From f0f0c1cbfad14e873a6708c80ebdde14305abdbc Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Tue, 12 Nov 2019 16:18:09 +0100 Subject: [PATCH] Built motion from commit (unavailable).|2.3.93 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- package.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 +- 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/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/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/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.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/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/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 +- 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/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/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 +- 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/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/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/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/index.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/migrations/2.3.93.js | 165 ++++++++++++++++++++ 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/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/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/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/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 +- 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/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/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/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 +- .../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 +- .../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/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 +- 1046 files changed, 1210 insertions(+), 1045 deletions(-) create mode 100644 server/migrations/2.3.93.js diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6c8ce42..c34fe46 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.3.92", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-08T17:11:49.256Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.3.93", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-12T15:12:23.198Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index fb88fd4..35fc26d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.3.92", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-08T17:11:49.256Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.3.93", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-11-12T15:12:23.198Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/package.json b/package.json index 41c709f..e4b249d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.3.92", + "version": "2.3.93", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 0fab0aa..a1a559f 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 _0x53ec=['getDataValue','action','contactManager','motionbar','jscripty','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL'];(function(_0xdf55fe,_0x172c71){var _0x2fc8e8=function(_0x19437e){while(--_0x19437e){_0xdf55fe['push'](_0xdf55fe['shift']());}};_0x2fc8e8(++_0x172c71);}(_0x53ec,0x192));var _0xc53e=function(_0x5e961f,_0x410eac){_0x5e961f=_0x5e961f-0x0;var _0x157371=_0x53ec[_0x5e961f];return _0x157371;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'get':function(_0x476d3a){return this[_0xc53e('0x3')](_0xc53e('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc53e('0x5'),'integration',_0xc53e('0x6'),_0xc53e('0x7'),'urlForward',_0xc53e('0x8'),'bot']],'msg':_0xc53e('0x9')}},'comment':_0xc53e('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc53e('0xa')},'data2':{'type':Sequelize[_0xc53e('0xb')](0x1000),'comment':_0xc53e('0xc')},'data3':{'type':Sequelize[_0xc53e('0xb')](0x1000),'comment':_0xc53e('0xd')},'data4':{'type':Sequelize[_0xc53e('0xb')](0x1000)},'data5':{'type':Sequelize[_0xc53e('0xb')](0x1000)},'data6':{'type':Sequelize[_0xc53e('0xb')]},'data7':{'type':Sequelize[_0xc53e('0xe')]}}; \ No newline at end of file +var _0xa630=['jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','getDataValue','STRING','integration','motionbar'];(function(_0x499b4c,_0x18a129){var _0x50874b=function(_0x55336d){while(--_0x55336d){_0x499b4c['push'](_0x499b4c['shift']());}};_0x50874b(++_0x18a129);}(_0xa630,0xbe));var _0x0a63=function(_0x4c9c34,_0x159f6c){_0x4c9c34=_0x4c9c34-0x0;var _0x6aa5dd=_0xa630[_0x4c9c34];return _0x6aa5dd;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52ad93){return this[_0x0a63('0x2')]('action');}},'action':{'type':Sequelize[_0x0a63('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0a63('0x4'),_0x0a63('0x5'),_0x0a63('0x6'),_0x0a63('0x7'),_0x0a63('0x8'),'bot']],'msg':_0x0a63('0x9')}},'comment':_0x0a63('0x9')},'data1':{'type':Sequelize[_0x0a63('0x3')](0x1000),'comment':_0x0a63('0xa')},'data2':{'type':Sequelize[_0x0a63('0x3')](0x1000),'comment':_0x0a63('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x0a63('0xc')},'data4':{'type':Sequelize[_0x0a63('0x3')](0x1000)},'data5':{'type':Sequelize[_0x0a63('0x3')](0x1000)},'data6':{'type':Sequelize[_0x0a63('0x3')]},'data7':{'type':Sequelize[_0x0a63('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index b20f2c7..1aba4fe 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 _0x0d2e=['reject','save','update','then','destroy','end','error','stack','name','send','body','find','params','catch','Action','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_0x0d2e,0x6d));var _0xe0d2=function(_0x49f374,_0x2b504d){_0x49f374=_0x49f374-0x0;var _0x23ff88=_0x0d2e[_0x49f374];return _0x23ff88;};'use strict';var pdf=require(_0xe0d2('0x0'));var emlformat=require(_0xe0d2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe0d2('0x2'));var rp=require('request-promise');var moment=require(_0xe0d2('0x3'));var BPromise=require(_0xe0d2('0x4'));var Mustache=require(_0xe0d2('0x5'));var util=require(_0xe0d2('0x6'));var path=require('path');var sox=require(_0xe0d2('0x7'));var csv=require(_0xe0d2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe0d2('0x9'));var squel=require(_0xe0d2('0xa'));var crypto=require(_0xe0d2('0xb'));var jsforce=require(_0xe0d2('0xc'));var deskjs=require(_0xe0d2('0xd'));var toCsv=require(_0xe0d2('0x8'));var querystring=require(_0xe0d2('0xe'));var Papa=require(_0xe0d2('0xf'));var authService=require(_0xe0d2('0x10'));var hardwareService=require(_0xe0d2('0x11'));var Redis=require(_0xe0d2('0x12'));var qs=require(_0xe0d2('0x13'));var logger=require(_0xe0d2('0x14'))(_0xe0d2('0x15'));var utils=require(_0xe0d2('0x16'));var config=require('../../config/environment');var db=require(_0xe0d2('0x17'))['db'];function respondWithStatusCode(_0x2be544,_0x3d6e5d){_0x3d6e5d=_0x3d6e5d||0xcc;return function(_0x21c8f3){if(_0x21c8f3){return _0x2be544[_0xe0d2('0x18')](_0x3d6e5d);}return _0x2be544['status'](_0x3d6e5d)['end']();};}function respondWithResult(_0x5a7cae,_0x18f6e8){_0x18f6e8=_0x18f6e8||0xc8;return function(_0x5dbbfb){if(_0x5dbbfb){return _0x5a7cae[_0xe0d2('0x19')](_0x18f6e8)[_0xe0d2('0x1a')](_0x5dbbfb);}};}function respondWithFilteredResult(_0x56abad,_0x52fd98){return function(_0x44a5e7){if(_0x44a5e7){var _0x4d27c9=_0x44a5e7['count'],_0x547e2c=_0x52fd98['offset'],_0x55dd22=_0x52fd98[_0xe0d2('0x1b')]+_0x52fd98[_0xe0d2('0x1c')],_0x2eade6;if(_0x55dd22>=_0x4d27c9){_0x55dd22=_0x4d27c9;_0x2eade6=0xc8;}else{_0x2eade6=0xce;}_0x56abad[_0xe0d2('0x19')](_0x2eade6);return _0x56abad[_0xe0d2('0x1d')](_0xe0d2('0x1e'),_0x547e2c+'-'+_0x55dd22+'/'+_0x4d27c9)[_0xe0d2('0x1a')](_0x44a5e7);}return null;};}function patchUpdates(_0x438532){return function(_0x4f3e4d){try{jsonpatch[_0xe0d2('0x1f')](_0x4f3e4d,_0x438532,!![]);}catch(_0x539700){return BPromise[_0xe0d2('0x20')](_0x539700);}return _0x4f3e4d[_0xe0d2('0x21')]();};}function saveUpdates(_0x3e19ad,_0x58c1b4){return function(_0x4b088a){if(_0x4b088a){return _0x4b088a[_0xe0d2('0x22')](_0x3e19ad)[_0xe0d2('0x23')](function(_0x1f6320){return _0x1f6320;});}return null;};}function removeEntity(_0x41e3c0,_0x4dd2d4){return function(_0x557983){if(_0x557983){return _0x557983[_0xe0d2('0x24')]()[_0xe0d2('0x23')](function(){_0x41e3c0[_0xe0d2('0x19')](0xcc)[_0xe0d2('0x25')]();});}};}function handleEntityNotFound(_0x570563,_0x8bc353){return function(_0x3aa662){if(!_0x3aa662){_0x570563[_0xe0d2('0x18')](0x194);}return _0x3aa662;};}function handleError(_0x1d5822,_0x1f7f30){_0x1f7f30=_0x1f7f30||0x1f4;return function(_0x10fe1c){logger[_0xe0d2('0x26')](_0x10fe1c[_0xe0d2('0x27')]);if(_0x10fe1c[_0xe0d2('0x28')]){delete _0x10fe1c['name'];}_0x1d5822[_0xe0d2('0x19')](_0x1f7f30)[_0xe0d2('0x29')](_0x10fe1c);};}exports[_0xe0d2('0x22')]=function(_0x8d6047,_0x4e9ae9){if(_0x8d6047[_0xe0d2('0x2a')]['id']){delete _0x8d6047[_0xe0d2('0x2a')]['id'];}return db['Action'][_0xe0d2('0x2b')]({'where':{'id':_0x8d6047[_0xe0d2('0x2c')]['id']}})[_0xe0d2('0x23')](handleEntityNotFound(_0x4e9ae9,null))[_0xe0d2('0x23')](saveUpdates(_0x8d6047['body'],null))[_0xe0d2('0x23')](respondWithResult(_0x4e9ae9,null))[_0xe0d2('0x2d')](handleError(_0x4e9ae9,null));};exports[_0xe0d2('0x24')]=function(_0x3733b1,_0x1fd5b6){return db[_0xe0d2('0x2e')][_0xe0d2('0x2b')]({'where':{'id':_0x3733b1[_0xe0d2('0x2c')]['id']}})[_0xe0d2('0x23')](handleEntityNotFound(_0x1fd5b6,null))[_0xe0d2('0x23')](removeEntity(_0x1fd5b6,null))['catch'](handleError(_0x1fd5b6,null));}; \ No newline at end of file +var _0x4378=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','body','Action','params','catch','destroy','find','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x1eff7c,_0x357ad0){var _0x304854=function(_0x27f760){while(--_0x27f760){_0x1eff7c['push'](_0x1eff7c['shift']());}};_0x304854(++_0x357ad0);}(_0x4378,0x126));var _0x8437=function(_0x5a9a9c,_0x2166c9){_0x5a9a9c=_0x5a9a9c-0x0;var _0x2e8b2c=_0x4378[_0x5a9a9c];return _0x2e8b2c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8437('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8437('0x1'));var rp=require(_0x8437('0x2'));var moment=require(_0x8437('0x3'));var BPromise=require(_0x8437('0x4'));var Mustache=require('mustache');var util=require(_0x8437('0x5'));var path=require('path');var sox=require(_0x8437('0x6'));var csv=require('to-csv');var ejs=require(_0x8437('0x7'));var fs=require('fs');var _=require(_0x8437('0x8'));var squel=require(_0x8437('0x9'));var crypto=require(_0x8437('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8437('0xb'));var toCsv=require(_0x8437('0xc'));var querystring=require(_0x8437('0xd'));var Papa=require(_0x8437('0xe'));var authService=require(_0x8437('0xf'));var hardwareService=require(_0x8437('0x10'));var Redis=require(_0x8437('0x11'));var qs=require(_0x8437('0x12'));var logger=require(_0x8437('0x13'))('api');var utils=require(_0x8437('0x14'));var config=require('../../config/environment');var db=require(_0x8437('0x15'))['db'];function respondWithStatusCode(_0x2040c1,_0x53b191){_0x53b191=_0x53b191||0xcc;return function(_0x461a48){if(_0x461a48){return _0x2040c1[_0x8437('0x16')](_0x53b191);}return _0x2040c1[_0x8437('0x17')](_0x53b191)[_0x8437('0x18')]();};}function respondWithResult(_0xbd3e51,_0x1616f7){_0x1616f7=_0x1616f7||0xc8;return function(_0x417b2d){if(_0x417b2d){return _0xbd3e51[_0x8437('0x17')](_0x1616f7)[_0x8437('0x19')](_0x417b2d);}};}function respondWithFilteredResult(_0x128f1d,_0x12bf78){return function(_0x914122){if(_0x914122){var _0x12bf32=_0x914122[_0x8437('0x1a')],_0x1002e9=_0x12bf78[_0x8437('0x1b')],_0x2569ae=_0x12bf78[_0x8437('0x1b')]+_0x12bf78['limit'],_0xececc;if(_0x2569ae>=_0x12bf32){_0x2569ae=_0x12bf32;_0xececc=0xc8;}else{_0xececc=0xce;}_0x128f1d[_0x8437('0x17')](_0xececc);return _0x128f1d[_0x8437('0x1c')](_0x8437('0x1d'),_0x1002e9+'-'+_0x2569ae+'/'+_0x12bf32)[_0x8437('0x19')](_0x914122);}return null;};}function patchUpdates(_0x9519a0){return function(_0x2733b9){try{jsonpatch[_0x8437('0x1e')](_0x2733b9,_0x9519a0,!![]);}catch(_0x569097){return BPromise[_0x8437('0x1f')](_0x569097);}return _0x2733b9[_0x8437('0x20')]();};}function saveUpdates(_0x382370,_0x302e6e){return function(_0x1d4843){if(_0x1d4843){return _0x1d4843[_0x8437('0x21')](_0x382370)[_0x8437('0x22')](function(_0x4fa0ff){return _0x4fa0ff;});}return null;};}function removeEntity(_0x5a5ddb,_0x58c5bc){return function(_0x4c0c7d){if(_0x4c0c7d){return _0x4c0c7d['destroy']()['then'](function(){_0x5a5ddb[_0x8437('0x17')](0xcc)[_0x8437('0x18')]();});}};}function handleEntityNotFound(_0x28ef37,_0x3c129b){return function(_0x408e37){if(!_0x408e37){_0x28ef37[_0x8437('0x16')](0x194);}return _0x408e37;};}function handleError(_0xb0142,_0xaf68fe){_0xaf68fe=_0xaf68fe||0x1f4;return function(_0x5466b9){logger['error'](_0x5466b9[_0x8437('0x23')]);if(_0x5466b9[_0x8437('0x24')]){delete _0x5466b9[_0x8437('0x24')];}_0xb0142[_0x8437('0x17')](_0xaf68fe)[_0x8437('0x25')](_0x5466b9);};}exports['update']=function(_0x85f0d8,_0x509f0e){if(_0x85f0d8['body']['id']){delete _0x85f0d8[_0x8437('0x26')]['id'];}return db[_0x8437('0x27')]['find']({'where':{'id':_0x85f0d8[_0x8437('0x28')]['id']}})[_0x8437('0x22')](handleEntityNotFound(_0x509f0e,null))['then'](saveUpdates(_0x85f0d8['body'],null))['then'](respondWithResult(_0x509f0e,null))[_0x8437('0x29')](handleError(_0x509f0e,null));};exports[_0x8437('0x2a')]=function(_0x2afedb,_0x1900d3){return db[_0x8437('0x27')][_0x8437('0x2b')]({'where':{'id':_0x2afedb[_0x8437('0x28')]['id']}})['then'](handleEntityNotFound(_0x1900d3,null))[_0x8437('0x22')](removeEntity(_0x1900d3,null))[_0x8437('0x29')](handleError(_0x1900d3,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e64f480..422ebee 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 _0x97b1=['util','../../config/logger','moment','bluebird','request-promise','exports','define','lodash'];(function(_0x3f69b7,_0x3946aa){var _0x415911=function(_0x1bc5a7){while(--_0x1bc5a7){_0x3f69b7['push'](_0x3f69b7['shift']());}};_0x415911(++_0x3946aa);}(_0x97b1,0x1a7));var _0x197b=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x97b1[_0x547e20];return _0x359171;};'use strict';var _=require(_0x197b('0x0'));var util=require(_0x197b('0x1'));var logger=require(_0x197b('0x2'))('api');var moment=require(_0x197b('0x3'));var BPromise=require(_0x197b('0x4'));var rp=require(_0x197b('0x5'));var attributes=require('./action.attributes');module[_0x197b('0x6')]=function(_0x271a1b,_0x1cc9d1){return _0x271a1b[_0x197b('0x7')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a20=['../../config/logger','api','./action.attributes','exports','define','tools_actions','lodash','util'];(function(_0x21a2da,_0x9f4c2b){var _0x3ff5da=function(_0x216564){while(--_0x216564){_0x21a2da['push'](_0x21a2da['shift']());}};_0x3ff5da(++_0x9f4c2b);}(_0x7a20,0x1de));var _0x07a2=function(_0x12d378,_0x57ce67){_0x12d378=_0x12d378-0x0;var _0x417058=_0x7a20[_0x12d378];return _0x417058;};'use strict';var _=require(_0x07a2('0x0'));var util=require(_0x07a2('0x1'));var logger=require(_0x07a2('0x2'))(_0x07a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x07a2('0x4'));module[_0x07a2('0x5')]=function(_0x1f2c19,_0x516f1d){return _0x1f2c19[_0x07a2('0x6')]('Action',attributes,{'tableName':_0x07a2('0x7'),'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 1f2e09c..ab68346 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 _0x379e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb'];(function(_0xa3d4e,_0x2f7432){var _0x10db75=function(_0x59ccf9){while(--_0x59ccf9){_0xa3d4e['push'](_0xa3d4e['shift']());}};_0x10db75(++_0x2f7432);}(_0x379e,0x104));var _0xe379=function(_0x4c33dc,_0xaa8d4c){_0x4c33dc=_0x4c33dc-0x0;var _0x25d30a=_0x379e[_0x4c33dc];return _0x25d30a;};'use strict';var _=require(_0xe379('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe379('0x1'));var fs=require('fs');var Redis=require(_0xe379('0x2'));var db=require(_0xe379('0x3'))['db'];var utils=require(_0xe379('0x4'));var logger=require(_0xe379('0x5'))(_0xe379('0x6'));var config=require(_0xe379('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe379('0x8')][_0xe379('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x166621,_0x1b6fed,_0x22cb37){return new BPromise(function(_0x5475e7,_0x10acc9){return client[_0xe379('0xa')](_0x166621,_0x22cb37)[_0xe379('0xb')](function(_0x21ce22){logger[_0xe379('0xc')](_0xe379('0xd'),_0x1b6fed,_0xe379('0xe'));logger[_0xe379('0xf')](_0xe379('0x10'),_0x1b6fed,'request\x20sent',JSON[_0xe379('0x11')](_0x21ce22));if(_0x21ce22[_0xe379('0x12')]){if(_0x21ce22[_0xe379('0x12')][_0xe379('0x13')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x1b6fed,_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);return _0x10acc9(_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);}logger[_0xe379('0x12')](_0xe379('0xd'),_0x1b6fed,_0x21ce22[_0xe379('0x12')][_0xe379('0x14')]);return _0x5475e7(_0x21ce22['error'][_0xe379('0x14')]);}else{logger[_0xe379('0xc')](_0xe379('0xd'),_0x1b6fed,_0xe379('0xe'));_0x5475e7(_0x21ce22[_0xe379('0x15')][_0xe379('0x14')]);}})['catch'](function(_0x2615bd){logger['error'](_0xe379('0xd'),_0x1b6fed,_0x2615bd);_0x10acc9(_0x2615bd);});});} \ No newline at end of file +var _0x7d86=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x46ebfe,_0x2cc0f1){var _0x371d78=function(_0x45eacf){while(--_0x45eacf){_0x46ebfe['push'](_0x46ebfe['shift']());}};_0x371d78(++_0x2cc0f1);}(_0x7d86,0x86));var _0x67d8=function(_0x3d517e,_0x3cdbd0){_0x3d517e=_0x3d517e-0x0;var _0x2ad562=_0x7d86[_0x3d517e];return _0x2ad562;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2485fa,_0x282b7a,_0x30c690){return new BPromise(function(_0x16e834,_0x31726a){return client[_0x67d8('0xc')](_0x2485fa,_0x30c690)[_0x67d8('0xd')](function(_0x6bc54c){logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));logger[_0x67d8('0x11')](_0x67d8('0x12'),_0x282b7a,_0x67d8('0x10'),JSON[_0x67d8('0x13')](_0x6bc54c));if(_0x6bc54c[_0x67d8('0x14')]){if(_0x6bc54c[_0x67d8('0x14')]['code']===0x1f4){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')]['message']);return _0x31726a(_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);}logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x6bc54c[_0x67d8('0x14')][_0x67d8('0x15')]);return _0x16e834(_0x6bc54c[_0x67d8('0x14')]['message']);}else{logger[_0x67d8('0xe')](_0x67d8('0xf'),_0x282b7a,_0x67d8('0x10'));_0x16e834(_0x6bc54c['result'][_0x67d8('0x15')]);}})[_0x67d8('0x16')](function(_0x4b2795){logger[_0x67d8('0x14')](_0x67d8('0xf'),_0x282b7a,_0x4b2795);_0x31726a(_0x4b2795);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e67f00a..866d3c1 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 _0x0565=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x49dafd,_0x1a360a){var _0xb6a296=function(_0x30d30a){while(--_0x30d30a){_0x49dafd['push'](_0x49dafd['shift']());}};_0xb6a296(++_0x1a360a);}(_0x0565,0xf2));var _0x5056=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0565[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var auth=require(_0x5056('0x6'));var interaction=require(_0x5056('0x7'));var config=require(_0x5056('0x8'));var controller=require(_0x5056('0x9'));router['put'](_0x5056('0xa'),auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5056('0xe')]);module[_0x5056('0xf')]=router; \ No newline at end of file +var _0x8286=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','destroy','multer','util','path'];(function(_0x23c13f,_0x544c4d){var _0x483a61=function(_0x49eb24){while(--_0x49eb24){_0x23c13f['push'](_0x23c13f['shift']());}};_0x483a61(++_0x544c4d);}(_0x8286,0x66));var _0x6828=function(_0x1aeecc,_0x328743){_0x1aeecc=_0x1aeecc-0x0;var _0x461027=_0x8286[_0x1aeecc];return _0x461027;};'use strict';var multer=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var path=require(_0x6828('0x2'));var timeout=require(_0x6828('0x3'));var express=require(_0x6828('0x4'));var router=express[_0x6828('0x5')]();var auth=require(_0x6828('0x6'));var interaction=require(_0x6828('0x7'));var config=require(_0x6828('0x8'));var controller=require(_0x6828('0x9'));router[_0x6828('0xa')]('/:id',auth[_0x6828('0xb')](),controller[_0x6828('0xc')]);router['delete'](_0x6828('0xd'),auth[_0x6828('0xb')](),controller[_0x6828('0xe')]);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 cb449d8..566d526 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 _0x9318=['STRING','TEXT','sequelize','exports'];(function(_0x3cf070,_0x4c430e){var _0x3d835c=function(_0x45116d){while(--_0x45116d){_0x3cf070['push'](_0x3cf070['shift']());}};_0x3d835c(++_0x4c430e);}(_0x9318,0x1f2));var _0x8931=function(_0x5f445c,_0x42725b){_0x5f445c=_0x5f445c-0x0;var _0x4b44cf=_0x9318[_0x5f445c];return _0x4b44cf;};'use strict';var Sequelize=require(_0x8931('0x0'));module[_0x8931('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8931('0x2')]},'parent':{'type':Sequelize[_0x8931('0x2')]},'table':{'type':Sequelize[_0x8931('0x2')]},'conditions':{'type':Sequelize[_0x8931('0x3')]},'joins':{'type':Sequelize[_0x8931('0x3')]}}; \ No newline at end of file +var _0x384a=['TEXT','sequelize','STRING'];(function(_0x1efc2a,_0x366666){var _0x39a9ae=function(_0x2cf3ec){while(--_0x2cf3ec){_0x1efc2a['push'](_0x1efc2a['shift']());}};_0x39a9ae(++_0x366666);}(_0x384a,0xeb));var _0xa384=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x384a[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0xa384('0x0'));module['exports']={'name':{'type':Sequelize[_0xa384('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa384('0x1')]},'parent':{'type':Sequelize[_0xa384('0x1')]},'table':{'type':Sequelize[_0xa384('0x1')]},'conditions':{'type':Sequelize[_0xa384('0x2')]},'joins':{'type':Sequelize[_0xa384('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e05bc2c..6ca0a98 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 _0x9f3e=['destroy','then','CustomReports','sendStatus','stack','name','send','AnalyticCustomReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','find','body','user','get','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','IS\x20EMPTY','operator','condition','AnalyticMetric','groupBy','Sequelize','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','metric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update'];(function(_0x1334f5,_0x419cb5){var _0x4c0747=function(_0x24bc11){while(--_0x24bc11){_0x1334f5['push'](_0x1334f5['shift']());}};_0x4c0747(++_0x419cb5);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x2cc0e1,_0x368f2c){_0x2cc0e1=_0x2cc0e1-0x0;var _0xbaf069=_0x9f3e[_0x2cc0e1];return _0xbaf069;};'use strict';var pdf=require(_0xe9f3('0x0'));var emlformat=require(_0xe9f3('0x1'));var rimraf=require(_0xe9f3('0x2'));var zipdir=require(_0xe9f3('0x3'));var jsonpatch=require(_0xe9f3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f3('0x5'));var util=require('util');var path=require(_0xe9f3('0x6'));var sox=require(_0xe9f3('0x7'));var csv=require(_0xe9f3('0x8'));var ejs=require(_0xe9f3('0x9'));var fs=require('fs');var _=require(_0xe9f3('0xa'));var squel=require(_0xe9f3('0xb'));var crypto=require(_0xe9f3('0xc'));var jsforce=require(_0xe9f3('0xd'));var deskjs=require(_0xe9f3('0xe'));var toCsv=require(_0xe9f3('0x8'));var querystring=require(_0xe9f3('0xf'));var Papa=require(_0xe9f3('0x10'));var authService=require(_0xe9f3('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe9f3('0x12'));var qs=require(_0xe9f3('0x13'));var logger=require(_0xe9f3('0x14'))(_0xe9f3('0x15'));var utils=require(_0xe9f3('0x16'));var config=require('../../config/environment');var db=require(_0xe9f3('0x17'))['db'];function respondWithStatusCode(_0x4759ab,_0x5150fc){_0x5150fc=_0x5150fc||0xcc;return function(_0x1865a6){if(_0x1865a6){return _0x4759ab['sendStatus'](_0x5150fc);}return _0x4759ab[_0xe9f3('0x18')](_0x5150fc)[_0xe9f3('0x19')]();};}function respondWithResult(_0x37f1b3,_0x596467){_0x596467=_0x596467||0xc8;return function(_0x5501fe){if(_0x5501fe){return _0x37f1b3[_0xe9f3('0x18')](_0x596467)[_0xe9f3('0x1a')](_0x5501fe);}};}function respondWithFilteredResult(_0x5ec77b,_0x393d6b){return function(_0x1f0dd9){if(_0x1f0dd9){var _0x2d6c96=_0x1f0dd9['count'],_0x25abdc=_0x393d6b[_0xe9f3('0x1b')],_0x45cfd5=_0x393d6b[_0xe9f3('0x1b')]+_0x393d6b[_0xe9f3('0x1c')],_0x5a8ea2;if(_0x45cfd5>=_0x2d6c96){_0x45cfd5=_0x2d6c96;_0x5a8ea2=0xc8;}else{_0x5a8ea2=0xce;}_0x5ec77b[_0xe9f3('0x18')](_0x5a8ea2);return _0x5ec77b[_0xe9f3('0x1d')]('Content-Range',_0x25abdc+'-'+_0x45cfd5+'/'+_0x2d6c96)[_0xe9f3('0x1a')](_0x1f0dd9);}return null;};}function patchUpdates(_0x3df9a5){return function(_0x570dc0){try{jsonpatch[_0xe9f3('0x1e')](_0x570dc0,_0x3df9a5,!![]);}catch(_0x679a80){return BPromise[_0xe9f3('0x1f')](_0x679a80);}return _0x570dc0[_0xe9f3('0x20')]();};}function saveUpdates(_0x1ab9c9,_0xd918b9){return function(_0x3866cc){if(_0x3866cc){return _0x3866cc[_0xe9f3('0x21')](_0x1ab9c9)['then'](function(_0x312b89){return _0x312b89;});}return null;};}function removeEntity(_0x39d82e,_0x10118e){return function(_0x514ddc){if(_0x514ddc){return _0x514ddc[_0xe9f3('0x22')]()[_0xe9f3('0x23')](function(){var _0x38a909=_0x514ddc['get']({'plain':!![]});var _0x4f9cdd=_0xe9f3('0x24');return db['UserProfileResource'][_0xe9f3('0x22')]({'where':{'type':_0x4f9cdd,'resourceId':_0x38a909['id']}})['then'](function(){return _0x514ddc;});})[_0xe9f3('0x23')](function(){_0x39d82e[_0xe9f3('0x18')](0xcc)[_0xe9f3('0x19')]();});}};}function handleEntityNotFound(_0x2e959a,_0x381300){return function(_0x40c7c2){if(!_0x40c7c2){_0x2e959a[_0xe9f3('0x25')](0x194);}return _0x40c7c2;};}function handleError(_0x5e518a,_0x3de723){_0x3de723=_0x3de723||0x1f4;return function(_0x144af0){logger['error'](_0x144af0[_0xe9f3('0x26')]);if(_0x144af0[_0xe9f3('0x27')]){delete _0x144af0[_0xe9f3('0x27')];}_0x5e518a[_0xe9f3('0x18')](_0x3de723)[_0xe9f3('0x28')](_0x144af0);};}exports['index']=function(_0x54b315,_0x2a8e22){var _0x489ff2={},_0x2fff80={},_0x421b9f={'count':0x0,'rows':[]};var _0x2b33de=db[_0xe9f3('0x29')][_0xe9f3('0x2a')];_0x2fff80[_0xe9f3('0x2b')]=_[_0xe9f3('0x2c')](_0x2b33de);_0x2fff80[_0xe9f3('0x2d')]=_[_0xe9f3('0x2c')](_0x54b315[_0xe9f3('0x2d')]);_0x2fff80['filters']=_[_0xe9f3('0x2e')](_0x2fff80[_0xe9f3('0x2b')],_0x2fff80[_0xe9f3('0x2d')]);_0x489ff2[_0xe9f3('0x2f')]=_['intersection'](_0x2fff80[_0xe9f3('0x2b')],qs[_0xe9f3('0x30')](_0x54b315[_0xe9f3('0x2d')][_0xe9f3('0x30')]));_0x489ff2['attributes']=_0x489ff2['attributes'][_0xe9f3('0x31')]?_0x489ff2[_0xe9f3('0x2f')]:_0x2fff80['model'];if(!_0x54b315[_0xe9f3('0x2d')][_0xe9f3('0x32')]('nolimit')){_0x489ff2[_0xe9f3('0x1c')]=qs['limit'](_0x54b315['query'][_0xe9f3('0x1c')]);_0x489ff2['offset']=qs['offset'](_0x54b315['query'][_0xe9f3('0x1b')]);}_0x489ff2[_0xe9f3('0x33')]=qs['sort'](_0x54b315[_0xe9f3('0x2d')][_0xe9f3('0x34')]);_0x489ff2[_0xe9f3('0x35')]=qs[_0xe9f3('0x36')](_[_0xe9f3('0x37')](_0x54b315[_0xe9f3('0x2d')],_0x2fff80['filters']));if(_0x54b315[_0xe9f3('0x2d')][_0xe9f3('0x38')]){_0x489ff2[_0xe9f3('0x35')]=_[_0xe9f3('0x39')](_0x489ff2['where'],{'$or':_['map'](_0x2b33de,function(_0x1fa582){if(_0x1fa582[_0xe9f3('0x3a')][_0xe9f3('0x3b')]!==_0xe9f3('0x3c')){var _0xe0dbc8={};_0xe0dbc8[_0x1fa582[_0xe9f3('0x3d')]]={'$like':'%'+_0x54b315[_0xe9f3('0x2d')][_0xe9f3('0x38')]+'%'};return _0xe0dbc8;}})});}_0x489ff2=_['merge']({},_0x489ff2,_0x54b315[_0xe9f3('0x3e')]);var _0xd02eea={'where':_0x489ff2[_0xe9f3('0x35')]};return db[_0xe9f3('0x29')][_0xe9f3('0x3f')](_0xd02eea)[_0xe9f3('0x23')](function(_0xfb1a78){_0x421b9f[_0xe9f3('0x3f')]=_0xfb1a78;if(_0x54b315[_0xe9f3('0x2d')]['includeAll']){_0x489ff2[_0xe9f3('0x40')]=[{'all':!![]}];}return db[_0xe9f3('0x29')][_0xe9f3('0x41')](_0x489ff2);})[_0xe9f3('0x23')](function(_0x29ab37){_0x421b9f[_0xe9f3('0x42')]=_0x29ab37;return _0x421b9f;})[_0xe9f3('0x23')](respondWithFilteredResult(_0x2a8e22,_0x489ff2))[_0xe9f3('0x43')](handleError(_0x2a8e22,null));};exports[_0xe9f3('0x44')]=function(_0xb11d82,_0x517de2){var _0x139882={'raw':![],'where':{'id':_0xb11d82['params']['id']}},_0xc70b48={};_0xc70b48[_0xe9f3('0x2b')]=_[_0xe9f3('0x2c')](db['AnalyticCustomReport'][_0xe9f3('0x2a')]);_0xc70b48[_0xe9f3('0x2d')]=_['keys'](_0xb11d82[_0xe9f3('0x2d')]);_0xc70b48[_0xe9f3('0x36')]=_['intersection'](_0xc70b48[_0xe9f3('0x2b')],_0xc70b48[_0xe9f3('0x2d')]);_0x139882[_0xe9f3('0x2f')]=_[_0xe9f3('0x2e')](_0xc70b48[_0xe9f3('0x2b')],qs[_0xe9f3('0x30')](_0xb11d82[_0xe9f3('0x2d')][_0xe9f3('0x30')]));_0x139882['attributes']=_0x139882['attributes']['length']?_0x139882[_0xe9f3('0x2f')]:_0xc70b48[_0xe9f3('0x2b')];if(_0xb11d82[_0xe9f3('0x2d')]['includeAll']){_0x139882[_0xe9f3('0x40')]=[{'all':!![]}];}_0x139882=_[_0xe9f3('0x39')]({},_0x139882,_0xb11d82[_0xe9f3('0x3e')]);return db[_0xe9f3('0x29')][_0xe9f3('0x45')](_0x139882)[_0xe9f3('0x23')](handleEntityNotFound(_0x517de2,null))[_0xe9f3('0x23')](respondWithResult(_0x517de2,null))[_0xe9f3('0x43')](handleError(_0x517de2,null));};exports['create']=function(_0x37973b,_0x940db8){return db['AnalyticCustomReport']['create'](_0x37973b[_0xe9f3('0x46')],{})['then'](function(_0x3cd2d7){var _0x371e77=_0x37973b['user']['get']({'plain':!![]});if(!_0x371e77)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x371e77['role']===_0xe9f3('0x47')){var _0x130c2b=_0x3cd2d7[_0xe9f3('0x48')]({'plain':!![]});var _0x369c97='Reports';return db[_0xe9f3('0x49')][_0xe9f3('0x45')]({'where':{'name':_0x369c97,'userProfileId':_0x371e77['userProfileId']},'raw':!![]})['then'](function(_0xa8161c){if(_0xa8161c&&_0xa8161c[_0xe9f3('0x4a')]===0x0){return db[_0xe9f3('0x4b')][_0xe9f3('0x4c')]({'name':_0x130c2b[_0xe9f3('0x27')],'resourceId':_0x130c2b['id'],'type':_0xe9f3('0x24'),'sectionId':_0xa8161c['id']},{})['then'](function(){return _0x3cd2d7;});}else{return _0x3cd2d7;}})[_0xe9f3('0x43')](function(_0x207621){logger['error'](_0xe9f3('0x4d'),_0x207621);throw _0x207621;});}return _0x3cd2d7;})[_0xe9f3('0x23')](respondWithResult(_0x940db8,0xc9))[_0xe9f3('0x43')](handleError(_0x940db8,null));};exports[_0xe9f3('0x21')]=function(_0x8114c8,_0x11411a){if(_0x8114c8[_0xe9f3('0x46')]['id']){delete _0x8114c8[_0xe9f3('0x46')]['id'];}return db[_0xe9f3('0x29')][_0xe9f3('0x45')]({'where':{'id':_0x8114c8['params']['id']}})[_0xe9f3('0x23')](handleEntityNotFound(_0x11411a,null))[_0xe9f3('0x23')](saveUpdates(_0x8114c8[_0xe9f3('0x46')],null))['then'](respondWithResult(_0x11411a,null))[_0xe9f3('0x43')](handleError(_0x11411a,null));};exports[_0xe9f3('0x22')]=function(_0x14d4c6,_0x5e3e7f){return db[_0xe9f3('0x29')][_0xe9f3('0x45')]({'where':{'id':_0x14d4c6[_0xe9f3('0x4e')]['id']}})[_0xe9f3('0x23')](handleEntityNotFound(_0x5e3e7f,null))[_0xe9f3('0x23')](removeEntity(_0x5e3e7f,null))[_0xe9f3('0x43')](handleError(_0x5e3e7f,null));};exports[_0xe9f3('0x4f')]=function(_0x27cbc1,_0x12865d){var _0xa875c3=0xa;var _0x10e311=['join',_0xe9f3('0x50'),_0xe9f3('0x51'),_0xe9f3('0x52')];var _0x255aa4={'SUM':_0xe9f3('0x53'),'COUNT':_0xe9f3('0x54'),'COUNT DISTINCT':_0xe9f3('0x55'),'MAX':'MAX(%s)','MIN':_0xe9f3('0x56'),'AVG':_0xe9f3('0x57'),'GROUP_CONCAT':_0xe9f3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe9f3('0x59')};var _0x2325ab={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe9f3('0x5a'),'UNIX_TIMESTAMP':_0xe9f3('0x5b')};var _0x12fec2=function(_0x211714){return!_[_0xe9f3('0x5c')]([_0xe9f3('0x5d'),_0xe9f3('0x5e'),'IS\x20EMPTY',_0xe9f3('0x5f')],_0x211714);};var _0xf68ad7=function(_0x36e246){if(!_0x36e246||!_0x36e246[_0xe9f3('0x60')][_0xe9f3('0x31')]){return'';}for(var _0x594845='(',_0x44cdd6=0x0;_0x44cdd6<_0x36e246['rules'][_0xe9f3('0x31')];_0x44cdd6+=0x1){_0x44cdd6>0x0&&(_0x594845+='\x20'+_0x36e246['operator']+'\x20');_0x594845+=_0x36e246['rules'][_0x44cdd6][_0xe9f3('0x61')]?_0xf68ad7(_0x36e246[_0xe9f3('0x60')][_0x44cdd6]['group']):_0x36e246[_0xe9f3('0x60')][_0x44cdd6]['field']+'\x20'+_0x36e246[_0xe9f3('0x60')][_0x44cdd6]['condition']+(_0x12fec2(_0x36e246[_0xe9f3('0x60')][_0x44cdd6]['condition'])?'\x20'+_0x36e246[_0xe9f3('0x60')][_0x44cdd6][_0xe9f3('0x62')]:'');}return _0x594845+')';};var _0x3aec72={'where':{'id':_0x27cbc1[_0xe9f3('0x4e')]['id']}},_0x43b839,_0x34b254,_0x2dd0ab,_0xe3bb87,_0xd21631;_0x3aec72=_[_0xe9f3('0x39')]({},_0x3aec72,_0x27cbc1['options']);return db[_0xe9f3('0x29')]['find'](_0x3aec72)[_0xe9f3('0x23')](function(_0x3f7cc8){if(_0x3f7cc8){_0x43b839=_0x3f7cc8;return _0x3f7cc8[_0xe9f3('0x63')]();}return null;})[_0xe9f3('0x23')](function(_0x2ef954){if(_0x2ef954){if(!_0x2ef954[_0xe9f3('0x31')]){throw new db['Sequelize'][(_0xe9f3('0x64'))](_0xe9f3('0x65'),0x193);}_0x34b254=_0x2ef954;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe9f3('0x23')](function(_0x22a17c){if(_0x22a17c){_0x2dd0ab=_[_0xe9f3('0x66')](_0x22a17c,'id');var _0x553493;var _0x2a14cd=squel[_0xe9f3('0x67')]();_0x2a14cd[_0xe9f3('0x68')](_0x43b839[_0xe9f3('0x69')]);for(var _0x306bb5=0x0;_0x306bb5<_0x34b254[_0xe9f3('0x31')];_0x306bb5+=0x1){_0x553493=_0x34b254[_0x306bb5][_0xe9f3('0x6a')]?_0x2dd0ab[_0x34b254[_0x306bb5][_0xe9f3('0x6a')]]['metric']:_0x34b254[_0x306bb5][_0xe9f3('0x3d')];_0x553493=_0x34b254[_0x306bb5][_0xe9f3('0x6b')]?_[_0xe9f3('0x6c')](_0x255aa4[_0x34b254[_0x306bb5][_0xe9f3('0x6b')]],'%s',_0x553493):_0x553493;_0x553493=_0x34b254[_0x306bb5][_0xe9f3('0x6d')]?_[_0xe9f3('0x6c')](_0x2325ab[_0x34b254[_0x306bb5][_0xe9f3('0x6d')]],'%s',_0x553493):_0x553493;if(_0x34b254[_0x306bb5]['groupBy']){_0x2a14cd[_0xe9f3('0x61')](_0x553493);}_0x34b254[_0x306bb5][_0xe9f3('0x6e')]&&_0x2a14cd['order'](_0x553493,_0x34b254[_0x306bb5][_0xe9f3('0x6e')]===_0xe9f3('0x6f')?![]:!![]);_0x2a14cd['field'](_0x553493,_0x34b254[_0x306bb5][_0xe9f3('0x70')]||_0x553493);}if(_0x43b839[_0xe9f3('0x71')]){_0x43b839[_0xe9f3('0x71')]=JSON[_0xe9f3('0x72')](_0x43b839['joins']);for(var _0xbb0247=0x0;_0xbb0247<_0x43b839[_0xe9f3('0x71')][_0xe9f3('0x31')];_0xbb0247+=0x1){if(_0x43b839['joins'][_0xbb0247][_0xe9f3('0x3a')]&&_[_0xe9f3('0x5c')](_0x10e311,_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x3a')])&&_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x73')]&&_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x74')]&&_0x43b839[_0xe9f3('0x71')][_0xbb0247]['foreignKey']){_0x2a14cd[_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x3a')]](_0x43b839[_0xe9f3('0x71')][_0xbb0247]['foreignTable'],null,util[_0xe9f3('0x6d')](_0xe9f3('0x75'),_0x43b839[_0xe9f3('0x69')],_0x43b839['joins'][_0xbb0247][_0xe9f3('0x73')],_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x74')],_0x43b839[_0xe9f3('0x71')][_0xbb0247][_0xe9f3('0x76')]));}}}if(_0x43b839[_0xe9f3('0x77')]){_0x43b839[_0xe9f3('0x77')]=JSON[_0xe9f3('0x72')](_0x43b839[_0xe9f3('0x77')]);_0x2a14cd[_0xe9f3('0x35')](_0xf68ad7(_0x43b839[_0xe9f3('0x77')][_0xe9f3('0x61')]));}_0xd21631=_0x2a14cd[_0xe9f3('0x78')]();_0x2a14cd[_0xe9f3('0x1c')](_0xa875c3);_0x2a14cd[_0xe9f3('0x1b')](0x0);logger[_0xe9f3('0x79')](_0xe9f3('0x7a'),_0x2a14cd[_0xe9f3('0x7b')]());return db['sequelize'][_0xe9f3('0x2d')](_0x2a14cd[_0xe9f3('0x7b')](),{'type':db[_0xe9f3('0x7c')][_0xe9f3('0x7d')][_0xe9f3('0x7e')]});}})[_0xe9f3('0x23')](respondWithResult(_0x12865d,null))['catch'](handleError(_0x12865d,null));};function runReport(_0x384e3b,_0x1c9cef,_0x202e21){var _0x44e80b=_0x1c9cef[_0xe9f3('0x27')];var _0x535491=0xa;var _0x3207f1=[_0xe9f3('0x7f'),_0xe9f3('0x50'),_0xe9f3('0x51'),_0xe9f3('0x52')];var _0x390714={'SUM':_0xe9f3('0x53'),'COUNT':_0xe9f3('0x54'),'COUNT DISTINCT':_0xe9f3('0x55'),'MAX':_0xe9f3('0x80'),'MIN':_0xe9f3('0x56'),'AVG':_0xe9f3('0x57'),'GROUP_CONCAT':_0xe9f3('0x58'),'GROUP_CONCAT ASC':_0xe9f3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34ccb5={'SEC_TO_TIME':_0xe9f3('0x82'),'DATE':_0xe9f3('0x83'),'HOUR':_0xe9f3('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x572c5f=function(_0x30fdbf){return!_[_0xe9f3('0x5c')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe9f3('0x85'),_0xe9f3('0x5f')],_0x30fdbf);};var _0x4cba6b=function(_0x40bbd4){if(!_0x40bbd4||!_0x40bbd4[_0xe9f3('0x60')]['length']){return'';}for(var _0x143e59='(',_0x17ea27=0x0;_0x17ea27<_0x40bbd4[_0xe9f3('0x60')][_0xe9f3('0x31')];_0x17ea27+=0x1){_0x17ea27>0x0&&(_0x143e59+='\x20'+_0x40bbd4[_0xe9f3('0x86')]+'\x20');_0x143e59+=_0x40bbd4['rules'][_0x17ea27][_0xe9f3('0x61')]?_0x4cba6b(_0x40bbd4['rules'][_0x17ea27][_0xe9f3('0x61')]):_0x40bbd4['rules'][_0x17ea27][_0xe9f3('0x3d')]+'\x20'+_0x40bbd4['rules'][_0x17ea27]['condition']+(_0x572c5f(_0x40bbd4[_0xe9f3('0x60')][_0x17ea27][_0xe9f3('0x87')])?'\x20'+_0x40bbd4['rules'][_0x17ea27]['value']:'');}return _0x143e59+')';};var _0x16c16a={'where':{'id':_0x384e3b['id']}},_0x3f905e,_0x3e9548,_0x3d6b65,_0x2b0a7e,_0x322b65;_0x16c16a=_[_0xe9f3('0x39')]({},_0x16c16a,_0x202e21);return db[_0xe9f3('0x29')][_0xe9f3('0x45')](_0x16c16a)[_0xe9f3('0x23')](function(_0x564d8f){if(_0x564d8f){_0x3f905e=_0x564d8f;return _0x564d8f[_0xe9f3('0x63')]();}return null;})[_0xe9f3('0x23')](function(_0x2d6483){if(_0x2d6483){if(!_0x2d6483[_0xe9f3('0x31')]){throw new db['Sequelize'][(_0xe9f3('0x64'))](_0xe9f3('0x65'),0x193);}_0x3e9548=_0x2d6483;return db[_0xe9f3('0x88')][_0xe9f3('0x41')]({'raw':!![]});}return null;})[_0xe9f3('0x23')](function(_0x54603c){if(_0x54603c){_0x3d6b65=_['keyBy'](_0x54603c,'id');var _0x59307c;var _0x3219a0=squel[_0xe9f3('0x67')]();_0x3219a0[_0xe9f3('0x68')](_0x3f905e['table']);for(var _0x3e5b39=0x0;_0x3e5b39<_0x3e9548[_0xe9f3('0x31')];_0x3e5b39+=0x1){_0x59307c=_0x3e9548[_0x3e5b39][_0xe9f3('0x6a')]?_0x3d6b65[_0x3e9548[_0x3e5b39][_0xe9f3('0x6a')]]['metric']:_0x3e9548[_0x3e5b39]['field'];_0x59307c=_0x3e9548[_0x3e5b39][_0xe9f3('0x6b')]?_['replace'](_0x390714[_0x3e9548[_0x3e5b39]['function']],'%s',_0x59307c):_0x59307c;_0x59307c=_0x3e9548[_0x3e5b39][_0xe9f3('0x6d')]?_['replace'](_0x34ccb5[_0x3e9548[_0x3e5b39][_0xe9f3('0x6d')]],'%s',_0x59307c):_0x59307c;if(_0x3e9548[_0x3e5b39][_0xe9f3('0x89')]){_0x3219a0[_0xe9f3('0x61')](_0x59307c);}_0x3e9548[_0x3e5b39][_0xe9f3('0x6e')]&&_0x3219a0['order'](_0x59307c,_0x3e9548[_0x3e5b39]['orderBy']==='DESC'?![]:!![]);_0x3219a0['field'](_0x59307c,_0x3e9548[_0x3e5b39][_0xe9f3('0x70')]||_0x59307c);}if(_0x3f905e[_0xe9f3('0x71')]){_0x3f905e[_0xe9f3('0x71')]=JSON['parse'](_0x3f905e[_0xe9f3('0x71')]);for(var _0x2ae81f=0x0;_0x2ae81f<_0x3f905e[_0xe9f3('0x71')]['length'];_0x2ae81f+=0x1){if(_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x3a')]&&_['includes'](_0x3207f1,_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x3a')])&&_0x3f905e['joins'][_0x2ae81f][_0xe9f3('0x73')]&&_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x74')]&&_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x76')]){_0x3219a0[_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x3a')]](_0x3f905e[_0xe9f3('0x71')][_0x2ae81f][_0xe9f3('0x74')],null,util['format'](_0xe9f3('0x75'),_0x3f905e[_0xe9f3('0x69')],_0x3f905e['joins'][_0x2ae81f]['parentKey'],_0x3f905e[_0xe9f3('0x71')][_0x2ae81f]['foreignTable'],_0x3f905e['joins'][_0x2ae81f]['foreignKey']));}}}if(_0x3f905e[_0xe9f3('0x77')]){_0x3f905e[_0xe9f3('0x77')]=JSON[_0xe9f3('0x72')](_0x3f905e[_0xe9f3('0x77')]);_0x3219a0[_0xe9f3('0x35')](_0x4cba6b(_0x3f905e[_0xe9f3('0x77')][_0xe9f3('0x61')]));}_0x322b65=_0x3219a0[_0xe9f3('0x78')]();_0x3219a0[_0xe9f3('0x1c')](_0x535491);_0x3219a0['offset'](0x0);logger[_0xe9f3('0x79')]('Limited\x20Query:',_0x3219a0[_0xe9f3('0x7b')]());return db[_0xe9f3('0x7c')][_0xe9f3('0x2d')](_0x3219a0[_0xe9f3('0x7b')](),{'type':db[_0xe9f3('0x7c')][_0xe9f3('0x7d')][_0xe9f3('0x7e')]});}})['then'](function(_0x4ea923){if(!_0x4ea923[_0xe9f3('0x31')]){throw new db[(_0xe9f3('0x8a'))][(_0xe9f3('0x64'))](_0xe9f3('0x8b'),0xcc);}if(_0x1c9cef[_0xe9f3('0x8c')]===_0xe9f3('0x8d')){return null;}var _0x57b28e=_['merge'](_0x1c9cef,{'name':_0x1c9cef[_0xe9f3('0x8e')]||_0x1c9cef[_0xe9f3('0x27')]||_0x3f905e['name'],'basename':_0x44e80b,'savename':util['format'](_0xe9f3('0x8f'),_0x1c9cef[_0xe9f3('0x27')]||_0x3f905e[_0xe9f3('0x27')],require(_0xe9f3('0x90'))[_0xe9f3('0x91')](0x4),_0x1c9cef[_0xe9f3('0x8c')]||_0xe9f3('0x92')),'reportId':_0x3f905e['id'],'reportType':_0xe9f3('0x93')});return db[_0xe9f3('0x94')]['create'](_0x57b28e,{'raw':!![]});})[_0xe9f3('0x23')](function(_0x523613){if(_0x3f905e['table']===_0xe9f3('0x95')){_0x322b65[_0xe9f3('0x35')](_0x3f905e[_0xe9f3('0x69')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1c9cef[_0xe9f3('0x96')],_0x1c9cef[_0xe9f3('0x97')]);}else{_0x322b65['where'](_0x3f905e[_0xe9f3('0x69')]+_0xe9f3('0x98'),_0x1c9cef['startDate'],_0x1c9cef[_0xe9f3('0x97')]);}if(_0x523613){logger[_0xe9f3('0x99')](_0xe9f3('0x9a'),_0x322b65[_0xe9f3('0x7b')]());require('child_process')[_0xe9f3('0x9b')](path['join'](__dirname,_0xe9f3('0x9c'),_0x523613[_0xe9f3('0x8c')]),[_0x523613['id'],_0x322b65[_0xe9f3('0x7b')](),path[_0xe9f3('0x7f')](__dirname,_0xe9f3('0x9d'),_0x523613[_0xe9f3('0x9e')]),_0x44e80b]);return _0x523613;}else{var _0x1f2997=squel[_0xe9f3('0x67')]();_0x1f2997['from']('('+_0x322b65[_0xe9f3('0x7b')]()+')',_0xe9f3('0x9f'));_0x1f2997['field'](_0xe9f3('0xa0'),_0xe9f3('0x3f'));_0x322b65[_0xe9f3('0x1c')](_0x1c9cef[_0xe9f3('0x1c')]||_0x535491);_0x322b65[_0xe9f3('0x1b')](_0x1c9cef[_0xe9f3('0x1b')]||0x0);return db[_0xe9f3('0x7c')][_0xe9f3('0x2d')](_0x1f2997[_0xe9f3('0x7b')](),{'type':db[_0xe9f3('0x7c')][_0xe9f3('0x7d')]['SELECT']})[_0xe9f3('0x23')](function(_0x15d406){if(!_0x15d406['length']){_0x2b0a7e=0x0;}else{_0x2b0a7e=_0x15d406[0x0][_0xe9f3('0x3f')]||0x0;}return db[_0xe9f3('0x7c')][_0xe9f3('0x2d')](_0x322b65[_0xe9f3('0x7b')](),{'type':db[_0xe9f3('0x7c')][_0xe9f3('0x7d')][_0xe9f3('0x7e')]});})[_0xe9f3('0x23')](function(_0x4f6b10){return{'rows':_0x4f6b10||[],'count':_0x2b0a7e};});}});}exports['run']=function(_0x842e80,_0x54950e){return runReport(_0x842e80['params'],_0x842e80[_0xe9f3('0x2d')],_0x842e80[_0xe9f3('0x3e')])[_0xe9f3('0x23')](respondWithResult(_0x54950e,null))[_0xe9f3('0x43')](handleError(_0x54950e,null));};exports['runReport']=runReport;exports[_0xe9f3('0x2d')]=function(_0x129363,_0xcef5c4){var _0x27b52c=0xa;var _0x2209bb=[_0xe9f3('0x7f'),_0xe9f3('0x50'),_0xe9f3('0x51'),_0xe9f3('0x52')];var _0x25acca={'SUM':'SUM(%s)','COUNT':_0xe9f3('0x54'),'COUNT DISTINCT':_0xe9f3('0x55'),'MAX':_0xe9f3('0x80'),'MIN':_0xe9f3('0x56'),'AVG':_0xe9f3('0x57'),'GROUP_CONCAT':_0xe9f3('0x58'),'GROUP_CONCAT ASC':_0xe9f3('0x81'),'GROUP_CONCAT DESC':_0xe9f3('0x59')};var _0x153f5b={'SEC_TO_TIME':_0xe9f3('0x82'),'DATE':_0xe9f3('0x83'),'HOUR':'HOUR(%s)','ROUND':_0xe9f3('0x5a'),'UNIX_TIMESTAMP':_0xe9f3('0x5b')};var _0x36a49f=function(_0x16d354){return!_[_0xe9f3('0x5c')]([_0xe9f3('0x5d'),_0xe9f3('0x5e'),_0xe9f3('0x85'),_0xe9f3('0x5f')],_0x16d354);};var _0x2a1b21=function(_0x4bb6f8){if(!_0x4bb6f8||!_0x4bb6f8[_0xe9f3('0x60')][_0xe9f3('0x31')]){return'';}for(var _0x3da5a5='(',_0x4628e0=0x0;_0x4628e0<_0x4bb6f8[_0xe9f3('0x60')]['length'];_0x4628e0+=0x1){_0x4628e0>0x0&&(_0x3da5a5+='\x20'+_0x4bb6f8[_0xe9f3('0x86')]+'\x20');_0x3da5a5+=_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0]['group']?_0x2a1b21(_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0][_0xe9f3('0x61')]):_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0][_0xe9f3('0x3d')]+'\x20'+_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0][_0xe9f3('0x87')]+(_0x36a49f(_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0]['condition'])?'\x20'+_0x4bb6f8[_0xe9f3('0x60')][_0x4628e0][_0xe9f3('0x62')]:'');}return _0x3da5a5+')';};var _0x373824={'where':{'id':_0x129363[_0xe9f3('0x4e')]['id']}},_0x43d3a0,_0x3751c4,_0x4d1467,_0x308c05,_0x38474a;_0x373824=_[_0xe9f3('0x39')]({},_0x373824,_0x129363[_0xe9f3('0x3e')]);return db[_0xe9f3('0x29')]['find'](_0x373824)[_0xe9f3('0x23')](function(_0x4bf02c){if(_0x4bf02c){_0x43d3a0=_0x4bf02c;return _0x4bf02c[_0xe9f3('0x63')]();}return null;})[_0xe9f3('0x23')](function(_0x3cd847){if(_0x3cd847){if(!_0x3cd847['length']){throw new db['Sequelize'][(_0xe9f3('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3751c4=_0x3cd847;return db['AnalyticMetric'][_0xe9f3('0x41')]({'raw':!![]});}return null;})[_0xe9f3('0x23')](function(_0x322d9b){if(_0x322d9b){_0x4d1467=_[_0xe9f3('0x66')](_0x322d9b,'id');var _0x3a44f1;var _0xea6baf=squel['select']();_0xea6baf[_0xe9f3('0x68')](_0x43d3a0['table']);for(var _0x324ace=0x0;_0x324ace<_0x3751c4['length'];_0x324ace+=0x1){_0x3a44f1=_0x3751c4[_0x324ace][_0xe9f3('0x6a')]?_0x4d1467[_0x3751c4[_0x324ace][_0xe9f3('0x6a')]][_0xe9f3('0xa1')]:_0x3751c4[_0x324ace][_0xe9f3('0x3d')];_0x3a44f1=_0x3751c4[_0x324ace][_0xe9f3('0x6b')]?_[_0xe9f3('0x6c')](_0x25acca[_0x3751c4[_0x324ace][_0xe9f3('0x6b')]],'%s',_0x3a44f1):_0x3a44f1;_0x3a44f1=_0x3751c4[_0x324ace][_0xe9f3('0x6d')]?_[_0xe9f3('0x6c')](_0x153f5b[_0x3751c4[_0x324ace]['format']],'%s',_0x3a44f1):_0x3a44f1;if(_0x3751c4[_0x324ace]['groupBy']){_0xea6baf[_0xe9f3('0x61')](_0x3a44f1);}_0x3751c4[_0x324ace]['orderBy']&&_0xea6baf[_0xe9f3('0x33')](_0x3a44f1,_0x3751c4[_0x324ace][_0xe9f3('0x6e')]===_0xe9f3('0x6f')?![]:!![]);_0xea6baf[_0xe9f3('0x3d')](_0x3a44f1,_0x3751c4[_0x324ace][_0xe9f3('0x70')]||_0x3a44f1);}if(_0x43d3a0[_0xe9f3('0x71')]){_0x43d3a0[_0xe9f3('0x71')]=JSON[_0xe9f3('0x72')](_0x43d3a0['joins']);for(var _0x1b956f=0x0;_0x1b956f<_0x43d3a0[_0xe9f3('0x71')][_0xe9f3('0x31')];_0x1b956f+=0x1){if(_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x3a')]&&_[_0xe9f3('0x5c')](_0x2209bb,_0x43d3a0['joins'][_0x1b956f][_0xe9f3('0x3a')])&&_0x43d3a0['joins'][_0x1b956f][_0xe9f3('0x73')]&&_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x74')]&&_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x76')]){_0xea6baf[_0x43d3a0[_0xe9f3('0x71')][_0x1b956f]['type']](_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x74')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x43d3a0[_0xe9f3('0x69')],_0x43d3a0['joins'][_0x1b956f][_0xe9f3('0x73')],_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x74')],_0x43d3a0[_0xe9f3('0x71')][_0x1b956f][_0xe9f3('0x76')]));}}}if(_0x43d3a0[_0xe9f3('0x77')]){_0x43d3a0[_0xe9f3('0x77')]=JSON['parse'](_0x43d3a0['conditions']);_0xea6baf[_0xe9f3('0x35')](_0x2a1b21(_0x43d3a0[_0xe9f3('0x77')][_0xe9f3('0x61')]));}_0x38474a=_0xea6baf[_0xe9f3('0x78')]();_0xea6baf['limit'](_0x27b52c);_0xea6baf[_0xe9f3('0x1b')](0x0);logger[_0xe9f3('0x79')](_0xe9f3('0x7a'),_0xea6baf['toString']());return db[_0xe9f3('0x7c')][_0xe9f3('0x2d')](_0xea6baf['toString'](),{'type':db[_0xe9f3('0x7c')][_0xe9f3('0x7d')][_0xe9f3('0x7e')]});}})[_0xe9f3('0x23')](function(){return{'sql':_0x38474a[_0xe9f3('0x7b')]()};})[_0xe9f3('0x23')](respondWithResult(_0xcef5c4,null))[_0xe9f3('0x43')](handleError(_0xcef5c4,null));}; \ No newline at end of file +var _0x65d2=['No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','join','../../components/export/','../../files/reports','savename','countTable','runReport','right_join','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','CustomReports','UserProfileResource','sendStatus','stack','name','send','AnalyticCustomReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','options','findAll','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','replace','function','format','orderBy','DESC','joins','includes','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','value','keyBy','groupBy','alias','SELECT'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x65d2,0xb8));var _0x265d=function(_0x21c983,_0x10cfe5){_0x21c983=_0x21c983-0x0;var _0xc647d=_0x65d2[_0x21c983];return _0xc647d;};'use strict';var pdf=require(_0x265d('0x0'));var emlformat=require(_0x265d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x265d('0x2'));var jsonpatch=require(_0x265d('0x3'));var rp=require(_0x265d('0x4'));var moment=require('moment');var BPromise=require(_0x265d('0x5'));var Mustache=require(_0x265d('0x6'));var util=require(_0x265d('0x7'));var path=require('path');var sox=require(_0x265d('0x8'));var csv=require(_0x265d('0x9'));var ejs=require(_0x265d('0xa'));var fs=require('fs');var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x9'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x265d('0x11'));var Redis=require(_0x265d('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x265d('0x13'))(_0x265d('0x14'));var utils=require(_0x265d('0x15'));var config=require(_0x265d('0x16'));var db=require(_0x265d('0x17'))['db'];function respondWithStatusCode(_0x47ec50,_0x3586eb){_0x3586eb=_0x3586eb||0xcc;return function(_0x5540fa){if(_0x5540fa){return _0x47ec50['sendStatus'](_0x3586eb);}return _0x47ec50[_0x265d('0x18')](_0x3586eb)[_0x265d('0x19')]();};}function respondWithResult(_0x22f8b8,_0x2cdf6a){_0x2cdf6a=_0x2cdf6a||0xc8;return function(_0x181344){if(_0x181344){return _0x22f8b8['status'](_0x2cdf6a)[_0x265d('0x1a')](_0x181344);}};}function respondWithFilteredResult(_0x13fff5,_0x40caed){return function(_0x34eb0b){if(_0x34eb0b){var _0x21e99b=_0x34eb0b[_0x265d('0x1b')],_0x183f31=_0x40caed[_0x265d('0x1c')],_0x29a163=_0x40caed[_0x265d('0x1c')]+_0x40caed[_0x265d('0x1d')],_0x282c63;if(_0x29a163>=_0x21e99b){_0x29a163=_0x21e99b;_0x282c63=0xc8;}else{_0x282c63=0xce;}_0x13fff5[_0x265d('0x18')](_0x282c63);return _0x13fff5[_0x265d('0x1e')](_0x265d('0x1f'),_0x183f31+'-'+_0x29a163+'/'+_0x21e99b)[_0x265d('0x1a')](_0x34eb0b);}return null;};}function patchUpdates(_0x4b0637){return function(_0x353678){try{jsonpatch[_0x265d('0x20')](_0x353678,_0x4b0637,!![]);}catch(_0x2f8932){return BPromise[_0x265d('0x21')](_0x2f8932);}return _0x353678[_0x265d('0x22')]();};}function saveUpdates(_0x5c9704,_0x5f485a){return function(_0x3dc44b){if(_0x3dc44b){return _0x3dc44b[_0x265d('0x23')](_0x5c9704)['then'](function(_0x408840){return _0x408840;});}return null;};}function removeEntity(_0x5ca918,_0x4816b7){return function(_0x31be87){if(_0x31be87){return _0x31be87[_0x265d('0x24')]()[_0x265d('0x25')](function(){var _0xe45474=_0x31be87['get']({'plain':!![]});var _0x1da376=_0x265d('0x26');return db[_0x265d('0x27')][_0x265d('0x24')]({'where':{'type':_0x1da376,'resourceId':_0xe45474['id']}})[_0x265d('0x25')](function(){return _0x31be87;});})[_0x265d('0x25')](function(){_0x5ca918[_0x265d('0x18')](0xcc)[_0x265d('0x19')]();});}};}function handleEntityNotFound(_0x53301f,_0x6916db){return function(_0x1fa6b5){if(!_0x1fa6b5){_0x53301f[_0x265d('0x28')](0x194);}return _0x1fa6b5;};}function handleError(_0x1c830b,_0x2d1c3d){_0x2d1c3d=_0x2d1c3d||0x1f4;return function(_0x3c163a){logger['error'](_0x3c163a[_0x265d('0x29')]);if(_0x3c163a[_0x265d('0x2a')]){delete _0x3c163a['name'];}_0x1c830b[_0x265d('0x18')](_0x2d1c3d)[_0x265d('0x2b')](_0x3c163a);};}exports['index']=function(_0x310904,_0x55e69f){var _0x311872={},_0x3873c3={},_0x27c851={'count':0x0,'rows':[]};var _0x1a3eeb=db[_0x265d('0x2c')][_0x265d('0x2d')];_0x3873c3[_0x265d('0x2e')]=_[_0x265d('0x2f')](_0x1a3eeb);_0x3873c3[_0x265d('0x30')]=_['keys'](_0x310904[_0x265d('0x30')]);_0x3873c3['filters']=_[_0x265d('0x31')](_0x3873c3[_0x265d('0x2e')],_0x3873c3[_0x265d('0x30')]);_0x311872[_0x265d('0x32')]=_[_0x265d('0x31')](_0x3873c3['model'],qs[_0x265d('0x33')](_0x310904['query'][_0x265d('0x33')]));_0x311872[_0x265d('0x32')]=_0x311872['attributes'][_0x265d('0x34')]?_0x311872[_0x265d('0x32')]:_0x3873c3['model'];if(!_0x310904[_0x265d('0x30')][_0x265d('0x35')](_0x265d('0x36'))){_0x311872[_0x265d('0x1d')]=qs[_0x265d('0x1d')](_0x310904['query']['limit']);_0x311872[_0x265d('0x1c')]=qs['offset'](_0x310904[_0x265d('0x30')][_0x265d('0x1c')]);}_0x311872[_0x265d('0x37')]=qs[_0x265d('0x38')](_0x310904[_0x265d('0x30')]['sort']);_0x311872[_0x265d('0x39')]=qs['filters'](_[_0x265d('0x3a')](_0x310904[_0x265d('0x30')],_0x3873c3[_0x265d('0x3b')]));if(_0x310904['query'][_0x265d('0x3c')]){_0x311872[_0x265d('0x39')]=_[_0x265d('0x3d')](_0x311872[_0x265d('0x39')],{'$or':_[_0x265d('0x3e')](_0x1a3eeb,function(_0x5de037){if(_0x5de037['type'][_0x265d('0x3f')]!==_0x265d('0x40')){var _0x290779={};_0x290779[_0x5de037['field']]={'$like':'%'+_0x310904['query'][_0x265d('0x3c')]+'%'};return _0x290779;}})});}_0x311872=_[_0x265d('0x3d')]({},_0x311872,_0x310904[_0x265d('0x41')]);var _0x577977={'where':_0x311872['where']};return db['AnalyticCustomReport']['count'](_0x577977)[_0x265d('0x25')](function(_0x3caea3){_0x27c851[_0x265d('0x1b')]=_0x3caea3;if(_0x310904[_0x265d('0x30')]['includeAll']){_0x311872['include']=[{'all':!![]}];}return db[_0x265d('0x2c')][_0x265d('0x42')](_0x311872);})[_0x265d('0x25')](function(_0xe927ee){_0x27c851['rows']=_0xe927ee;return _0x27c851;})['then'](respondWithFilteredResult(_0x55e69f,_0x311872))[_0x265d('0x43')](handleError(_0x55e69f,null));};exports[_0x265d('0x44')]=function(_0x159cab,_0x59242e){var _0x52459f={'raw':![],'where':{'id':_0x159cab[_0x265d('0x45')]['id']}},_0x526b7d={};_0x526b7d['model']=_['keys'](db[_0x265d('0x2c')][_0x265d('0x2d')]);_0x526b7d[_0x265d('0x30')]=_[_0x265d('0x2f')](_0x159cab['query']);_0x526b7d['filters']=_[_0x265d('0x31')](_0x526b7d['model'],_0x526b7d[_0x265d('0x30')]);_0x52459f[_0x265d('0x32')]=_['intersection'](_0x526b7d[_0x265d('0x2e')],qs[_0x265d('0x33')](_0x159cab[_0x265d('0x30')]['fields']));_0x52459f['attributes']=_0x52459f[_0x265d('0x32')][_0x265d('0x34')]?_0x52459f[_0x265d('0x32')]:_0x526b7d['model'];if(_0x159cab[_0x265d('0x30')][_0x265d('0x46')]){_0x52459f['include']=[{'all':!![]}];}_0x52459f=_[_0x265d('0x3d')]({},_0x52459f,_0x159cab[_0x265d('0x41')]);return db['AnalyticCustomReport'][_0x265d('0x47')](_0x52459f)[_0x265d('0x25')](handleEntityNotFound(_0x59242e,null))[_0x265d('0x25')](respondWithResult(_0x59242e,null))[_0x265d('0x43')](handleError(_0x59242e,null));};exports[_0x265d('0x48')]=function(_0x238c1d,_0x3124f8){return db[_0x265d('0x2c')]['create'](_0x238c1d[_0x265d('0x49')],{})[_0x265d('0x25')](function(_0xcbc1cc){var _0x9234f0=_0x238c1d[_0x265d('0x4a')][_0x265d('0x4b')]({'plain':!![]});if(!_0x9234f0)throw new Error(_0x265d('0x4c'));if(_0x9234f0['role']===_0x265d('0x4a')){var _0x3affc9=_0xcbc1cc[_0x265d('0x4b')]({'plain':!![]});var _0xb0d26d=_0x265d('0x4d');return db[_0x265d('0x4e')][_0x265d('0x47')]({'where':{'name':_0xb0d26d,'userProfileId':_0x9234f0['userProfileId']},'raw':!![]})[_0x265d('0x25')](function(_0x2260ea){if(_0x2260ea&&_0x2260ea[_0x265d('0x4f')]===0x0){return db[_0x265d('0x27')][_0x265d('0x48')]({'name':_0x3affc9['name'],'resourceId':_0x3affc9['id'],'type':_0x265d('0x26'),'sectionId':_0x2260ea['id']},{})[_0x265d('0x25')](function(){return _0xcbc1cc;});}else{return _0xcbc1cc;}})[_0x265d('0x43')](function(_0x234449){logger[_0x265d('0x50')](_0x265d('0x51'),_0x234449);throw _0x234449;});}return _0xcbc1cc;})[_0x265d('0x25')](respondWithResult(_0x3124f8,0xc9))[_0x265d('0x43')](handleError(_0x3124f8,null));};exports[_0x265d('0x23')]=function(_0x50b7c9,_0x4cd2bc){if(_0x50b7c9[_0x265d('0x49')]['id']){delete _0x50b7c9[_0x265d('0x49')]['id'];}return db[_0x265d('0x2c')][_0x265d('0x47')]({'where':{'id':_0x50b7c9['params']['id']}})[_0x265d('0x25')](handleEntityNotFound(_0x4cd2bc,null))[_0x265d('0x25')](saveUpdates(_0x50b7c9[_0x265d('0x49')],null))['then'](respondWithResult(_0x4cd2bc,null))[_0x265d('0x43')](handleError(_0x4cd2bc,null));};exports[_0x265d('0x24')]=function(_0x589817,_0x40b167){return db[_0x265d('0x2c')]['find']({'where':{'id':_0x589817[_0x265d('0x45')]['id']}})[_0x265d('0x25')](handleEntityNotFound(_0x40b167,null))['then'](removeEntity(_0x40b167,null))[_0x265d('0x43')](handleError(_0x40b167,null));};exports['preview']=function(_0x15a3d8,_0x380deb){var _0x109f73=0xa;var _0x5ed0e7=['join',_0x265d('0x52'),'right_join',_0x265d('0x53')];var _0x42e3ac={'SUM':'SUM(%s)','COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':_0x265d('0x58'),'GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x23d634={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':'DATE(%s)','HOUR':_0x265d('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45786f=function(_0x229ea8){return!_['includes']([_0x265d('0x5c'),_0x265d('0x5d'),_0x265d('0x5e'),_0x265d('0x5f')],_0x229ea8);};var _0x4aec41=function(_0x535b4b){if(!_0x535b4b||!_0x535b4b[_0x265d('0x60')][_0x265d('0x34')]){return'';}for(var _0x22e5ef='(',_0x409c33=0x0;_0x409c33<_0x535b4b[_0x265d('0x60')][_0x265d('0x34')];_0x409c33+=0x1){_0x409c33>0x0&&(_0x22e5ef+='\x20'+_0x535b4b[_0x265d('0x61')]+'\x20');_0x22e5ef+=_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x62')]?_0x4aec41(_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x62')]):_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x63')]+'\x20'+_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x64')]+(_0x45786f(_0x535b4b[_0x265d('0x60')][_0x409c33][_0x265d('0x64')])?'\x20'+_0x535b4b[_0x265d('0x60')][_0x409c33]['value']:'');}return _0x22e5ef+')';};var _0x49ba48={'where':{'id':_0x15a3d8['params']['id']}},_0x5c9972,_0x404563,_0x156e4a,_0x1a67c5,_0x2db413;_0x49ba48=_[_0x265d('0x3d')]({},_0x49ba48,_0x15a3d8[_0x265d('0x41')]);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x49ba48)['then'](function(_0x1ac354){if(_0x1ac354){_0x5c9972=_0x1ac354;return _0x1ac354[_0x265d('0x65')]();}return null;})[_0x265d('0x25')](function(_0x13f04e){if(_0x13f04e){if(!_0x13f04e[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x404563=_0x13f04e;return db[_0x265d('0x69')][_0x265d('0x42')]({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0xdc6ce1){if(_0xdc6ce1){_0x156e4a=_['keyBy'](_0xdc6ce1,'id');var _0x2bbc75;var _0x66426f=squel[_0x265d('0x6a')]();_0x66426f[_0x265d('0x6b')](_0x5c9972[_0x265d('0x6c')]);for(var _0x49c5bf=0x0;_0x49c5bf<_0x404563[_0x265d('0x34')];_0x49c5bf+=0x1){_0x2bbc75=_0x404563[_0x49c5bf][_0x265d('0x6d')]?_0x156e4a[_0x404563[_0x49c5bf][_0x265d('0x6d')]][_0x265d('0x6e')]:_0x404563[_0x49c5bf][_0x265d('0x63')];_0x2bbc75=_0x404563[_0x49c5bf]['function']?_[_0x265d('0x6f')](_0x42e3ac[_0x404563[_0x49c5bf][_0x265d('0x70')]],'%s',_0x2bbc75):_0x2bbc75;_0x2bbc75=_0x404563[_0x49c5bf][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x23d634[_0x404563[_0x49c5bf][_0x265d('0x71')]],'%s',_0x2bbc75):_0x2bbc75;if(_0x404563[_0x49c5bf]['groupBy']){_0x66426f[_0x265d('0x62')](_0x2bbc75);}_0x404563[_0x49c5bf]['orderBy']&&_0x66426f[_0x265d('0x37')](_0x2bbc75,_0x404563[_0x49c5bf][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x66426f[_0x265d('0x63')](_0x2bbc75,_0x404563[_0x49c5bf]['alias']||_0x2bbc75);}if(_0x5c9972[_0x265d('0x74')]){_0x5c9972[_0x265d('0x74')]=JSON['parse'](_0x5c9972[_0x265d('0x74')]);for(var _0x38affb=0x0;_0x38affb<_0x5c9972[_0x265d('0x74')][_0x265d('0x34')];_0x38affb+=0x1){if(_0x5c9972[_0x265d('0x74')][_0x38affb]['type']&&_[_0x265d('0x75')](_0x5ed0e7,_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x76')])&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x77')]&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')]&&_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x79')]){_0x66426f[_0x5c9972[_0x265d('0x74')][_0x38affb]['type']](_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')],null,util[_0x265d('0x71')](_0x265d('0x7a'),_0x5c9972[_0x265d('0x6c')],_0x5c9972[_0x265d('0x74')][_0x38affb]['parentKey'],_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x78')],_0x5c9972[_0x265d('0x74')][_0x38affb][_0x265d('0x79')]));}}}if(_0x5c9972[_0x265d('0x7b')]){_0x5c9972['conditions']=JSON[_0x265d('0x7c')](_0x5c9972['conditions']);_0x66426f['where'](_0x4aec41(_0x5c9972[_0x265d('0x7b')][_0x265d('0x62')]));}_0x2db413=_0x66426f[_0x265d('0x7d')]();_0x66426f[_0x265d('0x1d')](_0x109f73);_0x66426f[_0x265d('0x1c')](0x0);logger[_0x265d('0x7e')](_0x265d('0x7f'),_0x66426f[_0x265d('0x80')]());return db['sequelize'][_0x265d('0x30')](_0x66426f[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')]['SELECT']});}})[_0x265d('0x25')](respondWithResult(_0x380deb,null))[_0x265d('0x43')](handleError(_0x380deb,null));};function runReport(_0x428dce,_0x185fbd,_0x11cbd6){var _0x133f28=_0x185fbd[_0x265d('0x2a')];var _0x3d09f8=0xa;var _0x5e4435=['join',_0x265d('0x52'),'right_join',_0x265d('0x53')];var _0x379ad6={'SUM':_0x265d('0x83'),'COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':_0x265d('0x58'),'GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':_0x265d('0x84'),'GROUP_CONCAT DESC':_0x265d('0x85')};var _0x594a6f={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':_0x265d('0x86'),'HOUR':_0x265d('0x5b'),'ROUND':_0x265d('0x87'),'UNIX_TIMESTAMP':_0x265d('0x88')};var _0x516a7c=function(_0x2be109){return!_[_0x265d('0x75')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x265d('0x5f')],_0x2be109);};var _0xea70a1=function(_0x207a40){if(!_0x207a40||!_0x207a40[_0x265d('0x60')][_0x265d('0x34')]){return'';}for(var _0x533c2b='(',_0x2bb5ef=0x0;_0x2bb5ef<_0x207a40[_0x265d('0x60')][_0x265d('0x34')];_0x2bb5ef+=0x1){_0x2bb5ef>0x0&&(_0x533c2b+='\x20'+_0x207a40[_0x265d('0x61')]+'\x20');_0x533c2b+=_0x207a40['rules'][_0x2bb5ef][_0x265d('0x62')]?_0xea70a1(_0x207a40['rules'][_0x2bb5ef][_0x265d('0x62')]):_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x63')]+'\x20'+_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x64')]+(_0x516a7c(_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x64')])?'\x20'+_0x207a40[_0x265d('0x60')][_0x2bb5ef][_0x265d('0x89')]:'');}return _0x533c2b+')';};var _0x2c74ac={'where':{'id':_0x428dce['id']}},_0x201ae4,_0x3919cd,_0x566947,_0x30108b,_0x57031e;_0x2c74ac=_[_0x265d('0x3d')]({},_0x2c74ac,_0x11cbd6);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x2c74ac)[_0x265d('0x25')](function(_0x288022){if(_0x288022){_0x201ae4=_0x288022;return _0x288022[_0x265d('0x65')]();}return null;})[_0x265d('0x25')](function(_0x3f215b){if(_0x3f215b){if(!_0x3f215b[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x3919cd=_0x3f215b;return db[_0x265d('0x69')][_0x265d('0x42')]({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0x9e4cd0){if(_0x9e4cd0){_0x566947=_[_0x265d('0x8a')](_0x9e4cd0,'id');var _0x53b92a;var _0x18e686=squel[_0x265d('0x6a')]();_0x18e686[_0x265d('0x6b')](_0x201ae4[_0x265d('0x6c')]);for(var _0x30e121=0x0;_0x30e121<_0x3919cd[_0x265d('0x34')];_0x30e121+=0x1){_0x53b92a=_0x3919cd[_0x30e121]['MetricId']?_0x566947[_0x3919cd[_0x30e121][_0x265d('0x6d')]]['metric']:_0x3919cd[_0x30e121]['field'];_0x53b92a=_0x3919cd[_0x30e121][_0x265d('0x70')]?_[_0x265d('0x6f')](_0x379ad6[_0x3919cd[_0x30e121][_0x265d('0x70')]],'%s',_0x53b92a):_0x53b92a;_0x53b92a=_0x3919cd[_0x30e121][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x594a6f[_0x3919cd[_0x30e121][_0x265d('0x71')]],'%s',_0x53b92a):_0x53b92a;if(_0x3919cd[_0x30e121][_0x265d('0x8b')]){_0x18e686[_0x265d('0x62')](_0x53b92a);}_0x3919cd[_0x30e121][_0x265d('0x72')]&&_0x18e686[_0x265d('0x37')](_0x53b92a,_0x3919cd[_0x30e121][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x18e686[_0x265d('0x63')](_0x53b92a,_0x3919cd[_0x30e121][_0x265d('0x8c')]||_0x53b92a);}if(_0x201ae4[_0x265d('0x74')]){_0x201ae4[_0x265d('0x74')]=JSON[_0x265d('0x7c')](_0x201ae4[_0x265d('0x74')]);for(var _0x1ee5a8=0x0;_0x1ee5a8<_0x201ae4[_0x265d('0x74')][_0x265d('0x34')];_0x1ee5a8+=0x1){if(_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['type']&&_[_0x265d('0x75')](_0x5e4435,_0x201ae4['joins'][_0x1ee5a8][_0x265d('0x76')])&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x77')]&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignTable']&&_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignKey']){_0x18e686[_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x76')]](_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x78')],null,util['format'](_0x265d('0x7a'),_0x201ae4[_0x265d('0x6c')],_0x201ae4[_0x265d('0x74')][_0x1ee5a8][_0x265d('0x77')],_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignTable'],_0x201ae4[_0x265d('0x74')][_0x1ee5a8]['foreignKey']));}}}if(_0x201ae4[_0x265d('0x7b')]){_0x201ae4[_0x265d('0x7b')]=JSON[_0x265d('0x7c')](_0x201ae4[_0x265d('0x7b')]);_0x18e686[_0x265d('0x39')](_0xea70a1(_0x201ae4['conditions'][_0x265d('0x62')]));}_0x57031e=_0x18e686[_0x265d('0x7d')]();_0x18e686['limit'](_0x3d09f8);_0x18e686[_0x265d('0x1c')](0x0);logger['debug'](_0x265d('0x7f'),_0x18e686['toString']());return db['sequelize'][_0x265d('0x30')](_0x18e686[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')][_0x265d('0x8d')]});}})[_0x265d('0x25')](function(_0x433b53){if(!_0x433b53[_0x265d('0x34')]){throw new db[(_0x265d('0x66'))][(_0x265d('0x67'))](_0x265d('0x8e'),0xcc);}if(_0x185fbd[_0x265d('0x8f')]===_0x265d('0x90')){return null;}var _0x5345f1=_[_0x265d('0x3d')](_0x185fbd,{'name':_0x185fbd['fullPath']||_0x185fbd[_0x265d('0x2a')]||_0x201ae4[_0x265d('0x2a')],'basename':_0x133f28,'savename':util[_0x265d('0x71')](_0x265d('0x91'),_0x185fbd['name']||_0x201ae4[_0x265d('0x2a')],require(_0x265d('0x92'))[_0x265d('0x93')](0x4),_0x185fbd['output']||'csv'),'reportId':_0x201ae4['id'],'reportType':_0x265d('0x94')});return db[_0x265d('0x95')]['create'](_0x5345f1,{'raw':!![]});})['then'](function(_0x45d891){if(_0x201ae4[_0x265d('0x6c')]==='cdr'){_0x57031e[_0x265d('0x39')](_0x201ae4[_0x265d('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x185fbd[_0x265d('0x96')],_0x185fbd[_0x265d('0x97')]);}else{_0x57031e[_0x265d('0x39')](_0x201ae4[_0x265d('0x6c')]+_0x265d('0x98'),_0x185fbd[_0x265d('0x96')],_0x185fbd['endDate']);}if(_0x45d891){logger[_0x265d('0x99')](_0x265d('0x9a'),_0x57031e[_0x265d('0x80')]());require('child_process')[_0x265d('0x9b')](path[_0x265d('0x9c')](__dirname,_0x265d('0x9d'),_0x45d891[_0x265d('0x8f')]),[_0x45d891['id'],_0x57031e[_0x265d('0x80')](),path[_0x265d('0x9c')](__dirname,_0x265d('0x9e'),_0x45d891[_0x265d('0x9f')]),_0x133f28]);return _0x45d891;}else{var _0x2edd9b=squel[_0x265d('0x6a')]();_0x2edd9b[_0x265d('0x6b')]('('+_0x57031e['toString']()+')',_0x265d('0xa0'));_0x2edd9b[_0x265d('0x63')]('COUNT(*)',_0x265d('0x1b'));_0x57031e[_0x265d('0x1d')](_0x185fbd['limit']||_0x3d09f8);_0x57031e[_0x265d('0x1c')](_0x185fbd['offset']||0x0);return db[_0x265d('0x81')][_0x265d('0x30')](_0x2edd9b[_0x265d('0x80')](),{'type':db['sequelize'][_0x265d('0x82')]['SELECT']})['then'](function(_0x5eebd6){if(!_0x5eebd6[_0x265d('0x34')]){_0x30108b=0x0;}else{_0x30108b=_0x5eebd6[0x0]['count']||0x0;}return db[_0x265d('0x81')][_0x265d('0x30')](_0x57031e[_0x265d('0x80')](),{'type':db[_0x265d('0x81')][_0x265d('0x82')]['SELECT']});})[_0x265d('0x25')](function(_0xa6195b){return{'rows':_0xa6195b||[],'count':_0x30108b};});}});}exports['run']=function(_0x59f8e0,_0x299218){return runReport(_0x59f8e0[_0x265d('0x45')],_0x59f8e0['query'],_0x59f8e0[_0x265d('0x41')])[_0x265d('0x25')](respondWithResult(_0x299218,null))[_0x265d('0x43')](handleError(_0x299218,null));};exports[_0x265d('0xa1')]=runReport;exports[_0x265d('0x30')]=function(_0x114f5a,_0x158f4a){var _0x1ad197=0xa;var _0x3f46a4=[_0x265d('0x9c'),_0x265d('0x52'),_0x265d('0xa2'),'cross_join'];var _0x37dc83={'SUM':_0x265d('0x83'),'COUNT':_0x265d('0x54'),'COUNT DISTINCT':_0x265d('0x55'),'MAX':_0x265d('0x56'),'MIN':_0x265d('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x265d('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x265d('0x85')};var _0x436fe3={'SEC_TO_TIME':_0x265d('0x5a'),'DATE':_0x265d('0x86'),'HOUR':_0x265d('0x5b'),'ROUND':_0x265d('0x87'),'UNIX_TIMESTAMP':_0x265d('0x88')};var _0x214e82=function(_0x49992d){return!_['includes']([_0x265d('0x5c'),_0x265d('0x5d'),'IS\x20EMPTY',_0x265d('0x5f')],_0x49992d);};var _0x28c5a0=function(_0x9f879){if(!_0x9f879||!_0x9f879['rules'][_0x265d('0x34')]){return'';}for(var _0x1747ed='(',_0x6eda4=0x0;_0x6eda4<_0x9f879[_0x265d('0x60')]['length'];_0x6eda4+=0x1){_0x6eda4>0x0&&(_0x1747ed+='\x20'+_0x9f879['operator']+'\x20');_0x1747ed+=_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x62')]?_0x28c5a0(_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x62')]):_0x9f879['rules'][_0x6eda4][_0x265d('0x63')]+'\x20'+_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x64')]+(_0x214e82(_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x64')])?'\x20'+_0x9f879[_0x265d('0x60')][_0x6eda4][_0x265d('0x89')]:'');}return _0x1747ed+')';};var _0x48cf26={'where':{'id':_0x114f5a[_0x265d('0x45')]['id']}},_0x3630f3,_0x219aa7,_0x5c7555,_0x4ed86d,_0x42596f;_0x48cf26=_['merge']({},_0x48cf26,_0x114f5a[_0x265d('0x41')]);return db[_0x265d('0x2c')][_0x265d('0x47')](_0x48cf26)[_0x265d('0x25')](function(_0x46733f){if(_0x46733f){_0x3630f3=_0x46733f;return _0x46733f[_0x265d('0x65')]();}return null;})['then'](function(_0xcd9a0c){if(_0xcd9a0c){if(!_0xcd9a0c[_0x265d('0x34')]){throw new db['Sequelize'][(_0x265d('0x67'))](_0x265d('0x68'),0x193);}_0x219aa7=_0xcd9a0c;return db[_0x265d('0x69')]['findAll']({'raw':!![]});}return null;})[_0x265d('0x25')](function(_0x23b30b){if(_0x23b30b){_0x5c7555=_['keyBy'](_0x23b30b,'id');var _0x343660;var _0x314c8a=squel[_0x265d('0x6a')]();_0x314c8a[_0x265d('0x6b')](_0x3630f3[_0x265d('0x6c')]);for(var _0x17ded2=0x0;_0x17ded2<_0x219aa7[_0x265d('0x34')];_0x17ded2+=0x1){_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x6d')]?_0x5c7555[_0x219aa7[_0x17ded2][_0x265d('0x6d')]][_0x265d('0x6e')]:_0x219aa7[_0x17ded2][_0x265d('0x63')];_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x70')]?_[_0x265d('0x6f')](_0x37dc83[_0x219aa7[_0x17ded2][_0x265d('0x70')]],'%s',_0x343660):_0x343660;_0x343660=_0x219aa7[_0x17ded2][_0x265d('0x71')]?_[_0x265d('0x6f')](_0x436fe3[_0x219aa7[_0x17ded2][_0x265d('0x71')]],'%s',_0x343660):_0x343660;if(_0x219aa7[_0x17ded2][_0x265d('0x8b')]){_0x314c8a[_0x265d('0x62')](_0x343660);}_0x219aa7[_0x17ded2][_0x265d('0x72')]&&_0x314c8a['order'](_0x343660,_0x219aa7[_0x17ded2][_0x265d('0x72')]===_0x265d('0x73')?![]:!![]);_0x314c8a['field'](_0x343660,_0x219aa7[_0x17ded2]['alias']||_0x343660);}if(_0x3630f3[_0x265d('0x74')]){_0x3630f3[_0x265d('0x74')]=JSON[_0x265d('0x7c')](_0x3630f3['joins']);for(var _0x5099f8=0x0;_0x5099f8<_0x3630f3[_0x265d('0x74')][_0x265d('0x34')];_0x5099f8+=0x1){if(_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')]&&_[_0x265d('0x75')](_0x3f46a4,_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')])&&_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x77')]&&_0x3630f3['joins'][_0x5099f8]['foreignTable']&&_0x3630f3[_0x265d('0x74')][_0x5099f8]['foreignKey']){_0x314c8a[_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x76')]](_0x3630f3['joins'][_0x5099f8][_0x265d('0x78')],null,util['format'](_0x265d('0x7a'),_0x3630f3[_0x265d('0x6c')],_0x3630f3[_0x265d('0x74')][_0x5099f8][_0x265d('0x77')],_0x3630f3['joins'][_0x5099f8][_0x265d('0x78')],_0x3630f3['joins'][_0x5099f8][_0x265d('0x79')]));}}}if(_0x3630f3['conditions']){_0x3630f3[_0x265d('0x7b')]=JSON['parse'](_0x3630f3[_0x265d('0x7b')]);_0x314c8a[_0x265d('0x39')](_0x28c5a0(_0x3630f3[_0x265d('0x7b')][_0x265d('0x62')]));}_0x42596f=_0x314c8a[_0x265d('0x7d')]();_0x314c8a[_0x265d('0x1d')](_0x1ad197);_0x314c8a['offset'](0x0);logger['debug'](_0x265d('0x7f'),_0x314c8a['toString']());return db[_0x265d('0x81')][_0x265d('0x30')](_0x314c8a[_0x265d('0x80')](),{'type':db['sequelize'][_0x265d('0x82')][_0x265d('0x8d')]});}})[_0x265d('0x25')](function(){return{'sql':_0x42596f[_0x265d('0x80')]()};})[_0x265d('0x25')](respondWithResult(_0x158f4a,null))['catch'](handleError(_0x158f4a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 23a6850..5ea836d 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 _0x3ba9=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x40e887,_0x5daf9e){var _0x50a6da=function(_0x2b857a){while(--_0x2b857a){_0x40e887['push'](_0x40e887['shift']());}};_0x50a6da(++_0x5daf9e);}(_0x3ba9,0x140));var _0x93ba=function(_0x222878,_0x49e025){_0x222878=_0x222878-0x0;var _0x1902c3=_0x3ba9[_0x222878];return _0x1902c3;};'use strict';var _=require(_0x93ba('0x0'));var util=require(_0x93ba('0x1'));var logger=require('../../config/logger')(_0x93ba('0x2'));var moment=require(_0x93ba('0x3'));var BPromise=require(_0x93ba('0x4'));var rp=require(_0x93ba('0x5'));var attributes=require(_0x93ba('0x6'));module[_0x93ba('0x7')]=function(_0x2c848f,_0x3f4783){return _0x2c848f[_0x93ba('0x8')](_0x93ba('0x9'),attributes,{'tableName':_0x93ba('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbad9=['request-promise','exports','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird'];(function(_0xc1a4cf,_0x17141b){var _0x2930d1=function(_0x2e6e7a){while(--_0x2e6e7a){_0xc1a4cf['push'](_0xc1a4cf['shift']());}};_0x2930d1(++_0x17141b);}(_0xbad9,0x1a2));var _0x9bad=function(_0x1c3cba,_0x2c8fea){_0x1c3cba=_0x1c3cba-0x0;var _0x19c352=_0xbad9[_0x1c3cba];return _0x19c352;};'use strict';var _=require('lodash');var util=require(_0x9bad('0x0'));var logger=require(_0x9bad('0x1'))(_0x9bad('0x2'));var moment=require(_0x9bad('0x3'));var BPromise=require(_0x9bad('0x4'));var rp=require(_0x9bad('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x9bad('0x6')]=function(_0x2f12f4,_0x1fa909){return _0x2f12f4['define'](_0x9bad('0x7'),attributes,{'tableName':_0x9bad('0x8'),'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 5e0bfad..6d69a45 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index fe03c38..e293cea 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 _0x0abf=['exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','delete','destroy'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf0ab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf0ab('0x4'));var controller=require(_0xf0ab('0x5'));router[_0xf0ab('0x6')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x8')]);router[_0xf0ab('0x6')](_0xf0ab('0x9'),auth['isAuthenticated'](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x6')](_0xf0ab('0xb'),auth[_0xf0ab('0x7')](),controller['preview']);router[_0xf0ab('0x6')](_0xf0ab('0xc'),auth[_0xf0ab('0x7')](),controller['run']);router['get'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0xf')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller['update']);router[_0xf0ab('0x12')](_0xf0ab('0x9'),auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x13')]);module[_0xf0ab('0x14')]=router; \ No newline at end of file +var _0x4213=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','run','/:id/query','query','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0xfca31c,_0x2c9852){var _0x5bdc18=function(_0x362c1c){while(--_0x362c1c){_0xfca31c['push'](_0xfca31c['shift']());}};_0x5bdc18(++_0x2c9852);}(_0x4213,0x77));var _0x3421=function(_0x1a0856,_0x17f3e4){_0x1a0856=_0x1a0856-0x0;var _0x32ce16=_0x4213[_0x1a0856];return _0x32ce16;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['preview']);router[_0x3421('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x3421('0xd')]);router['get'](_0x3421('0xe'),auth[_0x3421('0x9')](),controller[_0x3421('0xf')]);router[_0x3421('0x10')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x13')]);router[_0x3421('0x14')](_0x3421('0x15'),auth[_0x3421('0x9')](),controller[_0x3421('0x16')]);module[_0x3421('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index feaf828..b8c5b88 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 _0x25a0=['sequelize','exports','STRING','TEXT'];(function(_0x59cbad,_0x185241){var _0x593f4d=function(_0xa9d3a9){while(--_0xa9d3a9){_0x59cbad['push'](_0x59cbad['shift']());}};_0x593f4d(++_0x185241);}(_0x25a0,0x80));var _0x025a=function(_0x243716,_0x1d896c){_0x243716=_0x243716-0x0;var _0xf547f1=_0x25a0[_0x243716];return _0xf547f1;};'use strict';var Sequelize=require(_0x025a('0x0'));module[_0x025a('0x1')]={'name':{'type':Sequelize[_0x025a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x025a('0x2')]},'parent':{'type':Sequelize[_0x025a('0x2')]},'table':{'type':Sequelize[_0x025a('0x2')]},'conditions':{'type':Sequelize[_0x025a('0x3')]},'joins':{'type':Sequelize[_0x025a('0x3')]}}; \ No newline at end of file +var _0x815a=['TEXT','sequelize','STRING'];(function(_0x33653e,_0x14c1f1){var _0x522773=function(_0x39a1ee){while(--_0x39a1ee){_0x33653e['push'](_0x33653e['shift']());}};_0x522773(++_0x14c1f1);}(_0x815a,0xaf));var _0xa815=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x815a[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0xa815('0x0'));module['exports']={'name':{'type':Sequelize[_0xa815('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa815('0x1')]},'parent':{'type':Sequelize[_0xa815('0x1')]},'table':{'type':Sequelize[_0xa815('0x1')]},'conditions':{'type':Sequelize[_0xa815('0x2')]},'joins':{'type':Sequelize[_0xa815('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 56cd167..e078436 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 _0xb94b=['limit','Content-Range','json','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','stack','name','send','index','AnalyticDefaultReport','rawAttributes','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','findAll','catch','show','params','length','include','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','rules','group','condition','ValidationErrorItem','AnalyticMetric','select','from','table','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','type','includes','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','MetricId','parentKey','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset'];(function(_0x4ce065,_0x1215cf){var _0xa32b1d=function(_0x478384){while(--_0x478384){_0x4ce065['push'](_0x4ce065['shift']());}};_0xa32b1d(++_0x1215cf);}(_0xb94b,0x12c));var _0xbb94=function(_0x61dafb,_0x5e6bf8){_0x61dafb=_0x61dafb-0x0;var _0x52f042=_0xb94b[_0x61dafb];return _0x52f042;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb94('0x0'));var rimraf=require(_0xbb94('0x1'));var zipdir=require(_0xbb94('0x2'));var jsonpatch=require(_0xbb94('0x3'));var rp=require(_0xbb94('0x4'));var moment=require(_0xbb94('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbb94('0x6'));var util=require(_0xbb94('0x7'));var path=require(_0xbb94('0x8'));var sox=require(_0xbb94('0x9'));var csv=require(_0xbb94('0xa'));var ejs=require(_0xbb94('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb94('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbb94('0xa'));var querystring=require('querystring');var Papa=require(_0xbb94('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xbb94('0xe'));var Redis=require(_0xbb94('0xf'));var qs=require(_0xbb94('0x10'));var logger=require(_0xbb94('0x11'))(_0xbb94('0x12'));var utils=require(_0xbb94('0x13'));var config=require(_0xbb94('0x14'));var db=require(_0xbb94('0x15'))['db'];function respondWithStatusCode(_0x204c75,_0x3f161f){_0x3f161f=_0x3f161f||0xcc;return function(_0xdb237a){if(_0xdb237a){return _0x204c75[_0xbb94('0x16')](_0x3f161f);}return _0x204c75[_0xbb94('0x17')](_0x3f161f)[_0xbb94('0x18')]();};}function respondWithResult(_0x408244,_0x33d711){_0x33d711=_0x33d711||0xc8;return function(_0x3e6879){if(_0x3e6879){return _0x408244['status'](_0x33d711)['json'](_0x3e6879);}};}function respondWithFilteredResult(_0x3b8de2,_0x43fb0f){return function(_0x4b4877){if(_0x4b4877){var _0x131bd4=_0x4b4877['count'],_0x57838a=_0x43fb0f[_0xbb94('0x19')],_0x14f97e=_0x43fb0f['offset']+_0x43fb0f[_0xbb94('0x1a')],_0x37d5d5;if(_0x14f97e>=_0x131bd4){_0x14f97e=_0x131bd4;_0x37d5d5=0xc8;}else{_0x37d5d5=0xce;}_0x3b8de2[_0xbb94('0x17')](_0x37d5d5);return _0x3b8de2['set'](_0xbb94('0x1b'),_0x57838a+'-'+_0x14f97e+'/'+_0x131bd4)[_0xbb94('0x1c')](_0x4b4877);}return null;};}function patchUpdates(_0x2865ad){return function(_0x4659ab){try{jsonpatch['apply'](_0x4659ab,_0x2865ad,!![]);}catch(_0x573707){return BPromise[_0xbb94('0x1d')](_0x573707);}return _0x4659ab[_0xbb94('0x1e')]();};}function saveUpdates(_0xc2ba48,_0x37c5ef){return function(_0x40865e){if(_0x40865e){return _0x40865e[_0xbb94('0x1f')](_0xc2ba48)[_0xbb94('0x20')](function(_0x1c6052){return _0x1c6052;});}return null;};}function removeEntity(_0x4ccf6f,_0x52f9a6){return function(_0x7d2b46){if(_0x7d2b46){return _0x7d2b46[_0xbb94('0x21')]()[_0xbb94('0x20')](function(){var _0x2c29c0=_0x7d2b46[_0xbb94('0x22')]({'plain':!![]});var _0x58fb2a=_0xbb94('0x23');return db[_0xbb94('0x24')][_0xbb94('0x21')]({'where':{'type':_0x58fb2a,'resourceId':_0x2c29c0['id']}})[_0xbb94('0x20')](function(){return _0x7d2b46;});})['then'](function(){_0x4ccf6f[_0xbb94('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2decc9,_0x1c7125){return function(_0x3e99b3){if(!_0x3e99b3){_0x2decc9[_0xbb94('0x16')](0x194);}return _0x3e99b3;};}function handleError(_0x51fa1d,_0x37e8c6){_0x37e8c6=_0x37e8c6||0x1f4;return function(_0x5ba453){logger['error'](_0x5ba453[_0xbb94('0x25')]);if(_0x5ba453[_0xbb94('0x26')]){delete _0x5ba453[_0xbb94('0x26')];}_0x51fa1d[_0xbb94('0x17')](_0x37e8c6)[_0xbb94('0x27')](_0x5ba453);};}exports[_0xbb94('0x28')]=function(_0x213eef,_0x36cbd6){var _0x5f3cf9={},_0x58efe3={},_0x23b08c={'count':0x0,'rows':[]};var _0x3e5d1d=db[_0xbb94('0x29')][_0xbb94('0x2a')];_0x58efe3['model']=_[_0xbb94('0x2b')](_0x3e5d1d);_0x58efe3[_0xbb94('0x2c')]=_[_0xbb94('0x2b')](_0x213eef['query']);_0x58efe3['filters']=_[_0xbb94('0x2d')](_0x58efe3['model'],_0x58efe3[_0xbb94('0x2c')]);_0x5f3cf9['attributes']=_[_0xbb94('0x2d')](_0x58efe3[_0xbb94('0x2e')],qs[_0xbb94('0x2f')](_0x213eef[_0xbb94('0x2c')]['fields']));_0x5f3cf9[_0xbb94('0x30')]=_0x5f3cf9['attributes']['length']?_0x5f3cf9['attributes']:_0x58efe3[_0xbb94('0x2e')];if(!_0x213eef[_0xbb94('0x2c')][_0xbb94('0x31')](_0xbb94('0x32'))){_0x5f3cf9['limit']=qs[_0xbb94('0x1a')](_0x213eef[_0xbb94('0x2c')][_0xbb94('0x1a')]);_0x5f3cf9[_0xbb94('0x19')]=qs[_0xbb94('0x19')](_0x213eef[_0xbb94('0x2c')][_0xbb94('0x19')]);}_0x5f3cf9[_0xbb94('0x33')]=qs[_0xbb94('0x34')](_0x213eef[_0xbb94('0x2c')][_0xbb94('0x34')]);_0x5f3cf9[_0xbb94('0x35')]=qs[_0xbb94('0x36')](_[_0xbb94('0x37')](_0x213eef[_0xbb94('0x2c')],_0x58efe3[_0xbb94('0x36')]));if(_0x213eef[_0xbb94('0x2c')][_0xbb94('0x38')]){_0x5f3cf9[_0xbb94('0x35')]=_[_0xbb94('0x39')](_0x5f3cf9[_0xbb94('0x35')],{'$or':_[_0xbb94('0x3a')](_0x3e5d1d,function(_0x50c763){if(_0x50c763['type'][_0xbb94('0x3b')]!==_0xbb94('0x3c')){var _0x485d21={};_0x485d21[_0x50c763[_0xbb94('0x3d')]]={'$like':'%'+_0x213eef[_0xbb94('0x2c')][_0xbb94('0x38')]+'%'};return _0x485d21;}})});}_0x5f3cf9=_[_0xbb94('0x39')]({},_0x5f3cf9,_0x213eef[_0xbb94('0x3e')]);var _0x3a27f2={'where':_0x5f3cf9[_0xbb94('0x35')]};return db[_0xbb94('0x29')][_0xbb94('0x3f')](_0x3a27f2)[_0xbb94('0x20')](function(_0x4396cc){_0x23b08c[_0xbb94('0x3f')]=_0x4396cc;if(_0x213eef[_0xbb94('0x2c')][_0xbb94('0x40')]){_0x5f3cf9['include']=[{'all':!![]}];}return db[_0xbb94('0x29')][_0xbb94('0x41')](_0x5f3cf9);})[_0xbb94('0x20')](function(_0x200a94){_0x23b08c['rows']=_0x200a94;return _0x23b08c;})[_0xbb94('0x20')](respondWithFilteredResult(_0x36cbd6,_0x5f3cf9))[_0xbb94('0x42')](handleError(_0x36cbd6,null));};exports[_0xbb94('0x43')]=function(_0x1610ef,_0x5d71c1){var _0x482961={'raw':!![],'where':{'id':_0x1610ef[_0xbb94('0x44')]['id']}},_0x151bc1={};_0x151bc1[_0xbb94('0x2e')]=_[_0xbb94('0x2b')](db[_0xbb94('0x29')][_0xbb94('0x2a')]);_0x151bc1[_0xbb94('0x2c')]=_[_0xbb94('0x2b')](_0x1610ef['query']);_0x151bc1[_0xbb94('0x36')]=_[_0xbb94('0x2d')](_0x151bc1['model'],_0x151bc1[_0xbb94('0x2c')]);_0x482961['attributes']=_['intersection'](_0x151bc1[_0xbb94('0x2e')],qs['fields'](_0x1610ef[_0xbb94('0x2c')][_0xbb94('0x2f')]));_0x482961['attributes']=_0x482961[_0xbb94('0x30')][_0xbb94('0x45')]?_0x482961[_0xbb94('0x30')]:_0x151bc1['model'];if(_0x1610ef[_0xbb94('0x2c')][_0xbb94('0x40')]){_0x482961[_0xbb94('0x46')]=[{'all':!![]}];}_0x482961=_['merge']({},_0x482961,_0x1610ef[_0xbb94('0x3e')]);return db[_0xbb94('0x29')][_0xbb94('0x47')](_0x482961)[_0xbb94('0x20')](handleEntityNotFound(_0x5d71c1,null))[_0xbb94('0x20')](respondWithResult(_0x5d71c1,null))[_0xbb94('0x42')](handleError(_0x5d71c1,null));};exports[_0xbb94('0x48')]=function(_0x4ca376,_0x5bd690){return db[_0xbb94('0x29')][_0xbb94('0x48')](_0x4ca376['body'],{})['then'](function(_0x11cd0f){var _0x1f1b33=_0x4ca376['user'][_0xbb94('0x22')]({'plain':!![]});if(!_0x1f1b33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f1b33[_0xbb94('0x49')]===_0xbb94('0x4a')){var _0x4a0698=_0x11cd0f[_0xbb94('0x22')]({'plain':!![]});var _0x5f381f='Reports';return db[_0xbb94('0x4b')][_0xbb94('0x47')]({'where':{'name':_0x5f381f,'userProfileId':_0x1f1b33[_0xbb94('0x4c')]},'raw':!![]})[_0xbb94('0x20')](function(_0x355440){if(_0x355440&&_0x355440[_0xbb94('0x4d')]===0x0){return db[_0xbb94('0x24')][_0xbb94('0x48')]({'name':_0x4a0698['name'],'resourceId':_0x4a0698['id'],'type':'DefaultReports','sectionId':_0x355440['id']},{})[_0xbb94('0x20')](function(){return _0x11cd0f;});}else{return _0x11cd0f;}})[_0xbb94('0x42')](function(_0x2b19c6){logger['error'](_0xbb94('0x4e'),_0x2b19c6);throw _0x2b19c6;});}return _0x11cd0f;})[_0xbb94('0x20')](respondWithResult(_0x5bd690,0xc9))[_0xbb94('0x42')](handleError(_0x5bd690,null));};exports['update']=function(_0x70040e,_0x54d1d1){if(_0x70040e['body']['id']){delete _0x70040e['body']['id'];}return db[_0xbb94('0x29')]['find']({'where':{'id':_0x70040e[_0xbb94('0x44')]['id']}})[_0xbb94('0x20')](handleEntityNotFound(_0x54d1d1,null))[_0xbb94('0x20')](saveUpdates(_0x70040e[_0xbb94('0x4f')],null))[_0xbb94('0x20')](respondWithResult(_0x54d1d1,null))[_0xbb94('0x42')](handleError(_0x54d1d1,null));};exports[_0xbb94('0x21')]=function(_0x30e89b,_0x5d28c3){return db[_0xbb94('0x29')][_0xbb94('0x47')]({'where':{'id':_0x30e89b[_0xbb94('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d28c3,null))[_0xbb94('0x20')](removeEntity(_0x5d28c3,null))[_0xbb94('0x42')](handleError(_0x5d28c3,null));};exports[_0xbb94('0x50')]=function(_0x382440,_0x5053d2){var _0x4926ce=0xa;var _0x2769da=[_0xbb94('0x51'),'left_join',_0xbb94('0x52'),'cross_join'];var _0x545c17={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb94('0x53'),'MAX':'MAX(%s)','MIN':_0xbb94('0x54'),'AVG':_0xbb94('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb94('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x258379={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbb94('0x57'),'HOUR':_0xbb94('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbb94('0x59')};var _0x5c2d73=function(_0x18340a){return!_['includes'](['IS\x20NULL',_0xbb94('0x5a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x18340a);};var _0x49b5e6=function(_0x1de0d1){if(!_0x1de0d1||!_0x1de0d1[_0xbb94('0x5b')][_0xbb94('0x45')]){return'';}for(var _0x45fe68='(',_0x5bfc50=0x0;_0x5bfc50<_0x1de0d1['rules'][_0xbb94('0x45')];_0x5bfc50+=0x1){_0x5bfc50>0x0&&(_0x45fe68+='\x20'+_0x1de0d1['operator']+'\x20');_0x45fe68+=_0x1de0d1[_0xbb94('0x5b')][_0x5bfc50][_0xbb94('0x5c')]?_0x49b5e6(_0x1de0d1[_0xbb94('0x5b')][_0x5bfc50][_0xbb94('0x5c')]):_0x1de0d1[_0xbb94('0x5b')][_0x5bfc50][_0xbb94('0x3d')]+'\x20'+_0x1de0d1[_0xbb94('0x5b')][_0x5bfc50][_0xbb94('0x5d')]+(_0x5c2d73(_0x1de0d1['rules'][_0x5bfc50][_0xbb94('0x5d')])?'\x20'+_0x1de0d1['rules'][_0x5bfc50]['value']:'');}return _0x45fe68+')';};var _0x55cbe5={'where':{'id':_0x382440[_0xbb94('0x44')]['id']}},_0x1013af,_0xdbc884,_0x3ce042,_0x4177e3,_0x4a561a;_0x55cbe5=_[_0xbb94('0x39')]({},_0x55cbe5,_0x382440[_0xbb94('0x3e')]);return db[_0xbb94('0x29')][_0xbb94('0x47')](_0x55cbe5)[_0xbb94('0x20')](function(_0x828296){if(_0x828296){_0x1013af=_0x828296;return _0x828296['getFields']();}return null;})[_0xbb94('0x20')](function(_0x129656){if(_0x129656){if(!_0x129656[_0xbb94('0x45')]){throw new db['Sequelize'][(_0xbb94('0x5e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xdbc884=_0x129656;return db[_0xbb94('0x5f')][_0xbb94('0x41')]({'raw':!![]});}return null;})[_0xbb94('0x20')](function(_0xa0e0c6){if(_0xa0e0c6){_0x3ce042=_['keyBy'](_0xa0e0c6,'id');var _0x44a131;var _0x327210=squel[_0xbb94('0x60')]();_0x327210[_0xbb94('0x61')](_0x1013af[_0xbb94('0x62')]);for(var _0x1911ea=0x0;_0x1911ea<_0xdbc884[_0xbb94('0x45')];_0x1911ea+=0x1){_0x44a131=_0xdbc884[_0x1911ea]['MetricId']?_0x3ce042[_0xdbc884[_0x1911ea]['MetricId']][_0xbb94('0x63')]:_0xdbc884[_0x1911ea][_0xbb94('0x3d')];_0x44a131=_0xdbc884[_0x1911ea]['function']?_[_0xbb94('0x64')](_0x545c17[_0xdbc884[_0x1911ea][_0xbb94('0x65')]],'%s',_0x44a131):_0x44a131;_0x44a131=_0xdbc884[_0x1911ea]['format']?_[_0xbb94('0x64')](_0x258379[_0xdbc884[_0x1911ea][_0xbb94('0x66')]],'%s',_0x44a131):_0x44a131;if(_0xdbc884[_0x1911ea][_0xbb94('0x67')]){_0x327210['group'](_0x44a131);}_0xdbc884[_0x1911ea][_0xbb94('0x68')]&&_0x327210[_0xbb94('0x33')](_0x44a131,_0xdbc884[_0x1911ea][_0xbb94('0x68')]==='DESC'?![]:!![]);_0x327210[_0xbb94('0x3d')](_0x44a131,_0xdbc884[_0x1911ea][_0xbb94('0x69')]||_0x44a131);}if(_0x1013af['joins']){_0x1013af[_0xbb94('0x6a')]=JSON[_0xbb94('0x6b')](_0x1013af[_0xbb94('0x6a')]);for(var _0x2d88ae=0x0;_0x2d88ae<_0x1013af[_0xbb94('0x6a')][_0xbb94('0x45')];_0x2d88ae+=0x1){if(_0x1013af[_0xbb94('0x6a')][_0x2d88ae][_0xbb94('0x6c')]&&_[_0xbb94('0x6d')](_0x2769da,_0x1013af['joins'][_0x2d88ae]['type'])&&_0x1013af[_0xbb94('0x6a')][_0x2d88ae]['parentKey']&&_0x1013af[_0xbb94('0x6a')][_0x2d88ae]['foreignTable']&&_0x1013af[_0xbb94('0x6a')][_0x2d88ae][_0xbb94('0x6e')]){_0x327210[_0x1013af[_0xbb94('0x6a')][_0x2d88ae][_0xbb94('0x6c')]](_0x1013af[_0xbb94('0x6a')][_0x2d88ae]['foreignTable'],null,util['format'](_0xbb94('0x6f'),_0x1013af[_0xbb94('0x62')],_0x1013af[_0xbb94('0x6a')][_0x2d88ae]['parentKey'],_0x1013af['joins'][_0x2d88ae][_0xbb94('0x70')],_0x1013af['joins'][_0x2d88ae][_0xbb94('0x6e')]));}}}if(_0x1013af[_0xbb94('0x71')]){_0x1013af[_0xbb94('0x71')]=JSON[_0xbb94('0x6b')](_0x1013af[_0xbb94('0x71')]);_0x327210[_0xbb94('0x35')](_0x49b5e6(_0x1013af[_0xbb94('0x71')][_0xbb94('0x5c')]));}_0x4a561a=_0x327210[_0xbb94('0x72')]();_0x327210[_0xbb94('0x1a')](_0x4926ce);_0x327210[_0xbb94('0x19')](0x0);logger[_0xbb94('0x73')](_0xbb94('0x74'),_0x327210['toString']());return db[_0xbb94('0x75')]['query'](_0x327210[_0xbb94('0x76')](),{'type':db[_0xbb94('0x75')][_0xbb94('0x77')]['SELECT']});}})[_0xbb94('0x20')](respondWithResult(_0x5053d2,null))[_0xbb94('0x42')](handleError(_0x5053d2,null));};function runReport(_0x40cff5,_0x10d1f9,_0x337052){var _0x597fe3=_0x10d1f9['name'];var _0x5978a1=0xa;var _0x123416=[_0xbb94('0x51'),_0xbb94('0x78'),_0xbb94('0x52'),_0xbb94('0x79')];var _0x54816b={'SUM':_0xbb94('0x7a'),'COUNT':_0xbb94('0x7b'),'COUNT DISTINCT':_0xbb94('0x53'),'MAX':_0xbb94('0x7c'),'MIN':_0xbb94('0x54'),'AVG':_0xbb94('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb94('0x56'),'GROUP_CONCAT DESC':_0xbb94('0x7d')};var _0x37bd45={'SEC_TO_TIME':_0xbb94('0x7e'),'DATE':_0xbb94('0x57'),'HOUR':_0xbb94('0x58'),'ROUND':_0xbb94('0x7f'),'UNIX_TIMESTAMP':_0xbb94('0x59')};var _0x5bbcd8=function(_0x49a349){return!_[_0xbb94('0x6d')]([_0xbb94('0x80'),_0xbb94('0x5a'),_0xbb94('0x81'),_0xbb94('0x82')],_0x49a349);};var _0x3faf08=function(_0x286792){if(!_0x286792||!_0x286792[_0xbb94('0x5b')][_0xbb94('0x45')]){return'';}for(var _0x35bd0d='(',_0x59ec50=0x0;_0x59ec50<_0x286792[_0xbb94('0x5b')]['length'];_0x59ec50+=0x1){_0x59ec50>0x0&&(_0x35bd0d+='\x20'+_0x286792[_0xbb94('0x83')]+'\x20');_0x35bd0d+=_0x286792[_0xbb94('0x5b')][_0x59ec50][_0xbb94('0x5c')]?_0x3faf08(_0x286792['rules'][_0x59ec50][_0xbb94('0x5c')]):_0x286792[_0xbb94('0x5b')][_0x59ec50][_0xbb94('0x3d')]+'\x20'+_0x286792[_0xbb94('0x5b')][_0x59ec50][_0xbb94('0x5d')]+(_0x5bbcd8(_0x286792[_0xbb94('0x5b')][_0x59ec50][_0xbb94('0x5d')])?'\x20'+_0x286792[_0xbb94('0x5b')][_0x59ec50]['value']:'');}return _0x35bd0d+')';};var _0xc234a0={'where':{'id':_0x40cff5['id']}},_0x3cd839,_0x56a974,_0x1f2e01,_0x372d00,_0x358955;_0xc234a0=_[_0xbb94('0x39')]({},_0xc234a0,_0x337052);return db[_0xbb94('0x29')]['find'](_0xc234a0)[_0xbb94('0x20')](function(_0x264336){if(_0x264336){_0x3cd839=_0x264336;return _0x264336[_0xbb94('0x84')]();}return null;})[_0xbb94('0x20')](function(_0x3c6456){if(_0x3c6456){if(!_0x3c6456[_0xbb94('0x45')]){throw new db[(_0xbb94('0x85'))][(_0xbb94('0x5e'))](_0xbb94('0x86'),0x193);}_0x56a974=_0x3c6456;return db[_0xbb94('0x5f')][_0xbb94('0x41')]({'raw':!![]});}return null;})[_0xbb94('0x20')](function(_0x95b91f){if(_0x95b91f){_0x1f2e01=_[_0xbb94('0x87')](_0x95b91f,'id');var _0x505074;var _0x1b2926=squel[_0xbb94('0x60')]();_0x1b2926[_0xbb94('0x61')](_0x3cd839[_0xbb94('0x62')]);for(var _0x47bf2a=0x0;_0x47bf2a<_0x56a974[_0xbb94('0x45')];_0x47bf2a+=0x1){_0x505074=_0x56a974[_0x47bf2a][_0xbb94('0x88')]?_0x1f2e01[_0x56a974[_0x47bf2a]['MetricId']][_0xbb94('0x63')]:_0x56a974[_0x47bf2a]['field'];_0x505074=_0x56a974[_0x47bf2a][_0xbb94('0x65')]?_[_0xbb94('0x64')](_0x54816b[_0x56a974[_0x47bf2a][_0xbb94('0x65')]],'%s',_0x505074):_0x505074;_0x505074=_0x56a974[_0x47bf2a][_0xbb94('0x66')]?_[_0xbb94('0x64')](_0x37bd45[_0x56a974[_0x47bf2a][_0xbb94('0x66')]],'%s',_0x505074):_0x505074;if(_0x56a974[_0x47bf2a][_0xbb94('0x67')]){_0x1b2926[_0xbb94('0x5c')](_0x505074);}_0x56a974[_0x47bf2a][_0xbb94('0x68')]&&_0x1b2926[_0xbb94('0x33')](_0x505074,_0x56a974[_0x47bf2a][_0xbb94('0x68')]==='DESC'?![]:!![]);_0x1b2926['field'](_0x505074,_0x56a974[_0x47bf2a][_0xbb94('0x69')]||_0x505074);}if(_0x3cd839[_0xbb94('0x6a')]){_0x3cd839[_0xbb94('0x6a')]=JSON['parse'](_0x3cd839[_0xbb94('0x6a')]);for(var _0x273abe=0x0;_0x273abe<_0x3cd839[_0xbb94('0x6a')][_0xbb94('0x45')];_0x273abe+=0x1){if(_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x6c')]&&_[_0xbb94('0x6d')](_0x123416,_0x3cd839['joins'][_0x273abe]['type'])&&_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x89')]&&_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x70')]&&_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x6e')]){_0x1b2926[_0x3cd839['joins'][_0x273abe][_0xbb94('0x6c')]](_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x70')],null,util[_0xbb94('0x66')](_0xbb94('0x6f'),_0x3cd839[_0xbb94('0x62')],_0x3cd839['joins'][_0x273abe][_0xbb94('0x89')],_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x70')],_0x3cd839[_0xbb94('0x6a')][_0x273abe][_0xbb94('0x6e')]));}}}if(_0x3cd839[_0xbb94('0x71')]){_0x3cd839[_0xbb94('0x71')]=JSON['parse'](_0x3cd839[_0xbb94('0x71')]);_0x1b2926[_0xbb94('0x35')](_0x3faf08(_0x3cd839['conditions'][_0xbb94('0x5c')]));}_0x358955=_0x1b2926[_0xbb94('0x72')]();_0x1b2926[_0xbb94('0x1a')](_0x5978a1);_0x1b2926[_0xbb94('0x19')](0x0);logger[_0xbb94('0x73')]('Limited\x20Query:',_0x1b2926[_0xbb94('0x76')]());return db[_0xbb94('0x75')][_0xbb94('0x2c')](_0x1b2926['toString'](),{'type':db[_0xbb94('0x75')][_0xbb94('0x77')]['SELECT']});}})[_0xbb94('0x20')](function(_0x265c13){if(!_0x265c13[_0xbb94('0x45')]){throw new db['Sequelize'][(_0xbb94('0x5e'))](_0xbb94('0x8a'),0xcc);}if(_0x10d1f9['output']===_0xbb94('0x8b')){return null;}var _0x531f76=_['merge'](_0x10d1f9,{'name':_0x10d1f9[_0xbb94('0x8c')]||_0x10d1f9['name']||_0x3cd839['name'],'basename':_0x597fe3,'savename':util['format'](_0xbb94('0x8d'),_0x10d1f9['name']||_0x3cd839[_0xbb94('0x26')],require(_0xbb94('0x8e'))[_0xbb94('0x8f')](0x4),_0x10d1f9[_0xbb94('0x90')]||'csv'),'reportId':_0x3cd839['id'],'reportType':_0xbb94('0x91')});return db['AnalyticExtractedReport'][_0xbb94('0x48')](_0x531f76,{'raw':!![]});})[_0xbb94('0x20')](function(_0xe97b3a){if(_0x3cd839[_0xbb94('0x62')]===_0xbb94('0x92')){_0x358955[_0xbb94('0x35')](_0x3cd839[_0xbb94('0x62')]+_0xbb94('0x93'),_0x10d1f9[_0xbb94('0x94')],_0x10d1f9[_0xbb94('0x95')]);}else{_0x358955[_0xbb94('0x35')](_0x3cd839['table']+_0xbb94('0x96'),_0x10d1f9[_0xbb94('0x94')],_0x10d1f9[_0xbb94('0x95')]);}if(_0xe97b3a){logger[_0xbb94('0x97')](_0xbb94('0x98'),_0x358955['toString']());require(_0xbb94('0x99'))[_0xbb94('0x9a')](path[_0xbb94('0x51')](__dirname,_0xbb94('0x9b'),_0xe97b3a[_0xbb94('0x90')]),[_0xe97b3a['id'],_0x358955[_0xbb94('0x76')](),path[_0xbb94('0x51')](__dirname,_0xbb94('0x9c'),_0xe97b3a[_0xbb94('0x9d')]),_0x597fe3]);return _0xe97b3a;}else{var _0xa4e26f=squel['select']();_0xa4e26f[_0xbb94('0x61')]('('+_0x358955[_0xbb94('0x76')]()+')',_0xbb94('0x9e'));_0xa4e26f[_0xbb94('0x3d')](_0xbb94('0x9f'),_0xbb94('0x3f'));_0x358955['limit'](_0x10d1f9['limit']||_0x5978a1);_0x358955[_0xbb94('0x19')](_0x10d1f9[_0xbb94('0x19')]||0x0);return db['sequelize']['query'](_0xa4e26f[_0xbb94('0x76')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x5e0e75){if(!_0x5e0e75[_0xbb94('0x45')]){_0x372d00=0x0;}else{_0x372d00=_0x5e0e75[0x0]['count']||0x0;}return db['sequelize'][_0xbb94('0x2c')](_0x358955['toString'](),{'type':db[_0xbb94('0x75')]['QueryTypes'][_0xbb94('0xa0')]});})[_0xbb94('0x20')](function(_0x41e0ba){return{'rows':_0x41e0ba||[],'count':_0x372d00};});}});}exports[_0xbb94('0xa1')]=function(_0x54e09a,_0x43107b){return runReport(_0x54e09a['params'],_0x54e09a[_0xbb94('0x2c')],_0x54e09a[_0xbb94('0x3e')])[_0xbb94('0x20')](respondWithResult(_0x43107b,null))[_0xbb94('0x42')](handleError(_0x43107b,null));};exports['runReport']=runReport;exports[_0xbb94('0x2c')]=function(_0x254443,_0x1a7812){var _0x13a4e5=0xa;var _0x1d9914=[_0xbb94('0x51'),_0xbb94('0x78'),_0xbb94('0x52'),_0xbb94('0x79')];var _0x3ab564={'SUM':_0xbb94('0x7a'),'COUNT':_0xbb94('0x7b'),'COUNT DISTINCT':_0xbb94('0x53'),'MAX':'MAX(%s)','MIN':_0xbb94('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb94('0x56'),'GROUP_CONCAT DESC':_0xbb94('0x7d')};var _0x10d5af={'SEC_TO_TIME':_0xbb94('0x7e'),'DATE':'DATE(%s)','HOUR':_0xbb94('0x58'),'ROUND':_0xbb94('0x7f'),'UNIX_TIMESTAMP':_0xbb94('0x59')};var _0x5a6c7c=function(_0x2cb538){return!_[_0xbb94('0x6d')](['IS\x20NULL',_0xbb94('0x5a'),_0xbb94('0x81'),_0xbb94('0x82')],_0x2cb538);};var _0x2c2f79=function(_0x29d829){if(!_0x29d829||!_0x29d829[_0xbb94('0x5b')]['length']){return'';}for(var _0xbd730='(',_0x5523b8=0x0;_0x5523b8<_0x29d829['rules']['length'];_0x5523b8+=0x1){_0x5523b8>0x0&&(_0xbd730+='\x20'+_0x29d829[_0xbb94('0x83')]+'\x20');_0xbd730+=_0x29d829[_0xbb94('0x5b')][_0x5523b8][_0xbb94('0x5c')]?_0x2c2f79(_0x29d829[_0xbb94('0x5b')][_0x5523b8][_0xbb94('0x5c')]):_0x29d829[_0xbb94('0x5b')][_0x5523b8][_0xbb94('0x3d')]+'\x20'+_0x29d829[_0xbb94('0x5b')][_0x5523b8][_0xbb94('0x5d')]+(_0x5a6c7c(_0x29d829['rules'][_0x5523b8][_0xbb94('0x5d')])?'\x20'+_0x29d829['rules'][_0x5523b8]['value']:'');}return _0xbd730+')';};var _0x24c57f={'where':{'id':_0x254443['params']['id']}},_0xd486c4,_0x42e96e,_0x3ee20a,_0x398394,_0x47de38;_0x24c57f=_[_0xbb94('0x39')]({},_0x24c57f,_0x254443[_0xbb94('0x3e')]);return db[_0xbb94('0x29')][_0xbb94('0x47')](_0x24c57f)['then'](function(_0x344b2b){if(_0x344b2b){_0xd486c4=_0x344b2b;return _0x344b2b[_0xbb94('0x84')]();}return null;})['then'](function(_0x4b1397){if(_0x4b1397){if(!_0x4b1397['length']){throw new db[(_0xbb94('0x85'))][(_0xbb94('0x5e'))](_0xbb94('0x86'),0x193);}_0x42e96e=_0x4b1397;return db['AnalyticMetric'][_0xbb94('0x41')]({'raw':!![]});}return null;})[_0xbb94('0x20')](function(_0x1e8352){if(_0x1e8352){_0x3ee20a=_[_0xbb94('0x87')](_0x1e8352,'id');var _0x41c27d;var _0x2f9f1a=squel['select']();_0x2f9f1a[_0xbb94('0x61')](_0xd486c4[_0xbb94('0x62')]);for(var _0x5cbe86=0x0;_0x5cbe86<_0x42e96e['length'];_0x5cbe86+=0x1){_0x41c27d=_0x42e96e[_0x5cbe86][_0xbb94('0x88')]?_0x3ee20a[_0x42e96e[_0x5cbe86]['MetricId']][_0xbb94('0x63')]:_0x42e96e[_0x5cbe86]['field'];_0x41c27d=_0x42e96e[_0x5cbe86][_0xbb94('0x65')]?_['replace'](_0x3ab564[_0x42e96e[_0x5cbe86][_0xbb94('0x65')]],'%s',_0x41c27d):_0x41c27d;_0x41c27d=_0x42e96e[_0x5cbe86][_0xbb94('0x66')]?_['replace'](_0x10d5af[_0x42e96e[_0x5cbe86][_0xbb94('0x66')]],'%s',_0x41c27d):_0x41c27d;if(_0x42e96e[_0x5cbe86][_0xbb94('0x67')]){_0x2f9f1a[_0xbb94('0x5c')](_0x41c27d);}_0x42e96e[_0x5cbe86]['orderBy']&&_0x2f9f1a[_0xbb94('0x33')](_0x41c27d,_0x42e96e[_0x5cbe86][_0xbb94('0x68')]===_0xbb94('0xa2')?![]:!![]);_0x2f9f1a[_0xbb94('0x3d')](_0x41c27d,_0x42e96e[_0x5cbe86][_0xbb94('0x69')]||_0x41c27d);}if(_0xd486c4[_0xbb94('0x6a')]){_0xd486c4[_0xbb94('0x6a')]=JSON[_0xbb94('0x6b')](_0xd486c4[_0xbb94('0x6a')]);for(var _0x1b05c6=0x0;_0x1b05c6<_0xd486c4['joins']['length'];_0x1b05c6+=0x1){if(_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x6c')]&&_[_0xbb94('0x6d')](_0x1d9914,_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x6c')])&&_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x89')]&&_0xd486c4['joins'][_0x1b05c6][_0xbb94('0x70')]&&_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x6e')]){_0x2f9f1a[_0xd486c4['joins'][_0x1b05c6][_0xbb94('0x6c')]](_0xd486c4['joins'][_0x1b05c6][_0xbb94('0x70')],null,util[_0xbb94('0x66')](_0xbb94('0x6f'),_0xd486c4['table'],_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x89')],_0xd486c4[_0xbb94('0x6a')][_0x1b05c6][_0xbb94('0x70')],_0xd486c4['joins'][_0x1b05c6][_0xbb94('0x6e')]));}}}if(_0xd486c4[_0xbb94('0x71')]){_0xd486c4[_0xbb94('0x71')]=JSON[_0xbb94('0x6b')](_0xd486c4[_0xbb94('0x71')]);_0x2f9f1a[_0xbb94('0x35')](_0x2c2f79(_0xd486c4[_0xbb94('0x71')][_0xbb94('0x5c')]));}_0x47de38=_0x2f9f1a['clone']();_0x2f9f1a[_0xbb94('0x1a')](_0x13a4e5);_0x2f9f1a[_0xbb94('0x19')](0x0);logger[_0xbb94('0x73')](_0xbb94('0x74'),_0x2f9f1a[_0xbb94('0x76')]());return db['sequelize'][_0xbb94('0x2c')](_0x2f9f1a[_0xbb94('0x76')](),{'type':db[_0xbb94('0x75')][_0xbb94('0x77')][_0xbb94('0xa0')]});}})[_0xbb94('0x20')](function(){return{'sql':_0x47de38[_0xbb94('0x76')]()};})[_0xbb94('0x20')](respondWithResult(_0x1a7812,null))[_0xbb94('0x42')](handleError(_0x1a7812,null));}; \ No newline at end of file +var _0x60bb=['ejs','lodash','squel','crypto','desk.js','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','includeAll','show','params','include','find','catch','create','body','user','role','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','SEC_TO_TIME(%s)','ValidationErrorItem','groupBy','No\x20available\x20data','output','web','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','run','runReport','operator','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5111a5,_0x2a2866){var _0x373915=function(_0x3c61c0){while(--_0x3c61c0){_0x5111a5['push'](_0x5111a5['shift']());}};_0x373915(++_0x2a2866);}(_0x60bb,0x12f));var _0xb60b=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x60bb[_0x427217];return _0x5b28fb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb60b('0x0'));var rimraf=require(_0xb60b('0x1'));var zipdir=require(_0xb60b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb60b('0x3'));var moment=require(_0xb60b('0x4'));var BPromise=require(_0xb60b('0x5'));var Mustache=require(_0xb60b('0x6'));var util=require(_0xb60b('0x7'));var path=require(_0xb60b('0x8'));var sox=require(_0xb60b('0x9'));var csv=require(_0xb60b('0xa'));var ejs=require(_0xb60b('0xb'));var fs=require('fs');var _=require(_0xb60b('0xc'));var squel=require(_0xb60b('0xd'));var crypto=require(_0xb60b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb60b('0xf'));var toCsv=require(_0xb60b('0xa'));var querystring=require(_0xb60b('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xb60b('0x11'));var Redis=require('ioredis');var qs=require(_0xb60b('0x12'));var logger=require(_0xb60b('0x13'))(_0xb60b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14aae0,_0x589131){_0x589131=_0x589131||0xcc;return function(_0x2699f9){if(_0x2699f9){return _0x14aae0['sendStatus'](_0x589131);}return _0x14aae0[_0xb60b('0x15')](_0x589131)[_0xb60b('0x16')]();};}function respondWithResult(_0x47c7eb,_0x19e9cf){_0x19e9cf=_0x19e9cf||0xc8;return function(_0x2c3221){if(_0x2c3221){return _0x47c7eb[_0xb60b('0x15')](_0x19e9cf)[_0xb60b('0x17')](_0x2c3221);}};}function respondWithFilteredResult(_0xcf872b,_0x377f4a){return function(_0x3fdaf4){if(_0x3fdaf4){var _0x15c0d3=_0x3fdaf4[_0xb60b('0x18')],_0x442ac2=_0x377f4a[_0xb60b('0x19')],_0x3f8dd2=_0x377f4a['offset']+_0x377f4a[_0xb60b('0x1a')],_0x46f0aa;if(_0x3f8dd2>=_0x15c0d3){_0x3f8dd2=_0x15c0d3;_0x46f0aa=0xc8;}else{_0x46f0aa=0xce;}_0xcf872b[_0xb60b('0x15')](_0x46f0aa);return _0xcf872b[_0xb60b('0x1b')](_0xb60b('0x1c'),_0x442ac2+'-'+_0x3f8dd2+'/'+_0x15c0d3)[_0xb60b('0x17')](_0x3fdaf4);}return null;};}function patchUpdates(_0x3b5b3e){return function(_0x2d283a){try{jsonpatch[_0xb60b('0x1d')](_0x2d283a,_0x3b5b3e,!![]);}catch(_0x1e73fd){return BPromise[_0xb60b('0x1e')](_0x1e73fd);}return _0x2d283a[_0xb60b('0x1f')]();};}function saveUpdates(_0x3ab786,_0x5cd8fc){return function(_0x1635fe){if(_0x1635fe){return _0x1635fe['update'](_0x3ab786)[_0xb60b('0x20')](function(_0x2e5e0e){return _0x2e5e0e;});}return null;};}function removeEntity(_0xbff4a1,_0x1adf93){return function(_0xe832ab){if(_0xe832ab){return _0xe832ab['destroy']()[_0xb60b('0x20')](function(){var _0x17e782=_0xe832ab[_0xb60b('0x21')]({'plain':!![]});var _0x4606fb=_0xb60b('0x22');return db[_0xb60b('0x23')][_0xb60b('0x24')]({'where':{'type':_0x4606fb,'resourceId':_0x17e782['id']}})[_0xb60b('0x20')](function(){return _0xe832ab;});})['then'](function(){_0xbff4a1['status'](0xcc)[_0xb60b('0x16')]();});}};}function handleEntityNotFound(_0x176a55,_0x1bac56){return function(_0x14ff25){if(!_0x14ff25){_0x176a55[_0xb60b('0x25')](0x194);}return _0x14ff25;};}function handleError(_0x11dc32,_0x1f47d7){_0x1f47d7=_0x1f47d7||0x1f4;return function(_0xccbbbe){logger[_0xb60b('0x26')](_0xccbbbe['stack']);if(_0xccbbbe[_0xb60b('0x27')]){delete _0xccbbbe[_0xb60b('0x27')];}_0x11dc32[_0xb60b('0x15')](_0x1f47d7)['send'](_0xccbbbe);};}exports['index']=function(_0x462e0c,_0x17309c){var _0x10ee54={},_0x48e0aa={},_0xa609bb={'count':0x0,'rows':[]};var _0x5ed0bb=db[_0xb60b('0x28')][_0xb60b('0x29')];_0x48e0aa[_0xb60b('0x2a')]=_[_0xb60b('0x2b')](_0x5ed0bb);_0x48e0aa[_0xb60b('0x2c')]=_[_0xb60b('0x2b')](_0x462e0c[_0xb60b('0x2c')]);_0x48e0aa[_0xb60b('0x2d')]=_[_0xb60b('0x2e')](_0x48e0aa[_0xb60b('0x2a')],_0x48e0aa[_0xb60b('0x2c')]);_0x10ee54[_0xb60b('0x2f')]=_[_0xb60b('0x2e')](_0x48e0aa['model'],qs[_0xb60b('0x30')](_0x462e0c[_0xb60b('0x2c')][_0xb60b('0x30')]));_0x10ee54[_0xb60b('0x2f')]=_0x10ee54[_0xb60b('0x2f')][_0xb60b('0x31')]?_0x10ee54[_0xb60b('0x2f')]:_0x48e0aa[_0xb60b('0x2a')];if(!_0x462e0c[_0xb60b('0x2c')][_0xb60b('0x32')]('nolimit')){_0x10ee54[_0xb60b('0x1a')]=qs[_0xb60b('0x1a')](_0x462e0c['query']['limit']);_0x10ee54[_0xb60b('0x19')]=qs[_0xb60b('0x19')](_0x462e0c[_0xb60b('0x2c')][_0xb60b('0x19')]);}_0x10ee54[_0xb60b('0x33')]=qs[_0xb60b('0x34')](_0x462e0c[_0xb60b('0x2c')]['sort']);_0x10ee54[_0xb60b('0x35')]=qs['filters'](_[_0xb60b('0x36')](_0x462e0c['query'],_0x48e0aa[_0xb60b('0x2d')]));if(_0x462e0c[_0xb60b('0x2c')]['filter']){_0x10ee54['where']=_[_0xb60b('0x37')](_0x10ee54[_0xb60b('0x35')],{'$or':_['map'](_0x5ed0bb,function(_0x3748cd){if(_0x3748cd[_0xb60b('0x38')][_0xb60b('0x39')]!==_0xb60b('0x3a')){var _0x4ca82e={};_0x4ca82e[_0x3748cd[_0xb60b('0x3b')]]={'$like':'%'+_0x462e0c[_0xb60b('0x2c')]['filter']+'%'};return _0x4ca82e;}})});}_0x10ee54=_[_0xb60b('0x37')]({},_0x10ee54,_0x462e0c[_0xb60b('0x3c')]);var _0x437941={'where':_0x10ee54[_0xb60b('0x35')]};return db['AnalyticDefaultReport'][_0xb60b('0x18')](_0x437941)[_0xb60b('0x20')](function(_0x51069b){_0xa609bb[_0xb60b('0x18')]=_0x51069b;if(_0x462e0c[_0xb60b('0x2c')][_0xb60b('0x3d')]){_0x10ee54['include']=[{'all':!![]}];}return db['AnalyticDefaultReport']['findAll'](_0x10ee54);})[_0xb60b('0x20')](function(_0x571b52){_0xa609bb['rows']=_0x571b52;return _0xa609bb;})['then'](respondWithFilteredResult(_0x17309c,_0x10ee54))['catch'](handleError(_0x17309c,null));};exports[_0xb60b('0x3e')]=function(_0x39fc28,_0x388f10){var _0x3eb981={'raw':!![],'where':{'id':_0x39fc28[_0xb60b('0x3f')]['id']}},_0x4100e5={};_0x4100e5[_0xb60b('0x2a')]=_[_0xb60b('0x2b')](db[_0xb60b('0x28')][_0xb60b('0x29')]);_0x4100e5[_0xb60b('0x2c')]=_['keys'](_0x39fc28[_0xb60b('0x2c')]);_0x4100e5['filters']=_[_0xb60b('0x2e')](_0x4100e5['model'],_0x4100e5[_0xb60b('0x2c')]);_0x3eb981[_0xb60b('0x2f')]=_[_0xb60b('0x2e')](_0x4100e5[_0xb60b('0x2a')],qs[_0xb60b('0x30')](_0x39fc28['query']['fields']));_0x3eb981['attributes']=_0x3eb981[_0xb60b('0x2f')][_0xb60b('0x31')]?_0x3eb981[_0xb60b('0x2f')]:_0x4100e5['model'];if(_0x39fc28['query'][_0xb60b('0x3d')]){_0x3eb981[_0xb60b('0x40')]=[{'all':!![]}];}_0x3eb981=_['merge']({},_0x3eb981,_0x39fc28['options']);return db[_0xb60b('0x28')][_0xb60b('0x41')](_0x3eb981)['then'](handleEntityNotFound(_0x388f10,null))['then'](respondWithResult(_0x388f10,null))[_0xb60b('0x42')](handleError(_0x388f10,null));};exports[_0xb60b('0x43')]=function(_0x2b331a,_0x572668){return db[_0xb60b('0x28')][_0xb60b('0x43')](_0x2b331a[_0xb60b('0x44')],{})[_0xb60b('0x20')](function(_0x2b7e19){var _0x1648ad=_0x2b331a[_0xb60b('0x45')][_0xb60b('0x21')]({'plain':!![]});if(!_0x1648ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1648ad[_0xb60b('0x46')]===_0xb60b('0x45')){var _0x50491a=_0x2b7e19['get']({'plain':!![]});var _0x1f4ec0=_0xb60b('0x47');return db[_0xb60b('0x48')][_0xb60b('0x41')]({'where':{'name':_0x1f4ec0,'userProfileId':_0x1648ad['userProfileId']},'raw':!![]})['then'](function(_0x175b92){if(_0x175b92&&_0x175b92['autoAssociation']===0x0){return db[_0xb60b('0x23')][_0xb60b('0x43')]({'name':_0x50491a['name'],'resourceId':_0x50491a['id'],'type':_0xb60b('0x22'),'sectionId':_0x175b92['id']},{})[_0xb60b('0x20')](function(){return _0x2b7e19;});}else{return _0x2b7e19;}})[_0xb60b('0x42')](function(_0x2f3820){logger[_0xb60b('0x26')](_0xb60b('0x49'),_0x2f3820);throw _0x2f3820;});}return _0x2b7e19;})[_0xb60b('0x20')](respondWithResult(_0x572668,0xc9))[_0xb60b('0x42')](handleError(_0x572668,null));};exports[_0xb60b('0x4a')]=function(_0x33e5bc,_0x186427){if(_0x33e5bc[_0xb60b('0x44')]['id']){delete _0x33e5bc['body']['id'];}return db['AnalyticDefaultReport'][_0xb60b('0x41')]({'where':{'id':_0x33e5bc[_0xb60b('0x3f')]['id']}})[_0xb60b('0x20')](handleEntityNotFound(_0x186427,null))[_0xb60b('0x20')](saveUpdates(_0x33e5bc[_0xb60b('0x44')],null))['then'](respondWithResult(_0x186427,null))[_0xb60b('0x42')](handleError(_0x186427,null));};exports[_0xb60b('0x24')]=function(_0x2a6b7b,_0x36fc8b){return db[_0xb60b('0x28')]['find']({'where':{'id':_0x2a6b7b[_0xb60b('0x3f')]['id']}})[_0xb60b('0x20')](handleEntityNotFound(_0x36fc8b,null))['then'](removeEntity(_0x36fc8b,null))[_0xb60b('0x42')](handleError(_0x36fc8b,null));};exports[_0xb60b('0x4b')]=function(_0xc0fac5,_0x1ccd10){var _0x6adca7=0xa;var _0x410ad7=[_0xb60b('0x4c'),_0xb60b('0x4d'),'right_join',_0xb60b('0x4e')];var _0x3910ef={'SUM':_0xb60b('0x4f'),'COUNT':_0xb60b('0x50'),'COUNT DISTINCT':_0xb60b('0x51'),'MAX':_0xb60b('0x52'),'MIN':_0xb60b('0x53'),'AVG':_0xb60b('0x54'),'GROUP_CONCAT':_0xb60b('0x55'),'GROUP_CONCAT ASC':_0xb60b('0x56'),'GROUP_CONCAT DESC':_0xb60b('0x57')};var _0x13b52e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb60b('0x58'),'HOUR':_0xb60b('0x59'),'ROUND':_0xb60b('0x5a'),'UNIX_TIMESTAMP':_0xb60b('0x5b')};var _0x57e9c5=function(_0x2a3239){return!_[_0xb60b('0x5c')]([_0xb60b('0x5d'),_0xb60b('0x5e'),_0xb60b('0x5f'),_0xb60b('0x60')],_0x2a3239);};var _0x5e2b65=function(_0x411fea){if(!_0x411fea||!_0x411fea[_0xb60b('0x61')][_0xb60b('0x31')]){return'';}for(var _0x2c6410='(',_0x45f7c7=0x0;_0x45f7c7<_0x411fea[_0xb60b('0x61')]['length'];_0x45f7c7+=0x1){_0x45f7c7>0x0&&(_0x2c6410+='\x20'+_0x411fea['operator']+'\x20');_0x2c6410+=_0x411fea[_0xb60b('0x61')][_0x45f7c7][_0xb60b('0x62')]?_0x5e2b65(_0x411fea['rules'][_0x45f7c7][_0xb60b('0x62')]):_0x411fea['rules'][_0x45f7c7][_0xb60b('0x3b')]+'\x20'+_0x411fea[_0xb60b('0x61')][_0x45f7c7][_0xb60b('0x63')]+(_0x57e9c5(_0x411fea[_0xb60b('0x61')][_0x45f7c7][_0xb60b('0x63')])?'\x20'+_0x411fea['rules'][_0x45f7c7][_0xb60b('0x64')]:'');}return _0x2c6410+')';};var _0x564e45={'where':{'id':_0xc0fac5[_0xb60b('0x3f')]['id']}},_0x15a696,_0x22305d,_0x313429,_0x27a7e8,_0x516ca7;_0x564e45=_[_0xb60b('0x37')]({},_0x564e45,_0xc0fac5['options']);return db['AnalyticDefaultReport'][_0xb60b('0x41')](_0x564e45)[_0xb60b('0x20')](function(_0x502ef5){if(_0x502ef5){_0x15a696=_0x502ef5;return _0x502ef5[_0xb60b('0x65')]();}return null;})['then'](function(_0x637ef4){if(_0x637ef4){if(!_0x637ef4[_0xb60b('0x31')]){throw new db[(_0xb60b('0x66'))]['ValidationErrorItem'](_0xb60b('0x67'),0x193);}_0x22305d=_0x637ef4;return db[_0xb60b('0x68')][_0xb60b('0x69')]({'raw':!![]});}return null;})[_0xb60b('0x20')](function(_0x4e6246){if(_0x4e6246){_0x313429=_[_0xb60b('0x6a')](_0x4e6246,'id');var _0x49f130;var _0xd36cc0=squel[_0xb60b('0x6b')]();_0xd36cc0[_0xb60b('0x6c')](_0x15a696['table']);for(var _0x57d5e5=0x0;_0x57d5e5<_0x22305d[_0xb60b('0x31')];_0x57d5e5+=0x1){_0x49f130=_0x22305d[_0x57d5e5][_0xb60b('0x6d')]?_0x313429[_0x22305d[_0x57d5e5][_0xb60b('0x6d')]][_0xb60b('0x6e')]:_0x22305d[_0x57d5e5][_0xb60b('0x3b')];_0x49f130=_0x22305d[_0x57d5e5][_0xb60b('0x6f')]?_['replace'](_0x3910ef[_0x22305d[_0x57d5e5][_0xb60b('0x6f')]],'%s',_0x49f130):_0x49f130;_0x49f130=_0x22305d[_0x57d5e5][_0xb60b('0x70')]?_[_0xb60b('0x71')](_0x13b52e[_0x22305d[_0x57d5e5]['format']],'%s',_0x49f130):_0x49f130;if(_0x22305d[_0x57d5e5]['groupBy']){_0xd36cc0[_0xb60b('0x62')](_0x49f130);}_0x22305d[_0x57d5e5][_0xb60b('0x72')]&&_0xd36cc0[_0xb60b('0x33')](_0x49f130,_0x22305d[_0x57d5e5][_0xb60b('0x72')]===_0xb60b('0x73')?![]:!![]);_0xd36cc0[_0xb60b('0x3b')](_0x49f130,_0x22305d[_0x57d5e5][_0xb60b('0x74')]||_0x49f130);}if(_0x15a696[_0xb60b('0x75')]){_0x15a696[_0xb60b('0x75')]=JSON[_0xb60b('0x76')](_0x15a696[_0xb60b('0x75')]);for(var _0x31750c=0x0;_0x31750c<_0x15a696[_0xb60b('0x75')][_0xb60b('0x31')];_0x31750c+=0x1){if(_0x15a696['joins'][_0x31750c]['type']&&_[_0xb60b('0x5c')](_0x410ad7,_0x15a696[_0xb60b('0x75')][_0x31750c]['type'])&&_0x15a696[_0xb60b('0x75')][_0x31750c][_0xb60b('0x77')]&&_0x15a696['joins'][_0x31750c]['foreignTable']&&_0x15a696['joins'][_0x31750c][_0xb60b('0x78')]){_0xd36cc0[_0x15a696[_0xb60b('0x75')][_0x31750c][_0xb60b('0x38')]](_0x15a696['joins'][_0x31750c][_0xb60b('0x79')],null,util[_0xb60b('0x70')](_0xb60b('0x7a'),_0x15a696[_0xb60b('0x7b')],_0x15a696[_0xb60b('0x75')][_0x31750c]['parentKey'],_0x15a696['joins'][_0x31750c][_0xb60b('0x79')],_0x15a696[_0xb60b('0x75')][_0x31750c]['foreignKey']));}}}if(_0x15a696[_0xb60b('0x7c')]){_0x15a696[_0xb60b('0x7c')]=JSON['parse'](_0x15a696[_0xb60b('0x7c')]);_0xd36cc0[_0xb60b('0x35')](_0x5e2b65(_0x15a696[_0xb60b('0x7c')]['group']));}_0x516ca7=_0xd36cc0[_0xb60b('0x7d')]();_0xd36cc0['limit'](_0x6adca7);_0xd36cc0[_0xb60b('0x19')](0x0);logger[_0xb60b('0x7e')](_0xb60b('0x7f'),_0xd36cc0[_0xb60b('0x80')]());return db[_0xb60b('0x81')][_0xb60b('0x2c')](_0xd36cc0[_0xb60b('0x80')](),{'type':db[_0xb60b('0x81')][_0xb60b('0x82')][_0xb60b('0x83')]});}})['then'](respondWithResult(_0x1ccd10,null))[_0xb60b('0x42')](handleError(_0x1ccd10,null));};function runReport(_0x6f4880,_0x109e21,_0x258893){var _0x106bdb=_0x109e21[_0xb60b('0x27')];var _0x4aa0bb=0xa;var _0xc871ae=[_0xb60b('0x4c'),_0xb60b('0x4d'),_0xb60b('0x84'),_0xb60b('0x4e')];var _0x3b7aed={'SUM':_0xb60b('0x4f'),'COUNT':_0xb60b('0x50'),'COUNT DISTINCT':_0xb60b('0x51'),'MAX':_0xb60b('0x52'),'MIN':'MIN(%s)','AVG':_0xb60b('0x54'),'GROUP_CONCAT':_0xb60b('0x55'),'GROUP_CONCAT ASC':_0xb60b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x50dc3c={'SEC_TO_TIME':_0xb60b('0x85'),'DATE':_0xb60b('0x58'),'HOUR':_0xb60b('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb60b('0x5b')};var _0x3ea9d4=function(_0x47a9db){return!_[_0xb60b('0x5c')]([_0xb60b('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb60b('0x60')],_0x47a9db);};var _0x3952c6=function(_0x12e970){if(!_0x12e970||!_0x12e970[_0xb60b('0x61')][_0xb60b('0x31')]){return'';}for(var _0x3a1ce1='(',_0x5d9f1b=0x0;_0x5d9f1b<_0x12e970[_0xb60b('0x61')][_0xb60b('0x31')];_0x5d9f1b+=0x1){_0x5d9f1b>0x0&&(_0x3a1ce1+='\x20'+_0x12e970['operator']+'\x20');_0x3a1ce1+=_0x12e970[_0xb60b('0x61')][_0x5d9f1b][_0xb60b('0x62')]?_0x3952c6(_0x12e970[_0xb60b('0x61')][_0x5d9f1b][_0xb60b('0x62')]):_0x12e970[_0xb60b('0x61')][_0x5d9f1b]['field']+'\x20'+_0x12e970[_0xb60b('0x61')][_0x5d9f1b][_0xb60b('0x63')]+(_0x3ea9d4(_0x12e970['rules'][_0x5d9f1b][_0xb60b('0x63')])?'\x20'+_0x12e970[_0xb60b('0x61')][_0x5d9f1b][_0xb60b('0x64')]:'');}return _0x3a1ce1+')';};var _0x3c92b5={'where':{'id':_0x6f4880['id']}},_0x592a4c,_0x300f42,_0x58e9fd,_0x331a7e,_0x41300e;_0x3c92b5=_[_0xb60b('0x37')]({},_0x3c92b5,_0x258893);return db[_0xb60b('0x28')]['find'](_0x3c92b5)['then'](function(_0x79d7ea){if(_0x79d7ea){_0x592a4c=_0x79d7ea;return _0x79d7ea[_0xb60b('0x65')]();}return null;})[_0xb60b('0x20')](function(_0x558421){if(_0x558421){if(!_0x558421[_0xb60b('0x31')]){throw new db[(_0xb60b('0x66'))][(_0xb60b('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x300f42=_0x558421;return db[_0xb60b('0x68')]['findAll']({'raw':!![]});}return null;})[_0xb60b('0x20')](function(_0x244bf7){if(_0x244bf7){_0x58e9fd=_['keyBy'](_0x244bf7,'id');var _0x3b7892;var _0x53cc05=squel['select']();_0x53cc05[_0xb60b('0x6c')](_0x592a4c['table']);for(var _0x3153fb=0x0;_0x3153fb<_0x300f42[_0xb60b('0x31')];_0x3153fb+=0x1){_0x3b7892=_0x300f42[_0x3153fb]['MetricId']?_0x58e9fd[_0x300f42[_0x3153fb][_0xb60b('0x6d')]]['metric']:_0x300f42[_0x3153fb][_0xb60b('0x3b')];_0x3b7892=_0x300f42[_0x3153fb]['function']?_['replace'](_0x3b7aed[_0x300f42[_0x3153fb][_0xb60b('0x6f')]],'%s',_0x3b7892):_0x3b7892;_0x3b7892=_0x300f42[_0x3153fb][_0xb60b('0x70')]?_[_0xb60b('0x71')](_0x50dc3c[_0x300f42[_0x3153fb]['format']],'%s',_0x3b7892):_0x3b7892;if(_0x300f42[_0x3153fb][_0xb60b('0x87')]){_0x53cc05['group'](_0x3b7892);}_0x300f42[_0x3153fb][_0xb60b('0x72')]&&_0x53cc05['order'](_0x3b7892,_0x300f42[_0x3153fb][_0xb60b('0x72')]===_0xb60b('0x73')?![]:!![]);_0x53cc05[_0xb60b('0x3b')](_0x3b7892,_0x300f42[_0x3153fb][_0xb60b('0x74')]||_0x3b7892);}if(_0x592a4c['joins']){_0x592a4c[_0xb60b('0x75')]=JSON[_0xb60b('0x76')](_0x592a4c['joins']);for(var _0x5ede9b=0x0;_0x5ede9b<_0x592a4c[_0xb60b('0x75')][_0xb60b('0x31')];_0x5ede9b+=0x1){if(_0x592a4c[_0xb60b('0x75')][_0x5ede9b][_0xb60b('0x38')]&&_[_0xb60b('0x5c')](_0xc871ae,_0x592a4c['joins'][_0x5ede9b][_0xb60b('0x38')])&&_0x592a4c['joins'][_0x5ede9b][_0xb60b('0x77')]&&_0x592a4c['joins'][_0x5ede9b][_0xb60b('0x79')]&&_0x592a4c[_0xb60b('0x75')][_0x5ede9b][_0xb60b('0x78')]){_0x53cc05[_0x592a4c[_0xb60b('0x75')][_0x5ede9b][_0xb60b('0x38')]](_0x592a4c['joins'][_0x5ede9b][_0xb60b('0x79')],null,util[_0xb60b('0x70')](_0xb60b('0x7a'),_0x592a4c[_0xb60b('0x7b')],_0x592a4c[_0xb60b('0x75')][_0x5ede9b][_0xb60b('0x77')],_0x592a4c[_0xb60b('0x75')][_0x5ede9b][_0xb60b('0x79')],_0x592a4c['joins'][_0x5ede9b]['foreignKey']));}}}if(_0x592a4c[_0xb60b('0x7c')]){_0x592a4c[_0xb60b('0x7c')]=JSON[_0xb60b('0x76')](_0x592a4c[_0xb60b('0x7c')]);_0x53cc05[_0xb60b('0x35')](_0x3952c6(_0x592a4c[_0xb60b('0x7c')][_0xb60b('0x62')]));}_0x41300e=_0x53cc05[_0xb60b('0x7d')]();_0x53cc05[_0xb60b('0x1a')](_0x4aa0bb);_0x53cc05[_0xb60b('0x19')](0x0);logger['debug'](_0xb60b('0x7f'),_0x53cc05['toString']());return db[_0xb60b('0x81')]['query'](_0x53cc05[_0xb60b('0x80')](),{'type':db[_0xb60b('0x81')][_0xb60b('0x82')][_0xb60b('0x83')]});}})[_0xb60b('0x20')](function(_0x566285){if(!_0x566285['length']){throw new db[(_0xb60b('0x66'))][(_0xb60b('0x86'))](_0xb60b('0x88'),0xcc);}if(_0x109e21[_0xb60b('0x89')]===_0xb60b('0x8a')){return null;}var _0x198fea=_['merge'](_0x109e21,{'name':_0x109e21['fullPath']||_0x109e21[_0xb60b('0x27')]||_0x592a4c[_0xb60b('0x27')],'basename':_0x106bdb,'savename':util['format']('%s-%s.%s',_0x109e21[_0xb60b('0x27')]||_0x592a4c[_0xb60b('0x27')],require(_0xb60b('0x8b'))['generate'](0x4),_0x109e21[_0xb60b('0x89')]||_0xb60b('0x8c')),'reportId':_0x592a4c['id'],'reportType':_0xb60b('0x8d')});return db[_0xb60b('0x8e')][_0xb60b('0x43')](_0x198fea,{'raw':!![]});})[_0xb60b('0x20')](function(_0xdd862a){if(_0x592a4c['table']===_0xb60b('0x8f')){_0x41300e[_0xb60b('0x35')](_0x592a4c[_0xb60b('0x7b')]+_0xb60b('0x90'),_0x109e21[_0xb60b('0x91')],_0x109e21[_0xb60b('0x92')]);}else{_0x41300e[_0xb60b('0x35')](_0x592a4c[_0xb60b('0x7b')]+_0xb60b('0x93'),_0x109e21[_0xb60b('0x91')],_0x109e21[_0xb60b('0x92')]);}if(_0xdd862a){logger[_0xb60b('0x94')](_0xb60b('0x95'),_0x41300e['toString']());require(_0xb60b('0x96'))['fork'](path[_0xb60b('0x4c')](__dirname,'../../components/export/',_0xdd862a[_0xb60b('0x89')]),[_0xdd862a['id'],_0x41300e[_0xb60b('0x80')](),path[_0xb60b('0x4c')](__dirname,_0xb60b('0x97'),_0xdd862a[_0xb60b('0x98')]),_0x106bdb]);return _0xdd862a;}else{var _0x1cb93f=squel[_0xb60b('0x6b')]();_0x1cb93f['from']('('+_0x41300e['toString']()+')',_0xb60b('0x99'));_0x1cb93f[_0xb60b('0x3b')]('COUNT(*)','count');_0x41300e[_0xb60b('0x1a')](_0x109e21[_0xb60b('0x1a')]||_0x4aa0bb);_0x41300e['offset'](_0x109e21[_0xb60b('0x19')]||0x0);return db[_0xb60b('0x81')][_0xb60b('0x2c')](_0x1cb93f[_0xb60b('0x80')](),{'type':db[_0xb60b('0x81')][_0xb60b('0x82')][_0xb60b('0x83')]})['then'](function(_0x2996d2){if(!_0x2996d2[_0xb60b('0x31')]){_0x331a7e=0x0;}else{_0x331a7e=_0x2996d2[0x0][_0xb60b('0x18')]||0x0;}return db[_0xb60b('0x81')][_0xb60b('0x2c')](_0x41300e['toString'](),{'type':db[_0xb60b('0x81')][_0xb60b('0x82')][_0xb60b('0x83')]});})[_0xb60b('0x20')](function(_0x49eba5){return{'rows':_0x49eba5||[],'count':_0x331a7e};});}});}exports[_0xb60b('0x9a')]=function(_0x3c9c22,_0x18eeca){return runReport(_0x3c9c22['params'],_0x3c9c22[_0xb60b('0x2c')],_0x3c9c22[_0xb60b('0x3c')])[_0xb60b('0x20')](respondWithResult(_0x18eeca,null))[_0xb60b('0x42')](handleError(_0x18eeca,null));};exports[_0xb60b('0x9b')]=runReport;exports[_0xb60b('0x2c')]=function(_0x26ddc9,_0x30ceed){var _0x11a076=0xa;var _0x5318e7=['join',_0xb60b('0x4d'),'right_join','cross_join'];var _0x390800={'SUM':_0xb60b('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb60b('0x51'),'MAX':_0xb60b('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb60b('0x57')};var _0x4e857b={'SEC_TO_TIME':_0xb60b('0x85'),'DATE':_0xb60b('0x58'),'HOUR':_0xb60b('0x59'),'ROUND':_0xb60b('0x5a'),'UNIX_TIMESTAMP':_0xb60b('0x5b')};var _0xfa83a0=function(_0x658b50){return!_[_0xb60b('0x5c')]([_0xb60b('0x5d'),'IS\x20NOT\x20NULL',_0xb60b('0x5f'),_0xb60b('0x60')],_0x658b50);};var _0x246670=function(_0x2a0672){if(!_0x2a0672||!_0x2a0672[_0xb60b('0x61')][_0xb60b('0x31')]){return'';}for(var _0x482b6a='(',_0x2d0432=0x0;_0x2d0432<_0x2a0672[_0xb60b('0x61')][_0xb60b('0x31')];_0x2d0432+=0x1){_0x2d0432>0x0&&(_0x482b6a+='\x20'+_0x2a0672[_0xb60b('0x9c')]+'\x20');_0x482b6a+=_0x2a0672['rules'][_0x2d0432][_0xb60b('0x62')]?_0x246670(_0x2a0672[_0xb60b('0x61')][_0x2d0432]['group']):_0x2a0672['rules'][_0x2d0432]['field']+'\x20'+_0x2a0672[_0xb60b('0x61')][_0x2d0432][_0xb60b('0x63')]+(_0xfa83a0(_0x2a0672['rules'][_0x2d0432][_0xb60b('0x63')])?'\x20'+_0x2a0672['rules'][_0x2d0432][_0xb60b('0x64')]:'');}return _0x482b6a+')';};var _0x4b481c={'where':{'id':_0x26ddc9['params']['id']}},_0x466441,_0x5c1bb6,_0x148238,_0x50bd0d,_0x19d859;_0x4b481c=_[_0xb60b('0x37')]({},_0x4b481c,_0x26ddc9[_0xb60b('0x3c')]);return db[_0xb60b('0x28')][_0xb60b('0x41')](_0x4b481c)['then'](function(_0xf09880){if(_0xf09880){_0x466441=_0xf09880;return _0xf09880[_0xb60b('0x65')]();}return null;})[_0xb60b('0x20')](function(_0x523ccf){if(_0x523ccf){if(!_0x523ccf[_0xb60b('0x31')]){throw new db[(_0xb60b('0x66'))][(_0xb60b('0x86'))](_0xb60b('0x67'),0x193);}_0x5c1bb6=_0x523ccf;return db[_0xb60b('0x68')][_0xb60b('0x69')]({'raw':!![]});}return null;})['then'](function(_0xc17a76){if(_0xc17a76){_0x148238=_['keyBy'](_0xc17a76,'id');var _0xec8b77;var _0x3e3876=squel[_0xb60b('0x6b')]();_0x3e3876[_0xb60b('0x6c')](_0x466441[_0xb60b('0x7b')]);for(var _0x125791=0x0;_0x125791<_0x5c1bb6[_0xb60b('0x31')];_0x125791+=0x1){_0xec8b77=_0x5c1bb6[_0x125791]['MetricId']?_0x148238[_0x5c1bb6[_0x125791][_0xb60b('0x6d')]][_0xb60b('0x6e')]:_0x5c1bb6[_0x125791][_0xb60b('0x3b')];_0xec8b77=_0x5c1bb6[_0x125791]['function']?_['replace'](_0x390800[_0x5c1bb6[_0x125791]['function']],'%s',_0xec8b77):_0xec8b77;_0xec8b77=_0x5c1bb6[_0x125791][_0xb60b('0x70')]?_[_0xb60b('0x71')](_0x4e857b[_0x5c1bb6[_0x125791][_0xb60b('0x70')]],'%s',_0xec8b77):_0xec8b77;if(_0x5c1bb6[_0x125791][_0xb60b('0x87')]){_0x3e3876['group'](_0xec8b77);}_0x5c1bb6[_0x125791]['orderBy']&&_0x3e3876[_0xb60b('0x33')](_0xec8b77,_0x5c1bb6[_0x125791][_0xb60b('0x72')]===_0xb60b('0x73')?![]:!![]);_0x3e3876[_0xb60b('0x3b')](_0xec8b77,_0x5c1bb6[_0x125791][_0xb60b('0x74')]||_0xec8b77);}if(_0x466441[_0xb60b('0x75')]){_0x466441[_0xb60b('0x75')]=JSON[_0xb60b('0x76')](_0x466441['joins']);for(var _0x1e9c4a=0x0;_0x1e9c4a<_0x466441[_0xb60b('0x75')][_0xb60b('0x31')];_0x1e9c4a+=0x1){if(_0x466441['joins'][_0x1e9c4a][_0xb60b('0x38')]&&_[_0xb60b('0x5c')](_0x5318e7,_0x466441['joins'][_0x1e9c4a][_0xb60b('0x38')])&&_0x466441[_0xb60b('0x75')][_0x1e9c4a][_0xb60b('0x77')]&&_0x466441['joins'][_0x1e9c4a]['foreignTable']&&_0x466441['joins'][_0x1e9c4a][_0xb60b('0x78')]){_0x3e3876[_0x466441[_0xb60b('0x75')][_0x1e9c4a][_0xb60b('0x38')]](_0x466441[_0xb60b('0x75')][_0x1e9c4a][_0xb60b('0x79')],null,util[_0xb60b('0x70')](_0xb60b('0x7a'),_0x466441[_0xb60b('0x7b')],_0x466441[_0xb60b('0x75')][_0x1e9c4a][_0xb60b('0x77')],_0x466441['joins'][_0x1e9c4a][_0xb60b('0x79')],_0x466441[_0xb60b('0x75')][_0x1e9c4a][_0xb60b('0x78')]));}}}if(_0x466441[_0xb60b('0x7c')]){_0x466441[_0xb60b('0x7c')]=JSON['parse'](_0x466441[_0xb60b('0x7c')]);_0x3e3876[_0xb60b('0x35')](_0x246670(_0x466441[_0xb60b('0x7c')][_0xb60b('0x62')]));}_0x19d859=_0x3e3876[_0xb60b('0x7d')]();_0x3e3876['limit'](_0x11a076);_0x3e3876[_0xb60b('0x19')](0x0);logger[_0xb60b('0x7e')]('Limited\x20Query:',_0x3e3876['toString']());return db['sequelize'][_0xb60b('0x2c')](_0x3e3876[_0xb60b('0x80')](),{'type':db[_0xb60b('0x81')][_0xb60b('0x82')][_0xb60b('0x83')]});}})[_0xb60b('0x20')](function(){return{'sql':_0x19d859[_0xb60b('0x80')]()};})[_0xb60b('0x20')](respondWithResult(_0x30ceed,null))[_0xb60b('0x42')](handleError(_0x30ceed,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 2358e7d..0cd3df6 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 _0x1cf7=['../../config/logger','api','moment','bluebird','request-promise','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x49bf83,_0x3a54dc){var _0x339b39=function(_0x4ed39e){while(--_0x4ed39e){_0x49bf83['push'](_0x49bf83['shift']());}};_0x339b39(++_0x3a54dc);}(_0x1cf7,0x8e));var _0x71cf=function(_0x5522b0,_0x15f876){_0x5522b0=_0x5522b0-0x0;var _0x169a7b=_0x1cf7[_0x5522b0];return _0x169a7b;};'use strict';var _=require('lodash');var util=require(_0x71cf('0x0'));var logger=require(_0x71cf('0x1'))(_0x71cf('0x2'));var moment=require(_0x71cf('0x3'));var BPromise=require(_0x71cf('0x4'));var rp=require(_0x71cf('0x5'));var attributes=require(_0x71cf('0x6'));module[_0x71cf('0x7')]=function(_0x501bf0,_0x5ed554){return _0x501bf0[_0x71cf('0x8')](_0x71cf('0x9'),attributes,{'tableName':_0x71cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05f3=['bluebird','request-promise','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api'];(function(_0x1335dd,_0x1f2cc2){var _0x682164=function(_0x2b4e4b){while(--_0x2b4e4b){_0x1335dd['push'](_0x1335dd['shift']());}};_0x682164(++_0x1f2cc2);}(_0x05f3,0xde));var _0x305f=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x05f3[_0x28669c];return _0x4a3af6;};'use strict';var _=require('lodash');var util=require(_0x305f('0x0'));var logger=require(_0x305f('0x1'))(_0x305f('0x2'));var moment=require('moment');var BPromise=require(_0x305f('0x3'));var rp=require(_0x305f('0x4'));var attributes=require(_0x305f('0x5'));module['exports']=function(_0x3a6dd4,_0xb9282b){return _0x3a6dd4[_0x305f('0x6')](_0x305f('0x7'),attributes,{'tableName':_0x305f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 4df730a..95743c6 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 _0xa9e0=['http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\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(_0x53e6c7,_0x1cc78f){var _0x41510c=function(_0x3fec29){while(--_0x3fec29){_0x53e6c7['push'](_0x53e6c7['shift']());}};_0x41510c(++_0x1cc78f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result'];(function(_0x442a6f,_0x465db4){var _0x280685=function(_0x22b7b8){while(--_0x22b7b8){_0x442a6f['push'](_0x442a6f['shift']());}};_0x280685(++_0x465db4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xf3cd[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 79059de..02904db 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 _0x043d=['put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x51facc,_0x34e80a){var _0x5b47eb=function(_0x2fafc5){while(--_0x2fafc5){_0x51facc['push'](_0x51facc['shift']());}};_0x5b47eb(++_0x34e80a);}(_0x043d,0x1bb));var _0xd043=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x043d[_0x44c974];return _0x5214c6;};'use strict';var multer=require(_0xd043('0x0'));var util=require(_0xd043('0x1'));var path=require('path');var timeout=require(_0xd043('0x2'));var express=require(_0xd043('0x3'));var router=express[_0xd043('0x4')]();var auth=require(_0xd043('0x5'));var interaction=require(_0xd043('0x6'));var config=require(_0xd043('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xd043('0x8')]('/',auth['isAuthenticated'](),controller[_0xd043('0x9')]);router[_0xd043('0x8')](_0xd043('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd043('0x8')]('/:id/preview',auth[_0xd043('0xb')](),controller[_0xd043('0xc')]);router[_0xd043('0x8')](_0xd043('0xd'),auth['isAuthenticated'](),controller[_0xd043('0xe')]);router[_0xd043('0x8')](_0xd043('0xf'),auth[_0xd043('0xb')](),controller[_0xd043('0x10')]);router[_0xd043('0x11')]('/',auth[_0xd043('0xb')](),controller[_0xd043('0x12')]);router[_0xd043('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd043('0x14')]);router['delete'](_0xd043('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd043('0x15')]=router; \ No newline at end of file +var _0x7068=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x50b919,_0x7cdb7f){var _0x12fec9=function(_0x3e3370){while(--_0x3e3370){_0x50b919['push'](_0x50b919['shift']());}};_0x12fec9(++_0x7cdb7f);}(_0x7068,0x164));var _0x8706=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x7068[_0x59befa];return _0x1dd63d;};'use strict';var multer=require(_0x8706('0x0'));var util=require(_0x8706('0x1'));var path=require(_0x8706('0x2'));var timeout=require(_0x8706('0x3'));var express=require('express');var router=express[_0x8706('0x4')]();var auth=require(_0x8706('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8706('0x6'));var controller=require(_0x8706('0x7'));router[_0x8706('0x8')]('/',auth[_0x8706('0x9')](),controller[_0x8706('0xa')]);router[_0x8706('0x8')](_0x8706('0xb'),auth[_0x8706('0x9')](),controller[_0x8706('0xc')]);router[_0x8706('0x8')](_0x8706('0xd'),auth[_0x8706('0x9')](),controller[_0x8706('0xe')]);router[_0x8706('0x8')](_0x8706('0xf'),auth['isAuthenticated'](),controller[_0x8706('0x10')]);router[_0x8706('0x8')](_0x8706('0x11'),auth[_0x8706('0x9')](),controller[_0x8706('0x12')]);router[_0x8706('0x13')]('/',auth[_0x8706('0x9')](),controller[_0x8706('0x14')]);router[_0x8706('0x15')](_0x8706('0xb'),auth['isAuthenticated'](),controller[_0x8706('0x16')]);router[_0x8706('0x17')](_0x8706('0xb'),auth[_0x8706('0x9')](),controller['destroy']);module[_0x8706('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 60a6fe0..5f5674d 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 _0xbfad=['csv','pdf','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbfad,0x1ab));var _0xdbfa=function(_0x1fece1,_0x57b87c){_0x1fece1=_0x1fece1-0x0;var _0x36135f=_0xbfad[_0x1fece1];return _0x36135f;};'use strict';var Sequelize=require(_0xdbfa('0x0'));var moment=require(_0xdbfa('0x1'));module[_0xdbfa('0x2')]={'name':{'type':Sequelize[_0xdbfa('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xdbfa('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xdbfa('0x4')](_0xdbfa('0x5'),_0xdbfa('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0xdbfa('0x5')},'savename':{'type':Sequelize[_0xdbfa('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xdbfa('0x7')]},'endDate':{'type':Sequelize[_0xdbfa('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xdbfa('0x8')},'type':{'type':Sequelize[_0xdbfa('0x4')](_0xdbfa('0x9'),_0xdbfa('0xa')),'allowNull':![],'defaultValue':_0xdbfa('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xdbfa('0xb')]},'reportType':{'type':Sequelize[_0xdbfa('0x3')]}}; \ No newline at end of file +var _0x4d2b=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','STRING','ENUM','pdf','xlsx','csv'];(function(_0x750500,_0x44588b){var _0x1acdae=function(_0x3eb804){while(--_0x3eb804){_0x750500['push'](_0x750500['shift']());}};_0x1acdae(++_0x44588b);}(_0x4d2b,0x186));var _0xb4d2=function(_0x103bb0,_0x285351){_0x103bb0=_0x103bb0-0x0;var _0x2181e5=_0x4d2b[_0x103bb0];return _0x2181e5;};'use strict';var Sequelize=require(_0xb4d2('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xb4d2('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xb4d2('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xb4d2('0x2')]('csv',_0xb4d2('0x3'),_0xb4d2('0x4')),'allowNull':![],'defaultValue':_0xb4d2('0x5')},'savename':{'type':Sequelize[_0xb4d2('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb4d2('0x6')]},'endDate':{'type':Sequelize[_0xb4d2('0x6')]},'status':{'type':Sequelize[_0xb4d2('0x1')],'defaultValue':_0xb4d2('0x7')},'type':{'type':Sequelize[_0xb4d2('0x2')](_0xb4d2('0x8'),_0xb4d2('0x9')),'allowNull':![],'defaultValue':_0xb4d2('0x8')},'reportId':{'type':Sequelize[_0xb4d2('0xa')](0xb)[_0xb4d2('0xb')]},'reportType':{'type':Sequelize[_0xb4d2('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 0e1a679..abbe0c3 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 _0x4408=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','ExtractedReports','destroy','error','stack','name','send','AnalyticExtractedReport','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','squel','crypto','jsforce','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x4408,0x1c3));var _0x8440=function(_0x4e7c88,_0xc51072){_0x4e7c88=_0x4e7c88-0x0;var _0xcb600c=_0x4408[_0x4e7c88];return _0xcb600c;};'use strict';var pdf=require(_0x8440('0x0'));var emlformat=require(_0x8440('0x1'));var rimraf=require(_0x8440('0x2'));var zipdir=require(_0x8440('0x3'));var jsonpatch=require(_0x8440('0x4'));var rp=require('request-promise');var moment=require(_0x8440('0x5'));var BPromise=require(_0x8440('0x6'));var Mustache=require(_0x8440('0x7'));var util=require(_0x8440('0x8'));var path=require(_0x8440('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8440('0xa'));var crypto=require(_0x8440('0xb'));var jsforce=require(_0x8440('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8440('0xd'));var querystring=require(_0x8440('0xe'));var Papa=require(_0x8440('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8440('0x10'));var Redis=require(_0x8440('0x11'));var qs=require(_0x8440('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8440('0x13'));var db=require(_0x8440('0x14'))['db'];function respondWithStatusCode(_0xacb946,_0x7b611b){_0x7b611b=_0x7b611b||0xcc;return function(_0x14aecf){if(_0x14aecf){return _0xacb946[_0x8440('0x15')](_0x7b611b);}return _0xacb946[_0x8440('0x16')](_0x7b611b)[_0x8440('0x17')]();};}function respondWithResult(_0x571bae,_0x269567){_0x269567=_0x269567||0xc8;return function(_0x41888f){if(_0x41888f){return _0x571bae[_0x8440('0x16')](_0x269567)[_0x8440('0x18')](_0x41888f);}};}function respondWithFilteredResult(_0xfd1651,_0x21204c){return function(_0x2b8277){if(_0x2b8277){var _0x2910d2=_0x2b8277[_0x8440('0x19')],_0x22e1a2=_0x21204c[_0x8440('0x1a')],_0xa1f834=_0x21204c[_0x8440('0x1a')]+_0x21204c[_0x8440('0x1b')],_0x4ca786;if(_0xa1f834>=_0x2910d2){_0xa1f834=_0x2910d2;_0x4ca786=0xc8;}else{_0x4ca786=0xce;}_0xfd1651[_0x8440('0x16')](_0x4ca786);return _0xfd1651[_0x8440('0x1c')]('Content-Range',_0x22e1a2+'-'+_0xa1f834+'/'+_0x2910d2)['json'](_0x2b8277);}return null;};}function patchUpdates(_0xe2dc5b){return function(_0x2a8a34){try{jsonpatch[_0x8440('0x1d')](_0x2a8a34,_0xe2dc5b,!![]);}catch(_0x30a660){return BPromise[_0x8440('0x1e')](_0x30a660);}return _0x2a8a34[_0x8440('0x1f')]();};}function saveUpdates(_0x2af472,_0x1f9f73){return function(_0x1b9f9b){if(_0x1b9f9b){return _0x1b9f9b[_0x8440('0x20')](_0x2af472)[_0x8440('0x21')](function(_0x23c4fd){return _0x23c4fd;});}return null;};}function removeEntity(_0x317513,_0x16706f){return function(_0x2ba089){if(_0x2ba089){return _0x2ba089['destroy']()[_0x8440('0x21')](function(){var _0x3ccbf3=_0x2ba089[_0x8440('0x22')]({'plain':!![]});var _0xd143df=_0x8440('0x23');return db['UserProfileResource'][_0x8440('0x24')]({'where':{'type':_0xd143df,'resourceId':_0x3ccbf3['id']}})[_0x8440('0x21')](function(){return _0x2ba089;});})[_0x8440('0x21')](function(){_0x317513[_0x8440('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5833d0,_0x135c5e){return function(_0x10d4bd){if(!_0x10d4bd){_0x5833d0['sendStatus'](0x194);}return _0x10d4bd;};}function handleError(_0xa648ca,_0x136977){_0x136977=_0x136977||0x1f4;return function(_0x56f229){logger[_0x8440('0x25')](_0x56f229[_0x8440('0x26')]);if(_0x56f229[_0x8440('0x27')]){delete _0x56f229[_0x8440('0x27')];}_0xa648ca[_0x8440('0x16')](_0x136977)[_0x8440('0x28')](_0x56f229);};}exports['index']=function(_0xfe1c6d,_0x1beeea){var _0x59d6d1={},_0xcda3c3={},_0x55a27e={'count':0x0,'rows':[]};var _0x3858b9=db[_0x8440('0x29')][_0x8440('0x2a')];_0xcda3c3[_0x8440('0x2b')]=_[_0x8440('0x2c')](_0x3858b9);_0xcda3c3[_0x8440('0x2d')]=_[_0x8440('0x2c')](_0xfe1c6d['query']);_0xcda3c3['filters']=_['intersection'](_0xcda3c3[_0x8440('0x2b')],_0xcda3c3[_0x8440('0x2d')]);_0x59d6d1[_0x8440('0x2e')]=_['intersection'](_0xcda3c3[_0x8440('0x2b')],qs[_0x8440('0x2f')](_0xfe1c6d['query'][_0x8440('0x2f')]));_0x59d6d1[_0x8440('0x2e')]=_0x59d6d1[_0x8440('0x2e')][_0x8440('0x30')]?_0x59d6d1[_0x8440('0x2e')]:_0xcda3c3[_0x8440('0x2b')];if(!_0xfe1c6d[_0x8440('0x2d')][_0x8440('0x31')]('nolimit')){_0x59d6d1[_0x8440('0x1b')]=qs[_0x8440('0x1b')](_0xfe1c6d['query'][_0x8440('0x1b')]);_0x59d6d1[_0x8440('0x1a')]=qs[_0x8440('0x1a')](_0xfe1c6d['query'][_0x8440('0x1a')]);}_0x59d6d1[_0x8440('0x32')]=qs[_0x8440('0x33')](_0xfe1c6d[_0x8440('0x2d')]['sort']);_0x59d6d1[_0x8440('0x34')]=qs[_0x8440('0x35')](_[_0x8440('0x36')](_0xfe1c6d[_0x8440('0x2d')],_0xcda3c3[_0x8440('0x35')]));if(_0xfe1c6d[_0x8440('0x2d')][_0x8440('0x37')]){_0x59d6d1[_0x8440('0x34')]=_['merge'](_0x59d6d1[_0x8440('0x34')],{'$or':_[_0x8440('0x38')](_0x3858b9,function(_0x3e34b0){if(_0x3e34b0[_0x8440('0x39')][_0x8440('0x3a')]!==_0x8440('0x3b')){var _0x1d7b8e={};_0x1d7b8e[_0x3e34b0[_0x8440('0x3c')]]={'$like':'%'+_0xfe1c6d[_0x8440('0x2d')]['filter']+'%'};return _0x1d7b8e;}})});}_0x59d6d1=_[_0x8440('0x3d')]({},_0x59d6d1,_0xfe1c6d[_0x8440('0x3e')]);var _0x562b82={'where':_0x59d6d1[_0x8440('0x34')]};return db[_0x8440('0x29')][_0x8440('0x19')](_0x562b82)[_0x8440('0x21')](function(_0x5be7b0){_0x55a27e[_0x8440('0x19')]=_0x5be7b0;if(_0xfe1c6d[_0x8440('0x2d')][_0x8440('0x3f')]){_0x59d6d1[_0x8440('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x59d6d1);})[_0x8440('0x21')](function(_0x2443dd){_0x55a27e[_0x8440('0x41')]=_0x2443dd;return _0x55a27e;})[_0x8440('0x21')](respondWithFilteredResult(_0x1beeea,_0x59d6d1))[_0x8440('0x42')](handleError(_0x1beeea,null));};exports[_0x8440('0x43')]=function(_0x83c426,_0x1e7ab6){var _0x162194={'raw':!![],'where':{'id':_0x83c426[_0x8440('0x44')]['id']}},_0x406a6e={};_0x406a6e[_0x8440('0x2b')]=_[_0x8440('0x2c')](db['AnalyticExtractedReport'][_0x8440('0x2a')]);_0x406a6e[_0x8440('0x2d')]=_[_0x8440('0x2c')](_0x83c426[_0x8440('0x2d')]);_0x406a6e[_0x8440('0x35')]=_['intersection'](_0x406a6e['model'],_0x406a6e[_0x8440('0x2d')]);_0x162194['attributes']=_[_0x8440('0x45')](_0x406a6e[_0x8440('0x2b')],qs[_0x8440('0x2f')](_0x83c426[_0x8440('0x2d')][_0x8440('0x2f')]));_0x162194[_0x8440('0x2e')]=_0x162194[_0x8440('0x2e')][_0x8440('0x30')]?_0x162194[_0x8440('0x2e')]:_0x406a6e[_0x8440('0x2b')];if(_0x83c426[_0x8440('0x2d')]['includeAll']){_0x162194[_0x8440('0x40')]=[{'all':!![]}];}_0x162194=_[_0x8440('0x3d')]({},_0x162194,_0x83c426['options']);return db['AnalyticExtractedReport'][_0x8440('0x46')](_0x162194)['then'](handleEntityNotFound(_0x1e7ab6,null))[_0x8440('0x21')](respondWithResult(_0x1e7ab6,null))[_0x8440('0x42')](handleError(_0x1e7ab6,null));};exports['create']=function(_0x4c354b,_0x26f11e){return db[_0x8440('0x29')][_0x8440('0x47')](_0x4c354b[_0x8440('0x48')],{})[_0x8440('0x21')](function(_0xe3cf0c){var _0x5eda31=_0x4c354b[_0x8440('0x49')][_0x8440('0x22')]({'plain':!![]});if(!_0x5eda31)throw new Error(_0x8440('0x4a'));if(_0x5eda31[_0x8440('0x4b')]===_0x8440('0x49')){var _0x38167f=_0xe3cf0c[_0x8440('0x22')]({'plain':!![]});var _0x1406fc=_0x8440('0x23');return db[_0x8440('0x4c')]['find']({'where':{'name':_0x1406fc,'userProfileId':_0x5eda31[_0x8440('0x4d')]},'raw':!![]})[_0x8440('0x21')](function(_0x2d0d3c){if(_0x2d0d3c&&_0x2d0d3c[_0x8440('0x4e')]===0x0){return db[_0x8440('0x4f')]['create']({'name':_0x38167f[_0x8440('0x27')],'resourceId':_0x38167f['id'],'type':_0x2d0d3c[_0x8440('0x27')],'sectionId':_0x2d0d3c['id']},{})[_0x8440('0x21')](function(){return _0xe3cf0c;});}else{return _0xe3cf0c;}})[_0x8440('0x42')](function(_0xf04cb9){logger[_0x8440('0x25')](_0x8440('0x50'),_0xf04cb9);throw _0xf04cb9;});}return _0xe3cf0c;})['then'](respondWithResult(_0x26f11e,0xc9))[_0x8440('0x42')](handleError(_0x26f11e,null));};exports[_0x8440('0x20')]=function(_0x300abb,_0x1b08f7){if(_0x300abb[_0x8440('0x48')]['id']){delete _0x300abb[_0x8440('0x48')]['id'];}return db[_0x8440('0x29')][_0x8440('0x46')]({'where':{'id':_0x300abb[_0x8440('0x44')]['id']}})[_0x8440('0x21')](handleEntityNotFound(_0x1b08f7,null))[_0x8440('0x21')](saveUpdates(_0x300abb[_0x8440('0x48')],null))[_0x8440('0x21')](respondWithResult(_0x1b08f7,null))['catch'](handleError(_0x1b08f7,null));};exports[_0x8440('0x24')]=function(_0x51802c,_0x503c8b){return db['AnalyticExtractedReport'][_0x8440('0x46')]({'where':{'id':_0x51802c['params']['id']}})[_0x8440('0x21')](handleEntityNotFound(_0x503c8b,null))[_0x8440('0x21')](removeEntity(_0x503c8b,null))[_0x8440('0x42')](handleError(_0x503c8b,null));};exports['download']=function(_0xbb41d3,_0x14878d,_0x4db0f1){return db[_0x8440('0x29')][_0x8440('0x46')]({'where':{'id':_0xbb41d3['params']['id']},'attributes':[_0x8440('0x27'),'basename',_0x8440('0x51'),_0x8440('0x52')],'raw':!![]})[_0x8440('0x21')](handleEntityNotFound(_0x14878d,null))[_0x8440('0x21')](function(_0x2b8eb0){if(_0x2b8eb0){if(!fs[_0x8440('0x53')](path[_0x8440('0x54')](config[_0x8440('0x55')],_0x8440('0x56'),_0x2b8eb0[_0x8440('0x51')]))){throw new db['Sequelize'][(_0x8440('0x57'))](_0x8440('0x58'));}if(_0xbb41d3['query'][_0x8440('0x59')]){return _0x14878d[_0x8440('0x15')](0xc8);}return _0x14878d[_0x8440('0x5a')](path[_0x8440('0x54')](config[_0x8440('0x55')],_0x8440('0x56'),_0x2b8eb0[_0x8440('0x51')]),util[_0x8440('0x5b')](_0x8440('0x5c'),_0x2b8eb0['basename']||_0x2b8eb0['name'],_0x2b8eb0[_0x8440('0x52')][_0x8440('0x5d')]()));}})[_0x8440('0x42')](handleError(_0x14878d,null));}; \ No newline at end of file +var _0x6f45=['root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','output','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','json','count','offset','Content-Range','save','update','then','get','ExtractedReports','destroy','sendStatus','error','name','send','index','AnalyticExtractedReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','existsSync','join'];(function(_0x20e15c,_0x186146){var _0x307228=function(_0x11a29b){while(--_0x11a29b){_0x20e15c['push'](_0x20e15c['shift']());}};_0x307228(++_0x186146);}(_0x6f45,0x1d7));var _0x56f4=function(_0x3dcdd8,_0x26aee0){_0x3dcdd8=_0x3dcdd8-0x0;var _0x570736=_0x6f45[_0x3dcdd8];return _0x570736;};'use strict';var pdf=require(_0x56f4('0x0'));var emlformat=require(_0x56f4('0x1'));var rimraf=require(_0x56f4('0x2'));var zipdir=require(_0x56f4('0x3'));var jsonpatch=require(_0x56f4('0x4'));var rp=require(_0x56f4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56f4('0x6'));var util=require(_0x56f4('0x7'));var path=require(_0x56f4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x56f4('0x9'));var squel=require(_0x56f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x56f4('0xb'));var deskjs=require(_0x56f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x56f4('0xd'));var Papa=require(_0x56f4('0xe'));var authService=require(_0x56f4('0xf'));var hardwareService=require(_0x56f4('0x10'));var Redis=require(_0x56f4('0x11'));var qs=require(_0x56f4('0x12'));var logger=require(_0x56f4('0x13'))(_0x56f4('0x14'));var utils=require('../../config/utils');var config=require(_0x56f4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x148b8a,_0x2a52f1){_0x2a52f1=_0x2a52f1||0xcc;return function(_0x29ec08){if(_0x29ec08){return _0x148b8a['sendStatus'](_0x2a52f1);}return _0x148b8a[_0x56f4('0x16')](_0x2a52f1)[_0x56f4('0x17')]();};}function respondWithResult(_0x3bc08b,_0x13fe4e){_0x13fe4e=_0x13fe4e||0xc8;return function(_0x10742c){if(_0x10742c){return _0x3bc08b['status'](_0x13fe4e)[_0x56f4('0x18')](_0x10742c);}};}function respondWithFilteredResult(_0x2bd547,_0x49322f){return function(_0x21dd21){if(_0x21dd21){var _0x1d3d89=_0x21dd21[_0x56f4('0x19')],_0x585313=_0x49322f[_0x56f4('0x1a')],_0x11a321=_0x49322f[_0x56f4('0x1a')]+_0x49322f['limit'],_0xf69417;if(_0x11a321>=_0x1d3d89){_0x11a321=_0x1d3d89;_0xf69417=0xc8;}else{_0xf69417=0xce;}_0x2bd547[_0x56f4('0x16')](_0xf69417);return _0x2bd547['set'](_0x56f4('0x1b'),_0x585313+'-'+_0x11a321+'/'+_0x1d3d89)[_0x56f4('0x18')](_0x21dd21);}return null;};}function patchUpdates(_0x8714c6){return function(_0x1bfb13){try{jsonpatch['apply'](_0x1bfb13,_0x8714c6,!![]);}catch(_0x543bb3){return BPromise['reject'](_0x543bb3);}return _0x1bfb13[_0x56f4('0x1c')]();};}function saveUpdates(_0x1346fe,_0x102da4){return function(_0x1646ab){if(_0x1646ab){return _0x1646ab[_0x56f4('0x1d')](_0x1346fe)[_0x56f4('0x1e')](function(_0x35c011){return _0x35c011;});}return null;};}function removeEntity(_0x1301f7,_0x28fa45){return function(_0x479773){if(_0x479773){return _0x479773['destroy']()['then'](function(){var _0x274c17=_0x479773[_0x56f4('0x1f')]({'plain':!![]});var _0x2bfe9f=_0x56f4('0x20');return db['UserProfileResource'][_0x56f4('0x21')]({'where':{'type':_0x2bfe9f,'resourceId':_0x274c17['id']}})[_0x56f4('0x1e')](function(){return _0x479773;});})[_0x56f4('0x1e')](function(){_0x1301f7['status'](0xcc)[_0x56f4('0x17')]();});}};}function handleEntityNotFound(_0x2f0457,_0xf1270f){return function(_0x4186d8){if(!_0x4186d8){_0x2f0457[_0x56f4('0x22')](0x194);}return _0x4186d8;};}function handleError(_0x264c44,_0x1c5238){_0x1c5238=_0x1c5238||0x1f4;return function(_0x296a0d){logger[_0x56f4('0x23')](_0x296a0d['stack']);if(_0x296a0d[_0x56f4('0x24')]){delete _0x296a0d[_0x56f4('0x24')];}_0x264c44[_0x56f4('0x16')](_0x1c5238)[_0x56f4('0x25')](_0x296a0d);};}exports[_0x56f4('0x26')]=function(_0x5ce234,_0x25a86c){var _0x5bf420={},_0x1cff92={},_0xce6fb8={'count':0x0,'rows':[]};var _0x489fcf=db[_0x56f4('0x27')][_0x56f4('0x28')];_0x1cff92[_0x56f4('0x29')]=_[_0x56f4('0x2a')](_0x489fcf);_0x1cff92[_0x56f4('0x2b')]=_[_0x56f4('0x2a')](_0x5ce234[_0x56f4('0x2b')]);_0x1cff92['filters']=_[_0x56f4('0x2c')](_0x1cff92[_0x56f4('0x29')],_0x1cff92['query']);_0x5bf420[_0x56f4('0x2d')]=_[_0x56f4('0x2c')](_0x1cff92[_0x56f4('0x29')],qs['fields'](_0x5ce234[_0x56f4('0x2b')][_0x56f4('0x2e')]));_0x5bf420[_0x56f4('0x2d')]=_0x5bf420[_0x56f4('0x2d')][_0x56f4('0x2f')]?_0x5bf420[_0x56f4('0x2d')]:_0x1cff92[_0x56f4('0x29')];if(!_0x5ce234['query'][_0x56f4('0x30')](_0x56f4('0x31'))){_0x5bf420[_0x56f4('0x32')]=qs[_0x56f4('0x32')](_0x5ce234[_0x56f4('0x2b')][_0x56f4('0x32')]);_0x5bf420[_0x56f4('0x1a')]=qs[_0x56f4('0x1a')](_0x5ce234['query'][_0x56f4('0x1a')]);}_0x5bf420[_0x56f4('0x33')]=qs[_0x56f4('0x34')](_0x5ce234[_0x56f4('0x2b')][_0x56f4('0x34')]);_0x5bf420[_0x56f4('0x35')]=qs[_0x56f4('0x36')](_['pick'](_0x5ce234[_0x56f4('0x2b')],_0x1cff92[_0x56f4('0x36')]));if(_0x5ce234[_0x56f4('0x2b')]['filter']){_0x5bf420[_0x56f4('0x35')]=_[_0x56f4('0x37')](_0x5bf420[_0x56f4('0x35')],{'$or':_[_0x56f4('0x38')](_0x489fcf,function(_0x4544b5){if(_0x4544b5[_0x56f4('0x39')][_0x56f4('0x3a')]!==_0x56f4('0x3b')){var _0x1b49bf={};_0x1b49bf[_0x4544b5[_0x56f4('0x3c')]]={'$like':'%'+_0x5ce234['query'][_0x56f4('0x3d')]+'%'};return _0x1b49bf;}})});}_0x5bf420=_['merge']({},_0x5bf420,_0x5ce234[_0x56f4('0x3e')]);var _0x182b30={'where':_0x5bf420[_0x56f4('0x35')]};return db['AnalyticExtractedReport'][_0x56f4('0x19')](_0x182b30)[_0x56f4('0x1e')](function(_0x3ed308){_0xce6fb8[_0x56f4('0x19')]=_0x3ed308;if(_0x5ce234[_0x56f4('0x2b')][_0x56f4('0x3f')]){_0x5bf420[_0x56f4('0x40')]=[{'all':!![]}];}return db[_0x56f4('0x27')][_0x56f4('0x41')](_0x5bf420);})['then'](function(_0x286897){_0xce6fb8['rows']=_0x286897;return _0xce6fb8;})[_0x56f4('0x1e')](respondWithFilteredResult(_0x25a86c,_0x5bf420))['catch'](handleError(_0x25a86c,null));};exports[_0x56f4('0x42')]=function(_0x1eb387,_0x5978f9){var _0xbddf3f={'raw':!![],'where':{'id':_0x1eb387[_0x56f4('0x43')]['id']}},_0x38dadf={};_0x38dadf[_0x56f4('0x29')]=_[_0x56f4('0x2a')](db[_0x56f4('0x27')][_0x56f4('0x28')]);_0x38dadf[_0x56f4('0x2b')]=_[_0x56f4('0x2a')](_0x1eb387[_0x56f4('0x2b')]);_0x38dadf['filters']=_[_0x56f4('0x2c')](_0x38dadf[_0x56f4('0x29')],_0x38dadf[_0x56f4('0x2b')]);_0xbddf3f['attributes']=_[_0x56f4('0x2c')](_0x38dadf['model'],qs[_0x56f4('0x2e')](_0x1eb387[_0x56f4('0x2b')][_0x56f4('0x2e')]));_0xbddf3f[_0x56f4('0x2d')]=_0xbddf3f[_0x56f4('0x2d')][_0x56f4('0x2f')]?_0xbddf3f['attributes']:_0x38dadf[_0x56f4('0x29')];if(_0x1eb387[_0x56f4('0x2b')][_0x56f4('0x3f')]){_0xbddf3f[_0x56f4('0x40')]=[{'all':!![]}];}_0xbddf3f=_['merge']({},_0xbddf3f,_0x1eb387[_0x56f4('0x3e')]);return db[_0x56f4('0x27')][_0x56f4('0x44')](_0xbddf3f)[_0x56f4('0x1e')](handleEntityNotFound(_0x5978f9,null))[_0x56f4('0x1e')](respondWithResult(_0x5978f9,null))[_0x56f4('0x45')](handleError(_0x5978f9,null));};exports[_0x56f4('0x46')]=function(_0x20236e,_0x18db56){return db[_0x56f4('0x27')][_0x56f4('0x46')](_0x20236e[_0x56f4('0x47')],{})[_0x56f4('0x1e')](function(_0x5155d9){var _0x477b47=_0x20236e[_0x56f4('0x48')][_0x56f4('0x1f')]({'plain':!![]});if(!_0x477b47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x477b47[_0x56f4('0x49')]==='user'){var _0x1c454c=_0x5155d9[_0x56f4('0x1f')]({'plain':!![]});var _0x64d5a0=_0x56f4('0x20');return db[_0x56f4('0x4a')][_0x56f4('0x44')]({'where':{'name':_0x64d5a0,'userProfileId':_0x477b47[_0x56f4('0x4b')]},'raw':!![]})['then'](function(_0x22fb0c){if(_0x22fb0c&&_0x22fb0c['autoAssociation']===0x0){return db[_0x56f4('0x4c')][_0x56f4('0x46')]({'name':_0x1c454c[_0x56f4('0x24')],'resourceId':_0x1c454c['id'],'type':_0x22fb0c[_0x56f4('0x24')],'sectionId':_0x22fb0c['id']},{})['then'](function(){return _0x5155d9;});}else{return _0x5155d9;}})[_0x56f4('0x45')](function(_0x36f20b){logger[_0x56f4('0x23')](_0x56f4('0x4d'),_0x36f20b);throw _0x36f20b;});}return _0x5155d9;})[_0x56f4('0x1e')](respondWithResult(_0x18db56,0xc9))[_0x56f4('0x45')](handleError(_0x18db56,null));};exports['update']=function(_0x314857,_0x2b6a20){if(_0x314857[_0x56f4('0x47')]['id']){delete _0x314857[_0x56f4('0x47')]['id'];}return db[_0x56f4('0x27')][_0x56f4('0x44')]({'where':{'id':_0x314857[_0x56f4('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b6a20,null))[_0x56f4('0x1e')](saveUpdates(_0x314857[_0x56f4('0x47')],null))[_0x56f4('0x1e')](respondWithResult(_0x2b6a20,null))[_0x56f4('0x45')](handleError(_0x2b6a20,null));};exports['destroy']=function(_0x151e76,_0x2a6a58){return db[_0x56f4('0x27')][_0x56f4('0x44')]({'where':{'id':_0x151e76[_0x56f4('0x43')]['id']}})[_0x56f4('0x1e')](handleEntityNotFound(_0x2a6a58,null))[_0x56f4('0x1e')](removeEntity(_0x2a6a58,null))[_0x56f4('0x45')](handleError(_0x2a6a58,null));};exports['download']=function(_0x29d565,_0x4b6eec,_0x2e3869){return db['AnalyticExtractedReport'][_0x56f4('0x44')]({'where':{'id':_0x29d565[_0x56f4('0x43')]['id']},'attributes':['name',_0x56f4('0x4e'),'savename','output'],'raw':!![]})[_0x56f4('0x1e')](handleEntityNotFound(_0x4b6eec,null))[_0x56f4('0x1e')](function(_0x3b4a46){if(_0x3b4a46){if(!fs[_0x56f4('0x4f')](path[_0x56f4('0x50')](config[_0x56f4('0x51')],_0x56f4('0x52'),_0x3b4a46[_0x56f4('0x53')]))){throw new db['Sequelize'][(_0x56f4('0x54'))](_0x56f4('0x55'));}if(_0x29d565[_0x56f4('0x2b')][_0x56f4('0x56')]){return _0x4b6eec[_0x56f4('0x22')](0xc8);}return _0x4b6eec[_0x56f4('0x57')](path[_0x56f4('0x50')](config[_0x56f4('0x51')],_0x56f4('0x52'),_0x3b4a46[_0x56f4('0x53')]),util[_0x56f4('0x58')](_0x56f4('0x59'),_0x3b4a46[_0x56f4('0x4e')]||_0x3b4a46[_0x56f4('0x24')],_0x3b4a46[_0x56f4('0x5a')][_0x56f4('0x5b')]()));}})[_0x56f4('0x45')](handleError(_0x4b6eec,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b939854..58bdd00 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 _0x5d30=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticExtractedReport.attributes','exports','define'];(function(_0x2fad9d,_0x49a49e){var _0x16e90e=function(_0x5aaf10){while(--_0x5aaf10){_0x2fad9d['push'](_0x2fad9d['shift']());}};_0x16e90e(++_0x49a49e);}(_0x5d30,0x135));var _0x05d3=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x5d30[_0x43fdf8];return _0x1160c6;};'use strict';var _=require(_0x05d3('0x0'));var util=require(_0x05d3('0x1'));var logger=require(_0x05d3('0x2'))(_0x05d3('0x3'));var moment=require(_0x05d3('0x4'));var BPromise=require(_0x05d3('0x5'));var rp=require(_0x05d3('0x6'));var attributes=require(_0x05d3('0x7'));module[_0x05d3('0x8')]=function(_0x14e388,_0x103bfb){return _0x14e388[_0x05d3('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x05d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9458=['bluebird','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger'];(function(_0x2754d8,_0x1ba0fa){var _0x48cfd6=function(_0x49fef5){while(--_0x49fef5){_0x2754d8['push'](_0x2754d8['shift']());}};_0x48cfd6(++_0x1ba0fa);}(_0x9458,0x1b8));var _0x8945=function(_0x190eaa,_0x3c35bd){_0x190eaa=_0x190eaa-0x0;var _0x106c51=_0x9458[_0x190eaa];return _0x106c51;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8945('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8945('0x1'));var rp=require('request-promise');var attributes=require(_0x8945('0x2'));module[_0x8945('0x3')]=function(_0x10311b,_0x31347e){return _0x10311b[_0x8945('0x4')](_0x8945('0x5'),attributes,{'tableName':_0x8945('0x6'),'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 0d33a0b..babecd4 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 _0x6909=['info','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x6909,0x1c0));var _0x9690=function(_0x40217a,_0x5a7c2b){_0x40217a=_0x40217a-0x0;var _0x20f9d8=_0x6909[_0x40217a];return _0x20f9d8;};'use strict';var _=require(_0x9690('0x0'));var util=require(_0x9690('0x1'));var moment=require(_0x9690('0x2'));var BPromise=require(_0x9690('0x3'));var rs=require(_0x9690('0x4'));var fs=require('fs');var Redis=require(_0x9690('0x5'));var db=require(_0x9690('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9690('0x7'));var config=require(_0x9690('0x8'));var jayson=require(_0x9690('0x9'));var client=jayson[_0x9690('0xa')][_0x9690('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c140e,_0x3274fa,_0x3c4c78){return new BPromise(function(_0x1f8dd4,_0x14d14e){return client[_0x9690('0xc')](_0x3c140e,_0x3c4c78)[_0x9690('0xd')](function(_0x158bbf){logger[_0x9690('0xe')](_0x9690('0xf'),_0x3274fa,'request\x20sent');logger[_0x9690('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3274fa,_0x9690('0x11'),JSON['stringify'](_0x158bbf));if(_0x158bbf[_0x9690('0x12')]){if(_0x158bbf['error'][_0x9690('0x13')]===0x1f4){logger[_0x9690('0x12')](_0x9690('0xf'),_0x3274fa,_0x158bbf[_0x9690('0x12')][_0x9690('0x14')]);return _0x14d14e(_0x158bbf[_0x9690('0x12')]['message']);}logger[_0x9690('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3274fa,_0x158bbf[_0x9690('0x12')][_0x9690('0x14')]);return _0x1f8dd4(_0x158bbf['error'][_0x9690('0x14')]);}else{logger[_0x9690('0xe')](_0x9690('0xf'),_0x3274fa,'request\x20sent');_0x1f8dd4(_0x158bbf['result'][_0x9690('0x14')]);}})[_0x9690('0x15')](function(_0x19c7c7){logger['error'](_0x9690('0xf'),_0x3274fa,_0x19c7c7);_0x14d14e(_0x19c7c7);});});} \ No newline at end of file +var _0x22ed=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x22ed,0x10b));var _0xd22e=function(_0x1585d6,_0x58225d){_0x1585d6=_0x1585d6-0x0;var _0x1e5113=_0x22ed[_0x1585d6];return _0x1e5113;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require('moment');var BPromise=require(_0xd22e('0x2'));var rs=require(_0xd22e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd22e('0x4'))['db'];var utils=require(_0xd22e('0x5'));var logger=require('../../config/logger')(_0xd22e('0x6'));var config=require(_0xd22e('0x7'));var jayson=require(_0xd22e('0x8'));var client=jayson[_0xd22e('0x9')][_0xd22e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52215d,_0x32b9ca,_0x301e50){return new BPromise(function(_0x293e1a,_0x55e0f6){return client[_0xd22e('0xb')](_0x52215d,_0x301e50)['then'](function(_0x2e3d97){logger[_0xd22e('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x32b9ca,_0xd22e('0xd'));logger[_0xd22e('0xe')](_0xd22e('0xf'),_0x32b9ca,_0xd22e('0xd'),JSON['stringify'](_0x2e3d97));if(_0x2e3d97[_0xd22e('0x10')]){if(_0x2e3d97['error']['code']===0x1f4){logger[_0xd22e('0x10')](_0xd22e('0x11'),_0x32b9ca,_0x2e3d97[_0xd22e('0x10')][_0xd22e('0x12')]);return _0x55e0f6(_0x2e3d97[_0xd22e('0x10')][_0xd22e('0x12')]);}logger['error'](_0xd22e('0x11'),_0x32b9ca,_0x2e3d97[_0xd22e('0x10')][_0xd22e('0x12')]);return _0x293e1a(_0x2e3d97[_0xd22e('0x10')][_0xd22e('0x12')]);}else{logger[_0xd22e('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x32b9ca,_0xd22e('0xd'));_0x293e1a(_0x2e3d97[_0xd22e('0x13')][_0xd22e('0x12')]);}})[_0xd22e('0x14')](function(_0x26d6da){logger[_0xd22e('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x32b9ca,_0x26d6da);_0x55e0f6(_0x26d6da);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index de317d6..6a29daa 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 _0x5627=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5627,0x175));var _0x7562=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5627[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x7562('0x0'));var util=require(_0x7562('0x1'));var path=require(_0x7562('0x2'));var timeout=require('connect-timeout');var express=require(_0x7562('0x3'));var router=express[_0x7562('0x4')]();var auth=require(_0x7562('0x5'));var interaction=require(_0x7562('0x6'));var config=require(_0x7562('0x7'));var controller=require(_0x7562('0x8'));router[_0x7562('0x9')]('/',auth[_0x7562('0xa')](),controller[_0x7562('0xb')]);router[_0x7562('0x9')](_0x7562('0xc'),auth[_0x7562('0xa')](),controller['show']);router['get']('/:id/download',auth[_0x7562('0xa')](),controller[_0x7562('0xd')]);router[_0x7562('0xe')]('/',auth[_0x7562('0xa')](),controller[_0x7562('0xf')]);router['put']('/:id',auth[_0x7562('0xa')](),controller[_0x7562('0x10')]);router[_0x7562('0x11')]('/:id',auth[_0x7562('0xa')](),controller[_0x7562('0x12')]);module[_0x7562('0x13')]=router; \ No newline at end of file +var _0x5b5a=['connect-timeout','express','./analyticExtractedReport.controller','get','isAuthenticated','show','download','post','create','put','update','delete','/:id','exports','multer'];(function(_0x2d345b,_0x4363f0){var _0x5262bd=function(_0x510662){while(--_0x510662){_0x2d345b['push'](_0x2d345b['shift']());}};_0x5262bd(++_0x4363f0);}(_0x5b5a,0xe0));var _0xa5b5=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x5b5a[_0x44afa4];return _0xcad289;};'use strict';var multer=require(_0xa5b5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa5b5('0x1'));var express=require(_0xa5b5('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa5b5('0x3'));router[_0xa5b5('0x4')]('/',auth[_0xa5b5('0x5')](),controller['index']);router['get']('/:id',auth[_0xa5b5('0x5')](),controller[_0xa5b5('0x6')]);router[_0xa5b5('0x4')]('/:id/download',auth[_0xa5b5('0x5')](),controller[_0xa5b5('0x7')]);router[_0xa5b5('0x8')]('/',auth[_0xa5b5('0x5')](),controller[_0xa5b5('0x9')]);router[_0xa5b5('0xa')]('/:id',auth[_0xa5b5('0x5')](),controller[_0xa5b5('0xb')]);router[_0xa5b5('0xc')](_0xa5b5('0xd'),auth[_0xa5b5('0x5')](),controller['destroy']);module[_0xa5b5('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b9a3c9b..ef04c6c 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 _0xcb61=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1a7bd8,_0x264ca5){var _0x5ba529=function(_0x1042b2){while(--_0x1042b2){_0x1a7bd8['push'](_0x1a7bd8['shift']());}};_0x5ba529(++_0x264ca5);}(_0xcb61,0xed));var _0x1cb6=function(_0x148a3b,_0x38fa99){_0x148a3b=_0x148a3b-0x0;var _0x4ec6b8=_0xcb61[_0x148a3b];return _0x4ec6b8;};'use strict';var Sequelize=require(_0x1cb6('0x0'));module[_0x1cb6('0x1')]={'field':{'type':Sequelize[_0x1cb6('0x2')]},'alias':{'type':Sequelize[_0x1cb6('0x3')]},'function':{'type':Sequelize[_0x1cb6('0x3')]},'format':{'type':Sequelize[_0x1cb6('0x3')]},'groupBy':{'type':Sequelize[_0x1cb6('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1cb6('0x3')]},'custom':{'type':Sequelize[_0x1cb6('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2276=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x5be017,_0x465e9a){var _0x2db095=function(_0x35a9b0){while(--_0x35a9b0){_0x5be017['push'](_0x5be017['shift']());}};_0x2db095(++_0x465e9a);}(_0x2276,0x172));var _0x6227=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x2276[_0x5f6a8a];return _0x2cce4d;};'use strict';var Sequelize=require(_0x6227('0x0'));module[_0x6227('0x1')]={'field':{'type':Sequelize[_0x6227('0x2')]},'alias':{'type':Sequelize[_0x6227('0x3')]},'function':{'type':Sequelize[_0x6227('0x3')]},'format':{'type':Sequelize[_0x6227('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x6227('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5e33690..f01d3a6 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 _0x77d8=['bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x57ec50,_0x6c98be){var _0x533dd4=function(_0x293256){while(--_0x293256){_0x57ec50['push'](_0x57ec50['shift']());}};_0x533dd4(++_0x6c98be);}(_0x77d8,0x1c8));var _0x877d=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0x77d8[_0x572637];return _0xb6748;};'use strict';var pdf=require(_0x877d('0x0'));var emlformat=require(_0x877d('0x1'));var rimraf=require(_0x877d('0x2'));var zipdir=require(_0x877d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x877d('0x4'));var moment=require(_0x877d('0x5'));var BPromise=require(_0x877d('0x6'));var Mustache=require(_0x877d('0x7'));var util=require(_0x877d('0x8'));var path=require(_0x877d('0x9'));var sox=require('sox');var csv=require(_0x877d('0xa'));var ejs=require(_0x877d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x877d('0xc'));var jsforce=require(_0x877d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x877d('0xa'));var querystring=require(_0x877d('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x877d('0xf'));var Redis=require('ioredis');var qs=require(_0x877d('0x10'));var logger=require(_0x877d('0x11'))(_0x877d('0x12'));var utils=require(_0x877d('0x13'));var config=require(_0x877d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c0ff4,_0x21681b){_0x21681b=_0x21681b||0xcc;return function(_0x30790a){if(_0x30790a){return _0x2c0ff4[_0x877d('0x15')](_0x21681b);}return _0x2c0ff4[_0x877d('0x16')](_0x21681b)[_0x877d('0x17')]();};}function respondWithResult(_0x58b1cc,_0x541528){_0x541528=_0x541528||0xc8;return function(_0x1a74f1){if(_0x1a74f1){return _0x58b1cc[_0x877d('0x16')](_0x541528)[_0x877d('0x18')](_0x1a74f1);}};}function respondWithFilteredResult(_0x26f3e9,_0x39edd9){return function(_0xbe9678){if(_0xbe9678){var _0x2b89c5=_0xbe9678['count'],_0x4ab07a=_0x39edd9[_0x877d('0x19')],_0x2140b1=_0x39edd9[_0x877d('0x19')]+_0x39edd9[_0x877d('0x1a')],_0x36c097;if(_0x2140b1>=_0x2b89c5){_0x2140b1=_0x2b89c5;_0x36c097=0xc8;}else{_0x36c097=0xce;}_0x26f3e9[_0x877d('0x16')](_0x36c097);return _0x26f3e9[_0x877d('0x1b')](_0x877d('0x1c'),_0x4ab07a+'-'+_0x2140b1+'/'+_0x2b89c5)[_0x877d('0x18')](_0xbe9678);}return null;};}function patchUpdates(_0x2bed90){return function(_0x4c45ec){try{jsonpatch[_0x877d('0x1d')](_0x4c45ec,_0x2bed90,!![]);}catch(_0x518a6b){return BPromise[_0x877d('0x1e')](_0x518a6b);}return _0x4c45ec['save']();};}function saveUpdates(_0x3e7977,_0x597e84){return function(_0x14ac8b){if(_0x14ac8b){return _0x14ac8b['update'](_0x3e7977)[_0x877d('0x1f')](function(_0x9098ab){return _0x9098ab;});}return null;};}function removeEntity(_0x27cbd1,_0x30a94b){return function(_0x12374d){if(_0x12374d){return _0x12374d['destroy']()[_0x877d('0x1f')](function(){_0x27cbd1[_0x877d('0x16')](0xcc)[_0x877d('0x17')]();});}};}function handleEntityNotFound(_0x18d527,_0x4ebfa7){return function(_0x1cf187){if(!_0x1cf187){_0x18d527[_0x877d('0x15')](0x194);}return _0x1cf187;};}function handleError(_0x1b5215,_0x31537a){_0x31537a=_0x31537a||0x1f4;return function(_0x166213){logger[_0x877d('0x20')](_0x166213[_0x877d('0x21')]);if(_0x166213[_0x877d('0x22')]){delete _0x166213[_0x877d('0x22')];}_0x1b5215[_0x877d('0x16')](_0x31537a)[_0x877d('0x23')](_0x166213);};}exports[_0x877d('0x24')]=function(_0xb26d3e,_0x37e6e8){var _0x606269={},_0x3e56e6={},_0x58fe37={'count':0x0,'rows':[]};var _0x592272=db[_0x877d('0x25')][_0x877d('0x26')];_0x3e56e6['model']=_[_0x877d('0x27')](_0x592272);_0x3e56e6[_0x877d('0x28')]=_[_0x877d('0x27')](_0xb26d3e['query']);_0x3e56e6[_0x877d('0x29')]=_[_0x877d('0x2a')](_0x3e56e6[_0x877d('0x2b')],_0x3e56e6[_0x877d('0x28')]);_0x606269[_0x877d('0x2c')]=_['intersection'](_0x3e56e6[_0x877d('0x2b')],qs[_0x877d('0x2d')](_0xb26d3e[_0x877d('0x28')]['fields']));_0x606269[_0x877d('0x2c')]=_0x606269[_0x877d('0x2c')]['length']?_0x606269[_0x877d('0x2c')]:_0x3e56e6[_0x877d('0x2b')];if(!_0xb26d3e['query']['hasOwnProperty'](_0x877d('0x2e'))){_0x606269[_0x877d('0x1a')]=qs[_0x877d('0x1a')](_0xb26d3e[_0x877d('0x28')][_0x877d('0x1a')]);_0x606269[_0x877d('0x19')]=qs[_0x877d('0x19')](_0xb26d3e['query'][_0x877d('0x19')]);}_0x606269['order']=qs[_0x877d('0x2f')](_0xb26d3e[_0x877d('0x28')][_0x877d('0x2f')]);_0x606269[_0x877d('0x30')]=qs['filters'](_[_0x877d('0x31')](_0xb26d3e[_0x877d('0x28')],_0x3e56e6[_0x877d('0x29')]));if(_0xb26d3e[_0x877d('0x28')][_0x877d('0x32')]){_0x606269[_0x877d('0x30')]=_[_0x877d('0x33')](_0x606269[_0x877d('0x30')],{'$or':_[_0x877d('0x34')](_0x592272,function(_0x4b9706){if(_0x4b9706[_0x877d('0x35')][_0x877d('0x36')]!==_0x877d('0x37')){var _0x159234={};_0x159234[_0x4b9706[_0x877d('0x38')]]={'$like':'%'+_0xb26d3e[_0x877d('0x28')]['filter']+'%'};return _0x159234;}})});}_0x606269=_[_0x877d('0x33')]({},_0x606269,_0xb26d3e[_0x877d('0x39')]);var _0x294fe4={'where':_0x606269[_0x877d('0x30')]};return db[_0x877d('0x25')]['count'](_0x294fe4)['then'](function(_0x44818a){_0x58fe37[_0x877d('0x3a')]=_0x44818a;if(_0xb26d3e['query'][_0x877d('0x3b')]){_0x606269[_0x877d('0x3c')]=[{'all':!![]}];}return db[_0x877d('0x25')][_0x877d('0x3d')](_0x606269);})[_0x877d('0x1f')](function(_0x543d83){_0x58fe37[_0x877d('0x3e')]=_0x543d83;return _0x58fe37;})[_0x877d('0x1f')](respondWithFilteredResult(_0x37e6e8,_0x606269))[_0x877d('0x3f')](handleError(_0x37e6e8,null));};exports[_0x877d('0x40')]=function(_0x2c5865,_0xc21c8){var _0x437588={'raw':![],'where':{'id':_0x2c5865[_0x877d('0x41')]['id']}},_0x4bfd2d={};_0x4bfd2d[_0x877d('0x2b')]=_[_0x877d('0x27')](db['AnalyticFieldReport']['rawAttributes']);_0x4bfd2d[_0x877d('0x28')]=_[_0x877d('0x27')](_0x2c5865[_0x877d('0x28')]);_0x4bfd2d[_0x877d('0x29')]=_['intersection'](_0x4bfd2d[_0x877d('0x2b')],_0x4bfd2d[_0x877d('0x28')]);_0x437588['attributes']=_[_0x877d('0x2a')](_0x4bfd2d[_0x877d('0x2b')],qs[_0x877d('0x2d')](_0x2c5865['query']['fields']));_0x437588['attributes']=_0x437588['attributes']['length']?_0x437588[_0x877d('0x2c')]:_0x4bfd2d['model'];if(_0x2c5865['query'][_0x877d('0x3b')]){_0x437588[_0x877d('0x3c')]=[{'all':!![]}];}_0x437588=_['merge']({},_0x437588,_0x2c5865[_0x877d('0x39')]);return db[_0x877d('0x25')][_0x877d('0x42')](_0x437588)['then'](handleEntityNotFound(_0xc21c8,null))[_0x877d('0x1f')](respondWithResult(_0xc21c8,null))['catch'](handleError(_0xc21c8,null));};exports[_0x877d('0x43')]=function(_0x57edf3,_0x181693){return db['AnalyticFieldReport']['create'](_0x57edf3[_0x877d('0x44')],{})[_0x877d('0x1f')](respondWithResult(_0x181693,0xc9))[_0x877d('0x3f')](handleError(_0x181693,null));};exports[_0x877d('0x45')]=function(_0x346652,_0x2d3a27){return db[_0x877d('0x25')][_0x877d('0x45')](_0x346652[_0x877d('0x44')],{'raw':![],'individualHooks':!![]})[_0x877d('0x1f')](respondWithResult(_0x2d3a27,0xc9))[_0x877d('0x3f')](handleError(_0x2d3a27,null));};exports['update']=function(_0x3368f0,_0x3ffe4e){if(_0x3368f0['body']['id']){delete _0x3368f0[_0x877d('0x44')]['id'];}return db['AnalyticFieldReport'][_0x877d('0x42')]({'where':{'id':_0x3368f0['params']['id']}})[_0x877d('0x1f')](handleEntityNotFound(_0x3ffe4e,null))['then'](saveUpdates(_0x3368f0[_0x877d('0x44')],null))[_0x877d('0x1f')](respondWithResult(_0x3ffe4e,null))[_0x877d('0x3f')](handleError(_0x3ffe4e,null));};exports[_0x877d('0x46')]=function(_0x2c7710,_0x47c85f){return db[_0x877d('0x25')][_0x877d('0x42')]({'where':{'id':_0x2c7710[_0x877d('0x41')]['id']}})[_0x877d('0x1f')](handleEntityNotFound(_0x47c85f,null))[_0x877d('0x1f')](removeEntity(_0x47c85f,null))[_0x877d('0x3f')](handleError(_0x47c85f,null));};exports[_0x877d('0x47')]=function(_0x2ae2fb,_0x1fd1b1){return db[_0x877d('0x25')]['destroy']({'where':{'id':_0x2ae2fb['query'][_0x877d('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x877d('0x1f')](respondWithResult(_0x1fd1b1,0xcc))['catch'](handleError(_0x1fd1b1,null));};exports[_0x877d('0x49')]=function(_0x34d704,_0x566f5f,_0x265c06){return db[_0x877d('0x4a')]['findOne']({'where':{'id':_0x34d704[_0x877d('0x41')]['id']}})['then'](handleEntityNotFound(_0x566f5f,null))[_0x877d('0x1f')](function(_0x506047){if(_0x506047){return db['sequelize'][_0x877d('0x4b')](function(_0x353bed){return db['AnalyticFieldReport'][_0x877d('0x46')]({'where':{'CustomReportId':_0x34d704[_0x877d('0x41')]['id']},'transaction':_0x353bed})[_0x877d('0x1f')](function(_0xc75217){var _0x22c606=_['map'](_0x34d704[_0x877d('0x44')],function(_0x9d1110){delete _0x9d1110['id'];_0x9d1110[_0x877d('0x4c')]=_0x34d704[_0x877d('0x41')]['id'];return _0x9d1110;});return db[_0x877d('0x25')][_0x877d('0x45')](_0x22c606,{'transaction':_0x353bed});});})[_0x877d('0x1f')](function(){return db[_0x877d('0x25')][_0x877d('0x3d')]({'where':{'CustomReportId':_0x34d704[_0x877d('0x41')]['id']}});});}})['then'](respondWithResult(_0x566f5f,null))['catch'](handleError(_0x566f5f,null));}; \ No newline at end of file +var _0x198f=['show','params','rawAttributes','create','bulkCreate','body','update','find','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','findAll','html-pdf','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','error','stack','name','index','AnalyticFieldReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch'];(function(_0x51c9e0,_0x29b308){var _0x4aa077=function(_0x9b0206){while(--_0x9b0206){_0x51c9e0['push'](_0x51c9e0['shift']());}};_0x4aa077(++_0x29b308);}(_0x198f,0x190));var _0xf198=function(_0x30510d,_0x22be64){_0x30510d=_0x30510d-0x0;var _0x375f53=_0x198f[_0x30510d];return _0x375f53;};'use strict';var pdf=require(_0xf198('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf198('0x1'));var moment=require(_0xf198('0x2'));var BPromise=require(_0xf198('0x3'));var Mustache=require('mustache');var util=require(_0xf198('0x4'));var path=require(_0xf198('0x5'));var sox=require(_0xf198('0x6'));var csv=require(_0xf198('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf198('0x8'));var squel=require(_0xf198('0x9'));var crypto=require(_0xf198('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xf198('0xb'));var hardwareService=require(_0xf198('0xc'));var Redis=require(_0xf198('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0xf198('0xe'))(_0xf198('0xf'));var utils=require(_0xf198('0x10'));var config=require('../../config/environment');var db=require(_0xf198('0x11'))['db'];function respondWithStatusCode(_0x36d308,_0x11c3dc){_0x11c3dc=_0x11c3dc||0xcc;return function(_0x102f50){if(_0x102f50){return _0x36d308[_0xf198('0x12')](_0x11c3dc);}return _0x36d308[_0xf198('0x13')](_0x11c3dc)[_0xf198('0x14')]();};}function respondWithResult(_0x22cc60,_0x4c0cbc){_0x4c0cbc=_0x4c0cbc||0xc8;return function(_0x13b2e7){if(_0x13b2e7){return _0x22cc60[_0xf198('0x13')](_0x4c0cbc)['json'](_0x13b2e7);}};}function respondWithFilteredResult(_0xf51b8e,_0x1458ce){return function(_0x2449ef){if(_0x2449ef){var _0xd0e39f=_0x2449ef[_0xf198('0x15')],_0x6e66d0=_0x1458ce[_0xf198('0x16')],_0x7f506b=_0x1458ce[_0xf198('0x16')]+_0x1458ce[_0xf198('0x17')],_0x24328b;if(_0x7f506b>=_0xd0e39f){_0x7f506b=_0xd0e39f;_0x24328b=0xc8;}else{_0x24328b=0xce;}_0xf51b8e[_0xf198('0x13')](_0x24328b);return _0xf51b8e[_0xf198('0x18')](_0xf198('0x19'),_0x6e66d0+'-'+_0x7f506b+'/'+_0xd0e39f)[_0xf198('0x1a')](_0x2449ef);}return null;};}function patchUpdates(_0x2ef08b){return function(_0x1e2aa2){try{jsonpatch['apply'](_0x1e2aa2,_0x2ef08b,!![]);}catch(_0x2600dd){return BPromise[_0xf198('0x1b')](_0x2600dd);}return _0x1e2aa2[_0xf198('0x1c')]();};}function saveUpdates(_0x4e6992,_0xe9b764){return function(_0x24ba74){if(_0x24ba74){return _0x24ba74['update'](_0x4e6992)[_0xf198('0x1d')](function(_0x5c1cc2){return _0x5c1cc2;});}return null;};}function removeEntity(_0x2163c7,_0x55377d){return function(_0x90d9a4){if(_0x90d9a4){return _0x90d9a4[_0xf198('0x1e')]()[_0xf198('0x1d')](function(){_0x2163c7[_0xf198('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384200,_0x5574b6){return function(_0x5a671e){if(!_0x5a671e){_0x384200[_0xf198('0x12')](0x194);}return _0x5a671e;};}function handleError(_0x16a60c,_0x47c55e){_0x47c55e=_0x47c55e||0x1f4;return function(_0x3649c6){logger[_0xf198('0x1f')](_0x3649c6[_0xf198('0x20')]);if(_0x3649c6[_0xf198('0x21')]){delete _0x3649c6[_0xf198('0x21')];}_0x16a60c[_0xf198('0x13')](_0x47c55e)['send'](_0x3649c6);};}exports[_0xf198('0x22')]=function(_0x247854,_0x315e5b){var _0x47874e={},_0x1dabb6={},_0x2ec37e={'count':0x0,'rows':[]};var _0x5f43af=db[_0xf198('0x23')]['rawAttributes'];_0x1dabb6[_0xf198('0x24')]=_[_0xf198('0x25')](_0x5f43af);_0x1dabb6[_0xf198('0x26')]=_['keys'](_0x247854[_0xf198('0x26')]);_0x1dabb6[_0xf198('0x27')]=_[_0xf198('0x28')](_0x1dabb6[_0xf198('0x24')],_0x1dabb6[_0xf198('0x26')]);_0x47874e['attributes']=_[_0xf198('0x28')](_0x1dabb6[_0xf198('0x24')],qs[_0xf198('0x29')](_0x247854[_0xf198('0x26')][_0xf198('0x29')]));_0x47874e[_0xf198('0x2a')]=_0x47874e[_0xf198('0x2a')][_0xf198('0x2b')]?_0x47874e[_0xf198('0x2a')]:_0x1dabb6[_0xf198('0x24')];if(!_0x247854[_0xf198('0x26')][_0xf198('0x2c')](_0xf198('0x2d'))){_0x47874e[_0xf198('0x17')]=qs[_0xf198('0x17')](_0x247854[_0xf198('0x26')][_0xf198('0x17')]);_0x47874e[_0xf198('0x16')]=qs['offset'](_0x247854[_0xf198('0x26')][_0xf198('0x16')]);}_0x47874e[_0xf198('0x2e')]=qs[_0xf198('0x2f')](_0x247854[_0xf198('0x26')][_0xf198('0x2f')]);_0x47874e[_0xf198('0x30')]=qs[_0xf198('0x27')](_[_0xf198('0x31')](_0x247854[_0xf198('0x26')],_0x1dabb6[_0xf198('0x27')]));if(_0x247854[_0xf198('0x26')][_0xf198('0x32')]){_0x47874e[_0xf198('0x30')]=_[_0xf198('0x33')](_0x47874e[_0xf198('0x30')],{'$or':_[_0xf198('0x34')](_0x5f43af,function(_0x427180){if(_0x427180[_0xf198('0x35')][_0xf198('0x36')]!==_0xf198('0x37')){var _0x59c1a9={};_0x59c1a9[_0x427180[_0xf198('0x38')]]={'$like':'%'+_0x247854[_0xf198('0x26')][_0xf198('0x32')]+'%'};return _0x59c1a9;}})});}_0x47874e=_['merge']({},_0x47874e,_0x247854[_0xf198('0x39')]);var _0x151a4d={'where':_0x47874e['where']};return db[_0xf198('0x23')][_0xf198('0x15')](_0x151a4d)[_0xf198('0x1d')](function(_0x310472){_0x2ec37e['count']=_0x310472;if(_0x247854['query'][_0xf198('0x3a')]){_0x47874e[_0xf198('0x3b')]=[{'all':!![]}];}return db[_0xf198('0x23')]['findAll'](_0x47874e);})[_0xf198('0x1d')](function(_0x5c833c){_0x2ec37e[_0xf198('0x3c')]=_0x5c833c;return _0x2ec37e;})[_0xf198('0x1d')](respondWithFilteredResult(_0x315e5b,_0x47874e))[_0xf198('0x3d')](handleError(_0x315e5b,null));};exports[_0xf198('0x3e')]=function(_0x18c737,_0xa88d4d){var _0x41eb59={'raw':![],'where':{'id':_0x18c737[_0xf198('0x3f')]['id']}},_0x3de7e9={};_0x3de7e9[_0xf198('0x24')]=_['keys'](db[_0xf198('0x23')][_0xf198('0x40')]);_0x3de7e9[_0xf198('0x26')]=_[_0xf198('0x25')](_0x18c737['query']);_0x3de7e9[_0xf198('0x27')]=_[_0xf198('0x28')](_0x3de7e9[_0xf198('0x24')],_0x3de7e9[_0xf198('0x26')]);_0x41eb59['attributes']=_[_0xf198('0x28')](_0x3de7e9['model'],qs[_0xf198('0x29')](_0x18c737[_0xf198('0x26')][_0xf198('0x29')]));_0x41eb59[_0xf198('0x2a')]=_0x41eb59['attributes']['length']?_0x41eb59[_0xf198('0x2a')]:_0x3de7e9[_0xf198('0x24')];if(_0x18c737[_0xf198('0x26')]['includeAll']){_0x41eb59[_0xf198('0x3b')]=[{'all':!![]}];}_0x41eb59=_[_0xf198('0x33')]({},_0x41eb59,_0x18c737[_0xf198('0x39')]);return db[_0xf198('0x23')]['find'](_0x41eb59)['then'](handleEntityNotFound(_0xa88d4d,null))[_0xf198('0x1d')](respondWithResult(_0xa88d4d,null))[_0xf198('0x3d')](handleError(_0xa88d4d,null));};exports[_0xf198('0x41')]=function(_0x1e9076,_0xb1d64){return db[_0xf198('0x23')][_0xf198('0x41')](_0x1e9076['body'],{})[_0xf198('0x1d')](respondWithResult(_0xb1d64,0xc9))[_0xf198('0x3d')](handleError(_0xb1d64,null));};exports[_0xf198('0x42')]=function(_0x5e2a61,_0x59aac5){return db['AnalyticFieldReport'][_0xf198('0x42')](_0x5e2a61[_0xf198('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x59aac5,0xc9))[_0xf198('0x3d')](handleError(_0x59aac5,null));};exports[_0xf198('0x44')]=function(_0x278238,_0x257f2e){if(_0x278238[_0xf198('0x43')]['id']){delete _0x278238[_0xf198('0x43')]['id'];}return db['AnalyticFieldReport'][_0xf198('0x45')]({'where':{'id':_0x278238['params']['id']}})[_0xf198('0x1d')](handleEntityNotFound(_0x257f2e,null))[_0xf198('0x1d')](saveUpdates(_0x278238['body'],null))[_0xf198('0x1d')](respondWithResult(_0x257f2e,null))['catch'](handleError(_0x257f2e,null));};exports[_0xf198('0x1e')]=function(_0x4bc191,_0x3e4a0f){return db[_0xf198('0x23')][_0xf198('0x45')]({'where':{'id':_0x4bc191['params']['id']}})['then'](handleEntityNotFound(_0x3e4a0f,null))[_0xf198('0x1d')](removeEntity(_0x3e4a0f,null))[_0xf198('0x3d')](handleError(_0x3e4a0f,null));};exports[_0xf198('0x46')]=function(_0x447e85,_0x4e68a5){return db['AnalyticFieldReport'][_0xf198('0x1e')]({'where':{'id':_0x447e85[_0xf198('0x26')][_0xf198('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4e68a5,0xcc))[_0xf198('0x3d')](handleError(_0x4e68a5,null));};exports[_0xf198('0x48')]=function(_0x38a37e,_0x5e642a,_0x1847f1){return db[_0xf198('0x49')]['findOne']({'where':{'id':_0x38a37e[_0xf198('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e642a,null))[_0xf198('0x1d')](function(_0x533682){if(_0x533682){return db[_0xf198('0x4a')]['transaction'](function(_0x593ece){return db[_0xf198('0x23')][_0xf198('0x1e')]({'where':{'CustomReportId':_0x38a37e[_0xf198('0x3f')]['id']},'transaction':_0x593ece})[_0xf198('0x1d')](function(_0x274a17){var _0x14f951=_[_0xf198('0x34')](_0x38a37e[_0xf198('0x43')],function(_0x2b6d90){delete _0x2b6d90['id'];_0x2b6d90[_0xf198('0x4b')]=_0x38a37e[_0xf198('0x3f')]['id'];return _0x2b6d90;});return db[_0xf198('0x23')][_0xf198('0x42')](_0x14f951,{'transaction':_0x593ece});});})['then'](function(){return db[_0xf198('0x23')][_0xf198('0x4c')]({'where':{'CustomReportId':_0x38a37e[_0xf198('0x3f')]['id']}});});}})['then'](respondWithResult(_0x5e642a,null))[_0xf198('0x3d')](handleError(_0x5e642a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index bfc6dd7..0fe50b3 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 _0x5574=['api','moment','request-promise','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x5574,0xf0));var _0x4557=function(_0x295567,_0x1de5fa){_0x295567=_0x295567-0x0;var _0x12e218=_0x5574[_0x295567];return _0x12e218;};'use strict';var _=require(_0x4557('0x0'));var util=require(_0x4557('0x1'));var logger=require(_0x4557('0x2'))(_0x4557('0x3'));var moment=require(_0x4557('0x4'));var BPromise=require('bluebird');var rp=require(_0x4557('0x5'));var attributes=require(_0x4557('0x6'));module['exports']=function(_0x1c5e4e,_0xadbb93){return _0x1c5e4e['define'](_0x4557('0x7'),attributes,{'tableName':_0x4557('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x773d=['moment','bluebird','request-promise','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x3ac02f,_0x3fd2b4){var _0x3fdaa4=function(_0x834b6c){while(--_0x834b6c){_0x3ac02f['push'](_0x3ac02f['shift']());}};_0x3fdaa4(++_0x3fd2b4);}(_0x773d,0xb1));var _0xd773=function(_0xe4fa63,_0x4e7d2f){_0xe4fa63=_0xe4fa63-0x0;var _0x24bd1e=_0x773d[_0xe4fa63];return _0x24bd1e;};'use strict';var _=require(_0xd773('0x0'));var util=require(_0xd773('0x1'));var logger=require(_0xd773('0x2'))('api');var moment=require(_0xd773('0x3'));var BPromise=require(_0xd773('0x4'));var rp=require(_0xd773('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0xd773('0x6')]=function(_0x564694,_0x2b4b64){return _0x564694[_0xd773('0x7')](_0xd773('0x8'),attributes,{'tableName':_0xd773('0x9'),'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 a653284..d36fc10 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 _0xf8af=['../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0xf8af,0x8b));var _0xff8a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf8af[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var moment=require(_0xff8a('0x1'));var BPromise=require(_0xff8a('0x2'));var rs=require(_0xff8a('0x3'));var fs=require('fs');var Redis=require(_0xff8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff8a('0x5'));var logger=require(_0xff8a('0x6'))(_0xff8a('0x7'));var config=require(_0xff8a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff8a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x571a7f,_0x1a1251,_0x406e06){return new BPromise(function(_0x46e262,_0x1ce66c){return client[_0xff8a('0xa')](_0x571a7f,_0x406e06)[_0xff8a('0xb')](function(_0x108875){logger[_0xff8a('0xc')](_0xff8a('0xd'),_0x1a1251,_0xff8a('0xe'));logger[_0xff8a('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1a1251,_0xff8a('0xe'),JSON[_0xff8a('0x10')](_0x108875));if(_0x108875[_0xff8a('0x11')]){if(_0x108875['error'][_0xff8a('0x12')]===0x1f4){logger[_0xff8a('0x11')](_0xff8a('0xd'),_0x1a1251,_0x108875[_0xff8a('0x11')][_0xff8a('0x13')]);return _0x1ce66c(_0x108875['error'][_0xff8a('0x13')]);}logger[_0xff8a('0x11')](_0xff8a('0xd'),_0x1a1251,_0x108875[_0xff8a('0x11')]['message']);return _0x46e262(_0x108875['error']['message']);}else{logger['info'](_0xff8a('0xd'),_0x1a1251,'request\x20sent');_0x46e262(_0x108875[_0xff8a('0x14')][_0xff8a('0x13')]);}})['catch'](function(_0x2dba7f){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a1251,_0x2dba7f);_0x1ce66c(_0x2dba7f);});});} \ No newline at end of file +var _0xf23b=['AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x433352,_0x397a78){var _0xee13ee=function(_0x51f375){while(--_0x51f375){_0x433352['push'](_0x433352['shift']());}};_0xee13ee(++_0x397a78);}(_0xf23b,0x133));var _0xbf23=function(_0x44dbd8,_0x45aed1){_0x44dbd8=_0x44dbd8-0x0;var _0x28ea61=_0xf23b[_0x44dbd8];return _0x28ea61;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var moment=require(_0xbf23('0x2'));var BPromise=require(_0xbf23('0x3'));var rs=require(_0xbf23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf23('0x5'))['db'];var utils=require(_0xbf23('0x6'));var logger=require(_0xbf23('0x7'))('rpc');var config=require(_0xbf23('0x8'));var jayson=require(_0xbf23('0x9'));var client=jayson[_0xbf23('0xa')][_0xbf23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18857b,_0x4c0869,_0x4b5e1e){return new BPromise(function(_0x41b721,_0x486c02){return client[_0xbf23('0xc')](_0x18857b,_0x4b5e1e)[_0xbf23('0xd')](function(_0x378d37){logger[_0xbf23('0xe')](_0xbf23('0xf'),_0x4c0869,'request\x20sent');logger[_0xbf23('0x10')](_0xbf23('0x11'),_0x4c0869,_0xbf23('0x12'),JSON[_0xbf23('0x13')](_0x378d37));if(_0x378d37[_0xbf23('0x14')]){if(_0x378d37[_0xbf23('0x14')]['code']===0x1f4){logger[_0xbf23('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c0869,_0x378d37[_0xbf23('0x14')]['message']);return _0x486c02(_0x378d37[_0xbf23('0x14')][_0xbf23('0x15')]);}logger['error'](_0xbf23('0xf'),_0x4c0869,_0x378d37['error']['message']);return _0x41b721(_0x378d37[_0xbf23('0x14')][_0xbf23('0x15')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4c0869,_0xbf23('0x12'));_0x41b721(_0x378d37['result'][_0xbf23('0x15')]);}})[_0xbf23('0x16')](function(_0x3e3575){logger[_0xbf23('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c0869,_0x3e3575);_0x486c02(_0x3e3575);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 800d16f..d31bcfa 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 _0x4ded=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','/:id','show','post','/:id/create_many','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x31a3fc,_0x5dd847){var _0x144cd8=function(_0x1c0d94){while(--_0x1c0d94){_0x31a3fc['push'](_0x31a3fc['shift']());}};_0x144cd8(++_0x5dd847);}(_0x4ded,0x116));var _0xd4de=function(_0x5ecbad,_0x315415){_0x5ecbad=_0x5ecbad-0x0;var _0x3e2d69=_0x4ded[_0x5ecbad];return _0x3e2d69;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var auth=require(_0xd4de('0x6'));var interaction=require(_0xd4de('0x7'));var config=require(_0xd4de('0x8'));var controller=require(_0xd4de('0x9'));router[_0xd4de('0xa')]('/',auth[_0xd4de('0xb')](),controller['index']);router[_0xd4de('0xa')](_0xd4de('0xc'),auth[_0xd4de('0xb')](),controller[_0xd4de('0xd')]);router[_0xd4de('0xe')]('/',auth[_0xd4de('0xb')](),controller['create']);router[_0xd4de('0xe')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0xd4de('0xe')](_0xd4de('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put'](_0xd4de('0xc'),auth['isAuthenticated'](),controller[_0xd4de('0x10')]);router[_0xd4de('0x11')](_0xd4de('0x12'),auth[_0xd4de('0xb')](),controller[_0xd4de('0x13')]);router[_0xd4de('0x11')](_0xd4de('0xc'),auth[_0xd4de('0xb')](),controller[_0xd4de('0x14')]);module[_0xd4de('0x15')]=router; \ No newline at end of file +var _0x2f68=['put','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','isAuthenticated','index','create','post','bulkCreate','/:id/create_many','addFields'];(function(_0x293a32,_0x281c2a){var _0x374209=function(_0x2f006a){while(--_0x2f006a){_0x293a32['push'](_0x293a32['shift']());}};_0x374209(++_0x281c2a);}(_0x2f68,0x9a));var _0x82f6=function(_0x360e6c,_0x20d705){_0x360e6c=_0x360e6c-0x0;var _0x11df8b=_0x2f68[_0x360e6c];return _0x11df8b;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var auth=require(_0x82f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82f6('0x5'));var controller=require(_0x82f6('0x6'));router['get']('/',auth[_0x82f6('0x7')](),controller[_0x82f6('0x8')]);router['get']('/:id',auth[_0x82f6('0x7')](),controller['show']);router['post']('/',auth[_0x82f6('0x7')](),controller[_0x82f6('0x9')]);router[_0x82f6('0xa')]('/create_many',auth[_0x82f6('0x7')](),controller[_0x82f6('0xb')]);router['post'](_0x82f6('0xc'),auth[_0x82f6('0x7')](),controller[_0x82f6('0xd')]);router[_0x82f6('0xe')](_0x82f6('0xf'),auth[_0x82f6('0x7')](),controller['update']);router[_0x82f6('0x10')](_0x82f6('0x11'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x10')](_0x82f6('0xf'),auth[_0x82f6('0x7')](),controller[_0x82f6('0x13')]);module[_0x82f6('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 2c62a3a..8faf87c 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 _0x1c7b=['STRING','name','TEXT','sequelize'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x1c7b,0x15f));var _0xb1c7=function(_0x59f433,_0x36d3c8){_0x59f433=_0x59f433-0x0;var _0x2e49ae=_0x1c7b[_0x59f433];return _0x2e49ae;};'use strict';var Sequelize=require(_0xb1c7('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1c7('0x1')],'allowNull':![],'unique':_0xb1c7('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xb1c7('0x3')]},'description':{'type':Sequelize[_0xb1c7('0x1')]}}; \ No newline at end of file +var _0xdd32=['exports','STRING','TEXT','sequelize'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0xdd32,0x1c7));var _0x2dd3=function(_0xa6cdb0,_0xa0a884){_0xa6cdb0=_0xa6cdb0-0x0;var _0x110ac2=_0xdd32[_0xa6cdb0];return _0x110ac2;};'use strict';var Sequelize=require(_0x2dd3('0x0'));module[_0x2dd3('0x1')]={'name':{'type':Sequelize[_0x2dd3('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2dd3('0x2')]},'metric':{'type':Sequelize[_0x2dd3('0x3')]},'description':{'type':Sequelize[_0x2dd3('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 42b162f..ed5c246 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 _0x42a8=['findAll','rows','catch','show','params','find','create','body','user','get','role','Metrics','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','reject','update','then','UserProfileResource','stack','name','send','index','AnalyticMetric','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include'];(function(_0x50a60e,_0x41cd99){var _0x6977a1=function(_0x2d1fbb){while(--_0x2d1fbb){_0x50a60e['push'](_0x50a60e['shift']());}};_0x6977a1(++_0x41cd99);}(_0x42a8,0x67));var _0x842a=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0x42a8[_0x34f8ba];return _0xa5ed05;};'use strict';var pdf=require(_0x842a('0x0'));var emlformat=require(_0x842a('0x1'));var rimraf=require(_0x842a('0x2'));var zipdir=require(_0x842a('0x3'));var jsonpatch=require(_0x842a('0x4'));var rp=require(_0x842a('0x5'));var moment=require(_0x842a('0x6'));var BPromise=require(_0x842a('0x7'));var Mustache=require(_0x842a('0x8'));var util=require(_0x842a('0x9'));var path=require(_0x842a('0xa'));var sox=require('sox');var csv=require(_0x842a('0xb'));var ejs=require(_0x842a('0xc'));var fs=require('fs');var _=require(_0x842a('0xd'));var squel=require(_0x842a('0xe'));var crypto=require(_0x842a('0xf'));var jsforce=require(_0x842a('0x10'));var deskjs=require(_0x842a('0x11'));var toCsv=require(_0x842a('0xb'));var querystring=require(_0x842a('0x12'));var Papa=require(_0x842a('0x13'));var authService=require(_0x842a('0x14'));var hardwareService=require(_0x842a('0x15'));var Redis=require(_0x842a('0x16'));var qs=require('../../components/parsers/qs');var logger=require(_0x842a('0x17'))(_0x842a('0x18'));var utils=require(_0x842a('0x19'));var config=require(_0x842a('0x1a'));var db=require(_0x842a('0x1b'))['db'];function respondWithStatusCode(_0x35c8e1,_0x489da3){_0x489da3=_0x489da3||0xcc;return function(_0x3b8b4e){if(_0x3b8b4e){return _0x35c8e1[_0x842a('0x1c')](_0x489da3);}return _0x35c8e1['status'](_0x489da3)['end']();};}function respondWithResult(_0xa63f7d,_0x4c861e){_0x4c861e=_0x4c861e||0xc8;return function(_0x4d31df){if(_0x4d31df){return _0xa63f7d[_0x842a('0x1d')](_0x4c861e)[_0x842a('0x1e')](_0x4d31df);}};}function respondWithFilteredResult(_0x16efd1,_0x3aeeb4){return function(_0x16f27a){if(_0x16f27a){var _0x2771bb=_0x16f27a[_0x842a('0x1f')],_0x18cab9=_0x3aeeb4[_0x842a('0x20')],_0x1f8f21=_0x3aeeb4[_0x842a('0x20')]+_0x3aeeb4['limit'],_0x55018a;if(_0x1f8f21>=_0x2771bb){_0x1f8f21=_0x2771bb;_0x55018a=0xc8;}else{_0x55018a=0xce;}_0x16efd1[_0x842a('0x1d')](_0x55018a);return _0x16efd1['set']('Content-Range',_0x18cab9+'-'+_0x1f8f21+'/'+_0x2771bb)[_0x842a('0x1e')](_0x16f27a);}return null;};}function patchUpdates(_0x36ea1c){return function(_0x5cf806){try{jsonpatch['apply'](_0x5cf806,_0x36ea1c,!![]);}catch(_0x176120){return BPromise[_0x842a('0x21')](_0x176120);}return _0x5cf806['save']();};}function saveUpdates(_0x3ea612,_0x7aab5c){return function(_0x72a885){if(_0x72a885){return _0x72a885[_0x842a('0x22')](_0x3ea612)[_0x842a('0x23')](function(_0x4c1741){return _0x4c1741;});}return null;};}function removeEntity(_0x2c185e,_0x41008a){return function(_0x24b0d9){if(_0x24b0d9){return _0x24b0d9['destroy']()[_0x842a('0x23')](function(){var _0x100f1b=_0x24b0d9['get']({'plain':!![]});var _0x53d449='Metrics';return db[_0x842a('0x24')]['destroy']({'where':{'type':_0x53d449,'resourceId':_0x100f1b['id']}})[_0x842a('0x23')](function(){return _0x24b0d9;});})['then'](function(){_0x2c185e[_0x842a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ec493,_0x596b80){return function(_0xe4ce02){if(!_0xe4ce02){_0x3ec493[_0x842a('0x1c')](0x194);}return _0xe4ce02;};}function handleError(_0x2a9560,_0x16528d){_0x16528d=_0x16528d||0x1f4;return function(_0x357273){logger['error'](_0x357273[_0x842a('0x25')]);if(_0x357273[_0x842a('0x26')]){delete _0x357273[_0x842a('0x26')];}_0x2a9560[_0x842a('0x1d')](_0x16528d)[_0x842a('0x27')](_0x357273);};}exports[_0x842a('0x28')]=function(_0x22c7c0,_0x110550){var _0x23bb2f={},_0x282e13={},_0xda2f5e={'count':0x0,'rows':[]};var _0x28109f=db[_0x842a('0x29')][_0x842a('0x2a')];_0x282e13['model']=_[_0x842a('0x2b')](_0x28109f);_0x282e13[_0x842a('0x2c')]=_['keys'](_0x22c7c0[_0x842a('0x2c')]);_0x282e13[_0x842a('0x2d')]=_[_0x842a('0x2e')](_0x282e13['model'],_0x282e13[_0x842a('0x2c')]);_0x23bb2f['attributes']=_[_0x842a('0x2e')](_0x282e13['model'],qs[_0x842a('0x2f')](_0x22c7c0[_0x842a('0x2c')][_0x842a('0x2f')]));_0x23bb2f[_0x842a('0x30')]=_0x23bb2f['attributes'][_0x842a('0x31')]?_0x23bb2f[_0x842a('0x30')]:_0x282e13[_0x842a('0x32')];if(!_0x22c7c0['query'][_0x842a('0x33')](_0x842a('0x34'))){_0x23bb2f[_0x842a('0x35')]=qs[_0x842a('0x35')](_0x22c7c0[_0x842a('0x2c')][_0x842a('0x35')]);_0x23bb2f[_0x842a('0x20')]=qs[_0x842a('0x20')](_0x22c7c0[_0x842a('0x2c')][_0x842a('0x20')]);}_0x23bb2f[_0x842a('0x36')]=qs[_0x842a('0x37')](_0x22c7c0[_0x842a('0x2c')]['sort']);_0x23bb2f[_0x842a('0x38')]=qs['filters'](_[_0x842a('0x39')](_0x22c7c0[_0x842a('0x2c')],_0x282e13['filters']));if(_0x22c7c0[_0x842a('0x2c')][_0x842a('0x3a')]){_0x23bb2f[_0x842a('0x38')]=_[_0x842a('0x3b')](_0x23bb2f[_0x842a('0x38')],{'$or':_[_0x842a('0x3c')](_0x28109f,function(_0x539a5c){if(_0x539a5c[_0x842a('0x3d')][_0x842a('0x3e')]!=='VIRTUAL'){var _0xb12ddf={};_0xb12ddf[_0x539a5c[_0x842a('0x3f')]]={'$like':'%'+_0x22c7c0[_0x842a('0x2c')][_0x842a('0x3a')]+'%'};return _0xb12ddf;}})});}_0x23bb2f=_[_0x842a('0x3b')]({},_0x23bb2f,_0x22c7c0[_0x842a('0x40')]);var _0x273aa2={'where':_0x23bb2f[_0x842a('0x38')]};return db['AnalyticMetric'][_0x842a('0x1f')](_0x273aa2)[_0x842a('0x23')](function(_0x2b13aa){_0xda2f5e[_0x842a('0x1f')]=_0x2b13aa;if(_0x22c7c0['query'][_0x842a('0x41')]){_0x23bb2f[_0x842a('0x42')]=[{'all':!![]}];}return db[_0x842a('0x29')][_0x842a('0x43')](_0x23bb2f);})[_0x842a('0x23')](function(_0x5778c8){_0xda2f5e[_0x842a('0x44')]=_0x5778c8;return _0xda2f5e;})[_0x842a('0x23')](respondWithFilteredResult(_0x110550,_0x23bb2f))[_0x842a('0x45')](handleError(_0x110550,null));};exports[_0x842a('0x46')]=function(_0xb351af,_0x195f88){var _0x4bf4b7={'raw':!![],'where':{'id':_0xb351af[_0x842a('0x47')]['id']}},_0x4158ea={};_0x4158ea['model']=_[_0x842a('0x2b')](db[_0x842a('0x29')][_0x842a('0x2a')]);_0x4158ea[_0x842a('0x2c')]=_['keys'](_0xb351af['query']);_0x4158ea['filters']=_['intersection'](_0x4158ea[_0x842a('0x32')],_0x4158ea[_0x842a('0x2c')]);_0x4bf4b7[_0x842a('0x30')]=_['intersection'](_0x4158ea[_0x842a('0x32')],qs[_0x842a('0x2f')](_0xb351af[_0x842a('0x2c')]['fields']));_0x4bf4b7[_0x842a('0x30')]=_0x4bf4b7[_0x842a('0x30')][_0x842a('0x31')]?_0x4bf4b7[_0x842a('0x30')]:_0x4158ea[_0x842a('0x32')];if(_0xb351af[_0x842a('0x2c')]['includeAll']){_0x4bf4b7[_0x842a('0x42')]=[{'all':!![]}];}_0x4bf4b7=_['merge']({},_0x4bf4b7,_0xb351af[_0x842a('0x40')]);return db[_0x842a('0x29')][_0x842a('0x48')](_0x4bf4b7)[_0x842a('0x23')](handleEntityNotFound(_0x195f88,null))['then'](respondWithResult(_0x195f88,null))[_0x842a('0x45')](handleError(_0x195f88,null));};exports[_0x842a('0x49')]=function(_0x4e28e2,_0x6abf46){return db['AnalyticMetric'][_0x842a('0x49')](_0x4e28e2[_0x842a('0x4a')],{})[_0x842a('0x23')](function(_0x2a6b2c){var _0xc985cc=_0x4e28e2[_0x842a('0x4b')][_0x842a('0x4c')]({'plain':!![]});if(!_0xc985cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc985cc[_0x842a('0x4d')]===_0x842a('0x4b')){var _0x26c403=_0x2a6b2c[_0x842a('0x4c')]({'plain':!![]});var _0x1d3470=_0x842a('0x4e');return db[_0x842a('0x4f')][_0x842a('0x48')]({'where':{'name':_0x1d3470,'userProfileId':_0xc985cc[_0x842a('0x50')]},'raw':!![]})[_0x842a('0x23')](function(_0x1a5d91){if(_0x1a5d91&&_0x1a5d91[_0x842a('0x51')]===0x0){return db['UserProfileResource'][_0x842a('0x49')]({'name':_0x26c403[_0x842a('0x26')],'resourceId':_0x26c403['id'],'type':_0x1a5d91[_0x842a('0x26')],'sectionId':_0x1a5d91['id']},{})[_0x842a('0x23')](function(){return _0x2a6b2c;});}else{return _0x2a6b2c;}})['catch'](function(_0x4f6d3d){logger[_0x842a('0x52')](_0x842a('0x53'),_0x4f6d3d);throw _0x4f6d3d;});}return _0x2a6b2c;})[_0x842a('0x23')](respondWithResult(_0x6abf46,0xc9))[_0x842a('0x45')](handleError(_0x6abf46,null));};exports[_0x842a('0x22')]=function(_0x263b96,_0x5922b7){if(_0x263b96['body']['id']){delete _0x263b96[_0x842a('0x4a')]['id'];}return db[_0x842a('0x29')][_0x842a('0x48')]({'where':{'id':_0x263b96[_0x842a('0x47')]['id']}})[_0x842a('0x23')](handleEntityNotFound(_0x5922b7,null))[_0x842a('0x23')](saveUpdates(_0x263b96['body'],null))['then'](respondWithResult(_0x5922b7,null))['catch'](handleError(_0x5922b7,null));};exports[_0x842a('0x54')]=function(_0x1cbfa5,_0x404272){return db[_0x842a('0x29')][_0x842a('0x48')]({'where':{'id':_0x1cbfa5[_0x842a('0x47')]['id']}})[_0x842a('0x23')](handleEntityNotFound(_0x404272,null))[_0x842a('0x23')](removeEntity(_0x404272,null))['catch'](handleError(_0x404272,null));}; \ No newline at end of file +var _0x80e4=['pick','filters','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','Metrics','UserProfileResource','error','stack','name','send','index','AnalyticMetric','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where'];(function(_0x3cc36c,_0x21e650){var _0x38b32b=function(_0x3d36ba){while(--_0x3d36ba){_0x3cc36c['push'](_0x3cc36c['shift']());}};_0x38b32b(++_0x21e650);}(_0x80e4,0x113));var _0x480e=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x80e4[_0x25e109];return _0xc0f7d6;};'use strict';var pdf=require(_0x480e('0x0'));var emlformat=require(_0x480e('0x1'));var rimraf=require(_0x480e('0x2'));var zipdir=require(_0x480e('0x3'));var jsonpatch=require(_0x480e('0x4'));var rp=require(_0x480e('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x480e('0x6'));var util=require(_0x480e('0x7'));var path=require('path');var sox=require(_0x480e('0x8'));var csv=require(_0x480e('0x9'));var ejs=require(_0x480e('0xa'));var fs=require('fs');var _=require(_0x480e('0xb'));var squel=require(_0x480e('0xc'));var crypto=require(_0x480e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x480e('0xe'));var toCsv=require(_0x480e('0x9'));var querystring=require('querystring');var Papa=require(_0x480e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x480e('0x10'));var Redis=require(_0x480e('0x11'));var qs=require(_0x480e('0x12'));var logger=require(_0x480e('0x13'))(_0x480e('0x14'));var utils=require('../../config/utils');var config=require(_0x480e('0x15'));var db=require(_0x480e('0x16'))['db'];function respondWithStatusCode(_0x5d5adb,_0x59f209){_0x59f209=_0x59f209||0xcc;return function(_0x1327fe){if(_0x1327fe){return _0x5d5adb[_0x480e('0x17')](_0x59f209);}return _0x5d5adb[_0x480e('0x18')](_0x59f209)[_0x480e('0x19')]();};}function respondWithResult(_0x2f785f,_0x16af34){_0x16af34=_0x16af34||0xc8;return function(_0x50f441){if(_0x50f441){return _0x2f785f['status'](_0x16af34)[_0x480e('0x1a')](_0x50f441);}};}function respondWithFilteredResult(_0x1e3412,_0x2f281b){return function(_0xb503dd){if(_0xb503dd){var _0x3af73c=_0xb503dd['count'],_0x539d79=_0x2f281b[_0x480e('0x1b')],_0x5def2e=_0x2f281b[_0x480e('0x1b')]+_0x2f281b[_0x480e('0x1c')],_0xdcd6db;if(_0x5def2e>=_0x3af73c){_0x5def2e=_0x3af73c;_0xdcd6db=0xc8;}else{_0xdcd6db=0xce;}_0x1e3412[_0x480e('0x18')](_0xdcd6db);return _0x1e3412[_0x480e('0x1d')]('Content-Range',_0x539d79+'-'+_0x5def2e+'/'+_0x3af73c)[_0x480e('0x1a')](_0xb503dd);}return null;};}function patchUpdates(_0x43b916){return function(_0x157d05){try{jsonpatch[_0x480e('0x1e')](_0x157d05,_0x43b916,!![]);}catch(_0x6d3dde){return BPromise['reject'](_0x6d3dde);}return _0x157d05[_0x480e('0x1f')]();};}function saveUpdates(_0x236d1e,_0x27e0da){return function(_0x304668){if(_0x304668){return _0x304668[_0x480e('0x20')](_0x236d1e)[_0x480e('0x21')](function(_0x5e2a99){return _0x5e2a99;});}return null;};}function removeEntity(_0xa0a900,_0x426f3a){return function(_0x15076c){if(_0x15076c){return _0x15076c[_0x480e('0x22')]()[_0x480e('0x21')](function(){var _0x54502c=_0x15076c['get']({'plain':!![]});var _0x366002=_0x480e('0x23');return db[_0x480e('0x24')]['destroy']({'where':{'type':_0x366002,'resourceId':_0x54502c['id']}})['then'](function(){return _0x15076c;});})[_0x480e('0x21')](function(){_0xa0a900[_0x480e('0x18')](0xcc)[_0x480e('0x19')]();});}};}function handleEntityNotFound(_0x150bfa,_0xef2d7b){return function(_0x5c52eb){if(!_0x5c52eb){_0x150bfa['sendStatus'](0x194);}return _0x5c52eb;};}function handleError(_0x5ef207,_0x10e8bf){_0x10e8bf=_0x10e8bf||0x1f4;return function(_0x48b77a){logger[_0x480e('0x25')](_0x48b77a[_0x480e('0x26')]);if(_0x48b77a['name']){delete _0x48b77a[_0x480e('0x27')];}_0x5ef207[_0x480e('0x18')](_0x10e8bf)[_0x480e('0x28')](_0x48b77a);};}exports[_0x480e('0x29')]=function(_0x5722a5,_0x490607){var _0x460d44={},_0x413cb2={},_0x49e057={'count':0x0,'rows':[]};var _0x368b74=db[_0x480e('0x2a')]['rawAttributes'];_0x413cb2[_0x480e('0x2b')]=_[_0x480e('0x2c')](_0x368b74);_0x413cb2[_0x480e('0x2d')]=_['keys'](_0x5722a5['query']);_0x413cb2['filters']=_[_0x480e('0x2e')](_0x413cb2['model'],_0x413cb2[_0x480e('0x2d')]);_0x460d44['attributes']=_[_0x480e('0x2e')](_0x413cb2[_0x480e('0x2b')],qs[_0x480e('0x2f')](_0x5722a5['query']['fields']));_0x460d44[_0x480e('0x30')]=_0x460d44[_0x480e('0x30')]['length']?_0x460d44[_0x480e('0x30')]:_0x413cb2[_0x480e('0x2b')];if(!_0x5722a5[_0x480e('0x2d')]['hasOwnProperty'](_0x480e('0x31'))){_0x460d44[_0x480e('0x1c')]=qs[_0x480e('0x1c')](_0x5722a5['query']['limit']);_0x460d44[_0x480e('0x1b')]=qs[_0x480e('0x1b')](_0x5722a5['query']['offset']);}_0x460d44[_0x480e('0x32')]=qs['sort'](_0x5722a5[_0x480e('0x2d')][_0x480e('0x33')]);_0x460d44[_0x480e('0x34')]=qs['filters'](_[_0x480e('0x35')](_0x5722a5[_0x480e('0x2d')],_0x413cb2[_0x480e('0x36')]));if(_0x5722a5[_0x480e('0x2d')][_0x480e('0x37')]){_0x460d44['where']=_[_0x480e('0x38')](_0x460d44['where'],{'$or':_[_0x480e('0x39')](_0x368b74,function(_0x1a0267){if(_0x1a0267[_0x480e('0x3a')][_0x480e('0x3b')]!=='VIRTUAL'){var _0x1432b5={};_0x1432b5[_0x1a0267[_0x480e('0x3c')]]={'$like':'%'+_0x5722a5[_0x480e('0x2d')]['filter']+'%'};return _0x1432b5;}})});}_0x460d44=_[_0x480e('0x38')]({},_0x460d44,_0x5722a5[_0x480e('0x3d')]);var _0x1389d1={'where':_0x460d44['where']};return db[_0x480e('0x2a')][_0x480e('0x3e')](_0x1389d1)['then'](function(_0x139a1b){_0x49e057[_0x480e('0x3e')]=_0x139a1b;if(_0x5722a5[_0x480e('0x2d')][_0x480e('0x3f')]){_0x460d44[_0x480e('0x40')]=[{'all':!![]}];}return db[_0x480e('0x2a')][_0x480e('0x41')](_0x460d44);})[_0x480e('0x21')](function(_0x56c1ed){_0x49e057[_0x480e('0x42')]=_0x56c1ed;return _0x49e057;})['then'](respondWithFilteredResult(_0x490607,_0x460d44))[_0x480e('0x43')](handleError(_0x490607,null));};exports[_0x480e('0x44')]=function(_0x1c07ad,_0x1159c2){var _0x342afd={'raw':!![],'where':{'id':_0x1c07ad[_0x480e('0x45')]['id']}},_0x18c636={};_0x18c636[_0x480e('0x2b')]=_[_0x480e('0x2c')](db['AnalyticMetric'][_0x480e('0x46')]);_0x18c636['query']=_['keys'](_0x1c07ad[_0x480e('0x2d')]);_0x18c636[_0x480e('0x36')]=_[_0x480e('0x2e')](_0x18c636['model'],_0x18c636[_0x480e('0x2d')]);_0x342afd[_0x480e('0x30')]=_['intersection'](_0x18c636[_0x480e('0x2b')],qs[_0x480e('0x2f')](_0x1c07ad['query'][_0x480e('0x2f')]));_0x342afd[_0x480e('0x30')]=_0x342afd[_0x480e('0x30')][_0x480e('0x47')]?_0x342afd[_0x480e('0x30')]:_0x18c636[_0x480e('0x2b')];if(_0x1c07ad[_0x480e('0x2d')][_0x480e('0x3f')]){_0x342afd['include']=[{'all':!![]}];}_0x342afd=_['merge']({},_0x342afd,_0x1c07ad['options']);return db[_0x480e('0x2a')][_0x480e('0x48')](_0x342afd)['then'](handleEntityNotFound(_0x1159c2,null))[_0x480e('0x21')](respondWithResult(_0x1159c2,null))[_0x480e('0x43')](handleError(_0x1159c2,null));};exports[_0x480e('0x49')]=function(_0x1d87f3,_0x17d822){return db['AnalyticMetric'][_0x480e('0x49')](_0x1d87f3['body'],{})[_0x480e('0x21')](function(_0x2b1381){var _0x229fa9=_0x1d87f3['user'][_0x480e('0x4a')]({'plain':!![]});if(!_0x229fa9)throw new Error(_0x480e('0x4b'));if(_0x229fa9[_0x480e('0x4c')]===_0x480e('0x4d')){var _0x559325=_0x2b1381[_0x480e('0x4a')]({'plain':!![]});var _0x25b6e4=_0x480e('0x23');return db[_0x480e('0x4e')][_0x480e('0x48')]({'where':{'name':_0x25b6e4,'userProfileId':_0x229fa9['userProfileId']},'raw':!![]})['then'](function(_0x2ac43f){if(_0x2ac43f&&_0x2ac43f[_0x480e('0x4f')]===0x0){return db[_0x480e('0x24')][_0x480e('0x49')]({'name':_0x559325['name'],'resourceId':_0x559325['id'],'type':_0x2ac43f[_0x480e('0x27')],'sectionId':_0x2ac43f['id']},{})[_0x480e('0x21')](function(){return _0x2b1381;});}else{return _0x2b1381;}})[_0x480e('0x43')](function(_0x3cc611){logger[_0x480e('0x25')](_0x480e('0x50'),_0x3cc611);throw _0x3cc611;});}return _0x2b1381;})[_0x480e('0x21')](respondWithResult(_0x17d822,0xc9))['catch'](handleError(_0x17d822,null));};exports[_0x480e('0x20')]=function(_0x53830f,_0x947f07){if(_0x53830f[_0x480e('0x51')]['id']){delete _0x53830f['body']['id'];}return db[_0x480e('0x2a')][_0x480e('0x48')]({'where':{'id':_0x53830f['params']['id']}})[_0x480e('0x21')](handleEntityNotFound(_0x947f07,null))[_0x480e('0x21')](saveUpdates(_0x53830f['body'],null))['then'](respondWithResult(_0x947f07,null))['catch'](handleError(_0x947f07,null));};exports[_0x480e('0x22')]=function(_0x34467c,_0x40ee27){return db[_0x480e('0x2a')][_0x480e('0x48')]({'where':{'id':_0x34467c[_0x480e('0x45')]['id']}})[_0x480e('0x21')](handleEntityNotFound(_0x40ee27,null))[_0x480e('0x21')](removeEntity(_0x40ee27,null))[_0x480e('0x43')](handleError(_0x40ee27,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 8018959..769cb04 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 _0x21b4=['bluebird','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0xb02c4d,_0x241f70){var _0x2b0601=function(_0x19598f){while(--_0x19598f){_0xb02c4d['push'](_0xb02c4d['shift']());}};_0x2b0601(++_0x241f70);}(_0x21b4,0x69));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x421b('0x0'));var logger=require(_0x421b('0x1'))(_0x421b('0x2'));var moment=require('moment');var BPromise=require(_0x421b('0x3'));var rp=require('request-promise');var attributes=require(_0x421b('0x4'));module[_0x421b('0x5')]=function(_0x587870,_0x4d6afc){return _0x587870[_0x421b('0x6')](_0x421b('0x7'),attributes,{'tableName':_0x421b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b6e=['./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird'];(function(_0x33fb57,_0xa1a64d){var _0x468bb2=function(_0x869e14){while(--_0x869e14){_0x33fb57['push'](_0x33fb57['shift']());}};_0x468bb2(++_0xa1a64d);}(_0x1b6e,0x199));var _0xe1b6=function(_0x12e27f,_0x5b9739){_0x12e27f=_0x12e27f-0x0;var _0x2409ba=_0x1b6e[_0x12e27f];return _0x2409ba;};'use strict';var _=require(_0xe1b6('0x0'));var util=require(_0xe1b6('0x1'));var logger=require(_0xe1b6('0x2'))('api');var moment=require(_0xe1b6('0x3'));var BPromise=require(_0xe1b6('0x4'));var rp=require('request-promise');var attributes=require(_0xe1b6('0x5'));module['exports']=function(_0x2bff25,_0x58ffc8){return _0x2bff25[_0xe1b6('0x6')](_0xe1b6('0x7'),attributes,{'tableName':_0xe1b6('0x8'),'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 ca1dec9..782b684 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 _0x1738=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x1738,0x1bc));var _0x8173=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x1738[_0x33c637];return _0x14aa20;};'use strict';var _=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8173('0x2'));var fs=require('fs');var Redis=require(_0x8173('0x3'));var db=require(_0x8173('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8173('0x5'));var config=require(_0x8173('0x6'));var jayson=require(_0x8173('0x7'));var client=jayson[_0x8173('0x8')][_0x8173('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438550,_0x3e4c85,_0x234f2d){return new BPromise(function(_0x13a621,_0x3e37b1){return client['request'](_0x438550,_0x234f2d)['then'](function(_0x1b787d){logger[_0x8173('0xa')](_0x8173('0xb'),_0x3e4c85,'request\x20sent');logger['debug'](_0x8173('0xc'),_0x3e4c85,_0x8173('0xd'),JSON[_0x8173('0xe')](_0x1b787d));if(_0x1b787d[_0x8173('0xf')]){if(_0x1b787d[_0x8173('0xf')]['code']===0x1f4){logger[_0x8173('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3e4c85,_0x1b787d[_0x8173('0xf')][_0x8173('0x10')]);return _0x3e37b1(_0x1b787d[_0x8173('0xf')][_0x8173('0x10')]);}logger[_0x8173('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3e4c85,_0x1b787d[_0x8173('0xf')][_0x8173('0x10')]);return _0x13a621(_0x1b787d[_0x8173('0xf')]['message']);}else{logger['info'](_0x8173('0xb'),_0x3e4c85,_0x8173('0xd'));_0x13a621(_0x1b787d[_0x8173('0x11')]['message']);}})[_0x8173('0x12')](function(_0x114b42){logger['error'](_0x8173('0xb'),_0x3e4c85,_0x114b42);_0x3e37b1(_0x114b42);});});} \ No newline at end of file +var _0x37f8=['catch','util','moment','bluebird','randomstring','../../mysqldb','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x37f8,0xd2));var _0x837f=function(_0xb66877,_0x1e937e){_0xb66877=_0xb66877-0x0;var _0x1ec34e=_0x37f8[_0xb66877];return _0x1ec34e;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var moment=require(_0x837f('0x1'));var BPromise=require(_0x837f('0x2'));var rs=require(_0x837f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x837f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x837f('0x5')][_0x837f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x224ad2,_0x40270f,_0x4111cb){return new BPromise(function(_0x25bbcb,_0x12c732){return client[_0x837f('0x7')](_0x224ad2,_0x4111cb)[_0x837f('0x8')](function(_0x2f1dc7){logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));logger[_0x837f('0xc')](_0x837f('0xd'),_0x40270f,'request\x20sent',JSON[_0x837f('0xe')](_0x2f1dc7));if(_0x2f1dc7[_0x837f('0xf')]){if(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x10')]===0x1f4){logger[_0x837f('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x12c732(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x25bbcb(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}else{logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));_0x25bbcb(_0x2f1dc7['result'][_0x837f('0x11')]);}})[_0x837f('0x12')](function(_0x47bbe7){logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x47bbe7);_0x12c732(_0x47bbe7);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c3e9a62..c358f44 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 _0x1c7c=['Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x46940e,_0x266684){var _0x58befc=function(_0x362702){while(--_0x362702){_0x46940e['push'](_0x46940e['shift']());}};_0x58befc(++_0x266684);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4390fa,_0x2caf92){_0x4390fa=_0x4390fa-0x0;var _0x15d629=_0x1c7c[_0x4390fa];return _0x15d629;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1c7('0x5'));var config=require(_0xc1c7('0x6'));var controller=require(_0xc1c7('0x7'));router[_0xc1c7('0x8')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xa')]);router[_0xc1c7('0x8')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xc')]);router[_0xc1c7('0xd')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xe')]);router[_0xc1c7('0xf')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x10')]);router['delete'](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller['destroy']);module[_0xc1c7('0x11')]=router; \ No newline at end of file +var _0x253d=['multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','put','destroy','exports'];(function(_0x57b14e,_0x26852a){var _0x1b6008=function(_0x508aea){while(--_0x508aea){_0x57b14e['push'](_0x57b14e['shift']());}};_0x1b6008(++_0x26852a);}(_0x253d,0x1b3));var _0xd253=function(_0x134202,_0x587684){_0x134202=_0x134202-0x0;var _0x5b85ee=_0x253d[_0x134202];return _0x5b85ee;};'use strict';var multer=require(_0xd253('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd253('0x1')]();var auth=require(_0xd253('0x2'));var interaction=require(_0xd253('0x3'));var config=require(_0xd253('0x4'));var controller=require(_0xd253('0x5'));router['get']('/',auth[_0xd253('0x6')](),controller[_0xd253('0x7')]);router[_0xd253('0x8')](_0xd253('0x9'),auth[_0xd253('0x6')](),controller['show']);router[_0xd253('0xa')]('/',auth[_0xd253('0x6')](),controller[_0xd253('0xb')]);router[_0xd253('0xc')](_0xd253('0x9'),auth[_0xd253('0x6')](),controller['update']);router['delete'](_0xd253('0x9'),auth['isAuthenticated'](),controller[_0xd253('0xd')]);module[_0xd253('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a88740d..1847c96 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 _0xee57=['exports','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee57,0x1c4));var _0x7ee5=function(_0x114722,_0x22ce2d){_0x114722=_0x114722-0x0;var _0x1513e6=_0xee57[_0x114722];return _0x1513e6;};'use strict';var Sequelize=require(_0x7ee5('0x0'));module[_0x7ee5('0x1')]={'tree':{'type':Sequelize[_0x7ee5('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x03b1=['sequelize','exports','TEXT'];(function(_0x41b76b,_0x401506){var _0x5d2f5d=function(_0x500e7b){while(--_0x500e7b){_0x41b76b['push'](_0x41b76b['shift']());}};_0x5d2f5d(++_0x401506);}(_0x03b1,0x1da));var _0x103b=function(_0x4b1123,_0x4bb7dd){_0x4b1123=_0x4b1123-0x0;var _0x52c5d7=_0x03b1[_0x4b1123];return _0x52c5d7;};'use strict';var Sequelize=require(_0x103b('0x0'));module[_0x103b('0x1')]={'tree':{'type':Sequelize[_0x103b('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 4a9b830..0d69706 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 _0x9f8d=['filter','merge','map','type','key','VIRTUAL','field','options','includeAll','AnalyticTreeReport','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x1b8d95,_0x109a3e){var _0xfcab56=function(_0x598034){while(--_0x598034){_0x1b8d95['push'](_0x1b8d95['shift']());}};_0xfcab56(++_0x109a3e);}(_0x9f8d,0xb0));var _0xd9f8=function(_0x37c169,_0x3889bc){_0x37c169=_0x37c169-0x0;var _0x5cfc93=_0x9f8d[_0x37c169];return _0x5cfc93;};'use strict';var pdf=require(_0xd9f8('0x0'));var emlformat=require(_0xd9f8('0x1'));var rimraf=require(_0xd9f8('0x2'));var zipdir=require(_0xd9f8('0x3'));var jsonpatch=require(_0xd9f8('0x4'));var rp=require(_0xd9f8('0x5'));var moment=require(_0xd9f8('0x6'));var BPromise=require(_0xd9f8('0x7'));var Mustache=require(_0xd9f8('0x8'));var util=require(_0xd9f8('0x9'));var path=require(_0xd9f8('0xa'));var sox=require(_0xd9f8('0xb'));var csv=require(_0xd9f8('0xc'));var ejs=require(_0xd9f8('0xd'));var fs=require('fs');var _=require(_0xd9f8('0xe'));var squel=require(_0xd9f8('0xf'));var crypto=require(_0xd9f8('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd9f8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd9f8('0x12'));var Papa=require(_0xd9f8('0x13'));var authService=require(_0xd9f8('0x14'));var hardwareService=require(_0xd9f8('0x15'));var Redis=require(_0xd9f8('0x16'));var qs=require('../../components/parsers/qs');var logger=require(_0xd9f8('0x17'))('api');var utils=require(_0xd9f8('0x18'));var config=require(_0xd9f8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56ea0d,_0x5db18e){_0x5db18e=_0x5db18e||0xcc;return function(_0x1a555e){if(_0x1a555e){return _0x56ea0d['sendStatus'](_0x5db18e);}return _0x56ea0d[_0xd9f8('0x1a')](_0x5db18e)[_0xd9f8('0x1b')]();};}function respondWithResult(_0x19cf8b,_0x5ae2ff){_0x5ae2ff=_0x5ae2ff||0xc8;return function(_0x47fe7a){if(_0x47fe7a){return _0x19cf8b[_0xd9f8('0x1a')](_0x5ae2ff)[_0xd9f8('0x1c')](_0x47fe7a);}};}function respondWithFilteredResult(_0x50d9c4,_0x549eae){return function(_0x546d18){if(_0x546d18){var _0x103ad2=_0x546d18[_0xd9f8('0x1d')],_0x8c90dc=_0x549eae[_0xd9f8('0x1e')],_0x57f884=_0x549eae[_0xd9f8('0x1e')]+_0x549eae[_0xd9f8('0x1f')],_0x5a5f84;if(_0x57f884>=_0x103ad2){_0x57f884=_0x103ad2;_0x5a5f84=0xc8;}else{_0x5a5f84=0xce;}_0x50d9c4[_0xd9f8('0x1a')](_0x5a5f84);return _0x50d9c4[_0xd9f8('0x20')](_0xd9f8('0x21'),_0x8c90dc+'-'+_0x57f884+'/'+_0x103ad2)[_0xd9f8('0x1c')](_0x546d18);}return null;};}function patchUpdates(_0x53fd04){return function(_0x33d27e){try{jsonpatch[_0xd9f8('0x22')](_0x33d27e,_0x53fd04,!![]);}catch(_0xbedfb3){return BPromise['reject'](_0xbedfb3);}return _0x33d27e[_0xd9f8('0x23')]();};}function saveUpdates(_0x52e8e0,_0x28dcb5){return function(_0x52f756){if(_0x52f756){return _0x52f756[_0xd9f8('0x24')](_0x52e8e0)[_0xd9f8('0x25')](function(_0x2e7858){return _0x2e7858;});}return null;};}function removeEntity(_0xa89b11,_0x39eefb){return function(_0x142f6d){if(_0x142f6d){return _0x142f6d[_0xd9f8('0x26')]()['then'](function(){_0xa89b11[_0xd9f8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50896e,_0x27628b){return function(_0x18195c){if(!_0x18195c){_0x50896e[_0xd9f8('0x27')](0x194);}return _0x18195c;};}function handleError(_0x24f9ff,_0xdf2ed5){_0xdf2ed5=_0xdf2ed5||0x1f4;return function(_0x2056ca){logger[_0xd9f8('0x28')](_0x2056ca[_0xd9f8('0x29')]);if(_0x2056ca[_0xd9f8('0x2a')]){delete _0x2056ca[_0xd9f8('0x2a')];}_0x24f9ff['status'](_0xdf2ed5)[_0xd9f8('0x2b')](_0x2056ca);};}exports[_0xd9f8('0x2c')]=function(_0x198922,_0x47d660){var _0x2c402b={},_0x2edb49={},_0x31dbd2={'count':0x0,'rows':[]};var _0x34c528=db['AnalyticTreeReport']['rawAttributes'];_0x2edb49['model']=_['keys'](_0x34c528);_0x2edb49[_0xd9f8('0x2d')]=_[_0xd9f8('0x2e')](_0x198922[_0xd9f8('0x2d')]);_0x2edb49[_0xd9f8('0x2f')]=_[_0xd9f8('0x30')](_0x2edb49[_0xd9f8('0x31')],_0x2edb49[_0xd9f8('0x2d')]);_0x2c402b[_0xd9f8('0x32')]=_[_0xd9f8('0x30')](_0x2edb49['model'],qs[_0xd9f8('0x33')](_0x198922[_0xd9f8('0x2d')][_0xd9f8('0x33')]));_0x2c402b[_0xd9f8('0x32')]=_0x2c402b[_0xd9f8('0x32')][_0xd9f8('0x34')]?_0x2c402b['attributes']:_0x2edb49[_0xd9f8('0x31')];if(!_0x198922['query'][_0xd9f8('0x35')]('nolimit')){_0x2c402b[_0xd9f8('0x1f')]=qs[_0xd9f8('0x1f')](_0x198922[_0xd9f8('0x2d')][_0xd9f8('0x1f')]);_0x2c402b[_0xd9f8('0x1e')]=qs[_0xd9f8('0x1e')](_0x198922[_0xd9f8('0x2d')]['offset']);}_0x2c402b[_0xd9f8('0x36')]=qs[_0xd9f8('0x37')](_0x198922[_0xd9f8('0x2d')][_0xd9f8('0x37')]);_0x2c402b[_0xd9f8('0x38')]=qs['filters'](_[_0xd9f8('0x39')](_0x198922[_0xd9f8('0x2d')],_0x2edb49['filters']));if(_0x198922[_0xd9f8('0x2d')][_0xd9f8('0x3a')]){_0x2c402b[_0xd9f8('0x38')]=_[_0xd9f8('0x3b')](_0x2c402b[_0xd9f8('0x38')],{'$or':_[_0xd9f8('0x3c')](_0x34c528,function(_0x49c3ff){if(_0x49c3ff[_0xd9f8('0x3d')][_0xd9f8('0x3e')]!==_0xd9f8('0x3f')){var _0x43b05a={};_0x43b05a[_0x49c3ff[_0xd9f8('0x40')]]={'$like':'%'+_0x198922['query'][_0xd9f8('0x3a')]+'%'};return _0x43b05a;}})});}_0x2c402b=_[_0xd9f8('0x3b')]({},_0x2c402b,_0x198922[_0xd9f8('0x41')]);var _0xa3fb5d={'where':_0x2c402b[_0xd9f8('0x38')]};return db['AnalyticTreeReport'][_0xd9f8('0x1d')](_0xa3fb5d)[_0xd9f8('0x25')](function(_0x20cb98){_0x31dbd2[_0xd9f8('0x1d')]=_0x20cb98;if(_0x198922[_0xd9f8('0x2d')][_0xd9f8('0x42')]){_0x2c402b['include']=[{'all':!![]}];}return db[_0xd9f8('0x43')][_0xd9f8('0x44')](_0x2c402b);})[_0xd9f8('0x25')](function(_0x2a5a90){_0x31dbd2[_0xd9f8('0x45')]=_0x2a5a90;return _0x31dbd2;})[_0xd9f8('0x25')](respondWithFilteredResult(_0x47d660,_0x2c402b))[_0xd9f8('0x46')](handleError(_0x47d660,null));};exports[_0xd9f8('0x47')]=function(_0x47ddb4,_0x1fec16){var _0x12a3ef={'raw':!![],'where':{'id':_0x47ddb4['params']['id']}},_0x5620c4={};_0x5620c4[_0xd9f8('0x31')]=_[_0xd9f8('0x2e')](db['AnalyticTreeReport'][_0xd9f8('0x48')]);_0x5620c4[_0xd9f8('0x2d')]=_[_0xd9f8('0x2e')](_0x47ddb4['query']);_0x5620c4[_0xd9f8('0x2f')]=_[_0xd9f8('0x30')](_0x5620c4[_0xd9f8('0x31')],_0x5620c4['query']);_0x12a3ef[_0xd9f8('0x32')]=_[_0xd9f8('0x30')](_0x5620c4[_0xd9f8('0x31')],qs[_0xd9f8('0x33')](_0x47ddb4[_0xd9f8('0x2d')][_0xd9f8('0x33')]));_0x12a3ef[_0xd9f8('0x32')]=_0x12a3ef[_0xd9f8('0x32')][_0xd9f8('0x34')]?_0x12a3ef[_0xd9f8('0x32')]:_0x5620c4[_0xd9f8('0x31')];if(_0x47ddb4[_0xd9f8('0x2d')][_0xd9f8('0x42')]){_0x12a3ef[_0xd9f8('0x49')]=[{'all':!![]}];}_0x12a3ef=_['merge']({},_0x12a3ef,_0x47ddb4[_0xd9f8('0x41')]);return db[_0xd9f8('0x43')][_0xd9f8('0x4a')](_0x12a3ef)['then'](handleEntityNotFound(_0x1fec16,null))[_0xd9f8('0x25')](respondWithResult(_0x1fec16,null))[_0xd9f8('0x46')](handleError(_0x1fec16,null));};exports[_0xd9f8('0x4b')]=function(_0x21528d,_0x45402d){return db[_0xd9f8('0x43')][_0xd9f8('0x4b')](_0x21528d[_0xd9f8('0x4c')],{})[_0xd9f8('0x25')](respondWithResult(_0x45402d,0xc9))[_0xd9f8('0x46')](handleError(_0x45402d,null));};exports[_0xd9f8('0x24')]=function(_0xc396e7,_0x1b739a){if(_0xc396e7[_0xd9f8('0x4c')]['id']){delete _0xc396e7[_0xd9f8('0x4c')]['id'];}return db[_0xd9f8('0x43')]['find']({'where':{'id':_0xc396e7[_0xd9f8('0x4d')]['id']}})[_0xd9f8('0x25')](handleEntityNotFound(_0x1b739a,null))['then'](saveUpdates(_0xc396e7['body'],null))['then'](respondWithResult(_0x1b739a,null))[_0xd9f8('0x46')](handleError(_0x1b739a,null));};exports['destroy']=function(_0x3e0906,_0x29dbdf){return db[_0xd9f8('0x43')][_0xd9f8('0x4a')]({'where':{'id':_0x3e0906[_0xd9f8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29dbdf,null))[_0xd9f8('0x25')](removeEntity(_0x29dbdf,null))[_0xd9f8('0x46')](handleError(_0x29dbdf,null));}; \ No newline at end of file +var _0x0bcc=['attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','AnalyticTreeReport','rawAttributes','query','keys','intersection','model'];(function(_0x148316,_0x6c9dc){var _0xdbe95d=function(_0x138a9f){while(--_0x138a9f){_0x148316['push'](_0x148316['shift']());}};_0xdbe95d(++_0x6c9dc);}(_0x0bcc,0x1bc));var _0xc0bc=function(_0x323084,_0x2de48d){_0x323084=_0x323084-0x0;var _0x5ef1c5=_0x0bcc[_0x323084];return _0x5ef1c5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0bc('0x0'));var jsonpatch=require(_0xc0bc('0x1'));var rp=require(_0xc0bc('0x2'));var moment=require('moment');var BPromise=require(_0xc0bc('0x3'));var Mustache=require(_0xc0bc('0x4'));var util=require(_0xc0bc('0x5'));var path=require('path');var sox=require(_0xc0bc('0x6'));var csv=require(_0xc0bc('0x7'));var ejs=require(_0xc0bc('0x8'));var fs=require('fs');var _=require(_0xc0bc('0x9'));var squel=require(_0xc0bc('0xa'));var crypto=require(_0xc0bc('0xb'));var jsforce=require(_0xc0bc('0xc'));var deskjs=require(_0xc0bc('0xd'));var toCsv=require(_0xc0bc('0x7'));var querystring=require('querystring');var Papa=require(_0xc0bc('0xe'));var authService=require(_0xc0bc('0xf'));var hardwareService=require(_0xc0bc('0x10'));var Redis=require(_0xc0bc('0x11'));var qs=require(_0xc0bc('0x12'));var logger=require(_0xc0bc('0x13'))('api');var utils=require(_0xc0bc('0x14'));var config=require('../../config/environment');var db=require(_0xc0bc('0x15'))['db'];function respondWithStatusCode(_0x2904f2,_0x2f9b70){_0x2f9b70=_0x2f9b70||0xcc;return function(_0x132618){if(_0x132618){return _0x2904f2['sendStatus'](_0x2f9b70);}return _0x2904f2['status'](_0x2f9b70)[_0xc0bc('0x16')]();};}function respondWithResult(_0x2dcb06,_0x4f3bd6){_0x4f3bd6=_0x4f3bd6||0xc8;return function(_0x38d3bb){if(_0x38d3bb){return _0x2dcb06['status'](_0x4f3bd6)['json'](_0x38d3bb);}};}function respondWithFilteredResult(_0x193130,_0x11b31e){return function(_0x4a207d){if(_0x4a207d){var _0x2f341d=_0x4a207d[_0xc0bc('0x17')],_0x3b3552=_0x11b31e[_0xc0bc('0x18')],_0x1d33c2=_0x11b31e[_0xc0bc('0x18')]+_0x11b31e[_0xc0bc('0x19')],_0x226442;if(_0x1d33c2>=_0x2f341d){_0x1d33c2=_0x2f341d;_0x226442=0xc8;}else{_0x226442=0xce;}_0x193130[_0xc0bc('0x1a')](_0x226442);return _0x193130['set'](_0xc0bc('0x1b'),_0x3b3552+'-'+_0x1d33c2+'/'+_0x2f341d)[_0xc0bc('0x1c')](_0x4a207d);}return null;};}function patchUpdates(_0xdcf243){return function(_0x2ab54b){try{jsonpatch[_0xc0bc('0x1d')](_0x2ab54b,_0xdcf243,!![]);}catch(_0xf48a2){return BPromise[_0xc0bc('0x1e')](_0xf48a2);}return _0x2ab54b[_0xc0bc('0x1f')]();};}function saveUpdates(_0x23deac,_0x466379){return function(_0x1c05c2){if(_0x1c05c2){return _0x1c05c2[_0xc0bc('0x20')](_0x23deac)[_0xc0bc('0x21')](function(_0x145497){return _0x145497;});}return null;};}function removeEntity(_0x1feb40,_0x6fc1c7){return function(_0x5729a8){if(_0x5729a8){return _0x5729a8[_0xc0bc('0x22')]()['then'](function(){_0x1feb40[_0xc0bc('0x1a')](0xcc)[_0xc0bc('0x16')]();});}};}function handleEntityNotFound(_0xcad103,_0x6ce189){return function(_0x1d2a43){if(!_0x1d2a43){_0xcad103[_0xc0bc('0x23')](0x194);}return _0x1d2a43;};}function handleError(_0x3989b5,_0x2ab7d3){_0x2ab7d3=_0x2ab7d3||0x1f4;return function(_0x5ec2e1){logger[_0xc0bc('0x24')](_0x5ec2e1[_0xc0bc('0x25')]);if(_0x5ec2e1[_0xc0bc('0x26')]){delete _0x5ec2e1[_0xc0bc('0x26')];}_0x3989b5[_0xc0bc('0x1a')](_0x2ab7d3)[_0xc0bc('0x27')](_0x5ec2e1);};}exports['index']=function(_0x1e5759,_0x25ae07){var _0xc28a91={},_0xe560b={},_0x28ba22={'count':0x0,'rows':[]};var _0x2fbe30=db[_0xc0bc('0x28')][_0xc0bc('0x29')];_0xe560b['model']=_['keys'](_0x2fbe30);_0xe560b[_0xc0bc('0x2a')]=_[_0xc0bc('0x2b')](_0x1e5759['query']);_0xe560b['filters']=_[_0xc0bc('0x2c')](_0xe560b[_0xc0bc('0x2d')],_0xe560b['query']);_0xc28a91[_0xc0bc('0x2e')]=_['intersection'](_0xe560b['model'],qs[_0xc0bc('0x2f')](_0x1e5759[_0xc0bc('0x2a')]['fields']));_0xc28a91[_0xc0bc('0x2e')]=_0xc28a91[_0xc0bc('0x2e')][_0xc0bc('0x30')]?_0xc28a91[_0xc0bc('0x2e')]:_0xe560b['model'];if(!_0x1e5759[_0xc0bc('0x2a')]['hasOwnProperty'](_0xc0bc('0x31'))){_0xc28a91['limit']=qs[_0xc0bc('0x19')](_0x1e5759[_0xc0bc('0x2a')][_0xc0bc('0x19')]);_0xc28a91[_0xc0bc('0x18')]=qs[_0xc0bc('0x18')](_0x1e5759[_0xc0bc('0x2a')][_0xc0bc('0x18')]);}_0xc28a91[_0xc0bc('0x32')]=qs[_0xc0bc('0x33')](_0x1e5759[_0xc0bc('0x2a')][_0xc0bc('0x33')]);_0xc28a91[_0xc0bc('0x34')]=qs[_0xc0bc('0x35')](_[_0xc0bc('0x36')](_0x1e5759[_0xc0bc('0x2a')],_0xe560b[_0xc0bc('0x35')]));if(_0x1e5759['query'][_0xc0bc('0x37')]){_0xc28a91[_0xc0bc('0x34')]=_['merge'](_0xc28a91[_0xc0bc('0x34')],{'$or':_['map'](_0x2fbe30,function(_0x463aec){if(_0x463aec['type'][_0xc0bc('0x38')]!==_0xc0bc('0x39')){var _0xc4fd11={};_0xc4fd11[_0x463aec[_0xc0bc('0x3a')]]={'$like':'%'+_0x1e5759[_0xc0bc('0x2a')][_0xc0bc('0x37')]+'%'};return _0xc4fd11;}})});}_0xc28a91=_[_0xc0bc('0x3b')]({},_0xc28a91,_0x1e5759['options']);var _0x2aae87={'where':_0xc28a91[_0xc0bc('0x34')]};return db[_0xc0bc('0x28')][_0xc0bc('0x17')](_0x2aae87)['then'](function(_0x206802){_0x28ba22[_0xc0bc('0x17')]=_0x206802;if(_0x1e5759[_0xc0bc('0x2a')][_0xc0bc('0x3c')]){_0xc28a91[_0xc0bc('0x3d')]=[{'all':!![]}];}return db[_0xc0bc('0x28')][_0xc0bc('0x3e')](_0xc28a91);})['then'](function(_0x16082d){_0x28ba22[_0xc0bc('0x3f')]=_0x16082d;return _0x28ba22;})[_0xc0bc('0x21')](respondWithFilteredResult(_0x25ae07,_0xc28a91))[_0xc0bc('0x40')](handleError(_0x25ae07,null));};exports['show']=function(_0x2d5bba,_0x4d7eb8){var _0x2487e5={'raw':!![],'where':{'id':_0x2d5bba['params']['id']}},_0x2bf2ae={};_0x2bf2ae[_0xc0bc('0x2d')]=_[_0xc0bc('0x2b')](db[_0xc0bc('0x28')][_0xc0bc('0x29')]);_0x2bf2ae['query']=_[_0xc0bc('0x2b')](_0x2d5bba['query']);_0x2bf2ae[_0xc0bc('0x35')]=_['intersection'](_0x2bf2ae[_0xc0bc('0x2d')],_0x2bf2ae[_0xc0bc('0x2a')]);_0x2487e5['attributes']=_[_0xc0bc('0x2c')](_0x2bf2ae['model'],qs[_0xc0bc('0x2f')](_0x2d5bba[_0xc0bc('0x2a')][_0xc0bc('0x2f')]));_0x2487e5['attributes']=_0x2487e5[_0xc0bc('0x2e')][_0xc0bc('0x30')]?_0x2487e5[_0xc0bc('0x2e')]:_0x2bf2ae[_0xc0bc('0x2d')];if(_0x2d5bba[_0xc0bc('0x2a')]['includeAll']){_0x2487e5['include']=[{'all':!![]}];}_0x2487e5=_[_0xc0bc('0x3b')]({},_0x2487e5,_0x2d5bba[_0xc0bc('0x41')]);return db['AnalyticTreeReport'][_0xc0bc('0x42')](_0x2487e5)['then'](handleEntityNotFound(_0x4d7eb8,null))[_0xc0bc('0x21')](respondWithResult(_0x4d7eb8,null))['catch'](handleError(_0x4d7eb8,null));};exports['create']=function(_0x4ddab2,_0x26d9f6){return db[_0xc0bc('0x28')][_0xc0bc('0x43')](_0x4ddab2[_0xc0bc('0x44')],{})['then'](respondWithResult(_0x26d9f6,0xc9))[_0xc0bc('0x40')](handleError(_0x26d9f6,null));};exports[_0xc0bc('0x20')]=function(_0x3f5775,_0x3c482a){if(_0x3f5775['body']['id']){delete _0x3f5775['body']['id'];}return db['AnalyticTreeReport'][_0xc0bc('0x42')]({'where':{'id':_0x3f5775[_0xc0bc('0x45')]['id']}})[_0xc0bc('0x21')](handleEntityNotFound(_0x3c482a,null))['then'](saveUpdates(_0x3f5775[_0xc0bc('0x44')],null))[_0xc0bc('0x21')](respondWithResult(_0x3c482a,null))['catch'](handleError(_0x3c482a,null));};exports[_0xc0bc('0x22')]=function(_0x41986d,_0x338fc6){return db[_0xc0bc('0x28')][_0xc0bc('0x42')]({'where':{'id':_0x41986d[_0xc0bc('0x45')]['id']}})[_0xc0bc('0x21')](handleEntityNotFound(_0x338fc6,null))['then'](removeEntity(_0x338fc6,null))[_0xc0bc('0x40')](handleError(_0x338fc6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d0f8edd..a4d9f87 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 _0x4827=['lodash','../../config/logger','api','moment','bluebird','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x891c46,_0x3039be){var _0x3536fd=function(_0x47722e){while(--_0x47722e){_0x891c46['push'](_0x891c46['shift']());}};_0x3536fd(++_0x3039be);}(_0x4827,0x1e6));var _0x7482=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4827[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7482('0x0'));var util=require('util');var logger=require(_0x7482('0x1'))(_0x7482('0x2'));var moment=require(_0x7482('0x3'));var BPromise=require(_0x7482('0x4'));var rp=require('request-promise');var attributes=require(_0x7482('0x5'));module[_0x7482('0x6')]=function(_0x2f133d,_0x3531cb){return _0x2f133d[_0x7482('0x7')](_0x7482('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe863=['exports','analytics_report_trees','../../config/logger','api','moment','bluebird'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0xe863,0x1f4));var _0x3e86=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xe863[_0x15b399];return _0x199f2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e86('0x0'))(_0x3e86('0x1'));var moment=require(_0x3e86('0x2'));var BPromise=require(_0x3e86('0x3'));var rp=require('request-promise');var attributes=require('./analyticTreeReport.attributes');module[_0x3e86('0x4')]=function(_0x3ffdba,_0x5d34a2){return _0x3ffdba['define']('AnalyticTreeReport',attributes,{'tableName':_0x3e86('0x5'),'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 758e848..38f076a 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 _0x83e1=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x281677,_0x2a8e0a){var _0x387bc8=function(_0x185d6d){while(--_0x185d6d){_0x281677['push'](_0x281677['shift']());}};_0x387bc8(++_0x2a8e0a);}(_0x83e1,0x1a5));var _0x183e=function(_0x502c9b,_0xdaf0b3){_0x502c9b=_0x502c9b-0x0;var _0x344c36=_0x83e1[_0x502c9b];return _0x344c36;};'use strict';var _=require(_0x183e('0x0'));var util=require(_0x183e('0x1'));var moment=require(_0x183e('0x2'));var BPromise=require(_0x183e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x183e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x183e('0x5'));var logger=require(_0x183e('0x6'))('rpc');var config=require(_0x183e('0x7'));var jayson=require(_0x183e('0x8'));var client=jayson['client'][_0x183e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4623fb,_0x18fcf3,_0x57907f){return new BPromise(function(_0x58657a,_0x1fc1f3){return client[_0x183e('0xa')](_0x4623fb,_0x57907f)[_0x183e('0xb')](function(_0x1506d0){logger[_0x183e('0xc')](_0x183e('0xd'),_0x18fcf3,_0x183e('0xe'));logger[_0x183e('0xf')](_0x183e('0x10'),_0x18fcf3,'request\x20sent',JSON['stringify'](_0x1506d0));if(_0x1506d0['error']){if(_0x1506d0[_0x183e('0x11')][_0x183e('0x12')]===0x1f4){logger['error'](_0x183e('0xd'),_0x18fcf3,_0x1506d0[_0x183e('0x11')][_0x183e('0x13')]);return _0x1fc1f3(_0x1506d0[_0x183e('0x11')][_0x183e('0x13')]);}logger['error'](_0x183e('0xd'),_0x18fcf3,_0x1506d0['error'][_0x183e('0x13')]);return _0x58657a(_0x1506d0[_0x183e('0x11')][_0x183e('0x13')]);}else{logger['info'](_0x183e('0xd'),_0x18fcf3,_0x183e('0xe'));_0x58657a(_0x1506d0[_0x183e('0x14')]['message']);}})['catch'](function(_0x545f5c){logger[_0x183e('0x11')](_0x183e('0xd'),_0x18fcf3,_0x545f5c);_0x1fc1f3(_0x545f5c);});});} \ No newline at end of file +var _0x244e=['error','code','message','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3db361,_0x34e8b3){var _0x4d9d29=function(_0x4a2bb8){while(--_0x4a2bb8){_0x3db361['push'](_0x3db361['shift']());}};_0x4d9d29(++_0x34e8b3);}(_0x244e,0xab));var _0xe244=function(_0x5da4e0,_0x4e560a){_0x5da4e0=_0x5da4e0-0x0;var _0x532670=_0x244e[_0x5da4e0];return _0x532670;};'use strict';var _=require(_0xe244('0x0'));var util=require(_0xe244('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe244('0x2'))['db'];var utils=require(_0xe244('0x3'));var logger=require(_0xe244('0x4'))(_0xe244('0x5'));var config=require(_0xe244('0x6'));var jayson=require(_0xe244('0x7'));var client=jayson[_0xe244('0x8')][_0xe244('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x200095,_0x5d3f52,_0x357bc7){return new BPromise(function(_0xb16200,_0x485e21){return client[_0xe244('0xa')](_0x200095,_0x357bc7)[_0xe244('0xb')](function(_0x29747d){logger[_0xe244('0xc')](_0xe244('0xd'),_0x5d3f52,'request\x20sent');logger[_0xe244('0xe')](_0xe244('0xf'),_0x5d3f52,_0xe244('0x10'),JSON[_0xe244('0x11')](_0x29747d));if(_0x29747d[_0xe244('0x12')]){if(_0x29747d[_0xe244('0x12')][_0xe244('0x13')]===0x1f4){logger['error'](_0xe244('0xd'),_0x5d3f52,_0x29747d[_0xe244('0x12')][_0xe244('0x14')]);return _0x485e21(_0x29747d[_0xe244('0x12')][_0xe244('0x14')]);}logger[_0xe244('0x12')](_0xe244('0xd'),_0x5d3f52,_0x29747d['error'][_0xe244('0x14')]);return _0xb16200(_0x29747d[_0xe244('0x12')]['message']);}else{logger[_0xe244('0xc')](_0xe244('0xd'),_0x5d3f52,_0xe244('0x10'));_0xb16200(_0x29747d['result'][_0xe244('0x14')]);}})['catch'](function(_0x2cf6f1){logger[_0xe244('0x12')](_0xe244('0xd'),_0x5d3f52,_0x2cf6f1);_0x485e21(_0x2cf6f1);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 35fe6e3..6c7ef79 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 _0x5d73=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5d73,0xbb));var _0x35d7=function(_0x560616,_0x536b23){_0x560616=_0x560616-0x0;var _0x5dc292=_0x5d73[_0x560616];return _0x5dc292;};'use strict';var multer=require('multer');var util=require(_0x35d7('0x0'));var path=require(_0x35d7('0x1'));var timeout=require(_0x35d7('0x2'));var express=require(_0x35d7('0x3'));var router=express[_0x35d7('0x4')]();var auth=require(_0x35d7('0x5'));var interaction=require(_0x35d7('0x6'));var config=require(_0x35d7('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x35d7('0x8')]('/',auth[_0x35d7('0x9')](),controller['index']);router[_0x35d7('0x8')](_0x35d7('0xa'),auth['isAuthenticated'](),controller[_0x35d7('0xb')]);router['post']('/',auth[_0x35d7('0x9')](),controller['create']);router['put'](_0x35d7('0xa'),auth['isAuthenticated'](),controller[_0x35d7('0xc')]);router[_0x35d7('0xd')](_0x35d7('0xa'),auth[_0x35d7('0x9')](),controller[_0x35d7('0xe')]);module[_0x35d7('0xf')]=router; \ No newline at end of file +var _0x0a3f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0x0a3f,0xd0));var _0xf0a3=function(_0x3efff7,_0x1364a4){_0x3efff7=_0x3efff7-0x0;var _0x46ca81=_0x0a3f[_0x3efff7];return _0x46ca81;};'use strict';var multer=require(_0xf0a3('0x0'));var util=require(_0xf0a3('0x1'));var path=require(_0xf0a3('0x2'));var timeout=require(_0xf0a3('0x3'));var express=require(_0xf0a3('0x4'));var router=express[_0xf0a3('0x5')]();var auth=require(_0xf0a3('0x6'));var interaction=require(_0xf0a3('0x7'));var config=require(_0xf0a3('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xf0a3('0x9')](),controller['index']);router[_0xf0a3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf0a3('0xb')]);router[_0xf0a3('0xc')]('/',auth[_0xf0a3('0x9')](),controller['create']);router[_0xf0a3('0xd')](_0xf0a3('0xe'),auth[_0xf0a3('0x9')](),controller[_0xf0a3('0xf')]);router[_0xf0a3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf0a3('0x11')]);module[_0xf0a3('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 9521f19..336256e 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 _0x8f42=['STRING','exports'];(function(_0x2cdd4d,_0x394c2f){var _0x55cbc8=function(_0x3b92cb){while(--_0x3b92cb){_0x2cdd4d['push'](_0x2cdd4d['shift']());}};_0x55cbc8(++_0x394c2f);}(_0x8f42,0x73));var _0x28f4=function(_0x458fe9,_0x264c73){_0x458fe9=_0x458fe9-0x0;var _0x475253=_0x8f42[_0x458fe9];return _0x475253;};'use strict';var Sequelize=require('sequelize');module[_0x28f4('0x0')]={'name':{'type':Sequelize[_0x28f4('0x1')]},'basename':{'type':Sequelize[_0x28f4('0x1')]},'type':{'type':Sequelize[_0x28f4('0x1')]}}; \ No newline at end of file +var _0xc14a=['exports','sequelize'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0xc14a,0xe5));var _0xac14=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc14a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xac14('0x0'));module[_0xac14('0x1')]={'name':{'type':Sequelize['STRING']},'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 fd531c3..9b52416 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 _0xe11c=['sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','file','originalname','basename','filename','create','download','findOne','join','server/files/attachments/','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','reject','update','destroy','then','end','error','name','send','index','Attachment','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe11c,0x113));var _0xce11=function(_0x63408d,_0x13c862){_0x63408d=_0x63408d-0x0;var _0x14cc58=_0xe11c[_0x63408d];return _0x14cc58;};'use strict';var pdf=require(_0xce11('0x0'));var emlformat=require(_0xce11('0x1'));var rimraf=require(_0xce11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce11('0x3'));var rp=require(_0xce11('0x4'));var moment=require(_0xce11('0x5'));var BPromise=require(_0xce11('0x6'));var Mustache=require('mustache');var util=require(_0xce11('0x7'));var path=require(_0xce11('0x8'));var sox=require(_0xce11('0x9'));var csv=require('to-csv');var ejs=require(_0xce11('0xa'));var fs=require('fs');var _=require(_0xce11('0xb'));var squel=require(_0xce11('0xc'));var crypto=require(_0xce11('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xce11('0xe'));var toCsv=require(_0xce11('0xf'));var querystring=require(_0xce11('0x10'));var Papa=require(_0xce11('0x11'));var authService=require(_0xce11('0x12'));var hardwareService=require(_0xce11('0x13'));var Redis=require(_0xce11('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xce11('0x15'))('api');var utils=require(_0xce11('0x16'));var config=require(_0xce11('0x17'));var db=require(_0xce11('0x18'))['db'];function respondWithStatusCode(_0xe1fda8,_0x4883fa){_0x4883fa=_0x4883fa||0xcc;return function(_0x5070aa){if(_0x5070aa){return _0xe1fda8[_0xce11('0x19')](_0x4883fa);}return _0xe1fda8['status'](_0x4883fa)['end']();};}function respondWithResult(_0x31669b,_0x28642d){_0x28642d=_0x28642d||0xc8;return function(_0x496bfc){if(_0x496bfc){return _0x31669b[_0xce11('0x1a')](_0x28642d)[_0xce11('0x1b')](_0x496bfc);}};}function respondWithFilteredResult(_0x52de3f,_0x2d4c08){return function(_0x9fff13){if(_0x9fff13){var _0x20e30a=_0x9fff13[_0xce11('0x1c')],_0x26132c=_0x2d4c08['offset'],_0x387f25=_0x2d4c08[_0xce11('0x1d')]+_0x2d4c08['limit'],_0x2d697d;if(_0x387f25>=_0x20e30a){_0x387f25=_0x20e30a;_0x2d697d=0xc8;}else{_0x2d697d=0xce;}_0x52de3f[_0xce11('0x1a')](_0x2d697d);return _0x52de3f[_0xce11('0x1e')]('Content-Range',_0x26132c+'-'+_0x387f25+'/'+_0x20e30a)['json'](_0x9fff13);}return null;};}function patchUpdates(_0x49ce6a){return function(_0xd239c6){try{jsonpatch['apply'](_0xd239c6,_0x49ce6a,!![]);}catch(_0x193f81){return BPromise[_0xce11('0x1f')](_0x193f81);}return _0xd239c6['save']();};}function saveUpdates(_0x484202,_0x334e7c){return function(_0x3910cd){if(_0x3910cd){return _0x3910cd[_0xce11('0x20')](_0x484202)['then'](function(_0x2c3f68){return _0x2c3f68;});}return null;};}function removeEntity(_0x1d14c4,_0x3baf11){return function(_0x2496ea){if(_0x2496ea){return _0x2496ea[_0xce11('0x21')]()[_0xce11('0x22')](function(){_0x1d14c4['status'](0xcc)[_0xce11('0x23')]();});}};}function handleEntityNotFound(_0x3fadd9,_0x3d6e60){return function(_0x1e7df4){if(!_0x1e7df4){_0x3fadd9[_0xce11('0x19')](0x194);}return _0x1e7df4;};}function handleError(_0x4f2cd0,_0x2b345a){_0x2b345a=_0x2b345a||0x1f4;return function(_0x193354){logger[_0xce11('0x24')](_0x193354['stack']);if(_0x193354[_0xce11('0x25')]){delete _0x193354[_0xce11('0x25')];}_0x4f2cd0['status'](_0x2b345a)[_0xce11('0x26')](_0x193354);};}exports[_0xce11('0x27')]=function(_0x5b951d,_0x284a9e){var _0x4cdbcd={},_0x343953={},_0xd35aa8={'count':0x0,'rows':[]};var _0x5e1ef5=db[_0xce11('0x28')]['rawAttributes'];_0x343953[_0xce11('0x29')]=_[_0xce11('0x2a')](_0x5e1ef5);_0x343953[_0xce11('0x2b')]=_[_0xce11('0x2a')](_0x5b951d['query']);_0x343953[_0xce11('0x2c')]=_[_0xce11('0x2d')](_0x343953['model'],_0x343953[_0xce11('0x2b')]);_0x4cdbcd[_0xce11('0x2e')]=_[_0xce11('0x2d')](_0x343953[_0xce11('0x29')],qs[_0xce11('0x2f')](_0x5b951d['query']['fields']));_0x4cdbcd[_0xce11('0x2e')]=_0x4cdbcd['attributes'][_0xce11('0x30')]?_0x4cdbcd[_0xce11('0x2e')]:_0x343953[_0xce11('0x29')];if(!_0x5b951d[_0xce11('0x2b')][_0xce11('0x31')](_0xce11('0x32'))){_0x4cdbcd['limit']=qs[_0xce11('0x33')](_0x5b951d['query'][_0xce11('0x33')]);_0x4cdbcd['offset']=qs[_0xce11('0x1d')](_0x5b951d['query'][_0xce11('0x1d')]);}_0x4cdbcd[_0xce11('0x34')]=qs[_0xce11('0x35')](_0x5b951d[_0xce11('0x2b')][_0xce11('0x35')]);_0x4cdbcd[_0xce11('0x36')]=qs[_0xce11('0x2c')](_[_0xce11('0x37')](_0x5b951d[_0xce11('0x2b')],_0x343953['filters']));if(_0x5b951d[_0xce11('0x2b')][_0xce11('0x38')]){_0x4cdbcd[_0xce11('0x36')]=_[_0xce11('0x39')](_0x4cdbcd[_0xce11('0x36')],{'$or':_['map'](_0x5e1ef5,function(_0x2b15e1){if(_0x2b15e1[_0xce11('0x3a')][_0xce11('0x3b')]!==_0xce11('0x3c')){var _0x216a01={};_0x216a01[_0x2b15e1[_0xce11('0x3d')]]={'$like':'%'+_0x5b951d[_0xce11('0x2b')]['filter']+'%'};return _0x216a01;}})});}_0x4cdbcd=_['merge']({},_0x4cdbcd,_0x5b951d[_0xce11('0x3e')]);var _0x4c2daa={'where':_0x4cdbcd[_0xce11('0x36')]};return db[_0xce11('0x28')]['count'](_0x4c2daa)[_0xce11('0x22')](function(_0x21eceb){_0xd35aa8[_0xce11('0x1c')]=_0x21eceb;if(_0x5b951d[_0xce11('0x2b')]['includeAll']){_0x4cdbcd[_0xce11('0x3f')]=[{'all':!![]}];}return db[_0xce11('0x28')][_0xce11('0x40')](_0x4cdbcd);})[_0xce11('0x22')](function(_0x3ab760){_0xd35aa8[_0xce11('0x41')]=_0x3ab760;return _0xd35aa8;})[_0xce11('0x22')](respondWithFilteredResult(_0x284a9e,_0x4cdbcd))[_0xce11('0x42')](handleError(_0x284a9e,null));};exports[_0xce11('0x43')]=function(_0x4090da,_0x43e6b1){var _0x3ea19f={'raw':!![],'where':{'id':_0x4090da[_0xce11('0x44')]['id']}},_0x50fe19={};_0x50fe19[_0xce11('0x29')]=_[_0xce11('0x2a')](db['Attachment'][_0xce11('0x45')]);_0x50fe19[_0xce11('0x2b')]=_[_0xce11('0x2a')](_0x4090da[_0xce11('0x2b')]);_0x50fe19[_0xce11('0x2c')]=_['intersection'](_0x50fe19[_0xce11('0x29')],_0x50fe19[_0xce11('0x2b')]);_0x3ea19f[_0xce11('0x2e')]=_[_0xce11('0x2d')](_0x50fe19[_0xce11('0x29')],qs[_0xce11('0x2f')](_0x4090da[_0xce11('0x2b')][_0xce11('0x2f')]));_0x3ea19f['attributes']=_0x3ea19f[_0xce11('0x2e')][_0xce11('0x30')]?_0x3ea19f[_0xce11('0x2e')]:_0x50fe19['model'];if(_0x4090da[_0xce11('0x2b')][_0xce11('0x46')]){_0x3ea19f['include']=[{'all':!![]}];}_0x3ea19f=_['merge']({},_0x3ea19f,_0x4090da[_0xce11('0x3e')]);return db[_0xce11('0x28')][_0xce11('0x47')](_0x3ea19f)['then'](handleEntityNotFound(_0x43e6b1,null))[_0xce11('0x22')](respondWithResult(_0x43e6b1,null))[_0xce11('0x42')](handleError(_0x43e6b1,null));};exports['update']=function(_0xa4a61d,_0x4019c9){if(_0xa4a61d['body']['id']){delete _0xa4a61d['body']['id'];}return db[_0xce11('0x28')][_0xce11('0x47')]({'where':{'id':_0xa4a61d['params']['id']}})['then'](handleEntityNotFound(_0x4019c9,null))[_0xce11('0x22')](saveUpdates(_0xa4a61d[_0xce11('0x48')],null))[_0xce11('0x22')](respondWithResult(_0x4019c9,null))['catch'](handleError(_0x4019c9,null));};exports['destroy']=function(_0x51c733,_0x5be842){return db[_0xce11('0x28')]['find']({'where':{'id':_0x51c733['params']['id']}})[_0xce11('0x22')](handleEntityNotFound(_0x5be842,null))['then'](removeEntity(_0x5be842,null))[_0xce11('0x42')](handleError(_0x5be842,null));};exports['create']=function(_0x1d8735,_0x287552,_0xafdfed){_0x1d8735[_0xce11('0x48')][_0xce11('0x25')]=_0x1d8735[_0xce11('0x49')][_0xce11('0x4a')];_0x1d8735[_0xce11('0x48')][_0xce11('0x4b')]=_0x1d8735['file'][_0xce11('0x4c')];_0x1d8735[_0xce11('0x48')]['type']=_0x1d8735[_0xce11('0x49')]['mimetype'];return db[_0xce11('0x28')][_0xce11('0x4d')](_0x1d8735[_0xce11('0x48')])['then'](respondWithResult(_0x287552,0xc9))['catch'](handleError(_0x287552,null));};exports[_0xce11('0x4e')]=function(_0x3213d6,_0x473a47,_0x553344){return db[_0xce11('0x28')][_0xce11('0x4f')]({'where':{'id':_0x3213d6[_0xce11('0x44')]['id']},'raw':!![]})[_0xce11('0x22')](handleEntityNotFound(_0x473a47,null))[_0xce11('0x22')](function(_0x564dc2){if(_0x564dc2){return _0x473a47[_0xce11('0x4e')](path[_0xce11('0x50')](config['root'],_0xce11('0x51'),_0x564dc2[_0xce11('0x4b')]));}})['catch'](handleError(_0x473a47,null));}; \ No newline at end of file +var _0xd207=['update','then','destroy','end','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','limit','order','sort','filters','pick','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','include','find','body','params','create','file','basename','download','findOne','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x558577,_0x5161c1){var _0x20051c=function(_0x4e0aa4){while(--_0x4e0aa4){_0x558577['push'](_0x558577['shift']());}};_0x20051c(++_0x5161c1);}(_0xd207,0x11b));var _0x7d20=function(_0xae61,_0x4f9fea){_0xae61=_0xae61-0x0;var _0x3cc820=_0xd207[_0xae61];return _0x3cc820;};'use strict';var pdf=require(_0x7d20('0x0'));var emlformat=require(_0x7d20('0x1'));var rimraf=require(_0x7d20('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d20('0x3'));var moment=require(_0x7d20('0x4'));var BPromise=require(_0x7d20('0x5'));var Mustache=require(_0x7d20('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7d20('0x7'));var csv=require(_0x7d20('0x8'));var ejs=require(_0x7d20('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7d20('0xa'));var crypto=require('crypto');var jsforce=require(_0x7d20('0xb'));var deskjs=require(_0x7d20('0xc'));var toCsv=require(_0x7d20('0x8'));var querystring=require(_0x7d20('0xd'));var Papa=require(_0x7d20('0xe'));var authService=require(_0x7d20('0xf'));var hardwareService=require(_0x7d20('0x10'));var Redis=require('ioredis');var qs=require(_0x7d20('0x11'));var logger=require(_0x7d20('0x12'))(_0x7d20('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7d20('0x14'))['db'];function respondWithStatusCode(_0x5f4abd,_0x5e1241){_0x5e1241=_0x5e1241||0xcc;return function(_0x17ea67){if(_0x17ea67){return _0x5f4abd['sendStatus'](_0x5e1241);}return _0x5f4abd[_0x7d20('0x15')](_0x5e1241)['end']();};}function respondWithResult(_0x195181,_0x4fef2e){_0x4fef2e=_0x4fef2e||0xc8;return function(_0x200637){if(_0x200637){return _0x195181[_0x7d20('0x15')](_0x4fef2e)[_0x7d20('0x16')](_0x200637);}};}function respondWithFilteredResult(_0x147aa0,_0x12cabf){return function(_0x5ed361){if(_0x5ed361){var _0x1780bd=_0x5ed361[_0x7d20('0x17')],_0x57e925=_0x12cabf[_0x7d20('0x18')],_0x45a9a9=_0x12cabf[_0x7d20('0x18')]+_0x12cabf['limit'],_0x3f8820;if(_0x45a9a9>=_0x1780bd){_0x45a9a9=_0x1780bd;_0x3f8820=0xc8;}else{_0x3f8820=0xce;}_0x147aa0[_0x7d20('0x15')](_0x3f8820);return _0x147aa0[_0x7d20('0x19')](_0x7d20('0x1a'),_0x57e925+'-'+_0x45a9a9+'/'+_0x1780bd)[_0x7d20('0x16')](_0x5ed361);}return null;};}function patchUpdates(_0xae6518){return function(_0x2708a3){try{jsonpatch[_0x7d20('0x1b')](_0x2708a3,_0xae6518,!![]);}catch(_0x511683){return BPromise[_0x7d20('0x1c')](_0x511683);}return _0x2708a3['save']();};}function saveUpdates(_0xf1e605,_0x4bd250){return function(_0x2ec328){if(_0x2ec328){return _0x2ec328[_0x7d20('0x1d')](_0xf1e605)[_0x7d20('0x1e')](function(_0x51d0cd){return _0x51d0cd;});}return null;};}function removeEntity(_0x393883,_0x516e3e){return function(_0xc903b8){if(_0xc903b8){return _0xc903b8[_0x7d20('0x1f')]()[_0x7d20('0x1e')](function(){_0x393883[_0x7d20('0x15')](0xcc)[_0x7d20('0x20')]();});}};}function handleEntityNotFound(_0x17e834,_0x421918){return function(_0x2a3398){if(!_0x2a3398){_0x17e834[_0x7d20('0x21')](0x194);}return _0x2a3398;};}function handleError(_0x3fc3f1,_0x1e138a){_0x1e138a=_0x1e138a||0x1f4;return function(_0x112596){logger[_0x7d20('0x22')](_0x112596[_0x7d20('0x23')]);if(_0x112596[_0x7d20('0x24')]){delete _0x112596[_0x7d20('0x24')];}_0x3fc3f1[_0x7d20('0x15')](_0x1e138a)[_0x7d20('0x25')](_0x112596);};}exports[_0x7d20('0x26')]=function(_0x5f5bf3,_0x2db6c7){var _0x10b99b={},_0x1b24d1={},_0x2faf27={'count':0x0,'rows':[]};var _0x1e598f=db[_0x7d20('0x27')][_0x7d20('0x28')];_0x1b24d1[_0x7d20('0x29')]=_[_0x7d20('0x2a')](_0x1e598f);_0x1b24d1[_0x7d20('0x2b')]=_[_0x7d20('0x2a')](_0x5f5bf3[_0x7d20('0x2b')]);_0x1b24d1['filters']=_['intersection'](_0x1b24d1[_0x7d20('0x29')],_0x1b24d1[_0x7d20('0x2b')]);_0x10b99b[_0x7d20('0x2c')]=_[_0x7d20('0x2d')](_0x1b24d1[_0x7d20('0x29')],qs[_0x7d20('0x2e')](_0x5f5bf3[_0x7d20('0x2b')][_0x7d20('0x2e')]));_0x10b99b[_0x7d20('0x2c')]=_0x10b99b['attributes'][_0x7d20('0x2f')]?_0x10b99b[_0x7d20('0x2c')]:_0x1b24d1[_0x7d20('0x29')];if(!_0x5f5bf3['query']['hasOwnProperty'](_0x7d20('0x30'))){_0x10b99b['limit']=qs[_0x7d20('0x31')](_0x5f5bf3[_0x7d20('0x2b')][_0x7d20('0x31')]);_0x10b99b[_0x7d20('0x18')]=qs[_0x7d20('0x18')](_0x5f5bf3['query'][_0x7d20('0x18')]);}_0x10b99b[_0x7d20('0x32')]=qs[_0x7d20('0x33')](_0x5f5bf3[_0x7d20('0x2b')][_0x7d20('0x33')]);_0x10b99b['where']=qs[_0x7d20('0x34')](_[_0x7d20('0x35')](_0x5f5bf3[_0x7d20('0x2b')],_0x1b24d1[_0x7d20('0x34')]));if(_0x5f5bf3[_0x7d20('0x2b')]['filter']){_0x10b99b[_0x7d20('0x36')]=_[_0x7d20('0x37')](_0x10b99b[_0x7d20('0x36')],{'$or':_[_0x7d20('0x38')](_0x1e598f,function(_0x5e1a2b){if(_0x5e1a2b[_0x7d20('0x39')]['key']!==_0x7d20('0x3a')){var _0x2fd70f={};_0x2fd70f[_0x5e1a2b[_0x7d20('0x3b')]]={'$like':'%'+_0x5f5bf3[_0x7d20('0x2b')][_0x7d20('0x3c')]+'%'};return _0x2fd70f;}})});}_0x10b99b=_['merge']({},_0x10b99b,_0x5f5bf3[_0x7d20('0x3d')]);var _0x46c62c={'where':_0x10b99b[_0x7d20('0x36')]};return db[_0x7d20('0x27')][_0x7d20('0x17')](_0x46c62c)[_0x7d20('0x1e')](function(_0x57c926){_0x2faf27[_0x7d20('0x17')]=_0x57c926;if(_0x5f5bf3[_0x7d20('0x2b')][_0x7d20('0x3e')]){_0x10b99b['include']=[{'all':!![]}];}return db[_0x7d20('0x27')][_0x7d20('0x3f')](_0x10b99b);})[_0x7d20('0x1e')](function(_0x57dd0a){_0x2faf27[_0x7d20('0x40')]=_0x57dd0a;return _0x2faf27;})['then'](respondWithFilteredResult(_0x2db6c7,_0x10b99b))[_0x7d20('0x41')](handleError(_0x2db6c7,null));};exports['show']=function(_0x3a3ccf,_0x339ff1){var _0x77ec15={'raw':!![],'where':{'id':_0x3a3ccf['params']['id']}},_0x3a0192={};_0x3a0192['model']=_[_0x7d20('0x2a')](db['Attachment']['rawAttributes']);_0x3a0192[_0x7d20('0x2b')]=_['keys'](_0x3a3ccf[_0x7d20('0x2b')]);_0x3a0192[_0x7d20('0x34')]=_[_0x7d20('0x2d')](_0x3a0192['model'],_0x3a0192[_0x7d20('0x2b')]);_0x77ec15[_0x7d20('0x2c')]=_[_0x7d20('0x2d')](_0x3a0192[_0x7d20('0x29')],qs[_0x7d20('0x2e')](_0x3a3ccf['query'][_0x7d20('0x2e')]));_0x77ec15['attributes']=_0x77ec15[_0x7d20('0x2c')][_0x7d20('0x2f')]?_0x77ec15[_0x7d20('0x2c')]:_0x3a0192['model'];if(_0x3a3ccf[_0x7d20('0x2b')][_0x7d20('0x3e')]){_0x77ec15[_0x7d20('0x42')]=[{'all':!![]}];}_0x77ec15=_[_0x7d20('0x37')]({},_0x77ec15,_0x3a3ccf['options']);return db[_0x7d20('0x27')][_0x7d20('0x43')](_0x77ec15)['then'](handleEntityNotFound(_0x339ff1,null))[_0x7d20('0x1e')](respondWithResult(_0x339ff1,null))['catch'](handleError(_0x339ff1,null));};exports[_0x7d20('0x1d')]=function(_0x466b10,_0xae37a3){if(_0x466b10[_0x7d20('0x44')]['id']){delete _0x466b10['body']['id'];}return db[_0x7d20('0x27')]['find']({'where':{'id':_0x466b10[_0x7d20('0x45')]['id']}})[_0x7d20('0x1e')](handleEntityNotFound(_0xae37a3,null))[_0x7d20('0x1e')](saveUpdates(_0x466b10['body'],null))[_0x7d20('0x1e')](respondWithResult(_0xae37a3,null))[_0x7d20('0x41')](handleError(_0xae37a3,null));};exports[_0x7d20('0x1f')]=function(_0x444cfe,_0x4aa8f5){return db[_0x7d20('0x27')][_0x7d20('0x43')]({'where':{'id':_0x444cfe[_0x7d20('0x45')]['id']}})['then'](handleEntityNotFound(_0x4aa8f5,null))['then'](removeEntity(_0x4aa8f5,null))[_0x7d20('0x41')](handleError(_0x4aa8f5,null));};exports[_0x7d20('0x46')]=function(_0x3fcc26,_0x243b7e,_0x4fd77f){_0x3fcc26['body'][_0x7d20('0x24')]=_0x3fcc26[_0x7d20('0x47')]['originalname'];_0x3fcc26[_0x7d20('0x44')][_0x7d20('0x48')]=_0x3fcc26['file']['filename'];_0x3fcc26['body'][_0x7d20('0x39')]=_0x3fcc26['file']['mimetype'];return db[_0x7d20('0x27')]['create'](_0x3fcc26[_0x7d20('0x44')])[_0x7d20('0x1e')](respondWithResult(_0x243b7e,0xc9))['catch'](handleError(_0x243b7e,null));};exports[_0x7d20('0x49')]=function(_0x4ec95e,_0x35ad5f,_0x28918e){return db['Attachment'][_0x7d20('0x4a')]({'where':{'id':_0x4ec95e[_0x7d20('0x45')]['id']},'raw':!![]})[_0x7d20('0x1e')](handleEntityNotFound(_0x35ad5f,null))[_0x7d20('0x1e')](function(_0x41a29d){if(_0x41a29d){return _0x35ad5f['download'](path[_0x7d20('0x4b')](config[_0x7d20('0x4c')],_0x7d20('0x4d'),_0x41a29d['basename']));}})['catch'](handleError(_0x35ad5f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1d4328e..cabbb3e 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 _0xabce=['./attachment.attributes','exports','Attachment','lodash','util','../../config/logger','api','moment'];(function(_0x570a71,_0x57441f){var _0x157860=function(_0x585663){while(--_0x585663){_0x570a71['push'](_0x570a71['shift']());}};_0x157860(++_0x57441f);}(_0xabce,0x103));var _0xeabc=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xabce[_0x220dbb];return _0x2b77de;};'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 attributes=require(_0xeabc('0x5'));module[_0xeabc('0x6')]=function(_0x1a88a7,_0x5e9e2d){return _0x1a88a7['define'](_0xeabc('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','./attachment.attributes','exports'];(function(_0x45f5e8,_0x3256d1){var _0x38ff1e=function(_0x4f1de1){while(--_0x4f1de1){_0x45f5e8['push'](_0x45f5e8['shift']());}};_0x38ff1e(++_0x3256d1);}(_0xf494,0x1c6));var _0x4f49=function(_0x2ebf41,_0xc6f080){_0x2ebf41=_0x2ebf41-0x0;var _0x558232=_0xf494[_0x2ebf41];return _0x558232;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var attributes=require(_0x4f49('0x6'));module[_0x4f49('0x7')]=function(_0x2a15fb,_0x3267c1){return _0x2a15fb[_0x4f49('0x8')](_0x4f49('0x9'),attributes,{'tableName':_0x4f49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index b0c5a10..91394a2 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 _0xf076=['rpc','../../config/environment','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','options','raw','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x161381,_0xd4e4d6){var _0x6b5803=function(_0x253455){while(--_0x253455){_0x161381['push'](_0x161381['shift']());}};_0x6b5803(++_0xd4e4d6);}(_0xf076,0x13e));var _0x6f07=function(_0x102d75,_0x3e189a){_0x102d75=_0x102d75-0x0;var _0x371e08=_0xf076[_0x102d75];return _0x371e08;};'use strict';var _=require(_0x6f07('0x0'));var util=require('util');var moment=require(_0x6f07('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f07('0x2'));var fs=require('fs');var Redis=require(_0x6f07('0x3'));var db=require(_0x6f07('0x4'))['db'];var utils=require(_0x6f07('0x5'));var logger=require(_0x6f07('0x6'))(_0x6f07('0x7'));var config=require(_0x6f07('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ccfcc,_0x7b6e8e,_0x173735){return new BPromise(function(_0x32c579,_0x539ef8){return client[_0x6f07('0xa')](_0x4ccfcc,_0x173735)[_0x6f07('0xb')](function(_0x578ce5){logger['info'](_0x6f07('0xc'),_0x7b6e8e,'request\x20sent');logger[_0x6f07('0xd')](_0x6f07('0xe'),_0x7b6e8e,_0x6f07('0xf'),JSON[_0x6f07('0x10')](_0x578ce5));if(_0x578ce5[_0x6f07('0x11')]){if(_0x578ce5[_0x6f07('0x11')][_0x6f07('0x12')]===0x1f4){logger[_0x6f07('0x11')]('Attachment,\x20%s,\x20%s',_0x7b6e8e,_0x578ce5[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x539ef8(_0x578ce5[_0x6f07('0x11')][_0x6f07('0x13')]);}logger[_0x6f07('0x11')](_0x6f07('0xc'),_0x7b6e8e,_0x578ce5['error'][_0x6f07('0x13')]);return _0x32c579(_0x578ce5[_0x6f07('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x7b6e8e,'request\x20sent');_0x32c579(_0x578ce5['result']['message']);}})[_0x6f07('0x14')](function(_0x613a1e){logger['error'](_0x6f07('0xc'),_0x7b6e8e,_0x613a1e);_0x539ef8(_0x613a1e);});});}exports[_0x6f07('0x15')]=function(_0x5aeabc){var _0x19e67b=this;return new Promise(function(_0xc206ae,_0xadabf){return db['Attachment']['create'](_0x5aeabc['body'],{'raw':_0x5aeabc[_0x6f07('0x16')]?_0x5aeabc[_0x6f07('0x16')][_0x6f07('0x17')]===undefined?!![]:![]:!![]})[_0x6f07('0xb')](function(_0x3b1e8f){logger[_0x6f07('0x18')](_0x6f07('0x15'),_0x5aeabc);logger['debug'](_0x6f07('0x15'),_0x5aeabc,JSON[_0x6f07('0x10')](_0x3b1e8f));_0xc206ae(_0x3b1e8f);})[_0x6f07('0x14')](function(_0x472dc4){logger[_0x6f07('0x11')](_0x6f07('0x15'),_0x472dc4[_0x6f07('0x13')],_0x5aeabc);_0xadabf(_0x19e67b[_0x6f07('0x11')](0x1f4,_0x472dc4[_0x6f07('0x13')]));});});}; \ No newline at end of file +var _0x697e=['debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','Attachment','create','body','raw','CreateAttachment','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent'];(function(_0x336b09,_0x5ebbb6){var _0x585fce=function(_0x1df6d5){while(--_0x1df6d5){_0x336b09['push'](_0x336b09['shift']());}};_0x585fce(++_0x5ebbb6);}(_0x697e,0x111));var _0xe697=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x697e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe697('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe697('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe697('0x2'));var db=require(_0xe697('0x3'))['db'];var utils=require(_0xe697('0x4'));var logger=require(_0xe697('0x5'))(_0xe697('0x6'));var config=require(_0xe697('0x7'));var jayson=require(_0xe697('0x8'));var client=jayson['client'][_0xe697('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43a59e,_0x30f77f,_0x55423f){return new BPromise(function(_0x462347,_0x2e6024){return client[_0xe697('0xa')](_0x43a59e,_0x55423f)['then'](function(_0x12c89c){logger[_0xe697('0xb')]('Attachment,\x20%s,\x20%s',_0x30f77f,_0xe697('0xc'));logger[_0xe697('0xd')](_0xe697('0xe'),_0x30f77f,_0xe697('0xc'),JSON[_0xe697('0xf')](_0x12c89c));if(_0x12c89c[_0xe697('0x10')]){if(_0x12c89c[_0xe697('0x10')][_0xe697('0x11')]===0x1f4){logger['error'](_0xe697('0x12'),_0x30f77f,_0x12c89c['error'][_0xe697('0x13')]);return _0x2e6024(_0x12c89c['error'][_0xe697('0x13')]);}logger[_0xe697('0x10')](_0xe697('0x12'),_0x30f77f,_0x12c89c[_0xe697('0x10')][_0xe697('0x13')]);return _0x462347(_0x12c89c['error'][_0xe697('0x13')]);}else{logger[_0xe697('0xb')](_0xe697('0x12'),_0x30f77f,_0xe697('0xc'));_0x462347(_0x12c89c['result'][_0xe697('0x13')]);}})['catch'](function(_0x23329a){logger[_0xe697('0x10')]('Attachment,\x20%s,\x20%s',_0x30f77f,_0x23329a);_0x2e6024(_0x23329a);});});}exports['CreateAttachment']=function(_0x1695ee){var _0x4658c9=this;return new Promise(function(_0x3efe71,_0x1e6c63){return db[_0xe697('0x14')][_0xe697('0x15')](_0x1695ee[_0xe697('0x16')],{'raw':_0x1695ee['options']?_0x1695ee['options'][_0xe697('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x44a8ce){logger[_0xe697('0xb')](_0xe697('0x18'),_0x1695ee);logger[_0xe697('0xd')](_0xe697('0x18'),_0x1695ee,JSON[_0xe697('0xf')](_0x44a8ce));_0x3efe71(_0x44a8ce);})[_0xe697('0x19')](function(_0x5df83d){logger[_0xe697('0x10')](_0xe697('0x18'),_0x5df83d[_0xe697('0x13')],_0x1695ee);_0x1e6c63(_0x4658c9[_0xe697('0x10')](0x1f4,_0x5df83d[_0xe697('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9ab7cd4..bcf25ef 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 _0x9e0d=['single','create','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','format','%s-%s','now','originalname','replace'];(function(_0x32eb0f,_0x773bb7){var _0xea42f2=function(_0x39d8f0){while(--_0x39d8f0){_0x32eb0f['push'](_0x32eb0f['shift']());}};_0xea42f2(++_0x773bb7);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x4ca4ef,_0x9e82fa){_0x4ca4ef=_0x4ca4ef-0x0;var _0x3e9f35=_0x9e0d[_0x4ca4ef];return _0x3e9f35;};'use strict';var multer=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var path=require(_0xd9e0('0x2'));var timeout=require(_0xd9e0('0x3'));var express=require('express');var router=express[_0xd9e0('0x4')]();var auth=require(_0xd9e0('0x5'));var interaction=require(_0xd9e0('0x6'));var config=require(_0xd9e0('0x7'));var controller=require(_0xd9e0('0x8'));router[_0xd9e0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd9e0('0x9')](_0xd9e0('0xa'),auth[_0xd9e0('0xb')](),controller[_0xd9e0('0xc')]);router[_0xd9e0('0x9')](_0xd9e0('0xd'),auth['isAuthenticated'](),controller[_0xd9e0('0xe')]);var upload=multer({'storage':multer[_0xd9e0('0xf')]({'destination':function(_0x57763b,_0x5bd6ad,_0x1fc11b){_0x1fc11b(null,path[_0xd9e0('0x10')](config[_0xd9e0('0x11')],'server/files/attachments/'));},'filename':function(_0x36ef0b,_0x1f8eae,_0x4b8f8d){_0x4b8f8d(null,util[_0xd9e0('0x12')](_0xd9e0('0x13'),Date[_0xd9e0('0x14')](),_0x1f8eae[_0xd9e0('0x15')][_0xd9e0('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xd9e0('0x17')]('file'),controller[_0xd9e0('0x18')]);router['put'](_0xd9e0('0xa'),auth[_0xd9e0('0xb')](),controller[_0xd9e0('0x19')]);router[_0xd9e0('0x1a')](_0xd9e0('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc041=['put','/:id','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','join','root','server/files/attachments/','format','now','originalname','post','single','file','create'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0xc041,0x1ea));var _0x1c04=function(_0x5b6828,_0x4a19d9){_0x5b6828=_0x5b6828-0x0;var _0x2dbd2c=_0xc041[_0x5b6828];return _0x2dbd2c;};'use strict';var multer=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var path=require('path');var timeout=require(_0x1c04('0x2'));var express=require('express');var router=express[_0x1c04('0x3')]();var auth=require(_0x1c04('0x4'));var interaction=require(_0x1c04('0x5'));var config=require(_0x1c04('0x6'));var controller=require(_0x1c04('0x7'));router[_0x1c04('0x8')]('/',auth['isAuthenticated'](),controller[_0x1c04('0x9')]);router['get']('/:id',auth[_0x1c04('0xa')](),controller[_0x1c04('0xb')]);router[_0x1c04('0x8')](_0x1c04('0xc'),auth[_0x1c04('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x340660,_0xa122f4,_0x1cc5d5){_0x1cc5d5(null,path[_0x1c04('0xd')](config[_0x1c04('0xe')],_0x1c04('0xf')));},'filename':function(_0x469152,_0x861e81,_0x52ac73){_0x52ac73(null,util[_0x1c04('0x10')]('%s-%s',Date[_0x1c04('0x11')](),_0x861e81[_0x1c04('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1c04('0x13')]('/',upload[_0x1c04('0x14')](_0x1c04('0x15')),controller[_0x1c04('0x16')]);router[_0x1c04('0x17')](_0x1c04('0x18'),auth[_0x1c04('0xa')](),controller['update']);router[_0x1c04('0x19')](_0x1c04('0x18'),auth[_0x1c04('0xa')](),controller['destroy']);module[_0x1c04('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5b21f65..538a91a 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 _0xd47f=['profile','email','clientID','clientSecret','secret','callbackURL','map','value','admin','user','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login'];(function(_0x4ff443,_0x5e1148){var _0x12832a=function(_0x40f7b2){while(--_0x40f7b2){_0x4ff443['push'](_0x4ff443['shift']());}};_0x12832a(++_0x5e1148);}(_0xd47f,0x1bd));var _0xfd47=function(_0x4e2fe3,_0x15fb77){_0x4e2fe3=_0x4e2fe3-0x0;var _0x4f9d24=_0xd47f[_0x4e2fe3];return _0x4f9d24;};'use strict';var _=require(_0xfd47('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xfd47('0x1'))[_0xfd47('0x2')];var db=require(_0xfd47('0x3'))['db'];var config=require(_0xfd47('0x4'));var signToken=require(_0xfd47('0x5'))[_0xfd47('0x6')];exports[_0xfd47('0x7')]=passport[_0xfd47('0x8')](_0xfd47('0x9'),{'failureRedirect':_0xfd47('0xa'),'scope':[_0xfd47('0xb'),_0xfd47('0xc')],'session':![]});exports['callback']=passport['authenticate'](_0xfd47('0x9'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0xfd47('0x9')][_0xfd47('0xd')]:'id','clientSecret':config[_0xfd47('0x9')]?config[_0xfd47('0x9')][_0xfd47('0xe')]:_0xfd47('0xf'),'callbackURL':config['google']?config['google'][_0xfd47('0x10')]:''},function(_0x5e5ad4,_0x4dd464,_0x3a0078,_0x4d3c12){db['User']['find']({'where':{'email':_[_0xfd47('0x11')](_0x3a0078['emails'],_0xfd47('0x12')),'role':{'$or':[_0xfd47('0x13'),_0xfd47('0x14'),'agent']}}})[_0xfd47('0x15')](function(_0x13fc51){if(_0x13fc51){return _0x4d3c12(null,_0x13fc51);}_0x4d3c12(_0xfd47('0x16'));})[_0xfd47('0x17')](function(_0x584fe1){_0x4d3c12(_0x584fe1);});})); \ No newline at end of file +var _0xdbb1=['Incorrect\x20username\x20and/or\x20password','lodash','../../mysqldb','signToken','authenticate','google','email','callback','use','clientID','clientSecret','secret','callbackURL','User','find','map','emails','user','agent','then'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0xdbb1,0x105));var _0x1dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dbb('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var db=require(_0x1dbb('0x1'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x1dbb('0x2')];exports['login']=passport[_0x1dbb('0x3')](_0x1dbb('0x4'),{'failureRedirect':'/login','scope':['profile',_0x1dbb('0x5')],'session':![]});exports[_0x1dbb('0x6')]=passport[_0x1dbb('0x3')](_0x1dbb('0x4'),{'failureRedirect':'/login','session':![]});passport[_0x1dbb('0x7')](new GoogleStrategy({'clientID':config[_0x1dbb('0x4')]?config['google'][_0x1dbb('0x8')]:'id','clientSecret':config[_0x1dbb('0x4')]?config[_0x1dbb('0x4')][_0x1dbb('0x9')]:_0x1dbb('0xa'),'callbackURL':config[_0x1dbb('0x4')]?config[_0x1dbb('0x4')][_0x1dbb('0xb')]:''},function(_0x3e71bd,_0x11adbe,_0x1d3f8b,_0x5bf42d){db[_0x1dbb('0xc')][_0x1dbb('0xd')]({'where':{'email':_[_0x1dbb('0xe')](_0x1d3f8b[_0x1dbb('0xf')],'value'),'role':{'$or':['admin',_0x1dbb('0x10'),_0x1dbb('0x11')]}}})[_0x1dbb('0x12')](function(_0xc910a8){if(_0xc910a8){return _0x5bf42d(null,_0xc910a8);}_0x5bf42d(_0x1dbb('0x13'));})['catch'](function(_0x15dc51){_0x5bf42d(_0x15dc51);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 9b7626d..64cc5f7 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 _0x3a3e=['exports','passport','Router','./authGoogle.controller','../../components/auth/service','setTokenCookie','get','login','callback'];(function(_0xb23ad5,_0x389a3c){var _0x3a9ce2=function(_0x4da668){while(--_0x4da668){_0xb23ad5['push'](_0xb23ad5['shift']());}};_0x3a9ce2(++_0x389a3c);}(_0x3a3e,0x1ba));var _0xe3a3=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x3a3e[_0x2b7764];return _0x848dcb;};'use strict';var express=require('express');var passport=require(_0xe3a3('0x0'));var router=express[_0xe3a3('0x1')]();var controller=require(_0xe3a3('0x2'));var setTokenCookie=require(_0xe3a3('0x3'))[_0xe3a3('0x4')];router[_0xe3a3('0x5')]('/',controller[_0xe3a3('0x6')]);router[_0xe3a3('0x5')]('/callback',controller[_0xe3a3('0x7')],setTokenCookie);module[_0xe3a3('0x8')]=router; \ No newline at end of file +var _0x90b0=['./authGoogle.controller','../../components/auth/service','setTokenCookie','get','login','/callback','callback','exports','express','passport','Router'];(function(_0x2a1f3b,_0x3cd3d1){var _0x4da9be=function(_0x1853f3){while(--_0x1853f3){_0x2a1f3b['push'](_0x2a1f3b['shift']());}};_0x4da9be(++_0x3cd3d1);}(_0x90b0,0x81));var _0x090b=function(_0x5cfff8,_0x5572cb){_0x5cfff8=_0x5cfff8-0x0;var _0xffe54b=_0x90b0[_0x5cfff8];return _0xffe54b;};'use strict';var express=require(_0x090b('0x0'));var passport=require(_0x090b('0x1'));var router=express[_0x090b('0x2')]();var controller=require(_0x090b('0x3'));var setTokenCookie=require(_0x090b('0x4'))[_0x090b('0x5')];router[_0x090b('0x6')]('/',controller[_0x090b('0x7')]);router[_0x090b('0x6')](_0x090b('0x8'),controller[_0x090b('0x9')],setTokenCookie);module[_0x090b('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e60264b..5ec332a 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 _0xe5af=['forgot','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','token','password','use','passport','passport-local','bluebird','jayson/promise','lodash','api','../../components/auth/service','signToken','agent','then','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online'];(function(_0x53a781,_0x1a4369){var _0x58699c=function(_0x204e28){while(--_0x204e28){_0x53a781['push'](_0x53a781['shift']());}};_0x58699c(++_0x1a4369);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1c57f9,_0x1ac957){_0x1c57f9=_0x1c57f9-0x0;var _0x3a65b0=_0xe5af[_0x1c57f9];return _0x3a65b0;};'use strict';var util=require('util');var passport=require(_0xfe5a('0x0'));var LocalStrategy=require(_0xfe5a('0x1'))['Strategy'];var BPromise=require(_0xfe5a('0x2'));var jayson=require(_0xfe5a('0x3'));var _=require(_0xfe5a('0x4'));var logger=require('../../config/logger')(_0xfe5a('0x5'));var rs=require('randomstring');var db=require('../../mysqldb')['db'];var signToken=require(_0xfe5a('0x6'))[_0xfe5a('0x7')];var client=jayson['client']['http']({'port':0x232b});var getLicense=function(_0x356c69){return new BPromise(function(_0x106492,_0xfb4357){var _0x3e683c=0x0;_0x356c69['role']!==_0xfe5a('0x8')&&_0x106492(_0x356c69);return db['User']['count']({'where':{'role':_0xfe5a('0x8'),'online':!![],'id':{'$ne':_0x356c69['id']}}})[_0xfe5a('0x9')](function(_0x543619){_0x3e683c=_0x543619;return require(_0xfe5a('0xa'))[_0xfe5a('0xb')]();})[_0xfe5a('0x9')](function(_0x50024c){if(_0x50024c&&_0x50024c[_0xfe5a('0xc')]&&_0x3e683c>=_0x50024c['agents']){return _0xfb4357({'message':_0xfe5a('0xd')});}return _0x106492(_0x356c69);})[_0xfe5a('0xe')](function(_0x20b206){return _0xfb4357(_0x20b206);});});};function localAuthenticate(_0x374ded,_0x3d9683,_0x58b72c,_0x33e574){_0x374ded[_0xfe5a('0xf')]({'where':{'name':_0x3d9683,'role':{'$or':[_0xfe5a('0x10'),_0xfe5a('0x11'),_0xfe5a('0x8')]}}})[_0xfe5a('0x9')](function(_0x375380){if(!_0x375380||_0x375380&&_0x375380[_0xfe5a('0x12')]!==_0x3d9683){return _0x33e574(null,![],{'message':_0xfe5a('0x13')});}return getLicense(_0x375380);})[_0xfe5a('0x9')](function(_0x38f12e){_0x38f12e[_0xfe5a('0x14')](_0x58b72c,function(_0x22afa7,_0x290600){if(_0x22afa7){return _0x33e574(_0x22afa7);}if(!_0x290600){return _0x33e574(null,![],{'message':_0xfe5a('0x13')});}else{return _0x33e574(null,_0x38f12e);}});})[_0xfe5a('0xe')](function(_0x5bf597){_0x33e574(_0x5bf597);});}function sendServiceMail(_0x20620b){return db[_0xfe5a('0x15')]['find']({'where':{'service':!![]},'attributes':['id',_0xfe5a('0x12'),_0xfe5a('0x16')],'include':[{'model':db[_0xfe5a('0x17')],'as':'Smtp'}]})['then'](function(_0x3e11ad){if(!_0x3e11ad){throw new Error(_0xfe5a('0x18'));}var _0xded538={'tls':{'rejectUnauthorized':![]}};if(_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x1a')]){_0xded538[_0xfe5a('0x1a')]=_0x3e11ad['Smtp'][_0xfe5a('0x1a')];}else{_0xded538['host']=_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x1b')];_0xded538[_0xfe5a('0x1c')]=_0x3e11ad['Smtp']['port'];_0xded538[_0xfe5a('0x1d')]=_0x3e11ad[_0xfe5a('0x19')]['secure'];}if(_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x1e')]){_0xded538['auth']={'user':_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x11')],'pass':_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x1f')]};}var _0x4a0a6e={'account':_0xded538,'message':_[_0xfe5a('0x20')]({'from':util[_0xfe5a('0x21')](_0xfe5a('0x22'),_0x3e11ad[_0xfe5a('0x12')],_0x3e11ad[_0xfe5a('0x16')]||_0x3e11ad[_0xfe5a('0x19')][_0xfe5a('0x11')])},_0x20620b)};return client[_0xfe5a('0x23')]('SendMail',_0x4a0a6e);})['then'](function(_0x712b44){if(_0x712b44['error']){throw new Error(util[_0xfe5a('0x21')](_0xfe5a('0x24'),_0x712b44[_0xfe5a('0x25')]['message']||JSON['stringify'](_0x712b44['error'])));}return!![];});}function handleError(_0x32d31e,_0x582f2d,_0x51d1f4){return _0x32d31e['status'](_0x582f2d||0x1f4)[_0xfe5a('0x26')]({'message':_0x51d1f4?_0x51d1f4[_0xfe5a('0x27')]||_0x51d1f4:''});}exports[_0xfe5a('0x28')]=function(_0x18d54c,_0xb164e0,_0x286f27){passport[_0xfe5a('0x14')](_0xfe5a('0x29'),function(_0x414ab8,_0x2ae57c,_0x14f080){var _0x517969=_0x414ab8||_0x14f080;if(_0x517969){return handleError(_0xb164e0,0x191,_0x517969);}if(!_0x2ae57c){return handleError(_0xb164e0,0x194,{'message':_0xfe5a('0x2a')});}var _0x33a8b1=signToken(_0x2ae57c['id'],_0x2ae57c['role']);_0xb164e0[_0xfe5a('0x2b')]({'id':_0x2ae57c['id'],'token':_0x33a8b1,'statusCall':'','isAlreadyLogged':_0x2ae57c[_0xfe5a('0x2c')]});})(_0x18d54c,_0xb164e0,_0x286f27);};exports[_0xfe5a('0x2d')]=function(_0x45ed5f,_0xe5a992,_0x5ed29a){if(!_0x45ed5f['body'][_0xfe5a('0x16')]){return handleError(_0xe5a992,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x30fd4b=rs[_0xfe5a('0x2e')]();_0x45ed5f[_0xfe5a('0x2f')][_0xfe5a('0x16')]=_0x45ed5f['body'][_0xfe5a('0x16')][_0xfe5a('0x30')]()[_0xfe5a('0x31')]();return db['User'][_0xfe5a('0xf')]({'where':{'email':_0x45ed5f[_0xfe5a('0x2f')][_0xfe5a('0x16')]}})[_0xfe5a('0x9')](function(_0x498807){if(!_0x498807){throw new Error(_0xfe5a('0x32'));}_0x498807['resetPasswordToken']=_0x30fd4b;_0x498807[_0xfe5a('0x33')]=Date[_0xfe5a('0x34')]()+0x36ee80;return _0x498807['save']();})[_0xfe5a('0x9')](function(){return sendServiceMail({'to':_0x45ed5f[_0xfe5a('0x2f')][_0xfe5a('0x16')],'subject':_0xfe5a('0x35'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xfe5a('0x36')+_0xfe5a('0x37')+_0x45ed5f[_0xfe5a('0x38')]['host']+_0xfe5a('0x39')+_0x30fd4b+'\x0a\x0a'+_0xfe5a('0x3a')});})[_0xfe5a('0x9')](function(){_0xe5a992[_0xfe5a('0x3b')](0xc8)[_0xfe5a('0x26')]({'message':_0xfe5a('0x3c')});})[_0xfe5a('0xe')](function(_0x243271){return handleError(_0xe5a992,0x1f4,_0x243271);});};exports[_0xfe5a('0x3d')]=function(_0x332685,_0x20da14,_0x585752){return db[_0xfe5a('0x3e')][_0xfe5a('0xf')]({'where':{'resetPasswordToken':_0x332685[_0xfe5a('0x3f')][_0xfe5a('0x40')],'resetPasswordExpires':{'$gt':Date[_0xfe5a('0x34')]()}}})[_0xfe5a('0x9')](function(_0x3475fb){if(!_0x3475fb){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}_0x3475fb[_0xfe5a('0x41')]=_0x332685[_0xfe5a('0x2f')]['password'];_0x3475fb['resetPasswordToken']=null;_0x3475fb[_0xfe5a('0x33')]=null;return _0x3475fb['save']();})['then'](function(){_0x20da14[_0xfe5a('0x3b')](0xc8)[_0xfe5a('0x26')]({'message':'Password\x20reset!'});})[_0xfe5a('0xe')](function(_0x5a9c92){return handleError(_0x20da14,0x1f4,_0x5a9c92);});};passport[_0xfe5a('0x42')](new LocalStrategy({'usernameField':_0xfe5a('0x12'),'passwordField':_0xfe5a('0x41')},function(_0x2beb0b,_0x17ddb7,_0x9afd66){return localAuthenticate(db['User'],_0x2beb0b,_0x17ddb7,_0x9afd66);})); \ No newline at end of file +var _0x66fa=['lodash','../../config/logger','api','randomstring','signToken','client','http','agent','count','../../config/license/util','getLicense','agents','catch','then','name','Incorrect\x20username\x20and/or\x20password','authenticate','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','resetPasswordToken','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','http://','headers','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','resetPasswordExpires','Password\x20reset!','use','util','passport','Strategy','bluebird','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x66fa,0x117));var _0xa66f=function(_0x556df1,_0x2413ed){_0x556df1=_0x556df1-0x0;var _0x2e03fc=_0x66fa[_0x556df1];return _0x2e03fc;};'use strict';var util=require(_0xa66f('0x0'));var passport=require(_0xa66f('0x1'));var LocalStrategy=require('passport-local')[_0xa66f('0x2')];var BPromise=require(_0xa66f('0x3'));var jayson=require(_0xa66f('0x4'));var _=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var rs=require(_0xa66f('0x8'));var db=require('../../mysqldb')['db'];var signToken=require('../../components/auth/service')[_0xa66f('0x9')];var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232b});var getLicense=function(_0x1d02fc){return new BPromise(function(_0x38b58b,_0x5096bf){var _0x39c1ef=0x0;_0x1d02fc['role']!==_0xa66f('0xc')&&_0x38b58b(_0x1d02fc);return db['User'][_0xa66f('0xd')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1d02fc['id']}}})['then'](function(_0x55e6dc){_0x39c1ef=_0x55e6dc;return require(_0xa66f('0xe'))[_0xa66f('0xf')]();})['then'](function(_0x14d31e){if(_0x14d31e&&_0x14d31e['agents']&&_0x39c1ef>=_0x14d31e[_0xa66f('0x10')]){return _0x5096bf({'message':'Maximum\x20login\x20has\x20been\x20reached'});}return _0x38b58b(_0x1d02fc);})[_0xa66f('0x11')](function(_0x14af70){return _0x5096bf(_0x14af70);});});};function localAuthenticate(_0xca12f8,_0x4ebd7b,_0x49713e,_0x215ffa){_0xca12f8['find']({'where':{'name':_0x4ebd7b,'role':{'$or':['admin','user',_0xa66f('0xc')]}}})[_0xa66f('0x12')](function(_0x267129){if(!_0x267129||_0x267129&&_0x267129[_0xa66f('0x13')]!==_0x4ebd7b){return _0x215ffa(null,![],{'message':_0xa66f('0x14')});}return getLicense(_0x267129);})['then'](function(_0x5510dc){_0x5510dc[_0xa66f('0x15')](_0x49713e,function(_0x32d338,_0x295acf){if(_0x32d338){return _0x215ffa(_0x32d338);}if(!_0x295acf){return _0x215ffa(null,![],{'message':_0xa66f('0x14')});}else{return _0x215ffa(null,_0x5510dc);}});})['catch'](function(_0x1cbe64){_0x215ffa(_0x1cbe64);});}function sendServiceMail(_0x55b59d){return db['MailAccount'][_0xa66f('0x16')]({'where':{'service':!![]},'attributes':['id',_0xa66f('0x13'),_0xa66f('0x17')],'include':[{'model':db[_0xa66f('0x18')],'as':_0xa66f('0x19')}]})[_0xa66f('0x12')](function(_0x251f60){if(!_0x251f60){throw new Error(_0xa66f('0x1a'));}var _0x2033a4={'tls':{'rejectUnauthorized':![]}};if(_0x251f60[_0xa66f('0x19')][_0xa66f('0x1b')]){_0x2033a4[_0xa66f('0x1b')]=_0x251f60[_0xa66f('0x19')][_0xa66f('0x1b')];}else{_0x2033a4[_0xa66f('0x1c')]=_0x251f60['Smtp'][_0xa66f('0x1c')];_0x2033a4[_0xa66f('0x1d')]=_0x251f60[_0xa66f('0x19')][_0xa66f('0x1d')];_0x2033a4['secure']=_0x251f60[_0xa66f('0x19')][_0xa66f('0x1e')];}if(_0x251f60[_0xa66f('0x19')][_0xa66f('0x1f')]){_0x2033a4['auth']={'user':_0x251f60['Smtp'][_0xa66f('0x20')],'pass':_0x251f60['Smtp'][_0xa66f('0x21')]};}var _0xc661f2={'account':_0x2033a4,'message':_[_0xa66f('0x22')]({'from':util['format'](_0xa66f('0x23'),_0x251f60[_0xa66f('0x13')],_0x251f60[_0xa66f('0x17')]||_0x251f60[_0xa66f('0x19')][_0xa66f('0x20')])},_0x55b59d)};return client[_0xa66f('0x24')](_0xa66f('0x25'),_0xc661f2);})[_0xa66f('0x12')](function(_0x20ee67){if(_0x20ee67[_0xa66f('0x26')]){throw new Error(util[_0xa66f('0x27')](_0xa66f('0x28'),_0x20ee67[_0xa66f('0x26')][_0xa66f('0x29')]||JSON['stringify'](_0x20ee67['error'])));}return!![];});}function handleError(_0x38daac,_0x27ceae,_0x55f309){return _0x38daac[_0xa66f('0x2a')](_0x27ceae||0x1f4)[_0xa66f('0x2b')]({'message':_0x55f309?_0x55f309['message']||_0x55f309:''});}exports[_0xa66f('0x2c')]=function(_0x15b946,_0x9d78d5,_0x2c2ace){passport[_0xa66f('0x15')]('local',function(_0x1b2c5a,_0x4fcdc1,_0x306b35){var _0x35a0a7=_0x1b2c5a||_0x306b35;if(_0x35a0a7){return handleError(_0x9d78d5,0x191,_0x35a0a7);}if(!_0x4fcdc1){return handleError(_0x9d78d5,0x194,{'message':_0xa66f('0x2d')});}var _0x486e4e=signToken(_0x4fcdc1['id'],_0x4fcdc1[_0xa66f('0x2e')]);_0x9d78d5[_0xa66f('0x2f')]({'id':_0x4fcdc1['id'],'token':_0x486e4e,'statusCall':'','isAlreadyLogged':_0x4fcdc1['online']});})(_0x15b946,_0x9d78d5,_0x2c2ace);};exports[_0xa66f('0x30')]=function(_0x35a847,_0xba9457,_0x3e7ac5){if(!_0x35a847[_0xa66f('0x31')][_0xa66f('0x17')]){return handleError(_0xba9457,0x1f4,{'message':_0xa66f('0x32')});}var _0x41303c=rs[_0xa66f('0x33')]();_0x35a847[_0xa66f('0x31')]['email']=_0x35a847[_0xa66f('0x31')]['email'][_0xa66f('0x34')]()[_0xa66f('0x35')]();return db[_0xa66f('0x36')][_0xa66f('0x16')]({'where':{'email':_0x35a847[_0xa66f('0x31')][_0xa66f('0x17')]}})[_0xa66f('0x12')](function(_0xcee582){if(!_0xcee582){throw new Error('This\x20email\x20is\x20not\x20registered.');}_0xcee582[_0xa66f('0x37')]=_0x41303c;_0xcee582['resetPasswordExpires']=Date[_0xa66f('0x38')]()+0x36ee80;return _0xcee582[_0xa66f('0x39')]();})[_0xa66f('0x12')](function(){return sendServiceMail({'to':_0x35a847['body']['email'],'subject':_0xa66f('0x3a'),'text':_0xa66f('0x3b')+_0xa66f('0x3c')+_0xa66f('0x3d')+_0x35a847[_0xa66f('0x3e')]['host']+'/reset/'+_0x41303c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa66f('0x12')](function(){_0xba9457['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xa66f('0x11')](function(_0x5051b2){return handleError(_0xba9457,0x1f4,_0x5051b2);});};exports[_0xa66f('0x3f')]=function(_0x17d942,_0x23a546,_0x1647a0){return db[_0xa66f('0x36')][_0xa66f('0x16')]({'where':{'resetPasswordToken':_0x17d942[_0xa66f('0x40')][_0xa66f('0x41')],'resetPasswordExpires':{'$gt':Date[_0xa66f('0x38')]()}}})[_0xa66f('0x12')](function(_0x3a7929){if(!_0x3a7929){throw new Error(_0xa66f('0x42'));}_0x3a7929[_0xa66f('0x43')]=_0x17d942[_0xa66f('0x31')]['password'];_0x3a7929[_0xa66f('0x37')]=null;_0x3a7929[_0xa66f('0x44')]=null;return _0x3a7929['save']();})[_0xa66f('0x12')](function(){_0x23a546['status'](0xc8)[_0xa66f('0x2b')]({'message':_0xa66f('0x45')});})['catch'](function(_0x1ddd2f){return handleError(_0x23a546,0x1f4,_0x1ddd2f);});};passport[_0xa66f('0x46')](new LocalStrategy({'usernameField':_0xa66f('0x13'),'passwordField':'password'},function(_0x394b1e,_0x5cdfe2,_0x276cd5){return localAuthenticate(db[_0xa66f('0x36')],_0x394b1e,_0x5cdfe2,_0x276cd5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0637042..d55cd78 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 _0x8194=['post','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','login'];(function(_0x1fcac7,_0x2332b1){var _0x21a516=function(_0x1d9368){while(--_0x1d9368){_0x1fcac7['push'](_0x1fcac7['shift']());}};_0x21a516(++_0x2332b1);}(_0x8194,0x113));var _0x4819=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0x8194[_0x2730da];return _0xfe9991;};'use strict';var express=require(_0x4819('0x0'));var router=express[_0x4819('0x1')]();var controller=require(_0x4819('0x2'));router['post']('/',controller[_0x4819('0x3')]);router[_0x4819('0x4')](_0x4819('0x5'),controller[_0x4819('0x6')]);router[_0x4819('0x4')](_0x4819('0x7'),controller[_0x4819('0x8')]);module['exports']=router; \ No newline at end of file +var _0xd94b=['post','reset','exports','express','Router','./authLocal.controller','/forgot','forgot'];(function(_0x42e0da,_0x421f91){var _0x1002c6=function(_0x4094a2){while(--_0x4094a2){_0x42e0da['push'](_0x42e0da['shift']());}};_0x1002c6(++_0x421f91);}(_0xd94b,0x83));var _0xbd94=function(_0x883d31,_0x50f7d0){_0x883d31=_0x883d31-0x0;var _0x4201bb=_0xd94b[_0x883d31];return _0x4201bb;};'use strict';var express=require(_0xbd94('0x0'));var router=express[_0xbd94('0x1')]();var controller=require(_0xbd94('0x2'));router['post']('/',controller['login']);router['post'](_0xbd94('0x3'),controller[_0xbd94('0x4')]);router[_0xbd94('0x5')]('/reset/:token',controller[_0xbd94('0x6')]);module[_0xbd94('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index dfc9b17..2c52e3f 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 _0x759e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2bc6dc,_0x232814){var _0xa0cd2a=function(_0x2ee4be){while(--_0x2ee4be){_0x2bc6dc['push'](_0x2bc6dc['shift']());}};_0xa0cd2a(++_0x232814);}(_0x759e,0xd1));var _0xe759=function(_0x543476,_0x113daa){_0x543476=_0x543476-0x0;var _0x59c2df=_0x759e[_0x543476];return _0x59c2df;};'use strict';var Sequelize=require(_0xe759('0x0'));module[_0xe759('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe759('0x2')]},'description':{'type':Sequelize[_0xe759('0x2')]},'status':{'type':Sequelize[_0xe759('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe759('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6017=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1b2f41,_0x308cb9){var _0x5746cc=function(_0x477734){while(--_0x477734){_0x1b2f41['push'](_0x1b2f41['shift']());}};_0x5746cc(++_0x308cb9);}(_0x6017,0xae));var _0x7601=function(_0x5583a4,_0x3bc094){_0x5583a4=_0x5583a4-0x0;var _0x287367=_0x6017[_0x5583a4];return _0x287367;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'name':{'type':Sequelize[_0x7601('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7601('0x2')]},'status':{'type':Sequelize[_0x7601('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 1f3fc2d..e1336a0 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 _0x0511=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','index','Automation','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','field','merge','options','then','includeAll','rows','catch','show','find','create','body','destroy','params','addConditions','Condition','ids','getConditions','findOne','sort','addActions','getActions','Action','map','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','squel'];(function(_0x70a1dd,_0x7e1eb7){var _0x4b309d=function(_0x2551c1){while(--_0x2551c1){_0x70a1dd['push'](_0x70a1dd['shift']());}};_0x4b309d(++_0x7e1eb7);}(_0x0511,0x186));var _0x1051=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x0511[_0x5df033];return _0x445829;};'use strict';var pdf=require(_0x1051('0x0'));var emlformat=require(_0x1051('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1051('0x2'));var rp=require(_0x1051('0x3'));var moment=require(_0x1051('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1051('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1051('0x6'));var ejs=require(_0x1051('0x7'));var fs=require('fs');var _=require(_0x1051('0x8'));var squel=require(_0x1051('0x9'));var crypto=require(_0x1051('0xa'));var jsforce=require(_0x1051('0xb'));var deskjs=require(_0x1051('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1051('0xd'));var authService=require(_0x1051('0xe'));var hardwareService=require(_0x1051('0xf'));var Redis=require(_0x1051('0x10'));var qs=require(_0x1051('0x11'));var logger=require(_0x1051('0x12'))(_0x1051('0x13'));var utils=require(_0x1051('0x14'));var config=require(_0x1051('0x15'));var db=require(_0x1051('0x16'))['db'];function respondWithStatusCode(_0x57ac65,_0x473729){_0x473729=_0x473729||0xcc;return function(_0x50489a){if(_0x50489a){return _0x57ac65['sendStatus'](_0x473729);}return _0x57ac65[_0x1051('0x17')](_0x473729)[_0x1051('0x18')]();};}function respondWithResult(_0x380520,_0x158253){_0x158253=_0x158253||0xc8;return function(_0x182c0c){if(_0x182c0c){return _0x380520[_0x1051('0x17')](_0x158253)[_0x1051('0x19')](_0x182c0c);}};}function respondWithFilteredResult(_0x4ab645,_0x55e3d3){return function(_0x4432dd){if(_0x4432dd){var _0x54b573=_0x4432dd[_0x1051('0x1a')],_0x2fe39a=_0x55e3d3[_0x1051('0x1b')],_0x51e01a=_0x55e3d3[_0x1051('0x1b')]+_0x55e3d3['limit'],_0x7d717b;if(_0x51e01a>=_0x54b573){_0x51e01a=_0x54b573;_0x7d717b=0xc8;}else{_0x7d717b=0xce;}_0x4ab645[_0x1051('0x17')](_0x7d717b);return _0x4ab645[_0x1051('0x1c')](_0x1051('0x1d'),_0x2fe39a+'-'+_0x51e01a+'/'+_0x54b573)[_0x1051('0x19')](_0x4432dd);}return null;};}function patchUpdates(_0x32bb7d){return function(_0x212658){try{jsonpatch[_0x1051('0x1e')](_0x212658,_0x32bb7d,!![]);}catch(_0x3718e4){return BPromise[_0x1051('0x1f')](_0x3718e4);}return _0x212658[_0x1051('0x20')]();};}function saveUpdates(_0x59a32f,_0x1d1d33){return function(_0x128794){if(_0x128794){return _0x128794[_0x1051('0x21')](_0x59a32f)['then'](function(_0x3e65e2){return _0x3e65e2;});}return null;};}function removeEntity(_0x11f6bc,_0x315797){return function(_0x1c89e0){if(_0x1c89e0){return _0x1c89e0['destroy']()['then'](function(){_0x11f6bc['status'](0xcc)[_0x1051('0x18')]();});}};}function handleEntityNotFound(_0x1c42b4,_0x1a5607){return function(_0x2f4adb){if(!_0x2f4adb){_0x1c42b4[_0x1051('0x22')](0x194);}return _0x2f4adb;};}function handleError(_0x1d4fbb,_0x11aa9a){_0x11aa9a=_0x11aa9a||0x1f4;return function(_0x32aaaa){logger[_0x1051('0x23')](_0x32aaaa[_0x1051('0x24')]);if(_0x32aaaa['name']){delete _0x32aaaa[_0x1051('0x25')];}_0x1d4fbb['status'](_0x11aa9a)[_0x1051('0x26')](_0x32aaaa);};}exports[_0x1051('0x27')]=function(_0x35c931,_0x59926f){var _0x45426b={},_0x5b968e={},_0x388424={'count':0x0,'rows':[]};var _0x3d9391=db[_0x1051('0x28')][_0x1051('0x29')];_0x5b968e['model']=_[_0x1051('0x2a')](_0x3d9391);_0x5b968e[_0x1051('0x2b')]=_['keys'](_0x35c931[_0x1051('0x2b')]);_0x5b968e[_0x1051('0x2c')]=_[_0x1051('0x2d')](_0x5b968e[_0x1051('0x2e')],_0x5b968e[_0x1051('0x2b')]);_0x45426b[_0x1051('0x2f')]=_[_0x1051('0x2d')](_0x5b968e[_0x1051('0x2e')],qs[_0x1051('0x30')](_0x35c931[_0x1051('0x2b')]['fields']));_0x45426b[_0x1051('0x2f')]=_0x45426b[_0x1051('0x2f')][_0x1051('0x31')]?_0x45426b[_0x1051('0x2f')]:_0x5b968e[_0x1051('0x2e')];if(!_0x35c931['query'][_0x1051('0x32')](_0x1051('0x33'))){_0x45426b['limit']=qs[_0x1051('0x34')](_0x35c931['query'][_0x1051('0x34')]);_0x45426b[_0x1051('0x1b')]=qs[_0x1051('0x1b')](_0x35c931[_0x1051('0x2b')][_0x1051('0x1b')]);}_0x45426b[_0x1051('0x35')]=qs['sort'](_0x35c931[_0x1051('0x2b')]['sort']);_0x45426b[_0x1051('0x36')]=qs[_0x1051('0x2c')](_[_0x1051('0x37')](_0x35c931['query'],_0x5b968e[_0x1051('0x2c')]));if(_0x35c931[_0x1051('0x2b')][_0x1051('0x38')]){_0x45426b['where']=_['merge'](_0x45426b['where'],{'$or':_['map'](_0x3d9391,function(_0x20cee7){if(_0x20cee7['type']['key']!=='VIRTUAL'){var _0x5f5749={};_0x5f5749[_0x20cee7[_0x1051('0x39')]]={'$like':'%'+_0x35c931['query']['filter']+'%'};return _0x5f5749;}})});}_0x45426b=_[_0x1051('0x3a')]({},_0x45426b,_0x35c931[_0x1051('0x3b')]);var _0x35bee6={'where':_0x45426b['where']};return db['Automation'][_0x1051('0x1a')](_0x35bee6)[_0x1051('0x3c')](function(_0x415449){_0x388424[_0x1051('0x1a')]=_0x415449;if(_0x35c931['query'][_0x1051('0x3d')]){_0x45426b['include']=[{'all':!![]}];}return db[_0x1051('0x28')]['findAll'](_0x45426b);})[_0x1051('0x3c')](function(_0x4d8003){_0x388424[_0x1051('0x3e')]=_0x4d8003;return _0x388424;})['then'](respondWithFilteredResult(_0x59926f,_0x45426b))[_0x1051('0x3f')](handleError(_0x59926f,null));};exports[_0x1051('0x40')]=function(_0x21969c,_0x291340){var _0x3f7a15={'raw':![],'where':{'id':_0x21969c['params']['id']}},_0x221d57={};_0x221d57[_0x1051('0x2e')]=_[_0x1051('0x2a')](db[_0x1051('0x28')][_0x1051('0x29')]);_0x221d57[_0x1051('0x2b')]=_[_0x1051('0x2a')](_0x21969c[_0x1051('0x2b')]);_0x221d57['filters']=_[_0x1051('0x2d')](_0x221d57[_0x1051('0x2e')],_0x221d57['query']);_0x3f7a15[_0x1051('0x2f')]=_[_0x1051('0x2d')](_0x221d57[_0x1051('0x2e')],qs['fields'](_0x21969c[_0x1051('0x2b')][_0x1051('0x30')]));_0x3f7a15[_0x1051('0x2f')]=_0x3f7a15[_0x1051('0x2f')][_0x1051('0x31')]?_0x3f7a15[_0x1051('0x2f')]:_0x221d57[_0x1051('0x2e')];if(_0x21969c[_0x1051('0x2b')][_0x1051('0x3d')]){_0x3f7a15['include']=[{'all':!![]}];}_0x3f7a15=_[_0x1051('0x3a')]({},_0x3f7a15,_0x21969c['options']);return db[_0x1051('0x28')][_0x1051('0x41')](_0x3f7a15)[_0x1051('0x3c')](handleEntityNotFound(_0x291340,null))['then'](respondWithResult(_0x291340,null))[_0x1051('0x3f')](handleError(_0x291340,null));};exports[_0x1051('0x42')]=function(_0x23cf2a,_0x3a0af1){return db['Automation'][_0x1051('0x42')](_0x23cf2a[_0x1051('0x43')],{})[_0x1051('0x3c')](respondWithResult(_0x3a0af1,0xc9))[_0x1051('0x3f')](handleError(_0x3a0af1,null));};exports[_0x1051('0x21')]=function(_0x59c9aa,_0x26869b){if(_0x59c9aa[_0x1051('0x43')]['id']){delete _0x59c9aa[_0x1051('0x43')]['id'];}return db[_0x1051('0x28')][_0x1051('0x41')]({'where':{'id':_0x59c9aa['params']['id']}})[_0x1051('0x3c')](handleEntityNotFound(_0x26869b,null))[_0x1051('0x3c')](saveUpdates(_0x59c9aa['body'],null))['then'](respondWithResult(_0x26869b,null))[_0x1051('0x3f')](handleError(_0x26869b,null));};exports[_0x1051('0x44')]=function(_0x4af7f0,_0x36c74a){return db[_0x1051('0x28')]['find']({'where':{'id':_0x4af7f0[_0x1051('0x45')]['id']}})[_0x1051('0x3c')](handleEntityNotFound(_0x36c74a,null))[_0x1051('0x3c')](removeEntity(_0x36c74a,null))['catch'](handleError(_0x36c74a,null));};exports[_0x1051('0x46')]=function(_0xe56a3b,_0x3882a8,_0x364ecf){return db[_0x1051('0x47')]['find']({'where':{'id':_0xe56a3b[_0x1051('0x45')]['id']}})[_0x1051('0x3c')](handleEntityNotFound(_0x3882a8,null))[_0x1051('0x3c')](function(_0x4dfeef){if(_0x4dfeef){return _0x4dfeef[_0x1051('0x46')](_0xe56a3b[_0x1051('0x43')][_0x1051('0x48')],_['omit'](_0xe56a3b[_0x1051('0x43')],[_0x1051('0x48'),'id'])||{});}})[_0x1051('0x3c')](respondWithResult(_0x3882a8,null))[_0x1051('0x3f')](handleError(_0x3882a8,null));};exports[_0x1051('0x49')]=function(_0x12441a,_0x288636,_0x18adb5){var _0x85c88d={};var _0x21935c={};var _0x3e06ff;var _0x2da5e0;return db['Automation'][_0x1051('0x4a')]({'where':{'id':_0x12441a['params']['id']}})[_0x1051('0x3c')](handleEntityNotFound(_0x288636,null))[_0x1051('0x3c')](function(_0x255192){if(_0x255192){_0x3e06ff=_0x255192;_0x21935c[_0x1051('0x2e')]=_[_0x1051('0x2a')](db['Condition'][_0x1051('0x29')]);_0x21935c['query']=_[_0x1051('0x2a')](_0x12441a[_0x1051('0x2b')]);_0x21935c[_0x1051('0x2c')]=_[_0x1051('0x2d')](_0x21935c['model'],_0x21935c['query']);_0x85c88d[_0x1051('0x2f')]=_['intersection'](_0x21935c['model'],qs['fields'](_0x12441a[_0x1051('0x2b')][_0x1051('0x30')]));_0x85c88d['attributes']=_0x85c88d[_0x1051('0x2f')][_0x1051('0x31')]?_0x85c88d[_0x1051('0x2f')]:_0x21935c[_0x1051('0x2e')];_0x85c88d[_0x1051('0x35')]=qs[_0x1051('0x4b')](_0x12441a[_0x1051('0x2b')][_0x1051('0x4b')]);_0x85c88d[_0x1051('0x36')]=qs[_0x1051('0x2c')](_['pick'](_0x12441a[_0x1051('0x2b')],_0x21935c['filters']));if(_0x12441a['query'][_0x1051('0x38')]){_0x85c88d['where']=_[_0x1051('0x3a')](_0x85c88d[_0x1051('0x36')],{'$or':_['map'](_0x85c88d['attributes'],function(_0x55b904){var _0x6ebdd8={};_0x6ebdd8[_0x55b904]={'$like':'%'+_0x12441a[_0x1051('0x2b')][_0x1051('0x38')]+'%'};return _0x6ebdd8;})});}_0x85c88d=_[_0x1051('0x3a')]({},_0x85c88d,_0x12441a['options']);return _0x3e06ff[_0x1051('0x49')](_0x85c88d);}})[_0x1051('0x3c')](function(_0x4f3ae6){if(_0x4f3ae6){_0x2da5e0=_0x4f3ae6[_0x1051('0x31')];if(!_0x12441a[_0x1051('0x2b')][_0x1051('0x32')](_0x1051('0x33'))){_0x85c88d[_0x1051('0x34')]=qs[_0x1051('0x34')](_0x12441a[_0x1051('0x2b')]['limit']);_0x85c88d[_0x1051('0x1b')]=qs[_0x1051('0x1b')](_0x12441a[_0x1051('0x2b')]['offset']);}return _0x3e06ff[_0x1051('0x49')](_0x85c88d);}})[_0x1051('0x3c')](function(_0x591858){if(_0x591858){return _0x591858?{'count':_0x2da5e0,'rows':_0x591858}:null;}})[_0x1051('0x3c')](respondWithResult(_0x288636,null))[_0x1051('0x3f')](handleError(_0x288636,null));};exports[_0x1051('0x4c')]=function(_0x4552db,_0xa5576a,_0x1b6374){return db['Action']['find']({'where':{'id':_0x4552db[_0x1051('0x45')]['id']}})[_0x1051('0x3c')](handleEntityNotFound(_0xa5576a,null))[_0x1051('0x3c')](function(_0x25a8d6){if(_0x25a8d6){return _0x25a8d6[_0x1051('0x4c')](_0x4552db[_0x1051('0x43')][_0x1051('0x48')],_['omit'](_0x4552db[_0x1051('0x43')],[_0x1051('0x48'),'id'])||{});}})[_0x1051('0x3c')](respondWithResult(_0xa5576a,null))['catch'](handleError(_0xa5576a,null));};exports[_0x1051('0x4d')]=function(_0x20aea6,_0x4f2082,_0x5e869c){var _0x484d50={};var _0x499f78={};var _0x20f18e;var _0x19d724;return db[_0x1051('0x28')]['findOne']({'where':{'id':_0x20aea6[_0x1051('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f2082,null))[_0x1051('0x3c')](function(_0x331903){if(_0x331903){_0x20f18e=_0x331903;_0x499f78[_0x1051('0x2e')]=_['keys'](db[_0x1051('0x4e')]['rawAttributes']);_0x499f78['query']=_[_0x1051('0x2a')](_0x20aea6[_0x1051('0x2b')]);_0x499f78[_0x1051('0x2c')]=_[_0x1051('0x2d')](_0x499f78[_0x1051('0x2e')],_0x499f78[_0x1051('0x2b')]);_0x484d50[_0x1051('0x2f')]=_[_0x1051('0x2d')](_0x499f78['model'],qs[_0x1051('0x30')](_0x20aea6['query'][_0x1051('0x30')]));_0x484d50['attributes']=_0x484d50['attributes']['length']?_0x484d50['attributes']:_0x499f78[_0x1051('0x2e')];_0x484d50['order']=qs[_0x1051('0x4b')](_0x20aea6[_0x1051('0x2b')][_0x1051('0x4b')]);_0x484d50[_0x1051('0x36')]=qs['filters'](_['pick'](_0x20aea6['query'],_0x499f78[_0x1051('0x2c')]));if(_0x20aea6[_0x1051('0x2b')]['filter']){_0x484d50[_0x1051('0x36')]=_[_0x1051('0x3a')](_0x484d50['where'],{'$or':_[_0x1051('0x4f')](_0x484d50['attributes'],function(_0x31eaea){var _0x3e8c66={};_0x3e8c66[_0x31eaea]={'$like':'%'+_0x20aea6[_0x1051('0x2b')]['filter']+'%'};return _0x3e8c66;})});}_0x484d50=_[_0x1051('0x3a')]({},_0x484d50,_0x20aea6[_0x1051('0x3b')]);return _0x20f18e[_0x1051('0x4d')](_0x484d50);}})[_0x1051('0x3c')](function(_0x47e212){if(_0x47e212){_0x19d724=_0x47e212[_0x1051('0x31')];if(!_0x20aea6[_0x1051('0x2b')][_0x1051('0x32')]('nolimit')){_0x484d50[_0x1051('0x34')]=qs[_0x1051('0x34')](_0x20aea6[_0x1051('0x2b')][_0x1051('0x34')]);_0x484d50[_0x1051('0x1b')]=qs['offset'](_0x20aea6[_0x1051('0x2b')][_0x1051('0x1b')]);}return _0x20f18e[_0x1051('0x4d')](_0x484d50);}})[_0x1051('0x3c')](function(_0x146846){if(_0x146846){return _0x146846?{'count':_0x19d724,'rows':_0x146846}:null;}})[_0x1051('0x3c')](respondWithResult(_0x4f2082,null))[_0x1051('0x3f')](handleError(_0x4f2082,null));}; \ No newline at end of file +var _0xa1c8=['reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','Content-Range','apply'];(function(_0xc8a598,_0x8ffd7c){var _0x2a6225=function(_0x5f2d46){while(--_0x5f2d46){_0xc8a598['push'](_0xc8a598['shift']());}};_0x2a6225(++_0x8ffd7c);}(_0xa1c8,0x134));var _0x8a1c=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xa1c8[_0x5a776b];return _0xbbef59;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8a1c('0x0'));var zipdir=require(_0x8a1c('0x1'));var jsonpatch=require(_0x8a1c('0x2'));var rp=require(_0x8a1c('0x3'));var moment=require('moment');var BPromise=require(_0x8a1c('0x4'));var Mustache=require(_0x8a1c('0x5'));var util=require(_0x8a1c('0x6'));var path=require(_0x8a1c('0x7'));var sox=require(_0x8a1c('0x8'));var csv=require('to-csv');var ejs=require(_0x8a1c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a1c('0xa'));var crypto=require(_0x8a1c('0xb'));var jsforce=require(_0x8a1c('0xc'));var deskjs=require(_0x8a1c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8a1c('0xe'));var Papa=require(_0x8a1c('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8a1c('0x10'));var Redis=require('ioredis');var qs=require(_0x8a1c('0x11'));var logger=require(_0x8a1c('0x12'))(_0x8a1c('0x13'));var utils=require(_0x8a1c('0x14'));var config=require(_0x8a1c('0x15'));var db=require(_0x8a1c('0x16'))['db'];function respondWithStatusCode(_0x207f04,_0x581523){_0x581523=_0x581523||0xcc;return function(_0x40a18d){if(_0x40a18d){return _0x207f04['sendStatus'](_0x581523);}return _0x207f04[_0x8a1c('0x17')](_0x581523)['end']();};}function respondWithResult(_0x599434,_0x96af74){_0x96af74=_0x96af74||0xc8;return function(_0x20110f){if(_0x20110f){return _0x599434[_0x8a1c('0x17')](_0x96af74)[_0x8a1c('0x18')](_0x20110f);}};}function respondWithFilteredResult(_0x35fc2e,_0x50e490){return function(_0x113fa9){if(_0x113fa9){var _0x456933=_0x113fa9['count'],_0x55d405=_0x50e490[_0x8a1c('0x19')],_0x7c4fa0=_0x50e490[_0x8a1c('0x19')]+_0x50e490['limit'],_0x409bf4;if(_0x7c4fa0>=_0x456933){_0x7c4fa0=_0x456933;_0x409bf4=0xc8;}else{_0x409bf4=0xce;}_0x35fc2e['status'](_0x409bf4);return _0x35fc2e['set'](_0x8a1c('0x1a'),_0x55d405+'-'+_0x7c4fa0+'/'+_0x456933)[_0x8a1c('0x18')](_0x113fa9);}return null;};}function patchUpdates(_0x461686){return function(_0x10ed5f){try{jsonpatch[_0x8a1c('0x1b')](_0x10ed5f,_0x461686,!![]);}catch(_0x4a2615){return BPromise[_0x8a1c('0x1c')](_0x4a2615);}return _0x10ed5f[_0x8a1c('0x1d')]();};}function saveUpdates(_0x2bce78,_0x29fceb){return function(_0x437f69){if(_0x437f69){return _0x437f69[_0x8a1c('0x1e')](_0x2bce78)['then'](function(_0x5bf054){return _0x5bf054;});}return null;};}function removeEntity(_0x554ef0,_0x4cede4){return function(_0x1c44ca){if(_0x1c44ca){return _0x1c44ca[_0x8a1c('0x1f')]()[_0x8a1c('0x20')](function(){_0x554ef0[_0x8a1c('0x17')](0xcc)[_0x8a1c('0x21')]();});}};}function handleEntityNotFound(_0x477523,_0x22a4c5){return function(_0x29b1ee){if(!_0x29b1ee){_0x477523[_0x8a1c('0x22')](0x194);}return _0x29b1ee;};}function handleError(_0xd872ee,_0x1ae2fb){_0x1ae2fb=_0x1ae2fb||0x1f4;return function(_0xfc2a9f){logger[_0x8a1c('0x23')](_0xfc2a9f[_0x8a1c('0x24')]);if(_0xfc2a9f[_0x8a1c('0x25')]){delete _0xfc2a9f[_0x8a1c('0x25')];}_0xd872ee[_0x8a1c('0x17')](_0x1ae2fb)[_0x8a1c('0x26')](_0xfc2a9f);};}exports[_0x8a1c('0x27')]=function(_0x26ca31,_0x2e9ef9){var _0x440831={},_0x3e1479={},_0x439ef3={'count':0x0,'rows':[]};var _0x43c102=db[_0x8a1c('0x28')][_0x8a1c('0x29')];_0x3e1479[_0x8a1c('0x2a')]=_[_0x8a1c('0x2b')](_0x43c102);_0x3e1479[_0x8a1c('0x2c')]=_[_0x8a1c('0x2b')](_0x26ca31[_0x8a1c('0x2c')]);_0x3e1479[_0x8a1c('0x2d')]=_[_0x8a1c('0x2e')](_0x3e1479[_0x8a1c('0x2a')],_0x3e1479['query']);_0x440831[_0x8a1c('0x2f')]=_[_0x8a1c('0x2e')](_0x3e1479['model'],qs[_0x8a1c('0x30')](_0x26ca31[_0x8a1c('0x2c')]['fields']));_0x440831[_0x8a1c('0x2f')]=_0x440831[_0x8a1c('0x2f')][_0x8a1c('0x31')]?_0x440831['attributes']:_0x3e1479['model'];if(!_0x26ca31['query']['hasOwnProperty'](_0x8a1c('0x32'))){_0x440831[_0x8a1c('0x33')]=qs[_0x8a1c('0x33')](_0x26ca31[_0x8a1c('0x2c')][_0x8a1c('0x33')]);_0x440831['offset']=qs['offset'](_0x26ca31[_0x8a1c('0x2c')]['offset']);}_0x440831[_0x8a1c('0x34')]=qs[_0x8a1c('0x35')](_0x26ca31['query']['sort']);_0x440831[_0x8a1c('0x36')]=qs[_0x8a1c('0x2d')](_[_0x8a1c('0x37')](_0x26ca31[_0x8a1c('0x2c')],_0x3e1479[_0x8a1c('0x2d')]));if(_0x26ca31[_0x8a1c('0x2c')][_0x8a1c('0x38')]){_0x440831[_0x8a1c('0x36')]=_[_0x8a1c('0x39')](_0x440831[_0x8a1c('0x36')],{'$or':_[_0x8a1c('0x3a')](_0x43c102,function(_0x86e43f){if(_0x86e43f[_0x8a1c('0x3b')][_0x8a1c('0x3c')]!=='VIRTUAL'){var _0x40cad2={};_0x40cad2[_0x86e43f[_0x8a1c('0x3d')]]={'$like':'%'+_0x26ca31['query'][_0x8a1c('0x38')]+'%'};return _0x40cad2;}})});}_0x440831=_[_0x8a1c('0x39')]({},_0x440831,_0x26ca31[_0x8a1c('0x3e')]);var _0x3e1b0d={'where':_0x440831[_0x8a1c('0x36')]};return db[_0x8a1c('0x28')]['count'](_0x3e1b0d)[_0x8a1c('0x20')](function(_0x31494b){_0x439ef3[_0x8a1c('0x3f')]=_0x31494b;if(_0x26ca31[_0x8a1c('0x2c')]['includeAll']){_0x440831[_0x8a1c('0x40')]=[{'all':!![]}];}return db[_0x8a1c('0x28')][_0x8a1c('0x41')](_0x440831);})[_0x8a1c('0x20')](function(_0x5b4af4){_0x439ef3[_0x8a1c('0x42')]=_0x5b4af4;return _0x439ef3;})['then'](respondWithFilteredResult(_0x2e9ef9,_0x440831))[_0x8a1c('0x43')](handleError(_0x2e9ef9,null));};exports[_0x8a1c('0x44')]=function(_0x1b790a,_0x37464f){var _0xd07531={'raw':![],'where':{'id':_0x1b790a[_0x8a1c('0x45')]['id']}},_0x420944={};_0x420944[_0x8a1c('0x2a')]=_[_0x8a1c('0x2b')](db[_0x8a1c('0x28')]['rawAttributes']);_0x420944['query']=_[_0x8a1c('0x2b')](_0x1b790a['query']);_0x420944[_0x8a1c('0x2d')]=_[_0x8a1c('0x2e')](_0x420944[_0x8a1c('0x2a')],_0x420944[_0x8a1c('0x2c')]);_0xd07531[_0x8a1c('0x2f')]=_['intersection'](_0x420944['model'],qs[_0x8a1c('0x30')](_0x1b790a['query'][_0x8a1c('0x30')]));_0xd07531[_0x8a1c('0x2f')]=_0xd07531['attributes'][_0x8a1c('0x31')]?_0xd07531[_0x8a1c('0x2f')]:_0x420944[_0x8a1c('0x2a')];if(_0x1b790a[_0x8a1c('0x2c')][_0x8a1c('0x46')]){_0xd07531['include']=[{'all':!![]}];}_0xd07531=_['merge']({},_0xd07531,_0x1b790a['options']);return db['Automation']['find'](_0xd07531)[_0x8a1c('0x20')](handleEntityNotFound(_0x37464f,null))['then'](respondWithResult(_0x37464f,null))['catch'](handleError(_0x37464f,null));};exports[_0x8a1c('0x47')]=function(_0x4b57e7,_0x576dc2){return db[_0x8a1c('0x28')][_0x8a1c('0x47')](_0x4b57e7[_0x8a1c('0x48')],{})[_0x8a1c('0x20')](respondWithResult(_0x576dc2,0xc9))[_0x8a1c('0x43')](handleError(_0x576dc2,null));};exports[_0x8a1c('0x1e')]=function(_0x55af60,_0x29dca8){if(_0x55af60[_0x8a1c('0x48')]['id']){delete _0x55af60[_0x8a1c('0x48')]['id'];}return db[_0x8a1c('0x28')][_0x8a1c('0x49')]({'where':{'id':_0x55af60['params']['id']}})[_0x8a1c('0x20')](handleEntityNotFound(_0x29dca8,null))['then'](saveUpdates(_0x55af60['body'],null))['then'](respondWithResult(_0x29dca8,null))[_0x8a1c('0x43')](handleError(_0x29dca8,null));};exports[_0x8a1c('0x1f')]=function(_0x284426,_0x52637d){return db['Automation'][_0x8a1c('0x49')]({'where':{'id':_0x284426['params']['id']}})[_0x8a1c('0x20')](handleEntityNotFound(_0x52637d,null))['then'](removeEntity(_0x52637d,null))[_0x8a1c('0x43')](handleError(_0x52637d,null));};exports[_0x8a1c('0x4a')]=function(_0x3f7609,_0x4e3ebd,_0x17e12f){return db[_0x8a1c('0x4b')][_0x8a1c('0x49')]({'where':{'id':_0x3f7609['params']['id']}})[_0x8a1c('0x20')](handleEntityNotFound(_0x4e3ebd,null))[_0x8a1c('0x20')](function(_0x45a555){if(_0x45a555){return _0x45a555[_0x8a1c('0x4a')](_0x3f7609[_0x8a1c('0x48')][_0x8a1c('0x4c')],_['omit'](_0x3f7609[_0x8a1c('0x48')],[_0x8a1c('0x4c'),'id'])||{});}})[_0x8a1c('0x20')](respondWithResult(_0x4e3ebd,null))[_0x8a1c('0x43')](handleError(_0x4e3ebd,null));};exports[_0x8a1c('0x4d')]=function(_0x1fe8cd,_0x1fabd0,_0x2b5c5a){var _0x550574={};var _0x4e9730={};var _0x2efd86;var _0x503baf;return db[_0x8a1c('0x28')][_0x8a1c('0x4e')]({'where':{'id':_0x1fe8cd[_0x8a1c('0x45')]['id']}})[_0x8a1c('0x20')](handleEntityNotFound(_0x1fabd0,null))[_0x8a1c('0x20')](function(_0x292f9b){if(_0x292f9b){_0x2efd86=_0x292f9b;_0x4e9730['model']=_['keys'](db['Condition']['rawAttributes']);_0x4e9730['query']=_[_0x8a1c('0x2b')](_0x1fe8cd[_0x8a1c('0x2c')]);_0x4e9730[_0x8a1c('0x2d')]=_[_0x8a1c('0x2e')](_0x4e9730[_0x8a1c('0x2a')],_0x4e9730[_0x8a1c('0x2c')]);_0x550574[_0x8a1c('0x2f')]=_['intersection'](_0x4e9730[_0x8a1c('0x2a')],qs['fields'](_0x1fe8cd[_0x8a1c('0x2c')]['fields']));_0x550574[_0x8a1c('0x2f')]=_0x550574[_0x8a1c('0x2f')][_0x8a1c('0x31')]?_0x550574['attributes']:_0x4e9730[_0x8a1c('0x2a')];_0x550574[_0x8a1c('0x34')]=qs[_0x8a1c('0x35')](_0x1fe8cd[_0x8a1c('0x2c')][_0x8a1c('0x35')]);_0x550574[_0x8a1c('0x36')]=qs[_0x8a1c('0x2d')](_[_0x8a1c('0x37')](_0x1fe8cd[_0x8a1c('0x2c')],_0x4e9730[_0x8a1c('0x2d')]));if(_0x1fe8cd[_0x8a1c('0x2c')][_0x8a1c('0x38')]){_0x550574['where']=_[_0x8a1c('0x39')](_0x550574[_0x8a1c('0x36')],{'$or':_[_0x8a1c('0x3a')](_0x550574[_0x8a1c('0x2f')],function(_0x1214bb){var _0x27fe2c={};_0x27fe2c[_0x1214bb]={'$like':'%'+_0x1fe8cd[_0x8a1c('0x2c')][_0x8a1c('0x38')]+'%'};return _0x27fe2c;})});}_0x550574=_[_0x8a1c('0x39')]({},_0x550574,_0x1fe8cd[_0x8a1c('0x3e')]);return _0x2efd86['getConditions'](_0x550574);}})[_0x8a1c('0x20')](function(_0x4be3f7){if(_0x4be3f7){_0x503baf=_0x4be3f7[_0x8a1c('0x31')];if(!_0x1fe8cd[_0x8a1c('0x2c')][_0x8a1c('0x4f')](_0x8a1c('0x32'))){_0x550574[_0x8a1c('0x33')]=qs[_0x8a1c('0x33')](_0x1fe8cd['query'][_0x8a1c('0x33')]);_0x550574['offset']=qs['offset'](_0x1fe8cd['query'][_0x8a1c('0x19')]);}return _0x2efd86[_0x8a1c('0x4d')](_0x550574);}})[_0x8a1c('0x20')](function(_0x36c204){if(_0x36c204){return _0x36c204?{'count':_0x503baf,'rows':_0x36c204}:null;}})['then'](respondWithResult(_0x1fabd0,null))[_0x8a1c('0x43')](handleError(_0x1fabd0,null));};exports[_0x8a1c('0x50')]=function(_0x52014a,_0x5f0fcc,_0x1ebda5){return db[_0x8a1c('0x51')][_0x8a1c('0x49')]({'where':{'id':_0x52014a[_0x8a1c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f0fcc,null))[_0x8a1c('0x20')](function(_0x321033){if(_0x321033){return _0x321033[_0x8a1c('0x50')](_0x52014a[_0x8a1c('0x48')][_0x8a1c('0x4c')],_[_0x8a1c('0x52')](_0x52014a['body'],[_0x8a1c('0x4c'),'id'])||{});}})[_0x8a1c('0x20')](respondWithResult(_0x5f0fcc,null))[_0x8a1c('0x43')](handleError(_0x5f0fcc,null));};exports[_0x8a1c('0x53')]=function(_0x51ee30,_0x571237,_0x2e5595){var _0x4ffed7={};var _0x2fd892={};var _0x192109;var _0x368e4d;return db[_0x8a1c('0x28')][_0x8a1c('0x4e')]({'where':{'id':_0x51ee30[_0x8a1c('0x45')]['id']}})[_0x8a1c('0x20')](handleEntityNotFound(_0x571237,null))[_0x8a1c('0x20')](function(_0x6716e8){if(_0x6716e8){_0x192109=_0x6716e8;_0x2fd892[_0x8a1c('0x2a')]=_['keys'](db['Action'][_0x8a1c('0x29')]);_0x2fd892[_0x8a1c('0x2c')]=_[_0x8a1c('0x2b')](_0x51ee30[_0x8a1c('0x2c')]);_0x2fd892[_0x8a1c('0x2d')]=_['intersection'](_0x2fd892[_0x8a1c('0x2a')],_0x2fd892['query']);_0x4ffed7[_0x8a1c('0x2f')]=_[_0x8a1c('0x2e')](_0x2fd892[_0x8a1c('0x2a')],qs[_0x8a1c('0x30')](_0x51ee30[_0x8a1c('0x2c')]['fields']));_0x4ffed7[_0x8a1c('0x2f')]=_0x4ffed7[_0x8a1c('0x2f')][_0x8a1c('0x31')]?_0x4ffed7[_0x8a1c('0x2f')]:_0x2fd892[_0x8a1c('0x2a')];_0x4ffed7[_0x8a1c('0x34')]=qs['sort'](_0x51ee30[_0x8a1c('0x2c')][_0x8a1c('0x35')]);_0x4ffed7['where']=qs[_0x8a1c('0x2d')](_[_0x8a1c('0x37')](_0x51ee30[_0x8a1c('0x2c')],_0x2fd892[_0x8a1c('0x2d')]));if(_0x51ee30[_0x8a1c('0x2c')][_0x8a1c('0x38')]){_0x4ffed7[_0x8a1c('0x36')]=_[_0x8a1c('0x39')](_0x4ffed7['where'],{'$or':_[_0x8a1c('0x3a')](_0x4ffed7['attributes'],function(_0x2df9ec){var _0x59b616={};_0x59b616[_0x2df9ec]={'$like':'%'+_0x51ee30[_0x8a1c('0x2c')][_0x8a1c('0x38')]+'%'};return _0x59b616;})});}_0x4ffed7=_[_0x8a1c('0x39')]({},_0x4ffed7,_0x51ee30[_0x8a1c('0x3e')]);return _0x192109[_0x8a1c('0x53')](_0x4ffed7);}})[_0x8a1c('0x20')](function(_0x47db0d){if(_0x47db0d){_0x368e4d=_0x47db0d[_0x8a1c('0x31')];if(!_0x51ee30[_0x8a1c('0x2c')][_0x8a1c('0x4f')]('nolimit')){_0x4ffed7[_0x8a1c('0x33')]=qs[_0x8a1c('0x33')](_0x51ee30[_0x8a1c('0x2c')][_0x8a1c('0x33')]);_0x4ffed7[_0x8a1c('0x19')]=qs[_0x8a1c('0x19')](_0x51ee30['query'][_0x8a1c('0x19')]);}return _0x192109[_0x8a1c('0x53')](_0x4ffed7);}})[_0x8a1c('0x20')](function(_0x43103d){if(_0x43103d){return _0x43103d?{'count':_0x368e4d,'rows':_0x43103d}:null;}})[_0x8a1c('0x20')](respondWithResult(_0x571237,null))['catch'](handleError(_0x571237,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3d8ff17..5349693 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 _0x6e27=['bluebird','request-promise','./automation.attributes','exports','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x2c3b20,_0x23bada){var _0x26f206=function(_0x44369a){while(--_0x44369a){_0x2c3b20['push'](_0x2c3b20['shift']());}};_0x26f206(++_0x23bada);}(_0x6e27,0x19f));var _0x76e2=function(_0x392244,_0x2cce87){_0x392244=_0x392244-0x0;var _0x573f60=_0x6e27[_0x392244];return _0x573f60;};'use strict';var _=require(_0x76e2('0x0'));var util=require(_0x76e2('0x1'));var logger=require(_0x76e2('0x2'))(_0x76e2('0x3'));var moment=require(_0x76e2('0x4'));var BPromise=require(_0x76e2('0x5'));var rp=require(_0x76e2('0x6'));var attributes=require(_0x76e2('0x7'));module[_0x76e2('0x8')]=function(_0x4266dd,_0x12389e){return _0x4266dd['define']('Automation',attributes,{'tableName':_0x76e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x819e=['bluebird','request-promise','./automation.attributes','define','Automation','tools_automations','util','../../config/logger','api'];(function(_0x1d5031,_0x11f58a){var _0x36ac9a=function(_0x48acef){while(--_0x48acef){_0x1d5031['push'](_0x1d5031['shift']());}};_0x36ac9a(++_0x11f58a);}(_0x819e,0x141));var _0xe819=function(_0x16fd68,_0x3d394d){_0x16fd68=_0x16fd68-0x0;var _0x12cf8e=_0x819e[_0x16fd68];return _0x12cf8e;};'use strict';var _=require('lodash');var util=require(_0xe819('0x0'));var logger=require(_0xe819('0x1'))(_0xe819('0x2'));var moment=require('moment');var BPromise=require(_0xe819('0x3'));var rp=require(_0xe819('0x4'));var attributes=require(_0xe819('0x5'));module['exports']=function(_0x446491,_0x10b349){return _0x446491[_0xe819('0x6')](_0xe819('0x7'),attributes,{'tableName':_0xe819('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 5d2d3dc..2826131 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 _0xaf97=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xaf97,0x15a));var _0x7af9=function(_0x1a7204,_0x1c0e51){_0x1a7204=_0x1a7204-0x0;var _0x52a746=_0xaf97[_0x1a7204];return _0x52a746;};'use strict';var _=require(_0x7af9('0x0'));var util=require(_0x7af9('0x1'));var moment=require(_0x7af9('0x2'));var BPromise=require(_0x7af9('0x3'));var rs=require(_0x7af9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7af9('0x5'))['db'];var utils=require(_0x7af9('0x6'));var logger=require(_0x7af9('0x7'))(_0x7af9('0x8'));var config=require('../../config/environment');var jayson=require(_0x7af9('0x9'));var client=jayson[_0x7af9('0xa')][_0x7af9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369746,_0x5c98b8,_0x1e9ccc){return new BPromise(function(_0x2055c2,_0x2963b7){return client[_0x7af9('0xc')](_0x369746,_0x1e9ccc)[_0x7af9('0xd')](function(_0x44867d){logger['info']('Automation,\x20%s,\x20%s',_0x5c98b8,_0x7af9('0xe'));logger[_0x7af9('0xf')](_0x7af9('0x10'),_0x5c98b8,'request\x20sent',JSON[_0x7af9('0x11')](_0x44867d));if(_0x44867d[_0x7af9('0x12')]){if(_0x44867d[_0x7af9('0x12')]['code']===0x1f4){logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2963b7(_0x44867d[_0x7af9('0x12')]['message']);}logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2055c2(_0x44867d['error'][_0x7af9('0x14')]);}else{logger[_0x7af9('0x15')](_0x7af9('0x13'),_0x5c98b8,_0x7af9('0xe'));_0x2055c2(_0x44867d[_0x7af9('0x16')][_0x7af9('0x14')]);}})[_0x7af9('0x17')](function(_0x238814){logger['error']('Automation,\x20%s,\x20%s',_0x5c98b8,_0x238814);_0x2963b7(_0x238814);});});} \ No newline at end of file +var _0xaa00=['Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x3a9b5d,_0xd16c5a){var _0x49ab98=function(_0x27b6c4){while(--_0x27b6c4){_0x3a9b5d['push'](_0x3a9b5d['shift']());}};_0x49ab98(++_0xd16c5a);}(_0xaa00,0x1f4));var _0x0aa0=function(_0x3e846e,_0x3e8092){_0x3e846e=_0x3e846e-0x0;var _0x4bd970=_0xaa00[_0x3e846e];return _0x4bd970;};'use strict';var _=require(_0x0aa0('0x0'));var util=require(_0x0aa0('0x1'));var moment=require(_0x0aa0('0x2'));var BPromise=require(_0x0aa0('0x3'));var rs=require(_0x0aa0('0x4'));var fs=require('fs');var Redis=require(_0x0aa0('0x5'));var db=require(_0x0aa0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aa0('0x7'))(_0x0aa0('0x8'));var config=require(_0x0aa0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0aa0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24db82,_0x49212f,_0x2524d5){return new BPromise(function(_0xa371c0,_0x47d650){return client[_0x0aa0('0xb')](_0x24db82,_0x2524d5)[_0x0aa0('0xc')](function(_0x460438){logger['info'](_0x0aa0('0xd'),_0x49212f,_0x0aa0('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x49212f,'request\x20sent',JSON[_0x0aa0('0xf')](_0x460438));if(_0x460438['error']){if(_0x460438['error']['code']===0x1f4){logger['error'](_0x0aa0('0xd'),_0x49212f,_0x460438[_0x0aa0('0x10')][_0x0aa0('0x11')]);return _0x47d650(_0x460438[_0x0aa0('0x10')][_0x0aa0('0x11')]);}logger[_0x0aa0('0x10')](_0x0aa0('0xd'),_0x49212f,_0x460438[_0x0aa0('0x10')][_0x0aa0('0x11')]);return _0xa371c0(_0x460438['error'][_0x0aa0('0x11')]);}else{logger[_0x0aa0('0x12')]('Automation,\x20%s,\x20%s',_0x49212f,'request\x20sent');_0xa371c0(_0x460438['result']['message']);}})['catch'](function(_0x3ed1e2){logger[_0x0aa0('0x10')]('Automation,\x20%s,\x20%s',_0x49212f,_0x3ed1e2);_0x47d650(_0x3ed1e2);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 24eacf8..997aedc 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 _0x2687=['./automation.controller','index','/:id','show','get','/:id/conditions','isAuthenticated','/:id/actions','getActions','create','post','addActions','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x1bcf96,_0x4cbb13){var _0x28afc4=function(_0x4f795d){while(--_0x4f795d){_0x1bcf96['push'](_0x1bcf96['shift']());}};_0x28afc4(++_0x4cbb13);}(_0x2687,0x143));var _0x7268=function(_0x8ce355,_0x51b38c){_0x8ce355=_0x8ce355-0x0;var _0x4ba014=_0x2687[_0x8ce355];return _0x4ba014;};'use strict';var multer=require(_0x7268('0x0'));var util=require(_0x7268('0x1'));var path=require(_0x7268('0x2'));var timeout=require(_0x7268('0x3'));var express=require(_0x7268('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7268('0x5'));var config=require(_0x7268('0x6'));var controller=require(_0x7268('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7268('0x8')]);router['get'](_0x7268('0x9'),auth['isAuthenticated'](),controller[_0x7268('0xa')]);router[_0x7268('0xb')](_0x7268('0xc'),auth[_0x7268('0xd')](),controller['getConditions']);router['get'](_0x7268('0xe'),auth[_0x7268('0xd')](),controller[_0x7268('0xf')]);router['post']('/',auth[_0x7268('0xd')](),controller[_0x7268('0x10')]);router[_0x7268('0x11')](_0x7268('0xc'),auth[_0x7268('0xd')](),controller['addConditions']);router['post'](_0x7268('0xe'),auth['isAuthenticated'](),controller[_0x7268('0x12')]);router['put'](_0x7268('0x9'),auth['isAuthenticated'](),controller[_0x7268('0x13')]);router['delete'](_0x7268('0x9'),auth[_0x7268('0xd')](),controller[_0x7268('0x14')]);module[_0x7268('0x15')]=router; \ No newline at end of file +var _0x0e6e=['/:id/actions','getActions','post','create','addConditions','addActions','update','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0e6e,0x14b));var _0xe0e6=function(_0x31c0af,_0x1808c0){_0x31c0af=_0x31c0af-0x0;var _0x1d4ec3=_0x0e6e[_0x31c0af];return _0x1d4ec3;};'use strict';var multer=require(_0xe0e6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe0e6('0x1'));var router=express[_0xe0e6('0x2')]();var auth=require(_0xe0e6('0x3'));var interaction=require(_0xe0e6('0x4'));var config=require(_0xe0e6('0x5'));var controller=require(_0xe0e6('0x6'));router[_0xe0e6('0x7')]('/',auth['isAuthenticated'](),controller[_0xe0e6('0x8')]);router[_0xe0e6('0x7')](_0xe0e6('0x9'),auth[_0xe0e6('0xa')](),controller[_0xe0e6('0xb')]);router['get'](_0xe0e6('0xc'),auth[_0xe0e6('0xa')](),controller[_0xe0e6('0xd')]);router[_0xe0e6('0x7')](_0xe0e6('0xe'),auth[_0xe0e6('0xa')](),controller[_0xe0e6('0xf')]);router[_0xe0e6('0x10')]('/',auth[_0xe0e6('0xa')](),controller[_0xe0e6('0x11')]);router[_0xe0e6('0x10')]('/:id/conditions',auth[_0xe0e6('0xa')](),controller[_0xe0e6('0x12')]);router[_0xe0e6('0x10')](_0xe0e6('0xe'),auth[_0xe0e6('0xa')](),controller[_0xe0e6('0x13')]);router['put'](_0xe0e6('0x9'),auth[_0xe0e6('0xa')](),controller[_0xe0e6('0x14')]);router[_0xe0e6('0x15')](_0xe0e6('0x9'),auth[_0xe0e6('0xa')](),controller['destroy']);module[_0xe0e6('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b568250..2899843 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 _0xbe5c=['Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0xbe5c,0x9d));var _0xcbe5=function(_0x3fa7e7,_0x45b8e1){_0x3fa7e7=_0x3fa7e7-0x0;var _0x56e56b=_0xbe5c[_0x3fa7e7];return _0x56e56b;};'use strict';var Sequelize=require(_0xcbe5('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbe5('0x1')],'unique':_0xcbe5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xcbe5('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xcbe5('0x1')]},'active':{'type':Sequelize[_0xcbe5('0x4')],'defaultValue':0x0,'comment':_0xcbe5('0x5')},'limitCalls':{'type':Sequelize[_0xcbe5('0x6')](0x4)[_0xcbe5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xcbe5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcbe5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcbe5('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xcbe5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xcbe5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbe5('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcbe5('0x6')](0x5)[_0xcbe5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xcbe5('0x6')](0x3)[_0xcbe5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcbe5('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xcbe5('0x6')](0x5)[_0xcbe5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbe5('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcbe5('0x6')](0x3)[_0xcbe5('0x7')],'defaultValue':0x3,'comment':_0xcbe5('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xcbe5('0x6')](0x5)[_0xcbe5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcbe5('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcbe5('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xcbe5('0xe')},'dialTimezone':{'type':Sequelize[_0xcbe5('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xcbe5('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xcbe5('0x10')](_0xcbe5('0x11'),_0xcbe5('0x12'),_0xcbe5('0x13')),'defaultValue':_0xcbe5('0x11')},'dialAMDActive':{'type':Sequelize[_0xcbe5('0x4')],'defaultValue':0x0,'comment':_0xcbe5('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xcbe5('0x6')](0x9)[_0xcbe5('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcbe5('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcbe5('0x6')](0x9)[_0xcbe5('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcbe5('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcbe5('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xcbe5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcbe5('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcbe5('0x6')](0x9)[_0xcbe5('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcbe5('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xcbe5('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcbe5('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xcbe5('0x6')](0x5)[_0xcbe5('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcbe5('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcbe5('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcbe5('0x10')](_0xcbe5('0x1d'),_0xcbe5('0x1e')),'defaultValue':_0xcbe5('0x1d')},'dialPrefix':{'type':Sequelize[_0xcbe5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcbe5('0x6')](0x3)[_0xcbe5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcbe5('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xcbe5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcbe5('0x20')}}; \ No newline at end of file +var _0x8373=['sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8373,0xb4));var _0x3837=function(_0x100f3d,_0x464de7){_0x100f3d=_0x100f3d-0x0;var _0x53caa0=_0x8373[_0x100f3d];return _0x53caa0;};'use strict';var Sequelize=require(_0x3837('0x0'));module['exports']={'name':{'type':Sequelize[_0x3837('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3837('0x2')](_0x3837('0x3')),'allowNull':![],'defaultValue':_0x3837('0x3')},'description':{'type':Sequelize[_0x3837('0x1')]},'active':{'type':Sequelize[_0x3837('0x4')],'defaultValue':0x0,'comment':_0x3837('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x3837('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3837('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3837('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3837('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3837('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3837('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3837('0x8')](0x5)[_0x3837('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3837('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'defaultValue':0x3,'comment':_0x3837('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3837('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3837('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3837('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3837('0x1')],'defaultValue':_0x3837('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x3837('0x2')](_0x3837('0x10'),_0x3837('0x11'),_0x3837('0x12')),'defaultValue':_0x3837('0x10')},'dialAMDActive':{'type':Sequelize[_0x3837('0x4')],'defaultValue':0x0,'comment':_0x3837('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x3837('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3837('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x3837('0x8')](0x9)[_0x3837('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3837('0x8')](0x9)[_0x3837('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3837('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3837('0x8')](0x9)[_0x3837('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3837('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x3837('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3837('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3837('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3837('0x8')](0x9)[_0x3837('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3837('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3837('0x8')](0x5)[_0x3837('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3837('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3837('0x8')](0x9)[_0x3837('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3837('0x2')]('DESC',_0x3837('0x1a')),'defaultValue':_0x3837('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3837('0x1c')},'dialCutDigit':{'type':Sequelize[_0x3837('0x8')](0x3)[_0x3837('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3837('0x1d')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b7933c1..39611e1 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 _0x8dfb=['select','NOW()','scheduledAt','CmListId','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','into','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','../../components/auth/service','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','IvrCampaigns','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','options','Campaign','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','UserProfileResource','params','createdAt','updatedAt','omit','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','ListId'];(function(_0x28db94,_0x165996){var _0x536455=function(_0x3a1cca){while(--_0x3a1cca){_0x28db94['push'](_0x28db94['shift']());}};_0x536455(++_0x165996);}(_0x8dfb,0x19c));var _0xb8df=function(_0x135892,_0x203263){_0x135892=_0x135892-0x0;var _0x1351d4=_0x8dfb[_0x135892];return _0x1351d4;};'use strict';var pdf=require(_0xb8df('0x0'));var emlformat=require(_0xb8df('0x1'));var rimraf=require(_0xb8df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb8df('0x3'));var moment=require(_0xb8df('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb8df('0x5'));var util=require(_0xb8df('0x6'));var path=require(_0xb8df('0x7'));var sox=require('sox');var csv=require(_0xb8df('0x8'));var ejs=require(_0xb8df('0x9'));var fs=require('fs');var _=require(_0xb8df('0xa'));var squel=require('squel');var crypto=require(_0xb8df('0xb'));var jsforce=require(_0xb8df('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8df('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xb8df('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb8df('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0xb8df('0xf'))(_0xb8df('0x10'));var utils=require('../../config/utils');var config=require(_0xb8df('0x11'));var db=require(_0xb8df('0x12'))['db'];function respondWithStatusCode(_0x318c85,_0x578a8b){_0x578a8b=_0x578a8b||0xcc;return function(_0x3babf6){if(_0x3babf6){return _0x318c85[_0xb8df('0x13')](_0x578a8b);}return _0x318c85[_0xb8df('0x14')](_0x578a8b)[_0xb8df('0x15')]();};}function respondWithResult(_0x3762ae,_0x1a086e){_0x1a086e=_0x1a086e||0xc8;return function(_0x5df889){if(_0x5df889){return _0x3762ae['status'](_0x1a086e)[_0xb8df('0x16')](_0x5df889);}};}function respondWithFilteredResult(_0x44d4db,_0x30f837){return function(_0x14f720){if(_0x14f720){var _0x38e3ba=_0x14f720[_0xb8df('0x17')],_0x445b85=_0x30f837[_0xb8df('0x18')],_0x623892=_0x30f837[_0xb8df('0x18')]+_0x30f837[_0xb8df('0x19')],_0x597685;if(_0x623892>=_0x38e3ba){_0x623892=_0x38e3ba;_0x597685=0xc8;}else{_0x597685=0xce;}_0x44d4db['status'](_0x597685);return _0x44d4db[_0xb8df('0x1a')](_0xb8df('0x1b'),_0x445b85+'-'+_0x623892+'/'+_0x38e3ba)[_0xb8df('0x16')](_0x14f720);}return null;};}function patchUpdates(_0x56a892){return function(_0x5a7f0e){try{jsonpatch[_0xb8df('0x1c')](_0x5a7f0e,_0x56a892,!![]);}catch(_0x5f11cf){return BPromise['reject'](_0x5f11cf);}return _0x5a7f0e['save']();};}function saveUpdates(_0x1cee2b,_0x45d904){return function(_0x3b694c){if(_0x3b694c){return _0x3b694c[_0xb8df('0x1d')](_0x1cee2b)[_0xb8df('0x1e')](function(_0x56f02c){return _0x56f02c;});}return null;};}function removeEntity(_0x4e3296,_0xa2a6f7){return function(_0xefed1b){if(_0xefed1b){return _0xefed1b['destroy']()[_0xb8df('0x1e')](function(){var _0x3a98a0=_0xefed1b['get']({'plain':!![]});var _0x53c915=_0xb8df('0x1f');return db['UserProfileResource'][_0xb8df('0x20')]({'where':{'type':_0x53c915,'resourceId':_0x3a98a0['id']}})['then'](function(){return _0xefed1b;});})['then'](function(){_0x4e3296[_0xb8df('0x14')](0xcc)[_0xb8df('0x15')]();});}};}function handleEntityNotFound(_0x16b57b,_0x676554){return function(_0xbc7f1b){if(!_0xbc7f1b){_0x16b57b[_0xb8df('0x13')](0x194);}return _0xbc7f1b;};}function handleError(_0x377d39,_0x1075e2){_0x1075e2=_0x1075e2||0x1f4;return function(_0x1c82d4){logger[_0xb8df('0x21')](_0x1c82d4[_0xb8df('0x22')]);if(_0x1c82d4[_0xb8df('0x23')]){delete _0x1c82d4[_0xb8df('0x23')];}_0x377d39[_0xb8df('0x14')](_0x1075e2)[_0xb8df('0x24')](_0x1c82d4);};}exports[_0xb8df('0x25')]=function(_0x2af60e,_0x374048){var _0x305207={},_0x2b6948={},_0x315050={'count':0x0,'rows':[]};var _0x35df0a=db['Campaign'][_0xb8df('0x26')];_0x2b6948[_0xb8df('0x27')]=_[_0xb8df('0x28')](_0x35df0a);_0x2b6948['query']=_[_0xb8df('0x28')](_0x2af60e[_0xb8df('0x29')]);_0x2b6948[_0xb8df('0x2a')]=_[_0xb8df('0x2b')](_0x2b6948[_0xb8df('0x27')],_0x2b6948[_0xb8df('0x29')]);_0x305207['attributes']=_[_0xb8df('0x2b')](_0x2b6948[_0xb8df('0x27')],qs['fields'](_0x2af60e[_0xb8df('0x29')][_0xb8df('0x2c')]));_0x305207[_0xb8df('0x2d')]=_0x305207[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x305207[_0xb8df('0x2d')]:_0x2b6948['model'];if(!_0x2af60e['query'][_0xb8df('0x2f')](_0xb8df('0x30'))){_0x305207['limit']=qs[_0xb8df('0x19')](_0x2af60e[_0xb8df('0x29')][_0xb8df('0x19')]);_0x305207['offset']=qs['offset'](_0x2af60e[_0xb8df('0x29')]['offset']);}_0x305207[_0xb8df('0x31')]=qs[_0xb8df('0x32')](_0x2af60e[_0xb8df('0x29')][_0xb8df('0x32')]);_0x305207[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_[_0xb8df('0x34')](_0x2af60e[_0xb8df('0x29')],_0x2b6948[_0xb8df('0x2a')]));if(_0x2af60e[_0xb8df('0x29')][_0xb8df('0x35')]){_0x305207[_0xb8df('0x33')]=_[_0xb8df('0x36')](_0x305207[_0xb8df('0x33')],{'$or':_[_0xb8df('0x37')](_0x35df0a,function(_0x1cdef6){if(_0x1cdef6['type'][_0xb8df('0x38')]!=='VIRTUAL'){var _0x1d4d81={};_0x1d4d81[_0x1cdef6[_0xb8df('0x39')]]={'$like':'%'+_0x2af60e[_0xb8df('0x29')][_0xb8df('0x35')]+'%'};return _0x1d4d81;}})});}_0x305207=_[_0xb8df('0x36')]({},_0x305207,_0x2af60e[_0xb8df('0x3a')]);var _0x5cdfd={'where':_0x305207[_0xb8df('0x33')]};return db[_0xb8df('0x3b')]['count'](_0x5cdfd)[_0xb8df('0x1e')](function(_0x571b01){_0x315050['count']=_0x571b01;if(_0x2af60e[_0xb8df('0x29')][_0xb8df('0x3c')]){_0x305207[_0xb8df('0x3d')]=[{'all':!![]}];}return db[_0xb8df('0x3b')][_0xb8df('0x3e')](_0x305207);})[_0xb8df('0x1e')](function(_0x5f54a1){_0x315050[_0xb8df('0x3f')]=_0x5f54a1;return _0x315050;})[_0xb8df('0x1e')](respondWithFilteredResult(_0x374048,_0x305207))[_0xb8df('0x40')](handleError(_0x374048,null));};exports[_0xb8df('0x41')]=function(_0x481271,_0x303427){var _0x1c139e={'raw':![],'where':{'id':_0x481271['params']['id']}},_0x51a08f={};_0x51a08f[_0xb8df('0x27')]=_[_0xb8df('0x28')](db[_0xb8df('0x3b')]['rawAttributes']);_0x51a08f[_0xb8df('0x29')]=_['keys'](_0x481271[_0xb8df('0x29')]);_0x51a08f['filters']=_[_0xb8df('0x2b')](_0x51a08f[_0xb8df('0x27')],_0x51a08f[_0xb8df('0x29')]);_0x1c139e[_0xb8df('0x2d')]=_[_0xb8df('0x2b')](_0x51a08f['model'],qs[_0xb8df('0x2c')](_0x481271[_0xb8df('0x29')][_0xb8df('0x2c')]));_0x1c139e['attributes']=_0x1c139e[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x1c139e[_0xb8df('0x2d')]:_0x51a08f[_0xb8df('0x27')];if(_0x481271[_0xb8df('0x29')][_0xb8df('0x3c')]){_0x1c139e[_0xb8df('0x3d')]=[{'all':!![]}];}_0x1c139e=_[_0xb8df('0x36')]({},_0x1c139e,_0x481271[_0xb8df('0x3a')]);return db[_0xb8df('0x3b')][_0xb8df('0x42')](_0x1c139e)[_0xb8df('0x1e')](handleEntityNotFound(_0x303427,null))[_0xb8df('0x1e')](respondWithResult(_0x303427,null))[_0xb8df('0x40')](handleError(_0x303427,null));};exports[_0xb8df('0x43')]=function(_0x3b7c32,_0x579116){return db[_0xb8df('0x3b')][_0xb8df('0x43')](_0x3b7c32[_0xb8df('0x44')],{})[_0xb8df('0x1e')](function(_0x50c418){var _0x48c2b7=_0x3b7c32[_0xb8df('0x45')]['get']({'plain':!![]});if(!_0x48c2b7)throw new Error(_0xb8df('0x46'));if(_0x48c2b7[_0xb8df('0x47')]===_0xb8df('0x45')){var _0x2cf262=_0x50c418[_0xb8df('0x48')]({'plain':!![]});var _0x5f507c=_0xb8df('0x1f');return db['UserProfileSection'][_0xb8df('0x42')]({'where':{'name':_0x5f507c,'userProfileId':_0x48c2b7['userProfileId']},'raw':!![]})[_0xb8df('0x1e')](function(_0xc3b899){if(_0xc3b899&&_0xc3b899[_0xb8df('0x49')]===0x0){return db[_0xb8df('0x4a')][_0xb8df('0x43')]({'name':_0x2cf262[_0xb8df('0x23')],'resourceId':_0x2cf262['id'],'type':_0xc3b899[_0xb8df('0x23')],'sectionId':_0xc3b899['id']},{})['then'](function(){return _0x50c418;});}else{return _0x50c418;}})['catch'](function(_0x30591a){logger[_0xb8df('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30591a);throw _0x30591a;});}return _0x50c418;})[_0xb8df('0x1e')](respondWithResult(_0x579116,0xc9))[_0xb8df('0x40')](handleError(_0x579116,null));};exports['clone']=function(_0x39fb1e,_0xa7613e){var _0x333574={'raw':![],'where':{'id':_0x39fb1e[_0xb8df('0x4b')]['id']}},_0x4d98f1={};_0x4d98f1[_0xb8df('0x27')]=_[_0xb8df('0x28')](db[_0xb8df('0x3b')][_0xb8df('0x26')]);_0x333574[_0xb8df('0x2d')]=_[_0xb8df('0x2b')](_0x4d98f1['model'],qs['fields'](_0x39fb1e[_0xb8df('0x29')]['fields']));_0x333574[_0xb8df('0x2d')]=_0x333574[_0xb8df('0x2d')]['length']?_0x333574[_0xb8df('0x2d')]:_0x4d98f1['model'];if(_0x39fb1e[_0xb8df('0x29')][_0xb8df('0x3c')]){_0x333574[_0xb8df('0x3d')]=[{'all':!![]}];}_0x333574=_[_0xb8df('0x36')]({},_0x333574,_0x39fb1e[_0xb8df('0x3a')]);return db['Campaign'][_0xb8df('0x42')](_0x333574)['then'](handleEntityNotFound(_0xa7613e,null))[_0xb8df('0x1e')](function(_0x3bbd36){if(_0x3bbd36){var _0x27fbbd=_0x3bbd36[_0xb8df('0x48')]({'plain':!![]});_0x27fbbd=qs['omit'](_0x27fbbd,['id',_0xb8df('0x4c'),_0xb8df('0x4d')]);_0x39fb1e[_0xb8df('0x44')]=_[_0xb8df('0x4e')](_0x39fb1e['body'],['id',_0xb8df('0x4c'),_0xb8df('0x4d')]);return db[_0xb8df('0x3b')][_0xb8df('0x43')](_[_0xb8df('0x36')](_0x27fbbd,_0x39fb1e[_0xb8df('0x44')]),{'include':_0x39fb1e['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb8df('0x1e')](function(_0x4e1e9a){var _0x1d2d01=_0x39fb1e[_0xb8df('0x45')][_0xb8df('0x48')]({'plain':!![]});if(!_0x1d2d01)throw new Error(_0xb8df('0x46'));if(_0x1d2d01[_0xb8df('0x47')]===_0xb8df('0x45')){var _0x7bbc9d=_0x4e1e9a['get']({'plain':!![]});var _0x5b30ff=_0xb8df('0x1f');return db[_0xb8df('0x4f')][_0xb8df('0x42')]({'where':{'name':_0x5b30ff,'userProfileId':_0x1d2d01[_0xb8df('0x50')]},'raw':!![]})[_0xb8df('0x1e')](function(_0x5ecb48){if(_0x5ecb48&&_0x5ecb48[_0xb8df('0x49')]===0x0){return db[_0xb8df('0x4a')][_0xb8df('0x43')]({'name':_0x7bbc9d[_0xb8df('0x23')],'resourceId':_0x7bbc9d['id'],'type':_0x5ecb48['name'],'sectionId':_0x5ecb48['id']},{})[_0xb8df('0x1e')](function(){return _0x4e1e9a;});}else{return _0x4e1e9a;}})[_0xb8df('0x40')](function(_0x337c9d){logger['error'](_0xb8df('0x51'),_0x337c9d);throw _0x337c9d;});}return _0x4e1e9a;});}})['then'](respondWithResult(_0xa7613e,0xc9))[_0xb8df('0x40')](handleError(_0xa7613e,null));};exports[_0xb8df('0x1d')]=function(_0x4aed25,_0x354539){if(_0x4aed25[_0xb8df('0x44')]['id']){delete _0x4aed25['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x4aed25[_0xb8df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x354539,null))[_0xb8df('0x1e')](saveUpdates(_0x4aed25[_0xb8df('0x44')],null))[_0xb8df('0x1e')](respondWithResult(_0x354539,null))[_0xb8df('0x40')](handleError(_0x354539,null));};exports[_0xb8df('0x20')]=function(_0x73aa10,_0x2b0f50){return db['Campaign'][_0xb8df('0x42')]({'where':{'id':_0x73aa10['params']['id']}})['then'](handleEntityNotFound(_0x2b0f50,null))[_0xb8df('0x1e')](removeEntity(_0x2b0f50,null))['catch'](handleError(_0x2b0f50,null));};exports[_0xb8df('0x52')]=function(_0x533a2d,_0x3d59c2,_0x2607ad){var _0x2b556f={'raw':!![],'where':{}};var _0x79008b={};var _0x237670={'count':0x0,'rows':[]};return db[_0xb8df('0x3b')]['findOne']({'where':{'id':_0x533a2d[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x3d59c2,null))['then'](function(_0x59e5d9){if(_0x59e5d9){_0x79008b['model']=_['keys'](db[_0xb8df('0x53')][_0xb8df('0x26')]);_0x79008b[_0xb8df('0x29')]=_[_0xb8df('0x28')](_0x533a2d['query']);_0x79008b['filters']=_['intersection'](_0x79008b[_0xb8df('0x27')],_0x79008b[_0xb8df('0x29')]);_0x2b556f['attributes']=_[_0xb8df('0x2b')](_0x79008b['model'],qs[_0xb8df('0x2c')](_0x533a2d[_0xb8df('0x29')][_0xb8df('0x2c')]));_0x2b556f[_0xb8df('0x2d')]=_0x2b556f[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x2b556f['attributes']:_0x79008b[_0xb8df('0x27')];if(!_0x533a2d[_0xb8df('0x29')]['hasOwnProperty']('nolimit')){_0x2b556f[_0xb8df('0x19')]=qs['limit'](_0x533a2d[_0xb8df('0x29')][_0xb8df('0x19')]);_0x2b556f[_0xb8df('0x18')]=qs['offset'](_0x533a2d['query'][_0xb8df('0x18')]);}_0x2b556f[_0xb8df('0x31')]=qs[_0xb8df('0x32')](_0x533a2d[_0xb8df('0x29')][_0xb8df('0x32')]);_0x2b556f[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_[_0xb8df('0x34')](_0x533a2d[_0xb8df('0x29')],_0x79008b['filters']));_0x2b556f['where'][_0xb8df('0x54')]=_0x59e5d9['id'];if(_0x533a2d[_0xb8df('0x29')][_0xb8df('0x35')]){_0x2b556f[_0xb8df('0x33')]=_['merge'](_0x2b556f[_0xb8df('0x33')],{'$or':_[_0xb8df('0x37')](_0x2b556f[_0xb8df('0x2d')],function(_0x5bd720){var _0x2f1b18={};_0x2f1b18[_0x5bd720]={'$like':'%'+_0x533a2d[_0xb8df('0x29')]['filter']+'%'};return _0x2f1b18;})});}_0x2b556f=_[_0xb8df('0x36')]({},_0x2b556f,_0x533a2d[_0xb8df('0x3a')]);return db[_0xb8df('0x53')][_0xb8df('0x17')]({'where':_0x2b556f[_0xb8df('0x33')]})['then'](function(_0x588783){_0x237670[_0xb8df('0x17')]=_0x588783;if(_0x533a2d[_0xb8df('0x29')]['includeAll']){_0x2b556f[_0xb8df('0x3d')]=[{'all':!![]}];}return db[_0xb8df('0x53')][_0xb8df('0x3e')](_0x2b556f);})[_0xb8df('0x1e')](function(_0x237a66){_0x237670['rows']=_0x237a66;return _0x237670;});}})[_0xb8df('0x1e')](respondWithFilteredResult(_0x3d59c2,_0x2b556f))['catch'](handleError(_0x3d59c2,null));};exports[_0xb8df('0x55')]=function(_0x47dc53,_0x4588f1,_0x2fdd98){var _0x1d83ee={'raw':!![],'where':{}};var _0x4386dc={};var _0x2b8616={'count':0x0,'rows':[]};return db[_0xb8df('0x3b')][_0xb8df('0x56')]({'where':{'id':_0x47dc53[_0xb8df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4588f1,null))['then'](function(_0x4281b4){if(_0x4281b4){_0x4386dc[_0xb8df('0x27')]=_[_0xb8df('0x28')](db[_0xb8df('0x57')]['rawAttributes']);_0x4386dc[_0xb8df('0x29')]=_[_0xb8df('0x28')](_0x47dc53[_0xb8df('0x29')]);_0x4386dc[_0xb8df('0x2a')]=_['intersection'](_0x4386dc[_0xb8df('0x27')],_0x4386dc['query']);_0x1d83ee['attributes']=_[_0xb8df('0x2b')](_0x4386dc['model'],qs[_0xb8df('0x2c')](_0x47dc53[_0xb8df('0x29')]['fields']));_0x1d83ee['attributes']=_0x1d83ee[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x1d83ee[_0xb8df('0x2d')]:_0x4386dc[_0xb8df('0x27')];if(!_0x47dc53['query'][_0xb8df('0x2f')](_0xb8df('0x30'))){_0x1d83ee['limit']=qs[_0xb8df('0x19')](_0x47dc53[_0xb8df('0x29')]['limit']);_0x1d83ee[_0xb8df('0x18')]=qs[_0xb8df('0x18')](_0x47dc53[_0xb8df('0x29')][_0xb8df('0x18')]);}_0x1d83ee[_0xb8df('0x31')]=qs['sort'](_0x47dc53['query']['sort']);_0x1d83ee[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_[_0xb8df('0x34')](_0x47dc53[_0xb8df('0x29')],_0x4386dc['filters']));_0x1d83ee['where']['CampaignId']=_0x4281b4['id'];if(_0x47dc53['query']['filter']){_0x1d83ee[_0xb8df('0x33')]=_['merge'](_0x1d83ee[_0xb8df('0x33')],{'$or':_['map'](_0x1d83ee[_0xb8df('0x2d')],function(_0x5d28bf){var _0x48ded8={};_0x48ded8[_0x5d28bf]={'$like':'%'+_0x47dc53[_0xb8df('0x29')][_0xb8df('0x35')]+'%'};return _0x48ded8;})});}_0x1d83ee=_[_0xb8df('0x36')]({},_0x1d83ee,_0x47dc53[_0xb8df('0x3a')]);return db[_0xb8df('0x57')][_0xb8df('0x17')]({'where':_0x1d83ee['where']})[_0xb8df('0x1e')](function(_0x31d8b0){_0x2b8616[_0xb8df('0x17')]=_0x31d8b0;if(_0x47dc53[_0xb8df('0x29')][_0xb8df('0x3c')]){_0x1d83ee[_0xb8df('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xb8df('0x3e')](_0x1d83ee);})['then'](function(_0x51a2c0){_0x2b8616[_0xb8df('0x3f')]=_0x51a2c0;return _0x2b8616;});}})['then'](respondWithFilteredResult(_0x4588f1,_0x1d83ee))[_0xb8df('0x40')](handleError(_0x4588f1,null));};exports[_0xb8df('0x58')]=function(_0x15c308,_0x425ff6,_0x4871b5){var _0x51a5a8={'raw':!![],'where':{}};var _0x1e4c22={};var _0x2dd6a3={'count':0x0,'rows':[]};return db[_0xb8df('0x3b')][_0xb8df('0x56')]({'where':{'id':_0x15c308[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x425ff6,null))[_0xb8df('0x1e')](function(_0x30fec5){if(_0x30fec5){_0x1e4c22[_0xb8df('0x27')]=_[_0xb8df('0x28')](db['CmHopperFinal'][_0xb8df('0x26')]);_0x1e4c22[_0xb8df('0x29')]=_['keys'](_0x15c308[_0xb8df('0x29')]);_0x1e4c22[_0xb8df('0x2a')]=_['intersection'](_0x1e4c22[_0xb8df('0x27')],_0x1e4c22[_0xb8df('0x29')]);_0x51a5a8[_0xb8df('0x2d')]=_['intersection'](_0x1e4c22[_0xb8df('0x27')],qs['fields'](_0x15c308[_0xb8df('0x29')][_0xb8df('0x2c')]));_0x51a5a8['attributes']=_0x51a5a8[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x51a5a8[_0xb8df('0x2d')]:_0x1e4c22['model'];if(!_0x15c308[_0xb8df('0x29')][_0xb8df('0x2f')]('nolimit')){_0x51a5a8['limit']=qs[_0xb8df('0x19')](_0x15c308['query']['limit']);_0x51a5a8['offset']=qs[_0xb8df('0x18')](_0x15c308['query']['offset']);}_0x51a5a8['order']=qs[_0xb8df('0x32')](_0x15c308[_0xb8df('0x29')][_0xb8df('0x32')]);_0x51a5a8[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_['pick'](_0x15c308['query'],_0x1e4c22[_0xb8df('0x2a')]));_0x51a5a8[_0xb8df('0x33')][_0xb8df('0x54')]=_0x30fec5['id'];if(_0x15c308[_0xb8df('0x29')][_0xb8df('0x35')]){_0x51a5a8[_0xb8df('0x33')]=_[_0xb8df('0x36')](_0x51a5a8[_0xb8df('0x33')],{'$or':_[_0xb8df('0x37')](_0x51a5a8[_0xb8df('0x2d')],function(_0x406b34){var _0x23a5fd={};_0x23a5fd[_0x406b34]={'$like':'%'+_0x15c308[_0xb8df('0x29')][_0xb8df('0x35')]+'%'};return _0x23a5fd;})});}_0x51a5a8=_['merge']({},_0x51a5a8,_0x15c308['options']);return db[_0xb8df('0x59')][_0xb8df('0x17')]({'where':_0x51a5a8[_0xb8df('0x33')]})['then'](function(_0x4b9920){_0x2dd6a3['count']=_0x4b9920;if(_0x15c308[_0xb8df('0x29')]['includeAll']){_0x51a5a8['include']=[{'all':!![]}];}return db[_0xb8df('0x59')][_0xb8df('0x3e')](_0x51a5a8);})[_0xb8df('0x1e')](function(_0x2a7f6e){_0x2dd6a3[_0xb8df('0x3f')]=_0x2a7f6e;return _0x2dd6a3;});}})[_0xb8df('0x1e')](respondWithFilteredResult(_0x425ff6,_0x51a5a8))[_0xb8df('0x40')](handleError(_0x425ff6,null));};exports[_0xb8df('0x5a')]=function(_0xdbc9d,_0x575b30,_0x3f8690){var _0x617612={'raw':!![],'where':{}};var _0x2c8d4e={};var _0x585edf={'count':0x0,'rows':[]};return db['Campaign'][_0xb8df('0x56')]({'where':{'id':_0xdbc9d[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x575b30,null))[_0xb8df('0x1e')](function(_0x2f9876){if(_0x2f9876){_0x2c8d4e[_0xb8df('0x27')]=_[_0xb8df('0x28')](db[_0xb8df('0x5b')][_0xb8df('0x26')]);_0x2c8d4e[_0xb8df('0x29')]=_[_0xb8df('0x28')](_0xdbc9d[_0xb8df('0x29')]);_0x2c8d4e[_0xb8df('0x2a')]=_[_0xb8df('0x2b')](_0x2c8d4e[_0xb8df('0x27')],_0x2c8d4e[_0xb8df('0x29')]);_0x617612[_0xb8df('0x2d')]=_[_0xb8df('0x2b')](_0x2c8d4e[_0xb8df('0x27')],qs['fields'](_0xdbc9d[_0xb8df('0x29')]['fields']));_0x617612['attributes']=_0x617612[_0xb8df('0x2d')]['length']?_0x617612[_0xb8df('0x2d')]:_0x2c8d4e[_0xb8df('0x27')];if(!_0xdbc9d[_0xb8df('0x29')][_0xb8df('0x2f')](_0xb8df('0x30'))){_0x617612[_0xb8df('0x19')]=qs[_0xb8df('0x19')](_0xdbc9d['query'][_0xb8df('0x19')]);_0x617612[_0xb8df('0x18')]=qs[_0xb8df('0x18')](_0xdbc9d[_0xb8df('0x29')]['offset']);}_0x617612['order']=qs['sort'](_0xdbc9d[_0xb8df('0x29')][_0xb8df('0x32')]);_0x617612[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_[_0xb8df('0x34')](_0xdbc9d['query'],_0x2c8d4e[_0xb8df('0x2a')]));_0x617612['where'][_0xb8df('0x54')]=_0x2f9876['id'];if(_0xdbc9d[_0xb8df('0x29')][_0xb8df('0x35')]){_0x617612[_0xb8df('0x33')]=_[_0xb8df('0x36')](_0x617612[_0xb8df('0x33')],{'$or':_[_0xb8df('0x37')](_0x617612[_0xb8df('0x2d')],function(_0x28e1ac){var _0x43a2d7={};_0x43a2d7[_0x28e1ac]={'$like':'%'+_0xdbc9d['query'][_0xb8df('0x35')]+'%'};return _0x43a2d7;})});}_0x617612=_[_0xb8df('0x36')]({},_0x617612,_0xdbc9d[_0xb8df('0x3a')]);return db[_0xb8df('0x5b')][_0xb8df('0x17')]({'where':_0x617612[_0xb8df('0x33')]})[_0xb8df('0x1e')](function(_0x581c42){_0x585edf[_0xb8df('0x17')]=_0x581c42;if(_0xdbc9d[_0xb8df('0x29')][_0xb8df('0x3c')]){_0x617612['include']=[{'all':!![]}];}return db[_0xb8df('0x5b')][_0xb8df('0x3e')](_0x617612);})['then'](function(_0x546650){_0x585edf[_0xb8df('0x3f')]=_0x546650;return _0x585edf;});}})[_0xb8df('0x1e')](respondWithFilteredResult(_0x575b30,_0x617612))[_0xb8df('0x40')](handleError(_0x575b30,null));};exports[_0xb8df('0x5c')]=function(_0x32a51c,_0x505785,_0x16b76c){var _0x2ff194={};var _0x185cd4={};var _0x206396;var _0x94db85;return db['Campaign'][_0xb8df('0x56')]({'where':{'id':_0x32a51c[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x505785,null))[_0xb8df('0x1e')](function(_0x37e9a1){if(_0x37e9a1){_0x206396=_0x37e9a1;_0x185cd4[_0xb8df('0x27')]=_[_0xb8df('0x28')](db['CmList']['rawAttributes']);_0x185cd4[_0xb8df('0x29')]=_[_0xb8df('0x28')](_0x32a51c['query']);_0x185cd4[_0xb8df('0x2a')]=_[_0xb8df('0x2b')](_0x185cd4[_0xb8df('0x27')],_0x185cd4['query']);_0x2ff194['attributes']=_['intersection'](_0x185cd4[_0xb8df('0x27')],qs[_0xb8df('0x2c')](_0x32a51c[_0xb8df('0x29')][_0xb8df('0x2c')]));_0x2ff194[_0xb8df('0x2d')]=_0x2ff194[_0xb8df('0x2d')]['length']?_0x2ff194['attributes']:_0x185cd4[_0xb8df('0x27')];_0x2ff194[_0xb8df('0x31')]=qs[_0xb8df('0x32')](_0x32a51c[_0xb8df('0x29')][_0xb8df('0x32')]);_0x2ff194[_0xb8df('0x33')]=qs['filters'](_[_0xb8df('0x34')](_0x32a51c['query'],_0x185cd4['filters']));if(_0x32a51c[_0xb8df('0x29')][_0xb8df('0x35')]){_0x2ff194['where']=_[_0xb8df('0x36')](_0x2ff194['where'],{'$or':_[_0xb8df('0x37')](_0x2ff194[_0xb8df('0x2d')],function(_0x24fe10){var _0x117051={};_0x117051[_0x24fe10]={'$like':'%'+_0x32a51c[_0xb8df('0x29')]['filter']+'%'};return _0x117051;})});}_0x2ff194=_['merge']({},_0x2ff194,_0x32a51c[_0xb8df('0x3a')]);return _0x206396[_0xb8df('0x5c')](_0x2ff194);}})[_0xb8df('0x1e')](function(_0x2ef9bb){if(_0x2ef9bb){_0x94db85=_0x2ef9bb[_0xb8df('0x2e')];if(!_0x32a51c['query'][_0xb8df('0x2f')](_0xb8df('0x30'))){_0x2ff194[_0xb8df('0x19')]=qs['limit'](_0x32a51c[_0xb8df('0x29')][_0xb8df('0x19')]);_0x2ff194[_0xb8df('0x18')]=qs[_0xb8df('0x18')](_0x32a51c[_0xb8df('0x29')][_0xb8df('0x18')]);}return _0x206396[_0xb8df('0x5c')](_0x2ff194);}})[_0xb8df('0x1e')](function(_0x3d18fc){if(_0x3d18fc){return _0x3d18fc?{'count':_0x94db85,'rows':_0x3d18fc}:null;}})[_0xb8df('0x1e')](respondWithResult(_0x505785,null))[_0xb8df('0x40')](handleError(_0x505785,null));};exports[_0xb8df('0x5d')]=function(_0xd0def5,_0x5f1d7a,_0x5caaf8){var _0x9897b8,_0x3a9977;return db['Campaign'][_0xb8df('0x42')]({'where':{'id':_0xd0def5[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x5f1d7a,null))[_0xb8df('0x1e')](function(_0x22ed46){if(_0x22ed46){_0x3a9977=_0x22ed46;return _0x22ed46['addLists'](_0xd0def5[_0xb8df('0x44')][_0xb8df('0x5e')],_[_0xb8df('0x4e')](_0xd0def5[_0xb8df('0x44')],[_0xb8df('0x5e'),'id'])||{});}return null;})[_0xb8df('0x5f')](function(_0x2aac3c){var _0x4e2a4d;_0x9897b8=_0x2aac3c||[];var _0x1e89f9=[];if(_0x2aac3c){for(var _0x4b96c4=0x0;_0x4b96c4<_0x2aac3c['length'];_0x4b96c4+=0x1){var _0xca48a1=_0x2aac3c[_0x4b96c4][_0xb8df('0x48')]({'plain':!![]});_0x3a9977['dialCheckDuplicateType']=_0xd0def5[_0xb8df('0x44')][_0xb8df('0x60')]?_0xd0def5[_0xb8df('0x44')][_0xb8df('0x60')]:_0x3a9977[_0xb8df('0x60')];switch(_0x3a9977[_0xb8df('0x60')]){case _0xb8df('0x61'):_0x4e2a4d=squel[_0xb8df('0x62')]()['into'](_0xb8df('0x63'))[_0xb8df('0x64')]([_0xb8df('0x65'),'scheduledAt',_0xb8df('0x66'),_0xb8df('0x67'),_0xb8df('0x54'),'createdAt',_0xb8df('0x4d')],squel[_0xb8df('0x68')]()[_0xb8df('0x39')](_0xb8df('0x65'),_0xb8df('0x65'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x6a'))[_0xb8df('0x39')]('id',_0xb8df('0x66'))[_0xb8df('0x39')](_0xca48a1[_0xb8df('0x6b')][_0xb8df('0x6c')](),_0xb8df('0x67'))[_0xb8df('0x39')](_0xd0def5[_0xb8df('0x4b')]['id']['toString'](),'CampaignId')[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4c'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4d'))['from']('cm_contacts')[_0xb8df('0x33')]('deletedAt\x20IS\x20NULL')[_0xb8df('0x33')]('ListId\x20=\x20?',_0xca48a1[_0xb8df('0x6b')]['toString']())[_0xb8df('0x33')](_0xb8df('0x6d'))[_0xb8df('0x33')](_0xb8df('0x6e'),squel[_0xb8df('0x68')]()['field'](_0xb8df('0x6f'))['from'](_0xb8df('0x70'))[_0xb8df('0x33')](_0xb8df('0x71'),_0xd0def5[_0xb8df('0x4b')]['id'][_0xb8df('0x6c')]()))[_0xb8df('0x33')](_0xb8df('0x6e'),squel[_0xb8df('0x68')]()[_0xb8df('0x39')](_0xb8df('0x72'))[_0xb8df('0x73')](_0xb8df('0x63'))[_0xb8df('0x33')](_0xb8df('0x71'),_0xd0def5[_0xb8df('0x4b')]['id'][_0xb8df('0x6c')]())))[_0xb8df('0x6c')]();break;case'onlyIfOpen':_0x4e2a4d=squel[_0xb8df('0x62')]()[_0xb8df('0x74')](_0xb8df('0x63'))[_0xb8df('0x64')]([_0xb8df('0x65'),'scheduledAt','ContactId',_0xb8df('0x67'),_0xb8df('0x54'),'createdAt',_0xb8df('0x4d')],squel['select']()['field'](_0xb8df('0x65'),_0xb8df('0x65'))[_0xb8df('0x39')]('NOW()',_0xb8df('0x6a'))[_0xb8df('0x39')]('id','ContactId')[_0xb8df('0x39')](_0xca48a1[_0xb8df('0x6b')][_0xb8df('0x6c')](),_0xb8df('0x67'))[_0xb8df('0x39')](_0xd0def5[_0xb8df('0x4b')]['id'][_0xb8df('0x6c')](),_0xb8df('0x54'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4c'))[_0xb8df('0x39')](_0xb8df('0x69'),'updatedAt')[_0xb8df('0x73')](_0xb8df('0x75'))[_0xb8df('0x33')](_0xb8df('0x76'))['where'](_0xb8df('0x77'),_0xca48a1['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xb8df('0x33')](_0xb8df('0x6e'),squel['select']()['field'](_0xb8df('0x72'))['from'](_0xb8df('0x63'))[_0xb8df('0x33')]('CampaignId\x20=\x20?',_0xd0def5[_0xb8df('0x4b')]['id'][_0xb8df('0x6c')]())))[_0xb8df('0x6c')]();break;default:_0x4e2a4d=squel[_0xb8df('0x62')]()[_0xb8df('0x74')]('cm_hopper')[_0xb8df('0x64')]([_0xb8df('0x65'),_0xb8df('0x6a'),_0xb8df('0x66'),_0xb8df('0x67'),_0xb8df('0x54'),_0xb8df('0x4c'),_0xb8df('0x4d')],squel['select']()[_0xb8df('0x39')](_0xb8df('0x65'),'phone')['field']('NOW()','scheduledAt')[_0xb8df('0x39')]('id',_0xb8df('0x66'))[_0xb8df('0x39')](_0xca48a1[_0xb8df('0x6b')][_0xb8df('0x6c')](),_0xb8df('0x67'))[_0xb8df('0x39')](_0xd0def5[_0xb8df('0x4b')]['id'][_0xb8df('0x6c')](),_0xb8df('0x54'))[_0xb8df('0x39')]('NOW()',_0xb8df('0x4c'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4d'))[_0xb8df('0x73')](_0xb8df('0x75'))[_0xb8df('0x33')]('deletedAt\x20IS\x20NULL')['where'](_0xb8df('0x77'),_0xca48a1[_0xb8df('0x6b')][_0xb8df('0x6c')]())[_0xb8df('0x33')](_0xb8df('0x6d')))['toString']();}_0x1e89f9[_0xb8df('0x78')](db[_0xb8df('0x79')]['query'](_0x4e2a4d));}return BPromise[_0xb8df('0x7a')](_0x1e89f9);}})[_0xb8df('0x1e')](function(){return _0x9897b8;})['then'](respondWithResult(_0x5f1d7a,null))[_0xb8df('0x40')](handleError(_0x5f1d7a,null));};exports[_0xb8df('0x7b')]=function(_0x5385e6,_0x69dae7,_0x336682){var _0x3d608d;return db[_0xb8df('0x3b')][_0xb8df('0x42')]({'where':{'id':_0x5385e6[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x69dae7,null))[_0xb8df('0x1e')](function(_0x5c5eb4){if(_0x5c5eb4){return _0x5c5eb4[_0xb8df('0x7b')](_0x5385e6['query'][_0xb8df('0x5e')]);}})[_0xb8df('0x1e')](function(_0x4d5776){if(_0x4d5776){_0x3d608d=_0x4d5776;return db[_0xb8df('0x53')]['destroy']({'where':{'ListId':_0x5385e6[_0xb8df('0x29')]['ids'],'CampaignId':_0x5385e6[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](function(){return _0x3d608d;});}})[_0xb8df('0x1e')](respondWithStatusCode(_0x69dae7,null))['catch'](handleError(_0x69dae7,null));};exports[_0xb8df('0x7c')]=function(_0x1a6b71,_0x4f1048,_0x2fdb84){var _0x479e65={'raw':!![],'where':{}};var _0x521e70={};var _0xb4bba6={'count':0x0,'rows':[]};return db[_0xb8df('0x3b')][_0xb8df('0x56')]({'where':{'id':_0x1a6b71[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x4f1048,null))[_0xb8df('0x1e')](function(_0x25306d){if(_0x25306d){_0x521e70[_0xb8df('0x27')]=_['keys'](db[_0xb8df('0x7d')][_0xb8df('0x26')]);_0x521e70[_0xb8df('0x29')]=_['keys'](_0x1a6b71['query']);_0x521e70[_0xb8df('0x2a')]=_[_0xb8df('0x2b')](_0x521e70[_0xb8df('0x27')],_0x521e70[_0xb8df('0x29')]);_0x479e65[_0xb8df('0x2d')]=_[_0xb8df('0x2b')](_0x521e70[_0xb8df('0x27')],qs[_0xb8df('0x2c')](_0x1a6b71['query'][_0xb8df('0x2c')]));_0x479e65[_0xb8df('0x2d')]=_0x479e65[_0xb8df('0x2d')][_0xb8df('0x2e')]?_0x479e65[_0xb8df('0x2d')]:_0x521e70['model'];if(!_0x1a6b71[_0xb8df('0x29')][_0xb8df('0x2f')](_0xb8df('0x30'))){_0x479e65[_0xb8df('0x19')]=qs[_0xb8df('0x19')](_0x1a6b71['query'][_0xb8df('0x19')]);_0x479e65[_0xb8df('0x18')]=qs['offset'](_0x1a6b71[_0xb8df('0x29')][_0xb8df('0x18')]);}_0x479e65[_0xb8df('0x31')]=qs[_0xb8df('0x32')](_0x1a6b71[_0xb8df('0x29')][_0xb8df('0x32')]);_0x479e65[_0xb8df('0x33')]=qs[_0xb8df('0x2a')](_[_0xb8df('0x34')](_0x1a6b71[_0xb8df('0x29')],_0x521e70['filters']));_0x479e65[_0xb8df('0x33')]['CampaignId']=_0x25306d['id'];if(_0x1a6b71[_0xb8df('0x29')]['filter']){_0x479e65[_0xb8df('0x33')]=_['merge'](_0x479e65[_0xb8df('0x33')],{'$or':_[_0xb8df('0x37')](_0x479e65[_0xb8df('0x2d')],function(_0x5ee040){var _0x1b7359={};_0x1b7359[_0x5ee040]={'$like':'%'+_0x1a6b71[_0xb8df('0x29')][_0xb8df('0x35')]+'%'};return _0x1b7359;})});}_0x479e65=_['merge']({},_0x479e65,_0x1a6b71[_0xb8df('0x3a')]);return db[_0xb8df('0x7d')][_0xb8df('0x17')]({'where':_0x479e65[_0xb8df('0x33')]})[_0xb8df('0x1e')](function(_0x1ef98){_0xb4bba6[_0xb8df('0x17')]=_0x1ef98;if(_0x1a6b71['query'][_0xb8df('0x3c')]){_0x479e65[_0xb8df('0x3d')]=[{'all':!![]}];}return db[_0xb8df('0x7d')][_0xb8df('0x3e')](_0x479e65);})['then'](function(_0x58f753){_0xb4bba6[_0xb8df('0x3f')]=_0x58f753;return _0xb4bba6;});}})[_0xb8df('0x1e')](respondWithFilteredResult(_0x4f1048,_0x479e65))[_0xb8df('0x40')](handleError(_0x4f1048,null));};exports['addBlackLists']=function(_0x58b09b,_0x19adca,_0x24074a){var _0x360863,_0xb08dab;return db[_0xb8df('0x3b')]['find']({'where':{'id':_0x58b09b[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x19adca,null))['then'](function(_0x46586c){if(_0x46586c){_0xb08dab=_0x46586c;return _0x46586c[_0xb8df('0x7e')](_0x58b09b[_0xb8df('0x44')]['ids'],_[_0xb8df('0x4e')](_0x58b09b['body'],[_0xb8df('0x5e'),'id'])||{});}return null;})[_0xb8df('0x5f')](function(_0x37dfe6){var _0x354dc8;_0x360863=_0x37dfe6||[];var _0x4679dc=[];if(_0x37dfe6){for(var _0x11b1cc=0x0;_0x11b1cc<_0x37dfe6[_0xb8df('0x2e')];_0x11b1cc+=0x1){var _0x44158f=_0x37dfe6[_0x11b1cc][_0xb8df('0x48')]({'plain':!![]});_0x354dc8=squel[_0xb8df('0x62')]()['into'](_0xb8df('0x7f'))['fromQuery'](['phone','ContactId',_0xb8df('0x67'),_0xb8df('0x54'),_0xb8df('0x4c'),_0xb8df('0x4d')],squel[_0xb8df('0x68')]()[_0xb8df('0x39')]('phone','phone')[_0xb8df('0x39')]('id','ContactId')[_0xb8df('0x39')](_0x44158f['CmListId']['toString'](),_0xb8df('0x67'))[_0xb8df('0x39')](_0x58b09b['params']['id'][_0xb8df('0x6c')](),_0xb8df('0x54'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4c'))[_0xb8df('0x39')](_0xb8df('0x69'),_0xb8df('0x4d'))[_0xb8df('0x73')](_0xb8df('0x75'))[_0xb8df('0x33')](_0xb8df('0x76'))[_0xb8df('0x33')](_0xb8df('0x77'),_0x44158f[_0xb8df('0x6b')]['toString']())[_0xb8df('0x33')](_0xb8df('0x6d')))['toString']();_0x4679dc[_0xb8df('0x78')](db[_0xb8df('0x79')][_0xb8df('0x29')](_0x354dc8));}return BPromise['all'](_0x4679dc);}})[_0xb8df('0x1e')](function(){return _0x360863;})[_0xb8df('0x1e')](respondWithResult(_0x19adca,null))[_0xb8df('0x40')](handleError(_0x19adca,null));};exports[_0xb8df('0x80')]=function(_0x18eef9,_0x3b7969,_0x3a4163){var _0x5f569f;return db[_0xb8df('0x3b')][_0xb8df('0x42')]({'where':{'id':_0x18eef9[_0xb8df('0x4b')]['id']}})[_0xb8df('0x1e')](handleEntityNotFound(_0x3b7969,null))[_0xb8df('0x1e')](function(_0xaa2e8c){if(_0xaa2e8c){return _0xaa2e8c['removeBlackLists'](_0x18eef9[_0xb8df('0x29')][_0xb8df('0x5e')]);}})['then'](function(_0x1a1d68){if(_0x1a1d68){_0x5f569f=_0x1a1d68;return db[_0xb8df('0x5b')][_0xb8df('0x20')]({'where':{'ListId':_0x18eef9['query'][_0xb8df('0x5e')],'CampaignId':_0x18eef9['params']['id']}})[_0xb8df('0x1e')](function(){return _0x5f569f;});}})['then'](respondWithStatusCode(_0x3b7969,null))[_0xb8df('0x40')](handleError(_0x3b7969,null));}; \ No newline at end of file +var _0x9c54=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','name','send','index','Campaign','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','update','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','field','phone','ContactId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','select','sequelize','all','removeLists','CmList','addBlackLists','spread','cm_hopper_black','removeBlackLists'];(function(_0x4cddd1,_0x3b49c8){var _0x3edb96=function(_0x14339d){while(--_0x14339d){_0x4cddd1['push'](_0x4cddd1['shift']());}};_0x3edb96(++_0x3b49c8);}(_0x9c54,0x110));var _0x49c5=function(_0x4f54eb,_0x5a9643){_0x4f54eb=_0x4f54eb-0x0;var _0x475c1c=_0x9c54[_0x4f54eb];return _0x475c1c;};'use strict';var pdf=require(_0x49c5('0x0'));var emlformat=require(_0x49c5('0x1'));var rimraf=require(_0x49c5('0x2'));var zipdir=require(_0x49c5('0x3'));var jsonpatch=require(_0x49c5('0x4'));var rp=require(_0x49c5('0x5'));var moment=require('moment');var BPromise=require(_0x49c5('0x6'));var Mustache=require(_0x49c5('0x7'));var util=require(_0x49c5('0x8'));var path=require(_0x49c5('0x9'));var sox=require(_0x49c5('0xa'));var csv=require(_0x49c5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x49c5('0xc'));var squel=require(_0x49c5('0xd'));var crypto=require(_0x49c5('0xe'));var jsforce=require(_0x49c5('0xf'));var deskjs=require(_0x49c5('0x10'));var toCsv=require(_0x49c5('0xb'));var querystring=require('querystring');var Papa=require(_0x49c5('0x11'));var authService=require(_0x49c5('0x12'));var hardwareService=require(_0x49c5('0x13'));var Redis=require('ioredis');var qs=require(_0x49c5('0x14'));var logger=require(_0x49c5('0x15'))('api');var utils=require(_0x49c5('0x16'));var config=require(_0x49c5('0x17'));var db=require(_0x49c5('0x18'))['db'];function respondWithStatusCode(_0x30fca4,_0x49b83c){_0x49b83c=_0x49b83c||0xcc;return function(_0x2a566f){if(_0x2a566f){return _0x30fca4[_0x49c5('0x19')](_0x49b83c);}return _0x30fca4[_0x49c5('0x1a')](_0x49b83c)[_0x49c5('0x1b')]();};}function respondWithResult(_0x591099,_0x49d52a){_0x49d52a=_0x49d52a||0xc8;return function(_0x5b1a8b){if(_0x5b1a8b){return _0x591099[_0x49c5('0x1a')](_0x49d52a)[_0x49c5('0x1c')](_0x5b1a8b);}};}function respondWithFilteredResult(_0x2d3e7b,_0x3bcf7d){return function(_0x2b9145){if(_0x2b9145){var _0x3cefc9=_0x2b9145[_0x49c5('0x1d')],_0x1b8324=_0x3bcf7d[_0x49c5('0x1e')],_0x5ec058=_0x3bcf7d[_0x49c5('0x1e')]+_0x3bcf7d[_0x49c5('0x1f')],_0x2569b4;if(_0x5ec058>=_0x3cefc9){_0x5ec058=_0x3cefc9;_0x2569b4=0xc8;}else{_0x2569b4=0xce;}_0x2d3e7b[_0x49c5('0x1a')](_0x2569b4);return _0x2d3e7b[_0x49c5('0x20')](_0x49c5('0x21'),_0x1b8324+'-'+_0x5ec058+'/'+_0x3cefc9)[_0x49c5('0x1c')](_0x2b9145);}return null;};}function patchUpdates(_0x496c1c){return function(_0x50d5d0){try{jsonpatch[_0x49c5('0x22')](_0x50d5d0,_0x496c1c,!![]);}catch(_0xd2b5fe){return BPromise[_0x49c5('0x23')](_0xd2b5fe);}return _0x50d5d0[_0x49c5('0x24')]();};}function saveUpdates(_0x5bf223,_0x46305){return function(_0x46c608){if(_0x46c608){return _0x46c608['update'](_0x5bf223)[_0x49c5('0x25')](function(_0x509bfb){return _0x509bfb;});}return null;};}function removeEntity(_0x127167,_0x27a2b3){return function(_0x454af7){if(_0x454af7){return _0x454af7[_0x49c5('0x26')]()[_0x49c5('0x25')](function(){var _0x3e44d2=_0x454af7['get']({'plain':!![]});var _0x349276=_0x49c5('0x27');return db[_0x49c5('0x28')][_0x49c5('0x26')]({'where':{'type':_0x349276,'resourceId':_0x3e44d2['id']}})[_0x49c5('0x25')](function(){return _0x454af7;});})[_0x49c5('0x25')](function(){_0x127167[_0x49c5('0x1a')](0xcc)[_0x49c5('0x1b')]();});}};}function handleEntityNotFound(_0x2cd689,_0x27429d){return function(_0x361836){if(!_0x361836){_0x2cd689[_0x49c5('0x19')](0x194);}return _0x361836;};}function handleError(_0x242bb6,_0x3d522d){_0x3d522d=_0x3d522d||0x1f4;return function(_0x4f8288){logger[_0x49c5('0x29')](_0x4f8288['stack']);if(_0x4f8288['name']){delete _0x4f8288[_0x49c5('0x2a')];}_0x242bb6[_0x49c5('0x1a')](_0x3d522d)[_0x49c5('0x2b')](_0x4f8288);};}exports[_0x49c5('0x2c')]=function(_0x435686,_0x43d518){var _0x5c7d2f={},_0x1e10b9={},_0x18aea0={'count':0x0,'rows':[]};var _0x4d631a=db[_0x49c5('0x2d')][_0x49c5('0x2e')];_0x1e10b9[_0x49c5('0x2f')]=_['keys'](_0x4d631a);_0x1e10b9[_0x49c5('0x30')]=_['keys'](_0x435686[_0x49c5('0x30')]);_0x1e10b9[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x1e10b9[_0x49c5('0x2f')],_0x1e10b9[_0x49c5('0x30')]);_0x5c7d2f[_0x49c5('0x33')]=_[_0x49c5('0x32')](_0x1e10b9[_0x49c5('0x2f')],qs['fields'](_0x435686[_0x49c5('0x30')][_0x49c5('0x34')]));_0x5c7d2f['attributes']=_0x5c7d2f[_0x49c5('0x33')][_0x49c5('0x35')]?_0x5c7d2f[_0x49c5('0x33')]:_0x1e10b9[_0x49c5('0x2f')];if(!_0x435686[_0x49c5('0x30')][_0x49c5('0x36')]('nolimit')){_0x5c7d2f[_0x49c5('0x1f')]=qs['limit'](_0x435686[_0x49c5('0x30')][_0x49c5('0x1f')]);_0x5c7d2f[_0x49c5('0x1e')]=qs[_0x49c5('0x1e')](_0x435686[_0x49c5('0x30')][_0x49c5('0x1e')]);}_0x5c7d2f[_0x49c5('0x37')]=qs[_0x49c5('0x38')](_0x435686[_0x49c5('0x30')][_0x49c5('0x38')]);_0x5c7d2f['where']=qs['filters'](_[_0x49c5('0x39')](_0x435686[_0x49c5('0x30')],_0x1e10b9[_0x49c5('0x31')]));if(_0x435686[_0x49c5('0x30')]['filter']){_0x5c7d2f[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0x5c7d2f[_0x49c5('0x3a')],{'$or':_[_0x49c5('0x3c')](_0x4d631a,function(_0x314333){if(_0x314333['type'][_0x49c5('0x3d')]!==_0x49c5('0x3e')){var _0x57855e={};_0x57855e[_0x314333['field']]={'$like':'%'+_0x435686[_0x49c5('0x30')][_0x49c5('0x3f')]+'%'};return _0x57855e;}})});}_0x5c7d2f=_[_0x49c5('0x3b')]({},_0x5c7d2f,_0x435686[_0x49c5('0x40')]);var _0x457a7c={'where':_0x5c7d2f[_0x49c5('0x3a')]};return db[_0x49c5('0x2d')][_0x49c5('0x1d')](_0x457a7c)[_0x49c5('0x25')](function(_0x2d3b1b){_0x18aea0['count']=_0x2d3b1b;if(_0x435686[_0x49c5('0x30')][_0x49c5('0x41')]){_0x5c7d2f[_0x49c5('0x42')]=[{'all':!![]}];}return db['Campaign'][_0x49c5('0x43')](_0x5c7d2f);})[_0x49c5('0x25')](function(_0x40c977){_0x18aea0[_0x49c5('0x44')]=_0x40c977;return _0x18aea0;})[_0x49c5('0x25')](respondWithFilteredResult(_0x43d518,_0x5c7d2f))[_0x49c5('0x45')](handleError(_0x43d518,null));};exports[_0x49c5('0x46')]=function(_0x459cab,_0x280560){var _0x3b3290={'raw':![],'where':{'id':_0x459cab[_0x49c5('0x47')]['id']}},_0x2621af={};_0x2621af[_0x49c5('0x2f')]=_['keys'](db[_0x49c5('0x2d')]['rawAttributes']);_0x2621af[_0x49c5('0x30')]=_[_0x49c5('0x48')](_0x459cab[_0x49c5('0x30')]);_0x2621af[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x2621af['model'],_0x2621af[_0x49c5('0x30')]);_0x3b3290[_0x49c5('0x33')]=_[_0x49c5('0x32')](_0x2621af['model'],qs['fields'](_0x459cab[_0x49c5('0x30')][_0x49c5('0x34')]));_0x3b3290[_0x49c5('0x33')]=_0x3b3290['attributes']['length']?_0x3b3290[_0x49c5('0x33')]:_0x2621af[_0x49c5('0x2f')];if(_0x459cab['query'][_0x49c5('0x41')]){_0x3b3290[_0x49c5('0x42')]=[{'all':!![]}];}_0x3b3290=_[_0x49c5('0x3b')]({},_0x3b3290,_0x459cab[_0x49c5('0x40')]);return db[_0x49c5('0x2d')][_0x49c5('0x49')](_0x3b3290)['then'](handleEntityNotFound(_0x280560,null))[_0x49c5('0x25')](respondWithResult(_0x280560,null))[_0x49c5('0x45')](handleError(_0x280560,null));};exports[_0x49c5('0x4a')]=function(_0x26196e,_0xbd7284){return db['Campaign']['create'](_0x26196e[_0x49c5('0x4b')],{})[_0x49c5('0x25')](function(_0x582877){var _0x53ed11=_0x26196e[_0x49c5('0x4c')][_0x49c5('0x4d')]({'plain':!![]});if(!_0x53ed11)throw new Error(_0x49c5('0x4e'));if(_0x53ed11[_0x49c5('0x4f')]===_0x49c5('0x4c')){var _0xbf0960=_0x582877[_0x49c5('0x4d')]({'plain':!![]});var _0x225b23=_0x49c5('0x27');return db[_0x49c5('0x50')]['find']({'where':{'name':_0x225b23,'userProfileId':_0x53ed11[_0x49c5('0x51')]},'raw':!![]})['then'](function(_0xedaa8c){if(_0xedaa8c&&_0xedaa8c[_0x49c5('0x52')]===0x0){return db[_0x49c5('0x28')][_0x49c5('0x4a')]({'name':_0xbf0960[_0x49c5('0x2a')],'resourceId':_0xbf0960['id'],'type':_0xedaa8c[_0x49c5('0x2a')],'sectionId':_0xedaa8c['id']},{})[_0x49c5('0x25')](function(){return _0x582877;});}else{return _0x582877;}})[_0x49c5('0x45')](function(_0x5d5673){logger[_0x49c5('0x29')](_0x49c5('0x53'),_0x5d5673);throw _0x5d5673;});}return _0x582877;})['then'](respondWithResult(_0xbd7284,0xc9))[_0x49c5('0x45')](handleError(_0xbd7284,null));};exports[_0x49c5('0x54')]=function(_0x131ca2,_0x10faf1){var _0x206cdb={'raw':![],'where':{'id':_0x131ca2['params']['id']}},_0x44aceb={};_0x44aceb['model']=_[_0x49c5('0x48')](db[_0x49c5('0x2d')][_0x49c5('0x2e')]);_0x206cdb['attributes']=_[_0x49c5('0x32')](_0x44aceb[_0x49c5('0x2f')],qs[_0x49c5('0x34')](_0x131ca2['query']['fields']));_0x206cdb[_0x49c5('0x33')]=_0x206cdb[_0x49c5('0x33')][_0x49c5('0x35')]?_0x206cdb[_0x49c5('0x33')]:_0x44aceb[_0x49c5('0x2f')];if(_0x131ca2[_0x49c5('0x30')][_0x49c5('0x41')]){_0x206cdb['include']=[{'all':!![]}];}_0x206cdb=_['merge']({},_0x206cdb,_0x131ca2[_0x49c5('0x40')]);return db[_0x49c5('0x2d')][_0x49c5('0x49')](_0x206cdb)[_0x49c5('0x25')](handleEntityNotFound(_0x10faf1,null))[_0x49c5('0x25')](function(_0x42f4ed){if(_0x42f4ed){var _0x5e173c=_0x42f4ed[_0x49c5('0x4d')]({'plain':!![]});_0x5e173c=qs['omit'](_0x5e173c,['id',_0x49c5('0x55'),'updatedAt']);_0x131ca2['body']=_[_0x49c5('0x56')](_0x131ca2[_0x49c5('0x4b')],['id','createdAt',_0x49c5('0x57')]);return db[_0x49c5('0x2d')][_0x49c5('0x4a')](_['merge'](_0x5e173c,_0x131ca2[_0x49c5('0x4b')]),{'include':_0x131ca2[_0x49c5('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x43e459){var _0x4f95a7=_0x131ca2[_0x49c5('0x4c')]['get']({'plain':!![]});if(!_0x4f95a7)throw new Error(_0x49c5('0x4e'));if(_0x4f95a7['role']==='user'){var _0x422839=_0x43e459[_0x49c5('0x4d')]({'plain':!![]});var _0x3dfb4f=_0x49c5('0x27');return db[_0x49c5('0x50')][_0x49c5('0x49')]({'where':{'name':_0x3dfb4f,'userProfileId':_0x4f95a7[_0x49c5('0x51')]},'raw':!![]})[_0x49c5('0x25')](function(_0x28dec1){if(_0x28dec1&&_0x28dec1[_0x49c5('0x52')]===0x0){return db[_0x49c5('0x28')]['create']({'name':_0x422839[_0x49c5('0x2a')],'resourceId':_0x422839['id'],'type':_0x28dec1[_0x49c5('0x2a')],'sectionId':_0x28dec1['id']},{})['then'](function(){return _0x43e459;});}else{return _0x43e459;}})[_0x49c5('0x45')](function(_0x4116f7){logger[_0x49c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4116f7);throw _0x4116f7;});}return _0x43e459;});}})['then'](respondWithResult(_0x10faf1,0xc9))['catch'](handleError(_0x10faf1,null));};exports[_0x49c5('0x58')]=function(_0x466d93,_0x1f2a35){if(_0x466d93[_0x49c5('0x4b')]['id']){delete _0x466d93['body']['id'];}return db['Campaign'][_0x49c5('0x49')]({'where':{'id':_0x466d93[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x1f2a35,null))[_0x49c5('0x25')](saveUpdates(_0x466d93[_0x49c5('0x4b')],null))[_0x49c5('0x25')](respondWithResult(_0x1f2a35,null))[_0x49c5('0x45')](handleError(_0x1f2a35,null));};exports['destroy']=function(_0x149e3a,_0x5d6178){return db[_0x49c5('0x2d')]['find']({'where':{'id':_0x149e3a[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x5d6178,null))[_0x49c5('0x25')](removeEntity(_0x5d6178,null))['catch'](handleError(_0x5d6178,null));};exports[_0x49c5('0x59')]=function(_0x9b342a,_0x2e9c26,_0x20b96e){var _0xe7611={'raw':!![],'where':{}};var _0x4ffcce={};var _0xdc2493={'count':0x0,'rows':[]};return db[_0x49c5('0x2d')][_0x49c5('0x5a')]({'where':{'id':_0x9b342a[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x2e9c26,null))[_0x49c5('0x25')](function(_0x1dbc24){if(_0x1dbc24){_0x4ffcce[_0x49c5('0x2f')]=_[_0x49c5('0x48')](db[_0x49c5('0x5b')][_0x49c5('0x2e')]);_0x4ffcce[_0x49c5('0x30')]=_[_0x49c5('0x48')](_0x9b342a[_0x49c5('0x30')]);_0x4ffcce[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x4ffcce[_0x49c5('0x2f')],_0x4ffcce['query']);_0xe7611[_0x49c5('0x33')]=_[_0x49c5('0x32')](_0x4ffcce[_0x49c5('0x2f')],qs[_0x49c5('0x34')](_0x9b342a['query'][_0x49c5('0x34')]));_0xe7611[_0x49c5('0x33')]=_0xe7611[_0x49c5('0x33')]['length']?_0xe7611[_0x49c5('0x33')]:_0x4ffcce['model'];if(!_0x9b342a['query']['hasOwnProperty']('nolimit')){_0xe7611[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x9b342a['query']['limit']);_0xe7611[_0x49c5('0x1e')]=qs[_0x49c5('0x1e')](_0x9b342a[_0x49c5('0x30')]['offset']);}_0xe7611['order']=qs[_0x49c5('0x38')](_0x9b342a[_0x49c5('0x30')][_0x49c5('0x38')]);_0xe7611[_0x49c5('0x3a')]=qs['filters'](_[_0x49c5('0x39')](_0x9b342a['query'],_0x4ffcce[_0x49c5('0x31')]));_0xe7611['where'][_0x49c5('0x5c')]=_0x1dbc24['id'];if(_0x9b342a[_0x49c5('0x30')][_0x49c5('0x3f')]){_0xe7611[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0xe7611[_0x49c5('0x3a')],{'$or':_['map'](_0xe7611[_0x49c5('0x33')],function(_0x2eb05e){var _0x24e203={};_0x24e203[_0x2eb05e]={'$like':'%'+_0x9b342a[_0x49c5('0x30')][_0x49c5('0x3f')]+'%'};return _0x24e203;})});}_0xe7611=_[_0x49c5('0x3b')]({},_0xe7611,_0x9b342a[_0x49c5('0x40')]);return db[_0x49c5('0x5b')]['count']({'where':_0xe7611[_0x49c5('0x3a')]})['then'](function(_0x1ffc8c){_0xdc2493[_0x49c5('0x1d')]=_0x1ffc8c;if(_0x9b342a['query'][_0x49c5('0x41')]){_0xe7611[_0x49c5('0x42')]=[{'all':!![]}];}return db[_0x49c5('0x5b')][_0x49c5('0x43')](_0xe7611);})[_0x49c5('0x25')](function(_0x509d43){_0xdc2493[_0x49c5('0x44')]=_0x509d43;return _0xdc2493;});}})[_0x49c5('0x25')](respondWithFilteredResult(_0x2e9c26,_0xe7611))[_0x49c5('0x45')](handleError(_0x2e9c26,null));};exports[_0x49c5('0x5d')]=function(_0x1eaa38,_0x2553cd,_0x37c265){var _0x3fe8e7={'raw':!![],'where':{}};var _0x5f0188={};var _0x3fb5f8={'count':0x0,'rows':[]};return db[_0x49c5('0x2d')][_0x49c5('0x5a')]({'where':{'id':_0x1eaa38[_0x49c5('0x47')]['id']}})['then'](handleEntityNotFound(_0x2553cd,null))['then'](function(_0x5ece75){if(_0x5ece75){_0x5f0188[_0x49c5('0x2f')]=_[_0x49c5('0x48')](db[_0x49c5('0x5e')][_0x49c5('0x2e')]);_0x5f0188[_0x49c5('0x30')]=_['keys'](_0x1eaa38['query']);_0x5f0188[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x5f0188[_0x49c5('0x2f')],_0x5f0188[_0x49c5('0x30')]);_0x3fe8e7[_0x49c5('0x33')]=_['intersection'](_0x5f0188['model'],qs[_0x49c5('0x34')](_0x1eaa38[_0x49c5('0x30')][_0x49c5('0x34')]));_0x3fe8e7['attributes']=_0x3fe8e7['attributes']['length']?_0x3fe8e7[_0x49c5('0x33')]:_0x5f0188['model'];if(!_0x1eaa38['query'][_0x49c5('0x36')](_0x49c5('0x5f'))){_0x3fe8e7[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x1eaa38[_0x49c5('0x30')][_0x49c5('0x1f')]);_0x3fe8e7[_0x49c5('0x1e')]=qs['offset'](_0x1eaa38[_0x49c5('0x30')][_0x49c5('0x1e')]);}_0x3fe8e7['order']=qs[_0x49c5('0x38')](_0x1eaa38[_0x49c5('0x30')][_0x49c5('0x38')]);_0x3fe8e7[_0x49c5('0x3a')]=qs[_0x49c5('0x31')](_[_0x49c5('0x39')](_0x1eaa38['query'],_0x5f0188['filters']));_0x3fe8e7[_0x49c5('0x3a')][_0x49c5('0x5c')]=_0x5ece75['id'];if(_0x1eaa38[_0x49c5('0x30')][_0x49c5('0x3f')]){_0x3fe8e7[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0x3fe8e7[_0x49c5('0x3a')],{'$or':_['map'](_0x3fe8e7[_0x49c5('0x33')],function(_0x15c44b){var _0x4c6400={};_0x4c6400[_0x15c44b]={'$like':'%'+_0x1eaa38['query'][_0x49c5('0x3f')]+'%'};return _0x4c6400;})});}_0x3fe8e7=_['merge']({},_0x3fe8e7,_0x1eaa38['options']);return db[_0x49c5('0x5e')]['count']({'where':_0x3fe8e7[_0x49c5('0x3a')]})[_0x49c5('0x25')](function(_0x1d148f){_0x3fb5f8['count']=_0x1d148f;if(_0x1eaa38[_0x49c5('0x30')]['includeAll']){_0x3fe8e7[_0x49c5('0x42')]=[{'all':!![]}];}return db[_0x49c5('0x5e')][_0x49c5('0x43')](_0x3fe8e7);})[_0x49c5('0x25')](function(_0x256134){_0x3fb5f8[_0x49c5('0x44')]=_0x256134;return _0x3fb5f8;});}})[_0x49c5('0x25')](respondWithFilteredResult(_0x2553cd,_0x3fe8e7))[_0x49c5('0x45')](handleError(_0x2553cd,null));};exports[_0x49c5('0x60')]=function(_0x58d676,_0x4db425,_0x41ba3){var _0xc57ac5={'raw':!![],'where':{}};var _0x5956e7={};var _0x4f14b4={'count':0x0,'rows':[]};return db[_0x49c5('0x2d')]['findOne']({'where':{'id':_0x58d676[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x4db425,null))[_0x49c5('0x25')](function(_0x55abf){if(_0x55abf){_0x5956e7[_0x49c5('0x2f')]=_[_0x49c5('0x48')](db[_0x49c5('0x61')]['rawAttributes']);_0x5956e7[_0x49c5('0x30')]=_[_0x49c5('0x48')](_0x58d676[_0x49c5('0x30')]);_0x5956e7['filters']=_[_0x49c5('0x32')](_0x5956e7[_0x49c5('0x2f')],_0x5956e7[_0x49c5('0x30')]);_0xc57ac5[_0x49c5('0x33')]=_[_0x49c5('0x32')](_0x5956e7['model'],qs[_0x49c5('0x34')](_0x58d676['query']['fields']));_0xc57ac5[_0x49c5('0x33')]=_0xc57ac5[_0x49c5('0x33')]['length']?_0xc57ac5[_0x49c5('0x33')]:_0x5956e7['model'];if(!_0x58d676[_0x49c5('0x30')][_0x49c5('0x36')](_0x49c5('0x5f'))){_0xc57ac5[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x58d676[_0x49c5('0x30')]['limit']);_0xc57ac5[_0x49c5('0x1e')]=qs[_0x49c5('0x1e')](_0x58d676[_0x49c5('0x30')][_0x49c5('0x1e')]);}_0xc57ac5['order']=qs[_0x49c5('0x38')](_0x58d676[_0x49c5('0x30')][_0x49c5('0x38')]);_0xc57ac5[_0x49c5('0x3a')]=qs[_0x49c5('0x31')](_[_0x49c5('0x39')](_0x58d676[_0x49c5('0x30')],_0x5956e7['filters']));_0xc57ac5[_0x49c5('0x3a')][_0x49c5('0x5c')]=_0x55abf['id'];if(_0x58d676[_0x49c5('0x30')][_0x49c5('0x3f')]){_0xc57ac5[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0xc57ac5['where'],{'$or':_[_0x49c5('0x3c')](_0xc57ac5[_0x49c5('0x33')],function(_0x55eb05){var _0xf89b1e={};_0xf89b1e[_0x55eb05]={'$like':'%'+_0x58d676[_0x49c5('0x30')][_0x49c5('0x3f')]+'%'};return _0xf89b1e;})});}_0xc57ac5=_[_0x49c5('0x3b')]({},_0xc57ac5,_0x58d676[_0x49c5('0x40')]);return db['CmHopperFinal']['count']({'where':_0xc57ac5[_0x49c5('0x3a')]})[_0x49c5('0x25')](function(_0x4f6e18){_0x4f14b4[_0x49c5('0x1d')]=_0x4f6e18;if(_0x58d676[_0x49c5('0x30')][_0x49c5('0x41')]){_0xc57ac5[_0x49c5('0x42')]=[{'all':!![]}];}return db[_0x49c5('0x61')][_0x49c5('0x43')](_0xc57ac5);})['then'](function(_0x228bab){_0x4f14b4[_0x49c5('0x44')]=_0x228bab;return _0x4f14b4;});}})[_0x49c5('0x25')](respondWithFilteredResult(_0x4db425,_0xc57ac5))[_0x49c5('0x45')](handleError(_0x4db425,null));};exports[_0x49c5('0x62')]=function(_0x5a1b09,_0xb6b110,_0x177539){var _0x1a40bd={'raw':!![],'where':{}};var _0x1d0707={};var _0x4c4bad={'count':0x0,'rows':[]};return db['Campaign'][_0x49c5('0x5a')]({'where':{'id':_0x5a1b09[_0x49c5('0x47')]['id']}})['then'](handleEntityNotFound(_0xb6b110,null))[_0x49c5('0x25')](function(_0x3dcb56){if(_0x3dcb56){_0x1d0707['model']=_[_0x49c5('0x48')](db[_0x49c5('0x63')][_0x49c5('0x2e')]);_0x1d0707[_0x49c5('0x30')]=_[_0x49c5('0x48')](_0x5a1b09[_0x49c5('0x30')]);_0x1d0707[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x1d0707[_0x49c5('0x2f')],_0x1d0707[_0x49c5('0x30')]);_0x1a40bd[_0x49c5('0x33')]=_[_0x49c5('0x32')](_0x1d0707['model'],qs[_0x49c5('0x34')](_0x5a1b09[_0x49c5('0x30')][_0x49c5('0x34')]));_0x1a40bd['attributes']=_0x1a40bd[_0x49c5('0x33')]['length']?_0x1a40bd[_0x49c5('0x33')]:_0x1d0707[_0x49c5('0x2f')];if(!_0x5a1b09[_0x49c5('0x30')][_0x49c5('0x36')]('nolimit')){_0x1a40bd[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x5a1b09[_0x49c5('0x30')][_0x49c5('0x1f')]);_0x1a40bd[_0x49c5('0x1e')]=qs[_0x49c5('0x1e')](_0x5a1b09[_0x49c5('0x30')][_0x49c5('0x1e')]);}_0x1a40bd['order']=qs[_0x49c5('0x38')](_0x5a1b09[_0x49c5('0x30')]['sort']);_0x1a40bd[_0x49c5('0x3a')]=qs['filters'](_['pick'](_0x5a1b09[_0x49c5('0x30')],_0x1d0707[_0x49c5('0x31')]));_0x1a40bd[_0x49c5('0x3a')][_0x49c5('0x5c')]=_0x3dcb56['id'];if(_0x5a1b09['query']['filter']){_0x1a40bd[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0x1a40bd['where'],{'$or':_[_0x49c5('0x3c')](_0x1a40bd[_0x49c5('0x33')],function(_0x2b3efd){var _0x558be0={};_0x558be0[_0x2b3efd]={'$like':'%'+_0x5a1b09['query'][_0x49c5('0x3f')]+'%'};return _0x558be0;})});}_0x1a40bd=_[_0x49c5('0x3b')]({},_0x1a40bd,_0x5a1b09['options']);return db[_0x49c5('0x63')][_0x49c5('0x1d')]({'where':_0x1a40bd['where']})[_0x49c5('0x25')](function(_0x2a5d1e){_0x4c4bad[_0x49c5('0x1d')]=_0x2a5d1e;if(_0x5a1b09[_0x49c5('0x30')][_0x49c5('0x41')]){_0x1a40bd[_0x49c5('0x42')]=[{'all':!![]}];}return db[_0x49c5('0x63')]['findAll'](_0x1a40bd);})[_0x49c5('0x25')](function(_0x327d7d){_0x4c4bad[_0x49c5('0x44')]=_0x327d7d;return _0x4c4bad;});}})[_0x49c5('0x25')](respondWithFilteredResult(_0xb6b110,_0x1a40bd))[_0x49c5('0x45')](handleError(_0xb6b110,null));};exports['getLists']=function(_0x220abb,_0x298755,_0x5b369a){var _0x382759={};var _0x4fac54={};var _0x41f11a;var _0x3f3ee5;return db['Campaign']['findOne']({'where':{'id':_0x220abb[_0x49c5('0x47')]['id']}})['then'](handleEntityNotFound(_0x298755,null))[_0x49c5('0x25')](function(_0x3653c3){if(_0x3653c3){_0x41f11a=_0x3653c3;_0x4fac54[_0x49c5('0x2f')]=_[_0x49c5('0x48')](db['CmList']['rawAttributes']);_0x4fac54[_0x49c5('0x30')]=_['keys'](_0x220abb[_0x49c5('0x30')]);_0x4fac54[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x4fac54[_0x49c5('0x2f')],_0x4fac54['query']);_0x382759[_0x49c5('0x33')]=_['intersection'](_0x4fac54[_0x49c5('0x2f')],qs[_0x49c5('0x34')](_0x220abb['query'][_0x49c5('0x34')]));_0x382759['attributes']=_0x382759[_0x49c5('0x33')][_0x49c5('0x35')]?_0x382759['attributes']:_0x4fac54[_0x49c5('0x2f')];_0x382759['order']=qs[_0x49c5('0x38')](_0x220abb[_0x49c5('0x30')][_0x49c5('0x38')]);_0x382759[_0x49c5('0x3a')]=qs[_0x49c5('0x31')](_[_0x49c5('0x39')](_0x220abb['query'],_0x4fac54['filters']));if(_0x220abb[_0x49c5('0x30')][_0x49c5('0x3f')]){_0x382759[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0x382759[_0x49c5('0x3a')],{'$or':_['map'](_0x382759['attributes'],function(_0x56b648){var _0x134d73={};_0x134d73[_0x56b648]={'$like':'%'+_0x220abb[_0x49c5('0x30')]['filter']+'%'};return _0x134d73;})});}_0x382759=_['merge']({},_0x382759,_0x220abb[_0x49c5('0x40')]);return _0x41f11a[_0x49c5('0x64')](_0x382759);}})[_0x49c5('0x25')](function(_0x443d09){if(_0x443d09){_0x3f3ee5=_0x443d09[_0x49c5('0x35')];if(!_0x220abb[_0x49c5('0x30')][_0x49c5('0x36')](_0x49c5('0x5f'))){_0x382759[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x220abb['query'][_0x49c5('0x1f')]);_0x382759[_0x49c5('0x1e')]=qs[_0x49c5('0x1e')](_0x220abb[_0x49c5('0x30')][_0x49c5('0x1e')]);}return _0x41f11a['getLists'](_0x382759);}})['then'](function(_0x1537c1){if(_0x1537c1){return _0x1537c1?{'count':_0x3f3ee5,'rows':_0x1537c1}:null;}})['then'](respondWithResult(_0x298755,null))[_0x49c5('0x45')](handleError(_0x298755,null));};exports[_0x49c5('0x65')]=function(_0x56f22f,_0xae2350,_0xa880b8){var _0x53120d,_0x115ed9;return db[_0x49c5('0x2d')][_0x49c5('0x49')]({'where':{'id':_0x56f22f[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0xae2350,null))[_0x49c5('0x25')](function(_0x29034c){if(_0x29034c){_0x115ed9=_0x29034c;return _0x29034c[_0x49c5('0x65')](_0x56f22f['body'][_0x49c5('0x66')],_[_0x49c5('0x56')](_0x56f22f[_0x49c5('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x10a9a2){var _0x210116;_0x53120d=_0x10a9a2||[];var _0x3b69a6=[];if(_0x10a9a2){for(var _0x52651a=0x0;_0x52651a<_0x10a9a2[_0x49c5('0x35')];_0x52651a+=0x1){var _0x27ca82=_0x10a9a2[_0x52651a][_0x49c5('0x4d')]({'plain':!![]});_0x115ed9[_0x49c5('0x67')]=_0x56f22f[_0x49c5('0x4b')][_0x49c5('0x67')]?_0x56f22f[_0x49c5('0x4b')][_0x49c5('0x67')]:_0x115ed9[_0x49c5('0x67')];switch(_0x115ed9[_0x49c5('0x67')]){case'always':_0x210116=squel[_0x49c5('0x68')]()[_0x49c5('0x69')](_0x49c5('0x6a'))[_0x49c5('0x6b')](['phone',_0x49c5('0x6c'),'ContactId',_0x49c5('0x6d'),_0x49c5('0x5c'),_0x49c5('0x55'),'updatedAt'],squel['select']()[_0x49c5('0x6e')](_0x49c5('0x6f'),'phone')[_0x49c5('0x6e')]('NOW()','scheduledAt')['field']('id',_0x49c5('0x70'))[_0x49c5('0x6e')](_0x27ca82['CmListId'][_0x49c5('0x71')](),_0x49c5('0x6d'))[_0x49c5('0x6e')](_0x56f22f[_0x49c5('0x47')]['id']['toString'](),'CampaignId')['field'](_0x49c5('0x72'),_0x49c5('0x55'))[_0x49c5('0x6e')]('NOW()',_0x49c5('0x57'))['from'](_0x49c5('0x73'))[_0x49c5('0x3a')](_0x49c5('0x74'))[_0x49c5('0x3a')](_0x49c5('0x75'),_0x27ca82[_0x49c5('0x76')][_0x49c5('0x71')]())[_0x49c5('0x3a')](_0x49c5('0x77'))[_0x49c5('0x3a')](_0x49c5('0x78'),squel['select']()[_0x49c5('0x6e')](_0x49c5('0x79'))[_0x49c5('0x7a')](_0x49c5('0x7b'))[_0x49c5('0x3a')](_0x49c5('0x7c'),_0x56f22f[_0x49c5('0x47')]['id'][_0x49c5('0x71')]()))['where'](_0x49c5('0x78'),squel['select']()['field'](_0x49c5('0x7d'))['from'](_0x49c5('0x6a'))[_0x49c5('0x3a')](_0x49c5('0x7c'),_0x56f22f[_0x49c5('0x47')]['id'][_0x49c5('0x71')]())))[_0x49c5('0x71')]();break;case _0x49c5('0x7e'):_0x210116=squel[_0x49c5('0x68')]()['into'](_0x49c5('0x6a'))[_0x49c5('0x6b')]([_0x49c5('0x6f'),'scheduledAt',_0x49c5('0x70'),'ListId',_0x49c5('0x5c'),_0x49c5('0x55'),_0x49c5('0x57')],squel['select']()[_0x49c5('0x6e')](_0x49c5('0x6f'),_0x49c5('0x6f'))[_0x49c5('0x6e')](_0x49c5('0x72'),_0x49c5('0x6c'))[_0x49c5('0x6e')]('id','ContactId')['field'](_0x27ca82[_0x49c5('0x76')][_0x49c5('0x71')](),_0x49c5('0x6d'))[_0x49c5('0x6e')](_0x56f22f[_0x49c5('0x47')]['id'][_0x49c5('0x71')](),'CampaignId')['field'](_0x49c5('0x72'),_0x49c5('0x55'))[_0x49c5('0x6e')](_0x49c5('0x72'),_0x49c5('0x57'))[_0x49c5('0x7a')](_0x49c5('0x73'))[_0x49c5('0x3a')](_0x49c5('0x74'))[_0x49c5('0x3a')]('ListId\x20=\x20?',_0x27ca82['CmListId'][_0x49c5('0x71')]())[_0x49c5('0x3a')](_0x49c5('0x77'))[_0x49c5('0x3a')](_0x49c5('0x78'),squel[_0x49c5('0x7f')]()[_0x49c5('0x6e')](_0x49c5('0x7d'))[_0x49c5('0x7a')]('cm_hopper')[_0x49c5('0x3a')](_0x49c5('0x7c'),_0x56f22f[_0x49c5('0x47')]['id']['toString']())))[_0x49c5('0x71')]();break;default:_0x210116=squel['insert']()[_0x49c5('0x69')](_0x49c5('0x6a'))[_0x49c5('0x6b')]([_0x49c5('0x6f'),_0x49c5('0x6c'),_0x49c5('0x70'),_0x49c5('0x6d'),_0x49c5('0x5c'),_0x49c5('0x55'),'updatedAt'],squel[_0x49c5('0x7f')]()['field']('phone',_0x49c5('0x6f'))['field'](_0x49c5('0x72'),'scheduledAt')[_0x49c5('0x6e')]('id',_0x49c5('0x70'))[_0x49c5('0x6e')](_0x27ca82[_0x49c5('0x76')]['toString'](),'ListId')[_0x49c5('0x6e')](_0x56f22f[_0x49c5('0x47')]['id']['toString'](),_0x49c5('0x5c'))['field'](_0x49c5('0x72'),_0x49c5('0x55'))[_0x49c5('0x6e')](_0x49c5('0x72'),'updatedAt')[_0x49c5('0x7a')](_0x49c5('0x73'))['where'](_0x49c5('0x74'))[_0x49c5('0x3a')](_0x49c5('0x75'),_0x27ca82[_0x49c5('0x76')]['toString']())['where'](_0x49c5('0x77')))['toString']();}_0x3b69a6['push'](db[_0x49c5('0x80')]['query'](_0x210116));}return BPromise[_0x49c5('0x81')](_0x3b69a6);}})['then'](function(){return _0x53120d;})['then'](respondWithResult(_0xae2350,null))['catch'](handleError(_0xae2350,null));};exports[_0x49c5('0x82')]=function(_0x3aee73,_0x5276c9,_0x41c74b){var _0x553332;return db[_0x49c5('0x2d')][_0x49c5('0x49')]({'where':{'id':_0x3aee73['params']['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x5276c9,null))[_0x49c5('0x25')](function(_0x472219){if(_0x472219){return _0x472219[_0x49c5('0x82')](_0x3aee73['query'][_0x49c5('0x66')]);}})[_0x49c5('0x25')](function(_0x25a66e){if(_0x25a66e){_0x553332=_0x25a66e;return db[_0x49c5('0x5b')][_0x49c5('0x26')]({'where':{'ListId':_0x3aee73[_0x49c5('0x30')][_0x49c5('0x66')],'CampaignId':_0x3aee73[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](function(){return _0x553332;});}})[_0x49c5('0x25')](respondWithStatusCode(_0x5276c9,null))[_0x49c5('0x45')](handleError(_0x5276c9,null));};exports['getBlackLists']=function(_0x5528df,_0x2b5b5a,_0x4cedbc){var _0x35700f={'raw':!![],'where':{}};var _0x30d340={};var _0x51c949={'count':0x0,'rows':[]};return db[_0x49c5('0x2d')][_0x49c5('0x5a')]({'where':{'id':_0x5528df[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](handleEntityNotFound(_0x2b5b5a,null))[_0x49c5('0x25')](function(_0x1e94fd){if(_0x1e94fd){_0x30d340[_0x49c5('0x2f')]=_[_0x49c5('0x48')](db[_0x49c5('0x83')]['rawAttributes']);_0x30d340[_0x49c5('0x30')]=_['keys'](_0x5528df['query']);_0x30d340[_0x49c5('0x31')]=_[_0x49c5('0x32')](_0x30d340['model'],_0x30d340[_0x49c5('0x30')]);_0x35700f[_0x49c5('0x33')]=_['intersection'](_0x30d340[_0x49c5('0x2f')],qs[_0x49c5('0x34')](_0x5528df[_0x49c5('0x30')][_0x49c5('0x34')]));_0x35700f[_0x49c5('0x33')]=_0x35700f[_0x49c5('0x33')][_0x49c5('0x35')]?_0x35700f['attributes']:_0x30d340[_0x49c5('0x2f')];if(!_0x5528df['query'][_0x49c5('0x36')]('nolimit')){_0x35700f[_0x49c5('0x1f')]=qs[_0x49c5('0x1f')](_0x5528df[_0x49c5('0x30')][_0x49c5('0x1f')]);_0x35700f[_0x49c5('0x1e')]=qs['offset'](_0x5528df[_0x49c5('0x30')][_0x49c5('0x1e')]);}_0x35700f[_0x49c5('0x37')]=qs[_0x49c5('0x38')](_0x5528df[_0x49c5('0x30')]['sort']);_0x35700f[_0x49c5('0x3a')]=qs[_0x49c5('0x31')](_[_0x49c5('0x39')](_0x5528df['query'],_0x30d340[_0x49c5('0x31')]));_0x35700f[_0x49c5('0x3a')][_0x49c5('0x5c')]=_0x1e94fd['id'];if(_0x5528df['query'][_0x49c5('0x3f')]){_0x35700f[_0x49c5('0x3a')]=_[_0x49c5('0x3b')](_0x35700f[_0x49c5('0x3a')],{'$or':_[_0x49c5('0x3c')](_0x35700f[_0x49c5('0x33')],function(_0x539e6a){var _0x2bbc14={};_0x2bbc14[_0x539e6a]={'$like':'%'+_0x5528df[_0x49c5('0x30')]['filter']+'%'};return _0x2bbc14;})});}_0x35700f=_[_0x49c5('0x3b')]({},_0x35700f,_0x5528df[_0x49c5('0x40')]);return db[_0x49c5('0x83')][_0x49c5('0x1d')]({'where':_0x35700f[_0x49c5('0x3a')]})[_0x49c5('0x25')](function(_0x2fdea9){_0x51c949[_0x49c5('0x1d')]=_0x2fdea9;if(_0x5528df['query']['includeAll']){_0x35700f[_0x49c5('0x42')]=[{'all':!![]}];}return db[_0x49c5('0x83')][_0x49c5('0x43')](_0x35700f);})[_0x49c5('0x25')](function(_0x5beb8b){_0x51c949[_0x49c5('0x44')]=_0x5beb8b;return _0x51c949;});}})[_0x49c5('0x25')](respondWithFilteredResult(_0x2b5b5a,_0x35700f))[_0x49c5('0x45')](handleError(_0x2b5b5a,null));};exports['addBlackLists']=function(_0x1d8b53,_0x4fa22b,_0x3f8194){var _0x26bfb6,_0x8ae813;return db[_0x49c5('0x2d')][_0x49c5('0x49')]({'where':{'id':_0x1d8b53[_0x49c5('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fa22b,null))[_0x49c5('0x25')](function(_0x55fde9){if(_0x55fde9){_0x8ae813=_0x55fde9;return _0x55fde9[_0x49c5('0x84')](_0x1d8b53[_0x49c5('0x4b')]['ids'],_[_0x49c5('0x56')](_0x1d8b53[_0x49c5('0x4b')],[_0x49c5('0x66'),'id'])||{});}return null;})[_0x49c5('0x85')](function(_0x4281ce){var _0x4e194d;_0x26bfb6=_0x4281ce||[];var _0x27804b=[];if(_0x4281ce){for(var _0x40e695=0x0;_0x40e695<_0x4281ce[_0x49c5('0x35')];_0x40e695+=0x1){var _0x3c068e=_0x4281ce[_0x40e695][_0x49c5('0x4d')]({'plain':!![]});_0x4e194d=squel[_0x49c5('0x68')]()[_0x49c5('0x69')](_0x49c5('0x86'))[_0x49c5('0x6b')](['phone',_0x49c5('0x70'),_0x49c5('0x6d'),_0x49c5('0x5c'),_0x49c5('0x55'),_0x49c5('0x57')],squel[_0x49c5('0x7f')]()[_0x49c5('0x6e')](_0x49c5('0x6f'),'phone')[_0x49c5('0x6e')]('id','ContactId')[_0x49c5('0x6e')](_0x3c068e[_0x49c5('0x76')][_0x49c5('0x71')](),_0x49c5('0x6d'))['field'](_0x1d8b53['params']['id'][_0x49c5('0x71')](),_0x49c5('0x5c'))[_0x49c5('0x6e')](_0x49c5('0x72'),_0x49c5('0x55'))[_0x49c5('0x6e')](_0x49c5('0x72'),_0x49c5('0x57'))['from']('cm_contacts')[_0x49c5('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x49c5('0x75'),_0x3c068e[_0x49c5('0x76')][_0x49c5('0x71')]())[_0x49c5('0x3a')](_0x49c5('0x77')))[_0x49c5('0x71')]();_0x27804b['push'](db[_0x49c5('0x80')][_0x49c5('0x30')](_0x4e194d));}return BPromise[_0x49c5('0x81')](_0x27804b);}})[_0x49c5('0x25')](function(){return _0x26bfb6;})[_0x49c5('0x25')](respondWithResult(_0x4fa22b,null))[_0x49c5('0x45')](handleError(_0x4fa22b,null));};exports[_0x49c5('0x87')]=function(_0x5a2a37,_0x2c7d2d,_0x5b3567){var _0x278f1c;return db[_0x49c5('0x2d')][_0x49c5('0x49')]({'where':{'id':_0x5a2a37['params']['id']}})['then'](handleEntityNotFound(_0x2c7d2d,null))[_0x49c5('0x25')](function(_0x57435c){if(_0x57435c){return _0x57435c['removeBlackLists'](_0x5a2a37['query'][_0x49c5('0x66')]);}})['then'](function(_0x88f797){if(_0x88f797){_0x278f1c=_0x88f797;return db[_0x49c5('0x63')][_0x49c5('0x26')]({'where':{'ListId':_0x5a2a37[_0x49c5('0x30')][_0x49c5('0x66')],'CampaignId':_0x5a2a37[_0x49c5('0x47')]['id']}})[_0x49c5('0x25')](function(){return _0x278f1c;});}})['then'](respondWithStatusCode(_0x2c7d2d,null))['catch'](handleError(_0x2c7d2d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 58d408b..1a8954c 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 _0xfde3=['Campaign','lodash','moment','bluebird','request-promise','./campaign.attributes','define'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xfde3,0xe8));var _0x3fde=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfde3[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x3fde('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3fde('0x1'));var BPromise=require(_0x3fde('0x2'));var rp=require(_0x3fde('0x3'));var attributes=require(_0x3fde('0x4'));module['exports']=function(_0x288717,_0x5369f7){return _0x288717[_0x3fde('0x5')](_0x3fde('0x6'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafe9=['bluebird','request-promise','./campaign.attributes','exports','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xafe9,0x1ea));var _0x9afe=function(_0x4cbd46,_0x23d623){_0x4cbd46=_0x4cbd46-0x0;var _0x15d4e4=_0xafe9[_0x4cbd46];return _0x15d4e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9afe('0x0'));var moment=require(_0x9afe('0x1'));var BPromise=require(_0x9afe('0x2'));var rp=require(_0x9afe('0x3'));var attributes=require(_0x9afe('0x4'));module[_0x9afe('0x5')]=function(_0x337c95,_0x42a16f){return _0x337c95['define']('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 23abde5..6478a7e 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 _0xc676=['map','include','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Campaign','options','raw','where','attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc676,0x1be));var _0x6c67=function(_0x4ef824,_0xc52091){_0x4ef824=_0x4ef824-0x0;var _0x5884ff=_0xc676[_0x4ef824];return _0x5884ff;};'use strict';var _=require(_0x6c67('0x0'));var util=require(_0x6c67('0x1'));var moment=require(_0x6c67('0x2'));var BPromise=require(_0x6c67('0x3'));var rs=require(_0x6c67('0x4'));var fs=require('fs');var Redis=require(_0x6c67('0x5'));var db=require(_0x6c67('0x6'))['db'];var utils=require(_0x6c67('0x7'));var logger=require(_0x6c67('0x8'))(_0x6c67('0x9'));var config=require('../../config/environment');var jayson=require(_0x6c67('0xa'));var client=jayson[_0x6c67('0xb')][_0x6c67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c847b,_0x471c55,_0x1b9c7e){return new BPromise(function(_0x33637e,_0x569f8d){return client[_0x6c67('0xd')](_0x3c847b,_0x1b9c7e)[_0x6c67('0xe')](function(_0x173523){logger[_0x6c67('0xf')](_0x6c67('0x10'),_0x471c55,_0x6c67('0x11'));logger[_0x6c67('0x12')](_0x6c67('0x13'),_0x471c55,'request\x20sent',JSON[_0x6c67('0x14')](_0x173523));if(_0x173523[_0x6c67('0x15')]){if(_0x173523[_0x6c67('0x15')][_0x6c67('0x16')]===0x1f4){logger[_0x6c67('0x15')](_0x6c67('0x10'),_0x471c55,_0x173523[_0x6c67('0x15')][_0x6c67('0x17')]);return _0x569f8d(_0x173523[_0x6c67('0x15')][_0x6c67('0x17')]);}logger[_0x6c67('0x15')](_0x6c67('0x10'),_0x471c55,_0x173523[_0x6c67('0x15')][_0x6c67('0x17')]);return _0x33637e(_0x173523['error'][_0x6c67('0x17')]);}else{logger[_0x6c67('0xf')](_0x6c67('0x10'),_0x471c55,'request\x20sent');_0x33637e(_0x173523['result']['message']);}})[_0x6c67('0x18')](function(_0x1783b0){logger[_0x6c67('0x15')](_0x6c67('0x10'),_0x471c55,_0x1783b0);_0x569f8d(_0x1783b0);});});}exports['GetCampaign']=function(_0x2b7b18){var _0x380b2c=this;return new Promise(function(_0x4b9394,_0x4585f6){return db[_0x6c67('0x19')]['findAll']({'raw':_0x2b7b18['options']?_0x2b7b18[_0x6c67('0x1a')][_0x6c67('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b7b18[_0x6c67('0x1a')]?_0x2b7b18[_0x6c67('0x1a')][_0x6c67('0x1c')]||null:null,'attributes':_0x2b7b18['options']?_0x2b7b18[_0x6c67('0x1a')][_0x6c67('0x1d')]||null:null,'limit':_0x2b7b18[_0x6c67('0x1a')]?_0x2b7b18[_0x6c67('0x1a')]['limit']||null:null,'include':_0x2b7b18[_0x6c67('0x1a')]?_0x2b7b18[_0x6c67('0x1a')]['include']?_[_0x6c67('0x1e')](_0x2b7b18[_0x6c67('0x1a')][_0x6c67('0x1f')],function(_0x583aa6){return{'model':db[_0x583aa6['model']],'as':_0x583aa6['as'],'attributes':_0x583aa6['attributes'],'include':_0x583aa6[_0x6c67('0x1f')]?_['map'](_0x583aa6[_0x6c67('0x1f')],function(_0x5fd685){return{'model':db[_0x5fd685['model']],'as':_0x5fd685['as'],'attributes':_0x5fd685[_0x6c67('0x1d')],'include':_0x5fd685['include']?_[_0x6c67('0x1e')](_0x5fd685[_0x6c67('0x1f')],function(_0x3fe1ec){return{'model':db[_0x3fe1ec[_0x6c67('0x20')]],'as':_0x3fe1ec['as'],'attributes':_0x3fe1ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c67('0xe')](function(_0x37df95){logger[_0x6c67('0xf')](_0x6c67('0x21'),_0x2b7b18);logger['debug'](_0x6c67('0x21'),_0x2b7b18,JSON[_0x6c67('0x14')](_0x37df95));_0x4b9394(_0x37df95);})[_0x6c67('0x18')](function(_0x560686){logger['error'](_0x6c67('0x21'),_0x560686[_0x6c67('0x17')],_0x2b7b18);_0x4585f6(_0x380b2c[_0x6c67('0x15')](0x1f4,_0x560686[_0x6c67('0x17')]));});});}; \ No newline at end of file +var _0x15ae=['http','request','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','Campaign,\x20%s,\x20%s','message','result','GetCampaign','options','where','attributes','include','map','model','then','info','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cd439,_0x4154ad){var _0x413696=function(_0x190bfc){while(--_0x190bfc){_0x1cd439['push'](_0x1cd439['shift']());}};_0x413696(++_0x4154ad);}(_0x15ae,0x17b));var _0xe15a=function(_0x5327cb,_0x4e4410){_0x5327cb=_0x5327cb-0x0;var _0x5c79d5=_0x15ae[_0x5327cb];return _0x5c79d5;};'use strict';var _=require(_0xe15a('0x0'));var util=require(_0xe15a('0x1'));var moment=require(_0xe15a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe15a('0x3'));var fs=require('fs');var Redis=require(_0xe15a('0x4'));var db=require(_0xe15a('0x5'))['db'];var utils=require(_0xe15a('0x6'));var logger=require(_0xe15a('0x7'))(_0xe15a('0x8'));var config=require(_0xe15a('0x9'));var jayson=require(_0xe15a('0xa'));var client=jayson['client'][_0xe15a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16ecca,_0x2dbd82,_0x246371){return new BPromise(function(_0xd30c01,_0x3f5479){return client[_0xe15a('0xc')](_0x16ecca,_0x246371)['then'](function(_0x510c03){logger['info']('Campaign,\x20%s,\x20%s',_0x2dbd82,'request\x20sent');logger['debug'](_0xe15a('0xd'),_0x2dbd82,_0xe15a('0xe'),JSON['stringify'](_0x510c03));if(_0x510c03[_0xe15a('0xf')]){if(_0x510c03['error']['code']===0x1f4){logger[_0xe15a('0xf')](_0xe15a('0x10'),_0x2dbd82,_0x510c03[_0xe15a('0xf')]['message']);return _0x3f5479(_0x510c03[_0xe15a('0xf')][_0xe15a('0x11')]);}logger[_0xe15a('0xf')](_0xe15a('0x10'),_0x2dbd82,_0x510c03[_0xe15a('0xf')][_0xe15a('0x11')]);return _0xd30c01(_0x510c03[_0xe15a('0xf')][_0xe15a('0x11')]);}else{logger['info'](_0xe15a('0x10'),_0x2dbd82,'request\x20sent');_0xd30c01(_0x510c03[_0xe15a('0x12')]['message']);}})['catch'](function(_0x453e4d){logger['error'](_0xe15a('0x10'),_0x2dbd82,_0x453e4d);_0x3f5479(_0x453e4d);});});}exports[_0xe15a('0x13')]=function(_0x399a09){var _0x2d10e5=this;return new Promise(function(_0x164f2a,_0x44a88d){return db['Campaign']['findAll']({'raw':_0x399a09[_0xe15a('0x14')]?_0x399a09[_0xe15a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x399a09[_0xe15a('0x14')]?_0x399a09['options'][_0xe15a('0x15')]||null:null,'attributes':_0x399a09[_0xe15a('0x14')]?_0x399a09[_0xe15a('0x14')][_0xe15a('0x16')]||null:null,'limit':_0x399a09[_0xe15a('0x14')]?_0x399a09[_0xe15a('0x14')]['limit']||null:null,'include':_0x399a09[_0xe15a('0x14')]?_0x399a09[_0xe15a('0x14')][_0xe15a('0x17')]?_[_0xe15a('0x18')](_0x399a09[_0xe15a('0x14')]['include'],function(_0x14d7cb){return{'model':db[_0x14d7cb[_0xe15a('0x19')]],'as':_0x14d7cb['as'],'attributes':_0x14d7cb['attributes'],'include':_0x14d7cb[_0xe15a('0x17')]?_['map'](_0x14d7cb[_0xe15a('0x17')],function(_0xd62513){return{'model':db[_0xd62513[_0xe15a('0x19')]],'as':_0xd62513['as'],'attributes':_0xd62513[_0xe15a('0x16')],'include':_0xd62513[_0xe15a('0x17')]?_['map'](_0xd62513[_0xe15a('0x17')],function(_0x233d6b){return{'model':db[_0x233d6b[_0xe15a('0x19')]],'as':_0x233d6b['as'],'attributes':_0x233d6b[_0xe15a('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe15a('0x1a')](function(_0x1817da){logger[_0xe15a('0x1b')](_0xe15a('0x13'),_0x399a09);logger[_0xe15a('0x1c')]('GetCampaign',_0x399a09,JSON['stringify'](_0x1817da));_0x164f2a(_0x1817da);})[_0xe15a('0x1d')](function(_0x7cd76){logger[_0xe15a('0xf')](_0xe15a('0x13'),_0x7cd76['message'],_0x399a09);_0x44a88d(_0x2d10e5[_0xe15a('0xf')](0x1f4,_0x7cd76[_0xe15a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 36f04bb..2ee54a3 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 _0xa635=['create','/:id/clone','addLists','addBlackLists','put','update','delete','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post'];(function(_0x37e421,_0x4dc9da){var _0x4f0d94=function(_0x2fc4b7){while(--_0x2fc4b7){_0x37e421['push'](_0x37e421['shift']());}};_0x4f0d94(++_0x4dc9da);}(_0xa635,0x97));var _0x5a63=function(_0x1f1b58,_0x5a5daf){_0x1f1b58=_0x1f1b58-0x0;var _0x96cade=_0xa635[_0x1f1b58];return _0x96cade;};'use strict';var multer=require(_0x5a63('0x0'));var util=require(_0x5a63('0x1'));var path=require(_0x5a63('0x2'));var timeout=require(_0x5a63('0x3'));var express=require(_0x5a63('0x4'));var router=express[_0x5a63('0x5')]();var auth=require(_0x5a63('0x6'));var interaction=require(_0x5a63('0x7'));var config=require(_0x5a63('0x8'));var controller=require(_0x5a63('0x9'));router[_0x5a63('0xa')]('/',auth[_0x5a63('0xb')](),controller[_0x5a63('0xc')]);router[_0x5a63('0xa')](_0x5a63('0xd'),auth[_0x5a63('0xb')](),controller[_0x5a63('0xe')]);router[_0x5a63('0xa')]('/:id/hoppers',auth[_0x5a63('0xb')](),controller[_0x5a63('0xf')]);router['get'](_0x5a63('0x10'),auth[_0x5a63('0xb')](),controller['getHopperHistories']);router[_0x5a63('0xa')](_0x5a63('0x11'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x5a63('0xa')](_0x5a63('0x12'),auth['isAuthenticated'](),controller[_0x5a63('0x13')]);router['get'](_0x5a63('0x14'),auth[_0x5a63('0xb')](),controller[_0x5a63('0x15')]);router[_0x5a63('0xa')]('/:id/blacklists',auth[_0x5a63('0xb')](),controller[_0x5a63('0x16')]);router[_0x5a63('0x17')]('/',auth[_0x5a63('0xb')](),controller[_0x5a63('0x18')]);router['post'](_0x5a63('0x19'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x5a63('0x14'),auth[_0x5a63('0xb')](),controller[_0x5a63('0x1a')]);router[_0x5a63('0x17')]('/:id/blacklists',auth[_0x5a63('0xb')](),controller[_0x5a63('0x1b')]);router[_0x5a63('0x1c')](_0x5a63('0xd'),auth[_0x5a63('0xb')](),controller[_0x5a63('0x1d')]);router['delete'](_0x5a63('0xd'),auth[_0x5a63('0xb')](),controller['destroy']);router[_0x5a63('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller[_0x5a63('0x1f')]);router[_0x5a63('0x1e')](_0x5a63('0x20'),auth[_0x5a63('0xb')](),controller[_0x5a63('0x21')]);module[_0x5a63('0x22')]=router; \ No newline at end of file +var _0x106e=['show','/:id/hoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id'];(function(_0x253475,_0x1fea10){var _0x16d219=function(_0x4382d6){while(--_0x4382d6){_0x253475['push'](_0x253475['shift']());}};_0x16d219(++_0x1fea10);}(_0x106e,0x174));var _0xe106=function(_0x3f0c39,_0x548f86){_0x3f0c39=_0x3f0c39-0x0;var _0x2913a1=_0x106e[_0x3f0c39];return _0x2913a1;};'use strict';var multer=require(_0xe106('0x0'));var util=require(_0xe106('0x1'));var path=require('path');var timeout=require(_0xe106('0x2'));var express=require(_0xe106('0x3'));var router=express[_0xe106('0x4')]();var auth=require(_0xe106('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe106('0x6'));var controller=require(_0xe106('0x7'));router['get']('/',auth[_0xe106('0x8')](),controller[_0xe106('0x9')]);router[_0xe106('0xa')](_0xe106('0xb'),auth[_0xe106('0x8')](),controller[_0xe106('0xc')]);router[_0xe106('0xa')](_0xe106('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0xe106('0x8')](),controller[_0xe106('0xe')]);router[_0xe106('0xa')]('/:id/hopper_finals',auth[_0xe106('0x8')](),controller[_0xe106('0xf')]);router['get'](_0xe106('0x10'),auth[_0xe106('0x8')](),controller['getHopperBlacks']);router['get'](_0xe106('0x11'),auth['isAuthenticated'](),controller[_0xe106('0x12')]);router[_0xe106('0xa')](_0xe106('0x13'),auth[_0xe106('0x8')](),controller[_0xe106('0x14')]);router[_0xe106('0x15')]('/',auth[_0xe106('0x8')](),controller[_0xe106('0x16')]);router[_0xe106('0x15')](_0xe106('0x17'),auth[_0xe106('0x8')](),controller[_0xe106('0x18')]);router[_0xe106('0x15')](_0xe106('0x11'),auth[_0xe106('0x8')](),controller[_0xe106('0x19')]);router['post'](_0xe106('0x13'),auth['isAuthenticated'](),controller[_0xe106('0x1a')]);router[_0xe106('0x1b')]('/:id',auth[_0xe106('0x8')](),controller[_0xe106('0x1c')]);router[_0xe106('0x1d')](_0xe106('0xb'),auth[_0xe106('0x8')](),controller[_0xe106('0x1e')]);router[_0xe106('0x1d')](_0xe106('0x11'),auth['isAuthenticated'](),controller[_0xe106('0x1f')]);router[_0xe106('0x1d')](_0xe106('0x13'),auth[_0xe106('0x8')](),controller['removeBlackLists']);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 a510aec..93a4b34 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 _0xdf78=['key','sequelize','STRING','TEXT','getDataValue'];(function(_0x58e499,_0x270ec7){var _0x171598=function(_0x24bc5a){while(--_0x24bc5a){_0x58e499['push'](_0x58e499['shift']());}};_0x171598(++_0x270ec7);}(_0xdf78,0xb0));var _0x8df7=function(_0x36a94d,_0x378fef){_0x36a94d=_0x36a94d-0x0;var _0x196903=_0xdf78[_0x36a94d];return _0x196903;};'use strict';var Sequelize=require(_0x8df7('0x0'));module['exports']={'key':{'type':Sequelize[_0x8df7('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x8df7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8df7('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8df7('0x3')](_0x8df7('0x4'));}}}; \ No newline at end of file +var _0xb4ca=['TEXT','getDataValue','exports','STRING'];(function(_0x312994,_0x26ec38){var _0xfa3ef2=function(_0x4d1e71){while(--_0x4d1e71){_0x312994['push'](_0x312994['shift']());}};_0xfa3ef2(++_0x26ec38);}(_0xb4ca,0x1e2));var _0xab4c=function(_0x58fe68,_0x13bb9d){_0x58fe68=_0x58fe68-0x0;var _0x4b943a=_0xb4ca[_0x58fe68];return _0x4b943a;};'use strict';var Sequelize=require('sequelize');module[_0xab4c('0x0')]={'key':{'type':Sequelize[_0xab4c('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xab4c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xab4c('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 490c939..40b8786 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 _0x71c7=['path','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','stack','name','send','CannedAnswer','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','map','type','key','VIRTUAL','merge','count','includeAll','include','rows','catch','show','params','options','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x71c7,0xfd));var _0x771c=function(_0x58b1f2,_0x38d5e4){_0x58b1f2=_0x58b1f2-0x0;var _0x2e99ed=_0x71c7[_0x58b1f2];return _0x2e99ed;};'use strict';var pdf=require(_0x771c('0x0'));var emlformat=require(_0x771c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x771c('0x2'));var jsonpatch=require(_0x771c('0x3'));var rp=require(_0x771c('0x4'));var moment=require('moment');var BPromise=require(_0x771c('0x5'));var Mustache=require(_0x771c('0x6'));var util=require(_0x771c('0x7'));var path=require(_0x771c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x771c('0x9'));var fs=require('fs');var _=require(_0x771c('0xa'));var squel=require(_0x771c('0xb'));var crypto=require(_0x771c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x771c('0xd'));var querystring=require('querystring');var Papa=require(_0x771c('0xe'));var authService=require(_0x771c('0xf'));var hardwareService=require(_0x771c('0x10'));var Redis=require(_0x771c('0x11'));var qs=require(_0x771c('0x12'));var logger=require(_0x771c('0x13'))(_0x771c('0x14'));var utils=require(_0x771c('0x15'));var config=require(_0x771c('0x16'));var db=require(_0x771c('0x17'))['db'];function respondWithStatusCode(_0x510968,_0x267fe9){_0x267fe9=_0x267fe9||0xcc;return function(_0x3f07ab){if(_0x3f07ab){return _0x510968['sendStatus'](_0x267fe9);}return _0x510968[_0x771c('0x18')](_0x267fe9)[_0x771c('0x19')]();};}function respondWithResult(_0x251de2,_0x1ee426){_0x1ee426=_0x1ee426||0xc8;return function(_0x5960fc){if(_0x5960fc){return _0x251de2[_0x771c('0x18')](_0x1ee426)[_0x771c('0x1a')](_0x5960fc);}};}function respondWithFilteredResult(_0x3c6281,_0xed2ef9){return function(_0x2a8891){if(_0x2a8891){var _0x492958=_0x2a8891['count'],_0x4c9b58=_0xed2ef9[_0x771c('0x1b')],_0x32db41=_0xed2ef9[_0x771c('0x1b')]+_0xed2ef9[_0x771c('0x1c')],_0x3ee635;if(_0x32db41>=_0x492958){_0x32db41=_0x492958;_0x3ee635=0xc8;}else{_0x3ee635=0xce;}_0x3c6281[_0x771c('0x18')](_0x3ee635);return _0x3c6281[_0x771c('0x1d')](_0x771c('0x1e'),_0x4c9b58+'-'+_0x32db41+'/'+_0x492958)[_0x771c('0x1a')](_0x2a8891);}return null;};}function patchUpdates(_0x18e125){return function(_0x252508){try{jsonpatch[_0x771c('0x1f')](_0x252508,_0x18e125,!![]);}catch(_0x3efc41){return BPromise[_0x771c('0x20')](_0x3efc41);}return _0x252508[_0x771c('0x21')]();};}function saveUpdates(_0x52ce5d,_0x24b04e){return function(_0x1a8bba){if(_0x1a8bba){return _0x1a8bba[_0x771c('0x22')](_0x52ce5d)[_0x771c('0x23')](function(_0x210263){return _0x210263;});}return null;};}function removeEntity(_0x10a7b5,_0x93cb2a){return function(_0x173442){if(_0x173442){return _0x173442[_0x771c('0x24')]()[_0x771c('0x23')](function(){var _0x590a16=_0x173442['get']({'plain':!![]});var _0x3173ce=_0x771c('0x25');return db[_0x771c('0x26')]['destroy']({'where':{'type':_0x3173ce,'resourceId':_0x590a16['id']}})[_0x771c('0x23')](function(){return _0x173442;});})['then'](function(){_0x10a7b5[_0x771c('0x18')](0xcc)[_0x771c('0x19')]();});}};}function handleEntityNotFound(_0x5bc55d,_0x1522c6){return function(_0x45e87a){if(!_0x45e87a){_0x5bc55d['sendStatus'](0x194);}return _0x45e87a;};}function handleError(_0x4d6aff,_0x9ce400){_0x9ce400=_0x9ce400||0x1f4;return function(_0x2f87ca){logger['error'](_0x2f87ca[_0x771c('0x27')]);if(_0x2f87ca[_0x771c('0x28')]){delete _0x2f87ca[_0x771c('0x28')];}_0x4d6aff['status'](_0x9ce400)[_0x771c('0x29')](_0x2f87ca);};}exports['index']=function(_0x196b2e,_0x44f70c){var _0x242977={},_0x349d73={},_0x13ee6a={'count':0x0,'rows':[]};var _0x4a948b=db[_0x771c('0x2a')][_0x771c('0x2b')];_0x349d73['model']=_[_0x771c('0x2c')](_0x4a948b);_0x349d73['query']=_[_0x771c('0x2c')](_0x196b2e[_0x771c('0x2d')]);_0x349d73['filters']=_[_0x771c('0x2e')](_0x349d73[_0x771c('0x2f')],_0x349d73[_0x771c('0x2d')]);_0x242977[_0x771c('0x30')]=_[_0x771c('0x2e')](_0x349d73[_0x771c('0x2f')],qs['fields'](_0x196b2e[_0x771c('0x2d')][_0x771c('0x31')]));_0x242977['attributes']=_0x242977[_0x771c('0x30')]['length']?_0x242977['attributes']:_0x349d73[_0x771c('0x2f')];if(!_0x196b2e['query'][_0x771c('0x32')](_0x771c('0x33'))){_0x242977[_0x771c('0x1c')]=qs[_0x771c('0x1c')](_0x196b2e[_0x771c('0x2d')][_0x771c('0x1c')]);_0x242977['offset']=qs[_0x771c('0x1b')](_0x196b2e['query'][_0x771c('0x1b')]);}_0x242977[_0x771c('0x34')]=qs['sort'](_0x196b2e[_0x771c('0x2d')]['sort']);_0x242977[_0x771c('0x35')]=qs[_0x771c('0x36')](_[_0x771c('0x37')](_0x196b2e[_0x771c('0x2d')],_0x349d73[_0x771c('0x36')]));if(_0x196b2e['query'][_0x771c('0x38')]){_0x242977[_0x771c('0x35')]=_['merge'](_0x242977['where'],{'$or':_[_0x771c('0x39')](_0x4a948b,function(_0x496bbb){if(_0x496bbb[_0x771c('0x3a')][_0x771c('0x3b')]!==_0x771c('0x3c')){var _0x5614aa={};_0x5614aa[_0x496bbb['field']]={'$like':'%'+_0x196b2e['query'][_0x771c('0x38')]+'%'};return _0x5614aa;}})});}_0x242977=_[_0x771c('0x3d')]({},_0x242977,_0x196b2e['options']);var _0x2b50d1={'where':_0x242977[_0x771c('0x35')]};return db[_0x771c('0x2a')][_0x771c('0x3e')](_0x2b50d1)['then'](function(_0x3a19c5){_0x13ee6a['count']=_0x3a19c5;if(_0x196b2e[_0x771c('0x2d')][_0x771c('0x3f')]){_0x242977[_0x771c('0x40')]=[{'all':!![]}];}return db[_0x771c('0x2a')]['findAll'](_0x242977);})[_0x771c('0x23')](function(_0x17384d){_0x13ee6a[_0x771c('0x41')]=_0x17384d;return _0x13ee6a;})[_0x771c('0x23')](respondWithFilteredResult(_0x44f70c,_0x242977))[_0x771c('0x42')](handleError(_0x44f70c,null));};exports[_0x771c('0x43')]=function(_0x2cbb37,_0x5f2d88){var _0x2e074e={'raw':!![],'where':{'id':_0x2cbb37[_0x771c('0x44')]['id']}},_0x5c029a={};_0x5c029a[_0x771c('0x2f')]=_[_0x771c('0x2c')](db[_0x771c('0x2a')]['rawAttributes']);_0x5c029a[_0x771c('0x2d')]=_[_0x771c('0x2c')](_0x2cbb37['query']);_0x5c029a[_0x771c('0x36')]=_[_0x771c('0x2e')](_0x5c029a[_0x771c('0x2f')],_0x5c029a[_0x771c('0x2d')]);_0x2e074e[_0x771c('0x30')]=_[_0x771c('0x2e')](_0x5c029a[_0x771c('0x2f')],qs[_0x771c('0x31')](_0x2cbb37[_0x771c('0x2d')][_0x771c('0x31')]));_0x2e074e[_0x771c('0x30')]=_0x2e074e[_0x771c('0x30')]['length']?_0x2e074e[_0x771c('0x30')]:_0x5c029a[_0x771c('0x2f')];if(_0x2cbb37[_0x771c('0x2d')][_0x771c('0x3f')]){_0x2e074e[_0x771c('0x40')]=[{'all':!![]}];}_0x2e074e=_['merge']({},_0x2e074e,_0x2cbb37[_0x771c('0x45')]);return db[_0x771c('0x2a')]['find'](_0x2e074e)[_0x771c('0x23')](handleEntityNotFound(_0x5f2d88,null))[_0x771c('0x23')](respondWithResult(_0x5f2d88,null))[_0x771c('0x42')](handleError(_0x5f2d88,null));};exports[_0x771c('0x22')]=function(_0x5c863b,_0xd70482){if(_0x5c863b[_0x771c('0x46')]['id']){delete _0x5c863b[_0x771c('0x46')]['id'];}return db[_0x771c('0x2a')]['find']({'where':{'id':_0x5c863b[_0x771c('0x44')]['id']}})['then'](handleEntityNotFound(_0xd70482,null))[_0x771c('0x23')](saveUpdates(_0x5c863b[_0x771c('0x46')],null))[_0x771c('0x23')](respondWithResult(_0xd70482,null))[_0x771c('0x42')](handleError(_0xd70482,null));};exports[_0x771c('0x24')]=function(_0x5ceada,_0x20fea5){return db[_0x771c('0x2a')][_0x771c('0x47')]({'where':{'id':_0x5ceada[_0x771c('0x44')]['id']}})['then'](handleEntityNotFound(_0x20fea5,null))['then'](removeEntity(_0x20fea5,null))[_0x771c('0x42')](handleError(_0x20fea5,null));};exports['create']=function(_0x1f339f,_0x5da260){var _0x2ab3de={'key':_0x1f339f['body'][_0x771c('0x3b')]};if(_0x1f339f[_0x771c('0x46')]['MailAccountId']){_0x2ab3de[_0x771c('0x48')]=_0x1f339f[_0x771c('0x46')][_0x771c('0x48')];}else if(_0x1f339f[_0x771c('0x46')][_0x771c('0x49')]){_0x2ab3de[_0x771c('0x49')]=_0x1f339f[_0x771c('0x46')][_0x771c('0x49')];}else if(_0x1f339f[_0x771c('0x46')][_0x771c('0x4a')]){_0x2ab3de[_0x771c('0x4a')]=_0x1f339f[_0x771c('0x46')][_0x771c('0x4a')];}else if(_0x1f339f[_0x771c('0x46')][_0x771c('0x4b')]){_0x2ab3de[_0x771c('0x4b')]=_0x1f339f[_0x771c('0x46')][_0x771c('0x4b')];}return db['CannedAnswer']['find']({'where':_0x2ab3de})[_0x771c('0x23')](function(_0x1c950b){if(_0x1c950b){throw new db[(_0x771c('0x4c'))][(_0x771c('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x771c('0x2a')][_0x771c('0x4e')](_0x1f339f[_0x771c('0x46')]);})[_0x771c('0x23')](function(_0x52ca06){var _0x158481=_0x1f339f[_0x771c('0x4f')][_0x771c('0x50')]({'plain':!![]});if(!_0x158481)throw new Error(_0x771c('0x51'));if(_0x158481[_0x771c('0x52')]===_0x771c('0x4f')){var _0x226664=_0x52ca06['get']({'plain':!![]});return db['UserProfileSection'][_0x771c('0x47')]({'where':{'name':_0x771c('0x25'),'userProfileId':_0x158481[_0x771c('0x53')]},'raw':!![]})['then'](function(_0x37f488){if(_0x37f488&&_0x37f488[_0x771c('0x54')]===0x0){return db[_0x771c('0x26')][_0x771c('0x4e')]({'name':_0x226664[_0x771c('0x28')],'resourceId':_0x226664['id'],'type':_0x37f488[_0x771c('0x28')],'sectionId':_0x37f488['id']},{})[_0x771c('0x23')](function(){return _0x52ca06;});}else{return _0x52ca06;}})[_0x771c('0x42')](function(_0x21dfd1){logger[_0x771c('0x55')](_0x771c('0x56'),_0x21dfd1);throw _0x21dfd1;});}return _0x52ca06;})[_0x771c('0x23')](respondWithResult(_0x5da260,0xc9))[_0x771c('0x42')](handleError(_0x5da260,null));}; \ No newline at end of file +var _0xa4db=['name','CannedAnswer','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','include','findAll','rows','show','params','options','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','json','apply','reject','update','destroy','then','end','sendStatus','error','stack'];(function(_0x499b83,_0xde81d0){var _0x15d62a=function(_0x3500b5){while(--_0x3500b5){_0x499b83['push'](_0x499b83['shift']());}};_0x15d62a(++_0xde81d0);}(_0xa4db,0x1e1));var _0xba4d=function(_0x2c15fa,_0x35d890){_0x2c15fa=_0x2c15fa-0x0;var _0xe4fce7=_0xa4db[_0x2c15fa];return _0xe4fce7;};'use strict';var pdf=require(_0xba4d('0x0'));var emlformat=require(_0xba4d('0x1'));var rimraf=require(_0xba4d('0x2'));var zipdir=require(_0xba4d('0x3'));var jsonpatch=require(_0xba4d('0x4'));var rp=require(_0xba4d('0x5'));var moment=require(_0xba4d('0x6'));var BPromise=require(_0xba4d('0x7'));var Mustache=require('mustache');var util=require(_0xba4d('0x8'));var path=require(_0xba4d('0x9'));var sox=require(_0xba4d('0xa'));var csv=require(_0xba4d('0xb'));var ejs=require(_0xba4d('0xc'));var fs=require('fs');var _=require(_0xba4d('0xd'));var squel=require(_0xba4d('0xe'));var crypto=require(_0xba4d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba4d('0xb'));var querystring=require(_0xba4d('0x10'));var Papa=require(_0xba4d('0x11'));var authService=require(_0xba4d('0x12'));var hardwareService=require(_0xba4d('0x13'));var Redis=require(_0xba4d('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xba4d('0x15'))(_0xba4d('0x16'));var utils=require(_0xba4d('0x17'));var config=require(_0xba4d('0x18'));var db=require(_0xba4d('0x19'))['db'];function respondWithStatusCode(_0x4dc9df,_0x5c0b25){_0x5c0b25=_0x5c0b25||0xcc;return function(_0x576f85){if(_0x576f85){return _0x4dc9df['sendStatus'](_0x5c0b25);}return _0x4dc9df['status'](_0x5c0b25)['end']();};}function respondWithResult(_0x2fb52c,_0x477ecb){_0x477ecb=_0x477ecb||0xc8;return function(_0x4a2168){if(_0x4a2168){return _0x2fb52c[_0xba4d('0x1a')](_0x477ecb)['json'](_0x4a2168);}};}function respondWithFilteredResult(_0x42a102,_0x4cd143){return function(_0x293aa1){if(_0x293aa1){var _0x1abcf5=_0x293aa1[_0xba4d('0x1b')],_0x59494f=_0x4cd143['offset'],_0x57d8c4=_0x4cd143[_0xba4d('0x1c')]+_0x4cd143[_0xba4d('0x1d')],_0x542722;if(_0x57d8c4>=_0x1abcf5){_0x57d8c4=_0x1abcf5;_0x542722=0xc8;}else{_0x542722=0xce;}_0x42a102[_0xba4d('0x1a')](_0x542722);return _0x42a102['set'](_0xba4d('0x1e'),_0x59494f+'-'+_0x57d8c4+'/'+_0x1abcf5)[_0xba4d('0x1f')](_0x293aa1);}return null;};}function patchUpdates(_0x5a7493){return function(_0x3bc721){try{jsonpatch[_0xba4d('0x20')](_0x3bc721,_0x5a7493,!![]);}catch(_0x571493){return BPromise[_0xba4d('0x21')](_0x571493);}return _0x3bc721['save']();};}function saveUpdates(_0x1e125,_0x478f99){return function(_0x3b7cf0){if(_0x3b7cf0){return _0x3b7cf0[_0xba4d('0x22')](_0x1e125)['then'](function(_0x4a8fa5){return _0x4a8fa5;});}return null;};}function removeEntity(_0x45d7be,_0x5a7a68){return function(_0xc09757){if(_0xc09757){return _0xc09757[_0xba4d('0x23')]()['then'](function(){var _0x335ed8=_0xc09757['get']({'plain':!![]});var _0x76a37a='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x76a37a,'resourceId':_0x335ed8['id']}})[_0xba4d('0x24')](function(){return _0xc09757;});})['then'](function(){_0x45d7be[_0xba4d('0x1a')](0xcc)[_0xba4d('0x25')]();});}};}function handleEntityNotFound(_0x20cbb0,_0x125e2f){return function(_0x368fbf){if(!_0x368fbf){_0x20cbb0[_0xba4d('0x26')](0x194);}return _0x368fbf;};}function handleError(_0xf08aa0,_0x50dd7a){_0x50dd7a=_0x50dd7a||0x1f4;return function(_0x2d8c40){logger[_0xba4d('0x27')](_0x2d8c40[_0xba4d('0x28')]);if(_0x2d8c40[_0xba4d('0x29')]){delete _0x2d8c40['name'];}_0xf08aa0[_0xba4d('0x1a')](_0x50dd7a)['send'](_0x2d8c40);};}exports['index']=function(_0x330592,_0x314bd8){var _0x4f418={},_0x3d6e56={},_0x2168fe={'count':0x0,'rows':[]};var _0x22482c=db[_0xba4d('0x2a')][_0xba4d('0x2b')];_0x3d6e56[_0xba4d('0x2c')]=_[_0xba4d('0x2d')](_0x22482c);_0x3d6e56[_0xba4d('0x2e')]=_[_0xba4d('0x2d')](_0x330592[_0xba4d('0x2e')]);_0x3d6e56['filters']=_[_0xba4d('0x2f')](_0x3d6e56[_0xba4d('0x2c')],_0x3d6e56[_0xba4d('0x2e')]);_0x4f418[_0xba4d('0x30')]=_[_0xba4d('0x2f')](_0x3d6e56[_0xba4d('0x2c')],qs[_0xba4d('0x31')](_0x330592['query'][_0xba4d('0x31')]));_0x4f418[_0xba4d('0x30')]=_0x4f418['attributes'][_0xba4d('0x32')]?_0x4f418['attributes']:_0x3d6e56[_0xba4d('0x2c')];if(!_0x330592[_0xba4d('0x2e')][_0xba4d('0x33')](_0xba4d('0x34'))){_0x4f418[_0xba4d('0x1d')]=qs[_0xba4d('0x1d')](_0x330592[_0xba4d('0x2e')]['limit']);_0x4f418[_0xba4d('0x1c')]=qs[_0xba4d('0x1c')](_0x330592['query'][_0xba4d('0x1c')]);}_0x4f418['order']=qs['sort'](_0x330592[_0xba4d('0x2e')][_0xba4d('0x35')]);_0x4f418[_0xba4d('0x36')]=qs[_0xba4d('0x37')](_[_0xba4d('0x38')](_0x330592[_0xba4d('0x2e')],_0x3d6e56['filters']));if(_0x330592[_0xba4d('0x2e')][_0xba4d('0x39')]){_0x4f418[_0xba4d('0x36')]=_[_0xba4d('0x3a')](_0x4f418[_0xba4d('0x36')],{'$or':_[_0xba4d('0x3b')](_0x22482c,function(_0x47fec3){if(_0x47fec3[_0xba4d('0x3c')][_0xba4d('0x3d')]!==_0xba4d('0x3e')){var _0x3b89d6={};_0x3b89d6[_0x47fec3['field']]={'$like':'%'+_0x330592[_0xba4d('0x2e')][_0xba4d('0x39')]+'%'};return _0x3b89d6;}})});}_0x4f418=_[_0xba4d('0x3a')]({},_0x4f418,_0x330592['options']);var _0x4893f5={'where':_0x4f418[_0xba4d('0x36')]};return db[_0xba4d('0x2a')][_0xba4d('0x1b')](_0x4893f5)['then'](function(_0x13e453){_0x2168fe['count']=_0x13e453;if(_0x330592[_0xba4d('0x2e')]['includeAll']){_0x4f418[_0xba4d('0x3f')]=[{'all':!![]}];}return db[_0xba4d('0x2a')][_0xba4d('0x40')](_0x4f418);})[_0xba4d('0x24')](function(_0x4981a9){_0x2168fe[_0xba4d('0x41')]=_0x4981a9;return _0x2168fe;})['then'](respondWithFilteredResult(_0x314bd8,_0x4f418))['catch'](handleError(_0x314bd8,null));};exports[_0xba4d('0x42')]=function(_0x4cf94b,_0x4c5382){var _0x313a47={'raw':!![],'where':{'id':_0x4cf94b[_0xba4d('0x43')]['id']}},_0x3cdec7={};_0x3cdec7[_0xba4d('0x2c')]=_[_0xba4d('0x2d')](db['CannedAnswer']['rawAttributes']);_0x3cdec7[_0xba4d('0x2e')]=_[_0xba4d('0x2d')](_0x4cf94b[_0xba4d('0x2e')]);_0x3cdec7[_0xba4d('0x37')]=_[_0xba4d('0x2f')](_0x3cdec7[_0xba4d('0x2c')],_0x3cdec7[_0xba4d('0x2e')]);_0x313a47[_0xba4d('0x30')]=_['intersection'](_0x3cdec7[_0xba4d('0x2c')],qs[_0xba4d('0x31')](_0x4cf94b[_0xba4d('0x2e')][_0xba4d('0x31')]));_0x313a47[_0xba4d('0x30')]=_0x313a47[_0xba4d('0x30')][_0xba4d('0x32')]?_0x313a47[_0xba4d('0x30')]:_0x3cdec7[_0xba4d('0x2c')];if(_0x4cf94b[_0xba4d('0x2e')]['includeAll']){_0x313a47['include']=[{'all':!![]}];}_0x313a47=_[_0xba4d('0x3a')]({},_0x313a47,_0x4cf94b[_0xba4d('0x44')]);return db[_0xba4d('0x2a')][_0xba4d('0x45')](_0x313a47)[_0xba4d('0x24')](handleEntityNotFound(_0x4c5382,null))[_0xba4d('0x24')](respondWithResult(_0x4c5382,null))[_0xba4d('0x46')](handleError(_0x4c5382,null));};exports[_0xba4d('0x22')]=function(_0x2966b6,_0x532a02){if(_0x2966b6['body']['id']){delete _0x2966b6[_0xba4d('0x47')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x2966b6['params']['id']}})[_0xba4d('0x24')](handleEntityNotFound(_0x532a02,null))['then'](saveUpdates(_0x2966b6['body'],null))[_0xba4d('0x24')](respondWithResult(_0x532a02,null))[_0xba4d('0x46')](handleError(_0x532a02,null));};exports[_0xba4d('0x23')]=function(_0x14ce42,_0x141a7b){return db[_0xba4d('0x2a')]['find']({'where':{'id':_0x14ce42[_0xba4d('0x43')]['id']}})[_0xba4d('0x24')](handleEntityNotFound(_0x141a7b,null))['then'](removeEntity(_0x141a7b,null))[_0xba4d('0x46')](handleError(_0x141a7b,null));};exports['create']=function(_0x3b47aa,_0x11c328){var _0x16a7ad={'key':_0x3b47aa[_0xba4d('0x47')][_0xba4d('0x3d')]};if(_0x3b47aa[_0xba4d('0x47')][_0xba4d('0x48')]){_0x16a7ad['MailAccountId']=_0x3b47aa[_0xba4d('0x47')][_0xba4d('0x48')];}else if(_0x3b47aa[_0xba4d('0x47')]['SmsAccountId']){_0x16a7ad[_0xba4d('0x49')]=_0x3b47aa[_0xba4d('0x47')][_0xba4d('0x49')];}else if(_0x3b47aa[_0xba4d('0x47')]['OpenchannelAccountId']){_0x16a7ad[_0xba4d('0x4a')]=_0x3b47aa[_0xba4d('0x47')]['OpenchannelAccountId'];}else if(_0x3b47aa[_0xba4d('0x47')]['ChatWebsiteId']){_0x16a7ad['ChatWebsiteId']=_0x3b47aa[_0xba4d('0x47')][_0xba4d('0x4b')];}return db[_0xba4d('0x2a')]['find']({'where':_0x16a7ad})[_0xba4d('0x24')](function(_0x59797f){if(_0x59797f){throw new db['Sequelize']['ValidationError'](_0xba4d('0x4c'));}return db[_0xba4d('0x2a')][_0xba4d('0x4d')](_0x3b47aa[_0xba4d('0x47')]);})[_0xba4d('0x24')](function(_0x4f7d87){var _0x5ec01b=_0x3b47aa['user'][_0xba4d('0x4e')]({'plain':!![]});if(!_0x5ec01b)throw new Error(_0xba4d('0x4f'));if(_0x5ec01b['role']===_0xba4d('0x50')){var _0x31c819=_0x4f7d87['get']({'plain':!![]});return db[_0xba4d('0x51')]['find']({'where':{'name':_0xba4d('0x52'),'userProfileId':_0x5ec01b[_0xba4d('0x53')]},'raw':!![]})[_0xba4d('0x24')](function(_0x23f629){if(_0x23f629&&_0x23f629[_0xba4d('0x54')]===0x0){return db[_0xba4d('0x55')][_0xba4d('0x4d')]({'name':_0x31c819['name'],'resourceId':_0x31c819['id'],'type':_0x23f629[_0xba4d('0x29')],'sectionId':_0x23f629['id']},{})[_0xba4d('0x24')](function(){return _0x4f7d87;});}else{return _0x4f7d87;}})[_0xba4d('0x46')](function(_0xe928f9){logger[_0xba4d('0x27')](_0xba4d('0x56'),_0xe928f9);throw _0xe928f9;});}return _0x4f7d87;})[_0xba4d('0x24')](respondWithResult(_0x11c328,0xc9))[_0xba4d('0x46')](handleError(_0x11c328,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a04723d..c6bc34f 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 _0xa1dc=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x2a5b76,_0x4d7072){var _0x2f98f2=function(_0x363aae){while(--_0x363aae){_0x2a5b76['push'](_0x2a5b76['shift']());}};_0x2f98f2(++_0x4d7072);}(_0xa1dc,0x121));var _0xca1d=function(_0x1babe5,_0x437e5c){_0x1babe5=_0x1babe5-0x0;var _0x320e74=_0xa1dc[_0x1babe5];return _0x320e74;};'use strict';var _=require(_0xca1d('0x0'));var util=require(_0xca1d('0x1'));var logger=require(_0xca1d('0x2'))('api');var moment=require(_0xca1d('0x3'));var BPromise=require(_0xca1d('0x4'));var rp=require(_0xca1d('0x5'));var attributes=require(_0xca1d('0x6'));module[_0xca1d('0x7')]=function(_0x545290,_0x3ef83b){return _0x545290['define'](_0xca1d('0x8'),attributes,{'tableName':_0xca1d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca1d('0xa'),'collate':_0xca1d('0xb')});}; \ No newline at end of file +var _0x013b=['bluebird','request-promise','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x131fbc,_0x3362f4){var _0x5a271c=function(_0x514812){while(--_0x514812){_0x131fbc['push'](_0x131fbc['shift']());}};_0x5a271c(++_0x3362f4);}(_0x013b,0x177));var _0xb013=function(_0x2cc374,_0x21c582){_0x2cc374=_0x2cc374-0x0;var _0x306658=_0x013b[_0x2cc374];return _0x306658;};'use strict';var _=require(_0xb013('0x0'));var util=require(_0xb013('0x1'));var logger=require('../../config/logger')(_0xb013('0x2'));var moment=require('moment');var BPromise=require(_0xb013('0x3'));var rp=require(_0xb013('0x4'));var attributes=require(_0xb013('0x5'));module[_0xb013('0x6')]=function(_0x157bbe,_0x24e054){return _0x157bbe['define'](_0xb013('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb013('0x8')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 26e16b3..4f6b916 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 _0x43fe=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x555d17,_0x288107){var _0x1a79d2=function(_0xa35e81){while(--_0xa35e81){_0x555d17['push'](_0x555d17['shift']());}};_0x1a79d2(++_0x288107);}(_0x43fe,0x1cd));var _0xe43f=function(_0x5365f2,_0x1a951d){_0x5365f2=_0x5365f2-0x0;var _0xce53fa=_0x43fe[_0x5365f2];return _0xce53fa;};'use strict';var _=require(_0xe43f('0x0'));var util=require(_0xe43f('0x1'));var moment=require(_0xe43f('0x2'));var BPromise=require(_0xe43f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe43f('0x4'));var db=require(_0xe43f('0x5'))['db'];var utils=require(_0xe43f('0x6'));var logger=require(_0xe43f('0x7'))(_0xe43f('0x8'));var config=require(_0xe43f('0x9'));var jayson=require(_0xe43f('0xa'));var client=jayson[_0xe43f('0xb')][_0xe43f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d83b1,_0x20c40a,_0x2e4c0a){return new BPromise(function(_0x499958,_0x278d0f){return client['request'](_0x4d83b1,_0x2e4c0a)['then'](function(_0x5de7c1){logger[_0xe43f('0xd')](_0xe43f('0xe'),_0x20c40a,_0xe43f('0xf'));logger[_0xe43f('0x10')](_0xe43f('0x11'),_0x20c40a,'request\x20sent',JSON[_0xe43f('0x12')](_0x5de7c1));if(_0x5de7c1[_0xe43f('0x13')]){if(_0x5de7c1[_0xe43f('0x13')][_0xe43f('0x14')]===0x1f4){logger[_0xe43f('0x13')](_0xe43f('0xe'),_0x20c40a,_0x5de7c1[_0xe43f('0x13')]['message']);return _0x278d0f(_0x5de7c1[_0xe43f('0x13')][_0xe43f('0x15')]);}logger[_0xe43f('0x13')](_0xe43f('0xe'),_0x20c40a,_0x5de7c1[_0xe43f('0x13')][_0xe43f('0x15')]);return _0x499958(_0x5de7c1[_0xe43f('0x13')]['message']);}else{logger[_0xe43f('0xd')](_0xe43f('0xe'),_0x20c40a,_0xe43f('0xf'));_0x499958(_0x5de7c1[_0xe43f('0x16')]['message']);}})[_0xe43f('0x17')](function(_0x2d1c5e){logger[_0xe43f('0x13')](_0xe43f('0xe'),_0x20c40a,_0x2d1c5e);_0x278d0f(_0x2d1c5e);});});} \ No newline at end of file +var _0xe61c=['client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5480de,_0x3d0516){var _0x5878e6=function(_0x1853af){while(--_0x1853af){_0x5480de['push'](_0x5480de['shift']());}};_0x5878e6(++_0x3d0516);}(_0xe61c,0x1b7));var _0xce61=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xe61c[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xce61('0x0'));var util=require(_0xce61('0x1'));var moment=require(_0xce61('0x2'));var BPromise=require(_0xce61('0x3'));var rs=require(_0xce61('0x4'));var fs=require('fs');var Redis=require(_0xce61('0x5'));var db=require(_0xce61('0x6'))['db'];var utils=require(_0xce61('0x7'));var logger=require(_0xce61('0x8'))(_0xce61('0x9'));var config=require('../../config/environment');var jayson=require(_0xce61('0xa'));var client=jayson[_0xce61('0xb')][_0xce61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x565fe7,_0x5c1851,_0x345e20){return new BPromise(function(_0x45271e,_0x88d91c){return client[_0xce61('0xd')](_0x565fe7,_0x345e20)[_0xce61('0xe')](function(_0x32035b){logger['info'](_0xce61('0xf'),_0x5c1851,_0xce61('0x10'));logger[_0xce61('0x11')](_0xce61('0x12'),_0x5c1851,_0xce61('0x10'),JSON[_0xce61('0x13')](_0x32035b));if(_0x32035b[_0xce61('0x14')]){if(_0x32035b[_0xce61('0x14')]['code']===0x1f4){logger[_0xce61('0x14')]('CannedAnswer,\x20%s,\x20%s',_0x5c1851,_0x32035b[_0xce61('0x14')]['message']);return _0x88d91c(_0x32035b[_0xce61('0x14')][_0xce61('0x15')]);}logger[_0xce61('0x14')](_0xce61('0xf'),_0x5c1851,_0x32035b['error'][_0xce61('0x15')]);return _0x45271e(_0x32035b['error'][_0xce61('0x15')]);}else{logger[_0xce61('0x16')]('CannedAnswer,\x20%s,\x20%s',_0x5c1851,'request\x20sent');_0x45271e(_0x32035b[_0xce61('0x17')][_0xce61('0x15')]);}})[_0xce61('0x18')](function(_0x4e7258){logger[_0xce61('0x14')](_0xce61('0xf'),_0x5c1851,_0x4e7258);_0x88d91c(_0x4e7258);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 1999795..3cf9b17 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 _0x2962=['post','create','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','show'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x2962,0x18c));var _0x2296=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2962[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x2296('0x0'));var util=require(_0x2296('0x1'));var path=require(_0x2296('0x2'));var timeout=require(_0x2296('0x3'));var express=require(_0x2296('0x4'));var router=express[_0x2296('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2296('0x6'));var config=require(_0x2296('0x7'));var controller=require(_0x2296('0x8'));router['get']('/',auth[_0x2296('0x9')](),controller[_0x2296('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2296('0xb')]);router[_0x2296('0xc')]('/',auth[_0x2296('0x9')](),controller[_0x2296('0xd')]);router['put'](_0x2296('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x2296('0xf')]('/:id',auth[_0x2296('0x9')](),controller[_0x2296('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd332=['/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index'];(function(_0x5d2ec8,_0x177f12){var _0x8dc3a7=function(_0x2a9c12){while(--_0x2a9c12){_0x5d2ec8['push'](_0x5d2ec8['shift']());}};_0x8dc3a7(++_0x177f12);}(_0xd332,0x84));var _0x2d33=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xd332[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0x2d33('0x0'));var util=require(_0x2d33('0x1'));var path=require(_0x2d33('0x2'));var timeout=require(_0x2d33('0x3'));var express=require(_0x2d33('0x4'));var router=express[_0x2d33('0x5')]();var auth=require(_0x2d33('0x6'));var interaction=require(_0x2d33('0x7'));var config=require('../../config/environment');var controller=require(_0x2d33('0x8'));router[_0x2d33('0x9')]('/',auth[_0x2d33('0xa')](),controller[_0x2d33('0xb')]);router[_0x2d33('0x9')](_0x2d33('0xc'),auth['isAuthenticated'](),controller[_0x2d33('0xd')]);router[_0x2d33('0xe')]('/',auth[_0x2d33('0xa')](),controller['create']);router[_0x2d33('0xf')](_0x2d33('0xc'),auth[_0x2d33('0xa')](),controller[_0x2d33('0x10')]);router['delete'](_0x2d33('0xc'),auth[_0x2d33('0xa')](),controller['destroy']);module[_0x2d33('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 233a5e5..253ab68 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 _0x4dce=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dce,0x1dd));var _0xe4dc=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x4dce[_0x37cc52];return _0x2b4a90;};'use strict';var Sequelize=require(_0xe4dc('0x0'));module[_0xe4dc('0x1')]={'calldate':{'type':Sequelize[_0xe4dc('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xe4dc('0x3')]},'dcontext':{'type':Sequelize[_0xe4dc('0x3')]},'channel':{'type':Sequelize[_0xe4dc('0x3')]},'dstchannel':{'type':Sequelize[_0xe4dc('0x3')]},'lastapp':{'type':Sequelize[_0xe4dc('0x3')]},'lastdata':{'type':Sequelize[_0xe4dc('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe4dc('0x3')]},'amaflags':{'type':Sequelize[_0xe4dc('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xe4dc('0x3')]},'uniqueid':{'type':Sequelize[_0xe4dc('0x3')]},'linkedid':{'type':Sequelize[_0xe4dc('0x3')]},'sequence':{'type':Sequelize[_0xe4dc('0x3')]},'peeraccount':{'type':Sequelize[_0xe4dc('0x3')]},'type':{'type':Sequelize[_0xe4dc('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbd2a=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x27d244,_0x4df7c4){var _0x2e68f6=function(_0x238ae2){while(--_0x238ae2){_0x27d244['push'](_0x27d244['shift']());}};_0x2e68f6(++_0x4df7c4);}(_0xbd2a,0x135));var _0xabd2=function(_0x40315d,_0x5c45d8){_0x40315d=_0x40315d-0x0;var _0x8a2844=_0xbd2a[_0x40315d];return _0x8a2844;};'use strict';var Sequelize=require(_0xabd2('0x0'));module[_0xabd2('0x1')]={'calldate':{'type':Sequelize[_0xabd2('0x2')],'allowNull':![],'defaultValue':_0xabd2('0x3')},'clid':{'type':Sequelize[_0xabd2('0x4')]},'src':{'type':Sequelize[_0xabd2('0x4')]},'dst':{'type':Sequelize[_0xabd2('0x4')]},'dcontext':{'type':Sequelize[_0xabd2('0x4')]},'channel':{'type':Sequelize[_0xabd2('0x4')]},'dstchannel':{'type':Sequelize[_0xabd2('0x4')]},'lastapp':{'type':Sequelize[_0xabd2('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xabd2('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xabd2('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xabd2('0x4')]},'amaflags':{'type':Sequelize[_0xabd2('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xabd2('0x4')]},'userfield':{'type':Sequelize[_0xabd2('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xabd2('0x4')]},'peeraccount':{'type':Sequelize[_0xabd2('0x4')]},'type':{'type':Sequelize[_0xabd2('0x4')]},'tag':{'type':Sequelize[_0xabd2('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f395d20..6d61089 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 _0xe974=['name','send','index','Cdr','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack'];(function(_0x399269,_0x38c1ee){var _0xa90608=function(_0x25af32){while(--_0x25af32){_0x399269['push'](_0x399269['shift']());}};_0xa90608(++_0x38c1ee);}(_0xe974,0x197));var _0x4e97=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0xe974[_0x9e0cb3];return _0x5926b7;};'use strict';var pdf=require(_0x4e97('0x0'));var emlformat=require(_0x4e97('0x1'));var rimraf=require(_0x4e97('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e97('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4e97('0x4'));var Mustache=require('mustache');var util=require(_0x4e97('0x5'));var path=require(_0x4e97('0x6'));var sox=require(_0x4e97('0x7'));var csv=require(_0x4e97('0x8'));var ejs=require(_0x4e97('0x9'));var fs=require('fs');var _=require(_0x4e97('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4e97('0xb'));var deskjs=require(_0x4e97('0xc'));var toCsv=require(_0x4e97('0x8'));var querystring=require(_0x4e97('0xd'));var Papa=require(_0x4e97('0xe'));var authService=require(_0x4e97('0xf'));var hardwareService=require(_0x4e97('0x10'));var Redis=require(_0x4e97('0x11'));var qs=require(_0x4e97('0x12'));var logger=require(_0x4e97('0x13'))(_0x4e97('0x14'));var utils=require(_0x4e97('0x15'));var config=require('../../config/environment');var db=require(_0x4e97('0x16'))['db'];function respondWithStatusCode(_0x3cbd96,_0x7bbcbc){_0x7bbcbc=_0x7bbcbc||0xcc;return function(_0x485588){if(_0x485588){return _0x3cbd96[_0x4e97('0x17')](_0x7bbcbc);}return _0x3cbd96[_0x4e97('0x18')](_0x7bbcbc)[_0x4e97('0x19')]();};}function respondWithResult(_0x748ac1,_0x183752){_0x183752=_0x183752||0xc8;return function(_0x30040a){if(_0x30040a){return _0x748ac1[_0x4e97('0x18')](_0x183752)[_0x4e97('0x1a')](_0x30040a);}};}function respondWithFilteredResult(_0x36ec57,_0x49084a){return function(_0x521939){if(_0x521939){var _0x4c269c=_0x521939[_0x4e97('0x1b')],_0x1be687=_0x49084a[_0x4e97('0x1c')],_0x21c6c9=_0x49084a['offset']+_0x49084a['limit'],_0x3543ca;if(_0x21c6c9>=_0x4c269c){_0x21c6c9=_0x4c269c;_0x3543ca=0xc8;}else{_0x3543ca=0xce;}_0x36ec57['status'](_0x3543ca);return _0x36ec57[_0x4e97('0x1d')](_0x4e97('0x1e'),_0x1be687+'-'+_0x21c6c9+'/'+_0x4c269c)[_0x4e97('0x1a')](_0x521939);}return null;};}function patchUpdates(_0x10dc6e){return function(_0x469844){try{jsonpatch[_0x4e97('0x1f')](_0x469844,_0x10dc6e,!![]);}catch(_0x298d3c){return BPromise[_0x4e97('0x20')](_0x298d3c);}return _0x469844['save']();};}function saveUpdates(_0x44745a,_0x3a31b8){return function(_0x471eaa){if(_0x471eaa){return _0x471eaa['update'](_0x44745a)[_0x4e97('0x21')](function(_0x4b29e9){return _0x4b29e9;});}return null;};}function removeEntity(_0x269ca7,_0x59ac9e){return function(_0x185b86){if(_0x185b86){return _0x185b86[_0x4e97('0x22')]()[_0x4e97('0x21')](function(){_0x269ca7[_0x4e97('0x18')](0xcc)[_0x4e97('0x19')]();});}};}function handleEntityNotFound(_0x18080e,_0x5c30b9){return function(_0x18247b){if(!_0x18247b){_0x18080e[_0x4e97('0x17')](0x194);}return _0x18247b;};}function handleError(_0x570180,_0x43b4ac){_0x43b4ac=_0x43b4ac||0x1f4;return function(_0xc19149){logger[_0x4e97('0x23')](_0xc19149[_0x4e97('0x24')]);if(_0xc19149[_0x4e97('0x25')]){delete _0xc19149[_0x4e97('0x25')];}_0x570180[_0x4e97('0x18')](_0x43b4ac)[_0x4e97('0x26')](_0xc19149);};}exports[_0x4e97('0x27')]=function(_0x1a6db7,_0x5e0457){var _0x1cd1cd={},_0x1392bb={},_0x44392c={'count':0x0,'rows':[]};var _0x2c9bc8=db[_0x4e97('0x28')][_0x4e97('0x29')];_0x1392bb['model']=_[_0x4e97('0x2a')](_0x2c9bc8);_0x1392bb['query']=_[_0x4e97('0x2a')](_0x1a6db7[_0x4e97('0x2b')]);_0x1392bb[_0x4e97('0x2c')]=_[_0x4e97('0x2d')](_0x1392bb[_0x4e97('0x2e')],_0x1392bb[_0x4e97('0x2b')]);_0x1cd1cd[_0x4e97('0x2f')]=_[_0x4e97('0x2d')](_0x1392bb[_0x4e97('0x2e')],qs[_0x4e97('0x30')](_0x1a6db7[_0x4e97('0x2b')][_0x4e97('0x30')]));_0x1cd1cd['attributes']=_0x1cd1cd[_0x4e97('0x2f')]['length']?_0x1cd1cd[_0x4e97('0x2f')]:_0x1392bb['model'];if(!_0x1a6db7[_0x4e97('0x2b')]['hasOwnProperty'](_0x4e97('0x31'))){_0x1cd1cd['limit']=qs[_0x4e97('0x32')](_0x1a6db7[_0x4e97('0x2b')][_0x4e97('0x32')]);_0x1cd1cd[_0x4e97('0x1c')]=qs[_0x4e97('0x1c')](_0x1a6db7[_0x4e97('0x2b')][_0x4e97('0x1c')]);}_0x1cd1cd[_0x4e97('0x33')]=qs[_0x4e97('0x34')](_0x1a6db7[_0x4e97('0x2b')]['sort']);_0x1cd1cd[_0x4e97('0x35')]=qs[_0x4e97('0x2c')](_[_0x4e97('0x36')](_0x1a6db7['query'],_0x1392bb[_0x4e97('0x2c')]));if(_0x1a6db7[_0x4e97('0x2b')]['filter']){_0x1cd1cd[_0x4e97('0x35')]=_[_0x4e97('0x37')](_0x1cd1cd['where'],{'$or':_[_0x4e97('0x38')](_0x2c9bc8,function(_0x5b08df){if(_0x5b08df['type'][_0x4e97('0x39')]!==_0x4e97('0x3a')){var _0x38c0c4={};_0x38c0c4[_0x5b08df[_0x4e97('0x3b')]]={'$like':'%'+_0x1a6db7[_0x4e97('0x2b')]['filter']+'%'};return _0x38c0c4;}})});}_0x1cd1cd=_[_0x4e97('0x37')]({},_0x1cd1cd,_0x1a6db7[_0x4e97('0x3c')]);var _0x4d387a={'where':_0x1cd1cd['where']};return db['Cdr'][_0x4e97('0x1b')](_0x4d387a)[_0x4e97('0x21')](function(_0x204157){_0x44392c[_0x4e97('0x1b')]=_0x204157;if(_0x1a6db7[_0x4e97('0x2b')][_0x4e97('0x3d')]){_0x1cd1cd[_0x4e97('0x3e')]=[{'all':!![]}];}return db[_0x4e97('0x28')][_0x4e97('0x3f')](_0x1cd1cd);})[_0x4e97('0x21')](function(_0x23f562){_0x44392c[_0x4e97('0x40')]=_0x23f562;return _0x44392c;})[_0x4e97('0x21')](respondWithFilteredResult(_0x5e0457,_0x1cd1cd))[_0x4e97('0x41')](handleError(_0x5e0457,null));};exports[_0x4e97('0x42')]=function(_0x434b68,_0x389dc9){var _0x29f28c={'raw':!![],'where':{'id':_0x434b68[_0x4e97('0x43')]['id']}},_0x4062e7={};_0x4062e7[_0x4e97('0x2e')]=_[_0x4e97('0x2a')](db[_0x4e97('0x28')]['rawAttributes']);_0x4062e7[_0x4e97('0x2b')]=_[_0x4e97('0x2a')](_0x434b68[_0x4e97('0x2b')]);_0x4062e7[_0x4e97('0x2c')]=_['intersection'](_0x4062e7[_0x4e97('0x2e')],_0x4062e7[_0x4e97('0x2b')]);_0x29f28c[_0x4e97('0x2f')]=_[_0x4e97('0x2d')](_0x4062e7[_0x4e97('0x2e')],qs['fields'](_0x434b68[_0x4e97('0x2b')]['fields']));_0x29f28c[_0x4e97('0x2f')]=_0x29f28c[_0x4e97('0x2f')][_0x4e97('0x44')]?_0x29f28c[_0x4e97('0x2f')]:_0x4062e7['model'];if(_0x434b68['query'][_0x4e97('0x3d')]){_0x29f28c[_0x4e97('0x3e')]=[{'all':!![]}];}_0x29f28c=_['merge']({},_0x29f28c,_0x434b68[_0x4e97('0x3c')]);return db[_0x4e97('0x28')][_0x4e97('0x45')](_0x29f28c)[_0x4e97('0x21')](handleEntityNotFound(_0x389dc9,null))[_0x4e97('0x21')](respondWithResult(_0x389dc9,null))[_0x4e97('0x41')](handleError(_0x389dc9,null));};exports[_0x4e97('0x46')]=function(_0x514937,_0x1899c3){return db[_0x4e97('0x28')][_0x4e97('0x46')](_0x514937[_0x4e97('0x47')],{})[_0x4e97('0x21')](respondWithResult(_0x1899c3,0xc9))['catch'](handleError(_0x1899c3,null));};exports[_0x4e97('0x48')]=function(_0x3dcbe7,_0x7fc71b){if(_0x3dcbe7[_0x4e97('0x47')]['id']){delete _0x3dcbe7[_0x4e97('0x47')]['id'];}return db[_0x4e97('0x28')][_0x4e97('0x45')]({'where':{'id':_0x3dcbe7[_0x4e97('0x43')]['id']}})['then'](handleEntityNotFound(_0x7fc71b,null))[_0x4e97('0x21')](saveUpdates(_0x3dcbe7[_0x4e97('0x47')],null))[_0x4e97('0x21')](respondWithResult(_0x7fc71b,null))[_0x4e97('0x41')](handleError(_0x7fc71b,null));};exports['destroy']=function(_0x3e06ec,_0x1af948){return db['Cdr']['find']({'where':{'id':_0x3e06ec[_0x4e97('0x43')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x1af948,null))[_0x4e97('0x21')](removeEntity(_0x1af948,null))[_0x4e97('0x41')](handleError(_0x1af948,null));};exports[_0x4e97('0x49')]=function(_0x2e1448,_0x1e5d77){return db[_0x4e97('0x28')][_0x4e97('0x49')]()[_0x4e97('0x21')](respondWithResult(_0x1e5d77,null))['catch'](handleError(_0x1e5d77,null));}; \ No newline at end of file +var _0x60b6=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x60b6,0xd2));var _0x660b=function(_0x5a256e,_0x26ebd7){_0x5a256e=_0x5a256e-0x0;var _0x53c58a=_0x60b6[_0x5a256e];return _0x53c58a;};'use strict';var pdf=require(_0x660b('0x0'));var emlformat=require(_0x660b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x660b('0x2'));var jsonpatch=require(_0x660b('0x3'));var rp=require(_0x660b('0x4'));var moment=require('moment');var BPromise=require(_0x660b('0x5'));var Mustache=require(_0x660b('0x6'));var util=require('util');var path=require(_0x660b('0x7'));var sox=require(_0x660b('0x8'));var csv=require(_0x660b('0x9'));var ejs=require(_0x660b('0xa'));var fs=require('fs');var _=require(_0x660b('0xb'));var squel=require(_0x660b('0xc'));var crypto=require(_0x660b('0xd'));var jsforce=require(_0x660b('0xe'));var deskjs=require(_0x660b('0xf'));var toCsv=require(_0x660b('0x9'));var querystring=require(_0x660b('0x10'));var Papa=require(_0x660b('0x11'));var authService=require(_0x660b('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x660b('0x13'));var logger=require(_0x660b('0x14'))(_0x660b('0x15'));var utils=require(_0x660b('0x16'));var config=require(_0x660b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19451d,_0x23edfd){_0x23edfd=_0x23edfd||0xcc;return function(_0x283e3e){if(_0x283e3e){return _0x19451d[_0x660b('0x18')](_0x23edfd);}return _0x19451d['status'](_0x23edfd)[_0x660b('0x19')]();};}function respondWithResult(_0x1d3e60,_0x268ea5){_0x268ea5=_0x268ea5||0xc8;return function(_0x261aab){if(_0x261aab){return _0x1d3e60[_0x660b('0x1a')](_0x268ea5)[_0x660b('0x1b')](_0x261aab);}};}function respondWithFilteredResult(_0x313eaa,_0x1f6133){return function(_0x24f352){if(_0x24f352){var _0x3e1683=_0x24f352[_0x660b('0x1c')],_0x456455=_0x1f6133[_0x660b('0x1d')],_0x5693d6=_0x1f6133['offset']+_0x1f6133[_0x660b('0x1e')],_0x201fd0;if(_0x5693d6>=_0x3e1683){_0x5693d6=_0x3e1683;_0x201fd0=0xc8;}else{_0x201fd0=0xce;}_0x313eaa[_0x660b('0x1a')](_0x201fd0);return _0x313eaa['set'](_0x660b('0x1f'),_0x456455+'-'+_0x5693d6+'/'+_0x3e1683)[_0x660b('0x1b')](_0x24f352);}return null;};}function patchUpdates(_0x7a85d7){return function(_0x252a6f){try{jsonpatch[_0x660b('0x20')](_0x252a6f,_0x7a85d7,!![]);}catch(_0x6195b3){return BPromise['reject'](_0x6195b3);}return _0x252a6f[_0x660b('0x21')]();};}function saveUpdates(_0x2a5e3a,_0x46ae02){return function(_0x209790){if(_0x209790){return _0x209790['update'](_0x2a5e3a)[_0x660b('0x22')](function(_0x2fd19a){return _0x2fd19a;});}return null;};}function removeEntity(_0xda096b,_0x53e0d2){return function(_0x5a1fe8){if(_0x5a1fe8){return _0x5a1fe8[_0x660b('0x23')]()[_0x660b('0x22')](function(){_0xda096b[_0x660b('0x1a')](0xcc)[_0x660b('0x19')]();});}};}function handleEntityNotFound(_0x47024a,_0x208a8a){return function(_0x3c0f9a){if(!_0x3c0f9a){_0x47024a[_0x660b('0x18')](0x194);}return _0x3c0f9a;};}function handleError(_0x2c94e1,_0x440011){_0x440011=_0x440011||0x1f4;return function(_0x1f3d64){logger[_0x660b('0x24')](_0x1f3d64[_0x660b('0x25')]);if(_0x1f3d64[_0x660b('0x26')]){delete _0x1f3d64['name'];}_0x2c94e1[_0x660b('0x1a')](_0x440011)[_0x660b('0x27')](_0x1f3d64);};}exports[_0x660b('0x28')]=function(_0xc67607,_0x492527){var _0x341d3f={},_0x1101f4={},_0x40fb4e={'count':0x0,'rows':[]};var _0x47b712=db[_0x660b('0x29')][_0x660b('0x2a')];_0x1101f4[_0x660b('0x2b')]=_[_0x660b('0x2c')](_0x47b712);_0x1101f4['query']=_[_0x660b('0x2c')](_0xc67607[_0x660b('0x2d')]);_0x1101f4[_0x660b('0x2e')]=_[_0x660b('0x2f')](_0x1101f4[_0x660b('0x2b')],_0x1101f4['query']);_0x341d3f[_0x660b('0x30')]=_['intersection'](_0x1101f4[_0x660b('0x2b')],qs[_0x660b('0x31')](_0xc67607[_0x660b('0x2d')]['fields']));_0x341d3f[_0x660b('0x30')]=_0x341d3f[_0x660b('0x30')][_0x660b('0x32')]?_0x341d3f['attributes']:_0x1101f4['model'];if(!_0xc67607['query'][_0x660b('0x33')]('nolimit')){_0x341d3f[_0x660b('0x1e')]=qs[_0x660b('0x1e')](_0xc67607[_0x660b('0x2d')][_0x660b('0x1e')]);_0x341d3f[_0x660b('0x1d')]=qs[_0x660b('0x1d')](_0xc67607['query'][_0x660b('0x1d')]);}_0x341d3f['order']=qs[_0x660b('0x34')](_0xc67607[_0x660b('0x2d')]['sort']);_0x341d3f[_0x660b('0x35')]=qs[_0x660b('0x2e')](_['pick'](_0xc67607[_0x660b('0x2d')],_0x1101f4['filters']));if(_0xc67607[_0x660b('0x2d')][_0x660b('0x36')]){_0x341d3f[_0x660b('0x35')]=_[_0x660b('0x37')](_0x341d3f[_0x660b('0x35')],{'$or':_[_0x660b('0x38')](_0x47b712,function(_0x2abe99){if(_0x2abe99[_0x660b('0x39')]['key']!==_0x660b('0x3a')){var _0x31fca6={};_0x31fca6[_0x2abe99[_0x660b('0x3b')]]={'$like':'%'+_0xc67607[_0x660b('0x2d')]['filter']+'%'};return _0x31fca6;}})});}_0x341d3f=_[_0x660b('0x37')]({},_0x341d3f,_0xc67607[_0x660b('0x3c')]);var _0x3c805={'where':_0x341d3f[_0x660b('0x35')]};return db[_0x660b('0x29')][_0x660b('0x1c')](_0x3c805)['then'](function(_0x5b6b02){_0x40fb4e['count']=_0x5b6b02;if(_0xc67607['query'][_0x660b('0x3d')]){_0x341d3f[_0x660b('0x3e')]=[{'all':!![]}];}return db[_0x660b('0x29')]['findAll'](_0x341d3f);})[_0x660b('0x22')](function(_0x192588){_0x40fb4e[_0x660b('0x3f')]=_0x192588;return _0x40fb4e;})[_0x660b('0x22')](respondWithFilteredResult(_0x492527,_0x341d3f))[_0x660b('0x40')](handleError(_0x492527,null));};exports[_0x660b('0x41')]=function(_0x510940,_0x339627){var _0x59d198={'raw':!![],'where':{'id':_0x510940[_0x660b('0x42')]['id']}},_0x778216={};_0x778216[_0x660b('0x2b')]=_[_0x660b('0x2c')](db[_0x660b('0x29')][_0x660b('0x2a')]);_0x778216[_0x660b('0x2d')]=_[_0x660b('0x2c')](_0x510940[_0x660b('0x2d')]);_0x778216['filters']=_['intersection'](_0x778216['model'],_0x778216['query']);_0x59d198[_0x660b('0x30')]=_[_0x660b('0x2f')](_0x778216[_0x660b('0x2b')],qs[_0x660b('0x31')](_0x510940[_0x660b('0x2d')]['fields']));_0x59d198[_0x660b('0x30')]=_0x59d198[_0x660b('0x30')]['length']?_0x59d198[_0x660b('0x30')]:_0x778216[_0x660b('0x2b')];if(_0x510940[_0x660b('0x2d')][_0x660b('0x3d')]){_0x59d198[_0x660b('0x3e')]=[{'all':!![]}];}_0x59d198=_[_0x660b('0x37')]({},_0x59d198,_0x510940[_0x660b('0x3c')]);return db['Cdr'][_0x660b('0x43')](_0x59d198)[_0x660b('0x22')](handleEntityNotFound(_0x339627,null))[_0x660b('0x22')](respondWithResult(_0x339627,null))[_0x660b('0x40')](handleError(_0x339627,null));};exports[_0x660b('0x44')]=function(_0x3c47f0,_0x30dbce){return db['Cdr'][_0x660b('0x44')](_0x3c47f0[_0x660b('0x45')],{})[_0x660b('0x22')](respondWithResult(_0x30dbce,0xc9))[_0x660b('0x40')](handleError(_0x30dbce,null));};exports[_0x660b('0x46')]=function(_0x1f1580,_0x286d38){if(_0x1f1580[_0x660b('0x45')]['id']){delete _0x1f1580['body']['id'];}return db[_0x660b('0x29')][_0x660b('0x43')]({'where':{'id':_0x1f1580[_0x660b('0x42')]['id']}})['then'](handleEntityNotFound(_0x286d38,null))[_0x660b('0x22')](saveUpdates(_0x1f1580['body'],null))[_0x660b('0x22')](respondWithResult(_0x286d38,null))[_0x660b('0x40')](handleError(_0x286d38,null));};exports[_0x660b('0x23')]=function(_0x493580,_0x91717b){return db[_0x660b('0x29')]['find']({'where':{'id':_0x493580[_0x660b('0x42')]['id']}})[_0x660b('0x22')](handleEntityNotFound(_0x91717b,null))[_0x660b('0x22')](removeEntity(_0x91717b,null))['catch'](handleError(_0x91717b,null));};exports[_0x660b('0x47')]=function(_0x5bb32a,_0x422027){return db['Cdr']['describe']()[_0x660b('0x22')](respondWithResult(_0x422027,null))[_0x660b('0x40')](handleError(_0x422027,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 88d597f..d343a93 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 _0x70b9=['src','uniqueid','util','api','moment','bluebird','request-promise','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x70b9,0x13a));var _0x970b=function(_0x42c02c,_0xe91754){_0x42c02c=_0x42c02c-0x0;var _0x239173=_0x70b9[_0x42c02c];return _0x239173;};'use strict';var _=require('lodash');var util=require(_0x970b('0x0'));var logger=require('../../config/logger')(_0x970b('0x1'));var moment=require(_0x970b('0x2'));var BPromise=require(_0x970b('0x3'));var rp=require(_0x970b('0x4'));var attributes=require('./cdr.attributes');module[_0x970b('0x5')]=function(_0xaccff0,_0x482436){return _0xaccff0[_0x970b('0x6')](_0x970b('0x7'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x970b('0x8')]},{'name':_0x970b('0x9'),'fields':['calldate']},{'name':'disposition','fields':[_0x970b('0xa')]},{'name':'dst','fields':['dst']},{'name':'src','fields':[_0x970b('0xb')]},{'name':_0x970b('0xc'),'fields':[_0x970b('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2393=['Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','../../config/logger','api','moment','request-promise','define'];(function(_0x20a0ab,_0xb2b5a0){var _0x4acfd2=function(_0x1cf14b){while(--_0x1cf14b){_0x20a0ab['push'](_0x20a0ab['shift']());}};_0x4acfd2(++_0xb2b5a0);}(_0x2393,0x120));var _0x3239=function(_0x20a13e,_0x1a131f){_0x20a13e=_0x20a13e-0x0;var _0x46e1c0=_0x2393[_0x20a13e];return _0x46e1c0;};'use strict';var _=require(_0x3239('0x0'));var util=require('util');var logger=require(_0x3239('0x1'))(_0x3239('0x2'));var moment=require(_0x3239('0x3'));var BPromise=require('bluebird');var rp=require(_0x3239('0x4'));var attributes=require('./cdr.attributes');module['exports']=function(_0x5d4210,_0x59637e){return _0x5d4210[_0x3239('0x5')](_0x3239('0x6'),attributes,{'tableName':_0x3239('0x7'),'paranoid':![],'indexes':[{'name':_0x3239('0x8'),'fields':[_0x3239('0x8')]},{'name':_0x3239('0x9'),'fields':[_0x3239('0x9')]},{'name':_0x3239('0xa'),'fields':[_0x3239('0xa')]},{'name':_0x3239('0xb'),'fields':[_0x3239('0xb')]},{'name':_0x3239('0xc'),'fields':[_0x3239('0xc')]},{'name':_0x3239('0xd'),'fields':[_0x3239('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f332249..61bceab 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 _0x236c=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug'];(function(_0x38bfb4,_0x1cefed){var _0x53d1a4=function(_0x3b6a12){while(--_0x3b6a12){_0x38bfb4['push'](_0x38bfb4['shift']());}};_0x53d1a4(++_0x1cefed);}(_0x236c,0x1bf));var _0xc236=function(_0x38587e,_0x1dcaf9){_0x38587e=_0x38587e-0x0;var _0x2297cd=_0x236c[_0x38587e];return _0x2297cd;};'use strict';var _=require(_0xc236('0x0'));var util=require(_0xc236('0x1'));var moment=require('moment');var BPromise=require(_0xc236('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc236('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc236('0x4'));var logger=require(_0xc236('0x5'))('rpc');var config=require(_0xc236('0x6'));var jayson=require(_0xc236('0x7'));var client=jayson[_0xc236('0x8')][_0xc236('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f630c,_0x2ffa9e,_0x56f988){return new BPromise(function(_0x225af1,_0x1dc62f){return client[_0xc236('0xa')](_0x1f630c,_0x56f988)[_0xc236('0xb')](function(_0x5631ac){logger[_0xc236('0xc')](_0xc236('0xd'),_0x2ffa9e,'request\x20sent');logger[_0xc236('0xe')](_0xc236('0xf'),_0x2ffa9e,_0xc236('0x10'),JSON[_0xc236('0x11')](_0x5631ac));if(_0x5631ac['error']){if(_0x5631ac[_0xc236('0x12')]['code']===0x1f4){logger['error'](_0xc236('0xd'),_0x2ffa9e,_0x5631ac[_0xc236('0x12')][_0xc236('0x13')]);return _0x1dc62f(_0x5631ac[_0xc236('0x12')][_0xc236('0x13')]);}logger[_0xc236('0x12')](_0xc236('0xd'),_0x2ffa9e,_0x5631ac['error'][_0xc236('0x13')]);return _0x225af1(_0x5631ac['error'][_0xc236('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x2ffa9e,_0xc236('0x10'));_0x225af1(_0x5631ac[_0xc236('0x14')][_0xc236('0x13')]);}})[_0xc236('0x15')](function(_0x4cd8e1){logger[_0xc236('0x12')](_0xc236('0xd'),_0x2ffa9e,_0x4cd8e1);_0x1dc62f(_0x4cd8e1);});});} \ No newline at end of file +var _0xd7fa=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','util'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xd7fa,0x1a3));var _0xad7f=function(_0x120ae5,_0x2be519){_0x120ae5=_0x120ae5-0x0;var _0x3878c6=_0xd7fa[_0x120ae5];return _0x3878c6;};'use strict';var _=require('lodash');var util=require(_0xad7f('0x0'));var moment=require(_0xad7f('0x1'));var BPromise=require(_0xad7f('0x2'));var rs=require(_0xad7f('0x3'));var fs=require('fs');var Redis=require(_0xad7f('0x4'));var db=require(_0xad7f('0x5'))['db'];var utils=require(_0xad7f('0x6'));var logger=require('../../config/logger')(_0xad7f('0x7'));var config=require(_0xad7f('0x8'));var jayson=require(_0xad7f('0x9'));var client=jayson['client'][_0xad7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49e8c3,_0x388020,_0x44d8d0){return new BPromise(function(_0x54ed1e,_0x557ee4){return client[_0xad7f('0xb')](_0x49e8c3,_0x44d8d0)['then'](function(_0x5a1120){logger[_0xad7f('0xc')]('Cdr,\x20%s,\x20%s',_0x388020,_0xad7f('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x388020,_0xad7f('0xd'),JSON[_0xad7f('0xe')](_0x5a1120));if(_0x5a1120[_0xad7f('0xf')]){if(_0x5a1120[_0xad7f('0xf')][_0xad7f('0x10')]===0x1f4){logger['error'](_0xad7f('0x11'),_0x388020,_0x5a1120[_0xad7f('0xf')]['message']);return _0x557ee4(_0x5a1120[_0xad7f('0xf')][_0xad7f('0x12')]);}logger[_0xad7f('0xf')](_0xad7f('0x11'),_0x388020,_0x5a1120[_0xad7f('0xf')][_0xad7f('0x12')]);return _0x54ed1e(_0x5a1120[_0xad7f('0xf')][_0xad7f('0x12')]);}else{logger[_0xad7f('0xc')](_0xad7f('0x11'),_0x388020,_0xad7f('0xd'));_0x54ed1e(_0x5a1120[_0xad7f('0x13')][_0xad7f('0x12')]);}})[_0xad7f('0x14')](function(_0x1b14f9){logger[_0xad7f('0xf')]('Cdr,\x20%s,\x20%s',_0x388020,_0x1b14f9);_0x557ee4(_0x1b14f9);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 375e66c..c2ef6e5 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 _0x4f5d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x4f5d[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var path=require(_0xd4f5('0x2'));var timeout=require(_0xd4f5('0x3'));var express=require(_0xd4f5('0x4'));var router=express[_0xd4f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4f5('0x6'));var config=require(_0xd4f5('0x7'));var controller=require(_0xd4f5('0x8'));router[_0xd4f5('0x9')]('/',auth[_0xd4f5('0xa')](),controller[_0xd4f5('0xb')]);router[_0xd4f5('0x9')](_0xd4f5('0xc'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0xd')]);router[_0xd4f5('0x9')](_0xd4f5('0xe'),auth[_0xd4f5('0xa')](),controller['show']);router[_0xd4f5('0xf')]('/',auth[_0xd4f5('0xa')](),controller['create']);router[_0xd4f5('0x10')](_0xd4f5('0xe'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x11')]);router[_0xd4f5('0x12')](_0xd4f5('0xe'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x13')]);module[_0xd4f5('0x14')]=router; \ No newline at end of file +var _0x0d74=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','util','Router'];(function(_0x284aff,_0x39a70d){var _0x379917=function(_0x31d1d3){while(--_0x31d1d3){_0x284aff['push'](_0x284aff['shift']());}};_0x379917(++_0x39a70d);}(_0x0d74,0x1c9));var _0x40d7=function(_0x3255fa,_0x5a7050){_0x3255fa=_0x3255fa-0x0;var _0x5f0e53=_0x0d74[_0x3255fa];return _0x5f0e53;};'use strict';var multer=require('multer');var util=require(_0x40d7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x40d7('0x1')]();var auth=require(_0x40d7('0x2'));var interaction=require(_0x40d7('0x3'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0x40d7('0x4')]('/',auth[_0x40d7('0x5')](),controller[_0x40d7('0x6')]);router[_0x40d7('0x4')](_0x40d7('0x7'),auth[_0x40d7('0x5')](),controller[_0x40d7('0x8')]);router[_0x40d7('0x4')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x40d7('0x9')]('/',auth[_0x40d7('0x5')](),controller[_0x40d7('0xa')]);router[_0x40d7('0xb')](_0x40d7('0xc'),auth[_0x40d7('0x5')](),controller[_0x40d7('0xd')]);router[_0x40d7('0xe')](_0x40d7('0xc'),auth[_0x40d7('0x5')](),controller[_0x40d7('0xf')]);module[_0x40d7('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 588b172..6da487e 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 _0xf2e3=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x128239,_0x30a688){var _0x5543df=function(_0x251c03){while(--_0x251c03){_0x128239['push'](_0x128239['shift']());}};_0x5543df(++_0x30a688);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf2e3[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x3f2e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3f2e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3f2e('0x2')],'allowNull':![],'defaultValue':_0x3f2e('0x3')},'appdata':{'type':Sequelize[_0x3f2e('0x4')]()},'description':{'type':Sequelize[_0x3f2e('0x2')]},'interval':{'type':Sequelize[_0x3f2e('0x2')],'defaultValue':_0x3f2e('0x5')}}; \ No newline at end of file +var _0x4e39=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x55d872,_0x2f5cc2){var _0x5abd97=function(_0x1ba514){while(--_0x1ba514){_0x55d872['push'](_0x55d872['shift']());}};_0x5abd97(++_0x2f5cc2);}(_0x4e39,0x95));var _0x94e3=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x4e39[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require(_0x94e3('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x94e3('0x1')],'allowNull':![],'defaultValue':_0x94e3('0x2')},'appdata':{'type':Sequelize[_0x94e3('0x3')]()},'description':{'type':Sequelize[_0x94e3('0x1')]},'interval':{'type':Sequelize[_0x94e3('0x1')],'defaultValue':_0x94e3('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 34d6c7c..7f350d8 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 _0xbd1b=['error','name','send','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','json','apply','update','destroy','then','sendStatus'];(function(_0x327deb,_0xabcd75){var _0xe15245=function(_0x19be9c){while(--_0x19be9c){_0x327deb['push'](_0x327deb['shift']());}};_0xe15245(++_0xabcd75);}(_0xbd1b,0x187));var _0xbbd1=function(_0x100df0,_0x43beed){_0x100df0=_0x100df0-0x0;var _0x2116a6=_0xbd1b[_0x100df0];return _0x2116a6;};'use strict';var pdf=require(_0xbbd1('0x0'));var emlformat=require(_0xbbd1('0x1'));var rimraf=require(_0xbbd1('0x2'));var zipdir=require(_0xbbd1('0x3'));var jsonpatch=require(_0xbbd1('0x4'));var rp=require(_0xbbd1('0x5'));var moment=require(_0xbbd1('0x6'));var BPromise=require(_0xbbd1('0x7'));var Mustache=require(_0xbbd1('0x8'));var util=require('util');var path=require(_0xbbd1('0x9'));var sox=require(_0xbbd1('0xa'));var csv=require(_0xbbd1('0xb'));var ejs=require(_0xbbd1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbbd1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xbbd1('0xd'));var hardwareService=require(_0xbbd1('0xe'));var Redis=require(_0xbbd1('0xf'));var qs=require(_0xbbd1('0x10'));var logger=require(_0xbbd1('0x11'))(_0xbbd1('0x12'));var utils=require('../../config/utils');var config=require(_0xbbd1('0x13'));var db=require(_0xbbd1('0x14'))['db'];function respondWithStatusCode(_0x56ab77,_0x402c54){_0x402c54=_0x402c54||0xcc;return function(_0x3c3375){if(_0x3c3375){return _0x56ab77['sendStatus'](_0x402c54);}return _0x56ab77['status'](_0x402c54)[_0xbbd1('0x15')]();};}function respondWithResult(_0x264397,_0x5aee82){_0x5aee82=_0x5aee82||0xc8;return function(_0x5c5e43){if(_0x5c5e43){return _0x264397[_0xbbd1('0x16')](_0x5aee82)['json'](_0x5c5e43);}};}function respondWithFilteredResult(_0x48b6c6,_0x4fa3c4){return function(_0x54c005){if(_0x54c005){var _0x4e0596=_0x54c005[_0xbbd1('0x17')],_0x21b5e7=_0x4fa3c4[_0xbbd1('0x18')],_0x1973db=_0x4fa3c4[_0xbbd1('0x18')]+_0x4fa3c4[_0xbbd1('0x19')],_0x8e9252;if(_0x1973db>=_0x4e0596){_0x1973db=_0x4e0596;_0x8e9252=0xc8;}else{_0x8e9252=0xce;}_0x48b6c6[_0xbbd1('0x16')](_0x8e9252);return _0x48b6c6[_0xbbd1('0x1a')]('Content-Range',_0x21b5e7+'-'+_0x1973db+'/'+_0x4e0596)[_0xbbd1('0x1b')](_0x54c005);}return null;};}function patchUpdates(_0x25d842){return function(_0x13258d){try{jsonpatch[_0xbbd1('0x1c')](_0x13258d,_0x25d842,!![]);}catch(_0x4882e9){return BPromise['reject'](_0x4882e9);}return _0x13258d['save']();};}function saveUpdates(_0x137591,_0x38f967){return function(_0x571b5f){if(_0x571b5f){return _0x571b5f[_0xbbd1('0x1d')](_0x137591)['then'](function(_0x1ee15b){return _0x1ee15b;});}return null;};}function removeEntity(_0x47d368,_0x167435){return function(_0x371086){if(_0x371086){return _0x371086[_0xbbd1('0x1e')]()[_0xbbd1('0x1f')](function(){_0x47d368['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a6147,_0x4c4556){return function(_0x2069ad){if(!_0x2069ad){_0x4a6147[_0xbbd1('0x20')](0x194);}return _0x2069ad;};}function handleError(_0xc8245c,_0x1ee762){_0x1ee762=_0x1ee762||0x1f4;return function(_0x2ff040){logger[_0xbbd1('0x21')](_0x2ff040['stack']);if(_0x2ff040['name']){delete _0x2ff040[_0xbbd1('0x22')];}_0xc8245c[_0xbbd1('0x16')](_0x1ee762)[_0xbbd1('0x23')](_0x2ff040);};}exports[_0xbbd1('0x24')]=function(_0x60628d,_0x59f0fd){var _0x5b1e0c={'raw':!![],'where':{'id':_0x60628d['params']['id']}},_0x2af4a2={};_0x2af4a2[_0xbbd1('0x25')]=_[_0xbbd1('0x26')](db['ChatApplication'][_0xbbd1('0x27')]);_0x2af4a2[_0xbbd1('0x28')]=_[_0xbbd1('0x26')](_0x60628d[_0xbbd1('0x28')]);_0x2af4a2['filters']=_[_0xbbd1('0x29')](_0x2af4a2['model'],_0x2af4a2[_0xbbd1('0x28')]);_0x5b1e0c[_0xbbd1('0x2a')]=_[_0xbbd1('0x29')](_0x2af4a2[_0xbbd1('0x25')],qs[_0xbbd1('0x2b')](_0x60628d['query']['fields']));_0x5b1e0c[_0xbbd1('0x2a')]=_0x5b1e0c[_0xbbd1('0x2a')][_0xbbd1('0x2c')]?_0x5b1e0c[_0xbbd1('0x2a')]:_0x2af4a2['model'];if(_0x60628d['query']['includeAll']){_0x5b1e0c[_0xbbd1('0x2d')]=[{'all':!![]}];}_0x5b1e0c=_[_0xbbd1('0x2e')]({},_0x5b1e0c,_0x60628d[_0xbbd1('0x2f')]);return db[_0xbbd1('0x30')][_0xbbd1('0x31')](_0x5b1e0c)[_0xbbd1('0x1f')](handleEntityNotFound(_0x59f0fd,null))[_0xbbd1('0x1f')](respondWithResult(_0x59f0fd,null))[_0xbbd1('0x32')](handleError(_0x59f0fd,null));};exports[_0xbbd1('0x1d')]=function(_0x36c7eb,_0x3a473c){if(_0x36c7eb[_0xbbd1('0x33')]['id']){delete _0x36c7eb[_0xbbd1('0x33')]['id'];}return db[_0xbbd1('0x30')][_0xbbd1('0x31')]({'where':{'id':_0x36c7eb[_0xbbd1('0x34')]['id']}})[_0xbbd1('0x1f')](handleEntityNotFound(_0x3a473c,null))[_0xbbd1('0x1f')](saveUpdates(_0x36c7eb[_0xbbd1('0x33')],null))[_0xbbd1('0x1f')](respondWithResult(_0x3a473c,null))[_0xbbd1('0x32')](handleError(_0x3a473c,null));};exports['destroy']=function(_0x4778d0,_0x208a2){return db[_0xbbd1('0x30')][_0xbbd1('0x31')]({'where':{'id':_0x4778d0[_0xbbd1('0x34')]['id']}})[_0xbbd1('0x1f')](handleEntityNotFound(_0x208a2,null))[_0xbbd1('0x1f')](removeEntity(_0x208a2,null))['catch'](handleError(_0x208a2,null));}; \ No newline at end of file +var _0xcd56=['html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','then','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','update','body','destroy','params'];(function(_0x39f470,_0x30a1bc){var _0x3ea2a5=function(_0x495464){while(--_0x495464){_0x39f470['push'](_0x39f470['shift']());}};_0x3ea2a5(++_0x30a1bc);}(_0xcd56,0xb1));var _0x6cd5=function(_0x19aebe,_0x125942){_0x19aebe=_0x19aebe-0x0;var _0x6c9df4=_0xcd56[_0x19aebe];return _0x6c9df4;};'use strict';var pdf=require(_0x6cd5('0x0'));var emlformat=require(_0x6cd5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6cd5('0x2'));var jsonpatch=require(_0x6cd5('0x3'));var rp=require('request-promise');var moment=require(_0x6cd5('0x4'));var BPromise=require(_0x6cd5('0x5'));var Mustache=require(_0x6cd5('0x6'));var util=require('util');var path=require(_0x6cd5('0x7'));var sox=require(_0x6cd5('0x8'));var csv=require(_0x6cd5('0x9'));var ejs=require(_0x6cd5('0xa'));var fs=require('fs');var _=require(_0x6cd5('0xb'));var squel=require('squel');var crypto=require(_0x6cd5('0xc'));var jsforce=require(_0x6cd5('0xd'));var deskjs=require(_0x6cd5('0xe'));var toCsv=require(_0x6cd5('0x9'));var querystring=require(_0x6cd5('0xf'));var Papa=require(_0x6cd5('0x10'));var authService=require(_0x6cd5('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6cd5('0x12'));var qs=require(_0x6cd5('0x13'));var logger=require(_0x6cd5('0x14'))(_0x6cd5('0x15'));var utils=require(_0x6cd5('0x16'));var config=require(_0x6cd5('0x17'));var db=require(_0x6cd5('0x18'))['db'];function respondWithStatusCode(_0x2af75b,_0xf9216d){_0xf9216d=_0xf9216d||0xcc;return function(_0x3a859a){if(_0x3a859a){return _0x2af75b[_0x6cd5('0x19')](_0xf9216d);}return _0x2af75b[_0x6cd5('0x1a')](_0xf9216d)['end']();};}function respondWithResult(_0x556306,_0x19cde3){_0x19cde3=_0x19cde3||0xc8;return function(_0x2be832){if(_0x2be832){return _0x556306[_0x6cd5('0x1a')](_0x19cde3)[_0x6cd5('0x1b')](_0x2be832);}};}function respondWithFilteredResult(_0x563b9e,_0x5f0b12){return function(_0x264f10){if(_0x264f10){var _0x4d2382=_0x264f10[_0x6cd5('0x1c')],_0x4982f1=_0x5f0b12[_0x6cd5('0x1d')],_0x8443f1=_0x5f0b12[_0x6cd5('0x1d')]+_0x5f0b12[_0x6cd5('0x1e')],_0x1a958c;if(_0x8443f1>=_0x4d2382){_0x8443f1=_0x4d2382;_0x1a958c=0xc8;}else{_0x1a958c=0xce;}_0x563b9e[_0x6cd5('0x1a')](_0x1a958c);return _0x563b9e[_0x6cd5('0x1f')]('Content-Range',_0x4982f1+'-'+_0x8443f1+'/'+_0x4d2382)[_0x6cd5('0x1b')](_0x264f10);}return null;};}function patchUpdates(_0x267ee7){return function(_0x3ecc0f){try{jsonpatch[_0x6cd5('0x20')](_0x3ecc0f,_0x267ee7,!![]);}catch(_0x2a4be7){return BPromise[_0x6cd5('0x21')](_0x2a4be7);}return _0x3ecc0f['save']();};}function saveUpdates(_0x37f8d7,_0x420263){return function(_0x53292e){if(_0x53292e){return _0x53292e['update'](_0x37f8d7)[_0x6cd5('0x22')](function(_0x111ffe){return _0x111ffe;});}return null;};}function removeEntity(_0x11c414,_0x1e5519){return function(_0x44052d){if(_0x44052d){return _0x44052d['destroy']()[_0x6cd5('0x22')](function(){_0x11c414[_0x6cd5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a0e27,_0x211c3e){return function(_0xe37dd){if(!_0xe37dd){_0x2a0e27[_0x6cd5('0x19')](0x194);}return _0xe37dd;};}function handleError(_0x5e7635,_0x336040){_0x336040=_0x336040||0x1f4;return function(_0x18797d){logger[_0x6cd5('0x23')](_0x18797d[_0x6cd5('0x24')]);if(_0x18797d[_0x6cd5('0x25')]){delete _0x18797d[_0x6cd5('0x25')];}_0x5e7635[_0x6cd5('0x1a')](_0x336040)[_0x6cd5('0x26')](_0x18797d);};}exports[_0x6cd5('0x27')]=function(_0x3c7d59,_0x7a236a){var _0xcddbfb={'raw':!![],'where':{'id':_0x3c7d59['params']['id']}},_0x396b73={};_0x396b73[_0x6cd5('0x28')]=_[_0x6cd5('0x29')](db[_0x6cd5('0x2a')][_0x6cd5('0x2b')]);_0x396b73[_0x6cd5('0x2c')]=_[_0x6cd5('0x29')](_0x3c7d59['query']);_0x396b73[_0x6cd5('0x2d')]=_[_0x6cd5('0x2e')](_0x396b73[_0x6cd5('0x28')],_0x396b73[_0x6cd5('0x2c')]);_0xcddbfb[_0x6cd5('0x2f')]=_[_0x6cd5('0x2e')](_0x396b73[_0x6cd5('0x28')],qs[_0x6cd5('0x30')](_0x3c7d59[_0x6cd5('0x2c')][_0x6cd5('0x30')]));_0xcddbfb[_0x6cd5('0x2f')]=_0xcddbfb[_0x6cd5('0x2f')][_0x6cd5('0x31')]?_0xcddbfb['attributes']:_0x396b73[_0x6cd5('0x28')];if(_0x3c7d59[_0x6cd5('0x2c')][_0x6cd5('0x32')]){_0xcddbfb[_0x6cd5('0x33')]=[{'all':!![]}];}_0xcddbfb=_['merge']({},_0xcddbfb,_0x3c7d59[_0x6cd5('0x34')]);return db[_0x6cd5('0x2a')][_0x6cd5('0x35')](_0xcddbfb)['then'](handleEntityNotFound(_0x7a236a,null))[_0x6cd5('0x22')](respondWithResult(_0x7a236a,null))[_0x6cd5('0x36')](handleError(_0x7a236a,null));};exports[_0x6cd5('0x37')]=function(_0x514374,_0xb0af54){if(_0x514374[_0x6cd5('0x38')]['id']){delete _0x514374['body']['id'];}return db[_0x6cd5('0x2a')]['find']({'where':{'id':_0x514374['params']['id']}})['then'](handleEntityNotFound(_0xb0af54,null))[_0x6cd5('0x22')](saveUpdates(_0x514374[_0x6cd5('0x38')],null))['then'](respondWithResult(_0xb0af54,null))[_0x6cd5('0x36')](handleError(_0xb0af54,null));};exports[_0x6cd5('0x39')]=function(_0x46d650,_0x2cd73a){return db[_0x6cd5('0x2a')][_0x6cd5('0x35')]({'where':{'id':_0x46d650[_0x6cd5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2cd73a,null))['then'](removeEntity(_0x2cd73a,null))[_0x6cd5('0x36')](handleError(_0x2cd73a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index fccc6fe..5e0ee94 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 _0x4ad2=['../../config/logger','api','moment','bluebird','request-promise','./chatApplication.attributes','exports','define','chat_applications','lodash'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x4ad2,0x1e9));var _0x24ad=function(_0x12c798,_0x310718){_0x12c798=_0x12c798-0x0;var _0xaafd39=_0x4ad2[_0x12c798];return _0xaafd39;};'use strict';var _=require(_0x24ad('0x0'));var util=require('util');var logger=require(_0x24ad('0x1'))(_0x24ad('0x2'));var moment=require(_0x24ad('0x3'));var BPromise=require(_0x24ad('0x4'));var rp=require(_0x24ad('0x5'));var attributes=require(_0x24ad('0x6'));module[_0x24ad('0x7')]=function(_0x21cc3e,_0x1eb5bf){return _0x21cc3e[_0x24ad('0x8')]('ChatApplication',attributes,{'tableName':_0x24ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cb0=['ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatApplication.attributes','exports'];(function(_0x240d66,_0x39012a){var _0x3788c6=function(_0x960683){while(--_0x960683){_0x240d66['push'](_0x240d66['shift']());}};_0x3788c6(++_0x39012a);}(_0x8cb0,0x12b));var _0x08cb=function(_0x4f9ab3,_0x55796f){_0x4f9ab3=_0x4f9ab3-0x0;var _0x50b8a7=_0x8cb0[_0x4f9ab3];return _0x50b8a7;};'use strict';var _=require(_0x08cb('0x0'));var util=require(_0x08cb('0x1'));var logger=require(_0x08cb('0x2'))(_0x08cb('0x3'));var moment=require(_0x08cb('0x4'));var BPromise=require(_0x08cb('0x5'));var rp=require(_0x08cb('0x6'));var attributes=require(_0x08cb('0x7'));module[_0x08cb('0x8')]=function(_0x5ade39,_0x399388){return _0x5ade39['define'](_0x08cb('0x9'),attributes,{'tableName':_0x08cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 71a71a0..df301e9 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 _0x52b5=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0x52b5,0x1c6));var _0x552b=function(_0x1dc0de,_0x2f9a0f){_0x1dc0de=_0x1dc0de-0x0;var _0x1d2778=_0x52b5[_0x1dc0de];return _0x1d2778;};'use strict';var _=require(_0x552b('0x0'));var util=require(_0x552b('0x1'));var moment=require(_0x552b('0x2'));var BPromise=require(_0x552b('0x3'));var rs=require(_0x552b('0x4'));var fs=require('fs');var Redis=require(_0x552b('0x5'));var db=require(_0x552b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x552b('0x7'))(_0x552b('0x8'));var config=require(_0x552b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x552b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f239f,_0x4b9f86,_0x30156c){return new BPromise(function(_0x21b6f4,_0x4c0d43){return client[_0x552b('0xb')](_0x5f239f,_0x30156c)[_0x552b('0xc')](function(_0x29b087){logger[_0x552b('0xd')](_0x552b('0xe'),_0x4b9f86,_0x552b('0xf'));logger['debug'](_0x552b('0x10'),_0x4b9f86,'request\x20sent',JSON[_0x552b('0x11')](_0x29b087));if(_0x29b087['error']){if(_0x29b087[_0x552b('0x12')][_0x552b('0x13')]===0x1f4){logger[_0x552b('0x12')](_0x552b('0xe'),_0x4b9f86,_0x29b087[_0x552b('0x12')]['message']);return _0x4c0d43(_0x29b087[_0x552b('0x12')][_0x552b('0x14')]);}logger[_0x552b('0x12')](_0x552b('0xe'),_0x4b9f86,_0x29b087[_0x552b('0x12')][_0x552b('0x14')]);return _0x21b6f4(_0x29b087[_0x552b('0x12')][_0x552b('0x14')]);}else{logger['info'](_0x552b('0xe'),_0x4b9f86,_0x552b('0xf'));_0x21b6f4(_0x29b087[_0x552b('0x15')]['message']);}})[_0x552b('0x16')](function(_0x35424a){logger[_0x552b('0x12')](_0x552b('0xe'),_0x4b9f86,_0x35424a);_0x4c0d43(_0x35424a);});});} \ No newline at end of file +var _0xea5c=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e526d,_0x57576e){var _0x13ab29=function(_0x5476a8){while(--_0x5476a8){_0x1e526d['push'](_0x1e526d['shift']());}};_0x13ab29(++_0x57576e);}(_0xea5c,0xdc));var _0xcea5=function(_0x3bd62b,_0x462105){_0x3bd62b=_0x3bd62b-0x0;var _0x578cd4=_0xea5c[_0x3bd62b];return _0x578cd4;};'use strict';var _=require(_0xcea5('0x0'));var util=require('util');var moment=require(_0xcea5('0x1'));var BPromise=require(_0xcea5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcea5('0x3'))['db'];var utils=require(_0xcea5('0x4'));var logger=require(_0xcea5('0x5'))(_0xcea5('0x6'));var config=require(_0xcea5('0x7'));var jayson=require(_0xcea5('0x8'));var client=jayson[_0xcea5('0x9')][_0xcea5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4447a1,_0x302d40,_0x827f6e){return new BPromise(function(_0xe6d6ef,_0x3f809a){return client[_0xcea5('0xb')](_0x4447a1,_0x827f6e)[_0xcea5('0xc')](function(_0x3f8624){logger[_0xcea5('0xd')](_0xcea5('0xe'),_0x302d40,_0xcea5('0xf'));logger['debug'](_0xcea5('0x10'),_0x302d40,_0xcea5('0xf'),JSON[_0xcea5('0x11')](_0x3f8624));if(_0x3f8624['error']){if(_0x3f8624[_0xcea5('0x12')][_0xcea5('0x13')]===0x1f4){logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x302d40,_0x3f8624[_0xcea5('0x12')][_0xcea5('0x14')]);return _0x3f809a(_0x3f8624[_0xcea5('0x12')][_0xcea5('0x14')]);}logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x302d40,_0x3f8624[_0xcea5('0x12')][_0xcea5('0x14')]);return _0xe6d6ef(_0x3f8624['error'][_0xcea5('0x14')]);}else{logger[_0xcea5('0xd')](_0xcea5('0xe'),_0x302d40,'request\x20sent');_0xe6d6ef(_0x3f8624[_0xcea5('0x15')][_0xcea5('0x14')]);}})[_0xcea5('0x16')](function(_0x3d3a2c){logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x302d40,_0x3d3a2c);_0x3f809a(_0x3d3a2c);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3c081b6..45d8966 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 _0x1183=['../../config/environment','./chatApplication.controller','get','show','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x1183,0x1d7));var _0x3118=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0x1183[_0x567fff];return _0x465a37;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3118('0x0'));var timeout=require(_0x3118('0x1'));var express=require(_0x3118('0x2'));var router=express[_0x3118('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3118('0x4'));var config=require(_0x3118('0x5'));var controller=require(_0x3118('0x6'));router[_0x3118('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3118('0x8')]);router['put'](_0x3118('0x9'),auth['isAuthenticated'](),controller[_0x3118('0xa')]);router[_0x3118('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3118('0xc')]);module[_0x3118('0xd')]=router; \ No newline at end of file +var _0x920a=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','../../components/auth/service','./chatApplication.controller','get'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x920a,0x15a));var _0xa920=function(_0x1f8fa6,_0x3380d9){_0x1f8fa6=_0x1f8fa6-0x0;var _0x2ee7fd=_0x920a[_0x1f8fa6];return _0x2ee7fd;};'use strict';var multer=require(_0xa920('0x0'));var util=require(_0xa920('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa920('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa920('0x3'));router[_0xa920('0x4')](_0xa920('0x5'),auth[_0xa920('0x6')](),controller[_0xa920('0x7')]);router[_0xa920('0x8')](_0xa920('0x5'),auth[_0xa920('0x6')](),controller[_0xa920('0x9')]);router[_0xa920('0xa')](_0xa920('0x5'),auth[_0xa920('0x6')](),controller[_0xa920('0xb')]);module[_0xa920('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b609f26..39b05b2 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 _0xdb03=['sequelize','STRING','BOOLEAN'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0xdb03,0xae));var _0x3db0=function(_0x1d876f,_0x57f959){_0x1d876f=_0x1d876f-0x0;var _0x4c9f24=_0xdb03[_0x1d876f];return _0x4c9f24;};'use strict';var Sequelize=require(_0x3db0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3db0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x3db0('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf455=['STRING','BOOLEAN','exports'];(function(_0x12dcc2,_0x213ca4){var _0x337017=function(_0x5a0d29){while(--_0x5a0d29){_0x12dcc2['push'](_0x12dcc2['shift']());}};_0x337017(++_0x213ca4);}(_0xf455,0x176));var _0x5f45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf455[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x5f45('0x0')]={'name':{'type':Sequelize[_0x5f45('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5f45('0x1')]},'write':{'type':Sequelize[_0x5f45('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index fea6378..4dab9cc 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 _0xc3ce=['bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','client','http','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','json','count','offset','limit','Content-Range','apply','save','update','destroy','status','end','stack','name','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','ChatGroup','findAll','rows','catch','include','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','getMessages','$gte','split','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x368889,_0x2ae251){var _0x3f3b06=function(_0x455b0d){while(--_0x455b0d){_0x368889['push'](_0x368889['shift']());}};_0x3f3b06(++_0x2ae251);}(_0xc3ce,0x126));var _0xec3c=function(_0x288e46,_0x605d5d){_0x288e46=_0x288e46-0x0;var _0x582caa=_0xc3ce[_0x288e46];return _0x582caa;};'use strict';var pdf=require(_0xec3c('0x0'));var emlformat=require(_0xec3c('0x1'));var rimraf=require(_0xec3c('0x2'));var zipdir=require(_0xec3c('0x3'));var jsonpatch=require(_0xec3c('0x4'));var rp=require('request-promise');var moment=require(_0xec3c('0x5'));var BPromise=require(_0xec3c('0x6'));var Mustache=require(_0xec3c('0x7'));var util=require(_0xec3c('0x8'));var path=require(_0xec3c('0x9'));var sox=require(_0xec3c('0xa'));var csv=require(_0xec3c('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xec3c('0xc'));var squel=require(_0xec3c('0xd'));var crypto=require(_0xec3c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xec3c('0xb'));var querystring=require('querystring');var Papa=require(_0xec3c('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xec3c('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xec3c('0x11'))(_0xec3c('0x12'));var utils=require(_0xec3c('0x13'));var config=require(_0xec3c('0x14'));var db=require(_0xec3c('0x15'))['db'];config['redis']=_['defaults'](config[_0xec3c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xec3c('0x17'))(new Redis(config[_0xec3c('0x16')]));require(_0xec3c('0x18'))[_0xec3c('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xec3c('0x1a')][_0xec3c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x30735e,_0x40f258,_0x4ef22a,_0x205c7d){return new BPromise(function(_0xcbc15e,_0x544b31){var _0x296885=_0x205c7d||client;return _0x296885[_0xec3c('0x1c')](_0x30735e,_0x4ef22a)[_0xec3c('0x1d')](function(_0x39ac0c){logger[_0xec3c('0x1e')](_0xec3c('0x1f'),_0x40f258,_0xec3c('0x20'));logger[_0xec3c('0x21')](_0xec3c('0x22'),_0x40f258,'request\x20sent',JSON['stringify'](_0x39ac0c));if(_0x39ac0c[_0xec3c('0x23')]){if(_0x39ac0c['error'][_0xec3c('0x24')]===0x1f4){logger[_0xec3c('0x23')](_0xec3c('0x1f'),_0x40f258,_0x39ac0c['error'][_0xec3c('0x25')]);return _0x544b31(_0x39ac0c[_0xec3c('0x23')][_0xec3c('0x25')]);}logger[_0xec3c('0x23')](_0xec3c('0x1f'),_0x40f258,_0x39ac0c[_0xec3c('0x23')][_0xec3c('0x25')]);return _0xcbc15e(_0x39ac0c['error'][_0xec3c('0x25')]);}else{logger[_0xec3c('0x1e')](_0xec3c('0x1f'),_0x40f258,_0xec3c('0x20'));_0xcbc15e(_0x39ac0c[_0xec3c('0x26')][_0xec3c('0x25')]);}})['catch'](function(_0x39c2db){logger['error']('ChatGroup,\x20%s,\x20%s',_0x40f258,_0x39c2db);_0x544b31(_0x39c2db);});});}function respondWithStatusCode(_0x20a106,_0x3340e7){_0x3340e7=_0x3340e7||0xcc;return function(_0xe4d2f0){if(_0xe4d2f0){return _0x20a106[_0xec3c('0x27')](_0x3340e7);}return _0x20a106['status'](_0x3340e7)['end']();};}function respondWithResult(_0x1beeea,_0x5463e3){_0x5463e3=_0x5463e3||0xc8;return function(_0x285c1d){if(_0x285c1d){return _0x1beeea['status'](_0x5463e3)[_0xec3c('0x28')](_0x285c1d);}};}function respondWithFilteredResult(_0x4780ac,_0x2b1606){return function(_0x146aad){if(_0x146aad){var _0x4e9b08=_0x146aad[_0xec3c('0x29')],_0x2ac9ee=_0x2b1606[_0xec3c('0x2a')],_0x3e632e=_0x2b1606['offset']+_0x2b1606[_0xec3c('0x2b')],_0x63be10;if(_0x3e632e>=_0x4e9b08){_0x3e632e=_0x4e9b08;_0x63be10=0xc8;}else{_0x63be10=0xce;}_0x4780ac['status'](_0x63be10);return _0x4780ac['set'](_0xec3c('0x2c'),_0x2ac9ee+'-'+_0x3e632e+'/'+_0x4e9b08)[_0xec3c('0x28')](_0x146aad);}return null;};}function patchUpdates(_0x97cf5c){return function(_0x3e3514){try{jsonpatch[_0xec3c('0x2d')](_0x3e3514,_0x97cf5c,!![]);}catch(_0xb4acda){return BPromise['reject'](_0xb4acda);}return _0x3e3514[_0xec3c('0x2e')]();};}function saveUpdates(_0x5e8438,_0x49c2ce){return function(_0x493a8f){if(_0x493a8f){return _0x493a8f[_0xec3c('0x2f')](_0x5e8438)[_0xec3c('0x1d')](function(_0x58fa73){return _0x58fa73;});}return null;};}function removeEntity(_0x2ab8b4,_0x140fa2){return function(_0x830b40){if(_0x830b40){return _0x830b40[_0xec3c('0x30')]()[_0xec3c('0x1d')](function(){_0x2ab8b4[_0xec3c('0x31')](0xcc)[_0xec3c('0x32')]();});}};}function handleEntityNotFound(_0x293d9,_0x539286){return function(_0x555b0a){if(!_0x555b0a){_0x293d9[_0xec3c('0x27')](0x194);}return _0x555b0a;};}function handleError(_0x4b1b78,_0x4de740){_0x4de740=_0x4de740||0x1f4;return function(_0x1f9c14){logger['error'](_0x1f9c14[_0xec3c('0x33')]);if(_0x1f9c14[_0xec3c('0x34')]){delete _0x1f9c14[_0xec3c('0x34')];}_0x4b1b78[_0xec3c('0x31')](_0x4de740)['send'](_0x1f9c14);};}exports[_0xec3c('0x35')]=function(_0x30ecb3,_0x5886f4){var _0x4134cb={},_0x1f422e={},_0x8f5a7c={'count':0x0,'rows':[]};var _0x128230=db['ChatGroup'][_0xec3c('0x36')];_0x1f422e[_0xec3c('0x37')]=_[_0xec3c('0x38')](_0x128230);_0x1f422e['query']=_['keys'](_0x30ecb3['query']);_0x1f422e[_0xec3c('0x39')]=_[_0xec3c('0x3a')](_0x1f422e[_0xec3c('0x37')],_0x1f422e[_0xec3c('0x3b')]);_0x4134cb[_0xec3c('0x3c')]=_[_0xec3c('0x3a')](_0x1f422e[_0xec3c('0x37')],qs[_0xec3c('0x3d')](_0x30ecb3[_0xec3c('0x3b')]['fields']));_0x4134cb[_0xec3c('0x3c')]=_0x4134cb[_0xec3c('0x3c')][_0xec3c('0x3e')]?_0x4134cb[_0xec3c('0x3c')]:_0x1f422e[_0xec3c('0x37')];if(!_0x30ecb3[_0xec3c('0x3b')]['hasOwnProperty'](_0xec3c('0x3f'))){_0x4134cb[_0xec3c('0x2b')]=qs[_0xec3c('0x2b')](_0x30ecb3[_0xec3c('0x3b')][_0xec3c('0x2b')]);_0x4134cb[_0xec3c('0x2a')]=qs[_0xec3c('0x2a')](_0x30ecb3[_0xec3c('0x3b')]['offset']);}_0x4134cb[_0xec3c('0x40')]=qs[_0xec3c('0x41')](_0x30ecb3[_0xec3c('0x3b')][_0xec3c('0x41')]);_0x4134cb[_0xec3c('0x42')]=qs[_0xec3c('0x39')](_[_0xec3c('0x43')](_0x30ecb3['query'],_0x1f422e[_0xec3c('0x39')]));if(_0x30ecb3[_0xec3c('0x3b')][_0xec3c('0x44')]){_0x4134cb['where']=_[_0xec3c('0x45')](_0x4134cb[_0xec3c('0x42')],{'$or':_[_0xec3c('0x46')](_0x128230,function(_0x3e4cb7){if(_0x3e4cb7[_0xec3c('0x47')]['key']!==_0xec3c('0x48')){var _0x214e89={};_0x214e89[_0x3e4cb7[_0xec3c('0x49')]]={'$like':'%'+_0x30ecb3[_0xec3c('0x3b')][_0xec3c('0x44')]+'%'};return _0x214e89;}})});}_0x4134cb=_['merge']({},_0x4134cb,_0x30ecb3[_0xec3c('0x4a')]);var _0x21d54b={'where':_0x4134cb[_0xec3c('0x42')]};return db[_0xec3c('0x4b')][_0xec3c('0x29')](_0x21d54b)[_0xec3c('0x1d')](function(_0x400e66){_0x8f5a7c[_0xec3c('0x29')]=_0x400e66;if(_0x30ecb3[_0xec3c('0x3b')]['includeAll']){_0x4134cb['include']=[{'all':!![]}];}return db[_0xec3c('0x4b')][_0xec3c('0x4c')](_0x4134cb);})[_0xec3c('0x1d')](function(_0x5d96e1){_0x8f5a7c[_0xec3c('0x4d')]=_0x5d96e1;return _0x8f5a7c;})[_0xec3c('0x1d')](respondWithFilteredResult(_0x5886f4,_0x4134cb))[_0xec3c('0x4e')](handleError(_0x5886f4,null));};exports['show']=function(_0x1c97b6,_0x25624c){var _0x45bb07={'raw':!![],'where':{'id':_0x1c97b6['params']['id']}},_0x353482={};_0x353482['model']=_[_0xec3c('0x38')](db[_0xec3c('0x4b')]['rawAttributes']);_0x353482[_0xec3c('0x3b')]=_['keys'](_0x1c97b6[_0xec3c('0x3b')]);_0x353482[_0xec3c('0x39')]=_[_0xec3c('0x3a')](_0x353482[_0xec3c('0x37')],_0x353482[_0xec3c('0x3b')]);_0x45bb07['attributes']=_['intersection'](_0x353482[_0xec3c('0x37')],qs[_0xec3c('0x3d')](_0x1c97b6[_0xec3c('0x3b')][_0xec3c('0x3d')]));_0x45bb07[_0xec3c('0x3c')]=_0x45bb07[_0xec3c('0x3c')]['length']?_0x45bb07[_0xec3c('0x3c')]:_0x353482[_0xec3c('0x37')];if(_0x1c97b6[_0xec3c('0x3b')]['includeAll']){_0x45bb07[_0xec3c('0x4f')]=[{'all':!![]}];}_0x45bb07=_[_0xec3c('0x45')]({},_0x45bb07,_0x1c97b6[_0xec3c('0x4a')]);return db[_0xec3c('0x4b')][_0xec3c('0x50')](_0x45bb07)[_0xec3c('0x1d')](handleEntityNotFound(_0x25624c,null))[_0xec3c('0x1d')](respondWithResult(_0x25624c,null))[_0xec3c('0x4e')](handleError(_0x25624c,null));};exports['create']=function(_0x4d307e,_0x417af2){return db[_0xec3c('0x4b')][_0xec3c('0x51')](_0x4d307e[_0xec3c('0x52')],{})[_0xec3c('0x1d')](respondWithResult(_0x417af2,0xc9))[_0xec3c('0x4e')](handleError(_0x417af2,null));};exports[_0xec3c('0x2f')]=function(_0x221830,_0x12a618){if(_0x221830[_0xec3c('0x52')]['id']){delete _0x221830['body']['id'];}return db[_0xec3c('0x4b')][_0xec3c('0x50')]({'where':{'id':_0x221830[_0xec3c('0x53')]['id']}})['then'](handleEntityNotFound(_0x12a618,null))[_0xec3c('0x1d')](saveUpdates(_0x221830['body'],null))['then'](respondWithResult(_0x12a618,null))[_0xec3c('0x4e')](handleError(_0x12a618,null));};exports[_0xec3c('0x30')]=function(_0x20c8c7,_0x20c1de){return db[_0xec3c('0x4b')]['find']({'where':{'id':_0x20c8c7[_0xec3c('0x53')]['id']}})[_0xec3c('0x1d')](handleEntityNotFound(_0x20c1de,null))[_0xec3c('0x1d')](removeEntity(_0x20c1de,null))['catch'](handleError(_0x20c1de,null));};exports['describe']=function(_0x98d60e,_0x212aa0){return db[_0xec3c('0x4b')][_0xec3c('0x54')]()[_0xec3c('0x1d')](respondWithResult(_0x212aa0,null))[_0xec3c('0x4e')](handleError(_0x212aa0,null));};exports[_0xec3c('0x55')]=function(_0x2b296a,_0x22a2fb,_0x236b4e){return db[_0xec3c('0x56')][_0xec3c('0x29')]({'where':{'ChatGroupId':_0x2b296a[_0xec3c('0x53')]['id'],'ToId':_0x2b296a['user']['id'],'read':![]}})[_0xec3c('0x1d')](function(_0xec99e5){return{'id':_[_0xec3c('0x57')](_0x2b296a[_0xec3c('0x53')]['id']),'count':_0xec99e5};})[_0xec3c('0x1d')](respondWithResult(_0x22a2fb,null))[_0xec3c('0x4e')](handleError(_0x22a2fb,null));};exports[_0xec3c('0x58')]=function(_0x43799f,_0x33ec8b,_0x24c3d6){return db['ChatGroup']['find']({'where':{'id':_0x43799f[_0xec3c('0x53')]['id']}})['then'](handleEntityNotFound(_0x33ec8b,null))['then'](function(_0x314e09){if(_0x314e09){return _0x314e09['addMembers'](_0x43799f['body'][_0xec3c('0x59')],_['omit'](_0x43799f[_0xec3c('0x52')],[_0xec3c('0x59'),'id'])||{});}})[_0xec3c('0x1d')](respondWithResult(_0x33ec8b,null))['catch'](handleError(_0x33ec8b,null));};exports[_0xec3c('0x5a')]=function(_0x4b1830,_0x58ebc3,_0x1ce5f1){var _0x418dc8={};var _0x3a1ae={};var _0x18e1c5;var _0x3a1b60;return db[_0xec3c('0x4b')][_0xec3c('0x5b')]({'where':{'id':_0x4b1830[_0xec3c('0x53')]['id']}})[_0xec3c('0x1d')](handleEntityNotFound(_0x58ebc3,null))[_0xec3c('0x1d')](function(_0x3cc680){if(_0x3cc680){_0x18e1c5=_0x3cc680;_0x3a1ae[_0xec3c('0x37')]=_[_0xec3c('0x38')](db[_0xec3c('0x5c')][_0xec3c('0x36')]);_0x3a1ae[_0xec3c('0x3b')]=_[_0xec3c('0x38')](_0x4b1830[_0xec3c('0x3b')]);_0x3a1ae[_0xec3c('0x39')]=_[_0xec3c('0x3a')](_0x3a1ae['model'],_0x3a1ae[_0xec3c('0x3b')]);_0x418dc8[_0xec3c('0x3c')]=_[_0xec3c('0x3a')](_0x3a1ae[_0xec3c('0x37')],qs[_0xec3c('0x3d')](_0x4b1830['query'][_0xec3c('0x3d')]));_0x418dc8[_0xec3c('0x3c')]=_0x418dc8[_0xec3c('0x3c')][_0xec3c('0x3e')]?_0x418dc8[_0xec3c('0x3c')]:_0x3a1ae[_0xec3c('0x37')];_0x418dc8[_0xec3c('0x40')]=qs['sort'](_0x4b1830[_0xec3c('0x3b')]['sort']);_0x418dc8[_0xec3c('0x42')]=qs[_0xec3c('0x39')](_['pick'](_0x4b1830[_0xec3c('0x3b')],_0x3a1ae[_0xec3c('0x39')]));if(_0x4b1830[_0xec3c('0x3b')]['filter']){_0x418dc8[_0xec3c('0x42')]=_[_0xec3c('0x45')](_0x418dc8[_0xec3c('0x42')],{'$or':_['map'](_0x418dc8[_0xec3c('0x3c')],function(_0x3c8054){var _0x3fa338={};_0x3fa338[_0x3c8054]={'$like':'%'+_0x4b1830[_0xec3c('0x3b')][_0xec3c('0x44')]+'%'};return _0x3fa338;})});}_0x418dc8=_[_0xec3c('0x45')]({},_0x418dc8,_0x4b1830[_0xec3c('0x4a')]);return _0x18e1c5[_0xec3c('0x5a')](_0x418dc8);}})[_0xec3c('0x1d')](function(_0x1046e8){if(_0x1046e8){_0x3a1b60=_0x1046e8[_0xec3c('0x3e')];if(!_0x4b1830[_0xec3c('0x3b')][_0xec3c('0x5d')]('nolimit')){_0x418dc8[_0xec3c('0x2b')]=qs[_0xec3c('0x2b')](_0x4b1830[_0xec3c('0x3b')][_0xec3c('0x2b')]);_0x418dc8[_0xec3c('0x2a')]=qs[_0xec3c('0x2a')](_0x4b1830[_0xec3c('0x3b')]['offset']);}return _0x18e1c5['getMembers'](_0x418dc8);}})[_0xec3c('0x1d')](function(_0x1d8fe7){if(_0x1d8fe7){return _0x1d8fe7?{'count':_0x3a1b60,'rows':_0x1d8fe7}:null;}})['then'](respondWithResult(_0x58ebc3,null))[_0xec3c('0x4e')](handleError(_0x58ebc3,null));};exports[_0xec3c('0x5e')]=function(_0x40d693,_0x3967dd,_0x5bd06e){var _0x48052f;return db[_0xec3c('0x4b')][_0xec3c('0x50')]({'where':{'id':_0x40d693['params']['id']}})[_0xec3c('0x1d')](handleEntityNotFound(_0x3967dd,null))[_0xec3c('0x1d')](function(_0x1e7fc5){if(_0x1e7fc5){return _0x1e7fc5['removeMembers'](_0x40d693[_0xec3c('0x3b')][_0xec3c('0x59')]);}})[_0xec3c('0x1d')](respondWithStatusCode(_0x3967dd,null))['catch'](handleError(_0x3967dd,null));};exports[_0xec3c('0x5f')]=function(_0x305f7d,_0x544e86,_0x2a75f5){if(_0x305f7d['body']['id']){delete _0x305f7d[_0xec3c('0x52')]['id'];}return db[_0xec3c('0x4b')][_0xec3c('0x50')]({'where':{'id':_0x305f7d[_0xec3c('0x53')]['id']}})['then'](handleEntityNotFound(_0x544e86,null))['then'](function(_0x33a76d){if(_0x33a76d){_0x305f7d[_0xec3c('0x52')]['ChatGroupId']=_0x33a76d['id'];return db[_0xec3c('0x56')][_0xec3c('0x51')](_0x305f7d[_0xec3c('0x52')]);}})['then'](respondWithResult(_0x544e86,null))[_0xec3c('0x4e')](handleError(_0x544e86,null));};exports[_0xec3c('0x60')]=function(_0x217723,_0x152b43,_0x45999e){var _0x3a708b={};var _0x31c54e={};var _0x32c3c1;var _0x26bb3b;return db['ChatGroup'][_0xec3c('0x5b')]({'where':{'id':_0x217723[_0xec3c('0x53')]['id']}})[_0xec3c('0x1d')](handleEntityNotFound(_0x152b43,null))[_0xec3c('0x1d')](function(_0x30a8b8){if(_0x30a8b8){_0x32c3c1=_0x30a8b8;_0x31c54e['model']=_[_0xec3c('0x38')](db[_0xec3c('0x56')][_0xec3c('0x36')]);_0x31c54e['query']=_[_0xec3c('0x38')](_0x217723[_0xec3c('0x3b')]);_0x31c54e['filters']=_[_0xec3c('0x3a')](_0x31c54e[_0xec3c('0x37')],_0x31c54e['query']);_0x3a708b['attributes']=_['intersection'](_0x31c54e[_0xec3c('0x37')],qs[_0xec3c('0x3d')](_0x217723[_0xec3c('0x3b')]['fields']));_0x3a708b[_0xec3c('0x3c')]=_0x3a708b[_0xec3c('0x3c')]['length']?_0x3a708b['attributes']:_0x31c54e[_0xec3c('0x37')];_0x3a708b['order']=qs['sort'](_0x217723[_0xec3c('0x3b')][_0xec3c('0x41')]);_0x3a708b[_0xec3c('0x42')]=qs[_0xec3c('0x39')](_[_0xec3c('0x43')](_0x217723['query'],_0x31c54e[_0xec3c('0x39')]));if(_0x217723[_0xec3c('0x3b')][_0xec3c('0x44')]){_0x3a708b['where']=_[_0xec3c('0x45')](_0x3a708b[_0xec3c('0x42')],{'$or':_[_0xec3c('0x46')](_0x3a708b[_0xec3c('0x3c')],function(_0x180cb1){var _0xab7146={};_0xab7146[_0x180cb1]={'$like':'%'+_0x217723[_0xec3c('0x3b')][_0xec3c('0x44')]+'%'};return _0xab7146;})});}if(_0x217723[_0xec3c('0x3b')]['$gte']){var _0x59d044=_0x217723[_0xec3c('0x3b')][_0xec3c('0x61')][_0xec3c('0x62')](',');var _0x576b36={};_0x576b36[_0x59d044[0x0]]={'$gte':moment(_0x59d044[0x1])[_0xec3c('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3a708b[_0xec3c('0x42')]=_[_0xec3c('0x45')](_0x3a708b[_0xec3c('0x42')],_0x576b36);}_0x3a708b=_['merge']({},_0x3a708b,_0x217723[_0xec3c('0x4a')]);return _0x32c3c1['getMessages'](_0x3a708b);}})['then'](function(_0x2116ba){if(_0x2116ba){_0x26bb3b=_0x2116ba[_0xec3c('0x3e')];if(!_0x217723['query'][_0xec3c('0x5d')](_0xec3c('0x3f'))){_0x3a708b[_0xec3c('0x2b')]=qs[_0xec3c('0x2b')](_0x217723[_0xec3c('0x3b')][_0xec3c('0x2b')]);_0x3a708b[_0xec3c('0x2a')]=qs['offset'](_0x217723[_0xec3c('0x3b')][_0xec3c('0x2a')]);}return _0x32c3c1['getMessages'](_0x3a708b);}})[_0xec3c('0x1d')](function(_0x4e838c){if(_0x4e838c){return _0x4e838c?{'count':_0x26bb3b,'rows':_0x4e838c}:null;}})[_0xec3c('0x1d')](respondWithResult(_0x152b43,null))[_0xec3c('0x4e')](handleError(_0x152b43,null));}; \ No newline at end of file +var _0xc881=['addMembers','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','getMessages','$gte','format','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','count','offset','limit','set','json','apply','reject','save','update','sendStatus','stack','name','send','index','ChatGroup','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','rows','params','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger'];(function(_0x570560,_0x41c5c5){var _0x286343=function(_0x262a4c){while(--_0x262a4c){_0x570560['push'](_0x570560['shift']());}};_0x286343(++_0x41c5c5);}(_0xc881,0xd4));var _0x1c88=function(_0x10ab62,_0x21d1da){_0x10ab62=_0x10ab62-0x0;var _0x3b325b=_0xc881[_0x10ab62];return _0x3b325b;};'use strict';var pdf=require(_0x1c88('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c88('0x1'));var zipdir=require(_0x1c88('0x2'));var jsonpatch=require(_0x1c88('0x3'));var rp=require(_0x1c88('0x4'));var moment=require(_0x1c88('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1c88('0x6'));var util=require(_0x1c88('0x7'));var path=require(_0x1c88('0x8'));var sox=require('sox');var csv=require(_0x1c88('0x9'));var ejs=require(_0x1c88('0xa'));var fs=require('fs');var _=require(_0x1c88('0xb'));var squel=require('squel');var crypto=require(_0x1c88('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1c88('0x9'));var querystring=require(_0x1c88('0xd'));var Papa=require(_0x1c88('0xe'));var authService=require(_0x1c88('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1c88('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x1c88('0x11'))(_0x1c88('0x12'));var utils=require(_0x1c88('0x13'));var config=require(_0x1c88('0x14'));var db=require('../../mysqldb')['db'];config[_0x1c88('0x15')]=_[_0x1c88('0x16')](config[_0x1c88('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c88('0x17'))(new Redis(config[_0x1c88('0x15')]));require(_0x1c88('0x18'))[_0x1c88('0x19')](socket);var jayson=require(_0x1c88('0x1a'));var client=jayson[_0x1c88('0x1b')][_0x1c88('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x27a7f9,_0x50ed16,_0x3fd353,_0xb2a38b){return new BPromise(function(_0xc3c7be,_0x25c6ff){var _0x432d7d=_0xb2a38b||client;return _0x432d7d[_0x1c88('0x1d')](_0x27a7f9,_0x3fd353)[_0x1c88('0x1e')](function(_0x24bbb7){logger[_0x1c88('0x1f')](_0x1c88('0x20'),_0x50ed16,_0x1c88('0x21'));logger['debug'](_0x1c88('0x22'),_0x50ed16,_0x1c88('0x21'),JSON['stringify'](_0x24bbb7));if(_0x24bbb7['error']){if(_0x24bbb7[_0x1c88('0x23')][_0x1c88('0x24')]===0x1f4){logger[_0x1c88('0x23')](_0x1c88('0x20'),_0x50ed16,_0x24bbb7[_0x1c88('0x23')][_0x1c88('0x25')]);return _0x25c6ff(_0x24bbb7[_0x1c88('0x23')][_0x1c88('0x25')]);}logger[_0x1c88('0x23')]('ChatGroup,\x20%s,\x20%s',_0x50ed16,_0x24bbb7[_0x1c88('0x23')]['message']);return _0xc3c7be(_0x24bbb7[_0x1c88('0x23')][_0x1c88('0x25')]);}else{logger['info'](_0x1c88('0x20'),_0x50ed16,_0x1c88('0x21'));_0xc3c7be(_0x24bbb7[_0x1c88('0x26')][_0x1c88('0x25')]);}})[_0x1c88('0x27')](function(_0x3be57b){logger['error'](_0x1c88('0x20'),_0x50ed16,_0x3be57b);_0x25c6ff(_0x3be57b);});});}function respondWithStatusCode(_0x2bc927,_0x455f67){_0x455f67=_0x455f67||0xcc;return function(_0x3d5030){if(_0x3d5030){return _0x2bc927['sendStatus'](_0x455f67);}return _0x2bc927[_0x1c88('0x28')](_0x455f67)[_0x1c88('0x29')]();};}function respondWithResult(_0x33efee,_0x2830d4){_0x2830d4=_0x2830d4||0xc8;return function(_0x13994b){if(_0x13994b){return _0x33efee[_0x1c88('0x28')](_0x2830d4)['json'](_0x13994b);}};}function respondWithFilteredResult(_0x182fa5,_0x5e0344){return function(_0x513669){if(_0x513669){var _0x56ed15=_0x513669[_0x1c88('0x2a')],_0x9d7bb6=_0x5e0344[_0x1c88('0x2b')],_0x4b30e7=_0x5e0344[_0x1c88('0x2b')]+_0x5e0344[_0x1c88('0x2c')],_0x3f9f4d;if(_0x4b30e7>=_0x56ed15){_0x4b30e7=_0x56ed15;_0x3f9f4d=0xc8;}else{_0x3f9f4d=0xce;}_0x182fa5[_0x1c88('0x28')](_0x3f9f4d);return _0x182fa5[_0x1c88('0x2d')]('Content-Range',_0x9d7bb6+'-'+_0x4b30e7+'/'+_0x56ed15)[_0x1c88('0x2e')](_0x513669);}return null;};}function patchUpdates(_0x38d40f){return function(_0x1e4024){try{jsonpatch[_0x1c88('0x2f')](_0x1e4024,_0x38d40f,!![]);}catch(_0x2209fd){return BPromise[_0x1c88('0x30')](_0x2209fd);}return _0x1e4024[_0x1c88('0x31')]();};}function saveUpdates(_0x12a697,_0x120e30){return function(_0x43d3d3){if(_0x43d3d3){return _0x43d3d3[_0x1c88('0x32')](_0x12a697)[_0x1c88('0x1e')](function(_0x211239){return _0x211239;});}return null;};}function removeEntity(_0x5274f8,_0x45399d){return function(_0x785c05){if(_0x785c05){return _0x785c05['destroy']()['then'](function(){_0x5274f8[_0x1c88('0x28')](0xcc)[_0x1c88('0x29')]();});}};}function handleEntityNotFound(_0x3dfb34,_0x1e02b6){return function(_0x6a1b8a){if(!_0x6a1b8a){_0x3dfb34[_0x1c88('0x33')](0x194);}return _0x6a1b8a;};}function handleError(_0x42b43f,_0x218e0c){_0x218e0c=_0x218e0c||0x1f4;return function(_0x8c21c8){logger[_0x1c88('0x23')](_0x8c21c8[_0x1c88('0x34')]);if(_0x8c21c8[_0x1c88('0x35')]){delete _0x8c21c8[_0x1c88('0x35')];}_0x42b43f[_0x1c88('0x28')](_0x218e0c)[_0x1c88('0x36')](_0x8c21c8);};}exports[_0x1c88('0x37')]=function(_0x44cff1,_0x7a2f6b){var _0xb15d47={},_0xcebad={},_0x4bf896={'count':0x0,'rows':[]};var _0x5ba673=db[_0x1c88('0x38')][_0x1c88('0x39')];_0xcebad['model']=_[_0x1c88('0x3a')](_0x5ba673);_0xcebad['query']=_[_0x1c88('0x3a')](_0x44cff1[_0x1c88('0x3b')]);_0xcebad[_0x1c88('0x3c')]=_['intersection'](_0xcebad[_0x1c88('0x3d')],_0xcebad[_0x1c88('0x3b')]);_0xb15d47[_0x1c88('0x3e')]=_[_0x1c88('0x3f')](_0xcebad[_0x1c88('0x3d')],qs[_0x1c88('0x40')](_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x40')]));_0xb15d47[_0x1c88('0x3e')]=_0xb15d47[_0x1c88('0x3e')][_0x1c88('0x41')]?_0xb15d47[_0x1c88('0x3e')]:_0xcebad[_0x1c88('0x3d')];if(!_0x44cff1[_0x1c88('0x3b')]['hasOwnProperty'](_0x1c88('0x42'))){_0xb15d47[_0x1c88('0x2c')]=qs[_0x1c88('0x2c')](_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x2c')]);_0xb15d47['offset']=qs[_0x1c88('0x2b')](_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x2b')]);}_0xb15d47[_0x1c88('0x43')]=qs[_0x1c88('0x44')](_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x44')]);_0xb15d47[_0x1c88('0x45')]=qs['filters'](_[_0x1c88('0x46')](_0x44cff1[_0x1c88('0x3b')],_0xcebad[_0x1c88('0x3c')]));if(_0x44cff1[_0x1c88('0x3b')]['filter']){_0xb15d47['where']=_[_0x1c88('0x47')](_0xb15d47[_0x1c88('0x45')],{'$or':_[_0x1c88('0x48')](_0x5ba673,function(_0x1a2d79){if(_0x1a2d79[_0x1c88('0x49')][_0x1c88('0x4a')]!==_0x1c88('0x4b')){var _0xfb9887={};_0xfb9887[_0x1a2d79['field']]={'$like':'%'+_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x4c')]+'%'};return _0xfb9887;}})});}_0xb15d47=_['merge']({},_0xb15d47,_0x44cff1[_0x1c88('0x4d')]);var _0x2c7a12={'where':_0xb15d47['where']};return db[_0x1c88('0x38')]['count'](_0x2c7a12)['then'](function(_0x315da6){_0x4bf896[_0x1c88('0x2a')]=_0x315da6;if(_0x44cff1[_0x1c88('0x3b')][_0x1c88('0x4e')]){_0xb15d47[_0x1c88('0x4f')]=[{'all':!![]}];}return db[_0x1c88('0x38')]['findAll'](_0xb15d47);})[_0x1c88('0x1e')](function(_0x3a8fa8){_0x4bf896[_0x1c88('0x50')]=_0x3a8fa8;return _0x4bf896;})['then'](respondWithFilteredResult(_0x7a2f6b,_0xb15d47))[_0x1c88('0x27')](handleError(_0x7a2f6b,null));};exports['show']=function(_0x535b85,_0x25cd8a){var _0x11707d={'raw':!![],'where':{'id':_0x535b85[_0x1c88('0x51')]['id']}},_0x1338ed={};_0x1338ed[_0x1c88('0x3d')]=_[_0x1c88('0x3a')](db[_0x1c88('0x38')]['rawAttributes']);_0x1338ed[_0x1c88('0x3b')]=_[_0x1c88('0x3a')](_0x535b85[_0x1c88('0x3b')]);_0x1338ed[_0x1c88('0x3c')]=_[_0x1c88('0x3f')](_0x1338ed[_0x1c88('0x3d')],_0x1338ed[_0x1c88('0x3b')]);_0x11707d['attributes']=_[_0x1c88('0x3f')](_0x1338ed['model'],qs[_0x1c88('0x40')](_0x535b85[_0x1c88('0x3b')][_0x1c88('0x40')]));_0x11707d[_0x1c88('0x3e')]=_0x11707d[_0x1c88('0x3e')][_0x1c88('0x41')]?_0x11707d[_0x1c88('0x3e')]:_0x1338ed[_0x1c88('0x3d')];if(_0x535b85['query'][_0x1c88('0x4e')]){_0x11707d['include']=[{'all':!![]}];}_0x11707d=_[_0x1c88('0x47')]({},_0x11707d,_0x535b85[_0x1c88('0x4d')]);return db[_0x1c88('0x38')][_0x1c88('0x52')](_0x11707d)[_0x1c88('0x1e')](handleEntityNotFound(_0x25cd8a,null))[_0x1c88('0x1e')](respondWithResult(_0x25cd8a,null))[_0x1c88('0x27')](handleError(_0x25cd8a,null));};exports[_0x1c88('0x53')]=function(_0x250105,_0x3dfefd){return db['ChatGroup']['create'](_0x250105[_0x1c88('0x54')],{})[_0x1c88('0x1e')](respondWithResult(_0x3dfefd,0xc9))[_0x1c88('0x27')](handleError(_0x3dfefd,null));};exports[_0x1c88('0x32')]=function(_0x3326dd,_0x110c1b){if(_0x3326dd['body']['id']){delete _0x3326dd['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3326dd[_0x1c88('0x51')]['id']}})['then'](handleEntityNotFound(_0x110c1b,null))['then'](saveUpdates(_0x3326dd[_0x1c88('0x54')],null))[_0x1c88('0x1e')](respondWithResult(_0x110c1b,null))[_0x1c88('0x27')](handleError(_0x110c1b,null));};exports[_0x1c88('0x55')]=function(_0x525c68,_0x37b4f8){return db[_0x1c88('0x38')][_0x1c88('0x52')]({'where':{'id':_0x525c68[_0x1c88('0x51')]['id']}})[_0x1c88('0x1e')](handleEntityNotFound(_0x37b4f8,null))[_0x1c88('0x1e')](removeEntity(_0x37b4f8,null))[_0x1c88('0x27')](handleError(_0x37b4f8,null));};exports[_0x1c88('0x56')]=function(_0x28f119,_0x345edd){return db[_0x1c88('0x38')][_0x1c88('0x56')]()[_0x1c88('0x1e')](respondWithResult(_0x345edd,null))[_0x1c88('0x27')](handleError(_0x345edd,null));};exports[_0x1c88('0x57')]=function(_0x3fdf08,_0x4cfbec,_0x25f23f){return db[_0x1c88('0x58')]['count']({'where':{'ChatGroupId':_0x3fdf08[_0x1c88('0x51')]['id'],'ToId':_0x3fdf08[_0x1c88('0x59')]['id'],'read':![]}})[_0x1c88('0x1e')](function(_0x481efd){return{'id':_[_0x1c88('0x5a')](_0x3fdf08[_0x1c88('0x51')]['id']),'count':_0x481efd};})[_0x1c88('0x1e')](respondWithResult(_0x4cfbec,null))[_0x1c88('0x27')](handleError(_0x4cfbec,null));};exports[_0x1c88('0x5b')]=function(_0x518210,_0x2d92fb,_0x58e719){return db['ChatGroup'][_0x1c88('0x52')]({'where':{'id':_0x518210['params']['id']}})[_0x1c88('0x1e')](handleEntityNotFound(_0x2d92fb,null))[_0x1c88('0x1e')](function(_0x23915b){if(_0x23915b){return _0x23915b[_0x1c88('0x5b')](_0x518210['body'][_0x1c88('0x5c')],_['omit'](_0x518210[_0x1c88('0x54')],[_0x1c88('0x5c'),'id'])||{});}})[_0x1c88('0x1e')](respondWithResult(_0x2d92fb,null))['catch'](handleError(_0x2d92fb,null));};exports[_0x1c88('0x5d')]=function(_0x414ea1,_0x2f0eea,_0x1d5503){var _0x5490f8={};var _0x56895e={};var _0x4dac61;var _0x4aaacf;return db[_0x1c88('0x38')][_0x1c88('0x5e')]({'where':{'id':_0x414ea1[_0x1c88('0x51')]['id']}})[_0x1c88('0x1e')](handleEntityNotFound(_0x2f0eea,null))[_0x1c88('0x1e')](function(_0xb842f7){if(_0xb842f7){_0x4dac61=_0xb842f7;_0x56895e[_0x1c88('0x3d')]=_[_0x1c88('0x3a')](db[_0x1c88('0x5f')]['rawAttributes']);_0x56895e[_0x1c88('0x3b')]=_[_0x1c88('0x3a')](_0x414ea1[_0x1c88('0x3b')]);_0x56895e[_0x1c88('0x3c')]=_['intersection'](_0x56895e[_0x1c88('0x3d')],_0x56895e[_0x1c88('0x3b')]);_0x5490f8[_0x1c88('0x3e')]=_[_0x1c88('0x3f')](_0x56895e[_0x1c88('0x3d')],qs[_0x1c88('0x40')](_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x40')]));_0x5490f8[_0x1c88('0x3e')]=_0x5490f8[_0x1c88('0x3e')]['length']?_0x5490f8[_0x1c88('0x3e')]:_0x56895e[_0x1c88('0x3d')];_0x5490f8[_0x1c88('0x43')]=qs['sort'](_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x44')]);_0x5490f8[_0x1c88('0x45')]=qs[_0x1c88('0x3c')](_[_0x1c88('0x46')](_0x414ea1[_0x1c88('0x3b')],_0x56895e[_0x1c88('0x3c')]));if(_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x4c')]){_0x5490f8[_0x1c88('0x45')]=_['merge'](_0x5490f8['where'],{'$or':_[_0x1c88('0x48')](_0x5490f8[_0x1c88('0x3e')],function(_0x1d47b2){var _0x560420={};_0x560420[_0x1d47b2]={'$like':'%'+_0x414ea1['query'][_0x1c88('0x4c')]+'%'};return _0x560420;})});}_0x5490f8=_[_0x1c88('0x47')]({},_0x5490f8,_0x414ea1[_0x1c88('0x4d')]);return _0x4dac61[_0x1c88('0x5d')](_0x5490f8);}})[_0x1c88('0x1e')](function(_0x1b4e33){if(_0x1b4e33){_0x4aaacf=_0x1b4e33['length'];if(!_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x60')]('nolimit')){_0x5490f8[_0x1c88('0x2c')]=qs[_0x1c88('0x2c')](_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x2c')]);_0x5490f8[_0x1c88('0x2b')]=qs[_0x1c88('0x2b')](_0x414ea1[_0x1c88('0x3b')][_0x1c88('0x2b')]);}return _0x4dac61[_0x1c88('0x5d')](_0x5490f8);}})['then'](function(_0x393f98){if(_0x393f98){return _0x393f98?{'count':_0x4aaacf,'rows':_0x393f98}:null;}})[_0x1c88('0x1e')](respondWithResult(_0x2f0eea,null))[_0x1c88('0x27')](handleError(_0x2f0eea,null));};exports[_0x1c88('0x61')]=function(_0xea3527,_0x5d9f3a,_0xf7a3ca){var _0x22c994;return db[_0x1c88('0x38')]['find']({'where':{'id':_0xea3527[_0x1c88('0x51')]['id']}})['then'](handleEntityNotFound(_0x5d9f3a,null))[_0x1c88('0x1e')](function(_0x3bc15f){if(_0x3bc15f){return _0x3bc15f[_0x1c88('0x61')](_0xea3527[_0x1c88('0x3b')][_0x1c88('0x5c')]);}})['then'](respondWithStatusCode(_0x5d9f3a,null))[_0x1c88('0x27')](handleError(_0x5d9f3a,null));};exports['addMessage']=function(_0x172f31,_0xda355a,_0x230b8d){if(_0x172f31[_0x1c88('0x54')]['id']){delete _0x172f31[_0x1c88('0x54')]['id'];}return db[_0x1c88('0x38')][_0x1c88('0x52')]({'where':{'id':_0x172f31[_0x1c88('0x51')]['id']}})[_0x1c88('0x1e')](handleEntityNotFound(_0xda355a,null))[_0x1c88('0x1e')](function(_0x32ea1d){if(_0x32ea1d){_0x172f31['body']['ChatGroupId']=_0x32ea1d['id'];return db[_0x1c88('0x58')][_0x1c88('0x53')](_0x172f31[_0x1c88('0x54')]);}})[_0x1c88('0x1e')](respondWithResult(_0xda355a,null))[_0x1c88('0x27')](handleError(_0xda355a,null));};exports[_0x1c88('0x62')]=function(_0x1130ad,_0x13fc83,_0x1ff8d3){var _0xfc8eee={};var _0x41b054={};var _0xcb85bd;var _0x5bb4e2;return db['ChatGroup'][_0x1c88('0x5e')]({'where':{'id':_0x1130ad['params']['id']}})['then'](handleEntityNotFound(_0x13fc83,null))['then'](function(_0x544e52){if(_0x544e52){_0xcb85bd=_0x544e52;_0x41b054[_0x1c88('0x3d')]=_[_0x1c88('0x3a')](db['ChatInternalMessage'][_0x1c88('0x39')]);_0x41b054['query']=_[_0x1c88('0x3a')](_0x1130ad[_0x1c88('0x3b')]);_0x41b054[_0x1c88('0x3c')]=_[_0x1c88('0x3f')](_0x41b054[_0x1c88('0x3d')],_0x41b054[_0x1c88('0x3b')]);_0xfc8eee['attributes']=_[_0x1c88('0x3f')](_0x41b054[_0x1c88('0x3d')],qs[_0x1c88('0x40')](_0x1130ad[_0x1c88('0x3b')][_0x1c88('0x40')]));_0xfc8eee[_0x1c88('0x3e')]=_0xfc8eee[_0x1c88('0x3e')][_0x1c88('0x41')]?_0xfc8eee[_0x1c88('0x3e')]:_0x41b054[_0x1c88('0x3d')];_0xfc8eee[_0x1c88('0x43')]=qs['sort'](_0x1130ad['query'][_0x1c88('0x44')]);_0xfc8eee['where']=qs['filters'](_['pick'](_0x1130ad[_0x1c88('0x3b')],_0x41b054[_0x1c88('0x3c')]));if(_0x1130ad[_0x1c88('0x3b')][_0x1c88('0x4c')]){_0xfc8eee[_0x1c88('0x45')]=_[_0x1c88('0x47')](_0xfc8eee['where'],{'$or':_['map'](_0xfc8eee[_0x1c88('0x3e')],function(_0x3cd684){var _0x3ecb28={};_0x3ecb28[_0x3cd684]={'$like':'%'+_0x1130ad[_0x1c88('0x3b')]['filter']+'%'};return _0x3ecb28;})});}if(_0x1130ad['query'][_0x1c88('0x63')]){var _0x2bdfbd=_0x1130ad[_0x1c88('0x3b')][_0x1c88('0x63')]['split'](',');var _0x107395={};_0x107395[_0x2bdfbd[0x0]]={'$gte':moment(_0x2bdfbd[0x1])[_0x1c88('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};_0xfc8eee['where']=_[_0x1c88('0x47')](_0xfc8eee[_0x1c88('0x45')],_0x107395);}_0xfc8eee=_[_0x1c88('0x47')]({},_0xfc8eee,_0x1130ad[_0x1c88('0x4d')]);return _0xcb85bd[_0x1c88('0x62')](_0xfc8eee);}})[_0x1c88('0x1e')](function(_0x11dcd9){if(_0x11dcd9){_0x5bb4e2=_0x11dcd9['length'];if(!_0x1130ad[_0x1c88('0x3b')][_0x1c88('0x60')](_0x1c88('0x42'))){_0xfc8eee[_0x1c88('0x2c')]=qs[_0x1c88('0x2c')](_0x1130ad[_0x1c88('0x3b')][_0x1c88('0x2c')]);_0xfc8eee[_0x1c88('0x2b')]=qs[_0x1c88('0x2b')](_0x1130ad['query'][_0x1c88('0x2b')]);}return _0xcb85bd[_0x1c88('0x62')](_0xfc8eee);}})[_0x1c88('0x1e')](function(_0x1e5c36){if(_0x1e5c36){return _0x1e5c36?{'count':_0x5bb4e2,'rows':_0x1e5c36}:null;}})['then'](respondWithResult(_0x13fc83,null))[_0x1c88('0x27')](handleError(_0x13fc83,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ad24d10..5afae87 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 _0x6144=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x15d049,_0x290021){var _0x26e64d=function(_0x2849c4){while(--_0x2849c4){_0x15d049['push'](_0x15d049['shift']());}};_0x26e64d(++_0x290021);}(_0x6144,0xa2));var _0x4614=function(_0x510a01,_0x554eb1){_0x510a01=_0x510a01-0x0;var _0x4221d6=_0x6144[_0x510a01];return _0x4221d6;};'use strict';var EventEmitter=require(_0x4614('0x0'));var ChatGroup=require(_0x4614('0x1'))['db'][_0x4614('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4614('0x3')](0x0);var events={'afterCreate':_0x4614('0x4'),'afterUpdate':_0x4614('0x5'),'afterDestroy':_0x4614('0x6')};function emitEvent(_0x9c3dc2){return function(_0x3b9a63,_0x4435f0,_0x551986){ChatGroupEvents[_0x4614('0x7')](_0x9c3dc2+':'+_0x3b9a63['id'],_0x3b9a63);ChatGroupEvents[_0x4614('0x7')](_0x9c3dc2,_0x3b9a63);_0x551986(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4614('0x8')](e,emitEvent(event));}}module[_0x4614('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xa47b=['remove','emit','hasOwnProperty','exports','ChatGroup','setMaxListeners','save','update'];(function(_0x1f288b,_0x560de0){var _0x2247ee=function(_0x4e4b40){while(--_0x4e4b40){_0x1f288b['push'](_0x1f288b['shift']());}};_0x2247ee(++_0x560de0);}(_0xa47b,0xe4));var _0xba47=function(_0xc3d5e4,_0x56a0f8){_0xc3d5e4=_0xc3d5e4-0x0;var _0x46ef63=_0xa47b[_0xc3d5e4];return _0x46ef63;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xba47('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xba47('0x1')](0x0);var events={'afterCreate':_0xba47('0x2'),'afterUpdate':_0xba47('0x3'),'afterDestroy':_0xba47('0x4')};function emitEvent(_0x390cb8){return function(_0x2ff98f,_0x380d48,_0x5cb3f6){ChatGroupEvents[_0xba47('0x5')](_0x390cb8+':'+_0x2ff98f['id'],_0x2ff98f);ChatGroupEvents[_0xba47('0x5')](_0x390cb8,_0x2ff98f);_0x5cb3f6(null);};}for(var e in events){if(events[_0xba47('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xba47('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 47afa33..4089d0f 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 _0x84b9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x34e607,_0x4f4c0e){var _0x3156fc=function(_0x236367){while(--_0x236367){_0x34e607['push'](_0x34e607['shift']());}};_0x3156fc(++_0x4f4c0e);}(_0x84b9,0x1bc));var _0x984b=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x84b9[_0x102881];return _0x5c63d0;};'use strict';var _=require(_0x984b('0x0'));var util=require(_0x984b('0x1'));var logger=require(_0x984b('0x2'))(_0x984b('0x3'));var moment=require(_0x984b('0x4'));var BPromise=require(_0x984b('0x5'));var rp=require(_0x984b('0x6'));var attributes=require(_0x984b('0x7'));module[_0x984b('0x8')]=function(_0x2bc077,_0x4db85b){return _0x2bc077[_0x984b('0x9')](_0x984b('0xa'),attributes,{'tableName':_0x984b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b54=['api','moment','bluebird','request-promise','./chatGroup.attributes','exports','define','ChatGroup','util'];(function(_0x12ab9c,_0x1ad557){var _0x2a3e39=function(_0x5f0653){while(--_0x5f0653){_0x12ab9c['push'](_0x12ab9c['shift']());}};_0x2a3e39(++_0x1ad557);}(_0x6b54,0x86));var _0x46b5=function(_0x835f85,_0xa30228){_0x835f85=_0x835f85-0x0;var _0xfdc1b=_0x6b54[_0x835f85];return _0xfdc1b;};'use strict';var _=require('lodash');var util=require(_0x46b5('0x0'));var logger=require('../../config/logger')(_0x46b5('0x1'));var moment=require(_0x46b5('0x2'));var BPromise=require(_0x46b5('0x3'));var rp=require(_0x46b5('0x4'));var attributes=require(_0x46b5('0x5'));module[_0x46b5('0x6')]=function(_0x34f998,_0x2612bc){return _0x34f998[_0x46b5('0x7')](_0x46b5('0x8'),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 47a94fa..dd87001 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 _0xe5b3=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5b3,0x133));var _0x3e5b=function(_0x20b0bd,_0x26e296){_0x20b0bd=_0x20b0bd-0x0;var _0x2051c8=_0xe5b3[_0x20b0bd];return _0x2051c8;};'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});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});} \ No newline at end of file +var _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3f07f2,_0x5e732a){var _0x5b9443=function(_0x211700){while(--_0x211700){_0x3f07f2['push'](_0x3f07f2['shift']());}};_0x5b9443(++_0x5e732a);}(_0x84ab,0x12f));var _0xb84a=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x84ab[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 23c28ff..2051b48 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 _0x6611=['emit','removeListener','register','length','save','remove','update'];(function(_0x533c7f,_0x4ab7be){var _0xc2077d=function(_0x442622){while(--_0x442622){_0x533c7f['push'](_0x533c7f['shift']());}};_0xc2077d(++_0x4ab7be);}(_0x6611,0xdd));var _0x1661=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6611[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1661('0x0'),_0x1661('0x1'),_0x1661('0x2')];function createListener(_0x1a93fb,_0x3dcfbd){return function(_0x474832){_0x3dcfbd[_0x1661('0x3')](_0x1a93fb,_0x474832);};}function removeListener(_0x25bce6,_0x277da8){return function(){ChatGroupEvents[_0x1661('0x4')](_0x25bce6,_0x277da8);};}exports[_0x1661('0x5')]=function(_0x1e5dab){for(var _0x58781d=0x0,_0x516d22=events[_0x1661('0x6')];_0x58781d<_0x516d22;_0x58781d++){var _0x3be60f=events[_0x58781d];var _0x57e4b8=createListener('chatGroup:'+_0x3be60f,_0x1e5dab);ChatGroupEvents['on'](_0x3be60f,_0x57e4b8);}}; \ No newline at end of file +var _0xe0c0=['remove','update','emit','register','length','chatGroup:','./chatGroup.events'];(function(_0x1f0c22,_0x3e9402){var _0x533c44=function(_0x4387e3){while(--_0x4387e3){_0x1f0c22['push'](_0x1f0c22['shift']());}};_0x533c44(++_0x3e9402);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x43a0ae,_0x31c134){_0x43a0ae=_0x43a0ae-0x0;var _0x8999c1=_0xe0c0[_0x43a0ae];return _0x8999c1;};'use strict';var ChatGroupEvents=require(_0x0e0c('0x0'));var events=['save',_0x0e0c('0x1'),_0x0e0c('0x2')];function createListener(_0x2a083c,_0x386d52){return function(_0x491fc7){_0x386d52[_0x0e0c('0x3')](_0x2a083c,_0x491fc7);};}function removeListener(_0x289810,_0x373046){return function(){ChatGroupEvents['removeListener'](_0x289810,_0x373046);};}exports[_0x0e0c('0x4')]=function(_0x2856d7){for(var _0x4a094c=0x0,_0x14e5de=events[_0x0e0c('0x5')];_0x4a094c<_0x14e5de;_0x4a094c++){var _0xf7de29=events[_0x4a094c];var _0x13e45d=createListener(_0x0e0c('0x6')+_0xf7de29,_0x2856d7);ChatGroupEvents['on'](_0xf7de29,_0x13e45d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 649bb00..cb001a9 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 _0xa9e9=['Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','describe','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','util','express'];(function(_0x2f8a8a,_0x45c54d){var _0x2e5d90=function(_0x1a3339){while(--_0x1a3339){_0x2f8a8a['push'](_0x2f8a8a['shift']());}};_0x2e5d90(++_0x45c54d);}(_0xa9e9,0xcd));var _0x9a9e=function(_0x4c6747,_0xf84f0e){_0x4c6747=_0x4c6747-0x0;var _0x35af9c=_0xa9e9[_0x4c6747];return _0x35af9c;};'use strict';var multer=require('multer');var util=require(_0x9a9e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a9e('0x1'));var router=express[_0x9a9e('0x2')]();var auth=require(_0x9a9e('0x3'));var interaction=require(_0x9a9e('0x4'));var config=require('../../config/environment');var controller=require(_0x9a9e('0x5'));router[_0x9a9e('0x6')]('/',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x8')]);router['get']('/describe',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x9')]);router[_0x9a9e('0x6')]('/:id',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0xa')]);router[_0x9a9e('0x6')]('/:id/unread',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0xb')]);router[_0x9a9e('0x6')](_0x9a9e('0xc'),auth[_0x9a9e('0x7')](),controller[_0x9a9e('0xd')]);router[_0x9a9e('0x6')](_0x9a9e('0xe'),auth['isAuthenticated'](),controller[_0x9a9e('0xf')]);router[_0x9a9e('0x10')]('/',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x11')]);router[_0x9a9e('0x10')]('/:id/members',auth[_0x9a9e('0x7')](),controller['addMembers']);router[_0x9a9e('0x10')]('/:id/messages',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x12')]);router['put']('/:id',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x13')]);router[_0x9a9e('0x14')]('/:id',auth[_0x9a9e('0x7')](),controller[_0x9a9e('0x15')]);router[_0x9a9e('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0x9a9e('0x16')]);module['exports']=router; \ No newline at end of file +var _0xfbd8=['/:id/messages','post','addMembers','addMessage','put','delete','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/unread','/:id/members','getMembers'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xfbd8,0x13f));var _0x8fbd=function(_0x347733,_0x5de9fa){_0x347733=_0x347733-0x0;var _0x398c75=_0xfbd8[_0x347733];return _0x398c75;};'use strict';var multer=require(_0x8fbd('0x0'));var util=require(_0x8fbd('0x1'));var path=require(_0x8fbd('0x2'));var timeout=require(_0x8fbd('0x3'));var express=require(_0x8fbd('0x4'));var router=express[_0x8fbd('0x5')]();var auth=require(_0x8fbd('0x6'));var interaction=require(_0x8fbd('0x7'));var config=require(_0x8fbd('0x8'));var controller=require(_0x8fbd('0x9'));router[_0x8fbd('0xa')]('/',auth['isAuthenticated'](),controller[_0x8fbd('0xb')]);router[_0x8fbd('0xa')](_0x8fbd('0xc'),auth[_0x8fbd('0xd')](),controller['describe']);router[_0x8fbd('0xa')](_0x8fbd('0xe'),auth[_0x8fbd('0xd')](),controller[_0x8fbd('0xf')]);router[_0x8fbd('0xa')](_0x8fbd('0x10'),auth[_0x8fbd('0xd')](),controller['getUnread']);router['get'](_0x8fbd('0x11'),auth[_0x8fbd('0xd')](),controller[_0x8fbd('0x12')]);router[_0x8fbd('0xa')](_0x8fbd('0x13'),auth[_0x8fbd('0xd')](),controller['getMessages']);router[_0x8fbd('0x14')]('/',auth[_0x8fbd('0xd')](),controller['create']);router[_0x8fbd('0x14')](_0x8fbd('0x11'),auth[_0x8fbd('0xd')](),controller[_0x8fbd('0x15')]);router[_0x8fbd('0x14')](_0x8fbd('0x13'),auth[_0x8fbd('0xd')](),controller[_0x8fbd('0x16')]);router[_0x8fbd('0x17')](_0x8fbd('0xe'),auth[_0x8fbd('0xd')](),controller['update']);router[_0x8fbd('0x18')](_0x8fbd('0xe'),auth[_0x8fbd('0xd')](),controller['destroy']);router[_0x8fbd('0x18')](_0x8fbd('0x11'),auth['isAuthenticated'](),controller[_0x8fbd('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b13410a..0c6dc11 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 _0xee5b=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','DATE','STRING','ENUM','out'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1a1af1,_0x2efb92){_0x1a1af1=_0x1a1af1-0x0;var _0x5b37f8=_0xee5b[_0x1a1af1];return _0x5b37f8;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbee5('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xbee5('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xbee5('0x3'),_0xbee5('0x4')),'defaultValue':_0xbee5('0x3')},'ratingMessage':{'type':Sequelize[_0xbee5('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbee5('0x6')]},'disposition':{'type':Sequelize[_0xbee5('0x7')]},'note':{'type':Sequelize[_0xbee5('0x7')]},'browserName':{'type':Sequelize[_0xbee5('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xbee5('0x7')]},'referer':{'type':Sequelize[_0xbee5('0x7')]},'customerIp':{'type':Sequelize[_0xbee5('0x7')]},'formData':{'type':Sequelize[_0xbee5('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xbee5('0x6')]},'lastMsgAt':{'type':Sequelize[_0xbee5('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xbee5('0x8')]('in',_0xbee5('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbee5('0x7')]}}; \ No newline at end of file +var _0x36ee=['BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x46647b,_0x4e8678){var _0x2bef5d=function(_0x336266){while(--_0x336266){_0x46647b['push'](_0x46647b['shift']());}};_0x2bef5d(++_0x4e8678);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe36e('0x1')](_0xe36e('0x2'),_0xe36e('0x3')),'defaultValue':_0xe36e('0x2')},'ratingMessage':{'type':Sequelize[_0xe36e('0x4')]},'pathTranscript':{'type':Sequelize[_0xe36e('0x4')]},'mailTranscript':{'type':Sequelize[_0xe36e('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe36e('0x6')]},'disposition':{'type':Sequelize[_0xe36e('0x5')]},'note':{'type':Sequelize[_0xe36e('0x5')]},'browserName':{'type':Sequelize[_0xe36e('0x5')]},'browserVersion':{'type':Sequelize[_0xe36e('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xe36e('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xe36e('0x5')]},'deviceType':{'type':Sequelize[_0xe36e('0x5')]},'referer':{'type':Sequelize[_0xe36e('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe36e('0x4')]('long')},'read1stAt':{'type':Sequelize[_0xe36e('0x6')]},'lastMsgAt':{'type':Sequelize[_0xe36e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xe36e('0x1')]('in',_0xe36e('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe36e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 303cca2..a60904d 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 _0x4249=['%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','email','user','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','merge','$gte','split','getMyMessages','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','root','server','files','tmp','interaction-%s.zip','firstName','Letter','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','','%s:\x20%s

','createReadStream','createWriteStream','toFile','interaction-','.pdf','log','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','update','destroy','name','send','index','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','include','tag','push','Tags','distinct','read','Messages','createdAt','count','then','includeAll','User','fullname','CmContact','Contact','Owner','internal','ChatWebsite','Account','ChatMessage','Tag','color','ThroughTags','findAll','rows','show','length','find','create','body','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Sequelize','ValidationError','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','originalname','filename','Attachment','findOne','Unauthorized','download','server/files/attachments/','basename','close','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','ContactId'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x4249,0x100));var _0x9424=function(_0x5787e0,_0xd90606){_0x5787e0=_0x5787e0-0x0;var _0x55c180=_0x4249[_0x5787e0];return _0x55c180;};'use strict';var pdf=require(_0x9424('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9424('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9424('0x2'));var rp=require(_0x9424('0x3'));var moment=require('moment');var BPromise=require(_0x9424('0x4'));var Mustache=require(_0x9424('0x5'));var util=require(_0x9424('0x6'));var path=require('path');var sox=require(_0x9424('0x7'));var csv=require('to-csv');var ejs=require(_0x9424('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9424('0x9'));var jsforce=require(_0x9424('0xa'));var deskjs=require(_0x9424('0xb'));var toCsv=require(_0x9424('0xc'));var querystring=require(_0x9424('0xd'));var Papa=require(_0x9424('0xe'));var authService=require(_0x9424('0xf'));var hardwareService=require(_0x9424('0x10'));var Redis=require(_0x9424('0x11'));var qs=require(_0x9424('0x12'));var logger=require(_0x9424('0x13'))(_0x9424('0x14'));var utils=require(_0x9424('0x15'));var config=require(_0x9424('0x16'));var db=require('../../mysqldb')['db'];config[_0x9424('0x17')]=_[_0x9424('0x18')](config['redis'],{'host':_0x9424('0x19'),'port':0x18eb});var socket=require(_0x9424('0x1a'))(new Redis(config[_0x9424('0x17')]));require(_0x9424('0x1b'))[_0x9424('0x1c')](socket);var jayson=require(_0x9424('0x1d'));var client=jayson[_0x9424('0x1e')][_0x9424('0x1f')]({'port':0x232b});var client9004=jayson[_0x9424('0x1e')][_0x9424('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1393ec,_0x7c7f99,_0x35c81b,_0x23cd21){return new BPromise(function(_0x3623b9,_0x299607){var _0x11c9af=_0x23cd21||client;return _0x11c9af['request'](_0x1393ec,_0x35c81b)['then'](function(_0x5d9bbe){logger[_0x9424('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x7c7f99,_0x9424('0x21'));logger[_0x9424('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x7c7f99,_0x9424('0x21'),JSON[_0x9424('0x23')](_0x5d9bbe));if(_0x5d9bbe[_0x9424('0x24')]){if(_0x5d9bbe[_0x9424('0x24')]['code']===0x1f4){logger['error'](_0x9424('0x25'),_0x7c7f99,_0x5d9bbe['error'][_0x9424('0x26')]);return _0x299607(_0x5d9bbe[_0x9424('0x24')][_0x9424('0x26')]);}logger[_0x9424('0x24')](_0x9424('0x25'),_0x7c7f99,_0x5d9bbe[_0x9424('0x24')]['message']);return _0x3623b9(_0x5d9bbe[_0x9424('0x24')]['message']);}else{logger[_0x9424('0x20')](_0x9424('0x25'),_0x7c7f99,_0x9424('0x21'));_0x3623b9(_0x5d9bbe['result'][_0x9424('0x26')]);}})[_0x9424('0x27')](function(_0x46e25a){logger['error'](_0x9424('0x25'),_0x7c7f99,_0x46e25a);_0x299607(_0x46e25a);});});}function respondWithStatusCode(_0x5487fd,_0x580c37){_0x580c37=_0x580c37||0xcc;return function(_0xb28f31){if(_0xb28f31){return _0x5487fd[_0x9424('0x28')](_0x580c37);}return _0x5487fd[_0x9424('0x29')](_0x580c37)[_0x9424('0x2a')]();};}function respondWithResult(_0x4bca63,_0x52f6b9){_0x52f6b9=_0x52f6b9||0xc8;return function(_0x392081){if(_0x392081){return _0x4bca63[_0x9424('0x29')](_0x52f6b9)[_0x9424('0x2b')](_0x392081);}};}function respondWithFilteredResult(_0x5d12da,_0x3fab4f){return function(_0x1b948c){if(_0x1b948c){var _0xd9f53e=_0x1b948c['count'],_0x12f5cb=_0x3fab4f['offset'],_0x2de2fe=_0x3fab4f[_0x9424('0x2c')]+_0x3fab4f['limit'],_0x29ed1c;if(_0x2de2fe>=_0xd9f53e){_0x2de2fe=_0xd9f53e;_0x29ed1c=0xc8;}else{_0x29ed1c=0xce;}_0x5d12da[_0x9424('0x29')](_0x29ed1c);return _0x5d12da[_0x9424('0x2d')](_0x9424('0x2e'),_0x12f5cb+'-'+_0x2de2fe+'/'+_0xd9f53e)[_0x9424('0x2b')](_0x1b948c);}return null;};}function patchUpdates(_0x29edaa){return function(_0x404d36){try{jsonpatch[_0x9424('0x2f')](_0x404d36,_0x29edaa,!![]);}catch(_0x2e6094){return BPromise['reject'](_0x2e6094);}return _0x404d36['save']();};}function saveUpdates(_0x4faff7,_0x3955b9){return function(_0x40b043){if(_0x40b043){return _0x40b043[_0x9424('0x30')](_0x4faff7)['then'](function(_0x560050){return _0x560050;});}return null;};}function removeEntity(_0x57423e,_0x29b26f){return function(_0xff577e){if(_0xff577e){return _0xff577e[_0x9424('0x31')]()['then'](function(){_0x57423e[_0x9424('0x29')](0xcc)[_0x9424('0x2a')]();});}};}function handleEntityNotFound(_0x665ac0,_0x42e4c4){return function(_0x36ec60){if(!_0x36ec60){_0x665ac0[_0x9424('0x28')](0x194);}return _0x36ec60;};}function handleError(_0x3deb56,_0x2189cf){_0x2189cf=_0x2189cf||0x1f4;return function(_0x1e751b){logger[_0x9424('0x24')](_0x1e751b['stack']);if(_0x1e751b[_0x9424('0x32')]){delete _0x1e751b[_0x9424('0x32')];}_0x3deb56[_0x9424('0x29')](_0x2189cf)[_0x9424('0x33')](_0x1e751b);};}exports[_0x9424('0x34')]=function(_0x507a69,_0x41d1a7){var _0x572abd={},_0x13db4c={},_0xa40e46={'count':0x0,'rows':[]};var _0x3034d6=db[_0x9424('0x35')][_0x9424('0x36')];_0x13db4c[_0x9424('0x37')]=_[_0x9424('0x38')](_0x3034d6);_0x13db4c[_0x9424('0x39')]=_[_0x9424('0x38')](_0x507a69[_0x9424('0x39')]);_0x13db4c[_0x9424('0x3a')]=_[_0x9424('0x3b')](_0x13db4c[_0x9424('0x37')],_0x13db4c['query']);_0x572abd[_0x9424('0x3c')]=_[_0x9424('0x3b')](_0x13db4c[_0x9424('0x37')],qs['fields'](_0x507a69[_0x9424('0x39')][_0x9424('0x3d')]));_0x572abd['attributes']=_0x572abd[_0x9424('0x3c')]['length']?_0x572abd[_0x9424('0x3c')]:_0x13db4c[_0x9424('0x37')];if(!_0x507a69[_0x9424('0x39')]['hasOwnProperty'](_0x9424('0x3e'))){_0x572abd[_0x9424('0x3f')]=qs[_0x9424('0x3f')](_0x507a69[_0x9424('0x39')][_0x9424('0x3f')]);_0x572abd['offset']=qs[_0x9424('0x2c')](_0x507a69['query'][_0x9424('0x2c')]);}_0x572abd[_0x9424('0x40')]=qs[_0x9424('0x41')](_0x507a69[_0x9424('0x39')][_0x9424('0x41')]);_0x572abd[_0x9424('0x42')]=qs[_0x9424('0x3a')](_[_0x9424('0x43')](_0x507a69['query'],_0x13db4c[_0x9424('0x3a')]));if(_0x507a69[_0x9424('0x39')]['filter']){_0x572abd[_0x9424('0x42')]=_['merge'](_0x572abd[_0x9424('0x42')],{'$or':_[_0x9424('0x44')](_0x3034d6,function(_0x4843cd){if(_0x4843cd[_0x9424('0x45')][_0x9424('0x46')]!==_0x9424('0x47')){var _0x4b988a={};_0x4b988a[_0x4843cd[_0x9424('0x48')]]={'$like':'%'+_0x507a69[_0x9424('0x39')][_0x9424('0x49')]+'%'};return _0x4b988a;}})});}_0x572abd=_['merge']({},_0x572abd,_0x507a69[_0x9424('0x4a')]);var _0xaaec5d={'where':_0x572abd['where']};_0xaaec5d[_0x9424('0x4b')]=[];if(_0x507a69[_0x9424('0x39')][_0x9424('0x4c')]){_0xaaec5d[_0x9424('0x4b')][_0x9424('0x4d')]({'model':db['Tag'],'as':_0x9424('0x4e'),'attributes':['id'],'where':{'id':_0x507a69[_0x9424('0x39')][_0x9424('0x4c')]},'required':!![]});_0xaaec5d[_0x9424('0x4f')]=!![];}if(_0x507a69[_0x9424('0x39')][_0x9424('0x50')]){_0xaaec5d['include'][_0x9424('0x4d')]({'model':db['ChatMessage'],'as':_0x9424('0x51'),'attributes':['id','direction',_0x9424('0x52'),'read'],'where':{'direction':'in','read':_0x507a69[_0x9424('0x39')][_0x9424('0x50')]||![]},'required':!![]});_0xaaec5d[_0x9424('0x4f')]=!![];}return db[_0x9424('0x35')][_0x9424('0x53')](_0xaaec5d)[_0x9424('0x54')](function(_0x581ad3){_0xa40e46['count']=_0x581ad3;if(_0x507a69['query'][_0x9424('0x55')]){_0x572abd[_0x9424('0x4b')]=[{'model':db[_0x9424('0x56')],'as':'Users','required':![],'attributes':['id',_0x9424('0x32'),_0x9424('0x57')]},{'model':db[_0x9424('0x58')],'as':_0x9424('0x59'),'required':![]},{'model':db[_0x9424('0x56')],'as':_0x9424('0x5a'),'attributes':[_0x9424('0x32'),_0x9424('0x57'),_0x9424('0x5b')],'required':![]},{'model':db[_0x9424('0x5c')],'as':_0x9424('0x5d'),'attributes':[_0x9424('0x32'),_0x9424('0x46')],'required':![]},{'model':db[_0x9424('0x5e')],'as':_0x9424('0x51'),'attributes':['id','direction',_0x9424('0x52'),'read'],'where':{'direction':'in','read':_0x507a69[_0x9424('0x39')][_0x9424('0x50')]||![]},'required':_0x507a69[_0x9424('0x39')][_0x9424('0x50')]||![]},{'model':db[_0x9424('0x5f')],'as':_0x9424('0x4e'),'attributes':['id',_0x9424('0x32'),_0x9424('0x60')],'required':_0x507a69['query'][_0x9424('0x4c')]?!![]:![]},{'model':db[_0x9424('0x5f')],'as':_0x9424('0x61'),'attributes':['id','name','color'],'through':_0x507a69[_0x9424('0x39')]['tag']?{'attributes':[],'where':{'TagId':_0x507a69[_0x9424('0x39')][_0x9424('0x4c')]||undefined}}:{},'required':_0x507a69[_0x9424('0x39')][_0x9424('0x4c')]?!![]:![]}];}return db[_0x9424('0x35')][_0x9424('0x62')](_0x572abd);})[_0x9424('0x54')](function(_0x4bf470){_0xa40e46[_0x9424('0x63')]=_0x4bf470;return _0xa40e46;})[_0x9424('0x54')](respondWithFilteredResult(_0x41d1a7,_0x572abd))[_0x9424('0x27')](handleError(_0x41d1a7,null));};exports[_0x9424('0x64')]=function(_0x435614,_0x444e23){var _0x5f4529={'raw':![],'where':{'id':_0x435614['params']['id']}},_0x399959={};_0x399959[_0x9424('0x37')]=_['keys'](db[_0x9424('0x35')][_0x9424('0x36')]);_0x399959[_0x9424('0x39')]=_[_0x9424('0x38')](_0x435614['query']);_0x399959['filters']=_[_0x9424('0x3b')](_0x399959[_0x9424('0x37')],_0x399959['query']);_0x5f4529[_0x9424('0x3c')]=_[_0x9424('0x3b')](_0x399959[_0x9424('0x37')],qs[_0x9424('0x3d')](_0x435614[_0x9424('0x39')][_0x9424('0x3d')]));_0x5f4529['attributes']=_0x5f4529[_0x9424('0x3c')][_0x9424('0x65')]?_0x5f4529[_0x9424('0x3c')]:_0x399959[_0x9424('0x37')];if(_0x435614['query'][_0x9424('0x55')]){_0x5f4529[_0x9424('0x4b')]=[{'all':!![]}];}_0x5f4529=_['merge']({},_0x5f4529,_0x435614[_0x9424('0x4a')]);return db[_0x9424('0x35')][_0x9424('0x66')](_0x5f4529)[_0x9424('0x54')](handleEntityNotFound(_0x444e23,null))[_0x9424('0x54')](respondWithResult(_0x444e23,null))[_0x9424('0x27')](handleError(_0x444e23,null));};exports[_0x9424('0x67')]=function(_0x3b6874,_0x28e18d){return db[_0x9424('0x35')][_0x9424('0x67')](_0x3b6874[_0x9424('0x68')],{})[_0x9424('0x54')](respondWithResult(_0x28e18d,0xc9))[_0x9424('0x27')](handleError(_0x28e18d,null));};exports['update']=function(_0x2ce972,_0x3e7576){if(_0x2ce972[_0x9424('0x68')]['id']){delete _0x2ce972['body']['id'];}return db['ChatInteraction'][_0x9424('0x66')]({'where':{'id':_0x2ce972[_0x9424('0x69')]['id']}})[_0x9424('0x54')](handleEntityNotFound(_0x3e7576,null))['then'](saveUpdates(_0x2ce972[_0x9424('0x68')],null))[_0x9424('0x54')](respondWithResult(_0x3e7576,null))['catch'](handleError(_0x3e7576,null));};exports[_0x9424('0x31')]=function(_0x2b1622,_0x17ee7e){return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x2b1622['params']['id']}})['then'](handleEntityNotFound(_0x17ee7e,null))[_0x9424('0x54')](removeEntity(_0x17ee7e,null))[_0x9424('0x27')](handleError(_0x17ee7e,null));};exports['describe']=function(_0x5269e2,_0x4bd567){return db[_0x9424('0x35')][_0x9424('0x6a')]()[_0x9424('0x54')](respondWithResult(_0x4bd567,null))[_0x9424('0x27')](handleError(_0x4bd567,null));};exports[_0x9424('0x6b')]=function(_0x170f4f,_0x3e3e2c){if(_0x170f4f[_0x9424('0x68')]['id']){delete _0x170f4f[_0x9424('0x68')]['id'];}return db[_0x9424('0x35')]['find']({'where':{'id':_0x170f4f[_0x9424('0x69')]['id']}})['then'](handleEntityNotFound(_0x3e3e2c,null))[_0x9424('0x54')](saveUpdates(_0x170f4f['body'],null))[_0x9424('0x54')](respondWithResult(_0x3e3e2c,null))[_0x9424('0x27')](handleError(_0x3e3e2c,null));};exports[_0x9424('0x6c')]=function(_0x4fc830,_0x12041,_0x4e781c){if(_0x4fc830[_0x9424('0x68')]['id']){delete _0x4fc830[_0x9424('0x68')]['id'];}return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x4fc830[_0x9424('0x69')]['id']}})[_0x9424('0x54')](function(_0xe4b7d1){if(!_0xe4b7d1){logger[_0x9424('0x24')](_0x9424('0x6d'),_0x9424('0x6c'),0x194,_0x9424('0x6e'));_0x12041[_0x9424('0x28')](0x194);}else{if(_0xe4b7d1[_0x9424('0x6f')]){throw new db[(_0x9424('0x70'))][(_0x9424('0x71'))](_0x9424('0x72'));}}return _0xe4b7d1;})[_0x9424('0x54')](function(_0x37e57c){if(_0x37e57c){return _0x37e57c[_0x9424('0x30')]({'closed':_0x4fc830['body']['closed'],'disposition':_0x4fc830[_0x9424('0x68')][_0x9424('0x73')]})['then'](function(_0x5de820){return _0x5de820;});}})[_0x9424('0x54')](function(_0x17f22d){return respondWithRpcPromise(_0x9424('0x74'),_0x9424('0x6c'),_0x4fc830[_0x9424('0x68')],client9004);})['then'](respondWithResult(_0x12041,null))[_0x9424('0x27')](handleError(_0x12041,null));};exports['attachmentUpload']=function(_0x139671,_0xff7e8,_0x2df7f9){_0x139671['body'][_0x9424('0x32')]=_0x139671[_0x9424('0x75')][_0x9424('0x76')];_0x139671['body']['basename']=_0x139671[_0x9424('0x75')][_0x9424('0x77')];_0x139671[_0x9424('0x68')][_0x9424('0x45')]=_0x139671['file']['mimetype'];return db[_0x9424('0x78')][_0x9424('0x67')](_0x139671[_0x9424('0x68')])[_0x9424('0x54')](respondWithResult(_0xff7e8,0xc9))['catch'](handleError(_0xff7e8,null));};exports['attachmentDownload']=function(_0x297ff3,_0x46902e,_0x15c1ac){return db[_0x9424('0x35')][_0x9424('0x79')]({'where':{'id':_0x297ff3[_0x9424('0x69')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x46902e,null))[_0x9424('0x54')](function(_0x5e98b4){if(_0x5e98b4){if(_0x5e98b4['closed']){return _0x46902e[_0x9424('0x29')](0x193)[_0x9424('0x2b')]({'status':0x193,'message':_0x9424('0x7a')});}return db[_0x9424('0x78')]['findOne']({'where':{'id':_0x297ff3[_0x9424('0x39')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x46902e,null));}})['then'](function(_0x1762e2){if(_0x1762e2){return _0x46902e[_0x9424('0x7b')](path['join'](config['root'],_0x9424('0x7c'),_0x1762e2[_0x9424('0x7d')]));}})[_0x9424('0x27')](handleError(_0x46902e,null));};exports[_0x9424('0x7e')]=function(_0x503780,_0x221908){var _0x582d82=null;var _0x34d2d5=null;var _0x3fb73e=null;var _0x266dfb=null;if(_0x503780[_0x9424('0x68')]['id']){delete _0x503780['body']['id'];}if(_0x503780['body'][_0x9424('0x7f')]){_0x266dfb=path[_0x9424('0x80')](config['root'],_0x9424('0x81'),util[_0x9424('0x82')](_0x9424('0x83'),Date[_0x9424('0x84')]()));_0x503780['body'][_0x9424('0x85')]=_0x266dfb;}return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x503780[_0x9424('0x69')]['id']},'include':[{'model':db[_0x9424('0x5e')],'as':_0x9424('0x51'),'include':[{'model':db['User'],'as':_0x9424('0x56')}]}]})[_0x9424('0x54')](handleEntityNotFound(_0x221908,null))[_0x9424('0x54')](saveUpdates(_0x503780[_0x9424('0x68')],null))[_0x9424('0x54')](function(_0x5eb415){if(_0x5eb415){_0x582d82=_0x5eb415;return db[_0x9424('0x5c')][_0x9424('0x66')]({'where':{'id':_0x582d82[_0x9424('0x86')]}});}})[_0x9424('0x54')](function(_0x28be75){if(_0x28be75){_0x3fb73e=_0x28be75;return db[_0x9424('0x58')][_0x9424('0x66')]({'where':{'id':_0x582d82[_0x9424('0x87')]}});}})[_0x9424('0x54')](function(_0x4801b6){if(_0x4801b6){_0x34d2d5=_0x4801b6;if(_0x266dfb){var _0x420ba2=null;for(var _0x56e1f1=0x1;_0x56e1f1<_0x582d82[_0x9424('0x51')]['length'];++_0x56e1f1){_0x420ba2=_0x582d82[_0x9424('0x51')][_0x56e1f1];var _0x7b6c12=_0x420ba2[_0x9424('0x6f')]?util[_0x9424('0x82')](_0x9424('0x88'),_0x3fb73e[_0x9424('0x89')],_0x420ba2['UserId']):_0x9424('0x8a');var _0x569860=_0x503780['body'][_0x9424('0x8b')]||util[_0x9424('0x82')](_0x9424('0x88'),_0x9424('0x8c'),_0x420ba2['ContactId']);switch(_0x3fb73e[_0x9424('0x8d')]){case _0x9424('0x8e'):_0x7b6c12=_0x420ba2['UserId']?util['format']('%s%d',_0x3fb73e[_0x9424('0x89')],_0x420ba2[_0x9424('0x6f')]):_0x9424('0x8a');break;case _0x9424('0x8f'):_0x7b6c12=_0x420ba2[_0x9424('0x6f')]?_0x420ba2[_0x9424('0x56')][_0x9424('0x90')]||_0x420ba2[_0x9424('0x56')][_0x9424('0x57')]:_0x9424('0x8a');break;case _0x9424('0x91'):_0x7b6c12=_0x420ba2[_0x9424('0x6f')]?_0x420ba2[_0x9424('0x56')][_0x9424('0x57')]:_0x9424('0x8a');break;default:_0x7b6c12=_0x420ba2[_0x9424('0x6f')]?util['format'](_0x9424('0x88'),_0x3fb73e[_0x9424('0x89')],_0x420ba2['UserId']):_0x9424('0x8a');}var _0x294840=util[_0x9424('0x82')](_0x9424('0x92'),moment(_0x420ba2[_0x9424('0x52')])[_0x9424('0x82')]('MM/DD/YYYY\x20HH:mm:ss'),_0x420ba2['direction']==='in'?_0x569860:_0x7b6c12,_0x420ba2['body']);if(!_0x420ba2[_0x9424('0x93')]){fs['appendFileSync'](_0x266dfb,_0x294840);}}return db[_0x9424('0x94')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x9424('0x95')],'as':'Smtp','raw':!![]}]});}}})[_0x9424('0x54')](function(_0xbded7){if(_0xbded7&&_0xbded7[_0x9424('0x96')]&&_0x503780[_0x9424('0x68')]){var _0x26ee70={'tls':{'rejectUnauthorized':![]}};if(_0xbded7['Smtp'][_0x9424('0x97')]){_0x26ee70['service']=_0xbded7['Smtp'][_0x9424('0x97')];}else{_0x26ee70[_0x9424('0x98')]=_0xbded7[_0x9424('0x96')][_0x9424('0x98')];_0x26ee70[_0x9424('0x99')]=_0xbded7[_0x9424('0x96')][_0x9424('0x99')];_0x26ee70[_0x9424('0x9a')]=_0xbded7[_0x9424('0x96')][_0x9424('0x9a')];}if(_0xbded7[_0x9424('0x96')][_0x9424('0x9b')]){_0x26ee70[_0x9424('0x9c')]={'user':_0xbded7[_0x9424('0x96')]['user'],'pass':_0xbded7[_0x9424('0x96')][_0x9424('0x9d')]};}return respondWithRpcPromise(_0x9424('0x9e'),'sendMail',{'account':_0x26ee70,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xbded7[_0x9424('0x32')],_0xbded7[_0x9424('0x9f')]||_0xbded7[_0x9424('0x96')][_0x9424('0xa0')]),'to':_0x503780[_0x9424('0x68')][_0x9424('0x7f')],'subject':_0x9424('0xa1'),'text':util[_0x9424('0x82')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x503780[_0x9424('0x68')]['mailTranscript']),'attachments':[{'path':_0x266dfb}]}})[_0x9424('0x54')](function(){return _0x582d82;})[_0x9424('0x27')](function(_0x3ef3ba){console[_0x9424('0x24')](_0x3ef3ba);});}else{return _0x582d82;}})['then'](respondWithStatusCode(_0x221908,0xc8))['catch'](handleError(_0x221908,null));};exports['addMessage']=function(_0x43c04e,_0x5e9526,_0x2fcd46){return db[_0x9424('0x5e')][_0x9424('0x66')]({'where':{'id':_0x43c04e[_0x9424('0x69')]['id']}})[_0x9424('0x54')](handleEntityNotFound(_0x5e9526,null))[_0x9424('0x54')](function(_0x2d1412){if(_0x2d1412){return _0x2d1412[_0x9424('0xa2')](_0x43c04e[_0x9424('0x68')][_0x9424('0xa3')],_[_0x9424('0xa4')](_0x43c04e[_0x9424('0x68')],[_0x9424('0xa3'),'id'])||{});}})[_0x9424('0x54')](respondWithResult(_0x5e9526,null))[_0x9424('0x27')](handleError(_0x5e9526,null));};exports['getMessages']=function(_0x549539,_0x31df14,_0x5e9232){var _0x56043c={'raw':![],'where':{}};var _0x467fa9={};var _0x3a9cb7={'count':0x0,'rows':[]};return db[_0x9424('0x35')][_0x9424('0x79')]({'where':{'id':_0x549539[_0x9424('0x69')]['id']}})[_0x9424('0x54')](handleEntityNotFound(_0x31df14,null))[_0x9424('0x54')](function(_0x195698){if(_0x195698){_0x467fa9[_0x9424('0x37')]=_['keys'](db['ChatMessage'][_0x9424('0x36')]);_0x467fa9[_0x9424('0x39')]=_['keys'](_0x549539[_0x9424('0x39')]);_0x467fa9['filters']=_[_0x9424('0x3b')](_0x467fa9[_0x9424('0x37')],_0x467fa9[_0x9424('0x39')]);_0x56043c[_0x9424('0x3c')]=_[_0x9424('0x3b')](_0x467fa9[_0x9424('0x37')],qs[_0x9424('0x3d')](_0x549539['query'][_0x9424('0x3d')]));_0x56043c['attributes']=_0x56043c['attributes'][_0x9424('0x65')]?_0x56043c['attributes']:_0x467fa9['model'];if(!_0x549539[_0x9424('0x39')][_0x9424('0xa5')]('nolimit')){_0x56043c['limit']=qs[_0x9424('0x3f')](_0x549539[_0x9424('0x39')]['limit']);_0x56043c[_0x9424('0x2c')]=qs[_0x9424('0x2c')](_0x549539[_0x9424('0x39')][_0x9424('0x2c')]);}_0x56043c[_0x9424('0x40')]=qs[_0x9424('0x41')](_0x549539[_0x9424('0x39')][_0x9424('0x41')]);_0x56043c['where']=qs[_0x9424('0x3a')](_[_0x9424('0x43')](_0x549539['query'],_0x467fa9[_0x9424('0x3a')]));_0x56043c[_0x9424('0x42')][_0x9424('0xa6')]=_0x195698['id'];if(_0x549539['query']['filter']){_0x56043c['where']=_[_0x9424('0xa7')](_0x56043c[_0x9424('0x42')],{'$or':_[_0x9424('0x44')](_0x56043c['attributes'],function(_0x36c2f0){var _0x1237a9={};_0x1237a9[_0x36c2f0]={'$like':'%'+_0x549539[_0x9424('0x39')][_0x9424('0x49')]+'%'};return _0x1237a9;})});}if(_0x549539[_0x9424('0x39')][_0x9424('0xa8')]){var _0x1b1f34=_0x549539[_0x9424('0x39')][_0x9424('0xa8')][_0x9424('0xa9')](',');var _0x890c23={};_0x890c23[_0x1b1f34[0x0]]={'$gte':moment(_0x1b1f34[0x1])[_0x9424('0x82')]('YYYY-MM-DD\x20HH:mm:ss')};_0x56043c[_0x9424('0x42')]=_['merge'](_0x56043c[_0x9424('0x42')],_0x890c23);}_0x56043c=_[_0x9424('0xa7')]({},_0x56043c,_0x549539['options']);return db[_0x9424('0x5e')][_0x9424('0x53')]({'where':_0x56043c[_0x9424('0x42')]})[_0x9424('0x54')](function(_0x35c6e2){_0x3a9cb7[_0x9424('0x53')]=_0x35c6e2;if(_0x549539[_0x9424('0x39')][_0x9424('0x55')]){_0x56043c[_0x9424('0x4b')]=[{'all':!![]}];}return db[_0x9424('0x5e')][_0x9424('0x62')](_0x56043c);})[_0x9424('0x54')](function(_0x30a75b){_0x3a9cb7[_0x9424('0x63')]=_0x30a75b;return _0x3a9cb7;});}})[_0x9424('0x54')](respondWithFilteredResult(_0x31df14,_0x56043c))['catch'](handleError(_0x31df14,null));};exports[_0x9424('0xaa')]=function(_0x289c4f,_0x46b5da,_0x2cdc05){var _0x2f7bf8={'where':{}},_0x2fff34={},_0xaf3577={'count':0x0,'rows':[]};return db[_0x9424('0x35')][_0x9424('0x79')]({'where':{'id':_0x289c4f['params']['id']}})['then'](handleEntityNotFound(_0x46b5da,null))[_0x9424('0x54')](function(_0x2366ba){if(_0x2366ba){_0x2fff34['model']=_[_0x9424('0x38')](db[_0x9424('0x5e')][_0x9424('0x36')]);_0x2fff34['query']=_[_0x9424('0x38')](_0x289c4f[_0x9424('0x39')]);_0x2fff34[_0x9424('0x3a')]=_[_0x9424('0x3b')](_0x2fff34['model'],_0x2fff34[_0x9424('0x39')]);_0x2f7bf8[_0x9424('0x3c')]=_[_0x9424('0x3b')](_0x2fff34[_0x9424('0x37')],qs[_0x9424('0x3d')](_0x289c4f[_0x9424('0x39')][_0x9424('0x3d')]));_0x2f7bf8[_0x9424('0x3c')]=_0x2f7bf8[_0x9424('0x3c')]['length']?_0x2f7bf8['attributes']:_0x2fff34[_0x9424('0x37')];if(!_0x289c4f['query'][_0x9424('0xa5')](_0x9424('0x3e'))){_0x2f7bf8['limit']=qs[_0x9424('0x3f')](_0x289c4f['query'][_0x9424('0x3f')]);_0x2f7bf8[_0x9424('0x2c')]=qs[_0x9424('0x2c')](_0x289c4f[_0x9424('0x39')][_0x9424('0x2c')]);}_0x2f7bf8[_0x9424('0x40')]=qs[_0x9424('0x41')](_0x289c4f[_0x9424('0x39')][_0x9424('0x41')]);_0x2f7bf8[_0x9424('0x42')]=qs['filters'](_[_0x9424('0x43')](_0x289c4f[_0x9424('0x39')],_0x2fff34[_0x9424('0x3a')]));_0x2f7bf8[_0x9424('0x42')][_0x9424('0xa6')]=_0x2366ba['id'];if(_0x289c4f[_0x9424('0x39')]['filter']){_0x2f7bf8[_0x9424('0x42')]=_[_0x9424('0xa7')](_0x2f7bf8[_0x9424('0x42')],{'$or':_['map'](_0x2f7bf8[_0x9424('0x3c')],function(_0x389f08){var _0x34ca4a={};_0x34ca4a[_0x389f08]={'$like':'%'+_0x289c4f[_0x9424('0x39')][_0x9424('0x49')]+'%'};return _0x34ca4a;})});}_0x2f7bf8['where'][_0x9424('0x93')]=![];if(_0x289c4f[_0x9424('0x39')]['id']){_0x2f7bf8[_0x9424('0x42')]['id']={'$gt':_0x289c4f[_0x9424('0x39')]['id']};}_0x2f7bf8=_[_0x9424('0xa7')]({},_0x2f7bf8,_0x289c4f['options']);return db['ChatMessage'][_0x9424('0x53')]({'where':_0x2f7bf8['where']})[_0x9424('0x54')](function(_0x107e5d){_0xaf3577[_0x9424('0x53')]=_0x107e5d;_0x2f7bf8['include']=[];if(_0x289c4f[_0x9424('0x39')][_0x9424('0xab')]){_0x2f7bf8[_0x9424('0x4b')][_0x9424('0x4d')]({'model':db['User'],'as':_0x9424('0x56'),'attributes':['id','fullname',_0x9424('0x90')]});}if(_0x289c4f[_0x9424('0x39')][_0x9424('0x55')]){_0x2f7bf8[_0x9424('0x4b')]=[{'all':!![]}];}return db[_0x9424('0x5e')][_0x9424('0x62')](_0x2f7bf8);})['then'](function(_0xbf21b7){_0xaf3577[_0x9424('0x63')]=_0xbf21b7;return _0xaf3577;});}})[_0x9424('0x54')](respondWithFilteredResult(_0x46b5da,_0x2f7bf8))[_0x9424('0x27')](handleError(_0x46b5da,null));};exports[_0x9424('0xac')]=function(_0x4d9b50,_0x55ed40,_0x2a1ebf){return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x4d9b50[_0x9424('0x69')]['id']}})[_0x9424('0x54')](handleEntityNotFound(_0x55ed40,null))[_0x9424('0x54')](function(_0x809b58){if(_0x809b58){return _0x809b58[_0x9424('0xad')](_0x4d9b50[_0x9424('0x68')][_0x9424('0xa3')],_[_0x9424('0xa4')](_0x4d9b50[_0x9424('0x68')],['ids','id'])||{})[_0x9424('0xae')](function(){return db[_0x9424('0x5f')][_0x9424('0x62')]({'attributes':['id',_0x9424('0x32'),_0x9424('0x60')],'where':{'id':_0x4d9b50[_0x9424('0x68')][_0x9424('0xa3')]}});})[_0x9424('0x54')](function(_0x50c876){socket['emit'](_0x9424('0xaf'),{'id':Number(_0x4d9b50[_0x9424('0x69')]['id']),'tags':_0x50c876||[]});return{'id':Number(_0x4d9b50['params']['id']),'tags':_0x50c876||[]};});}})[_0x9424('0x54')](respondWithResult(_0x55ed40,null))[_0x9424('0x27')](handleError(_0x55ed40,null));};exports[_0x9424('0xb0')]=function(_0x41f29f,_0x36aa50,_0x45436b){var _0x268cc1;return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x41f29f[_0x9424('0x69')]['id']}})[_0x9424('0x54')](handleEntityNotFound(_0x36aa50,null))['then'](function(_0x44892e){if(_0x44892e){return _0x44892e[_0x9424('0xb0')](_0x41f29f['query'][_0x9424('0xa3')]);}})[_0x9424('0x54')](respondWithStatusCode(_0x36aa50,null))['catch'](handleError(_0x36aa50,null));};exports['download']=function(_0x1c6932,_0x198b44){var _0x5a64e0=moment()['unix']()['toString']();var _0x55c1f2=path['join'](config[_0x9424('0xb1')],_0x9424('0xb2'),_0x9424('0xb3'),_0x9424('0xb4'));var _0x4a03e2=path[_0x9424('0x80')](config['root'],'server','files','attachments');var _0x36f58e=path[_0x9424('0x80')](_0x55c1f2,_0x5a64e0);var _0x102976=util['format'](_0x9424('0xb5'),_0x5a64e0);var _0x222a01=path[_0x9424('0x80')](_0x55c1f2,_0x102976);var _0x616052=![];return db[_0x9424('0x35')][_0x9424('0x66')]({'where':{'id':_0x1c6932[_0x9424('0x69')]['id']},'include':[{'model':db[_0x9424('0x5e')],'as':_0x9424('0x51'),'attributes':['id',_0x9424('0x68')],'include':[{'model':db[_0x9424('0x56')],'as':'User','attributes':['id',_0x9424('0x57')],'raw':!![]},{'model':db[_0x9424('0x58')],'as':'Contact','attributes':['id',_0x9424('0xb6')],'raw':!![]},{'model':db[_0x9424('0x78')],'as':_0x9424('0x78'),'raw':!![]}]}]})[_0x9424('0x54')](handleEntityNotFound(_0x198b44,null))[_0x9424('0x54')](function(_0x135e72){if(_0x135e72){_0x616052=!![];var _0x22d353='';var _0x36629d={'format':_0x9424('0xb7'),'border':'1cm'};fs['mkdirSync'](_0x36f58e);_0x22d353+=util[_0x9424('0x82')]('

Chat\x20Interaction:\x20#%d

',_0x135e72['id']);_0x22d353+=util[_0x9424('0x82')](_0x9424('0xb8'),moment()[_0x9424('0x82')](_0x9424('0xb9'))[_0x9424('0xba')]());_0x22d353+='
';for(var _0x2ad66e=0x1;_0x2ad66e<_0x135e72[_0x9424('0x51')]['length'];_0x2ad66e++){var _0x310c16=_0x135e72[_0x9424('0x51')][_0x2ad66e];_0x22d353+=_0x9424('0xbb');_0x22d353+=util['format'](_0x9424('0xbc'),_0x310c16[_0x9424('0x56')]?_0x310c16[_0x9424('0x56')][_0x9424('0x57')]:_0x310c16[_0x9424('0x59')]['firstName'],_0x310c16['body']);_0x22d353+='';if(_0x310c16['Attachment']){var _0x5e9cfa=_0x310c16[_0x9424('0x78')];var _0x3e2a3f=path[_0x9424('0x80')](_0x4a03e2,_0x5e9cfa[_0x9424('0x7d')]);if(fs['existsSync'](_0x3e2a3f)){fs[_0x9424('0xbd')](_0x3e2a3f)['pipe'](fs[_0x9424('0xbe')](path[_0x9424('0x80')](_0x36f58e,_0x5e9cfa['basename'])));}}}return new BPromise(function(_0x1e410b,_0x23f6b8){pdf[_0x9424('0x67')](_0x22d353,_0x36629d)[_0x9424('0xbf')](path[_0x9424('0x80')](_0x36f58e,_0x9424('0xc0')+_0x5a64e0+_0x9424('0xc1')),function(_0x2ebc63,_0x59321b){if(_0x2ebc63)return _0x23f6b8(_0x2ebc63);_0x1e410b(_0x59321b);});});}})['then'](function(){if(_0x616052){return new BPromise(function(_0x175f9d,_0x2018a2){zipdir(_0x36f58e,{'saveTo':_0x222a01},function(_0x218171,_0x3657e8){if(_0x218171)return _0x2018a2(_0x218171);return _0x175f9d(_0x3657e8);});});}})[_0x9424('0x54')](function(){if(_0x616052){return new BPromise(function(_0x423636,_0x2d5ae4){rimraf(_0x36f58e,function(_0x3c2541){if(_0x3c2541)_0x2d5ae4(_0x3c2541);return _0x423636();});});}})[_0x9424('0x54')](function(){if(_0x616052){return _0x198b44[_0x9424('0x7b')](_0x222a01,_0x102976,function(_0x2e0825){if(_0x2e0825){console[_0x9424('0xc2')]('err',_0x2e0825);}else{fs[_0x9424('0xc3')](_0x222a01);}});}else{return _0x198b44[_0x9424('0x28')](0xc8);}})[_0x9424('0x27')](handleError(_0x198b44,null));}; \ No newline at end of file +var _0x6b79=['internal','Account','Tags','color','ThroughTags','rows','show','params','options','find','create','body','destroy','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Sequelize','Interaction\x20already\x20assigned','update','closed','attachmentUpload','basename','file','type','mimetype','attachmentDownload','findOne','Unauthorized','attachId','download','join','server/files/attachments/','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatWebsite','ChatWebsiteId','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','ChatInteractionId','$gte','split','getMyMessages','secret','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','interaction-%s.zip','firstName','Attachment','mkdirSync','

Chat\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','%s:\x20%s

','','existsSync','createReadStream','createWriteStream','toFile','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','include','tag','push','Tag','distinct','read','ChatMessage','Messages','direction','createdAt','ChatInteraction','includeAll','User','Users','CmContact','Contact','fullname'];(function(_0x3e7c8f,_0x2c49d0){var _0x5bd937=function(_0x30545b){while(--_0x30545b){_0x3e7c8f['push'](_0x3e7c8f['shift']());}};_0x5bd937(++_0x2c49d0);}(_0x6b79,0x6b));var _0x96b7=function(_0x19cc1e,_0x3effc4){_0x19cc1e=_0x19cc1e-0x0;var _0x266110=_0x6b79[_0x19cc1e];return _0x266110;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96b7('0x0'));var rimraf=require(_0x96b7('0x1'));var zipdir=require(_0x96b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96b7('0x4'));var path=require('path');var sox=require(_0x96b7('0x5'));var csv=require(_0x96b7('0x6'));var ejs=require(_0x96b7('0x7'));var fs=require('fs');var _=require(_0x96b7('0x8'));var squel=require(_0x96b7('0x9'));var crypto=require(_0x96b7('0xa'));var jsforce=require(_0x96b7('0xb'));var deskjs=require(_0x96b7('0xc'));var toCsv=require(_0x96b7('0x6'));var querystring=require(_0x96b7('0xd'));var Papa=require(_0x96b7('0xe'));var authService=require(_0x96b7('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x96b7('0x10'));var qs=require(_0x96b7('0x11'));var logger=require(_0x96b7('0x12'))(_0x96b7('0x13'));var utils=require(_0x96b7('0x14'));var config=require(_0x96b7('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x96b7('0x16')](config[_0x96b7('0x17')],{'host':_0x96b7('0x18'),'port':0x18eb});var socket=require(_0x96b7('0x19'))(new Redis(config[_0x96b7('0x17')]));require(_0x96b7('0x1a'))[_0x96b7('0x1b')](socket);var jayson=require(_0x96b7('0x1c'));var client=jayson[_0x96b7('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0x96b7('0x1d')][_0x96b7('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x45ebbe,_0x73ec7c,_0x120c6b,_0x2bf5be){return new BPromise(function(_0x383f8d,_0x140b4a){var _0x215add=_0x2bf5be||client;return _0x215add[_0x96b7('0x1f')](_0x45ebbe,_0x120c6b)['then'](function(_0x5e8735){logger[_0x96b7('0x20')](_0x96b7('0x21'),_0x73ec7c,_0x96b7('0x22'));logger[_0x96b7('0x23')](_0x96b7('0x24'),_0x73ec7c,_0x96b7('0x22'),JSON[_0x96b7('0x25')](_0x5e8735));if(_0x5e8735[_0x96b7('0x26')]){if(_0x5e8735[_0x96b7('0x26')][_0x96b7('0x27')]===0x1f4){logger[_0x96b7('0x26')](_0x96b7('0x21'),_0x73ec7c,_0x5e8735[_0x96b7('0x26')][_0x96b7('0x28')]);return _0x140b4a(_0x5e8735['error'][_0x96b7('0x28')]);}logger[_0x96b7('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x73ec7c,_0x5e8735['error'][_0x96b7('0x28')]);return _0x383f8d(_0x5e8735[_0x96b7('0x26')][_0x96b7('0x28')]);}else{logger[_0x96b7('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x73ec7c,_0x96b7('0x22'));_0x383f8d(_0x5e8735['result'][_0x96b7('0x28')]);}})[_0x96b7('0x29')](function(_0x45371b){logger[_0x96b7('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x73ec7c,_0x45371b);_0x140b4a(_0x45371b);});});}function respondWithStatusCode(_0x4d4c4d,_0x29b7e2){_0x29b7e2=_0x29b7e2||0xcc;return function(_0xfe64bf){if(_0xfe64bf){return _0x4d4c4d[_0x96b7('0x2a')](_0x29b7e2);}return _0x4d4c4d[_0x96b7('0x2b')](_0x29b7e2)[_0x96b7('0x2c')]();};}function respondWithResult(_0x73d937,_0x1ec8f0){_0x1ec8f0=_0x1ec8f0||0xc8;return function(_0x498e1f){if(_0x498e1f){return _0x73d937[_0x96b7('0x2b')](_0x1ec8f0)[_0x96b7('0x2d')](_0x498e1f);}};}function respondWithFilteredResult(_0x51fef2,_0x3eecea){return function(_0x237c04){if(_0x237c04){var _0x4a073f=_0x237c04[_0x96b7('0x2e')],_0x1677c6=_0x3eecea['offset'],_0x816ea7=_0x3eecea[_0x96b7('0x2f')]+_0x3eecea[_0x96b7('0x30')],_0x42edde;if(_0x816ea7>=_0x4a073f){_0x816ea7=_0x4a073f;_0x42edde=0xc8;}else{_0x42edde=0xce;}_0x51fef2[_0x96b7('0x2b')](_0x42edde);return _0x51fef2['set'](_0x96b7('0x31'),_0x1677c6+'-'+_0x816ea7+'/'+_0x4a073f)[_0x96b7('0x2d')](_0x237c04);}return null;};}function patchUpdates(_0x4234b2){return function(_0x507d4e){try{jsonpatch['apply'](_0x507d4e,_0x4234b2,!![]);}catch(_0x3901fd){return BPromise[_0x96b7('0x32')](_0x3901fd);}return _0x507d4e[_0x96b7('0x33')]();};}function saveUpdates(_0x2ed082,_0x30a41b){return function(_0x428375){if(_0x428375){return _0x428375['update'](_0x2ed082)[_0x96b7('0x34')](function(_0x1a93c6){return _0x1a93c6;});}return null;};}function removeEntity(_0x30aba2,_0x320e9b){return function(_0x49a924){if(_0x49a924){return _0x49a924['destroy']()[_0x96b7('0x34')](function(){_0x30aba2[_0x96b7('0x2b')](0xcc)[_0x96b7('0x2c')]();});}};}function handleEntityNotFound(_0x4127ac,_0x588e0a){return function(_0x166ef5){if(!_0x166ef5){_0x4127ac[_0x96b7('0x2a')](0x194);}return _0x166ef5;};}function handleError(_0x22b86a,_0x3679f9){_0x3679f9=_0x3679f9||0x1f4;return function(_0x30d8d8){logger[_0x96b7('0x26')](_0x30d8d8[_0x96b7('0x35')]);if(_0x30d8d8[_0x96b7('0x36')]){delete _0x30d8d8[_0x96b7('0x36')];}_0x22b86a[_0x96b7('0x2b')](_0x3679f9)[_0x96b7('0x37')](_0x30d8d8);};}exports[_0x96b7('0x38')]=function(_0x556317,_0x58194b){var _0x33550b={},_0xaba824={},_0x30adbf={'count':0x0,'rows':[]};var _0x17e021=db['ChatInteraction'][_0x96b7('0x39')];_0xaba824[_0x96b7('0x3a')]=_['keys'](_0x17e021);_0xaba824[_0x96b7('0x3b')]=_[_0x96b7('0x3c')](_0x556317[_0x96b7('0x3b')]);_0xaba824[_0x96b7('0x3d')]=_[_0x96b7('0x3e')](_0xaba824[_0x96b7('0x3a')],_0xaba824[_0x96b7('0x3b')]);_0x33550b[_0x96b7('0x3f')]=_[_0x96b7('0x3e')](_0xaba824[_0x96b7('0x3a')],qs[_0x96b7('0x40')](_0x556317['query']['fields']));_0x33550b['attributes']=_0x33550b[_0x96b7('0x3f')][_0x96b7('0x41')]?_0x33550b[_0x96b7('0x3f')]:_0xaba824[_0x96b7('0x3a')];if(!_0x556317[_0x96b7('0x3b')][_0x96b7('0x42')](_0x96b7('0x43'))){_0x33550b[_0x96b7('0x30')]=qs[_0x96b7('0x30')](_0x556317[_0x96b7('0x3b')]['limit']);_0x33550b[_0x96b7('0x2f')]=qs[_0x96b7('0x2f')](_0x556317['query']['offset']);}_0x33550b[_0x96b7('0x44')]=qs[_0x96b7('0x45')](_0x556317[_0x96b7('0x3b')]['sort']);_0x33550b[_0x96b7('0x46')]=qs[_0x96b7('0x3d')](_[_0x96b7('0x47')](_0x556317[_0x96b7('0x3b')],_0xaba824['filters']));if(_0x556317['query'][_0x96b7('0x48')]){_0x33550b[_0x96b7('0x46')]=_[_0x96b7('0x49')](_0x33550b[_0x96b7('0x46')],{'$or':_[_0x96b7('0x4a')](_0x17e021,function(_0x480390){if(_0x480390['type'][_0x96b7('0x4b')]!==_0x96b7('0x4c')){var _0x377b08={};_0x377b08[_0x480390[_0x96b7('0x4d')]]={'$like':'%'+_0x556317[_0x96b7('0x3b')][_0x96b7('0x48')]+'%'};return _0x377b08;}})});}_0x33550b=_[_0x96b7('0x49')]({},_0x33550b,_0x556317['options']);var _0x1316f8={'where':_0x33550b[_0x96b7('0x46')]};_0x1316f8[_0x96b7('0x4e')]=[];if(_0x556317[_0x96b7('0x3b')][_0x96b7('0x4f')]){_0x1316f8['include'][_0x96b7('0x50')]({'model':db[_0x96b7('0x51')],'as':'Tags','attributes':['id'],'where':{'id':_0x556317[_0x96b7('0x3b')][_0x96b7('0x4f')]},'required':!![]});_0x1316f8[_0x96b7('0x52')]=!![];}if(_0x556317['query'][_0x96b7('0x53')]){_0x1316f8[_0x96b7('0x4e')][_0x96b7('0x50')]({'model':db[_0x96b7('0x54')],'as':_0x96b7('0x55'),'attributes':['id',_0x96b7('0x56'),_0x96b7('0x57'),'read'],'where':{'direction':'in','read':_0x556317[_0x96b7('0x3b')][_0x96b7('0x53')]||![]},'required':!![]});_0x1316f8[_0x96b7('0x52')]=!![];}return db[_0x96b7('0x58')][_0x96b7('0x2e')](_0x1316f8)[_0x96b7('0x34')](function(_0x24ba2e){_0x30adbf[_0x96b7('0x2e')]=_0x24ba2e;if(_0x556317['query'][_0x96b7('0x59')]){_0x33550b[_0x96b7('0x4e')]=[{'model':db[_0x96b7('0x5a')],'as':_0x96b7('0x5b'),'required':![],'attributes':['id',_0x96b7('0x36'),'fullname']},{'model':db[_0x96b7('0x5c')],'as':_0x96b7('0x5d'),'required':![]},{'model':db[_0x96b7('0x5a')],'as':'Owner','attributes':[_0x96b7('0x36'),_0x96b7('0x5e'),_0x96b7('0x5f')],'required':![]},{'model':db['ChatWebsite'],'as':_0x96b7('0x60'),'attributes':['name',_0x96b7('0x4b')],'required':![]},{'model':db[_0x96b7('0x54')],'as':'Messages','attributes':['id','direction',_0x96b7('0x57'),'read'],'where':{'direction':'in','read':_0x556317['query'][_0x96b7('0x53')]||![]},'required':_0x556317[_0x96b7('0x3b')][_0x96b7('0x53')]||![]},{'model':db[_0x96b7('0x51')],'as':_0x96b7('0x61'),'attributes':['id',_0x96b7('0x36'),_0x96b7('0x62')],'required':_0x556317[_0x96b7('0x3b')]['tag']?!![]:![]},{'model':db[_0x96b7('0x51')],'as':_0x96b7('0x63'),'attributes':['id',_0x96b7('0x36'),_0x96b7('0x62')],'through':_0x556317[_0x96b7('0x3b')][_0x96b7('0x4f')]?{'attributes':[],'where':{'TagId':_0x556317[_0x96b7('0x3b')][_0x96b7('0x4f')]||undefined}}:{},'required':_0x556317[_0x96b7('0x3b')][_0x96b7('0x4f')]?!![]:![]}];}return db[_0x96b7('0x58')]['findAll'](_0x33550b);})[_0x96b7('0x34')](function(_0x1d4881){_0x30adbf[_0x96b7('0x64')]=_0x1d4881;return _0x30adbf;})[_0x96b7('0x34')](respondWithFilteredResult(_0x58194b,_0x33550b))[_0x96b7('0x29')](handleError(_0x58194b,null));};exports[_0x96b7('0x65')]=function(_0x3e9273,_0x5e8ceb){var _0x3c8001={'raw':![],'where':{'id':_0x3e9273[_0x96b7('0x66')]['id']}},_0x1cb3bd={};_0x1cb3bd[_0x96b7('0x3a')]=_['keys'](db[_0x96b7('0x58')]['rawAttributes']);_0x1cb3bd[_0x96b7('0x3b')]=_[_0x96b7('0x3c')](_0x3e9273[_0x96b7('0x3b')]);_0x1cb3bd[_0x96b7('0x3d')]=_['intersection'](_0x1cb3bd['model'],_0x1cb3bd['query']);_0x3c8001[_0x96b7('0x3f')]=_['intersection'](_0x1cb3bd[_0x96b7('0x3a')],qs['fields'](_0x3e9273[_0x96b7('0x3b')][_0x96b7('0x40')]));_0x3c8001[_0x96b7('0x3f')]=_0x3c8001[_0x96b7('0x3f')][_0x96b7('0x41')]?_0x3c8001['attributes']:_0x1cb3bd['model'];if(_0x3e9273[_0x96b7('0x3b')][_0x96b7('0x59')]){_0x3c8001[_0x96b7('0x4e')]=[{'all':!![]}];}_0x3c8001=_[_0x96b7('0x49')]({},_0x3c8001,_0x3e9273[_0x96b7('0x67')]);return db[_0x96b7('0x58')][_0x96b7('0x68')](_0x3c8001)[_0x96b7('0x34')](handleEntityNotFound(_0x5e8ceb,null))[_0x96b7('0x34')](respondWithResult(_0x5e8ceb,null))[_0x96b7('0x29')](handleError(_0x5e8ceb,null));};exports[_0x96b7('0x69')]=function(_0x635d70,_0x3fd740){return db[_0x96b7('0x58')]['create'](_0x635d70[_0x96b7('0x6a')],{})['then'](respondWithResult(_0x3fd740,0xc9))['catch'](handleError(_0x3fd740,null));};exports['update']=function(_0x901b28,_0x38d0ae){if(_0x901b28[_0x96b7('0x6a')]['id']){delete _0x901b28[_0x96b7('0x6a')]['id'];}return db['ChatInteraction'][_0x96b7('0x68')]({'where':{'id':_0x901b28[_0x96b7('0x66')]['id']}})['then'](handleEntityNotFound(_0x38d0ae,null))[_0x96b7('0x34')](saveUpdates(_0x901b28[_0x96b7('0x6a')],null))[_0x96b7('0x34')](respondWithResult(_0x38d0ae,null))[_0x96b7('0x29')](handleError(_0x38d0ae,null));};exports[_0x96b7('0x6b')]=function(_0x5d1813,_0x4fb524){return db[_0x96b7('0x58')]['find']({'where':{'id':_0x5d1813[_0x96b7('0x66')]['id']}})[_0x96b7('0x34')](handleEntityNotFound(_0x4fb524,null))[_0x96b7('0x34')](removeEntity(_0x4fb524,null))[_0x96b7('0x29')](handleError(_0x4fb524,null));};exports[_0x96b7('0x6c')]=function(_0x56a7ad,_0x108b05){return db['ChatInteraction']['describe']()[_0x96b7('0x34')](respondWithResult(_0x108b05,null))['catch'](handleError(_0x108b05,null));};exports[_0x96b7('0x6d')]=function(_0x49b81e,_0x1b44de){if(_0x49b81e[_0x96b7('0x6a')]['id']){delete _0x49b81e['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x49b81e[_0x96b7('0x66')]['id']}})['then'](handleEntityNotFound(_0x1b44de,null))[_0x96b7('0x34')](saveUpdates(_0x49b81e[_0x96b7('0x6a')],null))[_0x96b7('0x34')](respondWithResult(_0x1b44de,null))[_0x96b7('0x29')](handleError(_0x1b44de,null));};exports[_0x96b7('0x6e')]=function(_0x232db0,_0x5eea85,_0xcc21a1){if(_0x232db0['body']['id']){delete _0x232db0['body']['id'];}return db['ChatInteraction'][_0x96b7('0x68')]({'where':{'id':_0x232db0[_0x96b7('0x66')]['id']}})[_0x96b7('0x34')](function(_0x5b4371){if(!_0x5b4371){logger['error'](_0x96b7('0x6f'),_0x96b7('0x6e'),0x194,'entity\x20not\x20found');_0x5eea85['sendStatus'](0x194);}else{if(_0x5b4371[_0x96b7('0x70')]){throw new db[(_0x96b7('0x71'))]['ValidationError'](_0x96b7('0x72'));}}return _0x5b4371;})[_0x96b7('0x34')](function(_0xf08eef){if(_0xf08eef){return _0xf08eef[_0x96b7('0x73')]({'closed':_0x232db0[_0x96b7('0x6a')][_0x96b7('0x74')],'disposition':_0x232db0[_0x96b7('0x6a')]['disposition']})[_0x96b7('0x34')](function(_0x4057a7){return _0x4057a7;});}})[_0x96b7('0x34')](function(_0x1df345){return respondWithRpcPromise('AbandonInteraction',_0x96b7('0x6e'),_0x232db0['body'],client9004);})[_0x96b7('0x34')](respondWithResult(_0x5eea85,null))[_0x96b7('0x29')](handleError(_0x5eea85,null));};exports[_0x96b7('0x75')]=function(_0x4884ad,_0xa26462,_0x4133aa){_0x4884ad[_0x96b7('0x6a')]['name']=_0x4884ad['file']['originalname'];_0x4884ad[_0x96b7('0x6a')][_0x96b7('0x76')]=_0x4884ad[_0x96b7('0x77')]['filename'];_0x4884ad[_0x96b7('0x6a')][_0x96b7('0x78')]=_0x4884ad[_0x96b7('0x77')][_0x96b7('0x79')];return db['Attachment'][_0x96b7('0x69')](_0x4884ad[_0x96b7('0x6a')])[_0x96b7('0x34')](respondWithResult(_0xa26462,0xc9))['catch'](handleError(_0xa26462,null));};exports[_0x96b7('0x7a')]=function(_0x291dce,_0x38dfcc,_0x27197d){return db[_0x96b7('0x58')][_0x96b7('0x7b')]({'where':{'id':_0x291dce[_0x96b7('0x66')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x38dfcc,null))[_0x96b7('0x34')](function(_0x307e37){if(_0x307e37){if(_0x307e37['closed']){return _0x38dfcc[_0x96b7('0x2b')](0x193)[_0x96b7('0x2d')]({'status':0x193,'message':_0x96b7('0x7c')});}return db['Attachment']['findOne']({'where':{'id':_0x291dce[_0x96b7('0x3b')][_0x96b7('0x7d')]},'raw':!![]})[_0x96b7('0x34')](handleEntityNotFound(_0x38dfcc,null));}})['then'](function(_0xd0752c){if(_0xd0752c){return _0x38dfcc[_0x96b7('0x7e')](path[_0x96b7('0x7f')](config['root'],_0x96b7('0x80'),_0xd0752c[_0x96b7('0x76')]));}})[_0x96b7('0x29')](handleError(_0x38dfcc,null));};exports['close']=function(_0x4d8efb,_0x3e7730){var _0x25d87b=null;var _0x2edc02=null;var _0x5581c7=null;var _0x229013=null;if(_0x4d8efb[_0x96b7('0x6a')]['id']){delete _0x4d8efb[_0x96b7('0x6a')]['id'];}if(_0x4d8efb[_0x96b7('0x6a')][_0x96b7('0x81')]){_0x229013=path['join'](config[_0x96b7('0x82')],_0x96b7('0x83'),util[_0x96b7('0x84')](_0x96b7('0x85'),Date[_0x96b7('0x86')]()));_0x4d8efb[_0x96b7('0x6a')][_0x96b7('0x87')]=_0x229013;}return db['ChatInteraction'][_0x96b7('0x68')]({'where':{'id':_0x4d8efb['params']['id']},'include':[{'model':db[_0x96b7('0x54')],'as':'Messages','include':[{'model':db[_0x96b7('0x5a')],'as':'User'}]}]})[_0x96b7('0x34')](handleEntityNotFound(_0x3e7730,null))[_0x96b7('0x34')](saveUpdates(_0x4d8efb[_0x96b7('0x6a')],null))['then'](function(_0x1ceb93){if(_0x1ceb93){_0x25d87b=_0x1ceb93;return db[_0x96b7('0x88')]['find']({'where':{'id':_0x25d87b[_0x96b7('0x89')]}});}})[_0x96b7('0x34')](function(_0x115ea8){if(_0x115ea8){_0x5581c7=_0x115ea8;return db[_0x96b7('0x5c')][_0x96b7('0x68')]({'where':{'id':_0x25d87b[_0x96b7('0x8a')]}});}})[_0x96b7('0x34')](function(_0x1196e8){if(_0x1196e8){_0x2edc02=_0x1196e8;if(_0x229013){var _0x26cc2e=null;for(var _0x163455=0x1;_0x163455<_0x25d87b[_0x96b7('0x55')][_0x96b7('0x41')];++_0x163455){_0x26cc2e=_0x25d87b[_0x96b7('0x55')][_0x163455];var _0x39fda1=_0x26cc2e[_0x96b7('0x70')]?util['format'](_0x96b7('0x8b'),_0x5581c7[_0x96b7('0x8c')],_0x26cc2e['UserId']):_0x96b7('0x8d');var _0x2a1d54=_0x4d8efb['body'][_0x96b7('0x8e')]||util[_0x96b7('0x84')]('%s%d',_0x96b7('0x8f'),_0x26cc2e[_0x96b7('0x8a')]);switch(_0x5581c7['agentIdentifier']){case _0x96b7('0x90'):_0x39fda1=_0x26cc2e[_0x96b7('0x70')]?util[_0x96b7('0x84')](_0x96b7('0x8b'),_0x5581c7[_0x96b7('0x8c')],_0x26cc2e['UserId']):_0x96b7('0x8d');break;case _0x96b7('0x91'):_0x39fda1=_0x26cc2e['UserId']?_0x26cc2e[_0x96b7('0x5a')][_0x96b7('0x92')]||_0x26cc2e[_0x96b7('0x5a')][_0x96b7('0x5e')]:'System';break;case'agent_fullname':_0x39fda1=_0x26cc2e[_0x96b7('0x70')]?_0x26cc2e[_0x96b7('0x5a')][_0x96b7('0x5e')]:_0x96b7('0x8d');break;default:_0x39fda1=_0x26cc2e[_0x96b7('0x70')]?util['format']('%s%d',_0x5581c7['agentAlias'],_0x26cc2e[_0x96b7('0x70')]):_0x96b7('0x8d');}var _0x167945=util[_0x96b7('0x84')](_0x96b7('0x93'),moment(_0x26cc2e[_0x96b7('0x57')])['format'](_0x96b7('0x94')),_0x26cc2e[_0x96b7('0x56')]==='in'?_0x2a1d54:_0x39fda1,_0x26cc2e[_0x96b7('0x6a')]);if(!_0x26cc2e['secret']){fs['appendFileSync'](_0x229013,_0x167945);}}return db[_0x96b7('0x95')][_0x96b7('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x96b7('0x96')],'as':_0x96b7('0x97'),'raw':!![]}]});}}})[_0x96b7('0x34')](function(_0x17445b){if(_0x17445b&&_0x17445b[_0x96b7('0x97')]&&_0x4d8efb[_0x96b7('0x6a')]){var _0x27227a={'tls':{'rejectUnauthorized':![]}};if(_0x17445b[_0x96b7('0x97')][_0x96b7('0x98')]){_0x27227a['service']=_0x17445b[_0x96b7('0x97')][_0x96b7('0x98')];}else{_0x27227a[_0x96b7('0x99')]=_0x17445b['Smtp']['host'];_0x27227a[_0x96b7('0x9a')]=_0x17445b['Smtp'][_0x96b7('0x9a')];_0x27227a[_0x96b7('0x9b')]=_0x17445b[_0x96b7('0x97')][_0x96b7('0x9b')];}if(_0x17445b['Smtp'][_0x96b7('0x9c')]){_0x27227a[_0x96b7('0x9d')]={'user':_0x17445b['Smtp'][_0x96b7('0x9e')],'pass':_0x17445b[_0x96b7('0x97')][_0x96b7('0x9f')]};}return respondWithRpcPromise(_0x96b7('0xa0'),_0x96b7('0xa1'),{'account':_0x27227a,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x17445b[_0x96b7('0x36')],_0x17445b['email']||_0x17445b[_0x96b7('0x97')][_0x96b7('0x9e')]),'to':_0x4d8efb[_0x96b7('0x6a')][_0x96b7('0x81')],'subject':_0x96b7('0xa2'),'text':util[_0x96b7('0x84')](_0x96b7('0xa3'),_0x4d8efb[_0x96b7('0x6a')][_0x96b7('0x81')]),'attachments':[{'path':_0x229013}]}})['then'](function(){return _0x25d87b;})[_0x96b7('0x29')](function(_0x3c11a0){console['error'](_0x3c11a0);});}else{return _0x25d87b;}})[_0x96b7('0x34')](respondWithStatusCode(_0x3e7730,0xc8))[_0x96b7('0x29')](handleError(_0x3e7730,null));};exports['addMessage']=function(_0x43e247,_0x4a65ac,_0x335da1){return db[_0x96b7('0x54')][_0x96b7('0x68')]({'where':{'id':_0x43e247[_0x96b7('0x66')]['id']}})['then'](handleEntityNotFound(_0x4a65ac,null))['then'](function(_0x406e70){if(_0x406e70){return _0x406e70['addMessage'](_0x43e247[_0x96b7('0x6a')][_0x96b7('0xa4')],_[_0x96b7('0xa5')](_0x43e247[_0x96b7('0x6a')],[_0x96b7('0xa4'),'id'])||{});}})[_0x96b7('0x34')](respondWithResult(_0x4a65ac,null))[_0x96b7('0x29')](handleError(_0x4a65ac,null));};exports['getMessages']=function(_0x5c6066,_0x5064b0,_0x416aa3){var _0xcedb8a={'raw':![],'where':{}};var _0xd7165e={};var _0x208f0a={'count':0x0,'rows':[]};return db[_0x96b7('0x58')][_0x96b7('0x7b')]({'where':{'id':_0x5c6066['params']['id']}})[_0x96b7('0x34')](handleEntityNotFound(_0x5064b0,null))[_0x96b7('0x34')](function(_0x5461e1){if(_0x5461e1){_0xd7165e['model']=_[_0x96b7('0x3c')](db['ChatMessage'][_0x96b7('0x39')]);_0xd7165e[_0x96b7('0x3b')]=_[_0x96b7('0x3c')](_0x5c6066[_0x96b7('0x3b')]);_0xd7165e['filters']=_[_0x96b7('0x3e')](_0xd7165e[_0x96b7('0x3a')],_0xd7165e['query']);_0xcedb8a[_0x96b7('0x3f')]=_[_0x96b7('0x3e')](_0xd7165e['model'],qs[_0x96b7('0x40')](_0x5c6066['query'][_0x96b7('0x40')]));_0xcedb8a[_0x96b7('0x3f')]=_0xcedb8a[_0x96b7('0x3f')][_0x96b7('0x41')]?_0xcedb8a[_0x96b7('0x3f')]:_0xd7165e[_0x96b7('0x3a')];if(!_0x5c6066[_0x96b7('0x3b')]['hasOwnProperty'](_0x96b7('0x43'))){_0xcedb8a[_0x96b7('0x30')]=qs[_0x96b7('0x30')](_0x5c6066['query'][_0x96b7('0x30')]);_0xcedb8a[_0x96b7('0x2f')]=qs[_0x96b7('0x2f')](_0x5c6066['query'][_0x96b7('0x2f')]);}_0xcedb8a[_0x96b7('0x44')]=qs[_0x96b7('0x45')](_0x5c6066[_0x96b7('0x3b')][_0x96b7('0x45')]);_0xcedb8a[_0x96b7('0x46')]=qs['filters'](_[_0x96b7('0x47')](_0x5c6066[_0x96b7('0x3b')],_0xd7165e[_0x96b7('0x3d')]));_0xcedb8a[_0x96b7('0x46')][_0x96b7('0xa6')]=_0x5461e1['id'];if(_0x5c6066[_0x96b7('0x3b')][_0x96b7('0x48')]){_0xcedb8a[_0x96b7('0x46')]=_[_0x96b7('0x49')](_0xcedb8a[_0x96b7('0x46')],{'$or':_[_0x96b7('0x4a')](_0xcedb8a['attributes'],function(_0x9d598c){var _0x358aed={};_0x358aed[_0x9d598c]={'$like':'%'+_0x5c6066[_0x96b7('0x3b')]['filter']+'%'};return _0x358aed;})});}if(_0x5c6066[_0x96b7('0x3b')][_0x96b7('0xa7')]){var _0x49bce0=_0x5c6066[_0x96b7('0x3b')][_0x96b7('0xa7')][_0x96b7('0xa8')](',');var _0x248c06={};_0x248c06[_0x49bce0[0x0]]={'$gte':moment(_0x49bce0[0x1])[_0x96b7('0x84')]('YYYY-MM-DD\x20HH:mm:ss')};_0xcedb8a[_0x96b7('0x46')]=_[_0x96b7('0x49')](_0xcedb8a['where'],_0x248c06);}_0xcedb8a=_[_0x96b7('0x49')]({},_0xcedb8a,_0x5c6066[_0x96b7('0x67')]);return db[_0x96b7('0x54')]['count']({'where':_0xcedb8a[_0x96b7('0x46')]})[_0x96b7('0x34')](function(_0x12c790){_0x208f0a['count']=_0x12c790;if(_0x5c6066[_0x96b7('0x3b')][_0x96b7('0x59')]){_0xcedb8a[_0x96b7('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xcedb8a);})['then'](function(_0x3943a4){_0x208f0a['rows']=_0x3943a4;return _0x208f0a;});}})[_0x96b7('0x34')](respondWithFilteredResult(_0x5064b0,_0xcedb8a))[_0x96b7('0x29')](handleError(_0x5064b0,null));};exports[_0x96b7('0xa9')]=function(_0x1bde52,_0x46f548,_0x2dbff9){var _0x5117ef={'where':{}},_0x2357a7={},_0x6cdb0d={'count':0x0,'rows':[]};return db[_0x96b7('0x58')]['findOne']({'where':{'id':_0x1bde52[_0x96b7('0x66')]['id']}})['then'](handleEntityNotFound(_0x46f548,null))[_0x96b7('0x34')](function(_0x2e8e1f){if(_0x2e8e1f){_0x2357a7['model']=_[_0x96b7('0x3c')](db[_0x96b7('0x54')][_0x96b7('0x39')]);_0x2357a7[_0x96b7('0x3b')]=_['keys'](_0x1bde52[_0x96b7('0x3b')]);_0x2357a7['filters']=_[_0x96b7('0x3e')](_0x2357a7[_0x96b7('0x3a')],_0x2357a7[_0x96b7('0x3b')]);_0x5117ef[_0x96b7('0x3f')]=_[_0x96b7('0x3e')](_0x2357a7[_0x96b7('0x3a')],qs[_0x96b7('0x40')](_0x1bde52[_0x96b7('0x3b')][_0x96b7('0x40')]));_0x5117ef[_0x96b7('0x3f')]=_0x5117ef[_0x96b7('0x3f')][_0x96b7('0x41')]?_0x5117ef[_0x96b7('0x3f')]:_0x2357a7['model'];if(!_0x1bde52['query'][_0x96b7('0x42')](_0x96b7('0x43'))){_0x5117ef['limit']=qs[_0x96b7('0x30')](_0x1bde52['query'][_0x96b7('0x30')]);_0x5117ef['offset']=qs[_0x96b7('0x2f')](_0x1bde52[_0x96b7('0x3b')][_0x96b7('0x2f')]);}_0x5117ef['order']=qs[_0x96b7('0x45')](_0x1bde52['query'][_0x96b7('0x45')]);_0x5117ef[_0x96b7('0x46')]=qs[_0x96b7('0x3d')](_[_0x96b7('0x47')](_0x1bde52[_0x96b7('0x3b')],_0x2357a7[_0x96b7('0x3d')]));_0x5117ef[_0x96b7('0x46')][_0x96b7('0xa6')]=_0x2e8e1f['id'];if(_0x1bde52[_0x96b7('0x3b')]['filter']){_0x5117ef[_0x96b7('0x46')]=_[_0x96b7('0x49')](_0x5117ef['where'],{'$or':_[_0x96b7('0x4a')](_0x5117ef['attributes'],function(_0x4bce04){var _0x490f88={};_0x490f88[_0x4bce04]={'$like':'%'+_0x1bde52[_0x96b7('0x3b')][_0x96b7('0x48')]+'%'};return _0x490f88;})});}_0x5117ef[_0x96b7('0x46')][_0x96b7('0xaa')]=![];if(_0x1bde52[_0x96b7('0x3b')]['id']){_0x5117ef['where']['id']={'$gt':_0x1bde52['query']['id']};}_0x5117ef=_[_0x96b7('0x49')]({},_0x5117ef,_0x1bde52[_0x96b7('0x67')]);return db[_0x96b7('0x54')][_0x96b7('0x2e')]({'where':_0x5117ef[_0x96b7('0x46')]})['then'](function(_0x5922e0){_0x6cdb0d['count']=_0x5922e0;_0x5117ef[_0x96b7('0x4e')]=[];if(_0x1bde52[_0x96b7('0x3b')][_0x96b7('0xab')]){_0x5117ef[_0x96b7('0x4e')]['push']({'model':db['User'],'as':_0x96b7('0x5a'),'attributes':['id',_0x96b7('0x5e'),_0x96b7('0x92')]});}if(_0x1bde52[_0x96b7('0x3b')][_0x96b7('0x59')]){_0x5117ef[_0x96b7('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5117ef);})[_0x96b7('0x34')](function(_0x1e9b81){_0x6cdb0d[_0x96b7('0x64')]=_0x1e9b81;return _0x6cdb0d;});}})[_0x96b7('0x34')](respondWithFilteredResult(_0x46f548,_0x5117ef))[_0x96b7('0x29')](handleError(_0x46f548,null));};exports['addTags']=function(_0xf3145a,_0x2d0112,_0x3541b9){return db[_0x96b7('0x58')][_0x96b7('0x68')]({'where':{'id':_0xf3145a[_0x96b7('0x66')]['id']}})['then'](handleEntityNotFound(_0x2d0112,null))[_0x96b7('0x34')](function(_0xc80a13){if(_0xc80a13){return _0xc80a13[_0x96b7('0xac')](_0xf3145a[_0x96b7('0x6a')][_0x96b7('0xa4')],_[_0x96b7('0xa5')](_0xf3145a[_0x96b7('0x6a')],[_0x96b7('0xa4'),'id'])||{})[_0x96b7('0xad')](function(){return db[_0x96b7('0x51')]['findAll']({'attributes':['id',_0x96b7('0x36'),_0x96b7('0x62')],'where':{'id':_0xf3145a[_0x96b7('0x6a')]['ids']}});})['then'](function(_0x38d1e8){socket[_0x96b7('0xae')](_0x96b7('0xaf'),{'id':Number(_0xf3145a['params']['id']),'tags':_0x38d1e8||[]});return{'id':Number(_0xf3145a[_0x96b7('0x66')]['id']),'tags':_0x38d1e8||[]};});}})[_0x96b7('0x34')](respondWithResult(_0x2d0112,null))[_0x96b7('0x29')](handleError(_0x2d0112,null));};exports[_0x96b7('0xb0')]=function(_0x47713c,_0x3a1aec,_0x4411be){var _0x2727d0;return db[_0x96b7('0x58')][_0x96b7('0x68')]({'where':{'id':_0x47713c[_0x96b7('0x66')]['id']}})[_0x96b7('0x34')](handleEntityNotFound(_0x3a1aec,null))[_0x96b7('0x34')](function(_0x32b72d){if(_0x32b72d){return _0x32b72d[_0x96b7('0xb0')](_0x47713c['query'][_0x96b7('0xa4')]);}})[_0x96b7('0x34')](respondWithStatusCode(_0x3a1aec,null))[_0x96b7('0x29')](handleError(_0x3a1aec,null));};exports['download']=function(_0x263d0a,_0xee5970){var _0x1c1eb6=moment()[_0x96b7('0xb1')]()[_0x96b7('0xb2')]();var _0x1c8004=path['join'](config[_0x96b7('0x82')],_0x96b7('0xb3'),_0x96b7('0xb4'),_0x96b7('0xb5'));var _0x12044f=path['join'](config[_0x96b7('0x82')],_0x96b7('0xb3'),_0x96b7('0xb4'),_0x96b7('0xb6'));var _0x575cc9=path[_0x96b7('0x7f')](_0x1c8004,_0x1c1eb6);var _0x1f1696=util[_0x96b7('0x84')](_0x96b7('0xb7'),_0x1c1eb6);var _0x2d4b22=path[_0x96b7('0x7f')](_0x1c8004,_0x1f1696);var _0x24b814=![];return db['ChatInteraction'][_0x96b7('0x68')]({'where':{'id':_0x263d0a[_0x96b7('0x66')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x96b7('0x55'),'attributes':['id',_0x96b7('0x6a')],'include':[{'model':db['User'],'as':_0x96b7('0x5a'),'attributes':['id',_0x96b7('0x5e')],'raw':!![]},{'model':db[_0x96b7('0x5c')],'as':'Contact','attributes':['id',_0x96b7('0xb8')],'raw':!![]},{'model':db[_0x96b7('0xb9')],'as':'Attachment','raw':!![]}]}]})[_0x96b7('0x34')](handleEntityNotFound(_0xee5970,null))[_0x96b7('0x34')](function(_0x401227){if(_0x401227){_0x24b814=!![];var _0xe4393d='';var _0x200680={'format':'Letter','border':'1cm'};fs[_0x96b7('0xba')](_0x575cc9);_0xe4393d+=util[_0x96b7('0x84')](_0x96b7('0xbb'),_0x401227['id']);_0xe4393d+=util[_0x96b7('0x84')](_0x96b7('0xbc'),moment()[_0x96b7('0x84')](_0x96b7('0xbd'))[_0x96b7('0xb2')]());_0xe4393d+=_0x96b7('0xbe');for(var _0x1ad60e=0x1;_0x1ad60e<_0x401227['Messages'][_0x96b7('0x41')];_0x1ad60e++){var _0x25d3f6=_0x401227[_0x96b7('0x55')][_0x1ad60e];_0xe4393d+=_0x96b7('0xbf');_0xe4393d+=util[_0x96b7('0x84')](_0x96b7('0xc0'),_0x25d3f6[_0x96b7('0x5a')]?_0x25d3f6[_0x96b7('0x5a')]['fullname']:_0x25d3f6[_0x96b7('0x5d')][_0x96b7('0xb8')],_0x25d3f6['body']);_0xe4393d+=_0x96b7('0xc1');if(_0x25d3f6[_0x96b7('0xb9')]){var _0x43ab63=_0x25d3f6[_0x96b7('0xb9')];var _0x5f0dc8=path[_0x96b7('0x7f')](_0x12044f,_0x43ab63[_0x96b7('0x76')]);if(fs[_0x96b7('0xc2')](_0x5f0dc8)){fs[_0x96b7('0xc3')](_0x5f0dc8)['pipe'](fs[_0x96b7('0xc4')](path['join'](_0x575cc9,_0x43ab63[_0x96b7('0x76')])));}}}return new BPromise(function(_0x110499,_0x34baa3){pdf['create'](_0xe4393d,_0x200680)[_0x96b7('0xc5')](path['join'](_0x575cc9,'interaction-'+_0x1c1eb6+_0x96b7('0xc6')),function(_0xe05cf0,_0x494e38){if(_0xe05cf0)return _0x34baa3(_0xe05cf0);_0x110499(_0x494e38);});});}})[_0x96b7('0x34')](function(){if(_0x24b814){return new BPromise(function(_0xbcaa0f,_0x389eda){zipdir(_0x575cc9,{'saveTo':_0x2d4b22},function(_0xa73731,_0x10ae13){if(_0xa73731)return _0x389eda(_0xa73731);return _0xbcaa0f(_0x10ae13);});});}})[_0x96b7('0x34')](function(){if(_0x24b814){return new BPromise(function(_0x52ad4b,_0x5bae5d){rimraf(_0x575cc9,function(_0x159949){if(_0x159949)_0x5bae5d(_0x159949);return _0x52ad4b();});});}})[_0x96b7('0x34')](function(){if(_0x24b814){return _0xee5970[_0x96b7('0x7e')](_0x2d4b22,_0x1f1696,function(_0x5865d5){if(_0x5865d5){console[_0x96b7('0xc7')](_0x96b7('0xc8'),_0x5865d5);}else{fs[_0x96b7('0xc9')](_0x2d4b22);}});}else{return _0xee5970[_0x96b7('0x2a')](0xc8);}})[_0x96b7('0x29')](handleError(_0xee5970,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 86167a0..f45ef56 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 _0xedfd=['ChatInteraction','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x399937,_0x151d87){var _0x28d02f=function(_0x5d978a){while(--_0x5d978a){_0x399937['push'](_0x399937['shift']());}};_0x28d02f(++_0x151d87);}(_0xedfd,0x1e5));var _0xdedf=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xedfd[_0x4fc9e6];return _0x551d28;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdedf('0x0'))['db'][_0xdedf('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdedf('0x2')](0x0);var events={'afterCreate':_0xdedf('0x3'),'afterUpdate':'update','afterDestroy':_0xdedf('0x4')};function emitEvent(_0xfb1d48){return function(_0x5cd462,_0x2febaf,_0x583185){ChatInteractionEvents[_0xdedf('0x5')](_0xfb1d48+':'+_0x5cd462['id'],_0x5cd462);ChatInteractionEvents['emit'](_0xfb1d48,_0x5cd462);_0x583185(null);};}for(var e in events){if(events[_0xdedf('0x6')](e)){var event=events[e];ChatInteraction[_0xdedf('0x7')](e,emitEvent(event));}}module[_0xdedf('0x8')]=ChatInteractionEvents; \ No newline at end of file +var _0xb22a=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb22a,0x111));var _0xab22=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xb22a[_0x471448];return _0x38190b;};'use strict';var EventEmitter=require(_0xab22('0x0'));var ChatInteraction=require(_0xab22('0x1'))['db']['ChatInteraction'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xab22('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xab22('0x3'),'afterDestroy':_0xab22('0x4')};function emitEvent(_0x9c5887){return function(_0x16f61d,_0x2e2375,_0x5034a0){ChatInteractionEvents[_0xab22('0x5')](_0x9c5887+':'+_0x16f61d['id'],_0x16f61d);ChatInteractionEvents['emit'](_0x9c5887,_0x16f61d);_0x5034a0(null);};}for(var e in events){if(events[_0xab22('0x6')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 90e9dba..efed64f 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 _0x763a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','./chatInteraction.attributes','ChatInteraction','chat_interactions','changed','closed'];(function(_0x345307,_0x11b6f3){var _0x1e07a7=function(_0x76bed3){while(--_0x76bed3){_0x345307['push'](_0x345307['shift']());}};_0x1e07a7(++_0x11b6f3);}(_0x763a,0x1c4));var _0xa763=function(_0x31dc92,_0x4d7443){_0x31dc92=_0x31dc92-0x0;var _0x11b3d2=_0x763a[_0x31dc92];return _0x11b3d2;};'use strict';var _=require(_0xa763('0x0'));var util=require(_0xa763('0x1'));var logger=require(_0xa763('0x2'))('api');var moment=require(_0xa763('0x3'));var BPromise=require(_0xa763('0x4'));var rp=require('request-promise');var attributes=require(_0xa763('0x5'));module['exports']=function(_0x270008,_0x417f47){return _0x270008['define'](_0xa763('0x6'),attributes,{'tableName':_0xa763('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28cce6,_0x41f34a,_0x3ba102){if(_0x28cce6[_0xa763('0x8')](_0xa763('0x9'))){_0x28cce6[_0xa763('0xa')]=moment()[_0xa763('0xb')](_0xa763('0xc'));}_0x3ba102(null,_0x28cce6);}},'charset':'utf8mb4','collate':_0xa763('0xd')});}; \ No newline at end of file +var _0xe9bb=['chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','./chatInteraction.attributes','ChatInteraction'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0xe9bb,0x17e));var _0xbe9b=function(_0x5a76f0,_0x35970a){_0x5a76f0=_0x5a76f0-0x0;var _0x1958ce=_0xe9bb[_0x5a76f0];return _0x1958ce;};'use strict';var _=require(_0xbe9b('0x0'));var util=require(_0xbe9b('0x1'));var logger=require(_0xbe9b('0x2'))(_0xbe9b('0x3'));var moment=require(_0xbe9b('0x4'));var BPromise=require('bluebird');var rp=require(_0xbe9b('0x5'));var attributes=require(_0xbe9b('0x6'));module['exports']=function(_0x4d8d5a,_0x23b0e9){return _0x4d8d5a['define'](_0xbe9b('0x7'),attributes,{'tableName':_0xbe9b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x564b38,_0x40372d,_0x910528){if(_0x564b38[_0xbe9b('0x9')](_0xbe9b('0xa'))){_0x564b38[_0xbe9b('0xb')]=moment()['format'](_0xbe9b('0xc'));}_0x910528(null,_0x564b38);}},'charset':_0xbe9b('0xd'),'collate':_0xbe9b('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 35ae708..18d2d95 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 _0x4e5b=['AddTagsToChatInteraction','ChatInteraction','find','ids','body','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateChatInteraction','update','options','raw','where','attributes','limit','stringify','catch'];(function(_0x298be3,_0x2ebf8f){var _0x286f11=function(_0x136901){while(--_0x136901){_0x298be3['push'](_0x298be3['shift']());}};_0x286f11(++_0x2ebf8f);}(_0x4e5b,0x1aa));var _0xb4e5=function(_0x4188ed,_0x41db70){_0x4188ed=_0x4188ed-0x0;var _0x39a85d=_0x4e5b[_0x4188ed];return _0x39a85d;};'use strict';var _=require(_0xb4e5('0x0'));var util=require(_0xb4e5('0x1'));var moment=require('moment');var BPromise=require(_0xb4e5('0x2'));var rs=require(_0xb4e5('0x3'));var fs=require('fs');var Redis=require(_0xb4e5('0x4'));var db=require(_0xb4e5('0x5'))['db'];var utils=require(_0xb4e5('0x6'));var logger=require(_0xb4e5('0x7'))(_0xb4e5('0x8'));var config=require('../../config/environment');var jayson=require(_0xb4e5('0x9'));var client=jayson[_0xb4e5('0xa')][_0xb4e5('0xb')]({'port':0x232a});config[_0xb4e5('0xc')]=_[_0xb4e5('0xd')](config['redis'],{'host':_0xb4e5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4e5('0xc')]));require(_0xb4e5('0xf'))[_0xb4e5('0x10')](socket);function respondWithRpcPromise(_0x360219,_0x3617b9,_0x90d5e5){return new BPromise(function(_0x468bbc,_0x1b4c30){return client['request'](_0x360219,_0x90d5e5)[_0xb4e5('0x11')](function(_0x300e48){logger[_0xb4e5('0x12')](_0xb4e5('0x13'),_0x3617b9,_0xb4e5('0x14'));logger[_0xb4e5('0x15')](_0xb4e5('0x16'),_0x3617b9,_0xb4e5('0x14'),JSON['stringify'](_0x300e48));if(_0x300e48[_0xb4e5('0x17')]){if(_0x300e48[_0xb4e5('0x17')][_0xb4e5('0x18')]===0x1f4){logger['error'](_0xb4e5('0x13'),_0x3617b9,_0x300e48[_0xb4e5('0x17')]['message']);return _0x1b4c30(_0x300e48[_0xb4e5('0x17')][_0xb4e5('0x19')]);}logger[_0xb4e5('0x17')](_0xb4e5('0x13'),_0x3617b9,_0x300e48['error'][_0xb4e5('0x19')]);return _0x468bbc(_0x300e48[_0xb4e5('0x17')][_0xb4e5('0x19')]);}else{logger[_0xb4e5('0x12')](_0xb4e5('0x13'),_0x3617b9,'request\x20sent');_0x468bbc(_0x300e48[_0xb4e5('0x1a')][_0xb4e5('0x19')]);}})['catch'](function(_0x3f3e74){logger[_0xb4e5('0x17')](_0xb4e5('0x13'),_0x3617b9,_0x3f3e74);_0x1b4c30(_0x3f3e74);});});}exports[_0xb4e5('0x1b')]=function(_0x119a5e){var _0x160251=this;return new Promise(function(_0x45d412,_0x440774){return db['ChatInteraction'][_0xb4e5('0x1c')](_0x119a5e['body'],{'raw':_0x119a5e[_0xb4e5('0x1d')]?_0x119a5e[_0xb4e5('0x1d')][_0xb4e5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119a5e[_0xb4e5('0x1d')]?_0x119a5e[_0xb4e5('0x1d')][_0xb4e5('0x1f')]||null:null,'attributes':_0x119a5e[_0xb4e5('0x1d')]?_0x119a5e[_0xb4e5('0x1d')][_0xb4e5('0x20')]||null:null,'limit':_0x119a5e[_0xb4e5('0x1d')]?_0x119a5e['options'][_0xb4e5('0x21')]||null:null})['then'](function(_0x31740e){logger[_0xb4e5('0x12')](_0xb4e5('0x1b'),_0x119a5e);logger['debug'](_0xb4e5('0x1b'),_0x119a5e,JSON[_0xb4e5('0x22')](_0x31740e));_0x45d412(_0x31740e);})[_0xb4e5('0x23')](function(_0x20b836){logger['error']('UpdateChatInteraction',_0x20b836[_0xb4e5('0x19')],_0x119a5e);_0x440774(_0x160251[_0xb4e5('0x17')](0x1f4,_0x20b836[_0xb4e5('0x19')]));});});};exports[_0xb4e5('0x24')]=function(_0x2945f5){return new Promise(function(_0x34e0b1,_0x471cc8){return db[_0xb4e5('0x25')][_0xb4e5('0x26')]({'where':_0x2945f5[_0xb4e5('0x1d')]?_0x2945f5[_0xb4e5('0x1d')]['where']||null:null})[_0xb4e5('0x11')](function(_0x2b28b8){if(_0x2b28b8){return _0x2b28b8['addTags'](_0x2945f5['body'][_0xb4e5('0x27')],_['omit'](_0x2945f5[_0xb4e5('0x28')],[_0xb4e5('0x27'),'id'])||{});}})['spread'](function(_0x58cfc6){logger[_0xb4e5('0x12')](_0xb4e5('0x29'),_0x2945f5);logger[_0xb4e5('0x15')]('AddTags',_0x2945f5,JSON['stringify'](_0x58cfc6));_0x34e0b1(_0x58cfc6);})[_0xb4e5('0x23')](function(_0x55e646){logger[_0xb4e5('0x17')](_0xb4e5('0x29'),_0x55e646[_0xb4e5('0x19')],_0x2945f5);_0x471cc8(_this[_0xb4e5('0x17')](0x1f4,_0x55e646['message']));});});}; \ No newline at end of file +var _0x2587=['ChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','update','body','options','raw','attributes','limit','info','UpdateChatInteraction'];(function(_0x3ff811,_0x5be877){var _0x326566=function(_0x30d8db){while(--_0x30d8db){_0x3ff811['push'](_0x3ff811['shift']());}};_0x326566(++_0x5be877);}(_0x2587,0xcb));var _0x7258=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0x2587[_0x4c16c4];return _0x2d2ddf;};'use strict';var _=require(_0x7258('0x0'));var util=require(_0x7258('0x1'));var moment=require(_0x7258('0x2'));var BPromise=require(_0x7258('0x3'));var rs=require(_0x7258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7258('0x5'))['db'];var utils=require(_0x7258('0x6'));var logger=require('../../config/logger')(_0x7258('0x7'));var config=require('../../config/environment');var jayson=require(_0x7258('0x8'));var client=jayson[_0x7258('0x9')][_0x7258('0xa')]({'port':0x232a});config[_0x7258('0xb')]=_['defaults'](config[_0x7258('0xb')],{'host':_0x7258('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x7258('0xd')](socket);function respondWithRpcPromise(_0x25a1ef,_0x209123,_0x49cc55){return new BPromise(function(_0x9be009,_0x7ddb88){return client[_0x7258('0xe')](_0x25a1ef,_0x49cc55)[_0x7258('0xf')](function(_0x4be1ef){logger['info'](_0x7258('0x10'),_0x209123,_0x7258('0x11'));logger[_0x7258('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x209123,'request\x20sent',JSON[_0x7258('0x13')](_0x4be1ef));if(_0x4be1ef['error']){if(_0x4be1ef['error']['code']===0x1f4){logger[_0x7258('0x14')](_0x7258('0x10'),_0x209123,_0x4be1ef[_0x7258('0x14')][_0x7258('0x15')]);return _0x7ddb88(_0x4be1ef[_0x7258('0x14')][_0x7258('0x15')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x209123,_0x4be1ef[_0x7258('0x14')][_0x7258('0x15')]);return _0x9be009(_0x4be1ef[_0x7258('0x14')][_0x7258('0x15')]);}else{logger['info'](_0x7258('0x10'),_0x209123,_0x7258('0x11'));_0x9be009(_0x4be1ef['result'][_0x7258('0x15')]);}})[_0x7258('0x16')](function(_0x418353){logger[_0x7258('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x209123,_0x418353);_0x7ddb88(_0x418353);});});}exports['UpdateChatInteraction']=function(_0x41ece6){var _0x2a2ff4=this;return new Promise(function(_0x55e1c9,_0x20391f){return db['ChatInteraction'][_0x7258('0x17')](_0x41ece6[_0x7258('0x18')],{'raw':_0x41ece6['options']?_0x41ece6[_0x7258('0x19')][_0x7258('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41ece6[_0x7258('0x19')]?_0x41ece6[_0x7258('0x19')]['where']||null:null,'attributes':_0x41ece6[_0x7258('0x19')]?_0x41ece6[_0x7258('0x19')][_0x7258('0x1b')]||null:null,'limit':_0x41ece6['options']?_0x41ece6[_0x7258('0x19')][_0x7258('0x1c')]||null:null})[_0x7258('0xf')](function(_0x36667f){logger[_0x7258('0x1d')](_0x7258('0x1e'),_0x41ece6);logger[_0x7258('0x12')](_0x7258('0x1e'),_0x41ece6,JSON[_0x7258('0x13')](_0x36667f));_0x55e1c9(_0x36667f);})[_0x7258('0x16')](function(_0x2892fe){logger['error'](_0x7258('0x1e'),_0x2892fe[_0x7258('0x15')],_0x41ece6);_0x20391f(_0x2a2ff4[_0x7258('0x14')](0x1f4,_0x2892fe[_0x7258('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x4aed72){return new Promise(function(_0x21dc22,_0x38f783){return db[_0x7258('0x1f')][_0x7258('0x20')]({'where':_0x4aed72['options']?_0x4aed72['options'][_0x7258('0x21')]||null:null})[_0x7258('0xf')](function(_0x2bbbe3){if(_0x2bbbe3){return _0x2bbbe3[_0x7258('0x22')](_0x4aed72['body'][_0x7258('0x23')],_[_0x7258('0x24')](_0x4aed72[_0x7258('0x18')],[_0x7258('0x23'),'id'])||{});}})[_0x7258('0x25')](function(_0x97c531){logger[_0x7258('0x1d')](_0x7258('0x26'),_0x4aed72);logger[_0x7258('0x12')](_0x7258('0x26'),_0x4aed72,JSON['stringify'](_0x97c531));_0x21dc22(_0x97c531);})[_0x7258('0x16')](function(_0x39e1b5){logger[_0x7258('0x14')](_0x7258('0x26'),_0x39e1b5[_0x7258('0x15')],_0x4aed72);_0x38f783(_this['error'](0x1f4,_0x39e1b5[_0x7258('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c2acf9a..584eccd 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 _0x822f=['chatInteraction:','./chatInteraction.events','remove','emit','removeListener','length'];(function(_0x331160,_0x2da821){var _0x398f85=function(_0x5ac7ed){while(--_0x5ac7ed){_0x331160['push'](_0x331160['shift']());}};_0x398f85(++_0x2da821);}(_0x822f,0x79));var _0xf822=function(_0x4f7221,_0x9e6d08){_0x4f7221=_0x4f7221-0x0;var _0x101605=_0x822f[_0x4f7221];return _0x101605;};'use strict';var ChatInteractionEvents=require(_0xf822('0x0'));var events=['save',_0xf822('0x1'),'update'];function createListener(_0x309f8a,_0x88825){return function(_0x14745b){_0x88825[_0xf822('0x2')](_0x309f8a,_0x14745b);};}function removeListener(_0x9ecde3,_0x293940){return function(){ChatInteractionEvents[_0xf822('0x3')](_0x9ecde3,_0x293940);};}exports['register']=function(_0x315deb){for(var _0x2b32ef=0x0,_0x5d6530=events[_0xf822('0x4')];_0x2b32ef<_0x5d6530;_0x2b32ef++){var _0x8aa18e=events[_0x2b32ef];var _0x4d1bf8=createListener(_0xf822('0x5')+_0x8aa18e,_0x315deb);ChatInteractionEvents['on'](_0x8aa18e,_0x4d1bf8);}}; \ No newline at end of file +var _0x0109=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','register'];(function(_0x12378f,_0x4121ba){var _0x50f0d5=function(_0x2d6a6f){while(--_0x2d6a6f){_0x12378f['push'](_0x12378f['shift']());}};_0x50f0d5(++_0x4121ba);}(_0x0109,0xea));var _0x9010=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0109[_0x618414];return _0x21c19a;};'use strict';var ChatInteractionEvents=require(_0x9010('0x0'));var events=[_0x9010('0x1'),_0x9010('0x2'),_0x9010('0x3')];function createListener(_0x4786ba,_0x1a7280){return function(_0x460e4f){_0x1a7280[_0x9010('0x4')](_0x4786ba,_0x460e4f);};}function removeListener(_0x5ef70b,_0x331654){return function(){ChatInteractionEvents['removeListener'](_0x5ef70b,_0x331654);};}exports[_0x9010('0x5')]=function(_0x199ac4){for(var _0x3b2418=0x0,_0x4864b3=events[_0x9010('0x6')];_0x3b2418<_0x4864b3;_0x3b2418++){var _0x213988=events[_0x3b2418];var _0x251ef6=createListener(_0x9010('0x7')+_0x213988,_0x199ac4);ChatInteractionEvents['on'](_0x213988,_0x251ef6);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 14094bc..c71b939 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 _0x4213=['root','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join'];(function(_0x1621dd,_0x172229){var _0x3b0046=function(_0x53ab32){while(--_0x53ab32){_0x1621dd['push'](_0x1621dd['shift']());}};_0x3b0046(++_0x172229);}(_0x4213,0x77));var _0x3421=function(_0x36d9d1,_0x1dbe1d){_0x36d9d1=_0x36d9d1-0x0;var _0xa7e07a=_0x4213[_0x36d9d1];return _0xa7e07a;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./chatInteraction.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/describe',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0xd')](),controller['show']);router[_0x3421('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x3421('0xe')]);router['get'](_0x3421('0xf'),auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);router[_0x3421('0x8')](_0x3421('0x11'),auth[_0x3421('0xd')](),controller[_0x3421('0x12')]);router['get'](_0x3421('0x13'),auth[_0x3421('0x9')](),controller[_0x3421('0x14')]);router[_0x3421('0x15')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0x16')]);var upload=multer({'storage':multer[_0x3421('0x17')]({'destination':function(_0x59ea4a,_0xafd9e0,_0x4b5f43){_0x4b5f43(null,path[_0x3421('0x18')](config[_0x3421('0x19')],'server/files/attachments/'));},'filename':function(_0x1e33ab,_0x4c6f7b,_0x16bc8f){_0x16bc8f(null,util[_0x3421('0x1a')]('%s-%s',Date[_0x3421('0x1b')](),_0x4c6f7b[_0x3421('0x1c')][_0x3421('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3421('0x15')](_0x3421('0x1e'),upload[_0x3421('0x1f')](_0x3421('0x20')),controller[_0x3421('0x21')]);router[_0x3421('0x15')](_0x3421('0xf'),auth[_0x3421('0xd')](),controller['addMessage']);router[_0x3421('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x3421('0x22'),_0x3421('0x23')),controller[_0x3421('0x24')]);router[_0x3421('0x25')](_0x3421('0xc'),auth[_0x3421('0x9')](),interaction[_0x3421('0x26')](_0x3421('0x22'),_0x3421('0x27')),controller[_0x3421('0x28')]);router['put']('/:id/custom_update',controller['customUpdate']);router[_0x3421('0x25')](_0x3421('0x29'),auth[_0x3421('0xd')](),controller['abandon']);router['put'](_0x3421('0x2a'),controller['close']);router[_0x3421('0x2b')]('/:id',auth[_0x3421('0x9')](),interaction[_0x3421('0x26')](_0x3421('0x22'),_0x3421('0x2c')),controller[_0x3421('0x2d')]);router['delete'](_0x3421('0x2e'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3421('0x2f')]=router; \ No newline at end of file +var _0x5c00=['get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','addTags','put','tracked','chat','chatinteraction:update','/:id/custom_update','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index'];(function(_0x142dc3,_0x512d08){var _0x25ea85=function(_0x548bea){while(--_0x548bea){_0x142dc3['push'](_0x142dc3['shift']());}};_0x25ea85(++_0x512d08);}(_0x5c00,0x17e));var _0x05c0=function(_0x18b56f,_0x2d8823){_0x18b56f=_0x18b56f-0x0;var _0x4df0e0=_0x5c00[_0x18b56f];return _0x4df0e0;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xa')](_0x05c0('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x05c0('0xe')]);router[_0x05c0('0xa')](_0x05c0('0xf'),auth[_0x05c0('0x10')](),controller[_0x05c0('0x11')]);router[_0x05c0('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);router['get'](_0x05c0('0x13'),auth[_0x05c0('0x10')](),controller[_0x05c0('0x14')]);router['get'](_0x05c0('0x15'),auth['isAuthenticated'](),controller[_0x05c0('0x16')]);router[_0x05c0('0x17')]('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x18')]);var upload=multer({'storage':multer[_0x05c0('0x19')]({'destination':function(_0xe57ed0,_0x331799,_0xd7b487){_0xd7b487(null,path['join'](config[_0x05c0('0x1a')],_0x05c0('0x1b')));},'filename':function(_0x4bb164,_0x29e6b0,_0x27c7bd){_0x27c7bd(null,util[_0x05c0('0x1c')](_0x05c0('0x1d'),Date[_0x05c0('0x1e')](),_0x29e6b0[_0x05c0('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x05c0('0x17')](_0x05c0('0x20'),upload[_0x05c0('0x21')]('file'),controller[_0x05c0('0x22')]);router[_0x05c0('0x17')](_0x05c0('0x23'),auth[_0x05c0('0x10')](),controller[_0x05c0('0x24')]);router['post'](_0x05c0('0x25'),auth[_0x05c0('0x8')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x05c0('0x26')]);router[_0x05c0('0x27')](_0x05c0('0xd'),auth[_0x05c0('0x8')](),interaction[_0x05c0('0x28')](_0x05c0('0x29'),_0x05c0('0x2a')),controller['update']);router[_0x05c0('0x27')](_0x05c0('0x2b'),controller['customUpdate']);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x05c0('0x27')](_0x05c0('0x2c'),controller['close']);router[_0x05c0('0x2d')](_0x05c0('0xd'),auth[_0x05c0('0x8')](),interaction[_0x05c0('0x28')]('chat',_0x05c0('0x2e')),controller[_0x05c0('0x2f')]);router[_0x05c0('0x2d')](_0x05c0('0x25'),auth[_0x05c0('0x8')](),controller[_0x05c0('0x30')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 85ee11f..21c101c 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 _0x7278=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x16e7ea,_0x23fda5){var _0x4f581f=function(_0xa60ff5){while(--_0xa60ff5){_0x16e7ea['push'](_0x16e7ea['shift']());}};_0x4f581f(++_0x23fda5);}(_0x7278,0x161));var _0x8727=function(_0xb1cd4d,_0xddbc46){_0xb1cd4d=_0xb1cd4d-0x0;var _0x626beb=_0x7278[_0xb1cd4d];return _0x626beb;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'body':{'type':Sequelize[_0x8727('0x2')](_0x8727('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8727('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3d04=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'body':{'type':Sequelize[_0x43d0('0x2')](_0x43d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x43d0('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x43d0('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 67aee68..738a39d 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 _0x49e5=['reject','save','update','then','destroy','error','stack','name','send','index','ChatInternalMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','limit','set','Content-Range','apply'];(function(_0x40e8ab,_0x3e50c8){var _0x3b1621=function(_0x5cd803){while(--_0x5cd803){_0x40e8ab['push'](_0x40e8ab['shift']());}};_0x3b1621(++_0x3e50c8);}(_0x49e5,0x196));var _0x549e=function(_0x374214,_0x262429){_0x374214=_0x374214-0x0;var _0x402719=_0x49e5[_0x374214];return _0x402719;};'use strict';var pdf=require(_0x549e('0x0'));var emlformat=require(_0x549e('0x1'));var rimraf=require(_0x549e('0x2'));var zipdir=require(_0x549e('0x3'));var jsonpatch=require(_0x549e('0x4'));var rp=require(_0x549e('0x5'));var moment=require('moment');var BPromise=require(_0x549e('0x6'));var Mustache=require(_0x549e('0x7'));var util=require(_0x549e('0x8'));var path=require(_0x549e('0x9'));var sox=require(_0x549e('0xa'));var csv=require('to-csv');var ejs=require(_0x549e('0xb'));var fs=require('fs');var _=require(_0x549e('0xc'));var squel=require(_0x549e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x549e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x549e('0xf'));var Papa=require('papaparse');var authService=require(_0x549e('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x549e('0x11'));var qs=require(_0x549e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x549e('0x13'));var config=require('../../config/environment');var db=require(_0x549e('0x14'))['db'];config[_0x549e('0x15')]=_['defaults'](config[_0x549e('0x15')],{'host':_0x549e('0x16'),'port':0x18eb});var socket=require(_0x549e('0x17'))(new Redis(config[_0x549e('0x15')]));require('./chatInternalMessage.socket')[_0x549e('0x18')](socket);function respondWithStatusCode(_0x1d49f6,_0x26d8b4){_0x26d8b4=_0x26d8b4||0xcc;return function(_0x363d1f){if(_0x363d1f){return _0x1d49f6[_0x549e('0x19')](_0x26d8b4);}return _0x1d49f6['status'](_0x26d8b4)[_0x549e('0x1a')]();};}function respondWithResult(_0x36a2a8,_0x2ff674){_0x2ff674=_0x2ff674||0xc8;return function(_0xe12ff9){if(_0xe12ff9){return _0x36a2a8[_0x549e('0x1b')](_0x2ff674)[_0x549e('0x1c')](_0xe12ff9);}};}function respondWithFilteredResult(_0x31183c,_0x5910ba){return function(_0x23cee3){if(_0x23cee3){var _0x19838f=_0x23cee3[_0x549e('0x1d')],_0x209c5b=_0x5910ba['offset'],_0x2d858d=_0x5910ba['offset']+_0x5910ba[_0x549e('0x1e')],_0xd0ac55;if(_0x2d858d>=_0x19838f){_0x2d858d=_0x19838f;_0xd0ac55=0xc8;}else{_0xd0ac55=0xce;}_0x31183c[_0x549e('0x1b')](_0xd0ac55);return _0x31183c[_0x549e('0x1f')](_0x549e('0x20'),_0x209c5b+'-'+_0x2d858d+'/'+_0x19838f)[_0x549e('0x1c')](_0x23cee3);}return null;};}function patchUpdates(_0x1ae932){return function(_0x2360e4){try{jsonpatch[_0x549e('0x21')](_0x2360e4,_0x1ae932,!![]);}catch(_0x414391){return BPromise[_0x549e('0x22')](_0x414391);}return _0x2360e4[_0x549e('0x23')]();};}function saveUpdates(_0x298f82,_0x6a7dc4){return function(_0x2f49c9){if(_0x2f49c9){return _0x2f49c9[_0x549e('0x24')](_0x298f82)[_0x549e('0x25')](function(_0x4468fb){return _0x4468fb;});}return null;};}function removeEntity(_0x2bcea8,_0x498d50){return function(_0x1b54a9){if(_0x1b54a9){return _0x1b54a9[_0x549e('0x26')]()[_0x549e('0x25')](function(){_0x2bcea8[_0x549e('0x1b')](0xcc)[_0x549e('0x1a')]();});}};}function handleEntityNotFound(_0x4c54e4,_0x1edd5e){return function(_0x2c3a20){if(!_0x2c3a20){_0x4c54e4[_0x549e('0x19')](0x194);}return _0x2c3a20;};}function handleError(_0x285459,_0x1f8b07){_0x1f8b07=_0x1f8b07||0x1f4;return function(_0x52f88f){logger[_0x549e('0x27')](_0x52f88f[_0x549e('0x28')]);if(_0x52f88f[_0x549e('0x29')]){delete _0x52f88f[_0x549e('0x29')];}_0x285459['status'](_0x1f8b07)[_0x549e('0x2a')](_0x52f88f);};}exports[_0x549e('0x2b')]=function(_0x33cae6,_0x30853e){var _0x2fd80a={},_0x4aa83b={},_0x58017e={'count':0x0,'rows':[]};var _0x247941=db[_0x549e('0x2c')][_0x549e('0x2d')];_0x4aa83b[_0x549e('0x2e')]=_[_0x549e('0x2f')](_0x247941);_0x4aa83b[_0x549e('0x30')]=_[_0x549e('0x2f')](_0x33cae6['query']);_0x4aa83b[_0x549e('0x31')]=_[_0x549e('0x32')](_0x4aa83b['model'],_0x4aa83b[_0x549e('0x30')]);_0x2fd80a['attributes']=_[_0x549e('0x32')](_0x4aa83b[_0x549e('0x2e')],qs[_0x549e('0x33')](_0x33cae6[_0x549e('0x30')][_0x549e('0x33')]));_0x2fd80a[_0x549e('0x34')]=_0x2fd80a[_0x549e('0x34')][_0x549e('0x35')]?_0x2fd80a[_0x549e('0x34')]:_0x4aa83b[_0x549e('0x2e')];if(!_0x33cae6[_0x549e('0x30')]['hasOwnProperty'](_0x549e('0x36'))){_0x2fd80a['limit']=qs[_0x549e('0x1e')](_0x33cae6[_0x549e('0x30')]['limit']);_0x2fd80a['offset']=qs[_0x549e('0x37')](_0x33cae6[_0x549e('0x30')][_0x549e('0x37')]);}_0x2fd80a[_0x549e('0x38')]=qs[_0x549e('0x39')](_0x33cae6[_0x549e('0x30')]['sort']);_0x2fd80a[_0x549e('0x3a')]=qs['filters'](_[_0x549e('0x3b')](_0x33cae6[_0x549e('0x30')],_0x4aa83b[_0x549e('0x31')]));if(_0x33cae6[_0x549e('0x30')][_0x549e('0x3c')]){_0x2fd80a['where']=_['merge'](_0x2fd80a[_0x549e('0x3a')],{'$or':_[_0x549e('0x3d')](_0x247941,function(_0x49f029){if(_0x49f029['type'][_0x549e('0x3e')]!==_0x549e('0x3f')){var _0x4d62ff={};_0x4d62ff[_0x49f029[_0x549e('0x40')]]={'$like':'%'+_0x33cae6['query'][_0x549e('0x3c')]+'%'};return _0x4d62ff;}})});}_0x2fd80a=_[_0x549e('0x41')]({},_0x2fd80a,_0x33cae6[_0x549e('0x42')]);var _0x4df3e7={'where':_0x2fd80a['where']};return db['ChatInternalMessage'][_0x549e('0x1d')](_0x4df3e7)[_0x549e('0x25')](function(_0x530d55){_0x58017e['count']=_0x530d55;if(_0x33cae6[_0x549e('0x30')][_0x549e('0x43')]){_0x2fd80a[_0x549e('0x44')]=[{'all':!![]}];}return db[_0x549e('0x2c')][_0x549e('0x45')](_0x2fd80a);})[_0x549e('0x25')](function(_0x392b73){_0x58017e[_0x549e('0x46')]=_0x392b73;return _0x58017e;})[_0x549e('0x25')](respondWithFilteredResult(_0x30853e,_0x2fd80a))[_0x549e('0x47')](handleError(_0x30853e,null));};exports[_0x549e('0x48')]=function(_0x1868e6,_0x3d40a2){var _0x3b919b={'raw':!![],'where':{'id':_0x1868e6[_0x549e('0x49')]['id']}},_0x3be662={};_0x3be662[_0x549e('0x2e')]=_[_0x549e('0x2f')](db['ChatInternalMessage']['rawAttributes']);_0x3be662[_0x549e('0x30')]=_[_0x549e('0x2f')](_0x1868e6[_0x549e('0x30')]);_0x3be662['filters']=_[_0x549e('0x32')](_0x3be662[_0x549e('0x2e')],_0x3be662[_0x549e('0x30')]);_0x3b919b['attributes']=_[_0x549e('0x32')](_0x3be662[_0x549e('0x2e')],qs['fields'](_0x1868e6[_0x549e('0x30')][_0x549e('0x33')]));_0x3b919b[_0x549e('0x34')]=_0x3b919b['attributes'][_0x549e('0x35')]?_0x3b919b[_0x549e('0x34')]:_0x3be662[_0x549e('0x2e')];if(_0x1868e6['query'][_0x549e('0x43')]){_0x3b919b['include']=[{'all':!![]}];}_0x3b919b=_[_0x549e('0x41')]({},_0x3b919b,_0x1868e6[_0x549e('0x42')]);return db[_0x549e('0x2c')][_0x549e('0x4a')](_0x3b919b)[_0x549e('0x25')](handleEntityNotFound(_0x3d40a2,null))[_0x549e('0x25')](respondWithResult(_0x3d40a2,null))[_0x549e('0x47')](handleError(_0x3d40a2,null));};exports['create']=function(_0x7336da,_0x1c81b5){return db[_0x549e('0x2c')][_0x549e('0x4b')](_0x7336da[_0x549e('0x4c')],{})[_0x549e('0x25')](respondWithResult(_0x1c81b5,0xc9))['catch'](handleError(_0x1c81b5,null));};exports[_0x549e('0x24')]=function(_0x422298,_0x52ad8f){if(_0x422298['body']['id']){delete _0x422298[_0x549e('0x4c')]['id'];}return db[_0x549e('0x2c')][_0x549e('0x4a')]({'where':{'id':_0x422298[_0x549e('0x49')]['id']}})[_0x549e('0x25')](handleEntityNotFound(_0x52ad8f,null))['then'](saveUpdates(_0x422298[_0x549e('0x4c')],null))['then'](respondWithResult(_0x52ad8f,null))[_0x549e('0x47')](handleError(_0x52ad8f,null));};exports[_0x549e('0x26')]=function(_0x15e561,_0x246bda){return db[_0x549e('0x2c')][_0x549e('0x4a')]({'where':{'id':_0x15e561[_0x549e('0x49')]['id']}})[_0x549e('0x25')](handleEntityNotFound(_0x246bda,null))['then'](removeEntity(_0x246bda,null))['catch'](handleError(_0x246bda,null));};exports[_0x549e('0x4d')]=function(_0x4a95f1,_0x6e5e24){return db[_0x549e('0x2c')][_0x549e('0x4d')]()[_0x549e('0x25')](respondWithResult(_0x6e5e24,null))[_0x549e('0x47')](handleError(_0x6e5e24,null));};function wrapUser(_0x5469be){return function(_0x3c070b){var _0x3b47d2=_0x5469be[_0x549e('0x4e')]({'plain':!![]});_0x3b47d2[_0x549e('0x4f')]=[];if(_0x3c070b){_0x3b47d2['lastMessageAt']=_0x3c070b[_0x549e('0x50')];_0x3b47d2[_0x549e('0x51')]=_0x3c070b;}else{_0x3b47d2['lastMessageAt']=moment(0x0)[_0x549e('0x52')](_0x549e('0x53'));_0x3b47d2[_0x549e('0x51')]={};}return _0x3b47d2;};}exports[_0x549e('0x54')]=function(_0x56f25f,_0x35694e,_0xd27bb7){var _0x3408b2=[];return db[_0x549e('0x55')]['findAll']({'where':{'role':[_0x549e('0x56'),_0x549e('0x57'),'user']},'attributes':['id',_0x549e('0x58'),_0x549e('0x29'),_0x549e('0x59'),_0x549e('0x5a'),'internal',_0x549e('0x5b'),_0x549e('0x5c'),_0x549e('0x5d'),_0x549e('0x5e')],'order':qs[_0x549e('0x39')](_0x549e('0x5f')),'include':[{'model':db[_0x549e('0x60')],'as':'VoiceQueues','attributes':['id',_0x549e('0x29'),_0x549e('0x61')],'through':{'attributes':[]}}]})[_0x549e('0x25')](function(_0x2189ef){if(_0x2189ef){var _0x48a855=_0x56f25f[_0x549e('0x62')][_0x549e('0x4e')]({'plain':!![]});if(!_0x48a855)throw new Error(_0x549e('0x63'));if(_0x48a855[_0x549e('0x59')]==='user'){return db['UserProfileSection']['find']({'where':{'name':_0x549e('0x64'),'userProfileId':_0x48a855[_0x549e('0x65')]},'raw':!![]})[_0x549e('0x25')](function(_0x3b8637){if(_0x3b8637){if(_0x3b8637[_0x549e('0x66')]===0x0){return db[_0x549e('0x67')][_0x549e('0x45')]({'where':{'sectionId':_0x3b8637['id']},'raw':!![]})[_0x549e('0x25')](function(_0x2fa869){var _0x5c4aa0=[];if(_[_0x549e('0x68')](_0x2fa869)){_0x5c4aa0=_['filter'](_0x2189ef,function(_0x410be9){if(_0x410be9[_0x549e('0x59')]!==_0x549e('0x56')){return _0x410be9;}});return _0x5c4aa0;}else{for(var _0x55ef36=0x0;_0x55ef36<_0x2189ef[_0x549e('0x35')];_0x55ef36++){var _0x133670=_0x2189ef[_0x55ef36];if(_0x133670[_0x549e('0x59')]===_0x549e('0x56')){var _0x35e498=_[_0x549e('0x4a')](_0x2fa869,function(_0x173313){return _0x173313[_0x549e('0x69')]===_0x133670['id'];});if(_0x35e498)_0x5c4aa0[_0x549e('0x6a')](_0x133670);}else{_0x5c4aa0[_0x549e('0x6a')](_0x133670);}}return _0x5c4aa0;}});}else{return _0x2189ef;}}else{var _0x4c3e48=_[_0x549e('0x3c')](_0x2189ef,function(_0xbb387b){if(_0xbb387b['role']!=='agent'){return _0xbb387b;}});return _0x4c3e48;}});}else{return _0x2189ef;}}})[_0x549e('0x25')](function(_0xc837ff){var _0xa771b1=[];if(_0xc837ff){_0x3408b2=_0xc837ff;for(var _0x29ba7f=0x0;_0x29ba7f<_0xc837ff[_0x549e('0x35')];_0x29ba7f+=0x1){_0x3408b2[_0x29ba7f]['messages']=[];_0xa771b1[_0x549e('0x6a')](db['ChatInternalMessage'][_0x549e('0x4a')]({'where':{'FromId':[_0x56f25f[_0x549e('0x62')]['id'],_0xc837ff[_0x29ba7f]['id']],'ToId':[_0x56f25f['user']['id'],_0xc837ff[_0x29ba7f]['id']],'ChatGroupId':null},'attributes':['id',_0x549e('0x50'),_0x549e('0x6b'),'ToId',_0x549e('0x6c'),_0x549e('0x4c')],'order':qs[_0x549e('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xc837ff[_0x29ba7f])));}return BPromise[_0x549e('0x6d')](_0xa771b1);}return[];})[_0x549e('0x25')](function(_0x13eb35){return{'rows':_0x13eb35,'count':_0x13eb35['length']};})[_0x549e('0x25')](respondWithResult(_0x35694e,null))[_0x549e('0x47')](handleError(_0x35694e,null));}; \ No newline at end of file +var _0x2617=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','set','apply','then','destroy','error','stack','name','send','index','ChatInternalMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','showWebBar','-online','VoiceQueue','get','UserProfileSection','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','-createdAt','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x594c76,_0x37bd0e){var _0x57592a=function(_0x268d3f){while(--_0x268d3f){_0x594c76['push'](_0x594c76['shift']());}};_0x57592a(++_0x37bd0e);}(_0x2617,0xb8));var _0x7261=function(_0x1f384f,_0x121332){_0x1f384f=_0x1f384f-0x0;var _0x2346d8=_0x2617[_0x1f384f];return _0x2346d8;};'use strict';var pdf=require(_0x7261('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7261('0x1'));var jsonpatch=require(_0x7261('0x2'));var rp=require(_0x7261('0x3'));var moment=require(_0x7261('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7261('0x5'));var util=require(_0x7261('0x6'));var path=require(_0x7261('0x7'));var sox=require(_0x7261('0x8'));var csv=require(_0x7261('0x9'));var ejs=require(_0x7261('0xa'));var fs=require('fs');var _=require(_0x7261('0xb'));var squel=require(_0x7261('0xc'));var crypto=require(_0x7261('0xd'));var jsforce=require(_0x7261('0xe'));var deskjs=require(_0x7261('0xf'));var toCsv=require(_0x7261('0x9'));var querystring=require(_0x7261('0x10'));var Papa=require(_0x7261('0x11'));var authService=require(_0x7261('0x12'));var hardwareService=require(_0x7261('0x13'));var Redis=require(_0x7261('0x14'));var qs=require(_0x7261('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7261('0x16'));var config=require(_0x7261('0x17'));var db=require(_0x7261('0x18'))['db'];config[_0x7261('0x19')]=_[_0x7261('0x1a')](config[_0x7261('0x19')],{'host':_0x7261('0x1b'),'port':0x18eb});var socket=require(_0x7261('0x1c'))(new Redis(config[_0x7261('0x19')]));require(_0x7261('0x1d'))[_0x7261('0x1e')](socket);function respondWithStatusCode(_0xca12c4,_0x1d871d){_0x1d871d=_0x1d871d||0xcc;return function(_0x1428d7){if(_0x1428d7){return _0xca12c4[_0x7261('0x1f')](_0x1d871d);}return _0xca12c4[_0x7261('0x20')](_0x1d871d)[_0x7261('0x21')]();};}function respondWithResult(_0xcfb4,_0x323e3e){_0x323e3e=_0x323e3e||0xc8;return function(_0x1fd845){if(_0x1fd845){return _0xcfb4[_0x7261('0x20')](_0x323e3e)[_0x7261('0x22')](_0x1fd845);}};}function respondWithFilteredResult(_0x3d020a,_0x52884e){return function(_0x58966d){if(_0x58966d){var _0x2fe190=_0x58966d['count'],_0x3b8592=_0x52884e[_0x7261('0x23')],_0x3da839=_0x52884e[_0x7261('0x23')]+_0x52884e[_0x7261('0x24')],_0x5af460;if(_0x3da839>=_0x2fe190){_0x3da839=_0x2fe190;_0x5af460=0xc8;}else{_0x5af460=0xce;}_0x3d020a[_0x7261('0x20')](_0x5af460);return _0x3d020a[_0x7261('0x25')]('Content-Range',_0x3b8592+'-'+_0x3da839+'/'+_0x2fe190)[_0x7261('0x22')](_0x58966d);}return null;};}function patchUpdates(_0xfc65bb){return function(_0x470ee0){try{jsonpatch[_0x7261('0x26')](_0x470ee0,_0xfc65bb,!![]);}catch(_0x1b7019){return BPromise['reject'](_0x1b7019);}return _0x470ee0['save']();};}function saveUpdates(_0x49db7c,_0x6f278f){return function(_0x3d1da4){if(_0x3d1da4){return _0x3d1da4['update'](_0x49db7c)[_0x7261('0x27')](function(_0x243953){return _0x243953;});}return null;};}function removeEntity(_0x1528c2,_0x47b7c5){return function(_0xd881ed){if(_0xd881ed){return _0xd881ed[_0x7261('0x28')]()['then'](function(){_0x1528c2[_0x7261('0x20')](0xcc)[_0x7261('0x21')]();});}};}function handleEntityNotFound(_0x2b2864,_0x1c5b7e){return function(_0x2e0219){if(!_0x2e0219){_0x2b2864['sendStatus'](0x194);}return _0x2e0219;};}function handleError(_0x29544e,_0xb78a19){_0xb78a19=_0xb78a19||0x1f4;return function(_0x39866d){logger[_0x7261('0x29')](_0x39866d[_0x7261('0x2a')]);if(_0x39866d[_0x7261('0x2b')]){delete _0x39866d[_0x7261('0x2b')];}_0x29544e['status'](_0xb78a19)[_0x7261('0x2c')](_0x39866d);};}exports[_0x7261('0x2d')]=function(_0x796784,_0x2e2465){var _0x4386de={},_0x1b3682={},_0x61ae51={'count':0x0,'rows':[]};var _0x599125=db[_0x7261('0x2e')][_0x7261('0x2f')];_0x1b3682[_0x7261('0x30')]=_[_0x7261('0x31')](_0x599125);_0x1b3682[_0x7261('0x32')]=_['keys'](_0x796784[_0x7261('0x32')]);_0x1b3682[_0x7261('0x33')]=_[_0x7261('0x34')](_0x1b3682['model'],_0x1b3682[_0x7261('0x32')]);_0x4386de['attributes']=_[_0x7261('0x34')](_0x1b3682['model'],qs['fields'](_0x796784['query'][_0x7261('0x35')]));_0x4386de[_0x7261('0x36')]=_0x4386de[_0x7261('0x36')][_0x7261('0x37')]?_0x4386de[_0x7261('0x36')]:_0x1b3682[_0x7261('0x30')];if(!_0x796784['query'][_0x7261('0x38')]('nolimit')){_0x4386de['limit']=qs[_0x7261('0x24')](_0x796784['query'][_0x7261('0x24')]);_0x4386de[_0x7261('0x23')]=qs[_0x7261('0x23')](_0x796784['query']['offset']);}_0x4386de['order']=qs[_0x7261('0x39')](_0x796784[_0x7261('0x32')]['sort']);_0x4386de[_0x7261('0x3a')]=qs[_0x7261('0x33')](_['pick'](_0x796784['query'],_0x1b3682[_0x7261('0x33')]));if(_0x796784[_0x7261('0x32')][_0x7261('0x3b')]){_0x4386de[_0x7261('0x3a')]=_[_0x7261('0x3c')](_0x4386de[_0x7261('0x3a')],{'$or':_[_0x7261('0x3d')](_0x599125,function(_0xf5c99c){if(_0xf5c99c['type']['key']!==_0x7261('0x3e')){var _0x1f26d0={};_0x1f26d0[_0xf5c99c[_0x7261('0x3f')]]={'$like':'%'+_0x796784[_0x7261('0x32')][_0x7261('0x3b')]+'%'};return _0x1f26d0;}})});}_0x4386de=_[_0x7261('0x3c')]({},_0x4386de,_0x796784[_0x7261('0x40')]);var _0x35376a={'where':_0x4386de[_0x7261('0x3a')]};return db[_0x7261('0x2e')][_0x7261('0x41')](_0x35376a)[_0x7261('0x27')](function(_0x194944){_0x61ae51[_0x7261('0x41')]=_0x194944;if(_0x796784['query'][_0x7261('0x42')]){_0x4386de[_0x7261('0x43')]=[{'all':!![]}];}return db[_0x7261('0x2e')]['findAll'](_0x4386de);})[_0x7261('0x27')](function(_0x468f93){_0x61ae51[_0x7261('0x44')]=_0x468f93;return _0x61ae51;})['then'](respondWithFilteredResult(_0x2e2465,_0x4386de))[_0x7261('0x45')](handleError(_0x2e2465,null));};exports[_0x7261('0x46')]=function(_0x5896b1,_0x501727){var _0x1337e7={'raw':!![],'where':{'id':_0x5896b1[_0x7261('0x47')]['id']}},_0x29a6eb={};_0x29a6eb[_0x7261('0x30')]=_[_0x7261('0x31')](db[_0x7261('0x2e')][_0x7261('0x2f')]);_0x29a6eb[_0x7261('0x32')]=_['keys'](_0x5896b1[_0x7261('0x32')]);_0x29a6eb[_0x7261('0x33')]=_['intersection'](_0x29a6eb[_0x7261('0x30')],_0x29a6eb[_0x7261('0x32')]);_0x1337e7['attributes']=_[_0x7261('0x34')](_0x29a6eb[_0x7261('0x30')],qs[_0x7261('0x35')](_0x5896b1[_0x7261('0x32')]['fields']));_0x1337e7['attributes']=_0x1337e7[_0x7261('0x36')][_0x7261('0x37')]?_0x1337e7['attributes']:_0x29a6eb['model'];if(_0x5896b1[_0x7261('0x32')][_0x7261('0x42')]){_0x1337e7['include']=[{'all':!![]}];}_0x1337e7=_[_0x7261('0x3c')]({},_0x1337e7,_0x5896b1[_0x7261('0x40')]);return db[_0x7261('0x2e')][_0x7261('0x48')](_0x1337e7)[_0x7261('0x27')](handleEntityNotFound(_0x501727,null))['then'](respondWithResult(_0x501727,null))[_0x7261('0x45')](handleError(_0x501727,null));};exports[_0x7261('0x49')]=function(_0x12f383,_0x17c5e0){return db[_0x7261('0x2e')][_0x7261('0x49')](_0x12f383['body'],{})[_0x7261('0x27')](respondWithResult(_0x17c5e0,0xc9))[_0x7261('0x45')](handleError(_0x17c5e0,null));};exports['update']=function(_0x56f3cd,_0x17a249){if(_0x56f3cd[_0x7261('0x4a')]['id']){delete _0x56f3cd[_0x7261('0x4a')]['id'];}return db[_0x7261('0x2e')][_0x7261('0x48')]({'where':{'id':_0x56f3cd[_0x7261('0x47')]['id']}})[_0x7261('0x27')](handleEntityNotFound(_0x17a249,null))['then'](saveUpdates(_0x56f3cd[_0x7261('0x4a')],null))['then'](respondWithResult(_0x17a249,null))[_0x7261('0x45')](handleError(_0x17a249,null));};exports['destroy']=function(_0x364d25,_0x2525c4){return db[_0x7261('0x2e')][_0x7261('0x48')]({'where':{'id':_0x364d25[_0x7261('0x47')]['id']}})[_0x7261('0x27')](handleEntityNotFound(_0x2525c4,null))['then'](removeEntity(_0x2525c4,null))[_0x7261('0x45')](handleError(_0x2525c4,null));};exports[_0x7261('0x4b')]=function(_0x166f3e,_0xc2151b){return db[_0x7261('0x2e')]['describe']()[_0x7261('0x27')](respondWithResult(_0xc2151b,null))[_0x7261('0x45')](handleError(_0xc2151b,null));};function wrapUser(_0xcd39f9){return function(_0x431f88){var _0x35b880=_0xcd39f9['get']({'plain':!![]});_0x35b880[_0x7261('0x4c')]=[];if(_0x431f88){_0x35b880[_0x7261('0x4d')]=_0x431f88[_0x7261('0x4e')];_0x35b880['lastMessage']=_0x431f88;}else{_0x35b880[_0x7261('0x4d')]=moment(0x0)['format'](_0x7261('0x4f'));_0x35b880[_0x7261('0x50')]={};}return _0x35b880;};}exports[_0x7261('0x51')]=function(_0x38615b,_0x59c4bb,_0x5e6637){var _0x38941b=[];return db[_0x7261('0x52')][_0x7261('0x53')]({'where':{'role':[_0x7261('0x54'),_0x7261('0x55'),_0x7261('0x56')]},'attributes':['id',_0x7261('0x57'),_0x7261('0x2b'),_0x7261('0x58'),_0x7261('0x59'),_0x7261('0x5a'),_0x7261('0x5b'),'lastLoginAt','allowmessenger',_0x7261('0x5c')],'order':qs['sort'](_0x7261('0x5d')),'include':[{'model':db[_0x7261('0x5e')],'as':'VoiceQueues','attributes':['id',_0x7261('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x7261('0x27')](function(_0x1b5cd7){if(_0x1b5cd7){var _0x2562ec=_0x38615b['user'][_0x7261('0x5f')]({'plain':!![]});if(!_0x2562ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2562ec[_0x7261('0x58')]==='user'){return db[_0x7261('0x60')][_0x7261('0x48')]({'where':{'name':_0x7261('0x61'),'userProfileId':_0x2562ec['userProfileId']},'raw':!![]})['then'](function(_0x3a7879){if(_0x3a7879){if(_0x3a7879[_0x7261('0x62')]===0x0){return db[_0x7261('0x63')][_0x7261('0x53')]({'where':{'sectionId':_0x3a7879['id']},'raw':!![]})[_0x7261('0x27')](function(_0x404f1c){var _0x30f7ce=[];if(_['isEmpty'](_0x404f1c)){_0x30f7ce=_[_0x7261('0x3b')](_0x1b5cd7,function(_0x1bfc7e){if(_0x1bfc7e[_0x7261('0x58')]!==_0x7261('0x54')){return _0x1bfc7e;}});return _0x30f7ce;}else{for(var _0x2e9c50=0x0;_0x2e9c50<_0x1b5cd7['length'];_0x2e9c50++){var _0x1850e9=_0x1b5cd7[_0x2e9c50];if(_0x1850e9['role']===_0x7261('0x54')){var _0xbf791d=_[_0x7261('0x48')](_0x404f1c,function(_0x25f8d2){return _0x25f8d2[_0x7261('0x64')]===_0x1850e9['id'];});if(_0xbf791d)_0x30f7ce[_0x7261('0x65')](_0x1850e9);}else{_0x30f7ce[_0x7261('0x65')](_0x1850e9);}}return _0x30f7ce;}});}else{return _0x1b5cd7;}}else{var _0x5bc500=_[_0x7261('0x3b')](_0x1b5cd7,function(_0x2fae6b){if(_0x2fae6b['role']!==_0x7261('0x54')){return _0x2fae6b;}});return _0x5bc500;}});}else{return _0x1b5cd7;}}})[_0x7261('0x27')](function(_0x42ed00){var _0x486f3a=[];if(_0x42ed00){_0x38941b=_0x42ed00;for(var _0x1b507c=0x0;_0x1b507c<_0x42ed00['length'];_0x1b507c+=0x1){_0x38941b[_0x1b507c][_0x7261('0x4c')]=[];_0x486f3a[_0x7261('0x65')](db[_0x7261('0x2e')]['find']({'where':{'FromId':[_0x38615b['user']['id'],_0x42ed00[_0x1b507c]['id']],'ToId':[_0x38615b[_0x7261('0x56')]['id'],_0x42ed00[_0x1b507c]['id']],'ChatGroupId':null},'attributes':['id',_0x7261('0x4e'),_0x7261('0x66'),_0x7261('0x67'),'read','body'],'order':qs['sort'](_0x7261('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7261('0x27')](wrapUser(_0x42ed00[_0x1b507c])));}return BPromise['all'](_0x486f3a);}return[];})[_0x7261('0x27')](function(_0x297c2b){return{'rows':_0x297c2b,'count':_0x297c2b[_0x7261('0x37')]};})[_0x7261('0x27')](respondWithResult(_0x59c4bb,null))[_0x7261('0x45')](handleError(_0x59c4bb,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 46500ee..a2f3bd8 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 _0x278d=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x16cdca,_0x478717){var _0x4f5211=function(_0x2b1e12){while(--_0x2b1e12){_0x16cdca['push'](_0x16cdca['shift']());}};_0x4f5211(++_0x478717);}(_0x278d,0xf0));var _0xd278=function(_0x34db7f,_0x3e22f8){_0x34db7f=_0x34db7f-0x0;var _0x509554=_0x278d[_0x34db7f];return _0x509554;};'use strict';var EventEmitter=require(_0xd278('0x0'));var ChatInternalMessage=require(_0xd278('0x1'))['db'][_0xd278('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd278('0x3')](0x0);var events={'afterCreate':_0xd278('0x4'),'afterUpdate':_0xd278('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1bc172){return function(_0x483ec1,_0x1dedb8,_0x1101b6){ChatInternalMessageEvents['emit'](_0x1bc172+':'+_0x483ec1['id'],_0x483ec1);ChatInternalMessageEvents[_0xd278('0x6')](_0x1bc172,_0x483ec1);_0x1101b6(null);};}for(var e in events){if(events[_0xd278('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xaa8f=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x1f6ff8,_0x162dc8){var _0x4cfd78=function(_0x247c3e){while(--_0x247c3e){_0x1f6ff8['push'](_0x1f6ff8['shift']());}};_0x4cfd78(++_0x162dc8);}(_0xaa8f,0xfd));var _0xfaa8=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xaa8f[_0xf2f332];return _0x56cce3;};'use strict';var EventEmitter=require(_0xfaa8('0x0'));var ChatInternalMessage=require(_0xfaa8('0x1'))['db'][_0xfaa8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfaa8('0x3')](0x0);var events={'afterCreate':_0xfaa8('0x4'),'afterUpdate':_0xfaa8('0x5'),'afterDestroy':_0xfaa8('0x6')};function emitEvent(_0x558dbd){return function(_0x1e4cae,_0x1919fd,_0x3e39bd){ChatInternalMessageEvents[_0xfaa8('0x7')](_0x558dbd+':'+_0x1e4cae['id'],_0x1e4cae);ChatInternalMessageEvents[_0xfaa8('0x7')](_0x558dbd,_0x1e4cae);_0x3e39bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xfaa8('0x8')](e,emitEvent(event));}}module[_0xfaa8('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 96bb1c0..4b768aa 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 _0xdc77=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1a4a2b,_0x30d099){var _0x648a9e=function(_0x2b6d18){while(--_0x2b6d18){_0x1a4a2b['push'](_0x1a4a2b['shift']());}};_0x648a9e(++_0x30d099);}(_0xdc77,0x96));var _0x7dc7=function(_0x115c4e,_0x1910ea){_0x115c4e=_0x115c4e-0x0;var _0x4d2645=_0xdc77[_0x115c4e];return _0x4d2645;};'use strict';var _=require(_0x7dc7('0x0'));var util=require(_0x7dc7('0x1'));var logger=require(_0x7dc7('0x2'))(_0x7dc7('0x3'));var moment=require(_0x7dc7('0x4'));var BPromise=require('bluebird');var rp=require(_0x7dc7('0x5'));var attributes=require(_0x7dc7('0x6'));module[_0x7dc7('0x7')]=function(_0x4bb63a,_0x1a4984){return _0x4bb63a[_0x7dc7('0x8')](_0x7dc7('0x9'),attributes,{'tableName':_0x7dc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7dc7('0xb'),'collate':_0x7dc7('0xc')});}; \ No newline at end of file +var _0xd412=['utf8mb4_unicode_ci','lodash','util','request-promise','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x3bb4f7,_0x4548c0){var _0xeee0b=function(_0x26d6a0){while(--_0x26d6a0){_0x3bb4f7['push'](_0x3bb4f7['shift']());}};_0xeee0b(++_0x4548c0);}(_0xd412,0x1e7));var _0x2d41=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0xd412[_0x60878f];return _0x1fbefb;};'use strict';var _=require(_0x2d41('0x0'));var util=require(_0x2d41('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d41('0x2'));var attributes=require(_0x2d41('0x3'));module[_0x2d41('0x4')]=function(_0x4d804d,_0x5c6e46){return _0x4d804d['define'](_0x2d41('0x5'),attributes,{'tableName':_0x2d41('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d41('0x7'),'collate':_0x2d41('0x8')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 3f62f9c..8073e86 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 _0xe6cd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x14a48e,_0x2c7898){var _0x353c19=function(_0x374612){while(--_0x374612){_0x14a48e['push'](_0x14a48e['shift']());}};_0x353c19(++_0x2c7898);}(_0xe6cd,0x159));var _0xde6c=function(_0xe8f2eb,_0x3aef13){_0xe8f2eb=_0xe8f2eb-0x0;var _0x4d75ee=_0xe6cd[_0xe8f2eb];return _0x4d75ee;};'use strict';var _=require(_0xde6c('0x0'));var util=require(_0xde6c('0x1'));var moment=require(_0xde6c('0x2'));var BPromise=require(_0xde6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde6c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xde6c('0x5'))(_0xde6c('0x6'));var config=require(_0xde6c('0x7'));var jayson=require(_0xde6c('0x8'));var client=jayson[_0xde6c('0x9')][_0xde6c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde6c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xde6c('0xc'))(new Redis(config['redis']));require(_0xde6c('0xd'))['register'](socket);function respondWithRpcPromise(_0x69b4b8,_0x2990c7,_0x5bbeba){return new BPromise(function(_0x42f970,_0x316f84){return client['request'](_0x69b4b8,_0x5bbeba)[_0xde6c('0xe')](function(_0x41e511){logger[_0xde6c('0xf')](_0xde6c('0x10'),_0x2990c7,_0xde6c('0x11'));logger[_0xde6c('0x12')](_0xde6c('0x13'),_0x2990c7,_0xde6c('0x11'),JSON[_0xde6c('0x14')](_0x41e511));if(_0x41e511[_0xde6c('0x15')]){if(_0x41e511[_0xde6c('0x15')]['code']===0x1f4){logger['error'](_0xde6c('0x10'),_0x2990c7,_0x41e511[_0xde6c('0x15')][_0xde6c('0x16')]);return _0x316f84(_0x41e511['error'][_0xde6c('0x16')]);}logger[_0xde6c('0x15')](_0xde6c('0x10'),_0x2990c7,_0x41e511[_0xde6c('0x15')][_0xde6c('0x16')]);return _0x42f970(_0x41e511[_0xde6c('0x15')]['message']);}else{logger[_0xde6c('0xf')](_0xde6c('0x10'),_0x2990c7,_0xde6c('0x11'));_0x42f970(_0x41e511[_0xde6c('0x17')][_0xde6c('0x16')]);}})[_0xde6c('0x18')](function(_0x543ac2){logger[_0xde6c('0x15')](_0xde6c('0x10'),_0x2990c7,_0x543ac2);_0x316f84(_0x543ac2);});});} \ No newline at end of file +var _0xadfd=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0xb7ea29,_0x9dd1c3){var _0x4f8458=function(_0x1f6757){while(--_0x1f6757){_0xb7ea29['push'](_0xb7ea29['shift']());}};_0x4f8458(++_0x9dd1c3);}(_0xadfd,0xf0));var _0xdadf=function(_0x56b091,_0x311584){_0x56b091=_0x56b091-0x0;var _0x2ff593=_0xadfd[_0x56b091];return _0x2ff593;};'use strict';var _=require(_0xdadf('0x0'));var util=require(_0xdadf('0x1'));var moment=require(_0xdadf('0x2'));var BPromise=require(_0xdadf('0x3'));var rs=require(_0xdadf('0x4'));var fs=require('fs');var Redis=require(_0xdadf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdadf('0x6'))(_0xdadf('0x7'));var config=require(_0xdadf('0x8'));var jayson=require(_0xdadf('0x9'));var client=jayson[_0xdadf('0xa')]['http']({'port':0x232a});config[_0xdadf('0xb')]=_[_0xdadf('0xc')](config['redis'],{'host':_0xdadf('0xd'),'port':0x18eb});var socket=require(_0xdadf('0xe'))(new Redis(config[_0xdadf('0xb')]));require(_0xdadf('0xf'))[_0xdadf('0x10')](socket);function respondWithRpcPromise(_0x29d12c,_0x39e4ee,_0x338ffe){return new BPromise(function(_0x1401ee,_0x22f80a){return client[_0xdadf('0x11')](_0x29d12c,_0x338ffe)[_0xdadf('0x12')](function(_0xff4738){logger[_0xdadf('0x13')](_0xdadf('0x14'),_0x39e4ee,_0xdadf('0x15'));logger['debug'](_0xdadf('0x16'),_0x39e4ee,'request\x20sent',JSON[_0xdadf('0x17')](_0xff4738));if(_0xff4738[_0xdadf('0x18')]){if(_0xff4738[_0xdadf('0x18')][_0xdadf('0x19')]===0x1f4){logger[_0xdadf('0x18')](_0xdadf('0x14'),_0x39e4ee,_0xff4738[_0xdadf('0x18')]['message']);return _0x22f80a(_0xff4738['error']['message']);}logger[_0xdadf('0x18')](_0xdadf('0x14'),_0x39e4ee,_0xff4738['error'][_0xdadf('0x1a')]);return _0x1401ee(_0xff4738[_0xdadf('0x18')][_0xdadf('0x1a')]);}else{logger[_0xdadf('0x13')](_0xdadf('0x14'),_0x39e4ee,_0xdadf('0x15'));_0x1401ee(_0xff4738['result'][_0xdadf('0x1a')]);}})['catch'](function(_0x2bdeda){logger[_0xdadf('0x18')](_0xdadf('0x14'),_0x39e4ee,_0x2bdeda);_0x22f80a(_0x2bdeda);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 04aaf70..1a6d302 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 _0x38f0=['save','remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x38f0,0x131));var _0x038f=function(_0x3d7178,_0x2547f8){_0x3d7178=_0x3d7178-0x0;var _0x418a19=_0x38f0[_0x3d7178];return _0x418a19;};'use strict';var ChatInternalMessageEvents=require(_0x038f('0x0'));var events=[_0x038f('0x1'),_0x038f('0x2'),_0x038f('0x3')];function createListener(_0x42cb15,_0x368913){return function(_0x4c79ff){_0x368913[_0x038f('0x4')](_0x42cb15,_0x4c79ff);};}function removeListener(_0x497362,_0x84d5a4){return function(){ChatInternalMessageEvents[_0x038f('0x5')](_0x497362,_0x84d5a4);};}exports[_0x038f('0x6')]=function(_0x12a380){for(var _0x44769d=0x0,_0x33ca97=events[_0x038f('0x7')];_0x44769d<_0x33ca97;_0x44769d++){var _0x2d1dda=events[_0x44769d];var _0x47e873=createListener(_0x038f('0x8')+_0x2d1dda,_0x12a380);ChatInternalMessageEvents['on'](_0x2d1dda,_0x47e873);}}; \ No newline at end of file +var _0x0e51=['./chatInternalMessage.events','save','removeListener','register','length'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0e51,0xd7));var _0x10e5=function(_0x471427,_0x4de5bf){_0x471427=_0x471427-0x0;var _0x517228=_0x0e51[_0x471427];return _0x517228;};'use strict';var ChatInternalMessageEvents=require(_0x10e5('0x0'));var events=[_0x10e5('0x1'),'remove','update'];function createListener(_0x5c565c,_0x192c28){return function(_0x187586){_0x192c28['emit'](_0x5c565c,_0x187586);};}function removeListener(_0x3384f2,_0x586651){return function(){ChatInternalMessageEvents[_0x10e5('0x2')](_0x3384f2,_0x586651);};}exports[_0x10e5('0x3')]=function(_0x1ce002){for(var _0x2e0810=0x0,_0xc50581=events[_0x10e5('0x4')];_0x2e0810<_0xc50581;_0x2e0810++){var _0x442377=events[_0x2e0810];var _0x1e2f66=createListener('chatInternalMessage:'+_0x442377,_0x1ce002);ChatInternalMessageEvents['on'](_0x442377,_0x1e2f66);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8af3dbc..eec417c 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 _0x598a=['util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','/users','getUsers','/:id','post','create','put','delete','exports','multer'];(function(_0x12d449,_0x38e73d){var _0x29ecc9=function(_0x802db9){while(--_0x802db9){_0x12d449['push'](_0x12d449['shift']());}};_0x29ecc9(++_0x38e73d);}(_0x598a,0xfb));var _0xa598=function(_0xa7212c,_0x178453){_0xa7212c=_0xa7212c-0x0;var _0x2e7abf=_0x598a[_0xa7212c];return _0x2e7abf;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express['Router']();var auth=require(_0xa598('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xa598('0x6')]('/',auth[_0xa598('0x7')](),controller[_0xa598('0x8')]);router[_0xa598('0x6')](_0xa598('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xa598('0x6')](_0xa598('0xa'),auth[_0xa598('0x7')](),controller[_0xa598('0xb')]);router[_0xa598('0x6')](_0xa598('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa598('0xd')]('/',auth[_0xa598('0x7')](),controller[_0xa598('0xe')]);router[_0xa598('0xf')](_0xa598('0xc'),controller['update']);router[_0xa598('0x10')](_0xa598('0xc'),auth[_0xa598('0x7')](),controller['destroy']);module[_0xa598('0x11')]=router; \ No newline at end of file +var _0x908d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/users','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0xd403d3,_0x2e2d89){var _0x141543=function(_0x49e189){while(--_0x49e189){_0xd403d3['push'](_0xd403d3['shift']());}};_0x141543(++_0x2e2d89);}(_0x908d,0x176));var _0xd908=function(_0x39f764,_0x3faa45){_0x39f764=_0x39f764-0x0;var _0x58353c=_0x908d[_0x39f764];return _0x58353c;};'use strict';var multer=require(_0xd908('0x0'));var util=require('util');var path=require(_0xd908('0x1'));var timeout=require(_0xd908('0x2'));var express=require('express');var router=express[_0xd908('0x3')]();var auth=require(_0xd908('0x4'));var interaction=require(_0xd908('0x5'));var config=require(_0xd908('0x6'));var controller=require(_0xd908('0x7'));router['get']('/',auth[_0xd908('0x8')](),controller[_0xd908('0x9')]);router[_0xd908('0xa')]('/describe',auth[_0xd908('0x8')](),controller['describe']);router[_0xd908('0xa')](_0xd908('0xb'),auth[_0xd908('0x8')](),controller[_0xd908('0xc')]);router[_0xd908('0xa')](_0xd908('0xd'),auth['isAuthenticated'](),controller[_0xd908('0xe')]);router['post']('/',auth[_0xd908('0x8')](),controller[_0xd908('0xf')]);router[_0xd908('0x10')]('/:id',controller[_0xd908('0x11')]);router[_0xd908('0x12')](_0xd908('0xd'),auth[_0xd908('0x8')](),controller[_0xd908('0x13')]);module[_0xd908('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index eb46c7b..6882dfb 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 _0xed38=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed38,0x1a6));var _0x8ed3=function(_0x4183af,_0x17c0cc){_0x4183af=_0x4183af-0x0;var _0x238c03=_0xed38[_0x4183af];return _0x238c03;};'use strict';var Sequelize=require(_0x8ed3('0x0'));module[_0x8ed3('0x1')]={'body':{'type':Sequelize[_0x8ed3('0x2')](_0x8ed3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8ed3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ed3('0x5')]('in',_0x8ed3('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8ed3('0x7')]}}; \ No newline at end of file +var _0x2a25=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x2a25,0xce));var _0x52a2=function(_0x3ec135,_0x5323b9){_0x3ec135=_0x3ec135-0x0;var _0x47327a=_0x2a25[_0x3ec135];return _0x47327a;};'use strict';var Sequelize=require(_0x52a2('0x0'));module[_0x52a2('0x1')]={'body':{'type':Sequelize[_0x52a2('0x2')](_0x52a2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x52a2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x52a2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x52a2('0x5')]('in',_0x52a2('0x6')),'defaultValue':_0x52a2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x52a2('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 298a4e6..015717d 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 _0x6d3d=['count','offset','Content-Range','update','then','destroy','stack','name','send','index','ChatMessage','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','merge','key','VIRTUAL','field','includeAll','include','findAll','rows','params','rawAttributes','body','find','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','manual','interface','format','SIP/%s','channel','EventManager','acceptmessage','parse','formData','reject','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json'];(function(_0x12a06b,_0x417b51){var _0x5d0bb8=function(_0x41d3d0){while(--_0x41d3d0){_0x12a06b['push'](_0x12a06b['shift']());}};_0x5d0bb8(++_0x417b51);}(_0x6d3d,0x12e));var _0xd6d3=function(_0x5123a4,_0x2e39a1){_0x5123a4=_0x5123a4-0x0;var _0x1085ee=_0x6d3d[_0x5123a4];return _0x1085ee;};'use strict';var pdf=require(_0xd6d3('0x0'));var emlformat=require(_0xd6d3('0x1'));var rimraf=require(_0xd6d3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6d3('0x3'));var rp=require('request-promise');var moment=require(_0xd6d3('0x4'));var BPromise=require(_0xd6d3('0x5'));var Mustache=require(_0xd6d3('0x6'));var util=require(_0xd6d3('0x7'));var path=require(_0xd6d3('0x8'));var sox=require(_0xd6d3('0x9'));var csv=require(_0xd6d3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd6d3('0xb'));var squel=require(_0xd6d3('0xc'));var crypto=require('crypto');var jsforce=require(_0xd6d3('0xd'));var deskjs=require(_0xd6d3('0xe'));var toCsv=require(_0xd6d3('0xa'));var querystring=require(_0xd6d3('0xf'));var Papa=require(_0xd6d3('0x10'));var authService=require(_0xd6d3('0x11'));var hardwareService=require(_0xd6d3('0x12'));var Redis=require(_0xd6d3('0x13'));var qs=require(_0xd6d3('0x14'));var logger=require(_0xd6d3('0x15'))('api');var utils=require(_0xd6d3('0x16'));var config=require(_0xd6d3('0x17'));var db=require(_0xd6d3('0x18'))['db'];config[_0xd6d3('0x19')]=_[_0xd6d3('0x1a')](config[_0xd6d3('0x19')],{'host':_0xd6d3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6d3('0x19')]));require(_0xd6d3('0x1c'))['register'](socket);var jayson=require(_0xd6d3('0x1d'));var client=jayson[_0xd6d3('0x1e')][_0xd6d3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xd6d3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x244a17,_0x474943,_0x5985f4,_0x7b5731){return new BPromise(function(_0x468aa0,_0x4f09eb){var _0x4d40ac=_0x7b5731||client;return _0x4d40ac[_0xd6d3('0x20')](_0x244a17,_0x5985f4)['then'](function(_0x3eb6e0){logger[_0xd6d3('0x21')]('ChatMessage,\x20%s,\x20%s',_0x474943,_0xd6d3('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x474943,_0xd6d3('0x22'),JSON[_0xd6d3('0x23')](_0x3eb6e0));if(_0x3eb6e0[_0xd6d3('0x24')]){if(_0x3eb6e0[_0xd6d3('0x24')][_0xd6d3('0x25')]===0x1f4){logger[_0xd6d3('0x24')](_0xd6d3('0x26'),_0x474943,_0x3eb6e0[_0xd6d3('0x24')][_0xd6d3('0x27')]);return _0x4f09eb(_0x3eb6e0[_0xd6d3('0x24')][_0xd6d3('0x27')]);}logger[_0xd6d3('0x24')]('ChatMessage,\x20%s,\x20%s',_0x474943,_0x3eb6e0[_0xd6d3('0x24')]['message']);return _0x468aa0(_0x3eb6e0[_0xd6d3('0x24')][_0xd6d3('0x27')]);}else{logger[_0xd6d3('0x21')](_0xd6d3('0x26'),_0x474943,_0xd6d3('0x22'));_0x468aa0(_0x3eb6e0[_0xd6d3('0x28')][_0xd6d3('0x27')]);}})[_0xd6d3('0x29')](function(_0x150804){logger['error'](_0xd6d3('0x26'),_0x474943,_0x150804);_0x4f09eb(_0x150804);});});}function respondWithStatusCode(_0x998dee,_0x354c13){_0x354c13=_0x354c13||0xcc;return function(_0x13b03e){if(_0x13b03e){return _0x998dee[_0xd6d3('0x2a')](_0x354c13);}return _0x998dee[_0xd6d3('0x2b')](_0x354c13)[_0xd6d3('0x2c')]();};}function respondWithResult(_0x47bd90,_0x91eb59){_0x91eb59=_0x91eb59||0xc8;return function(_0x8dce69){if(_0x8dce69){return _0x47bd90['status'](_0x91eb59)[_0xd6d3('0x2d')](_0x8dce69);}};}function respondWithFilteredResult(_0x1ce0b5,_0x2f313d){return function(_0x27f039){if(_0x27f039){var _0xe454ef=_0x27f039[_0xd6d3('0x2e')],_0x50d396=_0x2f313d[_0xd6d3('0x2f')],_0x4bc682=_0x2f313d[_0xd6d3('0x2f')]+_0x2f313d['limit'],_0x1f3fc6;if(_0x4bc682>=_0xe454ef){_0x4bc682=_0xe454ef;_0x1f3fc6=0xc8;}else{_0x1f3fc6=0xce;}_0x1ce0b5[_0xd6d3('0x2b')](_0x1f3fc6);return _0x1ce0b5['set'](_0xd6d3('0x30'),_0x50d396+'-'+_0x4bc682+'/'+_0xe454ef)[_0xd6d3('0x2d')](_0x27f039);}return null;};}function patchUpdates(_0x583ed1){return function(_0x2f88c9){try{jsonpatch['apply'](_0x2f88c9,_0x583ed1,!![]);}catch(_0x19d9a7){return BPromise['reject'](_0x19d9a7);}return _0x2f88c9['save']();};}function saveUpdates(_0x3f9396,_0x27f298){return function(_0x37e947){if(_0x37e947){return _0x37e947[_0xd6d3('0x31')](_0x3f9396)[_0xd6d3('0x32')](function(_0xeda09c){return _0xeda09c;});}return null;};}function removeEntity(_0x338908,_0x450a24){return function(_0x5b6952){if(_0x5b6952){return _0x5b6952[_0xd6d3('0x33')]()[_0xd6d3('0x32')](function(){_0x338908['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7918,_0x4531ea){return function(_0x48c5a8){if(!_0x48c5a8){_0x5e7918[_0xd6d3('0x2a')](0x194);}return _0x48c5a8;};}function handleError(_0x4dd1b5,_0xcc5c2e){_0xcc5c2e=_0xcc5c2e||0x1f4;return function(_0x289aaf){logger['error'](_0x289aaf[_0xd6d3('0x34')]);if(_0x289aaf[_0xd6d3('0x35')]){delete _0x289aaf[_0xd6d3('0x35')];}_0x4dd1b5[_0xd6d3('0x2b')](_0xcc5c2e)[_0xd6d3('0x36')](_0x289aaf);};}exports[_0xd6d3('0x37')]=function(_0x3b6f81,_0x5479ed){var _0x513219={},_0x58517d={},_0x41dc4a={'count':0x0,'rows':[]};var _0x5a871a=db[_0xd6d3('0x38')]['rawAttributes'];_0x58517d[_0xd6d3('0x39')]=_[_0xd6d3('0x3a')](_0x5a871a);_0x58517d[_0xd6d3('0x3b')]=_[_0xd6d3('0x3a')](_0x3b6f81[_0xd6d3('0x3b')]);_0x58517d['filters']=_[_0xd6d3('0x3c')](_0x58517d[_0xd6d3('0x39')],_0x58517d[_0xd6d3('0x3b')]);_0x513219[_0xd6d3('0x3d')]=_[_0xd6d3('0x3c')](_0x58517d[_0xd6d3('0x39')],qs[_0xd6d3('0x3e')](_0x3b6f81['query'][_0xd6d3('0x3e')]));_0x513219[_0xd6d3('0x3d')]=_0x513219[_0xd6d3('0x3d')][_0xd6d3('0x3f')]?_0x513219[_0xd6d3('0x3d')]:_0x58517d[_0xd6d3('0x39')];if(!_0x3b6f81[_0xd6d3('0x3b')][_0xd6d3('0x40')](_0xd6d3('0x41'))){_0x513219[_0xd6d3('0x42')]=qs['limit'](_0x3b6f81['query'][_0xd6d3('0x42')]);_0x513219['offset']=qs[_0xd6d3('0x2f')](_0x3b6f81['query'][_0xd6d3('0x2f')]);}_0x513219['order']=qs[_0xd6d3('0x43')](_0x3b6f81[_0xd6d3('0x3b')][_0xd6d3('0x43')]);_0x513219[_0xd6d3('0x44')]=qs['filters'](_['pick'](_0x3b6f81['query'],_0x58517d[_0xd6d3('0x45')]));if(_0x3b6f81[_0xd6d3('0x3b')]['filter']){_0x513219['where']=_[_0xd6d3('0x46')](_0x513219[_0xd6d3('0x44')],{'$or':_['map'](_0x5a871a,function(_0x343541){if(_0x343541['type'][_0xd6d3('0x47')]!==_0xd6d3('0x48')){var _0x390459={};_0x390459[_0x343541[_0xd6d3('0x49')]]={'$like':'%'+_0x3b6f81[_0xd6d3('0x3b')]['filter']+'%'};return _0x390459;}})});}_0x513219=_[_0xd6d3('0x46')]({},_0x513219,_0x3b6f81['options']);var _0x25dd7c={'where':_0x513219[_0xd6d3('0x44')]};return db[_0xd6d3('0x38')][_0xd6d3('0x2e')](_0x25dd7c)[_0xd6d3('0x32')](function(_0x2ba74d){_0x41dc4a[_0xd6d3('0x2e')]=_0x2ba74d;if(_0x3b6f81[_0xd6d3('0x3b')][_0xd6d3('0x4a')]){_0x513219[_0xd6d3('0x4b')]=[{'all':!![]}];}return db['ChatMessage'][_0xd6d3('0x4c')](_0x513219);})[_0xd6d3('0x32')](function(_0xf6445b){_0x41dc4a[_0xd6d3('0x4d')]=_0xf6445b;return _0x41dc4a;})[_0xd6d3('0x32')](respondWithFilteredResult(_0x5479ed,_0x513219))[_0xd6d3('0x29')](handleError(_0x5479ed,null));};exports['show']=function(_0xb63c3d,_0x16964f){var _0x3332c2={'raw':!![],'where':{'id':_0xb63c3d[_0xd6d3('0x4e')]['id']}},_0x5a7d9b={};_0x5a7d9b[_0xd6d3('0x39')]=_[_0xd6d3('0x3a')](db[_0xd6d3('0x38')][_0xd6d3('0x4f')]);_0x5a7d9b[_0xd6d3('0x3b')]=_[_0xd6d3('0x3a')](_0xb63c3d['query']);_0x5a7d9b[_0xd6d3('0x45')]=_[_0xd6d3('0x3c')](_0x5a7d9b[_0xd6d3('0x39')],_0x5a7d9b[_0xd6d3('0x3b')]);_0x3332c2['attributes']=_[_0xd6d3('0x3c')](_0x5a7d9b['model'],qs[_0xd6d3('0x3e')](_0xb63c3d[_0xd6d3('0x3b')][_0xd6d3('0x3e')]));_0x3332c2[_0xd6d3('0x3d')]=_0x3332c2[_0xd6d3('0x3d')]['length']?_0x3332c2[_0xd6d3('0x3d')]:_0x5a7d9b['model'];if(_0xb63c3d['query'][_0xd6d3('0x4a')]){_0x3332c2[_0xd6d3('0x4b')]=[{'all':!![]}];}_0x3332c2=_[_0xd6d3('0x46')]({},_0x3332c2,_0xb63c3d['options']);return db[_0xd6d3('0x38')]['find'](_0x3332c2)['then'](handleEntityNotFound(_0x16964f,null))[_0xd6d3('0x32')](respondWithResult(_0x16964f,null))[_0xd6d3('0x29')](handleError(_0x16964f,null));};exports['create']=function(_0x3fd249,_0x311509){return db['ChatMessage']['create'](_0x3fd249['body'],{})['then'](respondWithResult(_0x311509,0xc9))['catch'](handleError(_0x311509,null));};exports[_0xd6d3('0x31')]=function(_0x562bbf,_0xdd2ac7){if(_0x562bbf[_0xd6d3('0x50')]['id']){delete _0x562bbf[_0xd6d3('0x50')]['id'];}return db[_0xd6d3('0x38')][_0xd6d3('0x51')]({'where':{'id':_0x562bbf['params']['id']}})['then'](handleEntityNotFound(_0xdd2ac7,null))[_0xd6d3('0x32')](saveUpdates(_0x562bbf[_0xd6d3('0x50')],null))[_0xd6d3('0x32')](respondWithResult(_0xdd2ac7,null))['catch'](handleError(_0xdd2ac7,null));};exports[_0xd6d3('0x33')]=function(_0x555013,_0x5182ff){return db[_0xd6d3('0x38')][_0xd6d3('0x51')]({'where':{'id':_0x555013['params']['id']}})['then'](handleEntityNotFound(_0x5182ff,null))[_0xd6d3('0x32')](removeEntity(_0x5182ff,null))[_0xd6d3('0x29')](handleError(_0x5182ff,null));};exports[_0xd6d3('0x52')]=function(_0x42f075,_0x5b4adf){return db[_0xd6d3('0x38')][_0xd6d3('0x52')]()[_0xd6d3('0x32')](respondWithResult(_0x5b4adf,null))[_0xd6d3('0x29')](handleError(_0x5b4adf,null));};var interaction_log=require(_0xd6d3('0x15'))(_0xd6d3('0x53'));exports[_0xd6d3('0x54')]=function(_0x18c49b,_0x2ed3a8,_0x5caf2b){var _0x37e556={'channel':_0xd6d3('0x55')};if(_0x18c49b['body']['id']){delete _0x18c49b[_0xd6d3('0x50')]['id'];}_0x18c49b[_0xd6d3('0x50')]['read']=!![];_0x18c49b[_0xd6d3('0x50')][_0xd6d3('0x56')]=moment()['format'](_0xd6d3('0x57'));_0x18c49b[_0xd6d3('0x50')][_0xd6d3('0x58')]=_0x18c49b['body'][_0xd6d3('0x58')]||_0x18c49b[_0xd6d3('0x59')]['id'];return db[_0xd6d3('0x38')][_0xd6d3('0x51')]({'where':{'id':_0x18c49b[_0xd6d3('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0xd6d3('0x5a')],'as':_0xd6d3('0x5b')}]})['then'](handleEntityNotFound(_0x2ed3a8,null))['then'](saveUpdates(_0x18c49b[_0xd6d3('0x50')],null))['then'](function(_0x3cb6fc){if(_0x3cb6fc){_0x37e556['message']=_0x3cb6fc[_0xd6d3('0x5c')]({'plain':!![]});return db[_0xd6d3('0x5d')]['find']({'where':{'id':_0x3cb6fc[_0xd6d3('0x5e')]}});}return null;})[_0xd6d3('0x32')](handleEntityNotFound(_0x2ed3a8,null))[_0xd6d3('0x32')](function(_0x509bce){if(_0x509bce){return _0x509bce['update']({'UserId':_0x18c49b[_0xd6d3('0x50')][_0xd6d3('0x58')],'read1stAt':_[_0xd6d3('0x5f')](_0x509bce[_0xd6d3('0x60')])?moment()['format'](_0xd6d3('0x57')):undefined});}return null;})[_0xd6d3('0x32')](function(_0x1d51ac){if(_0x1d51ac){_0x37e556[_0xd6d3('0x61')]=_0x1d51ac[_0xd6d3('0x5c')]({'plain':!![]});interaction_log[_0xd6d3('0x21')](_0xd6d3('0x62'),_0x18c49b[_0xd6d3('0x59')]['id'],_0x18c49b[_0xd6d3('0x59')][_0xd6d3('0x35')],_0x18c49b[_0xd6d3('0x59')][_0xd6d3('0x63')],_0x37e556[_0xd6d3('0x61')]['id'],_0x18c49b['body']?JSON[_0xd6d3('0x23')](_0x18c49b[_0xd6d3('0x50')]):_0xd6d3('0x64'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x37e556);}return null;})[_0xd6d3('0x32')](function(_0x4cb937){if(_0x4cb937){if(_0x18c49b[_0xd6d3('0x50')][_0xd6d3('0x65')]){_0x37e556[_0xd6d3('0x27')][_0xd6d3('0x66')]=util[_0xd6d3('0x67')](_0xd6d3('0x68'),_0x18c49b[_0xd6d3('0x59')][_0xd6d3('0x35')]);_0x37e556['message'][_0xd6d3('0x69')]=_0x37e556[_0xd6d3('0x69')];_0x37e556['message']['event']=_0xd6d3('0x54');return respondWithRpcPromise(_0xd6d3('0x6a'),'EventManager',{'event':_0xd6d3('0x6b'),'message':_[_0xd6d3('0x46')](_0x37e556[_0xd6d3('0x27')],JSON[_0xd6d3('0x6c')](_0x37e556[_0xd6d3('0x61')][_0xd6d3('0x6d')]))},client9002)[_0xd6d3('0x32')](function(){return _0x37e556;});}return _0x37e556;}return null;})[_0xd6d3('0x32')](respondWithResult(_0x2ed3a8,null))[_0xd6d3('0x29')](handleError(_0x2ed3a8,null));};var interaction_log=require(_0xd6d3('0x15'))(_0xd6d3('0x53'));exports[_0xd6d3('0x6e')]=function(_0x4b1506,_0x4596e6,_0x2b8f12){var _0x39f58e={'agent':{},'channel':_0xd6d3('0x55')};if(_0x4b1506['body']['id']){delete _0x4b1506[_0xd6d3('0x50')]['id'];}_0x4b1506[_0xd6d3('0x50')][_0xd6d3('0x58')]=_0x4b1506[_0xd6d3('0x50')]['UserId']||_0x4b1506[_0xd6d3('0x59')]['id'];_0x39f58e[_0xd6d3('0x6f')]['id']=_0x4b1506[_0xd6d3('0x50')][_0xd6d3('0x58')];return db[_0xd6d3('0x38')][_0xd6d3('0x51')]({'where':{'id':_0x4b1506['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4596e6,null))[_0xd6d3('0x32')](function(_0x2e2428){if(_0x2e2428){_0x39f58e[_0xd6d3('0x27')]=_0x2e2428[_0xd6d3('0x5c')]({'plain':!![]});return db[_0xd6d3('0x5d')][_0xd6d3('0x51')]({'where':{'id':_0x2e2428[_0xd6d3('0x5e')]}});}return null;})[_0xd6d3('0x32')](handleEntityNotFound(_0x4596e6,null))['then'](function(_0x5e890f){if(_0x5e890f){_0x39f58e[_0xd6d3('0x61')]=_0x5e890f['get']({'plain':!![]});interaction_log['info'](_0xd6d3('0x70'),_0x4b1506['user']['id'],_0x4b1506[_0xd6d3('0x59')][_0xd6d3('0x35')],_0x4b1506[_0xd6d3('0x59')][_0xd6d3('0x63')],_0x39f58e[_0xd6d3('0x61')]['id'],_0x4b1506[_0xd6d3('0x50')]?JSON[_0xd6d3('0x23')](_0x4b1506[_0xd6d3('0x50')]):_0xd6d3('0x64'));return respondWithRpcPromise(_0xd6d3('0x71'),_0xd6d3('0x72'),_0x39f58e);}return null;})[_0xd6d3('0x32')](function(_0x383235){if(_0x383235){_0x383235[_0xd6d3('0x27')][_0xd6d3('0x66')]=util[_0xd6d3('0x67')](_0xd6d3('0x68'),_0x4b1506[_0xd6d3('0x59')]['name']);_0x383235[_0xd6d3('0x27')][_0xd6d3('0x69')]=_0x39f58e[_0xd6d3('0x69')];_0x383235[_0xd6d3('0x27')]['event']=_0xd6d3('0x6e');respondWithRpcPromise(_0xd6d3('0x6a'),_0xd6d3('0x6a'),{'event':_0xd6d3('0x73'),'message':_0x383235[_0xd6d3('0x27')]},client9002);return _0x39f58e;}return null;})[_0xd6d3('0x32')](respondWithResult(_0x4596e6,null))['catch'](handleError(_0x4596e6,null));}; \ No newline at end of file +var _0x60ce=['redis','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','Content-Range','reject','save','then','sendStatus','stack','name','send','index','ChatMessage','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','count','includeAll','findAll','show','params','keys','length','include','options','find','create','body','update','destroy','describe','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','manual','interface','channel','accept','EventManager','parse','formData','chat-interactions','agent','null','RejectMessage','rejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter'];(function(_0x1990ae,_0x110739){var _0x3f5d55=function(_0x55ca8d){while(--_0x55ca8d){_0x1990ae['push'](_0x1990ae['shift']());}};_0x3f5d55(++_0x110739);}(_0x60ce,0xd8));var _0xe60c=function(_0x4138c0,_0x4a0469){_0x4138c0=_0x4138c0-0x0;var _0x5a78f8=_0x60ce[_0x4138c0];return _0x5a78f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe60c('0x0'));var rimraf=require(_0xe60c('0x1'));var zipdir=require(_0xe60c('0x2'));var jsonpatch=require(_0xe60c('0x3'));var rp=require(_0xe60c('0x4'));var moment=require('moment');var BPromise=require(_0xe60c('0x5'));var Mustache=require(_0xe60c('0x6'));var util=require(_0xe60c('0x7'));var path=require(_0xe60c('0x8'));var sox=require(_0xe60c('0x9'));var csv=require(_0xe60c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe60c('0xb'));var jsforce=require(_0xe60c('0xc'));var deskjs=require(_0xe60c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe60c('0xe'));var Papa=require(_0xe60c('0xf'));var authService=require(_0xe60c('0x10'));var hardwareService=require(_0xe60c('0x11'));var Redis=require('ioredis');var qs=require(_0xe60c('0x12'));var logger=require(_0xe60c('0x13'))('api');var utils=require(_0xe60c('0x14'));var config=require(_0xe60c('0x15'));var db=require(_0xe60c('0x16'))['db'];config['redis']=_[_0xe60c('0x17')](config['redis'],{'host':_0xe60c('0x18'),'port':0x18eb});var socket=require(_0xe60c('0x19'))(new Redis(config[_0xe60c('0x1a')]));require(_0xe60c('0x1b'))[_0xe60c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe60c('0x1d')][_0xe60c('0x1e')]({'port':0x232c});var client9002=jayson[_0xe60c('0x1d')][_0xe60c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3cf4f8,_0x4796b7,_0x3a39c8,_0x24fb82){return new BPromise(function(_0x222cf5,_0x27b458){var _0x113429=_0x24fb82||client;return _0x113429[_0xe60c('0x1f')](_0x3cf4f8,_0x3a39c8)['then'](function(_0x22e581){logger[_0xe60c('0x20')](_0xe60c('0x21'),_0x4796b7,_0xe60c('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4796b7,_0xe60c('0x22'),JSON[_0xe60c('0x23')](_0x22e581));if(_0x22e581['error']){if(_0x22e581[_0xe60c('0x24')][_0xe60c('0x25')]===0x1f4){logger['error'](_0xe60c('0x21'),_0x4796b7,_0x22e581['error'][_0xe60c('0x26')]);return _0x27b458(_0x22e581[_0xe60c('0x24')]['message']);}logger[_0xe60c('0x24')](_0xe60c('0x21'),_0x4796b7,_0x22e581[_0xe60c('0x24')]['message']);return _0x222cf5(_0x22e581[_0xe60c('0x24')][_0xe60c('0x26')]);}else{logger['info'](_0xe60c('0x21'),_0x4796b7,_0xe60c('0x22'));_0x222cf5(_0x22e581[_0xe60c('0x27')][_0xe60c('0x26')]);}})[_0xe60c('0x28')](function(_0x3c6506){logger['error'](_0xe60c('0x21'),_0x4796b7,_0x3c6506);_0x27b458(_0x3c6506);});});}function respondWithStatusCode(_0x5e35c0,_0x160aba){_0x160aba=_0x160aba||0xcc;return function(_0x510940){if(_0x510940){return _0x5e35c0['sendStatus'](_0x160aba);}return _0x5e35c0['status'](_0x160aba)[_0xe60c('0x29')]();};}function respondWithResult(_0x5c8cb3,_0x3b26f3){_0x3b26f3=_0x3b26f3||0xc8;return function(_0x435243){if(_0x435243){return _0x5c8cb3[_0xe60c('0x2a')](_0x3b26f3)[_0xe60c('0x2b')](_0x435243);}};}function respondWithFilteredResult(_0x141fb0,_0x2e3dab){return function(_0x528220){if(_0x528220){var _0x344166=_0x528220['count'],_0x3ddab9=_0x2e3dab[_0xe60c('0x2c')],_0x5e0a12=_0x2e3dab[_0xe60c('0x2c')]+_0x2e3dab['limit'],_0x2394db;if(_0x5e0a12>=_0x344166){_0x5e0a12=_0x344166;_0x2394db=0xc8;}else{_0x2394db=0xce;}_0x141fb0[_0xe60c('0x2a')](_0x2394db);return _0x141fb0['set'](_0xe60c('0x2d'),_0x3ddab9+'-'+_0x5e0a12+'/'+_0x344166)[_0xe60c('0x2b')](_0x528220);}return null;};}function patchUpdates(_0x553197){return function(_0x4f76b6){try{jsonpatch['apply'](_0x4f76b6,_0x553197,!![]);}catch(_0x1ec2c2){return BPromise[_0xe60c('0x2e')](_0x1ec2c2);}return _0x4f76b6[_0xe60c('0x2f')]();};}function saveUpdates(_0x11d4ac,_0x1f3e4c){return function(_0x4e2ccd){if(_0x4e2ccd){return _0x4e2ccd['update'](_0x11d4ac)['then'](function(_0x54a29c){return _0x54a29c;});}return null;};}function removeEntity(_0x2b28a6,_0x221a83){return function(_0x53215d){if(_0x53215d){return _0x53215d['destroy']()[_0xe60c('0x30')](function(){_0x2b28a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x212985,_0x42f873){return function(_0x3b5c3b){if(!_0x3b5c3b){_0x212985[_0xe60c('0x31')](0x194);}return _0x3b5c3b;};}function handleError(_0x1310f7,_0x297c45){_0x297c45=_0x297c45||0x1f4;return function(_0x59f2d4){logger[_0xe60c('0x24')](_0x59f2d4[_0xe60c('0x32')]);if(_0x59f2d4['name']){delete _0x59f2d4[_0xe60c('0x33')];}_0x1310f7[_0xe60c('0x2a')](_0x297c45)[_0xe60c('0x34')](_0x59f2d4);};}exports[_0xe60c('0x35')]=function(_0x161dac,_0x39e5a4){var _0x49f82e={},_0x2a53fd={},_0x318d06={'count':0x0,'rows':[]};var _0xdf64eb=db[_0xe60c('0x36')][_0xe60c('0x37')];_0x2a53fd['model']=_['keys'](_0xdf64eb);_0x2a53fd[_0xe60c('0x38')]=_['keys'](_0x161dac['query']);_0x2a53fd[_0xe60c('0x39')]=_[_0xe60c('0x3a')](_0x2a53fd[_0xe60c('0x3b')],_0x2a53fd[_0xe60c('0x38')]);_0x49f82e[_0xe60c('0x3c')]=_[_0xe60c('0x3a')](_0x2a53fd[_0xe60c('0x3b')],qs[_0xe60c('0x3d')](_0x161dac['query'][_0xe60c('0x3d')]));_0x49f82e[_0xe60c('0x3c')]=_0x49f82e['attributes']['length']?_0x49f82e[_0xe60c('0x3c')]:_0x2a53fd['model'];if(!_0x161dac['query'][_0xe60c('0x3e')](_0xe60c('0x3f'))){_0x49f82e[_0xe60c('0x40')]=qs['limit'](_0x161dac[_0xe60c('0x38')]['limit']);_0x49f82e[_0xe60c('0x2c')]=qs[_0xe60c('0x2c')](_0x161dac[_0xe60c('0x38')][_0xe60c('0x2c')]);}_0x49f82e[_0xe60c('0x41')]=qs[_0xe60c('0x42')](_0x161dac[_0xe60c('0x38')][_0xe60c('0x42')]);_0x49f82e[_0xe60c('0x43')]=qs[_0xe60c('0x39')](_[_0xe60c('0x44')](_0x161dac['query'],_0x2a53fd[_0xe60c('0x39')]));if(_0x161dac['query'][_0xe60c('0x45')]){_0x49f82e[_0xe60c('0x43')]=_['merge'](_0x49f82e[_0xe60c('0x43')],{'$or':_[_0xe60c('0x46')](_0xdf64eb,function(_0x536396){if(_0x536396[_0xe60c('0x47')]['key']!==_0xe60c('0x48')){var _0x27104d={};_0x27104d[_0x536396[_0xe60c('0x49')]]={'$like':'%'+_0x161dac[_0xe60c('0x38')][_0xe60c('0x45')]+'%'};return _0x27104d;}})});}_0x49f82e=_[_0xe60c('0x4a')]({},_0x49f82e,_0x161dac['options']);var _0x56c0e5={'where':_0x49f82e[_0xe60c('0x43')]};return db[_0xe60c('0x36')]['count'](_0x56c0e5)[_0xe60c('0x30')](function(_0xc3a27d){_0x318d06[_0xe60c('0x4b')]=_0xc3a27d;if(_0x161dac[_0xe60c('0x38')][_0xe60c('0x4c')]){_0x49f82e['include']=[{'all':!![]}];}return db[_0xe60c('0x36')][_0xe60c('0x4d')](_0x49f82e);})[_0xe60c('0x30')](function(_0x13719d){_0x318d06['rows']=_0x13719d;return _0x318d06;})[_0xe60c('0x30')](respondWithFilteredResult(_0x39e5a4,_0x49f82e))[_0xe60c('0x28')](handleError(_0x39e5a4,null));};exports[_0xe60c('0x4e')]=function(_0x1f05eb,_0x4a6eb7){var _0x25d8b1={'raw':!![],'where':{'id':_0x1f05eb[_0xe60c('0x4f')]['id']}},_0x3f962c={};_0x3f962c['model']=_[_0xe60c('0x50')](db['ChatMessage'][_0xe60c('0x37')]);_0x3f962c[_0xe60c('0x38')]=_[_0xe60c('0x50')](_0x1f05eb[_0xe60c('0x38')]);_0x3f962c['filters']=_[_0xe60c('0x3a')](_0x3f962c['model'],_0x3f962c['query']);_0x25d8b1['attributes']=_[_0xe60c('0x3a')](_0x3f962c['model'],qs[_0xe60c('0x3d')](_0x1f05eb[_0xe60c('0x38')]['fields']));_0x25d8b1[_0xe60c('0x3c')]=_0x25d8b1[_0xe60c('0x3c')][_0xe60c('0x51')]?_0x25d8b1['attributes']:_0x3f962c[_0xe60c('0x3b')];if(_0x1f05eb[_0xe60c('0x38')]['includeAll']){_0x25d8b1[_0xe60c('0x52')]=[{'all':!![]}];}_0x25d8b1=_[_0xe60c('0x4a')]({},_0x25d8b1,_0x1f05eb[_0xe60c('0x53')]);return db[_0xe60c('0x36')][_0xe60c('0x54')](_0x25d8b1)[_0xe60c('0x30')](handleEntityNotFound(_0x4a6eb7,null))[_0xe60c('0x30')](respondWithResult(_0x4a6eb7,null))[_0xe60c('0x28')](handleError(_0x4a6eb7,null));};exports['create']=function(_0x4e1340,_0x6bc791){return db['ChatMessage'][_0xe60c('0x55')](_0x4e1340[_0xe60c('0x56')],{})[_0xe60c('0x30')](respondWithResult(_0x6bc791,0xc9))[_0xe60c('0x28')](handleError(_0x6bc791,null));};exports[_0xe60c('0x57')]=function(_0x2cddf5,_0xb4ac0){if(_0x2cddf5[_0xe60c('0x56')]['id']){delete _0x2cddf5['body']['id'];}return db['ChatMessage'][_0xe60c('0x54')]({'where':{'id':_0x2cddf5[_0xe60c('0x4f')]['id']}})[_0xe60c('0x30')](handleEntityNotFound(_0xb4ac0,null))[_0xe60c('0x30')](saveUpdates(_0x2cddf5[_0xe60c('0x56')],null))[_0xe60c('0x30')](respondWithResult(_0xb4ac0,null))[_0xe60c('0x28')](handleError(_0xb4ac0,null));};exports[_0xe60c('0x58')]=function(_0x4cc09b,_0xcebc66){return db[_0xe60c('0x36')][_0xe60c('0x54')]({'where':{'id':_0x4cc09b[_0xe60c('0x4f')]['id']}})[_0xe60c('0x30')](handleEntityNotFound(_0xcebc66,null))[_0xe60c('0x30')](removeEntity(_0xcebc66,null))['catch'](handleError(_0xcebc66,null));};exports[_0xe60c('0x59')]=function(_0x1f6001,_0x1250a0){return db[_0xe60c('0x36')][_0xe60c('0x59')]()[_0xe60c('0x30')](respondWithResult(_0x1250a0,null))[_0xe60c('0x28')](handleError(_0x1250a0,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x273441,_0x25722e,_0x5761ca){var _0x42032a={'channel':_0xe60c('0x5a')};if(_0x273441[_0xe60c('0x56')]['id']){delete _0x273441[_0xe60c('0x56')]['id'];}_0x273441[_0xe60c('0x56')]['read']=!![];_0x273441[_0xe60c('0x56')][_0xe60c('0x5b')]=moment()[_0xe60c('0x5c')](_0xe60c('0x5d'));_0x273441[_0xe60c('0x56')][_0xe60c('0x5e')]=_0x273441['body'][_0xe60c('0x5e')]||_0x273441['user']['id'];return db[_0xe60c('0x36')][_0xe60c('0x54')]({'where':{'id':_0x273441[_0xe60c('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xe60c('0x5f')],'as':_0xe60c('0x60')}]})[_0xe60c('0x30')](handleEntityNotFound(_0x25722e,null))['then'](saveUpdates(_0x273441[_0xe60c('0x56')],null))[_0xe60c('0x30')](function(_0x27c8aa){if(_0x27c8aa){_0x42032a['message']=_0x27c8aa[_0xe60c('0x61')]({'plain':!![]});return db[_0xe60c('0x62')][_0xe60c('0x54')]({'where':{'id':_0x27c8aa[_0xe60c('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x25722e,null))[_0xe60c('0x30')](function(_0x195385){if(_0x195385){return _0x195385[_0xe60c('0x57')]({'UserId':_0x273441[_0xe60c('0x56')][_0xe60c('0x5e')],'read1stAt':_[_0xe60c('0x64')](_0x195385[_0xe60c('0x65')])?moment()['format'](_0xe60c('0x5d')):undefined});}return null;})['then'](function(_0x476ea8){if(_0x476ea8){_0x42032a[_0xe60c('0x66')]=_0x476ea8[_0xe60c('0x61')]({'plain':!![]});interaction_log['info'](_0xe60c('0x67'),_0x273441[_0xe60c('0x68')]['id'],_0x273441['user'][_0xe60c('0x33')],_0x273441['user'][_0xe60c('0x69')],_0x42032a['interaction']['id'],_0x273441[_0xe60c('0x56')]?JSON[_0xe60c('0x23')](_0x273441['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xe60c('0x6a'),_0x42032a);}return null;})['then'](function(_0x52aac4){if(_0x52aac4){if(_0x273441[_0xe60c('0x56')][_0xe60c('0x6b')]){_0x42032a['message'][_0xe60c('0x6c')]=util[_0xe60c('0x5c')]('SIP/%s',_0x273441['user']['name']);_0x42032a[_0xe60c('0x26')][_0xe60c('0x6d')]=_0x42032a[_0xe60c('0x6d')];_0x42032a[_0xe60c('0x26')]['event']=_0xe60c('0x6e');return respondWithRpcPromise(_0xe60c('0x6f'),_0xe60c('0x6f'),{'event':'acceptmessage','message':_[_0xe60c('0x4a')](_0x42032a[_0xe60c('0x26')],JSON[_0xe60c('0x70')](_0x42032a['interaction'][_0xe60c('0x71')]))},client9002)[_0xe60c('0x30')](function(){return _0x42032a;});}return _0x42032a;}return null;})[_0xe60c('0x30')](respondWithResult(_0x25722e,null))[_0xe60c('0x28')](handleError(_0x25722e,null));};var interaction_log=require(_0xe60c('0x13'))(_0xe60c('0x72'));exports[_0xe60c('0x2e')]=function(_0x60e992,_0x1d4aad,_0x1e24f7){var _0x273b4c={'agent':{},'channel':_0xe60c('0x5a')};if(_0x60e992[_0xe60c('0x56')]['id']){delete _0x60e992[_0xe60c('0x56')]['id'];}_0x60e992['body']['UserId']=_0x60e992[_0xe60c('0x56')][_0xe60c('0x5e')]||_0x60e992[_0xe60c('0x68')]['id'];_0x273b4c[_0xe60c('0x73')]['id']=_0x60e992[_0xe60c('0x56')]['UserId'];return db[_0xe60c('0x36')][_0xe60c('0x54')]({'where':{'id':_0x60e992[_0xe60c('0x4f')]['id'],'UserId':null}})[_0xe60c('0x30')](handleEntityNotFound(_0x1d4aad,null))[_0xe60c('0x30')](function(_0x287152){if(_0x287152){_0x273b4c[_0xe60c('0x26')]=_0x287152[_0xe60c('0x61')]({'plain':!![]});return db[_0xe60c('0x62')][_0xe60c('0x54')]({'where':{'id':_0x287152[_0xe60c('0x63')]}});}return null;})[_0xe60c('0x30')](handleEntityNotFound(_0x1d4aad,null))[_0xe60c('0x30')](function(_0x1cbb10){if(_0x1cbb10){_0x273b4c[_0xe60c('0x66')]=_0x1cbb10[_0xe60c('0x61')]({'plain':!![]});interaction_log[_0xe60c('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x60e992['user']['id'],_0x60e992[_0xe60c('0x68')][_0xe60c('0x33')],_0x60e992[_0xe60c('0x68')][_0xe60c('0x69')],_0x273b4c[_0xe60c('0x66')]['id'],_0x60e992[_0xe60c('0x56')]?JSON[_0xe60c('0x23')](_0x60e992['body']):_0xe60c('0x74'));return respondWithRpcPromise(_0xe60c('0x75'),_0xe60c('0x76'),_0x273b4c);}return null;})[_0xe60c('0x30')](function(_0x48653b){if(_0x48653b){_0x48653b[_0xe60c('0x26')][_0xe60c('0x6c')]=util['format']('SIP/%s',_0x60e992[_0xe60c('0x68')]['name']);_0x48653b['message'][_0xe60c('0x6d')]=_0x273b4c['channel'];_0x48653b[_0xe60c('0x26')][_0xe60c('0x77')]='reject';respondWithRpcPromise(_0xe60c('0x6f'),_0xe60c('0x6f'),{'event':_0xe60c('0x78'),'message':_0x48653b[_0xe60c('0x26')]},client9002);return _0x273b4c;}return null;})['then'](respondWithResult(_0x1d4aad,null))[_0xe60c('0x28')](handleError(_0x1d4aad,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a70bb4f..ba6708c 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 _0xa60a=['update','remove','hook','exports','events','../../mysqldb','save'];(function(_0x52c856,_0x47fd69){var _0x41f172=function(_0x7bec89){while(--_0x7bec89){_0x52c856['push'](_0x52c856['shift']());}};_0x41f172(++_0x47fd69);}(_0xa60a,0x90));var _0xaa60=function(_0x29c558,_0x7999a8){_0x29c558=_0x29c558-0x0;var _0x54c6e9=_0xa60a[_0x29c558];return _0x54c6e9;};'use strict';var EventEmitter=require(_0xaa60('0x0'));var ChatMessage=require(_0xaa60('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaa60('0x2'),'afterUpdate':_0xaa60('0x3'),'afterDestroy':_0xaa60('0x4')};function emitEvent(_0x71043c){return function(_0x39d38e,_0x1ffc0f,_0x40f270){ChatMessageEvents['emit'](_0x71043c+':'+_0x39d38e['id'],_0x39d38e);ChatMessageEvents['emit'](_0x71043c,_0x39d38e);_0x40f270(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xaa60('0x5')](e,emitEvent(event));}}module[_0xaa60('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xa5a3=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa5a3,0x7c));var _0x3a5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5a3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3a5a('0x0'));var ChatMessage=require(_0x3a5a('0x1'))['db'][_0x3a5a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3a5a('0x3')](0x0);var events={'afterCreate':_0x3a5a('0x4'),'afterUpdate':_0x3a5a('0x5'),'afterDestroy':_0x3a5a('0x6')};function emitEvent(_0x2f443b){return function(_0x4b2f27,_0x130de3,_0xd8b1f0){ChatMessageEvents[_0x3a5a('0x7')](_0x2f443b+':'+_0x4b2f27['id'],_0x4b2f27);ChatMessageEvents[_0x3a5a('0x7')](_0x2f443b,_0x4b2f27);_0xd8b1f0(null);};}for(var e in events){if(events[_0x3a5a('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3a5a('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 73658c5..69fd1d0 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 _0x3940=['get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','body','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','exports','define','chat_messages','models'];(function(_0x1fabd7,_0x25b63f){var _0x6bbade=function(_0x5976d0){while(--_0x5976d0){_0x1fabd7['push'](_0x1fabd7['shift']());}};_0x6bbade(++_0x25b63f);}(_0x3940,0xa6));var _0x0394=function(_0x471dbb,_0x50a0ed){_0x471dbb=_0x471dbb-0x0;var _0x16911f=_0x3940[_0x471dbb];return _0x16911f;};'use strict';var _=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var logger=require('../../config/logger')(_0x0394('0x2'));var moment=require('moment');var BPromise=require(_0x0394('0x3'));var rp=require(_0x0394('0x4'));var attributes=require('./chatMessage.attributes');module[_0x0394('0x5')]=function(_0x5697bd,_0x2f6ecb){return _0x5697bd[_0x0394('0x6')]('ChatMessage',attributes,{'tableName':_0x0394('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f503c,_0x510b8d,_0x187637){var _0x4f6faa=_0x5697bd[_0x0394('0x8')];var _0x9b3b2f=_0x2f503c[_0x0394('0x9')]({'plain':!![]});if(_0x9b3b2f[_0x0394('0xa')][_0x0394('0xb')]()==='in'||_0x9b3b2f[_0x0394('0xa')][_0x0394('0xb')]()===_0x0394('0xc')&&!_0x9b3b2f[_0x0394('0xd')]&&!_[_0x0394('0xe')](_0x9b3b2f['UserId'])){_0x4f6faa[_0x0394('0xf')][_0x0394('0x10')]({'where':{'id':_0x9b3b2f[_0x0394('0x11')]}})[_0x0394('0x12')](function(_0x56fe9a){if(_0x56fe9a){_0x56fe9a[_0x0394('0x13')]({'lastMsgAt':_0x9b3b2f[_0x0394('0x14')],'lastMsgDirection':_0x9b3b2f[_0x0394('0xa')]['toLowerCase'](),'lastMsgBody':_0x9b3b2f[_0x0394('0x15')]});}})['catch'](function(_0x461257){console[_0x0394('0x16')](_0x461257);});}_0x187637();}},'charset':_0x0394('0x17'),'collate':_0x0394('0x18')});}; \ No newline at end of file +var _0x831b=['exports','define','ChatMessage','chat_messages','models','direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatMessage.attributes'];(function(_0x16edd1,_0x4c21e2){var _0x6be6b3=function(_0x1287ac){while(--_0x1287ac){_0x16edd1['push'](_0x16edd1['shift']());}};_0x6be6b3(++_0x4c21e2);}(_0x831b,0x160));var _0xb831=function(_0x42b2ed,_0x1f83bc){_0x42b2ed=_0x42b2ed-0x0;var _0x367367=_0x831b[_0x42b2ed];return _0x367367;};'use strict';var _=require(_0xb831('0x0'));var util=require(_0xb831('0x1'));var logger=require(_0xb831('0x2'))(_0xb831('0x3'));var moment=require(_0xb831('0x4'));var BPromise=require(_0xb831('0x5'));var rp=require(_0xb831('0x6'));var attributes=require(_0xb831('0x7'));module[_0xb831('0x8')]=function(_0x52cdf6,_0x47a2f2){return _0x52cdf6[_0xb831('0x9')](_0xb831('0xa'),attributes,{'tableName':_0xb831('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a2878,_0x1994ce,_0x1cb198){var _0x2934d4=_0x52cdf6[_0xb831('0xc')];var _0x14da5f=_0x4a2878['get']({'plain':!![]});if(_0x14da5f[_0xb831('0xd')][_0xb831('0xe')]()==='in'||_0x14da5f['direction'][_0xb831('0xe')]()===_0xb831('0xf')&&!_0x14da5f['secret']&&!_['isNil'](_0x14da5f[_0xb831('0x10')])){_0x2934d4[_0xb831('0x11')][_0xb831('0x12')]({'where':{'id':_0x14da5f[_0xb831('0x13')]}})[_0xb831('0x14')](function(_0x1af191){if(_0x1af191){_0x1af191['update']({'lastMsgAt':_0x14da5f[_0xb831('0x15')],'lastMsgDirection':_0x14da5f[_0xb831('0xd')][_0xb831('0xe')](),'lastMsgBody':_0x14da5f['body']});}})['catch'](function(_0x135d9e){console[_0xb831('0x16')](_0x135d9e);});}_0x1cb198();}},'charset':'utf8mb4','collate':_0xb831('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e3fe90a..850e69d 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 _0x04a2=['ChatMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage'];(function(_0x15d609,_0x1e0fb8){var _0x48882e=function(_0xfbd0a9){while(--_0xfbd0a9){_0x15d609['push'](_0x15d609['shift']());}};_0x48882e(++_0x1e0fb8);}(_0x04a2,0x197));var _0x204a=function(_0x71f78a,_0x3455a1){_0x71f78a=_0x71f78a-0x0;var _0x426f2e=_0x04a2[_0x71f78a];return _0x426f2e;};'use strict';var _=require(_0x204a('0x0'));var util=require(_0x204a('0x1'));var moment=require(_0x204a('0x2'));var BPromise=require(_0x204a('0x3'));var rs=require(_0x204a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x204a('0x5'))['db'];var utils=require(_0x204a('0x6'));var logger=require(_0x204a('0x7'))(_0x204a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x204a('0x9')]['http']({'port':0x232a});config[_0x204a('0xa')]=_[_0x204a('0xb')](config[_0x204a('0xa')],{'host':_0x204a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x204a('0xa')]));require(_0x204a('0xd'))['register'](socket);function respondWithRpcPromise(_0xdaa9a6,_0x25d40b,_0x524449){return new BPromise(function(_0x44659c,_0x596945){return client['request'](_0xdaa9a6,_0x524449)[_0x204a('0xe')](function(_0x9935bd){logger['info'](_0x204a('0xf'),_0x25d40b,_0x204a('0x10'));logger[_0x204a('0x11')](_0x204a('0x12'),_0x25d40b,_0x204a('0x10'),JSON[_0x204a('0x13')](_0x9935bd));if(_0x9935bd[_0x204a('0x14')]){if(_0x9935bd['error'][_0x204a('0x15')]===0x1f4){logger[_0x204a('0x14')](_0x204a('0xf'),_0x25d40b,_0x9935bd['error'][_0x204a('0x16')]);return _0x596945(_0x9935bd[_0x204a('0x14')][_0x204a('0x16')]);}logger[_0x204a('0x14')](_0x204a('0xf'),_0x25d40b,_0x9935bd[_0x204a('0x14')][_0x204a('0x16')]);return _0x44659c(_0x9935bd[_0x204a('0x14')][_0x204a('0x16')]);}else{logger[_0x204a('0x17')](_0x204a('0xf'),_0x25d40b,_0x204a('0x10'));_0x44659c(_0x9935bd[_0x204a('0x18')][_0x204a('0x16')]);}})[_0x204a('0x19')](function(_0x3a652c){logger[_0x204a('0x14')](_0x204a('0xf'),_0x25d40b,_0x3a652c);_0x596945(_0x3a652c);});});}exports[_0x204a('0x1a')]=function(_0x3f7878){var _0x178b0e=this;return new Promise(function(_0x1c3aae,_0x39177e){return db[_0x204a('0x1b')][_0x204a('0x1c')](_0x3f7878['body'],{'raw':_0x3f7878[_0x204a('0x1d')]?_0x3f7878['options'][_0x204a('0x1e')]===undefined?!![]:![]:!![]})[_0x204a('0xe')](function(_0x2bd771){logger[_0x204a('0x17')](_0x204a('0x1a'),_0x3f7878);logger[_0x204a('0x11')](_0x204a('0x1a'),_0x3f7878,JSON[_0x204a('0x13')](_0x2bd771));_0x1c3aae(_0x2bd771);})['catch'](function(_0x525007){logger[_0x204a('0x14')](_0x204a('0x1a'),_0x525007[_0x204a('0x16')],_0x3f7878);_0x39177e(_0x178b0e[_0x204a('0x14')](0x1f4,_0x525007[_0x204a('0x16')]));});});}; \ No newline at end of file +var _0xe48a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','moment','bluebird'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0xe48a,0x72));var _0xae48=function(_0x936f18,_0x110725){_0x936f18=_0x936f18-0x0;var _0x36b3b7=_0xe48a[_0x936f18];return _0x36b3b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae48('0x0'));var BPromise=require(_0xae48('0x1'));var rs=require(_0xae48('0x2'));var fs=require('fs');var Redis=require(_0xae48('0x3'));var db=require(_0xae48('0x4'))['db'];var utils=require(_0xae48('0x5'));var logger=require(_0xae48('0x6'))('rpc');var config=require(_0xae48('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae48('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xae48('0x9')],{'host':_0xae48('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae48('0x9')]));require(_0xae48('0xb'))[_0xae48('0xc')](socket);function respondWithRpcPromise(_0x230273,_0x19e2c0,_0x5df216){return new BPromise(function(_0x30ebf3,_0x79798){return client['request'](_0x230273,_0x5df216)[_0xae48('0xd')](function(_0x4297a7){logger['info'](_0xae48('0xe'),_0x19e2c0,_0xae48('0xf'));logger[_0xae48('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x19e2c0,_0xae48('0xf'),JSON['stringify'](_0x4297a7));if(_0x4297a7[_0xae48('0x11')]){if(_0x4297a7[_0xae48('0x11')][_0xae48('0x12')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x19e2c0,_0x4297a7['error'][_0xae48('0x13')]);return _0x79798(_0x4297a7[_0xae48('0x11')][_0xae48('0x13')]);}logger[_0xae48('0x11')](_0xae48('0xe'),_0x19e2c0,_0x4297a7[_0xae48('0x11')]['message']);return _0x30ebf3(_0x4297a7[_0xae48('0x11')][_0xae48('0x13')]);}else{logger[_0xae48('0x14')]('ChatMessage,\x20%s,\x20%s',_0x19e2c0,_0xae48('0xf'));_0x30ebf3(_0x4297a7['result'][_0xae48('0x13')]);}})[_0xae48('0x15')](function(_0x245b86){logger['error'](_0xae48('0xe'),_0x19e2c0,_0x245b86);_0x79798(_0x245b86);});});}exports[_0xae48('0x16')]=function(_0x4f55b1){var _0x410026=this;return new Promise(function(_0x40a850,_0x19b74a){return db[_0xae48('0x17')][_0xae48('0x18')](_0x4f55b1[_0xae48('0x19')],{'raw':_0x4f55b1[_0xae48('0x1a')]?_0x4f55b1[_0xae48('0x1a')][_0xae48('0x1b')]===undefined?!![]:![]:!![]})[_0xae48('0xd')](function(_0x197896){logger[_0xae48('0x14')]('CreateChatMessage',_0x4f55b1);logger['debug'](_0xae48('0x16'),_0x4f55b1,JSON[_0xae48('0x1c')](_0x197896));_0x40a850(_0x197896);})[_0xae48('0x15')](function(_0x3d05df){logger[_0xae48('0x11')](_0xae48('0x16'),_0x3d05df[_0xae48('0x13')],_0x4f55b1);_0x19b74a(_0x410026[_0xae48('0x11')](0x1f4,_0x3d05df['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 33dbba8..6122959 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 _0xedd9=['removeListener','register','length','chatMessage:','save','remove','update','emit'];(function(_0x23dec5,_0x35ea68){var _0x3265ad=function(_0x3cd7a6){while(--_0x3cd7a6){_0x23dec5['push'](_0x23dec5['shift']());}};_0x3265ad(++_0x35ea68);}(_0xedd9,0xfc));var _0x9edd=function(_0x20d68e,_0x36b353){_0x20d68e=_0x20d68e-0x0;var _0x452fa9=_0xedd9[_0x20d68e];return _0x452fa9;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x55ca,0x126));var _0xa55c=function(_0x3f7e8b,_0x7291d1){_0x3f7e8b=_0x3f7e8b-0x0;var _0x4eb892=_0x55ca[_0x3f7e8b];return _0x4eb892;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3f238da..62624c0 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 _0xc800=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','post','chat','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc800,0x1db));var _0x0c80=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc800[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var path=require(_0x0c80('0x2'));var timeout=require(_0x0c80('0x3'));var express=require(_0x0c80('0x4'));var router=express[_0x0c80('0x5')]();var auth=require(_0x0c80('0x6'));var interaction=require(_0x0c80('0x7'));var config=require(_0x0c80('0x8'));var controller=require(_0x0c80('0x9'));router[_0x0c80('0xa')]('/',auth[_0x0c80('0xb')](),controller['index']);router[_0x0c80('0xa')](_0x0c80('0xc'),auth[_0x0c80('0xb')](),controller['describe']);router[_0x0c80('0xa')](_0x0c80('0xd'),auth[_0x0c80('0xb')](),controller['show']);router[_0x0c80('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x0c80('0xf'),_0x0c80('0x10')),controller['create']);router['put'](_0x0c80('0xd'),controller['update']);router[_0x0c80('0x11')](_0x0c80('0x12'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x13')]);router[_0x0c80('0x11')](_0x0c80('0x14'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x15')]);router[_0x0c80('0x16')](_0x0c80('0xd'),auth[_0x0c80('0xb')](),controller['destroy']);module[_0x0c80('0x17')]=router; \ No newline at end of file +var _0xe8ba=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer'];(function(_0x4fe0d9,_0x25043b){var _0x3a9219=function(_0x44d296){while(--_0x44d296){_0x4fe0d9['push'](_0x4fe0d9['shift']());}};_0x3a9219(++_0x25043b);}(_0xe8ba,0x15d));var _0xae8b=function(_0x2559d6,_0x25d149){_0x2559d6=_0x2559d6-0x0;var _0x15f5b9=_0xe8ba[_0x2559d6];return _0x15f5b9;};'use strict';var multer=require(_0xae8b('0x0'));var util=require(_0xae8b('0x1'));var path=require('path');var timeout=require(_0xae8b('0x2'));var express=require(_0xae8b('0x3'));var router=express[_0xae8b('0x4')]();var auth=require(_0xae8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xae8b('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xae8b('0x7')](),controller[_0xae8b('0x8')]);router[_0xae8b('0x9')](_0xae8b('0xa'),auth[_0xae8b('0x7')](),controller[_0xae8b('0xb')]);router['get'](_0xae8b('0xc'),auth[_0xae8b('0x7')](),controller[_0xae8b('0xd')]);router['post']('/',auth[_0xae8b('0x7')](),interaction[_0xae8b('0xe')](_0xae8b('0xf'),_0xae8b('0x10')),controller[_0xae8b('0x11')]);router[_0xae8b('0x12')](_0xae8b('0xc'),controller[_0xae8b('0x13')]);router[_0xae8b('0x12')](_0xae8b('0x14'),auth[_0xae8b('0x7')](),controller['accept']);router[_0xae8b('0x12')]('/:id/reject',auth[_0xae8b('0x7')](),controller[_0xae8b('0x15')]);router[_0xae8b('0x16')](_0xae8b('0xc'),auth[_0xae8b('0x7')](),controller[_0xae8b('0x17')]);module[_0xae8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 7edcb55..15e177b 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 _0x1a45=['medium','sequelize','TEXT'];(function(_0x46839c,_0x16d55e){var _0x926de=function(_0x5278fa){while(--_0x5278fa){_0x46839c['push'](_0x46839c['shift']());}};_0x926de(++_0x16d55e);}(_0x1a45,0x100));var _0x51a4=function(_0xc46b7b,_0x3c83d5){_0xc46b7b=_0xc46b7b-0x0;var _0x43f624=_0x1a45[_0xc46b7b];return _0x43f624;};'use strict';var Sequelize=require(_0x51a4('0x0'));module['exports']={'body':{'type':Sequelize[_0x51a4('0x1')](_0x51a4('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xbd50=['TEXT','sequelize','exports'];(function(_0x7e710e,_0x1eee2f){var _0xa05a1d=function(_0x53fa14){while(--_0x53fa14){_0x7e710e['push'](_0x7e710e['shift']());}};_0xa05a1d(++_0x1eee2f);}(_0xbd50,0x196));var _0x0bd5=function(_0x48a509,_0x30df45){_0x48a509=_0x48a509-0x0;var _0x4155e9=_0xbd50[_0x48a509];return _0x4155e9;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'body':{'type':Sequelize[_0x0bd5('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index fdd81b6..4097ad9 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 _0xdf78=['type','key','field','merge','options','ChatOfflineMessage','findAll','show','params','length','include','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map'];(function(_0xccd571,_0x42abda){var _0x222b53=function(_0x5b3bbe){while(--_0x5b3bbe){_0xccd571['push'](_0xccd571['shift']());}};_0x222b53(++_0x42abda);}(_0xdf78,0x1af));var _0x8df7=function(_0x436d87,_0x1f6911){_0x436d87=_0x436d87-0x0;var _0x4d45be=_0xdf78[_0x436d87];return _0x4d45be;};'use strict';var pdf=require(_0x8df7('0x0'));var emlformat=require(_0x8df7('0x1'));var rimraf=require(_0x8df7('0x2'));var zipdir=require(_0x8df7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8df7('0x4'));var BPromise=require(_0x8df7('0x5'));var Mustache=require(_0x8df7('0x6'));var util=require(_0x8df7('0x7'));var path=require('path');var sox=require(_0x8df7('0x8'));var csv=require(_0x8df7('0x9'));var ejs=require(_0x8df7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8df7('0xb'));var jsforce=require(_0x8df7('0xc'));var deskjs=require(_0x8df7('0xd'));var toCsv=require(_0x8df7('0x9'));var querystring=require('querystring');var Papa=require(_0x8df7('0xe'));var authService=require(_0x8df7('0xf'));var hardwareService=require(_0x8df7('0x10'));var Redis=require(_0x8df7('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8df7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8df7('0x13'))['db'];function respondWithStatusCode(_0x280105,_0x47e1f2){_0x47e1f2=_0x47e1f2||0xcc;return function(_0x28759b){if(_0x28759b){return _0x280105['sendStatus'](_0x47e1f2);}return _0x280105['status'](_0x47e1f2)[_0x8df7('0x14')]();};}function respondWithResult(_0x3e3fe0,_0x5f2719){_0x5f2719=_0x5f2719||0xc8;return function(_0x44753e){if(_0x44753e){return _0x3e3fe0['status'](_0x5f2719)[_0x8df7('0x15')](_0x44753e);}};}function respondWithFilteredResult(_0x48b94f,_0x2f0c90){return function(_0x14ae69){if(_0x14ae69){var _0x26e05e=_0x14ae69[_0x8df7('0x16')],_0x2a8d38=_0x2f0c90[_0x8df7('0x17')],_0x478082=_0x2f0c90[_0x8df7('0x17')]+_0x2f0c90[_0x8df7('0x18')],_0x12d393;if(_0x478082>=_0x26e05e){_0x478082=_0x26e05e;_0x12d393=0xc8;}else{_0x12d393=0xce;}_0x48b94f[_0x8df7('0x19')](_0x12d393);return _0x48b94f[_0x8df7('0x1a')](_0x8df7('0x1b'),_0x2a8d38+'-'+_0x478082+'/'+_0x26e05e)[_0x8df7('0x15')](_0x14ae69);}return null;};}function patchUpdates(_0x26defb){return function(_0x1837e4){try{jsonpatch[_0x8df7('0x1c')](_0x1837e4,_0x26defb,!![]);}catch(_0x5d9a34){return BPromise['reject'](_0x5d9a34);}return _0x1837e4[_0x8df7('0x1d')]();};}function saveUpdates(_0x43c37d,_0x1d1c43){return function(_0x46a298){if(_0x46a298){return _0x46a298[_0x8df7('0x1e')](_0x43c37d)[_0x8df7('0x1f')](function(_0x70dfd5){return _0x70dfd5;});}return null;};}function removeEntity(_0x5ce462,_0x42e3ab){return function(_0x3da537){if(_0x3da537){return _0x3da537['destroy']()[_0x8df7('0x1f')](function(){_0x5ce462[_0x8df7('0x19')](0xcc)[_0x8df7('0x14')]();});}};}function handleEntityNotFound(_0x5dc5df,_0x4ea61c){return function(_0x421c3f){if(!_0x421c3f){_0x5dc5df[_0x8df7('0x20')](0x194);}return _0x421c3f;};}function handleError(_0x564f35,_0x5f1643){_0x5f1643=_0x5f1643||0x1f4;return function(_0x41e63f){logger[_0x8df7('0x21')](_0x41e63f[_0x8df7('0x22')]);if(_0x41e63f[_0x8df7('0x23')]){delete _0x41e63f[_0x8df7('0x23')];}_0x564f35['status'](_0x5f1643)['send'](_0x41e63f);};}exports['index']=function(_0x2bb24c,_0x15af80){var _0x41a382={},_0x2aa98a={},_0x3622b5={'count':0x0,'rows':[]};var _0x3426d4=db['ChatOfflineMessage'][_0x8df7('0x24')];_0x2aa98a[_0x8df7('0x25')]=_[_0x8df7('0x26')](_0x3426d4);_0x2aa98a[_0x8df7('0x27')]=_[_0x8df7('0x26')](_0x2bb24c[_0x8df7('0x27')]);_0x2aa98a[_0x8df7('0x28')]=_['intersection'](_0x2aa98a[_0x8df7('0x25')],_0x2aa98a['query']);_0x41a382['attributes']=_[_0x8df7('0x29')](_0x2aa98a[_0x8df7('0x25')],qs[_0x8df7('0x2a')](_0x2bb24c[_0x8df7('0x27')][_0x8df7('0x2a')]));_0x41a382[_0x8df7('0x2b')]=_0x41a382['attributes']['length']?_0x41a382[_0x8df7('0x2b')]:_0x2aa98a['model'];if(!_0x2bb24c[_0x8df7('0x27')][_0x8df7('0x2c')](_0x8df7('0x2d'))){_0x41a382[_0x8df7('0x18')]=qs[_0x8df7('0x18')](_0x2bb24c[_0x8df7('0x27')][_0x8df7('0x18')]);_0x41a382['offset']=qs[_0x8df7('0x17')](_0x2bb24c['query'][_0x8df7('0x17')]);}_0x41a382[_0x8df7('0x2e')]=qs[_0x8df7('0x2f')](_0x2bb24c[_0x8df7('0x27')][_0x8df7('0x2f')]);_0x41a382[_0x8df7('0x30')]=qs['filters'](_[_0x8df7('0x31')](_0x2bb24c[_0x8df7('0x27')],_0x2aa98a[_0x8df7('0x28')]));if(_0x2bb24c['query'][_0x8df7('0x32')]){_0x41a382['where']=_['merge'](_0x41a382['where'],{'$or':_[_0x8df7('0x33')](_0x3426d4,function(_0x4a3a3a){if(_0x4a3a3a[_0x8df7('0x34')][_0x8df7('0x35')]!=='VIRTUAL'){var _0x4bd123={};_0x4bd123[_0x4a3a3a[_0x8df7('0x36')]]={'$like':'%'+_0x2bb24c[_0x8df7('0x27')][_0x8df7('0x32')]+'%'};return _0x4bd123;}})});}_0x41a382=_[_0x8df7('0x37')]({},_0x41a382,_0x2bb24c[_0x8df7('0x38')]);var _0x2558d0={'where':_0x41a382[_0x8df7('0x30')]};return db['ChatOfflineMessage'][_0x8df7('0x16')](_0x2558d0)[_0x8df7('0x1f')](function(_0x54237b){_0x3622b5[_0x8df7('0x16')]=_0x54237b;if(_0x2bb24c[_0x8df7('0x27')]['includeAll']){_0x41a382['include']=[{'all':!![]}];}return db[_0x8df7('0x39')][_0x8df7('0x3a')](_0x41a382);})[_0x8df7('0x1f')](function(_0x4a4948){_0x3622b5['rows']=_0x4a4948;return _0x3622b5;})[_0x8df7('0x1f')](respondWithFilteredResult(_0x15af80,_0x41a382))['catch'](handleError(_0x15af80,null));};exports[_0x8df7('0x3b')]=function(_0x317ce7,_0x1dcf67){var _0x1c46b9={'raw':!![],'where':{'id':_0x317ce7[_0x8df7('0x3c')]['id']}},_0x461d75={};_0x461d75[_0x8df7('0x25')]=_['keys'](db['ChatOfflineMessage'][_0x8df7('0x24')]);_0x461d75[_0x8df7('0x27')]=_['keys'](_0x317ce7[_0x8df7('0x27')]);_0x461d75[_0x8df7('0x28')]=_[_0x8df7('0x29')](_0x461d75[_0x8df7('0x25')],_0x461d75[_0x8df7('0x27')]);_0x1c46b9[_0x8df7('0x2b')]=_[_0x8df7('0x29')](_0x461d75[_0x8df7('0x25')],qs['fields'](_0x317ce7['query'][_0x8df7('0x2a')]));_0x1c46b9[_0x8df7('0x2b')]=_0x1c46b9[_0x8df7('0x2b')][_0x8df7('0x3d')]?_0x1c46b9[_0x8df7('0x2b')]:_0x461d75[_0x8df7('0x25')];if(_0x317ce7[_0x8df7('0x27')]['includeAll']){_0x1c46b9[_0x8df7('0x3e')]=[{'all':!![]}];}_0x1c46b9=_[_0x8df7('0x37')]({},_0x1c46b9,_0x317ce7[_0x8df7('0x38')]);return db['ChatOfflineMessage'][_0x8df7('0x3f')](_0x1c46b9)[_0x8df7('0x1f')](handleEntityNotFound(_0x1dcf67,null))[_0x8df7('0x1f')](respondWithResult(_0x1dcf67,null))[_0x8df7('0x40')](handleError(_0x1dcf67,null));};exports['create']=function(_0x1b7400,_0x59c05e){return db['ChatOfflineMessage'][_0x8df7('0x41')](_0x1b7400[_0x8df7('0x42')],{})['then'](respondWithResult(_0x59c05e,0xc9))[_0x8df7('0x40')](handleError(_0x59c05e,null));};exports['update']=function(_0x13ecc8,_0x89421f){if(_0x13ecc8[_0x8df7('0x42')]['id']){delete _0x13ecc8['body']['id'];}return db[_0x8df7('0x39')]['find']({'where':{'id':_0x13ecc8[_0x8df7('0x3c')]['id']}})['then'](handleEntityNotFound(_0x89421f,null))[_0x8df7('0x1f')](saveUpdates(_0x13ecc8[_0x8df7('0x42')],null))[_0x8df7('0x1f')](respondWithResult(_0x89421f,null))[_0x8df7('0x40')](handleError(_0x89421f,null));};exports[_0x8df7('0x43')]=function(_0x329cdd,_0x575f06){return db['ChatOfflineMessage']['find']({'where':{'id':_0x329cdd[_0x8df7('0x3c')]['id']}})[_0x8df7('0x1f')](handleEntityNotFound(_0x575f06,null))[_0x8df7('0x1f')](removeEntity(_0x575f06,null))[_0x8df7('0x40')](handleError(_0x575f06,null));};exports[_0x8df7('0x44')]=function(_0x4ee544,_0x45131b){return db[_0x8df7('0x39')][_0x8df7('0x44')]()[_0x8df7('0x1f')](respondWithResult(_0x45131b,null))[_0x8df7('0x40')](handleError(_0x45131b,null));}; \ No newline at end of file +var _0xcb87=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','then','include','findAll','catch','params','includeAll','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','name','index','ChatOfflineMessage','rawAttributes'];(function(_0x22077a,_0x219f67){var _0x495891=function(_0x468b61){while(--_0x468b61){_0x22077a['push'](_0x22077a['shift']());}};_0x495891(++_0x219f67);}(_0xcb87,0xf3));var _0x7cb8=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xcb87[_0x443494];return _0x4a6794;};'use strict';var pdf=require(_0x7cb8('0x0'));var emlformat=require(_0x7cb8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7cb8('0x2'));var jsonpatch=require(_0x7cb8('0x3'));var rp=require('request-promise');var moment=require(_0x7cb8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7cb8('0x5'));var util=require(_0x7cb8('0x6'));var path=require(_0x7cb8('0x7'));var sox=require(_0x7cb8('0x8'));var csv=require(_0x7cb8('0x9'));var ejs=require(_0x7cb8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7cb8('0xb'));var crypto=require(_0x7cb8('0xc'));var jsforce=require(_0x7cb8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7cb8('0x9'));var querystring=require(_0x7cb8('0xe'));var Papa=require(_0x7cb8('0xf'));var authService=require(_0x7cb8('0x10'));var hardwareService=require(_0x7cb8('0x11'));var Redis=require(_0x7cb8('0x12'));var qs=require(_0x7cb8('0x13'));var logger=require('../../config/logger')(_0x7cb8('0x14'));var utils=require(_0x7cb8('0x15'));var config=require(_0x7cb8('0x16'));var db=require(_0x7cb8('0x17'))['db'];function respondWithStatusCode(_0x2c8c38,_0x4c92a8){_0x4c92a8=_0x4c92a8||0xcc;return function(_0x357d9f){if(_0x357d9f){return _0x2c8c38[_0x7cb8('0x18')](_0x4c92a8);}return _0x2c8c38['status'](_0x4c92a8)['end']();};}function respondWithResult(_0x1a9c6d,_0x157df0){_0x157df0=_0x157df0||0xc8;return function(_0x27cdd2){if(_0x27cdd2){return _0x1a9c6d[_0x7cb8('0x19')](_0x157df0)[_0x7cb8('0x1a')](_0x27cdd2);}};}function respondWithFilteredResult(_0x334944,_0x3368e6){return function(_0x3af11d){if(_0x3af11d){var _0x4fe94a=_0x3af11d[_0x7cb8('0x1b')],_0x75c608=_0x3368e6['offset'],_0x4ec081=_0x3368e6[_0x7cb8('0x1c')]+_0x3368e6['limit'],_0x2a0005;if(_0x4ec081>=_0x4fe94a){_0x4ec081=_0x4fe94a;_0x2a0005=0xc8;}else{_0x2a0005=0xce;}_0x334944[_0x7cb8('0x19')](_0x2a0005);return _0x334944[_0x7cb8('0x1d')](_0x7cb8('0x1e'),_0x75c608+'-'+_0x4ec081+'/'+_0x4fe94a)[_0x7cb8('0x1a')](_0x3af11d);}return null;};}function patchUpdates(_0x5c55a7){return function(_0x548ea2){try{jsonpatch[_0x7cb8('0x1f')](_0x548ea2,_0x5c55a7,!![]);}catch(_0x560343){return BPromise[_0x7cb8('0x20')](_0x560343);}return _0x548ea2[_0x7cb8('0x21')]();};}function saveUpdates(_0x536070,_0x3614ee){return function(_0x5bdf45){if(_0x5bdf45){return _0x5bdf45[_0x7cb8('0x22')](_0x536070)['then'](function(_0x318a7e){return _0x318a7e;});}return null;};}function removeEntity(_0x55c30e,_0x4c16ff){return function(_0x135505){if(_0x135505){return _0x135505[_0x7cb8('0x23')]()['then'](function(){_0x55c30e[_0x7cb8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21681a,_0x444fab){return function(_0x301566){if(!_0x301566){_0x21681a['sendStatus'](0x194);}return _0x301566;};}function handleError(_0x436409,_0x179cc9){_0x179cc9=_0x179cc9||0x1f4;return function(_0x406982){logger[_0x7cb8('0x24')](_0x406982['stack']);if(_0x406982[_0x7cb8('0x25')]){delete _0x406982[_0x7cb8('0x25')];}_0x436409[_0x7cb8('0x19')](_0x179cc9)['send'](_0x406982);};}exports[_0x7cb8('0x26')]=function(_0x610e10,_0x1dd1a1){var _0x4cc81a={},_0x3c1f12={},_0xf6f4ff={'count':0x0,'rows':[]};var _0x10d7f1=db[_0x7cb8('0x27')][_0x7cb8('0x28')];_0x3c1f12[_0x7cb8('0x29')]=_[_0x7cb8('0x2a')](_0x10d7f1);_0x3c1f12[_0x7cb8('0x2b')]=_['keys'](_0x610e10[_0x7cb8('0x2b')]);_0x3c1f12[_0x7cb8('0x2c')]=_[_0x7cb8('0x2d')](_0x3c1f12[_0x7cb8('0x29')],_0x3c1f12['query']);_0x4cc81a['attributes']=_['intersection'](_0x3c1f12[_0x7cb8('0x29')],qs['fields'](_0x610e10[_0x7cb8('0x2b')][_0x7cb8('0x2e')]));_0x4cc81a[_0x7cb8('0x2f')]=_0x4cc81a[_0x7cb8('0x2f')][_0x7cb8('0x30')]?_0x4cc81a[_0x7cb8('0x2f')]:_0x3c1f12[_0x7cb8('0x29')];if(!_0x610e10['query'][_0x7cb8('0x31')](_0x7cb8('0x32'))){_0x4cc81a['limit']=qs[_0x7cb8('0x33')](_0x610e10['query'][_0x7cb8('0x33')]);_0x4cc81a[_0x7cb8('0x1c')]=qs[_0x7cb8('0x1c')](_0x610e10[_0x7cb8('0x2b')]['offset']);}_0x4cc81a[_0x7cb8('0x34')]=qs[_0x7cb8('0x35')](_0x610e10[_0x7cb8('0x2b')][_0x7cb8('0x35')]);_0x4cc81a[_0x7cb8('0x36')]=qs[_0x7cb8('0x2c')](_[_0x7cb8('0x37')](_0x610e10['query'],_0x3c1f12[_0x7cb8('0x2c')]));if(_0x610e10[_0x7cb8('0x2b')][_0x7cb8('0x38')]){_0x4cc81a[_0x7cb8('0x36')]=_[_0x7cb8('0x39')](_0x4cc81a['where'],{'$or':_[_0x7cb8('0x3a')](_0x10d7f1,function(_0x250ca6){if(_0x250ca6['type']['key']!==_0x7cb8('0x3b')){var _0x4d342c={};_0x4d342c[_0x250ca6[_0x7cb8('0x3c')]]={'$like':'%'+_0x610e10['query'][_0x7cb8('0x38')]+'%'};return _0x4d342c;}})});}_0x4cc81a=_['merge']({},_0x4cc81a,_0x610e10[_0x7cb8('0x3d')]);var _0x387bbe={'where':_0x4cc81a[_0x7cb8('0x36')]};return db[_0x7cb8('0x27')][_0x7cb8('0x1b')](_0x387bbe)[_0x7cb8('0x3e')](function(_0x2a9842){_0xf6f4ff[_0x7cb8('0x1b')]=_0x2a9842;if(_0x610e10[_0x7cb8('0x2b')]['includeAll']){_0x4cc81a[_0x7cb8('0x3f')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x7cb8('0x40')](_0x4cc81a);})[_0x7cb8('0x3e')](function(_0x55d46f){_0xf6f4ff['rows']=_0x55d46f;return _0xf6f4ff;})[_0x7cb8('0x3e')](respondWithFilteredResult(_0x1dd1a1,_0x4cc81a))[_0x7cb8('0x41')](handleError(_0x1dd1a1,null));};exports['show']=function(_0x5917c9,_0x12dd8f){var _0x227f97={'raw':!![],'where':{'id':_0x5917c9[_0x7cb8('0x42')]['id']}},_0x51cb02={};_0x51cb02[_0x7cb8('0x29')]=_[_0x7cb8('0x2a')](db[_0x7cb8('0x27')][_0x7cb8('0x28')]);_0x51cb02[_0x7cb8('0x2b')]=_[_0x7cb8('0x2a')](_0x5917c9[_0x7cb8('0x2b')]);_0x51cb02[_0x7cb8('0x2c')]=_[_0x7cb8('0x2d')](_0x51cb02['model'],_0x51cb02[_0x7cb8('0x2b')]);_0x227f97[_0x7cb8('0x2f')]=_['intersection'](_0x51cb02[_0x7cb8('0x29')],qs[_0x7cb8('0x2e')](_0x5917c9[_0x7cb8('0x2b')]['fields']));_0x227f97[_0x7cb8('0x2f')]=_0x227f97[_0x7cb8('0x2f')][_0x7cb8('0x30')]?_0x227f97[_0x7cb8('0x2f')]:_0x51cb02[_0x7cb8('0x29')];if(_0x5917c9[_0x7cb8('0x2b')][_0x7cb8('0x43')]){_0x227f97[_0x7cb8('0x3f')]=[{'all':!![]}];}_0x227f97=_[_0x7cb8('0x39')]({},_0x227f97,_0x5917c9[_0x7cb8('0x3d')]);return db['ChatOfflineMessage'][_0x7cb8('0x44')](_0x227f97)[_0x7cb8('0x3e')](handleEntityNotFound(_0x12dd8f,null))['then'](respondWithResult(_0x12dd8f,null))[_0x7cb8('0x41')](handleError(_0x12dd8f,null));};exports['create']=function(_0x3fe0fc,_0x4dd82a){return db[_0x7cb8('0x27')][_0x7cb8('0x45')](_0x3fe0fc['body'],{})[_0x7cb8('0x3e')](respondWithResult(_0x4dd82a,0xc9))[_0x7cb8('0x41')](handleError(_0x4dd82a,null));};exports[_0x7cb8('0x22')]=function(_0x4c68d4,_0x127646){if(_0x4c68d4['body']['id']){delete _0x4c68d4['body']['id'];}return db[_0x7cb8('0x27')][_0x7cb8('0x44')]({'where':{'id':_0x4c68d4[_0x7cb8('0x42')]['id']}})[_0x7cb8('0x3e')](handleEntityNotFound(_0x127646,null))[_0x7cb8('0x3e')](saveUpdates(_0x4c68d4[_0x7cb8('0x46')],null))[_0x7cb8('0x3e')](respondWithResult(_0x127646,null))[_0x7cb8('0x41')](handleError(_0x127646,null));};exports[_0x7cb8('0x23')]=function(_0x56bb9c,_0x13fad2){return db['ChatOfflineMessage']['find']({'where':{'id':_0x56bb9c[_0x7cb8('0x42')]['id']}})['then'](handleEntityNotFound(_0x13fad2,null))[_0x7cb8('0x3e')](removeEntity(_0x13fad2,null))[_0x7cb8('0x41')](handleError(_0x13fad2,null));};exports['describe']=function(_0xb23758,_0x3a77b4){return db[_0x7cb8('0x27')]['describe']()[_0x7cb8('0x3e')](respondWithResult(_0x3a77b4,null))[_0x7cb8('0x41')](handleError(_0x3a77b4,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index dc5f8f0..464be87 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 _0xc053=['util','../../config/logger','api','bluebird','request-promise','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x293704,_0x5ec4bb){var _0x5d84fc=function(_0x413db4){while(--_0x413db4){_0x293704['push'](_0x293704['shift']());}};_0x5d84fc(++_0x5ec4bb);}(_0xc053,0x1d5));var _0x3c05=function(_0x54e5eb,_0x650daf){_0x54e5eb=_0x54e5eb-0x0;var _0x3030cc=_0xc053[_0x54e5eb];return _0x3030cc;};'use strict';var _=require(_0x3c05('0x0'));var util=require(_0x3c05('0x1'));var logger=require(_0x3c05('0x2'))(_0x3c05('0x3'));var moment=require('moment');var BPromise=require(_0x3c05('0x4'));var rp=require(_0x3c05('0x5'));var attributes=require(_0x3c05('0x6'));module[_0x3c05('0x7')]=function(_0x21b10f,_0x1e90b6){return _0x21b10f['define']('ChatOfflineMessage',attributes,{'tableName':_0x3c05('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3c05('0x9')});}; \ No newline at end of file +var _0x3ab8=['define','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x400c6e,_0x274fd6){var _0x3f8a47=function(_0x1a8a03){while(--_0x1a8a03){_0x400c6e['push'](_0x400c6e['shift']());}};_0x3f8a47(++_0x274fd6);}(_0x3ab8,0x85));var _0x83ab=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3ab8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x83ab('0x0'));var util=require(_0x83ab('0x1'));var logger=require(_0x83ab('0x2'))(_0x83ab('0x3'));var moment=require(_0x83ab('0x4'));var BPromise=require(_0x83ab('0x5'));var rp=require(_0x83ab('0x6'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x24a97e,_0x27098f){return _0x24a97e[_0x83ab('0x7')]('ChatOfflineMessage',attributes,{'tableName':_0x83ab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x83ab('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 71bf80e..2a05f89 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 _0x3dbb=['client','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x3dbb,0x15c));var _0xb3db=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x3dbb[_0x4b2251];return _0x5d22fb;};'use strict';var _=require('lodash');var util=require(_0xb3db('0x0'));var moment=require(_0xb3db('0x1'));var BPromise=require(_0xb3db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3db('0x3'));var db=require(_0xb3db('0x4'))['db'];var utils=require(_0xb3db('0x5'));var logger=require(_0xb3db('0x6'))('rpc');var config=require(_0xb3db('0x7'));var jayson=require(_0xb3db('0x8'));var client=jayson[_0xb3db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1f23,_0x24eb23,_0x27b2cd){return new BPromise(function(_0x14e86b,_0x6909f2){return client[_0xb3db('0xa')](_0x2f1f23,_0x27b2cd)['then'](function(_0x468139){logger[_0xb3db('0xb')](_0xb3db('0xc'),_0x24eb23,'request\x20sent');logger[_0xb3db('0xd')](_0xb3db('0xe'),_0x24eb23,_0xb3db('0xf'),JSON['stringify'](_0x468139));if(_0x468139[_0xb3db('0x10')]){if(_0x468139['error'][_0xb3db('0x11')]===0x1f4){logger[_0xb3db('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x24eb23,_0x468139[_0xb3db('0x10')][_0xb3db('0x12')]);return _0x6909f2(_0x468139[_0xb3db('0x10')][_0xb3db('0x12')]);}logger[_0xb3db('0x10')](_0xb3db('0xc'),_0x24eb23,_0x468139[_0xb3db('0x10')][_0xb3db('0x12')]);return _0x14e86b(_0x468139['error'][_0xb3db('0x12')]);}else{logger[_0xb3db('0xb')](_0xb3db('0xc'),_0x24eb23,'request\x20sent');_0x14e86b(_0x468139[_0xb3db('0x13')]['message']);}})[_0xb3db('0x14')](function(_0x482338){logger[_0xb3db('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x24eb23,_0x482338);_0x6909f2(_0x482338);});});} \ No newline at end of file +var _0x6fc9=['stringify','error','message','result','util','bluebird','../../mysqldb','../../config/logger','client','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x177c8d,_0x15a8af){var _0x2a771b=function(_0x3b2763){while(--_0x3b2763){_0x177c8d['push'](_0x177c8d['shift']());}};_0x2a771b(++_0x15a8af);}(_0x6fc9,0x108));var _0x96fc=function(_0x337da7,_0x1fcb31){_0x337da7=_0x337da7-0x0;var _0x347c4f=_0x6fc9[_0x337da7];return _0x347c4f;};'use strict';var _=require('lodash');var util=require(_0x96fc('0x0'));var moment=require('moment');var BPromise=require(_0x96fc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96fc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x96fc('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x96fc('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421d55,_0x153883,_0x58e383){return new BPromise(function(_0x51c950,_0x32a59f){return client[_0x96fc('0x5')](_0x421d55,_0x58e383)['then'](function(_0x2c8317){logger['info'](_0x96fc('0x6'),_0x153883,_0x96fc('0x7'));logger[_0x96fc('0x8')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x153883,_0x96fc('0x7'),JSON[_0x96fc('0x9')](_0x2c8317));if(_0x2c8317['error']){if(_0x2c8317[_0x96fc('0xa')]['code']===0x1f4){logger[_0x96fc('0xa')](_0x96fc('0x6'),_0x153883,_0x2c8317[_0x96fc('0xa')][_0x96fc('0xb')]);return _0x32a59f(_0x2c8317[_0x96fc('0xa')]['message']);}logger[_0x96fc('0xa')](_0x96fc('0x6'),_0x153883,_0x2c8317[_0x96fc('0xa')]['message']);return _0x51c950(_0x2c8317[_0x96fc('0xa')][_0x96fc('0xb')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x153883,'request\x20sent');_0x51c950(_0x2c8317[_0x96fc('0xc')][_0x96fc('0xb')]);}})['catch'](function(_0xc8a3d3){logger[_0x96fc('0xa')](_0x96fc('0x6'),_0x153883,_0xc8a3d3);_0x32a59f(_0xc8a3d3);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1729621..415a5d6 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 _0x9f75=['put','update','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','describe','get','/:id','show','create'];(function(_0x502036,_0x502686){var _0x485247=function(_0x135ee3){while(--_0x135ee3){_0x502036['push'](_0x502036['shift']());}};_0x485247(++_0x502686);}(_0x9f75,0x15a));var _0x59f7=function(_0x301dc5,_0x4ae4c8){_0x301dc5=_0x301dc5-0x0;var _0x44bf5a=_0x9f75[_0x301dc5];return _0x44bf5a;};'use strict';var multer=require(_0x59f7('0x0'));var util=require('util');var path=require(_0x59f7('0x1'));var timeout=require(_0x59f7('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x59f7('0x3'));var interaction=require(_0x59f7('0x4'));var config=require(_0x59f7('0x5'));var controller=require(_0x59f7('0x6'));router['get']('/',auth[_0x59f7('0x7')](),controller[_0x59f7('0x8')]);router['get']('/describe',auth[_0x59f7('0x7')](),controller[_0x59f7('0x9')]);router[_0x59f7('0xa')](_0x59f7('0xb'),auth[_0x59f7('0x7')](),controller[_0x59f7('0xc')]);router['post']('/',auth[_0x59f7('0x7')](),controller[_0x59f7('0xd')]);router[_0x59f7('0xe')](_0x59f7('0xb'),auth['isAuthenticated'](),controller[_0x59f7('0xf')]);router['delete'](_0x59f7('0xb'),auth['isAuthenticated'](),controller[_0x59f7('0x10')]);module[_0x59f7('0x11')]=router; \ No newline at end of file +var _0x280f=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x280f,0xe2));var _0xf280=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x280f[_0x1ca890];return _0x3f8e01;};'use strict';var multer=require(_0xf280('0x0'));var util=require('util');var path=require(_0xf280('0x1'));var timeout=require(_0xf280('0x2'));var express=require(_0xf280('0x3'));var router=express[_0xf280('0x4')]();var auth=require(_0xf280('0x5'));var interaction=require(_0xf280('0x6'));var config=require(_0xf280('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xf280('0x8')]('/',auth[_0xf280('0x9')](),controller[_0xf280('0xa')]);router[_0xf280('0x8')](_0xf280('0xb'),auth['isAuthenticated'](),controller[_0xf280('0xc')]);router[_0xf280('0x8')](_0xf280('0xd'),auth[_0xf280('0x9')](),controller[_0xf280('0xe')]);router[_0xf280('0xf')]('/',auth['isAuthenticated'](),controller[_0xf280('0x10')]);router[_0xf280('0x11')](_0xf280('0xd'),auth[_0xf280('0x9')](),controller[_0xf280('0x12')]);router[_0xf280('0x13')](_0xf280('0xd'),auth[_0xf280('0x9')](),controller[_0xf280('0x14')]);module[_0xf280('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index cb320cf..e2b67b4 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 _0x7ea6=['sequelize','exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x169576,_0x46a96c){var _0x4850cb=function(_0x129f05){while(--_0x129f05){_0x169576['push'](_0x169576['shift']());}};_0x4850cb(++_0x46a96c);}(_0x7ea6,0x13b));var _0x67ea=function(_0xa263fb,_0x63eed2){_0xa263fb=_0xa263fb-0x0;var _0x12bb85=_0x7ea6[_0xa263fb];return _0x12bb85;};'use strict';var Sequelize=require(_0x67ea('0x0'));module[_0x67ea('0x1')]={'name':{'type':Sequelize[_0x67ea('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x67ea('0x3')]('mouseOver',_0x67ea('0x4')),'defaultValue':_0x67ea('0x5')},'selector':{'type':Sequelize[_0x67ea('0x2')]},'timeout':{'type':Sequelize[_0x67ea('0x6')]}}; \ No newline at end of file +var _0x6d60=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x8c228e,_0x508e1c){var _0x56a968=function(_0x573349){while(--_0x573349){_0x8c228e['push'](_0x8c228e['shift']());}};_0x56a968(++_0x508e1c);}(_0x6d60,0x16a));var _0x06d6=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x6d60[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0x06d6('0x0'));module[_0x06d6('0x1')]={'name':{'type':Sequelize[_0x06d6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x06d6('0x3')](_0x06d6('0x4'),'timeout'),'defaultValue':_0x06d6('0x4')},'selector':{'type':Sequelize[_0x06d6('0x2')]},'timeout':{'type':Sequelize[_0x06d6('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index acb5ce8..5f940e4 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 _0x3379=['path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','destroy','end','error','stack','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','length','merge','options','find','then','create','catch','update','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x2de41e,_0x12a7dc){var _0x2e70d1=function(_0x3e77ba){while(--_0x3e77ba){_0x2de41e['push'](_0x2de41e['shift']());}};_0x2e70d1(++_0x12a7dc);}(_0x3379,0x115));var _0x9337=function(_0x887960,_0x2e283e){_0x887960=_0x887960-0x0;var _0x1f34cb=_0x3379[_0x887960];return _0x1f34cb;};'use strict';var pdf=require(_0x9337('0x0'));var emlformat=require(_0x9337('0x1'));var rimraf=require(_0x9337('0x2'));var zipdir=require(_0x9337('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9337('0x4'));var moment=require(_0x9337('0x5'));var BPromise=require(_0x9337('0x6'));var Mustache=require(_0x9337('0x7'));var util=require('util');var path=require(_0x9337('0x8'));var sox=require(_0x9337('0x9'));var csv=require(_0x9337('0xa'));var ejs=require(_0x9337('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9337('0xc'));var crypto=require('crypto');var jsforce=require(_0x9337('0xd'));var deskjs=require(_0x9337('0xe'));var toCsv=require(_0x9337('0xa'));var querystring=require(_0x9337('0xf'));var Papa=require(_0x9337('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9337('0x11'));var Redis=require(_0x9337('0x12'));var qs=require(_0x9337('0x13'));var logger=require(_0x9337('0x14'))(_0x9337('0x15'));var utils=require('../../config/utils');var config=require(_0x9337('0x16'));var db=require(_0x9337('0x17'))['db'];function respondWithStatusCode(_0x3cd78e,_0x2d1121){_0x2d1121=_0x2d1121||0xcc;return function(_0x3303f6){if(_0x3303f6){return _0x3cd78e[_0x9337('0x18')](_0x2d1121);}return _0x3cd78e[_0x9337('0x19')](_0x2d1121)['end']();};}function respondWithResult(_0x4dafd1,_0xa58254){_0xa58254=_0xa58254||0xc8;return function(_0xedb2b6){if(_0xedb2b6){return _0x4dafd1[_0x9337('0x19')](_0xa58254)[_0x9337('0x1a')](_0xedb2b6);}};}function respondWithFilteredResult(_0x4c246d,_0x5d5d0f){return function(_0x13515e){if(_0x13515e){var _0x594b51=_0x13515e[_0x9337('0x1b')],_0x513263=_0x5d5d0f['offset'],_0x35e805=_0x5d5d0f[_0x9337('0x1c')]+_0x5d5d0f[_0x9337('0x1d')],_0x13a207;if(_0x35e805>=_0x594b51){_0x35e805=_0x594b51;_0x13a207=0xc8;}else{_0x13a207=0xce;}_0x4c246d['status'](_0x13a207);return _0x4c246d['set'](_0x9337('0x1e'),_0x513263+'-'+_0x35e805+'/'+_0x594b51)[_0x9337('0x1a')](_0x13515e);}return null;};}function patchUpdates(_0x4a27cc){return function(_0x1bae86){try{jsonpatch[_0x9337('0x1f')](_0x1bae86,_0x4a27cc,!![]);}catch(_0x4e9802){return BPromise[_0x9337('0x20')](_0x4e9802);}return _0x1bae86[_0x9337('0x21')]();};}function saveUpdates(_0x5ab5dc,_0x1b8753){return function(_0x7c334f){if(_0x7c334f){return _0x7c334f['update'](_0x5ab5dc)['then'](function(_0x28a237){return _0x28a237;});}return null;};}function removeEntity(_0x48f370,_0x44eb84){return function(_0x55601a){if(_0x55601a){return _0x55601a[_0x9337('0x22')]()['then'](function(){_0x48f370['status'](0xcc)[_0x9337('0x23')]();});}};}function handleEntityNotFound(_0x4fd485,_0xe4b053){return function(_0x543cfc){if(!_0x543cfc){_0x4fd485[_0x9337('0x18')](0x194);}return _0x543cfc;};}function handleError(_0x332238,_0x32d924){_0x32d924=_0x32d924||0x1f4;return function(_0x33498a){logger[_0x9337('0x24')](_0x33498a[_0x9337('0x25')]);if(_0x33498a['name']){delete _0x33498a['name'];}_0x332238[_0x9337('0x19')](_0x32d924)[_0x9337('0x26')](_0x33498a);};}exports[_0x9337('0x27')]=function(_0x178ed5,_0x4ef25a){var _0x453f19={'raw':!![],'where':{'id':_0x178ed5[_0x9337('0x28')]['id']}},_0x48e884={};_0x48e884[_0x9337('0x29')]=_[_0x9337('0x2a')](db[_0x9337('0x2b')]['rawAttributes']);_0x48e884['query']=_[_0x9337('0x2a')](_0x178ed5[_0x9337('0x2c')]);_0x48e884[_0x9337('0x2d')]=_[_0x9337('0x2e')](_0x48e884[_0x9337('0x29')],_0x48e884['query']);_0x453f19[_0x9337('0x2f')]=_['intersection'](_0x48e884[_0x9337('0x29')],qs['fields'](_0x178ed5['query']['fields']));_0x453f19['attributes']=_0x453f19[_0x9337('0x2f')][_0x9337('0x30')]?_0x453f19[_0x9337('0x2f')]:_0x48e884[_0x9337('0x29')];if(_0x178ed5[_0x9337('0x2c')]['includeAll']){_0x453f19['include']=[{'all':!![]}];}_0x453f19=_[_0x9337('0x31')]({},_0x453f19,_0x178ed5[_0x9337('0x32')]);return db[_0x9337('0x2b')][_0x9337('0x33')](_0x453f19)[_0x9337('0x34')](handleEntityNotFound(_0x4ef25a,null))[_0x9337('0x34')](respondWithResult(_0x4ef25a,null))['catch'](handleError(_0x4ef25a,null));};exports[_0x9337('0x35')]=function(_0x21d3d9,_0x3ca9d2){return db['ChatProactiveAction'][_0x9337('0x35')](_0x21d3d9['body'],{})[_0x9337('0x34')](respondWithResult(_0x3ca9d2,0xc9))[_0x9337('0x36')](handleError(_0x3ca9d2,null));};exports[_0x9337('0x37')]=function(_0x24518b,_0x4fb036){if(_0x24518b[_0x9337('0x38')]['id']){delete _0x24518b[_0x9337('0x38')]['id'];}return db[_0x9337('0x2b')][_0x9337('0x33')]({'where':{'id':_0x24518b[_0x9337('0x28')]['id']}})[_0x9337('0x34')](handleEntityNotFound(_0x4fb036,null))[_0x9337('0x34')](saveUpdates(_0x24518b[_0x9337('0x38')],null))[_0x9337('0x34')](respondWithResult(_0x4fb036,null))['catch'](handleError(_0x4fb036,null));};exports[_0x9337('0x22')]=function(_0x240d3c,_0x58d239){return db[_0x9337('0x2b')][_0x9337('0x33')]({'where':{'id':_0x240d3c[_0x9337('0x28')]['id']}})[_0x9337('0x34')](handleEntityNotFound(_0x58d239,null))['then'](removeEntity(_0x58d239,null))[_0x9337('0x36')](handleError(_0x58d239,null));}; \ No newline at end of file +var _0xb76c=['intersection','attributes','fields','length','includeAll','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../mysqldb','sendStatus','status','json','limit','set','apply','reject','save','update','destroy','then','name','send','show','params','model','keys','rawAttributes','query','filters'];(function(_0x33da90,_0x1fa3dd){var _0x5749f4=function(_0x30250d){while(--_0x30250d){_0x33da90['push'](_0x33da90['shift']());}};_0x5749f4(++_0x1fa3dd);}(_0xb76c,0x74));var _0xcb76=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0xb76c[_0x478414];return _0x5eb6b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcb76('0x0'));var rimraf=require(_0xcb76('0x1'));var zipdir=require(_0xcb76('0x2'));var jsonpatch=require(_0xcb76('0x3'));var rp=require(_0xcb76('0x4'));var moment=require(_0xcb76('0x5'));var BPromise=require(_0xcb76('0x6'));var Mustache=require(_0xcb76('0x7'));var util=require('util');var path=require(_0xcb76('0x8'));var sox=require(_0xcb76('0x9'));var csv=require(_0xcb76('0xa'));var ejs=require(_0xcb76('0xb'));var fs=require('fs');var _=require(_0xcb76('0xc'));var squel=require(_0xcb76('0xd'));var crypto=require(_0xcb76('0xe'));var jsforce=require(_0xcb76('0xf'));var deskjs=require(_0xcb76('0x10'));var toCsv=require(_0xcb76('0xa'));var querystring=require('querystring');var Papa=require(_0xcb76('0x11'));var authService=require(_0xcb76('0x12'));var hardwareService=require(_0xcb76('0x13'));var Redis=require(_0xcb76('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xcb76('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcb76('0x16'))['db'];function respondWithStatusCode(_0x54d043,_0x5236e9){_0x5236e9=_0x5236e9||0xcc;return function(_0x1534a2){if(_0x1534a2){return _0x54d043[_0xcb76('0x17')](_0x5236e9);}return _0x54d043[_0xcb76('0x18')](_0x5236e9)['end']();};}function respondWithResult(_0x3a865e,_0x1c21a0){_0x1c21a0=_0x1c21a0||0xc8;return function(_0x191333){if(_0x191333){return _0x3a865e['status'](_0x1c21a0)[_0xcb76('0x19')](_0x191333);}};}function respondWithFilteredResult(_0x386e17,_0xe1a2c3){return function(_0x3f9b22){if(_0x3f9b22){var _0x2e27a6=_0x3f9b22['count'],_0x16ceb9=_0xe1a2c3['offset'],_0x1066c6=_0xe1a2c3['offset']+_0xe1a2c3[_0xcb76('0x1a')],_0x596edc;if(_0x1066c6>=_0x2e27a6){_0x1066c6=_0x2e27a6;_0x596edc=0xc8;}else{_0x596edc=0xce;}_0x386e17[_0xcb76('0x18')](_0x596edc);return _0x386e17[_0xcb76('0x1b')]('Content-Range',_0x16ceb9+'-'+_0x1066c6+'/'+_0x2e27a6)['json'](_0x3f9b22);}return null;};}function patchUpdates(_0x33c925){return function(_0x38a974){try{jsonpatch[_0xcb76('0x1c')](_0x38a974,_0x33c925,!![]);}catch(_0x35626a){return BPromise[_0xcb76('0x1d')](_0x35626a);}return _0x38a974[_0xcb76('0x1e')]();};}function saveUpdates(_0x8f1be8,_0x397e17){return function(_0x41704c){if(_0x41704c){return _0x41704c[_0xcb76('0x1f')](_0x8f1be8)['then'](function(_0x9bf589){return _0x9bf589;});}return null;};}function removeEntity(_0x441503,_0x2e5f7d){return function(_0x3193db){if(_0x3193db){return _0x3193db[_0xcb76('0x20')]()[_0xcb76('0x21')](function(){_0x441503[_0xcb76('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a44ad,_0x677479){return function(_0x2e359d){if(!_0x2e359d){_0x4a44ad[_0xcb76('0x17')](0x194);}return _0x2e359d;};}function handleError(_0x3e3766,_0x1e2ae5){_0x1e2ae5=_0x1e2ae5||0x1f4;return function(_0x3de9e0){logger['error'](_0x3de9e0['stack']);if(_0x3de9e0[_0xcb76('0x22')]){delete _0x3de9e0[_0xcb76('0x22')];}_0x3e3766[_0xcb76('0x18')](_0x1e2ae5)[_0xcb76('0x23')](_0x3de9e0);};}exports[_0xcb76('0x24')]=function(_0x5cbb10,_0x1d058e){var _0xc623bb={'raw':!![],'where':{'id':_0x5cbb10[_0xcb76('0x25')]['id']}},_0x37ea7b={};_0x37ea7b[_0xcb76('0x26')]=_[_0xcb76('0x27')](db['ChatProactiveAction'][_0xcb76('0x28')]);_0x37ea7b['query']=_['keys'](_0x5cbb10[_0xcb76('0x29')]);_0x37ea7b[_0xcb76('0x2a')]=_[_0xcb76('0x2b')](_0x37ea7b[_0xcb76('0x26')],_0x37ea7b[_0xcb76('0x29')]);_0xc623bb[_0xcb76('0x2c')]=_[_0xcb76('0x2b')](_0x37ea7b[_0xcb76('0x26')],qs['fields'](_0x5cbb10['query'][_0xcb76('0x2d')]));_0xc623bb[_0xcb76('0x2c')]=_0xc623bb[_0xcb76('0x2c')][_0xcb76('0x2e')]?_0xc623bb[_0xcb76('0x2c')]:_0x37ea7b[_0xcb76('0x26')];if(_0x5cbb10[_0xcb76('0x29')][_0xcb76('0x2f')]){_0xc623bb['include']=[{'all':!![]}];}_0xc623bb=_['merge']({},_0xc623bb,_0x5cbb10['options']);return db[_0xcb76('0x30')][_0xcb76('0x31')](_0xc623bb)[_0xcb76('0x21')](handleEntityNotFound(_0x1d058e,null))['then'](respondWithResult(_0x1d058e,null))[_0xcb76('0x32')](handleError(_0x1d058e,null));};exports[_0xcb76('0x33')]=function(_0x325f42,_0x2dbc5c){return db['ChatProactiveAction'][_0xcb76('0x33')](_0x325f42[_0xcb76('0x34')],{})['then'](respondWithResult(_0x2dbc5c,0xc9))[_0xcb76('0x32')](handleError(_0x2dbc5c,null));};exports[_0xcb76('0x1f')]=function(_0x512ca1,_0x2eb10b){if(_0x512ca1[_0xcb76('0x34')]['id']){delete _0x512ca1[_0xcb76('0x34')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x512ca1[_0xcb76('0x25')]['id']}})['then'](handleEntityNotFound(_0x2eb10b,null))['then'](saveUpdates(_0x512ca1[_0xcb76('0x34')],null))['then'](respondWithResult(_0x2eb10b,null))[_0xcb76('0x32')](handleError(_0x2eb10b,null));};exports[_0xcb76('0x20')]=function(_0x408a9e,_0x5592ff){return db['ChatProactiveAction'][_0xcb76('0x31')]({'where':{'id':_0x408a9e['params']['id']}})[_0xcb76('0x21')](handleEntityNotFound(_0x5592ff,null))[_0xcb76('0x21')](removeEntity(_0x5592ff,null))[_0xcb76('0x32')](handleError(_0x5592ff,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 798d394..c5360f5 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 _0x0295=['lodash','api','request-promise','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x160814,_0x57b5c6){var _0x427a69=function(_0x3f1485){while(--_0x3f1485){_0x160814['push'](_0x160814['shift']());}};_0x427a69(++_0x57b5c6);}(_0x0295,0x1f0));var _0x5029=function(_0x4cfd78,_0x52355e){_0x4cfd78=_0x4cfd78-0x0;var _0xf4a95a=_0x0295[_0x4cfd78];return _0xf4a95a;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var attributes=require(_0x5029('0x3'));module[_0x5029('0x4')]=function(_0x3d0af1,_0x170504){return _0x3d0af1[_0x5029('0x5')](_0x5029('0x6'),attributes,{'tableName':_0x5029('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1967=['chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','./chatProactiveAction.attributes','exports','ChatProactiveAction'];(function(_0x299c43,_0x18aea6){var _0x4e94cc=function(_0x29f8f7){while(--_0x29f8f7){_0x299c43['push'](_0x299c43['shift']());}};_0x4e94cc(++_0x18aea6);}(_0x1967,0x173));var _0x7196=function(_0x55949f,_0xc28783){_0x55949f=_0x55949f-0x0;var _0x5eddf3=_0x1967[_0x55949f];return _0x5eddf3;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var attributes=require(_0x7196('0x6'));module[_0x7196('0x7')]=function(_0x458ae8,_0x3ae43f){return _0x458ae8['define'](_0x7196('0x8'),attributes,{'tableName':_0x7196('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 97aaddd..4120a4e 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17ac01,_0x334bf1){var _0x2ef69a=function(_0x54569d){while(--_0x54569d){_0x17ac01['push'](_0x17ac01['shift']());}};_0x2ef69a(++_0x334bf1);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x17f27c,_0x25149b){var _0x27ba38=function(_0x334c66){while(--_0x334c66){_0x17f27c['push'](_0x17f27c['shift']());}};_0x27ba38(++_0x25149b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a30fb72..60c0c16 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 _0x1f81=['/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x1c1483,_0x344989){var _0x435d4d=function(_0x1ecc1a){while(--_0x1ecc1a){_0x1c1483['push'](_0x1c1483['shift']());}};_0x435d4d(++_0x344989);}(_0x1f81,0xab));var _0x11f8=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x1f81[_0x42ca15];return _0x1c6ded;};'use strict';var multer=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var path=require('path');var timeout=require(_0x11f8('0x2'));var express=require(_0x11f8('0x3'));var router=express['Router']();var auth=require(_0x11f8('0x4'));var interaction=require(_0x11f8('0x5'));var config=require(_0x11f8('0x6'));var controller=require(_0x11f8('0x7'));router[_0x11f8('0x8')](_0x11f8('0x9'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xb')]);router['post']('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0xc')]);router[_0x11f8('0xd')](_0x11f8('0x9'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xe')]);router[_0x11f8('0xf')](_0x11f8('0x9'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x10')]);module[_0x11f8('0x11')]=router; \ No newline at end of file +var _0x676c=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var path=require(_0xc676('0x2'));var timeout=require('connect-timeout');var express=require(_0xc676('0x3'));var router=express[_0xc676('0x4')]();var auth=require(_0xc676('0x5'));var interaction=require(_0xc676('0x6'));var config=require(_0xc676('0x7'));var controller=require(_0xc676('0x8'));router['get'](_0xc676('0x9'),auth[_0xc676('0xa')](),controller[_0xc676('0xb')]);router[_0xc676('0xc')]('/',auth[_0xc676('0xa')](),controller['create']);router[_0xc676('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc676('0xe')]);router[_0xc676('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc676('0x10')]);module[_0xc676('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index b4744eb..d5ae16a 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 _0x6a63=['rrmemory','exports','name','STRING','INTEGER','ENUM'];(function(_0xefeb97,_0x10f246){var _0x3a7aa8=function(_0x14c440){while(--_0x14c440){_0xefeb97['push'](_0xefeb97['shift']());}};_0x3a7aa8(++_0x10f246);}(_0x6a63,0x14b));var _0x36a6=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x6a63[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require('sequelize');module[_0x36a6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x36a6('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x36a6('0x2')]},'timeout':{'type':Sequelize[_0x36a6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x36a6('0x4')](_0x36a6('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xf7d5=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x49ab13,_0x15ee9d){var _0xbf55fe=function(_0x2034a1){while(--_0x2034a1){_0x49ab13['push'](_0x49ab13['shift']());}};_0xbf55fe(++_0x15ee9d);}(_0xf7d5,0x110));var _0x5f7d=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xf7d5[_0x1e48d3];return _0x2852b1;};'use strict';var Sequelize=require(_0x5f7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f7d('0x1')],'unique':_0x5f7d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5f7d('0x1')]},'timeout':{'type':Sequelize[_0x5f7d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f7d('0x4')]('rrmemory',_0x5f7d('0x5'),_0x5f7d('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c8e7043..2836aa0 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 _0x9e0a=['ChatQueueId','findAndCountAll','UserId','agent','name','createdAt','format','%s/%s','chatPause','updatedAt','getTeams','Team','ids','User','Agents','union','penalty','addTeams','removeTeams','removeAgents','addAgents','omit','spread','emit','userChatQueue:save','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','get','ChatQueues','UserProfileResource','ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','nolimit','order','pick'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9e0a,0x180));var _0xa9e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e0a[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa9e0('0x0'));var rimraf=require(_0xa9e0('0x1'));var zipdir=require(_0xa9e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa9e0('0x3'));var Mustache=require(_0xa9e0('0x4'));var util=require(_0xa9e0('0x5'));var path=require(_0xa9e0('0x6'));var sox=require(_0xa9e0('0x7'));var csv=require(_0xa9e0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa9e0('0x9'));var squel=require(_0xa9e0('0xa'));var crypto=require(_0xa9e0('0xb'));var jsforce=require(_0xa9e0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xa9e0('0xd'));var hardwareService=require(_0xa9e0('0xe'));var Redis=require(_0xa9e0('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xa9e0('0x10'))(_0xa9e0('0x11'));var utils=require(_0xa9e0('0x12'));var config=require(_0xa9e0('0x13'));var db=require(_0xa9e0('0x14'))['db'];config[_0xa9e0('0x15')]=_[_0xa9e0('0x16')](config[_0xa9e0('0x15')],{'host':_0xa9e0('0x17'),'port':0x18eb});var socket=require(_0xa9e0('0x18'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xa9e0('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa9e0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274a09,_0x4928f9,_0x293820,_0x1de241){return new BPromise(function(_0x455fee,_0x5496d0){var _0x5ebe06=_0x1de241||client;return _0x5ebe06[_0xa9e0('0x1b')](_0x274a09,_0x293820)[_0xa9e0('0x1c')](function(_0x51187a){logger[_0xa9e0('0x1d')](_0xa9e0('0x1e'),_0x4928f9,_0xa9e0('0x1f'));logger[_0xa9e0('0x20')](_0xa9e0('0x21'),_0x4928f9,_0xa9e0('0x1f'),JSON[_0xa9e0('0x22')](_0x51187a));if(_0x51187a[_0xa9e0('0x23')]){if(_0x51187a['error'][_0xa9e0('0x24')]===0x1f4){logger[_0xa9e0('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4928f9,_0x51187a[_0xa9e0('0x23')][_0xa9e0('0x25')]);return _0x5496d0(_0x51187a['error'][_0xa9e0('0x25')]);}logger[_0xa9e0('0x23')](_0xa9e0('0x1e'),_0x4928f9,_0x51187a[_0xa9e0('0x23')][_0xa9e0('0x25')]);return _0x455fee(_0x51187a[_0xa9e0('0x23')][_0xa9e0('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4928f9,_0xa9e0('0x1f'));_0x455fee(_0x51187a['result'][_0xa9e0('0x25')]);}})['catch'](function(_0x390a9f){logger[_0xa9e0('0x23')](_0xa9e0('0x1e'),_0x4928f9,_0x390a9f);_0x5496d0(_0x390a9f);});});}function respondWithStatusCode(_0x1c3940,_0x394219){_0x394219=_0x394219||0xcc;return function(_0x3d83b3){if(_0x3d83b3){return _0x1c3940[_0xa9e0('0x26')](_0x394219);}return _0x1c3940[_0xa9e0('0x27')](_0x394219)[_0xa9e0('0x28')]();};}function respondWithResult(_0x4fac0c,_0x5d42b9){_0x5d42b9=_0x5d42b9||0xc8;return function(_0x433ede){if(_0x433ede){return _0x4fac0c[_0xa9e0('0x27')](_0x5d42b9)[_0xa9e0('0x29')](_0x433ede);}};}function respondWithFilteredResult(_0x217915,_0x5abe56){return function(_0x1af56b){if(_0x1af56b){var _0x18325d=_0x1af56b[_0xa9e0('0x2a')],_0x2b1a43=_0x5abe56[_0xa9e0('0x2b')],_0x49f222=_0x5abe56['offset']+_0x5abe56[_0xa9e0('0x2c')],_0xf7d596;if(_0x49f222>=_0x18325d){_0x49f222=_0x18325d;_0xf7d596=0xc8;}else{_0xf7d596=0xce;}_0x217915[_0xa9e0('0x27')](_0xf7d596);return _0x217915[_0xa9e0('0x2d')](_0xa9e0('0x2e'),_0x2b1a43+'-'+_0x49f222+'/'+_0x18325d)['json'](_0x1af56b);}return null;};}function patchUpdates(_0x4ad2eb){return function(_0x5b528c){try{jsonpatch[_0xa9e0('0x2f')](_0x5b528c,_0x4ad2eb,!![]);}catch(_0x4a29ce){return BPromise['reject'](_0x4a29ce);}return _0x5b528c['save']();};}function saveUpdates(_0x128d91,_0x7cf968){return function(_0xcbaaf8){if(_0xcbaaf8){return _0xcbaaf8[_0xa9e0('0x30')](_0x128d91)[_0xa9e0('0x1c')](function(_0x1a4bcc){return _0x1a4bcc;});}return null;};}function removeEntity(_0xcd8c26,_0x571bad){return function(_0x29e564){if(_0x29e564){return _0x29e564[_0xa9e0('0x31')]()['then'](function(){var _0x4c372e=_0x29e564[_0xa9e0('0x32')]({'plain':!![]});var _0x132fec=_0xa9e0('0x33');return db[_0xa9e0('0x34')][_0xa9e0('0x31')]({'where':{'type':_0x132fec,'resourceId':_0x4c372e['id']}})[_0xa9e0('0x1c')](function(){return _0x29e564;});})[_0xa9e0('0x1c')](function(){_0xcd8c26['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ee164,_0x4cfe33){return function(_0x286fe3){if(!_0x286fe3){_0x3ee164['sendStatus'](0x194);}return _0x286fe3;};}function handleError(_0x540148,_0x5bbeed){_0x5bbeed=_0x5bbeed||0x1f4;return function(_0x5c33b2){logger['error'](_0x5c33b2['stack']);if(_0x5c33b2['name']){delete _0x5c33b2['name'];}_0x540148[_0xa9e0('0x27')](_0x5bbeed)['send'](_0x5c33b2);};}exports['index']=function(_0x4a18ef,_0x527e33){var _0x4c01ee={},_0x4d0eb9={},_0x7e589={'count':0x0,'rows':[]};var _0x14072d=db[_0xa9e0('0x35')][_0xa9e0('0x36')];_0x4d0eb9[_0xa9e0('0x37')]=_['keys'](_0x14072d);_0x4d0eb9['query']=_[_0xa9e0('0x38')](_0x4a18ef[_0xa9e0('0x39')]);_0x4d0eb9[_0xa9e0('0x3a')]=_[_0xa9e0('0x3b')](_0x4d0eb9[_0xa9e0('0x37')],_0x4d0eb9['query']);_0x4c01ee[_0xa9e0('0x3c')]=_[_0xa9e0('0x3b')](_0x4d0eb9[_0xa9e0('0x37')],qs[_0xa9e0('0x3d')](_0x4a18ef[_0xa9e0('0x39')][_0xa9e0('0x3d')]));_0x4c01ee[_0xa9e0('0x3c')]=_0x4c01ee[_0xa9e0('0x3c')][_0xa9e0('0x3e')]?_0x4c01ee['attributes']:_0x4d0eb9[_0xa9e0('0x37')];if(!_0x4a18ef['query'][_0xa9e0('0x3f')]('nolimit')){_0x4c01ee[_0xa9e0('0x2c')]=qs['limit'](_0x4a18ef[_0xa9e0('0x39')]['limit']);_0x4c01ee['offset']=qs[_0xa9e0('0x2b')](_0x4a18ef['query'][_0xa9e0('0x2b')]);}_0x4c01ee['order']=qs[_0xa9e0('0x40')](_0x4a18ef['query'][_0xa9e0('0x40')]);_0x4c01ee['where']=qs[_0xa9e0('0x3a')](_['pick'](_0x4a18ef['query'],_0x4d0eb9[_0xa9e0('0x3a')]));if(_0x4a18ef[_0xa9e0('0x39')][_0xa9e0('0x41')]){_0x4c01ee[_0xa9e0('0x42')]=_[_0xa9e0('0x43')](_0x4c01ee['where'],{'$or':_[_0xa9e0('0x44')](_0x14072d,function(_0x4ecd30){if(_0x4ecd30[_0xa9e0('0x45')]['key']!==_0xa9e0('0x46')){var _0x59dba8={};_0x59dba8[_0x4ecd30['field']]={'$like':'%'+_0x4a18ef[_0xa9e0('0x39')][_0xa9e0('0x41')]+'%'};return _0x59dba8;}})});}_0x4c01ee=_[_0xa9e0('0x43')]({},_0x4c01ee,_0x4a18ef[_0xa9e0('0x47')]);var _0x336b6f={'where':_0x4c01ee[_0xa9e0('0x42')]};return db['ChatQueue'][_0xa9e0('0x2a')](_0x336b6f)[_0xa9e0('0x1c')](function(_0x52dba4){_0x7e589[_0xa9e0('0x2a')]=_0x52dba4;if(_0x4a18ef['query'][_0xa9e0('0x48')]){_0x4c01ee[_0xa9e0('0x49')]=[{'all':!![]}];}return db[_0xa9e0('0x35')][_0xa9e0('0x4a')](_0x4c01ee);})[_0xa9e0('0x1c')](function(_0x32a155){_0x7e589['rows']=_0x32a155;return _0x7e589;})[_0xa9e0('0x1c')](respondWithFilteredResult(_0x527e33,_0x4c01ee))[_0xa9e0('0x4b')](handleError(_0x527e33,null));};exports[_0xa9e0('0x4c')]=function(_0x2623f9,_0x549518){var _0x27d3ca={'raw':!![],'where':{'id':_0x2623f9['params']['id']}},_0x4228fe={};_0x4228fe[_0xa9e0('0x37')]=_[_0xa9e0('0x38')](db[_0xa9e0('0x35')][_0xa9e0('0x36')]);_0x4228fe[_0xa9e0('0x39')]=_['keys'](_0x2623f9[_0xa9e0('0x39')]);_0x4228fe[_0xa9e0('0x3a')]=_[_0xa9e0('0x3b')](_0x4228fe[_0xa9e0('0x37')],_0x4228fe[_0xa9e0('0x39')]);_0x27d3ca[_0xa9e0('0x3c')]=_[_0xa9e0('0x3b')](_0x4228fe['model'],qs[_0xa9e0('0x3d')](_0x2623f9[_0xa9e0('0x39')][_0xa9e0('0x3d')]));_0x27d3ca[_0xa9e0('0x3c')]=_0x27d3ca[_0xa9e0('0x3c')]['length']?_0x27d3ca['attributes']:_0x4228fe['model'];if(_0x2623f9[_0xa9e0('0x39')]['includeAll']){_0x27d3ca['include']=[{'all':!![]}];}_0x27d3ca=_[_0xa9e0('0x43')]({},_0x27d3ca,_0x2623f9['options']);return db['ChatQueue'][_0xa9e0('0x4d')](_0x27d3ca)[_0xa9e0('0x1c')](handleEntityNotFound(_0x549518,null))[_0xa9e0('0x1c')](respondWithResult(_0x549518,null))[_0xa9e0('0x4b')](handleError(_0x549518,null));};exports['create']=function(_0x457b5c,_0x19183f){return db[_0xa9e0('0x35')][_0xa9e0('0x4e')](_0x457b5c[_0xa9e0('0x4f')],{})['then'](function(_0x2ffcec){var _0x525f6d=_0x457b5c[_0xa9e0('0x50')][_0xa9e0('0x32')]({'plain':!![]});if(!_0x525f6d)throw new Error(_0xa9e0('0x51'));if(_0x525f6d['role']===_0xa9e0('0x50')){var _0x56a3de=_0x2ffcec[_0xa9e0('0x32')]({'plain':!![]});var _0x1ba5b3='ChatQueues';return db['UserProfileSection'][_0xa9e0('0x4d')]({'where':{'name':_0x1ba5b3,'userProfileId':_0x525f6d[_0xa9e0('0x52')]},'raw':!![]})[_0xa9e0('0x1c')](function(_0x5a104c){if(_0x5a104c&&_0x5a104c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x56a3de['name'],'resourceId':_0x56a3de['id'],'type':_0x5a104c['name'],'sectionId':_0x5a104c['id']},{})[_0xa9e0('0x1c')](function(){return _0x2ffcec;});}else{return _0x2ffcec;}})['catch'](function(_0x36fab9){logger[_0xa9e0('0x23')](_0xa9e0('0x53'),_0x36fab9);throw _0x36fab9;});}return _0x2ffcec;})[_0xa9e0('0x1c')](respondWithResult(_0x19183f,0xc9))['catch'](handleError(_0x19183f,null));};exports[_0xa9e0('0x30')]=function(_0x19e9f3,_0x3a1f82){if(_0x19e9f3[_0xa9e0('0x4f')]['id']){delete _0x19e9f3['body']['id'];}return db['ChatQueue'][_0xa9e0('0x4d')]({'where':{'id':_0x19e9f3[_0xa9e0('0x54')]['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x3a1f82,null))[_0xa9e0('0x1c')](saveUpdates(_0x19e9f3[_0xa9e0('0x4f')],null))[_0xa9e0('0x1c')](respondWithResult(_0x3a1f82,null))[_0xa9e0('0x4b')](handleError(_0x3a1f82,null));};exports[_0xa9e0('0x31')]=function(_0x1f88d4,_0x1dd259){return db[_0xa9e0('0x35')]['find']({'where':{'id':_0x1f88d4['params']['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x1dd259,null))[_0xa9e0('0x1c')](removeEntity(_0x1dd259,null))['catch'](handleError(_0x1dd259,null));};exports[_0xa9e0('0x55')]=function(_0x45377b,_0x111cb4){return db['ChatQueue'][_0xa9e0('0x55')]()[_0xa9e0('0x1c')](respondWithResult(_0x111cb4,null))[_0xa9e0('0x4b')](handleError(_0x111cb4,null));};exports[_0xa9e0('0x56')]=function(_0x246e2c,_0x6e6046,_0x31d897){var _0x3abe93={'raw':!![],'where':{}},_0xd12f9d={},_0x193d80;return db['ChatQueue'][_0xa9e0('0x57')]({'where':{'id':_0x246e2c[_0xa9e0('0x54')]['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x6e6046,null))[_0xa9e0('0x1c')](function(_0x547791){if(_0x547791){_0x193d80=_0x547791[_0xa9e0('0x32')]({'plain':!![]});_0xd12f9d[_0xa9e0('0x37')]=_[_0xa9e0('0x38')](db[_0xa9e0('0x58')][_0xa9e0('0x36')]);_0xd12f9d[_0xa9e0('0x39')]=_[_0xa9e0('0x38')](_0x246e2c[_0xa9e0('0x39')]);_0xd12f9d[_0xa9e0('0x3a')]=_[_0xa9e0('0x3b')](_0xd12f9d[_0xa9e0('0x37')],_0xd12f9d[_0xa9e0('0x39')]);_0x3abe93[_0xa9e0('0x3c')]=_[_0xa9e0('0x3b')](_0xd12f9d[_0xa9e0('0x37')],qs[_0xa9e0('0x3d')](_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x3d')]));_0x3abe93[_0xa9e0('0x3c')]=_0x3abe93[_0xa9e0('0x3c')]['length']?_0x3abe93[_0xa9e0('0x3c')]:_0xd12f9d['model'];if(!_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x3f')](_0xa9e0('0x59'))){_0x3abe93[_0xa9e0('0x2c')]=qs[_0xa9e0('0x2c')](_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x2c')]);_0x3abe93[_0xa9e0('0x2b')]=qs[_0xa9e0('0x2b')](_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x2b')]);}_0x3abe93[_0xa9e0('0x5a')]=qs[_0xa9e0('0x40')](_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x40')]);_0x3abe93[_0xa9e0('0x42')]=qs[_0xa9e0('0x3a')](_[_0xa9e0('0x5b')](_0x246e2c[_0xa9e0('0x39')],_0xd12f9d[_0xa9e0('0x3a')]));_0x3abe93[_0xa9e0('0x42')][_0xa9e0('0x5c')]=_0x547791['id'];if(_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x41')]){_0x3abe93[_0xa9e0('0x42')]=_['merge'](_0x3abe93[_0xa9e0('0x42')],{'$or':_['map'](_0x3abe93[_0xa9e0('0x3c')],function(_0x4a7a64){var _0xf1e85a={};_0xf1e85a[_0x4a7a64]={'$like':'%'+_0x246e2c[_0xa9e0('0x39')][_0xa9e0('0x41')]+'%'};return _0xf1e85a;})});}_0x3abe93=_[_0xa9e0('0x43')]({},_0x3abe93,_0x246e2c[_0xa9e0('0x47')]);return db[_0xa9e0('0x58')][_0xa9e0('0x4a')](_0x3abe93);}})[_0xa9e0('0x1c')](function(_0x2bee4e){if(_0x2bee4e){return db['User'][_0xa9e0('0x5d')]({'where':{'id':_[_0xa9e0('0x44')](_0x2bee4e,_0xa9e0('0x5e')),'role':_0xa9e0('0x5f')},'attributes':['id',_0xa9e0('0x60'),'chatPause','updatedAt',_0xa9e0('0x61')]});}})['then'](function(_0x403285){if(_0x403285){return{'count':_0x403285[_0xa9e0('0x2a')],'rows':_[_0xa9e0('0x44')](_0x403285['rows'],function(_0x5040b4){return{'membername':_0x5040b4['name'],'UserId':_0x5040b4['id'],'queue_name':_0x193d80[_0xa9e0('0x60')],'ChatQueueId':_0x193d80['id'],'interface':util[_0xa9e0('0x62')](_0xa9e0('0x63'),'SIP',_0x5040b4[_0xa9e0('0x60')]),'penalty':0x0,'paused':_0x5040b4[_0xa9e0('0x64')],'createdAt':_0x5040b4[_0xa9e0('0x61')],'updatedAt':_0x5040b4[_0xa9e0('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa9e0('0x1c')](respondWithFilteredResult(_0x6e6046,_0x3abe93))['catch'](handleError(_0x6e6046,null));};exports[_0xa9e0('0x66')]=function(_0x3894ab,_0x4a6097,_0x2c80d1){var _0x9cf7e={};var _0x56f443={};var _0x397885;var _0x2fb73d;return db[_0xa9e0('0x35')][_0xa9e0('0x57')]({'where':{'id':_0x3894ab['params']['id']}})['then'](handleEntityNotFound(_0x4a6097,null))['then'](function(_0x292903){if(_0x292903){_0x397885=_0x292903;_0x56f443[_0xa9e0('0x37')]=_[_0xa9e0('0x38')](db[_0xa9e0('0x67')]['rawAttributes']);_0x56f443[_0xa9e0('0x39')]=_[_0xa9e0('0x38')](_0x3894ab[_0xa9e0('0x39')]);_0x56f443[_0xa9e0('0x3a')]=_[_0xa9e0('0x3b')](_0x56f443[_0xa9e0('0x37')],_0x56f443[_0xa9e0('0x39')]);_0x9cf7e['attributes']=_[_0xa9e0('0x3b')](_0x56f443[_0xa9e0('0x37')],qs[_0xa9e0('0x3d')](_0x3894ab['query'][_0xa9e0('0x3d')]));_0x9cf7e[_0xa9e0('0x3c')]=_0x9cf7e[_0xa9e0('0x3c')][_0xa9e0('0x3e')]?_0x9cf7e[_0xa9e0('0x3c')]:_0x56f443[_0xa9e0('0x37')];_0x9cf7e['order']=qs[_0xa9e0('0x40')](_0x3894ab[_0xa9e0('0x39')]['sort']);_0x9cf7e[_0xa9e0('0x42')]=qs['filters'](_[_0xa9e0('0x5b')](_0x3894ab[_0xa9e0('0x39')],_0x56f443['filters']));if(_0x3894ab[_0xa9e0('0x39')]['filter']){_0x9cf7e[_0xa9e0('0x42')]=_[_0xa9e0('0x43')](_0x9cf7e['where'],{'$or':_[_0xa9e0('0x44')](_0x9cf7e[_0xa9e0('0x3c')],function(_0x3c642f){var _0x125303={};_0x125303[_0x3c642f]={'$like':'%'+_0x3894ab[_0xa9e0('0x39')][_0xa9e0('0x41')]+'%'};return _0x125303;})});}_0x9cf7e=_[_0xa9e0('0x43')]({},_0x9cf7e,_0x3894ab['options']);return _0x397885['getTeams'](_0x9cf7e);}})[_0xa9e0('0x1c')](function(_0x494c64){if(_0x494c64){_0x2fb73d=_0x494c64['length'];if(!_0x3894ab[_0xa9e0('0x39')]['hasOwnProperty'](_0xa9e0('0x59'))){_0x9cf7e[_0xa9e0('0x2c')]=qs['limit'](_0x3894ab[_0xa9e0('0x39')][_0xa9e0('0x2c')]);_0x9cf7e[_0xa9e0('0x2b')]=qs[_0xa9e0('0x2b')](_0x3894ab['query']['offset']);}return _0x397885[_0xa9e0('0x66')](_0x9cf7e);}})['then'](function(_0x1dcb88){if(_0x1dcb88){return _0x1dcb88?{'count':_0x2fb73d,'rows':_0x1dcb88}:null;}})['then'](respondWithResult(_0x4a6097,null))[_0xa9e0('0x4b')](handleError(_0x4a6097,null));};exports['addTeams']=function(_0x45fe70,_0x2d1a02,_0x388605){var _0x1e6a25=[];var _0x5642fd;return db[_0xa9e0('0x67')][_0xa9e0('0x4a')]({'where':{'id':_0x45fe70[_0xa9e0('0x4f')][_0xa9e0('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa9e0('0x69')],'as':_0xa9e0('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xa9e0('0x1c')](function(_0x1ce69f){if(_0x1ce69f){for(var _0x2d311f=0x0;_0x2d311f<_0x1ce69f[_0xa9e0('0x3e')];_0x2d311f+=0x1){for(var _0x55ed69=0x0;_0x55ed69<_0x1ce69f[_0x2d311f][_0xa9e0('0x6a')]['length'];_0x55ed69+=0x1){_0x1e6a25=_[_0xa9e0('0x6b')](_0x1e6a25,[_0x1ce69f[_0x2d311f][_0xa9e0('0x6a')][_0x55ed69]['id']]);}}return _0x1e6a25;}})[_0xa9e0('0x1c')](function(_0xb1d9f2){if(_0xb1d9f2){return db[_0xa9e0('0x35')][_0xa9e0('0x4d')]({'where':{'id':_0x45fe70[_0xa9e0('0x54')]['id']}});}})[_0xa9e0('0x1c')](function(_0x2f9dac){if(_0x2f9dac){_0x5642fd=_0x2f9dac;return _0x5642fd['addAgents'](_0x1e6a25,{'penalty':_0x45fe70['body'][_0xa9e0('0x6c')]});}})[_0xa9e0('0x1c')](function(_0x3d49ce){if(_0x3d49ce){return _0x5642fd[_0xa9e0('0x6d')](_0x45fe70[_0xa9e0('0x4f')][_0xa9e0('0x68')]);}})['then'](handleEntityNotFound(_0x2d1a02,null))[_0xa9e0('0x1c')](respondWithStatusCode(_0x2d1a02,null))[_0xa9e0('0x4b')](handleError(_0x2d1a02,null));};exports[_0xa9e0('0x6e')]=function(_0x427b53,_0x4125c7,_0x1eed9b){var _0x256b1d=[];var _0x3619c1;return db[_0xa9e0('0x67')]['findAll']({'where':{'id':_0x427b53[_0xa9e0('0x39')][_0xa9e0('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa9e0('0x69')],'as':_0xa9e0('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xa9e0('0x1c')](function(_0x2dcfa5){if(_0x2dcfa5){for(var _0x23ce58=0x0;_0x23ce58<_0x2dcfa5[_0xa9e0('0x3e')];_0x23ce58+=0x1){for(var _0x4d7861=0x0;_0x4d7861<_0x2dcfa5[_0x23ce58][_0xa9e0('0x6a')][_0xa9e0('0x3e')];_0x4d7861+=0x1){_0x256b1d=_['union'](_0x256b1d,[_0x2dcfa5[_0x23ce58][_0xa9e0('0x6a')][_0x4d7861]['id']]);}}return _0x256b1d;}})[_0xa9e0('0x1c')](function(_0x1e989b){if(_0x1e989b){return db[_0xa9e0('0x35')][_0xa9e0('0x4d')]({'where':{'id':_0x427b53[_0xa9e0('0x54')]['id']}});}})[_0xa9e0('0x1c')](function(_0x22c0a9){if(_0x22c0a9){_0x3619c1=_0x22c0a9;return _0x3619c1[_0xa9e0('0x6f')](_0x256b1d);}})['then'](function(_0xe528d0){if(_0x3619c1){return _0x3619c1[_0xa9e0('0x6e')](_0x427b53[_0xa9e0('0x39')]['ids']);}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x4125c7,null))['then'](respondWithStatusCode(_0x4125c7,null))['catch'](handleError(_0x4125c7,null));};exports[_0xa9e0('0x70')]=function(_0x559b77,_0x10046b,_0x36fb65){return db[_0xa9e0('0x35')][_0xa9e0('0x4d')]({'where':{'id':_0x559b77[_0xa9e0('0x54')]['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x10046b,null))['then'](function(_0x44ebc8){if(_0x44ebc8){return _0x44ebc8['addAgents'](_0x559b77[_0xa9e0('0x4f')][_0xa9e0('0x68')],_[_0xa9e0('0x71')](_0x559b77['body'],['ids','id'])||{})[_0xa9e0('0x72')](function(_0x34e0e0){for(var _0x5d6073=0x0;_0x5d6073<_0x559b77[_0xa9e0('0x4f')][_0xa9e0('0x68')][_0xa9e0('0x3e')];_0x5d6073+=0x1){socket[_0xa9e0('0x73')](_0xa9e0('0x74'),{'UserId':_0x559b77['body'][_0xa9e0('0x68')][_0x5d6073],'ChatQueueId':_0x559b77[_0xa9e0('0x54')]['id']});}return _0x34e0e0;});}})[_0xa9e0('0x1c')](respondWithResult(_0x10046b,null))[_0xa9e0('0x4b')](handleError(_0x10046b,null));};exports[_0xa9e0('0x6f')]=function(_0xe2a572,_0x20cf86,_0x17c6e9){var _0xa4fdc5;return db['ChatQueue'][_0xa9e0('0x4d')]({'where':{'id':_0xe2a572[_0xa9e0('0x54')]['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x20cf86,null))[_0xa9e0('0x1c')](function(_0x2a3eb1){if(_0x2a3eb1){return _0x2a3eb1[_0xa9e0('0x6f')](_0xe2a572['query'][_0xa9e0('0x68')])[_0xa9e0('0x1c')](function(_0x2728cd){if(_['isArray'](_0xe2a572[_0xa9e0('0x39')]['ids'])){for(var _0x5d4f81=0x0;_0x5d4f81<_0xe2a572[_0xa9e0('0x39')][_0xa9e0('0x68')][_0xa9e0('0x3e')];_0x5d4f81+=0x1){socket[_0xa9e0('0x73')](_0xa9e0('0x75'),{'UserId':_0xe2a572[_0xa9e0('0x39')][_0xa9e0('0x68')][_0x5d4f81],'ChatQueueId':_0xe2a572['params']['id']});}}else{socket[_0xa9e0('0x73')]('userChatQueue:remove',{'UserId':_0xe2a572[_0xa9e0('0x39')][_0xa9e0('0x68')],'ChatQueueId':_0xe2a572['params']['id']});}});}})[_0xa9e0('0x1c')](respondWithStatusCode(_0x20cf86,null))[_0xa9e0('0x4b')](handleError(_0x20cf86,null));};exports[_0xa9e0('0x76')]=function(_0x28bfac,_0x383ad2,_0x17ef78){var _0x28a835={};var _0x44d903={};var _0x3ac5c3;var _0x172625;return db[_0xa9e0('0x35')][_0xa9e0('0x57')]({'where':{'id':_0x28bfac['params']['id']}})[_0xa9e0('0x1c')](handleEntityNotFound(_0x383ad2,null))[_0xa9e0('0x1c')](function(_0x4a54ff){if(_0x4a54ff){_0x3ac5c3=_0x4a54ff;_0x44d903[_0xa9e0('0x37')]=_[_0xa9e0('0x38')](db['User']['rawAttributes']);_0x44d903[_0xa9e0('0x39')]=_[_0xa9e0('0x38')](_0x28bfac[_0xa9e0('0x39')]);_0x44d903[_0xa9e0('0x3a')]=_['intersection'](_0x44d903[_0xa9e0('0x37')],_0x44d903[_0xa9e0('0x39')]);_0x28a835[_0xa9e0('0x3c')]=_[_0xa9e0('0x3b')](_0x44d903[_0xa9e0('0x37')],qs[_0xa9e0('0x3d')](_0x28bfac['query'][_0xa9e0('0x3d')]));_0x28a835['attributes']=_0x28a835[_0xa9e0('0x3c')][_0xa9e0('0x3e')]?_0x28a835[_0xa9e0('0x3c')]:_0x44d903[_0xa9e0('0x37')];_0x28a835['order']=qs[_0xa9e0('0x40')](_0x28bfac[_0xa9e0('0x39')][_0xa9e0('0x40')]);_0x28a835['where']=qs[_0xa9e0('0x3a')](_['pick'](_0x28bfac[_0xa9e0('0x39')],_0x44d903[_0xa9e0('0x3a')]));if(_0x28bfac[_0xa9e0('0x39')]['filter']){_0x28a835[_0xa9e0('0x42')]=_[_0xa9e0('0x43')](_0x28a835[_0xa9e0('0x42')],{'$or':_['map'](_0x28a835[_0xa9e0('0x3c')],function(_0x3f3b8f){var _0xf35bb6={};_0xf35bb6[_0x3f3b8f]={'$like':'%'+_0x28bfac[_0xa9e0('0x39')][_0xa9e0('0x41')]+'%'};return _0xf35bb6;})});}_0x28a835=_[_0xa9e0('0x43')]({},_0x28a835,_0x28bfac[_0xa9e0('0x47')]);return _0x3ac5c3[_0xa9e0('0x76')](_0x28a835);}})['then'](function(_0x1648db){if(_0x1648db){_0x172625=_0x1648db[_0xa9e0('0x3e')];if(!_0x28bfac['query'][_0xa9e0('0x3f')](_0xa9e0('0x59'))){_0x28a835[_0xa9e0('0x2c')]=qs[_0xa9e0('0x2c')](_0x28bfac[_0xa9e0('0x39')][_0xa9e0('0x2c')]);_0x28a835['offset']=qs['offset'](_0x28bfac[_0xa9e0('0x39')]['offset']);}return _0x3ac5c3[_0xa9e0('0x76')](_0x28a835);}})[_0xa9e0('0x1c')](function(_0x268d21){if(_0x268d21){return _0x268d21?{'count':_0x172625,'rows':_0x268d21}:null;}})[_0xa9e0('0x1c')](respondWithResult(_0x383ad2,null))[_0xa9e0('0x4b')](handleError(_0x383ad2,null));}; \ No newline at end of file +var _0x0dca=['update','params','describe','getMembers','findOne','hasOwnProperty','pick','ChatQueueId','UserChatQueue','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','union','addAgents','penalty','removeTeams','User','removeAgents','omit','userChatQueue:save','emit','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','http','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','save','destroy','ChatQueues','name','send','index','ChatQueue','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','filter','merge','where','map','type','VIRTUAL','field','options','findAll','rows','catch','show','rawAttributes','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3e56d2,_0x2de466){var _0x231b71=function(_0x22f977){while(--_0x22f977){_0x3e56d2['push'](_0x3e56d2['shift']());}};_0x231b71(++_0x2de466);}(_0x0dca,0x190));var _0xa0dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0dca[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0dc('0x0'));var rimraf=require(_0xa0dc('0x1'));var zipdir=require(_0xa0dc('0x2'));var jsonpatch=require(_0xa0dc('0x3'));var rp=require(_0xa0dc('0x4'));var moment=require(_0xa0dc('0x5'));var BPromise=require(_0xa0dc('0x6'));var Mustache=require(_0xa0dc('0x7'));var util=require('util');var path=require(_0xa0dc('0x8'));var sox=require(_0xa0dc('0x9'));var csv=require(_0xa0dc('0xa'));var ejs=require(_0xa0dc('0xb'));var fs=require('fs');var _=require(_0xa0dc('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0dc('0xd'));var deskjs=require(_0xa0dc('0xe'));var toCsv=require(_0xa0dc('0xa'));var querystring=require(_0xa0dc('0xf'));var Papa=require(_0xa0dc('0x10'));var authService=require(_0xa0dc('0x11'));var hardwareService=require(_0xa0dc('0x12'));var Redis=require(_0xa0dc('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xa0dc('0x14'));var config=require('../../config/environment');var db=require(_0xa0dc('0x15'))['db'];config[_0xa0dc('0x16')]=_[_0xa0dc('0x17')](config[_0xa0dc('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0dc('0x18'))(new Redis(config['redis']));require(_0xa0dc('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa0dc('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x38538d,_0x3db248,_0x49aa0c,_0x1483a9){return new BPromise(function(_0x4777cb,_0x45dc50){var _0x41446a=_0x1483a9||client;return _0x41446a['request'](_0x38538d,_0x49aa0c)[_0xa0dc('0x1b')](function(_0x57b13e){logger[_0xa0dc('0x1c')]('ChatQueue,\x20%s,\x20%s',_0x3db248,'request\x20sent');logger[_0xa0dc('0x1d')](_0xa0dc('0x1e'),_0x3db248,_0xa0dc('0x1f'),JSON[_0xa0dc('0x20')](_0x57b13e));if(_0x57b13e[_0xa0dc('0x21')]){if(_0x57b13e[_0xa0dc('0x21')]['code']===0x1f4){logger[_0xa0dc('0x21')](_0xa0dc('0x22'),_0x3db248,_0x57b13e['error'][_0xa0dc('0x23')]);return _0x45dc50(_0x57b13e['error'][_0xa0dc('0x23')]);}logger[_0xa0dc('0x21')](_0xa0dc('0x22'),_0x3db248,_0x57b13e[_0xa0dc('0x21')]['message']);return _0x4777cb(_0x57b13e[_0xa0dc('0x21')][_0xa0dc('0x23')]);}else{logger['info'](_0xa0dc('0x22'),_0x3db248,_0xa0dc('0x1f'));_0x4777cb(_0x57b13e[_0xa0dc('0x24')]['message']);}})['catch'](function(_0x261fb7){logger[_0xa0dc('0x21')](_0xa0dc('0x22'),_0x3db248,_0x261fb7);_0x45dc50(_0x261fb7);});});}function respondWithStatusCode(_0x2233da,_0x39714f){_0x39714f=_0x39714f||0xcc;return function(_0x384123){if(_0x384123){return _0x2233da[_0xa0dc('0x25')](_0x39714f);}return _0x2233da['status'](_0x39714f)['end']();};}function respondWithResult(_0x12d4c1,_0x71aba0){_0x71aba0=_0x71aba0||0xc8;return function(_0x569902){if(_0x569902){return _0x12d4c1[_0xa0dc('0x26')](_0x71aba0)[_0xa0dc('0x27')](_0x569902);}};}function respondWithFilteredResult(_0x5022a2,_0x157cf5){return function(_0x4a17ca){if(_0x4a17ca){var _0x173d4d=_0x4a17ca[_0xa0dc('0x28')],_0x5511d2=_0x157cf5[_0xa0dc('0x29')],_0x21ba8b=_0x157cf5[_0xa0dc('0x29')]+_0x157cf5[_0xa0dc('0x2a')],_0x194201;if(_0x21ba8b>=_0x173d4d){_0x21ba8b=_0x173d4d;_0x194201=0xc8;}else{_0x194201=0xce;}_0x5022a2[_0xa0dc('0x26')](_0x194201);return _0x5022a2[_0xa0dc('0x2b')](_0xa0dc('0x2c'),_0x5511d2+'-'+_0x21ba8b+'/'+_0x173d4d)[_0xa0dc('0x27')](_0x4a17ca);}return null;};}function patchUpdates(_0x32d4af){return function(_0x5e4139){try{jsonpatch['apply'](_0x5e4139,_0x32d4af,!![]);}catch(_0x2ae68b){return BPromise['reject'](_0x2ae68b);}return _0x5e4139[_0xa0dc('0x2d')]();};}function saveUpdates(_0x13325d,_0x294d90){return function(_0x40d1de){if(_0x40d1de){return _0x40d1de['update'](_0x13325d)[_0xa0dc('0x1b')](function(_0x43be8){return _0x43be8;});}return null;};}function removeEntity(_0x41548f,_0x4158eb){return function(_0x5c7e2d){if(_0x5c7e2d){return _0x5c7e2d[_0xa0dc('0x2e')]()[_0xa0dc('0x1b')](function(){var _0x537e54=_0x5c7e2d['get']({'plain':!![]});var _0x520ff9=_0xa0dc('0x2f');return db['UserProfileResource'][_0xa0dc('0x2e')]({'where':{'type':_0x520ff9,'resourceId':_0x537e54['id']}})[_0xa0dc('0x1b')](function(){return _0x5c7e2d;});})[_0xa0dc('0x1b')](function(){_0x41548f[_0xa0dc('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a911,_0x57d0ec){return function(_0x3604bf){if(!_0x3604bf){_0x59a911[_0xa0dc('0x25')](0x194);}return _0x3604bf;};}function handleError(_0x15a41e,_0x284e07){_0x284e07=_0x284e07||0x1f4;return function(_0x13833c){logger[_0xa0dc('0x21')](_0x13833c['stack']);if(_0x13833c[_0xa0dc('0x30')]){delete _0x13833c[_0xa0dc('0x30')];}_0x15a41e[_0xa0dc('0x26')](_0x284e07)[_0xa0dc('0x31')](_0x13833c);};}exports[_0xa0dc('0x32')]=function(_0x1b8dab,_0x343c2e){var _0x2f2cf1={},_0x49e3e0={},_0x53adb8={'count':0x0,'rows':[]};var _0x274d61=db[_0xa0dc('0x33')]['rawAttributes'];_0x49e3e0[_0xa0dc('0x34')]=_[_0xa0dc('0x35')](_0x274d61);_0x49e3e0[_0xa0dc('0x36')]=_[_0xa0dc('0x35')](_0x1b8dab[_0xa0dc('0x36')]);_0x49e3e0['filters']=_[_0xa0dc('0x37')](_0x49e3e0[_0xa0dc('0x34')],_0x49e3e0['query']);_0x2f2cf1[_0xa0dc('0x38')]=_[_0xa0dc('0x37')](_0x49e3e0[_0xa0dc('0x34')],qs['fields'](_0x1b8dab[_0xa0dc('0x36')][_0xa0dc('0x39')]));_0x2f2cf1['attributes']=_0x2f2cf1['attributes']['length']?_0x2f2cf1[_0xa0dc('0x38')]:_0x49e3e0[_0xa0dc('0x34')];if(!_0x1b8dab[_0xa0dc('0x36')]['hasOwnProperty'](_0xa0dc('0x3a'))){_0x2f2cf1[_0xa0dc('0x2a')]=qs[_0xa0dc('0x2a')](_0x1b8dab[_0xa0dc('0x36')][_0xa0dc('0x2a')]);_0x2f2cf1[_0xa0dc('0x29')]=qs[_0xa0dc('0x29')](_0x1b8dab[_0xa0dc('0x36')]['offset']);}_0x2f2cf1[_0xa0dc('0x3b')]=qs[_0xa0dc('0x3c')](_0x1b8dab['query'][_0xa0dc('0x3c')]);_0x2f2cf1['where']=qs['filters'](_['pick'](_0x1b8dab['query'],_0x49e3e0[_0xa0dc('0x3d')]));if(_0x1b8dab[_0xa0dc('0x36')][_0xa0dc('0x3e')]){_0x2f2cf1['where']=_[_0xa0dc('0x3f')](_0x2f2cf1[_0xa0dc('0x40')],{'$or':_[_0xa0dc('0x41')](_0x274d61,function(_0x36a65c){if(_0x36a65c[_0xa0dc('0x42')]['key']!==_0xa0dc('0x43')){var _0x8f8e9e={};_0x8f8e9e[_0x36a65c[_0xa0dc('0x44')]]={'$like':'%'+_0x1b8dab[_0xa0dc('0x36')][_0xa0dc('0x3e')]+'%'};return _0x8f8e9e;}})});}_0x2f2cf1=_[_0xa0dc('0x3f')]({},_0x2f2cf1,_0x1b8dab[_0xa0dc('0x45')]);var _0x581dcd={'where':_0x2f2cf1[_0xa0dc('0x40')]};return db[_0xa0dc('0x33')][_0xa0dc('0x28')](_0x581dcd)[_0xa0dc('0x1b')](function(_0x2eed15){_0x53adb8[_0xa0dc('0x28')]=_0x2eed15;if(_0x1b8dab[_0xa0dc('0x36')]['includeAll']){_0x2f2cf1['include']=[{'all':!![]}];}return db[_0xa0dc('0x33')][_0xa0dc('0x46')](_0x2f2cf1);})[_0xa0dc('0x1b')](function(_0x58a061){_0x53adb8[_0xa0dc('0x47')]=_0x58a061;return _0x53adb8;})[_0xa0dc('0x1b')](respondWithFilteredResult(_0x343c2e,_0x2f2cf1))[_0xa0dc('0x48')](handleError(_0x343c2e,null));};exports[_0xa0dc('0x49')]=function(_0x2f50a6,_0x35265b){var _0x16fe88={'raw':!![],'where':{'id':_0x2f50a6['params']['id']}},_0x1c2db3={};_0x1c2db3[_0xa0dc('0x34')]=_[_0xa0dc('0x35')](db[_0xa0dc('0x33')][_0xa0dc('0x4a')]);_0x1c2db3[_0xa0dc('0x36')]=_[_0xa0dc('0x35')](_0x2f50a6['query']);_0x1c2db3[_0xa0dc('0x3d')]=_['intersection'](_0x1c2db3[_0xa0dc('0x34')],_0x1c2db3[_0xa0dc('0x36')]);_0x16fe88[_0xa0dc('0x38')]=_[_0xa0dc('0x37')](_0x1c2db3[_0xa0dc('0x34')],qs['fields'](_0x2f50a6['query']['fields']));_0x16fe88['attributes']=_0x16fe88[_0xa0dc('0x38')][_0xa0dc('0x4b')]?_0x16fe88[_0xa0dc('0x38')]:_0x1c2db3[_0xa0dc('0x34')];if(_0x2f50a6['query'][_0xa0dc('0x4c')]){_0x16fe88[_0xa0dc('0x4d')]=[{'all':!![]}];}_0x16fe88=_[_0xa0dc('0x3f')]({},_0x16fe88,_0x2f50a6[_0xa0dc('0x45')]);return db[_0xa0dc('0x33')][_0xa0dc('0x4e')](_0x16fe88)[_0xa0dc('0x1b')](handleEntityNotFound(_0x35265b,null))[_0xa0dc('0x1b')](respondWithResult(_0x35265b,null))[_0xa0dc('0x48')](handleError(_0x35265b,null));};exports['create']=function(_0x3eceae,_0x222ca3){return db['ChatQueue'][_0xa0dc('0x4f')](_0x3eceae[_0xa0dc('0x50')],{})['then'](function(_0x34a21f){var _0xf968b6=_0x3eceae['user']['get']({'plain':!![]});if(!_0xf968b6)throw new Error(_0xa0dc('0x51'));if(_0xf968b6[_0xa0dc('0x52')]==='user'){var _0x308282=_0x34a21f[_0xa0dc('0x53')]({'plain':!![]});var _0x21b0d1=_0xa0dc('0x2f');return db[_0xa0dc('0x54')][_0xa0dc('0x4e')]({'where':{'name':_0x21b0d1,'userProfileId':_0xf968b6[_0xa0dc('0x55')]},'raw':!![]})[_0xa0dc('0x1b')](function(_0x3efa8a){if(_0x3efa8a&&_0x3efa8a['autoAssociation']===0x0){return db[_0xa0dc('0x56')][_0xa0dc('0x4f')]({'name':_0x308282[_0xa0dc('0x30')],'resourceId':_0x308282['id'],'type':_0x3efa8a[_0xa0dc('0x30')],'sectionId':_0x3efa8a['id']},{})[_0xa0dc('0x1b')](function(){return _0x34a21f;});}else{return _0x34a21f;}})[_0xa0dc('0x48')](function(_0x5d2428){logger[_0xa0dc('0x21')](_0xa0dc('0x57'),_0x5d2428);throw _0x5d2428;});}return _0x34a21f;})[_0xa0dc('0x1b')](respondWithResult(_0x222ca3,0xc9))[_0xa0dc('0x48')](handleError(_0x222ca3,null));};exports[_0xa0dc('0x58')]=function(_0x249dfe,_0x3e3bf4){if(_0x249dfe[_0xa0dc('0x50')]['id']){delete _0x249dfe[_0xa0dc('0x50')]['id'];}return db[_0xa0dc('0x33')][_0xa0dc('0x4e')]({'where':{'id':_0x249dfe['params']['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x3e3bf4,null))['then'](saveUpdates(_0x249dfe[_0xa0dc('0x50')],null))[_0xa0dc('0x1b')](respondWithResult(_0x3e3bf4,null))[_0xa0dc('0x48')](handleError(_0x3e3bf4,null));};exports[_0xa0dc('0x2e')]=function(_0x450f72,_0xe1fe68){return db['ChatQueue'][_0xa0dc('0x4e')]({'where':{'id':_0x450f72[_0xa0dc('0x59')]['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0xe1fe68,null))[_0xa0dc('0x1b')](removeEntity(_0xe1fe68,null))[_0xa0dc('0x48')](handleError(_0xe1fe68,null));};exports[_0xa0dc('0x5a')]=function(_0xf750c3,_0x4f24e3){return db[_0xa0dc('0x33')][_0xa0dc('0x5a')]()[_0xa0dc('0x1b')](respondWithResult(_0x4f24e3,null))[_0xa0dc('0x48')](handleError(_0x4f24e3,null));};exports[_0xa0dc('0x5b')]=function(_0x168c84,_0x597f5a,_0x2405cd){var _0xed885f={'raw':!![],'where':{}},_0x9cd60a={},_0x1dd992;return db['ChatQueue'][_0xa0dc('0x5c')]({'where':{'id':_0x168c84['params']['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x597f5a,null))['then'](function(_0x588b47){if(_0x588b47){_0x1dd992=_0x588b47[_0xa0dc('0x53')]({'plain':!![]});_0x9cd60a[_0xa0dc('0x34')]=_[_0xa0dc('0x35')](db['UserChatQueue'][_0xa0dc('0x4a')]);_0x9cd60a['query']=_[_0xa0dc('0x35')](_0x168c84[_0xa0dc('0x36')]);_0x9cd60a[_0xa0dc('0x3d')]=_[_0xa0dc('0x37')](_0x9cd60a[_0xa0dc('0x34')],_0x9cd60a[_0xa0dc('0x36')]);_0xed885f[_0xa0dc('0x38')]=_['intersection'](_0x9cd60a[_0xa0dc('0x34')],qs[_0xa0dc('0x39')](_0x168c84[_0xa0dc('0x36')][_0xa0dc('0x39')]));_0xed885f['attributes']=_0xed885f[_0xa0dc('0x38')][_0xa0dc('0x4b')]?_0xed885f['attributes']:_0x9cd60a['model'];if(!_0x168c84['query'][_0xa0dc('0x5d')]('nolimit')){_0xed885f['limit']=qs[_0xa0dc('0x2a')](_0x168c84[_0xa0dc('0x36')][_0xa0dc('0x2a')]);_0xed885f['offset']=qs[_0xa0dc('0x29')](_0x168c84['query'][_0xa0dc('0x29')]);}_0xed885f[_0xa0dc('0x3b')]=qs['sort'](_0x168c84[_0xa0dc('0x36')]['sort']);_0xed885f[_0xa0dc('0x40')]=qs[_0xa0dc('0x3d')](_[_0xa0dc('0x5e')](_0x168c84[_0xa0dc('0x36')],_0x9cd60a['filters']));_0xed885f['where'][_0xa0dc('0x5f')]=_0x588b47['id'];if(_0x168c84['query']['filter']){_0xed885f['where']=_['merge'](_0xed885f[_0xa0dc('0x40')],{'$or':_[_0xa0dc('0x41')](_0xed885f[_0xa0dc('0x38')],function(_0x54ba4e){var _0x1d7266={};_0x1d7266[_0x54ba4e]={'$like':'%'+_0x168c84[_0xa0dc('0x36')][_0xa0dc('0x3e')]+'%'};return _0x1d7266;})});}_0xed885f=_['merge']({},_0xed885f,_0x168c84['options']);return db[_0xa0dc('0x60')][_0xa0dc('0x46')](_0xed885f);}})[_0xa0dc('0x1b')](function(_0x2aa162){if(_0x2aa162){return db['User'][_0xa0dc('0x61')]({'where':{'id':_[_0xa0dc('0x41')](_0x2aa162,_0xa0dc('0x62')),'role':_0xa0dc('0x63')},'attributes':['id',_0xa0dc('0x30'),_0xa0dc('0x64'),'updatedAt',_0xa0dc('0x65')]});}})[_0xa0dc('0x1b')](function(_0x31ec54){if(_0x31ec54){return{'count':_0x31ec54['count'],'rows':_[_0xa0dc('0x41')](_0x31ec54[_0xa0dc('0x47')],function(_0x43a7be){return{'membername':_0x43a7be[_0xa0dc('0x30')],'UserId':_0x43a7be['id'],'queue_name':_0x1dd992[_0xa0dc('0x30')],'ChatQueueId':_0x1dd992['id'],'interface':util[_0xa0dc('0x66')](_0xa0dc('0x67'),_0xa0dc('0x68'),_0x43a7be[_0xa0dc('0x30')]),'penalty':0x0,'paused':_0x43a7be[_0xa0dc('0x64')],'createdAt':_0x43a7be[_0xa0dc('0x65')],'updatedAt':_0x43a7be[_0xa0dc('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0dc('0x1b')](respondWithFilteredResult(_0x597f5a,_0xed885f))[_0xa0dc('0x48')](handleError(_0x597f5a,null));};exports['getTeams']=function(_0x5368f7,_0x1eaa4e,_0x754b62){var _0x5ac60b={};var _0x2d526a={};var _0x5f285f;var _0x25e147;return db[_0xa0dc('0x33')][_0xa0dc('0x5c')]({'where':{'id':_0x5368f7[_0xa0dc('0x59')]['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x1eaa4e,null))['then'](function(_0x8af9d4){if(_0x8af9d4){_0x5f285f=_0x8af9d4;_0x2d526a[_0xa0dc('0x34')]=_[_0xa0dc('0x35')](db[_0xa0dc('0x6a')][_0xa0dc('0x4a')]);_0x2d526a[_0xa0dc('0x36')]=_[_0xa0dc('0x35')](_0x5368f7[_0xa0dc('0x36')]);_0x2d526a[_0xa0dc('0x3d')]=_[_0xa0dc('0x37')](_0x2d526a[_0xa0dc('0x34')],_0x2d526a[_0xa0dc('0x36')]);_0x5ac60b['attributes']=_[_0xa0dc('0x37')](_0x2d526a['model'],qs[_0xa0dc('0x39')](_0x5368f7[_0xa0dc('0x36')][_0xa0dc('0x39')]));_0x5ac60b['attributes']=_0x5ac60b[_0xa0dc('0x38')][_0xa0dc('0x4b')]?_0x5ac60b[_0xa0dc('0x38')]:_0x2d526a[_0xa0dc('0x34')];_0x5ac60b[_0xa0dc('0x3b')]=qs[_0xa0dc('0x3c')](_0x5368f7['query'][_0xa0dc('0x3c')]);_0x5ac60b[_0xa0dc('0x40')]=qs['filters'](_[_0xa0dc('0x5e')](_0x5368f7[_0xa0dc('0x36')],_0x2d526a[_0xa0dc('0x3d')]));if(_0x5368f7[_0xa0dc('0x36')][_0xa0dc('0x3e')]){_0x5ac60b['where']=_[_0xa0dc('0x3f')](_0x5ac60b[_0xa0dc('0x40')],{'$or':_['map'](_0x5ac60b[_0xa0dc('0x38')],function(_0x42aa1b){var _0x12c0bd={};_0x12c0bd[_0x42aa1b]={'$like':'%'+_0x5368f7[_0xa0dc('0x36')][_0xa0dc('0x3e')]+'%'};return _0x12c0bd;})});}_0x5ac60b=_[_0xa0dc('0x3f')]({},_0x5ac60b,_0x5368f7[_0xa0dc('0x45')]);return _0x5f285f[_0xa0dc('0x6b')](_0x5ac60b);}})[_0xa0dc('0x1b')](function(_0x4e9420){if(_0x4e9420){_0x25e147=_0x4e9420[_0xa0dc('0x4b')];if(!_0x5368f7[_0xa0dc('0x36')]['hasOwnProperty']('nolimit')){_0x5ac60b[_0xa0dc('0x2a')]=qs[_0xa0dc('0x2a')](_0x5368f7[_0xa0dc('0x36')][_0xa0dc('0x2a')]);_0x5ac60b[_0xa0dc('0x29')]=qs[_0xa0dc('0x29')](_0x5368f7[_0xa0dc('0x36')][_0xa0dc('0x29')]);}return _0x5f285f[_0xa0dc('0x6b')](_0x5ac60b);}})[_0xa0dc('0x1b')](function(_0x32421f){if(_0x32421f){return _0x32421f?{'count':_0x25e147,'rows':_0x32421f}:null;}})['then'](respondWithResult(_0x1eaa4e,null))[_0xa0dc('0x48')](handleError(_0x1eaa4e,null));};exports[_0xa0dc('0x6c')]=function(_0x1a514b,_0x201dae,_0x37d81e){var _0x37020d=[];var _0x493920;return db['Team']['findAll']({'where':{'id':_0x1a514b['body'][_0xa0dc('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa0dc('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xa0dc('0x1b')](function(_0x516359){if(_0x516359){for(var _0x5c3326=0x0;_0x5c3326<_0x516359[_0xa0dc('0x4b')];_0x5c3326+=0x1){for(var _0x34b935=0x0;_0x34b935<_0x516359[_0x5c3326][_0xa0dc('0x6e')][_0xa0dc('0x4b')];_0x34b935+=0x1){_0x37020d=_[_0xa0dc('0x6f')](_0x37020d,[_0x516359[_0x5c3326][_0xa0dc('0x6e')][_0x34b935]['id']]);}}return _0x37020d;}})[_0xa0dc('0x1b')](function(_0x1d3952){if(_0x1d3952){return db[_0xa0dc('0x33')][_0xa0dc('0x4e')]({'where':{'id':_0x1a514b[_0xa0dc('0x59')]['id']}});}})['then'](function(_0x31258e){if(_0x31258e){_0x493920=_0x31258e;return _0x493920[_0xa0dc('0x70')](_0x37020d,{'penalty':_0x1a514b[_0xa0dc('0x50')][_0xa0dc('0x71')]});}})[_0xa0dc('0x1b')](function(_0x4d95ea){if(_0x4d95ea){return _0x493920[_0xa0dc('0x6c')](_0x1a514b[_0xa0dc('0x50')]['ids']);}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x201dae,null))[_0xa0dc('0x1b')](respondWithStatusCode(_0x201dae,null))[_0xa0dc('0x48')](handleError(_0x201dae,null));};exports[_0xa0dc('0x72')]=function(_0x4658b5,_0x1fc941,_0x442d42){var _0x573533=[];var _0x67fa31;return db[_0xa0dc('0x6a')]['findAll']({'where':{'id':_0x4658b5[_0xa0dc('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa0dc('0x73')],'as':_0xa0dc('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xa0dc('0x1b')](function(_0x413d46){if(_0x413d46){for(var _0x1f7850=0x0;_0x1f7850<_0x413d46[_0xa0dc('0x4b')];_0x1f7850+=0x1){for(var _0x442332=0x0;_0x442332<_0x413d46[_0x1f7850][_0xa0dc('0x6e')][_0xa0dc('0x4b')];_0x442332+=0x1){_0x573533=_['union'](_0x573533,[_0x413d46[_0x1f7850]['Agents'][_0x442332]['id']]);}}return _0x573533;}})[_0xa0dc('0x1b')](function(_0x4496d2){if(_0x4496d2){return db[_0xa0dc('0x33')][_0xa0dc('0x4e')]({'where':{'id':_0x4658b5[_0xa0dc('0x59')]['id']}});}})[_0xa0dc('0x1b')](function(_0x1a40ad){if(_0x1a40ad){_0x67fa31=_0x1a40ad;return _0x67fa31[_0xa0dc('0x74')](_0x573533);}})[_0xa0dc('0x1b')](function(_0x5811c9){if(_0x67fa31){return _0x67fa31[_0xa0dc('0x72')](_0x4658b5[_0xa0dc('0x36')][_0xa0dc('0x6d')]);}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x1fc941,null))[_0xa0dc('0x1b')](respondWithStatusCode(_0x1fc941,null))[_0xa0dc('0x48')](handleError(_0x1fc941,null));};exports['addAgents']=function(_0x37b8dc,_0x4f7f05,_0x566ee7){return db[_0xa0dc('0x33')][_0xa0dc('0x4e')]({'where':{'id':_0x37b8dc[_0xa0dc('0x59')]['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x4f7f05,null))[_0xa0dc('0x1b')](function(_0x5dce4f){if(_0x5dce4f){return _0x5dce4f[_0xa0dc('0x70')](_0x37b8dc[_0xa0dc('0x50')]['ids'],_[_0xa0dc('0x75')](_0x37b8dc[_0xa0dc('0x50')],[_0xa0dc('0x6d'),'id'])||{})['spread'](function(_0x4649d2){for(var _0x2eb473=0x0;_0x2eb473<_0x37b8dc[_0xa0dc('0x50')]['ids'][_0xa0dc('0x4b')];_0x2eb473+=0x1){socket['emit'](_0xa0dc('0x76'),{'UserId':_0x37b8dc[_0xa0dc('0x50')][_0xa0dc('0x6d')][_0x2eb473],'ChatQueueId':_0x37b8dc['params']['id']});}return _0x4649d2;});}})[_0xa0dc('0x1b')](respondWithResult(_0x4f7f05,null))['catch'](handleError(_0x4f7f05,null));};exports[_0xa0dc('0x74')]=function(_0x45081b,_0x235927,_0x47bdb4){var _0x4b118a;return db[_0xa0dc('0x33')][_0xa0dc('0x4e')]({'where':{'id':_0x45081b[_0xa0dc('0x59')]['id']}})['then'](handleEntityNotFound(_0x235927,null))['then'](function(_0x454f8f){if(_0x454f8f){return _0x454f8f[_0xa0dc('0x74')](_0x45081b[_0xa0dc('0x36')][_0xa0dc('0x6d')])[_0xa0dc('0x1b')](function(_0x5ee650){if(_['isArray'](_0x45081b[_0xa0dc('0x36')][_0xa0dc('0x6d')])){for(var _0x555470=0x0;_0x555470<_0x45081b[_0xa0dc('0x36')][_0xa0dc('0x6d')][_0xa0dc('0x4b')];_0x555470+=0x1){socket[_0xa0dc('0x77')]('userChatQueue:remove',{'UserId':_0x45081b['query']['ids'][_0x555470],'ChatQueueId':_0x45081b[_0xa0dc('0x59')]['id']});}}else{socket['emit'](_0xa0dc('0x78'),{'UserId':_0x45081b['query']['ids'],'ChatQueueId':_0x45081b[_0xa0dc('0x59')]['id']});}});}})[_0xa0dc('0x1b')](respondWithStatusCode(_0x235927,null))[_0xa0dc('0x48')](handleError(_0x235927,null));};exports[_0xa0dc('0x79')]=function(_0x1ba697,_0x108929,_0x3fdb49){var _0x2fa00c={};var _0x553533={};var _0x4b0f33;var _0xa6500;return db[_0xa0dc('0x33')][_0xa0dc('0x5c')]({'where':{'id':_0x1ba697['params']['id']}})[_0xa0dc('0x1b')](handleEntityNotFound(_0x108929,null))[_0xa0dc('0x1b')](function(_0xefef8c){if(_0xefef8c){_0x4b0f33=_0xefef8c;_0x553533[_0xa0dc('0x34')]=_[_0xa0dc('0x35')](db['User'][_0xa0dc('0x4a')]);_0x553533[_0xa0dc('0x36')]=_['keys'](_0x1ba697[_0xa0dc('0x36')]);_0x553533[_0xa0dc('0x3d')]=_[_0xa0dc('0x37')](_0x553533[_0xa0dc('0x34')],_0x553533[_0xa0dc('0x36')]);_0x2fa00c[_0xa0dc('0x38')]=_['intersection'](_0x553533[_0xa0dc('0x34')],qs[_0xa0dc('0x39')](_0x1ba697[_0xa0dc('0x36')][_0xa0dc('0x39')]));_0x2fa00c[_0xa0dc('0x38')]=_0x2fa00c[_0xa0dc('0x38')][_0xa0dc('0x4b')]?_0x2fa00c[_0xa0dc('0x38')]:_0x553533[_0xa0dc('0x34')];_0x2fa00c[_0xa0dc('0x3b')]=qs[_0xa0dc('0x3c')](_0x1ba697[_0xa0dc('0x36')][_0xa0dc('0x3c')]);_0x2fa00c['where']=qs[_0xa0dc('0x3d')](_[_0xa0dc('0x5e')](_0x1ba697[_0xa0dc('0x36')],_0x553533[_0xa0dc('0x3d')]));if(_0x1ba697['query']['filter']){_0x2fa00c[_0xa0dc('0x40')]=_['merge'](_0x2fa00c[_0xa0dc('0x40')],{'$or':_[_0xa0dc('0x41')](_0x2fa00c[_0xa0dc('0x38')],function(_0x5beb18){var _0x2ef1dc={};_0x2ef1dc[_0x5beb18]={'$like':'%'+_0x1ba697[_0xa0dc('0x36')]['filter']+'%'};return _0x2ef1dc;})});}_0x2fa00c=_['merge']({},_0x2fa00c,_0x1ba697[_0xa0dc('0x45')]);return _0x4b0f33[_0xa0dc('0x79')](_0x2fa00c);}})[_0xa0dc('0x1b')](function(_0x1adb20){if(_0x1adb20){_0xa6500=_0x1adb20['length'];if(!_0x1ba697[_0xa0dc('0x36')]['hasOwnProperty'](_0xa0dc('0x3a'))){_0x2fa00c[_0xa0dc('0x2a')]=qs[_0xa0dc('0x2a')](_0x1ba697['query']['limit']);_0x2fa00c[_0xa0dc('0x29')]=qs[_0xa0dc('0x29')](_0x1ba697[_0xa0dc('0x36')]['offset']);}return _0x4b0f33[_0xa0dc('0x79')](_0x2fa00c);}})[_0xa0dc('0x1b')](function(_0x162949){if(_0x162949){return _0x162949?{'count':_0xa6500,'rows':_0x162949}:null;}})[_0xa0dc('0x1b')](respondWithResult(_0x108929,null))[_0xa0dc('0x48')](handleError(_0x108929,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7033596..87fd6c2 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 _0x9809=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x30359a,_0x3e2edd){var _0x46d0e5=function(_0x3b3595){while(--_0x3b3595){_0x30359a['push'](_0x30359a['shift']());}};_0x46d0e5(++_0x3e2edd);}(_0x9809,0x1da));var _0x9980=function(_0x3a7f90,_0x254f94){_0x3a7f90=_0x3a7f90-0x0;var _0x9bedba=_0x9809[_0x3a7f90];return _0x9bedba;};'use strict';var EventEmitter=require(_0x9980('0x0'));var ChatQueue=require(_0x9980('0x1'))['db'][_0x9980('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9980('0x3')](0x0);var events={'afterCreate':_0x9980('0x4'),'afterUpdate':_0x9980('0x5'),'afterDestroy':_0x9980('0x6')};function emitEvent(_0x1496fe){return function(_0x64b7ec,_0xa65852,_0x27d888){ChatQueueEvents['emit'](_0x1496fe+':'+_0x64b7ec['id'],_0x64b7ec);ChatQueueEvents[_0x9980('0x7')](_0x1496fe,_0x64b7ec);_0x27d888(null);};}for(var e in events){if(events[_0x9980('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9980('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x0490=['hasOwnProperty','hook','../../mysqldb','remove','emit'];(function(_0x1ce23d,_0x25a351){var _0x4338d9=function(_0xf8d3a9){while(--_0xf8d3a9){_0x1ce23d['push'](_0x1ce23d['shift']());}};_0x4338d9(++_0x25a351);}(_0x0490,0x147));var _0x0049=function(_0x4a6633,_0x32dfae){_0x4a6633=_0x4a6633-0x0;var _0x3443d7=_0x0490[_0x4a6633];return _0x3443d7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0049('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0049('0x1')};function emitEvent(_0x3b1b70){return function(_0x435d2d,_0x1f3b3c,_0x2872ec){ChatQueueEvents[_0x0049('0x2')](_0x3b1b70+':'+_0x435d2d['id'],_0x435d2d);ChatQueueEvents[_0x0049('0x2')](_0x3b1b70,_0x435d2d);_0x2872ec(null);};}for(var e in events){if(events[_0x0049('0x3')](e)){var event=events[e];ChatQueue[_0x0049('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 682067c..4d47768 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 _0xdbf5=['util','moment','bluebird','request-promise','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x363665,_0xe244b8){var _0x3da3cf=function(_0x6648ea){while(--_0x6648ea){_0x363665['push'](_0x363665['shift']());}};_0x3da3cf(++_0xe244b8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2cc409,_0x54b60a){_0x2cc409=_0x2cc409-0x0;var _0x4b2025=_0xdbf5[_0x2cc409];return _0x4b2025;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var attributes=require(_0x5dbf('0x4'));module[_0x5dbf('0x5')]=function(_0x1a1ea9,_0x776036){return _0x1a1ea9[_0x5dbf('0x6')](_0x5dbf('0x7'),attributes,{'tableName':_0x5dbf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24ca=['./chatQueue.attributes','define','lodash','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x8c));var _0xa24c=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x24ca[_0x437d7f];return _0x31058c;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa24c('0x1'));var moment=require('moment');var BPromise=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var attributes=require(_0xa24c('0x4'));module['exports']=function(_0x2fbcfa,_0x89148d){return _0x2fbcfa[_0xa24c('0x5')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index b6b9baa..bbce479 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 _0x5d4e=['error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2283bf,_0x37c1a1){var _0x419910=function(_0x1e633d){while(--_0x1e633d){_0x2283bf['push'](_0x2283bf['shift']());}};_0x419910(++_0x37c1a1);}(_0x5d4e,0x69));var _0xe5d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d4e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe5d4('0x0'));var util=require(_0xe5d4('0x1'));var moment=require('moment');var BPromise=require(_0xe5d4('0x2'));var rs=require(_0xe5d4('0x3'));var fs=require('fs');var Redis=require(_0xe5d4('0x4'));var db=require(_0xe5d4('0x5'))['db'];var utils=require(_0xe5d4('0x6'));var logger=require(_0xe5d4('0x7'))(_0xe5d4('0x8'));var config=require(_0xe5d4('0x9'));var jayson=require(_0xe5d4('0xa'));var client=jayson[_0xe5d4('0xb')][_0xe5d4('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe5d4('0xd')],{'host':_0xe5d4('0xe'),'port':0x18eb});var socket=require(_0xe5d4('0xf'))(new Redis(config[_0xe5d4('0xd')]));require(_0xe5d4('0x10'))[_0xe5d4('0x11')](socket);function respondWithRpcPromise(_0x4b4a93,_0x488f85,_0x5b9175){return new BPromise(function(_0x22e88b,_0x4b5093){return client['request'](_0x4b4a93,_0x5b9175)['then'](function(_0x5d9df5){logger[_0xe5d4('0x12')](_0xe5d4('0x13'),_0x488f85,_0xe5d4('0x14'));logger[_0xe5d4('0x15')](_0xe5d4('0x16'),_0x488f85,_0xe5d4('0x14'),JSON[_0xe5d4('0x17')](_0x5d9df5));if(_0x5d9df5[_0xe5d4('0x18')]){if(_0x5d9df5[_0xe5d4('0x18')][_0xe5d4('0x19')]===0x1f4){logger['error'](_0xe5d4('0x13'),_0x488f85,_0x5d9df5[_0xe5d4('0x18')][_0xe5d4('0x1a')]);return _0x4b5093(_0x5d9df5[_0xe5d4('0x18')][_0xe5d4('0x1a')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x488f85,_0x5d9df5[_0xe5d4('0x18')][_0xe5d4('0x1a')]);return _0x22e88b(_0x5d9df5[_0xe5d4('0x18')][_0xe5d4('0x1a')]);}else{logger['info'](_0xe5d4('0x13'),_0x488f85,_0xe5d4('0x14'));_0x22e88b(_0x5d9df5[_0xe5d4('0x1b')]['message']);}})[_0xe5d4('0x1c')](function(_0x560c99){logger['error'](_0xe5d4('0x13'),_0x488f85,_0x560c99);_0x4b5093(_0x560c99);});});}exports[_0xe5d4('0x1d')]=function(_0x1cc781){var _0xf0f8ab=this;return new Promise(function(_0x4e96f2,_0x4ab4a7){return db[_0xe5d4('0x1e')][_0xe5d4('0x1f')]({'raw':_0x1cc781[_0xe5d4('0x20')]?_0x1cc781[_0xe5d4('0x20')][_0xe5d4('0x21')]===undefined?!![]:![]:!![],'where':_0x1cc781['options']?_0x1cc781['options'][_0xe5d4('0x22')]||null:null,'attributes':_0x1cc781[_0xe5d4('0x20')]?_0x1cc781[_0xe5d4('0x20')][_0xe5d4('0x23')]||null:null,'limit':_0x1cc781[_0xe5d4('0x20')]?_0x1cc781['options'][_0xe5d4('0x24')]||null:null,'include':_0x1cc781[_0xe5d4('0x20')]?_0x1cc781['options']['include']?_[_0xe5d4('0x25')](_0x1cc781[_0xe5d4('0x20')][_0xe5d4('0x26')],function(_0x363d8c){return{'model':db[_0x363d8c[_0xe5d4('0x27')]],'as':_0x363d8c['as'],'attributes':_0x363d8c[_0xe5d4('0x23')],'include':_0x363d8c[_0xe5d4('0x26')]?_[_0xe5d4('0x25')](_0x363d8c[_0xe5d4('0x26')],function(_0x3bc194){return{'model':db[_0x3bc194[_0xe5d4('0x27')]],'as':_0x3bc194['as'],'attributes':_0x3bc194[_0xe5d4('0x23')],'include':_0x3bc194[_0xe5d4('0x26')]?_['map'](_0x3bc194[_0xe5d4('0x26')],function(_0x3ce036){return{'model':db[_0x3ce036['model']],'as':_0x3ce036['as'],'attributes':_0x3ce036[_0xe5d4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe5d4('0x28')](function(_0x211330){logger[_0xe5d4('0x12')]('GetChatQueue',_0x1cc781);logger[_0xe5d4('0x15')]('GetChatQueue',_0x1cc781,JSON[_0xe5d4('0x17')](_0x211330));_0x4e96f2(_0x211330);})[_0xe5d4('0x1c')](function(_0x362b13){logger[_0xe5d4('0x18')](_0xe5d4('0x1d'),_0x362b13[_0xe5d4('0x1a')],_0x1cc781);_0x4ab4a7(_0xf0f8ab['error'](0x1f4,_0x362b13[_0xe5d4('0x1a')]));});});};exports[_0xe5d4('0x29')]=function(_0xbe7132){var _0x1e9cc6=this;return new Promise(function(_0x53ebb9,_0x450da8){return db[_0xe5d4('0x1e')][_0xe5d4('0x2a')]({'raw':_0xbe7132[_0xe5d4('0x20')]?_0xbe7132['options']['raw']===undefined?!![]:![]:!![],'where':_0xbe7132[_0xe5d4('0x20')]?_0xbe7132[_0xe5d4('0x20')][_0xe5d4('0x22')]||null:null,'attributes':_0xbe7132[_0xe5d4('0x20')]?_0xbe7132[_0xe5d4('0x20')][_0xe5d4('0x23')]||null:null,'include':_0xbe7132[_0xe5d4('0x20')]?_0xbe7132['options'][_0xe5d4('0x26')]?_[_0xe5d4('0x25')](_0xbe7132['options'][_0xe5d4('0x26')],function(_0x1dadd9){return{'model':db[_0x1dadd9[_0xe5d4('0x27')]],'as':_0x1dadd9['as'],'attributes':_0x1dadd9[_0xe5d4('0x23')],'include':_0x1dadd9[_0xe5d4('0x26')]?_[_0xe5d4('0x25')](_0x1dadd9['include'],function(_0x3f4a6e){return{'model':db[_0x3f4a6e[_0xe5d4('0x27')]],'as':_0x3f4a6e['as'],'attributes':_0x3f4a6e[_0xe5d4('0x23')],'include':_0x3f4a6e[_0xe5d4('0x26')]?_[_0xe5d4('0x25')](_0x3f4a6e[_0xe5d4('0x26')],function(_0x264ccc){return{'model':db[_0x264ccc['model']],'as':_0x264ccc['as'],'attributes':_0x264ccc[_0xe5d4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe5d4('0x28')](function(_0x40d8a5){logger['info'](_0xe5d4('0x29'),_0xbe7132);logger['debug'](_0xe5d4('0x29'),_0xbe7132,JSON['stringify'](_0x40d8a5));_0x53ebb9(_0x40d8a5);})[_0xe5d4('0x1c')](function(_0x4b857b){logger[_0xe5d4('0x18')](_0xe5d4('0x29'),_0x4b857b[_0xe5d4('0x1a')],_0xbe7132);_0x450da8(_0x1e9cc6['error'](0x1f4,_0x4b857b[_0xe5d4('0x1a')]));});});}; \ No newline at end of file +var _0x48a7=['http','redis','defaults','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x48a7,0x1ca));var _0x748a=function(_0x55a00b,_0x41578b){_0x55a00b=_0x55a00b-0x0;var _0x542685=_0x48a7[_0x55a00b];return _0x542685;};'use strict';var _=require(_0x748a('0x0'));var util=require(_0x748a('0x1'));var moment=require(_0x748a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x748a('0x3'));var db=require(_0x748a('0x4'))['db'];var utils=require(_0x748a('0x5'));var logger=require(_0x748a('0x6'))(_0x748a('0x7'));var config=require('../../config/environment');var jayson=require(_0x748a('0x8'));var client=jayson[_0x748a('0x9')][_0x748a('0xa')]({'port':0x232a});config[_0x748a('0xb')]=_[_0x748a('0xc')](config[_0x748a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x748a('0xb')]));require('./chatQueue.socket')[_0x748a('0xd')](socket);function respondWithRpcPromise(_0x56d775,_0x1f3b5c,_0x15c1db){return new BPromise(function(_0x2d9219,_0x573c8e){return client[_0x748a('0xe')](_0x56d775,_0x15c1db)[_0x748a('0xf')](function(_0x4a1f53){logger[_0x748a('0x10')](_0x748a('0x11'),_0x1f3b5c,'request\x20sent');logger[_0x748a('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1f3b5c,_0x748a('0x13'),JSON['stringify'](_0x4a1f53));if(_0x4a1f53[_0x748a('0x14')]){if(_0x4a1f53[_0x748a('0x14')]['code']===0x1f4){logger[_0x748a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x1f3b5c,_0x4a1f53['error'][_0x748a('0x15')]);return _0x573c8e(_0x4a1f53['error'][_0x748a('0x15')]);}logger[_0x748a('0x14')](_0x748a('0x11'),_0x1f3b5c,_0x4a1f53[_0x748a('0x14')][_0x748a('0x15')]);return _0x2d9219(_0x4a1f53[_0x748a('0x14')][_0x748a('0x15')]);}else{logger[_0x748a('0x10')](_0x748a('0x11'),_0x1f3b5c,_0x748a('0x13'));_0x2d9219(_0x4a1f53['result']['message']);}})[_0x748a('0x16')](function(_0x9ece03){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1f3b5c,_0x9ece03);_0x573c8e(_0x9ece03);});});}exports[_0x748a('0x17')]=function(_0x62ff60){var _0x26787c=this;return new Promise(function(_0x31e91e,_0x2cb098){return db[_0x748a('0x18')]['findAll']({'raw':_0x62ff60[_0x748a('0x19')]?_0x62ff60['options'][_0x748a('0x1a')]===undefined?!![]:![]:!![],'where':_0x62ff60[_0x748a('0x19')]?_0x62ff60[_0x748a('0x19')][_0x748a('0x1b')]||null:null,'attributes':_0x62ff60[_0x748a('0x19')]?_0x62ff60[_0x748a('0x19')][_0x748a('0x1c')]||null:null,'limit':_0x62ff60['options']?_0x62ff60[_0x748a('0x19')][_0x748a('0x1d')]||null:null,'include':_0x62ff60[_0x748a('0x19')]?_0x62ff60[_0x748a('0x19')][_0x748a('0x1e')]?_[_0x748a('0x1f')](_0x62ff60[_0x748a('0x19')]['include'],function(_0xc0aa69){return{'model':db[_0xc0aa69[_0x748a('0x20')]],'as':_0xc0aa69['as'],'attributes':_0xc0aa69[_0x748a('0x1c')],'include':_0xc0aa69[_0x748a('0x1e')]?_[_0x748a('0x1f')](_0xc0aa69[_0x748a('0x1e')],function(_0x40e115){return{'model':db[_0x40e115[_0x748a('0x20')]],'as':_0x40e115['as'],'attributes':_0x40e115[_0x748a('0x1c')],'include':_0x40e115[_0x748a('0x1e')]?_[_0x748a('0x1f')](_0x40e115[_0x748a('0x1e')],function(_0x22dfa2){return{'model':db[_0x22dfa2[_0x748a('0x20')]],'as':_0x22dfa2['as'],'attributes':_0x22dfa2[_0x748a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x748a('0xf')](function(_0x73193){logger[_0x748a('0x10')]('GetChatQueue',_0x62ff60);logger[_0x748a('0x12')](_0x748a('0x17'),_0x62ff60,JSON['stringify'](_0x73193));_0x31e91e(_0x73193);})[_0x748a('0x16')](function(_0x1d568c){logger[_0x748a('0x14')](_0x748a('0x17'),_0x1d568c['message'],_0x62ff60);_0x2cb098(_0x26787c[_0x748a('0x14')](0x1f4,_0x1d568c[_0x748a('0x15')]));});});};exports[_0x748a('0x21')]=function(_0x3b2a5b){var _0x30f81e=this;return new Promise(function(_0x2e9dd7,_0x6b64ef){return db[_0x748a('0x18')][_0x748a('0x22')]({'raw':_0x3b2a5b['options']?_0x3b2a5b['options'][_0x748a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b2a5b[_0x748a('0x19')]?_0x3b2a5b[_0x748a('0x19')]['where']||null:null,'attributes':_0x3b2a5b[_0x748a('0x19')]?_0x3b2a5b[_0x748a('0x19')][_0x748a('0x1c')]||null:null,'include':_0x3b2a5b[_0x748a('0x19')]?_0x3b2a5b[_0x748a('0x19')]['include']?_[_0x748a('0x1f')](_0x3b2a5b[_0x748a('0x19')][_0x748a('0x1e')],function(_0x520ad0){return{'model':db[_0x520ad0[_0x748a('0x20')]],'as':_0x520ad0['as'],'attributes':_0x520ad0[_0x748a('0x1c')],'include':_0x520ad0['include']?_['map'](_0x520ad0[_0x748a('0x1e')],function(_0x2955ad){return{'model':db[_0x2955ad['model']],'as':_0x2955ad['as'],'attributes':_0x2955ad[_0x748a('0x1c')],'include':_0x2955ad[_0x748a('0x1e')]?_[_0x748a('0x1f')](_0x2955ad[_0x748a('0x1e')],function(_0x681770){return{'model':db[_0x681770[_0x748a('0x20')]],'as':_0x681770['as'],'attributes':_0x681770['attributes']};}):[]};}):[]};}):[]:[]})[_0x748a('0xf')](function(_0x5f2ee7){logger['info'](_0x748a('0x21'),_0x3b2a5b);logger[_0x748a('0x12')]('ShowChatQueue',_0x3b2a5b,JSON[_0x748a('0x23')](_0x5f2ee7));_0x2e9dd7(_0x5f2ee7);})[_0x748a('0x16')](function(_0x16b091){logger[_0x748a('0x14')](_0x748a('0x21'),_0x16b091[_0x748a('0x15')],_0x3b2a5b);_0x6b64ef(_0x30f81e[_0x748a('0x14')](0x1f4,_0x16b091[_0x748a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 46614e9..c4e3b65 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.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(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 9578391..f404601 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 _0x80c6=['/:id/users','post','create','addTeams','addAgents','put','delete','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','/:id/teams','getTeams'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x80c6,0x170));var _0x680c=function(_0x481015,_0x5b3e2e){_0x481015=_0x481015-0x0;var _0x24a6c5=_0x80c6[_0x481015];return _0x24a6c5;};'use strict';var multer=require(_0x680c('0x0'));var util=require(_0x680c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x680c('0x2'));var router=express[_0x680c('0x3')]();var auth=require(_0x680c('0x4'));var interaction=require(_0x680c('0x5'));var config=require('../../config/environment');var controller=require(_0x680c('0x6'));router['get']('/',auth[_0x680c('0x7')](),controller[_0x680c('0x8')]);router[_0x680c('0x9')](_0x680c('0xa'),auth[_0x680c('0x7')](),controller[_0x680c('0xb')]);router[_0x680c('0x9')](_0x680c('0xc'),auth[_0x680c('0x7')](),controller['show']);router[_0x680c('0x9')](_0x680c('0xd'),auth[_0x680c('0x7')](),controller['getMembers']);router[_0x680c('0x9')](_0x680c('0xe'),auth[_0x680c('0x7')](),controller[_0x680c('0xf')]);router[_0x680c('0x9')](_0x680c('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x680c('0x11')]('/',auth[_0x680c('0x7')](),controller[_0x680c('0x12')]);router[_0x680c('0x11')](_0x680c('0xe'),auth[_0x680c('0x7')](),controller[_0x680c('0x13')]);router['post']('/:id/users',auth[_0x680c('0x7')](),controller[_0x680c('0x14')]);router[_0x680c('0x15')](_0x680c('0xc'),auth[_0x680c('0x7')](),controller['update']);router[_0x680c('0x16')](_0x680c('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x680c('0x16')](_0x680c('0xe'),auth[_0x680c('0x7')](),controller['removeTeams']);router[_0x680c('0x16')](_0x680c('0x10'),auth[_0x680c('0x7')](),controller[_0x680c('0x17')]);module['exports']=router; \ No newline at end of file +var _0xee0a=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0xee0a,0x71));var _0xaee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee0a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaee0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaee0('0x1'));var express=require(_0xaee0('0x2'));var router=express[_0xaee0('0x3')]();var auth=require(_0xaee0('0x4'));var interaction=require(_0xaee0('0x5'));var config=require(_0xaee0('0x6'));var controller=require(_0xaee0('0x7'));router[_0xaee0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaee0('0x8')](_0xaee0('0x9'),auth[_0xaee0('0xa')](),controller[_0xaee0('0xb')]);router[_0xaee0('0x8')](_0xaee0('0xc'),auth[_0xaee0('0xa')](),controller[_0xaee0('0xd')]);router[_0xaee0('0x8')](_0xaee0('0xe'),auth[_0xaee0('0xa')](),controller[_0xaee0('0xf')]);router['get'](_0xaee0('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xaee0('0x8')](_0xaee0('0x11'),auth[_0xaee0('0xa')](),controller[_0xaee0('0x12')]);router[_0xaee0('0x13')]('/',auth[_0xaee0('0xa')](),controller[_0xaee0('0x14')]);router[_0xaee0('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xaee0('0x15')]);router[_0xaee0('0x13')](_0xaee0('0x11'),auth[_0xaee0('0xa')](),controller[_0xaee0('0x16')]);router['put'](_0xaee0('0xc'),auth[_0xaee0('0xa')](),controller[_0xaee0('0x17')]);router[_0xaee0('0x18')](_0xaee0('0xc'),auth[_0xaee0('0xa')](),controller['destroy']);router[_0xaee0('0x18')](_0xaee0('0x10'),auth[_0xaee0('0xa')](),controller[_0xaee0('0x19')]);router[_0xaee0('0x18')]('/:id/users',auth[_0xaee0('0xa')](),controller[_0xaee0('0x1a')]);module[_0xaee0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ec46f11..1cc89ce 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 _0xd45d=['exports','STRING','DATE','sequelize'];(function(_0x487041,_0x5937df){var _0x5025da=function(_0xea489){while(--_0xea489){_0x487041['push'](_0x487041['shift']());}};_0x5025da(++_0x5937df);}(_0xd45d,0x8f));var _0xdd45=function(_0x506b33,_0x59d015){_0x506b33=_0x506b33-0x0;var _0x440ea0=_0xd45d[_0x506b33];return _0x440ea0;};'use strict';var moment=require('moment');var Sequelize=require(_0xdd45('0x0'));module[_0xdd45('0x1')]={'uniqueid':{'type':Sequelize[_0xdd45('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdd45('0x2')]},'joinAt':{'type':Sequelize[_0xdd45('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdd45('0x3')]},'exitAt':{'type':Sequelize[_0xdd45('0x3')]},'reason':{'type':Sequelize[_0xdd45('0x2')]}}; \ No newline at end of file +var _0xad1d=['DATE','sequelize','exports','STRING'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xad1d,0x119));var _0xdad1=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xad1d[_0x5cb97e];return _0x1714b4;};'use strict';var moment=require('moment');var Sequelize=require(_0xdad1('0x0'));module[_0xdad1('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdad1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdad1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdad1('0x3')]},'reason':{'type':Sequelize[_0xdad1('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 48df1b4..a4dbf11 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 _0x30e5=['field','filter','options','then','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','ChatQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x30e5,0x190));var _0x530e=function(_0x12a4d6,_0x3277bd){_0x12a4d6=_0x12a4d6-0x0;var _0x415b60=_0x30e5[_0x12a4d6];return _0x415b60;};'use strict';var pdf=require(_0x530e('0x0'));var emlformat=require(_0x530e('0x1'));var rimraf=require(_0x530e('0x2'));var zipdir=require(_0x530e('0x3'));var jsonpatch=require(_0x530e('0x4'));var rp=require(_0x530e('0x5'));var moment=require(_0x530e('0x6'));var BPromise=require(_0x530e('0x7'));var Mustache=require('mustache');var util=require(_0x530e('0x8'));var path=require(_0x530e('0x9'));var sox=require(_0x530e('0xa'));var csv=require(_0x530e('0xb'));var ejs=require(_0x530e('0xc'));var fs=require('fs');var _=require(_0x530e('0xd'));var squel=require('squel');var crypto=require(_0x530e('0xe'));var jsforce=require(_0x530e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x530e('0xb'));var querystring=require('querystring');var Papa=require(_0x530e('0x10'));var authService=require(_0x530e('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x530e('0x12'));var qs=require(_0x530e('0x13'));var logger=require('../../config/logger')(_0x530e('0x14'));var utils=require(_0x530e('0x15'));var config=require(_0x530e('0x16'));var db=require(_0x530e('0x17'))['db'];function respondWithStatusCode(_0x34320c,_0x3de4e3){_0x3de4e3=_0x3de4e3||0xcc;return function(_0x2a3ba8){if(_0x2a3ba8){return _0x34320c[_0x530e('0x18')](_0x3de4e3);}return _0x34320c[_0x530e('0x19')](_0x3de4e3)[_0x530e('0x1a')]();};}function respondWithResult(_0x327ed0,_0x522eb1){_0x522eb1=_0x522eb1||0xc8;return function(_0x553c31){if(_0x553c31){return _0x327ed0[_0x530e('0x19')](_0x522eb1)[_0x530e('0x1b')](_0x553c31);}};}function respondWithFilteredResult(_0x48d58a,_0x488c6d){return function(_0x95d629){if(_0x95d629){var _0x302da8=_0x95d629[_0x530e('0x1c')],_0x4a1a24=_0x488c6d['offset'],_0x3e040c=_0x488c6d[_0x530e('0x1d')]+_0x488c6d[_0x530e('0x1e')],_0x4e24a1;if(_0x3e040c>=_0x302da8){_0x3e040c=_0x302da8;_0x4e24a1=0xc8;}else{_0x4e24a1=0xce;}_0x48d58a['status'](_0x4e24a1);return _0x48d58a[_0x530e('0x1f')](_0x530e('0x20'),_0x4a1a24+'-'+_0x3e040c+'/'+_0x302da8)[_0x530e('0x1b')](_0x95d629);}return null;};}function patchUpdates(_0x5621d3){return function(_0x2dd134){try{jsonpatch[_0x530e('0x21')](_0x2dd134,_0x5621d3,!![]);}catch(_0x1a813c){return BPromise[_0x530e('0x22')](_0x1a813c);}return _0x2dd134[_0x530e('0x23')]();};}function saveUpdates(_0x120fec,_0x579383){return function(_0x42fe6a){if(_0x42fe6a){return _0x42fe6a[_0x530e('0x24')](_0x120fec)['then'](function(_0x6ce4d5){return _0x6ce4d5;});}return null;};}function removeEntity(_0x5f28e4,_0x18169b){return function(_0x11bb03){if(_0x11bb03){return _0x11bb03[_0x530e('0x25')]()['then'](function(){_0x5f28e4[_0x530e('0x19')](0xcc)[_0x530e('0x1a')]();});}};}function handleEntityNotFound(_0x5a59bb,_0x4e071e){return function(_0x49a57a){if(!_0x49a57a){_0x5a59bb[_0x530e('0x18')](0x194);}return _0x49a57a;};}function handleError(_0x36b36a,_0x33a505){_0x33a505=_0x33a505||0x1f4;return function(_0x2d2645){logger['error'](_0x2d2645['stack']);if(_0x2d2645[_0x530e('0x26')]){delete _0x2d2645[_0x530e('0x26')];}_0x36b36a['status'](_0x33a505)[_0x530e('0x27')](_0x2d2645);};}exports[_0x530e('0x28')]=function(_0x4eaee7,_0x220a45){var _0x395e68={},_0x443c1b={},_0x2aa905={'count':0x0,'rows':[]};var _0x444010=db[_0x530e('0x29')][_0x530e('0x2a')];_0x443c1b['model']=_[_0x530e('0x2b')](_0x444010);_0x443c1b[_0x530e('0x2c')]=_[_0x530e('0x2b')](_0x4eaee7[_0x530e('0x2c')]);_0x443c1b[_0x530e('0x2d')]=_[_0x530e('0x2e')](_0x443c1b[_0x530e('0x2f')],_0x443c1b[_0x530e('0x2c')]);_0x395e68[_0x530e('0x30')]=_[_0x530e('0x2e')](_0x443c1b[_0x530e('0x2f')],qs[_0x530e('0x31')](_0x4eaee7['query'][_0x530e('0x31')]));_0x395e68[_0x530e('0x30')]=_0x395e68[_0x530e('0x30')][_0x530e('0x32')]?_0x395e68['attributes']:_0x443c1b[_0x530e('0x2f')];if(!_0x4eaee7[_0x530e('0x2c')][_0x530e('0x33')](_0x530e('0x34'))){_0x395e68[_0x530e('0x1e')]=qs[_0x530e('0x1e')](_0x4eaee7[_0x530e('0x2c')]['limit']);_0x395e68[_0x530e('0x1d')]=qs[_0x530e('0x1d')](_0x4eaee7['query'][_0x530e('0x1d')]);}_0x395e68[_0x530e('0x35')]=qs[_0x530e('0x36')](_0x4eaee7[_0x530e('0x2c')][_0x530e('0x36')]);_0x395e68[_0x530e('0x37')]=qs['filters'](_[_0x530e('0x38')](_0x4eaee7['query'],_0x443c1b[_0x530e('0x2d')]));if(_0x4eaee7[_0x530e('0x2c')]['filter']){_0x395e68[_0x530e('0x37')]=_[_0x530e('0x39')](_0x395e68[_0x530e('0x37')],{'$or':_[_0x530e('0x3a')](_0x444010,function(_0x10c00d){if(_0x10c00d[_0x530e('0x3b')][_0x530e('0x3c')]!==_0x530e('0x3d')){var _0x89f189={};_0x89f189[_0x10c00d[_0x530e('0x3e')]]={'$like':'%'+_0x4eaee7['query'][_0x530e('0x3f')]+'%'};return _0x89f189;}})});}_0x395e68=_[_0x530e('0x39')]({},_0x395e68,_0x4eaee7[_0x530e('0x40')]);var _0x4ca4ef={'where':_0x395e68['where']};return db[_0x530e('0x29')][_0x530e('0x1c')](_0x4ca4ef)[_0x530e('0x41')](function(_0x42181a){_0x2aa905[_0x530e('0x1c')]=_0x42181a;if(_0x4eaee7[_0x530e('0x2c')][_0x530e('0x42')]){_0x395e68['include']=[{'all':!![]}];}return db[_0x530e('0x29')][_0x530e('0x43')](_0x395e68);})['then'](function(_0x55cbdc){_0x2aa905[_0x530e('0x44')]=_0x55cbdc;return _0x2aa905;})[_0x530e('0x41')](respondWithFilteredResult(_0x220a45,_0x395e68))['catch'](handleError(_0x220a45,null));};exports[_0x530e('0x45')]=function(_0x582660,_0x1e06f3){var _0x5f257d={'raw':!![],'where':{'id':_0x582660['params']['id']}},_0x4778b={};_0x4778b[_0x530e('0x2f')]=_['keys'](db['ChatQueueReport'][_0x530e('0x2a')]);_0x4778b[_0x530e('0x2c')]=_[_0x530e('0x2b')](_0x582660[_0x530e('0x2c')]);_0x4778b['filters']=_[_0x530e('0x2e')](_0x4778b[_0x530e('0x2f')],_0x4778b['query']);_0x5f257d['attributes']=_['intersection'](_0x4778b['model'],qs[_0x530e('0x31')](_0x582660[_0x530e('0x2c')][_0x530e('0x31')]));_0x5f257d[_0x530e('0x30')]=_0x5f257d[_0x530e('0x30')][_0x530e('0x32')]?_0x5f257d[_0x530e('0x30')]:_0x4778b[_0x530e('0x2f')];if(_0x582660[_0x530e('0x2c')][_0x530e('0x42')]){_0x5f257d[_0x530e('0x46')]=[{'all':!![]}];}_0x5f257d=_['merge']({},_0x5f257d,_0x582660[_0x530e('0x40')]);return db[_0x530e('0x29')][_0x530e('0x47')](_0x5f257d)[_0x530e('0x41')](handleEntityNotFound(_0x1e06f3,null))['then'](respondWithResult(_0x1e06f3,null))[_0x530e('0x48')](handleError(_0x1e06f3,null));};exports[_0x530e('0x49')]=function(_0x183c82,_0x5427fa){return db[_0x530e('0x29')][_0x530e('0x49')](_0x183c82[_0x530e('0x4a')],{})[_0x530e('0x41')](respondWithResult(_0x5427fa,0xc9))['catch'](handleError(_0x5427fa,null));};exports[_0x530e('0x24')]=function(_0x52bfd7,_0x108bbf){if(_0x52bfd7['body']['id']){delete _0x52bfd7[_0x530e('0x4a')]['id'];}return db[_0x530e('0x29')][_0x530e('0x47')]({'where':{'id':_0x52bfd7[_0x530e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x108bbf,null))[_0x530e('0x41')](saveUpdates(_0x52bfd7[_0x530e('0x4a')],null))[_0x530e('0x41')](respondWithResult(_0x108bbf,null))[_0x530e('0x48')](handleError(_0x108bbf,null));};exports['destroy']=function(_0x6630ed,_0x238b7c){return db[_0x530e('0x29')][_0x530e('0x47')]({'where':{'id':_0x6630ed[_0x530e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x238b7c,null))[_0x530e('0x41')](removeEntity(_0x238b7c,null))['catch'](handleError(_0x238b7c,null));};exports[_0x530e('0x4c')]=function(_0x3b9d64,_0x462b40){return db[_0x530e('0x29')][_0x530e('0x4c')]()['then'](respondWithResult(_0x462b40,null))[_0x530e('0x48')](handleError(_0x462b40,null));}; \ No newline at end of file +var _0x266b=['pick','filter','where','merge','map','type','key','VIRTUAL','field','options','ChatQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','status','end','json','count','offset','Content-Range','reject','update','then','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','sort'];(function(_0x5e1eae,_0x2d2a56){var _0x3217c5=function(_0xb968dd){while(--_0xb968dd){_0x5e1eae['push'](_0x5e1eae['shift']());}};_0x3217c5(++_0x2d2a56);}(_0x266b,0x122));var _0xb266=function(_0x2121ae,_0x1b7338){_0x2121ae=_0x2121ae-0x0;var _0x2bd3aa=_0x266b[_0x2121ae];return _0x2bd3aa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb266('0x0'));var rimraf=require(_0xb266('0x1'));var zipdir=require(_0xb266('0x2'));var jsonpatch=require(_0xb266('0x3'));var rp=require(_0xb266('0x4'));var moment=require('moment');var BPromise=require(_0xb266('0x5'));var Mustache=require(_0xb266('0x6'));var util=require(_0xb266('0x7'));var path=require('path');var sox=require(_0xb266('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb266('0x9'));var squel=require(_0xb266('0xa'));var crypto=require(_0xb266('0xb'));var jsforce=require(_0xb266('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb266('0xd'));var querystring=require(_0xb266('0xe'));var Papa=require('papaparse');var authService=require(_0xb266('0xf'));var hardwareService=require(_0xb266('0x10'));var Redis=require('ioredis');var qs=require(_0xb266('0x11'));var logger=require(_0xb266('0x12'))('api');var utils=require(_0xb266('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ab820,_0x67f7bb){_0x67f7bb=_0x67f7bb||0xcc;return function(_0x209758){if(_0x209758){return _0x1ab820['sendStatus'](_0x67f7bb);}return _0x1ab820[_0xb266('0x14')](_0x67f7bb)[_0xb266('0x15')]();};}function respondWithResult(_0x2b5310,_0x47fb3d){_0x47fb3d=_0x47fb3d||0xc8;return function(_0x57b99d){if(_0x57b99d){return _0x2b5310['status'](_0x47fb3d)[_0xb266('0x16')](_0x57b99d);}};}function respondWithFilteredResult(_0x28fbea,_0xf248f4){return function(_0xf011db){if(_0xf011db){var _0xa5feb4=_0xf011db[_0xb266('0x17')],_0xb6b68f=_0xf248f4[_0xb266('0x18')],_0x27e210=_0xf248f4[_0xb266('0x18')]+_0xf248f4['limit'],_0x189828;if(_0x27e210>=_0xa5feb4){_0x27e210=_0xa5feb4;_0x189828=0xc8;}else{_0x189828=0xce;}_0x28fbea['status'](_0x189828);return _0x28fbea['set'](_0xb266('0x19'),_0xb6b68f+'-'+_0x27e210+'/'+_0xa5feb4)[_0xb266('0x16')](_0xf011db);}return null;};}function patchUpdates(_0x528a71){return function(_0x34cfb2){try{jsonpatch['apply'](_0x34cfb2,_0x528a71,!![]);}catch(_0x4fb1b3){return BPromise[_0xb266('0x1a')](_0x4fb1b3);}return _0x34cfb2['save']();};}function saveUpdates(_0x447f85,_0x5a2894){return function(_0x44dbfb){if(_0x44dbfb){return _0x44dbfb[_0xb266('0x1b')](_0x447f85)['then'](function(_0x341062){return _0x341062;});}return null;};}function removeEntity(_0x37f472,_0x3f648f){return function(_0x2a7bde){if(_0x2a7bde){return _0x2a7bde['destroy']()[_0xb266('0x1c')](function(){_0x37f472[_0xb266('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfcd66d,_0x1fedb4){return function(_0x47780f){if(!_0x47780f){_0xfcd66d[_0xb266('0x1d')](0x194);}return _0x47780f;};}function handleError(_0x3dd317,_0x4ad615){_0x4ad615=_0x4ad615||0x1f4;return function(_0x596174){logger[_0xb266('0x1e')](_0x596174['stack']);if(_0x596174[_0xb266('0x1f')]){delete _0x596174['name'];}_0x3dd317[_0xb266('0x14')](_0x4ad615)[_0xb266('0x20')](_0x596174);};}exports[_0xb266('0x21')]=function(_0x11d00e,_0x220d6a){var _0x35baba={},_0x5d2647={},_0x658df2={'count':0x0,'rows':[]};var _0x5c319d=db['ChatQueueReport'][_0xb266('0x22')];_0x5d2647[_0xb266('0x23')]=_[_0xb266('0x24')](_0x5c319d);_0x5d2647[_0xb266('0x25')]=_['keys'](_0x11d00e[_0xb266('0x25')]);_0x5d2647[_0xb266('0x26')]=_['intersection'](_0x5d2647[_0xb266('0x23')],_0x5d2647[_0xb266('0x25')]);_0x35baba[_0xb266('0x27')]=_[_0xb266('0x28')](_0x5d2647[_0xb266('0x23')],qs[_0xb266('0x29')](_0x11d00e['query'][_0xb266('0x29')]));_0x35baba[_0xb266('0x27')]=_0x35baba[_0xb266('0x27')]['length']?_0x35baba[_0xb266('0x27')]:_0x5d2647['model'];if(!_0x11d00e['query'][_0xb266('0x2a')]('nolimit')){_0x35baba[_0xb266('0x2b')]=qs[_0xb266('0x2b')](_0x11d00e[_0xb266('0x25')][_0xb266('0x2b')]);_0x35baba[_0xb266('0x18')]=qs[_0xb266('0x18')](_0x11d00e[_0xb266('0x25')][_0xb266('0x18')]);}_0x35baba['order']=qs[_0xb266('0x2c')](_0x11d00e['query'][_0xb266('0x2c')]);_0x35baba['where']=qs[_0xb266('0x26')](_[_0xb266('0x2d')](_0x11d00e[_0xb266('0x25')],_0x5d2647[_0xb266('0x26')]));if(_0x11d00e[_0xb266('0x25')][_0xb266('0x2e')]){_0x35baba[_0xb266('0x2f')]=_[_0xb266('0x30')](_0x35baba[_0xb266('0x2f')],{'$or':_[_0xb266('0x31')](_0x5c319d,function(_0x3c674e){if(_0x3c674e[_0xb266('0x32')][_0xb266('0x33')]!==_0xb266('0x34')){var _0x3b10a0={};_0x3b10a0[_0x3c674e[_0xb266('0x35')]]={'$like':'%'+_0x11d00e[_0xb266('0x25')][_0xb266('0x2e')]+'%'};return _0x3b10a0;}})});}_0x35baba=_[_0xb266('0x30')]({},_0x35baba,_0x11d00e[_0xb266('0x36')]);var _0xac4bbd={'where':_0x35baba[_0xb266('0x2f')]};return db[_0xb266('0x37')][_0xb266('0x17')](_0xac4bbd)[_0xb266('0x1c')](function(_0xd83ea7){_0x658df2['count']=_0xd83ea7;if(_0x11d00e[_0xb266('0x25')][_0xb266('0x38')]){_0x35baba['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xb266('0x39')](_0x35baba);})[_0xb266('0x1c')](function(_0x348dd7){_0x658df2[_0xb266('0x3a')]=_0x348dd7;return _0x658df2;})[_0xb266('0x1c')](respondWithFilteredResult(_0x220d6a,_0x35baba))[_0xb266('0x3b')](handleError(_0x220d6a,null));};exports[_0xb266('0x3c')]=function(_0x340131,_0x3d784c){var _0x5a63f4={'raw':!![],'where':{'id':_0x340131[_0xb266('0x3d')]['id']}},_0x242939={};_0x242939[_0xb266('0x23')]=_['keys'](db[_0xb266('0x37')][_0xb266('0x22')]);_0x242939[_0xb266('0x25')]=_[_0xb266('0x24')](_0x340131['query']);_0x242939[_0xb266('0x26')]=_[_0xb266('0x28')](_0x242939[_0xb266('0x23')],_0x242939[_0xb266('0x25')]);_0x5a63f4[_0xb266('0x27')]=_['intersection'](_0x242939['model'],qs[_0xb266('0x29')](_0x340131[_0xb266('0x25')][_0xb266('0x29')]));_0x5a63f4[_0xb266('0x27')]=_0x5a63f4[_0xb266('0x27')]['length']?_0x5a63f4[_0xb266('0x27')]:_0x242939['model'];if(_0x340131[_0xb266('0x25')]['includeAll']){_0x5a63f4[_0xb266('0x3e')]=[{'all':!![]}];}_0x5a63f4=_[_0xb266('0x30')]({},_0x5a63f4,_0x340131[_0xb266('0x36')]);return db[_0xb266('0x37')][_0xb266('0x3f')](_0x5a63f4)[_0xb266('0x1c')](handleEntityNotFound(_0x3d784c,null))[_0xb266('0x1c')](respondWithResult(_0x3d784c,null))[_0xb266('0x3b')](handleError(_0x3d784c,null));};exports[_0xb266('0x40')]=function(_0x1866f9,_0x2eae5d){return db[_0xb266('0x37')]['create'](_0x1866f9[_0xb266('0x41')],{})[_0xb266('0x1c')](respondWithResult(_0x2eae5d,0xc9))[_0xb266('0x3b')](handleError(_0x2eae5d,null));};exports[_0xb266('0x1b')]=function(_0x6d53ff,_0x6231b){if(_0x6d53ff[_0xb266('0x41')]['id']){delete _0x6d53ff['body']['id'];}return db['ChatQueueReport'][_0xb266('0x3f')]({'where':{'id':_0x6d53ff['params']['id']}})[_0xb266('0x1c')](handleEntityNotFound(_0x6231b,null))[_0xb266('0x1c')](saveUpdates(_0x6d53ff[_0xb266('0x41')],null))[_0xb266('0x1c')](respondWithResult(_0x6231b,null))[_0xb266('0x3b')](handleError(_0x6231b,null));};exports['destroy']=function(_0x16d9c9,_0xb8ce99){return db['ChatQueueReport']['find']({'where':{'id':_0x16d9c9[_0xb266('0x3d')]['id']}})[_0xb266('0x1c')](handleEntityNotFound(_0xb8ce99,null))[_0xb266('0x1c')](removeEntity(_0xb8ce99,null))[_0xb266('0x3b')](handleError(_0xb8ce99,null));};exports[_0xb266('0x42')]=function(_0x283737,_0x4f36b9){return db['ChatQueueReport'][_0xb266('0x42')]()[_0xb266('0x1c')](respondWithResult(_0x4f36b9,null))[_0xb266('0x3b')](handleError(_0x4f36b9,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index b45cb2d..d734f14 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 _0x34e8=['define','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueueReport.attributes','exports'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x34e8,0x12c));var _0x834e=function(_0x548cf9,_0x4a3e15){_0x548cf9=_0x548cf9-0x0;var _0xd0dfe3=_0x34e8[_0x548cf9];return _0xd0dfe3;};'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 attributes=require(_0x834e('0x6'));module[_0x834e('0x7')]=function(_0x289ef2,_0x19a3e0){return _0x289ef2[_0x834e('0x8')]('ChatQueueReport',attributes,{'tableName':_0x834e('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x834e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20c47c,_0x443272){var _0x1cfcd7=function(_0x144ced){while(--_0x144ced){_0x20c47c['push'](_0x20c47c['shift']());}};_0x1cfcd7(++_0x443272);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x472a96,_0xce17f9){return _0x472a96[_0x7721('0x6')](_0x7721('0x7'),attributes,{'tableName':_0x7721('0x8'),'paranoid':![],'indexes':[{'name':_0x7721('0x9'),'fields':[_0x7721('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 5ba3c57..d61d24b 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 _0x8bcc=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','where','attributes','limit','stringify','lodash','util'];(function(_0x1b3d9c,_0x2668fb){var _0x23169c=function(_0x33109d){while(--_0x33109d){_0x1b3d9c['push'](_0x1b3d9c['shift']());}};_0x23169c(++_0x2668fb);}(_0x8bcc,0xee));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8bc('0x0'));var util=require(_0xc8bc('0x1'));var moment=require('moment');var BPromise=require(_0xc8bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8bc('0x3'));var db=require(_0xc8bc('0x4'))['db'];var utils=require(_0xc8bc('0x5'));var logger=require('../../config/logger')(_0xc8bc('0x6'));var config=require('../../config/environment');var jayson=require(_0xc8bc('0x7'));var client=jayson['client'][_0xc8bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x492aa9,_0x5e2e8a,_0x15b5fd){return new BPromise(function(_0x38bbfa,_0x24bbe5){return client[_0xc8bc('0x9')](_0x492aa9,_0x15b5fd)[_0xc8bc('0xa')](function(_0x1f9346){logger[_0xc8bc('0xb')](_0xc8bc('0xc'),_0x5e2e8a,_0xc8bc('0xd'));logger[_0xc8bc('0xe')](_0xc8bc('0xf'),_0x5e2e8a,'request\x20sent',JSON['stringify'](_0x1f9346));if(_0x1f9346[_0xc8bc('0x10')]){if(_0x1f9346[_0xc8bc('0x10')]['code']===0x1f4){logger[_0xc8bc('0x10')](_0xc8bc('0xc'),_0x5e2e8a,_0x1f9346[_0xc8bc('0x10')][_0xc8bc('0x11')]);return _0x24bbe5(_0x1f9346[_0xc8bc('0x10')][_0xc8bc('0x11')]);}logger[_0xc8bc('0x10')](_0xc8bc('0xc'),_0x5e2e8a,_0x1f9346[_0xc8bc('0x10')][_0xc8bc('0x11')]);return _0x38bbfa(_0x1f9346['error'][_0xc8bc('0x11')]);}else{logger[_0xc8bc('0xb')](_0xc8bc('0xc'),_0x5e2e8a,'request\x20sent');_0x38bbfa(_0x1f9346[_0xc8bc('0x12')][_0xc8bc('0x11')]);}})[_0xc8bc('0x13')](function(_0x5a8f72){logger[_0xc8bc('0x10')](_0xc8bc('0xc'),_0x5e2e8a,_0x5a8f72);_0x24bbe5(_0x5a8f72);});});}exports[_0xc8bc('0x14')]=function(_0x3a0b98){var _0x1dc16b=this;return new Promise(function(_0xdf1cf0,_0xdd989c){return db[_0xc8bc('0x15')][_0xc8bc('0x16')](_0x3a0b98['body'],{'raw':_0x3a0b98[_0xc8bc('0x17')]?_0x3a0b98[_0xc8bc('0x17')][_0xc8bc('0x18')]===undefined?!![]:![]:!![]})[_0xc8bc('0xa')](function(_0x3de365){logger[_0xc8bc('0xb')](_0xc8bc('0x14'),_0x3a0b98);logger[_0xc8bc('0xe')](_0xc8bc('0x14'),_0x3a0b98,JSON['stringify'](_0x3de365));_0xdf1cf0(_0x3de365);})[_0xc8bc('0x13')](function(_0x5d070a){logger['error'](_0xc8bc('0x14'),_0x5d070a[_0xc8bc('0x11')],_0x3a0b98);_0xdd989c(_0x1dc16b['error'](0x1f4,_0x5d070a[_0xc8bc('0x11')]));});});};exports[_0xc8bc('0x19')]=function(_0x22419e){var _0x134357=this;return new Promise(function(_0xa9efe8,_0x32e422){return db[_0xc8bc('0x15')]['update'](_0x22419e['body'],{'raw':_0x22419e[_0xc8bc('0x17')]?_0x22419e[_0xc8bc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22419e[_0xc8bc('0x17')]?_0x22419e[_0xc8bc('0x17')][_0xc8bc('0x1a')]||null:null,'attributes':_0x22419e[_0xc8bc('0x17')]?_0x22419e[_0xc8bc('0x17')][_0xc8bc('0x1b')]||null:null,'limit':_0x22419e[_0xc8bc('0x17')]?_0x22419e[_0xc8bc('0x17')][_0xc8bc('0x1c')]||null:null})['then'](function(_0xda88bf){logger[_0xc8bc('0xb')](_0xc8bc('0x19'),_0x22419e);logger[_0xc8bc('0xe')](_0xc8bc('0x19'),_0x22419e,JSON[_0xc8bc('0x1d')](_0xda88bf));_0xa9efe8(_0xda88bf);})['catch'](function(_0x10106c){logger['error'](_0xc8bc('0x19'),_0x10106c[_0xc8bc('0x11')],_0x22419e);_0x32e422(_0x134357[_0xc8bc('0x10')](0x1f4,_0x10106c[_0xc8bc('0x11')]));});});}; \ No newline at end of file +var _0x4618=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3be414,_0x35e652){var _0xa47a04=function(_0x15fcd8){while(--_0x15fcd8){_0x3be414['push'](_0x3be414['shift']());}};_0xa47a04(++_0x35e652);}(_0x4618,0x6c));var _0x8461=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4618[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x8461('0x0'));var util=require(_0x8461('0x1'));var moment=require(_0x8461('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8461('0x3'));var db=require(_0x8461('0x4'))['db'];var utils=require(_0x8461('0x5'));var logger=require(_0x8461('0x6'))(_0x8461('0x7'));var config=require('../../config/environment');var jayson=require(_0x8461('0x8'));var client=jayson[_0x8461('0x9')][_0x8461('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x403a0e,_0xe8f91e,_0x1c937a){return new BPromise(function(_0x2a69bb,_0x3d562c){return client[_0x8461('0xb')](_0x403a0e,_0x1c937a)[_0x8461('0xc')](function(_0x346875){logger[_0x8461('0xd')](_0x8461('0xe'),_0xe8f91e,_0x8461('0xf'));logger[_0x8461('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xe8f91e,'request\x20sent',JSON[_0x8461('0x11')](_0x346875));if(_0x346875[_0x8461('0x12')]){if(_0x346875[_0x8461('0x12')]['code']===0x1f4){logger[_0x8461('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0xe8f91e,_0x346875[_0x8461('0x12')][_0x8461('0x13')]);return _0x3d562c(_0x346875[_0x8461('0x12')][_0x8461('0x13')]);}logger[_0x8461('0x12')](_0x8461('0xe'),_0xe8f91e,_0x346875[_0x8461('0x12')]['message']);return _0x2a69bb(_0x346875['error'][_0x8461('0x13')]);}else{logger[_0x8461('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0xe8f91e,_0x8461('0xf'));_0x2a69bb(_0x346875[_0x8461('0x14')][_0x8461('0x13')]);}})[_0x8461('0x15')](function(_0x20a918){logger[_0x8461('0x12')](_0x8461('0xe'),_0xe8f91e,_0x20a918);_0x3d562c(_0x20a918);});});}exports[_0x8461('0x16')]=function(_0x398336){var _0x2ed841=this;return new Promise(function(_0x5845b0,_0xb00943){return db[_0x8461('0x17')][_0x8461('0x18')](_0x398336[_0x8461('0x19')],{'raw':_0x398336[_0x8461('0x1a')]?_0x398336[_0x8461('0x1a')][_0x8461('0x1b')]===undefined?!![]:![]:!![]})[_0x8461('0xc')](function(_0x211b6a){logger['info'](_0x8461('0x16'),_0x398336);logger[_0x8461('0x10')](_0x8461('0x16'),_0x398336,JSON[_0x8461('0x11')](_0x211b6a));_0x5845b0(_0x211b6a);})['catch'](function(_0x1f3241){logger[_0x8461('0x12')](_0x8461('0x16'),_0x1f3241['message'],_0x398336);_0xb00943(_0x2ed841[_0x8461('0x12')](0x1f4,_0x1f3241[_0x8461('0x13')]));});});};exports[_0x8461('0x1c')]=function(_0x14e2ba){var _0x23a859=this;return new Promise(function(_0xe0a8fa,_0x2dd896){return db[_0x8461('0x17')][_0x8461('0x1d')](_0x14e2ba[_0x8461('0x19')],{'raw':_0x14e2ba[_0x8461('0x1a')]?_0x14e2ba[_0x8461('0x1a')][_0x8461('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e2ba[_0x8461('0x1a')]?_0x14e2ba['options'][_0x8461('0x1e')]||null:null,'attributes':_0x14e2ba[_0x8461('0x1a')]?_0x14e2ba[_0x8461('0x1a')][_0x8461('0x1f')]||null:null,'limit':_0x14e2ba[_0x8461('0x1a')]?_0x14e2ba[_0x8461('0x1a')]['limit']||null:null})[_0x8461('0xc')](function(_0x397cd3){logger[_0x8461('0xd')](_0x8461('0x1c'),_0x14e2ba);logger[_0x8461('0x10')]('UpdateChatQueueReport',_0x14e2ba,JSON['stringify'](_0x397cd3));_0xe0a8fa(_0x397cd3);})[_0x8461('0x15')](function(_0x436355){logger['error']('UpdateChatQueueReport',_0x436355[_0x8461('0x13')],_0x14e2ba);_0x2dd896(_0x23a859[_0x8461('0x12')](0x1f4,_0x436355[_0x8461('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3f8b904..2d6f226 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 _0x3585=['express','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','post','create','/:id','update','delete','multer','path','connect-timeout'];(function(_0x4bd9bc,_0x269a25){var _0x307d01=function(_0x26db86){while(--_0x26db86){_0x4bd9bc['push'](_0x4bd9bc['shift']());}};_0x307d01(++_0x269a25);}(_0x3585,0xda));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5358('0x0'));var util=require('util');var path=require(_0x5358('0x1'));var timeout=require(_0x5358('0x2'));var express=require(_0x5358('0x3'));var router=express[_0x5358('0x4')]();var auth=require(_0x5358('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5358('0x6'));var controller=require(_0x5358('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5358('0x8')](_0x5358('0x9'),auth[_0x5358('0xa')](),controller[_0x5358('0xb')]);router[_0x5358('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5358('0xc')]('/',auth[_0x5358('0xa')](),controller[_0x5358('0xd')]);router['put'](_0x5358('0xe'),auth[_0x5358('0xa')](),controller[_0x5358('0xf')]);router[_0x5358('0x10')](_0x5358('0xe'),auth[_0x5358('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb041=['describe','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get'];(function(_0x9b44dc,_0x45b7fe){var _0x36b06b=function(_0x512d9d){while(--_0x512d9d){_0x9b44dc['push'](_0x9b44dc['shift']());}};_0x36b06b(++_0x45b7fe);}(_0xb041,0xd0));var _0x1b04=function(_0x75baf1,_0x230249){_0x75baf1=_0x75baf1-0x0;var _0x4707cf=_0xb041[_0x75baf1];return _0x4707cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b04('0x0'));var timeout=require(_0x1b04('0x1'));var express=require('express');var router=express[_0x1b04('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1b04('0x3'));var config=require(_0x1b04('0x4'));var controller=require(_0x1b04('0x5'));router['get']('/',auth[_0x1b04('0x6')](),controller['index']);router[_0x1b04('0x7')]('/describe',auth[_0x1b04('0x6')](),controller[_0x1b04('0x8')]);router[_0x1b04('0x7')]('/:id',auth[_0x1b04('0x6')](),controller[_0x1b04('0x9')]);router[_0x1b04('0xa')]('/',auth['isAuthenticated'](),controller[_0x1b04('0xb')]);router[_0x1b04('0xc')](_0x1b04('0xd'),auth['isAuthenticated'](),controller[_0x1b04('0xe')]);router[_0x1b04('0xf')](_0x1b04('0xd'),auth[_0x1b04('0x6')](),controller[_0x1b04('0x10')]);module[_0x1b04('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6c081ab..3a02b12 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 _0x52fc=['ENUM','account','agent','queue','DATE','NOW','sequelize','exports'];(function(_0x1fe7e4,_0x5d39a4){var _0x4b3e54=function(_0x39fdf1){while(--_0x39fdf1){_0x1fe7e4['push'](_0x1fe7e4['shift']());}};_0x4b3e54(++_0x5d39a4);}(_0x52fc,0x8e));var _0xc52f=function(_0xe40067,_0x2dcc9f){_0xe40067=_0xe40067-0x0;var _0x12a43b=_0x52fc[_0xe40067];return _0x12a43b;};'use strict';var moment=require('moment');var Sequelize=require(_0xc52f('0x0'));module[_0xc52f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc52f('0x2')](_0xc52f('0x3'),_0xc52f('0x4'),'queue'),'allowNull':![],'defaultValue':_0xc52f('0x5')},'transferredAt':{'type':Sequelize[_0xc52f('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xc52f('0x7')]}}; \ No newline at end of file +var _0x90ef=['sequelize','STRING','ENUM','account','queue','DATE','NOW','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90ef,0x9f));var _0xf90e=function(_0x4a468e,_0x4ca999){_0x4a468e=_0x4a468e-0x0;var _0x128c98=_0x90ef[_0x4a468e];return _0x128c98;};'use strict';var moment=require(_0xf90e('0x0'));var Sequelize=require(_0xf90e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf90e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf90e('0x3')](_0xf90e('0x4'),'agent',_0xf90e('0x5')),'allowNull':![],'defaultValue':_0xf90e('0x5')},'transferredAt':{'type':Sequelize[_0xf90e('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xf90e('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index b05ec85..d1072dc 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 _0xd1eb=['util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','ChatTransferReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','key','field','options','includeAll','include','catch','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache'];(function(_0x325f0c,_0xecf28e){var _0x3ef8f9=function(_0x108807){while(--_0x108807){_0x325f0c['push'](_0x325f0c['shift']());}};_0x3ef8f9(++_0xecf28e);}(_0xd1eb,0xc3));var _0xbd1e=function(_0x4684a6,_0x36427e){_0x4684a6=_0x4684a6-0x0;var _0x4cc2d4=_0xd1eb[_0x4684a6];return _0x4cc2d4;};'use strict';var pdf=require(_0xbd1e('0x0'));var emlformat=require(_0xbd1e('0x1'));var rimraf=require(_0xbd1e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd1e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd1e('0x4'));var Mustache=require(_0xbd1e('0x5'));var util=require(_0xbd1e('0x6'));var path=require(_0xbd1e('0x7'));var sox=require(_0xbd1e('0x8'));var csv=require(_0xbd1e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbd1e('0xa'));var crypto=require(_0xbd1e('0xb'));var jsforce=require(_0xbd1e('0xc'));var deskjs=require(_0xbd1e('0xd'));var toCsv=require(_0xbd1e('0x9'));var querystring=require(_0xbd1e('0xe'));var Papa=require(_0xbd1e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xbd1e('0x10'));var qs=require(_0xbd1e('0x11'));var logger=require(_0xbd1e('0x12'))(_0xbd1e('0x13'));var utils=require('../../config/utils');var config=require(_0xbd1e('0x14'));var db=require(_0xbd1e('0x15'))['db'];function respondWithStatusCode(_0x1f6afc,_0x4252dc){_0x4252dc=_0x4252dc||0xcc;return function(_0x283446){if(_0x283446){return _0x1f6afc[_0xbd1e('0x16')](_0x4252dc);}return _0x1f6afc[_0xbd1e('0x17')](_0x4252dc)[_0xbd1e('0x18')]();};}function respondWithResult(_0x40b9c2,_0x360ce0){_0x360ce0=_0x360ce0||0xc8;return function(_0x9cf4a7){if(_0x9cf4a7){return _0x40b9c2[_0xbd1e('0x17')](_0x360ce0)[_0xbd1e('0x19')](_0x9cf4a7);}};}function respondWithFilteredResult(_0x3de710,_0x1974ac){return function(_0x1e1484){if(_0x1e1484){var _0x5526c7=_0x1e1484[_0xbd1e('0x1a')],_0xf2f0b4=_0x1974ac['offset'],_0x5a5dcf=_0x1974ac[_0xbd1e('0x1b')]+_0x1974ac[_0xbd1e('0x1c')],_0x24653f;if(_0x5a5dcf>=_0x5526c7){_0x5a5dcf=_0x5526c7;_0x24653f=0xc8;}else{_0x24653f=0xce;}_0x3de710[_0xbd1e('0x17')](_0x24653f);return _0x3de710[_0xbd1e('0x1d')]('Content-Range',_0xf2f0b4+'-'+_0x5a5dcf+'/'+_0x5526c7)[_0xbd1e('0x19')](_0x1e1484);}return null;};}function patchUpdates(_0x4cb77b){return function(_0x3cf7db){try{jsonpatch[_0xbd1e('0x1e')](_0x3cf7db,_0x4cb77b,!![]);}catch(_0x315288){return BPromise[_0xbd1e('0x1f')](_0x315288);}return _0x3cf7db[_0xbd1e('0x20')]();};}function saveUpdates(_0x53cfd2,_0x2aff37){return function(_0x3c8e6d){if(_0x3c8e6d){return _0x3c8e6d[_0xbd1e('0x21')](_0x53cfd2)[_0xbd1e('0x22')](function(_0x1249a4){return _0x1249a4;});}return null;};}function removeEntity(_0x43b808,_0xe24465){return function(_0x20196f){if(_0x20196f){return _0x20196f[_0xbd1e('0x23')]()[_0xbd1e('0x22')](function(){_0x43b808[_0xbd1e('0x17')](0xcc)[_0xbd1e('0x18')]();});}};}function handleEntityNotFound(_0x4bd84a,_0x499ec0){return function(_0x389c79){if(!_0x389c79){_0x4bd84a[_0xbd1e('0x16')](0x194);}return _0x389c79;};}function handleError(_0x1fbe52,_0x4ef8d9){_0x4ef8d9=_0x4ef8d9||0x1f4;return function(_0x4a2353){logger[_0xbd1e('0x24')](_0x4a2353['stack']);if(_0x4a2353[_0xbd1e('0x25')]){delete _0x4a2353[_0xbd1e('0x25')];}_0x1fbe52[_0xbd1e('0x17')](_0x4ef8d9)['send'](_0x4a2353);};}exports[_0xbd1e('0x26')]=function(_0x598cfe,_0x30a4e4){var _0x5b4a50={},_0x43d648={},_0x57caca={'count':0x0,'rows':[]};var _0x56d8a9=db[_0xbd1e('0x27')][_0xbd1e('0x28')];_0x43d648[_0xbd1e('0x29')]=_['keys'](_0x56d8a9);_0x43d648[_0xbd1e('0x2a')]=_['keys'](_0x598cfe[_0xbd1e('0x2a')]);_0x43d648['filters']=_[_0xbd1e('0x2b')](_0x43d648[_0xbd1e('0x29')],_0x43d648[_0xbd1e('0x2a')]);_0x5b4a50[_0xbd1e('0x2c')]=_[_0xbd1e('0x2b')](_0x43d648[_0xbd1e('0x29')],qs[_0xbd1e('0x2d')](_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x2d')]));_0x5b4a50[_0xbd1e('0x2c')]=_0x5b4a50[_0xbd1e('0x2c')][_0xbd1e('0x2e')]?_0x5b4a50[_0xbd1e('0x2c')]:_0x43d648['model'];if(!_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x2f')]('nolimit')){_0x5b4a50[_0xbd1e('0x1c')]=qs['limit'](_0x598cfe['query'][_0xbd1e('0x1c')]);_0x5b4a50[_0xbd1e('0x1b')]=qs[_0xbd1e('0x1b')](_0x598cfe[_0xbd1e('0x2a')]['offset']);}_0x5b4a50[_0xbd1e('0x30')]=qs[_0xbd1e('0x31')](_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x31')]);_0x5b4a50[_0xbd1e('0x32')]=qs['filters'](_[_0xbd1e('0x33')](_0x598cfe[_0xbd1e('0x2a')],_0x43d648[_0xbd1e('0x34')]));if(_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x35')]){_0x5b4a50[_0xbd1e('0x32')]=_[_0xbd1e('0x36')](_0x5b4a50['where'],{'$or':_['map'](_0x56d8a9,function(_0x57604c){if(_0x57604c['type'][_0xbd1e('0x37')]!=='VIRTUAL'){var _0x507f47={};_0x507f47[_0x57604c[_0xbd1e('0x38')]]={'$like':'%'+_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x35')]+'%'};return _0x507f47;}})});}_0x5b4a50=_[_0xbd1e('0x36')]({},_0x5b4a50,_0x598cfe[_0xbd1e('0x39')]);var _0x1808dd={'where':_0x5b4a50[_0xbd1e('0x32')]};return db[_0xbd1e('0x27')][_0xbd1e('0x1a')](_0x1808dd)[_0xbd1e('0x22')](function(_0x19ed6e){_0x57caca['count']=_0x19ed6e;if(_0x598cfe[_0xbd1e('0x2a')][_0xbd1e('0x3a')]){_0x5b4a50[_0xbd1e('0x3b')]=[{'all':!![]}];}return db[_0xbd1e('0x27')]['findAll'](_0x5b4a50);})['then'](function(_0x53024e){_0x57caca['rows']=_0x53024e;return _0x57caca;})[_0xbd1e('0x22')](respondWithFilteredResult(_0x30a4e4,_0x5b4a50))[_0xbd1e('0x3c')](handleError(_0x30a4e4,null));};exports['show']=function(_0x8311da,_0x2ec9fb){var _0x209827={'raw':!![],'where':{'id':_0x8311da[_0xbd1e('0x3d')]['id']}},_0x9254d9={};_0x9254d9['model']=_['keys'](db['ChatTransferReport'][_0xbd1e('0x28')]);_0x9254d9[_0xbd1e('0x2a')]=_[_0xbd1e('0x3e')](_0x8311da['query']);_0x9254d9[_0xbd1e('0x34')]=_['intersection'](_0x9254d9[_0xbd1e('0x29')],_0x9254d9['query']);_0x209827[_0xbd1e('0x2c')]=_[_0xbd1e('0x2b')](_0x9254d9[_0xbd1e('0x29')],qs['fields'](_0x8311da[_0xbd1e('0x2a')][_0xbd1e('0x2d')]));_0x209827[_0xbd1e('0x2c')]=_0x209827[_0xbd1e('0x2c')][_0xbd1e('0x2e')]?_0x209827[_0xbd1e('0x2c')]:_0x9254d9['model'];if(_0x8311da[_0xbd1e('0x2a')][_0xbd1e('0x3a')]){_0x209827['include']=[{'all':!![]}];}_0x209827=_['merge']({},_0x209827,_0x8311da['options']);return db[_0xbd1e('0x27')][_0xbd1e('0x3f')](_0x209827)['then'](handleEntityNotFound(_0x2ec9fb,null))[_0xbd1e('0x22')](respondWithResult(_0x2ec9fb,null))[_0xbd1e('0x3c')](handleError(_0x2ec9fb,null));};exports[_0xbd1e('0x40')]=function(_0x290752,_0x118f2f){return db[_0xbd1e('0x27')]['create'](_0x290752[_0xbd1e('0x41')],{})[_0xbd1e('0x22')](respondWithResult(_0x118f2f,0xc9))[_0xbd1e('0x3c')](handleError(_0x118f2f,null));};exports[_0xbd1e('0x21')]=function(_0x35c42c,_0x48ada9){if(_0x35c42c[_0xbd1e('0x41')]['id']){delete _0x35c42c['body']['id'];}return db[_0xbd1e('0x27')]['find']({'where':{'id':_0x35c42c['params']['id']}})[_0xbd1e('0x22')](handleEntityNotFound(_0x48ada9,null))[_0xbd1e('0x22')](saveUpdates(_0x35c42c[_0xbd1e('0x41')],null))[_0xbd1e('0x22')](respondWithResult(_0x48ada9,null))[_0xbd1e('0x3c')](handleError(_0x48ada9,null));};exports[_0xbd1e('0x23')]=function(_0x31c687,_0x1fc9b7){return db['ChatTransferReport'][_0xbd1e('0x3f')]({'where':{'id':_0x31c687[_0xbd1e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1fc9b7,null))[_0xbd1e('0x22')](removeEntity(_0x1fc9b7,null))[_0xbd1e('0x3c')](handleError(_0x1fc9b7,null));};exports[_0xbd1e('0x42')]=function(_0x2ed590,_0x38a101){return db['ChatTransferReport'][_0xbd1e('0x42')]()[_0xbd1e('0x22')](respondWithResult(_0x38a101,null))['catch'](handleError(_0x38a101,null));}; \ No newline at end of file +var _0x7969=['includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','error','name','send','index','ChatTransferReport','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','count','then'];(function(_0x20ae3b,_0x23a21c){var _0x391475=function(_0x590776){while(--_0x590776){_0x20ae3b['push'](_0x20ae3b['shift']());}};_0x391475(++_0x23a21c);}(_0x7969,0x1c2));var _0x9796=function(_0x25231a,_0x2ce3c0){_0x25231a=_0x25231a-0x0;var _0x45aede=_0x7969[_0x25231a];return _0x45aede;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9796('0x0'));var zipdir=require(_0x9796('0x1'));var jsonpatch=require(_0x9796('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9796('0x3'));var Mustache=require(_0x9796('0x4'));var util=require(_0x9796('0x5'));var path=require(_0x9796('0x6'));var sox=require(_0x9796('0x7'));var csv=require(_0x9796('0x8'));var ejs=require(_0x9796('0x9'));var fs=require('fs');var _=require(_0x9796('0xa'));var squel=require('squel');var crypto=require(_0x9796('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9796('0x8'));var querystring=require('querystring');var Papa=require(_0x9796('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9796('0xd'));var Redis=require(_0x9796('0xe'));var qs=require(_0x9796('0xf'));var logger=require(_0x9796('0x10'))(_0x9796('0x11'));var utils=require(_0x9796('0x12'));var config=require(_0x9796('0x13'));var db=require(_0x9796('0x14'))['db'];function respondWithStatusCode(_0x5d1366,_0x147ce4){_0x147ce4=_0x147ce4||0xcc;return function(_0x54c658){if(_0x54c658){return _0x5d1366[_0x9796('0x15')](_0x147ce4);}return _0x5d1366['status'](_0x147ce4)[_0x9796('0x16')]();};}function respondWithResult(_0x2e7efe,_0x239379){_0x239379=_0x239379||0xc8;return function(_0x3c080a){if(_0x3c080a){return _0x2e7efe[_0x9796('0x17')](_0x239379)[_0x9796('0x18')](_0x3c080a);}};}function respondWithFilteredResult(_0x413795,_0x326af4){return function(_0x226a6b){if(_0x226a6b){var _0x3e8299=_0x226a6b['count'],_0x432a00=_0x326af4['offset'],_0xf2fd9a=_0x326af4[_0x9796('0x19')]+_0x326af4[_0x9796('0x1a')],_0x4d894d;if(_0xf2fd9a>=_0x3e8299){_0xf2fd9a=_0x3e8299;_0x4d894d=0xc8;}else{_0x4d894d=0xce;}_0x413795[_0x9796('0x17')](_0x4d894d);return _0x413795[_0x9796('0x1b')](_0x9796('0x1c'),_0x432a00+'-'+_0xf2fd9a+'/'+_0x3e8299)[_0x9796('0x18')](_0x226a6b);}return null;};}function patchUpdates(_0x3efa4e){return function(_0x21d265){try{jsonpatch[_0x9796('0x1d')](_0x21d265,_0x3efa4e,!![]);}catch(_0x41a0b2){return BPromise[_0x9796('0x1e')](_0x41a0b2);}return _0x21d265[_0x9796('0x1f')]();};}function saveUpdates(_0x1c12ef,_0x415f4b){return function(_0xa3c110){if(_0xa3c110){return _0xa3c110[_0x9796('0x20')](_0x1c12ef)['then'](function(_0x1d7d7b){return _0x1d7d7b;});}return null;};}function removeEntity(_0xc32832,_0x247098){return function(_0x272b3a){if(_0x272b3a){return _0x272b3a['destroy']()['then'](function(){_0xc32832[_0x9796('0x17')](0xcc)[_0x9796('0x16')]();});}};}function handleEntityNotFound(_0x5aa12d,_0x47468f){return function(_0x2f5766){if(!_0x2f5766){_0x5aa12d[_0x9796('0x15')](0x194);}return _0x2f5766;};}function handleError(_0x23615f,_0xe2d640){_0xe2d640=_0xe2d640||0x1f4;return function(_0x1600be){logger[_0x9796('0x21')](_0x1600be['stack']);if(_0x1600be[_0x9796('0x22')]){delete _0x1600be['name'];}_0x23615f[_0x9796('0x17')](_0xe2d640)[_0x9796('0x23')](_0x1600be);};}exports[_0x9796('0x24')]=function(_0x32e917,_0x1d4f7b){var _0x1009e9={},_0x118022={},_0x2e98ca={'count':0x0,'rows':[]};var _0x587d04=db[_0x9796('0x25')]['rawAttributes'];_0x118022['model']=_[_0x9796('0x26')](_0x587d04);_0x118022[_0x9796('0x27')]=_[_0x9796('0x26')](_0x32e917['query']);_0x118022[_0x9796('0x28')]=_['intersection'](_0x118022[_0x9796('0x29')],_0x118022[_0x9796('0x27')]);_0x1009e9['attributes']=_[_0x9796('0x2a')](_0x118022[_0x9796('0x29')],qs[_0x9796('0x2b')](_0x32e917[_0x9796('0x27')][_0x9796('0x2b')]));_0x1009e9['attributes']=_0x1009e9[_0x9796('0x2c')][_0x9796('0x2d')]?_0x1009e9[_0x9796('0x2c')]:_0x118022[_0x9796('0x29')];if(!_0x32e917[_0x9796('0x27')][_0x9796('0x2e')](_0x9796('0x2f'))){_0x1009e9[_0x9796('0x1a')]=qs[_0x9796('0x1a')](_0x32e917[_0x9796('0x27')][_0x9796('0x1a')]);_0x1009e9[_0x9796('0x19')]=qs['offset'](_0x32e917[_0x9796('0x27')][_0x9796('0x19')]);}_0x1009e9[_0x9796('0x30')]=qs[_0x9796('0x31')](_0x32e917[_0x9796('0x27')][_0x9796('0x31')]);_0x1009e9[_0x9796('0x32')]=qs[_0x9796('0x28')](_[_0x9796('0x33')](_0x32e917['query'],_0x118022[_0x9796('0x28')]));if(_0x32e917[_0x9796('0x27')][_0x9796('0x34')]){_0x1009e9['where']=_['merge'](_0x1009e9['where'],{'$or':_[_0x9796('0x35')](_0x587d04,function(_0x441de2){if(_0x441de2[_0x9796('0x36')][_0x9796('0x37')]!==_0x9796('0x38')){var _0x447a07={};_0x447a07[_0x441de2[_0x9796('0x39')]]={'$like':'%'+_0x32e917[_0x9796('0x27')][_0x9796('0x34')]+'%'};return _0x447a07;}})});}_0x1009e9=_['merge']({},_0x1009e9,_0x32e917[_0x9796('0x3a')]);var _0xaf2a74={'where':_0x1009e9[_0x9796('0x32')]};return db[_0x9796('0x25')][_0x9796('0x3b')](_0xaf2a74)[_0x9796('0x3c')](function(_0x45ec9e){_0x2e98ca[_0x9796('0x3b')]=_0x45ec9e;if(_0x32e917['query'][_0x9796('0x3d')]){_0x1009e9[_0x9796('0x3e')]=[{'all':!![]}];}return db[_0x9796('0x25')][_0x9796('0x3f')](_0x1009e9);})[_0x9796('0x3c')](function(_0x57852b){_0x2e98ca[_0x9796('0x40')]=_0x57852b;return _0x2e98ca;})[_0x9796('0x3c')](respondWithFilteredResult(_0x1d4f7b,_0x1009e9))['catch'](handleError(_0x1d4f7b,null));};exports[_0x9796('0x41')]=function(_0x310fd4,_0xb0f00a){var _0x5d40c5={'raw':!![],'where':{'id':_0x310fd4[_0x9796('0x42')]['id']}},_0x567348={};_0x567348[_0x9796('0x29')]=_[_0x9796('0x26')](db[_0x9796('0x25')][_0x9796('0x43')]);_0x567348[_0x9796('0x27')]=_['keys'](_0x310fd4[_0x9796('0x27')]);_0x567348[_0x9796('0x28')]=_['intersection'](_0x567348['model'],_0x567348[_0x9796('0x27')]);_0x5d40c5['attributes']=_[_0x9796('0x2a')](_0x567348[_0x9796('0x29')],qs[_0x9796('0x2b')](_0x310fd4[_0x9796('0x27')][_0x9796('0x2b')]));_0x5d40c5[_0x9796('0x2c')]=_0x5d40c5[_0x9796('0x2c')]['length']?_0x5d40c5[_0x9796('0x2c')]:_0x567348[_0x9796('0x29')];if(_0x310fd4[_0x9796('0x27')][_0x9796('0x3d')]){_0x5d40c5['include']=[{'all':!![]}];}_0x5d40c5=_[_0x9796('0x44')]({},_0x5d40c5,_0x310fd4['options']);return db[_0x9796('0x25')][_0x9796('0x45')](_0x5d40c5)[_0x9796('0x3c')](handleEntityNotFound(_0xb0f00a,null))['then'](respondWithResult(_0xb0f00a,null))[_0x9796('0x46')](handleError(_0xb0f00a,null));};exports['create']=function(_0x271c11,_0x904769){return db['ChatTransferReport']['create'](_0x271c11[_0x9796('0x47')],{})[_0x9796('0x3c')](respondWithResult(_0x904769,0xc9))[_0x9796('0x46')](handleError(_0x904769,null));};exports[_0x9796('0x20')]=function(_0xfa4af5,_0x353b44){if(_0xfa4af5[_0x9796('0x47')]['id']){delete _0xfa4af5['body']['id'];}return db[_0x9796('0x25')][_0x9796('0x45')]({'where':{'id':_0xfa4af5[_0x9796('0x42')]['id']}})['then'](handleEntityNotFound(_0x353b44,null))['then'](saveUpdates(_0xfa4af5['body'],null))[_0x9796('0x3c')](respondWithResult(_0x353b44,null))[_0x9796('0x46')](handleError(_0x353b44,null));};exports['destroy']=function(_0x479783,_0x3ddaa0){return db['ChatTransferReport'][_0x9796('0x45')]({'where':{'id':_0x479783[_0x9796('0x42')]['id']}})[_0x9796('0x3c')](handleEntityNotFound(_0x3ddaa0,null))[_0x9796('0x3c')](removeEntity(_0x3ddaa0,null))['catch'](handleError(_0x3ddaa0,null));};exports[_0x9796('0x48')]=function(_0x5018f5,_0x2d2061){return db['ChatTransferReport'][_0x9796('0x48')]()[_0x9796('0x3c')](respondWithResult(_0x2d2061,null))[_0x9796('0x46')](handleError(_0x2d2061,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2fae9cf..8ba1a7f 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 _0x269a=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','./chatTransferReport.attributes','define'];(function(_0x3013a0,_0x1e0559){var _0x4a2288=function(_0x3c62f6){while(--_0x3c62f6){_0x3013a0['push'](_0x3013a0['shift']());}};_0x4a2288(++_0x1e0559);}(_0x269a,0x1dc));var _0xa269=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x269a[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xa269('0x0'));var util=require(_0xa269('0x1'));var logger=require(_0xa269('0x2'))(_0xa269('0x3'));var moment=require(_0xa269('0x4'));var BPromise=require('bluebird');var rp=require(_0xa269('0x5'));var attributes=require(_0xa269('0x6'));module['exports']=function(_0x58d9ad,_0x1d510a){return _0x58d9ad[_0xa269('0x7')](_0xa269('0x8'),attributes,{'tableName':_0xa269('0x9'),'paranoid':![],'indexes':[{'name':_0xa269('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ce6=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','./chatTransferReport.attributes','exports','define'];(function(_0x2c56a9,_0x11630f){var _0x4c79c6=function(_0x41981f){while(--_0x41981f){_0x2c56a9['push'](_0x2c56a9['shift']());}};_0x4c79c6(++_0x11630f);}(_0x7ce6,0x184));var _0x67ce=function(_0x5e3acd,_0x32e993){_0x5e3acd=_0x5e3acd-0x0;var _0x26fa93=_0x7ce6[_0x5e3acd];return _0x26fa93;};'use strict';var _=require(_0x67ce('0x0'));var util=require('util');var logger=require(_0x67ce('0x1'))('api');var moment=require(_0x67ce('0x2'));var BPromise=require(_0x67ce('0x3'));var rp=require(_0x67ce('0x4'));var attributes=require(_0x67ce('0x5'));module[_0x67ce('0x6')]=function(_0x47f293,_0x50e672){return _0x47f293[_0x67ce('0x7')](_0x67ce('0x8'),attributes,{'tableName':_0x67ce('0x9'),'paranoid':![],'indexes':[{'name':_0x67ce('0xa'),'fields':[_0x67ce('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ad08c56..0433a81 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 _0xa9e0=['http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\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(_0x4f92c1,_0x222cdf){var _0x5eb20c=function(_0x464005){while(--_0x464005){_0x4f92c1['push'](_0x4f92c1['shift']());}};_0x5eb20c(++_0x222cdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 _0x938c=['catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result'];(function(_0xb2c91a,_0xc61319){var _0x9a47db=function(_0x3936df){while(--_0x3936df){_0xb2c91a['push'](_0xb2c91a['shift']());}};_0x9a47db(++_0xc61319);}(_0x938c,0x11f));var _0xc938=function(_0xec8d0e,_0x6181e7){_0xec8d0e=_0xec8d0e-0x0;var _0x51ace2=_0x938c[_0xec8d0e];return _0x51ace2;};'use strict';var _=require(_0xc938('0x0'));var util=require(_0xc938('0x1'));var moment=require('moment');var BPromise=require(_0xc938('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc938('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc938('0x4'))(_0xc938('0x5'));var config=require(_0xc938('0x6'));var jayson=require(_0xc938('0x7'));var client=jayson[_0xc938('0x8')][_0xc938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c08fe,_0x384ff3,_0x6e8871){return new BPromise(function(_0x52fbb1,_0x3037f1){return client[_0xc938('0xa')](_0x5c08fe,_0x6e8871)['then'](function(_0x1bfe72){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x384ff3,_0xc938('0xb'));logger[_0xc938('0xc')](_0xc938('0xd'),_0x384ff3,'request\x20sent',JSON[_0xc938('0xe')](_0x1bfe72));if(_0x1bfe72[_0xc938('0xf')]){if(_0x1bfe72['error'][_0xc938('0x10')]===0x1f4){logger['error'](_0xc938('0x11'),_0x384ff3,_0x1bfe72[_0xc938('0xf')][_0xc938('0x12')]);return _0x3037f1(_0x1bfe72['error'][_0xc938('0x12')]);}logger[_0xc938('0xf')](_0xc938('0x11'),_0x384ff3,_0x1bfe72['error']['message']);return _0x52fbb1(_0x1bfe72['error'][_0xc938('0x12')]);}else{logger[_0xc938('0x13')](_0xc938('0x11'),_0x384ff3,'request\x20sent');_0x52fbb1(_0x1bfe72[_0xc938('0x14')]['message']);}})[_0xc938('0x15')](function(_0x4b68be){logger['error'](_0xc938('0x11'),_0x384ff3,_0x4b68be);_0x3037f1(_0x4b68be);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6df9899..eb2216b 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 _0x3b4c=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3b4c,0x16c));var _0xc3b4=function(_0x5c68d1,_0x24bae5){_0x5c68d1=_0x5c68d1-0x0;var _0x1a8400=_0x3b4c[_0x5c68d1];return _0x1a8400;};'use strict';var multer=require(_0xc3b4('0x0'));var util=require('util');var path=require(_0xc3b4('0x1'));var timeout=require(_0xc3b4('0x2'));var express=require(_0xc3b4('0x3'));var router=express['Router']();var auth=require(_0xc3b4('0x4'));var interaction=require(_0xc3b4('0x5'));var config=require(_0xc3b4('0x6'));var controller=require(_0xc3b4('0x7'));router[_0xc3b4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc3b4('0x8')](_0xc3b4('0x9'),auth[_0xc3b4('0xa')](),controller[_0xc3b4('0xb')]);router[_0xc3b4('0x8')](_0xc3b4('0xc'),auth['isAuthenticated'](),controller[_0xc3b4('0xd')]);router[_0xc3b4('0xe')]('/',auth[_0xc3b4('0xa')](),controller['create']);router[_0xc3b4('0xf')](_0xc3b4('0xc'),auth[_0xc3b4('0xa')](),controller[_0xc3b4('0x10')]);router[_0xc3b4('0x11')](_0xc3b4('0xc'),auth[_0xc3b4('0xa')](),controller[_0xc3b4('0x12')]);module[_0xc3b4('0x13')]=router; \ No newline at end of file +var _0x7f84=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','create','put','update','delete'];(function(_0x9b8f96,_0x4077d5){var _0x424345=function(_0x5f4faa){while(--_0x5f4faa){_0x9b8f96['push'](_0x9b8f96['shift']());}};_0x424345(++_0x4077d5);}(_0x7f84,0xbf));var _0x47f8=function(_0x34c3ba,_0x4d1f3c){_0x34c3ba=_0x34c3ba-0x0;var _0x1c0a76=_0x7f84[_0x34c3ba];return _0x1c0a76;};'use strict';var multer=require(_0x47f8('0x0'));var util=require(_0x47f8('0x1'));var path=require(_0x47f8('0x2'));var timeout=require(_0x47f8('0x3'));var express=require(_0x47f8('0x4'));var router=express[_0x47f8('0x5')]();var auth=require(_0x47f8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47f8('0x7'));var controller=require(_0x47f8('0x8'));router[_0x47f8('0x9')]('/',auth['isAuthenticated'](),controller[_0x47f8('0xa')]);router['get']('/describe',auth[_0x47f8('0xb')](),controller[_0x47f8('0xc')]);router[_0x47f8('0x9')](_0x47f8('0xd'),auth[_0x47f8('0xb')](),controller['show']);router['post']('/',auth[_0x47f8('0xb')](),controller[_0x47f8('0xe')]);router[_0x47f8('0xf')](_0x47f8('0xd'),auth['isAuthenticated'](),controller[_0x47f8('0x10')]);router[_0x47f8('0x11')](_0x47f8('0xd'),auth[_0x47f8('0xb')](),controller[_0x47f8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index aee797e..e4a23b2 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 _0x3a9e=['address','email','Agent','#9f946a','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Send','Skip','star','thumb','stringify','name','text','input','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','getDataValue','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0x3a9e,0x7c));var _0xe3a9=function(_0x55257d,_0x3998ec){_0x55257d=_0x55257d-0x0;var _0x4d296d=_0x3a9e[_0x55257d];return _0x4d296d;};'use strict';var Sequelize=require(_0xe3a9('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![],'unique':_0xe3a9('0x2')},'description':{'type':Sequelize[_0xe3a9('0x1')]},'mapKey':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x3')},'mapKeyOffline':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x3')},'key':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![],'defaultValue':_0xe3a9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![],'defaultValue':_0xe3a9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe3a9('0x8')](_0xe3a9('0x9'),_0xe3a9('0xa')),'defaultValue':_0xe3a9('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xe3a9('0xb')},'start_chat_button':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0xc')},'offline_chat_button':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0xd')},'download_transcript':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe3a9('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe3a9('0x10')]},'closingQuestion':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe3a9('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x13')},'placeholderMessage':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x14')},'skipMessageButton':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xe3a9('0x8')](_0xe3a9('0x16'),_0xe3a9('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe3a9('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe3a9('0x10')],'defaultValue':function(){return JSON[_0xe3a9('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xe3a9('0x19'),'type':_0xe3a9('0x1a'),'required':!![]},'props':{'title':_0xe3a9('0x19'),'helpText':''}},{'type':_0xe3a9('0x1b'),'props':{'title':_0xe3a9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe3a9('0x3'),'type':_0xe3a9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xe3a9('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x5ad14f){return this[_0xe3a9('0x1d')](_0xe3a9('0x1c'),JSON['stringify'](_0x5ad14f));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe3a9('0x18')]({'items':[{'type':_0xe3a9('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe3a9('0x3'),'type':_0xe3a9('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xe3a9('0x1e')},'props':{'title':_0xe3a9('0x1e'),'helpText':_0xe3a9('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xe3a9('0x20')](_0xe3a9('0x21'))?JSON['parse'](this[_0xe3a9('0x20')](_0xe3a9('0x21'))):{};},'set':function(_0x1e0b16){return this['setDataValue'](_0xe3a9('0x21'),JSON[_0xe3a9('0x18')](_0x1e0b16));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe3a9('0x1')]},'waitingTitle':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x22')},'waitingMessage':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xe3a9('0x15')},'sendUnmanaged':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe3a9('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe3a9('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe3a9('0x10')],'defaultValue':function(){return _0xe3a9('0x24');}},'notificationSound':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xe3a9('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xe3a9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x26')},'defaultTitle':{'type':Sequelize[_0xe3a9('0x1')]},'customerAvatar':{'type':Sequelize[_0xe3a9('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe3a9('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe3a9('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe3a9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe3a9('0x1')],'defaultValue':_0xe3a9('0x27')},'systemAvatar':{'type':Sequelize[_0xe3a9('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3a9('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe3a9('0x7')],'defaultValue':![],'comment':_0xe3a9('0x28'),'set':function(_0x318e30){if(!_0x318e30)this[_0xe3a9('0x1d')](_0xe3a9('0x29'),null);this[_0xe3a9('0x1d')]('mandatoryDisposition',_0x318e30);}}}; \ No newline at end of file +var _0xa57f=['#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xa57f,0x1bb));var _0xfa57=function(_0x839d4a,_0x4795c3){_0x839d4a=_0x839d4a-0x0;var _0x330b10=_0xa57f[_0x839d4a];return _0x330b10;};'use strict';var Sequelize=require(_0xfa57('0x0'));var rs=require(_0xfa57('0x1'));module[_0xfa57('0x2')]={'name':{'type':Sequelize[_0xfa57('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xfa57('0x3')],'allowNull':![],'unique':_0xfa57('0x4')},'description':{'type':Sequelize[_0xfa57('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x5')},'key':{'type':Sequelize[_0xfa57('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x6')},'customerAlias':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa57('0x3')],'allowNull':![],'defaultValue':_0xfa57('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa57('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfa57('0x3')],'allowNull':![],'defaultValue':_0xfa57('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa57('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfa57('0x3')]},'animation':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa57('0xb')]('rounded','squared'),'defaultValue':_0xfa57('0xc')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0xe')},'header_offline':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0xf')},'download_transcript':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa57('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfa57('0x11')]},'closingQuestion':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x14')},'placeholderMessage':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x15')},'closingMessage':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x16')},'closingMessageButton':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x17')},'conditionAgreement':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0xfa57('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xfa57('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa57('0x11')],'defaultValue':function(){return JSON[_0xfa57('0x19')]({'items':[{'type':_0xfa57('0x1a'),'variable':null,'config':{'placeholder':_0xfa57('0x1b'),'type':_0xfa57('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xfa57('0x1a'),'props':{'title':_0xfa57('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa57('0x5'),'type':_0xfa57('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa57('0x1d')](_0xfa57('0x1e'))?JSON[_0xfa57('0x1f')](this[_0xfa57('0x1d')](_0xfa57('0x1e'))):{};},'set':function(_0x594887){return this['setDataValue']('onlineForm',JSON[_0xfa57('0x19')](_0x594887));}},'offlineForm':{'type':Sequelize[_0xfa57('0x11')],'defaultValue':function(){return JSON[_0xfa57('0x19')]({'items':[{'type':_0xfa57('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xfa57('0x20'),'config':{'placeholder':_0xfa57('0x21')},'props':{'title':_0xfa57('0x21'),'helpText':_0xfa57('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xfa57('0x1d')](_0xfa57('0x23'))?JSON[_0xfa57('0x1f')](this[_0xfa57('0x1d')](_0xfa57('0x23'))):{};},'set':function(_0x1b57c9){return this[_0xfa57('0x24')](_0xfa57('0x23'),JSON[_0xfa57('0x19')](_0x1b57c9));}},'token':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':function(){return rs[_0xfa57('0x25')]();}},'autoclose':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa57('0x3')]},'forwardOffline':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa57('0x3')]},'waitingTitle':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x27')},'offlineMessageBody':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfa57('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfa57('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa57('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x2b')},'verticalAlignment':{'type':Sequelize[_0xfa57('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xfa57('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xfa57('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa57('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa57('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa57('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfa57('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa57('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa57('0x3')],'defaultValue':_0xfa57('0x2e')},'systemAvatar':{'type':Sequelize[_0xfa57('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa57('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfa57('0x30'),'set':function(_0x4d9c7a){if(!_0x4d9c7a)this[_0xfa57('0x24')](_0xfa57('0x31'),null);this[_0xfa57('0x24')]('mandatoryDisposition',_0x4d9c7a);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a785432..9426310 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=['index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','query','keys','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','params','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','ChatWebsiteId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','join','root','../../config/license/util','getLicense','custom','sitepic','server/files/images/logos/','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','isNil','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','applications','Applications','list','priority','firstName','lastName','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','type','stringify','threadId','externalUrl','ChatInteraction','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','no\x20available\x20attributes','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','defaults','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','omit','Contact','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','headers','x-forwarded-for','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','localhost','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','name','send'];(function(_0x487f29,_0xd0d498){var _0x2f076e=function(_0x30cd8b){while(--_0x30cd8b){_0x487f29['push'](_0x487f29['shift']());}};_0x2f076e(++_0xd0d498);}(_0x757a,0xde));var _0xa757=function(_0x3867f8,_0x70706b){_0x3867f8=_0x3867f8-0x0;var _0x12e7a5=_0x757a[_0x3867f8];return _0x12e7a5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var authService=require(_0xa757('0xf'));var hardwareService=require(_0xa757('0x10'));var Redis=require(_0xa757('0x11'));var qs=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require(_0xa757('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa757('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa757('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa757('0x18')][_0xa757('0x19')]({'port':0x232c});var client9002=jayson[_0xa757('0x18')][_0xa757('0x19')]({'port':0x232a});var client9003=jayson[_0xa757('0x18')][_0xa757('0x19')]({'port':0x232b});function respondWithRpcPromise(_0xf12b68,_0x2f7947,_0x185011,_0x3df1f9){return new BPromise(function(_0x50aac1,_0x2e195b){var _0x44eab8=_0x3df1f9||client;return _0x44eab8[_0xa757('0x1a')](_0xf12b68,_0x185011)['then'](function(_0x54b305){logger[_0xa757('0x1b')](_0xa757('0x1c'),_0x2f7947,_0xa757('0x1d'));logger[_0xa757('0x1e')](_0xa757('0x1f'),_0x2f7947,_0xa757('0x1d'),JSON['stringify'](_0x54b305));if(_0x54b305[_0xa757('0x20')]){if(_0x54b305['error'][_0xa757('0x21')]===0x1f4){logger[_0xa757('0x20')](_0xa757('0x1c'),_0x2f7947,_0x54b305[_0xa757('0x20')]['message']);return _0x2e195b(_0x54b305['error'][_0xa757('0x22')]);}logger[_0xa757('0x20')](_0xa757('0x1c'),_0x2f7947,_0x54b305[_0xa757('0x20')][_0xa757('0x22')]);return _0x50aac1(_0x54b305[_0xa757('0x20')][_0xa757('0x22')]);}else{logger[_0xa757('0x1b')](_0xa757('0x1c'),_0x2f7947,'request\x20sent');_0x50aac1(_0x54b305[_0xa757('0x23')]['message']);}})[_0xa757('0x24')](function(_0x47903b){logger[_0xa757('0x20')](_0xa757('0x1c'),_0x2f7947,_0x47903b);_0x2e195b(_0x47903b);});});}function respondWithStatusCode(_0x37c7e6,_0x4d58a4){_0x4d58a4=_0x4d58a4||0xcc;return function(_0x2b19d5){if(_0x2b19d5){return _0x37c7e6[_0xa757('0x25')](_0x4d58a4);}return _0x37c7e6[_0xa757('0x26')](_0x4d58a4)[_0xa757('0x27')]();};}function respondWithResult(_0x5b4779,_0x449a7d){_0x449a7d=_0x449a7d||0xc8;return function(_0x54263b){if(_0x54263b){return _0x5b4779['status'](_0x449a7d)['json'](_0x54263b);}};}function respondWithFilteredResult(_0x4f8de2,_0xfdf69d){return function(_0x596ae2){if(_0x596ae2){var _0x2208f9=_0x596ae2['count'],_0x3bc24c=_0xfdf69d[_0xa757('0x28')],_0x55c5f8=_0xfdf69d[_0xa757('0x28')]+_0xfdf69d['limit'],_0x2a0c9a;if(_0x55c5f8>=_0x2208f9){_0x55c5f8=_0x2208f9;_0x2a0c9a=0xc8;}else{_0x2a0c9a=0xce;}_0x4f8de2[_0xa757('0x26')](_0x2a0c9a);return _0x4f8de2['set'](_0xa757('0x29'),_0x3bc24c+'-'+_0x55c5f8+'/'+_0x2208f9)[_0xa757('0x2a')](_0x596ae2);}return null;};}function patchUpdates(_0x458974){return function(_0x300dc4){try{jsonpatch[_0xa757('0x2b')](_0x300dc4,_0x458974,!![]);}catch(_0x2c1885){return BPromise[_0xa757('0x2c')](_0x2c1885);}return _0x300dc4[_0xa757('0x2d')]();};}function saveUpdates(_0x112282,_0x384424){return function(_0x1f5d5a){if(_0x1f5d5a){return _0x1f5d5a[_0xa757('0x2e')](_0x112282)[_0xa757('0x2f')](function(_0x2dfb33){return _0x2dfb33;});}return null;};}function removeEntity(_0x27be88,_0xc1cc20){return function(_0x3e64b7){if(_0x3e64b7){return _0x3e64b7[_0xa757('0x30')]()[_0xa757('0x2f')](function(){var _0x29a5ba=_0x3e64b7[_0xa757('0x31')]({'plain':!![]});var _0x170aa9=_0xa757('0x32');return db[_0xa757('0x33')]['destroy']({'where':{'type':_0x170aa9,'resourceId':_0x29a5ba['id']}})[_0xa757('0x2f')](function(){return _0x3e64b7;});})[_0xa757('0x2f')](function(){_0x27be88[_0xa757('0x26')](0xcc)[_0xa757('0x27')]();});}};}function handleEntityNotFound(_0x1c4c40,_0x51e2aa){return function(_0x1d4414){if(!_0x1d4414){_0x1c4c40[_0xa757('0x25')](0x194);}return _0x1d4414;};}function handleError(_0x37b1a3,_0x2c34b1){_0x2c34b1=_0x2c34b1||0x1f4;return function(_0xd54446){logger[_0xa757('0x20')](_0xd54446['stack']);if(_0xd54446[_0xa757('0x34')]){delete _0xd54446[_0xa757('0x34')];}_0x37b1a3[_0xa757('0x26')](_0x2c34b1)[_0xa757('0x35')](_0xd54446);};}exports[_0xa757('0x36')]=function(_0x111cfe,_0x24e280){var _0x3e12a5={'include':[{'model':db[_0xa757('0x37')],'as':_0xa757('0x38')}]},_0x13b699={},_0x4f9d98={'count':0x0,'rows':[]};var _0x9f73c6=db[_0xa757('0x39')][_0xa757('0x3a')];_0x13b699[_0xa757('0x3b')]=_['keys'](_0x9f73c6);_0x13b699[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x111cfe['query']);_0x13b699['filters']=_[_0xa757('0x3e')](_0x13b699[_0xa757('0x3b')],_0x13b699['query']);_0x3e12a5['attributes']=_[_0xa757('0x3e')](_0x13b699[_0xa757('0x3b')],qs[_0xa757('0x3f')](_0x111cfe['query'][_0xa757('0x3f')]));_0x3e12a5[_0xa757('0x40')]=_0x3e12a5[_0xa757('0x40')][_0xa757('0x41')]?_0x3e12a5[_0xa757('0x40')]:_0x13b699['model'];if(!_0x111cfe[_0xa757('0x3c')]['hasOwnProperty']('nolimit')){_0x3e12a5[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x111cfe[_0xa757('0x3c')][_0xa757('0x42')]);_0x3e12a5[_0xa757('0x28')]=qs['offset'](_0x111cfe['query'][_0xa757('0x28')]);}_0x3e12a5[_0xa757('0x43')]=qs[_0xa757('0x44')](_0x111cfe[_0xa757('0x3c')][_0xa757('0x44')]);_0x3e12a5[_0xa757('0x45')]=qs['filters'](_[_0xa757('0x46')](_0x111cfe[_0xa757('0x3c')],_0x13b699['filters']));if(_0x111cfe[_0xa757('0x3c')]['filter']){_0x3e12a5[_0xa757('0x45')]=_[_0xa757('0x47')](_0x3e12a5['where'],{'$or':_[_0xa757('0x48')](_0x9f73c6,function(_0x23efad){if(_0x23efad['type'][_0xa757('0x49')]!==_0xa757('0x4a')){var _0x27ae35={};_0x27ae35[_0x23efad[_0xa757('0x4b')]]={'$like':'%'+_0x111cfe['query'][_0xa757('0x4c')]+'%'};return _0x27ae35;}})});}_0x3e12a5=_[_0xa757('0x47')]({},_0x3e12a5,_0x111cfe[_0xa757('0x4d')]);var _0xec4610={'where':_0x3e12a5['where']};return db[_0xa757('0x39')]['count'](_0xec4610)['then'](function(_0x2acf88){_0x4f9d98[_0xa757('0x4e')]=_0x2acf88;if(_0x111cfe[_0xa757('0x3c')]['includeAll']){_0x3e12a5[_0xa757('0x4f')]=[{'all':!![]}];}return db['ChatWebsite'][_0xa757('0x50')](_0x3e12a5);})[_0xa757('0x2f')](function(_0x265793){_0x4f9d98[_0xa757('0x51')]=_0x265793;return _0x4f9d98;})[_0xa757('0x2f')](respondWithFilteredResult(_0x24e280,_0x3e12a5))[_0xa757('0x24')](handleError(_0x24e280,null));};exports[_0xa757('0x52')]=function(_0x505cd,_0x581e95){var _0x2de226={'raw':![],'where':{'id':_0x505cd[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x37')],'as':_0xa757('0x38')}]},_0x7411a3={};_0x7411a3[_0xa757('0x3b')]=_[_0xa757('0x3d')](db[_0xa757('0x39')][_0xa757('0x3a')]);_0x7411a3[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x505cd[_0xa757('0x3c')]);_0x7411a3[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x7411a3[_0xa757('0x3b')],_0x7411a3[_0xa757('0x3c')]);_0x2de226['attributes']=_[_0xa757('0x3e')](_0x7411a3['model'],qs[_0xa757('0x3f')](_0x505cd[_0xa757('0x3c')][_0xa757('0x3f')]));_0x2de226[_0xa757('0x40')]=_0x2de226['attributes'][_0xa757('0x41')]?_0x2de226[_0xa757('0x40')]:_0x7411a3[_0xa757('0x3b')];if(_0x505cd[_0xa757('0x3c')]['includeAll']){_0x2de226[_0xa757('0x4f')]=[{'all':!![]}];}_0x2de226=_[_0xa757('0x47')]({},_0x2de226,_0x505cd[_0xa757('0x4d')]);return db[_0xa757('0x39')][_0xa757('0x55')](_0x2de226)[_0xa757('0x2f')](handleEntityNotFound(_0x581e95,null))['then'](respondWithResult(_0x581e95,null))['catch'](handleError(_0x581e95,null));};exports['create']=function(_0x5a49d0,_0x1d8742){return db[_0xa757('0x39')][_0xa757('0x56')](_0x5a49d0[_0xa757('0x57')],{})[_0xa757('0x2f')](function(_0x2d290b){var _0x5efb32=_0x5a49d0[_0xa757('0x58')][_0xa757('0x31')]({'plain':!![]});if(!_0x5efb32)throw new Error(_0xa757('0x59'));if(_0x5efb32[_0xa757('0x5a')]==='user'){var _0x26c74e=_0x2d290b[_0xa757('0x31')]({'plain':!![]});var _0x4af840=_0xa757('0x32');return db['UserProfileSection'][_0xa757('0x55')]({'where':{'name':_0x4af840,'userProfileId':_0x5efb32['userProfileId']},'raw':!![]})[_0xa757('0x2f')](function(_0x58633a){if(_0x58633a&&_0x58633a['autoAssociation']===0x0){return db[_0xa757('0x33')][_0xa757('0x56')]({'name':_0x26c74e[_0xa757('0x34')],'resourceId':_0x26c74e['id'],'type':_0x58633a[_0xa757('0x34')],'sectionId':_0x58633a['id']},{})[_0xa757('0x2f')](function(){return _0x2d290b;});}else{return _0x2d290b;}})[_0xa757('0x24')](function(_0x4c19a6){logger['error'](_0xa757('0x5b'),_0x4c19a6);throw _0x4c19a6;});}return _0x2d290b;})[_0xa757('0x2f')](respondWithResult(_0x1d8742,0xc9))[_0xa757('0x24')](handleError(_0x1d8742,null));};exports['update']=function(_0x55a7d2,_0x18dff7){if(_0x55a7d2[_0xa757('0x57')]['id']){delete _0x55a7d2[_0xa757('0x57')]['id'];}return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x55a7d2[_0xa757('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xa757('0x38')}]})[_0xa757('0x2f')](handleEntityNotFound(_0x18dff7,null))[_0xa757('0x2f')](saveUpdates(_0x55a7d2[_0xa757('0x57')],null))[_0xa757('0x2f')](respondWithResult(_0x18dff7,null))[_0xa757('0x24')](handleError(_0x18dff7,null));};exports[_0xa757('0x30')]=function(_0x13dd81,_0xb45477){return db[_0xa757('0x39')]['find']({'where':{'id':_0x13dd81[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0xb45477,null))['then'](removeEntity(_0xb45477,null))[_0xa757('0x24')](handleError(_0xb45477,null));};exports[_0xa757('0x5c')]=function(_0x432856,_0x444417){return db[_0xa757('0x39')][_0xa757('0x5c')]()[_0xa757('0x2f')](respondWithResult(_0x444417,null))[_0xa757('0x24')](handleError(_0x444417,null));};exports[_0xa757('0x5d')]=function(_0x22a185,_0x42f2c0,_0x4fc507){if(_0x22a185[_0xa757('0x57')]['id']){delete _0x22a185[_0xa757('0x57')]['id'];}return db['ChatWebsite'][_0xa757('0x55')]({'where':{'id':_0x22a185[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x42f2c0,null))[_0xa757('0x2f')](function(_0x27d79b){if(_0x27d79b){_0x22a185[_0xa757('0x57')]['ChatWebsiteId']=_0x27d79b['id'];return db[_0xa757('0x5e')]['create'](_0x22a185[_0xa757('0x57')]);}})[_0xa757('0x2f')](respondWithResult(_0x42f2c0,null))[_0xa757('0x24')](handleError(_0x42f2c0,null));};exports[_0xa757('0x5f')]=function(_0x39ca41,_0x5c0870,_0x57ec52){var _0x1c8807={'raw':![],'where':{}};var _0x10a7cb={};var _0x2338e5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa757('0x60')]({'where':{'id':_0x39ca41['params']['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x5c0870,null))[_0xa757('0x2f')](function(_0x2b0ad4){if(_0x2b0ad4){_0x10a7cb[_0xa757('0x3b')]=_[_0xa757('0x3d')](db[_0xa757('0x5e')]['rawAttributes']);_0x10a7cb[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x39ca41[_0xa757('0x3c')]);_0x10a7cb[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x10a7cb['model'],_0x10a7cb[_0xa757('0x3c')]);_0x1c8807[_0xa757('0x40')]=_[_0xa757('0x3e')](_0x10a7cb[_0xa757('0x3b')],qs[_0xa757('0x3f')](_0x39ca41['query'][_0xa757('0x3f')]));_0x1c8807[_0xa757('0x40')]=_0x1c8807[_0xa757('0x40')]['length']?_0x1c8807[_0xa757('0x40')]:_0x10a7cb[_0xa757('0x3b')];if(!_0x39ca41[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x1c8807[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x39ca41[_0xa757('0x3c')][_0xa757('0x42')]);_0x1c8807[_0xa757('0x28')]=qs[_0xa757('0x28')](_0x39ca41[_0xa757('0x3c')][_0xa757('0x28')]);}_0x1c8807[_0xa757('0x43')]=qs['sort'](_0x39ca41[_0xa757('0x3c')][_0xa757('0x44')]);_0x1c8807['where']=qs[_0xa757('0x54')](_[_0xa757('0x46')](_0x39ca41['query'],_0x10a7cb[_0xa757('0x54')]));_0x1c8807[_0xa757('0x45')][_0xa757('0x63')]=_0x2b0ad4['id'];if(_0x39ca41[_0xa757('0x3c')][_0xa757('0x4c')]){_0x1c8807[_0xa757('0x45')]=_[_0xa757('0x47')](_0x1c8807[_0xa757('0x45')],{'$or':_[_0xa757('0x48')](_0x1c8807[_0xa757('0x40')],function(_0x2649a2){var _0x189195={};_0x189195[_0x2649a2]={'$like':'%'+_0x39ca41[_0xa757('0x3c')][_0xa757('0x4c')]+'%'};return _0x189195;})});}_0x1c8807=_[_0xa757('0x47')]({},_0x1c8807,_0x39ca41[_0xa757('0x4d')]);return db['Disposition'][_0xa757('0x4e')]({'where':_0x1c8807['where']})[_0xa757('0x2f')](function(_0x20c444){_0x2338e5[_0xa757('0x4e')]=_0x20c444;if(_0x39ca41[_0xa757('0x3c')][_0xa757('0x64')]){_0x1c8807['include']=[{'all':!![]}];}return db[_0xa757('0x5e')][_0xa757('0x50')](_0x1c8807);})[_0xa757('0x2f')](function(_0x4a691d){_0x2338e5[_0xa757('0x51')]=_0x4a691d;return _0x2338e5;});}})[_0xa757('0x2f')](respondWithFilteredResult(_0x5c0870,_0x1c8807))[_0xa757('0x24')](handleError(_0x5c0870,null));};exports['removeDispositions']=function(_0x501134,_0x1f437d,_0x351e0e){var _0x388e6d;return db['ChatWebsite'][_0xa757('0x55')]({'where':{'id':_0x501134['params']['id']}})['then'](handleEntityNotFound(_0x1f437d,null))[_0xa757('0x2f')](function(_0x1adf5a){if(_0x1adf5a){return _0x1adf5a[_0xa757('0x65')](_0x501134['query'][_0xa757('0x66')]);}})[_0xa757('0x2f')](respondWithStatusCode(_0x1f437d,null))[_0xa757('0x24')](handleError(_0x1f437d,null));};exports[_0xa757('0x67')]=function(_0x3e5cf5,_0x2d0ce0,_0x26dcec){if(_0x3e5cf5[_0xa757('0x57')]['id']){delete _0x3e5cf5[_0xa757('0x57')]['id'];}return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x3e5cf5[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d0ce0,null))[_0xa757('0x2f')](function(_0x1b624f){if(_0x1b624f){_0x3e5cf5[_0xa757('0x57')][_0xa757('0x63')]=_0x1b624f['id'];return db[_0xa757('0x68')][_0xa757('0x56')](_0x3e5cf5[_0xa757('0x57')]);}})[_0xa757('0x2f')](respondWithResult(_0x2d0ce0,null))[_0xa757('0x24')](handleError(_0x2d0ce0,null));};exports[_0xa757('0x69')]=function(_0x3997f8,_0x2f5a0f,_0x132033){var _0x3a258f={'raw':![],'where':{}};var _0x1b6adb={};var _0x57dd90={'count':0x0,'rows':[]};return db[_0xa757('0x39')][_0xa757('0x60')]({'where':{'id':_0x3997f8[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x2f5a0f,null))[_0xa757('0x2f')](function(_0x20ea21){if(_0x20ea21){_0x1b6adb['model']=_[_0xa757('0x3d')](db[_0xa757('0x68')]['rawAttributes']);_0x1b6adb[_0xa757('0x3c')]=_['keys'](_0x3997f8[_0xa757('0x3c')]);_0x1b6adb[_0xa757('0x54')]=_['intersection'](_0x1b6adb[_0xa757('0x3b')],_0x1b6adb[_0xa757('0x3c')]);_0x3a258f[_0xa757('0x40')]=_[_0xa757('0x3e')](_0x1b6adb['model'],qs[_0xa757('0x3f')](_0x3997f8[_0xa757('0x3c')]['fields']));_0x3a258f[_0xa757('0x40')]=_0x3a258f[_0xa757('0x40')]['length']?_0x3a258f[_0xa757('0x40')]:_0x1b6adb[_0xa757('0x3b')];if(!_0x3997f8[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x3a258f[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x3997f8[_0xa757('0x3c')][_0xa757('0x42')]);_0x3a258f['offset']=qs['offset'](_0x3997f8[_0xa757('0x3c')][_0xa757('0x28')]);}_0x3a258f[_0xa757('0x43')]=qs[_0xa757('0x44')](_0x3997f8[_0xa757('0x3c')][_0xa757('0x44')]);_0x3a258f[_0xa757('0x45')]=qs['filters'](_[_0xa757('0x46')](_0x3997f8['query'],_0x1b6adb[_0xa757('0x54')]));_0x3a258f[_0xa757('0x45')][_0xa757('0x63')]=_0x20ea21['id'];if(_0x3997f8[_0xa757('0x3c')][_0xa757('0x4c')]){_0x3a258f['where']=_[_0xa757('0x47')](_0x3a258f['where'],{'$or':_[_0xa757('0x48')](_0x3a258f[_0xa757('0x40')],function(_0x183097){var _0x219b11={};_0x219b11[_0x183097]={'$like':'%'+_0x3997f8['query'][_0xa757('0x4c')]+'%'};return _0x219b11;})});}_0x3a258f=_[_0xa757('0x47')]({},_0x3a258f,_0x3997f8[_0xa757('0x4d')]);return db[_0xa757('0x68')][_0xa757('0x4e')]({'where':_0x3a258f[_0xa757('0x45')]})[_0xa757('0x2f')](function(_0x26dff8){_0x57dd90['count']=_0x26dff8;if(_0x3997f8[_0xa757('0x3c')][_0xa757('0x64')]){_0x3a258f[_0xa757('0x4f')]=[{'all':!![]}];}return db[_0xa757('0x68')]['findAll'](_0x3a258f);})[_0xa757('0x2f')](function(_0x40f851){_0x57dd90[_0xa757('0x51')]=_0x40f851;return _0x57dd90;});}})[_0xa757('0x2f')](respondWithFilteredResult(_0x2f5a0f,_0x3a258f))[_0xa757('0x24')](handleError(_0x2f5a0f,null));};exports[_0xa757('0x6a')]=function(_0x37bc78,_0x5ac363,_0x4bd160){var _0x38d7b4;return db['ChatWebsite'][_0xa757('0x55')]({'where':{'id':_0x37bc78['params']['id']}})['then'](handleEntityNotFound(_0x5ac363,null))[_0xa757('0x2f')](function(_0x331775){if(_0x331775){return _0x331775[_0xa757('0x6a')](_0x37bc78[_0xa757('0x3c')][_0xa757('0x66')]);}})[_0xa757('0x2f')](respondWithStatusCode(_0x5ac363,null))[_0xa757('0x24')](handleError(_0x5ac363,null));};exports[_0xa757('0x6b')]=function(_0x14b610,_0xb903,_0x4da18a){_0x14b610[_0xa757('0x57')]['sitepic']=_0x14b610[_0xa757('0x6c')][_0xa757('0x6d')];return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x14b610['params']['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0xb903,null))[_0xa757('0x2f')](saveUpdates(_0x14b610[_0xa757('0x57')],null))[_0xa757('0x2f')](respondWithResult(_0xb903,null))[_0xa757('0x24')](handleError(_0xb903,null));};exports[_0xa757('0x6e')]=function(_0x1c789c,_0xa4313f,_0x150b5c){_0x1c789c[_0xa757('0x57')][_0xa757('0x6f')]=_0x1c789c[_0xa757('0x6c')][_0xa757('0x6d')];return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x1c789c['params']['id']}})['then'](handleEntityNotFound(_0xa4313f,null))[_0xa757('0x2f')](saveUpdates(_0x1c789c['body'],null))[_0xa757('0x2f')](respondWithResult(_0xa4313f,null))[_0xa757('0x24')](handleError(_0xa4313f,null));};exports[_0xa757('0x70')]=function(_0x1d03a7,_0x48c52f,_0x33995b){_0x1d03a7[_0xa757('0x57')][_0xa757('0x71')]=_0x1d03a7[_0xa757('0x6c')][_0xa757('0x6d')];return db[_0xa757('0x39')]['find']({'where':{'id':_0x1d03a7[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x48c52f,null))[_0xa757('0x2f')](saveUpdates(_0x1d03a7[_0xa757('0x57')],null))[_0xa757('0x2f')](respondWithResult(_0x48c52f,null))['catch'](handleError(_0x48c52f,null));};exports['addSystemAvatar']=function(_0x26954d,_0x531cba,_0x2b177c){_0x26954d['body'][_0xa757('0x72')]=_0x26954d[_0xa757('0x6c')][_0xa757('0x6d')];return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x26954d[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x531cba,null))[_0xa757('0x2f')](saveUpdates(_0x26954d[_0xa757('0x57')],null))[_0xa757('0x2f')](respondWithResult(_0x531cba,null))[_0xa757('0x24')](handleError(_0x531cba,null));};exports['getLogo']=function(_0x289149,_0x38a6db,_0x3eb34f){var _0x3a1717=path[_0xa757('0x73')](config[_0xa757('0x74')],'server/files/images/logos/default_logo.png');var _0x30439a={'where':{'id':_0x289149[_0xa757('0x53')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x133f0c=![];return require(_0xa757('0x75'))[_0xa757('0x76')]()['then'](function(_0x3ae3bf){if(_0x3ae3bf){_0x133f0c=_0x3ae3bf[_0xa757('0x77')];}})[_0xa757('0x2f')](function(){return db[_0xa757('0x39')][_0xa757('0x55')](_0x30439a);})['then'](handleEntityNotFound(_0x38a6db,null))[_0xa757('0x2f')](function(_0x5ddcab){if(_0x5ddcab){if(!_['isNil'](_0x5ddcab[_0xa757('0x78')])){if(fs['existsSync'](path['join'](config[_0xa757('0x74')],_0xa757('0x79'),_0x5ddcab[_0xa757('0x78')]))&&_0x133f0c){_0x3a1717=path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0x79'),_0x5ddcab['sitepic']);}}return _0x38a6db['download'](_0x3a1717);}})['catch'](handleError(_0x38a6db,null));};exports['getAvatar']=function(_0x5cd42d,_0x4e5e8f,_0x504367){var _0x1c9b81=path['join'](config[_0xa757('0x74')],_0xa757('0x7a'));var _0x146305={'where':{'id':_0x5cd42d[_0xa757('0x53')]['id']},'attributes':['id',_0xa757('0x6f')],'raw':!![]};return db[_0xa757('0x39')][_0xa757('0x55')](_0x146305)[_0xa757('0x2f')](handleEntityNotFound(_0x4e5e8f,null))[_0xa757('0x2f')](function(_0x49f3fe){if(_0x49f3fe){if(!_['isNil'](_0x49f3fe[_0xa757('0x6f')])){if(fs[_0xa757('0x7b')](path[_0xa757('0x73')](config[_0xa757('0x74')],'server/files/images/avatars/',_0x49f3fe[_0xa757('0x6f')]))){_0x1c9b81=path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0x7c'),_0x49f3fe[_0xa757('0x6f')]);}}return _0x4e5e8f[_0xa757('0x7d')](_0x1c9b81);}})[_0xa757('0x24')](handleError(_0x4e5e8f,null));};exports['getCustomerAvatar']=function(_0x2a6423,_0x2116a8,_0x494735){var _0x3799ce=path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0x7e'));var _0x1b61ba={'where':{'id':_0x2a6423['params']['id']},'attributes':['id',_0xa757('0x71'),_0xa757('0x7f')],'raw':!![]};return db[_0xa757('0x39')]['find'](_0x1b61ba)[_0xa757('0x2f')](handleEntityNotFound(_0x2116a8,null))[_0xa757('0x2f')](function(_0xb65657){if(_0xb65657){if(!_['isNil'](_0xb65657[_0xa757('0x71')])){if(fs[_0xa757('0x7b')](path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0x7c'),_0xb65657['customerAvatar']))&&_0xb65657[_0xa757('0x7f')]){_0x3799ce=path['join'](config['root'],_0xa757('0x7c'),_0xb65657[_0xa757('0x71')]);}}return _0x2116a8[_0xa757('0x7d')](_0x3799ce);}})[_0xa757('0x24')](handleError(_0x2116a8,null));};exports['getSystemAvatar']=function(_0xe88a0a,_0x36c462,_0x4735a9){var _0x2aa91b=path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0x80'));var _0xad41e1={'where':{'id':_0xe88a0a['params']['id']},'attributes':['id',_0xa757('0x72')],'raw':!![]};return db[_0xa757('0x39')][_0xa757('0x55')](_0xad41e1)[_0xa757('0x2f')](handleEntityNotFound(_0x36c462,null))[_0xa757('0x2f')](function(_0x182d71){if(_0x182d71){if(!_[_0xa757('0x81')](_0x182d71[_0xa757('0x72')])){if(fs[_0xa757('0x7b')](path['join'](config['root'],_0xa757('0x7c'),_0x182d71[_0xa757('0x72')]))){_0x2aa91b=path['join'](config[_0xa757('0x74')],'server/files/images/avatars/',_0x182d71[_0xa757('0x72')]);}}return _0x36c462[_0xa757('0x7d')](_0x2aa91b);}})[_0xa757('0x24')](handleError(_0x36c462,null));};exports[_0xa757('0x82')]=function(_0x4601de,_0x1bb681,_0x168bbd){var _0xaf735e=require(_0xa757('0x83'));var _0x5b89a4=new _0xaf735e();var _0x31ead6=_0x5b89a4[_0xa757('0x84')](_0x4601de['headers'][_0xa757('0x85')])[_0xa757('0x86')]();var _0x4598d0={'body':_0x4601de[_0xa757('0x57')],'channel':_0xa757('0x87')};var _0x210fcb=[];var _0x377de7=[];var _0x42ba86={};var _0x2ea80d=![];return db[_0xa757('0x88')][_0xa757('0x5c')]()[_0xa757('0x2f')](function(_0x4bc42c){if(!_0x4bc42c){throw new db[(_0xa757('0x89'))][(_0xa757('0x8a'))]('no\x20available\x20attributes');}_0x210fcb=_[_0xa757('0x8b')](_[_0xa757('0x3d')](_0x4bc42c),['createdAt',_0xa757('0x8c')]);_0x377de7=_[_0xa757('0x8b')](_[_0xa757('0x3d')](_0x4bc42c),[_0xa757('0x8d'),'updatedAt','CompanyId',_0xa757('0x8e')]);if(_0x4601de['body']['id']){delete _0x4601de[_0xa757('0x57')]['id'];}if(_['isNil'](_0x4601de[_0xa757('0x57')][_0xa757('0x8f')])){throw new db[(_0xa757('0x89'))][(_0xa757('0x8a'))](_0xa757('0x90'));}if(_['isNil'](_0x4601de['body'][_0xa757('0x57')])||_0x4601de[_0xa757('0x57')][_0xa757('0x57')]===''){throw new db[(_0xa757('0x89'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa757('0x81')](_0x4601de['body'][_0xa757('0x91')])){throw new db[(_0xa757('0x89'))][(_0xa757('0x8a'))](_0xa757('0x92')+_0x377de7);}if(!_[_0xa757('0x93')](_0x377de7,_0x4601de[_0xa757('0x57')][_0xa757('0x91')])){throw new db['Sequelize'][(_0xa757('0x8a'))](_0xa757('0x94')+_0x377de7);}_0x42ba86[_0x4601de[_0xa757('0x57')][_0xa757('0x91')]]=_0x4601de[_0xa757('0x57')][_0xa757('0x8f')];})[_0xa757('0x2f')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4601de[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x95')],'as':_0xa757('0x96'),'include':[{'model':db[_0xa757('0x88')],'as':_0xa757('0x97'),'where':_0x42ba86,'limit':0x1,'order':[[_0xa757('0x8c'),'DESC']]}]},{'model':db[_0xa757('0x98')],'as':'Applications'}]});})[_0xa757('0x2f')](handleEntityNotFound(_0x1bb681,null))[_0xa757('0x2f')](function(_0x3c7e49){if(_0x3c7e49&&_0x3c7e49[_0xa757('0x96')]){_0x4598d0[_0xa757('0x99')]=_0x3c7e49;_0x4598d0[_0xa757('0x9a')]=_0x3c7e49[_0xa757('0x9b')];_0x4598d0[_0xa757('0x9c')]=_0x3c7e49[_0xa757('0x96')];_0x4598d0[_0xa757('0x9a')]=_['orderBy'](_0x4598d0['applications'],[_0xa757('0x9d')],['asc']);if(_0x4598d0['account'][_0xa757('0x9b')]){delete _0x4598d0[_0xa757('0x99')]['Applications'];}if(_0x4598d0[_0xa757('0x99')]['List']&&_0x4598d0[_0xa757('0x99')][_0xa757('0x96')][_0xa757('0x97')][_0xa757('0x41')]){return _0x4598d0[_0xa757('0x99')][_0xa757('0x96')][_0xa757('0x97')][0x0];}var _0x44d742=_['defaults'](_0x4601de['body'],{'firstName':_0x4601de[_0xa757('0x57')]['from'],'ListId':_0x3c7e49[_0xa757('0x8e')]});_0x44d742[_0x4601de[_0xa757('0x57')][_0xa757('0x91')]]=_0x4601de[_0xa757('0x57')][_0xa757('0x8f')];return db[_0xa757('0x88')][_0xa757('0x56')](_0x44d742,{'fields':_0x210fcb,'raw':!![]});}})[_0xa757('0x2f')](handleEntityNotFound(_0x1bb681,null))['then'](function(_0x2d0344){_0x4598d0['contact']=_0x2d0344;if(_0x2d0344){var _0x53dd5f={'ContactId':_0x2d0344['id'],'ChatWebsiteId':_0x4601de[_0xa757('0x53')]['id'],'from':(_0x2d0344[_0xa757('0x9e')]||'')+'\x20'+(_0x2d0344[_0xa757('0x9f')]||''),'customerIp':_0x4601de[_0xa757('0x57')]['customerIp'],'referer':_0x4601de[_0xa757('0x57')]['referer'],'browserName':_0x31ead6[_0xa757('0xa0')]['name']&&_0x31ead6[_0xa757('0xa0')][_0xa757('0xa1')]?util['format'](_0xa757('0xa2'),_0x31ead6[_0xa757('0xa0')]['name'],_0x31ead6[_0xa757('0xa0')][_0xa757('0xa1')]):_0xa757('0xa3'),'browserVersion':_0x31ead6[_0xa757('0xa0')][_0xa757('0xa1')]||_0xa757('0xa3'),'osName':util[_0xa757('0xa4')]('%s\x20%s',_0x31ead6['os'][_0xa757('0x34')],_0x31ead6['os'][_0xa757('0xa1')]),'osVersion':_0x31ead6['os']['version'],'deviceModel':_0x31ead6['device'][_0xa757('0x3b')]&&_0x31ead6[_0xa757('0xa5')][_0xa757('0xa6')]?util[_0xa757('0xa4')](_0xa757('0xa7'),_0x31ead6[_0xa757('0xa5')][_0xa757('0x3b')],_0x31ead6[_0xa757('0xa5')][_0xa757('0xa6')],_0x31ead6[_0xa757('0xa5')][_0xa757('0xa8')]):null,'deviceVendor':_0x31ead6[_0xa757('0xa5')][_0xa757('0xa6')],'deviceType':_0x31ead6['device'][_0xa757('0xa8')],'formData':JSON[_0xa757('0xa9')](_0x4601de[_0xa757('0x57')])};var _0x54edfb={'ChatWebsiteId':_0x4601de['params']['id'],'closed':![]};if(_0x4601de[_0xa757('0x57')][_0xa757('0xaa')]){_0x54edfb['threadId']=_0x4601de[_0xa757('0x57')][_0xa757('0xaa')];return db['ChatInteraction'][_0xa757('0x55')]({'where':_0x54edfb})['then'](function(_0x20b817){if(_0x20b817){return[_0x20b817,![]];}_0x53dd5f[_0xa757('0xaa')]=_0x4601de[_0xa757('0x57')][_0xa757('0xaa')];_0x53dd5f[_0xa757('0xab')]=_0x4601de[_0xa757('0x57')][_0xa757('0xab')];return db[_0xa757('0xac')]['create'](_0x53dd5f)[_0xa757('0x2f')](function(_0x54ae6f){return[_0x54ae6f,!![]];});});}_0x54edfb['ContactId']=_0x2d0344['id'];if(_0x4601de[_0xa757('0x57')][_0xa757('0xad')]&&_0x4601de['body']['interaction']['id']){_0x54edfb['id']=_0x4601de['body'][_0xa757('0xad')]['id'];return db[_0xa757('0xac')][_0xa757('0x55')]({'where':_0x54edfb})['then'](function(_0x1327f7){if(_0x1327f7){return[_0x1327f7,![]];}return db[_0xa757('0xac')][_0xa757('0x56')](_0x53dd5f)[_0xa757('0x2f')](function(_0x1caccc){return[_0x1caccc,!![]];});});}return db[_0xa757('0xac')][_0xa757('0x56')](_0x53dd5f)[_0xa757('0x2f')](function(_0x573b82){return[_0x573b82,!![]];});}})[_0xa757('0xae')](function(_0x485e4f,_0x4654e3){if(_0x485e4f){_0x2ea80d=_0x4654e3;if(!_0x4654e3){var _0x238e2b={'from':(_0x4598d0[_0xa757('0xaf')][_0xa757('0x9e')]||'')+'\x20'+(_0x4598d0[_0xa757('0xaf')]['lastName']||'')};if(_0x4601de[_0xa757('0x57')]['threadId']&&_0x4601de[_0xa757('0x57')][_0xa757('0xb0')]&&_0x4601de[_0xa757('0x57')][_0xa757('0xaa')]!=_0x4601de[_0xa757('0x57')][_0xa757('0xb0')]){_0x238e2b[_0xa757('0xaa')]=_0x4601de[_0xa757('0x57')][_0xa757('0xb0')];}return _0x485e4f['update'](_0x238e2b);}else{return _0x485e4f;}}})['then'](function(_0x2ef834){_0x4598d0[_0xa757('0xad')]=_0x2ef834['get']({'plain':!![]});_0x4598d0[_0xa757('0xad')][_0xa757('0xb1')]=_0x2ea80d;if(_0x4598d0['interaction'][_0xa757('0xb1')]){if(_0x4598d0['account'][_0xa757('0xb2')]){_0x4598d0[_0xa757('0x9a')][_0xa757('0xb3')]({'id':0x0,'priority':_0x4598d0[_0xa757('0x9a')][_0xa757('0x41')]+0x1,'app':_0xa757('0xb4'),'appdata':_0xa757('0xb5'),'interval':_0xa757('0xb6')});}}return db[_0xa757('0xb7')][_0xa757('0x56')]({'body':_0x4601de[_0xa757('0x57')][_0xa757('0x57')],'ChatWebsiteId':_0x4601de[_0xa757('0x53')]['id'],'ChatInteractionId':_0x2ef834['id'],'direction':'in','ContactId':_0x4598d0['contact']['id'],'AttachmentId':_0x4601de['body'][_0xa757('0xb8')]});})[_0xa757('0x2f')](function(_0x3199d6){_0x4598d0['message']=_0x3199d6;if(_0x4598d0[_0xa757('0xad')][_0xa757('0xb9')]){return db[_0xa757('0xba')][_0xa757('0x55')]({'attributes':['id',_0xa757('0x34')],'where':{'id':_0x4598d0['interaction']['UserId']}})[_0xa757('0x2f')](function(_0x4606e1){if(_0x4606e1){_0x4598d0[_0xa757('0x9a')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa757('0xbb'),'appdata':_0x4606e1[_0xa757('0x34')]+','+(_0x4598d0['account'][_0xa757('0xbc')]||0xa),'interval':_0xa757('0xb6')});_0x4598d0[_0xa757('0xbd')]=!![];}return respondWithRpcPromise('Start',_0xa757('0xbe'),_0x4598d0);});}return respondWithRpcPromise(_0xa757('0xbf'),_0xa757('0xbe'),_0x4598d0);})[_0xa757('0x2f')](function(_0x22939e){respondWithRpcPromise(_0xa757('0xc0'),_0xa757('0xc0'),{'event':'notify','message':_0x22939e},client9002);return _0x22939e;})[_0xa757('0x2f')](respondWithResult(_0x1bb681,null))['catch'](handleError(_0x1bb681,null));};exports[_0xa757('0xc1')]=function(_0x439650,_0x319742,_0x3694bc){var _0x57f3fd,_0x4d033f,_0x10f936;var _0x488be0=[];var _0x36391a=[];var _0x4243db={};return db[_0xa757('0x88')]['describe']()['then'](function(_0x15ee4c){if(!_0x15ee4c){throw new db[(_0xa757('0x89'))][(_0xa757('0x8a'))](_0xa757('0xc2'));}_0x36391a=_[_0xa757('0x8b')](_[_0xa757('0x3d')](_0x15ee4c),['createdAt',_0xa757('0x8c')]);_0x488be0=_[_0xa757('0x8b')](_[_0xa757('0x3d')](_0x15ee4c),['createdAt',_0xa757('0x8c'),_0xa757('0xc3'),_0xa757('0x8e')]);if(_0x439650[_0xa757('0x57')]['id']){delete _0x439650[_0xa757('0x57')]['id'];}if(_[_0xa757('0x81')](_0x439650[_0xa757('0x57')]['from'])){throw _0x319742[_0xa757('0x26')](0x1f4)[_0xa757('0x35')](new db[(_0xa757('0x89'))][(_0xa757('0x8a'))](_0xa757('0x90')));}if(_[_0xa757('0x81')](_0x439650[_0xa757('0x57')]['body'])||_0x439650[_0xa757('0x57')]['body']===''){throw _0x319742[_0xa757('0x26')](0x1f4)['send'](new db[(_0xa757('0x89'))][(_0xa757('0x8a'))](_0xa757('0xc4')));}if(_['isNil'](_0x439650['body']['mapKeyOffline'])){throw _0x319742[_0xa757('0x26')](0x1f4)[_0xa757('0x35')](new db[(_0xa757('0x89'))][(_0xa757('0x8a'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x488be0));}if(!_[_0xa757('0x93')](_0x488be0,_0x439650['body'][_0xa757('0xc5')])){throw _0x319742[_0xa757('0x26')](0x1f4)[_0xa757('0x35')](new db['Sequelize'][(_0xa757('0x8a'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x488be0));}_0x4243db[_0x439650[_0xa757('0x57')][_0xa757('0xc5')]]=_0x439650['body'][_0xa757('0x8f')];})[_0xa757('0x2f')](function(){return db[_0xa757('0x39')]['find']({'where':{'id':_0x439650['params']['id']},'include':[{'model':db['CmList'],'as':_0xa757('0x96')}]});})[_0xa757('0x2f')](handleEntityNotFound(_0x319742,null))['then'](function(_0x500fbe){if(_0x500fbe&&_0x500fbe[_0xa757('0x96')]){_0x4d033f=_0x500fbe;var _0xdd7b4f=_[_0xa757('0xc6')](_0x439650['body'],{'firstName':_0x439650['body']['from'],'phone':_0x439650[_0xa757('0x57')][_0xa757('0x8f')],'ListId':_0x500fbe[_0xa757('0x8e')]});_0xdd7b4f[_0x439650[_0xa757('0x57')][_0xa757('0xc5')]]=_0x439650[_0xa757('0x57')][_0xa757('0x8f')];return db[_0xa757('0x88')]['findOrCreate']({'where':_0x4243db,'defaults':_0xdd7b4f});}})[_0xa757('0xae')](function(_0x468ae5){if(_0x468ae5){_0x10f936=_0x468ae5;var _0x530e8f=fs[_0xa757('0xc7')](path[_0xa757('0x73')](config[_0xa757('0x74')],_0xa757('0xc8')),_0xa757('0xc9'));var _0x9b7857=ejs[_0xa757('0xca')](_0x530e8f,{'body':_[_0xa757('0xcb')](_0x439650[_0xa757('0x57')][_0xa757('0x57')]),'bodyTitle':_0x4d033f[_0xa757('0xcc')]});return db[_0xa757('0xcd')]['create']({'body':_0x9b7857,'ContactId':_0x468ae5['id'],'ChatWebsiteId':_0x4d033f['id']});}})['then'](function(_0x2abae7){if(_0x2abae7){_0x57f3fd=_0x2abae7;return db[_0xa757('0xce')][_0xa757('0x60')]({'where':{'service':!![]},'include':[{'model':db[_0xa757('0xcf')],'as':_0xa757('0xd0'),'raw':!![]}]});}})[_0xa757('0x2f')](function(_0x25bcf0){if(_0x25bcf0&&_0x25bcf0['Smtp']&&_0x4d033f[_0xa757('0xd1')]){var _0x2266db={'tls':{'rejectUnauthorized':![]}};if(_0x25bcf0[_0xa757('0xd0')][_0xa757('0xd2')]){_0x2266db[_0xa757('0xd2')]=_0x25bcf0[_0xa757('0xd0')][_0xa757('0xd2')];}else{_0x2266db['host']=_0x25bcf0[_0xa757('0xd0')][_0xa757('0xd3')];_0x2266db['port']=_0x25bcf0['Smtp']['port'];_0x2266db[_0xa757('0xd4')]=_0x25bcf0['Smtp']['secure'];}if(_0x25bcf0[_0xa757('0xd0')][_0xa757('0xd5')]){_0x2266db[_0xa757('0xd6')]={'user':_0x25bcf0[_0xa757('0xd0')]['user'],'pass':_0x25bcf0[_0xa757('0xd0')][_0xa757('0xd7')]};}return respondWithRpcPromise('SendMail',_0xa757('0xd8'),{'account':_0x2266db,'message':{'from':util[_0xa757('0xa4')](_0xa757('0xd9'),_0x25bcf0[_0xa757('0x34')],_0x25bcf0['email']||_0x25bcf0[_0xa757('0xd0')][_0xa757('0x58')]),'to':_0x4d033f[_0xa757('0xd1')],'subject':_0x4d033f[_0xa757('0xda')],'text':_0x57f3fd[_0xa757('0x57')]}},client9003)[_0xa757('0x2f')](function(){return _0x57f3fd;})[_0xa757('0x24')](function(_0x321d9e){console[_0xa757('0x20')](_0x321d9e);});}})['then'](function(){if(_0x57f3fd){return _0x57f3fd;}})[_0xa757('0x2f')](respondWithResult(_0x319742,null))[_0xa757('0x24')](handleError(_0x319742,null));};exports[_0xa757('0xdb')]=function(_0x3b003d,_0x256da6,_0x3f6732){return db[_0xa757('0xac')]['find']({'where':{'id':_0x3b003d[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x256da6,null))[_0xa757('0x2f')](function(_0x13248a){if(_0x13248a){return _0x13248a[_0xa757('0xdb')](_0x3b003d[_0xa757('0x57')][_0xa757('0x66')],_[_0xa757('0xdc')](_0x3b003d[_0xa757('0x57')],['ids','id'])||{});}})[_0xa757('0x2f')](respondWithResult(_0x256da6,null))['catch'](handleError(_0x256da6,null));};exports['getInteractions']=function(_0x49e774,_0x48cf01,_0x1a60a2){var _0x40e0df={'raw':![],'where':{}};var _0x54f4ca={};var _0x4152da={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x49e774[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x48cf01,null))['then'](function(_0x59ff48){if(_0x59ff48){_0x54f4ca[_0xa757('0x3b')]=_['keys'](db[_0xa757('0xac')][_0xa757('0x3a')]);_0x54f4ca[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x49e774['query']);_0x54f4ca[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x54f4ca[_0xa757('0x3b')],_0x54f4ca[_0xa757('0x3c')]);_0x40e0df[_0xa757('0x40')]=_[_0xa757('0x3e')](_0x54f4ca[_0xa757('0x3b')],qs['fields'](_0x49e774[_0xa757('0x3c')][_0xa757('0x3f')]));_0x40e0df['attributes']=_0x40e0df[_0xa757('0x40')][_0xa757('0x41')]?_0x40e0df['attributes']:_0x54f4ca[_0xa757('0x3b')];if(!_0x49e774[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x40e0df[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x49e774[_0xa757('0x3c')]['limit']);_0x40e0df[_0xa757('0x28')]=qs[_0xa757('0x28')](_0x49e774[_0xa757('0x3c')][_0xa757('0x28')]);}_0x40e0df['order']=qs[_0xa757('0x44')](_0x49e774[_0xa757('0x3c')][_0xa757('0x44')]);_0x40e0df['where']=qs[_0xa757('0x54')](_[_0xa757('0x46')](_0x49e774['query'],_0x54f4ca[_0xa757('0x54')]));_0x40e0df['where'][_0xa757('0x63')]=_0x59ff48['id'];if(_0x49e774['query'][_0xa757('0x4c')]){_0x40e0df[_0xa757('0x45')]=_[_0xa757('0x47')](_0x40e0df['where'],{'$or':_[_0xa757('0x48')](_0x40e0df[_0xa757('0x40')],function(_0x28a72a){var _0x11a10a={};_0x11a10a[_0x28a72a]={'$like':'%'+_0x49e774[_0xa757('0x3c')]['filter']+'%'};return _0x11a10a;})});}_0x40e0df=_[_0xa757('0x47')]({},_0x40e0df,_0x49e774[_0xa757('0x4d')]);return db[_0xa757('0xac')][_0xa757('0x4e')]({'where':_0x40e0df[_0xa757('0x45')]})[_0xa757('0x2f')](function(_0x5b96ff){_0x4152da[_0xa757('0x4e')]=_0x5b96ff;if(_0x49e774[_0xa757('0x3c')][_0xa757('0x64')]){_0x40e0df[_0xa757('0x4f')]=[{'model':db[_0xa757('0x88')],'as':_0xa757('0xdd'),'required':![]},{'model':db[_0xa757('0xba')],'as':'Owner','attributes':[_0xa757('0x34'),'fullname','internal'],'required':![]},{'model':db[_0xa757('0xde')],'as':_0xa757('0xdf'),'attributes':['id',_0xa757('0x34'),'color'],'where':_0x49e774[_0xa757('0x3c')]['tag']?{'id':_0x49e774[_0xa757('0x3c')][_0xa757('0xe0')]}:undefined,'required':_0x49e774['query'][_0xa757('0xe0')]?!![]:![]}];}return db['ChatInteraction'][_0xa757('0x50')](_0x40e0df);})[_0xa757('0x2f')](function(_0x336cd1){_0x4152da[_0xa757('0x51')]=_0x336cd1;return _0x4152da;});}})[_0xa757('0x2f')](respondWithFilteredResult(_0x48cf01,_0x40e0df))[_0xa757('0x24')](handleError(_0x48cf01,null));};function iftimePromise(_0x998939,_0x243640){return respondWithRpcPromise(_0xa757('0xe1'),_0xa757('0xe2'),{'command':_0x243640[_0xa757('0xe3')]?util['format'](_0xa757('0xe4'),_0x998939[_0xa757('0xe5')],_0x243640[_0xa757('0xe3')]):util[_0xa757('0xa4')](_0xa757('0xe6'),_0x998939[_0xa757('0xe5')])},client9002)[_0xa757('0x2f')](function(_0x2b8680){var _0x571abe=_0x2b8680&&_0x2b8680[_0xa757('0xe7')]('true')>=0x0?!![]:![];logger[_0xa757('0x1b')](_0xa757('0xe8'),_0x243640['id'],_0x998939['id'],_0x998939[_0xa757('0xe5')],_0x571abe?_0xa757('0xe9'):_0xa757('0xea'),_0x243640['timezone']?_0x243640[_0xa757('0xe3')]:_0xa757('0xeb'));return _0x571abe;})[_0xa757('0x24')](function(_0x507af2){logger[_0xa757('0x20')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x243640['id'],_0x998939['id'],_0x998939['interval'],util[_0xa757('0xec')](_0x507af2,{'showHidden':![],'depth':null}),_0x243640[_0xa757('0xe3')]?_0x243640[_0xa757('0xe3')]:_0xa757('0xeb'));return![];});}exports['getSnippet']=function(_0x3630ad,_0xdc5215,_0x41c5ec){var _0xa1bd24=0x0;var _0x367a3c=0x0;var _0x4e4067=![];var _0x535599;var _0x4e3fa6;return db['ChatWebsite'][_0xa757('0x55')]({'where':{'id':_0x3630ad['params']['id']},'include':[{'model':db[_0xa757('0xed')],'as':_0xa757('0xed'),'include':[{'model':db[_0xa757('0xed')],'as':_0xa757('0xee'),'attributes':['id',_0xa757('0xe5')],'raw':!![]}]}]})[_0xa757('0x2f')](handleEntityNotFound(_0xdc5215,null))[_0xa757('0x2f')](function(_0x3c32e2){if(_0x3c32e2){_0x535599=_0x3c32e2;return _0x3c32e2[_0xa757('0xef')]({'raw':!![]});}})[_0xa757('0x2f')](function(_0xa2a8d0){if(_0x535599){if(_0xa2a8d0){_0x4e3fa6=_0xa2a8d0;}}return require(_0xa757('0x75'))[_0xa757('0x76')]();})[_0xa757('0x2f')](function(_0x62d6d0){if(_0x62d6d0){_0x367a3c=_0x62d6d0[_0xa757('0xf0')];_0x4e4067=_0x62d6d0[_0xa757('0x77')];}})[_0xa757('0x2f')](function(){return db[_0xa757('0xac')][_0xa757('0x4e')]({'where':{'closed':![]}});})[_0xa757('0x2f')](function(_0x1c5163){_0xa1bd24=_0x1c5163;if(_0x367a3c&&_0x1c5163>_0x367a3c){return db[_0xa757('0xf1')][_0xa757('0x60')]({'where':{'id':0x1}})[_0xa757('0x2f')](function(_0x1f0f82){if(_0x1f0f82){_0x1f0f82[_0xa757('0xf2')](_0xa757('0xf3'));}});}})['then'](function(){if(_0x535599[_0xa757('0xed')]&&_0x535599[_0xa757('0xed')][_0xa757('0xee')]){var _0x27880f=[];for(var _0x4cd02d=0x0;_0x4cd02d<_0x535599[_0xa757('0xed')][_0xa757('0xee')][_0xa757('0x41')];_0x4cd02d++){var _0x1f2420=_0x535599[_0xa757('0xed')][_0xa757('0xee')][_0x4cd02d][_0xa757('0x31')]({'plain':!![]});_0x27880f[_0xa757('0xb3')](iftimePromise(_0x1f2420,_0x535599));}return BPromise[_0xa757('0xf4')](_0x27880f)[_0xa757('0x2f')](function(_0x43923c){return _[_0xa757('0xf5')](_0x43923c);});}else{return!![];}})[_0xa757('0x2f')](function(_0x211d2d){var _0x597b76=fs[_0xa757('0xc7')](path[_0xa757('0x73')](config['root'],_0xa757('0xf6')),_0xa757('0xc9'));var _0x103b0f={'remote':_0x535599[_0xa757('0xf7')],'query':querystring['stringify'](_[_0xa757('0x47')](_0x535599[_0xa757('0x31')]({'plain':!![]}),{'customerIp':_0x3630ad[_0xa757('0xf8')][_0xa757('0xf9')]||_0x3630ad[_0xa757('0xf8')][_0xa757('0xfa')]||_0x3630ad[_0xa757('0xfb')][_0xa757('0xfc')]||_0x3630ad['ip'],'referer':_0x3630ad[_0xa757('0xf8')][_0xa757('0xfd')],'openedInteractions':_0xa1bd24,'maxInteractions':_0x367a3c,'virtual':_0x4e4067[_0xa757('0xf0')],'online':_0x211d2d,'custom':_0x4e4067}))['replace'](/'/g,'\x5c\x27')};_0xdc5215['send'](ejs['render'](Mustache[_0xa757('0xca')](_0x597b76,_0x103b0f),{'proactiveActions':_0x4e3fa6,'alignment':_0x535599[_0xa757('0xfe')],'verticalAlignment':_0x535599[_0xa757('0xff')]}));})[_0xa757('0x24')](handleError(_0xdc5215,null));};exports[_0xa757('0x100')]=function(_0x269c15,_0x1e1866,_0x369976){return db[_0xa757('0x39')][_0xa757('0x60')]({'where':{'id':_0x269c15[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x1e1866,null))[_0xa757('0x2f')](function(_0x7af4cd){if(_0x7af4cd){return db[_0xa757('0x101')][_0xa757('0x102')](function(_0x45d722){return db[_0xa757('0x98')][_0xa757('0x30')]({'where':{'ChatWebsiteId':_0x269c15[_0xa757('0x53')]['id']},'transaction':_0x45d722})[_0xa757('0x2f')](function(_0x41ace9){var _0x195712=_[_0xa757('0x48')](_0x269c15[_0xa757('0x57')],function(_0x49f07c){_0x49f07c[_0xa757('0x63')]=_0x269c15[_0xa757('0x53')]['id'];return _0x49f07c;});return db[_0xa757('0x98')][_0xa757('0x103')](_0x195712,{'transaction':_0x45d722});});})['then'](function(){return db[_0xa757('0x98')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x269c15[_0xa757('0x53')]['id']},'order':_0xa757('0x9d')});});}})[_0xa757('0x2f')](respondWithResult(_0x1e1866,null))['catch'](handleError(_0x1e1866,null));};exports[_0xa757('0x104')]=function(_0x49c0bd,_0x4f92ee,_0x411c88){var _0x38f40b={};var _0x5bab76={};var _0x1e2b34;var _0x230057;return db[_0xa757('0x39')][_0xa757('0x60')]({'where':{'id':_0x49c0bd[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x4f92ee,null))[_0xa757('0x2f')](function(_0x3ef371){if(_0x3ef371){_0x1e2b34=_0x3ef371;_0x5bab76[_0xa757('0x3b')]=_[_0xa757('0x3d')](db[_0xa757('0x98')][_0xa757('0x3a')]);_0x5bab76[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x49c0bd[_0xa757('0x3c')]);_0x5bab76[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x5bab76[_0xa757('0x3b')],_0x5bab76[_0xa757('0x3c')]);_0x38f40b['attributes']=_['intersection'](_0x5bab76[_0xa757('0x3b')],qs[_0xa757('0x3f')](_0x49c0bd[_0xa757('0x3c')][_0xa757('0x3f')]));_0x38f40b[_0xa757('0x40')]=_0x38f40b[_0xa757('0x40')][_0xa757('0x41')]?_0x38f40b['attributes']:_0x5bab76[_0xa757('0x3b')];_0x38f40b[_0xa757('0x43')]=qs[_0xa757('0x44')](_0x49c0bd[_0xa757('0x3c')][_0xa757('0x44')]);_0x38f40b['where']=qs[_0xa757('0x54')](_['pick'](_0x49c0bd[_0xa757('0x3c')],_0x5bab76['filters']));if(_0x49c0bd[_0xa757('0x3c')][_0xa757('0x4c')]){_0x38f40b['where']=_['merge'](_0x38f40b[_0xa757('0x45')],{'$or':_[_0xa757('0x48')](_0x38f40b['attributes'],function(_0x7c4778){var _0xe21512={};_0xe21512[_0x7c4778]={'$like':'%'+_0x49c0bd[_0xa757('0x3c')][_0xa757('0x4c')]+'%'};return _0xe21512;})});}_0x38f40b=_[_0xa757('0x47')]({},_0x38f40b,_0x49c0bd[_0xa757('0x4d')]);return _0x1e2b34['getApplications'](_0x38f40b);}})[_0xa757('0x2f')](function(_0x25f59a){if(_0x25f59a){_0x230057=_0x25f59a[_0xa757('0x41')];if(!_0x49c0bd[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x38f40b[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x49c0bd[_0xa757('0x3c')][_0xa757('0x42')]);_0x38f40b[_0xa757('0x28')]=qs[_0xa757('0x28')](_0x49c0bd['query'][_0xa757('0x28')]);}return _0x1e2b34[_0xa757('0x104')](_0x38f40b);}})[_0xa757('0x2f')](function(_0x3afa4b){if(_0x3afa4b){return _0x3afa4b?{'count':_0x230057,'rows':_0x3afa4b}:null;}})['then'](respondWithResult(_0x4f92ee,null))[_0xa757('0x24')](handleError(_0x4f92ee,null));};exports[_0xa757('0x105')]=function(_0x2903b7,_0x141d20,_0x3a53da){return db['chatProactiveAction'][_0xa757('0x55')]({'where':{'id':_0x2903b7[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x141d20,null))[_0xa757('0x2f')](function(_0x46d1b2){if(_0x46d1b2){return _0x46d1b2[_0xa757('0x105')](_0x2903b7[_0xa757('0x57')][_0xa757('0x66')],_[_0xa757('0xdc')](_0x2903b7['body'],[_0xa757('0x66'),'id'])||{});}})['then'](respondWithResult(_0x141d20,null))[_0xa757('0x24')](handleError(_0x141d20,null));};exports['getProactiveActions']=function(_0x35fe4e,_0x418eeb,_0xc25de1){var _0x327415={};var _0x5b60fe={};var _0xb76114;var _0x53eb8e;return db[_0xa757('0x39')][_0xa757('0x60')]({'where':{'id':_0x35fe4e[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x418eeb,null))[_0xa757('0x2f')](function(_0x3a1ddc){if(_0x3a1ddc){_0xb76114=_0x3a1ddc;_0x5b60fe[_0xa757('0x3b')]=_[_0xa757('0x3d')](db[_0xa757('0x106')][_0xa757('0x3a')]);_0x5b60fe[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x35fe4e[_0xa757('0x3c')]);_0x5b60fe[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x5b60fe[_0xa757('0x3b')],_0x5b60fe[_0xa757('0x3c')]);_0x327415[_0xa757('0x40')]=_[_0xa757('0x3e')](_0x5b60fe[_0xa757('0x3b')],qs[_0xa757('0x3f')](_0x35fe4e['query'][_0xa757('0x3f')]));_0x327415[_0xa757('0x40')]=_0x327415[_0xa757('0x40')][_0xa757('0x41')]?_0x327415[_0xa757('0x40')]:_0x5b60fe[_0xa757('0x3b')];_0x327415[_0xa757('0x43')]=qs[_0xa757('0x44')](_0x35fe4e[_0xa757('0x3c')][_0xa757('0x44')]);_0x327415['where']=qs['filters'](_[_0xa757('0x46')](_0x35fe4e[_0xa757('0x3c')],_0x5b60fe[_0xa757('0x54')]));if(_0x35fe4e[_0xa757('0x3c')][_0xa757('0x4c')]){_0x327415['where']=_[_0xa757('0x47')](_0x327415[_0xa757('0x45')],{'$or':_[_0xa757('0x48')](_0x327415[_0xa757('0x40')],function(_0x823332){var _0x29cfca={};_0x29cfca[_0x823332]={'$like':'%'+_0x35fe4e[_0xa757('0x3c')]['filter']+'%'};return _0x29cfca;})});}_0x327415=_['merge']({},_0x327415,_0x35fe4e[_0xa757('0x4d')]);return _0xb76114[_0xa757('0xef')](_0x327415);}})['then'](function(_0x5e9161){if(_0x5e9161){_0x53eb8e=_0x5e9161['length'];if(!_0x35fe4e[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x327415[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x35fe4e[_0xa757('0x3c')]['limit']);_0x327415[_0xa757('0x28')]=qs['offset'](_0x35fe4e[_0xa757('0x3c')][_0xa757('0x28')]);}return _0xb76114[_0xa757('0xef')](_0x327415);}})['then'](function(_0x34cd11){if(_0x34cd11){return _0x34cd11?{'count':_0x53eb8e,'rows':_0x34cd11}:null;}})[_0xa757('0x2f')](respondWithResult(_0x418eeb,null))[_0xa757('0x24')](handleError(_0x418eeb,null));};exports[_0xa757('0x107')]=function(_0x40fb82,_0x143a79,_0x848c98){var _0x5da427=_0x40fb82[_0xa757('0x3c')][_0xa757('0x108')]===_0xa757('0x109')?_0xa757('0x10a'):_0xa757('0x10b');return db[_0xa757('0x39')]['find']({'attributes':['id',_0x5da427],'where':{'id':_0x40fb82[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x143a79,null))[_0xa757('0x2f')](function(_0x2e8eb6){if(_0x2e8eb6){var _0x3e454d=_0x2e8eb6[_0x5da427];var _0x265365=_0x3e454d&&_0x3e454d[_0xa757('0x10c')]?_0x3e454d[_0xa757('0x10c')]:[];_0x143a79[_0xa757('0x35')]({'fromKey':_[_0xa757('0x81')](_0x3e454d[_0xa757('0x10d')])?undefined:_0x3e454d['fromKey'],'count':_0x265365[_0xa757('0x41')],'rows':_0x265365});}})[_0xa757('0x24')](handleError(_0x143a79,null));};exports['getOfflineMessages']=function(_0xa201d5,_0x361e67,_0x553682){var _0x595ef5={'raw':!![],'where':{}};var _0x4a949b={};var _0x1da1d4={'count':0x0,'rows':[]};return db[_0xa757('0x39')][_0xa757('0x60')]({'where':{'id':_0xa201d5[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x361e67,null))['then'](function(_0x41721d){if(_0x41721d){_0x4a949b[_0xa757('0x3b')]=_['keys'](db[_0xa757('0xcd')][_0xa757('0x3a')]);_0x4a949b['query']=_['keys'](_0xa201d5['query']);_0x4a949b[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x4a949b['model'],_0x4a949b[_0xa757('0x3c')]);_0x595ef5['attributes']=_[_0xa757('0x3e')](_0x4a949b[_0xa757('0x3b')],qs['fields'](_0xa201d5['query'][_0xa757('0x3f')]));_0x595ef5[_0xa757('0x40')]=_0x595ef5[_0xa757('0x40')][_0xa757('0x41')]?_0x595ef5[_0xa757('0x40')]:_0x4a949b[_0xa757('0x3b')];if(!_0xa201d5['query'][_0xa757('0x61')](_0xa757('0x62'))){_0x595ef5['limit']=qs['limit'](_0xa201d5[_0xa757('0x3c')][_0xa757('0x42')]);_0x595ef5['offset']=qs['offset'](_0xa201d5['query'][_0xa757('0x28')]);}_0x595ef5[_0xa757('0x43')]=qs[_0xa757('0x44')](_0xa201d5[_0xa757('0x3c')][_0xa757('0x44')]);_0x595ef5[_0xa757('0x45')]=qs[_0xa757('0x54')](_[_0xa757('0x46')](_0xa201d5['query'],_0x4a949b['filters']));_0x595ef5[_0xa757('0x45')][_0xa757('0x63')]=_0x41721d['id'];if(_0xa201d5['query'][_0xa757('0x4c')]){_0x595ef5[_0xa757('0x45')]=_[_0xa757('0x47')](_0x595ef5[_0xa757('0x45')],{'$or':_[_0xa757('0x48')](_0x595ef5[_0xa757('0x40')],function(_0x41c254){var _0x26957f={};_0x26957f[_0x41c254]={'$like':'%'+_0xa201d5[_0xa757('0x3c')][_0xa757('0x4c')]+'%'};return _0x26957f;})});}_0x595ef5=_[_0xa757('0x47')]({},_0x595ef5,_0xa201d5['options']);return db[_0xa757('0xcd')][_0xa757('0x4e')]({'where':_0x595ef5[_0xa757('0x45')]})['then'](function(_0x3e50e4){_0x1da1d4[_0xa757('0x4e')]=_0x3e50e4;if(_0xa201d5[_0xa757('0x3c')][_0xa757('0x64')]){_0x595ef5[_0xa757('0x4f')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xa757('0x50')](_0x595ef5);})[_0xa757('0x2f')](function(_0x451f46){_0x1da1d4[_0xa757('0x51')]=_0x451f46;return _0x1da1d4;});}})[_0xa757('0x2f')](respondWithFilteredResult(_0x361e67,_0x595ef5))[_0xa757('0x24')](handleError(_0x361e67,null));};exports['addAgents']=function(_0x39d99d,_0x3851cd,_0x2e51f2){return db[_0xa757('0x39')]['find']({'where':{'id':_0x39d99d[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x3851cd,null))[_0xa757('0x2f')](function(_0x58f8b2){if(_0x58f8b2){return _0x58f8b2['addAgents'](_0x39d99d[_0xa757('0x57')][_0xa757('0x66')],_['omit'](_0x39d99d['body'],[_0xa757('0x66'),'id'])||{})[_0xa757('0xae')](function(_0x3b76e7){for(var _0x473883=0x0;_0x473883<_0x39d99d['body'][_0xa757('0x66')][_0xa757('0x41')];_0x473883+=0x1){socket[_0xa757('0x10e')](_0xa757('0x10f'),{'UserId':_0x39d99d['body'][_0xa757('0x66')][_0x473883],'ChatWebsiteId':_0x39d99d[_0xa757('0x53')]['id']});}return _0x3b76e7;});}})[_0xa757('0x2f')](respondWithResult(_0x3851cd,null))[_0xa757('0x24')](handleError(_0x3851cd,null));};exports[_0xa757('0x110')]=function(_0x1fd749,_0x84bd95,_0x204c28){var _0x31430c;return db[_0xa757('0x39')][_0xa757('0x55')]({'where':{'id':_0x1fd749[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x84bd95,null))[_0xa757('0x2f')](function(_0xd559ce){if(_0xd559ce){return _0xd559ce[_0xa757('0x110')](_0x1fd749['query'][_0xa757('0x66')])[_0xa757('0x2f')](function(_0x4f2c2a){if(_[_0xa757('0x111')](_0x1fd749[_0xa757('0x3c')][_0xa757('0x66')])){for(var _0xa99a59=0x0;_0xa99a59<_0x1fd749['query'][_0xa757('0x66')][_0xa757('0x41')];_0xa99a59+=0x1){socket['emit'](_0xa757('0x112'),{'UserId':_0x1fd749[_0xa757('0x3c')][_0xa757('0x66')][_0xa99a59],'ChatWebsiteId':_0x1fd749[_0xa757('0x53')]['id']});}}else{socket['emit'](_0xa757('0x112'),{'UserId':_0x1fd749[_0xa757('0x3c')][_0xa757('0x66')],'ChatWebsiteId':_0x1fd749['params']['id']});}});}})['then'](respondWithStatusCode(_0x84bd95,null))[_0xa757('0x24')](handleError(_0x84bd95,null));};exports[_0xa757('0x113')]=function(_0x7cf039,_0x5df3a1,_0x3949b5){var _0x3de026={};var _0x39b61a={};var _0x510698;var _0xef0cf9;return db['ChatWebsite'][_0xa757('0x60')]({'where':{'id':_0x7cf039[_0xa757('0x53')]['id']}})[_0xa757('0x2f')](handleEntityNotFound(_0x5df3a1,null))[_0xa757('0x2f')](function(_0x153898){if(_0x153898){_0x510698=_0x153898;_0x39b61a['model']=_[_0xa757('0x3d')](db[_0xa757('0xba')]['rawAttributes']);_0x39b61a[_0xa757('0x3c')]=_[_0xa757('0x3d')](_0x7cf039[_0xa757('0x3c')]);_0x39b61a[_0xa757('0x54')]=_[_0xa757('0x3e')](_0x39b61a[_0xa757('0x3b')],_0x39b61a[_0xa757('0x3c')]);_0x3de026[_0xa757('0x40')]=_[_0xa757('0x3e')](_0x39b61a['model'],qs[_0xa757('0x3f')](_0x7cf039['query'][_0xa757('0x3f')]));_0x3de026['attributes']=_0x3de026[_0xa757('0x40')][_0xa757('0x41')]?_0x3de026[_0xa757('0x40')]:_0x39b61a[_0xa757('0x3b')];_0x3de026['order']=qs[_0xa757('0x44')](_0x7cf039[_0xa757('0x3c')][_0xa757('0x44')]);_0x3de026[_0xa757('0x45')]=qs[_0xa757('0x54')](_[_0xa757('0x46')](_0x7cf039[_0xa757('0x3c')],_0x39b61a['filters']));if(_0x7cf039[_0xa757('0x3c')][_0xa757('0x4c')]){_0x3de026[_0xa757('0x45')]=_[_0xa757('0x47')](_0x3de026[_0xa757('0x45')],{'$or':_['map'](_0x3de026[_0xa757('0x40')],function(_0xd0a33e){var _0x195b99={};_0x195b99[_0xd0a33e]={'$like':'%'+_0x7cf039[_0xa757('0x3c')][_0xa757('0x4c')]+'%'};return _0x195b99;})});}_0x3de026=_[_0xa757('0x47')]({},_0x3de026,_0x7cf039[_0xa757('0x4d')]);return _0x510698['getAgents'](_0x3de026);}})[_0xa757('0x2f')](function(_0xd2538c){if(_0xd2538c){_0xef0cf9=_0xd2538c[_0xa757('0x41')];if(!_0x7cf039[_0xa757('0x3c')][_0xa757('0x61')](_0xa757('0x62'))){_0x3de026[_0xa757('0x42')]=qs[_0xa757('0x42')](_0x7cf039['query'][_0xa757('0x42')]);_0x3de026[_0xa757('0x28')]=qs[_0xa757('0x28')](_0x7cf039['query']['offset']);}return _0x510698[_0xa757('0x113')](_0x3de026);}})[_0xa757('0x2f')](function(_0x26e01c){if(_0x26e01c){return _0x26e01c?{'count':_0xef0cf9,'rows':_0x26e01c}:null;}})[_0xa757('0x2f')](respondWithResult(_0x5df3a1,null))[_0xa757('0x24')](handleError(_0x5df3a1,null));}; \ No newline at end of file +var _0xe706=['custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','ChatApplication','List','applications','Applications','list','orderBy','priority','asc','account','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','License','chatLicenseExceeded','Intervals','push','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','http','client','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','get','ChatWebsites','end','stack','name','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','Pause','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util'];(function(_0x154b31,_0x2d12bc){var _0x1183d8=function(_0x5c9e27){while(--_0x5c9e27){_0x154b31['push'](_0x154b31['shift']());}};_0x1183d8(++_0x2d12bc);}(_0xe706,0xa3));var _0x6e70=function(_0x5c6046,_0x25dcd8){_0x5c6046=_0x5c6046-0x0;var _0x4c462d=_0xe706[_0x5c6046];return _0x4c462d;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var authService=require(_0x6e70('0x14'));var hardwareService=require(_0x6e70('0x15'));var Redis=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];config[_0x6e70('0x1b')]=_[_0x6e70('0x1c')](config[_0x6e70('0x1b')],{'host':_0x6e70('0x1d'),'port':0x18eb});var socket=require(_0x6e70('0x1e'))(new Redis(config[_0x6e70('0x1b')]));require(_0x6e70('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6e70('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x6e70('0x21')][_0x6e70('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x5d9263,_0x24f3ac,_0x5c3fe7,_0x2efc0f){return new BPromise(function(_0x161f23,_0x4ca554){var _0x49029f=_0x2efc0f||client;return _0x49029f[_0x6e70('0x22')](_0x5d9263,_0x5c3fe7)['then'](function(_0x28a21f){logger[_0x6e70('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');logger[_0x6e70('0x24')](_0x6e70('0x25'),_0x24f3ac,_0x6e70('0x26'),JSON[_0x6e70('0x27')](_0x28a21f));if(_0x28a21f[_0x6e70('0x28')]){if(_0x28a21f[_0x6e70('0x28')][_0x6e70('0x29')]===0x1f4){logger[_0x6e70('0x28')](_0x6e70('0x2a'),_0x24f3ac,_0x28a21f[_0x6e70('0x28')]['message']);return _0x4ca554(_0x28a21f[_0x6e70('0x28')][_0x6e70('0x2b')]);}logger[_0x6e70('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,_0x28a21f[_0x6e70('0x28')][_0x6e70('0x2b')]);return _0x161f23(_0x28a21f[_0x6e70('0x28')]['message']);}else{logger[_0x6e70('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x24f3ac,'request\x20sent');_0x161f23(_0x28a21f['result'][_0x6e70('0x2b')]);}})[_0x6e70('0x2c')](function(_0x51d292){logger[_0x6e70('0x28')](_0x6e70('0x2a'),_0x24f3ac,_0x51d292);_0x4ca554(_0x51d292);});});}function respondWithStatusCode(_0x5f268f,_0x338ad6){_0x338ad6=_0x338ad6||0xcc;return function(_0x67fb43){if(_0x67fb43){return _0x5f268f[_0x6e70('0x2d')](_0x338ad6);}return _0x5f268f['status'](_0x338ad6)['end']();};}function respondWithResult(_0x2c4d37,_0x3af17f){_0x3af17f=_0x3af17f||0xc8;return function(_0x83c836){if(_0x83c836){return _0x2c4d37[_0x6e70('0x2e')](_0x3af17f)[_0x6e70('0x2f')](_0x83c836);}};}function respondWithFilteredResult(_0x5d772a,_0x1952ea){return function(_0x406f29){if(_0x406f29){var _0xecf336=_0x406f29[_0x6e70('0x30')],_0x2864a0=_0x1952ea[_0x6e70('0x31')],_0x396a67=_0x1952ea[_0x6e70('0x31')]+_0x1952ea[_0x6e70('0x32')],_0x20a225;if(_0x396a67>=_0xecf336){_0x396a67=_0xecf336;_0x20a225=0xc8;}else{_0x20a225=0xce;}_0x5d772a['status'](_0x20a225);return _0x5d772a[_0x6e70('0x33')]('Content-Range',_0x2864a0+'-'+_0x396a67+'/'+_0xecf336)[_0x6e70('0x2f')](_0x406f29);}return null;};}function patchUpdates(_0x5a7a2a){return function(_0xdd7cc1){try{jsonpatch[_0x6e70('0x34')](_0xdd7cc1,_0x5a7a2a,!![]);}catch(_0x30fa0b){return BPromise['reject'](_0x30fa0b);}return _0xdd7cc1[_0x6e70('0x35')]();};}function saveUpdates(_0x42b094,_0x5780a1){return function(_0x13d673){if(_0x13d673){return _0x13d673[_0x6e70('0x36')](_0x42b094)['then'](function(_0x10d8f6){return _0x10d8f6;});}return null;};}function removeEntity(_0x3665a1,_0x2d52bd){return function(_0x2723d7){if(_0x2723d7){return _0x2723d7[_0x6e70('0x37')]()[_0x6e70('0x38')](function(){var _0x44b19d=_0x2723d7[_0x6e70('0x39')]({'plain':!![]});var _0xf146fd=_0x6e70('0x3a');return db['UserProfileResource'][_0x6e70('0x37')]({'where':{'type':_0xf146fd,'resourceId':_0x44b19d['id']}})['then'](function(){return _0x2723d7;});})[_0x6e70('0x38')](function(){_0x3665a1[_0x6e70('0x2e')](0xcc)[_0x6e70('0x3b')]();});}};}function handleEntityNotFound(_0x32d12d,_0x233a83){return function(_0x989b80){if(!_0x989b80){_0x32d12d[_0x6e70('0x2d')](0x194);}return _0x989b80;};}function handleError(_0xdd0bee,_0x80bebb){_0x80bebb=_0x80bebb||0x1f4;return function(_0x198dd1){logger[_0x6e70('0x28')](_0x198dd1[_0x6e70('0x3c')]);if(_0x198dd1[_0x6e70('0x3d')]){delete _0x198dd1['name'];}_0xdd0bee['status'](_0x80bebb)['send'](_0x198dd1);};}exports[_0x6e70('0x3e')]=function(_0x3841a0,_0x2cb5b0){var _0x1f6955={'include':[{'model':db['Pause'],'as':_0x6e70('0x3f')}]},_0x1872e9={},_0x3bdd87={'count':0x0,'rows':[]};var _0x9e7ad2=db[_0x6e70('0x40')][_0x6e70('0x41')];_0x1872e9[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x9e7ad2);_0x1872e9[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x3841a0['query']);_0x1872e9[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x1872e9[_0x6e70('0x42')],_0x1872e9[_0x6e70('0x44')]);_0x1f6955[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x1872e9[_0x6e70('0x42')],qs['fields'](_0x3841a0['query']['fields']));_0x1f6955[_0x6e70('0x47')]=_0x1f6955[_0x6e70('0x47')][_0x6e70('0x48')]?_0x1f6955[_0x6e70('0x47')]:_0x1872e9[_0x6e70('0x42')];if(!_0x3841a0['query'][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x1f6955[_0x6e70('0x32')]=qs['limit'](_0x3841a0['query']['limit']);_0x1f6955[_0x6e70('0x31')]=qs['offset'](_0x3841a0[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x1f6955[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x3841a0['query'][_0x6e70('0x4c')]);_0x1f6955['where']=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x3841a0[_0x6e70('0x44')],_0x1872e9[_0x6e70('0x45')]));if(_0x3841a0['query'][_0x6e70('0x4e')]){_0x1f6955[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x1f6955[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x9e7ad2,function(_0x3fcb2d){if(_0x3fcb2d[_0x6e70('0x52')]['key']!==_0x6e70('0x53')){var _0x3884a4={};_0x3884a4[_0x3fcb2d[_0x6e70('0x54')]]={'$like':'%'+_0x3841a0[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x3884a4;}})});}_0x1f6955=_[_0x6e70('0x50')]({},_0x1f6955,_0x3841a0[_0x6e70('0x55')]);var _0x4ab26e={'where':_0x1f6955[_0x6e70('0x4f')]};return db['ChatWebsite'][_0x6e70('0x30')](_0x4ab26e)[_0x6e70('0x38')](function(_0x4b351e){_0x3bdd87['count']=_0x4b351e;if(_0x3841a0[_0x6e70('0x44')][_0x6e70('0x56')]){_0x1f6955[_0x6e70('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1f6955);})[_0x6e70('0x38')](function(_0x11ac3d){_0x3bdd87[_0x6e70('0x58')]=_0x11ac3d;return _0x3bdd87;})[_0x6e70('0x38')](respondWithFilteredResult(_0x2cb5b0,_0x1f6955))[_0x6e70('0x2c')](handleError(_0x2cb5b0,null));};exports[_0x6e70('0x59')]=function(_0x4ad5a9,_0x756a5b){var _0x3aa1a6={'raw':![],'where':{'id':_0x4ad5a9[_0x6e70('0x5a')]['id']},'include':[{'model':db[_0x6e70('0x5b')],'as':'mandatoryDispositionPause'}]},_0x219f4={};_0x219f4['model']=_[_0x6e70('0x43')](db[_0x6e70('0x40')][_0x6e70('0x41')]);_0x219f4[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x4ad5a9['query']);_0x219f4[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x219f4[_0x6e70('0x42')],_0x219f4[_0x6e70('0x44')]);_0x3aa1a6[_0x6e70('0x47')]=_['intersection'](_0x219f4[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x4ad5a9[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x3aa1a6[_0x6e70('0x47')]=_0x3aa1a6[_0x6e70('0x47')]['length']?_0x3aa1a6[_0x6e70('0x47')]:_0x219f4[_0x6e70('0x42')];if(_0x4ad5a9['query'][_0x6e70('0x56')]){_0x3aa1a6[_0x6e70('0x57')]=[{'all':!![]}];}_0x3aa1a6=_['merge']({},_0x3aa1a6,_0x4ad5a9[_0x6e70('0x55')]);return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x3aa1a6)[_0x6e70('0x38')](handleEntityNotFound(_0x756a5b,null))[_0x6e70('0x38')](respondWithResult(_0x756a5b,null))['catch'](handleError(_0x756a5b,null));};exports[_0x6e70('0x5e')]=function(_0x2d1336,_0x10d655){return db[_0x6e70('0x40')][_0x6e70('0x5e')](_0x2d1336[_0x6e70('0x5f')],{})[_0x6e70('0x38')](function(_0x2e2587){var _0x6043cd=_0x2d1336[_0x6e70('0x60')][_0x6e70('0x39')]({'plain':!![]});if(!_0x6043cd)throw new Error(_0x6e70('0x61'));if(_0x6043cd[_0x6e70('0x62')]===_0x6e70('0x60')){var _0x2a9173=_0x2e2587[_0x6e70('0x39')]({'plain':!![]});var _0x324fa6=_0x6e70('0x3a');return db[_0x6e70('0x63')][_0x6e70('0x5d')]({'where':{'name':_0x324fa6,'userProfileId':_0x6043cd['userProfileId']},'raw':!![]})[_0x6e70('0x38')](function(_0x4434dd){if(_0x4434dd&&_0x4434dd[_0x6e70('0x64')]===0x0){return db[_0x6e70('0x65')][_0x6e70('0x5e')]({'name':_0x2a9173[_0x6e70('0x3d')],'resourceId':_0x2a9173['id'],'type':_0x4434dd['name'],'sectionId':_0x4434dd['id']},{})[_0x6e70('0x38')](function(){return _0x2e2587;});}else{return _0x2e2587;}})[_0x6e70('0x2c')](function(_0x4f813a){logger[_0x6e70('0x28')](_0x6e70('0x66'),_0x4f813a);throw _0x4f813a;});}return _0x2e2587;})[_0x6e70('0x38')](respondWithResult(_0x10d655,0xc9))['catch'](handleError(_0x10d655,null));};exports['update']=function(_0x2f9be4,_0xd6bccd){if(_0x2f9be4[_0x6e70('0x5f')]['id']){delete _0x2f9be4[_0x6e70('0x5f')]['id'];}return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x2f9be4[_0x6e70('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x6e70('0x38')](handleEntityNotFound(_0xd6bccd,null))[_0x6e70('0x38')](saveUpdates(_0x2f9be4[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0xd6bccd,null))['catch'](handleError(_0xd6bccd,null));};exports['destroy']=function(_0x2e972b,_0x4e5545){return db['ChatWebsite']['find']({'where':{'id':_0x2e972b[_0x6e70('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e5545,null))[_0x6e70('0x38')](removeEntity(_0x4e5545,null))[_0x6e70('0x2c')](handleError(_0x4e5545,null));};exports[_0x6e70('0x67')]=function(_0x2f3626,_0x64ea5b){return db[_0x6e70('0x40')][_0x6e70('0x67')]()[_0x6e70('0x38')](respondWithResult(_0x64ea5b,null))['catch'](handleError(_0x64ea5b,null));};exports[_0x6e70('0x68')]=function(_0x6a560f,_0x22c836,_0x346c79){if(_0x6a560f[_0x6e70('0x5f')]['id']){delete _0x6a560f['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x6a560f[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x22c836,null))[_0x6e70('0x38')](function(_0x4ed5ad){if(_0x4ed5ad){_0x6a560f['body'][_0x6e70('0x69')]=_0x4ed5ad['id'];return db[_0x6e70('0x6a')][_0x6e70('0x5e')](_0x6a560f[_0x6e70('0x5f')]);}})[_0x6e70('0x38')](respondWithResult(_0x22c836,null))[_0x6e70('0x2c')](handleError(_0x22c836,null));};exports['getDispositions']=function(_0x2d2855,_0x3f5896,_0x30d11b){var _0x82a9a={'raw':![],'where':{}};var _0x515c0c={};var _0xce964b={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2d2855[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3f5896,null))[_0x6e70('0x38')](function(_0xe24ad5){if(_0xe24ad5){_0x515c0c[_0x6e70('0x42')]=_[_0x6e70('0x43')](db['Disposition'][_0x6e70('0x41')]);_0x515c0c[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x2d2855[_0x6e70('0x44')]);_0x515c0c[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x515c0c[_0x6e70('0x42')],_0x515c0c[_0x6e70('0x44')]);_0x82a9a[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x515c0c['model'],qs[_0x6e70('0x5c')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x82a9a['attributes']=_0x82a9a['attributes'][_0x6e70('0x48')]?_0x82a9a[_0x6e70('0x47')]:_0x515c0c[_0x6e70('0x42')];if(!_0x2d2855[_0x6e70('0x44')][_0x6e70('0x49')]('nolimit')){_0x82a9a['limit']=qs[_0x6e70('0x32')](_0x2d2855[_0x6e70('0x44')]['limit']);_0x82a9a[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x82a9a[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x2d2855[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x82a9a[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x2d2855[_0x6e70('0x44')],_0x515c0c[_0x6e70('0x45')]));_0x82a9a[_0x6e70('0x4f')]['ChatWebsiteId']=_0xe24ad5['id'];if(_0x2d2855['query'][_0x6e70('0x4e')]){_0x82a9a['where']=_[_0x6e70('0x50')](_0x82a9a['where'],{'$or':_['map'](_0x82a9a[_0x6e70('0x47')],function(_0x48e04b){var _0x576069={};_0x576069[_0x48e04b]={'$like':'%'+_0x2d2855[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x576069;})});}_0x82a9a=_[_0x6e70('0x50')]({},_0x82a9a,_0x2d2855['options']);return db['Disposition']['count']({'where':_0x82a9a[_0x6e70('0x4f')]})['then'](function(_0x2e8ed3){_0xce964b[_0x6e70('0x30')]=_0x2e8ed3;if(_0x2d2855[_0x6e70('0x44')][_0x6e70('0x56')]){_0x82a9a[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x6a')][_0x6e70('0x6b')](_0x82a9a);})['then'](function(_0x282b02){_0xce964b[_0x6e70('0x58')]=_0x282b02;return _0xce964b;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x3f5896,_0x82a9a))['catch'](handleError(_0x3f5896,null));};exports[_0x6e70('0x6c')]=function(_0x227d94,_0x11a615,_0x267576){var _0x451960;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x227d94[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x11a615,null))['then'](function(_0x463eed){if(_0x463eed){return _0x463eed[_0x6e70('0x6c')](_0x227d94['query'][_0x6e70('0x6d')]);}})[_0x6e70('0x38')](respondWithStatusCode(_0x11a615,null))['catch'](handleError(_0x11a615,null));};exports['addAnswer']=function(_0x4059cf,_0x502e6c,_0x154c8a){if(_0x4059cf['body']['id']){delete _0x4059cf[_0x6e70('0x5f')]['id'];}return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x4059cf[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x502e6c,null))[_0x6e70('0x38')](function(_0x3f985f){if(_0x3f985f){_0x4059cf['body']['ChatWebsiteId']=_0x3f985f['id'];return db[_0x6e70('0x6e')]['create'](_0x4059cf[_0x6e70('0x5f')]);}})[_0x6e70('0x38')](respondWithResult(_0x502e6c,null))[_0x6e70('0x2c')](handleError(_0x502e6c,null));};exports[_0x6e70('0x6f')]=function(_0x4b201f,_0x21fb9a,_0x5c30ce){var _0x260dfa={'raw':![],'where':{}};var _0x18a1be={};var _0x21cd21={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x4b201f[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x21fb9a,null))['then'](function(_0x1d6acf){if(_0x1d6acf){_0x18a1be['model']=_[_0x6e70('0x43')](db['CannedAnswer']['rawAttributes']);_0x18a1be['query']=_[_0x6e70('0x43')](_0x4b201f[_0x6e70('0x44')]);_0x18a1be[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x18a1be[_0x6e70('0x42')],_0x18a1be['query']);_0x260dfa[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x18a1be['model'],qs[_0x6e70('0x5c')](_0x4b201f['query'][_0x6e70('0x5c')]));_0x260dfa['attributes']=_0x260dfa['attributes'][_0x6e70('0x48')]?_0x260dfa[_0x6e70('0x47')]:_0x18a1be[_0x6e70('0x42')];if(!_0x4b201f[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x260dfa[_0x6e70('0x32')]=qs['limit'](_0x4b201f[_0x6e70('0x44')]['limit']);_0x260dfa[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x4b201f[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x260dfa[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x4b201f[_0x6e70('0x44')]['sort']);_0x260dfa[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x4b201f[_0x6e70('0x44')],_0x18a1be[_0x6e70('0x45')]));_0x260dfa[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x1d6acf['id'];if(_0x4b201f[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x260dfa[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x260dfa[_0x6e70('0x4f')],{'$or':_['map'](_0x260dfa[_0x6e70('0x47')],function(_0x411d8f){var _0x31559b={};_0x31559b[_0x411d8f]={'$like':'%'+_0x4b201f[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x31559b;})});}_0x260dfa=_['merge']({},_0x260dfa,_0x4b201f['options']);return db['CannedAnswer'][_0x6e70('0x30')]({'where':_0x260dfa[_0x6e70('0x4f')]})[_0x6e70('0x38')](function(_0x30c5bd){_0x21cd21[_0x6e70('0x30')]=_0x30c5bd;if(_0x4b201f[_0x6e70('0x44')][_0x6e70('0x56')]){_0x260dfa[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x6e')][_0x6e70('0x6b')](_0x260dfa);})[_0x6e70('0x38')](function(_0x400b20){_0x21cd21[_0x6e70('0x58')]=_0x400b20;return _0x21cd21;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x21fb9a,_0x260dfa))[_0x6e70('0x2c')](handleError(_0x21fb9a,null));};exports['removeAnswers']=function(_0x3a038a,_0x223610,_0x6fd098){var _0x156c3c;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x3a038a['params']['id']}})['then'](handleEntityNotFound(_0x223610,null))[_0x6e70('0x38')](function(_0x433c79){if(_0x433c79){return _0x433c79[_0x6e70('0x71')](_0x3a038a[_0x6e70('0x44')][_0x6e70('0x6d')]);}})[_0x6e70('0x38')](respondWithStatusCode(_0x223610,null))[_0x6e70('0x2c')](handleError(_0x223610,null));};exports['addLogo']=function(_0x245123,_0x511830,_0x3296d2){_0x245123[_0x6e70('0x5f')][_0x6e70('0x72')]=_0x245123[_0x6e70('0x73')]['filename'];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x245123['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x511830,null))['then'](saveUpdates(_0x245123[_0x6e70('0x5f')],null))['then'](respondWithResult(_0x511830,null))['catch'](handleError(_0x511830,null));};exports[_0x6e70('0x74')]=function(_0x455f49,_0x3cd4cc,_0x47edfe){_0x455f49[_0x6e70('0x5f')][_0x6e70('0x75')]=_0x455f49['file'][_0x6e70('0x76')];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x455f49[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3cd4cc,null))[_0x6e70('0x38')](saveUpdates(_0x455f49[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0x3cd4cc,null))[_0x6e70('0x2c')](handleError(_0x3cd4cc,null));};exports['addCustomerAvatar']=function(_0x4e7a56,_0xb5e3be,_0x564d55){_0x4e7a56[_0x6e70('0x5f')][_0x6e70('0x77')]=_0x4e7a56['file'][_0x6e70('0x76')];return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x4e7a56['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xb5e3be,null))[_0x6e70('0x38')](saveUpdates(_0x4e7a56[_0x6e70('0x5f')],null))[_0x6e70('0x38')](respondWithResult(_0xb5e3be,null))[_0x6e70('0x2c')](handleError(_0xb5e3be,null));};exports[_0x6e70('0x78')]=function(_0xb80704,_0xffa524,_0xd5b1c6){_0xb80704[_0x6e70('0x5f')][_0x6e70('0x79')]=_0xb80704[_0x6e70('0x73')][_0x6e70('0x76')];return db['ChatWebsite'][_0x6e70('0x5d')]({'where':{'id':_0xb80704[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xffa524,null))[_0x6e70('0x38')](saveUpdates(_0xb80704[_0x6e70('0x5f')],null))['then'](respondWithResult(_0xffa524,null))[_0x6e70('0x2c')](handleError(_0xffa524,null));};exports[_0x6e70('0x7a')]=function(_0x2a5aed,_0x5e5b1f,_0x40a47f){var _0x5f12d3=path['join'](config[_0x6e70('0x7b')],_0x6e70('0x7c'));var _0x324353={'where':{'id':_0x2a5aed[_0x6e70('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x39e14f=![];return require(_0x6e70('0x7d'))['getLicense']()['then'](function(_0x48571f){if(_0x48571f){_0x39e14f=_0x48571f[_0x6e70('0x7e')];}})[_0x6e70('0x38')](function(){return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x324353);})[_0x6e70('0x38')](handleEntityNotFound(_0x5e5b1f,null))[_0x6e70('0x38')](function(_0x40c5c0){if(_0x40c5c0){if(!_['isNil'](_0x40c5c0[_0x6e70('0x72')])){if(fs[_0x6e70('0x7f')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x81'),_0x40c5c0[_0x6e70('0x72')]))&&_0x39e14f){_0x5f12d3=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x81'),_0x40c5c0[_0x6e70('0x72')]);}}return _0x5e5b1f[_0x6e70('0x82')](_0x5f12d3);}})[_0x6e70('0x2c')](handleError(_0x5e5b1f,null));};exports['getAvatar']=function(_0x2a1205,_0x1f1b96,_0x397289){var _0x551c7e=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x83'));var _0x1ff761={'where':{'id':_0x2a1205[_0x6e70('0x5a')]['id']},'attributes':['id',_0x6e70('0x75')],'raw':!![]};return db['ChatWebsite']['find'](_0x1ff761)[_0x6e70('0x38')](handleEntityNotFound(_0x1f1b96,null))[_0x6e70('0x38')](function(_0xc93d60){if(_0xc93d60){if(!_[_0x6e70('0x84')](_0xc93d60[_0x6e70('0x75')])){if(fs[_0x6e70('0x7f')](path['join'](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0xc93d60[_0x6e70('0x75')]))){_0x551c7e=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0xc93d60[_0x6e70('0x75')]);}}return _0x1f1b96[_0x6e70('0x82')](_0x551c7e);}})[_0x6e70('0x2c')](handleError(_0x1f1b96,null));};exports[_0x6e70('0x86')]=function(_0xd2d74f,_0x8b237a,_0x17647f){var _0xd06a34=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x87'));var _0x4ca2f4={'where':{'id':_0xd2d74f['params']['id']},'attributes':['id',_0x6e70('0x77'),_0x6e70('0x88')],'raw':!![]};return db[_0x6e70('0x40')][_0x6e70('0x5d')](_0x4ca2f4)[_0x6e70('0x38')](handleEntityNotFound(_0x8b237a,null))[_0x6e70('0x38')](function(_0x58a004){if(_0x58a004){if(!_[_0x6e70('0x84')](_0x58a004['customerAvatar'])){if(fs[_0x6e70('0x7f')](path['join'](config[_0x6e70('0x7b')],'server/files/images/avatars/',_0x58a004[_0x6e70('0x77')]))&&_0x58a004[_0x6e70('0x88')]){_0xd06a34=path[_0x6e70('0x80')](config['root'],_0x6e70('0x85'),_0x58a004[_0x6e70('0x77')]);}}return _0x8b237a[_0x6e70('0x82')](_0xd06a34);}})[_0x6e70('0x2c')](handleError(_0x8b237a,null));};exports[_0x6e70('0x89')]=function(_0x4028a2,_0x1e8bfd,_0x5002ba){var _0x2e3278=path[_0x6e70('0x80')](config['root'],_0x6e70('0x8a'));var _0x31a586={'where':{'id':_0x4028a2['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x6e70('0x40')]['find'](_0x31a586)[_0x6e70('0x38')](handleEntityNotFound(_0x1e8bfd,null))[_0x6e70('0x38')](function(_0x2695af){if(_0x2695af){if(!_[_0x6e70('0x84')](_0x2695af[_0x6e70('0x79')])){if(fs[_0x6e70('0x7f')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0x2695af[_0x6e70('0x79')]))){_0x2e3278=path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x85'),_0x2695af['systemAvatar']);}}return _0x1e8bfd[_0x6e70('0x82')](_0x2e3278);}})[_0x6e70('0x2c')](handleError(_0x1e8bfd,null));};exports[_0x6e70('0x8b')]=function(_0x472a93,_0x26d3f8,_0x29f2ec){var _0x1cf0d7=require(_0x6e70('0x8c'));var _0x44ebd6=new _0x1cf0d7();var _0x568799=_0x44ebd6[_0x6e70('0x8d')](_0x472a93[_0x6e70('0x8e')][_0x6e70('0x8f')])['getResult']();var _0x88522={'body':_0x472a93[_0x6e70('0x5f')],'channel':_0x6e70('0x90')};var _0x5c98b8=[];var _0x4af0bc=[];var _0x52bacf={};var _0x20ac7e=![];return db['CmContact']['describe']()[_0x6e70('0x38')](function(_0x83d7e3){if(!_0x83d7e3){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x93'));}_0x5c98b8=_[_0x6e70('0x94')](_[_0x6e70('0x43')](_0x83d7e3),[_0x6e70('0x95'),_0x6e70('0x96')]);_0x4af0bc=_[_0x6e70('0x94')](_['keys'](_0x83d7e3),[_0x6e70('0x95'),_0x6e70('0x96'),_0x6e70('0x97'),_0x6e70('0x98')]);if(_0x472a93[_0x6e70('0x5f')]['id']){delete _0x472a93[_0x6e70('0x5f')]['id'];}if(_[_0x6e70('0x84')](_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')])){throw new db[(_0x6e70('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x472a93['body'][_0x6e70('0x5f')])||_0x472a93[_0x6e70('0x5f')][_0x6e70('0x5f')]===''){throw new db['Sequelize'][(_0x6e70('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6e70('0x84')](_0x472a93['body']['mapKey'])){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x9a')+_0x4af0bc);}if(!_[_0x6e70('0x9b')](_0x4af0bc,_0x472a93[_0x6e70('0x5f')][_0x6e70('0x9c')])){throw new db[(_0x6e70('0x91'))]['ValidationError'](_0x6e70('0x9d')+_0x4af0bc);}_0x52bacf[_0x472a93[_0x6e70('0x5f')]['mapKey']]=_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')];})[_0x6e70('0x38')](function(){return db['ChatWebsite'][_0x6e70('0x5d')]({'where':{'id':_0x472a93[_0x6e70('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6e70('0x9e')],'as':_0x6e70('0x9f'),'where':_0x52bacf,'limit':0x1,'order':[[_0x6e70('0x96'),_0x6e70('0xa0')]]}]},{'model':db[_0x6e70('0xa1')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x26d3f8,null))[_0x6e70('0x38')](function(_0x1becb0){if(_0x1becb0&&_0x1becb0[_0x6e70('0xa2')]){_0x88522['account']=_0x1becb0;_0x88522[_0x6e70('0xa3')]=_0x1becb0[_0x6e70('0xa4')];_0x88522[_0x6e70('0xa5')]=_0x1becb0[_0x6e70('0xa2')];_0x88522[_0x6e70('0xa3')]=_[_0x6e70('0xa6')](_0x88522[_0x6e70('0xa3')],[_0x6e70('0xa7')],[_0x6e70('0xa8')]);if(_0x88522[_0x6e70('0xa9')]['Applications']){delete _0x88522[_0x6e70('0xa9')][_0x6e70('0xa4')];}if(_0x88522[_0x6e70('0xa9')][_0x6e70('0xa2')]&&_0x88522['account'][_0x6e70('0xa2')][_0x6e70('0x9f')][_0x6e70('0x48')]){return _0x88522['account'][_0x6e70('0xa2')][_0x6e70('0x9f')][0x0];}var _0x29da89=_[_0x6e70('0x1c')](_0x472a93['body'],{'firstName':_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')],'ListId':_0x1becb0[_0x6e70('0x98')]});_0x29da89[_0x472a93[_0x6e70('0x5f')][_0x6e70('0x9c')]]=_0x472a93[_0x6e70('0x5f')][_0x6e70('0x99')];return db[_0x6e70('0x9e')][_0x6e70('0x5e')](_0x29da89,{'fields':_0x5c98b8,'raw':!![]});}})[_0x6e70('0x38')](handleEntityNotFound(_0x26d3f8,null))['then'](function(_0x53f283){_0x88522[_0x6e70('0xaa')]=_0x53f283;if(_0x53f283){var _0x3dec80={'ContactId':_0x53f283['id'],'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'from':(_0x53f283[_0x6e70('0xab')]||'')+'\x20'+(_0x53f283[_0x6e70('0xac')]||''),'customerIp':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xad')],'referer':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xae')],'browserName':_0x568799[_0x6e70('0xaf')][_0x6e70('0x3d')]&&_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]?util[_0x6e70('0xb1')](_0x6e70('0xb2'),_0x568799['browser'][_0x6e70('0x3d')],_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]):'unknown','browserVersion':_0x568799[_0x6e70('0xaf')][_0x6e70('0xb0')]||_0x6e70('0xb3'),'osName':util[_0x6e70('0xb1')](_0x6e70('0xb2'),_0x568799['os'][_0x6e70('0x3d')],_0x568799['os']['version']),'osVersion':_0x568799['os'][_0x6e70('0xb0')],'deviceModel':_0x568799[_0x6e70('0xb4')]['model']&&_0x568799[_0x6e70('0xb4')][_0x6e70('0xb5')]?util[_0x6e70('0xb1')](_0x6e70('0xb6'),_0x568799[_0x6e70('0xb4')]['model'],_0x568799['device'][_0x6e70('0xb5')],_0x568799['device'][_0x6e70('0x52')]):null,'deviceVendor':_0x568799[_0x6e70('0xb4')][_0x6e70('0xb5')],'deviceType':_0x568799[_0x6e70('0xb4')][_0x6e70('0x52')],'formData':JSON['stringify'](_0x472a93[_0x6e70('0x5f')])};var _0x237949={'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'closed':![]};if(_0x472a93[_0x6e70('0x5f')][_0x6e70('0xb7')]){_0x237949[_0x6e70('0xb7')]=_0x472a93['body']['threadId'];return db[_0x6e70('0xb8')][_0x6e70('0x5d')]({'where':_0x237949})[_0x6e70('0x38')](function(_0x2fdf04){if(_0x2fdf04){return[_0x2fdf04,![]];}_0x3dec80['threadId']=_0x472a93['body'][_0x6e70('0xb7')];_0x3dec80[_0x6e70('0xb9')]=_0x472a93['body'][_0x6e70('0xb9')];return db[_0x6e70('0xb8')][_0x6e70('0x5e')](_0x3dec80)['then'](function(_0xec1de0){return[_0xec1de0,!![]];});});}_0x237949[_0x6e70('0xba')]=_0x53f283['id'];if(_0x472a93['body'][_0x6e70('0xbb')]&&_0x472a93['body'][_0x6e70('0xbb')]['id']){_0x237949['id']=_0x472a93[_0x6e70('0x5f')][_0x6e70('0xbb')]['id'];return db['ChatInteraction'][_0x6e70('0x5d')]({'where':_0x237949})[_0x6e70('0x38')](function(_0x2edb4a){if(_0x2edb4a){return[_0x2edb4a,![]];}return db[_0x6e70('0xb8')][_0x6e70('0x5e')](_0x3dec80)['then'](function(_0x12c458){return[_0x12c458,!![]];});});}return db['ChatInteraction'][_0x6e70('0x5e')](_0x3dec80)[_0x6e70('0x38')](function(_0x4617c9){return[_0x4617c9,!![]];});}})[_0x6e70('0xbc')](function(_0x307dfb,_0x26a56c){if(_0x307dfb){_0x20ac7e=_0x26a56c;if(!_0x26a56c){var _0x171940={'from':(_0x88522[_0x6e70('0xaa')]['firstName']||'')+'\x20'+(_0x88522[_0x6e70('0xaa')]['lastName']||'')};if(_0x472a93[_0x6e70('0x5f')][_0x6e70('0xb7')]&&_0x472a93[_0x6e70('0x5f')][_0x6e70('0xbd')]&&_0x472a93['body'][_0x6e70('0xb7')]!=_0x472a93['body']['messageId']){_0x171940[_0x6e70('0xb7')]=_0x472a93['body'][_0x6e70('0xbd')];}return _0x307dfb[_0x6e70('0x36')](_0x171940);}else{return _0x307dfb;}}})[_0x6e70('0x38')](function(_0x4e53fe){_0x88522['interaction']=_0x4e53fe[_0x6e70('0x39')]({'plain':!![]});_0x88522[_0x6e70('0xbb')][_0x6e70('0xbe')]=_0x20ac7e;if(_0x88522[_0x6e70('0xbb')][_0x6e70('0xbe')]){if(_0x88522[_0x6e70('0xa9')]['autoclose']){_0x88522[_0x6e70('0xa3')]['push']({'id':0x0,'priority':_0x88522['applications']['length']+0x1,'app':_0x6e70('0xbf'),'appdata':_0x6e70('0xc0'),'interval':'*,*,*,*'});}}return db[_0x6e70('0xc1')]['create']({'body':_0x472a93[_0x6e70('0x5f')][_0x6e70('0x5f')],'ChatWebsiteId':_0x472a93[_0x6e70('0x5a')]['id'],'ChatInteractionId':_0x4e53fe['id'],'direction':'in','ContactId':_0x88522[_0x6e70('0xaa')]['id'],'AttachmentId':_0x472a93[_0x6e70('0x5f')][_0x6e70('0xc2')]});})[_0x6e70('0x38')](function(_0x31b91f){_0x88522[_0x6e70('0x2b')]=_0x31b91f;if(_0x88522[_0x6e70('0xbb')][_0x6e70('0xc3')]){return db[_0x6e70('0xc4')]['find']({'attributes':['id','name'],'where':{'id':_0x88522[_0x6e70('0xbb')][_0x6e70('0xc3')]}})[_0x6e70('0x38')](function(_0x2363b6){if(_0x2363b6){_0x88522['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x6e70('0xc5'),'appdata':_0x2363b6[_0x6e70('0x3d')]+','+(_0x88522[_0x6e70('0xa9')][_0x6e70('0xc6')]||0xa),'interval':'*,*,*,*'});_0x88522[_0x6e70('0xc7')]=!![];}return respondWithRpcPromise('Start',_0x6e70('0xc8'),_0x88522);});}return respondWithRpcPromise(_0x6e70('0xc9'),_0x6e70('0xc8'),_0x88522);})[_0x6e70('0x38')](function(_0x3dd34c){respondWithRpcPromise('EventManager',_0x6e70('0xca'),{'event':_0x6e70('0x8b'),'message':_0x3dd34c},client9002);return _0x3dd34c;})[_0x6e70('0x38')](respondWithResult(_0x26d3f8,null))['catch'](handleError(_0x26d3f8,null));};exports[_0x6e70('0xcb')]=function(_0x20a675,_0x2b5529,_0x1cd88f){var _0x1a83ab,_0x330389,_0xb12214;var _0x3071e6=[];var _0x3ec1fe=[];var _0x105b8f={};return db[_0x6e70('0x9e')][_0x6e70('0x67')]()[_0x6e70('0x38')](function(_0xc2cf78){if(!_0xc2cf78){throw new db[(_0x6e70('0x91'))][(_0x6e70('0x92'))](_0x6e70('0x93'));}_0x3ec1fe=_[_0x6e70('0x94')](_[_0x6e70('0x43')](_0xc2cf78),[_0x6e70('0x95'),_0x6e70('0x96')]);_0x3071e6=_['difference'](_[_0x6e70('0x43')](_0xc2cf78),['createdAt','updatedAt','CompanyId','ListId']);if(_0x20a675[_0x6e70('0x5f')]['id']){delete _0x20a675[_0x6e70('0x5f')]['id'];}if(_[_0x6e70('0x84')](_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize'][(_0x6e70('0x92'))](_0x6e70('0xcd')));}if(_['isNil'](_0x20a675['body'][_0x6e70('0x5f')])||_0x20a675[_0x6e70('0x5f')][_0x6e70('0x5f')]===''){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize']['ValidationError'](_0x6e70('0xce')));}if(_[_0x6e70('0x84')](_0x20a675[_0x6e70('0x5f')]['mapKeyOffline'])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db[(_0x6e70('0x91'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3071e6));}if(!_[_0x6e70('0x9b')](_0x3071e6,_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')])){throw _0x2b5529[_0x6e70('0x2e')](0x1f4)[_0x6e70('0xcc')](new db['Sequelize']['ValidationError'](_0x6e70('0xd0')+_0x3071e6));}_0x105b8f[_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')]]=_0x20a675['body'][_0x6e70('0x99')];})[_0x6e70('0x38')](function(){return db[_0x6e70('0x40')]['find']({'where':{'id':_0x20a675[_0x6e70('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x6e70('0xa2')}]});})[_0x6e70('0x38')](handleEntityNotFound(_0x2b5529,null))['then'](function(_0x3b9e5a){if(_0x3b9e5a&&_0x3b9e5a[_0x6e70('0xa2')]){_0x330389=_0x3b9e5a;var _0x55d5d6=_[_0x6e70('0x1c')](_0x20a675[_0x6e70('0x5f')],{'firstName':_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')],'phone':_0x20a675[_0x6e70('0x5f')][_0x6e70('0x99')],'ListId':_0x3b9e5a[_0x6e70('0x98')]});_0x55d5d6[_0x20a675[_0x6e70('0x5f')][_0x6e70('0xcf')]]=_0x20a675[_0x6e70('0x5f')]['from'];return db['CmContact'][_0x6e70('0xd1')]({'where':_0x105b8f,'defaults':_0x55d5d6});}})['spread'](function(_0x32198a){if(_0x32198a){_0xb12214=_0x32198a;var _0x150d10=fs[_0x6e70('0xd2')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0xd3')),_0x6e70('0xd4'));var _0x3a9260=ejs[_0x6e70('0xd5')](_0x150d10,{'body':_['toPairs'](_0x20a675['body']['body']),'bodyTitle':_0x330389[_0x6e70('0xd6')]});return db['ChatOfflineMessage'][_0x6e70('0x5e')]({'body':_0x3a9260,'ContactId':_0x32198a['id'],'ChatWebsiteId':_0x330389['id']});}})[_0x6e70('0x38')](function(_0x1e8e4d){if(_0x1e8e4d){_0x1a83ab=_0x1e8e4d;return db[_0x6e70('0xd7')][_0x6e70('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x6e70('0xd8')],'as':'Smtp','raw':!![]}]});}})[_0x6e70('0x38')](function(_0xfa1678){if(_0xfa1678&&_0xfa1678[_0x6e70('0xd9')]&&_0x330389[_0x6e70('0xda')]){var _0x7bad03={'tls':{'rejectUnauthorized':![]}};if(_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdb')]){_0x7bad03['service']=_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdb')];}else{_0x7bad03['host']=_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdc')];_0x7bad03['port']=_0xfa1678['Smtp'][_0x6e70('0xdd')];_0x7bad03[_0x6e70('0xde')]=_0xfa1678['Smtp'][_0x6e70('0xde')];}if(_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xdf')]){_0x7bad03[_0x6e70('0xe0')]={'user':_0xfa1678[_0x6e70('0xd9')]['user'],'pass':_0xfa1678[_0x6e70('0xd9')][_0x6e70('0xe1')]};}return respondWithRpcPromise('SendMail',_0x6e70('0xe2'),{'account':_0x7bad03,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xfa1678['name'],_0xfa1678[_0x6e70('0xe3')]||_0xfa1678[_0x6e70('0xd9')]['user']),'to':_0x330389[_0x6e70('0xda')],'subject':_0x330389[_0x6e70('0xe4')],'text':_0x1a83ab['body']}},client9003)['then'](function(){return _0x1a83ab;})[_0x6e70('0x2c')](function(_0xc5bf0){console['error'](_0xc5bf0);});}})[_0x6e70('0x38')](function(){if(_0x1a83ab){return _0x1a83ab;}})[_0x6e70('0x38')](respondWithResult(_0x2b5529,null))[_0x6e70('0x2c')](handleError(_0x2b5529,null));};exports[_0x6e70('0xe5')]=function(_0x57d976,_0x183d58,_0x5cb9fb){return db['ChatInteraction']['find']({'where':{'id':_0x57d976[_0x6e70('0x5a')]['id']}})['then'](handleEntityNotFound(_0x183d58,null))[_0x6e70('0x38')](function(_0x8fbbf4){if(_0x8fbbf4){return _0x8fbbf4[_0x6e70('0xe5')](_0x57d976['body']['ids'],_[_0x6e70('0xe6')](_0x57d976['body'],[_0x6e70('0x6d'),'id'])||{});}})[_0x6e70('0x38')](respondWithResult(_0x183d58,null))[_0x6e70('0x2c')](handleError(_0x183d58,null));};exports[_0x6e70('0xe7')]=function(_0x2c5d28,_0x204c3a,_0x3976cf){var _0x526abf={'raw':![],'where':{}};var _0x23c944={};var _0x1346c1={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x2c5d28['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x204c3a,null))[_0x6e70('0x38')](function(_0x3f9000){if(_0x3f9000){_0x23c944['model']=_[_0x6e70('0x43')](db[_0x6e70('0xb8')][_0x6e70('0x41')]);_0x23c944[_0x6e70('0x44')]=_['keys'](_0x2c5d28[_0x6e70('0x44')]);_0x23c944[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x23c944[_0x6e70('0x42')],_0x23c944['query']);_0x526abf[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x23c944[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x526abf[_0x6e70('0x47')]=_0x526abf[_0x6e70('0x47')][_0x6e70('0x48')]?_0x526abf[_0x6e70('0x47')]:_0x23c944[_0x6e70('0x42')];if(!_0x2c5d28[_0x6e70('0x44')]['hasOwnProperty'](_0x6e70('0x4a'))){_0x526abf[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x32')]);_0x526abf['offset']=qs['offset'](_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x31')]);}_0x526abf[_0x6e70('0x4b')]=qs['sort'](_0x2c5d28['query'][_0x6e70('0x4c')]);_0x526abf[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x2c5d28[_0x6e70('0x44')],_0x23c944[_0x6e70('0x45')]));_0x526abf[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x3f9000['id'];if(_0x2c5d28[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x526abf[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x526abf[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x526abf[_0x6e70('0x47')],function(_0x3cbad0){var _0x41d78e={};_0x41d78e[_0x3cbad0]={'$like':'%'+_0x2c5d28['query'][_0x6e70('0x4e')]+'%'};return _0x41d78e;})});}_0x526abf=_[_0x6e70('0x50')]({},_0x526abf,_0x2c5d28['options']);return db[_0x6e70('0xb8')]['count']({'where':_0x526abf[_0x6e70('0x4f')]})['then'](function(_0x7e62f7){_0x1346c1[_0x6e70('0x30')]=_0x7e62f7;if(_0x2c5d28['query'][_0x6e70('0x56')]){_0x526abf['include']=[{'model':db['CmContact'],'as':_0x6e70('0xe8'),'required':![]},{'model':db[_0x6e70('0xc4')],'as':_0x6e70('0xe9'),'attributes':[_0x6e70('0x3d'),_0x6e70('0xea'),_0x6e70('0xeb')],'required':![]},{'model':db[_0x6e70('0xec')],'as':_0x6e70('0xed'),'attributes':['id',_0x6e70('0x3d'),_0x6e70('0xee')],'where':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]?{'id':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]}:undefined,'required':_0x2c5d28[_0x6e70('0x44')][_0x6e70('0xef')]?!![]:![]}];}return db[_0x6e70('0xb8')][_0x6e70('0x6b')](_0x526abf);})[_0x6e70('0x38')](function(_0x5ed63e){_0x1346c1[_0x6e70('0x58')]=_0x5ed63e;return _0x1346c1;});}})['then'](respondWithFilteredResult(_0x204c3a,_0x526abf))[_0x6e70('0x2c')](handleError(_0x204c3a,null));};function iftimePromise(_0x556ee2,_0x28a825){return respondWithRpcPromise(_0x6e70('0xf0'),_0x6e70('0xf1'),{'command':_0x28a825['timezone']?util[_0x6e70('0xb1')](_0x6e70('0xf2'),_0x556ee2[_0x6e70('0xf3')],_0x28a825[_0x6e70('0xf4')]):util[_0x6e70('0xb1')](_0x6e70('0xf5'),_0x556ee2['interval'])},client9002)[_0x6e70('0x38')](function(_0x10c7c3){var _0x41270a=_0x10c7c3&&_0x10c7c3['indexOf']('true')>=0x0?!![]:![];logger[_0x6e70('0x23')](_0x6e70('0xf6'),_0x28a825['id'],_0x556ee2['id'],_0x556ee2[_0x6e70('0xf3')],_0x41270a?_0x6e70('0xf7'):_0x6e70('0xf8'),_0x28a825['timezone']?_0x28a825[_0x6e70('0xf4')]:_0x6e70('0xf9'));return _0x41270a;})[_0x6e70('0x2c')](function(_0x3e883c){logger[_0x6e70('0x28')](_0x6e70('0xf6'),_0x28a825['id'],_0x556ee2['id'],_0x556ee2[_0x6e70('0xf3')],util[_0x6e70('0xfa')](_0x3e883c,{'showHidden':![],'depth':null}),_0x28a825[_0x6e70('0xf4')]?_0x28a825[_0x6e70('0xf4')]:_0x6e70('0xf9'));return![];});}exports[_0x6e70('0xf1')]=function(_0x16fe88,_0x25a891,_0x5f3b6f){var _0x3161a1=0x0;var _0x4a48da=0x0;var _0x395e9a=![];var _0x4cffd5;var _0x206d76;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x16fe88[_0x6e70('0x5a')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6e70('0xfb')],'as':'Intervals','attributes':['id',_0x6e70('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x25a891,null))['then'](function(_0x3666d2){if(_0x3666d2){_0x4cffd5=_0x3666d2;return _0x3666d2[_0x6e70('0xfc')]({'raw':!![]});}})[_0x6e70('0x38')](function(_0x5078a1){if(_0x4cffd5){if(_0x5078a1){_0x206d76=_0x5078a1;}}return require('../../config/license/util')[_0x6e70('0xfd')]();})[_0x6e70('0x38')](function(_0x44c669){if(_0x44c669){_0x4a48da=_0x44c669['virtual'];_0x395e9a=_0x44c669[_0x6e70('0x7e')];}})[_0x6e70('0x38')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x529789){_0x3161a1=_0x529789;if(_0x4a48da&&_0x529789>_0x4a48da){return db[_0x6e70('0xfe')][_0x6e70('0x70')]({'where':{'id':0x1}})[_0x6e70('0x38')](function(_0x438fd7){if(_0x438fd7){_0x438fd7['increment'](_0x6e70('0xff'));}});}})[_0x6e70('0x38')](function(){if(_0x4cffd5[_0x6e70('0xfb')]&&_0x4cffd5['Interval'][_0x6e70('0x100')]){var _0x7e9085=[];for(var _0x309f53=0x0;_0x309f53<_0x4cffd5[_0x6e70('0xfb')][_0x6e70('0x100')][_0x6e70('0x48')];_0x309f53++){var _0xada7ca=_0x4cffd5[_0x6e70('0xfb')]['Intervals'][_0x309f53][_0x6e70('0x39')]({'plain':!![]});_0x7e9085[_0x6e70('0x101')](iftimePromise(_0xada7ca,_0x4cffd5));}return BPromise['all'](_0x7e9085)[_0x6e70('0x38')](function(_0x15a45d){return _[_0x6e70('0x102')](_0x15a45d);});}else{return!![];}})[_0x6e70('0x38')](function(_0x1662b0){var _0x35cda0=fs[_0x6e70('0xd2')](path[_0x6e70('0x80')](config[_0x6e70('0x7b')],_0x6e70('0x103')),_0x6e70('0xd4'));var _0x151ba4={'remote':_0x4cffd5[_0x6e70('0x104')],'query':querystring['stringify'](_[_0x6e70('0x50')](_0x4cffd5[_0x6e70('0x39')]({'plain':!![]}),{'customerIp':_0x16fe88[_0x6e70('0x8e')]['x-forwarded-for']||_0x16fe88[_0x6e70('0x8e')][_0x6e70('0x105')]||_0x16fe88[_0x6e70('0x106')][_0x6e70('0x107')]||_0x16fe88['ip'],'referer':_0x16fe88[_0x6e70('0x8e')][_0x6e70('0xae')],'openedInteractions':_0x3161a1,'maxInteractions':_0x4a48da,'virtual':_0x395e9a[_0x6e70('0x108')],'online':_0x1662b0,'custom':_0x395e9a}))[_0x6e70('0x109')](/'/g,'\x5c\x27')};_0x25a891['send'](ejs[_0x6e70('0xd5')](Mustache[_0x6e70('0xd5')](_0x35cda0,_0x151ba4),{'proactiveActions':_0x206d76,'alignment':_0x4cffd5[_0x6e70('0x10a')],'verticalAlignment':_0x4cffd5[_0x6e70('0x10b')]}));})[_0x6e70('0x2c')](handleError(_0x25a891,null));};exports[_0x6e70('0x10c')]=function(_0x5ae297,_0x1f8272,_0x1b723f){return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x5ae297[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x1f8272,null))[_0x6e70('0x38')](function(_0x1c8cdd){if(_0x1c8cdd){return db[_0x6e70('0x10d')]['transaction'](function(_0x703d37){return db['ChatApplication'][_0x6e70('0x37')]({'where':{'ChatWebsiteId':_0x5ae297[_0x6e70('0x5a')]['id']},'transaction':_0x703d37})[_0x6e70('0x38')](function(_0x372a72){var _0x31477e=_[_0x6e70('0x51')](_0x5ae297['body'],function(_0x263690){_0x263690[_0x6e70('0x69')]=_0x5ae297[_0x6e70('0x5a')]['id'];return _0x263690;});return db['ChatApplication'][_0x6e70('0x10e')](_0x31477e,{'transaction':_0x703d37});});})[_0x6e70('0x38')](function(){return db[_0x6e70('0xa1')][_0x6e70('0x10f')]({'where':{'ChatWebsiteId':_0x5ae297[_0x6e70('0x5a')]['id']},'order':_0x6e70('0xa7')});});}})[_0x6e70('0x38')](respondWithResult(_0x1f8272,null))[_0x6e70('0x2c')](handleError(_0x1f8272,null));};exports['getApplications']=function(_0x46b658,_0x377fc9,_0x4fa024){var _0x15dc7e={};var _0x3c4d3a={};var _0x281fc2;var _0x1a0f36;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x46b658[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x377fc9,null))['then'](function(_0x5bc20d){if(_0x5bc20d){_0x281fc2=_0x5bc20d;_0x3c4d3a[_0x6e70('0x42')]=_['keys'](db[_0x6e70('0xa1')][_0x6e70('0x41')]);_0x3c4d3a[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x46b658['query']);_0x3c4d3a[_0x6e70('0x45')]=_[_0x6e70('0x46')](_0x3c4d3a['model'],_0x3c4d3a[_0x6e70('0x44')]);_0x15dc7e[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x3c4d3a['model'],qs[_0x6e70('0x5c')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x15dc7e[_0x6e70('0x47')]=_0x15dc7e[_0x6e70('0x47')][_0x6e70('0x48')]?_0x15dc7e[_0x6e70('0x47')]:_0x3c4d3a[_0x6e70('0x42')];_0x15dc7e[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x15dc7e[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x46b658['query'],_0x3c4d3a[_0x6e70('0x45')]));if(_0x46b658[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x15dc7e[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x15dc7e[_0x6e70('0x4f')],{'$or':_['map'](_0x15dc7e[_0x6e70('0x47')],function(_0x43f742){var _0x4ce89a={};_0x4ce89a[_0x43f742]={'$like':'%'+_0x46b658['query'][_0x6e70('0x4e')]+'%'};return _0x4ce89a;})});}_0x15dc7e=_[_0x6e70('0x50')]({},_0x15dc7e,_0x46b658[_0x6e70('0x55')]);return _0x281fc2[_0x6e70('0x110')](_0x15dc7e);}})[_0x6e70('0x38')](function(_0x1bff94){if(_0x1bff94){_0x1a0f36=_0x1bff94[_0x6e70('0x48')];if(!_0x46b658['query']['hasOwnProperty'](_0x6e70('0x4a'))){_0x15dc7e[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x32')]);_0x15dc7e['offset']=qs[_0x6e70('0x31')](_0x46b658[_0x6e70('0x44')][_0x6e70('0x31')]);}return _0x281fc2[_0x6e70('0x110')](_0x15dc7e);}})[_0x6e70('0x38')](function(_0x219353){if(_0x219353){return _0x219353?{'count':_0x1a0f36,'rows':_0x219353}:null;}})['then'](respondWithResult(_0x377fc9,null))[_0x6e70('0x2c')](handleError(_0x377fc9,null));};exports[_0x6e70('0x111')]=function(_0x64010,_0xbcaf1,_0x17cf03){return db[_0x6e70('0x112')][_0x6e70('0x5d')]({'where':{'id':_0x64010[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0xbcaf1,null))[_0x6e70('0x38')](function(_0x135231){if(_0x135231){return _0x135231[_0x6e70('0x111')](_0x64010[_0x6e70('0x5f')]['ids'],_[_0x6e70('0xe6')](_0x64010[_0x6e70('0x5f')],[_0x6e70('0x6d'),'id'])||{});}})[_0x6e70('0x38')](respondWithResult(_0xbcaf1,null))[_0x6e70('0x2c')](handleError(_0xbcaf1,null));};exports[_0x6e70('0xfc')]=function(_0x3da91d,_0x2764de,_0x25a840){var _0x28c3a5={};var _0x1b88a9={};var _0x35a444;var _0x57d646;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x3da91d['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x2764de,null))['then'](function(_0x3c52d9){if(_0x3c52d9){_0x35a444=_0x3c52d9;_0x1b88a9[_0x6e70('0x42')]=_[_0x6e70('0x43')](db['ChatProactiveAction']['rawAttributes']);_0x1b88a9[_0x6e70('0x44')]=_['keys'](_0x3da91d[_0x6e70('0x44')]);_0x1b88a9[_0x6e70('0x45')]=_['intersection'](_0x1b88a9['model'],_0x1b88a9[_0x6e70('0x44')]);_0x28c3a5['attributes']=_[_0x6e70('0x46')](_0x1b88a9[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x5c')]));_0x28c3a5[_0x6e70('0x47')]=_0x28c3a5[_0x6e70('0x47')][_0x6e70('0x48')]?_0x28c3a5[_0x6e70('0x47')]:_0x1b88a9['model'];_0x28c3a5[_0x6e70('0x4b')]=qs['sort'](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x28c3a5[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x3da91d[_0x6e70('0x44')],_0x1b88a9[_0x6e70('0x45')]));if(_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x28c3a5['where']=_[_0x6e70('0x50')](_0x28c3a5['where'],{'$or':_[_0x6e70('0x51')](_0x28c3a5[_0x6e70('0x47')],function(_0xa4e543){var _0x23cd8f={};_0x23cd8f[_0xa4e543]={'$like':'%'+_0x3da91d[_0x6e70('0x44')][_0x6e70('0x4e')]+'%'};return _0x23cd8f;})});}_0x28c3a5=_['merge']({},_0x28c3a5,_0x3da91d[_0x6e70('0x55')]);return _0x35a444[_0x6e70('0xfc')](_0x28c3a5);}})[_0x6e70('0x38')](function(_0x39380b){if(_0x39380b){_0x57d646=_0x39380b[_0x6e70('0x48')];if(!_0x3da91d[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x28c3a5['limit']=qs[_0x6e70('0x32')](_0x3da91d[_0x6e70('0x44')][_0x6e70('0x32')]);_0x28c3a5[_0x6e70('0x31')]=qs['offset'](_0x3da91d[_0x6e70('0x44')]['offset']);}return _0x35a444['getProactiveActions'](_0x28c3a5);}})[_0x6e70('0x38')](function(_0x40b556){if(_0x40b556){return _0x40b556?{'count':_0x57d646,'rows':_0x40b556}:null;}})[_0x6e70('0x38')](respondWithResult(_0x2764de,null))[_0x6e70('0x2c')](handleError(_0x2764de,null));};exports['getFields']=function(_0x4fba66,_0x5f2aa6,_0x3d8a55){var _0x3d016e=_0x4fba66['query'][_0x6e70('0x113')]==='false'?_0x6e70('0x114'):_0x6e70('0x115');return db['ChatWebsite'][_0x6e70('0x5d')]({'attributes':['id',_0x3d016e],'where':{'id':_0x4fba66[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x5f2aa6,null))[_0x6e70('0x38')](function(_0x49d5f8){if(_0x49d5f8){var _0x463448=_0x49d5f8[_0x3d016e];var _0x373f7c=_0x463448&&_0x463448[_0x6e70('0x116')]?_0x463448[_0x6e70('0x116')]:[];_0x5f2aa6['send']({'fromKey':_[_0x6e70('0x84')](_0x463448['fromKey'])?undefined:_0x463448[_0x6e70('0x117')],'count':_0x373f7c[_0x6e70('0x48')],'rows':_0x373f7c});}})[_0x6e70('0x2c')](handleError(_0x5f2aa6,null));};exports[_0x6e70('0x118')]=function(_0x226e26,_0x24f203,_0x172d6c){var _0x11ad05={'raw':!![],'where':{}};var _0x3e0204={};var _0x2386bb={'count':0x0,'rows':[]};return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x226e26[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x24f203,null))[_0x6e70('0x38')](function(_0x5bb918){if(_0x5bb918){_0x3e0204['model']=_[_0x6e70('0x43')](db[_0x6e70('0x119')][_0x6e70('0x41')]);_0x3e0204['query']=_[_0x6e70('0x43')](_0x226e26[_0x6e70('0x44')]);_0x3e0204['filters']=_['intersection'](_0x3e0204[_0x6e70('0x42')],_0x3e0204[_0x6e70('0x44')]);_0x11ad05[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x3e0204[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x226e26[_0x6e70('0x44')]['fields']));_0x11ad05[_0x6e70('0x47')]=_0x11ad05[_0x6e70('0x47')][_0x6e70('0x48')]?_0x11ad05[_0x6e70('0x47')]:_0x3e0204['model'];if(!_0x226e26[_0x6e70('0x44')][_0x6e70('0x49')](_0x6e70('0x4a'))){_0x11ad05[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x226e26[_0x6e70('0x44')][_0x6e70('0x32')]);_0x11ad05[_0x6e70('0x31')]=qs[_0x6e70('0x31')](_0x226e26[_0x6e70('0x44')]['offset']);}_0x11ad05[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x226e26[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x11ad05[_0x6e70('0x4f')]=qs[_0x6e70('0x45')](_[_0x6e70('0x4d')](_0x226e26[_0x6e70('0x44')],_0x3e0204[_0x6e70('0x45')]));_0x11ad05[_0x6e70('0x4f')][_0x6e70('0x69')]=_0x5bb918['id'];if(_0x226e26[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x11ad05[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x11ad05[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x11ad05[_0x6e70('0x47')],function(_0x4498bc){var _0x1d7f68={};_0x1d7f68[_0x4498bc]={'$like':'%'+_0x226e26[_0x6e70('0x44')]['filter']+'%'};return _0x1d7f68;})});}_0x11ad05=_[_0x6e70('0x50')]({},_0x11ad05,_0x226e26[_0x6e70('0x55')]);return db[_0x6e70('0x119')][_0x6e70('0x30')]({'where':_0x11ad05['where']})['then'](function(_0x473621){_0x2386bb[_0x6e70('0x30')]=_0x473621;if(_0x226e26['query']['includeAll']){_0x11ad05[_0x6e70('0x57')]=[{'all':!![]}];}return db[_0x6e70('0x119')][_0x6e70('0x6b')](_0x11ad05);})['then'](function(_0x5a52ba){_0x2386bb[_0x6e70('0x58')]=_0x5a52ba;return _0x2386bb;});}})[_0x6e70('0x38')](respondWithFilteredResult(_0x24f203,_0x11ad05))[_0x6e70('0x2c')](handleError(_0x24f203,null));};exports[_0x6e70('0x11a')]=function(_0x5a5fb2,_0x4818d3,_0x9a33e2){return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x5a5fb2['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x4818d3,null))['then'](function(_0x3ec865){if(_0x3ec865){return _0x3ec865[_0x6e70('0x11a')](_0x5a5fb2['body'][_0x6e70('0x6d')],_[_0x6e70('0xe6')](_0x5a5fb2[_0x6e70('0x5f')],[_0x6e70('0x6d'),'id'])||{})['spread'](function(_0x24ec1b){for(var _0x4b6894=0x0;_0x4b6894<_0x5a5fb2[_0x6e70('0x5f')][_0x6e70('0x6d')][_0x6e70('0x48')];_0x4b6894+=0x1){socket[_0x6e70('0x11b')](_0x6e70('0x11c'),{'UserId':_0x5a5fb2[_0x6e70('0x5f')][_0x6e70('0x6d')][_0x4b6894],'ChatWebsiteId':_0x5a5fb2['params']['id']});}return _0x24ec1b;});}})[_0x6e70('0x38')](respondWithResult(_0x4818d3,null))[_0x6e70('0x2c')](handleError(_0x4818d3,null));};exports[_0x6e70('0x11d')]=function(_0x40442a,_0x3839ee,_0x40f962){var _0x5132ce;return db[_0x6e70('0x40')][_0x6e70('0x5d')]({'where':{'id':_0x40442a['params']['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x3839ee,null))['then'](function(_0x26263d){if(_0x26263d){return _0x26263d[_0x6e70('0x11d')](_0x40442a['query'][_0x6e70('0x6d')])[_0x6e70('0x38')](function(_0x3aa070){if(_[_0x6e70('0x11e')](_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')])){for(var _0x2b81a6=0x0;_0x2b81a6<_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')][_0x6e70('0x48')];_0x2b81a6+=0x1){socket['emit'](_0x6e70('0x11f'),{'UserId':_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')][_0x2b81a6],'ChatWebsiteId':_0x40442a['params']['id']});}}else{socket['emit']('userChatWebsite:remove',{'UserId':_0x40442a[_0x6e70('0x44')][_0x6e70('0x6d')],'ChatWebsiteId':_0x40442a[_0x6e70('0x5a')]['id']});}});}})['then'](respondWithStatusCode(_0x3839ee,null))[_0x6e70('0x2c')](handleError(_0x3839ee,null));};exports[_0x6e70('0x120')]=function(_0x3c2063,_0x30bb34,_0x3f4dfb){var _0x1e87e1={};var _0x2b51f4={};var _0x32937c;var _0x32f0d2;return db[_0x6e70('0x40')][_0x6e70('0x70')]({'where':{'id':_0x3c2063[_0x6e70('0x5a')]['id']}})[_0x6e70('0x38')](handleEntityNotFound(_0x30bb34,null))['then'](function(_0x23010e){if(_0x23010e){_0x32937c=_0x23010e;_0x2b51f4[_0x6e70('0x42')]=_[_0x6e70('0x43')](db[_0x6e70('0xc4')][_0x6e70('0x41')]);_0x2b51f4['query']=_[_0x6e70('0x43')](_0x3c2063[_0x6e70('0x44')]);_0x2b51f4['filters']=_[_0x6e70('0x46')](_0x2b51f4[_0x6e70('0x42')],_0x2b51f4[_0x6e70('0x44')]);_0x1e87e1[_0x6e70('0x47')]=_[_0x6e70('0x46')](_0x2b51f4[_0x6e70('0x42')],qs[_0x6e70('0x5c')](_0x3c2063['query'][_0x6e70('0x5c')]));_0x1e87e1['attributes']=_0x1e87e1[_0x6e70('0x47')][_0x6e70('0x48')]?_0x1e87e1[_0x6e70('0x47')]:_0x2b51f4[_0x6e70('0x42')];_0x1e87e1[_0x6e70('0x4b')]=qs[_0x6e70('0x4c')](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x4c')]);_0x1e87e1[_0x6e70('0x4f')]=qs['filters'](_[_0x6e70('0x4d')](_0x3c2063[_0x6e70('0x44')],_0x2b51f4[_0x6e70('0x45')]));if(_0x3c2063[_0x6e70('0x44')][_0x6e70('0x4e')]){_0x1e87e1[_0x6e70('0x4f')]=_[_0x6e70('0x50')](_0x1e87e1[_0x6e70('0x4f')],{'$or':_[_0x6e70('0x51')](_0x1e87e1['attributes'],function(_0x51a1d9){var _0x31e037={};_0x31e037[_0x51a1d9]={'$like':'%'+_0x3c2063['query'][_0x6e70('0x4e')]+'%'};return _0x31e037;})});}_0x1e87e1=_[_0x6e70('0x50')]({},_0x1e87e1,_0x3c2063[_0x6e70('0x55')]);return _0x32937c[_0x6e70('0x120')](_0x1e87e1);}})[_0x6e70('0x38')](function(_0x5ee7ff){if(_0x5ee7ff){_0x32f0d2=_0x5ee7ff[_0x6e70('0x48')];if(!_0x3c2063['query'][_0x6e70('0x49')]('nolimit')){_0x1e87e1[_0x6e70('0x32')]=qs[_0x6e70('0x32')](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x32')]);_0x1e87e1['offset']=qs['offset'](_0x3c2063[_0x6e70('0x44')][_0x6e70('0x31')]);}return _0x32937c['getAgents'](_0x1e87e1);}})[_0x6e70('0x38')](function(_0x5bcfcb){if(_0x5bcfcb){return _0x5bcfcb?{'count':_0x32f0d2,'rows':_0x5bcfcb}:null;}})[_0x6e70('0x38')](respondWithResult(_0x30bb34,null))[_0x6e70('0x2c')](handleError(_0x30bb34,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b9cacf9..5ea4a73 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 _0xcca7=['../../mysqldb','ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x109946,_0x3494b7){var _0x4ed20b=function(_0x578aa4){while(--_0x578aa4){_0x109946['push'](_0x109946['shift']());}};_0x4ed20b(++_0x3494b7);}(_0xcca7,0x1aa));var _0x7cca=function(_0x317545,_0xd3f6c6){_0x317545=_0x317545-0x0;var _0x391afd=_0xcca7[_0x317545];return _0x391afd;};'use strict';var EventEmitter=require(_0x7cca('0x0'));var ChatWebsite=require(_0x7cca('0x1'))['db'][_0x7cca('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7cca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7cca('0x4')};function emitEvent(_0x533b00){return function(_0x3b86a4,_0x9523f7,_0x2126f7){ChatWebsiteEvents[_0x7cca('0x5')](_0x533b00+':'+_0x3b86a4['id'],_0x3b86a4);ChatWebsiteEvents[_0x7cca('0x5')](_0x533b00,_0x3b86a4);_0x2126f7(null);};}for(var e in events){if(events[_0x7cca('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x5957=['exports','events','../../mysqldb','save','remove','emit','hook'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5957,0x158));var _0x7595=function(_0x23eecd,_0x3a0a3b){_0x23eecd=_0x23eecd-0x0;var _0x5e30d2=_0x5957[_0x23eecd];return _0x5e30d2;};'use strict';var EventEmitter=require(_0x7595('0x0'));var ChatWebsite=require(_0x7595('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7595('0x2'),'afterUpdate':'update','afterDestroy':_0x7595('0x3')};function emitEvent(_0x8e95e4){return function(_0x27d0ea,_0x34e328,_0x68627c){ChatWebsiteEvents[_0x7595('0x4')](_0x8e95e4+':'+_0x27d0ea['id'],_0x27d0ea);ChatWebsiteEvents['emit'](_0x8e95e4,_0x27d0ea);_0x68627c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7595('0x5')](e,emitEvent(event));}}module[_0x7595('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a4fbdd4..2e5d6bb 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 _0xffe1=['bluebird','request-promise','exports','ChatWebsite','chat_websites','lodash','util','moment'];(function(_0x330fd1,_0x219869){var _0x2f3fea=function(_0x2fb134){while(--_0x2fb134){_0x330fd1['push'](_0x330fd1['shift']());}};_0x2f3fea(++_0x219869);}(_0xffe1,0x175));var _0x1ffe=function(_0x26f6fc,_0x11ab38){_0x26f6fc=_0x26f6fc-0x0;var _0x2afe2b=_0xffe1[_0x26f6fc];return _0x2afe2b;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1ffe('0x2'));var BPromise=require(_0x1ffe('0x3'));var rp=require(_0x1ffe('0x4'));var attributes=require('./chatWebsite.attributes');module[_0x1ffe('0x5')]=function(_0x21ba54,_0x2ba24a){return _0x21ba54['define'](_0x1ffe('0x6'),attributes,{'tableName':_0x1ffe('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa477=['util','api','moment','bluebird','request-promise','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0xdea8eb,_0x53af42){var _0x510816=function(_0x2e3300){while(--_0x2e3300){_0xdea8eb['push'](_0xdea8eb['shift']());}};_0x510816(++_0x53af42);}(_0xa477,0xe6));var _0x7a47=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa477[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var logger=require('../../config/logger')(_0x7a47('0x2'));var moment=require(_0x7a47('0x3'));var BPromise=require(_0x7a47('0x4'));var rp=require(_0x7a47('0x5'));var attributes=require(_0x7a47('0x6'));module[_0x7a47('0x7')]=function(_0x1b595e,_0x56b589){return _0x1b595e[_0x7a47('0x8')](_0x7a47('0x9'),attributes,{'tableName':_0x7a47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index f3e4eae..4428e71 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 _0xe11d=['stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe11d,0x1eb));var _0xde11=function(_0x1e80dc,_0x5b30be){_0x1e80dc=_0x1e80dc-0x0;var _0x146a7c=_0xe11d[_0x1e80dc];return _0x146a7c;};'use strict';var _=require(_0xde11('0x0'));var util=require('util');var moment=require(_0xde11('0x1'));var BPromise=require(_0xde11('0x2'));var rs=require(_0xde11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde11('0x4'))['db'];var utils=require(_0xde11('0x5'));var logger=require(_0xde11('0x6'))(_0xde11('0x7'));var config=require(_0xde11('0x8'));var jayson=require(_0xde11('0x9'));var client=jayson[_0xde11('0xa')][_0xde11('0xb')]({'port':0x232a});config['redis']=_[_0xde11('0xc')](config[_0xde11('0xd')],{'host':_0xde11('0xe'),'port':0x18eb});var socket=require(_0xde11('0xf'))(new Redis(config[_0xde11('0xd')]));require('./chatWebsite.socket')[_0xde11('0x10')](socket);function respondWithRpcPromise(_0x252d62,_0x5d5233,_0x56d431){return new BPromise(function(_0x234927,_0x23bc74){return client[_0xde11('0x11')](_0x252d62,_0x56d431)[_0xde11('0x12')](function(_0x38d82d){logger['info'](_0xde11('0x13'),_0x5d5233,_0xde11('0x14'));logger[_0xde11('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5d5233,'request\x20sent',JSON[_0xde11('0x16')](_0x38d82d));if(_0x38d82d[_0xde11('0x17')]){if(_0x38d82d[_0xde11('0x17')][_0xde11('0x18')]===0x1f4){logger[_0xde11('0x17')](_0xde11('0x13'),_0x5d5233,_0x38d82d[_0xde11('0x17')]['message']);return _0x23bc74(_0x38d82d[_0xde11('0x17')]['message']);}logger['error'](_0xde11('0x13'),_0x5d5233,_0x38d82d['error']['message']);return _0x234927(_0x38d82d[_0xde11('0x17')][_0xde11('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5d5233,'request\x20sent');_0x234927(_0x38d82d['result'][_0xde11('0x19')]);}})[_0xde11('0x1a')](function(_0x3e5a13){logger[_0xde11('0x17')](_0xde11('0x13'),_0x5d5233,_0x3e5a13);_0x23bc74(_0x3e5a13);});});} \ No newline at end of file +var _0xd09d=['error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3efde6,_0x2ce8b7){var _0x251330=function(_0x5214a7){while(--_0x5214a7){_0x3efde6['push'](_0x3efde6['shift']());}};_0x251330(++_0x2ce8b7);}(_0xd09d,0x6d));var _0xdd09=function(_0x2a4137,_0x4ae4fe){_0x2a4137=_0x2a4137-0x0;var _0x165cba=_0xd09d[_0x2a4137];return _0x165cba;};'use strict';var _=require('lodash');var util=require(_0xdd09('0x0'));var moment=require(_0xdd09('0x1'));var BPromise=require(_0xdd09('0x2'));var rs=require(_0xdd09('0x3'));var fs=require('fs');var Redis=require(_0xdd09('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdd09('0x5'))(_0xdd09('0x6'));var config=require(_0xdd09('0x7'));var jayson=require(_0xdd09('0x8'));var client=jayson[_0xdd09('0x9')]['http']({'port':0x232a});config[_0xdd09('0xa')]=_[_0xdd09('0xb')](config[_0xdd09('0xa')],{'host':_0xdd09('0xc'),'port':0x18eb});var socket=require(_0xdd09('0xd'))(new Redis(config['redis']));require(_0xdd09('0xe'))[_0xdd09('0xf')](socket);function respondWithRpcPromise(_0x11655f,_0x210038,_0x47b7da){return new BPromise(function(_0xb3a936,_0x373710){return client[_0xdd09('0x10')](_0x11655f,_0x47b7da)[_0xdd09('0x11')](function(_0x147f9a){logger['info'](_0xdd09('0x12'),_0x210038,'request\x20sent');logger['debug'](_0xdd09('0x13'),_0x210038,'request\x20sent',JSON[_0xdd09('0x14')](_0x147f9a));if(_0x147f9a[_0xdd09('0x15')]){if(_0x147f9a[_0xdd09('0x15')]['code']===0x1f4){logger[_0xdd09('0x15')](_0xdd09('0x12'),_0x210038,_0x147f9a[_0xdd09('0x15')][_0xdd09('0x16')]);return _0x373710(_0x147f9a[_0xdd09('0x15')][_0xdd09('0x16')]);}logger[_0xdd09('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x210038,_0x147f9a[_0xdd09('0x15')][_0xdd09('0x16')]);return _0xb3a936(_0x147f9a[_0xdd09('0x15')]['message']);}else{logger[_0xdd09('0x17')](_0xdd09('0x12'),_0x210038,'request\x20sent');_0xb3a936(_0x147f9a[_0xdd09('0x18')][_0xdd09('0x16')]);}})[_0xdd09('0x19')](function(_0x3aef38){logger[_0xdd09('0x15')](_0xdd09('0x12'),_0x210038,_0x3aef38);_0x373710(_0x3aef38);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 904e245..2d57b13 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 _0x9fc3=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x4e5aba,_0x31871d){var _0x473caf=function(_0x3b06dc){while(--_0x3b06dc){_0x4e5aba['push'](_0x4e5aba['shift']());}};_0x473caf(++_0x31871d);}(_0x9fc3,0xcb));var _0x39fc=function(_0x5b3f8f,_0x20814c){_0x5b3f8f=_0x5b3f8f-0x0;var _0xe7cbc4=_0x9fc3[_0x5b3f8f];return _0xe7cbc4;};'use strict';var ChatWebsiteEvents=require(_0x39fc('0x0'));var events=[_0x39fc('0x1'),_0x39fc('0x2'),_0x39fc('0x3')];function createListener(_0x293689,_0x5c6007){return function(_0x504c52){_0x5c6007[_0x39fc('0x4')](_0x293689,_0x504c52);};}function removeListener(_0xe79d81,_0x59808d){return function(){ChatWebsiteEvents[_0x39fc('0x5')](_0xe79d81,_0x59808d);};}exports[_0x39fc('0x6')]=function(_0x1ad379){for(var _0x4496d0=0x0,_0x39d163=events[_0x39fc('0x7')];_0x4496d0<_0x39d163;_0x4496d0++){var _0x4e70fa=events[_0x4496d0];var _0x108460=createListener(_0x39fc('0x8')+_0x4e70fa,_0x1ad379);ChatWebsiteEvents['on'](_0x4e70fa,_0x108460);}}; \ No newline at end of file +var _0xd117=['update','emit','removeListener','register','length','remove'];(function(_0xb92a44,_0x49bdf8){var _0x395615=function(_0x244d03){while(--_0x244d03){_0xb92a44['push'](_0xb92a44['shift']());}};_0x395615(++_0x49bdf8);}(_0xd117,0xf5));var _0x7d11=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xd117[_0x421c56];return _0x49b244;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x7d11('0x0'),_0x7d11('0x1')];function createListener(_0x430296,_0x27451a){return function(_0x2a464d){_0x27451a[_0x7d11('0x2')](_0x430296,_0x2a464d);};}function removeListener(_0x3f5b68,_0x21c293){return function(){ChatWebsiteEvents[_0x7d11('0x3')](_0x3f5b68,_0x21c293);};}exports[_0x7d11('0x4')]=function(_0x23d9e4){for(var _0x50d1b2=0x0,_0x252493=events[_0x7d11('0x5')];_0x50d1b2<_0x252493;_0x50d1b2++){var _0x37ea49=events[_0x50d1b2];var _0x34702a=createListener('chatWebsite:'+_0x37ea49,_0x23d9e4);ChatWebsiteEvents['on'](_0x37ea49,_0x34702a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a86ab5e..f937652 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 _0x9585=['destroy','delete','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','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','/:id/offline_messages','getOfflineMessages','post','/:id/dispositions','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','join','server/files/images/avatars/','file','addAvatar','/:id/customer_avatar','single','addCustomerAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x9585,0x15e));var _0x5958=function(_0xa55878,_0x3065eb){_0xa55878=_0xa55878-0x0;var _0x18b734=_0x9585[_0xa55878];return _0x18b734;};'use strict';var multer=require('multer');var util=require(_0x5958('0x0'));var path=require('path');var timeout=require(_0x5958('0x1'));var express=require(_0x5958('0x2'));var router=express[_0x5958('0x3')]();var auth=require(_0x5958('0x4'));var interaction=require(_0x5958('0x5'));var config=require(_0x5958('0x6'));var controller=require(_0x5958('0x7'));router[_0x5958('0x8')]('/',auth['isAuthenticated'](),controller[_0x5958('0x9')]);router['get'](_0x5958('0xa'),auth[_0x5958('0xb')](),controller[_0x5958('0xc')]);router['get'](_0x5958('0xd'),auth['isAuthenticated'](),controller[_0x5958('0xe')]);router[_0x5958('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5958('0xf')]);router[_0x5958('0x8')](_0x5958('0x10'),auth[_0x5958('0xb')](),controller[_0x5958('0x11')]);router['get'](_0x5958('0x12'),controller[_0x5958('0x13')]);router[_0x5958('0x8')](_0x5958('0x14'),controller[_0x5958('0x15')]);router['get']('/:id/customer_avatar',controller[_0x5958('0x16')]);router[_0x5958('0x8')](_0x5958('0x17'),controller['getSystemAvatar']);router[_0x5958('0x8')](_0x5958('0x18'),auth[_0x5958('0xb')](),controller[_0x5958('0x19')]);router['get'](_0x5958('0x1a'),controller[_0x5958('0x1b')]);router[_0x5958('0x8')](_0x5958('0x1c'),auth[_0x5958('0xb')](),controller[_0x5958('0x1d')]);router['get'](_0x5958('0x1e'),auth[_0x5958('0xb')](),controller[_0x5958('0x1f')]);router[_0x5958('0x8')](_0x5958('0x20'),controller['getFields']);router[_0x5958('0x8')](_0x5958('0x21'),auth[_0x5958('0xb')](),controller[_0x5958('0x22')]);router[_0x5958('0x8')]('/:id/users',auth[_0x5958('0xb')](),controller['getAgents']);router['post']('/',auth[_0x5958('0xb')](),controller['create']);router[_0x5958('0x23')](_0x5958('0x24'),auth[_0x5958('0xb')](),controller[_0x5958('0x25')]);router[_0x5958('0x23')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x5958('0x26')]({'destination':function(_0x1f1a87,_0x14380c,_0x3df8e7){_0x3df8e7(null,path['join'](config[_0x5958('0x27')],_0x5958('0x28')));},'filename':function(_0x31e00a,_0x5b0467,_0x329a6b){_0x329a6b(null,util[_0x5958('0x29')](_0x5958('0x2a'),Date[_0x5958('0x2b')](),_0x5b0467[_0x5958('0x2c')]));}})});router[_0x5958('0x23')](_0x5958('0x12'),upload['single']('file'),controller[_0x5958('0x2d')]);var upload=multer({'storage':multer[_0x5958('0x26')]({'destination':function(_0x45cd86,_0x57036a,_0x429064){_0x429064(null,path[_0x5958('0x2e')](config[_0x5958('0x27')],_0x5958('0x2f')));},'filename':function(_0xcc3e85,_0x35a2e3,_0x2a020e){_0x2a020e(null,util['format']('%s-%s',Date[_0x5958('0x2b')](),_0x35a2e3[_0x5958('0x2c')]));}})});router[_0x5958('0x23')]('/:id/avatar',upload['single'](_0x5958('0x30')),controller[_0x5958('0x31')]);var upload=multer({'storage':multer[_0x5958('0x26')]({'destination':function(_0xcca90c,_0x20b783,_0x39a6b0){_0x39a6b0(null,path[_0x5958('0x2e')](config['root'],_0x5958('0x2f')));},'filename':function(_0x52abdb,_0x3db7a5,_0xaea755){_0xaea755(null,util['format']('%s-%s',Date[_0x5958('0x2b')](),_0x3db7a5[_0x5958('0x2c')]));}})});router[_0x5958('0x23')](_0x5958('0x32'),upload[_0x5958('0x33')]('file'),controller[_0x5958('0x34')]);var upload=multer({'storage':multer[_0x5958('0x26')]({'destination':function(_0x19a36c,_0x32789b,_0x285468){_0x285468(null,path[_0x5958('0x2e')](config['root'],_0x5958('0x2f')));},'filename':function(_0x6ae8e5,_0x1ea0f9,_0xe6f463){_0xe6f463(null,util['format']('%s-%s',Date[_0x5958('0x2b')](),_0x1ea0f9[_0x5958('0x2c')]));}})});router['post'](_0x5958('0x17'),upload[_0x5958('0x33')](_0x5958('0x30')),controller['addSystemAvatar']);router[_0x5958('0x23')](_0x5958('0x35'),controller[_0x5958('0x36')]);router['post'](_0x5958('0x37'),controller[_0x5958('0x38')]);router[_0x5958('0x23')](_0x5958('0x18'),auth[_0x5958('0xb')](),controller[_0x5958('0x39')]);router[_0x5958('0x23')]('/:id/applications',auth[_0x5958('0xb')](),controller[_0x5958('0x3a')]);router['post'](_0x5958('0x1e'),auth['isAuthenticated'](),controller[_0x5958('0x3b')]);router['post'](_0x5958('0x3c'),auth[_0x5958('0xb')](),controller[_0x5958('0x3d')]);router[_0x5958('0x3e')]('/:id',auth[_0x5958('0xb')](),controller[_0x5958('0x3f')]);router['delete'](_0x5958('0xd'),auth['isAuthenticated'](),controller[_0x5958('0x40')]);router[_0x5958('0x41')](_0x5958('0x24'),auth[_0x5958('0xb')](),controller[_0x5958('0x42')]);router[_0x5958('0x41')]('/:id/canned_answers',auth[_0x5958('0xb')](),controller[_0x5958('0x43')]);router[_0x5958('0x41')](_0x5958('0x3c'),auth['isAuthenticated'](),controller[_0x5958('0x44')]);module['exports']=router; \ No newline at end of file +var _0xe1f0=['/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addAgents','put','/:id','update','removeDispositions','delete','removeAnswers','/:id/users','util','path','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x4259cf,_0x1cec24){var _0x37d18b=function(_0x4fd6a7){while(--_0x4fd6a7){_0x4259cf['push'](_0x4259cf['shift']());}};_0x37d18b(++_0x1cec24);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x271f47,_0x11688f){_0x271f47=_0x271f47-0x0;var _0x47b299=_0xe1f0[_0x271f47];return _0x47b299;};'use strict';var multer=require('multer');var util=require(_0x0e1f('0x0'));var path=require(_0x0e1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e1f('0x2'));var router=express[_0x0e1f('0x3')]();var auth=require(_0x0e1f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0e1f('0x5'));var controller=require(_0x0e1f('0x6'));router[_0x0e1f('0x7')]('/',auth['isAuthenticated'](),controller[_0x0e1f('0x8')]);router['get'](_0x0e1f('0x9'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0xb')]);router['get']('/:id',auth[_0x0e1f('0xa')](),controller[_0x0e1f('0xc')]);router['get'](_0x0e1f('0xd'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0xe')]);router[_0x0e1f('0x7')](_0x0e1f('0xf'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x10')]);router[_0x0e1f('0x7')](_0x0e1f('0x11'),controller[_0x0e1f('0x12')]);router[_0x0e1f('0x7')](_0x0e1f('0x13'),controller['getAvatar']);router[_0x0e1f('0x7')](_0x0e1f('0x14'),controller[_0x0e1f('0x15')]);router[_0x0e1f('0x7')](_0x0e1f('0x16'),controller[_0x0e1f('0x17')]);router[_0x0e1f('0x7')](_0x0e1f('0x18'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x19')]);router['get'](_0x0e1f('0x1a'),controller[_0x0e1f('0x1b')]);router['get'](_0x0e1f('0x1c'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x1d')]);router[_0x0e1f('0x7')](_0x0e1f('0x1e'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x1f')]);router['get'](_0x0e1f('0x20'),controller[_0x0e1f('0x21')]);router[_0x0e1f('0x7')](_0x0e1f('0x22'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x23')]);router[_0x0e1f('0x7')]('/:id/users',auth[_0x0e1f('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0e1f('0x24')]);router[_0x0e1f('0x25')](_0x0e1f('0xd'),auth['isAuthenticated'](),controller[_0x0e1f('0x26')]);router[_0x0e1f('0x25')](_0x0e1f('0xf'),auth['isAuthenticated'](),controller[_0x0e1f('0x27')]);var upload=multer({'storage':multer[_0x0e1f('0x28')]({'destination':function(_0x376e6a,_0x1a1af5,_0x3bd3e2){_0x3bd3e2(null,path[_0x0e1f('0x29')](config[_0x0e1f('0x2a')],_0x0e1f('0x2b')));},'filename':function(_0x5445ff,_0x9b7441,_0x79c32){_0x79c32(null,util[_0x0e1f('0x2c')](_0x0e1f('0x2d'),Date['now'](),_0x9b7441[_0x0e1f('0x2e')]));}})});router['post'](_0x0e1f('0x11'),upload['single'](_0x0e1f('0x2f')),controller[_0x0e1f('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c895d,_0xca6afa,_0x2a551e){_0x2a551e(null,path[_0x0e1f('0x29')](config[_0x0e1f('0x2a')],_0x0e1f('0x31')));},'filename':function(_0x535917,_0x81d704,_0x4b80ee){_0x4b80ee(null,util[_0x0e1f('0x2c')](_0x0e1f('0x2d'),Date[_0x0e1f('0x32')](),_0x81d704[_0x0e1f('0x2e')]));}})});router[_0x0e1f('0x25')](_0x0e1f('0x13'),upload['single'](_0x0e1f('0x2f')),controller[_0x0e1f('0x33')]);var upload=multer({'storage':multer[_0x0e1f('0x28')]({'destination':function(_0x160ec8,_0x5ae7bb,_0x54a56c){_0x54a56c(null,path[_0x0e1f('0x29')](config[_0x0e1f('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x21e80b,_0x15ac7e,_0x1479d7){_0x1479d7(null,util[_0x0e1f('0x2c')](_0x0e1f('0x2d'),Date[_0x0e1f('0x32')](),_0x15ac7e[_0x0e1f('0x2e')]));}})});router[_0x0e1f('0x25')](_0x0e1f('0x14'),upload[_0x0e1f('0x34')](_0x0e1f('0x2f')),controller[_0x0e1f('0x35')]);var upload=multer({'storage':multer[_0x0e1f('0x28')]({'destination':function(_0x37ddf7,_0x2e4e73,_0x5a7c4c){_0x5a7c4c(null,path[_0x0e1f('0x29')](config[_0x0e1f('0x2a')],_0x0e1f('0x31')));},'filename':function(_0x45275,_0x3c9045,_0x586332){_0x586332(null,util['format'](_0x0e1f('0x2d'),Date[_0x0e1f('0x32')](),_0x3c9045[_0x0e1f('0x2e')]));}})});router[_0x0e1f('0x25')]('/:id/system_avatar',upload[_0x0e1f('0x34')]('file'),controller[_0x0e1f('0x36')]);router['post'](_0x0e1f('0x37'),controller[_0x0e1f('0x38')]);router[_0x0e1f('0x25')](_0x0e1f('0x39'),controller['offline']);router[_0x0e1f('0x25')]('/:id/interactions',auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x3a')]);router[_0x0e1f('0x25')](_0x0e1f('0x1c'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x3b')]);router[_0x0e1f('0x25')](_0x0e1f('0x1e'),auth[_0x0e1f('0xa')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x3c')]);router[_0x0e1f('0x3d')](_0x0e1f('0x3e'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x3f')]);router['delete'](_0x0e1f('0x3e'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x0e1f('0xd'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x40')]);router[_0x0e1f('0x41')](_0x0e1f('0xf'),auth[_0x0e1f('0xa')](),controller[_0x0e1f('0x42')]);router[_0x0e1f('0x41')](_0x0e1f('0x43'),auth[_0x0e1f('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e08b57d..cb43e2f 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 _0x8b04=['STRING','name','sequelize','exports'];(function(_0x2d9dd6,_0x5c212b){var _0x1a36f9=function(_0x2b0ba3){while(--_0x2b0ba3){_0x2d9dd6['push'](_0x2d9dd6['shift']());}};_0x1a36f9(++_0x5c212b);}(_0x8b04,0xea));var _0x48b0=function(_0x2ee654,_0x3d6e2f){_0x2ee654=_0x2ee654-0x0;var _0x355857=_0x8b04[_0x2ee654];return _0x355857;};'use strict';var Sequelize=require(_0x48b0('0x0'));module[_0x48b0('0x1')]={'name':{'type':Sequelize[_0x48b0('0x2')],'unique':_0x48b0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x48b0('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x48b0('0x2')]},'phone':{'type':Sequelize[_0x48b0('0x2')]},'fax':{'type':Sequelize[_0x48b0('0x2')]},'type':{'type':Sequelize[_0x48b0('0x2')]},'street':{'type':Sequelize[_0x48b0('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x48b0('0x2')]},'country':{'type':Sequelize[_0x48b0('0x2')]},'email':{'type':Sequelize[_0x48b0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x48b0('0x2')]},'sCountry':{'type':Sequelize[_0x48b0('0x2')]},'description':{'type':Sequelize[_0x48b0('0x2')]}}; \ No newline at end of file +var _0x0b45=['name','sequelize','exports','STRING'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x0b45,0x99));var _0x50b4=function(_0x588c2e,_0x5963bf){_0x588c2e=_0x588c2e-0x0;var _0x2d5070=_0x0b45[_0x588c2e];return _0x2d5070;};'use strict';var Sequelize=require(_0x50b4('0x0'));module[_0x50b4('0x1')]={'name':{'type':Sequelize[_0x50b4('0x2')],'unique':_0x50b4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x50b4('0x2')]},'companyId':{'type':Sequelize[_0x50b4('0x2')]},'website':{'type':Sequelize[_0x50b4('0x2')]},'phone':{'type':Sequelize[_0x50b4('0x2')]},'fax':{'type':Sequelize[_0x50b4('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x50b4('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x50b4('0x2')]},'email':{'type':Sequelize[_0x50b4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x50b4('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x50b4('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x50b4('0x2')]},'description':{'type':Sequelize[_0x50b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d257827..31bde32 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 _0x2827=['type','VIRTUAL','field','merge','options','includeAll','findAll','catch','show','length','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','ids','omit','getContacts','findOne','CmContact','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','get','Companies','destroy','error','stack','name','CmCompany','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','map'];(function(_0x54772c,_0x4b90c7){var _0x8f15da=function(_0xf258d3){while(--_0xf258d3){_0x54772c['push'](_0x54772c['shift']());}};_0x8f15da(++_0x4b90c7);}(_0x2827,0xd0));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7282('0x0'));var rimraf=require(_0x7282('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7282('0x2'));var rp=require(_0x7282('0x3'));var moment=require(_0x7282('0x4'));var BPromise=require(_0x7282('0x5'));var Mustache=require(_0x7282('0x6'));var util=require('util');var path=require(_0x7282('0x7'));var sox=require(_0x7282('0x8'));var csv=require(_0x7282('0x9'));var ejs=require(_0x7282('0xa'));var fs=require('fs');var _=require(_0x7282('0xb'));var squel=require(_0x7282('0xc'));var crypto=require(_0x7282('0xd'));var jsforce=require(_0x7282('0xe'));var deskjs=require(_0x7282('0xf'));var toCsv=require(_0x7282('0x9'));var querystring=require(_0x7282('0x10'));var Papa=require(_0x7282('0x11'));var authService=require(_0x7282('0x12'));var hardwareService=require(_0x7282('0x13'));var Redis=require('ioredis');var qs=require(_0x7282('0x14'));var logger=require(_0x7282('0x15'))(_0x7282('0x16'));var utils=require(_0x7282('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x67f05e,_0x3d123b){_0x3d123b=_0x3d123b||0xcc;return function(_0x52c5dc){if(_0x52c5dc){return _0x67f05e[_0x7282('0x18')](_0x3d123b);}return _0x67f05e[_0x7282('0x19')](_0x3d123b)[_0x7282('0x1a')]();};}function respondWithResult(_0x3373a7,_0xb43583){_0xb43583=_0xb43583||0xc8;return function(_0x508e2f){if(_0x508e2f){return _0x3373a7['status'](_0xb43583)['json'](_0x508e2f);}};}function respondWithFilteredResult(_0x5c1087,_0x409315){return function(_0x4196a7){if(_0x4196a7){var _0x2d0980=_0x4196a7[_0x7282('0x1b')],_0x3f6051=_0x409315[_0x7282('0x1c')],_0x2db689=_0x409315[_0x7282('0x1c')]+_0x409315[_0x7282('0x1d')],_0x413267;if(_0x2db689>=_0x2d0980){_0x2db689=_0x2d0980;_0x413267=0xc8;}else{_0x413267=0xce;}_0x5c1087[_0x7282('0x19')](_0x413267);return _0x5c1087[_0x7282('0x1e')](_0x7282('0x1f'),_0x3f6051+'-'+_0x2db689+'/'+_0x2d0980)[_0x7282('0x20')](_0x4196a7);}return null;};}function patchUpdates(_0x36b0d8){return function(_0x378d55){try{jsonpatch[_0x7282('0x21')](_0x378d55,_0x36b0d8,!![]);}catch(_0x372497){return BPromise[_0x7282('0x22')](_0x372497);}return _0x378d55[_0x7282('0x23')]();};}function saveUpdates(_0x2a318c,_0x53fb93){return function(_0x25c6cc){if(_0x25c6cc){return _0x25c6cc['update'](_0x2a318c)['then'](function(_0x21ebe7){return _0x21ebe7;});}return null;};}function removeEntity(_0x4f9fef,_0x1ca8f2){return function(_0x6afc18){if(_0x6afc18){return _0x6afc18['destroy']()[_0x7282('0x24')](function(){var _0x418443=_0x6afc18[_0x7282('0x25')]({'plain':!![]});var _0x415227=_0x7282('0x26');return db['UserProfileResource'][_0x7282('0x27')]({'where':{'type':_0x415227,'resourceId':_0x418443['id']}})[_0x7282('0x24')](function(){return _0x6afc18;});})[_0x7282('0x24')](function(){_0x4f9fef[_0x7282('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dd956,_0x382bc9){return function(_0x53ea10){if(!_0x53ea10){_0x4dd956['sendStatus'](0x194);}return _0x53ea10;};}function handleError(_0x25473b,_0x18993a){_0x18993a=_0x18993a||0x1f4;return function(_0xd8132a){logger[_0x7282('0x28')](_0xd8132a[_0x7282('0x29')]);if(_0xd8132a[_0x7282('0x2a')]){delete _0xd8132a[_0x7282('0x2a')];}_0x25473b['status'](_0x18993a)['send'](_0xd8132a);};}exports['index']=function(_0x65bb7f,_0x4c1513){var _0x32b598={},_0x6f77b1={},_0x34e4ee={'count':0x0,'rows':[]};var _0x54bbc2=db[_0x7282('0x2b')][_0x7282('0x2c')];_0x6f77b1[_0x7282('0x2d')]=_['keys'](_0x54bbc2);_0x6f77b1[_0x7282('0x2e')]=_[_0x7282('0x2f')](_0x65bb7f['query']);_0x6f77b1[_0x7282('0x30')]=_[_0x7282('0x31')](_0x6f77b1[_0x7282('0x2d')],_0x6f77b1[_0x7282('0x2e')]);_0x32b598[_0x7282('0x32')]=_[_0x7282('0x31')](_0x6f77b1[_0x7282('0x2d')],qs['fields'](_0x65bb7f[_0x7282('0x2e')][_0x7282('0x33')]));_0x32b598[_0x7282('0x32')]=_0x32b598[_0x7282('0x32')]['length']?_0x32b598[_0x7282('0x32')]:_0x6f77b1[_0x7282('0x2d')];if(!_0x65bb7f['query'][_0x7282('0x34')](_0x7282('0x35'))){_0x32b598[_0x7282('0x1d')]=qs[_0x7282('0x1d')](_0x65bb7f[_0x7282('0x2e')][_0x7282('0x1d')]);_0x32b598['offset']=qs[_0x7282('0x1c')](_0x65bb7f['query']['offset']);}_0x32b598['order']=qs[_0x7282('0x36')](_0x65bb7f[_0x7282('0x2e')][_0x7282('0x36')]);_0x32b598['where']=qs[_0x7282('0x30')](_[_0x7282('0x37')](_0x65bb7f[_0x7282('0x2e')],_0x6f77b1[_0x7282('0x30')]));if(_0x65bb7f[_0x7282('0x2e')][_0x7282('0x38')]){_0x32b598[_0x7282('0x39')]=_['merge'](_0x32b598[_0x7282('0x39')],{'$or':_[_0x7282('0x3a')](_0x54bbc2,function(_0x5792c5){if(_0x5792c5[_0x7282('0x3b')]['key']!==_0x7282('0x3c')){var _0x1b382d={};_0x1b382d[_0x5792c5[_0x7282('0x3d')]]={'$like':'%'+_0x65bb7f[_0x7282('0x2e')][_0x7282('0x38')]+'%'};return _0x1b382d;}})});}_0x32b598=_[_0x7282('0x3e')]({},_0x32b598,_0x65bb7f[_0x7282('0x3f')]);var _0xbf0455={'where':_0x32b598[_0x7282('0x39')]};return db[_0x7282('0x2b')]['count'](_0xbf0455)[_0x7282('0x24')](function(_0x59981c){_0x34e4ee[_0x7282('0x1b')]=_0x59981c;if(_0x65bb7f[_0x7282('0x2e')][_0x7282('0x40')]){_0x32b598['include']=[{'all':!![]}];}return db[_0x7282('0x2b')][_0x7282('0x41')](_0x32b598);})['then'](function(_0x439557){_0x34e4ee['rows']=_0x439557;return _0x34e4ee;})[_0x7282('0x24')](respondWithFilteredResult(_0x4c1513,_0x32b598))[_0x7282('0x42')](handleError(_0x4c1513,null));};exports[_0x7282('0x43')]=function(_0x2ce0b7,_0x449c42){var _0x21596a={'raw':![],'where':{'id':_0x2ce0b7['params']['id']}},_0x5697c7={};_0x5697c7[_0x7282('0x2d')]=_[_0x7282('0x2f')](db[_0x7282('0x2b')][_0x7282('0x2c')]);_0x5697c7[_0x7282('0x2e')]=_[_0x7282('0x2f')](_0x2ce0b7['query']);_0x5697c7[_0x7282('0x30')]=_[_0x7282('0x31')](_0x5697c7[_0x7282('0x2d')],_0x5697c7[_0x7282('0x2e')]);_0x21596a[_0x7282('0x32')]=_[_0x7282('0x31')](_0x5697c7[_0x7282('0x2d')],qs[_0x7282('0x33')](_0x2ce0b7[_0x7282('0x2e')]['fields']));_0x21596a[_0x7282('0x32')]=_0x21596a[_0x7282('0x32')][_0x7282('0x44')]?_0x21596a[_0x7282('0x32')]:_0x5697c7[_0x7282('0x2d')];if(_0x2ce0b7[_0x7282('0x2e')]['includeAll']){_0x21596a[_0x7282('0x45')]=[{'all':!![]}];}_0x21596a=_[_0x7282('0x3e')]({},_0x21596a,_0x2ce0b7[_0x7282('0x3f')]);return db['CmCompany']['find'](_0x21596a)['then'](handleEntityNotFound(_0x449c42,null))['then'](respondWithResult(_0x449c42,null))[_0x7282('0x42')](handleError(_0x449c42,null));};exports['create']=function(_0xe45b5e,_0x539f88){return db[_0x7282('0x2b')][_0x7282('0x46')](_0xe45b5e[_0x7282('0x47')],{})[_0x7282('0x24')](function(_0x38f33f){var _0x3b5fd4=_0xe45b5e[_0x7282('0x48')][_0x7282('0x25')]({'plain':!![]});if(!_0x3b5fd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b5fd4[_0x7282('0x49')]===_0x7282('0x48')){var _0x48a79d=_0x38f33f['get']({'plain':!![]});var _0x16900e=_0x7282('0x26');return db[_0x7282('0x4a')][_0x7282('0x4b')]({'where':{'name':_0x16900e,'userProfileId':_0x3b5fd4[_0x7282('0x4c')]},'raw':!![]})[_0x7282('0x24')](function(_0x537905){if(_0x537905&&_0x537905[_0x7282('0x4d')]===0x0){return db[_0x7282('0x4e')][_0x7282('0x46')]({'name':_0x48a79d[_0x7282('0x2a')],'resourceId':_0x48a79d['id'],'type':_0x537905[_0x7282('0x2a')],'sectionId':_0x537905['id']},{})[_0x7282('0x24')](function(){return _0x38f33f;});}else{return _0x38f33f;}})[_0x7282('0x42')](function(_0x2c6d5e){logger[_0x7282('0x28')](_0x7282('0x4f'),_0x2c6d5e);throw _0x2c6d5e;});}return _0x38f33f;})['then'](respondWithResult(_0x539f88,0xc9))[_0x7282('0x42')](handleError(_0x539f88,null));};exports[_0x7282('0x50')]=function(_0x523a31,_0x526f23){if(_0x523a31[_0x7282('0x47')]['id']){delete _0x523a31[_0x7282('0x47')]['id'];}return db[_0x7282('0x2b')]['find']({'where':{'id':_0x523a31['params']['id']}})['then'](handleEntityNotFound(_0x526f23,null))['then'](saveUpdates(_0x523a31['body'],null))[_0x7282('0x24')](respondWithResult(_0x526f23,null))[_0x7282('0x42')](handleError(_0x526f23,null));};exports['destroy']=function(_0x46d580,_0x3963dd){return db[_0x7282('0x2b')][_0x7282('0x4b')]({'where':{'id':_0x46d580[_0x7282('0x51')]['id']}})[_0x7282('0x24')](handleEntityNotFound(_0x3963dd,null))[_0x7282('0x24')](removeEntity(_0x3963dd,null))[_0x7282('0x42')](handleError(_0x3963dd,null));};exports[_0x7282('0x52')]=function(_0x114167,_0x53c759,_0x271085){return db['CmContact'][_0x7282('0x4b')]({'where':{'id':_0x114167[_0x7282('0x51')]['id']}})['then'](handleEntityNotFound(_0x53c759,null))[_0x7282('0x24')](function(_0x32f19f){if(_0x32f19f){return _0x32f19f[_0x7282('0x52')](_0x114167[_0x7282('0x47')][_0x7282('0x53')],_[_0x7282('0x54')](_0x114167[_0x7282('0x47')],['ids','id'])||{});}})[_0x7282('0x24')](respondWithResult(_0x53c759,null))[_0x7282('0x42')](handleError(_0x53c759,null));};exports[_0x7282('0x55')]=function(_0x52b5f9,_0x4b8c08,_0x4307ff){var _0x8996cf={};var _0x5843af={};var _0x559ee7;var _0x74205d;return db[_0x7282('0x2b')][_0x7282('0x56')]({'where':{'id':_0x52b5f9[_0x7282('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b8c08,null))['then'](function(_0x125b17){if(_0x125b17){_0x559ee7=_0x125b17;_0x5843af[_0x7282('0x2d')]=_['keys'](db[_0x7282('0x57')][_0x7282('0x2c')]);_0x5843af[_0x7282('0x2e')]=_[_0x7282('0x2f')](_0x52b5f9[_0x7282('0x2e')]);_0x5843af[_0x7282('0x30')]=_['intersection'](_0x5843af[_0x7282('0x2d')],_0x5843af[_0x7282('0x2e')]);_0x8996cf[_0x7282('0x32')]=_[_0x7282('0x31')](_0x5843af[_0x7282('0x2d')],qs[_0x7282('0x33')](_0x52b5f9['query']['fields']));_0x8996cf[_0x7282('0x32')]=_0x8996cf[_0x7282('0x32')][_0x7282('0x44')]?_0x8996cf['attributes']:_0x5843af[_0x7282('0x2d')];_0x8996cf[_0x7282('0x58')]=qs[_0x7282('0x36')](_0x52b5f9[_0x7282('0x2e')]['sort']);_0x8996cf[_0x7282('0x39')]=qs[_0x7282('0x30')](_[_0x7282('0x37')](_0x52b5f9[_0x7282('0x2e')],_0x5843af[_0x7282('0x30')]));if(_0x52b5f9[_0x7282('0x2e')][_0x7282('0x38')]){_0x8996cf[_0x7282('0x39')]=_['merge'](_0x8996cf[_0x7282('0x39')],{'$or':_[_0x7282('0x3a')](_0x8996cf[_0x7282('0x32')],function(_0x18594c){var _0x5eef5f={};_0x5eef5f[_0x18594c]={'$like':'%'+_0x52b5f9['query'][_0x7282('0x38')]+'%'};return _0x5eef5f;})});}_0x8996cf=_[_0x7282('0x3e')]({},_0x8996cf,_0x52b5f9['options']);return _0x559ee7[_0x7282('0x55')](_0x8996cf);}})[_0x7282('0x24')](function(_0x4ba492){if(_0x4ba492){_0x74205d=_0x4ba492[_0x7282('0x44')];if(!_0x52b5f9[_0x7282('0x2e')][_0x7282('0x34')](_0x7282('0x35'))){_0x8996cf[_0x7282('0x1d')]=qs[_0x7282('0x1d')](_0x52b5f9[_0x7282('0x2e')][_0x7282('0x1d')]);_0x8996cf['offset']=qs['offset'](_0x52b5f9[_0x7282('0x2e')][_0x7282('0x1c')]);}return _0x559ee7[_0x7282('0x55')](_0x8996cf);}})[_0x7282('0x24')](function(_0xed1bbf){if(_0xed1bbf){return _0xed1bbf?{'count':_0x74205d,'rows':_0xed1bbf}:null;}})[_0x7282('0x24')](respondWithResult(_0x4b8c08,null))[_0x7282('0x42')](handleError(_0x4b8c08,null));}; \ No newline at end of file +var _0xb22f=['moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','Companies','UserProfileResource','destroy','end','error','stack','name','send','index','CmCompany','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','filter','merge','type','key','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','length','pick','map','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x4417af,_0x45c4aa){var _0x30d9e3=function(_0x55a2ce){while(--_0x55a2ce){_0x4417af['push'](_0x4417af['shift']());}};_0x30d9e3(++_0x45c4aa);}(_0xb22f,0xfa));var _0xfb22=function(_0x3dbcab,_0x78dbe4){_0x3dbcab=_0x3dbcab-0x0;var _0x2c9906=_0xb22f[_0x3dbcab];return _0x2c9906;};'use strict';var pdf=require(_0xfb22('0x0'));var emlformat=require(_0xfb22('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfb22('0x2'));var jsonpatch=require(_0xfb22('0x3'));var rp=require(_0xfb22('0x4'));var moment=require(_0xfb22('0x5'));var BPromise=require(_0xfb22('0x6'));var Mustache=require('mustache');var util=require(_0xfb22('0x7'));var path=require('path');var sox=require(_0xfb22('0x8'));var csv=require(_0xfb22('0x9'));var ejs=require(_0xfb22('0xa'));var fs=require('fs');var _=require(_0xfb22('0xb'));var squel=require(_0xfb22('0xc'));var crypto=require(_0xfb22('0xd'));var jsforce=require(_0xfb22('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfb22('0x9'));var querystring=require('querystring');var Papa=require(_0xfb22('0xf'));var authService=require(_0xfb22('0x10'));var hardwareService=require(_0xfb22('0x11'));var Redis=require('ioredis');var qs=require(_0xfb22('0x12'));var logger=require(_0xfb22('0x13'))('api');var utils=require(_0xfb22('0x14'));var config=require('../../config/environment');var db=require(_0xfb22('0x15'))['db'];function respondWithStatusCode(_0x1c245f,_0x242c09){_0x242c09=_0x242c09||0xcc;return function(_0x49db36){if(_0x49db36){return _0x1c245f[_0xfb22('0x16')](_0x242c09);}return _0x1c245f[_0xfb22('0x17')](_0x242c09)['end']();};}function respondWithResult(_0x1bda3d,_0xee1536){_0xee1536=_0xee1536||0xc8;return function(_0x547aea){if(_0x547aea){return _0x1bda3d[_0xfb22('0x17')](_0xee1536)[_0xfb22('0x18')](_0x547aea);}};}function respondWithFilteredResult(_0x27c3d6,_0x51b710){return function(_0xc34e77){if(_0xc34e77){var _0x558340=_0xc34e77[_0xfb22('0x19')],_0x2750f2=_0x51b710[_0xfb22('0x1a')],_0xc1792f=_0x51b710[_0xfb22('0x1a')]+_0x51b710['limit'],_0x302c24;if(_0xc1792f>=_0x558340){_0xc1792f=_0x558340;_0x302c24=0xc8;}else{_0x302c24=0xce;}_0x27c3d6[_0xfb22('0x17')](_0x302c24);return _0x27c3d6['set'](_0xfb22('0x1b'),_0x2750f2+'-'+_0xc1792f+'/'+_0x558340)[_0xfb22('0x18')](_0xc34e77);}return null;};}function patchUpdates(_0x3eca90){return function(_0x39be75){try{jsonpatch['apply'](_0x39be75,_0x3eca90,!![]);}catch(_0xc713a1){return BPromise[_0xfb22('0x1c')](_0xc713a1);}return _0x39be75[_0xfb22('0x1d')]();};}function saveUpdates(_0x33e3af,_0x2a77ed){return function(_0x59beb5){if(_0x59beb5){return _0x59beb5[_0xfb22('0x1e')](_0x33e3af)[_0xfb22('0x1f')](function(_0x1f566c){return _0x1f566c;});}return null;};}function removeEntity(_0x4c3cd0,_0x116ced){return function(_0x3f25d8){if(_0x3f25d8){return _0x3f25d8['destroy']()[_0xfb22('0x1f')](function(){var _0x6770b9=_0x3f25d8['get']({'plain':!![]});var _0x536eae=_0xfb22('0x20');return db[_0xfb22('0x21')][_0xfb22('0x22')]({'where':{'type':_0x536eae,'resourceId':_0x6770b9['id']}})[_0xfb22('0x1f')](function(){return _0x3f25d8;});})[_0xfb22('0x1f')](function(){_0x4c3cd0['status'](0xcc)[_0xfb22('0x23')]();});}};}function handleEntityNotFound(_0xeebe,_0x2d573e){return function(_0x17f4ab){if(!_0x17f4ab){_0xeebe[_0xfb22('0x16')](0x194);}return _0x17f4ab;};}function handleError(_0x21b0fd,_0x5e9ae2){_0x5e9ae2=_0x5e9ae2||0x1f4;return function(_0x47e279){logger[_0xfb22('0x24')](_0x47e279[_0xfb22('0x25')]);if(_0x47e279[_0xfb22('0x26')]){delete _0x47e279[_0xfb22('0x26')];}_0x21b0fd['status'](_0x5e9ae2)[_0xfb22('0x27')](_0x47e279);};}exports[_0xfb22('0x28')]=function(_0x218799,_0x5043dc){var _0x1c0be0={},_0x226a83={},_0x19dfc3={'count':0x0,'rows':[]};var _0x3bd798=db[_0xfb22('0x29')][_0xfb22('0x2a')];_0x226a83[_0xfb22('0x2b')]=_['keys'](_0x3bd798);_0x226a83[_0xfb22('0x2c')]=_[_0xfb22('0x2d')](_0x218799['query']);_0x226a83[_0xfb22('0x2e')]=_[_0xfb22('0x2f')](_0x226a83[_0xfb22('0x2b')],_0x226a83['query']);_0x1c0be0['attributes']=_[_0xfb22('0x2f')](_0x226a83['model'],qs['fields'](_0x218799[_0xfb22('0x2c')][_0xfb22('0x30')]));_0x1c0be0[_0xfb22('0x31')]=_0x1c0be0[_0xfb22('0x31')]['length']?_0x1c0be0[_0xfb22('0x31')]:_0x226a83[_0xfb22('0x2b')];if(!_0x218799['query'][_0xfb22('0x32')]('nolimit')){_0x1c0be0[_0xfb22('0x33')]=qs['limit'](_0x218799[_0xfb22('0x2c')][_0xfb22('0x33')]);_0x1c0be0['offset']=qs[_0xfb22('0x1a')](_0x218799[_0xfb22('0x2c')][_0xfb22('0x1a')]);}_0x1c0be0[_0xfb22('0x34')]=qs[_0xfb22('0x35')](_0x218799[_0xfb22('0x2c')][_0xfb22('0x35')]);_0x1c0be0[_0xfb22('0x36')]=qs['filters'](_['pick'](_0x218799['query'],_0x226a83[_0xfb22('0x2e')]));if(_0x218799[_0xfb22('0x2c')][_0xfb22('0x37')]){_0x1c0be0[_0xfb22('0x36')]=_[_0xfb22('0x38')](_0x1c0be0[_0xfb22('0x36')],{'$or':_['map'](_0x3bd798,function(_0x88ae23){if(_0x88ae23[_0xfb22('0x39')][_0xfb22('0x3a')]!=='VIRTUAL'){var _0x550666={};_0x550666[_0x88ae23[_0xfb22('0x3b')]]={'$like':'%'+_0x218799[_0xfb22('0x2c')][_0xfb22('0x37')]+'%'};return _0x550666;}})});}_0x1c0be0=_[_0xfb22('0x38')]({},_0x1c0be0,_0x218799[_0xfb22('0x3c')]);var _0x3f33bf={'where':_0x1c0be0['where']};return db[_0xfb22('0x29')]['count'](_0x3f33bf)[_0xfb22('0x1f')](function(_0x3f244c){_0x19dfc3[_0xfb22('0x19')]=_0x3f244c;if(_0x218799[_0xfb22('0x2c')]['includeAll']){_0x1c0be0[_0xfb22('0x3d')]=[{'all':!![]}];}return db[_0xfb22('0x29')][_0xfb22('0x3e')](_0x1c0be0);})[_0xfb22('0x1f')](function(_0x8eadc8){_0x19dfc3[_0xfb22('0x3f')]=_0x8eadc8;return _0x19dfc3;})['then'](respondWithFilteredResult(_0x5043dc,_0x1c0be0))[_0xfb22('0x40')](handleError(_0x5043dc,null));};exports[_0xfb22('0x41')]=function(_0x12cabc,_0x20f6fe){var _0x1aa692={'raw':![],'where':{'id':_0x12cabc[_0xfb22('0x42')]['id']}},_0x310bb8={};_0x310bb8[_0xfb22('0x2b')]=_['keys'](db[_0xfb22('0x29')][_0xfb22('0x2a')]);_0x310bb8['query']=_[_0xfb22('0x2d')](_0x12cabc['query']);_0x310bb8[_0xfb22('0x2e')]=_[_0xfb22('0x2f')](_0x310bb8[_0xfb22('0x2b')],_0x310bb8[_0xfb22('0x2c')]);_0x1aa692[_0xfb22('0x31')]=_[_0xfb22('0x2f')](_0x310bb8[_0xfb22('0x2b')],qs[_0xfb22('0x30')](_0x12cabc[_0xfb22('0x2c')][_0xfb22('0x30')]));_0x1aa692[_0xfb22('0x31')]=_0x1aa692[_0xfb22('0x31')]['length']?_0x1aa692['attributes']:_0x310bb8['model'];if(_0x12cabc[_0xfb22('0x2c')][_0xfb22('0x43')]){_0x1aa692[_0xfb22('0x3d')]=[{'all':!![]}];}_0x1aa692=_[_0xfb22('0x38')]({},_0x1aa692,_0x12cabc['options']);return db[_0xfb22('0x29')][_0xfb22('0x44')](_0x1aa692)[_0xfb22('0x1f')](handleEntityNotFound(_0x20f6fe,null))['then'](respondWithResult(_0x20f6fe,null))[_0xfb22('0x40')](handleError(_0x20f6fe,null));};exports[_0xfb22('0x45')]=function(_0x89d7cf,_0x445f96){return db[_0xfb22('0x29')]['create'](_0x89d7cf['body'],{})[_0xfb22('0x1f')](function(_0x33acb6){var _0x4d15f9=_0x89d7cf[_0xfb22('0x46')]['get']({'plain':!![]});if(!_0x4d15f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d15f9[_0xfb22('0x47')]===_0xfb22('0x46')){var _0x56a596=_0x33acb6['get']({'plain':!![]});var _0x2352a3='Companies';return db['UserProfileSection'][_0xfb22('0x44')]({'where':{'name':_0x2352a3,'userProfileId':_0x4d15f9['userProfileId']},'raw':!![]})[_0xfb22('0x1f')](function(_0x59e4c9){if(_0x59e4c9&&_0x59e4c9[_0xfb22('0x48')]===0x0){return db[_0xfb22('0x21')][_0xfb22('0x45')]({'name':_0x56a596[_0xfb22('0x26')],'resourceId':_0x56a596['id'],'type':_0x59e4c9[_0xfb22('0x26')],'sectionId':_0x59e4c9['id']},{})[_0xfb22('0x1f')](function(){return _0x33acb6;});}else{return _0x33acb6;}})[_0xfb22('0x40')](function(_0xe4b2cd){logger['error'](_0xfb22('0x49'),_0xe4b2cd);throw _0xe4b2cd;});}return _0x33acb6;})[_0xfb22('0x1f')](respondWithResult(_0x445f96,0xc9))[_0xfb22('0x40')](handleError(_0x445f96,null));};exports['update']=function(_0x8b3132,_0x35fdea){if(_0x8b3132[_0xfb22('0x4a')]['id']){delete _0x8b3132[_0xfb22('0x4a')]['id'];}return db[_0xfb22('0x29')]['find']({'where':{'id':_0x8b3132[_0xfb22('0x42')]['id']}})[_0xfb22('0x1f')](handleEntityNotFound(_0x35fdea,null))[_0xfb22('0x1f')](saveUpdates(_0x8b3132[_0xfb22('0x4a')],null))[_0xfb22('0x1f')](respondWithResult(_0x35fdea,null))['catch'](handleError(_0x35fdea,null));};exports[_0xfb22('0x22')]=function(_0x3f4f5e,_0x328d3c){return db[_0xfb22('0x29')][_0xfb22('0x44')]({'where':{'id':_0x3f4f5e[_0xfb22('0x42')]['id']}})[_0xfb22('0x1f')](handleEntityNotFound(_0x328d3c,null))[_0xfb22('0x1f')](removeEntity(_0x328d3c,null))[_0xfb22('0x40')](handleError(_0x328d3c,null));};exports[_0xfb22('0x4b')]=function(_0x5dea68,_0x4c78e3,_0x2b9e9f){return db[_0xfb22('0x4c')]['find']({'where':{'id':_0x5dea68[_0xfb22('0x42')]['id']}})[_0xfb22('0x1f')](handleEntityNotFound(_0x4c78e3,null))['then'](function(_0x2040e3){if(_0x2040e3){return _0x2040e3[_0xfb22('0x4b')](_0x5dea68[_0xfb22('0x4a')][_0xfb22('0x4d')],_[_0xfb22('0x4e')](_0x5dea68[_0xfb22('0x4a')],[_0xfb22('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x4c78e3,null))['catch'](handleError(_0x4c78e3,null));};exports[_0xfb22('0x4f')]=function(_0x1b1c14,_0x5a70d0,_0x5af701){var _0x54c60d={};var _0x15df7d={};var _0x1d2be2;var _0x39cf30;return db[_0xfb22('0x29')][_0xfb22('0x50')]({'where':{'id':_0x1b1c14[_0xfb22('0x42')]['id']}})[_0xfb22('0x1f')](handleEntityNotFound(_0x5a70d0,null))[_0xfb22('0x1f')](function(_0x42ace6){if(_0x42ace6){_0x1d2be2=_0x42ace6;_0x15df7d[_0xfb22('0x2b')]=_[_0xfb22('0x2d')](db['CmContact'][_0xfb22('0x2a')]);_0x15df7d[_0xfb22('0x2c')]=_[_0xfb22('0x2d')](_0x1b1c14[_0xfb22('0x2c')]);_0x15df7d[_0xfb22('0x2e')]=_[_0xfb22('0x2f')](_0x15df7d[_0xfb22('0x2b')],_0x15df7d[_0xfb22('0x2c')]);_0x54c60d['attributes']=_[_0xfb22('0x2f')](_0x15df7d['model'],qs['fields'](_0x1b1c14[_0xfb22('0x2c')][_0xfb22('0x30')]));_0x54c60d[_0xfb22('0x31')]=_0x54c60d[_0xfb22('0x31')][_0xfb22('0x51')]?_0x54c60d[_0xfb22('0x31')]:_0x15df7d[_0xfb22('0x2b')];_0x54c60d[_0xfb22('0x34')]=qs['sort'](_0x1b1c14[_0xfb22('0x2c')][_0xfb22('0x35')]);_0x54c60d[_0xfb22('0x36')]=qs[_0xfb22('0x2e')](_[_0xfb22('0x52')](_0x1b1c14[_0xfb22('0x2c')],_0x15df7d[_0xfb22('0x2e')]));if(_0x1b1c14[_0xfb22('0x2c')][_0xfb22('0x37')]){_0x54c60d[_0xfb22('0x36')]=_[_0xfb22('0x38')](_0x54c60d[_0xfb22('0x36')],{'$or':_[_0xfb22('0x53')](_0x54c60d[_0xfb22('0x31')],function(_0x5d8f87){var _0x23823a={};_0x23823a[_0x5d8f87]={'$like':'%'+_0x1b1c14['query'][_0xfb22('0x37')]+'%'};return _0x23823a;})});}_0x54c60d=_[_0xfb22('0x38')]({},_0x54c60d,_0x1b1c14['options']);return _0x1d2be2[_0xfb22('0x4f')](_0x54c60d);}})['then'](function(_0x499cee){if(_0x499cee){_0x39cf30=_0x499cee[_0xfb22('0x51')];if(!_0x1b1c14['query'][_0xfb22('0x32')](_0xfb22('0x54'))){_0x54c60d['limit']=qs[_0xfb22('0x33')](_0x1b1c14['query'][_0xfb22('0x33')]);_0x54c60d['offset']=qs[_0xfb22('0x1a')](_0x1b1c14[_0xfb22('0x2c')][_0xfb22('0x1a')]);}return _0x1d2be2[_0xfb22('0x4f')](_0x54c60d);}})[_0xfb22('0x1f')](function(_0x2a7fa9){if(_0x2a7fa9){return _0x2a7fa9?{'count':_0x39cf30,'rows':_0x2a7fa9}:null;}})['then'](respondWithResult(_0x5a70d0,null))[_0xfb22('0x40')](handleError(_0x5a70d0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 627adac..d006688 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 _0x0c5d=['lodash','util','api','bluebird','request-promise','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x269480,_0x177242){var _0x5e026d=function(_0x3ea2c1){while(--_0x3ea2c1){_0x269480['push'](_0x269480['shift']());}};_0x5e026d(++_0x177242);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x2da525,_0x315a01){_0x2da525=_0x2da525-0x0;var _0xf0a632=_0x0c5d[_0x2da525];return _0xf0a632;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var logger=require('../../config/logger')(_0xd0c5('0x2'));var moment=require('moment');var BPromise=require(_0xd0c5('0x3'));var rp=require(_0xd0c5('0x4'));var attributes=require(_0xd0c5('0x5'));module[_0xd0c5('0x6')]=function(_0x4664bc,_0xc3a9b9){return _0x4664bc[_0xd0c5('0x7')](_0xd0c5('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01fe=['define','cm_companies','lodash','../../config/logger','api','request-promise','./cmCompany.attributes','exports'];(function(_0xd8f7bd,_0x45dc8c){var _0x1bd5ee=function(_0x20498e){while(--_0x20498e){_0xd8f7bd['push'](_0xd8f7bd['shift']());}};_0x1bd5ee(++_0x45dc8c);}(_0x01fe,0x102));var _0xe01f=function(_0xb80abb,_0x4c6989){_0xb80abb=_0xb80abb-0x0;var _0x39b1ac=_0x01fe[_0xb80abb];return _0x39b1ac;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var logger=require(_0xe01f('0x1'))(_0xe01f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe01f('0x3'));var attributes=require(_0xe01f('0x4'));module[_0xe01f('0x5')]=function(_0x92b885,_0x58223b){return _0x92b885[_0xe01f('0x6')]('CmCompany',attributes,{'tableName':_0xe01f('0x7'),'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 a861b14..43692ee 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 _0x186b=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf70fe9,_0x3a5c9a){var _0x568ba1=function(_0x4799a7){while(--_0x4799a7){_0xf70fe9['push'](_0xf70fe9['shift']());}};_0x568ba1(++_0x3a5c9a);}(_0x186b,0x16b));var _0xb186=function(_0x3055ab,_0x4d1f74){_0x3055ab=_0x3055ab-0x0;var _0x31d336=_0x186b[_0x3055ab];return _0x31d336;};'use strict';var _=require(_0xb186('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb186('0x1'));var rs=require(_0xb186('0x2'));var fs=require('fs');var Redis=require(_0xb186('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb186('0x4'));var logger=require('../../config/logger')(_0xb186('0x5'));var config=require('../../config/environment');var jayson=require(_0xb186('0x6'));var client=jayson['client'][_0xb186('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e7c03,_0x272553,_0xb29aee){return new BPromise(function(_0x4a668e,_0x12f9bb){return client[_0xb186('0x8')](_0x4e7c03,_0xb29aee)[_0xb186('0x9')](function(_0x4f6bb8){logger[_0xb186('0xa')](_0xb186('0xb'),_0x272553,_0xb186('0xc'));logger[_0xb186('0xd')](_0xb186('0xe'),_0x272553,_0xb186('0xc'),JSON[_0xb186('0xf')](_0x4f6bb8));if(_0x4f6bb8[_0xb186('0x10')]){if(_0x4f6bb8[_0xb186('0x10')]['code']===0x1f4){logger[_0xb186('0x10')](_0xb186('0xb'),_0x272553,_0x4f6bb8[_0xb186('0x10')][_0xb186('0x11')]);return _0x12f9bb(_0x4f6bb8[_0xb186('0x10')][_0xb186('0x11')]);}logger[_0xb186('0x10')](_0xb186('0xb'),_0x272553,_0x4f6bb8[_0xb186('0x10')][_0xb186('0x11')]);return _0x4a668e(_0x4f6bb8[_0xb186('0x10')]['message']);}else{logger[_0xb186('0xa')]('CmCompany,\x20%s,\x20%s',_0x272553,_0xb186('0xc'));_0x4a668e(_0x4f6bb8[_0xb186('0x12')][_0xb186('0x11')]);}})[_0xb186('0x13')](function(_0x1c6f6a){logger[_0xb186('0x10')](_0xb186('0xb'),_0x272553,_0x1c6f6a);_0x12f9bb(_0x1c6f6a);});});} \ No newline at end of file +var _0xd3f3=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird'];(function(_0x4e0b8c,_0x443f31){var _0x633ecc=function(_0x1f1f36){while(--_0x1f1f36){_0x4e0b8c['push'](_0x4e0b8c['shift']());}};_0x633ecc(++_0x443f31);}(_0xd3f3,0x81));var _0x3d3f=function(_0xacc5a1,_0x21a98b){_0xacc5a1=_0xacc5a1-0x0;var _0x5774aa=_0xd3f3[_0xacc5a1];return _0x5774aa;};'use strict';var _=require(_0x3d3f('0x0'));var util=require('util');var moment=require(_0x3d3f('0x1'));var BPromise=require(_0x3d3f('0x2'));var rs=require(_0x3d3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d3f('0x5'))(_0x3d3f('0x6'));var config=require(_0x3d3f('0x7'));var jayson=require(_0x3d3f('0x8'));var client=jayson[_0x3d3f('0x9')][_0x3d3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afd78,_0x3204cd,_0x2cc573){return new BPromise(function(_0x457141,_0xa4b2f8){return client['request'](_0x5afd78,_0x2cc573)[_0x3d3f('0xb')](function(_0x14dde2){logger['info'](_0x3d3f('0xc'),_0x3204cd,_0x3d3f('0xd'));logger['debug'](_0x3d3f('0xe'),_0x3204cd,_0x3d3f('0xd'),JSON[_0x3d3f('0xf')](_0x14dde2));if(_0x14dde2['error']){if(_0x14dde2[_0x3d3f('0x10')][_0x3d3f('0x11')]===0x1f4){logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x14dde2['error'][_0x3d3f('0x12')]);return _0xa4b2f8(_0x14dde2[_0x3d3f('0x10')]['message']);}logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x14dde2[_0x3d3f('0x10')][_0x3d3f('0x12')]);return _0x457141(_0x14dde2['error'][_0x3d3f('0x12')]);}else{logger[_0x3d3f('0x13')]('CmCompany,\x20%s,\x20%s',_0x3204cd,'request\x20sent');_0x457141(_0x14dde2[_0x3d3f('0x14')][_0x3d3f('0x12')]);}})[_0x3d3f('0x15')](function(_0x1d6e0a){logger[_0x3d3f('0x10')](_0x3d3f('0xc'),_0x3204cd,_0x1d6e0a);_0xa4b2f8(_0x1d6e0a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3bc3047..23a62f8 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 _0x2966=['connect-timeout','express','Router','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','show','getContacts','post','create','/:id/contacts','addContacts','/:id','delete','destroy','exports','multer','util'];(function(_0x59088a,_0x3924bf){var _0xe96936=function(_0x15a4ee){while(--_0x15a4ee){_0x59088a['push'](_0x59088a['shift']());}};_0xe96936(++_0x3924bf);}(_0x2966,0xc6));var _0x6296=function(_0x3f4bef,_0x359a87){_0x3f4bef=_0x3f4bef-0x0;var _0x1989b7=_0x2966[_0x3f4bef];return _0x1989b7;};'use strict';var multer=require(_0x6296('0x0'));var util=require(_0x6296('0x1'));var path=require('path');var timeout=require(_0x6296('0x2'));var express=require(_0x6296('0x3'));var router=express[_0x6296('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6296('0x5'));var controller=require(_0x6296('0x6'));router[_0x6296('0x7')]('/',auth['isAuthenticated'](),controller[_0x6296('0x8')]);router[_0x6296('0x7')]('/:id',auth[_0x6296('0x9')](),controller[_0x6296('0xa')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x6296('0xb')]);router[_0x6296('0xc')]('/',auth['isAuthenticated'](),controller[_0x6296('0xd')]);router['post'](_0x6296('0xe'),auth[_0x6296('0x9')](),controller[_0x6296('0xf')]);router['put'](_0x6296('0x10'),auth[_0x6296('0x9')](),controller['update']);router[_0x6296('0x11')](_0x6296('0x10'),auth[_0x6296('0x9')](),controller[_0x6296('0x12')]);module[_0x6296('0x13')]=router; \ No newline at end of file +var _0x48eb=['../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x1f04a0,_0x44ab02){var _0x4a99f5=function(_0x111740){while(--_0x111740){_0x1f04a0['push'](_0x1f04a0['shift']());}};_0x4a99f5(++_0x44ab02);}(_0x48eb,0x1f3));var _0xb48e=function(_0x100ee1,_0x563957){_0x100ee1=_0x100ee1-0x0;var _0x599624=_0x48eb[_0x100ee1];return _0x599624;};'use strict';var multer=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb48e('0x2'));var router=express[_0xb48e('0x3')]();var auth=require(_0xb48e('0x4'));var interaction=require(_0xb48e('0x5'));var config=require(_0xb48e('0x6'));var controller=require(_0xb48e('0x7'));router['get']('/',auth[_0xb48e('0x8')](),controller['index']);router[_0xb48e('0x9')](_0xb48e('0xa'),auth[_0xb48e('0x8')](),controller[_0xb48e('0xb')]);router[_0xb48e('0x9')](_0xb48e('0xc'),auth[_0xb48e('0x8')](),controller[_0xb48e('0xd')]);router[_0xb48e('0xe')]('/',auth[_0xb48e('0x8')](),controller[_0xb48e('0xf')]);router[_0xb48e('0xe')](_0xb48e('0xc'),auth[_0xb48e('0x8')](),controller[_0xb48e('0x10')]);router[_0xb48e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb48e('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb48e('0x13')]);module[_0xb48e('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e05db79..66143a4 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 _0x3883=['NOW','lodash','sequelize','STRING','TEXT','DATE'];(function(_0x31d170,_0x46d9f6){var _0x3f591c=function(_0x4491d7){while(--_0x4491d7){_0x31d170['push'](_0x31d170['shift']());}};_0x3f591c(++_0x46d9f6);}(_0x3883,0x169));var _0x3388=function(_0x5a0c6e,_0x2ec3a5){_0x5a0c6e=_0x5a0c6e-0x0;var _0x26c757=_0x3883[_0x5a0c6e];return _0x26c757;};'use strict';var _=require(_0x3388('0x0'));var Sequelize=require(_0x3388('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x3388('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3388('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3388('0x2')]},'city':{'type':Sequelize[_0x3388('0x2')]},'country':{'type':Sequelize[_0x3388('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3388('0x2')]},'description':{'type':Sequelize[_0x3388('0x3')]},'phone':{'type':Sequelize[_0x3388('0x2')]},'mobile':{'type':Sequelize[_0x3388('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3388('0x2')]},'url':{'type':Sequelize[_0x3388('0x2')]},'facebook':{'type':Sequelize[_0x3388('0x2')]},'fb_data':{'type':Sequelize[_0x3388('0x2')]},'twitter':{'type':Sequelize[_0x3388('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3388('0x2')]},'viber':{'type':Sequelize[_0x3388('0x2')]},'line':{'type':Sequelize[_0x3388('0x2')]},'wechat':{'type':Sequelize[_0x3388('0x2')]},'telegram':{'type':Sequelize[_0x3388('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3388('0x4')],'defaultValue':Sequelize[_0x3388('0x5')]}}; \ No newline at end of file +var _0xe5e8=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x1fa50f,_0x248ae0){var _0x5c43d0=function(_0x26ff3f){while(--_0x26ff3f){_0x1fa50f['push'](_0x1fa50f['shift']());}};_0x5c43d0(++_0x248ae0);}(_0xe5e8,0x160));var _0x8e5e=function(_0x5563e6,_0x2ca166){_0x5563e6=_0x5563e6-0x0;var _0x1596b1=_0xe5e8[_0x5563e6];return _0x1596b1;};'use strict';var _=require(_0x8e5e('0x0'));var Sequelize=require(_0x8e5e('0x1'));module[_0x8e5e('0x2')]={'firstName':{'type':Sequelize[_0x8e5e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8e5e('0x3')]},'street':{'type':Sequelize[_0x8e5e('0x3')]},'postalCode':{'type':Sequelize[_0x8e5e('0x3')]},'city':{'type':Sequelize[_0x8e5e('0x3')]},'country':{'type':Sequelize[_0x8e5e('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e5e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8e5e('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x8e5e('0x3')]},'fb_data':{'type':Sequelize[_0x8e5e('0x3')]},'twitter':{'type':Sequelize[_0x8e5e('0x3')]},'skype':{'type':Sequelize[_0x8e5e('0x3')]},'teams':{'type':Sequelize[_0x8e5e('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x8e5e('0x3')]},'wechat':{'type':Sequelize[_0x8e5e('0x3')]},'telegram':{'type':Sequelize[_0x8e5e('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x8e5e('0x5')](0x2)[_0x8e5e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8e5e('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4dab688..c7f68e8 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 _0x4ccc=['info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','ListId','$and','omit','map','pickBy','format','cf_%d','isEmpty','table','cm_contacts','id\x20=\x20?','sequelize','text','values','phone','CmHopper','getTags','findOne','rawAttributes','setTags','ids','ContactId','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','meta','import','User','agent','No\x20phone\x20column\x20specified','firstName','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','json','count','offset','Content-Range','reject','save','then','error','stack','name','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','tag','push','Tag','distinct','CmContact','includeAll','Tags','ThroughTags','color','findAll','rows','catch','destroy','find','params','describe','length','startsWith','cf_','displayName','CmCustomField','columnName','alias','body','from','get','mergeWith','isArray','tags','join'];(function(_0x45c0ce,_0x299fa9){var _0x16304f=function(_0x45224b){while(--_0x45224b){_0x45c0ce['push'](_0x45c0ce['shift']());}};_0x16304f(++_0x299fa9);}(_0x4ccc,0x107));var _0xc4cc=function(_0x449385,_0x5beeb1){_0x449385=_0x449385-0x0;var _0x2b10d7=_0x4ccc[_0x449385];return _0x2b10d7;};'use strict';var pdf=require(_0xc4cc('0x0'));var emlformat=require(_0xc4cc('0x1'));var rimraf=require(_0xc4cc('0x2'));var zipdir=require(_0xc4cc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4cc('0x4'));var moment=require(_0xc4cc('0x5'));var BPromise=require(_0xc4cc('0x6'));var Mustache=require(_0xc4cc('0x7'));var util=require(_0xc4cc('0x8'));var path=require(_0xc4cc('0x9'));var sox=require(_0xc4cc('0xa'));var csv=require(_0xc4cc('0xb'));var ejs=require(_0xc4cc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc4cc('0xd'));var crypto=require(_0xc4cc('0xe'));var jsforce=require(_0xc4cc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc4cc('0x10'));var Papa=require(_0xc4cc('0x11'));var authService=require(_0xc4cc('0x12'));var hardwareService=require(_0xc4cc('0x13'));var Redis=require('ioredis');var qs=require(_0xc4cc('0x14'));var logger=require(_0xc4cc('0x15'))(_0xc4cc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc4cc('0x17')](config['redis'],{'host':_0xc4cc('0x18'),'port':0x18eb});var socket=require(_0xc4cc('0x19'))(new Redis(config[_0xc4cc('0x1a')]));require(_0xc4cc('0x1b'))[_0xc4cc('0x1c')](socket);function respondWithStatusCode(_0x3a52bd,_0x4571b9){_0x4571b9=_0x4571b9||0xcc;return function(_0x19acbd){if(_0x19acbd){return _0x3a52bd[_0xc4cc('0x1d')](_0x4571b9);}return _0x3a52bd[_0xc4cc('0x1e')](_0x4571b9)['end']();};}function respondWithResult(_0x14723c,_0x3c2814){_0x3c2814=_0x3c2814||0xc8;return function(_0x14b249){if(_0x14b249){return _0x14723c['status'](_0x3c2814)[_0xc4cc('0x1f')](_0x14b249);}};}function respondWithFilteredResult(_0x26169c,_0x45782c){return function(_0x39122f){if(_0x39122f){var _0x4b853a=_0x39122f[_0xc4cc('0x20')],_0x552250=_0x45782c['offset'],_0xab9193=_0x45782c[_0xc4cc('0x21')]+_0x45782c['limit'],_0x288fdd;if(_0xab9193>=_0x4b853a){_0xab9193=_0x4b853a;_0x288fdd=0xc8;}else{_0x288fdd=0xce;}_0x26169c[_0xc4cc('0x1e')](_0x288fdd);return _0x26169c['set'](_0xc4cc('0x22'),_0x552250+'-'+_0xab9193+'/'+_0x4b853a)[_0xc4cc('0x1f')](_0x39122f);}return null;};}function patchUpdates(_0x22eff3){return function(_0x4816ae){try{jsonpatch['apply'](_0x4816ae,_0x22eff3,!![]);}catch(_0x2ca72f){return BPromise[_0xc4cc('0x23')](_0x2ca72f);}return _0x4816ae[_0xc4cc('0x24')]();};}function saveUpdates(_0x3a5f29,_0x5a06b6){return function(_0x1e2bf7){if(_0x1e2bf7){return _0x1e2bf7['update'](_0x3a5f29)['then'](function(_0x3bb406){return _0x3bb406;});}return null;};}function removeEntity(_0x142280,_0x2b97c0){return function(_0x33daa5){if(_0x33daa5){return _0x33daa5['destroy']()[_0xc4cc('0x25')](function(){_0x142280[_0xc4cc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11db33,_0xd736b9){return function(_0x186066){if(!_0x186066){_0x11db33['sendStatus'](0x194);}return _0x186066;};}function handleError(_0x9f1d11,_0x39d834){_0x39d834=_0x39d834||0x1f4;return function(_0x2e7372){logger[_0xc4cc('0x26')](_0x2e7372[_0xc4cc('0x27')]);if(_0x2e7372['name']){delete _0x2e7372[_0xc4cc('0x28')];}_0x9f1d11[_0xc4cc('0x1e')](_0x39d834)['send'](_0x2e7372);};}exports['index']=function(_0x7e7aad,_0x23ddb2){var _0x330298={},_0x1dd8eb={},_0x1e529a={'count':0x0,'rows':[]};return db['CmContact']['describe']()['then'](function(_0x565ef2){_0x1dd8eb[_0xc4cc('0x29')]=_[_0xc4cc('0x2a')](_0x565ef2);_0x1dd8eb[_0xc4cc('0x2b')]=_[_0xc4cc('0x2a')](_0x7e7aad[_0xc4cc('0x2b')]);_0x1dd8eb[_0xc4cc('0x2c')]=_[_0xc4cc('0x2d')](_0x1dd8eb['model'],_0x1dd8eb['query']);_0x330298['attributes']=_[_0xc4cc('0x2d')](_0x1dd8eb[_0xc4cc('0x29')],qs[_0xc4cc('0x2e')](_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x2e')]));_0x330298[_0xc4cc('0x2f')]=_0x330298['attributes']['length']?_0x330298['attributes']:_0x1dd8eb[_0xc4cc('0x29')];if(!_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x30')](_0xc4cc('0x31'))){_0x330298[_0xc4cc('0x32')]=qs[_0xc4cc('0x32')](_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x32')]);_0x330298[_0xc4cc('0x21')]=qs[_0xc4cc('0x21')](_0x7e7aad['query'][_0xc4cc('0x21')]);}_0x330298[_0xc4cc('0x33')]=qs['sort'](_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x34')]);_0x330298[_0xc4cc('0x35')]=qs[_0xc4cc('0x2c')](_[_0xc4cc('0x36')](_0x7e7aad[_0xc4cc('0x2b')],_0x1dd8eb[_0xc4cc('0x2c')]));if(_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x37')]){_0x330298[_0xc4cc('0x35')]=_[_0xc4cc('0x38')](_0x330298[_0xc4cc('0x35')],{'$or':_['map'](_0x330298['attributes'],function(_0x4bcaf0){var _0x297dca={};_0x297dca[_0x4bcaf0]={'$like':'%'+_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x37')]+'%'};return _0x297dca;})});}_0x330298=_[_0xc4cc('0x38')]({},_0x330298,_0x7e7aad[_0xc4cc('0x39')]);var _0x4a879b={'where':_0x330298['where']};_0x4a879b[_0xc4cc('0x3a')]=[];if(_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x3b')]){_0x4a879b[_0xc4cc('0x3a')][_0xc4cc('0x3c')]({'model':db[_0xc4cc('0x3d')],'as':'Tags','attributes':['id'],'where':{'id':_0x7e7aad['query'][_0xc4cc('0x3b')]},'required':!![]});_0x4a879b[_0xc4cc('0x3e')]=!![];}return db[_0xc4cc('0x3f')]['count'](_0x4a879b)[_0xc4cc('0x25')](function(_0x4c5a33){_0x1e529a[_0xc4cc('0x20')]=_0x4c5a33;if(_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x40')]){_0x330298['include']=[{'model':db[_0xc4cc('0x3d')],'as':_0xc4cc('0x41'),'attributes':['id','name','color'],'required':_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x3b')]?!![]:![]},{'model':db['Tag'],'as':_0xc4cc('0x42'),'attributes':['id',_0xc4cc('0x28'),_0xc4cc('0x43')],'through':_0x7e7aad[_0xc4cc('0x2b')]['tag']?{'attributes':[],'where':{'TagId':_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x3b')]||undefined}}:{},'required':_0x7e7aad[_0xc4cc('0x2b')][_0xc4cc('0x3b')]?!![]:![]}];}return db[_0xc4cc('0x3f')][_0xc4cc('0x44')](_0x330298);})[_0xc4cc('0x25')](function(_0x4f67b3){_0x1e529a[_0xc4cc('0x45')]=_0x4f67b3;return _0x1e529a;})[_0xc4cc('0x25')](respondWithFilteredResult(_0x23ddb2,_0x330298))[_0xc4cc('0x46')](handleError(_0x23ddb2,null));});};exports[_0xc4cc('0x47')]=function(_0x1b2883,_0x5674cd){return db[_0xc4cc('0x3f')][_0xc4cc('0x48')]({'where':{'id':_0x1b2883[_0xc4cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x5674cd,null))[_0xc4cc('0x25')](removeEntity(_0x5674cd,null))[_0xc4cc('0x46')](handleError(_0x5674cd,null));};exports[_0xc4cc('0x4a')]=function(_0x638b2d,_0x4f1ed9){return db[_0xc4cc('0x3f')][_0xc4cc('0x4a')]()['then'](function(_0x317434){for(var _0x121483=0x0;_0x121483=_0x9081ff){_0x3a6cc5=_0x9081ff;_0x598afa=0xc8;}else{_0x598afa=0xce;}_0x2bc6ff[_0xbfd0('0x1e')](_0x598afa);return _0x2bc6ff[_0xbfd0('0x23')](_0xbfd0('0x24'),_0x3ee46f+'-'+_0x3a6cc5+'/'+_0x9081ff)[_0xbfd0('0x1f')](_0x11281f);}return null;};}function patchUpdates(_0x5894ed){return function(_0x538272){try{jsonpatch[_0xbfd0('0x25')](_0x538272,_0x5894ed,!![]);}catch(_0x5ed1e5){return BPromise[_0xbfd0('0x26')](_0x5ed1e5);}return _0x538272[_0xbfd0('0x27')]();};}function saveUpdates(_0x1e87d3,_0x42c116){return function(_0xc96985){if(_0xc96985){return _0xc96985[_0xbfd0('0x28')](_0x1e87d3)[_0xbfd0('0x29')](function(_0xf7351f){return _0xf7351f;});}return null;};}function removeEntity(_0x230260,_0x1cabe4){return function(_0x58c6b5){if(_0x58c6b5){return _0x58c6b5[_0xbfd0('0x2a')]()[_0xbfd0('0x29')](function(){_0x230260[_0xbfd0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44054d,_0x5db5b5){return function(_0x4d93f4){if(!_0x4d93f4){_0x44054d[_0xbfd0('0x2b')](0x194);}return _0x4d93f4;};}function handleError(_0x33a0a4,_0x6f0d94){_0x6f0d94=_0x6f0d94||0x1f4;return function(_0x465811){logger[_0xbfd0('0x2c')](_0x465811[_0xbfd0('0x2d')]);if(_0x465811[_0xbfd0('0x2e')]){delete _0x465811[_0xbfd0('0x2e')];}_0x33a0a4[_0xbfd0('0x1e')](_0x6f0d94)[_0xbfd0('0x2f')](_0x465811);};}exports[_0xbfd0('0x30')]=function(_0x435bc2,_0x114f43){var _0x483bc6={},_0x2177b2={},_0x4c320b={'count':0x0,'rows':[]};return db[_0xbfd0('0x31')][_0xbfd0('0x32')]()[_0xbfd0('0x29')](function(_0x521d69){_0x2177b2['model']=_[_0xbfd0('0x33')](_0x521d69);_0x2177b2[_0xbfd0('0x34')]=_[_0xbfd0('0x33')](_0x435bc2['query']);_0x2177b2['filters']=_[_0xbfd0('0x35')](_0x2177b2[_0xbfd0('0x36')],_0x2177b2[_0xbfd0('0x34')]);_0x483bc6['attributes']=_[_0xbfd0('0x35')](_0x2177b2[_0xbfd0('0x36')],qs['fields'](_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x37')]));_0x483bc6[_0xbfd0('0x38')]=_0x483bc6[_0xbfd0('0x38')][_0xbfd0('0x39')]?_0x483bc6[_0xbfd0('0x38')]:_0x2177b2[_0xbfd0('0x36')];if(!_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x3a')](_0xbfd0('0x3b'))){_0x483bc6['limit']=qs[_0xbfd0('0x22')](_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x22')]);_0x483bc6[_0xbfd0('0x21')]=qs[_0xbfd0('0x21')](_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x21')]);}_0x483bc6[_0xbfd0('0x3c')]=qs[_0xbfd0('0x3d')](_0x435bc2[_0xbfd0('0x34')]['sort']);_0x483bc6[_0xbfd0('0x3e')]=qs[_0xbfd0('0x3f')](_[_0xbfd0('0x40')](_0x435bc2[_0xbfd0('0x34')],_0x2177b2[_0xbfd0('0x3f')]));if(_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x41')]){_0x483bc6[_0xbfd0('0x3e')]=_['merge'](_0x483bc6[_0xbfd0('0x3e')],{'$or':_[_0xbfd0('0x42')](_0x483bc6[_0xbfd0('0x38')],function(_0x2c7da3){var _0x1ada9b={};_0x1ada9b[_0x2c7da3]={'$like':'%'+_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x41')]+'%'};return _0x1ada9b;})});}_0x483bc6=_[_0xbfd0('0x43')]({},_0x483bc6,_0x435bc2[_0xbfd0('0x44')]);var _0x40db1f={'where':_0x483bc6['where']};_0x40db1f['include']=[];if(_0x435bc2[_0xbfd0('0x34')]['tag']){_0x40db1f[_0xbfd0('0x45')][_0xbfd0('0x46')]({'model':db['Tag'],'as':_0xbfd0('0x47'),'attributes':['id'],'where':{'id':_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x48')]},'required':!![]});_0x40db1f[_0xbfd0('0x49')]=!![];}return db['CmContact'][_0xbfd0('0x20')](_0x40db1f)['then'](function(_0xb29845){_0x4c320b[_0xbfd0('0x20')]=_0xb29845;if(_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x4a')]){_0x483bc6[_0xbfd0('0x45')]=[{'model':db[_0xbfd0('0x4b')],'as':_0xbfd0('0x47'),'attributes':['id',_0xbfd0('0x2e'),'color'],'required':_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x48')]?!![]:![]},{'model':db[_0xbfd0('0x4b')],'as':_0xbfd0('0x4c'),'attributes':['id',_0xbfd0('0x2e'),_0xbfd0('0x4d')],'through':_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x48')]?{'attributes':[],'where':{'TagId':_0x435bc2['query'][_0xbfd0('0x48')]||undefined}}:{},'required':_0x435bc2[_0xbfd0('0x34')][_0xbfd0('0x48')]?!![]:![]}];}return db[_0xbfd0('0x31')][_0xbfd0('0x4e')](_0x483bc6);})['then'](function(_0x508a9b){_0x4c320b[_0xbfd0('0x4f')]=_0x508a9b;return _0x4c320b;})[_0xbfd0('0x29')](respondWithFilteredResult(_0x114f43,_0x483bc6))['catch'](handleError(_0x114f43,null));});};exports[_0xbfd0('0x2a')]=function(_0x14bec3,_0x487081){return db[_0xbfd0('0x31')][_0xbfd0('0x50')]({'where':{'id':_0x14bec3[_0xbfd0('0x51')]['id']}})[_0xbfd0('0x29')](handleEntityNotFound(_0x487081,null))[_0xbfd0('0x29')](removeEntity(_0x487081,null))[_0xbfd0('0x52')](handleError(_0x487081,null));};exports[_0xbfd0('0x32')]=function(_0x2e9570,_0x11cfb6){return db[_0xbfd0('0x31')][_0xbfd0('0x32')]()[_0xbfd0('0x29')](function(_0x5181e0){for(var _0x2e0434=0x0;_0x2e0434{}\s\\|]/g,'-');_0x5e6886(null,util[_0xd53d('0x1e')](_0xd53d('0x1f'),path[_0xd53d('0x20')](_0x1f2886[_0xd53d('0x1c')],path['extname'](_0x1f2886[_0xd53d('0x1c')])),Date[_0xd53d('0x21')](),path['extname'](_0x1f2886['originalname'])));}})});router['post']('/csv',upload['single'](_0xd53d('0x22')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5609f7,_0x503cd0,_0x42d4c1){_0x42d4c1(null,path[_0xd53d('0x19')](config[_0xd53d('0x1a')],_0xd53d('0x1b')));},'filename':function(_0x2cb764,_0x1a183b,_0x425903){_0x1a183b[_0xd53d('0x1c')]=_0x1a183b[_0xd53d('0x1c')][_0xd53d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x425903(null,util['format'](_0xd53d('0x1f'),path[_0xd53d('0x20')](_0x1a183b[_0xd53d('0x1c')],path['extname'](_0x1a183b[_0xd53d('0x1c')])),Date[_0xd53d('0x21')](),path['extname'](_0x1a183b[_0xd53d('0x1c')])));}})});router[_0xd53d('0x11')](_0xd53d('0x23'),upload[_0xd53d('0x24')](_0xd53d('0x22')),controller[_0xd53d('0x25')]);router[_0xd53d('0x11')](_0xd53d('0x26'),auth['isAuthenticated'](),controller[_0xd53d('0x27')]);router[_0xd53d('0x28')](_0xd53d('0x29'),auth['isAuthenticated'](),controller[_0xd53d('0x2a')]);router['delete'](_0xd53d('0x29'),auth[_0xd53d('0x8')](),controller[_0xd53d('0x2b')]);module[_0xd53d('0x2c')]=router; \ No newline at end of file +var _0x62b3=['/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','/create_many','bulkCreate','join','root','server/files/tmp','originalname','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','diskStorage','replace','format','/upload','/upload/:id','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x62b3,0x19c));var _0x362b=function(_0xc9181b,_0x1a3744){_0xc9181b=_0xc9181b-0x0;var _0x563e9d=_0x62b3[_0xc9181b];return _0x563e9d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x362b('0x0'));var express=require(_0x362b('0x1'));var router=express[_0x362b('0x2')]();var auth=require(_0x362b('0x3'));var interaction=require(_0x362b('0x4'));var config=require('../../config/environment');var controller=require(_0x362b('0x5'));router[_0x362b('0x6')]('/',auth[_0x362b('0x7')](),controller[_0x362b('0x8')]);router[_0x362b('0x6')](_0x362b('0x9'),auth['isAuthenticated'](),controller[_0x362b('0xa')]);router[_0x362b('0x6')](_0x362b('0xb'),auth[_0x362b('0x7')](),controller['show']);router[_0x362b('0x6')](_0x362b('0xc'),auth[_0x362b('0x7')](),controller[_0x362b('0xd')]);router[_0x362b('0x6')](_0x362b('0xe'),auth[_0x362b('0x7')](),controller[_0x362b('0xf')]);router[_0x362b('0x6')](_0x362b('0x10'),auth[_0x362b('0x7')](),controller[_0x362b('0x11')]);router[_0x362b('0x6')](_0x362b('0x12'),auth['isAuthenticated'](),controller[_0x362b('0x13')]);router[_0x362b('0x6')](_0x362b('0x14'),auth[_0x362b('0x7')](),controller[_0x362b('0x15')]);router[_0x362b('0x16')](_0x362b('0x17'),auth[_0x362b('0x7')](),controller[_0x362b('0x18')]);router[_0x362b('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x362b('0x16')](_0x362b('0x19'),auth[_0x362b('0x7')](),controller[_0x362b('0x1a')]);router[_0x362b('0x16')](_0x362b('0xc'),auth[_0x362b('0x7')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x195137,_0x4fa392,_0x39fd47){_0x39fd47(null,path[_0x362b('0x1b')](config[_0x362b('0x1c')],_0x362b('0x1d')));},'filename':function(_0x1dce5b,_0x87e53a,_0xc1af07){_0x87e53a[_0x362b('0x1e')]=_0x87e53a['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc1af07(null,util['format'](_0x362b('0x1f'),path[_0x362b('0x20')](_0x87e53a[_0x362b('0x1e')],path[_0x362b('0x21')](_0x87e53a[_0x362b('0x1e')])),Date[_0x362b('0x22')](),path[_0x362b('0x21')](_0x87e53a[_0x362b('0x1e')])));}})});router[_0x362b('0x16')](_0x362b('0x23'),upload[_0x362b('0x24')](_0x362b('0x25')),controller[_0x362b('0x26')]);var upload=multer({'storage':multer[_0x362b('0x27')]({'destination':function(_0x21cced,_0x4b7cce,_0x1cd950){_0x1cd950(null,path[_0x362b('0x1b')](config['root'],_0x362b('0x1d')));},'filename':function(_0x6e556d,_0x55174e,_0x334129){_0x55174e[_0x362b('0x1e')]=_0x55174e[_0x362b('0x1e')][_0x362b('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x334129(null,util[_0x362b('0x29')](_0x362b('0x1f'),path[_0x362b('0x20')](_0x55174e[_0x362b('0x1e')],path[_0x362b('0x21')](_0x55174e['originalname'])),Date[_0x362b('0x22')](),path['extname'](_0x55174e[_0x362b('0x1e')])));}})});router[_0x362b('0x16')](_0x362b('0x2a'),upload[_0x362b('0x24')]('file'),controller['upload']);router[_0x362b('0x16')](_0x362b('0x2b'),auth[_0x362b('0x7')](),controller['import']);router['put'](_0x362b('0xb'),auth[_0x362b('0x7')](),controller['update']);router[_0x362b('0x2c')](_0x362b('0xb'),auth[_0x362b('0x7')](),controller[_0x362b('0x2d')]);module[_0x362b('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 418e39e..1192591 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 _0x7487=['long','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT'];(function(_0xe7925a,_0x584cb6){var _0x5e4728=function(_0x426369){while(--_0x426369){_0xe7925a['push'](_0xe7925a['shift']());}};_0x5e4728(++_0x584cb6);}(_0x7487,0x97));var _0x7748=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0x7487[_0x488ca1];return _0x4dd0a4;};'use strict';var Sequelize=require(_0x7748('0x0'));var _=require(_0x7748('0x1'));module['exports']={'name':{'type':Sequelize[_0x7748('0x2')],'get':function(_0x2e0225){return this[_0x7748('0x3')](_0x7748('0x4'));}},'alias':{'type':Sequelize[_0x7748('0x5')],'allowNull':![],'set':function(_0x502b26){this[_0x7748('0x6')](_0x7748('0x4'),_0x502b26?_0x502b26:this[_0x7748('0x3')](_0x7748('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x7748('0x8')](_0x7748('0x9')),'get':function(){if(this[_0x7748('0x3')]('type')===_0x7748('0xa')){return JSON[_0x7748('0xb')](this[_0x7748('0x3')]('values'));}else{return this[_0x7748('0x3')](_0x7748('0xc'));}},'set':function(_0x23c642){if(Array[_0x7748('0xd')](_0x23c642)){this[_0x7748('0x6')]('values',JSON[_0x7748('0xe')](_0x23c642));}else{this['setDataValue'](_0x7748('0xc'),_0x23c642);}}},'required':{'type':Sequelize[_0x7748('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x6514=['getDataValue','TEXT','type','select','parse','values','BOOLEAN','sequelize','lodash','exports','alias','STRING','setDataValue'];(function(_0x434f53,_0x4204de){var _0x3f6bbc=function(_0x31676f){while(--_0x31676f){_0x434f53['push'](_0x434f53['shift']());}};_0x3f6bbc(++_0x4204de);}(_0x6514,0x1c1));var _0x4651=function(_0x41b2c3,_0x487c3b){_0x41b2c3=_0x41b2c3-0x0;var _0x17167a=_0x6514[_0x41b2c3];return _0x17167a;};'use strict';var Sequelize=require(_0x4651('0x0'));var _=require(_0x4651('0x1'));module[_0x4651('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xf46b6b){return this['getDataValue'](_0x4651('0x3'));}},'alias':{'type':Sequelize[_0x4651('0x4')],'allowNull':![],'set':function(_0x1e825c){this[_0x4651('0x5')](_0x4651('0x3'),_0x1e825c?_0x1e825c:this[_0x4651('0x6')]('name'));}},'type':{'type':Sequelize[_0x4651('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x4651('0x7')]('long'),'get':function(){if(this[_0x4651('0x6')](_0x4651('0x8'))===_0x4651('0x9')){return JSON[_0x4651('0xa')](this[_0x4651('0x6')](_0x4651('0xb')));}else{return this[_0x4651('0x6')](_0x4651('0xb'));}},'set':function(_0x5db6c7){if(Array['isArray'](_0x5db6c7)){this[_0x4651('0x5')]('values',JSON['stringify'](_0x5db6c7));}else{this[_0x4651('0x5')](_0x4651('0xb'),_0x5db6c7);}}},'required':{'type':Sequelize[_0x4651('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index e8ae9bd..a390faf 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 _0xc00d=['CmCustomField','includeAll','include','rows','show','params','options','find','catch','body','create','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','format','html-pdf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','map','type','key','field','where'];(function(_0x456fcb,_0x4bfdb9){var _0x124da9=function(_0x3f9fab){while(--_0x3f9fab){_0x456fcb['push'](_0x456fcb['shift']());}};_0x124da9(++_0x4bfdb9);}(_0xc00d,0x1a5));var _0xdc00=function(_0x2eb0d0,_0x4fc83c){_0x2eb0d0=_0x2eb0d0-0x0;var _0x41e53e=_0xc00d[_0x2eb0d0];return _0x41e53e;};'use strict';var pdf=require(_0xdc00('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdc00('0x1'));var rp=require(_0xdc00('0x2'));var moment=require('moment');var BPromise=require(_0xdc00('0x3'));var Mustache=require(_0xdc00('0x4'));var util=require('util');var path=require(_0xdc00('0x5'));var sox=require(_0xdc00('0x6'));var csv=require(_0xdc00('0x7'));var ejs=require(_0xdc00('0x8'));var fs=require('fs');var _=require(_0xdc00('0x9'));var squel=require(_0xdc00('0xa'));var crypto=require(_0xdc00('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc00('0xc'));var toCsv=require(_0xdc00('0x7'));var querystring=require(_0xdc00('0xd'));var Papa=require('papaparse');var authService=require(_0xdc00('0xe'));var hardwareService=require(_0xdc00('0xf'));var Redis=require('ioredis');var qs=require(_0xdc00('0x10'));var logger=require('../../config/logger')(_0xdc00('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdc00('0x12'))['db'];function respondWithStatusCode(_0x370030,_0x5f343b){_0x5f343b=_0x5f343b||0xcc;return function(_0x1e4aec){if(_0x1e4aec){return _0x370030[_0xdc00('0x13')](_0x5f343b);}return _0x370030[_0xdc00('0x14')](_0x5f343b)[_0xdc00('0x15')]();};}function respondWithResult(_0x28ee9d,_0x3748de){_0x3748de=_0x3748de||0xc8;return function(_0x181ed9){if(_0x181ed9){return _0x28ee9d[_0xdc00('0x14')](_0x3748de)[_0xdc00('0x16')](_0x181ed9);}};}function respondWithFilteredResult(_0xc9e4c2,_0x2a20ef){return function(_0x24ca85){if(_0x24ca85){var _0x528037=_0x24ca85[_0xdc00('0x17')],_0x27903f=_0x2a20ef['offset'],_0x4a3638=_0x2a20ef[_0xdc00('0x18')]+_0x2a20ef['limit'],_0x2aaa72;if(_0x4a3638>=_0x528037){_0x4a3638=_0x528037;_0x2aaa72=0xc8;}else{_0x2aaa72=0xce;}_0xc9e4c2[_0xdc00('0x14')](_0x2aaa72);return _0xc9e4c2[_0xdc00('0x19')](_0xdc00('0x1a'),_0x27903f+'-'+_0x4a3638+'/'+_0x528037)['json'](_0x24ca85);}return null;};}function patchUpdates(_0x540271){return function(_0x28310b){try{jsonpatch[_0xdc00('0x1b')](_0x28310b,_0x540271,!![]);}catch(_0x5b022e){return BPromise[_0xdc00('0x1c')](_0x5b022e);}return _0x28310b[_0xdc00('0x1d')]();};}function saveUpdates(_0x1397c3,_0x5776d7){return function(_0x3db785){if(_0x3db785){return _0x3db785[_0xdc00('0x1e')](_0x1397c3)[_0xdc00('0x1f')](function(_0x4a47de){return _0x4a47de;});}return null;};}function removeEntity(_0x2384ff,_0x29de2a){return function(_0x58cdee){if(_0x58cdee){return _0x58cdee[_0xdc00('0x20')]()[_0xdc00('0x1f')](function(){_0x2384ff[_0xdc00('0x14')](0xcc)[_0xdc00('0x15')]();});}};}function handleEntityNotFound(_0x6ce55f,_0x18f4a7){return function(_0x5dde61){if(!_0x5dde61){_0x6ce55f[_0xdc00('0x13')](0x194);}return _0x5dde61;};}function handleError(_0x1d9bc7,_0x398bea){_0x398bea=_0x398bea||0x1f4;return function(_0x45212a){logger[_0xdc00('0x21')](_0x45212a['stack']);if(_0x45212a[_0xdc00('0x22')]){delete _0x45212a['name'];}_0x1d9bc7['status'](_0x398bea)[_0xdc00('0x23')](_0x45212a);};}exports['index']=function(_0x288ca0,_0x5daddd){var _0x1ad93b={},_0x5b59a8={},_0x4014d9={'count':0x0,'rows':[]};var _0x512f9f=db['CmCustomField'][_0xdc00('0x24')];_0x5b59a8[_0xdc00('0x25')]=_[_0xdc00('0x26')](_[_0xdc00('0x27')](_0x512f9f),['name']);_0x5b59a8[_0xdc00('0x28')]=_['keys'](_0x288ca0['query']);_0x5b59a8[_0xdc00('0x29')]=_[_0xdc00('0x2a')](_0x5b59a8[_0xdc00('0x25')],_0x5b59a8['query']);_0x1ad93b['attributes']=_['intersection'](_0x5b59a8[_0xdc00('0x25')],qs[_0xdc00('0x2b')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x2b')]));_0x1ad93b[_0xdc00('0x2c')]=_0x1ad93b[_0xdc00('0x2c')][_0xdc00('0x2d')]?_0x1ad93b['attributes']:_0x5b59a8[_0xdc00('0x25')];if(!_0x288ca0[_0xdc00('0x28')][_0xdc00('0x2e')](_0xdc00('0x2f'))){_0x1ad93b[_0xdc00('0x30')]=qs[_0xdc00('0x30')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x30')]);_0x1ad93b[_0xdc00('0x18')]=qs[_0xdc00('0x18')](_0x288ca0[_0xdc00('0x28')][_0xdc00('0x18')]);}_0x1ad93b[_0xdc00('0x31')]=qs[_0xdc00('0x32')](_0x288ca0['query'][_0xdc00('0x32')]);_0x1ad93b['where']=qs[_0xdc00('0x29')](_[_0xdc00('0x33')](_0x288ca0[_0xdc00('0x28')],_0x5b59a8['filters']));if(_0x288ca0['query'][_0xdc00('0x34')]){_0x1ad93b['where']=_[_0xdc00('0x35')](_0x1ad93b['where'],{'$or':_[_0xdc00('0x36')](_0x512f9f,function(_0x54e9f4){if(_0x54e9f4[_0xdc00('0x37')][_0xdc00('0x38')]!=='VIRTUAL'){var _0x336dc9={};_0x336dc9[_0x54e9f4[_0xdc00('0x39')]]={'$like':'%'+_0x288ca0[_0xdc00('0x28')][_0xdc00('0x34')]+'%'};return _0x336dc9;}})});}_0x1ad93b=_['merge']({},_0x1ad93b,_0x288ca0['options']);var _0x5c7f15={'where':_0x1ad93b[_0xdc00('0x3a')]};return db[_0xdc00('0x3b')]['count'](_0x5c7f15)['then'](function(_0x51e15c){_0x4014d9[_0xdc00('0x17')]=_0x51e15c;if(_0x288ca0[_0xdc00('0x28')][_0xdc00('0x3c')]){_0x1ad93b[_0xdc00('0x3d')]=[{'all':!![]}];}return db[_0xdc00('0x3b')]['findAll'](_0x1ad93b);})[_0xdc00('0x1f')](function(_0x4a31b5){_0x4014d9[_0xdc00('0x3e')]=_0x4a31b5;return _0x4014d9;})[_0xdc00('0x1f')](respondWithFilteredResult(_0x5daddd,_0x1ad93b))['catch'](handleError(_0x5daddd,null));};exports[_0xdc00('0x3f')]=function(_0x575f77,_0x8d8a08){var _0x5f0d5c={'raw':!![],'where':{'id':_0x575f77[_0xdc00('0x40')]['id']}},_0x2b7b53={};_0x2b7b53[_0xdc00('0x25')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x2b7b53['query']=_[_0xdc00('0x27')](_0x575f77[_0xdc00('0x28')]);_0x2b7b53[_0xdc00('0x29')]=_[_0xdc00('0x2a')](_0x2b7b53['model'],_0x2b7b53[_0xdc00('0x28')]);_0x5f0d5c[_0xdc00('0x2c')]=_[_0xdc00('0x2a')](_0x2b7b53[_0xdc00('0x25')],qs[_0xdc00('0x2b')](_0x575f77[_0xdc00('0x28')][_0xdc00('0x2b')]));_0x5f0d5c['attributes']=_0x5f0d5c[_0xdc00('0x2c')][_0xdc00('0x2d')]?_0x5f0d5c[_0xdc00('0x2c')]:_0x2b7b53[_0xdc00('0x25')];if(_0x575f77[_0xdc00('0x28')]['includeAll']){_0x5f0d5c[_0xdc00('0x3d')]=[{'all':!![]}];}_0x5f0d5c=_[_0xdc00('0x35')]({},_0x5f0d5c,_0x575f77[_0xdc00('0x41')]);return db[_0xdc00('0x3b')][_0xdc00('0x42')](_0x5f0d5c)[_0xdc00('0x1f')](handleEntityNotFound(_0x8d8a08,null))['then'](respondWithResult(_0x8d8a08,null))[_0xdc00('0x43')](handleError(_0x8d8a08,null));};exports['update']=function(_0x152df9,_0x2eb47d){if(_0x152df9[_0xdc00('0x44')]['id']){delete _0x152df9[_0xdc00('0x44')]['id'];}return db[_0xdc00('0x3b')]['find']({'where':{'id':_0x152df9[_0xdc00('0x40')]['id']}})[_0xdc00('0x1f')](handleEntityNotFound(_0x2eb47d,null))[_0xdc00('0x1f')](saveUpdates(_0x152df9[_0xdc00('0x44')],null))[_0xdc00('0x1f')](respondWithResult(_0x2eb47d,null))['catch'](handleError(_0x2eb47d,null));};exports[_0xdc00('0x20')]=function(_0x198044,_0x5ad1df){return db['CmCustomField']['find']({'where':{'id':_0x198044[_0xdc00('0x40')]['id']}})[_0xdc00('0x1f')](handleEntityNotFound(_0x5ad1df,null))[_0xdc00('0x1f')](removeEntity(_0x5ad1df,null))[_0xdc00('0x43')](handleError(_0x5ad1df,null));};exports[_0xdc00('0x45')]=function(_0x4f6b67,_0x48c068){var _0x42e54c;return db['sequelize']['transaction'](function(_0x5260ea){return db[_0xdc00('0x3b')][_0xdc00('0x45')](_0x4f6b67['body'],{'transaction':_0x5260ea})[_0xdc00('0x1f')](function(_0x534666){_0x42e54c=_0x534666;var _0x4452b5={'type':db[_0xdc00('0x46')][_0xdc00('0x47')],'transaction':_0x5260ea};switch(_0x4f6b67[_0xdc00('0x44')]['type']){case _0xdc00('0x48'):_0x4452b5[_0xdc00('0x37')]=db[_0xdc00('0x46')]['TEXT'];break;case _0xdc00('0x49'):_0x4452b5['type']=db[_0xdc00('0x46')][_0xdc00('0x4a')];break;case'switch':_0x4452b5[_0xdc00('0x37')]=db[_0xdc00('0x46')]['BOOLEAN'];_0x4452b5[_0xdc00('0x4b')]=![];break;default:}return db['sequelize'][_0xdc00('0x4c')][_0xdc00('0x4d')](_0xdc00('0x4e'),util[_0xdc00('0x4f')]('cf_%d',_0x42e54c['id']),_0x4452b5);})[_0xdc00('0x1f')](function(){return _0x42e54c;});})[_0xdc00('0x1f')](respondWithResult(_0x48c068,0xc9))[_0xdc00('0x43')](handleError(_0x48c068,null));}; \ No newline at end of file +var _0xbb08=['field','filter','options','then','includeAll','include','findAll','rows','show','params','find','catch','body','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','stack','name','send','index','CmCustomField','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL'];(function(_0x4e6eb2,_0x3ea359){var _0x36240c=function(_0xadf867){while(--_0xadf867){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x36240c(++_0x3ea359);}(_0xbb08,0xce));var _0x8bb0=function(_0x1dd636,_0x439ecd){_0x1dd636=_0x1dd636-0x0;var _0x4571a0=_0xbb08[_0x1dd636];return _0x4571a0;};'use strict';var pdf=require(_0x8bb0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8bb0('0x1'));var zipdir=require(_0x8bb0('0x2'));var jsonpatch=require(_0x8bb0('0x3'));var rp=require(_0x8bb0('0x4'));var moment=require(_0x8bb0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bb0('0x6'));var util=require(_0x8bb0('0x7'));var path=require('path');var sox=require(_0x8bb0('0x8'));var csv=require(_0x8bb0('0x9'));var ejs=require(_0x8bb0('0xa'));var fs=require('fs');var _=require(_0x8bb0('0xb'));var squel=require(_0x8bb0('0xc'));var crypto=require('crypto');var jsforce=require(_0x8bb0('0xd'));var deskjs=require(_0x8bb0('0xe'));var toCsv=require(_0x8bb0('0x9'));var querystring=require(_0x8bb0('0xf'));var Papa=require(_0x8bb0('0x10'));var authService=require(_0x8bb0('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8bb0('0x12'));var qs=require(_0x8bb0('0x13'));var logger=require(_0x8bb0('0x14'))(_0x8bb0('0x15'));var utils=require(_0x8bb0('0x16'));var config=require(_0x8bb0('0x17'));var db=require(_0x8bb0('0x18'))['db'];function respondWithStatusCode(_0x286ab3,_0x484b31){_0x484b31=_0x484b31||0xcc;return function(_0x215ef5){if(_0x215ef5){return _0x286ab3[_0x8bb0('0x19')](_0x484b31);}return _0x286ab3[_0x8bb0('0x1a')](_0x484b31)[_0x8bb0('0x1b')]();};}function respondWithResult(_0x5b1a79,_0x3ce545){_0x3ce545=_0x3ce545||0xc8;return function(_0x961355){if(_0x961355){return _0x5b1a79[_0x8bb0('0x1a')](_0x3ce545)[_0x8bb0('0x1c')](_0x961355);}};}function respondWithFilteredResult(_0x53687d,_0x122466){return function(_0x33fbb1){if(_0x33fbb1){var _0x7e2c8e=_0x33fbb1[_0x8bb0('0x1d')],_0x1c4040=_0x122466[_0x8bb0('0x1e')],_0x23bc53=_0x122466[_0x8bb0('0x1e')]+_0x122466['limit'],_0x481f80;if(_0x23bc53>=_0x7e2c8e){_0x23bc53=_0x7e2c8e;_0x481f80=0xc8;}else{_0x481f80=0xce;}_0x53687d[_0x8bb0('0x1a')](_0x481f80);return _0x53687d[_0x8bb0('0x1f')](_0x8bb0('0x20'),_0x1c4040+'-'+_0x23bc53+'/'+_0x7e2c8e)[_0x8bb0('0x1c')](_0x33fbb1);}return null;};}function patchUpdates(_0x4ae260){return function(_0x14dfdf){try{jsonpatch[_0x8bb0('0x21')](_0x14dfdf,_0x4ae260,!![]);}catch(_0xe91580){return BPromise[_0x8bb0('0x22')](_0xe91580);}return _0x14dfdf['save']();};}function saveUpdates(_0x86f838,_0x1713d7){return function(_0x7c516e){if(_0x7c516e){return _0x7c516e[_0x8bb0('0x23')](_0x86f838)['then'](function(_0x3be711){return _0x3be711;});}return null;};}function removeEntity(_0x1d34b2,_0x2427a2){return function(_0x1402ad){if(_0x1402ad){return _0x1402ad['destroy']()['then'](function(){_0x1d34b2[_0x8bb0('0x1a')](0xcc)[_0x8bb0('0x1b')]();});}};}function handleEntityNotFound(_0x350d2d,_0x5cb107){return function(_0x4a54a2){if(!_0x4a54a2){_0x350d2d[_0x8bb0('0x19')](0x194);}return _0x4a54a2;};}function handleError(_0x4acadc,_0x20342a){_0x20342a=_0x20342a||0x1f4;return function(_0x4b4723){logger['error'](_0x4b4723[_0x8bb0('0x24')]);if(_0x4b4723[_0x8bb0('0x25')]){delete _0x4b4723[_0x8bb0('0x25')];}_0x4acadc[_0x8bb0('0x1a')](_0x20342a)[_0x8bb0('0x26')](_0x4b4723);};}exports[_0x8bb0('0x27')]=function(_0x4e3d52,_0x283713){var _0x5ced4e={},_0x5fc956={},_0x3f8a50={'count':0x0,'rows':[]};var _0x4bb65b=db[_0x8bb0('0x28')][_0x8bb0('0x29')];_0x5fc956[_0x8bb0('0x2a')]=_['differenceBy'](_[_0x8bb0('0x2b')](_0x4bb65b),[_0x8bb0('0x25')]);_0x5fc956[_0x8bb0('0x2c')]=_['keys'](_0x4e3d52['query']);_0x5fc956[_0x8bb0('0x2d')]=_[_0x8bb0('0x2e')](_0x5fc956[_0x8bb0('0x2a')],_0x5fc956[_0x8bb0('0x2c')]);_0x5ced4e['attributes']=_[_0x8bb0('0x2e')](_0x5fc956['model'],qs[_0x8bb0('0x2f')](_0x4e3d52['query'][_0x8bb0('0x2f')]));_0x5ced4e['attributes']=_0x5ced4e['attributes'][_0x8bb0('0x30')]?_0x5ced4e[_0x8bb0('0x31')]:_0x5fc956[_0x8bb0('0x2a')];if(!_0x4e3d52['query'][_0x8bb0('0x32')](_0x8bb0('0x33'))){_0x5ced4e[_0x8bb0('0x34')]=qs[_0x8bb0('0x34')](_0x4e3d52[_0x8bb0('0x2c')]['limit']);_0x5ced4e[_0x8bb0('0x1e')]=qs[_0x8bb0('0x1e')](_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x1e')]);}_0x5ced4e[_0x8bb0('0x35')]=qs[_0x8bb0('0x36')](_0x4e3d52[_0x8bb0('0x2c')]['sort']);_0x5ced4e[_0x8bb0('0x37')]=qs['filters'](_[_0x8bb0('0x38')](_0x4e3d52[_0x8bb0('0x2c')],_0x5fc956[_0x8bb0('0x2d')]));if(_0x4e3d52[_0x8bb0('0x2c')]['filter']){_0x5ced4e['where']=_[_0x8bb0('0x39')](_0x5ced4e['where'],{'$or':_[_0x8bb0('0x3a')](_0x4bb65b,function(_0x27c14b){if(_0x27c14b[_0x8bb0('0x3b')]['key']!==_0x8bb0('0x3c')){var _0x37d472={};_0x37d472[_0x27c14b[_0x8bb0('0x3d')]]={'$like':'%'+_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x3e')]+'%'};return _0x37d472;}})});}_0x5ced4e=_[_0x8bb0('0x39')]({},_0x5ced4e,_0x4e3d52[_0x8bb0('0x3f')]);var _0x43b005={'where':_0x5ced4e['where']};return db[_0x8bb0('0x28')][_0x8bb0('0x1d')](_0x43b005)[_0x8bb0('0x40')](function(_0x46eea7){_0x3f8a50[_0x8bb0('0x1d')]=_0x46eea7;if(_0x4e3d52[_0x8bb0('0x2c')][_0x8bb0('0x41')]){_0x5ced4e[_0x8bb0('0x42')]=[{'all':!![]}];}return db[_0x8bb0('0x28')][_0x8bb0('0x43')](_0x5ced4e);})[_0x8bb0('0x40')](function(_0x19ac50){_0x3f8a50[_0x8bb0('0x44')]=_0x19ac50;return _0x3f8a50;})[_0x8bb0('0x40')](respondWithFilteredResult(_0x283713,_0x5ced4e))['catch'](handleError(_0x283713,null));};exports[_0x8bb0('0x45')]=function(_0xf5874a,_0x5221ec){var _0x30eee7={'raw':!![],'where':{'id':_0xf5874a[_0x8bb0('0x46')]['id']}},_0x93387d={};_0x93387d[_0x8bb0('0x2a')]=_['keys'](db[_0x8bb0('0x28')][_0x8bb0('0x29')]);_0x93387d[_0x8bb0('0x2c')]=_['keys'](_0xf5874a[_0x8bb0('0x2c')]);_0x93387d[_0x8bb0('0x2d')]=_['intersection'](_0x93387d['model'],_0x93387d[_0x8bb0('0x2c')]);_0x30eee7[_0x8bb0('0x31')]=_['intersection'](_0x93387d[_0x8bb0('0x2a')],qs[_0x8bb0('0x2f')](_0xf5874a[_0x8bb0('0x2c')][_0x8bb0('0x2f')]));_0x30eee7[_0x8bb0('0x31')]=_0x30eee7[_0x8bb0('0x31')][_0x8bb0('0x30')]?_0x30eee7[_0x8bb0('0x31')]:_0x93387d[_0x8bb0('0x2a')];if(_0xf5874a[_0x8bb0('0x2c')]['includeAll']){_0x30eee7[_0x8bb0('0x42')]=[{'all':!![]}];}_0x30eee7=_[_0x8bb0('0x39')]({},_0x30eee7,_0xf5874a[_0x8bb0('0x3f')]);return db[_0x8bb0('0x28')][_0x8bb0('0x47')](_0x30eee7)[_0x8bb0('0x40')](handleEntityNotFound(_0x5221ec,null))[_0x8bb0('0x40')](respondWithResult(_0x5221ec,null))[_0x8bb0('0x48')](handleError(_0x5221ec,null));};exports[_0x8bb0('0x23')]=function(_0x32f122,_0x13f7a4){if(_0x32f122[_0x8bb0('0x49')]['id']){delete _0x32f122[_0x8bb0('0x49')]['id'];}return db[_0x8bb0('0x28')][_0x8bb0('0x47')]({'where':{'id':_0x32f122['params']['id']}})[_0x8bb0('0x40')](handleEntityNotFound(_0x13f7a4,null))[_0x8bb0('0x40')](saveUpdates(_0x32f122[_0x8bb0('0x49')],null))[_0x8bb0('0x40')](respondWithResult(_0x13f7a4,null))[_0x8bb0('0x48')](handleError(_0x13f7a4,null));};exports['destroy']=function(_0x25e93e,_0x273dd7){return db['CmCustomField'][_0x8bb0('0x47')]({'where':{'id':_0x25e93e[_0x8bb0('0x46')]['id']}})[_0x8bb0('0x40')](handleEntityNotFound(_0x273dd7,null))[_0x8bb0('0x40')](removeEntity(_0x273dd7,null))[_0x8bb0('0x48')](handleError(_0x273dd7,null));};exports[_0x8bb0('0x4a')]=function(_0x5761bc,_0x26e52f){var _0x4ca48b;return db[_0x8bb0('0x4b')][_0x8bb0('0x4c')](function(_0x317559){return db[_0x8bb0('0x28')][_0x8bb0('0x4a')](_0x5761bc['body'],{'transaction':_0x317559})[_0x8bb0('0x40')](function(_0x5d8fa7){_0x4ca48b=_0x5d8fa7;var _0x271882={'type':db['Sequelize'][_0x8bb0('0x4d')],'transaction':_0x317559};switch(_0x5761bc[_0x8bb0('0x49')][_0x8bb0('0x3b')]){case _0x8bb0('0x4e'):_0x271882['type']=db[_0x8bb0('0x4f')]['TEXT'];break;case _0x8bb0('0x50'):_0x271882[_0x8bb0('0x3b')]=db[_0x8bb0('0x4f')][_0x8bb0('0x51')];break;case _0x8bb0('0x52'):_0x271882[_0x8bb0('0x3b')]=db[_0x8bb0('0x4f')][_0x8bb0('0x53')];_0x271882[_0x8bb0('0x54')]=![];break;default:}return db[_0x8bb0('0x4b')][_0x8bb0('0x55')][_0x8bb0('0x56')]('cm_contacts',util[_0x8bb0('0x57')](_0x8bb0('0x58'),_0x4ca48b['id']),_0x271882);})['then'](function(){return _0x4ca48b;});})[_0x8bb0('0x40')](respondWithResult(_0x26e52f,0xc9))['catch'](handleError(_0x26e52f,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 94c9612..6319b63 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 _0x1cda=['lodash','util','api','bluebird','request-promise','./cmCustomField.attributes','exports','define','cm_custom_fields'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x1cda,0x1c2));var _0xa1cd=function(_0x4c3669,_0x3d1ca3){_0x4c3669=_0x4c3669-0x0;var _0xa96f9e=_0x1cda[_0x4c3669];return _0xa96f9e;};'use strict';var _=require(_0xa1cd('0x0'));var util=require(_0xa1cd('0x1'));var logger=require('../../config/logger')(_0xa1cd('0x2'));var moment=require('moment');var BPromise=require(_0xa1cd('0x3'));var rp=require(_0xa1cd('0x4'));var attributes=require(_0xa1cd('0x5'));module[_0xa1cd('0x6')]=function(_0x5d3d85,_0x350354){return _0x5d3d85[_0xa1cd('0x7')]('CmCustomField',attributes,{'tableName':_0xa1cd('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5ba=['CmCustomField','lodash','util','../../config/logger','moment','./cmCustomField.attributes','exports'];(function(_0x14d1c1,_0x17370c){var _0x30ac9b=function(_0x22a297){while(--_0x22a297){_0x14d1c1['push'](_0x14d1c1['shift']());}};_0x30ac9b(++_0x17370c);}(_0xd5ba,0x8d));var _0xad5b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd5ba[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var logger=require(_0xad5b('0x2'))('api');var moment=require(_0xad5b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xad5b('0x4'));module[_0xad5b('0x5')]=function(_0x579523,_0x1b84cc){return _0x579523['define'](_0xad5b('0x6'),attributes,{'tableName':'cm_custom_fields','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 6093b98..4513afe 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 _0x95ad=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xd3e0b9,_0xd80d4d){var _0x470133=function(_0x1aede8){while(--_0x1aede8){_0xd3e0b9['push'](_0xd3e0b9['shift']());}};_0x470133(++_0xd80d4d);}(_0x95ad,0x7e));var _0xd95a=function(_0x3c0be1,_0xd1f4a6){_0x3c0be1=_0x3c0be1-0x0;var _0x2b120a=_0x95ad[_0x3c0be1];return _0x2b120a;};'use strict';var _=require(_0xd95a('0x0'));var util=require(_0xd95a('0x1'));var moment=require(_0xd95a('0x2'));var BPromise=require(_0xd95a('0x3'));var rs=require(_0xd95a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd95a('0x5'))['db'];var utils=require(_0xd95a('0x6'));var logger=require(_0xd95a('0x7'))(_0xd95a('0x8'));var config=require(_0xd95a('0x9'));var jayson=require(_0xd95a('0xa'));var client=jayson[_0xd95a('0xb')][_0xd95a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18b2be,_0x5e46bf,_0x1ba26f){return new BPromise(function(_0x4576f2,_0x174ad4){return client['request'](_0x18b2be,_0x1ba26f)[_0xd95a('0xd')](function(_0x1fd729){logger[_0xd95a('0xe')](_0xd95a('0xf'),_0x5e46bf,_0xd95a('0x10'));logger[_0xd95a('0x11')](_0xd95a('0x12'),_0x5e46bf,'request\x20sent',JSON[_0xd95a('0x13')](_0x1fd729));if(_0x1fd729[_0xd95a('0x14')]){if(_0x1fd729['error'][_0xd95a('0x15')]===0x1f4){logger[_0xd95a('0x14')](_0xd95a('0xf'),_0x5e46bf,_0x1fd729['error'][_0xd95a('0x16')]);return _0x174ad4(_0x1fd729['error'][_0xd95a('0x16')]);}logger[_0xd95a('0x14')](_0xd95a('0xf'),_0x5e46bf,_0x1fd729[_0xd95a('0x14')]['message']);return _0x4576f2(_0x1fd729[_0xd95a('0x14')]['message']);}else{logger[_0xd95a('0xe')](_0xd95a('0xf'),_0x5e46bf,_0xd95a('0x10'));_0x4576f2(_0x1fd729[_0xd95a('0x17')]['message']);}})[_0xd95a('0x18')](function(_0x53c62c){logger['error'](_0xd95a('0xf'),_0x5e46bf,_0x53c62c);_0x174ad4(_0x53c62c);});});} \ No newline at end of file +var _0x8433=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x19f551,_0x27dd5a){var _0xf07ebd=function(_0x48e967){while(--_0x48e967){_0x19f551['push'](_0x19f551['shift']());}};_0xf07ebd(++_0x27dd5a);}(_0x8433,0x1d8));var _0x3843=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x8433[_0x5f3905];return _0x2923b1;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var moment=require(_0x3843('0x2'));var BPromise=require(_0x3843('0x3'));var rs=require(_0x3843('0x4'));var fs=require('fs');var Redis=require(_0x3843('0x5'));var db=require(_0x3843('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3843('0x7'))('rpc');var config=require(_0x3843('0x8'));var jayson=require(_0x3843('0x9'));var client=jayson[_0x3843('0xa')][_0x3843('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15eb86,_0x46df13,_0x12d85a){return new BPromise(function(_0x7bcd82,_0x3694f2){return client[_0x3843('0xc')](_0x15eb86,_0x12d85a)[_0x3843('0xd')](function(_0x4ecd46){logger['info'](_0x3843('0xe'),_0x46df13,_0x3843('0xf'));logger[_0x3843('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x46df13,_0x3843('0xf'),JSON[_0x3843('0x11')](_0x4ecd46));if(_0x4ecd46[_0x3843('0x12')]){if(_0x4ecd46[_0x3843('0x12')]['code']===0x1f4){logger[_0x3843('0x12')]('CmCustomField,\x20%s,\x20%s',_0x46df13,_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);return _0x3694f2(_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);}logger[_0x3843('0x12')](_0x3843('0xe'),_0x46df13,_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);return _0x7bcd82(_0x4ecd46[_0x3843('0x12')][_0x3843('0x13')]);}else{logger[_0x3843('0x14')](_0x3843('0xe'),_0x46df13,_0x3843('0xf'));_0x7bcd82(_0x4ecd46[_0x3843('0x15')][_0x3843('0x13')]);}})[_0x3843('0x16')](function(_0x1238b5){logger[_0x3843('0x12')]('CmCustomField,\x20%s,\x20%s',_0x46df13,_0x1238b5);_0x3694f2(_0x1238b5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 775c186..d10279f 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 _0x6f0c=['express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x6f0c,0x165));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc6f0('0x0'));var util=require(_0xc6f0('0x1'));var path=require('path');var timeout=require(_0xc6f0('0x2'));var express=require(_0xc6f0('0x3'));var router=express[_0xc6f0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc6f0('0x5'));var config=require(_0xc6f0('0x6'));var controller=require('./cmCustomField.controller');router[_0xc6f0('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6f0('0x8')]);router[_0xc6f0('0x7')]('/:id',auth[_0xc6f0('0x9')](),controller['show']);router[_0xc6f0('0xa')]('/',auth[_0xc6f0('0x9')](),controller[_0xc6f0('0xb')]);router[_0xc6f0('0xc')]('/:id',auth[_0xc6f0('0x9')](),controller[_0xc6f0('0xd')]);router[_0xc6f0('0xe')](_0xc6f0('0xf'),auth[_0xc6f0('0x9')](),controller[_0xc6f0('0x10')]);module[_0xc6f0('0x11')]=router; \ No newline at end of file +var _0x8598=['create','put','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x5d321c,_0x28c08a){var _0x3a543a=function(_0x1e7bc8){while(--_0x1e7bc8){_0x5d321c['push'](_0x5d321c['shift']());}};_0x3a543a(++_0x28c08a);}(_0x8598,0x15b));var _0x8859=function(_0x1dac78,_0x3b832f){_0x1dac78=_0x1dac78-0x0;var _0x541302=_0x8598[_0x1dac78];return _0x541302;};'use strict';var multer=require('multer');var util=require(_0x8859('0x0'));var path=require(_0x8859('0x1'));var timeout=require('connect-timeout');var express=require(_0x8859('0x2'));var router=express[_0x8859('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8859('0x4'));var config=require(_0x8859('0x5'));var controller=require(_0x8859('0x6'));router['get']('/',auth[_0x8859('0x7')](),controller[_0x8859('0x8')]);router[_0x8859('0x9')](_0x8859('0xa'),auth[_0x8859('0x7')](),controller[_0x8859('0xb')]);router[_0x8859('0xc')]('/',auth['isAuthenticated'](),controller[_0x8859('0xd')]);router[_0x8859('0xe')](_0x8859('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8859('0xf')](_0x8859('0xa'),auth[_0x8859('0x7')](),controller[_0x8859('0x10')]);module[_0x8859('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 0510362..b948354 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 _0xc9e8=['moment','sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','BOOLEAN','contactListQueue'];(function(_0x258108,_0x3ec07c){var _0x31c11e=function(_0x54e874){while(--_0x54e874){_0x258108['push'](_0x258108['shift']());}};_0x31c11e(++_0x3ec07c);}(_0xc9e8,0x6e));var _0x8c9e=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xc9e8[_0x4503df];return _0x3f1b2b;};'use strict';var moment=require(_0x8c9e('0x0'));var Sequelize=require(_0x8c9e('0x1'));module[_0x8c9e('0x2')]={'phone':{'type':Sequelize[_0x8c9e('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x8c9e('0x4')](_0x8c9e('0x5'))},'countbusyretry':{'type':Sequelize[_0x8c9e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8c9e('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8c9e('0x7')]},'priority':{'type':Sequelize[_0x8c9e('0x6')](0x2)[_0x8c9e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8c9e('0x9')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8c9e('0x6')],'unique':_0x8c9e('0xa')},'ListId':{'type':Sequelize[_0x8c9e('0x6')],'unique':_0x8c9e('0xa')},'UserId':{'type':Sequelize[_0x8c9e('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x8c9e('0x6')],'unique':_0x8c9e('0xa')},'CampaignId':{'type':Sequelize[_0x8c9e('0x6')]}}; \ No newline at end of file +var _0x0748=['UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x50f040,_0x270105){var _0x5ba45b=function(_0x1456a2){while(--_0x1456a2){_0x50f040['push'](_0x50f040['shift']());}};_0x5ba45b(++_0x270105);}(_0x0748,0xb6));var _0x8074=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x0748[_0x48d6a3];return _0x38bfa0;};'use strict';var moment=require(_0x8074('0x0'));var Sequelize=require(_0x8074('0x1'));module['exports']={'phone':{'type':Sequelize[_0x8074('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8074('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8074('0x4')],'defaultValue':moment()[_0x8074('0x5')](_0x8074('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8074('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8074('0x4')]},'priority':{'type':Sequelize[_0x8074('0x7')](0x2)[_0x8074('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8074('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8074('0x7')],'unique':_0x8074('0x9')},'ListId':{'type':Sequelize[_0x8074('0x7')],'unique':_0x8074('0x9')},'UserId':{'type':Sequelize[_0x8074('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x8074('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0f88a18..ccfe4bc 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 _0x61b2=['isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','sequelize','YYYY-MM-DD\x20HH:mm:ss','map','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmList','List','Queue','dialActive','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','model','keys','query','filters','concat','$and','$or','$gte','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$contains','$contained','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','options','includeAll','include','CmHopper','findAll','rows','catch','show','attributes','create','body','find','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','updatedAt','deleted','campaign','membername','user','UserId','deletedat','format','ivr','lastName'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x61b2,0xad));var _0x261b=function(_0x581bcb,_0x3aa741){_0x581bcb=_0x581bcb-0x0;var _0x1afc1d=_0x61b2[_0x581bcb];return _0x1afc1d;};'use strict';var pdf=require(_0x261b('0x0'));var emlformat=require(_0x261b('0x1'));var rimraf=require(_0x261b('0x2'));var zipdir=require(_0x261b('0x3'));var jsonpatch=require(_0x261b('0x4'));var rp=require('request-promise');var moment=require(_0x261b('0x5'));var BPromise=require(_0x261b('0x6'));var Mustache=require(_0x261b('0x7'));var util=require(_0x261b('0x8'));var path=require(_0x261b('0x9'));var sox=require(_0x261b('0xa'));var csv=require(_0x261b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x261b('0xc'));var squel=require('squel');var crypto=require(_0x261b('0xd'));var jsforce=require(_0x261b('0xe'));var deskjs=require(_0x261b('0xf'));var toCsv=require(_0x261b('0xb'));var querystring=require(_0x261b('0x10'));var Papa=require(_0x261b('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x261b('0x12'));var Redis=require(_0x261b('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x261b('0x14'))(_0x261b('0x15'));var utils=require('../../config/utils');var config=require(_0x261b('0x16'));var db=require(_0x261b('0x17'))['db'];function respondWithStatusCode(_0x285a1c,_0x38ea44){_0x38ea44=_0x38ea44||0xcc;return function(_0x129075){if(_0x129075){return _0x285a1c[_0x261b('0x18')](_0x38ea44);}return _0x285a1c[_0x261b('0x19')](_0x38ea44)[_0x261b('0x1a')]();};}function respondWithResult(_0x7526cc,_0x520d62){_0x520d62=_0x520d62||0xc8;return function(_0x52c508){if(_0x52c508){return _0x7526cc[_0x261b('0x19')](_0x520d62)['json'](_0x52c508);}};}function respondWithFilteredResult(_0x217057,_0x314474){return function(_0x2e8810){if(_0x2e8810){var _0x146b15=_0x2e8810[_0x261b('0x1b')],_0x2020fe=_0x314474['offset'],_0x57085f=_0x314474['offset']+_0x314474[_0x261b('0x1c')],_0x8ffbff;if(_0x57085f>=_0x146b15){_0x57085f=_0x146b15;_0x8ffbff=0xc8;}else{_0x8ffbff=0xce;}_0x217057[_0x261b('0x19')](_0x8ffbff);return _0x217057[_0x261b('0x1d')](_0x261b('0x1e'),_0x2020fe+'-'+_0x57085f+'/'+_0x146b15)[_0x261b('0x1f')](_0x2e8810);}return null;};}function patchUpdates(_0x2ca81c){return function(_0x17a6e4){try{jsonpatch[_0x261b('0x20')](_0x17a6e4,_0x2ca81c,!![]);}catch(_0x32819e){return BPromise[_0x261b('0x21')](_0x32819e);}return _0x17a6e4[_0x261b('0x22')]();};}function saveUpdates(_0xc1d75e,_0x4246aa){return function(_0x505a5c){if(_0x505a5c){return _0x505a5c[_0x261b('0x23')](_0xc1d75e)[_0x261b('0x24')](function(_0x1a3c04){return _0x1a3c04;});}return null;};}function removeEntity(_0x51559f,_0xb220b){return function(_0x17ac22){if(_0x17ac22){return _0x17ac22[_0x261b('0x25')]()[_0x261b('0x24')](function(){_0x51559f[_0x261b('0x19')](0xcc)[_0x261b('0x1a')]();});}};}function handleEntityNotFound(_0x3f636c,_0x9d7bf9){return function(_0xaa0a43){if(!_0xaa0a43){_0x3f636c[_0x261b('0x18')](0x194);}return _0xaa0a43;};}function handleError(_0x35ece3,_0x4f0eae){_0x4f0eae=_0x4f0eae||0x1f4;return function(_0x1583c1){logger['error'](_0x1583c1[_0x261b('0x26')]);if(_0x1583c1[_0x261b('0x27')]){delete _0x1583c1[_0x261b('0x27')];}_0x35ece3['status'](_0x4f0eae)['send'](_0x1583c1);};}exports[_0x261b('0x28')]=function(_0x562331,_0x47f74b){var _0x884630={},_0x413b37={},_0x3686e4={'count':0x0,'rows':[]};var _0x3c3b83=db['CmHopper'][_0x261b('0x29')];_0x413b37[_0x261b('0x2a')]=_[_0x261b('0x2b')](_0x3c3b83);_0x413b37[_0x261b('0x2c')]=_[_0x261b('0x2b')](_0x562331[_0x261b('0x2c')]);_0x413b37[_0x261b('0x2d')]=_['intersection'](_0x413b37[_0x261b('0x2a')],_0x413b37[_0x261b('0x2c')]);_0x413b37[_0x261b('0x2d')]=_[_0x261b('0x2e')](_0x413b37[_0x261b('0x2d')],[_0x261b('0x2f'),_0x261b('0x30'),'$gt',_0x261b('0x31'),'$lt','$lte','$ne','$eq',_0x261b('0x32'),_0x261b('0x33'),_0x261b('0x34'),_0x261b('0x35'),_0x261b('0x36'),_0x261b('0x37'),_0x261b('0x38'),'$iLike','$notILike',_0x261b('0x37'),'$overlap',_0x261b('0x39'),_0x261b('0x3a'),'$any']);_0x884630['attributes']=_[_0x261b('0x3b')](_0x413b37['model'],qs[_0x261b('0x3c')](_0x562331[_0x261b('0x2c')]['fields']));_0x884630['attributes']=_0x884630['attributes'][_0x261b('0x3d')]?_0x884630['attributes']:_0x413b37['model'];if(!_0x562331[_0x261b('0x2c')][_0x261b('0x3e')](_0x261b('0x3f'))){_0x884630['limit']=qs[_0x261b('0x1c')](_0x562331[_0x261b('0x2c')]['limit']);_0x884630[_0x261b('0x40')]=qs[_0x261b('0x40')](_0x562331[_0x261b('0x2c')][_0x261b('0x40')]);}_0x884630[_0x261b('0x41')]=qs[_0x261b('0x42')](_0x562331[_0x261b('0x2c')][_0x261b('0x42')]);_0x884630['where']=qs[_0x261b('0x2d')](_['pick'](_0x562331[_0x261b('0x2c')],_0x413b37[_0x261b('0x2d')]));if(_0x562331['query'][_0x261b('0x43')]){_0x884630[_0x261b('0x44')]=_[_0x261b('0x45')](_0x884630[_0x261b('0x44')],{'$or':_['map'](_0x3c3b83,function(_0x3ea40e){if(_0x3ea40e['type']['key']!=='VIRTUAL'){var _0x5e52f1={};_0x5e52f1[_0x3ea40e['field']]={'$like':'%'+_0x562331['query'][_0x261b('0x43')]+'%'};return _0x5e52f1;}})});}_0x884630=_[_0x261b('0x45')]({},_0x884630,_0x562331[_0x261b('0x46')]);var _0x4784e6={'where':_0x884630[_0x261b('0x44')]};return db['CmHopper'][_0x261b('0x1b')](_0x4784e6)['then'](function(_0x21639e){_0x3686e4[_0x261b('0x1b')]=_0x21639e;if(_0x562331[_0x261b('0x2c')][_0x261b('0x47')]){_0x884630[_0x261b('0x48')]=[{'all':!![]}];}return db[_0x261b('0x49')][_0x261b('0x4a')](_0x884630);})[_0x261b('0x24')](function(_0x506db0){_0x3686e4[_0x261b('0x4b')]=_0x506db0;return _0x3686e4;})['then'](respondWithFilteredResult(_0x47f74b,_0x884630))[_0x261b('0x4c')](handleError(_0x47f74b,null));};exports[_0x261b('0x4d')]=function(_0x1bb951,_0x2f2cf0){var _0x5e5b67={'raw':!![],'where':{'id':_0x1bb951['params']['id']}},_0x5ccdda={};_0x5ccdda[_0x261b('0x2a')]=_[_0x261b('0x2b')](db['CmHopper']['rawAttributes']);_0x5ccdda['query']=_[_0x261b('0x2b')](_0x1bb951[_0x261b('0x2c')]);_0x5ccdda[_0x261b('0x2d')]=_[_0x261b('0x3b')](_0x5ccdda[_0x261b('0x2a')],_0x5ccdda[_0x261b('0x2c')]);_0x5e5b67['attributes']=_[_0x261b('0x3b')](_0x5ccdda[_0x261b('0x2a')],qs['fields'](_0x1bb951[_0x261b('0x2c')]['fields']));_0x5e5b67[_0x261b('0x4e')]=_0x5e5b67['attributes'][_0x261b('0x3d')]?_0x5e5b67['attributes']:_0x5ccdda[_0x261b('0x2a')];if(_0x1bb951[_0x261b('0x2c')][_0x261b('0x47')]){_0x5e5b67[_0x261b('0x48')]=[{'all':!![]}];}_0x5e5b67=_['merge']({},_0x5e5b67,_0x1bb951[_0x261b('0x46')]);return db[_0x261b('0x49')]['find'](_0x5e5b67)[_0x261b('0x24')](handleEntityNotFound(_0x2f2cf0,null))['then'](respondWithResult(_0x2f2cf0,null))[_0x261b('0x4c')](handleError(_0x2f2cf0,null));};exports[_0x261b('0x4f')]=function(_0x52bf0c,_0x626869){return db[_0x261b('0x49')][_0x261b('0x4f')](_0x52bf0c[_0x261b('0x50')],{})['then'](respondWithResult(_0x626869,0xc9))[_0x261b('0x4c')](handleError(_0x626869,null));};exports['update']=function(_0x195467,_0x38151b){if(_0x195467[_0x261b('0x50')]['id']){delete _0x195467[_0x261b('0x50')]['id'];}return db[_0x261b('0x49')][_0x261b('0x51')]({'where':{'id':_0x195467[_0x261b('0x52')]['id']}})[_0x261b('0x24')](handleEntityNotFound(_0x38151b,null))[_0x261b('0x24')](saveUpdates(_0x195467['body'],null))[_0x261b('0x24')](respondWithResult(_0x38151b,null))[_0x261b('0x4c')](handleError(_0x38151b,null));};exports['describe']=function(_0x2ea8cf,_0x3f8bac){return db[_0x261b('0x49')][_0x261b('0x53')]()['then'](respondWithResult(_0x3f8bac,null))[_0x261b('0x4c')](handleError(_0x3f8bac,null));};exports[_0x261b('0x25')]=function(_0x2e1edd,_0x268e57){var _0x2c7844;return db[_0x261b('0x49')][_0x261b('0x51')]({'where':{'id':_0x2e1edd[_0x261b('0x52')]['id']}})[_0x261b('0x24')](handleEntityNotFound(_0x268e57,null))['then'](function(_0x42cbf3){if(_0x42cbf3){return _0x42cbf3['destroy']()[_0x261b('0x24')](function(_0x2b1305){return _0x2b1305;});}})[_0x261b('0x24')](function(_0x3a2e36){_0x2c7844=_0x3a2e36;if(_0x3a2e36){if(_0x3a2e36[_0x261b('0x54')]||_0x3a2e36[_0x261b('0x55')]){return db[_0x3a2e36[_0x261b('0x54')]?_0x261b('0x56'):_0x261b('0x57')][_0x261b('0x51')]({'where':{'id':_0x3a2e36['VoiceQueueId']?_0x3a2e36[_0x261b('0x54')]:_0x3a2e36[_0x261b('0x55')]},'attributes':['id',_0x261b('0x27')],'raw':!![]});}}})[_0x261b('0x24')](function(_0x4fd9ac){var _0x20d204={};if(_0x4fd9ac){_[_0x261b('0x45')](_0x20d204,_['omit'](_0x2c7844[_0x261b('0x58')],['createdAt',_0x261b('0x59'),'id']));_0x20d204['state']=0x15;_0x20d204['statedesc']=_0x261b('0x5a');_0x20d204[_0x261b('0x5b')]=_0x4fd9ac[_0x261b('0x27')];_0x20d204[_0x261b('0x5c')]=_0x2e1edd[_0x261b('0x5d')][_0x261b('0x27')];_0x20d204[_0x261b('0x5e')]=_0x2e1edd[_0x261b('0x5d')]['id'];_0x20d204[_0x261b('0x5a')]=!![];_0x20d204[_0x261b('0x5f')]=moment()[_0x261b('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x20d204['calleridnum']=_0x2c7844['phone'];_0x20d204['campaigntype']=_0x2c7844[_0x261b('0x54')]?'queue':_0x261b('0x61');return db['CmContact'][_0x261b('0x51')]({'where':{'id':_0x20d204['ContactId']},'attributes':['firstName',_0x261b('0x62')]})[_0x261b('0x24')](function(_0x19d486){if(!_[_0x261b('0x63')](_0x268e57)&&!_[_0x261b('0x63')](_0x19d486[_0x261b('0x64')])){_0x20d204[_0x261b('0x65')]=_0x19d486['firstName'];if(!_[_0x261b('0x63')](_0x19d486[_0x261b('0x62')])){_0x20d204[_0x261b('0x65')]+='\x20'+_0x19d486['lastName'];}}})[_0x261b('0x66')](function(){return db[_0x261b('0x67')][_0x261b('0x4f')](_0x20d204);});}})[_0x261b('0x24')](function(){return _0x268e57[_0x261b('0x19')](0xcc)[_0x261b('0x1a')]();})['catch'](handleError(_0x268e57,null));};exports[_0x261b('0x68')]=function(_0x381833,_0x3a3a92,_0x2fcc17){var _0x1a7d2b=[];return db[_0x261b('0x69')][_0x261b('0x53')]()[_0x261b('0x24')](function(_0x328591){_0x1a7d2b=_[_0x261b('0x2b')](_0x328591);return _0x381833[_0x261b('0x5d')][_0x261b('0x6a')]({'where':{'type':_0x261b('0x6b'),'dialActive':!![],'dialMethod':_0x261b('0x6c')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x137e87){if(_0x137e87&&_0x137e87[_0x261b('0x3d')]){return db[_0x261b('0x6d')]['transaction'](function(_0x591f28){var _0x4e86ab={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x261b('0x6e'))},'VoiceQueueId':{'$in':_[_0x261b('0x6f')](_0x137e87,'id')},'$or':[{'UserId':null},{'UserId':_0x381833[_0x261b('0x5d')]['id']}]};var _0xd10865=[];if(_0x381833[_0x261b('0x50')][_0x261b('0x70')]&&_0x381833[_0x261b('0x50')][_0x261b('0x70')]===_0x261b('0x71')){if(!_[_0x261b('0x72')](_0x381833[_0x261b('0x50')][_0x261b('0x73')])){_0x4e86ab['id']={'$in':_0x381833[_0x261b('0x50')][_0x261b('0x73')]};}_0xd10865=[[_0x261b('0x74'),_0x261b('0x75')],[_0x261b('0x76'),_0x137e87[0x0]['dialOrderByScheduledAt']==='ASC'?_0x261b('0x77'):_0x261b('0x75')],db[_0x261b('0x6d')]['literal'](_0x261b('0x78')),['id','DESC']];}else{if(!_[_0x261b('0x72')](_0x381833[_0x261b('0x50')][_0x261b('0x73')])){_0x4e86ab['id']={'$notIn':_0x381833[_0x261b('0x50')][_0x261b('0x73')]};}_0xd10865=[[_0x261b('0x74'),_0x261b('0x77')],[_0x261b('0x76'),_0x137e87[0x0][_0x261b('0x79')]],db[_0x261b('0x6d')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x261b('0x75')]];}return db[_0x261b('0x49')][_0x261b('0x7a')]({'attributes':['id',_0x261b('0x7b')],'where':_0x4e86ab,'order':_0xd10865,'transaction':_0x591f28,'lock':_0x591f28[_0x261b('0x7c')][_0x261b('0x7d')],'include':[{'model':db['CmContact'],'as':_0x261b('0x7e'),'attributes':_0x1a7d2b,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x261b('0x27')]}]},{'model':db[_0x261b('0x7f')],'as':_0x261b('0x80'),'attributes':['id',_0x261b('0x27')]},{'model':db['VoiceQueue'],'as':_0x261b('0x81'),'attributes':['id',_0x261b('0x27'),_0x261b('0x82')]}]})[_0x261b('0x24')](function(_0x18a96c){if(_0x18a96c){return _0x18a96c[_0x261b('0x23')]({'UserId':_0x381833[_0x261b('0x5d')]['id']},{'transaction':_0x591f28});}});});}})[_0x261b('0x24')](handleEntityNotFound(_0x3a3a92,null))[_0x261b('0x24')](respondWithResult(_0x3a3a92,null))[_0x261b('0x4c')](handleError(_0x3a3a92,null));};exports[_0x261b('0x83')]=function(_0x420847,_0x23e66c,_0x4c2ae9){return _0x420847[_0x261b('0x5d')][_0x261b('0x6a')]({'where':{'type':_0x261b('0x6b'),'dialActive':!![],'dialMethod':_0x261b('0x6c')},'attributes':['id'],'raw':!![]})['then'](function(_0x477283){if(_0x477283&&_0x477283[_0x261b('0x3d')]){return db[_0x261b('0x49')][_0x261b('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x261b('0x60')](_0x261b('0x6e'))},'VoiceQueueId':{'$in':_[_0x261b('0x6f')](_0x477283,'id')},'$or':[{'UserId':null},{'UserId':_0x420847[_0x261b('0x5d')]['id']}]}});}return 0x0;})[_0x261b('0x24')](function(_0x42dc50){if(!_['isNil'](_0x42dc50)&&_[_0x261b('0x84')](_0x42dc50)){return _0x23e66c[_0x261b('0x19')](0xc8)[_0x261b('0x1f')]({'contacts':_0x42dc50});}else{logger[_0x261b('0x85')](_0x261b('0x86'),_0x261b('0x83'),0x194,_0x261b('0x87'));_0x23e66c[_0x261b('0x18')](0x194);}})['catch'](handleError(_0x23e66c,null));}; \ No newline at end of file +var _0x1744=['$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','VIRTUAL','field','includeAll','include','findAll','catch','show','params','merge','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','name','dialActive','getOpenContacts','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','concat'];(function(_0x4ea026,_0x259869){var _0x40d3a4=function(_0x2950b4){while(--_0x2950b4){_0x4ea026['push'](_0x4ea026['shift']());}};_0x40d3a4(++_0x259869);}(_0x1744,0xf0));var _0x4174=function(_0x20f060,_0xe160c9){_0x20f060=_0x20f060-0x0;var _0x46077c=_0x1744[_0x20f060];return _0x46077c;};'use strict';var pdf=require(_0x4174('0x0'));var emlformat=require(_0x4174('0x1'));var rimraf=require(_0x4174('0x2'));var zipdir=require(_0x4174('0x3'));var jsonpatch=require(_0x4174('0x4'));var rp=require(_0x4174('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4174('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4174('0x7'));var csv=require(_0x4174('0x8'));var ejs=require(_0x4174('0x9'));var fs=require('fs');var _=require(_0x4174('0xa'));var squel=require('squel');var crypto=require(_0x4174('0xb'));var jsforce=require(_0x4174('0xc'));var deskjs=require(_0x4174('0xd'));var toCsv=require(_0x4174('0x8'));var querystring=require(_0x4174('0xe'));var Papa=require(_0x4174('0xf'));var authService=require(_0x4174('0x10'));var hardwareService=require(_0x4174('0x11'));var Redis=require('ioredis');var qs=require(_0x4174('0x12'));var logger=require(_0x4174('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4713b0,_0x153fa5){_0x153fa5=_0x153fa5||0xcc;return function(_0x34ce48){if(_0x34ce48){return _0x4713b0[_0x4174('0x14')](_0x153fa5);}return _0x4713b0[_0x4174('0x15')](_0x153fa5)['end']();};}function respondWithResult(_0x2ae6b6,_0x4c8df8){_0x4c8df8=_0x4c8df8||0xc8;return function(_0x51c4d8){if(_0x51c4d8){return _0x2ae6b6[_0x4174('0x15')](_0x4c8df8)[_0x4174('0x16')](_0x51c4d8);}};}function respondWithFilteredResult(_0x1f3a46,_0x1c3bd3){return function(_0x476364){if(_0x476364){var _0x5793bb=_0x476364[_0x4174('0x17')],_0x17caa7=_0x1c3bd3[_0x4174('0x18')],_0xe64bc5=_0x1c3bd3[_0x4174('0x18')]+_0x1c3bd3[_0x4174('0x19')],_0xe5409c;if(_0xe64bc5>=_0x5793bb){_0xe64bc5=_0x5793bb;_0xe5409c=0xc8;}else{_0xe5409c=0xce;}_0x1f3a46[_0x4174('0x15')](_0xe5409c);return _0x1f3a46[_0x4174('0x1a')](_0x4174('0x1b'),_0x17caa7+'-'+_0xe64bc5+'/'+_0x5793bb)[_0x4174('0x16')](_0x476364);}return null;};}function patchUpdates(_0x49f2bf){return function(_0x2f5fda){try{jsonpatch[_0x4174('0x1c')](_0x2f5fda,_0x49f2bf,!![]);}catch(_0x510b50){return BPromise[_0x4174('0x1d')](_0x510b50);}return _0x2f5fda[_0x4174('0x1e')]();};}function saveUpdates(_0x3e15f5,_0x4fdf5c){return function(_0x4b4506){if(_0x4b4506){return _0x4b4506[_0x4174('0x1f')](_0x3e15f5)['then'](function(_0x2ac45b){return _0x2ac45b;});}return null;};}function removeEntity(_0x40c08c,_0x1ede8a){return function(_0x4ba14c){if(_0x4ba14c){return _0x4ba14c['destroy']()[_0x4174('0x20')](function(){_0x40c08c[_0x4174('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3328bb,_0x45dff4){return function(_0x58bfdd){if(!_0x58bfdd){_0x3328bb['sendStatus'](0x194);}return _0x58bfdd;};}function handleError(_0x1e338f,_0x2597bf){_0x2597bf=_0x2597bf||0x1f4;return function(_0x20a62f){logger['error'](_0x20a62f['stack']);if(_0x20a62f['name']){delete _0x20a62f['name'];}_0x1e338f[_0x4174('0x15')](_0x2597bf)['send'](_0x20a62f);};}exports[_0x4174('0x21')]=function(_0x44afd6,_0x2a33f1){var _0x3ca9b8={},_0xed06c8={},_0x13a251={'count':0x0,'rows':[]};var _0x32cbcc=db[_0x4174('0x22')][_0x4174('0x23')];_0xed06c8[_0x4174('0x24')]=_[_0x4174('0x25')](_0x32cbcc);_0xed06c8[_0x4174('0x26')]=_[_0x4174('0x25')](_0x44afd6[_0x4174('0x26')]);_0xed06c8[_0x4174('0x27')]=_[_0x4174('0x28')](_0xed06c8[_0x4174('0x24')],_0xed06c8[_0x4174('0x26')]);_0xed06c8[_0x4174('0x27')]=_[_0x4174('0x29')](_0xed06c8[_0x4174('0x27')],[_0x4174('0x2a'),_0x4174('0x2b'),_0x4174('0x2c'),_0x4174('0x2d'),_0x4174('0x2e'),_0x4174('0x2f'),_0x4174('0x30'),'$eq',_0x4174('0x31'),_0x4174('0x32'),_0x4174('0x33'),_0x4174('0x34'),'$notIn',_0x4174('0x35'),_0x4174('0x36'),_0x4174('0x37'),_0x4174('0x38'),_0x4174('0x35'),_0x4174('0x39'),'$contains',_0x4174('0x3a'),'$any']);_0x3ca9b8[_0x4174('0x3b')]=_[_0x4174('0x28')](_0xed06c8[_0x4174('0x24')],qs[_0x4174('0x3c')](_0x44afd6[_0x4174('0x26')][_0x4174('0x3c')]));_0x3ca9b8[_0x4174('0x3b')]=_0x3ca9b8['attributes'][_0x4174('0x3d')]?_0x3ca9b8[_0x4174('0x3b')]:_0xed06c8[_0x4174('0x24')];if(!_0x44afd6[_0x4174('0x26')][_0x4174('0x3e')](_0x4174('0x3f'))){_0x3ca9b8[_0x4174('0x19')]=qs[_0x4174('0x19')](_0x44afd6[_0x4174('0x26')][_0x4174('0x19')]);_0x3ca9b8['offset']=qs[_0x4174('0x18')](_0x44afd6['query'][_0x4174('0x18')]);}_0x3ca9b8[_0x4174('0x40')]=qs[_0x4174('0x41')](_0x44afd6[_0x4174('0x26')][_0x4174('0x41')]);_0x3ca9b8[_0x4174('0x42')]=qs[_0x4174('0x27')](_['pick'](_0x44afd6['query'],_0xed06c8['filters']));if(_0x44afd6[_0x4174('0x26')][_0x4174('0x43')]){_0x3ca9b8[_0x4174('0x42')]=_['merge'](_0x3ca9b8['where'],{'$or':_[_0x4174('0x44')](_0x32cbcc,function(_0x161db3){if(_0x161db3[_0x4174('0x45')]['key']!==_0x4174('0x46')){var _0x4c7dc2={};_0x4c7dc2[_0x161db3[_0x4174('0x47')]]={'$like':'%'+_0x44afd6[_0x4174('0x26')]['filter']+'%'};return _0x4c7dc2;}})});}_0x3ca9b8=_['merge']({},_0x3ca9b8,_0x44afd6['options']);var _0x2a8882={'where':_0x3ca9b8['where']};return db['CmHopper']['count'](_0x2a8882)['then'](function(_0x595979){_0x13a251['count']=_0x595979;if(_0x44afd6['query'][_0x4174('0x48')]){_0x3ca9b8[_0x4174('0x49')]=[{'all':!![]}];}return db[_0x4174('0x22')][_0x4174('0x4a')](_0x3ca9b8);})[_0x4174('0x20')](function(_0x571ce8){_0x13a251['rows']=_0x571ce8;return _0x13a251;})[_0x4174('0x20')](respondWithFilteredResult(_0x2a33f1,_0x3ca9b8))[_0x4174('0x4b')](handleError(_0x2a33f1,null));};exports[_0x4174('0x4c')]=function(_0x28a3a4,_0x5a70b4){var _0x2d4f63={'raw':!![],'where':{'id':_0x28a3a4[_0x4174('0x4d')]['id']}},_0x35c442={};_0x35c442['model']=_[_0x4174('0x25')](db['CmHopper'][_0x4174('0x23')]);_0x35c442[_0x4174('0x26')]=_['keys'](_0x28a3a4[_0x4174('0x26')]);_0x35c442['filters']=_[_0x4174('0x28')](_0x35c442['model'],_0x35c442[_0x4174('0x26')]);_0x2d4f63[_0x4174('0x3b')]=_['intersection'](_0x35c442[_0x4174('0x24')],qs[_0x4174('0x3c')](_0x28a3a4['query'][_0x4174('0x3c')]));_0x2d4f63[_0x4174('0x3b')]=_0x2d4f63[_0x4174('0x3b')][_0x4174('0x3d')]?_0x2d4f63[_0x4174('0x3b')]:_0x35c442[_0x4174('0x24')];if(_0x28a3a4[_0x4174('0x26')]['includeAll']){_0x2d4f63[_0x4174('0x49')]=[{'all':!![]}];}_0x2d4f63=_[_0x4174('0x4e')]({},_0x2d4f63,_0x28a3a4[_0x4174('0x4f')]);return db['CmHopper'][_0x4174('0x50')](_0x2d4f63)[_0x4174('0x20')](handleEntityNotFound(_0x5a70b4,null))['then'](respondWithResult(_0x5a70b4,null))[_0x4174('0x4b')](handleError(_0x5a70b4,null));};exports[_0x4174('0x51')]=function(_0x33a376,_0x39047b){return db[_0x4174('0x22')][_0x4174('0x51')](_0x33a376['body'],{})[_0x4174('0x20')](respondWithResult(_0x39047b,0xc9))[_0x4174('0x4b')](handleError(_0x39047b,null));};exports['update']=function(_0x5e56bf,_0x1d761d){if(_0x5e56bf['body']['id']){delete _0x5e56bf[_0x4174('0x52')]['id'];}return db[_0x4174('0x22')]['find']({'where':{'id':_0x5e56bf['params']['id']}})['then'](handleEntityNotFound(_0x1d761d,null))[_0x4174('0x20')](saveUpdates(_0x5e56bf['body'],null))[_0x4174('0x20')](respondWithResult(_0x1d761d,null))[_0x4174('0x4b')](handleError(_0x1d761d,null));};exports['describe']=function(_0x1bdd57,_0x5864bf){return db[_0x4174('0x22')][_0x4174('0x53')]()[_0x4174('0x20')](respondWithResult(_0x5864bf,null))['catch'](handleError(_0x5864bf,null));};exports[_0x4174('0x54')]=function(_0x2b319b,_0x34fd8b){var _0x11c71b;return db[_0x4174('0x22')][_0x4174('0x50')]({'where':{'id':_0x2b319b[_0x4174('0x4d')]['id']}})['then'](handleEntityNotFound(_0x34fd8b,null))[_0x4174('0x20')](function(_0x4902fb){if(_0x4902fb){return _0x4902fb[_0x4174('0x54')]()[_0x4174('0x20')](function(_0x19a815){return _0x19a815;});}})[_0x4174('0x20')](function(_0x2a5e56){_0x11c71b=_0x2a5e56;if(_0x2a5e56){if(_0x2a5e56[_0x4174('0x55')]||_0x2a5e56[_0x4174('0x56')]){return db[_0x2a5e56[_0x4174('0x55')]?_0x4174('0x57'):'Campaign'][_0x4174('0x50')]({'where':{'id':_0x2a5e56['VoiceQueueId']?_0x2a5e56[_0x4174('0x55')]:_0x2a5e56[_0x4174('0x56')]},'attributes':['id','name'],'raw':!![]});}}})[_0x4174('0x20')](function(_0xe3d62e){var _0x487a9a={};if(_0xe3d62e){_[_0x4174('0x4e')](_0x487a9a,_[_0x4174('0x58')](_0x11c71b[_0x4174('0x59')],[_0x4174('0x5a'),_0x4174('0x5b'),'id']));_0x487a9a[_0x4174('0x5c')]=0x15;_0x487a9a['statedesc']=_0x4174('0x5d');_0x487a9a[_0x4174('0x5e')]=_0xe3d62e['name'];_0x487a9a['membername']=_0x2b319b[_0x4174('0x5f')]['name'];_0x487a9a[_0x4174('0x60')]=_0x2b319b[_0x4174('0x5f')]['id'];_0x487a9a['deleted']=!![];_0x487a9a[_0x4174('0x61')]=moment()[_0x4174('0x62')](_0x4174('0x63'));_0x487a9a[_0x4174('0x64')]=_0x11c71b['phone'];_0x487a9a[_0x4174('0x65')]=_0x11c71b[_0x4174('0x55')]?_0x4174('0x66'):_0x4174('0x67');return db[_0x4174('0x68')][_0x4174('0x50')]({'where':{'id':_0x487a9a['ContactId']},'attributes':[_0x4174('0x69'),_0x4174('0x6a')]})[_0x4174('0x20')](function(_0x124f61){if(!_[_0x4174('0x6b')](_0x34fd8b)&&!_[_0x4174('0x6b')](_0x124f61['firstName'])){_0x487a9a['calleridname']=_0x124f61[_0x4174('0x69')];if(!_['isNil'](_0x124f61[_0x4174('0x6a')])){_0x487a9a[_0x4174('0x6c')]+='\x20'+_0x124f61[_0x4174('0x6a')];}}})[_0x4174('0x6d')](function(){return db[_0x4174('0x6e')][_0x4174('0x51')](_0x487a9a);});}})[_0x4174('0x20')](function(){return _0x34fd8b[_0x4174('0x15')](0xcc)[_0x4174('0x6f')]();})['catch'](handleError(_0x34fd8b,null));};exports[_0x4174('0x70')]=function(_0x369393,_0x1377ce,_0x319e27){var _0x32016b=[];return db[_0x4174('0x68')][_0x4174('0x53')]()[_0x4174('0x20')](function(_0x58358a){_0x32016b=_['keys'](_0x58358a);return _0x369393['user'][_0x4174('0x71')]({'where':{'type':_0x4174('0x72'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4174('0x73')],'raw':!![]});})[_0x4174('0x20')](function(_0x297e33){if(_0x297e33&&_0x297e33[_0x4174('0x3d')]){return db[_0x4174('0x74')][_0x4174('0x75')](function(_0x1331ee){var _0xa94e4b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4174('0x62')](_0x4174('0x63'))},'VoiceQueueId':{'$in':_[_0x4174('0x44')](_0x297e33,'id')},'$or':[{'UserId':null},{'UserId':_0x369393['user']['id']}]};var _0x95e3ec=[];if(_0x369393[_0x4174('0x52')][_0x4174('0x76')]&&_0x369393[_0x4174('0x52')][_0x4174('0x76')]===_0x4174('0x77')){if(!_[_0x4174('0x78')](_0x369393[_0x4174('0x52')][_0x4174('0x79')])){_0xa94e4b['id']={'$in':_0x369393[_0x4174('0x52')][_0x4174('0x79')]};}_0x95e3ec=[[_0x4174('0x7a'),_0x4174('0x7b')],[_0x4174('0x7c'),_0x297e33[0x0][_0x4174('0x73')]===_0x4174('0x7b')?_0x4174('0x7d'):_0x4174('0x7b')],db[_0x4174('0x74')][_0x4174('0x7e')](_0x4174('0x7f')),['id',_0x4174('0x7d')]];}else{if(!_[_0x4174('0x78')](_0x369393[_0x4174('0x52')][_0x4174('0x79')])){_0xa94e4b['id']={'$notIn':_0x369393[_0x4174('0x52')][_0x4174('0x79')]};}_0x95e3ec=[[_0x4174('0x7a'),_0x4174('0x7d')],['scheduledAt',_0x297e33[0x0]['dialOrderByScheduledAt']],db[_0x4174('0x74')][_0x4174('0x7e')](_0x4174('0x80')),['id',_0x4174('0x7b')]];}return db['CmHopper'][_0x4174('0x81')]({'attributes':['id',_0x4174('0x82')],'where':_0xa94e4b,'order':_0x95e3ec,'transaction':_0x1331ee,'lock':_0x1331ee[_0x4174('0x83')][_0x4174('0x84')],'include':[{'model':db[_0x4174('0x68')],'as':_0x4174('0x85'),'attributes':_0x32016b,'include':[{'model':db[_0x4174('0x86')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x4174('0x87')],'as':_0x4174('0x88'),'attributes':['id','name']},{'model':db[_0x4174('0x57')],'as':'Queue','attributes':['id',_0x4174('0x89'),_0x4174('0x8a')]}]})[_0x4174('0x20')](function(_0x3ee448){if(_0x3ee448){return _0x3ee448[_0x4174('0x1f')]({'UserId':_0x369393[_0x4174('0x5f')]['id']},{'transaction':_0x1331ee});}});});}})[_0x4174('0x20')](handleEntityNotFound(_0x1377ce,null))['then'](respondWithResult(_0x1377ce,null))[_0x4174('0x4b')](handleError(_0x1377ce,null));};exports[_0x4174('0x8b')]=function(_0x381063,_0x1dc67e,_0x50c9de){return _0x381063[_0x4174('0x5f')][_0x4174('0x71')]({'where':{'type':_0x4174('0x72'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x4a7423){if(_0x4a7423&&_0x4a7423[_0x4174('0x3d')]){return db[_0x4174('0x22')][_0x4174('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4174('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x4174('0x44')](_0x4a7423,'id')},'$or':[{'UserId':null},{'UserId':_0x381063[_0x4174('0x5f')]['id']}]}});}return 0x0;})[_0x4174('0x20')](function(_0x1c2eef){if(!_['isNil'](_0x1c2eef)&&_['isNumber'](_0x1c2eef)){return _0x1dc67e[_0x4174('0x15')](0xc8)[_0x4174('0x16')]({'contacts':_0x1c2eef});}else{logger[_0x4174('0x8c')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4174('0x8b'),0x194,'entity\x20not\x20found');_0x1dc67e[_0x4174('0x14')](0x194);}})[_0x4174('0x4b')](handleError(_0x1dc67e,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index b5aef10..351dcd4 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 _0x2c32=['scheduledat','priority','../../config/logger','api','bluebird','request-promise','exports','define','CmHopper'];(function(_0x39319a,_0x3615fe){var _0x27b9ef=function(_0x322068){while(--_0x322068){_0x39319a['push'](_0x39319a['shift']());}};_0x27b9ef(++_0x3615fe);}(_0x2c32,0x14f));var _0x22c3=function(_0x67021b,_0x1893c2){_0x67021b=_0x67021b-0x0;var _0x410575=_0x2c32[_0x67021b];return _0x410575;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x22c3('0x0'))(_0x22c3('0x1'));var moment=require('moment');var BPromise=require(_0x22c3('0x2'));var rp=require(_0x22c3('0x3'));var attributes=require('./cmHopper.attributes');module[_0x22c3('0x4')]=function(_0x3232e7,_0x46f64b){return _0x3232e7[_0x22c3('0x5')](_0x22c3('0x6'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x22c3('0x7'),'fields':[_0x22c3('0x7')]},{'name':'phone','fields':['phone']},{'name':_0x22c3('0x8'),'fields':[_0x22c3('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd92=['CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird','./cmHopper.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd92,0x191));var _0x2bd9=function(_0x520b5f,_0x336536){_0x520b5f=_0x520b5f-0x0;var _0x1da52e=_0xbd92[_0x520b5f];return _0x1da52e;};'use strict';var _=require(_0x2bd9('0x0'));var util=require('util');var logger=require(_0x2bd9('0x1'))(_0x2bd9('0x2'));var moment=require(_0x2bd9('0x3'));var BPromise=require(_0x2bd9('0x4'));var rp=require('request-promise');var attributes=require(_0x2bd9('0x5'));module['exports']=function(_0x1602f8,_0x1d941d){return _0x1602f8[_0x2bd9('0x6')](_0x2bd9('0x7'),attributes,{'tableName':_0x2bd9('0x8'),'paranoid':![],'indexes':[{'name':_0x2bd9('0x9'),'fields':[_0x2bd9('0x9')]},{'name':'phone','fields':[_0x2bd9('0xa')]},{'name':'priority','fields':[_0x2bd9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 3fa0839..27f22b7 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 _0x8d2b=['CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','CmContact','describe','UserId','all','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','find','ShowCmHopper','catch','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','sequelize','transaction','order','LOCK','UPDATE','keys','length','push','MoveContactManagedDialer'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8d2b,0x146));var _0xb8d2=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x8d2b[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xb8d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8d2('0x1'));var rs=require(_0xb8d2('0x2'));var fs=require('fs');var Redis=require(_0xb8d2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8d2('0x4'));var logger=require('../../config/logger')(_0xb8d2('0x5'));var config=require(_0xb8d2('0x6'));var jayson=require(_0xb8d2('0x7'));var client=jayson[_0xb8d2('0x8')][_0xb8d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2127b6,_0x9a1630,_0x3b0744){return new BPromise(function(_0x4e900b,_0x4a88d3){return client['request'](_0x2127b6,_0x3b0744)['then'](function(_0x5c26fa){logger[_0xb8d2('0xa')](_0xb8d2('0xb'),_0x9a1630,_0xb8d2('0xc'));logger[_0xb8d2('0xd')](_0xb8d2('0xe'),_0x9a1630,'request\x20sent',JSON['stringify'](_0x5c26fa));if(_0x5c26fa[_0xb8d2('0xf')]){if(_0x5c26fa[_0xb8d2('0xf')][_0xb8d2('0x10')]===0x1f4){logger[_0xb8d2('0xf')](_0xb8d2('0xb'),_0x9a1630,_0x5c26fa[_0xb8d2('0xf')][_0xb8d2('0x11')]);return _0x4a88d3(_0x5c26fa['error'][_0xb8d2('0x11')]);}logger['error'](_0xb8d2('0xb'),_0x9a1630,_0x5c26fa['error'][_0xb8d2('0x11')]);return _0x4e900b(_0x5c26fa[_0xb8d2('0xf')][_0xb8d2('0x11')]);}else{logger['info'](_0xb8d2('0xb'),_0x9a1630,_0xb8d2('0xc'));_0x4e900b(_0x5c26fa[_0xb8d2('0x12')][_0xb8d2('0x11')]);}})['catch'](function(_0x315768){logger['error']('CmHopper,\x20%s,\x20%s',_0x9a1630,_0x315768);_0x4a88d3(_0x315768);});});}exports[_0xb8d2('0x13')]=function(_0x1fdc51){var _0x4e7fd5=this;return new Promise(function(_0xebdaec,_0x567ccc){return db[_0xb8d2('0x14')][_0xb8d2('0x15')]({'raw':_0x1fdc51[_0xb8d2('0x16')]?_0x1fdc51['options'][_0xb8d2('0x17')]===undefined?!![]:![]:!![],'where':_0x1fdc51[_0xb8d2('0x16')]?_0x1fdc51['options'][_0xb8d2('0x18')]||null:null,'attributes':_0x1fdc51[_0xb8d2('0x16')]?_0x1fdc51[_0xb8d2('0x16')][_0xb8d2('0x19')]||null:null,'limit':_0x1fdc51[_0xb8d2('0x16')]?_0x1fdc51['options'][_0xb8d2('0x1a')]||null:null,'include':_0x1fdc51['options']?_0x1fdc51['options'][_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x1fdc51[_0xb8d2('0x16')][_0xb8d2('0x1b')],function(_0x5e0781){return{'model':db[_0x5e0781[_0xb8d2('0x1d')]],'as':_0x5e0781['as'],'attributes':_0x5e0781[_0xb8d2('0x19')],'include':_0x5e0781['include']?_[_0xb8d2('0x1c')](_0x5e0781[_0xb8d2('0x1b')],function(_0x52d1d2){return{'model':db[_0x52d1d2['model']],'as':_0x52d1d2['as'],'attributes':_0x52d1d2[_0xb8d2('0x19')],'include':_0x52d1d2['include']?_[_0xb8d2('0x1c')](_0x52d1d2[_0xb8d2('0x1b')],function(_0x2449c5){return{'model':db[_0x2449c5[_0xb8d2('0x1d')]],'as':_0x2449c5['as'],'attributes':_0x2449c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xb8d2('0x1e')](function(_0x3d4f31){logger[_0xb8d2('0xa')]('GetCmHopper',_0x1fdc51);logger[_0xb8d2('0xd')](_0xb8d2('0x13'),_0x1fdc51,JSON[_0xb8d2('0x1f')](_0x3d4f31));_0xebdaec(_0x3d4f31);})['catch'](function(_0x19524c){logger['error'](_0xb8d2('0x13'),_0x19524c[_0xb8d2('0x11')],_0x1fdc51);_0x567ccc(_0x4e7fd5['error'](0x1f4,_0x19524c[_0xb8d2('0x11')]));});});};exports['ShowCmHopper']=function(_0x4f76e0){var _0x3dfb9e=this;return new Promise(function(_0x9db9c4,_0x30a533){return db[_0xb8d2('0x14')][_0xb8d2('0x20')]({'raw':_0x4f76e0['options']?_0x4f76e0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f76e0[_0xb8d2('0x16')]?_0x4f76e0[_0xb8d2('0x16')]['where']||null:null,'attributes':_0x4f76e0[_0xb8d2('0x16')]?_0x4f76e0['options'][_0xb8d2('0x19')]||null:null,'include':_0x4f76e0[_0xb8d2('0x16')]?_0x4f76e0[_0xb8d2('0x16')][_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x4f76e0[_0xb8d2('0x16')]['include'],function(_0x142d3c){return{'model':db[_0x142d3c[_0xb8d2('0x1d')]],'as':_0x142d3c['as'],'attributes':_0x142d3c[_0xb8d2('0x19')],'include':_0x142d3c[_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x142d3c['include'],function(_0x2f3919){return{'model':db[_0x2f3919[_0xb8d2('0x1d')]],'as':_0x2f3919['as'],'attributes':_0x2f3919[_0xb8d2('0x19')],'include':_0x2f3919['include']?_['map'](_0x2f3919[_0xb8d2('0x1b')],function(_0x1a2ebc){return{'model':db[_0x1a2ebc[_0xb8d2('0x1d')]],'as':_0x1a2ebc['as'],'attributes':_0x1a2ebc[_0xb8d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb8d2('0x1e')](function(_0x12d9f9){logger[_0xb8d2('0xa')](_0xb8d2('0x21'),_0x4f76e0);logger[_0xb8d2('0xd')](_0xb8d2('0x21'),_0x4f76e0,JSON['stringify'](_0x12d9f9));_0x9db9c4(_0x12d9f9);})[_0xb8d2('0x22')](function(_0x584ba6){logger[_0xb8d2('0xf')](_0xb8d2('0x21'),_0x584ba6[_0xb8d2('0x11')],_0x4f76e0);_0x30a533(_0x3dfb9e[_0xb8d2('0xf')](0x1f4,_0x584ba6[_0xb8d2('0x11')]));});});};exports['CreateCmHopper']=function(_0xc966e8){var _0xd7ff5c=this;return new Promise(function(_0x4334cc,_0x382af7){return db[_0xb8d2('0x14')][_0xb8d2('0x23')](_0xc966e8[_0xb8d2('0x24')],{'raw':_0xc966e8[_0xb8d2('0x16')]?_0xc966e8[_0xb8d2('0x16')][_0xb8d2('0x17')]===undefined?!![]:![]:!![]})[_0xb8d2('0x1e')](function(_0x4ecbce){logger[_0xb8d2('0xa')]('CreateCmHopper',_0xc966e8);logger[_0xb8d2('0xd')](_0xb8d2('0x25'),_0xc966e8,JSON[_0xb8d2('0x1f')](_0x4ecbce));_0x4334cc(_0x4ecbce);})[_0xb8d2('0x22')](function(_0x5eec48){logger[_0xb8d2('0xf')]('CreateCmHopper',_0x5eec48['message'],_0xc966e8);_0x382af7(_0xd7ff5c[_0xb8d2('0xf')](0x1f4,_0x5eec48[_0xb8d2('0x11')]));});});};exports[_0xb8d2('0x26')]=function(_0x4567cb){var _0x3da41c=this;return new Promise(function(_0xfc8107,_0x2b6fc5){return db['CmHopper'][_0xb8d2('0x27')](_0x4567cb[_0xb8d2('0x24')],{'raw':_0x4567cb['options']?_0x4567cb[_0xb8d2('0x16')][_0xb8d2('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4567cb[_0xb8d2('0x16')]?_0x4567cb['options'][_0xb8d2('0x18')]||null:null,'attributes':_0x4567cb[_0xb8d2('0x16')]?_0x4567cb[_0xb8d2('0x16')][_0xb8d2('0x19')]||null:null,'limit':_0x4567cb[_0xb8d2('0x16')]?_0x4567cb[_0xb8d2('0x16')]['limit']||null:null})[_0xb8d2('0x1e')](function(_0x406b9c){logger[_0xb8d2('0xa')]('UpdateCmHopper',_0x4567cb);logger['debug'](_0xb8d2('0x26'),_0x4567cb,JSON['stringify'](_0x406b9c));_0xfc8107(_0x406b9c);})[_0xb8d2('0x22')](function(_0xe91f11){logger[_0xb8d2('0xf')](_0xb8d2('0x26'),_0xe91f11[_0xb8d2('0x11')],_0x4567cb);_0x2b6fc5(_0x3da41c[_0xb8d2('0xf')](0x1f4,_0xe91f11[_0xb8d2('0x11')]));});});};exports[_0xb8d2('0x28')]=function(_0x452ea9){var _0x6e6e38=this;return new Promise(function(_0x332d85,_0x44f8ea){return db[_0xb8d2('0x14')][_0xb8d2('0x29')]({'where':_0x452ea9['options']?_0x452ea9[_0xb8d2('0x16')][_0xb8d2('0x18')]||null:null})[_0xb8d2('0x1e')](function(_0x27384c){logger['info'](_0xb8d2('0x28'),_0x452ea9);logger['debug'](_0xb8d2('0x28'),_0x452ea9,JSON[_0xb8d2('0x1f')](_0x27384c));_0x332d85(_0x27384c);})['catch'](function(_0x562a82){logger[_0xb8d2('0xf')](_0xb8d2('0x28'),_0x562a82[_0xb8d2('0x11')],_0x452ea9);_0x44f8ea(_0x6e6e38[_0xb8d2('0xf')](0x1f4,_0x562a82[_0xb8d2('0x11')]));});});};exports[_0xb8d2('0x2a')]=function(_0xf9a56){var _0x2dd2ad=this;return new Promise(function(_0x50252c,_0x42cadc){return db['CmContact']['describe']()[_0xb8d2('0x1e')](function(_0x183594){return db[_0xb8d2('0x2b')][_0xb8d2('0x2c')](function(_0x3576bf){return db[_0xb8d2('0x14')]['findAll']({'where':_0xf9a56[_0xb8d2('0x16')]?_0xf9a56[_0xb8d2('0x16')][_0xb8d2('0x18')]||null:null,'attributes':_0xf9a56[_0xb8d2('0x16')]?_0xf9a56['options']['attributes']||null:null,'limit':_0xf9a56[_0xb8d2('0x16')]?_0xf9a56[_0xb8d2('0x16')]['limit']||null:null,'order':_0xf9a56['options']?_0xf9a56[_0xb8d2('0x16')][_0xb8d2('0x2d')]||null:null,'transaction':_0x3576bf,'lock':_0x3576bf[_0xb8d2('0x2e')][_0xb8d2('0x2f')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0xb8d2('0x30')](_0x183594)}]})['then'](function(_0x585297){var _0x4e415f=[];for(var _0x2ca603=0x0;_0x2ca603<_0x585297[_0xb8d2('0x31')];_0x2ca603+=0x1){_0x4e415f[_0xb8d2('0x32')](_0x585297[_0x2ca603][_0xb8d2('0x27')](_0xf9a56[_0xb8d2('0x24')],{'transaction':_0x3576bf}));}return BPromise['all'](_0x4e415f);});})[_0xb8d2('0x1e')](function(_0x41fd9f){logger[_0xb8d2('0xa')](_0xb8d2('0x2a'),_0xf9a56);logger[_0xb8d2('0xd')](_0xb8d2('0x2a'),_0xf9a56,JSON[_0xb8d2('0x1f')](_0x41fd9f));_0x50252c(_0x41fd9f);})[_0xb8d2('0x22')](function(_0x2bb754){logger[_0xb8d2('0xf')]('GetContactDialer',_0x2bb754[_0xb8d2('0x11')],_0xf9a56);_0x42cadc(_0x2dd2ad['error'](0x1f4,_0x2bb754[_0xb8d2('0x11')]));});});});};exports[_0xb8d2('0x33')]=function(_0x4e0787){var _0x40870a=this;return new Promise(function(_0x340a71,_0x31f455){return db[_0xb8d2('0x2b')][_0xb8d2('0x2c')](function(_0x344b77){return db['CmHopperFinal']['create'](_0x4e0787['body'],{'raw':_0x4e0787[_0xb8d2('0x16')]?_0x4e0787['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x344b77})[_0xb8d2('0x1e')](function(){return db['CmHopper'][_0xb8d2('0x29')]({'where':_0x4e0787[_0xb8d2('0x16')]?_0x4e0787[_0xb8d2('0x16')]['where']||null:null,'transaction':_0x344b77});});})[_0xb8d2('0x1e')](function(_0x9b6c80){logger[_0xb8d2('0xa')]('MoveContactManagedDialer',_0x4e0787);logger['debug'](_0xb8d2('0x33'),_0x4e0787,JSON[_0xb8d2('0x1f')](_0x9b6c80));_0x340a71(_0x9b6c80);})[_0xb8d2('0x22')](function(_0x503a11){logger[_0xb8d2('0xf')](_0xb8d2('0x33'),_0x503a11[_0xb8d2('0x11')],_0x4e0787);_0x31f455(_0x40870a[_0xb8d2('0xf')](0x1f4,_0x503a11[_0xb8d2('0x11')]));});});};exports[_0xb8d2('0x34')]=function(_0x13edc2){var _0x5631bb=this;return new Promise(function(_0x37cc77,_0x398f25){return db[_0xb8d2('0x14')]['findAll']({'raw':_0x13edc2[_0xb8d2('0x16')]?_0x13edc2[_0xb8d2('0x16')][_0xb8d2('0x17')]===undefined?!![]:![]:!![],'where':_0x13edc2[_0xb8d2('0x16')]?_0x13edc2[_0xb8d2('0x16')][_0xb8d2('0x18')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb8d2('0x35'),db[_0xb8d2('0x2b')]['fn']('IF',db[_0xb8d2('0x2b')][_0xb8d2('0x36')]('`scheduledat`\x20>=\x20'+util[_0xb8d2('0x37')]('\x22%s\x22',moment()[_0xb8d2('0x37')](_0xb8d2('0x38')))+'\x20,\x201,\x20null'))),_0xb8d2('0x39')]]})[_0xb8d2('0x1e')](function(_0x5228f5){logger['info'](_0xb8d2('0x34'),_0x13edc2);logger[_0xb8d2('0xd')](_0xb8d2('0x34'),_0x13edc2,JSON['stringify'](_0x5228f5));_0x37cc77(_0x5228f5);})['catch'](function(_0x441cef){logger['error']('CountReScheduled',_0x441cef['message'],_0x13edc2);_0x398f25(_0x5631bb[_0xb8d2('0xf')](0x1f4,_0x441cef[_0xb8d2('0x11')]));});});};exports[_0xb8d2('0x3a')]=function(_0x188fed){var _0x54ac2b=this;return new Promise(function(_0x25ad4d,_0x336dc6){return db[_0xb8d2('0x3b')][_0xb8d2('0x3c')]()[_0xb8d2('0x1e')](function(_0xb0eaea){return db[_0xb8d2('0x2b')][_0xb8d2('0x2c')](function(_0x1418eb){return db['CmHopper'][_0xb8d2('0x15')]({'where':_0x188fed[_0xb8d2('0x16')]?_0x188fed['options'][_0xb8d2('0x18')]||null:null,'attributes':_0x188fed[_0xb8d2('0x16')]?_0x188fed[_0xb8d2('0x16')][_0xb8d2('0x19')]||null:null,'limit':0x1,'order':_0x188fed['options']?_0x188fed['options'][_0xb8d2('0x2d')]||null:null,'group':db[_0xb8d2('0x14')][_0xb8d2('0x3d')],'transaction':_0x1418eb,'lock':_0x1418eb[_0xb8d2('0x2e')][_0xb8d2('0x2f')],'include':_0x188fed[_0xb8d2('0x16')]?_0x188fed[_0xb8d2('0x16')][_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x188fed['options']['include'],function(_0x19542a){return{'model':db[_0x19542a[_0xb8d2('0x1d')]],'as':_0x19542a['as'],'attributes':_0x19542a['attributes'],'include':_0x19542a[_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x19542a['include'],function(_0x558642){return{'model':db[_0x558642[_0xb8d2('0x1d')]],'as':_0x558642['as'],'attributes':_0x558642[_0xb8d2('0x19')],'include':_0x558642[_0xb8d2('0x1b')]?_[_0xb8d2('0x1c')](_0x558642[_0xb8d2('0x1b')],function(_0x34ae1b){return{'model':db[_0x34ae1b[_0xb8d2('0x1d')]],'as':_0x34ae1b['as'],'attributes':_0x34ae1b[_0xb8d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb8d2('0x1e')](function(_0x5d2c5c){var _0x20f77a=[];for(var _0x1f91dd=0x0;_0x1f91dd<_0x5d2c5c[_0xb8d2('0x31')];_0x1f91dd+=0x1){_0x20f77a['push'](_0x5d2c5c[_0x1f91dd][_0xb8d2('0x27')](_0x188fed[_0xb8d2('0x24')],{'transaction':_0x1418eb}));}return BPromise[_0xb8d2('0x3e')](_0x20f77a);});})[_0xb8d2('0x1e')](function(_0x1a0d3e){logger['info'](_0xb8d2('0x3a'),_0x188fed);logger[_0xb8d2('0xd')](_0xb8d2('0x3a'),_0x188fed,JSON[_0xb8d2('0x1f')](_0x1a0d3e));_0x25ad4d(_0x1a0d3e);})['catch'](function(_0x13a21a){logger[_0xb8d2('0xf')](_0xb8d2('0x3a'),_0x13a21a['message'],_0x188fed);_0x336dc6(_0x54ac2b[_0xb8d2('0xf')](0x1f4,_0x13a21a[_0xb8d2('0x11')]));});});});}; \ No newline at end of file +var _0x2811=['CmHopperFinal','destroy','MoveContactManagedDialer','CountReScheduled','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','UserId','UPDATE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper,\x20%s,\x20%s','CmHopper','findAll','options','raw','where','attributes','include','model','map','GetCmHopper','find','then','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','limit','order','LOCK','Contact','length','push','all'];(function(_0x462577,_0x3a25c1){var _0x238cca=function(_0xe6f466){while(--_0xe6f466){_0x462577['push'](_0x462577['shift']());}};_0x238cca(++_0x3a25c1);}(_0x2811,0x92));var _0x1281=function(_0x3f1913,_0x46bc73){_0x3f1913=_0x3f1913-0x0;var _0x28fc2d=_0x2811[_0x3f1913];return _0x28fc2d;};'use strict';var _=require(_0x1281('0x0'));var util=require(_0x1281('0x1'));var moment=require(_0x1281('0x2'));var BPromise=require(_0x1281('0x3'));var rs=require(_0x1281('0x4'));var fs=require('fs');var Redis=require(_0x1281('0x5'));var db=require(_0x1281('0x6'))['db'];var utils=require(_0x1281('0x7'));var logger=require('../../config/logger')(_0x1281('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1281('0x9')][_0x1281('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa6d9cb,_0x564373,_0x4a7017){return new BPromise(function(_0xd212ad,_0x3801fa){return client[_0x1281('0xb')](_0xa6d9cb,_0x4a7017)['then'](function(_0x22c333){logger[_0x1281('0xc')]('CmHopper,\x20%s,\x20%s',_0x564373,_0x1281('0xd'));logger[_0x1281('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x564373,_0x1281('0xd'),JSON[_0x1281('0xf')](_0x22c333));if(_0x22c333[_0x1281('0x10')]){if(_0x22c333[_0x1281('0x10')][_0x1281('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x564373,_0x22c333[_0x1281('0x10')][_0x1281('0x12')]);return _0x3801fa(_0x22c333[_0x1281('0x10')][_0x1281('0x12')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x564373,_0x22c333['error'][_0x1281('0x12')]);return _0xd212ad(_0x22c333[_0x1281('0x10')][_0x1281('0x12')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x564373,_0x1281('0xd'));_0xd212ad(_0x22c333[_0x1281('0x13')][_0x1281('0x12')]);}})[_0x1281('0x14')](function(_0x3f1769){logger[_0x1281('0x10')](_0x1281('0x15'),_0x564373,_0x3f1769);_0x3801fa(_0x3f1769);});});}exports['GetCmHopper']=function(_0x764add){var _0x5b4da3=this;return new Promise(function(_0x15d7e4,_0x25060e){return db[_0x1281('0x16')][_0x1281('0x17')]({'raw':_0x764add[_0x1281('0x18')]?_0x764add[_0x1281('0x18')][_0x1281('0x19')]===undefined?!![]:![]:!![],'where':_0x764add[_0x1281('0x18')]?_0x764add[_0x1281('0x18')][_0x1281('0x1a')]||null:null,'attributes':_0x764add[_0x1281('0x18')]?_0x764add[_0x1281('0x18')][_0x1281('0x1b')]||null:null,'limit':_0x764add['options']?_0x764add[_0x1281('0x18')]['limit']||null:null,'include':_0x764add[_0x1281('0x18')]?_0x764add[_0x1281('0x18')]['include']?_['map'](_0x764add[_0x1281('0x18')][_0x1281('0x1c')],function(_0x1eab4e){return{'model':db[_0x1eab4e[_0x1281('0x1d')]],'as':_0x1eab4e['as'],'attributes':_0x1eab4e[_0x1281('0x1b')],'include':_0x1eab4e[_0x1281('0x1c')]?_[_0x1281('0x1e')](_0x1eab4e[_0x1281('0x1c')],function(_0x1e4795){return{'model':db[_0x1e4795[_0x1281('0x1d')]],'as':_0x1e4795['as'],'attributes':_0x1e4795[_0x1281('0x1b')],'include':_0x1e4795[_0x1281('0x1c')]?_[_0x1281('0x1e')](_0x1e4795[_0x1281('0x1c')],function(_0x39e0c6){return{'model':db[_0x39e0c6[_0x1281('0x1d')]],'as':_0x39e0c6['as'],'attributes':_0x39e0c6[_0x1281('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cd0ee){logger['info'](_0x1281('0x1f'),_0x764add);logger[_0x1281('0xe')]('GetCmHopper',_0x764add,JSON['stringify'](_0x1cd0ee));_0x15d7e4(_0x1cd0ee);})[_0x1281('0x14')](function(_0x4bac3c){logger[_0x1281('0x10')](_0x1281('0x1f'),_0x4bac3c[_0x1281('0x12')],_0x764add);_0x25060e(_0x5b4da3[_0x1281('0x10')](0x1f4,_0x4bac3c['message']));});});};exports['ShowCmHopper']=function(_0x27152f){var _0xce2c1a=this;return new Promise(function(_0x50c8d6,_0x4ee5af){return db[_0x1281('0x16')][_0x1281('0x20')]({'raw':_0x27152f[_0x1281('0x18')]?_0x27152f[_0x1281('0x18')][_0x1281('0x19')]===undefined?!![]:![]:!![],'where':_0x27152f['options']?_0x27152f[_0x1281('0x18')][_0x1281('0x1a')]||null:null,'attributes':_0x27152f[_0x1281('0x18')]?_0x27152f['options'][_0x1281('0x1b')]||null:null,'include':_0x27152f[_0x1281('0x18')]?_0x27152f[_0x1281('0x18')][_0x1281('0x1c')]?_['map'](_0x27152f['options'][_0x1281('0x1c')],function(_0x215f62){return{'model':db[_0x215f62[_0x1281('0x1d')]],'as':_0x215f62['as'],'attributes':_0x215f62['attributes'],'include':_0x215f62[_0x1281('0x1c')]?_['map'](_0x215f62['include'],function(_0x5f0337){return{'model':db[_0x5f0337['model']],'as':_0x5f0337['as'],'attributes':_0x5f0337[_0x1281('0x1b')],'include':_0x5f0337[_0x1281('0x1c')]?_[_0x1281('0x1e')](_0x5f0337[_0x1281('0x1c')],function(_0x4402de){return{'model':db[_0x4402de[_0x1281('0x1d')]],'as':_0x4402de['as'],'attributes':_0x4402de['attributes']};}):[]};}):[]};}):[]:[]})[_0x1281('0x21')](function(_0x36c00a){logger[_0x1281('0xc')]('ShowCmHopper',_0x27152f);logger[_0x1281('0xe')](_0x1281('0x22'),_0x27152f,JSON['stringify'](_0x36c00a));_0x50c8d6(_0x36c00a);})[_0x1281('0x14')](function(_0xd8244){logger[_0x1281('0x10')](_0x1281('0x22'),_0xd8244[_0x1281('0x12')],_0x27152f);_0x4ee5af(_0xce2c1a[_0x1281('0x10')](0x1f4,_0xd8244[_0x1281('0x12')]));});});};exports[_0x1281('0x23')]=function(_0xfa0fba){var _0x39a33c=this;return new Promise(function(_0x3c956d,_0x4c0ea5){return db[_0x1281('0x16')][_0x1281('0x24')](_0xfa0fba[_0x1281('0x25')],{'raw':_0xfa0fba['options']?_0xfa0fba['options'][_0x1281('0x19')]===undefined?!![]:![]:!![]})[_0x1281('0x21')](function(_0x4a6223){logger[_0x1281('0xc')](_0x1281('0x23'),_0xfa0fba);logger[_0x1281('0xe')](_0x1281('0x23'),_0xfa0fba,JSON[_0x1281('0xf')](_0x4a6223));_0x3c956d(_0x4a6223);})[_0x1281('0x14')](function(_0x38feaf){logger['error']('CreateCmHopper',_0x38feaf['message'],_0xfa0fba);_0x4c0ea5(_0x39a33c[_0x1281('0x10')](0x1f4,_0x38feaf[_0x1281('0x12')]));});});};exports[_0x1281('0x26')]=function(_0x5a9968){var _0x350a2e=this;return new Promise(function(_0x523112,_0x2330f1){return db['CmHopper'][_0x1281('0x27')](_0x5a9968[_0x1281('0x25')],{'raw':_0x5a9968[_0x1281('0x18')]?_0x5a9968[_0x1281('0x18')][_0x1281('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a9968[_0x1281('0x18')]?_0x5a9968[_0x1281('0x18')]['where']||null:null,'attributes':_0x5a9968['options']?_0x5a9968[_0x1281('0x18')]['attributes']||null:null,'limit':_0x5a9968['options']?_0x5a9968['options']['limit']||null:null})[_0x1281('0x21')](function(_0x3d437e){logger['info']('UpdateCmHopper',_0x5a9968);logger[_0x1281('0xe')](_0x1281('0x26'),_0x5a9968,JSON[_0x1281('0xf')](_0x3d437e));_0x523112(_0x3d437e);})[_0x1281('0x14')](function(_0x3ae739){logger['error'](_0x1281('0x26'),_0x3ae739[_0x1281('0x12')],_0x5a9968);_0x2330f1(_0x350a2e[_0x1281('0x10')](0x1f4,_0x3ae739[_0x1281('0x12')]));});});};exports[_0x1281('0x28')]=function(_0x5ad119){var _0x2c3189=this;return new Promise(function(_0x42f284,_0x1199d5){return db[_0x1281('0x16')]['destroy']({'where':_0x5ad119['options']?_0x5ad119[_0x1281('0x18')][_0x1281('0x1a')]||null:null})['then'](function(_0x3b108e){logger[_0x1281('0xc')](_0x1281('0x28'),_0x5ad119);logger[_0x1281('0xe')](_0x1281('0x28'),_0x5ad119,JSON[_0x1281('0xf')](_0x3b108e));_0x42f284(_0x3b108e);})[_0x1281('0x14')](function(_0x56adff){logger[_0x1281('0x10')](_0x1281('0x28'),_0x56adff[_0x1281('0x12')],_0x5ad119);_0x1199d5(_0x2c3189[_0x1281('0x10')](0x1f4,_0x56adff[_0x1281('0x12')]));});});};exports[_0x1281('0x29')]=function(_0x1b1be7){var _0x22fda6=this;return new Promise(function(_0x4fa0c1,_0x3c321b){return db[_0x1281('0x2a')]['describe']()['then'](function(_0xc36c6e){return db[_0x1281('0x2b')][_0x1281('0x2c')](function(_0x462b19){return db['CmHopper'][_0x1281('0x17')]({'where':_0x1b1be7[_0x1281('0x18')]?_0x1b1be7[_0x1281('0x18')]['where']||null:null,'attributes':_0x1b1be7['options']?_0x1b1be7[_0x1281('0x18')][_0x1281('0x1b')]||null:null,'limit':_0x1b1be7['options']?_0x1b1be7[_0x1281('0x18')][_0x1281('0x2d')]||null:null,'order':_0x1b1be7[_0x1281('0x18')]?_0x1b1be7[_0x1281('0x18')][_0x1281('0x2e')]||null:null,'transaction':_0x462b19,'lock':_0x462b19[_0x1281('0x2f')]['UPDATE'],'include':[{'model':db[_0x1281('0x2a')],'as':_0x1281('0x30'),'attributes':_['keys'](_0xc36c6e)}]})[_0x1281('0x21')](function(_0x3b0932){var _0x5ee309=[];for(var _0x272bf5=0x0;_0x272bf5<_0x3b0932[_0x1281('0x31')];_0x272bf5+=0x1){_0x5ee309[_0x1281('0x32')](_0x3b0932[_0x272bf5][_0x1281('0x27')](_0x1b1be7[_0x1281('0x25')],{'transaction':_0x462b19}));}return BPromise[_0x1281('0x33')](_0x5ee309);});})[_0x1281('0x21')](function(_0x1d0116){logger['info'](_0x1281('0x29'),_0x1b1be7);logger['debug']('GetContactDialer',_0x1b1be7,JSON[_0x1281('0xf')](_0x1d0116));_0x4fa0c1(_0x1d0116);})[_0x1281('0x14')](function(_0x3c39bb){logger[_0x1281('0x10')](_0x1281('0x29'),_0x3c39bb[_0x1281('0x12')],_0x1b1be7);_0x3c321b(_0x22fda6['error'](0x1f4,_0x3c39bb['message']));});});});};exports['MoveContactManagedDialer']=function(_0x470fbf){var _0x473122=this;return new Promise(function(_0x163d6e,_0x3340ac){return db['sequelize'][_0x1281('0x2c')](function(_0x6cc54b){return db[_0x1281('0x34')][_0x1281('0x24')](_0x470fbf[_0x1281('0x25')],{'raw':_0x470fbf[_0x1281('0x18')]?_0x470fbf[_0x1281('0x18')][_0x1281('0x19')]===undefined?!![]:![]:!![],'transaction':_0x6cc54b})['then'](function(){return db['CmHopper'][_0x1281('0x35')]({'where':_0x470fbf['options']?_0x470fbf['options']['where']||null:null,'transaction':_0x6cc54b});});})[_0x1281('0x21')](function(_0x284637){logger[_0x1281('0xc')]('MoveContactManagedDialer',_0x470fbf);logger[_0x1281('0xe')](_0x1281('0x36'),_0x470fbf,JSON[_0x1281('0xf')](_0x284637));_0x163d6e(_0x284637);})['catch'](function(_0x3398b1){logger['error'](_0x1281('0x36'),_0x3398b1[_0x1281('0x12')],_0x470fbf);_0x3340ac(_0x473122['error'](0x1f4,_0x3398b1[_0x1281('0x12')]));});});};exports[_0x1281('0x37')]=function(_0x14f100){var _0x1b1dff=this;return new Promise(function(_0x264be5,_0x3d41c0){return db['CmHopper'][_0x1281('0x17')]({'raw':_0x14f100['options']?_0x14f100[_0x1281('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x14f100[_0x1281('0x18')]?_0x14f100[_0x1281('0x18')][_0x1281('0x1a')]||null:null,'attributes':[[db[_0x1281('0x2b')]['fn']('COUNT',db[_0x1281('0x2b')]['fn']('IF',db[_0x1281('0x2b')]['literal'](_0x1281('0x38')+util[_0x1281('0x39')](_0x1281('0x3a'),moment()['format'](_0x1281('0x3b')))+_0x1281('0x3c')))),_0x1281('0x3d')]]})[_0x1281('0x21')](function(_0x1aa736){logger[_0x1281('0xc')](_0x1281('0x37'),_0x14f100);logger[_0x1281('0xe')]('CountReScheduled',_0x14f100,JSON[_0x1281('0xf')](_0x1aa736));_0x264be5(_0x1aa736);})[_0x1281('0x14')](function(_0x3bd4be){logger[_0x1281('0x10')]('CountReScheduled',_0x3bd4be[_0x1281('0x12')],_0x14f100);_0x3d41c0(_0x1b1dff[_0x1281('0x10')](0x1f4,_0x3bd4be[_0x1281('0x12')]));});});};exports[_0x1281('0x3e')]=function(_0x2a3ac8){var _0x1ea1d5=this;return new Promise(function(_0x15c3b9,_0x571bf7){return db[_0x1281('0x2a')][_0x1281('0x3f')]()[_0x1281('0x21')](function(_0x4fae72){return db['sequelize'][_0x1281('0x2c')](function(_0x674e46){return db[_0x1281('0x16')][_0x1281('0x17')]({'where':_0x2a3ac8[_0x1281('0x18')]?_0x2a3ac8[_0x1281('0x18')]['where']||null:null,'attributes':_0x2a3ac8[_0x1281('0x18')]?_0x2a3ac8[_0x1281('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x2a3ac8[_0x1281('0x18')]?_0x2a3ac8['options'][_0x1281('0x2e')]||null:null,'group':db[_0x1281('0x16')][_0x1281('0x40')],'transaction':_0x674e46,'lock':_0x674e46[_0x1281('0x2f')][_0x1281('0x41')],'include':_0x2a3ac8[_0x1281('0x18')]?_0x2a3ac8['options'][_0x1281('0x1c')]?_[_0x1281('0x1e')](_0x2a3ac8['options'][_0x1281('0x1c')],function(_0x4fa638){return{'model':db[_0x4fa638['model']],'as':_0x4fa638['as'],'attributes':_0x4fa638[_0x1281('0x1b')],'include':_0x4fa638[_0x1281('0x1c')]?_[_0x1281('0x1e')](_0x4fa638['include'],function(_0x23fcc1){return{'model':db[_0x23fcc1[_0x1281('0x1d')]],'as':_0x23fcc1['as'],'attributes':_0x23fcc1[_0x1281('0x1b')],'include':_0x23fcc1[_0x1281('0x1c')]?_['map'](_0x23fcc1['include'],function(_0x162f73){return{'model':db[_0x162f73[_0x1281('0x1d')]],'as':_0x162f73['as'],'attributes':_0x162f73[_0x1281('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1281('0x21')](function(_0x452f6b){var _0x29f7d3=[];for(var _0x26a9da=0x0;_0x26a9da<_0x452f6b['length'];_0x26a9da+=0x1){_0x29f7d3[_0x1281('0x32')](_0x452f6b[_0x26a9da][_0x1281('0x27')](_0x2a3ac8[_0x1281('0x25')],{'transaction':_0x674e46}));}return BPromise['all'](_0x29f7d3);});})[_0x1281('0x21')](function(_0x51f89b){logger['info']('GetContactRecallMe',_0x2a3ac8);logger['debug']('GetContactRecallMe',_0x2a3ac8,JSON['stringify'](_0x51f89b));_0x15c3b9(_0x51f89b);})[_0x1281('0x14')](function(_0x2d24b0){logger[_0x1281('0x10')](_0x1281('0x3e'),_0x2d24b0[_0x1281('0x12')],_0x2a3ac8);_0x571bf7(_0x1ea1d5[_0x1281('0x10')](0x1f4,_0x2d24b0[_0x1281('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c9799d2..e34b78f 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x400b04,_0x185f4f){var _0x512d8c=function(_0x23d20e){while(--_0x23d20e){_0x400b04['push'](_0x400b04['shift']());}};_0x512d8c(++_0x185f4f);}(_0x7a54,0x106));var _0x47a5=function(_0x7922a7,_0x32e5a3){_0x7922a7=_0x7922a7-0x0;var _0x1b92b2=_0x7a54[_0x7922a7];return _0x1b92b2;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x48e974,_0x25ec93){var _0x65078e=function(_0x2f4ba9){while(--_0x2f4ba9){_0x48e974['push'](_0x48e974['shift']());}};_0x65078e(++_0x25ec93);}(_0x7a54,0x106));var _0x47a5=function(_0x1843e6,_0x2e73bc){_0x1843e6=_0x1843e6-0x0;var _0x373712=_0x7a54[_0x1843e6];return _0x373712;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 014ddba..023c343 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 _0x07b5=['STRING','INTEGER','contactListQueue','moment'];(function(_0xb1db2d,_0x4d21fd){var _0x22f9bb=function(_0x548f5d){while(--_0x548f5d){_0xb1db2d['push'](_0xb1db2d['shift']());}};_0x22f9bb(++_0x4d21fd);}(_0x07b5,0x97));var _0x507b=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x07b5[_0x1d50f2];return _0x3769b8;};'use strict';var moment=require(_0x507b('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x507b('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x507b('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x507b('0x2')],'unique':_0x507b('0x3')},'VoiceQueueId':{'type':Sequelize[_0x507b('0x2')],'unique':_0x507b('0x3')}}; \ No newline at end of file +var _0xf882=['contactListQueue','sequelize','exports','INTEGER'];(function(_0x3dde8c,_0x3d571a){var _0x2c9e8e=function(_0x543d38){while(--_0x543d38){_0x3dde8c['push'](_0x3dde8c['shift']());}};_0x2c9e8e(++_0x3d571a);}(_0xf882,0x1d5));var _0x2f88=function(_0x3e14bc,_0x1bea10){_0x3e14bc=_0x3e14bc-0x0;var _0xd2d49c=_0xf882[_0x3e14bc];return _0xd2d49c;};'use strict';var moment=require('moment');var Sequelize=require(_0x2f88('0x0'));module[_0x2f88('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2f88('0x2')],'unique':_0x2f88('0x3')},'ListId':{'type':Sequelize[_0x2f88('0x2')],'unique':_0x2f88('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2f88('0x2')],'unique':_0x2f88('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 80d1a79..20e48cf 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 _0xe419=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','filters','attributes','intersection','query','fields','hasOwnProperty','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x5b6d64,_0x1a8e32){var _0xfc576e=function(_0x395f11){while(--_0x395f11){_0x5b6d64['push'](_0x5b6d64['shift']());}};_0xfc576e(++_0x1a8e32);}(_0xe419,0x8b));var _0x9e41=function(_0x117c77,_0xf15229){_0x117c77=_0x117c77-0x0;var _0x3b4e12=_0xe419[_0x117c77];return _0x3b4e12;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e41('0x0'));var rimraf=require(_0x9e41('0x1'));var zipdir=require(_0x9e41('0x2'));var jsonpatch=require(_0x9e41('0x3'));var rp=require('request-promise');var moment=require(_0x9e41('0x4'));var BPromise=require(_0x9e41('0x5'));var Mustache=require(_0x9e41('0x6'));var util=require(_0x9e41('0x7'));var path=require(_0x9e41('0x8'));var sox=require('sox');var csv=require(_0x9e41('0x9'));var ejs=require(_0x9e41('0xa'));var fs=require('fs');var _=require(_0x9e41('0xb'));var squel=require(_0x9e41('0xc'));var crypto=require(_0x9e41('0xd'));var jsforce=require(_0x9e41('0xe'));var deskjs=require(_0x9e41('0xf'));var toCsv=require(_0x9e41('0x9'));var querystring=require(_0x9e41('0x10'));var Papa=require(_0x9e41('0x11'));var authService=require(_0x9e41('0x12'));var hardwareService=require(_0x9e41('0x13'));var Redis=require(_0x9e41('0x14'));var qs=require(_0x9e41('0x15'));var logger=require(_0x9e41('0x16'))('api');var utils=require(_0x9e41('0x17'));var config=require(_0x9e41('0x18'));var db=require(_0x9e41('0x19'))['db'];function respondWithStatusCode(_0x226490,_0x38a588){_0x38a588=_0x38a588||0xcc;return function(_0x3ca207){if(_0x3ca207){return _0x226490['sendStatus'](_0x38a588);}return _0x226490[_0x9e41('0x1a')](_0x38a588)[_0x9e41('0x1b')]();};}function respondWithResult(_0xc94044,_0x41d223){_0x41d223=_0x41d223||0xc8;return function(_0x43b9a7){if(_0x43b9a7){return _0xc94044[_0x9e41('0x1a')](_0x41d223)[_0x9e41('0x1c')](_0x43b9a7);}};}function respondWithFilteredResult(_0x526689,_0x23f8f7){return function(_0x3e92a5){if(_0x3e92a5){var _0x32150c=_0x3e92a5[_0x9e41('0x1d')],_0x5183c1=_0x23f8f7['offset'],_0x484a61=_0x23f8f7[_0x9e41('0x1e')]+_0x23f8f7[_0x9e41('0x1f')],_0x1856e9;if(_0x484a61>=_0x32150c){_0x484a61=_0x32150c;_0x1856e9=0xc8;}else{_0x1856e9=0xce;}_0x526689[_0x9e41('0x1a')](_0x1856e9);return _0x526689[_0x9e41('0x20')](_0x9e41('0x21'),_0x5183c1+'-'+_0x484a61+'/'+_0x32150c)[_0x9e41('0x1c')](_0x3e92a5);}return null;};}function patchUpdates(_0x3cfaa8){return function(_0xe92013){try{jsonpatch[_0x9e41('0x22')](_0xe92013,_0x3cfaa8,!![]);}catch(_0x1cd430){return BPromise[_0x9e41('0x23')](_0x1cd430);}return _0xe92013[_0x9e41('0x24')]();};}function saveUpdates(_0x384e6f,_0x441f1a){return function(_0x31c378){if(_0x31c378){return _0x31c378[_0x9e41('0x25')](_0x384e6f)[_0x9e41('0x26')](function(_0x32a43e){return _0x32a43e;});}return null;};}function removeEntity(_0x5e4d91,_0x46a5df){return function(_0x51edf6){if(_0x51edf6){return _0x51edf6[_0x9e41('0x27')]()[_0x9e41('0x26')](function(){_0x5e4d91[_0x9e41('0x1a')](0xcc)[_0x9e41('0x1b')]();});}};}function handleEntityNotFound(_0x377fa2,_0x48b218){return function(_0x48d712){if(!_0x48d712){_0x377fa2[_0x9e41('0x28')](0x194);}return _0x48d712;};}function handleError(_0x53dd37,_0x35fa8f){_0x35fa8f=_0x35fa8f||0x1f4;return function(_0x543629){logger[_0x9e41('0x29')](_0x543629[_0x9e41('0x2a')]);if(_0x543629[_0x9e41('0x2b')]){delete _0x543629['name'];}_0x53dd37[_0x9e41('0x1a')](_0x35fa8f)[_0x9e41('0x2c')](_0x543629);};}exports[_0x9e41('0x2d')]=function(_0x25758c,_0x389e7a){var _0x429109={},_0x3715ea={},_0x5a136b={'count':0x0,'rows':[]};var _0x49277c=db[_0x9e41('0x2e')][_0x9e41('0x2f')];_0x3715ea[_0x9e41('0x30')]=_[_0x9e41('0x31')](_0x49277c);_0x3715ea['query']=_[_0x9e41('0x31')](_0x25758c['query']);_0x3715ea[_0x9e41('0x32')]=_['intersection'](_0x3715ea[_0x9e41('0x30')],_0x3715ea['query']);_0x429109[_0x9e41('0x33')]=_[_0x9e41('0x34')](_0x3715ea['model'],qs['fields'](_0x25758c[_0x9e41('0x35')][_0x9e41('0x36')]));_0x429109[_0x9e41('0x33')]=_0x429109[_0x9e41('0x33')]['length']?_0x429109[_0x9e41('0x33')]:_0x3715ea[_0x9e41('0x30')];if(!_0x25758c[_0x9e41('0x35')][_0x9e41('0x37')]('nolimit')){_0x429109['limit']=qs[_0x9e41('0x1f')](_0x25758c[_0x9e41('0x35')]['limit']);_0x429109[_0x9e41('0x1e')]=qs[_0x9e41('0x1e')](_0x25758c[_0x9e41('0x35')]['offset']);}_0x429109['order']=qs[_0x9e41('0x38')](_0x25758c[_0x9e41('0x35')][_0x9e41('0x38')]);_0x429109[_0x9e41('0x39')]=qs[_0x9e41('0x32')](_[_0x9e41('0x3a')](_0x25758c[_0x9e41('0x35')],_0x3715ea[_0x9e41('0x32')]));if(_0x25758c[_0x9e41('0x35')][_0x9e41('0x3b')]){_0x429109[_0x9e41('0x39')]=_[_0x9e41('0x3c')](_0x429109[_0x9e41('0x39')],{'$or':_['map'](_0x49277c,function(_0x4659b6){if(_0x4659b6[_0x9e41('0x3d')][_0x9e41('0x3e')]!==_0x9e41('0x3f')){var _0x3f775e={};_0x3f775e[_0x4659b6[_0x9e41('0x40')]]={'$like':'%'+_0x25758c[_0x9e41('0x35')][_0x9e41('0x3b')]+'%'};return _0x3f775e;}})});}_0x429109=_['merge']({},_0x429109,_0x25758c[_0x9e41('0x41')]);var _0x234774={'where':_0x429109[_0x9e41('0x39')]};return db[_0x9e41('0x2e')]['count'](_0x234774)[_0x9e41('0x26')](function(_0x1f21e6){_0x5a136b[_0x9e41('0x1d')]=_0x1f21e6;if(_0x25758c[_0x9e41('0x35')][_0x9e41('0x42')]){_0x429109[_0x9e41('0x43')]=[{'all':!![]}];}return db[_0x9e41('0x2e')][_0x9e41('0x44')](_0x429109);})[_0x9e41('0x26')](function(_0x3055a7){_0x5a136b[_0x9e41('0x45')]=_0x3055a7;return _0x5a136b;})[_0x9e41('0x26')](respondWithFilteredResult(_0x389e7a,_0x429109))[_0x9e41('0x46')](handleError(_0x389e7a,null));};exports[_0x9e41('0x47')]=function(_0x5d679d,_0x369a43){var _0x55d8e4={'raw':!![],'where':{'id':_0x5d679d[_0x9e41('0x48')]['id']}},_0x40e6b6={};_0x40e6b6[_0x9e41('0x30')]=_['keys'](db['CmHopperBlack'][_0x9e41('0x2f')]);_0x40e6b6[_0x9e41('0x35')]=_[_0x9e41('0x31')](_0x5d679d[_0x9e41('0x35')]);_0x40e6b6[_0x9e41('0x32')]=_[_0x9e41('0x34')](_0x40e6b6[_0x9e41('0x30')],_0x40e6b6[_0x9e41('0x35')]);_0x55d8e4[_0x9e41('0x33')]=_[_0x9e41('0x34')](_0x40e6b6['model'],qs[_0x9e41('0x36')](_0x5d679d[_0x9e41('0x35')][_0x9e41('0x36')]));_0x55d8e4[_0x9e41('0x33')]=_0x55d8e4[_0x9e41('0x33')][_0x9e41('0x49')]?_0x55d8e4[_0x9e41('0x33')]:_0x40e6b6[_0x9e41('0x30')];if(_0x5d679d[_0x9e41('0x35')][_0x9e41('0x42')]){_0x55d8e4[_0x9e41('0x43')]=[{'all':!![]}];}_0x55d8e4=_[_0x9e41('0x3c')]({},_0x55d8e4,_0x5d679d[_0x9e41('0x41')]);return db[_0x9e41('0x2e')][_0x9e41('0x4a')](_0x55d8e4)['then'](handleEntityNotFound(_0x369a43,null))[_0x9e41('0x26')](respondWithResult(_0x369a43,null))['catch'](handleError(_0x369a43,null));};exports['update']=function(_0x55fd2c,_0x26c968){if(_0x55fd2c[_0x9e41('0x4b')]['id']){delete _0x55fd2c['body']['id'];}return db['CmHopperBlack'][_0x9e41('0x4a')]({'where':{'id':_0x55fd2c[_0x9e41('0x48')]['id']}})['then'](handleEntityNotFound(_0x26c968,null))[_0x9e41('0x26')](saveUpdates(_0x55fd2c[_0x9e41('0x4b')],null))[_0x9e41('0x26')](respondWithResult(_0x26c968,null))['catch'](handleError(_0x26c968,null));};exports['destroy']=function(_0x43df1b,_0x46463a){return db[_0x9e41('0x2e')][_0x9e41('0x4a')]({'where':{'id':_0x43df1b[_0x9e41('0x48')]['id']}})[_0x9e41('0x26')](handleEntityNotFound(_0x46463a,null))[_0x9e41('0x26')](removeEntity(_0x46463a,null))[_0x9e41('0x46')](handleError(_0x46463a,null));};exports[_0x9e41('0x4c')]=function(_0x1ab58c,_0x2a43d4){return db['CmHopperBlack'][_0x9e41('0x4c')]()['then'](respondWithResult(_0x2a43d4,null))[_0x9e41('0x46')](handleError(_0x2a43d4,null));}; \ No newline at end of file +var _0x7e19=['rawAttributes','length','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','CmHopperBlack','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x34b02a,_0xc897da){var _0x393178=function(_0x465fbf){while(--_0x465fbf){_0x34b02a['push'](_0x34b02a['shift']());}};_0x393178(++_0xc897da);}(_0x7e19,0x185));var _0x97e1=function(_0x59d45b,_0x21b484){_0x59d45b=_0x59d45b-0x0;var _0x76da4c=_0x7e19[_0x59d45b];return _0x76da4c;};'use strict';var pdf=require(_0x97e1('0x0'));var emlformat=require(_0x97e1('0x1'));var rimraf=require(_0x97e1('0x2'));var zipdir=require(_0x97e1('0x3'));var jsonpatch=require(_0x97e1('0x4'));var rp=require(_0x97e1('0x5'));var moment=require(_0x97e1('0x6'));var BPromise=require(_0x97e1('0x7'));var Mustache=require(_0x97e1('0x8'));var util=require(_0x97e1('0x9'));var path=require(_0x97e1('0xa'));var sox=require(_0x97e1('0xb'));var csv=require(_0x97e1('0xc'));var ejs=require(_0x97e1('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x97e1('0xe'));var crypto=require(_0x97e1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x97e1('0x10'));var toCsv=require(_0x97e1('0xc'));var querystring=require('querystring');var Papa=require(_0x97e1('0x11'));var authService=require(_0x97e1('0x12'));var hardwareService=require(_0x97e1('0x13'));var Redis=require(_0x97e1('0x14'));var qs=require(_0x97e1('0x15'));var logger=require(_0x97e1('0x16'))(_0x97e1('0x17'));var utils=require(_0x97e1('0x18'));var config=require(_0x97e1('0x19'));var db=require(_0x97e1('0x1a'))['db'];function respondWithStatusCode(_0xe56ff1,_0x10f17c){_0x10f17c=_0x10f17c||0xcc;return function(_0x1c4bd4){if(_0x1c4bd4){return _0xe56ff1[_0x97e1('0x1b')](_0x10f17c);}return _0xe56ff1[_0x97e1('0x1c')](_0x10f17c)[_0x97e1('0x1d')]();};}function respondWithResult(_0x84a7c3,_0x2548e2){_0x2548e2=_0x2548e2||0xc8;return function(_0x350b13){if(_0x350b13){return _0x84a7c3['status'](_0x2548e2)[_0x97e1('0x1e')](_0x350b13);}};}function respondWithFilteredResult(_0x109b7f,_0x52f327){return function(_0x333e23){if(_0x333e23){var _0x4cf4d9=_0x333e23[_0x97e1('0x1f')],_0x391daf=_0x52f327[_0x97e1('0x20')],_0x269228=_0x52f327[_0x97e1('0x20')]+_0x52f327[_0x97e1('0x21')],_0x2aa21c;if(_0x269228>=_0x4cf4d9){_0x269228=_0x4cf4d9;_0x2aa21c=0xc8;}else{_0x2aa21c=0xce;}_0x109b7f[_0x97e1('0x1c')](_0x2aa21c);return _0x109b7f[_0x97e1('0x22')](_0x97e1('0x23'),_0x391daf+'-'+_0x269228+'/'+_0x4cf4d9)[_0x97e1('0x1e')](_0x333e23);}return null;};}function patchUpdates(_0xd03992){return function(_0x4a410e){try{jsonpatch[_0x97e1('0x24')](_0x4a410e,_0xd03992,!![]);}catch(_0x4f02bb){return BPromise[_0x97e1('0x25')](_0x4f02bb);}return _0x4a410e['save']();};}function saveUpdates(_0x445e72,_0x1473f5){return function(_0x44718b){if(_0x44718b){return _0x44718b[_0x97e1('0x26')](_0x445e72)[_0x97e1('0x27')](function(_0x347d85){return _0x347d85;});}return null;};}function removeEntity(_0x2d4b7c,_0x1a2ed0){return function(_0x5bd7c5){if(_0x5bd7c5){return _0x5bd7c5[_0x97e1('0x28')]()[_0x97e1('0x27')](function(){_0x2d4b7c[_0x97e1('0x1c')](0xcc)[_0x97e1('0x1d')]();});}};}function handleEntityNotFound(_0x266770,_0x38e27c){return function(_0xc3c8b){if(!_0xc3c8b){_0x266770[_0x97e1('0x1b')](0x194);}return _0xc3c8b;};}function handleError(_0x3f5fe2,_0x1cb5ab){_0x1cb5ab=_0x1cb5ab||0x1f4;return function(_0x888ca3){logger[_0x97e1('0x29')](_0x888ca3[_0x97e1('0x2a')]);if(_0x888ca3[_0x97e1('0x2b')]){delete _0x888ca3[_0x97e1('0x2b')];}_0x3f5fe2[_0x97e1('0x1c')](_0x1cb5ab)['send'](_0x888ca3);};}exports[_0x97e1('0x2c')]=function(_0x309fde,_0x207fcd){var _0x499aca={},_0x10bbf7={},_0x4667a3={'count':0x0,'rows':[]};var _0x2451e5=db[_0x97e1('0x2d')]['rawAttributes'];_0x10bbf7[_0x97e1('0x2e')]=_[_0x97e1('0x2f')](_0x2451e5);_0x10bbf7[_0x97e1('0x30')]=_[_0x97e1('0x2f')](_0x309fde['query']);_0x10bbf7[_0x97e1('0x31')]=_[_0x97e1('0x32')](_0x10bbf7[_0x97e1('0x2e')],_0x10bbf7[_0x97e1('0x30')]);_0x499aca['attributes']=_['intersection'](_0x10bbf7[_0x97e1('0x2e')],qs[_0x97e1('0x33')](_0x309fde[_0x97e1('0x30')][_0x97e1('0x33')]));_0x499aca['attributes']=_0x499aca[_0x97e1('0x34')]['length']?_0x499aca[_0x97e1('0x34')]:_0x10bbf7[_0x97e1('0x2e')];if(!_0x309fde[_0x97e1('0x30')][_0x97e1('0x35')](_0x97e1('0x36'))){_0x499aca['limit']=qs[_0x97e1('0x21')](_0x309fde[_0x97e1('0x30')]['limit']);_0x499aca[_0x97e1('0x20')]=qs[_0x97e1('0x20')](_0x309fde[_0x97e1('0x30')]['offset']);}_0x499aca[_0x97e1('0x37')]=qs[_0x97e1('0x38')](_0x309fde[_0x97e1('0x30')][_0x97e1('0x38')]);_0x499aca[_0x97e1('0x39')]=qs[_0x97e1('0x31')](_['pick'](_0x309fde['query'],_0x10bbf7[_0x97e1('0x31')]));if(_0x309fde[_0x97e1('0x30')][_0x97e1('0x3a')]){_0x499aca[_0x97e1('0x39')]=_[_0x97e1('0x3b')](_0x499aca[_0x97e1('0x39')],{'$or':_[_0x97e1('0x3c')](_0x2451e5,function(_0xc44b87){if(_0xc44b87[_0x97e1('0x3d')][_0x97e1('0x3e')]!==_0x97e1('0x3f')){var _0x1058c4={};_0x1058c4[_0xc44b87[_0x97e1('0x40')]]={'$like':'%'+_0x309fde[_0x97e1('0x30')][_0x97e1('0x3a')]+'%'};return _0x1058c4;}})});}_0x499aca=_[_0x97e1('0x3b')]({},_0x499aca,_0x309fde[_0x97e1('0x41')]);var _0x336639={'where':_0x499aca[_0x97e1('0x39')]};return db[_0x97e1('0x2d')][_0x97e1('0x1f')](_0x336639)[_0x97e1('0x27')](function(_0x46aac7){_0x4667a3[_0x97e1('0x1f')]=_0x46aac7;if(_0x309fde[_0x97e1('0x30')][_0x97e1('0x42')]){_0x499aca[_0x97e1('0x43')]=[{'all':!![]}];}return db[_0x97e1('0x2d')][_0x97e1('0x44')](_0x499aca);})[_0x97e1('0x27')](function(_0x1bc5de){_0x4667a3[_0x97e1('0x45')]=_0x1bc5de;return _0x4667a3;})['then'](respondWithFilteredResult(_0x207fcd,_0x499aca))[_0x97e1('0x46')](handleError(_0x207fcd,null));};exports[_0x97e1('0x47')]=function(_0x333846,_0x24fd00){var _0x38b1d2={'raw':!![],'where':{'id':_0x333846[_0x97e1('0x48')]['id']}},_0x5ecdcf={};_0x5ecdcf['model']=_[_0x97e1('0x2f')](db['CmHopperBlack'][_0x97e1('0x49')]);_0x5ecdcf[_0x97e1('0x30')]=_['keys'](_0x333846[_0x97e1('0x30')]);_0x5ecdcf[_0x97e1('0x31')]=_['intersection'](_0x5ecdcf[_0x97e1('0x2e')],_0x5ecdcf[_0x97e1('0x30')]);_0x38b1d2[_0x97e1('0x34')]=_['intersection'](_0x5ecdcf[_0x97e1('0x2e')],qs['fields'](_0x333846[_0x97e1('0x30')][_0x97e1('0x33')]));_0x38b1d2['attributes']=_0x38b1d2['attributes'][_0x97e1('0x4a')]?_0x38b1d2['attributes']:_0x5ecdcf[_0x97e1('0x2e')];if(_0x333846[_0x97e1('0x30')][_0x97e1('0x42')]){_0x38b1d2[_0x97e1('0x43')]=[{'all':!![]}];}_0x38b1d2=_['merge']({},_0x38b1d2,_0x333846[_0x97e1('0x41')]);return db[_0x97e1('0x2d')][_0x97e1('0x4b')](_0x38b1d2)[_0x97e1('0x27')](handleEntityNotFound(_0x24fd00,null))[_0x97e1('0x27')](respondWithResult(_0x24fd00,null))[_0x97e1('0x46')](handleError(_0x24fd00,null));};exports[_0x97e1('0x26')]=function(_0x4f6475,_0x4e7735){if(_0x4f6475['body']['id']){delete _0x4f6475['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x4f6475[_0x97e1('0x48')]['id']}})[_0x97e1('0x27')](handleEntityNotFound(_0x4e7735,null))[_0x97e1('0x27')](saveUpdates(_0x4f6475['body'],null))['then'](respondWithResult(_0x4e7735,null))[_0x97e1('0x46')](handleError(_0x4e7735,null));};exports[_0x97e1('0x28')]=function(_0x5257e8,_0x212601){return db['CmHopperBlack']['find']({'where':{'id':_0x5257e8[_0x97e1('0x48')]['id']}})['then'](handleEntityNotFound(_0x212601,null))['then'](removeEntity(_0x212601,null))[_0x97e1('0x46')](handleError(_0x212601,null));};exports[_0x97e1('0x4c')]=function(_0x1c8844,_0x325843){return db[_0x97e1('0x2d')][_0x97e1('0x4c')]()[_0x97e1('0x27')](respondWithResult(_0x325843,null))['catch'](handleError(_0x325843,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4236c1a..6e92d5a 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 _0xd857=['CmHopperBlack','util','../../config/logger','api','moment','bluebird','request-promise','./cmHopperBlack.attributes','exports','define'];(function(_0x41dea0,_0x5422b1){var _0x335fb2=function(_0x1f902e){while(--_0x1f902e){_0x41dea0['push'](_0x41dea0['shift']());}};_0x335fb2(++_0x5422b1);}(_0xd857,0x137));var _0x7d85=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd857[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0x7d85('0x0'));var logger=require(_0x7d85('0x1'))(_0x7d85('0x2'));var moment=require(_0x7d85('0x3'));var BPromise=require(_0x7d85('0x4'));var rp=require(_0x7d85('0x5'));var attributes=require(_0x7d85('0x6'));module[_0x7d85('0x7')]=function(_0x30d0f8,_0x7c5fb6){return _0x30d0f8[_0x7d85('0x8')](_0x7d85('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd370=['exports','define','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','./cmHopperBlack.attributes'];(function(_0x293bd6,_0xb66d64){var _0x1489e2=function(_0x6d1503){while(--_0x6d1503){_0x293bd6['push'](_0x293bd6['shift']());}};_0x1489e2(++_0xb66d64);}(_0xd370,0xd5));var _0x0d37=function(_0xf0f9ae,_0x3b02ef){_0xf0f9ae=_0xf0f9ae-0x0;var _0x46b898=_0xd370[_0xf0f9ae];return _0x46b898;};'use strict';var _=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var logger=require(_0x0d37('0x2'))(_0x0d37('0x3'));var moment=require('moment');var BPromise=require(_0x0d37('0x4'));var rp=require(_0x0d37('0x5'));var attributes=require(_0x0d37('0x6'));module[_0x0d37('0x7')]=function(_0x58a299,_0x1e98e3){return _0x58a299[_0x0d37('0x8')]('CmHopperBlack',attributes,{'tableName':_0x0d37('0x9'),'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 4fec410..024bfd4 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 _0x21d5=['info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','map','include','model','then','debug','update','body','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','request'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x21d5,0x108));var _0x521d=function(_0x1f1b97,_0x1cfa0e){_0x1f1b97=_0x1f1b97-0x0;var _0x572a49=_0x21d5[_0x1f1b97];return _0x572a49;};'use strict';var _=require(_0x521d('0x0'));var util=require(_0x521d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x521d('0x2'));var fs=require('fs');var Redis=require(_0x521d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x521d('0x4'))(_0x521d('0x5'));var config=require('../../config/environment');var jayson=require(_0x521d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12d4db,_0x19b080,_0x6e7d96){return new BPromise(function(_0x1194ef,_0x6ca2ab){return client[_0x521d('0x7')](_0x12d4db,_0x6e7d96)['then'](function(_0x57bee5){logger[_0x521d('0x8')](_0x521d('0x9'),_0x19b080,'request\x20sent');logger['debug'](_0x521d('0xa'),_0x19b080,_0x521d('0xb'),JSON[_0x521d('0xc')](_0x57bee5));if(_0x57bee5[_0x521d('0xd')]){if(_0x57bee5[_0x521d('0xd')][_0x521d('0xe')]===0x1f4){logger['error'](_0x521d('0x9'),_0x19b080,_0x57bee5['error'][_0x521d('0xf')]);return _0x6ca2ab(_0x57bee5[_0x521d('0xd')][_0x521d('0xf')]);}logger[_0x521d('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x19b080,_0x57bee5['error'][_0x521d('0xf')]);return _0x1194ef(_0x57bee5[_0x521d('0xd')][_0x521d('0xf')]);}else{logger[_0x521d('0x8')](_0x521d('0x9'),_0x19b080,'request\x20sent');_0x1194ef(_0x57bee5[_0x521d('0x10')][_0x521d('0xf')]);}})[_0x521d('0x11')](function(_0x46607e){logger[_0x521d('0xd')](_0x521d('0x9'),_0x19b080,_0x46607e);_0x6ca2ab(_0x46607e);});});}exports[_0x521d('0x12')]=function(_0x32431c){var _0x29de0d=this;return new Promise(function(_0x18740e,_0x365c21){return db[_0x521d('0x13')]['findAll']({'raw':_0x32431c[_0x521d('0x14')]?_0x32431c[_0x521d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x32431c[_0x521d('0x14')]?_0x32431c['options'][_0x521d('0x15')]||null:null,'attributes':_0x32431c[_0x521d('0x14')]?_0x32431c[_0x521d('0x14')][_0x521d('0x16')]||null:null,'limit':_0x32431c[_0x521d('0x14')]?_0x32431c[_0x521d('0x14')]['limit']||null:null,'include':_0x32431c['options']?_0x32431c[_0x521d('0x14')]['include']?_[_0x521d('0x17')](_0x32431c['options'][_0x521d('0x18')],function(_0x4238ee){return{'model':db[_0x4238ee['model']],'as':_0x4238ee['as'],'attributes':_0x4238ee[_0x521d('0x16')],'include':_0x4238ee[_0x521d('0x18')]?_[_0x521d('0x17')](_0x4238ee['include'],function(_0xf6da8e){return{'model':db[_0xf6da8e['model']],'as':_0xf6da8e['as'],'attributes':_0xf6da8e[_0x521d('0x16')],'include':_0xf6da8e[_0x521d('0x18')]?_[_0x521d('0x17')](_0xf6da8e[_0x521d('0x18')],function(_0x2b8d84){return{'model':db[_0x2b8d84[_0x521d('0x19')]],'as':_0x2b8d84['as'],'attributes':_0x2b8d84[_0x521d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x521d('0x1a')](function(_0x4b9ed8){logger[_0x521d('0x8')]('GetCmHopperBlack',_0x32431c);logger[_0x521d('0x1b')](_0x521d('0x12'),_0x32431c,JSON['stringify'](_0x4b9ed8));_0x18740e(_0x4b9ed8);})[_0x521d('0x11')](function(_0x2c4d52){logger[_0x521d('0xd')](_0x521d('0x12'),_0x2c4d52['message'],_0x32431c);_0x365c21(_0x29de0d[_0x521d('0xd')](0x1f4,_0x2c4d52[_0x521d('0xf')]));});});};exports['UpdateCmHopperBlack']=function(_0x698a88){var _0x13cf1b=this;return new Promise(function(_0x19a73c,_0xa57bfc){return db[_0x521d('0x13')][_0x521d('0x1c')](_0x698a88[_0x521d('0x1d')],{'raw':_0x698a88[_0x521d('0x14')]?_0x698a88[_0x521d('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x698a88[_0x521d('0x14')]?_0x698a88[_0x521d('0x14')][_0x521d('0x15')]||null:null,'attributes':_0x698a88[_0x521d('0x14')]?_0x698a88[_0x521d('0x14')][_0x521d('0x16')]||null:null,'limit':_0x698a88['options']?_0x698a88[_0x521d('0x14')][_0x521d('0x1e')]||null:null})[_0x521d('0x1a')](function(_0x48d329){logger[_0x521d('0x8')](_0x521d('0x1f'),_0x698a88);logger[_0x521d('0x1b')](_0x521d('0x1f'),_0x698a88,JSON[_0x521d('0xc')](_0x48d329));_0x19a73c(_0x48d329);})[_0x521d('0x11')](function(_0x1774b4){logger[_0x521d('0xd')](_0x521d('0x1f'),_0x1774b4[_0x521d('0xf')],_0x698a88);_0xa57bfc(_0x13cf1b[_0x521d('0xd')](0x1f4,_0x1774b4[_0x521d('0xf')]));});});};exports[_0x521d('0x20')]=function(_0x1c199f){var _0x4e1ef0=this;return new Promise(function(_0x3b28f2,_0x456e48){return db[_0x521d('0x13')][_0x521d('0x21')]({'where':_0x1c199f[_0x521d('0x14')]?_0x1c199f['options'][_0x521d('0x15')]||null:null})[_0x521d('0x1a')](function(_0x2f746b){logger[_0x521d('0x8')](_0x521d('0x20'),_0x1c199f);logger[_0x521d('0x1b')](_0x521d('0x20'),_0x1c199f,JSON[_0x521d('0xc')](_0x2f746b));_0x3b28f2(_0x2f746b);})[_0x521d('0x11')](function(_0x445dbf){logger[_0x521d('0xd')](_0x521d('0x20'),_0x445dbf[_0x521d('0xf')],_0x1c199f);_0x456e48(_0x4e1ef0[_0x521d('0xd')](0x1f4,_0x445dbf[_0x521d('0xf')]));});});}; \ No newline at end of file +var _0xd429=['limit','include','map','model','catch','UpdateCmHopperBlack','body','where','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd429,0xbe));var _0x9d42=function(_0x4744fa,_0x5d5621){_0x4744fa=_0x4744fa-0x0;var _0x8f79a4=_0xd429[_0x4744fa];return _0x8f79a4;};'use strict';var _=require(_0x9d42('0x0'));var util=require(_0x9d42('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d42('0x2'));var fs=require('fs');var Redis=require(_0x9d42('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d42('0x4'));var logger=require(_0x9d42('0x5'))(_0x9d42('0x6'));var config=require('../../config/environment');var jayson=require(_0x9d42('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46d1e7,_0x680317,_0x3f3aaa){return new BPromise(function(_0xdb6381,_0x36a0a3){return client[_0x9d42('0x8')](_0x46d1e7,_0x3f3aaa)[_0x9d42('0x9')](function(_0x24c3ed){logger[_0x9d42('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x680317,_0x9d42('0xb'));logger[_0x9d42('0xc')](_0x9d42('0xd'),_0x680317,_0x9d42('0xb'),JSON[_0x9d42('0xe')](_0x24c3ed));if(_0x24c3ed['error']){if(_0x24c3ed['error'][_0x9d42('0xf')]===0x1f4){logger[_0x9d42('0x10')](_0x9d42('0x11'),_0x680317,_0x24c3ed['error']['message']);return _0x36a0a3(_0x24c3ed[_0x9d42('0x10')][_0x9d42('0x12')]);}logger[_0x9d42('0x10')](_0x9d42('0x11'),_0x680317,_0x24c3ed[_0x9d42('0x10')][_0x9d42('0x12')]);return _0xdb6381(_0x24c3ed[_0x9d42('0x10')][_0x9d42('0x12')]);}else{logger[_0x9d42('0xa')](_0x9d42('0x11'),_0x680317,_0x9d42('0xb'));_0xdb6381(_0x24c3ed[_0x9d42('0x13')][_0x9d42('0x12')]);}})['catch'](function(_0x165f8a){logger[_0x9d42('0x10')](_0x9d42('0x11'),_0x680317,_0x165f8a);_0x36a0a3(_0x165f8a);});});}exports[_0x9d42('0x14')]=function(_0x593de5){var _0x3939fe=this;return new Promise(function(_0x366613,_0x37ce0b){return db[_0x9d42('0x15')][_0x9d42('0x16')]({'raw':_0x593de5[_0x9d42('0x17')]?_0x593de5['options'][_0x9d42('0x18')]===undefined?!![]:![]:!![],'where':_0x593de5['options']?_0x593de5['options']['where']||null:null,'attributes':_0x593de5[_0x9d42('0x17')]?_0x593de5['options'][_0x9d42('0x19')]||null:null,'limit':_0x593de5[_0x9d42('0x17')]?_0x593de5['options'][_0x9d42('0x1a')]||null:null,'include':_0x593de5[_0x9d42('0x17')]?_0x593de5['options'][_0x9d42('0x1b')]?_[_0x9d42('0x1c')](_0x593de5['options'][_0x9d42('0x1b')],function(_0x484f44){return{'model':db[_0x484f44[_0x9d42('0x1d')]],'as':_0x484f44['as'],'attributes':_0x484f44[_0x9d42('0x19')],'include':_0x484f44['include']?_['map'](_0x484f44[_0x9d42('0x1b')],function(_0x1148c5){return{'model':db[_0x1148c5[_0x9d42('0x1d')]],'as':_0x1148c5['as'],'attributes':_0x1148c5[_0x9d42('0x19')],'include':_0x1148c5[_0x9d42('0x1b')]?_[_0x9d42('0x1c')](_0x1148c5['include'],function(_0x237b33){return{'model':db[_0x237b33[_0x9d42('0x1d')]],'as':_0x237b33['as'],'attributes':_0x237b33[_0x9d42('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x90e2af){logger['info'](_0x9d42('0x14'),_0x593de5);logger['debug']('GetCmHopperBlack',_0x593de5,JSON[_0x9d42('0xe')](_0x90e2af));_0x366613(_0x90e2af);})[_0x9d42('0x1e')](function(_0x39fdda){logger[_0x9d42('0x10')](_0x9d42('0x14'),_0x39fdda['message'],_0x593de5);_0x37ce0b(_0x3939fe[_0x9d42('0x10')](0x1f4,_0x39fdda[_0x9d42('0x12')]));});});};exports[_0x9d42('0x1f')]=function(_0x380134){var _0x1464a4=this;return new Promise(function(_0x3a2253,_0x81c6cb){return db['CmHopperBlack']['update'](_0x380134[_0x9d42('0x20')],{'raw':_0x380134['options']?_0x380134[_0x9d42('0x17')][_0x9d42('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380134[_0x9d42('0x17')]?_0x380134[_0x9d42('0x17')][_0x9d42('0x21')]||null:null,'attributes':_0x380134[_0x9d42('0x17')]?_0x380134['options']['attributes']||null:null,'limit':_0x380134[_0x9d42('0x17')]?_0x380134['options']['limit']||null:null})[_0x9d42('0x9')](function(_0x5c77e9){logger[_0x9d42('0xa')](_0x9d42('0x1f'),_0x380134);logger[_0x9d42('0xc')](_0x9d42('0x1f'),_0x380134,JSON['stringify'](_0x5c77e9));_0x3a2253(_0x5c77e9);})[_0x9d42('0x1e')](function(_0x362d4c){logger[_0x9d42('0x10')](_0x9d42('0x1f'),_0x362d4c[_0x9d42('0x12')],_0x380134);_0x81c6cb(_0x1464a4['error'](0x1f4,_0x362d4c['message']));});});};exports[_0x9d42('0x22')]=function(_0x3687c5){var _0x465c74=this;return new Promise(function(_0x5e54e6,_0x18304d){return db[_0x9d42('0x15')][_0x9d42('0x23')]({'where':_0x3687c5[_0x9d42('0x17')]?_0x3687c5['options'][_0x9d42('0x21')]||null:null})[_0x9d42('0x9')](function(_0x1bad3b){logger[_0x9d42('0xa')]('DestroyCmHopperBlack',_0x3687c5);logger[_0x9d42('0xc')](_0x9d42('0x22'),_0x3687c5,JSON[_0x9d42('0xe')](_0x1bad3b));_0x5e54e6(_0x1bad3b);})[_0x9d42('0x1e')](function(_0x46c5a){logger['error'](_0x9d42('0x22'),_0x46c5a[_0x9d42('0x12')],_0x3687c5);_0x18304d(_0x465c74['error'](0x1f4,_0x46c5a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1a63087..c571acd 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 _0x1801=['index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x1e87c0,_0x48122e){var _0x3e7136=function(_0x3d8c49){while(--_0x3d8c49){_0x1e87c0['push'](_0x1e87c0['shift']());}};_0x3e7136(++_0x48122e);}(_0x1801,0xc6));var _0x1180=function(_0x1ee057,_0x3b7852){_0x1ee057=_0x1ee057-0x0;var _0x46bbe6=_0x1801[_0x1ee057];return _0x46bbe6;};'use strict';var multer=require(_0x1180('0x0'));var util=require(_0x1180('0x1'));var path=require(_0x1180('0x2'));var timeout=require(_0x1180('0x3'));var express=require(_0x1180('0x4'));var router=express[_0x1180('0x5')]();var auth=require(_0x1180('0x6'));var interaction=require(_0x1180('0x7'));var config=require(_0x1180('0x8'));var controller=require(_0x1180('0x9'));router[_0x1180('0xa')]('/',auth[_0x1180('0xb')](),controller[_0x1180('0xc')]);router['get'](_0x1180('0xd'),auth[_0x1180('0xb')](),controller['describe']);router['get'](_0x1180('0xe'),auth[_0x1180('0xb')](),controller[_0x1180('0xf')]);router[_0x1180('0x10')](_0x1180('0xe'),auth[_0x1180('0xb')](),controller[_0x1180('0x11')]);router[_0x1180('0x12')]('/:id',auth[_0x1180('0xb')](),controller[_0x1180('0x13')]);module[_0x1180('0x14')]=router; \ No newline at end of file +var _0x48d0=['/describe','/:id','show','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x8f5efa,_0x1a282f){var _0x111ced=function(_0x338f74){while(--_0x338f74){_0x8f5efa['push'](_0x8f5efa['shift']());}};_0x111ced(++_0x1a282f);}(_0x48d0,0xd3));var _0x048d=function(_0x4ec05f,_0x168f9e){_0x4ec05f=_0x4ec05f-0x0;var _0x425237=_0x48d0[_0x4ec05f];return _0x425237;};'use strict';var multer=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var path=require('path');var timeout=require(_0x048d('0x2'));var express=require(_0x048d('0x3'));var router=express[_0x048d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x048d('0x5'));var config=require(_0x048d('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x048d('0x7')]('/',auth[_0x048d('0x8')](),controller[_0x048d('0x9')]);router['get'](_0x048d('0xa'),auth[_0x048d('0x8')](),controller['describe']);router[_0x048d('0x7')](_0x048d('0xb'),auth[_0x048d('0x8')](),controller[_0x048d('0xc')]);router[_0x048d('0xd')](_0x048d('0xb'),auth[_0x048d('0x8')](),controller[_0x048d('0xe')]);router[_0x048d('0xf')](_0x048d('0xb'),auth[_0x048d('0x8')](),controller[_0x048d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index ce6a730..f052392 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 _0xe8cf=['followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','setDataValue'];(function(_0x4d6b4d,_0x1bd1c8){var _0x2c8a92=function(_0x13fbbf){while(--_0x13fbbf){_0x4d6b4d['push'](_0x4d6b4d['shift']());}};_0x2c8a92(++_0x1bd1c8);}(_0xe8cf,0x87));var _0xfe8c=function(_0x14af1b,_0x25cff8){_0x14af1b=_0x14af1b-0x0;var _0x4acefb=_0xe8cf[_0x14af1b];return _0x4acefb;};'use strict';var Sequelize=require(_0xfe8c('0x0'));var moment=require(_0xfe8c('0x1'));module[_0xfe8c('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfe8c('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xfe8c('0x3')]},'calleridnum':{'type':Sequelize[_0xfe8c('0x3')]},'calleridname':{'type':Sequelize[_0xfe8c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfe8c('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfe8c('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfe8c('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfe8c('0x3')]},'campaign':{'type':Sequelize[_0xfe8c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfe8c('0x3')]},'reason':{'type':Sequelize[_0xfe8c('0x3')]},'disposition':{'type':Sequelize[_0xfe8c('0x3')]},'dispositionat':{'type':Sequelize[_0xfe8c('0x5')],'set':function(_0x1ca186){var _0x54f33e=this[_0xfe8c('0x6')]('endtime');if(_0x54f33e&&_0x1ca186){this[_0xfe8c('0x7')](_0xfe8c('0x8'),moment(_0x1ca186)[_0xfe8c('0x9')](moment(_0x54f33e),_0xfe8c('0xa')));}return this['setDataValue'](_0xfe8c('0xb'),_0x1ca186);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xfe8c('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfe8c('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xfe8c('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfe8c('0x5')]},'deleted':{'type':Sequelize[_0xfe8c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfe8c('0x5')]},'recallme':{'type':Sequelize[_0xfe8c('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x51fa=['BOOLEAN','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','endtime','followuptime','diff','seconds','setDataValue','dispositionat'];(function(_0x126252,_0x2e41d4){var _0x589e99=function(_0x313b0b){while(--_0x313b0b){_0x126252['push'](_0x126252['shift']());}};_0x589e99(++_0x2e41d4);}(_0x51fa,0x135));var _0xa51f=function(_0x52b460,_0x1325bd){_0x52b460=_0x52b460-0x0;var _0x36006e=_0x51fa[_0x52b460];return _0x36006e;};'use strict';var Sequelize=require(_0xa51f('0x0'));var moment=require(_0xa51f('0x1'));module[_0xa51f('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa51f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa51f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa51f('0x3')]},'calleridnum':{'type':Sequelize[_0xa51f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa51f('0x5')]},'answertime':{'type':Sequelize[_0xa51f('0x5')]},'droptime':{'type':Sequelize[_0xa51f('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa51f('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa51f('0x3')]},'campaign':{'type':Sequelize[_0xa51f('0x3')]},'campaigntype':{'type':Sequelize[_0xa51f('0x3')]},'membername':{'type':Sequelize[_0xa51f('0x3')]},'reason':{'type':Sequelize[_0xa51f('0x3')]},'disposition':{'type':Sequelize[_0xa51f('0x3')]},'dispositionat':{'type':Sequelize[_0xa51f('0x5')],'set':function(_0x391e99){var _0xefee0d=this[_0xa51f('0x6')](_0xa51f('0x7'));if(_0xefee0d&&_0x391e99){this['setDataValue'](_0xa51f('0x8'),moment(_0x391e99)[_0xa51f('0x9')](moment(_0xefee0d),_0xa51f('0xa')));}return this[_0xa51f('0xb')](_0xa51f('0xc'),_0x391e99);}},'amd':{'type':Sequelize[_0xa51f('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa51f('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa51f('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa51f('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa51f('0x5')]},'callback':{'type':Sequelize[_0xa51f('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa51f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa51f('0x5')]},'deleted':{'type':Sequelize[_0xa51f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa51f('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 75ce2e4..eaceba4 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 _0x36ee=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','model','query','fields','attributes','hasOwnProperty','nolimit','limit','order','filters','filter','where','map','type','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','insert','into','cm_hopper','phone','ContactId','VoiceQueueId','createdAt','updatedAt','select','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(calleridnum)','ListId','ANY_VALUE(CampaignId)','from','CampaignId\x20=\x20?','checkContactHopper','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api'];(function(_0x1a9a92,_0x42a2c4){var _0x10c152=function(_0x4922d5){while(--_0x4922d5){_0x1a9a92['push'](_0x1a9a92['shift']());}};_0x10c152(++_0x42a2c4);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe36e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe36e('0x1'));var rp=require(_0xe36e('0x2'));var moment=require(_0xe36e('0x3'));var BPromise=require(_0xe36e('0x4'));var Mustache=require(_0xe36e('0x5'));var util=require(_0xe36e('0x6'));var path=require(_0xe36e('0x7'));var sox=require(_0xe36e('0x8'));var csv=require(_0xe36e('0x9'));var ejs=require(_0xe36e('0xa'));var fs=require('fs');var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x9'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe36e('0x10'));var Redis=require('ioredis');var qs=require(_0xe36e('0x11'));var logger=require(_0xe36e('0x12'))(_0xe36e('0x13'));var utils=require(_0xe36e('0x14'));var config=require(_0xe36e('0x15'));var db=require(_0xe36e('0x16'))['db'];function respondWithStatusCode(_0x3f6d7f,_0x265473){_0x265473=_0x265473||0xcc;return function(_0x4fbdb2){if(_0x4fbdb2){return _0x3f6d7f[_0xe36e('0x17')](_0x265473);}return _0x3f6d7f[_0xe36e('0x18')](_0x265473)[_0xe36e('0x19')]();};}function respondWithResult(_0x1fdea2,_0x5c3f3c){_0x5c3f3c=_0x5c3f3c||0xc8;return function(_0x3e264a){if(_0x3e264a){return _0x1fdea2['status'](_0x5c3f3c)['json'](_0x3e264a);}};}function respondWithFilteredResult(_0x27ff47,_0x300f21){return function(_0x26fb37){if(_0x26fb37){var _0x278135=_0x26fb37[_0xe36e('0x1a')],_0xd6828e=_0x300f21[_0xe36e('0x1b')],_0x924cd5=_0x300f21[_0xe36e('0x1b')]+_0x300f21['limit'],_0x2096f6;if(_0x924cd5>=_0x278135){_0x924cd5=_0x278135;_0x2096f6=0xc8;}else{_0x2096f6=0xce;}_0x27ff47[_0xe36e('0x18')](_0x2096f6);return _0x27ff47[_0xe36e('0x1c')]('Content-Range',_0xd6828e+'-'+_0x924cd5+'/'+_0x278135)[_0xe36e('0x1d')](_0x26fb37);}return null;};}function patchUpdates(_0x533c06){return function(_0x471400){try{jsonpatch[_0xe36e('0x1e')](_0x471400,_0x533c06,!![]);}catch(_0x5e15f5){return BPromise[_0xe36e('0x1f')](_0x5e15f5);}return _0x471400[_0xe36e('0x20')]();};}function saveUpdates(_0x21efe7,_0x597331){return function(_0x21e95e){if(_0x21e95e){return _0x21e95e[_0xe36e('0x21')](_0x21efe7)[_0xe36e('0x22')](function(_0x3c4017){return _0x3c4017;});}return null;};}function removeEntity(_0x2c4e30,_0x360b95){return function(_0x4f438a){if(_0x4f438a){return _0x4f438a[_0xe36e('0x23')]()[_0xe36e('0x22')](function(){_0x2c4e30[_0xe36e('0x18')](0xcc)[_0xe36e('0x19')]();});}};}function handleEntityNotFound(_0x437f3f,_0x53e13a){return function(_0x598a7a){if(!_0x598a7a){_0x437f3f[_0xe36e('0x17')](0x194);}return _0x598a7a;};}function handleError(_0x10818d,_0xb0cd85){_0xb0cd85=_0xb0cd85||0x1f4;return function(_0xb32195){logger[_0xe36e('0x24')](_0xb32195[_0xe36e('0x25')]);if(_0xb32195[_0xe36e('0x26')]){delete _0xb32195['name'];}_0x10818d[_0xe36e('0x18')](_0xb0cd85)[_0xe36e('0x27')](_0xb32195);};}exports[_0xe36e('0x28')]=function(_0x262caa,_0x5e58d8){var _0x2d757c={},_0x5a3133={},_0xf7b02e={'count':0x0,'rows':[]};var _0x5993de=db[_0xe36e('0x29')]['rawAttributes'];_0x5a3133[_0xe36e('0x2a')]=_['keys'](_0x5993de);_0x5a3133[_0xe36e('0x2b')]=_['keys'](_0x262caa['query']);_0x5a3133['filters']=_['intersection'](_0x5a3133[_0xe36e('0x2a')],_0x5a3133[_0xe36e('0x2b')]);_0x2d757c['attributes']=_['intersection'](_0x5a3133[_0xe36e('0x2a')],qs[_0xe36e('0x2c')](_0x262caa[_0xe36e('0x2b')][_0xe36e('0x2c')]));_0x2d757c[_0xe36e('0x2d')]=_0x2d757c[_0xe36e('0x2d')]['length']?_0x2d757c[_0xe36e('0x2d')]:_0x5a3133[_0xe36e('0x2a')];if(!_0x262caa['query'][_0xe36e('0x2e')](_0xe36e('0x2f'))){_0x2d757c[_0xe36e('0x30')]=qs[_0xe36e('0x30')](_0x262caa[_0xe36e('0x2b')][_0xe36e('0x30')]);_0x2d757c[_0xe36e('0x1b')]=qs[_0xe36e('0x1b')](_0x262caa[_0xe36e('0x2b')][_0xe36e('0x1b')]);}_0x2d757c[_0xe36e('0x31')]=qs['sort'](_0x262caa[_0xe36e('0x2b')]['sort']);_0x2d757c['where']=qs[_0xe36e('0x32')](_['pick'](_0x262caa[_0xe36e('0x2b')],_0x5a3133[_0xe36e('0x32')]));if(_0x262caa[_0xe36e('0x2b')][_0xe36e('0x33')]){_0x2d757c['where']=_['merge'](_0x2d757c[_0xe36e('0x34')],{'$or':_[_0xe36e('0x35')](_0x5993de,function(_0x19a53f){if(_0x19a53f[_0xe36e('0x36')]['key']!==_0xe36e('0x37')){var _0x2f828e={};_0x2f828e[_0x19a53f[_0xe36e('0x38')]]={'$like':'%'+_0x262caa['query'][_0xe36e('0x33')]+'%'};return _0x2f828e;}})});}_0x2d757c=_[_0xe36e('0x39')]({},_0x2d757c,_0x262caa['options']);var _0x40cbe5={'where':_0x2d757c[_0xe36e('0x34')]};return db[_0xe36e('0x29')][_0xe36e('0x1a')](_0x40cbe5)[_0xe36e('0x22')](function(_0x2fc909){_0xf7b02e[_0xe36e('0x1a')]=_0x2fc909;if(_0x262caa[_0xe36e('0x2b')][_0xe36e('0x3a')]){_0x2d757c[_0xe36e('0x3b')]=[{'all':!![]}];}return db[_0xe36e('0x29')][_0xe36e('0x3c')](_0x2d757c);})[_0xe36e('0x22')](function(_0x5f396c){_0xf7b02e[_0xe36e('0x3d')]=_0x5f396c;return _0xf7b02e;})[_0xe36e('0x22')](respondWithFilteredResult(_0x5e58d8,_0x2d757c))[_0xe36e('0x3e')](handleError(_0x5e58d8,null));};exports[_0xe36e('0x3f')]=function(_0x295feb,_0x4d133b){var _0x591e33={'raw':!![],'where':{'id':_0x295feb[_0xe36e('0x40')]['id']}},_0x4094c6={};_0x4094c6[_0xe36e('0x2a')]=_[_0xe36e('0x41')](db[_0xe36e('0x29')][_0xe36e('0x42')]);_0x4094c6[_0xe36e('0x2b')]=_[_0xe36e('0x41')](_0x295feb['query']);_0x4094c6[_0xe36e('0x32')]=_[_0xe36e('0x43')](_0x4094c6['model'],_0x4094c6[_0xe36e('0x2b')]);_0x591e33['attributes']=_[_0xe36e('0x43')](_0x4094c6[_0xe36e('0x2a')],qs[_0xe36e('0x2c')](_0x295feb[_0xe36e('0x2b')][_0xe36e('0x2c')]));_0x591e33['attributes']=_0x591e33[_0xe36e('0x2d')][_0xe36e('0x44')]?_0x591e33[_0xe36e('0x2d')]:_0x4094c6[_0xe36e('0x2a')];if(_0x295feb[_0xe36e('0x2b')][_0xe36e('0x3a')]){_0x591e33['include']=[{'all':!![]}];}_0x591e33=_[_0xe36e('0x39')]({},_0x591e33,_0x295feb[_0xe36e('0x45')]);return db[_0xe36e('0x29')][_0xe36e('0x46')](_0x591e33)[_0xe36e('0x22')](handleEntityNotFound(_0x4d133b,null))['then'](respondWithResult(_0x4d133b,null))[_0xe36e('0x3e')](handleError(_0x4d133b,null));};exports[_0xe36e('0x47')]=function(_0x390d9d,_0x9debd7){return db[_0xe36e('0x29')][_0xe36e('0x47')]()[_0xe36e('0x22')](respondWithResult(_0x9debd7,null))[_0xe36e('0x3e')](handleError(_0x9debd7,null));};exports[_0xe36e('0x21')]=function(_0x52e744,_0x56956c){if(_0x52e744[_0xe36e('0x48')]['uniqueid']){delete _0x52e744[_0xe36e('0x48')][_0xe36e('0x49')];}return db[_0xe36e('0x29')][_0xe36e('0x46')]({'where':{'uniqueid':_0x52e744['params']['id']}})[_0xe36e('0x22')](handleEntityNotFound(_0x56956c,null))[_0xe36e('0x22')](saveUpdates(_0x52e744['body'],null))[_0xe36e('0x22')](respondWithResult(_0x56956c,null))[_0xe36e('0x3e')](handleError(_0x56956c,null));};exports[_0xe36e('0x4a')]=function(_0x42eae5,_0x15895d,_0x3bc458){return db[_0xe36e('0x29')][_0xe36e('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x42eae5[_0xe36e('0x40')]['id']},'attributes':[[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x4e')))),'noSuchContacts'],[db[_0xe36e('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0xe36e('0x4f')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x50')))),_0xe36e('0x51')],[db[_0xe36e('0x4b')]['fn']('COUNT',db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')]['literal'](_0xe36e('0x52')))),_0xe36e('0x53')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x54')))),_0xe36e('0x55')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db['sequelize']['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xe36e('0x56')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x57')))),_0xe36e('0x58')]]})[_0xe36e('0x22')](handleEntityNotFound(_0x15895d,null))[_0xe36e('0x22')](respondWithResult(_0x15895d,null))[_0xe36e('0x3e')](handleError(_0x15895d,null));};exports[_0xe36e('0x59')]=function(_0x389e91,_0x6f979f,_0x3512ec){return db[_0xe36e('0x29')][_0xe36e('0x3c')]({'raw':![],'where':{'CampaignId':_0x389e91[_0xe36e('0x40')]['id']},'attributes':[[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x4e')))),_0xe36e('0x5a')],[db['sequelize']['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db['sequelize'][_0xe36e('0x4d')](_0xe36e('0x5b')))),_0xe36e('0x4f')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db['sequelize'][_0xe36e('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0xe36e('0x51')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x52')))),_0xe36e('0x53')],[db['sequelize']['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db['sequelize'][_0xe36e('0x4d')](_0xe36e('0x5c')))),_0xe36e('0x5d')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')]['literal'](_0xe36e('0x54')))),_0xe36e('0x55')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db[_0xe36e('0x4b')]['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x5e')))),_0xe36e('0x56')],[db[_0xe36e('0x4b')]['fn'](_0xe36e('0x4c'),db['sequelize']['fn']('IF',db[_0xe36e('0x4b')][_0xe36e('0x4d')](_0xe36e('0x57')))),_0xe36e('0x58')]]})['then'](handleEntityNotFound(_0x6f979f,null))['then'](respondWithResult(_0x6f979f,null))[_0xe36e('0x3e')](handleError(_0x6f979f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x585bd5,_0x59c454,_0xe0a282){return db['VoiceQueue'][_0xe36e('0x46')]({'where':{'id':_0x585bd5[_0xe36e('0x40')]['id']}})[_0xe36e('0x22')](handleEntityNotFound(_0x59c454,null))[_0xe36e('0x22')](function(_0x1bd60d){var _0x46f789;if(_0x1bd60d){_0x46f789=squel[_0xe36e('0x5f')]()[_0xe36e('0x60')](_0xe36e('0x61'))['fromQuery']([_0xe36e('0x62'),'scheduledAt',_0xe36e('0x63'),'ListId',_0xe36e('0x64'),_0xe36e('0x65'),_0xe36e('0x66')],squel[_0xe36e('0x67')]()['field']('ANY_VALUE(calleridnum)',_0xe36e('0x62'))[_0xe36e('0x38')](_0xe36e('0x68'),_0xe36e('0x69'))[_0xe36e('0x38')](_0xe36e('0x6a'),'ContactId')[_0xe36e('0x38')](_0xe36e('0x6b'),'ListId')[_0xe36e('0x38')]('ANY_VALUE(VoiceQueueId)',_0xe36e('0x64'))[_0xe36e('0x38')](_0xe36e('0x68'),_0xe36e('0x65'))['field'](_0xe36e('0x68'),'updatedAt')['from'](_0xe36e('0x6c'))[_0xe36e('0x34')]('VoiceQueueId\x20=\x20?',_0x585bd5['params']['id'][_0xe36e('0x6d')]())['where'](_0xe36e('0x6e'),_0x585bd5[_0xe36e('0x48')][_0xe36e('0x6f')][_0xe36e('0x6d')]())[_0xe36e('0x34')](_0xe36e('0x70'))['where'](_0xe36e('0x71'),squel[_0xe36e('0x67')]()[_0xe36e('0x38')](_0xe36e('0x62'))['from'](_0xe36e('0x61'))[_0xe36e('0x34')](_0xe36e('0x72'),_0x585bd5[_0xe36e('0x40')]['id']['toString']()))[_0xe36e('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe36e('0x67')]()['field'](_0xe36e('0x73'))['from']('cm_hopper_final')[_0xe36e('0x34')](_0xe36e('0x72'),_0x585bd5[_0xe36e('0x40')]['id']['toString']())[_0xe36e('0x34')](_0xe36e('0x74')))['group'](_0xe36e('0x63')))[_0xe36e('0x6d')]();return db[_0xe36e('0x4b')]['query'](_0x46f789);}return[];})['then'](respondWithResult(_0x59c454,null))[_0xe36e('0x3e')](handleError(_0x59c454,null));};exports[_0xe36e('0x75')]=function(_0x3bd3c2,_0x327506,_0x411305){return db['Campaign'][_0xe36e('0x46')]({'where':{'id':_0x3bd3c2[_0xe36e('0x40')]['id']}})[_0xe36e('0x22')](handleEntityNotFound(_0x327506,null))[_0xe36e('0x22')](function(_0xdc59c5){var _0x5bdeea;if(_0xdc59c5){_0x5bdeea=squel[_0xe36e('0x5f')]()[_0xe36e('0x60')](_0xe36e('0x61'))['fromQuery']([_0xe36e('0x62'),'scheduledAt',_0xe36e('0x63'),'ListId',_0xe36e('0x76'),_0xe36e('0x65'),'updatedAt'],squel[_0xe36e('0x67')]()['field'](_0xe36e('0x77'),_0xe36e('0x62'))[_0xe36e('0x38')](_0xe36e('0x68'),_0xe36e('0x69'))['field'](_0xe36e('0x6a'),'ContactId')[_0xe36e('0x38')](_0xe36e('0x6b'),_0xe36e('0x78'))[_0xe36e('0x38')](_0xe36e('0x79'),_0xe36e('0x76'))['field'](_0xe36e('0x68'),_0xe36e('0x65'))[_0xe36e('0x38')]('NOW()',_0xe36e('0x66'))[_0xe36e('0x7a')](_0xe36e('0x6c'))[_0xe36e('0x34')]('CampaignId\x20=\x20?',_0x3bd3c2[_0xe36e('0x40')]['id']['toString']())[_0xe36e('0x34')]('state\x20=\x20?',_0x3bd3c2[_0xe36e('0x48')][_0xe36e('0x6f')][_0xe36e('0x6d')]())['where'](_0xe36e('0x70'))[_0xe36e('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe36e('0x67')]()[_0xe36e('0x38')](_0xe36e('0x62'))['from']('cm_hopper')[_0xe36e('0x34')](_0xe36e('0x7b'),_0x3bd3c2[_0xe36e('0x40')]['id'][_0xe36e('0x6d')]()))[_0xe36e('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe36e('0x67')]()[_0xe36e('0x38')](_0xe36e('0x73'))[_0xe36e('0x7a')]('cm_hopper_final')[_0xe36e('0x34')](_0xe36e('0x7b'),_0x3bd3c2['params']['id']['toString']())['where'](_0xe36e('0x74')))['group']('ContactId'))[_0xe36e('0x6d')]();return db[_0xe36e('0x4b')][_0xe36e('0x2b')](_0x5bdeea);}return[];})[_0xe36e('0x22')](respondWithResult(_0x327506,null))[_0xe36e('0x3e')](handleError(_0x327506,null));};exports[_0xe36e('0x7c')]=function(_0x48fbed,_0x2ebe8e,_0x4f9354){return db['CmHopper'][_0xe36e('0x7d')]({'where':{'VoiceQueueId':_0x48fbed[_0xe36e('0x48')][_0xe36e('0x64')],'CampaignId':_0x48fbed[_0xe36e('0x48')]['CampaignId'],'ContactId':_0x48fbed[_0xe36e('0x48')][_0xe36e('0x63')]}})[_0xe36e('0x22')](handleEntityNotFound(_0x2ebe8e,null))[_0xe36e('0x22')](function(_0x4d0a75){if(_0x4d0a75){return _0x4d0a75;}return null;})[_0xe36e('0x22')](respondWithResult(_0x2ebe8e,null))['catch'](handleError(_0x2ebe8e,null));}; \ No newline at end of file +var _0xda3f=['to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','then','destroy','error','name','send','index','CmHopperFinal','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type','key','options','includeAll','findAll','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','updatedAt','select','field','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','CampaignId','ContactId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','eml-format','rimraf','moment','mustache','util','sox'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0xda3f,0xec));var _0xfda3=function(_0x1e9899,_0x379650){_0x1e9899=_0x1e9899-0x0;var _0x483bba=_0xda3f[_0x1e9899];return _0x483bba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var authService=require(_0xfda3('0xd'));var hardwareService=require(_0xfda3('0xe'));var Redis=require(_0xfda3('0xf'));var qs=require(_0xfda3('0x10'));var logger=require(_0xfda3('0x11'))('api');var utils=require(_0xfda3('0x12'));var config=require(_0xfda3('0x13'));var db=require(_0xfda3('0x14'))['db'];function respondWithStatusCode(_0x11afc1,_0x1443f4){_0x1443f4=_0x1443f4||0xcc;return function(_0x4b77ea){if(_0x4b77ea){return _0x11afc1[_0xfda3('0x15')](_0x1443f4);}return _0x11afc1['status'](_0x1443f4)[_0xfda3('0x16')]();};}function respondWithResult(_0x1e7a55,_0x4929fa){_0x4929fa=_0x4929fa||0xc8;return function(_0x501588){if(_0x501588){return _0x1e7a55['status'](_0x4929fa)[_0xfda3('0x17')](_0x501588);}};}function respondWithFilteredResult(_0x477fc0,_0x5ea793){return function(_0x57a229){if(_0x57a229){var _0x533365=_0x57a229[_0xfda3('0x18')],_0x80ea80=_0x5ea793[_0xfda3('0x19')],_0x474707=_0x5ea793[_0xfda3('0x19')]+_0x5ea793[_0xfda3('0x1a')],_0x249dc6;if(_0x474707>=_0x533365){_0x474707=_0x533365;_0x249dc6=0xc8;}else{_0x249dc6=0xce;}_0x477fc0[_0xfda3('0x1b')](_0x249dc6);return _0x477fc0[_0xfda3('0x1c')](_0xfda3('0x1d'),_0x80ea80+'-'+_0x474707+'/'+_0x533365)['json'](_0x57a229);}return null;};}function patchUpdates(_0x15ddb9){return function(_0x1bbdda){try{jsonpatch[_0xfda3('0x1e')](_0x1bbdda,_0x15ddb9,!![]);}catch(_0x32855a){return BPromise['reject'](_0x32855a);}return _0x1bbdda[_0xfda3('0x1f')]();};}function saveUpdates(_0x43cfac,_0x2ee74c){return function(_0x51e731){if(_0x51e731){return _0x51e731['update'](_0x43cfac)[_0xfda3('0x20')](function(_0x38d428){return _0x38d428;});}return null;};}function removeEntity(_0x4ea9f5,_0x545320){return function(_0x3cf5a9){if(_0x3cf5a9){return _0x3cf5a9[_0xfda3('0x21')]()[_0xfda3('0x20')](function(){_0x4ea9f5[_0xfda3('0x1b')](0xcc)[_0xfda3('0x16')]();});}};}function handleEntityNotFound(_0x2b84b7,_0x2677f6){return function(_0xc6fb9a){if(!_0xc6fb9a){_0x2b84b7[_0xfda3('0x15')](0x194);}return _0xc6fb9a;};}function handleError(_0x5499f5,_0x82341b){_0x82341b=_0x82341b||0x1f4;return function(_0x2d5b44){logger[_0xfda3('0x22')](_0x2d5b44['stack']);if(_0x2d5b44[_0xfda3('0x23')]){delete _0x2d5b44[_0xfda3('0x23')];}_0x5499f5[_0xfda3('0x1b')](_0x82341b)[_0xfda3('0x24')](_0x2d5b44);};}exports[_0xfda3('0x25')]=function(_0xad9f7b,_0x514d2a){var _0x3c6d7d={},_0x1e87fe={},_0x2bef2b={'count':0x0,'rows':[]};var _0x1f2884=db[_0xfda3('0x26')]['rawAttributes'];_0x1e87fe[_0xfda3('0x27')]=_[_0xfda3('0x28')](_0x1f2884);_0x1e87fe[_0xfda3('0x29')]=_[_0xfda3('0x28')](_0xad9f7b[_0xfda3('0x29')]);_0x1e87fe[_0xfda3('0x2a')]=_[_0xfda3('0x2b')](_0x1e87fe['model'],_0x1e87fe['query']);_0x3c6d7d[_0xfda3('0x2c')]=_['intersection'](_0x1e87fe['model'],qs[_0xfda3('0x2d')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x3c6d7d[_0xfda3('0x2c')]=_0x3c6d7d[_0xfda3('0x2c')][_0xfda3('0x2e')]?_0x3c6d7d[_0xfda3('0x2c')]:_0x1e87fe[_0xfda3('0x27')];if(!_0xad9f7b[_0xfda3('0x29')]['hasOwnProperty'](_0xfda3('0x2f'))){_0x3c6d7d[_0xfda3('0x1a')]=qs[_0xfda3('0x1a')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x1a')]);_0x3c6d7d[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x19')]);}_0x3c6d7d['order']=qs['sort'](_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x30')]);_0x3c6d7d['where']=qs[_0xfda3('0x2a')](_[_0xfda3('0x31')](_0xad9f7b[_0xfda3('0x29')],_0x1e87fe['filters']));if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]){_0x3c6d7d[_0xfda3('0x33')]=_[_0xfda3('0x34')](_0x3c6d7d[_0xfda3('0x33')],{'$or':_['map'](_0x1f2884,function(_0xc6dd4e){if(_0xc6dd4e[_0xfda3('0x35')][_0xfda3('0x36')]!=='VIRTUAL'){var _0x373c96={};_0x373c96[_0xc6dd4e['field']]={'$like':'%'+_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x32')]+'%'};return _0x373c96;}})});}_0x3c6d7d=_[_0xfda3('0x34')]({},_0x3c6d7d,_0xad9f7b[_0xfda3('0x37')]);var _0x21c5cc={'where':_0x3c6d7d[_0xfda3('0x33')]};return db[_0xfda3('0x26')][_0xfda3('0x18')](_0x21c5cc)['then'](function(_0x24c7ad){_0x2bef2b[_0xfda3('0x18')]=_0x24c7ad;if(_0xad9f7b[_0xfda3('0x29')][_0xfda3('0x38')]){_0x3c6d7d['include']=[{'all':!![]}];}return db[_0xfda3('0x26')][_0xfda3('0x39')](_0x3c6d7d);})[_0xfda3('0x20')](function(_0x5bad90){_0x2bef2b['rows']=_0x5bad90;return _0x2bef2b;})[_0xfda3('0x20')](respondWithFilteredResult(_0x514d2a,_0x3c6d7d))[_0xfda3('0x3a')](handleError(_0x514d2a,null));};exports[_0xfda3('0x3b')]=function(_0x1aaa6c,_0x2b415d){var _0x115f20={'raw':!![],'where':{'id':_0x1aaa6c[_0xfda3('0x3c')]['id']}},_0x40b814={};_0x40b814[_0xfda3('0x27')]=_[_0xfda3('0x28')](db['CmHopperFinal'][_0xfda3('0x3d')]);_0x40b814[_0xfda3('0x29')]=_['keys'](_0x1aaa6c[_0xfda3('0x29')]);_0x40b814['filters']=_['intersection'](_0x40b814['model'],_0x40b814[_0xfda3('0x29')]);_0x115f20[_0xfda3('0x2c')]=_[_0xfda3('0x2b')](_0x40b814[_0xfda3('0x27')],qs['fields'](_0x1aaa6c[_0xfda3('0x29')][_0xfda3('0x2d')]));_0x115f20[_0xfda3('0x2c')]=_0x115f20[_0xfda3('0x2c')]['length']?_0x115f20[_0xfda3('0x2c')]:_0x40b814[_0xfda3('0x27')];if(_0x1aaa6c[_0xfda3('0x29')]['includeAll']){_0x115f20['include']=[{'all':!![]}];}_0x115f20=_[_0xfda3('0x34')]({},_0x115f20,_0x1aaa6c[_0xfda3('0x37')]);return db[_0xfda3('0x26')][_0xfda3('0x3e')](_0x115f20)[_0xfda3('0x20')](handleEntityNotFound(_0x2b415d,null))[_0xfda3('0x20')](respondWithResult(_0x2b415d,null))[_0xfda3('0x3a')](handleError(_0x2b415d,null));};exports[_0xfda3('0x3f')]=function(_0x12b533,_0x3ed533){return db[_0xfda3('0x26')][_0xfda3('0x3f')]()[_0xfda3('0x20')](respondWithResult(_0x3ed533,null))[_0xfda3('0x3a')](handleError(_0x3ed533,null));};exports['update']=function(_0x4a0cbd,_0x52b5c3){if(_0x4a0cbd[_0xfda3('0x40')][_0xfda3('0x41')]){delete _0x4a0cbd[_0xfda3('0x40')][_0xfda3('0x41')];}return db[_0xfda3('0x26')][_0xfda3('0x3e')]({'where':{'uniqueid':_0x4a0cbd[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x52b5c3,null))[_0xfda3('0x20')](saveUpdates(_0x4a0cbd['body'],null))[_0xfda3('0x20')](respondWithResult(_0x52b5c3,null))[_0xfda3('0x3a')](handleError(_0x52b5c3,null));};exports[_0xfda3('0x42')]=function(_0x36aa3a,_0x26496a,_0x5b4817){return db[_0xfda3('0x26')][_0xfda3('0x39')]({'raw':![],'where':{'VoiceQueueId':_0x36aa3a[_0xfda3('0x3c')]['id']},'attributes':[[db['sequelize']['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')]['literal'](_0xfda3('0x45')))),_0xfda3('0x46')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db['sequelize'][_0xfda3('0x47')]('`state`\x20=\x203,\x201,\x20null'))),_0xfda3('0x48')],[db['sequelize']['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')][_0xfda3('0x47')]('`state`\x20=\x205,\x201,\x20null'))),_0xfda3('0x49')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')][_0xfda3('0x47')](_0xfda3('0x4a')))),'congestionContacts'],[db['sequelize']['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xfda3('0x4b')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')]['literal'](_0xfda3('0x4c')))),_0xfda3('0x4d')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')][_0xfda3('0x47')](_0xfda3('0x4e')))),_0xfda3('0x4f')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db['sequelize'][_0xfda3('0x47')](_0xfda3('0x50')))),_0xfda3('0x51')]]})[_0xfda3('0x20')](handleEntityNotFound(_0x26496a,null))[_0xfda3('0x20')](respondWithResult(_0x26496a,null))[_0xfda3('0x3a')](handleError(_0x26496a,null));};exports[_0xfda3('0x52')]=function(_0x4ce31c,_0x5a3a6f,_0x1401d8){return db[_0xfda3('0x26')]['findAll']({'raw':![],'where':{'CampaignId':_0x4ce31c[_0xfda3('0x3c')]['id']},'attributes':[[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db['sequelize']['literal'](_0xfda3('0x45')))),_0xfda3('0x46')],[db[_0xfda3('0x44')]['fn']('COUNT',db[_0xfda3('0x44')]['fn']('IF',db['sequelize'][_0xfda3('0x47')](_0xfda3('0x53')))),_0xfda3('0x48')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db['sequelize'][_0xfda3('0x47')](_0xfda3('0x54')))),_0xfda3('0x49')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db['sequelize']['fn']('IF',db['sequelize'][_0xfda3('0x47')](_0xfda3('0x4a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')]['literal'](_0xfda3('0x55')))),_0xfda3('0x4b')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db['sequelize']['fn']('IF',db[_0xfda3('0x44')][_0xfda3('0x47')](_0xfda3('0x4c')))),_0xfda3('0x4d')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db['sequelize']['fn']('IF',db['sequelize'][_0xfda3('0x47')]('`state`\x20=\x2022,\x201,\x20null'))),_0xfda3('0x4f')],[db[_0xfda3('0x44')]['fn'](_0xfda3('0x43'),db[_0xfda3('0x44')]['fn']('IF',db[_0xfda3('0x44')][_0xfda3('0x47')](_0xfda3('0x50')))),_0xfda3('0x51')]]})[_0xfda3('0x20')](handleEntityNotFound(_0x5a3a6f,null))[_0xfda3('0x20')](respondWithResult(_0x5a3a6f,null))['catch'](handleError(_0x5a3a6f,null));};exports[_0xfda3('0x56')]=function(_0x49f04a,_0x5c0755,_0x197be4){return db[_0xfda3('0x57')]['find']({'where':{'id':_0x49f04a[_0xfda3('0x3c')]['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x5c0755,null))[_0xfda3('0x20')](function(_0x589c7a){var _0x1a825c;if(_0x589c7a){_0x1a825c=squel[_0xfda3('0x58')]()[_0xfda3('0x59')](_0xfda3('0x5a'))[_0xfda3('0x5b')](['phone','scheduledAt','ContactId',_0xfda3('0x5c'),_0xfda3('0x5d'),_0xfda3('0x5e'),_0xfda3('0x5f')],squel[_0xfda3('0x60')]()[_0xfda3('0x61')]('ANY_VALUE(calleridnum)',_0xfda3('0x62'))[_0xfda3('0x61')](_0xfda3('0x63'),_0xfda3('0x64'))['field'](_0xfda3('0x65'),'ContactId')[_0xfda3('0x61')](_0xfda3('0x66'),_0xfda3('0x5c'))[_0xfda3('0x61')](_0xfda3('0x67'),_0xfda3('0x5d'))[_0xfda3('0x61')]('NOW()',_0xfda3('0x5e'))[_0xfda3('0x61')](_0xfda3('0x63'),_0xfda3('0x5f'))[_0xfda3('0x68')](_0xfda3('0x69'))['where'](_0xfda3('0x6a'),_0x49f04a[_0xfda3('0x3c')]['id'][_0xfda3('0x6b')]())[_0xfda3('0x33')](_0xfda3('0x6c'),_0x49f04a['body'][_0xfda3('0x6d')][_0xfda3('0x6b')]())[_0xfda3('0x33')](_0xfda3('0x6e'))[_0xfda3('0x33')](_0xfda3('0x6f'),squel[_0xfda3('0x60')]()[_0xfda3('0x61')](_0xfda3('0x62'))[_0xfda3('0x68')]('cm_hopper')[_0xfda3('0x33')](_0xfda3('0x6a'),_0x49f04a[_0xfda3('0x3c')]['id'][_0xfda3('0x6b')]()))[_0xfda3('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xfda3('0x61')](_0xfda3('0x70'))[_0xfda3('0x68')](_0xfda3('0x69'))[_0xfda3('0x33')](_0xfda3('0x6a'),_0x49f04a[_0xfda3('0x3c')]['id'][_0xfda3('0x6b')]())[_0xfda3('0x33')](_0xfda3('0x71')))[_0xfda3('0x72')]('ContactId'))[_0xfda3('0x6b')]();return db['sequelize']['query'](_0x1a825c);}return[];})['then'](respondWithResult(_0x5c0755,null))[_0xfda3('0x3a')](handleError(_0x5c0755,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x334d87,_0x38f456,_0x5d1ebe){return db[_0xfda3('0x73')][_0xfda3('0x3e')]({'where':{'id':_0x334d87['params']['id']}})[_0xfda3('0x20')](handleEntityNotFound(_0x38f456,null))['then'](function(_0x35e986){var _0x3a66ca;if(_0x35e986){_0x3a66ca=squel['insert']()[_0xfda3('0x59')](_0xfda3('0x5a'))[_0xfda3('0x5b')]([_0xfda3('0x62'),_0xfda3('0x64'),'ContactId',_0xfda3('0x5c'),_0xfda3('0x74'),_0xfda3('0x5e'),_0xfda3('0x5f')],squel[_0xfda3('0x60')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xfda3('0x61')](_0xfda3('0x63'),_0xfda3('0x64'))[_0xfda3('0x61')](_0xfda3('0x65'),_0xfda3('0x75'))[_0xfda3('0x61')](_0xfda3('0x66'),'ListId')[_0xfda3('0x61')](_0xfda3('0x76'),'CampaignId')[_0xfda3('0x61')](_0xfda3('0x63'),'createdAt')[_0xfda3('0x61')](_0xfda3('0x63'),_0xfda3('0x5f'))[_0xfda3('0x68')](_0xfda3('0x69'))['where'](_0xfda3('0x77'),_0x334d87[_0xfda3('0x3c')]['id'][_0xfda3('0x6b')]())[_0xfda3('0x33')]('state\x20=\x20?',_0x334d87[_0xfda3('0x40')][_0xfda3('0x6d')][_0xfda3('0x6b')]())[_0xfda3('0x33')](_0xfda3('0x6e'))[_0xfda3('0x33')](_0xfda3('0x6f'),squel[_0xfda3('0x60')]()[_0xfda3('0x61')](_0xfda3('0x62'))[_0xfda3('0x68')]('cm_hopper')['where'](_0xfda3('0x77'),_0x334d87['params']['id'][_0xfda3('0x6b')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xfda3('0x61')](_0xfda3('0x70'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x334d87['params']['id']['toString']())[_0xfda3('0x33')]('state\x20=\x204'))['group'](_0xfda3('0x75')))['toString']();return db['sequelize'][_0xfda3('0x29')](_0x3a66ca);}return[];})[_0xfda3('0x20')](respondWithResult(_0x38f456,null))[_0xfda3('0x3a')](handleError(_0x38f456,null));};exports['checkContactHopper']=function(_0x401e29,_0x19047e,_0x265226){return db[_0xfda3('0x78')]['findOne']({'where':{'VoiceQueueId':_0x401e29[_0xfda3('0x40')][_0xfda3('0x5d')],'CampaignId':_0x401e29['body'][_0xfda3('0x74')],'ContactId':_0x401e29[_0xfda3('0x40')][_0xfda3('0x75')]}})[_0xfda3('0x20')](handleEntityNotFound(_0x19047e,null))[_0xfda3('0x20')](function(_0x4bb625){if(_0x4bb625){return _0x4bb625;}return null;})[_0xfda3('0x20')](respondWithResult(_0x19047e,null))[_0xfda3('0x3a')](handleError(_0x19047e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 7737cd3..a81785e 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 _0xadb5=['bluebird','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','api','moment'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xadb5,0xad));var _0x5adb=function(_0x1aff4f,_0x2890a8){_0x1aff4f=_0x1aff4f-0x0;var _0x45cd7f=_0xadb5[_0x1aff4f];return _0x45cd7f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var attributes=require(_0x5adb('0x4'));module[_0x5adb('0x5')]=function(_0x2e3ef4,_0x4cb1d1){return _0x2e3ef4[_0x5adb('0x6')](_0x5adb('0x7'),attributes,{'tableName':_0x5adb('0x8'),'paranoid':![],'indexes':[{'name':_0x5adb('0x9'),'fields':[_0x5adb('0x9')]},{'name':_0x5adb('0xa'),'fields':[_0x5adb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x7a54,0x106));var _0x47a5=function(_0x25a4ba,_0x2e98b1){_0x25a4ba=_0x25a4ba-0x0;var _0xbd09de=_0x7a54[_0x25a4ba];return _0xbd09de;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('CmHopperFinal',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x47a5('0x9')]},{'name':_0x47a5('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 0463b1f..3580905 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 _0xd64b=['http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd766,_0xbab9f){var _0x2e60fc=function(_0x35302a){while(--_0x35302a){_0x3dd766['push'](_0x3dd766['shift']());}};_0x2e60fc(++_0xbab9f);}(_0xd64b,0xc1));var _0xbd64=function(_0x2fb72c,_0x3b46b3){_0x2fb72c=_0x2fb72c-0x0;var _0x9ce8b7=_0xd64b[_0x2fb72c];return _0x9ce8b7;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}exports[_0xbd64('0x13')]=function(_0x1d7a14){var _0x17d015=this;return new Promise(function(_0x2f4554,_0xa5491d){return db[_0xbd64('0x14')]['create'](_0x1d7a14[_0xbd64('0x15')],{'raw':_0x1d7a14[_0xbd64('0x16')]?_0x1d7a14['options']['raw']===undefined?!![]:![]:!![]})[_0xbd64('0x17')](function(_0x42b328){logger[_0xbd64('0x9')](_0xbd64('0x13'),_0x1d7a14);logger[_0xbd64('0x18')](_0xbd64('0x13'),_0x1d7a14,JSON['stringify'](_0x42b328));_0x2f4554(_0x42b328);})['catch'](function(_0x6038f){logger[_0xbd64('0xe')](_0xbd64('0x13'),_0x6038f[_0xbd64('0x10')],_0x1d7a14);_0xa5491d(_0x17d015['error'](0x1f4,_0x6038f['message']));});});}; \ No newline at end of file +var _0x04b8=['CmHopperFinal','create','body','options','raw','debug','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateCmHopperFinal'];(function(_0x3e06ce,_0x373aca){var _0x1cacfd=function(_0x4cbf54){while(--_0x4cbf54){_0x3e06ce['push'](_0x3e06ce['shift']());}};_0x1cacfd(++_0x373aca);}(_0x04b8,0x159));var _0x804b=function(_0x4c2edc,_0x248043){_0x4c2edc=_0x4c2edc-0x0;var _0x259549=_0x04b8[_0x4c2edc];return _0x259549;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')](_0x3a05c0[_0x804b('0x15')],{'raw':_0x3a05c0[_0x804b('0x16')]?_0x3a05c0['options'][_0x804b('0x17')]===undefined?!![]:![]:!![]})[_0x804b('0x9')](function(_0x427166){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x18')](_0x804b('0x12'),_0x3a05c0,JSON[_0x804b('0xe')](_0x427166));_0x871d6c(_0x427166);})[_0x804b('0x19')](function(_0x2b7271){logger[_0x804b('0xf')]('CreateCmHopperFinal',_0x2b7271[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x2b7271['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index f572d55..9b796b4 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x5edc47,_0x1b94a5){var _0x514f6d=function(_0xebbf4c){while(--_0xebbf4c){_0x5edc47['push'](_0x5edc47['shift']());}};_0x514f6d(++_0x1b94a5);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x55e10a,_0x13458c){var _0x919fa=function(_0x511980){while(--_0x511980){_0x55e10a['push'](_0x55e10a['shift']());}};_0x919fa(++_0x13458c);}(_0x34e8,0x12c));var _0x834e=function(_0x1d39f2,_0x429293){_0x1d39f2=_0x1d39f2-0x0;var _0x2168fb=_0x34e8[_0x1d39f2];return _0x2168fb;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);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 e36390e..8620e8a 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 _0x39c7=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x35004a,_0x512fa3){var _0x4cc843=function(_0x13c5a6){while(--_0x13c5a6){_0x35004a['push'](_0x35004a['shift']());}};_0x4cc843(++_0x512fa3);}(_0x39c7,0x85));var _0x739c=function(_0x5deaf0,_0x335add){_0x5deaf0=_0x5deaf0-0x0;var _0x23b926=_0x39c7[_0x5deaf0];return _0x23b926;};'use strict';var Sequelize=require('sequelize');module[_0x739c('0x0')]={'state':{'type':Sequelize[_0x739c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x739c('0x2')]},'scheduledat':{'type':Sequelize[_0x739c('0x3')]},'countbusyretry':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x739c('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x739c('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x739c('0x2')]},'starttime':{'type':Sequelize[_0x739c('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x739c('0x3')]},'endtime':{'type':Sequelize[_0x739c('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x739c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x739c('0x2')]},'campaigntype':{'type':Sequelize[_0x739c('0x2')]},'membername':{'type':Sequelize[_0x739c('0x2')]},'reason':{'type':Sequelize[_0x739c('0x2')]},'amd':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x739c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x739c('0x3')]},'recallme':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x739c('0x3')]},'edited':{'type':Sequelize[_0x739c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb38e=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xb38e,0xa7));var _0xeb38=function(_0x239a9b,_0x494175){_0x239a9b=_0x239a9b-0x0;var _0x39fda1=_0xb38e[_0x239a9b];return _0x39fda1;};'use strict';var Sequelize=require(_0xeb38('0x0'));module[_0xeb38('0x1')]={'state':{'type':Sequelize[_0xeb38('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeb38('0x3')]},'scheduledat':{'type':Sequelize[_0xeb38('0x4')]},'countbusyretry':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xeb38('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xeb38('0x3')]},'calleridnum':{'type':Sequelize[_0xeb38('0x3')]},'calleridname':{'type':Sequelize[_0xeb38('0x3')]},'starttime':{'type':Sequelize[_0xeb38('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xeb38('0x4')]},'droptime':{'type':Sequelize[_0xeb38('0x4')]},'endtime':{'type':Sequelize[_0xeb38('0x4')]},'ringtime':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb38('0x3')]},'campaign':{'type':Sequelize[_0xeb38('0x3')]},'campaigntype':{'type':Sequelize[_0xeb38('0x3')]},'membername':{'type':Sequelize[_0xeb38('0x3')]},'reason':{'type':Sequelize[_0xeb38('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xeb38('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xeb38('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb38('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xeb38('0x4')]},'edited':{'type':Sequelize[_0xeb38('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 7ea1fca..0f3b083 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 _0xea1a=['querystring','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','CmHopperHistory','rawAttributes','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','describe','uniqueid','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0xc9f297,_0x46df59){var _0x5c593a=function(_0x257da2){while(--_0x257da2){_0xc9f297['push'](_0xc9f297['shift']());}};_0x5c593a(++_0x46df59);}(_0xea1a,0x158));var _0xaea1=function(_0xcd7f63,_0x24a51f){_0xcd7f63=_0xcd7f63-0x0;var _0x1be84c=_0xea1a[_0xcd7f63];return _0x1be84c;};'use strict';var pdf=require(_0xaea1('0x0'));var emlformat=require(_0xaea1('0x1'));var rimraf=require(_0xaea1('0x2'));var zipdir=require(_0xaea1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaea1('0x4'));var moment=require(_0xaea1('0x5'));var BPromise=require(_0xaea1('0x6'));var Mustache=require(_0xaea1('0x7'));var util=require(_0xaea1('0x8'));var path=require(_0xaea1('0x9'));var sox=require(_0xaea1('0xa'));var csv=require(_0xaea1('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaea1('0xc'));var squel=require(_0xaea1('0xd'));var crypto=require(_0xaea1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaea1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaea1('0x10'));var Papa=require('papaparse');var authService=require(_0xaea1('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xaea1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xaea1('0x13'));var db=require(_0xaea1('0x14'))['db'];function respondWithStatusCode(_0x567dbf,_0x1b908b){_0x1b908b=_0x1b908b||0xcc;return function(_0x345a98){if(_0x345a98){return _0x567dbf[_0xaea1('0x15')](_0x1b908b);}return _0x567dbf[_0xaea1('0x16')](_0x1b908b)[_0xaea1('0x17')]();};}function respondWithResult(_0x7ad061,_0x376cc9){_0x376cc9=_0x376cc9||0xc8;return function(_0x47f887){if(_0x47f887){return _0x7ad061[_0xaea1('0x16')](_0x376cc9)[_0xaea1('0x18')](_0x47f887);}};}function respondWithFilteredResult(_0x358419,_0x294de1){return function(_0x3b319e){if(_0x3b319e){var _0xb7cefa=_0x3b319e[_0xaea1('0x19')],_0x3ce4f3=_0x294de1[_0xaea1('0x1a')],_0x3e1c1a=_0x294de1[_0xaea1('0x1a')]+_0x294de1[_0xaea1('0x1b')],_0xaf72ab;if(_0x3e1c1a>=_0xb7cefa){_0x3e1c1a=_0xb7cefa;_0xaf72ab=0xc8;}else{_0xaf72ab=0xce;}_0x358419[_0xaea1('0x16')](_0xaf72ab);return _0x358419[_0xaea1('0x1c')](_0xaea1('0x1d'),_0x3ce4f3+'-'+_0x3e1c1a+'/'+_0xb7cefa)[_0xaea1('0x18')](_0x3b319e);}return null;};}function patchUpdates(_0x471476){return function(_0x5b38af){try{jsonpatch[_0xaea1('0x1e')](_0x5b38af,_0x471476,!![]);}catch(_0x4c3cdf){return BPromise[_0xaea1('0x1f')](_0x4c3cdf);}return _0x5b38af[_0xaea1('0x20')]();};}function saveUpdates(_0x1b18d0,_0x448f36){return function(_0x10fa19){if(_0x10fa19){return _0x10fa19[_0xaea1('0x21')](_0x1b18d0)[_0xaea1('0x22')](function(_0x56b2c9){return _0x56b2c9;});}return null;};}function removeEntity(_0x326920,_0x9704f5){return function(_0x4e4880){if(_0x4e4880){return _0x4e4880[_0xaea1('0x23')]()['then'](function(){_0x326920['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x503310,_0x1d245b){return function(_0x51f76f){if(!_0x51f76f){_0x503310['sendStatus'](0x194);}return _0x51f76f;};}function handleError(_0x43c785,_0x16e0c0){_0x16e0c0=_0x16e0c0||0x1f4;return function(_0x3b2d67){logger['error'](_0x3b2d67['stack']);if(_0x3b2d67[_0xaea1('0x24')]){delete _0x3b2d67[_0xaea1('0x24')];}_0x43c785[_0xaea1('0x16')](_0x16e0c0)[_0xaea1('0x25')](_0x3b2d67);};}exports[_0xaea1('0x26')]=function(_0x4da2bc,_0x5fb4d2){var _0x38e1bd={},_0x1cb0a9={},_0x3f8e30={'count':0x0,'rows':[]};var _0x11fd41=db[_0xaea1('0x27')][_0xaea1('0x28')];_0x1cb0a9['model']=_[_0xaea1('0x29')](_0x11fd41);_0x1cb0a9['query']=_[_0xaea1('0x29')](_0x4da2bc[_0xaea1('0x2a')]);_0x1cb0a9['filters']=_[_0xaea1('0x2b')](_0x1cb0a9[_0xaea1('0x2c')],_0x1cb0a9['query']);_0x38e1bd[_0xaea1('0x2d')]=_['intersection'](_0x1cb0a9['model'],qs['fields'](_0x4da2bc[_0xaea1('0x2a')]['fields']));_0x38e1bd[_0xaea1('0x2d')]=_0x38e1bd['attributes'][_0xaea1('0x2e')]?_0x38e1bd['attributes']:_0x1cb0a9[_0xaea1('0x2c')];if(!_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x2f')](_0xaea1('0x30'))){_0x38e1bd[_0xaea1('0x1b')]=qs['limit'](_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x1b')]);_0x38e1bd[_0xaea1('0x1a')]=qs[_0xaea1('0x1a')](_0x4da2bc['query'][_0xaea1('0x1a')]);}_0x38e1bd[_0xaea1('0x31')]=qs[_0xaea1('0x32')](_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x32')]);_0x38e1bd[_0xaea1('0x33')]=qs[_0xaea1('0x34')](_[_0xaea1('0x35')](_0x4da2bc[_0xaea1('0x2a')],_0x1cb0a9[_0xaea1('0x34')]));if(_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x36')]){_0x38e1bd[_0xaea1('0x33')]=_[_0xaea1('0x37')](_0x38e1bd['where'],{'$or':_['map'](_0x11fd41,function(_0x4dda55){if(_0x4dda55[_0xaea1('0x38')]['key']!==_0xaea1('0x39')){var _0x72d144={};_0x72d144[_0x4dda55['field']]={'$like':'%'+_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x36')]+'%'};return _0x72d144;}})});}_0x38e1bd=_[_0xaea1('0x37')]({},_0x38e1bd,_0x4da2bc[_0xaea1('0x3a')]);var _0x2fd4fd={'where':_0x38e1bd[_0xaea1('0x33')]};return db[_0xaea1('0x27')][_0xaea1('0x19')](_0x2fd4fd)['then'](function(_0x21da5e){_0x3f8e30[_0xaea1('0x19')]=_0x21da5e;if(_0x4da2bc[_0xaea1('0x2a')][_0xaea1('0x3b')]){_0x38e1bd[_0xaea1('0x3c')]=[{'all':!![]}];}return db[_0xaea1('0x27')][_0xaea1('0x3d')](_0x38e1bd);})['then'](function(_0x33f0ee){_0x3f8e30[_0xaea1('0x3e')]=_0x33f0ee;return _0x3f8e30;})[_0xaea1('0x22')](respondWithFilteredResult(_0x5fb4d2,_0x38e1bd))[_0xaea1('0x3f')](handleError(_0x5fb4d2,null));};exports[_0xaea1('0x40')]=function(_0x17627f,_0xb59504){var _0x2f4263={'raw':!![],'where':{'id':_0x17627f['params']['id']}},_0x17ad81={};_0x17ad81['model']=_[_0xaea1('0x29')](db['CmHopperHistory'][_0xaea1('0x28')]);_0x17ad81['query']=_[_0xaea1('0x29')](_0x17627f[_0xaea1('0x2a')]);_0x17ad81[_0xaea1('0x34')]=_['intersection'](_0x17ad81[_0xaea1('0x2c')],_0x17ad81['query']);_0x2f4263[_0xaea1('0x2d')]=_[_0xaea1('0x2b')](_0x17ad81[_0xaea1('0x2c')],qs[_0xaea1('0x41')](_0x17627f[_0xaea1('0x2a')][_0xaea1('0x41')]));_0x2f4263[_0xaea1('0x2d')]=_0x2f4263[_0xaea1('0x2d')][_0xaea1('0x2e')]?_0x2f4263[_0xaea1('0x2d')]:_0x17ad81[_0xaea1('0x2c')];if(_0x17627f[_0xaea1('0x2a')][_0xaea1('0x3b')]){_0x2f4263[_0xaea1('0x3c')]=[{'all':!![]}];}_0x2f4263=_[_0xaea1('0x37')]({},_0x2f4263,_0x17627f[_0xaea1('0x3a')]);return db[_0xaea1('0x27')][_0xaea1('0x42')](_0x2f4263)['then'](handleEntityNotFound(_0xb59504,null))['then'](respondWithResult(_0xb59504,null))[_0xaea1('0x3f')](handleError(_0xb59504,null));};exports[_0xaea1('0x43')]=function(_0x3cca1c,_0x87bf7d){return db['CmHopperHistory'][_0xaea1('0x43')](_0x3cca1c[_0xaea1('0x44')],{})[_0xaea1('0x22')](respondWithResult(_0x87bf7d,0xc9))[_0xaea1('0x3f')](handleError(_0x87bf7d,null));};exports[_0xaea1('0x45')]=function(_0x341e0a,_0xf4697c){return db[_0xaea1('0x27')][_0xaea1('0x45')]()['then'](respondWithResult(_0xf4697c,null))[_0xaea1('0x3f')](handleError(_0xf4697c,null));};exports[_0xaea1('0x21')]=function(_0x4a442c,_0x44898c){if(_0x4a442c[_0xaea1('0x44')][_0xaea1('0x46')]){delete _0x4a442c[_0xaea1('0x44')][_0xaea1('0x46')];}return db[_0xaea1('0x27')]['find']({'where':{'uniqueid':_0x4a442c[_0xaea1('0x47')]['id']}})[_0xaea1('0x22')](handleEntityNotFound(_0x44898c,null))[_0xaea1('0x22')](saveUpdates(_0x4a442c[_0xaea1('0x44')],null))[_0xaea1('0x22')](respondWithResult(_0x44898c,null))[_0xaea1('0x3f')](handleError(_0x44898c,null));}; \ No newline at end of file +var _0x28bc=['apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','field','options','count','includeAll','include','catch','show','params','find','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x28bc,0x79));var _0xc28b=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x28bc[_0x3a7a9c];return _0x59156e;};'use strict';var pdf=require(_0xc28b('0x0'));var emlformat=require(_0xc28b('0x1'));var rimraf=require(_0xc28b('0x2'));var zipdir=require(_0xc28b('0x3'));var jsonpatch=require(_0xc28b('0x4'));var rp=require(_0xc28b('0x5'));var moment=require('moment');var BPromise=require(_0xc28b('0x6'));var Mustache=require(_0xc28b('0x7'));var util=require(_0xc28b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc28b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc28b('0xa'));var squel=require(_0xc28b('0xb'));var crypto=require(_0xc28b('0xc'));var jsforce=require(_0xc28b('0xd'));var deskjs=require(_0xc28b('0xe'));var toCsv=require(_0xc28b('0x9'));var querystring=require(_0xc28b('0xf'));var Papa=require(_0xc28b('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc28b('0x11'));var Redis=require(_0xc28b('0x12'));var qs=require(_0xc28b('0x13'));var logger=require(_0xc28b('0x14'))(_0xc28b('0x15'));var utils=require(_0xc28b('0x16'));var config=require(_0xc28b('0x17'));var db=require(_0xc28b('0x18'))['db'];function respondWithStatusCode(_0x481131,_0x3c4505){_0x3c4505=_0x3c4505||0xcc;return function(_0x1b72e6){if(_0x1b72e6){return _0x481131[_0xc28b('0x19')](_0x3c4505);}return _0x481131['status'](_0x3c4505)[_0xc28b('0x1a')]();};}function respondWithResult(_0x583546,_0x586a1a){_0x586a1a=_0x586a1a||0xc8;return function(_0x13c315){if(_0x13c315){return _0x583546['status'](_0x586a1a)[_0xc28b('0x1b')](_0x13c315);}};}function respondWithFilteredResult(_0x4be5ec,_0x3e68bb){return function(_0x284f4e){if(_0x284f4e){var _0x1a181a=_0x284f4e['count'],_0x4eba41=_0x3e68bb[_0xc28b('0x1c')],_0x57645f=_0x3e68bb['offset']+_0x3e68bb[_0xc28b('0x1d')],_0x3fc0a8;if(_0x57645f>=_0x1a181a){_0x57645f=_0x1a181a;_0x3fc0a8=0xc8;}else{_0x3fc0a8=0xce;}_0x4be5ec[_0xc28b('0x1e')](_0x3fc0a8);return _0x4be5ec[_0xc28b('0x1f')](_0xc28b('0x20'),_0x4eba41+'-'+_0x57645f+'/'+_0x1a181a)[_0xc28b('0x1b')](_0x284f4e);}return null;};}function patchUpdates(_0x1aa267){return function(_0x443ed3){try{jsonpatch[_0xc28b('0x21')](_0x443ed3,_0x1aa267,!![]);}catch(_0x57ac80){return BPromise[_0xc28b('0x22')](_0x57ac80);}return _0x443ed3[_0xc28b('0x23')]();};}function saveUpdates(_0x293735,_0x59c15b){return function(_0x270c5e){if(_0x270c5e){return _0x270c5e[_0xc28b('0x24')](_0x293735)[_0xc28b('0x25')](function(_0x277c60){return _0x277c60;});}return null;};}function removeEntity(_0xdd7b44,_0x4b1cfe){return function(_0x166f93){if(_0x166f93){return _0x166f93[_0xc28b('0x26')]()['then'](function(){_0xdd7b44[_0xc28b('0x1e')](0xcc)[_0xc28b('0x1a')]();});}};}function handleEntityNotFound(_0x43d213,_0x369d43){return function(_0x1ed843){if(!_0x1ed843){_0x43d213[_0xc28b('0x19')](0x194);}return _0x1ed843;};}function handleError(_0x44f81c,_0x1d9d50){_0x1d9d50=_0x1d9d50||0x1f4;return function(_0x112326){logger[_0xc28b('0x27')](_0x112326[_0xc28b('0x28')]);if(_0x112326[_0xc28b('0x29')]){delete _0x112326[_0xc28b('0x29')];}_0x44f81c[_0xc28b('0x1e')](_0x1d9d50)[_0xc28b('0x2a')](_0x112326);};}exports[_0xc28b('0x2b')]=function(_0x56e4f5,_0x302b1b){var _0x1bf1e1={},_0x2a7b4a={},_0x1ca36f={'count':0x0,'rows':[]};var _0x1aa3ac=db[_0xc28b('0x2c')][_0xc28b('0x2d')];_0x2a7b4a[_0xc28b('0x2e')]=_[_0xc28b('0x2f')](_0x1aa3ac);_0x2a7b4a[_0xc28b('0x30')]=_[_0xc28b('0x2f')](_0x56e4f5[_0xc28b('0x30')]);_0x2a7b4a['filters']=_[_0xc28b('0x31')](_0x2a7b4a[_0xc28b('0x2e')],_0x2a7b4a['query']);_0x1bf1e1[_0xc28b('0x32')]=_[_0xc28b('0x31')](_0x2a7b4a[_0xc28b('0x2e')],qs['fields'](_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x33')]));_0x1bf1e1[_0xc28b('0x32')]=_0x1bf1e1[_0xc28b('0x32')][_0xc28b('0x34')]?_0x1bf1e1['attributes']:_0x2a7b4a[_0xc28b('0x2e')];if(!_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x35')](_0xc28b('0x36'))){_0x1bf1e1[_0xc28b('0x1d')]=qs[_0xc28b('0x1d')](_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x1d')]);_0x1bf1e1[_0xc28b('0x1c')]=qs['offset'](_0x56e4f5[_0xc28b('0x30')]['offset']);}_0x1bf1e1[_0xc28b('0x37')]=qs[_0xc28b('0x38')](_0x56e4f5['query'][_0xc28b('0x38')]);_0x1bf1e1[_0xc28b('0x39')]=qs['filters'](_[_0xc28b('0x3a')](_0x56e4f5[_0xc28b('0x30')],_0x2a7b4a[_0xc28b('0x3b')]));if(_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x3c')]){_0x1bf1e1['where']=_[_0xc28b('0x3d')](_0x1bf1e1[_0xc28b('0x39')],{'$or':_[_0xc28b('0x3e')](_0x1aa3ac,function(_0x3de143){if(_0x3de143['type'][_0xc28b('0x3f')]!=='VIRTUAL'){var _0x144e73={};_0x144e73[_0x3de143[_0xc28b('0x40')]]={'$like':'%'+_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x3c')]+'%'};return _0x144e73;}})});}_0x1bf1e1=_[_0xc28b('0x3d')]({},_0x1bf1e1,_0x56e4f5[_0xc28b('0x41')]);var _0x558f5c={'where':_0x1bf1e1[_0xc28b('0x39')]};return db[_0xc28b('0x2c')][_0xc28b('0x42')](_0x558f5c)[_0xc28b('0x25')](function(_0x4b4310){_0x1ca36f['count']=_0x4b4310;if(_0x56e4f5[_0xc28b('0x30')][_0xc28b('0x43')]){_0x1bf1e1[_0xc28b('0x44')]=[{'all':!![]}];}return db[_0xc28b('0x2c')]['findAll'](_0x1bf1e1);})[_0xc28b('0x25')](function(_0x1fc6eb){_0x1ca36f['rows']=_0x1fc6eb;return _0x1ca36f;})['then'](respondWithFilteredResult(_0x302b1b,_0x1bf1e1))[_0xc28b('0x45')](handleError(_0x302b1b,null));};exports[_0xc28b('0x46')]=function(_0x409936,_0x23e84b){var _0x41c686={'raw':!![],'where':{'id':_0x409936[_0xc28b('0x47')]['id']}},_0x55ffee={};_0x55ffee['model']=_[_0xc28b('0x2f')](db[_0xc28b('0x2c')][_0xc28b('0x2d')]);_0x55ffee[_0xc28b('0x30')]=_['keys'](_0x409936[_0xc28b('0x30')]);_0x55ffee[_0xc28b('0x3b')]=_[_0xc28b('0x31')](_0x55ffee[_0xc28b('0x2e')],_0x55ffee['query']);_0x41c686[_0xc28b('0x32')]=_[_0xc28b('0x31')](_0x55ffee['model'],qs[_0xc28b('0x33')](_0x409936[_0xc28b('0x30')]['fields']));_0x41c686[_0xc28b('0x32')]=_0x41c686[_0xc28b('0x32')][_0xc28b('0x34')]?_0x41c686[_0xc28b('0x32')]:_0x55ffee[_0xc28b('0x2e')];if(_0x409936[_0xc28b('0x30')]['includeAll']){_0x41c686[_0xc28b('0x44')]=[{'all':!![]}];}_0x41c686=_[_0xc28b('0x3d')]({},_0x41c686,_0x409936[_0xc28b('0x41')]);return db[_0xc28b('0x2c')][_0xc28b('0x48')](_0x41c686)[_0xc28b('0x25')](handleEntityNotFound(_0x23e84b,null))[_0xc28b('0x25')](respondWithResult(_0x23e84b,null))[_0xc28b('0x45')](handleError(_0x23e84b,null));};exports[_0xc28b('0x49')]=function(_0x10e3c1,_0x18777c){return db[_0xc28b('0x2c')][_0xc28b('0x49')](_0x10e3c1[_0xc28b('0x4a')],{})[_0xc28b('0x25')](respondWithResult(_0x18777c,0xc9))[_0xc28b('0x45')](handleError(_0x18777c,null));};exports[_0xc28b('0x4b')]=function(_0x5561e7,_0x69eef2){return db[_0xc28b('0x2c')][_0xc28b('0x4b')]()[_0xc28b('0x25')](respondWithResult(_0x69eef2,null))[_0xc28b('0x45')](handleError(_0x69eef2,null));};exports[_0xc28b('0x24')]=function(_0x394fa5,_0x1d91b0){if(_0x394fa5[_0xc28b('0x4a')][_0xc28b('0x4c')]){delete _0x394fa5[_0xc28b('0x4a')][_0xc28b('0x4c')];}return db[_0xc28b('0x2c')][_0xc28b('0x48')]({'where':{'uniqueid':_0x394fa5[_0xc28b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d91b0,null))['then'](saveUpdates(_0x394fa5['body'],null))[_0xc28b('0x25')](respondWithResult(_0x1d91b0,null))[_0xc28b('0x45')](handleError(_0x1d91b0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index d96ae58..dec2303 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 _0x01dd=['CmHopperHistory','cm_hopper_history','endtime','lodash','util','../../config/logger','request-promise','./cmHopperHistory.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01dd,0xd5));var _0xd01d=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x01dd[_0x43776a];return _0x18eb8f;};'use strict';var _=require(_0xd01d('0x0'));var util=require(_0xd01d('0x1'));var logger=require(_0xd01d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd01d('0x3'));var attributes=require(_0xd01d('0x4'));module[_0xd01d('0x5')]=function(_0x2a1384,_0x6cd585){return _0x2a1384[_0xd01d('0x6')](_0xd01d('0x7'),attributes,{'tableName':_0xd01d('0x8'),'paranoid':![],'indexes':[{'name':_0xd01d('0x9'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a68=['moment','bluebird','request-promise','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api'];(function(_0x172623,_0x51f5fd){var _0x35a255=function(_0x5ceeca){while(--_0x5ceeca){_0x172623['push'](_0x172623['shift']());}};_0x35a255(++_0x51f5fd);}(_0x0a68,0x173));var _0x80a6=function(_0x3bfa18,_0x1752dc){_0x3bfa18=_0x3bfa18-0x0;var _0x6ad2e4=_0x0a68[_0x3bfa18];return _0x6ad2e4;};'use strict';var _=require(_0x80a6('0x0'));var util=require(_0x80a6('0x1'));var logger=require('../../config/logger')(_0x80a6('0x2'));var moment=require(_0x80a6('0x3'));var BPromise=require(_0x80a6('0x4'));var rp=require(_0x80a6('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x196dce,_0x24caca){return _0x196dce[_0x80a6('0x6')](_0x80a6('0x7'),attributes,{'tableName':_0x80a6('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x80a6('0x9')]},{'name':'uniqueid','fields':[_0x80a6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c174185..b5ef4e6 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 _0x48b2=['`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','body','options','info','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime'];(function(_0x21d150,_0x2750d0){var _0x4d9512=function(_0x499dd0){while(--_0x499dd0){_0x21d150['push'](_0x21d150['shift']());}};_0x4d9512(++_0x2750d0);}(_0x48b2,0x176));var _0x248b=function(_0x15f4b8,_0x3a44b3){_0x15f4b8=_0x15f4b8-0x0;var _0x573527=_0x48b2[_0x15f4b8];return _0x573527;};'use strict';var _=require(_0x248b('0x0'));var util=require(_0x248b('0x1'));var moment=require(_0x248b('0x2'));var BPromise=require(_0x248b('0x3'));var rs=require(_0x248b('0x4'));var fs=require('fs');var Redis=require(_0x248b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x248b('0x6'));var logger=require('../../config/logger')(_0x248b('0x7'));var config=require(_0x248b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x248b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5189bb,_0x14fc46,_0x109fd7){return new BPromise(function(_0xa580ff,_0x376960){return client[_0x248b('0xa')](_0x5189bb,_0x109fd7)[_0x248b('0xb')](function(_0x5be12f){logger['info'](_0x248b('0xc'),_0x14fc46,'request\x20sent');logger[_0x248b('0xd')](_0x248b('0xe'),_0x14fc46,'request\x20sent',JSON[_0x248b('0xf')](_0x5be12f));if(_0x5be12f[_0x248b('0x10')]){if(_0x5be12f['error'][_0x248b('0x11')]===0x1f4){logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f['error']['message']);return _0x376960(_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);}logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);return _0xa580ff(_0x5be12f[_0x248b('0x10')]['message']);}else{logger['info'](_0x248b('0xc'),_0x14fc46,_0x248b('0x13'));_0xa580ff(_0x5be12f['result'][_0x248b('0x12')]);}})[_0x248b('0x14')](function(_0x304dba){logger[_0x248b('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x14fc46,_0x304dba);_0x376960(_0x304dba);});});}exports[_0x248b('0x15')]=function(_0x146300){var _0xaa8232=this;return new Promise(function(_0x3bb21f,_0x4de01a){return db[_0x248b('0x16')]['create'](_0x146300[_0x248b('0x17')],{'raw':_0x146300[_0x248b('0x18')]?_0x146300[_0x248b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x248b('0xb')](function(_0x40a6b7){logger[_0x248b('0x19')](_0x248b('0x15'),_0x146300);logger[_0x248b('0xd')](_0x248b('0x15'),_0x146300,JSON['stringify'](_0x40a6b7));_0x3bb21f(_0x40a6b7);})[_0x248b('0x14')](function(_0x1cb2a7){logger[_0x248b('0x10')]('CreateCmHopperHistory',_0x1cb2a7[_0x248b('0x12')],_0x146300);_0x4de01a(_0xaa8232[_0x248b('0x10')](0x1f4,_0x1cb2a7['message']));});});};exports['AvgHandleTime']=function(_0x20123f){var _0x25ad0d=this;return new Promise(function(_0x2657e3,_0x4980b4){return db[_0x248b('0x16')][_0x248b('0x1a')]({'raw':_0x20123f[_0x248b('0x18')]?_0x20123f['options']['raw']===undefined?!![]:![]:!![],'where':_0x20123f['options']?_0x20123f['options'][_0x248b('0x1b')]||null:null,'attributes':[[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db['sequelize'][_0x248b('0x1e')]('id')),_0x248b('0x1f')],[db[_0x248b('0x1c')]['fn']('COUNT',db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')](_0x248b('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db['sequelize']['fn']('IF',db[_0x248b('0x1c')]['literal'](_0x248b('0x22')))),_0x248b('0x23')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0x248b('0x24')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x25'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x26')))),_0x248b('0x27')],[db[_0x248b('0x1c')]['fn']('AVG',db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x28')))),_0x248b('0x29')]]})[_0x248b('0xb')](function(_0x127c7c){logger[_0x248b('0x19')]('AvgHandleTime',_0x20123f);logger[_0x248b('0xd')](_0x248b('0x2a'),_0x20123f,JSON[_0x248b('0xf')](_0x127c7c));_0x2657e3(_0x127c7c);})['catch'](function(_0x24e99e){logger['error'](_0x248b('0x2a'),_0x24e99e[_0x248b('0x12')],_0x20123f);_0x4980b4(_0x25ad0d[_0x248b('0x10')](0x1f4,_0x24e99e[_0x248b('0x12')]));});});};exports[_0x248b('0x2b')]=function(_0xe2e7e1){var _0x274036=this;return new Promise(function(_0x28b074,_0x536e3a){return db[_0x248b('0x16')][_0x248b('0x1a')]({'raw':_0xe2e7e1[_0x248b('0x18')]?_0xe2e7e1['options']['raw']===undefined?!![]:![]:!![],'where':_0xe2e7e1['options']?_0xe2e7e1['options']['where']||null:null,'attributes':[[_0x248b('0x2c'),'name'],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x2d')))),_0x248b('0x2e')],[db[_0x248b('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x2f')))),_0x248b('0x30')],[db[_0x248b('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x21')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0x248b('0x31')],[db['sequelize']['fn']('COUNT',db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')]('`state`\x20=\x208,\x201,\x20null'))),_0x248b('0x32')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')]['literal'](_0x248b('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x34')))),_0x248b('0x35')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')](_0x248b('0x36')))),_0x248b('0x37')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')](_0x248b('0x38')))),_0x248b('0x39')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db['sequelize']['fn']('IF',db[_0x248b('0x1c')]['literal'](_0x248b('0x3a')))),_0x248b('0x3b')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0x248b('0x3c')],[db[_0x248b('0x1c')]['fn']('COUNT',db[_0x248b('0x1c')]['fn']('IF',db['sequelize'][_0x248b('0x20')](_0x248b('0x3d')))),_0x248b('0x3e')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')]['literal'](_0x248b('0x3f')))),_0x248b('0x3c')],[db[_0x248b('0x1c')]['fn']('COUNT',db[_0x248b('0x1c')]['fn']('IF',db[_0x248b('0x1c')][_0x248b('0x20')](_0x248b('0x40')))),_0x248b('0x41')]],'group':[_0x248b('0x2c')]})[_0x248b('0xb')](function(_0x39c0b5){logger[_0x248b('0x19')](_0x248b('0x2b'),_0xe2e7e1);logger['debug'](_0x248b('0x2b'),_0xe2e7e1,JSON[_0x248b('0xf')](_0x39c0b5));_0x28b074(_0x39c0b5);})[_0x248b('0x14')](function(_0x4adba8){logger['error'](_0x248b('0x2b'),_0x4adba8[_0x248b('0x12')],_0xe2e7e1);_0x536e3a(_0x274036[_0x248b('0x10')](0x1f4,_0x4adba8[_0x248b('0x12')]));});});};exports[_0x248b('0x42')]=function(_0x297128){var _0x5cab1b=this;return new Promise(function(_0x2c00a2,_0x57a5b){return db[_0x248b('0x16')][_0x248b('0x1a')]({'raw':_0x297128['options']?_0x297128[_0x248b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x297128['options']?_0x297128[_0x248b('0x18')][_0x248b('0x1b')]||null:null,'attributes':[['campaign',_0x248b('0x43')],[db[_0x248b('0x1c')]['fn'](_0x248b('0x1d'),db['sequelize'][_0x248b('0x1e')]('id')),_0x248b('0x44')],[db[_0x248b('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x248b('0x1c')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x248b('0x2c')]})[_0x248b('0xb')](function(_0x8a3d5a){logger[_0x248b('0x19')](_0x248b('0x42'),_0x297128);logger[_0x248b('0xd')](_0x248b('0x42'),_0x297128,JSON[_0x248b('0xf')](_0x8a3d5a));_0x2c00a2(_0x8a3d5a);})[_0x248b('0x14')](function(_0x5a19ad){logger[_0x248b('0x10')](_0x248b('0x42'),_0x5a19ad[_0x248b('0x12')],_0x297128);_0x57a5b(_0x5cab1b[_0x248b('0x10')](0x1f4,_0x5a19ad['message']));});});}; \ No newline at end of file +var _0x5c68=['CmHopperHistory','findAll','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','col','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','create','body','options','AvgHandleTime'];(function(_0x5f296f,_0x41e34d){var _0x4a517e=function(_0xcd0340){while(--_0xcd0340){_0x5f296f['push'](_0x5f296f['shift']());}};_0x4a517e(++_0x41e34d);}(_0x5c68,0x1e9));var _0x85c6=function(_0x14c493,_0x114bb7){_0x14c493=_0x14c493-0x0;var _0x349739=_0x5c68[_0x14c493];return _0x349739;};'use strict';var _=require(_0x85c6('0x0'));var util=require(_0x85c6('0x1'));var moment=require(_0x85c6('0x2'));var BPromise=require(_0x85c6('0x3'));var rs=require(_0x85c6('0x4'));var fs=require('fs');var Redis=require(_0x85c6('0x5'));var db=require(_0x85c6('0x6'))['db'];var utils=require(_0x85c6('0x7'));var logger=require('../../config/logger')(_0x85c6('0x8'));var config=require(_0x85c6('0x9'));var jayson=require(_0x85c6('0xa'));var client=jayson[_0x85c6('0xb')][_0x85c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x220464,_0x3fe657,_0x178725){return new BPromise(function(_0x511c83,_0x21a719){return client[_0x85c6('0xd')](_0x220464,_0x178725)[_0x85c6('0xe')](function(_0x55b91e){logger[_0x85c6('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x3fe657,_0x85c6('0x10'));logger[_0x85c6('0x11')](_0x85c6('0x12'),_0x3fe657,_0x85c6('0x10'),JSON[_0x85c6('0x13')](_0x55b91e));if(_0x55b91e['error']){if(_0x55b91e[_0x85c6('0x14')]['code']===0x1f4){logger['error'](_0x85c6('0x15'),_0x3fe657,_0x55b91e[_0x85c6('0x14')][_0x85c6('0x16')]);return _0x21a719(_0x55b91e[_0x85c6('0x14')]['message']);}logger[_0x85c6('0x14')](_0x85c6('0x15'),_0x3fe657,_0x55b91e[_0x85c6('0x14')][_0x85c6('0x16')]);return _0x511c83(_0x55b91e[_0x85c6('0x14')]['message']);}else{logger[_0x85c6('0xf')](_0x85c6('0x15'),_0x3fe657,_0x85c6('0x10'));_0x511c83(_0x55b91e['result'][_0x85c6('0x16')]);}})[_0x85c6('0x17')](function(_0x3a827a){logger['error'](_0x85c6('0x15'),_0x3fe657,_0x3a827a);_0x21a719(_0x3a827a);});});}exports[_0x85c6('0x18')]=function(_0x5bb74c){var _0x2f8532=this;return new Promise(function(_0x58c8e0,_0x270e26){return db['CmHopperHistory'][_0x85c6('0x19')](_0x5bb74c[_0x85c6('0x1a')],{'raw':_0x5bb74c[_0x85c6('0x1b')]?_0x5bb74c[_0x85c6('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x85c6('0xe')](function(_0x48457c){logger[_0x85c6('0xf')](_0x85c6('0x18'),_0x5bb74c);logger[_0x85c6('0x11')](_0x85c6('0x18'),_0x5bb74c,JSON['stringify'](_0x48457c));_0x58c8e0(_0x48457c);})[_0x85c6('0x17')](function(_0x4ac3ee){logger[_0x85c6('0x14')](_0x85c6('0x18'),_0x4ac3ee[_0x85c6('0x16')],_0x5bb74c);_0x270e26(_0x2f8532[_0x85c6('0x14')](0x1f4,_0x4ac3ee['message']));});});};exports[_0x85c6('0x1c')]=function(_0x5c624b){var _0x1207a7=this;return new Promise(function(_0x75918,_0x461b75){return db[_0x85c6('0x1d')][_0x85c6('0x1e')]({'raw':_0x5c624b['options']?_0x5c624b[_0x85c6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5c624b[_0x85c6('0x1b')]?_0x5c624b['options']['where']||null:null,'attributes':[[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['col']('id')),_0x85c6('0x21')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db['sequelize']['fn']('IF',db[_0x85c6('0x1f')]['literal'](_0x85c6('0x22')))),_0x85c6('0x23')],[db['sequelize']['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0x85c6('0x25')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x27'),db['sequelize']['fn']('IF',db[_0x85c6('0x1f')]['literal'](_0x85c6('0x28')))),_0x85c6('0x29')],[db['sequelize']['fn'](_0x85c6('0x27'),db[_0x85c6('0x1f')]['fn']('IF',db['sequelize'][_0x85c6('0x24')](_0x85c6('0x2a')))),'predictiveIntervalAvgTalktime']]})[_0x85c6('0xe')](function(_0x510eff){logger['info'](_0x85c6('0x1c'),_0x5c624b);logger[_0x85c6('0x11')](_0x85c6('0x1c'),_0x5c624b,JSON[_0x85c6('0x13')](_0x510eff));_0x75918(_0x510eff);})[_0x85c6('0x17')](function(_0x1cbf21){logger[_0x85c6('0x14')](_0x85c6('0x1c'),_0x1cbf21[_0x85c6('0x16')],_0x5c624b);_0x461b75(_0x1207a7[_0x85c6('0x14')](0x1f4,_0x1cbf21[_0x85c6('0x16')]));});});};exports[_0x85c6('0x2b')]=function(_0x30bfce){var _0x146be8=this;return new Promise(function(_0x5860cf,_0x49a3e0){return db[_0x85c6('0x1d')][_0x85c6('0x1e')]({'raw':_0x30bfce[_0x85c6('0x1b')]?_0x30bfce[_0x85c6('0x1b')][_0x85c6('0x2c')]===undefined?!![]:![]:!![],'where':_0x30bfce[_0x85c6('0x1b')]?_0x30bfce[_0x85c6('0x1b')]['where']||null:null,'attributes':[[_0x85c6('0x2d'),_0x85c6('0x2e')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db['sequelize']['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x85c6('0x31')],[db[_0x85c6('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x32')))),_0x85c6('0x33')],[db['sequelize']['fn'](_0x85c6('0x20'),db['sequelize']['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x34')))),'outboundCongestionCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x35')))),_0x85c6('0x36')],[db[_0x85c6('0x1f')]['fn']('COUNT',db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x37')))),_0x85c6('0x38')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')]['literal'](_0x85c6('0x39')))),_0x85c6('0x3a')],[db[_0x85c6('0x1f')]['fn']('COUNT',db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x3b')))),_0x85c6('0x3c')],[db[_0x85c6('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x3d')))),_0x85c6('0x3e')],[db['sequelize']['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x3f')))),_0x85c6('0x40')],[db['sequelize']['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')]['literal'](_0x85c6('0x41')))),_0x85c6('0x42')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x43')))),'outboundRejectCallsDay'],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')][_0x85c6('0x24')](_0x85c6('0x44')))),_0x85c6('0x45')]],'group':[_0x85c6('0x2d')]})[_0x85c6('0xe')](function(_0x34b86c){logger[_0x85c6('0xf')](_0x85c6('0x2b'),_0x30bfce);logger[_0x85c6('0x11')](_0x85c6('0x2b'),_0x30bfce,JSON[_0x85c6('0x13')](_0x34b86c));_0x5860cf(_0x34b86c);})[_0x85c6('0x17')](function(_0x50cbcf){logger[_0x85c6('0x14')]('GetVoiceQueueHopperHistory',_0x50cbcf[_0x85c6('0x16')],_0x30bfce);_0x49a3e0(_0x146be8[_0x85c6('0x14')](0x1f4,_0x50cbcf[_0x85c6('0x16')]));});});};exports[_0x85c6('0x46')]=function(_0x44f352){var _0x12a36d=this;return new Promise(function(_0x3a4e73,_0xcad7a2){return db[_0x85c6('0x1d')]['findAll']({'raw':_0x44f352[_0x85c6('0x1b')]?_0x44f352['options']['raw']===undefined?!![]:![]:!![],'where':_0x44f352[_0x85c6('0x1b')]?_0x44f352[_0x85c6('0x1b')][_0x85c6('0x47')]||null:null,'attributes':[[_0x85c6('0x2d'),'name'],[db['sequelize']['fn']('COUNT',db[_0x85c6('0x1f')][_0x85c6('0x48')]('id')),_0x85c6('0x49')],[db[_0x85c6('0x1f')]['fn'](_0x85c6('0x20'),db[_0x85c6('0x1f')]['fn']('IF',db[_0x85c6('0x1f')]['literal'](_0x85c6('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85c6('0x2d')]})['then'](function(_0x183bb7){logger[_0x85c6('0xf')](_0x85c6('0x46'),_0x44f352);logger['debug'](_0x85c6('0x46'),_0x44f352,JSON[_0x85c6('0x13')](_0x183bb7));_0x3a4e73(_0x183bb7);})[_0x85c6('0x17')](function(_0x1446d4){logger[_0x85c6('0x14')](_0x85c6('0x46'),_0x1446d4[_0x85c6('0x16')],_0x44f352);_0xcad7a2(_0x12a36d[_0x85c6('0x14')](0x1f4,_0x1446d4['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f65fd52..fa01d26 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 _0x86f4=['Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x86f4,0x18a));var _0x486f=function(_0x3c8468,_0x3eb5d6){_0x3c8468=_0x3c8468-0x0;var _0x5ceeb8=_0x86f4[_0x3c8468];return _0x5ceeb8;};'use strict';var multer=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var path=require(_0x486f('0x2'));var timeout=require(_0x486f('0x3'));var express=require(_0x486f('0x4'));var router=express[_0x486f('0x5')]();var auth=require(_0x486f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x486f('0x7'));var controller=require(_0x486f('0x8'));router['get']('/',auth[_0x486f('0x9')](),controller[_0x486f('0xa')]);router[_0x486f('0xb')](_0x486f('0xc'),auth[_0x486f('0x9')](),controller[_0x486f('0xd')]);router['get'](_0x486f('0xe'),auth[_0x486f('0x9')](),controller[_0x486f('0xf')]);router[_0x486f('0x10')]('/',auth[_0x486f('0x9')](),controller[_0x486f('0x11')]);router[_0x486f('0x12')](_0x486f('0xe'),auth[_0x486f('0x9')](),controller[_0x486f('0x13')]);module[_0x486f('0x14')]=router; \ No newline at end of file +var _0xadf0=['./cmHopperHistory.controller','/describe','isAuthenticated','/:id','post','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xadf0,0x12d));var _0x0adf=function(_0x5581f7,_0x23d099){_0x5581f7=_0x5581f7-0x0;var _0x459c65=_0xadf0[_0x5581f7];return _0x459c65;};'use strict';var multer=require('multer');var util=require(_0x0adf('0x0'));var path=require(_0x0adf('0x1'));var timeout=require(_0x0adf('0x2'));var express=require(_0x0adf('0x3'));var router=express[_0x0adf('0x4')]();var auth=require(_0x0adf('0x5'));var interaction=require(_0x0adf('0x6'));var config=require('../../config/environment');var controller=require(_0x0adf('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0adf('0x8'),auth[_0x0adf('0x9')](),controller['describe']);router['get'](_0x0adf('0xa'),auth[_0x0adf('0x9')](),controller['show']);router[_0x0adf('0xb')]('/',auth[_0x0adf('0x9')](),controller['create']);router[_0x0adf('0xc')](_0x0adf('0xa'),auth[_0x0adf('0x9')](),controller['update']);module[_0x0adf('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c9c2c2e..af36305 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 _0xabce=['exports','STRING','name','sequelize'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0xabce,0x103));var _0xeabc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xabce[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'unique':_0xeabc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeabc('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe14b=['sequelize','exports','STRING'];(function(_0xff6721,_0x5ecf11){var _0x2a0076=function(_0x1e01a1){while(--_0x1e01a1){_0xff6721['push'](_0xff6721['shift']());}};_0x2a0076(++_0x5ecf11);}(_0xe14b,0x93));var _0xbe14=function(_0x3843a6,_0x1cddf2){_0x3843a6=_0x3843a6-0x0;var _0x5ae272=_0xe14b[_0x3843a6];return _0x5ae272;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe14('0x2')]},'dialPrefix':{'type':Sequelize[_0xbe14('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a7df69a..987b4bc 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 _0x941d=['socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','update','Lists','UserProfileResource','destroy','then','error','stack','name','index','CmList','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','getDispositions','Disposition','pick','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','getContactsCsv','format','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-type','text/csv','download','findOne','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x941d,0x197));var _0xd941=function(_0x258257,_0x32042d){_0x258257=_0x258257-0x0;var _0xafb58a=_0x941d[_0x258257];return _0xafb58a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd941('0x0'));var zipdir=require(_0xd941('0x1'));var jsonpatch=require(_0xd941('0x2'));var rp=require(_0xd941('0x3'));var moment=require(_0xd941('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd941('0x5'));var path=require(_0xd941('0x6'));var sox=require(_0xd941('0x7'));var csv=require(_0xd941('0x8'));var ejs=require(_0xd941('0x9'));var fs=require('fs');var _=require(_0xd941('0xa'));var squel=require(_0xd941('0xb'));var crypto=require(_0xd941('0xc'));var jsforce=require(_0xd941('0xd'));var deskjs=require(_0xd941('0xe'));var toCsv=require(_0xd941('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xd941('0xf'));var hardwareService=require(_0xd941('0x10'));var Redis=require(_0xd941('0x11'));var qs=require(_0xd941('0x12'));var logger=require(_0xd941('0x13'))(_0xd941('0x14'));var utils=require(_0xd941('0x15'));var config=require(_0xd941('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd941('0x17')](config['redis'],{'host':_0xd941('0x18'),'port':0x18eb});var socket=require(_0xd941('0x19'))(new Redis(config['redis']));require(_0xd941('0x1a'))[_0xd941('0x1b')](socket);function respondWithStatusCode(_0x3f1873,_0x553126){_0x553126=_0x553126||0xcc;return function(_0x203158){if(_0x203158){return _0x3f1873[_0xd941('0x1c')](_0x553126);}return _0x3f1873[_0xd941('0x1d')](_0x553126)[_0xd941('0x1e')]();};}function respondWithResult(_0x36399f,_0x5383c3){_0x5383c3=_0x5383c3||0xc8;return function(_0x222717){if(_0x222717){return _0x36399f[_0xd941('0x1d')](_0x5383c3)['json'](_0x222717);}};}function respondWithFilteredResult(_0x29268a,_0x4ae62b){return function(_0x3cc88c){if(_0x3cc88c){var _0x1a26e0=_0x3cc88c['count'],_0x19ac10=_0x4ae62b[_0xd941('0x1f')],_0x45831b=_0x4ae62b[_0xd941('0x1f')]+_0x4ae62b[_0xd941('0x20')],_0x36bc42;if(_0x45831b>=_0x1a26e0){_0x45831b=_0x1a26e0;_0x36bc42=0xc8;}else{_0x36bc42=0xce;}_0x29268a[_0xd941('0x1d')](_0x36bc42);return _0x29268a[_0xd941('0x21')](_0xd941('0x22'),_0x19ac10+'-'+_0x45831b+'/'+_0x1a26e0)[_0xd941('0x23')](_0x3cc88c);}return null;};}function patchUpdates(_0x44a85c){return function(_0x1baa61){try{jsonpatch['apply'](_0x1baa61,_0x44a85c,!![]);}catch(_0x320d99){return BPromise[_0xd941('0x24')](_0x320d99);}return _0x1baa61['save']();};}function saveUpdates(_0x45cfcd,_0x473103){return function(_0x3b2c75){if(_0x3b2c75){return _0x3b2c75[_0xd941('0x25')](_0x45cfcd)['then'](function(_0x5c4b3d){return _0x5c4b3d;});}return null;};}function removeEntity(_0x295683,_0x32b528){return function(_0x1c0e03){if(_0x1c0e03){return _0x1c0e03['destroy']()['then'](function(){var _0x447da3=_0x1c0e03['get']({'plain':!![]});var _0x43335f=_0xd941('0x26');return db[_0xd941('0x27')][_0xd941('0x28')]({'where':{'type':_0x43335f,'resourceId':_0x447da3['id']}})[_0xd941('0x29')](function(){return _0x1c0e03;});})[_0xd941('0x29')](function(){_0x295683[_0xd941('0x1d')](0xcc)[_0xd941('0x1e')]();});}};}function handleEntityNotFound(_0x284a33,_0x4752a3){return function(_0x1b4d68){if(!_0x1b4d68){_0x284a33[_0xd941('0x1c')](0x194);}return _0x1b4d68;};}function handleError(_0x180796,_0x3e9e13){_0x3e9e13=_0x3e9e13||0x1f4;return function(_0x5a3f84){logger[_0xd941('0x2a')](_0x5a3f84[_0xd941('0x2b')]);if(_0x5a3f84[_0xd941('0x2c')]){delete _0x5a3f84[_0xd941('0x2c')];}_0x180796['status'](_0x3e9e13)['send'](_0x5a3f84);};}exports[_0xd941('0x2d')]=function(_0x56df46,_0x1c3634){var _0x55340f={},_0x16536d={},_0x4d0f20={'count':0x0,'rows':[]};var _0xb8b455=db[_0xd941('0x2e')][_0xd941('0x2f')];_0x16536d[_0xd941('0x30')]=_[_0xd941('0x31')](_0xb8b455);_0x16536d[_0xd941('0x32')]=_[_0xd941('0x31')](_0x56df46[_0xd941('0x32')]);_0x16536d[_0xd941('0x33')]=_[_0xd941('0x34')](_0x16536d[_0xd941('0x30')],_0x16536d[_0xd941('0x32')]);_0x55340f['attributes']=_[_0xd941('0x34')](_0x16536d[_0xd941('0x30')],qs[_0xd941('0x35')](_0x56df46[_0xd941('0x32')][_0xd941('0x35')]));_0x55340f[_0xd941('0x36')]=_0x55340f[_0xd941('0x36')]['length']?_0x55340f[_0xd941('0x36')]:_0x16536d[_0xd941('0x30')];if(!_0x56df46['query'][_0xd941('0x37')](_0xd941('0x38'))){_0x55340f[_0xd941('0x20')]=qs[_0xd941('0x20')](_0x56df46['query'][_0xd941('0x20')]);_0x55340f[_0xd941('0x1f')]=qs[_0xd941('0x1f')](_0x56df46['query'][_0xd941('0x1f')]);}_0x55340f[_0xd941('0x39')]=qs['sort'](_0x56df46[_0xd941('0x32')][_0xd941('0x3a')]);_0x55340f[_0xd941('0x3b')]=qs['filters'](_['pick'](_0x56df46[_0xd941('0x32')],_0x16536d['filters']));if(_0x56df46[_0xd941('0x32')][_0xd941('0x3c')]){_0x55340f[_0xd941('0x3b')]=_[_0xd941('0x3d')](_0x55340f[_0xd941('0x3b')],{'$or':_[_0xd941('0x3e')](_0xb8b455,function(_0x7f6007){if(_0x7f6007[_0xd941('0x3f')][_0xd941('0x40')]!==_0xd941('0x41')){var _0x161d5e={};_0x161d5e[_0x7f6007[_0xd941('0x42')]]={'$like':'%'+_0x56df46['query'][_0xd941('0x3c')]+'%'};return _0x161d5e;}})});}_0x55340f=_[_0xd941('0x3d')]({},_0x55340f,_0x56df46[_0xd941('0x43')]);var _0x2003ad={'where':_0x55340f[_0xd941('0x3b')]};return db['CmList'][_0xd941('0x44')](_0x2003ad)['then'](function(_0x233747){_0x4d0f20['count']=_0x233747;if(_0x56df46[_0xd941('0x32')][_0xd941('0x45')]){_0x55340f[_0xd941('0x46')]=[{'all':!![]}];}return db[_0xd941('0x2e')][_0xd941('0x47')](_0x55340f);})[_0xd941('0x29')](function(_0x10f0fc){_0x4d0f20[_0xd941('0x48')]=_0x10f0fc;return _0x4d0f20;})[_0xd941('0x29')](respondWithFilteredResult(_0x1c3634,_0x55340f))['catch'](handleError(_0x1c3634,null));};exports[_0xd941('0x49')]=function(_0x52715b,_0x15d678){var _0xb7364c={'raw':![],'where':{'id':_0x52715b[_0xd941('0x4a')]['id']}},_0x8ccb={};_0x8ccb[_0xd941('0x30')]=_[_0xd941('0x31')](db[_0xd941('0x2e')][_0xd941('0x2f')]);_0x8ccb[_0xd941('0x32')]=_[_0xd941('0x31')](_0x52715b[_0xd941('0x32')]);_0x8ccb[_0xd941('0x33')]=_[_0xd941('0x34')](_0x8ccb[_0xd941('0x30')],_0x8ccb[_0xd941('0x32')]);_0xb7364c[_0xd941('0x36')]=_[_0xd941('0x34')](_0x8ccb[_0xd941('0x30')],qs[_0xd941('0x35')](_0x52715b[_0xd941('0x32')][_0xd941('0x35')]));_0xb7364c[_0xd941('0x36')]=_0xb7364c[_0xd941('0x36')][_0xd941('0x4b')]?_0xb7364c[_0xd941('0x36')]:_0x8ccb[_0xd941('0x30')];if(_0x52715b[_0xd941('0x32')]['includeAll']){_0xb7364c[_0xd941('0x46')]=[{'all':!![]}];}_0xb7364c=_[_0xd941('0x3d')]({},_0xb7364c,_0x52715b['options']);return db['CmList'][_0xd941('0x4c')](_0xb7364c)[_0xd941('0x29')](handleEntityNotFound(_0x15d678,null))[_0xd941('0x29')](respondWithResult(_0x15d678,null))['catch'](handleError(_0x15d678,null));};exports[_0xd941('0x4d')]=function(_0xf95455,_0x4e515a){return db[_0xd941('0x2e')][_0xd941('0x4d')](_0xf95455['body'],{})[_0xd941('0x29')](function(_0x1cfa86){var _0x2c73b9=_0xf95455[_0xd941('0x4e')]['get']({'plain':!![]});if(!_0x2c73b9)throw new Error(_0xd941('0x4f'));if(_0x2c73b9[_0xd941('0x50')]==='user'){var _0x429b15=_0x1cfa86[_0xd941('0x51')]({'plain':!![]});var _0x3badac=_0xd941('0x26');return db[_0xd941('0x52')]['find']({'where':{'name':_0x3badac,'userProfileId':_0x2c73b9[_0xd941('0x53')]},'raw':!![]})[_0xd941('0x29')](function(_0x286dad){if(_0x286dad&&_0x286dad[_0xd941('0x54')]===0x0){return db[_0xd941('0x27')]['create']({'name':_0x429b15[_0xd941('0x2c')],'resourceId':_0x429b15['id'],'type':_0x286dad['name'],'sectionId':_0x286dad['id']},{})['then'](function(){return _0x1cfa86;});}else{return _0x1cfa86;}})[_0xd941('0x55')](function(_0x31f6a0){logger[_0xd941('0x2a')](_0xd941('0x56'),_0x31f6a0);throw _0x31f6a0;});}return _0x1cfa86;})[_0xd941('0x29')](respondWithResult(_0x4e515a,0xc9))[_0xd941('0x55')](handleError(_0x4e515a,null));};exports[_0xd941('0x25')]=function(_0x3a5bf4,_0x35398e){if(_0x3a5bf4[_0xd941('0x57')]['id']){delete _0x3a5bf4['body']['id'];}return db[_0xd941('0x2e')]['find']({'where':{'id':_0x3a5bf4[_0xd941('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35398e,null))[_0xd941('0x29')](saveUpdates(_0x3a5bf4[_0xd941('0x57')],null))[_0xd941('0x29')](respondWithResult(_0x35398e,null))[_0xd941('0x55')](handleError(_0x35398e,null));};exports[_0xd941('0x28')]=function(_0x17d58d,_0x3618df){return db[_0xd941('0x2e')][_0xd941('0x4c')]({'where':{'id':_0x17d58d['params']['id']}})['then'](handleEntityNotFound(_0x3618df,null))[_0xd941('0x29')](removeEntity(_0x3618df,null))[_0xd941('0x55')](handleError(_0x3618df,null));};exports[_0xd941('0x58')]=function(_0x3e2848,_0x1cf87e){return db['CmList'][_0xd941('0x58')]()[_0xd941('0x29')](respondWithResult(_0x1cf87e,null))['catch'](handleError(_0x1cf87e,null));};exports[_0xd941('0x59')]=function(_0x5b7bd8,_0x4e0dd4,_0x3183f9){if(_0x5b7bd8[_0xd941('0x57')]['id']){delete _0x5b7bd8[_0xd941('0x57')]['id'];}return db[_0xd941('0x2e')][_0xd941('0x4c')]({'where':{'id':_0x5b7bd8[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x4e0dd4,null))[_0xd941('0x29')](function(_0x5126e6){if(_0x5126e6){_0x5b7bd8[_0xd941('0x57')][_0xd941('0x5a')]=_0x5126e6['id'];return db['Disposition'][_0xd941('0x4d')](_0x5b7bd8['body']);}})[_0xd941('0x29')](respondWithResult(_0x4e0dd4,null))['catch'](handleError(_0x4e0dd4,null));};exports[_0xd941('0x5b')]=function(_0x29c44b,_0x3d62f2,_0x4d57d1){var _0x159bcb={'raw':![],'where':{}};var _0x5d6747={};var _0xb5d80a={'count':0x0,'rows':[]};return db[_0xd941('0x2e')]['findOne']({'where':{'id':_0x29c44b[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x3d62f2,null))[_0xd941('0x29')](function(_0x71fb21){if(_0x71fb21){_0x5d6747[_0xd941('0x30')]=_[_0xd941('0x31')](db[_0xd941('0x5c')][_0xd941('0x2f')]);_0x5d6747[_0xd941('0x32')]=_[_0xd941('0x31')](_0x29c44b[_0xd941('0x32')]);_0x5d6747[_0xd941('0x33')]=_[_0xd941('0x34')](_0x5d6747[_0xd941('0x30')],_0x5d6747[_0xd941('0x32')]);_0x159bcb[_0xd941('0x36')]=_['intersection'](_0x5d6747[_0xd941('0x30')],qs['fields'](_0x29c44b['query'][_0xd941('0x35')]));_0x159bcb[_0xd941('0x36')]=_0x159bcb[_0xd941('0x36')]['length']?_0x159bcb[_0xd941('0x36')]:_0x5d6747[_0xd941('0x30')];if(!_0x29c44b[_0xd941('0x32')]['hasOwnProperty'](_0xd941('0x38'))){_0x159bcb[_0xd941('0x20')]=qs['limit'](_0x29c44b[_0xd941('0x32')][_0xd941('0x20')]);_0x159bcb[_0xd941('0x1f')]=qs['offset'](_0x29c44b[_0xd941('0x32')][_0xd941('0x1f')]);}_0x159bcb['order']=qs[_0xd941('0x3a')](_0x29c44b[_0xd941('0x32')]['sort']);_0x159bcb[_0xd941('0x3b')]=qs[_0xd941('0x33')](_[_0xd941('0x5d')](_0x29c44b[_0xd941('0x32')],_0x5d6747['filters']));_0x159bcb[_0xd941('0x3b')][_0xd941('0x5a')]=_0x71fb21['id'];if(_0x29c44b[_0xd941('0x32')][_0xd941('0x3c')]){_0x159bcb['where']=_['merge'](_0x159bcb['where'],{'$or':_[_0xd941('0x3e')](_0x159bcb['attributes'],function(_0x3940b0){var _0x2fc059={};_0x2fc059[_0x3940b0]={'$like':'%'+_0x29c44b[_0xd941('0x32')][_0xd941('0x3c')]+'%'};return _0x2fc059;})});}_0x159bcb=_['merge']({},_0x159bcb,_0x29c44b[_0xd941('0x43')]);return db[_0xd941('0x5c')][_0xd941('0x44')]({'where':_0x159bcb[_0xd941('0x3b')]})[_0xd941('0x29')](function(_0x3d51ed){_0xb5d80a['count']=_0x3d51ed;if(_0x29c44b[_0xd941('0x32')][_0xd941('0x45')]){_0x159bcb['include']=[{'all':!![]}];}return db[_0xd941('0x5c')][_0xd941('0x47')](_0x159bcb);})[_0xd941('0x29')](function(_0x184e4d){_0xb5d80a[_0xd941('0x48')]=_0x184e4d;return _0xb5d80a;});}})[_0xd941('0x29')](respondWithFilteredResult(_0x3d62f2,_0x159bcb))[_0xd941('0x55')](handleError(_0x3d62f2,null));};exports[_0xd941('0x5e')]=function(_0xde4968,_0x5901c3,_0x3638c2){var _0x1657e0;return db[_0xd941('0x2e')]['find']({'where':{'id':_0xde4968[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x5901c3,null))[_0xd941('0x29')](function(_0x49c44d){if(_0x49c44d){return _0x49c44d[_0xd941('0x5e')](_0xde4968[_0xd941('0x32')]['ids']);}})[_0xd941('0x29')](respondWithStatusCode(_0x5901c3,null))[_0xd941('0x55')](handleError(_0x5901c3,null));};exports[_0xd941('0x5f')]=function(_0x275ed1,_0x17fd4b,_0x1617c8){return db[_0xd941('0x2e')][_0xd941('0x4c')]({'where':{'id':_0x275ed1[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x17fd4b,null))[_0xd941('0x29')](function(_0x11d6d8){if(_0x11d6d8){var _0x176a54=[];var _0x43df34={'success':[],'errors':[]};return db[_0xd941('0x60')]['describe']()['then'](function(_0x5c34fd){if(_0x275ed1[_0xd941('0x57')][_0xd941('0x61')]&&_[_0xd941('0x62')](_0x275ed1[_0xd941('0x57')]['tags'])){if(_0x275ed1[_0xd941('0x57')][_0xd941('0x61')][_0xd941('0x4b')]){_0x275ed1['body'][_0xd941('0x61')]=_0x275ed1[_0xd941('0x57')][_0xd941('0x61')][_0xd941('0x63')](';')+';';}else{_0x275ed1[_0xd941('0x57')][_0xd941('0x61')]=null;}}else{_0x275ed1[_0xd941('0x57')][_0xd941('0x61')]=null;}if(_0x275ed1[_0xd941('0x57')]&&_[_0xd941('0x62')](_0x275ed1['body'])){for(var _0x5e04f4=0x0;_0x5e04f4<_0x275ed1[_0xd941('0x57')][_0xd941('0x4b')];_0x5e04f4+=0x1){_0x275ed1[_0xd941('0x57')][_0x5e04f4][_0xd941('0x5a')]=_0x275ed1['params']['id'];_0x176a54[_0xd941('0x64')](_0x275ed1[_0xd941('0x57')][_0x5e04f4]);}return BPromise[_0xd941('0x65')](_0x176a54,function(_0x55702b){return db[_0xd941('0x60')][_0xd941('0x4d')](_[_0xd941('0x66')](_0x55702b,[_0xd941('0x67'),'id'])||{},{'fields':_[_0xd941('0x31')](_0x5c34fd),'raw':!![]})[_0xd941('0x29')](function(_0x320988){_0x43df34[_0xd941('0x68')][_0xd941('0x64')](_0x320988[_0xd941('0x69')]);})[_0xd941('0x55')](function(_0x19f2a4){_0x43df34[_0xd941('0x6a')]['push']({'data':_0x55702b,'error':_0x19f2a4[_0xd941('0x6b')]});});})[_0xd941('0x29')](function(_0x37c1d3){return _0x43df34;})['catch'](function(_0x1d6311){return _0x1d6311;});}else{_0x17fd4b[_0xd941('0x1d')](0x190)['json']({'message':_0xd941('0x6c')});}});}})[_0xd941('0x29')](respondWithResult(_0x17fd4b,null))[_0xd941('0x55')](handleError(_0x17fd4b,null));};exports[_0xd941('0x6d')]=function(_0x4f4564,_0x4be20e,_0x3420ac){var _0x584a98;return db[_0xd941('0x2e')]['find']({'where':{'id':_0x4f4564[_0xd941('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd941('0x6e')}]})[_0xd941('0x29')](handleEntityNotFound(_0x4be20e,null))[_0xd941('0x29')](function(_0x4d339c){if(_0x4d339c){_0x584a98=_0x4d339c;return db[_0xd941('0x60')][_0xd941('0x2f')];}})[_0xd941('0x29')](function(_0xa2e646){if(_0xa2e646){var _0x1a7daa={};var _0x4db7bd={};_0x4db7bd['model']=_[_0xd941('0x6f')](_[_0xd941('0x31')](_0xa2e646),_[_0xd941('0x3e')](_0x584a98[_0xd941('0x6e')],function(_0x52991){return util['format'](_0xd941('0x70'),_0x52991['id']);}));_0x4db7bd[_0xd941('0x32')]=_['keys'](_0x4f4564[_0xd941('0x32')]);_0x4db7bd[_0xd941('0x33')]=_[_0xd941('0x34')](_0x4db7bd[_0xd941('0x30')],_0x4db7bd[_0xd941('0x32')]);_0x1a7daa[_0xd941('0x36')]=_[_0xd941('0x34')](_0x4db7bd[_0xd941('0x30')],qs[_0xd941('0x35')](_0x4f4564[_0xd941('0x32')][_0xd941('0x35')]));_0x1a7daa[_0xd941('0x36')]=_0x1a7daa['attributes']['length']?_0x1a7daa[_0xd941('0x36')]:_0x4db7bd[_0xd941('0x30')];if(!_0x4f4564[_0xd941('0x32')][_0xd941('0x37')](_0xd941('0x38'))){_0x1a7daa[_0xd941('0x20')]=qs[_0xd941('0x20')](_0x4f4564[_0xd941('0x32')][_0xd941('0x20')]);_0x1a7daa[_0xd941('0x1f')]=qs[_0xd941('0x1f')](_0x4f4564['query'][_0xd941('0x1f')]);}_0x1a7daa['order']=qs[_0xd941('0x3a')](_0x4f4564['query'][_0xd941('0x3a')]);_0x1a7daa[_0xd941('0x3b')]=qs[_0xd941('0x33')](_[_0xd941('0x5d')](_0x4f4564[_0xd941('0x32')],_0x4db7bd[_0xd941('0x33')]));_0x1a7daa['raw']=!![];if(_0x4f4564[_0xd941('0x32')][_0xd941('0x3c')]){_0x1a7daa[_0xd941('0x3b')]=_[_0xd941('0x3d')](_0x1a7daa['where'],{'$or':_[_0xd941('0x3e')](_0x1a7daa[_0xd941('0x36')],function(_0x17233b){var _0x61c5={};_0x61c5[_0x17233b]={'$like':'%'+_0x4f4564[_0xd941('0x32')]['filter']+'%'};return _0x61c5;})});}_0x1a7daa=_['merge']({},_0x1a7daa,_0x4f4564[_0xd941('0x43')]);return _0x584a98[_0xd941('0x6d')](_0x1a7daa);}})['then'](respondWithResult(_0x4be20e,null))[_0xd941('0x55')](handleError(_0x4be20e,null));};exports[_0xd941('0x71')]=function(_0x4da1d7,_0x1ad727,_0x58a64a){var _0xf04d24;return db[_0xd941('0x2e')]['find']({'where':{'id':_0x4da1d7[_0xd941('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd941('0x6e')}]})[_0xd941('0x29')](handleEntityNotFound(_0x1ad727,null))[_0xd941('0x29')](function(_0x7e9bb1){if(_0x7e9bb1){_0xf04d24=_0x7e9bb1;return db[_0xd941('0x60')][_0xd941('0x2f')];}})['then'](function(_0x5aac40){if(_0x5aac40){var _0x969b65={};var _0x16516c={};_0x16516c[_0xd941('0x30')]=_['concat'](_[_0xd941('0x31')](_0x5aac40),_[_0xd941('0x3e')](_0xf04d24[_0xd941('0x6e')],function(_0x307a65){return util[_0xd941('0x72')]('cf_%d',_0x307a65['id']);}));_0x16516c[_0xd941('0x32')]=_[_0xd941('0x31')](_0x4da1d7['query']);_0x16516c['filters']=_[_0xd941('0x34')](_0x16516c[_0xd941('0x30')],_0x16516c[_0xd941('0x32')]);_0x969b65[_0xd941('0x36')]=_[_0xd941('0x34')](_0x16516c[_0xd941('0x30')],qs[_0xd941('0x35')](_0x4da1d7['query'][_0xd941('0x35')]));_0x969b65[_0xd941('0x36')]=_0x969b65[_0xd941('0x36')][_0xd941('0x4b')]?_0x969b65[_0xd941('0x36')]:_0x16516c[_0xd941('0x30')];if(!_0x4da1d7[_0xd941('0x32')]['hasOwnProperty'](_0xd941('0x38'))){_0x969b65[_0xd941('0x20')]=qs['limit'](_0x4da1d7['query'][_0xd941('0x20')]);_0x969b65[_0xd941('0x1f')]=qs[_0xd941('0x1f')](_0x4da1d7['query'][_0xd941('0x1f')]);}_0x969b65[_0xd941('0x39')]=qs['sort'](_0x4da1d7['query'][_0xd941('0x3a')]);_0x969b65[_0xd941('0x3b')]=qs['filters'](_[_0xd941('0x5d')](_0x4da1d7[_0xd941('0x32')],_0x16516c[_0xd941('0x33')]));_0x969b65['raw']=!![];if(_0x4da1d7[_0xd941('0x32')][_0xd941('0x3c')]){_0x969b65[_0xd941('0x3b')]=_[_0xd941('0x3d')](_0x969b65['where'],{'$or':_[_0xd941('0x3e')](_0x969b65[_0xd941('0x36')],function(_0x5cd680){var _0x43d372={};_0x43d372[_0x5cd680]={'$like':'%'+_0x4da1d7[_0xd941('0x32')][_0xd941('0x3c')]+'%'};return _0x43d372;})});}_0x969b65=_[_0xd941('0x3d')]({},_0x969b65,_0x4da1d7[_0xd941('0x43')]);return _0xf04d24['getContacts'](_0x969b65);}})['then'](function(_0x2822b6){if(!_[_0xd941('0x73')](_0x2822b6)){var _0x52a9d4=toCsv(_0x2822b6);var _0x43fff9=Date[_0xd941('0x74')]();fs['writeFileSync'](util[_0xd941('0x72')](_0xd941('0x75'),_0xf04d24['id'],_0x43fff9),_0x52a9d4);_0x1ad727[_0xd941('0x76')]('Content-disposition','attachment;\x20filename='+util[_0xd941('0x72')]('list_%d_%s.csv',_0xf04d24['id'],_0x43fff9));_0x1ad727[_0xd941('0x76')](_0xd941('0x77'),_0xd941('0x78'));return _0x1ad727[_0xd941('0x79')](util[_0xd941('0x72')](_0xd941('0x75'),_0xf04d24['id'],_0x43fff9));}else{return _0x1ad727[_0xd941('0x1c')](0xcc);}})['catch'](handleError(_0x1ad727,null));};exports['addCustomField']=function(_0x564fa5,_0x5c2804,_0x455f72){var _0x6c21e7;delete _0x564fa5[_0xd941('0x57')]['id'];return db[_0xd941('0x2e')][_0xd941('0x7a')]({'where':{'id':_0x564fa5[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x5c2804,null))['then'](function(_0x2508a8){if(_0x2508a8){return db[_0xd941('0x7b')][_0xd941('0x7c')](function(_0x198f8c){return db[_0xd941('0x7d')][_0xd941('0x4d')](_0x564fa5[_0xd941('0x57')],{'transaction':_0x198f8c})[_0xd941('0x29')](function(_0x4cff36){_0x6c21e7=_0x4cff36;return _0x2508a8[_0xd941('0x7e')](_0x4cff36,{'transaction':_0x198f8c});})[_0xd941('0x29')](function(){var _0x347830={'type':db[_0xd941('0x7f')][_0xd941('0x80')],'transaction':_0x198f8c};switch(_0x564fa5['body'][_0xd941('0x3f')]){case'text':_0x347830[_0xd941('0x3f')]=db[_0xd941('0x7f')][_0xd941('0x80')];break;case'number':_0x347830[_0xd941('0x3f')]=db['Sequelize'][_0xd941('0x81')];break;case _0xd941('0x82'):_0x347830['type']=db[_0xd941('0x7f')][_0xd941('0x83')];_0x347830['defaultValue']=![];break;default:}return db[_0xd941('0x7b')]['queryInterface'][_0xd941('0x84')](_0xd941('0x85'),util[_0xd941('0x72')](_0xd941('0x86'),_0x6c21e7['id']),_0x347830);})[_0xd941('0x29')](function(){return _0x6c21e7;});});}})[_0xd941('0x29')](respondWithResult(_0x5c2804,null))['catch'](handleError(_0x5c2804,null));};exports[_0xd941('0x87')]=function(_0x553992,_0x277edd,_0x261a15){var _0x17e3f4={};var _0x301943={};var _0x4edd7c;var _0x35e386;return db['CmList'][_0xd941('0x7a')]({'where':{'id':_0x553992[_0xd941('0x4a')]['id']}})['then'](handleEntityNotFound(_0x277edd,null))[_0xd941('0x29')](function(_0x1f6c4e){if(_0x1f6c4e){_0x4edd7c=_0x1f6c4e;_0x301943[_0xd941('0x30')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x301943[_0xd941('0x32')]=_[_0xd941('0x31')](_0x553992[_0xd941('0x32')]);_0x301943[_0xd941('0x33')]=_['intersection'](_0x301943['model'],_0x301943['query']);_0x17e3f4[_0xd941('0x36')]=_[_0xd941('0x34')](_0x301943[_0xd941('0x30')],qs[_0xd941('0x35')](_0x553992[_0xd941('0x32')][_0xd941('0x35')]));_0x17e3f4['attributes']=_0x17e3f4[_0xd941('0x36')]['length']?_0x17e3f4[_0xd941('0x36')]:_0x301943['model'];_0x17e3f4[_0xd941('0x39')]=qs[_0xd941('0x3a')](_0x553992[_0xd941('0x32')][_0xd941('0x3a')]);_0x17e3f4[_0xd941('0x3b')]=qs[_0xd941('0x33')](_[_0xd941('0x5d')](_0x553992[_0xd941('0x32')],_0x301943[_0xd941('0x33')]));_0x17e3f4[_0xd941('0x3b')]=_['merge'](_0x17e3f4['where'],{'$or':[{'ListId':_0x1f6c4e['id']},{'ListId':null}]});if(_0x553992['query']['filter']){_0x17e3f4['where']=_[_0xd941('0x3d')](_0x17e3f4[_0xd941('0x3b')],{'$or':_[_0xd941('0x3e')](_0x17e3f4[_0xd941('0x36')],function(_0x446128){var _0x383141={};_0x383141[_0x446128]={'$like':'%'+_0x553992[_0xd941('0x32')]['filter']+'%'};return _0x383141;})});}_0x17e3f4=_[_0xd941('0x3d')]({},_0x17e3f4,_0x553992['options']);return db[_0xd941('0x7d')][_0xd941('0x88')](_0x17e3f4);}})[_0xd941('0x29')](respondWithResult(_0x277edd,null))[_0xd941('0x55')](handleError(_0x277edd,null));};exports[_0xd941('0x89')]=function(_0x53fe5d,_0x18acf6,_0x2c4315){return db[_0xd941('0x2e')][_0xd941('0x4c')]({'where':{'id':_0x53fe5d[_0xd941('0x4a')]['id']}})[_0xd941('0x29')](handleEntityNotFound(_0x18acf6,null))[_0xd941('0x29')](function(_0x37dbd7){if(_0x37dbd7){return _0x37dbd7['addAgents'](_0x53fe5d[_0xd941('0x57')][_0xd941('0x67')],_[_0xd941('0x66')](_0x53fe5d['body'],[_0xd941('0x67'),'id'])||{})['spread'](function(_0x563385){for(var _0x1f8489=0x0;_0x1f8489<_0x53fe5d[_0xd941('0x57')]['ids']['length'];_0x1f8489+=0x1){socket['emit'](_0xd941('0x8a'),{'UserId':_0x53fe5d['body'][_0xd941('0x67')][_0x1f8489],'CmListId':_0x53fe5d[_0xd941('0x4a')]['id']});}return _0x563385;});}})[_0xd941('0x29')](respondWithResult(_0x18acf6,null))[_0xd941('0x55')](handleError(_0x18acf6,null));};exports['removeAgents']=function(_0x3fd33f,_0x888c71,_0x4224b1){var _0x3a1bf4;return db[_0xd941('0x2e')][_0xd941('0x4c')]({'where':{'id':_0x3fd33f[_0xd941('0x4a')]['id']}})['then'](handleEntityNotFound(_0x888c71,null))[_0xd941('0x29')](function(_0x3af8de){if(_0x3af8de){return _0x3af8de[_0xd941('0x8b')](_0x3fd33f[_0xd941('0x32')][_0xd941('0x67')])[_0xd941('0x29')](function(_0x1728e5){if(_['isArray'](_0x3fd33f[_0xd941('0x32')][_0xd941('0x67')])){for(var _0x524cfd=0x0;_0x524cfd<_0x3fd33f['query']['ids'][_0xd941('0x4b')];_0x524cfd+=0x1){socket[_0xd941('0x8c')]('userCmList:remove',{'UserId':_0x3fd33f['query']['ids'][_0x524cfd],'CmListId':_0x3fd33f['params']['id']});}}else{socket[_0xd941('0x8c')](_0xd941('0x8d'),{'UserId':_0x3fd33f['query'][_0xd941('0x67')],'CmListId':_0x3fd33f[_0xd941('0x4a')]['id']});}});}})[_0xd941('0x29')](respondWithStatusCode(_0x888c71,null))[_0xd941('0x55')](handleError(_0x888c71,null));};exports[_0xd941('0x8e')]=function(_0x3c4b33,_0x2d4689,_0x98227d){var _0x53f49f={};var _0x3d20d9={};var _0x17fd13;var _0xf491e6;return db[_0xd941('0x2e')][_0xd941('0x7a')]({'where':{'id':_0x3c4b33[_0xd941('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d4689,null))[_0xd941('0x29')](function(_0x1decfb){if(_0x1decfb){_0x17fd13=_0x1decfb;_0x3d20d9[_0xd941('0x30')]=_[_0xd941('0x31')](db[_0xd941('0x8f')]['rawAttributes']);_0x3d20d9['query']=_[_0xd941('0x31')](_0x3c4b33[_0xd941('0x32')]);_0x3d20d9[_0xd941('0x33')]=_['intersection'](_0x3d20d9[_0xd941('0x30')],_0x3d20d9[_0xd941('0x32')]);_0x53f49f[_0xd941('0x36')]=_[_0xd941('0x34')](_0x3d20d9[_0xd941('0x30')],qs[_0xd941('0x35')](_0x3c4b33[_0xd941('0x32')]['fields']));_0x53f49f[_0xd941('0x36')]=_0x53f49f['attributes']['length']?_0x53f49f[_0xd941('0x36')]:_0x3d20d9['model'];_0x53f49f[_0xd941('0x39')]=qs[_0xd941('0x3a')](_0x3c4b33[_0xd941('0x32')][_0xd941('0x3a')]);_0x53f49f['where']=qs[_0xd941('0x33')](_['pick'](_0x3c4b33[_0xd941('0x32')],_0x3d20d9[_0xd941('0x33')]));if(_0x3c4b33['query']['filter']){_0x53f49f[_0xd941('0x3b')]=_['merge'](_0x53f49f['where'],{'$or':_[_0xd941('0x3e')](_0x53f49f['attributes'],function(_0x222fd1){var _0x58c9c3={};_0x58c9c3[_0x222fd1]={'$like':'%'+_0x3c4b33[_0xd941('0x32')][_0xd941('0x3c')]+'%'};return _0x58c9c3;})});}_0x53f49f=_['merge']({},_0x53f49f,_0x3c4b33[_0xd941('0x43')]);return _0x17fd13[_0xd941('0x8e')](_0x53f49f);}})[_0xd941('0x29')](function(_0x5773ea){if(_0x5773ea){_0xf491e6=_0x5773ea[_0xd941('0x4b')];if(!_0x3c4b33[_0xd941('0x32')]['hasOwnProperty'](_0xd941('0x38'))){_0x53f49f[_0xd941('0x20')]=qs[_0xd941('0x20')](_0x3c4b33[_0xd941('0x32')][_0xd941('0x20')]);_0x53f49f[_0xd941('0x1f')]=qs['offset'](_0x3c4b33[_0xd941('0x32')][_0xd941('0x1f')]);}return _0x17fd13['getAgents'](_0x53f49f);}})[_0xd941('0x29')](function(_0x45bdef){if(_0x45bdef){return _0x45bdef?{'count':_0xf491e6,'rows':_0x45bdef}:null;}})[_0xd941('0x29')](respondWithResult(_0x2d4689,null))[_0xd941('0x55')](handleError(_0x2d4689,null));}; \ No newline at end of file +var _0x5467=['push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','map','cf_%d','getContactsCsv','format','raw','isEmpty','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','text','number','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','status','json','count','offset','Content-Range','apply','update','then','get','UserProfileResource','destroy','sendStatus','error','name','send','index','CmList','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','type','merge','options','includeAll','rows','catch','params','include','create','body','user','role','Lists','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','order','findAll','addContacts','CmContact','tags','join','isArray'];(function(_0x1e0298,_0x306fdd){var _0xfaf98a=function(_0x454f5e){while(--_0x454f5e){_0x1e0298['push'](_0x1e0298['shift']());}};_0xfaf98a(++_0x306fdd);}(_0x5467,0x141));var _0x7546=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x5467[_0xa1e3e3];return _0xc980e9;};'use strict';var pdf=require(_0x7546('0x0'));var emlformat=require(_0x7546('0x1'));var rimraf=require(_0x7546('0x2'));var zipdir=require(_0x7546('0x3'));var jsonpatch=require(_0x7546('0x4'));var rp=require(_0x7546('0x5'));var moment=require(_0x7546('0x6'));var BPromise=require(_0x7546('0x7'));var Mustache=require(_0x7546('0x8'));var util=require(_0x7546('0x9'));var path=require(_0x7546('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7546('0xb'));var fs=require('fs');var _=require(_0x7546('0xc'));var squel=require(_0x7546('0xd'));var crypto=require(_0x7546('0xe'));var jsforce=require(_0x7546('0xf'));var deskjs=require(_0x7546('0x10'));var toCsv=require(_0x7546('0x11'));var querystring=require('querystring');var Papa=require(_0x7546('0x12'));var authService=require(_0x7546('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7546('0x14'))('api');var utils=require(_0x7546('0x15'));var config=require(_0x7546('0x16'));var db=require(_0x7546('0x17'))['db'];config[_0x7546('0x18')]=_[_0x7546('0x19')](config['redis'],{'host':_0x7546('0x1a'),'port':0x18eb});var socket=require(_0x7546('0x1b'))(new Redis(config[_0x7546('0x18')]));require(_0x7546('0x1c'))['register'](socket);function respondWithStatusCode(_0x2bd195,_0x895806){_0x895806=_0x895806||0xcc;return function(_0xd8db0e){if(_0xd8db0e){return _0x2bd195['sendStatus'](_0x895806);}return _0x2bd195[_0x7546('0x1d')](_0x895806)['end']();};}function respondWithResult(_0x264940,_0x42e93c){_0x42e93c=_0x42e93c||0xc8;return function(_0x390209){if(_0x390209){return _0x264940[_0x7546('0x1d')](_0x42e93c)[_0x7546('0x1e')](_0x390209);}};}function respondWithFilteredResult(_0x2c5419,_0x2febc0){return function(_0x35e229){if(_0x35e229){var _0x1c1121=_0x35e229[_0x7546('0x1f')],_0x3a219b=_0x2febc0['offset'],_0x354feb=_0x2febc0[_0x7546('0x20')]+_0x2febc0['limit'],_0x4469a3;if(_0x354feb>=_0x1c1121){_0x354feb=_0x1c1121;_0x4469a3=0xc8;}else{_0x4469a3=0xce;}_0x2c5419['status'](_0x4469a3);return _0x2c5419['set'](_0x7546('0x21'),_0x3a219b+'-'+_0x354feb+'/'+_0x1c1121)[_0x7546('0x1e')](_0x35e229);}return null;};}function patchUpdates(_0x2e9ffd){return function(_0x5ef518){try{jsonpatch[_0x7546('0x22')](_0x5ef518,_0x2e9ffd,!![]);}catch(_0x4f10d1){return BPromise['reject'](_0x4f10d1);}return _0x5ef518['save']();};}function saveUpdates(_0x4cd81e,_0xcb156d){return function(_0x73c00a){if(_0x73c00a){return _0x73c00a[_0x7546('0x23')](_0x4cd81e)[_0x7546('0x24')](function(_0x218e71){return _0x218e71;});}return null;};}function removeEntity(_0x2cc711,_0x36b5bf){return function(_0x315fc2){if(_0x315fc2){return _0x315fc2['destroy']()['then'](function(){var _0x188967=_0x315fc2[_0x7546('0x25')]({'plain':!![]});var _0x435fa9='Lists';return db[_0x7546('0x26')][_0x7546('0x27')]({'where':{'type':_0x435fa9,'resourceId':_0x188967['id']}})[_0x7546('0x24')](function(){return _0x315fc2;});})[_0x7546('0x24')](function(){_0x2cc711[_0x7546('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a091,_0x429544){return function(_0x52ac04){if(!_0x52ac04){_0x31a091[_0x7546('0x28')](0x194);}return _0x52ac04;};}function handleError(_0x296e45,_0x34f28){_0x34f28=_0x34f28||0x1f4;return function(_0x4aa25a){logger[_0x7546('0x29')](_0x4aa25a['stack']);if(_0x4aa25a[_0x7546('0x2a')]){delete _0x4aa25a['name'];}_0x296e45[_0x7546('0x1d')](_0x34f28)[_0x7546('0x2b')](_0x4aa25a);};}exports[_0x7546('0x2c')]=function(_0x318409,_0x4f457d){var _0xdda512={},_0x9ad4f1={},_0x4ee4d4={'count':0x0,'rows':[]};var _0x385504=db[_0x7546('0x2d')][_0x7546('0x2e')];_0x9ad4f1[_0x7546('0x2f')]=_[_0x7546('0x30')](_0x385504);_0x9ad4f1['query']=_['keys'](_0x318409[_0x7546('0x31')]);_0x9ad4f1[_0x7546('0x32')]=_[_0x7546('0x33')](_0x9ad4f1[_0x7546('0x2f')],_0x9ad4f1[_0x7546('0x31')]);_0xdda512[_0x7546('0x34')]=_[_0x7546('0x33')](_0x9ad4f1[_0x7546('0x2f')],qs[_0x7546('0x35')](_0x318409[_0x7546('0x31')][_0x7546('0x35')]));_0xdda512[_0x7546('0x34')]=_0xdda512['attributes'][_0x7546('0x36')]?_0xdda512['attributes']:_0x9ad4f1[_0x7546('0x2f')];if(!_0x318409[_0x7546('0x31')]['hasOwnProperty'](_0x7546('0x37'))){_0xdda512[_0x7546('0x38')]=qs[_0x7546('0x38')](_0x318409['query'][_0x7546('0x38')]);_0xdda512['offset']=qs[_0x7546('0x20')](_0x318409[_0x7546('0x31')]['offset']);}_0xdda512['order']=qs[_0x7546('0x39')](_0x318409[_0x7546('0x31')][_0x7546('0x39')]);_0xdda512[_0x7546('0x3a')]=qs[_0x7546('0x32')](_[_0x7546('0x3b')](_0x318409['query'],_0x9ad4f1[_0x7546('0x32')]));if(_0x318409[_0x7546('0x31')][_0x7546('0x3c')]){_0xdda512[_0x7546('0x3a')]=_['merge'](_0xdda512['where'],{'$or':_['map'](_0x385504,function(_0x36b1a3){if(_0x36b1a3[_0x7546('0x3d')]['key']!=='VIRTUAL'){var _0xb5da93={};_0xb5da93[_0x36b1a3['field']]={'$like':'%'+_0x318409[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0xb5da93;}})});}_0xdda512=_[_0x7546('0x3e')]({},_0xdda512,_0x318409[_0x7546('0x3f')]);var _0x2f9659={'where':_0xdda512[_0x7546('0x3a')]};return db[_0x7546('0x2d')]['count'](_0x2f9659)[_0x7546('0x24')](function(_0xad7c29){_0x4ee4d4[_0x7546('0x1f')]=_0xad7c29;if(_0x318409[_0x7546('0x31')][_0x7546('0x40')]){_0xdda512['include']=[{'all':!![]}];}return db[_0x7546('0x2d')]['findAll'](_0xdda512);})[_0x7546('0x24')](function(_0x590721){_0x4ee4d4[_0x7546('0x41')]=_0x590721;return _0x4ee4d4;})['then'](respondWithFilteredResult(_0x4f457d,_0xdda512))[_0x7546('0x42')](handleError(_0x4f457d,null));};exports['show']=function(_0x2755ca,_0x2805f5){var _0x36f4db={'raw':![],'where':{'id':_0x2755ca[_0x7546('0x43')]['id']}},_0x5da672={};_0x5da672[_0x7546('0x2f')]=_[_0x7546('0x30')](db['CmList'][_0x7546('0x2e')]);_0x5da672['query']=_[_0x7546('0x30')](_0x2755ca[_0x7546('0x31')]);_0x5da672[_0x7546('0x32')]=_[_0x7546('0x33')](_0x5da672[_0x7546('0x2f')],_0x5da672[_0x7546('0x31')]);_0x36f4db['attributes']=_[_0x7546('0x33')](_0x5da672[_0x7546('0x2f')],qs['fields'](_0x2755ca['query'][_0x7546('0x35')]));_0x36f4db[_0x7546('0x34')]=_0x36f4db[_0x7546('0x34')]['length']?_0x36f4db[_0x7546('0x34')]:_0x5da672[_0x7546('0x2f')];if(_0x2755ca[_0x7546('0x31')]['includeAll']){_0x36f4db[_0x7546('0x44')]=[{'all':!![]}];}_0x36f4db=_['merge']({},_0x36f4db,_0x2755ca[_0x7546('0x3f')]);return db[_0x7546('0x2d')]['find'](_0x36f4db)[_0x7546('0x24')](handleEntityNotFound(_0x2805f5,null))['then'](respondWithResult(_0x2805f5,null))['catch'](handleError(_0x2805f5,null));};exports[_0x7546('0x45')]=function(_0x4cb980,_0x5433a6){return db[_0x7546('0x2d')][_0x7546('0x45')](_0x4cb980[_0x7546('0x46')],{})[_0x7546('0x24')](function(_0x2ef8b1){var _0x5aa076=_0x4cb980[_0x7546('0x47')][_0x7546('0x25')]({'plain':!![]});if(!_0x5aa076)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aa076[_0x7546('0x48')]==='user'){var _0x544497=_0x2ef8b1[_0x7546('0x25')]({'plain':!![]});var _0x3a3cb3=_0x7546('0x49');return db['UserProfileSection'][_0x7546('0x4a')]({'where':{'name':_0x3a3cb3,'userProfileId':_0x5aa076['userProfileId']},'raw':!![]})['then'](function(_0xf3421a){if(_0xf3421a&&_0xf3421a['autoAssociation']===0x0){return db[_0x7546('0x26')][_0x7546('0x45')]({'name':_0x544497[_0x7546('0x2a')],'resourceId':_0x544497['id'],'type':_0xf3421a[_0x7546('0x2a')],'sectionId':_0xf3421a['id']},{})['then'](function(){return _0x2ef8b1;});}else{return _0x2ef8b1;}})[_0x7546('0x42')](function(_0x42a527){logger[_0x7546('0x29')](_0x7546('0x4b'),_0x42a527);throw _0x42a527;});}return _0x2ef8b1;})[_0x7546('0x24')](respondWithResult(_0x5433a6,0xc9))['catch'](handleError(_0x5433a6,null));};exports['update']=function(_0x4b4103,_0x2c998b){if(_0x4b4103[_0x7546('0x46')]['id']){delete _0x4b4103[_0x7546('0x46')]['id'];}return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x4b4103['params']['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x2c998b,null))[_0x7546('0x24')](saveUpdates(_0x4b4103[_0x7546('0x46')],null))[_0x7546('0x24')](respondWithResult(_0x2c998b,null))[_0x7546('0x42')](handleError(_0x2c998b,null));};exports[_0x7546('0x27')]=function(_0x476db1,_0x2b1a2f){return db[_0x7546('0x2d')]['find']({'where':{'id':_0x476db1[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x2b1a2f,null))['then'](removeEntity(_0x2b1a2f,null))['catch'](handleError(_0x2b1a2f,null));};exports[_0x7546('0x4c')]=function(_0x53d23b,_0x43a49b){return db[_0x7546('0x2d')]['describe']()[_0x7546('0x24')](respondWithResult(_0x43a49b,null))[_0x7546('0x42')](handleError(_0x43a49b,null));};exports[_0x7546('0x4d')]=function(_0x31f473,_0x284c60,_0x46a85b){if(_0x31f473['body']['id']){delete _0x31f473[_0x7546('0x46')]['id'];}return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x31f473[_0x7546('0x43')]['id']}})['then'](handleEntityNotFound(_0x284c60,null))[_0x7546('0x24')](function(_0x3190ba){if(_0x3190ba){_0x31f473[_0x7546('0x46')][_0x7546('0x4e')]=_0x3190ba['id'];return db[_0x7546('0x4f')][_0x7546('0x45')](_0x31f473[_0x7546('0x46')]);}})[_0x7546('0x24')](respondWithResult(_0x284c60,null))[_0x7546('0x42')](handleError(_0x284c60,null));};exports[_0x7546('0x50')]=function(_0x22d614,_0x470bfb,_0x597e42){var _0xfbb246={'raw':![],'where':{}};var _0x3c6ca2={};var _0x4b4936={'count':0x0,'rows':[]};return db[_0x7546('0x2d')][_0x7546('0x51')]({'where':{'id':_0x22d614[_0x7546('0x43')]['id']}})['then'](handleEntityNotFound(_0x470bfb,null))[_0x7546('0x24')](function(_0x1bbe67){if(_0x1bbe67){_0x3c6ca2['model']=_[_0x7546('0x30')](db['Disposition']['rawAttributes']);_0x3c6ca2[_0x7546('0x31')]=_[_0x7546('0x30')](_0x22d614[_0x7546('0x31')]);_0x3c6ca2[_0x7546('0x32')]=_[_0x7546('0x33')](_0x3c6ca2[_0x7546('0x2f')],_0x3c6ca2[_0x7546('0x31')]);_0xfbb246[_0x7546('0x34')]=_[_0x7546('0x33')](_0x3c6ca2['model'],qs[_0x7546('0x35')](_0x22d614[_0x7546('0x31')][_0x7546('0x35')]));_0xfbb246[_0x7546('0x34')]=_0xfbb246[_0x7546('0x34')]['length']?_0xfbb246[_0x7546('0x34')]:_0x3c6ca2[_0x7546('0x2f')];if(!_0x22d614[_0x7546('0x31')][_0x7546('0x52')](_0x7546('0x37'))){_0xfbb246[_0x7546('0x38')]=qs[_0x7546('0x38')](_0x22d614[_0x7546('0x31')][_0x7546('0x38')]);_0xfbb246['offset']=qs['offset'](_0x22d614[_0x7546('0x31')][_0x7546('0x20')]);}_0xfbb246[_0x7546('0x53')]=qs[_0x7546('0x39')](_0x22d614[_0x7546('0x31')][_0x7546('0x39')]);_0xfbb246[_0x7546('0x3a')]=qs['filters'](_[_0x7546('0x3b')](_0x22d614['query'],_0x3c6ca2[_0x7546('0x32')]));_0xfbb246[_0x7546('0x3a')][_0x7546('0x4e')]=_0x1bbe67['id'];if(_0x22d614[_0x7546('0x31')][_0x7546('0x3c')]){_0xfbb246['where']=_[_0x7546('0x3e')](_0xfbb246[_0x7546('0x3a')],{'$or':_['map'](_0xfbb246[_0x7546('0x34')],function(_0x13d089){var _0x2d1eee={};_0x2d1eee[_0x13d089]={'$like':'%'+_0x22d614[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0x2d1eee;})});}_0xfbb246=_[_0x7546('0x3e')]({},_0xfbb246,_0x22d614['options']);return db[_0x7546('0x4f')][_0x7546('0x1f')]({'where':_0xfbb246[_0x7546('0x3a')]})['then'](function(_0x5327e9){_0x4b4936[_0x7546('0x1f')]=_0x5327e9;if(_0x22d614['query'][_0x7546('0x40')]){_0xfbb246['include']=[{'all':!![]}];}return db['Disposition'][_0x7546('0x54')](_0xfbb246);})[_0x7546('0x24')](function(_0x432599){_0x4b4936[_0x7546('0x41')]=_0x432599;return _0x4b4936;});}})[_0x7546('0x24')](respondWithFilteredResult(_0x470bfb,_0xfbb246))[_0x7546('0x42')](handleError(_0x470bfb,null));};exports['removeDispositions']=function(_0x5cd379,_0x3470ee,_0x11c037){var _0x5c1963;return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x5cd379[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x3470ee,null))[_0x7546('0x24')](function(_0x471a7a){if(_0x471a7a){return _0x471a7a['removeDispositions'](_0x5cd379[_0x7546('0x31')]['ids']);}})[_0x7546('0x24')](respondWithStatusCode(_0x3470ee,null))[_0x7546('0x42')](handleError(_0x3470ee,null));};exports[_0x7546('0x55')]=function(_0x38ca32,_0x129e13,_0x3f14a2){return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x38ca32[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x129e13,null))['then'](function(_0x39b53d){if(_0x39b53d){var _0x4875db=[];var _0x2dc40a={'success':[],'errors':[]};return db[_0x7546('0x56')]['describe']()[_0x7546('0x24')](function(_0x30d555){if(_0x38ca32[_0x7546('0x46')][_0x7546('0x57')]&&_['isArray'](_0x38ca32['body'][_0x7546('0x57')])){if(_0x38ca32[_0x7546('0x46')]['tags'][_0x7546('0x36')]){_0x38ca32['body'][_0x7546('0x57')]=_0x38ca32[_0x7546('0x46')][_0x7546('0x57')][_0x7546('0x58')](';')+';';}else{_0x38ca32[_0x7546('0x46')][_0x7546('0x57')]=null;}}else{_0x38ca32['body']['tags']=null;}if(_0x38ca32[_0x7546('0x46')]&&_[_0x7546('0x59')](_0x38ca32[_0x7546('0x46')])){for(var _0x2d01b5=0x0;_0x2d01b5<_0x38ca32[_0x7546('0x46')]['length'];_0x2d01b5+=0x1){_0x38ca32[_0x7546('0x46')][_0x2d01b5][_0x7546('0x4e')]=_0x38ca32[_0x7546('0x43')]['id'];_0x4875db[_0x7546('0x5a')](_0x38ca32[_0x7546('0x46')][_0x2d01b5]);}return BPromise['each'](_0x4875db,function(_0x5b9309){return db['CmContact'][_0x7546('0x45')](_[_0x7546('0x5b')](_0x5b9309,[_0x7546('0x5c'),'id'])||{},{'fields':_['keys'](_0x30d555),'raw':!![]})[_0x7546('0x24')](function(_0x5287d4){_0x2dc40a[_0x7546('0x5d')][_0x7546('0x5a')](_0x5287d4[_0x7546('0x5e')]);})[_0x7546('0x42')](function(_0x246b00){_0x2dc40a[_0x7546('0x5f')][_0x7546('0x5a')]({'data':_0x5b9309,'error':_0x246b00[_0x7546('0x60')]});});})[_0x7546('0x24')](function(_0x3e0404){return _0x2dc40a;})[_0x7546('0x42')](function(_0x33a7a6){return _0x33a7a6;});}else{_0x129e13[_0x7546('0x1d')](0x190)[_0x7546('0x1e')]({'message':_0x7546('0x61')});}});}})['then'](respondWithResult(_0x129e13,null))['catch'](handleError(_0x129e13,null));};exports[_0x7546('0x62')]=function(_0xbd1cbb,_0xd11ff6,_0xf31a91){var _0x48e502;return db['CmList'][_0x7546('0x4a')]({'where':{'id':_0xbd1cbb[_0x7546('0x43')]['id']},'include':[{'model':db[_0x7546('0x63')],'as':_0x7546('0x64')}]})[_0x7546('0x24')](handleEntityNotFound(_0xd11ff6,null))[_0x7546('0x24')](function(_0xddfa87){if(_0xddfa87){_0x48e502=_0xddfa87;return db[_0x7546('0x56')][_0x7546('0x2e')];}})['then'](function(_0x8b166d){if(_0x8b166d){var _0x177a87={};var _0x2a2210={};_0x2a2210[_0x7546('0x2f')]=_[_0x7546('0x65')](_[_0x7546('0x30')](_0x8b166d),_[_0x7546('0x66')](_0x48e502[_0x7546('0x64')],function(_0x46c5f7){return util['format'](_0x7546('0x67'),_0x46c5f7['id']);}));_0x2a2210[_0x7546('0x31')]=_[_0x7546('0x30')](_0xbd1cbb['query']);_0x2a2210['filters']=_[_0x7546('0x33')](_0x2a2210[_0x7546('0x2f')],_0x2a2210['query']);_0x177a87[_0x7546('0x34')]=_[_0x7546('0x33')](_0x2a2210[_0x7546('0x2f')],qs[_0x7546('0x35')](_0xbd1cbb[_0x7546('0x31')]['fields']));_0x177a87[_0x7546('0x34')]=_0x177a87[_0x7546('0x34')][_0x7546('0x36')]?_0x177a87[_0x7546('0x34')]:_0x2a2210['model'];if(!_0xbd1cbb['query'][_0x7546('0x52')](_0x7546('0x37'))){_0x177a87['limit']=qs[_0x7546('0x38')](_0xbd1cbb['query']['limit']);_0x177a87[_0x7546('0x20')]=qs['offset'](_0xbd1cbb['query']['offset']);}_0x177a87[_0x7546('0x53')]=qs['sort'](_0xbd1cbb[_0x7546('0x31')][_0x7546('0x39')]);_0x177a87[_0x7546('0x3a')]=qs['filters'](_[_0x7546('0x3b')](_0xbd1cbb[_0x7546('0x31')],_0x2a2210[_0x7546('0x32')]));_0x177a87['raw']=!![];if(_0xbd1cbb['query'][_0x7546('0x3c')]){_0x177a87['where']=_['merge'](_0x177a87['where'],{'$or':_[_0x7546('0x66')](_0x177a87[_0x7546('0x34')],function(_0x54c3e1){var _0x3df664={};_0x3df664[_0x54c3e1]={'$like':'%'+_0xbd1cbb[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0x3df664;})});}_0x177a87=_[_0x7546('0x3e')]({},_0x177a87,_0xbd1cbb[_0x7546('0x3f')]);return _0x48e502['getContacts'](_0x177a87);}})[_0x7546('0x24')](respondWithResult(_0xd11ff6,null))['catch'](handleError(_0xd11ff6,null));};exports[_0x7546('0x68')]=function(_0x202ca4,_0x2f6448,_0x479ff7){var _0xa3ae15;return db['CmList']['find']({'where':{'id':_0x202ca4[_0x7546('0x43')]['id']},'include':[{'model':db[_0x7546('0x63')],'as':_0x7546('0x64')}]})[_0x7546('0x24')](handleEntityNotFound(_0x2f6448,null))['then'](function(_0xfe2697){if(_0xfe2697){_0xa3ae15=_0xfe2697;return db[_0x7546('0x56')][_0x7546('0x2e')];}})[_0x7546('0x24')](function(_0x371a4b){if(_0x371a4b){var _0x4552db={};var _0x2e0378={};_0x2e0378[_0x7546('0x2f')]=_['concat'](_[_0x7546('0x30')](_0x371a4b),_[_0x7546('0x66')](_0xa3ae15[_0x7546('0x64')],function(_0xdbcbbe){return util[_0x7546('0x69')](_0x7546('0x67'),_0xdbcbbe['id']);}));_0x2e0378[_0x7546('0x31')]=_[_0x7546('0x30')](_0x202ca4[_0x7546('0x31')]);_0x2e0378[_0x7546('0x32')]=_[_0x7546('0x33')](_0x2e0378[_0x7546('0x2f')],_0x2e0378['query']);_0x4552db['attributes']=_['intersection'](_0x2e0378[_0x7546('0x2f')],qs[_0x7546('0x35')](_0x202ca4['query'][_0x7546('0x35')]));_0x4552db[_0x7546('0x34')]=_0x4552db[_0x7546('0x34')][_0x7546('0x36')]?_0x4552db[_0x7546('0x34')]:_0x2e0378[_0x7546('0x2f')];if(!_0x202ca4[_0x7546('0x31')][_0x7546('0x52')](_0x7546('0x37'))){_0x4552db[_0x7546('0x38')]=qs['limit'](_0x202ca4[_0x7546('0x31')]['limit']);_0x4552db['offset']=qs[_0x7546('0x20')](_0x202ca4[_0x7546('0x31')]['offset']);}_0x4552db[_0x7546('0x53')]=qs['sort'](_0x202ca4[_0x7546('0x31')]['sort']);_0x4552db[_0x7546('0x3a')]=qs[_0x7546('0x32')](_[_0x7546('0x3b')](_0x202ca4[_0x7546('0x31')],_0x2e0378['filters']));_0x4552db[_0x7546('0x6a')]=!![];if(_0x202ca4[_0x7546('0x31')][_0x7546('0x3c')]){_0x4552db['where']=_[_0x7546('0x3e')](_0x4552db['where'],{'$or':_[_0x7546('0x66')](_0x4552db['attributes'],function(_0x895a7b){var _0x2982f9={};_0x2982f9[_0x895a7b]={'$like':'%'+_0x202ca4[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0x2982f9;})});}_0x4552db=_[_0x7546('0x3e')]({},_0x4552db,_0x202ca4[_0x7546('0x3f')]);return _0xa3ae15['getContacts'](_0x4552db);}})['then'](function(_0x27da69){if(!_[_0x7546('0x6b')](_0x27da69)){var _0x4598df=toCsv(_0x27da69);var _0x553532=Date['now']();fs[_0x7546('0x6c')](util[_0x7546('0x69')]('/tmp/list_%d_%s.csv',_0xa3ae15['id'],_0x553532),_0x4598df);_0x2f6448[_0x7546('0x6d')](_0x7546('0x6e'),'attachment;\x20filename='+util[_0x7546('0x69')](_0x7546('0x6f'),_0xa3ae15['id'],_0x553532));_0x2f6448[_0x7546('0x6d')](_0x7546('0x70'),_0x7546('0x71'));return _0x2f6448[_0x7546('0x72')](util[_0x7546('0x69')](_0x7546('0x73'),_0xa3ae15['id'],_0x553532));}else{return _0x2f6448[_0x7546('0x28')](0xcc);}})[_0x7546('0x42')](handleError(_0x2f6448,null));};exports['addCustomField']=function(_0x3052f9,_0x17f894,_0x566530){var _0x5c047e;delete _0x3052f9['body']['id'];return db['CmList'][_0x7546('0x51')]({'where':{'id':_0x3052f9[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x17f894,null))[_0x7546('0x24')](function(_0xa61ccc){if(_0xa61ccc){return db[_0x7546('0x74')][_0x7546('0x75')](function(_0x245b77){return db[_0x7546('0x63')]['create'](_0x3052f9[_0x7546('0x46')],{'transaction':_0x245b77})[_0x7546('0x24')](function(_0xef0e9){_0x5c047e=_0xef0e9;return _0xa61ccc[_0x7546('0x76')](_0xef0e9,{'transaction':_0x245b77});})['then'](function(){var _0x4a0c96={'type':db[_0x7546('0x77')]['TEXT'],'transaction':_0x245b77};switch(_0x3052f9[_0x7546('0x46')][_0x7546('0x3d')]){case _0x7546('0x78'):_0x4a0c96[_0x7546('0x3d')]=db['Sequelize']['TEXT'];break;case _0x7546('0x79'):_0x4a0c96[_0x7546('0x3d')]=db[_0x7546('0x77')]['INTEGER'];break;case'switch':_0x4a0c96['type']=db[_0x7546('0x77')][_0x7546('0x7a')];_0x4a0c96['defaultValue']=![];break;default:}return db[_0x7546('0x74')][_0x7546('0x7b')][_0x7546('0x7c')](_0x7546('0x7d'),util[_0x7546('0x69')](_0x7546('0x7e'),_0x5c047e['id']),_0x4a0c96);})['then'](function(){return _0x5c047e;});});}})[_0x7546('0x24')](respondWithResult(_0x17f894,null))[_0x7546('0x42')](handleError(_0x17f894,null));};exports[_0x7546('0x7f')]=function(_0x2fc666,_0x369f8e,_0xf16562){var _0x23669f={};var _0x43493b={};var _0x1b83bf;var _0x35fdd6;return db['CmList']['findOne']({'where':{'id':_0x2fc666[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x369f8e,null))['then'](function(_0x2ac51e){if(_0x2ac51e){_0x1b83bf=_0x2ac51e;_0x43493b[_0x7546('0x2f')]=_['keys'](db[_0x7546('0x63')][_0x7546('0x2e')]);_0x43493b[_0x7546('0x31')]=_[_0x7546('0x30')](_0x2fc666[_0x7546('0x31')]);_0x43493b[_0x7546('0x32')]=_['intersection'](_0x43493b[_0x7546('0x2f')],_0x43493b[_0x7546('0x31')]);_0x23669f['attributes']=_[_0x7546('0x33')](_0x43493b['model'],qs[_0x7546('0x35')](_0x2fc666[_0x7546('0x31')]['fields']));_0x23669f['attributes']=_0x23669f['attributes'][_0x7546('0x36')]?_0x23669f[_0x7546('0x34')]:_0x43493b[_0x7546('0x2f')];_0x23669f['order']=qs[_0x7546('0x39')](_0x2fc666[_0x7546('0x31')][_0x7546('0x39')]);_0x23669f['where']=qs['filters'](_[_0x7546('0x3b')](_0x2fc666[_0x7546('0x31')],_0x43493b[_0x7546('0x32')]));_0x23669f[_0x7546('0x3a')]=_[_0x7546('0x3e')](_0x23669f[_0x7546('0x3a')],{'$or':[{'ListId':_0x2ac51e['id']},{'ListId':null}]});if(_0x2fc666[_0x7546('0x31')][_0x7546('0x3c')]){_0x23669f[_0x7546('0x3a')]=_[_0x7546('0x3e')](_0x23669f[_0x7546('0x3a')],{'$or':_[_0x7546('0x66')](_0x23669f[_0x7546('0x34')],function(_0x28fe72){var _0x1617c8={};_0x1617c8[_0x28fe72]={'$like':'%'+_0x2fc666[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0x1617c8;})});}_0x23669f=_[_0x7546('0x3e')]({},_0x23669f,_0x2fc666['options']);return db[_0x7546('0x63')][_0x7546('0x80')](_0x23669f);}})['then'](respondWithResult(_0x369f8e,null))[_0x7546('0x42')](handleError(_0x369f8e,null));};exports[_0x7546('0x81')]=function(_0x297bb5,_0x41e881,_0x54515b){return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x297bb5[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x41e881,null))[_0x7546('0x24')](function(_0x56154c){if(_0x56154c){return _0x56154c['addAgents'](_0x297bb5[_0x7546('0x46')][_0x7546('0x5c')],_[_0x7546('0x5b')](_0x297bb5['body'],['ids','id'])||{})[_0x7546('0x82')](function(_0x5c2c11){for(var _0x228649=0x0;_0x228649<_0x297bb5[_0x7546('0x46')][_0x7546('0x5c')]['length'];_0x228649+=0x1){socket['emit'](_0x7546('0x83'),{'UserId':_0x297bb5[_0x7546('0x46')]['ids'][_0x228649],'CmListId':_0x297bb5['params']['id']});}return _0x5c2c11;});}})['then'](respondWithResult(_0x41e881,null))[_0x7546('0x42')](handleError(_0x41e881,null));};exports[_0x7546('0x84')]=function(_0x3d0d93,_0x11ed83,_0xa495e6){var _0xbba0be;return db[_0x7546('0x2d')][_0x7546('0x4a')]({'where':{'id':_0x3d0d93[_0x7546('0x43')]['id']}})['then'](handleEntityNotFound(_0x11ed83,null))['then'](function(_0x9065c6){if(_0x9065c6){return _0x9065c6[_0x7546('0x84')](_0x3d0d93[_0x7546('0x31')][_0x7546('0x5c')])[_0x7546('0x24')](function(_0xfeea21){if(_['isArray'](_0x3d0d93[_0x7546('0x31')][_0x7546('0x5c')])){for(var _0x1807c9=0x0;_0x1807c9<_0x3d0d93[_0x7546('0x31')][_0x7546('0x5c')][_0x7546('0x36')];_0x1807c9+=0x1){socket['emit'](_0x7546('0x85'),{'UserId':_0x3d0d93['query'][_0x7546('0x5c')][_0x1807c9],'CmListId':_0x3d0d93[_0x7546('0x43')]['id']});}}else{socket[_0x7546('0x86')](_0x7546('0x85'),{'UserId':_0x3d0d93['query'][_0x7546('0x5c')],'CmListId':_0x3d0d93[_0x7546('0x43')]['id']});}});}})[_0x7546('0x24')](respondWithStatusCode(_0x11ed83,null))[_0x7546('0x42')](handleError(_0x11ed83,null));};exports[_0x7546('0x87')]=function(_0x34b4f3,_0x1686b5,_0x1c2f51){var _0x19187b={};var _0x358cb2={};var _0x375e56;var _0x5a681d;return db[_0x7546('0x2d')][_0x7546('0x51')]({'where':{'id':_0x34b4f3[_0x7546('0x43')]['id']}})[_0x7546('0x24')](handleEntityNotFound(_0x1686b5,null))[_0x7546('0x24')](function(_0x213970){if(_0x213970){_0x375e56=_0x213970;_0x358cb2['model']=_[_0x7546('0x30')](db[_0x7546('0x88')][_0x7546('0x2e')]);_0x358cb2['query']=_[_0x7546('0x30')](_0x34b4f3[_0x7546('0x31')]);_0x358cb2[_0x7546('0x32')]=_[_0x7546('0x33')](_0x358cb2['model'],_0x358cb2[_0x7546('0x31')]);_0x19187b[_0x7546('0x34')]=_[_0x7546('0x33')](_0x358cb2[_0x7546('0x2f')],qs[_0x7546('0x35')](_0x34b4f3[_0x7546('0x31')][_0x7546('0x35')]));_0x19187b[_0x7546('0x34')]=_0x19187b[_0x7546('0x34')][_0x7546('0x36')]?_0x19187b[_0x7546('0x34')]:_0x358cb2[_0x7546('0x2f')];_0x19187b['order']=qs[_0x7546('0x39')](_0x34b4f3[_0x7546('0x31')][_0x7546('0x39')]);_0x19187b[_0x7546('0x3a')]=qs[_0x7546('0x32')](_[_0x7546('0x3b')](_0x34b4f3[_0x7546('0x31')],_0x358cb2[_0x7546('0x32')]));if(_0x34b4f3[_0x7546('0x31')][_0x7546('0x3c')]){_0x19187b[_0x7546('0x3a')]=_[_0x7546('0x3e')](_0x19187b[_0x7546('0x3a')],{'$or':_[_0x7546('0x66')](_0x19187b[_0x7546('0x34')],function(_0x30b470){var _0x189d96={};_0x189d96[_0x30b470]={'$like':'%'+_0x34b4f3[_0x7546('0x31')][_0x7546('0x3c')]+'%'};return _0x189d96;})});}_0x19187b=_[_0x7546('0x3e')]({},_0x19187b,_0x34b4f3[_0x7546('0x3f')]);return _0x375e56[_0x7546('0x87')](_0x19187b);}})[_0x7546('0x24')](function(_0x13982d){if(_0x13982d){_0x5a681d=_0x13982d[_0x7546('0x36')];if(!_0x34b4f3[_0x7546('0x31')][_0x7546('0x52')]('nolimit')){_0x19187b[_0x7546('0x38')]=qs[_0x7546('0x38')](_0x34b4f3[_0x7546('0x31')][_0x7546('0x38')]);_0x19187b['offset']=qs['offset'](_0x34b4f3[_0x7546('0x31')]['offset']);}return _0x375e56[_0x7546('0x87')](_0x19187b);}})['then'](function(_0x2513a6){if(_0x2513a6){return _0x2513a6?{'count':_0x5a681d,'rows':_0x2513a6}:null;}})[_0x7546('0x24')](respondWithResult(_0x1686b5,null))[_0x7546('0x42')](handleError(_0x1686b5,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c63cd68..4f5057c 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 _0xa20a=['CmList','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4d7e74,_0x33c229){var _0x1d7383=function(_0x263970){while(--_0x263970){_0x4d7e74['push'](_0x4d7e74['shift']());}};_0x1d7383(++_0x33c229);}(_0xa20a,0x184));var _0xaa20=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa20a[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require(_0xaa20('0x0'));var CmList=require(_0xaa20('0x1'))['db'][_0xaa20('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xaa20('0x3')](0x0);var events={'afterCreate':_0xaa20('0x4'),'afterUpdate':'update','afterDestroy':_0xaa20('0x5')};function emitEvent(_0x2992f4){return function(_0x538639,_0x58336d,_0x144394){CmListEvents[_0xaa20('0x6')](_0x2992f4+':'+_0x538639['id'],_0x538639);CmListEvents[_0xaa20('0x6')](_0x2992f4,_0x538639);_0x144394(null);};}for(var e in events){if(events[_0xaa20('0x7')](e)){var event=events[e];CmList[_0xaa20('0x8')](e,emitEvent(event));}}module[_0xaa20('0x9')]=CmListEvents; \ No newline at end of file +var _0x7be1=['save','update','remove','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners'];(function(_0x2bbdc4,_0x2cb88e){var _0x482d0c=function(_0x4da8ce){while(--_0x4da8ce){_0x2bbdc4['push'](_0x2bbdc4['shift']());}};_0x482d0c(++_0x2cb88e);}(_0x7be1,0xec));var _0x17be=function(_0x139eb2,_0x3d7e18){_0x139eb2=_0x139eb2-0x0;var _0x2a5657=_0x7be1[_0x139eb2];return _0x2a5657;};'use strict';var EventEmitter=require(_0x17be('0x0'));var CmList=require(_0x17be('0x1'))['db'][_0x17be('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x17be('0x3')](0x0);var events={'afterCreate':_0x17be('0x4'),'afterUpdate':_0x17be('0x5'),'afterDestroy':_0x17be('0x6')};function emitEvent(_0x3631c4){return function(_0x483818,_0x48ff68,_0x203f0a){CmListEvents[_0x17be('0x7')](_0x3631c4+':'+_0x483818['id'],_0x483818);CmListEvents['emit'](_0x3631c4,_0x483818);_0x203f0a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x17be('0x8')](e,emitEvent(event));}}module[_0x17be('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e064c57..dc7e424 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 _0xda94=['CmList','cm_lists','lodash','util','api','moment','request-promise','./cmList.attributes','define'];(function(_0x4242a3,_0x1c7510){var _0x5766bb=function(_0x39d5e7){while(--_0x39d5e7){_0x4242a3['push'](_0x4242a3['shift']());}};_0x5766bb(++_0x1c7510);}(_0xda94,0x1f1));var _0x4da9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xda94[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4da9('0x0'));var util=require(_0x4da9('0x1'));var logger=require('../../config/logger')(_0x4da9('0x2'));var moment=require(_0x4da9('0x3'));var BPromise=require('bluebird');var rp=require(_0x4da9('0x4'));var attributes=require(_0x4da9('0x5'));module['exports']=function(_0x284208,_0x4e8d0f){return _0x284208[_0x4da9('0x6')](_0x4da9('0x7'),attributes,{'tableName':_0x4da9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb1=['bluebird','./cmList.attributes','exports','define','CmList','lodash','util','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5eb1,0x1e2));var _0x15eb=function(_0x274f14,_0x27dd7f){_0x274f14=_0x274f14-0x0;var _0x13b97e=_0x5eb1[_0x274f14];return _0x13b97e;};'use strict';var _=require(_0x15eb('0x0'));var util=require(_0x15eb('0x1'));var logger=require('../../config/logger')(_0x15eb('0x2'));var moment=require(_0x15eb('0x3'));var BPromise=require(_0x15eb('0x4'));var rp=require('request-promise');var attributes=require(_0x15eb('0x5'));module[_0x15eb('0x6')]=function(_0x413a4b,_0x59d854){return _0x413a4b[_0x15eb('0x7')](_0x15eb('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 662c712..2586eae 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 _0x6312=['request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register'];(function(_0x3238bd,_0x4ea3ef){var _0xdc7a7e=function(_0x275fbc){while(--_0x275fbc){_0x3238bd['push'](_0x3238bd['shift']());}};_0xdc7a7e(++_0x4ea3ef);}(_0x6312,0x12e));var _0x2631=function(_0x57bc52,_0x446e19){_0x57bc52=_0x57bc52-0x0;var _0x440b2f=_0x6312[_0x57bc52];return _0x440b2f;};'use strict';var _=require(_0x2631('0x0'));var util=require(_0x2631('0x1'));var moment=require(_0x2631('0x2'));var BPromise=require(_0x2631('0x3'));var rs=require(_0x2631('0x4'));var fs=require('fs');var Redis=require(_0x2631('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2631('0x6'))(_0x2631('0x7'));var config=require(_0x2631('0x8'));var jayson=require(_0x2631('0x9'));var client=jayson[_0x2631('0xa')]['http']({'port':0x232a});config['redis']=_[_0x2631('0xb')](config[_0x2631('0xc')],{'host':_0x2631('0xd'),'port':0x18eb});var socket=require(_0x2631('0xe'))(new Redis(config[_0x2631('0xc')]));require(_0x2631('0xf'))[_0x2631('0x10')](socket);function respondWithRpcPromise(_0x50dc84,_0x5450b1,_0x2311d4){return new BPromise(function(_0x5e9415,_0xe8b7bc){return client[_0x2631('0x11')](_0x50dc84,_0x2311d4)[_0x2631('0x12')](function(_0x1811eb){logger[_0x2631('0x13')](_0x2631('0x14'),_0x5450b1,'request\x20sent');logger[_0x2631('0x15')](_0x2631('0x16'),_0x5450b1,'request\x20sent',JSON['stringify'](_0x1811eb));if(_0x1811eb['error']){if(_0x1811eb[_0x2631('0x17')][_0x2631('0x18')]===0x1f4){logger[_0x2631('0x17')]('CmList,\x20%s,\x20%s',_0x5450b1,_0x1811eb['error'][_0x2631('0x19')]);return _0xe8b7bc(_0x1811eb[_0x2631('0x17')]['message']);}logger[_0x2631('0x17')]('CmList,\x20%s,\x20%s',_0x5450b1,_0x1811eb[_0x2631('0x17')][_0x2631('0x19')]);return _0x5e9415(_0x1811eb[_0x2631('0x17')][_0x2631('0x19')]);}else{logger[_0x2631('0x13')]('CmList,\x20%s,\x20%s',_0x5450b1,_0x2631('0x1a'));_0x5e9415(_0x1811eb[_0x2631('0x1b')][_0x2631('0x19')]);}})[_0x2631('0x1c')](function(_0x460c6e){logger[_0x2631('0x17')]('CmList,\x20%s,\x20%s',_0x5450b1,_0x460c6e);_0xe8b7bc(_0x460c6e);});});} \ No newline at end of file +var _0x0bf7=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./cmList.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bf7,0x128));var _0x70bf=function(_0x409af5,_0x47eab8){_0x409af5=_0x409af5-0x0;var _0x5e353b=_0x0bf7[_0x409af5];return _0x5e353b;};'use strict';var _=require(_0x70bf('0x0'));var util=require(_0x70bf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x70bf('0x2'));var fs=require('fs');var Redis=require(_0x70bf('0x3'));var db=require(_0x70bf('0x4'))['db'];var utils=require(_0x70bf('0x5'));var logger=require(_0x70bf('0x6'))(_0x70bf('0x7'));var config=require(_0x70bf('0x8'));var jayson=require(_0x70bf('0x9'));var client=jayson['client'][_0x70bf('0xa')]({'port':0x232a});config['redis']=_[_0x70bf('0xb')](config[_0x70bf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x70bf('0xd'))(new Redis(config[_0x70bf('0xc')]));require(_0x70bf('0xe'))[_0x70bf('0xf')](socket);function respondWithRpcPromise(_0x562878,_0x8aa47d,_0x2116cf){return new BPromise(function(_0x2832ad,_0x197627){return client['request'](_0x562878,_0x2116cf)[_0x70bf('0x10')](function(_0x15c6f0){logger[_0x70bf('0x11')](_0x70bf('0x12'),_0x8aa47d,_0x70bf('0x13'));logger[_0x70bf('0x14')](_0x70bf('0x15'),_0x8aa47d,_0x70bf('0x13'),JSON[_0x70bf('0x16')](_0x15c6f0));if(_0x15c6f0[_0x70bf('0x17')]){if(_0x15c6f0[_0x70bf('0x17')][_0x70bf('0x18')]===0x1f4){logger[_0x70bf('0x17')]('CmList,\x20%s,\x20%s',_0x8aa47d,_0x15c6f0[_0x70bf('0x17')]['message']);return _0x197627(_0x15c6f0['error'][_0x70bf('0x19')]);}logger[_0x70bf('0x17')](_0x70bf('0x12'),_0x8aa47d,_0x15c6f0[_0x70bf('0x17')]['message']);return _0x2832ad(_0x15c6f0['error']['message']);}else{logger['info'](_0x70bf('0x12'),_0x8aa47d,_0x70bf('0x13'));_0x2832ad(_0x15c6f0['result'][_0x70bf('0x19')]);}})['catch'](function(_0xee2873){logger['error'](_0x70bf('0x12'),_0x8aa47d,_0xee2873);_0x197627(_0xee2873);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4e2caf2..bec6a71 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 _0x826b=['cmList:','./cmList.events','save','update','emit','register'];(function(_0x3c5d97,_0x35ecf7){var _0x2ab71b=function(_0x5510bd){while(--_0x5510bd){_0x3c5d97['push'](_0x3c5d97['shift']());}};_0x2ab71b(++_0x35ecf7);}(_0x826b,0x18d));var _0xb826=function(_0x5a8752,_0x4818a4){_0x5a8752=_0x5a8752-0x0;var _0x2d341d=_0x826b[_0x5a8752];return _0x2d341d;};'use strict';var CmListEvents=require(_0xb826('0x0'));var events=[_0xb826('0x1'),'remove',_0xb826('0x2')];function createListener(_0x2500f0,_0x57db56){return function(_0x1f6a12){_0x57db56[_0xb826('0x3')](_0x2500f0,_0x1f6a12);};}function removeListener(_0x553cae,_0x105a61){return function(){CmListEvents['removeListener'](_0x553cae,_0x105a61);};}exports[_0xb826('0x4')]=function(_0x121132){for(var _0x263994=0x0,_0x16a7c1=events['length'];_0x263994<_0x16a7c1;_0x263994++){var _0x186f43=events[_0x263994];var _0x133f73=createListener(_0xb826('0x5')+_0x186f43,_0x121132);CmListEvents['on'](_0x186f43,_0x133f73);}}; \ No newline at end of file +var _0x3390=['update','removeListener','register','cmList:','./cmList.events','save'];(function(_0x15211c,_0x4738c9){var _0x5e255c=function(_0x3bbf36){while(--_0x3bbf36){_0x15211c['push'](_0x15211c['shift']());}};_0x5e255c(++_0x4738c9);}(_0x3390,0x1a8));var _0x0339=function(_0x3437be,_0x14b62f){_0x3437be=_0x3437be-0x0;var _0x275662=_0x3390[_0x3437be];return _0x275662;};'use strict';var CmListEvents=require(_0x0339('0x0'));var events=[_0x0339('0x1'),'remove',_0x0339('0x2')];function createListener(_0x4695ab,_0xbb857c){return function(_0x168bd3){_0xbb857c['emit'](_0x4695ab,_0x168bd3);};}function removeListener(_0x1b0ac9,_0x4fd31a){return function(){CmListEvents[_0x0339('0x3')](_0x1b0ac9,_0x4fd31a);};}exports[_0x0339('0x4')]=function(_0x47faf6){for(var _0x3fc871=0x0,_0x1c81b4=events['length'];_0x3fc871<_0x1c81b4;_0x3fc871++){var _0x26e87b=events[_0x3fc871];var _0x1f4390=createListener(_0x0339('0x5')+_0x26e87b,_0x47faf6);CmListEvents['on'](_0x26e87b,_0x1f4390);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 75f740d..408a36f 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 _0x410d=['exports','multer','util','path','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy','/:id/dispositions','removeDispositions','removeAgents'];(function(_0x3909e3,_0x1cb53f){var _0x44a324=function(_0x162297){while(--_0x162297){_0x3909e3['push'](_0x3909e3['shift']());}};_0x44a324(++_0x1cb53f);}(_0x410d,0x118));var _0xd410=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x410d[_0xf9a6cf];return _0x59e2bc;};'use strict';var multer=require(_0xd410('0x0'));var util=require(_0xd410('0x1'));var path=require(_0xd410('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd410('0x3'));var controller=require('./cmList.controller');router[_0xd410('0x4')]('/',auth[_0xd410('0x5')](),controller[_0xd410('0x6')]);router['get'](_0xd410('0x7'),auth['isAuthenticated'](),controller[_0xd410('0x8')]);router[_0xd410('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xd410('0x9')]);router['get']('/:id/dispositions',auth[_0xd410('0x5')](),controller['getDispositions']);router[_0xd410('0x4')](_0xd410('0xa'),auth['isAuthenticated'](),controller[_0xd410('0xb')]);router['get'](_0xd410('0xc'),auth[_0xd410('0x5')](),controller[_0xd410('0xd')]);router[_0xd410('0x4')](_0xd410('0xe'),auth[_0xd410('0x5')](),controller[_0xd410('0xf')]);router[_0xd410('0x4')](_0xd410('0x10'),auth[_0xd410('0x5')](),controller[_0xd410('0x11')]);router['post']('/',auth[_0xd410('0x5')](),controller['create']);router[_0xd410('0x12')]('/:id/dispositions',auth[_0xd410('0x5')](),controller['addDisposition']);router['post']('/:id/contacts',auth[_0xd410('0x5')](),controller[_0xd410('0x13')]);router['post'](_0xd410('0xe'),auth[_0xd410('0x5')](),controller[_0xd410('0x14')]);router['post']('/:id/users',auth[_0xd410('0x5')](),controller[_0xd410('0x15')]);router[_0xd410('0x16')](_0xd410('0x17'),auth[_0xd410('0x5')](),controller[_0xd410('0x18')]);router[_0xd410('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xd410('0x1a')]);router[_0xd410('0x19')](_0xd410('0x1b'),auth[_0xd410('0x5')](),controller[_0xd410('0x1c')]);router[_0xd410('0x19')](_0xd410('0x10'),auth[_0xd410('0x5')](),controller[_0xd410('0x1d')]);module[_0xd410('0x1e')]=router; \ No newline at end of file +var _0x23fa=['isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts/csv','getContactsCsv','getCustomFields','create','post','/:id/contacts','addContacts','/:id/fields','/:id/users','addAgents','put','update','delete','/:id/dispositions','removeDispositions','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x23fa,0x15f));var _0xa23f=function(_0xd0cd5e,_0x1efa5d){_0xd0cd5e=_0xd0cd5e-0x0;var _0x119e00=_0x23fa[_0xd0cd5e];return _0x119e00;};'use strict';var multer=require(_0xa23f('0x0'));var util=require(_0xa23f('0x1'));var path=require(_0xa23f('0x2'));var timeout=require(_0xa23f('0x3'));var express=require(_0xa23f('0x4'));var router=express[_0xa23f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa23f('0x6'));var config=require(_0xa23f('0x7'));var controller=require('./cmList.controller');router[_0xa23f('0x8')]('/',auth[_0xa23f('0x9')](),controller[_0xa23f('0xa')]);router[_0xa23f('0x8')](_0xa23f('0xb'),auth[_0xa23f('0x9')](),controller[_0xa23f('0xc')]);router[_0xa23f('0x8')](_0xa23f('0xd'),auth['isAuthenticated'](),controller[_0xa23f('0xe')]);router[_0xa23f('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa23f('0x8')]('/:id/contacts',auth[_0xa23f('0x9')](),controller['getContacts']);router[_0xa23f('0x8')](_0xa23f('0xf'),auth[_0xa23f('0x9')](),controller[_0xa23f('0x10')]);router[_0xa23f('0x8')]('/:id/fields',auth[_0xa23f('0x9')](),controller[_0xa23f('0x11')]);router[_0xa23f('0x8')]('/:id/users',auth[_0xa23f('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xa23f('0x12')]);router[_0xa23f('0x13')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xa23f('0x14'),auth[_0xa23f('0x9')](),controller[_0xa23f('0x15')]);router['post'](_0xa23f('0x16'),auth[_0xa23f('0x9')](),controller['addCustomField']);router['post'](_0xa23f('0x17'),auth[_0xa23f('0x9')](),controller[_0xa23f('0x18')]);router[_0xa23f('0x19')]('/:id',auth[_0xa23f('0x9')](),controller[_0xa23f('0x1a')]);router[_0xa23f('0x1b')]('/:id',auth[_0xa23f('0x9')](),controller['destroy']);router['delete'](_0xa23f('0x1c'),auth['isAuthenticated'](),controller[_0xa23f('0x1d')]);router[_0xa23f('0x1b')](_0xa23f('0x17'),auth[_0xa23f('0x9')](),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 3f32a9d..c89a8fb 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 _0x9344=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x2e9e9d,_0xfc5eb2){var _0x30791d=function(_0x42e96e){while(--_0x42e96e){_0x2e9e9d['push'](_0x2e9e9d['shift']());}};_0x30791d(++_0xfc5eb2);}(_0x9344,0x180));var _0x4934=function(_0x40741b,_0x380f1a){_0x40741b=_0x40741b-0x0;var _0x30e499=_0x9344[_0x40741b];return _0x30e499;};'use strict';var Sequelize=require(_0x4934('0x0'));module['exports']={'name':{'type':Sequelize[_0x4934('0x1')],'get':function(_0x2b761f){return this[_0x4934('0x2')](_0x4934('0x3'));}},'field':{'type':Sequelize[_0x4934('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4934('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xb802=['STRING','sequelize','getDataValue'];(function(_0x32cb75,_0x1a6973){var _0x362c43=function(_0x8a132d){while(--_0x8a132d){_0x32cb75['push'](_0x32cb75['shift']());}};_0x362c43(++_0x1a6973);}(_0xb802,0x103));var _0x2b80=function(_0xfc8169,_0xa0959){_0xfc8169=_0xfc8169-0x0;var _0xc95ee5=_0xb802[_0xfc8169];return _0xc95ee5;};'use strict';var Sequelize=require(_0x2b80('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x23826a){return this[_0x2b80('0x1')]('field');}},'field':{'type':Sequelize[_0x2b80('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x2b80('0x2')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 4ee7772..3d9739a 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 _0xee5b=['sendStatus','name','send','body','Condition','find','params','catch','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end'];(function(_0x58dad7,_0x1945c5){var _0x16ebfb=function(_0xe76974){while(--_0xe76974){_0x58dad7['push'](_0x58dad7['shift']());}};_0x16ebfb(++_0x1945c5);}(_0xee5b,0x1f4));var _0xbee5=function(_0x16015d,_0x3c8cf6){_0x16015d=_0x16015d-0x0;var _0x5b259b=_0xee5b[_0x16015d];return _0x5b259b;};'use strict';var pdf=require(_0xbee5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbee5('0x1'));var zipdir=require(_0xbee5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbee5('0x3'));var moment=require(_0xbee5('0x4'));var BPromise=require(_0xbee5('0x5'));var Mustache=require(_0xbee5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbee5('0x7'));var csv=require(_0xbee5('0x8'));var ejs=require(_0xbee5('0x9'));var fs=require('fs');var _=require(_0xbee5('0xa'));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(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var authService=require(_0xbee5('0xd'));var hardwareService=require(_0xbee5('0xe'));var Redis=require('ioredis');var qs=require(_0xbee5('0xf'));var logger=require(_0xbee5('0x10'))(_0xbee5('0x11'));var utils=require(_0xbee5('0x12'));var config=require(_0xbee5('0x13'));var db=require(_0xbee5('0x14'))['db'];function respondWithStatusCode(_0x105e16,_0x17ee3c){_0x17ee3c=_0x17ee3c||0xcc;return function(_0xcef158){if(_0xcef158){return _0x105e16['sendStatus'](_0x17ee3c);}return _0x105e16[_0xbee5('0x15')](_0x17ee3c)['end']();};}function respondWithResult(_0x183877,_0x180edd){_0x180edd=_0x180edd||0xc8;return function(_0x8a268f){if(_0x8a268f){return _0x183877['status'](_0x180edd)['json'](_0x8a268f);}};}function respondWithFilteredResult(_0x3c6e56,_0x4cf5a8){return function(_0x40afcb){if(_0x40afcb){var _0x5426c9=_0x40afcb['count'],_0x1a24bd=_0x4cf5a8[_0xbee5('0x16')],_0x141878=_0x4cf5a8[_0xbee5('0x16')]+_0x4cf5a8['limit'],_0xf676b1;if(_0x141878>=_0x5426c9){_0x141878=_0x5426c9;_0xf676b1=0xc8;}else{_0xf676b1=0xce;}_0x3c6e56[_0xbee5('0x15')](_0xf676b1);return _0x3c6e56[_0xbee5('0x17')](_0xbee5('0x18'),_0x1a24bd+'-'+_0x141878+'/'+_0x5426c9)[_0xbee5('0x19')](_0x40afcb);}return null;};}function patchUpdates(_0x35eb5c){return function(_0xac51f5){try{jsonpatch[_0xbee5('0x1a')](_0xac51f5,_0x35eb5c,!![]);}catch(_0xa50ec9){return BPromise[_0xbee5('0x1b')](_0xa50ec9);}return _0xac51f5[_0xbee5('0x1c')]();};}function saveUpdates(_0x3d49b0,_0x117f10){return function(_0x35d7d3){if(_0x35d7d3){return _0x35d7d3[_0xbee5('0x1d')](_0x3d49b0)[_0xbee5('0x1e')](function(_0x47af8e){return _0x47af8e;});}return null;};}function removeEntity(_0x550325,_0x469a7a){return function(_0x48bfb5){if(_0x48bfb5){return _0x48bfb5[_0xbee5('0x1f')]()[_0xbee5('0x1e')](function(){_0x550325[_0xbee5('0x15')](0xcc)[_0xbee5('0x20')]();});}};}function handleEntityNotFound(_0x3f23c5,_0xb665df){return function(_0x359ccf){if(!_0x359ccf){_0x3f23c5[_0xbee5('0x21')](0x194);}return _0x359ccf;};}function handleError(_0xc79035,_0x520c02){_0x520c02=_0x520c02||0x1f4;return function(_0x5b43b3){logger['error'](_0x5b43b3['stack']);if(_0x5b43b3['name']){delete _0x5b43b3[_0xbee5('0x22')];}_0xc79035[_0xbee5('0x15')](_0x520c02)[_0xbee5('0x23')](_0x5b43b3);};}exports[_0xbee5('0x1d')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x24')]['id']){delete _0x169042['body']['id'];}return db[_0xbee5('0x25')][_0xbee5('0x26')]({'where':{'id':_0x169042[_0xbee5('0x27')]['id']}})[_0xbee5('0x1e')](handleEntityNotFound(_0x20e7e8,null))[_0xbee5('0x1e')](saveUpdates(_0x169042['body'],null))[_0xbee5('0x1e')](respondWithResult(_0x20e7e8,null))[_0xbee5('0x28')](handleError(_0x20e7e8,null));};exports[_0xbee5('0x1f')]=function(_0x136a00,_0xa57f85){return db[_0xbee5('0x25')][_0xbee5('0x26')]({'where':{'id':_0x136a00[_0xbee5('0x27')]['id']}})[_0xbee5('0x1e')](handleEntityNotFound(_0xa57f85,null))['then'](removeEntity(_0xa57f85,null))[_0xbee5('0x28')](handleError(_0xa57f85,null));}; \ No newline at end of file +var _0x9c44=['moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','json','count','offset','limit','save','update','then','error','stack','name','send','body','Condition','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4c24d2,_0x33b0e3){var _0x26abf3=function(_0x2b5622){while(--_0x2b5622){_0x4c24d2['push'](_0x4c24d2['shift']());}};_0x26abf3(++_0x33b0e3);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x49c4('0xf'));var qs=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){_0x46e475[_0x49c4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x592bb8,_0x2263ae){return function(_0x15581b){if(!_0x15581b){_0x592bb8[_0x49c4('0x13')](0x194);}return _0x15581b;};}function handleError(_0xd335e4,_0x4811c4){_0x4811c4=_0x4811c4||0x1f4;return function(_0x5850f2){logger[_0x49c4('0x1c')](_0x5850f2[_0x49c4('0x1d')]);if(_0x5850f2['name']){delete _0x5850f2[_0x49c4('0x1e')];}_0xd335e4[_0x49c4('0x14')](_0x4811c4)[_0x49c4('0x1f')](_0x5850f2);};}exports[_0x49c4('0x1a')]=function(_0x531d92,_0x543ea2){if(_0x531d92[_0x49c4('0x20')]['id']){delete _0x531d92['body']['id'];}return db[_0x49c4('0x21')][_0x49c4('0x22')]({'where':{'id':_0x531d92[_0x49c4('0x23')]['id']}})[_0x49c4('0x1b')](handleEntityNotFound(_0x543ea2,null))['then'](saveUpdates(_0x531d92[_0x49c4('0x20')],null))[_0x49c4('0x1b')](respondWithResult(_0x543ea2,null))[_0x49c4('0x24')](handleError(_0x543ea2,null));};exports[_0x49c4('0x25')]=function(_0x6329b3,_0x29f835){return db[_0x49c4('0x21')][_0x49c4('0x22')]({'where':{'id':_0x6329b3[_0x49c4('0x23')]['id']}})[_0x49c4('0x1b')](handleEntityNotFound(_0x29f835,null))[_0x49c4('0x1b')](removeEntity(_0x29f835,null))['catch'](handleError(_0x29f835,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e5f9496..5848955 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 _0x4fb2=['bluebird','request-promise','define','Condition','../../config/logger','moment'];(function(_0x55ed7a,_0x34eb0e){var _0x120754=function(_0x1529e1){while(--_0x1529e1){_0x55ed7a['push'](_0x55ed7a['shift']());}};_0x120754(++_0x34eb0e);}(_0x4fb2,0xf4));var _0x24fb=function(_0x5dd0ef,_0x459a82){_0x5dd0ef=_0x5dd0ef-0x0;var _0x594a9c=_0x4fb2[_0x5dd0ef];return _0x594a9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x24fb('0x0'))('api');var moment=require(_0x24fb('0x1'));var BPromise=require(_0x24fb('0x2'));var rp=require(_0x24fb('0x3'));var attributes=require('./condition.attributes');module['exports']=function(_0x52715f,_0x3c9e83){return _0x52715f[_0x24fb('0x4')](_0x24fb('0x5'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xade6=['../../config/logger','api','moment','bluebird','request-promise','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0xade6,0x12a));var _0x6ade=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xade6[_0x179c4a];return _0x5d1879;};'use strict';var _=require(_0x6ade('0x0'));var util=require(_0x6ade('0x1'));var logger=require(_0x6ade('0x2'))(_0x6ade('0x3'));var moment=require(_0x6ade('0x4'));var BPromise=require(_0x6ade('0x5'));var rp=require(_0x6ade('0x6'));var attributes=require(_0x6ade('0x7'));module[_0x6ade('0x8')]=function(_0x298b2f,_0x2f276b){return _0x298b2f[_0x6ade('0x9')](_0x6ade('0xa'),attributes,{'tableName':_0x6ade('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index d84483a..be97176 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 _0x8747=['http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x47fbdd,_0x487e75){var _0x39172c=function(_0x32d8e2){while(--_0x32d8e2){_0x47fbdd['push'](_0x47fbdd['shift']());}};_0x39172c(++_0x487e75);}(_0x8747,0x19c));var _0x7874=function(_0x27a611,_0xe00621){_0x27a611=_0x27a611-0x0;var _0x39c5de=_0x8747[_0x27a611];return _0x39c5de;};'use strict';var _=require(_0x7874('0x0'));var util=require(_0x7874('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7874('0x2'));var fs=require('fs');var Redis=require(_0x7874('0x3'));var db=require(_0x7874('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7874('0x5'))('rpc');var config=require(_0x7874('0x6'));var jayson=require(_0x7874('0x7'));var client=jayson['client'][_0x7874('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28cc6b,_0x5c004b,_0x47fc4e){return new BPromise(function(_0x493f13,_0x17066d){return client['request'](_0x28cc6b,_0x47fc4e)[_0x7874('0x9')](function(_0x4cb439){logger[_0x7874('0xa')](_0x7874('0xb'),_0x5c004b,_0x7874('0xc'));logger[_0x7874('0xd')](_0x7874('0xe'),_0x5c004b,'request\x20sent',JSON['stringify'](_0x4cb439));if(_0x4cb439[_0x7874('0xf')]){if(_0x4cb439['error'][_0x7874('0x10')]===0x1f4){logger['error'](_0x7874('0xb'),_0x5c004b,_0x4cb439[_0x7874('0xf')][_0x7874('0x11')]);return _0x17066d(_0x4cb439[_0x7874('0xf')][_0x7874('0x11')]);}logger[_0x7874('0xf')]('Condition,\x20%s,\x20%s',_0x5c004b,_0x4cb439[_0x7874('0xf')][_0x7874('0x11')]);return _0x493f13(_0x4cb439[_0x7874('0xf')][_0x7874('0x11')]);}else{logger[_0x7874('0xa')](_0x7874('0xb'),_0x5c004b,'request\x20sent');_0x493f13(_0x4cb439[_0x7874('0x12')][_0x7874('0x11')]);}})[_0x7874('0x13')](function(_0x2b5080){logger[_0x7874('0xf')]('Condition,\x20%s,\x20%s',_0x5c004b,_0x2b5080);_0x17066d(_0x2b5080);});});} \ No newline at end of file +var _0xfbd4=['code','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2511cf,_0x4b7635){var _0x2797fe=function(_0x4579f5){while(--_0x4579f5){_0x2511cf['push'](_0x2511cf['shift']());}};_0x2797fe(++_0x4b7635);}(_0xfbd4,0x1e8));var _0x4fbd=function(_0x441975,_0x4a1e43){_0x441975=_0x441975-0x0;var _0xb6e875=_0xfbd4[_0x441975];return _0xb6e875;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fbd('0x0'));var BPromise=require(_0x4fbd('0x1'));var rs=require(_0x4fbd('0x2'));var fs=require('fs');var Redis=require(_0x4fbd('0x3'));var db=require(_0x4fbd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4fbd('0x5'));var config=require(_0x4fbd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4fbd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a3646,_0x1e64ef,_0x88bbab){return new BPromise(function(_0x364075,_0x190975){return client[_0x4fbd('0x8')](_0x3a3646,_0x88bbab)[_0x4fbd('0x9')](function(_0x164d55){logger[_0x4fbd('0xa')](_0x4fbd('0xb'),_0x1e64ef,'request\x20sent');logger[_0x4fbd('0xc')](_0x4fbd('0xd'),_0x1e64ef,_0x4fbd('0xe'),JSON[_0x4fbd('0xf')](_0x164d55));if(_0x164d55['error']){if(_0x164d55['error'][_0x4fbd('0x10')]===0x1f4){logger[_0x4fbd('0x11')](_0x4fbd('0xb'),_0x1e64ef,_0x164d55[_0x4fbd('0x11')]['message']);return _0x190975(_0x164d55[_0x4fbd('0x11')][_0x4fbd('0x12')]);}logger[_0x4fbd('0x11')]('Condition,\x20%s,\x20%s',_0x1e64ef,_0x164d55[_0x4fbd('0x11')][_0x4fbd('0x12')]);return _0x364075(_0x164d55[_0x4fbd('0x11')]['message']);}else{logger[_0x4fbd('0xa')]('Condition,\x20%s,\x20%s',_0x1e64ef,_0x4fbd('0xe'));_0x364075(_0x164d55[_0x4fbd('0x13')]['message']);}})[_0x4fbd('0x14')](function(_0x4da8c4){logger['error'](_0x4fbd('0xb'),_0x1e64ef,_0x4da8c4);_0x190975(_0x4da8c4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index b0dceae..c22d8ec 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 _0x9c35=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','destroy'];(function(_0x3dbf5a,_0x4613fc){var _0x5e83a8=function(_0x523916){while(--_0x523916){_0x3dbf5a['push'](_0x3dbf5a['shift']());}};_0x5e83a8(++_0x4613fc);}(_0x9c35,0x112));var _0x59c3=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0x9c35[_0x5b8310];return _0xd3ebc1;};'use strict';var multer=require(_0x59c3('0x0'));var util=require(_0x59c3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x59c3('0x2'));var router=express[_0x59c3('0x3')]();var auth=require(_0x59c3('0x4'));var interaction=require(_0x59c3('0x5'));var config=require(_0x59c3('0x6'));var controller=require('./condition.controller');router[_0x59c3('0x7')](_0x59c3('0x8'),auth[_0x59c3('0x9')](),controller[_0x59c3('0xa')]);router['delete'](_0x59c3('0x8'),auth[_0x59c3('0x9')](),controller[_0x59c3('0xb')]);module[_0x59c3('0xc')]=router; \ No newline at end of file +var _0xa112=['isAuthenticated','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','put','/:id'];(function(_0x2de810,_0x981292){var _0x100762=function(_0x53aaac){while(--_0x53aaac){_0x2de810['push'](_0x2de810['shift']());}};_0x100762(++_0x981292);}(_0xa112,0xf4));var _0x2a11=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xa112[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x2a11('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a11('0x1'));var express=require(_0x2a11('0x2'));var router=express[_0x2a11('0x3')]();var auth=require(_0x2a11('0x4'));var interaction=require(_0x2a11('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0x2a11('0x6')](_0x2a11('0x7'),auth[_0x2a11('0x8')](),controller['update']);router[_0x2a11('0x9')](_0x2a11('0x7'),auth[_0x2a11('0x8')](),controller[_0x2a11('0xa')]);module[_0x2a11('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 179e42e..715af7a 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 _0xf0c6=['STRING','name','exports'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xf0c6,0xb3));var _0x6f0c=function(_0x32a998,_0x30cc2c){_0x32a998=_0x32a998-0x0;var _0x2b503d=_0xf0c6[_0x32a998];return _0x2b503d;};'use strict';var Sequelize=require('sequelize');module[_0x6f0c('0x0')]={'name':{'type':Sequelize[_0x6f0c('0x1')],'allowNull':![],'unique':_0x6f0c('0x2')},'description':{'type':Sequelize[_0x6f0c('0x1')]}}; \ No newline at end of file +var _0x578a=['sequelize','exports','name'];(function(_0x1c8040,_0x209fe0){var _0x4288c5=function(_0x1f6089){while(--_0x1f6089){_0x1c8040['push'](_0x1c8040['shift']());}};_0x4288c5(++_0x209fe0);}(_0x578a,0x1a4));var _0xa578=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x578a[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0xa578('0x0'));module[_0xa578('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa578('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 140b158..b0b8511 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 _0xc4bd=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','count','offset','set','reject','save','update','then','destroy','CustomDashboards','sendStatus','error','stack','name','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','Dashboard','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','stringify','addItem','DashboardItem','getItems','pick','html-pdf','eml-format'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc4bd,0x75));var _0xdc4b=function(_0x4be3ad,_0x303bfb){_0x4be3ad=_0x4be3ad-0x0;var _0x457c35=_0xc4bd[_0x4be3ad];return _0x457c35;};'use strict';var pdf=require(_0xdc4b('0x0'));var emlformat=require(_0xdc4b('0x1'));var rimraf=require(_0xdc4b('0x2'));var zipdir=require(_0xdc4b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc4b('0x4'));var BPromise=require(_0xdc4b('0x5'));var Mustache=require(_0xdc4b('0x6'));var util=require(_0xdc4b('0x7'));var path=require(_0xdc4b('0x8'));var sox=require(_0xdc4b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc4b('0xa'));var squel=require(_0xdc4b('0xb'));var crypto=require(_0xdc4b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdc4b('0xd'));var toCsv=require(_0xdc4b('0xe'));var querystring=require(_0xdc4b('0xf'));var Papa=require(_0xdc4b('0x10'));var authService=require(_0xdc4b('0x11'));var hardwareService=require(_0xdc4b('0x12'));var Redis=require('ioredis');var qs=require(_0xdc4b('0x13'));var logger=require(_0xdc4b('0x14'))(_0xdc4b('0x15'));var utils=require('../../config/utils');var config=require(_0xdc4b('0x16'));var db=require(_0xdc4b('0x17'))['db'];config['redis']=_[_0xdc4b('0x18')](config[_0xdc4b('0x19')],{'host':_0xdc4b('0x1a'),'port':0x18eb});var socket=require(_0xdc4b('0x1b'))(new Redis(config['redis']));require(_0xdc4b('0x1c'))[_0xdc4b('0x1d')](socket);function respondWithStatusCode(_0x17734f,_0x2c7ab7){_0x2c7ab7=_0x2c7ab7||0xcc;return function(_0x1b548f){if(_0x1b548f){return _0x17734f['sendStatus'](_0x2c7ab7);}return _0x17734f[_0xdc4b('0x1e')](_0x2c7ab7)[_0xdc4b('0x1f')]();};}function respondWithResult(_0x3358be,_0x1817ae){_0x1817ae=_0x1817ae||0xc8;return function(_0x1d23ff){if(_0x1d23ff){return _0x3358be['status'](_0x1817ae)[_0xdc4b('0x20')](_0x1d23ff);}};}function respondWithFilteredResult(_0x3b08c7,_0x463182){return function(_0x36db2c){if(_0x36db2c){var _0x2ac7a8=_0x36db2c[_0xdc4b('0x21')],_0x9349a5=_0x463182[_0xdc4b('0x22')],_0x1d49f0=_0x463182[_0xdc4b('0x22')]+_0x463182['limit'],_0x37f0b5;if(_0x1d49f0>=_0x2ac7a8){_0x1d49f0=_0x2ac7a8;_0x37f0b5=0xc8;}else{_0x37f0b5=0xce;}_0x3b08c7[_0xdc4b('0x1e')](_0x37f0b5);return _0x3b08c7[_0xdc4b('0x23')]('Content-Range',_0x9349a5+'-'+_0x1d49f0+'/'+_0x2ac7a8)[_0xdc4b('0x20')](_0x36db2c);}return null;};}function patchUpdates(_0x134c54){return function(_0xb0b8d8){try{jsonpatch['apply'](_0xb0b8d8,_0x134c54,!![]);}catch(_0xa41d27){return BPromise[_0xdc4b('0x24')](_0xa41d27);}return _0xb0b8d8[_0xdc4b('0x25')]();};}function saveUpdates(_0xa22050,_0x23e20f){return function(_0x2e98b7){if(_0x2e98b7){return _0x2e98b7[_0xdc4b('0x26')](_0xa22050)[_0xdc4b('0x27')](function(_0x53bef8){return _0x53bef8;});}return null;};}function removeEntity(_0x26f83a,_0x459c3e){return function(_0x5ad440){if(_0x5ad440){return _0x5ad440[_0xdc4b('0x28')]()[_0xdc4b('0x27')](function(){var _0x23e98f=_0x5ad440['get']({'plain':!![]});var _0x26c492=_0xdc4b('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x26c492,'resourceId':_0x23e98f['id']}})['then'](function(){return _0x5ad440;});})[_0xdc4b('0x27')](function(){_0x26f83a['status'](0xcc)[_0xdc4b('0x1f')]();});}};}function handleEntityNotFound(_0x5b0b7a,_0x230393){return function(_0x4b7b26){if(!_0x4b7b26){_0x5b0b7a[_0xdc4b('0x2a')](0x194);}return _0x4b7b26;};}function handleError(_0x57edfa,_0x5706bb){_0x5706bb=_0x5706bb||0x1f4;return function(_0x910415){logger[_0xdc4b('0x2b')](_0x910415[_0xdc4b('0x2c')]);if(_0x910415['name']){delete _0x910415[_0xdc4b('0x2d')];}_0x57edfa[_0xdc4b('0x1e')](_0x5706bb)['send'](_0x910415);};}exports['index']=function(_0x51c017,_0x50aedf){var _0x15d9db={},_0x47f7bf={},_0x2b2762={'count':0x0,'rows':[]};var _0x47df23=db['Dashboard'][_0xdc4b('0x2e')];_0x47f7bf[_0xdc4b('0x2f')]=_[_0xdc4b('0x30')](_0x47df23);_0x47f7bf[_0xdc4b('0x31')]=_[_0xdc4b('0x30')](_0x51c017[_0xdc4b('0x31')]);_0x47f7bf[_0xdc4b('0x32')]=_[_0xdc4b('0x33')](_0x47f7bf['model'],_0x47f7bf[_0xdc4b('0x31')]);_0x15d9db[_0xdc4b('0x34')]=_[_0xdc4b('0x33')](_0x47f7bf[_0xdc4b('0x2f')],qs['fields'](_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x35')]));_0x15d9db[_0xdc4b('0x34')]=_0x15d9db[_0xdc4b('0x34')][_0xdc4b('0x36')]?_0x15d9db[_0xdc4b('0x34')]:_0x47f7bf[_0xdc4b('0x2f')];if(!_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x37')](_0xdc4b('0x38'))){_0x15d9db['limit']=qs[_0xdc4b('0x39')](_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x39')]);_0x15d9db[_0xdc4b('0x22')]=qs[_0xdc4b('0x22')](_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x22')]);}_0x15d9db[_0xdc4b('0x3a')]=qs[_0xdc4b('0x3b')](_0x51c017[_0xdc4b('0x31')]['sort']);_0x15d9db[_0xdc4b('0x3c')]=qs[_0xdc4b('0x32')](_['pick'](_0x51c017['query'],_0x47f7bf[_0xdc4b('0x32')]));if(_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x3d')]){_0x15d9db[_0xdc4b('0x3c')]=_[_0xdc4b('0x3e')](_0x15d9db[_0xdc4b('0x3c')],{'$or':_[_0xdc4b('0x3f')](_0x47df23,function(_0xbd5c4f){if(_0xbd5c4f[_0xdc4b('0x40')][_0xdc4b('0x41')]!==_0xdc4b('0x42')){var _0x599b21={};_0x599b21[_0xbd5c4f['field']]={'$like':'%'+_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x3d')]+'%'};return _0x599b21;}})});}_0x15d9db=_[_0xdc4b('0x3e')]({},_0x15d9db,_0x51c017[_0xdc4b('0x43')]);var _0x27d725={'where':_0x15d9db[_0xdc4b('0x3c')]};return db['Dashboard']['count'](_0x27d725)[_0xdc4b('0x27')](function(_0x2ec81e){_0x2b2762[_0xdc4b('0x21')]=_0x2ec81e;if(_0x51c017[_0xdc4b('0x31')][_0xdc4b('0x44')]){_0x15d9db[_0xdc4b('0x45')]=[{'all':!![]}];}return db[_0xdc4b('0x46')][_0xdc4b('0x47')](_0x15d9db);})[_0xdc4b('0x27')](function(_0x20a8d8){_0x2b2762[_0xdc4b('0x48')]=_0x20a8d8;return _0x2b2762;})[_0xdc4b('0x27')](respondWithFilteredResult(_0x50aedf,_0x15d9db))[_0xdc4b('0x49')](handleError(_0x50aedf,null));};exports[_0xdc4b('0x4a')]=function(_0x5e8ee5,_0x271faa){var _0x1e0fcc={'raw':![],'where':{'id':_0x5e8ee5[_0xdc4b('0x4b')]['id']}},_0x948b04={};_0x948b04[_0xdc4b('0x2f')]=_['keys'](db[_0xdc4b('0x46')]['rawAttributes']);_0x948b04[_0xdc4b('0x31')]=_[_0xdc4b('0x30')](_0x5e8ee5['query']);_0x948b04['filters']=_[_0xdc4b('0x33')](_0x948b04['model'],_0x948b04[_0xdc4b('0x31')]);_0x1e0fcc[_0xdc4b('0x34')]=_[_0xdc4b('0x33')](_0x948b04[_0xdc4b('0x2f')],qs[_0xdc4b('0x35')](_0x5e8ee5['query'][_0xdc4b('0x35')]));_0x1e0fcc[_0xdc4b('0x34')]=_0x1e0fcc[_0xdc4b('0x34')][_0xdc4b('0x36')]?_0x1e0fcc[_0xdc4b('0x34')]:_0x948b04[_0xdc4b('0x2f')];if(_0x5e8ee5[_0xdc4b('0x31')][_0xdc4b('0x44')]){_0x1e0fcc[_0xdc4b('0x45')]=[{'all':!![]}];}_0x1e0fcc=_[_0xdc4b('0x3e')]({},_0x1e0fcc,_0x5e8ee5[_0xdc4b('0x43')]);return db[_0xdc4b('0x46')]['find'](_0x1e0fcc)[_0xdc4b('0x27')](handleEntityNotFound(_0x271faa,null))['then'](respondWithResult(_0x271faa,null))['catch'](handleError(_0x271faa,null));};exports['create']=function(_0x14f26b,_0x2c0694){return db['Dashboard'][_0xdc4b('0x4c')](_0x14f26b[_0xdc4b('0x4d')],{})[_0xdc4b('0x27')](function(_0x30efb1){var _0x44176e=_0x14f26b[_0xdc4b('0x4e')][_0xdc4b('0x4f')]({'plain':!![]});if(!_0x44176e)throw new Error(_0xdc4b('0x50'));if(_0x44176e[_0xdc4b('0x51')]==='user'){var _0x111665=_0x30efb1[_0xdc4b('0x4f')]({'plain':!![]});var _0x43cc8e=_0xdc4b('0x29');return db[_0xdc4b('0x52')][_0xdc4b('0x53')]({'where':{'name':_0x43cc8e,'userProfileId':_0x44176e[_0xdc4b('0x54')]},'raw':!![]})['then'](function(_0x1dfd90){if(_0x1dfd90&&_0x1dfd90['autoAssociation']===0x0){return db[_0xdc4b('0x55')][_0xdc4b('0x4c')]({'name':_0x111665[_0xdc4b('0x2d')],'resourceId':_0x111665['id'],'type':_0x1dfd90[_0xdc4b('0x2d')],'sectionId':_0x1dfd90['id']},{})[_0xdc4b('0x27')](function(){return _0x30efb1;});}else{return _0x30efb1;}})[_0xdc4b('0x49')](function(_0x38f0c7){logger[_0xdc4b('0x2b')](_0xdc4b('0x56'),_0x38f0c7);throw _0x38f0c7;});}return _0x30efb1;})[_0xdc4b('0x27')](respondWithResult(_0x2c0694,0xc9))[_0xdc4b('0x49')](handleError(_0x2c0694,null));};exports['clone']=function(_0x3fd554,_0x1cc181){var _0x2d0f6d={'raw':![],'where':{'id':_0x3fd554[_0xdc4b('0x4b')]['id']}},_0x5e9c33={};_0x5e9c33[_0xdc4b('0x2f')]=_['keys'](db[_0xdc4b('0x46')][_0xdc4b('0x2e')]);_0x2d0f6d[_0xdc4b('0x34')]=_['intersection'](_0x5e9c33['model'],qs[_0xdc4b('0x35')](_0x3fd554[_0xdc4b('0x31')][_0xdc4b('0x35')]));_0x2d0f6d[_0xdc4b('0x34')]=_0x2d0f6d['attributes'][_0xdc4b('0x36')]?_0x2d0f6d[_0xdc4b('0x34')]:_0x5e9c33[_0xdc4b('0x2f')];if(_0x3fd554[_0xdc4b('0x31')][_0xdc4b('0x44')]){_0x2d0f6d[_0xdc4b('0x45')]=[{'all':!![]}];}_0x2d0f6d=_[_0xdc4b('0x3e')]({},_0x2d0f6d,_0x3fd554[_0xdc4b('0x43')]);return db['Dashboard']['find'](_0x2d0f6d)[_0xdc4b('0x27')](handleEntityNotFound(_0x1cc181,null))[_0xdc4b('0x27')](function(_0x41f0ee){if(_0x41f0ee){var _0x56caac=_0x41f0ee[_0xdc4b('0x4f')]({'plain':!![]});_0x56caac=qs[_0xdc4b('0x57')](_0x56caac,['id',_0xdc4b('0x58'),_0xdc4b('0x59')]);_0x3fd554[_0xdc4b('0x4d')]=_[_0xdc4b('0x57')](_0x3fd554[_0xdc4b('0x4d')],['id',_0xdc4b('0x58'),_0xdc4b('0x59')]);return db[_0xdc4b('0x46')]['create'](_[_0xdc4b('0x3e')](_0x56caac,_0x3fd554[_0xdc4b('0x4d')]),{'include':_0x3fd554[_0xdc4b('0x31')][_0xdc4b('0x44')]?[{'all':!![]}]:undefined})[_0xdc4b('0x27')](function(_0x4883cd){var _0x10ae67=_0x3fd554[_0xdc4b('0x4e')]['get']({'plain':!![]});if(!_0x10ae67)throw new Error(_0xdc4b('0x50'));if(_0x10ae67[_0xdc4b('0x51')]===_0xdc4b('0x4e')){var _0x55d8e4=_0x4883cd['get']({'plain':!![]});var _0x2f3183=_0xdc4b('0x29');return db['UserProfileSection'][_0xdc4b('0x53')]({'where':{'name':_0x2f3183,'userProfileId':_0x10ae67[_0xdc4b('0x54')]},'raw':!![]})['then'](function(_0x2149c5){if(_0x2149c5&&_0x2149c5[_0xdc4b('0x5a')]===0x0){return db['UserProfileResource'][_0xdc4b('0x4c')]({'name':_0x55d8e4[_0xdc4b('0x2d')],'resourceId':_0x55d8e4['id'],'type':_0x2149c5[_0xdc4b('0x2d')],'sectionId':_0x2149c5['id']},{})['then'](function(){return _0x4883cd;});}else{return _0x4883cd;}})['catch'](function(_0x1a0f47){logger[_0xdc4b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a0f47);throw _0x1a0f47;});}return _0x4883cd;});}})[_0xdc4b('0x27')](respondWithResult(_0x1cc181,0xc9))[_0xdc4b('0x49')](handleError(_0x1cc181,null));};exports[_0xdc4b('0x26')]=function(_0x3b98ba,_0x4b8855){if(_0x3b98ba[_0xdc4b('0x4d')]['id']){delete _0x3b98ba[_0xdc4b('0x4d')]['id'];}return db[_0xdc4b('0x46')][_0xdc4b('0x53')]({'where':{'id':_0x3b98ba[_0xdc4b('0x4b')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x4b8855,null))['then'](saveUpdates(_0x3b98ba[_0xdc4b('0x4d')],null))[_0xdc4b('0x27')](respondWithResult(_0x4b8855,null))[_0xdc4b('0x49')](handleError(_0x4b8855,null));};exports['destroy']=function(_0x1cec6d,_0x145dc1){return db[_0xdc4b('0x46')][_0xdc4b('0x53')]({'where':{'id':_0x1cec6d[_0xdc4b('0x4b')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x145dc1,null))[_0xdc4b('0x27')](removeEntity(_0x145dc1,null))[_0xdc4b('0x49')](handleError(_0x145dc1,null));};function widgetAttributes(_0x3003da){try{switch(_0x3003da['type']){case _0xdc4b('0x5b'):return[{'name':_0xdc4b('0x5c'),'value':_0x3003da[_0xdc4b('0x5c')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da['attrs'][0x0][_0xdc4b('0x5e')]:undefined)||_0xdc4b('0x5f')}];case _0xdc4b('0x60'):return[{'name':_0xdc4b('0x61'),'value':_0x3003da[_0xdc4b('0x61')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da['attrs'][0x0][_0xdc4b('0x5e')]:undefined)||''}];case _0xdc4b('0x62'):return[{'name':_0xdc4b('0x63'),'value':_0x3003da[_0xdc4b('0x63')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da['attrs'][0x0][_0xdc4b('0x5e')]:undefined)||_0xdc4b('0x64')},{'name':_0xdc4b('0x65'),'value':_0x3003da['attrTimezone']||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x1]?_0x3003da[_0xdc4b('0x5d')][0x1][_0xdc4b('0x5e')]:undefined)||'0.00'},{'name':_0xdc4b('0x66'),'value':_0x3003da[_0xdc4b('0x66')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x2]?_0x3003da['attrs'][0x2][_0xdc4b('0x5e')]:undefined)||0xc}];case _0xdc4b('0x67'):return[{'name':_0xdc4b('0x68'),'value':_0x3003da[_0xdc4b('0x68')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da['attrs'][0x0][_0xdc4b('0x5e')]:undefined)||_0xdc4b('0x69')},{'name':_0xdc4b('0x6a'),'value':_0x3003da['attrVoiceQueues']||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x1]?_0x3003da[_0xdc4b('0x5d')][0x1]['value']:undefined)||[]},{'name':_0xdc4b('0x66'),'value':_0x3003da['attrFontSize']||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x2]?_0x3003da['attrs'][0x2][_0xdc4b('0x5e')]:undefined)||0x14}];case _0xdc4b('0x6b'):case _0xdc4b('0x6c'):return[{'name':'attrSerie1','value':_0x3003da['attrSerie1']||(_0x3003da['attrs']&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da['attrs'][0x0][_0xdc4b('0x5e')]:undefined)||_0xdc4b('0x69')},{'name':_0xdc4b('0x6d'),'value':_0x3003da[_0xdc4b('0x6d')]||(_0x3003da['attrs']&&_0x3003da['attrs'][0x1]?_0x3003da[_0xdc4b('0x5d')][0x1][_0xdc4b('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x3003da[_0xdc4b('0x6e')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x2]?_0x3003da[_0xdc4b('0x5d')][0x2][_0xdc4b('0x5e')]:undefined)||null},{'name':_0xdc4b('0x6a'),'value':_0x3003da[_0xdc4b('0x6a')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x3]?_0x3003da[_0xdc4b('0x5d')][0x3][_0xdc4b('0x5e')]:undefined)||[]}];case _0xdc4b('0x6f'):return[{'name':'attrReport','type':_0x3003da[_0xdc4b('0x70')]||(_0x3003da['attrs']&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da[_0xdc4b('0x5d')][0x0]['type']:undefined)||null,'value':_0x3003da['attrReport']||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x0]?_0x3003da[_0xdc4b('0x5d')][0x0][_0xdc4b('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x3003da[_0xdc4b('0x71')]||(_0x3003da[_0xdc4b('0x5d')]&&_0x3003da[_0xdc4b('0x5d')][0x1]?_0x3003da[_0xdc4b('0x5d')][0x1][_0xdc4b('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1da154){logger[_0xdc4b('0x2b')]('widgetAttributes:\x20%s',JSON[_0xdc4b('0x72')](_0x1da154));return[];}}exports[_0xdc4b('0x73')]=function(_0x1a5f66,_0x45f098,_0x31965d){if(_0x1a5f66[_0xdc4b('0x4d')]['id']){delete _0x1a5f66['body']['id'];}return db[_0xdc4b('0x46')][_0xdc4b('0x53')]({'where':{'id':_0x1a5f66[_0xdc4b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45f098,null))[_0xdc4b('0x27')](function(_0x3ae9f1){if(_0x3ae9f1){_0x1a5f66[_0xdc4b('0x4d')]['DashboardId']=_0x3ae9f1['id'];_0x1a5f66[_0xdc4b('0x4d')]['attrs']=widgetAttributes(_0x1a5f66[_0xdc4b('0x4d')]);return db[_0xdc4b('0x74')][_0xdc4b('0x4c')](_0x1a5f66['body']);}})['then'](respondWithResult(_0x45f098,null))[_0xdc4b('0x49')](handleError(_0x45f098,null));};exports[_0xdc4b('0x75')]=function(_0x2fabf6,_0x20eb6e,_0x5c9770){var _0x50f54c={};var _0x5a008a={};var _0xe56c49;var _0x4ebcff;return db[_0xdc4b('0x46')]['findOne']({'where':{'id':_0x2fabf6[_0xdc4b('0x4b')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x20eb6e,null))[_0xdc4b('0x27')](function(_0x362b8a){if(_0x362b8a){_0xe56c49=_0x362b8a;_0x5a008a[_0xdc4b('0x2f')]=_[_0xdc4b('0x30')](db[_0xdc4b('0x74')][_0xdc4b('0x2e')]);_0x5a008a[_0xdc4b('0x31')]=_[_0xdc4b('0x30')](_0x2fabf6['query']);_0x5a008a[_0xdc4b('0x32')]=_[_0xdc4b('0x33')](_0x5a008a[_0xdc4b('0x2f')],_0x5a008a[_0xdc4b('0x31')]);_0x50f54c[_0xdc4b('0x34')]=_[_0xdc4b('0x33')](_0x5a008a[_0xdc4b('0x2f')],qs[_0xdc4b('0x35')](_0x2fabf6[_0xdc4b('0x31')][_0xdc4b('0x35')]));_0x50f54c[_0xdc4b('0x34')]=_0x50f54c[_0xdc4b('0x34')][_0xdc4b('0x36')]?_0x50f54c[_0xdc4b('0x34')]:_0x5a008a[_0xdc4b('0x2f')];_0x50f54c[_0xdc4b('0x3a')]=qs[_0xdc4b('0x3b')](_0x2fabf6[_0xdc4b('0x31')][_0xdc4b('0x3b')]);_0x50f54c[_0xdc4b('0x3c')]=qs[_0xdc4b('0x32')](_[_0xdc4b('0x76')](_0x2fabf6[_0xdc4b('0x31')],_0x5a008a[_0xdc4b('0x32')]));if(_0x2fabf6['query'][_0xdc4b('0x3d')]){_0x50f54c['where']=_[_0xdc4b('0x3e')](_0x50f54c['where'],{'$or':_[_0xdc4b('0x3f')](_0x50f54c[_0xdc4b('0x34')],function(_0x5755ce){var _0x5932d0={};_0x5932d0[_0x5755ce]={'$like':'%'+_0x2fabf6[_0xdc4b('0x31')][_0xdc4b('0x3d')]+'%'};return _0x5932d0;})});}_0x50f54c=_['merge']({},_0x50f54c,_0x2fabf6[_0xdc4b('0x43')]);return _0xe56c49[_0xdc4b('0x75')](_0x50f54c);}})['then'](function(_0xd15e42){if(_0xd15e42){_0x4ebcff=_0xd15e42[_0xdc4b('0x36')];if(!_0x2fabf6[_0xdc4b('0x31')][_0xdc4b('0x37')](_0xdc4b('0x38'))){_0x50f54c['limit']=qs[_0xdc4b('0x39')](_0x2fabf6['query'][_0xdc4b('0x39')]);_0x50f54c[_0xdc4b('0x22')]=qs[_0xdc4b('0x22')](_0x2fabf6[_0xdc4b('0x31')]['offset']);}return _0xe56c49[_0xdc4b('0x75')](_0x50f54c);}})['then'](function(_0x3fa8d2){if(_0x3fa8d2){return _0x3fa8d2?{'count':_0x4ebcff,'rows':_0x3fa8d2}:null;}})['then'](respondWithResult(_0x20eb6e,null))[_0xdc4b('0x49')](handleError(_0x20eb6e,null));}; \ No newline at end of file +var _0xb53b=['socket.io-emitter','./dashboard.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','Dashboard','include','findAll','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrFontSize','counter','attrMetric','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','localhost'];(function(_0x989b44,_0x21e411){var _0x2d459d=function(_0x17b06d){while(--_0x17b06d){_0x989b44['push'](_0x989b44['shift']());}};_0x2d459d(++_0x21e411);}(_0xb53b,0xd7));var _0xbb53=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xb53b[_0x4e5552];return _0x60a338;};'use strict';var pdf=require(_0xbb53('0x0'));var emlformat=require(_0xbb53('0x1'));var rimraf=require(_0xbb53('0x2'));var zipdir=require(_0xbb53('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb53('0x4'));var moment=require(_0xbb53('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbb53('0x6'));var util=require(_0xbb53('0x7'));var path=require('path');var sox=require(_0xbb53('0x8'));var csv=require(_0xbb53('0x9'));var ejs=require(_0xbb53('0xa'));var fs=require('fs');var _=require(_0xbb53('0xb'));var squel=require(_0xbb53('0xc'));var crypto=require(_0xbb53('0xd'));var jsforce=require(_0xbb53('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb53('0x9'));var querystring=require('querystring');var Papa=require(_0xbb53('0xf'));var authService=require(_0xbb53('0x10'));var hardwareService=require(_0xbb53('0x11'));var Redis=require(_0xbb53('0x12'));var qs=require(_0xbb53('0x13'));var logger=require('../../config/logger')(_0xbb53('0x14'));var utils=require(_0xbb53('0x15'));var config=require('../../config/environment');var db=require(_0xbb53('0x16'))['db'];config[_0xbb53('0x17')]=_['defaults'](config[_0xbb53('0x17')],{'host':_0xbb53('0x18'),'port':0x18eb});var socket=require(_0xbb53('0x19'))(new Redis(config[_0xbb53('0x17')]));require(_0xbb53('0x1a'))[_0xbb53('0x1b')](socket);function respondWithStatusCode(_0x485207,_0x16bf76){_0x16bf76=_0x16bf76||0xcc;return function(_0x47c2e6){if(_0x47c2e6){return _0x485207['sendStatus'](_0x16bf76);}return _0x485207[_0xbb53('0x1c')](_0x16bf76)[_0xbb53('0x1d')]();};}function respondWithResult(_0x18e2b0,_0x410243){_0x410243=_0x410243||0xc8;return function(_0x5c637b){if(_0x5c637b){return _0x18e2b0[_0xbb53('0x1c')](_0x410243)['json'](_0x5c637b);}};}function respondWithFilteredResult(_0x3c6064,_0x5197b1){return function(_0x5b90e3){if(_0x5b90e3){var _0x213f59=_0x5b90e3[_0xbb53('0x1e')],_0x196938=_0x5197b1[_0xbb53('0x1f')],_0x546e60=_0x5197b1[_0xbb53('0x1f')]+_0x5197b1[_0xbb53('0x20')],_0x32e16a;if(_0x546e60>=_0x213f59){_0x546e60=_0x213f59;_0x32e16a=0xc8;}else{_0x32e16a=0xce;}_0x3c6064['status'](_0x32e16a);return _0x3c6064[_0xbb53('0x21')](_0xbb53('0x22'),_0x196938+'-'+_0x546e60+'/'+_0x213f59)[_0xbb53('0x23')](_0x5b90e3);}return null;};}function patchUpdates(_0x36ad53){return function(_0x53c006){try{jsonpatch[_0xbb53('0x24')](_0x53c006,_0x36ad53,!![]);}catch(_0x4ae2c4){return BPromise[_0xbb53('0x25')](_0x4ae2c4);}return _0x53c006[_0xbb53('0x26')]();};}function saveUpdates(_0x42ee66,_0x629e4c){return function(_0x180aa3){if(_0x180aa3){return _0x180aa3[_0xbb53('0x27')](_0x42ee66)['then'](function(_0x4484a7){return _0x4484a7;});}return null;};}function removeEntity(_0x5031a1,_0x58021f){return function(_0x173141){if(_0x173141){return _0x173141[_0xbb53('0x28')]()[_0xbb53('0x29')](function(){var _0x436739=_0x173141[_0xbb53('0x2a')]({'plain':!![]});var _0x30344e='CustomDashboards';return db[_0xbb53('0x2b')][_0xbb53('0x28')]({'where':{'type':_0x30344e,'resourceId':_0x436739['id']}})[_0xbb53('0x29')](function(){return _0x173141;});})[_0xbb53('0x29')](function(){_0x5031a1[_0xbb53('0x1c')](0xcc)[_0xbb53('0x1d')]();});}};}function handleEntityNotFound(_0x4d3f57,_0x337700){return function(_0x35f0a9){if(!_0x35f0a9){_0x4d3f57[_0xbb53('0x2c')](0x194);}return _0x35f0a9;};}function handleError(_0x1950fd,_0x55407f){_0x55407f=_0x55407f||0x1f4;return function(_0x2ae982){logger[_0xbb53('0x2d')](_0x2ae982['stack']);if(_0x2ae982[_0xbb53('0x2e')]){delete _0x2ae982[_0xbb53('0x2e')];}_0x1950fd['status'](_0x55407f)[_0xbb53('0x2f')](_0x2ae982);};}exports[_0xbb53('0x30')]=function(_0x3f8d87,_0x591ee3){var _0x530dee={},_0x49e905={},_0x45bb31={'count':0x0,'rows':[]};var _0x46fdc2=db['Dashboard'][_0xbb53('0x31')];_0x49e905[_0xbb53('0x32')]=_[_0xbb53('0x33')](_0x46fdc2);_0x49e905[_0xbb53('0x34')]=_['keys'](_0x3f8d87[_0xbb53('0x34')]);_0x49e905[_0xbb53('0x35')]=_[_0xbb53('0x36')](_0x49e905[_0xbb53('0x32')],_0x49e905[_0xbb53('0x34')]);_0x530dee[_0xbb53('0x37')]=_['intersection'](_0x49e905['model'],qs[_0xbb53('0x38')](_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x38')]));_0x530dee[_0xbb53('0x37')]=_0x530dee[_0xbb53('0x37')][_0xbb53('0x39')]?_0x530dee[_0xbb53('0x37')]:_0x49e905[_0xbb53('0x32')];if(!_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x3a')](_0xbb53('0x3b'))){_0x530dee[_0xbb53('0x20')]=qs[_0xbb53('0x20')](_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x20')]);_0x530dee[_0xbb53('0x1f')]=qs['offset'](_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x1f')]);}_0x530dee[_0xbb53('0x3c')]=qs['sort'](_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x3d')]);_0x530dee[_0xbb53('0x3e')]=qs[_0xbb53('0x35')](_[_0xbb53('0x3f')](_0x3f8d87[_0xbb53('0x34')],_0x49e905['filters']));if(_0x3f8d87['query']['filter']){_0x530dee[_0xbb53('0x3e')]=_['merge'](_0x530dee[_0xbb53('0x3e')],{'$or':_[_0xbb53('0x40')](_0x46fdc2,function(_0x3cf7b0){if(_0x3cf7b0[_0xbb53('0x41')][_0xbb53('0x42')]!==_0xbb53('0x43')){var _0x436bdb={};_0x436bdb[_0x3cf7b0[_0xbb53('0x44')]]={'$like':'%'+_0x3f8d87[_0xbb53('0x34')][_0xbb53('0x45')]+'%'};return _0x436bdb;}})});}_0x530dee=_[_0xbb53('0x46')]({},_0x530dee,_0x3f8d87['options']);var _0x60fa29={'where':_0x530dee[_0xbb53('0x3e')]};return db[_0xbb53('0x47')][_0xbb53('0x1e')](_0x60fa29)[_0xbb53('0x29')](function(_0x525764){_0x45bb31[_0xbb53('0x1e')]=_0x525764;if(_0x3f8d87[_0xbb53('0x34')]['includeAll']){_0x530dee[_0xbb53('0x48')]=[{'all':!![]}];}return db[_0xbb53('0x47')][_0xbb53('0x49')](_0x530dee);})[_0xbb53('0x29')](function(_0x78e8cb){_0x45bb31['rows']=_0x78e8cb;return _0x45bb31;})[_0xbb53('0x29')](respondWithFilteredResult(_0x591ee3,_0x530dee))[_0xbb53('0x4a')](handleError(_0x591ee3,null));};exports['show']=function(_0xa4e4cc,_0x3cccfb){var _0x5c01ac={'raw':![],'where':{'id':_0xa4e4cc[_0xbb53('0x4b')]['id']}},_0x20ce39={};_0x20ce39[_0xbb53('0x32')]=_[_0xbb53('0x33')](db['Dashboard'][_0xbb53('0x31')]);_0x20ce39[_0xbb53('0x34')]=_['keys'](_0xa4e4cc[_0xbb53('0x34')]);_0x20ce39[_0xbb53('0x35')]=_['intersection'](_0x20ce39[_0xbb53('0x32')],_0x20ce39[_0xbb53('0x34')]);_0x5c01ac[_0xbb53('0x37')]=_[_0xbb53('0x36')](_0x20ce39['model'],qs[_0xbb53('0x38')](_0xa4e4cc[_0xbb53('0x34')][_0xbb53('0x38')]));_0x5c01ac['attributes']=_0x5c01ac['attributes'][_0xbb53('0x39')]?_0x5c01ac[_0xbb53('0x37')]:_0x20ce39[_0xbb53('0x32')];if(_0xa4e4cc[_0xbb53('0x34')][_0xbb53('0x4c')]){_0x5c01ac[_0xbb53('0x48')]=[{'all':!![]}];}_0x5c01ac=_['merge']({},_0x5c01ac,_0xa4e4cc[_0xbb53('0x4d')]);return db[_0xbb53('0x47')][_0xbb53('0x4e')](_0x5c01ac)[_0xbb53('0x29')](handleEntityNotFound(_0x3cccfb,null))[_0xbb53('0x29')](respondWithResult(_0x3cccfb,null))[_0xbb53('0x4a')](handleError(_0x3cccfb,null));};exports['create']=function(_0x532d65,_0x8b464a){return db[_0xbb53('0x47')][_0xbb53('0x4f')](_0x532d65[_0xbb53('0x50')],{})[_0xbb53('0x29')](function(_0xaad957){var _0x3ef8c4=_0x532d65[_0xbb53('0x51')][_0xbb53('0x2a')]({'plain':!![]});if(!_0x3ef8c4)throw new Error(_0xbb53('0x52'));if(_0x3ef8c4[_0xbb53('0x53')]===_0xbb53('0x51')){var _0x282d99=_0xaad957['get']({'plain':!![]});var _0x7e52de=_0xbb53('0x54');return db[_0xbb53('0x55')]['find']({'where':{'name':_0x7e52de,'userProfileId':_0x3ef8c4['userProfileId']},'raw':!![]})['then'](function(_0x50dc38){if(_0x50dc38&&_0x50dc38[_0xbb53('0x56')]===0x0){return db['UserProfileResource'][_0xbb53('0x4f')]({'name':_0x282d99['name'],'resourceId':_0x282d99['id'],'type':_0x50dc38[_0xbb53('0x2e')],'sectionId':_0x50dc38['id']},{})[_0xbb53('0x29')](function(){return _0xaad957;});}else{return _0xaad957;}})[_0xbb53('0x4a')](function(_0x88921a){logger[_0xbb53('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x88921a);throw _0x88921a;});}return _0xaad957;})[_0xbb53('0x29')](respondWithResult(_0x8b464a,0xc9))[_0xbb53('0x4a')](handleError(_0x8b464a,null));};exports[_0xbb53('0x57')]=function(_0x43a3b5,_0x8af6a7){var _0x40e3e6={'raw':![],'where':{'id':_0x43a3b5[_0xbb53('0x4b')]['id']}},_0x4256c0={};_0x4256c0[_0xbb53('0x32')]=_[_0xbb53('0x33')](db[_0xbb53('0x47')][_0xbb53('0x31')]);_0x40e3e6[_0xbb53('0x37')]=_[_0xbb53('0x36')](_0x4256c0[_0xbb53('0x32')],qs[_0xbb53('0x38')](_0x43a3b5[_0xbb53('0x34')][_0xbb53('0x38')]));_0x40e3e6['attributes']=_0x40e3e6['attributes'][_0xbb53('0x39')]?_0x40e3e6[_0xbb53('0x37')]:_0x4256c0['model'];if(_0x43a3b5[_0xbb53('0x34')]['includeAll']){_0x40e3e6[_0xbb53('0x48')]=[{'all':!![]}];}_0x40e3e6=_['merge']({},_0x40e3e6,_0x43a3b5[_0xbb53('0x4d')]);return db[_0xbb53('0x47')][_0xbb53('0x4e')](_0x40e3e6)[_0xbb53('0x29')](handleEntityNotFound(_0x8af6a7,null))[_0xbb53('0x29')](function(_0x278168){if(_0x278168){var _0x598c65=_0x278168[_0xbb53('0x2a')]({'plain':!![]});_0x598c65=qs[_0xbb53('0x58')](_0x598c65,['id',_0xbb53('0x59'),_0xbb53('0x5a')]);_0x43a3b5['body']=_[_0xbb53('0x58')](_0x43a3b5['body'],['id',_0xbb53('0x59'),_0xbb53('0x5a')]);return db[_0xbb53('0x47')][_0xbb53('0x4f')](_[_0xbb53('0x46')](_0x598c65,_0x43a3b5[_0xbb53('0x50')]),{'include':_0x43a3b5[_0xbb53('0x34')][_0xbb53('0x4c')]?[{'all':!![]}]:undefined})[_0xbb53('0x29')](function(_0x2eb46a){var _0x6fd58f=_0x43a3b5['user']['get']({'plain':!![]});if(!_0x6fd58f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6fd58f[_0xbb53('0x53')]===_0xbb53('0x51')){var _0x3f72a8=_0x2eb46a['get']({'plain':!![]});var _0x495853=_0xbb53('0x54');return db['UserProfileSection']['find']({'where':{'name':_0x495853,'userProfileId':_0x6fd58f['userProfileId']},'raw':!![]})['then'](function(_0x6d036d){if(_0x6d036d&&_0x6d036d[_0xbb53('0x56')]===0x0){return db['UserProfileResource'][_0xbb53('0x4f')]({'name':_0x3f72a8[_0xbb53('0x2e')],'resourceId':_0x3f72a8['id'],'type':_0x6d036d[_0xbb53('0x2e')],'sectionId':_0x6d036d['id']},{})[_0xbb53('0x29')](function(){return _0x2eb46a;});}else{return _0x2eb46a;}})['catch'](function(_0x15d322){logger[_0xbb53('0x2d')](_0xbb53('0x5b'),_0x15d322);throw _0x15d322;});}return _0x2eb46a;});}})[_0xbb53('0x29')](respondWithResult(_0x8af6a7,0xc9))[_0xbb53('0x4a')](handleError(_0x8af6a7,null));};exports[_0xbb53('0x27')]=function(_0x6d9037,_0x5dc747){if(_0x6d9037[_0xbb53('0x50')]['id']){delete _0x6d9037[_0xbb53('0x50')]['id'];}return db['Dashboard'][_0xbb53('0x4e')]({'where':{'id':_0x6d9037['params']['id']}})[_0xbb53('0x29')](handleEntityNotFound(_0x5dc747,null))[_0xbb53('0x29')](saveUpdates(_0x6d9037[_0xbb53('0x50')],null))[_0xbb53('0x29')](respondWithResult(_0x5dc747,null))[_0xbb53('0x4a')](handleError(_0x5dc747,null));};exports[_0xbb53('0x28')]=function(_0x1f354a,_0x5993c3){return db['Dashboard']['find']({'where':{'id':_0x1f354a[_0xbb53('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5993c3,null))[_0xbb53('0x29')](removeEntity(_0x5993c3,null))[_0xbb53('0x4a')](handleError(_0x5993c3,null));};function widgetAttributes(_0x4c727e){try{switch(_0x4c727e[_0xbb53('0x41')]){case _0xbb53('0x5c'):return[{'name':'attrUrl','value':_0x4c727e[_0xbb53('0x5d')]||(_0x4c727e['attrs']&&_0x4c727e[_0xbb53('0x5e')][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0][_0xbb53('0x5f')]:undefined)||_0xbb53('0x60')}];case _0xbb53('0x61'):return[{'name':_0xbb53('0x62'),'value':_0x4c727e[_0xbb53('0x62')]||(_0x4c727e['attrs']&&_0x4c727e['attrs'][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0][_0xbb53('0x5f')]:undefined)||''}];case _0xbb53('0x63'):return[{'name':'attrHourFormat','value':_0x4c727e[_0xbb53('0x64')]||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x0]?_0x4c727e['attrs'][0x0][_0xbb53('0x5f')]:undefined)||_0xbb53('0x65')},{'name':'attrTimezone','value':_0x4c727e['attrTimezone']||(_0x4c727e['attrs']&&_0x4c727e[_0xbb53('0x5e')][0x1]?_0x4c727e['attrs'][0x1][_0xbb53('0x5f')]:undefined)||'0.00'},{'name':_0xbb53('0x66'),'value':_0x4c727e[_0xbb53('0x66')]||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x2]?_0x4c727e[_0xbb53('0x5e')][0x2][_0xbb53('0x5f')]:undefined)||0xc}];case _0xbb53('0x67'):return[{'name':'attrMetric','value':_0x4c727e[_0xbb53('0x68')]||(_0x4c727e['attrs']&&_0x4c727e[_0xbb53('0x5e')][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0][_0xbb53('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x4c727e['attrVoiceQueues']||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x1]?_0x4c727e['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x4c727e['attrFontSize']||(_0x4c727e['attrs']&&_0x4c727e[_0xbb53('0x5e')][0x2]?_0x4c727e[_0xbb53('0x5e')][0x2][_0xbb53('0x5f')]:undefined)||0x14}];case _0xbb53('0x69'):case'pie-chart':return[{'name':_0xbb53('0x6a'),'value':_0x4c727e[_0xbb53('0x6a')]||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e['attrs'][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0]['value']:undefined)||_0xbb53('0x6b')},{'name':_0xbb53('0x6c'),'value':_0x4c727e[_0xbb53('0x6c')]||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x1]?_0x4c727e[_0xbb53('0x5e')][0x1][_0xbb53('0x5f')]:undefined)||null},{'name':_0xbb53('0x6d'),'value':_0x4c727e['attrSerie3']||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x2]?_0x4c727e[_0xbb53('0x5e')][0x2][_0xbb53('0x5f')]:undefined)||null},{'name':_0xbb53('0x6e'),'value':_0x4c727e[_0xbb53('0x6e')]||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e['attrs'][0x3]?_0x4c727e[_0xbb53('0x5e')][0x3][_0xbb53('0x5f')]:undefined)||[]}];case _0xbb53('0x6f'):return[{'name':'attrReport','type':_0x4c727e[_0xbb53('0x70')]||(_0x4c727e['attrs']&&_0x4c727e[_0xbb53('0x5e')][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0][_0xbb53('0x41')]:undefined)||null,'value':_0x4c727e['attrReport']||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x0]?_0x4c727e[_0xbb53('0x5e')][0x0][_0xbb53('0x5f')]:undefined)||null},{'name':_0xbb53('0x71'),'value':_0x4c727e['attrRefresh']||(_0x4c727e[_0xbb53('0x5e')]&&_0x4c727e[_0xbb53('0x5e')][0x1]?_0x4c727e[_0xbb53('0x5e')][0x1][_0xbb53('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x1d95ed){logger['error'](_0xbb53('0x72'),JSON[_0xbb53('0x73')](_0x1d95ed));return[];}}exports[_0xbb53('0x74')]=function(_0x122e91,_0x12733f,_0x2ceb4d){if(_0x122e91[_0xbb53('0x50')]['id']){delete _0x122e91['body']['id'];}return db[_0xbb53('0x47')]['find']({'where':{'id':_0x122e91[_0xbb53('0x4b')]['id']}})[_0xbb53('0x29')](handleEntityNotFound(_0x12733f,null))['then'](function(_0x187449){if(_0x187449){_0x122e91[_0xbb53('0x50')]['DashboardId']=_0x187449['id'];_0x122e91[_0xbb53('0x50')]['attrs']=widgetAttributes(_0x122e91[_0xbb53('0x50')]);return db[_0xbb53('0x75')][_0xbb53('0x4f')](_0x122e91['body']);}})[_0xbb53('0x29')](respondWithResult(_0x12733f,null))[_0xbb53('0x4a')](handleError(_0x12733f,null));};exports[_0xbb53('0x76')]=function(_0x37b4d1,_0x9f038,_0x37266f){var _0x22079f={};var _0x3411ce={};var _0x17ca74;var _0x4c63d7;return db['Dashboard'][_0xbb53('0x77')]({'where':{'id':_0x37b4d1[_0xbb53('0x4b')]['id']}})[_0xbb53('0x29')](handleEntityNotFound(_0x9f038,null))[_0xbb53('0x29')](function(_0x5e94c6){if(_0x5e94c6){_0x17ca74=_0x5e94c6;_0x3411ce[_0xbb53('0x32')]=_[_0xbb53('0x33')](db[_0xbb53('0x75')][_0xbb53('0x31')]);_0x3411ce[_0xbb53('0x34')]=_[_0xbb53('0x33')](_0x37b4d1[_0xbb53('0x34')]);_0x3411ce[_0xbb53('0x35')]=_[_0xbb53('0x36')](_0x3411ce[_0xbb53('0x32')],_0x3411ce[_0xbb53('0x34')]);_0x22079f['attributes']=_['intersection'](_0x3411ce[_0xbb53('0x32')],qs[_0xbb53('0x38')](_0x37b4d1[_0xbb53('0x34')][_0xbb53('0x38')]));_0x22079f['attributes']=_0x22079f[_0xbb53('0x37')][_0xbb53('0x39')]?_0x22079f[_0xbb53('0x37')]:_0x3411ce[_0xbb53('0x32')];_0x22079f['order']=qs[_0xbb53('0x3d')](_0x37b4d1[_0xbb53('0x34')][_0xbb53('0x3d')]);_0x22079f[_0xbb53('0x3e')]=qs['filters'](_[_0xbb53('0x3f')](_0x37b4d1[_0xbb53('0x34')],_0x3411ce[_0xbb53('0x35')]));if(_0x37b4d1['query']['filter']){_0x22079f[_0xbb53('0x3e')]=_['merge'](_0x22079f[_0xbb53('0x3e')],{'$or':_[_0xbb53('0x40')](_0x22079f[_0xbb53('0x37')],function(_0x4c9d0c){var _0x3b197d={};_0x3b197d[_0x4c9d0c]={'$like':'%'+_0x37b4d1[_0xbb53('0x34')]['filter']+'%'};return _0x3b197d;})});}_0x22079f=_[_0xbb53('0x46')]({},_0x22079f,_0x37b4d1['options']);return _0x17ca74[_0xbb53('0x76')](_0x22079f);}})[_0xbb53('0x29')](function(_0x437a84){if(_0x437a84){_0x4c63d7=_0x437a84['length'];if(!_0x37b4d1[_0xbb53('0x34')][_0xbb53('0x3a')](_0xbb53('0x3b'))){_0x22079f['limit']=qs[_0xbb53('0x20')](_0x37b4d1[_0xbb53('0x34')]['limit']);_0x22079f[_0xbb53('0x1f')]=qs[_0xbb53('0x1f')](_0x37b4d1['query']['offset']);}return _0x17ca74[_0xbb53('0x76')](_0x22079f);}})[_0xbb53('0x29')](function(_0x214a5b){if(_0x214a5b){return _0x214a5b?{'count':_0x4c63d7,'rows':_0x214a5b}:null;}})['then'](respondWithResult(_0x9f038,null))[_0xbb53('0x4a')](handleError(_0x9f038,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 69a37e7..c2b0498 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 _0xa46d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Dashboard'];(function(_0xbf6f32,_0x3d793a){var _0x1d3ecc=function(_0x2f236e){while(--_0x2f236e){_0xbf6f32['push'](_0xbf6f32['shift']());}};_0x1d3ecc(++_0x3d793a);}(_0xa46d,0x143));var _0xda46=function(_0x44172a,_0x556499){_0x44172a=_0x44172a-0x0;var _0x1480d5=_0xa46d[_0x44172a];return _0x1480d5;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xda46('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xda46('0x1')](0x0);var events={'afterCreate':_0xda46('0x2'),'afterUpdate':_0xda46('0x3'),'afterDestroy':_0xda46('0x4')};function emitEvent(_0x36443f){return function(_0x48036c,_0x43e930,_0x1b4e8a){DashboardEvents[_0xda46('0x5')](_0x36443f+':'+_0x48036c['id'],_0x48036c);DashboardEvents[_0xda46('0x5')](_0x36443f,_0x48036c);_0x1b4e8a(null);};}for(var e in events){if(events[_0xda46('0x6')](e)){var event=events[e];Dashboard[_0xda46('0x7')](e,emitEvent(event));}}module[_0xda46('0x8')]=DashboardEvents; \ No newline at end of file +var _0xe801=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0xe801,0x195));var _0x1e80=function(_0x1659f2,_0x4d8f99){_0x1659f2=_0x1659f2-0x0;var _0x11c54f=_0xe801[_0x1659f2];return _0x11c54f;};'use strict';var EventEmitter=require(_0x1e80('0x0'));var Dashboard=require(_0x1e80('0x1'))['db'][_0x1e80('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1e80('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e80('0x4'),'afterDestroy':_0x1e80('0x5')};function emitEvent(_0x200fd7){return function(_0x10cfb4,_0x48e904,_0x5e59ea){DashboardEvents[_0x1e80('0x6')](_0x200fd7+':'+_0x10cfb4['id'],_0x10cfb4);DashboardEvents[_0x1e80('0x6')](_0x200fd7,_0x10cfb4);_0x5e59ea(null);};}for(var e in events){if(events[_0x1e80('0x7')](e)){var event=events[e];Dashboard[_0x1e80('0x8')](e,emitEvent(event));}}module[_0x1e80('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 31a1b03..c738b2f 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 _0xb4b6=['bluebird','request-promise','./dashboard.attributes','exports','define','dashboards','util','../../config/logger','api','moment'];(function(_0x3506be,_0xbfe0b){var _0x594c11=function(_0x43e517){while(--_0x43e517){_0x3506be['push'](_0x3506be['shift']());}};_0x594c11(++_0xbfe0b);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x5a4420,_0x2b3bd4){_0x5a4420=_0x5a4420-0x0;var _0x361d8f=_0xb4b6[_0x5a4420];return _0x361d8f;};'use strict';var _=require('lodash');var util=require(_0x6b4b('0x0'));var logger=require(_0x6b4b('0x1'))(_0x6b4b('0x2'));var moment=require(_0x6b4b('0x3'));var BPromise=require(_0x6b4b('0x4'));var rp=require(_0x6b4b('0x5'));var attributes=require(_0x6b4b('0x6'));module[_0x6b4b('0x7')]=function(_0x422b21,_0x562733){return _0x422b21[_0x6b4b('0x8')]('Dashboard',attributes,{'tableName':_0x6b4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5853=['request-promise','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x567f0e,_0x2be7a0){var _0x15aca8=function(_0x1e6ca6){while(--_0x1e6ca6){_0x567f0e['push'](_0x567f0e['shift']());}};_0x15aca8(++_0x2be7a0);}(_0x5853,0x113));var _0x3585=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x5853[_0x65c0bb];return _0x320bd5;};'use strict';var _=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var logger=require(_0x3585('0x2'))(_0x3585('0x3'));var moment=require(_0x3585('0x4'));var BPromise=require('bluebird');var rp=require(_0x3585('0x5'));var attributes=require(_0x3585('0x6'));module[_0x3585('0x7')]=function(_0x3d6263,_0x336ef2){return _0x3d6263[_0x3585('0x8')]('Dashboard',attributes,{'tableName':_0x3585('0x9'),'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 25b471a..778ab3e 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 _0x9572=['jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x9572,0x16f));var _0x2957=function(_0x1ea709,_0xc883ee){_0x1ea709=_0x1ea709-0x0;var _0x44efe7=_0x9572[_0x1ea709];return _0x44efe7;};'use strict';var _=require('lodash');var util=require(_0x2957('0x0'));var moment=require(_0x2957('0x1'));var BPromise=require(_0x2957('0x2'));var rs=require(_0x2957('0x3'));var fs=require('fs');var Redis=require(_0x2957('0x4'));var db=require(_0x2957('0x5'))['db'];var utils=require(_0x2957('0x6'));var logger=require(_0x2957('0x7'))(_0x2957('0x8'));var config=require(_0x2957('0x9'));var jayson=require(_0x2957('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x2957('0xb')]=_[_0x2957('0xc')](config['redis'],{'host':_0x2957('0xd'),'port':0x18eb});var socket=require(_0x2957('0xe'))(new Redis(config['redis']));require(_0x2957('0xf'))['register'](socket);function respondWithRpcPromise(_0x59fca8,_0x47b20d,_0x448fd6){return new BPromise(function(_0x931101,_0x80dda5){return client[_0x2957('0x10')](_0x59fca8,_0x448fd6)[_0x2957('0x11')](function(_0x599b93){logger[_0x2957('0x12')]('Dashboard,\x20%s,\x20%s',_0x47b20d,_0x2957('0x13'));logger[_0x2957('0x14')](_0x2957('0x15'),_0x47b20d,_0x2957('0x13'),JSON[_0x2957('0x16')](_0x599b93));if(_0x599b93[_0x2957('0x17')]){if(_0x599b93[_0x2957('0x17')][_0x2957('0x18')]===0x1f4){logger[_0x2957('0x17')](_0x2957('0x19'),_0x47b20d,_0x599b93['error']['message']);return _0x80dda5(_0x599b93[_0x2957('0x17')][_0x2957('0x1a')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x47b20d,_0x599b93[_0x2957('0x17')]['message']);return _0x931101(_0x599b93[_0x2957('0x17')]['message']);}else{logger[_0x2957('0x12')](_0x2957('0x19'),_0x47b20d,_0x2957('0x13'));_0x931101(_0x599b93[_0x2957('0x1b')][_0x2957('0x1a')]);}})[_0x2957('0x1c')](function(_0x3cfdef){logger[_0x2957('0x17')]('Dashboard,\x20%s,\x20%s',_0x47b20d,_0x3cfdef);_0x80dda5(_0x3cfdef);});});} \ No newline at end of file +var _0xd7c6=['../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x503218,_0x1ec947){var _0x3daf97=function(_0x144bd6){while(--_0x144bd6){_0x503218['push'](_0x503218['shift']());}};_0x3daf97(++_0x1ec947);}(_0xd7c6,0x1d4));var _0x6d7c=function(_0x4f0ea5,_0x142b5b){_0x4f0ea5=_0x4f0ea5-0x0;var _0xd7ebef=_0xd7c6[_0x4f0ea5];return _0xd7ebef;};'use strict';var _=require('lodash');var util=require(_0x6d7c('0x0'));var moment=require(_0x6d7c('0x1'));var BPromise=require(_0x6d7c('0x2'));var rs=require(_0x6d7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d7c('0x4'));var logger=require(_0x6d7c('0x5'))(_0x6d7c('0x6'));var config=require(_0x6d7c('0x7'));var jayson=require(_0x6d7c('0x8'));var client=jayson[_0x6d7c('0x9')]['http']({'port':0x232a});config[_0x6d7c('0xa')]=_[_0x6d7c('0xb')](config[_0x6d7c('0xa')],{'host':_0x6d7c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d7c('0xa')]));require(_0x6d7c('0xd'))['register'](socket);function respondWithRpcPromise(_0x5cdd65,_0x184b32,_0x4eb777){return new BPromise(function(_0x3311c2,_0x14cc1f){return client['request'](_0x5cdd65,_0x4eb777)[_0x6d7c('0xe')](function(_0x408ae0){logger[_0x6d7c('0xf')](_0x6d7c('0x10'),_0x184b32,_0x6d7c('0x11'));logger['debug'](_0x6d7c('0x12'),_0x184b32,'request\x20sent',JSON[_0x6d7c('0x13')](_0x408ae0));if(_0x408ae0[_0x6d7c('0x14')]){if(_0x408ae0[_0x6d7c('0x14')][_0x6d7c('0x15')]===0x1f4){logger[_0x6d7c('0x14')](_0x6d7c('0x10'),_0x184b32,_0x408ae0[_0x6d7c('0x14')][_0x6d7c('0x16')]);return _0x14cc1f(_0x408ae0[_0x6d7c('0x14')][_0x6d7c('0x16')]);}logger[_0x6d7c('0x14')](_0x6d7c('0x10'),_0x184b32,_0x408ae0[_0x6d7c('0x14')][_0x6d7c('0x16')]);return _0x3311c2(_0x408ae0[_0x6d7c('0x14')][_0x6d7c('0x16')]);}else{logger[_0x6d7c('0xf')](_0x6d7c('0x10'),_0x184b32,_0x6d7c('0x11'));_0x3311c2(_0x408ae0[_0x6d7c('0x17')][_0x6d7c('0x16')]);}})[_0x6d7c('0x18')](function(_0x340f23){logger['error'](_0x6d7c('0x10'),_0x184b32,_0x340f23);_0x14cc1f(_0x340f23);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 873c709..cd4913d 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 _0x72d5=['remove','update','emit','removeListener','length','dashboard:','./dashboard.events','save'];(function(_0x24a202,_0x3889ba){var _0x4dc4df=function(_0x4abcb8){while(--_0x4abcb8){_0x24a202['push'](_0x24a202['shift']());}};_0x4dc4df(++_0x3889ba);}(_0x72d5,0x186));var _0x572d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72d5[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0x572d('0x0'));var events=[_0x572d('0x1'),_0x572d('0x2'),_0x572d('0x3')];function createListener(_0x562aa7,_0xd76be7){return function(_0x395583){_0xd76be7[_0x572d('0x4')](_0x562aa7,_0x395583);};}function removeListener(_0x31bf3f,_0x3ad42e){return function(){DashboardEvents[_0x572d('0x5')](_0x31bf3f,_0x3ad42e);};}exports['register']=function(_0x5c70c4){for(var _0x2c1300=0x0,_0x2342ae=events[_0x572d('0x6')];_0x2c1300<_0x2342ae;_0x2c1300++){var _0x4139be=events[_0x2c1300];var _0x3a3cb8=createListener(_0x572d('0x7')+_0x4139be,_0x5c70c4);DashboardEvents['on'](_0x4139be,_0x3a3cb8);}}; \ No newline at end of file +var _0xe44e=['emit','removeListener','register','length','./dashboard.events','remove','update'];(function(_0x374e6f,_0x3b9686){var _0x2be482=function(_0x139f9b){while(--_0x139f9b){_0x374e6f['push'](_0x374e6f['shift']());}};_0x2be482(++_0x3b9686);}(_0xe44e,0xd6));var _0xee44=function(_0x46d713,_0x476013){_0x46d713=_0x46d713-0x0;var _0x190b2f=_0xe44e[_0x46d713];return _0x190b2f;};'use strict';var DashboardEvents=require(_0xee44('0x0'));var events=['save',_0xee44('0x1'),_0xee44('0x2')];function createListener(_0x5e4b60,_0x57f8ac){return function(_0x2f4a9f){_0x57f8ac[_0xee44('0x3')](_0x5e4b60,_0x2f4a9f);};}function removeListener(_0x4a9895,_0x452ae5){return function(){DashboardEvents[_0xee44('0x4')](_0x4a9895,_0x452ae5);};}exports[_0xee44('0x5')]=function(_0x3871d4){for(var _0x4e7071=0x0,_0x597e80=events[_0xee44('0x6')];_0x4e7071<_0x597e80;_0x4e7071++){var _0x23c13e=events[_0x4e7071];var _0x350c40=createListener('dashboard:'+_0x23c13e,_0x3871d4);DashboardEvents['on'](_0x23c13e,_0x350c40);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 395e8c5..095c5c0 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 _0xea66=['post','create','clone','addItem','put','/:id','update','delete','util','connect-timeout','express','Router','../../components/interaction/service','index','isAuthenticated','get','/:id/items','getItems'];(function(_0x46f379,_0x571ddc){var _0x1c5b4e=function(_0x513751){while(--_0x513751){_0x46f379['push'](_0x46f379['shift']());}};_0x1c5b4e(++_0x571ddc);}(_0xea66,0xbc));var _0x6ea6=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0xea66[_0x1b2255];return _0x33e57d;};'use strict';var multer=require('multer');var util=require(_0x6ea6('0x0'));var path=require('path');var timeout=require(_0x6ea6('0x1'));var express=require(_0x6ea6('0x2'));var router=express[_0x6ea6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ea6('0x4'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6ea6('0x5')]);router['get']('/:id',auth[_0x6ea6('0x6')](),controller['show']);router[_0x6ea6('0x7')](_0x6ea6('0x8'),auth['isAuthenticated'](),controller[_0x6ea6('0x9')]);router[_0x6ea6('0xa')]('/',auth[_0x6ea6('0x6')](),controller[_0x6ea6('0xb')]);router[_0x6ea6('0xa')]('/:id/clone',auth[_0x6ea6('0x6')](),controller[_0x6ea6('0xc')]);router['post'](_0x6ea6('0x8'),auth[_0x6ea6('0x6')](),controller[_0x6ea6('0xd')]);router[_0x6ea6('0xe')](_0x6ea6('0xf'),auth[_0x6ea6('0x6')](),controller[_0x6ea6('0x10')]);router[_0x6ea6('0x11')](_0x6ea6('0xf'),auth[_0x6ea6('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc75c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x150c65,_0x303f38){var _0x4ca489=function(_0x2c2e26){while(--_0x2c2e26){_0x150c65['push'](_0x150c65['shift']());}};_0x4ca489(++_0x303f38);}(_0xc75c,0xb4));var _0xcc75=function(_0x51380e,_0x55b897){_0x51380e=_0x51380e-0x0;var _0x2ed390=_0xc75c[_0x51380e];return _0x2ed390;};'use strict';var multer=require(_0xcc75('0x0'));var util=require(_0xcc75('0x1'));var path=require(_0xcc75('0x2'));var timeout=require(_0xcc75('0x3'));var express=require('express');var router=express[_0xcc75('0x4')]();var auth=require(_0xcc75('0x5'));var interaction=require(_0xcc75('0x6'));var config=require(_0xcc75('0x7'));var controller=require(_0xcc75('0x8'));router[_0xcc75('0x9')]('/',auth['isAuthenticated'](),controller[_0xcc75('0xa')]);router[_0xcc75('0x9')](_0xcc75('0xb'),auth[_0xcc75('0xc')](),controller['show']);router[_0xcc75('0x9')]('/:id/items',auth[_0xcc75('0xc')](),controller['getItems']);router[_0xcc75('0xd')]('/',auth['isAuthenticated'](),controller[_0xcc75('0xe')]);router[_0xcc75('0xd')](_0xcc75('0xf'),auth[_0xcc75('0xc')](),controller[_0xcc75('0x10')]);router[_0xcc75('0xd')]('/:id/items',auth[_0xcc75('0xc')](),controller[_0xcc75('0x11')]);router[_0xcc75('0x12')](_0xcc75('0xb'),auth[_0xcc75('0xc')](),controller[_0xcc75('0x13')]);router[_0xcc75('0x14')](_0xcc75('0xb'),auth[_0xcc75('0xc')](),controller[_0xcc75('0x15')]);module[_0xcc75('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index eff3cf1..1b149fb 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 _0x10f6=['stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','exports','STRING','TEXT','long','attrs','setDataValue'];(function(_0x53febd,_0x43ebfd){var _0xfbf2a5=function(_0x116412){while(--_0x116412){_0x53febd['push'](_0x53febd['shift']());}};_0xfbf2a5(++_0x43ebfd);}(_0x10f6,0x1b4));var _0x610f=function(_0x180191,_0x3d2448){_0x180191=_0x180191-0x0;var _0x3c9c67=_0x10f6[_0x180191];return _0x3c9c67;};'use strict';var Sequelize=require(_0x610f('0x0'));var squel=require(_0x610f('0x1'));var _=require('lodash');module[_0x610f('0x2')]={'title':{'type':Sequelize[_0x610f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x610f('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x610f('0x4')](_0x610f('0x5')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x37084b){return[];}},'set':function(_0xcbe6ba){try{this['setDataValue'](_0x610f('0x6'),JSON['stringify'](_0xcbe6ba));}catch(_0x422842){this[_0x610f('0x7')](_0x610f('0x6'),JSON[_0x610f('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x610f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x610f('0x9')]},'background':{'type':Sequelize[_0x610f('0x3')],'allowNull':![],'defaultValue':_0x610f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x610f('0x3')],'allowNull':![],'defaultValue':_0x610f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x610f('0x3')]}}; \ No newline at end of file +var _0xef74=['long','parse','getDataValue','setDataValue','stringify','attrs','INTEGER','squel','exports','STRING','TEXT'];(function(_0x5ae570,_0x501128){var _0x523b23=function(_0x8d3f1a){while(--_0x8d3f1a){_0x5ae570['push'](_0x5ae570['shift']());}};_0x523b23(++_0x501128);}(_0xef74,0x19e));var _0x4ef7=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xef74[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x4ef7('0x0'));var _=require('lodash');module[_0x4ef7('0x1')]={'title':{'type':Sequelize[_0x4ef7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4ef7('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4ef7('0x3')](_0x4ef7('0x4')),'get':function(){try{return JSON[_0x4ef7('0x5')](this[_0x4ef7('0x6')]('attrs'));}catch(_0x440e2d){return[];}},'set':function(_0x3f3ed7){try{this[_0x4ef7('0x7')]('attrs',JSON[_0x4ef7('0x8')](_0x3f3ed7));}catch(_0x4c39db){this[_0x4ef7('0x7')](_0x4ef7('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4ef7('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4ef7('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4ef7('0xa')]},'col':{'type':Sequelize[_0x4ef7('0xa')]},'background':{'type':Sequelize[_0x4ef7('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4ef7('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4ef7('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index aa42a37..291ef1a 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 _0x53ec=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','body','create','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce'];(function(_0x1df828,_0x42d369){var _0x173712=function(_0x15d7d0){while(--_0x15d7d0){_0x1df828['push'](_0x1df828['shift']());}};_0x173712(++_0x42d369);}(_0x53ec,0x192));var _0xc53e=function(_0x298510,_0x21b06b){_0x298510=_0x298510-0x0;var _0x51f279=_0x53ec[_0x298510];return _0x51f279;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var authService=require(_0xc53e('0x10'));var hardwareService=require(_0xc53e('0x11'));var Redis=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc53e('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc53e('0x15')]=_[_0xc53e('0x16')](config[_0xc53e('0x15')],{'host':_0xc53e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc53e('0x18'))[_0xc53e('0x19')](socket);function respondWithStatusCode(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xcc;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x1a')](_0x3d2e17);}return _0x7cd798[_0xc53e('0x1b')](_0x3d2e17)[_0xc53e('0x1c')]();};}function respondWithResult(_0x455e4d,_0x2ad6eb){_0x2ad6eb=_0x2ad6eb||0xc8;return function(_0x5b0a88){if(_0x5b0a88){return _0x455e4d[_0xc53e('0x1b')](_0x2ad6eb)[_0xc53e('0x1d')](_0x5b0a88);}};}function respondWithFilteredResult(_0x535cd4,_0x261c6c){return function(_0x15333b){if(_0x15333b){var _0x270c78=_0x15333b['count'],_0x164016=_0x261c6c['offset'],_0x2d4ebb=_0x261c6c[_0xc53e('0x1e')]+_0x261c6c[_0xc53e('0x1f')],_0x3b550e;if(_0x2d4ebb>=_0x270c78){_0x2d4ebb=_0x270c78;_0x3b550e=0xc8;}else{_0x3b550e=0xce;}_0x535cd4[_0xc53e('0x1b')](_0x3b550e);return _0x535cd4[_0xc53e('0x20')](_0xc53e('0x21'),_0x164016+'-'+_0x2d4ebb+'/'+_0x270c78)[_0xc53e('0x1d')](_0x15333b);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x22')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x23')](_0x401af6);}return _0x25702b[_0xc53e('0x24')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x25')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x1a')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['show']=function(_0x24a77e,_0x5112d2){var _0x5ce216={'raw':![],'where':{'id':_0x24a77e[_0xc53e('0x28')]['id']}},_0x8f0ee6={};_0x8f0ee6[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x24a77e['query']);_0x8f0ee6[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x8f0ee6[_0xc53e('0x29')],_0x8f0ee6['query']);_0x5ce216[_0xc53e('0x30')]=_['intersection'](_0x8f0ee6[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x24a77e['query']['fields']));_0x5ce216[_0xc53e('0x30')]=_0x5ce216[_0xc53e('0x30')][_0xc53e('0x32')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x29')];if(_0x24a77e[_0xc53e('0x2d')][_0xc53e('0x33')]){_0x5ce216[_0xc53e('0x34')]=[{'all':!![]}];}_0x5ce216=_['merge']({},_0x5ce216,_0x24a77e[_0xc53e('0x35')]);return db[_0xc53e('0x2b')][_0xc53e('0x36')](_0x5ce216)[_0xc53e('0x25')](handleEntityNotFound(_0x5112d2,null))[_0xc53e('0x25')](respondWithResult(_0x5112d2,null))[_0xc53e('0x37')](handleError(_0x5112d2,null));};exports[_0xc53e('0x38')]=function(_0x16942c,_0x215abe){return db['DashboardItem'][_0xc53e('0x36')]({'where':{'id':_0x16942c['params']['id']}})[_0xc53e('0x25')](handleEntityNotFound(_0x215abe,null))[_0xc53e('0x25')](removeEntity(_0x215abe,null))['catch'](handleError(_0x215abe,null));};function widgetAttributes(_0x37452a){try{switch(_0x37452a[_0xc53e('0x39')]){case _0xc53e('0x3a'):return[{'name':'attrUrl','value':_0x37452a[_0xc53e('0x3b')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a[_0xc53e('0x3c')][0x0][_0xc53e('0x3d')]:undefined)||_0xc53e('0x3e')}];case _0xc53e('0x3f'):return[{'name':'attrPath','value':_0x37452a[_0xc53e('0x40')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a['attrs'][0x0][_0xc53e('0x3d')]:undefined)||''}];case'clock':return[{'name':_0xc53e('0x41'),'value':_0x37452a[_0xc53e('0x41')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a[_0xc53e('0x3c')][0x0]['value']:undefined)||_0xc53e('0x42')},{'name':_0xc53e('0x43'),'value':_0x37452a['attrTimezone']||(_0x37452a['attrs']&&_0x37452a['attrs'][0x1]?_0x37452a['attrs'][0x1][_0xc53e('0x3d')]:undefined)||_0xc53e('0x44')},{'name':'attrFontSize','value':_0x37452a[_0xc53e('0x45')]||(_0x37452a['attrs']&&_0x37452a['attrs'][0x2]?_0x37452a['attrs'][0x2][_0xc53e('0x3d')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x37452a[_0xc53e('0x46')]||(_0x37452a['attrs']&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a[_0xc53e('0x3c')][0x0]['value']:undefined)||_0xc53e('0x47')},{'name':_0xc53e('0x48'),'value':_0x37452a['attrVoiceQueues']||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a['attrs'][0x1]?_0x37452a['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x37452a[_0xc53e('0x45')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x2]?_0x37452a['attrs'][0x2][_0xc53e('0x3d')]:undefined)||0x14}];case _0xc53e('0x49'):case'pie-chart':return[{'name':'attrSerie1','value':_0x37452a[_0xc53e('0x4a')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a['attrs'][0x0][_0xc53e('0x3d')]:undefined)||_0xc53e('0x47')},{'name':_0xc53e('0x4b'),'value':_0x37452a[_0xc53e('0x4b')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x1]?_0x37452a[_0xc53e('0x3c')][0x1]['value']:undefined)||null},{'name':_0xc53e('0x4c'),'value':_0x37452a[_0xc53e('0x4c')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a['attrs'][0x2]?_0x37452a[_0xc53e('0x3c')][0x2][_0xc53e('0x3d')]:undefined)||null},{'name':_0xc53e('0x48'),'value':_0x37452a[_0xc53e('0x48')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x3]?_0x37452a['attrs'][0x3][_0xc53e('0x3d')]:undefined)||[]}];case _0xc53e('0x4d'):return[{'name':_0xc53e('0x4e'),'type':_0x37452a['reportType']||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a[_0xc53e('0x3c')][0x0][_0xc53e('0x39')]:undefined)||null,'value':_0x37452a[_0xc53e('0x4e')]||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x0]?_0x37452a[_0xc53e('0x3c')][0x0][_0xc53e('0x3d')]:undefined)||null},{'name':_0xc53e('0x4f'),'value':_0x37452a['attrRefresh']||(_0x37452a[_0xc53e('0x3c')]&&_0x37452a[_0xc53e('0x3c')][0x1]?_0x37452a[_0xc53e('0x3c')][0x1][_0xc53e('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x136544){logger['error']('widgetAttributes:\x20%s',JSON[_0xc53e('0x50')](_0x136544));return[];}}exports['create']=function(_0x15c91b,_0x575a13){if(_0x15c91b[_0xc53e('0x51')]){_0x15c91b[_0xc53e('0x51')][_0xc53e('0x3c')]=widgetAttributes(_0x15c91b['body']);}return db[_0xc53e('0x2b')][_0xc53e('0x52')](_0x15c91b[_0xc53e('0x51')],{})['then'](respondWithResult(_0x575a13,0xc9))[_0xc53e('0x37')](handleError(_0x575a13,null));};exports['update']=function(_0x2be75c,_0x3f1ca5){if(_0x2be75c['body']['id']){delete _0x2be75c[_0xc53e('0x51')]['id'];}_0x2be75c[_0xc53e('0x51')]['attrs']=widgetAttributes(_0x2be75c[_0xc53e('0x51')]);return db[_0xc53e('0x2b')][_0xc53e('0x36')]({'where':{'id':_0x2be75c[_0xc53e('0x28')]['id']}})[_0xc53e('0x25')](handleEntityNotFound(_0x3f1ca5,null))[_0xc53e('0x25')](saveUpdates(_0x2be75c[_0xc53e('0x51')],null))[_0xc53e('0x25')](respondWithResult(_0x3f1ca5,null))[_0xc53e('0x37')](handleError(_0x3f1ca5,null));}; \ No newline at end of file +var _0xfaf3=['attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','show','model','DashboardItem','rawAttributes','query','keys','intersection','fields','attributes','length','include','merge','find','catch','destroy','params','type','iframe','attrUrl','attrs','https://','custom'];(function(_0x4d7826,_0x8a215d){var _0x5a2d62=function(_0x5e84a8){while(--_0x5e84a8){_0x4d7826['push'](_0x4d7826['shift']());}};_0x5a2d62(++_0x8a215d);}(_0xfaf3,0x118));var _0x3faf=function(_0x28b753,_0x3e6bf6){_0x28b753=_0x28b753-0x0;var _0x5a428e=_0xfaf3[_0x28b753];return _0x5a428e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3faf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3faf('0x1'));var moment=require(_0x3faf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3faf('0x3'));var util=require(_0x3faf('0x4'));var path=require(_0x3faf('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3faf('0x6'));var fs=require('fs');var _=require(_0x3faf('0x7'));var squel=require(_0x3faf('0x8'));var crypto=require(_0x3faf('0x9'));var jsforce=require(_0x3faf('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3faf('0xb'));var Papa=require(_0x3faf('0xc'));var authService=require(_0x3faf('0xd'));var hardwareService=require(_0x3faf('0xe'));var Redis=require(_0x3faf('0xf'));var qs=require(_0x3faf('0x10'));var logger=require(_0x3faf('0x11'))(_0x3faf('0x12'));var utils=require(_0x3faf('0x13'));var config=require('../../config/environment');var db=require(_0x3faf('0x14'))['db'];config['redis']=_[_0x3faf('0x15')](config[_0x3faf('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x3faf('0x17'))(new Redis(config[_0x3faf('0x16')]));require(_0x3faf('0x18'))[_0x3faf('0x19')](socket);function respondWithStatusCode(_0xef1aa6,_0x4802a5){_0x4802a5=_0x4802a5||0xcc;return function(_0x26379b){if(_0x26379b){return _0xef1aa6[_0x3faf('0x1a')](_0x4802a5);}return _0xef1aa6[_0x3faf('0x1b')](_0x4802a5)[_0x3faf('0x1c')]();};}function respondWithResult(_0x3a3aef,_0x46eafa){_0x46eafa=_0x46eafa||0xc8;return function(_0x5aa9a2){if(_0x5aa9a2){return _0x3a3aef[_0x3faf('0x1b')](_0x46eafa)[_0x3faf('0x1d')](_0x5aa9a2);}};}function respondWithFilteredResult(_0x5631b7,_0x5f0fb6){return function(_0x44fd4d){if(_0x44fd4d){var _0x2131c7=_0x44fd4d[_0x3faf('0x1e')],_0x500b97=_0x5f0fb6['offset'],_0x9cdc45=_0x5f0fb6[_0x3faf('0x1f')]+_0x5f0fb6[_0x3faf('0x20')],_0x1e3e73;if(_0x9cdc45>=_0x2131c7){_0x9cdc45=_0x2131c7;_0x1e3e73=0xc8;}else{_0x1e3e73=0xce;}_0x5631b7[_0x3faf('0x1b')](_0x1e3e73);return _0x5631b7['set'](_0x3faf('0x21'),_0x500b97+'-'+_0x9cdc45+'/'+_0x2131c7)[_0x3faf('0x1d')](_0x44fd4d);}return null;};}function patchUpdates(_0x3e56c8){return function(_0x589aa9){try{jsonpatch[_0x3faf('0x22')](_0x589aa9,_0x3e56c8,!![]);}catch(_0x241562){return BPromise[_0x3faf('0x23')](_0x241562);}return _0x589aa9[_0x3faf('0x24')]();};}function saveUpdates(_0x2ec3c6,_0x21e5ca){return function(_0x3228a1){if(_0x3228a1){return _0x3228a1[_0x3faf('0x25')](_0x2ec3c6)[_0x3faf('0x26')](function(_0x395c4c){return _0x395c4c;});}return null;};}function removeEntity(_0x1e4bac,_0xe1b01c){return function(_0x1c72a7){if(_0x1c72a7){return _0x1c72a7['destroy']()[_0x3faf('0x26')](function(){_0x1e4bac[_0x3faf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25d507,_0x2e08ec){return function(_0xfe8bbc){if(!_0xfe8bbc){_0x25d507['sendStatus'](0x194);}return _0xfe8bbc;};}function handleError(_0x1355b4,_0x5b40aa){_0x5b40aa=_0x5b40aa||0x1f4;return function(_0x2dd3e5){logger[_0x3faf('0x27')](_0x2dd3e5[_0x3faf('0x28')]);if(_0x2dd3e5[_0x3faf('0x29')]){delete _0x2dd3e5[_0x3faf('0x29')];}_0x1355b4[_0x3faf('0x1b')](_0x5b40aa)['send'](_0x2dd3e5);};}exports[_0x3faf('0x2a')]=function(_0x51a908,_0x487393){var _0x3f1640={'raw':![],'where':{'id':_0x51a908['params']['id']}},_0xafb9b4={};_0xafb9b4[_0x3faf('0x2b')]=_['keys'](db[_0x3faf('0x2c')][_0x3faf('0x2d')]);_0xafb9b4[_0x3faf('0x2e')]=_[_0x3faf('0x2f')](_0x51a908[_0x3faf('0x2e')]);_0xafb9b4['filters']=_[_0x3faf('0x30')](_0xafb9b4[_0x3faf('0x2b')],_0xafb9b4[_0x3faf('0x2e')]);_0x3f1640['attributes']=_['intersection'](_0xafb9b4['model'],qs[_0x3faf('0x31')](_0x51a908[_0x3faf('0x2e')]['fields']));_0x3f1640[_0x3faf('0x32')]=_0x3f1640[_0x3faf('0x32')][_0x3faf('0x33')]?_0x3f1640[_0x3faf('0x32')]:_0xafb9b4['model'];if(_0x51a908[_0x3faf('0x2e')]['includeAll']){_0x3f1640[_0x3faf('0x34')]=[{'all':!![]}];}_0x3f1640=_[_0x3faf('0x35')]({},_0x3f1640,_0x51a908['options']);return db[_0x3faf('0x2c')][_0x3faf('0x36')](_0x3f1640)['then'](handleEntityNotFound(_0x487393,null))['then'](respondWithResult(_0x487393,null))[_0x3faf('0x37')](handleError(_0x487393,null));};exports[_0x3faf('0x38')]=function(_0x3c2a42,_0xc6c834){return db[_0x3faf('0x2c')][_0x3faf('0x36')]({'where':{'id':_0x3c2a42[_0x3faf('0x39')]['id']}})[_0x3faf('0x26')](handleEntityNotFound(_0xc6c834,null))[_0x3faf('0x26')](removeEntity(_0xc6c834,null))[_0x3faf('0x37')](handleError(_0xc6c834,null));};function widgetAttributes(_0x28a5b9){try{switch(_0x28a5b9[_0x3faf('0x3a')]){case _0x3faf('0x3b'):return[{'name':_0x3faf('0x3c'),'value':_0x28a5b9['attrUrl']||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9['attrs'][0x0]['value']:undefined)||_0x3faf('0x3e')}];case _0x3faf('0x3f'):return[{'name':'attrPath','value':_0x28a5b9[_0x3faf('0x40')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0][_0x3faf('0x41')]:undefined)||''}];case'clock':return[{'name':_0x3faf('0x42'),'value':_0x28a5b9[_0x3faf('0x42')]||(_0x28a5b9['attrs']&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0][_0x3faf('0x41')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x28a5b9[_0x3faf('0x43')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x1]?_0x28a5b9[_0x3faf('0x3d')][0x1]['value']:undefined)||_0x3faf('0x44')},{'name':_0x3faf('0x45'),'value':_0x28a5b9[_0x3faf('0x45')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x2]?_0x28a5b9['attrs'][0x2][_0x3faf('0x41')]:undefined)||0xc}];case _0x3faf('0x46'):return[{'name':_0x3faf('0x47'),'value':_0x28a5b9[_0x3faf('0x47')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0]['value']:undefined)||'total'},{'name':_0x3faf('0x48'),'value':_0x28a5b9[_0x3faf('0x48')]||(_0x28a5b9['attrs']&&_0x28a5b9[_0x3faf('0x3d')][0x1]?_0x28a5b9[_0x3faf('0x3d')][0x1][_0x3faf('0x41')]:undefined)||[]},{'name':'attrFontSize','value':_0x28a5b9[_0x3faf('0x45')]||(_0x28a5b9['attrs']&&_0x28a5b9[_0x3faf('0x3d')][0x2]?_0x28a5b9[_0x3faf('0x3d')][0x2][_0x3faf('0x41')]:undefined)||0x14}];case _0x3faf('0x49'):case _0x3faf('0x4a'):return[{'name':'attrSerie1','value':_0x28a5b9['attrSerie1']||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0]['value']:undefined)||_0x3faf('0x4b')},{'name':_0x3faf('0x4c'),'value':_0x28a5b9[_0x3faf('0x4c')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x1]?_0x28a5b9[_0x3faf('0x3d')][0x1][_0x3faf('0x41')]:undefined)||null},{'name':_0x3faf('0x4d'),'value':_0x28a5b9[_0x3faf('0x4d')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x2]?_0x28a5b9['attrs'][0x2][_0x3faf('0x41')]:undefined)||null},{'name':_0x3faf('0x48'),'value':_0x28a5b9[_0x3faf('0x48')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x3]?_0x28a5b9[_0x3faf('0x3d')][0x3]['value']:undefined)||[]}];case _0x3faf('0x4e'):return[{'name':_0x3faf('0x4f'),'type':_0x28a5b9[_0x3faf('0x50')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0][_0x3faf('0x3a')]:undefined)||null,'value':_0x28a5b9[_0x3faf('0x4f')]||(_0x28a5b9['attrs']&&_0x28a5b9['attrs'][0x0]?_0x28a5b9[_0x3faf('0x3d')][0x0]['value']:undefined)||null},{'name':_0x3faf('0x51'),'value':_0x28a5b9[_0x3faf('0x51')]||(_0x28a5b9[_0x3faf('0x3d')]&&_0x28a5b9[_0x3faf('0x3d')][0x1]?_0x28a5b9[_0x3faf('0x3d')][0x1][_0x3faf('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x40b735){logger[_0x3faf('0x27')](_0x3faf('0x52'),JSON[_0x3faf('0x53')](_0x40b735));return[];}}exports['create']=function(_0x1f38c6,_0x27d4a9){if(_0x1f38c6[_0x3faf('0x54')]){_0x1f38c6['body'][_0x3faf('0x3d')]=widgetAttributes(_0x1f38c6[_0x3faf('0x54')]);}return db[_0x3faf('0x2c')][_0x3faf('0x55')](_0x1f38c6[_0x3faf('0x54')],{})[_0x3faf('0x26')](respondWithResult(_0x27d4a9,0xc9))[_0x3faf('0x37')](handleError(_0x27d4a9,null));};exports[_0x3faf('0x25')]=function(_0x200647,_0x19eb29){if(_0x200647['body']['id']){delete _0x200647[_0x3faf('0x54')]['id'];}_0x200647[_0x3faf('0x54')][_0x3faf('0x3d')]=widgetAttributes(_0x200647['body']);return db[_0x3faf('0x2c')][_0x3faf('0x36')]({'where':{'id':_0x200647[_0x3faf('0x39')]['id']}})['then'](handleEntityNotFound(_0x19eb29,null))['then'](saveUpdates(_0x200647[_0x3faf('0x54')],null))['then'](respondWithResult(_0x19eb29,null))[_0x3faf('0x37')](handleError(_0x19eb29,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7a98085..0214a99 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 _0x4714=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x3c6c1d,_0x2a14fc){var _0x132324=function(_0x4544b4){while(--_0x4544b4){_0x3c6c1d['push'](_0x3c6c1d['shift']());}};_0x132324(++_0x2a14fc);}(_0x4714,0x129));var _0x4471=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4714[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x4471('0x0'));var DashboardItem=require(_0x4471('0x1'))['db'][_0x4471('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4471('0x3'),'afterUpdate':_0x4471('0x4'),'afterDestroy':_0x4471('0x5')};function emitEvent(_0x214dee){return function(_0x26f138,_0x47988a,_0x33f027){DashboardItemEvents[_0x4471('0x6')](_0x214dee+':'+_0x26f138['id'],_0x26f138);DashboardItemEvents['emit'](_0x214dee,_0x26f138);_0x33f027(null);};}for(var e in events){if(events[_0x4471('0x7')](e)){var event=events[e];DashboardItem[_0x4471('0x8')](e,emitEvent(event));}}module[_0x4471('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x24c6=['hook','exports','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x5a7180,_0x2bd079){var _0x533c5b=function(_0x5edc3){while(--_0x5edc3){_0x5a7180['push'](_0x5a7180['shift']());}};_0x533c5b(++_0x2bd079);}(_0x24c6,0x11c));var _0x624c=function(_0x2d0edf,_0x53d877){_0x2d0edf=_0x2d0edf-0x0;var _0xb54763=_0x24c6[_0x2d0edf];return _0xb54763;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x624c('0x0')](0x0);var events={'afterCreate':_0x624c('0x1'),'afterUpdate':'update','afterDestroy':_0x624c('0x2')};function emitEvent(_0x6a211b){return function(_0x240074,_0x4ce627,_0x2b48ce){DashboardItemEvents['emit'](_0x6a211b+':'+_0x240074['id'],_0x240074);DashboardItemEvents['emit'](_0x6a211b,_0x240074);_0x2b48ce(null);};}for(var e in events){if(events[_0x624c('0x3')](e)){var event=events[e];DashboardItem[_0x624c('0x4')](e,emitEvent(event));}}module[_0x624c('0x5')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d655f0a..7e73339 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 _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x22658d,_0x328f29){var _0x49a56b=function(_0x27b3a7){while(--_0x27b3a7){_0x22658d['push'](_0x22658d['shift']());}};_0x49a56b(++_0x328f29);}(_0x7a54,0x106));var _0x47a5=function(_0x5c6b85,_0x5e6c8c){_0x5c6b85=_0x5c6b85-0x0;var _0x3787a2=_0x7a54[_0x5c6b85];return _0x3787a2;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x7a54,0x106));var _0x47a5=function(_0x270e24,_0x1f63dd){_0x270e24=_0x270e24-0x0;var _0x2129e2=_0x7a54[_0x270e24];return _0x2129e2;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'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 7a9ab28..146f260 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 _0x7fd2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7fd2,0x114));var _0x27fd=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7fd2[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x27fd('0x0'));var util=require(_0x27fd('0x1'));var moment=require(_0x27fd('0x2'));var BPromise=require(_0x27fd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27fd('0x4'));var db=require(_0x27fd('0x5'))['db'];var utils=require(_0x27fd('0x6'));var logger=require(_0x27fd('0x7'))('rpc');var config=require(_0x27fd('0x8'));var jayson=require(_0x27fd('0x9'));var client=jayson[_0x27fd('0xa')]['http']({'port':0x232a});config[_0x27fd('0xb')]=_[_0x27fd('0xc')](config[_0x27fd('0xb')],{'host':_0x27fd('0xd'),'port':0x18eb});var socket=require(_0x27fd('0xe'))(new Redis(config[_0x27fd('0xb')]));require(_0x27fd('0xf'))[_0x27fd('0x10')](socket);function respondWithRpcPromise(_0xffb1bd,_0x2c7303,_0x2afd83){return new BPromise(function(_0x52cec0,_0x5f4566){return client[_0x27fd('0x11')](_0xffb1bd,_0x2afd83)[_0x27fd('0x12')](function(_0x325649){logger[_0x27fd('0x13')](_0x27fd('0x14'),_0x2c7303,_0x27fd('0x15'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2c7303,_0x27fd('0x15'),JSON[_0x27fd('0x16')](_0x325649));if(_0x325649[_0x27fd('0x17')]){if(_0x325649[_0x27fd('0x17')][_0x27fd('0x18')]===0x1f4){logger[_0x27fd('0x17')](_0x27fd('0x14'),_0x2c7303,_0x325649[_0x27fd('0x17')][_0x27fd('0x19')]);return _0x5f4566(_0x325649[_0x27fd('0x17')]['message']);}logger['error'](_0x27fd('0x14'),_0x2c7303,_0x325649[_0x27fd('0x17')][_0x27fd('0x19')]);return _0x52cec0(_0x325649[_0x27fd('0x17')][_0x27fd('0x19')]);}else{logger[_0x27fd('0x13')]('DashboardItem,\x20%s,\x20%s',_0x2c7303,_0x27fd('0x15'));_0x52cec0(_0x325649[_0x27fd('0x1a')][_0x27fd('0x19')]);}})[_0x27fd('0x1b')](function(_0x1596ac){logger[_0x27fd('0x17')](_0x27fd('0x14'),_0x2c7303,_0x1596ac);_0x5f4566(_0x1596ac);});});} \ No newline at end of file +var _0x55cd=['info','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x45023a,_0x18693c){var _0xf6c6e6=function(_0x2de9a2){while(--_0x2de9a2){_0x45023a['push'](_0x45023a['shift']());}};_0xf6c6e6(++_0x18693c);}(_0x55cd,0x16a));var _0xd55c=function(_0xb02d8c,_0x34a375){_0xb02d8c=_0xb02d8c-0x0;var _0x21bdf2=_0x55cd[_0xb02d8c];return _0x21bdf2;};'use strict';var _=require('lodash');var util=require(_0xd55c('0x0'));var moment=require('moment');var BPromise=require(_0xd55c('0x1'));var rs=require(_0xd55c('0x2'));var fs=require('fs');var Redis=require(_0xd55c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd55c('0x4'));var logger=require('../../config/logger')(_0xd55c('0x5'));var config=require(_0xd55c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd55c('0x7')]['http']({'port':0x232a});config[_0xd55c('0x8')]=_[_0xd55c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd55c('0xa'))(new Redis(config[_0xd55c('0x8')]));require(_0xd55c('0xb'))[_0xd55c('0xc')](socket);function respondWithRpcPromise(_0x29cef2,_0x531525,_0x4e5a9d){return new BPromise(function(_0x16475a,_0x353994){return client[_0xd55c('0xd')](_0x29cef2,_0x4e5a9d)[_0xd55c('0xe')](function(_0x38b5c0){logger['info'](_0xd55c('0xf'),_0x531525,_0xd55c('0x10'));logger[_0xd55c('0x11')](_0xd55c('0x12'),_0x531525,'request\x20sent',JSON[_0xd55c('0x13')](_0x38b5c0));if(_0x38b5c0['error']){if(_0x38b5c0[_0xd55c('0x14')]['code']===0x1f4){logger[_0xd55c('0x14')](_0xd55c('0xf'),_0x531525,_0x38b5c0[_0xd55c('0x14')]['message']);return _0x353994(_0x38b5c0[_0xd55c('0x14')][_0xd55c('0x15')]);}logger[_0xd55c('0x14')](_0xd55c('0xf'),_0x531525,_0x38b5c0[_0xd55c('0x14')]['message']);return _0x16475a(_0x38b5c0[_0xd55c('0x14')][_0xd55c('0x15')]);}else{logger[_0xd55c('0x16')](_0xd55c('0xf'),_0x531525,_0xd55c('0x10'));_0x16475a(_0x38b5c0['result'][_0xd55c('0x15')]);}})[_0xd55c('0x17')](function(_0x220571){logger[_0xd55c('0x14')](_0xd55c('0xf'),_0x531525,_0x220571);_0x353994(_0x220571);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 70e6793..333d93c 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 _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x10d369,_0x52d591){var _0x170b03=function(_0x42ef7c){while(--_0x42ef7c){_0x10d369['push'](_0x10d369['shift']());}};_0x170b03(++_0x52d591);}(_0xedd9,0xfc));var _0x9edd=function(_0x357e6a,_0x46afbd){_0x357e6a=_0x357e6a-0x0;var _0x2acb7f=_0xedd9[_0x357e6a];return _0x2acb7f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x3e74,0x175));var _0x43e7=function(_0x3d8260,_0x4a38db){_0x3d8260=_0x3d8260-0x0;var _0x3d452c=_0x3e74[_0x3d8260];return _0x3d452c;};'use strict';var DashboardItemEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){DashboardItemEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);DashboardItemEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5f8c216..32cb778 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 _0x7124=['show','post','isAuthenticated','create','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0xcceb4e,_0x16b9cd){var _0x458bda=function(_0x2efa9c){while(--_0x2efa9c){_0xcceb4e['push'](_0xcceb4e['shift']());}};_0x458bda(++_0x16b9cd);}(_0x7124,0x128));var _0x4712=function(_0x40a107,_0x5acc82){_0x40a107=_0x40a107-0x0;var _0x4beb59=_0x7124[_0x40a107];return _0x4beb59;};'use strict';var multer=require('multer');var util=require(_0x4712('0x0'));var path=require(_0x4712('0x1'));var timeout=require(_0x4712('0x2'));var express=require('express');var router=express[_0x4712('0x3')]();var auth=require(_0x4712('0x4'));var interaction=require(_0x4712('0x5'));var config=require(_0x4712('0x6'));var controller=require(_0x4712('0x7'));router[_0x4712('0x8')](_0x4712('0x9'),auth['isAuthenticated'](),controller[_0x4712('0xa')]);router[_0x4712('0xb')]('/',auth[_0x4712('0xc')](),controller[_0x4712('0xd')]);router['put'](_0x4712('0x9'),auth['isAuthenticated'](),controller[_0x4712('0xe')]);router[_0x4712('0xf')](_0x4712('0x9'),auth['isAuthenticated'](),controller[_0x4712('0x10')]);module[_0x4712('0x11')]=router; \ No newline at end of file +var _0xfa52=['/:id','create','put','delete','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0xfa52,0xca));var _0x2fa5=function(_0x2c3a28,_0xc0d536){_0x2c3a28=_0x2c3a28-0x0;var _0x2409b7=_0xfa52[_0x2c3a28];return _0x2409b7;};'use strict';var multer=require('multer');var util=require(_0x2fa5('0x0'));var path=require(_0x2fa5('0x1'));var timeout=require(_0x2fa5('0x2'));var express=require(_0x2fa5('0x3'));var router=express[_0x2fa5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2fa5('0x5'));var config=require(_0x2fa5('0x6'));var controller=require(_0x2fa5('0x7'));router['get'](_0x2fa5('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2fa5('0x9')]);router[_0x2fa5('0xa')](_0x2fa5('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x2fa5('0xb')](_0x2fa5('0x8'),auth[_0x2fa5('0xc')](),controller[_0x2fa5('0xd')]);module[_0x2fa5('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index fc56a41..540af8b 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 _0x127f=['exports','sequelize'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x127f,0xdf));var _0xf127=function(_0x39ac6e,_0x3d9e6d){_0x39ac6e=_0x39ac6e-0x0;var _0x789fea=_0x127f[_0x39ac6e];return _0x789fea;};'use strict';var Sequelize=require(_0xf127('0x0'));module[_0xf127('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x57cd=['exports','STRING'];(function(_0x496556,_0x3742a7){var _0x179755=function(_0xe3726b){while(--_0xe3726b){_0x496556['push'](_0x496556['shift']());}};_0x179755(++_0x3742a7);}(_0x57cd,0xe2));var _0xd57c=function(_0x217ea1,_0x18b281){_0x217ea1=_0x217ea1-0x0;var _0x1c9ea6=_0x57cd[_0x217ea1];return _0x1c9ea6;};'use strict';var Sequelize=require('sequelize');module[_0xd57c('0x0')]={'name':{'type':Sequelize[_0xd57c('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 5f59aec..af3f5d5 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 _0x4c91=['sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','Disposition','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x329ff7,_0x466789){var _0x2ca363=function(_0x2cf515){while(--_0x2cf515){_0x329ff7['push'](_0x329ff7['shift']());}};_0x2ca363(++_0x466789);}(_0x4c91,0x161));var _0x14c9=function(_0x42fa6f,_0x2eb380){_0x42fa6f=_0x42fa6f-0x0;var _0x343c75=_0x4c91[_0x42fa6f];return _0x343c75;};'use strict';var pdf=require(_0x14c9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14c9('0x1'));var jsonpatch=require(_0x14c9('0x2'));var rp=require(_0x14c9('0x3'));var moment=require(_0x14c9('0x4'));var BPromise=require(_0x14c9('0x5'));var Mustache=require(_0x14c9('0x6'));var util=require('util');var path=require(_0x14c9('0x7'));var sox=require(_0x14c9('0x8'));var csv=require(_0x14c9('0x9'));var ejs=require(_0x14c9('0xa'));var fs=require('fs');var _=require(_0x14c9('0xb'));var squel=require('squel');var crypto=require(_0x14c9('0xc'));var jsforce=require(_0x14c9('0xd'));var deskjs=require(_0x14c9('0xe'));var toCsv=require(_0x14c9('0x9'));var querystring=require('querystring');var Papa=require(_0x14c9('0xf'));var authService=require(_0x14c9('0x10'));var hardwareService=require(_0x14c9('0x11'));var Redis=require(_0x14c9('0x12'));var qs=require(_0x14c9('0x13'));var logger=require(_0x14c9('0x14'))(_0x14c9('0x15'));var utils=require(_0x14c9('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2676da,_0x24402b){_0x24402b=_0x24402b||0xcc;return function(_0xd0a9ef){if(_0xd0a9ef){return _0x2676da[_0x14c9('0x17')](_0x24402b);}return _0x2676da[_0x14c9('0x18')](_0x24402b)['end']();};}function respondWithResult(_0x564416,_0x1f06d2){_0x1f06d2=_0x1f06d2||0xc8;return function(_0x20a698){if(_0x20a698){return _0x564416[_0x14c9('0x18')](_0x1f06d2)[_0x14c9('0x19')](_0x20a698);}};}function respondWithFilteredResult(_0x5c43a2,_0x439108){return function(_0x46a16b){if(_0x46a16b){var _0x45825a=_0x46a16b[_0x14c9('0x1a')],_0x5a403a=_0x439108['offset'],_0x450264=_0x439108[_0x14c9('0x1b')]+_0x439108[_0x14c9('0x1c')],_0x46a7dd;if(_0x450264>=_0x45825a){_0x450264=_0x45825a;_0x46a7dd=0xc8;}else{_0x46a7dd=0xce;}_0x5c43a2[_0x14c9('0x18')](_0x46a7dd);return _0x5c43a2[_0x14c9('0x1d')](_0x14c9('0x1e'),_0x5a403a+'-'+_0x450264+'/'+_0x45825a)[_0x14c9('0x19')](_0x46a16b);}return null;};}function patchUpdates(_0x1f4aa6){return function(_0x51bf98){try{jsonpatch[_0x14c9('0x1f')](_0x51bf98,_0x1f4aa6,!![]);}catch(_0x521035){return BPromise[_0x14c9('0x20')](_0x521035);}return _0x51bf98[_0x14c9('0x21')]();};}function saveUpdates(_0x464c27,_0x3bd461){return function(_0x327aa2){if(_0x327aa2){return _0x327aa2[_0x14c9('0x22')](_0x464c27)[_0x14c9('0x23')](function(_0xc4849d){return _0xc4849d;});}return null;};}function removeEntity(_0x53ab6d,_0x4b10d1){return function(_0x268d7b){if(_0x268d7b){return _0x268d7b[_0x14c9('0x24')]()[_0x14c9('0x23')](function(){var _0x11e2d1=_0x268d7b[_0x14c9('0x25')]({'plain':!![]});var _0x6b3f43='Dispositions';return db[_0x14c9('0x26')][_0x14c9('0x24')]({'where':{'type':_0x6b3f43,'resourceId':_0x11e2d1['id']}})[_0x14c9('0x23')](function(){return _0x268d7b;});})[_0x14c9('0x23')](function(){_0x53ab6d['status'](0xcc)[_0x14c9('0x27')]();});}};}function handleEntityNotFound(_0x6df087,_0x252995){return function(_0x4fca82){if(!_0x4fca82){_0x6df087[_0x14c9('0x17')](0x194);}return _0x4fca82;};}function handleError(_0x3c3432,_0x1cccae){_0x1cccae=_0x1cccae||0x1f4;return function(_0x3984bf){logger['error'](_0x3984bf[_0x14c9('0x28')]);if(_0x3984bf[_0x14c9('0x29')]){delete _0x3984bf[_0x14c9('0x29')];}_0x3c3432[_0x14c9('0x18')](_0x1cccae)['send'](_0x3984bf);};}exports[_0x14c9('0x2a')]=function(_0x18008a,_0x224ff3){var _0x4a39f2={},_0x544767={},_0x7f394e={'count':0x0,'rows':[]};var _0x2911df=db['Disposition']['rawAttributes'];_0x544767[_0x14c9('0x2b')]=_[_0x14c9('0x2c')](_0x2911df);_0x544767[_0x14c9('0x2d')]=_[_0x14c9('0x2c')](_0x18008a['query']);_0x544767[_0x14c9('0x2e')]=_['intersection'](_0x544767[_0x14c9('0x2b')],_0x544767['query']);_0x4a39f2[_0x14c9('0x2f')]=_[_0x14c9('0x30')](_0x544767[_0x14c9('0x2b')],qs[_0x14c9('0x31')](_0x18008a[_0x14c9('0x2d')]['fields']));_0x4a39f2['attributes']=_0x4a39f2[_0x14c9('0x2f')][_0x14c9('0x32')]?_0x4a39f2['attributes']:_0x544767['model'];if(!_0x18008a[_0x14c9('0x2d')][_0x14c9('0x33')]('nolimit')){_0x4a39f2['limit']=qs[_0x14c9('0x1c')](_0x18008a[_0x14c9('0x2d')][_0x14c9('0x1c')]);_0x4a39f2[_0x14c9('0x1b')]=qs['offset'](_0x18008a[_0x14c9('0x2d')][_0x14c9('0x1b')]);}_0x4a39f2['order']=qs[_0x14c9('0x34')](_0x18008a[_0x14c9('0x2d')][_0x14c9('0x34')]);_0x4a39f2[_0x14c9('0x35')]=qs['filters'](_[_0x14c9('0x36')](_0x18008a['query'],_0x544767[_0x14c9('0x2e')]));if(_0x18008a['query'][_0x14c9('0x37')]){_0x4a39f2[_0x14c9('0x35')]=_[_0x14c9('0x38')](_0x4a39f2[_0x14c9('0x35')],{'$or':_[_0x14c9('0x39')](_0x2911df,function(_0x4c6208){if(_0x4c6208['type'][_0x14c9('0x3a')]!==_0x14c9('0x3b')){var _0x3fa367={};_0x3fa367[_0x4c6208[_0x14c9('0x3c')]]={'$like':'%'+_0x18008a['query'][_0x14c9('0x37')]+'%'};return _0x3fa367;}})});}_0x4a39f2=_[_0x14c9('0x38')]({},_0x4a39f2,_0x18008a[_0x14c9('0x3d')]);var _0x55ffea={'where':_0x4a39f2[_0x14c9('0x35')]};return db[_0x14c9('0x3e')][_0x14c9('0x1a')](_0x55ffea)[_0x14c9('0x23')](function(_0x1e0476){_0x7f394e[_0x14c9('0x1a')]=_0x1e0476;if(_0x18008a[_0x14c9('0x2d')]['includeAll']){_0x4a39f2[_0x14c9('0x3f')]=[{'all':!![]}];}return db[_0x14c9('0x3e')][_0x14c9('0x40')](_0x4a39f2);})['then'](function(_0x11fe14){_0x7f394e[_0x14c9('0x41')]=_0x11fe14;return _0x7f394e;})[_0x14c9('0x23')](respondWithFilteredResult(_0x224ff3,_0x4a39f2))[_0x14c9('0x42')](handleError(_0x224ff3,null));};exports[_0x14c9('0x43')]=function(_0x5f3c70,_0x39d0bf){var _0x5f3825={'raw':!![],'where':{'id':_0x5f3c70['params']['id']}},_0x85c20b={};_0x85c20b['model']=_[_0x14c9('0x2c')](db[_0x14c9('0x3e')][_0x14c9('0x44')]);_0x85c20b['query']=_[_0x14c9('0x2c')](_0x5f3c70[_0x14c9('0x2d')]);_0x85c20b[_0x14c9('0x2e')]=_[_0x14c9('0x30')](_0x85c20b['model'],_0x85c20b[_0x14c9('0x2d')]);_0x5f3825['attributes']=_[_0x14c9('0x30')](_0x85c20b['model'],qs[_0x14c9('0x31')](_0x5f3c70['query']['fields']));_0x5f3825['attributes']=_0x5f3825[_0x14c9('0x2f')][_0x14c9('0x32')]?_0x5f3825['attributes']:_0x85c20b[_0x14c9('0x2b')];if(_0x5f3c70[_0x14c9('0x2d')][_0x14c9('0x45')]){_0x5f3825[_0x14c9('0x3f')]=[{'all':!![]}];}_0x5f3825=_['merge']({},_0x5f3825,_0x5f3c70[_0x14c9('0x3d')]);return db[_0x14c9('0x3e')][_0x14c9('0x46')](_0x5f3825)[_0x14c9('0x23')](handleEntityNotFound(_0x39d0bf,null))[_0x14c9('0x23')](respondWithResult(_0x39d0bf,null))[_0x14c9('0x42')](handleError(_0x39d0bf,null));};exports[_0x14c9('0x47')]=function(_0x23353a,_0x3492ed){return db[_0x14c9('0x3e')][_0x14c9('0x47')](_0x23353a['body'],{})[_0x14c9('0x23')](function(_0x552245){var _0x8f891c=_0x23353a[_0x14c9('0x48')][_0x14c9('0x25')]({'plain':!![]});if(!_0x8f891c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8f891c['role']===_0x14c9('0x48')){var _0x56276c=_0x552245[_0x14c9('0x25')]({'plain':!![]});var _0x54687a=_0x14c9('0x49');return db[_0x14c9('0x4a')][_0x14c9('0x46')]({'where':{'name':_0x54687a,'userProfileId':_0x8f891c[_0x14c9('0x4b')]},'raw':!![]})[_0x14c9('0x23')](function(_0x158f00){if(_0x158f00&&_0x158f00[_0x14c9('0x4c')]===0x0){return db[_0x14c9('0x26')][_0x14c9('0x47')]({'name':_0x56276c[_0x14c9('0x29')],'resourceId':_0x56276c['id'],'type':_0x158f00[_0x14c9('0x29')],'sectionId':_0x158f00['id']},{})['then'](function(){return _0x552245;});}else{return _0x552245;}})[_0x14c9('0x42')](function(_0x484e59){logger[_0x14c9('0x4d')](_0x14c9('0x4e'),_0x484e59);throw _0x484e59;});}return _0x552245;})[_0x14c9('0x23')](respondWithResult(_0x3492ed,0xc9))[_0x14c9('0x42')](handleError(_0x3492ed,null));};exports['update']=function(_0x2493ac,_0x1170d7){if(_0x2493ac[_0x14c9('0x4f')]['id']){delete _0x2493ac['body']['id'];}return db[_0x14c9('0x3e')][_0x14c9('0x46')]({'where':{'id':_0x2493ac[_0x14c9('0x50')]['id']}})[_0x14c9('0x23')](handleEntityNotFound(_0x1170d7,null))['then'](saveUpdates(_0x2493ac[_0x14c9('0x4f')],null))[_0x14c9('0x23')](respondWithResult(_0x1170d7,null))[_0x14c9('0x42')](handleError(_0x1170d7,null));};exports[_0x14c9('0x24')]=function(_0x12214a,_0x458cc2){return db[_0x14c9('0x3e')][_0x14c9('0x46')]({'where':{'id':_0x12214a[_0x14c9('0x50')]['id']}})[_0x14c9('0x23')](handleEntityNotFound(_0x458cc2,null))['then'](removeEntity(_0x458cc2,null))[_0x14c9('0x42')](handleError(_0x458cc2,null));}; \ No newline at end of file +var _0x3c62=['util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','get','destroy','error','stack','name','index','Disposition','rawAttributes','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','rows','catch','intersection','options','create','body','user','role','Dispositions','UserProfileSection','find','userProfileId','UserProfileResource','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0xa04024,_0x531c9f){var _0x5bf7fc=function(_0x2cab72){while(--_0x2cab72){_0xa04024['push'](_0xa04024['shift']());}};_0x5bf7fc(++_0x531c9f);}(_0x3c62,0xe3));var _0x23c6=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3c62[_0x110c3d];return _0x226d67;};'use strict';var pdf=require(_0x23c6('0x0'));var emlformat=require(_0x23c6('0x1'));var rimraf=require(_0x23c6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23c6('0x3'));var rp=require(_0x23c6('0x4'));var moment=require('moment');var BPromise=require(_0x23c6('0x5'));var Mustache=require(_0x23c6('0x6'));var util=require(_0x23c6('0x7'));var path=require(_0x23c6('0x8'));var sox=require(_0x23c6('0x9'));var csv=require(_0x23c6('0xa'));var ejs=require(_0x23c6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x23c6('0xc'));var crypto=require('crypto');var jsforce=require(_0x23c6('0xd'));var deskjs=require(_0x23c6('0xe'));var toCsv=require(_0x23c6('0xa'));var querystring=require(_0x23c6('0xf'));var Papa=require('papaparse');var authService=require(_0x23c6('0x10'));var hardwareService=require(_0x23c6('0x11'));var Redis=require('ioredis');var qs=require(_0x23c6('0x12'));var logger=require(_0x23c6('0x13'))(_0x23c6('0x14'));var utils=require(_0x23c6('0x15'));var config=require(_0x23c6('0x16'));var db=require(_0x23c6('0x17'))['db'];function respondWithStatusCode(_0x1ee1d2,_0x5af3c9){_0x5af3c9=_0x5af3c9||0xcc;return function(_0x27fee2){if(_0x27fee2){return _0x1ee1d2[_0x23c6('0x18')](_0x5af3c9);}return _0x1ee1d2['status'](_0x5af3c9)[_0x23c6('0x19')]();};}function respondWithResult(_0x526051,_0x2e71dc){_0x2e71dc=_0x2e71dc||0xc8;return function(_0xdfa99b){if(_0xdfa99b){return _0x526051[_0x23c6('0x1a')](_0x2e71dc)[_0x23c6('0x1b')](_0xdfa99b);}};}function respondWithFilteredResult(_0x276c25,_0x932d7e){return function(_0x1e8595){if(_0x1e8595){var _0x1ff7da=_0x1e8595[_0x23c6('0x1c')],_0x114e6e=_0x932d7e['offset'],_0x57feab=_0x932d7e[_0x23c6('0x1d')]+_0x932d7e[_0x23c6('0x1e')],_0x4762f0;if(_0x57feab>=_0x1ff7da){_0x57feab=_0x1ff7da;_0x4762f0=0xc8;}else{_0x4762f0=0xce;}_0x276c25[_0x23c6('0x1a')](_0x4762f0);return _0x276c25['set'](_0x23c6('0x1f'),_0x114e6e+'-'+_0x57feab+'/'+_0x1ff7da)[_0x23c6('0x1b')](_0x1e8595);}return null;};}function patchUpdates(_0x1c9e57){return function(_0x49a142){try{jsonpatch['apply'](_0x49a142,_0x1c9e57,!![]);}catch(_0x928fc8){return BPromise[_0x23c6('0x20')](_0x928fc8);}return _0x49a142[_0x23c6('0x21')]();};}function saveUpdates(_0x5b3d8e,_0x2dd9b7){return function(_0x324d65){if(_0x324d65){return _0x324d65[_0x23c6('0x22')](_0x5b3d8e)[_0x23c6('0x23')](function(_0x33e65f){return _0x33e65f;});}return null;};}function removeEntity(_0x52052f,_0x19e004){return function(_0x1a2e40){if(_0x1a2e40){return _0x1a2e40['destroy']()[_0x23c6('0x23')](function(){var _0x2fc6e1=_0x1a2e40[_0x23c6('0x24')]({'plain':!![]});var _0x7c9735='Dispositions';return db['UserProfileResource'][_0x23c6('0x25')]({'where':{'type':_0x7c9735,'resourceId':_0x2fc6e1['id']}})[_0x23c6('0x23')](function(){return _0x1a2e40;});})[_0x23c6('0x23')](function(){_0x52052f[_0x23c6('0x1a')](0xcc)[_0x23c6('0x19')]();});}};}function handleEntityNotFound(_0x5d5e57,_0x4ba47b){return function(_0x4e0f80){if(!_0x4e0f80){_0x5d5e57[_0x23c6('0x18')](0x194);}return _0x4e0f80;};}function handleError(_0x9ca0c,_0x138f76){_0x138f76=_0x138f76||0x1f4;return function(_0x5b8105){logger[_0x23c6('0x26')](_0x5b8105[_0x23c6('0x27')]);if(_0x5b8105['name']){delete _0x5b8105[_0x23c6('0x28')];}_0x9ca0c[_0x23c6('0x1a')](_0x138f76)['send'](_0x5b8105);};}exports[_0x23c6('0x29')]=function(_0x5910b7,_0x4645b3){var _0x2b54cd={},_0x35b4d8={},_0x4fbff2={'count':0x0,'rows':[]};var _0x442e5f=db[_0x23c6('0x2a')][_0x23c6('0x2b')];_0x35b4d8[_0x23c6('0x2c')]=_[_0x23c6('0x2d')](_0x442e5f);_0x35b4d8[_0x23c6('0x2e')]=_[_0x23c6('0x2d')](_0x5910b7[_0x23c6('0x2e')]);_0x35b4d8[_0x23c6('0x2f')]=_['intersection'](_0x35b4d8[_0x23c6('0x2c')],_0x35b4d8[_0x23c6('0x2e')]);_0x2b54cd[_0x23c6('0x30')]=_['intersection'](_0x35b4d8[_0x23c6('0x2c')],qs[_0x23c6('0x31')](_0x5910b7[_0x23c6('0x2e')][_0x23c6('0x31')]));_0x2b54cd[_0x23c6('0x30')]=_0x2b54cd[_0x23c6('0x30')][_0x23c6('0x32')]?_0x2b54cd[_0x23c6('0x30')]:_0x35b4d8[_0x23c6('0x2c')];if(!_0x5910b7[_0x23c6('0x2e')]['hasOwnProperty'](_0x23c6('0x33'))){_0x2b54cd[_0x23c6('0x1e')]=qs[_0x23c6('0x1e')](_0x5910b7[_0x23c6('0x2e')][_0x23c6('0x1e')]);_0x2b54cd[_0x23c6('0x1d')]=qs[_0x23c6('0x1d')](_0x5910b7['query'][_0x23c6('0x1d')]);}_0x2b54cd[_0x23c6('0x34')]=qs[_0x23c6('0x35')](_0x5910b7['query']['sort']);_0x2b54cd[_0x23c6('0x36')]=qs[_0x23c6('0x2f')](_[_0x23c6('0x37')](_0x5910b7['query'],_0x35b4d8[_0x23c6('0x2f')]));if(_0x5910b7[_0x23c6('0x2e')][_0x23c6('0x38')]){_0x2b54cd['where']=_[_0x23c6('0x39')](_0x2b54cd['where'],{'$or':_['map'](_0x442e5f,function(_0x475ffa){if(_0x475ffa[_0x23c6('0x3a')][_0x23c6('0x3b')]!==_0x23c6('0x3c')){var _0x250e46={};_0x250e46[_0x475ffa[_0x23c6('0x3d')]]={'$like':'%'+_0x5910b7[_0x23c6('0x2e')][_0x23c6('0x38')]+'%'};return _0x250e46;}})});}_0x2b54cd=_['merge']({},_0x2b54cd,_0x5910b7['options']);var _0x518c2e={'where':_0x2b54cd[_0x23c6('0x36')]};return db[_0x23c6('0x2a')][_0x23c6('0x1c')](_0x518c2e)[_0x23c6('0x23')](function(_0x2a9da1){_0x4fbff2[_0x23c6('0x1c')]=_0x2a9da1;if(_0x5910b7[_0x23c6('0x2e')][_0x23c6('0x3e')]){_0x2b54cd[_0x23c6('0x3f')]=[{'all':!![]}];}return db[_0x23c6('0x2a')]['findAll'](_0x2b54cd);})[_0x23c6('0x23')](function(_0x222c58){_0x4fbff2[_0x23c6('0x40')]=_0x222c58;return _0x4fbff2;})[_0x23c6('0x23')](respondWithFilteredResult(_0x4645b3,_0x2b54cd))[_0x23c6('0x41')](handleError(_0x4645b3,null));};exports['show']=function(_0x99d468,_0x16f473){var _0x114f3a={'raw':!![],'where':{'id':_0x99d468['params']['id']}},_0xb11521={};_0xb11521[_0x23c6('0x2c')]=_[_0x23c6('0x2d')](db[_0x23c6('0x2a')][_0x23c6('0x2b')]);_0xb11521[_0x23c6('0x2e')]=_[_0x23c6('0x2d')](_0x99d468['query']);_0xb11521[_0x23c6('0x2f')]=_[_0x23c6('0x42')](_0xb11521['model'],_0xb11521[_0x23c6('0x2e')]);_0x114f3a[_0x23c6('0x30')]=_[_0x23c6('0x42')](_0xb11521[_0x23c6('0x2c')],qs[_0x23c6('0x31')](_0x99d468[_0x23c6('0x2e')][_0x23c6('0x31')]));_0x114f3a[_0x23c6('0x30')]=_0x114f3a[_0x23c6('0x30')]['length']?_0x114f3a[_0x23c6('0x30')]:_0xb11521[_0x23c6('0x2c')];if(_0x99d468[_0x23c6('0x2e')][_0x23c6('0x3e')]){_0x114f3a[_0x23c6('0x3f')]=[{'all':!![]}];}_0x114f3a=_[_0x23c6('0x39')]({},_0x114f3a,_0x99d468[_0x23c6('0x43')]);return db[_0x23c6('0x2a')]['find'](_0x114f3a)[_0x23c6('0x23')](handleEntityNotFound(_0x16f473,null))[_0x23c6('0x23')](respondWithResult(_0x16f473,null))[_0x23c6('0x41')](handleError(_0x16f473,null));};exports[_0x23c6('0x44')]=function(_0x100f71,_0x1eff02){return db[_0x23c6('0x2a')][_0x23c6('0x44')](_0x100f71[_0x23c6('0x45')],{})[_0x23c6('0x23')](function(_0x1c3ae9){var _0xd93167=_0x100f71[_0x23c6('0x46')][_0x23c6('0x24')]({'plain':!![]});if(!_0xd93167)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd93167[_0x23c6('0x47')]===_0x23c6('0x46')){var _0x3b37cb=_0x1c3ae9[_0x23c6('0x24')]({'plain':!![]});var _0x4fd577=_0x23c6('0x48');return db[_0x23c6('0x49')][_0x23c6('0x4a')]({'where':{'name':_0x4fd577,'userProfileId':_0xd93167[_0x23c6('0x4b')]},'raw':!![]})[_0x23c6('0x23')](function(_0x14d54d){if(_0x14d54d&&_0x14d54d['autoAssociation']===0x0){return db[_0x23c6('0x4c')][_0x23c6('0x44')]({'name':_0x3b37cb[_0x23c6('0x28')],'resourceId':_0x3b37cb['id'],'type':_0x14d54d[_0x23c6('0x28')],'sectionId':_0x14d54d['id']},{})[_0x23c6('0x23')](function(){return _0x1c3ae9;});}else{return _0x1c3ae9;}})['catch'](function(_0x5647b7){logger[_0x23c6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5647b7);throw _0x5647b7;});}return _0x1c3ae9;})[_0x23c6('0x23')](respondWithResult(_0x1eff02,0xc9))[_0x23c6('0x41')](handleError(_0x1eff02,null));};exports['update']=function(_0x143038,_0x2e746d){if(_0x143038[_0x23c6('0x45')]['id']){delete _0x143038[_0x23c6('0x45')]['id'];}return db['Disposition'][_0x23c6('0x4a')]({'where':{'id':_0x143038[_0x23c6('0x4d')]['id']}})[_0x23c6('0x23')](handleEntityNotFound(_0x2e746d,null))[_0x23c6('0x23')](saveUpdates(_0x143038[_0x23c6('0x45')],null))[_0x23c6('0x23')](respondWithResult(_0x2e746d,null))[_0x23c6('0x41')](handleError(_0x2e746d,null));};exports['destroy']=function(_0x35b036,_0xa5f0a9){return db[_0x23c6('0x2a')][_0x23c6('0x4a')]({'where':{'id':_0x35b036['params']['id']}})[_0x23c6('0x23')](handleEntityNotFound(_0xa5f0a9,null))[_0x23c6('0x23')](removeEntity(_0xa5f0a9,null))['catch'](handleError(_0xa5f0a9,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 537e1a5..e6d07be 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 _0x1a85=['ListId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','../../config/logger','api','moment','./disposition.attributes','exports','define','tools_dispositions','name'];(function(_0x2538ec,_0x51134a){var _0x346245=function(_0x4499d8){while(--_0x4499d8){_0x2538ec['push'](_0x2538ec['shift']());}};_0x346245(++_0x51134a);}(_0x1a85,0x178));var _0x51a8=function(_0x420282,_0x1f941f){_0x420282=_0x420282-0x0;var _0x535480=_0x1a85[_0x420282];return _0x535480;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x51a8('0x3'));module[_0x51a8('0x4')]=function(_0x99e371,_0x48a21b){return _0x99e371[_0x51a8('0x5')]('Disposition',attributes,{'tableName':_0x51a8('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x51a8('0x7'),_0x51a8('0x8')]},{'unique':!![],'name':'name_chat','fields':[_0x51a8('0x7'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x51a8('0x7'),_0x51a8('0x9')]},{'unique':!![],'name':_0x51a8('0xa'),'fields':[_0x51a8('0x7'),_0x51a8('0xb')]},{'unique':!![],'name':_0x51a8('0xc'),'fields':[_0x51a8('0x7'),_0x51a8('0xd')]},{'unique':!![],'name':_0x51a8('0xe'),'fields':[_0x51a8('0x7'),_0x51a8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','util','api','moment','bluebird','./disposition.attributes','exports','define'];(function(_0x5de3fd,_0x42d375){var _0xeec602=function(_0x258e8b){while(--_0x258e8b){_0x5de3fd['push'](_0x5de3fd['shift']());}};_0xeec602(++_0x42d375);}(_0xadb5,0xad));var _0x5adb=function(_0x5b253e,_0x1e060d){_0x5b253e=_0x5b253e-0x0;var _0x32804c=_0xadb5[_0x5b253e];return _0x32804c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var attributes=require(_0x5adb('0x4'));module[_0x5adb('0x5')]=function(_0x2e3ef4,_0x4cb1d1){return _0x2e3ef4[_0x5adb('0x6')](_0x5adb('0x7'),attributes,{'tableName':_0x5adb('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5adb('0x9'),'fields':[_0x5adb('0xa'),_0x5adb('0xb')]},{'unique':!![],'name':_0x5adb('0xc'),'fields':[_0x5adb('0xa'),_0x5adb('0xd')]},{'unique':!![],'name':_0x5adb('0xe'),'fields':[_0x5adb('0xa'),_0x5adb('0xf')]},{'unique':!![],'name':_0x5adb('0x10'),'fields':[_0x5adb('0xa'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x5adb('0xa'),_0x5adb('0x11')]},{'unique':!![],'name':_0x5adb('0x12'),'fields':['name',_0x5adb('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 40ef6ac..e053e6f 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 _0xfc65=['result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xe76b5c,_0x5da4ce){var _0x36438f=function(_0x4579d3){while(--_0x4579d3){_0xe76b5c['push'](_0xe76b5c['shift']());}};_0x36438f(++_0x5da4ce);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x2dc7bd,_0x1ab53d){_0x2dc7bd=_0x2dc7bd-0x0;var _0x2f3a6b=_0xfc65[_0x2dc7bd];return _0x2f3a6b;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5fc6('0x1'));var rs=require(_0x5fc6('0x2'));var fs=require('fs');var Redis=require(_0x5fc6('0x3'));var db=require(_0x5fc6('0x4'))['db'];var utils=require(_0x5fc6('0x5'));var logger=require(_0x5fc6('0x6'))(_0x5fc6('0x7'));var config=require(_0x5fc6('0x8'));var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x409c5f,_0x1a9600,_0x572941){return new BPromise(function(_0x3921c5,_0x1f1409){return client[_0x5fc6('0xc')](_0x409c5f,_0x572941)[_0x5fc6('0xd')](function(_0x16c285){logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1a9600,_0x5fc6('0x10'));logger[_0x5fc6('0x11')](_0x5fc6('0x12'),_0x1a9600,'request\x20sent',JSON[_0x5fc6('0x13')](_0x16c285));if(_0x16c285['error']){if(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x15')]===0x1f4){logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x16c285['error'][_0x5fc6('0x16')]);return _0x1f1409(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);}logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);return _0x3921c5(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);}else{logger[_0x5fc6('0xe')]('Disposition,\x20%s,\x20%s',_0x1a9600,'request\x20sent');_0x3921c5(_0x16c285[_0x5fc6('0x17')][_0x5fc6('0x16')]);}})['catch'](function(_0x26d2ba){logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x26d2ba);_0x1f1409(_0x26d2ba);});});} \ No newline at end of file +var _0x6b8f=['debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Disposition,\x20%s,\x20%s','request\x20sent'];(function(_0x46cb4d,_0x1b4f68){var _0x3acf6d=function(_0x25493d){while(--_0x25493d){_0x46cb4d['push'](_0x46cb4d['shift']());}};_0x3acf6d(++_0x1b4f68);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0xd1249a,_0x5ef059){_0xd1249a=_0xd1249a-0x0;var _0x401ebd=_0x6b8f[_0xd1249a];return _0x401ebd;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var moment=require('moment');var BPromise=require(_0xf6b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6b8('0x2'))['db'];var utils=require(_0xf6b8('0x3'));var logger=require('../../config/logger')(_0xf6b8('0x4'));var config=require(_0xf6b8('0x5'));var jayson=require(_0xf6b8('0x6'));var client=jayson['client'][_0xf6b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x79c66d,_0x446336,_0x3c3430){return new BPromise(function(_0x557910,_0x5f07f4){return client[_0xf6b8('0x8')](_0x79c66d,_0x3c3430)['then'](function(_0x24458c){logger[_0xf6b8('0x9')](_0xf6b8('0xa'),_0x446336,_0xf6b8('0xb'));logger[_0xf6b8('0xc')](_0xf6b8('0xd'),_0x446336,'request\x20sent',JSON['stringify'](_0x24458c));if(_0x24458c['error']){if(_0x24458c[_0xf6b8('0xe')][_0xf6b8('0xf')]===0x1f4){logger[_0xf6b8('0xe')](_0xf6b8('0xa'),_0x446336,_0x24458c['error']['message']);return _0x5f07f4(_0x24458c[_0xf6b8('0xe')][_0xf6b8('0x10')]);}logger['error'](_0xf6b8('0xa'),_0x446336,_0x24458c[_0xf6b8('0xe')][_0xf6b8('0x10')]);return _0x557910(_0x24458c['error'][_0xf6b8('0x10')]);}else{logger['info'](_0xf6b8('0xa'),_0x446336,_0xf6b8('0xb'));_0x557910(_0x24458c[_0xf6b8('0x11')][_0xf6b8('0x10')]);}})[_0xf6b8('0x12')](function(_0x567b58){logger['error'](_0xf6b8('0xa'),_0x446336,_0x567b58);_0x5f07f4(_0x567b58);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 800c373..09f6af9 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 _0x1511=['./disposition.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x94fd22,_0x2b4d11){var _0x183b67=function(_0x1abf9f){while(--_0x1abf9f){_0x94fd22['push'](_0x94fd22['shift']());}};_0x183b67(++_0x2b4d11);}(_0x1511,0x138));var _0x1151=function(_0x5f364f,_0x4f4ab6){_0x5f364f=_0x5f364f-0x0;var _0x4213ac=_0x1511[_0x5f364f];return _0x4213ac;};'use strict';var multer=require(_0x1151('0x0'));var util=require(_0x1151('0x1'));var path=require(_0x1151('0x2'));var timeout=require(_0x1151('0x3'));var express=require(_0x1151('0x4'));var router=express[_0x1151('0x5')]();var auth=require(_0x1151('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1151('0x7'));var controller=require(_0x1151('0x8'));router['get']('/',auth[_0x1151('0x9')](),controller[_0x1151('0xa')]);router[_0x1151('0xb')](_0x1151('0xc'),auth[_0x1151('0x9')](),controller['show']);router[_0x1151('0xd')]('/',auth['isAuthenticated'](),controller[_0x1151('0xe')]);router[_0x1151('0xf')](_0x1151('0xc'),auth[_0x1151('0x9')](),controller[_0x1151('0x10')]);router[_0x1151('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1151('0x12')]);module[_0x1151('0x13')]=router; \ No newline at end of file +var _0x82ca=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x1090e5,_0x10679d){var _0x2c9817=function(_0xaf275c){while(--_0xaf275c){_0x1090e5['push'](_0x1090e5['shift']());}};_0x2c9817(++_0x10679d);}(_0x82ca,0xd8));var _0xa82c=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x82ca[_0x4b2251];return _0x5d22fb;};'use strict';var multer=require(_0xa82c('0x0'));var util=require(_0xa82c('0x1'));var path=require(_0xa82c('0x2'));var timeout=require(_0xa82c('0x3'));var express=require(_0xa82c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa82c('0x5'));var config=require(_0xa82c('0x6'));var controller=require('./disposition.controller');router[_0xa82c('0x7')]('/',auth[_0xa82c('0x8')](),controller[_0xa82c('0x9')]);router['get'](_0xa82c('0xa'),auth[_0xa82c('0x8')](),controller[_0xa82c('0xb')]);router[_0xa82c('0xc')]('/',auth[_0xa82c('0x8')](),controller[_0xa82c('0xd')]);router[_0xa82c('0xe')](_0xa82c('0xa'),auth[_0xa82c('0x8')](),controller[_0xa82c('0xf')]);router[_0xa82c('0x10')](_0xa82c('0xa'),auth[_0xa82c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index ba85163..766027a 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 _0x4572=['mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x49c12f,_0x1c90b4){var _0x117c95=function(_0x5c8248){while(--_0x5c8248){_0x49c12f['push'](_0x49c12f['shift']());}};_0x117c95(++_0x1c90b4);}(_0x4572,0xf1));var _0x2457=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x4572[_0x1139d0];return _0xcc01a6;};'use strict';var Sequelize=require(_0x2457('0x0'));module[_0x2457('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2457('0x2')]},'ecm':{'type':Sequelize[_0x2457('0x3')](_0x2457('0x4'),'no'),'defaultValue':_0x2457('0x4')},'headerinfo':{'type':Sequelize[_0x2457('0x2')],'defaultValue':_0x2457('0x5')},'localstationid':{'type':Sequelize[_0x2457('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x2457('0x3')](_0x2457('0x6'),_0x2457('0x7'),_0x2457('0x8'),_0x2457('0x9'),_0x2457('0xa'),_0x2457('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x2457('0x3')](_0x2457('0x6'),_0x2457('0x7'),'7200',_0x2457('0x9'),_0x2457('0xa'),_0x2457('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x2457('0x2')],'defaultValue':_0x2457('0xc')},'gateway':{'type':Sequelize[_0x2457('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2457('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2457('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2457('0x3')](_0x2457('0xe'),_0x2457('0xf'),_0x2457('0x10'),_0x2457('0x11')),'defaultValue':_0x2457('0xe')},'key':{'type':Sequelize[_0x2457('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2457('0x12')],'defaultValue':function(){return _0x2457('0x13');}},'notificationSound':{'type':Sequelize[_0x2457('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2457('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2457('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2457('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2457('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2457('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2457('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2457('0x14')],'defaultValue':![],'comment':_0x2457('0x15'),'set':function(_0x51e9ce){if(!_0x51e9ce)this[_0x2457('0x16')]('mandatoryDispositionPauseId',null);this[_0x2457('0x16')](_0x2457('0x17'),_0x51e9ce);}}}; \ No newline at end of file +var _0x0e33=['yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','12000','14400','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM'];(function(_0x54e8d4,_0x19191f){var _0x18f39e=function(_0x32b6eb){while(--_0x32b6eb){_0x54e8d4['push'](_0x54e8d4['shift']());}};_0x18f39e(++_0x19191f);}(_0x0e33,0x127));var _0x30e3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0e33[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x30e3('0x0'));module[_0x30e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x30e3('0x2')]},'ecm':{'type':Sequelize[_0x30e3('0x3')](_0x30e3('0x4'),'no'),'defaultValue':_0x30e3('0x4')},'headerinfo':{'type':Sequelize[_0x30e3('0x2')],'defaultValue':_0x30e3('0x5')},'localstationid':{'type':Sequelize[_0x30e3('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x30e3('0x3')](_0x30e3('0x6'),_0x30e3('0x7'),_0x30e3('0x8'),_0x30e3('0x9'),_0x30e3('0xa'),_0x30e3('0xb')),'defaultValue':_0x30e3('0x7')},'maxrate':{'type':Sequelize[_0x30e3('0x3')](_0x30e3('0x6'),_0x30e3('0x7'),_0x30e3('0x8'),_0x30e3('0x9'),'12000',_0x30e3('0xb')),'defaultValue':_0x30e3('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x30e3('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x30e3('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x30e3('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x30e3('0x3')]('SIP',_0x30e3('0xd'),_0x30e3('0xe'),_0x30e3('0xf')),'defaultValue':_0x30e3('0x10')},'key':{'type':Sequelize[_0x30e3('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x30e3('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x30e3('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x30e3('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x30e3('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x30e3('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x30e3('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x30e3('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30e3('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x30e3('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x30e3('0x14'),'set':function(_0x13c8eb){if(!_0x13c8eb)this[_0x30e3('0x15')](_0x30e3('0x16'),null);this[_0x30e3('0x15')]('mandatoryDisposition',_0x13c8eb);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 98d310d..44fc229 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 _0x20d2=['request-promise','moment','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','offset','limit','set','json','apply','reject','save','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','FaxAccount','count','include','rows','show','options','find','create','user','autoAssociation','update','body','params','describe','FaxAccountId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','includeAll','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','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','ListId','FaxMessage','$gte','split','format','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','isNil','path','from','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x1c612a,_0x58cf11){var _0x4d5dd4=function(_0x292989){while(--_0x292989){_0x1c612a['push'](_0x1c612a['shift']());}};_0x4d5dd4(++_0x58cf11);}(_0x20d2,0x17e));var _0x220d=function(_0x17ede9,_0x27d731){_0x17ede9=_0x17ede9-0x0;var _0x35b71d=_0x20d2[_0x17ede9];return _0x35b71d;};'use strict';var pdf=require(_0x220d('0x0'));var emlformat=require(_0x220d('0x1'));var rimraf=require(_0x220d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x220d('0x3'));var rp=require(_0x220d('0x4'));var moment=require(_0x220d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x220d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x220d('0x7'));var csv=require(_0x220d('0x8'));var ejs=require(_0x220d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x220d('0xa'));var jsforce=require(_0x220d('0xb'));var deskjs=require(_0x220d('0xc'));var toCsv=require(_0x220d('0x8'));var querystring=require(_0x220d('0xd'));var Papa=require(_0x220d('0xe'));var authService=require(_0x220d('0xf'));var hardwareService=require(_0x220d('0x10'));var Redis=require(_0x220d('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x220d('0x12'))(_0x220d('0x13'));var utils=require(_0x220d('0x14'));var config=require('../../config/environment');var db=require(_0x220d('0x15'))['db'];config[_0x220d('0x16')]=_[_0x220d('0x17')](config[_0x220d('0x16')],{'host':_0x220d('0x18'),'port':0x18eb});var socket=require(_0x220d('0x19'))(new Redis(config['redis']));require(_0x220d('0x1a'))[_0x220d('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x220d('0x1c')][_0x220d('0x1d')]({'port':0x232c});var client9002=jayson[_0x220d('0x1c')][_0x220d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5453b5,_0x300196,_0x1ceffd,_0x55d23e){return new BPromise(function(_0x49092f,_0x1d794d){var _0x469f6d=_0x55d23e||client;return _0x469f6d[_0x220d('0x1e')](_0x5453b5,_0x1ceffd)['then'](function(_0x444764){logger['info']('FaxAccount,\x20%s,\x20%s',_0x300196,'request\x20sent');logger['debug'](_0x220d('0x1f'),_0x300196,_0x220d('0x20'),JSON[_0x220d('0x21')](_0x444764));if(_0x444764[_0x220d('0x22')]){if(_0x444764[_0x220d('0x22')][_0x220d('0x23')]===0x1f4){logger[_0x220d('0x22')](_0x220d('0x24'),_0x300196,_0x444764['error'][_0x220d('0x25')]);return _0x1d794d(_0x444764[_0x220d('0x22')]['message']);}logger[_0x220d('0x22')](_0x220d('0x24'),_0x300196,_0x444764[_0x220d('0x22')][_0x220d('0x25')]);return _0x49092f(_0x444764[_0x220d('0x22')][_0x220d('0x25')]);}else{logger['info'](_0x220d('0x24'),_0x300196,'request\x20sent');_0x49092f(_0x444764['result'][_0x220d('0x25')]);}})[_0x220d('0x26')](function(_0x27ba39){logger[_0x220d('0x22')](_0x220d('0x24'),_0x300196,_0x27ba39);_0x1d794d(_0x27ba39);});});}function respondWithStatusCode(_0x9ff333,_0x37849e){_0x37849e=_0x37849e||0xcc;return function(_0xc9245c){if(_0xc9245c){return _0x9ff333[_0x220d('0x27')](_0x37849e);}return _0x9ff333['status'](_0x37849e)[_0x220d('0x28')]();};}function respondWithResult(_0x1ea146,_0x3b7869){_0x3b7869=_0x3b7869||0xc8;return function(_0x15ffef){if(_0x15ffef){return _0x1ea146[_0x220d('0x29')](_0x3b7869)['json'](_0x15ffef);}};}function respondWithFilteredResult(_0x2a3c52,_0x388e61){return function(_0x1ab182){if(_0x1ab182){var _0xf57660=_0x1ab182['count'],_0x4b8b72=_0x388e61['offset'],_0x3e65c4=_0x388e61[_0x220d('0x2a')]+_0x388e61[_0x220d('0x2b')],_0x40158e;if(_0x3e65c4>=_0xf57660){_0x3e65c4=_0xf57660;_0x40158e=0xc8;}else{_0x40158e=0xce;}_0x2a3c52[_0x220d('0x29')](_0x40158e);return _0x2a3c52[_0x220d('0x2c')]('Content-Range',_0x4b8b72+'-'+_0x3e65c4+'/'+_0xf57660)[_0x220d('0x2d')](_0x1ab182);}return null;};}function patchUpdates(_0x4dad00){return function(_0x4d19ab){try{jsonpatch[_0x220d('0x2e')](_0x4d19ab,_0x4dad00,!![]);}catch(_0x11c786){return BPromise[_0x220d('0x2f')](_0x11c786);}return _0x4d19ab[_0x220d('0x30')]();};}function saveUpdates(_0x2903d0,_0x56d86b){return function(_0x340d45){if(_0x340d45){return _0x340d45['update'](_0x2903d0)[_0x220d('0x31')](function(_0x2ff65a){return _0x2ff65a;});}return null;};}function removeEntity(_0x407401,_0x5e8d07){return function(_0x2801c9){if(_0x2801c9){return _0x2801c9[_0x220d('0x32')]()[_0x220d('0x31')](function(){var _0xbbc896=_0x2801c9[_0x220d('0x33')]({'plain':!![]});var _0x3d69ce=_0x220d('0x34');return db[_0x220d('0x35')][_0x220d('0x32')]({'where':{'type':_0x3d69ce,'resourceId':_0xbbc896['id']}})[_0x220d('0x31')](function(){return _0x2801c9;});})[_0x220d('0x31')](function(){_0x407401[_0x220d('0x29')](0xcc)[_0x220d('0x28')]();});}};}function handleEntityNotFound(_0x29292c,_0x16b396){return function(_0x21418c){if(!_0x21418c){_0x29292c['sendStatus'](0x194);}return _0x21418c;};}function handleError(_0x44b04e,_0x101956){_0x101956=_0x101956||0x1f4;return function(_0xbfffab){logger[_0x220d('0x22')](_0xbfffab[_0x220d('0x36')]);if(_0xbfffab[_0x220d('0x37')]){delete _0xbfffab['name'];}_0x44b04e[_0x220d('0x29')](_0x101956)[_0x220d('0x38')](_0xbfffab);};}exports['index']=function(_0x1fd50,_0x178ceb){var _0x26de10={'include':[{'model':db[_0x220d('0x39')],'as':_0x220d('0x3a')}]},_0x5c6224={},_0x259d0e={'count':0x0,'rows':[]};var _0x503c5f=db['FaxAccount'][_0x220d('0x3b')];_0x5c6224[_0x220d('0x3c')]=_[_0x220d('0x3d')](_0x503c5f);_0x5c6224[_0x220d('0x3e')]=_[_0x220d('0x3d')](_0x1fd50['query']);_0x5c6224[_0x220d('0x3f')]=_[_0x220d('0x40')](_0x5c6224[_0x220d('0x3c')],_0x5c6224['query']);_0x26de10[_0x220d('0x41')]=_['intersection'](_0x5c6224[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x1fd50[_0x220d('0x3e')][_0x220d('0x42')]));_0x26de10[_0x220d('0x41')]=_0x26de10[_0x220d('0x41')][_0x220d('0x43')]?_0x26de10['attributes']:_0x5c6224[_0x220d('0x3c')];if(!_0x1fd50[_0x220d('0x3e')][_0x220d('0x44')](_0x220d('0x45'))){_0x26de10['limit']=qs[_0x220d('0x2b')](_0x1fd50[_0x220d('0x3e')][_0x220d('0x2b')]);_0x26de10[_0x220d('0x2a')]=qs[_0x220d('0x2a')](_0x1fd50[_0x220d('0x3e')][_0x220d('0x2a')]);}_0x26de10[_0x220d('0x46')]=qs[_0x220d('0x47')](_0x1fd50[_0x220d('0x3e')][_0x220d('0x47')]);_0x26de10[_0x220d('0x48')]=qs[_0x220d('0x3f')](_['pick'](_0x1fd50['query'],_0x5c6224[_0x220d('0x3f')]));if(_0x1fd50['query'][_0x220d('0x49')]){_0x26de10[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x26de10['where'],{'$or':_[_0x220d('0x4b')](_0x503c5f,function(_0x1db1ed){if(_0x1db1ed[_0x220d('0x4c')][_0x220d('0x4d')]!==_0x220d('0x4e')){var _0x5dede1={};_0x5dede1[_0x1db1ed['field']]={'$like':'%'+_0x1fd50['query'][_0x220d('0x49')]+'%'};return _0x5dede1;}})});}_0x26de10=_[_0x220d('0x4a')]({},_0x26de10,_0x1fd50['options']);var _0x33b483={'where':_0x26de10[_0x220d('0x48')]};return db[_0x220d('0x4f')][_0x220d('0x50')](_0x33b483)[_0x220d('0x31')](function(_0x1acaef){_0x259d0e[_0x220d('0x50')]=_0x1acaef;if(_0x1fd50['query']['includeAll']){_0x26de10[_0x220d('0x51')]=[{'all':!![]}];}return db[_0x220d('0x4f')]['findAll'](_0x26de10);})[_0x220d('0x31')](function(_0x50fb60){_0x259d0e[_0x220d('0x52')]=_0x50fb60;return _0x259d0e;})['then'](respondWithFilteredResult(_0x178ceb,_0x26de10))[_0x220d('0x26')](handleError(_0x178ceb,null));};exports[_0x220d('0x53')]=function(_0x5b0333,_0x203e49){var _0x14ebce={'raw':![],'where':{'id':_0x5b0333['params']['id']},'include':[{'model':db[_0x220d('0x39')],'as':_0x220d('0x3a')}]},_0x14db37={};_0x14db37[_0x220d('0x3c')]=_[_0x220d('0x3d')](db[_0x220d('0x4f')]['rawAttributes']);_0x14db37[_0x220d('0x3e')]=_[_0x220d('0x3d')](_0x5b0333['query']);_0x14db37['filters']=_[_0x220d('0x40')](_0x14db37[_0x220d('0x3c')],_0x14db37[_0x220d('0x3e')]);_0x14ebce[_0x220d('0x41')]=_['intersection'](_0x14db37[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x5b0333[_0x220d('0x3e')]['fields']));_0x14ebce[_0x220d('0x41')]=_0x14ebce[_0x220d('0x41')][_0x220d('0x43')]?_0x14ebce[_0x220d('0x41')]:_0x14db37[_0x220d('0x3c')];if(_0x5b0333[_0x220d('0x3e')]['includeAll']){_0x14ebce['include']=[{'all':!![]}];}_0x14ebce=_[_0x220d('0x4a')]({},_0x14ebce,_0x5b0333[_0x220d('0x54')]);return db['FaxAccount'][_0x220d('0x55')](_0x14ebce)[_0x220d('0x31')](handleEntityNotFound(_0x203e49,null))[_0x220d('0x31')](respondWithResult(_0x203e49,null))[_0x220d('0x26')](handleError(_0x203e49,null));};exports[_0x220d('0x56')]=function(_0x4b1097,_0x40c323){return db['FaxAccount']['create'](_0x4b1097['body'],{})[_0x220d('0x31')](function(_0x1d994a){var _0x1fd6af=_0x4b1097[_0x220d('0x57')]['get']({'plain':!![]});if(!_0x1fd6af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fd6af['role']===_0x220d('0x57')){var _0x5e698f=_0x1d994a[_0x220d('0x33')]({'plain':!![]});var _0x10335d='FaxAccounts';return db['UserProfileSection'][_0x220d('0x55')]({'where':{'name':_0x10335d,'userProfileId':_0x1fd6af['userProfileId']},'raw':!![]})[_0x220d('0x31')](function(_0x1353ef){if(_0x1353ef&&_0x1353ef[_0x220d('0x58')]===0x0){return db[_0x220d('0x35')][_0x220d('0x56')]({'name':_0x5e698f['name'],'resourceId':_0x5e698f['id'],'type':_0x1353ef[_0x220d('0x37')],'sectionId':_0x1353ef['id']},{})[_0x220d('0x31')](function(){return _0x1d994a;});}else{return _0x1d994a;}})[_0x220d('0x26')](function(_0x4ba728){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba728);throw _0x4ba728;});}return _0x1d994a;})[_0x220d('0x31')](respondWithResult(_0x40c323,0xc9))[_0x220d('0x26')](handleError(_0x40c323,null));};exports[_0x220d('0x59')]=function(_0xcc0393,_0xb1da70){if(_0xcc0393['body']['id']){delete _0xcc0393[_0x220d('0x5a')]['id'];}return db['FaxAccount'][_0x220d('0x55')]({'where':{'id':_0xcc0393[_0x220d('0x5b')]['id']},'include':[{'model':db[_0x220d('0x39')],'as':_0x220d('0x3a')}]})['then'](handleEntityNotFound(_0xb1da70,null))['then'](saveUpdates(_0xcc0393[_0x220d('0x5a')],null))[_0x220d('0x31')](respondWithResult(_0xb1da70,null))['catch'](handleError(_0xb1da70,null));};exports[_0x220d('0x32')]=function(_0x374846,_0x3a92c4){return db['FaxAccount'][_0x220d('0x55')]({'where':{'id':_0x374846['params']['id']}})['then'](handleEntityNotFound(_0x3a92c4,null))[_0x220d('0x31')](removeEntity(_0x3a92c4,null))['catch'](handleError(_0x3a92c4,null));};exports[_0x220d('0x5c')]=function(_0x262f9a,_0x762b16){return db[_0x220d('0x4f')][_0x220d('0x5c')]()[_0x220d('0x31')](respondWithResult(_0x762b16,null))[_0x220d('0x26')](handleError(_0x762b16,null));};exports['addDisposition']=function(_0x376526,_0x266d9a,_0x18fabb){if(_0x376526[_0x220d('0x5a')]['id']){delete _0x376526['body']['id'];}return db[_0x220d('0x4f')][_0x220d('0x55')]({'where':{'id':_0x376526[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x266d9a,null))['then'](function(_0x52cd6b){if(_0x52cd6b){_0x376526[_0x220d('0x5a')][_0x220d('0x5d')]=_0x52cd6b['id'];return db[_0x220d('0x5e')][_0x220d('0x56')](_0x376526[_0x220d('0x5a')]);}})[_0x220d('0x31')](respondWithResult(_0x266d9a,null))[_0x220d('0x26')](handleError(_0x266d9a,null));};exports[_0x220d('0x5f')]=function(_0x22055f,_0x38b350,_0x2450ba){var _0x39856f={'raw':![],'where':{}};var _0x468f57={};var _0x471809={'count':0x0,'rows':[]};return db['FaxAccount'][_0x220d('0x60')]({'where':{'id':_0x22055f[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x38b350,null))[_0x220d('0x31')](function(_0x596a){if(_0x596a){_0x468f57[_0x220d('0x3c')]=_[_0x220d('0x3d')](db['Disposition']['rawAttributes']);_0x468f57[_0x220d('0x3e')]=_['keys'](_0x22055f['query']);_0x468f57[_0x220d('0x3f')]=_[_0x220d('0x40')](_0x468f57[_0x220d('0x3c')],_0x468f57[_0x220d('0x3e')]);_0x39856f[_0x220d('0x41')]=_[_0x220d('0x40')](_0x468f57[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x22055f['query']['fields']));_0x39856f['attributes']=_0x39856f[_0x220d('0x41')][_0x220d('0x43')]?_0x39856f['attributes']:_0x468f57['model'];if(!_0x22055f[_0x220d('0x3e')]['hasOwnProperty']('nolimit')){_0x39856f[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x22055f[_0x220d('0x3e')][_0x220d('0x2b')]);_0x39856f[_0x220d('0x2a')]=qs[_0x220d('0x2a')](_0x22055f[_0x220d('0x3e')][_0x220d('0x2a')]);}_0x39856f['order']=qs[_0x220d('0x47')](_0x22055f[_0x220d('0x3e')][_0x220d('0x47')]);_0x39856f[_0x220d('0x48')]=qs[_0x220d('0x3f')](_[_0x220d('0x61')](_0x22055f[_0x220d('0x3e')],_0x468f57[_0x220d('0x3f')]));_0x39856f[_0x220d('0x48')][_0x220d('0x5d')]=_0x596a['id'];if(_0x22055f[_0x220d('0x3e')][_0x220d('0x49')]){_0x39856f[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x39856f[_0x220d('0x48')],{'$or':_[_0x220d('0x4b')](_0x39856f[_0x220d('0x41')],function(_0x518e7e){var _0x107a6f={};_0x107a6f[_0x518e7e]={'$like':'%'+_0x22055f[_0x220d('0x3e')][_0x220d('0x49')]+'%'};return _0x107a6f;})});}_0x39856f=_['merge']({},_0x39856f,_0x22055f[_0x220d('0x54')]);return db['Disposition'][_0x220d('0x50')]({'where':_0x39856f[_0x220d('0x48')]})[_0x220d('0x31')](function(_0x57c77f){_0x471809[_0x220d('0x50')]=_0x57c77f;if(_0x22055f[_0x220d('0x3e')]['includeAll']){_0x39856f[_0x220d('0x51')]=[{'all':!![]}];}return db[_0x220d('0x5e')][_0x220d('0x62')](_0x39856f);})[_0x220d('0x31')](function(_0x4d1b91){_0x471809[_0x220d('0x52')]=_0x4d1b91;return _0x471809;});}})[_0x220d('0x31')](respondWithFilteredResult(_0x38b350,_0x39856f))[_0x220d('0x26')](handleError(_0x38b350,null));};exports[_0x220d('0x63')]=function(_0x4c924c,_0x41d3c0,_0xd79c15){var _0x4a3527;return db['FaxAccount'][_0x220d('0x55')]({'where':{'id':_0x4c924c['params']['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x41d3c0,null))['then'](function(_0x3eba2f){if(_0x3eba2f){return _0x3eba2f[_0x220d('0x63')](_0x4c924c[_0x220d('0x3e')]['ids']);}})[_0x220d('0x31')](respondWithStatusCode(_0x41d3c0,null))[_0x220d('0x26')](handleError(_0x41d3c0,null));};exports[_0x220d('0x64')]=function(_0x4660b6,_0x5a7326,_0x6a5be9){if(_0x4660b6[_0x220d('0x5a')]['id']){delete _0x4660b6[_0x220d('0x5a')]['id'];}return db[_0x220d('0x4f')]['find']({'where':{'id':_0x4660b6[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x5a7326,null))[_0x220d('0x31')](function(_0x1e9e05){if(_0x1e9e05){_0x4660b6[_0x220d('0x5a')][_0x220d('0x5d')]=_0x1e9e05['id'];return db[_0x220d('0x65')][_0x220d('0x56')](_0x4660b6[_0x220d('0x5a')]);}})[_0x220d('0x31')](respondWithResult(_0x5a7326,null))['catch'](handleError(_0x5a7326,null));};exports[_0x220d('0x66')]=function(_0x4e6782,_0x5db913,_0x2eb228){var _0x2fe2b5={'raw':![],'where':{}};var _0x149149={};var _0x422458={'count':0x0,'rows':[]};return db[_0x220d('0x4f')][_0x220d('0x60')]({'where':{'id':_0x4e6782[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x5db913,null))[_0x220d('0x31')](function(_0x338f00){if(_0x338f00){_0x149149[_0x220d('0x3c')]=_[_0x220d('0x3d')](db[_0x220d('0x65')][_0x220d('0x3b')]);_0x149149['query']=_[_0x220d('0x3d')](_0x4e6782[_0x220d('0x3e')]);_0x149149['filters']=_[_0x220d('0x40')](_0x149149[_0x220d('0x3c')],_0x149149[_0x220d('0x3e')]);_0x2fe2b5[_0x220d('0x41')]=_['intersection'](_0x149149[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x4e6782[_0x220d('0x3e')][_0x220d('0x42')]));_0x2fe2b5[_0x220d('0x41')]=_0x2fe2b5['attributes'][_0x220d('0x43')]?_0x2fe2b5[_0x220d('0x41')]:_0x149149['model'];if(!_0x4e6782['query'][_0x220d('0x44')](_0x220d('0x45'))){_0x2fe2b5[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x4e6782[_0x220d('0x3e')][_0x220d('0x2b')]);_0x2fe2b5[_0x220d('0x2a')]=qs[_0x220d('0x2a')](_0x4e6782[_0x220d('0x3e')][_0x220d('0x2a')]);}_0x2fe2b5['order']=qs['sort'](_0x4e6782['query'][_0x220d('0x47')]);_0x2fe2b5[_0x220d('0x48')]=qs[_0x220d('0x3f')](_['pick'](_0x4e6782['query'],_0x149149[_0x220d('0x3f')]));_0x2fe2b5[_0x220d('0x48')][_0x220d('0x5d')]=_0x338f00['id'];if(_0x4e6782[_0x220d('0x3e')][_0x220d('0x49')]){_0x2fe2b5[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x2fe2b5[_0x220d('0x48')],{'$or':_['map'](_0x2fe2b5['attributes'],function(_0x80ec14){var _0x556a1b={};_0x556a1b[_0x80ec14]={'$like':'%'+_0x4e6782[_0x220d('0x3e')][_0x220d('0x49')]+'%'};return _0x556a1b;})});}_0x2fe2b5=_[_0x220d('0x4a')]({},_0x2fe2b5,_0x4e6782[_0x220d('0x54')]);return db[_0x220d('0x65')][_0x220d('0x50')]({'where':_0x2fe2b5['where']})[_0x220d('0x31')](function(_0x1e6da3){_0x422458[_0x220d('0x50')]=_0x1e6da3;if(_0x4e6782['query'][_0x220d('0x67')]){_0x2fe2b5['include']=[{'all':!![]}];}return db[_0x220d('0x65')][_0x220d('0x62')](_0x2fe2b5);})[_0x220d('0x31')](function(_0x19fc61){_0x422458['rows']=_0x19fc61;return _0x422458;});}})[_0x220d('0x31')](respondWithFilteredResult(_0x5db913,_0x2fe2b5))[_0x220d('0x26')](handleError(_0x5db913,null));};exports[_0x220d('0x68')]=function(_0x4e77d5,_0x232d93,_0x2c4f6c){var _0x5c8e50;return db[_0x220d('0x4f')]['find']({'where':{'id':_0x4e77d5['params']['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x232d93,null))[_0x220d('0x31')](function(_0x380c8c){if(_0x380c8c){return _0x380c8c[_0x220d('0x68')](_0x4e77d5[_0x220d('0x3e')][_0x220d('0x69')]);}})[_0x220d('0x31')](respondWithStatusCode(_0x232d93,null))[_0x220d('0x26')](handleError(_0x232d93,null));};exports[_0x220d('0x6a')]=function(_0x440de1,_0x56d620,_0x314a30){return db[_0x220d('0x6b')]['find']({'where':{'id':_0x440de1['params']['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x56d620,null))[_0x220d('0x31')](function(_0x34e5b0){if(_0x34e5b0){return _0x34e5b0[_0x220d('0x6a')](_0x440de1[_0x220d('0x5a')][_0x220d('0x69')],_[_0x220d('0x6c')](_0x440de1[_0x220d('0x5a')],[_0x220d('0x69'),'id'])||{});}})[_0x220d('0x31')](respondWithResult(_0x56d620,null))[_0x220d('0x26')](handleError(_0x56d620,null));};exports[_0x220d('0x6d')]=function(_0x4fa24f,_0x183fa6,_0x45d2b1){var _0x47c945={'raw':![],'where':{}};var _0x43de3d={};var _0x405974={'count':0x0,'rows':[]};return db['FaxAccount'][_0x220d('0x60')]({'where':{'id':_0x4fa24f[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x183fa6,null))[_0x220d('0x31')](function(_0x208742){if(_0x208742){_0x43de3d[_0x220d('0x3c')]=_[_0x220d('0x3d')](db[_0x220d('0x6b')]['rawAttributes']);_0x43de3d['query']=_[_0x220d('0x3d')](_0x4fa24f[_0x220d('0x3e')]);_0x43de3d[_0x220d('0x3f')]=_['intersection'](_0x43de3d[_0x220d('0x3c')],_0x43de3d[_0x220d('0x3e')]);_0x47c945[_0x220d('0x41')]=_[_0x220d('0x40')](_0x43de3d[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x4fa24f[_0x220d('0x3e')]['fields']));_0x47c945[_0x220d('0x41')]=_0x47c945[_0x220d('0x41')][_0x220d('0x43')]?_0x47c945['attributes']:_0x43de3d[_0x220d('0x3c')];if(!_0x4fa24f[_0x220d('0x3e')][_0x220d('0x44')](_0x220d('0x45'))){_0x47c945[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x4fa24f[_0x220d('0x3e')][_0x220d('0x2b')]);_0x47c945['offset']=qs[_0x220d('0x2a')](_0x4fa24f[_0x220d('0x3e')][_0x220d('0x2a')]);}_0x47c945[_0x220d('0x46')]=qs[_0x220d('0x47')](_0x4fa24f[_0x220d('0x3e')][_0x220d('0x47')]);_0x47c945[_0x220d('0x48')]=qs[_0x220d('0x3f')](_[_0x220d('0x61')](_0x4fa24f[_0x220d('0x3e')],_0x43de3d[_0x220d('0x3f')]));_0x47c945[_0x220d('0x48')]['FaxAccountId']=_0x208742['id'];if(_0x4fa24f['query'][_0x220d('0x49')]){_0x47c945[_0x220d('0x48')]=_['merge'](_0x47c945[_0x220d('0x48')],{'$or':_[_0x220d('0x4b')](_0x47c945['attributes'],function(_0x458aff){var _0x231e7f={};_0x231e7f[_0x458aff]={'$like':'%'+_0x4fa24f[_0x220d('0x3e')][_0x220d('0x49')]+'%'};return _0x231e7f;})});}_0x47c945=_[_0x220d('0x4a')]({},_0x47c945,_0x4fa24f[_0x220d('0x54')]);return db[_0x220d('0x6b')][_0x220d('0x50')]({'where':_0x47c945[_0x220d('0x48')]})[_0x220d('0x31')](function(_0x481e43){_0x405974[_0x220d('0x50')]=_0x481e43;if(_0x4fa24f[_0x220d('0x3e')][_0x220d('0x67')]){_0x47c945[_0x220d('0x51')]=[{'model':db[_0x220d('0x6e')],'as':_0x220d('0x6f'),'required':![]},{'model':db['User'],'as':_0x220d('0x70'),'attributes':[_0x220d('0x37'),_0x220d('0x71'),'internal'],'required':![]},{'model':db[_0x220d('0x72')],'as':_0x220d('0x73'),'attributes':['id','name',_0x220d('0x74')],'where':_0x4fa24f[_0x220d('0x3e')][_0x220d('0x75')]?{'id':_0x4fa24f[_0x220d('0x3e')][_0x220d('0x75')]}:undefined,'required':_0x4fa24f[_0x220d('0x3e')][_0x220d('0x75')]?!![]:![]}];}return db[_0x220d('0x6b')][_0x220d('0x62')](_0x47c945);})[_0x220d('0x31')](function(_0x5d98c2){_0x405974['rows']=_0x5d98c2;return _0x405974;});}})[_0x220d('0x31')](respondWithFilteredResult(_0x183fa6,_0x47c945))[_0x220d('0x26')](handleError(_0x183fa6,null));};exports[_0x220d('0x76')]=function(_0x3ce7f7,_0x510c08,_0x1c4bc3){return db[_0x220d('0x4f')][_0x220d('0x60')]({'where':{'id':_0x3ce7f7[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x510c08,null))[_0x220d('0x31')](function(_0x1181f7){if(_0x1181f7){return db[_0x220d('0x77')][_0x220d('0x78')](function(_0x1a9573){return db[_0x220d('0x79')][_0x220d('0x32')]({'where':{'FaxAccountId':_0x3ce7f7[_0x220d('0x5b')]['id']},'transaction':_0x1a9573})['then'](function(_0x2c069b){var _0x40cb35=_[_0x220d('0x4b')](_0x3ce7f7[_0x220d('0x5a')],function(_0x7d6f9a){_0x7d6f9a[_0x220d('0x5d')]=_0x3ce7f7['params']['id'];return _0x7d6f9a;});return db[_0x220d('0x79')][_0x220d('0x7a')](_0x40cb35,{'transaction':_0x1a9573});});})[_0x220d('0x31')](function(){return db[_0x220d('0x79')][_0x220d('0x7b')]({'where':{'FaxAccountId':_0x3ce7f7[_0x220d('0x5b')]['id']},'order':_0x220d('0x7c')});});}})[_0x220d('0x31')](respondWithResult(_0x510c08,null))[_0x220d('0x26')](handleError(_0x510c08,null));};exports[_0x220d('0x7d')]=function(_0x1bb71b,_0x20a592,_0x242fb6){var _0x274bd9={};var _0x5cd1b2={};var _0xa7237a;var _0x274dcd;return db[_0x220d('0x4f')][_0x220d('0x60')]({'where':{'id':_0x1bb71b['params']['id']}})['then'](handleEntityNotFound(_0x20a592,null))[_0x220d('0x31')](function(_0xa350ea){if(_0xa350ea){_0xa7237a=_0xa350ea;_0x5cd1b2[_0x220d('0x3c')]=_[_0x220d('0x3d')](db['FaxApplication'][_0x220d('0x3b')]);_0x5cd1b2[_0x220d('0x3e')]=_[_0x220d('0x3d')](_0x1bb71b['query']);_0x5cd1b2['filters']=_[_0x220d('0x40')](_0x5cd1b2[_0x220d('0x3c')],_0x5cd1b2[_0x220d('0x3e')]);_0x274bd9[_0x220d('0x41')]=_[_0x220d('0x40')](_0x5cd1b2[_0x220d('0x3c')],qs['fields'](_0x1bb71b['query']['fields']));_0x274bd9['attributes']=_0x274bd9[_0x220d('0x41')][_0x220d('0x43')]?_0x274bd9[_0x220d('0x41')]:_0x5cd1b2[_0x220d('0x3c')];_0x274bd9[_0x220d('0x46')]=qs[_0x220d('0x47')](_0x1bb71b[_0x220d('0x3e')][_0x220d('0x47')]);_0x274bd9[_0x220d('0x48')]=qs[_0x220d('0x3f')](_[_0x220d('0x61')](_0x1bb71b[_0x220d('0x3e')],_0x5cd1b2[_0x220d('0x3f')]));if(_0x1bb71b[_0x220d('0x3e')][_0x220d('0x49')]){_0x274bd9[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x274bd9[_0x220d('0x48')],{'$or':_[_0x220d('0x4b')](_0x274bd9[_0x220d('0x41')],function(_0x3ca904){var _0x5a46c8={};_0x5a46c8[_0x3ca904]={'$like':'%'+_0x1bb71b[_0x220d('0x3e')][_0x220d('0x49')]+'%'};return _0x5a46c8;})});}_0x274bd9=_[_0x220d('0x4a')]({},_0x274bd9,_0x1bb71b[_0x220d('0x54')]);return _0xa7237a[_0x220d('0x7d')](_0x274bd9);}})[_0x220d('0x31')](function(_0x34cbb2){if(_0x34cbb2){_0x274dcd=_0x34cbb2[_0x220d('0x43')];if(!_0x1bb71b[_0x220d('0x3e')][_0x220d('0x44')]('nolimit')){_0x274bd9[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x1bb71b[_0x220d('0x3e')][_0x220d('0x2b')]);_0x274bd9[_0x220d('0x2a')]=qs['offset'](_0x1bb71b[_0x220d('0x3e')][_0x220d('0x2a')]);}return _0xa7237a[_0x220d('0x7d')](_0x274bd9);}})['then'](function(_0x366ea0){if(_0x366ea0){return _0x366ea0?{'count':_0x274dcd,'rows':_0x366ea0}:null;}})[_0x220d('0x31')](respondWithResult(_0x20a592,null))[_0x220d('0x26')](handleError(_0x20a592,null));};function Extension(_0x41ba71,_0x36cc1b,_0x3b1b07,_0x2f476f){this[_0x220d('0x7e')]=_0x220d('0x7f');this['exten']=_0x41ba71[_0x220d('0x80')];this[_0x220d('0x81')]=_0x2f476f;this[_0x220d('0x4c')]=_0x220d('0x82');this[_0x220d('0x83')]=_0x220d('0x84');this['FaxAccountId']=_0x41ba71['id'];this[_0x220d('0x7c')]=_0x36cc1b;this[_0x220d('0x85')]=_0x3b1b07;}function createExtensionsReciveFax(_0x15f0ed){var _0x2245c8=0x1;var _0x425a90=[];_0x425a90[_0x220d('0x86')](new Extension(_0x15f0ed,_0x2245c8,'',_0x220d('0x87')));_0x2245c8+=0x1;_0x425a90[_0x220d('0x86')](new Extension(_0x15f0ed,_0x2245c8,_0x220d('0x88'),_0x220d('0x89')));_0x2245c8+=0x1;for(var _0x2024ca in _0x15f0ed){if(_0x15f0ed['hasOwnProperty'](_0x2024ca)&&(_0x2024ca===_0x220d('0x8a')||_0x2024ca===_0x220d('0x80')||_0x2024ca===_0x220d('0x8b')||_0x2024ca===_0x220d('0x8c')||_0x2024ca===_0x220d('0x8d')||_0x2024ca==='maxrate'||_0x2024ca===_0x220d('0x8e')||_0x2024ca===_0x220d('0x8f')||_0x2024ca===_0x220d('0x90'))){_0x425a90['push'](new Extension(_0x15f0ed,_0x2245c8,_0x220d('0x91')+_0x2024ca+')='+_0x15f0ed[_0x2024ca],_0x220d('0x89')));_0x2245c8+=0x1;}}_0x425a90[_0x220d('0x86')](new Extension(_0x15f0ed,_0x2245c8,'6',_0x220d('0x92')));_0x2245c8+=0x1;_0x425a90[_0x220d('0x86')](new Extension(_0x15f0ed,_0x2245c8,_0x220d('0x93'),_0x220d('0x94')));_0x2245c8=0x0;return _0x425a90;}exports[_0x220d('0x95')]=function(_0x524d5d,_0x4796ed,_0xfc0ee8){var _0x47540b;return db['sequelize'][_0x220d('0x78')](function(_0x5ac55e){return db[_0x220d('0x4f')][_0x220d('0x56')](_0x524d5d[_0x220d('0x5a')],{'transaction':_0x5ac55e})[_0x220d('0x31')](function(_0xeb5914){_0x47540b=_0xeb5914[_0x220d('0x33')]({'plain':!![]});return db[_0x220d('0x96')][_0x220d('0x7a')](createExtensionsReciveFax(_0x47540b),{'transaction':_0x5ac55e});});})[_0x220d('0x31')](function(){return _0x47540b;})[_0x220d('0x31')](respondWithResult(_0x4796ed,null))[_0x220d('0x26')](handleError(_0x4796ed,null));};exports[_0x220d('0x97')]=function(_0x5c6b6e,_0x2778ae,_0x156e0e){var _0x1181b1;return db[_0x220d('0x77')]['transaction'](function(_0xd6fe8b){return db['FaxAccount'][_0x220d('0x59')](_0x5c6b6e[_0x220d('0x5a')],{'where':{'id':_0x5c6b6e[_0x220d('0x5a')]['id']},'transaction':_0xd6fe8b})['then'](function(_0x8a77a7){return db[_0x220d('0x96')][_0x220d('0x32')]({'where':{'FaxAccountId':_0x5c6b6e[_0x220d('0x5a')]['id']},'transaction':_0xd6fe8b})[_0x220d('0x31')](function(_0x564bb2){return db['VoiceExtension'][_0x220d('0x7a')](createExtensionsReciveFax(_['omit'](_0x5c6b6e[_0x220d('0x5a')],[_0x220d('0x98'),_0x220d('0x4d'),_0x220d('0x99'),_0x220d('0x9a'),_0x220d('0x9b'),_0x220d('0x9c')])),{'transaction':_0xd6fe8b});});});})[_0x220d('0x31')](function(){return db['FaxAccount']['findById'](_0x5c6b6e['body']['id']);})[_0x220d('0x31')](respondWithResult(_0x2778ae,null))[_0x220d('0x26')](handleError(_0x2778ae,null));};exports['getMessages']=function(_0x586adc,_0x33a45a,_0x38ce7b){var _0x1ff9e7={'raw':!![],'where':{}};var _0x40332a={};var _0x55aa27={'count':0x0,'rows':[]};return db['FaxAccount'][_0x220d('0x60')]({'where':{'id':_0x586adc[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x33a45a,null))[_0x220d('0x31')](function(_0x4222b8){if(_0x4222b8){_0x40332a[_0x220d('0x3c')]=_['keys'](db[_0x220d('0x9d')][_0x220d('0x3b')]);_0x40332a['query']=_['keys'](_0x586adc[_0x220d('0x3e')]);_0x40332a[_0x220d('0x3f')]=_[_0x220d('0x40')](_0x40332a['model'],_0x40332a[_0x220d('0x3e')]);_0x1ff9e7[_0x220d('0x41')]=_[_0x220d('0x40')](_0x40332a[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x586adc[_0x220d('0x3e')]['fields']));_0x1ff9e7[_0x220d('0x41')]=_0x1ff9e7[_0x220d('0x41')][_0x220d('0x43')]?_0x1ff9e7[_0x220d('0x41')]:_0x40332a[_0x220d('0x3c')];if(!_0x586adc['query'][_0x220d('0x44')](_0x220d('0x45'))){_0x1ff9e7[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x586adc[_0x220d('0x3e')][_0x220d('0x2b')]);_0x1ff9e7['offset']=qs[_0x220d('0x2a')](_0x586adc[_0x220d('0x3e')][_0x220d('0x2a')]);}_0x1ff9e7['order']=qs[_0x220d('0x47')](_0x586adc[_0x220d('0x3e')][_0x220d('0x47')]);_0x1ff9e7[_0x220d('0x48')]=qs[_0x220d('0x3f')](_[_0x220d('0x61')](_0x586adc[_0x220d('0x3e')],_0x40332a[_0x220d('0x3f')]));_0x1ff9e7[_0x220d('0x48')][_0x220d('0x5d')]=_0x4222b8['id'];if(_0x586adc[_0x220d('0x3e')][_0x220d('0x49')]){_0x1ff9e7[_0x220d('0x48')]=_['merge'](_0x1ff9e7[_0x220d('0x48')],{'$or':_[_0x220d('0x4b')](_0x1ff9e7[_0x220d('0x41')],function(_0xaa3ae1){var _0x1ea449={};_0x1ea449[_0xaa3ae1]={'$like':'%'+_0x586adc[_0x220d('0x3e')][_0x220d('0x49')]+'%'};return _0x1ea449;})});}if(_0x586adc['query'][_0x220d('0x9e')]){var _0x9a3302=_0x586adc[_0x220d('0x3e')][_0x220d('0x9e')][_0x220d('0x9f')](',');var _0x2d794c={};_0x2d794c[_0x9a3302[0x0]]={'$gte':moment(_0x9a3302[0x1])[_0x220d('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1ff9e7[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x1ff9e7[_0x220d('0x48')],_0x2d794c);}_0x1ff9e7=_[_0x220d('0x4a')]({},_0x1ff9e7,_0x586adc[_0x220d('0x54')]);return db[_0x220d('0x9d')]['count']({'where':_0x1ff9e7[_0x220d('0x48')]})['then'](function(_0x42bb3d){_0x55aa27[_0x220d('0x50')]=_0x42bb3d;if(_0x586adc[_0x220d('0x3e')]['includeAll']){_0x1ff9e7[_0x220d('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0x220d('0x62')](_0x1ff9e7);})[_0x220d('0x31')](function(_0x29211d){_0x55aa27[_0x220d('0x52')]=_0x29211d;return _0x55aa27;});}})[_0x220d('0x31')](respondWithFilteredResult(_0x33a45a,_0x1ff9e7))[_0x220d('0x26')](handleError(_0x33a45a,null));};exports['send']=function(_0x1dc359,_0x59fe99,_0x3bd31c){var _0x78a718,_0x18c483={},_0x2b03bd;if(_0x1dc359[_0x220d('0x5a')]['to']){_0x2b03bd=_0x1dc359[_0x220d('0x5a')]['to'][0x0];}return db[_0x220d('0x4f')]['find']({'where':{'id':_0x1dc359[_0x220d('0x5b')]['id']},'include':[{'model':db[_0x220d('0xa1')],'as':_0x220d('0xa2'),'include':[{'model':db[_0x220d('0x6e')],'as':'Contacts','where':{'fax':_0x2b03bd},'limit':0x1,'order':[[_0x220d('0x9a'),_0x220d('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x59fe99,null))['then'](function(_0x21d1d4){_0x78a718=_0x21d1d4;if(_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')]&&_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')]['length']){for(var _0x5001e5=0x0;_0x5001e5<_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][_0x220d('0x43')];_0x5001e5+=0x1){_0x1dc359[_0x220d('0x5a')]['attachments'][_0x5001e5]={'filename':_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][_0x5001e5][_0x220d('0x37')],'id':_0x1dc359['body'][_0x220d('0xa4')][_0x5001e5]['id'],'path':path[_0x220d('0xa5')](config[_0x220d('0xa6')],_0x220d('0xa7'),_0x1dc359['body'][_0x220d('0xa4')][_0x5001e5][_0x220d('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x220d('0xa9')](_0x1dc359['params']['id'])?undefined:_0x1dc359[_0x220d('0x5b')]['id'],'path':_['isNil'](_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0]['path'])?undefined:_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0][_0x220d('0xaa')],'fax':_[_0x220d('0xa9')](_0x1dc359['body']['to'][0x0])?undefined:_0x1dc359[_0x220d('0x5a')]['to'][0x0]},client9002);})[_0x220d('0x31')](function(){if(_0x78a718){if(_['isNil'](_0x1dc359[_0x220d('0x5a')][_0x220d('0xab')])){_0x1dc359[_0x220d('0x5a')]['from']=util['format'](_0x220d('0xac'),_0x78a718[_0x220d('0x37')],_0x78a718['fax']);}if(_0x78a718[_0x220d('0xa2')]){if(_0x78a718[_0x220d('0xa2')][_0x220d('0xad')]['length']){return _0x78a718[_0x220d('0xa2')][_0x220d('0xad')][0x0];}else{return db[_0x220d('0x6e')][_0x220d('0x56')](_[_0x220d('0x17')](_0x1dc359['body'],{'firstName':_0x1dc359[_0x220d('0x5a')]['to'][0x0],'phone':_0x1dc359[_0x220d('0x5a')]['to'][0x0],'fax':_0x1dc359[_0x220d('0x5a')]['to'][0x0],'ListId':_0x78a718['ListId']}));}}else{throw new Error(_0x220d('0xae'));}}else{throw new Error(_0x220d('0xaf'));}})[_0x220d('0x31')](function(_0x404a74){if(_0x404a74){return db[_0x220d('0x6b')][_0x220d('0x55')]({'where':{'ContactId':_0x404a74['id'],'closed':![],'FaxAccountId':_0x78a718['id']}})[_0x220d('0x31')](function(_0x1cfd87){if(_0x1cfd87){return[_0x1cfd87,![]];}return db[_0x220d('0x6b')]['create']({'UserId':_0x1dc359[_0x220d('0x57')]['id'],'ContactId':_0x404a74['id'],'FaxAccountId':_0x78a718['id'],'fax':_0x1dc359[_0x220d('0x5a')]['to'][0x0],'firstMsgDirection':_0x220d('0xb0'),'Messages':[_['merge'](_0x1dc359[_0x220d('0x5a')],{'read':![],'body':_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0][_0x220d('0xb1')],'FaxAccountId':_0x78a718['id'],'UserId':_0x1dc359['user']['id'],'ContactId':_0x404a74['id'],'AttachmentId':_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x220d('0x9d')],'as':_0x220d('0xb2')}]})['then'](function(_0x4f44d8){return[_0x4f44d8,!![]];});});}else{throw new Error(_0x220d('0xb3'));}})[_0x220d('0xb4')](function(_0x3bd735,_0x51908d){if(_0x51908d){return _0x3bd735;}return db[_0x220d('0x9d')][_0x220d('0x56')]({'direction':'out','read':![],'body':_0x1dc359['body'][_0x220d('0xa4')][0x0][_0x220d('0xb1')],'FaxAccountId':_0x78a718['id'],'FaxInteractionId':_0x3bd735['id'],'UserId':_0x1dc359[_0x220d('0x57')]['id'],'ContactId':_0x3bd735['ContactId'],'AttachmentId':_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0]['id']})['then'](function(_0x307a25){_0x3bd735[_0x220d('0xb5')][_0x220d('0xb2')]=[];_0x3bd735['dataValues'][_0x220d('0xb2')]['push'](_0x307a25['dataValues']);return _0x3bd735;});})[_0x220d('0x31')](function(_0x53b9f1){respondWithRpcPromise(_0x220d('0xb6'),_0x220d('0xb6'),{'FaxAccountId':_[_0x220d('0xa9')](_0x1dc359['params']['id'])?undefined:_0x1dc359['params']['id'],'path':_[_0x220d('0xa9')](_0x1dc359['body'][_0x220d('0xa4')][0x0][_0x220d('0xaa')])?undefined:_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0][_0x220d('0xaa')],'fax':_['isNil'](_0x1dc359[_0x220d('0x5a')]['to'][0x0])?undefined:_0x1dc359[_0x220d('0x5a')]['to'][0x0],'AttachmentId':_0x1dc359[_0x220d('0x5a')][_0x220d('0xa4')][0x0]['id']},client9002)[_0x220d('0x31')](function(_0x2b9a46){logger[_0x220d('0xb7')](_0x220d('0xb8'),_0x2b9a46);})[_0x220d('0x26')](function(_0x49bf37){logger['info'](_0x220d('0xb8'),_0x49bf37);});return _0x53b9f1;})[_0x220d('0x31')](respondWithResult(_0x59fe99,null))[_0x220d('0x26')](handleError(_0x59fe99,null));};exports[_0x220d('0xb9')]=function(_0x2b520d,_0x590310,_0x23cacb){return db['FaxAccount'][_0x220d('0x55')]({'where':{'id':_0x2b520d[_0x220d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x590310,null))['then'](function(_0x5308cf){if(_0x5308cf){return _0x5308cf[_0x220d('0xb9')](_0x2b520d[_0x220d('0x5a')][_0x220d('0x69')],_['omit'](_0x2b520d[_0x220d('0x5a')],['ids','id'])||{})[_0x220d('0xb4')](function(_0x37f3dc){for(var _0xb8459=0x0;_0xb8459<_0x2b520d[_0x220d('0x5a')][_0x220d('0x69')][_0x220d('0x43')];_0xb8459+=0x1){socket[_0x220d('0xba')](_0x220d('0xbb'),{'UserId':_0x2b520d['body'][_0x220d('0x69')][_0xb8459],'FaxAccountId':_0x2b520d['params']['id']});}return _0x37f3dc;});}})[_0x220d('0x31')](respondWithResult(_0x590310,null))[_0x220d('0x26')](handleError(_0x590310,null));};exports[_0x220d('0xbc')]=function(_0x20dfed,_0x2f37ed,_0xf1bf1b){var _0x452371;return db[_0x220d('0x4f')][_0x220d('0x55')]({'where':{'id':_0x20dfed[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x2f37ed,null))[_0x220d('0x31')](function(_0x2a3130){if(_0x2a3130){return _0x2a3130['removeAgents'](_0x20dfed[_0x220d('0x3e')]['ids'])[_0x220d('0x31')](function(_0x592610){if(_[_0x220d('0xbd')](_0x20dfed[_0x220d('0x3e')][_0x220d('0x69')])){for(var _0x4074f4=0x0;_0x4074f4<_0x20dfed[_0x220d('0x3e')][_0x220d('0x69')][_0x220d('0x43')];_0x4074f4+=0x1){socket['emit'](_0x220d('0xbe'),{'UserId':_0x20dfed[_0x220d('0x3e')][_0x220d('0x69')][_0x4074f4],'FaxAccountId':_0x20dfed[_0x220d('0x5b')]['id']});}}else{socket['emit'](_0x220d('0xbe'),{'UserId':_0x20dfed[_0x220d('0x3e')][_0x220d('0x69')],'FaxAccountId':_0x20dfed[_0x220d('0x5b')]['id']});}});}})['then'](respondWithStatusCode(_0x2f37ed,null))[_0x220d('0x26')](handleError(_0x2f37ed,null));};exports['getAgents']=function(_0x1f8dfe,_0x17c42c,_0x3cc23a){var _0x134f2d={};var _0x4df45e={};var _0x455d8b;var _0x400e72;return db['FaxAccount'][_0x220d('0x60')]({'where':{'id':_0x1f8dfe[_0x220d('0x5b')]['id']}})[_0x220d('0x31')](handleEntityNotFound(_0x17c42c,null))[_0x220d('0x31')](function(_0x1b0379){if(_0x1b0379){_0x455d8b=_0x1b0379;_0x4df45e[_0x220d('0x3c')]=_[_0x220d('0x3d')](db[_0x220d('0xbf')]['rawAttributes']);_0x4df45e[_0x220d('0x3e')]=_[_0x220d('0x3d')](_0x1f8dfe['query']);_0x4df45e[_0x220d('0x3f')]=_['intersection'](_0x4df45e['model'],_0x4df45e['query']);_0x134f2d[_0x220d('0x41')]=_[_0x220d('0x40')](_0x4df45e[_0x220d('0x3c')],qs[_0x220d('0x42')](_0x1f8dfe[_0x220d('0x3e')]['fields']));_0x134f2d['attributes']=_0x134f2d['attributes'][_0x220d('0x43')]?_0x134f2d['attributes']:_0x4df45e['model'];_0x134f2d[_0x220d('0x46')]=qs[_0x220d('0x47')](_0x1f8dfe[_0x220d('0x3e')][_0x220d('0x47')]);_0x134f2d[_0x220d('0x48')]=qs[_0x220d('0x3f')](_[_0x220d('0x61')](_0x1f8dfe[_0x220d('0x3e')],_0x4df45e[_0x220d('0x3f')]));if(_0x1f8dfe[_0x220d('0x3e')][_0x220d('0x49')]){_0x134f2d[_0x220d('0x48')]=_[_0x220d('0x4a')](_0x134f2d[_0x220d('0x48')],{'$or':_[_0x220d('0x4b')](_0x134f2d['attributes'],function(_0x48f0af){var _0x59dadc={};_0x59dadc[_0x48f0af]={'$like':'%'+_0x1f8dfe[_0x220d('0x3e')]['filter']+'%'};return _0x59dadc;})});}_0x134f2d=_[_0x220d('0x4a')]({},_0x134f2d,_0x1f8dfe['options']);return _0x455d8b[_0x220d('0xc0')](_0x134f2d);}})['then'](function(_0x43152f){if(_0x43152f){_0x400e72=_0x43152f[_0x220d('0x43')];if(!_0x1f8dfe[_0x220d('0x3e')][_0x220d('0x44')](_0x220d('0x45'))){_0x134f2d[_0x220d('0x2b')]=qs[_0x220d('0x2b')](_0x1f8dfe[_0x220d('0x3e')][_0x220d('0x2b')]);_0x134f2d[_0x220d('0x2a')]=qs[_0x220d('0x2a')](_0x1f8dfe[_0x220d('0x3e')]['offset']);}return _0x455d8b[_0x220d('0xc0')](_0x134f2d);}})['then'](function(_0x32663e){if(_0x32663e){return _0x32663e?{'count':_0x400e72,'rows':_0x32663e}:null;}})[_0x220d('0x31')](respondWithResult(_0x17c42c,null))['catch'](handleError(_0x17c42c,null));}; \ No newline at end of file +var _0x4385=['CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','ListId','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','sendStatus','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','findAll','show','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','Disposition','findOne','FaxAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','internal','Tag','color','tag','addApplications','sequelize','FaxApplication','findAndCountAll','getApplications','localstationid','app','system','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','ecm','faxdetect','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','transaction','tech','key','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','attachments','root','server/files/attachments','basename'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0x4385,0xd6));var _0x5438=function(_0x13b663,_0x209085){_0x13b663=_0x13b663-0x0;var _0x4d4138=_0x4385[_0x13b663];return _0x4d4138;};'use strict';var pdf=require(_0x5438('0x0'));var emlformat=require(_0x5438('0x1'));var rimraf=require(_0x5438('0x2'));var zipdir=require(_0x5438('0x3'));var jsonpatch=require(_0x5438('0x4'));var rp=require('request-promise');var moment=require(_0x5438('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5438('0x6'));var util=require(_0x5438('0x7'));var path=require(_0x5438('0x8'));var sox=require(_0x5438('0x9'));var csv=require(_0x5438('0xa'));var ejs=require(_0x5438('0xb'));var fs=require('fs');var _=require(_0x5438('0xc'));var squel=require(_0x5438('0xd'));var crypto=require(_0x5438('0xe'));var jsforce=require(_0x5438('0xf'));var deskjs=require(_0x5438('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5438('0x11'));var Papa=require(_0x5438('0x12'));var authService=require(_0x5438('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x5438('0x14'));var logger=require(_0x5438('0x15'))(_0x5438('0x16'));var utils=require('../../config/utils');var config=require(_0x5438('0x17'));var db=require('../../mysqldb')['db'];config[_0x5438('0x18')]=_[_0x5438('0x19')](config[_0x5438('0x18')],{'host':_0x5438('0x1a'),'port':0x18eb});var socket=require(_0x5438('0x1b'))(new Redis(config[_0x5438('0x18')]));require(_0x5438('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5438('0x1d')][_0x5438('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9f4d,_0x40fccb,_0x17da8f,_0x1ad1c6){return new BPromise(function(_0xbb7e13,_0x1e5ec6){var _0x3d1b4e=_0x1ad1c6||client;return _0x3d1b4e[_0x5438('0x1f')](_0x2e9f4d,_0x17da8f)[_0x5438('0x20')](function(_0x1cfa0c){logger[_0x5438('0x21')]('FaxAccount,\x20%s,\x20%s',_0x40fccb,_0x5438('0x22'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x40fccb,_0x5438('0x22'),JSON[_0x5438('0x23')](_0x1cfa0c));if(_0x1cfa0c[_0x5438('0x24')]){if(_0x1cfa0c[_0x5438('0x24')][_0x5438('0x25')]===0x1f4){logger['error'](_0x5438('0x26'),_0x40fccb,_0x1cfa0c['error'][_0x5438('0x27')]);return _0x1e5ec6(_0x1cfa0c['error'][_0x5438('0x27')]);}logger[_0x5438('0x24')](_0x5438('0x26'),_0x40fccb,_0x1cfa0c[_0x5438('0x24')][_0x5438('0x27')]);return _0xbb7e13(_0x1cfa0c['error'][_0x5438('0x27')]);}else{logger[_0x5438('0x21')](_0x5438('0x26'),_0x40fccb,_0x5438('0x22'));_0xbb7e13(_0x1cfa0c[_0x5438('0x28')]['message']);}})['catch'](function(_0x5abdc1){logger[_0x5438('0x24')](_0x5438('0x26'),_0x40fccb,_0x5abdc1);_0x1e5ec6(_0x5abdc1);});});}function respondWithStatusCode(_0x2f0ea9,_0x3de4da){_0x3de4da=_0x3de4da||0xcc;return function(_0xe40aac){if(_0xe40aac){return _0x2f0ea9['sendStatus'](_0x3de4da);}return _0x2f0ea9[_0x5438('0x29')](_0x3de4da)[_0x5438('0x2a')]();};}function respondWithResult(_0x30aff9,_0x211d4a){_0x211d4a=_0x211d4a||0xc8;return function(_0x557f4d){if(_0x557f4d){return _0x30aff9[_0x5438('0x29')](_0x211d4a)[_0x5438('0x2b')](_0x557f4d);}};}function respondWithFilteredResult(_0x50bbaf,_0x3d0d45){return function(_0x4055c7){if(_0x4055c7){var _0x241f54=_0x4055c7[_0x5438('0x2c')],_0x5e7787=_0x3d0d45[_0x5438('0x2d')],_0x5e4960=_0x3d0d45[_0x5438('0x2d')]+_0x3d0d45[_0x5438('0x2e')],_0x38922e;if(_0x5e4960>=_0x241f54){_0x5e4960=_0x241f54;_0x38922e=0xc8;}else{_0x38922e=0xce;}_0x50bbaf[_0x5438('0x29')](_0x38922e);return _0x50bbaf[_0x5438('0x2f')](_0x5438('0x30'),_0x5e7787+'-'+_0x5e4960+'/'+_0x241f54)[_0x5438('0x2b')](_0x4055c7);}return null;};}function patchUpdates(_0x2ece04){return function(_0x1307e7){try{jsonpatch[_0x5438('0x31')](_0x1307e7,_0x2ece04,!![]);}catch(_0x4605ad){return BPromise[_0x5438('0x32')](_0x4605ad);}return _0x1307e7[_0x5438('0x33')]();};}function saveUpdates(_0x39d35c,_0x16941f){return function(_0x37cece){if(_0x37cece){return _0x37cece[_0x5438('0x34')](_0x39d35c)[_0x5438('0x20')](function(_0x8480eb){return _0x8480eb;});}return null;};}function removeEntity(_0x52164d,_0x56acd3){return function(_0x316adb){if(_0x316adb){return _0x316adb[_0x5438('0x35')]()[_0x5438('0x20')](function(){var _0x42a002=_0x316adb[_0x5438('0x36')]({'plain':!![]});var _0x137a29=_0x5438('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x137a29,'resourceId':_0x42a002['id']}})['then'](function(){return _0x316adb;});})[_0x5438('0x20')](function(){_0x52164d[_0x5438('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39cc07,_0x162f3f){return function(_0x5ef3ce){if(!_0x5ef3ce){_0x39cc07[_0x5438('0x38')](0x194);}return _0x5ef3ce;};}function handleError(_0x172373,_0x348302){_0x348302=_0x348302||0x1f4;return function(_0x44a177){logger[_0x5438('0x24')](_0x44a177['stack']);if(_0x44a177[_0x5438('0x39')]){delete _0x44a177['name'];}_0x172373[_0x5438('0x29')](_0x348302)[_0x5438('0x3a')](_0x44a177);};}exports[_0x5438('0x3b')]=function(_0x88e045,_0x2173b6){var _0x568b14={'include':[{'model':db[_0x5438('0x3c')],'as':_0x5438('0x3d')}]},_0x4964d1={},_0x186520={'count':0x0,'rows':[]};var _0x2358d5=db[_0x5438('0x3e')]['rawAttributes'];_0x4964d1[_0x5438('0x3f')]=_[_0x5438('0x40')](_0x2358d5);_0x4964d1[_0x5438('0x41')]=_['keys'](_0x88e045[_0x5438('0x41')]);_0x4964d1[_0x5438('0x42')]=_['intersection'](_0x4964d1['model'],_0x4964d1[_0x5438('0x41')]);_0x568b14[_0x5438('0x43')]=_[_0x5438('0x44')](_0x4964d1['model'],qs['fields'](_0x88e045[_0x5438('0x41')][_0x5438('0x45')]));_0x568b14[_0x5438('0x43')]=_0x568b14[_0x5438('0x43')][_0x5438('0x46')]?_0x568b14[_0x5438('0x43')]:_0x4964d1[_0x5438('0x3f')];if(!_0x88e045[_0x5438('0x41')][_0x5438('0x47')](_0x5438('0x48'))){_0x568b14['limit']=qs[_0x5438('0x2e')](_0x88e045[_0x5438('0x41')][_0x5438('0x2e')]);_0x568b14[_0x5438('0x2d')]=qs['offset'](_0x88e045[_0x5438('0x41')][_0x5438('0x2d')]);}_0x568b14['order']=qs[_0x5438('0x49')](_0x88e045['query'][_0x5438('0x49')]);_0x568b14[_0x5438('0x4a')]=qs['filters'](_[_0x5438('0x4b')](_0x88e045[_0x5438('0x41')],_0x4964d1[_0x5438('0x42')]));if(_0x88e045[_0x5438('0x41')]['filter']){_0x568b14[_0x5438('0x4a')]=_[_0x5438('0x4c')](_0x568b14[_0x5438('0x4a')],{'$or':_[_0x5438('0x4d')](_0x2358d5,function(_0x903005){if(_0x903005[_0x5438('0x4e')]['key']!==_0x5438('0x4f')){var _0x295df5={};_0x295df5[_0x903005[_0x5438('0x50')]]={'$like':'%'+_0x88e045[_0x5438('0x41')][_0x5438('0x51')]+'%'};return _0x295df5;}})});}_0x568b14=_[_0x5438('0x4c')]({},_0x568b14,_0x88e045[_0x5438('0x52')]);var _0x22b2f5={'where':_0x568b14[_0x5438('0x4a')]};return db[_0x5438('0x3e')][_0x5438('0x2c')](_0x22b2f5)[_0x5438('0x20')](function(_0xd4fcb4){_0x186520[_0x5438('0x2c')]=_0xd4fcb4;if(_0x88e045[_0x5438('0x41')][_0x5438('0x53')]){_0x568b14[_0x5438('0x54')]=[{'all':!![]}];}return db[_0x5438('0x3e')][_0x5438('0x55')](_0x568b14);})['then'](function(_0x5e6bb9){_0x186520['rows']=_0x5e6bb9;return _0x186520;})['then'](respondWithFilteredResult(_0x2173b6,_0x568b14))['catch'](handleError(_0x2173b6,null));};exports[_0x5438('0x56')]=function(_0x3dedfe,_0x53a012){var _0x225343={'raw':![],'where':{'id':_0x3dedfe['params']['id']},'include':[{'model':db[_0x5438('0x3c')],'as':_0x5438('0x3d')}]},_0x153fa6={};_0x153fa6[_0x5438('0x3f')]=_[_0x5438('0x40')](db['FaxAccount'][_0x5438('0x57')]);_0x153fa6[_0x5438('0x41')]=_['keys'](_0x3dedfe[_0x5438('0x41')]);_0x153fa6['filters']=_['intersection'](_0x153fa6['model'],_0x153fa6[_0x5438('0x41')]);_0x225343['attributes']=_[_0x5438('0x44')](_0x153fa6[_0x5438('0x3f')],qs[_0x5438('0x45')](_0x3dedfe[_0x5438('0x41')][_0x5438('0x45')]));_0x225343[_0x5438('0x43')]=_0x225343[_0x5438('0x43')][_0x5438('0x46')]?_0x225343[_0x5438('0x43')]:_0x153fa6[_0x5438('0x3f')];if(_0x3dedfe[_0x5438('0x41')][_0x5438('0x53')]){_0x225343[_0x5438('0x54')]=[{'all':!![]}];}_0x225343=_[_0x5438('0x4c')]({},_0x225343,_0x3dedfe['options']);return db['FaxAccount'][_0x5438('0x58')](_0x225343)[_0x5438('0x20')](handleEntityNotFound(_0x53a012,null))[_0x5438('0x20')](respondWithResult(_0x53a012,null))[_0x5438('0x59')](handleError(_0x53a012,null));};exports[_0x5438('0x5a')]=function(_0xc93f53,_0x495a68){return db[_0x5438('0x3e')][_0x5438('0x5a')](_0xc93f53[_0x5438('0x5b')],{})[_0x5438('0x20')](function(_0x59861a){var _0x3cd985=_0xc93f53[_0x5438('0x5c')][_0x5438('0x36')]({'plain':!![]});if(!_0x3cd985)throw new Error(_0x5438('0x5d'));if(_0x3cd985[_0x5438('0x5e')]===_0x5438('0x5c')){var _0x2e68b7=_0x59861a[_0x5438('0x36')]({'plain':!![]});var _0x2262af=_0x5438('0x37');return db['UserProfileSection'][_0x5438('0x58')]({'where':{'name':_0x2262af,'userProfileId':_0x3cd985[_0x5438('0x5f')]},'raw':!![]})[_0x5438('0x20')](function(_0x2943a1){if(_0x2943a1&&_0x2943a1[_0x5438('0x60')]===0x0){return db[_0x5438('0x61')][_0x5438('0x5a')]({'name':_0x2e68b7[_0x5438('0x39')],'resourceId':_0x2e68b7['id'],'type':_0x2943a1[_0x5438('0x39')],'sectionId':_0x2943a1['id']},{})[_0x5438('0x20')](function(){return _0x59861a;});}else{return _0x59861a;}})[_0x5438('0x59')](function(_0x1bec28){logger['error'](_0x5438('0x62'),_0x1bec28);throw _0x1bec28;});}return _0x59861a;})[_0x5438('0x20')](respondWithResult(_0x495a68,0xc9))['catch'](handleError(_0x495a68,null));};exports[_0x5438('0x34')]=function(_0x2c3795,_0x40642b){if(_0x2c3795[_0x5438('0x5b')]['id']){delete _0x2c3795['body']['id'];}return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x2c3795['params']['id']},'include':[{'model':db['Pause'],'as':_0x5438('0x3d')}]})['then'](handleEntityNotFound(_0x40642b,null))['then'](saveUpdates(_0x2c3795[_0x5438('0x5b')],null))['then'](respondWithResult(_0x40642b,null))[_0x5438('0x59')](handleError(_0x40642b,null));};exports[_0x5438('0x35')]=function(_0x5c0e60,_0x5c3145){return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x5c0e60[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x5c3145,null))[_0x5438('0x20')](removeEntity(_0x5c3145,null))[_0x5438('0x59')](handleError(_0x5c3145,null));};exports[_0x5438('0x64')]=function(_0x1a0582,_0x36a592){return db[_0x5438('0x3e')][_0x5438('0x64')]()[_0x5438('0x20')](respondWithResult(_0x36a592,null))[_0x5438('0x59')](handleError(_0x36a592,null));};exports['addDisposition']=function(_0x3d1378,_0x314afc,_0x5fc5ca){if(_0x3d1378[_0x5438('0x5b')]['id']){delete _0x3d1378[_0x5438('0x5b')]['id'];}return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x3d1378[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x314afc,null))['then'](function(_0x3ff7f0){if(_0x3ff7f0){_0x3d1378['body']['FaxAccountId']=_0x3ff7f0['id'];return db[_0x5438('0x65')][_0x5438('0x5a')](_0x3d1378[_0x5438('0x5b')]);}})[_0x5438('0x20')](respondWithResult(_0x314afc,null))[_0x5438('0x59')](handleError(_0x314afc,null));};exports['getDispositions']=function(_0x369253,_0x59b73d,_0x2f4d10){var _0x65547d={'raw':![],'where':{}};var _0x4313cf={};var _0x49a869={'count':0x0,'rows':[]};return db[_0x5438('0x3e')][_0x5438('0x66')]({'where':{'id':_0x369253['params']['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x59b73d,null))[_0x5438('0x20')](function(_0x215bc8){if(_0x215bc8){_0x4313cf['model']=_['keys'](db[_0x5438('0x65')][_0x5438('0x57')]);_0x4313cf[_0x5438('0x41')]=_[_0x5438('0x40')](_0x369253[_0x5438('0x41')]);_0x4313cf['filters']=_[_0x5438('0x44')](_0x4313cf['model'],_0x4313cf['query']);_0x65547d[_0x5438('0x43')]=_[_0x5438('0x44')](_0x4313cf[_0x5438('0x3f')],qs['fields'](_0x369253['query'][_0x5438('0x45')]));_0x65547d[_0x5438('0x43')]=_0x65547d[_0x5438('0x43')][_0x5438('0x46')]?_0x65547d[_0x5438('0x43')]:_0x4313cf[_0x5438('0x3f')];if(!_0x369253[_0x5438('0x41')][_0x5438('0x47')]('nolimit')){_0x65547d[_0x5438('0x2e')]=qs[_0x5438('0x2e')](_0x369253[_0x5438('0x41')]['limit']);_0x65547d[_0x5438('0x2d')]=qs[_0x5438('0x2d')](_0x369253[_0x5438('0x41')][_0x5438('0x2d')]);}_0x65547d['order']=qs[_0x5438('0x49')](_0x369253['query'][_0x5438('0x49')]);_0x65547d[_0x5438('0x4a')]=qs[_0x5438('0x42')](_[_0x5438('0x4b')](_0x369253[_0x5438('0x41')],_0x4313cf[_0x5438('0x42')]));_0x65547d[_0x5438('0x4a')][_0x5438('0x67')]=_0x215bc8['id'];if(_0x369253['query']['filter']){_0x65547d[_0x5438('0x4a')]=_['merge'](_0x65547d[_0x5438('0x4a')],{'$or':_['map'](_0x65547d[_0x5438('0x43')],function(_0x1244fd){var _0x466a99={};_0x466a99[_0x1244fd]={'$like':'%'+_0x369253['query'][_0x5438('0x51')]+'%'};return _0x466a99;})});}_0x65547d=_[_0x5438('0x4c')]({},_0x65547d,_0x369253[_0x5438('0x52')]);return db[_0x5438('0x65')][_0x5438('0x2c')]({'where':_0x65547d[_0x5438('0x4a')]})[_0x5438('0x20')](function(_0x38fe5e){_0x49a869[_0x5438('0x2c')]=_0x38fe5e;if(_0x369253[_0x5438('0x41')][_0x5438('0x53')]){_0x65547d[_0x5438('0x54')]=[{'all':!![]}];}return db[_0x5438('0x65')]['findAll'](_0x65547d);})[_0x5438('0x20')](function(_0x11c143){_0x49a869[_0x5438('0x68')]=_0x11c143;return _0x49a869;});}})['then'](respondWithFilteredResult(_0x59b73d,_0x65547d))[_0x5438('0x59')](handleError(_0x59b73d,null));};exports[_0x5438('0x69')]=function(_0x68c688,_0x1851f6,_0x506620){var _0x587ea3;return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x68c688[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x1851f6,null))[_0x5438('0x20')](function(_0x120936){if(_0x120936){return _0x120936[_0x5438('0x69')](_0x68c688[_0x5438('0x41')][_0x5438('0x6a')]);}})[_0x5438('0x20')](respondWithStatusCode(_0x1851f6,null))[_0x5438('0x59')](handleError(_0x1851f6,null));};exports[_0x5438('0x6b')]=function(_0x3a6810,_0x3114fc,_0x3bd4a6){if(_0x3a6810[_0x5438('0x5b')]['id']){delete _0x3a6810[_0x5438('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x3a6810['params']['id']}})['then'](handleEntityNotFound(_0x3114fc,null))['then'](function(_0x1c211d){if(_0x1c211d){_0x3a6810[_0x5438('0x5b')][_0x5438('0x67')]=_0x1c211d['id'];return db[_0x5438('0x6c')]['create'](_0x3a6810[_0x5438('0x5b')]);}})[_0x5438('0x20')](respondWithResult(_0x3114fc,null))[_0x5438('0x59')](handleError(_0x3114fc,null));};exports[_0x5438('0x6d')]=function(_0x47a734,_0xa627fe,_0x2fee2f){var _0xcd2bbf={'raw':![],'where':{}};var _0x17c14e={};var _0x158286={'count':0x0,'rows':[]};return db[_0x5438('0x3e')][_0x5438('0x66')]({'where':{'id':_0x47a734[_0x5438('0x63')]['id']}})['then'](handleEntityNotFound(_0xa627fe,null))[_0x5438('0x20')](function(_0x2eb62b){if(_0x2eb62b){_0x17c14e['model']=_[_0x5438('0x40')](db[_0x5438('0x6c')][_0x5438('0x57')]);_0x17c14e[_0x5438('0x41')]=_[_0x5438('0x40')](_0x47a734['query']);_0x17c14e[_0x5438('0x42')]=_['intersection'](_0x17c14e[_0x5438('0x3f')],_0x17c14e[_0x5438('0x41')]);_0xcd2bbf['attributes']=_[_0x5438('0x44')](_0x17c14e[_0x5438('0x3f')],qs['fields'](_0x47a734['query']['fields']));_0xcd2bbf[_0x5438('0x43')]=_0xcd2bbf['attributes']['length']?_0xcd2bbf[_0x5438('0x43')]:_0x17c14e[_0x5438('0x3f')];if(!_0x47a734['query']['hasOwnProperty'](_0x5438('0x48'))){_0xcd2bbf[_0x5438('0x2e')]=qs['limit'](_0x47a734[_0x5438('0x41')][_0x5438('0x2e')]);_0xcd2bbf[_0x5438('0x2d')]=qs[_0x5438('0x2d')](_0x47a734[_0x5438('0x41')][_0x5438('0x2d')]);}_0xcd2bbf[_0x5438('0x6e')]=qs[_0x5438('0x49')](_0x47a734[_0x5438('0x41')][_0x5438('0x49')]);_0xcd2bbf[_0x5438('0x4a')]=qs[_0x5438('0x42')](_['pick'](_0x47a734['query'],_0x17c14e[_0x5438('0x42')]));_0xcd2bbf[_0x5438('0x4a')][_0x5438('0x67')]=_0x2eb62b['id'];if(_0x47a734['query']['filter']){_0xcd2bbf[_0x5438('0x4a')]=_['merge'](_0xcd2bbf[_0x5438('0x4a')],{'$or':_[_0x5438('0x4d')](_0xcd2bbf['attributes'],function(_0x4e8216){var _0x90da83={};_0x90da83[_0x4e8216]={'$like':'%'+_0x47a734[_0x5438('0x41')][_0x5438('0x51')]+'%'};return _0x90da83;})});}_0xcd2bbf=_['merge']({},_0xcd2bbf,_0x47a734[_0x5438('0x52')]);return db[_0x5438('0x6c')]['count']({'where':_0xcd2bbf['where']})[_0x5438('0x20')](function(_0x317497){_0x158286[_0x5438('0x2c')]=_0x317497;if(_0x47a734['query'][_0x5438('0x53')]){_0xcd2bbf[_0x5438('0x54')]=[{'all':!![]}];}return db[_0x5438('0x6c')][_0x5438('0x55')](_0xcd2bbf);})['then'](function(_0x2f92bf){_0x158286['rows']=_0x2f92bf;return _0x158286;});}})[_0x5438('0x20')](respondWithFilteredResult(_0xa627fe,_0xcd2bbf))[_0x5438('0x59')](handleError(_0xa627fe,null));};exports[_0x5438('0x6f')]=function(_0x3c4328,_0x5b8e9f,_0x32d3bb){var _0x379821;return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x3c4328[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x5b8e9f,null))[_0x5438('0x20')](function(_0x9555e3){if(_0x9555e3){return _0x9555e3[_0x5438('0x6f')](_0x3c4328['query'][_0x5438('0x6a')]);}})[_0x5438('0x20')](respondWithStatusCode(_0x5b8e9f,null))[_0x5438('0x59')](handleError(_0x5b8e9f,null));};exports[_0x5438('0x70')]=function(_0xe295b7,_0x343b27,_0x269fde){return db[_0x5438('0x71')][_0x5438('0x58')]({'where':{'id':_0xe295b7[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x343b27,null))[_0x5438('0x20')](function(_0x47ce7a){if(_0x47ce7a){return _0x47ce7a[_0x5438('0x70')](_0xe295b7['body'][_0x5438('0x6a')],_[_0x5438('0x72')](_0xe295b7[_0x5438('0x5b')],[_0x5438('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x343b27,null))[_0x5438('0x59')](handleError(_0x343b27,null));};exports[_0x5438('0x73')]=function(_0x1aed48,_0x229022,_0x50effe){var _0x4501cd={'raw':![],'where':{}};var _0x47f6ae={};var _0x2ce07a={'count':0x0,'rows':[]};return db[_0x5438('0x3e')][_0x5438('0x66')]({'where':{'id':_0x1aed48[_0x5438('0x63')]['id']}})['then'](handleEntityNotFound(_0x229022,null))[_0x5438('0x20')](function(_0x26ed60){if(_0x26ed60){_0x47f6ae[_0x5438('0x3f')]=_[_0x5438('0x40')](db[_0x5438('0x71')]['rawAttributes']);_0x47f6ae[_0x5438('0x41')]=_[_0x5438('0x40')](_0x1aed48[_0x5438('0x41')]);_0x47f6ae['filters']=_[_0x5438('0x44')](_0x47f6ae[_0x5438('0x3f')],_0x47f6ae['query']);_0x4501cd[_0x5438('0x43')]=_[_0x5438('0x44')](_0x47f6ae['model'],qs[_0x5438('0x45')](_0x1aed48['query'][_0x5438('0x45')]));_0x4501cd[_0x5438('0x43')]=_0x4501cd[_0x5438('0x43')]['length']?_0x4501cd[_0x5438('0x43')]:_0x47f6ae[_0x5438('0x3f')];if(!_0x1aed48[_0x5438('0x41')][_0x5438('0x47')](_0x5438('0x48'))){_0x4501cd['limit']=qs[_0x5438('0x2e')](_0x1aed48[_0x5438('0x41')][_0x5438('0x2e')]);_0x4501cd['offset']=qs[_0x5438('0x2d')](_0x1aed48['query']['offset']);}_0x4501cd[_0x5438('0x6e')]=qs[_0x5438('0x49')](_0x1aed48[_0x5438('0x41')]['sort']);_0x4501cd['where']=qs[_0x5438('0x42')](_[_0x5438('0x4b')](_0x1aed48[_0x5438('0x41')],_0x47f6ae['filters']));_0x4501cd[_0x5438('0x4a')][_0x5438('0x67')]=_0x26ed60['id'];if(_0x1aed48[_0x5438('0x41')][_0x5438('0x51')]){_0x4501cd[_0x5438('0x4a')]=_['merge'](_0x4501cd['where'],{'$or':_['map'](_0x4501cd['attributes'],function(_0x5db55e){var _0x29f7a9={};_0x29f7a9[_0x5db55e]={'$like':'%'+_0x1aed48[_0x5438('0x41')]['filter']+'%'};return _0x29f7a9;})});}_0x4501cd=_[_0x5438('0x4c')]({},_0x4501cd,_0x1aed48[_0x5438('0x52')]);return db[_0x5438('0x71')]['count']({'where':_0x4501cd[_0x5438('0x4a')]})['then'](function(_0xb87c1a){_0x2ce07a[_0x5438('0x2c')]=_0xb87c1a;if(_0x1aed48[_0x5438('0x41')][_0x5438('0x53')]){_0x4501cd[_0x5438('0x54')]=[{'model':db['CmContact'],'as':_0x5438('0x74'),'required':![]},{'model':db[_0x5438('0x75')],'as':'Owner','attributes':[_0x5438('0x39'),'fullname',_0x5438('0x76')],'required':![]},{'model':db[_0x5438('0x77')],'as':'Tags','attributes':['id',_0x5438('0x39'),_0x5438('0x78')],'where':_0x1aed48['query'][_0x5438('0x79')]?{'id':_0x1aed48['query']['tag']}:undefined,'required':_0x1aed48['query'][_0x5438('0x79')]?!![]:![]}];}return db[_0x5438('0x71')][_0x5438('0x55')](_0x4501cd);})['then'](function(_0x32e5ee){_0x2ce07a[_0x5438('0x68')]=_0x32e5ee;return _0x2ce07a;});}})[_0x5438('0x20')](respondWithFilteredResult(_0x229022,_0x4501cd))[_0x5438('0x59')](handleError(_0x229022,null));};exports[_0x5438('0x7a')]=function(_0x45d0af,_0x25506b,_0x552ea6){return db[_0x5438('0x3e')]['findOne']({'where':{'id':_0x45d0af[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x25506b,null))[_0x5438('0x20')](function(_0x1fff70){if(_0x1fff70){return db[_0x5438('0x7b')]['transaction'](function(_0xd40ac3){return db[_0x5438('0x7c')][_0x5438('0x35')]({'where':{'FaxAccountId':_0x45d0af[_0x5438('0x63')]['id']},'transaction':_0xd40ac3})['then'](function(_0x43f961){var _0x366388=_[_0x5438('0x4d')](_0x45d0af[_0x5438('0x5b')],function(_0x288af0){_0x288af0['FaxAccountId']=_0x45d0af[_0x5438('0x63')]['id'];return _0x288af0;});return db[_0x5438('0x7c')]['bulkCreate'](_0x366388,{'transaction':_0xd40ac3});});})[_0x5438('0x20')](function(){return db[_0x5438('0x7c')][_0x5438('0x7d')]({'where':{'FaxAccountId':_0x45d0af[_0x5438('0x63')]['id']},'order':'priority'});});}})[_0x5438('0x20')](respondWithResult(_0x25506b,null))['catch'](handleError(_0x25506b,null));};exports[_0x5438('0x7e')]=function(_0x485dc2,_0x1ce056,_0x377930){var _0x4e72c0={};var _0x1bd820={};var _0x3c01e2;var _0x37b67e;return db[_0x5438('0x3e')][_0x5438('0x66')]({'where':{'id':_0x485dc2[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x1ce056,null))[_0x5438('0x20')](function(_0x579726){if(_0x579726){_0x3c01e2=_0x579726;_0x1bd820[_0x5438('0x3f')]=_[_0x5438('0x40')](db['FaxApplication']['rawAttributes']);_0x1bd820['query']=_['keys'](_0x485dc2[_0x5438('0x41')]);_0x1bd820[_0x5438('0x42')]=_[_0x5438('0x44')](_0x1bd820[_0x5438('0x3f')],_0x1bd820['query']);_0x4e72c0['attributes']=_[_0x5438('0x44')](_0x1bd820[_0x5438('0x3f')],qs[_0x5438('0x45')](_0x485dc2[_0x5438('0x41')][_0x5438('0x45')]));_0x4e72c0['attributes']=_0x4e72c0['attributes'][_0x5438('0x46')]?_0x4e72c0[_0x5438('0x43')]:_0x1bd820[_0x5438('0x3f')];_0x4e72c0['order']=qs[_0x5438('0x49')](_0x485dc2[_0x5438('0x41')][_0x5438('0x49')]);_0x4e72c0[_0x5438('0x4a')]=qs[_0x5438('0x42')](_[_0x5438('0x4b')](_0x485dc2[_0x5438('0x41')],_0x1bd820[_0x5438('0x42')]));if(_0x485dc2[_0x5438('0x41')][_0x5438('0x51')]){_0x4e72c0[_0x5438('0x4a')]=_[_0x5438('0x4c')](_0x4e72c0[_0x5438('0x4a')],{'$or':_[_0x5438('0x4d')](_0x4e72c0[_0x5438('0x43')],function(_0x4a5cba){var _0x49d82c={};_0x49d82c[_0x4a5cba]={'$like':'%'+_0x485dc2[_0x5438('0x41')][_0x5438('0x51')]+'%'};return _0x49d82c;})});}_0x4e72c0=_[_0x5438('0x4c')]({},_0x4e72c0,_0x485dc2[_0x5438('0x52')]);return _0x3c01e2[_0x5438('0x7e')](_0x4e72c0);}})[_0x5438('0x20')](function(_0x11aef1){if(_0x11aef1){_0x37b67e=_0x11aef1[_0x5438('0x46')];if(!_0x485dc2[_0x5438('0x41')][_0x5438('0x47')](_0x5438('0x48'))){_0x4e72c0[_0x5438('0x2e')]=qs[_0x5438('0x2e')](_0x485dc2['query']['limit']);_0x4e72c0[_0x5438('0x2d')]=qs[_0x5438('0x2d')](_0x485dc2['query'][_0x5438('0x2d')]);}return _0x3c01e2[_0x5438('0x7e')](_0x4e72c0);}})['then'](function(_0x352332){if(_0x352332){return _0x352332?{'count':_0x37b67e,'rows':_0x352332}:null;}})[_0x5438('0x20')](respondWithResult(_0x1ce056,null))['catch'](handleError(_0x1ce056,null));};function Extension(_0x5bc13c,_0x3caff1,_0x1fcf2d,_0x47af5d){this['context']='from-voip-provider';this['exten']=_0x5bc13c[_0x5438('0x7f')];this[_0x5438('0x80')]=_0x47af5d;this[_0x5438('0x4e')]=_0x5438('0x81');this[_0x5438('0x82')]=_0x5438('0x83');this[_0x5438('0x67')]=_0x5bc13c['id'];this[_0x5438('0x84')]=_0x3caff1;this['appdata']=_0x1fcf2d;}function createExtensionsReciveFax(_0x459bc5){var _0x26d308=0x1;var _0x1706b9=[];_0x1706b9[_0x5438('0x85')](new Extension(_0x459bc5,_0x26d308,'','Answer'));_0x26d308+=0x1;_0x1706b9[_0x5438('0x85')](new Extension(_0x459bc5,_0x26d308,_0x5438('0x86'),_0x5438('0x87')));_0x26d308+=0x1;for(var _0x9df524 in _0x459bc5){if(_0x459bc5['hasOwnProperty'](_0x9df524)&&(_0x9df524===_0x5438('0x88')||_0x9df524===_0x5438('0x7f')||_0x9df524==='gateway'||_0x9df524===_0x5438('0x89')||_0x9df524==='headerinfo'||_0x9df524==='maxrate'||_0x9df524===_0x5438('0x8a')||_0x9df524==='modem'||_0x9df524===_0x5438('0x8b'))){_0x1706b9[_0x5438('0x85')](new Extension(_0x459bc5,_0x26d308,_0x5438('0x8c')+_0x9df524+')='+_0x459bc5[_0x9df524],_0x5438('0x87')));_0x26d308+=0x1;}}_0x1706b9[_0x5438('0x85')](new Extension(_0x459bc5,_0x26d308,'6','Wait'));_0x26d308+=0x1;_0x1706b9[_0x5438('0x85')](new Extension(_0x459bc5,_0x26d308,_0x5438('0x8d'),_0x5438('0x8e')));_0x26d308=0x0;return _0x1706b9;}exports[_0x5438('0x8f')]=function(_0x3cda80,_0xd82ddd,_0x5c3e66){var _0xc4859c;return db[_0x5438('0x7b')]['transaction'](function(_0x28a5e6){return db['FaxAccount']['create'](_0x3cda80['body'],{'transaction':_0x28a5e6})[_0x5438('0x20')](function(_0x20b0fd){_0xc4859c=_0x20b0fd[_0x5438('0x36')]({'plain':!![]});return db[_0x5438('0x90')][_0x5438('0x91')](createExtensionsReciveFax(_0xc4859c),{'transaction':_0x28a5e6});});})[_0x5438('0x20')](function(){return _0xc4859c;})['then'](respondWithResult(_0xd82ddd,null))[_0x5438('0x59')](handleError(_0xd82ddd,null));};exports[_0x5438('0x92')]=function(_0x493d94,_0x3e4082,_0x3ac428){var _0xec36ff;return db['sequelize'][_0x5438('0x93')](function(_0x41dc55){return db['FaxAccount'][_0x5438('0x34')](_0x493d94[_0x5438('0x5b')],{'where':{'id':_0x493d94[_0x5438('0x5b')]['id']},'transaction':_0x41dc55})['then'](function(_0x121d44){return db['VoiceExtension'][_0x5438('0x35')]({'where':{'FaxAccountId':_0x493d94['body']['id']},'transaction':_0x41dc55})[_0x5438('0x20')](function(_0x2d0fae){return db[_0x5438('0x90')][_0x5438('0x91')](createExtensionsReciveFax(_[_0x5438('0x72')](_0x493d94[_0x5438('0x5b')],[_0x5438('0x94'),_0x5438('0x95'),_0x5438('0x96'),_0x5438('0x97'),_0x5438('0x98'),'ListId'])),{'transaction':_0x41dc55});});});})[_0x5438('0x20')](function(){return db[_0x5438('0x3e')][_0x5438('0x99')](_0x493d94[_0x5438('0x5b')]['id']);})[_0x5438('0x20')](respondWithResult(_0x3e4082,null))[_0x5438('0x59')](handleError(_0x3e4082,null));};exports[_0x5438('0x9a')]=function(_0x51af43,_0x429665,_0x152b2c){var _0x4e851c={'raw':!![],'where':{}};var _0x2d8d81={};var _0x2bd958={'count':0x0,'rows':[]};return db[_0x5438('0x3e')][_0x5438('0x66')]({'where':{'id':_0x51af43[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x429665,null))[_0x5438('0x20')](function(_0x56e080){if(_0x56e080){_0x2d8d81[_0x5438('0x3f')]=_[_0x5438('0x40')](db[_0x5438('0x9b')]['rawAttributes']);_0x2d8d81[_0x5438('0x41')]=_[_0x5438('0x40')](_0x51af43['query']);_0x2d8d81[_0x5438('0x42')]=_[_0x5438('0x44')](_0x2d8d81[_0x5438('0x3f')],_0x2d8d81[_0x5438('0x41')]);_0x4e851c[_0x5438('0x43')]=_[_0x5438('0x44')](_0x2d8d81[_0x5438('0x3f')],qs[_0x5438('0x45')](_0x51af43[_0x5438('0x41')][_0x5438('0x45')]));_0x4e851c['attributes']=_0x4e851c['attributes']['length']?_0x4e851c['attributes']:_0x2d8d81['model'];if(!_0x51af43[_0x5438('0x41')]['hasOwnProperty']('nolimit')){_0x4e851c[_0x5438('0x2e')]=qs['limit'](_0x51af43[_0x5438('0x41')][_0x5438('0x2e')]);_0x4e851c['offset']=qs[_0x5438('0x2d')](_0x51af43[_0x5438('0x41')][_0x5438('0x2d')]);}_0x4e851c[_0x5438('0x6e')]=qs[_0x5438('0x49')](_0x51af43[_0x5438('0x41')][_0x5438('0x49')]);_0x4e851c[_0x5438('0x4a')]=qs[_0x5438('0x42')](_['pick'](_0x51af43[_0x5438('0x41')],_0x2d8d81[_0x5438('0x42')]));_0x4e851c[_0x5438('0x4a')]['FaxAccountId']=_0x56e080['id'];if(_0x51af43[_0x5438('0x41')][_0x5438('0x51')]){_0x4e851c['where']=_[_0x5438('0x4c')](_0x4e851c[_0x5438('0x4a')],{'$or':_[_0x5438('0x4d')](_0x4e851c[_0x5438('0x43')],function(_0x564334){var _0x403849={};_0x403849[_0x564334]={'$like':'%'+_0x51af43[_0x5438('0x41')][_0x5438('0x51')]+'%'};return _0x403849;})});}if(_0x51af43[_0x5438('0x41')][_0x5438('0x9c')]){var _0x1ff5f0=_0x51af43[_0x5438('0x41')][_0x5438('0x9c')][_0x5438('0x9d')](',');var _0x582067={};_0x582067[_0x1ff5f0[0x0]]={'$gte':moment(_0x1ff5f0[0x1])[_0x5438('0x9e')](_0x5438('0x9f'))};_0x4e851c[_0x5438('0x4a')]=_[_0x5438('0x4c')](_0x4e851c[_0x5438('0x4a')],_0x582067);}_0x4e851c=_[_0x5438('0x4c')]({},_0x4e851c,_0x51af43[_0x5438('0x52')]);return db['FaxMessage'][_0x5438('0x2c')]({'where':_0x4e851c['where']})['then'](function(_0x1326db){_0x2bd958[_0x5438('0x2c')]=_0x1326db;if(_0x51af43[_0x5438('0x41')]['includeAll']){_0x4e851c[_0x5438('0x54')]=[{'all':!![]}];}return db[_0x5438('0x9b')][_0x5438('0x55')](_0x4e851c);})['then'](function(_0x489859){_0x2bd958['rows']=_0x489859;return _0x2bd958;});}})[_0x5438('0x20')](respondWithFilteredResult(_0x429665,_0x4e851c))[_0x5438('0x59')](handleError(_0x429665,null));};exports[_0x5438('0x3a')]=function(_0x3f29d8,_0xd9069a,_0x5b08e2){var _0x5203bf,_0x6bf818={},_0x441b01;if(_0x3f29d8[_0x5438('0x5b')]['to']){_0x441b01=_0x3f29d8[_0x5438('0x5b')]['to'][0x0];}return db[_0x5438('0x3e')][_0x5438('0x58')]({'where':{'id':_0x3f29d8[_0x5438('0x63')]['id']},'include':[{'model':db[_0x5438('0xa0')],'as':_0x5438('0xa1'),'include':[{'model':db[_0x5438('0xa2')],'as':'Contacts','where':{'fax':_0x441b01},'limit':0x1,'order':[[_0x5438('0x97'),_0x5438('0xa3')]]}]}]})[_0x5438('0x20')](handleEntityNotFound(_0xd9069a,null))['then'](function(_0x3ec948){_0x5203bf=_0x3ec948;if(_0x3f29d8['body'][_0x5438('0xa4')]&&_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][_0x5438('0x46')]){for(var _0x186995=0x0;_0x186995<_0x3f29d8[_0x5438('0x5b')]['attachments'][_0x5438('0x46')];_0x186995+=0x1){_0x3f29d8[_0x5438('0x5b')]['attachments'][_0x186995]={'filename':_0x3f29d8[_0x5438('0x5b')]['attachments'][_0x186995]['name'],'id':_0x3f29d8['body']['attachments'][_0x186995]['id'],'path':path['join'](config[_0x5438('0xa5')],_0x5438('0xa6'),_0x3f29d8[_0x5438('0x5b')]['attachments'][_0x186995][_0x5438('0xa7')])};}}return respondWithRpcPromise(_0x5438('0xa8'),_0x5438('0xa8'),{'FaxAccountId':_[_0x5438('0xa9')](_0x3f29d8['params']['id'])?undefined:_0x3f29d8[_0x5438('0x63')]['id'],'path':_[_0x5438('0xa9')](_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][0x0][_0x5438('0x8')])?undefined:_0x3f29d8['body'][_0x5438('0xa4')][0x0][_0x5438('0x8')],'fax':_[_0x5438('0xa9')](_0x3f29d8[_0x5438('0x5b')]['to'][0x0])?undefined:_0x3f29d8['body']['to'][0x0]},client9002);})[_0x5438('0x20')](function(){if(_0x5203bf){if(_[_0x5438('0xa9')](_0x3f29d8[_0x5438('0x5b')][_0x5438('0xaa')])){_0x3f29d8[_0x5438('0x5b')]['from']=util['format'](_0x5438('0xab'),_0x5203bf['name'],_0x5203bf[_0x5438('0xac')]);}if(_0x5203bf[_0x5438('0xa1')]){if(_0x5203bf[_0x5438('0xa1')]['Contacts'][_0x5438('0x46')]){return _0x5203bf[_0x5438('0xa1')][_0x5438('0xad')][0x0];}else{return db[_0x5438('0xa2')][_0x5438('0x5a')](_[_0x5438('0x19')](_0x3f29d8[_0x5438('0x5b')],{'firstName':_0x3f29d8[_0x5438('0x5b')]['to'][0x0],'phone':_0x3f29d8['body']['to'][0x0],'fax':_0x3f29d8[_0x5438('0x5b')]['to'][0x0],'ListId':_0x5203bf[_0x5438('0xae')]}));}}else{throw new Error(_0x5438('0xaf'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x5438('0x20')](function(_0x400137){if(_0x400137){return db[_0x5438('0x71')][_0x5438('0x58')]({'where':{'ContactId':_0x400137['id'],'closed':![],'FaxAccountId':_0x5203bf['id']}})['then'](function(_0x45fdff){if(_0x45fdff){return[_0x45fdff,![]];}return db[_0x5438('0x71')][_0x5438('0x5a')]({'UserId':_0x3f29d8[_0x5438('0x5c')]['id'],'ContactId':_0x400137['id'],'FaxAccountId':_0x5203bf['id'],'fax':_0x3f29d8['body']['to'][0x0],'firstMsgDirection':_0x5438('0xb0'),'Messages':[_[_0x5438('0x4c')](_0x3f29d8[_0x5438('0x5b')],{'read':![],'body':_0x3f29d8[_0x5438('0x5b')]['attachments'][0x0][_0x5438('0xb1')],'FaxAccountId':_0x5203bf['id'],'UserId':_0x3f29d8[_0x5438('0x5c')]['id'],'ContactId':_0x400137['id'],'AttachmentId':_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x5438('0x9b')],'as':'Messages'}]})[_0x5438('0x20')](function(_0x56ae10){return[_0x56ae10,!![]];});});}else{throw new Error(_0x5438('0xb2'));}})[_0x5438('0xb3')](function(_0x301704,_0x103575){if(_0x103575){return _0x301704;}return db['FaxMessage'][_0x5438('0x5a')]({'direction':_0x5438('0xb0'),'read':![],'body':_0x3f29d8[_0x5438('0x5b')]['attachments'][0x0][_0x5438('0xb1')],'FaxAccountId':_0x5203bf['id'],'FaxInteractionId':_0x301704['id'],'UserId':_0x3f29d8[_0x5438('0x5c')]['id'],'ContactId':_0x301704['ContactId'],'AttachmentId':_0x3f29d8['body'][_0x5438('0xa4')][0x0]['id']})[_0x5438('0x20')](function(_0x4b264e){_0x301704[_0x5438('0xb4')][_0x5438('0xb5')]=[];_0x301704['dataValues'][_0x5438('0xb5')][_0x5438('0x85')](_0x4b264e[_0x5438('0xb4')]);return _0x301704;});})['then'](function(_0x34a2d0){respondWithRpcPromise(_0x5438('0xb6'),'SendFax',{'FaxAccountId':_[_0x5438('0xa9')](_0x3f29d8['params']['id'])?undefined:_0x3f29d8['params']['id'],'path':_['isNil'](_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][0x0][_0x5438('0x8')])?undefined:_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][0x0][_0x5438('0x8')],'fax':_[_0x5438('0xa9')](_0x3f29d8[_0x5438('0x5b')]['to'][0x0])?undefined:_0x3f29d8[_0x5438('0x5b')]['to'][0x0],'AttachmentId':_0x3f29d8[_0x5438('0x5b')][_0x5438('0xa4')][0x0]['id']},client9002)[_0x5438('0x20')](function(_0x17807d){logger[_0x5438('0x21')](_0x5438('0xb7'),_0x17807d);})[_0x5438('0x59')](function(_0xd5b08a){logger[_0x5438('0x21')](_0x5438('0xb7'),_0xd5b08a);});return _0x34a2d0;})[_0x5438('0x20')](respondWithResult(_0xd9069a,null))[_0x5438('0x59')](handleError(_0xd9069a,null));};exports[_0x5438('0xb8')]=function(_0x3ec16b,_0x3f34d2,_0x46d2fe){return db['FaxAccount'][_0x5438('0x58')]({'where':{'id':_0x3ec16b[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x3f34d2,null))['then'](function(_0x3e1ec0){if(_0x3e1ec0){return _0x3e1ec0['addAgents'](_0x3ec16b['body'][_0x5438('0x6a')],_[_0x5438('0x72')](_0x3ec16b[_0x5438('0x5b')],[_0x5438('0x6a'),'id'])||{})[_0x5438('0xb3')](function(_0x337dcf){for(var _0x2b6772=0x0;_0x2b6772<_0x3ec16b[_0x5438('0x5b')]['ids'][_0x5438('0x46')];_0x2b6772+=0x1){socket[_0x5438('0xb9')](_0x5438('0xba'),{'UserId':_0x3ec16b[_0x5438('0x5b')]['ids'][_0x2b6772],'FaxAccountId':_0x3ec16b['params']['id']});}return _0x337dcf;});}})[_0x5438('0x20')](respondWithResult(_0x3f34d2,null))[_0x5438('0x59')](handleError(_0x3f34d2,null));};exports[_0x5438('0xbb')]=function(_0x5e3310,_0x392e16,_0x3e131f){var _0x32db26;return db[_0x5438('0x3e')][_0x5438('0x58')]({'where':{'id':_0x5e3310[_0x5438('0x63')]['id']}})[_0x5438('0x20')](handleEntityNotFound(_0x392e16,null))[_0x5438('0x20')](function(_0x5cdd98){if(_0x5cdd98){return _0x5cdd98['removeAgents'](_0x5e3310['query']['ids'])[_0x5438('0x20')](function(_0x5d4a15){if(_[_0x5438('0xbc')](_0x5e3310['query'][_0x5438('0x6a')])){for(var _0x4c015d=0x0;_0x4c015d<_0x5e3310[_0x5438('0x41')][_0x5438('0x6a')][_0x5438('0x46')];_0x4c015d+=0x1){socket[_0x5438('0xb9')]('userFaxAccount:remove',{'UserId':_0x5e3310[_0x5438('0x41')]['ids'][_0x4c015d],'FaxAccountId':_0x5e3310['params']['id']});}}else{socket[_0x5438('0xb9')](_0x5438('0xbd'),{'UserId':_0x5e3310['query'][_0x5438('0x6a')],'FaxAccountId':_0x5e3310['params']['id']});}});}})[_0x5438('0x20')](respondWithStatusCode(_0x392e16,null))[_0x5438('0x59')](handleError(_0x392e16,null));};exports[_0x5438('0xbe')]=function(_0x59c340,_0x1b5d4f,_0x1f87ff){var _0x4869a0={};var _0x4b83a9={};var _0x589070;var _0x447ef4;return db['FaxAccount']['findOne']({'where':{'id':_0x59c340[_0x5438('0x63')]['id']}})['then'](handleEntityNotFound(_0x1b5d4f,null))[_0x5438('0x20')](function(_0x4d9ded){if(_0x4d9ded){_0x589070=_0x4d9ded;_0x4b83a9[_0x5438('0x3f')]=_[_0x5438('0x40')](db[_0x5438('0x75')][_0x5438('0x57')]);_0x4b83a9[_0x5438('0x41')]=_[_0x5438('0x40')](_0x59c340[_0x5438('0x41')]);_0x4b83a9[_0x5438('0x42')]=_['intersection'](_0x4b83a9[_0x5438('0x3f')],_0x4b83a9[_0x5438('0x41')]);_0x4869a0[_0x5438('0x43')]=_[_0x5438('0x44')](_0x4b83a9[_0x5438('0x3f')],qs[_0x5438('0x45')](_0x59c340[_0x5438('0x41')][_0x5438('0x45')]));_0x4869a0['attributes']=_0x4869a0[_0x5438('0x43')][_0x5438('0x46')]?_0x4869a0[_0x5438('0x43')]:_0x4b83a9[_0x5438('0x3f')];_0x4869a0[_0x5438('0x6e')]=qs[_0x5438('0x49')](_0x59c340['query'][_0x5438('0x49')]);_0x4869a0[_0x5438('0x4a')]=qs[_0x5438('0x42')](_[_0x5438('0x4b')](_0x59c340['query'],_0x4b83a9['filters']));if(_0x59c340[_0x5438('0x41')][_0x5438('0x51')]){_0x4869a0['where']=_[_0x5438('0x4c')](_0x4869a0[_0x5438('0x4a')],{'$or':_['map'](_0x4869a0['attributes'],function(_0x33a40e){var _0x44ae26={};_0x44ae26[_0x33a40e]={'$like':'%'+_0x59c340[_0x5438('0x41')]['filter']+'%'};return _0x44ae26;})});}_0x4869a0=_[_0x5438('0x4c')]({},_0x4869a0,_0x59c340[_0x5438('0x52')]);return _0x589070[_0x5438('0xbe')](_0x4869a0);}})[_0x5438('0x20')](function(_0x56d2eb){if(_0x56d2eb){_0x447ef4=_0x56d2eb[_0x5438('0x46')];if(!_0x59c340[_0x5438('0x41')][_0x5438('0x47')](_0x5438('0x48'))){_0x4869a0['limit']=qs[_0x5438('0x2e')](_0x59c340['query']['limit']);_0x4869a0['offset']=qs[_0x5438('0x2d')](_0x59c340[_0x5438('0x41')][_0x5438('0x2d')]);}return _0x589070[_0x5438('0xbe')](_0x4869a0);}})[_0x5438('0x20')](function(_0x2e29f7){if(_0x2e29f7){return _0x2e29f7?{'count':_0x447ef4,'rows':_0x2e29f7}:null;}})[_0x5438('0x20')](respondWithResult(_0x1b5d4f,null))[_0x5438('0x59')](handleError(_0x1b5d4f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index a0bfdf5..04ab55f 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 _0xc029=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','remove'];(function(_0x185564,_0x723533){var _0x5e2c8e=function(_0x20fa47){while(--_0x20fa47){_0x185564['push'](_0x185564['shift']());}};_0x5e2c8e(++_0x723533);}(_0xc029,0xc3));var _0x9c02=function(_0xa3ff70,_0x4a8609){_0xa3ff70=_0xa3ff70-0x0;var _0x538dbb=_0xc029[_0xa3ff70];return _0x538dbb;};'use strict';var EventEmitter=require(_0x9c02('0x0'));var FaxAccount=require(_0x9c02('0x1'))['db'][_0x9c02('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9c02('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c02('0x4')};function emitEvent(_0x50730e){return function(_0x2e964b,_0x40b6f3,_0xd478eb){FaxAccountEvents[_0x9c02('0x5')](_0x50730e+':'+_0x2e964b['id'],_0x2e964b);FaxAccountEvents[_0x9c02('0x5')](_0x50730e,_0x2e964b);_0xd478eb(null);};}for(var e in events){if(events[_0x9c02('0x6')](e)){var event=events[e];FaxAccount[_0x9c02('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x76fe=['update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x59712d,_0x151540){var _0x592375=function(_0x4d9d31){while(--_0x4d9d31){_0x59712d['push'](_0x59712d['shift']());}};_0x592375(++_0x151540);}(_0x76fe,0x132));var _0xe76f=function(_0xe3b7bb,_0x263836){_0xe3b7bb=_0xe3b7bb-0x0;var _0x2df486=_0x76fe[_0xe3b7bb];return _0x2df486;};'use strict';var EventEmitter=require(_0xe76f('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe76f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe76f('0x2'),'afterDestroy':_0xe76f('0x3')};function emitEvent(_0x38e958){return function(_0x2486d5,_0xb1eb4c,_0x55415d){FaxAccountEvents[_0xe76f('0x4')](_0x38e958+':'+_0x2486d5['id'],_0x2486d5);FaxAccountEvents[_0xe76f('0x4')](_0x38e958,_0x2486d5);_0x55415d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe76f('0x5')](e,emitEvent(event));}}module[_0xe76f('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 9ba970a..34372b1 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 _0x608b=['util','../../config/logger','api','moment','bluebird','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x608b,0xa9));var _0xb608=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x608b[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xb608('0x0'));var util=require(_0xb608('0x1'));var logger=require(_0xb608('0x2'))(_0xb608('0x3'));var moment=require(_0xb608('0x4'));var BPromise=require(_0xb608('0x5'));var rp=require('request-promise');var attributes=require(_0xb608('0x6'));module[_0xb608('0x7')]=function(_0x4b0dc8,_0x59bfc9){return _0x4b0dc8['define'](_0xb608('0x8'),attributes,{'tableName':_0xb608('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x795a=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','api','moment','request-promise'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x795a,0x79));var _0xa795=function(_0x136396,_0x518ddd){_0x136396=_0x136396-0x0;var _0x4609de=_0x795a[_0x136396];return _0x4609de;};'use strict';var _=require(_0xa795('0x0'));var util=require(_0xa795('0x1'));var logger=require('../../config/logger')(_0xa795('0x2'));var moment=require(_0xa795('0x3'));var BPromise=require('bluebird');var rp=require(_0xa795('0x4'));var attributes=require(_0xa795('0x5'));module[_0xa795('0x6')]=function(_0x50fedd,_0x210bb8){return _0x50fedd[_0xa795('0x7')]('FaxAccount',attributes,{'tableName':_0xa795('0x8'),'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 d6fc240..f781962 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 _0xe785=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','Contacts','DESC','FaxApplication','List','get','applications','Applications','list','orderBy','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','findAll','options','raw','limit','map','include','model','attributes','catch','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x12cc21,_0x177870){var _0x57db1c=function(_0x2706e2){while(--_0x2706e2){_0x12cc21['push'](_0x12cc21['shift']());}};_0x57db1c(++_0x177870);}(_0xe785,0x128));var _0x5e78=function(_0x30c9db,_0x29842f){_0x30c9db=_0x30c9db-0x0;var _0x114d48=_0xe785[_0x30c9db];return _0x114d48;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var moment=require('moment');var BPromise=require(_0x5e78('0x2'));var rs=require(_0x5e78('0x3'));var fs=require('fs');var Redis=require(_0x5e78('0x4'));var db=require(_0x5e78('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e78('0x6'));var config=require(_0x5e78('0x7'));var jayson=require(_0x5e78('0x8'));var client=jayson[_0x5e78('0x9')]['http']({'port':0x232c});config['redis']=_[_0x5e78('0xa')](config[_0x5e78('0xb')],{'host':_0x5e78('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e78('0xb')]));require('./faxAccount.socket')[_0x5e78('0xd')](socket);function respondWithRpcPromise(_0x5ceec3,_0x3f4c30,_0xab263e){return new BPromise(function(_0x503d83,_0x171425){return client[_0x5e78('0xe')](_0x5ceec3,_0xab263e)[_0x5e78('0xf')](function(_0x348bb1){logger[_0x5e78('0x10')](_0x5e78('0x11'),_0x3f4c30,_0x5e78('0x12'));logger['debug'](_0x5e78('0x13'),_0x3f4c30,_0x5e78('0x12'),JSON[_0x5e78('0x14')](_0x348bb1));if(_0x348bb1['error']){if(_0x348bb1[_0x5e78('0x15')][_0x5e78('0x16')]===0x1f4){logger[_0x5e78('0x15')](_0x5e78('0x11'),_0x3f4c30,_0x348bb1['error'][_0x5e78('0x17')]);return _0x171425(_0x348bb1[_0x5e78('0x15')][_0x5e78('0x17')]);}logger[_0x5e78('0x15')](_0x5e78('0x11'),_0x3f4c30,_0x348bb1[_0x5e78('0x15')]['message']);return _0x503d83(_0x348bb1['error'][_0x5e78('0x17')]);}else{logger[_0x5e78('0x10')](_0x5e78('0x11'),_0x3f4c30,'request\x20sent');_0x503d83(_0x348bb1['result']['message']);}})['catch'](function(_0x1aa2ab){logger[_0x5e78('0x15')](_0x5e78('0x11'),_0x3f4c30,_0x1aa2ab);_0x171425(_0x1aa2ab);});});}exports[_0x5e78('0x18')]=function(_0x1b6721){var _0xa15035=this;return new Promise(function(_0x578a61,_0xa20b19){return db[_0x5e78('0x19')][_0x5e78('0x1a')]({'raw':_0x1b6721[_0x5e78('0x1b')]?_0x1b6721[_0x5e78('0x1b')][_0x5e78('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b6721[_0x5e78('0x1b')]?_0x1b6721[_0x5e78('0x1b')]['where']||null:null,'attributes':_0x1b6721[_0x5e78('0x1b')]?_0x1b6721[_0x5e78('0x1b')]['attributes']||null:null,'limit':_0x1b6721[_0x5e78('0x1b')]?_0x1b6721[_0x5e78('0x1b')][_0x5e78('0x1d')]||null:null,'include':_0x1b6721[_0x5e78('0x1b')]?_0x1b6721[_0x5e78('0x1b')]['include']?_[_0x5e78('0x1e')](_0x1b6721[_0x5e78('0x1b')][_0x5e78('0x1f')],function(_0x3b39f4){return{'model':db[_0x3b39f4[_0x5e78('0x20')]],'as':_0x3b39f4['as'],'attributes':_0x3b39f4[_0x5e78('0x21')],'include':_0x3b39f4[_0x5e78('0x1f')]?_[_0x5e78('0x1e')](_0x3b39f4['include'],function(_0x250618){return{'model':db[_0x250618[_0x5e78('0x20')]],'as':_0x250618['as'],'attributes':_0x250618['attributes'],'include':_0x250618['include']?_[_0x5e78('0x1e')](_0x250618['include'],function(_0x8d0a4a){return{'model':db[_0x8d0a4a[_0x5e78('0x20')]],'as':_0x8d0a4a['as'],'attributes':_0x8d0a4a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e78('0xf')](function(_0x42db02){logger['info'](_0x5e78('0x18'),_0x1b6721);logger['debug'](_0x5e78('0x18'),_0x1b6721,JSON[_0x5e78('0x14')](_0x42db02));_0x578a61(_0x42db02);})[_0x5e78('0x22')](function(_0x2c68d8){logger['error'](_0x5e78('0x18'),_0x2c68d8['message'],_0x1b6721);_0xa20b19(_0xa15035[_0x5e78('0x15')](0x1f4,_0x2c68d8['message']));});});};exports[_0x5e78('0x23')]=function(_0x311ad0,_0x13a91a,_0x4cb744){var _0x120b85=this;return new Promise(function(_0x2c1d37,_0x4900d2){var _0x158207={'body':_0x311ad0['body'],'channel':_0x5e78('0x24')};var _0x140920=[];var _0x47fd75=[];var _0x7a0f23={};return db[_0x5e78('0x25')][_0x5e78('0x26')]()[_0x5e78('0xf')](function(_0x16ba5a){if(!_0x16ba5a){throw new db[(_0x5e78('0x27'))][(_0x5e78('0x28'))](_0x5e78('0x29'));}_0x140920=_[_0x5e78('0x2a')](_['keys'](_0x16ba5a),[_0x5e78('0x2b'),'updatedAt']);_0x47fd75=_[_0x5e78('0x2a')](_['keys'](_0x16ba5a),[_0x5e78('0x2b'),'updatedAt',_0x5e78('0x2c'),_0x5e78('0x2d')]);if(_0x311ad0[_0x5e78('0x2e')]['id']){delete _0x311ad0['body']['id'];}if(_[_0x5e78('0x2f')](_0x311ad0[_0x5e78('0x2e')]['from'])){throw new db['Sequelize'][(_0x5e78('0x28'))](_0x5e78('0x30'));}if(_[_0x5e78('0x2f')](_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x2e')])||_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x2e')]===''){throw new db[(_0x5e78('0x27'))][(_0x5e78('0x28'))](_0x5e78('0x31'));}if(_[_0x5e78('0x2f')](_0x311ad0['body'][_0x5e78('0x32')])){throw new db[(_0x5e78('0x27'))][(_0x5e78('0x28'))](_0x5e78('0x33')+_0x47fd75);}if(!_['includes'](_0x47fd75,_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x32')])){throw new db[(_0x5e78('0x27'))][(_0x5e78('0x28'))](_0x5e78('0x34')+_0x47fd75);}_0x7a0f23[_0x311ad0[_0x5e78('0x2e')]['mapKey']]=_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x35')];})[_0x5e78('0xf')](function(){return db[_0x5e78('0x19')][_0x5e78('0x36')]({'where':{'id':_0x311ad0['account']['id']},'include':[{'model':db[_0x5e78('0x37')],'as':'List','include':[{'model':db[_0x5e78('0x25')],'as':_0x5e78('0x38'),'where':_0x7a0f23,'limit':0x1,'order':[['updatedAt',_0x5e78('0x39')]]}]},{'model':db[_0x5e78('0x3a')],'as':'Applications'}]});})[_0x5e78('0xf')](function(_0x33e7ba){if(_0x33e7ba&&_0x33e7ba[_0x5e78('0x3b')]){var _0x4c6788=_0x33e7ba[_0x5e78('0x3c')]({'plain':!![]});_0x158207['account']=_0x4c6788;_0x158207[_0x5e78('0x3d')]=_0x4c6788[_0x5e78('0x3e')];_0x158207[_0x5e78('0x3f')]=_0x4c6788[_0x5e78('0x3b')];_0x158207['applications']=_[_0x5e78('0x40')](_0x158207[_0x5e78('0x3d')],['priority'],['asc']);if(_0x158207[_0x5e78('0x41')][_0x5e78('0x3e')]){delete _0x158207[_0x5e78('0x41')][_0x5e78('0x3e')];}if(_0x158207[_0x5e78('0x41')]['List']&&_0x158207[_0x5e78('0x41')][_0x5e78('0x3b')][_0x5e78('0x38')][_0x5e78('0x42')]){return _0x158207[_0x5e78('0x41')]['List'][_0x5e78('0x38')][0x0];}var _0x26c4ef=_['defaults'](_0x311ad0['body'],{'firstName':_0x311ad0['body'][_0x5e78('0x35')],'ListId':_0x4c6788[_0x5e78('0x2d')]});_0x26c4ef[_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x32')]]=_0x311ad0[_0x5e78('0x2e')]['from'];return db[_0x5e78('0x25')][_0x5e78('0x43')](_0x26c4ef,{'fields':_0x140920,'raw':!![]});}})[_0x5e78('0xf')](function(_0x5cadfd){_0x158207[_0x5e78('0x44')]=_0x5cadfd;if(_0x5cadfd){var _0xd6522e={'ContactId':_0x5cadfd['id'],'FaxAccountId':_0x311ad0[_0x5e78('0x41')]['id'],'fax':_0x5cadfd[_0x5e78('0x24')]};return db[_0x5e78('0x45')]['find']({'where':{'ContactId':_0x5cadfd['id'],'closed':![],'FaxAccountId':_0x311ad0[_0x5e78('0x41')]['id']}})[_0x5e78('0xf')](function(_0x4c8a73){if(_0x4c8a73){return[_0x4c8a73,![]];}return db[_0x5e78('0x45')][_0x5e78('0x43')](_0xd6522e)[_0x5e78('0xf')](function(_0x155adf){return[_0x155adf,!![]];});});}else{throw new Error(_0x5e78('0x46'));}})[_0x5e78('0x47')](function(_0x420ae9,_0x3c77ab){var _0x226cf8=_0x420ae9[_0x5e78('0x3c')]({'plain':!![]});if(_0x3c77ab){if(_0x158207['account'][_0x5e78('0x48')]){_0x158207[_0x5e78('0x3d')]['push']({'id':0x0,'priority':_0x158207['applications'][_0x5e78('0x42')]+0x1,'app':_0x5e78('0x49'),'appdata':_0x5e78('0x4a'),'interval':_0x5e78('0x4b')});}_0x226cf8[_0x5e78('0x4c')]=!![];}else{_0x226cf8[_0x5e78('0x4c')]=![];}_0x158207[_0x5e78('0x4d')]=_0x226cf8;return db['FaxMessage'][_0x5e78('0x43')]({'body':_0x311ad0[_0x5e78('0x2e')][_0x5e78('0x2e')],'FaxAccountId':_0x311ad0[_0x5e78('0x41')]['id'],'FaxInteractionId':_0x420ae9['id'],'direction':'in','ContactId':_0x420ae9[_0x5e78('0x4e')],'AttachmentId':_0x311ad0[_0x5e78('0x2e')]['AttachmentId']});})[_0x5e78('0xf')](function(_0x30f513){_0x158207[_0x5e78('0x17')]=_0x30f513;if(_0x158207['interaction'][_0x5e78('0x4f')]){return db[_0x5e78('0x50')][_0x5e78('0x36')]({'attributes':['id',_0x5e78('0x51')],'where':{'id':_0x158207[_0x5e78('0x4d')][_0x5e78('0x4f')]}})[_0x5e78('0xf')](function(_0x402b06){if(_0x402b06){_0x158207[_0x5e78('0x3d')][_0x5e78('0x52')]({'id':0x0,'priority':0x0,'app':_0x5e78('0x53'),'appdata':_0x402b06[_0x5e78('0x51')]+','+(_0x158207[_0x5e78('0x41')][_0x5e78('0x54')]||0xa),'interval':_0x5e78('0x4b')});}return respondWithRpcPromise(_0x5e78('0x55'),_0x5e78('0x56'),_0x158207);});}return respondWithRpcPromise(_0x5e78('0x55'),'startRouting',_0x158207);})[_0x5e78('0xf')](function(_0x2d8cef){_0x2c1d37(_0x2d8cef);})[_0x5e78('0x22')](function(_0x18466c){_0x4900d2(_0x120b85[_0x5e78('0x15')](0x1f4,_0x18466c['message']));});});}; \ No newline at end of file +var _0xf69f=['createdAt','updatedAt','ListId','body','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','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','priority','asc','length','FaxInteraction','find','create','Contact\x20not\x20found','autoclose','push','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','waitForTheAssignedAgent','startRouting','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./faxAccount.socket','register','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','FaxAccount','findAll','options','raw','where','attributes','include','model','map','then','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf69f,0x85));var _0xff69=function(_0x49a46b,_0x524f03){_0x49a46b=_0x49a46b-0x0;var _0x4ac2e5=_0xf69f[_0x49a46b];return _0x4ac2e5;};'use strict';var _=require('lodash');var util=require(_0xff69('0x0'));var moment=require(_0xff69('0x1'));var BPromise=require(_0xff69('0x2'));var rs=require(_0xff69('0x3'));var fs=require('fs');var Redis=require(_0xff69('0x4'));var db=require(_0xff69('0x5'))['db'];var utils=require(_0xff69('0x6'));var logger=require('../../config/logger')(_0xff69('0x7'));var config=require(_0xff69('0x8'));var jayson=require(_0xff69('0x9'));var client=jayson['client'][_0xff69('0xa')]({'port':0x232c});config['redis']=_[_0xff69('0xb')](config[_0xff69('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xff69('0xd'))(new Redis(config['redis']));require(_0xff69('0xe'))[_0xff69('0xf')](socket);function respondWithRpcPromise(_0x1c3e76,_0x4ecb46,_0x4ded65){return new BPromise(function(_0x3ecbd6,_0x41e966){return client[_0xff69('0x10')](_0x1c3e76,_0x4ded65)['then'](function(_0x370ddc){logger[_0xff69('0x11')]('FaxAccount,\x20%s,\x20%s',_0x4ecb46,_0xff69('0x12'));logger[_0xff69('0x13')](_0xff69('0x14'),_0x4ecb46,_0xff69('0x12'),JSON[_0xff69('0x15')](_0x370ddc));if(_0x370ddc[_0xff69('0x16')]){if(_0x370ddc[_0xff69('0x16')][_0xff69('0x17')]===0x1f4){logger[_0xff69('0x16')](_0xff69('0x18'),_0x4ecb46,_0x370ddc[_0xff69('0x16')][_0xff69('0x19')]);return _0x41e966(_0x370ddc[_0xff69('0x16')][_0xff69('0x19')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x4ecb46,_0x370ddc[_0xff69('0x16')][_0xff69('0x19')]);return _0x3ecbd6(_0x370ddc[_0xff69('0x16')][_0xff69('0x19')]);}else{logger[_0xff69('0x11')](_0xff69('0x18'),_0x4ecb46,'request\x20sent');_0x3ecbd6(_0x370ddc[_0xff69('0x1a')][_0xff69('0x19')]);}})['catch'](function(_0x5b4430){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4ecb46,_0x5b4430);_0x41e966(_0x5b4430);});});}exports['GetFaxAccount']=function(_0x8eb075){var _0x38714e=this;return new Promise(function(_0x4ca9fd,_0x30cbaa){return db[_0xff69('0x1b')][_0xff69('0x1c')]({'raw':_0x8eb075[_0xff69('0x1d')]?_0x8eb075[_0xff69('0x1d')][_0xff69('0x1e')]===undefined?!![]:![]:!![],'where':_0x8eb075[_0xff69('0x1d')]?_0x8eb075['options'][_0xff69('0x1f')]||null:null,'attributes':_0x8eb075[_0xff69('0x1d')]?_0x8eb075[_0xff69('0x1d')][_0xff69('0x20')]||null:null,'limit':_0x8eb075[_0xff69('0x1d')]?_0x8eb075['options']['limit']||null:null,'include':_0x8eb075[_0xff69('0x1d')]?_0x8eb075[_0xff69('0x1d')][_0xff69('0x21')]?_['map'](_0x8eb075['options']['include'],function(_0x48a182){return{'model':db[_0x48a182['model']],'as':_0x48a182['as'],'attributes':_0x48a182[_0xff69('0x20')],'include':_0x48a182[_0xff69('0x21')]?_['map'](_0x48a182[_0xff69('0x21')],function(_0x4ae110){return{'model':db[_0x4ae110[_0xff69('0x22')]],'as':_0x4ae110['as'],'attributes':_0x4ae110[_0xff69('0x20')],'include':_0x4ae110[_0xff69('0x21')]?_[_0xff69('0x23')](_0x4ae110[_0xff69('0x21')],function(_0x1e4bae){return{'model':db[_0x1e4bae[_0xff69('0x22')]],'as':_0x1e4bae['as'],'attributes':_0x1e4bae[_0xff69('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff69('0x24')](function(_0xde7415){logger[_0xff69('0x11')](_0xff69('0x25'),_0x8eb075);logger[_0xff69('0x13')](_0xff69('0x25'),_0x8eb075,JSON['stringify'](_0xde7415));_0x4ca9fd(_0xde7415);})['catch'](function(_0x4aeddf){logger[_0xff69('0x16')](_0xff69('0x25'),_0x4aeddf['message'],_0x8eb075);_0x30cbaa(_0x38714e[_0xff69('0x16')](0x1f4,_0x4aeddf[_0xff69('0x19')]));});});};exports[_0xff69('0x26')]=function(_0xe614aa,_0x42ee96,_0x1f41f2){var _0x1c2f47=this;return new Promise(function(_0x584320,_0x36db70){var _0x1913ba={'body':_0xe614aa['body'],'channel':_0xff69('0x27')};var _0x27b22d=[];var _0x2abe82=[];var _0x535083={};return db[_0xff69('0x28')][_0xff69('0x29')]()[_0xff69('0x24')](function(_0x450771){if(!_0x450771){throw new db[(_0xff69('0x2a'))][(_0xff69('0x2b'))](_0xff69('0x2c'));}_0x27b22d=_[_0xff69('0x2d')](_[_0xff69('0x2e')](_0x450771),[_0xff69('0x2f'),_0xff69('0x30')]);_0x2abe82=_[_0xff69('0x2d')](_['keys'](_0x450771),[_0xff69('0x2f'),'updatedAt','CompanyId',_0xff69('0x31')]);if(_0xe614aa[_0xff69('0x32')]['id']){delete _0xe614aa[_0xff69('0x32')]['id'];}if(_[_0xff69('0x33')](_0xe614aa[_0xff69('0x32')][_0xff69('0x34')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0xe614aa[_0xff69('0x32')]['body'])||_0xe614aa['body'][_0xff69('0x32')]===''){throw new db['Sequelize'][(_0xff69('0x2b'))](_0xff69('0x35'));}if(_[_0xff69('0x33')](_0xe614aa[_0xff69('0x32')][_0xff69('0x36')])){throw new db[(_0xff69('0x2a'))][(_0xff69('0x2b'))](_0xff69('0x37')+_0x2abe82);}if(!_[_0xff69('0x38')](_0x2abe82,_0xe614aa[_0xff69('0x32')]['mapKey'])){throw new db[(_0xff69('0x2a'))][(_0xff69('0x2b'))](_0xff69('0x39')+_0x2abe82);}_0x535083[_0xe614aa[_0xff69('0x32')][_0xff69('0x36')]]=_0xe614aa[_0xff69('0x32')][_0xff69('0x34')];})[_0xff69('0x24')](function(){return db[_0xff69('0x1b')]['find']({'where':{'id':_0xe614aa['account']['id']},'include':[{'model':db[_0xff69('0x3a')],'as':_0xff69('0x3b'),'include':[{'model':db[_0xff69('0x28')],'as':_0xff69('0x3c'),'where':_0x535083,'limit':0x1,'order':[[_0xff69('0x30'),_0xff69('0x3d')]]}]},{'model':db[_0xff69('0x3e')],'as':_0xff69('0x3f')}]});})[_0xff69('0x24')](function(_0x3b50f8){if(_0x3b50f8&&_0x3b50f8[_0xff69('0x3b')]){var _0x1587aa=_0x3b50f8[_0xff69('0x40')]({'plain':!![]});_0x1913ba[_0xff69('0x41')]=_0x1587aa;_0x1913ba[_0xff69('0x42')]=_0x1587aa['Applications'];_0x1913ba[_0xff69('0x43')]=_0x1587aa[_0xff69('0x3b')];_0x1913ba[_0xff69('0x42')]=_[_0xff69('0x44')](_0x1913ba[_0xff69('0x42')],[_0xff69('0x45')],[_0xff69('0x46')]);if(_0x1913ba[_0xff69('0x41')][_0xff69('0x3f')]){delete _0x1913ba['account'][_0xff69('0x3f')];}if(_0x1913ba[_0xff69('0x41')][_0xff69('0x3b')]&&_0x1913ba[_0xff69('0x41')]['List'][_0xff69('0x3c')][_0xff69('0x47')]){return _0x1913ba['account']['List'][_0xff69('0x3c')][0x0];}var _0x443ff7=_[_0xff69('0xb')](_0xe614aa[_0xff69('0x32')],{'firstName':_0xe614aa[_0xff69('0x32')][_0xff69('0x34')],'ListId':_0x1587aa[_0xff69('0x31')]});_0x443ff7[_0xe614aa['body'][_0xff69('0x36')]]=_0xe614aa[_0xff69('0x32')][_0xff69('0x34')];return db['CmContact']['create'](_0x443ff7,{'fields':_0x27b22d,'raw':!![]});}})['then'](function(_0x1a06aa){_0x1913ba['contact']=_0x1a06aa;if(_0x1a06aa){var _0x2fcebf={'ContactId':_0x1a06aa['id'],'FaxAccountId':_0xe614aa[_0xff69('0x41')]['id'],'fax':_0x1a06aa[_0xff69('0x27')]};return db[_0xff69('0x48')][_0xff69('0x49')]({'where':{'ContactId':_0x1a06aa['id'],'closed':![],'FaxAccountId':_0xe614aa[_0xff69('0x41')]['id']}})['then'](function(_0x12f646){if(_0x12f646){return[_0x12f646,![]];}return db['FaxInteraction'][_0xff69('0x4a')](_0x2fcebf)[_0xff69('0x24')](function(_0x38bc32){return[_0x38bc32,!![]];});});}else{throw new Error(_0xff69('0x4b'));}})['spread'](function(_0x467327,_0x52f1e3){var _0x19cd3e=_0x467327[_0xff69('0x40')]({'plain':!![]});if(_0x52f1e3){if(_0x1913ba[_0xff69('0x41')][_0xff69('0x4c')]){_0x1913ba[_0xff69('0x42')][_0xff69('0x4d')]({'id':0x0,'priority':_0x1913ba[_0xff69('0x42')][_0xff69('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x19cd3e[_0xff69('0x4e')]=!![];}else{_0x19cd3e['created']=![];}_0x1913ba['interaction']=_0x19cd3e;return db[_0xff69('0x4f')][_0xff69('0x4a')]({'body':_0xe614aa[_0xff69('0x32')][_0xff69('0x32')],'FaxAccountId':_0xe614aa[_0xff69('0x41')]['id'],'FaxInteractionId':_0x467327['id'],'direction':'in','ContactId':_0x467327[_0xff69('0x50')],'AttachmentId':_0xe614aa[_0xff69('0x32')][_0xff69('0x51')]});})[_0xff69('0x24')](function(_0x57b08f){_0x1913ba[_0xff69('0x19')]=_0x57b08f;if(_0x1913ba[_0xff69('0x52')][_0xff69('0x53')]){return db[_0xff69('0x54')][_0xff69('0x49')]({'attributes':['id',_0xff69('0x55')],'where':{'id':_0x1913ba[_0xff69('0x52')]['UserId']}})[_0xff69('0x24')](function(_0x5bfa93){if(_0x5bfa93){_0x1913ba[_0xff69('0x42')][_0xff69('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5bfa93[_0xff69('0x55')]+','+(_0x1913ba[_0xff69('0x41')][_0xff69('0x57')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xff69('0x58'),_0x1913ba);});}return respondWithRpcPromise('Start',_0xff69('0x58'),_0x1913ba);})[_0xff69('0x24')](function(_0x3049e0){_0x584320(_0x3049e0);})[_0xff69('0x59')](function(_0x2ec6d0){_0x36db70(_0x1c2f47[_0xff69('0x16')](0x1f4,_0x2ec6d0[_0xff69('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e700b49..400a749 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 _0xf349=['length','faxAccount:','remove','emit','register'];(function(_0x3fc424,_0x181688){var _0x54aa53=function(_0x172683){while(--_0x172683){_0x3fc424['push'](_0x3fc424['shift']());}};_0x54aa53(++_0x181688);}(_0xf349,0xac));var _0x9f34=function(_0x5d76ad,_0x26158d){_0x5d76ad=_0x5d76ad-0x0;var _0x4f7937=_0xf349[_0x5d76ad];return _0x4f7937;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x9f34('0x0'),'update'];function createListener(_0x11cb03,_0x3a2eff){return function(_0x457330){_0x3a2eff[_0x9f34('0x1')](_0x11cb03,_0x457330);};}function removeListener(_0x5ab02b,_0x125fb8){return function(){FaxAccountEvents['removeListener'](_0x5ab02b,_0x125fb8);};}exports[_0x9f34('0x2')]=function(_0x4c7b3e){for(var _0x17505b=0x0,_0x34ecac=events[_0x9f34('0x3')];_0x17505b<_0x34ecac;_0x17505b++){var _0x21d657=events[_0x17505b];var _0x4bd430=createListener(_0x9f34('0x4')+_0x21d657,_0x4c7b3e);FaxAccountEvents['on'](_0x21d657,_0x4bd430);}}; \ No newline at end of file +var _0x52ad=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0x450c4a,_0x413574){var _0x52efe2=function(_0x705dcb){while(--_0x705dcb){_0x450c4a['push'](_0x450c4a['shift']());}};_0x52efe2(++_0x413574);}(_0x52ad,0x135));var _0xd52a=function(_0x2698e9,_0x664d75){_0x2698e9=_0x2698e9-0x0;var _0x19d5a1=_0x52ad[_0x2698e9];return _0x19d5a1;};'use strict';var FaxAccountEvents=require(_0xd52a('0x0'));var events=['save',_0xd52a('0x1'),_0xd52a('0x2')];function createListener(_0xc7f668,_0x5a38f7){return function(_0x2d48a0){_0x5a38f7[_0xd52a('0x3')](_0xc7f668,_0x2d48a0);};}function removeListener(_0x451f07,_0x33b0e0){return function(){FaxAccountEvents[_0xd52a('0x4')](_0x451f07,_0x33b0e0);};}exports[_0xd52a('0x5')]=function(_0x596f01){for(var _0x5b8f04=0x0,_0x12fb4e=events[_0xd52a('0x6')];_0x5b8f04<_0x12fb4e;_0x5b8f04++){var _0x1d0592=events[_0x5b8f04];var _0x421e54=createListener(_0xd52a('0x7')+_0x1d0592,_0x596f01);FaxAccountEvents['on'](_0x1d0592,_0x421e54);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a4741e6..e5976f4 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 _0xf3aa=['destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/users','put','update','delete'];(function(_0x49eb35,_0x537463){var _0x421a10=function(_0x4049de){while(--_0x4049de){_0x49eb35['push'](_0x49eb35['shift']());}};_0x421a10(++_0x537463);}(_0xf3aa,0xe2));var _0xaf3a=function(_0x25cec5,_0x115d0c){_0x25cec5=_0x25cec5-0x0;var _0x19fba4=_0xf3aa[_0x25cec5];return _0x19fba4;};'use strict';var multer=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var path=require(_0xaf3a('0x2'));var timeout=require(_0xaf3a('0x3'));var express=require('express');var router=express[_0xaf3a('0x4')]();var auth=require(_0xaf3a('0x5'));var interaction=require(_0xaf3a('0x6'));var config=require(_0xaf3a('0x7'));var controller=require('./faxAccount.controller');router[_0xaf3a('0x8')]('/',auth[_0xaf3a('0x9')](),controller['index']);router[_0xaf3a('0x8')](_0xaf3a('0xa'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0xb')]);router[_0xaf3a('0x8')](_0xaf3a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xaf3a('0x8')](_0xaf3a('0xd'),auth[_0xaf3a('0x9')](),controller['getDispositions']);router[_0xaf3a('0x8')](_0xaf3a('0xe'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0xf')]);router[_0xaf3a('0x8')](_0xaf3a('0x10'),auth[_0xaf3a('0x9')](),controller['getInteractions']);router[_0xaf3a('0x8')](_0xaf3a('0x11'),auth['isAuthenticated'](),controller[_0xaf3a('0x12')]);router['get'](_0xaf3a('0x13'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x14')]);router[_0xaf3a('0x8')]('/:id/users',auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x15')]);router[_0xaf3a('0x16')]('/',auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x17')]);router[_0xaf3a('0x16')]('/:id/dispositions',auth[_0xaf3a('0x9')](),controller['addDisposition']);router[_0xaf3a('0x16')](_0xaf3a('0xe'),auth[_0xaf3a('0x9')](),controller['addAnswer']);router[_0xaf3a('0x16')]('/:id/interactions',auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x18')]);router[_0xaf3a('0x16')](_0xaf3a('0x11'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x19')]);router[_0xaf3a('0x16')](_0xaf3a('0x1a'),auth[_0xaf3a('0x9')](),controller['addAccountApplications']);router['post'](_0xaf3a('0x1b'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x1c')]);router[_0xaf3a('0x16')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xaf3a('0x16')](_0xaf3a('0x1d'),auth['isAuthenticated'](),controller['addAgents']);router[_0xaf3a('0x1e')]('/:id',auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x1f')]);router[_0xaf3a('0x20')](_0xaf3a('0xc'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x21')]);router[_0xaf3a('0x20')](_0xaf3a('0xd'),auth['isAuthenticated'](),controller[_0xaf3a('0x22')]);router[_0xaf3a('0x20')](_0xaf3a('0xe'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0x23')]);router[_0xaf3a('0x20')](_0xaf3a('0x1d'),auth[_0xaf3a('0x9')](),controller['removeAgents']);module[_0xaf3a('0x24')]=router; \ No newline at end of file +var _0x0c41=['send','addAgents','put','delete','destroy','/:id/dispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addAnswer','/:id/interactions','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send'];(function(_0x41c7f4,_0x59e249){var _0xe41e3f=function(_0x14d6da){while(--_0x14d6da){_0x41c7f4['push'](_0x41c7f4['shift']());}};_0xe41e3f(++_0x59e249);}(_0x0c41,0xcb));var _0x10c4=function(_0x4ac50e,_0xeeb151){_0x4ac50e=_0x4ac50e-0x0;var _0x14496c=_0x0c41[_0x4ac50e];return _0x14496c;};'use strict';var multer=require(_0x10c4('0x0'));var util=require(_0x10c4('0x1'));var path=require(_0x10c4('0x2'));var timeout=require(_0x10c4('0x3'));var express=require('express');var router=express[_0x10c4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x10c4('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x10c4('0x6')]('/',auth[_0x10c4('0x7')](),controller['index']);router[_0x10c4('0x6')](_0x10c4('0x8'),auth[_0x10c4('0x7')](),controller['describe']);router['get'](_0x10c4('0x9'),auth[_0x10c4('0x7')](),controller[_0x10c4('0xa')]);router[_0x10c4('0x6')]('/:id/dispositions',auth[_0x10c4('0x7')](),controller[_0x10c4('0xb')]);router['get'](_0x10c4('0xc'),auth[_0x10c4('0x7')](),controller[_0x10c4('0xd')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x10c4('0xe')]);router[_0x10c4('0x6')](_0x10c4('0xf'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x10')]);router[_0x10c4('0x6')](_0x10c4('0x11'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x12')]);router[_0x10c4('0x6')](_0x10c4('0x13'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x14')]);router[_0x10c4('0x15')]('/',auth[_0x10c4('0x7')](),controller[_0x10c4('0x16')]);router['post']('/:id/dispositions',auth[_0x10c4('0x7')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x10c4('0x7')](),controller[_0x10c4('0x17')]);router['post'](_0x10c4('0x18'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x19')]);router['post'](_0x10c4('0xf'),auth[_0x10c4('0x7')](),controller['addApplications']);router['post'](_0x10c4('0x1a'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x1b')]);router['post'](_0x10c4('0x1c'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x1d')]);router[_0x10c4('0x15')](_0x10c4('0x1e'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x1f')]);router[_0x10c4('0x15')](_0x10c4('0x13'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x20')]);router[_0x10c4('0x21')](_0x10c4('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x10c4('0x22')](_0x10c4('0x9'),auth[_0x10c4('0x7')](),controller[_0x10c4('0x23')]);router['delete'](_0x10c4('0x24'),auth[_0x10c4('0x7')](),controller['removeDispositions']);router[_0x10c4('0x22')]('/:id/canned_answers',auth[_0x10c4('0x7')](),controller[_0x10c4('0x25')]);router[_0x10c4('0x22')](_0x10c4('0x13'),auth[_0x10c4('0x7')](),controller['removeAgents']);module[_0x10c4('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index dd602da..a2b3831 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 _0x3f2e=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x251b81,_0x32e8d5){var _0xf320a1=function(_0x3b3071){while(--_0x3b3071){_0x251b81['push'](_0x251b81['shift']());}};_0xf320a1(++_0x32e8d5);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x37e848,_0x418405){_0x37e848=_0x37e848-0x0;var _0x512fe7=_0x3f2e[_0x37e848];return _0x512fe7;};'use strict';var Sequelize=require(_0xe3f2('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe3f2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe3f2('0x2')],'allowNull':![],'defaultValue':_0xe3f2('0x3')},'appdata':{'type':Sequelize[_0xe3f2('0x4')]()},'description':{'type':Sequelize[_0xe3f2('0x2')]},'interval':{'type':Sequelize[_0xe3f2('0x2')],'defaultValue':_0xe3f2('0x5')}}; \ No newline at end of file +var _0x5a13=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x5769ca,_0x3e892a){var _0x483b01=function(_0x5b19af){while(--_0x5b19af){_0x5769ca['push'](_0x5769ca['shift']());}};_0x483b01(++_0x3e892a);}(_0x5a13,0x92));var _0x35a1=function(_0x4ee647,_0xe1cace){_0x4ee647=_0x4ee647-0x0;var _0x3aa9a1=_0x5a13[_0x4ee647];return _0x3aa9a1;};'use strict';var Sequelize=require('sequelize');module[_0x35a1('0x0')]={'priority':{'type':Sequelize[_0x35a1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x35a1('0x2')],'allowNull':![],'defaultValue':_0x35a1('0x3')},'appdata':{'type':Sequelize[_0x35a1('0x4')]()},'description':{'type':Sequelize[_0x35a1('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x35a1('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4cb0654..106c804 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 _0xa13d=['stack','name','send','FaxApplication','rawAttributes','keys','query','filters','intersection','model','attributes','fields','limit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','update','then','error'];(function(_0x4ca2e9,_0x421004){var _0x2d8f6a=function(_0x4c669c){while(--_0x4c669c){_0x4ca2e9['push'](_0x4ca2e9['shift']());}};_0x2d8f6a(++_0x421004);}(_0xa13d,0xb1));var _0xda13=function(_0x5abef6,_0x5194f3){_0x5abef6=_0x5abef6-0x0;var _0x3e9425=_0xa13d[_0x5abef6];return _0x3e9425;};'use strict';var pdf=require(_0xda13('0x0'));var emlformat=require(_0xda13('0x1'));var rimraf=require(_0xda13('0x2'));var zipdir=require(_0xda13('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xda13('0x4'));var BPromise=require(_0xda13('0x5'));var Mustache=require(_0xda13('0x6'));var util=require('util');var path=require(_0xda13('0x7'));var sox=require(_0xda13('0x8'));var csv=require(_0xda13('0x9'));var ejs=require(_0xda13('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xda13('0xb'));var crypto=require(_0xda13('0xc'));var jsforce=require(_0xda13('0xd'));var deskjs=require(_0xda13('0xe'));var toCsv=require(_0xda13('0x9'));var querystring=require('querystring');var Papa=require(_0xda13('0xf'));var authService=require(_0xda13('0x10'));var hardwareService=require(_0xda13('0x11'));var Redis=require(_0xda13('0x12'));var qs=require(_0xda13('0x13'));var logger=require(_0xda13('0x14'))('api');var utils=require(_0xda13('0x15'));var config=require(_0xda13('0x16'));var db=require(_0xda13('0x17'))['db'];function respondWithStatusCode(_0x4980cc,_0x54c4a5){_0x54c4a5=_0x54c4a5||0xcc;return function(_0x53708b){if(_0x53708b){return _0x4980cc[_0xda13('0x18')](_0x54c4a5);}return _0x4980cc[_0xda13('0x19')](_0x54c4a5)[_0xda13('0x1a')]();};}function respondWithResult(_0x8155c,_0x57ec4a){_0x57ec4a=_0x57ec4a||0xc8;return function(_0x2393f0){if(_0x2393f0){return _0x8155c[_0xda13('0x19')](_0x57ec4a)['json'](_0x2393f0);}};}function respondWithFilteredResult(_0x2a2a68,_0x28d41b){return function(_0x5fea49){if(_0x5fea49){var _0x3271d2=_0x5fea49[_0xda13('0x1b')],_0x2600d0=_0x28d41b[_0xda13('0x1c')],_0xb746f9=_0x28d41b[_0xda13('0x1c')]+_0x28d41b['limit'],_0x47c5a8;if(_0xb746f9>=_0x3271d2){_0xb746f9=_0x3271d2;_0x47c5a8=0xc8;}else{_0x47c5a8=0xce;}_0x2a2a68[_0xda13('0x19')](_0x47c5a8);return _0x2a2a68[_0xda13('0x1d')]('Content-Range',_0x2600d0+'-'+_0xb746f9+'/'+_0x3271d2)[_0xda13('0x1e')](_0x5fea49);}return null;};}function patchUpdates(_0x16ccb2){return function(_0x529233){try{jsonpatch[_0xda13('0x1f')](_0x529233,_0x16ccb2,!![]);}catch(_0x1d6fa1){return BPromise[_0xda13('0x20')](_0x1d6fa1);}return _0x529233['save']();};}function saveUpdates(_0x4d1da2,_0x3f1d1d){return function(_0x253155){if(_0x253155){return _0x253155[_0xda13('0x21')](_0x4d1da2)[_0xda13('0x22')](function(_0x2f3b0c){return _0x2f3b0c;});}return null;};}function removeEntity(_0x45d4b2,_0xc7fabc){return function(_0xb0c452){if(_0xb0c452){return _0xb0c452['destroy']()[_0xda13('0x22')](function(){_0x45d4b2[_0xda13('0x19')](0xcc)[_0xda13('0x1a')]();});}};}function handleEntityNotFound(_0x1af1d8,_0x4260a9){return function(_0x1aa9d4){if(!_0x1aa9d4){_0x1af1d8[_0xda13('0x18')](0x194);}return _0x1aa9d4;};}function handleError(_0x5c1bd4,_0x6cac0f){_0x6cac0f=_0x6cac0f||0x1f4;return function(_0x152f66){logger[_0xda13('0x23')](_0x152f66[_0xda13('0x24')]);if(_0x152f66['name']){delete _0x152f66[_0xda13('0x25')];}_0x5c1bd4['status'](_0x6cac0f)[_0xda13('0x26')](_0x152f66);};}exports['index']=function(_0x18c03b,_0x37f4f9){var _0x123e76={},_0x9db6ba={},_0x23dd01={'count':0x0,'rows':[]};var _0x1c9042=db[_0xda13('0x27')][_0xda13('0x28')];_0x9db6ba['model']=_[_0xda13('0x29')](_0x1c9042);_0x9db6ba[_0xda13('0x2a')]=_[_0xda13('0x29')](_0x18c03b['query']);_0x9db6ba[_0xda13('0x2b')]=_[_0xda13('0x2c')](_0x9db6ba[_0xda13('0x2d')],_0x9db6ba['query']);_0x123e76[_0xda13('0x2e')]=_[_0xda13('0x2c')](_0x9db6ba[_0xda13('0x2d')],qs[_0xda13('0x2f')](_0x18c03b['query'][_0xda13('0x2f')]));_0x123e76[_0xda13('0x2e')]=_0x123e76[_0xda13('0x2e')]['length']?_0x123e76[_0xda13('0x2e')]:_0x9db6ba['model'];if(!_0x18c03b[_0xda13('0x2a')]['hasOwnProperty']('nolimit')){_0x123e76[_0xda13('0x30')]=qs[_0xda13('0x30')](_0x18c03b[_0xda13('0x2a')][_0xda13('0x30')]);_0x123e76[_0xda13('0x1c')]=qs[_0xda13('0x1c')](_0x18c03b['query']['offset']);}_0x123e76[_0xda13('0x31')]=qs[_0xda13('0x32')](_0x18c03b['query'][_0xda13('0x32')]);_0x123e76[_0xda13('0x33')]=qs[_0xda13('0x2b')](_[_0xda13('0x34')](_0x18c03b['query'],_0x9db6ba[_0xda13('0x2b')]));if(_0x18c03b[_0xda13('0x2a')][_0xda13('0x35')]){_0x123e76[_0xda13('0x33')]=_['merge'](_0x123e76['where'],{'$or':_[_0xda13('0x36')](_0x1c9042,function(_0x430d6e){if(_0x430d6e['type'][_0xda13('0x37')]!==_0xda13('0x38')){var _0x16e2fd={};_0x16e2fd[_0x430d6e[_0xda13('0x39')]]={'$like':'%'+_0x18c03b[_0xda13('0x2a')][_0xda13('0x35')]+'%'};return _0x16e2fd;}})});}_0x123e76=_[_0xda13('0x3a')]({},_0x123e76,_0x18c03b[_0xda13('0x3b')]);var _0x3e23c7={'where':_0x123e76[_0xda13('0x33')]};return db[_0xda13('0x27')][_0xda13('0x1b')](_0x3e23c7)['then'](function(_0x571d85){_0x23dd01['count']=_0x571d85;if(_0x18c03b[_0xda13('0x2a')][_0xda13('0x3c')]){_0x123e76[_0xda13('0x3d')]=[{'all':!![]}];}return db['FaxApplication'][_0xda13('0x3e')](_0x123e76);})['then'](function(_0x454b1a){_0x23dd01[_0xda13('0x3f')]=_0x454b1a;return _0x23dd01;})['then'](respondWithFilteredResult(_0x37f4f9,_0x123e76))[_0xda13('0x40')](handleError(_0x37f4f9,null));};exports['show']=function(_0x4920ec,_0x33ae34){var _0x443ca2={'raw':!![],'where':{'id':_0x4920ec[_0xda13('0x41')]['id']}},_0xfd8fc7={};_0xfd8fc7[_0xda13('0x2d')]=_['keys'](db[_0xda13('0x27')]['rawAttributes']);_0xfd8fc7['query']=_[_0xda13('0x29')](_0x4920ec[_0xda13('0x2a')]);_0xfd8fc7['filters']=_['intersection'](_0xfd8fc7[_0xda13('0x2d')],_0xfd8fc7[_0xda13('0x2a')]);_0x443ca2[_0xda13('0x2e')]=_[_0xda13('0x2c')](_0xfd8fc7[_0xda13('0x2d')],qs[_0xda13('0x2f')](_0x4920ec['query'][_0xda13('0x2f')]));_0x443ca2[_0xda13('0x2e')]=_0x443ca2[_0xda13('0x2e')][_0xda13('0x42')]?_0x443ca2[_0xda13('0x2e')]:_0xfd8fc7[_0xda13('0x2d')];if(_0x4920ec[_0xda13('0x2a')][_0xda13('0x3c')]){_0x443ca2[_0xda13('0x3d')]=[{'all':!![]}];}_0x443ca2=_[_0xda13('0x3a')]({},_0x443ca2,_0x4920ec['options']);return db['FaxApplication'][_0xda13('0x43')](_0x443ca2)['then'](handleEntityNotFound(_0x33ae34,null))['then'](respondWithResult(_0x33ae34,null))[_0xda13('0x40')](handleError(_0x33ae34,null));};exports[_0xda13('0x44')]=function(_0x27486d,_0x299786){return db[_0xda13('0x27')]['create'](_0x27486d['body'],{})[_0xda13('0x22')](respondWithResult(_0x299786,0xc9))['catch'](handleError(_0x299786,null));};exports[_0xda13('0x21')]=function(_0x5376b9,_0xabb1bd){if(_0x5376b9['body']['id']){delete _0x5376b9[_0xda13('0x45')]['id'];}return db[_0xda13('0x27')][_0xda13('0x43')]({'where':{'id':_0x5376b9['params']['id']}})[_0xda13('0x22')](handleEntityNotFound(_0xabb1bd,null))[_0xda13('0x22')](saveUpdates(_0x5376b9[_0xda13('0x45')],null))[_0xda13('0x22')](respondWithResult(_0xabb1bd,null))[_0xda13('0x40')](handleError(_0xabb1bd,null));};exports[_0xda13('0x46')]=function(_0x116c16,_0x52430b){return db[_0xda13('0x27')][_0xda13('0x43')]({'where':{'id':_0x116c16['params']['id']}})[_0xda13('0x22')](handleEntityNotFound(_0x52430b,null))[_0xda13('0x22')](removeEntity(_0x52430b,null))['catch'](handleError(_0x52430b,null));}; \ No newline at end of file +var _0x5d51=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','FaxApplication','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','field','filter','options','include','params','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','lodash'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x5d51,0x146));var _0x15d5=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5d51[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x15d5('0x0'));var emlformat=require(_0x15d5('0x1'));var rimraf=require(_0x15d5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x15d5('0x3'));var moment=require(_0x15d5('0x4'));var BPromise=require(_0x15d5('0x5'));var Mustache=require(_0x15d5('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x15d5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x15d5('0x8'));var squel=require('squel');var crypto=require(_0x15d5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x15d5('0xa'));var toCsv=require(_0x15d5('0x7'));var querystring=require(_0x15d5('0xb'));var Papa=require(_0x15d5('0xc'));var authService=require(_0x15d5('0xd'));var hardwareService=require(_0x15d5('0xe'));var Redis=require(_0x15d5('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x15d5('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x15d5('0x11'));var db=require(_0x15d5('0x12'))['db'];function respondWithStatusCode(_0x4a2d4a,_0x65225b){_0x65225b=_0x65225b||0xcc;return function(_0x31e8d5){if(_0x31e8d5){return _0x4a2d4a[_0x15d5('0x13')](_0x65225b);}return _0x4a2d4a['status'](_0x65225b)['end']();};}function respondWithResult(_0x58aa87,_0x54a967){_0x54a967=_0x54a967||0xc8;return function(_0x3f5caa){if(_0x3f5caa){return _0x58aa87[_0x15d5('0x14')](_0x54a967)[_0x15d5('0x15')](_0x3f5caa);}};}function respondWithFilteredResult(_0x4ec612,_0x3097c3){return function(_0x2437f7){if(_0x2437f7){var _0x1ed1f5=_0x2437f7[_0x15d5('0x16')],_0x34fd82=_0x3097c3[_0x15d5('0x17')],_0x2df02f=_0x3097c3[_0x15d5('0x17')]+_0x3097c3[_0x15d5('0x18')],_0x5278a9;if(_0x2df02f>=_0x1ed1f5){_0x2df02f=_0x1ed1f5;_0x5278a9=0xc8;}else{_0x5278a9=0xce;}_0x4ec612['status'](_0x5278a9);return _0x4ec612[_0x15d5('0x19')](_0x15d5('0x1a'),_0x34fd82+'-'+_0x2df02f+'/'+_0x1ed1f5)[_0x15d5('0x15')](_0x2437f7);}return null;};}function patchUpdates(_0x24060b){return function(_0x4a1241){try{jsonpatch[_0x15d5('0x1b')](_0x4a1241,_0x24060b,!![]);}catch(_0x364181){return BPromise[_0x15d5('0x1c')](_0x364181);}return _0x4a1241[_0x15d5('0x1d')]();};}function saveUpdates(_0x484a0e,_0x4ba66c){return function(_0x370601){if(_0x370601){return _0x370601[_0x15d5('0x1e')](_0x484a0e)[_0x15d5('0x1f')](function(_0x3c41e9){return _0x3c41e9;});}return null;};}function removeEntity(_0x3cece0,_0x36b454){return function(_0x2fb892){if(_0x2fb892){return _0x2fb892[_0x15d5('0x20')]()[_0x15d5('0x1f')](function(){_0x3cece0[_0x15d5('0x14')](0xcc)[_0x15d5('0x21')]();});}};}function handleEntityNotFound(_0x13226,_0x42f17f){return function(_0x124d27){if(!_0x124d27){_0x13226[_0x15d5('0x13')](0x194);}return _0x124d27;};}function handleError(_0x2b2568,_0x26781d){_0x26781d=_0x26781d||0x1f4;return function(_0x57c039){logger['error'](_0x57c039[_0x15d5('0x22')]);if(_0x57c039[_0x15d5('0x23')]){delete _0x57c039[_0x15d5('0x23')];}_0x2b2568[_0x15d5('0x14')](_0x26781d)[_0x15d5('0x24')](_0x57c039);};}exports[_0x15d5('0x25')]=function(_0xa89013,_0x3eb256){var _0x54068d={},_0x36168d={},_0x53a67d={'count':0x0,'rows':[]};var _0x2d7f17=db[_0x15d5('0x26')][_0x15d5('0x27')];_0x36168d[_0x15d5('0x28')]=_[_0x15d5('0x29')](_0x2d7f17);_0x36168d[_0x15d5('0x2a')]=_[_0x15d5('0x29')](_0xa89013[_0x15d5('0x2a')]);_0x36168d[_0x15d5('0x2b')]=_['intersection'](_0x36168d[_0x15d5('0x28')],_0x36168d[_0x15d5('0x2a')]);_0x54068d['attributes']=_[_0x15d5('0x2c')](_0x36168d[_0x15d5('0x28')],qs[_0x15d5('0x2d')](_0xa89013[_0x15d5('0x2a')]['fields']));_0x54068d[_0x15d5('0x2e')]=_0x54068d[_0x15d5('0x2e')][_0x15d5('0x2f')]?_0x54068d[_0x15d5('0x2e')]:_0x36168d['model'];if(!_0xa89013['query'][_0x15d5('0x30')](_0x15d5('0x31'))){_0x54068d[_0x15d5('0x18')]=qs[_0x15d5('0x18')](_0xa89013[_0x15d5('0x2a')][_0x15d5('0x18')]);_0x54068d['offset']=qs[_0x15d5('0x17')](_0xa89013[_0x15d5('0x2a')]['offset']);}_0x54068d[_0x15d5('0x32')]=qs['sort'](_0xa89013[_0x15d5('0x2a')]['sort']);_0x54068d[_0x15d5('0x33')]=qs[_0x15d5('0x2b')](_[_0x15d5('0x34')](_0xa89013[_0x15d5('0x2a')],_0x36168d['filters']));if(_0xa89013['query']['filter']){_0x54068d['where']=_[_0x15d5('0x35')](_0x54068d[_0x15d5('0x33')],{'$or':_['map'](_0x2d7f17,function(_0xc0bb6){if(_0xc0bb6[_0x15d5('0x36')][_0x15d5('0x37')]!==_0x15d5('0x38')){var _0x5243d6={};_0x5243d6[_0xc0bb6[_0x15d5('0x39')]]={'$like':'%'+_0xa89013[_0x15d5('0x2a')][_0x15d5('0x3a')]+'%'};return _0x5243d6;}})});}_0x54068d=_[_0x15d5('0x35')]({},_0x54068d,_0xa89013[_0x15d5('0x3b')]);var _0x34f7e6={'where':_0x54068d[_0x15d5('0x33')]};return db[_0x15d5('0x26')][_0x15d5('0x16')](_0x34f7e6)[_0x15d5('0x1f')](function(_0x3e8113){_0x53a67d[_0x15d5('0x16')]=_0x3e8113;if(_0xa89013[_0x15d5('0x2a')]['includeAll']){_0x54068d[_0x15d5('0x3c')]=[{'all':!![]}];}return db[_0x15d5('0x26')]['findAll'](_0x54068d);})[_0x15d5('0x1f')](function(_0x4e8922){_0x53a67d['rows']=_0x4e8922;return _0x53a67d;})[_0x15d5('0x1f')](respondWithFilteredResult(_0x3eb256,_0x54068d))['catch'](handleError(_0x3eb256,null));};exports['show']=function(_0x47f42c,_0x5d2da4){var _0x5090a2={'raw':!![],'where':{'id':_0x47f42c[_0x15d5('0x3d')]['id']}},_0x165ccb={};_0x165ccb[_0x15d5('0x28')]=_[_0x15d5('0x29')](db[_0x15d5('0x26')][_0x15d5('0x27')]);_0x165ccb['query']=_['keys'](_0x47f42c[_0x15d5('0x2a')]);_0x165ccb[_0x15d5('0x2b')]=_['intersection'](_0x165ccb[_0x15d5('0x28')],_0x165ccb[_0x15d5('0x2a')]);_0x5090a2[_0x15d5('0x2e')]=_[_0x15d5('0x2c')](_0x165ccb[_0x15d5('0x28')],qs['fields'](_0x47f42c['query']['fields']));_0x5090a2[_0x15d5('0x2e')]=_0x5090a2[_0x15d5('0x2e')][_0x15d5('0x2f')]?_0x5090a2[_0x15d5('0x2e')]:_0x165ccb['model'];if(_0x47f42c['query'][_0x15d5('0x3e')]){_0x5090a2['include']=[{'all':!![]}];}_0x5090a2=_[_0x15d5('0x35')]({},_0x5090a2,_0x47f42c[_0x15d5('0x3b')]);return db[_0x15d5('0x26')][_0x15d5('0x3f')](_0x5090a2)[_0x15d5('0x1f')](handleEntityNotFound(_0x5d2da4,null))[_0x15d5('0x1f')](respondWithResult(_0x5d2da4,null))[_0x15d5('0x40')](handleError(_0x5d2da4,null));};exports[_0x15d5('0x41')]=function(_0x102458,_0x549e8c){return db[_0x15d5('0x26')][_0x15d5('0x41')](_0x102458[_0x15d5('0x42')],{})[_0x15d5('0x1f')](respondWithResult(_0x549e8c,0xc9))['catch'](handleError(_0x549e8c,null));};exports[_0x15d5('0x1e')]=function(_0x402908,_0x1fcffe){if(_0x402908[_0x15d5('0x42')]['id']){delete _0x402908[_0x15d5('0x42')]['id'];}return db[_0x15d5('0x26')]['find']({'where':{'id':_0x402908[_0x15d5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1fcffe,null))[_0x15d5('0x1f')](saveUpdates(_0x402908[_0x15d5('0x42')],null))[_0x15d5('0x1f')](respondWithResult(_0x1fcffe,null))[_0x15d5('0x40')](handleError(_0x1fcffe,null));};exports['destroy']=function(_0x44c094,_0x353891){return db[_0x15d5('0x26')][_0x15d5('0x3f')]({'where':{'id':_0x44c094[_0x15d5('0x3d')]['id']}})[_0x15d5('0x1f')](handleEntityNotFound(_0x353891,null))['then'](removeEntity(_0x353891,null))[_0x15d5('0x40')](handleError(_0x353891,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bf807e2..97a6e2d 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 _0x8866=['util','api','moment','bluebird','request-promise','./faxApplication.attributes','exports','FaxApplication','fax_applications','lodash'];(function(_0x5e3cef,_0x3c57f5){var _0x34c370=function(_0x4bc3e4){while(--_0x4bc3e4){_0x5e3cef['push'](_0x5e3cef['shift']());}};_0x34c370(++_0x3c57f5);}(_0x8866,0x149));var _0x6886=function(_0x1a803f,_0x4c6f86){_0x1a803f=_0x1a803f-0x0;var _0x1782ab=_0x8866[_0x1a803f];return _0x1782ab;};'use strict';var _=require(_0x6886('0x0'));var util=require(_0x6886('0x1'));var logger=require('../../config/logger')(_0x6886('0x2'));var moment=require(_0x6886('0x3'));var BPromise=require(_0x6886('0x4'));var rp=require(_0x6886('0x5'));var attributes=require(_0x6886('0x6'));module[_0x6886('0x7')]=function(_0x284e51,_0x23ebac){return _0x284e51['define'](_0x6886('0x8'),attributes,{'tableName':_0x6886('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5178=['./faxApplication.attributes','exports','FaxApplication','fax_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x5178,0x10c));var _0x8517=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5178[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8517('0x0'));var util=require(_0x8517('0x1'));var logger=require(_0x8517('0x2'))(_0x8517('0x3'));var moment=require(_0x8517('0x4'));var BPromise=require(_0x8517('0x5'));var rp=require(_0x8517('0x6'));var attributes=require(_0x8517('0x7'));module[_0x8517('0x8')]=function(_0x134ca2,_0x5dd513){return _0x134ca2['define'](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 42a6a4d..cec81f2 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 _0x631c=['jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','options','raw','where','limit','UpdateFaxApplication','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x631c,0xa5));var _0xc631=function(_0x160f69,_0x592ad1){_0x160f69=_0x160f69-0x0;var _0x2f8cd5=_0x631c[_0x160f69];return _0x2f8cd5;};'use strict';var _=require('lodash');var util=require(_0xc631('0x0'));var moment=require(_0xc631('0x1'));var BPromise=require(_0xc631('0x2'));var rs=require(_0xc631('0x3'));var fs=require('fs');var Redis=require(_0xc631('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc631('0x5'));var logger=require(_0xc631('0x6'))(_0xc631('0x7'));var config=require(_0xc631('0x8'));var jayson=require(_0xc631('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4cf49e,_0x4b0bd6,_0x3931a1){return new BPromise(function(_0x1dad30,_0x5938ec){return client[_0xc631('0xa')](_0x4cf49e,_0x3931a1)[_0xc631('0xb')](function(_0x3afc08){logger[_0xc631('0xc')](_0xc631('0xd'),_0x4b0bd6,_0xc631('0xe'));logger['debug'](_0xc631('0xf'),_0x4b0bd6,_0xc631('0xe'),JSON[_0xc631('0x10')](_0x3afc08));if(_0x3afc08[_0xc631('0x11')]){if(_0x3afc08['error'][_0xc631('0x12')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x4b0bd6,_0x3afc08['error'][_0xc631('0x13')]);return _0x5938ec(_0x3afc08[_0xc631('0x11')][_0xc631('0x13')]);}logger[_0xc631('0x11')]('FaxApplication,\x20%s,\x20%s',_0x4b0bd6,_0x3afc08[_0xc631('0x11')][_0xc631('0x13')]);return _0x1dad30(_0x3afc08[_0xc631('0x11')][_0xc631('0x13')]);}else{logger[_0xc631('0xc')](_0xc631('0xd'),_0x4b0bd6,_0xc631('0xe'));_0x1dad30(_0x3afc08[_0xc631('0x14')]['message']);}})['catch'](function(_0x4daacf){logger[_0xc631('0x11')](_0xc631('0xd'),_0x4b0bd6,_0x4daacf);_0x5938ec(_0x4daacf);});});}exports['UpdateFaxApplication']=function(_0x5d796a){var _0x88ea1f=this;return new Promise(function(_0x294bfb,_0x4102f3){return db[_0xc631('0x15')][_0xc631('0x16')](_0x5d796a['body'],{'raw':_0x5d796a[_0xc631('0x17')]?_0x5d796a[_0xc631('0x17')][_0xc631('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d796a[_0xc631('0x17')]?_0x5d796a['options'][_0xc631('0x19')]||null:null,'attributes':_0x5d796a[_0xc631('0x17')]?_0x5d796a[_0xc631('0x17')]['attributes']||null:null,'limit':_0x5d796a[_0xc631('0x17')]?_0x5d796a['options'][_0xc631('0x1a')]||null:null})['then'](function(_0x242de2){logger[_0xc631('0xc')]('UpdateFaxApplication',_0x5d796a);logger['debug'](_0xc631('0x1b'),_0x5d796a,JSON[_0xc631('0x10')](_0x242de2));_0x294bfb(_0x242de2);})[_0xc631('0x1c')](function(_0x584a10){logger[_0xc631('0x11')](_0xc631('0x1b'),_0x584a10[_0xc631('0x13')],_0x5d796a);_0x4102f3(_0x88ea1f[_0xc631('0x11')](0x1f4,_0x584a10[_0xc631('0x13')]));});});}; \ No newline at end of file +var _0x0e2e=['request\x20sent','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5bbff7,_0x4b7b03){var _0x2c91de=function(_0x4bf784){while(--_0x4bf784){_0x5bbff7['push'](_0x5bbff7['shift']());}};_0x2c91de(++_0x4b7b03);}(_0x0e2e,0x156));var _0xe0e2=function(_0x1d7499,_0x58832d){_0x1d7499=_0x1d7499-0x0;var _0x57ae31=_0x0e2e[_0x1d7499];return _0x57ae31;};'use strict';var _=require(_0xe0e2('0x0'));var util=require(_0xe0e2('0x1'));var moment=require(_0xe0e2('0x2'));var BPromise=require(_0xe0e2('0x3'));var rs=require(_0xe0e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0e2('0x5'))['db'];var utils=require(_0xe0e2('0x6'));var logger=require(_0xe0e2('0x7'))(_0xe0e2('0x8'));var config=require(_0xe0e2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe0e2('0xa')][_0xe0e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8cdd,_0x4bbd1e,_0x3c05dd){return new BPromise(function(_0xf90776,_0x508416){return client[_0xe0e2('0xc')](_0x4a8cdd,_0x3c05dd)[_0xe0e2('0xd')](function(_0x5e8f7a){logger[_0xe0e2('0xe')](_0xe0e2('0xf'),_0x4bbd1e,'request\x20sent');logger[_0xe0e2('0x10')](_0xe0e2('0x11'),_0x4bbd1e,_0xe0e2('0x12'),JSON[_0xe0e2('0x13')](_0x5e8f7a));if(_0x5e8f7a[_0xe0e2('0x14')]){if(_0x5e8f7a[_0xe0e2('0x14')]['code']===0x1f4){logger['error'](_0xe0e2('0xf'),_0x4bbd1e,_0x5e8f7a[_0xe0e2('0x14')]['message']);return _0x508416(_0x5e8f7a['error'][_0xe0e2('0x15')]);}logger[_0xe0e2('0x14')](_0xe0e2('0xf'),_0x4bbd1e,_0x5e8f7a[_0xe0e2('0x14')][_0xe0e2('0x15')]);return _0xf90776(_0x5e8f7a[_0xe0e2('0x14')][_0xe0e2('0x15')]);}else{logger[_0xe0e2('0xe')](_0xe0e2('0xf'),_0x4bbd1e,_0xe0e2('0x12'));_0xf90776(_0x5e8f7a[_0xe0e2('0x16')][_0xe0e2('0x15')]);}})[_0xe0e2('0x17')](function(_0x1f8a9f){logger[_0xe0e2('0x14')](_0xe0e2('0xf'),_0x4bbd1e,_0x1f8a9f);_0x508416(_0x1f8a9f);});});}exports[_0xe0e2('0x18')]=function(_0xbd246){var _0x1b28ed=this;return new Promise(function(_0x4f15cd,_0x308c9e){return db[_0xe0e2('0x19')]['update'](_0xbd246['body'],{'raw':_0xbd246[_0xe0e2('0x1a')]?_0xbd246[_0xe0e2('0x1a')][_0xe0e2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd246['options']?_0xbd246[_0xe0e2('0x1a')][_0xe0e2('0x1c')]||null:null,'attributes':_0xbd246[_0xe0e2('0x1a')]?_0xbd246[_0xe0e2('0x1a')]['attributes']||null:null,'limit':_0xbd246[_0xe0e2('0x1a')]?_0xbd246[_0xe0e2('0x1a')][_0xe0e2('0x1d')]||null:null})['then'](function(_0x1c9463){logger['info'](_0xe0e2('0x18'),_0xbd246);logger['debug'](_0xe0e2('0x18'),_0xbd246,JSON[_0xe0e2('0x13')](_0x1c9463));_0x4f15cd(_0x1c9463);})[_0xe0e2('0x17')](function(_0x21525f){logger[_0xe0e2('0x14')](_0xe0e2('0x18'),_0x21525f[_0xe0e2('0x15')],_0xbd246);_0x308c9e(_0x1b28ed[_0xe0e2('0x14')](0x1f4,_0x21525f[_0xe0e2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 3c2905f..38a83b3 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 _0x5c00=['put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x48918c,_0x1d2114){var _0x4aec8f=function(_0x504478){while(--_0x504478){_0x48918c['push'](_0x48918c['shift']());}};_0x4aec8f(++_0x1d2114);}(_0x5c00,0x17e));var _0x05c0=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0x5c00[_0x5e8c32];return _0x595f7b;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xd')]('/',auth[_0x05c0('0x8')](),controller['create']);router[_0x05c0('0xe')](_0x05c0('0xb'),auth[_0x05c0('0x8')](),controller[_0x05c0('0xf')]);router[_0x05c0('0x10')](_0x05c0('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x05c0('0x11')]=router; \ No newline at end of file +var _0x1c9a=['path','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x1fd542,_0x17441f){var _0x3ba750=function(_0x54c756){while(--_0x54c756){_0x1fd542['push'](_0x1fd542['shift']());}};_0x3ba750(++_0x17441f);}(_0x1c9a,0x98));var _0xa1c9=function(_0x2707fc,_0x1a24af){_0x2707fc=_0x2707fc-0x0;var _0x1cd8f7=_0x1c9a[_0x2707fc];return _0x1cd8f7;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1c9('0xb')]);router[_0xa1c9('0xc')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller['update']);router[_0xa1c9('0xe')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);module[_0xa1c9('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 6938ae1..b9b50f9 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 _0x7837=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7837,0x69));var _0x7783=function(_0x1fad4c,_0x42eccb){_0x1fad4c=_0x1fad4c-0x0;var _0x229172=_0x7837[_0x1fad4c];return _0x229172;};'use strict';var Sequelize=require('sequelize');module[_0x7783('0x0')]={'closed':{'type':Sequelize[_0x7783('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7783('0x2')]},'disposition':{'type':Sequelize[_0x7783('0x3')]},'note':{'type':Sequelize[_0x7783('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x7783('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7783('0x4')]('in',_0x7783('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7783('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7455=['ENUM','sequelize','exports','STRING','out','DATE'];(function(_0x5c7fca,_0x11bc8f){var _0x2c211=function(_0x3c071f){while(--_0x3c071f){_0x5c7fca['push'](_0x5c7fca['shift']());}};_0x2c211(++_0x11bc8f);}(_0x7455,0x67));var _0x5745=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7455[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5745('0x0'));module[_0x5745('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5745('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5745('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5745('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5745('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 4921ee6..d8fb69f 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 _0x34fa=['findAll','rows','addTags','spread','emit','download','unix','toString','join','root','server','files','attachments','Attachment','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','apply','save','update','then','destroy','error','stack','name','index','FaxInteraction','rawAttributes','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','include','tag','Tag','Tags','distinct','push','FaxMessage','Messages','direction','createdAt','read','includeAll','User','Contact','Owner','fullname','internal','FaxAccount','Account','color','catch','show','params','keys','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','FaxInteractionId','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x480f34,_0x2f37df){var _0x245d27=function(_0x5e5b9e){while(--_0x5e5b9e){_0x480f34['push'](_0x480f34['shift']());}};_0x245d27(++_0x2f37df);}(_0x34fa,0x187));var _0xa34f=function(_0x110c16,_0x364814){_0x110c16=_0x110c16-0x0;var _0x1eec11=_0x34fa[_0x110c16];return _0x1eec11;};'use strict';var pdf=require(_0xa34f('0x0'));var emlformat=require(_0xa34f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa34f('0x2'));var jsonpatch=require(_0xa34f('0x3'));var rp=require(_0xa34f('0x4'));var moment=require('moment');var BPromise=require(_0xa34f('0x5'));var Mustache=require(_0xa34f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa34f('0x7'));var csv=require(_0xa34f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa34f('0x9'));var jsforce=require(_0xa34f('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa34f('0xb'));var Papa=require(_0xa34f('0xc'));var authService=require(_0xa34f('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xa34f('0xe'));var qs=require(_0xa34f('0xf'));var logger=require(_0xa34f('0x10'))('api');var utils=require(_0xa34f('0x11'));var config=require(_0xa34f('0x12'));var db=require(_0xa34f('0x13'))['db'];config[_0xa34f('0x14')]=_[_0xa34f('0x15')](config[_0xa34f('0x14')],{'host':_0xa34f('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa34f('0x14')]));require(_0xa34f('0x17'))[_0xa34f('0x18')](socket);function respondWithStatusCode(_0x4c3b2f,_0x559e04){_0x559e04=_0x559e04||0xcc;return function(_0x45799e){if(_0x45799e){return _0x4c3b2f[_0xa34f('0x19')](_0x559e04);}return _0x4c3b2f[_0xa34f('0x1a')](_0x559e04)[_0xa34f('0x1b')]();};}function respondWithResult(_0x59a7da,_0x522a1b){_0x522a1b=_0x522a1b||0xc8;return function(_0x4be5ff){if(_0x4be5ff){return _0x59a7da['status'](_0x522a1b)[_0xa34f('0x1c')](_0x4be5ff);}};}function respondWithFilteredResult(_0x6daf3,_0x4d9c4e){return function(_0x578ee9){if(_0x578ee9){var _0x1e6c63=_0x578ee9[_0xa34f('0x1d')],_0x380cad=_0x4d9c4e[_0xa34f('0x1e')],_0x4ecf5a=_0x4d9c4e[_0xa34f('0x1e')]+_0x4d9c4e['limit'],_0x3265cd;if(_0x4ecf5a>=_0x1e6c63){_0x4ecf5a=_0x1e6c63;_0x3265cd=0xc8;}else{_0x3265cd=0xce;}_0x6daf3[_0xa34f('0x1a')](_0x3265cd);return _0x6daf3['set']('Content-Range',_0x380cad+'-'+_0x4ecf5a+'/'+_0x1e6c63)[_0xa34f('0x1c')](_0x578ee9);}return null;};}function patchUpdates(_0x3c357e){return function(_0x17ba98){try{jsonpatch[_0xa34f('0x1f')](_0x17ba98,_0x3c357e,!![]);}catch(_0x34bc2c){return BPromise['reject'](_0x34bc2c);}return _0x17ba98[_0xa34f('0x20')]();};}function saveUpdates(_0x381c3e,_0x3f0bcf){return function(_0x517116){if(_0x517116){return _0x517116[_0xa34f('0x21')](_0x381c3e)[_0xa34f('0x22')](function(_0x25c754){return _0x25c754;});}return null;};}function removeEntity(_0x238bce,_0x4c7bf5){return function(_0x1ea7ed){if(_0x1ea7ed){return _0x1ea7ed[_0xa34f('0x23')]()[_0xa34f('0x22')](function(){_0x238bce[_0xa34f('0x1a')](0xcc)[_0xa34f('0x1b')]();});}};}function handleEntityNotFound(_0x17c774,_0x138eb8){return function(_0x570956){if(!_0x570956){_0x17c774[_0xa34f('0x19')](0x194);}return _0x570956;};}function handleError(_0x1d1ab7,_0xf7d226){_0xf7d226=_0xf7d226||0x1f4;return function(_0x4a9c54){logger[_0xa34f('0x24')](_0x4a9c54[_0xa34f('0x25')]);if(_0x4a9c54[_0xa34f('0x26')]){delete _0x4a9c54[_0xa34f('0x26')];}_0x1d1ab7[_0xa34f('0x1a')](_0xf7d226)['send'](_0x4a9c54);};}exports[_0xa34f('0x27')]=function(_0x1c500e,_0x1da994){var _0x587b4d={},_0x396cde={},_0x2431aa={'count':0x0,'rows':[]};var _0x388d78=db[_0xa34f('0x28')][_0xa34f('0x29')];_0x396cde[_0xa34f('0x2a')]=_['keys'](_0x388d78);_0x396cde['query']=_['keys'](_0x1c500e['query']);_0x396cde[_0xa34f('0x2b')]=_[_0xa34f('0x2c')](_0x396cde[_0xa34f('0x2a')],_0x396cde[_0xa34f('0x2d')]);_0x587b4d[_0xa34f('0x2e')]=_[_0xa34f('0x2c')](_0x396cde[_0xa34f('0x2a')],qs['fields'](_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x2f')]));_0x587b4d[_0xa34f('0x2e')]=_0x587b4d[_0xa34f('0x2e')][_0xa34f('0x30')]?_0x587b4d[_0xa34f('0x2e')]:_0x396cde['model'];if(!_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x31')](_0xa34f('0x32'))){_0x587b4d[_0xa34f('0x33')]=qs['limit'](_0x1c500e[_0xa34f('0x2d')]['limit']);_0x587b4d[_0xa34f('0x1e')]=qs[_0xa34f('0x1e')](_0x1c500e['query'][_0xa34f('0x1e')]);}_0x587b4d[_0xa34f('0x34')]=qs[_0xa34f('0x35')](_0x1c500e[_0xa34f('0x2d')]['sort']);_0x587b4d[_0xa34f('0x36')]=qs[_0xa34f('0x2b')](_[_0xa34f('0x37')](_0x1c500e[_0xa34f('0x2d')],_0x396cde[_0xa34f('0x2b')]));if(_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x38')]){_0x587b4d['where']=_['merge'](_0x587b4d[_0xa34f('0x36')],{'$or':_['map'](_0x388d78,function(_0x2084b3){if(_0x2084b3['type'][_0xa34f('0x39')]!==_0xa34f('0x3a')){var _0x2b35d2={};_0x2b35d2[_0x2084b3[_0xa34f('0x3b')]]={'$like':'%'+_0x1c500e['query']['filter']+'%'};return _0x2b35d2;}})});}_0x587b4d=_[_0xa34f('0x3c')]({},_0x587b4d,_0x1c500e[_0xa34f('0x3d')]);var _0x2cfb94={'where':_0x587b4d['where']};_0x2cfb94[_0xa34f('0x3e')]=[];if(_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x3f')]){_0x2cfb94['include']['push']({'model':db[_0xa34f('0x40')],'as':_0xa34f('0x41'),'attributes':['id'],'where':{'id':_0x1c500e['query'][_0xa34f('0x3f')]},'required':!![]});_0x2cfb94[_0xa34f('0x42')]=!![];}if(_0x1c500e[_0xa34f('0x2d')]['read']){_0x2cfb94['include'][_0xa34f('0x43')]({'model':db[_0xa34f('0x44')],'as':_0xa34f('0x45'),'attributes':['id',_0xa34f('0x46'),_0xa34f('0x47'),_0xa34f('0x48')],'where':{'direction':'in','read':_0x1c500e[_0xa34f('0x2d')]['read']||![]},'required':!![]});_0x2cfb94[_0xa34f('0x42')]=!![];}return db[_0xa34f('0x28')]['count'](_0x2cfb94)['then'](function(_0x3ec580){_0x2431aa['count']=_0x3ec580;if(_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x49')]){_0x587b4d[_0xa34f('0x3e')]=[{'model':db[_0xa34f('0x4a')],'as':'Users','required':![],'attributes':['id',_0xa34f('0x26'),'fullname']},{'model':db['CmContact'],'as':_0xa34f('0x4b'),'required':![]},{'model':db[_0xa34f('0x4a')],'as':_0xa34f('0x4c'),'attributes':[_0xa34f('0x26'),_0xa34f('0x4d'),_0xa34f('0x4e')],'required':![]},{'model':db[_0xa34f('0x4f')],'as':_0xa34f('0x50'),'attributes':['name','key'],'required':![]},{'model':db[_0xa34f('0x44')],'as':_0xa34f('0x45'),'attributes':['id','direction','createdAt','read'],'where':{'direction':'in','read':_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x48')]||![]},'required':_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x48')]||![]},{'model':db['Tag'],'as':_0xa34f('0x41'),'attributes':['id',_0xa34f('0x26'),_0xa34f('0x51')],'required':_0x1c500e['query'][_0xa34f('0x3f')]?!![]:![]},{'model':db[_0xa34f('0x40')],'as':'ThroughTags','attributes':['id',_0xa34f('0x26'),_0xa34f('0x51')],'through':_0x1c500e['query'][_0xa34f('0x3f')]?{'attributes':[],'where':{'TagId':_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x3f')]||undefined}}:{},'required':_0x1c500e[_0xa34f('0x2d')][_0xa34f('0x3f')]?!![]:![]}];}return db[_0xa34f('0x28')]['findAll'](_0x587b4d);})[_0xa34f('0x22')](function(_0x5c2ea3){_0x2431aa['rows']=_0x5c2ea3;return _0x2431aa;})[_0xa34f('0x22')](respondWithFilteredResult(_0x1da994,_0x587b4d))[_0xa34f('0x52')](handleError(_0x1da994,null));};exports[_0xa34f('0x53')]=function(_0x29c61e,_0x4840fa){var _0xbae962={'raw':![],'where':{'id':_0x29c61e[_0xa34f('0x54')]['id']}},_0x488f19={};_0x488f19[_0xa34f('0x2a')]=_[_0xa34f('0x55')](db[_0xa34f('0x28')][_0xa34f('0x29')]);_0x488f19[_0xa34f('0x2d')]=_['keys'](_0x29c61e[_0xa34f('0x2d')]);_0x488f19['filters']=_['intersection'](_0x488f19[_0xa34f('0x2a')],_0x488f19['query']);_0xbae962[_0xa34f('0x2e')]=_[_0xa34f('0x2c')](_0x488f19['model'],qs['fields'](_0x29c61e[_0xa34f('0x2d')][_0xa34f('0x2f')]));_0xbae962[_0xa34f('0x2e')]=_0xbae962[_0xa34f('0x2e')][_0xa34f('0x30')]?_0xbae962[_0xa34f('0x2e')]:_0x488f19[_0xa34f('0x2a')];if(_0x29c61e['query'][_0xa34f('0x49')]){_0xbae962[_0xa34f('0x3e')]=[{'all':!![]}];}_0xbae962=_['merge']({},_0xbae962,_0x29c61e[_0xa34f('0x3d')]);return db[_0xa34f('0x28')]['find'](_0xbae962)[_0xa34f('0x22')](handleEntityNotFound(_0x4840fa,null))['then'](respondWithResult(_0x4840fa,null))[_0xa34f('0x52')](handleError(_0x4840fa,null));};exports[_0xa34f('0x56')]=function(_0xe2c625,_0x1b0cd7){return db[_0xa34f('0x28')][_0xa34f('0x56')](_0xe2c625['body'],{})[_0xa34f('0x22')](respondWithResult(_0x1b0cd7,0xc9))['catch'](handleError(_0x1b0cd7,null));};exports['update']=function(_0x3dc4fa,_0x2e678b){if(_0x3dc4fa[_0xa34f('0x57')]['id']){delete _0x3dc4fa[_0xa34f('0x57')]['id'];}return db[_0xa34f('0x28')][_0xa34f('0x58')]({'where':{'id':_0x3dc4fa[_0xa34f('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e678b,null))[_0xa34f('0x22')](saveUpdates(_0x3dc4fa[_0xa34f('0x57')],null))[_0xa34f('0x22')](respondWithResult(_0x2e678b,null))[_0xa34f('0x52')](handleError(_0x2e678b,null));};exports[_0xa34f('0x23')]=function(_0x1fb277,_0x36cba4){return db[_0xa34f('0x28')]['find']({'where':{'id':_0x1fb277['params']['id']}})['then'](handleEntityNotFound(_0x36cba4,null))['then'](removeEntity(_0x36cba4,null))['catch'](handleError(_0x36cba4,null));};exports['describe']=function(_0x1b84a1,_0x3082d7){return db[_0xa34f('0x28')][_0xa34f('0x59')]()[_0xa34f('0x22')](respondWithResult(_0x3082d7,null))[_0xa34f('0x52')](handleError(_0x3082d7,null));};exports[_0xa34f('0x5a')]=function(_0x37ca3b,_0xcd33e7,_0x23567f){return db['FaxMessage'][_0xa34f('0x58')]({'where':{'id':_0x37ca3b[_0xa34f('0x54')]['id']}})[_0xa34f('0x22')](handleEntityNotFound(_0xcd33e7,null))[_0xa34f('0x22')](function(_0x3d428b){if(_0x3d428b){return _0x3d428b[_0xa34f('0x5a')](_0x37ca3b['body'][_0xa34f('0x5b')],_[_0xa34f('0x5c')](_0x37ca3b['body'],['ids','id'])||{});}})[_0xa34f('0x22')](respondWithResult(_0xcd33e7,null))['catch'](handleError(_0xcd33e7,null));};exports[_0xa34f('0x5d')]=function(_0x41a8a8,_0x21278a,_0x3d1f0a){var _0x27be70={'raw':![],'where':{}};var _0x232425={};var _0x34f8e9={'count':0x0,'rows':[]};return db[_0xa34f('0x28')][_0xa34f('0x5e')]({'where':{'id':_0x41a8a8[_0xa34f('0x54')]['id']}})['then'](handleEntityNotFound(_0x21278a,null))[_0xa34f('0x22')](function(_0x518b2d){if(_0x518b2d){_0x232425[_0xa34f('0x2a')]=_['keys'](db['FaxMessage'][_0xa34f('0x29')]);_0x232425['query']=_[_0xa34f('0x55')](_0x41a8a8['query']);_0x232425[_0xa34f('0x2b')]=_[_0xa34f('0x2c')](_0x232425[_0xa34f('0x2a')],_0x232425[_0xa34f('0x2d')]);_0x27be70['attributes']=_[_0xa34f('0x2c')](_0x232425[_0xa34f('0x2a')],qs[_0xa34f('0x2f')](_0x41a8a8[_0xa34f('0x2d')]['fields']));_0x27be70[_0xa34f('0x2e')]=_0x27be70['attributes'][_0xa34f('0x30')]?_0x27be70['attributes']:_0x232425['model'];if(!_0x41a8a8[_0xa34f('0x2d')]['hasOwnProperty']('nolimit')){_0x27be70[_0xa34f('0x33')]=qs[_0xa34f('0x33')](_0x41a8a8[_0xa34f('0x2d')][_0xa34f('0x33')]);_0x27be70[_0xa34f('0x1e')]=qs['offset'](_0x41a8a8[_0xa34f('0x2d')][_0xa34f('0x1e')]);}_0x27be70[_0xa34f('0x34')]=qs[_0xa34f('0x35')](_0x41a8a8[_0xa34f('0x2d')]['sort']);_0x27be70[_0xa34f('0x36')]=qs[_0xa34f('0x2b')](_['pick'](_0x41a8a8[_0xa34f('0x2d')],_0x232425[_0xa34f('0x2b')]));_0x27be70[_0xa34f('0x36')][_0xa34f('0x5f')]=_0x518b2d['id'];if(_0x41a8a8[_0xa34f('0x2d')][_0xa34f('0x38')]){_0x27be70['where']=_[_0xa34f('0x3c')](_0x27be70[_0xa34f('0x36')],{'$or':_[_0xa34f('0x60')](_0x27be70[_0xa34f('0x2e')],function(_0x54d037){var _0x213d93={};_0x213d93[_0x54d037]={'$like':'%'+_0x41a8a8[_0xa34f('0x2d')]['filter']+'%'};return _0x213d93;})});}if(_0x41a8a8['query'][_0xa34f('0x61')]){var _0x5ce655=_0x41a8a8[_0xa34f('0x2d')][_0xa34f('0x61')][_0xa34f('0x62')](',');var _0x2f9521={};_0x2f9521[_0x5ce655[0x0]]={'$gte':moment(_0x5ce655[0x1])[_0xa34f('0x63')](_0xa34f('0x64'))};_0x27be70[_0xa34f('0x36')]=_['merge'](_0x27be70['where'],_0x2f9521);}_0x27be70=_[_0xa34f('0x3c')]({},_0x27be70,_0x41a8a8[_0xa34f('0x3d')]);return db[_0xa34f('0x44')][_0xa34f('0x1d')]({'where':_0x27be70[_0xa34f('0x36')]})[_0xa34f('0x22')](function(_0x5c5d64){_0x34f8e9['count']=_0x5c5d64;if(_0x41a8a8[_0xa34f('0x2d')]['includeAll']){_0x27be70['include']=[{'all':!![]}];}return db['FaxMessage'][_0xa34f('0x65')](_0x27be70);})[_0xa34f('0x22')](function(_0x3ddc2e){_0x34f8e9[_0xa34f('0x66')]=_0x3ddc2e;return _0x34f8e9;});}})[_0xa34f('0x22')](respondWithFilteredResult(_0x21278a,_0x27be70))[_0xa34f('0x52')](handleError(_0x21278a,null));};exports[_0xa34f('0x67')]=function(_0x319002,_0x441858,_0xc6638){return db[_0xa34f('0x28')]['find']({'where':{'id':_0x319002[_0xa34f('0x54')]['id']}})[_0xa34f('0x22')](handleEntityNotFound(_0x441858,null))[_0xa34f('0x22')](function(_0x55a3ca){if(_0x55a3ca){return _0x55a3ca['setTags'](_0x319002['body'][_0xa34f('0x5b')],_['omit'](_0x319002[_0xa34f('0x57')],[_0xa34f('0x5b'),'id'])||{})[_0xa34f('0x68')](function(){return db[_0xa34f('0x40')][_0xa34f('0x65')]({'attributes':['id',_0xa34f('0x26'),_0xa34f('0x51')],'where':{'id':_0x319002[_0xa34f('0x57')][_0xa34f('0x5b')]}});})[_0xa34f('0x22')](function(_0x3622e){socket[_0xa34f('0x69')]('faxInteractionTags:save',{'id':Number(_0x319002[_0xa34f('0x54')]['id']),'tags':_0x3622e||[]});return{'id':Number(_0x319002[_0xa34f('0x54')]['id']),'tags':_0x3622e||[]};});}})[_0xa34f('0x22')](respondWithResult(_0x441858,null))[_0xa34f('0x52')](handleError(_0x441858,null));};exports['removeTags']=function(_0x493297,_0x5a7dfb,_0x2df17b){var _0x3c98fe;return db['FaxInteraction'][_0xa34f('0x58')]({'where':{'id':_0x493297[_0xa34f('0x54')]['id']}})[_0xa34f('0x22')](handleEntityNotFound(_0x5a7dfb,null))[_0xa34f('0x22')](function(_0x57dc49){if(_0x57dc49){return _0x57dc49['removeTags'](_0x493297[_0xa34f('0x2d')]['ids']);}})[_0xa34f('0x22')](respondWithStatusCode(_0x5a7dfb,null))[_0xa34f('0x52')](handleError(_0x5a7dfb,null));};exports[_0xa34f('0x6a')]=function(_0x49d254,_0x4bbd01){var _0x21b81f=moment()[_0xa34f('0x6b')]()[_0xa34f('0x6c')]();var _0x4f4467=path[_0xa34f('0x6d')](config[_0xa34f('0x6e')],_0xa34f('0x6f'),_0xa34f('0x70'),_0xa34f('0x71'));var _0x38939f=path[_0xa34f('0x6d')](config['root'],_0xa34f('0x6f'),_0xa34f('0x70'),'tmp');var _0x141f9c=path[_0xa34f('0x6d')](_0x38939f,_0x21b81f);var _0x37309d=util['format']('interaction-%s.zip',_0x21b81f);var _0x2b638e=path[_0xa34f('0x6d')](_0x38939f,_0x37309d);var _0x3cba7d=![];return db['FaxInteraction'][_0xa34f('0x58')]({'where':{'id':_0x49d254[_0xa34f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4bbd01,null))[_0xa34f('0x22')](function(_0x348311){if(_0x348311){return _0x348311[_0xa34f('0x5d')]({'attributes':['id',_0xa34f('0x57'),_0xa34f('0x47')],'include':[{'model':db[_0xa34f('0x72')],'as':'Attachment'}]});}return[];})[_0xa34f('0x22')](function(_0x23788a){_0x3cba7d=_0x23788a[_0xa34f('0x30')];if(_0x23788a[_0xa34f('0x30')]){fs[_0xa34f('0x73')](_0x141f9c);for(var _0x5d86be=0x0;_0x5d86be<_0x23788a['length'];_0x5d86be++){var _0x18ffe5=_0x23788a[_0x5d86be];var _0x2d4c69=_0x18ffe5[_0xa34f('0x72')];if(_0x2d4c69){var _0x10a547=path[_0xa34f('0x6d')](_0x4f4467,_0x2d4c69[_0xa34f('0x74')]);if(fs['existsSync'](_0x10a547)){fs[_0xa34f('0x75')](_0x10a547)[_0xa34f('0x76')](fs[_0xa34f('0x77')](path[_0xa34f('0x6d')](_0x141f9c,_0x2d4c69[_0xa34f('0x74')])));}}}}})[_0xa34f('0x22')](function(){if(_0x3cba7d){return new BPromise(function(_0x4f8f99,_0x164121){zipdir(_0x141f9c,{'saveTo':_0x2b638e},function(_0xf13774,_0x45119e){if(_0xf13774)return _0x164121(_0xf13774);return _0x4f8f99(_0x45119e);});});}})['then'](function(){if(_0x3cba7d){return new BPromise(function(_0x46ec28,_0x840227){rimraf(_0x141f9c,function(_0x52a72a){if(_0x52a72a)_0x840227(_0x52a72a);return _0x46ec28();});});}})[_0xa34f('0x22')](function(){if(_0x3cba7d){return _0x4bbd01['download'](_0x2b638e,_0x37309d,function(_0x1227e6){if(_0x1227e6){console[_0xa34f('0x78')](_0xa34f('0x79'),_0x1227e6);}else{fs[_0xa34f('0x7a')](_0x2b638e);}});}else{return _0x4bbd01[_0xa34f('0x19')](0xc8);}})[_0xa34f('0x52')](handleError(_0x4bbd01,null));}; \ No newline at end of file +var _0xc042=['Messages','direction','createdAt','FaxInteraction','count','includeAll','include','User','Users','fullname','CmContact','Contact','internal','Account','ThroughTags','color','catch','show','params','options','create','body','find','describe','addMessage','ids','omit','rawAttributes','FaxInteractionId','$gte','findAll','addTags','setTags','spread','faxInteractionTags:save','unix','server','attachments','files','tmp','format','getMessages','Attachment','mkdirSync','join','existsSync','createReadStream','pipe','basename','download','log','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','tag','push','Tag','Tags','distinct','read','FaxMessage'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0xc042,0x121));var _0x2c04=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xc042[_0x2f45ea];return _0x485a84;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2c04('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c04('0x1'));var rp=require(_0x2c04('0x2'));var moment=require(_0x2c04('0x3'));var BPromise=require(_0x2c04('0x4'));var Mustache=require(_0x2c04('0x5'));var util=require(_0x2c04('0x6'));var path=require(_0x2c04('0x7'));var sox=require(_0x2c04('0x8'));var csv=require(_0x2c04('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2c04('0xa'));var squel=require(_0x2c04('0xb'));var crypto=require(_0x2c04('0xc'));var jsforce=require(_0x2c04('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2c04('0x9'));var querystring=require(_0x2c04('0xe'));var Papa=require('papaparse');var authService=require(_0x2c04('0xf'));var hardwareService=require(_0x2c04('0x10'));var Redis=require(_0x2c04('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x2c04('0x12'))(_0x2c04('0x13'));var utils=require('../../config/utils');var config=require(_0x2c04('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2c04('0x15')](config[_0x2c04('0x16')],{'host':_0x2c04('0x17'),'port':0x18eb});var socket=require(_0x2c04('0x18'))(new Redis(config[_0x2c04('0x16')]));require('./faxInteraction.socket')[_0x2c04('0x19')](socket);function respondWithStatusCode(_0x1d2312,_0xefeb80){_0xefeb80=_0xefeb80||0xcc;return function(_0x191e4c){if(_0x191e4c){return _0x1d2312['sendStatus'](_0xefeb80);}return _0x1d2312[_0x2c04('0x1a')](_0xefeb80)['end']();};}function respondWithResult(_0x552c2a,_0x23a2dc){_0x23a2dc=_0x23a2dc||0xc8;return function(_0x49cfd8){if(_0x49cfd8){return _0x552c2a[_0x2c04('0x1a')](_0x23a2dc)[_0x2c04('0x1b')](_0x49cfd8);}};}function respondWithFilteredResult(_0x1ceb75,_0x3596a8){return function(_0x3f7c68){if(_0x3f7c68){var _0x44d8bc=_0x3f7c68['count'],_0x661aa4=_0x3596a8[_0x2c04('0x1c')],_0x12b1c2=_0x3596a8[_0x2c04('0x1c')]+_0x3596a8[_0x2c04('0x1d')],_0x380148;if(_0x12b1c2>=_0x44d8bc){_0x12b1c2=_0x44d8bc;_0x380148=0xc8;}else{_0x380148=0xce;}_0x1ceb75[_0x2c04('0x1a')](_0x380148);return _0x1ceb75[_0x2c04('0x1e')](_0x2c04('0x1f'),_0x661aa4+'-'+_0x12b1c2+'/'+_0x44d8bc)[_0x2c04('0x1b')](_0x3f7c68);}return null;};}function patchUpdates(_0x4ce661){return function(_0x3372d2){try{jsonpatch[_0x2c04('0x20')](_0x3372d2,_0x4ce661,!![]);}catch(_0xdf7d3c){return BPromise[_0x2c04('0x21')](_0xdf7d3c);}return _0x3372d2['save']();};}function saveUpdates(_0x30ea5b,_0x53e42d){return function(_0x32415e){if(_0x32415e){return _0x32415e[_0x2c04('0x22')](_0x30ea5b)['then'](function(_0x8c0aa8){return _0x8c0aa8;});}return null;};}function removeEntity(_0x13ed16,_0x4d86ac){return function(_0x477538){if(_0x477538){return _0x477538[_0x2c04('0x23')]()[_0x2c04('0x24')](function(){_0x13ed16[_0x2c04('0x1a')](0xcc)[_0x2c04('0x25')]();});}};}function handleEntityNotFound(_0x4f2017,_0x2a77fa){return function(_0x54fe0e){if(!_0x54fe0e){_0x4f2017[_0x2c04('0x26')](0x194);}return _0x54fe0e;};}function handleError(_0x4a5754,_0x84a85f){_0x84a85f=_0x84a85f||0x1f4;return function(_0x29598e){logger[_0x2c04('0x27')](_0x29598e[_0x2c04('0x28')]);if(_0x29598e['name']){delete _0x29598e[_0x2c04('0x29')];}_0x4a5754[_0x2c04('0x1a')](_0x84a85f)[_0x2c04('0x2a')](_0x29598e);};}exports['index']=function(_0x3b43ec,_0x1aa7d3){var _0x17e63f={},_0x55504c={},_0x435747={'count':0x0,'rows':[]};var _0x50caf8=db['FaxInteraction']['rawAttributes'];_0x55504c['model']=_[_0x2c04('0x2b')](_0x50caf8);_0x55504c['query']=_[_0x2c04('0x2b')](_0x3b43ec[_0x2c04('0x2c')]);_0x55504c[_0x2c04('0x2d')]=_['intersection'](_0x55504c[_0x2c04('0x2e')],_0x55504c['query']);_0x17e63f[_0x2c04('0x2f')]=_[_0x2c04('0x30')](_0x55504c[_0x2c04('0x2e')],qs[_0x2c04('0x31')](_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x31')]));_0x17e63f[_0x2c04('0x2f')]=_0x17e63f[_0x2c04('0x2f')][_0x2c04('0x32')]?_0x17e63f[_0x2c04('0x2f')]:_0x55504c[_0x2c04('0x2e')];if(!_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x33')](_0x2c04('0x34'))){_0x17e63f['limit']=qs[_0x2c04('0x1d')](_0x3b43ec['query'][_0x2c04('0x1d')]);_0x17e63f[_0x2c04('0x1c')]=qs[_0x2c04('0x1c')](_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x1c')]);}_0x17e63f[_0x2c04('0x35')]=qs[_0x2c04('0x36')](_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x36')]);_0x17e63f[_0x2c04('0x37')]=qs[_0x2c04('0x2d')](_['pick'](_0x3b43ec[_0x2c04('0x2c')],_0x55504c[_0x2c04('0x2d')]));if(_0x3b43ec['query'][_0x2c04('0x38')]){_0x17e63f['where']=_[_0x2c04('0x39')](_0x17e63f[_0x2c04('0x37')],{'$or':_[_0x2c04('0x3a')](_0x50caf8,function(_0xbc6286){if(_0xbc6286['type'][_0x2c04('0x3b')]!==_0x2c04('0x3c')){var _0x254c91={};_0x254c91[_0xbc6286['field']]={'$like':'%'+_0x3b43ec[_0x2c04('0x2c')]['filter']+'%'};return _0x254c91;}})});}_0x17e63f=_[_0x2c04('0x39')]({},_0x17e63f,_0x3b43ec['options']);var _0x254cdf={'where':_0x17e63f['where']};_0x254cdf['include']=[];if(_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x3d')]){_0x254cdf['include'][_0x2c04('0x3e')]({'model':db[_0x2c04('0x3f')],'as':_0x2c04('0x40'),'attributes':['id'],'where':{'id':_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x3d')]},'required':!![]});_0x254cdf[_0x2c04('0x41')]=!![];}if(_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x42')]){_0x254cdf['include'][_0x2c04('0x3e')]({'model':db[_0x2c04('0x43')],'as':_0x2c04('0x44'),'attributes':['id',_0x2c04('0x45'),_0x2c04('0x46'),'read'],'where':{'direction':'in','read':_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x42')]||![]},'required':!![]});_0x254cdf[_0x2c04('0x41')]=!![];}return db[_0x2c04('0x47')][_0x2c04('0x48')](_0x254cdf)[_0x2c04('0x24')](function(_0x2755aa){_0x435747['count']=_0x2755aa;if(_0x3b43ec['query'][_0x2c04('0x49')]){_0x17e63f[_0x2c04('0x4a')]=[{'model':db[_0x2c04('0x4b')],'as':_0x2c04('0x4c'),'required':![],'attributes':['id',_0x2c04('0x29'),_0x2c04('0x4d')]},{'model':db[_0x2c04('0x4e')],'as':_0x2c04('0x4f'),'required':![]},{'model':db[_0x2c04('0x4b')],'as':'Owner','attributes':[_0x2c04('0x29'),_0x2c04('0x4d'),_0x2c04('0x50')],'required':![]},{'model':db['FaxAccount'],'as':_0x2c04('0x51'),'attributes':['name',_0x2c04('0x3b')],'required':![]},{'model':db[_0x2c04('0x43')],'as':_0x2c04('0x44'),'attributes':['id',_0x2c04('0x45'),'createdAt','read'],'where':{'direction':'in','read':_0x3b43ec[_0x2c04('0x2c')]['read']||![]},'required':_0x3b43ec[_0x2c04('0x2c')]['read']||![]},{'model':db[_0x2c04('0x3f')],'as':'Tags','attributes':['id',_0x2c04('0x29'),'color'],'required':_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x3d')]?!![]:![]},{'model':db[_0x2c04('0x3f')],'as':_0x2c04('0x52'),'attributes':['id',_0x2c04('0x29'),_0x2c04('0x53')],'through':_0x3b43ec['query'][_0x2c04('0x3d')]?{'attributes':[],'where':{'TagId':_0x3b43ec['query'][_0x2c04('0x3d')]||undefined}}:{},'required':_0x3b43ec[_0x2c04('0x2c')][_0x2c04('0x3d')]?!![]:![]}];}return db[_0x2c04('0x47')]['findAll'](_0x17e63f);})[_0x2c04('0x24')](function(_0x49e7ef){_0x435747['rows']=_0x49e7ef;return _0x435747;})['then'](respondWithFilteredResult(_0x1aa7d3,_0x17e63f))[_0x2c04('0x54')](handleError(_0x1aa7d3,null));};exports[_0x2c04('0x55')]=function(_0x5af3c1,_0x4d21a2){var _0xa3a19b={'raw':![],'where':{'id':_0x5af3c1[_0x2c04('0x56')]['id']}},_0x359b92={};_0x359b92[_0x2c04('0x2e')]=_[_0x2c04('0x2b')](db[_0x2c04('0x47')]['rawAttributes']);_0x359b92['query']=_['keys'](_0x5af3c1[_0x2c04('0x2c')]);_0x359b92[_0x2c04('0x2d')]=_[_0x2c04('0x30')](_0x359b92[_0x2c04('0x2e')],_0x359b92['query']);_0xa3a19b['attributes']=_[_0x2c04('0x30')](_0x359b92[_0x2c04('0x2e')],qs['fields'](_0x5af3c1['query'][_0x2c04('0x31')]));_0xa3a19b[_0x2c04('0x2f')]=_0xa3a19b['attributes'][_0x2c04('0x32')]?_0xa3a19b['attributes']:_0x359b92[_0x2c04('0x2e')];if(_0x5af3c1[_0x2c04('0x2c')][_0x2c04('0x49')]){_0xa3a19b['include']=[{'all':!![]}];}_0xa3a19b=_[_0x2c04('0x39')]({},_0xa3a19b,_0x5af3c1[_0x2c04('0x57')]);return db[_0x2c04('0x47')]['find'](_0xa3a19b)['then'](handleEntityNotFound(_0x4d21a2,null))['then'](respondWithResult(_0x4d21a2,null))[_0x2c04('0x54')](handleError(_0x4d21a2,null));};exports['create']=function(_0x3fcaef,_0x1708f0){return db[_0x2c04('0x47')][_0x2c04('0x58')](_0x3fcaef[_0x2c04('0x59')],{})[_0x2c04('0x24')](respondWithResult(_0x1708f0,0xc9))['catch'](handleError(_0x1708f0,null));};exports[_0x2c04('0x22')]=function(_0x772696,_0x110729){if(_0x772696[_0x2c04('0x59')]['id']){delete _0x772696[_0x2c04('0x59')]['id'];}return db[_0x2c04('0x47')][_0x2c04('0x5a')]({'where':{'id':_0x772696[_0x2c04('0x56')]['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0x110729,null))[_0x2c04('0x24')](saveUpdates(_0x772696['body'],null))[_0x2c04('0x24')](respondWithResult(_0x110729,null))[_0x2c04('0x54')](handleError(_0x110729,null));};exports[_0x2c04('0x23')]=function(_0x3d63c9,_0x55d821){return db[_0x2c04('0x47')]['find']({'where':{'id':_0x3d63c9[_0x2c04('0x56')]['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0x55d821,null))['then'](removeEntity(_0x55d821,null))['catch'](handleError(_0x55d821,null));};exports[_0x2c04('0x5b')]=function(_0x5b1278,_0x592dcf){return db[_0x2c04('0x47')][_0x2c04('0x5b')]()[_0x2c04('0x24')](respondWithResult(_0x592dcf,null))[_0x2c04('0x54')](handleError(_0x592dcf,null));};exports[_0x2c04('0x5c')]=function(_0x4b552e,_0x4b66fc,_0x440c0b){return db[_0x2c04('0x43')]['find']({'where':{'id':_0x4b552e['params']['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0x4b66fc,null))[_0x2c04('0x24')](function(_0x52d33b){if(_0x52d33b){return _0x52d33b[_0x2c04('0x5c')](_0x4b552e['body'][_0x2c04('0x5d')],_[_0x2c04('0x5e')](_0x4b552e[_0x2c04('0x59')],['ids','id'])||{});}})[_0x2c04('0x24')](respondWithResult(_0x4b66fc,null))[_0x2c04('0x54')](handleError(_0x4b66fc,null));};exports['getMessages']=function(_0x240662,_0x2205bf,_0xc50d6f){var _0x17f075={'raw':![],'where':{}};var _0x164cf9={};var _0x37b6c6={'count':0x0,'rows':[]};return db[_0x2c04('0x47')]['findOne']({'where':{'id':_0x240662[_0x2c04('0x56')]['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0x2205bf,null))[_0x2c04('0x24')](function(_0x2095ba){if(_0x2095ba){_0x164cf9[_0x2c04('0x2e')]=_['keys'](db[_0x2c04('0x43')][_0x2c04('0x5f')]);_0x164cf9[_0x2c04('0x2c')]=_[_0x2c04('0x2b')](_0x240662['query']);_0x164cf9[_0x2c04('0x2d')]=_[_0x2c04('0x30')](_0x164cf9[_0x2c04('0x2e')],_0x164cf9[_0x2c04('0x2c')]);_0x17f075[_0x2c04('0x2f')]=_[_0x2c04('0x30')](_0x164cf9['model'],qs['fields'](_0x240662[_0x2c04('0x2c')]['fields']));_0x17f075['attributes']=_0x17f075['attributes'][_0x2c04('0x32')]?_0x17f075['attributes']:_0x164cf9[_0x2c04('0x2e')];if(!_0x240662[_0x2c04('0x2c')][_0x2c04('0x33')]('nolimit')){_0x17f075[_0x2c04('0x1d')]=qs[_0x2c04('0x1d')](_0x240662[_0x2c04('0x2c')][_0x2c04('0x1d')]);_0x17f075['offset']=qs[_0x2c04('0x1c')](_0x240662[_0x2c04('0x2c')][_0x2c04('0x1c')]);}_0x17f075[_0x2c04('0x35')]=qs['sort'](_0x240662[_0x2c04('0x2c')][_0x2c04('0x36')]);_0x17f075[_0x2c04('0x37')]=qs['filters'](_['pick'](_0x240662['query'],_0x164cf9[_0x2c04('0x2d')]));_0x17f075[_0x2c04('0x37')][_0x2c04('0x60')]=_0x2095ba['id'];if(_0x240662[_0x2c04('0x2c')]['filter']){_0x17f075['where']=_[_0x2c04('0x39')](_0x17f075[_0x2c04('0x37')],{'$or':_[_0x2c04('0x3a')](_0x17f075[_0x2c04('0x2f')],function(_0x2d8bfd){var _0x5ae75f={};_0x5ae75f[_0x2d8bfd]={'$like':'%'+_0x240662[_0x2c04('0x2c')][_0x2c04('0x38')]+'%'};return _0x5ae75f;})});}if(_0x240662[_0x2c04('0x2c')]['$gte']){var _0x5acb40=_0x240662[_0x2c04('0x2c')][_0x2c04('0x61')]['split'](',');var _0x3d67b1={};_0x3d67b1[_0x5acb40[0x0]]={'$gte':moment(_0x5acb40[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x17f075[_0x2c04('0x37')]=_[_0x2c04('0x39')](_0x17f075[_0x2c04('0x37')],_0x3d67b1);}_0x17f075=_[_0x2c04('0x39')]({},_0x17f075,_0x240662[_0x2c04('0x57')]);return db['FaxMessage'][_0x2c04('0x48')]({'where':_0x17f075[_0x2c04('0x37')]})['then'](function(_0x19bf70){_0x37b6c6[_0x2c04('0x48')]=_0x19bf70;if(_0x240662[_0x2c04('0x2c')][_0x2c04('0x49')]){_0x17f075[_0x2c04('0x4a')]=[{'all':!![]}];}return db[_0x2c04('0x43')][_0x2c04('0x62')](_0x17f075);})[_0x2c04('0x24')](function(_0xd8c07b){_0x37b6c6['rows']=_0xd8c07b;return _0x37b6c6;});}})[_0x2c04('0x24')](respondWithFilteredResult(_0x2205bf,_0x17f075))[_0x2c04('0x54')](handleError(_0x2205bf,null));};exports[_0x2c04('0x63')]=function(_0x5335aa,_0x3cc213,_0x441b3d){return db[_0x2c04('0x47')][_0x2c04('0x5a')]({'where':{'id':_0x5335aa['params']['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0x3cc213,null))[_0x2c04('0x24')](function(_0x36cc1e){if(_0x36cc1e){return _0x36cc1e[_0x2c04('0x64')](_0x5335aa['body']['ids'],_[_0x2c04('0x5e')](_0x5335aa[_0x2c04('0x59')],[_0x2c04('0x5d'),'id'])||{})[_0x2c04('0x65')](function(){return db[_0x2c04('0x3f')]['findAll']({'attributes':['id',_0x2c04('0x29'),_0x2c04('0x53')],'where':{'id':_0x5335aa[_0x2c04('0x59')]['ids']}});})['then'](function(_0x4d1615){socket['emit'](_0x2c04('0x66'),{'id':Number(_0x5335aa[_0x2c04('0x56')]['id']),'tags':_0x4d1615||[]});return{'id':Number(_0x5335aa[_0x2c04('0x56')]['id']),'tags':_0x4d1615||[]};});}})[_0x2c04('0x24')](respondWithResult(_0x3cc213,null))['catch'](handleError(_0x3cc213,null));};exports['removeTags']=function(_0x5723f7,_0x388887,_0x27acae){var _0x44fb16;return db[_0x2c04('0x47')][_0x2c04('0x5a')]({'where':{'id':_0x5723f7['params']['id']}})['then'](handleEntityNotFound(_0x388887,null))[_0x2c04('0x24')](function(_0x2074f7){if(_0x2074f7){return _0x2074f7['removeTags'](_0x5723f7[_0x2c04('0x2c')][_0x2c04('0x5d')]);}})[_0x2c04('0x24')](respondWithStatusCode(_0x388887,null))[_0x2c04('0x54')](handleError(_0x388887,null));};exports['download']=function(_0x24b8da,_0xb11175){var _0x3e4b03=moment()[_0x2c04('0x67')]()['toString']();var _0x660f06=path['join'](config['root'],_0x2c04('0x68'),'files',_0x2c04('0x69'));var _0x400dbe=path['join'](config['root'],'server',_0x2c04('0x6a'),_0x2c04('0x6b'));var _0x2a1959=path['join'](_0x400dbe,_0x3e4b03);var _0x248705=util[_0x2c04('0x6c')]('interaction-%s.zip',_0x3e4b03);var _0x285765=path['join'](_0x400dbe,_0x248705);var _0x9660d6=![];return db['FaxInteraction'][_0x2c04('0x5a')]({'where':{'id':_0x24b8da[_0x2c04('0x56')]['id']}})[_0x2c04('0x24')](handleEntityNotFound(_0xb11175,null))[_0x2c04('0x24')](function(_0x25beb5){if(_0x25beb5){return _0x25beb5[_0x2c04('0x6d')]({'attributes':['id',_0x2c04('0x59'),'createdAt'],'include':[{'model':db['Attachment'],'as':_0x2c04('0x6e')}]});}return[];})['then'](function(_0x4eb4df){_0x9660d6=_0x4eb4df[_0x2c04('0x32')];if(_0x4eb4df['length']){fs[_0x2c04('0x6f')](_0x2a1959);for(var _0xa964b8=0x0;_0xa964b8<_0x4eb4df[_0x2c04('0x32')];_0xa964b8++){var _0x2aa50c=_0x4eb4df[_0xa964b8];var _0x16bffa=_0x2aa50c[_0x2c04('0x6e')];if(_0x16bffa){var _0x49686c=path[_0x2c04('0x70')](_0x660f06,_0x16bffa['basename']);if(fs[_0x2c04('0x71')](_0x49686c)){fs[_0x2c04('0x72')](_0x49686c)[_0x2c04('0x73')](fs['createWriteStream'](path[_0x2c04('0x70')](_0x2a1959,_0x16bffa[_0x2c04('0x74')])));}}}}})[_0x2c04('0x24')](function(){if(_0x9660d6){return new BPromise(function(_0x15d506,_0x3b6f55){zipdir(_0x2a1959,{'saveTo':_0x285765},function(_0x4e2505,_0x29f828){if(_0x4e2505)return _0x3b6f55(_0x4e2505);return _0x15d506(_0x29f828);});});}})[_0x2c04('0x24')](function(){if(_0x9660d6){return new BPromise(function(_0x1b3afe,_0x589b50){rimraf(_0x2a1959,function(_0x5bbeac){if(_0x5bbeac)_0x589b50(_0x5bbeac);return _0x1b3afe();});});}})[_0x2c04('0x24')](function(){if(_0x9660d6){return _0xb11175[_0x2c04('0x75')](_0x285765,_0x248705,function(_0x3b051b){if(_0x3b051b){console[_0x2c04('0x76')]('err',_0x3b051b);}else{fs['unlinkSync'](_0x285765);}});}else{return _0xb11175['sendStatus'](0xc8);}})[_0x2c04('0x54')](handleError(_0xb11175,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e702279..fe9adde 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 _0xee4f=['setMaxListeners','save','update','emit','exports','events'];(function(_0x212de5,_0xfe94a){var _0x3b655f=function(_0x4e3d85){while(--_0x4e3d85){_0x212de5['push'](_0x212de5['shift']());}};_0x3b655f(++_0xfe94a);}(_0xee4f,0xad));var _0xfee4=function(_0x463af2,_0x24adc6){_0x463af2=_0x463af2-0x0;var _0x335835=_0xee4f[_0x463af2];return _0x335835;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xfee4('0x1')](0x0);var events={'afterCreate':_0xfee4('0x2'),'afterUpdate':_0xfee4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37c05f){return function(_0x5b9149,_0x27874a,_0x505b55){FaxInteractionEvents['emit'](_0x37c05f+':'+_0x5b9149['id'],_0x5b9149);FaxInteractionEvents[_0xfee4('0x4')](_0x37c05f,_0x5b9149);_0x505b55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xfee4('0x5')]=FaxInteractionEvents; \ No newline at end of file +var _0xda3f=['exports','../../mysqldb','FaxInteraction','remove','emit'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xda3f,0xec));var _0xfda3=function(_0x2403c6,_0x1afff1){_0x2403c6=_0x2403c6-0x0;var _0x2e253a=_0xda3f[_0x2403c6];return _0x2e253a;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){FaxInteractionEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);FaxInteractionEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c5401eb..90bd2c8 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 _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0x29fe34,_0xcd5d36){var _0x4567fd=function(_0x544bf3){while(--_0x544bf3){_0x29fe34['push'](_0x29fe34['shift']());}};_0x4567fd(++_0xcd5d36);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file +var _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0x281734,_0x5557e3){var _0x3cf5f9=function(_0x289552){while(--_0x289552){_0x281734['push'](_0x281734['shift']());}};_0x3cf5f9(++_0x5557e3);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5d16565..06b9ae7 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 _0x0c61=['UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./faxInteraction.socket','then','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','FaxInteraction','update','options','where','attributes','limit'];(function(_0x5441d5,_0x463c85){var _0x5736a7=function(_0x53b2df){while(--_0x53b2df){_0x5441d5['push'](_0x5441d5['shift']());}};_0x5736a7(++_0x463c85);}(_0x0c61,0xd6));var _0x10c6=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x0c61[_0x513545];return _0x18b7c5;};'use strict';var _=require('lodash');var util=require(_0x10c6('0x0'));var moment=require(_0x10c6('0x1'));var BPromise=require(_0x10c6('0x2'));var rs=require(_0x10c6('0x3'));var fs=require('fs');var Redis=require(_0x10c6('0x4'));var db=require(_0x10c6('0x5'))['db'];var utils=require(_0x10c6('0x6'));var logger=require(_0x10c6('0x7'))('rpc');var config=require(_0x10c6('0x8'));var jayson=require(_0x10c6('0x9'));var client=jayson[_0x10c6('0xa')][_0x10c6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x10c6('0xc'),'port':0x18eb});var socket=require(_0x10c6('0xd'))(new Redis(config['redis']));require(_0x10c6('0xe'))['register'](socket);function respondWithRpcPromise(_0x1acb2a,_0x386ff3,_0x53a50a){return new BPromise(function(_0x25bbf6,_0x8971b6){return client['request'](_0x1acb2a,_0x53a50a)[_0x10c6('0xf')](function(_0x1161a8){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x386ff3,'request\x20sent');logger[_0x10c6('0x10')](_0x10c6('0x11'),_0x386ff3,_0x10c6('0x12'),JSON['stringify'](_0x1161a8));if(_0x1161a8[_0x10c6('0x13')]){if(_0x1161a8['error'][_0x10c6('0x14')]===0x1f4){logger['error'](_0x10c6('0x15'),_0x386ff3,_0x1161a8['error'][_0x10c6('0x16')]);return _0x8971b6(_0x1161a8['error'][_0x10c6('0x16')]);}logger[_0x10c6('0x13')](_0x10c6('0x15'),_0x386ff3,_0x1161a8[_0x10c6('0x13')]['message']);return _0x25bbf6(_0x1161a8[_0x10c6('0x13')][_0x10c6('0x16')]);}else{logger[_0x10c6('0x17')](_0x10c6('0x15'),_0x386ff3,_0x10c6('0x12'));_0x25bbf6(_0x1161a8[_0x10c6('0x18')]['message']);}})[_0x10c6('0x19')](function(_0x14100c){logger[_0x10c6('0x13')](_0x10c6('0x15'),_0x386ff3,_0x14100c);_0x8971b6(_0x14100c);});});}exports['UpdateFaxInteraction']=function(_0x242966){var _0x1fdce0=this;return new Promise(function(_0x4160ac,_0x47ae86){return db[_0x10c6('0x1a')][_0x10c6('0x1b')](_0x242966['body'],{'raw':_0x242966[_0x10c6('0x1c')]?_0x242966['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x242966[_0x10c6('0x1c')]?_0x242966[_0x10c6('0x1c')][_0x10c6('0x1d')]||null:null,'attributes':_0x242966[_0x10c6('0x1c')]?_0x242966[_0x10c6('0x1c')][_0x10c6('0x1e')]||null:null,'limit':_0x242966['options']?_0x242966[_0x10c6('0x1c')][_0x10c6('0x1f')]||null:null})[_0x10c6('0xf')](function(_0x478fb7){logger[_0x10c6('0x17')](_0x10c6('0x20'),_0x242966);logger['debug'](_0x10c6('0x20'),_0x242966,JSON[_0x10c6('0x21')](_0x478fb7));_0x4160ac(_0x478fb7);})[_0x10c6('0x19')](function(_0x3d15ea){logger[_0x10c6('0x13')](_0x10c6('0x20'),_0x3d15ea[_0x10c6('0x16')],_0x242966);_0x47ae86(_0x1fdce0[_0x10c6('0x13')](0x1f4,_0x3d15ea[_0x10c6('0x16')]));});});};exports[_0x10c6('0x22')]=function(_0x31ca09){return new Promise(function(_0x5e1233,_0x3060b4){return db['FaxInteraction'][_0x10c6('0x23')]({'where':_0x31ca09[_0x10c6('0x1c')]?_0x31ca09['options']['where']||null:null})[_0x10c6('0xf')](function(_0xe79abd){if(_0xe79abd){return _0xe79abd[_0x10c6('0x24')](_0x31ca09[_0x10c6('0x25')][_0x10c6('0x26')],_['omit'](_0x31ca09['body'],[_0x10c6('0x26'),'id'])||{});}})[_0x10c6('0x27')](function(_0xe5a444){logger[_0x10c6('0x17')](_0x10c6('0x28'),_0x31ca09);logger[_0x10c6('0x10')]('AddTags',_0x31ca09,JSON[_0x10c6('0x21')](_0xe5a444));_0x5e1233(_0xe5a444);})['catch'](function(_0x5b02aa){logger[_0x10c6('0x13')]('AddTags',_0x5b02aa[_0x10c6('0x16')],_0x31ca09);_0x3060b4(_this[_0x10c6('0x13')](0x1f4,_0x5b02aa[_0x10c6('0x16')]));});});}; \ No newline at end of file +var _0xb65a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','register','request','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FaxInteraction,\x20%s,\x20%s','info','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','then','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb65a,0x1e9));var _0xab65=function(_0x4418b9,_0x5c9e07){_0x4418b9=_0x4418b9-0x0;var _0x363ee4=_0xb65a[_0x4418b9];return _0x363ee4;};'use strict';var _=require(_0xab65('0x0'));var util=require(_0xab65('0x1'));var moment=require(_0xab65('0x2'));var BPromise=require(_0xab65('0x3'));var rs=require(_0xab65('0x4'));var fs=require('fs');var Redis=require(_0xab65('0x5'));var db=require(_0xab65('0x6'))['db'];var utils=require(_0xab65('0x7'));var logger=require(_0xab65('0x8'))(_0xab65('0x9'));var config=require(_0xab65('0xa'));var jayson=require(_0xab65('0xb'));var client=jayson['client'][_0xab65('0xc')]({'port':0x232a});config[_0xab65('0xd')]=_[_0xab65('0xe')](config['redis'],{'host':_0xab65('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xab65('0x10'))[_0xab65('0x11')](socket);function respondWithRpcPromise(_0x38505e,_0x503869,_0x239a4f){return new BPromise(function(_0x36210f,_0x181af6){return client[_0xab65('0x12')](_0x38505e,_0x239a4f)['then'](function(_0x593bc7){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x503869,'request\x20sent');logger[_0xab65('0x13')](_0xab65('0x14'),_0x503869,_0xab65('0x15'),JSON['stringify'](_0x593bc7));if(_0x593bc7[_0xab65('0x16')]){if(_0x593bc7[_0xab65('0x16')][_0xab65('0x17')]===0x1f4){logger[_0xab65('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x503869,_0x593bc7[_0xab65('0x16')][_0xab65('0x18')]);return _0x181af6(_0x593bc7[_0xab65('0x16')][_0xab65('0x18')]);}logger[_0xab65('0x16')](_0xab65('0x19'),_0x503869,_0x593bc7[_0xab65('0x16')][_0xab65('0x18')]);return _0x36210f(_0x593bc7[_0xab65('0x16')][_0xab65('0x18')]);}else{logger[_0xab65('0x1a')](_0xab65('0x19'),_0x503869,_0xab65('0x15'));_0x36210f(_0x593bc7[_0xab65('0x1b')][_0xab65('0x18')]);}})[_0xab65('0x1c')](function(_0x33cdae){logger[_0xab65('0x16')](_0xab65('0x19'),_0x503869,_0x33cdae);_0x181af6(_0x33cdae);});});}exports[_0xab65('0x1d')]=function(_0x4614e1){var _0x16b99c=this;return new Promise(function(_0x4a6ff7,_0xba3606){return db[_0xab65('0x1e')]['update'](_0x4614e1[_0xab65('0x1f')],{'raw':_0x4614e1[_0xab65('0x20')]?_0x4614e1[_0xab65('0x20')][_0xab65('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4614e1[_0xab65('0x20')]?_0x4614e1[_0xab65('0x20')][_0xab65('0x22')]||null:null,'attributes':_0x4614e1['options']?_0x4614e1[_0xab65('0x20')][_0xab65('0x23')]||null:null,'limit':_0x4614e1[_0xab65('0x20')]?_0x4614e1[_0xab65('0x20')][_0xab65('0x24')]||null:null})[_0xab65('0x25')](function(_0x62fa92){logger[_0xab65('0x1a')]('UpdateFaxInteraction',_0x4614e1);logger[_0xab65('0x13')](_0xab65('0x1d'),_0x4614e1,JSON[_0xab65('0x26')](_0x62fa92));_0x4a6ff7(_0x62fa92);})[_0xab65('0x1c')](function(_0x2a0867){logger['error']('UpdateFaxInteraction',_0x2a0867[_0xab65('0x18')],_0x4614e1);_0xba3606(_0x16b99c['error'](0x1f4,_0x2a0867[_0xab65('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x638368){return new Promise(function(_0x2726fe,_0x383131){return db[_0xab65('0x1e')][_0xab65('0x27')]({'where':_0x638368[_0xab65('0x20')]?_0x638368[_0xab65('0x20')][_0xab65('0x22')]||null:null})[_0xab65('0x25')](function(_0x1b37cb){if(_0x1b37cb){return _0x1b37cb[_0xab65('0x28')](_0x638368[_0xab65('0x1f')][_0xab65('0x29')],_[_0xab65('0x2a')](_0x638368[_0xab65('0x1f')],['ids','id'])||{});}})[_0xab65('0x2b')](function(_0x108e30){logger[_0xab65('0x1a')]('AddTags',_0x638368);logger['debug'](_0xab65('0x2c'),_0x638368,JSON['stringify'](_0x108e30));_0x2726fe(_0x108e30);})[_0xab65('0x1c')](function(_0x46ce4a){logger['error']('AddTags',_0x46ce4a[_0xab65('0x18')],_0x638368);_0x383131(_this[_0xab65('0x16')](0x1f4,_0x46ce4a[_0xab65('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 85ad11b..ce00081 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 _0xc80d=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener'];(function(_0x27ac61,_0x51c7a1){var _0xc25084=function(_0x2b16e6){while(--_0x2b16e6){_0x27ac61['push'](_0x27ac61['shift']());}};_0xc25084(++_0x51c7a1);}(_0xc80d,0x1b3));var _0xdc80=function(_0x4ff161,_0x360d6e){_0x4ff161=_0x4ff161-0x0;var _0x5aa7fb=_0xc80d[_0x4ff161];return _0x5aa7fb;};'use strict';var FaxInteractionEvents=require(_0xdc80('0x0'));var events=[_0xdc80('0x1'),_0xdc80('0x2'),_0xdc80('0x3')];function createListener(_0x1c102c,_0x52f9f1){return function(_0x2f6115){_0x52f9f1['emit'](_0x1c102c,_0x2f6115);};}function removeListener(_0x54169f,_0x4fa08d){return function(){FaxInteractionEvents[_0xdc80('0x4')](_0x54169f,_0x4fa08d);};}exports[_0xdc80('0x5')]=function(_0x1aca8f){for(var _0x75c481=0x0,_0x56d972=events[_0xdc80('0x6')];_0x75c481<_0x56d972;_0x75c481++){var _0x422551=events[_0x75c481];var _0x3bc1a3=createListener(_0xdc80('0x7')+_0x422551,_0x1aca8f);FaxInteractionEvents['on'](_0x422551,_0x3bc1a3);}}; \ No newline at end of file +var _0x6118=['update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x39cb8b,_0x506e7f){var _0x5a3339=function(_0x52808d){while(--_0x52808d){_0x39cb8b['push'](_0x39cb8b['shift']());}};_0x5a3339(++_0x506e7f);}(_0x6118,0x9f));var _0x8611=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x6118[_0x4702ee];return _0x62ca7d;};'use strict';var FaxInteractionEvents=require(_0x8611('0x0'));var events=['save',_0x8611('0x1'),_0x8611('0x2')];function createListener(_0x46288f,_0x5778d7){return function(_0x63862e){_0x5778d7[_0x8611('0x3')](_0x46288f,_0x63862e);};}function removeListener(_0x16f0d7,_0x5e50ee){return function(){FaxInteractionEvents[_0x8611('0x4')](_0x16f0d7,_0x5e50ee);};}exports['register']=function(_0x1f758e){for(var _0x49dcd5=0x0,_0x363a44=events[_0x8611('0x5')];_0x49dcd5<_0x363a44;_0x49dcd5++){var _0x35191c=events[_0x49dcd5];var _0x4c72c5=createListener(_0x8611('0x6')+_0x35191c,_0x1f758e);FaxInteractionEvents['on'](_0x35191c,_0x4c72c5);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 26a5983..b2d8fcc 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 _0x311c=['path','express','Router','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','delete','faxinteraction:destroy','removeTags','exports','multer','util'];(function(_0xed4dd3,_0x246d28){var _0x4ebc51=function(_0x253bb0){while(--_0x253bb0){_0xed4dd3['push'](_0xed4dd3['shift']());}};_0x4ebc51(++_0x246d28);}(_0x311c,0x193));var _0xc311=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x311c[_0xa2c0a3];return _0x52c618;};'use strict';var multer=require(_0xc311('0x0'));var util=require(_0xc311('0x1'));var path=require(_0xc311('0x2'));var timeout=require('connect-timeout');var express=require(_0xc311('0x3'));var router=express[_0xc311('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xc311('0x5')]('/',auth[_0xc311('0x6')](),controller['index']);router[_0xc311('0x5')](_0xc311('0x7'),auth[_0xc311('0x6')](),controller[_0xc311('0x8')]);router[_0xc311('0x5')](_0xc311('0x9'),auth[_0xc311('0x6')](),controller[_0xc311('0xa')]);router[_0xc311('0x5')](_0xc311('0xb'),auth[_0xc311('0x6')](),controller[_0xc311('0xc')]);router[_0xc311('0x5')](_0xc311('0xd'),auth['isAuthenticated'](),controller[_0xc311('0xe')]);router['post']('/',auth[_0xc311('0x6')](),controller[_0xc311('0xf')]);router['post']('/:id/messages',auth[_0xc311('0x6')](),controller[_0xc311('0x10')]);router['post'](_0xc311('0x11'),auth[_0xc311('0x6')](),interaction[_0xc311('0x12')](_0xc311('0x13'),_0xc311('0x14')),controller[_0xc311('0x15')]);router['put']('/:id',auth[_0xc311('0x6')](),interaction['tracked'](_0xc311('0x13'),_0xc311('0x16')),controller['update']);router[_0xc311('0x17')](_0xc311('0x9'),auth[_0xc311('0x6')](),interaction[_0xc311('0x12')]('fax',_0xc311('0x18')),controller['destroy']);router[_0xc311('0x17')](_0xc311('0x11'),auth[_0xc311('0x6')](),controller[_0xc311('0x19')]);module[_0xc311('0x1a')]=router; \ No newline at end of file +var _0xd7ca=['index','/describe','describe','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xd7ca,0xb1));var _0xad7c=function(_0x31b8bb,_0x2774ee){_0x31b8bb=_0x31b8bb-0x0;var _0x324ae5=_0xd7ca[_0x31b8bb];return _0x324ae5;};'use strict';var multer=require('multer');var util=require(_0xad7c('0x0'));var path=require(_0xad7c('0x1'));var timeout=require('connect-timeout');var express=require(_0xad7c('0x2'));var router=express[_0xad7c('0x3')]();var auth=require(_0xad7c('0x4'));var interaction=require(_0xad7c('0x5'));var config=require(_0xad7c('0x6'));var controller=require('./faxInteraction.controller');router[_0xad7c('0x7')]('/',auth[_0xad7c('0x8')](),controller[_0xad7c('0x9')]);router[_0xad7c('0x7')](_0xad7c('0xa'),auth[_0xad7c('0x8')](),controller[_0xad7c('0xb')]);router[_0xad7c('0x7')]('/:id',auth[_0xad7c('0x8')](),controller[_0xad7c('0xc')]);router[_0xad7c('0x7')](_0xad7c('0xd'),auth[_0xad7c('0x8')](),controller['getMessages']);router['get'](_0xad7c('0xe'),auth[_0xad7c('0x8')](),controller['download']);router[_0xad7c('0xf')]('/',auth[_0xad7c('0x8')](),controller[_0xad7c('0x10')]);router['post']('/:id/messages',auth[_0xad7c('0x8')](),controller[_0xad7c('0x11')]);router[_0xad7c('0xf')](_0xad7c('0x12'),auth[_0xad7c('0x8')](),interaction[_0xad7c('0x13')](_0xad7c('0x14'),_0xad7c('0x15')),controller[_0xad7c('0x16')]);router[_0xad7c('0x17')](_0xad7c('0x18'),auth[_0xad7c('0x8')](),interaction[_0xad7c('0x13')](_0xad7c('0x14'),_0xad7c('0x19')),controller[_0xad7c('0x1a')]);router[_0xad7c('0x1b')](_0xad7c('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0xad7c('0x14'),_0xad7c('0x1c')),controller[_0xad7c('0x1d')]);router[_0xad7c('0x1b')](_0xad7c('0x12'),auth[_0xad7c('0x8')](),controller[_0xad7c('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d68ff4b..c0188a9 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 _0x9c00=['DATE','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x9c00,0xd3));var _0x09c0=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0x9c00[_0x2b2b33];return _0x229157;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'body':{'type':Sequelize[_0x09c0('0x2')](_0x09c0('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x09c0('0x4')]('in',_0x09c0('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x09c0('0x6')]}}; \ No newline at end of file +var _0x4c8b=['ENUM','out','DATE','sequelize','exports','BOOLEAN'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x4c8b,0x17d));var _0xb4c8=function(_0x285524,_0x2767bf){_0x285524=_0x285524-0x0;var _0x528453=_0x4c8b[_0x285524];return _0x528453;};'use strict';var Sequelize=require(_0xb4c8('0x0'));module[_0xb4c8('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb4c8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb4c8('0x3')]('in','out'),'defaultValue':_0xb4c8('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xb4c8('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a2df21e..9ee8548 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 _0xffa2=['rejectMessage','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','html-pdf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./faxMessage.socket','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','FaxMessage','include','findAll','rows','show','params','filters','length','includeAll','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null'];(function(_0x8c6330,_0x5cb01c){var _0x222a11=function(_0x469ddf){while(--_0x469ddf){_0x8c6330['push'](_0x8c6330['shift']());}};_0x222a11(++_0x5cb01c);}(_0xffa2,0x115));var _0x2ffa=function(_0x39c407,_0x124d32){_0x39c407=_0x39c407-0x0;var _0x4696da=_0xffa2[_0x39c407];return _0x4696da;};'use strict';var pdf=require(_0x2ffa('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ffa('0x1'));var rp=require(_0x2ffa('0x2'));var moment=require(_0x2ffa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2ffa('0x4'));var util=require('util');var path=require(_0x2ffa('0x5'));var sox=require(_0x2ffa('0x6'));var csv=require(_0x2ffa('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2ffa('0x8'));var squel=require('squel');var crypto=require(_0x2ffa('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ffa('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x2ffa('0xa'));var hardwareService=require(_0x2ffa('0xb'));var Redis=require(_0x2ffa('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0x2ffa('0xd'))('api');var utils=require(_0x2ffa('0xe'));var config=require('../../config/environment');var db=require(_0x2ffa('0xf'))['db'];config['redis']=_[_0x2ffa('0x10')](config[_0x2ffa('0x11')],{'host':_0x2ffa('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ffa('0x11')]));require(_0x2ffa('0x13'))['register'](socket);var jayson=require(_0x2ffa('0x14'));var client=jayson[_0x2ffa('0x15')][_0x2ffa('0x16')]({'port':0x232c});var client9002=jayson[_0x2ffa('0x15')][_0x2ffa('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2bb3e3,_0xed1f09,_0x220210,_0x2468ad){return new BPromise(function(_0x9d9870,_0x128e51){var _0x50b070=_0x2468ad||client;return _0x50b070['request'](_0x2bb3e3,_0x220210)[_0x2ffa('0x17')](function(_0x26565b){logger[_0x2ffa('0x18')](_0x2ffa('0x19'),_0xed1f09,'request\x20sent');logger[_0x2ffa('0x1a')](_0x2ffa('0x1b'),_0xed1f09,_0x2ffa('0x1c'),JSON[_0x2ffa('0x1d')](_0x26565b));if(_0x26565b['error']){if(_0x26565b[_0x2ffa('0x1e')][_0x2ffa('0x1f')]===0x1f4){logger[_0x2ffa('0x1e')](_0x2ffa('0x19'),_0xed1f09,_0x26565b['error'][_0x2ffa('0x20')]);return _0x128e51(_0x26565b[_0x2ffa('0x1e')][_0x2ffa('0x20')]);}logger[_0x2ffa('0x1e')](_0x2ffa('0x19'),_0xed1f09,_0x26565b[_0x2ffa('0x1e')][_0x2ffa('0x20')]);return _0x9d9870(_0x26565b[_0x2ffa('0x1e')][_0x2ffa('0x20')]);}else{logger[_0x2ffa('0x18')]('FaxMessage,\x20%s,\x20%s',_0xed1f09,'request\x20sent');_0x9d9870(_0x26565b[_0x2ffa('0x21')][_0x2ffa('0x20')]);}})[_0x2ffa('0x22')](function(_0x25d8cc){logger[_0x2ffa('0x1e')](_0x2ffa('0x19'),_0xed1f09,_0x25d8cc);_0x128e51(_0x25d8cc);});});}function respondWithStatusCode(_0x145949,_0x4de6dc){_0x4de6dc=_0x4de6dc||0xcc;return function(_0x1f5cd0){if(_0x1f5cd0){return _0x145949[_0x2ffa('0x23')](_0x4de6dc);}return _0x145949[_0x2ffa('0x24')](_0x4de6dc)[_0x2ffa('0x25')]();};}function respondWithResult(_0x3c57c3,_0x3f56c7){_0x3f56c7=_0x3f56c7||0xc8;return function(_0x85a894){if(_0x85a894){return _0x3c57c3[_0x2ffa('0x24')](_0x3f56c7)[_0x2ffa('0x26')](_0x85a894);}};}function respondWithFilteredResult(_0x316d15,_0x39422b){return function(_0x3ec7ba){if(_0x3ec7ba){var _0x99dc38=_0x3ec7ba[_0x2ffa('0x27')],_0x57b4dc=_0x39422b[_0x2ffa('0x28')],_0x4bc665=_0x39422b[_0x2ffa('0x28')]+_0x39422b[_0x2ffa('0x29')],_0x552c96;if(_0x4bc665>=_0x99dc38){_0x4bc665=_0x99dc38;_0x552c96=0xc8;}else{_0x552c96=0xce;}_0x316d15[_0x2ffa('0x24')](_0x552c96);return _0x316d15[_0x2ffa('0x2a')]('Content-Range',_0x57b4dc+'-'+_0x4bc665+'/'+_0x99dc38)['json'](_0x3ec7ba);}return null;};}function patchUpdates(_0x48efe1){return function(_0x21cde2){try{jsonpatch[_0x2ffa('0x2b')](_0x21cde2,_0x48efe1,!![]);}catch(_0x1531e1){return BPromise[_0x2ffa('0x2c')](_0x1531e1);}return _0x21cde2[_0x2ffa('0x2d')]();};}function saveUpdates(_0x20221c,_0x374663){return function(_0x27cfc2){if(_0x27cfc2){return _0x27cfc2[_0x2ffa('0x2e')](_0x20221c)[_0x2ffa('0x17')](function(_0x31a299){return _0x31a299;});}return null;};}function removeEntity(_0x3ed4da,_0x25f447){return function(_0x1557bf){if(_0x1557bf){return _0x1557bf[_0x2ffa('0x2f')]()[_0x2ffa('0x17')](function(){_0x3ed4da[_0x2ffa('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3024cd,_0x34faf5){return function(_0x4f0b2f){if(!_0x4f0b2f){_0x3024cd[_0x2ffa('0x23')](0x194);}return _0x4f0b2f;};}function handleError(_0x5ce9e0,_0x5c24e2){_0x5c24e2=_0x5c24e2||0x1f4;return function(_0x351a87){logger[_0x2ffa('0x1e')](_0x351a87[_0x2ffa('0x30')]);if(_0x351a87[_0x2ffa('0x31')]){delete _0x351a87['name'];}_0x5ce9e0['status'](_0x5c24e2)[_0x2ffa('0x32')](_0x351a87);};}exports[_0x2ffa('0x33')]=function(_0x10ec72,_0x53f7c0){var _0x5cca69={},_0x5349cd={},_0x11d0cf={'count':0x0,'rows':[]};var _0x5cdb18=db['FaxMessage']['rawAttributes'];_0x5349cd[_0x2ffa('0x34')]=_[_0x2ffa('0x35')](_0x5cdb18);_0x5349cd['query']=_[_0x2ffa('0x35')](_0x10ec72[_0x2ffa('0x36')]);_0x5349cd['filters']=_[_0x2ffa('0x37')](_0x5349cd[_0x2ffa('0x34')],_0x5349cd[_0x2ffa('0x36')]);_0x5cca69[_0x2ffa('0x38')]=_[_0x2ffa('0x37')](_0x5349cd['model'],qs[_0x2ffa('0x39')](_0x10ec72['query'][_0x2ffa('0x39')]));_0x5cca69['attributes']=_0x5cca69['attributes']['length']?_0x5cca69[_0x2ffa('0x38')]:_0x5349cd['model'];if(!_0x10ec72[_0x2ffa('0x36')]['hasOwnProperty'](_0x2ffa('0x3a'))){_0x5cca69[_0x2ffa('0x29')]=qs[_0x2ffa('0x29')](_0x10ec72[_0x2ffa('0x36')][_0x2ffa('0x29')]);_0x5cca69['offset']=qs[_0x2ffa('0x28')](_0x10ec72['query']['offset']);}_0x5cca69[_0x2ffa('0x3b')]=qs[_0x2ffa('0x3c')](_0x10ec72['query'][_0x2ffa('0x3c')]);_0x5cca69[_0x2ffa('0x3d')]=qs['filters'](_[_0x2ffa('0x3e')](_0x10ec72['query'],_0x5349cd['filters']));if(_0x10ec72[_0x2ffa('0x36')]['filter']){_0x5cca69[_0x2ffa('0x3d')]=_[_0x2ffa('0x3f')](_0x5cca69[_0x2ffa('0x3d')],{'$or':_[_0x2ffa('0x40')](_0x5cdb18,function(_0x2f7937){if(_0x2f7937[_0x2ffa('0x41')][_0x2ffa('0x42')]!==_0x2ffa('0x43')){var _0x3962e5={};_0x3962e5[_0x2f7937[_0x2ffa('0x44')]]={'$like':'%'+_0x10ec72[_0x2ffa('0x36')][_0x2ffa('0x45')]+'%'};return _0x3962e5;}})});}_0x5cca69=_[_0x2ffa('0x3f')]({},_0x5cca69,_0x10ec72[_0x2ffa('0x46')]);var _0x24a620={'where':_0x5cca69[_0x2ffa('0x3d')]};return db[_0x2ffa('0x47')][_0x2ffa('0x27')](_0x24a620)['then'](function(_0xcfece2){_0x11d0cf['count']=_0xcfece2;if(_0x10ec72['query']['includeAll']){_0x5cca69[_0x2ffa('0x48')]=[{'all':!![]}];}return db[_0x2ffa('0x47')][_0x2ffa('0x49')](_0x5cca69);})[_0x2ffa('0x17')](function(_0xc46400){_0x11d0cf[_0x2ffa('0x4a')]=_0xc46400;return _0x11d0cf;})[_0x2ffa('0x17')](respondWithFilteredResult(_0x53f7c0,_0x5cca69))[_0x2ffa('0x22')](handleError(_0x53f7c0,null));};exports[_0x2ffa('0x4b')]=function(_0x5a7c3e,_0x2ebae5){var _0xf34fd7={'raw':!![],'where':{'id':_0x5a7c3e[_0x2ffa('0x4c')]['id']}},_0xaab51c={};_0xaab51c['model']=_[_0x2ffa('0x35')](db[_0x2ffa('0x47')]['rawAttributes']);_0xaab51c['query']=_[_0x2ffa('0x35')](_0x5a7c3e[_0x2ffa('0x36')]);_0xaab51c[_0x2ffa('0x4d')]=_[_0x2ffa('0x37')](_0xaab51c[_0x2ffa('0x34')],_0xaab51c[_0x2ffa('0x36')]);_0xf34fd7[_0x2ffa('0x38')]=_[_0x2ffa('0x37')](_0xaab51c[_0x2ffa('0x34')],qs[_0x2ffa('0x39')](_0x5a7c3e['query'][_0x2ffa('0x39')]));_0xf34fd7[_0x2ffa('0x38')]=_0xf34fd7['attributes'][_0x2ffa('0x4e')]?_0xf34fd7[_0x2ffa('0x38')]:_0xaab51c['model'];if(_0x5a7c3e[_0x2ffa('0x36')][_0x2ffa('0x4f')]){_0xf34fd7['include']=[{'all':!![]}];}_0xf34fd7=_[_0x2ffa('0x3f')]({},_0xf34fd7,_0x5a7c3e[_0x2ffa('0x46')]);return db[_0x2ffa('0x47')][_0x2ffa('0x50')](_0xf34fd7)['then'](handleEntityNotFound(_0x2ebae5,null))[_0x2ffa('0x17')](respondWithResult(_0x2ebae5,null))[_0x2ffa('0x22')](handleError(_0x2ebae5,null));};exports['update']=function(_0x2a38b0,_0x3d7d29){if(_0x2a38b0[_0x2ffa('0x51')]['id']){delete _0x2a38b0[_0x2ffa('0x51')]['id'];}return db[_0x2ffa('0x47')][_0x2ffa('0x50')]({'where':{'id':_0x2a38b0['params']['id']}})[_0x2ffa('0x17')](handleEntityNotFound(_0x3d7d29,null))[_0x2ffa('0x17')](saveUpdates(_0x2a38b0[_0x2ffa('0x51')],null))[_0x2ffa('0x17')](respondWithResult(_0x3d7d29,null))[_0x2ffa('0x22')](handleError(_0x3d7d29,null));};exports['destroy']=function(_0x3119fd,_0x1916b1){return db['FaxMessage'][_0x2ffa('0x50')]({'where':{'id':_0x3119fd['params']['id']}})[_0x2ffa('0x17')](handleEntityNotFound(_0x1916b1,null))[_0x2ffa('0x17')](removeEntity(_0x1916b1,null))['catch'](handleError(_0x1916b1,null));};exports[_0x2ffa('0x52')]=function(_0x30641a,_0x1e3bcf){return db[_0x2ffa('0x47')][_0x2ffa('0x52')]()['then'](respondWithResult(_0x1e3bcf,null))['catch'](handleError(_0x1e3bcf,null));};var interaction_log=require('../../config/logger')(_0x2ffa('0x53'));exports[_0x2ffa('0x54')]=function(_0x1cba10,_0x190f1b,_0x2649e0){var _0x2a4c12={'channel':_0x2ffa('0x55')};if(_0x1cba10[_0x2ffa('0x51')]['id']){delete _0x1cba10[_0x2ffa('0x51')]['id'];}_0x1cba10['body'][_0x2ffa('0x56')]=!![];_0x1cba10[_0x2ffa('0x51')][_0x2ffa('0x57')]=moment()[_0x2ffa('0x58')](_0x2ffa('0x59'));_0x1cba10['body']['UserId']=_0x1cba10[_0x2ffa('0x51')][_0x2ffa('0x5a')]||_0x1cba10[_0x2ffa('0x5b')]['id'];return db[_0x2ffa('0x47')]['find']({'where':{'id':_0x1cba10[_0x2ffa('0x4c')]['id'],'UserId':null},'include':[{'model':db[_0x2ffa('0x5c')],'as':_0x2ffa('0x5d')}]})[_0x2ffa('0x17')](handleEntityNotFound(_0x190f1b,null))[_0x2ffa('0x17')](saveUpdates(_0x1cba10[_0x2ffa('0x51')],null))[_0x2ffa('0x17')](function(_0x2de09a){if(_0x2de09a){_0x2a4c12[_0x2ffa('0x20')]=_0x2de09a[_0x2ffa('0x5e')]({'plain':!![]});return db[_0x2ffa('0x5f')]['find']({'where':{'id':_0x2de09a['FaxInteractionId']}});}return null;})[_0x2ffa('0x17')](handleEntityNotFound(_0x190f1b,null))[_0x2ffa('0x17')](function(_0x4b7c94){if(_0x4b7c94){return _0x4b7c94[_0x2ffa('0x2e')]({'UserId':_0x1cba10[_0x2ffa('0x51')][_0x2ffa('0x5a')],'read1stAt':_[_0x2ffa('0x60')](_0x4b7c94[_0x2ffa('0x61')])?moment()[_0x2ffa('0x58')](_0x2ffa('0x59')):undefined});}return null;})[_0x2ffa('0x17')](function(_0x23e1a2){if(_0x23e1a2){_0x2a4c12[_0x2ffa('0x62')]=_0x23e1a2['get']({'plain':!![]});interaction_log[_0x2ffa('0x18')](_0x2ffa('0x63'),_0x1cba10[_0x2ffa('0x5b')]['id'],_0x1cba10[_0x2ffa('0x5b')][_0x2ffa('0x31')],_0x1cba10[_0x2ffa('0x5b')][_0x2ffa('0x64')],_0x2a4c12[_0x2ffa('0x62')]['id'],_0x1cba10[_0x2ffa('0x51')]?JSON[_0x2ffa('0x1d')](_0x1cba10[_0x2ffa('0x51')]):'null');return respondWithRpcPromise(_0x2ffa('0x65'),_0x2ffa('0x66'),_0x2a4c12);}return null;})['then'](function(_0x2d02fd){if(_0x2d02fd){if(_0x1cba10[_0x2ffa('0x51')][_0x2ffa('0x67')]){_0x2a4c12[_0x2ffa('0x20')][_0x2ffa('0x68')]=util[_0x2ffa('0x58')](_0x2ffa('0x69'),_0x1cba10[_0x2ffa('0x5b')][_0x2ffa('0x31')]);_0x2a4c12[_0x2ffa('0x20')][_0x2ffa('0x6a')]=_0x2a4c12['channel'];_0x2a4c12[_0x2ffa('0x20')]['event']=_0x2ffa('0x54');return respondWithRpcPromise(_0x2ffa('0x6b'),_0x2ffa('0x6b'),{'event':_0x2ffa('0x6c'),'message':_0x2a4c12[_0x2ffa('0x20')]},client9002)[_0x2ffa('0x17')](function(){return _0x2a4c12;});}return _0x2a4c12;}return null;})[_0x2ffa('0x17')](respondWithResult(_0x190f1b,null))[_0x2ffa('0x22')](handleError(_0x190f1b,null));};var interaction_log=require(_0x2ffa('0xd'))(_0x2ffa('0x53'));exports[_0x2ffa('0x2c')]=function(_0x4041b3,_0x4fda25,_0x505b6c){var _0x3f81bb={'agent':{},'channel':_0x2ffa('0x55')};if(_0x4041b3[_0x2ffa('0x51')]['id']){delete _0x4041b3[_0x2ffa('0x51')]['id'];}_0x4041b3['body'][_0x2ffa('0x5a')]=_0x4041b3[_0x2ffa('0x51')][_0x2ffa('0x5a')]||_0x4041b3[_0x2ffa('0x5b')]['id'];_0x3f81bb[_0x2ffa('0x6d')]['id']=_0x4041b3[_0x2ffa('0x51')][_0x2ffa('0x5a')];return db[_0x2ffa('0x47')][_0x2ffa('0x50')]({'where':{'id':_0x4041b3['params']['id'],'UserId':null}})[_0x2ffa('0x17')](handleEntityNotFound(_0x4fda25,null))[_0x2ffa('0x17')](function(_0x170609){if(_0x170609){_0x3f81bb[_0x2ffa('0x20')]=_0x170609['get']({'plain':!![]});return db[_0x2ffa('0x5f')][_0x2ffa('0x50')]({'where':{'id':_0x170609[_0x2ffa('0x6e')]}});}return null;})[_0x2ffa('0x17')](handleEntityNotFound(_0x4fda25,null))[_0x2ffa('0x17')](function(_0x8d1b78){if(_0x8d1b78){_0x3f81bb[_0x2ffa('0x62')]=_0x8d1b78[_0x2ffa('0x5e')]({'plain':!![]});interaction_log[_0x2ffa('0x18')](_0x2ffa('0x6f'),_0x4041b3['user']['id'],_0x4041b3[_0x2ffa('0x5b')][_0x2ffa('0x31')],_0x4041b3[_0x2ffa('0x5b')][_0x2ffa('0x64')],_0x3f81bb[_0x2ffa('0x62')]['id'],_0x4041b3[_0x2ffa('0x51')]?JSON[_0x2ffa('0x1d')](_0x4041b3[_0x2ffa('0x51')]):_0x2ffa('0x70'));return respondWithRpcPromise('RejectMessage',_0x2ffa('0x71'),_0x3f81bb);}return null;})['then'](function(_0x7966f9){if(_0x7966f9){_0x7966f9[_0x2ffa('0x20')][_0x2ffa('0x68')]=util['format']('SIP/%s',_0x4041b3['user'][_0x2ffa('0x31')]);_0x7966f9['message'][_0x2ffa('0x6a')]=_0x3f81bb[_0x2ffa('0x6a')];_0x7966f9['message']['event']=_0x2ffa('0x2c');respondWithRpcPromise(_0x2ffa('0x6b'),_0x2ffa('0x6b'),{'event':_0x2ffa('0x72'),'message':_0x7966f9[_0x2ffa('0x20')]},client9002);return _0x3f81bb;}return null;})['then'](respondWithResult(_0x4fda25,null))[_0x2ffa('0x22')](handleError(_0x4fda25,null));};exports[_0x2ffa('0x73')]=function(_0x30ff86,_0xba602){var _0x1f4448;return db[_0x2ffa('0x47')][_0x2ffa('0x73')](_0x30ff86[_0x2ffa('0x51')],{})[_0x2ffa('0x17')](function(_0x520158){_0x1f4448=_0x520158;return db[_0x2ffa('0x5c')][_0x2ffa('0x74')]({'where':{'id':_0x1f4448[_0x2ffa('0x75')]}});})[_0x2ffa('0x17')](function(_0x4bdb64){if(_[_0x2ffa('0x60')](_0x4bdb64)){return;}else{_0x1f4448[_0x2ffa('0x55')]=_0x4bdb64['fax'];return db[_0x2ffa('0x76')][_0x2ffa('0x74')]({'where':{'id':_0x1f4448[_0x2ffa('0x77')]}});}})[_0x2ffa('0x17')](function(_0x1a1429){return respondWithRpcPromise('SendFax',_0x2ffa('0x78'),{'FaxAccountId':_['isNil'](_0x30ff86[_0x2ffa('0x51')])?undefined:_0x30ff86['body'][_0x2ffa('0x79')],'path':_['isNil'](_0x1a1429)?undefined:util[_0x2ffa('0x58')](_0x2ffa('0x7a'),_0x1a1429[_0x2ffa('0x7b')]),'fax':_[_0x2ffa('0x60')](_0x1f4448[_0x2ffa('0x55')])?undefined:_0x1f4448[_0x2ffa('0x55')],'AttachmentId':_0x1f4448[_0x2ffa('0x77')]},client9002);})['then'](respondWithResult(_0xba602,0xc9))[_0x2ffa('0x22')](handleError(_0xba602,null));};exports[_0x2ffa('0x7c')]=function(_0x5158da,_0x10bc33){var _0x544832=path[_0x2ffa('0x7d')](config[_0x2ffa('0x7e')],_0x2ffa('0x7f'),_0x2ffa('0x80'),_0x2ffa('0x81'));return db[_0x2ffa('0x47')][_0x2ffa('0x50')]({'where':{'id':_0x5158da[_0x2ffa('0x4c')]['id']},'include':[{'model':db[_0x2ffa('0x76')],'as':_0x2ffa('0x76')}]})[_0x2ffa('0x17')](handleEntityNotFound(_0x10bc33,null))[_0x2ffa('0x17')](function(_0x3d94fd){if(_0x3d94fd){return _0x10bc33[_0x2ffa('0x7c')](path[_0x2ffa('0x7d')](_0x544832,_0x3d94fd['Attachment'][_0x2ffa('0x7b')]));}})[_0x2ffa('0x22')](handleError(_0x10bc33,null));}; \ No newline at end of file +var _0xa3b7=['count','offset','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','find','body','params','describe','fax-interactions','accept','fax','read','readAt','UserId','user','CmContact','Contact','get','FaxInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','root','files','join','basename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','json'];(function(_0x2f601c,_0x5a94a2){var _0x50a269=function(_0x1c4680){while(--_0x1c4680){_0x2f601c['push'](_0x2f601c['shift']());}};_0x50a269(++_0x5a94a2);}(_0xa3b7,0xe0));var _0x7a3b=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0xa3b7[_0x1b25c1];return _0x1e4447;};'use strict';var pdf=require(_0x7a3b('0x0'));var emlformat=require(_0x7a3b('0x1'));var rimraf=require(_0x7a3b('0x2'));var zipdir=require(_0x7a3b('0x3'));var jsonpatch=require(_0x7a3b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7a3b('0x5'));var Mustache=require(_0x7a3b('0x6'));var util=require('util');var path=require(_0x7a3b('0x7'));var sox=require(_0x7a3b('0x8'));var csv=require(_0x7a3b('0x9'));var ejs=require(_0x7a3b('0xa'));var fs=require('fs');var _=require(_0x7a3b('0xb'));var squel=require(_0x7a3b('0xc'));var crypto=require(_0x7a3b('0xd'));var jsforce=require(_0x7a3b('0xe'));var deskjs=require(_0x7a3b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7a3b('0x10'));var authService=require(_0x7a3b('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7a3b('0x12'));var qs=require(_0x7a3b('0x13'));var logger=require(_0x7a3b('0x14'))(_0x7a3b('0x15'));var utils=require(_0x7a3b('0x16'));var config=require(_0x7a3b('0x17'));var db=require('../../mysqldb')['db'];config[_0x7a3b('0x18')]=_['defaults'](config[_0x7a3b('0x18')],{'host':_0x7a3b('0x19'),'port':0x18eb});var socket=require(_0x7a3b('0x1a'))(new Redis(config[_0x7a3b('0x18')]));require(_0x7a3b('0x1b'))[_0x7a3b('0x1c')](socket);var jayson=require(_0x7a3b('0x1d'));var client=jayson[_0x7a3b('0x1e')][_0x7a3b('0x1f')]({'port':0x232c});var client9002=jayson[_0x7a3b('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24d08c,_0x115f36,_0x385987,_0x2c5695){return new BPromise(function(_0x23f0fc,_0x13f1e6){var _0x397bec=_0x2c5695||client;return _0x397bec[_0x7a3b('0x20')](_0x24d08c,_0x385987)[_0x7a3b('0x21')](function(_0x2522f1){logger['info']('FaxMessage,\x20%s,\x20%s',_0x115f36,_0x7a3b('0x22'));logger[_0x7a3b('0x23')](_0x7a3b('0x24'),_0x115f36,'request\x20sent',JSON[_0x7a3b('0x25')](_0x2522f1));if(_0x2522f1[_0x7a3b('0x26')]){if(_0x2522f1[_0x7a3b('0x26')]['code']===0x1f4){logger[_0x7a3b('0x26')](_0x7a3b('0x27'),_0x115f36,_0x2522f1[_0x7a3b('0x26')][_0x7a3b('0x28')]);return _0x13f1e6(_0x2522f1[_0x7a3b('0x26')][_0x7a3b('0x28')]);}logger[_0x7a3b('0x26')](_0x7a3b('0x27'),_0x115f36,_0x2522f1['error']['message']);return _0x23f0fc(_0x2522f1[_0x7a3b('0x26')]['message']);}else{logger[_0x7a3b('0x29')](_0x7a3b('0x27'),_0x115f36,_0x7a3b('0x22'));_0x23f0fc(_0x2522f1['result']['message']);}})[_0x7a3b('0x2a')](function(_0x13bffd){logger[_0x7a3b('0x26')](_0x7a3b('0x27'),_0x115f36,_0x13bffd);_0x13f1e6(_0x13bffd);});});}function respondWithStatusCode(_0x3b8c32,_0x49c99a){_0x49c99a=_0x49c99a||0xcc;return function(_0x4d0d00){if(_0x4d0d00){return _0x3b8c32[_0x7a3b('0x2b')](_0x49c99a);}return _0x3b8c32[_0x7a3b('0x2c')](_0x49c99a)['end']();};}function respondWithResult(_0x7314a8,_0x4de294){_0x4de294=_0x4de294||0xc8;return function(_0x1546c4){if(_0x1546c4){return _0x7314a8[_0x7a3b('0x2c')](_0x4de294)[_0x7a3b('0x2d')](_0x1546c4);}};}function respondWithFilteredResult(_0x3a3fec,_0x2e9420){return function(_0x4b34b5){if(_0x4b34b5){var _0x4e4354=_0x4b34b5[_0x7a3b('0x2e')],_0x4fd34d=_0x2e9420[_0x7a3b('0x2f')],_0x2d9415=_0x2e9420[_0x7a3b('0x2f')]+_0x2e9420['limit'],_0xb1c777;if(_0x2d9415>=_0x4e4354){_0x2d9415=_0x4e4354;_0xb1c777=0xc8;}else{_0xb1c777=0xce;}_0x3a3fec['status'](_0xb1c777);return _0x3a3fec[_0x7a3b('0x30')](_0x7a3b('0x31'),_0x4fd34d+'-'+_0x2d9415+'/'+_0x4e4354)[_0x7a3b('0x2d')](_0x4b34b5);}return null;};}function patchUpdates(_0x12fffc){return function(_0x573672){try{jsonpatch[_0x7a3b('0x32')](_0x573672,_0x12fffc,!![]);}catch(_0x22081e){return BPromise[_0x7a3b('0x33')](_0x22081e);}return _0x573672['save']();};}function saveUpdates(_0x27ef9a,_0x1b5355){return function(_0x35e423){if(_0x35e423){return _0x35e423[_0x7a3b('0x34')](_0x27ef9a)[_0x7a3b('0x21')](function(_0x49d779){return _0x49d779;});}return null;};}function removeEntity(_0x103e51,_0x5c612d){return function(_0x55f0b0){if(_0x55f0b0){return _0x55f0b0[_0x7a3b('0x35')]()[_0x7a3b('0x21')](function(){_0x103e51['status'](0xcc)[_0x7a3b('0x36')]();});}};}function handleEntityNotFound(_0xc10084,_0x1e199e){return function(_0x3f526b){if(!_0x3f526b){_0xc10084[_0x7a3b('0x2b')](0x194);}return _0x3f526b;};}function handleError(_0x588da4,_0x322f9f){_0x322f9f=_0x322f9f||0x1f4;return function(_0x4b09b1){logger[_0x7a3b('0x26')](_0x4b09b1[_0x7a3b('0x37')]);if(_0x4b09b1[_0x7a3b('0x38')]){delete _0x4b09b1[_0x7a3b('0x38')];}_0x588da4[_0x7a3b('0x2c')](_0x322f9f)[_0x7a3b('0x39')](_0x4b09b1);};}exports[_0x7a3b('0x3a')]=function(_0x4978d0,_0x358489){var _0x350ec4={},_0x508f85={},_0x342fec={'count':0x0,'rows':[]};var _0x4d035f=db[_0x7a3b('0x3b')][_0x7a3b('0x3c')];_0x508f85[_0x7a3b('0x3d')]=_[_0x7a3b('0x3e')](_0x4d035f);_0x508f85[_0x7a3b('0x3f')]=_[_0x7a3b('0x3e')](_0x4978d0[_0x7a3b('0x3f')]);_0x508f85[_0x7a3b('0x40')]=_[_0x7a3b('0x41')](_0x508f85[_0x7a3b('0x3d')],_0x508f85[_0x7a3b('0x3f')]);_0x350ec4[_0x7a3b('0x42')]=_[_0x7a3b('0x41')](_0x508f85['model'],qs[_0x7a3b('0x43')](_0x4978d0[_0x7a3b('0x3f')]['fields']));_0x350ec4[_0x7a3b('0x42')]=_0x350ec4['attributes'][_0x7a3b('0x44')]?_0x350ec4[_0x7a3b('0x42')]:_0x508f85[_0x7a3b('0x3d')];if(!_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x45')](_0x7a3b('0x46'))){_0x350ec4['limit']=qs[_0x7a3b('0x47')](_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x47')]);_0x350ec4[_0x7a3b('0x2f')]=qs['offset'](_0x4978d0[_0x7a3b('0x3f')]['offset']);}_0x350ec4[_0x7a3b('0x48')]=qs['sort'](_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x49')]);_0x350ec4['where']=qs[_0x7a3b('0x40')](_[_0x7a3b('0x4a')](_0x4978d0[_0x7a3b('0x3f')],_0x508f85[_0x7a3b('0x40')]));if(_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x4b')]){_0x350ec4[_0x7a3b('0x4c')]=_['merge'](_0x350ec4[_0x7a3b('0x4c')],{'$or':_['map'](_0x4d035f,function(_0x67ba7b){if(_0x67ba7b[_0x7a3b('0x4d')][_0x7a3b('0x4e')]!==_0x7a3b('0x4f')){var _0x5e37f1={};_0x5e37f1[_0x67ba7b[_0x7a3b('0x50')]]={'$like':'%'+_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x4b')]+'%'};return _0x5e37f1;}})});}_0x350ec4=_[_0x7a3b('0x51')]({},_0x350ec4,_0x4978d0[_0x7a3b('0x52')]);var _0x39b8f5={'where':_0x350ec4[_0x7a3b('0x4c')]};return db[_0x7a3b('0x3b')][_0x7a3b('0x2e')](_0x39b8f5)[_0x7a3b('0x21')](function(_0x221133){_0x342fec[_0x7a3b('0x2e')]=_0x221133;if(_0x4978d0[_0x7a3b('0x3f')][_0x7a3b('0x53')]){_0x350ec4[_0x7a3b('0x54')]=[{'all':!![]}];}return db[_0x7a3b('0x3b')][_0x7a3b('0x55')](_0x350ec4);})[_0x7a3b('0x21')](function(_0x49c907){_0x342fec[_0x7a3b('0x56')]=_0x49c907;return _0x342fec;})[_0x7a3b('0x21')](respondWithFilteredResult(_0x358489,_0x350ec4))[_0x7a3b('0x2a')](handleError(_0x358489,null));};exports[_0x7a3b('0x57')]=function(_0xf6120,_0x5f3af0){var _0x333140={'raw':!![],'where':{'id':_0xf6120['params']['id']}},_0x48a6b8={};_0x48a6b8[_0x7a3b('0x3d')]=_[_0x7a3b('0x3e')](db[_0x7a3b('0x3b')]['rawAttributes']);_0x48a6b8[_0x7a3b('0x3f')]=_['keys'](_0xf6120[_0x7a3b('0x3f')]);_0x48a6b8[_0x7a3b('0x40')]=_[_0x7a3b('0x41')](_0x48a6b8['model'],_0x48a6b8[_0x7a3b('0x3f')]);_0x333140[_0x7a3b('0x42')]=_[_0x7a3b('0x41')](_0x48a6b8['model'],qs[_0x7a3b('0x43')](_0xf6120[_0x7a3b('0x3f')][_0x7a3b('0x43')]));_0x333140[_0x7a3b('0x42')]=_0x333140[_0x7a3b('0x42')][_0x7a3b('0x44')]?_0x333140[_0x7a3b('0x42')]:_0x48a6b8[_0x7a3b('0x3d')];if(_0xf6120['query'][_0x7a3b('0x53')]){_0x333140[_0x7a3b('0x54')]=[{'all':!![]}];}_0x333140=_[_0x7a3b('0x51')]({},_0x333140,_0xf6120[_0x7a3b('0x52')]);return db[_0x7a3b('0x3b')][_0x7a3b('0x58')](_0x333140)[_0x7a3b('0x21')](handleEntityNotFound(_0x5f3af0,null))[_0x7a3b('0x21')](respondWithResult(_0x5f3af0,null))[_0x7a3b('0x2a')](handleError(_0x5f3af0,null));};exports[_0x7a3b('0x34')]=function(_0x5bcafa,_0x4d953e){if(_0x5bcafa[_0x7a3b('0x59')]['id']){delete _0x5bcafa[_0x7a3b('0x59')]['id'];}return db[_0x7a3b('0x3b')][_0x7a3b('0x58')]({'where':{'id':_0x5bcafa[_0x7a3b('0x5a')]['id']}})[_0x7a3b('0x21')](handleEntityNotFound(_0x4d953e,null))['then'](saveUpdates(_0x5bcafa[_0x7a3b('0x59')],null))[_0x7a3b('0x21')](respondWithResult(_0x4d953e,null))[_0x7a3b('0x2a')](handleError(_0x4d953e,null));};exports[_0x7a3b('0x35')]=function(_0x3a7614,_0x39077d){return db['FaxMessage'][_0x7a3b('0x58')]({'where':{'id':_0x3a7614[_0x7a3b('0x5a')]['id']}})[_0x7a3b('0x21')](handleEntityNotFound(_0x39077d,null))[_0x7a3b('0x21')](removeEntity(_0x39077d,null))[_0x7a3b('0x2a')](handleError(_0x39077d,null));};exports['describe']=function(_0xcc1d43,_0x49ca8e){return db[_0x7a3b('0x3b')][_0x7a3b('0x5b')]()[_0x7a3b('0x21')](respondWithResult(_0x49ca8e,null))[_0x7a3b('0x2a')](handleError(_0x49ca8e,null));};var interaction_log=require(_0x7a3b('0x14'))(_0x7a3b('0x5c'));exports[_0x7a3b('0x5d')]=function(_0x36d960,_0x52d6b4,_0x48bcf4){var _0x1bedd7={'channel':_0x7a3b('0x5e')};if(_0x36d960[_0x7a3b('0x59')]['id']){delete _0x36d960[_0x7a3b('0x59')]['id'];}_0x36d960[_0x7a3b('0x59')][_0x7a3b('0x5f')]=!![];_0x36d960[_0x7a3b('0x59')][_0x7a3b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36d960[_0x7a3b('0x59')]['UserId']=_0x36d960['body'][_0x7a3b('0x61')]||_0x36d960[_0x7a3b('0x62')]['id'];return db['FaxMessage']['find']({'where':{'id':_0x36d960['params']['id'],'UserId':null},'include':[{'model':db[_0x7a3b('0x63')],'as':_0x7a3b('0x64')}]})[_0x7a3b('0x21')](handleEntityNotFound(_0x52d6b4,null))[_0x7a3b('0x21')](saveUpdates(_0x36d960['body'],null))[_0x7a3b('0x21')](function(_0x2aa0f1){if(_0x2aa0f1){_0x1bedd7[_0x7a3b('0x28')]=_0x2aa0f1[_0x7a3b('0x65')]({'plain':!![]});return db[_0x7a3b('0x66')]['find']({'where':{'id':_0x2aa0f1['FaxInteractionId']}});}return null;})[_0x7a3b('0x21')](handleEntityNotFound(_0x52d6b4,null))[_0x7a3b('0x21')](function(_0x3a5685){if(_0x3a5685){return _0x3a5685['update']({'UserId':_0x36d960['body'][_0x7a3b('0x61')],'read1stAt':_[_0x7a3b('0x67')](_0x3a5685[_0x7a3b('0x68')])?moment()[_0x7a3b('0x69')](_0x7a3b('0x6a')):undefined});}return null;})[_0x7a3b('0x21')](function(_0x293277){if(_0x293277){_0x1bedd7[_0x7a3b('0x6b')]=_0x293277[_0x7a3b('0x65')]({'plain':!![]});interaction_log['info'](_0x7a3b('0x6c'),_0x36d960[_0x7a3b('0x62')]['id'],_0x36d960[_0x7a3b('0x62')][_0x7a3b('0x38')],_0x36d960[_0x7a3b('0x62')][_0x7a3b('0x6d')],_0x1bedd7[_0x7a3b('0x6b')]['id'],_0x36d960[_0x7a3b('0x59')]?JSON[_0x7a3b('0x25')](_0x36d960[_0x7a3b('0x59')]):_0x7a3b('0x6e'));return respondWithRpcPromise(_0x7a3b('0x6f'),_0x7a3b('0x70'),_0x1bedd7);}return null;})[_0x7a3b('0x21')](function(_0xbf8d5b){if(_0xbf8d5b){if(_0x36d960[_0x7a3b('0x59')][_0x7a3b('0x71')]){_0x1bedd7[_0x7a3b('0x28')][_0x7a3b('0x72')]=util[_0x7a3b('0x69')]('SIP/%s',_0x36d960[_0x7a3b('0x62')][_0x7a3b('0x38')]);_0x1bedd7[_0x7a3b('0x28')]['channel']=_0x1bedd7[_0x7a3b('0x73')];_0x1bedd7[_0x7a3b('0x28')][_0x7a3b('0x74')]=_0x7a3b('0x5d');return respondWithRpcPromise(_0x7a3b('0x75'),'EventManager',{'event':'acceptmessage','message':_0x1bedd7['message']},client9002)[_0x7a3b('0x21')](function(){return _0x1bedd7;});}return _0x1bedd7;}return null;})['then'](respondWithResult(_0x52d6b4,null))['catch'](handleError(_0x52d6b4,null));};var interaction_log=require(_0x7a3b('0x14'))('fax-interactions');exports[_0x7a3b('0x33')]=function(_0x5cf17e,_0x245031,_0x780ba){var _0x42388c={'agent':{},'channel':_0x7a3b('0x5e')};if(_0x5cf17e[_0x7a3b('0x59')]['id']){delete _0x5cf17e[_0x7a3b('0x59')]['id'];}_0x5cf17e[_0x7a3b('0x59')]['UserId']=_0x5cf17e[_0x7a3b('0x59')][_0x7a3b('0x61')]||_0x5cf17e[_0x7a3b('0x62')]['id'];_0x42388c[_0x7a3b('0x76')]['id']=_0x5cf17e[_0x7a3b('0x59')][_0x7a3b('0x61')];return db[_0x7a3b('0x3b')][_0x7a3b('0x58')]({'where':{'id':_0x5cf17e[_0x7a3b('0x5a')]['id'],'UserId':null}})[_0x7a3b('0x21')](handleEntityNotFound(_0x245031,null))[_0x7a3b('0x21')](function(_0x51a046){if(_0x51a046){_0x42388c[_0x7a3b('0x28')]=_0x51a046[_0x7a3b('0x65')]({'plain':!![]});return db[_0x7a3b('0x66')][_0x7a3b('0x58')]({'where':{'id':_0x51a046[_0x7a3b('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x245031,null))[_0x7a3b('0x21')](function(_0x176204){if(_0x176204){_0x42388c['interaction']=_0x176204['get']({'plain':!![]});interaction_log['info'](_0x7a3b('0x78'),_0x5cf17e[_0x7a3b('0x62')]['id'],_0x5cf17e['user']['name'],_0x5cf17e['user']['role'],_0x42388c[_0x7a3b('0x6b')]['id'],_0x5cf17e[_0x7a3b('0x59')]?JSON[_0x7a3b('0x25')](_0x5cf17e[_0x7a3b('0x59')]):'null');return respondWithRpcPromise(_0x7a3b('0x79'),_0x7a3b('0x7a'),_0x42388c);}return null;})['then'](function(_0x5c504a){if(_0x5c504a){_0x5c504a[_0x7a3b('0x28')]['interface']=util['format']('SIP/%s',_0x5cf17e[_0x7a3b('0x62')][_0x7a3b('0x38')]);_0x5c504a[_0x7a3b('0x28')][_0x7a3b('0x73')]=_0x42388c[_0x7a3b('0x73')];_0x5c504a[_0x7a3b('0x28')][_0x7a3b('0x74')]=_0x7a3b('0x33');respondWithRpcPromise(_0x7a3b('0x75'),_0x7a3b('0x75'),{'event':'rejectmessage','message':_0x5c504a[_0x7a3b('0x28')]},client9002);return _0x42388c;}return null;})[_0x7a3b('0x21')](respondWithResult(_0x245031,null))[_0x7a3b('0x2a')](handleError(_0x245031,null));};exports[_0x7a3b('0x7b')]=function(_0x10f99a,_0x49da04){var _0x5493f3;return db[_0x7a3b('0x3b')]['create'](_0x10f99a[_0x7a3b('0x59')],{})[_0x7a3b('0x21')](function(_0x49ca88){_0x5493f3=_0x49ca88;return db[_0x7a3b('0x63')][_0x7a3b('0x7c')]({'where':{'id':_0x5493f3['ContactId']}});})[_0x7a3b('0x21')](function(_0x5d69e3){if(_['isNil'](_0x5d69e3)){return;}else{_0x5493f3[_0x7a3b('0x5e')]=_0x5d69e3[_0x7a3b('0x5e')];return db[_0x7a3b('0x7d')][_0x7a3b('0x7c')]({'where':{'id':_0x5493f3['AttachmentId']}});}})[_0x7a3b('0x21')](function(_0x18e1c5){return respondWithRpcPromise(_0x7a3b('0x7e'),'SendFax',{'FaxAccountId':_[_0x7a3b('0x67')](_0x10f99a['body'])?undefined:_0x10f99a[_0x7a3b('0x59')][_0x7a3b('0x7f')],'path':_['isNil'](_0x18e1c5)?undefined:util[_0x7a3b('0x69')](_0x7a3b('0x80'),_0x18e1c5['basename']),'fax':_[_0x7a3b('0x67')](_0x5493f3[_0x7a3b('0x5e')])?undefined:_0x5493f3['fax'],'AttachmentId':_0x5493f3[_0x7a3b('0x81')]},client9002);})[_0x7a3b('0x21')](respondWithResult(_0x49da04,0xc9))[_0x7a3b('0x2a')](handleError(_0x49da04,null));};exports[_0x7a3b('0x82')]=function(_0x537518,_0x203279){var _0x490e7e=path['join'](config[_0x7a3b('0x83')],'server',_0x7a3b('0x84'),'attachments');return db[_0x7a3b('0x3b')][_0x7a3b('0x58')]({'where':{'id':_0x537518['params']['id']},'include':[{'model':db[_0x7a3b('0x7d')],'as':_0x7a3b('0x7d')}]})['then'](handleEntityNotFound(_0x203279,null))[_0x7a3b('0x21')](function(_0x24964a){if(_0x24964a){return _0x203279[_0x7a3b('0x82')](path[_0x7a3b('0x85')](_0x490e7e,_0x24964a[_0x7a3b('0x7d')][_0x7a3b('0x86')]));}})['catch'](handleError(_0x203279,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 1d1977e..226b223 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 _0x2a64=['hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit'];(function(_0x76a80e,_0x3b1cb8){var _0x253724=function(_0x3f71ab){while(--_0x3f71ab){_0x76a80e['push'](_0x76a80e['shift']());}};_0x253724(++_0x3b1cb8);}(_0x2a64,0xc1));var _0x42a6=function(_0x2f86c0,_0xdf9166){_0x2f86c0=_0x2f86c0-0x0;var _0x463de3=_0x2a64[_0x2f86c0];return _0x463de3;};'use strict';var EventEmitter=require(_0x42a6('0x0'));var FaxMessage=require(_0x42a6('0x1'))['db'][_0x42a6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x42a6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x42a6('0x4'),'afterDestroy':_0x42a6('0x5')};function emitEvent(_0x5b942c){return function(_0x37f6d0,_0x389bf2,_0x3ffb40){FaxMessageEvents[_0x42a6('0x6')](_0x5b942c+':'+_0x37f6d0['id'],_0x37f6d0);FaxMessageEvents[_0x42a6('0x6')](_0x5b942c,_0x37f6d0);_0x3ffb40(null);};}for(var e in events){if(events[_0x42a6('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xac40=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x29fd5e,_0x26c530){var _0x5a5a03=function(_0x262117){while(--_0x262117){_0x29fd5e['push'](_0x29fd5e['shift']());}};_0x5a5a03(++_0x26c530);}(_0xac40,0x178));var _0x0ac4=function(_0x5b33a1,_0x21e008){_0x5b33a1=_0x5b33a1-0x0;var _0x2038df=_0xac40[_0x5b33a1];return _0x2038df;};'use strict';var EventEmitter=require(_0x0ac4('0x0'));var FaxMessage=require(_0x0ac4('0x1'))['db'][_0x0ac4('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0ac4('0x3')](0x0);var events={'afterCreate':_0x0ac4('0x4'),'afterUpdate':_0x0ac4('0x5'),'afterDestroy':_0x0ac4('0x6')};function emitEvent(_0x1c67dc){return function(_0x3c8963,_0x8c47ef,_0x36effd){FaxMessageEvents[_0x0ac4('0x7')](_0x1c67dc+':'+_0x3c8963['id'],_0x3c8963);FaxMessageEvents[_0x0ac4('0x7')](_0x1c67dc,_0x3c8963);_0x36effd(null);};}for(var e in events){if(events[_0x0ac4('0x8')](e)){var event=events[e];FaxMessage[_0x0ac4('0x9')](e,emitEvent(event));}}module[_0x0ac4('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 2137c68..40c016a 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 _0xb416=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','body','catch'];(function(_0x529587,_0x7b9e47){var _0x4ea039=function(_0x51cf40){while(--_0x51cf40){_0x529587['push'](_0x529587['shift']());}};_0x4ea039(++_0x7b9e47);}(_0xb416,0x80));var _0x6b41=function(_0x5f1436,_0x3185f4){_0x5f1436=_0x5f1436-0x0;var _0x1b78c2=_0xb416[_0x5f1436];return _0x1b78c2;};'use strict';var _=require(_0x6b41('0x0'));var util=require(_0x6b41('0x1'));var logger=require(_0x6b41('0x2'))(_0x6b41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b41('0x4'));var attributes=require(_0x6b41('0x5'));module[_0x6b41('0x6')]=function(_0x4c3e76,_0x5c351f){return _0x4c3e76[_0x6b41('0x7')](_0x6b41('0x8'),attributes,{'tableName':_0x6b41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2812c7,_0x53258e,_0xb0d056){var _0xee8923=_0x4c3e76['models'];var _0x4acd6f=_0x2812c7[_0x6b41('0xa')]({'plain':!![]});if(_0x4acd6f[_0x6b41('0xb')][_0x6b41('0xc')]()==='in'||_0x4acd6f[_0x6b41('0xb')][_0x6b41('0xc')]()===_0x6b41('0xd')&&!_0x4acd6f[_0x6b41('0xe')]&&!_[_0x6b41('0xf')](_0x4acd6f[_0x6b41('0x10')])){_0xee8923['FaxInteraction'][_0x6b41('0x11')]({'where':{'id':_0x4acd6f[_0x6b41('0x12')]}})['then'](function(_0x14ba6b){if(_0x14ba6b){_0x14ba6b[_0x6b41('0x13')]({'lastMsgAt':_0x4acd6f['createdAt'],'lastMsgDirection':_0x4acd6f[_0x6b41('0xb')][_0x6b41('0xc')](),'lastMsgBody':_0x4acd6f[_0x6b41('0x14')]});}})[_0x6b41('0x15')](function(_0x3efbbd){console[_0x6b41('0x16')](_0x3efbbd);});}_0xb0d056();}},'charset':_0x6b41('0x17'),'collate':_0x6b41('0x18')});}; \ No newline at end of file +var _0xb663=['body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','./faxMessage.attributes','define','FaxMessage','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','then','update'];(function(_0x437eba,_0xd78e3){var _0x619999=function(_0x347274){while(--_0x347274){_0x437eba['push'](_0x437eba['shift']());}};_0x619999(++_0xd78e3);}(_0xb663,0x65));var _0x3b66=function(_0x55d1b0,_0x46fb94){_0x55d1b0=_0x55d1b0-0x0;var _0x17c5f7=_0xb663[_0x55d1b0];return _0x17c5f7;};'use strict';var _=require(_0x3b66('0x0'));var util=require(_0x3b66('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3b66('0x2'));var BPromise=require(_0x3b66('0x3'));var rp=require(_0x3b66('0x4'));var attributes=require(_0x3b66('0x5'));module['exports']=function(_0x1e3203,_0x430f75){return _0x1e3203[_0x3b66('0x6')](_0x3b66('0x7'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29f4ba,_0xc78eef,_0x562c4f){var _0x256d9a=_0x1e3203[_0x3b66('0x8')];var _0x3731f1=_0x29f4ba[_0x3b66('0x9')]({'plain':!![]});if(_0x3731f1[_0x3b66('0xa')][_0x3b66('0xb')]()==='in'||_0x3731f1[_0x3b66('0xa')][_0x3b66('0xb')]()===_0x3b66('0xc')&&!_0x3731f1[_0x3b66('0xd')]&&!_['isNil'](_0x3731f1[_0x3b66('0xe')])){_0x256d9a[_0x3b66('0xf')][_0x3b66('0x10')]({'where':{'id':_0x3731f1['FaxInteractionId']}})[_0x3b66('0x11')](function(_0xd3fcac){if(_0xd3fcac){_0xd3fcac[_0x3b66('0x12')]({'lastMsgAt':_0x3731f1['createdAt'],'lastMsgDirection':_0x3731f1[_0x3b66('0xa')][_0x3b66('0xb')](),'lastMsgBody':_0x3731f1[_0x3b66('0x13')]});}})[_0x3b66('0x14')](function(_0x2abd67){console[_0x3b66('0x15')](_0x2abd67);});}_0x562c4f();}},'charset':_0x3b66('0x16'),'collate':_0x3b66('0x17')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 1880cec..7fdfe00 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 _0x7c1f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxMessage','create','options','CreateFaxMessage','update','body','attributes','UpdateFaxMessage','lodash','util','moment'];(function(_0x90162a,_0x54c4a8){var _0x19fc77=function(_0x26cfba){while(--_0x26cfba){_0x90162a['push'](_0x90162a['shift']());}};_0x19fc77(++_0x54c4a8);}(_0x7c1f,0x194));var _0xf7c1=function(_0x1e50ce,_0x34608f){_0x1e50ce=_0x1e50ce-0x0;var _0x1f9bce=_0x7c1f[_0x1e50ce];return _0x1f9bce;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require(_0xf7c1('0x3'));var rs=require(_0xf7c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7c1('0x5'))['db'];var utils=require(_0xf7c1('0x6'));var logger=require(_0xf7c1('0x7'))('rpc');var config=require(_0xf7c1('0x8'));var jayson=require(_0xf7c1('0x9'));var client=jayson[_0xf7c1('0xa')][_0xf7c1('0xb')]({'port':0x232a});config['redis']=_[_0xf7c1('0xc')](config[_0xf7c1('0xd')],{'host':_0xf7c1('0xe'),'port':0x18eb});var socket=require(_0xf7c1('0xf'))(new Redis(config[_0xf7c1('0xd')]));require(_0xf7c1('0x10'))[_0xf7c1('0x11')](socket);function respondWithRpcPromise(_0x211033,_0x118dfb,_0x1a4415){return new BPromise(function(_0x914382,_0x2584d7){return client['request'](_0x211033,_0x1a4415)[_0xf7c1('0x12')](function(_0x407fde){logger[_0xf7c1('0x13')](_0xf7c1('0x14'),_0x118dfb,_0xf7c1('0x15'));logger[_0xf7c1('0x16')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x118dfb,'request\x20sent',JSON[_0xf7c1('0x17')](_0x407fde));if(_0x407fde['error']){if(_0x407fde[_0xf7c1('0x18')][_0xf7c1('0x19')]===0x1f4){logger['error'](_0xf7c1('0x14'),_0x118dfb,_0x407fde['error'][_0xf7c1('0x1a')]);return _0x2584d7(_0x407fde[_0xf7c1('0x18')][_0xf7c1('0x1a')]);}logger[_0xf7c1('0x18')](_0xf7c1('0x14'),_0x118dfb,_0x407fde['error'][_0xf7c1('0x1a')]);return _0x914382(_0x407fde['error'][_0xf7c1('0x1a')]);}else{logger['info'](_0xf7c1('0x14'),_0x118dfb,_0xf7c1('0x15'));_0x914382(_0x407fde[_0xf7c1('0x1b')][_0xf7c1('0x1a')]);}})[_0xf7c1('0x1c')](function(_0x3e4124){logger[_0xf7c1('0x18')](_0xf7c1('0x14'),_0x118dfb,_0x3e4124);_0x2584d7(_0x3e4124);});});}exports['CreateFaxMessage']=function(_0x59f0d2){var _0x151b11=this;return new Promise(function(_0x3fd7fc,_0x4ee91e){return db[_0xf7c1('0x1d')][_0xf7c1('0x1e')](_0x59f0d2['body'],{'raw':_0x59f0d2[_0xf7c1('0x1f')]?_0x59f0d2['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4333f0){logger[_0xf7c1('0x13')]('CreateFaxMessage',_0x59f0d2);logger[_0xf7c1('0x16')](_0xf7c1('0x20'),_0x59f0d2,JSON[_0xf7c1('0x17')](_0x4333f0));_0x3fd7fc(_0x4333f0);})[_0xf7c1('0x1c')](function(_0x37b8d8){logger[_0xf7c1('0x18')](_0xf7c1('0x20'),_0x37b8d8[_0xf7c1('0x1a')],_0x59f0d2);_0x4ee91e(_0x151b11['error'](0x1f4,_0x37b8d8['message']));});});};exports['UpdateFaxMessage']=function(_0x491d4f){var _0x2802bf=this;return new Promise(function(_0x14ecef,_0x374efc){return db[_0xf7c1('0x1d')][_0xf7c1('0x21')](_0x491d4f[_0xf7c1('0x22')],{'raw':_0x491d4f[_0xf7c1('0x1f')]?_0x491d4f[_0xf7c1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x491d4f[_0xf7c1('0x1f')]?_0x491d4f[_0xf7c1('0x1f')]['where']||null:null,'attributes':_0x491d4f[_0xf7c1('0x1f')]?_0x491d4f[_0xf7c1('0x1f')][_0xf7c1('0x23')]||null:null,'limit':_0x491d4f[_0xf7c1('0x1f')]?_0x491d4f[_0xf7c1('0x1f')]['limit']||null:null})[_0xf7c1('0x12')](function(_0x5b01b4){logger[_0xf7c1('0x13')](_0xf7c1('0x24'),_0x491d4f);logger[_0xf7c1('0x16')]('UpdateFaxMessage',_0x491d4f,JSON[_0xf7c1('0x17')](_0x5b01b4));_0x14ecef(_0x5b01b4);})[_0xf7c1('0x1c')](function(_0x59c534){logger['error'](_0xf7c1('0x24'),_0x59c534[_0xf7c1('0x1a')],_0x491d4f);_0x374efc(_0x2802bf[_0xf7c1('0x18')](0x1f4,_0x59c534[_0xf7c1('0x1a')]));});});}; \ No newline at end of file +var _0x96aa=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','create','options','raw','then','UpdateFaxMessage','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x96aa,0x67));var _0xa96a=function(_0x777d08,_0x645da8){_0x777d08=_0x777d08-0x0;var _0x1b7e1b=_0x96aa[_0x777d08];return _0x1b7e1b;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var moment=require('moment');var BPromise=require(_0xa96a('0x2'));var rs=require(_0xa96a('0x3'));var fs=require('fs');var Redis=require(_0xa96a('0x4'));var db=require(_0xa96a('0x5'))['db'];var utils=require(_0xa96a('0x6'));var logger=require('../../config/logger')(_0xa96a('0x7'));var config=require(_0xa96a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa96a('0x9')][_0xa96a('0xa')]({'port':0x232a});config[_0xa96a('0xb')]=_[_0xa96a('0xc')](config[_0xa96a('0xb')],{'host':_0xa96a('0xd'),'port':0x18eb});var socket=require(_0xa96a('0xe'))(new Redis(config[_0xa96a('0xb')]));require(_0xa96a('0xf'))[_0xa96a('0x10')](socket);function respondWithRpcPromise(_0x13321e,_0x4825fc,_0x33b786){return new BPromise(function(_0x5532f2,_0x234d1a){return client[_0xa96a('0x11')](_0x13321e,_0x33b786)['then'](function(_0x32393a){logger[_0xa96a('0x12')](_0xa96a('0x13'),_0x4825fc,_0xa96a('0x14'));logger[_0xa96a('0x15')](_0xa96a('0x16'),_0x4825fc,_0xa96a('0x14'),JSON[_0xa96a('0x17')](_0x32393a));if(_0x32393a[_0xa96a('0x18')]){if(_0x32393a[_0xa96a('0x18')][_0xa96a('0x19')]===0x1f4){logger[_0xa96a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x4825fc,_0x32393a['error'][_0xa96a('0x1a')]);return _0x234d1a(_0x32393a['error'][_0xa96a('0x1a')]);}logger['error'](_0xa96a('0x13'),_0x4825fc,_0x32393a[_0xa96a('0x18')][_0xa96a('0x1a')]);return _0x5532f2(_0x32393a[_0xa96a('0x18')][_0xa96a('0x1a')]);}else{logger[_0xa96a('0x12')]('FaxMessage,\x20%s,\x20%s',_0x4825fc,_0xa96a('0x14'));_0x5532f2(_0x32393a[_0xa96a('0x1b')]['message']);}})[_0xa96a('0x1c')](function(_0x33298e){logger[_0xa96a('0x18')](_0xa96a('0x13'),_0x4825fc,_0x33298e);_0x234d1a(_0x33298e);});});}exports[_0xa96a('0x1d')]=function(_0x14c8e5){var _0x4e3f58=this;return new Promise(function(_0x190e94,_0x3f41ad){return db['FaxMessage'][_0xa96a('0x1e')](_0x14c8e5['body'],{'raw':_0x14c8e5[_0xa96a('0x1f')]?_0x14c8e5['options'][_0xa96a('0x20')]===undefined?!![]:![]:!![]})[_0xa96a('0x21')](function(_0x484ee7){logger['info'](_0xa96a('0x1d'),_0x14c8e5);logger[_0xa96a('0x15')](_0xa96a('0x1d'),_0x14c8e5,JSON[_0xa96a('0x17')](_0x484ee7));_0x190e94(_0x484ee7);})[_0xa96a('0x1c')](function(_0x7ea334){logger['error']('CreateFaxMessage',_0x7ea334[_0xa96a('0x1a')],_0x14c8e5);_0x3f41ad(_0x4e3f58['error'](0x1f4,_0x7ea334[_0xa96a('0x1a')]));});});};exports[_0xa96a('0x22')]=function(_0x23d4fd){var _0x573ea7=this;return new Promise(function(_0x171450,_0x485fb1){return db['FaxMessage'][_0xa96a('0x23')](_0x23d4fd['body'],{'raw':_0x23d4fd[_0xa96a('0x1f')]?_0x23d4fd[_0xa96a('0x1f')][_0xa96a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d4fd['options']?_0x23d4fd[_0xa96a('0x1f')]['where']||null:null,'attributes':_0x23d4fd['options']?_0x23d4fd[_0xa96a('0x1f')]['attributes']||null:null,'limit':_0x23d4fd['options']?_0x23d4fd[_0xa96a('0x1f')][_0xa96a('0x24')]||null:null})['then'](function(_0x34ef72){logger[_0xa96a('0x12')](_0xa96a('0x22'),_0x23d4fd);logger[_0xa96a('0x15')](_0xa96a('0x22'),_0x23d4fd,JSON['stringify'](_0x34ef72));_0x171450(_0x34ef72);})[_0xa96a('0x1c')](function(_0x17b6e9){logger['error'](_0xa96a('0x22'),_0x17b6e9[_0xa96a('0x1a')],_0x23d4fd);_0x485fb1(_0x573ea7[_0xa96a('0x18')](0x1f4,_0x17b6e9[_0xa96a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e30fc2a..9ef83be 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 _0x55a5=['remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x55a5,0xf7));var _0x555a=function(_0x2f4d41,_0x525047){_0x2f4d41=_0x2f4d41-0x0;var _0x3b0bb2=_0x55a5[_0x2f4d41];return _0x3b0bb2;};'use strict';var FaxMessageEvents=require(_0x555a('0x0'));var events=['save',_0x555a('0x1'),_0x555a('0x2')];function createListener(_0x44ec0a,_0x287b84){return function(_0x428212){_0x287b84[_0x555a('0x3')](_0x44ec0a,_0x428212);};}function removeListener(_0x4456c7,_0x1dbfe0){return function(){FaxMessageEvents[_0x555a('0x4')](_0x4456c7,_0x1dbfe0);};}exports[_0x555a('0x5')]=function(_0x2b0126){for(var _0x32f440=0x0,_0x365c37=events[_0x555a('0x6')];_0x32f440<_0x365c37;_0x32f440++){var _0x475b8d=events[_0x32f440];var _0x4b5b8e=createListener(_0x555a('0x7')+_0x475b8d,_0x2b0126);FaxMessageEvents['on'](_0x475b8d,_0x4b5b8e);}}; \ No newline at end of file +var _0x5e67=['./faxMessage.events','save','remove','update','emit','removeListener','register','faxMessage:'];(function(_0x2711fb,_0x525b00){var _0x2312dd=function(_0x401bb3){while(--_0x401bb3){_0x2711fb['push'](_0x2711fb['shift']());}};_0x2312dd(++_0x525b00);}(_0x5e67,0x70));var _0x75e6=function(_0x4d5776,_0x349e46){_0x4d5776=_0x4d5776-0x0;var _0x12f33d=_0x5e67[_0x4d5776];return _0x12f33d;};'use strict';var FaxMessageEvents=require(_0x75e6('0x0'));var events=[_0x75e6('0x1'),_0x75e6('0x2'),_0x75e6('0x3')];function createListener(_0x2f7528,_0x2d5d89){return function(_0x1da44c){_0x2d5d89[_0x75e6('0x4')](_0x2f7528,_0x1da44c);};}function removeListener(_0x1dbb1f,_0x3cfdcb){return function(){FaxMessageEvents[_0x75e6('0x5')](_0x1dbb1f,_0x3cfdcb);};}exports[_0x75e6('0x6')]=function(_0x4d23fc){for(var _0x47d757=0x0,_0x58c638=events['length'];_0x47d757<_0x58c638;_0x47d757++){var _0x383b2a=events[_0x47d757];var _0x534504=createListener(_0x75e6('0x7')+_0x383b2a,_0x4d23fc);FaxMessageEvents['on'](_0x383b2a,_0x534504);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 0beacef..4e1cf7c 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','post','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x70588,_0x2e21dd){var _0x1981d8=function(_0x5bbfb6){while(--_0x5bbfb6){_0x70588['push'](_0x70588['shift']());}};_0x1981d8(++_0x2e21dd);}(_0x7a54,0x106));var _0x47a5=function(_0x410014,_0x12ed20){_0x410014=_0x410014-0x0;var _0x126e91=_0x7a54[_0x410014];return _0x126e91;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['download']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x47a5('0xe'),_0x47a5('0xf')),controller[_0x47a5('0x10')]);router[_0x47a5('0x11')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);router['put'](_0x47a5('0x13'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x14')]);router[_0x47a5('0x11')](_0x47a5('0x15'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x16')]);router[_0x47a5('0x17')]('/:id',auth[_0x47a5('0x9')](),controller[_0x47a5('0x18')]);module[_0x47a5('0x19')]=router; \ No newline at end of file +var _0x6343=['put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','path','connect-timeout','../../config/environment','./faxMessage.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/download','tracked','faxmessage:create','create'];(function(_0x24bee5,_0x501777){var _0x295b0f=function(_0x1d36aa){while(--_0x1d36aa){_0x24bee5['push'](_0x24bee5['shift']());}};_0x295b0f(++_0x501777);}(_0x6343,0x168));var _0x3634=function(_0x2c0063,_0x320c19){_0x2c0063=_0x2c0063-0x0;var _0x34a136=_0x6343[_0x2c0063];return _0x34a136;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3634('0x2'));var controller=require(_0x3634('0x3'));router['get']('/',auth[_0x3634('0x4')](),controller[_0x3634('0x5')]);router['get'](_0x3634('0x6'),auth[_0x3634('0x4')](),controller['describe']);router['get'](_0x3634('0x7'),auth[_0x3634('0x4')](),controller[_0x3634('0x8')]);router[_0x3634('0x9')](_0x3634('0xa'),auth[_0x3634('0x4')](),controller['download']);router['post']('/',auth[_0x3634('0x4')](),interaction[_0x3634('0xb')]('fax',_0x3634('0xc')),controller[_0x3634('0xd')]);router[_0x3634('0xe')](_0x3634('0x7'),auth[_0x3634('0x4')](),controller[_0x3634('0xf')]);router[_0x3634('0xe')](_0x3634('0x10'),auth[_0x3634('0x4')](),controller[_0x3634('0x11')]);router[_0x3634('0xe')](_0x3634('0x12'),auth[_0x3634('0x4')](),controller[_0x3634('0x13')]);router['delete'](_0x3634('0x7'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);module[_0x3634('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0ebe941..23222f4 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 _0xb8e6=['beepall','roundrobin','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb8e6,0x1e5));var _0x6b8e=function(_0x9d486e,_0xa8f2ab){_0x9d486e=_0x9d486e-0x0;var _0x23cedc=_0xb8e6[_0x9d486e];return _0x23cedc;};'use strict';var Sequelize=require('sequelize');module[_0x6b8e('0x0')]={'name':{'type':Sequelize[_0x6b8e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6b8e('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6b8e('0x3')](_0x6b8e('0x4'),_0x6b8e('0x5'),_0x6b8e('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6b8e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5861=['name','INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x54f79b,_0x33898e){var _0x23bc1b=function(_0x3372dc){while(--_0x3372dc){_0x54f79b['push'](_0x54f79b['shift']());}};_0x23bc1b(++_0x33898e);}(_0x5861,0x154));var _0x1586=function(_0x52928d,_0xd5a28b){_0x52928d=_0x52928d-0x0;var _0x2ce6fa=_0x5861[_0x52928d];return _0x2ce6fa;};'use strict';var Sequelize=require(_0x1586('0x0'));module[_0x1586('0x1')]={'name':{'type':Sequelize[_0x1586('0x2')],'unique':_0x1586('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1586('0x2')]},'timeout':{'type':Sequelize[_0x1586('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1586('0x5')](_0x1586('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1586('0x4')],'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 6e0226f..ce5067c 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 _0xcea5=['addTeams','ids','Agents','addAgents','removeTeams','union','omit','spread','emit','removeAgents','isArray','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','FaxQueues','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','FaxQueue','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','params','describe','getMembers','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','findOne','Team'];(function(_0x40c8e7,_0x4ff7bb){var _0x26b8c7=function(_0x33843a){while(--_0x33843a){_0x40c8e7['push'](_0x40c8e7['shift']());}};_0x26b8c7(++_0x4ff7bb);}(_0xcea5,0xed));var _0x5cea=function(_0x3bb574,_0x12a4cd){_0x3bb574=_0x3bb574-0x0;var _0x42bac6=_0xcea5[_0x3bb574];return _0x42bac6;};'use strict';var pdf=require(_0x5cea('0x0'));var emlformat=require(_0x5cea('0x1'));var rimraf=require(_0x5cea('0x2'));var zipdir=require(_0x5cea('0x3'));var jsonpatch=require(_0x5cea('0x4'));var rp=require('request-promise');var moment=require(_0x5cea('0x5'));var BPromise=require(_0x5cea('0x6'));var Mustache=require(_0x5cea('0x7'));var util=require(_0x5cea('0x8'));var path=require('path');var sox=require(_0x5cea('0x9'));var csv=require(_0x5cea('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5cea('0xb'));var deskjs=require(_0x5cea('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5cea('0xd'));var Papa=require('papaparse');var authService=require(_0x5cea('0xe'));var hardwareService=require(_0x5cea('0xf'));var Redis=require(_0x5cea('0x10'));var qs=require(_0x5cea('0x11'));var logger=require(_0x5cea('0x12'))(_0x5cea('0x13'));var utils=require(_0x5cea('0x14'));var config=require(_0x5cea('0x15'));var db=require('../../mysqldb')['db'];config[_0x5cea('0x16')]=_[_0x5cea('0x17')](config[_0x5cea('0x16')],{'host':_0x5cea('0x18'),'port':0x18eb});var socket=require(_0x5cea('0x19'))(new Redis(config[_0x5cea('0x16')]));require(_0x5cea('0x1a'))[_0x5cea('0x1b')](socket);function respondWithStatusCode(_0x2925ec,_0x36684d){_0x36684d=_0x36684d||0xcc;return function(_0x166105){if(_0x166105){return _0x2925ec[_0x5cea('0x1c')](_0x36684d);}return _0x2925ec[_0x5cea('0x1d')](_0x36684d)[_0x5cea('0x1e')]();};}function respondWithResult(_0x1077d6,_0x84a9c4){_0x84a9c4=_0x84a9c4||0xc8;return function(_0x1c9a30){if(_0x1c9a30){return _0x1077d6[_0x5cea('0x1d')](_0x84a9c4)[_0x5cea('0x1f')](_0x1c9a30);}};}function respondWithFilteredResult(_0x9a670,_0x3eee17){return function(_0x326b50){if(_0x326b50){var _0x22bc4f=_0x326b50[_0x5cea('0x20')],_0x13b434=_0x3eee17[_0x5cea('0x21')],_0xd2a67e=_0x3eee17[_0x5cea('0x21')]+_0x3eee17[_0x5cea('0x22')],_0x190b6c;if(_0xd2a67e>=_0x22bc4f){_0xd2a67e=_0x22bc4f;_0x190b6c=0xc8;}else{_0x190b6c=0xce;}_0x9a670['status'](_0x190b6c);return _0x9a670[_0x5cea('0x23')]('Content-Range',_0x13b434+'-'+_0xd2a67e+'/'+_0x22bc4f)[_0x5cea('0x1f')](_0x326b50);}return null;};}function patchUpdates(_0x462f68){return function(_0x6bf237){try{jsonpatch[_0x5cea('0x24')](_0x6bf237,_0x462f68,!![]);}catch(_0x4a4080){return BPromise[_0x5cea('0x25')](_0x4a4080);}return _0x6bf237['save']();};}function saveUpdates(_0xa8cadc,_0x219780){return function(_0x168070){if(_0x168070){return _0x168070[_0x5cea('0x26')](_0xa8cadc)[_0x5cea('0x27')](function(_0x2fdc1b){return _0x2fdc1b;});}return null;};}function removeEntity(_0x3e10a5,_0x5eabea){return function(_0x51aef9){if(_0x51aef9){return _0x51aef9[_0x5cea('0x28')]()[_0x5cea('0x27')](function(){var _0x4f91c6=_0x51aef9[_0x5cea('0x29')]({'plain':!![]});var _0x21708c=_0x5cea('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x21708c,'resourceId':_0x4f91c6['id']}})[_0x5cea('0x27')](function(){return _0x51aef9;});})[_0x5cea('0x27')](function(){_0x3e10a5[_0x5cea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x165484,_0xaddd21){return function(_0x2e9f9a){if(!_0x2e9f9a){_0x165484[_0x5cea('0x1c')](0x194);}return _0x2e9f9a;};}function handleError(_0x5d9179,_0x2ed1d2){_0x2ed1d2=_0x2ed1d2||0x1f4;return function(_0x18c4e5){logger[_0x5cea('0x2b')](_0x18c4e5[_0x5cea('0x2c')]);if(_0x18c4e5[_0x5cea('0x2d')]){delete _0x18c4e5[_0x5cea('0x2d')];}_0x5d9179[_0x5cea('0x1d')](_0x2ed1d2)[_0x5cea('0x2e')](_0x18c4e5);};}exports['index']=function(_0x5e17af,_0x2282c3){var _0x122639={},_0x2d7f85={},_0x3592ab={'count':0x0,'rows':[]};var _0x366fc7=db['FaxQueue'][_0x5cea('0x2f')];_0x2d7f85[_0x5cea('0x30')]=_[_0x5cea('0x31')](_0x366fc7);_0x2d7f85[_0x5cea('0x32')]=_[_0x5cea('0x31')](_0x5e17af[_0x5cea('0x32')]);_0x2d7f85[_0x5cea('0x33')]=_[_0x5cea('0x34')](_0x2d7f85[_0x5cea('0x30')],_0x2d7f85[_0x5cea('0x32')]);_0x122639[_0x5cea('0x35')]=_['intersection'](_0x2d7f85[_0x5cea('0x30')],qs[_0x5cea('0x36')](_0x5e17af[_0x5cea('0x32')][_0x5cea('0x36')]));_0x122639['attributes']=_0x122639[_0x5cea('0x35')][_0x5cea('0x37')]?_0x122639[_0x5cea('0x35')]:_0x2d7f85[_0x5cea('0x30')];if(!_0x5e17af[_0x5cea('0x32')][_0x5cea('0x38')](_0x5cea('0x39'))){_0x122639[_0x5cea('0x22')]=qs[_0x5cea('0x22')](_0x5e17af[_0x5cea('0x32')][_0x5cea('0x22')]);_0x122639[_0x5cea('0x21')]=qs[_0x5cea('0x21')](_0x5e17af[_0x5cea('0x32')]['offset']);}_0x122639[_0x5cea('0x3a')]=qs[_0x5cea('0x3b')](_0x5e17af[_0x5cea('0x32')][_0x5cea('0x3b')]);_0x122639[_0x5cea('0x3c')]=qs[_0x5cea('0x33')](_[_0x5cea('0x3d')](_0x5e17af['query'],_0x2d7f85[_0x5cea('0x33')]));if(_0x5e17af['query'][_0x5cea('0x3e')]){_0x122639[_0x5cea('0x3c')]=_[_0x5cea('0x3f')](_0x122639['where'],{'$or':_[_0x5cea('0x40')](_0x366fc7,function(_0x55118a){if(_0x55118a[_0x5cea('0x41')]['key']!=='VIRTUAL'){var _0x4bda52={};_0x4bda52[_0x55118a[_0x5cea('0x42')]]={'$like':'%'+_0x5e17af[_0x5cea('0x32')][_0x5cea('0x3e')]+'%'};return _0x4bda52;}})});}_0x122639=_['merge']({},_0x122639,_0x5e17af[_0x5cea('0x43')]);var _0x14e687={'where':_0x122639[_0x5cea('0x3c')]};return db['FaxQueue'][_0x5cea('0x20')](_0x14e687)[_0x5cea('0x27')](function(_0x339092){_0x3592ab[_0x5cea('0x20')]=_0x339092;if(_0x5e17af[_0x5cea('0x32')][_0x5cea('0x44')]){_0x122639[_0x5cea('0x45')]=[{'all':!![]}];}return db[_0x5cea('0x46')][_0x5cea('0x47')](_0x122639);})[_0x5cea('0x27')](function(_0x2cf066){_0x3592ab[_0x5cea('0x48')]=_0x2cf066;return _0x3592ab;})[_0x5cea('0x27')](respondWithFilteredResult(_0x2282c3,_0x122639))[_0x5cea('0x49')](handleError(_0x2282c3,null));};exports['show']=function(_0x17f195,_0x4fb750){var _0x5d35c3={'raw':!![],'where':{'id':_0x17f195['params']['id']}},_0x304bde={};_0x304bde[_0x5cea('0x30')]=_[_0x5cea('0x31')](db[_0x5cea('0x46')]['rawAttributes']);_0x304bde[_0x5cea('0x32')]=_[_0x5cea('0x31')](_0x17f195[_0x5cea('0x32')]);_0x304bde[_0x5cea('0x33')]=_[_0x5cea('0x34')](_0x304bde[_0x5cea('0x30')],_0x304bde[_0x5cea('0x32')]);_0x5d35c3['attributes']=_['intersection'](_0x304bde['model'],qs[_0x5cea('0x36')](_0x17f195[_0x5cea('0x32')][_0x5cea('0x36')]));_0x5d35c3['attributes']=_0x5d35c3['attributes'][_0x5cea('0x37')]?_0x5d35c3['attributes']:_0x304bde['model'];if(_0x17f195[_0x5cea('0x32')][_0x5cea('0x44')]){_0x5d35c3[_0x5cea('0x45')]=[{'all':!![]}];}_0x5d35c3=_['merge']({},_0x5d35c3,_0x17f195[_0x5cea('0x43')]);return db[_0x5cea('0x46')][_0x5cea('0x4a')](_0x5d35c3)['then'](handleEntityNotFound(_0x4fb750,null))['then'](respondWithResult(_0x4fb750,null))[_0x5cea('0x49')](handleError(_0x4fb750,null));};exports[_0x5cea('0x4b')]=function(_0x4fd32b,_0x183bec){return db['FaxQueue']['create'](_0x4fd32b[_0x5cea('0x4c')],{})[_0x5cea('0x27')](function(_0x458a82){var _0x7703a8=_0x4fd32b[_0x5cea('0x4d')][_0x5cea('0x29')]({'plain':!![]});if(!_0x7703a8)throw new Error(_0x5cea('0x4e'));if(_0x7703a8[_0x5cea('0x4f')]==='user'){var _0x17fb4a=_0x458a82[_0x5cea('0x29')]({'plain':!![]});var _0x37a296=_0x5cea('0x2a');return db['UserProfileSection'][_0x5cea('0x4a')]({'where':{'name':_0x37a296,'userProfileId':_0x7703a8[_0x5cea('0x50')]},'raw':!![]})[_0x5cea('0x27')](function(_0x1aed91){if(_0x1aed91&&_0x1aed91['autoAssociation']===0x0){return db['UserProfileResource'][_0x5cea('0x4b')]({'name':_0x17fb4a[_0x5cea('0x2d')],'resourceId':_0x17fb4a['id'],'type':_0x1aed91[_0x5cea('0x2d')],'sectionId':_0x1aed91['id']},{})[_0x5cea('0x27')](function(){return _0x458a82;});}else{return _0x458a82;}})[_0x5cea('0x49')](function(_0x20a917){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20a917);throw _0x20a917;});}return _0x458a82;})[_0x5cea('0x27')](respondWithResult(_0x183bec,0xc9))[_0x5cea('0x49')](handleError(_0x183bec,null));};exports[_0x5cea('0x26')]=function(_0x5b4411,_0x359b75){if(_0x5b4411[_0x5cea('0x4c')]['id']){delete _0x5b4411[_0x5cea('0x4c')]['id'];}return db['FaxQueue'][_0x5cea('0x4a')]({'where':{'id':_0x5b4411[_0x5cea('0x51')]['id']}})['then'](handleEntityNotFound(_0x359b75,null))['then'](saveUpdates(_0x5b4411[_0x5cea('0x4c')],null))[_0x5cea('0x27')](respondWithResult(_0x359b75,null))['catch'](handleError(_0x359b75,null));};exports['destroy']=function(_0x3720a0,_0x25f62f){return db['FaxQueue'][_0x5cea('0x4a')]({'where':{'id':_0x3720a0[_0x5cea('0x51')]['id']}})[_0x5cea('0x27')](handleEntityNotFound(_0x25f62f,null))[_0x5cea('0x27')](removeEntity(_0x25f62f,null))[_0x5cea('0x49')](handleError(_0x25f62f,null));};exports[_0x5cea('0x52')]=function(_0x4c1bda,_0x5e9531){return db[_0x5cea('0x46')][_0x5cea('0x52')]()[_0x5cea('0x27')](respondWithResult(_0x5e9531,null))[_0x5cea('0x49')](handleError(_0x5e9531,null));};exports[_0x5cea('0x53')]=function(_0x533711,_0x1f4acd,_0x607ece){var _0x367cfa={'raw':!![],'where':{}},_0x47438e={},_0x35cfed;return db[_0x5cea('0x46')]['findOne']({'where':{'id':_0x533711['params']['id']}})[_0x5cea('0x27')](handleEntityNotFound(_0x1f4acd,null))['then'](function(_0x300a88){if(_0x300a88){_0x35cfed=_0x300a88[_0x5cea('0x29')]({'plain':!![]});_0x47438e['model']=_['keys'](db[_0x5cea('0x54')]['rawAttributes']);_0x47438e[_0x5cea('0x32')]=_[_0x5cea('0x31')](_0x533711['query']);_0x47438e[_0x5cea('0x33')]=_[_0x5cea('0x34')](_0x47438e['model'],_0x47438e[_0x5cea('0x32')]);_0x367cfa[_0x5cea('0x35')]=_[_0x5cea('0x34')](_0x47438e[_0x5cea('0x30')],qs[_0x5cea('0x36')](_0x533711[_0x5cea('0x32')][_0x5cea('0x36')]));_0x367cfa[_0x5cea('0x35')]=_0x367cfa[_0x5cea('0x35')][_0x5cea('0x37')]?_0x367cfa[_0x5cea('0x35')]:_0x47438e['model'];if(!_0x533711[_0x5cea('0x32')][_0x5cea('0x38')]('nolimit')){_0x367cfa[_0x5cea('0x22')]=qs[_0x5cea('0x22')](_0x533711[_0x5cea('0x32')]['limit']);_0x367cfa[_0x5cea('0x21')]=qs[_0x5cea('0x21')](_0x533711[_0x5cea('0x32')][_0x5cea('0x21')]);}_0x367cfa[_0x5cea('0x3a')]=qs[_0x5cea('0x3b')](_0x533711[_0x5cea('0x32')]['sort']);_0x367cfa['where']=qs['filters'](_[_0x5cea('0x3d')](_0x533711[_0x5cea('0x32')],_0x47438e['filters']));_0x367cfa[_0x5cea('0x3c')][_0x5cea('0x55')]=_0x300a88['id'];if(_0x533711['query']['filter']){_0x367cfa[_0x5cea('0x3c')]=_[_0x5cea('0x3f')](_0x367cfa[_0x5cea('0x3c')],{'$or':_['map'](_0x367cfa[_0x5cea('0x35')],function(_0xc1ec23){var _0x20b056={};_0x20b056[_0xc1ec23]={'$like':'%'+_0x533711[_0x5cea('0x32')][_0x5cea('0x3e')]+'%'};return _0x20b056;})});}_0x367cfa=_[_0x5cea('0x3f')]({},_0x367cfa,_0x533711[_0x5cea('0x43')]);return db[_0x5cea('0x54')][_0x5cea('0x47')](_0x367cfa);}})['then'](function(_0x49b5dc){if(_0x49b5dc){return db[_0x5cea('0x56')][_0x5cea('0x57')]({'where':{'id':_[_0x5cea('0x40')](_0x49b5dc,_0x5cea('0x58')),'role':_0x5cea('0x59')},'attributes':['id',_0x5cea('0x2d'),_0x5cea('0x5a'),'updatedAt','createdAt']});}})[_0x5cea('0x27')](function(_0x94dbd3){if(_0x94dbd3){return{'count':_0x94dbd3[_0x5cea('0x20')],'rows':_['map'](_0x94dbd3[_0x5cea('0x48')],function(_0x5c7244){return{'membername':_0x5c7244[_0x5cea('0x2d')],'UserId':_0x5c7244['id'],'queue_name':_0x35cfed[_0x5cea('0x2d')],'FaxQueueId':_0x35cfed['id'],'interface':util[_0x5cea('0x5b')](_0x5cea('0x5c'),_0x5cea('0x5d'),_0x5c7244[_0x5cea('0x2d')]),'penalty':0x0,'paused':_0x5c7244[_0x5cea('0x5a')],'createdAt':_0x5c7244[_0x5cea('0x5e')],'updatedAt':_0x5c7244[_0x5cea('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5cea('0x27')](respondWithFilteredResult(_0x1f4acd,_0x367cfa))[_0x5cea('0x49')](handleError(_0x1f4acd,null));};exports[_0x5cea('0x60')]=function(_0x57511e,_0x5e7bbe,_0x5c4a30){var _0x524319={};var _0x3a5afa={};var _0x357d22;var _0x33f35b;return db['FaxQueue'][_0x5cea('0x61')]({'where':{'id':_0x57511e[_0x5cea('0x51')]['id']}})['then'](handleEntityNotFound(_0x5e7bbe,null))[_0x5cea('0x27')](function(_0x1570c9){if(_0x1570c9){_0x357d22=_0x1570c9;_0x3a5afa['model']=_[_0x5cea('0x31')](db[_0x5cea('0x62')][_0x5cea('0x2f')]);_0x3a5afa['query']=_[_0x5cea('0x31')](_0x57511e[_0x5cea('0x32')]);_0x3a5afa[_0x5cea('0x33')]=_[_0x5cea('0x34')](_0x3a5afa[_0x5cea('0x30')],_0x3a5afa[_0x5cea('0x32')]);_0x524319['attributes']=_[_0x5cea('0x34')](_0x3a5afa[_0x5cea('0x30')],qs[_0x5cea('0x36')](_0x57511e[_0x5cea('0x32')][_0x5cea('0x36')]));_0x524319[_0x5cea('0x35')]=_0x524319[_0x5cea('0x35')][_0x5cea('0x37')]?_0x524319['attributes']:_0x3a5afa[_0x5cea('0x30')];_0x524319[_0x5cea('0x3a')]=qs[_0x5cea('0x3b')](_0x57511e[_0x5cea('0x32')][_0x5cea('0x3b')]);_0x524319['where']=qs[_0x5cea('0x33')](_[_0x5cea('0x3d')](_0x57511e[_0x5cea('0x32')],_0x3a5afa[_0x5cea('0x33')]));if(_0x57511e['query']['filter']){_0x524319[_0x5cea('0x3c')]=_[_0x5cea('0x3f')](_0x524319[_0x5cea('0x3c')],{'$or':_['map'](_0x524319[_0x5cea('0x35')],function(_0x4bfb1e){var _0xc5b446={};_0xc5b446[_0x4bfb1e]={'$like':'%'+_0x57511e[_0x5cea('0x32')][_0x5cea('0x3e')]+'%'};return _0xc5b446;})});}_0x524319=_[_0x5cea('0x3f')]({},_0x524319,_0x57511e[_0x5cea('0x43')]);return _0x357d22['getTeams'](_0x524319);}})[_0x5cea('0x27')](function(_0x12be9e){if(_0x12be9e){_0x33f35b=_0x12be9e['length'];if(!_0x57511e[_0x5cea('0x32')][_0x5cea('0x38')](_0x5cea('0x39'))){_0x524319[_0x5cea('0x22')]=qs['limit'](_0x57511e[_0x5cea('0x32')][_0x5cea('0x22')]);_0x524319[_0x5cea('0x21')]=qs[_0x5cea('0x21')](_0x57511e['query']['offset']);}return _0x357d22[_0x5cea('0x60')](_0x524319);}})['then'](function(_0x575b9e){if(_0x575b9e){return _0x575b9e?{'count':_0x33f35b,'rows':_0x575b9e}:null;}})['then'](respondWithResult(_0x5e7bbe,null))[_0x5cea('0x49')](handleError(_0x5e7bbe,null));};exports[_0x5cea('0x63')]=function(_0x2edce3,_0x166f60,_0x2381de){var _0xbf3960=[];var _0xa009c2;return db[_0x5cea('0x62')]['findAll']({'where':{'id':_0x2edce3[_0x5cea('0x4c')][_0x5cea('0x64')]},'attributes':['id'],'include':[{'model':db[_0x5cea('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0x11814e){if(_0x11814e){for(var _0x12c0c6=0x0;_0x12c0c6<_0x11814e[_0x5cea('0x37')];_0x12c0c6+=0x1){for(var _0x28e8b0=0x0;_0x28e8b0<_0x11814e[_0x12c0c6][_0x5cea('0x65')][_0x5cea('0x37')];_0x28e8b0+=0x1){_0xbf3960=_['union'](_0xbf3960,[_0x11814e[_0x12c0c6][_0x5cea('0x65')][_0x28e8b0]['id']]);}}return _0xbf3960;}})['then'](function(_0x359155){if(_0x359155){return db[_0x5cea('0x46')][_0x5cea('0x4a')]({'where':{'id':_0x2edce3[_0x5cea('0x51')]['id']}});}})[_0x5cea('0x27')](function(_0x15fb07){if(_0x15fb07){_0xa009c2=_0x15fb07;return _0xa009c2[_0x5cea('0x66')](_0xbf3960,{'penalty':_0x2edce3[_0x5cea('0x4c')]['penalty']});}})[_0x5cea('0x27')](function(_0x49aa52){if(_0x49aa52){return _0xa009c2['addTeams'](_0x2edce3['body'][_0x5cea('0x64')]);}})[_0x5cea('0x27')](handleEntityNotFound(_0x166f60,null))['then'](respondWithStatusCode(_0x166f60,null))['catch'](handleError(_0x166f60,null));};exports[_0x5cea('0x67')]=function(_0x384226,_0x329654,_0x3c8ded){var _0x19dd8a=[];var _0x39a47a;return db[_0x5cea('0x62')][_0x5cea('0x47')]({'where':{'id':_0x384226['query'][_0x5cea('0x64')]},'attributes':['id'],'include':[{'model':db[_0x5cea('0x56')],'as':_0x5cea('0x65'),'attributes':['id'],'raw':!![]}]})[_0x5cea('0x27')](function(_0x26aa2c){if(_0x26aa2c){for(var _0x393c03=0x0;_0x393c03<_0x26aa2c[_0x5cea('0x37')];_0x393c03+=0x1){for(var _0x1aee52=0x0;_0x1aee52<_0x26aa2c[_0x393c03]['Agents'][_0x5cea('0x37')];_0x1aee52+=0x1){_0x19dd8a=_[_0x5cea('0x68')](_0x19dd8a,[_0x26aa2c[_0x393c03][_0x5cea('0x65')][_0x1aee52]['id']]);}}return _0x19dd8a;}})[_0x5cea('0x27')](function(_0x3abc68){if(_0x3abc68){return db[_0x5cea('0x46')][_0x5cea('0x4a')]({'where':{'id':_0x384226[_0x5cea('0x51')]['id']}});}})[_0x5cea('0x27')](function(_0x1c307f){if(_0x1c307f){_0x39a47a=_0x1c307f;return _0x39a47a['removeAgents'](_0x19dd8a);}})[_0x5cea('0x27')](function(_0x148349){if(_0x39a47a){return _0x39a47a['removeTeams'](_0x384226['query'][_0x5cea('0x64')]);}})[_0x5cea('0x27')](handleEntityNotFound(_0x329654,null))[_0x5cea('0x27')](respondWithStatusCode(_0x329654,null))[_0x5cea('0x49')](handleError(_0x329654,null));};exports[_0x5cea('0x66')]=function(_0x527c33,_0x19fcf9,_0x89d8ef){return db[_0x5cea('0x46')]['find']({'where':{'id':_0x527c33[_0x5cea('0x51')]['id']}})[_0x5cea('0x27')](handleEntityNotFound(_0x19fcf9,null))[_0x5cea('0x27')](function(_0x59751d){if(_0x59751d){return _0x59751d[_0x5cea('0x66')](_0x527c33[_0x5cea('0x4c')][_0x5cea('0x64')],_[_0x5cea('0x69')](_0x527c33['body'],[_0x5cea('0x64'),'id'])||{})[_0x5cea('0x6a')](function(_0x17e4a9){for(var _0xf1b24a=0x0;_0xf1b24a<_0x527c33[_0x5cea('0x4c')][_0x5cea('0x64')][_0x5cea('0x37')];_0xf1b24a+=0x1){socket[_0x5cea('0x6b')]('userFaxQueue:save',{'UserId':_0x527c33[_0x5cea('0x4c')][_0x5cea('0x64')][_0xf1b24a],'FaxQueueId':_0x527c33['params']['id']});}return _0x17e4a9;});}})[_0x5cea('0x27')](respondWithResult(_0x19fcf9,null))['catch'](handleError(_0x19fcf9,null));};exports[_0x5cea('0x6c')]=function(_0x268ce3,_0xd69ee1,_0x3d06aa){var _0x4c7d7e;return db[_0x5cea('0x46')][_0x5cea('0x4a')]({'where':{'id':_0x268ce3['params']['id']}})[_0x5cea('0x27')](handleEntityNotFound(_0xd69ee1,null))['then'](function(_0x5f4e68){if(_0x5f4e68){return _0x5f4e68['removeAgents'](_0x268ce3[_0x5cea('0x32')]['ids'])[_0x5cea('0x27')](function(_0x56f00f){if(_[_0x5cea('0x6d')](_0x268ce3['query'][_0x5cea('0x64')])){for(var _0x1c05b1=0x0;_0x1c05b1<_0x268ce3['query']['ids'][_0x5cea('0x37')];_0x1c05b1+=0x1){socket[_0x5cea('0x6b')](_0x5cea('0x6e'),{'UserId':_0x268ce3[_0x5cea('0x32')]['ids'][_0x1c05b1],'FaxQueueId':_0x268ce3['params']['id']});}}else{socket[_0x5cea('0x6b')](_0x5cea('0x6e'),{'UserId':_0x268ce3[_0x5cea('0x32')][_0x5cea('0x64')],'FaxQueueId':_0x268ce3['params']['id']});}});}})[_0x5cea('0x27')](respondWithStatusCode(_0xd69ee1,null))[_0x5cea('0x49')](handleError(_0xd69ee1,null));};exports[_0x5cea('0x6f')]=function(_0x56b661,_0x20086b,_0x1c1251){var _0x412e3f={};var _0x4f84c1={};var _0x3d7d7d;var _0xcde0df;return db[_0x5cea('0x46')][_0x5cea('0x61')]({'where':{'id':_0x56b661[_0x5cea('0x51')]['id']}})[_0x5cea('0x27')](handleEntityNotFound(_0x20086b,null))['then'](function(_0x4cceac){if(_0x4cceac){_0x3d7d7d=_0x4cceac;_0x4f84c1['model']=_[_0x5cea('0x31')](db[_0x5cea('0x56')][_0x5cea('0x2f')]);_0x4f84c1['query']=_['keys'](_0x56b661['query']);_0x4f84c1[_0x5cea('0x33')]=_[_0x5cea('0x34')](_0x4f84c1[_0x5cea('0x30')],_0x4f84c1[_0x5cea('0x32')]);_0x412e3f[_0x5cea('0x35')]=_['intersection'](_0x4f84c1['model'],qs[_0x5cea('0x36')](_0x56b661[_0x5cea('0x32')][_0x5cea('0x36')]));_0x412e3f[_0x5cea('0x35')]=_0x412e3f['attributes'][_0x5cea('0x37')]?_0x412e3f['attributes']:_0x4f84c1[_0x5cea('0x30')];_0x412e3f['order']=qs[_0x5cea('0x3b')](_0x56b661[_0x5cea('0x32')][_0x5cea('0x3b')]);_0x412e3f['where']=qs['filters'](_[_0x5cea('0x3d')](_0x56b661[_0x5cea('0x32')],_0x4f84c1[_0x5cea('0x33')]));if(_0x56b661['query'][_0x5cea('0x3e')]){_0x412e3f['where']=_[_0x5cea('0x3f')](_0x412e3f['where'],{'$or':_[_0x5cea('0x40')](_0x412e3f[_0x5cea('0x35')],function(_0x195d6e){var _0x50b4e4={};_0x50b4e4[_0x195d6e]={'$like':'%'+_0x56b661[_0x5cea('0x32')][_0x5cea('0x3e')]+'%'};return _0x50b4e4;})});}_0x412e3f=_['merge']({},_0x412e3f,_0x56b661[_0x5cea('0x43')]);return _0x3d7d7d[_0x5cea('0x6f')](_0x412e3f);}})[_0x5cea('0x27')](function(_0x200a19){if(_0x200a19){_0xcde0df=_0x200a19[_0x5cea('0x37')];if(!_0x56b661[_0x5cea('0x32')][_0x5cea('0x38')](_0x5cea('0x39'))){_0x412e3f[_0x5cea('0x22')]=qs[_0x5cea('0x22')](_0x56b661[_0x5cea('0x32')][_0x5cea('0x22')]);_0x412e3f[_0x5cea('0x21')]=qs[_0x5cea('0x21')](_0x56b661[_0x5cea('0x32')][_0x5cea('0x21')]);}return _0x3d7d7d[_0x5cea('0x6f')](_0x412e3f);}})[_0x5cea('0x27')](function(_0x367c79){if(_0x367c79){return _0x367c79?{'count':_0xcde0df,'rows':_0x367c79}:null;}})['then'](respondWithResult(_0x20086b,null))[_0x5cea('0x49')](handleError(_0x20086b,null));}; \ No newline at end of file +var _0xe671=['getAgents','findOne','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','count','offset','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','error','stack','name','send','FaxQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','FaxQueueId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','union','penalty','removeTeams','removeAgents','addAgents','spread','emit','isArray','userFaxQueue:remove'];(function(_0x4d8524,_0x1e8925){var _0xbdb413=function(_0x1e70d7){while(--_0x1e70d7){_0x4d8524['push'](_0x4d8524['shift']());}};_0xbdb413(++_0x1e8925);}(_0xe671,0x1be));var _0x1e67=function(_0x1f5898,_0x29717c){_0x1f5898=_0x1f5898-0x0;var _0x591309=_0xe671[_0x1f5898];return _0x591309;};'use strict';var pdf=require(_0x1e67('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e67('0x1'));var jsonpatch=require(_0x1e67('0x2'));var rp=require(_0x1e67('0x3'));var moment=require('moment');var BPromise=require(_0x1e67('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1e67('0x5'));var sox=require(_0x1e67('0x6'));var csv=require(_0x1e67('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1e67('0x8'));var squel=require(_0x1e67('0x9'));var crypto=require('crypto');var jsforce=require(_0x1e67('0xa'));var deskjs=require(_0x1e67('0xb'));var toCsv=require(_0x1e67('0x7'));var querystring=require(_0x1e67('0xc'));var Papa=require(_0x1e67('0xd'));var authService=require(_0x1e67('0xe'));var hardwareService=require(_0x1e67('0xf'));var Redis=require(_0x1e67('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x1e67('0x11'))(_0x1e67('0x12'));var utils=require(_0x1e67('0x13'));var config=require(_0x1e67('0x14'));var db=require('../../mysqldb')['db'];config[_0x1e67('0x15')]=_[_0x1e67('0x16')](config[_0x1e67('0x15')],{'host':_0x1e67('0x17'),'port':0x18eb});var socket=require(_0x1e67('0x18'))(new Redis(config[_0x1e67('0x15')]));require(_0x1e67('0x19'))[_0x1e67('0x1a')](socket);function respondWithStatusCode(_0x160584,_0x54f0c0){_0x54f0c0=_0x54f0c0||0xcc;return function(_0xfd7c73){if(_0xfd7c73){return _0x160584[_0x1e67('0x1b')](_0x54f0c0);}return _0x160584['status'](_0x54f0c0)['end']();};}function respondWithResult(_0x6b9d,_0x1a0a2a){_0x1a0a2a=_0x1a0a2a||0xc8;return function(_0x2a07bf){if(_0x2a07bf){return _0x6b9d[_0x1e67('0x1c')](_0x1a0a2a)['json'](_0x2a07bf);}};}function respondWithFilteredResult(_0x59dbd3,_0x1c8e89){return function(_0x15a938){if(_0x15a938){var _0x58d713=_0x15a938[_0x1e67('0x1d')],_0x355c0d=_0x1c8e89[_0x1e67('0x1e')],_0x4feb98=_0x1c8e89[_0x1e67('0x1e')]+_0x1c8e89['limit'],_0x1e5f9a;if(_0x4feb98>=_0x58d713){_0x4feb98=_0x58d713;_0x1e5f9a=0xc8;}else{_0x1e5f9a=0xce;}_0x59dbd3[_0x1e67('0x1c')](_0x1e5f9a);return _0x59dbd3[_0x1e67('0x1f')](_0x1e67('0x20'),_0x355c0d+'-'+_0x4feb98+'/'+_0x58d713)['json'](_0x15a938);}return null;};}function patchUpdates(_0x182036){return function(_0x487dd0){try{jsonpatch[_0x1e67('0x21')](_0x487dd0,_0x182036,!![]);}catch(_0x50e169){return BPromise[_0x1e67('0x22')](_0x50e169);}return _0x487dd0['save']();};}function saveUpdates(_0x32fc23,_0x3e6df4){return function(_0x2ac3b3){if(_0x2ac3b3){return _0x2ac3b3[_0x1e67('0x23')](_0x32fc23)['then'](function(_0x150b3e){return _0x150b3e;});}return null;};}function removeEntity(_0x1314b6,_0x38c313){return function(_0x275a48){if(_0x275a48){return _0x275a48[_0x1e67('0x24')]()[_0x1e67('0x25')](function(){var _0x1d94f4=_0x275a48[_0x1e67('0x26')]({'plain':!![]});var _0xed4a69='FaxQueues';return db[_0x1e67('0x27')]['destroy']({'where':{'type':_0xed4a69,'resourceId':_0x1d94f4['id']}})[_0x1e67('0x25')](function(){return _0x275a48;});})[_0x1e67('0x25')](function(){_0x1314b6[_0x1e67('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd4600d,_0x2d9f58){return function(_0x4da09f){if(!_0x4da09f){_0xd4600d[_0x1e67('0x1b')](0x194);}return _0x4da09f;};}function handleError(_0x25a791,_0x1fd487){_0x1fd487=_0x1fd487||0x1f4;return function(_0x140699){logger[_0x1e67('0x28')](_0x140699[_0x1e67('0x29')]);if(_0x140699[_0x1e67('0x2a')]){delete _0x140699[_0x1e67('0x2a')];}_0x25a791[_0x1e67('0x1c')](_0x1fd487)[_0x1e67('0x2b')](_0x140699);};}exports['index']=function(_0x185d1c,_0x2133df){var _0x1ca896={},_0x47d015={},_0x1a6835={'count':0x0,'rows':[]};var _0x2abb8c=db[_0x1e67('0x2c')]['rawAttributes'];_0x47d015[_0x1e67('0x2d')]=_[_0x1e67('0x2e')](_0x2abb8c);_0x47d015[_0x1e67('0x2f')]=_['keys'](_0x185d1c[_0x1e67('0x2f')]);_0x47d015[_0x1e67('0x30')]=_[_0x1e67('0x31')](_0x47d015[_0x1e67('0x2d')],_0x47d015[_0x1e67('0x2f')]);_0x1ca896[_0x1e67('0x32')]=_[_0x1e67('0x31')](_0x47d015['model'],qs[_0x1e67('0x33')](_0x185d1c[_0x1e67('0x2f')][_0x1e67('0x33')]));_0x1ca896['attributes']=_0x1ca896['attributes'][_0x1e67('0x34')]?_0x1ca896[_0x1e67('0x32')]:_0x47d015['model'];if(!_0x185d1c['query'][_0x1e67('0x35')](_0x1e67('0x36'))){_0x1ca896['limit']=qs[_0x1e67('0x37')](_0x185d1c['query'][_0x1e67('0x37')]);_0x1ca896[_0x1e67('0x1e')]=qs[_0x1e67('0x1e')](_0x185d1c[_0x1e67('0x2f')]['offset']);}_0x1ca896[_0x1e67('0x38')]=qs['sort'](_0x185d1c[_0x1e67('0x2f')][_0x1e67('0x39')]);_0x1ca896[_0x1e67('0x3a')]=qs[_0x1e67('0x30')](_[_0x1e67('0x3b')](_0x185d1c['query'],_0x47d015[_0x1e67('0x30')]));if(_0x185d1c['query'][_0x1e67('0x3c')]){_0x1ca896[_0x1e67('0x3a')]=_[_0x1e67('0x3d')](_0x1ca896[_0x1e67('0x3a')],{'$or':_[_0x1e67('0x3e')](_0x2abb8c,function(_0x2078b9){if(_0x2078b9[_0x1e67('0x3f')][_0x1e67('0x40')]!=='VIRTUAL'){var _0x1a3d15={};_0x1a3d15[_0x2078b9[_0x1e67('0x41')]]={'$like':'%'+_0x185d1c['query'][_0x1e67('0x3c')]+'%'};return _0x1a3d15;}})});}_0x1ca896=_[_0x1e67('0x3d')]({},_0x1ca896,_0x185d1c[_0x1e67('0x42')]);var _0x425a49={'where':_0x1ca896[_0x1e67('0x3a')]};return db[_0x1e67('0x2c')][_0x1e67('0x1d')](_0x425a49)[_0x1e67('0x25')](function(_0x3fb69f){_0x1a6835[_0x1e67('0x1d')]=_0x3fb69f;if(_0x185d1c['query'][_0x1e67('0x43')]){_0x1ca896[_0x1e67('0x44')]=[{'all':!![]}];}return db[_0x1e67('0x2c')][_0x1e67('0x45')](_0x1ca896);})[_0x1e67('0x25')](function(_0x5842fb){_0x1a6835[_0x1e67('0x46')]=_0x5842fb;return _0x1a6835;})[_0x1e67('0x25')](respondWithFilteredResult(_0x2133df,_0x1ca896))[_0x1e67('0x47')](handleError(_0x2133df,null));};exports[_0x1e67('0x48')]=function(_0x77a23f,_0xb08eae){var _0x5ea8fb={'raw':!![],'where':{'id':_0x77a23f[_0x1e67('0x49')]['id']}},_0x378ff0={};_0x378ff0['model']=_[_0x1e67('0x2e')](db[_0x1e67('0x2c')][_0x1e67('0x4a')]);_0x378ff0[_0x1e67('0x2f')]=_[_0x1e67('0x2e')](_0x77a23f[_0x1e67('0x2f')]);_0x378ff0['filters']=_[_0x1e67('0x31')](_0x378ff0[_0x1e67('0x2d')],_0x378ff0['query']);_0x5ea8fb['attributes']=_[_0x1e67('0x31')](_0x378ff0[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x77a23f[_0x1e67('0x2f')][_0x1e67('0x33')]));_0x5ea8fb['attributes']=_0x5ea8fb[_0x1e67('0x32')][_0x1e67('0x34')]?_0x5ea8fb[_0x1e67('0x32')]:_0x378ff0[_0x1e67('0x2d')];if(_0x77a23f['query']['includeAll']){_0x5ea8fb[_0x1e67('0x44')]=[{'all':!![]}];}_0x5ea8fb=_[_0x1e67('0x3d')]({},_0x5ea8fb,_0x77a23f[_0x1e67('0x42')]);return db[_0x1e67('0x2c')][_0x1e67('0x4b')](_0x5ea8fb)[_0x1e67('0x25')](handleEntityNotFound(_0xb08eae,null))[_0x1e67('0x25')](respondWithResult(_0xb08eae,null))[_0x1e67('0x47')](handleError(_0xb08eae,null));};exports[_0x1e67('0x4c')]=function(_0x44412f,_0x957776){return db[_0x1e67('0x2c')][_0x1e67('0x4c')](_0x44412f['body'],{})[_0x1e67('0x25')](function(_0x1cda96){var _0x4a2208=_0x44412f[_0x1e67('0x4d')][_0x1e67('0x26')]({'plain':!![]});if(!_0x4a2208)throw new Error(_0x1e67('0x4e'));if(_0x4a2208[_0x1e67('0x4f')]===_0x1e67('0x4d')){var _0x5c6b65=_0x1cda96['get']({'plain':!![]});var _0x278368=_0x1e67('0x50');return db[_0x1e67('0x51')][_0x1e67('0x4b')]({'where':{'name':_0x278368,'userProfileId':_0x4a2208[_0x1e67('0x52')]},'raw':!![]})[_0x1e67('0x25')](function(_0x2cfabe){if(_0x2cfabe&&_0x2cfabe['autoAssociation']===0x0){return db[_0x1e67('0x27')][_0x1e67('0x4c')]({'name':_0x5c6b65[_0x1e67('0x2a')],'resourceId':_0x5c6b65['id'],'type':_0x2cfabe['name'],'sectionId':_0x2cfabe['id']},{})[_0x1e67('0x25')](function(){return _0x1cda96;});}else{return _0x1cda96;}})['catch'](function(_0x158ef0){logger[_0x1e67('0x28')](_0x1e67('0x53'),_0x158ef0);throw _0x158ef0;});}return _0x1cda96;})[_0x1e67('0x25')](respondWithResult(_0x957776,0xc9))[_0x1e67('0x47')](handleError(_0x957776,null));};exports[_0x1e67('0x23')]=function(_0x2fd53b,_0x14be07){if(_0x2fd53b['body']['id']){delete _0x2fd53b['body']['id'];}return db[_0x1e67('0x2c')][_0x1e67('0x4b')]({'where':{'id':_0x2fd53b[_0x1e67('0x49')]['id']}})['then'](handleEntityNotFound(_0x14be07,null))[_0x1e67('0x25')](saveUpdates(_0x2fd53b[_0x1e67('0x54')],null))['then'](respondWithResult(_0x14be07,null))[_0x1e67('0x47')](handleError(_0x14be07,null));};exports[_0x1e67('0x24')]=function(_0x2bc17e,_0x2efea3){return db[_0x1e67('0x2c')][_0x1e67('0x4b')]({'where':{'id':_0x2bc17e[_0x1e67('0x49')]['id']}})[_0x1e67('0x25')](handleEntityNotFound(_0x2efea3,null))[_0x1e67('0x25')](removeEntity(_0x2efea3,null))[_0x1e67('0x47')](handleError(_0x2efea3,null));};exports[_0x1e67('0x55')]=function(_0x1bf8bf,_0x1fb66f){return db[_0x1e67('0x2c')]['describe']()['then'](respondWithResult(_0x1fb66f,null))['catch'](handleError(_0x1fb66f,null));};exports['getMembers']=function(_0x482000,_0x1b0900,_0x245ed0){var _0x2bd3b5={'raw':!![],'where':{}},_0x54b129={},_0x2a2084;return db[_0x1e67('0x2c')]['findOne']({'where':{'id':_0x482000[_0x1e67('0x49')]['id']}})[_0x1e67('0x25')](handleEntityNotFound(_0x1b0900,null))[_0x1e67('0x25')](function(_0x319db8){if(_0x319db8){_0x2a2084=_0x319db8[_0x1e67('0x26')]({'plain':!![]});_0x54b129[_0x1e67('0x2d')]=_[_0x1e67('0x2e')](db['UserFaxQueue']['rawAttributes']);_0x54b129[_0x1e67('0x2f')]=_['keys'](_0x482000[_0x1e67('0x2f')]);_0x54b129[_0x1e67('0x30')]=_[_0x1e67('0x31')](_0x54b129['model'],_0x54b129[_0x1e67('0x2f')]);_0x2bd3b5[_0x1e67('0x32')]=_[_0x1e67('0x31')](_0x54b129[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x482000[_0x1e67('0x2f')][_0x1e67('0x33')]));_0x2bd3b5[_0x1e67('0x32')]=_0x2bd3b5[_0x1e67('0x32')][_0x1e67('0x34')]?_0x2bd3b5[_0x1e67('0x32')]:_0x54b129[_0x1e67('0x2d')];if(!_0x482000[_0x1e67('0x2f')][_0x1e67('0x35')]('nolimit')){_0x2bd3b5[_0x1e67('0x37')]=qs[_0x1e67('0x37')](_0x482000[_0x1e67('0x2f')]['limit']);_0x2bd3b5[_0x1e67('0x1e')]=qs[_0x1e67('0x1e')](_0x482000[_0x1e67('0x2f')][_0x1e67('0x1e')]);}_0x2bd3b5[_0x1e67('0x38')]=qs['sort'](_0x482000[_0x1e67('0x2f')][_0x1e67('0x39')]);_0x2bd3b5[_0x1e67('0x3a')]=qs[_0x1e67('0x30')](_[_0x1e67('0x3b')](_0x482000[_0x1e67('0x2f')],_0x54b129[_0x1e67('0x30')]));_0x2bd3b5[_0x1e67('0x3a')][_0x1e67('0x56')]=_0x319db8['id'];if(_0x482000[_0x1e67('0x2f')][_0x1e67('0x3c')]){_0x2bd3b5[_0x1e67('0x3a')]=_[_0x1e67('0x3d')](_0x2bd3b5['where'],{'$or':_[_0x1e67('0x3e')](_0x2bd3b5['attributes'],function(_0x5925e3){var _0x36b698={};_0x36b698[_0x5925e3]={'$like':'%'+_0x482000['query'][_0x1e67('0x3c')]+'%'};return _0x36b698;})});}_0x2bd3b5=_['merge']({},_0x2bd3b5,_0x482000[_0x1e67('0x42')]);return db['UserFaxQueue'][_0x1e67('0x45')](_0x2bd3b5);}})[_0x1e67('0x25')](function(_0x3acf2c){if(_0x3acf2c){return db['User']['findAndCountAll']({'where':{'id':_[_0x1e67('0x3e')](_0x3acf2c,'UserId'),'role':_0x1e67('0x57')},'attributes':['id','name',_0x1e67('0x58'),_0x1e67('0x59'),_0x1e67('0x5a')]});}})[_0x1e67('0x25')](function(_0x138bf8){if(_0x138bf8){return{'count':_0x138bf8[_0x1e67('0x1d')],'rows':_[_0x1e67('0x3e')](_0x138bf8[_0x1e67('0x46')],function(_0x15c8ef){return{'membername':_0x15c8ef[_0x1e67('0x2a')],'UserId':_0x15c8ef['id'],'queue_name':_0x2a2084[_0x1e67('0x2a')],'FaxQueueId':_0x2a2084['id'],'interface':util[_0x1e67('0x5b')](_0x1e67('0x5c'),_0x1e67('0x5d'),_0x15c8ef[_0x1e67('0x2a')]),'penalty':0x0,'paused':_0x15c8ef[_0x1e67('0x58')],'createdAt':_0x15c8ef[_0x1e67('0x5a')],'updatedAt':_0x15c8ef[_0x1e67('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1e67('0x25')](respondWithFilteredResult(_0x1b0900,_0x2bd3b5))[_0x1e67('0x47')](handleError(_0x1b0900,null));};exports[_0x1e67('0x5e')]=function(_0x512ca4,_0x2e205a,_0x2b74e3){var _0x242449={};var _0x1c54a7={};var _0x3ce9f2;var _0x28c59b;return db[_0x1e67('0x2c')]['findOne']({'where':{'id':_0x512ca4[_0x1e67('0x49')]['id']}})[_0x1e67('0x25')](handleEntityNotFound(_0x2e205a,null))[_0x1e67('0x25')](function(_0xc702f7){if(_0xc702f7){_0x3ce9f2=_0xc702f7;_0x1c54a7['model']=_[_0x1e67('0x2e')](db[_0x1e67('0x5f')][_0x1e67('0x4a')]);_0x1c54a7[_0x1e67('0x2f')]=_[_0x1e67('0x2e')](_0x512ca4[_0x1e67('0x2f')]);_0x1c54a7[_0x1e67('0x30')]=_[_0x1e67('0x31')](_0x1c54a7[_0x1e67('0x2d')],_0x1c54a7[_0x1e67('0x2f')]);_0x242449['attributes']=_['intersection'](_0x1c54a7[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x512ca4[_0x1e67('0x2f')]['fields']));_0x242449[_0x1e67('0x32')]=_0x242449[_0x1e67('0x32')][_0x1e67('0x34')]?_0x242449['attributes']:_0x1c54a7[_0x1e67('0x2d')];_0x242449[_0x1e67('0x38')]=qs[_0x1e67('0x39')](_0x512ca4[_0x1e67('0x2f')][_0x1e67('0x39')]);_0x242449[_0x1e67('0x3a')]=qs[_0x1e67('0x30')](_[_0x1e67('0x3b')](_0x512ca4[_0x1e67('0x2f')],_0x1c54a7[_0x1e67('0x30')]));if(_0x512ca4[_0x1e67('0x2f')]['filter']){_0x242449[_0x1e67('0x3a')]=_['merge'](_0x242449[_0x1e67('0x3a')],{'$or':_[_0x1e67('0x3e')](_0x242449[_0x1e67('0x32')],function(_0x2fc252){var _0x5ed7c5={};_0x5ed7c5[_0x2fc252]={'$like':'%'+_0x512ca4[_0x1e67('0x2f')]['filter']+'%'};return _0x5ed7c5;})});}_0x242449=_[_0x1e67('0x3d')]({},_0x242449,_0x512ca4[_0x1e67('0x42')]);return _0x3ce9f2[_0x1e67('0x5e')](_0x242449);}})[_0x1e67('0x25')](function(_0x1f1094){if(_0x1f1094){_0x28c59b=_0x1f1094[_0x1e67('0x34')];if(!_0x512ca4['query'][_0x1e67('0x35')](_0x1e67('0x36'))){_0x242449[_0x1e67('0x37')]=qs['limit'](_0x512ca4[_0x1e67('0x2f')]['limit']);_0x242449[_0x1e67('0x1e')]=qs[_0x1e67('0x1e')](_0x512ca4['query'][_0x1e67('0x1e')]);}return _0x3ce9f2[_0x1e67('0x5e')](_0x242449);}})[_0x1e67('0x25')](function(_0x4546b1){if(_0x4546b1){return _0x4546b1?{'count':_0x28c59b,'rows':_0x4546b1}:null;}})[_0x1e67('0x25')](respondWithResult(_0x2e205a,null))[_0x1e67('0x47')](handleError(_0x2e205a,null));};exports[_0x1e67('0x60')]=function(_0x55542f,_0x3a5201,_0xbcafae){var _0x21c219=[];var _0x166b02;return db[_0x1e67('0x5f')][_0x1e67('0x45')]({'where':{'id':_0x55542f[_0x1e67('0x54')][_0x1e67('0x61')]},'attributes':['id'],'include':[{'model':db[_0x1e67('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1e67('0x25')](function(_0x2aa7ae){if(_0x2aa7ae){for(var _0x3b454d=0x0;_0x3b454d<_0x2aa7ae[_0x1e67('0x34')];_0x3b454d+=0x1){for(var _0x3814d7=0x0;_0x3814d7<_0x2aa7ae[_0x3b454d][_0x1e67('0x63')][_0x1e67('0x34')];_0x3814d7+=0x1){_0x21c219=_[_0x1e67('0x64')](_0x21c219,[_0x2aa7ae[_0x3b454d][_0x1e67('0x63')][_0x3814d7]['id']]);}}return _0x21c219;}})[_0x1e67('0x25')](function(_0x6708ad){if(_0x6708ad){return db[_0x1e67('0x2c')][_0x1e67('0x4b')]({'where':{'id':_0x55542f['params']['id']}});}})[_0x1e67('0x25')](function(_0x19497a){if(_0x19497a){_0x166b02=_0x19497a;return _0x166b02['addAgents'](_0x21c219,{'penalty':_0x55542f[_0x1e67('0x54')][_0x1e67('0x65')]});}})['then'](function(_0x3d6cf2){if(_0x3d6cf2){return _0x166b02[_0x1e67('0x60')](_0x55542f[_0x1e67('0x54')][_0x1e67('0x61')]);}})['then'](handleEntityNotFound(_0x3a5201,null))[_0x1e67('0x25')](respondWithStatusCode(_0x3a5201,null))[_0x1e67('0x47')](handleError(_0x3a5201,null));};exports[_0x1e67('0x66')]=function(_0x49d0f1,_0x3678b5,_0x9f6e01){var _0x16968a=[];var _0xe6b3b5;return db[_0x1e67('0x5f')][_0x1e67('0x45')]({'where':{'id':_0x49d0f1[_0x1e67('0x2f')][_0x1e67('0x61')]},'attributes':['id'],'include':[{'model':db[_0x1e67('0x62')],'as':_0x1e67('0x63'),'attributes':['id'],'raw':!![]}]})[_0x1e67('0x25')](function(_0x468dc8){if(_0x468dc8){for(var _0x28dd5c=0x0;_0x28dd5c<_0x468dc8[_0x1e67('0x34')];_0x28dd5c+=0x1){for(var _0x56ae5d=0x0;_0x56ae5d<_0x468dc8[_0x28dd5c][_0x1e67('0x63')]['length'];_0x56ae5d+=0x1){_0x16968a=_[_0x1e67('0x64')](_0x16968a,[_0x468dc8[_0x28dd5c]['Agents'][_0x56ae5d]['id']]);}}return _0x16968a;}})[_0x1e67('0x25')](function(_0x31e4f7){if(_0x31e4f7){return db[_0x1e67('0x2c')]['find']({'where':{'id':_0x49d0f1[_0x1e67('0x49')]['id']}});}})['then'](function(_0x4a0baf){if(_0x4a0baf){_0xe6b3b5=_0x4a0baf;return _0xe6b3b5[_0x1e67('0x67')](_0x16968a);}})['then'](function(_0x443834){if(_0xe6b3b5){return _0xe6b3b5[_0x1e67('0x66')](_0x49d0f1[_0x1e67('0x2f')][_0x1e67('0x61')]);}})[_0x1e67('0x25')](handleEntityNotFound(_0x3678b5,null))[_0x1e67('0x25')](respondWithStatusCode(_0x3678b5,null))[_0x1e67('0x47')](handleError(_0x3678b5,null));};exports[_0x1e67('0x68')]=function(_0x4fce3d,_0x528573,_0x3b899c){return db['FaxQueue'][_0x1e67('0x4b')]({'where':{'id':_0x4fce3d[_0x1e67('0x49')]['id']}})['then'](handleEntityNotFound(_0x528573,null))[_0x1e67('0x25')](function(_0x41cee2){if(_0x41cee2){return _0x41cee2[_0x1e67('0x68')](_0x4fce3d[_0x1e67('0x54')][_0x1e67('0x61')],_['omit'](_0x4fce3d[_0x1e67('0x54')],['ids','id'])||{})[_0x1e67('0x69')](function(_0x1c64ee){for(var _0x247545=0x0;_0x247545<_0x4fce3d[_0x1e67('0x54')]['ids'][_0x1e67('0x34')];_0x247545+=0x1){socket[_0x1e67('0x6a')]('userFaxQueue:save',{'UserId':_0x4fce3d[_0x1e67('0x54')][_0x1e67('0x61')][_0x247545],'FaxQueueId':_0x4fce3d['params']['id']});}return _0x1c64ee;});}})[_0x1e67('0x25')](respondWithResult(_0x528573,null))[_0x1e67('0x47')](handleError(_0x528573,null));};exports[_0x1e67('0x67')]=function(_0x1d5909,_0x13025b,_0x39297f){var _0x19e457;return db[_0x1e67('0x2c')][_0x1e67('0x4b')]({'where':{'id':_0x1d5909[_0x1e67('0x49')]['id']}})['then'](handleEntityNotFound(_0x13025b,null))['then'](function(_0x2b7169){if(_0x2b7169){return _0x2b7169['removeAgents'](_0x1d5909[_0x1e67('0x2f')]['ids'])['then'](function(_0x34f379){if(_[_0x1e67('0x6b')](_0x1d5909[_0x1e67('0x2f')]['ids'])){for(var _0x47d3fc=0x0;_0x47d3fc<_0x1d5909[_0x1e67('0x2f')]['ids'][_0x1e67('0x34')];_0x47d3fc+=0x1){socket[_0x1e67('0x6a')](_0x1e67('0x6c'),{'UserId':_0x1d5909[_0x1e67('0x2f')][_0x1e67('0x61')][_0x47d3fc],'FaxQueueId':_0x1d5909[_0x1e67('0x49')]['id']});}}else{socket[_0x1e67('0x6a')]('userFaxQueue:remove',{'UserId':_0x1d5909[_0x1e67('0x2f')][_0x1e67('0x61')],'FaxQueueId':_0x1d5909[_0x1e67('0x49')]['id']});}});}})[_0x1e67('0x25')](respondWithStatusCode(_0x13025b,null))['catch'](handleError(_0x13025b,null));};exports[_0x1e67('0x6d')]=function(_0x367696,_0x24a990,_0x284ab3){var _0x5b9220={};var _0x2426c2={};var _0x1f00ab;var _0x3c8eed;return db[_0x1e67('0x2c')][_0x1e67('0x6e')]({'where':{'id':_0x367696['params']['id']}})[_0x1e67('0x25')](handleEntityNotFound(_0x24a990,null))[_0x1e67('0x25')](function(_0x47fad6){if(_0x47fad6){_0x1f00ab=_0x47fad6;_0x2426c2[_0x1e67('0x2d')]=_['keys'](db[_0x1e67('0x62')]['rawAttributes']);_0x2426c2[_0x1e67('0x2f')]=_['keys'](_0x367696[_0x1e67('0x2f')]);_0x2426c2[_0x1e67('0x30')]=_[_0x1e67('0x31')](_0x2426c2[_0x1e67('0x2d')],_0x2426c2[_0x1e67('0x2f')]);_0x5b9220[_0x1e67('0x32')]=_[_0x1e67('0x31')](_0x2426c2[_0x1e67('0x2d')],qs[_0x1e67('0x33')](_0x367696[_0x1e67('0x2f')][_0x1e67('0x33')]));_0x5b9220[_0x1e67('0x32')]=_0x5b9220[_0x1e67('0x32')][_0x1e67('0x34')]?_0x5b9220[_0x1e67('0x32')]:_0x2426c2['model'];_0x5b9220[_0x1e67('0x38')]=qs['sort'](_0x367696[_0x1e67('0x2f')][_0x1e67('0x39')]);_0x5b9220['where']=qs[_0x1e67('0x30')](_[_0x1e67('0x3b')](_0x367696[_0x1e67('0x2f')],_0x2426c2[_0x1e67('0x30')]));if(_0x367696[_0x1e67('0x2f')][_0x1e67('0x3c')]){_0x5b9220[_0x1e67('0x3a')]=_[_0x1e67('0x3d')](_0x5b9220['where'],{'$or':_['map'](_0x5b9220[_0x1e67('0x32')],function(_0x1dc1cb){var _0x49fd53={};_0x49fd53[_0x1dc1cb]={'$like':'%'+_0x367696[_0x1e67('0x2f')]['filter']+'%'};return _0x49fd53;})});}_0x5b9220=_['merge']({},_0x5b9220,_0x367696[_0x1e67('0x42')]);return _0x1f00ab[_0x1e67('0x6d')](_0x5b9220);}})[_0x1e67('0x25')](function(_0x14d5b9){if(_0x14d5b9){_0x3c8eed=_0x14d5b9[_0x1e67('0x34')];if(!_0x367696[_0x1e67('0x2f')][_0x1e67('0x35')]('nolimit')){_0x5b9220[_0x1e67('0x37')]=qs[_0x1e67('0x37')](_0x367696[_0x1e67('0x2f')][_0x1e67('0x37')]);_0x5b9220[_0x1e67('0x1e')]=qs[_0x1e67('0x1e')](_0x367696[_0x1e67('0x2f')]['offset']);}return _0x1f00ab[_0x1e67('0x6d')](_0x5b9220);}})[_0x1e67('0x25')](function(_0x24c2c6){if(_0x24c2c6){return _0x24c2c6?{'count':_0x3c8eed,'rows':_0x24c2c6}:null;}})[_0x1e67('0x25')](respondWithResult(_0x24a990,null))[_0x1e67('0x47')](handleError(_0x24a990,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ed5c0fb..d7fee0b 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 _0x984b=['update','emit','hasOwnProperty','exports','setMaxListeners','save'];(function(_0x200766,_0x5114fa){var _0x8cc5d1=function(_0x11d1c3){while(--_0x11d1c3){_0x200766['push'](_0x200766['shift']());}};_0x8cc5d1(++_0x5114fa);}(_0x984b,0xee));var _0xb984=function(_0x58ef15,_0x2a1bdb){_0x58ef15=_0x58ef15-0x0;var _0x151459=_0x984b[_0x58ef15];return _0x151459;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb984('0x0')](0x0);var events={'afterCreate':_0xb984('0x1'),'afterUpdate':_0xb984('0x2'),'afterDestroy':'remove'};function emitEvent(_0x59ea63){return function(_0x8384b0,_0x340f2c,_0x4d8f6a){FaxQueueEvents['emit'](_0x59ea63+':'+_0x8384b0['id'],_0x8384b0);FaxQueueEvents[_0xb984('0x3')](_0x59ea63,_0x8384b0);_0x4d8f6a(null);};}for(var e in events){if(events[_0xb984('0x4')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xb984('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0xdb94=['emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','save','update','remove'];(function(_0x2a7a20,_0x4a947a){var _0x36b746=function(_0x279e76){while(--_0x279e76){_0x2a7a20['push'](_0x2a7a20['shift']());}};_0x36b746(++_0x4a947a);}(_0xdb94,0xe5));var _0x4db9=function(_0x2c6067,_0x4726db){_0x2c6067=_0x2c6067-0x0;var _0x1a82a8=_0xdb94[_0x2c6067];return _0x1a82a8;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x4db9('0x0'))['db'][_0x4db9('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4db9('0x2'),'afterUpdate':_0x4db9('0x3'),'afterDestroy':_0x4db9('0x4')};function emitEvent(_0x2e85f4){return function(_0x1f05d4,_0x592097,_0x39eccb){FaxQueueEvents['emit'](_0x2e85f4+':'+_0x1f05d4['id'],_0x1f05d4);FaxQueueEvents[_0x4db9('0x5')](_0x2e85f4,_0x1f05d4);_0x39eccb(null);};}for(var e in events){if(events[_0x4db9('0x6')](e)){var event=events[e];FaxQueue[_0x4db9('0x7')](e,emitEvent(event));}}module[_0x4db9('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 8b23d33..3c83388 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 _0xadf5=['fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','exports','define'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xadf5,0xb1));var _0x5adf=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0xadf5[_0x238671];return _0x474844;};'use strict';var _=require(_0x5adf('0x0'));var util=require(_0x5adf('0x1'));var logger=require(_0x5adf('0x2'))(_0x5adf('0x3'));var moment=require(_0x5adf('0x4'));var BPromise=require(_0x5adf('0x5'));var rp=require(_0x5adf('0x6'));var attributes=require(_0x5adf('0x7'));module[_0x5adf('0x8')]=function(_0x32c606,_0x3c42a7){return _0x32c606[_0x5adf('0x9')]('FaxQueue',attributes,{'tableName':_0x5adf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x559f=['define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','exports'];(function(_0x27ae3b,_0x42c9dd){var _0x348fae=function(_0x38a87e){while(--_0x38a87e){_0x27ae3b['push'](_0x27ae3b['shift']());}};_0x348fae(++_0x42c9dd);}(_0x559f,0x1db));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf559('0x0'));var util=require(_0xf559('0x1'));var logger=require(_0xf559('0x2'))(_0xf559('0x3'));var moment=require(_0xf559('0x4'));var BPromise=require(_0xf559('0x5'));var rp=require(_0xf559('0x6'));var attributes=require(_0xf559('0x7'));module[_0xf559('0x8')]=function(_0x28fdbf,_0x543728){return _0x28fdbf[_0xf559('0x9')](_0xf559('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index c2479b5..2217c0a 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 _0x8074=['attributes','include','map','model','FaxQueue','ShowFaxQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','options','raw','where'];(function(_0x4fe4f6,_0x16e51d){var _0x1ce395=function(_0x54fd4c){while(--_0x54fd4c){_0x4fe4f6['push'](_0x4fe4f6['shift']());}};_0x1ce395(++_0x16e51d);}(_0x8074,0x1e7));var _0x4807=function(_0x1537bf,_0x3b6edc){_0x1537bf=_0x1537bf-0x0;var _0x3844fc=_0x8074[_0x1537bf];return _0x3844fc;};'use strict';var _=require(_0x4807('0x0'));var util=require(_0x4807('0x1'));var moment=require(_0x4807('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4807('0x3'));var db=require(_0x4807('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4807('0x5'))(_0x4807('0x6'));var config=require(_0x4807('0x7'));var jayson=require(_0x4807('0x8'));var client=jayson[_0x4807('0x9')][_0x4807('0xa')]({'port':0x232a});config[_0x4807('0xb')]=_['defaults'](config[_0x4807('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4807('0xc'))(new Redis(config[_0x4807('0xb')]));require(_0x4807('0xd'))[_0x4807('0xe')](socket);function respondWithRpcPromise(_0x3749b9,_0x5c9c98,_0x24d044){return new BPromise(function(_0x2159ba,_0x4433d7){return client[_0x4807('0xf')](_0x3749b9,_0x24d044)[_0x4807('0x10')](function(_0x2294bb){logger[_0x4807('0x11')](_0x4807('0x12'),_0x5c9c98,_0x4807('0x13'));logger[_0x4807('0x14')](_0x4807('0x15'),_0x5c9c98,_0x4807('0x13'),JSON[_0x4807('0x16')](_0x2294bb));if(_0x2294bb[_0x4807('0x17')]){if(_0x2294bb['error']['code']===0x1f4){logger['error'](_0x4807('0x12'),_0x5c9c98,_0x2294bb[_0x4807('0x17')][_0x4807('0x18')]);return _0x4433d7(_0x2294bb[_0x4807('0x17')]['message']);}logger[_0x4807('0x17')](_0x4807('0x12'),_0x5c9c98,_0x2294bb[_0x4807('0x17')][_0x4807('0x18')]);return _0x2159ba(_0x2294bb[_0x4807('0x17')]['message']);}else{logger[_0x4807('0x11')](_0x4807('0x12'),_0x5c9c98,'request\x20sent');_0x2159ba(_0x2294bb[_0x4807('0x19')][_0x4807('0x18')]);}})[_0x4807('0x1a')](function(_0x3ab9ff){logger[_0x4807('0x17')](_0x4807('0x12'),_0x5c9c98,_0x3ab9ff);_0x4433d7(_0x3ab9ff);});});}exports[_0x4807('0x1b')]=function(_0x1a4390){var _0x44ddd0=this;return new Promise(function(_0x39a02b,_0x32f16c){return db['FaxQueue']['findAll']({'raw':_0x1a4390[_0x4807('0x1c')]?_0x1a4390[_0x4807('0x1c')][_0x4807('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a4390[_0x4807('0x1c')]?_0x1a4390[_0x4807('0x1c')][_0x4807('0x1e')]||null:null,'attributes':_0x1a4390[_0x4807('0x1c')]?_0x1a4390[_0x4807('0x1c')][_0x4807('0x1f')]||null:null,'limit':_0x1a4390[_0x4807('0x1c')]?_0x1a4390[_0x4807('0x1c')]['limit']||null:null,'include':_0x1a4390[_0x4807('0x1c')]?_0x1a4390[_0x4807('0x1c')][_0x4807('0x20')]?_[_0x4807('0x21')](_0x1a4390[_0x4807('0x1c')][_0x4807('0x20')],function(_0x1a7d06){return{'model':db[_0x1a7d06[_0x4807('0x22')]],'as':_0x1a7d06['as'],'attributes':_0x1a7d06[_0x4807('0x1f')],'include':_0x1a7d06[_0x4807('0x20')]?_[_0x4807('0x21')](_0x1a7d06['include'],function(_0xe1979e){return{'model':db[_0xe1979e[_0x4807('0x22')]],'as':_0xe1979e['as'],'attributes':_0xe1979e[_0x4807('0x1f')],'include':_0xe1979e[_0x4807('0x20')]?_[_0x4807('0x21')](_0xe1979e['include'],function(_0x31a7f1){return{'model':db[_0x31a7f1[_0x4807('0x22')]],'as':_0x31a7f1['as'],'attributes':_0x31a7f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4807('0x10')](function(_0x1f871f){logger['info']('GetFaxQueue',_0x1a4390);logger[_0x4807('0x14')](_0x4807('0x1b'),_0x1a4390,JSON['stringify'](_0x1f871f));_0x39a02b(_0x1f871f);})[_0x4807('0x1a')](function(_0x527164){logger[_0x4807('0x17')](_0x4807('0x1b'),_0x527164[_0x4807('0x18')],_0x1a4390);_0x32f16c(_0x44ddd0[_0x4807('0x17')](0x1f4,_0x527164['message']));});});};exports['ShowFaxQueue']=function(_0x417e88){var _0x3d56a2=this;return new Promise(function(_0x22880e,_0x8bc00e){return db[_0x4807('0x23')]['find']({'raw':_0x417e88['options']?_0x417e88[_0x4807('0x1c')][_0x4807('0x1d')]===undefined?!![]:![]:!![],'where':_0x417e88[_0x4807('0x1c')]?_0x417e88[_0x4807('0x1c')][_0x4807('0x1e')]||null:null,'attributes':_0x417e88['options']?_0x417e88[_0x4807('0x1c')][_0x4807('0x1f')]||null:null,'include':_0x417e88['options']?_0x417e88['options'][_0x4807('0x20')]?_[_0x4807('0x21')](_0x417e88[_0x4807('0x1c')]['include'],function(_0x420913){return{'model':db[_0x420913[_0x4807('0x22')]],'as':_0x420913['as'],'attributes':_0x420913[_0x4807('0x1f')],'include':_0x420913[_0x4807('0x20')]?_[_0x4807('0x21')](_0x420913[_0x4807('0x20')],function(_0xb4df9e){return{'model':db[_0xb4df9e[_0x4807('0x22')]],'as':_0xb4df9e['as'],'attributes':_0xb4df9e[_0x4807('0x1f')],'include':_0xb4df9e[_0x4807('0x20')]?_[_0x4807('0x21')](_0xb4df9e[_0x4807('0x20')],function(_0x3d7d04){return{'model':db[_0x3d7d04['model']],'as':_0x3d7d04['as'],'attributes':_0x3d7d04['attributes']};}):[]};}):[]};}):[]:[]})[_0x4807('0x10')](function(_0x128e14){logger['info'](_0x4807('0x24'),_0x417e88);logger[_0x4807('0x14')](_0x4807('0x24'),_0x417e88,JSON[_0x4807('0x16')](_0x128e14));_0x22880e(_0x128e14);})[_0x4807('0x1a')](function(_0x2d0053){logger[_0x4807('0x17')](_0x4807('0x24'),_0x2d0053[_0x4807('0x18')],_0x417e88);_0x8bc00e(_0x3d56a2[_0x4807('0x17')](0x1f4,_0x2d0053[_0x4807('0x18')]));});});}; \ No newline at end of file +var _0xe001=['findAll','options','raw','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','find','where','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','FaxQueue'];(function(_0x4f89c4,_0x19bddd){var _0x551018=function(_0x5b51fb){while(--_0x5b51fb){_0x4f89c4['push'](_0x4f89c4['shift']());}};_0x551018(++_0x19bddd);}(_0xe001,0x173));var _0x1e00=function(_0x2c6fb9,_0xc7d7c0){_0x2c6fb9=_0x2c6fb9-0x0;var _0x49fd5e=_0xe001[_0x2c6fb9];return _0x49fd5e;};'use strict';var _=require(_0x1e00('0x0'));var util=require(_0x1e00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e00('0x2'));var fs=require('fs');var Redis=require(_0x1e00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1e00('0x4'));var logger=require(_0x1e00('0x5'))(_0x1e00('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e00('0x7'));var client=jayson[_0x1e00('0x8')][_0x1e00('0x9')]({'port':0x232a});config[_0x1e00('0xa')]=_[_0x1e00('0xb')](config[_0x1e00('0xa')],{'host':_0x1e00('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1e00('0xd'))['register'](socket);function respondWithRpcPromise(_0x5eab93,_0x20d264,_0x5142ee){return new BPromise(function(_0x4e6a91,_0x182120){return client['request'](_0x5eab93,_0x5142ee)[_0x1e00('0xe')](function(_0x4a2944){logger[_0x1e00('0xf')](_0x1e00('0x10'),_0x20d264,_0x1e00('0x11'));logger[_0x1e00('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x20d264,'request\x20sent',JSON[_0x1e00('0x13')](_0x4a2944));if(_0x4a2944[_0x1e00('0x14')]){if(_0x4a2944[_0x1e00('0x14')][_0x1e00('0x15')]===0x1f4){logger[_0x1e00('0x14')](_0x1e00('0x10'),_0x20d264,_0x4a2944[_0x1e00('0x14')][_0x1e00('0x16')]);return _0x182120(_0x4a2944['error']['message']);}logger[_0x1e00('0x14')](_0x1e00('0x10'),_0x20d264,_0x4a2944['error'][_0x1e00('0x16')]);return _0x4e6a91(_0x4a2944[_0x1e00('0x14')][_0x1e00('0x16')]);}else{logger[_0x1e00('0xf')](_0x1e00('0x10'),_0x20d264,_0x1e00('0x11'));_0x4e6a91(_0x4a2944['result'][_0x1e00('0x16')]);}})[_0x1e00('0x17')](function(_0x25cd79){logger[_0x1e00('0x14')](_0x1e00('0x10'),_0x20d264,_0x25cd79);_0x182120(_0x25cd79);});});}exports['GetFaxQueue']=function(_0x582fea){var _0x5becc4=this;return new Promise(function(_0xdf6d42,_0x22db73){return db[_0x1e00('0x18')][_0x1e00('0x19')]({'raw':_0x582fea['options']?_0x582fea[_0x1e00('0x1a')][_0x1e00('0x1b')]===undefined?!![]:![]:!![],'where':_0x582fea[_0x1e00('0x1a')]?_0x582fea['options']['where']||null:null,'attributes':_0x582fea[_0x1e00('0x1a')]?_0x582fea[_0x1e00('0x1a')][_0x1e00('0x1c')]||null:null,'limit':_0x582fea[_0x1e00('0x1a')]?_0x582fea[_0x1e00('0x1a')]['limit']||null:null,'include':_0x582fea['options']?_0x582fea[_0x1e00('0x1a')][_0x1e00('0x1d')]?_[_0x1e00('0x1e')](_0x582fea[_0x1e00('0x1a')][_0x1e00('0x1d')],function(_0x3b2a07){return{'model':db[_0x3b2a07[_0x1e00('0x1f')]],'as':_0x3b2a07['as'],'attributes':_0x3b2a07[_0x1e00('0x1c')],'include':_0x3b2a07[_0x1e00('0x1d')]?_[_0x1e00('0x1e')](_0x3b2a07['include'],function(_0xe85ad5){return{'model':db[_0xe85ad5[_0x1e00('0x1f')]],'as':_0xe85ad5['as'],'attributes':_0xe85ad5[_0x1e00('0x1c')],'include':_0xe85ad5[_0x1e00('0x1d')]?_['map'](_0xe85ad5['include'],function(_0x30871a){return{'model':db[_0x30871a[_0x1e00('0x1f')]],'as':_0x30871a['as'],'attributes':_0x30871a[_0x1e00('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e00('0xe')](function(_0x166a8a){logger['info'](_0x1e00('0x20'),_0x582fea);logger[_0x1e00('0x12')]('GetFaxQueue',_0x582fea,JSON[_0x1e00('0x13')](_0x166a8a));_0xdf6d42(_0x166a8a);})[_0x1e00('0x17')](function(_0x290c7e){logger['error'](_0x1e00('0x20'),_0x290c7e[_0x1e00('0x16')],_0x582fea);_0x22db73(_0x5becc4[_0x1e00('0x14')](0x1f4,_0x290c7e[_0x1e00('0x16')]));});});};exports[_0x1e00('0x21')]=function(_0x1ea787){var _0x200780=this;return new Promise(function(_0x35b4b9,_0xdf3d81){return db[_0x1e00('0x18')][_0x1e00('0x22')]({'raw':_0x1ea787[_0x1e00('0x1a')]?_0x1ea787['options'][_0x1e00('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ea787[_0x1e00('0x1a')]?_0x1ea787[_0x1e00('0x1a')][_0x1e00('0x23')]||null:null,'attributes':_0x1ea787[_0x1e00('0x1a')]?_0x1ea787[_0x1e00('0x1a')][_0x1e00('0x1c')]||null:null,'include':_0x1ea787[_0x1e00('0x1a')]?_0x1ea787[_0x1e00('0x1a')][_0x1e00('0x1d')]?_['map'](_0x1ea787[_0x1e00('0x1a')][_0x1e00('0x1d')],function(_0x3dc09a){return{'model':db[_0x3dc09a[_0x1e00('0x1f')]],'as':_0x3dc09a['as'],'attributes':_0x3dc09a['attributes'],'include':_0x3dc09a['include']?_['map'](_0x3dc09a[_0x1e00('0x1d')],function(_0x57ee4c){return{'model':db[_0x57ee4c[_0x1e00('0x1f')]],'as':_0x57ee4c['as'],'attributes':_0x57ee4c[_0x1e00('0x1c')],'include':_0x57ee4c['include']?_[_0x1e00('0x1e')](_0x57ee4c[_0x1e00('0x1d')],function(_0x13ae3b){return{'model':db[_0x13ae3b[_0x1e00('0x1f')]],'as':_0x13ae3b['as'],'attributes':_0x13ae3b[_0x1e00('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9ae377){logger[_0x1e00('0xf')](_0x1e00('0x21'),_0x1ea787);logger[_0x1e00('0x12')]('ShowFaxQueue',_0x1ea787,JSON[_0x1e00('0x13')](_0x9ae377));_0x35b4b9(_0x9ae377);})[_0x1e00('0x17')](function(_0x5cc287){logger[_0x1e00('0x14')]('ShowFaxQueue',_0x5cc287[_0x1e00('0x16')],_0x1ea787);_0xdf3d81(_0x200780['error'](0x1f4,_0x5cc287['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 780c351..2047110 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 _0x3f1b=['remove','length','save'];(function(_0x3108cf,_0x36b667){var _0x320255=function(_0x56b4a9){while(--_0x56b4a9){_0x3108cf['push'](_0x3108cf['shift']());}};_0x320255(++_0x36b667);}(_0x3f1b,0xad));var _0xb3f1=function(_0x19cade,_0x42510d){_0x19cade=_0x19cade-0x0;var _0xaf01fa=_0x3f1b[_0x19cade];return _0xaf01fa;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xb3f1('0x0'),_0xb3f1('0x1'),'update'];function createListener(_0x14cb2b,_0x1b8eb8){return function(_0x46448c){_0x1b8eb8['emit'](_0x14cb2b,_0x46448c);};}function removeListener(_0x504d5c,_0x532d87){return function(){FaxQueueEvents['removeListener'](_0x504d5c,_0x532d87);};}exports['register']=function(_0x2f1277){for(var _0x5696b2=0x0,_0x4d05f1=events[_0xb3f1('0x2')];_0x5696b2<_0x4d05f1;_0x5696b2++){var _0x4154c2=events[_0x5696b2];var _0x2fccf8=createListener('faxQueue:'+_0x4154c2,_0x2f1277);FaxQueueEvents['on'](_0x4154c2,_0x2fccf8);}}; \ No newline at end of file +var _0xd909=['save','remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd909,0x1c1));var _0x9d90=function(_0x3323c6,_0x41f0db){_0x3323c6=_0x3323c6-0x0;var _0x5833c9=_0xd909[_0x3323c6];return _0x5833c9;};'use strict';var FaxQueueEvents=require(_0x9d90('0x0'));var events=[_0x9d90('0x1'),_0x9d90('0x2'),_0x9d90('0x3')];function createListener(_0x4309c0,_0x28addf){return function(_0x435d2e){_0x28addf[_0x9d90('0x4')](_0x4309c0,_0x435d2e);};}function removeListener(_0x3f8de1,_0x1c71d9){return function(){FaxQueueEvents[_0x9d90('0x5')](_0x3f8de1,_0x1c71d9);};}exports[_0x9d90('0x6')]=function(_0x4e2274){for(var _0x4ab66a=0x0,_0xba0ada=events[_0x9d90('0x7')];_0x4ab66a<_0xba0ada;_0x4ab66a++){var _0x5bac97=events[_0x4ab66a];var _0x3cd124=createListener(_0x9d90('0x8')+_0x5bac97,_0x4e2274);FaxQueueEvents['on'](_0x5bac97,_0x3cd124);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9af7a1e..89cac16 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 _0xfc56=['isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','removeTeams','delete','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','/describe','/:id'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc56,0xd7));var _0x6fc5=function(_0x46b022,_0xd7585c){_0x46b022=_0x46b022-0x0;var _0x3aefeb=_0xfc56[_0x46b022];return _0x3aefeb;};'use strict';var multer=require(_0x6fc5('0x0'));var util=require('util');var path=require(_0x6fc5('0x1'));var timeout=require('connect-timeout');var express=require(_0x6fc5('0x2'));var router=express[_0x6fc5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6fc5('0x4'));var config=require(_0x6fc5('0x5'));var controller=require(_0x6fc5('0x6'));router[_0x6fc5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6fc5('0x7')](_0x6fc5('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6fc5('0x9'),auth[_0x6fc5('0xa')](),controller[_0x6fc5('0xb')]);router[_0x6fc5('0x7')]('/:id/members',auth[_0x6fc5('0xa')](),controller[_0x6fc5('0xc')]);router[_0x6fc5('0x7')](_0x6fc5('0xd'),auth[_0x6fc5('0xa')](),controller[_0x6fc5('0xe')]);router[_0x6fc5('0x7')](_0x6fc5('0xf'),auth[_0x6fc5('0xa')](),controller[_0x6fc5('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6fc5('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6fc5('0x12')]);router[_0x6fc5('0x11')](_0x6fc5('0xf'),auth[_0x6fc5('0xa')](),controller['addAgents']);router[_0x6fc5('0x13')](_0x6fc5('0x9'),auth['isAuthenticated'](),controller[_0x6fc5('0x14')]);router['delete'](_0x6fc5('0x9'),auth[_0x6fc5('0xa')](),controller['destroy']);router['delete'](_0x6fc5('0xd'),auth['isAuthenticated'](),controller[_0x6fc5('0x15')]);router[_0x6fc5('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x6fc5('0x17')]);module[_0x6fc5('0x18')]=router; \ No newline at end of file +var _0xa094=['util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x4dfe50,_0x4210b6){var _0x416a27=function(_0xa0561){while(--_0xa0561){_0x4dfe50['push'](_0x4dfe50['shift']());}};_0x416a27(++_0x4210b6);}(_0xa094,0xc4));var _0x4a09=function(_0x37a55f,_0x42dd96){_0x37a55f=_0x37a55f-0x0;var _0x3f05d9=_0xa094[_0x37a55f];return _0x3f05d9;};'use strict';var multer=require('multer');var util=require(_0x4a09('0x0'));var path=require(_0x4a09('0x1'));var timeout=require(_0x4a09('0x2'));var express=require(_0x4a09('0x3'));var router=express[_0x4a09('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4a09('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x4a09('0x6')]('/',auth[_0x4a09('0x7')](),controller[_0x4a09('0x8')]);router[_0x4a09('0x6')](_0x4a09('0x9'),auth['isAuthenticated'](),controller[_0x4a09('0xa')]);router[_0x4a09('0x6')](_0x4a09('0xb'),auth['isAuthenticated'](),controller[_0x4a09('0xc')]);router[_0x4a09('0x6')](_0x4a09('0xd'),auth[_0x4a09('0x7')](),controller['getMembers']);router[_0x4a09('0x6')](_0x4a09('0xe'),auth['isAuthenticated'](),controller[_0x4a09('0xf')]);router['get'](_0x4a09('0x10'),auth['isAuthenticated'](),controller[_0x4a09('0x11')]);router[_0x4a09('0x12')]('/',auth[_0x4a09('0x7')](),controller[_0x4a09('0x13')]);router['post']('/:id/teams',auth[_0x4a09('0x7')](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x4a09('0x14')]);router[_0x4a09('0x15')](_0x4a09('0xb'),auth[_0x4a09('0x7')](),controller[_0x4a09('0x16')]);router[_0x4a09('0x17')](_0x4a09('0xb'),auth[_0x4a09('0x7')](),controller[_0x4a09('0x18')]);router[_0x4a09('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4a09('0x19')]);router[_0x4a09('0x17')]('/:id/users',auth[_0x4a09('0x7')](),controller[_0x4a09('0x1a')]);module[_0x4a09('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b364508..867f2ed 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 _0x643d=['STRING','DATE','sequelize','exports'];(function(_0x1f7f12,_0x2636c4){var _0x290746=function(_0x24cf1e){while(--_0x24cf1e){_0x1f7f12['push'](_0x1f7f12['shift']());}};_0x290746(++_0x2636c4);}(_0x643d,0x11e));var _0xd643=function(_0x5c693b,_0x19502d){_0x5c693b=_0x5c693b-0x0;var _0x4fd6f4=_0x643d[_0x5c693b];return _0x4fd6f4;};'use strict';var moment=require('moment');var Sequelize=require(_0xd643('0x0'));module[_0xd643('0x1')]={'uniqueid':{'type':Sequelize[_0xd643('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd643('0x2')]},'joinAt':{'type':Sequelize[_0xd643('0x3')]},'leaveAt':{'type':Sequelize[_0xd643('0x3')]},'acceptAt':{'type':Sequelize[_0xd643('0x3')]},'exitAt':{'type':Sequelize[_0xd643('0x3')]},'reason':{'type':Sequelize[_0xd643('0x2')]}}; \ No newline at end of file +var _0xffeb=['sequelize','STRING','DATE','moment'];(function(_0x410493,_0x254f6a){var _0x2dab71=function(_0x4a46dd){while(--_0x4a46dd){_0x410493['push'](_0x410493['shift']());}};_0x2dab71(++_0x254f6a);}(_0xffeb,0x16f));var _0xbffe=function(_0x5b328a,_0x5c48bc){_0x5b328a=_0x5b328a-0x0;var _0xfcf474=_0xffeb[_0x5b328a];return _0xfcf474;};'use strict';var moment=require(_0xbffe('0x0'));var Sequelize=require(_0xbffe('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbffe('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbffe('0x3')]},'acceptAt':{'type':Sequelize[_0xbffe('0x3')]},'exitAt':{'type':Sequelize[_0xbffe('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1fcf570..4a8e767 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 _0xb9f4=['index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','include','find','FaxQueueReport','create','body','update','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0xb9f4,0x101));var _0x4b9f=function(_0x3afdf1,_0x479ac5){_0x3afdf1=_0x3afdf1-0x0;var _0xd01abf=_0xb9f4[_0x3afdf1];return _0xd01abf;};'use strict';var pdf=require(_0x4b9f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b9f('0x1'));var zipdir=require(_0x4b9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b9f('0x3'));var moment=require(_0x4b9f('0x4'));var BPromise=require(_0x4b9f('0x5'));var Mustache=require(_0x4b9f('0x6'));var util=require(_0x4b9f('0x7'));var path=require(_0x4b9f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b9f('0x9'));var fs=require('fs');var _=require(_0x4b9f('0xa'));var squel=require(_0x4b9f('0xb'));var crypto=require(_0x4b9f('0xc'));var jsforce=require(_0x4b9f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4b9f('0xe'));var querystring=require(_0x4b9f('0xf'));var Papa=require(_0x4b9f('0x10'));var authService=require(_0x4b9f('0x11'));var hardwareService=require(_0x4b9f('0x12'));var Redis=require(_0x4b9f('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x4b9f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x596cff,_0x574676){_0x574676=_0x574676||0xcc;return function(_0x1e51c7){if(_0x1e51c7){return _0x596cff[_0x4b9f('0x15')](_0x574676);}return _0x596cff[_0x4b9f('0x16')](_0x574676)[_0x4b9f('0x17')]();};}function respondWithResult(_0x2165ed,_0x501bdd){_0x501bdd=_0x501bdd||0xc8;return function(_0x577269){if(_0x577269){return _0x2165ed[_0x4b9f('0x16')](_0x501bdd)[_0x4b9f('0x18')](_0x577269);}};}function respondWithFilteredResult(_0x1a80eb,_0x5eebd6){return function(_0x1230b8){if(_0x1230b8){var _0x3b8d6a=_0x1230b8[_0x4b9f('0x19')],_0x2ee988=_0x5eebd6[_0x4b9f('0x1a')],_0x5e54b9=_0x5eebd6[_0x4b9f('0x1a')]+_0x5eebd6[_0x4b9f('0x1b')],_0x54e7d5;if(_0x5e54b9>=_0x3b8d6a){_0x5e54b9=_0x3b8d6a;_0x54e7d5=0xc8;}else{_0x54e7d5=0xce;}_0x1a80eb['status'](_0x54e7d5);return _0x1a80eb[_0x4b9f('0x1c')](_0x4b9f('0x1d'),_0x2ee988+'-'+_0x5e54b9+'/'+_0x3b8d6a)[_0x4b9f('0x18')](_0x1230b8);}return null;};}function patchUpdates(_0x394a18){return function(_0x5302c8){try{jsonpatch[_0x4b9f('0x1e')](_0x5302c8,_0x394a18,!![]);}catch(_0x21dcdd){return BPromise[_0x4b9f('0x1f')](_0x21dcdd);}return _0x5302c8[_0x4b9f('0x20')]();};}function saveUpdates(_0x5c40bc,_0x102f9a){return function(_0x574b0a){if(_0x574b0a){return _0x574b0a['update'](_0x5c40bc)[_0x4b9f('0x21')](function(_0xe8384e){return _0xe8384e;});}return null;};}function removeEntity(_0x3d0cc5,_0x4c331f){return function(_0x3978bd){if(_0x3978bd){return _0x3978bd[_0x4b9f('0x22')]()[_0x4b9f('0x21')](function(){_0x3d0cc5[_0x4b9f('0x16')](0xcc)[_0x4b9f('0x17')]();});}};}function handleEntityNotFound(_0x13ab4a,_0x9e06f0){return function(_0x10b3c5){if(!_0x10b3c5){_0x13ab4a[_0x4b9f('0x15')](0x194);}return _0x10b3c5;};}function handleError(_0x1eeec3,_0x3aca49){_0x3aca49=_0x3aca49||0x1f4;return function(_0x207b2){logger[_0x4b9f('0x23')](_0x207b2[_0x4b9f('0x24')]);if(_0x207b2[_0x4b9f('0x25')]){delete _0x207b2[_0x4b9f('0x25')];}_0x1eeec3[_0x4b9f('0x16')](_0x3aca49)[_0x4b9f('0x26')](_0x207b2);};}exports[_0x4b9f('0x27')]=function(_0x22f928,_0x59d06a){var _0x1660f2={},_0x4c7fc6={},_0x39e2f4={'count':0x0,'rows':[]};var _0x4c9ecc=db['FaxQueueReport'][_0x4b9f('0x28')];_0x4c7fc6[_0x4b9f('0x29')]=_[_0x4b9f('0x2a')](_0x4c9ecc);_0x4c7fc6[_0x4b9f('0x2b')]=_[_0x4b9f('0x2a')](_0x22f928['query']);_0x4c7fc6['filters']=_['intersection'](_0x4c7fc6['model'],_0x4c7fc6[_0x4b9f('0x2b')]);_0x1660f2[_0x4b9f('0x2c')]=_[_0x4b9f('0x2d')](_0x4c7fc6[_0x4b9f('0x29')],qs[_0x4b9f('0x2e')](_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x2e')]));_0x1660f2[_0x4b9f('0x2c')]=_0x1660f2[_0x4b9f('0x2c')][_0x4b9f('0x2f')]?_0x1660f2['attributes']:_0x4c7fc6[_0x4b9f('0x29')];if(!_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x30')]('nolimit')){_0x1660f2[_0x4b9f('0x1b')]=qs[_0x4b9f('0x1b')](_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x1b')]);_0x1660f2['offset']=qs[_0x4b9f('0x1a')](_0x22f928[_0x4b9f('0x2b')]['offset']);}_0x1660f2[_0x4b9f('0x31')]=qs[_0x4b9f('0x32')](_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x32')]);_0x1660f2[_0x4b9f('0x33')]=qs[_0x4b9f('0x34')](_[_0x4b9f('0x35')](_0x22f928['query'],_0x4c7fc6[_0x4b9f('0x34')]));if(_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x36')]){_0x1660f2[_0x4b9f('0x33')]=_[_0x4b9f('0x37')](_0x1660f2[_0x4b9f('0x33')],{'$or':_[_0x4b9f('0x38')](_0x4c9ecc,function(_0x17ee5e){if(_0x17ee5e[_0x4b9f('0x39')][_0x4b9f('0x3a')]!==_0x4b9f('0x3b')){var _0x1b105f={};_0x1b105f[_0x17ee5e[_0x4b9f('0x3c')]]={'$like':'%'+_0x22f928['query'][_0x4b9f('0x36')]+'%'};return _0x1b105f;}})});}_0x1660f2=_[_0x4b9f('0x37')]({},_0x1660f2,_0x22f928[_0x4b9f('0x3d')]);var _0x40e6af={'where':_0x1660f2[_0x4b9f('0x33')]};return db['FaxQueueReport'][_0x4b9f('0x19')](_0x40e6af)[_0x4b9f('0x21')](function(_0x43a4bd){_0x39e2f4[_0x4b9f('0x19')]=_0x43a4bd;if(_0x22f928[_0x4b9f('0x2b')][_0x4b9f('0x3e')]){_0x1660f2['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x4b9f('0x3f')](_0x1660f2);})['then'](function(_0x22cb9e){_0x39e2f4[_0x4b9f('0x40')]=_0x22cb9e;return _0x39e2f4;})[_0x4b9f('0x21')](respondWithFilteredResult(_0x59d06a,_0x1660f2))[_0x4b9f('0x41')](handleError(_0x59d06a,null));};exports['show']=function(_0x671fce,_0x5d49b6){var _0x1dc259={'raw':!![],'where':{'id':_0x671fce[_0x4b9f('0x42')]['id']}},_0x136911={};_0x136911[_0x4b9f('0x29')]=_[_0x4b9f('0x2a')](db['FaxQueueReport'][_0x4b9f('0x28')]);_0x136911[_0x4b9f('0x2b')]=_['keys'](_0x671fce[_0x4b9f('0x2b')]);_0x136911[_0x4b9f('0x34')]=_[_0x4b9f('0x2d')](_0x136911['model'],_0x136911['query']);_0x1dc259[_0x4b9f('0x2c')]=_[_0x4b9f('0x2d')](_0x136911[_0x4b9f('0x29')],qs[_0x4b9f('0x2e')](_0x671fce['query'][_0x4b9f('0x2e')]));_0x1dc259['attributes']=_0x1dc259['attributes']['length']?_0x1dc259['attributes']:_0x136911[_0x4b9f('0x29')];if(_0x671fce['query'][_0x4b9f('0x3e')]){_0x1dc259[_0x4b9f('0x43')]=[{'all':!![]}];}_0x1dc259=_['merge']({},_0x1dc259,_0x671fce[_0x4b9f('0x3d')]);return db['FaxQueueReport'][_0x4b9f('0x44')](_0x1dc259)[_0x4b9f('0x21')](handleEntityNotFound(_0x5d49b6,null))['then'](respondWithResult(_0x5d49b6,null))[_0x4b9f('0x41')](handleError(_0x5d49b6,null));};exports['create']=function(_0x444462,_0xbc3aa){return db[_0x4b9f('0x45')][_0x4b9f('0x46')](_0x444462[_0x4b9f('0x47')],{})['then'](respondWithResult(_0xbc3aa,0xc9))[_0x4b9f('0x41')](handleError(_0xbc3aa,null));};exports[_0x4b9f('0x48')]=function(_0x5124b0,_0x5a2a31){if(_0x5124b0[_0x4b9f('0x47')]['id']){delete _0x5124b0[_0x4b9f('0x47')]['id'];}return db[_0x4b9f('0x45')]['find']({'where':{'id':_0x5124b0[_0x4b9f('0x42')]['id']}})[_0x4b9f('0x21')](handleEntityNotFound(_0x5a2a31,null))[_0x4b9f('0x21')](saveUpdates(_0x5124b0[_0x4b9f('0x47')],null))[_0x4b9f('0x21')](respondWithResult(_0x5a2a31,null))['catch'](handleError(_0x5a2a31,null));};exports[_0x4b9f('0x22')]=function(_0x259fbd,_0x4f7e6d){return db[_0x4b9f('0x45')][_0x4b9f('0x44')]({'where':{'id':_0x259fbd[_0x4b9f('0x42')]['id']}})[_0x4b9f('0x21')](handleEntityNotFound(_0x4f7e6d,null))[_0x4b9f('0x21')](removeEntity(_0x4f7e6d,null))['catch'](handleError(_0x4f7e6d,null));};exports[_0x4b9f('0x49')]=function(_0x538e5e,_0x2b887c){return db['FaxQueueReport'][_0x4b9f('0x49')]()[_0x4b9f('0x21')](respondWithResult(_0x2b887c,null))['catch'](handleError(_0x2b887c,null));}; \ No newline at end of file +var _0xbe53=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','send','index','FaxQueueReport','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','catch','show','params','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','squel','desk.js','querystring','../../config/license/hardware'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xbe53,0x1c3));var _0x3be5=function(_0x2e2f01,_0xd6540a){_0x2e2f01=_0x2e2f01-0x0;var _0x2172ef=_0xbe53[_0x2e2f01];return _0x2172ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3be5('0x0'));var rimraf=require(_0x3be5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3be5('0x2'));var rp=require('request-promise');var moment=require(_0x3be5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3be5('0x4'));var path=require('path');var sox=require(_0x3be5('0x5'));var csv=require(_0x3be5('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3be5('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3be5('0x8'));var toCsv=require(_0x3be5('0x6'));var querystring=require(_0x3be5('0x9'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x3be5('0xa'));var Redis=require('ioredis');var qs=require(_0x3be5('0xb'));var logger=require(_0x3be5('0xc'))(_0x3be5('0xd'));var utils=require(_0x3be5('0xe'));var config=require('../../config/environment');var db=require(_0x3be5('0xf'))['db'];function respondWithStatusCode(_0x38d5d6,_0x47e21f){_0x47e21f=_0x47e21f||0xcc;return function(_0x227b2a){if(_0x227b2a){return _0x38d5d6[_0x3be5('0x10')](_0x47e21f);}return _0x38d5d6[_0x3be5('0x11')](_0x47e21f)[_0x3be5('0x12')]();};}function respondWithResult(_0x1b2254,_0x2897d0){_0x2897d0=_0x2897d0||0xc8;return function(_0x4f8a4b){if(_0x4f8a4b){return _0x1b2254[_0x3be5('0x11')](_0x2897d0)[_0x3be5('0x13')](_0x4f8a4b);}};}function respondWithFilteredResult(_0x5d31d4,_0x1657f7){return function(_0x69937e){if(_0x69937e){var _0x43fdc6=_0x69937e[_0x3be5('0x14')],_0x1187fc=_0x1657f7[_0x3be5('0x15')],_0x14117b=_0x1657f7[_0x3be5('0x15')]+_0x1657f7[_0x3be5('0x16')],_0x342f6f;if(_0x14117b>=_0x43fdc6){_0x14117b=_0x43fdc6;_0x342f6f=0xc8;}else{_0x342f6f=0xce;}_0x5d31d4['status'](_0x342f6f);return _0x5d31d4[_0x3be5('0x17')](_0x3be5('0x18'),_0x1187fc+'-'+_0x14117b+'/'+_0x43fdc6)['json'](_0x69937e);}return null;};}function patchUpdates(_0x500512){return function(_0x10221b){try{jsonpatch['apply'](_0x10221b,_0x500512,!![]);}catch(_0x5cb37c){return BPromise['reject'](_0x5cb37c);}return _0x10221b[_0x3be5('0x19')]();};}function saveUpdates(_0x1201d6,_0xe825bd){return function(_0x1dc0b0){if(_0x1dc0b0){return _0x1dc0b0[_0x3be5('0x1a')](_0x1201d6)[_0x3be5('0x1b')](function(_0x571c15){return _0x571c15;});}return null;};}function removeEntity(_0xdb66a1,_0x2c0917){return function(_0x300cf){if(_0x300cf){return _0x300cf[_0x3be5('0x1c')]()['then'](function(){_0xdb66a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cf4b8,_0x3592ee){return function(_0x205e9e){if(!_0x205e9e){_0x4cf4b8[_0x3be5('0x10')](0x194);}return _0x205e9e;};}function handleError(_0x37aaf2,_0x414459){_0x414459=_0x414459||0x1f4;return function(_0x3215d8){logger[_0x3be5('0x1d')](_0x3215d8[_0x3be5('0x1e')]);if(_0x3215d8['name']){delete _0x3215d8['name'];}_0x37aaf2[_0x3be5('0x11')](_0x414459)[_0x3be5('0x1f')](_0x3215d8);};}exports[_0x3be5('0x20')]=function(_0x1dbd19,_0x570a23){var _0x163d3a={},_0x4994c6={},_0x220210={'count':0x0,'rows':[]};var _0x18eafe=db[_0x3be5('0x21')]['rawAttributes'];_0x4994c6[_0x3be5('0x22')]=_[_0x3be5('0x23')](_0x18eafe);_0x4994c6[_0x3be5('0x24')]=_[_0x3be5('0x23')](_0x1dbd19[_0x3be5('0x24')]);_0x4994c6[_0x3be5('0x25')]=_['intersection'](_0x4994c6['model'],_0x4994c6['query']);_0x163d3a['attributes']=_[_0x3be5('0x26')](_0x4994c6['model'],qs[_0x3be5('0x27')](_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x27')]));_0x163d3a[_0x3be5('0x28')]=_0x163d3a[_0x3be5('0x28')]['length']?_0x163d3a[_0x3be5('0x28')]:_0x4994c6[_0x3be5('0x22')];if(!_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x29')](_0x3be5('0x2a'))){_0x163d3a[_0x3be5('0x16')]=qs[_0x3be5('0x16')](_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x16')]);_0x163d3a[_0x3be5('0x15')]=qs['offset'](_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x15')]);}_0x163d3a[_0x3be5('0x2b')]=qs['sort'](_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x2c')]);_0x163d3a['where']=qs[_0x3be5('0x25')](_[_0x3be5('0x2d')](_0x1dbd19[_0x3be5('0x24')],_0x4994c6['filters']));if(_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x2e')]){_0x163d3a['where']=_[_0x3be5('0x2f')](_0x163d3a[_0x3be5('0x30')],{'$or':_[_0x3be5('0x31')](_0x18eafe,function(_0x3ae03e){if(_0x3ae03e[_0x3be5('0x32')][_0x3be5('0x33')]!==_0x3be5('0x34')){var _0x34d23b={};_0x34d23b[_0x3ae03e[_0x3be5('0x35')]]={'$like':'%'+_0x1dbd19[_0x3be5('0x24')]['filter']+'%'};return _0x34d23b;}})});}_0x163d3a=_[_0x3be5('0x2f')]({},_0x163d3a,_0x1dbd19[_0x3be5('0x36')]);var _0x41d89c={'where':_0x163d3a['where']};return db[_0x3be5('0x21')][_0x3be5('0x14')](_0x41d89c)['then'](function(_0x45209a){_0x220210[_0x3be5('0x14')]=_0x45209a;if(_0x1dbd19[_0x3be5('0x24')][_0x3be5('0x37')]){_0x163d3a['include']=[{'all':!![]}];}return db[_0x3be5('0x21')]['findAll'](_0x163d3a);})[_0x3be5('0x1b')](function(_0x2f6abc){_0x220210['rows']=_0x2f6abc;return _0x220210;})[_0x3be5('0x1b')](respondWithFilteredResult(_0x570a23,_0x163d3a))[_0x3be5('0x38')](handleError(_0x570a23,null));};exports[_0x3be5('0x39')]=function(_0x475430,_0x540e91){var _0x4f694d={'raw':!![],'where':{'id':_0x475430[_0x3be5('0x3a')]['id']}},_0x512f99={};_0x512f99[_0x3be5('0x22')]=_[_0x3be5('0x23')](db['FaxQueueReport'][_0x3be5('0x3b')]);_0x512f99[_0x3be5('0x24')]=_[_0x3be5('0x23')](_0x475430[_0x3be5('0x24')]);_0x512f99[_0x3be5('0x25')]=_['intersection'](_0x512f99[_0x3be5('0x22')],_0x512f99[_0x3be5('0x24')]);_0x4f694d['attributes']=_[_0x3be5('0x26')](_0x512f99[_0x3be5('0x22')],qs[_0x3be5('0x27')](_0x475430[_0x3be5('0x24')][_0x3be5('0x27')]));_0x4f694d[_0x3be5('0x28')]=_0x4f694d['attributes'][_0x3be5('0x3c')]?_0x4f694d['attributes']:_0x512f99[_0x3be5('0x22')];if(_0x475430['query'][_0x3be5('0x37')]){_0x4f694d[_0x3be5('0x3d')]=[{'all':!![]}];}_0x4f694d=_[_0x3be5('0x2f')]({},_0x4f694d,_0x475430['options']);return db[_0x3be5('0x21')][_0x3be5('0x3e')](_0x4f694d)[_0x3be5('0x1b')](handleEntityNotFound(_0x540e91,null))[_0x3be5('0x1b')](respondWithResult(_0x540e91,null))[_0x3be5('0x38')](handleError(_0x540e91,null));};exports[_0x3be5('0x3f')]=function(_0x5b164f,_0x7e4e10){return db[_0x3be5('0x21')]['create'](_0x5b164f['body'],{})[_0x3be5('0x1b')](respondWithResult(_0x7e4e10,0xc9))[_0x3be5('0x38')](handleError(_0x7e4e10,null));};exports[_0x3be5('0x1a')]=function(_0x16999b,_0x221c42){if(_0x16999b['body']['id']){delete _0x16999b[_0x3be5('0x40')]['id'];}return db[_0x3be5('0x21')][_0x3be5('0x3e')]({'where':{'id':_0x16999b[_0x3be5('0x3a')]['id']}})[_0x3be5('0x1b')](handleEntityNotFound(_0x221c42,null))[_0x3be5('0x1b')](saveUpdates(_0x16999b[_0x3be5('0x40')],null))[_0x3be5('0x1b')](respondWithResult(_0x221c42,null))['catch'](handleError(_0x221c42,null));};exports[_0x3be5('0x1c')]=function(_0xb495e4,_0x1d393d){return db[_0x3be5('0x21')]['find']({'where':{'id':_0xb495e4[_0x3be5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1d393d,null))['then'](removeEntity(_0x1d393d,null))[_0x3be5('0x38')](handleError(_0x1d393d,null));};exports['describe']=function(_0x36f414,_0x3e4f77){return db[_0x3be5('0x21')][_0x3be5('0x41')]()['then'](respondWithResult(_0x3e4f77,null))[_0x3be5('0x38')](handleError(_0x3e4f77,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a3ed4c1..b16ead9 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 _0x13e9=['moment','request-promise','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x499b6c,_0x137024){var _0x4a9d83=function(_0x5e364a){while(--_0x5e364a){_0x499b6c['push'](_0x499b6c['shift']());}};_0x4a9d83(++_0x137024);}(_0x13e9,0x1bf));var _0x913e=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x13e9[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x913e('0x0'));var util=require('util');var logger=require(_0x913e('0x1'))(_0x913e('0x2'));var moment=require(_0x913e('0x3'));var BPromise=require('bluebird');var rp=require(_0x913e('0x4'));var attributes=require('./faxQueueReport.attributes');module[_0x913e('0x5')]=function(_0x9f3a16,_0x1619e6){return _0x9f3a16['define'](_0x913e('0x6'),attributes,{'tableName':_0x913e('0x7'),'paranoid':![],'indexes':[{'name':_0x913e('0x8'),'fields':[_0x913e('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b8e=['define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','./faxQueueReport.attributes','exports'];(function(_0x379603,_0x5e99cb){var _0x335565=function(_0x208cab){while(--_0x208cab){_0x379603['push'](_0x379603['shift']());}};_0x335565(++_0x5e99cb);}(_0x1b8e,0x158));var _0xe1b8=function(_0x42b64d,_0x4738b0){_0x42b64d=_0x42b64d-0x0;var _0x5b6389=_0x1b8e[_0x42b64d];return _0x5b6389;};'use strict';var _=require(_0xe1b8('0x0'));var util=require(_0xe1b8('0x1'));var logger=require(_0xe1b8('0x2'))(_0xe1b8('0x3'));var moment=require(_0xe1b8('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1b8('0x5'));var attributes=require(_0xe1b8('0x6'));module[_0xe1b8('0x7')]=function(_0x270be7,_0x5d37d4){return _0x270be7[_0xe1b8('0x8')]('FaxQueueReport',attributes,{'tableName':_0xe1b8('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe1b8('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 743f052..d559081 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 _0xd732=['then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','catch','UpdateFaxQueueReport','update','body','where','attributes','lodash','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','request'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd732,0x18e));var _0x2d73=function(_0x59fd83,_0x372336){_0x59fd83=_0x59fd83-0x0;var _0x9b73ea=_0xd732[_0x59fd83];return _0x9b73ea;};'use strict';var _=require(_0x2d73('0x0'));var util=require('util');var moment=require(_0x2d73('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d73('0x2'));var db=require(_0x2d73('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d73('0x4'));var config=require('../../config/environment');var jayson=require(_0x2d73('0x5'));var client=jayson[_0x2d73('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5be94f,_0x44c742,_0x541112){return new BPromise(function(_0x26be01,_0x301b50){return client[_0x2d73('0x7')](_0x5be94f,_0x541112)[_0x2d73('0x8')](function(_0x56f52d){logger[_0x2d73('0x9')](_0x2d73('0xa'),_0x44c742,_0x2d73('0xb'));logger[_0x2d73('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x44c742,_0x2d73('0xb'),JSON[_0x2d73('0xd')](_0x56f52d));if(_0x56f52d[_0x2d73('0xe')]){if(_0x56f52d[_0x2d73('0xe')][_0x2d73('0xf')]===0x1f4){logger[_0x2d73('0xe')](_0x2d73('0xa'),_0x44c742,_0x56f52d[_0x2d73('0xe')][_0x2d73('0x10')]);return _0x301b50(_0x56f52d[_0x2d73('0xe')][_0x2d73('0x10')]);}logger[_0x2d73('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x44c742,_0x56f52d[_0x2d73('0xe')]['message']);return _0x26be01(_0x56f52d[_0x2d73('0xe')]['message']);}else{logger[_0x2d73('0x9')](_0x2d73('0xa'),_0x44c742,_0x2d73('0xb'));_0x26be01(_0x56f52d[_0x2d73('0x11')][_0x2d73('0x10')]);}})['catch'](function(_0x57721e){logger['error'](_0x2d73('0xa'),_0x44c742,_0x57721e);_0x301b50(_0x57721e);});});}exports[_0x2d73('0x12')]=function(_0x43a2a5){var _0x54dca8=this;return new Promise(function(_0x303dfe,_0xd7e922){return db[_0x2d73('0x13')][_0x2d73('0x14')](_0x43a2a5['body'],{'raw':_0x43a2a5['options']?_0x43a2a5[_0x2d73('0x15')][_0x2d73('0x16')]===undefined?!![]:![]:!![]})[_0x2d73('0x8')](function(_0x350d7d){logger[_0x2d73('0x9')](_0x2d73('0x12'),_0x43a2a5);logger[_0x2d73('0xc')](_0x2d73('0x12'),_0x43a2a5,JSON['stringify'](_0x350d7d));_0x303dfe(_0x350d7d);})[_0x2d73('0x17')](function(_0x233f57){logger[_0x2d73('0xe')](_0x2d73('0x12'),_0x233f57['message'],_0x43a2a5);_0xd7e922(_0x54dca8[_0x2d73('0xe')](0x1f4,_0x233f57[_0x2d73('0x10')]));});});};exports[_0x2d73('0x18')]=function(_0x1bcb10){var _0x1899d6=this;return new Promise(function(_0x152aba,_0x263b35){return db[_0x2d73('0x13')][_0x2d73('0x19')](_0x1bcb10[_0x2d73('0x1a')],{'raw':_0x1bcb10[_0x2d73('0x15')]?_0x1bcb10[_0x2d73('0x15')][_0x2d73('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcb10[_0x2d73('0x15')]?_0x1bcb10[_0x2d73('0x15')][_0x2d73('0x1b')]||null:null,'attributes':_0x1bcb10[_0x2d73('0x15')]?_0x1bcb10['options'][_0x2d73('0x1c')]||null:null,'limit':_0x1bcb10[_0x2d73('0x15')]?_0x1bcb10[_0x2d73('0x15')]['limit']||null:null})['then'](function(_0x1458b7){logger[_0x2d73('0x9')]('UpdateFaxQueueReport',_0x1bcb10);logger['debug'](_0x2d73('0x18'),_0x1bcb10,JSON[_0x2d73('0xd')](_0x1458b7));_0x152aba(_0x1458b7);})[_0x2d73('0x17')](function(_0x5955a8){logger['error'](_0x2d73('0x18'),_0x5955a8[_0x2d73('0x10')],_0x1bcb10);_0x263b35(_0x1899d6[_0x2d73('0xe')](0x1f4,_0x5955a8['message']));});});}; \ No newline at end of file +var _0x4345=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0xe18afb,_0x8ec22c){var _0x19501d=function(_0x4ba2da){while(--_0x4ba2da){_0xe18afb['push'](_0xe18afb['shift']());}};_0x19501d(++_0x8ec22c);}(_0x4345,0x77));var _0x5434=function(_0x48a4e5,_0x4453ca){_0x48a4e5=_0x48a4e5-0x0;var _0x3d4617=_0x4345[_0x48a4e5];return _0x3d4617;};'use strict';var _=require(_0x5434('0x0'));var util=require(_0x5434('0x1'));var moment=require('moment');var BPromise=require(_0x5434('0x2'));var rs=require(_0x5434('0x3'));var fs=require('fs');var Redis=require(_0x5434('0x4'));var db=require(_0x5434('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5434('0x6'))('rpc');var config=require(_0x5434('0x7'));var jayson=require(_0x5434('0x8'));var client=jayson[_0x5434('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b26fe,_0x524e9e,_0x395e5c){return new BPromise(function(_0x457fe8,_0x17d20b){return client[_0x5434('0xa')](_0x1b26fe,_0x395e5c)[_0x5434('0xb')](function(_0x414550){logger[_0x5434('0xc')](_0x5434('0xd'),_0x524e9e,_0x5434('0xe'));logger[_0x5434('0xf')](_0x5434('0x10'),_0x524e9e,_0x5434('0xe'),JSON[_0x5434('0x11')](_0x414550));if(_0x414550[_0x5434('0x12')]){if(_0x414550['error'][_0x5434('0x13')]===0x1f4){logger['error'](_0x5434('0xd'),_0x524e9e,_0x414550[_0x5434('0x12')][_0x5434('0x14')]);return _0x17d20b(_0x414550[_0x5434('0x12')]['message']);}logger[_0x5434('0x12')](_0x5434('0xd'),_0x524e9e,_0x414550['error'][_0x5434('0x14')]);return _0x457fe8(_0x414550[_0x5434('0x12')][_0x5434('0x14')]);}else{logger[_0x5434('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x524e9e,_0x5434('0xe'));_0x457fe8(_0x414550[_0x5434('0x15')]['message']);}})[_0x5434('0x16')](function(_0x4fa3d5){logger[_0x5434('0x12')](_0x5434('0xd'),_0x524e9e,_0x4fa3d5);_0x17d20b(_0x4fa3d5);});});}exports[_0x5434('0x17')]=function(_0x148b3c){var _0x417143=this;return new Promise(function(_0x2d60be,_0x1dee84){return db['FaxQueueReport'][_0x5434('0x18')](_0x148b3c[_0x5434('0x19')],{'raw':_0x148b3c[_0x5434('0x1a')]?_0x148b3c['options'][_0x5434('0x1b')]===undefined?!![]:![]:!![]})[_0x5434('0xb')](function(_0x240787){logger['info'](_0x5434('0x17'),_0x148b3c);logger[_0x5434('0xf')](_0x5434('0x17'),_0x148b3c,JSON[_0x5434('0x11')](_0x240787));_0x2d60be(_0x240787);})[_0x5434('0x16')](function(_0x5c43ef){logger['error'](_0x5434('0x17'),_0x5c43ef['message'],_0x148b3c);_0x1dee84(_0x417143[_0x5434('0x12')](0x1f4,_0x5c43ef[_0x5434('0x14')]));});});};exports[_0x5434('0x1c')]=function(_0xd83da2){var _0x5dce5f=this;return new Promise(function(_0x5c0fe9,_0x14e903){return db[_0x5434('0x1d')][_0x5434('0x1e')](_0xd83da2[_0x5434('0x19')],{'raw':_0xd83da2[_0x5434('0x1a')]?_0xd83da2[_0x5434('0x1a')][_0x5434('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd83da2[_0x5434('0x1a')]?_0xd83da2[_0x5434('0x1a')][_0x5434('0x1f')]||null:null,'attributes':_0xd83da2[_0x5434('0x1a')]?_0xd83da2[_0x5434('0x1a')]['attributes']||null:null,'limit':_0xd83da2['options']?_0xd83da2['options'][_0x5434('0x20')]||null:null})[_0x5434('0xb')](function(_0x4189f9){logger[_0x5434('0xc')](_0x5434('0x1c'),_0xd83da2);logger['debug'](_0x5434('0x1c'),_0xd83da2,JSON[_0x5434('0x11')](_0x4189f9));_0x5c0fe9(_0x4189f9);})['catch'](function(_0x1c838d){logger[_0x5434('0x12')]('UpdateFaxQueueReport',_0x1c838d['message'],_0xd83da2);_0x14e903(_0x5dce5f['error'](0x1f4,_0x1c838d[_0x5434('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 30521bf..a0918a0 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 _0xa511=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','post','create','put','update','destroy'];(function(_0x1cda5c,_0x2e4667){var _0x5cf244=function(_0x2c0153){while(--_0x2c0153){_0x1cda5c['push'](_0x1cda5c['shift']());}};_0x5cf244(++_0x2e4667);}(_0xa511,0x121));var _0x1a51=function(_0x2e8285,_0x29b131){_0x2e8285=_0x2e8285-0x0;var _0x29c5bc=_0xa511[_0x2e8285];return _0x29c5bc;};'use strict';var multer=require(_0x1a51('0x0'));var util=require(_0x1a51('0x1'));var path=require(_0x1a51('0x2'));var timeout=require(_0x1a51('0x3'));var express=require(_0x1a51('0x4'));var router=express[_0x1a51('0x5')]();var auth=require(_0x1a51('0x6'));var interaction=require(_0x1a51('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x1a51('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a51('0x8')](_0x1a51('0x9'),auth[_0x1a51('0xa')](),controller[_0x1a51('0xb')]);router[_0x1a51('0x8')]('/:id',auth[_0x1a51('0xa')](),controller['show']);router[_0x1a51('0xc')]('/',auth['isAuthenticated'](),controller[_0x1a51('0xd')]);router[_0x1a51('0xe')]('/:id',auth[_0x1a51('0xa')](),controller[_0x1a51('0xf')]);router['delete']('/:id',auth[_0x1a51('0xa')](),controller[_0x1a51('0x10')]);module[_0x1a51('0x11')]=router; \ No newline at end of file +var _0xa01e=['connect-timeout','express','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','multer','path'];(function(_0x12d8f0,_0x48e9de){var _0x46798a=function(_0x49a1a9){while(--_0x49a1a9){_0x12d8f0['push'](_0x12d8f0['shift']());}};_0x46798a(++_0x48e9de);}(_0xa01e,0x152));var _0xea01=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa01e[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0xea01('0x0'));var util=require('util');var path=require(_0xea01('0x1'));var timeout=require(_0xea01('0x2'));var express=require(_0xea01('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea01('0x4'));var controller=require(_0xea01('0x5'));router[_0xea01('0x6')]('/',auth['isAuthenticated'](),controller[_0xea01('0x7')]);router[_0xea01('0x6')](_0xea01('0x8'),auth[_0xea01('0x9')](),controller[_0xea01('0xa')]);router[_0xea01('0x6')](_0xea01('0xb'),auth[_0xea01('0x9')](),controller[_0xea01('0xc')]);router[_0xea01('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea01('0xe')](_0xea01('0xb'),auth[_0xea01('0x9')](),controller['update']);router[_0xea01('0xf')]('/:id',auth[_0xea01('0x9')](),controller[_0xea01('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 7221726..0f05ca8 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 _0x40d0=['STRING','ENUM','account','queue','NOW','moment','sequelize'];(function(_0x532181,_0x4397c8){var _0x150bbf=function(_0x2952de){while(--_0x2952de){_0x532181['push'](_0x532181['shift']());}};_0x150bbf(++_0x4397c8);}(_0x40d0,0x163));var _0x040d=function(_0xc6a0e0,_0x32dd4b){_0xc6a0e0=_0xc6a0e0-0x0;var _0x2cdfe9=_0x40d0[_0xc6a0e0];return _0x2cdfe9;};'use strict';var moment=require(_0x040d('0x0'));var Sequelize=require(_0x040d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x040d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x040d('0x3')](_0x040d('0x4'),'agent',_0x040d('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x040d('0x6')]}}; \ No newline at end of file +var _0xe98b=['agent','queue','DATE','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x11d13f,_0x5c5417){var _0x55d834=function(_0x2c8261){while(--_0x2c8261){_0x11d13f['push'](_0x11d13f['shift']());}};_0x55d834(++_0x5c5417);}(_0xe98b,0x17d));var _0xbe98=function(_0x2f9e04,_0x3f1f71){_0x2f9e04=_0x2f9e04-0x0;var _0xbb2c0=_0xe98b[_0x2f9e04];return _0xbb2c0;};'use strict';var moment=require(_0xbe98('0x0'));var Sequelize=require(_0xbe98('0x1'));module[_0xbe98('0x2')]={'uniqueid':{'type':Sequelize[_0xbe98('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbe98('0x4')](_0xbe98('0x5'),_0xbe98('0x6'),_0xbe98('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xbe98('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 72ff599..58d8887 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 _0x5636=['status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','VIRTUAL','field','options','FaxTransferReport','then','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus'];(function(_0x27beed,_0xf94ca8){var _0x4b6abd=function(_0x811590){while(--_0x811590){_0x27beed['push'](_0x27beed['shift']());}};_0x4b6abd(++_0xf94ca8);}(_0x5636,0x102));var _0x6563=function(_0x17ed9c,_0x578ad7){_0x17ed9c=_0x17ed9c-0x0;var _0x32f9b8=_0x5636[_0x17ed9c];return _0x32f9b8;};'use strict';var pdf=require(_0x6563('0x0'));var emlformat=require(_0x6563('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6563('0x2'));var moment=require(_0x6563('0x3'));var BPromise=require(_0x6563('0x4'));var Mustache=require('mustache');var util=require(_0x6563('0x5'));var path=require(_0x6563('0x6'));var sox=require(_0x6563('0x7'));var csv=require(_0x6563('0x8'));var ejs=require(_0x6563('0x9'));var fs=require('fs');var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x8'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6563('0x11'));var qs=require(_0x6563('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6563('0x13'));var db=require(_0x6563('0x14'))['db'];function respondWithStatusCode(_0x35936d,_0x12429c){_0x12429c=_0x12429c||0xcc;return function(_0x33816e){if(_0x33816e){return _0x35936d[_0x6563('0x15')](_0x12429c);}return _0x35936d[_0x6563('0x16')](_0x12429c)[_0x6563('0x17')]();};}function respondWithResult(_0x447f9a,_0x51aeca){_0x51aeca=_0x51aeca||0xc8;return function(_0xa0a0b6){if(_0xa0a0b6){return _0x447f9a['status'](_0x51aeca)[_0x6563('0x18')](_0xa0a0b6);}};}function respondWithFilteredResult(_0x59bee1,_0x33f8e4){return function(_0x10d08c){if(_0x10d08c){var _0x5af5d0=_0x10d08c[_0x6563('0x19')],_0x26f26e=_0x33f8e4['offset'],_0x11baa2=_0x33f8e4[_0x6563('0x1a')]+_0x33f8e4['limit'],_0x477d9b;if(_0x11baa2>=_0x5af5d0){_0x11baa2=_0x5af5d0;_0x477d9b=0xc8;}else{_0x477d9b=0xce;}_0x59bee1['status'](_0x477d9b);return _0x59bee1['set'](_0x6563('0x1b'),_0x26f26e+'-'+_0x11baa2+'/'+_0x5af5d0)['json'](_0x10d08c);}return null;};}function patchUpdates(_0x54e69c){return function(_0x27651b){try{jsonpatch[_0x6563('0x1c')](_0x27651b,_0x54e69c,!![]);}catch(_0x17a29f){return BPromise[_0x6563('0x1d')](_0x17a29f);}return _0x27651b[_0x6563('0x1e')]();};}function saveUpdates(_0x10811d,_0x37ba3){return function(_0x93a45){if(_0x93a45){return _0x93a45[_0x6563('0x1f')](_0x10811d)['then'](function(_0x2f2905){return _0x2f2905;});}return null;};}function removeEntity(_0x9c3da7,_0x20b478){return function(_0x5a335c){if(_0x5a335c){return _0x5a335c[_0x6563('0x20')]()['then'](function(){_0x9c3da7[_0x6563('0x16')](0xcc)[_0x6563('0x17')]();});}};}function handleEntityNotFound(_0x5610b0,_0x5773e2){return function(_0x3ab7f6){if(!_0x3ab7f6){_0x5610b0['sendStatus'](0x194);}return _0x3ab7f6;};}function handleError(_0x1097d0,_0x19f34e){_0x19f34e=_0x19f34e||0x1f4;return function(_0x20d152){logger['error'](_0x20d152[_0x6563('0x21')]);if(_0x20d152['name']){delete _0x20d152[_0x6563('0x22')];}_0x1097d0[_0x6563('0x16')](_0x19f34e)['send'](_0x20d152);};}exports[_0x6563('0x23')]=function(_0x28252d,_0x49a824){var _0x2ddb2b={},_0x5b03a7={},_0x1fe1cb={'count':0x0,'rows':[]};var _0x4fbb20=db['FaxTransferReport'][_0x6563('0x24')];_0x5b03a7[_0x6563('0x25')]=_[_0x6563('0x26')](_0x4fbb20);_0x5b03a7[_0x6563('0x27')]=_[_0x6563('0x26')](_0x28252d['query']);_0x5b03a7[_0x6563('0x28')]=_['intersection'](_0x5b03a7['model'],_0x5b03a7[_0x6563('0x27')]);_0x2ddb2b[_0x6563('0x29')]=_[_0x6563('0x2a')](_0x5b03a7[_0x6563('0x25')],qs[_0x6563('0x2b')](_0x28252d[_0x6563('0x27')][_0x6563('0x2b')]));_0x2ddb2b[_0x6563('0x29')]=_0x2ddb2b[_0x6563('0x29')][_0x6563('0x2c')]?_0x2ddb2b['attributes']:_0x5b03a7[_0x6563('0x25')];if(!_0x28252d[_0x6563('0x27')][_0x6563('0x2d')](_0x6563('0x2e'))){_0x2ddb2b[_0x6563('0x2f')]=qs[_0x6563('0x2f')](_0x28252d[_0x6563('0x27')]['limit']);_0x2ddb2b[_0x6563('0x1a')]=qs[_0x6563('0x1a')](_0x28252d[_0x6563('0x27')][_0x6563('0x1a')]);}_0x2ddb2b[_0x6563('0x30')]=qs[_0x6563('0x31')](_0x28252d['query'][_0x6563('0x31')]);_0x2ddb2b[_0x6563('0x32')]=qs[_0x6563('0x28')](_[_0x6563('0x33')](_0x28252d[_0x6563('0x27')],_0x5b03a7[_0x6563('0x28')]));if(_0x28252d[_0x6563('0x27')]['filter']){_0x2ddb2b[_0x6563('0x32')]=_[_0x6563('0x34')](_0x2ddb2b['where'],{'$or':_[_0x6563('0x35')](_0x4fbb20,function(_0x1ff47d){if(_0x1ff47d['type']['key']!==_0x6563('0x36')){var _0x5ca0ab={};_0x5ca0ab[_0x1ff47d[_0x6563('0x37')]]={'$like':'%'+_0x28252d[_0x6563('0x27')]['filter']+'%'};return _0x5ca0ab;}})});}_0x2ddb2b=_[_0x6563('0x34')]({},_0x2ddb2b,_0x28252d[_0x6563('0x38')]);var _0x577875={'where':_0x2ddb2b[_0x6563('0x32')]};return db[_0x6563('0x39')][_0x6563('0x19')](_0x577875)[_0x6563('0x3a')](function(_0x154d5b){_0x1fe1cb[_0x6563('0x19')]=_0x154d5b;if(_0x28252d[_0x6563('0x27')][_0x6563('0x3b')]){_0x2ddb2b[_0x6563('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x6563('0x3d')](_0x2ddb2b);})[_0x6563('0x3a')](function(_0x3b7a24){_0x1fe1cb[_0x6563('0x3e')]=_0x3b7a24;return _0x1fe1cb;})['then'](respondWithFilteredResult(_0x49a824,_0x2ddb2b))['catch'](handleError(_0x49a824,null));};exports[_0x6563('0x3f')]=function(_0x11e5a4,_0x28db6f){var _0x5db29d={'raw':!![],'where':{'id':_0x11e5a4['params']['id']}},_0x3eadab={};_0x3eadab[_0x6563('0x25')]=_[_0x6563('0x26')](db['FaxTransferReport'][_0x6563('0x24')]);_0x3eadab[_0x6563('0x27')]=_[_0x6563('0x26')](_0x11e5a4[_0x6563('0x27')]);_0x3eadab[_0x6563('0x28')]=_[_0x6563('0x2a')](_0x3eadab[_0x6563('0x25')],_0x3eadab[_0x6563('0x27')]);_0x5db29d[_0x6563('0x29')]=_[_0x6563('0x2a')](_0x3eadab[_0x6563('0x25')],qs['fields'](_0x11e5a4['query'][_0x6563('0x2b')]));_0x5db29d[_0x6563('0x29')]=_0x5db29d[_0x6563('0x29')][_0x6563('0x2c')]?_0x5db29d[_0x6563('0x29')]:_0x3eadab[_0x6563('0x25')];if(_0x11e5a4[_0x6563('0x27')]['includeAll']){_0x5db29d[_0x6563('0x3c')]=[{'all':!![]}];}_0x5db29d=_[_0x6563('0x34')]({},_0x5db29d,_0x11e5a4[_0x6563('0x38')]);return db[_0x6563('0x39')]['find'](_0x5db29d)[_0x6563('0x3a')](handleEntityNotFound(_0x28db6f,null))[_0x6563('0x3a')](respondWithResult(_0x28db6f,null))[_0x6563('0x40')](handleError(_0x28db6f,null));};exports[_0x6563('0x41')]=function(_0x1032eb,_0x4e0f0a){return db['FaxTransferReport'][_0x6563('0x41')](_0x1032eb[_0x6563('0x42')],{})[_0x6563('0x3a')](respondWithResult(_0x4e0f0a,0xc9))['catch'](handleError(_0x4e0f0a,null));};exports[_0x6563('0x1f')]=function(_0x120723,_0x409f45){if(_0x120723[_0x6563('0x42')]['id']){delete _0x120723['body']['id'];}return db[_0x6563('0x39')][_0x6563('0x43')]({'where':{'id':_0x120723[_0x6563('0x44')]['id']}})['then'](handleEntityNotFound(_0x409f45,null))[_0x6563('0x3a')](saveUpdates(_0x120723['body'],null))[_0x6563('0x3a')](respondWithResult(_0x409f45,null))['catch'](handleError(_0x409f45,null));};exports['destroy']=function(_0x1ef2da,_0x11617b){return db[_0x6563('0x39')][_0x6563('0x43')]({'where':{'id':_0x1ef2da[_0x6563('0x44')]['id']}})[_0x6563('0x3a')](handleEntityNotFound(_0x11617b,null))[_0x6563('0x3a')](removeEntity(_0x11617b,null))[_0x6563('0x40')](handleError(_0x11617b,null));};exports[_0x6563('0x45')]=function(_0x411b72,_0x4951a6){return db[_0x6563('0x39')]['describe']()[_0x6563('0x3a')](respondWithResult(_0x4951a6,null))[_0x6563('0x40')](handleError(_0x4951a6,null));}; \ No newline at end of file +var _0x975f=['request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','sendStatus','error','stack','name','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','key','VIRTUAL','field','merge','options','includeAll','include','then','rows','catch','params','length','find','create','body','describe','html-pdf','eml-format','fast-json-patch'];(function(_0x90f5f5,_0x4453c8){var _0x4fcbe9=function(_0x2cd93c){while(--_0x2cd93c){_0x90f5f5['push'](_0x90f5f5['shift']());}};_0x4fcbe9(++_0x4453c8);}(_0x975f,0x109));var _0xf975=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x975f[_0x8de54f];return _0x14cba4;};'use strict';var pdf=require(_0xf975('0x0'));var emlformat=require(_0xf975('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf975('0x2'));var rp=require(_0xf975('0x3'));var moment=require('moment');var BPromise=require(_0xf975('0x4'));var Mustache=require(_0xf975('0x5'));var util=require(_0xf975('0x6'));var path=require(_0xf975('0x7'));var sox=require('sox');var csv=require(_0xf975('0x8'));var ejs=require(_0xf975('0x9'));var fs=require('fs');var _=require(_0xf975('0xa'));var squel=require(_0xf975('0xb'));var crypto=require('crypto');var jsforce=require(_0xf975('0xc'));var deskjs=require(_0xf975('0xd'));var toCsv=require(_0xf975('0x8'));var querystring=require('querystring');var Papa=require(_0xf975('0xe'));var authService=require(_0xf975('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xf975('0x10'));var qs=require(_0xf975('0x11'));var logger=require(_0xf975('0x12'))(_0xf975('0x13'));var utils=require(_0xf975('0x14'));var config=require(_0xf975('0x15'));var db=require(_0xf975('0x16'))['db'];function respondWithStatusCode(_0x4b0e83,_0x4214a0){_0x4214a0=_0x4214a0||0xcc;return function(_0x34111a){if(_0x34111a){return _0x4b0e83['sendStatus'](_0x4214a0);}return _0x4b0e83[_0xf975('0x17')](_0x4214a0)[_0xf975('0x18')]();};}function respondWithResult(_0x12d0e8,_0x31f03e){_0x31f03e=_0x31f03e||0xc8;return function(_0x32d59b){if(_0x32d59b){return _0x12d0e8[_0xf975('0x17')](_0x31f03e)[_0xf975('0x19')](_0x32d59b);}};}function respondWithFilteredResult(_0x525e4a,_0x1a86cd){return function(_0x5e63c1){if(_0x5e63c1){var _0x511aa2=_0x5e63c1[_0xf975('0x1a')],_0x213df9=_0x1a86cd[_0xf975('0x1b')],_0x168a76=_0x1a86cd[_0xf975('0x1b')]+_0x1a86cd[_0xf975('0x1c')],_0x24b7dc;if(_0x168a76>=_0x511aa2){_0x168a76=_0x511aa2;_0x24b7dc=0xc8;}else{_0x24b7dc=0xce;}_0x525e4a['status'](_0x24b7dc);return _0x525e4a['set'](_0xf975('0x1d'),_0x213df9+'-'+_0x168a76+'/'+_0x511aa2)[_0xf975('0x19')](_0x5e63c1);}return null;};}function patchUpdates(_0x26d37c){return function(_0xd03b1f){try{jsonpatch[_0xf975('0x1e')](_0xd03b1f,_0x26d37c,!![]);}catch(_0x1b5b00){return BPromise['reject'](_0x1b5b00);}return _0xd03b1f[_0xf975('0x1f')]();};}function saveUpdates(_0x21f709,_0x22acc7){return function(_0x200fe1){if(_0x200fe1){return _0x200fe1['update'](_0x21f709)['then'](function(_0x47387d){return _0x47387d;});}return null;};}function removeEntity(_0x1c5023,_0x192d47){return function(_0x21f02e){if(_0x21f02e){return _0x21f02e[_0xf975('0x20')]()['then'](function(){_0x1c5023[_0xf975('0x17')](0xcc)[_0xf975('0x18')]();});}};}function handleEntityNotFound(_0x29f7fa,_0x28e4b4){return function(_0x524790){if(!_0x524790){_0x29f7fa[_0xf975('0x21')](0x194);}return _0x524790;};}function handleError(_0xfc97cf,_0x1b501a){_0x1b501a=_0x1b501a||0x1f4;return function(_0x3f1aae){logger[_0xf975('0x22')](_0x3f1aae[_0xf975('0x23')]);if(_0x3f1aae['name']){delete _0x3f1aae[_0xf975('0x24')];}_0xfc97cf[_0xf975('0x17')](_0x1b501a)['send'](_0x3f1aae);};}exports['index']=function(_0x1ed733,_0x393655){var _0x5ccc9c={},_0x225a06={},_0x691fe2={'count':0x0,'rows':[]};var _0x2fa338=db[_0xf975('0x25')][_0xf975('0x26')];_0x225a06[_0xf975('0x27')]=_[_0xf975('0x28')](_0x2fa338);_0x225a06[_0xf975('0x29')]=_[_0xf975('0x28')](_0x1ed733[_0xf975('0x29')]);_0x225a06[_0xf975('0x2a')]=_[_0xf975('0x2b')](_0x225a06[_0xf975('0x27')],_0x225a06[_0xf975('0x29')]);_0x5ccc9c['attributes']=_[_0xf975('0x2b')](_0x225a06[_0xf975('0x27')],qs[_0xf975('0x2c')](_0x1ed733[_0xf975('0x29')]['fields']));_0x5ccc9c['attributes']=_0x5ccc9c[_0xf975('0x2d')]['length']?_0x5ccc9c[_0xf975('0x2d')]:_0x225a06[_0xf975('0x27')];if(!_0x1ed733[_0xf975('0x29')]['hasOwnProperty'](_0xf975('0x2e'))){_0x5ccc9c[_0xf975('0x1c')]=qs[_0xf975('0x1c')](_0x1ed733[_0xf975('0x29')][_0xf975('0x1c')]);_0x5ccc9c[_0xf975('0x1b')]=qs[_0xf975('0x1b')](_0x1ed733[_0xf975('0x29')][_0xf975('0x1b')]);}_0x5ccc9c[_0xf975('0x2f')]=qs['sort'](_0x1ed733[_0xf975('0x29')][_0xf975('0x30')]);_0x5ccc9c[_0xf975('0x31')]=qs[_0xf975('0x2a')](_[_0xf975('0x32')](_0x1ed733[_0xf975('0x29')],_0x225a06['filters']));if(_0x1ed733[_0xf975('0x29')]['filter']){_0x5ccc9c['where']=_['merge'](_0x5ccc9c[_0xf975('0x31')],{'$or':_['map'](_0x2fa338,function(_0x2548fd){if(_0x2548fd['type'][_0xf975('0x33')]!==_0xf975('0x34')){var _0x3bc449={};_0x3bc449[_0x2548fd[_0xf975('0x35')]]={'$like':'%'+_0x1ed733['query']['filter']+'%'};return _0x3bc449;}})});}_0x5ccc9c=_[_0xf975('0x36')]({},_0x5ccc9c,_0x1ed733[_0xf975('0x37')]);var _0x2c63bd={'where':_0x5ccc9c['where']};return db['FaxTransferReport'][_0xf975('0x1a')](_0x2c63bd)['then'](function(_0x455719){_0x691fe2[_0xf975('0x1a')]=_0x455719;if(_0x1ed733[_0xf975('0x29')][_0xf975('0x38')]){_0x5ccc9c[_0xf975('0x39')]=[{'all':!![]}];}return db[_0xf975('0x25')]['findAll'](_0x5ccc9c);})[_0xf975('0x3a')](function(_0x317f17){_0x691fe2[_0xf975('0x3b')]=_0x317f17;return _0x691fe2;})[_0xf975('0x3a')](respondWithFilteredResult(_0x393655,_0x5ccc9c))[_0xf975('0x3c')](handleError(_0x393655,null));};exports['show']=function(_0x2d713d,_0x1c3c1e){var _0x4fbf54={'raw':!![],'where':{'id':_0x2d713d[_0xf975('0x3d')]['id']}},_0x38a8de={};_0x38a8de[_0xf975('0x27')]=_['keys'](db[_0xf975('0x25')][_0xf975('0x26')]);_0x38a8de[_0xf975('0x29')]=_[_0xf975('0x28')](_0x2d713d[_0xf975('0x29')]);_0x38a8de['filters']=_[_0xf975('0x2b')](_0x38a8de[_0xf975('0x27')],_0x38a8de[_0xf975('0x29')]);_0x4fbf54[_0xf975('0x2d')]=_['intersection'](_0x38a8de[_0xf975('0x27')],qs[_0xf975('0x2c')](_0x2d713d['query'][_0xf975('0x2c')]));_0x4fbf54[_0xf975('0x2d')]=_0x4fbf54[_0xf975('0x2d')][_0xf975('0x3e')]?_0x4fbf54[_0xf975('0x2d')]:_0x38a8de['model'];if(_0x2d713d[_0xf975('0x29')][_0xf975('0x38')]){_0x4fbf54[_0xf975('0x39')]=[{'all':!![]}];}_0x4fbf54=_[_0xf975('0x36')]({},_0x4fbf54,_0x2d713d['options']);return db['FaxTransferReport'][_0xf975('0x3f')](_0x4fbf54)[_0xf975('0x3a')](handleEntityNotFound(_0x1c3c1e,null))[_0xf975('0x3a')](respondWithResult(_0x1c3c1e,null))['catch'](handleError(_0x1c3c1e,null));};exports[_0xf975('0x40')]=function(_0x3d5030,_0x135070){return db[_0xf975('0x25')][_0xf975('0x40')](_0x3d5030['body'],{})[_0xf975('0x3a')](respondWithResult(_0x135070,0xc9))[_0xf975('0x3c')](handleError(_0x135070,null));};exports['update']=function(_0x1f3de5,_0x4b5de6){if(_0x1f3de5['body']['id']){delete _0x1f3de5[_0xf975('0x41')]['id'];}return db['FaxTransferReport'][_0xf975('0x3f')]({'where':{'id':_0x1f3de5[_0xf975('0x3d')]['id']}})[_0xf975('0x3a')](handleEntityNotFound(_0x4b5de6,null))[_0xf975('0x3a')](saveUpdates(_0x1f3de5[_0xf975('0x41')],null))[_0xf975('0x3a')](respondWithResult(_0x4b5de6,null))[_0xf975('0x3c')](handleError(_0x4b5de6,null));};exports[_0xf975('0x20')]=function(_0x4a785c,_0xa8218b){return db['FaxTransferReport'][_0xf975('0x3f')]({'where':{'id':_0x4a785c[_0xf975('0x3d')]['id']}})[_0xf975('0x3a')](handleEntityNotFound(_0xa8218b,null))[_0xf975('0x3a')](removeEntity(_0xa8218b,null))[_0xf975('0x3c')](handleError(_0xa8218b,null));};exports['describe']=function(_0x270ab7,_0x3178c0){return db['FaxTransferReport'][_0xf975('0x42')]()['then'](respondWithResult(_0x3178c0,null))[_0xf975('0x3c')](handleError(_0x3178c0,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0c45a82..ae897de 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 _0xffdd=['./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','request-promise'];(function(_0x49e531,_0x49781b){var _0x2576ee=function(_0x47cfc3){while(--_0x47cfc3){_0x49e531['push'](_0x49e531['shift']());}};_0x2576ee(++_0x49781b);}(_0xffdd,0x84));var _0xdffd=function(_0x453ce0,_0x5f041c){_0x453ce0=_0x453ce0-0x0;var _0x4895e3=_0xffdd[_0x453ce0];return _0x4895e3;};'use strict';var _=require(_0xdffd('0x0'));var util=require('util');var logger=require(_0xdffd('0x1'))('api');var moment=require(_0xdffd('0x2'));var BPromise=require('bluebird');var rp=require(_0xdffd('0x3'));var attributes=require(_0xdffd('0x4'));module[_0xdffd('0x5')]=function(_0x6d6ca3,_0x56da3f){return _0x6d6ca3['define']('FaxTransferReport',attributes,{'tableName':_0xdffd('0x6'),'paranoid':![],'indexes':[{'name':_0xdffd('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc950=['../../config/logger','moment','bluebird','request-promise','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x4da141,_0x98eb36){var _0x371c86=function(_0x274de3){while(--_0x274de3){_0x4da141['push'](_0x4da141['shift']());}};_0x371c86(++_0x98eb36);}(_0xc950,0x134));var _0x0c95=function(_0x210b37,_0x4690e4){_0x210b37=_0x210b37-0x0;var _0x28599f=_0xc950[_0x210b37];return _0x28599f;};'use strict';var _=require(_0x0c95('0x0'));var util=require(_0x0c95('0x1'));var logger=require(_0x0c95('0x2'))('api');var moment=require(_0x0c95('0x3'));var BPromise=require(_0x0c95('0x4'));var rp=require(_0x0c95('0x5'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x2ff026,_0x7457a2){return _0x2ff026[_0x0c95('0x6')](_0x0c95('0x7'),attributes,{'tableName':_0x0c95('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0c95('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ab6e3cc..38ea9c1 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 _0x6910=['request\x20sent','debug','FaxTransferReport,\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','jayson/promise','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x345040,_0x31fd62){var _0xade47f=function(_0x30adb3){while(--_0x30adb3){_0x345040['push'](_0x345040['shift']());}};_0xade47f(++_0x31fd62);}(_0x6910,0x65));var _0x0691=function(_0x44c7a2,_0x449be7){_0x44c7a2=_0x44c7a2-0x0;var _0x3efc90=_0x6910[_0x44c7a2];return _0x3efc90;};'use strict';var _=require(_0x0691('0x0'));var util=require(_0x0691('0x1'));var moment=require(_0x0691('0x2'));var BPromise=require(_0x0691('0x3'));var rs=require(_0x0691('0x4'));var fs=require('fs');var Redis=require(_0x0691('0x5'));var db=require(_0x0691('0x6'))['db'];var utils=require(_0x0691('0x7'));var logger=require(_0x0691('0x8'))('rpc');var config=require(_0x0691('0x9'));var jayson=require(_0x0691('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137a8d,_0x2fcbcb,_0x652fd3){return new BPromise(function(_0x18b4db,_0x100693){return client['request'](_0x137a8d,_0x652fd3)[_0x0691('0xb')](function(_0x2471e7){logger[_0x0691('0xc')](_0x0691('0xd'),_0x2fcbcb,_0x0691('0xe'));logger[_0x0691('0xf')](_0x0691('0x10'),_0x2fcbcb,_0x0691('0xe'),JSON[_0x0691('0x11')](_0x2471e7));if(_0x2471e7[_0x0691('0x12')]){if(_0x2471e7[_0x0691('0x12')][_0x0691('0x13')]===0x1f4){logger[_0x0691('0x12')](_0x0691('0xd'),_0x2fcbcb,_0x2471e7['error'][_0x0691('0x14')]);return _0x100693(_0x2471e7[_0x0691('0x12')][_0x0691('0x14')]);}logger[_0x0691('0x12')](_0x0691('0xd'),_0x2fcbcb,_0x2471e7[_0x0691('0x12')][_0x0691('0x14')]);return _0x18b4db(_0x2471e7[_0x0691('0x12')]['message']);}else{logger[_0x0691('0xc')](_0x0691('0xd'),_0x2fcbcb,'request\x20sent');_0x18b4db(_0x2471e7[_0x0691('0x15')]['message']);}})[_0x0691('0x16')](function(_0x3b258a){logger['error'](_0x0691('0xd'),_0x2fcbcb,_0x3b258a);_0x100693(_0x3b258a);});});} \ No newline at end of file +var _0xee7b=['code','message','FaxTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x5e9110,_0x54e60a){var _0x28e5dd=function(_0x105847){while(--_0x105847){_0x5e9110['push'](_0x5e9110['shift']());}};_0x28e5dd(++_0x54e60a);}(_0xee7b,0xb5));var _0xbee7=function(_0x2981c7,_0x534e99){_0x2981c7=_0x2981c7-0x0;var _0x499c3f=_0xee7b[_0x2981c7];return _0x499c3f;};'use strict';var _=require(_0xbee7('0x0'));var util=require(_0xbee7('0x1'));var moment=require('moment');var BPromise=require(_0xbee7('0x2'));var rs=require(_0xbee7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbee7('0x4'))['db'];var utils=require(_0xbee7('0x5'));var logger=require('../../config/logger')(_0xbee7('0x6'));var config=require(_0xbee7('0x7'));var jayson=require(_0xbee7('0x8'));var client=jayson[_0xbee7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4704dd,_0x93db53,_0x38bd3f){return new BPromise(function(_0x45b9ea,_0x5ccbf7){return client[_0xbee7('0xa')](_0x4704dd,_0x38bd3f)[_0xbee7('0xb')](function(_0x5278e4){logger[_0xbee7('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x93db53,_0xbee7('0xd'));logger[_0xbee7('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x93db53,_0xbee7('0xd'),JSON[_0xbee7('0xf')](_0x5278e4));if(_0x5278e4[_0xbee7('0x10')]){if(_0x5278e4[_0xbee7('0x10')][_0xbee7('0x11')]===0x1f4){logger[_0xbee7('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x93db53,_0x5278e4['error'][_0xbee7('0x12')]);return _0x5ccbf7(_0x5278e4[_0xbee7('0x10')][_0xbee7('0x12')]);}logger[_0xbee7('0x10')](_0xbee7('0x13'),_0x93db53,_0x5278e4[_0xbee7('0x10')][_0xbee7('0x12')]);return _0x45b9ea(_0x5278e4[_0xbee7('0x10')][_0xbee7('0x12')]);}else{logger[_0xbee7('0xc')](_0xbee7('0x13'),_0x93db53,_0xbee7('0xd'));_0x45b9ea(_0x5278e4[_0xbee7('0x14')][_0xbee7('0x12')]);}})[_0xbee7('0x15')](function(_0x2530eb){logger[_0xbee7('0x10')](_0xbee7('0x13'),_0x93db53,_0x2530eb);_0x5ccbf7(_0x2530eb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f07c5d3..694e071 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 _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x143c0c,_0xfe3dcc){var _0x273644=function(_0x29f9ad){while(--_0x29f9ad){_0x143c0c['push'](_0x143c0c['shift']());}};_0x273644(++_0xfe3dcc);}(_0xac31,0xca));var _0x1ac3=function(_0x44be69,_0x5c2b8d){_0x44be69=_0x44be69-0x0;var _0x33ac59=_0xac31[_0x44be69];return _0x33ac59;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file +var _0x0a9a=['show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x0a9a,0x183));var _0xa0a9=function(_0x45af6b,_0x134eca){_0x45af6b=_0x45af6b-0x0;var _0x452402=_0x0a9a[_0x45af6b];return _0x452402;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var auth=require(_0xa0a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a9('0x5'));var controller=require(_0xa0a9('0x6'));router['get']('/',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x8')]);router[_0xa0a9('0x9')](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xb')]);router['get'](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xd')]);router[_0xa0a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0a9('0xf')]);router[_0xa0a9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa0a9('0x11')]);router[_0xa0a9('0x12')]('/:id',auth[_0xa0a9('0x7')](),controller['destroy']);module[_0xa0a9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ee0f949..36aabbf 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 _0xb6cc=['/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','multer','path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xb6cc,0xb2));var _0xcb6c=function(_0x43e9d9,_0x4411b7){_0x43e9d9=_0x43e9d9-0x0;var _0x463745=_0xb6cc[_0x43e9d9];return _0x463745;};'use strict';var multer=require(_0xcb6c('0x0'));var util=require('util');var path=require(_0xcb6c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb6c('0x2')]();var auth=require(_0xcb6c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcb6c('0x4'));var controller=require('./intDeskAccount.controller');router[_0xcb6c('0x5')]('/',auth[_0xcb6c('0x6')](),controller[_0xcb6c('0x7')]);router[_0xcb6c('0x5')](_0xcb6c('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xcb6c('0x5')](_0xcb6c('0x9'),auth[_0xcb6c('0x6')](),controller['getConfigurations']);router[_0xcb6c('0x5')](_0xcb6c('0xa'),auth[_0xcb6c('0x6')](),controller['getFields']);router[_0xcb6c('0xb')]('/',auth['isAuthenticated'](),controller[_0xcb6c('0xc')]);router[_0xcb6c('0xb')](_0xcb6c('0x9'),auth['isAuthenticated'](),controller[_0xcb6c('0xd')]);router[_0xcb6c('0xe')]('/:id',auth[_0xcb6c('0x6')](),controller[_0xcb6c('0xf')]);router[_0xcb6c('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x36e8=['index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xb9268a,_0x1800a2){var _0x10d2f9=function(_0x2abfe3){while(--_0x2abfe3){_0xb9268a['push'](_0xb9268a['shift']());}};_0x10d2f9(++_0x1800a2);}(_0x36e8,0xf2));var _0x836e=function(_0x2a515a,_0x126008){_0x2a515a=_0x2a515a-0x0;var _0x29d585=_0x36e8[_0x2a515a];return _0x29d585;};'use strict';var multer=require('multer');var util=require(_0x836e('0x0'));var path=require(_0x836e('0x1'));var timeout=require(_0x836e('0x2'));var express=require(_0x836e('0x3'));var router=express[_0x836e('0x4')]();var auth=require(_0x836e('0x5'));var interaction=require(_0x836e('0x6'));var config=require(_0x836e('0x7'));var controller=require('./intDeskAccount.controller');router[_0x836e('0x8')]('/',auth[_0x836e('0x9')](),controller[_0x836e('0xa')]);router[_0x836e('0x8')](_0x836e('0xb'),auth[_0x836e('0x9')](),controller[_0x836e('0xc')]);router[_0x836e('0x8')](_0x836e('0xd'),auth[_0x836e('0x9')](),controller[_0x836e('0xe')]);router[_0x836e('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x836e('0xf')]);router[_0x836e('0x10')]('/',auth[_0x836e('0x9')](),controller[_0x836e('0x11')]);router[_0x836e('0x10')](_0x836e('0xd'),auth[_0x836e('0x9')](),controller['addConfiguration']);router[_0x836e('0x12')](_0x836e('0xb'),auth[_0x836e('0x9')](),controller['update']);router['delete'](_0x836e('0xb'),auth[_0x836e('0x9')](),controller[_0x836e('0x13')]);module[_0x836e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index b2d86a4..69764b6 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 _0x713c=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x3464e0,_0x1b8e8a){var _0x266ab2=function(_0x563d1c){while(--_0x563d1c){_0x3464e0['push'](_0x3464e0['shift']());}};_0x266ab2(++_0x1b8e8a);}(_0x713c,0xe7));var _0xc713=function(_0x49b394,_0xd354f5){_0x49b394=_0x49b394-0x0;var _0x151ff8=_0x713c[_0x49b394];return _0x151ff8;};'use strict';var Sequelize=require(_0xc713('0x0'));module[_0xc713('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc713('0x2')]},'username':{'type':Sequelize[_0xc713('0x2')]},'remoteUri':{'type':Sequelize[_0xc713('0x2')]},'authType':{'type':Sequelize[_0xc713('0x3')]('basic'),'defaultValue':_0xc713('0x4')},'password':{'type':Sequelize[_0xc713('0x2')]},'consumerKey':{'type':Sequelize[_0xc713('0x2')]},'consumerSecret':{'type':Sequelize[_0xc713('0x2')]},'token':{'type':Sequelize[_0xc713('0x2')]},'tokenSecret':{'type':Sequelize[_0xc713('0x2')]},'serverUrl':{'type':Sequelize[_0xc713('0x2')]},'type':{'type':Sequelize[_0xc713('0x3')](_0xc713('0x5'),_0xc713('0x6')),'defaultValue':_0xc713('0x5')}}; \ No newline at end of file +var _0x177d=['exports','STRING','basic','newTab','integrationTab','sequelize'];(function(_0x78a2b,_0x5a7987){var _0x155087=function(_0x154f41){while(--_0x154f41){_0x78a2b['push'](_0x78a2b['shift']());}};_0x155087(++_0x5a7987);}(_0x177d,0x191));var _0xd177=function(_0x191f76,_0x429189){_0x191f76=_0x191f76-0x0;var _0x447120=_0x177d[_0x191f76];return _0x447120;};'use strict';var Sequelize=require(_0xd177('0x0'));module[_0xd177('0x1')]={'name':{'type':Sequelize[_0xd177('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd177('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xd177('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd177('0x2')]},'consumerSecret':{'type':Sequelize[_0xd177('0x2')]},'token':{'type':Sequelize[_0xd177('0x2')]},'tokenSecret':{'type':Sequelize[_0xd177('0x2')]},'serverUrl':{'type':Sequelize[_0xd177('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xd177('0x4')),'defaultValue':_0xd177('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d49aa15..d7c371a 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 _0x4517=['authType','username','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','password','base64','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../components/integrations/configuration','client','http','request','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','stack','name','index','DeskAccount','rawAttributes','keys','query','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','type','key','VIRTUAL','field','merge','options','includeAll','show','params','length','include','find','create','body','destroy','getConfigurations','findOne','map','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority'];(function(_0x5693bc,_0x54e84f){var _0x3b1004=function(_0x1a4e9e){while(--_0x1a4e9e){_0x5693bc['push'](_0x5693bc['shift']());}};_0x3b1004(++_0x54e84f);}(_0x4517,0x112));var _0x7451=function(_0x30699c,_0x156285){_0x30699c=_0x30699c-0x0;var _0x2739fe=_0x4517[_0x30699c];return _0x2739fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7451('0x0'));var rimraf=require(_0x7451('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7451('0x2'));var rp=require(_0x7451('0x3'));var moment=require(_0x7451('0x4'));var BPromise=require(_0x7451('0x5'));var Mustache=require(_0x7451('0x6'));var util=require(_0x7451('0x7'));var path=require(_0x7451('0x8'));var sox=require(_0x7451('0x9'));var csv=require(_0x7451('0xa'));var ejs=require(_0x7451('0xb'));var fs=require('fs');var _=require(_0x7451('0xc'));var squel=require(_0x7451('0xd'));var crypto=require(_0x7451('0xe'));var jsforce=require(_0x7451('0xf'));var deskjs=require(_0x7451('0x10'));var toCsv=require(_0x7451('0xa'));var querystring=require(_0x7451('0x11'));var Papa=require('papaparse');var authService=require(_0x7451('0x12'));var hardwareService=require(_0x7451('0x13'));var Redis=require(_0x7451('0x14'));var qs=require(_0x7451('0x15'));var logger=require(_0x7451('0x16'))(_0x7451('0x17'));var utils=require(_0x7451('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x7451('0x19'));var jayson=require('jayson/promise');var client=jayson[_0x7451('0x1a')][_0x7451('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4a14dc,_0x7cb990,_0x38129d,_0x4dbe5b){return new BPromise(function(_0x46811e,_0x282128){var _0x110ed6=_0x4dbe5b||client;return _0x110ed6[_0x7451('0x1c')](_0x4a14dc,_0x38129d)['then'](function(_0x357ea9){logger[_0x7451('0x1d')](_0x7451('0x1e'),_0x7cb990,'request\x20sent');logger['debug'](_0x7451('0x1f'),_0x7cb990,_0x7451('0x20'),JSON[_0x7451('0x21')](_0x357ea9));if(_0x357ea9[_0x7451('0x22')]){if(_0x357ea9[_0x7451('0x22')][_0x7451('0x23')]===0x1f4){logger[_0x7451('0x22')](_0x7451('0x1e'),_0x7cb990,_0x357ea9[_0x7451('0x22')]['message']);return _0x282128(_0x357ea9[_0x7451('0x22')][_0x7451('0x24')]);}logger[_0x7451('0x22')]('DeskAccount,\x20%s,\x20%s',_0x7cb990,_0x357ea9[_0x7451('0x22')][_0x7451('0x24')]);return _0x46811e(_0x357ea9[_0x7451('0x22')][_0x7451('0x24')]);}else{logger[_0x7451('0x1d')](_0x7451('0x1e'),_0x7cb990,_0x7451('0x20'));_0x46811e(_0x357ea9['result'][_0x7451('0x24')]);}})[_0x7451('0x25')](function(_0x561e12){logger[_0x7451('0x22')](_0x7451('0x1e'),_0x7cb990,_0x561e12);_0x282128(_0x561e12);});});}function respondWithStatusCode(_0x2962f8,_0x57cc15){_0x57cc15=_0x57cc15||0xcc;return function(_0x19e33b){if(_0x19e33b){return _0x2962f8[_0x7451('0x26')](_0x57cc15);}return _0x2962f8[_0x7451('0x27')](_0x57cc15)[_0x7451('0x28')]();};}function respondWithResult(_0x37bc47,_0x4650a5){_0x4650a5=_0x4650a5||0xc8;return function(_0x3c56f1){if(_0x3c56f1){return _0x37bc47[_0x7451('0x27')](_0x4650a5)[_0x7451('0x29')](_0x3c56f1);}};}function respondWithFilteredResult(_0x596988,_0x328d0b){return function(_0x2b8a8b){if(_0x2b8a8b){var _0x5df311=_0x2b8a8b[_0x7451('0x2a')],_0x54bef8=_0x328d0b[_0x7451('0x2b')],_0xcc793e=_0x328d0b[_0x7451('0x2b')]+_0x328d0b[_0x7451('0x2c')],_0x1edcf2;if(_0xcc793e>=_0x5df311){_0xcc793e=_0x5df311;_0x1edcf2=0xc8;}else{_0x1edcf2=0xce;}_0x596988['status'](_0x1edcf2);return _0x596988[_0x7451('0x2d')]('Content-Range',_0x54bef8+'-'+_0xcc793e+'/'+_0x5df311)[_0x7451('0x29')](_0x2b8a8b);}return null;};}function patchUpdates(_0x6c10ee){return function(_0x4d99f3){try{jsonpatch[_0x7451('0x2e')](_0x4d99f3,_0x6c10ee,!![]);}catch(_0x4323b7){return BPromise[_0x7451('0x2f')](_0x4323b7);}return _0x4d99f3[_0x7451('0x30')]();};}function saveUpdates(_0x17d52c,_0x4e24f7){return function(_0x2071e5){if(_0x2071e5){return _0x2071e5[_0x7451('0x31')](_0x17d52c)[_0x7451('0x32')](function(_0x479b39){return _0x479b39;});}return null;};}function removeEntity(_0x2be408,_0x4654e7){return function(_0x5dfc5e){if(_0x5dfc5e){return _0x5dfc5e['destroy']()[_0x7451('0x32')](function(){_0x2be408[_0x7451('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48cbb6,_0x295a1e){return function(_0x2c307b){if(!_0x2c307b){_0x48cbb6[_0x7451('0x26')](0x194);}return _0x2c307b;};}function handleError(_0x1e9e8a,_0x1fe0aa){_0x1fe0aa=_0x1fe0aa||0x1f4;return function(_0xa34c85){logger[_0x7451('0x22')](_0xa34c85[_0x7451('0x33')]);if(_0xa34c85['name']){delete _0xa34c85[_0x7451('0x34')];}_0x1e9e8a[_0x7451('0x27')](_0x1fe0aa)['send'](_0xa34c85);};}exports[_0x7451('0x35')]=function(_0x1ee26b,_0x463708){var _0x93269f={},_0x21b958={},_0x40af89={'count':0x0,'rows':[]};var _0x5d4c2e=db[_0x7451('0x36')][_0x7451('0x37')];_0x21b958['model']=_[_0x7451('0x38')](_0x5d4c2e);_0x21b958[_0x7451('0x39')]=_['keys'](_0x1ee26b['query']);_0x21b958['filters']=_['intersection'](_0x21b958['model'],_0x21b958[_0x7451('0x39')]);_0x93269f[_0x7451('0x3a')]=_[_0x7451('0x3b')](_0x21b958[_0x7451('0x3c')],qs[_0x7451('0x3d')](_0x1ee26b['query']['fields']));_0x93269f['attributes']=_0x93269f['attributes']['length']?_0x93269f[_0x7451('0x3a')]:_0x21b958[_0x7451('0x3c')];if(!_0x1ee26b[_0x7451('0x39')][_0x7451('0x3e')](_0x7451('0x3f'))){_0x93269f[_0x7451('0x2c')]=qs[_0x7451('0x2c')](_0x1ee26b[_0x7451('0x39')][_0x7451('0x2c')]);_0x93269f[_0x7451('0x2b')]=qs[_0x7451('0x2b')](_0x1ee26b['query']['offset']);}_0x93269f[_0x7451('0x40')]=qs['sort'](_0x1ee26b[_0x7451('0x39')][_0x7451('0x41')]);_0x93269f['where']=qs['filters'](_[_0x7451('0x42')](_0x1ee26b['query'],_0x21b958[_0x7451('0x43')]));if(_0x1ee26b['query'][_0x7451('0x44')]){_0x93269f[_0x7451('0x45')]=_['merge'](_0x93269f[_0x7451('0x45')],{'$or':_['map'](_0x5d4c2e,function(_0x2c48b1){if(_0x2c48b1[_0x7451('0x46')][_0x7451('0x47')]!==_0x7451('0x48')){var _0x44e636={};_0x44e636[_0x2c48b1[_0x7451('0x49')]]={'$like':'%'+_0x1ee26b[_0x7451('0x39')][_0x7451('0x44')]+'%'};return _0x44e636;}})});}_0x93269f=_[_0x7451('0x4a')]({},_0x93269f,_0x1ee26b[_0x7451('0x4b')]);var _0x29c581={'where':_0x93269f[_0x7451('0x45')]};return db[_0x7451('0x36')][_0x7451('0x2a')](_0x29c581)['then'](function(_0x437f9c){_0x40af89[_0x7451('0x2a')]=_0x437f9c;if(_0x1ee26b[_0x7451('0x39')][_0x7451('0x4c')]){_0x93269f['include']=[{'all':!![]}];}return db[_0x7451('0x36')]['findAll'](_0x93269f);})['then'](function(_0x5345fe){_0x40af89['rows']=_0x5345fe;return _0x40af89;})['then'](respondWithFilteredResult(_0x463708,_0x93269f))[_0x7451('0x25')](handleError(_0x463708,null));};exports[_0x7451('0x4d')]=function(_0x2b4bea,_0x489d7d){var _0x39438a={'raw':![],'where':{'id':_0x2b4bea[_0x7451('0x4e')]['id']}},_0xc4b8f3={};_0xc4b8f3[_0x7451('0x3c')]=_[_0x7451('0x38')](db[_0x7451('0x36')][_0x7451('0x37')]);_0xc4b8f3[_0x7451('0x39')]=_[_0x7451('0x38')](_0x2b4bea['query']);_0xc4b8f3['filters']=_['intersection'](_0xc4b8f3[_0x7451('0x3c')],_0xc4b8f3[_0x7451('0x39')]);_0x39438a[_0x7451('0x3a')]=_['intersection'](_0xc4b8f3['model'],qs['fields'](_0x2b4bea[_0x7451('0x39')]['fields']));_0x39438a['attributes']=_0x39438a[_0x7451('0x3a')][_0x7451('0x4f')]?_0x39438a[_0x7451('0x3a')]:_0xc4b8f3[_0x7451('0x3c')];if(_0x2b4bea[_0x7451('0x39')]['includeAll']){_0x39438a[_0x7451('0x50')]=[{'all':!![]}];}_0x39438a=_['merge']({},_0x39438a,_0x2b4bea[_0x7451('0x4b')]);return db[_0x7451('0x36')][_0x7451('0x51')](_0x39438a)[_0x7451('0x32')](handleEntityNotFound(_0x489d7d,null))[_0x7451('0x32')](respondWithResult(_0x489d7d,null))[_0x7451('0x25')](handleError(_0x489d7d,null));};exports[_0x7451('0x52')]=function(_0x157ff3,_0x342f28){return db['DeskAccount']['create'](_0x157ff3[_0x7451('0x53')],{})[_0x7451('0x32')](respondWithResult(_0x342f28,0xc9))['catch'](handleError(_0x342f28,null));};exports['update']=function(_0x55dff6,_0x2dddb8){if(_0x55dff6[_0x7451('0x53')]['id']){delete _0x55dff6[_0x7451('0x53')]['id'];}return db[_0x7451('0x36')][_0x7451('0x51')]({'where':{'id':_0x55dff6[_0x7451('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dddb8,null))[_0x7451('0x32')](saveUpdates(_0x55dff6['body'],null))['then'](respondWithResult(_0x2dddb8,null))['catch'](handleError(_0x2dddb8,null));};exports[_0x7451('0x54')]=function(_0x3db1fe,_0x2548be){return db[_0x7451('0x36')][_0x7451('0x51')]({'where':{'id':_0x3db1fe[_0x7451('0x4e')]['id']}})[_0x7451('0x32')](handleEntityNotFound(_0x2548be,null))['then'](removeEntity(_0x2548be,null))[_0x7451('0x25')](handleError(_0x2548be,null));};exports[_0x7451('0x55')]=function(_0x1702c1,_0x155a15,_0x42b945){var _0xd943e3={};var _0x383aa3={};var _0x5378b6;var _0xace3c9;return db[_0x7451('0x36')][_0x7451('0x56')]({'where':{'id':_0x1702c1[_0x7451('0x4e')]['id']}})[_0x7451('0x32')](handleEntityNotFound(_0x155a15,null))[_0x7451('0x32')](function(_0x53db81){if(_0x53db81){_0x5378b6=_0x53db81;_0x383aa3[_0x7451('0x3c')]=_['keys'](db['DeskConfiguration'][_0x7451('0x37')]);_0x383aa3[_0x7451('0x39')]=_[_0x7451('0x38')](_0x1702c1[_0x7451('0x39')]);_0x383aa3[_0x7451('0x43')]=_[_0x7451('0x3b')](_0x383aa3['model'],_0x383aa3[_0x7451('0x39')]);_0xd943e3['attributes']=_[_0x7451('0x3b')](_0x383aa3[_0x7451('0x3c')],qs['fields'](_0x1702c1['query']['fields']));_0xd943e3['attributes']=_0xd943e3[_0x7451('0x3a')][_0x7451('0x4f')]?_0xd943e3[_0x7451('0x3a')]:_0x383aa3[_0x7451('0x3c')];_0xd943e3[_0x7451('0x40')]=qs[_0x7451('0x41')](_0x1702c1['query'][_0x7451('0x41')]);_0xd943e3['where']=qs[_0x7451('0x43')](_[_0x7451('0x42')](_0x1702c1[_0x7451('0x39')],_0x383aa3['filters']));if(_0x1702c1['query'][_0x7451('0x44')]){_0xd943e3[_0x7451('0x45')]=_[_0x7451('0x4a')](_0xd943e3[_0x7451('0x45')],{'$or':_[_0x7451('0x57')](_0xd943e3[_0x7451('0x3a')],function(_0x248c6c){var _0x631aff={};_0x631aff[_0x248c6c]={'$like':'%'+_0x1702c1[_0x7451('0x39')][_0x7451('0x44')]+'%'};return _0x631aff;})});}_0xd943e3=_['merge']({},_0xd943e3,_0x1702c1['options']);return _0x5378b6[_0x7451('0x55')](_0xd943e3);}})[_0x7451('0x32')](function(_0x9184be){if(_0x9184be){_0xace3c9=_0x9184be['length'];if(!_0x1702c1[_0x7451('0x39')][_0x7451('0x3e')](_0x7451('0x3f'))){_0xd943e3['limit']=qs[_0x7451('0x2c')](_0x1702c1[_0x7451('0x39')]['limit']);_0xd943e3['offset']=qs[_0x7451('0x2b')](_0x1702c1[_0x7451('0x39')]['offset']);}return _0x5378b6[_0x7451('0x55')](_0xd943e3);}})[_0x7451('0x32')](function(_0x4bb953){if(_0x4bb953){return _0x4bb953?{'count':_0xace3c9,'rows':_0x4bb953}:null;}})['then'](respondWithResult(_0x155a15,null))['catch'](handleError(_0x155a15,null));};exports[_0x7451('0x58')]=function(_0x468a27,_0x2021c7,_0x1a6666){if(_0x468a27[_0x7451('0x53')]['id']){delete _0x468a27[_0x7451('0x53')]['id'];}return db[_0x7451('0x36')][_0x7451('0x56')]({'where':{'id':_0x468a27[_0x7451('0x4e')]['id']}})[_0x7451('0x32')](handleEntityNotFound(_0x2021c7,null))[_0x7451('0x32')](function(_0x2ce57e){if(_0x2ce57e){_0x468a27[_0x7451('0x53')]['AccountId']=_0x2ce57e['id'];_0x468a27[_0x7451('0x53')][_0x7451('0x59')]=integrations[_0x7451('0x5a')](_0x468a27[_0x7451('0x53')]['channel'],_0x468a27[_0x7451('0x53')]['type']);_0x468a27['body'][_0x7451('0x5b')]=integrations[_0x7451('0x5c')](_0x468a27['body'][_0x7451('0x5d')],_0x468a27['body'][_0x7451('0x46')]);return db[_0x7451('0x5e')][_0x7451('0x52')](_0x468a27[_0x7451('0x53')],{'include':[{'model':db[_0x7451('0x5f')],'as':_0x7451('0x59')},{'model':db[_0x7451('0x5f')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2021c7,null))['catch'](handleError(_0x2021c7,null));};exports[_0x7451('0x60')]=function(_0xe0cbc4,_0xe9c2a5,_0x26ad13){var _0x2d7ab0=[{'name':_0x7451('0x61'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5c3bd9='';return db[_0x7451('0x36')][_0x7451('0x56')]({'where':{'id':_0xe0cbc4[_0x7451('0x4e')]['id']},'attributes':['id','remoteUri',_0x7451('0x62'),_0x7451('0x63'),'password','consumerKey',_0x7451('0x64'),_0x7451('0x65'),_0x7451('0x66')]})[_0x7451('0x32')](handleEntityNotFound(_0xe9c2a5,null))[_0x7451('0x32')](function(_0x3eaffa){if(_0x3eaffa){_0x5c3bd9=_0x3eaffa[_0x7451('0x67')];var _0xeb5152=_0x5c3bd9[_0x7451('0x68')](-0x1);if(_0xeb5152==='/'){_0x5c3bd9=_0x5c3bd9[_0x7451('0x69')](0x0,_0x5c3bd9[_0x7451('0x6a')](_0xeb5152));}var _0x50a396={'method':'GET','uri':util['format'](_0x7451('0x6b'),_0x5c3bd9),'headers':{'Content-Type':_0x7451('0x6c'),'Accept':'application/json'},'json':!![]};if(_0x3eaffa[_0x7451('0x62')]===_0x7451('0x6d')){_0x50a396[_0x7451('0x6e')][_0x7451('0x6f')]=util[_0x7451('0x70')](_0x7451('0x71'),new Buffer(util[_0x7451('0x70')](_0x7451('0x72'),_0x3eaffa[_0x7451('0x63')],_0x3eaffa[_0x7451('0x73')]))['toString'](_0x7451('0x74')));}return rp(_0x50a396)[_0x7451('0x32')](function(_0x51a7ed){return _0x2d7ab0['concat'](_['map'](_0x51a7ed['_embedded'][_0x7451('0x75')],function(_0x5f850e){return{'id':_0x5f850e[_0x7451('0x34')],'name':_0x5f850e['name'],'type':_0x5f850e[_0x7451('0x46')],'active':_0x5f850e[_0x7451('0x76')],'label':_0x5f850e['label'],'custom':!![]};}));});}})[_0x7451('0x32')](function(_0x2a9927){return{'count':_0x2a9927[_0x7451('0x4f')],'rows':_0x2a9927};})[_0x7451('0x32')](respondWithResult(_0xe9c2a5,null))[_0x7451('0x25')](function(_0x1fea7e){var _0x1d86d8=_0xe0cbc4[_0x7451('0x39')][_0x7451('0x77')]?0x1f4:_0x1fea7e[_0x7451('0x78')]||0x1f4;logger[_0x7451('0x22')](_0x7451('0x79'),_0x7451('0x60'),_0x1d86d8,JSON[_0x7451('0x21')](_0x1fea7e));delete _0x1fea7e['name'];if(_0x1d86d8===0x191){_0x1d86d8=0x190;}_0xe9c2a5[_0x7451('0x27')](_0x1d86d8)[_0x7451('0x7a')](_0xe0cbc4[_0x7451('0x39')][_0x7451('0x77')]?{'message':_0x7451('0x7b'),'statusCode':_0x1fea7e[_0x7451('0x78')]}:_0x1fea7e);});}; \ No newline at end of file +var _0x087b=['getSubjects','channel','Descriptions','DeskField','priority','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','base64','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','options','DeskAccount','includeAll','include','findAll','find','create','body','update','params','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','Subjects'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x087b,0x11a));var _0xb087=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x087b[_0x39e84d];return _0x1991bc;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var authService=require(_0xb087('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb087('0x13'));var qs=require(_0xb087('0x14'));var logger=require(_0xb087('0x15'))(_0xb087('0x16'));var utils=require(_0xb087('0x17'));var config=require(_0xb087('0x18'));var db=require(_0xb087('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb087('0x1a'));var client=jayson[_0xb087('0x1b')][_0xb087('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x51ceaa,_0x3001e3,_0x3f145e,_0x43f136){return new BPromise(function(_0x46410b,_0x11784c){var _0x12d0db=_0x43f136||client;return _0x12d0db[_0xb087('0x1d')](_0x51ceaa,_0x3f145e)[_0xb087('0x1e')](function(_0x24e1a3){logger[_0xb087('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x3001e3,_0xb087('0x20'));logger[_0xb087('0x21')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3001e3,_0xb087('0x20'),JSON[_0xb087('0x22')](_0x24e1a3));if(_0x24e1a3[_0xb087('0x23')]){if(_0x24e1a3['error'][_0xb087('0x24')]===0x1f4){logger[_0xb087('0x23')](_0xb087('0x25'),_0x3001e3,_0x24e1a3[_0xb087('0x23')]['message']);return _0x11784c(_0x24e1a3[_0xb087('0x23')][_0xb087('0x26')]);}logger[_0xb087('0x23')](_0xb087('0x25'),_0x3001e3,_0x24e1a3['error']['message']);return _0x46410b(_0x24e1a3['error']['message']);}else{logger[_0xb087('0x1f')](_0xb087('0x25'),_0x3001e3,_0xb087('0x20'));_0x46410b(_0x24e1a3[_0xb087('0x27')][_0xb087('0x26')]);}})[_0xb087('0x28')](function(_0x31ae01){logger['error'](_0xb087('0x25'),_0x3001e3,_0x31ae01);_0x11784c(_0x31ae01);});});}function respondWithStatusCode(_0x466397,_0x1de654){_0x1de654=_0x1de654||0xcc;return function(_0x1cfb3e){if(_0x1cfb3e){return _0x466397[_0xb087('0x29')](_0x1de654);}return _0x466397['status'](_0x1de654)[_0xb087('0x2a')]();};}function respondWithResult(_0xdd4216,_0x502438){_0x502438=_0x502438||0xc8;return function(_0x5a2dc6){if(_0x5a2dc6){return _0xdd4216['status'](_0x502438)['json'](_0x5a2dc6);}};}function respondWithFilteredResult(_0x5a4ee0,_0x304840){return function(_0x45685d){if(_0x45685d){var _0x1d124f=_0x45685d[_0xb087('0x2b')],_0x3ca2df=_0x304840[_0xb087('0x2c')],_0xd9ec66=_0x304840[_0xb087('0x2c')]+_0x304840[_0xb087('0x2d')],_0xb72173;if(_0xd9ec66>=_0x1d124f){_0xd9ec66=_0x1d124f;_0xb72173=0xc8;}else{_0xb72173=0xce;}_0x5a4ee0[_0xb087('0x2e')](_0xb72173);return _0x5a4ee0[_0xb087('0x2f')](_0xb087('0x30'),_0x3ca2df+'-'+_0xd9ec66+'/'+_0x1d124f)[_0xb087('0x31')](_0x45685d);}return null;};}function patchUpdates(_0x593b78){return function(_0x37393a){try{jsonpatch[_0xb087('0x32')](_0x37393a,_0x593b78,!![]);}catch(_0x20183f){return BPromise[_0xb087('0x33')](_0x20183f);}return _0x37393a[_0xb087('0x34')]();};}function saveUpdates(_0xa6d90c,_0x2e1c57){return function(_0x13fb2f){if(_0x13fb2f){return _0x13fb2f['update'](_0xa6d90c)['then'](function(_0x3f9311){return _0x3f9311;});}return null;};}function removeEntity(_0xedd164,_0x4cb5a8){return function(_0x60bfe2){if(_0x60bfe2){return _0x60bfe2[_0xb087('0x35')]()[_0xb087('0x1e')](function(){_0xedd164[_0xb087('0x2e')](0xcc)[_0xb087('0x2a')]();});}};}function handleEntityNotFound(_0x427905,_0xa2ac06){return function(_0x3b7ace){if(!_0x3b7ace){_0x427905[_0xb087('0x29')](0x194);}return _0x3b7ace;};}function handleError(_0xdc7033,_0x442a5e){_0x442a5e=_0x442a5e||0x1f4;return function(_0x3069b5){logger['error'](_0x3069b5[_0xb087('0x36')]);if(_0x3069b5['name']){delete _0x3069b5[_0xb087('0x37')];}_0xdc7033[_0xb087('0x2e')](_0x442a5e)[_0xb087('0x38')](_0x3069b5);};}exports[_0xb087('0x39')]=function(_0x13cb5d,_0x1a4b17){var _0x32c3e8={},_0x29df58={},_0x8a4c3c={'count':0x0,'rows':[]};var _0x521c3f=db['DeskAccount'][_0xb087('0x3a')];_0x29df58[_0xb087('0x3b')]=_[_0xb087('0x3c')](_0x521c3f);_0x29df58[_0xb087('0x3d')]=_[_0xb087('0x3c')](_0x13cb5d['query']);_0x29df58[_0xb087('0x3e')]=_[_0xb087('0x3f')](_0x29df58['model'],_0x29df58['query']);_0x32c3e8[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x29df58[_0xb087('0x3b')],qs['fields'](_0x13cb5d[_0xb087('0x3d')][_0xb087('0x41')]));_0x32c3e8[_0xb087('0x40')]=_0x32c3e8[_0xb087('0x40')][_0xb087('0x42')]?_0x32c3e8['attributes']:_0x29df58[_0xb087('0x3b')];if(!_0x13cb5d['query'][_0xb087('0x43')]('nolimit')){_0x32c3e8[_0xb087('0x2d')]=qs[_0xb087('0x2d')](_0x13cb5d['query'][_0xb087('0x2d')]);_0x32c3e8['offset']=qs[_0xb087('0x2c')](_0x13cb5d['query'][_0xb087('0x2c')]);}_0x32c3e8[_0xb087('0x44')]=qs[_0xb087('0x45')](_0x13cb5d[_0xb087('0x3d')][_0xb087('0x45')]);_0x32c3e8[_0xb087('0x46')]=qs[_0xb087('0x3e')](_['pick'](_0x13cb5d[_0xb087('0x3d')],_0x29df58['filters']));if(_0x13cb5d[_0xb087('0x3d')][_0xb087('0x47')]){_0x32c3e8['where']=_[_0xb087('0x48')](_0x32c3e8[_0xb087('0x46')],{'$or':_[_0xb087('0x49')](_0x521c3f,function(_0x4c33cc){if(_0x4c33cc[_0xb087('0x4a')]['key']!==_0xb087('0x4b')){var _0x32b9d3={};_0x32b9d3[_0x4c33cc['field']]={'$like':'%'+_0x13cb5d[_0xb087('0x3d')][_0xb087('0x47')]+'%'};return _0x32b9d3;}})});}_0x32c3e8=_['merge']({},_0x32c3e8,_0x13cb5d[_0xb087('0x4c')]);var _0x171778={'where':_0x32c3e8['where']};return db[_0xb087('0x4d')][_0xb087('0x2b')](_0x171778)[_0xb087('0x1e')](function(_0x174c10){_0x8a4c3c['count']=_0x174c10;if(_0x13cb5d['query'][_0xb087('0x4e')]){_0x32c3e8[_0xb087('0x4f')]=[{'all':!![]}];}return db[_0xb087('0x4d')][_0xb087('0x50')](_0x32c3e8);})[_0xb087('0x1e')](function(_0x16a7b4){_0x8a4c3c['rows']=_0x16a7b4;return _0x8a4c3c;})['then'](respondWithFilteredResult(_0x1a4b17,_0x32c3e8))[_0xb087('0x28')](handleError(_0x1a4b17,null));};exports['show']=function(_0x3a405b,_0x3966f4){var _0x2a1823={'raw':![],'where':{'id':_0x3a405b['params']['id']}},_0x176c30={};_0x176c30[_0xb087('0x3b')]=_['keys'](db[_0xb087('0x4d')][_0xb087('0x3a')]);_0x176c30[_0xb087('0x3d')]=_[_0xb087('0x3c')](_0x3a405b[_0xb087('0x3d')]);_0x176c30['filters']=_[_0xb087('0x3f')](_0x176c30[_0xb087('0x3b')],_0x176c30[_0xb087('0x3d')]);_0x2a1823['attributes']=_[_0xb087('0x3f')](_0x176c30['model'],qs['fields'](_0x3a405b[_0xb087('0x3d')][_0xb087('0x41')]));_0x2a1823['attributes']=_0x2a1823[_0xb087('0x40')][_0xb087('0x42')]?_0x2a1823[_0xb087('0x40')]:_0x176c30['model'];if(_0x3a405b['query'][_0xb087('0x4e')]){_0x2a1823['include']=[{'all':!![]}];}_0x2a1823=_['merge']({},_0x2a1823,_0x3a405b[_0xb087('0x4c')]);return db[_0xb087('0x4d')][_0xb087('0x51')](_0x2a1823)[_0xb087('0x1e')](handleEntityNotFound(_0x3966f4,null))[_0xb087('0x1e')](respondWithResult(_0x3966f4,null))[_0xb087('0x28')](handleError(_0x3966f4,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){return db[_0xb087('0x4d')][_0xb087('0x52')](_0xfb8827[_0xb087('0x53')],{})['then'](respondWithResult(_0x1fe178,0xc9))[_0xb087('0x28')](handleError(_0x1fe178,null));};exports[_0xb087('0x54')]=function(_0x5cac89,_0xde0773){if(_0x5cac89[_0xb087('0x53')]['id']){delete _0x5cac89[_0xb087('0x53')]['id'];}return db[_0xb087('0x4d')][_0xb087('0x51')]({'where':{'id':_0x5cac89[_0xb087('0x55')]['id']}})[_0xb087('0x1e')](handleEntityNotFound(_0xde0773,null))[_0xb087('0x1e')](saveUpdates(_0x5cac89[_0xb087('0x53')],null))[_0xb087('0x1e')](respondWithResult(_0xde0773,null))[_0xb087('0x28')](handleError(_0xde0773,null));};exports['destroy']=function(_0x269eda,_0x56410e){return db[_0xb087('0x4d')]['find']({'where':{'id':_0x269eda[_0xb087('0x55')]['id']}})[_0xb087('0x1e')](handleEntityNotFound(_0x56410e,null))[_0xb087('0x1e')](removeEntity(_0x56410e,null))[_0xb087('0x28')](handleError(_0x56410e,null));};exports[_0xb087('0x56')]=function(_0x465ef6,_0x383304,_0x31436c){var _0x3f3091={};var _0x323e0a={};var _0x300e9b;var _0x2ee0a3;return db[_0xb087('0x4d')][_0xb087('0x57')]({'where':{'id':_0x465ef6[_0xb087('0x55')]['id']}})[_0xb087('0x1e')](handleEntityNotFound(_0x383304,null))[_0xb087('0x1e')](function(_0x3185c4){if(_0x3185c4){_0x300e9b=_0x3185c4;_0x323e0a[_0xb087('0x3b')]=_[_0xb087('0x3c')](db[_0xb087('0x58')][_0xb087('0x3a')]);_0x323e0a['query']=_[_0xb087('0x3c')](_0x465ef6[_0xb087('0x3d')]);_0x323e0a[_0xb087('0x3e')]=_['intersection'](_0x323e0a[_0xb087('0x3b')],_0x323e0a[_0xb087('0x3d')]);_0x3f3091['attributes']=_[_0xb087('0x3f')](_0x323e0a[_0xb087('0x3b')],qs[_0xb087('0x41')](_0x465ef6['query'][_0xb087('0x41')]));_0x3f3091[_0xb087('0x40')]=_0x3f3091[_0xb087('0x40')][_0xb087('0x42')]?_0x3f3091[_0xb087('0x40')]:_0x323e0a[_0xb087('0x3b')];_0x3f3091[_0xb087('0x44')]=qs[_0xb087('0x45')](_0x465ef6['query'][_0xb087('0x45')]);_0x3f3091[_0xb087('0x46')]=qs[_0xb087('0x3e')](_['pick'](_0x465ef6[_0xb087('0x3d')],_0x323e0a['filters']));if(_0x465ef6['query'][_0xb087('0x47')]){_0x3f3091[_0xb087('0x46')]=_['merge'](_0x3f3091[_0xb087('0x46')],{'$or':_['map'](_0x3f3091[_0xb087('0x40')],function(_0x1a8237){var _0x5938ad={};_0x5938ad[_0x1a8237]={'$like':'%'+_0x465ef6['query'][_0xb087('0x47')]+'%'};return _0x5938ad;})});}_0x3f3091=_['merge']({},_0x3f3091,_0x465ef6['options']);return _0x300e9b[_0xb087('0x56')](_0x3f3091);}})['then'](function(_0x34ad78){if(_0x34ad78){_0x2ee0a3=_0x34ad78['length'];if(!_0x465ef6[_0xb087('0x3d')][_0xb087('0x43')](_0xb087('0x59'))){_0x3f3091[_0xb087('0x2d')]=qs[_0xb087('0x2d')](_0x465ef6[_0xb087('0x3d')]['limit']);_0x3f3091[_0xb087('0x2c')]=qs['offset'](_0x465ef6[_0xb087('0x3d')][_0xb087('0x2c')]);}return _0x300e9b[_0xb087('0x56')](_0x3f3091);}})['then'](function(_0x298bbb){if(_0x298bbb){return _0x298bbb?{'count':_0x2ee0a3,'rows':_0x298bbb}:null;}})['then'](respondWithResult(_0x383304,null))[_0xb087('0x28')](handleError(_0x383304,null));};exports[_0xb087('0x5a')]=function(_0x66f15b,_0x2ee63f,_0x16cb87){if(_0x66f15b[_0xb087('0x53')]['id']){delete _0x66f15b['body']['id'];}return db[_0xb087('0x4d')][_0xb087('0x57')]({'where':{'id':_0x66f15b['params']['id']}})[_0xb087('0x1e')](handleEntityNotFound(_0x2ee63f,null))['then'](function(_0x19238d){if(_0x19238d){_0x66f15b[_0xb087('0x53')][_0xb087('0x5b')]=_0x19238d['id'];_0x66f15b[_0xb087('0x53')][_0xb087('0x5c')]=integrations[_0xb087('0x5d')](_0x66f15b[_0xb087('0x53')][_0xb087('0x5e')],_0x66f15b['body']['type']);_0x66f15b['body'][_0xb087('0x5f')]=integrations['getDescriptions'](_0x66f15b[_0xb087('0x53')]['channel'],_0x66f15b[_0xb087('0x53')][_0xb087('0x4a')]);return db[_0xb087('0x58')][_0xb087('0x52')](_0x66f15b['body'],{'include':[{'model':db[_0xb087('0x60')],'as':'Subjects'},{'model':db[_0xb087('0x60')],'as':_0xb087('0x5f')}]});}return null;})[_0xb087('0x1e')](respondWithResult(_0x2ee63f,null))[_0xb087('0x28')](handleError(_0x2ee63f,null));};exports['getFields']=function(_0x49d26a,_0x38f296,_0x5a16bb){var _0x18f220=[{'name':_0xb087('0x61'),'label':_0xb087('0x61'),'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 _0x3a96ba='';return db['DeskAccount']['findOne']({'where':{'id':_0x49d26a[_0xb087('0x55')]['id']},'attributes':['id','remoteUri',_0xb087('0x62'),_0xb087('0x63'),_0xb087('0x64'),_0xb087('0x65'),_0xb087('0x66'),'token',_0xb087('0x67')]})[_0xb087('0x1e')](handleEntityNotFound(_0x38f296,null))['then'](function(_0x544ee0){if(_0x544ee0){_0x3a96ba=_0x544ee0['remoteUri'];var _0x12f570=_0x3a96ba[_0xb087('0x68')](-0x1);if(_0x12f570==='/'){_0x3a96ba=_0x3a96ba[_0xb087('0x69')](0x0,_0x3a96ba[_0xb087('0x6a')](_0x12f570));}var _0x2b3420={'method':_0xb087('0x6b'),'uri':util['format'](_0xb087('0x6c'),_0x3a96ba),'headers':{'Content-Type':_0xb087('0x6d'),'Accept':_0xb087('0x6d')},'json':!![]};if(_0x544ee0[_0xb087('0x62')]===_0xb087('0x6e')){_0x2b3420[_0xb087('0x6f')][_0xb087('0x70')]=util['format'](_0xb087('0x71'),new Buffer(util[_0xb087('0x72')](_0xb087('0x73'),_0x544ee0['username'],_0x544ee0[_0xb087('0x64')]))['toString'](_0xb087('0x74')));}return rp(_0x2b3420)[_0xb087('0x1e')](function(_0x45da69){return _0x18f220[_0xb087('0x75')](_[_0xb087('0x49')](_0x45da69[_0xb087('0x76')]['entries'],function(_0x4ae3bb){return{'id':_0x4ae3bb[_0xb087('0x37')],'name':_0x4ae3bb[_0xb087('0x37')],'type':_0x4ae3bb['type'],'active':_0x4ae3bb[_0xb087('0x77')],'label':_0x4ae3bb[_0xb087('0x78')],'custom':!![]};}));});}})[_0xb087('0x1e')](function(_0x2618d6){return{'count':_0x2618d6[_0xb087('0x42')],'rows':_0x2618d6};})[_0xb087('0x1e')](respondWithResult(_0x38f296,null))['catch'](function(_0x15ff29){var _0x141859=_0x49d26a[_0xb087('0x3d')][_0xb087('0x79')]?0x1f4:_0x15ff29[_0xb087('0x7a')]||0x1f4;logger[_0xb087('0x23')](_0xb087('0x7b'),_0xb087('0x7c'),_0x141859,JSON[_0xb087('0x22')](_0x15ff29));delete _0x15ff29['name'];if(_0x141859===0x191){_0x141859=0x190;}_0x38f296[_0xb087('0x2e')](_0x141859)['send'](_0x49d26a[_0xb087('0x3d')][_0xb087('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x15ff29[_0xb087('0x7a')]}:_0x15ff29);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 8d79484..edb7c81 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 _0x955f=['moment','request-promise','exports','define','DeskAccount','lodash','util','../../config/logger','api'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x955f,0x1eb));var _0xf955=function(_0x4704dc,_0x573003){_0x4704dc=_0x4704dc-0x0;var _0x270fb2=_0x955f[_0x4704dc];return _0x270fb2;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xf955('0x6')]=function(_0x5a20bc,_0x13b796){return _0x5a20bc[_0xf955('0x7')](_0xf955('0x8'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89fb=['api','moment','bluebird','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','util','../../config/logger'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0x89fb,0x14b));var _0xb89f=function(_0x7bb5d1,_0x1d508a){_0x7bb5d1=_0x7bb5d1-0x0;var _0x550a9c=_0x89fb[_0x7bb5d1];return _0x550a9c;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var logger=require(_0xb89f('0x1'))(_0xb89f('0x2'));var moment=require(_0xb89f('0x3'));var BPromise=require(_0xb89f('0x4'));var rp=require('request-promise');var attributes=require(_0xb89f('0x5'));var integrations=require(_0xb89f('0x6'));module[_0xb89f('0x7')]=function(_0x34c4ce,_0x1987aa){return _0x34c4ce['define'](_0xb89f('0x8'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index c7c7d5c..6758d3b 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 _0xa169=['map','stringify','ShowDeskAccount','DeskAccount','then','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetDeskAccount','options','raw','where','limit','include','model','attributes'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xa169,0xaa));var _0x9a16=function(_0x382b79,_0x289ceb){_0x382b79=_0x382b79-0x0;var _0x435fe2=_0xa169[_0x382b79];return _0x435fe2;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var moment=require(_0x9a16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a16('0x3'));var db=require(_0x9a16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a16('0x5'))(_0x9a16('0x6'));var config=require(_0x9a16('0x7'));var jayson=require(_0x9a16('0x8'));var client=jayson[_0x9a16('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31597a,_0x1b3458,_0xae9d70){return new BPromise(function(_0xe871ab,_0x4d164e){return client[_0x9a16('0xa')](_0x31597a,_0xae9d70)['then'](function(_0x3c0f0a){logger['info'](_0x9a16('0xb'),_0x1b3458,_0x9a16('0xc'));logger[_0x9a16('0xd')](_0x9a16('0xe'),_0x1b3458,_0x9a16('0xc'),JSON['stringify'](_0x3c0f0a));if(_0x3c0f0a['error']){if(_0x3c0f0a[_0x9a16('0xf')]['code']===0x1f4){logger['error'](_0x9a16('0xb'),_0x1b3458,_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);return _0x4d164e(_0x3c0f0a[_0x9a16('0xf')]['message']);}logger[_0x9a16('0xf')](_0x9a16('0xb'),_0x1b3458,_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);return _0xe871ab(_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);}else{logger[_0x9a16('0x11')](_0x9a16('0xb'),_0x1b3458,'request\x20sent');_0xe871ab(_0x3c0f0a[_0x9a16('0x12')][_0x9a16('0x10')]);}})[_0x9a16('0x13')](function(_0x33fecb){logger['error']('DeskAccount,\x20%s,\x20%s',_0x1b3458,_0x33fecb);_0x4d164e(_0x33fecb);});});}exports[_0x9a16('0x14')]=function(_0x3fc94d){var _0x5ab424=this;return new Promise(function(_0x3024ab,_0x553d41){return db['DeskAccount']['findAll']({'raw':_0x3fc94d['options']?_0x3fc94d[_0x9a16('0x15')][_0x9a16('0x16')]===undefined?!![]:![]:!![],'where':_0x3fc94d['options']?_0x3fc94d[_0x9a16('0x15')][_0x9a16('0x17')]||null:null,'attributes':_0x3fc94d[_0x9a16('0x15')]?_0x3fc94d[_0x9a16('0x15')]['attributes']||null:null,'limit':_0x3fc94d[_0x9a16('0x15')]?_0x3fc94d[_0x9a16('0x15')][_0x9a16('0x18')]||null:null,'include':_0x3fc94d[_0x9a16('0x15')]?_0x3fc94d[_0x9a16('0x15')][_0x9a16('0x19')]?_['map'](_0x3fc94d['options']['include'],function(_0x38dcbf){return{'model':db[_0x38dcbf[_0x9a16('0x1a')]],'as':_0x38dcbf['as'],'attributes':_0x38dcbf[_0x9a16('0x1b')],'include':_0x38dcbf[_0x9a16('0x19')]?_['map'](_0x38dcbf[_0x9a16('0x19')],function(_0x34397b){return{'model':db[_0x34397b['model']],'as':_0x34397b['as'],'attributes':_0x34397b[_0x9a16('0x1b')],'include':_0x34397b[_0x9a16('0x19')]?_[_0x9a16('0x1c')](_0x34397b[_0x9a16('0x19')],function(_0x342186){return{'model':db[_0x342186[_0x9a16('0x1a')]],'as':_0x342186['as'],'attributes':_0x342186[_0x9a16('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x345a19){logger[_0x9a16('0x11')](_0x9a16('0x14'),_0x3fc94d);logger[_0x9a16('0xd')](_0x9a16('0x14'),_0x3fc94d,JSON[_0x9a16('0x1d')](_0x345a19));_0x3024ab(_0x345a19);})[_0x9a16('0x13')](function(_0x564d5){logger[_0x9a16('0xf')]('GetDeskAccount',_0x564d5[_0x9a16('0x10')],_0x3fc94d);_0x553d41(_0x5ab424[_0x9a16('0xf')](0x1f4,_0x564d5[_0x9a16('0x10')]));});});};exports[_0x9a16('0x1e')]=function(_0x4d47f0){var _0x7be0f5=this;return new Promise(function(_0x26b31e,_0x19c702){return db[_0x9a16('0x1f')]['find']({'raw':_0x4d47f0[_0x9a16('0x15')]?_0x4d47f0[_0x9a16('0x15')][_0x9a16('0x16')]===undefined?!![]:![]:!![],'where':_0x4d47f0[_0x9a16('0x15')]?_0x4d47f0['options'][_0x9a16('0x17')]||null:null,'attributes':_0x4d47f0['options']?_0x4d47f0['options'][_0x9a16('0x1b')]||null:null,'include':_0x4d47f0[_0x9a16('0x15')]?_0x4d47f0[_0x9a16('0x15')][_0x9a16('0x19')]?_[_0x9a16('0x1c')](_0x4d47f0[_0x9a16('0x15')][_0x9a16('0x19')],function(_0x37cc1f){return{'model':db[_0x37cc1f['model']],'as':_0x37cc1f['as'],'attributes':_0x37cc1f[_0x9a16('0x1b')],'include':_0x37cc1f[_0x9a16('0x19')]?_['map'](_0x37cc1f[_0x9a16('0x19')],function(_0x1f0e3f){return{'model':db[_0x1f0e3f[_0x9a16('0x1a')]],'as':_0x1f0e3f['as'],'attributes':_0x1f0e3f[_0x9a16('0x1b')],'include':_0x1f0e3f[_0x9a16('0x19')]?_[_0x9a16('0x1c')](_0x1f0e3f['include'],function(_0x14d7c6){return{'model':db[_0x14d7c6[_0x9a16('0x1a')]],'as':_0x14d7c6['as'],'attributes':_0x14d7c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a16('0x20')](function(_0x3e7688){logger[_0x9a16('0x11')](_0x9a16('0x1e'),_0x4d47f0);logger['debug']('ShowDeskAccount',_0x4d47f0,JSON[_0x9a16('0x1d')](_0x3e7688));_0x26b31e(_0x3e7688);})[_0x9a16('0x13')](function(_0x35ca91){logger[_0x9a16('0xf')](_0x9a16('0x1e'),_0x35ca91[_0x9a16('0x10')],_0x4d47f0);_0x19c702(_0x7be0f5[_0x9a16('0xf')](0x1f4,_0x35ca91[_0x9a16('0x10')]));});});}; \ No newline at end of file +var _0x3c91=['raw','where','attributes','limit','include','map','model','GetDeskAccount','debug','ShowDeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','DeskAccount','options'];(function(_0x4a84b7,_0x386495){var _0x3c0146=function(_0x5238fb){while(--_0x5238fb){_0x4a84b7['push'](_0x4a84b7['shift']());}};_0x3c0146(++_0x386495);}(_0x3c91,0x1af));var _0x13c9=function(_0x4e5877,_0x43cb98){_0x4e5877=_0x4e5877-0x0;var _0x1916b7=_0x3c91[_0x4e5877];return _0x1916b7;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('DeskAccount,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});}exports['GetDeskAccount']=function(_0xd08fc0){var _0x1a6c06=this;return new Promise(function(_0x1dcaf7,_0x339e7f){return db[_0x13c9('0x16')]['findAll']({'raw':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x18')]===undefined?!![]:![]:!![],'where':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x19')]||null:null,'attributes':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0['options'][_0x13c9('0x1a')]||null:null,'limit':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1b')]||null:null,'include':_0xd08fc0[_0x13c9('0x17')]?_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0xd08fc0[_0x13c9('0x17')][_0x13c9('0x1c')],function(_0x5dfd9d){return{'model':db[_0x5dfd9d[_0x13c9('0x1e')]],'as':_0x5dfd9d['as'],'attributes':_0x5dfd9d[_0x13c9('0x1a')],'include':_0x5dfd9d[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x5dfd9d[_0x13c9('0x1c')],function(_0x55b3d9){return{'model':db[_0x55b3d9[_0x13c9('0x1e')]],'as':_0x55b3d9['as'],'attributes':_0x55b3d9['attributes'],'include':_0x55b3d9['include']?_[_0x13c9('0x1d')](_0x55b3d9[_0x13c9('0x1c')],function(_0x3ca92a){return{'model':db[_0x3ca92a[_0x13c9('0x1e')]],'as':_0x3ca92a['as'],'attributes':_0x3ca92a[_0x13c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x13c9('0xc')](function(_0x3fcf1c){logger[_0x13c9('0x13')](_0x13c9('0x1f'),_0xd08fc0);logger[_0x13c9('0x20')]('GetDeskAccount',_0xd08fc0,JSON[_0x13c9('0xf')](_0x3fcf1c));_0x1dcaf7(_0x3fcf1c);})[_0x13c9('0x15')](function(_0x5d8997){logger[_0x13c9('0x10')](_0x13c9('0x1f'),_0x5d8997[_0x13c9('0x12')],_0xd08fc0);_0x339e7f(_0x1a6c06['error'](0x1f4,_0x5d8997['message']));});});};exports[_0x13c9('0x21')]=function(_0x35249b){var _0x1a1710=this;return new Promise(function(_0x4cb64a,_0x309606){return db[_0x13c9('0x16')][_0x13c9('0x22')]({'raw':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')][_0x13c9('0x19')]||null:null,'attributes':_0x35249b[_0x13c9('0x17')]?_0x35249b[_0x13c9('0x17')][_0x13c9('0x1a')]||null:null,'include':_0x35249b[_0x13c9('0x17')]?_0x35249b['options'][_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x35249b['options'][_0x13c9('0x1c')],function(_0x119b60){return{'model':db[_0x119b60[_0x13c9('0x1e')]],'as':_0x119b60['as'],'attributes':_0x119b60[_0x13c9('0x1a')],'include':_0x119b60[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x119b60['include'],function(_0x4db35f){return{'model':db[_0x4db35f[_0x13c9('0x1e')]],'as':_0x4db35f['as'],'attributes':_0x4db35f[_0x13c9('0x1a')],'include':_0x4db35f[_0x13c9('0x1c')]?_[_0x13c9('0x1d')](_0x4db35f['include'],function(_0x38d479){return{'model':db[_0x38d479[_0x13c9('0x1e')]],'as':_0x38d479['as'],'attributes':_0x38d479['attributes']};}):[]};}):[]};}):[]:[]})[_0x13c9('0xc')](function(_0x1cfdfc){logger[_0x13c9('0x13')]('ShowDeskAccount',_0x35249b);logger[_0x13c9('0x20')](_0x13c9('0x21'),_0x35249b,JSON[_0x13c9('0xf')](_0x1cfdfc));_0x4cb64a(_0x1cfdfc);})[_0x13c9('0x15')](function(_0x4e6cc3){logger['error'](_0x13c9('0x21'),_0x4e6cc3[_0x13c9('0x12')],_0x35249b);_0x309606(_0x1a1710['error'](0x1f4,_0x4e6cc3[_0x13c9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index eee83be..d293571 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 _0x6759=['/:id/tags','getTags','post','create','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x33875d,_0xf2f624){var _0x477086=function(_0x5331e4){while(--_0x5331e4){_0x33875d['push'](_0x33875d['shift']());}};_0x477086(++_0xf2f624);}(_0x6759,0x11d));var _0x9675=function(_0x2d7712,_0x39aba4){_0x2d7712=_0x2d7712-0x0;var _0x2efa08=_0x6759[_0x2d7712];return _0x2efa08;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9675('0x0'));var timeout=require(_0x9675('0x1'));var express=require(_0x9675('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9675('0x3'));var config=require(_0x9675('0x4'));var controller=require(_0x9675('0x5'));router[_0x9675('0x6')]('/',auth[_0x9675('0x7')](),controller[_0x9675('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9675('0x9')]);router['get'](_0x9675('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x9675('0x6')](_0x9675('0xb'),auth['isAuthenticated'](),controller[_0x9675('0xc')]);router['get'](_0x9675('0xd'),auth[_0x9675('0x7')](),controller['getDescriptions']);router['get'](_0x9675('0xe'),auth[_0x9675('0x7')](),controller[_0x9675('0xf')]);router[_0x9675('0x10')]('/',auth[_0x9675('0x7')](),controller[_0x9675('0x11')]);router[_0x9675('0x10')](_0x9675('0xe'),auth['isAuthenticated'](),controller['setTags']);router['put'](_0x9675('0x12'),auth[_0x9675('0x7')](),controller[_0x9675('0x13')]);router[_0x9675('0x14')](_0x9675('0x12'),auth[_0x9675('0x7')](),controller[_0x9675('0x15')]);module[_0x9675('0x16')]=router; \ No newline at end of file +var _0x0163=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','destroy'];(function(_0x5613a1,_0x4d1104){var _0x175bdc=function(_0x1afa72){while(--_0x1afa72){_0x5613a1['push'](_0x5613a1['shift']());}};_0x175bdc(++_0x4d1104);}(_0x0163,0x189));var _0x3016=function(_0x3cd919,_0x356b19){_0x3cd919=_0x3cd919-0x0;var _0x1aa67a=_0x0163[_0x3cd919];return _0x1aa67a;};'use strict';var multer=require(_0x3016('0x0'));var util=require(_0x3016('0x1'));var path=require(_0x3016('0x2'));var timeout=require(_0x3016('0x3'));var express=require('express');var router=express[_0x3016('0x4')]();var auth=require(_0x3016('0x5'));var interaction=require(_0x3016('0x6'));var config=require(_0x3016('0x7'));var controller=require(_0x3016('0x8'));router[_0x3016('0x9')]('/',auth[_0x3016('0xa')](),controller[_0x3016('0xb')]);router[_0x3016('0x9')]('/:id',auth[_0x3016('0xa')](),controller['show']);router[_0x3016('0x9')](_0x3016('0xc'),auth[_0x3016('0xa')](),controller[_0x3016('0xd')]);router['get'](_0x3016('0xe'),auth[_0x3016('0xa')](),controller[_0x3016('0xf')]);router[_0x3016('0x9')](_0x3016('0x10'),auth[_0x3016('0xa')](),controller[_0x3016('0x11')]);router[_0x3016('0x9')](_0x3016('0x12'),auth['isAuthenticated'](),controller[_0x3016('0x13')]);router[_0x3016('0x14')]('/',auth[_0x3016('0xa')](),controller[_0x3016('0x15')]);router[_0x3016('0x14')](_0x3016('0x12'),auth['isAuthenticated'](),controller[_0x3016('0x16')]);router[_0x3016('0x17')](_0x3016('0x18'),auth['isAuthenticated'](),controller[_0x3016('0x19')]);router['delete'](_0x3016('0x18'),auth[_0x3016('0xa')](),controller[_0x3016('0x1a')]);module[_0x3016('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index d696d1c..9e1afd7 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 _0x3c91=['exports','STRING'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x3c91,0x6c));var _0x13c9=function(_0x5060cd,_0x31d1a7){_0x5060cd=_0x5060cd-0x0;var _0x1d44a2=_0x3c91[_0x5060cd];return _0x1d44a2;};'use strict';var Sequelize=require('sequelize');module[_0x13c9('0x0')]={'name':{'type':Sequelize[_0x13c9('0x1')]},'description':{'type':Sequelize[_0x13c9('0x1')]}}; \ No newline at end of file +var _0xfc92=['STRING','sequelize','exports'];(function(_0x522a08,_0x12ac58){var _0x4d7797=function(_0x259e91){while(--_0x259e91){_0x522a08['push'](_0x522a08['shift']());}};_0x4d7797(++_0x12ac58);}(_0xfc92,0x1c3));var _0x2fc9=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0xfc92[_0x585ee5];return _0x470808;};'use strict';var Sequelize=require(_0x2fc9('0x0'));module[_0x2fc9('0x1')]={'name':{'type':Sequelize[_0x2fc9('0x2')]},'description':{'type':Sequelize[_0x2fc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index f7e541c..463440d 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 _0xb4e6=['length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','DeskField','order','map','getSubjects','pick','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','name','send','index','DeskConfiguration','rawAttributes','model','query','keys','intersection','attributes','fields'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xb4e6[_0x403c20];return _0x2b271a;};'use strict';var pdf=require(_0x6b4e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b4e('0x1'));var zipdir=require(_0x6b4e('0x2'));var jsonpatch=require(_0x6b4e('0x3'));var rp=require(_0x6b4e('0x4'));var moment=require(_0x6b4e('0x5'));var BPromise=require(_0x6b4e('0x6'));var Mustache=require(_0x6b4e('0x7'));var util=require('util');var path=require(_0x6b4e('0x8'));var sox=require(_0x6b4e('0x9'));var csv=require(_0x6b4e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var authService=require(_0x6b4e('0xf'));var hardwareService=require(_0x6b4e('0x10'));var Redis=require(_0x6b4e('0x11'));var qs=require(_0x6b4e('0x12'));var logger=require(_0x6b4e('0x13'))('api');var utils=require(_0x6b4e('0x14'));var config=require(_0x6b4e('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6b4e('0x16'));var client=jayson[_0x6b4e('0x17')][_0x6b4e('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2b2ce0,_0x9f8f6c,_0xa3d358,_0x1db513){return new BPromise(function(_0x531eec,_0x36f8a5){var _0x29bdee=_0x1db513||client;return _0x29bdee['request'](_0x2b2ce0,_0xa3d358)[_0x6b4e('0x19')](function(_0x4b62ad){logger[_0x6b4e('0x1a')](_0x6b4e('0x1b'),_0x9f8f6c,_0x6b4e('0x1c'));logger[_0x6b4e('0x1d')](_0x6b4e('0x1e'),_0x9f8f6c,_0x6b4e('0x1c'),JSON['stringify'](_0x4b62ad));if(_0x4b62ad['error']){if(_0x4b62ad[_0x6b4e('0x1f')][_0x6b4e('0x20')]===0x1f4){logger[_0x6b4e('0x1f')](_0x6b4e('0x1b'),_0x9f8f6c,_0x4b62ad[_0x6b4e('0x1f')][_0x6b4e('0x21')]);return _0x36f8a5(_0x4b62ad[_0x6b4e('0x1f')][_0x6b4e('0x21')]);}logger[_0x6b4e('0x1f')](_0x6b4e('0x1b'),_0x9f8f6c,_0x4b62ad[_0x6b4e('0x1f')]['message']);return _0x531eec(_0x4b62ad[_0x6b4e('0x1f')][_0x6b4e('0x21')]);}else{logger[_0x6b4e('0x1a')](_0x6b4e('0x1b'),_0x9f8f6c,'request\x20sent');_0x531eec(_0x4b62ad[_0x6b4e('0x22')]['message']);}})[_0x6b4e('0x23')](function(_0x163dea){logger[_0x6b4e('0x1f')](_0x6b4e('0x1b'),_0x9f8f6c,_0x163dea);_0x36f8a5(_0x163dea);});});}function respondWithStatusCode(_0xa06ccd,_0x346566){_0x346566=_0x346566||0xcc;return function(_0x3e636f){if(_0x3e636f){return _0xa06ccd['sendStatus'](_0x346566);}return _0xa06ccd[_0x6b4e('0x24')](_0x346566)['end']();};}function respondWithResult(_0x29cb4a,_0x884b7e){_0x884b7e=_0x884b7e||0xc8;return function(_0x38a79d){if(_0x38a79d){return _0x29cb4a[_0x6b4e('0x24')](_0x884b7e)['json'](_0x38a79d);}};}function respondWithFilteredResult(_0xec7d35,_0x3f72d7){return function(_0x4e217c){if(_0x4e217c){var _0x32102f=_0x4e217c['count'],_0x381ff0=_0x3f72d7[_0x6b4e('0x25')],_0x3513b2=_0x3f72d7[_0x6b4e('0x25')]+_0x3f72d7['limit'],_0x44b399;if(_0x3513b2>=_0x32102f){_0x3513b2=_0x32102f;_0x44b399=0xc8;}else{_0x44b399=0xce;}_0xec7d35[_0x6b4e('0x24')](_0x44b399);return _0xec7d35[_0x6b4e('0x26')](_0x6b4e('0x27'),_0x381ff0+'-'+_0x3513b2+'/'+_0x32102f)[_0x6b4e('0x28')](_0x4e217c);}return null;};}function patchUpdates(_0x4a6c90){return function(_0x445278){try{jsonpatch[_0x6b4e('0x29')](_0x445278,_0x4a6c90,!![]);}catch(_0x47ab11){return BPromise[_0x6b4e('0x2a')](_0x47ab11);}return _0x445278[_0x6b4e('0x2b')]();};}function saveUpdates(_0x37b636,_0x53c242){return function(_0x5c2200){if(_0x5c2200){return _0x5c2200[_0x6b4e('0x2c')](_0x37b636)[_0x6b4e('0x19')](function(_0x3ec877){return _0x3ec877;});}return null;};}function removeEntity(_0x5261bf,_0x2a1a29){return function(_0x421177){if(_0x421177){return _0x421177[_0x6b4e('0x2d')]()['then'](function(){_0x5261bf['status'](0xcc)[_0x6b4e('0x2e')]();});}};}function handleEntityNotFound(_0x4952ef,_0x1a2b27){return function(_0x332e74){if(!_0x332e74){_0x4952ef['sendStatus'](0x194);}return _0x332e74;};}function handleError(_0x885c35,_0x3b3094){_0x3b3094=_0x3b3094||0x1f4;return function(_0xa7d077){logger[_0x6b4e('0x1f')](_0xa7d077['stack']);if(_0xa7d077['name']){delete _0xa7d077[_0x6b4e('0x2f')];}_0x885c35[_0x6b4e('0x24')](_0x3b3094)[_0x6b4e('0x30')](_0xa7d077);};}exports[_0x6b4e('0x31')]=function(_0x1dbac7,_0x229484){var _0x2a5198={},_0x1fdc14={},_0x144954={'count':0x0,'rows':[]};var _0x3785d5=db[_0x6b4e('0x32')][_0x6b4e('0x33')];_0x1fdc14[_0x6b4e('0x34')]=_['keys'](_0x3785d5);_0x1fdc14[_0x6b4e('0x35')]=_[_0x6b4e('0x36')](_0x1dbac7[_0x6b4e('0x35')]);_0x1fdc14['filters']=_[_0x6b4e('0x37')](_0x1fdc14['model'],_0x1fdc14[_0x6b4e('0x35')]);_0x2a5198[_0x6b4e('0x38')]=_[_0x6b4e('0x37')](_0x1fdc14['model'],qs['fields'](_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x39')]));_0x2a5198['attributes']=_0x2a5198['attributes'][_0x6b4e('0x3a')]?_0x2a5198[_0x6b4e('0x38')]:_0x1fdc14[_0x6b4e('0x34')];if(!_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x3b')](_0x6b4e('0x3c'))){_0x2a5198[_0x6b4e('0x3d')]=qs[_0x6b4e('0x3d')](_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x3d')]);_0x2a5198[_0x6b4e('0x25')]=qs['offset'](_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x25')]);}_0x2a5198['order']=qs[_0x6b4e('0x3e')](_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x3e')]);_0x2a5198[_0x6b4e('0x3f')]=qs[_0x6b4e('0x40')](_['pick'](_0x1dbac7['query'],_0x1fdc14[_0x6b4e('0x40')]));if(_0x1dbac7['query'][_0x6b4e('0x41')]){_0x2a5198[_0x6b4e('0x3f')]=_['merge'](_0x2a5198[_0x6b4e('0x3f')],{'$or':_['map'](_0x3785d5,function(_0x3dec0f){if(_0x3dec0f['type'][_0x6b4e('0x42')]!==_0x6b4e('0x43')){var _0x8ea118={};_0x8ea118[_0x3dec0f[_0x6b4e('0x44')]]={'$like':'%'+_0x1dbac7['query'][_0x6b4e('0x41')]+'%'};return _0x8ea118;}})});}_0x2a5198=_[_0x6b4e('0x45')]({},_0x2a5198,_0x1dbac7[_0x6b4e('0x46')]);var _0x595140={'where':_0x2a5198[_0x6b4e('0x3f')]};return db[_0x6b4e('0x32')][_0x6b4e('0x47')](_0x595140)[_0x6b4e('0x19')](function(_0x3edebd){_0x144954[_0x6b4e('0x47')]=_0x3edebd;if(_0x1dbac7[_0x6b4e('0x35')][_0x6b4e('0x48')]){_0x2a5198[_0x6b4e('0x49')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x6b4e('0x4a')](_0x2a5198);})[_0x6b4e('0x19')](function(_0x148b66){_0x144954[_0x6b4e('0x4b')]=_0x148b66;return _0x144954;})[_0x6b4e('0x19')](respondWithFilteredResult(_0x229484,_0x2a5198))['catch'](handleError(_0x229484,null));};exports[_0x6b4e('0x4c')]=function(_0x4c3bb7,_0x401c0b){var _0x3bcfcc={'raw':![],'where':{'id':_0x4c3bb7[_0x6b4e('0x4d')]['id']}},_0x2f2973={};_0x2f2973['model']=_[_0x6b4e('0x36')](db[_0x6b4e('0x32')][_0x6b4e('0x33')]);_0x2f2973['query']=_[_0x6b4e('0x36')](_0x4c3bb7[_0x6b4e('0x35')]);_0x2f2973[_0x6b4e('0x40')]=_[_0x6b4e('0x37')](_0x2f2973[_0x6b4e('0x34')],_0x2f2973[_0x6b4e('0x35')]);_0x3bcfcc[_0x6b4e('0x38')]=_[_0x6b4e('0x37')](_0x2f2973[_0x6b4e('0x34')],qs[_0x6b4e('0x39')](_0x4c3bb7['query'][_0x6b4e('0x39')]));_0x3bcfcc[_0x6b4e('0x38')]=_0x3bcfcc[_0x6b4e('0x38')]['length']?_0x3bcfcc[_0x6b4e('0x38')]:_0x2f2973[_0x6b4e('0x34')];if(_0x4c3bb7[_0x6b4e('0x35')][_0x6b4e('0x48')]){_0x3bcfcc[_0x6b4e('0x49')]=[{'all':!![]}];}_0x3bcfcc=_[_0x6b4e('0x45')]({},_0x3bcfcc,_0x4c3bb7[_0x6b4e('0x46')]);return db[_0x6b4e('0x32')][_0x6b4e('0x4e')](_0x3bcfcc)[_0x6b4e('0x19')](handleEntityNotFound(_0x401c0b,null))[_0x6b4e('0x19')](respondWithResult(_0x401c0b,null))['catch'](handleError(_0x401c0b,null));};exports['create']=function(_0x2e67cd,_0x2d5eda){return db[_0x6b4e('0x32')][_0x6b4e('0x4f')](_0x2e67cd['body'],{})[_0x6b4e('0x19')](respondWithResult(_0x2d5eda,0xc9))[_0x6b4e('0x23')](handleError(_0x2d5eda,null));};exports[_0x6b4e('0x2c')]=function(_0x59db52,_0x477831){if(_0x59db52[_0x6b4e('0x50')]['id']){delete _0x59db52[_0x6b4e('0x50')]['id'];}return db[_0x6b4e('0x32')][_0x6b4e('0x4e')]({'where':{'id':_0x59db52['params']['id']}})[_0x6b4e('0x19')](handleEntityNotFound(_0x477831,null))['then'](saveUpdates(_0x59db52[_0x6b4e('0x50')],null))[_0x6b4e('0x19')](respondWithResult(_0x477831,null))['catch'](handleError(_0x477831,null));};exports[_0x6b4e('0x2d')]=function(_0x553521,_0xc47275){return db[_0x6b4e('0x32')][_0x6b4e('0x4e')]({'where':{'id':_0x553521[_0x6b4e('0x4d')]['id']}})[_0x6b4e('0x19')](handleEntityNotFound(_0xc47275,null))['then'](removeEntity(_0xc47275,null))[_0x6b4e('0x23')](handleError(_0xc47275,null));};exports[_0x6b4e('0x51')]=function(_0x9f8aab,_0x5906bf,_0x5b45f1){var _0x2f5e4e={};var _0x15ec6f={};var _0x5d46b9;var _0x88b7cc;return db[_0x6b4e('0x32')][_0x6b4e('0x52')]({'where':{'id':_0x9f8aab[_0x6b4e('0x4d')]['id']}})[_0x6b4e('0x19')](handleEntityNotFound(_0x5906bf,null))['then'](function(_0x52faab){if(_0x52faab){_0x5d46b9=_0x52faab;_0x15ec6f[_0x6b4e('0x34')]=_[_0x6b4e('0x36')](db[_0x6b4e('0x53')][_0x6b4e('0x33')]);_0x15ec6f[_0x6b4e('0x35')]=_[_0x6b4e('0x36')](_0x9f8aab[_0x6b4e('0x35')]);_0x15ec6f[_0x6b4e('0x40')]=_[_0x6b4e('0x37')](_0x15ec6f['model'],_0x15ec6f[_0x6b4e('0x35')]);_0x2f5e4e[_0x6b4e('0x38')]=_[_0x6b4e('0x37')](_0x15ec6f['model'],qs['fields'](_0x9f8aab[_0x6b4e('0x35')][_0x6b4e('0x39')]));_0x2f5e4e[_0x6b4e('0x38')]=_0x2f5e4e[_0x6b4e('0x38')][_0x6b4e('0x3a')]?_0x2f5e4e['attributes']:_0x15ec6f[_0x6b4e('0x34')];_0x2f5e4e[_0x6b4e('0x54')]=qs[_0x6b4e('0x3e')](_0x9f8aab['query'][_0x6b4e('0x3e')]);_0x2f5e4e[_0x6b4e('0x3f')]=qs[_0x6b4e('0x40')](_['pick'](_0x9f8aab[_0x6b4e('0x35')],_0x15ec6f[_0x6b4e('0x40')]));if(_0x9f8aab['query'][_0x6b4e('0x41')]){_0x2f5e4e[_0x6b4e('0x3f')]=_[_0x6b4e('0x45')](_0x2f5e4e[_0x6b4e('0x3f')],{'$or':_[_0x6b4e('0x55')](_0x2f5e4e[_0x6b4e('0x38')],function(_0x2ada5d){var _0x5d8433={};_0x5d8433[_0x2ada5d]={'$like':'%'+_0x9f8aab[_0x6b4e('0x35')][_0x6b4e('0x41')]+'%'};return _0x5d8433;})});}_0x2f5e4e=_[_0x6b4e('0x45')]({},_0x2f5e4e,_0x9f8aab[_0x6b4e('0x46')]);return _0x5d46b9[_0x6b4e('0x51')](_0x2f5e4e);}})['then'](function(_0x15a835){if(_0x15a835){_0x88b7cc=_0x15a835[_0x6b4e('0x3a')];if(!_0x9f8aab[_0x6b4e('0x35')][_0x6b4e('0x3b')](_0x6b4e('0x3c'))){_0x2f5e4e['limit']=qs[_0x6b4e('0x3d')](_0x9f8aab['query'][_0x6b4e('0x3d')]);_0x2f5e4e[_0x6b4e('0x25')]=qs[_0x6b4e('0x25')](_0x9f8aab[_0x6b4e('0x35')]['offset']);}return _0x5d46b9[_0x6b4e('0x51')](_0x2f5e4e);}})[_0x6b4e('0x19')](function(_0x329d25){if(_0x329d25){return _0x329d25?{'count':_0x88b7cc,'rows':_0x329d25}:null;}})[_0x6b4e('0x19')](respondWithResult(_0x5906bf,null))[_0x6b4e('0x23')](handleError(_0x5906bf,null));};exports[_0x6b4e('0x56')]=function(_0x41e901,_0x5b26df,_0x5dd283){var _0x4cdc08={};var _0x381e06={};var _0xde1d1f;var _0x247319;return db[_0x6b4e('0x32')][_0x6b4e('0x52')]({'where':{'id':_0x41e901[_0x6b4e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5b26df,null))['then'](function(_0x13d517){if(_0x13d517){_0xde1d1f=_0x13d517;_0x381e06[_0x6b4e('0x34')]=_[_0x6b4e('0x36')](db[_0x6b4e('0x53')]['rawAttributes']);_0x381e06[_0x6b4e('0x35')]=_['keys'](_0x41e901[_0x6b4e('0x35')]);_0x381e06[_0x6b4e('0x40')]=_[_0x6b4e('0x37')](_0x381e06[_0x6b4e('0x34')],_0x381e06['query']);_0x4cdc08[_0x6b4e('0x38')]=_['intersection'](_0x381e06[_0x6b4e('0x34')],qs['fields'](_0x41e901[_0x6b4e('0x35')][_0x6b4e('0x39')]));_0x4cdc08['attributes']=_0x4cdc08[_0x6b4e('0x38')]['length']?_0x4cdc08[_0x6b4e('0x38')]:_0x381e06[_0x6b4e('0x34')];_0x4cdc08[_0x6b4e('0x54')]=qs[_0x6b4e('0x3e')](_0x41e901['query']['sort']);_0x4cdc08['where']=qs[_0x6b4e('0x40')](_[_0x6b4e('0x57')](_0x41e901['query'],_0x381e06[_0x6b4e('0x40')]));if(_0x41e901[_0x6b4e('0x35')][_0x6b4e('0x41')]){_0x4cdc08[_0x6b4e('0x3f')]=_[_0x6b4e('0x45')](_0x4cdc08[_0x6b4e('0x3f')],{'$or':_[_0x6b4e('0x55')](_0x4cdc08[_0x6b4e('0x38')],function(_0x202efb){var _0x45cb6b={};_0x45cb6b[_0x202efb]={'$like':'%'+_0x41e901[_0x6b4e('0x35')]['filter']+'%'};return _0x45cb6b;})});}_0x4cdc08=_[_0x6b4e('0x45')]({},_0x4cdc08,_0x41e901[_0x6b4e('0x46')]);return _0xde1d1f[_0x6b4e('0x56')](_0x4cdc08);}})[_0x6b4e('0x19')](function(_0x24c2ca){if(_0x24c2ca){_0x247319=_0x24c2ca[_0x6b4e('0x3a')];if(!_0x41e901[_0x6b4e('0x35')][_0x6b4e('0x3b')](_0x6b4e('0x3c'))){_0x4cdc08['limit']=qs['limit'](_0x41e901['query']['limit']);_0x4cdc08[_0x6b4e('0x25')]=qs[_0x6b4e('0x25')](_0x41e901[_0x6b4e('0x35')][_0x6b4e('0x25')]);}return _0xde1d1f['getSubjects'](_0x4cdc08);}})[_0x6b4e('0x19')](function(_0x349964){if(_0x349964){return _0x349964?{'count':_0x247319,'rows':_0x349964}:null;}})['then'](respondWithResult(_0x5b26df,null))[_0x6b4e('0x23')](handleError(_0x5b26df,null));};exports[_0x6b4e('0x58')]=function(_0x3a1f75,_0x9ab10d,_0x5c60a4){var _0x3f5dda={};var _0x3bab0b={};var _0x4b0a4e;var _0x50bbeb;return db[_0x6b4e('0x32')]['findOne']({'where':{'id':_0x3a1f75[_0x6b4e('0x4d')]['id']}})[_0x6b4e('0x19')](handleEntityNotFound(_0x9ab10d,null))['then'](function(_0x438c2c){if(_0x438c2c){_0x4b0a4e=_0x438c2c;_0x3bab0b[_0x6b4e('0x34')]=_[_0x6b4e('0x36')](db[_0x6b4e('0x53')][_0x6b4e('0x33')]);_0x3bab0b['query']=_['keys'](_0x3a1f75[_0x6b4e('0x35')]);_0x3bab0b[_0x6b4e('0x40')]=_[_0x6b4e('0x37')](_0x3bab0b[_0x6b4e('0x34')],_0x3bab0b[_0x6b4e('0x35')]);_0x3f5dda[_0x6b4e('0x38')]=_[_0x6b4e('0x37')](_0x3bab0b[_0x6b4e('0x34')],qs[_0x6b4e('0x39')](_0x3a1f75['query'][_0x6b4e('0x39')]));_0x3f5dda[_0x6b4e('0x38')]=_0x3f5dda[_0x6b4e('0x38')][_0x6b4e('0x3a')]?_0x3f5dda[_0x6b4e('0x38')]:_0x3bab0b[_0x6b4e('0x34')];_0x3f5dda[_0x6b4e('0x54')]=qs[_0x6b4e('0x3e')](_0x3a1f75[_0x6b4e('0x35')][_0x6b4e('0x3e')]);_0x3f5dda[_0x6b4e('0x3f')]=qs[_0x6b4e('0x40')](_['pick'](_0x3a1f75['query'],_0x3bab0b[_0x6b4e('0x40')]));if(_0x3a1f75[_0x6b4e('0x35')][_0x6b4e('0x41')]){_0x3f5dda[_0x6b4e('0x3f')]=_[_0x6b4e('0x45')](_0x3f5dda['where'],{'$or':_[_0x6b4e('0x55')](_0x3f5dda[_0x6b4e('0x38')],function(_0x310b9c){var _0x53508a={};_0x53508a[_0x310b9c]={'$like':'%'+_0x3a1f75[_0x6b4e('0x35')][_0x6b4e('0x41')]+'%'};return _0x53508a;})});}_0x3f5dda=_[_0x6b4e('0x45')]({},_0x3f5dda,_0x3a1f75[_0x6b4e('0x46')]);return _0x4b0a4e[_0x6b4e('0x58')](_0x3f5dda);}})[_0x6b4e('0x19')](function(_0x1f3e29){if(_0x1f3e29){_0x50bbeb=_0x1f3e29['length'];if(!_0x3a1f75[_0x6b4e('0x35')][_0x6b4e('0x3b')](_0x6b4e('0x3c'))){_0x3f5dda['limit']=qs['limit'](_0x3a1f75['query'][_0x6b4e('0x3d')]);_0x3f5dda['offset']=qs[_0x6b4e('0x25')](_0x3a1f75[_0x6b4e('0x35')][_0x6b4e('0x25')]);}return _0x4b0a4e[_0x6b4e('0x58')](_0x3f5dda);}})[_0x6b4e('0x19')](function(_0x23b8f8){if(_0x23b8f8){return _0x23b8f8?{'count':_0x50bbeb,'rows':_0x23b8f8}:null;}})[_0x6b4e('0x19')](respondWithResult(_0x9ab10d,null))['catch'](handleError(_0x9ab10d,null));};exports[_0x6b4e('0x59')]=function(_0x53ff70,_0x5eacc4,_0x46fb3a){var _0xb25669={};var _0x170f9c={};var _0x5a29f8;var _0x230671;return db['DeskConfiguration'][_0x6b4e('0x52')]({'where':{'id':_0x53ff70[_0x6b4e('0x4d')]['id']}})[_0x6b4e('0x19')](handleEntityNotFound(_0x5eacc4,null))[_0x6b4e('0x19')](function(_0x3c812a){if(_0x3c812a){_0x5a29f8=_0x3c812a;_0x170f9c[_0x6b4e('0x34')]=_[_0x6b4e('0x36')](db[_0x6b4e('0x5a')]['rawAttributes']);_0x170f9c[_0x6b4e('0x35')]=_['keys'](_0x53ff70[_0x6b4e('0x35')]);_0x170f9c['filters']=_[_0x6b4e('0x37')](_0x170f9c['model'],_0x170f9c[_0x6b4e('0x35')]);_0xb25669[_0x6b4e('0x38')]=_[_0x6b4e('0x37')](_0x170f9c[_0x6b4e('0x34')],qs[_0x6b4e('0x39')](_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x39')]));_0xb25669[_0x6b4e('0x38')]=_0xb25669[_0x6b4e('0x38')][_0x6b4e('0x3a')]?_0xb25669[_0x6b4e('0x38')]:_0x170f9c[_0x6b4e('0x34')];_0xb25669[_0x6b4e('0x54')]=qs[_0x6b4e('0x3e')](_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x3e')]);_0xb25669['where']=qs[_0x6b4e('0x40')](_['pick'](_0x53ff70[_0x6b4e('0x35')],_0x170f9c['filters']));if(_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x41')]){_0xb25669[_0x6b4e('0x3f')]=_[_0x6b4e('0x45')](_0xb25669['where'],{'$or':_[_0x6b4e('0x55')](_0xb25669[_0x6b4e('0x38')],function(_0xb89276){var _0x3a17f5={};_0x3a17f5[_0xb89276]={'$like':'%'+_0x53ff70['query'][_0x6b4e('0x41')]+'%'};return _0x3a17f5;})});}_0xb25669=_['merge']({},_0xb25669,_0x53ff70[_0x6b4e('0x46')]);return _0x5a29f8[_0x6b4e('0x59')](_0xb25669);}})[_0x6b4e('0x19')](function(_0xc9e294){if(_0xc9e294){_0x230671=_0xc9e294[_0x6b4e('0x3a')];if(!_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x3b')](_0x6b4e('0x3c'))){_0xb25669[_0x6b4e('0x3d')]=qs[_0x6b4e('0x3d')](_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x3d')]);_0xb25669[_0x6b4e('0x25')]=qs[_0x6b4e('0x25')](_0x53ff70[_0x6b4e('0x35')][_0x6b4e('0x25')]);}return _0x5a29f8['getTags'](_0xb25669);}})[_0x6b4e('0x19')](function(_0x36b62b){if(_0x36b62b){return _0x36b62b?{'count':_0x230671,'rows':_0x36b62b}:null;}})[_0x6b4e('0x19')](respondWithResult(_0x5eacc4,null))[_0x6b4e('0x23')](handleError(_0x5eacc4,null));};exports['setTags']=function(_0x1855eb,_0x7cc5a6,_0x241a96){if(_0x1855eb['body']['id']){delete _0x1855eb[_0x6b4e('0x50')]['id'];}return db[_0x6b4e('0x32')][_0x6b4e('0x52')]({'where':{'id':_0x1855eb[_0x6b4e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7cc5a6,null))['then'](function(_0x21f0fe){if(_0x21f0fe){return _0x21f0fe[_0x6b4e('0x5b')](_0x1855eb['body'][_0x6b4e('0x5c')]||[]);}return null;})[_0x6b4e('0x19')](respondWithResult(_0x7cc5a6,null))[_0x6b4e('0x23')](handleError(_0x7cc5a6,null));}; \ No newline at end of file +var _0xa571=['lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','count','includeAll','include','rows','show','params','fields','options','find','create','body','findOne','DeskField','filter','map','getFields','getSubjects','getDescriptions','Tag','getTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs'];(function(_0x38e9de,_0x168374){var _0x45dde9=function(_0x434de8){while(--_0x434de8){_0x38e9de['push'](_0x38e9de['shift']());}};_0x45dde9(++_0x168374);}(_0xa571,0x107));var _0x1a57=function(_0x16b156,_0x50304a){_0x16b156=_0x16b156-0x0;var _0x4e65ef=_0xa571[_0x16b156];return _0x4e65ef;};'use strict';var pdf=require(_0x1a57('0x0'));var emlformat=require(_0x1a57('0x1'));var rimraf=require(_0x1a57('0x2'));var zipdir=require(_0x1a57('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a57('0x4'));var moment=require(_0x1a57('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a57('0x6'));var path=require('path');var sox=require(_0x1a57('0x7'));var csv=require(_0x1a57('0x8'));var ejs=require(_0x1a57('0x9'));var fs=require('fs');var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x8'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var authService=require(_0x1a57('0xf'));var hardwareService=require(_0x1a57('0x10'));var Redis=require(_0x1a57('0x11'));var qs=require(_0x1a57('0x12'));var logger=require(_0x1a57('0x13'))(_0x1a57('0x14'));var utils=require(_0x1a57('0x15'));var config=require(_0x1a57('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x1a57('0x17')][_0x1a57('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x202d9a,_0x5ae643,_0x3de36a,_0x18eec5){return new BPromise(function(_0x4c5ed4,_0x503278){var _0x587422=_0x18eec5||client;return _0x587422[_0x1a57('0x19')](_0x202d9a,_0x3de36a)[_0x1a57('0x1a')](function(_0x27e824){logger[_0x1a57('0x1b')]('DeskConfiguration,\x20%s,\x20%s',_0x5ae643,_0x1a57('0x1c'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5ae643,_0x1a57('0x1c'),JSON[_0x1a57('0x1d')](_0x27e824));if(_0x27e824[_0x1a57('0x1e')]){if(_0x27e824['error'][_0x1a57('0x1f')]===0x1f4){logger[_0x1a57('0x1e')](_0x1a57('0x20'),_0x5ae643,_0x27e824['error'][_0x1a57('0x21')]);return _0x503278(_0x27e824[_0x1a57('0x1e')][_0x1a57('0x21')]);}logger[_0x1a57('0x1e')](_0x1a57('0x20'),_0x5ae643,_0x27e824['error']['message']);return _0x4c5ed4(_0x27e824[_0x1a57('0x1e')][_0x1a57('0x21')]);}else{logger[_0x1a57('0x1b')]('DeskConfiguration,\x20%s,\x20%s',_0x5ae643,'request\x20sent');_0x4c5ed4(_0x27e824['result'][_0x1a57('0x21')]);}})[_0x1a57('0x22')](function(_0x3f52b9){logger[_0x1a57('0x1e')](_0x1a57('0x20'),_0x5ae643,_0x3f52b9);_0x503278(_0x3f52b9);});});}function respondWithStatusCode(_0x39d3ce,_0x2efa49){_0x2efa49=_0x2efa49||0xcc;return function(_0x2f8b00){if(_0x2f8b00){return _0x39d3ce[_0x1a57('0x23')](_0x2efa49);}return _0x39d3ce[_0x1a57('0x24')](_0x2efa49)[_0x1a57('0x25')]();};}function respondWithResult(_0x36b17e,_0x26cdd3){_0x26cdd3=_0x26cdd3||0xc8;return function(_0x1b4cb5){if(_0x1b4cb5){return _0x36b17e[_0x1a57('0x24')](_0x26cdd3)[_0x1a57('0x26')](_0x1b4cb5);}};}function respondWithFilteredResult(_0x25c1e9,_0x267302){return function(_0x27cfe1){if(_0x27cfe1){var _0xf6ffef=_0x27cfe1['count'],_0x26584b=_0x267302[_0x1a57('0x27')],_0x1dd939=_0x267302[_0x1a57('0x27')]+_0x267302['limit'],_0x5a53c8;if(_0x1dd939>=_0xf6ffef){_0x1dd939=_0xf6ffef;_0x5a53c8=0xc8;}else{_0x5a53c8=0xce;}_0x25c1e9[_0x1a57('0x24')](_0x5a53c8);return _0x25c1e9['set'](_0x1a57('0x28'),_0x26584b+'-'+_0x1dd939+'/'+_0xf6ffef)[_0x1a57('0x26')](_0x27cfe1);}return null;};}function patchUpdates(_0x53bf6e){return function(_0x8179a4){try{jsonpatch[_0x1a57('0x29')](_0x8179a4,_0x53bf6e,!![]);}catch(_0x30527c){return BPromise[_0x1a57('0x2a')](_0x30527c);}return _0x8179a4['save']();};}function saveUpdates(_0x366d5f,_0x396832){return function(_0x4374f0){if(_0x4374f0){return _0x4374f0[_0x1a57('0x2b')](_0x366d5f)['then'](function(_0xa42d2b){return _0xa42d2b;});}return null;};}function removeEntity(_0x251a54,_0x139fc9){return function(_0x32f79f){if(_0x32f79f){return _0x32f79f[_0x1a57('0x2c')]()[_0x1a57('0x1a')](function(){_0x251a54[_0x1a57('0x24')](0xcc)[_0x1a57('0x25')]();});}};}function handleEntityNotFound(_0x154cba,_0x4c1acc){return function(_0x28e829){if(!_0x28e829){_0x154cba[_0x1a57('0x23')](0x194);}return _0x28e829;};}function handleError(_0x497488,_0x4f9368){_0x4f9368=_0x4f9368||0x1f4;return function(_0x17b12e){logger[_0x1a57('0x1e')](_0x17b12e[_0x1a57('0x2d')]);if(_0x17b12e[_0x1a57('0x2e')]){delete _0x17b12e[_0x1a57('0x2e')];}_0x497488[_0x1a57('0x24')](_0x4f9368)[_0x1a57('0x2f')](_0x17b12e);};}exports[_0x1a57('0x30')]=function(_0x3f14ca,_0x2a6feb){var _0x4091b6={},_0x24025c={},_0x12f3a7={'count':0x0,'rows':[]};var _0x1a6231=db[_0x1a57('0x31')][_0x1a57('0x32')];_0x24025c[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x1a6231);_0x24025c['query']=_[_0x1a57('0x34')](_0x3f14ca[_0x1a57('0x35')]);_0x24025c[_0x1a57('0x36')]=_[_0x1a57('0x37')](_0x24025c[_0x1a57('0x33')],_0x24025c[_0x1a57('0x35')]);_0x4091b6[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x24025c[_0x1a57('0x33')],qs['fields'](_0x3f14ca['query']['fields']));_0x4091b6['attributes']=_0x4091b6[_0x1a57('0x38')][_0x1a57('0x39')]?_0x4091b6[_0x1a57('0x38')]:_0x24025c['model'];if(!_0x3f14ca[_0x1a57('0x35')][_0x1a57('0x3a')](_0x1a57('0x3b'))){_0x4091b6[_0x1a57('0x3c')]=qs['limit'](_0x3f14ca[_0x1a57('0x35')]['limit']);_0x4091b6[_0x1a57('0x27')]=qs[_0x1a57('0x27')](_0x3f14ca[_0x1a57('0x35')]['offset']);}_0x4091b6[_0x1a57('0x3d')]=qs[_0x1a57('0x3e')](_0x3f14ca[_0x1a57('0x35')][_0x1a57('0x3e')]);_0x4091b6[_0x1a57('0x3f')]=qs['filters'](_[_0x1a57('0x40')](_0x3f14ca['query'],_0x24025c['filters']));if(_0x3f14ca[_0x1a57('0x35')]['filter']){_0x4091b6[_0x1a57('0x3f')]=_[_0x1a57('0x41')](_0x4091b6[_0x1a57('0x3f')],{'$or':_['map'](_0x1a6231,function(_0x188a50){if(_0x188a50[_0x1a57('0x42')][_0x1a57('0x43')]!==_0x1a57('0x44')){var _0x504c29={};_0x504c29[_0x188a50[_0x1a57('0x45')]]={'$like':'%'+_0x3f14ca[_0x1a57('0x35')]['filter']+'%'};return _0x504c29;}})});}_0x4091b6=_[_0x1a57('0x41')]({},_0x4091b6,_0x3f14ca['options']);var _0x4d723f={'where':_0x4091b6[_0x1a57('0x3f')]};return db[_0x1a57('0x31')][_0x1a57('0x46')](_0x4d723f)[_0x1a57('0x1a')](function(_0x5c0f5d){_0x12f3a7[_0x1a57('0x46')]=_0x5c0f5d;if(_0x3f14ca[_0x1a57('0x35')][_0x1a57('0x47')]){_0x4091b6[_0x1a57('0x48')]=[{'all':!![]}];}return db[_0x1a57('0x31')]['findAll'](_0x4091b6);})[_0x1a57('0x1a')](function(_0x1175ca){_0x12f3a7[_0x1a57('0x49')]=_0x1175ca;return _0x12f3a7;})[_0x1a57('0x1a')](respondWithFilteredResult(_0x2a6feb,_0x4091b6))['catch'](handleError(_0x2a6feb,null));};exports[_0x1a57('0x4a')]=function(_0x5f1d5f,_0x4bbfc3){var _0x36f8dc={'raw':![],'where':{'id':_0x5f1d5f[_0x1a57('0x4b')]['id']}},_0x167b40={};_0x167b40[_0x1a57('0x33')]=_[_0x1a57('0x34')](db[_0x1a57('0x31')][_0x1a57('0x32')]);_0x167b40[_0x1a57('0x35')]=_[_0x1a57('0x34')](_0x5f1d5f[_0x1a57('0x35')]);_0x167b40[_0x1a57('0x36')]=_[_0x1a57('0x37')](_0x167b40['model'],_0x167b40[_0x1a57('0x35')]);_0x36f8dc[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x167b40[_0x1a57('0x33')],qs[_0x1a57('0x4c')](_0x5f1d5f[_0x1a57('0x35')][_0x1a57('0x4c')]));_0x36f8dc[_0x1a57('0x38')]=_0x36f8dc[_0x1a57('0x38')][_0x1a57('0x39')]?_0x36f8dc[_0x1a57('0x38')]:_0x167b40['model'];if(_0x5f1d5f[_0x1a57('0x35')][_0x1a57('0x47')]){_0x36f8dc['include']=[{'all':!![]}];}_0x36f8dc=_[_0x1a57('0x41')]({},_0x36f8dc,_0x5f1d5f[_0x1a57('0x4d')]);return db['DeskConfiguration'][_0x1a57('0x4e')](_0x36f8dc)[_0x1a57('0x1a')](handleEntityNotFound(_0x4bbfc3,null))['then'](respondWithResult(_0x4bbfc3,null))['catch'](handleError(_0x4bbfc3,null));};exports['create']=function(_0x2c1bac,_0x41465b){return db['DeskConfiguration'][_0x1a57('0x4f')](_0x2c1bac[_0x1a57('0x50')],{})['then'](respondWithResult(_0x41465b,0xc9))['catch'](handleError(_0x41465b,null));};exports['update']=function(_0x3cb9ce,_0x23d1c3){if(_0x3cb9ce[_0x1a57('0x50')]['id']){delete _0x3cb9ce[_0x1a57('0x50')]['id'];}return db[_0x1a57('0x31')][_0x1a57('0x4e')]({'where':{'id':_0x3cb9ce[_0x1a57('0x4b')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x23d1c3,null))['then'](saveUpdates(_0x3cb9ce['body'],null))['then'](respondWithResult(_0x23d1c3,null))['catch'](handleError(_0x23d1c3,null));};exports['destroy']=function(_0xd0261c,_0x13c04d){return db[_0x1a57('0x31')][_0x1a57('0x4e')]({'where':{'id':_0xd0261c[_0x1a57('0x4b')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x13c04d,null))[_0x1a57('0x1a')](removeEntity(_0x13c04d,null))[_0x1a57('0x22')](handleError(_0x13c04d,null));};exports['getFields']=function(_0x48cc13,_0x515b81,_0x13ebc4){var _0x4aa889={};var _0x301db9={};var _0x10c058;var _0x408e67;return db[_0x1a57('0x31')][_0x1a57('0x51')]({'where':{'id':_0x48cc13[_0x1a57('0x4b')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x515b81,null))['then'](function(_0x4e56b5){if(_0x4e56b5){_0x10c058=_0x4e56b5;_0x301db9['model']=_[_0x1a57('0x34')](db[_0x1a57('0x52')][_0x1a57('0x32')]);_0x301db9[_0x1a57('0x35')]=_[_0x1a57('0x34')](_0x48cc13[_0x1a57('0x35')]);_0x301db9[_0x1a57('0x36')]=_['intersection'](_0x301db9['model'],_0x301db9[_0x1a57('0x35')]);_0x4aa889[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x301db9[_0x1a57('0x33')],qs[_0x1a57('0x4c')](_0x48cc13[_0x1a57('0x35')]['fields']));_0x4aa889['attributes']=_0x4aa889[_0x1a57('0x38')][_0x1a57('0x39')]?_0x4aa889['attributes']:_0x301db9['model'];_0x4aa889[_0x1a57('0x3d')]=qs[_0x1a57('0x3e')](_0x48cc13[_0x1a57('0x35')][_0x1a57('0x3e')]);_0x4aa889[_0x1a57('0x3f')]=qs[_0x1a57('0x36')](_[_0x1a57('0x40')](_0x48cc13['query'],_0x301db9['filters']));if(_0x48cc13[_0x1a57('0x35')][_0x1a57('0x53')]){_0x4aa889[_0x1a57('0x3f')]=_[_0x1a57('0x41')](_0x4aa889['where'],{'$or':_[_0x1a57('0x54')](_0x4aa889[_0x1a57('0x38')],function(_0x1c28ca){var _0x33c8d4={};_0x33c8d4[_0x1c28ca]={'$like':'%'+_0x48cc13[_0x1a57('0x35')]['filter']+'%'};return _0x33c8d4;})});}_0x4aa889=_['merge']({},_0x4aa889,_0x48cc13['options']);return _0x10c058[_0x1a57('0x55')](_0x4aa889);}})[_0x1a57('0x1a')](function(_0x1e2df1){if(_0x1e2df1){_0x408e67=_0x1e2df1[_0x1a57('0x39')];if(!_0x48cc13[_0x1a57('0x35')][_0x1a57('0x3a')](_0x1a57('0x3b'))){_0x4aa889[_0x1a57('0x3c')]=qs['limit'](_0x48cc13[_0x1a57('0x35')][_0x1a57('0x3c')]);_0x4aa889['offset']=qs['offset'](_0x48cc13[_0x1a57('0x35')]['offset']);}return _0x10c058[_0x1a57('0x55')](_0x4aa889);}})[_0x1a57('0x1a')](function(_0x28bf55){if(_0x28bf55){return _0x28bf55?{'count':_0x408e67,'rows':_0x28bf55}:null;}})[_0x1a57('0x1a')](respondWithResult(_0x515b81,null))[_0x1a57('0x22')](handleError(_0x515b81,null));};exports[_0x1a57('0x56')]=function(_0x213576,_0x270331,_0x5ae6ae){var _0x7783ec={};var _0xc33b56={};var _0x5e5b2f;var _0x24b56c;return db[_0x1a57('0x31')][_0x1a57('0x51')]({'where':{'id':_0x213576['params']['id']}})['then'](handleEntityNotFound(_0x270331,null))[_0x1a57('0x1a')](function(_0x2ae7c3){if(_0x2ae7c3){_0x5e5b2f=_0x2ae7c3;_0xc33b56[_0x1a57('0x33')]=_[_0x1a57('0x34')](db['DeskField'][_0x1a57('0x32')]);_0xc33b56[_0x1a57('0x35')]=_[_0x1a57('0x34')](_0x213576[_0x1a57('0x35')]);_0xc33b56[_0x1a57('0x36')]=_['intersection'](_0xc33b56[_0x1a57('0x33')],_0xc33b56[_0x1a57('0x35')]);_0x7783ec[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0xc33b56[_0x1a57('0x33')],qs[_0x1a57('0x4c')](_0x213576[_0x1a57('0x35')][_0x1a57('0x4c')]));_0x7783ec[_0x1a57('0x38')]=_0x7783ec[_0x1a57('0x38')][_0x1a57('0x39')]?_0x7783ec['attributes']:_0xc33b56[_0x1a57('0x33')];_0x7783ec[_0x1a57('0x3d')]=qs['sort'](_0x213576[_0x1a57('0x35')][_0x1a57('0x3e')]);_0x7783ec['where']=qs[_0x1a57('0x36')](_[_0x1a57('0x40')](_0x213576[_0x1a57('0x35')],_0xc33b56[_0x1a57('0x36')]));if(_0x213576[_0x1a57('0x35')][_0x1a57('0x53')]){_0x7783ec[_0x1a57('0x3f')]=_[_0x1a57('0x41')](_0x7783ec['where'],{'$or':_[_0x1a57('0x54')](_0x7783ec[_0x1a57('0x38')],function(_0x5447ca){var _0x22fcb1={};_0x22fcb1[_0x5447ca]={'$like':'%'+_0x213576[_0x1a57('0x35')][_0x1a57('0x53')]+'%'};return _0x22fcb1;})});}_0x7783ec=_[_0x1a57('0x41')]({},_0x7783ec,_0x213576[_0x1a57('0x4d')]);return _0x5e5b2f[_0x1a57('0x56')](_0x7783ec);}})[_0x1a57('0x1a')](function(_0xf61c1d){if(_0xf61c1d){_0x24b56c=_0xf61c1d[_0x1a57('0x39')];if(!_0x213576['query'][_0x1a57('0x3a')](_0x1a57('0x3b'))){_0x7783ec[_0x1a57('0x3c')]=qs[_0x1a57('0x3c')](_0x213576[_0x1a57('0x35')]['limit']);_0x7783ec[_0x1a57('0x27')]=qs[_0x1a57('0x27')](_0x213576[_0x1a57('0x35')][_0x1a57('0x27')]);}return _0x5e5b2f[_0x1a57('0x56')](_0x7783ec);}})[_0x1a57('0x1a')](function(_0x1b6169){if(_0x1b6169){return _0x1b6169?{'count':_0x24b56c,'rows':_0x1b6169}:null;}})[_0x1a57('0x1a')](respondWithResult(_0x270331,null))['catch'](handleError(_0x270331,null));};exports[_0x1a57('0x57')]=function(_0x854914,_0xe916b1,_0x41b685){var _0x5c2e7a={};var _0x4c91c4={};var _0x49f809;var _0x57cd92;return db['DeskConfiguration'][_0x1a57('0x51')]({'where':{'id':_0x854914[_0x1a57('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe916b1,null))[_0x1a57('0x1a')](function(_0x19f1d5){if(_0x19f1d5){_0x49f809=_0x19f1d5;_0x4c91c4['model']=_[_0x1a57('0x34')](db[_0x1a57('0x52')][_0x1a57('0x32')]);_0x4c91c4[_0x1a57('0x35')]=_['keys'](_0x854914[_0x1a57('0x35')]);_0x4c91c4[_0x1a57('0x36')]=_['intersection'](_0x4c91c4[_0x1a57('0x33')],_0x4c91c4[_0x1a57('0x35')]);_0x5c2e7a[_0x1a57('0x38')]=_[_0x1a57('0x37')](_0x4c91c4[_0x1a57('0x33')],qs[_0x1a57('0x4c')](_0x854914[_0x1a57('0x35')]['fields']));_0x5c2e7a[_0x1a57('0x38')]=_0x5c2e7a['attributes'][_0x1a57('0x39')]?_0x5c2e7a[_0x1a57('0x38')]:_0x4c91c4[_0x1a57('0x33')];_0x5c2e7a[_0x1a57('0x3d')]=qs['sort'](_0x854914[_0x1a57('0x35')][_0x1a57('0x3e')]);_0x5c2e7a[_0x1a57('0x3f')]=qs['filters'](_[_0x1a57('0x40')](_0x854914[_0x1a57('0x35')],_0x4c91c4[_0x1a57('0x36')]));if(_0x854914['query'][_0x1a57('0x53')]){_0x5c2e7a[_0x1a57('0x3f')]=_[_0x1a57('0x41')](_0x5c2e7a[_0x1a57('0x3f')],{'$or':_[_0x1a57('0x54')](_0x5c2e7a[_0x1a57('0x38')],function(_0x2bf12f){var _0x3b6a65={};_0x3b6a65[_0x2bf12f]={'$like':'%'+_0x854914[_0x1a57('0x35')][_0x1a57('0x53')]+'%'};return _0x3b6a65;})});}_0x5c2e7a=_[_0x1a57('0x41')]({},_0x5c2e7a,_0x854914['options']);return _0x49f809[_0x1a57('0x57')](_0x5c2e7a);}})['then'](function(_0x391732){if(_0x391732){_0x57cd92=_0x391732['length'];if(!_0x854914['query']['hasOwnProperty']('nolimit')){_0x5c2e7a[_0x1a57('0x3c')]=qs[_0x1a57('0x3c')](_0x854914[_0x1a57('0x35')]['limit']);_0x5c2e7a[_0x1a57('0x27')]=qs['offset'](_0x854914[_0x1a57('0x35')][_0x1a57('0x27')]);}return _0x49f809[_0x1a57('0x57')](_0x5c2e7a);}})[_0x1a57('0x1a')](function(_0x1000e5){if(_0x1000e5){return _0x1000e5?{'count':_0x57cd92,'rows':_0x1000e5}:null;}})[_0x1a57('0x1a')](respondWithResult(_0xe916b1,null))['catch'](handleError(_0xe916b1,null));};exports['getTags']=function(_0x45b954,_0x59c9ce,_0x149f8d){var _0x369dc1={};var _0x541447={};var _0x45afe5;var _0x1a98f0;return db['DeskConfiguration'][_0x1a57('0x51')]({'where':{'id':_0x45b954[_0x1a57('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59c9ce,null))['then'](function(_0x46a49f){if(_0x46a49f){_0x45afe5=_0x46a49f;_0x541447['model']=_[_0x1a57('0x34')](db[_0x1a57('0x58')][_0x1a57('0x32')]);_0x541447[_0x1a57('0x35')]=_[_0x1a57('0x34')](_0x45b954[_0x1a57('0x35')]);_0x541447[_0x1a57('0x36')]=_['intersection'](_0x541447[_0x1a57('0x33')],_0x541447[_0x1a57('0x35')]);_0x369dc1[_0x1a57('0x38')]=_['intersection'](_0x541447['model'],qs['fields'](_0x45b954[_0x1a57('0x35')][_0x1a57('0x4c')]));_0x369dc1['attributes']=_0x369dc1['attributes'][_0x1a57('0x39')]?_0x369dc1[_0x1a57('0x38')]:_0x541447[_0x1a57('0x33')];_0x369dc1['order']=qs[_0x1a57('0x3e')](_0x45b954[_0x1a57('0x35')][_0x1a57('0x3e')]);_0x369dc1[_0x1a57('0x3f')]=qs['filters'](_[_0x1a57('0x40')](_0x45b954[_0x1a57('0x35')],_0x541447[_0x1a57('0x36')]));if(_0x45b954[_0x1a57('0x35')][_0x1a57('0x53')]){_0x369dc1[_0x1a57('0x3f')]=_[_0x1a57('0x41')](_0x369dc1[_0x1a57('0x3f')],{'$or':_[_0x1a57('0x54')](_0x369dc1['attributes'],function(_0x4132ff){var _0x42d05f={};_0x42d05f[_0x4132ff]={'$like':'%'+_0x45b954[_0x1a57('0x35')][_0x1a57('0x53')]+'%'};return _0x42d05f;})});}_0x369dc1=_[_0x1a57('0x41')]({},_0x369dc1,_0x45b954[_0x1a57('0x4d')]);return _0x45afe5[_0x1a57('0x59')](_0x369dc1);}})[_0x1a57('0x1a')](function(_0x3e8b1c){if(_0x3e8b1c){_0x1a98f0=_0x3e8b1c[_0x1a57('0x39')];if(!_0x45b954[_0x1a57('0x35')][_0x1a57('0x3a')](_0x1a57('0x3b'))){_0x369dc1['limit']=qs[_0x1a57('0x3c')](_0x45b954[_0x1a57('0x35')][_0x1a57('0x3c')]);_0x369dc1[_0x1a57('0x27')]=qs[_0x1a57('0x27')](_0x45b954[_0x1a57('0x35')]['offset']);}return _0x45afe5[_0x1a57('0x59')](_0x369dc1);}})[_0x1a57('0x1a')](function(_0x65a6d8){if(_0x65a6d8){return _0x65a6d8?{'count':_0x1a98f0,'rows':_0x65a6d8}:null;}})[_0x1a57('0x1a')](respondWithResult(_0x59c9ce,null))[_0x1a57('0x22')](handleError(_0x59c9ce,null));};exports['setTags']=function(_0x3ad184,_0x2f35c1,_0x5801bc){if(_0x3ad184[_0x1a57('0x50')]['id']){delete _0x3ad184[_0x1a57('0x50')]['id'];}return db[_0x1a57('0x31')][_0x1a57('0x51')]({'where':{'id':_0x3ad184['params']['id']}})['then'](handleEntityNotFound(_0x2f35c1,null))[_0x1a57('0x1a')](function(_0x453e5d){if(_0x453e5d){return _0x453e5d['setTags'](_0x3ad184[_0x1a57('0x50')][_0x1a57('0x5a')]||[]);}return null;})[_0x1a57('0x1a')](respondWithResult(_0x2f35c1,null))[_0x1a57('0x22')](handleError(_0x2f35c1,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 10c0e26..187ac76 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 _0x9348=['util','../../config/logger','api','moment','request-promise','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x36976b,_0x30c7d4){var _0x3fd20c=function(_0x177dd9){while(--_0x177dd9){_0x36976b['push'](_0x36976b['shift']());}};_0x3fd20c(++_0x30c7d4);}(_0x9348,0x10d));var _0x8934=function(_0x5be81f,_0x49dd9c){_0x5be81f=_0x5be81f-0x0;var _0x511c6c=_0x9348[_0x5be81f];return _0x511c6c;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var attributes=require(_0x8934('0x6'));module['exports']=function(_0x34f94c,_0x923aa3){return _0x34f94c[_0x8934('0x7')](_0x8934('0x8'),attributes,{'tableName':_0x8934('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['api','moment','bluebird','request-promise','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger'];(function(_0x7d343,_0x1f5788){var _0x507566=function(_0x4574fb){while(--_0x4574fb){_0x7d343['push'](_0x7d343['shift']());}};_0x507566(++_0x1f5788);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var attributes=require('./intDeskConfiguration.attributes');module[_0x0baf('0x6')]=function(_0x1c383e,_0x2d3fa5){return _0x1c383e[_0x0baf('0x7')](_0x0baf('0x8'),attributes,{'tableName':_0x0baf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5b2761e..3958b11 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 _0x1261=['then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1ebe75,_0x59a794){var _0xb966cb=function(_0x2fd5eb){while(--_0x2fd5eb){_0x1ebe75['push'](_0x1ebe75['shift']());}};_0xb966cb(++_0x59a794);}(_0x1261,0x144));var _0x1126=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x1261[_0x4687df];return _0x32eaef;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x31659a,_0x301538){var _0x2e2f20=function(_0x23980c){while(--_0x23980c){_0x31659a['push'](_0x31659a['shift']());}};_0x2e2f20(++_0x301538);}(_0xba34,0x119));var _0x4ba3=function(_0xd2ee10,_0x357e69){_0xd2ee10=_0xd2ee10-0x0;var _0x314463=_0xba34[_0xd2ee10];return _0x314463;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6c46e4f..b86462a 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 _0xc76a=['isAuthenticated','show','post','create','put','update','delete','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id'];(function(_0x275222,_0x7635fe){var _0x14a885=function(_0x269f87){while(--_0x269f87){_0x275222['push'](_0x275222['shift']());}};_0x14a885(++_0x7635fe);}(_0xc76a,0x15c));var _0xac76=function(_0x428003,_0x40d926){_0x428003=_0x428003-0x0;var _0x288d1f=_0xc76a[_0x428003];return _0x288d1f;};'use strict';var multer=require(_0xac76('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac76('0x1'));var router=express['Router']();var auth=require(_0xac76('0x2'));var interaction=require(_0xac76('0x3'));var config=require(_0xac76('0x4'));var controller=require(_0xac76('0x5'));router[_0xac76('0x6')]('/',auth['isAuthenticated'](),controller[_0xac76('0x7')]);router[_0xac76('0x6')](_0xac76('0x8'),auth[_0xac76('0x9')](),controller[_0xac76('0xa')]);router[_0xac76('0xb')]('/',auth[_0xac76('0x9')](),controller[_0xac76('0xc')]);router[_0xac76('0xd')](_0xac76('0x8'),auth[_0xac76('0x9')](),controller[_0xac76('0xe')]);router[_0xac76('0xf')](_0xac76('0x8'),auth[_0xac76('0x9')](),controller['destroy']);module[_0xac76('0x10')]=router; \ No newline at end of file +var _0x9ee4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','create','put','/:id','update'];(function(_0x136d4a,_0x48961e){var _0x7f5ded=function(_0x38a6f2){while(--_0x38a6f2){_0x136d4a['push'](_0x136d4a['shift']());}};_0x7f5ded(++_0x48961e);}(_0x9ee4,0xd4));var _0x49ee=function(_0x4efd00,_0x1e4f65){_0x4efd00=_0x4efd00-0x0;var _0x5685d9=_0x9ee4[_0x4efd00];return _0x5685d9;};'use strict';var multer=require(_0x49ee('0x0'));var util=require(_0x49ee('0x1'));var path=require(_0x49ee('0x2'));var timeout=require(_0x49ee('0x3'));var express=require(_0x49ee('0x4'));var router=express[_0x49ee('0x5')]();var auth=require(_0x49ee('0x6'));var interaction=require(_0x49ee('0x7'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x49ee('0x8')]('/',auth['isAuthenticated'](),controller[_0x49ee('0x9')]);router[_0x49ee('0x8')]('/:id',auth[_0x49ee('0xa')](),controller[_0x49ee('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49ee('0xc')]);router[_0x49ee('0xd')](_0x49ee('0xe'),auth[_0x49ee('0xa')](),controller[_0x49ee('0xf')]);router[_0x49ee('0x10')](_0x49ee('0xe'),auth[_0x49ee('0xa')](),controller[_0x49ee('0x11')]);module[_0x49ee('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 62125c3..e98cc6d 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 _0x13f6=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports'];(function(_0x5df84f,_0x2b058e){var _0x2a8a44=function(_0x5cfb92){while(--_0x5cfb92){_0x5df84f['push'](_0x5df84f['shift']());}};_0x2a8a44(++_0x2b058e);}(_0x13f6,0x124));var _0x613f=function(_0xff4aca,_0x1363c9){_0xff4aca=_0xff4aca-0x0;var _0x2c2580=_0x13f6[_0xff4aca];return _0x2c2580;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x613f('0x2'),_0x613f('0x3'),_0x613f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x613f('0x5')]},'key':{'type':Sequelize[_0x613f('0x5')]},'keyType':{'type':Sequelize[_0x613f('0x6')]('string',_0x613f('0x2'),_0x613f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x613f('0x5')]}}; \ No newline at end of file +var _0xe706=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0xc69530,_0x57c174){var _0x148a92=function(_0x409d97){while(--_0x409d97){_0xc69530['push'](_0xc69530['shift']());}};_0x148a92(++_0x57c174);}(_0xe706,0xa3));var _0x6e70=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0xe706[_0x45dd0e];return _0x50e5ca;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x6')},'content':{'type':Sequelize[_0x6e70('0x7')]},'key':{'type':Sequelize[_0x6e70('0x7')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x6'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x7')]},'idField':{'type':Sequelize[_0x6e70('0x7')]},'nameField':{'type':Sequelize[_0x6e70('0x7')]},'customField':{'type':Sequelize[_0x6e70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e70('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index ada78f3..74f3a58 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','DeskField','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x10d436,_0x16b0f9){var _0x4cd03b=function(_0x54e440){while(--_0x54e440){_0x10d436['push'](_0x10d436['shift']());}};_0x4cd03b(++_0x16b0f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['DeskField'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['DeskField'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0x0713=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','DeskField','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','key','VIRTUAL','field','include','findAll','catch','show','params','length','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x12b375,_0xf73070){var _0x3d2208=function(_0x303c08){while(--_0x303c08){_0x12b375['push'](_0x12b375['shift']());}};_0x3d2208(++_0xf73070);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var authService=require(_0x3071('0x11'));var hardwareService=require(_0x3071('0x12'));var Redis=require(_0x3071('0x13'));var qs=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];function respondWithStatusCode(_0x3ed4a0,_0xa0c1){_0xa0c1=_0xa0c1||0xcc;return function(_0x4a8cc7){if(_0x4a8cc7){return _0x3ed4a0['sendStatus'](_0xa0c1);}return _0x3ed4a0[_0x3071('0x19')](_0xa0c1)['end']();};}function respondWithResult(_0x31c220,_0x44fbae){_0x44fbae=_0x44fbae||0xc8;return function(_0x5d4883){if(_0x5d4883){return _0x31c220[_0x3071('0x19')](_0x44fbae)['json'](_0x5d4883);}};}function respondWithFilteredResult(_0x2fc15d,_0x45c93b){return function(_0x1271d0){if(_0x1271d0){var _0x1f14e1=_0x1271d0[_0x3071('0x1a')],_0x1caa5d=_0x45c93b[_0x3071('0x1b')],_0x2a6a4b=_0x45c93b[_0x3071('0x1b')]+_0x45c93b['limit'],_0x157a47;if(_0x2a6a4b>=_0x1f14e1){_0x2a6a4b=_0x1f14e1;_0x157a47=0xc8;}else{_0x157a47=0xce;}_0x2fc15d[_0x3071('0x19')](_0x157a47);return _0x2fc15d[_0x3071('0x1c')](_0x3071('0x1d'),_0x1caa5d+'-'+_0x2a6a4b+'/'+_0x1f14e1)[_0x3071('0x1e')](_0x1271d0);}return null;};}function patchUpdates(_0x3acf0e){return function(_0x17aee2){try{jsonpatch[_0x3071('0x1f')](_0x17aee2,_0x3acf0e,!![]);}catch(_0x26f113){return BPromise['reject'](_0x26f113);}return _0x17aee2[_0x3071('0x20')]();};}function saveUpdates(_0x2bfa33,_0xd3e23d){return function(_0x56c267){if(_0x56c267){return _0x56c267[_0x3071('0x21')](_0x2bfa33)['then'](function(_0x833074){return _0x833074;});}return null;};}function removeEntity(_0x43128c,_0x3762d8){return function(_0x457b57){if(_0x457b57){return _0x457b57[_0x3071('0x22')]()[_0x3071('0x23')](function(){_0x43128c[_0x3071('0x19')](0xcc)[_0x3071('0x24')]();});}};}function handleEntityNotFound(_0x542646,_0x481a51){return function(_0x2ce48a){if(!_0x2ce48a){_0x542646[_0x3071('0x25')](0x194);}return _0x2ce48a;};}function handleError(_0x412652,_0x13df9f){_0x13df9f=_0x13df9f||0x1f4;return function(_0x2793ef){logger[_0x3071('0x26')](_0x2793ef[_0x3071('0x27')]);if(_0x2793ef[_0x3071('0x28')]){delete _0x2793ef[_0x3071('0x28')];}_0x412652['status'](_0x13df9f)[_0x3071('0x29')](_0x2793ef);};}exports[_0x3071('0x2a')]=function(_0x177138,_0x4d5c4b){var _0x4fb1ca={},_0x28792d={},_0x163604={'count':0x0,'rows':[]};var _0x950fde=db[_0x3071('0x2b')][_0x3071('0x2c')];_0x28792d[_0x3071('0x2d')]=_[_0x3071('0x2e')](_0x950fde);_0x28792d[_0x3071('0x2f')]=_[_0x3071('0x2e')](_0x177138[_0x3071('0x2f')]);_0x28792d['filters']=_['intersection'](_0x28792d[_0x3071('0x2d')],_0x28792d[_0x3071('0x2f')]);_0x4fb1ca[_0x3071('0x30')]=_[_0x3071('0x31')](_0x28792d[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x177138[_0x3071('0x2f')][_0x3071('0x32')]));_0x4fb1ca['attributes']=_0x4fb1ca['attributes']['length']?_0x4fb1ca[_0x3071('0x30')]:_0x28792d[_0x3071('0x2d')];if(!_0x177138['query'][_0x3071('0x33')](_0x3071('0x34'))){_0x4fb1ca[_0x3071('0x35')]=qs[_0x3071('0x35')](_0x177138['query'][_0x3071('0x35')]);_0x4fb1ca[_0x3071('0x1b')]=qs[_0x3071('0x1b')](_0x177138[_0x3071('0x2f')][_0x3071('0x1b')]);}_0x4fb1ca[_0x3071('0x36')]=qs[_0x3071('0x37')](_0x177138[_0x3071('0x2f')]['sort']);_0x4fb1ca[_0x3071('0x38')]=qs['filters'](_['pick'](_0x177138[_0x3071('0x2f')],_0x28792d[_0x3071('0x39')]));if(_0x177138['query'][_0x3071('0x3a')]){_0x4fb1ca[_0x3071('0x38')]=_[_0x3071('0x3b')](_0x4fb1ca[_0x3071('0x38')],{'$or':_[_0x3071('0x3c')](_0x950fde,function(_0x232235){if(_0x232235['type'][_0x3071('0x3d')]!==_0x3071('0x3e')){var _0x4ce6d4={};_0x4ce6d4[_0x232235[_0x3071('0x3f')]]={'$like':'%'+_0x177138['query'][_0x3071('0x3a')]+'%'};return _0x4ce6d4;}})});}_0x4fb1ca=_[_0x3071('0x3b')]({},_0x4fb1ca,_0x177138['options']);var _0x593c99={'where':_0x4fb1ca[_0x3071('0x38')]};return db[_0x3071('0x2b')][_0x3071('0x1a')](_0x593c99)['then'](function(_0x4dea69){_0x163604['count']=_0x4dea69;if(_0x177138[_0x3071('0x2f')]['includeAll']){_0x4fb1ca[_0x3071('0x40')]=[{'all':!![]}];}return db[_0x3071('0x2b')][_0x3071('0x41')](_0x4fb1ca);})[_0x3071('0x23')](function(_0x30ab68){_0x163604['rows']=_0x30ab68;return _0x163604;})['then'](respondWithFilteredResult(_0x4d5c4b,_0x4fb1ca))[_0x3071('0x42')](handleError(_0x4d5c4b,null));};exports[_0x3071('0x43')]=function(_0x1455be,_0x1f69a6){var _0x525389={'raw':!![],'where':{'id':_0x1455be[_0x3071('0x44')]['id']}},_0x3cfc05={};_0x3cfc05[_0x3071('0x2d')]=_[_0x3071('0x2e')](db[_0x3071('0x2b')][_0x3071('0x2c')]);_0x3cfc05['query']=_[_0x3071('0x2e')](_0x1455be['query']);_0x3cfc05['filters']=_['intersection'](_0x3cfc05['model'],_0x3cfc05[_0x3071('0x2f')]);_0x525389[_0x3071('0x30')]=_[_0x3071('0x31')](_0x3cfc05[_0x3071('0x2d')],qs[_0x3071('0x32')](_0x1455be[_0x3071('0x2f')][_0x3071('0x32')]));_0x525389[_0x3071('0x30')]=_0x525389['attributes'][_0x3071('0x45')]?_0x525389[_0x3071('0x30')]:_0x3cfc05[_0x3071('0x2d')];if(_0x1455be[_0x3071('0x2f')][_0x3071('0x46')]){_0x525389['include']=[{'all':!![]}];}_0x525389=_['merge']({},_0x525389,_0x1455be[_0x3071('0x47')]);return db[_0x3071('0x2b')][_0x3071('0x48')](_0x525389)[_0x3071('0x23')](handleEntityNotFound(_0x1f69a6,null))[_0x3071('0x23')](respondWithResult(_0x1f69a6,null))['catch'](handleError(_0x1f69a6,null));};exports[_0x3071('0x49')]=function(_0x4a1d29,_0x18a773){return db['DeskField']['create'](_0x4a1d29[_0x3071('0x4a')],{})['then'](respondWithResult(_0x18a773,0xc9))[_0x3071('0x42')](handleError(_0x18a773,null));};exports['update']=function(_0x717c43,_0x1d75e5){if(_0x717c43[_0x3071('0x4a')]['id']){delete _0x717c43[_0x3071('0x4a')]['id'];}return db['DeskField'][_0x3071('0x48')]({'where':{'id':_0x717c43['params']['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x1d75e5,null))['then'](saveUpdates(_0x717c43[_0x3071('0x4a')],null))[_0x3071('0x23')](respondWithResult(_0x1d75e5,null))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x22')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x2b')][_0x3071('0x48')]({'where':{'id':_0x117e73[_0x3071('0x44')]['id']}})[_0x3071('0x23')](handleEntityNotFound(_0x224a70,null))['then'](removeEntity(_0x224a70,null))[_0x3071('0x42')](handleError(_0x224a70,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6b1b41a..8423ba1 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 _0xfd42=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','bluebird','request-promise','./intDeskField.attributes','exports','define'];(function(_0x33310f,_0x4fa302){var _0x9a1ea9=function(_0x5f4cac){while(--_0x5f4cac){_0x33310f['push'](_0x33310f['shift']());}};_0x9a1ea9(++_0x4fa302);}(_0xfd42,0xdd));var _0x2fd4=function(_0x445489,_0x446a0a){_0x445489=_0x445489-0x0;var _0x3e4fdf=_0xfd42[_0x445489];return _0x3e4fdf;};'use strict';var _=require('lodash');var util=require(_0x2fd4('0x0'));var logger=require(_0x2fd4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2fd4('0x2'));var rp=require(_0x2fd4('0x3'));var attributes=require(_0x2fd4('0x4'));module[_0x2fd4('0x5')]=function(_0x4ba358,_0x4e5022){return _0x4ba358[_0x2fd4('0x6')](_0x2fd4('0x7'),attributes,{'tableName':_0x2fd4('0x8'),'paranoid':![],'indexes':[{'name':_0x2fd4('0x9'),'fields':[_0x2fd4('0xa'),_0x2fd4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd51a=['api','moment','bluebird','request-promise','./intDeskField.attributes','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x1635f2,_0x391b03){var _0x3fced5=function(_0x3a9c46){while(--_0x3a9c46){_0x1635f2['push'](_0x1635f2['shift']());}};_0x3fced5(++_0x391b03);}(_0xd51a,0x111));var _0xad51=function(_0x45ea5e,_0x567fe0){_0x45ea5e=_0x45ea5e-0x0;var _0x1d7318=_0xd51a[_0x45ea5e];return _0x1d7318;};'use strict';var _=require(_0xad51('0x0'));var util=require(_0xad51('0x1'));var logger=require(_0xad51('0x2'))(_0xad51('0x3'));var moment=require(_0xad51('0x4'));var BPromise=require(_0xad51('0x5'));var rp=require(_0xad51('0x6'));var attributes=require(_0xad51('0x7'));module['exports']=function(_0x45e0b6,_0x44621b){return _0x45e0b6['define'](_0xad51('0x8'),attributes,{'tableName':_0xad51('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xad51('0xa'),_0xad51('0xb')],'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 1b1deaa..8c34b85 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 _0xf4eb=['DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4008de,_0x15f2e9){var _0x596738=function(_0x2d4060){while(--_0x2d4060){_0x4008de['push'](_0x4008de['shift']());}};_0x596738(++_0x15f2e9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x35fca4,_0x53cbd5){_0x35fca4=_0x35fca4-0x0;var _0x452f6e=_0xf4eb[_0x35fca4];return _0x452f6e;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('DeskField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result'];(function(_0x2d0a2c,_0x11bee0){var _0x27b0cf=function(_0x2c794d){while(--_0x2c794d){_0x2d0a2c['push'](_0x2d0a2c['shift']());}};_0x27b0cf(++_0x11bee0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x484ad6,_0x4efaee){_0x484ad6=_0x484ad6-0x0;var _0x4950d0=_0xf3cd[_0x484ad6];return _0x4950d0;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('DeskField,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('DeskField,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b468ac5..4fd81ca 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 _0xb2aa=['create','addConfiguration','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post'];(function(_0x103478,_0x353eca){var _0x55d015=function(_0x5a8665){while(--_0x5a8665){_0x103478['push'](_0x103478['shift']());}};_0x55d015(++_0x353eca);}(_0xb2aa,0xc3));var _0xab2a=function(_0x3c08b3,_0x2d6943){_0x3c08b3=_0x3c08b3-0x0;var _0x5223a1=_0xb2aa[_0x3c08b3];return _0x5223a1;};'use strict';var multer=require(_0xab2a('0x0'));var util=require(_0xab2a('0x1'));var path=require(_0xab2a('0x2'));var timeout=require('connect-timeout');var express=require(_0xab2a('0x3'));var router=express['Router']();var auth=require(_0xab2a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xab2a('0x5'));var controller=require(_0xab2a('0x6'));router[_0xab2a('0x7')]('/',auth['isAuthenticated'](),controller[_0xab2a('0x8')]);router[_0xab2a('0x7')](_0xab2a('0x9'),auth[_0xab2a('0xa')](),controller['show']);router[_0xab2a('0x7')](_0xab2a('0xb'),auth[_0xab2a('0xa')](),controller[_0xab2a('0xc')]);router['get']('/:id/fields',auth[_0xab2a('0xa')](),controller[_0xab2a('0xd')]);router[_0xab2a('0xe')]('/',auth[_0xab2a('0xa')](),controller[_0xab2a('0xf')]);router[_0xab2a('0xe')](_0xab2a('0xb'),auth['isAuthenticated'](),controller[_0xab2a('0x10')]);router[_0xab2a('0x11')](_0xab2a('0x9'),auth[_0xab2a('0xa')](),controller[_0xab2a('0x12')]);router[_0xab2a('0x13')](_0xab2a('0x9'),auth[_0xab2a('0xa')](),controller[_0xab2a('0x14')]);module['exports']=router; \ No newline at end of file +var _0x703b=['../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x558c2a,_0xf549e2){var _0x1b5e9a=function(_0x2b216e){while(--_0x2b216e){_0x558c2a['push'](_0x558c2a['shift']());}};_0x1b5e9a(++_0xf549e2);}(_0x703b,0x145));var _0xb703=function(_0x3c838e,_0x1960fd){_0x3c838e=_0x3c838e-0x0;var _0xac6620=_0x703b[_0x3c838e];return _0xac6620;};'use strict';var multer=require(_0xb703('0x0'));var util=require(_0xb703('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb703('0x2'));var router=express[_0xb703('0x3')]();var auth=require(_0xb703('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb703('0x5'));var controller=require(_0xb703('0x6'));router['get']('/',auth[_0xb703('0x7')](),controller[_0xb703('0x8')]);router[_0xb703('0x9')](_0xb703('0xa'),auth[_0xb703('0x7')](),controller[_0xb703('0xb')]);router[_0xb703('0x9')](_0xb703('0xc'),auth[_0xb703('0x7')](),controller[_0xb703('0xd')]);router[_0xb703('0x9')](_0xb703('0xe'),auth[_0xb703('0x7')](),controller[_0xb703('0xf')]);router['post']('/',auth[_0xb703('0x7')](),controller[_0xb703('0x10')]);router[_0xb703('0x11')](_0xb703('0xc'),auth[_0xb703('0x7')](),controller['addConfiguration']);router['put'](_0xb703('0xa'),auth[_0xb703('0x7')](),controller[_0xb703('0x12')]);router[_0xb703('0x13')](_0xb703('0xa'),auth[_0xb703('0x7')](),controller[_0xb703('0x14')]);module[_0xb703('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ed31964..b6b2ec2 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 _0x3fc5=['STRING','sequelize','exports'];(function(_0x5c1b62,_0x19577d){var _0x11ef77=function(_0x10f790){while(--_0x10f790){_0x5c1b62['push'](_0x5c1b62['shift']());}};_0x11ef77(++_0x19577d);}(_0x3fc5,0xf1));var _0x53fc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3fc5[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x53fc('0x0'));module[_0x53fc('0x1')]={'name':{'type':Sequelize[_0x53fc('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x53fc('0x2')]},'tenantId':{'type':Sequelize[_0x53fc('0x2')]},'clientId':{'type':Sequelize[_0x53fc('0x2')]},'clientSecret':{'type':Sequelize[_0x53fc('0x2')]},'serverUrl':{'type':Sequelize[_0x53fc('0x2')]},'description':{'type':Sequelize[_0x53fc('0x2')]}}; \ No newline at end of file +var _0x340c=['STRING','sequelize','exports'];(function(_0xe5a862,_0x5b7f20){var _0x313545=function(_0x5985cf){while(--_0x5985cf){_0xe5a862['push'](_0xe5a862['shift']());}};_0x313545(++_0x5b7f20);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'name':{'type':Sequelize[_0xc340('0x2')]},'username':{'type':Sequelize[_0xc340('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc340('0x2')]},'tenantId':{'type':Sequelize[_0xc340('0x2')]},'clientId':{'type':Sequelize[_0xc340('0x2')]},'clientSecret':{'type':Sequelize[_0xc340('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc340('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index b9c9154..333a6db 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 _0xef56=[')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','name','send','index','Dynamics365Account','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','key','VIRTUAL','field','merge','options','count','findAll','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','customerid','ownerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','format','https://login.microsoftonline.com/','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','forEach','substring','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','lastIndexOf','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','LogicalName','DisplayName'];(function(_0x4ffab6,_0x303961){var _0x507dc7=function(_0x597ed4){while(--_0x597ed4){_0x4ffab6['push'](_0x4ffab6['shift']());}};_0x507dc7(++_0x303961);}(_0xef56,0x1b8));var _0x6ef5=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xef56[_0x179e11];return _0x549f04;};'use strict';var pdf=require(_0x6ef5('0x0'));var emlformat=require(_0x6ef5('0x1'));var rimraf=require(_0x6ef5('0x2'));var zipdir=require(_0x6ef5('0x3'));var jsonpatch=require(_0x6ef5('0x4'));var rp=require(_0x6ef5('0x5'));var moment=require(_0x6ef5('0x6'));var BPromise=require(_0x6ef5('0x7'));var Mustache=require('mustache');var util=require(_0x6ef5('0x8'));var path=require(_0x6ef5('0x9'));var sox=require(_0x6ef5('0xa'));var csv=require(_0x6ef5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6ef5('0xc'));var squel=require(_0x6ef5('0xd'));var crypto=require(_0x6ef5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6ef5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6ef5('0x10'));var authService=require(_0x6ef5('0x11'));var hardwareService=require(_0x6ef5('0x12'));var Redis=require(_0x6ef5('0x13'));var qs=require(_0x6ef5('0x14'));var logger=require(_0x6ef5('0x15'))(_0x6ef5('0x16'));var utils=require(_0x6ef5('0x17'));var config=require(_0x6ef5('0x18'));var db=require(_0x6ef5('0x19'))['db'];var integrations=require(_0x6ef5('0x1a'));var jayson=require(_0x6ef5('0x1b'));var client=jayson[_0x6ef5('0x1c')][_0x6ef5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58e422,_0xc9aa17,_0x5d9a96,_0x6ed212){return new BPromise(function(_0xdff758,_0x3d722d){var _0x5159be=_0x6ed212||client;return _0x5159be[_0x6ef5('0x1e')](_0x58e422,_0x5d9a96)[_0x6ef5('0x1f')](function(_0x4bbab1){logger[_0x6ef5('0x20')](_0x6ef5('0x21'),_0xc9aa17,_0x6ef5('0x22'));logger['debug'](_0x6ef5('0x23'),_0xc9aa17,'request\x20sent',JSON['stringify'](_0x4bbab1));if(_0x4bbab1[_0x6ef5('0x24')]){if(_0x4bbab1['error']['code']===0x1f4){logger[_0x6ef5('0x24')](_0x6ef5('0x21'),_0xc9aa17,_0x4bbab1['error'][_0x6ef5('0x25')]);return _0x3d722d(_0x4bbab1[_0x6ef5('0x24')]['message']);}logger['error'](_0x6ef5('0x21'),_0xc9aa17,_0x4bbab1[_0x6ef5('0x24')][_0x6ef5('0x25')]);return _0xdff758(_0x4bbab1[_0x6ef5('0x24')][_0x6ef5('0x25')]);}else{logger['info'](_0x6ef5('0x21'),_0xc9aa17,_0x6ef5('0x22'));_0xdff758(_0x4bbab1['result'][_0x6ef5('0x25')]);}})['catch'](function(_0x45661f){logger[_0x6ef5('0x24')](_0x6ef5('0x21'),_0xc9aa17,_0x45661f);_0x3d722d(_0x45661f);});});}function respondWithStatusCode(_0x5d3bf6,_0x17f454){_0x17f454=_0x17f454||0xcc;return function(_0x2ef5b4){if(_0x2ef5b4){return _0x5d3bf6[_0x6ef5('0x26')](_0x17f454);}return _0x5d3bf6[_0x6ef5('0x27')](_0x17f454)[_0x6ef5('0x28')]();};}function respondWithResult(_0x133476,_0x2b6cf7){_0x2b6cf7=_0x2b6cf7||0xc8;return function(_0x408e6e){if(_0x408e6e){return _0x133476[_0x6ef5('0x27')](_0x2b6cf7)[_0x6ef5('0x29')](_0x408e6e);}};}function respondWithFilteredResult(_0x18d2e4,_0x4aedc5){return function(_0x738fca){if(_0x738fca){var _0x913c9e=_0x738fca['count'],_0x1c11cd=_0x4aedc5['offset'],_0x29fefd=_0x4aedc5[_0x6ef5('0x2a')]+_0x4aedc5[_0x6ef5('0x2b')],_0x324b9f;if(_0x29fefd>=_0x913c9e){_0x29fefd=_0x913c9e;_0x324b9f=0xc8;}else{_0x324b9f=0xce;}_0x18d2e4[_0x6ef5('0x27')](_0x324b9f);return _0x18d2e4[_0x6ef5('0x2c')](_0x6ef5('0x2d'),_0x1c11cd+'-'+_0x29fefd+'/'+_0x913c9e)[_0x6ef5('0x29')](_0x738fca);}return null;};}function patchUpdates(_0xca2343){return function(_0x4df24e){try{jsonpatch[_0x6ef5('0x2e')](_0x4df24e,_0xca2343,!![]);}catch(_0x31e3ee){return BPromise[_0x6ef5('0x2f')](_0x31e3ee);}return _0x4df24e['save']();};}function saveUpdates(_0x1e8ecf,_0x91772a){return function(_0x367b3f){if(_0x367b3f){return _0x367b3f[_0x6ef5('0x30')](_0x1e8ecf)['then'](function(_0x2d4ebc){return _0x2d4ebc;});}return null;};}function removeEntity(_0x299c1d,_0x592a43){return function(_0x43a79a){if(_0x43a79a){return _0x43a79a[_0x6ef5('0x31')]()[_0x6ef5('0x1f')](function(){_0x299c1d[_0x6ef5('0x27')](0xcc)[_0x6ef5('0x28')]();});}};}function handleEntityNotFound(_0x2110ba,_0xbf976e){return function(_0x2c2880){if(!_0x2c2880){_0x2110ba[_0x6ef5('0x26')](0x194);}return _0x2c2880;};}function handleError(_0x2baf15,_0x60d9cf){_0x60d9cf=_0x60d9cf||0x1f4;return function(_0x1a5b01){logger['error'](_0x1a5b01['stack']);if(_0x1a5b01[_0x6ef5('0x32')]){delete _0x1a5b01['name'];}_0x2baf15['status'](_0x60d9cf)[_0x6ef5('0x33')](_0x1a5b01);};}exports[_0x6ef5('0x34')]=function(_0x15e03a,_0x25755a){var _0x13df53={},_0x8f9ce0={},_0x389bf5={'count':0x0,'rows':[]};var _0x5c5df0=db[_0x6ef5('0x35')]['rawAttributes'];_0x8f9ce0[_0x6ef5('0x36')]=_[_0x6ef5('0x37')](_0x5c5df0);_0x8f9ce0[_0x6ef5('0x38')]=_[_0x6ef5('0x37')](_0x15e03a[_0x6ef5('0x38')]);_0x8f9ce0['filters']=_['intersection'](_0x8f9ce0[_0x6ef5('0x36')],_0x8f9ce0[_0x6ef5('0x38')]);_0x13df53[_0x6ef5('0x39')]=_[_0x6ef5('0x3a')](_0x8f9ce0[_0x6ef5('0x36')],qs[_0x6ef5('0x3b')](_0x15e03a[_0x6ef5('0x38')][_0x6ef5('0x3b')]));_0x13df53[_0x6ef5('0x39')]=_0x13df53['attributes']['length']?_0x13df53[_0x6ef5('0x39')]:_0x8f9ce0['model'];if(!_0x15e03a[_0x6ef5('0x38')][_0x6ef5('0x3c')](_0x6ef5('0x3d'))){_0x13df53[_0x6ef5('0x2b')]=qs[_0x6ef5('0x2b')](_0x15e03a['query']['limit']);_0x13df53[_0x6ef5('0x2a')]=qs['offset'](_0x15e03a[_0x6ef5('0x38')][_0x6ef5('0x2a')]);}_0x13df53[_0x6ef5('0x3e')]=qs[_0x6ef5('0x3f')](_0x15e03a[_0x6ef5('0x38')]['sort']);_0x13df53['where']=qs[_0x6ef5('0x40')](_[_0x6ef5('0x41')](_0x15e03a['query'],_0x8f9ce0['filters']));if(_0x15e03a[_0x6ef5('0x38')][_0x6ef5('0x42')]){_0x13df53[_0x6ef5('0x43')]=_['merge'](_0x13df53[_0x6ef5('0x43')],{'$or':_['map'](_0x5c5df0,function(_0x1889b6){if(_0x1889b6[_0x6ef5('0x44')][_0x6ef5('0x45')]!==_0x6ef5('0x46')){var _0x2a78eb={};_0x2a78eb[_0x1889b6[_0x6ef5('0x47')]]={'$like':'%'+_0x15e03a[_0x6ef5('0x38')]['filter']+'%'};return _0x2a78eb;}})});}_0x13df53=_[_0x6ef5('0x48')]({},_0x13df53,_0x15e03a[_0x6ef5('0x49')]);var _0x342861={'where':_0x13df53[_0x6ef5('0x43')]};return db[_0x6ef5('0x35')][_0x6ef5('0x4a')](_0x342861)[_0x6ef5('0x1f')](function(_0x53f6f7){_0x389bf5[_0x6ef5('0x4a')]=_0x53f6f7;if(_0x15e03a[_0x6ef5('0x38')]['includeAll']){_0x13df53['include']=[{'all':!![]}];}return db[_0x6ef5('0x35')][_0x6ef5('0x4b')](_0x13df53);})[_0x6ef5('0x1f')](function(_0x41c054){_0x389bf5['rows']=_0x41c054;return _0x389bf5;})[_0x6ef5('0x1f')](respondWithFilteredResult(_0x25755a,_0x13df53))[_0x6ef5('0x4c')](handleError(_0x25755a,null));};exports[_0x6ef5('0x4d')]=function(_0xb31d3e,_0x1c1ee0){var _0x4f7fd4={'raw':![],'where':{'id':_0xb31d3e[_0x6ef5('0x4e')]['id']}},_0x39668b={};_0x39668b[_0x6ef5('0x36')]=_['keys'](db['Dynamics365Account'][_0x6ef5('0x4f')]);_0x39668b[_0x6ef5('0x38')]=_[_0x6ef5('0x37')](_0xb31d3e[_0x6ef5('0x38')]);_0x39668b[_0x6ef5('0x40')]=_[_0x6ef5('0x3a')](_0x39668b[_0x6ef5('0x36')],_0x39668b[_0x6ef5('0x38')]);_0x4f7fd4[_0x6ef5('0x39')]=_[_0x6ef5('0x3a')](_0x39668b[_0x6ef5('0x36')],qs['fields'](_0xb31d3e['query'][_0x6ef5('0x3b')]));_0x4f7fd4[_0x6ef5('0x39')]=_0x4f7fd4[_0x6ef5('0x39')][_0x6ef5('0x50')]?_0x4f7fd4[_0x6ef5('0x39')]:_0x39668b[_0x6ef5('0x36')];if(_0xb31d3e[_0x6ef5('0x38')][_0x6ef5('0x51')]){_0x4f7fd4[_0x6ef5('0x52')]=[{'all':!![]}];}_0x4f7fd4=_[_0x6ef5('0x48')]({},_0x4f7fd4,_0xb31d3e['options']);return db['Dynamics365Account'][_0x6ef5('0x53')](_0x4f7fd4)[_0x6ef5('0x1f')](handleEntityNotFound(_0x1c1ee0,null))[_0x6ef5('0x1f')](respondWithResult(_0x1c1ee0,null))[_0x6ef5('0x4c')](handleError(_0x1c1ee0,null));};exports[_0x6ef5('0x54')]=function(_0x22a7d7,_0x5df1ee){return db['Dynamics365Account']['create'](_0x22a7d7[_0x6ef5('0x55')],{})[_0x6ef5('0x1f')](respondWithResult(_0x5df1ee,0xc9))[_0x6ef5('0x4c')](handleError(_0x5df1ee,null));};exports['update']=function(_0xf406d5,_0x5a30b0){if(_0xf406d5[_0x6ef5('0x55')]['id']){delete _0xf406d5[_0x6ef5('0x55')]['id'];}return db[_0x6ef5('0x35')]['find']({'where':{'id':_0xf406d5[_0x6ef5('0x4e')]['id']}})[_0x6ef5('0x1f')](handleEntityNotFound(_0x5a30b0,null))[_0x6ef5('0x1f')](saveUpdates(_0xf406d5[_0x6ef5('0x55')],null))[_0x6ef5('0x1f')](respondWithResult(_0x5a30b0,null))[_0x6ef5('0x4c')](handleError(_0x5a30b0,null));};exports['destroy']=function(_0x283efb,_0x28336c){return db[_0x6ef5('0x35')]['find']({'where':{'id':_0x283efb[_0x6ef5('0x4e')]['id']}})[_0x6ef5('0x1f')](handleEntityNotFound(_0x28336c,null))['then'](removeEntity(_0x28336c,null))['catch'](handleError(_0x28336c,null));};exports[_0x6ef5('0x56')]=function(_0x1302fd,_0x3b572f,_0x108e09){var _0x487b4f={};var _0x430665={};var _0x47f641;var _0xb748a6;return db[_0x6ef5('0x35')][_0x6ef5('0x57')]({'where':{'id':_0x1302fd[_0x6ef5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b572f,null))['then'](function(_0x6187){if(_0x6187){_0x47f641=_0x6187;_0x430665['model']=_[_0x6ef5('0x37')](db[_0x6ef5('0x58')][_0x6ef5('0x4f')]);_0x430665['query']=_[_0x6ef5('0x37')](_0x1302fd[_0x6ef5('0x38')]);_0x430665[_0x6ef5('0x40')]=_[_0x6ef5('0x3a')](_0x430665[_0x6ef5('0x36')],_0x430665[_0x6ef5('0x38')]);_0x487b4f[_0x6ef5('0x39')]=_[_0x6ef5('0x3a')](_0x430665[_0x6ef5('0x36')],qs[_0x6ef5('0x3b')](_0x1302fd['query'][_0x6ef5('0x3b')]));_0x487b4f[_0x6ef5('0x39')]=_0x487b4f[_0x6ef5('0x39')][_0x6ef5('0x50')]?_0x487b4f['attributes']:_0x430665[_0x6ef5('0x36')];_0x487b4f['order']=qs[_0x6ef5('0x3f')](_0x1302fd['query']['sort']);_0x487b4f[_0x6ef5('0x43')]=qs[_0x6ef5('0x40')](_[_0x6ef5('0x41')](_0x1302fd[_0x6ef5('0x38')],_0x430665[_0x6ef5('0x40')]));if(_0x1302fd[_0x6ef5('0x38')][_0x6ef5('0x42')]){_0x487b4f['where']=_[_0x6ef5('0x48')](_0x487b4f['where'],{'$or':_['map'](_0x487b4f[_0x6ef5('0x39')],function(_0x1ebf17){var _0x4542c6={};_0x4542c6[_0x1ebf17]={'$like':'%'+_0x1302fd['query'][_0x6ef5('0x42')]+'%'};return _0x4542c6;})});}_0x487b4f=_['merge']({},_0x487b4f,_0x1302fd[_0x6ef5('0x49')]);return _0x47f641[_0x6ef5('0x56')](_0x487b4f);}})[_0x6ef5('0x1f')](function(_0x336877){if(_0x336877){_0xb748a6=_0x336877[_0x6ef5('0x50')];if(!_0x1302fd[_0x6ef5('0x38')][_0x6ef5('0x3c')](_0x6ef5('0x3d'))){_0x487b4f[_0x6ef5('0x2b')]=qs[_0x6ef5('0x2b')](_0x1302fd[_0x6ef5('0x38')][_0x6ef5('0x2b')]);_0x487b4f[_0x6ef5('0x2a')]=qs[_0x6ef5('0x2a')](_0x1302fd[_0x6ef5('0x38')][_0x6ef5('0x2a')]);}return _0x47f641['getConfigurations'](_0x487b4f);}})[_0x6ef5('0x1f')](function(_0x3e582a){if(_0x3e582a){return _0x3e582a?{'count':_0xb748a6,'rows':_0x3e582a}:null;}})[_0x6ef5('0x1f')](respondWithResult(_0x3b572f,null))['catch'](handleError(_0x3b572f,null));};exports['addConfiguration']=function(_0x59c6ee,_0x520daf,_0x37853c){if(_0x59c6ee[_0x6ef5('0x55')]['id']){delete _0x59c6ee[_0x6ef5('0x55')]['id'];}return db['Dynamics365Account'][_0x6ef5('0x57')]({'where':{'id':_0x59c6ee['params']['id']}})[_0x6ef5('0x1f')](handleEntityNotFound(_0x520daf,null))[_0x6ef5('0x1f')](function(_0x7c9ae9){if(_0x7c9ae9){_0x59c6ee[_0x6ef5('0x55')][_0x6ef5('0x59')]=_0x7c9ae9['id'];_0x59c6ee[_0x6ef5('0x55')][_0x6ef5('0x5a')]=integrations[_0x6ef5('0x5b')](_0x59c6ee[_0x6ef5('0x55')][_0x6ef5('0x5c')],_0x59c6ee['body'][_0x6ef5('0x44')]);_0x59c6ee['body']['Descriptions']=integrations[_0x6ef5('0x5d')](_0x59c6ee[_0x6ef5('0x55')]['channel'],_0x59c6ee[_0x6ef5('0x55')]['type']);return db[_0x6ef5('0x58')][_0x6ef5('0x54')](_0x59c6ee[_0x6ef5('0x55')],{'include':[{'model':db[_0x6ef5('0x5e')],'as':_0x6ef5('0x5a')},{'model':db[_0x6ef5('0x5e')],'as':'Descriptions'}]});}return null;})[_0x6ef5('0x1f')](respondWithResult(_0x520daf,null))[_0x6ef5('0x4c')](handleError(_0x520daf,null));};exports[_0x6ef5('0x5f')]=function(_0x40e52b,_0x2319ea,_0x195b36){var _0xa6aaa4=_0x40e52b[_0x6ef5('0x38')][_0x6ef5('0x60')];var _0x4dcefa=_0xa6aaa4===_0x6ef5('0x61')?_0x6ef5('0x62'):'PhoneCall';var _0x5e825b='';var _0xb13f1e='';var _0x374882='';var _0x5f1f1c='';var _0x357e33='';var _0x5b721e='';var _0x33a814='';var _0xd1e8fa='';var _0x3bb799=[_0x6ef5('0x63'),'description',_0x6ef5('0x64'),_0x6ef5('0x65'),_0x6ef5('0x66'),'subject','phonenumber',_0x6ef5('0x67'),_0x6ef5('0x68'),_0x6ef5('0x69')];var _0x37f77c=[_0x6ef5('0x6a'),_0x6ef5('0x6b'),_0x6ef5('0x6c'),_0x6ef5('0x6d'),_0x6ef5('0x6e'),_0x6ef5('0x6f'),'contractdetailidname','contractidname',_0x6ef5('0x70'),'createdbyexternalpartyyominame',_0x6ef5('0x71'),_0x6ef5('0x72'),_0x6ef5('0x73'),_0x6ef5('0x74'),'createdonbehalfbyyominame',_0x6ef5('0x75'),'customeridtype',_0x6ef5('0x76'),_0x6ef5('0x77'),'entitlementidname',_0x6ef5('0x78'),'entityimage_url',_0x6ef5('0x79'),_0x6ef5('0x7a'),_0x6ef5('0x7b'),_0x6ef5('0x7c'),'importsequencenumber',_0x6ef5('0x7d'),_0x6ef5('0x7e'),_0x6ef5('0x7f'),_0x6ef5('0x80'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x6ef5('0x81'),'modifiedbyyominame',_0x6ef5('0x82'),_0x6ef5('0x83'),_0x6ef5('0x84'),_0x6ef5('0x85'),_0x6ef5('0x86'),'numberofchildincidents','onholdtime',_0x6ef5('0x87'),_0x6ef5('0x88'),'owneridtype',_0x6ef5('0x89'),_0x6ef5('0x8a'),_0x6ef5('0x8b'),_0x6ef5('0x8c'),_0x6ef5('0x8d'),_0x6ef5('0x8e'),_0x6ef5('0x8f'),_0x6ef5('0x90'),_0x6ef5('0x91'),_0x6ef5('0x92'),_0x6ef5('0x93'),_0x6ef5('0x94'),'sentimentvalue',_0x6ef5('0x95'),_0x6ef5('0x96'),_0x6ef5('0x97'),_0x6ef5('0x98'),_0x6ef5('0x99'),_0x6ef5('0x9a'),_0x6ef5('0x9b'),_0x6ef5('0x9c'),_0x6ef5('0x9d'),_0x6ef5('0x9e'),_0x6ef5('0x9f'),_0x6ef5('0xa0')];var _0x1b5fb8=_0x3bb799[_0x6ef5('0xa1')](_0x37f77c);return db['Dynamics365Account']['findOne']({'where':{'id':_0x40e52b[_0x6ef5('0x4e')]['id']},'attributes':['id',_0x6ef5('0xa2'),_0x6ef5('0xa3'),_0x6ef5('0xa4'),_0x6ef5('0xa5'),_0x6ef5('0xa6'),_0x6ef5('0xa7')]})[_0x6ef5('0x1f')](handleEntityNotFound(_0x2319ea,null))[_0x6ef5('0x1f')](function(_0xdcc3fe){if(_0xdcc3fe){_0xd1e8fa=_0xdcc3fe[_0x6ef5('0xa4')];var _0x407357=_0xd1e8fa[_0x6ef5('0xa8')](-0x1);if(_0x407357==='/'){_0xd1e8fa=_0xd1e8fa['substring'](0x0,_0xd1e8fa['lastIndexOf'](_0x407357));}_0x33a814=util[_0x6ef5('0xa9')]('%s/api/data/v9.0/',_0xd1e8fa);var _0x309682={'method':'POST','uri':_0x6ef5('0xaa')+_0xdcc3fe[_0x6ef5('0xa5')]+'/oauth2/token','form':{'client_id':_0xdcc3fe[_0x6ef5('0xa6')],'resource':_0xd1e8fa,'username':_0xdcc3fe[_0x6ef5('0xa2')],'password':_0xdcc3fe[_0x6ef5('0xa3')],'grant_type':_0x6ef5('0xa3'),'client_secret':_0xdcc3fe['clientSecret']},'json':!![]};return rp(_0x309682);}})['then'](function(_0x924e33){_0x5b721e=_0x924e33[_0x6ef5('0xab')];var _0x432f37={'method':_0x6ef5('0xac'),'uri':encodeURI(_0x33a814+_0x6ef5('0xad')+_0x4dcefa+'\x27'),'headers':{'Authorization':_0x6ef5('0xae')+_0x5b721e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x432f37);})[_0x6ef5('0x1f')](function(_0x365553){var _0x5f36a0=_0x365553[_0x6ef5('0xaf')][0x0];var _0x145c76=_0x5f36a0['MetadataId'];var _0x32d866={'method':_0x6ef5('0xac'),'uri':_0x33a814+_0x6ef5('0xb0')+_0x145c76+_0x6ef5('0xb1'),'headers':{'Authorization':_0x6ef5('0xae')+_0x5b721e,'If-None-Match':null,'OData-Version':_0x6ef5('0xb2')},'json':!![]};return rp(_0x32d866);})[_0x6ef5('0x1f')](function(_0x58da30){_0x5e825b=_0x58da30;_0xb13f1e=_0x5e825b[_0x6ef5('0xb3')];_0xb13f1e=_[_0x6ef5('0xb4')](_0xb13f1e,function(_0x2c2315){return!_0x1b5fb8[_0x6ef5('0xb5')](_0x2c2315['LogicalName']);});var _0x476d6b=[];var _0x4ef520=[];_0xb13f1e[_0x6ef5('0xb6')](function(_0xbfe8b1){if(_0xbfe8b1['@odata.type']){var _0x509ef7=_0xbfe8b1['@odata.type'][_0x6ef5('0xb7')](_0xbfe8b1[_0x6ef5('0xb8')]['lastIndexOf']('.')+0x1);if(_0x509ef7===_0x6ef5('0xb9')){_0x476d6b[_0x6ef5('0xba')](getSelectList(_0x33a814,_0xa6aaa4,_0x4ef520,_0x5e825b[_0x6ef5('0xbb')],_0xbfe8b1['MetadataId'],_0x5b721e));}}});return Promise[_0x6ef5('0xbc')](_0x476d6b);})['then'](function(_0x1a737c){_0x374882=_0x1a737c[0x0];var _0x498ea9=[];var _0x525ee3=[];_0xb13f1e[_0x6ef5('0xb6')](function(_0x92367d){if(!_[_0x6ef5('0xbd')](_0x92367d[_0x6ef5('0xb8')])){var _0x5bbddd=_0x92367d[_0x6ef5('0xb8')][_0x6ef5('0xb7')](_0x92367d['@odata.type'][_0x6ef5('0xbe')]('.')+0x1);if(_0x5bbddd==='BooleanAttributeMetadata'){_0x498ea9[_0x6ef5('0xba')](getBooleanList(_0x33a814,_0xa6aaa4,_0x525ee3,_0x5e825b['MetadataId'],_0x92367d[_0x6ef5('0xbb')],_0x5b721e));}}});return Promise['all'](_0x498ea9);})['then'](function(_0x4ccb0d){_0x5f1f1c=_0x4ccb0d[0x0];var _0x159213=[];var _0x405d47=[];_0xb13f1e[_0x6ef5('0xb6')](function(_0x4d7fdb){if(_0x4d7fdb['@odata.type']){var _0x5c2f06=_0x4d7fdb[_0x6ef5('0xb8')]['substring'](_0x4d7fdb[_0x6ef5('0xb8')][_0x6ef5('0xbe')]('.')+0x1);if(_0x5c2f06==='StringAttributeMetadata'||_0x5c2f06===_0x6ef5('0xbf')||_0x5c2f06==='BigIntAttributeMetadata'||_0x5c2f06===_0x6ef5('0xc0')||_0x5c2f06===_0x6ef5('0xc1')||_0x5c2f06==='DateTimeAttributeMetadata'||_0x5c2f06===_0x6ef5('0xc2')||_0x5c2f06==='EntityNameAttributeMetadata'||_0x5c2f06===_0x6ef5('0xc3')||_0x5c2f06===_0x6ef5('0xc4')){_0x159213[_0x6ef5('0xba')](getInputList(_0x33a814,_0xa6aaa4,_0x5c2f06,_0x405d47,_0x5e825b[_0x6ef5('0xbb')],_0x4d7fdb[_0x6ef5('0xbb')],_0x5b721e));}}});return Promise['all'](_0x159213);})['then'](function(_0x47a83b){_0x357e33=_0x47a83b[0x0];var _0x27708d=_0x374882[_0x6ef5('0xa1')](_0x5f1f1c)[_0x6ef5('0xa1')](_0x357e33);var _0x80748e={'count':_0x27708d[_0x6ef5('0x50')],'rows':_0x27708d};return _0x80748e;})[_0x6ef5('0x1f')](respondWithResult(_0x2319ea,null))[_0x6ef5('0x4c')](function(_0x51248d){console[_0x6ef5('0xc5')](_0x6ef5('0xc6')+_0x51248d);var _0x1f0398=_0x40e52b['query']['test']?0x1f4:_0x51248d['statusCode']||0x1f4;logger[_0x6ef5('0x24')](_0x51248d[_0x6ef5('0xc7')]);delete _0x51248d[_0x6ef5('0x32')];if(_0x1f0398===0x191){_0x1f0398=0x190;}_0x2319ea[_0x6ef5('0x27')](_0x1f0398)[_0x6ef5('0x33')](_0x40e52b[_0x6ef5('0x38')]['test']?{'message':_0x6ef5('0xc8'),'statusCode':_0x51248d['statusCode']}:_0x51248d);});};function getSelectList(_0x450360,_0x231397,_0x2a5329,_0x5f32fd,_0x552809,_0x2670ca){var _0x3e70c2={'method':_0x6ef5('0xac'),'uri':_0x450360+_0x6ef5('0xb0')+_0x5f32fd+_0x6ef5('0xc9')+_0x552809+_0x6ef5('0xca')+_0x6ef5('0xcb'),'headers':{'Authorization':_0x6ef5('0xae')+_0x2670ca,'If-None-Match':null,'OData-Version':_0x6ef5('0xb2')},'json':!![]};return rp(_0x3e70c2)[_0x6ef5('0x1f')](function(_0x4da9aa){var _0x24b32d=[];var _0x2ce443=_0x4da9aa['OptionSet']['Options'];_0x2ce443[_0x6ef5('0xb6')](function(_0x306654){_0x24b32d[_0x6ef5('0xba')]({'name':_0x306654[_0x6ef5('0xcc')][_0x6ef5('0xcd')][_0x6ef5('0xcc')],'value':String(_0x306654['Value'])});});var _0x4bf2a5={'id':_0x231397+'_'+_0x4da9aa[_0x6ef5('0xce')],'name':_0x4da9aa[_0x6ef5('0xcf')]['UserLocalizedLabel'][_0x6ef5('0xcc')],'custom':![],'options':_0x24b32d};_0x2a5329[_0x6ef5('0xba')](_0x4bf2a5);return _0x2a5329;});}function getBooleanList(_0x4fb0b4,_0x3b754e,_0x155ec6,_0x296d1a,_0x3477f3,_0x11470f){var _0x465c7e={'method':_0x6ef5('0xac'),'uri':_0x4fb0b4+_0x6ef5('0xb0')+_0x296d1a+_0x6ef5('0xc9')+_0x3477f3+_0x6ef5('0xd0'),'headers':{'Authorization':_0x6ef5('0xae')+_0x11470f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x465c7e)[_0x6ef5('0x1f')](function(_0x10f65b){var _0x104cd3=[];_0x104cd3[_0x6ef5('0xba')]({'name':_0x10f65b['OptionSet'][_0x6ef5('0xd1')]['Label'][_0x6ef5('0xcd')]['Label'],'value':_0x6ef5('0xd2')},{'name':_0x10f65b[_0x6ef5('0xd3')][_0x6ef5('0xd4')]['Label'][_0x6ef5('0xcd')][_0x6ef5('0xcc')],'value':_0x6ef5('0xd5')});var _0xd500e7={'id':_0x3b754e+'_'+_0x10f65b['LogicalName'],'name':_0x10f65b[_0x6ef5('0xcf')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x104cd3};_0x155ec6[_0x6ef5('0xba')](_0xd500e7);return _0x155ec6;});}function getInputList(_0x568f83,_0xb21413,_0x3f64b7,_0x4e4e9f,_0x4e0c32,_0x49cb54,_0x2c88b5){var _0x15f907={'method':_0x6ef5('0xac'),'uri':_0x568f83+_0x6ef5('0xb0')+_0x4e0c32+_0x6ef5('0xc9')+_0x49cb54+_0x6ef5('0xd6')+_0x3f64b7+_0x6ef5('0xd7'),'headers':{'Authorization':_0x6ef5('0xae')+_0x2c88b5,'If-None-Match':null,'OData-Version':_0x6ef5('0xb2')},'json':!![]};return rp(_0x15f907)[_0x6ef5('0x1f')](function(_0x4a57bf){var _0xd7e55c={'id':_0xb21413+'_'+_0x4a57bf['LogicalName'],'name':_0x4a57bf['DisplayName'][_0x6ef5('0xcd')]?_0x4a57bf[_0x6ef5('0xcf')][_0x6ef5('0xcd')][_0x6ef5('0xcc')]:_0x4a57bf[_0x6ef5('0xce')],'custom':![],'options':[]};_0x4e4e9f[_0x6ef5('0xba')](_0xd7e55c);return _0x4e4e9f;});} \ No newline at end of file +var _0xd83f=['socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','tenantId','clientSecret','remoteUri','slice','substring','format','/oauth2/token','clientId','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','Dynamics365\x20error:\x20','test','statusCode','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','UserLocalizedLabel','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','send','Dynamics365Account','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','include','findAll','rows','params','length','includeAll','find','create','body','getConfigurations','Dynamics365Configuration','map','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','Dynamics365Field','Descriptions','getFields','Incident','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname'];(function(_0x282ac4,_0x556ae3){var _0x188ced=function(_0x508176){while(--_0x508176){_0x282ac4['push'](_0x282ac4['shift']());}};_0x188ced(++_0x556ae3);}(_0xd83f,0x11b));var _0xfd83=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xd83f[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0xfd83('0x0'));var emlformat=require(_0xfd83('0x1'));var rimraf=require(_0xfd83('0x2'));var zipdir=require(_0xfd83('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfd83('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfd83('0x6'));var csv=require(_0xfd83('0x7'));var ejs=require(_0xfd83('0x8'));var fs=require('fs');var _=require(_0xfd83('0x9'));var squel=require(_0xfd83('0xa'));var crypto=require(_0xfd83('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfd83('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfd83('0xd'));var Papa=require(_0xfd83('0xe'));var authService=require(_0xfd83('0xf'));var hardwareService=require(_0xfd83('0x10'));var Redis=require(_0xfd83('0x11'));var qs=require(_0xfd83('0x12'));var logger=require(_0xfd83('0x13'))(_0xfd83('0x14'));var utils=require(_0xfd83('0x15'));var config=require(_0xfd83('0x16'));var db=require(_0xfd83('0x17'))['db'];var integrations=require(_0xfd83('0x18'));var jayson=require(_0xfd83('0x19'));var client=jayson[_0xfd83('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ff89e,_0x5e7a7c,_0x1ecee6,_0x5780d1){return new BPromise(function(_0x578998,_0x20a409){var _0x5d71c7=_0x5780d1||client;return _0x5d71c7[_0xfd83('0x1b')](_0x2ff89e,_0x1ecee6)[_0xfd83('0x1c')](function(_0x5c1d3f){logger[_0xfd83('0x1d')](_0xfd83('0x1e'),_0x5e7a7c,_0xfd83('0x1f'));logger[_0xfd83('0x20')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5e7a7c,_0xfd83('0x1f'),JSON[_0xfd83('0x21')](_0x5c1d3f));if(_0x5c1d3f['error']){if(_0x5c1d3f[_0xfd83('0x22')][_0xfd83('0x23')]===0x1f4){logger[_0xfd83('0x22')](_0xfd83('0x1e'),_0x5e7a7c,_0x5c1d3f[_0xfd83('0x22')][_0xfd83('0x24')]);return _0x20a409(_0x5c1d3f[_0xfd83('0x22')]['message']);}logger[_0xfd83('0x22')](_0xfd83('0x1e'),_0x5e7a7c,_0x5c1d3f[_0xfd83('0x22')][_0xfd83('0x24')]);return _0x578998(_0x5c1d3f[_0xfd83('0x22')][_0xfd83('0x24')]);}else{logger[_0xfd83('0x1d')](_0xfd83('0x1e'),_0x5e7a7c,'request\x20sent');_0x578998(_0x5c1d3f[_0xfd83('0x25')]['message']);}})[_0xfd83('0x26')](function(_0x976a38){logger['error'](_0xfd83('0x1e'),_0x5e7a7c,_0x976a38);_0x20a409(_0x976a38);});});}function respondWithStatusCode(_0x5551b7,_0x459dce){_0x459dce=_0x459dce||0xcc;return function(_0x4352b4){if(_0x4352b4){return _0x5551b7[_0xfd83('0x27')](_0x459dce);}return _0x5551b7[_0xfd83('0x28')](_0x459dce)[_0xfd83('0x29')]();};}function respondWithResult(_0x3b7b21,_0x535129){_0x535129=_0x535129||0xc8;return function(_0x84df70){if(_0x84df70){return _0x3b7b21[_0xfd83('0x28')](_0x535129)[_0xfd83('0x2a')](_0x84df70);}};}function respondWithFilteredResult(_0x4e4d23,_0x3bf721){return function(_0xe6a1c3){if(_0xe6a1c3){var _0x6bc024=_0xe6a1c3[_0xfd83('0x2b')],_0x3339db=_0x3bf721[_0xfd83('0x2c')],_0x5f31d5=_0x3bf721[_0xfd83('0x2c')]+_0x3bf721[_0xfd83('0x2d')],_0x54ae28;if(_0x5f31d5>=_0x6bc024){_0x5f31d5=_0x6bc024;_0x54ae28=0xc8;}else{_0x54ae28=0xce;}_0x4e4d23[_0xfd83('0x28')](_0x54ae28);return _0x4e4d23['set'](_0xfd83('0x2e'),_0x3339db+'-'+_0x5f31d5+'/'+_0x6bc024)[_0xfd83('0x2a')](_0xe6a1c3);}return null;};}function patchUpdates(_0x56dc30){return function(_0x5a8519){try{jsonpatch[_0xfd83('0x2f')](_0x5a8519,_0x56dc30,!![]);}catch(_0x4ff2b5){return BPromise[_0xfd83('0x30')](_0x4ff2b5);}return _0x5a8519[_0xfd83('0x31')]();};}function saveUpdates(_0x533b62,_0x5134f7){return function(_0x5c8628){if(_0x5c8628){return _0x5c8628[_0xfd83('0x32')](_0x533b62)[_0xfd83('0x1c')](function(_0x53178e){return _0x53178e;});}return null;};}function removeEntity(_0x3d3e89,_0x3c2ff3){return function(_0x174272){if(_0x174272){return _0x174272[_0xfd83('0x33')]()[_0xfd83('0x1c')](function(){_0x3d3e89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b886a,_0x37c507){return function(_0x246f5b){if(!_0x246f5b){_0x4b886a[_0xfd83('0x27')](0x194);}return _0x246f5b;};}function handleError(_0x28d078,_0x4e74d6){_0x4e74d6=_0x4e74d6||0x1f4;return function(_0x56dd6e){logger[_0xfd83('0x22')](_0x56dd6e['stack']);if(_0x56dd6e[_0xfd83('0x34')]){delete _0x56dd6e[_0xfd83('0x34')];}_0x28d078[_0xfd83('0x28')](_0x4e74d6)[_0xfd83('0x35')](_0x56dd6e);};}exports['index']=function(_0x25aa61,_0x89ad4){var _0x1b9dc1={},_0x4fe783={},_0x54d839={'count':0x0,'rows':[]};var _0x5c8fe2=db[_0xfd83('0x36')][_0xfd83('0x37')];_0x4fe783[_0xfd83('0x38')]=_[_0xfd83('0x39')](_0x5c8fe2);_0x4fe783[_0xfd83('0x3a')]=_[_0xfd83('0x39')](_0x25aa61['query']);_0x4fe783[_0xfd83('0x3b')]=_[_0xfd83('0x3c')](_0x4fe783[_0xfd83('0x38')],_0x4fe783[_0xfd83('0x3a')]);_0x1b9dc1[_0xfd83('0x3d')]=_[_0xfd83('0x3c')](_0x4fe783[_0xfd83('0x38')],qs[_0xfd83('0x3e')](_0x25aa61['query'][_0xfd83('0x3e')]));_0x1b9dc1[_0xfd83('0x3d')]=_0x1b9dc1[_0xfd83('0x3d')]['length']?_0x1b9dc1[_0xfd83('0x3d')]:_0x4fe783[_0xfd83('0x38')];if(!_0x25aa61['query'][_0xfd83('0x3f')](_0xfd83('0x40'))){_0x1b9dc1[_0xfd83('0x2d')]=qs['limit'](_0x25aa61['query'][_0xfd83('0x2d')]);_0x1b9dc1[_0xfd83('0x2c')]=qs[_0xfd83('0x2c')](_0x25aa61[_0xfd83('0x3a')][_0xfd83('0x2c')]);}_0x1b9dc1[_0xfd83('0x41')]=qs['sort'](_0x25aa61[_0xfd83('0x3a')][_0xfd83('0x42')]);_0x1b9dc1['where']=qs[_0xfd83('0x3b')](_[_0xfd83('0x43')](_0x25aa61[_0xfd83('0x3a')],_0x4fe783[_0xfd83('0x3b')]));if(_0x25aa61[_0xfd83('0x3a')][_0xfd83('0x44')]){_0x1b9dc1[_0xfd83('0x45')]=_[_0xfd83('0x46')](_0x1b9dc1[_0xfd83('0x45')],{'$or':_['map'](_0x5c8fe2,function(_0x42adf1){if(_0x42adf1[_0xfd83('0x47')][_0xfd83('0x48')]!==_0xfd83('0x49')){var _0x5cf7c3={};_0x5cf7c3[_0x42adf1[_0xfd83('0x4a')]]={'$like':'%'+_0x25aa61[_0xfd83('0x3a')][_0xfd83('0x44')]+'%'};return _0x5cf7c3;}})});}_0x1b9dc1=_[_0xfd83('0x46')]({},_0x1b9dc1,_0x25aa61[_0xfd83('0x4b')]);var _0x867015={'where':_0x1b9dc1[_0xfd83('0x45')]};return db[_0xfd83('0x36')][_0xfd83('0x2b')](_0x867015)[_0xfd83('0x1c')](function(_0x48fe5f){_0x54d839[_0xfd83('0x2b')]=_0x48fe5f;if(_0x25aa61[_0xfd83('0x3a')]['includeAll']){_0x1b9dc1[_0xfd83('0x4c')]=[{'all':!![]}];}return db[_0xfd83('0x36')][_0xfd83('0x4d')](_0x1b9dc1);})['then'](function(_0x41df11){_0x54d839[_0xfd83('0x4e')]=_0x41df11;return _0x54d839;})['then'](respondWithFilteredResult(_0x89ad4,_0x1b9dc1))[_0xfd83('0x26')](handleError(_0x89ad4,null));};exports['show']=function(_0x328b38,_0x46efdd){var _0x4ddb81={'raw':![],'where':{'id':_0x328b38[_0xfd83('0x4f')]['id']}},_0x50cdf4={};_0x50cdf4[_0xfd83('0x38')]=_['keys'](db[_0xfd83('0x36')]['rawAttributes']);_0x50cdf4['query']=_['keys'](_0x328b38[_0xfd83('0x3a')]);_0x50cdf4[_0xfd83('0x3b')]=_[_0xfd83('0x3c')](_0x50cdf4[_0xfd83('0x38')],_0x50cdf4[_0xfd83('0x3a')]);_0x4ddb81[_0xfd83('0x3d')]=_[_0xfd83('0x3c')](_0x50cdf4['model'],qs[_0xfd83('0x3e')](_0x328b38['query'][_0xfd83('0x3e')]));_0x4ddb81[_0xfd83('0x3d')]=_0x4ddb81[_0xfd83('0x3d')][_0xfd83('0x50')]?_0x4ddb81[_0xfd83('0x3d')]:_0x50cdf4['model'];if(_0x328b38[_0xfd83('0x3a')][_0xfd83('0x51')]){_0x4ddb81[_0xfd83('0x4c')]=[{'all':!![]}];}_0x4ddb81=_[_0xfd83('0x46')]({},_0x4ddb81,_0x328b38[_0xfd83('0x4b')]);return db[_0xfd83('0x36')][_0xfd83('0x52')](_0x4ddb81)['then'](handleEntityNotFound(_0x46efdd,null))['then'](respondWithResult(_0x46efdd,null))[_0xfd83('0x26')](handleError(_0x46efdd,null));};exports[_0xfd83('0x53')]=function(_0x3c77dd,_0x8c2e8f){return db[_0xfd83('0x36')]['create'](_0x3c77dd['body'],{})[_0xfd83('0x1c')](respondWithResult(_0x8c2e8f,0xc9))[_0xfd83('0x26')](handleError(_0x8c2e8f,null));};exports[_0xfd83('0x32')]=function(_0x59c611,_0x4a14b6){if(_0x59c611[_0xfd83('0x54')]['id']){delete _0x59c611[_0xfd83('0x54')]['id'];}return db[_0xfd83('0x36')][_0xfd83('0x52')]({'where':{'id':_0x59c611['params']['id']}})['then'](handleEntityNotFound(_0x4a14b6,null))[_0xfd83('0x1c')](saveUpdates(_0x59c611[_0xfd83('0x54')],null))['then'](respondWithResult(_0x4a14b6,null))[_0xfd83('0x26')](handleError(_0x4a14b6,null));};exports[_0xfd83('0x33')]=function(_0x30865a,_0x23b519){return db[_0xfd83('0x36')][_0xfd83('0x52')]({'where':{'id':_0x30865a[_0xfd83('0x4f')]['id']}})[_0xfd83('0x1c')](handleEntityNotFound(_0x23b519,null))[_0xfd83('0x1c')](removeEntity(_0x23b519,null))[_0xfd83('0x26')](handleError(_0x23b519,null));};exports[_0xfd83('0x55')]=function(_0x53b1eb,_0x4d62fb,_0xc47f7){var _0x20baf2={};var _0x51255f={};var _0x437fbf;var _0xf01c68;return db['Dynamics365Account']['findOne']({'where':{'id':_0x53b1eb[_0xfd83('0x4f')]['id']}})[_0xfd83('0x1c')](handleEntityNotFound(_0x4d62fb,null))[_0xfd83('0x1c')](function(_0x3954f3){if(_0x3954f3){_0x437fbf=_0x3954f3;_0x51255f['model']=_[_0xfd83('0x39')](db[_0xfd83('0x56')][_0xfd83('0x37')]);_0x51255f[_0xfd83('0x3a')]=_[_0xfd83('0x39')](_0x53b1eb[_0xfd83('0x3a')]);_0x51255f[_0xfd83('0x3b')]=_[_0xfd83('0x3c')](_0x51255f[_0xfd83('0x38')],_0x51255f['query']);_0x20baf2[_0xfd83('0x3d')]=_['intersection'](_0x51255f[_0xfd83('0x38')],qs['fields'](_0x53b1eb[_0xfd83('0x3a')]['fields']));_0x20baf2['attributes']=_0x20baf2[_0xfd83('0x3d')][_0xfd83('0x50')]?_0x20baf2[_0xfd83('0x3d')]:_0x51255f[_0xfd83('0x38')];_0x20baf2[_0xfd83('0x41')]=qs[_0xfd83('0x42')](_0x53b1eb[_0xfd83('0x3a')][_0xfd83('0x42')]);_0x20baf2[_0xfd83('0x45')]=qs[_0xfd83('0x3b')](_[_0xfd83('0x43')](_0x53b1eb[_0xfd83('0x3a')],_0x51255f['filters']));if(_0x53b1eb[_0xfd83('0x3a')][_0xfd83('0x44')]){_0x20baf2['where']=_['merge'](_0x20baf2['where'],{'$or':_[_0xfd83('0x57')](_0x20baf2[_0xfd83('0x3d')],function(_0x40a7b7){var _0x1aeb69={};_0x1aeb69[_0x40a7b7]={'$like':'%'+_0x53b1eb[_0xfd83('0x3a')][_0xfd83('0x44')]+'%'};return _0x1aeb69;})});}_0x20baf2=_[_0xfd83('0x46')]({},_0x20baf2,_0x53b1eb['options']);return _0x437fbf['getConfigurations'](_0x20baf2);}})['then'](function(_0x56a332){if(_0x56a332){_0xf01c68=_0x56a332['length'];if(!_0x53b1eb[_0xfd83('0x3a')][_0xfd83('0x3f')](_0xfd83('0x40'))){_0x20baf2[_0xfd83('0x2d')]=qs[_0xfd83('0x2d')](_0x53b1eb[_0xfd83('0x3a')][_0xfd83('0x2d')]);_0x20baf2[_0xfd83('0x2c')]=qs['offset'](_0x53b1eb['query'][_0xfd83('0x2c')]);}return _0x437fbf[_0xfd83('0x55')](_0x20baf2);}})[_0xfd83('0x1c')](function(_0x365c2e){if(_0x365c2e){return _0x365c2e?{'count':_0xf01c68,'rows':_0x365c2e}:null;}})['then'](respondWithResult(_0x4d62fb,null))[_0xfd83('0x26')](handleError(_0x4d62fb,null));};exports[_0xfd83('0x58')]=function(_0x22576e,_0x5e4002,_0x2a3853){if(_0x22576e['body']['id']){delete _0x22576e[_0xfd83('0x54')]['id'];}return db[_0xfd83('0x36')][_0xfd83('0x59')]({'where':{'id':_0x22576e[_0xfd83('0x4f')]['id']}})[_0xfd83('0x1c')](handleEntityNotFound(_0x5e4002,null))['then'](function(_0x51236a){if(_0x51236a){_0x22576e[_0xfd83('0x54')][_0xfd83('0x5a')]=_0x51236a['id'];_0x22576e[_0xfd83('0x54')][_0xfd83('0x5b')]=integrations[_0xfd83('0x5c')](_0x22576e['body']['channel'],_0x22576e[_0xfd83('0x54')]['type']);_0x22576e[_0xfd83('0x54')]['Descriptions']=integrations[_0xfd83('0x5d')](_0x22576e[_0xfd83('0x54')][_0xfd83('0x5e')],_0x22576e[_0xfd83('0x54')][_0xfd83('0x47')]);return db[_0xfd83('0x56')][_0xfd83('0x53')](_0x22576e[_0xfd83('0x54')],{'include':[{'model':db[_0xfd83('0x5f')],'as':_0xfd83('0x5b')},{'model':db[_0xfd83('0x5f')],'as':_0xfd83('0x60')}]});}return null;})[_0xfd83('0x1c')](respondWithResult(_0x5e4002,null))[_0xfd83('0x26')](handleError(_0x5e4002,null));};exports[_0xfd83('0x61')]=function(_0x2b16d5,_0x21cc99,_0x1bf8e0){var _0x1a894e=_0x2b16d5[_0xfd83('0x3a')]['ticketType'];var _0x88740e=_0x1a894e==='incident'?_0xfd83('0x62'):'PhoneCall';var _0x7e8140='';var _0x2b1c55='';var _0x214fe1='';var _0x17f767='';var _0x3e7d4e='';var _0x4ea268='';var _0x5d9d21='';var _0x39b336='';var _0x2ee366=[_0xfd83('0x63'),_0xfd83('0x64'),_0xfd83('0x65'),'ownerid',_0xfd83('0x66'),_0xfd83('0x67'),'phonenumber',_0xfd83('0x68'),_0xfd83('0x69'),'phonecall_activity_parties'];var _0x394e12=[_0xfd83('0x6a'),_0xfd83('0x6b'),_0xfd83('0x6c'),_0xfd83('0x6d'),_0xfd83('0x6e'),'contactidyominame',_0xfd83('0x6f'),_0xfd83('0x70'),_0xfd83('0x71'),'createdbyexternalpartyyominame',_0xfd83('0x72'),'createdbyyominame',_0xfd83('0x73'),_0xfd83('0x74'),'createdonbehalfbyyominame','customeridname',_0xfd83('0x75'),'customeridyominame',_0xfd83('0x76'),_0xfd83('0x77'),_0xfd83('0x78'),_0xfd83('0x79'),_0xfd83('0x7a'),_0xfd83('0x7b'),_0xfd83('0x7c'),'followupby',_0xfd83('0x7d'),'influencescore','kbarticleidname',_0xfd83('0x7e'),_0xfd83('0x7f'),_0xfd83('0x80'),_0xfd83('0x81'),_0xfd83('0x82'),_0xfd83('0x83'),_0xfd83('0x84'),_0xfd83('0x85'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xfd83('0x86'),'numberofchildincidents',_0xfd83('0x87'),_0xfd83('0x88'),_0xfd83('0x89'),_0xfd83('0x8a'),'owneridyominame',_0xfd83('0x8b'),_0xfd83('0x8c'),_0xfd83('0x8d'),_0xfd83('0x8e'),_0xfd83('0x8f'),_0xfd83('0x90'),_0xfd83('0x91'),_0xfd83('0x92'),_0xfd83('0x93'),_0xfd83('0x94'),_0xfd83('0x95'),_0xfd83('0x96'),_0xfd83('0x97'),_0xfd83('0x98'),_0xfd83('0x99'),_0xfd83('0x9a'),_0xfd83('0x9b'),_0xfd83('0x9c'),_0xfd83('0x9d'),_0xfd83('0x9e'),'transactioncurrencyidname',_0xfd83('0x9f'),_0xfd83('0xa0'),_0xfd83('0xa1')];var _0x333c54=_0x2ee366['concat'](_0x394e12);return db[_0xfd83('0x36')][_0xfd83('0x59')]({'where':{'id':_0x2b16d5[_0xfd83('0x4f')]['id']},'attributes':['id',_0xfd83('0xa2'),'password','remoteUri',_0xfd83('0xa3'),'clientId',_0xfd83('0xa4')]})['then'](handleEntityNotFound(_0x21cc99,null))['then'](function(_0x50fb37){if(_0x50fb37){_0x39b336=_0x50fb37[_0xfd83('0xa5')];var _0x48a278=_0x39b336[_0xfd83('0xa6')](-0x1);if(_0x48a278==='/'){_0x39b336=_0x39b336[_0xfd83('0xa7')](0x0,_0x39b336['lastIndexOf'](_0x48a278));}_0x5d9d21=util[_0xfd83('0xa8')]('%s/api/data/v9.0/',_0x39b336);var _0x19da2={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x50fb37[_0xfd83('0xa3')]+_0xfd83('0xa9'),'form':{'client_id':_0x50fb37[_0xfd83('0xaa')],'resource':_0x39b336,'username':_0x50fb37[_0xfd83('0xa2')],'password':_0x50fb37[_0xfd83('0xab')],'grant_type':_0xfd83('0xab'),'client_secret':_0x50fb37[_0xfd83('0xa4')]},'json':!![]};return rp(_0x19da2);}})[_0xfd83('0x1c')](function(_0x4354e6){_0x4ea268=_0x4354e6[_0xfd83('0xac')];var _0x41a1a6={'method':_0xfd83('0xad'),'uri':encodeURI(_0x5d9d21+_0xfd83('0xae')+_0x88740e+'\x27'),'headers':{'Authorization':_0xfd83('0xaf')+_0x4ea268,'If-None-Match':null,'OData-Version':_0xfd83('0xb0')},'json':!![]};return rp(_0x41a1a6);})[_0xfd83('0x1c')](function(_0x3b3426){var _0x1d2645=_0x3b3426[_0xfd83('0xb1')][0x0];var _0x34e922=_0x1d2645[_0xfd83('0xb2')];var _0x2e2fb0={'method':_0xfd83('0xad'),'uri':_0x5d9d21+_0xfd83('0xb3')+_0x34e922+_0xfd83('0xb4'),'headers':{'Authorization':_0xfd83('0xaf')+_0x4ea268,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e2fb0);})['then'](function(_0x1eb4ff){_0x7e8140=_0x1eb4ff;_0x2b1c55=_0x7e8140[_0xfd83('0xb5')];_0x2b1c55=_[_0xfd83('0xb6')](_0x2b1c55,function(_0x513106){return!_0x333c54['includes'](_0x513106[_0xfd83('0xb7')]);});var _0x39563f=[];var _0xfb653e=[];_0x2b1c55[_0xfd83('0xb8')](function(_0x5e0802){if(_0x5e0802[_0xfd83('0xb9')]){var _0x1b7270=_0x5e0802[_0xfd83('0xb9')][_0xfd83('0xa7')](_0x5e0802[_0xfd83('0xb9')][_0xfd83('0xba')]('.')+0x1);if(_0x1b7270===_0xfd83('0xbb')){_0x39563f[_0xfd83('0xbc')](getSelectList(_0x5d9d21,_0x1a894e,_0xfb653e,_0x7e8140['MetadataId'],_0x5e0802[_0xfd83('0xb2')],_0x4ea268));}}});return Promise[_0xfd83('0xbd')](_0x39563f);})['then'](function(_0x74a7d2){_0x214fe1=_0x74a7d2[0x0];var _0x414534=[];var _0x105072=[];_0x2b1c55[_0xfd83('0xb8')](function(_0x1e4615){if(!_[_0xfd83('0xbe')](_0x1e4615[_0xfd83('0xb9')])){var _0x264692=_0x1e4615[_0xfd83('0xb9')][_0xfd83('0xa7')](_0x1e4615[_0xfd83('0xb9')][_0xfd83('0xba')]('.')+0x1);if(_0x264692===_0xfd83('0xbf')){_0x414534[_0xfd83('0xbc')](getBooleanList(_0x5d9d21,_0x1a894e,_0x105072,_0x7e8140[_0xfd83('0xb2')],_0x1e4615[_0xfd83('0xb2')],_0x4ea268));}}});return Promise['all'](_0x414534);})['then'](function(_0x590bc1){_0x17f767=_0x590bc1[0x0];var _0x3833fe=[];var _0x3faf98=[];_0x2b1c55['forEach'](function(_0x1e524f){if(_0x1e524f[_0xfd83('0xb9')]){var _0x4fcafb=_0x1e524f[_0xfd83('0xb9')][_0xfd83('0xa7')](_0x1e524f[_0xfd83('0xb9')][_0xfd83('0xba')]('.')+0x1);if(_0x4fcafb===_0xfd83('0xc0')||_0x4fcafb===_0xfd83('0xc1')||_0x4fcafb==='BigIntAttributeMetadata'||_0x4fcafb==='IntegerAttributeMetadata'||_0x4fcafb===_0xfd83('0xc2')||_0x4fcafb==='DateTimeAttributeMetadata'||_0x4fcafb==='StatusAttributeMetadata'||_0x4fcafb===_0xfd83('0xc3')||_0x4fcafb===_0xfd83('0xc4')||_0x4fcafb==='DecimalAttributeMetadata'){_0x3833fe[_0xfd83('0xbc')](getInputList(_0x5d9d21,_0x1a894e,_0x4fcafb,_0x3faf98,_0x7e8140[_0xfd83('0xb2')],_0x1e524f[_0xfd83('0xb2')],_0x4ea268));}}});return Promise['all'](_0x3833fe);})[_0xfd83('0x1c')](function(_0x5a6ee5){_0x3e7d4e=_0x5a6ee5[0x0];var _0x3243eb=_0x214fe1[_0xfd83('0xc5')](_0x17f767)[_0xfd83('0xc5')](_0x3e7d4e);var _0x1a1eb6={'count':_0x3243eb['length'],'rows':_0x3243eb};return _0x1a1eb6;})[_0xfd83('0x1c')](respondWithResult(_0x21cc99,null))[_0xfd83('0x26')](function(_0x1e5921){console['log'](_0xfd83('0xc6')+_0x1e5921);var _0x43e21e=_0x2b16d5[_0xfd83('0x3a')][_0xfd83('0xc7')]?0x1f4:_0x1e5921[_0xfd83('0xc8')]||0x1f4;logger[_0xfd83('0x22')](_0x1e5921[_0xfd83('0xc9')]);delete _0x1e5921[_0xfd83('0x34')];if(_0x43e21e===0x191){_0x43e21e=0x190;}_0x21cc99[_0xfd83('0x28')](_0x43e21e)[_0xfd83('0x35')](_0x2b16d5['query']['test']?{'message':_0xfd83('0xca'),'statusCode':_0x1e5921[_0xfd83('0xc8')]}:_0x1e5921);});};function getSelectList(_0x18a128,_0x2a1f27,_0xa401c3,_0x548a6d,_0x3e7a68,_0x274f08){var _0x278d83={'method':'GET','uri':_0x18a128+'EntityDefinitions('+_0x548a6d+_0xfd83('0xcb')+_0x3e7a68+_0xfd83('0xcc')+_0xfd83('0xcd'),'headers':{'Authorization':_0xfd83('0xaf')+_0x274f08,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x278d83)[_0xfd83('0x1c')](function(_0x458b20){var _0x4629dc=[];var _0x12d5bc=_0x458b20['OptionSet'][_0xfd83('0xce')];_0x12d5bc[_0xfd83('0xb8')](function(_0x269195){_0x4629dc[_0xfd83('0xbc')]({'name':_0x269195['Label']['UserLocalizedLabel'][_0xfd83('0xcf')],'value':String(_0x269195[_0xfd83('0xd0')])});});var _0x434553={'id':_0x2a1f27+'_'+_0x458b20[_0xfd83('0xb7')],'name':_0x458b20['DisplayName']['UserLocalizedLabel'][_0xfd83('0xcf')],'custom':![],'options':_0x4629dc};_0xa401c3[_0xfd83('0xbc')](_0x434553);return _0xa401c3;});}function getBooleanList(_0x30f822,_0xe8af18,_0x53d684,_0xc6ad5d,_0xc72639,_0x1e6491){var _0x28dc83={'method':_0xfd83('0xad'),'uri':_0x30f822+_0xfd83('0xb3')+_0xc6ad5d+_0xfd83('0xcb')+_0xc72639+_0xfd83('0xd1'),'headers':{'Authorization':_0xfd83('0xaf')+_0x1e6491,'If-None-Match':null,'OData-Version':_0xfd83('0xb0')},'json':!![]};return rp(_0x28dc83)[_0xfd83('0x1c')](function(_0x416c60){var _0x53735e=[];_0x53735e[_0xfd83('0xbc')]({'name':_0x416c60['OptionSet'][_0xfd83('0xd2')][_0xfd83('0xcf')]['UserLocalizedLabel'][_0xfd83('0xcf')],'value':_0xfd83('0xd3')},{'name':_0x416c60['OptionSet'][_0xfd83('0xd4')]['Label'][_0xfd83('0xd5')][_0xfd83('0xcf')],'value':_0xfd83('0xd6')});var _0x2a46e3={'id':_0xe8af18+'_'+_0x416c60[_0xfd83('0xb7')],'name':_0x416c60[_0xfd83('0xd7')][_0xfd83('0xd5')][_0xfd83('0xcf')],'custom':![],'options':_0x53735e};_0x53d684['push'](_0x2a46e3);return _0x53d684;});}function getInputList(_0x8bec63,_0x4e3957,_0x1adaeb,_0x2e1770,_0x256e36,_0x1c4d58,_0x1e6b64){var _0xf4802a={'method':_0xfd83('0xad'),'uri':_0x8bec63+_0xfd83('0xb3')+_0x256e36+_0xfd83('0xcb')+_0x1c4d58+_0xfd83('0xd8')+_0x1adaeb+_0xfd83('0xd9'),'headers':{'Authorization':_0xfd83('0xaf')+_0x1e6b64,'If-None-Match':null,'OData-Version':_0xfd83('0xb0')},'json':!![]};return rp(_0xf4802a)['then'](function(_0x3329ab){var _0x199b59={'id':_0x4e3957+'_'+_0x3329ab[_0xfd83('0xb7')],'name':_0x3329ab[_0xfd83('0xd7')][_0xfd83('0xd5')]?_0x3329ab[_0xfd83('0xd7')][_0xfd83('0xd5')][_0xfd83('0xcf')]:_0x3329ab[_0xfd83('0xb7')],'custom':![],'options':[]};_0x2e1770[_0xfd83('0xbc')](_0x199b59);return _0x2e1770;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e68c32d..b9f3b19 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 _0x0225=['Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','moment','bluebird','./intDynamics365Account.attributes','../../components/integrations/configuration','define'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0x0225,0x19c));var _0x5022=function(_0x12ef9a,_0x5dfbf7){_0x12ef9a=_0x12ef9a-0x0;var _0x3a6833=_0x0225[_0x12ef9a];return _0x3a6833;};'use strict';var _=require(_0x5022('0x0'));var util=require(_0x5022('0x1'));var logger=require(_0x5022('0x2'))('api');var moment=require(_0x5022('0x3'));var BPromise=require(_0x5022('0x4'));var rp=require('request-promise');var attributes=require(_0x5022('0x5'));var integrations=require(_0x5022('0x6'));module['exports']=function(_0x2165ec,_0x27e2ae){return _0x2165ec[_0x5022('0x7')](_0x5022('0x8'),attributes,{'tableName':_0x5022('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7db9=['moment','bluebird','request-promise','./intDynamics365Account.attributes','exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api'];(function(_0x182dfc,_0x4c8342){var _0x5573ee=function(_0x4c6e90){while(--_0x4c6e90){_0x182dfc['push'](_0x182dfc['shift']());}};_0x5573ee(++_0x4c8342);}(_0x7db9,0x6a));var _0x97db=function(_0x1bb9b7,_0x3dfe1d){_0x1bb9b7=_0x1bb9b7-0x0;var _0x7174ef=_0x7db9[_0x1bb9b7];return _0x7174ef;};'use strict';var _=require(_0x97db('0x0'));var util=require(_0x97db('0x1'));var logger=require(_0x97db('0x2'))(_0x97db('0x3'));var moment=require(_0x97db('0x4'));var BPromise=require(_0x97db('0x5'));var rp=require(_0x97db('0x6'));var attributes=require(_0x97db('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x97db('0x8')]=function(_0x4cf1dd,_0x5ad9c7){return _0x4cf1dd['define'](_0x97db('0x9'),attributes,{'tableName':_0x97db('0xa'),'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 124c662..a6bcaa2 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 _0xdff8=['message','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetDynamics365Account','catch','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x34e9c2,_0x4ed776){var _0x2506b1=function(_0x25dbf1){while(--_0x25dbf1){_0x34e9c2['push'](_0x34e9c2['shift']());}};_0x2506b1(++_0x4ed776);}(_0xdff8,0x1eb));var _0x8dff=function(_0x5bb207,_0x157700){_0x5bb207=_0x5bb207-0x0;var _0x4b198e=_0xdff8[_0x5bb207];return _0x4b198e;};'use strict';var _=require(_0x8dff('0x0'));var util=require(_0x8dff('0x1'));var moment=require(_0x8dff('0x2'));var BPromise=require(_0x8dff('0x3'));var rs=require(_0x8dff('0x4'));var fs=require('fs');var Redis=require(_0x8dff('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dff('0x6'));var logger=require(_0x8dff('0x7'))('rpc');var config=require(_0x8dff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8dff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ca5c,_0x43c062,_0x2621e0){return new BPromise(function(_0x4acb42,_0x42505d){return client[_0x8dff('0xa')](_0x41ca5c,_0x2621e0)[_0x8dff('0xb')](function(_0x4ac00d){logger[_0x8dff('0xc')](_0x8dff('0xd'),_0x43c062,_0x8dff('0xe'));logger['debug'](_0x8dff('0xf'),_0x43c062,_0x8dff('0xe'),JSON[_0x8dff('0x10')](_0x4ac00d));if(_0x4ac00d[_0x8dff('0x11')]){if(_0x4ac00d['error'][_0x8dff('0x12')]===0x1f4){logger[_0x8dff('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x43c062,_0x4ac00d[_0x8dff('0x11')][_0x8dff('0x13')]);return _0x42505d(_0x4ac00d[_0x8dff('0x11')][_0x8dff('0x13')]);}logger[_0x8dff('0x11')](_0x8dff('0xd'),_0x43c062,_0x4ac00d[_0x8dff('0x11')][_0x8dff('0x13')]);return _0x4acb42(_0x4ac00d['error'][_0x8dff('0x13')]);}else{logger[_0x8dff('0xc')](_0x8dff('0xd'),_0x43c062,_0x8dff('0xe'));_0x4acb42(_0x4ac00d['result'][_0x8dff('0x13')]);}})['catch'](function(_0x5b27ba){logger[_0x8dff('0x11')](_0x8dff('0xd'),_0x43c062,_0x5b27ba);_0x42505d(_0x5b27ba);});});}exports['GetDynamics365Account']=function(_0x13f908){var _0x36748f=this;return new Promise(function(_0x18040f,_0x543080){return db[_0x8dff('0x14')][_0x8dff('0x15')]({'raw':_0x13f908[_0x8dff('0x16')]?_0x13f908['options'][_0x8dff('0x17')]===undefined?!![]:![]:!![],'where':_0x13f908[_0x8dff('0x16')]?_0x13f908[_0x8dff('0x16')][_0x8dff('0x18')]||null:null,'attributes':_0x13f908[_0x8dff('0x16')]?_0x13f908[_0x8dff('0x16')][_0x8dff('0x19')]||null:null,'limit':_0x13f908['options']?_0x13f908[_0x8dff('0x16')][_0x8dff('0x1a')]||null:null,'include':_0x13f908[_0x8dff('0x16')]?_0x13f908[_0x8dff('0x16')][_0x8dff('0x1b')]?_[_0x8dff('0x1c')](_0x13f908[_0x8dff('0x16')][_0x8dff('0x1b')],function(_0x41f576){return{'model':db[_0x41f576[_0x8dff('0x1d')]],'as':_0x41f576['as'],'attributes':_0x41f576['attributes'],'include':_0x41f576['include']?_[_0x8dff('0x1c')](_0x41f576[_0x8dff('0x1b')],function(_0x58eba3){return{'model':db[_0x58eba3['model']],'as':_0x58eba3['as'],'attributes':_0x58eba3[_0x8dff('0x19')],'include':_0x58eba3[_0x8dff('0x1b')]?_[_0x8dff('0x1c')](_0x58eba3[_0x8dff('0x1b')],function(_0x2f9618){return{'model':db[_0x2f9618[_0x8dff('0x1d')]],'as':_0x2f9618['as'],'attributes':_0x2f9618[_0x8dff('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8dff('0xb')](function(_0x2cc53b){logger[_0x8dff('0xc')]('GetDynamics365Account',_0x13f908);logger[_0x8dff('0x1e')](_0x8dff('0x1f'),_0x13f908,JSON[_0x8dff('0x10')](_0x2cc53b));_0x18040f(_0x2cc53b);})[_0x8dff('0x20')](function(_0x4d42ad){logger[_0x8dff('0x11')](_0x8dff('0x1f'),_0x4d42ad[_0x8dff('0x13')],_0x13f908);_0x543080(_0x36748f[_0x8dff('0x11')](0x1f4,_0x4d42ad[_0x8dff('0x13')]));});});};exports[_0x8dff('0x21')]=function(_0x810978){var _0x3213a5=this;return new Promise(function(_0x402d63,_0x36e069){return db[_0x8dff('0x14')]['find']({'raw':_0x810978['options']?_0x810978['options']['raw']===undefined?!![]:![]:!![],'where':_0x810978[_0x8dff('0x16')]?_0x810978[_0x8dff('0x16')]['where']||null:null,'attributes':_0x810978['options']?_0x810978['options'][_0x8dff('0x19')]||null:null,'include':_0x810978[_0x8dff('0x16')]?_0x810978[_0x8dff('0x16')][_0x8dff('0x1b')]?_['map'](_0x810978[_0x8dff('0x16')][_0x8dff('0x1b')],function(_0x4091da){return{'model':db[_0x4091da[_0x8dff('0x1d')]],'as':_0x4091da['as'],'attributes':_0x4091da[_0x8dff('0x19')],'include':_0x4091da['include']?_[_0x8dff('0x1c')](_0x4091da[_0x8dff('0x1b')],function(_0x35559f){return{'model':db[_0x35559f['model']],'as':_0x35559f['as'],'attributes':_0x35559f['attributes'],'include':_0x35559f[_0x8dff('0x1b')]?_[_0x8dff('0x1c')](_0x35559f[_0x8dff('0x1b')],function(_0x21b79f){return{'model':db[_0x21b79f[_0x8dff('0x1d')]],'as':_0x21b79f['as'],'attributes':_0x21b79f[_0x8dff('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37c721){logger[_0x8dff('0xc')]('ShowDynamics365Account',_0x810978);logger[_0x8dff('0x1e')](_0x8dff('0x21'),_0x810978,JSON['stringify'](_0x37c721));_0x402d63(_0x37c721);})['catch'](function(_0x4ce477){logger['error'](_0x8dff('0x21'),_0x4ce477[_0x8dff('0x13')],_0x810978);_0x36e069(_0x3213a5[_0x8dff('0x11')](0x1f4,_0x4ce477['message']));});});}; \ No newline at end of file +var _0x8a05=['request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','attributes','limit','include','map','model','find','where','ShowDynamics365Account','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a05,0xb4));var _0x58a0=function(_0x1d64c0,_0xd1b19a){_0x1d64c0=_0x1d64c0-0x0;var _0x579432=_0x8a05[_0x1d64c0];return _0x579432;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x58a0('0x0'));var rs=require(_0x58a0('0x1'));var fs=require('fs');var Redis=require(_0x58a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x58a0('0x3'))(_0x58a0('0x4'));var config=require(_0x58a0('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x58a0('0x6')][_0x58a0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476b8b,_0xdb0478,_0x5022af){return new BPromise(function(_0x58fba9,_0x4d620b){return client[_0x58a0('0x8')](_0x476b8b,_0x5022af)[_0x58a0('0x9')](function(_0x5824cf){logger[_0x58a0('0xa')](_0x58a0('0xb'),_0xdb0478,_0x58a0('0xc'));logger[_0x58a0('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0xdb0478,_0x58a0('0xc'),JSON[_0x58a0('0xe')](_0x5824cf));if(_0x5824cf[_0x58a0('0xf')]){if(_0x5824cf['error'][_0x58a0('0x10')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xdb0478,_0x5824cf['error'][_0x58a0('0x11')]);return _0x4d620b(_0x5824cf[_0x58a0('0xf')][_0x58a0('0x11')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xdb0478,_0x5824cf[_0x58a0('0xf')]['message']);return _0x58fba9(_0x5824cf[_0x58a0('0xf')][_0x58a0('0x11')]);}else{logger[_0x58a0('0xa')](_0x58a0('0xb'),_0xdb0478,_0x58a0('0xc'));_0x58fba9(_0x5824cf[_0x58a0('0x12')][_0x58a0('0x11')]);}})[_0x58a0('0x13')](function(_0x3e0c49){logger[_0x58a0('0xf')](_0x58a0('0xb'),_0xdb0478,_0x3e0c49);_0x4d620b(_0x3e0c49);});});}exports[_0x58a0('0x14')]=function(_0x39a069){var _0x2b6d8d=this;return new Promise(function(_0x4e5ac9,_0x195afd){return db[_0x58a0('0x15')][_0x58a0('0x16')]({'raw':_0x39a069[_0x58a0('0x17')]?_0x39a069[_0x58a0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39a069['options']?_0x39a069['options']['where']||null:null,'attributes':_0x39a069[_0x58a0('0x17')]?_0x39a069[_0x58a0('0x17')][_0x58a0('0x18')]||null:null,'limit':_0x39a069[_0x58a0('0x17')]?_0x39a069[_0x58a0('0x17')][_0x58a0('0x19')]||null:null,'include':_0x39a069[_0x58a0('0x17')]?_0x39a069[_0x58a0('0x17')][_0x58a0('0x1a')]?_[_0x58a0('0x1b')](_0x39a069[_0x58a0('0x17')][_0x58a0('0x1a')],function(_0x1dc677){return{'model':db[_0x1dc677[_0x58a0('0x1c')]],'as':_0x1dc677['as'],'attributes':_0x1dc677[_0x58a0('0x18')],'include':_0x1dc677[_0x58a0('0x1a')]?_[_0x58a0('0x1b')](_0x1dc677['include'],function(_0x3cbcf3){return{'model':db[_0x3cbcf3['model']],'as':_0x3cbcf3['as'],'attributes':_0x3cbcf3['attributes'],'include':_0x3cbcf3[_0x58a0('0x1a')]?_[_0x58a0('0x1b')](_0x3cbcf3['include'],function(_0xaa13d6){return{'model':db[_0xaa13d6[_0x58a0('0x1c')]],'as':_0xaa13d6['as'],'attributes':_0xaa13d6[_0x58a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x58a0('0x9')](function(_0x967fe8){logger[_0x58a0('0xa')](_0x58a0('0x14'),_0x39a069);logger[_0x58a0('0xd')]('GetDynamics365Account',_0x39a069,JSON[_0x58a0('0xe')](_0x967fe8));_0x4e5ac9(_0x967fe8);})['catch'](function(_0x230296){logger[_0x58a0('0xf')]('GetDynamics365Account',_0x230296[_0x58a0('0x11')],_0x39a069);_0x195afd(_0x2b6d8d[_0x58a0('0xf')](0x1f4,_0x230296[_0x58a0('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x38d000){var _0x11ad22=this;return new Promise(function(_0x5cb0a5,_0x469e90){return db[_0x58a0('0x15')][_0x58a0('0x1d')]({'raw':_0x38d000[_0x58a0('0x17')]?_0x38d000[_0x58a0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x38d000[_0x58a0('0x17')]?_0x38d000[_0x58a0('0x17')][_0x58a0('0x1e')]||null:null,'attributes':_0x38d000['options']?_0x38d000['options'][_0x58a0('0x18')]||null:null,'include':_0x38d000[_0x58a0('0x17')]?_0x38d000['options'][_0x58a0('0x1a')]?_[_0x58a0('0x1b')](_0x38d000['options'][_0x58a0('0x1a')],function(_0x3d309f){return{'model':db[_0x3d309f['model']],'as':_0x3d309f['as'],'attributes':_0x3d309f[_0x58a0('0x18')],'include':_0x3d309f['include']?_[_0x58a0('0x1b')](_0x3d309f[_0x58a0('0x1a')],function(_0x116fc6){return{'model':db[_0x116fc6[_0x58a0('0x1c')]],'as':_0x116fc6['as'],'attributes':_0x116fc6[_0x58a0('0x18')],'include':_0x116fc6[_0x58a0('0x1a')]?_[_0x58a0('0x1b')](_0x116fc6[_0x58a0('0x1a')],function(_0x433260){return{'model':db[_0x433260['model']],'as':_0x433260['as'],'attributes':_0x433260[_0x58a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x58a0('0x9')](function(_0x321877){logger[_0x58a0('0xa')]('ShowDynamics365Account',_0x38d000);logger[_0x58a0('0xd')](_0x58a0('0x1f'),_0x38d000,JSON[_0x58a0('0xe')](_0x321877));_0x5cb0a5(_0x321877);})[_0x58a0('0x13')](function(_0x4814c7){logger['error'](_0x58a0('0x1f'),_0x4814c7[_0x58a0('0x11')],_0x38d000);_0x469e90(_0x11ad22[_0x58a0('0xf')](0x1f4,_0x4814c7['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9d9cc39..5ded15c 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 _0x4de5=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','create'];(function(_0x22650c,_0x134946){var _0x2594c1=function(_0x3b9d88){while(--_0x3b9d88){_0x22650c['push'](_0x22650c['shift']());}};_0x2594c1(++_0x134946);}(_0x4de5,0x64));var _0x54de=function(_0xa9ddc9,_0x3bd521){_0xa9ddc9=_0xa9ddc9-0x0;var _0x2c0722=_0x4de5[_0xa9ddc9];return _0x2c0722;};'use strict';var multer=require(_0x54de('0x0'));var util=require(_0x54de('0x1'));var path=require(_0x54de('0x2'));var timeout=require(_0x54de('0x3'));var express=require(_0x54de('0x4'));var router=express[_0x54de('0x5')]();var auth=require(_0x54de('0x6'));var interaction=require(_0x54de('0x7'));var config=require(_0x54de('0x8'));var controller=require(_0x54de('0x9'));router['get']('/',auth[_0x54de('0xa')](),controller[_0x54de('0xb')]);router[_0x54de('0xc')](_0x54de('0xd'),auth[_0x54de('0xa')](),controller[_0x54de('0xe')]);router[_0x54de('0xc')](_0x54de('0xf'),auth[_0x54de('0xa')](),controller[_0x54de('0x10')]);router[_0x54de('0xc')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x54de('0x11')]);router[_0x54de('0xc')](_0x54de('0x12'),auth[_0x54de('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x54de('0xa')](),controller[_0x54de('0x13')]);router[_0x54de('0x14')](_0x54de('0xd'),auth[_0x54de('0xa')](),controller[_0x54de('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x54de('0x16')]);module[_0x54de('0x17')]=router; \ No newline at end of file +var _0xb116=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects'];(function(_0x370cd6,_0x4864ce){var _0x1b2592=function(_0x4d96e1){while(--_0x4d96e1){_0x370cd6['push'](_0x370cd6['shift']());}};_0x1b2592(++_0x4864ce);}(_0xb116,0x1ab));var _0x6b11=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xb116[_0x3da832];return _0xe602f2;};'use strict';var multer=require(_0x6b11('0x0'));var util=require(_0x6b11('0x1'));var path=require(_0x6b11('0x2'));var timeout=require(_0x6b11('0x3'));var express=require(_0x6b11('0x4'));var router=express[_0x6b11('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6b11('0x6'));var controller=require(_0x6b11('0x7'));router[_0x6b11('0x8')]('/',auth[_0x6b11('0x9')](),controller[_0x6b11('0xa')]);router[_0x6b11('0x8')]('/:id',auth[_0x6b11('0x9')](),controller['show']);router[_0x6b11('0x8')](_0x6b11('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x6b11('0x8')](_0x6b11('0xc'),auth[_0x6b11('0x9')](),controller[_0x6b11('0xd')]);router['get'](_0x6b11('0xe'),auth[_0x6b11('0x9')](),controller[_0x6b11('0xf')]);router[_0x6b11('0x10')]('/',auth[_0x6b11('0x9')](),controller[_0x6b11('0x11')]);router[_0x6b11('0x12')](_0x6b11('0x13'),auth[_0x6b11('0x9')](),controller['update']);router[_0x6b11('0x14')](_0x6b11('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b11('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 423cc8b..9dfc892 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 _0x9823=['sequelize','exports','STRING','phonecall'];(function(_0x5a3848,_0x2da184){var _0x4d212e=function(_0x1b27d8){while(--_0x1b27d8){_0x5a3848['push'](_0x5a3848['shift']());}};_0x4d212e(++_0x2da184);}(_0x9823,0x1cc));var _0x3982=function(_0x4c0086,_0x478e47){_0x4c0086=_0x4c0086-0x0;var _0x8ee5d8=_0x9823[_0x4c0086];return _0x8ee5d8;};'use strict';var Sequelize=require(_0x3982('0x0'));module[_0x3982('0x1')]={'name':{'type':Sequelize[_0x3982('0x2')]},'description':{'type':Sequelize[_0x3982('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x3982('0x3')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x0002=['sequelize','exports','STRING','ENUM','phonecall','incident'];(function(_0x58b7d8,_0x3f4b90){var _0x20a536=function(_0x31c425){while(--_0x31c425){_0x58b7d8['push'](_0x58b7d8['shift']());}};_0x20a536(++_0x3f4b90);}(_0x0002,0x90));var _0x2000=function(_0x5689fc,_0x178eb6){_0x5689fc=_0x5689fc-0x0;var _0x27b4b3=_0x0002[_0x5689fc];return _0x27b4b3;};'use strict';var Sequelize=require(_0x2000('0x0'));module[_0x2000('0x1')]={'name':{'type':Sequelize[_0x2000('0x2')]},'description':{'type':Sequelize[_0x2000('0x2')]},'ticketType':{'type':Sequelize[_0x2000('0x3')]('incident',_0x2000('0x4')),'defaultValue':_0x2000('0x5')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a08493e..94e01d4 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 _0x5a13=['stringify','error','code','message','result','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','filter','key','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','find','create','body','findOne','Dynamics365Field','sort','pick','map','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','api','../../config/utils','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x5a13,0x145));var _0x35a1=function(_0x4a7c91,_0x764f04){_0x4a7c91=_0x4a7c91-0x0;var _0x539445=_0x5a13[_0x4a7c91];return _0x539445;};'use strict';var pdf=require(_0x35a1('0x0'));var emlformat=require(_0x35a1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35a1('0x2'));var jsonpatch=require(_0x35a1('0x3'));var rp=require(_0x35a1('0x4'));var moment=require(_0x35a1('0x5'));var BPromise=require(_0x35a1('0x6'));var Mustache=require(_0x35a1('0x7'));var util=require(_0x35a1('0x8'));var path=require(_0x35a1('0x9'));var sox=require(_0x35a1('0xa'));var csv=require(_0x35a1('0xb'));var ejs=require(_0x35a1('0xc'));var fs=require('fs');var _=require(_0x35a1('0xd'));var squel=require(_0x35a1('0xe'));var crypto=require(_0x35a1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35a1('0x10'));var Papa=require(_0x35a1('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x35a1('0x12'));var Redis=require(_0x35a1('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x35a1('0x14'));var utils=require(_0x35a1('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x35a1('0x16'));var client=jayson['client'][_0x35a1('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x572c66,_0x21098a,_0x17be2a,_0x395aef){return new BPromise(function(_0x28a180,_0x1f57bf){var _0xa149d0=_0x395aef||client;return _0xa149d0[_0x35a1('0x18')](_0x572c66,_0x17be2a)[_0x35a1('0x19')](function(_0x1a2627){logger[_0x35a1('0x1a')](_0x35a1('0x1b'),_0x21098a,_0x35a1('0x1c'));logger[_0x35a1('0x1d')](_0x35a1('0x1e'),_0x21098a,_0x35a1('0x1c'),JSON[_0x35a1('0x1f')](_0x1a2627));if(_0x1a2627[_0x35a1('0x20')]){if(_0x1a2627[_0x35a1('0x20')][_0x35a1('0x21')]===0x1f4){logger[_0x35a1('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x21098a,_0x1a2627[_0x35a1('0x20')][_0x35a1('0x22')]);return _0x1f57bf(_0x1a2627[_0x35a1('0x20')][_0x35a1('0x22')]);}logger[_0x35a1('0x20')](_0x35a1('0x1b'),_0x21098a,_0x1a2627[_0x35a1('0x20')][_0x35a1('0x22')]);return _0x28a180(_0x1a2627[_0x35a1('0x20')]['message']);}else{logger[_0x35a1('0x1a')](_0x35a1('0x1b'),_0x21098a,'request\x20sent');_0x28a180(_0x1a2627[_0x35a1('0x23')][_0x35a1('0x22')]);}})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x1b'),_0x21098a,_0xc13bad);_0x1f57bf(_0xc13bad);});});}function respondWithStatusCode(_0x1bca05,_0x329054){_0x329054=_0x329054||0xcc;return function(_0x5e42cf){if(_0x5e42cf){return _0x1bca05[_0x35a1('0x24')](_0x329054);}return _0x1bca05[_0x35a1('0x25')](_0x329054)['end']();};}function respondWithResult(_0x4c41ce,_0x5303b4){_0x5303b4=_0x5303b4||0xc8;return function(_0x35ad8a){if(_0x35ad8a){return _0x4c41ce['status'](_0x5303b4)['json'](_0x35ad8a);}};}function respondWithFilteredResult(_0x52d22b,_0x2ee03c){return function(_0x288a0d){if(_0x288a0d){var _0x39248b=_0x288a0d[_0x35a1('0x26')],_0x3f1563=_0x2ee03c[_0x35a1('0x27')],_0x536394=_0x2ee03c[_0x35a1('0x27')]+_0x2ee03c[_0x35a1('0x28')],_0x39cc91;if(_0x536394>=_0x39248b){_0x536394=_0x39248b;_0x39cc91=0xc8;}else{_0x39cc91=0xce;}_0x52d22b[_0x35a1('0x25')](_0x39cc91);return _0x52d22b[_0x35a1('0x29')](_0x35a1('0x2a'),_0x3f1563+'-'+_0x536394+'/'+_0x39248b)[_0x35a1('0x2b')](_0x288a0d);}return null;};}function patchUpdates(_0x381bcc){return function(_0x83a000){try{jsonpatch[_0x35a1('0x2c')](_0x83a000,_0x381bcc,!![]);}catch(_0xacadf2){return BPromise[_0x35a1('0x2d')](_0xacadf2);}return _0x83a000[_0x35a1('0x2e')]();};}function saveUpdates(_0x4b74b3,_0x9720a4){return function(_0x379819){if(_0x379819){return _0x379819[_0x35a1('0x2f')](_0x4b74b3)[_0x35a1('0x19')](function(_0x4382f4){return _0x4382f4;});}return null;};}function removeEntity(_0x2afa9c,_0x2f8e43){return function(_0x2dc636){if(_0x2dc636){return _0x2dc636[_0x35a1('0x30')]()[_0x35a1('0x19')](function(){_0x2afa9c[_0x35a1('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x581740,_0x351894){return function(_0x5e1dad){if(!_0x5e1dad){_0x581740[_0x35a1('0x24')](0x194);}return _0x5e1dad;};}function handleError(_0x5756bb,_0x8c37b0){_0x8c37b0=_0x8c37b0||0x1f4;return function(_0x1bfe2d){logger[_0x35a1('0x20')](_0x1bfe2d[_0x35a1('0x31')]);if(_0x1bfe2d[_0x35a1('0x32')]){delete _0x1bfe2d[_0x35a1('0x32')];}_0x5756bb[_0x35a1('0x25')](_0x8c37b0)[_0x35a1('0x33')](_0x1bfe2d);};}exports[_0x35a1('0x34')]=function(_0x44ed30,_0x25d757){var _0x4a4903={},_0x227856={},_0x2f5248={'count':0x0,'rows':[]};var _0x181e85=db['Dynamics365Configuration']['rawAttributes'];_0x227856['model']=_['keys'](_0x181e85);_0x227856['query']=_['keys'](_0x44ed30[_0x35a1('0x35')]);_0x227856[_0x35a1('0x36')]=_[_0x35a1('0x37')](_0x227856[_0x35a1('0x38')],_0x227856[_0x35a1('0x35')]);_0x4a4903[_0x35a1('0x39')]=_[_0x35a1('0x37')](_0x227856[_0x35a1('0x38')],qs['fields'](_0x44ed30[_0x35a1('0x35')]['fields']));_0x4a4903[_0x35a1('0x39')]=_0x4a4903[_0x35a1('0x39')][_0x35a1('0x3a')]?_0x4a4903[_0x35a1('0x39')]:_0x227856[_0x35a1('0x38')];if(!_0x44ed30['query'][_0x35a1('0x3b')](_0x35a1('0x3c'))){_0x4a4903[_0x35a1('0x28')]=qs['limit'](_0x44ed30['query'][_0x35a1('0x28')]);_0x4a4903[_0x35a1('0x27')]=qs[_0x35a1('0x27')](_0x44ed30[_0x35a1('0x35')]['offset']);}_0x4a4903[_0x35a1('0x3d')]=qs['sort'](_0x44ed30[_0x35a1('0x35')]['sort']);_0x4a4903[_0x35a1('0x3e')]=qs[_0x35a1('0x36')](_['pick'](_0x44ed30['query'],_0x227856[_0x35a1('0x36')]));if(_0x44ed30['query'][_0x35a1('0x3f')]){_0x4a4903[_0x35a1('0x3e')]=_['merge'](_0x4a4903[_0x35a1('0x3e')],{'$or':_['map'](_0x181e85,function(_0xb1c14c){if(_0xb1c14c['type'][_0x35a1('0x40')]!=='VIRTUAL'){var _0x1a3434={};_0x1a3434[_0xb1c14c['field']]={'$like':'%'+_0x44ed30[_0x35a1('0x35')]['filter']+'%'};return _0x1a3434;}})});}_0x4a4903=_[_0x35a1('0x41')]({},_0x4a4903,_0x44ed30[_0x35a1('0x42')]);var _0x2d537f={'where':_0x4a4903[_0x35a1('0x3e')]};return db[_0x35a1('0x43')][_0x35a1('0x26')](_0x2d537f)[_0x35a1('0x19')](function(_0x52b925){_0x2f5248[_0x35a1('0x26')]=_0x52b925;if(_0x44ed30[_0x35a1('0x35')][_0x35a1('0x44')]){_0x4a4903[_0x35a1('0x45')]=[{'all':!![]}];}return db[_0x35a1('0x43')][_0x35a1('0x46')](_0x4a4903);})['then'](function(_0x263c46){_0x2f5248[_0x35a1('0x47')]=_0x263c46;return _0x2f5248;})[_0x35a1('0x19')](respondWithFilteredResult(_0x25d757,_0x4a4903))[_0x35a1('0x48')](handleError(_0x25d757,null));};exports[_0x35a1('0x49')]=function(_0x5dfd73,_0x2d484c){var _0x23d60a={'raw':![],'where':{'id':_0x5dfd73[_0x35a1('0x4a')]['id']}},_0xfe70be={};_0xfe70be['model']=_[_0x35a1('0x4b')](db[_0x35a1('0x43')][_0x35a1('0x4c')]);_0xfe70be[_0x35a1('0x35')]=_[_0x35a1('0x4b')](_0x5dfd73[_0x35a1('0x35')]);_0xfe70be[_0x35a1('0x36')]=_['intersection'](_0xfe70be['model'],_0xfe70be[_0x35a1('0x35')]);_0x23d60a[_0x35a1('0x39')]=_[_0x35a1('0x37')](_0xfe70be[_0x35a1('0x38')],qs['fields'](_0x5dfd73['query'][_0x35a1('0x4d')]));_0x23d60a[_0x35a1('0x39')]=_0x23d60a[_0x35a1('0x39')][_0x35a1('0x3a')]?_0x23d60a['attributes']:_0xfe70be['model'];if(_0x5dfd73['query'][_0x35a1('0x44')]){_0x23d60a['include']=[{'all':!![]}];}_0x23d60a=_[_0x35a1('0x41')]({},_0x23d60a,_0x5dfd73[_0x35a1('0x42')]);return db[_0x35a1('0x43')][_0x35a1('0x4e')](_0x23d60a)[_0x35a1('0x19')](handleEntityNotFound(_0x2d484c,null))[_0x35a1('0x19')](respondWithResult(_0x2d484c,null))[_0x35a1('0x48')](handleError(_0x2d484c,null));};exports[_0x35a1('0x4f')]=function(_0x55885c,_0x2e35a7){return db[_0x35a1('0x43')][_0x35a1('0x4f')](_0x55885c['body'],{})['then'](respondWithResult(_0x2e35a7,0xc9))['catch'](handleError(_0x2e35a7,null));};exports['update']=function(_0x657764,_0x3739e2){if(_0x657764[_0x35a1('0x50')]['id']){delete _0x657764[_0x35a1('0x50')]['id'];}return db[_0x35a1('0x43')][_0x35a1('0x4e')]({'where':{'id':_0x657764[_0x35a1('0x4a')]['id']}})[_0x35a1('0x19')](handleEntityNotFound(_0x3739e2,null))[_0x35a1('0x19')](saveUpdates(_0x657764[_0x35a1('0x50')],null))['then'](respondWithResult(_0x3739e2,null))[_0x35a1('0x48')](handleError(_0x3739e2,null));};exports[_0x35a1('0x30')]=function(_0xc50c62,_0x569da7){return db['Dynamics365Configuration'][_0x35a1('0x4e')]({'where':{'id':_0xc50c62['params']['id']}})[_0x35a1('0x19')](handleEntityNotFound(_0x569da7,null))[_0x35a1('0x19')](removeEntity(_0x569da7,null))[_0x35a1('0x48')](handleError(_0x569da7,null));};exports['getFields']=function(_0x4b9f4e,_0x6d22a1,_0x53f695){var _0x4cd372={};var _0x57e8bc={};var _0x4b3e29;var _0x1cec5e;return db[_0x35a1('0x43')][_0x35a1('0x51')]({'where':{'id':_0x4b9f4e[_0x35a1('0x4a')]['id']}})[_0x35a1('0x19')](handleEntityNotFound(_0x6d22a1,null))[_0x35a1('0x19')](function(_0x152572){if(_0x152572){_0x4b3e29=_0x152572;_0x57e8bc[_0x35a1('0x38')]=_[_0x35a1('0x4b')](db[_0x35a1('0x52')][_0x35a1('0x4c')]);_0x57e8bc['query']=_[_0x35a1('0x4b')](_0x4b9f4e[_0x35a1('0x35')]);_0x57e8bc[_0x35a1('0x36')]=_['intersection'](_0x57e8bc[_0x35a1('0x38')],_0x57e8bc[_0x35a1('0x35')]);_0x4cd372[_0x35a1('0x39')]=_[_0x35a1('0x37')](_0x57e8bc[_0x35a1('0x38')],qs[_0x35a1('0x4d')](_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x4d')]));_0x4cd372[_0x35a1('0x39')]=_0x4cd372[_0x35a1('0x39')][_0x35a1('0x3a')]?_0x4cd372[_0x35a1('0x39')]:_0x57e8bc['model'];_0x4cd372[_0x35a1('0x3d')]=qs[_0x35a1('0x53')](_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x53')]);_0x4cd372['where']=qs['filters'](_[_0x35a1('0x54')](_0x4b9f4e[_0x35a1('0x35')],_0x57e8bc[_0x35a1('0x36')]));if(_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x3f')]){_0x4cd372[_0x35a1('0x3e')]=_[_0x35a1('0x41')](_0x4cd372['where'],{'$or':_[_0x35a1('0x55')](_0x4cd372['attributes'],function(_0x5b4da1){var _0x3d2e20={};_0x3d2e20[_0x5b4da1]={'$like':'%'+_0x4b9f4e[_0x35a1('0x35')]['filter']+'%'};return _0x3d2e20;})});}_0x4cd372=_['merge']({},_0x4cd372,_0x4b9f4e[_0x35a1('0x42')]);return _0x4b3e29[_0x35a1('0x56')](_0x4cd372);}})[_0x35a1('0x19')](function(_0xa76800){if(_0xa76800){_0x1cec5e=_0xa76800[_0x35a1('0x3a')];if(!_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x3b')](_0x35a1('0x3c'))){_0x4cd372['limit']=qs[_0x35a1('0x28')](_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x28')]);_0x4cd372[_0x35a1('0x27')]=qs[_0x35a1('0x27')](_0x4b9f4e[_0x35a1('0x35')][_0x35a1('0x27')]);}return _0x4b3e29[_0x35a1('0x56')](_0x4cd372);}})[_0x35a1('0x19')](function(_0x29ac46){if(_0x29ac46){return _0x29ac46?{'count':_0x1cec5e,'rows':_0x29ac46}:null;}})[_0x35a1('0x19')](respondWithResult(_0x6d22a1,null))['catch'](handleError(_0x6d22a1,null));};exports[_0x35a1('0x57')]=function(_0xa3f089,_0x51b1b9,_0x469cb8){var _0x351af5={};var _0x261acb={};var _0x10a5d3;var _0x1a76cb;return db[_0x35a1('0x43')][_0x35a1('0x51')]({'where':{'id':_0xa3f089[_0x35a1('0x4a')]['id']}})[_0x35a1('0x19')](handleEntityNotFound(_0x51b1b9,null))['then'](function(_0x5b3117){if(_0x5b3117){_0x10a5d3=_0x5b3117;_0x261acb[_0x35a1('0x38')]=_[_0x35a1('0x4b')](db[_0x35a1('0x52')][_0x35a1('0x4c')]);_0x261acb['query']=_[_0x35a1('0x4b')](_0xa3f089[_0x35a1('0x35')]);_0x261acb[_0x35a1('0x36')]=_[_0x35a1('0x37')](_0x261acb[_0x35a1('0x38')],_0x261acb[_0x35a1('0x35')]);_0x351af5[_0x35a1('0x39')]=_[_0x35a1('0x37')](_0x261acb[_0x35a1('0x38')],qs[_0x35a1('0x4d')](_0xa3f089[_0x35a1('0x35')]['fields']));_0x351af5[_0x35a1('0x39')]=_0x351af5[_0x35a1('0x39')]['length']?_0x351af5[_0x35a1('0x39')]:_0x261acb[_0x35a1('0x38')];_0x351af5[_0x35a1('0x3d')]=qs[_0x35a1('0x53')](_0xa3f089['query'][_0x35a1('0x53')]);_0x351af5[_0x35a1('0x3e')]=qs[_0x35a1('0x36')](_[_0x35a1('0x54')](_0xa3f089[_0x35a1('0x35')],_0x261acb[_0x35a1('0x36')]));if(_0xa3f089[_0x35a1('0x35')][_0x35a1('0x3f')]){_0x351af5[_0x35a1('0x3e')]=_['merge'](_0x351af5['where'],{'$or':_['map'](_0x351af5[_0x35a1('0x39')],function(_0xb063e8){var _0x76c11b={};_0x76c11b[_0xb063e8]={'$like':'%'+_0xa3f089[_0x35a1('0x35')][_0x35a1('0x3f')]+'%'};return _0x76c11b;})});}_0x351af5=_[_0x35a1('0x41')]({},_0x351af5,_0xa3f089['options']);return _0x10a5d3['getSubjects'](_0x351af5);}})[_0x35a1('0x19')](function(_0xa33eb){if(_0xa33eb){_0x1a76cb=_0xa33eb[_0x35a1('0x3a')];if(!_0xa3f089['query'][_0x35a1('0x3b')](_0x35a1('0x3c'))){_0x351af5[_0x35a1('0x28')]=qs[_0x35a1('0x28')](_0xa3f089['query']['limit']);_0x351af5[_0x35a1('0x27')]=qs[_0x35a1('0x27')](_0xa3f089['query'][_0x35a1('0x27')]);}return _0x10a5d3[_0x35a1('0x57')](_0x351af5);}})[_0x35a1('0x19')](function(_0x16f59b){if(_0x16f59b){return _0x16f59b?{'count':_0x1a76cb,'rows':_0x16f59b}:null;}})['then'](respondWithResult(_0x51b1b9,null))[_0x35a1('0x48')](handleError(_0x51b1b9,null));};exports[_0x35a1('0x58')]=function(_0x4f605a,_0x198cf7,_0x32f8fe){var _0x10c9ed={};var _0x4f2dcf={};var _0x3c40df;var _0x754431;return db[_0x35a1('0x43')][_0x35a1('0x51')]({'where':{'id':_0x4f605a[_0x35a1('0x4a')]['id']}})[_0x35a1('0x19')](handleEntityNotFound(_0x198cf7,null))[_0x35a1('0x19')](function(_0x3f6886){if(_0x3f6886){_0x3c40df=_0x3f6886;_0x4f2dcf[_0x35a1('0x38')]=_[_0x35a1('0x4b')](db[_0x35a1('0x52')][_0x35a1('0x4c')]);_0x4f2dcf[_0x35a1('0x35')]=_[_0x35a1('0x4b')](_0x4f605a[_0x35a1('0x35')]);_0x4f2dcf[_0x35a1('0x36')]=_['intersection'](_0x4f2dcf[_0x35a1('0x38')],_0x4f2dcf['query']);_0x10c9ed[_0x35a1('0x39')]=_[_0x35a1('0x37')](_0x4f2dcf['model'],qs[_0x35a1('0x4d')](_0x4f605a['query']['fields']));_0x10c9ed['attributes']=_0x10c9ed[_0x35a1('0x39')][_0x35a1('0x3a')]?_0x10c9ed['attributes']:_0x4f2dcf[_0x35a1('0x38')];_0x10c9ed[_0x35a1('0x3d')]=qs[_0x35a1('0x53')](_0x4f605a[_0x35a1('0x35')][_0x35a1('0x53')]);_0x10c9ed[_0x35a1('0x3e')]=qs[_0x35a1('0x36')](_[_0x35a1('0x54')](_0x4f605a[_0x35a1('0x35')],_0x4f2dcf[_0x35a1('0x36')]));if(_0x4f605a['query'][_0x35a1('0x3f')]){_0x10c9ed['where']=_[_0x35a1('0x41')](_0x10c9ed[_0x35a1('0x3e')],{'$or':_[_0x35a1('0x55')](_0x10c9ed[_0x35a1('0x39')],function(_0x38d8c1){var _0x2687cb={};_0x2687cb[_0x38d8c1]={'$like':'%'+_0x4f605a[_0x35a1('0x35')][_0x35a1('0x3f')]+'%'};return _0x2687cb;})});}_0x10c9ed=_[_0x35a1('0x41')]({},_0x10c9ed,_0x4f605a[_0x35a1('0x42')]);return _0x3c40df[_0x35a1('0x58')](_0x10c9ed);}})[_0x35a1('0x19')](function(_0x12337b){if(_0x12337b){_0x754431=_0x12337b['length'];if(!_0x4f605a['query'][_0x35a1('0x3b')]('nolimit')){_0x10c9ed[_0x35a1('0x28')]=qs[_0x35a1('0x28')](_0x4f605a[_0x35a1('0x35')][_0x35a1('0x28')]);_0x10c9ed['offset']=qs['offset'](_0x4f605a['query'][_0x35a1('0x27')]);}return _0x3c40df[_0x35a1('0x58')](_0x10c9ed);}})[_0x35a1('0x19')](function(_0x33fa71){if(_0x33fa71){return _0x33fa71?{'count':_0x754431,'rows':_0x33fa71}:null;}})[_0x35a1('0x19')](respondWithResult(_0x198cf7,null))[_0x35a1('0x48')](handleError(_0x198cf7,null));}; \ No newline at end of file +var _0x5c3c=['Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','merge','where','type','key','VIRTUAL','field','options','count','include','findAll','rows','show','params','includeAll','create','body','find','getFields','findOne','Dynamics365Field','rawAttributes','pick','filter','map','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','json','save','update','then','destroy','end','stack','name'];(function(_0xcd0f43,_0x5aefd6){var _0x360dbf=function(_0x3d6056){while(--_0x3d6056){_0xcd0f43['push'](_0xcd0f43['shift']());}};_0x360dbf(++_0x5aefd6);}(_0x5c3c,0x132));var _0xc5c3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5c3c[_0x122096];return _0x3d1966;};'use strict';var pdf=require(_0xc5c3('0x0'));var emlformat=require(_0xc5c3('0x1'));var rimraf=require(_0xc5c3('0x2'));var zipdir=require(_0xc5c3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5c3('0x4'));var moment=require(_0xc5c3('0x5'));var BPromise=require(_0xc5c3('0x6'));var Mustache=require(_0xc5c3('0x7'));var util=require(_0xc5c3('0x8'));var path=require(_0xc5c3('0x9'));var sox=require(_0xc5c3('0xa'));var csv=require(_0xc5c3('0xb'));var ejs=require(_0xc5c3('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc5c3('0x11'));var Redis=require(_0xc5c3('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xc5c3('0x13'))(_0xc5c3('0x14'));var utils=require(_0xc5c3('0x15'));var config=require('../../config/environment');var db=require(_0xc5c3('0x16'))['db'];var jayson=require(_0xc5c3('0x17'));var client=jayson['client'][_0xc5c3('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x44d2b9,_0x3f0f45,_0x5ce47d,_0x2042a0){return new BPromise(function(_0x54fa08,_0x1488ab){var _0x13a740=_0x2042a0||client;return _0x13a740[_0xc5c3('0x19')](_0x44d2b9,_0x5ce47d)['then'](function(_0x5c0341){logger[_0xc5c3('0x1a')](_0xc5c3('0x1b'),_0x3f0f45,_0xc5c3('0x1c'));logger[_0xc5c3('0x1d')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3f0f45,'request\x20sent',JSON[_0xc5c3('0x1e')](_0x5c0341));if(_0x5c0341['error']){if(_0x5c0341[_0xc5c3('0x1f')][_0xc5c3('0x20')]===0x1f4){logger[_0xc5c3('0x1f')](_0xc5c3('0x1b'),_0x3f0f45,_0x5c0341[_0xc5c3('0x1f')]['message']);return _0x1488ab(_0x5c0341[_0xc5c3('0x1f')][_0xc5c3('0x21')]);}logger[_0xc5c3('0x1f')](_0xc5c3('0x1b'),_0x3f0f45,_0x5c0341['error'][_0xc5c3('0x21')]);return _0x54fa08(_0x5c0341[_0xc5c3('0x1f')][_0xc5c3('0x21')]);}else{logger[_0xc5c3('0x1a')](_0xc5c3('0x1b'),_0x3f0f45,'request\x20sent');_0x54fa08(_0x5c0341[_0xc5c3('0x22')][_0xc5c3('0x21')]);}})[_0xc5c3('0x23')](function(_0x2de266){logger[_0xc5c3('0x1f')](_0xc5c3('0x1b'),_0x3f0f45,_0x2de266);_0x1488ab(_0x2de266);});});}function respondWithStatusCode(_0x40ebcc,_0x5996a0){_0x5996a0=_0x5996a0||0xcc;return function(_0x52d638){if(_0x52d638){return _0x40ebcc[_0xc5c3('0x24')](_0x5996a0);}return _0x40ebcc[_0xc5c3('0x25')](_0x5996a0)['end']();};}function respondWithResult(_0x5c7329,_0x23e2fb){_0x23e2fb=_0x23e2fb||0xc8;return function(_0x1591e3){if(_0x1591e3){return _0x5c7329[_0xc5c3('0x25')](_0x23e2fb)['json'](_0x1591e3);}};}function respondWithFilteredResult(_0x4af067,_0x2df06b){return function(_0x22f607){if(_0x22f607){var _0x20c506=_0x22f607['count'],_0x29791c=_0x2df06b[_0xc5c3('0x26')],_0x5caf85=_0x2df06b['offset']+_0x2df06b[_0xc5c3('0x27')],_0x21efd6;if(_0x5caf85>=_0x20c506){_0x5caf85=_0x20c506;_0x21efd6=0xc8;}else{_0x21efd6=0xce;}_0x4af067[_0xc5c3('0x25')](_0x21efd6);return _0x4af067[_0xc5c3('0x28')](_0xc5c3('0x29'),_0x29791c+'-'+_0x5caf85+'/'+_0x20c506)[_0xc5c3('0x2a')](_0x22f607);}return null;};}function patchUpdates(_0x2d07e1){return function(_0x35a397){try{jsonpatch['apply'](_0x35a397,_0x2d07e1,!![]);}catch(_0xbcafd6){return BPromise['reject'](_0xbcafd6);}return _0x35a397[_0xc5c3('0x2b')]();};}function saveUpdates(_0x43ebfc,_0x5b26e9){return function(_0x4daa8b){if(_0x4daa8b){return _0x4daa8b[_0xc5c3('0x2c')](_0x43ebfc)[_0xc5c3('0x2d')](function(_0x66e83c){return _0x66e83c;});}return null;};}function removeEntity(_0x19e482,_0x52adcf){return function(_0x3f9591){if(_0x3f9591){return _0x3f9591[_0xc5c3('0x2e')]()[_0xc5c3('0x2d')](function(){_0x19e482[_0xc5c3('0x25')](0xcc)[_0xc5c3('0x2f')]();});}};}function handleEntityNotFound(_0x406968,_0xc1c851){return function(_0x1e6749){if(!_0x1e6749){_0x406968[_0xc5c3('0x24')](0x194);}return _0x1e6749;};}function handleError(_0x4b8be9,_0x340439){_0x340439=_0x340439||0x1f4;return function(_0x7fd66e){logger[_0xc5c3('0x1f')](_0x7fd66e[_0xc5c3('0x30')]);if(_0x7fd66e[_0xc5c3('0x31')]){delete _0x7fd66e[_0xc5c3('0x31')];}_0x4b8be9[_0xc5c3('0x25')](_0x340439)['send'](_0x7fd66e);};}exports['index']=function(_0x23635d,_0x55fccf){var _0x2b8d5c={},_0xa9c6c9={},_0x30a01e={'count':0x0,'rows':[]};var _0x15c656=db[_0xc5c3('0x32')]['rawAttributes'];_0xa9c6c9[_0xc5c3('0x33')]=_[_0xc5c3('0x34')](_0x15c656);_0xa9c6c9['query']=_[_0xc5c3('0x34')](_0x23635d[_0xc5c3('0x35')]);_0xa9c6c9[_0xc5c3('0x36')]=_[_0xc5c3('0x37')](_0xa9c6c9[_0xc5c3('0x33')],_0xa9c6c9[_0xc5c3('0x35')]);_0x2b8d5c[_0xc5c3('0x38')]=_[_0xc5c3('0x37')](_0xa9c6c9[_0xc5c3('0x33')],qs[_0xc5c3('0x39')](_0x23635d['query'][_0xc5c3('0x39')]));_0x2b8d5c['attributes']=_0x2b8d5c['attributes'][_0xc5c3('0x3a')]?_0x2b8d5c[_0xc5c3('0x38')]:_0xa9c6c9[_0xc5c3('0x33')];if(!_0x23635d[_0xc5c3('0x35')][_0xc5c3('0x3b')]('nolimit')){_0x2b8d5c['limit']=qs[_0xc5c3('0x27')](_0x23635d[_0xc5c3('0x35')]['limit']);_0x2b8d5c[_0xc5c3('0x26')]=qs['offset'](_0x23635d[_0xc5c3('0x35')][_0xc5c3('0x26')]);}_0x2b8d5c[_0xc5c3('0x3c')]=qs['sort'](_0x23635d[_0xc5c3('0x35')][_0xc5c3('0x3d')]);_0x2b8d5c['where']=qs[_0xc5c3('0x36')](_['pick'](_0x23635d[_0xc5c3('0x35')],_0xa9c6c9[_0xc5c3('0x36')]));if(_0x23635d['query']['filter']){_0x2b8d5c['where']=_[_0xc5c3('0x3e')](_0x2b8d5c[_0xc5c3('0x3f')],{'$or':_['map'](_0x15c656,function(_0x1a8490){if(_0x1a8490[_0xc5c3('0x40')][_0xc5c3('0x41')]!==_0xc5c3('0x42')){var _0x4ee078={};_0x4ee078[_0x1a8490[_0xc5c3('0x43')]]={'$like':'%'+_0x23635d['query']['filter']+'%'};return _0x4ee078;}})});}_0x2b8d5c=_[_0xc5c3('0x3e')]({},_0x2b8d5c,_0x23635d[_0xc5c3('0x44')]);var _0x55be1d={'where':_0x2b8d5c[_0xc5c3('0x3f')]};return db[_0xc5c3('0x32')]['count'](_0x55be1d)[_0xc5c3('0x2d')](function(_0x4ffc5a){_0x30a01e[_0xc5c3('0x45')]=_0x4ffc5a;if(_0x23635d[_0xc5c3('0x35')]['includeAll']){_0x2b8d5c[_0xc5c3('0x46')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xc5c3('0x47')](_0x2b8d5c);})[_0xc5c3('0x2d')](function(_0x4ce23a){_0x30a01e[_0xc5c3('0x48')]=_0x4ce23a;return _0x30a01e;})[_0xc5c3('0x2d')](respondWithFilteredResult(_0x55fccf,_0x2b8d5c))[_0xc5c3('0x23')](handleError(_0x55fccf,null));};exports[_0xc5c3('0x49')]=function(_0x450c46,_0x41dca5){var _0x5427b7={'raw':![],'where':{'id':_0x450c46[_0xc5c3('0x4a')]['id']}},_0x3e658b={};_0x3e658b[_0xc5c3('0x33')]=_[_0xc5c3('0x34')](db[_0xc5c3('0x32')]['rawAttributes']);_0x3e658b['query']=_[_0xc5c3('0x34')](_0x450c46[_0xc5c3('0x35')]);_0x3e658b[_0xc5c3('0x36')]=_['intersection'](_0x3e658b[_0xc5c3('0x33')],_0x3e658b[_0xc5c3('0x35')]);_0x5427b7[_0xc5c3('0x38')]=_[_0xc5c3('0x37')](_0x3e658b[_0xc5c3('0x33')],qs[_0xc5c3('0x39')](_0x450c46[_0xc5c3('0x35')]['fields']));_0x5427b7[_0xc5c3('0x38')]=_0x5427b7[_0xc5c3('0x38')][_0xc5c3('0x3a')]?_0x5427b7['attributes']:_0x3e658b[_0xc5c3('0x33')];if(_0x450c46[_0xc5c3('0x35')][_0xc5c3('0x4b')]){_0x5427b7[_0xc5c3('0x46')]=[{'all':!![]}];}_0x5427b7=_[_0xc5c3('0x3e')]({},_0x5427b7,_0x450c46['options']);return db[_0xc5c3('0x32')]['find'](_0x5427b7)[_0xc5c3('0x2d')](handleEntityNotFound(_0x41dca5,null))['then'](respondWithResult(_0x41dca5,null))[_0xc5c3('0x23')](handleError(_0x41dca5,null));};exports[_0xc5c3('0x4c')]=function(_0x4add6b,_0x325643){return db[_0xc5c3('0x32')]['create'](_0x4add6b[_0xc5c3('0x4d')],{})[_0xc5c3('0x2d')](respondWithResult(_0x325643,0xc9))[_0xc5c3('0x23')](handleError(_0x325643,null));};exports[_0xc5c3('0x2c')]=function(_0x453a73,_0x57c4a3){if(_0x453a73[_0xc5c3('0x4d')]['id']){delete _0x453a73[_0xc5c3('0x4d')]['id'];}return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x453a73[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57c4a3,null))['then'](saveUpdates(_0x453a73[_0xc5c3('0x4d')],null))[_0xc5c3('0x2d')](respondWithResult(_0x57c4a3,null))[_0xc5c3('0x23')](handleError(_0x57c4a3,null));};exports[_0xc5c3('0x2e')]=function(_0x45e79a,_0x315355){return db['Dynamics365Configuration'][_0xc5c3('0x4e')]({'where':{'id':_0x45e79a[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2d')](handleEntityNotFound(_0x315355,null))[_0xc5c3('0x2d')](removeEntity(_0x315355,null))[_0xc5c3('0x23')](handleError(_0x315355,null));};exports[_0xc5c3('0x4f')]=function(_0x3c3c50,_0x524aff,_0x59e765){var _0x1c6ef7={};var _0x16c26f={};var _0x57b1a8;var _0x3f1788;return db[_0xc5c3('0x32')][_0xc5c3('0x50')]({'where':{'id':_0x3c3c50[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x524aff,null))[_0xc5c3('0x2d')](function(_0x23a1f9){if(_0x23a1f9){_0x57b1a8=_0x23a1f9;_0x16c26f[_0xc5c3('0x33')]=_[_0xc5c3('0x34')](db[_0xc5c3('0x51')][_0xc5c3('0x52')]);_0x16c26f[_0xc5c3('0x35')]=_[_0xc5c3('0x34')](_0x3c3c50[_0xc5c3('0x35')]);_0x16c26f['filters']=_[_0xc5c3('0x37')](_0x16c26f[_0xc5c3('0x33')],_0x16c26f[_0xc5c3('0x35')]);_0x1c6ef7['attributes']=_[_0xc5c3('0x37')](_0x16c26f[_0xc5c3('0x33')],qs[_0xc5c3('0x39')](_0x3c3c50[_0xc5c3('0x35')][_0xc5c3('0x39')]));_0x1c6ef7['attributes']=_0x1c6ef7[_0xc5c3('0x38')][_0xc5c3('0x3a')]?_0x1c6ef7[_0xc5c3('0x38')]:_0x16c26f[_0xc5c3('0x33')];_0x1c6ef7[_0xc5c3('0x3c')]=qs[_0xc5c3('0x3d')](_0x3c3c50[_0xc5c3('0x35')]['sort']);_0x1c6ef7[_0xc5c3('0x3f')]=qs[_0xc5c3('0x36')](_[_0xc5c3('0x53')](_0x3c3c50[_0xc5c3('0x35')],_0x16c26f[_0xc5c3('0x36')]));if(_0x3c3c50[_0xc5c3('0x35')][_0xc5c3('0x54')]){_0x1c6ef7['where']=_['merge'](_0x1c6ef7[_0xc5c3('0x3f')],{'$or':_[_0xc5c3('0x55')](_0x1c6ef7[_0xc5c3('0x38')],function(_0x30ab45){var _0x1ed757={};_0x1ed757[_0x30ab45]={'$like':'%'+_0x3c3c50[_0xc5c3('0x35')][_0xc5c3('0x54')]+'%'};return _0x1ed757;})});}_0x1c6ef7=_[_0xc5c3('0x3e')]({},_0x1c6ef7,_0x3c3c50[_0xc5c3('0x44')]);return _0x57b1a8['getFields'](_0x1c6ef7);}})[_0xc5c3('0x2d')](function(_0x358b83){if(_0x358b83){_0x3f1788=_0x358b83['length'];if(!_0x3c3c50['query'][_0xc5c3('0x3b')](_0xc5c3('0x56'))){_0x1c6ef7[_0xc5c3('0x27')]=qs[_0xc5c3('0x27')](_0x3c3c50[_0xc5c3('0x35')][_0xc5c3('0x27')]);_0x1c6ef7[_0xc5c3('0x26')]=qs[_0xc5c3('0x26')](_0x3c3c50[_0xc5c3('0x35')]['offset']);}return _0x57b1a8[_0xc5c3('0x4f')](_0x1c6ef7);}})[_0xc5c3('0x2d')](function(_0xa4ecb4){if(_0xa4ecb4){return _0xa4ecb4?{'count':_0x3f1788,'rows':_0xa4ecb4}:null;}})[_0xc5c3('0x2d')](respondWithResult(_0x524aff,null))[_0xc5c3('0x23')](handleError(_0x524aff,null));};exports[_0xc5c3('0x57')]=function(_0x183f6b,_0x114c90,_0x22606a){var _0x31e280={};var _0x25d6ca={};var _0x5a79de;var _0x4ca6e6;return db[_0xc5c3('0x32')][_0xc5c3('0x50')]({'where':{'id':_0x183f6b[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2d')](handleEntityNotFound(_0x114c90,null))[_0xc5c3('0x2d')](function(_0x2da018){if(_0x2da018){_0x5a79de=_0x2da018;_0x25d6ca[_0xc5c3('0x33')]=_[_0xc5c3('0x34')](db[_0xc5c3('0x51')][_0xc5c3('0x52')]);_0x25d6ca[_0xc5c3('0x35')]=_[_0xc5c3('0x34')](_0x183f6b['query']);_0x25d6ca[_0xc5c3('0x36')]=_['intersection'](_0x25d6ca[_0xc5c3('0x33')],_0x25d6ca[_0xc5c3('0x35')]);_0x31e280[_0xc5c3('0x38')]=_[_0xc5c3('0x37')](_0x25d6ca[_0xc5c3('0x33')],qs[_0xc5c3('0x39')](_0x183f6b[_0xc5c3('0x35')][_0xc5c3('0x39')]));_0x31e280['attributes']=_0x31e280[_0xc5c3('0x38')][_0xc5c3('0x3a')]?_0x31e280[_0xc5c3('0x38')]:_0x25d6ca['model'];_0x31e280['order']=qs[_0xc5c3('0x3d')](_0x183f6b['query'][_0xc5c3('0x3d')]);_0x31e280[_0xc5c3('0x3f')]=qs[_0xc5c3('0x36')](_['pick'](_0x183f6b[_0xc5c3('0x35')],_0x25d6ca['filters']));if(_0x183f6b['query'][_0xc5c3('0x54')]){_0x31e280[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0x31e280[_0xc5c3('0x3f')],{'$or':_[_0xc5c3('0x55')](_0x31e280['attributes'],function(_0x340ace){var _0x52d20d={};_0x52d20d[_0x340ace]={'$like':'%'+_0x183f6b[_0xc5c3('0x35')][_0xc5c3('0x54')]+'%'};return _0x52d20d;})});}_0x31e280=_[_0xc5c3('0x3e')]({},_0x31e280,_0x183f6b[_0xc5c3('0x44')]);return _0x5a79de[_0xc5c3('0x57')](_0x31e280);}})['then'](function(_0x5588d9){if(_0x5588d9){_0x4ca6e6=_0x5588d9['length'];if(!_0x183f6b[_0xc5c3('0x35')][_0xc5c3('0x3b')](_0xc5c3('0x56'))){_0x31e280['limit']=qs[_0xc5c3('0x27')](_0x183f6b[_0xc5c3('0x35')]['limit']);_0x31e280[_0xc5c3('0x26')]=qs['offset'](_0x183f6b[_0xc5c3('0x35')][_0xc5c3('0x26')]);}return _0x5a79de[_0xc5c3('0x57')](_0x31e280);}})[_0xc5c3('0x2d')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02?{'count':_0x4ca6e6,'rows':_0x4b0d02}:null;}})[_0xc5c3('0x2d')](respondWithResult(_0x114c90,null))[_0xc5c3('0x23')](handleError(_0x114c90,null));};exports[_0xc5c3('0x58')]=function(_0x2bd0ac,_0x14679e,_0x2ddf24){var _0x642326={};var _0x1f36f8={};var _0x5b15ca;var _0x57ecd3;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2bd0ac[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2d')](handleEntityNotFound(_0x14679e,null))[_0xc5c3('0x2d')](function(_0x298065){if(_0x298065){_0x5b15ca=_0x298065;_0x1f36f8[_0xc5c3('0x33')]=_[_0xc5c3('0x34')](db[_0xc5c3('0x51')][_0xc5c3('0x52')]);_0x1f36f8[_0xc5c3('0x35')]=_['keys'](_0x2bd0ac[_0xc5c3('0x35')]);_0x1f36f8[_0xc5c3('0x36')]=_[_0xc5c3('0x37')](_0x1f36f8[_0xc5c3('0x33')],_0x1f36f8[_0xc5c3('0x35')]);_0x642326[_0xc5c3('0x38')]=_[_0xc5c3('0x37')](_0x1f36f8['model'],qs['fields'](_0x2bd0ac[_0xc5c3('0x35')][_0xc5c3('0x39')]));_0x642326[_0xc5c3('0x38')]=_0x642326[_0xc5c3('0x38')][_0xc5c3('0x3a')]?_0x642326[_0xc5c3('0x38')]:_0x1f36f8[_0xc5c3('0x33')];_0x642326[_0xc5c3('0x3c')]=qs[_0xc5c3('0x3d')](_0x2bd0ac[_0xc5c3('0x35')][_0xc5c3('0x3d')]);_0x642326['where']=qs[_0xc5c3('0x36')](_[_0xc5c3('0x53')](_0x2bd0ac[_0xc5c3('0x35')],_0x1f36f8[_0xc5c3('0x36')]));if(_0x2bd0ac[_0xc5c3('0x35')]['filter']){_0x642326[_0xc5c3('0x3f')]=_[_0xc5c3('0x3e')](_0x642326[_0xc5c3('0x3f')],{'$or':_[_0xc5c3('0x55')](_0x642326['attributes'],function(_0x40854d){var _0x2a59eb={};_0x2a59eb[_0x40854d]={'$like':'%'+_0x2bd0ac[_0xc5c3('0x35')]['filter']+'%'};return _0x2a59eb;})});}_0x642326=_[_0xc5c3('0x3e')]({},_0x642326,_0x2bd0ac[_0xc5c3('0x44')]);return _0x5b15ca[_0xc5c3('0x58')](_0x642326);}})[_0xc5c3('0x2d')](function(_0x265b63){if(_0x265b63){_0x57ecd3=_0x265b63[_0xc5c3('0x3a')];if(!_0x2bd0ac[_0xc5c3('0x35')][_0xc5c3('0x3b')](_0xc5c3('0x56'))){_0x642326[_0xc5c3('0x27')]=qs[_0xc5c3('0x27')](_0x2bd0ac[_0xc5c3('0x35')][_0xc5c3('0x27')]);_0x642326[_0xc5c3('0x26')]=qs[_0xc5c3('0x26')](_0x2bd0ac[_0xc5c3('0x35')]['offset']);}return _0x5b15ca[_0xc5c3('0x58')](_0x642326);}})[_0xc5c3('0x2d')](function(_0x5e7cf7){if(_0x5e7cf7){return _0x5e7cf7?{'count':_0x57ecd3,'rows':_0x5e7cf7}:null;}})[_0xc5c3('0x2d')](respondWithResult(_0x14679e,null))['catch'](handleError(_0x14679e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 2d681e2..9b69979 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 _0x35d5=['moment','bluebird','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api'];(function(_0x1ec73a,_0x491889){var _0x2dd506=function(_0x3fe8b1){while(--_0x3fe8b1){_0x1ec73a['push'](_0x1ec73a['shift']());}};_0x2dd506(++_0x491889);}(_0x35d5,0xde));var _0x535d=function(_0x141eb4,_0x4d355f){_0x141eb4=_0x141eb4-0x0;var _0x24608f=_0x35d5[_0x141eb4];return _0x24608f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x535d('0x0'))(_0x535d('0x1'));var moment=require(_0x535d('0x2'));var BPromise=require(_0x535d('0x3'));var rp=require('request-promise');var attributes=require(_0x535d('0x4'));module[_0x535d('0x5')]=function(_0x2c0034,_0x341d6d){return _0x2c0034['define'](_0x535d('0x6'),attributes,{'tableName':_0x535d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffb5=['moment','bluebird','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger'];(function(_0x3ad68d,_0x5c2acc){var _0x18cf6c=function(_0x3fbdbd){while(--_0x3fbdbd){_0x3ad68d['push'](_0x3ad68d['shift']());}};_0x18cf6c(++_0x5c2acc);}(_0xffb5,0xf9));var _0x5ffb=function(_0x1250e5,_0x31a06b){_0x1250e5=_0x1250e5-0x0;var _0xcae512=_0xffb5[_0x1250e5];return _0xcae512;};'use strict';var _=require(_0x5ffb('0x0'));var util=require(_0x5ffb('0x1'));var logger=require(_0x5ffb('0x2'))('api');var moment=require(_0x5ffb('0x3'));var BPromise=require(_0x5ffb('0x4'));var rp=require('request-promise');var attributes=require(_0x5ffb('0x5'));module['exports']=function(_0x308227,_0x98be90){return _0x308227[_0x5ffb('0x6')](_0x5ffb('0x7'),attributes,{'tableName':_0x5ffb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 9f6ae14..9a40ea3 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 _0x1d04=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x12e355,_0x190276){var _0x1623e0=function(_0xaae1a5){while(--_0xaae1a5){_0x12e355['push'](_0x12e355['shift']());}};_0x1623e0(++_0x190276);}(_0x1d04,0x1be));var _0x41d0=function(_0x3d893a,_0x42671c){_0x3d893a=_0x3d893a-0x0;var _0x1b49d6=_0x1d04[_0x3d893a];return _0x1b49d6;};'use strict';var _=require(_0x41d0('0x0'));var util=require(_0x41d0('0x1'));var moment=require(_0x41d0('0x2'));var BPromise=require(_0x41d0('0x3'));var rs=require(_0x41d0('0x4'));var fs=require('fs');var Redis=require(_0x41d0('0x5'));var db=require(_0x41d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x41d0('0x7'))(_0x41d0('0x8'));var config=require(_0x41d0('0x9'));var jayson=require(_0x41d0('0xa'));var client=jayson[_0x41d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9a26,_0x4844d6,_0x4c8a0d){return new BPromise(function(_0xb980da,_0x5cb3d7){return client[_0x41d0('0xc')](_0x1e9a26,_0x4c8a0d)['then'](function(_0x520488){logger[_0x41d0('0xd')](_0x41d0('0xe'),_0x4844d6,_0x41d0('0xf'));logger['debug'](_0x41d0('0x10'),_0x4844d6,_0x41d0('0xf'),JSON[_0x41d0('0x11')](_0x520488));if(_0x520488['error']){if(_0x520488[_0x41d0('0x12')][_0x41d0('0x13')]===0x1f4){logger[_0x41d0('0x12')](_0x41d0('0xe'),_0x4844d6,_0x520488[_0x41d0('0x12')][_0x41d0('0x14')]);return _0x5cb3d7(_0x520488[_0x41d0('0x12')]['message']);}logger[_0x41d0('0x12')](_0x41d0('0xe'),_0x4844d6,_0x520488[_0x41d0('0x12')][_0x41d0('0x14')]);return _0xb980da(_0x520488[_0x41d0('0x12')][_0x41d0('0x14')]);}else{logger[_0x41d0('0xd')](_0x41d0('0xe'),_0x4844d6,_0x41d0('0xf'));_0xb980da(_0x520488[_0x41d0('0x15')][_0x41d0('0x14')]);}})[_0x41d0('0x16')](function(_0x256221){logger[_0x41d0('0x12')](_0x41d0('0xe'),_0x4844d6,_0x256221);_0x5cb3d7(_0x256221);});});} \ No newline at end of file +var _0xfda2=['../../config/environment','jayson/promise','client','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x103ba6,_0x32d3af){var _0x2c14f4=function(_0x7cace0){while(--_0x7cace0){_0x103ba6['push'](_0x103ba6['shift']());}};_0x2c14f4(++_0x32d3af);}(_0xfda2,0x82));var _0x2fda=function(_0x37251b,_0x59aa32){_0x37251b=_0x37251b-0x0;var _0x5b8320=_0xfda2[_0x37251b];return _0x5b8320;};'use strict';var _=require(_0x2fda('0x0'));var util=require(_0x2fda('0x1'));var moment=require(_0x2fda('0x2'));var BPromise=require(_0x2fda('0x3'));var rs=require(_0x2fda('0x4'));var fs=require('fs');var Redis=require(_0x2fda('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2fda('0x6'))(_0x2fda('0x7'));var config=require(_0x2fda('0x8'));var jayson=require(_0x2fda('0x9'));var client=jayson[_0x2fda('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x529aa4,_0x19b6ea,_0x1304da){return new BPromise(function(_0x58a176,_0x5727d6){return client[_0x2fda('0xb')](_0x529aa4,_0x1304da)[_0x2fda('0xc')](function(_0x5808aa){logger['info'](_0x2fda('0xd'),_0x19b6ea,'request\x20sent');logger[_0x2fda('0xe')](_0x2fda('0xf'),_0x19b6ea,_0x2fda('0x10'),JSON[_0x2fda('0x11')](_0x5808aa));if(_0x5808aa[_0x2fda('0x12')]){if(_0x5808aa['error'][_0x2fda('0x13')]===0x1f4){logger[_0x2fda('0x12')](_0x2fda('0xd'),_0x19b6ea,_0x5808aa[_0x2fda('0x12')]['message']);return _0x5727d6(_0x5808aa[_0x2fda('0x12')][_0x2fda('0x14')]);}logger[_0x2fda('0x12')](_0x2fda('0xd'),_0x19b6ea,_0x5808aa[_0x2fda('0x12')][_0x2fda('0x14')]);return _0x58a176(_0x5808aa[_0x2fda('0x12')][_0x2fda('0x14')]);}else{logger[_0x2fda('0x15')](_0x2fda('0xd'),_0x19b6ea,_0x2fda('0x10'));_0x58a176(_0x5808aa['result'][_0x2fda('0x14')]);}})[_0x2fda('0x16')](function(_0x4ca3b6){logger['error'](_0x2fda('0xd'),_0x19b6ea,_0x4ca3b6);_0x5727d6(_0x4ca3b6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 42bcbcc..dcacb74 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 _0x4f06=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x290018,_0x393d9d){var _0x1ead87=function(_0x37e259){while(--_0x37e259){_0x290018['push'](_0x290018['shift']());}};_0x1ead87(++_0x393d9d);}(_0x4f06,0x1e9));var _0x64f0=function(_0xea69b1,_0x5499b2){_0xea69b1=_0xea69b1-0x0;var _0x3b5a7e=_0x4f06[_0xea69b1];return _0x3b5a7e;};'use strict';var multer=require(_0x64f0('0x0'));var util=require(_0x64f0('0x1'));var path=require(_0x64f0('0x2'));var timeout=require(_0x64f0('0x3'));var express=require(_0x64f0('0x4'));var router=express[_0x64f0('0x5')]();var auth=require(_0x64f0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64f0('0x7'));var controller=require(_0x64f0('0x8'));router[_0x64f0('0x9')]('/',auth[_0x64f0('0xa')](),controller['index']);router[_0x64f0('0x9')](_0x64f0('0xb'),auth[_0x64f0('0xa')](),controller[_0x64f0('0xc')]);router[_0x64f0('0xd')]('/',auth[_0x64f0('0xa')](),controller[_0x64f0('0xe')]);router[_0x64f0('0xf')]('/:id',auth[_0x64f0('0xa')](),controller['update']);router[_0x64f0('0x10')](_0x64f0('0xb'),auth[_0x64f0('0xa')](),controller[_0x64f0('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3756=['index','get','/:id','post','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x190a90,_0x128099){var _0x1fb761=function(_0x1a8237){while(--_0x1a8237){_0x190a90['push'](_0x190a90['shift']());}};_0x1fb761(++_0x128099);}(_0x3756,0xd6));var _0x6375=function(_0x1dddf5,_0x2cee80){_0x1dddf5=_0x1dddf5-0x0;var _0x1f51cc=_0x3756[_0x1dddf5];return _0x1f51cc;};'use strict';var multer=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var path=require('path');var timeout=require(_0x6375('0x2'));var express=require(_0x6375('0x3'));var router=express['Router']();var auth=require(_0x6375('0x4'));var interaction=require(_0x6375('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x6375('0x6')](),controller[_0x6375('0x7')]);router[_0x6375('0x8')](_0x6375('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6375('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6375('0x9'),auth[_0x6375('0x6')](),controller['update']);router['delete']('/:id',auth[_0x6375('0x6')](),controller[_0x6375('0xb')]);module[_0x6375('0xc')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 452d988..6ca8e88 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 _0xd8b0=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x1f5f10,_0x129f1c){var _0x3e2899=function(_0x56f2f3){while(--_0x56f2f3){_0x1f5f10['push'](_0x1f5f10['shift']());}};_0x3e2899(++_0x129f1c);}(_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')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x4')},'content':{'type':Sequelize[_0x0d8b('0x5')]},'key':{'type':Sequelize[_0x0d8b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0d8b('0x6'),_0x0d8b('0x2'))},'keyContent':{'type':Sequelize[_0x0d8b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d8b('0x5')]},'customField':{'type':Sequelize[_0x0d8b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaa88=['exports','ENUM','string','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x14daab,_0x518152){var _0xf0f2e5=function(_0x5079d3){while(--_0x5079d3){_0x14daab['push'](_0x14daab['shift']());}};_0xf0f2e5(++_0x518152);}(_0xaa88,0x137));var _0x8aa8=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0xaa88[_0x164760];return _0x8b91b2;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'type':{'type':Sequelize[_0x8aa8('0x2')](_0x8aa8('0x3'),'variable',_0x8aa8('0x4'),_0x8aa8('0x5')),'defaultValue':_0x8aa8('0x3')},'content':{'type':Sequelize[_0x8aa8('0x6')]},'key':{'type':Sequelize[_0x8aa8('0x6')]},'keyType':{'type':Sequelize[_0x8aa8('0x2')]('string','variable',_0x8aa8('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8aa8('0x6')]},'nameField':{'type':Sequelize[_0x8aa8('0x6')]},'customField':{'type':Sequelize[_0x8aa8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8aa8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 708c425..8ce7a40 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 _0x8b97=['limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','Dynamics365Field','include','rows','catch','show','params','find','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x8b97,0x1d9));var _0x78b9=function(_0x20654c,_0x2d0378){_0x20654c=_0x20654c-0x0;var _0x40a795=_0x8b97[_0x20654c];return _0x40a795;};'use strict';var pdf=require(_0x78b9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x78b9('0x1'));var zipdir=require(_0x78b9('0x2'));var jsonpatch=require(_0x78b9('0x3'));var rp=require(_0x78b9('0x4'));var moment=require(_0x78b9('0x5'));var BPromise=require(_0x78b9('0x6'));var Mustache=require('mustache');var util=require(_0x78b9('0x7'));var path=require(_0x78b9('0x8'));var sox=require('sox');var csv=require(_0x78b9('0x9'));var ejs=require(_0x78b9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78b9('0xb'));var crypto=require(_0x78b9('0xc'));var jsforce=require(_0x78b9('0xd'));var deskjs=require(_0x78b9('0xe'));var toCsv=require(_0x78b9('0x9'));var querystring=require(_0x78b9('0xf'));var Papa=require(_0x78b9('0x10'));var authService=require(_0x78b9('0x11'));var hardwareService=require(_0x78b9('0x12'));var Redis=require(_0x78b9('0x13'));var qs=require(_0x78b9('0x14'));var logger=require(_0x78b9('0x15'))(_0x78b9('0x16'));var utils=require('../../config/utils');var config=require(_0x78b9('0x17'));var db=require(_0x78b9('0x18'))['db'];function respondWithStatusCode(_0x2c93ac,_0x4e3bc6){_0x4e3bc6=_0x4e3bc6||0xcc;return function(_0xd59f9f){if(_0xd59f9f){return _0x2c93ac[_0x78b9('0x19')](_0x4e3bc6);}return _0x2c93ac[_0x78b9('0x1a')](_0x4e3bc6)[_0x78b9('0x1b')]();};}function respondWithResult(_0xfca50e,_0x2ca12a){_0x2ca12a=_0x2ca12a||0xc8;return function(_0x386a35){if(_0x386a35){return _0xfca50e[_0x78b9('0x1a')](_0x2ca12a)[_0x78b9('0x1c')](_0x386a35);}};}function respondWithFilteredResult(_0x107c1d,_0x16bf6c){return function(_0x2c715e){if(_0x2c715e){var _0x1f93ae=_0x2c715e[_0x78b9('0x1d')],_0x3f4386=_0x16bf6c[_0x78b9('0x1e')],_0x35bb01=_0x16bf6c[_0x78b9('0x1e')]+_0x16bf6c[_0x78b9('0x1f')],_0x271421;if(_0x35bb01>=_0x1f93ae){_0x35bb01=_0x1f93ae;_0x271421=0xc8;}else{_0x271421=0xce;}_0x107c1d['status'](_0x271421);return _0x107c1d[_0x78b9('0x20')](_0x78b9('0x21'),_0x3f4386+'-'+_0x35bb01+'/'+_0x1f93ae)[_0x78b9('0x1c')](_0x2c715e);}return null;};}function patchUpdates(_0x31dad3){return function(_0xeccdd){try{jsonpatch[_0x78b9('0x22')](_0xeccdd,_0x31dad3,!![]);}catch(_0x3ad532){return BPromise[_0x78b9('0x23')](_0x3ad532);}return _0xeccdd['save']();};}function saveUpdates(_0x577509,_0x333210){return function(_0x4730e3){if(_0x4730e3){return _0x4730e3['update'](_0x577509)['then'](function(_0x4e8a69){return _0x4e8a69;});}return null;};}function removeEntity(_0x330af3,_0x3eec86){return function(_0x29f3db){if(_0x29f3db){return _0x29f3db[_0x78b9('0x24')]()[_0x78b9('0x25')](function(){_0x330af3[_0x78b9('0x1a')](0xcc)[_0x78b9('0x1b')]();});}};}function handleEntityNotFound(_0x54c196,_0x1eba6e){return function(_0x1f096b){if(!_0x1f096b){_0x54c196[_0x78b9('0x19')](0x194);}return _0x1f096b;};}function handleError(_0x145c02,_0x28fe05){_0x28fe05=_0x28fe05||0x1f4;return function(_0x327885){logger[_0x78b9('0x26')](_0x327885[_0x78b9('0x27')]);if(_0x327885['name']){delete _0x327885[_0x78b9('0x28')];}_0x145c02[_0x78b9('0x1a')](_0x28fe05)['send'](_0x327885);};}exports['index']=function(_0x30db95,_0x3968a6){var _0x2c95dc={},_0x58d1ff={},_0x5baf26={'count':0x0,'rows':[]};var _0x10ea13=db['Dynamics365Field'][_0x78b9('0x29')];_0x58d1ff[_0x78b9('0x2a')]=_['keys'](_0x10ea13);_0x58d1ff[_0x78b9('0x2b')]=_[_0x78b9('0x2c')](_0x30db95[_0x78b9('0x2b')]);_0x58d1ff['filters']=_[_0x78b9('0x2d')](_0x58d1ff[_0x78b9('0x2a')],_0x58d1ff[_0x78b9('0x2b')]);_0x2c95dc[_0x78b9('0x2e')]=_[_0x78b9('0x2d')](_0x58d1ff[_0x78b9('0x2a')],qs[_0x78b9('0x2f')](_0x30db95[_0x78b9('0x2b')][_0x78b9('0x2f')]));_0x2c95dc[_0x78b9('0x2e')]=_0x2c95dc['attributes'][_0x78b9('0x30')]?_0x2c95dc[_0x78b9('0x2e')]:_0x58d1ff[_0x78b9('0x2a')];if(!_0x30db95[_0x78b9('0x2b')][_0x78b9('0x31')](_0x78b9('0x32'))){_0x2c95dc[_0x78b9('0x1f')]=qs[_0x78b9('0x1f')](_0x30db95[_0x78b9('0x2b')]['limit']);_0x2c95dc[_0x78b9('0x1e')]=qs[_0x78b9('0x1e')](_0x30db95[_0x78b9('0x2b')][_0x78b9('0x1e')]);}_0x2c95dc[_0x78b9('0x33')]=qs[_0x78b9('0x34')](_0x30db95[_0x78b9('0x2b')]['sort']);_0x2c95dc[_0x78b9('0x35')]=qs[_0x78b9('0x36')](_[_0x78b9('0x37')](_0x30db95[_0x78b9('0x2b')],_0x58d1ff[_0x78b9('0x36')]));if(_0x30db95[_0x78b9('0x2b')][_0x78b9('0x38')]){_0x2c95dc[_0x78b9('0x35')]=_[_0x78b9('0x39')](_0x2c95dc[_0x78b9('0x35')],{'$or':_[_0x78b9('0x3a')](_0x10ea13,function(_0x53bab4){if(_0x53bab4[_0x78b9('0x3b')][_0x78b9('0x3c')]!=='VIRTUAL'){var _0x593f0c={};_0x593f0c[_0x53bab4[_0x78b9('0x3d')]]={'$like':'%'+_0x30db95[_0x78b9('0x2b')]['filter']+'%'};return _0x593f0c;}})});}_0x2c95dc=_['merge']({},_0x2c95dc,_0x30db95[_0x78b9('0x3e')]);var _0x2e3498={'where':_0x2c95dc[_0x78b9('0x35')]};return db[_0x78b9('0x3f')][_0x78b9('0x1d')](_0x2e3498)[_0x78b9('0x25')](function(_0x48fe9d){_0x5baf26[_0x78b9('0x1d')]=_0x48fe9d;if(_0x30db95[_0x78b9('0x2b')]['includeAll']){_0x2c95dc[_0x78b9('0x40')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x2c95dc);})[_0x78b9('0x25')](function(_0x127cf3){_0x5baf26[_0x78b9('0x41')]=_0x127cf3;return _0x5baf26;})[_0x78b9('0x25')](respondWithFilteredResult(_0x3968a6,_0x2c95dc))[_0x78b9('0x42')](handleError(_0x3968a6,null));};exports[_0x78b9('0x43')]=function(_0x4382f2,_0x4d3a88){var _0x324583={'raw':!![],'where':{'id':_0x4382f2[_0x78b9('0x44')]['id']}},_0x710303={};_0x710303[_0x78b9('0x2a')]=_[_0x78b9('0x2c')](db[_0x78b9('0x3f')]['rawAttributes']);_0x710303[_0x78b9('0x2b')]=_[_0x78b9('0x2c')](_0x4382f2[_0x78b9('0x2b')]);_0x710303[_0x78b9('0x36')]=_[_0x78b9('0x2d')](_0x710303['model'],_0x710303[_0x78b9('0x2b')]);_0x324583[_0x78b9('0x2e')]=_[_0x78b9('0x2d')](_0x710303['model'],qs[_0x78b9('0x2f')](_0x4382f2[_0x78b9('0x2b')][_0x78b9('0x2f')]));_0x324583[_0x78b9('0x2e')]=_0x324583[_0x78b9('0x2e')]['length']?_0x324583['attributes']:_0x710303[_0x78b9('0x2a')];if(_0x4382f2[_0x78b9('0x2b')]['includeAll']){_0x324583[_0x78b9('0x40')]=[{'all':!![]}];}_0x324583=_[_0x78b9('0x39')]({},_0x324583,_0x4382f2[_0x78b9('0x3e')]);return db[_0x78b9('0x3f')][_0x78b9('0x45')](_0x324583)[_0x78b9('0x25')](handleEntityNotFound(_0x4d3a88,null))[_0x78b9('0x25')](respondWithResult(_0x4d3a88,null))[_0x78b9('0x42')](handleError(_0x4d3a88,null));};exports['create']=function(_0x4c3ebc,_0xde0e2c){return db['Dynamics365Field']['create'](_0x4c3ebc['body'],{})[_0x78b9('0x25')](respondWithResult(_0xde0e2c,0xc9))[_0x78b9('0x42')](handleError(_0xde0e2c,null));};exports[_0x78b9('0x46')]=function(_0xa0b552,_0xc59f4e){if(_0xa0b552['body']['id']){delete _0xa0b552[_0x78b9('0x47')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0xa0b552['params']['id']}})['then'](handleEntityNotFound(_0xc59f4e,null))[_0x78b9('0x25')](saveUpdates(_0xa0b552[_0x78b9('0x47')],null))[_0x78b9('0x25')](respondWithResult(_0xc59f4e,null))[_0x78b9('0x42')](handleError(_0xc59f4e,null));};exports[_0x78b9('0x24')]=function(_0x3b95a9,_0x3bb18c){return db[_0x78b9('0x3f')][_0x78b9('0x45')]({'where':{'id':_0x3b95a9['params']['id']}})['then'](handleEntityNotFound(_0x3bb18c,null))['then'](removeEntity(_0x3bb18c,null))['catch'](handleError(_0x3bb18c,null));}; \ No newline at end of file +var _0x15c6=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','field','options','then','include','findAll','catch','show','params','includeAll','merge','Dynamics365Field','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x15c6,0x1cd));var _0x615c=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x15c6[_0x10d670];return _0x20d6f8;};'use strict';var pdf=require(_0x615c('0x0'));var emlformat=require(_0x615c('0x1'));var rimraf=require(_0x615c('0x2'));var zipdir=require(_0x615c('0x3'));var jsonpatch=require(_0x615c('0x4'));var rp=require(_0x615c('0x5'));var moment=require(_0x615c('0x6'));var BPromise=require(_0x615c('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x615c('0x8'));var csv=require(_0x615c('0x9'));var ejs=require(_0x615c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x615c('0xb'));var crypto=require(_0x615c('0xc'));var jsforce=require(_0x615c('0xd'));var deskjs=require(_0x615c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x615c('0xf'));var Papa=require('papaparse');var authService=require(_0x615c('0x10'));var hardwareService=require(_0x615c('0x11'));var Redis=require(_0x615c('0x12'));var qs=require(_0x615c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x615c('0x14'));var config=require(_0x615c('0x15'));var db=require(_0x615c('0x16'))['db'];function respondWithStatusCode(_0xb88fd9,_0x5a0c3e){_0x5a0c3e=_0x5a0c3e||0xcc;return function(_0x497ecb){if(_0x497ecb){return _0xb88fd9[_0x615c('0x17')](_0x5a0c3e);}return _0xb88fd9[_0x615c('0x18')](_0x5a0c3e)['end']();};}function respondWithResult(_0x247cc8,_0x4a86be){_0x4a86be=_0x4a86be||0xc8;return function(_0x525708){if(_0x525708){return _0x247cc8[_0x615c('0x18')](_0x4a86be)[_0x615c('0x19')](_0x525708);}};}function respondWithFilteredResult(_0x2e9dd9,_0x11e338){return function(_0x146659){if(_0x146659){var _0x1ab157=_0x146659[_0x615c('0x1a')],_0x55ec9e=_0x11e338['offset'],_0x2d10d2=_0x11e338[_0x615c('0x1b')]+_0x11e338[_0x615c('0x1c')],_0x41dee1;if(_0x2d10d2>=_0x1ab157){_0x2d10d2=_0x1ab157;_0x41dee1=0xc8;}else{_0x41dee1=0xce;}_0x2e9dd9[_0x615c('0x18')](_0x41dee1);return _0x2e9dd9[_0x615c('0x1d')](_0x615c('0x1e'),_0x55ec9e+'-'+_0x2d10d2+'/'+_0x1ab157)[_0x615c('0x19')](_0x146659);}return null;};}function patchUpdates(_0x2beeab){return function(_0x341344){try{jsonpatch['apply'](_0x341344,_0x2beeab,!![]);}catch(_0x504e63){return BPromise['reject'](_0x504e63);}return _0x341344[_0x615c('0x1f')]();};}function saveUpdates(_0x1179a3,_0x348280){return function(_0x146c58){if(_0x146c58){return _0x146c58['update'](_0x1179a3)['then'](function(_0x2f77cc){return _0x2f77cc;});}return null;};}function removeEntity(_0x479917,_0x44ca83){return function(_0x53638f){if(_0x53638f){return _0x53638f[_0x615c('0x20')]()['then'](function(){_0x479917[_0x615c('0x18')](0xcc)[_0x615c('0x21')]();});}};}function handleEntityNotFound(_0x5d148b,_0x4cca36){return function(_0x5bba2f){if(!_0x5bba2f){_0x5d148b[_0x615c('0x17')](0x194);}return _0x5bba2f;};}function handleError(_0x29bad0,_0x42ee58){_0x42ee58=_0x42ee58||0x1f4;return function(_0x3ce866){logger['error'](_0x3ce866[_0x615c('0x22')]);if(_0x3ce866[_0x615c('0x23')]){delete _0x3ce866['name'];}_0x29bad0['status'](_0x42ee58)[_0x615c('0x24')](_0x3ce866);};}exports[_0x615c('0x25')]=function(_0x8671eb,_0x533368){var _0x32ce76={},_0x2ad4cc={},_0x457f7b={'count':0x0,'rows':[]};var _0x63e725=db['Dynamics365Field'][_0x615c('0x26')];_0x2ad4cc[_0x615c('0x27')]=_[_0x615c('0x28')](_0x63e725);_0x2ad4cc[_0x615c('0x29')]=_[_0x615c('0x28')](_0x8671eb[_0x615c('0x29')]);_0x2ad4cc[_0x615c('0x2a')]=_[_0x615c('0x2b')](_0x2ad4cc[_0x615c('0x27')],_0x2ad4cc[_0x615c('0x29')]);_0x32ce76[_0x615c('0x2c')]=_[_0x615c('0x2b')](_0x2ad4cc[_0x615c('0x27')],qs[_0x615c('0x2d')](_0x8671eb['query'][_0x615c('0x2d')]));_0x32ce76[_0x615c('0x2c')]=_0x32ce76[_0x615c('0x2c')][_0x615c('0x2e')]?_0x32ce76[_0x615c('0x2c')]:_0x2ad4cc[_0x615c('0x27')];if(!_0x8671eb['query'][_0x615c('0x2f')](_0x615c('0x30'))){_0x32ce76[_0x615c('0x1c')]=qs[_0x615c('0x1c')](_0x8671eb[_0x615c('0x29')]['limit']);_0x32ce76[_0x615c('0x1b')]=qs['offset'](_0x8671eb[_0x615c('0x29')][_0x615c('0x1b')]);}_0x32ce76[_0x615c('0x31')]=qs[_0x615c('0x32')](_0x8671eb[_0x615c('0x29')][_0x615c('0x32')]);_0x32ce76['where']=qs[_0x615c('0x2a')](_[_0x615c('0x33')](_0x8671eb[_0x615c('0x29')],_0x2ad4cc[_0x615c('0x2a')]));if(_0x8671eb[_0x615c('0x29')][_0x615c('0x34')]){_0x32ce76[_0x615c('0x35')]=_['merge'](_0x32ce76[_0x615c('0x35')],{'$or':_[_0x615c('0x36')](_0x63e725,function(_0x4163af){if(_0x4163af[_0x615c('0x37')]['key']!==_0x615c('0x38')){var _0x17f3bb={};_0x17f3bb[_0x4163af[_0x615c('0x39')]]={'$like':'%'+_0x8671eb[_0x615c('0x29')]['filter']+'%'};return _0x17f3bb;}})});}_0x32ce76=_['merge']({},_0x32ce76,_0x8671eb[_0x615c('0x3a')]);var _0xf36341={'where':_0x32ce76[_0x615c('0x35')]};return db['Dynamics365Field'][_0x615c('0x1a')](_0xf36341)[_0x615c('0x3b')](function(_0x34ab88){_0x457f7b[_0x615c('0x1a')]=_0x34ab88;if(_0x8671eb['query']['includeAll']){_0x32ce76[_0x615c('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x615c('0x3d')](_0x32ce76);})[_0x615c('0x3b')](function(_0xa59935){_0x457f7b['rows']=_0xa59935;return _0x457f7b;})[_0x615c('0x3b')](respondWithFilteredResult(_0x533368,_0x32ce76))[_0x615c('0x3e')](handleError(_0x533368,null));};exports[_0x615c('0x3f')]=function(_0x93e864,_0x3ede44){var _0x5a1c75={'raw':!![],'where':{'id':_0x93e864[_0x615c('0x40')]['id']}},_0x2e6dec={};_0x2e6dec['model']=_['keys'](db['Dynamics365Field'][_0x615c('0x26')]);_0x2e6dec[_0x615c('0x29')]=_['keys'](_0x93e864['query']);_0x2e6dec[_0x615c('0x2a')]=_[_0x615c('0x2b')](_0x2e6dec[_0x615c('0x27')],_0x2e6dec[_0x615c('0x29')]);_0x5a1c75[_0x615c('0x2c')]=_[_0x615c('0x2b')](_0x2e6dec[_0x615c('0x27')],qs[_0x615c('0x2d')](_0x93e864[_0x615c('0x29')][_0x615c('0x2d')]));_0x5a1c75['attributes']=_0x5a1c75[_0x615c('0x2c')][_0x615c('0x2e')]?_0x5a1c75[_0x615c('0x2c')]:_0x2e6dec[_0x615c('0x27')];if(_0x93e864['query'][_0x615c('0x41')]){_0x5a1c75[_0x615c('0x3c')]=[{'all':!![]}];}_0x5a1c75=_[_0x615c('0x42')]({},_0x5a1c75,_0x93e864[_0x615c('0x3a')]);return db[_0x615c('0x43')][_0x615c('0x44')](_0x5a1c75)['then'](handleEntityNotFound(_0x3ede44,null))[_0x615c('0x3b')](respondWithResult(_0x3ede44,null))['catch'](handleError(_0x3ede44,null));};exports['create']=function(_0x3ee07f,_0x566179){return db[_0x615c('0x43')][_0x615c('0x45')](_0x3ee07f[_0x615c('0x46')],{})[_0x615c('0x3b')](respondWithResult(_0x566179,0xc9))[_0x615c('0x3e')](handleError(_0x566179,null));};exports[_0x615c('0x47')]=function(_0x251e95,_0x540c5c){if(_0x251e95[_0x615c('0x46')]['id']){delete _0x251e95[_0x615c('0x46')]['id'];}return db['Dynamics365Field'][_0x615c('0x44')]({'where':{'id':_0x251e95[_0x615c('0x40')]['id']}})[_0x615c('0x3b')](handleEntityNotFound(_0x540c5c,null))['then'](saveUpdates(_0x251e95[_0x615c('0x46')],null))[_0x615c('0x3b')](respondWithResult(_0x540c5c,null))[_0x615c('0x3e')](handleError(_0x540c5c,null));};exports['destroy']=function(_0x1bd4f1,_0x546124){return db[_0x615c('0x43')][_0x615c('0x44')]({'where':{'id':_0x1bd4f1[_0x615c('0x40')]['id']}})[_0x615c('0x3b')](handleEntityNotFound(_0x546124,null))[_0x615c('0x3b')](removeEntity(_0x546124,null))['catch'](handleError(_0x546124,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index add8293..8c498fe 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 _0xb0ec=['moment','request-promise','./intDynamics365Field.attributes','exports','define','idField','FieldId','util','../../config/logger'];(function(_0x3303a8,_0xeb95df){var _0x56ae5f=function(_0x5ecf9e){while(--_0x5ecf9e){_0x3303a8['push'](_0x3303a8['shift']());}};_0x56ae5f(++_0xeb95df);}(_0xb0ec,0xbb));var _0xcb0e=function(_0x4a79ed,_0x2ba1d8){_0x4a79ed=_0x4a79ed-0x0;var _0x498076=_0xb0ec[_0x4a79ed];return _0x498076;};'use strict';var _=require('lodash');var util=require(_0xcb0e('0x0'));var logger=require(_0xcb0e('0x1'))('api');var moment=require(_0xcb0e('0x2'));var BPromise=require('bluebird');var rp=require(_0xcb0e('0x3'));var attributes=require(_0xcb0e('0x4'));module[_0xcb0e('0x5')]=function(_0x580fa1,_0x60c09e){return _0x580fa1[_0xcb0e('0x6')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xcb0e('0x7'),_0xcb0e('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x775c=['exports','define','int_dynamics365_fields','dynamics365_unique_index','lodash','../../config/logger','api','moment','bluebird','request-promise','./intDynamics365Field.attributes'];(function(_0x352e34,_0x3d4e97){var _0x51842d=function(_0x76045e){while(--_0x76045e){_0x352e34['push'](_0x352e34['shift']());}};_0x51842d(++_0x3d4e97);}(_0x775c,0x67));var _0xc775=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x775c[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0xc775('0x0'));var util=require('util');var logger=require(_0xc775('0x1'))(_0xc775('0x2'));var moment=require(_0xc775('0x3'));var BPromise=require(_0xc775('0x4'));var rp=require(_0xc775('0x5'));var attributes=require(_0xc775('0x6'));module[_0xc775('0x7')]=function(_0x419f6e,_0x18b2c0){return _0x419f6e[_0xc775('0x8')]('Dynamics365Field',attributes,{'tableName':_0xc775('0x9'),'paranoid':![],'indexes':[{'name':_0xc775('0xa'),'fields':['idField','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 c47f45d..1de3233 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 _0x8580=['../../config/environment','client','http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x2e410f,_0x364f00){var _0x43b20d=function(_0x3ab998){while(--_0x3ab998){_0x2e410f['push'](_0x2e410f['shift']());}};_0x43b20d(++_0x364f00);}(_0x8580,0x1c7));var _0x0858=function(_0x24dd85,_0xd96d9a){_0x24dd85=_0x24dd85-0x0;var _0x392142=_0x8580[_0x24dd85];return _0x392142;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3515b4,_0x38e3f7,_0x4981a7){return new BPromise(function(_0x9c611c,_0x3ae92b){return client[_0x0858('0x8')](_0x3515b4,_0x4981a7)['then'](function(_0x4ceffb){logger[_0x0858('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x38e3f7,_0x0858('0xa'));logger[_0x0858('0xb')](_0x0858('0xc'),_0x38e3f7,_0x0858('0xa'),JSON[_0x0858('0xd')](_0x4ceffb));if(_0x4ceffb[_0x0858('0xe')]){if(_0x4ceffb[_0x0858('0xe')][_0x0858('0xf')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x38e3f7,_0x4ceffb[_0x0858('0xe')]['message']);return _0x3ae92b(_0x4ceffb['error']['message']);}logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x4ceffb['error'][_0x0858('0x11')]);return _0x9c611c(_0x4ceffb[_0x0858('0xe')][_0x0858('0x11')]);}else{logger[_0x0858('0x9')](_0x0858('0x10'),_0x38e3f7,_0x0858('0xa'));_0x9c611c(_0x4ceffb[_0x0858('0x12')][_0x0858('0x11')]);}})[_0x0858('0x13')](function(_0x39e967){logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x39e967);_0x3ae92b(_0x39e967);});});} \ No newline at end of file +var _0x57ef=['Dynamics365Field,\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(_0x4280e2,_0x1e4d6f){var _0x37dd2b=function(_0x1f8e31){while(--_0x1f8e31){_0x4280e2['push'](_0x4280e2['shift']());}};_0x37dd2b(++_0x1e4d6f);}(_0x57ef,0xdb));var _0xf57e=function(_0x3d4ac3,_0x50f8da){_0x3d4ac3=_0x3d4ac3-0x0;var _0x4607a8=_0x57ef[_0x3d4ac3];return _0x4607a8;};'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')]('Dynamics365Field,\x20%s,\x20%s',_0x2498c5,_0xf57e('0xf'));logger[_0xf57e('0x10')]('Dynamics365Field,\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')]('Dynamics365Field,\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 diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4aebbdc..a4747dd 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 _0xb9c8=['post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x44ff66,_0x27f548){var _0x136331=function(_0x4c14b5){while(--_0x4c14b5){_0x44ff66['push'](_0x44ff66['shift']());}};_0x136331(++_0x27f548);}(_0xb9c8,0x98));var _0x8b9c=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xb9c8[_0x32f26d];return _0x5d9ddc;};'use strict';var multer=require(_0x8b9c('0x0'));var util=require(_0x8b9c('0x1'));var path=require(_0x8b9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b9c('0x3'));var router=express[_0x8b9c('0x4')]();var auth=require(_0x8b9c('0x5'));var interaction=require(_0x8b9c('0x6'));var config=require(_0x8b9c('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x8b9c('0x8')]('/',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xa')]);router[_0x8b9c('0x8')]('/:id',auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xb')]);router[_0x8b9c('0x8')](_0x8b9c('0xc'),auth['isAuthenticated'](),controller[_0x8b9c('0xd')]);router[_0x8b9c('0x8')](_0x8b9c('0xe'),auth[_0x8b9c('0x9')](),controller[_0x8b9c('0xf')]);router[_0x8b9c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8b9c('0xc'),auth[_0x8b9c('0x9')](),controller[_0x8b9c('0x11')]);router[_0x8b9c('0x12')](_0x8b9c('0x13'),auth[_0x8b9c('0x9')](),controller[_0x8b9c('0x14')]);router[_0x8b9c('0x15')](_0x8b9c('0x13'),auth[_0x8b9c('0x9')](),controller[_0x8b9c('0x16')]);module[_0x8b9c('0x17')]=router; \ No newline at end of file +var _0x3ec9=['getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ec9,0x104));var _0x93ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ec9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x93ec('0x0'));var util=require('util');var path=require(_0x93ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x93ec('0x2'));var router=express[_0x93ec('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x93ec('0x4'));var config=require(_0x93ec('0x5'));var controller=require(_0x93ec('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x93ec('0x7')]);router[_0x93ec('0x8')](_0x93ec('0x9'),auth[_0x93ec('0xa')](),controller[_0x93ec('0xb')]);router[_0x93ec('0x8')](_0x93ec('0xc'),auth['isAuthenticated'](),controller[_0x93ec('0xd')]);router['get']('/:id/fields',auth[_0x93ec('0xa')](),controller[_0x93ec('0xe')]);router[_0x93ec('0xf')]('/',auth['isAuthenticated'](),controller[_0x93ec('0x10')]);router[_0x93ec('0xf')](_0x93ec('0xc'),auth[_0x93ec('0xa')](),controller[_0x93ec('0x11')]);router[_0x93ec('0x12')](_0x93ec('0x9'),auth['isAuthenticated'](),controller[_0x93ec('0x13')]);router['delete'](_0x93ec('0x9'),auth[_0x93ec('0xa')](),controller[_0x93ec('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index ac1318a..62dff07 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 _0x7f59=['username','remoteUri','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f59,0x156));var _0x97f5=function(_0x5e620c,_0x9d44d9){_0x5e620c=_0x5e620c-0x0;var _0x415225=_0x7f59[_0x5e620c];return _0x415225;};'use strict';var Sequelize=require('sequelize');module[_0x97f5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97f5('0x1')]},'username':{'type':Sequelize[_0x97f5('0x1')],'unique':_0x97f5('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x97f5('0x1')],'unique':_0x97f5('0x3')},'serverUrl':{'type':Sequelize[_0x97f5('0x1')]}}; \ No newline at end of file +var _0x7e6b=['username','remoteUri','sequelize','exports','STRING'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x7e6b,0x1ce));var _0xb7e6=function(_0x192411,_0x82550a){_0x192411=_0x192411-0x0;var _0x3db39a=_0x7e6b[_0x192411];return _0x3db39a;};'use strict';var Sequelize=require(_0xb7e6('0x0'));module[_0xb7e6('0x1')]={'name':{'type':Sequelize[_0xb7e6('0x2')]},'description':{'type':Sequelize[_0xb7e6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb7e6('0x3')},'apiKey':{'type':Sequelize[_0xb7e6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb7e6('0x4')},'serverUrl':{'type':Sequelize[_0xb7e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 68c1e2b..ba402ad 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 _0xe6e4=['stack','name','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','params','find','create','body','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','findOne','Subjects','getSubjects','Descriptions','channel','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','priority','group','ticket_type','remove','includes','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','apply','reject','save','update','destroy'];(function(_0x353f40,_0x1caf49){var _0x8373b5=function(_0x311977){while(--_0x311977){_0x353f40['push'](_0x353f40['shift']());}};_0x8373b5(++_0x1caf49);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x5c0b9c,_0x3718ab){_0x5c0b9c=_0x5c0b9c-0x0;var _0x439fd1=_0xe6e4[_0x5c0b9c];return _0x439fd1;};'use strict';var pdf=require(_0x4e6e('0x0'));var emlformat=require(_0x4e6e('0x1'));var rimraf=require(_0x4e6e('0x2'));var zipdir=require(_0x4e6e('0x3'));var jsonpatch=require(_0x4e6e('0x4'));var rp=require(_0x4e6e('0x5'));var moment=require(_0x4e6e('0x6'));var BPromise=require(_0x4e6e('0x7'));var Mustache=require(_0x4e6e('0x8'));var util=require('util');var path=require(_0x4e6e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e6e('0xa'));var fs=require('fs');var _=require(_0x4e6e('0xb'));var squel=require('squel');var crypto=require(_0x4e6e('0xc'));var jsforce=require(_0x4e6e('0xd'));var deskjs=require(_0x4e6e('0xe'));var toCsv=require(_0x4e6e('0xf'));var querystring=require(_0x4e6e('0x10'));var Papa=require('papaparse');var authService=require(_0x4e6e('0x11'));var hardwareService=require(_0x4e6e('0x12'));var Redis=require(_0x4e6e('0x13'));var qs=require(_0x4e6e('0x14'));var logger=require(_0x4e6e('0x15'))('api');var utils=require(_0x4e6e('0x16'));var config=require(_0x4e6e('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4e6e('0x18'));var jayson=require(_0x4e6e('0x19'));var client=jayson[_0x4e6e('0x1a')][_0x4e6e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1e6595,_0x15f1ae,_0x13ab3f,_0x539031){return new BPromise(function(_0x15d2b2,_0x1bdafd){var _0x437a88=_0x539031||client;return _0x437a88[_0x4e6e('0x1c')](_0x1e6595,_0x13ab3f)[_0x4e6e('0x1d')](function(_0xf16a18){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x15f1ae,_0x4e6e('0x1e'));logger[_0x4e6e('0x1f')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x15f1ae,_0x4e6e('0x1e'),JSON[_0x4e6e('0x20')](_0xf16a18));if(_0xf16a18[_0x4e6e('0x21')]){if(_0xf16a18[_0x4e6e('0x21')]['code']===0x1f4){logger[_0x4e6e('0x21')](_0x4e6e('0x22'),_0x15f1ae,_0xf16a18[_0x4e6e('0x21')][_0x4e6e('0x23')]);return _0x1bdafd(_0xf16a18[_0x4e6e('0x21')]['message']);}logger[_0x4e6e('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0x15f1ae,_0xf16a18[_0x4e6e('0x21')][_0x4e6e('0x23')]);return _0x15d2b2(_0xf16a18[_0x4e6e('0x21')][_0x4e6e('0x23')]);}else{logger['info'](_0x4e6e('0x22'),_0x15f1ae,_0x4e6e('0x1e'));_0x15d2b2(_0xf16a18[_0x4e6e('0x24')]['message']);}})[_0x4e6e('0x25')](function(_0x55bcd3){logger[_0x4e6e('0x21')](_0x4e6e('0x22'),_0x15f1ae,_0x55bcd3);_0x1bdafd(_0x55bcd3);});});}function respondWithStatusCode(_0x268486,_0x4a0855){_0x4a0855=_0x4a0855||0xcc;return function(_0x255e4e){if(_0x255e4e){return _0x268486[_0x4e6e('0x26')](_0x4a0855);}return _0x268486['status'](_0x4a0855)[_0x4e6e('0x27')]();};}function respondWithResult(_0x1afbd1,_0x2e8be5){_0x2e8be5=_0x2e8be5||0xc8;return function(_0x175f07){if(_0x175f07){return _0x1afbd1[_0x4e6e('0x28')](_0x2e8be5)[_0x4e6e('0x29')](_0x175f07);}};}function respondWithFilteredResult(_0x3b2926,_0x1740a3){return function(_0x5ece21){if(_0x5ece21){var _0x4fdd3a=_0x5ece21['count'],_0x51e6c0=_0x1740a3[_0x4e6e('0x2a')],_0x4f6279=_0x1740a3['offset']+_0x1740a3[_0x4e6e('0x2b')],_0x484af8;if(_0x4f6279>=_0x4fdd3a){_0x4f6279=_0x4fdd3a;_0x484af8=0xc8;}else{_0x484af8=0xce;}_0x3b2926[_0x4e6e('0x28')](_0x484af8);return _0x3b2926['set']('Content-Range',_0x51e6c0+'-'+_0x4f6279+'/'+_0x4fdd3a)[_0x4e6e('0x29')](_0x5ece21);}return null;};}function patchUpdates(_0x282075){return function(_0xf8edd3){try{jsonpatch[_0x4e6e('0x2c')](_0xf8edd3,_0x282075,!![]);}catch(_0x2c59e6){return BPromise[_0x4e6e('0x2d')](_0x2c59e6);}return _0xf8edd3[_0x4e6e('0x2e')]();};}function saveUpdates(_0x16de2e,_0x5aa252){return function(_0x11689b){if(_0x11689b){return _0x11689b[_0x4e6e('0x2f')](_0x16de2e)[_0x4e6e('0x1d')](function(_0x5acf93){return _0x5acf93;});}return null;};}function removeEntity(_0x88fe51,_0x8f1b81){return function(_0x219329){if(_0x219329){return _0x219329[_0x4e6e('0x30')]()[_0x4e6e('0x1d')](function(){_0x88fe51[_0x4e6e('0x28')](0xcc)[_0x4e6e('0x27')]();});}};}function handleEntityNotFound(_0x24a8b2,_0x437bb3){return function(_0x5ec5f6){if(!_0x5ec5f6){_0x24a8b2[_0x4e6e('0x26')](0x194);}return _0x5ec5f6;};}function handleError(_0x242af7,_0x4824e9){_0x4824e9=_0x4824e9||0x1f4;return function(_0x122c2b){logger[_0x4e6e('0x21')](_0x122c2b[_0x4e6e('0x31')]);if(_0x122c2b[_0x4e6e('0x32')]){delete _0x122c2b[_0x4e6e('0x32')];}_0x242af7[_0x4e6e('0x28')](_0x4824e9)['send'](_0x122c2b);};}exports[_0x4e6e('0x33')]=function(_0x4f667b,_0x1bf5ea){var _0x46deb5={},_0x1d0d0b={},_0x1d5902={'count':0x0,'rows':[]};var _0x34909a=db[_0x4e6e('0x34')][_0x4e6e('0x35')];_0x1d0d0b[_0x4e6e('0x36')]=_[_0x4e6e('0x37')](_0x34909a);_0x1d0d0b[_0x4e6e('0x38')]=_[_0x4e6e('0x37')](_0x4f667b['query']);_0x1d0d0b[_0x4e6e('0x39')]=_[_0x4e6e('0x3a')](_0x1d0d0b[_0x4e6e('0x36')],_0x1d0d0b[_0x4e6e('0x38')]);_0x46deb5[_0x4e6e('0x3b')]=_['intersection'](_0x1d0d0b[_0x4e6e('0x36')],qs[_0x4e6e('0x3c')](_0x4f667b[_0x4e6e('0x38')][_0x4e6e('0x3c')]));_0x46deb5['attributes']=_0x46deb5[_0x4e6e('0x3b')][_0x4e6e('0x3d')]?_0x46deb5['attributes']:_0x1d0d0b['model'];if(!_0x4f667b['query'][_0x4e6e('0x3e')]('nolimit')){_0x46deb5[_0x4e6e('0x2b')]=qs['limit'](_0x4f667b[_0x4e6e('0x38')]['limit']);_0x46deb5[_0x4e6e('0x2a')]=qs[_0x4e6e('0x2a')](_0x4f667b[_0x4e6e('0x38')][_0x4e6e('0x2a')]);}_0x46deb5[_0x4e6e('0x3f')]=qs['sort'](_0x4f667b[_0x4e6e('0x38')][_0x4e6e('0x40')]);_0x46deb5['where']=qs[_0x4e6e('0x39')](_[_0x4e6e('0x41')](_0x4f667b[_0x4e6e('0x38')],_0x1d0d0b[_0x4e6e('0x39')]));if(_0x4f667b['query'][_0x4e6e('0x42')]){_0x46deb5['where']=_[_0x4e6e('0x43')](_0x46deb5[_0x4e6e('0x44')],{'$or':_[_0x4e6e('0x45')](_0x34909a,function(_0x41b44b){if(_0x41b44b[_0x4e6e('0x46')][_0x4e6e('0x47')]!==_0x4e6e('0x48')){var _0x4c5b7d={};_0x4c5b7d[_0x41b44b[_0x4e6e('0x49')]]={'$like':'%'+_0x4f667b[_0x4e6e('0x38')]['filter']+'%'};return _0x4c5b7d;}})});}_0x46deb5=_['merge']({},_0x46deb5,_0x4f667b[_0x4e6e('0x4a')]);var _0x2a63fb={'where':_0x46deb5[_0x4e6e('0x44')]};return db[_0x4e6e('0x34')]['count'](_0x2a63fb)[_0x4e6e('0x1d')](function(_0x23ad60){_0x1d5902[_0x4e6e('0x4b')]=_0x23ad60;if(_0x4f667b[_0x4e6e('0x38')][_0x4e6e('0x4c')]){_0x46deb5[_0x4e6e('0x4d')]=[{'all':!![]}];}return db[_0x4e6e('0x34')]['findAll'](_0x46deb5);})['then'](function(_0x33745d){_0x1d5902[_0x4e6e('0x4e')]=_0x33745d;return _0x1d5902;})[_0x4e6e('0x1d')](respondWithFilteredResult(_0x1bf5ea,_0x46deb5))['catch'](handleError(_0x1bf5ea,null));};exports[_0x4e6e('0x4f')]=function(_0x1cc8eb,_0x3553b5){var _0x45635f={'raw':![],'where':{'id':_0x1cc8eb[_0x4e6e('0x50')]['id']}},_0x5001f0={};_0x5001f0[_0x4e6e('0x36')]=_['keys'](db['FreshdeskAccount'][_0x4e6e('0x35')]);_0x5001f0['query']=_[_0x4e6e('0x37')](_0x1cc8eb[_0x4e6e('0x38')]);_0x5001f0[_0x4e6e('0x39')]=_[_0x4e6e('0x3a')](_0x5001f0[_0x4e6e('0x36')],_0x5001f0['query']);_0x45635f['attributes']=_[_0x4e6e('0x3a')](_0x5001f0[_0x4e6e('0x36')],qs[_0x4e6e('0x3c')](_0x1cc8eb['query']['fields']));_0x45635f[_0x4e6e('0x3b')]=_0x45635f['attributes'][_0x4e6e('0x3d')]?_0x45635f[_0x4e6e('0x3b')]:_0x5001f0[_0x4e6e('0x36')];if(_0x1cc8eb[_0x4e6e('0x38')][_0x4e6e('0x4c')]){_0x45635f[_0x4e6e('0x4d')]=[{'all':!![]}];}_0x45635f=_[_0x4e6e('0x43')]({},_0x45635f,_0x1cc8eb[_0x4e6e('0x4a')]);return db[_0x4e6e('0x34')][_0x4e6e('0x51')](_0x45635f)[_0x4e6e('0x1d')](handleEntityNotFound(_0x3553b5,null))[_0x4e6e('0x1d')](respondWithResult(_0x3553b5,null))[_0x4e6e('0x25')](handleError(_0x3553b5,null));};exports[_0x4e6e('0x52')]=function(_0x4d6858,_0x18fd1d){return db[_0x4e6e('0x34')][_0x4e6e('0x52')](_0x4d6858['body'],{})[_0x4e6e('0x1d')](respondWithResult(_0x18fd1d,0xc9))[_0x4e6e('0x25')](handleError(_0x18fd1d,null));};exports[_0x4e6e('0x2f')]=function(_0x5e6d92,_0x34870d){if(_0x5e6d92['body']['id']){delete _0x5e6d92[_0x4e6e('0x53')]['id'];}return db['FreshdeskAccount'][_0x4e6e('0x51')]({'where':{'id':_0x5e6d92[_0x4e6e('0x50')]['id']}})[_0x4e6e('0x1d')](handleEntityNotFound(_0x34870d,null))['then'](saveUpdates(_0x5e6d92[_0x4e6e('0x53')],null))[_0x4e6e('0x1d')](respondWithResult(_0x34870d,null))[_0x4e6e('0x25')](handleError(_0x34870d,null));};exports[_0x4e6e('0x30')]=function(_0xf02b55,_0x5f02bb){return db[_0x4e6e('0x34')][_0x4e6e('0x51')]({'where':{'id':_0xf02b55[_0x4e6e('0x50')]['id']}})[_0x4e6e('0x1d')](handleEntityNotFound(_0x5f02bb,null))[_0x4e6e('0x1d')](removeEntity(_0x5f02bb,null))[_0x4e6e('0x25')](handleError(_0x5f02bb,null));};exports['getConfigurations']=function(_0x58a84e,_0x48f3b7,_0x3c14ce){var _0x4001db={};var _0x20f1d8={};var _0x6e435b;var _0x2968ba;return db[_0x4e6e('0x34')]['findOne']({'where':{'id':_0x58a84e[_0x4e6e('0x50')]['id']}})[_0x4e6e('0x1d')](handleEntityNotFound(_0x48f3b7,null))[_0x4e6e('0x1d')](function(_0x97bcae){if(_0x97bcae){_0x6e435b=_0x97bcae;_0x20f1d8[_0x4e6e('0x36')]=_[_0x4e6e('0x37')](db[_0x4e6e('0x54')]['rawAttributes']);_0x20f1d8[_0x4e6e('0x38')]=_['keys'](_0x58a84e[_0x4e6e('0x38')]);_0x20f1d8['filters']=_[_0x4e6e('0x3a')](_0x20f1d8['model'],_0x20f1d8['query']);_0x4001db[_0x4e6e('0x3b')]=_[_0x4e6e('0x3a')](_0x20f1d8[_0x4e6e('0x36')],qs['fields'](_0x58a84e[_0x4e6e('0x38')]['fields']));_0x4001db[_0x4e6e('0x3b')]=_0x4001db['attributes'][_0x4e6e('0x3d')]?_0x4001db[_0x4e6e('0x3b')]:_0x20f1d8[_0x4e6e('0x36')];_0x4001db[_0x4e6e('0x3f')]=qs[_0x4e6e('0x40')](_0x58a84e[_0x4e6e('0x38')][_0x4e6e('0x40')]);_0x4001db[_0x4e6e('0x44')]=qs[_0x4e6e('0x39')](_['pick'](_0x58a84e[_0x4e6e('0x38')],_0x20f1d8['filters']));if(_0x58a84e['query']['filter']){_0x4001db[_0x4e6e('0x44')]=_[_0x4e6e('0x43')](_0x4001db[_0x4e6e('0x44')],{'$or':_['map'](_0x4001db['attributes'],function(_0x29152e){var _0x579974={};_0x579974[_0x29152e]={'$like':'%'+_0x58a84e[_0x4e6e('0x38')]['filter']+'%'};return _0x579974;})});}_0x4001db=_[_0x4e6e('0x43')]({},_0x4001db,_0x58a84e['options']);return _0x6e435b[_0x4e6e('0x55')](_0x4001db);}})[_0x4e6e('0x1d')](function(_0x229109){if(_0x229109){_0x2968ba=_0x229109[_0x4e6e('0x3d')];if(!_0x58a84e[_0x4e6e('0x38')][_0x4e6e('0x3e')](_0x4e6e('0x56'))){_0x4001db[_0x4e6e('0x2b')]=qs[_0x4e6e('0x2b')](_0x58a84e[_0x4e6e('0x38')][_0x4e6e('0x2b')]);_0x4001db[_0x4e6e('0x2a')]=qs[_0x4e6e('0x2a')](_0x58a84e[_0x4e6e('0x38')][_0x4e6e('0x2a')]);}return _0x6e435b[_0x4e6e('0x55')](_0x4001db);}})[_0x4e6e('0x1d')](function(_0x3c3d7f){if(_0x3c3d7f){return _0x3c3d7f?{'count':_0x2968ba,'rows':_0x3c3d7f}:null;}})[_0x4e6e('0x1d')](respondWithResult(_0x48f3b7,null))['catch'](handleError(_0x48f3b7,null));};exports[_0x4e6e('0x57')]=function(_0x9358b0,_0x393f1d,_0x4d88ed){if(_0x9358b0[_0x4e6e('0x53')]['id']){delete _0x9358b0[_0x4e6e('0x53')]['id'];}return db['FreshdeskAccount'][_0x4e6e('0x58')]({'where':{'id':_0x9358b0[_0x4e6e('0x50')]['id']}})[_0x4e6e('0x1d')](handleEntityNotFound(_0x393f1d,null))['then'](function(_0x131b24){if(_0x131b24){_0x9358b0['body']['AccountId']=_0x131b24['id'];_0x9358b0['body'][_0x4e6e('0x59')]=integrations[_0x4e6e('0x5a')](_0x9358b0[_0x4e6e('0x53')]['channel'],_0x9358b0['body'][_0x4e6e('0x46')]);_0x9358b0[_0x4e6e('0x53')][_0x4e6e('0x5b')]=integrations['getDescriptions'](_0x9358b0['body'][_0x4e6e('0x5c')],_0x9358b0[_0x4e6e('0x53')]['type']);return db[_0x4e6e('0x54')]['create'](_0x9358b0[_0x4e6e('0x53')],{'include':[{'model':db[_0x4e6e('0x5d')],'as':'Subjects'},{'model':db[_0x4e6e('0x5d')],'as':_0x4e6e('0x5b')}]});}return null;})['then'](respondWithResult(_0x393f1d,null))[_0x4e6e('0x25')](handleError(_0x393f1d,null));};exports['getFields']=function(_0x4f5d22,_0x284220,_0x170e5d){var _0x7bb040='';return db[_0x4e6e('0x34')][_0x4e6e('0x58')]({'where':{'id':_0x4f5d22[_0x4e6e('0x50')]['id']},'attributes':['id',_0x4e6e('0x5e'),_0x4e6e('0x5f')]})[_0x4e6e('0x1d')](handleEntityNotFound(_0x284220,null))[_0x4e6e('0x1d')](function(_0x20fcfa){if(_0x20fcfa){_0x7bb040=_0x20fcfa[_0x4e6e('0x5e')];var _0x32871a=_0x7bb040[_0x4e6e('0x60')](-0x1);if(_0x32871a==='/'){_0x7bb040=_0x7bb040[_0x4e6e('0x61')](0x0,_0x7bb040['lastIndexOf'](_0x32871a));}return rp({'method':_0x4e6e('0x62'),'uri':util[_0x4e6e('0x63')](_0x4e6e('0x64'),_0x7bb040,_0x4e6e('0x65')),'headers':{'Authorization':util[_0x4e6e('0x63')](_0x4e6e('0x66'),new Buffer(util['format'](_0x4e6e('0x67'),_0x20fcfa[_0x4e6e('0x5f')]))[_0x4e6e('0x68')](_0x4e6e('0x69')))},'json':!![]});}})[_0x4e6e('0x1d')](function(_0xeee70a){if(_0xeee70a){var _0x2e5639=[_0x4e6e('0x6a'),'subject','agent','description',_0x4e6e('0x28'),_0x4e6e('0x6b'),_0x4e6e('0x6c'),'source',_0x4e6e('0x6d'),_0x4e6e('0x6c'),'company'];_[_0x4e6e('0x6e')](_0xeee70a,function(_0x423be3){return _0x2e5639[_0x4e6e('0x6f')](_0x423be3[_0x4e6e('0x32')])||!_0x423be3['default']&&_0x423be3[_0x4e6e('0x46')]!=='custom_text'&&_0x423be3[_0x4e6e('0x46')]!=='custom_dropdown';});return{'count':_0xeee70a['length'],'rows':_[_0x4e6e('0x45')](_0xeee70a,function(_0x531d60){return{'id':_0x531d60[_0x4e6e('0x32')],'name':_0x531d60['label'],'custom':!_0x531d60[_0x4e6e('0x70')],'options':_0x531d60['choices']?_[_0x4e6e('0x45')](_0x531d60[_0x4e6e('0x71')],function(_0x43f266){return{'name':_[_0x4e6e('0x72')](_0x43f266),'value':_0x43f266};}):[]};})};}})[_0x4e6e('0x1d')](respondWithResult(_0x284220,null))[_0x4e6e('0x25')](function(_0x47b31d){var _0x267e3c=_0x4f5d22['query'][_0x4e6e('0x73')]?0x1f4:_0x47b31d[_0x4e6e('0x74')]||0x1f4;logger[_0x4e6e('0x21')](_0x4e6e('0x75'),_0x4e6e('0x76'),_0x267e3c,JSON[_0x4e6e('0x20')](_0x47b31d));delete _0x47b31d['name'];if(_0x267e3c===0x191){_0x267e3c=0x190;}_0x284220[_0x4e6e('0x28')](_0x267e3c)[_0x4e6e('0x77')](_0x4f5d22[_0x4e6e('0x38')][_0x4e6e('0x73')]?{'message':_0x4e6e('0x78'),'statusCode':_0x47b31d[_0x4e6e('0x74')]}:_0x47b31d);});}; \ No newline at end of file +var _0xf65d=['slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','count','offset','limit','status','set','Content-Range','json','apply','reject','update','end','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','map','type','VIRTUAL','FreshdeskAccount','includeAll','include','findAll','catch','show','params','options','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','getFields','apiKey','remoteUri'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf65d,0x9f));var _0xdf65=function(_0x2bcd9e,_0x1bef3a){_0x2bcd9e=_0x2bcd9e-0x0;var _0xc3ccf4=_0xf65d[_0x2bcd9e];return _0xc3ccf4;};'use strict';var pdf=require(_0xdf65('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf65('0x1'));var zipdir=require(_0xdf65('0x2'));var jsonpatch=require(_0xdf65('0x3'));var rp=require(_0xdf65('0x4'));var moment=require(_0xdf65('0x5'));var BPromise=require(_0xdf65('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf65('0x7'));var csv=require('to-csv');var ejs=require(_0xdf65('0x8'));var fs=require('fs');var _=require(_0xdf65('0x9'));var squel=require('squel');var crypto=require(_0xdf65('0xa'));var jsforce=require(_0xdf65('0xb'));var deskjs=require(_0xdf65('0xc'));var toCsv=require(_0xdf65('0xd'));var querystring=require(_0xdf65('0xe'));var Papa=require(_0xdf65('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xdf65('0x10'));var Redis=require('ioredis');var qs=require(_0xdf65('0x11'));var logger=require(_0xdf65('0x12'))(_0xdf65('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdf65('0x14'))['db'];var integrations=require(_0xdf65('0x15'));var jayson=require(_0xdf65('0x16'));var client=jayson[_0xdf65('0x17')][_0xdf65('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x42cfce,_0x4ac8af,_0x2cef10,_0x244ac7){return new BPromise(function(_0x51f281,_0x50de22){var _0x5a0ae1=_0x244ac7||client;return _0x5a0ae1[_0xdf65('0x19')](_0x42cfce,_0x2cef10)[_0xdf65('0x1a')](function(_0x11f0e3){logger[_0xdf65('0x1b')](_0xdf65('0x1c'),_0x4ac8af,_0xdf65('0x1d'));logger[_0xdf65('0x1e')](_0xdf65('0x1f'),_0x4ac8af,_0xdf65('0x1d'),JSON[_0xdf65('0x20')](_0x11f0e3));if(_0x11f0e3['error']){if(_0x11f0e3[_0xdf65('0x21')]['code']===0x1f4){logger[_0xdf65('0x21')](_0xdf65('0x1c'),_0x4ac8af,_0x11f0e3[_0xdf65('0x21')][_0xdf65('0x22')]);return _0x50de22(_0x11f0e3[_0xdf65('0x21')][_0xdf65('0x22')]);}logger['error'](_0xdf65('0x1c'),_0x4ac8af,_0x11f0e3['error'][_0xdf65('0x22')]);return _0x51f281(_0x11f0e3[_0xdf65('0x21')][_0xdf65('0x22')]);}else{logger[_0xdf65('0x1b')](_0xdf65('0x1c'),_0x4ac8af,'request\x20sent');_0x51f281(_0x11f0e3[_0xdf65('0x23')][_0xdf65('0x22')]);}})['catch'](function(_0x45fb5f){logger[_0xdf65('0x21')](_0xdf65('0x1c'),_0x4ac8af,_0x45fb5f);_0x50de22(_0x45fb5f);});});}function respondWithStatusCode(_0x12e935,_0x529bf0){_0x529bf0=_0x529bf0||0xcc;return function(_0x2c6900){if(_0x2c6900){return _0x12e935[_0xdf65('0x24')](_0x529bf0);}return _0x12e935['status'](_0x529bf0)['end']();};}function respondWithResult(_0x14a54c,_0x3957e5){_0x3957e5=_0x3957e5||0xc8;return function(_0x3d0aea){if(_0x3d0aea){return _0x14a54c['status'](_0x3957e5)['json'](_0x3d0aea);}};}function respondWithFilteredResult(_0xc61dab,_0x1c958a){return function(_0x513807){if(_0x513807){var _0x513d12=_0x513807[_0xdf65('0x25')],_0x5d8c67=_0x1c958a['offset'],_0x364606=_0x1c958a[_0xdf65('0x26')]+_0x1c958a[_0xdf65('0x27')],_0x5b5147;if(_0x364606>=_0x513d12){_0x364606=_0x513d12;_0x5b5147=0xc8;}else{_0x5b5147=0xce;}_0xc61dab[_0xdf65('0x28')](_0x5b5147);return _0xc61dab[_0xdf65('0x29')](_0xdf65('0x2a'),_0x5d8c67+'-'+_0x364606+'/'+_0x513d12)[_0xdf65('0x2b')](_0x513807);}return null;};}function patchUpdates(_0x220402){return function(_0x41c1d6){try{jsonpatch[_0xdf65('0x2c')](_0x41c1d6,_0x220402,!![]);}catch(_0x12a732){return BPromise[_0xdf65('0x2d')](_0x12a732);}return _0x41c1d6['save']();};}function saveUpdates(_0x4a40fb,_0x183e04){return function(_0x2262d0){if(_0x2262d0){return _0x2262d0[_0xdf65('0x2e')](_0x4a40fb)['then'](function(_0x3a4005){return _0x3a4005;});}return null;};}function removeEntity(_0x54648a,_0x46d275){return function(_0x3de60c){if(_0x3de60c){return _0x3de60c['destroy']()[_0xdf65('0x1a')](function(){_0x54648a[_0xdf65('0x28')](0xcc)[_0xdf65('0x2f')]();});}};}function handleEntityNotFound(_0x39a13b,_0xb395a8){return function(_0x476a0d){if(!_0x476a0d){_0x39a13b['sendStatus'](0x194);}return _0x476a0d;};}function handleError(_0x583871,_0x46d625){_0x46d625=_0x46d625||0x1f4;return function(_0x47a9c1){logger[_0xdf65('0x21')](_0x47a9c1[_0xdf65('0x30')]);if(_0x47a9c1[_0xdf65('0x31')]){delete _0x47a9c1['name'];}_0x583871[_0xdf65('0x28')](_0x46d625)[_0xdf65('0x32')](_0x47a9c1);};}exports[_0xdf65('0x33')]=function(_0x3b2194,_0x27ac6b){var _0x4d0bf2={},_0x13e9ce={},_0x664ee6={'count':0x0,'rows':[]};var _0x116164=db['FreshdeskAccount'][_0xdf65('0x34')];_0x13e9ce[_0xdf65('0x35')]=_[_0xdf65('0x36')](_0x116164);_0x13e9ce[_0xdf65('0x37')]=_[_0xdf65('0x36')](_0x3b2194['query']);_0x13e9ce['filters']=_[_0xdf65('0x38')](_0x13e9ce[_0xdf65('0x35')],_0x13e9ce[_0xdf65('0x37')]);_0x4d0bf2['attributes']=_[_0xdf65('0x38')](_0x13e9ce['model'],qs[_0xdf65('0x39')](_0x3b2194[_0xdf65('0x37')][_0xdf65('0x39')]));_0x4d0bf2['attributes']=_0x4d0bf2[_0xdf65('0x3a')][_0xdf65('0x3b')]?_0x4d0bf2[_0xdf65('0x3a')]:_0x13e9ce[_0xdf65('0x35')];if(!_0x3b2194[_0xdf65('0x37')][_0xdf65('0x3c')](_0xdf65('0x3d'))){_0x4d0bf2[_0xdf65('0x27')]=qs['limit'](_0x3b2194[_0xdf65('0x37')][_0xdf65('0x27')]);_0x4d0bf2[_0xdf65('0x26')]=qs['offset'](_0x3b2194['query'][_0xdf65('0x26')]);}_0x4d0bf2['order']=qs[_0xdf65('0x3e')](_0x3b2194['query']['sort']);_0x4d0bf2['where']=qs[_0xdf65('0x3f')](_[_0xdf65('0x40')](_0x3b2194[_0xdf65('0x37')],_0x13e9ce['filters']));if(_0x3b2194['query'][_0xdf65('0x41')]){_0x4d0bf2['where']=_[_0xdf65('0x42')](_0x4d0bf2[_0xdf65('0x43')],{'$or':_[_0xdf65('0x44')](_0x116164,function(_0x524923){if(_0x524923[_0xdf65('0x45')]['key']!==_0xdf65('0x46')){var _0xe6228a={};_0xe6228a[_0x524923['field']]={'$like':'%'+_0x3b2194[_0xdf65('0x37')][_0xdf65('0x41')]+'%'};return _0xe6228a;}})});}_0x4d0bf2=_[_0xdf65('0x42')]({},_0x4d0bf2,_0x3b2194['options']);var _0x3a18f0={'where':_0x4d0bf2[_0xdf65('0x43')]};return db[_0xdf65('0x47')][_0xdf65('0x25')](_0x3a18f0)[_0xdf65('0x1a')](function(_0x13eef6){_0x664ee6[_0xdf65('0x25')]=_0x13eef6;if(_0x3b2194['query'][_0xdf65('0x48')]){_0x4d0bf2[_0xdf65('0x49')]=[{'all':!![]}];}return db[_0xdf65('0x47')][_0xdf65('0x4a')](_0x4d0bf2);})[_0xdf65('0x1a')](function(_0x5e36cf){_0x664ee6['rows']=_0x5e36cf;return _0x664ee6;})[_0xdf65('0x1a')](respondWithFilteredResult(_0x27ac6b,_0x4d0bf2))[_0xdf65('0x4b')](handleError(_0x27ac6b,null));};exports[_0xdf65('0x4c')]=function(_0x3b9d48,_0x17ef62){var _0x369d38={'raw':![],'where':{'id':_0x3b9d48[_0xdf65('0x4d')]['id']}},_0x281fc8={};_0x281fc8[_0xdf65('0x35')]=_[_0xdf65('0x36')](db['FreshdeskAccount'][_0xdf65('0x34')]);_0x281fc8[_0xdf65('0x37')]=_['keys'](_0x3b9d48[_0xdf65('0x37')]);_0x281fc8[_0xdf65('0x3f')]=_[_0xdf65('0x38')](_0x281fc8['model'],_0x281fc8[_0xdf65('0x37')]);_0x369d38[_0xdf65('0x3a')]=_[_0xdf65('0x38')](_0x281fc8['model'],qs[_0xdf65('0x39')](_0x3b9d48['query']['fields']));_0x369d38['attributes']=_0x369d38[_0xdf65('0x3a')][_0xdf65('0x3b')]?_0x369d38['attributes']:_0x281fc8[_0xdf65('0x35')];if(_0x3b9d48[_0xdf65('0x37')][_0xdf65('0x48')]){_0x369d38['include']=[{'all':!![]}];}_0x369d38=_[_0xdf65('0x42')]({},_0x369d38,_0x3b9d48[_0xdf65('0x4e')]);return db[_0xdf65('0x47')][_0xdf65('0x4f')](_0x369d38)['then'](handleEntityNotFound(_0x17ef62,null))[_0xdf65('0x1a')](respondWithResult(_0x17ef62,null))[_0xdf65('0x4b')](handleError(_0x17ef62,null));};exports[_0xdf65('0x50')]=function(_0x3117f5,_0x2f9eb8){return db[_0xdf65('0x47')][_0xdf65('0x50')](_0x3117f5[_0xdf65('0x51')],{})[_0xdf65('0x1a')](respondWithResult(_0x2f9eb8,0xc9))['catch'](handleError(_0x2f9eb8,null));};exports[_0xdf65('0x2e')]=function(_0x3ba49f,_0x48c9eb){if(_0x3ba49f[_0xdf65('0x51')]['id']){delete _0x3ba49f[_0xdf65('0x51')]['id'];}return db[_0xdf65('0x47')][_0xdf65('0x4f')]({'where':{'id':_0x3ba49f[_0xdf65('0x4d')]['id']}})[_0xdf65('0x1a')](handleEntityNotFound(_0x48c9eb,null))[_0xdf65('0x1a')](saveUpdates(_0x3ba49f[_0xdf65('0x51')],null))[_0xdf65('0x1a')](respondWithResult(_0x48c9eb,null))[_0xdf65('0x4b')](handleError(_0x48c9eb,null));};exports['destroy']=function(_0x1e09b4,_0x217ff2){return db[_0xdf65('0x47')][_0xdf65('0x4f')]({'where':{'id':_0x1e09b4[_0xdf65('0x4d')]['id']}})[_0xdf65('0x1a')](handleEntityNotFound(_0x217ff2,null))['then'](removeEntity(_0x217ff2,null))[_0xdf65('0x4b')](handleError(_0x217ff2,null));};exports[_0xdf65('0x52')]=function(_0x1777a1,_0x54528d,_0x433201){var _0x350ea7={};var _0x4628c4={};var _0x2fc66c;var _0x46a9da;return db[_0xdf65('0x47')]['findOne']({'where':{'id':_0x1777a1[_0xdf65('0x4d')]['id']}})[_0xdf65('0x1a')](handleEntityNotFound(_0x54528d,null))[_0xdf65('0x1a')](function(_0x4bfa3c){if(_0x4bfa3c){_0x2fc66c=_0x4bfa3c;_0x4628c4['model']=_[_0xdf65('0x36')](db[_0xdf65('0x53')][_0xdf65('0x34')]);_0x4628c4['query']=_[_0xdf65('0x36')](_0x1777a1[_0xdf65('0x37')]);_0x4628c4[_0xdf65('0x3f')]=_['intersection'](_0x4628c4['model'],_0x4628c4[_0xdf65('0x37')]);_0x350ea7['attributes']=_['intersection'](_0x4628c4[_0xdf65('0x35')],qs['fields'](_0x1777a1[_0xdf65('0x37')][_0xdf65('0x39')]));_0x350ea7[_0xdf65('0x3a')]=_0x350ea7[_0xdf65('0x3a')][_0xdf65('0x3b')]?_0x350ea7['attributes']:_0x4628c4[_0xdf65('0x35')];_0x350ea7['order']=qs['sort'](_0x1777a1[_0xdf65('0x37')][_0xdf65('0x3e')]);_0x350ea7[_0xdf65('0x43')]=qs[_0xdf65('0x3f')](_[_0xdf65('0x40')](_0x1777a1[_0xdf65('0x37')],_0x4628c4[_0xdf65('0x3f')]));if(_0x1777a1['query'][_0xdf65('0x41')]){_0x350ea7['where']=_[_0xdf65('0x42')](_0x350ea7[_0xdf65('0x43')],{'$or':_['map'](_0x350ea7[_0xdf65('0x3a')],function(_0x841b2e){var _0xcf5583={};_0xcf5583[_0x841b2e]={'$like':'%'+_0x1777a1[_0xdf65('0x37')][_0xdf65('0x41')]+'%'};return _0xcf5583;})});}_0x350ea7=_['merge']({},_0x350ea7,_0x1777a1[_0xdf65('0x4e')]);return _0x2fc66c[_0xdf65('0x52')](_0x350ea7);}})[_0xdf65('0x1a')](function(_0x3d12a2){if(_0x3d12a2){_0x46a9da=_0x3d12a2[_0xdf65('0x3b')];if(!_0x1777a1[_0xdf65('0x37')][_0xdf65('0x3c')]('nolimit')){_0x350ea7[_0xdf65('0x27')]=qs[_0xdf65('0x27')](_0x1777a1[_0xdf65('0x37')]['limit']);_0x350ea7[_0xdf65('0x26')]=qs[_0xdf65('0x26')](_0x1777a1['query']['offset']);}return _0x2fc66c['getConfigurations'](_0x350ea7);}})['then'](function(_0x4859fb){if(_0x4859fb){return _0x4859fb?{'count':_0x46a9da,'rows':_0x4859fb}:null;}})[_0xdf65('0x1a')](respondWithResult(_0x54528d,null))[_0xdf65('0x4b')](handleError(_0x54528d,null));};exports[_0xdf65('0x54')]=function(_0x54209f,_0x803ab4,_0x25e53a){if(_0x54209f['body']['id']){delete _0x54209f[_0xdf65('0x51')]['id'];}return db[_0xdf65('0x47')][_0xdf65('0x55')]({'where':{'id':_0x54209f[_0xdf65('0x4d')]['id']}})['then'](handleEntityNotFound(_0x803ab4,null))['then'](function(_0x55268b){if(_0x55268b){_0x54209f[_0xdf65('0x51')][_0xdf65('0x56')]=_0x55268b['id'];_0x54209f[_0xdf65('0x51')][_0xdf65('0x57')]=integrations[_0xdf65('0x58')](_0x54209f[_0xdf65('0x51')]['channel'],_0x54209f[_0xdf65('0x51')][_0xdf65('0x45')]);_0x54209f[_0xdf65('0x51')][_0xdf65('0x59')]=integrations['getDescriptions'](_0x54209f['body'][_0xdf65('0x5a')],_0x54209f[_0xdf65('0x51')]['type']);return db[_0xdf65('0x53')]['create'](_0x54209f[_0xdf65('0x51')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0xdf65('0x5b')],'as':'Descriptions'}]});}return null;})[_0xdf65('0x1a')](respondWithResult(_0x803ab4,null))[_0xdf65('0x4b')](handleError(_0x803ab4,null));};exports[_0xdf65('0x5c')]=function(_0x12f469,_0xc39904,_0x2dea75){var _0x42641c='';return db[_0xdf65('0x47')][_0xdf65('0x55')]({'where':{'id':_0x12f469[_0xdf65('0x4d')]['id']},'attributes':['id','remoteUri',_0xdf65('0x5d')]})[_0xdf65('0x1a')](handleEntityNotFound(_0xc39904,null))[_0xdf65('0x1a')](function(_0x518f95){if(_0x518f95){_0x42641c=_0x518f95[_0xdf65('0x5e')];var _0x3af99b=_0x42641c[_0xdf65('0x5f')](-0x1);if(_0x3af99b==='/'){_0x42641c=_0x42641c[_0xdf65('0x60')](0x0,_0x42641c[_0xdf65('0x61')](_0x3af99b));}return rp({'method':_0xdf65('0x62'),'uri':util[_0xdf65('0x63')](_0xdf65('0x64'),_0x42641c,_0xdf65('0x65')),'headers':{'Authorization':util[_0xdf65('0x63')](_0xdf65('0x66'),new Buffer(util['format'](_0xdf65('0x67'),_0x518f95['apiKey']))[_0xdf65('0x68')](_0xdf65('0x69')))},'json':!![]});}})[_0xdf65('0x1a')](function(_0x411379){if(_0x411379){var _0x39d1fe=[_0xdf65('0x6a'),_0xdf65('0x6b'),_0xdf65('0x6c'),_0xdf65('0x6d'),_0xdf65('0x28'),_0xdf65('0x6e'),_0xdf65('0x6f'),_0xdf65('0x70'),_0xdf65('0x71'),'group',_0xdf65('0x72')];_[_0xdf65('0x73')](_0x411379,function(_0x121200){return _0x39d1fe[_0xdf65('0x74')](_0x121200[_0xdf65('0x31')])||!_0x121200[_0xdf65('0x75')]&&_0x121200[_0xdf65('0x45')]!==_0xdf65('0x76')&&_0x121200[_0xdf65('0x45')]!==_0xdf65('0x77');});return{'count':_0x411379[_0xdf65('0x3b')],'rows':_['map'](_0x411379,function(_0x8644d0){return{'id':_0x8644d0[_0xdf65('0x31')],'name':_0x8644d0[_0xdf65('0x78')],'custom':!_0x8644d0[_0xdf65('0x75')],'options':_0x8644d0[_0xdf65('0x79')]?_[_0xdf65('0x44')](_0x8644d0[_0xdf65('0x79')],function(_0x2c6923){return{'name':_[_0xdf65('0x7a')](_0x2c6923),'value':_0x2c6923};}):[]};})};}})[_0xdf65('0x1a')](respondWithResult(_0xc39904,null))['catch'](function(_0x142fd2){var _0x4c5b12=_0x12f469[_0xdf65('0x37')]['test']?0x1f4:_0x142fd2['statusCode']||0x1f4;logger['error'](_0xdf65('0x7b'),_0xdf65('0x5c'),_0x4c5b12,JSON[_0xdf65('0x20')](_0x142fd2));delete _0x142fd2['name'];if(_0x4c5b12===0x191){_0x4c5b12=0x190;}_0xc39904[_0xdf65('0x28')](_0x4c5b12)[_0xdf65('0x32')](_0x12f469[_0xdf65('0x37')][_0xdf65('0x7c')]?{'message':_0xdf65('0x7d'),'statusCode':_0x142fd2[_0xdf65('0x7e')]}:_0x142fd2);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 424e854..f2b3b9b 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 _0xbb59=['bluebird','request-promise','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','../../config/logger','api','moment'];(function(_0x3db1bd,_0x33e6e2){var _0x47f8a7=function(_0xb3084e){while(--_0xb3084e){_0x3db1bd['push'](_0x3db1bd['shift']());}};_0x47f8a7(++_0x33e6e2);}(_0xbb59,0x1d2));var _0x9bb5=function(_0x297841,_0x42c90c){_0x297841=_0x297841-0x0;var _0x4f9ee1=_0xbb59[_0x297841];return _0x4f9ee1;};'use strict';var _=require(_0x9bb5('0x0'));var util=require('util');var logger=require(_0x9bb5('0x1'))(_0x9bb5('0x2'));var moment=require(_0x9bb5('0x3'));var BPromise=require(_0x9bb5('0x4'));var rp=require(_0x9bb5('0x5'));var attributes=require(_0x9bb5('0x6'));var integrations=require(_0x9bb5('0x7'));module[_0x9bb5('0x8')]=function(_0xd0fe9f,_0x1845e9){return _0xd0fe9f[_0x9bb5('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa179=['util','api','moment','request-promise','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa179,0x1c1));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var logger=require('../../config/logger')(_0x9a17('0x2'));var moment=require(_0x9a17('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a17('0x4'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9a17('0x5'));module[_0x9a17('0x6')]=function(_0x214aa8,_0x45e316){return _0x214aa8[_0x9a17('0x7')]('FreshdeskAccount',attributes,{'tableName':_0x9a17('0x8'),'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 761118f..a9e70ae 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 _0x14b3=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','limit','include','map','model','then','catch','ShowFreshdeskAccount','find','raw','where','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x14b3,0xb3));var _0x314b=function(_0x2451ae,_0x2ff3a4){_0x2451ae=_0x2451ae-0x0;var _0x5d6db9=_0x14b3[_0x2451ae];return _0x5d6db9;};'use strict';var _=require('lodash');var util=require(_0x314b('0x0'));var moment=require('moment');var BPromise=require(_0x314b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x314b('0x2'));var db=require(_0x314b('0x3'))['db'];var utils=require(_0x314b('0x4'));var logger=require(_0x314b('0x5'))(_0x314b('0x6'));var config=require(_0x314b('0x7'));var jayson=require(_0x314b('0x8'));var client=jayson[_0x314b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x222bf4,_0x8bcfa1,_0x40ba71){return new BPromise(function(_0x2b5c46,_0xf43f14){return client[_0x314b('0xa')](_0x222bf4,_0x40ba71)['then'](function(_0x559dbf){logger[_0x314b('0xb')](_0x314b('0xc'),_0x8bcfa1,_0x314b('0xd'));logger[_0x314b('0xe')](_0x314b('0xf'),_0x8bcfa1,_0x314b('0xd'),JSON[_0x314b('0x10')](_0x559dbf));if(_0x559dbf['error']){if(_0x559dbf[_0x314b('0x11')][_0x314b('0x12')]===0x1f4){logger[_0x314b('0x11')](_0x314b('0xc'),_0x8bcfa1,_0x559dbf[_0x314b('0x11')][_0x314b('0x13')]);return _0xf43f14(_0x559dbf[_0x314b('0x11')]['message']);}logger[_0x314b('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x8bcfa1,_0x559dbf[_0x314b('0x11')][_0x314b('0x13')]);return _0x2b5c46(_0x559dbf['error'][_0x314b('0x13')]);}else{logger[_0x314b('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x8bcfa1,_0x314b('0xd'));_0x2b5c46(_0x559dbf[_0x314b('0x14')][_0x314b('0x13')]);}})['catch'](function(_0x1a7469){logger[_0x314b('0x11')](_0x314b('0xc'),_0x8bcfa1,_0x1a7469);_0xf43f14(_0x1a7469);});});}exports[_0x314b('0x15')]=function(_0x3ba3d1){var _0x2ee5c2=this;return new Promise(function(_0x290992,_0x4a0b4e){return db[_0x314b('0x16')][_0x314b('0x17')]({'raw':_0x3ba3d1['options']?_0x3ba3d1[_0x314b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3ba3d1[_0x314b('0x18')]?_0x3ba3d1['options']['where']||null:null,'attributes':_0x3ba3d1['options']?_0x3ba3d1[_0x314b('0x18')][_0x314b('0x19')]||null:null,'limit':_0x3ba3d1[_0x314b('0x18')]?_0x3ba3d1[_0x314b('0x18')][_0x314b('0x1a')]||null:null,'include':_0x3ba3d1[_0x314b('0x18')]?_0x3ba3d1[_0x314b('0x18')][_0x314b('0x1b')]?_[_0x314b('0x1c')](_0x3ba3d1[_0x314b('0x18')][_0x314b('0x1b')],function(_0x3d085a){return{'model':db[_0x3d085a[_0x314b('0x1d')]],'as':_0x3d085a['as'],'attributes':_0x3d085a[_0x314b('0x19')],'include':_0x3d085a[_0x314b('0x1b')]?_['map'](_0x3d085a[_0x314b('0x1b')],function(_0x29bccf){return{'model':db[_0x29bccf['model']],'as':_0x29bccf['as'],'attributes':_0x29bccf[_0x314b('0x19')],'include':_0x29bccf[_0x314b('0x1b')]?_[_0x314b('0x1c')](_0x29bccf[_0x314b('0x1b')],function(_0x392236){return{'model':db[_0x392236[_0x314b('0x1d')]],'as':_0x392236['as'],'attributes':_0x392236[_0x314b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x314b('0x1e')](function(_0x52b2b5){logger[_0x314b('0xb')]('GetFreshdeskAccount',_0x3ba3d1);logger[_0x314b('0xe')](_0x314b('0x15'),_0x3ba3d1,JSON[_0x314b('0x10')](_0x52b2b5));_0x290992(_0x52b2b5);})[_0x314b('0x1f')](function(_0xae0013){logger['error']('GetFreshdeskAccount',_0xae0013['message'],_0x3ba3d1);_0x4a0b4e(_0x2ee5c2[_0x314b('0x11')](0x1f4,_0xae0013['message']));});});};exports[_0x314b('0x20')]=function(_0x43cbbf){var _0x1116be=this;return new Promise(function(_0x2dad3a,_0x2e056d){return db[_0x314b('0x16')][_0x314b('0x21')]({'raw':_0x43cbbf[_0x314b('0x18')]?_0x43cbbf[_0x314b('0x18')][_0x314b('0x22')]===undefined?!![]:![]:!![],'where':_0x43cbbf[_0x314b('0x18')]?_0x43cbbf[_0x314b('0x18')][_0x314b('0x23')]||null:null,'attributes':_0x43cbbf['options']?_0x43cbbf[_0x314b('0x18')][_0x314b('0x19')]||null:null,'include':_0x43cbbf['options']?_0x43cbbf[_0x314b('0x18')][_0x314b('0x1b')]?_['map'](_0x43cbbf['options']['include'],function(_0xd368f7){return{'model':db[_0xd368f7['model']],'as':_0xd368f7['as'],'attributes':_0xd368f7['attributes'],'include':_0xd368f7[_0x314b('0x1b')]?_[_0x314b('0x1c')](_0xd368f7[_0x314b('0x1b')],function(_0x593f0d){return{'model':db[_0x593f0d[_0x314b('0x1d')]],'as':_0x593f0d['as'],'attributes':_0x593f0d[_0x314b('0x19')],'include':_0x593f0d[_0x314b('0x1b')]?_[_0x314b('0x1c')](_0x593f0d[_0x314b('0x1b')],function(_0x434f23){return{'model':db[_0x434f23[_0x314b('0x1d')]],'as':_0x434f23['as'],'attributes':_0x434f23[_0x314b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x314b('0x1e')](function(_0x4c9229){logger[_0x314b('0xb')](_0x314b('0x20'),_0x43cbbf);logger[_0x314b('0xe')](_0x314b('0x20'),_0x43cbbf,JSON[_0x314b('0x10')](_0x4c9229));_0x2dad3a(_0x4c9229);})['catch'](function(_0x5e035e){logger[_0x314b('0x11')]('ShowFreshdeskAccount',_0x5e035e[_0x314b('0x13')],_0x43cbbf);_0x2e056d(_0x1116be['error'](0x1f4,_0x5e035e[_0x314b('0x13')]));});});}; \ No newline at end of file +var _0xc8de=['model','attributes','map','then','stringify','ShowFreshdeskAccount','find','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include'];(function(_0x408584,_0x1b4d0d){var _0x1265e4=function(_0xeea000){while(--_0xeea000){_0x408584['push'](_0x408584['shift']());}};_0x1265e4(++_0x1b4d0d);}(_0xc8de,0x11f));var _0xec8d=function(_0x2ab2cc,_0x3bfd0a){_0x2ab2cc=_0x2ab2cc-0x0;var _0x1db4b7=_0xc8de[_0x2ab2cc];return _0x1db4b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec8d('0x0'));var BPromise=require(_0xec8d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec8d('0x2'));var db=require(_0xec8d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xec8d('0x4'))(_0xec8d('0x5'));var config=require(_0xec8d('0x6'));var jayson=require(_0xec8d('0x7'));var client=jayson[_0xec8d('0x8')][_0xec8d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x281906,_0x5180a3,_0x41dbc1){return new BPromise(function(_0x411a0a,_0x5a583d){return client[_0xec8d('0xa')](_0x281906,_0x41dbc1)['then'](function(_0x59f174){logger[_0xec8d('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x5180a3,_0xec8d('0xc'));logger[_0xec8d('0xd')](_0xec8d('0xe'),_0x5180a3,_0xec8d('0xc'),JSON['stringify'](_0x59f174));if(_0x59f174[_0xec8d('0xf')]){if(_0x59f174['error'][_0xec8d('0x10')]===0x1f4){logger['error'](_0xec8d('0x11'),_0x5180a3,_0x59f174[_0xec8d('0xf')][_0xec8d('0x12')]);return _0x5a583d(_0x59f174['error'][_0xec8d('0x12')]);}logger[_0xec8d('0xf')](_0xec8d('0x11'),_0x5180a3,_0x59f174[_0xec8d('0xf')][_0xec8d('0x12')]);return _0x411a0a(_0x59f174[_0xec8d('0xf')][_0xec8d('0x12')]);}else{logger[_0xec8d('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x5180a3,'request\x20sent');_0x411a0a(_0x59f174[_0xec8d('0x13')][_0xec8d('0x12')]);}})[_0xec8d('0x14')](function(_0x9c85d3){logger[_0xec8d('0xf')](_0xec8d('0x11'),_0x5180a3,_0x9c85d3);_0x5a583d(_0x9c85d3);});});}exports[_0xec8d('0x15')]=function(_0x56a9c7){var _0x51a914=this;return new Promise(function(_0x1c1423,_0x2a88aa){return db[_0xec8d('0x16')]['findAll']({'raw':_0x56a9c7[_0xec8d('0x17')]?_0x56a9c7[_0xec8d('0x17')][_0xec8d('0x18')]===undefined?!![]:![]:!![],'where':_0x56a9c7[_0xec8d('0x17')]?_0x56a9c7['options'][_0xec8d('0x19')]||null:null,'attributes':_0x56a9c7['options']?_0x56a9c7[_0xec8d('0x17')]['attributes']||null:null,'limit':_0x56a9c7['options']?_0x56a9c7[_0xec8d('0x17')][_0xec8d('0x1a')]||null:null,'include':_0x56a9c7['options']?_0x56a9c7['options']['include']?_['map'](_0x56a9c7['options'][_0xec8d('0x1b')],function(_0x468eb8){return{'model':db[_0x468eb8[_0xec8d('0x1c')]],'as':_0x468eb8['as'],'attributes':_0x468eb8[_0xec8d('0x1d')],'include':_0x468eb8[_0xec8d('0x1b')]?_[_0xec8d('0x1e')](_0x468eb8[_0xec8d('0x1b')],function(_0x4887ab){return{'model':db[_0x4887ab[_0xec8d('0x1c')]],'as':_0x4887ab['as'],'attributes':_0x4887ab[_0xec8d('0x1d')],'include':_0x4887ab[_0xec8d('0x1b')]?_[_0xec8d('0x1e')](_0x4887ab[_0xec8d('0x1b')],function(_0x21416f){return{'model':db[_0x21416f[_0xec8d('0x1c')]],'as':_0x21416f['as'],'attributes':_0x21416f['attributes']};}):[]};}):[]};}):[]:[]})[_0xec8d('0x1f')](function(_0x1a88a8){logger[_0xec8d('0xb')](_0xec8d('0x15'),_0x56a9c7);logger['debug'](_0xec8d('0x15'),_0x56a9c7,JSON[_0xec8d('0x20')](_0x1a88a8));_0x1c1423(_0x1a88a8);})[_0xec8d('0x14')](function(_0x289d78){logger['error'](_0xec8d('0x15'),_0x289d78[_0xec8d('0x12')],_0x56a9c7);_0x2a88aa(_0x51a914[_0xec8d('0xf')](0x1f4,_0x289d78['message']));});});};exports[_0xec8d('0x21')]=function(_0x4a0357){var _0x29248b=this;return new Promise(function(_0x2cea61,_0x1e7863){return db[_0xec8d('0x16')][_0xec8d('0x22')]({'raw':_0x4a0357[_0xec8d('0x17')]?_0x4a0357[_0xec8d('0x17')][_0xec8d('0x18')]===undefined?!![]:![]:!![],'where':_0x4a0357[_0xec8d('0x17')]?_0x4a0357[_0xec8d('0x17')][_0xec8d('0x19')]||null:null,'attributes':_0x4a0357['options']?_0x4a0357[_0xec8d('0x17')][_0xec8d('0x1d')]||null:null,'include':_0x4a0357[_0xec8d('0x17')]?_0x4a0357['options'][_0xec8d('0x1b')]?_['map'](_0x4a0357[_0xec8d('0x17')][_0xec8d('0x1b')],function(_0x4191a2){return{'model':db[_0x4191a2['model']],'as':_0x4191a2['as'],'attributes':_0x4191a2[_0xec8d('0x1d')],'include':_0x4191a2[_0xec8d('0x1b')]?_[_0xec8d('0x1e')](_0x4191a2[_0xec8d('0x1b')],function(_0x104e94){return{'model':db[_0x104e94['model']],'as':_0x104e94['as'],'attributes':_0x104e94[_0xec8d('0x1d')],'include':_0x104e94[_0xec8d('0x1b')]?_[_0xec8d('0x1e')](_0x104e94[_0xec8d('0x1b')],function(_0x25deaa){return{'model':db[_0x25deaa[_0xec8d('0x1c')]],'as':_0x25deaa['as'],'attributes':_0x25deaa[_0xec8d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b4f24){logger[_0xec8d('0xb')](_0xec8d('0x21'),_0x4a0357);logger[_0xec8d('0xd')]('ShowFreshdeskAccount',_0x4a0357,JSON[_0xec8d('0x20')](_0x3b4f24));_0x2cea61(_0x3b4f24);})[_0xec8d('0x14')](function(_0x241dab){logger[_0xec8d('0xf')](_0xec8d('0x21'),_0x241dab[_0xec8d('0x12')],_0x4a0357);_0x1e7863(_0x29248b[_0xec8d('0xf')](0x1f4,_0x241dab['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 852be34..8b3585c 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 _0xca9e=['getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x46f557,_0x45340c){var _0xccf7e7=function(_0x12be11){while(--_0x12be11){_0x46f557['push'](_0x46f557['shift']());}};_0xccf7e7(++_0x45340c);}(_0xca9e,0x136));var _0xeca9=function(_0x407287,_0x5b4dd4){_0x407287=_0x407287-0x0;var _0x383415=_0xca9e[_0x407287];return _0x383415;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var auth=require(_0xeca9('0x6'));var interaction=require(_0xeca9('0x7'));var config=require(_0xeca9('0x8'));var controller=require(_0xeca9('0x9'));router[_0xeca9('0xa')]('/',auth[_0xeca9('0xb')](),controller[_0xeca9('0xc')]);router[_0xeca9('0xa')]('/:id',auth[_0xeca9('0xb')](),controller[_0xeca9('0xd')]);router['get']('/:id/fields',auth[_0xeca9('0xb')](),controller[_0xeca9('0xe')]);router[_0xeca9('0xa')]('/:id/subjects',auth[_0xeca9('0xb')](),controller[_0xeca9('0xf')]);router[_0xeca9('0xa')](_0xeca9('0x10'),auth[_0xeca9('0xb')](),controller[_0xeca9('0x11')]);router['get'](_0xeca9('0x12'),auth[_0xeca9('0xb')](),controller['getTags']);router[_0xeca9('0x13')]('/',auth['isAuthenticated'](),controller[_0xeca9('0x14')]);router[_0xeca9('0x13')]('/:id/tags',auth[_0xeca9('0xb')](),controller[_0xeca9('0x15')]);router[_0xeca9('0x16')]('/:id',auth[_0xeca9('0xb')](),controller[_0xeca9('0x17')]);router[_0xeca9('0x18')](_0xeca9('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0xeca9('0x1a')]=router; \ No newline at end of file +var _0x0f4d=['getTags','post','setTags','update','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x91ded3,_0x411e86){_0x91ded3=_0x91ded3-0x0;var _0x2cd0f6=_0x0f4d[_0x91ded3];return _0x2cd0f6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var auth=require(_0xd0f4('0x2'));var interaction=require(_0xd0f4('0x3'));var config=require(_0xd0f4('0x4'));var controller=require(_0xd0f4('0x5'));router[_0xd0f4('0x6')]('/',auth[_0xd0f4('0x7')](),controller[_0xd0f4('0x8')]);router['get'](_0xd0f4('0x9'),auth[_0xd0f4('0x7')](),controller['show']);router[_0xd0f4('0x6')](_0xd0f4('0xa'),auth['isAuthenticated'](),controller[_0xd0f4('0xb')]);router[_0xd0f4('0x6')]('/:id/subjects',auth[_0xd0f4('0x7')](),controller[_0xd0f4('0xc')]);router[_0xd0f4('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd0f4('0xd')]);router[_0xd0f4('0x6')](_0xd0f4('0xe'),auth[_0xd0f4('0x7')](),controller[_0xd0f4('0xf')]);router[_0xd0f4('0x10')]('/',auth[_0xd0f4('0x7')](),controller['create']);router[_0xd0f4('0x10')](_0xd0f4('0xe'),auth['isAuthenticated'](),controller[_0xd0f4('0x11')]);router['put'](_0xd0f4('0x9'),auth['isAuthenticated'](),controller[_0xd0f4('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd0f4('0x13')]);module[_0xd0f4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c4b7288..e07c805 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 _0x179b=['sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x179b,0x86));var _0xb179=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x179b[_0x4c0622];return _0x1799d8;};'use strict';var Sequelize=require(_0xb179('0x0'));module['exports']={'name':{'type':Sequelize[_0xb179('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb6c3=['exports','STRING'];(function(_0x30f760,_0x1caf06){var _0x52764e=function(_0x266514){while(--_0x266514){_0x30f760['push'](_0x30f760['shift']());}};_0x52764e(++_0x1caf06);}(_0xb6c3,0x116));var _0x3b6c=function(_0x4c2812,_0x3c0fce){_0x4c2812=_0x4c2812-0x0;var _0x640f83=_0xb6c3[_0x4c2812];return _0x640f83;};'use strict';var Sequelize=require('sequelize');module[_0x3b6c('0x0')]={'name':{'type':Sequelize[_0x3b6c('0x1')]},'description':{'type':Sequelize[_0x3b6c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 470a040..e0058c8 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 _0xd153=['getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','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/auth/service','ioredis','api','../../config/environment','../../mysqldb','jayson/promise','client','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','set','Content-Range','save','update','destroy','then','stack','name','index','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','findOne','FreshdeskField','getFields'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xd153,0x179));var _0x3d15=function(_0x3fb9f9,_0xfac853){_0x3fb9f9=_0x3fb9f9-0x0;var _0x58d2ed=_0xd153[_0x3fb9f9];return _0x58d2ed;};'use strict';var pdf=require(_0x3d15('0x0'));var emlformat=require(_0x3d15('0x1'));var rimraf=require(_0x3d15('0x2'));var zipdir=require(_0x3d15('0x3'));var jsonpatch=require(_0x3d15('0x4'));var rp=require(_0x3d15('0x5'));var moment=require(_0x3d15('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3d15('0x7'));var util=require(_0x3d15('0x8'));var path=require(_0x3d15('0x9'));var sox=require('sox');var csv=require(_0x3d15('0xa'));var ejs=require(_0x3d15('0xb'));var fs=require('fs');var _=require(_0x3d15('0xc'));var squel=require(_0x3d15('0xd'));var crypto=require(_0x3d15('0xe'));var jsforce=require(_0x3d15('0xf'));var deskjs=require(_0x3d15('0x10'));var toCsv=require(_0x3d15('0xa'));var querystring=require(_0x3d15('0x11'));var Papa=require(_0x3d15('0x12'));var authService=require(_0x3d15('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3d15('0x14'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3d15('0x15'));var utils=require('../../config/utils');var config=require(_0x3d15('0x16'));var db=require(_0x3d15('0x17'))['db'];var jayson=require(_0x3d15('0x18'));var client=jayson[_0x3d15('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe85167,_0x2d9e29,_0x23639c,_0x2b5aa7){return new BPromise(function(_0x1818fd,_0x29a1f4){var _0x1097ca=_0x2b5aa7||client;return _0x1097ca[_0x3d15('0x1a')](_0xe85167,_0x23639c)['then'](function(_0x172afa){logger[_0x3d15('0x1b')](_0x3d15('0x1c'),_0x2d9e29,_0x3d15('0x1d'));logger[_0x3d15('0x1e')](_0x3d15('0x1f'),_0x2d9e29,_0x3d15('0x1d'),JSON[_0x3d15('0x20')](_0x172afa));if(_0x172afa['error']){if(_0x172afa[_0x3d15('0x21')][_0x3d15('0x22')]===0x1f4){logger[_0x3d15('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d9e29,_0x172afa[_0x3d15('0x21')]['message']);return _0x29a1f4(_0x172afa['error'][_0x3d15('0x23')]);}logger[_0x3d15('0x21')](_0x3d15('0x1c'),_0x2d9e29,_0x172afa[_0x3d15('0x21')][_0x3d15('0x23')]);return _0x1818fd(_0x172afa[_0x3d15('0x21')][_0x3d15('0x23')]);}else{logger[_0x3d15('0x1b')](_0x3d15('0x1c'),_0x2d9e29,'request\x20sent');_0x1818fd(_0x172afa[_0x3d15('0x24')][_0x3d15('0x23')]);}})['catch'](function(_0x2ba9d2){logger[_0x3d15('0x21')](_0x3d15('0x1c'),_0x2d9e29,_0x2ba9d2);_0x29a1f4(_0x2ba9d2);});});}function respondWithStatusCode(_0x10eea1,_0x3716a5){_0x3716a5=_0x3716a5||0xcc;return function(_0x49a510){if(_0x49a510){return _0x10eea1[_0x3d15('0x25')](_0x3716a5);}return _0x10eea1['status'](_0x3716a5)[_0x3d15('0x26')]();};}function respondWithResult(_0x50bda9,_0x3d3222){_0x3d3222=_0x3d3222||0xc8;return function(_0x218322){if(_0x218322){return _0x50bda9[_0x3d15('0x27')](_0x3d3222)[_0x3d15('0x28')](_0x218322);}};}function respondWithFilteredResult(_0x271ded,_0x4ff823){return function(_0x2b4830){if(_0x2b4830){var _0x49484d=_0x2b4830[_0x3d15('0x29')],_0xb73a37=_0x4ff823[_0x3d15('0x2a')],_0x2e1c06=_0x4ff823[_0x3d15('0x2a')]+_0x4ff823['limit'],_0x33c351;if(_0x2e1c06>=_0x49484d){_0x2e1c06=_0x49484d;_0x33c351=0xc8;}else{_0x33c351=0xce;}_0x271ded[_0x3d15('0x27')](_0x33c351);return _0x271ded[_0x3d15('0x2b')](_0x3d15('0x2c'),_0xb73a37+'-'+_0x2e1c06+'/'+_0x49484d)['json'](_0x2b4830);}return null;};}function patchUpdates(_0x4cd23e){return function(_0x1dfd70){try{jsonpatch['apply'](_0x1dfd70,_0x4cd23e,!![]);}catch(_0x55d75b){return BPromise['reject'](_0x55d75b);}return _0x1dfd70[_0x3d15('0x2d')]();};}function saveUpdates(_0x389d6a,_0x543113){return function(_0xda513a){if(_0xda513a){return _0xda513a[_0x3d15('0x2e')](_0x389d6a)['then'](function(_0x273c93){return _0x273c93;});}return null;};}function removeEntity(_0x1a4b62,_0x3eb203){return function(_0xbdf202){if(_0xbdf202){return _0xbdf202[_0x3d15('0x2f')]()[_0x3d15('0x30')](function(){_0x1a4b62[_0x3d15('0x27')](0xcc)[_0x3d15('0x26')]();});}};}function handleEntityNotFound(_0x47ce8a,_0x1b83a6){return function(_0xf5e230){if(!_0xf5e230){_0x47ce8a[_0x3d15('0x25')](0x194);}return _0xf5e230;};}function handleError(_0x4e2ae6,_0x56013f){_0x56013f=_0x56013f||0x1f4;return function(_0x53f23f){logger[_0x3d15('0x21')](_0x53f23f[_0x3d15('0x31')]);if(_0x53f23f[_0x3d15('0x32')]){delete _0x53f23f['name'];}_0x4e2ae6[_0x3d15('0x27')](_0x56013f)['send'](_0x53f23f);};}exports[_0x3d15('0x33')]=function(_0x2825f0,_0x4be1e9){var _0x30a23e={},_0x553bc9={},_0xe029e8={'count':0x0,'rows':[]};var _0x48e23b=db[_0x3d15('0x34')][_0x3d15('0x35')];_0x553bc9[_0x3d15('0x36')]=_[_0x3d15('0x37')](_0x48e23b);_0x553bc9[_0x3d15('0x38')]=_['keys'](_0x2825f0[_0x3d15('0x38')]);_0x553bc9[_0x3d15('0x39')]=_[_0x3d15('0x3a')](_0x553bc9[_0x3d15('0x36')],_0x553bc9[_0x3d15('0x38')]);_0x30a23e[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0x553bc9['model'],qs[_0x3d15('0x3c')](_0x2825f0[_0x3d15('0x38')]['fields']));_0x30a23e[_0x3d15('0x3b')]=_0x30a23e[_0x3d15('0x3b')][_0x3d15('0x3d')]?_0x30a23e['attributes']:_0x553bc9[_0x3d15('0x36')];if(!_0x2825f0[_0x3d15('0x38')][_0x3d15('0x3e')](_0x3d15('0x3f'))){_0x30a23e[_0x3d15('0x40')]=qs[_0x3d15('0x40')](_0x2825f0['query'][_0x3d15('0x40')]);_0x30a23e['offset']=qs[_0x3d15('0x2a')](_0x2825f0[_0x3d15('0x38')]['offset']);}_0x30a23e[_0x3d15('0x41')]=qs['sort'](_0x2825f0[_0x3d15('0x38')][_0x3d15('0x42')]);_0x30a23e[_0x3d15('0x43')]=qs[_0x3d15('0x39')](_[_0x3d15('0x44')](_0x2825f0[_0x3d15('0x38')],_0x553bc9[_0x3d15('0x39')]));if(_0x2825f0[_0x3d15('0x38')][_0x3d15('0x45')]){_0x30a23e[_0x3d15('0x43')]=_[_0x3d15('0x46')](_0x30a23e['where'],{'$or':_[_0x3d15('0x47')](_0x48e23b,function(_0x4d3d0a){if(_0x4d3d0a[_0x3d15('0x48')][_0x3d15('0x49')]!=='VIRTUAL'){var _0x4c4f39={};_0x4c4f39[_0x4d3d0a['field']]={'$like':'%'+_0x2825f0[_0x3d15('0x38')][_0x3d15('0x45')]+'%'};return _0x4c4f39;}})});}_0x30a23e=_[_0x3d15('0x46')]({},_0x30a23e,_0x2825f0['options']);var _0x308cf6={'where':_0x30a23e['where']};return db[_0x3d15('0x34')]['count'](_0x308cf6)[_0x3d15('0x30')](function(_0x2cf055){_0xe029e8[_0x3d15('0x29')]=_0x2cf055;if(_0x2825f0[_0x3d15('0x38')][_0x3d15('0x4a')]){_0x30a23e[_0x3d15('0x4b')]=[{'all':!![]}];}return db[_0x3d15('0x34')][_0x3d15('0x4c')](_0x30a23e);})[_0x3d15('0x30')](function(_0x5ef651){_0xe029e8[_0x3d15('0x4d')]=_0x5ef651;return _0xe029e8;})[_0x3d15('0x30')](respondWithFilteredResult(_0x4be1e9,_0x30a23e))[_0x3d15('0x4e')](handleError(_0x4be1e9,null));};exports[_0x3d15('0x4f')]=function(_0x1f93d4,_0x34d33f){var _0x14301d={'raw':![],'where':{'id':_0x1f93d4['params']['id']}},_0xe22131={};_0xe22131[_0x3d15('0x36')]=_['keys'](db['FreshdeskConfiguration'][_0x3d15('0x35')]);_0xe22131[_0x3d15('0x38')]=_[_0x3d15('0x37')](_0x1f93d4[_0x3d15('0x38')]);_0xe22131[_0x3d15('0x39')]=_['intersection'](_0xe22131[_0x3d15('0x36')],_0xe22131[_0x3d15('0x38')]);_0x14301d[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0xe22131[_0x3d15('0x36')],qs[_0x3d15('0x3c')](_0x1f93d4['query'][_0x3d15('0x3c')]));_0x14301d['attributes']=_0x14301d['attributes']['length']?_0x14301d['attributes']:_0xe22131[_0x3d15('0x36')];if(_0x1f93d4['query']['includeAll']){_0x14301d[_0x3d15('0x4b')]=[{'all':!![]}];}_0x14301d=_[_0x3d15('0x46')]({},_0x14301d,_0x1f93d4[_0x3d15('0x50')]);return db['FreshdeskConfiguration'][_0x3d15('0x51')](_0x14301d)[_0x3d15('0x30')](handleEntityNotFound(_0x34d33f,null))[_0x3d15('0x30')](respondWithResult(_0x34d33f,null))[_0x3d15('0x4e')](handleError(_0x34d33f,null));};exports[_0x3d15('0x52')]=function(_0x2eba7f,_0x1f8885){return db[_0x3d15('0x34')]['create'](_0x2eba7f[_0x3d15('0x53')],{})['then'](respondWithResult(_0x1f8885,0xc9))[_0x3d15('0x4e')](handleError(_0x1f8885,null));};exports['update']=function(_0xcf7027,_0x37ba2b){if(_0xcf7027[_0x3d15('0x53')]['id']){delete _0xcf7027['body']['id'];}return db[_0x3d15('0x34')][_0x3d15('0x51')]({'where':{'id':_0xcf7027[_0x3d15('0x54')]['id']}})['then'](handleEntityNotFound(_0x37ba2b,null))[_0x3d15('0x30')](saveUpdates(_0xcf7027[_0x3d15('0x53')],null))[_0x3d15('0x30')](respondWithResult(_0x37ba2b,null))['catch'](handleError(_0x37ba2b,null));};exports[_0x3d15('0x2f')]=function(_0xbd683e,_0x5b4337){return db[_0x3d15('0x34')][_0x3d15('0x51')]({'where':{'id':_0xbd683e[_0x3d15('0x54')]['id']}})[_0x3d15('0x30')](handleEntityNotFound(_0x5b4337,null))[_0x3d15('0x30')](removeEntity(_0x5b4337,null))[_0x3d15('0x4e')](handleError(_0x5b4337,null));};exports['getFields']=function(_0x4a673d,_0x261779,_0x52c2dc){var _0x56891d={};var _0x816861={};var _0x5a21c1;var _0x3fe6c9;return db[_0x3d15('0x34')][_0x3d15('0x55')]({'where':{'id':_0x4a673d[_0x3d15('0x54')]['id']}})['then'](handleEntityNotFound(_0x261779,null))[_0x3d15('0x30')](function(_0x3dc83d){if(_0x3dc83d){_0x5a21c1=_0x3dc83d;_0x816861[_0x3d15('0x36')]=_[_0x3d15('0x37')](db[_0x3d15('0x56')]['rawAttributes']);_0x816861['query']=_['keys'](_0x4a673d[_0x3d15('0x38')]);_0x816861[_0x3d15('0x39')]=_[_0x3d15('0x3a')](_0x816861[_0x3d15('0x36')],_0x816861['query']);_0x56891d[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0x816861['model'],qs['fields'](_0x4a673d[_0x3d15('0x38')]['fields']));_0x56891d[_0x3d15('0x3b')]=_0x56891d[_0x3d15('0x3b')][_0x3d15('0x3d')]?_0x56891d['attributes']:_0x816861[_0x3d15('0x36')];_0x56891d['order']=qs['sort'](_0x4a673d[_0x3d15('0x38')][_0x3d15('0x42')]);_0x56891d[_0x3d15('0x43')]=qs[_0x3d15('0x39')](_[_0x3d15('0x44')](_0x4a673d[_0x3d15('0x38')],_0x816861['filters']));if(_0x4a673d[_0x3d15('0x38')][_0x3d15('0x45')]){_0x56891d[_0x3d15('0x43')]=_[_0x3d15('0x46')](_0x56891d['where'],{'$or':_[_0x3d15('0x47')](_0x56891d[_0x3d15('0x3b')],function(_0x472f16){var _0x55fcbe={};_0x55fcbe[_0x472f16]={'$like':'%'+_0x4a673d[_0x3d15('0x38')][_0x3d15('0x45')]+'%'};return _0x55fcbe;})});}_0x56891d=_[_0x3d15('0x46')]({},_0x56891d,_0x4a673d['options']);return _0x5a21c1[_0x3d15('0x57')](_0x56891d);}})[_0x3d15('0x30')](function(_0x397334){if(_0x397334){_0x3fe6c9=_0x397334[_0x3d15('0x3d')];if(!_0x4a673d['query'][_0x3d15('0x3e')](_0x3d15('0x3f'))){_0x56891d[_0x3d15('0x40')]=qs[_0x3d15('0x40')](_0x4a673d[_0x3d15('0x38')][_0x3d15('0x40')]);_0x56891d[_0x3d15('0x2a')]=qs['offset'](_0x4a673d[_0x3d15('0x38')][_0x3d15('0x2a')]);}return _0x5a21c1['getFields'](_0x56891d);}})['then'](function(_0x345dc9){if(_0x345dc9){return _0x345dc9?{'count':_0x3fe6c9,'rows':_0x345dc9}:null;}})[_0x3d15('0x30')](respondWithResult(_0x261779,null))[_0x3d15('0x4e')](handleError(_0x261779,null));};exports[_0x3d15('0x58')]=function(_0x223850,_0x4ccb1a,_0x3322a7){var _0x3a6b4e={};var _0x1834c7={};var _0x36a8e3;var _0x359fa1;return db['FreshdeskConfiguration'][_0x3d15('0x55')]({'where':{'id':_0x223850[_0x3d15('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ccb1a,null))[_0x3d15('0x30')](function(_0x539cea){if(_0x539cea){_0x36a8e3=_0x539cea;_0x1834c7['model']=_['keys'](db[_0x3d15('0x56')]['rawAttributes']);_0x1834c7[_0x3d15('0x38')]=_[_0x3d15('0x37')](_0x223850[_0x3d15('0x38')]);_0x1834c7[_0x3d15('0x39')]=_['intersection'](_0x1834c7['model'],_0x1834c7[_0x3d15('0x38')]);_0x3a6b4e[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0x1834c7['model'],qs[_0x3d15('0x3c')](_0x223850[_0x3d15('0x38')][_0x3d15('0x3c')]));_0x3a6b4e[_0x3d15('0x3b')]=_0x3a6b4e['attributes']['length']?_0x3a6b4e[_0x3d15('0x3b')]:_0x1834c7[_0x3d15('0x36')];_0x3a6b4e[_0x3d15('0x41')]=qs[_0x3d15('0x42')](_0x223850['query'][_0x3d15('0x42')]);_0x3a6b4e[_0x3d15('0x43')]=qs[_0x3d15('0x39')](_[_0x3d15('0x44')](_0x223850[_0x3d15('0x38')],_0x1834c7[_0x3d15('0x39')]));if(_0x223850[_0x3d15('0x38')][_0x3d15('0x45')]){_0x3a6b4e[_0x3d15('0x43')]=_[_0x3d15('0x46')](_0x3a6b4e[_0x3d15('0x43')],{'$or':_[_0x3d15('0x47')](_0x3a6b4e[_0x3d15('0x3b')],function(_0x163066){var _0x438808={};_0x438808[_0x163066]={'$like':'%'+_0x223850[_0x3d15('0x38')][_0x3d15('0x45')]+'%'};return _0x438808;})});}_0x3a6b4e=_['merge']({},_0x3a6b4e,_0x223850['options']);return _0x36a8e3[_0x3d15('0x58')](_0x3a6b4e);}})[_0x3d15('0x30')](function(_0x26200c){if(_0x26200c){_0x359fa1=_0x26200c[_0x3d15('0x3d')];if(!_0x223850[_0x3d15('0x38')][_0x3d15('0x3e')](_0x3d15('0x3f'))){_0x3a6b4e[_0x3d15('0x40')]=qs[_0x3d15('0x40')](_0x223850[_0x3d15('0x38')][_0x3d15('0x40')]);_0x3a6b4e[_0x3d15('0x2a')]=qs[_0x3d15('0x2a')](_0x223850[_0x3d15('0x38')][_0x3d15('0x2a')]);}return _0x36a8e3[_0x3d15('0x58')](_0x3a6b4e);}})[_0x3d15('0x30')](function(_0x495538){if(_0x495538){return _0x495538?{'count':_0x359fa1,'rows':_0x495538}:null;}})[_0x3d15('0x30')](respondWithResult(_0x4ccb1a,null))['catch'](handleError(_0x4ccb1a,null));};exports[_0x3d15('0x59')]=function(_0x56e565,_0x24a0f1,_0x262ce1){var _0x2e7a02={};var _0x1b9ce9={};var _0x472ee2;var _0x111ea9;return db[_0x3d15('0x34')]['findOne']({'where':{'id':_0x56e565['params']['id']}})[_0x3d15('0x30')](handleEntityNotFound(_0x24a0f1,null))[_0x3d15('0x30')](function(_0x45d282){if(_0x45d282){_0x472ee2=_0x45d282;_0x1b9ce9[_0x3d15('0x36')]=_['keys'](db[_0x3d15('0x56')][_0x3d15('0x35')]);_0x1b9ce9[_0x3d15('0x38')]=_[_0x3d15('0x37')](_0x56e565[_0x3d15('0x38')]);_0x1b9ce9[_0x3d15('0x39')]=_[_0x3d15('0x3a')](_0x1b9ce9[_0x3d15('0x36')],_0x1b9ce9[_0x3d15('0x38')]);_0x2e7a02[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0x1b9ce9[_0x3d15('0x36')],qs[_0x3d15('0x3c')](_0x56e565['query'][_0x3d15('0x3c')]));_0x2e7a02[_0x3d15('0x3b')]=_0x2e7a02[_0x3d15('0x3b')]['length']?_0x2e7a02[_0x3d15('0x3b')]:_0x1b9ce9['model'];_0x2e7a02['order']=qs[_0x3d15('0x42')](_0x56e565[_0x3d15('0x38')]['sort']);_0x2e7a02[_0x3d15('0x43')]=qs[_0x3d15('0x39')](_[_0x3d15('0x44')](_0x56e565[_0x3d15('0x38')],_0x1b9ce9[_0x3d15('0x39')]));if(_0x56e565[_0x3d15('0x38')]['filter']){_0x2e7a02[_0x3d15('0x43')]=_[_0x3d15('0x46')](_0x2e7a02[_0x3d15('0x43')],{'$or':_[_0x3d15('0x47')](_0x2e7a02[_0x3d15('0x3b')],function(_0x389446){var _0x169194={};_0x169194[_0x389446]={'$like':'%'+_0x56e565[_0x3d15('0x38')][_0x3d15('0x45')]+'%'};return _0x169194;})});}_0x2e7a02=_[_0x3d15('0x46')]({},_0x2e7a02,_0x56e565[_0x3d15('0x50')]);return _0x472ee2[_0x3d15('0x59')](_0x2e7a02);}})[_0x3d15('0x30')](function(_0x10fb9d){if(_0x10fb9d){_0x111ea9=_0x10fb9d['length'];if(!_0x56e565[_0x3d15('0x38')]['hasOwnProperty']('nolimit')){_0x2e7a02[_0x3d15('0x40')]=qs[_0x3d15('0x40')](_0x56e565[_0x3d15('0x38')]['limit']);_0x2e7a02['offset']=qs[_0x3d15('0x2a')](_0x56e565[_0x3d15('0x38')][_0x3d15('0x2a')]);}return _0x472ee2[_0x3d15('0x59')](_0x2e7a02);}})[_0x3d15('0x30')](function(_0xd93d82){if(_0xd93d82){return _0xd93d82?{'count':_0x111ea9,'rows':_0xd93d82}:null;}})[_0x3d15('0x30')](respondWithResult(_0x24a0f1,null))[_0x3d15('0x4e')](handleError(_0x24a0f1,null));};exports[_0x3d15('0x5a')]=function(_0x582bf3,_0x332409,_0xe0a0ea){var _0x5b9117={};var _0x49408d={};var _0x4281c6;var _0x4bd750;return db[_0x3d15('0x34')]['findOne']({'where':{'id':_0x582bf3[_0x3d15('0x54')]['id']}})[_0x3d15('0x30')](handleEntityNotFound(_0x332409,null))['then'](function(_0x227e2d){if(_0x227e2d){_0x4281c6=_0x227e2d;_0x49408d[_0x3d15('0x36')]=_[_0x3d15('0x37')](db['Tag']['rawAttributes']);_0x49408d['query']=_[_0x3d15('0x37')](_0x582bf3[_0x3d15('0x38')]);_0x49408d['filters']=_[_0x3d15('0x3a')](_0x49408d['model'],_0x49408d[_0x3d15('0x38')]);_0x5b9117[_0x3d15('0x3b')]=_[_0x3d15('0x3a')](_0x49408d[_0x3d15('0x36')],qs['fields'](_0x582bf3[_0x3d15('0x38')][_0x3d15('0x3c')]));_0x5b9117[_0x3d15('0x3b')]=_0x5b9117[_0x3d15('0x3b')][_0x3d15('0x3d')]?_0x5b9117[_0x3d15('0x3b')]:_0x49408d[_0x3d15('0x36')];_0x5b9117[_0x3d15('0x41')]=qs[_0x3d15('0x42')](_0x582bf3[_0x3d15('0x38')]['sort']);_0x5b9117[_0x3d15('0x43')]=qs[_0x3d15('0x39')](_[_0x3d15('0x44')](_0x582bf3[_0x3d15('0x38')],_0x49408d[_0x3d15('0x39')]));if(_0x582bf3['query'][_0x3d15('0x45')]){_0x5b9117[_0x3d15('0x43')]=_[_0x3d15('0x46')](_0x5b9117[_0x3d15('0x43')],{'$or':_['map'](_0x5b9117[_0x3d15('0x3b')],function(_0x34794c){var _0x47c22e={};_0x47c22e[_0x34794c]={'$like':'%'+_0x582bf3[_0x3d15('0x38')]['filter']+'%'};return _0x47c22e;})});}_0x5b9117=_[_0x3d15('0x46')]({},_0x5b9117,_0x582bf3[_0x3d15('0x50')]);return _0x4281c6[_0x3d15('0x5a')](_0x5b9117);}})[_0x3d15('0x30')](function(_0x1c445b){if(_0x1c445b){_0x4bd750=_0x1c445b[_0x3d15('0x3d')];if(!_0x582bf3[_0x3d15('0x38')][_0x3d15('0x3e')](_0x3d15('0x3f'))){_0x5b9117[_0x3d15('0x40')]=qs['limit'](_0x582bf3[_0x3d15('0x38')][_0x3d15('0x40')]);_0x5b9117[_0x3d15('0x2a')]=qs[_0x3d15('0x2a')](_0x582bf3[_0x3d15('0x38')]['offset']);}return _0x4281c6[_0x3d15('0x5a')](_0x5b9117);}})[_0x3d15('0x30')](function(_0x3cb987){if(_0x3cb987){return _0x3cb987?{'count':_0x4bd750,'rows':_0x3cb987}:null;}})[_0x3d15('0x30')](respondWithResult(_0x332409,null))['catch'](handleError(_0x332409,null));};exports[_0x3d15('0x5b')]=function(_0x537ee6,_0x1bc6aa,_0x57aa36){if(_0x537ee6[_0x3d15('0x53')]['id']){delete _0x537ee6[_0x3d15('0x53')]['id'];}return db['FreshdeskConfiguration'][_0x3d15('0x55')]({'where':{'id':_0x537ee6[_0x3d15('0x54')]['id']}})[_0x3d15('0x30')](handleEntityNotFound(_0x1bc6aa,null))[_0x3d15('0x30')](function(_0x5dbee4){if(_0x5dbee4){return _0x5dbee4[_0x3d15('0x5b')](_0x537ee6[_0x3d15('0x53')][_0x3d15('0x5c')]||[]);}return null;})[_0x3d15('0x30')](respondWithResult(_0x1bc6aa,null))[_0x3d15('0x4e')](handleError(_0x1bc6aa,null));}; \ No newline at end of file +var _0x611b=['rawAttributes','merge','find','create','body','params','getFields','findOne','FreshdeskField','filter','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','send','index','FreshdeskConfiguration','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','map','VIRTUAL','field','options','includeAll','include','show'];(function(_0x2b3686,_0x81df85){var _0x235fd8=function(_0x48a614){while(--_0x48a614){_0x2b3686['push'](_0x2b3686['shift']());}};_0x235fd8(++_0x81df85);}(_0x611b,0xcf));var _0xb611=function(_0x4f4157,_0x27aa4c){_0x4f4157=_0x4f4157-0x0;var _0x23a1b1=_0x611b[_0x4f4157];return _0x23a1b1;};'use strict';var pdf=require(_0xb611('0x0'));var emlformat=require(_0xb611('0x1'));var rimraf=require(_0xb611('0x2'));var zipdir=require(_0xb611('0x3'));var jsonpatch=require(_0xb611('0x4'));var rp=require(_0xb611('0x5'));var moment=require('moment');var BPromise=require(_0xb611('0x6'));var Mustache=require(_0xb611('0x7'));var util=require(_0xb611('0x8'));var path=require(_0xb611('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb611('0xa'));var fs=require('fs');var _=require(_0xb611('0xb'));var squel=require(_0xb611('0xc'));var crypto=require(_0xb611('0xd'));var jsforce=require(_0xb611('0xe'));var deskjs=require(_0xb611('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb611('0x10'));var Papa=require(_0xb611('0x11'));var authService=require(_0xb611('0x12'));var hardwareService=require(_0xb611('0x13'));var Redis=require('ioredis');var qs=require(_0xb611('0x14'));var logger=require('../../config/logger')(_0xb611('0x15'));var utils=require(_0xb611('0x16'));var config=require(_0xb611('0x17'));var db=require(_0xb611('0x18'))['db'];var jayson=require(_0xb611('0x19'));var client=jayson[_0xb611('0x1a')][_0xb611('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4f39f6,_0x45c888,_0xefce09,_0x4d020d){return new BPromise(function(_0xa56e8a,_0xd405f6){var _0x46421a=_0x4d020d||client;return _0x46421a[_0xb611('0x1c')](_0x4f39f6,_0xefce09)[_0xb611('0x1d')](function(_0x290fa7){logger[_0xb611('0x1e')](_0xb611('0x1f'),_0x45c888,_0xb611('0x20'));logger[_0xb611('0x21')](_0xb611('0x22'),_0x45c888,'request\x20sent',JSON[_0xb611('0x23')](_0x290fa7));if(_0x290fa7[_0xb611('0x24')]){if(_0x290fa7[_0xb611('0x24')][_0xb611('0x25')]===0x1f4){logger['error'](_0xb611('0x1f'),_0x45c888,_0x290fa7[_0xb611('0x24')][_0xb611('0x26')]);return _0xd405f6(_0x290fa7[_0xb611('0x24')][_0xb611('0x26')]);}logger[_0xb611('0x24')](_0xb611('0x1f'),_0x45c888,_0x290fa7[_0xb611('0x24')]['message']);return _0xa56e8a(_0x290fa7[_0xb611('0x24')][_0xb611('0x26')]);}else{logger[_0xb611('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x45c888,_0xb611('0x20'));_0xa56e8a(_0x290fa7[_0xb611('0x27')][_0xb611('0x26')]);}})[_0xb611('0x28')](function(_0x2e6f03){logger[_0xb611('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x45c888,_0x2e6f03);_0xd405f6(_0x2e6f03);});});}function respondWithStatusCode(_0x1cf328,_0x38afc8){_0x38afc8=_0x38afc8||0xcc;return function(_0x1c23dd){if(_0x1c23dd){return _0x1cf328[_0xb611('0x29')](_0x38afc8);}return _0x1cf328[_0xb611('0x2a')](_0x38afc8)[_0xb611('0x2b')]();};}function respondWithResult(_0x34368b,_0x103228){_0x103228=_0x103228||0xc8;return function(_0x2c0918){if(_0x2c0918){return _0x34368b[_0xb611('0x2a')](_0x103228)[_0xb611('0x2c')](_0x2c0918);}};}function respondWithFilteredResult(_0x2ab5f1,_0x58d276){return function(_0x1b0cbe){if(_0x1b0cbe){var _0x2d0ba2=_0x1b0cbe[_0xb611('0x2d')],_0x1081fb=_0x58d276[_0xb611('0x2e')],_0x2e65b8=_0x58d276['offset']+_0x58d276[_0xb611('0x2f')],_0x5e32cf;if(_0x2e65b8>=_0x2d0ba2){_0x2e65b8=_0x2d0ba2;_0x5e32cf=0xc8;}else{_0x5e32cf=0xce;}_0x2ab5f1[_0xb611('0x2a')](_0x5e32cf);return _0x2ab5f1['set'](_0xb611('0x30'),_0x1081fb+'-'+_0x2e65b8+'/'+_0x2d0ba2)['json'](_0x1b0cbe);}return null;};}function patchUpdates(_0x472df2){return function(_0x1e7cb7){try{jsonpatch[_0xb611('0x31')](_0x1e7cb7,_0x472df2,!![]);}catch(_0x31e71c){return BPromise[_0xb611('0x32')](_0x31e71c);}return _0x1e7cb7['save']();};}function saveUpdates(_0x548a73,_0x2bb3c5){return function(_0x3416d7){if(_0x3416d7){return _0x3416d7[_0xb611('0x33')](_0x548a73)[_0xb611('0x1d')](function(_0x4e345c){return _0x4e345c;});}return null;};}function removeEntity(_0x2b4578,_0x3bfa0d){return function(_0x4f8f56){if(_0x4f8f56){return _0x4f8f56[_0xb611('0x34')]()[_0xb611('0x1d')](function(){_0x2b4578[_0xb611('0x2a')](0xcc)[_0xb611('0x2b')]();});}};}function handleEntityNotFound(_0x2fe984,_0x468ffd){return function(_0x5909d7){if(!_0x5909d7){_0x2fe984['sendStatus'](0x194);}return _0x5909d7;};}function handleError(_0x1e7f85,_0x3748c7){_0x3748c7=_0x3748c7||0x1f4;return function(_0x20a3d9){logger[_0xb611('0x24')](_0x20a3d9[_0xb611('0x35')]);if(_0x20a3d9[_0xb611('0x36')]){delete _0x20a3d9[_0xb611('0x36')];}_0x1e7f85['status'](_0x3748c7)[_0xb611('0x37')](_0x20a3d9);};}exports[_0xb611('0x38')]=function(_0xa65b2d,_0x22a345){var _0xf9882d={},_0x5dd6b2={},_0xc2b78d={'count':0x0,'rows':[]};var _0x3c2bde=db[_0xb611('0x39')]['rawAttributes'];_0x5dd6b2[_0xb611('0x3a')]=_[_0xb611('0x3b')](_0x3c2bde);_0x5dd6b2[_0xb611('0x3c')]=_['keys'](_0xa65b2d[_0xb611('0x3c')]);_0x5dd6b2[_0xb611('0x3d')]=_[_0xb611('0x3e')](_0x5dd6b2[_0xb611('0x3a')],_0x5dd6b2[_0xb611('0x3c')]);_0xf9882d[_0xb611('0x3f')]=_[_0xb611('0x3e')](_0x5dd6b2[_0xb611('0x3a')],qs[_0xb611('0x40')](_0xa65b2d[_0xb611('0x3c')]['fields']));_0xf9882d[_0xb611('0x3f')]=_0xf9882d[_0xb611('0x3f')][_0xb611('0x41')]?_0xf9882d[_0xb611('0x3f')]:_0x5dd6b2[_0xb611('0x3a')];if(!_0xa65b2d[_0xb611('0x3c')]['hasOwnProperty'](_0xb611('0x42'))){_0xf9882d[_0xb611('0x2f')]=qs[_0xb611('0x2f')](_0xa65b2d['query']['limit']);_0xf9882d[_0xb611('0x2e')]=qs[_0xb611('0x2e')](_0xa65b2d[_0xb611('0x3c')]['offset']);}_0xf9882d[_0xb611('0x43')]=qs['sort'](_0xa65b2d[_0xb611('0x3c')][_0xb611('0x44')]);_0xf9882d[_0xb611('0x45')]=qs[_0xb611('0x3d')](_[_0xb611('0x46')](_0xa65b2d['query'],_0x5dd6b2[_0xb611('0x3d')]));if(_0xa65b2d['query']['filter']){_0xf9882d[_0xb611('0x45')]=_['merge'](_0xf9882d[_0xb611('0x45')],{'$or':_[_0xb611('0x47')](_0x3c2bde,function(_0x242997){if(_0x242997['type']['key']!==_0xb611('0x48')){var _0x4ec556={};_0x4ec556[_0x242997[_0xb611('0x49')]]={'$like':'%'+_0xa65b2d[_0xb611('0x3c')]['filter']+'%'};return _0x4ec556;}})});}_0xf9882d=_['merge']({},_0xf9882d,_0xa65b2d[_0xb611('0x4a')]);var _0x2be9d6={'where':_0xf9882d[_0xb611('0x45')]};return db[_0xb611('0x39')][_0xb611('0x2d')](_0x2be9d6)[_0xb611('0x1d')](function(_0x3d6f2d){_0xc2b78d[_0xb611('0x2d')]=_0x3d6f2d;if(_0xa65b2d[_0xb611('0x3c')][_0xb611('0x4b')]){_0xf9882d[_0xb611('0x4c')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0xf9882d);})[_0xb611('0x1d')](function(_0x39dd7e){_0xc2b78d['rows']=_0x39dd7e;return _0xc2b78d;})[_0xb611('0x1d')](respondWithFilteredResult(_0x22a345,_0xf9882d))[_0xb611('0x28')](handleError(_0x22a345,null));};exports[_0xb611('0x4d')]=function(_0x425790,_0x5a8b8b){var _0x25a273={'raw':![],'where':{'id':_0x425790['params']['id']}},_0x84953={};_0x84953[_0xb611('0x3a')]=_['keys'](db['FreshdeskConfiguration'][_0xb611('0x4e')]);_0x84953[_0xb611('0x3c')]=_[_0xb611('0x3b')](_0x425790[_0xb611('0x3c')]);_0x84953[_0xb611('0x3d')]=_[_0xb611('0x3e')](_0x84953[_0xb611('0x3a')],_0x84953[_0xb611('0x3c')]);_0x25a273['attributes']=_['intersection'](_0x84953[_0xb611('0x3a')],qs[_0xb611('0x40')](_0x425790['query'][_0xb611('0x40')]));_0x25a273['attributes']=_0x25a273[_0xb611('0x3f')][_0xb611('0x41')]?_0x25a273[_0xb611('0x3f')]:_0x84953[_0xb611('0x3a')];if(_0x425790['query'][_0xb611('0x4b')]){_0x25a273['include']=[{'all':!![]}];}_0x25a273=_[_0xb611('0x4f')]({},_0x25a273,_0x425790['options']);return db[_0xb611('0x39')][_0xb611('0x50')](_0x25a273)[_0xb611('0x1d')](handleEntityNotFound(_0x5a8b8b,null))[_0xb611('0x1d')](respondWithResult(_0x5a8b8b,null))['catch'](handleError(_0x5a8b8b,null));};exports[_0xb611('0x51')]=function(_0x342462,_0x330fba){return db[_0xb611('0x39')][_0xb611('0x51')](_0x342462[_0xb611('0x52')],{})[_0xb611('0x1d')](respondWithResult(_0x330fba,0xc9))[_0xb611('0x28')](handleError(_0x330fba,null));};exports[_0xb611('0x33')]=function(_0x7e3595,_0x359fb6){if(_0x7e3595[_0xb611('0x52')]['id']){delete _0x7e3595[_0xb611('0x52')]['id'];}return db[_0xb611('0x39')][_0xb611('0x50')]({'where':{'id':_0x7e3595['params']['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x359fb6,null))[_0xb611('0x1d')](saveUpdates(_0x7e3595[_0xb611('0x52')],null))[_0xb611('0x1d')](respondWithResult(_0x359fb6,null))[_0xb611('0x28')](handleError(_0x359fb6,null));};exports[_0xb611('0x34')]=function(_0xc969d7,_0x14e5e9){return db[_0xb611('0x39')][_0xb611('0x50')]({'where':{'id':_0xc969d7[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x14e5e9,null))['then'](removeEntity(_0x14e5e9,null))[_0xb611('0x28')](handleError(_0x14e5e9,null));};exports[_0xb611('0x54')]=function(_0x3fede8,_0x3fc847,_0x123ea2){var _0x272b5f={};var _0x312f0d={};var _0x289410;var _0x44a584;return db[_0xb611('0x39')][_0xb611('0x55')]({'where':{'id':_0x3fede8[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x3fc847,null))['then'](function(_0x5562dd){if(_0x5562dd){_0x289410=_0x5562dd;_0x312f0d['model']=_[_0xb611('0x3b')](db[_0xb611('0x56')][_0xb611('0x4e')]);_0x312f0d[_0xb611('0x3c')]=_[_0xb611('0x3b')](_0x3fede8['query']);_0x312f0d[_0xb611('0x3d')]=_[_0xb611('0x3e')](_0x312f0d[_0xb611('0x3a')],_0x312f0d[_0xb611('0x3c')]);_0x272b5f[_0xb611('0x3f')]=_[_0xb611('0x3e')](_0x312f0d[_0xb611('0x3a')],qs[_0xb611('0x40')](_0x3fede8[_0xb611('0x3c')][_0xb611('0x40')]));_0x272b5f[_0xb611('0x3f')]=_0x272b5f['attributes'][_0xb611('0x41')]?_0x272b5f['attributes']:_0x312f0d[_0xb611('0x3a')];_0x272b5f['order']=qs[_0xb611('0x44')](_0x3fede8[_0xb611('0x3c')]['sort']);_0x272b5f[_0xb611('0x45')]=qs[_0xb611('0x3d')](_[_0xb611('0x46')](_0x3fede8[_0xb611('0x3c')],_0x312f0d['filters']));if(_0x3fede8['query'][_0xb611('0x57')]){_0x272b5f[_0xb611('0x45')]=_['merge'](_0x272b5f[_0xb611('0x45')],{'$or':_[_0xb611('0x47')](_0x272b5f['attributes'],function(_0x26752f){var _0x279c97={};_0x279c97[_0x26752f]={'$like':'%'+_0x3fede8[_0xb611('0x3c')]['filter']+'%'};return _0x279c97;})});}_0x272b5f=_['merge']({},_0x272b5f,_0x3fede8[_0xb611('0x4a')]);return _0x289410[_0xb611('0x54')](_0x272b5f);}})['then'](function(_0x4cfb85){if(_0x4cfb85){_0x44a584=_0x4cfb85[_0xb611('0x41')];if(!_0x3fede8[_0xb611('0x3c')][_0xb611('0x58')](_0xb611('0x42'))){_0x272b5f['limit']=qs[_0xb611('0x2f')](_0x3fede8['query']['limit']);_0x272b5f[_0xb611('0x2e')]=qs[_0xb611('0x2e')](_0x3fede8[_0xb611('0x3c')][_0xb611('0x2e')]);}return _0x289410['getFields'](_0x272b5f);}})[_0xb611('0x1d')](function(_0x36e6c0){if(_0x36e6c0){return _0x36e6c0?{'count':_0x44a584,'rows':_0x36e6c0}:null;}})['then'](respondWithResult(_0x3fc847,null))[_0xb611('0x28')](handleError(_0x3fc847,null));};exports['getSubjects']=function(_0x251a27,_0x5a86cb,_0x3a391){var _0x2d3de2={};var _0xba5256={};var _0x59e8b8;var _0xc0a907;return db[_0xb611('0x39')][_0xb611('0x55')]({'where':{'id':_0x251a27[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x5a86cb,null))[_0xb611('0x1d')](function(_0x185e3a){if(_0x185e3a){_0x59e8b8=_0x185e3a;_0xba5256[_0xb611('0x3a')]=_['keys'](db[_0xb611('0x56')][_0xb611('0x4e')]);_0xba5256[_0xb611('0x3c')]=_['keys'](_0x251a27[_0xb611('0x3c')]);_0xba5256[_0xb611('0x3d')]=_[_0xb611('0x3e')](_0xba5256[_0xb611('0x3a')],_0xba5256[_0xb611('0x3c')]);_0x2d3de2[_0xb611('0x3f')]=_[_0xb611('0x3e')](_0xba5256['model'],qs[_0xb611('0x40')](_0x251a27[_0xb611('0x3c')]['fields']));_0x2d3de2['attributes']=_0x2d3de2['attributes'][_0xb611('0x41')]?_0x2d3de2[_0xb611('0x3f')]:_0xba5256[_0xb611('0x3a')];_0x2d3de2['order']=qs[_0xb611('0x44')](_0x251a27[_0xb611('0x3c')][_0xb611('0x44')]);_0x2d3de2[_0xb611('0x45')]=qs['filters'](_[_0xb611('0x46')](_0x251a27[_0xb611('0x3c')],_0xba5256[_0xb611('0x3d')]));if(_0x251a27[_0xb611('0x3c')][_0xb611('0x57')]){_0x2d3de2[_0xb611('0x45')]=_[_0xb611('0x4f')](_0x2d3de2['where'],{'$or':_[_0xb611('0x47')](_0x2d3de2[_0xb611('0x3f')],function(_0x53f8c8){var _0x227a10={};_0x227a10[_0x53f8c8]={'$like':'%'+_0x251a27[_0xb611('0x3c')]['filter']+'%'};return _0x227a10;})});}_0x2d3de2=_['merge']({},_0x2d3de2,_0x251a27['options']);return _0x59e8b8[_0xb611('0x59')](_0x2d3de2);}})[_0xb611('0x1d')](function(_0x5bfb5b){if(_0x5bfb5b){_0xc0a907=_0x5bfb5b[_0xb611('0x41')];if(!_0x251a27[_0xb611('0x3c')][_0xb611('0x58')](_0xb611('0x42'))){_0x2d3de2[_0xb611('0x2f')]=qs[_0xb611('0x2f')](_0x251a27[_0xb611('0x3c')][_0xb611('0x2f')]);_0x2d3de2[_0xb611('0x2e')]=qs[_0xb611('0x2e')](_0x251a27['query'][_0xb611('0x2e')]);}return _0x59e8b8['getSubjects'](_0x2d3de2);}})['then'](function(_0x196541){if(_0x196541){return _0x196541?{'count':_0xc0a907,'rows':_0x196541}:null;}})[_0xb611('0x1d')](respondWithResult(_0x5a86cb,null))[_0xb611('0x28')](handleError(_0x5a86cb,null));};exports[_0xb611('0x5a')]=function(_0x37545b,_0x4a79f4,_0x44c8d0){var _0x2c3cf1={};var _0x1c9f68={};var _0x547eb8;var _0x416b8a;return db[_0xb611('0x39')]['findOne']({'where':{'id':_0x37545b[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x4a79f4,null))['then'](function(_0x39b346){if(_0x39b346){_0x547eb8=_0x39b346;_0x1c9f68[_0xb611('0x3a')]=_['keys'](db['FreshdeskField'][_0xb611('0x4e')]);_0x1c9f68[_0xb611('0x3c')]=_[_0xb611('0x3b')](_0x37545b[_0xb611('0x3c')]);_0x1c9f68[_0xb611('0x3d')]=_['intersection'](_0x1c9f68[_0xb611('0x3a')],_0x1c9f68[_0xb611('0x3c')]);_0x2c3cf1[_0xb611('0x3f')]=_[_0xb611('0x3e')](_0x1c9f68[_0xb611('0x3a')],qs[_0xb611('0x40')](_0x37545b[_0xb611('0x3c')][_0xb611('0x40')]));_0x2c3cf1[_0xb611('0x3f')]=_0x2c3cf1['attributes'][_0xb611('0x41')]?_0x2c3cf1[_0xb611('0x3f')]:_0x1c9f68['model'];_0x2c3cf1[_0xb611('0x43')]=qs['sort'](_0x37545b[_0xb611('0x3c')][_0xb611('0x44')]);_0x2c3cf1[_0xb611('0x45')]=qs[_0xb611('0x3d')](_[_0xb611('0x46')](_0x37545b[_0xb611('0x3c')],_0x1c9f68[_0xb611('0x3d')]));if(_0x37545b[_0xb611('0x3c')]['filter']){_0x2c3cf1[_0xb611('0x45')]=_[_0xb611('0x4f')](_0x2c3cf1[_0xb611('0x45')],{'$or':_['map'](_0x2c3cf1[_0xb611('0x3f')],function(_0x3d5da7){var _0x5ada1a={};_0x5ada1a[_0x3d5da7]={'$like':'%'+_0x37545b[_0xb611('0x3c')]['filter']+'%'};return _0x5ada1a;})});}_0x2c3cf1=_[_0xb611('0x4f')]({},_0x2c3cf1,_0x37545b[_0xb611('0x4a')]);return _0x547eb8[_0xb611('0x5a')](_0x2c3cf1);}})[_0xb611('0x1d')](function(_0x424041){if(_0x424041){_0x416b8a=_0x424041[_0xb611('0x41')];if(!_0x37545b['query']['hasOwnProperty'](_0xb611('0x42'))){_0x2c3cf1[_0xb611('0x2f')]=qs[_0xb611('0x2f')](_0x37545b[_0xb611('0x3c')][_0xb611('0x2f')]);_0x2c3cf1['offset']=qs[_0xb611('0x2e')](_0x37545b[_0xb611('0x3c')][_0xb611('0x2e')]);}return _0x547eb8[_0xb611('0x5a')](_0x2c3cf1);}})['then'](function(_0x5897e7){if(_0x5897e7){return _0x5897e7?{'count':_0x416b8a,'rows':_0x5897e7}:null;}})['then'](respondWithResult(_0x4a79f4,null))[_0xb611('0x28')](handleError(_0x4a79f4,null));};exports[_0xb611('0x5b')]=function(_0x3dd011,_0x1abc77,_0x17ea87){var _0x162a0d={};var _0x4e62ed={};var _0x1c2b39;var _0x46bd80;return db[_0xb611('0x39')]['findOne']({'where':{'id':_0x3dd011[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0x1abc77,null))[_0xb611('0x1d')](function(_0x4af1bd){if(_0x4af1bd){_0x1c2b39=_0x4af1bd;_0x4e62ed[_0xb611('0x3a')]=_[_0xb611('0x3b')](db[_0xb611('0x5c')][_0xb611('0x4e')]);_0x4e62ed['query']=_[_0xb611('0x3b')](_0x3dd011['query']);_0x4e62ed[_0xb611('0x3d')]=_['intersection'](_0x4e62ed[_0xb611('0x3a')],_0x4e62ed['query']);_0x162a0d['attributes']=_[_0xb611('0x3e')](_0x4e62ed[_0xb611('0x3a')],qs['fields'](_0x3dd011[_0xb611('0x3c')]['fields']));_0x162a0d[_0xb611('0x3f')]=_0x162a0d[_0xb611('0x3f')]['length']?_0x162a0d['attributes']:_0x4e62ed[_0xb611('0x3a')];_0x162a0d['order']=qs[_0xb611('0x44')](_0x3dd011[_0xb611('0x3c')]['sort']);_0x162a0d['where']=qs[_0xb611('0x3d')](_[_0xb611('0x46')](_0x3dd011[_0xb611('0x3c')],_0x4e62ed[_0xb611('0x3d')]));if(_0x3dd011[_0xb611('0x3c')][_0xb611('0x57')]){_0x162a0d['where']=_[_0xb611('0x4f')](_0x162a0d['where'],{'$or':_['map'](_0x162a0d[_0xb611('0x3f')],function(_0x32ba26){var _0x1b027c={};_0x1b027c[_0x32ba26]={'$like':'%'+_0x3dd011[_0xb611('0x3c')][_0xb611('0x57')]+'%'};return _0x1b027c;})});}_0x162a0d=_[_0xb611('0x4f')]({},_0x162a0d,_0x3dd011[_0xb611('0x4a')]);return _0x1c2b39[_0xb611('0x5b')](_0x162a0d);}})['then'](function(_0x25d70a){if(_0x25d70a){_0x46bd80=_0x25d70a[_0xb611('0x41')];if(!_0x3dd011['query']['hasOwnProperty']('nolimit')){_0x162a0d[_0xb611('0x2f')]=qs[_0xb611('0x2f')](_0x3dd011['query'][_0xb611('0x2f')]);_0x162a0d[_0xb611('0x2e')]=qs[_0xb611('0x2e')](_0x3dd011[_0xb611('0x3c')]['offset']);}return _0x1c2b39[_0xb611('0x5b')](_0x162a0d);}})['then'](function(_0x375fcb){if(_0x375fcb){return _0x375fcb?{'count':_0x46bd80,'rows':_0x375fcb}:null;}})[_0xb611('0x1d')](respondWithResult(_0x1abc77,null))[_0xb611('0x28')](handleError(_0x1abc77,null));};exports[_0xb611('0x5d')]=function(_0x957140,_0xcccf7f,_0xbd7a27){if(_0x957140[_0xb611('0x52')]['id']){delete _0x957140[_0xb611('0x52')]['id'];}return db[_0xb611('0x39')]['findOne']({'where':{'id':_0x957140[_0xb611('0x53')]['id']}})[_0xb611('0x1d')](handleEntityNotFound(_0xcccf7f,null))[_0xb611('0x1d')](function(_0x22d577){if(_0x22d577){return _0x22d577[_0xb611('0x5d')](_0x957140[_0xb611('0x52')][_0xb611('0x5e')]||[]);}return null;})['then'](respondWithResult(_0xcccf7f,null))[_0xb611('0x28')](handleError(_0xcccf7f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8ba60ae..58dccf2 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 _0x4f17=['api','bluebird','request-promise','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','lodash','../../config/logger'];(function(_0x54b915,_0x335768){var _0xe56145=function(_0x4692d1){while(--_0x4692d1){_0x54b915['push'](_0x54b915['shift']());}};_0xe56145(++_0x335768);}(_0x4f17,0x9e));var _0x74f1=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0x4f17[_0x154cb5];return _0x3f574f;};'use strict';var _=require(_0x74f1('0x0'));var util=require('util');var logger=require(_0x74f1('0x1'))(_0x74f1('0x2'));var moment=require('moment');var BPromise=require(_0x74f1('0x3'));var rp=require(_0x74f1('0x4'));var attributes=require(_0x74f1('0x5'));module[_0x74f1('0x6')]=function(_0x2d1ff2,_0x550215){return _0x2d1ff2['define'](_0x74f1('0x7'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad86=['moment','bluebird','exports','define','lodash','util','../../config/logger','api'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xad86,0x194));var _0x6ad8=function(_0xaf0c74,_0x24aeb3){_0xaf0c74=_0xaf0c74-0x0;var _0x38634f=_0xad86[_0xaf0c74];return _0x38634f;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var logger=require(_0x6ad8('0x2'))(_0x6ad8('0x3'));var moment=require(_0x6ad8('0x4'));var BPromise=require(_0x6ad8('0x5'));var rp=require('request-promise');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6ad8('0x6')]=function(_0x363cc7,_0x24604b){return _0x363cc7[_0x6ad8('0x7')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index faaaa7e..182c396 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 _0x30a1=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x2f6b44,_0xf202be){var _0xf77503=function(_0x309193){while(--_0x309193){_0x2f6b44['push'](_0x2f6b44['shift']());}};_0xf77503(++_0xf202be);}(_0x30a1,0x108));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x130a('0x0'));var moment=require(_0x130a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x130a('0x2'));var db=require(_0x130a('0x3'))['db'];var utils=require(_0x130a('0x4'));var logger=require(_0x130a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x130a('0x6'));var client=jayson[_0x130a('0x7')][_0x130a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x356f88,_0x3c2f1a,_0x1b7004){return new BPromise(function(_0x328084,_0x4cdc7b){return client[_0x130a('0x9')](_0x356f88,_0x1b7004)[_0x130a('0xa')](function(_0x4d2302){logger[_0x130a('0xb')](_0x130a('0xc'),_0x3c2f1a,_0x130a('0xd'));logger[_0x130a('0xe')](_0x130a('0xf'),_0x3c2f1a,_0x130a('0xd'),JSON[_0x130a('0x10')](_0x4d2302));if(_0x4d2302[_0x130a('0x11')]){if(_0x4d2302[_0x130a('0x11')][_0x130a('0x12')]===0x1f4){logger[_0x130a('0x11')](_0x130a('0xc'),_0x3c2f1a,_0x4d2302[_0x130a('0x11')][_0x130a('0x13')]);return _0x4cdc7b(_0x4d2302['error']['message']);}logger[_0x130a('0x11')](_0x130a('0xc'),_0x3c2f1a,_0x4d2302[_0x130a('0x11')]['message']);return _0x328084(_0x4d2302[_0x130a('0x11')][_0x130a('0x13')]);}else{logger['info'](_0x130a('0xc'),_0x3c2f1a,'request\x20sent');_0x328084(_0x4d2302['result'][_0x130a('0x13')]);}})[_0x130a('0x14')](function(_0x47b7fc){logger[_0x130a('0x11')](_0x130a('0xc'),_0x3c2f1a,_0x47b7fc);_0x4cdc7b(_0x47b7fc);});});} \ No newline at end of file +var _0x509e=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5a709c,_0x1e6cfe){var _0x719025=function(_0x1ddba3){while(--_0x1ddba3){_0x5a709c['push'](_0x5a709c['shift']());}};_0x719025(++_0x1e6cfe);}(_0x509e,0x12c));var _0xe509=function(_0x588d50,_0x11f1f4){_0x588d50=_0x588d50-0x0;var _0x47dd55=_0x509e[_0x588d50];return _0x47dd55;};'use strict';var _=require(_0xe509('0x0'));var util=require(_0xe509('0x1'));var moment=require(_0xe509('0x2'));var BPromise=require(_0xe509('0x3'));var rs=require(_0xe509('0x4'));var fs=require('fs');var Redis=require(_0xe509('0x5'));var db=require(_0xe509('0x6'))['db'];var utils=require(_0xe509('0x7'));var logger=require('../../config/logger')(_0xe509('0x8'));var config=require('../../config/environment');var jayson=require(_0xe509('0x9'));var client=jayson['client'][_0xe509('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f57e2,_0x15a237,_0x39de06){return new BPromise(function(_0x4ce94b,_0x1e4827){return client[_0xe509('0xb')](_0x5f57e2,_0x39de06)['then'](function(_0x4fb6f1){logger['info'](_0xe509('0xc'),_0x15a237,_0xe509('0xd'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x15a237,_0xe509('0xd'),JSON['stringify'](_0x4fb6f1));if(_0x4fb6f1[_0xe509('0xe')]){if(_0x4fb6f1['error']['code']===0x1f4){logger[_0xe509('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15a237,_0x4fb6f1['error'][_0xe509('0xf')]);return _0x1e4827(_0x4fb6f1['error'][_0xe509('0xf')]);}logger[_0xe509('0xe')](_0xe509('0xc'),_0x15a237,_0x4fb6f1[_0xe509('0xe')][_0xe509('0xf')]);return _0x4ce94b(_0x4fb6f1[_0xe509('0xe')][_0xe509('0xf')]);}else{logger[_0xe509('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15a237,_0xe509('0xd'));_0x4ce94b(_0x4fb6f1['result'][_0xe509('0xf')]);}})['catch'](function(_0x56fa73){logger[_0xe509('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15a237,_0x56fa73);_0x1e4827(_0x56fa73);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d2d33b2..77ecd66 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 _0xe260=['destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshdeskField.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x59ee3e,_0x56b1c4){var _0x5c0511=function(_0x74e5cd){while(--_0x74e5cd){_0x59ee3e['push'](_0x59ee3e['shift']());}};_0x5c0511(++_0x56b1c4);}(_0xe260,0x6e));var _0x0e26=function(_0x39282d,_0x1afeca){_0x39282d=_0x39282d-0x0;var _0x1a6748=_0xe260[_0x39282d];return _0x1a6748;};'use strict';var multer=require('multer');var util=require(_0x0e26('0x0'));var path=require(_0x0e26('0x1'));var timeout=require(_0x0e26('0x2'));var express=require(_0x0e26('0x3'));var router=express[_0x0e26('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e26('0x5'));var config=require('../../config/environment');var controller=require(_0x0e26('0x6'));router[_0x0e26('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0e26('0x8'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xa')]);router[_0x0e26('0xb')]('/',auth[_0x0e26('0x9')](),controller[_0x0e26('0xc')]);router[_0x0e26('0xd')](_0x0e26('0x8'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xe')]);router[_0x0e26('0xf')]('/:id',auth[_0x0e26('0x9')](),controller[_0x0e26('0x10')]);module[_0x0e26('0x11')]=router; \ No newline at end of file +var _0x989b=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x989b,0x187));var _0xb989=function(_0x2b0810,_0x4e45d4){_0x2b0810=_0x2b0810-0x0;var _0x5261df=_0x989b[_0x2b0810];return _0x5261df;};'use strict';var multer=require(_0xb989('0x0'));var util=require(_0xb989('0x1'));var path=require(_0xb989('0x2'));var timeout=require(_0xb989('0x3'));var express=require(_0xb989('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb989('0x5'));var config=require(_0xb989('0x6'));var controller=require(_0xb989('0x7'));router[_0xb989('0x8')]('/',auth[_0xb989('0x9')](),controller[_0xb989('0xa')]);router[_0xb989('0x8')](_0xb989('0xb'),auth[_0xb989('0x9')](),controller[_0xb989('0xc')]);router[_0xb989('0xd')]('/',auth[_0xb989('0x9')](),controller[_0xb989('0xe')]);router['put'](_0xb989('0xb'),auth[_0xb989('0x9')](),controller[_0xb989('0xf')]);router['delete'](_0xb989('0xb'),auth[_0xb989('0x9')](),controller[_0xb989('0x10')]);module[_0xb989('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index b7e7f97..901eb32 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 _0xcb91=['string','variable','customVariable','STRING','BOOLEAN','ENUM'];(function(_0xd1cf70,_0x116002){var _0x158514=function(_0x58b206){while(--_0x58b206){_0xd1cf70['push'](_0xd1cf70['shift']());}};_0x158514(++_0x116002);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xcb91[_0x506d83];return _0x335e8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),_0x1cb9('0x2'),_0x1cb9('0x3'),'keyValue'),'defaultValue':_0x1cb9('0x1')},'content':{'type':Sequelize[_0x1cb9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),'variable',_0x1cb9('0x3'))},'keyContent':{'type':Sequelize[_0x1cb9('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1cb9('0x4')]},'customField':{'type':Sequelize[_0x1cb9('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x702d=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x5b736f,_0x349a09){var _0x6ed809=function(_0x300af1){while(--_0x300af1){_0x5b736f['push'](_0x5b736f['shift']());}};_0x6ed809(++_0x349a09);}(_0x702d,0x147));var _0xd702=function(_0x2ffd55,_0x53adae){_0x2ffd55=_0x2ffd55-0x0;var _0x3cf917=_0x702d[_0x2ffd55];return _0x3cf917;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'type':{'type':Sequelize[_0xd702('0x2')](_0xd702('0x3'),_0xd702('0x4'),'customVariable',_0xd702('0x5')),'defaultValue':_0xd702('0x3')},'content':{'type':Sequelize[_0xd702('0x6')]},'key':{'type':Sequelize[_0xd702('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd702('0x3'),'variable',_0xd702('0x7'))},'keyContent':{'type':Sequelize[_0xd702('0x6')]},'idField':{'type':Sequelize[_0xd702('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index da16e79..98b3f5a 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 _0x821b=['type','VIRTUAL','merge','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','destroy','then','error','stack','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter'];(function(_0x5189d9,_0xa48e2d){var _0x1acd05=function(_0x567c04){while(--_0x567c04){_0x5189d9['push'](_0x5189d9['shift']());}};_0x1acd05(++_0xa48e2d);}(_0x821b,0x8a));var _0xb821=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x821b[_0x5f1391];return _0x50ebe3;};'use strict';var pdf=require(_0xb821('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb821('0x1'));var jsonpatch=require(_0xb821('0x2'));var rp=require(_0xb821('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb821('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb821('0x5'));var csv=require(_0xb821('0x6'));var ejs=require(_0xb821('0x7'));var fs=require('fs');var _=require(_0xb821('0x8'));var squel=require(_0xb821('0x9'));var crypto=require(_0xb821('0xa'));var jsforce=require(_0xb821('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb821('0x6'));var querystring=require(_0xb821('0xc'));var Papa=require(_0xb821('0xd'));var authService=require(_0xb821('0xe'));var hardwareService=require(_0xb821('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xb821('0x10'));var utils=require('../../config/utils');var config=require(_0xb821('0x11'));var db=require(_0xb821('0x12'))['db'];function respondWithStatusCode(_0x5efbbc,_0x549390){_0x549390=_0x549390||0xcc;return function(_0x51bcb1){if(_0x51bcb1){return _0x5efbbc['sendStatus'](_0x549390);}return _0x5efbbc['status'](_0x549390)[_0xb821('0x13')]();};}function respondWithResult(_0x36725b,_0x9bb445){_0x9bb445=_0x9bb445||0xc8;return function(_0xe22fa2){if(_0xe22fa2){return _0x36725b[_0xb821('0x14')](_0x9bb445)[_0xb821('0x15')](_0xe22fa2);}};}function respondWithFilteredResult(_0x19b8c5,_0x470007){return function(_0x356042){if(_0x356042){var _0x435721=_0x356042[_0xb821('0x16')],_0x5130aa=_0x470007[_0xb821('0x17')],_0x11ea9d=_0x470007[_0xb821('0x17')]+_0x470007[_0xb821('0x18')],_0x4f04e9;if(_0x11ea9d>=_0x435721){_0x11ea9d=_0x435721;_0x4f04e9=0xc8;}else{_0x4f04e9=0xce;}_0x19b8c5[_0xb821('0x14')](_0x4f04e9);return _0x19b8c5[_0xb821('0x19')]('Content-Range',_0x5130aa+'-'+_0x11ea9d+'/'+_0x435721)['json'](_0x356042);}return null;};}function patchUpdates(_0x441d81){return function(_0x370d78){try{jsonpatch['apply'](_0x370d78,_0x441d81,!![]);}catch(_0x16a3da){return BPromise['reject'](_0x16a3da);}return _0x370d78['save']();};}function saveUpdates(_0x280191,_0x3b3afb){return function(_0x1c156b){if(_0x1c156b){return _0x1c156b['update'](_0x280191)['then'](function(_0x5c64bc){return _0x5c64bc;});}return null;};}function removeEntity(_0x24fead,_0x20e555){return function(_0x47b343){if(_0x47b343){return _0x47b343[_0xb821('0x1a')]()[_0xb821('0x1b')](function(){_0x24fead[_0xb821('0x14')](0xcc)[_0xb821('0x13')]();});}};}function handleEntityNotFound(_0x27a392,_0x1efca8){return function(_0x1d8472){if(!_0x1d8472){_0x27a392['sendStatus'](0x194);}return _0x1d8472;};}function handleError(_0x3ade95,_0x84dd7){_0x84dd7=_0x84dd7||0x1f4;return function(_0x5a12bb){logger[_0xb821('0x1c')](_0x5a12bb[_0xb821('0x1d')]);if(_0x5a12bb['name']){delete _0x5a12bb['name'];}_0x3ade95[_0xb821('0x14')](_0x84dd7)['send'](_0x5a12bb);};}exports[_0xb821('0x1e')]=function(_0x1b6a96,_0x434b4f){var _0x14dc7b={},_0xca9f26={},_0x5af798={'count':0x0,'rows':[]};var _0x94ce0c=db['FreshdeskField'][_0xb821('0x1f')];_0xca9f26[_0xb821('0x20')]=_[_0xb821('0x21')](_0x94ce0c);_0xca9f26[_0xb821('0x22')]=_['keys'](_0x1b6a96[_0xb821('0x22')]);_0xca9f26[_0xb821('0x23')]=_[_0xb821('0x24')](_0xca9f26[_0xb821('0x20')],_0xca9f26['query']);_0x14dc7b[_0xb821('0x25')]=_[_0xb821('0x24')](_0xca9f26[_0xb821('0x20')],qs[_0xb821('0x26')](_0x1b6a96[_0xb821('0x22')][_0xb821('0x26')]));_0x14dc7b[_0xb821('0x25')]=_0x14dc7b[_0xb821('0x25')][_0xb821('0x27')]?_0x14dc7b[_0xb821('0x25')]:_0xca9f26[_0xb821('0x20')];if(!_0x1b6a96[_0xb821('0x22')][_0xb821('0x28')](_0xb821('0x29'))){_0x14dc7b[_0xb821('0x18')]=qs[_0xb821('0x18')](_0x1b6a96['query'][_0xb821('0x18')]);_0x14dc7b[_0xb821('0x17')]=qs[_0xb821('0x17')](_0x1b6a96[_0xb821('0x22')][_0xb821('0x17')]);}_0x14dc7b['order']=qs[_0xb821('0x2a')](_0x1b6a96[_0xb821('0x22')][_0xb821('0x2a')]);_0x14dc7b[_0xb821('0x2b')]=qs[_0xb821('0x23')](_['pick'](_0x1b6a96[_0xb821('0x22')],_0xca9f26[_0xb821('0x23')]));if(_0x1b6a96[_0xb821('0x22')][_0xb821('0x2c')]){_0x14dc7b['where']=_['merge'](_0x14dc7b[_0xb821('0x2b')],{'$or':_['map'](_0x94ce0c,function(_0x3534ab){if(_0x3534ab[_0xb821('0x2d')]['key']!==_0xb821('0x2e')){var _0x1f7477={};_0x1f7477[_0x3534ab['field']]={'$like':'%'+_0x1b6a96['query'][_0xb821('0x2c')]+'%'};return _0x1f7477;}})});}_0x14dc7b=_[_0xb821('0x2f')]({},_0x14dc7b,_0x1b6a96['options']);var _0x1128c4={'where':_0x14dc7b[_0xb821('0x2b')]};return db[_0xb821('0x30')][_0xb821('0x16')](_0x1128c4)[_0xb821('0x1b')](function(_0x5d90b3){_0x5af798['count']=_0x5d90b3;if(_0x1b6a96[_0xb821('0x22')][_0xb821('0x31')]){_0x14dc7b[_0xb821('0x32')]=[{'all':!![]}];}return db[_0xb821('0x30')][_0xb821('0x33')](_0x14dc7b);})[_0xb821('0x1b')](function(_0x249276){_0x5af798[_0xb821('0x34')]=_0x249276;return _0x5af798;})[_0xb821('0x1b')](respondWithFilteredResult(_0x434b4f,_0x14dc7b))[_0xb821('0x35')](handleError(_0x434b4f,null));};exports[_0xb821('0x36')]=function(_0x56c351,_0x22d2ec){var _0x3fc3dc={'raw':!![],'where':{'id':_0x56c351[_0xb821('0x37')]['id']}},_0x31c48f={};_0x31c48f[_0xb821('0x20')]=_[_0xb821('0x21')](db['FreshdeskField'][_0xb821('0x1f')]);_0x31c48f['query']=_['keys'](_0x56c351['query']);_0x31c48f['filters']=_[_0xb821('0x24')](_0x31c48f[_0xb821('0x20')],_0x31c48f['query']);_0x3fc3dc['attributes']=_[_0xb821('0x24')](_0x31c48f['model'],qs[_0xb821('0x26')](_0x56c351[_0xb821('0x22')][_0xb821('0x26')]));_0x3fc3dc[_0xb821('0x25')]=_0x3fc3dc[_0xb821('0x25')][_0xb821('0x27')]?_0x3fc3dc[_0xb821('0x25')]:_0x31c48f[_0xb821('0x20')];if(_0x56c351[_0xb821('0x22')][_0xb821('0x31')]){_0x3fc3dc['include']=[{'all':!![]}];}_0x3fc3dc=_[_0xb821('0x2f')]({},_0x3fc3dc,_0x56c351[_0xb821('0x38')]);return db['FreshdeskField'][_0xb821('0x39')](_0x3fc3dc)['then'](handleEntityNotFound(_0x22d2ec,null))[_0xb821('0x1b')](respondWithResult(_0x22d2ec,null))[_0xb821('0x35')](handleError(_0x22d2ec,null));};exports[_0xb821('0x3a')]=function(_0x552306,_0x54be88){return db[_0xb821('0x30')][_0xb821('0x3a')](_0x552306[_0xb821('0x3b')],{})[_0xb821('0x1b')](respondWithResult(_0x54be88,0xc9))[_0xb821('0x35')](handleError(_0x54be88,null));};exports[_0xb821('0x3c')]=function(_0x3d9792,_0x1e48e0){if(_0x3d9792[_0xb821('0x3b')]['id']){delete _0x3d9792[_0xb821('0x3b')]['id'];}return db[_0xb821('0x30')][_0xb821('0x39')]({'where':{'id':_0x3d9792[_0xb821('0x37')]['id']}})[_0xb821('0x1b')](handleEntityNotFound(_0x1e48e0,null))[_0xb821('0x1b')](saveUpdates(_0x3d9792[_0xb821('0x3b')],null))[_0xb821('0x1b')](respondWithResult(_0x1e48e0,null))[_0xb821('0x35')](handleError(_0x1e48e0,null));};exports['destroy']=function(_0x38b858,_0x178076){return db[_0xb821('0x30')]['find']({'where':{'id':_0x38b858[_0xb821('0x37')]['id']}})[_0xb821('0x1b')](handleEntityNotFound(_0x178076,null))['then'](removeEntity(_0x178076,null))['catch'](handleError(_0x178076,null));}; \ No newline at end of file +var _0x80b7=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','status','Content-Range','json','apply','save','then','stack','name','send','index','FreshdeskField','rawAttributes','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','rows','catch','params','length','includeAll','options','find','create','body','update','destroy'];(function(_0x79374d,_0x5e651a){var _0x220e68=function(_0x5866a0){while(--_0x5866a0){_0x79374d['push'](_0x79374d['shift']());}};_0x220e68(++_0x5e651a);}(_0x80b7,0x12c));var _0x780b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x80b7[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x780b('0x0'));var emlformat=require(_0x780b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x780b('0x2'));var jsonpatch=require(_0x780b('0x3'));var rp=require(_0x780b('0x4'));var moment=require(_0x780b('0x5'));var BPromise=require(_0x780b('0x6'));var Mustache=require(_0x780b('0x7'));var util=require(_0x780b('0x8'));var path=require(_0x780b('0x9'));var sox=require(_0x780b('0xa'));var csv=require(_0x780b('0xb'));var ejs=require(_0x780b('0xc'));var fs=require('fs');var _=require(_0x780b('0xd'));var squel=require(_0x780b('0xe'));var crypto=require(_0x780b('0xf'));var jsforce=require(_0x780b('0x10'));var deskjs=require(_0x780b('0x11'));var toCsv=require(_0x780b('0xb'));var querystring=require('querystring');var Papa=require(_0x780b('0x12'));var authService=require(_0x780b('0x13'));var hardwareService=require(_0x780b('0x14'));var Redis=require(_0x780b('0x15'));var qs=require(_0x780b('0x16'));var logger=require(_0x780b('0x17'))(_0x780b('0x18'));var utils=require(_0x780b('0x19'));var config=require(_0x780b('0x1a'));var db=require(_0x780b('0x1b'))['db'];function respondWithStatusCode(_0x5dc396,_0x542458){_0x542458=_0x542458||0xcc;return function(_0x30b57b){if(_0x30b57b){return _0x5dc396[_0x780b('0x1c')](_0x542458);}return _0x5dc396['status'](_0x542458)[_0x780b('0x1d')]();};}function respondWithResult(_0x38f496,_0x2b66a3){_0x2b66a3=_0x2b66a3||0xc8;return function(_0x405d14){if(_0x405d14){return _0x38f496['status'](_0x2b66a3)['json'](_0x405d14);}};}function respondWithFilteredResult(_0x9008c4,_0x50dcac){return function(_0x339358){if(_0x339358){var _0x9e226e=_0x339358[_0x780b('0x1e')],_0x11c74e=_0x50dcac[_0x780b('0x1f')],_0x5c0c9a=_0x50dcac[_0x780b('0x1f')]+_0x50dcac['limit'],_0x18c87d;if(_0x5c0c9a>=_0x9e226e){_0x5c0c9a=_0x9e226e;_0x18c87d=0xc8;}else{_0x18c87d=0xce;}_0x9008c4[_0x780b('0x20')](_0x18c87d);return _0x9008c4['set'](_0x780b('0x21'),_0x11c74e+'-'+_0x5c0c9a+'/'+_0x9e226e)[_0x780b('0x22')](_0x339358);}return null;};}function patchUpdates(_0x321250){return function(_0x373d71){try{jsonpatch[_0x780b('0x23')](_0x373d71,_0x321250,!![]);}catch(_0x55d93e){return BPromise['reject'](_0x55d93e);}return _0x373d71[_0x780b('0x24')]();};}function saveUpdates(_0x428d55,_0x52269c){return function(_0x5b8f22){if(_0x5b8f22){return _0x5b8f22['update'](_0x428d55)[_0x780b('0x25')](function(_0x3fece3){return _0x3fece3;});}return null;};}function removeEntity(_0x5238ff,_0x59a273){return function(_0x10e442){if(_0x10e442){return _0x10e442['destroy']()[_0x780b('0x25')](function(){_0x5238ff[_0x780b('0x20')](0xcc)[_0x780b('0x1d')]();});}};}function handleEntityNotFound(_0x1980ec,_0xbd0ec){return function(_0x3eae6f){if(!_0x3eae6f){_0x1980ec[_0x780b('0x1c')](0x194);}return _0x3eae6f;};}function handleError(_0xf39def,_0x1a295f){_0x1a295f=_0x1a295f||0x1f4;return function(_0x147e17){logger['error'](_0x147e17[_0x780b('0x26')]);if(_0x147e17[_0x780b('0x27')]){delete _0x147e17['name'];}_0xf39def[_0x780b('0x20')](_0x1a295f)[_0x780b('0x28')](_0x147e17);};}exports[_0x780b('0x29')]=function(_0x2a3c2e,_0x110075){var _0x543ef8={},_0x55e270={},_0x5c0c33={'count':0x0,'rows':[]};var _0x5802f6=db[_0x780b('0x2a')][_0x780b('0x2b')];_0x55e270['model']=_['keys'](_0x5802f6);_0x55e270[_0x780b('0x2c')]=_[_0x780b('0x2d')](_0x2a3c2e[_0x780b('0x2c')]);_0x55e270[_0x780b('0x2e')]=_[_0x780b('0x2f')](_0x55e270[_0x780b('0x30')],_0x55e270['query']);_0x543ef8['attributes']=_[_0x780b('0x2f')](_0x55e270[_0x780b('0x30')],qs['fields'](_0x2a3c2e['query'][_0x780b('0x31')]));_0x543ef8[_0x780b('0x32')]=_0x543ef8['attributes']['length']?_0x543ef8[_0x780b('0x32')]:_0x55e270['model'];if(!_0x2a3c2e[_0x780b('0x2c')][_0x780b('0x33')]('nolimit')){_0x543ef8['limit']=qs[_0x780b('0x34')](_0x2a3c2e[_0x780b('0x2c')][_0x780b('0x34')]);_0x543ef8[_0x780b('0x1f')]=qs[_0x780b('0x1f')](_0x2a3c2e[_0x780b('0x2c')][_0x780b('0x1f')]);}_0x543ef8['order']=qs['sort'](_0x2a3c2e['query'][_0x780b('0x35')]);_0x543ef8[_0x780b('0x36')]=qs[_0x780b('0x2e')](_[_0x780b('0x37')](_0x2a3c2e[_0x780b('0x2c')],_0x55e270[_0x780b('0x2e')]));if(_0x2a3c2e['query'][_0x780b('0x38')]){_0x543ef8[_0x780b('0x36')]=_[_0x780b('0x39')](_0x543ef8[_0x780b('0x36')],{'$or':_[_0x780b('0x3a')](_0x5802f6,function(_0x5b3efc){if(_0x5b3efc[_0x780b('0x3b')][_0x780b('0x3c')]!==_0x780b('0x3d')){var _0x12b8f8={};_0x12b8f8[_0x5b3efc[_0x780b('0x3e')]]={'$like':'%'+_0x2a3c2e[_0x780b('0x2c')][_0x780b('0x38')]+'%'};return _0x12b8f8;}})});}_0x543ef8=_[_0x780b('0x39')]({},_0x543ef8,_0x2a3c2e['options']);var _0xac5ef6={'where':_0x543ef8[_0x780b('0x36')]};return db[_0x780b('0x2a')]['count'](_0xac5ef6)['then'](function(_0xb20b19){_0x5c0c33['count']=_0xb20b19;if(_0x2a3c2e[_0x780b('0x2c')]['includeAll']){_0x543ef8[_0x780b('0x3f')]=[{'all':!![]}];}return db[_0x780b('0x2a')]['findAll'](_0x543ef8);})[_0x780b('0x25')](function(_0x473f60){_0x5c0c33[_0x780b('0x40')]=_0x473f60;return _0x5c0c33;})['then'](respondWithFilteredResult(_0x110075,_0x543ef8))[_0x780b('0x41')](handleError(_0x110075,null));};exports['show']=function(_0xe48ee1,_0x4d629b){var _0xd252d2={'raw':!![],'where':{'id':_0xe48ee1[_0x780b('0x42')]['id']}},_0xef7396={};_0xef7396[_0x780b('0x30')]=_['keys'](db[_0x780b('0x2a')]['rawAttributes']);_0xef7396[_0x780b('0x2c')]=_[_0x780b('0x2d')](_0xe48ee1[_0x780b('0x2c')]);_0xef7396[_0x780b('0x2e')]=_[_0x780b('0x2f')](_0xef7396['model'],_0xef7396[_0x780b('0x2c')]);_0xd252d2[_0x780b('0x32')]=_[_0x780b('0x2f')](_0xef7396[_0x780b('0x30')],qs[_0x780b('0x31')](_0xe48ee1[_0x780b('0x2c')][_0x780b('0x31')]));_0xd252d2[_0x780b('0x32')]=_0xd252d2[_0x780b('0x32')][_0x780b('0x43')]?_0xd252d2['attributes']:_0xef7396[_0x780b('0x30')];if(_0xe48ee1[_0x780b('0x2c')][_0x780b('0x44')]){_0xd252d2[_0x780b('0x3f')]=[{'all':!![]}];}_0xd252d2=_[_0x780b('0x39')]({},_0xd252d2,_0xe48ee1[_0x780b('0x45')]);return db['FreshdeskField'][_0x780b('0x46')](_0xd252d2)[_0x780b('0x25')](handleEntityNotFound(_0x4d629b,null))[_0x780b('0x25')](respondWithResult(_0x4d629b,null))['catch'](handleError(_0x4d629b,null));};exports['create']=function(_0x224bf4,_0x1ddf0d){return db[_0x780b('0x2a')][_0x780b('0x47')](_0x224bf4[_0x780b('0x48')],{})[_0x780b('0x25')](respondWithResult(_0x1ddf0d,0xc9))[_0x780b('0x41')](handleError(_0x1ddf0d,null));};exports[_0x780b('0x49')]=function(_0x2381ed,_0x37495a){if(_0x2381ed[_0x780b('0x48')]['id']){delete _0x2381ed[_0x780b('0x48')]['id'];}return db[_0x780b('0x2a')][_0x780b('0x46')]({'where':{'id':_0x2381ed[_0x780b('0x42')]['id']}})[_0x780b('0x25')](handleEntityNotFound(_0x37495a,null))['then'](saveUpdates(_0x2381ed['body'],null))[_0x780b('0x25')](respondWithResult(_0x37495a,null))[_0x780b('0x41')](handleError(_0x37495a,null));};exports[_0x780b('0x4a')]=function(_0x40dc01,_0xb90a01){return db[_0x780b('0x2a')][_0x780b('0x46')]({'where':{'id':_0x40dc01['params']['id']}})['then'](handleEntityNotFound(_0xb90a01,null))['then'](removeEntity(_0xb90a01,null))['catch'](handleError(_0xb90a01,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 0019a95..f3ddcac 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 _0x480f=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','./intFreshdeskField.attributes','exports'];(function(_0x401ec6,_0x37ae2b){var _0x1e9a74=function(_0x292afb){while(--_0x292afb){_0x401ec6['push'](_0x401ec6['shift']());}};_0x1e9a74(++_0x37ae2b);}(_0x480f,0x192));var _0xf480=function(_0x478bcf,_0x11eb51){_0x478bcf=_0x478bcf-0x0;var _0x4b84e0=_0x480f[_0x478bcf];return _0x4b84e0;};'use strict';var _=require(_0xf480('0x0'));var util=require(_0xf480('0x1'));var logger=require('../../config/logger')(_0xf480('0x2'));var moment=require(_0xf480('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xf480('0x4'));module[_0xf480('0x5')]=function(_0x53d0b4,_0x28aebc){return _0x53d0b4[_0xf480('0x6')](_0xf480('0x7'),attributes,{'tableName':_0xf480('0x8'),'paranoid':![],'indexes':[{'name':_0xf480('0x9'),'fields':[_0xf480('0xa'),_0xf480('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb3b=['idField','FieldId','lodash','api','moment','bluebird','request-promise','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x90db44,_0x1e1ea6){var _0x1e2dab=function(_0x39fe5d){while(--_0x39fe5d){_0x90db44['push'](_0x90db44['shift']());}};_0x1e2dab(++_0x1e1ea6);}(_0xdb3b,0x18e));var _0xbdb3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb3b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbdb3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdb3('0x1'));var moment=require(_0xbdb3('0x2'));var BPromise=require(_0xbdb3('0x3'));var rp=require(_0xbdb3('0x4'));var attributes=require(_0xbdb3('0x5'));module[_0xbdb3('0x6')]=function(_0x393943,_0x9c0c69){return _0x393943['define'](_0xbdb3('0x7'),attributes,{'tableName':_0xbdb3('0x8'),'paranoid':![],'indexes':[{'name':_0xbdb3('0x9'),'fields':[_0xbdb3('0xa'),_0xbdb3('0xb')],'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 2127dfc..89a6960 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1c080c,_0x2b7235){var _0x513e33=function(_0x5f4eee){while(--_0x5f4eee){_0x1c080c['push'](_0x1c080c['shift']());}};_0x513e33(++_0x2b7235);}(_0xe14d,0x1ee));var _0xde14=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe14d[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0xd382=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3bffe8,_0x3b651f){var _0x40f5c6=function(_0x149fc0){while(--_0x149fc0){_0x3bffe8['push'](_0x3bffe8['shift']());}};_0x40f5c6(++_0x3b651f);}(_0xd382,0x1b6));var _0x2d38=function(_0x225c83,_0x35b060){_0x225c83=_0x225c83-0x0;var _0xeabce6=_0xd382[_0x225c83];return _0xeabce6;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var moment=require(_0x2d38('0x2'));var BPromise=require(_0x2d38('0x3'));var rs=require(_0x2d38('0x4'));var fs=require('fs');var Redis=require(_0x2d38('0x5'));var db=require(_0x2d38('0x6'))['db'];var utils=require(_0x2d38('0x7'));var logger=require(_0x2d38('0x8'))(_0x2d38('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2919,_0x55ae65,_0x1296cb){return new BPromise(function(_0x3fb88f,_0x39ebfd){return client['request'](_0x1e2919,_0x1296cb)['then'](function(_0x5f20a4){logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,'request\x20sent');logger[_0x2d38('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x55ae65,_0x2d38('0xe'),JSON[_0x2d38('0xf')](_0x5f20a4));if(_0x5f20a4[_0x2d38('0x10')]){if(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x11')]===0x1f4){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x39ebfd(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x3fb88f(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}else{logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,_0x2d38('0xe'));_0x3fb88f(_0x5f20a4[_0x2d38('0x13')][_0x2d38('0x12')]);}})[_0x2d38('0x14')](function(_0x6d2a9a){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x6d2a9a);_0x39ebfd(_0x6d2a9a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 73af884..7f2f01f 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 _0x6484=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1cb1b7,_0x433b5a){var _0x378e5e=function(_0x2b4f0b){while(--_0x2b4f0b){_0x1cb1b7['push'](_0x1cb1b7['shift']());}};_0x378e5e(++_0x433b5a);}(_0x6484,0x64));var _0x4648=function(_0x4af269,_0x5c6903){_0x4af269=_0x4af269-0x0;var _0x4dbee8=_0x6484[_0x4af269];return _0x4dbee8;};'use strict';var multer=require(_0x4648('0x0'));var util=require(_0x4648('0x1'));var path=require(_0x4648('0x2'));var timeout=require(_0x4648('0x3'));var express=require(_0x4648('0x4'));var router=express[_0x4648('0x5')]();var auth=require(_0x4648('0x6'));var interaction=require(_0x4648('0x7'));var config=require(_0x4648('0x8'));var controller=require(_0x4648('0x9'));router['get']('/',auth[_0x4648('0xa')](),controller[_0x4648('0xb')]);router[_0x4648('0xc')](_0x4648('0xd'),auth[_0x4648('0xa')](),controller[_0x4648('0xe')]);router['get'](_0x4648('0xf'),auth[_0x4648('0xa')](),controller[_0x4648('0x10')]);router['get'](_0x4648('0x11'),auth[_0x4648('0xa')](),controller[_0x4648('0x12')]);router[_0x4648('0x13')]('/',auth[_0x4648('0xa')](),controller[_0x4648('0x14')]);router[_0x4648('0x13')](_0x4648('0xf'),auth[_0x4648('0xa')](),controller[_0x4648('0x15')]);router[_0x4648('0x16')](_0x4648('0xd'),auth[_0x4648('0xa')](),controller[_0x4648('0x17')]);router[_0x4648('0x18')](_0x4648('0xd'),auth[_0x4648('0xa')](),controller['destroy']);module[_0x4648('0x19')]=router; \ No newline at end of file +var _0x5142=['post','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','show','get','/:id/configurations','getConfigurations','getFields'];(function(_0x27dfe7,_0x3acd6f){var _0x9d647c=function(_0x200340){while(--_0x200340){_0x27dfe7['push'](_0x27dfe7['shift']());}};_0x9d647c(++_0x3acd6f);}(_0x5142,0xf8));var _0x2514=function(_0x336819,_0x12ff44){_0x336819=_0x336819-0x0;var _0x4f8ee0=_0x5142[_0x336819];return _0x4f8ee0;};'use strict';var multer=require(_0x2514('0x0'));var util=require(_0x2514('0x1'));var path=require(_0x2514('0x2'));var timeout=require(_0x2514('0x3'));var express=require(_0x2514('0x4'));var router=express[_0x2514('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2514('0x6'));var config=require(_0x2514('0x7'));var controller=require(_0x2514('0x8'));router['get']('/',auth[_0x2514('0x9')](),controller[_0x2514('0xa')]);router['get']('/:id',auth[_0x2514('0x9')](),controller[_0x2514('0xb')]);router[_0x2514('0xc')](_0x2514('0xd'),auth[_0x2514('0x9')](),controller[_0x2514('0xe')]);router[_0x2514('0xc')]('/:id/fields',auth[_0x2514('0x9')](),controller[_0x2514('0xf')]);router[_0x2514('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2514('0x10')](_0x2514('0xd'),auth[_0x2514('0x9')](),controller[_0x2514('0x11')]);router[_0x2514('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2514('0x13')]);router[_0x2514('0x14')](_0x2514('0x15'),auth['isAuthenticated'](),controller[_0x2514('0x16')]);module[_0x2514('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 700dc05..96912d8 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 _0x145a=['exports','STRING','username','newTab'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0x145a,0x9c));var _0xa145=function(_0x8ab0a2,_0x31cf50){_0x8ab0a2=_0x8ab0a2-0x0;var _0xbfe8f9=_0x145a[_0x8ab0a2];return _0xbfe8f9;};'use strict';var Sequelize=require('sequelize');module[_0xa145('0x0')]={'name':{'type':Sequelize[_0xa145('0x1')]},'description':{'type':Sequelize[_0xa145('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa145('0x2')},'remoteUri':{'type':Sequelize[_0xa145('0x1')]},'password':{'type':Sequelize[_0xa145('0x1')]},'clientId':{'type':Sequelize[_0xa145('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('integrationTab',_0xa145('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x6fb9=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x6fb9,0xd0));var _0x96fb=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x6fb9[_0x4017b0];return _0x5ed4f7;};'use strict';var Sequelize=require(_0x96fb('0x0'));module[_0x96fb('0x1')]={'name':{'type':Sequelize[_0x96fb('0x2')]},'description':{'type':Sequelize[_0x96fb('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x96fb('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x96fb('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x96fb('0x2')]},'serverUrl':{'type':Sequelize[_0x96fb('0x2')]},'type':{'type':Sequelize[_0x96fb('0x4')](_0x96fb('0x5'),_0x96fb('0x6')),'defaultValue':_0x96fb('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 17e7a58..07c8416 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 _0x1767=['api','../../config/environment','../../components/integrations/configuration','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','stack','send','index','SalesforceAccount','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','concat','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','isNil','Case','Origin','Reason','IsEscalated','SuppliedName','remove','name','label','custom','picklistValues','boolean','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0x52d9e6,_0x1bc63e){var _0x393760=function(_0x5bcddd){while(--_0x5bcddd){_0x52d9e6['push'](_0x52d9e6['shift']());}};_0x393760(++_0x1bc63e);}(_0x1767,0x71));var _0x7176=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x1767[_0x4bacb6];return _0x58c029;};'use strict';var pdf=require(_0x7176('0x0'));var emlformat=require(_0x7176('0x1'));var rimraf=require(_0x7176('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7176('0x3'));var rp=require(_0x7176('0x4'));var moment=require(_0x7176('0x5'));var BPromise=require(_0x7176('0x6'));var Mustache=require('mustache');var util=require(_0x7176('0x7'));var path=require('path');var sox=require(_0x7176('0x8'));var csv=require(_0x7176('0x9'));var ejs=require(_0x7176('0xa'));var fs=require('fs');var _=require(_0x7176('0xb'));var squel=require(_0x7176('0xc'));var crypto=require(_0x7176('0xd'));var jsforce=require(_0x7176('0xe'));var deskjs=require(_0x7176('0xf'));var toCsv=require(_0x7176('0x9'));var querystring=require(_0x7176('0x10'));var Papa=require(_0x7176('0x11'));var authService=require(_0x7176('0x12'));var hardwareService=require(_0x7176('0x13'));var Redis=require(_0x7176('0x14'));var qs=require(_0x7176('0x15'));var logger=require('../../config/logger')(_0x7176('0x16'));var utils=require('../../config/utils');var config=require(_0x7176('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7176('0x18'));var jayson=require(_0x7176('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7e08,_0x270ae6,_0x59c210,_0x462fdb){return new BPromise(function(_0x2de44f,_0x4ff043){var _0x3bcce7=_0x462fdb||client;return _0x3bcce7[_0x7176('0x1a')](_0x1f7e08,_0x59c210)[_0x7176('0x1b')](function(_0x2a9bb2){logger[_0x7176('0x1c')](_0x7176('0x1d'),_0x270ae6,_0x7176('0x1e'));logger['debug'](_0x7176('0x1f'),_0x270ae6,_0x7176('0x1e'),JSON['stringify'](_0x2a9bb2));if(_0x2a9bb2[_0x7176('0x20')]){if(_0x2a9bb2[_0x7176('0x20')][_0x7176('0x21')]===0x1f4){logger[_0x7176('0x20')](_0x7176('0x1d'),_0x270ae6,_0x2a9bb2[_0x7176('0x20')][_0x7176('0x22')]);return _0x4ff043(_0x2a9bb2[_0x7176('0x20')][_0x7176('0x22')]);}logger['error'](_0x7176('0x1d'),_0x270ae6,_0x2a9bb2[_0x7176('0x20')]['message']);return _0x2de44f(_0x2a9bb2[_0x7176('0x20')][_0x7176('0x22')]);}else{logger[_0x7176('0x1c')](_0x7176('0x1d'),_0x270ae6,'request\x20sent');_0x2de44f(_0x2a9bb2[_0x7176('0x23')]['message']);}})['catch'](function(_0x4182a8){logger['error'](_0x7176('0x1d'),_0x270ae6,_0x4182a8);_0x4ff043(_0x4182a8);});});}function respondWithStatusCode(_0x3d856a,_0x2e5d02){_0x2e5d02=_0x2e5d02||0xcc;return function(_0x44a371){if(_0x44a371){return _0x3d856a[_0x7176('0x24')](_0x2e5d02);}return _0x3d856a[_0x7176('0x25')](_0x2e5d02)[_0x7176('0x26')]();};}function respondWithResult(_0x2e6414,_0x16843f){_0x16843f=_0x16843f||0xc8;return function(_0x10ef60){if(_0x10ef60){return _0x2e6414[_0x7176('0x25')](_0x16843f)[_0x7176('0x27')](_0x10ef60);}};}function respondWithFilteredResult(_0x4cb8c9,_0x2778dd){return function(_0x3069e5){if(_0x3069e5){var _0x3f6452=_0x3069e5[_0x7176('0x28')],_0x16b69a=_0x2778dd[_0x7176('0x29')],_0x2a12a2=_0x2778dd[_0x7176('0x29')]+_0x2778dd[_0x7176('0x2a')],_0x5bef90;if(_0x2a12a2>=_0x3f6452){_0x2a12a2=_0x3f6452;_0x5bef90=0xc8;}else{_0x5bef90=0xce;}_0x4cb8c9['status'](_0x5bef90);return _0x4cb8c9[_0x7176('0x2b')](_0x7176('0x2c'),_0x16b69a+'-'+_0x2a12a2+'/'+_0x3f6452)[_0x7176('0x27')](_0x3069e5);}return null;};}function patchUpdates(_0x40928c){return function(_0x3e72b1){try{jsonpatch['apply'](_0x3e72b1,_0x40928c,!![]);}catch(_0xf1733a){return BPromise[_0x7176('0x2d')](_0xf1733a);}return _0x3e72b1['save']();};}function saveUpdates(_0x3594ac,_0x324888){return function(_0x593b01){if(_0x593b01){return _0x593b01[_0x7176('0x2e')](_0x3594ac)[_0x7176('0x1b')](function(_0x9e2ec6){return _0x9e2ec6;});}return null;};}function removeEntity(_0x58a5cf,_0xc0b5c0){return function(_0x17b4d4){if(_0x17b4d4){return _0x17b4d4[_0x7176('0x2f')]()[_0x7176('0x1b')](function(){_0x58a5cf[_0x7176('0x25')](0xcc)[_0x7176('0x26')]();});}};}function handleEntityNotFound(_0x1de9b1,_0x128f8e){return function(_0x394f86){if(!_0x394f86){_0x1de9b1[_0x7176('0x24')](0x194);}return _0x394f86;};}function handleError(_0x1e5873,_0x1bcf80){_0x1bcf80=_0x1bcf80||0x1f4;return function(_0x3993ce){logger[_0x7176('0x20')](_0x3993ce[_0x7176('0x30')]);if(_0x3993ce['name']){delete _0x3993ce['name'];}_0x1e5873[_0x7176('0x25')](_0x1bcf80)[_0x7176('0x31')](_0x3993ce);};}exports[_0x7176('0x32')]=function(_0x22aaf3,_0x93e7e1){var _0x1c2a9c={},_0xdaff5c={},_0x280638={'count':0x0,'rows':[]};var _0x4ec33a=db[_0x7176('0x33')]['rawAttributes'];_0xdaff5c[_0x7176('0x34')]=_[_0x7176('0x35')](_0x4ec33a);_0xdaff5c['query']=_[_0x7176('0x35')](_0x22aaf3[_0x7176('0x36')]);_0xdaff5c[_0x7176('0x37')]=_['intersection'](_0xdaff5c[_0x7176('0x34')],_0xdaff5c['query']);_0x1c2a9c['attributes']=_[_0x7176('0x38')](_0xdaff5c[_0x7176('0x34')],qs[_0x7176('0x39')](_0x22aaf3[_0x7176('0x36')][_0x7176('0x39')]));_0x1c2a9c[_0x7176('0x3a')]=_0x1c2a9c[_0x7176('0x3a')][_0x7176('0x3b')]?_0x1c2a9c[_0x7176('0x3a')]:_0xdaff5c[_0x7176('0x34')];if(!_0x22aaf3[_0x7176('0x36')][_0x7176('0x3c')](_0x7176('0x3d'))){_0x1c2a9c[_0x7176('0x2a')]=qs[_0x7176('0x2a')](_0x22aaf3[_0x7176('0x36')][_0x7176('0x2a')]);_0x1c2a9c[_0x7176('0x29')]=qs[_0x7176('0x29')](_0x22aaf3[_0x7176('0x36')]['offset']);}_0x1c2a9c[_0x7176('0x3e')]=qs['sort'](_0x22aaf3[_0x7176('0x36')][_0x7176('0x3f')]);_0x1c2a9c[_0x7176('0x40')]=qs['filters'](_['pick'](_0x22aaf3[_0x7176('0x36')],_0xdaff5c[_0x7176('0x37')]));if(_0x22aaf3[_0x7176('0x36')][_0x7176('0x41')]){_0x1c2a9c[_0x7176('0x40')]=_[_0x7176('0x42')](_0x1c2a9c[_0x7176('0x40')],{'$or':_[_0x7176('0x43')](_0x4ec33a,function(_0x31a47c){if(_0x31a47c[_0x7176('0x44')][_0x7176('0x45')]!=='VIRTUAL'){var _0x5cb69f={};_0x5cb69f[_0x31a47c[_0x7176('0x46')]]={'$like':'%'+_0x22aaf3['query']['filter']+'%'};return _0x5cb69f;}})});}_0x1c2a9c=_[_0x7176('0x42')]({},_0x1c2a9c,_0x22aaf3[_0x7176('0x47')]);var _0x2fa57b={'where':_0x1c2a9c[_0x7176('0x40')]};return db[_0x7176('0x33')][_0x7176('0x28')](_0x2fa57b)[_0x7176('0x1b')](function(_0x2514f3){_0x280638[_0x7176('0x28')]=_0x2514f3;if(_0x22aaf3[_0x7176('0x36')]['includeAll']){_0x1c2a9c[_0x7176('0x48')]=[{'all':!![]}];}return db[_0x7176('0x33')][_0x7176('0x49')](_0x1c2a9c);})[_0x7176('0x1b')](function(_0x1be7e6){_0x280638[_0x7176('0x4a')]=_0x1be7e6;return _0x280638;})[_0x7176('0x1b')](respondWithFilteredResult(_0x93e7e1,_0x1c2a9c))[_0x7176('0x4b')](handleError(_0x93e7e1,null));};exports[_0x7176('0x4c')]=function(_0x280bdc,_0x2af405){var _0x8dca7f={'raw':![],'where':{'id':_0x280bdc[_0x7176('0x4d')]['id']}},_0x1d5852={};_0x1d5852[_0x7176('0x34')]=_['keys'](db[_0x7176('0x33')][_0x7176('0x4e')]);_0x1d5852['query']=_[_0x7176('0x35')](_0x280bdc[_0x7176('0x36')]);_0x1d5852[_0x7176('0x37')]=_[_0x7176('0x38')](_0x1d5852[_0x7176('0x34')],_0x1d5852[_0x7176('0x36')]);_0x8dca7f[_0x7176('0x3a')]=_['intersection'](_0x1d5852[_0x7176('0x34')],qs['fields'](_0x280bdc[_0x7176('0x36')]['fields']));_0x8dca7f[_0x7176('0x3a')]=_0x8dca7f[_0x7176('0x3a')][_0x7176('0x3b')]?_0x8dca7f[_0x7176('0x3a')]:_0x1d5852[_0x7176('0x34')];if(_0x280bdc['query'][_0x7176('0x4f')]){_0x8dca7f[_0x7176('0x48')]=[{'all':!![]}];}_0x8dca7f=_[_0x7176('0x42')]({},_0x8dca7f,_0x280bdc['options']);return db[_0x7176('0x33')][_0x7176('0x50')](_0x8dca7f)[_0x7176('0x1b')](handleEntityNotFound(_0x2af405,null))[_0x7176('0x1b')](respondWithResult(_0x2af405,null))[_0x7176('0x4b')](handleError(_0x2af405,null));};exports[_0x7176('0x51')]=function(_0x55e536,_0x42cbe5){return db[_0x7176('0x33')][_0x7176('0x51')](_0x55e536['body'],{})[_0x7176('0x1b')](respondWithResult(_0x42cbe5,0xc9))[_0x7176('0x4b')](handleError(_0x42cbe5,null));};exports[_0x7176('0x2e')]=function(_0x5cb9ce,_0x573e7e){if(_0x5cb9ce[_0x7176('0x52')]['id']){delete _0x5cb9ce[_0x7176('0x52')]['id'];}return db[_0x7176('0x33')][_0x7176('0x50')]({'where':{'id':_0x5cb9ce['params']['id']}})[_0x7176('0x1b')](handleEntityNotFound(_0x573e7e,null))['then'](saveUpdates(_0x5cb9ce[_0x7176('0x52')],null))[_0x7176('0x1b')](respondWithResult(_0x573e7e,null))['catch'](handleError(_0x573e7e,null));};exports[_0x7176('0x2f')]=function(_0x2a680e,_0x96f67f){return db['SalesforceAccount'][_0x7176('0x50')]({'where':{'id':_0x2a680e[_0x7176('0x4d')]['id']}})['then'](handleEntityNotFound(_0x96f67f,null))[_0x7176('0x1b')](removeEntity(_0x96f67f,null))[_0x7176('0x4b')](handleError(_0x96f67f,null));};exports[_0x7176('0x53')]=function(_0x45552c,_0x45b0a9,_0xf60781){var _0x575b75={};var _0x40f06f={};var _0x48f1fa;var _0x160ff8;return db[_0x7176('0x33')][_0x7176('0x54')]({'where':{'id':_0x45552c[_0x7176('0x4d')]['id']}})[_0x7176('0x1b')](handleEntityNotFound(_0x45b0a9,null))['then'](function(_0x42bf84){if(_0x42bf84){_0x48f1fa=_0x42bf84;_0x40f06f[_0x7176('0x34')]=_[_0x7176('0x35')](db[_0x7176('0x55')]['rawAttributes']);_0x40f06f[_0x7176('0x36')]=_['keys'](_0x45552c[_0x7176('0x36')]);_0x40f06f[_0x7176('0x37')]=_[_0x7176('0x38')](_0x40f06f[_0x7176('0x34')],_0x40f06f[_0x7176('0x36')]);_0x575b75[_0x7176('0x3a')]=_['intersection'](_0x40f06f['model'],qs['fields'](_0x45552c[_0x7176('0x36')]['fields']));_0x575b75[_0x7176('0x3a')]=_0x575b75[_0x7176('0x3a')][_0x7176('0x3b')]?_0x575b75[_0x7176('0x3a')]:_0x40f06f[_0x7176('0x34')];_0x575b75[_0x7176('0x3e')]=qs['sort'](_0x45552c['query'][_0x7176('0x3f')]);_0x575b75[_0x7176('0x40')]=qs[_0x7176('0x37')](_[_0x7176('0x56')](_0x45552c[_0x7176('0x36')],_0x40f06f[_0x7176('0x37')]));if(_0x45552c[_0x7176('0x36')][_0x7176('0x41')]){_0x575b75[_0x7176('0x40')]=_['merge'](_0x575b75['where'],{'$or':_[_0x7176('0x43')](_0x575b75[_0x7176('0x3a')],function(_0x4ff326){var _0x428c35={};_0x428c35[_0x4ff326]={'$like':'%'+_0x45552c['query']['filter']+'%'};return _0x428c35;})});}_0x575b75=_[_0x7176('0x42')]({},_0x575b75,_0x45552c[_0x7176('0x47')]);return _0x48f1fa[_0x7176('0x53')](_0x575b75);}})[_0x7176('0x1b')](function(_0x3a8eb1){if(_0x3a8eb1){_0x160ff8=_0x3a8eb1['length'];if(!_0x45552c[_0x7176('0x36')]['hasOwnProperty'](_0x7176('0x3d'))){_0x575b75[_0x7176('0x2a')]=qs[_0x7176('0x2a')](_0x45552c[_0x7176('0x36')][_0x7176('0x2a')]);_0x575b75[_0x7176('0x29')]=qs['offset'](_0x45552c[_0x7176('0x36')][_0x7176('0x29')]);}return _0x48f1fa[_0x7176('0x53')](_0x575b75);}})['then'](function(_0x11025e){if(_0x11025e){return _0x11025e?{'count':_0x160ff8,'rows':_0x11025e}:null;}})[_0x7176('0x1b')](respondWithResult(_0x45b0a9,null))[_0x7176('0x4b')](handleError(_0x45b0a9,null));};exports['addConfiguration']=function(_0x4f2474,_0x4a8c0d,_0x5a71c6){if(_0x4f2474['body']['id']){delete _0x4f2474['body']['id'];}return db[_0x7176('0x33')][_0x7176('0x54')]({'where':{'id':_0x4f2474[_0x7176('0x4d')]['id']}})[_0x7176('0x1b')](handleEntityNotFound(_0x4a8c0d,null))[_0x7176('0x1b')](function(_0x2a1282){if(_0x2a1282){_0x4f2474['body'][_0x7176('0x57')]=_0x2a1282['id'];_0x4f2474['body'][_0x7176('0x58')]=integrations[_0x7176('0x59')](_0x4f2474[_0x7176('0x52')][_0x7176('0x5a')],_0x4f2474[_0x7176('0x52')]['type']);_0x4f2474[_0x7176('0x52')][_0x7176('0x5b')]=integrations[_0x7176('0x5c')](_0x4f2474[_0x7176('0x52')]['channel'],_0x4f2474['body'][_0x7176('0x44')]);return db[_0x7176('0x55')]['create'](_0x4f2474[_0x7176('0x52')],{'include':[{'model':db[_0x7176('0x5d')],'as':_0x7176('0x58')},{'model':db['SalesforceField'],'as':_0x7176('0x5b')}]});}return null;})['then'](respondWithResult(_0x4a8c0d,null))[_0x7176('0x4b')](handleError(_0x4a8c0d,null));};exports[_0x7176('0x5e')]=function(_0x44fa99,_0x11a9e0,_0x4f5853){var _0x38be93;var _0x348d4a='';var _0x1f1b28=_0x7176('0x5f');return db[_0x7176('0x33')]['findOne']({'where':{'id':_0x44fa99[_0x7176('0x4d')]['id']},'attributes':['id','remoteUri',_0x7176('0x60'),_0x7176('0x61'),_0x7176('0x62'),_0x7176('0x63'),_0x7176('0x64')]})[_0x7176('0x1b')](handleEntityNotFound(_0x11a9e0,null))[_0x7176('0x1b')](function(_0x313b0a){if(_0x313b0a){_0x348d4a=_0x313b0a[_0x7176('0x65')];var _0x2dc525=_0x348d4a[_0x7176('0x66')](-0x1);if(_0x2dc525==='/'){_0x348d4a=_0x348d4a['substring'](0x0,_0x348d4a[_0x7176('0x67')](_0x2dc525));}_0x38be93=new jsforce[(_0x7176('0x68'))]({'oauth2':{'loginUrl':_0x348d4a,'clientId':_0x313b0a[_0x7176('0x60')],'clientSecret':_0x313b0a[_0x7176('0x61')]}});return _0x38be93['login'](_0x313b0a[_0x7176('0x62')],_0x313b0a[_0x7176('0x63')][_0x7176('0x69')](_0x313b0a[_0x7176('0x64')]));}})[_0x7176('0x1b')](function(_0x1f53f9){if(_0x1f53f9){if(!_['isNil'](_0x44fa99['query'][_0x7176('0x6a')])){_0x1f1b28=_0x44fa99['query'][_0x7176('0x6a')];}return _0x38be93[_0x7176('0x6b')](_0x1f1b28)[_0x7176('0x6c')]();}})[_0x7176('0x1b')](function(_0x40edb2){var _0x4ffe91=[_0x7176('0x6d'),_0x7176('0x6e'),_0x7176('0x6f'),_0x7176('0x70'),_0x7176('0x71'),_0x7176('0x72'),_0x7176('0x73'),_0x7176('0x74')];if(!_[_0x7176('0x75')](_0x44fa99[_0x7176('0x36')][_0x7176('0x6a')])&&_0x44fa99['query'][_0x7176('0x6a')]===_0x7176('0x76')){_0x4ffe91=[_0x7176('0x74'),_0x7176('0x77'),_0x7176('0x78'),'Status',_0x7176('0x72'),_0x7176('0x79'),_0x7176('0x7a'),'SuppliedCompany'];}if(_0x40edb2){_[_0x7176('0x7b')](_0x40edb2[_0x7176('0x39')],function(_0x25f6ea){return _0x25f6ea['custom']===![]&&!_0x4ffe91['includes'](_0x25f6ea[_0x7176('0x7c')]);});return{'count':_0x40edb2['fields'][_0x7176('0x3b')],'rows':_[_0x7176('0x43')](_0x40edb2[_0x7176('0x39')],function(_0x4bd0e6){return{'id':_0x4bd0e6['name'],'name':_0x4bd0e6[_0x7176('0x7d')],'custom':_0x4bd0e6[_0x7176('0x7e')],'options':_0x4bd0e6['picklistValues'][_0x7176('0x3b')]>0x0?_[_0x7176('0x43')](_0x4bd0e6[_0x7176('0x7f')],function(_0x5b847f){return{'name':_0x5b847f[_0x7176('0x7d')],'value':_0x5b847f['value']};}):_0x4bd0e6['type']==_0x7176('0x80')?[{'name':'True','value':'true'},{'name':_0x7176('0x81'),'value':_0x7176('0x82')}]:[]};})};}})[_0x7176('0x1b')](respondWithResult(_0x11a9e0,null))['catch'](function(_0x34cc80){var _0x26ef95=_0x44fa99['query'][_0x7176('0x83')]?0x1f4:_0x34cc80[_0x7176('0x84')]||0x1f4;logger[_0x7176('0x20')](_0x7176('0x85'),_0x7176('0x5e'),_0x26ef95,JSON['stringify'](_0x34cc80));delete _0x34cc80[_0x7176('0x7c')];if(_0x26ef95===0x191){_0x26ef95=0x190;}_0x11a9e0[_0x7176('0x25')](_0x26ef95)[_0x7176('0x31')](_0x44fa99[_0x7176('0x36')][_0x7176('0x83')]?{'message':_0x7176('0x86'),'statusCode':_0x34cc80[_0x7176('0x84')]}:_0x34cc80);});}; \ No newline at end of file +var _0x31a2=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','count','offset','limit','set','json','reject','save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','field','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','substring','Connection','concat','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallType','IsArchived','Priority','Status','isNil','Case','Type','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4ce444,_0x4bf51b){var _0x5b6b10=function(_0x16c3a5){while(--_0x16c3a5){_0x4ce444['push'](_0x4ce444['shift']());}};_0x5b6b10(++_0x4bf51b);}(_0x31a2,0xee));var _0x231a=function(_0xe726a1,_0x3c914d){_0xe726a1=_0xe726a1-0x0;var _0x40bed8=_0x31a2[_0xe726a1];return _0x40bed8;};'use strict';var pdf=require(_0x231a('0x0'));var emlformat=require(_0x231a('0x1'));var rimraf=require(_0x231a('0x2'));var zipdir=require(_0x231a('0x3'));var jsonpatch=require(_0x231a('0x4'));var rp=require(_0x231a('0x5'));var moment=require(_0x231a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x231a('0x7'));var util=require('util');var path=require(_0x231a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x231a('0x9'));var fs=require('fs');var _=require(_0x231a('0xa'));var squel=require(_0x231a('0xb'));var crypto=require('crypto');var jsforce=require(_0x231a('0xc'));var deskjs=require(_0x231a('0xd'));var toCsv=require(_0x231a('0xe'));var querystring=require(_0x231a('0xf'));var Papa=require(_0x231a('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x231a('0x11'));var Redis=require(_0x231a('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x231a('0x13'))(_0x231a('0x14'));var utils=require(_0x231a('0x15'));var config=require(_0x231a('0x16'));var db=require(_0x231a('0x17'))['db'];var integrations=require(_0x231a('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0x231a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5384ee,_0x13b319,_0x4e281a,_0x565f13){return new BPromise(function(_0x25b4fa,_0x1855fb){var _0x1271ba=_0x565f13||client;return _0x1271ba[_0x231a('0x1a')](_0x5384ee,_0x4e281a)[_0x231a('0x1b')](function(_0xfde70f){logger['info'](_0x231a('0x1c'),_0x13b319,_0x231a('0x1d'));logger[_0x231a('0x1e')](_0x231a('0x1f'),_0x13b319,_0x231a('0x1d'),JSON[_0x231a('0x20')](_0xfde70f));if(_0xfde70f[_0x231a('0x21')]){if(_0xfde70f[_0x231a('0x21')][_0x231a('0x22')]===0x1f4){logger[_0x231a('0x21')](_0x231a('0x1c'),_0x13b319,_0xfde70f['error'][_0x231a('0x23')]);return _0x1855fb(_0xfde70f['error'][_0x231a('0x23')]);}logger[_0x231a('0x21')](_0x231a('0x1c'),_0x13b319,_0xfde70f['error'][_0x231a('0x23')]);return _0x25b4fa(_0xfde70f[_0x231a('0x21')]['message']);}else{logger[_0x231a('0x24')](_0x231a('0x1c'),_0x13b319,_0x231a('0x1d'));_0x25b4fa(_0xfde70f[_0x231a('0x25')][_0x231a('0x23')]);}})[_0x231a('0x26')](function(_0x4db4a4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x13b319,_0x4db4a4);_0x1855fb(_0x4db4a4);});});}function respondWithStatusCode(_0x3c4a73,_0x436fd5){_0x436fd5=_0x436fd5||0xcc;return function(_0x2c2683){if(_0x2c2683){return _0x3c4a73[_0x231a('0x27')](_0x436fd5);}return _0x3c4a73[_0x231a('0x28')](_0x436fd5)['end']();};}function respondWithResult(_0x1c4514,_0x3faf42){_0x3faf42=_0x3faf42||0xc8;return function(_0x29be92){if(_0x29be92){return _0x1c4514[_0x231a('0x28')](_0x3faf42)['json'](_0x29be92);}};}function respondWithFilteredResult(_0x2d6d3e,_0x159c80){return function(_0x24e1ef){if(_0x24e1ef){var _0x182f08=_0x24e1ef[_0x231a('0x29')],_0x47fee6=_0x159c80[_0x231a('0x2a')],_0x31d5a9=_0x159c80[_0x231a('0x2a')]+_0x159c80[_0x231a('0x2b')],_0x2abcc7;if(_0x31d5a9>=_0x182f08){_0x31d5a9=_0x182f08;_0x2abcc7=0xc8;}else{_0x2abcc7=0xce;}_0x2d6d3e[_0x231a('0x28')](_0x2abcc7);return _0x2d6d3e[_0x231a('0x2c')]('Content-Range',_0x47fee6+'-'+_0x31d5a9+'/'+_0x182f08)[_0x231a('0x2d')](_0x24e1ef);}return null;};}function patchUpdates(_0x3c61b6){return function(_0x393dfd){try{jsonpatch['apply'](_0x393dfd,_0x3c61b6,!![]);}catch(_0x41334a){return BPromise[_0x231a('0x2e')](_0x41334a);}return _0x393dfd[_0x231a('0x2f')]();};}function saveUpdates(_0x5d08bd,_0x20ed74){return function(_0x5a6a92){if(_0x5a6a92){return _0x5a6a92[_0x231a('0x30')](_0x5d08bd)[_0x231a('0x1b')](function(_0x46aeb7){return _0x46aeb7;});}return null;};}function removeEntity(_0x193cac,_0x36f39f){return function(_0x51d6f7){if(_0x51d6f7){return _0x51d6f7[_0x231a('0x31')]()[_0x231a('0x1b')](function(){_0x193cac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3d34,_0x4f2566){return function(_0x432796){if(!_0x432796){_0x3a3d34[_0x231a('0x27')](0x194);}return _0x432796;};}function handleError(_0x103817,_0x144c79){_0x144c79=_0x144c79||0x1f4;return function(_0x16559a){logger[_0x231a('0x21')](_0x16559a[_0x231a('0x32')]);if(_0x16559a[_0x231a('0x33')]){delete _0x16559a[_0x231a('0x33')];}_0x103817[_0x231a('0x28')](_0x144c79)[_0x231a('0x34')](_0x16559a);};}exports[_0x231a('0x35')]=function(_0x1e3207,_0x583a03){var _0x812c25={},_0x3e6577={},_0x1591da={'count':0x0,'rows':[]};var _0x53a5a5=db[_0x231a('0x36')][_0x231a('0x37')];_0x3e6577[_0x231a('0x38')]=_[_0x231a('0x39')](_0x53a5a5);_0x3e6577[_0x231a('0x3a')]=_[_0x231a('0x39')](_0x1e3207[_0x231a('0x3a')]);_0x3e6577[_0x231a('0x3b')]=_[_0x231a('0x3c')](_0x3e6577[_0x231a('0x38')],_0x3e6577['query']);_0x812c25[_0x231a('0x3d')]=_['intersection'](_0x3e6577[_0x231a('0x38')],qs[_0x231a('0x3e')](_0x1e3207[_0x231a('0x3a')][_0x231a('0x3e')]));_0x812c25[_0x231a('0x3d')]=_0x812c25[_0x231a('0x3d')][_0x231a('0x3f')]?_0x812c25[_0x231a('0x3d')]:_0x3e6577['model'];if(!_0x1e3207[_0x231a('0x3a')][_0x231a('0x40')](_0x231a('0x41'))){_0x812c25[_0x231a('0x2b')]=qs[_0x231a('0x2b')](_0x1e3207[_0x231a('0x3a')][_0x231a('0x2b')]);_0x812c25[_0x231a('0x2a')]=qs[_0x231a('0x2a')](_0x1e3207[_0x231a('0x3a')][_0x231a('0x2a')]);}_0x812c25[_0x231a('0x42')]=qs['sort'](_0x1e3207['query'][_0x231a('0x43')]);_0x812c25[_0x231a('0x44')]=qs[_0x231a('0x3b')](_['pick'](_0x1e3207[_0x231a('0x3a')],_0x3e6577[_0x231a('0x3b')]));if(_0x1e3207[_0x231a('0x3a')][_0x231a('0x45')]){_0x812c25[_0x231a('0x44')]=_[_0x231a('0x46')](_0x812c25[_0x231a('0x44')],{'$or':_[_0x231a('0x47')](_0x53a5a5,function(_0x32ab5c){if(_0x32ab5c[_0x231a('0x48')]['key']!=='VIRTUAL'){var _0x193288={};_0x193288[_0x32ab5c[_0x231a('0x49')]]={'$like':'%'+_0x1e3207[_0x231a('0x3a')][_0x231a('0x45')]+'%'};return _0x193288;}})});}_0x812c25=_['merge']({},_0x812c25,_0x1e3207[_0x231a('0x4a')]);var _0xde2cd8={'where':_0x812c25[_0x231a('0x44')]};return db[_0x231a('0x36')]['count'](_0xde2cd8)[_0x231a('0x1b')](function(_0x6186f6){_0x1591da[_0x231a('0x29')]=_0x6186f6;if(_0x1e3207[_0x231a('0x3a')][_0x231a('0x4b')]){_0x812c25[_0x231a('0x4c')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x231a('0x4d')](_0x812c25);})[_0x231a('0x1b')](function(_0x3f5c4b){_0x1591da[_0x231a('0x4e')]=_0x3f5c4b;return _0x1591da;})[_0x231a('0x1b')](respondWithFilteredResult(_0x583a03,_0x812c25))[_0x231a('0x26')](handleError(_0x583a03,null));};exports[_0x231a('0x4f')]=function(_0x454fa5,_0x27731a){var _0x51ef55={'raw':![],'where':{'id':_0x454fa5[_0x231a('0x50')]['id']}},_0x40ecb7={};_0x40ecb7['model']=_[_0x231a('0x39')](db[_0x231a('0x36')][_0x231a('0x37')]);_0x40ecb7[_0x231a('0x3a')]=_[_0x231a('0x39')](_0x454fa5[_0x231a('0x3a')]);_0x40ecb7[_0x231a('0x3b')]=_[_0x231a('0x3c')](_0x40ecb7['model'],_0x40ecb7['query']);_0x51ef55[_0x231a('0x3d')]=_['intersection'](_0x40ecb7[_0x231a('0x38')],qs['fields'](_0x454fa5[_0x231a('0x3a')][_0x231a('0x3e')]));_0x51ef55[_0x231a('0x3d')]=_0x51ef55[_0x231a('0x3d')][_0x231a('0x3f')]?_0x51ef55[_0x231a('0x3d')]:_0x40ecb7[_0x231a('0x38')];if(_0x454fa5['query'][_0x231a('0x4b')]){_0x51ef55[_0x231a('0x4c')]=[{'all':!![]}];}_0x51ef55=_[_0x231a('0x46')]({},_0x51ef55,_0x454fa5[_0x231a('0x4a')]);return db[_0x231a('0x36')][_0x231a('0x51')](_0x51ef55)[_0x231a('0x1b')](handleEntityNotFound(_0x27731a,null))[_0x231a('0x1b')](respondWithResult(_0x27731a,null))['catch'](handleError(_0x27731a,null));};exports[_0x231a('0x52')]=function(_0x193ef2,_0x34528e){return db['SalesforceAccount']['create'](_0x193ef2[_0x231a('0x53')],{})[_0x231a('0x1b')](respondWithResult(_0x34528e,0xc9))[_0x231a('0x26')](handleError(_0x34528e,null));};exports['update']=function(_0x29e996,_0x32a936){if(_0x29e996[_0x231a('0x53')]['id']){delete _0x29e996[_0x231a('0x53')]['id'];}return db[_0x231a('0x36')][_0x231a('0x51')]({'where':{'id':_0x29e996[_0x231a('0x50')]['id']}})['then'](handleEntityNotFound(_0x32a936,null))['then'](saveUpdates(_0x29e996[_0x231a('0x53')],null))[_0x231a('0x1b')](respondWithResult(_0x32a936,null))[_0x231a('0x26')](handleError(_0x32a936,null));};exports['destroy']=function(_0x2ec354,_0x9f4d97){return db['SalesforceAccount'][_0x231a('0x51')]({'where':{'id':_0x2ec354[_0x231a('0x50')]['id']}})[_0x231a('0x1b')](handleEntityNotFound(_0x9f4d97,null))['then'](removeEntity(_0x9f4d97,null))['catch'](handleError(_0x9f4d97,null));};exports[_0x231a('0x54')]=function(_0x304024,_0x3923ed,_0x1caae){var _0x5035e6={};var _0x3e113b={};var _0x245db3;var _0x51bf5e;return db[_0x231a('0x36')][_0x231a('0x55')]({'where':{'id':_0x304024[_0x231a('0x50')]['id']}})[_0x231a('0x1b')](handleEntityNotFound(_0x3923ed,null))[_0x231a('0x1b')](function(_0x1f4836){if(_0x1f4836){_0x245db3=_0x1f4836;_0x3e113b[_0x231a('0x38')]=_['keys'](db[_0x231a('0x56')][_0x231a('0x37')]);_0x3e113b[_0x231a('0x3a')]=_['keys'](_0x304024[_0x231a('0x3a')]);_0x3e113b['filters']=_[_0x231a('0x3c')](_0x3e113b[_0x231a('0x38')],_0x3e113b[_0x231a('0x3a')]);_0x5035e6[_0x231a('0x3d')]=_[_0x231a('0x3c')](_0x3e113b[_0x231a('0x38')],qs[_0x231a('0x3e')](_0x304024['query'][_0x231a('0x3e')]));_0x5035e6[_0x231a('0x3d')]=_0x5035e6[_0x231a('0x3d')][_0x231a('0x3f')]?_0x5035e6[_0x231a('0x3d')]:_0x3e113b['model'];_0x5035e6[_0x231a('0x42')]=qs[_0x231a('0x43')](_0x304024[_0x231a('0x3a')][_0x231a('0x43')]);_0x5035e6[_0x231a('0x44')]=qs[_0x231a('0x3b')](_[_0x231a('0x57')](_0x304024[_0x231a('0x3a')],_0x3e113b[_0x231a('0x3b')]));if(_0x304024['query'][_0x231a('0x45')]){_0x5035e6[_0x231a('0x44')]=_['merge'](_0x5035e6[_0x231a('0x44')],{'$or':_[_0x231a('0x47')](_0x5035e6[_0x231a('0x3d')],function(_0x216af1){var _0x5442ee={};_0x5442ee[_0x216af1]={'$like':'%'+_0x304024[_0x231a('0x3a')][_0x231a('0x45')]+'%'};return _0x5442ee;})});}_0x5035e6=_[_0x231a('0x46')]({},_0x5035e6,_0x304024[_0x231a('0x4a')]);return _0x245db3[_0x231a('0x54')](_0x5035e6);}})[_0x231a('0x1b')](function(_0x5dff7c){if(_0x5dff7c){_0x51bf5e=_0x5dff7c[_0x231a('0x3f')];if(!_0x304024[_0x231a('0x3a')][_0x231a('0x40')]('nolimit')){_0x5035e6[_0x231a('0x2b')]=qs[_0x231a('0x2b')](_0x304024[_0x231a('0x3a')][_0x231a('0x2b')]);_0x5035e6[_0x231a('0x2a')]=qs[_0x231a('0x2a')](_0x304024[_0x231a('0x3a')][_0x231a('0x2a')]);}return _0x245db3[_0x231a('0x54')](_0x5035e6);}})[_0x231a('0x1b')](function(_0x5adb0a){if(_0x5adb0a){return _0x5adb0a?{'count':_0x51bf5e,'rows':_0x5adb0a}:null;}})[_0x231a('0x1b')](respondWithResult(_0x3923ed,null))[_0x231a('0x26')](handleError(_0x3923ed,null));};exports[_0x231a('0x58')]=function(_0x5c9c60,_0x51625e,_0x3b509e){if(_0x5c9c60[_0x231a('0x53')]['id']){delete _0x5c9c60[_0x231a('0x53')]['id'];}return db[_0x231a('0x36')][_0x231a('0x55')]({'where':{'id':_0x5c9c60[_0x231a('0x50')]['id']}})[_0x231a('0x1b')](handleEntityNotFound(_0x51625e,null))[_0x231a('0x1b')](function(_0x5a61f7){if(_0x5a61f7){_0x5c9c60[_0x231a('0x53')]['AccountId']=_0x5a61f7['id'];_0x5c9c60[_0x231a('0x53')][_0x231a('0x59')]=integrations[_0x231a('0x5a')](_0x5c9c60['body'][_0x231a('0x5b')],_0x5c9c60[_0x231a('0x53')][_0x231a('0x48')]);_0x5c9c60['body'][_0x231a('0x5c')]=integrations[_0x231a('0x5d')](_0x5c9c60[_0x231a('0x53')][_0x231a('0x5b')],_0x5c9c60[_0x231a('0x53')][_0x231a('0x48')]);return db[_0x231a('0x56')]['create'](_0x5c9c60[_0x231a('0x53')],{'include':[{'model':db['SalesforceField'],'as':_0x231a('0x59')},{'model':db[_0x231a('0x5e')],'as':'Descriptions'}]});}return null;})[_0x231a('0x1b')](respondWithResult(_0x51625e,null))[_0x231a('0x26')](handleError(_0x51625e,null));};exports[_0x231a('0x5f')]=function(_0x3bde22,_0x527d16,_0x444a67){var _0xc0d6f1;var _0x411924='';var _0x1ace0d=_0x231a('0x60');return db[_0x231a('0x36')][_0x231a('0x55')]({'where':{'id':_0x3bde22[_0x231a('0x50')]['id']},'attributes':['id','remoteUri',_0x231a('0x61'),_0x231a('0x62'),_0x231a('0x63'),_0x231a('0x64'),_0x231a('0x65')]})[_0x231a('0x1b')](handleEntityNotFound(_0x527d16,null))[_0x231a('0x1b')](function(_0x445289){if(_0x445289){_0x411924=_0x445289['remoteUri'];var _0x5909ce=_0x411924['slice'](-0x1);if(_0x5909ce==='/'){_0x411924=_0x411924[_0x231a('0x66')](0x0,_0x411924['lastIndexOf'](_0x5909ce));}_0xc0d6f1=new jsforce[(_0x231a('0x67'))]({'oauth2':{'loginUrl':_0x411924,'clientId':_0x445289['clientId'],'clientSecret':_0x445289[_0x231a('0x62')]}});return _0xc0d6f1['login'](_0x445289['username'],_0x445289['password'][_0x231a('0x68')](_0x445289['securityToken']));}})[_0x231a('0x1b')](function(_0x256dd6){if(_0x256dd6){if(!_['isNil'](_0x3bde22['query']['ticketType'])){_0x1ace0d=_0x3bde22[_0x231a('0x3a')][_0x231a('0x69')];}return _0xc0d6f1[_0x231a('0x6a')](_0x1ace0d)[_0x231a('0x6b')]();}})[_0x231a('0x1b')](function(_0x47ec97){var _0x5d1828=[_0x231a('0x6c'),_0x231a('0x6d'),'CallObject',_0x231a('0x6e'),_0x231a('0x6f'),_0x231a('0x70'),_0x231a('0x71'),'Type'];if(!_[_0x231a('0x72')](_0x3bde22[_0x231a('0x3a')]['ticketType'])&&_0x3bde22[_0x231a('0x3a')][_0x231a('0x69')]===_0x231a('0x73')){_0x5d1828=[_0x231a('0x74'),'Origin',_0x231a('0x75'),_0x231a('0x71'),_0x231a('0x70'),_0x231a('0x76'),_0x231a('0x77'),_0x231a('0x78')];}if(_0x47ec97){_[_0x231a('0x79')](_0x47ec97[_0x231a('0x3e')],function(_0x3350b0){return _0x3350b0[_0x231a('0x7a')]===![]&&!_0x5d1828[_0x231a('0x7b')](_0x3350b0[_0x231a('0x33')]);});return{'count':_0x47ec97[_0x231a('0x3e')][_0x231a('0x3f')],'rows':_[_0x231a('0x47')](_0x47ec97['fields'],function(_0x49fbc1){return{'id':_0x49fbc1['name'],'name':_0x49fbc1['label'],'custom':_0x49fbc1[_0x231a('0x7a')],'options':_0x49fbc1[_0x231a('0x7c')][_0x231a('0x3f')]>0x0?_[_0x231a('0x47')](_0x49fbc1[_0x231a('0x7c')],function(_0x5a097b){return{'name':_0x5a097b[_0x231a('0x7d')],'value':_0x5a097b[_0x231a('0x7e')]};}):_0x49fbc1[_0x231a('0x48')]=='boolean'?[{'name':_0x231a('0x7f'),'value':_0x231a('0x80')},{'name':_0x231a('0x81'),'value':_0x231a('0x82')}]:[]};})};}})[_0x231a('0x1b')](respondWithResult(_0x527d16,null))['catch'](function(_0x4212f2){var _0x214d9f=_0x3bde22[_0x231a('0x3a')][_0x231a('0x83')]?0x1f4:_0x4212f2[_0x231a('0x84')]||0x1f4;logger[_0x231a('0x21')](_0x231a('0x85'),_0x231a('0x5f'),_0x214d9f,JSON[_0x231a('0x20')](_0x4212f2));delete _0x4212f2['name'];if(_0x214d9f===0x191){_0x214d9f=0x190;}_0x527d16[_0x231a('0x28')](_0x214d9f)[_0x231a('0x34')](_0x3bde22['query'][_0x231a('0x83')]?{'message':'Wrong\x20credentials','statusCode':_0x4212f2[_0x231a('0x84')]}:_0x4212f2);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b92ada9..f0b2b3f 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 _0xcf53=['int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x121306,_0x33cd73){var _0xebc95=function(_0x5e34c6){while(--_0x5e34c6){_0x121306['push'](_0x121306['shift']());}};_0xebc95(++_0x33cd73);}(_0xcf53,0x169));var _0x3cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf53[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3cf5('0x0'));var util=require(_0x3cf5('0x1'));var logger=require('../../config/logger')(_0x3cf5('0x2'));var moment=require(_0x3cf5('0x3'));var BPromise=require(_0x3cf5('0x4'));var rp=require(_0x3cf5('0x5'));var attributes=require(_0x3cf5('0x6'));var integrations=require(_0x3cf5('0x7'));module[_0x3cf5('0x8')]=function(_0x1a1ea0,_0x5cc13f){return _0x1a1ea0[_0x3cf5('0x9')](_0x3cf5('0xa'),attributes,{'tableName':_0x3cf5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc40b=['int_salesforce_accounts','lodash','../../config/logger','bluebird','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xc40b,0x79));var _0xbc40=function(_0x2cdb91,_0x540bbe){_0x2cdb91=_0x2cdb91-0x0;var _0x5d852a=_0xc40b[_0x2cdb91];return _0x5d852a;};'use strict';var _=require(_0xbc40('0x0'));var util=require('util');var logger=require(_0xbc40('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbc40('0x2'));var rp=require('request-promise');var attributes=require(_0xbc40('0x3'));var integrations=require(_0xbc40('0x4'));module['exports']=function(_0x1ebf3a,_0x3c20a8){return _0x1ebf3a[_0xbc40('0x5')](_0xbc40('0x6'),attributes,{'tableName':_0xbc40('0x7'),'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 62fa355..9e658c8 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 _0x6aa5=['request\x20sent','stringify','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetSalesforceAccount','debug','SalesforceAccount','find','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2792d6,_0x2f264e){var _0x4b5158=function(_0x5530ca){while(--_0x5530ca){_0x2792d6['push'](_0x2792d6['shift']());}};_0x4b5158(++_0x2f264e);}(_0x6aa5,0x110));var _0x56aa=function(_0x53ea77,_0x3edf7e){_0x53ea77=_0x53ea77-0x0;var _0xfc6ae3=_0x6aa5[_0x53ea77];return _0xfc6ae3;};'use strict';var _=require(_0x56aa('0x0'));var util=require(_0x56aa('0x1'));var moment=require(_0x56aa('0x2'));var BPromise=require('bluebird');var rs=require(_0x56aa('0x3'));var fs=require('fs');var Redis=require(_0x56aa('0x4'));var db=require(_0x56aa('0x5'))['db'];var utils=require(_0x56aa('0x6'));var logger=require(_0x56aa('0x7'))('rpc');var config=require(_0x56aa('0x8'));var jayson=require(_0x56aa('0x9'));var client=jayson[_0x56aa('0xa')][_0x56aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5afd87,_0x19e187,_0x117ad5){return new BPromise(function(_0xd13b6c,_0x36aa91){return client['request'](_0x5afd87,_0x117ad5)[_0x56aa('0xc')](function(_0x5e8d98){logger[_0x56aa('0xd')](_0x56aa('0xe'),_0x19e187,'request\x20sent');logger['debug'](_0x56aa('0xf'),_0x19e187,_0x56aa('0x10'),JSON[_0x56aa('0x11')](_0x5e8d98));if(_0x5e8d98[_0x56aa('0x12')]){if(_0x5e8d98[_0x56aa('0x12')]['code']===0x1f4){logger[_0x56aa('0x12')](_0x56aa('0xe'),_0x19e187,_0x5e8d98[_0x56aa('0x12')][_0x56aa('0x13')]);return _0x36aa91(_0x5e8d98['error'][_0x56aa('0x13')]);}logger[_0x56aa('0x12')](_0x56aa('0xe'),_0x19e187,_0x5e8d98['error'][_0x56aa('0x13')]);return _0xd13b6c(_0x5e8d98[_0x56aa('0x12')][_0x56aa('0x13')]);}else{logger['info'](_0x56aa('0xe'),_0x19e187,_0x56aa('0x10'));_0xd13b6c(_0x5e8d98[_0x56aa('0x14')]['message']);}})[_0x56aa('0x15')](function(_0x563a0f){logger[_0x56aa('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x19e187,_0x563a0f);_0x36aa91(_0x563a0f);});});}exports['GetSalesforceAccount']=function(_0x2c2a78){var _0x416492=this;return new Promise(function(_0x50c8d4,_0x4c8a7d){return db['SalesforceAccount'][_0x56aa('0x16')]({'raw':_0x2c2a78[_0x56aa('0x17')]?_0x2c2a78[_0x56aa('0x17')][_0x56aa('0x18')]===undefined?!![]:![]:!![],'where':_0x2c2a78[_0x56aa('0x17')]?_0x2c2a78[_0x56aa('0x17')][_0x56aa('0x19')]||null:null,'attributes':_0x2c2a78[_0x56aa('0x17')]?_0x2c2a78['options'][_0x56aa('0x1a')]||null:null,'limit':_0x2c2a78[_0x56aa('0x17')]?_0x2c2a78['options'][_0x56aa('0x1b')]||null:null,'include':_0x2c2a78[_0x56aa('0x17')]?_0x2c2a78[_0x56aa('0x17')][_0x56aa('0x1c')]?_['map'](_0x2c2a78[_0x56aa('0x17')]['include'],function(_0x4359c1){return{'model':db[_0x4359c1[_0x56aa('0x1d')]],'as':_0x4359c1['as'],'attributes':_0x4359c1[_0x56aa('0x1a')],'include':_0x4359c1[_0x56aa('0x1c')]?_['map'](_0x4359c1[_0x56aa('0x1c')],function(_0x1ee7a2){return{'model':db[_0x1ee7a2[_0x56aa('0x1d')]],'as':_0x1ee7a2['as'],'attributes':_0x1ee7a2[_0x56aa('0x1a')],'include':_0x1ee7a2[_0x56aa('0x1c')]?_[_0x56aa('0x1e')](_0x1ee7a2[_0x56aa('0x1c')],function(_0xbed832){return{'model':db[_0xbed832['model']],'as':_0xbed832['as'],'attributes':_0xbed832[_0x56aa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56aa('0xc')](function(_0x464a5d){logger[_0x56aa('0xd')](_0x56aa('0x1f'),_0x2c2a78);logger[_0x56aa('0x20')](_0x56aa('0x1f'),_0x2c2a78,JSON[_0x56aa('0x11')](_0x464a5d));_0x50c8d4(_0x464a5d);})[_0x56aa('0x15')](function(_0x162ee8){logger['error']('GetSalesforceAccount',_0x162ee8['message'],_0x2c2a78);_0x4c8a7d(_0x416492[_0x56aa('0x12')](0x1f4,_0x162ee8[_0x56aa('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x1a64c3){var _0x5e8018=this;return new Promise(function(_0x4e3081,_0x10e363){return db[_0x56aa('0x21')][_0x56aa('0x22')]({'raw':_0x1a64c3[_0x56aa('0x17')]?_0x1a64c3['options'][_0x56aa('0x18')]===undefined?!![]:![]:!![],'where':_0x1a64c3[_0x56aa('0x17')]?_0x1a64c3[_0x56aa('0x17')][_0x56aa('0x19')]||null:null,'attributes':_0x1a64c3['options']?_0x1a64c3[_0x56aa('0x17')][_0x56aa('0x1a')]||null:null,'include':_0x1a64c3['options']?_0x1a64c3[_0x56aa('0x17')][_0x56aa('0x1c')]?_[_0x56aa('0x1e')](_0x1a64c3[_0x56aa('0x17')]['include'],function(_0x160dc5){return{'model':db[_0x160dc5[_0x56aa('0x1d')]],'as':_0x160dc5['as'],'attributes':_0x160dc5[_0x56aa('0x1a')],'include':_0x160dc5[_0x56aa('0x1c')]?_[_0x56aa('0x1e')](_0x160dc5[_0x56aa('0x1c')],function(_0x3dafb7){return{'model':db[_0x3dafb7[_0x56aa('0x1d')]],'as':_0x3dafb7['as'],'attributes':_0x3dafb7[_0x56aa('0x1a')],'include':_0x3dafb7['include']?_[_0x56aa('0x1e')](_0x3dafb7[_0x56aa('0x1c')],function(_0xb3c00d){return{'model':db[_0xb3c00d[_0x56aa('0x1d')]],'as':_0xb3c00d['as'],'attributes':_0xb3c00d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dc7b4){logger[_0x56aa('0xd')](_0x56aa('0x23'),_0x1a64c3);logger[_0x56aa('0x20')](_0x56aa('0x23'),_0x1a64c3,JSON[_0x56aa('0x11')](_0x2dc7b4));_0x4e3081(_0x2dc7b4);})[_0x56aa('0x15')](function(_0x2014e8){logger[_0x56aa('0x12')](_0x56aa('0x23'),_0x2014e8[_0x56aa('0x13')],_0x1a64c3);_0x10e363(_0x5e8018[_0x56aa('0x12')](0x1f4,_0x2014e8[_0x56aa('0x13')]));});});}; \ No newline at end of file +var _0xf1b5=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSalesforceAccount','options','raw','limit','include','map','attributes','model','ShowSalesforceAccount','SalesforceAccount','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4cdfa8,_0x56820e){var _0x2d9418=function(_0x5a35ec){while(--_0x5a35ec){_0x4cdfa8['push'](_0x4cdfa8['shift']());}};_0x2d9418(++_0x56820e);}(_0xf1b5,0x1ee));var _0x5f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f1b('0x0'));var util=require(_0x5f1b('0x1'));var moment=require(_0x5f1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f1b('0x3'));var fs=require('fs');var Redis=require(_0x5f1b('0x4'));var db=require(_0x5f1b('0x5'))['db'];var utils=require(_0x5f1b('0x6'));var logger=require(_0x5f1b('0x7'))(_0x5f1b('0x8'));var config=require(_0x5f1b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5f1b('0xa')][_0x5f1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xed01b9,_0x17435e,_0x4ad1de){return new BPromise(function(_0x3c6fa3,_0x732c1f){return client['request'](_0xed01b9,_0x4ad1de)[_0x5f1b('0xc')](function(_0x37f949){logger[_0x5f1b('0xd')](_0x5f1b('0xe'),_0x17435e,_0x5f1b('0xf'));logger[_0x5f1b('0x10')](_0x5f1b('0x11'),_0x17435e,_0x5f1b('0xf'),JSON['stringify'](_0x37f949));if(_0x37f949[_0x5f1b('0x12')]){if(_0x37f949[_0x5f1b('0x12')][_0x5f1b('0x13')]===0x1f4){logger['error'](_0x5f1b('0xe'),_0x17435e,_0x37f949[_0x5f1b('0x12')]['message']);return _0x732c1f(_0x37f949[_0x5f1b('0x12')][_0x5f1b('0x14')]);}logger[_0x5f1b('0x12')](_0x5f1b('0xe'),_0x17435e,_0x37f949[_0x5f1b('0x12')][_0x5f1b('0x14')]);return _0x3c6fa3(_0x37f949[_0x5f1b('0x12')][_0x5f1b('0x14')]);}else{logger[_0x5f1b('0xd')](_0x5f1b('0xe'),_0x17435e,_0x5f1b('0xf'));_0x3c6fa3(_0x37f949['result'][_0x5f1b('0x14')]);}})[_0x5f1b('0x15')](function(_0x27e7f4){logger['error'](_0x5f1b('0xe'),_0x17435e,_0x27e7f4);_0x732c1f(_0x27e7f4);});});}exports[_0x5f1b('0x16')]=function(_0x4a48cf){var _0x1bd296=this;return new Promise(function(_0x28e8a2,_0x24b363){return db['SalesforceAccount']['findAll']({'raw':_0x4a48cf[_0x5f1b('0x17')]?_0x4a48cf[_0x5f1b('0x17')][_0x5f1b('0x18')]===undefined?!![]:![]:!![],'where':_0x4a48cf['options']?_0x4a48cf[_0x5f1b('0x17')]['where']||null:null,'attributes':_0x4a48cf[_0x5f1b('0x17')]?_0x4a48cf[_0x5f1b('0x17')]['attributes']||null:null,'limit':_0x4a48cf[_0x5f1b('0x17')]?_0x4a48cf[_0x5f1b('0x17')][_0x5f1b('0x19')]||null:null,'include':_0x4a48cf[_0x5f1b('0x17')]?_0x4a48cf[_0x5f1b('0x17')][_0x5f1b('0x1a')]?_[_0x5f1b('0x1b')](_0x4a48cf[_0x5f1b('0x17')]['include'],function(_0x2a9758){return{'model':db[_0x2a9758['model']],'as':_0x2a9758['as'],'attributes':_0x2a9758[_0x5f1b('0x1c')],'include':_0x2a9758['include']?_[_0x5f1b('0x1b')](_0x2a9758[_0x5f1b('0x1a')],function(_0x7ff708){return{'model':db[_0x7ff708[_0x5f1b('0x1d')]],'as':_0x7ff708['as'],'attributes':_0x7ff708[_0x5f1b('0x1c')],'include':_0x7ff708['include']?_['map'](_0x7ff708[_0x5f1b('0x1a')],function(_0x1c8d83){return{'model':db[_0x1c8d83[_0x5f1b('0x1d')]],'as':_0x1c8d83['as'],'attributes':_0x1c8d83[_0x5f1b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5f1b('0xc')](function(_0x2fd121){logger['info'](_0x5f1b('0x16'),_0x4a48cf);logger[_0x5f1b('0x10')](_0x5f1b('0x16'),_0x4a48cf,JSON['stringify'](_0x2fd121));_0x28e8a2(_0x2fd121);})[_0x5f1b('0x15')](function(_0x287d0b){logger['error'](_0x5f1b('0x16'),_0x287d0b['message'],_0x4a48cf);_0x24b363(_0x1bd296['error'](0x1f4,_0x287d0b[_0x5f1b('0x14')]));});});};exports[_0x5f1b('0x1e')]=function(_0x4f3933){var _0x337b6f=this;return new Promise(function(_0x3ab5c6,_0x2d569c){return db[_0x5f1b('0x1f')][_0x5f1b('0x20')]({'raw':_0x4f3933[_0x5f1b('0x17')]?_0x4f3933['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f3933[_0x5f1b('0x17')]?_0x4f3933['options'][_0x5f1b('0x21')]||null:null,'attributes':_0x4f3933['options']?_0x4f3933[_0x5f1b('0x17')]['attributes']||null:null,'include':_0x4f3933[_0x5f1b('0x17')]?_0x4f3933[_0x5f1b('0x17')][_0x5f1b('0x1a')]?_['map'](_0x4f3933[_0x5f1b('0x17')]['include'],function(_0x5c8cb1){return{'model':db[_0x5c8cb1['model']],'as':_0x5c8cb1['as'],'attributes':_0x5c8cb1[_0x5f1b('0x1c')],'include':_0x5c8cb1[_0x5f1b('0x1a')]?_['map'](_0x5c8cb1[_0x5f1b('0x1a')],function(_0x52afea){return{'model':db[_0x52afea[_0x5f1b('0x1d')]],'as':_0x52afea['as'],'attributes':_0x52afea[_0x5f1b('0x1c')],'include':_0x52afea['include']?_[_0x5f1b('0x1b')](_0x52afea[_0x5f1b('0x1a')],function(_0x186ec7){return{'model':db[_0x186ec7[_0x5f1b('0x1d')]],'as':_0x186ec7['as'],'attributes':_0x186ec7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1eaaa1){logger[_0x5f1b('0xd')](_0x5f1b('0x1e'),_0x4f3933);logger[_0x5f1b('0x10')](_0x5f1b('0x1e'),_0x4f3933,JSON['stringify'](_0x1eaaa1));_0x3ab5c6(_0x1eaaa1);})[_0x5f1b('0x15')](function(_0x366db4){logger['error'](_0x5f1b('0x1e'),_0x366db4[_0x5f1b('0x14')],_0x4f3933);_0x2d569c(_0x337b6f['error'](0x1f4,_0x366db4[_0x5f1b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index b3aa4e4..ba0b785 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 _0x7f11=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7f11,0xfd));var _0x17f1=function(_0x5b94eb,_0x33c41c){_0x5b94eb=_0x5b94eb-0x0;var _0x29ecb9=_0x7f11[_0x5b94eb];return _0x29ecb9;};'use strict';var multer=require(_0x17f1('0x0'));var util=require(_0x17f1('0x1'));var path=require('path');var timeout=require(_0x17f1('0x2'));var express=require(_0x17f1('0x3'));var router=express[_0x17f1('0x4')]();var auth=require(_0x17f1('0x5'));var interaction=require(_0x17f1('0x6'));var config=require(_0x17f1('0x7'));var controller=require('./intSalesforceConfiguration.controller');router[_0x17f1('0x8')]('/',auth[_0x17f1('0x9')](),controller[_0x17f1('0xa')]);router[_0x17f1('0x8')](_0x17f1('0xb'),auth[_0x17f1('0x9')](),controller[_0x17f1('0xc')]);router[_0x17f1('0x8')](_0x17f1('0xd'),auth[_0x17f1('0x9')](),controller[_0x17f1('0xe')]);router[_0x17f1('0x8')](_0x17f1('0xf'),auth['isAuthenticated'](),controller[_0x17f1('0x10')]);router[_0x17f1('0x8')](_0x17f1('0x11'),auth[_0x17f1('0x9')](),controller[_0x17f1('0x12')]);router[_0x17f1('0x13')]('/',auth[_0x17f1('0x9')](),controller['create']);router['put'](_0x17f1('0xb'),auth['isAuthenticated'](),controller[_0x17f1('0x14')]);router[_0x17f1('0x15')](_0x17f1('0xb'),auth['isAuthenticated'](),controller[_0x17f1('0x16')]);module[_0x17f1('0x17')]=router; \ No newline at end of file +var _0xc7c8=['/:id/descriptions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xc7c8,0x157));var _0x8c7c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc7c8[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x8c7c('0x0'));var util=require(_0x8c7c('0x1'));var path=require('path');var timeout=require(_0x8c7c('0x2'));var express=require('express');var router=express[_0x8c7c('0x3')]();var auth=require(_0x8c7c('0x4'));var interaction=require(_0x8c7c('0x5'));var config=require('../../config/environment');var controller=require(_0x8c7c('0x6'));router['get']('/',auth[_0x8c7c('0x7')](),controller[_0x8c7c('0x8')]);router['get'](_0x8c7c('0x9'),auth[_0x8c7c('0x7')](),controller[_0x8c7c('0xa')]);router['get'](_0x8c7c('0xb'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x8c7c('0xc'),auth[_0x8c7c('0x7')](),controller[_0x8c7c('0xd')]);router['get'](_0x8c7c('0xe'),auth[_0x8c7c('0x7')](),controller['getDescriptions']);router[_0x8c7c('0xf')]('/',auth[_0x8c7c('0x7')](),controller['create']);router[_0x8c7c('0x10')](_0x8c7c('0x9'),auth[_0x8c7c('0x7')](),controller[_0x8c7c('0x11')]);router[_0x8c7c('0x12')](_0x8c7c('0x9'),auth[_0x8c7c('0x7')](),controller[_0x8c7c('0x13')]);module[_0x8c7c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 80f88c9..cd4679e 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 _0x9d32=['nothing','contact','sequelize','exports','STRING','ENUM','Task','contact_lead','lead'];(function(_0x125397,_0x3337db){var _0x1e503b=function(_0x5daca0){while(--_0x5daca0){_0x125397['push'](_0x125397['shift']());}};_0x1e503b(++_0x3337db);}(_0x9d32,0x110));var _0x29d3=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x9d32[_0x28b7ab];return _0x56791b;};'use strict';var Sequelize=require(_0x29d3('0x0'));module[_0x29d3('0x1')]={'name':{'type':Sequelize[_0x29d3('0x2')]},'description':{'type':Sequelize[_0x29d3('0x2')]},'ticketType':{'type':Sequelize[_0x29d3('0x3')](_0x29d3('0x4'),'Case'),'defaultValue':_0x29d3('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x29d3('0x5'),'contact',_0x29d3('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x29d3('0x7'),_0x29d3('0x8'),_0x29d3('0x6')),'defaultValue':'lead'}}; \ No newline at end of file +var _0x349b=['lead','nothing','sequelize','exports','STRING','ENUM','Task','contact_lead','contact'];(function(_0x562ffc,_0x48a371){var _0x6db85b=function(_0x8a95be){while(--_0x8a95be){_0x562ffc['push'](_0x562ffc['shift']());}};_0x6db85b(++_0x48a371);}(_0x349b,0x1d6));var _0xb349=function(_0x489613,_0x56a633){_0x489613=_0x489613-0x0;var _0x142635=_0x349b[_0x489613];return _0x142635;};'use strict';var Sequelize=require(_0xb349('0x0'));module[_0xb349('0x1')]={'name':{'type':Sequelize[_0xb349('0x2')]},'description':{'type':Sequelize[_0xb349('0x2')]},'ticketType':{'type':Sequelize[_0xb349('0x3')]('Task','Case'),'defaultValue':_0xb349('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xb349('0x5'),_0xb349('0x6'),_0xb349('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xb349('0x3')](_0xb349('0x8'),_0xb349('0x6'),'lead'),'defaultValue':_0xb349('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4dbbce6..c0b6e62 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 _0xc4aa=['util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','order','sort','filters','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','find','create','body','findOne','SalesforceField','pick','hasOwnProperty','getFields','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2ce543,_0x9993b){var _0x1b67a3=function(_0x143d43){while(--_0x143d43){_0x2ce543['push'](_0x2ce543['shift']());}};_0x1b67a3(++_0x9993b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xac4a('0x10'));var Redis=require(_0xac4a('0x11'));var qs=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xac4a('0x15'));var client=jayson[_0xac4a('0x16')][_0xac4a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5e16aa,_0x21a79,_0x68424a,_0x247b78){return new BPromise(function(_0x6e00d4,_0x1b4313){var _0x3b71c0=_0x247b78||client;return _0x3b71c0[_0xac4a('0x18')](_0x5e16aa,_0x68424a)[_0xac4a('0x19')](function(_0x190418){logger[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x21a79,_0xac4a('0x1c'));logger['debug'](_0xac4a('0x1d'),_0x21a79,_0xac4a('0x1c'),JSON[_0xac4a('0x1e')](_0x190418));if(_0x190418[_0xac4a('0x1f')]){if(_0x190418[_0xac4a('0x1f')][_0xac4a('0x20')]===0x1f4){logger[_0xac4a('0x1f')](_0xac4a('0x1b'),_0x21a79,_0x190418['error']['message']);return _0x1b4313(_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);}logger[_0xac4a('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x21a79,_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);return _0x6e00d4(_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);}else{logger[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x21a79,_0xac4a('0x1c'));_0x6e00d4(_0x190418[_0xac4a('0x22')]['message']);}})[_0xac4a('0x23')](function(_0x3204ad){logger['error'](_0xac4a('0x1b'),_0x21a79,_0x3204ad);_0x1b4313(_0x3204ad);});});}function respondWithStatusCode(_0x4169c0,_0x3eacd3){_0x3eacd3=_0x3eacd3||0xcc;return function(_0x947d8e){if(_0x947d8e){return _0x4169c0['sendStatus'](_0x3eacd3);}return _0x4169c0[_0xac4a('0x24')](_0x3eacd3)[_0xac4a('0x25')]();};}function respondWithResult(_0x15435c,_0x412494){_0x412494=_0x412494||0xc8;return function(_0x594f36){if(_0x594f36){return _0x15435c[_0xac4a('0x24')](_0x412494)[_0xac4a('0x26')](_0x594f36);}};}function respondWithFilteredResult(_0x36054a,_0x3e2c69){return function(_0x3bc318){if(_0x3bc318){var _0x1d0539=_0x3bc318[_0xac4a('0x27')],_0x215a31=_0x3e2c69[_0xac4a('0x28')],_0x14832b=_0x3e2c69['offset']+_0x3e2c69[_0xac4a('0x29')],_0x472c57;if(_0x14832b>=_0x1d0539){_0x14832b=_0x1d0539;_0x472c57=0xc8;}else{_0x472c57=0xce;}_0x36054a[_0xac4a('0x24')](_0x472c57);return _0x36054a[_0xac4a('0x2a')](_0xac4a('0x2b'),_0x215a31+'-'+_0x14832b+'/'+_0x1d0539)[_0xac4a('0x26')](_0x3bc318);}return null;};}function patchUpdates(_0x4a5a9e){return function(_0x47f49c){try{jsonpatch[_0xac4a('0x2c')](_0x47f49c,_0x4a5a9e,!![]);}catch(_0x7a948b){return BPromise[_0xac4a('0x2d')](_0x7a948b);}return _0x47f49c['save']();};}function saveUpdates(_0x4bda1f,_0x355755){return function(_0x2896bc){if(_0x2896bc){return _0x2896bc[_0xac4a('0x2e')](_0x4bda1f)[_0xac4a('0x19')](function(_0x17118e){return _0x17118e;});}return null;};}function removeEntity(_0x53d3a5,_0x6dcc7f){return function(_0x482afc){if(_0x482afc){return _0x482afc[_0xac4a('0x2f')]()['then'](function(){_0x53d3a5[_0xac4a('0x24')](0xcc)[_0xac4a('0x25')]();});}};}function handleEntityNotFound(_0x31501b,_0x228aa7){return function(_0x34577f){if(!_0x34577f){_0x31501b[_0xac4a('0x30')](0x194);}return _0x34577f;};}function handleError(_0xbd4591,_0x1f13f3){_0x1f13f3=_0x1f13f3||0x1f4;return function(_0x29fb3b){logger[_0xac4a('0x1f')](_0x29fb3b[_0xac4a('0x31')]);if(_0x29fb3b[_0xac4a('0x32')]){delete _0x29fb3b[_0xac4a('0x32')];}_0xbd4591[_0xac4a('0x24')](_0x1f13f3)['send'](_0x29fb3b);};}exports[_0xac4a('0x33')]=function(_0x1c41fb,_0x5a4e2b){var _0x2a5419={},_0x1af1c1={},_0x565164={'count':0x0,'rows':[]};var _0x58804b=db[_0xac4a('0x34')][_0xac4a('0x35')];_0x1af1c1[_0xac4a('0x36')]=_[_0xac4a('0x37')](_0x58804b);_0x1af1c1['query']=_[_0xac4a('0x37')](_0x1c41fb[_0xac4a('0x38')]);_0x1af1c1['filters']=_[_0xac4a('0x39')](_0x1af1c1[_0xac4a('0x36')],_0x1af1c1[_0xac4a('0x38')]);_0x2a5419['attributes']=_[_0xac4a('0x39')](_0x1af1c1[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x1c41fb['query'][_0xac4a('0x3a')]));_0x2a5419[_0xac4a('0x3b')]=_0x2a5419['attributes']['length']?_0x2a5419[_0xac4a('0x3b')]:_0x1af1c1['model'];if(!_0x1c41fb['query']['hasOwnProperty']('nolimit')){_0x2a5419[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x29')]);_0x2a5419[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x28')]);}_0x2a5419[_0xac4a('0x3c')]=qs[_0xac4a('0x3d')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x2a5419['where']=qs['filters'](_['pick'](_0x1c41fb[_0xac4a('0x38')],_0x1af1c1[_0xac4a('0x3e')]));if(_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x2a5419[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x2a5419[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x58804b,function(_0x3e9973){if(_0x3e9973[_0xac4a('0x43')]['key']!==_0xac4a('0x44')){var _0x31bfaf={};_0x31bfaf[_0x3e9973[_0xac4a('0x45')]]={'$like':'%'+_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x31bfaf;}})});}_0x2a5419=_['merge']({},_0x2a5419,_0x1c41fb[_0xac4a('0x46')]);var _0x1b77bb={'where':_0x2a5419['where']};return db[_0xac4a('0x34')]['count'](_0x1b77bb)[_0xac4a('0x19')](function(_0x65494e){_0x565164[_0xac4a('0x27')]=_0x65494e;if(_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x47')]){_0x2a5419[_0xac4a('0x48')]=[{'all':!![]}];}return db[_0xac4a('0x34')][_0xac4a('0x49')](_0x2a5419);})[_0xac4a('0x19')](function(_0xcb002b){_0x565164[_0xac4a('0x4a')]=_0xcb002b;return _0x565164;})[_0xac4a('0x19')](respondWithFilteredResult(_0x5a4e2b,_0x2a5419))['catch'](handleError(_0x5a4e2b,null));};exports[_0xac4a('0x4b')]=function(_0x41d11d,_0xeca4e9){var _0x58759a={'raw':![],'where':{'id':_0x41d11d[_0xac4a('0x4c')]['id']}},_0x1764bf={};_0x1764bf['model']=_[_0xac4a('0x37')](db['SalesforceConfiguration'][_0xac4a('0x35')]);_0x1764bf[_0xac4a('0x38')]=_[_0xac4a('0x37')](_0x41d11d['query']);_0x1764bf['filters']=_[_0xac4a('0x39')](_0x1764bf['model'],_0x1764bf[_0xac4a('0x38')]);_0x58759a['attributes']=_[_0xac4a('0x39')](_0x1764bf['model'],qs[_0xac4a('0x3a')](_0x41d11d[_0xac4a('0x38')][_0xac4a('0x3a')]));_0x58759a[_0xac4a('0x3b')]=_0x58759a['attributes'][_0xac4a('0x4d')]?_0x58759a[_0xac4a('0x3b')]:_0x1764bf[_0xac4a('0x36')];if(_0x41d11d[_0xac4a('0x38')][_0xac4a('0x47')]){_0x58759a[_0xac4a('0x48')]=[{'all':!![]}];}_0x58759a=_[_0xac4a('0x41')]({},_0x58759a,_0x41d11d['options']);return db[_0xac4a('0x34')][_0xac4a('0x4e')](_0x58759a)['then'](handleEntityNotFound(_0xeca4e9,null))[_0xac4a('0x19')](respondWithResult(_0xeca4e9,null))[_0xac4a('0x23')](handleError(_0xeca4e9,null));};exports[_0xac4a('0x4f')]=function(_0x3ac36e,_0x4bb2fb){return db[_0xac4a('0x34')][_0xac4a('0x4f')](_0x3ac36e[_0xac4a('0x50')],{})[_0xac4a('0x19')](respondWithResult(_0x4bb2fb,0xc9))[_0xac4a('0x23')](handleError(_0x4bb2fb,null));};exports['update']=function(_0x179373,_0x564b10){if(_0x179373[_0xac4a('0x50')]['id']){delete _0x179373[_0xac4a('0x50')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x179373[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x564b10,null))['then'](saveUpdates(_0x179373[_0xac4a('0x50')],null))[_0xac4a('0x19')](respondWithResult(_0x564b10,null))[_0xac4a('0x23')](handleError(_0x564b10,null));};exports[_0xac4a('0x2f')]=function(_0x48900f,_0x3057d6){return db[_0xac4a('0x34')][_0xac4a('0x4e')]({'where':{'id':_0x48900f[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x3057d6,null))[_0xac4a('0x19')](removeEntity(_0x3057d6,null))[_0xac4a('0x23')](handleError(_0x3057d6,null));};exports['getFields']=function(_0x39123d,_0xef51d0,_0xe870ba){var _0x156dd2={};var _0x1b7231={};var _0x2ac1e9;var _0x213df2;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x39123d[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0xef51d0,null))[_0xac4a('0x19')](function(_0x400ac4){if(_0x400ac4){_0x2ac1e9=_0x400ac4;_0x1b7231[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')]['rawAttributes']);_0x1b7231[_0xac4a('0x38')]=_['keys'](_0x39123d[_0xac4a('0x38')]);_0x1b7231['filters']=_[_0xac4a('0x39')](_0x1b7231['model'],_0x1b7231[_0xac4a('0x38')]);_0x156dd2['attributes']=_['intersection'](_0x1b7231[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x3a')]));_0x156dd2[_0xac4a('0x3b')]=_0x156dd2[_0xac4a('0x3b')]['length']?_0x156dd2[_0xac4a('0x3b')]:_0x1b7231['model'];_0x156dd2[_0xac4a('0x3c')]=qs['sort'](_0x39123d[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x156dd2[_0xac4a('0x40')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x53')](_0x39123d[_0xac4a('0x38')],_0x1b7231[_0xac4a('0x3e')]));if(_0x39123d[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x156dd2[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x156dd2[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x156dd2[_0xac4a('0x3b')],function(_0x17ae93){var _0xf07212={};_0xf07212[_0x17ae93]={'$like':'%'+_0x39123d[_0xac4a('0x38')]['filter']+'%'};return _0xf07212;})});}_0x156dd2=_[_0xac4a('0x41')]({},_0x156dd2,_0x39123d[_0xac4a('0x46')]);return _0x2ac1e9['getFields'](_0x156dd2);}})[_0xac4a('0x19')](function(_0x34bd1c){if(_0x34bd1c){_0x213df2=_0x34bd1c[_0xac4a('0x4d')];if(!_0x39123d[_0xac4a('0x38')][_0xac4a('0x54')]('nolimit')){_0x156dd2['limit']=qs[_0xac4a('0x29')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x29')]);_0x156dd2[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x28')]);}return _0x2ac1e9[_0xac4a('0x55')](_0x156dd2);}})[_0xac4a('0x19')](function(_0x295f21){if(_0x295f21){return _0x295f21?{'count':_0x213df2,'rows':_0x295f21}:null;}})[_0xac4a('0x19')](respondWithResult(_0xef51d0,null))['catch'](handleError(_0xef51d0,null));};exports['getSubjects']=function(_0x1ee825,_0x1febff,_0x2954fc){var _0x423f70={};var _0x663a97={};var _0x283107;var _0x1d24bb;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x1ee825[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x1febff,null))[_0xac4a('0x19')](function(_0x5f0173){if(_0x5f0173){_0x283107=_0x5f0173;_0x663a97[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')][_0xac4a('0x35')]);_0x663a97['query']=_[_0xac4a('0x37')](_0x1ee825['query']);_0x663a97[_0xac4a('0x3e')]=_[_0xac4a('0x39')](_0x663a97['model'],_0x663a97['query']);_0x423f70[_0xac4a('0x3b')]=_[_0xac4a('0x39')](_0x663a97[_0xac4a('0x36')],qs['fields'](_0x1ee825[_0xac4a('0x38')]['fields']));_0x423f70[_0xac4a('0x3b')]=_0x423f70['attributes']['length']?_0x423f70[_0xac4a('0x3b')]:_0x663a97['model'];_0x423f70[_0xac4a('0x3c')]=qs['sort'](_0x1ee825[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x423f70['where']=qs[_0xac4a('0x3e')](_['pick'](_0x1ee825[_0xac4a('0x38')],_0x663a97[_0xac4a('0x3e')]));if(_0x1ee825['query'][_0xac4a('0x3f')]){_0x423f70['where']=_['merge'](_0x423f70[_0xac4a('0x40')],{'$or':_['map'](_0x423f70[_0xac4a('0x3b')],function(_0x558c43){var _0x4ccd67={};_0x4ccd67[_0x558c43]={'$like':'%'+_0x1ee825[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x4ccd67;})});}_0x423f70=_[_0xac4a('0x41')]({},_0x423f70,_0x1ee825['options']);return _0x283107['getSubjects'](_0x423f70);}})[_0xac4a('0x19')](function(_0x9c0fa1){if(_0x9c0fa1){_0x1d24bb=_0x9c0fa1['length'];if(!_0x1ee825['query'][_0xac4a('0x54')](_0xac4a('0x56'))){_0x423f70[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x1ee825[_0xac4a('0x38')][_0xac4a('0x29')]);_0x423f70[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x1ee825[_0xac4a('0x38')]['offset']);}return _0x283107[_0xac4a('0x57')](_0x423f70);}})[_0xac4a('0x19')](function(_0x3ba61e){if(_0x3ba61e){return _0x3ba61e?{'count':_0x1d24bb,'rows':_0x3ba61e}:null;}})['then'](respondWithResult(_0x1febff,null))[_0xac4a('0x23')](handleError(_0x1febff,null));};exports[_0xac4a('0x58')]=function(_0x7c9bbe,_0x391c35,_0x3d2b5c){var _0x5daf44={};var _0x290a73={};var _0x19ce24;var _0xc9d040;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x7c9bbe[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x391c35,null))['then'](function(_0x2e3bb7){if(_0x2e3bb7){_0x19ce24=_0x2e3bb7;_0x290a73[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')][_0xac4a('0x35')]);_0x290a73[_0xac4a('0x38')]=_['keys'](_0x7c9bbe[_0xac4a('0x38')]);_0x290a73[_0xac4a('0x3e')]=_[_0xac4a('0x39')](_0x290a73[_0xac4a('0x36')],_0x290a73['query']);_0x5daf44[_0xac4a('0x3b')]=_['intersection'](_0x290a73[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x7c9bbe['query']['fields']));_0x5daf44[_0xac4a('0x3b')]=_0x5daf44[_0xac4a('0x3b')][_0xac4a('0x4d')]?_0x5daf44['attributes']:_0x290a73[_0xac4a('0x36')];_0x5daf44['order']=qs[_0xac4a('0x3d')](_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x5daf44[_0xac4a('0x40')]=qs[_0xac4a('0x3e')](_['pick'](_0x7c9bbe['query'],_0x290a73[_0xac4a('0x3e')]));if(_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x5daf44[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x5daf44[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x5daf44[_0xac4a('0x3b')],function(_0x49ac09){var _0x52b3e6={};_0x52b3e6[_0x49ac09]={'$like':'%'+_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x52b3e6;})});}_0x5daf44=_[_0xac4a('0x41')]({},_0x5daf44,_0x7c9bbe[_0xac4a('0x46')]);return _0x19ce24[_0xac4a('0x58')](_0x5daf44);}})[_0xac4a('0x19')](function(_0xdaa2ef){if(_0xdaa2ef){_0xc9d040=_0xdaa2ef[_0xac4a('0x4d')];if(!_0x7c9bbe['query']['hasOwnProperty'](_0xac4a('0x56'))){_0x5daf44[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x29')]);_0x5daf44[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x7c9bbe['query'][_0xac4a('0x28')]);}return _0x19ce24[_0xac4a('0x58')](_0x5daf44);}})[_0xac4a('0x19')](function(_0x5f323d){if(_0x5f323d){return _0x5f323d?{'count':_0xc9d040,'rows':_0x5f323d}:null;}})[_0xac4a('0x19')](respondWithResult(_0x391c35,null))[_0xac4a('0x23')](handleError(_0x391c35,null));}; \ No newline at end of file +var _0x1261=['querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SalesforceConfiguration,\x20%s,\x20%s','status','json','offset','limit','set','Content-Range','apply','reject','destroy','end','name','send','index','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','key','VIRTUAL','filter','merge','SalesforceConfiguration','count','includeAll','include','rows','params','options','create','body','find','getFields','findOne','SalesforceField','getSubjects','map','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x11cee0,_0x141ca8){var _0x42f475=function(_0x562352){while(--_0x562352){_0x11cee0['push'](_0x11cee0['shift']());}};_0x42f475(++_0x141ca8);}(_0x1261,0x144));var _0x1126=function(_0x2dbed7,_0x2962d5){_0x2dbed7=_0x2dbed7-0x0;var _0x326efc=_0x1261[_0x2dbed7];return _0x326efc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var authService=require(_0x1126('0x11'));var hardwareService=require(_0x1126('0x12'));var Redis=require(_0x1126('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1126('0x16'));var client=jayson[_0x1126('0x17')][_0x1126('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x273896,_0xca0355,_0x3f10e9,_0xd8ca42){return new BPromise(function(_0x2048ad,_0x43850b){var _0x53a8f0=_0xd8ca42||client;return _0x53a8f0['request'](_0x273896,_0x3f10e9)[_0x1126('0x19')](function(_0x154e20){logger[_0x1126('0x1a')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x1126('0x1b'));logger['debug'](_0x1126('0x1c'),_0xca0355,_0x1126('0x1b'),JSON[_0x1126('0x1d')](_0x154e20));if(_0x154e20['error']){if(_0x154e20[_0x1126('0x1e')][_0x1126('0x1f')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x154e20[_0x1126('0x1e')][_0x1126('0x20')]);return _0x43850b(_0x154e20['error']['message']);}logger[_0x1126('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,_0x154e20[_0x1126('0x1e')][_0x1126('0x20')]);return _0x2048ad(_0x154e20[_0x1126('0x1e')]['message']);}else{logger[_0x1126('0x1a')]('SalesforceConfiguration,\x20%s,\x20%s',_0xca0355,'request\x20sent');_0x2048ad(_0x154e20[_0x1126('0x21')][_0x1126('0x20')]);}})[_0x1126('0x22')](function(_0x36d254){logger['error'](_0x1126('0x23'),_0xca0355,_0x36d254);_0x43850b(_0x36d254);});});}function respondWithStatusCode(_0x477e6a,_0x48a08d){_0x48a08d=_0x48a08d||0xcc;return function(_0x2175fa){if(_0x2175fa){return _0x477e6a['sendStatus'](_0x48a08d);}return _0x477e6a['status'](_0x48a08d)['end']();};}function respondWithResult(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0xc8;return function(_0x329914){if(_0x329914){return _0x2199d9[_0x1126('0x24')](_0x15bcc3)[_0x1126('0x25')](_0x329914);}};}function respondWithFilteredResult(_0x1b07a7,_0xea0971){return function(_0x38119d){if(_0x38119d){var _0x589725=_0x38119d['count'],_0x35eec3=_0xea0971['offset'],_0x375e59=_0xea0971[_0x1126('0x26')]+_0xea0971[_0x1126('0x27')],_0xa293f4;if(_0x375e59>=_0x589725){_0x375e59=_0x589725;_0xa293f4=0xc8;}else{_0xa293f4=0xce;}_0x1b07a7['status'](_0xa293f4);return _0x1b07a7[_0x1126('0x28')](_0x1126('0x29'),_0x35eec3+'-'+_0x375e59+'/'+_0x589725)['json'](_0x38119d);}return null;};}function patchUpdates(_0x3fa694){return function(_0x4bf807){try{jsonpatch[_0x1126('0x2a')](_0x4bf807,_0x3fa694,!![]);}catch(_0x4bd50b){return BPromise[_0x1126('0x2b')](_0x4bd50b);}return _0x4bf807['save']();};}function saveUpdates(_0x378f4d,_0x5f2611){return function(_0x5252e0){if(_0x5252e0){return _0x5252e0['update'](_0x378f4d)[_0x1126('0x19')](function(_0xa8906d){return _0xa8906d;});}return null;};}function removeEntity(_0x1cef48,_0x5b8bea){return function(_0x2a3055){if(_0x2a3055){return _0x2a3055[_0x1126('0x2c')]()['then'](function(){_0x1cef48[_0x1126('0x24')](0xcc)[_0x1126('0x2d')]();});}};}function handleEntityNotFound(_0x2d8127,_0x29fbfa){return function(_0x5836a2){if(!_0x5836a2){_0x2d8127['sendStatus'](0x194);}return _0x5836a2;};}function handleError(_0x2a7edc,_0x19e6e4){_0x19e6e4=_0x19e6e4||0x1f4;return function(_0x2d9bd2){logger[_0x1126('0x1e')](_0x2d9bd2['stack']);if(_0x2d9bd2[_0x1126('0x2e')]){delete _0x2d9bd2[_0x1126('0x2e')];}_0x2a7edc[_0x1126('0x24')](_0x19e6e4)[_0x1126('0x2f')](_0x2d9bd2);};}exports[_0x1126('0x30')]=function(_0x5df232,_0x2a0dfe){var _0x457efd={},_0x1e8402={},_0x42e773={'count':0x0,'rows':[]};var _0x5c019d=db['SalesforceConfiguration'][_0x1126('0x31')];_0x1e8402[_0x1126('0x32')]=_['keys'](_0x5c019d);_0x1e8402[_0x1126('0x33')]=_[_0x1126('0x34')](_0x5df232[_0x1126('0x33')]);_0x1e8402['filters']=_['intersection'](_0x1e8402[_0x1126('0x32')],_0x1e8402[_0x1126('0x33')]);_0x457efd[_0x1126('0x35')]=_[_0x1126('0x36')](_0x1e8402['model'],qs[_0x1126('0x37')](_0x5df232['query'][_0x1126('0x37')]));_0x457efd[_0x1126('0x35')]=_0x457efd[_0x1126('0x35')][_0x1126('0x38')]?_0x457efd[_0x1126('0x35')]:_0x1e8402['model'];if(!_0x5df232[_0x1126('0x33')][_0x1126('0x39')](_0x1126('0x3a'))){_0x457efd[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x5df232[_0x1126('0x33')][_0x1126('0x27')]);_0x457efd['offset']=qs[_0x1126('0x26')](_0x5df232[_0x1126('0x33')][_0x1126('0x26')]);}_0x457efd[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x5df232['query']['sort']);_0x457efd[_0x1126('0x3d')]=qs[_0x1126('0x3e')](_[_0x1126('0x3f')](_0x5df232[_0x1126('0x33')],_0x1e8402[_0x1126('0x3e')]));if(_0x5df232[_0x1126('0x33')]['filter']){_0x457efd['where']=_['merge'](_0x457efd[_0x1126('0x3d')],{'$or':_['map'](_0x5c019d,function(_0xf84005){if(_0xf84005[_0x1126('0x40')][_0x1126('0x41')]!==_0x1126('0x42')){var _0x585fad={};_0x585fad[_0xf84005['field']]={'$like':'%'+_0x5df232[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x585fad;}})});}_0x457efd=_[_0x1126('0x44')]({},_0x457efd,_0x5df232['options']);var _0x2f8551={'where':_0x457efd['where']};return db[_0x1126('0x45')]['count'](_0x2f8551)[_0x1126('0x19')](function(_0xe178b4){_0x42e773[_0x1126('0x46')]=_0xe178b4;if(_0x5df232['query'][_0x1126('0x47')]){_0x457efd[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x45')]['findAll'](_0x457efd);})['then'](function(_0x4dd7f5){_0x42e773[_0x1126('0x49')]=_0x4dd7f5;return _0x42e773;})['then'](respondWithFilteredResult(_0x2a0dfe,_0x457efd))[_0x1126('0x22')](handleError(_0x2a0dfe,null));};exports['show']=function(_0x2f45b9,_0x323499){var _0x146066={'raw':![],'where':{'id':_0x2f45b9[_0x1126('0x4a')]['id']}},_0x120de1={};_0x120de1['model']=_[_0x1126('0x34')](db[_0x1126('0x45')]['rawAttributes']);_0x120de1[_0x1126('0x33')]=_[_0x1126('0x34')](_0x2f45b9['query']);_0x120de1[_0x1126('0x3e')]=_[_0x1126('0x36')](_0x120de1['model'],_0x120de1[_0x1126('0x33')]);_0x146066[_0x1126('0x35')]=_[_0x1126('0x36')](_0x120de1['model'],qs[_0x1126('0x37')](_0x2f45b9[_0x1126('0x33')][_0x1126('0x37')]));_0x146066[_0x1126('0x35')]=_0x146066[_0x1126('0x35')][_0x1126('0x38')]?_0x146066[_0x1126('0x35')]:_0x120de1[_0x1126('0x32')];if(_0x2f45b9['query'][_0x1126('0x47')]){_0x146066['include']=[{'all':!![]}];}_0x146066=_[_0x1126('0x44')]({},_0x146066,_0x2f45b9[_0x1126('0x4b')]);return db['SalesforceConfiguration']['find'](_0x146066)[_0x1126('0x19')](handleEntityNotFound(_0x323499,null))[_0x1126('0x19')](respondWithResult(_0x323499,null))[_0x1126('0x22')](handleError(_0x323499,null));};exports['create']=function(_0x3cb44c,_0x3506d7){return db[_0x1126('0x45')][_0x1126('0x4c')](_0x3cb44c['body'],{})[_0x1126('0x19')](respondWithResult(_0x3506d7,0xc9))[_0x1126('0x22')](handleError(_0x3506d7,null));};exports['update']=function(_0x4bcc08,_0x4abb4d){if(_0x4bcc08['body']['id']){delete _0x4bcc08[_0x1126('0x4d')]['id'];}return db[_0x1126('0x45')]['find']({'where':{'id':_0x4bcc08[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x4abb4d,null))[_0x1126('0x19')](saveUpdates(_0x4bcc08[_0x1126('0x4d')],null))[_0x1126('0x19')](respondWithResult(_0x4abb4d,null))['catch'](handleError(_0x4abb4d,null));};exports[_0x1126('0x2c')]=function(_0x267592,_0x5d6414){return db[_0x1126('0x45')][_0x1126('0x4e')]({'where':{'id':_0x267592[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x5d6414,null))[_0x1126('0x19')](removeEntity(_0x5d6414,null))['catch'](handleError(_0x5d6414,null));};exports[_0x1126('0x4f')]=function(_0x49aeaa,_0x868b2c,_0x952d14){var _0x33c971={};var _0x590bc2={};var _0x427add;var _0x2340f8;return db['SalesforceConfiguration'][_0x1126('0x50')]({'where':{'id':_0x49aeaa[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x868b2c,null))['then'](function(_0x2fe6dc){if(_0x2fe6dc){_0x427add=_0x2fe6dc;_0x590bc2[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x590bc2[_0x1126('0x33')]=_[_0x1126('0x34')](_0x49aeaa[_0x1126('0x33')]);_0x590bc2['filters']=_[_0x1126('0x36')](_0x590bc2[_0x1126('0x32')],_0x590bc2[_0x1126('0x33')]);_0x33c971[_0x1126('0x35')]=_[_0x1126('0x36')](_0x590bc2['model'],qs[_0x1126('0x37')](_0x49aeaa[_0x1126('0x33')]['fields']));_0x33c971[_0x1126('0x35')]=_0x33c971['attributes'][_0x1126('0x38')]?_0x33c971[_0x1126('0x35')]:_0x590bc2['model'];_0x33c971[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x49aeaa[_0x1126('0x33')]['sort']);_0x33c971[_0x1126('0x3d')]=qs['filters'](_['pick'](_0x49aeaa[_0x1126('0x33')],_0x590bc2[_0x1126('0x3e')]));if(_0x49aeaa[_0x1126('0x33')][_0x1126('0x43')]){_0x33c971[_0x1126('0x3d')]=_[_0x1126('0x44')](_0x33c971[_0x1126('0x3d')],{'$or':_['map'](_0x33c971[_0x1126('0x35')],function(_0x43ec00){var _0x116867={};_0x116867[_0x43ec00]={'$like':'%'+_0x49aeaa[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x116867;})});}_0x33c971=_[_0x1126('0x44')]({},_0x33c971,_0x49aeaa['options']);return _0x427add['getFields'](_0x33c971);}})[_0x1126('0x19')](function(_0x3921c2){if(_0x3921c2){_0x2340f8=_0x3921c2['length'];if(!_0x49aeaa['query']['hasOwnProperty']('nolimit')){_0x33c971[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x49aeaa[_0x1126('0x33')]['limit']);_0x33c971[_0x1126('0x26')]=qs[_0x1126('0x26')](_0x49aeaa[_0x1126('0x33')][_0x1126('0x26')]);}return _0x427add[_0x1126('0x4f')](_0x33c971);}})[_0x1126('0x19')](function(_0x131056){if(_0x131056){return _0x131056?{'count':_0x2340f8,'rows':_0x131056}:null;}})['then'](respondWithResult(_0x868b2c,null))[_0x1126('0x22')](handleError(_0x868b2c,null));};exports[_0x1126('0x52')]=function(_0x43bd70,_0xd8171c,_0x288b9b){var _0x56c003={};var _0x5d758d={};var _0x15cf3d;var _0x2643d7;return db['SalesforceConfiguration'][_0x1126('0x50')]({'where':{'id':_0x43bd70[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0xd8171c,null))[_0x1126('0x19')](function(_0x2828d4){if(_0x2828d4){_0x15cf3d=_0x2828d4;_0x5d758d[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x5d758d[_0x1126('0x33')]=_[_0x1126('0x34')](_0x43bd70[_0x1126('0x33')]);_0x5d758d[_0x1126('0x3e')]=_['intersection'](_0x5d758d[_0x1126('0x32')],_0x5d758d[_0x1126('0x33')]);_0x56c003[_0x1126('0x35')]=_['intersection'](_0x5d758d['model'],qs[_0x1126('0x37')](_0x43bd70[_0x1126('0x33')][_0x1126('0x37')]));_0x56c003[_0x1126('0x35')]=_0x56c003['attributes']['length']?_0x56c003['attributes']:_0x5d758d[_0x1126('0x32')];_0x56c003[_0x1126('0x3b')]=qs[_0x1126('0x3c')](_0x43bd70[_0x1126('0x33')]['sort']);_0x56c003[_0x1126('0x3d')]=qs['filters'](_[_0x1126('0x3f')](_0x43bd70[_0x1126('0x33')],_0x5d758d[_0x1126('0x3e')]));if(_0x43bd70[_0x1126('0x33')][_0x1126('0x43')]){_0x56c003[_0x1126('0x3d')]=_[_0x1126('0x44')](_0x56c003['where'],{'$or':_[_0x1126('0x53')](_0x56c003['attributes'],function(_0x3c1dda){var _0x906531={};_0x906531[_0x3c1dda]={'$like':'%'+_0x43bd70['query'][_0x1126('0x43')]+'%'};return _0x906531;})});}_0x56c003=_[_0x1126('0x44')]({},_0x56c003,_0x43bd70['options']);return _0x15cf3d[_0x1126('0x52')](_0x56c003);}})[_0x1126('0x19')](function(_0x4b1d04){if(_0x4b1d04){_0x2643d7=_0x4b1d04['length'];if(!_0x43bd70[_0x1126('0x33')][_0x1126('0x39')](_0x1126('0x3a'))){_0x56c003['limit']=qs['limit'](_0x43bd70['query'][_0x1126('0x27')]);_0x56c003['offset']=qs['offset'](_0x43bd70[_0x1126('0x33')]['offset']);}return _0x15cf3d[_0x1126('0x52')](_0x56c003);}})[_0x1126('0x19')](function(_0x51ccdc){if(_0x51ccdc){return _0x51ccdc?{'count':_0x2643d7,'rows':_0x51ccdc}:null;}})[_0x1126('0x19')](respondWithResult(_0xd8171c,null))[_0x1126('0x22')](handleError(_0xd8171c,null));};exports[_0x1126('0x54')]=function(_0xc3bb7f,_0x1644fc,_0x5e9872){var _0xec8540={};var _0x426faa={};var _0x5679ec;var _0xd182b1;return db[_0x1126('0x45')][_0x1126('0x50')]({'where':{'id':_0xc3bb7f[_0x1126('0x4a')]['id']}})[_0x1126('0x19')](handleEntityNotFound(_0x1644fc,null))[_0x1126('0x19')](function(_0x59512b){if(_0x59512b){_0x5679ec=_0x59512b;_0x426faa[_0x1126('0x32')]=_[_0x1126('0x34')](db[_0x1126('0x51')][_0x1126('0x31')]);_0x426faa[_0x1126('0x33')]=_[_0x1126('0x34')](_0xc3bb7f[_0x1126('0x33')]);_0x426faa[_0x1126('0x3e')]=_[_0x1126('0x36')](_0x426faa['model'],_0x426faa[_0x1126('0x33')]);_0xec8540[_0x1126('0x35')]=_[_0x1126('0x36')](_0x426faa[_0x1126('0x32')],qs[_0x1126('0x37')](_0xc3bb7f['query'][_0x1126('0x37')]));_0xec8540['attributes']=_0xec8540['attributes'][_0x1126('0x38')]?_0xec8540[_0x1126('0x35')]:_0x426faa['model'];_0xec8540['order']=qs[_0x1126('0x3c')](_0xc3bb7f[_0x1126('0x33')][_0x1126('0x3c')]);_0xec8540[_0x1126('0x3d')]=qs[_0x1126('0x3e')](_[_0x1126('0x3f')](_0xc3bb7f[_0x1126('0x33')],_0x426faa[_0x1126('0x3e')]));if(_0xc3bb7f[_0x1126('0x33')]['filter']){_0xec8540[_0x1126('0x3d')]=_[_0x1126('0x44')](_0xec8540[_0x1126('0x3d')],{'$or':_[_0x1126('0x53')](_0xec8540[_0x1126('0x35')],function(_0x336b4b){var _0x482199={};_0x482199[_0x336b4b]={'$like':'%'+_0xc3bb7f[_0x1126('0x33')][_0x1126('0x43')]+'%'};return _0x482199;})});}_0xec8540=_[_0x1126('0x44')]({},_0xec8540,_0xc3bb7f[_0x1126('0x4b')]);return _0x5679ec[_0x1126('0x54')](_0xec8540);}})[_0x1126('0x19')](function(_0x2418ca){if(_0x2418ca){_0xd182b1=_0x2418ca[_0x1126('0x38')];if(!_0xc3bb7f[_0x1126('0x33')][_0x1126('0x39')]('nolimit')){_0xec8540['limit']=qs[_0x1126('0x27')](_0xc3bb7f['query'][_0x1126('0x27')]);_0xec8540['offset']=qs[_0x1126('0x26')](_0xc3bb7f['query'][_0x1126('0x26')]);}return _0x5679ec['getDescriptions'](_0xec8540);}})['then'](function(_0x48c461){if(_0x48c461){return _0x48c461?{'count':_0xd182b1,'rows':_0x48c461}:null;}})[_0x1126('0x19')](respondWithResult(_0x1644fc,null))[_0x1126('0x22')](handleError(_0x1644fc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6abc069..bd58eb8 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 _0x9ed4=['request-promise','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34cfc5,_0x7007c6){var _0x259538=function(_0x1daa7c){while(--_0x1daa7c){_0x34cfc5['push'](_0x34cfc5['shift']());}};_0x259538(++_0x7007c6);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x22ffb2,_0x2690df){_0x22ffb2=_0x22ffb2-0x0;var _0x5c8764=_0x9ed4[_0x22ffb2];return _0x5c8764;};'use strict';var _=require(_0x49ed('0x0'));var util=require(_0x49ed('0x1'));var logger=require(_0x49ed('0x2'))(_0x49ed('0x3'));var moment=require(_0x49ed('0x4'));var BPromise=require(_0x49ed('0x5'));var rp=require(_0x49ed('0x6'));var attributes=require(_0x49ed('0x7'));module[_0x49ed('0x8')]=function(_0x330c09,_0x41f69b){return _0x330c09['define'](_0x49ed('0x9'),attributes,{'tableName':_0x49ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae4b=['request-promise','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xae4b,0x17e));var _0xbae4=function(_0x8861eb,_0x10bf53){_0x8861eb=_0x8861eb-0x0;var _0xdcfbd2=_0xae4b[_0x8861eb];return _0xdcfbd2;};'use strict';var _=require(_0xbae4('0x0'));var util=require('util');var logger=require(_0xbae4('0x1'))(_0xbae4('0x2'));var moment=require(_0xbae4('0x3'));var BPromise=require(_0xbae4('0x4'));var rp=require(_0xbae4('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0xde411,_0xef0dc7){return _0xde411[_0xbae4('0x6')](_0xbae4('0x7'),attributes,{'tableName':_0xbae4('0x8'),'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 e6ba818..b2c3028 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x506772,_0x2b7b49){var _0x58ff3b=function(_0x579c2c){while(--_0x579c2c){_0x506772['push'](_0x506772['shift']());}};_0x58ff3b(++_0x2b7b49);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'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')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2c3325,_0x4ee03a){var _0x867923=function(_0x32ea11){while(--_0x32ea11){_0x2c3325['push'](_0x2c3325['shift']());}};_0x867923(++_0x4ee03a);}(_0x1261,0x144));var _0x1126=function(_0x1e0f42,_0x2567e5){_0x1e0f42=_0x1e0f42-0x0;var _0x4e9c54=_0x1261[_0x1e0f42];return _0x4e9c54;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7a42009..a7fddec 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 _0x866c=['Router','../../config/environment','get','index','/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout'];(function(_0x2c4f72,_0x47f310){var _0x51b919=function(_0x46ac60){while(--_0x46ac60){_0x2c4f72['push'](_0x2c4f72['shift']());}};_0x51b919(++_0x47f310);}(_0x866c,0x1e9));var _0xc866=function(_0x45dd3b,_0x30ea1e){_0x45dd3b=_0x45dd3b-0x0;var _0x2eb479=_0x866c[_0x45dd3b];return _0x2eb479;};'use strict';var multer=require(_0xc866('0x0'));var util=require('util');var path=require(_0xc866('0x1'));var timeout=require(_0xc866('0x2'));var express=require('express');var router=express[_0xc866('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc866('0x4'));var controller=require('./intSalesforceField.controller');router[_0xc866('0x5')]('/',auth['isAuthenticated'](),controller[_0xc866('0x6')]);router['get'](_0xc866('0x7'),auth[_0xc866('0x8')](),controller['show']);router['post']('/',auth[_0xc866('0x8')](),controller['create']);router['put'](_0xc866('0x7'),auth[_0xc866('0x8')](),controller[_0xc866('0x9')]);router[_0xc866('0xa')](_0xc866('0x7'),auth[_0xc866('0x8')](),controller['destroy']);module[_0xc866('0xb')]=router; \ No newline at end of file +var _0xa396=['/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4b8b8b,_0x2240c4){var _0x9efd9a=function(_0x590141){while(--_0x590141){_0x4b8b8b['push'](_0x4b8b8b['shift']());}};_0x9efd9a(++_0x2240c4);}(_0xa396,0x196));var _0x6a39=function(_0x30e819,_0x4c9cb7){_0x30e819=_0x30e819-0x0;var _0x576ec4=_0xa396[_0x30e819];return _0x576ec4;};'use strict';var multer=require(_0x6a39('0x0'));var util=require(_0x6a39('0x1'));var path=require(_0x6a39('0x2'));var timeout=require(_0x6a39('0x3'));var express=require(_0x6a39('0x4'));var router=express[_0x6a39('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6a39('0x6'));var config=require(_0x6a39('0x7'));var controller=require('./intSalesforceField.controller');router[_0x6a39('0x8')]('/',auth[_0x6a39('0x9')](),controller['index']);router[_0x6a39('0x8')](_0x6a39('0xa'),auth['isAuthenticated'](),controller[_0x6a39('0xb')]);router[_0x6a39('0xc')]('/',auth[_0x6a39('0x9')](),controller[_0x6a39('0xd')]);router[_0x6a39('0xe')]('/:id',auth[_0x6a39('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6a39('0xf')]);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 a3f01d2..6e31bc3 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 _0xd94e=['string','sequelize','exports','customVariable','keyValue','STRING','ENUM'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xd94e,0x6a));var _0xed94=function(_0x30717e,_0xd96659){_0x30717e=_0x30717e-0x0;var _0x38e97f=_0xd94e[_0x30717e];return _0x38e97f;};'use strict';var Sequelize=require(_0xed94('0x0'));module[_0xed94('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xed94('0x2'),_0xed94('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xed94('0x4')]},'key':{'type':Sequelize[_0xed94('0x4')]},'keyType':{'type':Sequelize[_0xed94('0x5')](_0xed94('0x6'),'variable',_0xed94('0x2'))},'keyContent':{'type':Sequelize[_0xed94('0x4')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xed94('0x4')]}}; \ No newline at end of file +var _0x2f1c=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x1dc5a7,_0x448a9f){var _0x4b3f3e=function(_0x1f0cd5){while(--_0x1f0cd5){_0x1dc5a7['push'](_0x1dc5a7['shift']());}};_0x4b3f3e(++_0x448a9f);}(_0x2f1c,0x134));var _0xc2f1=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x2f1c[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0xc2f1('0x0'));module[_0xc2f1('0x1')]={'type':{'type':Sequelize[_0xc2f1('0x2')](_0xc2f1('0x3'),_0xc2f1('0x4'),_0xc2f1('0x5'),_0xc2f1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc2f1('0x7')]},'key':{'type':Sequelize[_0xc2f1('0x7')]},'keyType':{'type':Sequelize[_0xc2f1('0x2')]('string',_0xc2f1('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xc2f1('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xc2f1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3fcd403..334760f 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 _0x53fa=['rows','catch','show','params','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','SalesforceField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x53fa,0x1ac));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa53f('0x0'));var emlformat=require(_0xa53f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa53f('0x2'));var jsonpatch=require(_0xa53f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa53f('0x4'));var path=require(_0xa53f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa53f('0x6'));var fs=require('fs');var _=require(_0xa53f('0x7'));var squel=require('squel');var crypto=require(_0xa53f('0x8'));var jsforce=require(_0xa53f('0x9'));var deskjs=require(_0xa53f('0xa'));var toCsv=require(_0xa53f('0xb'));var querystring=require(_0xa53f('0xc'));var Papa=require('papaparse');var authService=require(_0xa53f('0xd'));var hardwareService=require(_0xa53f('0xe'));var Redis=require('ioredis');var qs=require(_0xa53f('0xf'));var logger=require('../../config/logger')(_0xa53f('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4860ed,_0x3d6dd0){_0x3d6dd0=_0x3d6dd0||0xcc;return function(_0xf8a2ca){if(_0xf8a2ca){return _0x4860ed[_0xa53f('0x11')](_0x3d6dd0);}return _0x4860ed['status'](_0x3d6dd0)[_0xa53f('0x12')]();};}function respondWithResult(_0x52e670,_0x12287c){_0x12287c=_0x12287c||0xc8;return function(_0x3a00c0){if(_0x3a00c0){return _0x52e670['status'](_0x12287c)[_0xa53f('0x13')](_0x3a00c0);}};}function respondWithFilteredResult(_0x5af96c,_0x51c478){return function(_0x34596f){if(_0x34596f){var _0x48939d=_0x34596f[_0xa53f('0x14')],_0x213759=_0x51c478[_0xa53f('0x15')],_0x141778=_0x51c478[_0xa53f('0x15')]+_0x51c478[_0xa53f('0x16')],_0x3d016b;if(_0x141778>=_0x48939d){_0x141778=_0x48939d;_0x3d016b=0xc8;}else{_0x3d016b=0xce;}_0x5af96c[_0xa53f('0x17')](_0x3d016b);return _0x5af96c[_0xa53f('0x18')](_0xa53f('0x19'),_0x213759+'-'+_0x141778+'/'+_0x48939d)[_0xa53f('0x13')](_0x34596f);}return null;};}function patchUpdates(_0x915d85){return function(_0x4d1a92){try{jsonpatch[_0xa53f('0x1a')](_0x4d1a92,_0x915d85,!![]);}catch(_0x19df90){return BPromise[_0xa53f('0x1b')](_0x19df90);}return _0x4d1a92[_0xa53f('0x1c')]();};}function saveUpdates(_0x5d0215,_0x2274ba){return function(_0x1d6aa7){if(_0x1d6aa7){return _0x1d6aa7[_0xa53f('0x1d')](_0x5d0215)['then'](function(_0x475c02){return _0x475c02;});}return null;};}function removeEntity(_0x31f528,_0x34f2b9){return function(_0x3923a7){if(_0x3923a7){return _0x3923a7[_0xa53f('0x1e')]()[_0xa53f('0x1f')](function(){_0x31f528[_0xa53f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19cac5,_0x196f37){return function(_0x2714f2){if(!_0x2714f2){_0x19cac5['sendStatus'](0x194);}return _0x2714f2;};}function handleError(_0x3c1546,_0xfd9825){_0xfd9825=_0xfd9825||0x1f4;return function(_0x2b5dcc){logger[_0xa53f('0x20')](_0x2b5dcc['stack']);if(_0x2b5dcc[_0xa53f('0x21')]){delete _0x2b5dcc['name'];}_0x3c1546[_0xa53f('0x17')](_0xfd9825)[_0xa53f('0x22')](_0x2b5dcc);};}exports[_0xa53f('0x23')]=function(_0x4e7121,_0x35392b){var _0x445223={},_0x2750f4={},_0x518018={'count':0x0,'rows':[]};var _0x9e43c1=db[_0xa53f('0x24')][_0xa53f('0x25')];_0x2750f4[_0xa53f('0x26')]=_[_0xa53f('0x27')](_0x9e43c1);_0x2750f4[_0xa53f('0x28')]=_[_0xa53f('0x27')](_0x4e7121[_0xa53f('0x28')]);_0x2750f4[_0xa53f('0x29')]=_[_0xa53f('0x2a')](_0x2750f4['model'],_0x2750f4[_0xa53f('0x28')]);_0x445223[_0xa53f('0x2b')]=_[_0xa53f('0x2a')](_0x2750f4[_0xa53f('0x26')],qs[_0xa53f('0x2c')](_0x4e7121['query'][_0xa53f('0x2c')]));_0x445223[_0xa53f('0x2b')]=_0x445223[_0xa53f('0x2b')][_0xa53f('0x2d')]?_0x445223[_0xa53f('0x2b')]:_0x2750f4[_0xa53f('0x26')];if(!_0x4e7121[_0xa53f('0x28')][_0xa53f('0x2e')](_0xa53f('0x2f'))){_0x445223[_0xa53f('0x16')]=qs['limit'](_0x4e7121[_0xa53f('0x28')]['limit']);_0x445223[_0xa53f('0x15')]=qs[_0xa53f('0x15')](_0x4e7121[_0xa53f('0x28')]['offset']);}_0x445223[_0xa53f('0x30')]=qs[_0xa53f('0x31')](_0x4e7121[_0xa53f('0x28')]['sort']);_0x445223[_0xa53f('0x32')]=qs[_0xa53f('0x29')](_[_0xa53f('0x33')](_0x4e7121['query'],_0x2750f4[_0xa53f('0x29')]));if(_0x4e7121['query']['filter']){_0x445223[_0xa53f('0x32')]=_['merge'](_0x445223[_0xa53f('0x32')],{'$or':_[_0xa53f('0x34')](_0x9e43c1,function(_0x25b4b1){if(_0x25b4b1[_0xa53f('0x35')][_0xa53f('0x36')]!==_0xa53f('0x37')){var _0x2139e4={};_0x2139e4[_0x25b4b1[_0xa53f('0x38')]]={'$like':'%'+_0x4e7121['query'][_0xa53f('0x39')]+'%'};return _0x2139e4;}})});}_0x445223=_[_0xa53f('0x3a')]({},_0x445223,_0x4e7121[_0xa53f('0x3b')]);var _0x4cf20d={'where':_0x445223[_0xa53f('0x32')]};return db[_0xa53f('0x24')][_0xa53f('0x14')](_0x4cf20d)[_0xa53f('0x1f')](function(_0x3bde47){_0x518018[_0xa53f('0x14')]=_0x3bde47;if(_0x4e7121['query'][_0xa53f('0x3c')]){_0x445223['include']=[{'all':!![]}];}return db[_0xa53f('0x24')][_0xa53f('0x3d')](_0x445223);})[_0xa53f('0x1f')](function(_0x41e879){_0x518018[_0xa53f('0x3e')]=_0x41e879;return _0x518018;})[_0xa53f('0x1f')](respondWithFilteredResult(_0x35392b,_0x445223))[_0xa53f('0x3f')](handleError(_0x35392b,null));};exports[_0xa53f('0x40')]=function(_0x253ec1,_0x5c06e6){var _0x30f8a2={'raw':!![],'where':{'id':_0x253ec1[_0xa53f('0x41')]['id']}},_0x42bf22={};_0x42bf22['model']=_[_0xa53f('0x27')](db[_0xa53f('0x24')][_0xa53f('0x25')]);_0x42bf22[_0xa53f('0x28')]=_[_0xa53f('0x27')](_0x253ec1[_0xa53f('0x28')]);_0x42bf22[_0xa53f('0x29')]=_['intersection'](_0x42bf22['model'],_0x42bf22['query']);_0x30f8a2[_0xa53f('0x2b')]=_[_0xa53f('0x2a')](_0x42bf22[_0xa53f('0x26')],qs['fields'](_0x253ec1[_0xa53f('0x28')]['fields']));_0x30f8a2['attributes']=_0x30f8a2[_0xa53f('0x2b')][_0xa53f('0x2d')]?_0x30f8a2[_0xa53f('0x2b')]:_0x42bf22['model'];if(_0x253ec1[_0xa53f('0x28')]['includeAll']){_0x30f8a2[_0xa53f('0x42')]=[{'all':!![]}];}_0x30f8a2=_[_0xa53f('0x3a')]({},_0x30f8a2,_0x253ec1['options']);return db[_0xa53f('0x24')][_0xa53f('0x43')](_0x30f8a2)[_0xa53f('0x1f')](handleEntityNotFound(_0x5c06e6,null))[_0xa53f('0x1f')](respondWithResult(_0x5c06e6,null))['catch'](handleError(_0x5c06e6,null));};exports[_0xa53f('0x44')]=function(_0xc5d5f2,_0xfe6048){return db[_0xa53f('0x24')][_0xa53f('0x44')](_0xc5d5f2[_0xa53f('0x45')],{})[_0xa53f('0x1f')](respondWithResult(_0xfe6048,0xc9))[_0xa53f('0x3f')](handleError(_0xfe6048,null));};exports[_0xa53f('0x1d')]=function(_0x21f004,_0x4371df){if(_0x21f004[_0xa53f('0x45')]['id']){delete _0x21f004[_0xa53f('0x45')]['id'];}return db[_0xa53f('0x24')][_0xa53f('0x43')]({'where':{'id':_0x21f004[_0xa53f('0x41')]['id']}})[_0xa53f('0x1f')](handleEntityNotFound(_0x4371df,null))[_0xa53f('0x1f')](saveUpdates(_0x21f004['body'],null))['then'](respondWithResult(_0x4371df,null))[_0xa53f('0x3f')](handleError(_0x4371df,null));};exports[_0xa53f('0x1e')]=function(_0xe19db9,_0x2d8737){return db[_0xa53f('0x24')][_0xa53f('0x43')]({'where':{'id':_0xe19db9['params']['id']}})[_0xa53f('0x1f')](handleEntityNotFound(_0x2d8737,null))[_0xa53f('0x1f')](removeEntity(_0x2d8737,null))[_0xa53f('0x3f')](handleError(_0x2d8737,null));}; \ No newline at end of file +var _0x1952=['create','body','eml-format','rimraf','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','SalesforceField','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find'];(function(_0x5f25d2,_0x437b56){var _0x3bac32=function(_0xe48552){while(--_0xe48552){_0x5f25d2['push'](_0x5f25d2['shift']());}};_0x3bac32(++_0x437b56);}(_0x1952,0x92));var _0x2195=function(_0xf64bc0,_0x28997d){_0xf64bc0=_0xf64bc0-0x0;var _0x15914e=_0x1952[_0xf64bc0];return _0x15914e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2195('0x0'));var rimraf=require(_0x2195('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2195('0x2'));var rp=require('request-promise');var moment=require(_0x2195('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2195('0x4'));var path=require(_0x2195('0x5'));var sox=require('sox');var csv=require(_0x2195('0x6'));var ejs=require(_0x2195('0x7'));var fs=require('fs');var _=require(_0x2195('0x8'));var squel=require(_0x2195('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2195('0xa'));var toCsv=require(_0x2195('0x6'));var querystring=require(_0x2195('0xb'));var Papa=require(_0x2195('0xc'));var authService=require(_0x2195('0xd'));var hardwareService=require(_0x2195('0xe'));var Redis=require(_0x2195('0xf'));var qs=require(_0x2195('0x10'));var logger=require(_0x2195('0x11'))(_0x2195('0x12'));var utils=require(_0x2195('0x13'));var config=require(_0x2195('0x14'));var db=require(_0x2195('0x15'))['db'];function respondWithStatusCode(_0x60b246,_0x338044){_0x338044=_0x338044||0xcc;return function(_0x231da3){if(_0x231da3){return _0x60b246[_0x2195('0x16')](_0x338044);}return _0x60b246[_0x2195('0x17')](_0x338044)['end']();};}function respondWithResult(_0x41f6d9,_0x1edf07){_0x1edf07=_0x1edf07||0xc8;return function(_0x50a1eb){if(_0x50a1eb){return _0x41f6d9['status'](_0x1edf07)['json'](_0x50a1eb);}};}function respondWithFilteredResult(_0x1517bc,_0x1ee2c7){return function(_0x2b10b5){if(_0x2b10b5){var _0x19ca5d=_0x2b10b5[_0x2195('0x18')],_0x27c97c=_0x1ee2c7[_0x2195('0x19')],_0x4f0030=_0x1ee2c7[_0x2195('0x19')]+_0x1ee2c7[_0x2195('0x1a')],_0x5c3e0c;if(_0x4f0030>=_0x19ca5d){_0x4f0030=_0x19ca5d;_0x5c3e0c=0xc8;}else{_0x5c3e0c=0xce;}_0x1517bc[_0x2195('0x17')](_0x5c3e0c);return _0x1517bc[_0x2195('0x1b')](_0x2195('0x1c'),_0x27c97c+'-'+_0x4f0030+'/'+_0x19ca5d)[_0x2195('0x1d')](_0x2b10b5);}return null;};}function patchUpdates(_0x1960c8){return function(_0x4810c7){try{jsonpatch['apply'](_0x4810c7,_0x1960c8,!![]);}catch(_0x5d94af){return BPromise[_0x2195('0x1e')](_0x5d94af);}return _0x4810c7[_0x2195('0x1f')]();};}function saveUpdates(_0x2d4bec,_0x200be6){return function(_0x1e0c8d){if(_0x1e0c8d){return _0x1e0c8d[_0x2195('0x20')](_0x2d4bec)['then'](function(_0x2e499e){return _0x2e499e;});}return null;};}function removeEntity(_0x3a3335,_0x3731db){return function(_0x52e678){if(_0x52e678){return _0x52e678[_0x2195('0x21')]()[_0x2195('0x22')](function(){_0x3a3335[_0x2195('0x17')](0xcc)[_0x2195('0x23')]();});}};}function handleEntityNotFound(_0x31e1ff,_0x5babb3){return function(_0x21966b){if(!_0x21966b){_0x31e1ff['sendStatus'](0x194);}return _0x21966b;};}function handleError(_0x2e3fa3,_0x42aa8d){_0x42aa8d=_0x42aa8d||0x1f4;return function(_0x2f48a2){logger[_0x2195('0x24')](_0x2f48a2[_0x2195('0x25')]);if(_0x2f48a2[_0x2195('0x26')]){delete _0x2f48a2[_0x2195('0x26')];}_0x2e3fa3[_0x2195('0x17')](_0x42aa8d)[_0x2195('0x27')](_0x2f48a2);};}exports[_0x2195('0x28')]=function(_0x4a2e0c,_0x1853d1){var _0x4657d1={},_0x4b06f5={},_0x30313a={'count':0x0,'rows':[]};var _0xdb0d18=db[_0x2195('0x29')][_0x2195('0x2a')];_0x4b06f5['model']=_['keys'](_0xdb0d18);_0x4b06f5[_0x2195('0x2b')]=_['keys'](_0x4a2e0c[_0x2195('0x2b')]);_0x4b06f5[_0x2195('0x2c')]=_['intersection'](_0x4b06f5[_0x2195('0x2d')],_0x4b06f5['query']);_0x4657d1[_0x2195('0x2e')]=_[_0x2195('0x2f')](_0x4b06f5['model'],qs[_0x2195('0x30')](_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x30')]));_0x4657d1['attributes']=_0x4657d1[_0x2195('0x2e')][_0x2195('0x31')]?_0x4657d1[_0x2195('0x2e')]:_0x4b06f5[_0x2195('0x2d')];if(!_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x32')](_0x2195('0x33'))){_0x4657d1[_0x2195('0x1a')]=qs['limit'](_0x4a2e0c[_0x2195('0x2b')]['limit']);_0x4657d1['offset']=qs[_0x2195('0x19')](_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x19')]);}_0x4657d1[_0x2195('0x34')]=qs[_0x2195('0x35')](_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x35')]);_0x4657d1[_0x2195('0x36')]=qs[_0x2195('0x2c')](_[_0x2195('0x37')](_0x4a2e0c['query'],_0x4b06f5['filters']));if(_0x4a2e0c['query']['filter']){_0x4657d1['where']=_[_0x2195('0x38')](_0x4657d1[_0x2195('0x36')],{'$or':_[_0x2195('0x39')](_0xdb0d18,function(_0x4af3e5){if(_0x4af3e5[_0x2195('0x3a')]['key']!==_0x2195('0x3b')){var _0x42672d={};_0x42672d[_0x4af3e5['field']]={'$like':'%'+_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x3c')]+'%'};return _0x42672d;}})});}_0x4657d1=_['merge']({},_0x4657d1,_0x4a2e0c[_0x2195('0x3d')]);var _0x31ae5e={'where':_0x4657d1[_0x2195('0x36')]};return db[_0x2195('0x29')]['count'](_0x31ae5e)[_0x2195('0x22')](function(_0x274df7){_0x30313a[_0x2195('0x18')]=_0x274df7;if(_0x4a2e0c[_0x2195('0x2b')][_0x2195('0x3e')]){_0x4657d1[_0x2195('0x3f')]=[{'all':!![]}];}return db['SalesforceField'][_0x2195('0x40')](_0x4657d1);})['then'](function(_0x51db1b){_0x30313a['rows']=_0x51db1b;return _0x30313a;})['then'](respondWithFilteredResult(_0x1853d1,_0x4657d1))[_0x2195('0x41')](handleError(_0x1853d1,null));};exports[_0x2195('0x42')]=function(_0x5df9fd,_0x141839){var _0x516b5c={'raw':!![],'where':{'id':_0x5df9fd[_0x2195('0x43')]['id']}},_0x2bf7a8={};_0x2bf7a8[_0x2195('0x2d')]=_[_0x2195('0x44')](db[_0x2195('0x29')][_0x2195('0x2a')]);_0x2bf7a8[_0x2195('0x2b')]=_[_0x2195('0x44')](_0x5df9fd[_0x2195('0x2b')]);_0x2bf7a8['filters']=_[_0x2195('0x2f')](_0x2bf7a8[_0x2195('0x2d')],_0x2bf7a8[_0x2195('0x2b')]);_0x516b5c[_0x2195('0x2e')]=_[_0x2195('0x2f')](_0x2bf7a8[_0x2195('0x2d')],qs[_0x2195('0x30')](_0x5df9fd[_0x2195('0x2b')]['fields']));_0x516b5c[_0x2195('0x2e')]=_0x516b5c[_0x2195('0x2e')]['length']?_0x516b5c[_0x2195('0x2e')]:_0x2bf7a8[_0x2195('0x2d')];if(_0x5df9fd[_0x2195('0x2b')][_0x2195('0x3e')]){_0x516b5c['include']=[{'all':!![]}];}_0x516b5c=_[_0x2195('0x38')]({},_0x516b5c,_0x5df9fd[_0x2195('0x3d')]);return db[_0x2195('0x29')][_0x2195('0x45')](_0x516b5c)[_0x2195('0x22')](handleEntityNotFound(_0x141839,null))[_0x2195('0x22')](respondWithResult(_0x141839,null))[_0x2195('0x41')](handleError(_0x141839,null));};exports[_0x2195('0x46')]=function(_0x2913dd,_0x398a92){return db[_0x2195('0x29')]['create'](_0x2913dd['body'],{})['then'](respondWithResult(_0x398a92,0xc9))[_0x2195('0x41')](handleError(_0x398a92,null));};exports[_0x2195('0x20')]=function(_0x598297,_0x455824){if(_0x598297['body']['id']){delete _0x598297[_0x2195('0x47')]['id'];}return db[_0x2195('0x29')][_0x2195('0x45')]({'where':{'id':_0x598297[_0x2195('0x43')]['id']}})['then'](handleEntityNotFound(_0x455824,null))[_0x2195('0x22')](saveUpdates(_0x598297[_0x2195('0x47')],null))['then'](respondWithResult(_0x455824,null))['catch'](handleError(_0x455824,null));};exports[_0x2195('0x21')]=function(_0x44e342,_0x4178fc){return db['SalesforceField'][_0x2195('0x45')]({'where':{'id':_0x44e342[_0x2195('0x43')]['id']}})[_0x2195('0x22')](handleEntityNotFound(_0x4178fc,null))[_0x2195('0x22')](removeEntity(_0x4178fc,null))[_0x2195('0x41')](handleError(_0x4178fc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9bbd54b..5ada74c 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 _0xbf64=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','./intSalesforceField.attributes'];(function(_0x2a4315,_0x20e037){var _0x1cab01=function(_0x180931){while(--_0x180931){_0x2a4315['push'](_0x2a4315['shift']());}};_0x1cab01(++_0x20e037);}(_0xbf64,0x1b2));var _0x4bf6=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xbf64[_0x2a67fe];return _0x57e726;};'use strict';var _=require('lodash');var util=require(_0x4bf6('0x0'));var logger=require(_0x4bf6('0x1'))('api');var moment=require(_0x4bf6('0x2'));var BPromise=require(_0x4bf6('0x3'));var rp=require(_0x4bf6('0x4'));var attributes=require(_0x4bf6('0x5'));module['exports']=function(_0x484c21,_0x29edfc){return _0x484c21['define'](_0x4bf6('0x6'),attributes,{'tableName':_0x4bf6('0x7'),'paranoid':![],'indexes':[{'name':_0x4bf6('0x8'),'fields':[_0x4bf6('0x9'),_0x4bf6('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3cdc=['moment','request-promise','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','../../config/logger','api'];(function(_0x342ba6,_0x3ffa29){var _0x3d77d6=function(_0x379be8){while(--_0x379be8){_0x342ba6['push'](_0x342ba6['shift']());}};_0x3d77d6(++_0x3ffa29);}(_0x3cdc,0xf9));var _0xc3cd=function(_0x5814eb,_0x1e9e23){_0x5814eb=_0x5814eb-0x0;var _0x4d5c7b=_0x3cdc[_0x5814eb];return _0x4d5c7b;};'use strict';var _=require(_0xc3cd('0x0'));var util=require('util');var logger=require(_0xc3cd('0x1'))(_0xc3cd('0x2'));var moment=require(_0xc3cd('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3cd('0x4'));var attributes=require(_0xc3cd('0x5'));module[_0xc3cd('0x6')]=function(_0x15836a,_0x58de3d){return _0x15836a[_0xc3cd('0x7')](_0xc3cd('0x8'),attributes,{'tableName':_0xc3cd('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xc3cd('0xa'),_0xc3cd('0xb')],'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 af91645..a0f1648 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 _0xc3b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3b7,0x1c5));var _0x7c3b=function(_0x202bb1,_0x551057){_0x202bb1=_0x202bb1-0x0;var _0x2a3588=_0xc3b7[_0x202bb1];return _0x2a3588;};'use strict';var _=require(_0x7c3b('0x0'));var util=require(_0x7c3b('0x1'));var moment=require(_0x7c3b('0x2'));var BPromise=require(_0x7c3b('0x3'));var rs=require(_0x7c3b('0x4'));var fs=require('fs');var Redis=require(_0x7c3b('0x5'));var db=require(_0x7c3b('0x6'))['db'];var utils=require(_0x7c3b('0x7'));var logger=require(_0x7c3b('0x8'))(_0x7c3b('0x9'));var config=require(_0x7c3b('0xa'));var jayson=require(_0x7c3b('0xb'));var client=jayson[_0x7c3b('0xc')][_0x7c3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b6791,_0x4f0b6e,_0x3997c0){return new BPromise(function(_0x533bef,_0x332a4e){return client['request'](_0x5b6791,_0x3997c0)['then'](function(_0x5acfa0){logger[_0x7c3b('0xe')](_0x7c3b('0xf'),_0x4f0b6e,_0x7c3b('0x10'));logger[_0x7c3b('0x11')](_0x7c3b('0x12'),_0x4f0b6e,_0x7c3b('0x10'),JSON['stringify'](_0x5acfa0));if(_0x5acfa0[_0x7c3b('0x13')]){if(_0x5acfa0[_0x7c3b('0x13')][_0x7c3b('0x14')]===0x1f4){logger[_0x7c3b('0x13')](_0x7c3b('0xf'),_0x4f0b6e,_0x5acfa0[_0x7c3b('0x13')][_0x7c3b('0x15')]);return _0x332a4e(_0x5acfa0[_0x7c3b('0x13')][_0x7c3b('0x15')]);}logger[_0x7c3b('0x13')](_0x7c3b('0xf'),_0x4f0b6e,_0x5acfa0['error'][_0x7c3b('0x15')]);return _0x533bef(_0x5acfa0[_0x7c3b('0x13')]['message']);}else{logger[_0x7c3b('0xe')](_0x7c3b('0xf'),_0x4f0b6e,_0x7c3b('0x10'));_0x533bef(_0x5acfa0[_0x7c3b('0x16')][_0x7c3b('0x15')]);}})[_0x7c3b('0x17')](function(_0x4ee00f){logger[_0x7c3b('0x13')]('SalesforceField,\x20%s,\x20%s',_0x4f0b6e,_0x4ee00f);_0x332a4e(_0x4ee00f);});});} \ No newline at end of file +var _0x3a00=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3a00,0x18e));var _0x03a0=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x3a00[_0xe51596];return _0x22c705;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var moment=require('moment');var BPromise=require(_0x03a0('0x2'));var rs=require(_0x03a0('0x3'));var fs=require('fs');var Redis=require(_0x03a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03a0('0x5'));var logger=require(_0x03a0('0x6'))(_0x03a0('0x7'));var config=require('../../config/environment');var jayson=require(_0x03a0('0x8'));var client=jayson['client'][_0x03a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x101d63,_0x475894,_0x1edd61){return new BPromise(function(_0x25e653,_0x212244){return client[_0x03a0('0xa')](_0x101d63,_0x1edd61)[_0x03a0('0xb')](function(_0x2461c5){logger[_0x03a0('0xc')]('SalesforceField,\x20%s,\x20%s',_0x475894,_0x03a0('0xd'));logger[_0x03a0('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x475894,_0x03a0('0xd'),JSON[_0x03a0('0xf')](_0x2461c5));if(_0x2461c5['error']){if(_0x2461c5[_0x03a0('0x10')]['code']===0x1f4){logger[_0x03a0('0x10')](_0x03a0('0x11'),_0x475894,_0x2461c5['error'][_0x03a0('0x12')]);return _0x212244(_0x2461c5[_0x03a0('0x10')][_0x03a0('0x12')]);}logger['error'](_0x03a0('0x11'),_0x475894,_0x2461c5[_0x03a0('0x10')]['message']);return _0x25e653(_0x2461c5['error'][_0x03a0('0x12')]);}else{logger[_0x03a0('0xc')]('SalesforceField,\x20%s,\x20%s',_0x475894,_0x03a0('0xd'));_0x25e653(_0x2461c5[_0x03a0('0x13')]['message']);}})[_0x03a0('0x14')](function(_0x1d558c){logger[_0x03a0('0x10')](_0x03a0('0x11'),_0x475894,_0x1d558c);_0x212244(_0x1d558c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7a8a627..55fb771 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 _0x954c=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x954c,0x172));var _0xc954=function(_0x5bd6c0,_0x21e4ea){_0x5bd6c0=_0x5bd6c0-0x0;var _0xbc9780=_0x954c[_0x5bd6c0];return _0xbc9780;};'use strict';var multer=require(_0xc954('0x0'));var util=require('util');var path=require(_0xc954('0x1'));var timeout=require(_0xc954('0x2'));var express=require(_0xc954('0x3'));var router=express[_0xc954('0x4')]();var auth=require(_0xc954('0x5'));var interaction=require(_0xc954('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xc954('0x7')]('/',auth[_0xc954('0x8')](),controller[_0xc954('0x9')]);router[_0xc954('0x7')](_0xc954('0xa'),auth['isAuthenticated'](),controller[_0xc954('0xb')]);router[_0xc954('0x7')](_0xc954('0xc'),auth['isAuthenticated'](),controller[_0xc954('0xd')]);router[_0xc954('0x7')](_0xc954('0xe'),auth[_0xc954('0x8')](),controller[_0xc954('0xf')]);router[_0xc954('0x10')]('/',auth[_0xc954('0x8')](),controller[_0xc954('0x11')]);router['post'](_0xc954('0xc'),auth[_0xc954('0x8')](),controller[_0xc954('0x12')]);router[_0xc954('0x13')](_0xc954('0xa'),auth[_0xc954('0x8')](),controller[_0xc954('0x14')]);router[_0xc954('0x15')](_0xc954('0xa'),auth[_0xc954('0x8')](),controller[_0xc954('0x16')]);module[_0xc954('0x17')]=router; \ No newline at end of file +var _0x49a0=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations'];(function(_0x4fae89,_0x5b6387){var _0x45e2ac=function(_0x274b97){while(--_0x274b97){_0x4fae89['push'](_0x4fae89['shift']());}};_0x45e2ac(++_0x5b6387);}(_0x49a0,0x1e9));var _0x049a=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x49a0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x049a('0x0'));var util=require(_0x049a('0x1'));var path=require(_0x049a('0x2'));var timeout=require(_0x049a('0x3'));var express=require(_0x049a('0x4'));var router=express[_0x049a('0x5')]();var auth=require(_0x049a('0x6'));var interaction=require(_0x049a('0x7'));var config=require(_0x049a('0x8'));var controller=require(_0x049a('0x9'));router[_0x049a('0xa')]('/',auth['isAuthenticated'](),controller[_0x049a('0xb')]);router['get'](_0x049a('0xc'),auth[_0x049a('0xd')](),controller['show']);router[_0x049a('0xa')](_0x049a('0xe'),auth['isAuthenticated'](),controller[_0x049a('0xf')]);router[_0x049a('0xa')](_0x049a('0x10'),auth[_0x049a('0xd')](),controller[_0x049a('0x11')]);router['post']('/',auth[_0x049a('0xd')](),controller[_0x049a('0x12')]);router[_0x049a('0x13')](_0x049a('0xe'),auth['isAuthenticated'](),controller[_0x049a('0x14')]);router[_0x049a('0x15')](_0x049a('0xc'),auth[_0x049a('0xd')](),controller[_0x049a('0x16')]);router[_0x049a('0x17')](_0x049a('0xc'),auth[_0x049a('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f319037..50967e5 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 _0xb7c8=['remoteUri','exports','STRING','username'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xb7c8,0x119));var _0x8b7c=function(_0x63cf67,_0x1d6f39){_0x63cf67=_0x63cf67-0x0;var _0x38e135=_0xb7c8[_0x63cf67];return _0x38e135;};'use strict';var Sequelize=require('sequelize');module[_0x8b7c('0x0')]={'name':{'type':Sequelize[_0x8b7c('0x1')]},'description':{'type':Sequelize[_0x8b7c('0x1')]},'username':{'type':Sequelize[_0x8b7c('0x1')],'unique':_0x8b7c('0x2')},'password':{'type':Sequelize[_0x8b7c('0x1')]},'email':{'type':Sequelize[_0x8b7c('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8b7c('0x3')},'serverUrl':{'type':Sequelize[_0x8b7c('0x1')]}}; \ No newline at end of file +var _0x1339=['remoteUri','STRING','username'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1339,0x1ed));var _0x9133=function(_0x1bf6b1,_0x5bb822){_0x1bf6b1=_0x1bf6b1-0x0;var _0x3736aa=_0x1339[_0x1bf6b1];return _0x3736aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9133('0x0')]},'description':{'type':Sequelize[_0x9133('0x0')]},'username':{'type':Sequelize[_0x9133('0x0')],'unique':_0x9133('0x1')},'password':{'type':Sequelize[_0x9133('0x0')]},'email':{'type':Sequelize[_0x9133('0x0')]},'remoteUri':{'type':Sequelize[_0x9133('0x0')],'unique':_0x9133('0x2')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index dd07319..fee35fa 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 _0xd117=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../components/integrations/configuration','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','count','offset','set','Content-Range','json','save','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','ServicenowAccount','includeAll','include','rows','catch','params','merge','create','update','body','find','getConfigurations','map','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowConfiguration','ServicenowField','Descriptions','made_sla','hold_reason','knowledge','subcategory','close_code','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','internalType','label','push','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','all','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd117,0x182));var _0x7d11=function(_0x232e7a,_0x19997){_0x232e7a=_0x232e7a-0x0;var _0x445ddd=_0xd117[_0x232e7a];return _0x445ddd;};'use strict';var pdf=require(_0x7d11('0x0'));var emlformat=require(_0x7d11('0x1'));var rimraf=require(_0x7d11('0x2'));var zipdir=require(_0x7d11('0x3'));var jsonpatch=require(_0x7d11('0x4'));var rp=require(_0x7d11('0x5'));var moment=require(_0x7d11('0x6'));var BPromise=require(_0x7d11('0x7'));var Mustache=require(_0x7d11('0x8'));var util=require(_0x7d11('0x9'));var path=require(_0x7d11('0xa'));var sox=require(_0x7d11('0xb'));var csv=require(_0x7d11('0xc'));var ejs=require(_0x7d11('0xd'));var fs=require('fs');var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xc'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var authService=require(_0x7d11('0x13'));var hardwareService=require(_0x7d11('0x14'));var Redis=require('ioredis');var qs=require(_0x7d11('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7d11('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x7d11('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x7d11('0x18')][_0x7d11('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5ee572,_0x401bb7,_0x20f519,_0x4cda5d){return new BPromise(function(_0x324de5,_0x16949d){var _0x20a2df=_0x4cda5d||client;return _0x20a2df[_0x7d11('0x1a')](_0x5ee572,_0x20f519)[_0x7d11('0x1b')](function(_0xeae744){logger[_0x7d11('0x1c')](_0x7d11('0x1d'),_0x401bb7,'request\x20sent');logger[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x401bb7,_0x7d11('0x20'),JSON[_0x7d11('0x21')](_0xeae744));if(_0xeae744[_0x7d11('0x22')]){if(_0xeae744['error'][_0x7d11('0x23')]===0x1f4){logger[_0x7d11('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x401bb7,_0xeae744['error'][_0x7d11('0x24')]);return _0x16949d(_0xeae744['error'][_0x7d11('0x24')]);}logger['error'](_0x7d11('0x1d'),_0x401bb7,_0xeae744[_0x7d11('0x22')][_0x7d11('0x24')]);return _0x324de5(_0xeae744[_0x7d11('0x22')][_0x7d11('0x24')]);}else{logger[_0x7d11('0x1c')](_0x7d11('0x1d'),_0x401bb7,_0x7d11('0x20'));_0x324de5(_0xeae744['result'][_0x7d11('0x24')]);}})['catch'](function(_0x58455b){logger['error'](_0x7d11('0x1d'),_0x401bb7,_0x58455b);_0x16949d(_0x58455b);});});}function respondWithStatusCode(_0x3545dc,_0x44476c){_0x44476c=_0x44476c||0xcc;return function(_0x1a7853){if(_0x1a7853){return _0x3545dc[_0x7d11('0x25')](_0x44476c);}return _0x3545dc[_0x7d11('0x26')](_0x44476c)[_0x7d11('0x27')]();};}function respondWithResult(_0x1c1edd,_0x5e2f2f){_0x5e2f2f=_0x5e2f2f||0xc8;return function(_0x36c2b4){if(_0x36c2b4){return _0x1c1edd['status'](_0x5e2f2f)['json'](_0x36c2b4);}};}function respondWithFilteredResult(_0x5126cf,_0x3ba092){return function(_0x59cdba){if(_0x59cdba){var _0x180e1e=_0x59cdba[_0x7d11('0x28')],_0x30e4c6=_0x3ba092[_0x7d11('0x29')],_0x328ab7=_0x3ba092[_0x7d11('0x29')]+_0x3ba092['limit'],_0x47c794;if(_0x328ab7>=_0x180e1e){_0x328ab7=_0x180e1e;_0x47c794=0xc8;}else{_0x47c794=0xce;}_0x5126cf[_0x7d11('0x26')](_0x47c794);return _0x5126cf[_0x7d11('0x2a')](_0x7d11('0x2b'),_0x30e4c6+'-'+_0x328ab7+'/'+_0x180e1e)[_0x7d11('0x2c')](_0x59cdba);}return null;};}function patchUpdates(_0x4c7d6a){return function(_0x1a7745){try{jsonpatch['apply'](_0x1a7745,_0x4c7d6a,!![]);}catch(_0x1bc218){return BPromise['reject'](_0x1bc218);}return _0x1a7745[_0x7d11('0x2d')]();};}function saveUpdates(_0xba4e80,_0x1e32f6){return function(_0x4831ed){if(_0x4831ed){return _0x4831ed['update'](_0xba4e80)[_0x7d11('0x1b')](function(_0x1ed210){return _0x1ed210;});}return null;};}function removeEntity(_0x5d540e,_0x388b84){return function(_0x1d3d86){if(_0x1d3d86){return _0x1d3d86[_0x7d11('0x2e')]()['then'](function(){_0x5d540e[_0x7d11('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x507465,_0x3a88c9){return function(_0x56637d){if(!_0x56637d){_0x507465[_0x7d11('0x25')](0x194);}return _0x56637d;};}function handleError(_0x38fbd3,_0x34f3b6){_0x34f3b6=_0x34f3b6||0x1f4;return function(_0x35b997){logger['error'](_0x35b997[_0x7d11('0x2f')]);if(_0x35b997[_0x7d11('0x30')]){delete _0x35b997['name'];}_0x38fbd3['status'](_0x34f3b6)[_0x7d11('0x31')](_0x35b997);};}exports[_0x7d11('0x32')]=function(_0x5b7d3a,_0x37beb0){var _0x5ac591={},_0x5c0113={},_0x1286d6={'count':0x0,'rows':[]};var _0x53ed85=db['ServicenowAccount'][_0x7d11('0x33')];_0x5c0113[_0x7d11('0x34')]=_[_0x7d11('0x35')](_0x53ed85);_0x5c0113[_0x7d11('0x36')]=_[_0x7d11('0x35')](_0x5b7d3a[_0x7d11('0x36')]);_0x5c0113[_0x7d11('0x37')]=_[_0x7d11('0x38')](_0x5c0113[_0x7d11('0x34')],_0x5c0113[_0x7d11('0x36')]);_0x5ac591[_0x7d11('0x39')]=_[_0x7d11('0x38')](_0x5c0113['model'],qs[_0x7d11('0x3a')](_0x5b7d3a['query'][_0x7d11('0x3a')]));_0x5ac591[_0x7d11('0x39')]=_0x5ac591[_0x7d11('0x39')][_0x7d11('0x3b')]?_0x5ac591['attributes']:_0x5c0113[_0x7d11('0x34')];if(!_0x5b7d3a[_0x7d11('0x36')][_0x7d11('0x3c')](_0x7d11('0x3d'))){_0x5ac591['limit']=qs[_0x7d11('0x3e')](_0x5b7d3a['query'][_0x7d11('0x3e')]);_0x5ac591['offset']=qs[_0x7d11('0x29')](_0x5b7d3a[_0x7d11('0x36')][_0x7d11('0x29')]);}_0x5ac591[_0x7d11('0x3f')]=qs['sort'](_0x5b7d3a['query'][_0x7d11('0x40')]);_0x5ac591[_0x7d11('0x41')]=qs['filters'](_[_0x7d11('0x42')](_0x5b7d3a[_0x7d11('0x36')],_0x5c0113[_0x7d11('0x37')]));if(_0x5b7d3a[_0x7d11('0x36')][_0x7d11('0x43')]){_0x5ac591[_0x7d11('0x41')]=_['merge'](_0x5ac591[_0x7d11('0x41')],{'$or':_['map'](_0x53ed85,function(_0x2f4a76){if(_0x2f4a76[_0x7d11('0x44')][_0x7d11('0x45')]!==_0x7d11('0x46')){var _0x2a0c2f={};_0x2a0c2f[_0x2f4a76[_0x7d11('0x47')]]={'$like':'%'+_0x5b7d3a['query']['filter']+'%'};return _0x2a0c2f;}})});}_0x5ac591=_['merge']({},_0x5ac591,_0x5b7d3a[_0x7d11('0x48')]);var _0x16d92a={'where':_0x5ac591[_0x7d11('0x41')]};return db[_0x7d11('0x49')][_0x7d11('0x28')](_0x16d92a)['then'](function(_0x347b8e){_0x1286d6[_0x7d11('0x28')]=_0x347b8e;if(_0x5b7d3a['query'][_0x7d11('0x4a')]){_0x5ac591[_0x7d11('0x4b')]=[{'all':!![]}];}return db[_0x7d11('0x49')]['findAll'](_0x5ac591);})[_0x7d11('0x1b')](function(_0x3bbc14){_0x1286d6[_0x7d11('0x4c')]=_0x3bbc14;return _0x1286d6;})['then'](respondWithFilteredResult(_0x37beb0,_0x5ac591))[_0x7d11('0x4d')](handleError(_0x37beb0,null));};exports['show']=function(_0xe5d2fe,_0x69dbd1){var _0x3f33d9={'raw':![],'where':{'id':_0xe5d2fe[_0x7d11('0x4e')]['id']}},_0xbe357={};_0xbe357[_0x7d11('0x34')]=_[_0x7d11('0x35')](db[_0x7d11('0x49')][_0x7d11('0x33')]);_0xbe357['query']=_['keys'](_0xe5d2fe['query']);_0xbe357[_0x7d11('0x37')]=_[_0x7d11('0x38')](_0xbe357[_0x7d11('0x34')],_0xbe357[_0x7d11('0x36')]);_0x3f33d9[_0x7d11('0x39')]=_[_0x7d11('0x38')](_0xbe357[_0x7d11('0x34')],qs[_0x7d11('0x3a')](_0xe5d2fe[_0x7d11('0x36')][_0x7d11('0x3a')]));_0x3f33d9[_0x7d11('0x39')]=_0x3f33d9[_0x7d11('0x39')]['length']?_0x3f33d9[_0x7d11('0x39')]:_0xbe357[_0x7d11('0x34')];if(_0xe5d2fe[_0x7d11('0x36')]['includeAll']){_0x3f33d9['include']=[{'all':!![]}];}_0x3f33d9=_[_0x7d11('0x4f')]({},_0x3f33d9,_0xe5d2fe[_0x7d11('0x48')]);return db[_0x7d11('0x49')]['find'](_0x3f33d9)['then'](handleEntityNotFound(_0x69dbd1,null))[_0x7d11('0x1b')](respondWithResult(_0x69dbd1,null))[_0x7d11('0x4d')](handleError(_0x69dbd1,null));};exports['create']=function(_0x3a2102,_0x29dfad){return db[_0x7d11('0x49')][_0x7d11('0x50')](_0x3a2102['body'],{})[_0x7d11('0x1b')](respondWithResult(_0x29dfad,0xc9))[_0x7d11('0x4d')](handleError(_0x29dfad,null));};exports[_0x7d11('0x51')]=function(_0x503cef,_0x4d0f77){if(_0x503cef[_0x7d11('0x52')]['id']){delete _0x503cef[_0x7d11('0x52')]['id'];}return db[_0x7d11('0x49')][_0x7d11('0x53')]({'where':{'id':_0x503cef[_0x7d11('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d0f77,null))[_0x7d11('0x1b')](saveUpdates(_0x503cef[_0x7d11('0x52')],null))[_0x7d11('0x1b')](respondWithResult(_0x4d0f77,null))[_0x7d11('0x4d')](handleError(_0x4d0f77,null));};exports['destroy']=function(_0x4f1ea3,_0x46e1db){return db[_0x7d11('0x49')][_0x7d11('0x53')]({'where':{'id':_0x4f1ea3[_0x7d11('0x4e')]['id']}})[_0x7d11('0x1b')](handleEntityNotFound(_0x46e1db,null))[_0x7d11('0x1b')](removeEntity(_0x46e1db,null))[_0x7d11('0x4d')](handleError(_0x46e1db,null));};exports[_0x7d11('0x54')]=function(_0x3b3383,_0x37467f,_0x4db2d7){var _0x4fb818={};var _0x47f44f={};var _0x2b5534;var _0xbb3072;return db[_0x7d11('0x49')]['findOne']({'where':{'id':_0x3b3383[_0x7d11('0x4e')]['id']}})[_0x7d11('0x1b')](handleEntityNotFound(_0x37467f,null))[_0x7d11('0x1b')](function(_0x32937c){if(_0x32937c){_0x2b5534=_0x32937c;_0x47f44f[_0x7d11('0x34')]=_[_0x7d11('0x35')](db['ServicenowConfiguration'][_0x7d11('0x33')]);_0x47f44f[_0x7d11('0x36')]=_[_0x7d11('0x35')](_0x3b3383['query']);_0x47f44f['filters']=_['intersection'](_0x47f44f['model'],_0x47f44f[_0x7d11('0x36')]);_0x4fb818['attributes']=_['intersection'](_0x47f44f['model'],qs[_0x7d11('0x3a')](_0x3b3383[_0x7d11('0x36')][_0x7d11('0x3a')]));_0x4fb818[_0x7d11('0x39')]=_0x4fb818[_0x7d11('0x39')][_0x7d11('0x3b')]?_0x4fb818['attributes']:_0x47f44f[_0x7d11('0x34')];_0x4fb818['order']=qs[_0x7d11('0x40')](_0x3b3383['query'][_0x7d11('0x40')]);_0x4fb818[_0x7d11('0x41')]=qs['filters'](_[_0x7d11('0x42')](_0x3b3383[_0x7d11('0x36')],_0x47f44f[_0x7d11('0x37')]));if(_0x3b3383[_0x7d11('0x36')]['filter']){_0x4fb818['where']=_[_0x7d11('0x4f')](_0x4fb818[_0x7d11('0x41')],{'$or':_[_0x7d11('0x55')](_0x4fb818[_0x7d11('0x39')],function(_0x458362){var _0x492183={};_0x492183[_0x458362]={'$like':'%'+_0x3b3383[_0x7d11('0x36')]['filter']+'%'};return _0x492183;})});}_0x4fb818=_[_0x7d11('0x4f')]({},_0x4fb818,_0x3b3383[_0x7d11('0x48')]);return _0x2b5534[_0x7d11('0x54')](_0x4fb818);}})[_0x7d11('0x1b')](function(_0x4df2da){if(_0x4df2da){_0xbb3072=_0x4df2da[_0x7d11('0x3b')];if(!_0x3b3383['query'][_0x7d11('0x3c')](_0x7d11('0x3d'))){_0x4fb818[_0x7d11('0x3e')]=qs[_0x7d11('0x3e')](_0x3b3383[_0x7d11('0x36')][_0x7d11('0x3e')]);_0x4fb818[_0x7d11('0x29')]=qs[_0x7d11('0x29')](_0x3b3383[_0x7d11('0x36')][_0x7d11('0x29')]);}return _0x2b5534[_0x7d11('0x54')](_0x4fb818);}})[_0x7d11('0x1b')](function(_0x346250){if(_0x346250){return _0x346250?{'count':_0xbb3072,'rows':_0x346250}:null;}})[_0x7d11('0x1b')](respondWithResult(_0x37467f,null))['catch'](handleError(_0x37467f,null));};exports[_0x7d11('0x56')]=function(_0x489121,_0x371869,_0x4c113b){if(_0x489121[_0x7d11('0x52')]['id']){delete _0x489121[_0x7d11('0x52')]['id'];}return db[_0x7d11('0x49')][_0x7d11('0x57')]({'where':{'id':_0x489121['params']['id']}})['then'](handleEntityNotFound(_0x371869,null))[_0x7d11('0x1b')](function(_0x15938b){if(_0x15938b){_0x489121[_0x7d11('0x52')]['AccountId']=_0x15938b['id'];_0x489121[_0x7d11('0x52')][_0x7d11('0x58')]=integrations[_0x7d11('0x59')](_0x489121[_0x7d11('0x52')][_0x7d11('0x5a')],_0x489121[_0x7d11('0x52')]['type']);_0x489121[_0x7d11('0x52')]['Descriptions']=integrations[_0x7d11('0x5b')](_0x489121['body']['channel'],_0x489121[_0x7d11('0x52')][_0x7d11('0x44')]);return db[_0x7d11('0x5c')][_0x7d11('0x50')](_0x489121[_0x7d11('0x52')],{'include':[{'model':db[_0x7d11('0x5d')],'as':_0x7d11('0x58')},{'model':db[_0x7d11('0x5d')],'as':_0x7d11('0x5e')}]});}return null;})[_0x7d11('0x1b')](respondWithResult(_0x371869,null))[_0x7d11('0x4d')](handleError(_0x371869,null));};exports['getFields']=function(_0x3f0d43,_0x5af10e,_0x1af320){var _0x239901=[_0x7d11('0x5f'),_0x7d11('0x60'),_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),'notify','incident_state',_0x7d11('0x64'),_0x7d11('0x65')];var _0x7004fa=[_0x7d11('0x66'),_0x7d11('0x5f'),'caused_by',_0x7d11('0x67'),'upon_reject',_0x7d11('0x68'),_0x7d11('0x69'),_0x7d11('0x60'),_0x7d11('0x6a'),_0x7d11('0x6b'),_0x7d11('0x6c'),_0x7d11('0x6d'),_0x7d11('0x6e'),'user_input','sys_created_on',_0x7d11('0x6f'),_0x7d11('0x70'),_0x7d11('0x71'),'knowledge','order',_0x7d11('0x72'),'closed_at',_0x7d11('0x73'),_0x7d11('0x74'),_0x7d11('0x75'),_0x7d11('0x76'),'work_notes_list',_0x7d11('0x77'),_0x7d11('0x78'),_0x7d11('0x79'),_0x7d11('0x7a'),_0x7d11('0x7b'),_0x7d11('0x7c'),_0x7d11('0x7d'),_0x7d11('0x7e'),'group_list',_0x7d11('0x7f'),_0x7d11('0x80'),_0x7d11('0x81'),_0x7d11('0x82'),_0x7d11('0x83'),'subcategory',_0x7d11('0x84'),_0x7d11('0x85'),_0x7d11('0x63'),_0x7d11('0x86'),_0x7d11('0x87'),'work_start','assignment_group','business_stc',_0x7d11('0x88'),'description',_0x7d11('0x89'),'notify','sys_class_name',_0x7d11('0x8a'),_0x7d11('0x8b'),_0x7d11('0x8c'),_0x7d11('0x8d'),_0x7d11('0x8e'),_0x7d11('0x8f'),_0x7d11('0x90'),_0x7d11('0x91'),_0x7d11('0x92'),_0x7d11('0x93'),'company',_0x7d11('0x94'),_0x7d11('0x95'),'assigned_to',_0x7d11('0x64'),_0x7d11('0x96'),_0x7d11('0x97'),_0x7d11('0x98'),'comments_and_work_notes','due_date',_0x7d11('0x99'),'reopen_count',_0x7d11('0x9a'),_0x7d11('0x9b'),_0x7d11('0x9c'),_0x7d11('0x9d'),_0x7d11('0x9e'),_0x7d11('0x65')];var _0x238486='';var _0x596228='';var _0x3381e0=[];var _0x3212fa='';var _0x22121e='';var _0x402efb=[];var _0x5bb85d='';var _0x2e986b='';var _0x18cb6b={};var _0x498714='';return db[_0x7d11('0x49')][_0x7d11('0x57')]({'where':{'id':_0x3f0d43[_0x7d11('0x4e')]['id']},'attributes':['id','username',_0x7d11('0x9f'),_0x7d11('0xa0'),'remoteUri',_0x7d11('0xa1')]})[_0x7d11('0x1b')](handleEntityNotFound(_0x5af10e,null))['then'](function(_0x3ee2ee){if(_0x3ee2ee){_0x498714=_0x3ee2ee['remoteUri'];var _0x49d16c=_0x498714['slice'](-0x1);if(_0x49d16c==='/'){_0x498714=_0x498714['substring'](0x0,_0x498714[_0x7d11('0xa2')](_0x49d16c));}_0x2e986b=util[_0x7d11('0xa3')](_0x7d11('0xa4'),_0x498714);_0x5bb85d=util[_0x7d11('0xa3')](_0x7d11('0xa5'),_0x498714);_0x18cb6b={'user':_0x3ee2ee[_0x7d11('0xa6')],'pass':_0x3ee2ee[_0x7d11('0x9f')]};var _0x1a2df6={'method':_0x7d11('0xa7'),'uri':_0x2e986b+_0x7d11('0xa8'),'auth':_0x18cb6b,'json':!![]};return rp(_0x1a2df6);}})['then'](function(_0x5ba13c){if(_0x5ba13c[_0x7d11('0xa9')][_0x7d11('0x3b')]>0x0){_0x238486=_0x5ba13c['result'];}console['log'](_0x7d11('0xaa'),_0x238486);_0x402efb=[];_0x596228=Object[_0x7d11('0xab')]([],_0x238486);_[_0x7d11('0xac')](_0x596228,function(_0x391d7){return!_0x239901['includes'](_0x391d7['name']);});_0x596228['forEach'](function(_0x41386e){var _0x126107=createFieldObject(_0x5bb85d,_0x18cb6b,_0x41386e[_0x7d11('0xad')],_0x41386e['name'],_0x41386e[_0x7d11('0xae')],![]);_0x402efb[_0x7d11('0xaf')](_0x126107);});return Promise['all'](_0x402efb);})[_0x7d11('0x1b')](function(_0x1cb457){_0x3381e0=_0x1cb457;_0x3212fa=Object['assign']([],_0x238486);console['log'](_0x7d11('0xb0'),_0x238486);_[_0x7d11('0xac')](_0x3212fa,function(_0x5e0905){return _0x7004fa['includes'](_0x5e0905[_0x7d11('0x30')]);});console[_0x7d11('0xb1')](_0x7d11('0xb2'),_0x3212fa);_0x402efb=[];_0x3212fa[_0x7d11('0xb3')](function(_0x4af02c){var _0x411f81=createFieldObject(_0x5bb85d,_0x18cb6b,_0x4af02c[_0x7d11('0xad')],_0x4af02c[_0x7d11('0x30')],_0x4af02c[_0x7d11('0xae')],!![]);_0x402efb['push'](_0x411f81);});return Promise[_0x7d11('0xb4')](_0x402efb);})[_0x7d11('0x1b')](function(_0x357cd1){_0x22121e=_0x357cd1;var _0x5ab31d=_0x3381e0[_0x7d11('0xb5')](_0x22121e);return{'count':_0x5ab31d['length'],'rows':_0x5ab31d};})[_0x7d11('0x1b')](respondWithResult(_0x5af10e,null))['catch'](function(_0x1a0e19){console[_0x7d11('0xb1')](_0x7d11('0xb6')+_0x1a0e19);var _0x1a548f=_0x3f0d43[_0x7d11('0x36')][_0x7d11('0xb7')]?0x1f4:_0x1a0e19['statusCode']||0x1f4;logger['error'](_0x1a0e19[_0x7d11('0x2f')]);delete _0x1a0e19[_0x7d11('0x30')];if(_0x1a548f===0x191){_0x1a548f=0x190;}_0x5af10e[_0x7d11('0x26')](_0x1a548f)[_0x7d11('0x31')](_0x3f0d43['query'][_0x7d11('0xb7')]?{'message':_0x7d11('0xb8'),'statusCode':_0x1a0e19[_0x7d11('0xb9')]}:_0x1a0e19);});};function createFieldObject(_0x3e8049,_0x53d831,_0x7fb79e,_0x2bac2a,_0x3aad38,_0x8353fe){return new Promise(function(_0x2e97e,_0x21e965){var _0x4b06e7={'id':_0x2bac2a,'name':_0x3aad38,'custom':_0x8353fe};if(_0x7fb79e===_0x7d11('0xba')){_0x4b06e7['options']=[{'name':_0x7d11('0xbb'),'value':'true'},{'name':_0x7d11('0xbc'),'value':_0x7d11('0xbd')}];_0x2e97e(_0x4b06e7);}else{var _0x42755e={'method':_0x7d11('0xa7'),'uri':_0x3e8049+_0x7d11('0xbe')+_0x2bac2a,'auth':_0x53d831,'json':!![]};return rp(_0x42755e)[_0x7d11('0x1b')](function(_0x444b65){var _0x2f8fda=[];if(_0x444b65[_0x7d11('0xa9')][_0x7d11('0x3b')]>0x0){_0x444b65['result'][_0x7d11('0xb3')](function(_0x4d8ab7){if(_0x4d8ab7[_0x7d11('0xbf')]===_0x7d11('0xbd')){var _0x34267a={'name':_0x4d8ab7[_0x7d11('0xae')],'value':_0x4d8ab7[_0x7d11('0xc0')]};_0x2f8fda['push'](_0x34267a);}});}_0x4b06e7['options']=_0x2f8fda;if(_0x4b06e7[_0x7d11('0x48')][_0x7d11('0x3b')]>0x0){_0x2e97e(_0x4b06e7);}else{if(_0x8353fe==![]){_0x2e97e();}else{_0x2e97e(_0x4b06e7);}}});}});} \ No newline at end of file +var _0x5464=['count','offset','limit','Content-Range','reject','then','destroy','stack','name','send','index','ServicenowAccount','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','include','findAll','rows','show','params','includeAll','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','state','sys_created_by','calendar_stc','closed_at','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status'];(function(_0x14cc9d,_0x138641){var _0x28fee3=function(_0x42300b){while(--_0x42300b){_0x14cc9d['push'](_0x14cc9d['shift']());}};_0x28fee3(++_0x138641);}(_0x5464,0x15d));var _0x4546=function(_0x209623,_0x29d2b6){_0x209623=_0x209623-0x0;var _0x40a3cf=_0x5464[_0x209623];return _0x40a3cf;};'use strict';var pdf=require(_0x4546('0x0'));var emlformat=require(_0x4546('0x1'));var rimraf=require(_0x4546('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4546('0x3'));var rp=require('request-promise');var moment=require(_0x4546('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4546('0x5'));var util=require(_0x4546('0x6'));var path=require(_0x4546('0x7'));var sox=require(_0x4546('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0xd'));var querystring=require(_0x4546('0xe'));var Papa=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var hardwareService=require(_0x4546('0x11'));var Redis=require('ioredis');var qs=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))(_0x4546('0x14'));var utils=require('../../config/utils');var config=require(_0x4546('0x15'));var db=require(_0x4546('0x16'))['db'];var integrations=require(_0x4546('0x17'));var jayson=require(_0x4546('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e6622,_0x57cf5f,_0x59eb29,_0x4bb236){return new BPromise(function(_0x5b64b7,_0x598516){var _0x4f5571=_0x4bb236||client;return _0x4f5571[_0x4546('0x19')](_0x3e6622,_0x59eb29)['then'](function(_0x363a17){logger['info'](_0x4546('0x1a'),_0x57cf5f,'request\x20sent');logger[_0x4546('0x1b')](_0x4546('0x1c'),_0x57cf5f,_0x4546('0x1d'),JSON[_0x4546('0x1e')](_0x363a17));if(_0x363a17[_0x4546('0x1f')]){if(_0x363a17[_0x4546('0x1f')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x57cf5f,_0x363a17[_0x4546('0x1f')][_0x4546('0x20')]);return _0x598516(_0x363a17[_0x4546('0x1f')][_0x4546('0x20')]);}logger[_0x4546('0x1f')](_0x4546('0x1a'),_0x57cf5f,_0x363a17[_0x4546('0x1f')][_0x4546('0x20')]);return _0x5b64b7(_0x363a17[_0x4546('0x1f')][_0x4546('0x20')]);}else{logger['info'](_0x4546('0x1a'),_0x57cf5f,_0x4546('0x1d'));_0x5b64b7(_0x363a17['result'][_0x4546('0x20')]);}})[_0x4546('0x21')](function(_0x1a1984){logger[_0x4546('0x1f')](_0x4546('0x1a'),_0x57cf5f,_0x1a1984);_0x598516(_0x1a1984);});});}function respondWithStatusCode(_0x15b013,_0x53e402){_0x53e402=_0x53e402||0xcc;return function(_0x3dab5c){if(_0x3dab5c){return _0x15b013[_0x4546('0x22')](_0x53e402);}return _0x15b013['status'](_0x53e402)[_0x4546('0x23')]();};}function respondWithResult(_0x4618a6,_0x202a6c){_0x202a6c=_0x202a6c||0xc8;return function(_0x4467ee){if(_0x4467ee){return _0x4618a6[_0x4546('0x24')](_0x202a6c)['json'](_0x4467ee);}};}function respondWithFilteredResult(_0x49dc98,_0x3796fe){return function(_0x831fa5){if(_0x831fa5){var _0x48fc36=_0x831fa5[_0x4546('0x25')],_0x4c1dad=_0x3796fe[_0x4546('0x26')],_0x43740e=_0x3796fe[_0x4546('0x26')]+_0x3796fe[_0x4546('0x27')],_0x166d6f;if(_0x43740e>=_0x48fc36){_0x43740e=_0x48fc36;_0x166d6f=0xc8;}else{_0x166d6f=0xce;}_0x49dc98[_0x4546('0x24')](_0x166d6f);return _0x49dc98['set'](_0x4546('0x28'),_0x4c1dad+'-'+_0x43740e+'/'+_0x48fc36)['json'](_0x831fa5);}return null;};}function patchUpdates(_0x3a2d12){return function(_0x161815){try{jsonpatch['apply'](_0x161815,_0x3a2d12,!![]);}catch(_0x539f74){return BPromise[_0x4546('0x29')](_0x539f74);}return _0x161815['save']();};}function saveUpdates(_0x3c7c7d,_0x58b69){return function(_0x480d8e){if(_0x480d8e){return _0x480d8e['update'](_0x3c7c7d)[_0x4546('0x2a')](function(_0x3b673f){return _0x3b673f;});}return null;};}function removeEntity(_0x258d26,_0x5716dc){return function(_0x10db2e){if(_0x10db2e){return _0x10db2e[_0x4546('0x2b')]()['then'](function(){_0x258d26[_0x4546('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3541,_0x44f604){return function(_0xe89b7c){if(!_0xe89b7c){_0x2a3541[_0x4546('0x22')](0x194);}return _0xe89b7c;};}function handleError(_0x507ccb,_0x12e38c){_0x12e38c=_0x12e38c||0x1f4;return function(_0x3b3948){logger[_0x4546('0x1f')](_0x3b3948[_0x4546('0x2c')]);if(_0x3b3948[_0x4546('0x2d')]){delete _0x3b3948[_0x4546('0x2d')];}_0x507ccb['status'](_0x12e38c)[_0x4546('0x2e')](_0x3b3948);};}exports[_0x4546('0x2f')]=function(_0x549f48,_0x5749b0){var _0x3eb8e8={},_0x26fb3d={},_0x56049d={'count':0x0,'rows':[]};var _0x3ecd16=db[_0x4546('0x30')]['rawAttributes'];_0x26fb3d['model']=_[_0x4546('0x31')](_0x3ecd16);_0x26fb3d[_0x4546('0x32')]=_[_0x4546('0x31')](_0x549f48[_0x4546('0x32')]);_0x26fb3d[_0x4546('0x33')]=_[_0x4546('0x34')](_0x26fb3d['model'],_0x26fb3d[_0x4546('0x32')]);_0x3eb8e8[_0x4546('0x35')]=_['intersection'](_0x26fb3d[_0x4546('0x36')],qs['fields'](_0x549f48[_0x4546('0x32')][_0x4546('0x37')]));_0x3eb8e8['attributes']=_0x3eb8e8['attributes'][_0x4546('0x38')]?_0x3eb8e8[_0x4546('0x35')]:_0x26fb3d[_0x4546('0x36')];if(!_0x549f48['query'][_0x4546('0x39')](_0x4546('0x3a'))){_0x3eb8e8[_0x4546('0x27')]=qs[_0x4546('0x27')](_0x549f48[_0x4546('0x32')][_0x4546('0x27')]);_0x3eb8e8[_0x4546('0x26')]=qs[_0x4546('0x26')](_0x549f48['query'][_0x4546('0x26')]);}_0x3eb8e8[_0x4546('0x3b')]=qs['sort'](_0x549f48['query'][_0x4546('0x3c')]);_0x3eb8e8[_0x4546('0x3d')]=qs[_0x4546('0x33')](_[_0x4546('0x3e')](_0x549f48[_0x4546('0x32')],_0x26fb3d['filters']));if(_0x549f48[_0x4546('0x32')][_0x4546('0x3f')]){_0x3eb8e8[_0x4546('0x3d')]=_[_0x4546('0x40')](_0x3eb8e8[_0x4546('0x3d')],{'$or':_[_0x4546('0x41')](_0x3ecd16,function(_0x3dad7e){if(_0x3dad7e[_0x4546('0x42')][_0x4546('0x43')]!=='VIRTUAL'){var _0x270f59={};_0x270f59[_0x3dad7e[_0x4546('0x44')]]={'$like':'%'+_0x549f48[_0x4546('0x32')][_0x4546('0x3f')]+'%'};return _0x270f59;}})});}_0x3eb8e8=_[_0x4546('0x40')]({},_0x3eb8e8,_0x549f48[_0x4546('0x45')]);var _0x214398={'where':_0x3eb8e8[_0x4546('0x3d')]};return db[_0x4546('0x30')][_0x4546('0x25')](_0x214398)[_0x4546('0x2a')](function(_0x524702){_0x56049d[_0x4546('0x25')]=_0x524702;if(_0x549f48[_0x4546('0x32')]['includeAll']){_0x3eb8e8[_0x4546('0x46')]=[{'all':!![]}];}return db[_0x4546('0x30')][_0x4546('0x47')](_0x3eb8e8);})['then'](function(_0x23f4f4){_0x56049d[_0x4546('0x48')]=_0x23f4f4;return _0x56049d;})[_0x4546('0x2a')](respondWithFilteredResult(_0x5749b0,_0x3eb8e8))[_0x4546('0x21')](handleError(_0x5749b0,null));};exports[_0x4546('0x49')]=function(_0x15816c,_0x3e8ebd){var _0x3343c0={'raw':![],'where':{'id':_0x15816c[_0x4546('0x4a')]['id']}},_0x661b14={};_0x661b14['model']=_[_0x4546('0x31')](db[_0x4546('0x30')]['rawAttributes']);_0x661b14[_0x4546('0x32')]=_[_0x4546('0x31')](_0x15816c[_0x4546('0x32')]);_0x661b14[_0x4546('0x33')]=_['intersection'](_0x661b14[_0x4546('0x36')],_0x661b14['query']);_0x3343c0[_0x4546('0x35')]=_[_0x4546('0x34')](_0x661b14[_0x4546('0x36')],qs['fields'](_0x15816c[_0x4546('0x32')][_0x4546('0x37')]));_0x3343c0[_0x4546('0x35')]=_0x3343c0[_0x4546('0x35')][_0x4546('0x38')]?_0x3343c0[_0x4546('0x35')]:_0x661b14[_0x4546('0x36')];if(_0x15816c[_0x4546('0x32')][_0x4546('0x4b')]){_0x3343c0[_0x4546('0x46')]=[{'all':!![]}];}_0x3343c0=_[_0x4546('0x40')]({},_0x3343c0,_0x15816c['options']);return db[_0x4546('0x30')][_0x4546('0x4c')](_0x3343c0)['then'](handleEntityNotFound(_0x3e8ebd,null))[_0x4546('0x2a')](respondWithResult(_0x3e8ebd,null))[_0x4546('0x21')](handleError(_0x3e8ebd,null));};exports[_0x4546('0x4d')]=function(_0x4ca3a6,_0x422ebc){return db[_0x4546('0x30')][_0x4546('0x4d')](_0x4ca3a6[_0x4546('0x4e')],{})[_0x4546('0x2a')](respondWithResult(_0x422ebc,0xc9))[_0x4546('0x21')](handleError(_0x422ebc,null));};exports[_0x4546('0x4f')]=function(_0x3c36b2,_0x50c2df){if(_0x3c36b2[_0x4546('0x4e')]['id']){delete _0x3c36b2[_0x4546('0x4e')]['id'];}return db[_0x4546('0x30')][_0x4546('0x4c')]({'where':{'id':_0x3c36b2[_0x4546('0x4a')]['id']}})[_0x4546('0x2a')](handleEntityNotFound(_0x50c2df,null))[_0x4546('0x2a')](saveUpdates(_0x3c36b2['body'],null))[_0x4546('0x2a')](respondWithResult(_0x50c2df,null))[_0x4546('0x21')](handleError(_0x50c2df,null));};exports['destroy']=function(_0x203275,_0x1485e8){return db[_0x4546('0x30')][_0x4546('0x4c')]({'where':{'id':_0x203275['params']['id']}})[_0x4546('0x2a')](handleEntityNotFound(_0x1485e8,null))[_0x4546('0x2a')](removeEntity(_0x1485e8,null))[_0x4546('0x21')](handleError(_0x1485e8,null));};exports[_0x4546('0x50')]=function(_0x49a106,_0x420954,_0x411e55){var _0x1765e0={};var _0x3406e9={};var _0xcf682c;var _0x67f40d;return db['ServicenowAccount'][_0x4546('0x51')]({'where':{'id':_0x49a106[_0x4546('0x4a')]['id']}})[_0x4546('0x2a')](handleEntityNotFound(_0x420954,null))[_0x4546('0x2a')](function(_0x4890b4){if(_0x4890b4){_0xcf682c=_0x4890b4;_0x3406e9[_0x4546('0x36')]=_['keys'](db[_0x4546('0x52')][_0x4546('0x53')]);_0x3406e9[_0x4546('0x32')]=_[_0x4546('0x31')](_0x49a106[_0x4546('0x32')]);_0x3406e9['filters']=_[_0x4546('0x34')](_0x3406e9['model'],_0x3406e9[_0x4546('0x32')]);_0x1765e0['attributes']=_['intersection'](_0x3406e9['model'],qs[_0x4546('0x37')](_0x49a106['query'][_0x4546('0x37')]));_0x1765e0[_0x4546('0x35')]=_0x1765e0[_0x4546('0x35')][_0x4546('0x38')]?_0x1765e0['attributes']:_0x3406e9[_0x4546('0x36')];_0x1765e0[_0x4546('0x3b')]=qs[_0x4546('0x3c')](_0x49a106[_0x4546('0x32')][_0x4546('0x3c')]);_0x1765e0['where']=qs[_0x4546('0x33')](_[_0x4546('0x3e')](_0x49a106[_0x4546('0x32')],_0x3406e9['filters']));if(_0x49a106[_0x4546('0x32')][_0x4546('0x3f')]){_0x1765e0[_0x4546('0x3d')]=_['merge'](_0x1765e0[_0x4546('0x3d')],{'$or':_[_0x4546('0x41')](_0x1765e0[_0x4546('0x35')],function(_0x220259){var _0x203103={};_0x203103[_0x220259]={'$like':'%'+_0x49a106[_0x4546('0x32')][_0x4546('0x3f')]+'%'};return _0x203103;})});}_0x1765e0=_[_0x4546('0x40')]({},_0x1765e0,_0x49a106['options']);return _0xcf682c[_0x4546('0x50')](_0x1765e0);}})[_0x4546('0x2a')](function(_0x2b61c9){if(_0x2b61c9){_0x67f40d=_0x2b61c9[_0x4546('0x38')];if(!_0x49a106[_0x4546('0x32')][_0x4546('0x39')](_0x4546('0x3a'))){_0x1765e0[_0x4546('0x27')]=qs[_0x4546('0x27')](_0x49a106[_0x4546('0x32')][_0x4546('0x27')]);_0x1765e0[_0x4546('0x26')]=qs[_0x4546('0x26')](_0x49a106[_0x4546('0x32')][_0x4546('0x26')]);}return _0xcf682c['getConfigurations'](_0x1765e0);}})[_0x4546('0x2a')](function(_0x47f1ab){if(_0x47f1ab){return _0x47f1ab?{'count':_0x67f40d,'rows':_0x47f1ab}:null;}})[_0x4546('0x2a')](respondWithResult(_0x420954,null))[_0x4546('0x21')](handleError(_0x420954,null));};exports['addConfiguration']=function(_0x314afc,_0x335881,_0x27680b){if(_0x314afc[_0x4546('0x4e')]['id']){delete _0x314afc[_0x4546('0x4e')]['id'];}return db[_0x4546('0x30')][_0x4546('0x51')]({'where':{'id':_0x314afc[_0x4546('0x4a')]['id']}})[_0x4546('0x2a')](handleEntityNotFound(_0x335881,null))[_0x4546('0x2a')](function(_0x1aa678){if(_0x1aa678){_0x314afc[_0x4546('0x4e')][_0x4546('0x54')]=_0x1aa678['id'];_0x314afc['body'][_0x4546('0x55')]=integrations[_0x4546('0x56')](_0x314afc[_0x4546('0x4e')]['channel'],_0x314afc[_0x4546('0x4e')][_0x4546('0x42')]);_0x314afc[_0x4546('0x4e')][_0x4546('0x57')]=integrations[_0x4546('0x58')](_0x314afc[_0x4546('0x4e')][_0x4546('0x59')],_0x314afc['body'][_0x4546('0x42')]);return db[_0x4546('0x52')][_0x4546('0x4d')](_0x314afc['body'],{'include':[{'model':db['ServicenowField'],'as':_0x4546('0x55')},{'model':db[_0x4546('0x5a')],'as':'Descriptions'}]});}return null;})[_0x4546('0x2a')](respondWithResult(_0x335881,null))[_0x4546('0x21')](handleError(_0x335881,null));};exports[_0x4546('0x5b')]=function(_0x11e2e4,_0x5e17a2,_0x4551a8){var _0x2be477=[_0x4546('0x5c'),_0x4546('0x5d'),_0x4546('0x5e'),_0x4546('0x5f'),_0x4546('0x60'),_0x4546('0x61'),'incident_state',_0x4546('0x62'),_0x4546('0x63')];var _0x57c6ee=[_0x4546('0x64'),_0x4546('0x5c'),'caused_by',_0x4546('0x65'),_0x4546('0x66'),_0x4546('0x67'),'child_incidents',_0x4546('0x5d'),_0x4546('0x68'),_0x4546('0x69'),_0x4546('0x6a'),_0x4546('0x6b'),_0x4546('0x6c'),_0x4546('0x6d'),'sys_created_on','sys_domain',_0x4546('0x6e'),_0x4546('0x6f'),_0x4546('0x5e'),_0x4546('0x3b'),_0x4546('0x70'),_0x4546('0x71'),'cmdb_ci','delivery_plan',_0x4546('0x72'),_0x4546('0x73'),_0x4546('0x74'),_0x4546('0x75'),_0x4546('0x76'),_0x4546('0x77'),_0x4546('0x78'),_0x4546('0x79'),'expected_start',_0x4546('0x7a'),'business_duration',_0x4546('0x7b'),_0x4546('0x7c'),_0x4546('0x7d'),'resolved_at',_0x4546('0x7e'),_0x4546('0x7f'),_0x4546('0x5f'),_0x4546('0x80'),_0x4546('0x81'),_0x4546('0x60'),_0x4546('0x82'),_0x4546('0x83'),_0x4546('0x84'),_0x4546('0x85'),'business_stc',_0x4546('0x86'),_0x4546('0x87'),'calendar_duration',_0x4546('0x61'),_0x4546('0x88'),_0x4546('0x89'),_0x4546('0x8a'),'follow_up','parent_incident',_0x4546('0x8b'),_0x4546('0x8c'),_0x4546('0x8d'),_0x4546('0x8e'),_0x4546('0x8f'),'problem_id',_0x4546('0x90'),_0x4546('0x91'),_0x4546('0x92'),_0x4546('0x93'),_0x4546('0x62'),'comments',_0x4546('0x94'),'approval',_0x4546('0x95'),_0x4546('0x96'),_0x4546('0x97'),_0x4546('0x98'),_0x4546('0x99'),_0x4546('0x9a'),_0x4546('0x9b'),_0x4546('0x9c'),'location',_0x4546('0x63')];var _0x21c9fb='';var _0x353d63='';var _0x44bb63=[];var _0x3a0278='';var _0x51761d='';var _0x39fbe2=[];var _0x5a6a2e='';var _0x5afda4='';var _0x4c9e0b={};var _0x2c5155='';return db[_0x4546('0x30')][_0x4546('0x51')]({'where':{'id':_0x11e2e4[_0x4546('0x4a')]['id']},'attributes':['id',_0x4546('0x9d'),_0x4546('0x9e'),_0x4546('0x9f'),_0x4546('0xa0'),_0x4546('0xa1')]})[_0x4546('0x2a')](handleEntityNotFound(_0x5e17a2,null))['then'](function(_0x3b8888){if(_0x3b8888){_0x2c5155=_0x3b8888['remoteUri'];var _0x2c8509=_0x2c5155[_0x4546('0xa2')](-0x1);if(_0x2c8509==='/'){_0x2c5155=_0x2c5155[_0x4546('0xa3')](0x0,_0x2c5155[_0x4546('0xa4')](_0x2c8509));}_0x5afda4=util[_0x4546('0xa5')](_0x4546('0xa6'),_0x2c5155);_0x5a6a2e=util[_0x4546('0xa5')]('%s/api/now/table/',_0x2c5155);_0x4c9e0b={'user':_0x3b8888[_0x4546('0x9d')],'pass':_0x3b8888[_0x4546('0x9e')]};var _0x4c69d9={'method':_0x4546('0xa7'),'uri':_0x5afda4+_0x4546('0xa8'),'auth':_0x4c9e0b,'json':!![]};return rp(_0x4c69d9);}})[_0x4546('0x2a')](function(_0x235f2d){if(_0x235f2d[_0x4546('0xa9')][_0x4546('0x38')]>0x0){_0x21c9fb=_0x235f2d[_0x4546('0xa9')];}console[_0x4546('0xaa')](_0x4546('0xab'),_0x21c9fb);_0x39fbe2=[];_0x353d63=Object[_0x4546('0xac')]([],_0x21c9fb);_[_0x4546('0xad')](_0x353d63,function(_0x2ba11b){return!_0x2be477['includes'](_0x2ba11b[_0x4546('0x2d')]);});_0x353d63[_0x4546('0xae')](function(_0x4247db){var _0xb070c0=createFieldObject(_0x5a6a2e,_0x4c9e0b,_0x4247db[_0x4546('0xaf')],_0x4247db[_0x4546('0x2d')],_0x4247db[_0x4546('0xb0')],![]);_0x39fbe2[_0x4546('0xb1')](_0xb070c0);});return Promise[_0x4546('0xb2')](_0x39fbe2);})[_0x4546('0x2a')](function(_0x40dd19){_0x44bb63=_0x40dd19;_0x3a0278=Object[_0x4546('0xac')]([],_0x21c9fb);console[_0x4546('0xaa')](_0x4546('0xb3'),_0x21c9fb);_[_0x4546('0xad')](_0x3a0278,function(_0x2aa5c6){return _0x57c6ee[_0x4546('0xb4')](_0x2aa5c6[_0x4546('0x2d')]);});console[_0x4546('0xaa')](_0x4546('0xb5'),_0x3a0278);_0x39fbe2=[];_0x3a0278[_0x4546('0xae')](function(_0x47724b){var _0x21cb88=createFieldObject(_0x5a6a2e,_0x4c9e0b,_0x47724b['internalType'],_0x47724b['name'],_0x47724b[_0x4546('0xb0')],!![]);_0x39fbe2['push'](_0x21cb88);});return Promise[_0x4546('0xb2')](_0x39fbe2);})[_0x4546('0x2a')](function(_0x14f6a7){_0x51761d=_0x14f6a7;var _0x595808=_0x44bb63[_0x4546('0xb6')](_0x51761d);return{'count':_0x595808['length'],'rows':_0x595808};})['then'](respondWithResult(_0x5e17a2,null))[_0x4546('0x21')](function(_0x408293){console[_0x4546('0xaa')]('ServiceNow\x20error:\x20'+_0x408293);var _0x582e8a=_0x11e2e4[_0x4546('0x32')][_0x4546('0xb7')]?0x1f4:_0x408293['statusCode']||0x1f4;logger[_0x4546('0x1f')](_0x408293[_0x4546('0x2c')]);delete _0x408293[_0x4546('0x2d')];if(_0x582e8a===0x191){_0x582e8a=0x190;}_0x5e17a2[_0x4546('0x24')](_0x582e8a)[_0x4546('0x2e')](_0x11e2e4[_0x4546('0x32')][_0x4546('0xb7')]?{'message':'Wrong\x20credentials','statusCode':_0x408293[_0x4546('0xb8')]}:_0x408293);});};function createFieldObject(_0x4cc533,_0x2d02f3,_0x5a9311,_0x5130a4,_0x3d95e5,_0x4ceebf){return new Promise(function(_0x4aee1f,_0xb53087){var _0x2f5acc={'id':_0x5130a4,'name':_0x3d95e5,'custom':_0x4ceebf};if(_0x5a9311===_0x4546('0xb9')){_0x2f5acc[_0x4546('0x45')]=[{'name':_0x4546('0xba'),'value':_0x4546('0xbb')},{'name':_0x4546('0xbc'),'value':'false'}];_0x4aee1f(_0x2f5acc);}else{var _0xf459e4={'method':'GET','uri':_0x4cc533+_0x4546('0xbd')+_0x5130a4,'auth':_0x2d02f3,'json':!![]};return rp(_0xf459e4)[_0x4546('0x2a')](function(_0x24798b){var _0x34dcc1=[];if(_0x24798b[_0x4546('0xa9')][_0x4546('0x38')]>0x0){_0x24798b['result'][_0x4546('0xae')](function(_0x22a956){if(_0x22a956[_0x4546('0xbe')]===_0x4546('0xbf')){var _0x53c40c={'name':_0x22a956[_0x4546('0xb0')],'value':_0x22a956[_0x4546('0xc0')]};_0x34dcc1[_0x4546('0xb1')](_0x53c40c);}});}_0x2f5acc['options']=_0x34dcc1;if(_0x2f5acc['options']['length']>0x0){_0x4aee1f(_0x2f5acc);}else{if(_0x4ceebf==![]){_0x4aee1f();}else{_0x4aee1f(_0x2f5acc);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5e85d53..300f2c4 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 _0x118f=['bluebird','request-promise','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger'];(function(_0x230b8d,_0xc7bd){var _0x499932=function(_0x3aec13){while(--_0x3aec13){_0x230b8d['push'](_0x230b8d['shift']());}};_0x499932(++_0xc7bd);}(_0x118f,0x1f1));var _0xf118=function(_0x499185,_0x9342ce){_0x499185=_0x499185-0x0;var _0x232a15=_0x118f[_0x499185];return _0x232a15;};'use strict';var _=require(_0xf118('0x0'));var util=require(_0xf118('0x1'));var logger=require(_0xf118('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf118('0x3'));var rp=require(_0xf118('0x4'));var attributes=require(_0xf118('0x5'));var integrations=require(_0xf118('0x6'));module[_0xf118('0x7')]=function(_0x46a1b3,_0x90cbe4){return _0x46a1b3[_0xf118('0x8')]('ServicenowAccount',attributes,{'tableName':_0xf118('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4161=['util','moment','bluebird','request-promise','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x1bfa86,_0x4a8606){var _0x1bd346=function(_0x1a1135){while(--_0x1a1135){_0x1bfa86['push'](_0x1bfa86['shift']());}};_0x1bd346(++_0x4a8606);}(_0x4161,0x1d8));var _0x1416=function(_0x114fc7,_0x432cff){_0x114fc7=_0x114fc7-0x0;var _0x3673a2=_0x4161[_0x114fc7];return _0x3673a2;};'use strict';var _=require(_0x1416('0x0'));var util=require(_0x1416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1416('0x2'));var BPromise=require(_0x1416('0x3'));var rp=require(_0x1416('0x4'));var attributes=require(_0x1416('0x5'));var integrations=require(_0x1416('0x6'));module[_0x1416('0x7')]=function(_0x1c368e,_0x296c70){return _0x1c368e[_0x1416('0x8')](_0x1416('0x9'),attributes,{'tableName':_0x1416('0xa'),'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 1d2bc80..0821fb4 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 _0xf4f5=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ServicenowAccount','findAll','options','raw','limit','include','model','attributes','map','GetServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4fba44,_0x10e53c){var _0x1b87ec=function(_0x20015c){while(--_0x20015c){_0x4fba44['push'](_0x4fba44['shift']());}};_0x1b87ec(++_0x10e53c);}(_0xf4f5,0xc0));var _0x5f4f=function(_0x1053a1,_0x1da768){_0x1053a1=_0x1053a1-0x0;var _0x1cb87a=_0xf4f5[_0x1053a1];return _0x1cb87a;};'use strict';var _=require(_0x5f4f('0x0'));var util=require(_0x5f4f('0x1'));var moment=require(_0x5f4f('0x2'));var BPromise=require(_0x5f4f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f4f('0x4'));var db=require(_0x5f4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f4f('0x6'));var config=require(_0x5f4f('0x7'));var jayson=require(_0x5f4f('0x8'));var client=jayson[_0x5f4f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b2bc9,_0x557698,_0x348e22){return new BPromise(function(_0x5922ea,_0x4e57d2){return client[_0x5f4f('0xa')](_0x2b2bc9,_0x348e22)[_0x5f4f('0xb')](function(_0x3f1f64){logger['info'](_0x5f4f('0xc'),_0x557698,_0x5f4f('0xd'));logger[_0x5f4f('0xe')](_0x5f4f('0xf'),_0x557698,'request\x20sent',JSON[_0x5f4f('0x10')](_0x3f1f64));if(_0x3f1f64[_0x5f4f('0x11')]){if(_0x3f1f64[_0x5f4f('0x11')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x557698,_0x3f1f64[_0x5f4f('0x11')][_0x5f4f('0x12')]);return _0x4e57d2(_0x3f1f64['error'][_0x5f4f('0x12')]);}logger['error'](_0x5f4f('0xc'),_0x557698,_0x3f1f64[_0x5f4f('0x11')][_0x5f4f('0x12')]);return _0x5922ea(_0x3f1f64[_0x5f4f('0x11')][_0x5f4f('0x12')]);}else{logger[_0x5f4f('0x13')](_0x5f4f('0xc'),_0x557698,_0x5f4f('0xd'));_0x5922ea(_0x3f1f64[_0x5f4f('0x14')]['message']);}})[_0x5f4f('0x15')](function(_0xbdaa84){logger[_0x5f4f('0x11')](_0x5f4f('0xc'),_0x557698,_0xbdaa84);_0x4e57d2(_0xbdaa84);});});}exports['GetServicenowAccount']=function(_0x578b04){var _0x15fc95=this;return new Promise(function(_0x78a490,_0x3d7183){return db[_0x5f4f('0x16')][_0x5f4f('0x17')]({'raw':_0x578b04[_0x5f4f('0x18')]?_0x578b04['options'][_0x5f4f('0x19')]===undefined?!![]:![]:!![],'where':_0x578b04['options']?_0x578b04['options']['where']||null:null,'attributes':_0x578b04[_0x5f4f('0x18')]?_0x578b04[_0x5f4f('0x18')]['attributes']||null:null,'limit':_0x578b04[_0x5f4f('0x18')]?_0x578b04['options'][_0x5f4f('0x1a')]||null:null,'include':_0x578b04[_0x5f4f('0x18')]?_0x578b04[_0x5f4f('0x18')][_0x5f4f('0x1b')]?_['map'](_0x578b04[_0x5f4f('0x18')][_0x5f4f('0x1b')],function(_0x26e841){return{'model':db[_0x26e841[_0x5f4f('0x1c')]],'as':_0x26e841['as'],'attributes':_0x26e841[_0x5f4f('0x1d')],'include':_0x26e841[_0x5f4f('0x1b')]?_['map'](_0x26e841[_0x5f4f('0x1b')],function(_0x3243e8){return{'model':db[_0x3243e8['model']],'as':_0x3243e8['as'],'attributes':_0x3243e8[_0x5f4f('0x1d')],'include':_0x3243e8[_0x5f4f('0x1b')]?_[_0x5f4f('0x1e')](_0x3243e8['include'],function(_0x145f8d){return{'model':db[_0x145f8d[_0x5f4f('0x1c')]],'as':_0x145f8d['as'],'attributes':_0x145f8d[_0x5f4f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5f4f('0xb')](function(_0x5e7d35){logger[_0x5f4f('0x13')](_0x5f4f('0x1f'),_0x578b04);logger['debug'](_0x5f4f('0x1f'),_0x578b04,JSON['stringify'](_0x5e7d35));_0x78a490(_0x5e7d35);})['catch'](function(_0x3d9f29){logger[_0x5f4f('0x11')](_0x5f4f('0x1f'),_0x3d9f29[_0x5f4f('0x12')],_0x578b04);_0x3d7183(_0x15fc95[_0x5f4f('0x11')](0x1f4,_0x3d9f29['message']));});});};exports['ShowServicenowAccount']=function(_0x3f08ce){var _0x29c8c8=this;return new Promise(function(_0x2706bc,_0x2c7f90){return db[_0x5f4f('0x16')][_0x5f4f('0x20')]({'raw':_0x3f08ce[_0x5f4f('0x18')]?_0x3f08ce[_0x5f4f('0x18')][_0x5f4f('0x19')]===undefined?!![]:![]:!![],'where':_0x3f08ce[_0x5f4f('0x18')]?_0x3f08ce[_0x5f4f('0x18')]['where']||null:null,'attributes':_0x3f08ce[_0x5f4f('0x18')]?_0x3f08ce[_0x5f4f('0x18')][_0x5f4f('0x1d')]||null:null,'include':_0x3f08ce[_0x5f4f('0x18')]?_0x3f08ce[_0x5f4f('0x18')][_0x5f4f('0x1b')]?_[_0x5f4f('0x1e')](_0x3f08ce[_0x5f4f('0x18')][_0x5f4f('0x1b')],function(_0x501181){return{'model':db[_0x501181['model']],'as':_0x501181['as'],'attributes':_0x501181[_0x5f4f('0x1d')],'include':_0x501181['include']?_[_0x5f4f('0x1e')](_0x501181['include'],function(_0x5b3f7a){return{'model':db[_0x5b3f7a[_0x5f4f('0x1c')]],'as':_0x5b3f7a['as'],'attributes':_0x5b3f7a[_0x5f4f('0x1d')],'include':_0x5b3f7a[_0x5f4f('0x1b')]?_['map'](_0x5b3f7a[_0x5f4f('0x1b')],function(_0x48d378){return{'model':db[_0x48d378['model']],'as':_0x48d378['as'],'attributes':_0x48d378['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1669fe){logger[_0x5f4f('0x13')](_0x5f4f('0x21'),_0x3f08ce);logger[_0x5f4f('0xe')](_0x5f4f('0x21'),_0x3f08ce,JSON['stringify'](_0x1669fe));_0x2706bc(_0x1669fe);})['catch'](function(_0x57b8c2){logger[_0x5f4f('0x11')](_0x5f4f('0x21'),_0x57b8c2['message'],_0x3f08ce);_0x2c7f90(_0x29c8c8[_0x5f4f('0x11')](0x1f4,_0x57b8c2[_0x5f4f('0x12')]));});});}; \ No newline at end of file +var _0xb2bb=['message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','limit','include','map','attributes','then','stringify','find','raw','model','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1a0c2a,_0x104eb9){var _0xdcf933=function(_0x29ec51){while(--_0x29ec51){_0x1a0c2a['push'](_0x1a0c2a['shift']());}};_0xdcf933(++_0x104eb9);}(_0xb2bb,0x17b));var _0xbb2b=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xb2bb[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xbb2b('0x0'));var util=require(_0xbb2b('0x1'));var moment=require(_0xbb2b('0x2'));var BPromise=require(_0xbb2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb2b('0x5'));var logger=require(_0xbb2b('0x6'))('rpc');var config=require(_0xbb2b('0x7'));var jayson=require(_0xbb2b('0x8'));var client=jayson[_0xbb2b('0x9')][_0xbb2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a410d,_0x15f8e6,_0x1bbd53){return new BPromise(function(_0x5e6730,_0xd59b24){return client['request'](_0x4a410d,_0x1bbd53)['then'](function(_0x214f62){logger['info'](_0xbb2b('0xb'),_0x15f8e6,_0xbb2b('0xc'));logger[_0xbb2b('0xd')](_0xbb2b('0xe'),_0x15f8e6,'request\x20sent',JSON['stringify'](_0x214f62));if(_0x214f62[_0xbb2b('0xf')]){if(_0x214f62[_0xbb2b('0xf')][_0xbb2b('0x10')]===0x1f4){logger[_0xbb2b('0xf')](_0xbb2b('0xb'),_0x15f8e6,_0x214f62[_0xbb2b('0xf')][_0xbb2b('0x11')]);return _0xd59b24(_0x214f62[_0xbb2b('0xf')][_0xbb2b('0x11')]);}logger[_0xbb2b('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x15f8e6,_0x214f62[_0xbb2b('0xf')]['message']);return _0x5e6730(_0x214f62['error'][_0xbb2b('0x11')]);}else{logger[_0xbb2b('0x12')](_0xbb2b('0xb'),_0x15f8e6,'request\x20sent');_0x5e6730(_0x214f62[_0xbb2b('0x13')][_0xbb2b('0x11')]);}})[_0xbb2b('0x14')](function(_0xe148bd){logger[_0xbb2b('0xf')](_0xbb2b('0xb'),_0x15f8e6,_0xe148bd);_0xd59b24(_0xe148bd);});});}exports[_0xbb2b('0x15')]=function(_0x37e14d){var _0x46231f=this;return new Promise(function(_0x377d18,_0x1618c8){return db[_0xbb2b('0x16')][_0xbb2b('0x17')]({'raw':_0x37e14d['options']?_0x37e14d[_0xbb2b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x37e14d[_0xbb2b('0x18')]?_0x37e14d[_0xbb2b('0x18')][_0xbb2b('0x19')]||null:null,'attributes':_0x37e14d[_0xbb2b('0x18')]?_0x37e14d[_0xbb2b('0x18')]['attributes']||null:null,'limit':_0x37e14d[_0xbb2b('0x18')]?_0x37e14d[_0xbb2b('0x18')][_0xbb2b('0x1a')]||null:null,'include':_0x37e14d[_0xbb2b('0x18')]?_0x37e14d[_0xbb2b('0x18')][_0xbb2b('0x1b')]?_['map'](_0x37e14d['options']['include'],function(_0x4741be){return{'model':db[_0x4741be['model']],'as':_0x4741be['as'],'attributes':_0x4741be['attributes'],'include':_0x4741be['include']?_[_0xbb2b('0x1c')](_0x4741be['include'],function(_0x37f512){return{'model':db[_0x37f512['model']],'as':_0x37f512['as'],'attributes':_0x37f512[_0xbb2b('0x1d')],'include':_0x37f512[_0xbb2b('0x1b')]?_[_0xbb2b('0x1c')](_0x37f512[_0xbb2b('0x1b')],function(_0xb75649){return{'model':db[_0xb75649['model']],'as':_0xb75649['as'],'attributes':_0xb75649[_0xbb2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb2b('0x1e')](function(_0xc2b390){logger[_0xbb2b('0x12')](_0xbb2b('0x15'),_0x37e14d);logger[_0xbb2b('0xd')](_0xbb2b('0x15'),_0x37e14d,JSON[_0xbb2b('0x1f')](_0xc2b390));_0x377d18(_0xc2b390);})['catch'](function(_0x2d2c89){logger[_0xbb2b('0xf')](_0xbb2b('0x15'),_0x2d2c89['message'],_0x37e14d);_0x1618c8(_0x46231f['error'](0x1f4,_0x2d2c89[_0xbb2b('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x577249){var _0x360b74=this;return new Promise(function(_0x1133dc,_0x3d61ff){return db[_0xbb2b('0x16')][_0xbb2b('0x20')]({'raw':_0x577249[_0xbb2b('0x18')]?_0x577249[_0xbb2b('0x18')][_0xbb2b('0x21')]===undefined?!![]:![]:!![],'where':_0x577249[_0xbb2b('0x18')]?_0x577249[_0xbb2b('0x18')][_0xbb2b('0x19')]||null:null,'attributes':_0x577249[_0xbb2b('0x18')]?_0x577249['options'][_0xbb2b('0x1d')]||null:null,'include':_0x577249[_0xbb2b('0x18')]?_0x577249['options'][_0xbb2b('0x1b')]?_[_0xbb2b('0x1c')](_0x577249[_0xbb2b('0x18')]['include'],function(_0x4f21fd){return{'model':db[_0x4f21fd[_0xbb2b('0x22')]],'as':_0x4f21fd['as'],'attributes':_0x4f21fd[_0xbb2b('0x1d')],'include':_0x4f21fd['include']?_[_0xbb2b('0x1c')](_0x4f21fd['include'],function(_0x3de7aa){return{'model':db[_0x3de7aa[_0xbb2b('0x22')]],'as':_0x3de7aa['as'],'attributes':_0x3de7aa[_0xbb2b('0x1d')],'include':_0x3de7aa['include']?_[_0xbb2b('0x1c')](_0x3de7aa[_0xbb2b('0x1b')],function(_0x24204a){return{'model':db[_0x24204a[_0xbb2b('0x22')]],'as':_0x24204a['as'],'attributes':_0x24204a[_0xbb2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb2b('0x1e')](function(_0x41169d){logger[_0xbb2b('0x12')](_0xbb2b('0x23'),_0x577249);logger[_0xbb2b('0xd')](_0xbb2b('0x23'),_0x577249,JSON[_0xbb2b('0x1f')](_0x41169d));_0x1133dc(_0x41169d);})['catch'](function(_0x2d0ad7){logger['error']('ShowServicenowAccount',_0x2d0ad7[_0xbb2b('0x11')],_0x577249);_0x3d61ff(_0x360b74[_0xbb2b('0xf')](0x1f4,_0x2d0ad7[_0xbb2b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b82d256..939f7af 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 _0x83bf=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x27ad09,_0x49fc53){var _0xd80b27=function(_0x148139){while(--_0x148139){_0x27ad09['push'](_0x27ad09['shift']());}};_0xd80b27(++_0x49fc53);}(_0x83bf,0x87));var _0xf83b=function(_0x1d0a88,_0x4f873a){_0x1d0a88=_0x1d0a88-0x0;var _0x4e0cd1=_0x83bf[_0x1d0a88];return _0x4e0cd1;};'use strict';var multer=require(_0xf83b('0x0'));var util=require(_0xf83b('0x1'));var path=require(_0xf83b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf83b('0x3')]();var auth=require(_0xf83b('0x4'));var interaction=require(_0xf83b('0x5'));var config=require(_0xf83b('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0xf83b('0x7')]('/',auth[_0xf83b('0x8')](),controller[_0xf83b('0x9')]);router['get'](_0xf83b('0xa'),auth['isAuthenticated'](),controller[_0xf83b('0xb')]);router['get'](_0xf83b('0xc'),auth[_0xf83b('0x8')](),controller[_0xf83b('0xd')]);router[_0xf83b('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xf83b('0xe')]);router[_0xf83b('0x7')](_0xf83b('0xf'),auth[_0xf83b('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0xf83b('0x8')](),controller['create']);router[_0xf83b('0x10')](_0xf83b('0xa'),auth[_0xf83b('0x8')](),controller[_0xf83b('0x11')]);router[_0xf83b('0x12')]('/:id',auth[_0xf83b('0x8')](),controller[_0xf83b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6269=['/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','/:id','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show'];(function(_0x1db28f,_0x4b9c82){var _0x40ef3b=function(_0x4ac206){while(--_0x4ac206){_0x1db28f['push'](_0x1db28f['shift']());}};_0x40ef3b(++_0x4b9c82);}(_0x6269,0x128));var _0x9626=function(_0x4019f6,_0x1493a0){_0x4019f6=_0x4019f6-0x0;var _0x2e9cb6=_0x6269[_0x4019f6];return _0x2e9cb6;};'use strict';var multer=require(_0x9626('0x0'));var util=require(_0x9626('0x1'));var path=require(_0x9626('0x2'));var timeout=require('connect-timeout');var express=require(_0x9626('0x3'));var router=express[_0x9626('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9626('0x5'));var config=require(_0x9626('0x6'));var controller=require(_0x9626('0x7'));router['get']('/',auth[_0x9626('0x8')](),controller[_0x9626('0x9')]);router[_0x9626('0xa')]('/:id',auth[_0x9626('0x8')](),controller[_0x9626('0xb')]);router['get'](_0x9626('0xc'),auth['isAuthenticated'](),controller[_0x9626('0xd')]);router['get']('/:id/subjects',auth[_0x9626('0x8')](),controller[_0x9626('0xe')]);router['get']('/:id/descriptions',auth[_0x9626('0x8')](),controller[_0x9626('0xf')]);router[_0x9626('0x10')]('/',auth[_0x9626('0x8')](),controller[_0x9626('0x11')]);router[_0x9626('0x12')](_0x9626('0x13'),auth[_0x9626('0x8')](),controller[_0x9626('0x14')]);router['delete'](_0x9626('0x13'),auth[_0x9626('0x8')](),controller['destroy']);module[_0x9626('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 9ab0873..28522bb 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 _0x323f=['STRING','sequelize','exports'];(function(_0x26a44e,_0x18c43f){var _0x566fc4=function(_0x1fd0cb){while(--_0x1fd0cb){_0x26a44e['push'](_0x26a44e['shift']());}};_0x566fc4(++_0x18c43f);}(_0x323f,0x1e4));var _0xf323=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x323f[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xf323('0x0'));module[_0xf323('0x1')]={'name':{'type':Sequelize[_0xf323('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7529=['sequelize','STRING'];(function(_0x540533,_0x4033a3){var _0x4791f0=function(_0x2b9947){while(--_0x2b9947){_0x540533['push'](_0x540533['shift']());}};_0x4791f0(++_0x4033a3);}(_0x7529,0x78));var _0x9752=function(_0x5f01b0,_0x245d50){_0x5f01b0=_0x5f01b0-0x0;var _0x27b990=_0x7529[_0x5f01b0];return _0x27b990;};'use strict';var Sequelize=require(_0x9752('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9752('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a38fecc..6d89e69 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 _0x0bb5=['count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','ServicenowConfiguration','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','getFields','findOne','ServicenowField','length','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json'];(function(_0x508024,_0x479dad){var _0x1c749b=function(_0x175d2a){while(--_0x175d2a){_0x508024['push'](_0x508024['shift']());}};_0x1c749b(++_0x479dad);}(_0x0bb5,0x148));var _0x50bb=function(_0x3b2def,_0x4b6cb){_0x3b2def=_0x3b2def-0x0;var _0x3a6c51=_0x0bb5[_0x3b2def];return _0x3a6c51;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var authService=require(_0x50bb('0x10'));var hardwareService=require(_0x50bb('0x11'));var Redis=require('ioredis');var qs=require(_0x50bb('0x12'));var logger=require(_0x50bb('0x13'))(_0x50bb('0x14'));var utils=require(_0x50bb('0x15'));var config=require(_0x50bb('0x16'));var db=require(_0x50bb('0x17'))['db'];var jayson=require(_0x50bb('0x18'));var client=jayson['client'][_0x50bb('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x58837d,_0x283f04,_0xd8ab27,_0x155864){return new BPromise(function(_0x502250,_0x17007f){var _0x309986=_0x155864||client;return _0x309986[_0x50bb('0x1a')](_0x58837d,_0xd8ab27)['then'](function(_0xbbc6a0){logger['info'](_0x50bb('0x1b'),_0x283f04,_0x50bb('0x1c'));logger[_0x50bb('0x1d')](_0x50bb('0x1e'),_0x283f04,_0x50bb('0x1c'),JSON['stringify'](_0xbbc6a0));if(_0xbbc6a0[_0x50bb('0x1f')]){if(_0xbbc6a0[_0x50bb('0x1f')]['code']===0x1f4){logger[_0x50bb('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x283f04,_0xbbc6a0[_0x50bb('0x1f')][_0x50bb('0x20')]);return _0x17007f(_0xbbc6a0['error']['message']);}logger[_0x50bb('0x1f')](_0x50bb('0x1b'),_0x283f04,_0xbbc6a0[_0x50bb('0x1f')][_0x50bb('0x20')]);return _0x502250(_0xbbc6a0['error'][_0x50bb('0x20')]);}else{logger[_0x50bb('0x21')](_0x50bb('0x1b'),_0x283f04,'request\x20sent');_0x502250(_0xbbc6a0[_0x50bb('0x22')][_0x50bb('0x20')]);}})[_0x50bb('0x23')](function(_0x4825f8){logger[_0x50bb('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x283f04,_0x4825f8);_0x17007f(_0x4825f8);});});}function respondWithStatusCode(_0x1c81a1,_0x3391da){_0x3391da=_0x3391da||0xcc;return function(_0x1a2a0b){if(_0x1a2a0b){return _0x1c81a1[_0x50bb('0x24')](_0x3391da);}return _0x1c81a1[_0x50bb('0x25')](_0x3391da)[_0x50bb('0x26')]();};}function respondWithResult(_0x4f7f73,_0xad17ac){_0xad17ac=_0xad17ac||0xc8;return function(_0xee0af0){if(_0xee0af0){return _0x4f7f73[_0x50bb('0x25')](_0xad17ac)[_0x50bb('0x27')](_0xee0af0);}};}function respondWithFilteredResult(_0x5234d7,_0x75fea6){return function(_0x4d38f7){if(_0x4d38f7){var _0x55e87b=_0x4d38f7[_0x50bb('0x28')],_0x2befd9=_0x75fea6[_0x50bb('0x29')],_0x491632=_0x75fea6[_0x50bb('0x29')]+_0x75fea6[_0x50bb('0x2a')],_0x5cfe4b;if(_0x491632>=_0x55e87b){_0x491632=_0x55e87b;_0x5cfe4b=0xc8;}else{_0x5cfe4b=0xce;}_0x5234d7[_0x50bb('0x25')](_0x5cfe4b);return _0x5234d7[_0x50bb('0x2b')](_0x50bb('0x2c'),_0x2befd9+'-'+_0x491632+'/'+_0x55e87b)[_0x50bb('0x27')](_0x4d38f7);}return null;};}function patchUpdates(_0x4f7514){return function(_0x44ce86){try{jsonpatch[_0x50bb('0x2d')](_0x44ce86,_0x4f7514,!![]);}catch(_0x15ee2e){return BPromise[_0x50bb('0x2e')](_0x15ee2e);}return _0x44ce86['save']();};}function saveUpdates(_0x13dc3c,_0x1a62fb){return function(_0xc38da5){if(_0xc38da5){return _0xc38da5[_0x50bb('0x2f')](_0x13dc3c)[_0x50bb('0x30')](function(_0x3b0374){return _0x3b0374;});}return null;};}function removeEntity(_0x51aa81,_0x3b33b9){return function(_0x5cfdd5){if(_0x5cfdd5){return _0x5cfdd5[_0x50bb('0x31')]()[_0x50bb('0x30')](function(){_0x51aa81[_0x50bb('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae66c,_0x3bad07){return function(_0x3f4d8e){if(!_0x3f4d8e){_0x1ae66c[_0x50bb('0x24')](0x194);}return _0x3f4d8e;};}function handleError(_0x2bea60,_0x2db122){_0x2db122=_0x2db122||0x1f4;return function(_0x3fa742){logger[_0x50bb('0x1f')](_0x3fa742[_0x50bb('0x32')]);if(_0x3fa742[_0x50bb('0x33')]){delete _0x3fa742[_0x50bb('0x33')];}_0x2bea60['status'](_0x2db122)[_0x50bb('0x34')](_0x3fa742);};}exports[_0x50bb('0x35')]=function(_0x20a097,_0x2bfb54){var _0x1faced={},_0x3eb8a8={},_0x53600a={'count':0x0,'rows':[]};var _0x527b4a=db[_0x50bb('0x36')]['rawAttributes'];_0x3eb8a8[_0x50bb('0x37')]=_[_0x50bb('0x38')](_0x527b4a);_0x3eb8a8[_0x50bb('0x39')]=_[_0x50bb('0x38')](_0x20a097[_0x50bb('0x39')]);_0x3eb8a8['filters']=_[_0x50bb('0x3a')](_0x3eb8a8['model'],_0x3eb8a8[_0x50bb('0x39')]);_0x1faced[_0x50bb('0x3b')]=_[_0x50bb('0x3a')](_0x3eb8a8['model'],qs['fields'](_0x20a097[_0x50bb('0x39')][_0x50bb('0x3c')]));_0x1faced[_0x50bb('0x3b')]=_0x1faced[_0x50bb('0x3b')]['length']?_0x1faced[_0x50bb('0x3b')]:_0x3eb8a8['model'];if(!_0x20a097['query'][_0x50bb('0x3d')]('nolimit')){_0x1faced[_0x50bb('0x2a')]=qs[_0x50bb('0x2a')](_0x20a097[_0x50bb('0x39')][_0x50bb('0x2a')]);_0x1faced[_0x50bb('0x29')]=qs[_0x50bb('0x29')](_0x20a097[_0x50bb('0x39')][_0x50bb('0x29')]);}_0x1faced[_0x50bb('0x3e')]=qs[_0x50bb('0x3f')](_0x20a097['query']['sort']);_0x1faced[_0x50bb('0x40')]=qs[_0x50bb('0x41')](_[_0x50bb('0x42')](_0x20a097[_0x50bb('0x39')],_0x3eb8a8['filters']));if(_0x20a097[_0x50bb('0x39')]['filter']){_0x1faced[_0x50bb('0x40')]=_[_0x50bb('0x43')](_0x1faced[_0x50bb('0x40')],{'$or':_[_0x50bb('0x44')](_0x527b4a,function(_0x1c438b){if(_0x1c438b[_0x50bb('0x45')][_0x50bb('0x46')]!==_0x50bb('0x47')){var _0x425632={};_0x425632[_0x1c438b[_0x50bb('0x48')]]={'$like':'%'+_0x20a097[_0x50bb('0x39')][_0x50bb('0x49')]+'%'};return _0x425632;}})});}_0x1faced=_[_0x50bb('0x43')]({},_0x1faced,_0x20a097[_0x50bb('0x4a')]);var _0x2f27d3={'where':_0x1faced[_0x50bb('0x40')]};return db['ServicenowConfiguration'][_0x50bb('0x28')](_0x2f27d3)['then'](function(_0x2a87c1){_0x53600a[_0x50bb('0x28')]=_0x2a87c1;if(_0x20a097[_0x50bb('0x39')][_0x50bb('0x4b')]){_0x1faced[_0x50bb('0x4c')]=[{'all':!![]}];}return db[_0x50bb('0x36')][_0x50bb('0x4d')](_0x1faced);})[_0x50bb('0x30')](function(_0x3ecec7){_0x53600a[_0x50bb('0x4e')]=_0x3ecec7;return _0x53600a;})[_0x50bb('0x30')](respondWithFilteredResult(_0x2bfb54,_0x1faced))[_0x50bb('0x23')](handleError(_0x2bfb54,null));};exports[_0x50bb('0x4f')]=function(_0x457bb4,_0x5880df){var _0x3eb429={'raw':![],'where':{'id':_0x457bb4[_0x50bb('0x50')]['id']}},_0x4e545f={};_0x4e545f[_0x50bb('0x37')]=_[_0x50bb('0x38')](db[_0x50bb('0x36')][_0x50bb('0x51')]);_0x4e545f[_0x50bb('0x39')]=_[_0x50bb('0x38')](_0x457bb4[_0x50bb('0x39')]);_0x4e545f['filters']=_[_0x50bb('0x3a')](_0x4e545f[_0x50bb('0x37')],_0x4e545f[_0x50bb('0x39')]);_0x3eb429[_0x50bb('0x3b')]=_[_0x50bb('0x3a')](_0x4e545f['model'],qs[_0x50bb('0x3c')](_0x457bb4[_0x50bb('0x39')][_0x50bb('0x3c')]));_0x3eb429[_0x50bb('0x3b')]=_0x3eb429[_0x50bb('0x3b')]['length']?_0x3eb429['attributes']:_0x4e545f[_0x50bb('0x37')];if(_0x457bb4['query'][_0x50bb('0x4b')]){_0x3eb429['include']=[{'all':!![]}];}_0x3eb429=_[_0x50bb('0x43')]({},_0x3eb429,_0x457bb4[_0x50bb('0x4a')]);return db[_0x50bb('0x36')]['find'](_0x3eb429)[_0x50bb('0x30')](handleEntityNotFound(_0x5880df,null))[_0x50bb('0x30')](respondWithResult(_0x5880df,null))['catch'](handleError(_0x5880df,null));};exports[_0x50bb('0x52')]=function(_0x1dff6a,_0x8d62af){return db[_0x50bb('0x36')]['create'](_0x1dff6a[_0x50bb('0x53')],{})[_0x50bb('0x30')](respondWithResult(_0x8d62af,0xc9))[_0x50bb('0x23')](handleError(_0x8d62af,null));};exports[_0x50bb('0x2f')]=function(_0x12bb89,_0x5e61fe){if(_0x12bb89[_0x50bb('0x53')]['id']){delete _0x12bb89['body']['id'];}return db[_0x50bb('0x36')]['find']({'where':{'id':_0x12bb89['params']['id']}})[_0x50bb('0x30')](handleEntityNotFound(_0x5e61fe,null))['then'](saveUpdates(_0x12bb89['body'],null))[_0x50bb('0x30')](respondWithResult(_0x5e61fe,null))[_0x50bb('0x23')](handleError(_0x5e61fe,null));};exports[_0x50bb('0x31')]=function(_0x1bbebc,_0x3ef5d8){return db[_0x50bb('0x36')][_0x50bb('0x54')]({'where':{'id':_0x1bbebc[_0x50bb('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ef5d8,null))['then'](removeEntity(_0x3ef5d8,null))[_0x50bb('0x23')](handleError(_0x3ef5d8,null));};exports[_0x50bb('0x55')]=function(_0x1d8bf9,_0x29e1c7,_0x45d4bf){var _0x184d26={};var _0x287bc7={};var _0x4bf426;var _0x3be83b;return db[_0x50bb('0x36')][_0x50bb('0x56')]({'where':{'id':_0x1d8bf9[_0x50bb('0x50')]['id']}})[_0x50bb('0x30')](handleEntityNotFound(_0x29e1c7,null))['then'](function(_0x33ebe6){if(_0x33ebe6){_0x4bf426=_0x33ebe6;_0x287bc7[_0x50bb('0x37')]=_[_0x50bb('0x38')](db[_0x50bb('0x57')][_0x50bb('0x51')]);_0x287bc7['query']=_[_0x50bb('0x38')](_0x1d8bf9['query']);_0x287bc7['filters']=_[_0x50bb('0x3a')](_0x287bc7[_0x50bb('0x37')],_0x287bc7[_0x50bb('0x39')]);_0x184d26[_0x50bb('0x3b')]=_[_0x50bb('0x3a')](_0x287bc7[_0x50bb('0x37')],qs[_0x50bb('0x3c')](_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x3c')]));_0x184d26[_0x50bb('0x3b')]=_0x184d26[_0x50bb('0x3b')]['length']?_0x184d26[_0x50bb('0x3b')]:_0x287bc7['model'];_0x184d26[_0x50bb('0x3e')]=qs[_0x50bb('0x3f')](_0x1d8bf9['query'][_0x50bb('0x3f')]);_0x184d26[_0x50bb('0x40')]=qs[_0x50bb('0x41')](_[_0x50bb('0x42')](_0x1d8bf9[_0x50bb('0x39')],_0x287bc7[_0x50bb('0x41')]));if(_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x49')]){_0x184d26['where']=_[_0x50bb('0x43')](_0x184d26[_0x50bb('0x40')],{'$or':_[_0x50bb('0x44')](_0x184d26['attributes'],function(_0x1d1d00){var _0x2779b3={};_0x2779b3[_0x1d1d00]={'$like':'%'+_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x49')]+'%'};return _0x2779b3;})});}_0x184d26=_[_0x50bb('0x43')]({},_0x184d26,_0x1d8bf9[_0x50bb('0x4a')]);return _0x4bf426['getFields'](_0x184d26);}})[_0x50bb('0x30')](function(_0x3d1839){if(_0x3d1839){_0x3be83b=_0x3d1839[_0x50bb('0x58')];if(!_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x3d')](_0x50bb('0x59'))){_0x184d26['limit']=qs[_0x50bb('0x2a')](_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x2a')]);_0x184d26[_0x50bb('0x29')]=qs[_0x50bb('0x29')](_0x1d8bf9[_0x50bb('0x39')][_0x50bb('0x29')]);}return _0x4bf426[_0x50bb('0x55')](_0x184d26);}})[_0x50bb('0x30')](function(_0x583915){if(_0x583915){return _0x583915?{'count':_0x3be83b,'rows':_0x583915}:null;}})[_0x50bb('0x30')](respondWithResult(_0x29e1c7,null))[_0x50bb('0x23')](handleError(_0x29e1c7,null));};exports[_0x50bb('0x5a')]=function(_0x2d2463,_0x367bb9,_0x4627d1){var _0x1c0712={};var _0x22d904={};var _0x24c3b6;var _0x578ff3;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2d2463[_0x50bb('0x50')]['id']}})['then'](handleEntityNotFound(_0x367bb9,null))['then'](function(_0x388ec9){if(_0x388ec9){_0x24c3b6=_0x388ec9;_0x22d904[_0x50bb('0x37')]=_[_0x50bb('0x38')](db[_0x50bb('0x57')]['rawAttributes']);_0x22d904[_0x50bb('0x39')]=_[_0x50bb('0x38')](_0x2d2463['query']);_0x22d904[_0x50bb('0x41')]=_['intersection'](_0x22d904[_0x50bb('0x37')],_0x22d904[_0x50bb('0x39')]);_0x1c0712['attributes']=_[_0x50bb('0x3a')](_0x22d904['model'],qs[_0x50bb('0x3c')](_0x2d2463[_0x50bb('0x39')]['fields']));_0x1c0712[_0x50bb('0x3b')]=_0x1c0712[_0x50bb('0x3b')][_0x50bb('0x58')]?_0x1c0712['attributes']:_0x22d904[_0x50bb('0x37')];_0x1c0712[_0x50bb('0x3e')]=qs[_0x50bb('0x3f')](_0x2d2463[_0x50bb('0x39')]['sort']);_0x1c0712[_0x50bb('0x40')]=qs[_0x50bb('0x41')](_['pick'](_0x2d2463['query'],_0x22d904[_0x50bb('0x41')]));if(_0x2d2463[_0x50bb('0x39')]['filter']){_0x1c0712[_0x50bb('0x40')]=_[_0x50bb('0x43')](_0x1c0712[_0x50bb('0x40')],{'$or':_[_0x50bb('0x44')](_0x1c0712[_0x50bb('0x3b')],function(_0x57b864){var _0x480163={};_0x480163[_0x57b864]={'$like':'%'+_0x2d2463[_0x50bb('0x39')][_0x50bb('0x49')]+'%'};return _0x480163;})});}_0x1c0712=_[_0x50bb('0x43')]({},_0x1c0712,_0x2d2463[_0x50bb('0x4a')]);return _0x24c3b6['getSubjects'](_0x1c0712);}})[_0x50bb('0x30')](function(_0x5342df){if(_0x5342df){_0x578ff3=_0x5342df[_0x50bb('0x58')];if(!_0x2d2463[_0x50bb('0x39')][_0x50bb('0x3d')](_0x50bb('0x59'))){_0x1c0712[_0x50bb('0x2a')]=qs[_0x50bb('0x2a')](_0x2d2463[_0x50bb('0x39')]['limit']);_0x1c0712[_0x50bb('0x29')]=qs[_0x50bb('0x29')](_0x2d2463[_0x50bb('0x39')][_0x50bb('0x29')]);}return _0x24c3b6[_0x50bb('0x5a')](_0x1c0712);}})[_0x50bb('0x30')](function(_0x18e326){if(_0x18e326){return _0x18e326?{'count':_0x578ff3,'rows':_0x18e326}:null;}})['then'](respondWithResult(_0x367bb9,null))[_0x50bb('0x23')](handleError(_0x367bb9,null));};exports[_0x50bb('0x5b')]=function(_0x2752bf,_0x3bd57a,_0x469435){var _0x56aa4a={};var _0x5bb216={};var _0x145cf8;var _0x47e80f;return db[_0x50bb('0x36')][_0x50bb('0x56')]({'where':{'id':_0x2752bf['params']['id']}})['then'](handleEntityNotFound(_0x3bd57a,null))[_0x50bb('0x30')](function(_0x80d34c){if(_0x80d34c){_0x145cf8=_0x80d34c;_0x5bb216[_0x50bb('0x37')]=_['keys'](db[_0x50bb('0x57')][_0x50bb('0x51')]);_0x5bb216[_0x50bb('0x39')]=_[_0x50bb('0x38')](_0x2752bf[_0x50bb('0x39')]);_0x5bb216[_0x50bb('0x41')]=_[_0x50bb('0x3a')](_0x5bb216['model'],_0x5bb216['query']);_0x56aa4a[_0x50bb('0x3b')]=_[_0x50bb('0x3a')](_0x5bb216[_0x50bb('0x37')],qs[_0x50bb('0x3c')](_0x2752bf[_0x50bb('0x39')][_0x50bb('0x3c')]));_0x56aa4a[_0x50bb('0x3b')]=_0x56aa4a[_0x50bb('0x3b')][_0x50bb('0x58')]?_0x56aa4a[_0x50bb('0x3b')]:_0x5bb216['model'];_0x56aa4a[_0x50bb('0x3e')]=qs[_0x50bb('0x3f')](_0x2752bf[_0x50bb('0x39')][_0x50bb('0x3f')]);_0x56aa4a[_0x50bb('0x40')]=qs[_0x50bb('0x41')](_[_0x50bb('0x42')](_0x2752bf[_0x50bb('0x39')],_0x5bb216[_0x50bb('0x41')]));if(_0x2752bf[_0x50bb('0x39')][_0x50bb('0x49')]){_0x56aa4a[_0x50bb('0x40')]=_[_0x50bb('0x43')](_0x56aa4a[_0x50bb('0x40')],{'$or':_[_0x50bb('0x44')](_0x56aa4a['attributes'],function(_0x1253a2){var _0x28c4ca={};_0x28c4ca[_0x1253a2]={'$like':'%'+_0x2752bf[_0x50bb('0x39')]['filter']+'%'};return _0x28c4ca;})});}_0x56aa4a=_[_0x50bb('0x43')]({},_0x56aa4a,_0x2752bf[_0x50bb('0x4a')]);return _0x145cf8[_0x50bb('0x5b')](_0x56aa4a);}})[_0x50bb('0x30')](function(_0x225253){if(_0x225253){_0x47e80f=_0x225253[_0x50bb('0x58')];if(!_0x2752bf[_0x50bb('0x39')][_0x50bb('0x3d')](_0x50bb('0x59'))){_0x56aa4a[_0x50bb('0x2a')]=qs['limit'](_0x2752bf[_0x50bb('0x39')][_0x50bb('0x2a')]);_0x56aa4a[_0x50bb('0x29')]=qs[_0x50bb('0x29')](_0x2752bf[_0x50bb('0x39')][_0x50bb('0x29')]);}return _0x145cf8[_0x50bb('0x5b')](_0x56aa4a);}})[_0x50bb('0x30')](function(_0xfc2a72){if(_0xfc2a72){return _0xfc2a72?{'count':_0x47e80f,'rows':_0xfc2a72}:null;}})[_0x50bb('0x30')](respondWithResult(_0x3bd57a,null))[_0x50bb('0x23')](handleError(_0x3bd57a,null));}; \ No newline at end of file +var _0xbdb7=['set','Content-Range','json','apply','reject','update','then','destroy','stack','index','ServicenowConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','count','includeAll','findAll','rows','show','params','include','find','create','body','getFields','findOne','ServicenowField','length','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','offset','limit'];(function(_0x3fec5c,_0x3fbf6c){var _0x3e6ddb=function(_0x5de0f9){while(--_0x5de0f9){_0x3fec5c['push'](_0x3fec5c['shift']());}};_0x3e6ddb(++_0x3fbf6c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5d50d7,_0x339501){_0x5d50d7=_0x5d50d7-0x0;var _0x4acb68=_0xbdb7[_0x5d50d7];return _0x4acb68;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var authService=require(_0x7bdb('0xf'));var hardwareService=require(_0x7bdb('0x10'));var Redis=require(_0x7bdb('0x11'));var qs=require(_0x7bdb('0x12'));var logger=require(_0x7bdb('0x13'))(_0x7bdb('0x14'));var utils=require(_0x7bdb('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x7bdb('0x16')][_0x7bdb('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x496613,_0x8d74ff,_0x53021d,_0x5898c1){return new BPromise(function(_0x2abca6,_0x46dd4a){var _0x4fd91a=_0x5898c1||client;return _0x4fd91a['request'](_0x496613,_0x53021d)['then'](function(_0x4476ff){logger[_0x7bdb('0x18')](_0x7bdb('0x19'),_0x8d74ff,_0x7bdb('0x1a'));logger[_0x7bdb('0x1b')](_0x7bdb('0x1c'),_0x8d74ff,_0x7bdb('0x1a'),JSON[_0x7bdb('0x1d')](_0x4476ff));if(_0x4476ff['error']){if(_0x4476ff[_0x7bdb('0x1e')][_0x7bdb('0x1f')]===0x1f4){logger[_0x7bdb('0x1e')](_0x7bdb('0x19'),_0x8d74ff,_0x4476ff['error'][_0x7bdb('0x20')]);return _0x46dd4a(_0x4476ff[_0x7bdb('0x1e')]['message']);}logger[_0x7bdb('0x1e')](_0x7bdb('0x19'),_0x8d74ff,_0x4476ff[_0x7bdb('0x1e')][_0x7bdb('0x20')]);return _0x2abca6(_0x4476ff[_0x7bdb('0x1e')]['message']);}else{logger['info'](_0x7bdb('0x19'),_0x8d74ff,_0x7bdb('0x1a'));_0x2abca6(_0x4476ff['result'][_0x7bdb('0x20')]);}})[_0x7bdb('0x21')](function(_0x346c72){logger[_0x7bdb('0x1e')](_0x7bdb('0x19'),_0x8d74ff,_0x346c72);_0x46dd4a(_0x346c72);});});}function respondWithStatusCode(_0x4d668e,_0x1d37ac){_0x1d37ac=_0x1d37ac||0xcc;return function(_0xdad53d){if(_0xdad53d){return _0x4d668e[_0x7bdb('0x22')](_0x1d37ac);}return _0x4d668e[_0x7bdb('0x23')](_0x1d37ac)['end']();};}function respondWithResult(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0xc8;return function(_0x5eface){if(_0x5eface){return _0x4d6e44['status'](_0x3c423f)['json'](_0x5eface);}};}function respondWithFilteredResult(_0x2abef6,_0x51ab04){return function(_0x2b14bc){if(_0x2b14bc){var _0x72ba69=_0x2b14bc['count'],_0x3ec129=_0x51ab04[_0x7bdb('0x24')],_0x7c09cf=_0x51ab04[_0x7bdb('0x24')]+_0x51ab04[_0x7bdb('0x25')],_0x2a494e;if(_0x7c09cf>=_0x72ba69){_0x7c09cf=_0x72ba69;_0x2a494e=0xc8;}else{_0x2a494e=0xce;}_0x2abef6[_0x7bdb('0x23')](_0x2a494e);return _0x2abef6[_0x7bdb('0x26')](_0x7bdb('0x27'),_0x3ec129+'-'+_0x7c09cf+'/'+_0x72ba69)[_0x7bdb('0x28')](_0x2b14bc);}return null;};}function patchUpdates(_0xd2d7be){return function(_0x25a1fe){try{jsonpatch[_0x7bdb('0x29')](_0x25a1fe,_0xd2d7be,!![]);}catch(_0x9ec48d){return BPromise[_0x7bdb('0x2a')](_0x9ec48d);}return _0x25a1fe['save']();};}function saveUpdates(_0x388a45,_0x23fc3a){return function(_0x8f7672){if(_0x8f7672){return _0x8f7672[_0x7bdb('0x2b')](_0x388a45)[_0x7bdb('0x2c')](function(_0x5da819){return _0x5da819;});}return null;};}function removeEntity(_0x28aa2f,_0x43054c){return function(_0x9ac56){if(_0x9ac56){return _0x9ac56[_0x7bdb('0x2d')]()['then'](function(){_0x28aa2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2304b1,_0x56def2){return function(_0x2058e1){if(!_0x2058e1){_0x2304b1['sendStatus'](0x194);}return _0x2058e1;};}function handleError(_0x23e5b2,_0x438ee5){_0x438ee5=_0x438ee5||0x1f4;return function(_0x1cf75a){logger['error'](_0x1cf75a[_0x7bdb('0x2e')]);if(_0x1cf75a['name']){delete _0x1cf75a['name'];}_0x23e5b2[_0x7bdb('0x23')](_0x438ee5)['send'](_0x1cf75a);};}exports[_0x7bdb('0x2f')]=function(_0x4e36a5,_0x5ee47d){var _0x206c26={},_0x353b26={},_0x3ddee4={'count':0x0,'rows':[]};var _0x62e562=db[_0x7bdb('0x30')][_0x7bdb('0x31')];_0x353b26['model']=_[_0x7bdb('0x32')](_0x62e562);_0x353b26[_0x7bdb('0x33')]=_[_0x7bdb('0x32')](_0x4e36a5[_0x7bdb('0x33')]);_0x353b26[_0x7bdb('0x34')]=_[_0x7bdb('0x35')](_0x353b26[_0x7bdb('0x36')],_0x353b26[_0x7bdb('0x33')]);_0x206c26[_0x7bdb('0x37')]=_['intersection'](_0x353b26['model'],qs[_0x7bdb('0x38')](_0x4e36a5[_0x7bdb('0x33')][_0x7bdb('0x38')]));_0x206c26[_0x7bdb('0x37')]=_0x206c26[_0x7bdb('0x37')]['length']?_0x206c26['attributes']:_0x353b26[_0x7bdb('0x36')];if(!_0x4e36a5['query'][_0x7bdb('0x39')]('nolimit')){_0x206c26[_0x7bdb('0x25')]=qs['limit'](_0x4e36a5['query'][_0x7bdb('0x25')]);_0x206c26[_0x7bdb('0x24')]=qs[_0x7bdb('0x24')](_0x4e36a5[_0x7bdb('0x33')][_0x7bdb('0x24')]);}_0x206c26[_0x7bdb('0x3a')]=qs[_0x7bdb('0x3b')](_0x4e36a5['query']['sort']);_0x206c26[_0x7bdb('0x3c')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3d')](_0x4e36a5[_0x7bdb('0x33')],_0x353b26[_0x7bdb('0x34')]));if(_0x4e36a5[_0x7bdb('0x33')][_0x7bdb('0x3e')]){_0x206c26['where']=_['merge'](_0x206c26[_0x7bdb('0x3c')],{'$or':_[_0x7bdb('0x3f')](_0x62e562,function(_0x4636f8){if(_0x4636f8[_0x7bdb('0x40')]['key']!==_0x7bdb('0x41')){var _0x5951cd={};_0x5951cd[_0x4636f8[_0x7bdb('0x42')]]={'$like':'%'+_0x4e36a5[_0x7bdb('0x33')][_0x7bdb('0x3e')]+'%'};return _0x5951cd;}})});}_0x206c26=_[_0x7bdb('0x43')]({},_0x206c26,_0x4e36a5[_0x7bdb('0x44')]);var _0x375deb={'where':_0x206c26[_0x7bdb('0x3c')]};return db[_0x7bdb('0x30')][_0x7bdb('0x45')](_0x375deb)['then'](function(_0x2c1707){_0x3ddee4[_0x7bdb('0x45')]=_0x2c1707;if(_0x4e36a5['query'][_0x7bdb('0x46')]){_0x206c26['include']=[{'all':!![]}];}return db[_0x7bdb('0x30')][_0x7bdb('0x47')](_0x206c26);})[_0x7bdb('0x2c')](function(_0x3a8415){_0x3ddee4[_0x7bdb('0x48')]=_0x3a8415;return _0x3ddee4;})['then'](respondWithFilteredResult(_0x5ee47d,_0x206c26))[_0x7bdb('0x21')](handleError(_0x5ee47d,null));};exports[_0x7bdb('0x49')]=function(_0x12d889,_0x3eda2e){var _0x31244f={'raw':![],'where':{'id':_0x12d889[_0x7bdb('0x4a')]['id']}},_0x5021cd={};_0x5021cd[_0x7bdb('0x36')]=_[_0x7bdb('0x32')](db[_0x7bdb('0x30')][_0x7bdb('0x31')]);_0x5021cd[_0x7bdb('0x33')]=_[_0x7bdb('0x32')](_0x12d889[_0x7bdb('0x33')]);_0x5021cd[_0x7bdb('0x34')]=_[_0x7bdb('0x35')](_0x5021cd['model'],_0x5021cd[_0x7bdb('0x33')]);_0x31244f['attributes']=_['intersection'](_0x5021cd[_0x7bdb('0x36')],qs[_0x7bdb('0x38')](_0x12d889['query'][_0x7bdb('0x38')]));_0x31244f[_0x7bdb('0x37')]=_0x31244f['attributes']['length']?_0x31244f['attributes']:_0x5021cd[_0x7bdb('0x36')];if(_0x12d889[_0x7bdb('0x33')][_0x7bdb('0x46')]){_0x31244f[_0x7bdb('0x4b')]=[{'all':!![]}];}_0x31244f=_[_0x7bdb('0x43')]({},_0x31244f,_0x12d889[_0x7bdb('0x44')]);return db[_0x7bdb('0x30')][_0x7bdb('0x4c')](_0x31244f)[_0x7bdb('0x2c')](handleEntityNotFound(_0x3eda2e,null))[_0x7bdb('0x2c')](respondWithResult(_0x3eda2e,null))['catch'](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x4d')]=function(_0x4806e0,_0x240425){return db[_0x7bdb('0x30')][_0x7bdb('0x4d')](_0x4806e0[_0x7bdb('0x4e')],{})['then'](respondWithResult(_0x240425,0xc9))[_0x7bdb('0x21')](handleError(_0x240425,null));};exports['update']=function(_0x533c3b,_0x1439c3){if(_0x533c3b[_0x7bdb('0x4e')]['id']){delete _0x533c3b['body']['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x533c3b[_0x7bdb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1439c3,null))['then'](saveUpdates(_0x533c3b[_0x7bdb('0x4e')],null))[_0x7bdb('0x2c')](respondWithResult(_0x1439c3,null))[_0x7bdb('0x21')](handleError(_0x1439c3,null));};exports[_0x7bdb('0x2d')]=function(_0x49c313,_0x1d444c){return db['ServicenowConfiguration'][_0x7bdb('0x4c')]({'where':{'id':_0x49c313[_0x7bdb('0x4a')]['id']}})[_0x7bdb('0x2c')](handleEntityNotFound(_0x1d444c,null))[_0x7bdb('0x2c')](removeEntity(_0x1d444c,null))[_0x7bdb('0x21')](handleError(_0x1d444c,null));};exports[_0x7bdb('0x4f')]=function(_0x52d90e,_0x40d3b5,_0x3022ee){var _0x377d58={};var _0x58658e={};var _0x2b5493;var _0x1d9927;return db['ServicenowConfiguration'][_0x7bdb('0x50')]({'where':{'id':_0x52d90e['params']['id']}})[_0x7bdb('0x2c')](handleEntityNotFound(_0x40d3b5,null))[_0x7bdb('0x2c')](function(_0x4f3f8c){if(_0x4f3f8c){_0x2b5493=_0x4f3f8c;_0x58658e['model']=_[_0x7bdb('0x32')](db[_0x7bdb('0x51')]['rawAttributes']);_0x58658e[_0x7bdb('0x33')]=_['keys'](_0x52d90e[_0x7bdb('0x33')]);_0x58658e['filters']=_['intersection'](_0x58658e[_0x7bdb('0x36')],_0x58658e[_0x7bdb('0x33')]);_0x377d58[_0x7bdb('0x37')]=_[_0x7bdb('0x35')](_0x58658e[_0x7bdb('0x36')],qs[_0x7bdb('0x38')](_0x52d90e[_0x7bdb('0x33')][_0x7bdb('0x38')]));_0x377d58[_0x7bdb('0x37')]=_0x377d58[_0x7bdb('0x37')][_0x7bdb('0x52')]?_0x377d58[_0x7bdb('0x37')]:_0x58658e['model'];_0x377d58[_0x7bdb('0x3a')]=qs[_0x7bdb('0x3b')](_0x52d90e['query'][_0x7bdb('0x3b')]);_0x377d58[_0x7bdb('0x3c')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3d')](_0x52d90e[_0x7bdb('0x33')],_0x58658e['filters']));if(_0x52d90e[_0x7bdb('0x33')][_0x7bdb('0x3e')]){_0x377d58[_0x7bdb('0x3c')]=_['merge'](_0x377d58[_0x7bdb('0x3c')],{'$or':_[_0x7bdb('0x3f')](_0x377d58[_0x7bdb('0x37')],function(_0x11ec61){var _0x30d069={};_0x30d069[_0x11ec61]={'$like':'%'+_0x52d90e[_0x7bdb('0x33')][_0x7bdb('0x3e')]+'%'};return _0x30d069;})});}_0x377d58=_[_0x7bdb('0x43')]({},_0x377d58,_0x52d90e[_0x7bdb('0x44')]);return _0x2b5493['getFields'](_0x377d58);}})[_0x7bdb('0x2c')](function(_0x2b7c7e){if(_0x2b7c7e){_0x1d9927=_0x2b7c7e[_0x7bdb('0x52')];if(!_0x52d90e[_0x7bdb('0x33')][_0x7bdb('0x39')](_0x7bdb('0x53'))){_0x377d58[_0x7bdb('0x25')]=qs[_0x7bdb('0x25')](_0x52d90e[_0x7bdb('0x33')][_0x7bdb('0x25')]);_0x377d58[_0x7bdb('0x24')]=qs[_0x7bdb('0x24')](_0x52d90e[_0x7bdb('0x33')]['offset']);}return _0x2b5493[_0x7bdb('0x4f')](_0x377d58);}})['then'](function(_0x1ca2e0){if(_0x1ca2e0){return _0x1ca2e0?{'count':_0x1d9927,'rows':_0x1ca2e0}:null;}})[_0x7bdb('0x2c')](respondWithResult(_0x40d3b5,null))[_0x7bdb('0x21')](handleError(_0x40d3b5,null));};exports['getSubjects']=function(_0xd57d33,_0x2a5e6c,_0x4ebc9f){var _0x3b4736={};var _0x1f9024={};var _0x5b3105;var _0x1c4525;return db[_0x7bdb('0x30')]['findOne']({'where':{'id':_0xd57d33[_0x7bdb('0x4a')]['id']}})[_0x7bdb('0x2c')](handleEntityNotFound(_0x2a5e6c,null))['then'](function(_0x202f46){if(_0x202f46){_0x5b3105=_0x202f46;_0x1f9024[_0x7bdb('0x36')]=_['keys'](db[_0x7bdb('0x51')]['rawAttributes']);_0x1f9024[_0x7bdb('0x33')]=_[_0x7bdb('0x32')](_0xd57d33[_0x7bdb('0x33')]);_0x1f9024[_0x7bdb('0x34')]=_[_0x7bdb('0x35')](_0x1f9024['model'],_0x1f9024['query']);_0x3b4736['attributes']=_[_0x7bdb('0x35')](_0x1f9024['model'],qs[_0x7bdb('0x38')](_0xd57d33[_0x7bdb('0x33')][_0x7bdb('0x38')]));_0x3b4736['attributes']=_0x3b4736['attributes'][_0x7bdb('0x52')]?_0x3b4736[_0x7bdb('0x37')]:_0x1f9024[_0x7bdb('0x36')];_0x3b4736[_0x7bdb('0x3a')]=qs['sort'](_0xd57d33[_0x7bdb('0x33')][_0x7bdb('0x3b')]);_0x3b4736[_0x7bdb('0x3c')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3d')](_0xd57d33[_0x7bdb('0x33')],_0x1f9024['filters']));if(_0xd57d33[_0x7bdb('0x33')]['filter']){_0x3b4736[_0x7bdb('0x3c')]=_['merge'](_0x3b4736[_0x7bdb('0x3c')],{'$or':_[_0x7bdb('0x3f')](_0x3b4736[_0x7bdb('0x37')],function(_0x1e4a5a){var _0x7a8bec={};_0x7a8bec[_0x1e4a5a]={'$like':'%'+_0xd57d33['query']['filter']+'%'};return _0x7a8bec;})});}_0x3b4736=_[_0x7bdb('0x43')]({},_0x3b4736,_0xd57d33[_0x7bdb('0x44')]);return _0x5b3105['getSubjects'](_0x3b4736);}})[_0x7bdb('0x2c')](function(_0x2d5991){if(_0x2d5991){_0x1c4525=_0x2d5991['length'];if(!_0xd57d33[_0x7bdb('0x33')][_0x7bdb('0x39')]('nolimit')){_0x3b4736[_0x7bdb('0x25')]=qs['limit'](_0xd57d33['query'][_0x7bdb('0x25')]);_0x3b4736[_0x7bdb('0x24')]=qs['offset'](_0xd57d33['query'][_0x7bdb('0x24')]);}return _0x5b3105['getSubjects'](_0x3b4736);}})[_0x7bdb('0x2c')](function(_0x52c913){if(_0x52c913){return _0x52c913?{'count':_0x1c4525,'rows':_0x52c913}:null;}})[_0x7bdb('0x2c')](respondWithResult(_0x2a5e6c,null))[_0x7bdb('0x21')](handleError(_0x2a5e6c,null));};exports[_0x7bdb('0x54')]=function(_0xee0862,_0x537377,_0x46cb59){var _0x231f9c={};var _0x587e9c={};var _0x2be441;var _0x3096e0;return db['ServicenowConfiguration'][_0x7bdb('0x50')]({'where':{'id':_0xee0862[_0x7bdb('0x4a')]['id']}})[_0x7bdb('0x2c')](handleEntityNotFound(_0x537377,null))[_0x7bdb('0x2c')](function(_0x521d68){if(_0x521d68){_0x2be441=_0x521d68;_0x587e9c[_0x7bdb('0x36')]=_['keys'](db[_0x7bdb('0x51')][_0x7bdb('0x31')]);_0x587e9c[_0x7bdb('0x33')]=_['keys'](_0xee0862[_0x7bdb('0x33')]);_0x587e9c[_0x7bdb('0x34')]=_[_0x7bdb('0x35')](_0x587e9c[_0x7bdb('0x36')],_0x587e9c[_0x7bdb('0x33')]);_0x231f9c[_0x7bdb('0x37')]=_[_0x7bdb('0x35')](_0x587e9c[_0x7bdb('0x36')],qs[_0x7bdb('0x38')](_0xee0862[_0x7bdb('0x33')][_0x7bdb('0x38')]));_0x231f9c[_0x7bdb('0x37')]=_0x231f9c[_0x7bdb('0x37')][_0x7bdb('0x52')]?_0x231f9c[_0x7bdb('0x37')]:_0x587e9c[_0x7bdb('0x36')];_0x231f9c[_0x7bdb('0x3a')]=qs[_0x7bdb('0x3b')](_0xee0862['query'][_0x7bdb('0x3b')]);_0x231f9c[_0x7bdb('0x3c')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3d')](_0xee0862[_0x7bdb('0x33')],_0x587e9c[_0x7bdb('0x34')]));if(_0xee0862[_0x7bdb('0x33')][_0x7bdb('0x3e')]){_0x231f9c[_0x7bdb('0x3c')]=_[_0x7bdb('0x43')](_0x231f9c[_0x7bdb('0x3c')],{'$or':_['map'](_0x231f9c['attributes'],function(_0x50d248){var _0x2795c4={};_0x2795c4[_0x50d248]={'$like':'%'+_0xee0862[_0x7bdb('0x33')]['filter']+'%'};return _0x2795c4;})});}_0x231f9c=_[_0x7bdb('0x43')]({},_0x231f9c,_0xee0862[_0x7bdb('0x44')]);return _0x2be441['getDescriptions'](_0x231f9c);}})['then'](function(_0x5a98de){if(_0x5a98de){_0x3096e0=_0x5a98de[_0x7bdb('0x52')];if(!_0xee0862['query']['hasOwnProperty']('nolimit')){_0x231f9c[_0x7bdb('0x25')]=qs[_0x7bdb('0x25')](_0xee0862[_0x7bdb('0x33')]['limit']);_0x231f9c[_0x7bdb('0x24')]=qs[_0x7bdb('0x24')](_0xee0862[_0x7bdb('0x33')][_0x7bdb('0x24')]);}return _0x2be441['getDescriptions'](_0x231f9c);}})[_0x7bdb('0x2c')](function(_0x4dddbf){if(_0x4dddbf){return _0x4dddbf?{'count':_0x3096e0,'rows':_0x4dddbf}:null;}})[_0x7bdb('0x2c')](respondWithResult(_0x537377,null))[_0x7bdb('0x21')](handleError(_0x537377,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 8db0f28..f7e1a48 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 _0xd157=['lodash','api','request-promise','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x57246f,_0x3d0f4c){var _0x2c7db9=function(_0x9cd6d){while(--_0x9cd6d){_0x57246f['push'](_0x57246f['shift']());}};_0x2c7db9(++_0x3d0f4c);}(_0xd157,0x19d));var _0x7d15=function(_0x5bfb36,_0x3f7e97){_0x5bfb36=_0x5bfb36-0x0;var _0x45bc6e=_0xd157[_0x5bfb36];return _0x45bc6e;};'use strict';var _=require(_0x7d15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d15('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d15('0x2'));var attributes=require(_0x7d15('0x3'));module['exports']=function(_0x2078c2,_0x4994dd){return _0x2078c2[_0x7d15('0x4')](_0x7d15('0x5'),attributes,{'tableName':_0x7d15('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb35d=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','exports','define'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xb35d,0x19c));var _0xdb35=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0xb35d[_0x592cbc];return _0x39b8d9;};'use strict';var _=require(_0xdb35('0x0'));var util=require(_0xdb35('0x1'));var logger=require(_0xdb35('0x2'))(_0xdb35('0x3'));var moment=require(_0xdb35('0x4'));var BPromise=require(_0xdb35('0x5'));var rp=require('request-promise');var attributes=require('./intServicenowConfiguration.attributes');module[_0xdb35('0x6')]=function(_0x312e01,_0x49a54d){return _0x312e01[_0xdb35('0x7')](_0xdb35('0x8'),attributes,{'tableName':_0xdb35('0x9'),'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 f8728ea..4fcd136 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 _0xbfe3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x5427c6,_0x1240a1){var _0x5144ff=function(_0x426797){while(--_0x426797){_0x5427c6['push'](_0x5427c6['shift']());}};_0x5144ff(++_0x1240a1);}(_0xbfe3,0x1f0));var _0x3bfe=function(_0x460b79,_0x367483){_0x460b79=_0x460b79-0x0;var _0x220b19=_0xbfe3[_0x460b79];return _0x220b19;};'use strict';var _=require('lodash');var util=require(_0x3bfe('0x0'));var moment=require(_0x3bfe('0x1'));var BPromise=require(_0x3bfe('0x2'));var rs=require(_0x3bfe('0x3'));var fs=require('fs');var Redis=require(_0x3bfe('0x4'));var db=require(_0x3bfe('0x5'))['db'];var utils=require(_0x3bfe('0x6'));var logger=require(_0x3bfe('0x7'))(_0x3bfe('0x8'));var config=require(_0x3bfe('0x9'));var jayson=require(_0x3bfe('0xa'));var client=jayson[_0x3bfe('0xb')][_0x3bfe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a0fde,_0x535bf8,_0x52ff09){return new BPromise(function(_0x2b61f5,_0x395ff9){return client[_0x3bfe('0xd')](_0x3a0fde,_0x52ff09)[_0x3bfe('0xe')](function(_0xd2c35b){logger[_0x3bfe('0xf')](_0x3bfe('0x10'),_0x535bf8,_0x3bfe('0x11'));logger[_0x3bfe('0x12')](_0x3bfe('0x13'),_0x535bf8,'request\x20sent',JSON[_0x3bfe('0x14')](_0xd2c35b));if(_0xd2c35b[_0x3bfe('0x15')]){if(_0xd2c35b['error'][_0x3bfe('0x16')]===0x1f4){logger[_0x3bfe('0x15')](_0x3bfe('0x10'),_0x535bf8,_0xd2c35b[_0x3bfe('0x15')][_0x3bfe('0x17')]);return _0x395ff9(_0xd2c35b[_0x3bfe('0x15')][_0x3bfe('0x17')]);}logger[_0x3bfe('0x15')](_0x3bfe('0x10'),_0x535bf8,_0xd2c35b[_0x3bfe('0x15')]['message']);return _0x2b61f5(_0xd2c35b[_0x3bfe('0x15')]['message']);}else{logger[_0x3bfe('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x535bf8,_0x3bfe('0x11'));_0x2b61f5(_0xd2c35b['result'][_0x3bfe('0x17')]);}})[_0x3bfe('0x18')](function(_0x546640){logger[_0x3bfe('0x15')](_0x3bfe('0x10'),_0x535bf8,_0x546640);_0x395ff9(_0x546640);});});} \ No newline at end of file +var _0x2acb=['../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis'];(function(_0x41ee86,_0x5299ec){var _0xd89a55=function(_0x3419fb){while(--_0x3419fb){_0x41ee86['push'](_0x41ee86['shift']());}};_0xd89a55(++_0x5299ec);}(_0x2acb,0xb0));var _0xb2ac=function(_0x4d901c,_0x213fb7){_0x4d901c=_0x4d901c-0x0;var _0x2cfa59=_0x2acb[_0x4d901c];return _0x2cfa59;};'use strict';var _=require(_0xb2ac('0x0'));var util=require('util');var moment=require(_0xb2ac('0x1'));var BPromise=require('bluebird');var rs=require(_0xb2ac('0x2'));var fs=require('fs');var Redis=require(_0xb2ac('0x3'));var db=require(_0xb2ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb2ac('0x5'));var jayson=require(_0xb2ac('0x6'));var client=jayson[_0xb2ac('0x7')][_0xb2ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19d633,_0x17cfc3,_0x30447c){return new BPromise(function(_0x148505,_0xfa42c3){return client['request'](_0x19d633,_0x30447c)[_0xb2ac('0x9')](function(_0x16a60d){logger[_0xb2ac('0xa')](_0xb2ac('0xb'),_0x17cfc3,_0xb2ac('0xc'));logger['debug'](_0xb2ac('0xd'),_0x17cfc3,_0xb2ac('0xc'),JSON[_0xb2ac('0xe')](_0x16a60d));if(_0x16a60d[_0xb2ac('0xf')]){if(_0x16a60d[_0xb2ac('0xf')]['code']===0x1f4){logger['error'](_0xb2ac('0xb'),_0x17cfc3,_0x16a60d['error']['message']);return _0xfa42c3(_0x16a60d[_0xb2ac('0xf')][_0xb2ac('0x10')]);}logger[_0xb2ac('0xf')](_0xb2ac('0xb'),_0x17cfc3,_0x16a60d['error'][_0xb2ac('0x10')]);return _0x148505(_0x16a60d[_0xb2ac('0xf')][_0xb2ac('0x10')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x17cfc3,'request\x20sent');_0x148505(_0x16a60d[_0xb2ac('0x11')]['message']);}})['catch'](function(_0x4c266f){logger[_0xb2ac('0xf')](_0xb2ac('0xb'),_0x17cfc3,_0x4c266f);_0xfa42c3(_0x4c266f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0e94786..a7001c2 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 _0xcb6b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','/:id','post','put','update','destroy'];(function(_0x2c1db5,_0x20b060){var _0x204189=function(_0x20398e){while(--_0x20398e){_0x2c1db5['push'](_0x2c1db5['shift']());}};_0x204189(++_0x20b060);}(_0xcb6b,0x140));var _0xbcb6=function(_0x12396c,_0x4e179c){_0x12396c=_0x12396c-0x0;var _0x4917f1=_0xcb6b[_0x12396c];return _0x4917f1;};'use strict';var multer=require(_0xbcb6('0x0'));var util=require(_0xbcb6('0x1'));var path=require(_0xbcb6('0x2'));var timeout=require(_0xbcb6('0x3'));var express=require(_0xbcb6('0x4'));var router=express[_0xbcb6('0x5')]();var auth=require(_0xbcb6('0x6'));var interaction=require(_0xbcb6('0x7'));var config=require('../../config/environment');var controller=require(_0xbcb6('0x8'));router[_0xbcb6('0x9')]('/',auth[_0xbcb6('0xa')](),controller['index']);router[_0xbcb6('0x9')](_0xbcb6('0xb'),auth[_0xbcb6('0xa')](),controller['show']);router[_0xbcb6('0xc')]('/',auth[_0xbcb6('0xa')](),controller['create']);router[_0xbcb6('0xd')]('/:id',auth[_0xbcb6('0xa')](),controller[_0xbcb6('0xe')]);router['delete'](_0xbcb6('0xb'),auth[_0xbcb6('0xa')](),controller[_0xbcb6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8e69=['show','post','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x29c7dd,_0x3120b0){var _0x53b683=function(_0x5031ba){while(--_0x5031ba){_0x29c7dd['push'](_0x29c7dd['shift']());}};_0x53b683(++_0x3120b0);}(_0x8e69,0xc9));var _0x98e6=function(_0x28c626,_0x305ff2){_0x28c626=_0x28c626-0x0;var _0x51f005=_0x8e69[_0x28c626];return _0x51f005;};'use strict';var multer=require(_0x98e6('0x0'));var util=require(_0x98e6('0x1'));var path=require(_0x98e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x98e6('0x3'));var router=express[_0x98e6('0x4')]();var auth=require(_0x98e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x98e6('0x6'));var controller=require('./intServicenowField.controller');router[_0x98e6('0x7')]('/',auth[_0x98e6('0x8')](),controller['index']);router[_0x98e6('0x7')]('/:id',auth[_0x98e6('0x8')](),controller[_0x98e6('0x9')]);router[_0x98e6('0xa')]('/',auth[_0x98e6('0x8')](),controller['create']);router['put'](_0x98e6('0xb'),auth[_0x98e6('0x8')](),controller[_0x98e6('0xc')]);router['delete'](_0x98e6('0xb'),auth['isAuthenticated'](),controller[_0x98e6('0xd')]);module[_0x98e6('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 7dfe089..83c0689 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 _0xd8b0=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x5e8b13,_0x4981c7){var _0x4acc6a=function(_0x12c4d7){while(--_0x12c4d7){_0x5e8b13['push'](_0x5e8b13['shift']());}};_0x4acc6a(++_0x4981c7);}(_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')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x4')},'content':{'type':Sequelize[_0x0d8b('0x5')]},'key':{'type':Sequelize[_0x0d8b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0d8b('0x6'),_0x0d8b('0x2'))},'keyContent':{'type':Sequelize[_0x0d8b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d8b('0x5')]},'customField':{'type':Sequelize[_0x0d8b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa571=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x25d09d,_0x13f7e8){var _0x4d876b=function(_0x5e4e7e){while(--_0x5e4e7e){_0x25d09d['push'](_0x25d09d['shift']());}};_0x4d876b(++_0x13f7e8);}(_0xa571,0x107));var _0x1a57=function(_0x13974b,_0x1581f3){_0x13974b=_0x13974b-0x0;var _0x764a34=_0xa571[_0x13974b];return _0x764a34;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'type':{'type':Sequelize[_0x1a57('0x2')](_0x1a57('0x3'),'variable',_0x1a57('0x4'),_0x1a57('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a57('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1a57('0x3'),_0x1a57('0x7'),_0x1a57('0x4'))},'keyContent':{'type':Sequelize[_0x1a57('0x6')]},'idField':{'type':Sequelize[_0x1a57('0x6')]},'nameField':{'type':Sequelize[_0x1a57('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a57('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index fa19553..e69b6e4 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 _0xce0b=['merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','catch','show','include','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','ServicenowField','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xe91543,_0x2ca206){var _0x5b6bde=function(_0x5a3396){while(--_0x5a3396){_0xe91543['push'](_0xe91543['shift']());}};_0x5b6bde(++_0x2ca206);}(_0xce0b,0x1d3));var _0xbce0=function(_0x453907,_0xd8ebfb){_0x453907=_0x453907-0x0;var _0x2b29e8=_0xce0b[_0x453907];return _0x2b29e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbce0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbce0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbce0('0x2'));var moment=require(_0xbce0('0x3'));var BPromise=require(_0xbce0('0x4'));var Mustache=require(_0xbce0('0x5'));var util=require(_0xbce0('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbce0('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbce0('0x8'));var crypto=require(_0xbce0('0x9'));var jsforce=require(_0xbce0('0xa'));var deskjs=require(_0xbce0('0xb'));var toCsv=require(_0xbce0('0xc'));var querystring=require(_0xbce0('0xd'));var Papa=require(_0xbce0('0xe'));var authService=require(_0xbce0('0xf'));var hardwareService=require(_0xbce0('0x10'));var Redis=require(_0xbce0('0x11'));var qs=require(_0xbce0('0x12'));var logger=require(_0xbce0('0x13'))(_0xbce0('0x14'));var utils=require(_0xbce0('0x15'));var config=require(_0xbce0('0x16'));var db=require(_0xbce0('0x17'))['db'];function respondWithStatusCode(_0x58e82b,_0x1bd6e){_0x1bd6e=_0x1bd6e||0xcc;return function(_0x38b055){if(_0x38b055){return _0x58e82b['sendStatus'](_0x1bd6e);}return _0x58e82b[_0xbce0('0x18')](_0x1bd6e)[_0xbce0('0x19')]();};}function respondWithResult(_0x51f087,_0x39fdf0){_0x39fdf0=_0x39fdf0||0xc8;return function(_0x1a9847){if(_0x1a9847){return _0x51f087['status'](_0x39fdf0)['json'](_0x1a9847);}};}function respondWithFilteredResult(_0x8a68cd,_0x3f5e11){return function(_0x8de25a){if(_0x8de25a){var _0x1e7d3f=_0x8de25a[_0xbce0('0x1a')],_0xfcffea=_0x3f5e11[_0xbce0('0x1b')],_0x56d0ae=_0x3f5e11['offset']+_0x3f5e11[_0xbce0('0x1c')],_0xa8ce59;if(_0x56d0ae>=_0x1e7d3f){_0x56d0ae=_0x1e7d3f;_0xa8ce59=0xc8;}else{_0xa8ce59=0xce;}_0x8a68cd[_0xbce0('0x18')](_0xa8ce59);return _0x8a68cd[_0xbce0('0x1d')](_0xbce0('0x1e'),_0xfcffea+'-'+_0x56d0ae+'/'+_0x1e7d3f)[_0xbce0('0x1f')](_0x8de25a);}return null;};}function patchUpdates(_0x21e840){return function(_0x5b9476){try{jsonpatch[_0xbce0('0x20')](_0x5b9476,_0x21e840,!![]);}catch(_0x52fbfb){return BPromise[_0xbce0('0x21')](_0x52fbfb);}return _0x5b9476[_0xbce0('0x22')]();};}function saveUpdates(_0x42093d,_0x19b91c){return function(_0x1ce6b1){if(_0x1ce6b1){return _0x1ce6b1['update'](_0x42093d)[_0xbce0('0x23')](function(_0x2f6bba){return _0x2f6bba;});}return null;};}function removeEntity(_0x237b4d,_0x1ba77c){return function(_0x13abec){if(_0x13abec){return _0x13abec[_0xbce0('0x24')]()[_0xbce0('0x23')](function(){_0x237b4d['status'](0xcc)[_0xbce0('0x19')]();});}};}function handleEntityNotFound(_0x2361af,_0xc48894){return function(_0xd20edd){if(!_0xd20edd){_0x2361af[_0xbce0('0x25')](0x194);}return _0xd20edd;};}function handleError(_0x3a63c6,_0x1c71c4){_0x1c71c4=_0x1c71c4||0x1f4;return function(_0x4c0c11){logger[_0xbce0('0x26')](_0x4c0c11[_0xbce0('0x27')]);if(_0x4c0c11[_0xbce0('0x28')]){delete _0x4c0c11['name'];}_0x3a63c6[_0xbce0('0x18')](_0x1c71c4)[_0xbce0('0x29')](_0x4c0c11);};}exports[_0xbce0('0x2a')]=function(_0x142542,_0x4c1809){var _0x458822={},_0x1e8702={},_0x4a1882={'count':0x0,'rows':[]};var _0x568e75=db[_0xbce0('0x2b')]['rawAttributes'];_0x1e8702[_0xbce0('0x2c')]=_['keys'](_0x568e75);_0x1e8702[_0xbce0('0x2d')]=_[_0xbce0('0x2e')](_0x142542[_0xbce0('0x2d')]);_0x1e8702[_0xbce0('0x2f')]=_['intersection'](_0x1e8702[_0xbce0('0x2c')],_0x1e8702['query']);_0x458822[_0xbce0('0x30')]=_[_0xbce0('0x31')](_0x1e8702['model'],qs[_0xbce0('0x32')](_0x142542[_0xbce0('0x2d')]['fields']));_0x458822[_0xbce0('0x30')]=_0x458822[_0xbce0('0x30')][_0xbce0('0x33')]?_0x458822[_0xbce0('0x30')]:_0x1e8702[_0xbce0('0x2c')];if(!_0x142542['query'][_0xbce0('0x34')](_0xbce0('0x35'))){_0x458822[_0xbce0('0x1c')]=qs[_0xbce0('0x1c')](_0x142542[_0xbce0('0x2d')][_0xbce0('0x1c')]);_0x458822[_0xbce0('0x1b')]=qs['offset'](_0x142542[_0xbce0('0x2d')][_0xbce0('0x1b')]);}_0x458822[_0xbce0('0x36')]=qs[_0xbce0('0x37')](_0x142542[_0xbce0('0x2d')]['sort']);_0x458822[_0xbce0('0x38')]=qs[_0xbce0('0x2f')](_[_0xbce0('0x39')](_0x142542['query'],_0x1e8702[_0xbce0('0x2f')]));if(_0x142542[_0xbce0('0x2d')]['filter']){_0x458822[_0xbce0('0x38')]=_[_0xbce0('0x3a')](_0x458822[_0xbce0('0x38')],{'$or':_[_0xbce0('0x3b')](_0x568e75,function(_0x1c4403){if(_0x1c4403[_0xbce0('0x3c')][_0xbce0('0x3d')]!==_0xbce0('0x3e')){var _0x232e39={};_0x232e39[_0x1c4403[_0xbce0('0x3f')]]={'$like':'%'+_0x142542['query'][_0xbce0('0x40')]+'%'};return _0x232e39;}})});}_0x458822=_['merge']({},_0x458822,_0x142542[_0xbce0('0x41')]);var _0x7d7a1c={'where':_0x458822[_0xbce0('0x38')]};return db[_0xbce0('0x2b')][_0xbce0('0x1a')](_0x7d7a1c)[_0xbce0('0x23')](function(_0x5efa09){_0x4a1882[_0xbce0('0x1a')]=_0x5efa09;if(_0x142542[_0xbce0('0x2d')][_0xbce0('0x42')]){_0x458822['include']=[{'all':!![]}];}return db[_0xbce0('0x2b')][_0xbce0('0x43')](_0x458822);})[_0xbce0('0x23')](function(_0x4a39e5){_0x4a1882['rows']=_0x4a39e5;return _0x4a1882;})[_0xbce0('0x23')](respondWithFilteredResult(_0x4c1809,_0x458822))[_0xbce0('0x44')](handleError(_0x4c1809,null));};exports[_0xbce0('0x45')]=function(_0x5321e9,_0x5f1067){var _0x4ec3d2={'raw':!![],'where':{'id':_0x5321e9['params']['id']}},_0x22eb02={};_0x22eb02[_0xbce0('0x2c')]=_['keys'](db[_0xbce0('0x2b')]['rawAttributes']);_0x22eb02['query']=_[_0xbce0('0x2e')](_0x5321e9[_0xbce0('0x2d')]);_0x22eb02[_0xbce0('0x2f')]=_[_0xbce0('0x31')](_0x22eb02['model'],_0x22eb02[_0xbce0('0x2d')]);_0x4ec3d2[_0xbce0('0x30')]=_[_0xbce0('0x31')](_0x22eb02['model'],qs[_0xbce0('0x32')](_0x5321e9['query'][_0xbce0('0x32')]));_0x4ec3d2[_0xbce0('0x30')]=_0x4ec3d2[_0xbce0('0x30')]['length']?_0x4ec3d2['attributes']:_0x22eb02['model'];if(_0x5321e9[_0xbce0('0x2d')][_0xbce0('0x42')]){_0x4ec3d2[_0xbce0('0x46')]=[{'all':!![]}];}_0x4ec3d2=_[_0xbce0('0x3a')]({},_0x4ec3d2,_0x5321e9[_0xbce0('0x41')]);return db[_0xbce0('0x2b')][_0xbce0('0x47')](_0x4ec3d2)[_0xbce0('0x23')](handleEntityNotFound(_0x5f1067,null))[_0xbce0('0x23')](respondWithResult(_0x5f1067,null))[_0xbce0('0x44')](handleError(_0x5f1067,null));};exports[_0xbce0('0x48')]=function(_0x5bec8c,_0x1e0347){return db['ServicenowField'][_0xbce0('0x48')](_0x5bec8c[_0xbce0('0x49')],{})[_0xbce0('0x23')](respondWithResult(_0x1e0347,0xc9))[_0xbce0('0x44')](handleError(_0x1e0347,null));};exports[_0xbce0('0x4a')]=function(_0x24a74d,_0x119830){if(_0x24a74d[_0xbce0('0x49')]['id']){delete _0x24a74d[_0xbce0('0x49')]['id'];}return db[_0xbce0('0x2b')][_0xbce0('0x47')]({'where':{'id':_0x24a74d['params']['id']}})[_0xbce0('0x23')](handleEntityNotFound(_0x119830,null))['then'](saveUpdates(_0x24a74d['body'],null))[_0xbce0('0x23')](respondWithResult(_0x119830,null))[_0xbce0('0x44')](handleError(_0x119830,null));};exports['destroy']=function(_0x10bee6,_0x1fef6a){return db[_0xbce0('0x2b')]['find']({'where':{'id':_0x10bee6['params']['id']}})['then'](handleEntityNotFound(_0x1fef6a,null))[_0xbce0('0x23')](removeEntity(_0x1fef6a,null))[_0xbce0('0x44')](handleError(_0x1fef6a,null));}; \ No newline at end of file +var _0x6f7b=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','error','name','index','ServicenowField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','params','rawAttributes','length','catch','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils'];(function(_0x1c9817,_0x4d55e0){var _0x4a33ff=function(_0x5a685f){while(--_0x5a685f){_0x1c9817['push'](_0x1c9817['shift']());}};_0x4a33ff(++_0x4d55e0);}(_0x6f7b,0x7c));var _0xb6f7=function(_0x151848,_0x44c65c){_0x151848=_0x151848-0x0;var _0x29cc73=_0x6f7b[_0x151848];return _0x29cc73;};'use strict';var pdf=require(_0xb6f7('0x0'));var emlformat=require(_0xb6f7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb6f7('0x2'));var jsonpatch=require(_0xb6f7('0x3'));var rp=require(_0xb6f7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb6f7('0x5'));var util=require('util');var path=require(_0xb6f7('0x6'));var sox=require(_0xb6f7('0x7'));var csv=require(_0xb6f7('0x8'));var ejs=require(_0xb6f7('0x9'));var fs=require('fs');var _=require(_0xb6f7('0xa'));var squel=require(_0xb6f7('0xb'));var crypto=require('crypto');var jsforce=require(_0xb6f7('0xc'));var deskjs=require(_0xb6f7('0xd'));var toCsv=require(_0xb6f7('0x8'));var querystring=require(_0xb6f7('0xe'));var Papa=require(_0xb6f7('0xf'));var authService=require(_0xb6f7('0x10'));var hardwareService=require(_0xb6f7('0x11'));var Redis=require(_0xb6f7('0x12'));var qs=require(_0xb6f7('0x13'));var logger=require('../../config/logger')(_0xb6f7('0x14'));var utils=require(_0xb6f7('0x15'));var config=require(_0xb6f7('0x16'));var db=require(_0xb6f7('0x17'))['db'];function respondWithStatusCode(_0x41f3d6,_0x8e70c3){_0x8e70c3=_0x8e70c3||0xcc;return function(_0x5b9bbb){if(_0x5b9bbb){return _0x41f3d6[_0xb6f7('0x18')](_0x8e70c3);}return _0x41f3d6[_0xb6f7('0x19')](_0x8e70c3)[_0xb6f7('0x1a')]();};}function respondWithResult(_0x44f52a,_0x305c94){_0x305c94=_0x305c94||0xc8;return function(_0x29c363){if(_0x29c363){return _0x44f52a[_0xb6f7('0x19')](_0x305c94)[_0xb6f7('0x1b')](_0x29c363);}};}function respondWithFilteredResult(_0x1d13fe,_0x448120){return function(_0x3055fc){if(_0x3055fc){var _0x21cc60=_0x3055fc[_0xb6f7('0x1c')],_0x59a451=_0x448120[_0xb6f7('0x1d')],_0x229182=_0x448120[_0xb6f7('0x1d')]+_0x448120['limit'],_0x558808;if(_0x229182>=_0x21cc60){_0x229182=_0x21cc60;_0x558808=0xc8;}else{_0x558808=0xce;}_0x1d13fe[_0xb6f7('0x19')](_0x558808);return _0x1d13fe['set'](_0xb6f7('0x1e'),_0x59a451+'-'+_0x229182+'/'+_0x21cc60)[_0xb6f7('0x1b')](_0x3055fc);}return null;};}function patchUpdates(_0x371bf5){return function(_0x3e407f){try{jsonpatch[_0xb6f7('0x1f')](_0x3e407f,_0x371bf5,!![]);}catch(_0x5bf3f1){return BPromise[_0xb6f7('0x20')](_0x5bf3f1);}return _0x3e407f[_0xb6f7('0x21')]();};}function saveUpdates(_0x5dd789,_0x3a1e0f){return function(_0x133fe8){if(_0x133fe8){return _0x133fe8[_0xb6f7('0x22')](_0x5dd789)['then'](function(_0x3ba285){return _0x3ba285;});}return null;};}function removeEntity(_0x58ed51,_0x5eabc3){return function(_0x4a9777){if(_0x4a9777){return _0x4a9777['destroy']()['then'](function(){_0x58ed51[_0xb6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c380b,_0x2e8615){return function(_0x47759a){if(!_0x47759a){_0x5c380b[_0xb6f7('0x18')](0x194);}return _0x47759a;};}function handleError(_0x26d4a4,_0x36dfca){_0x36dfca=_0x36dfca||0x1f4;return function(_0xe65f7d){logger[_0xb6f7('0x23')](_0xe65f7d['stack']);if(_0xe65f7d[_0xb6f7('0x24')]){delete _0xe65f7d['name'];}_0x26d4a4[_0xb6f7('0x19')](_0x36dfca)['send'](_0xe65f7d);};}exports[_0xb6f7('0x25')]=function(_0x1d3995,_0x4c1cc5){var _0x8fb981={},_0x4e823c={},_0x164db8={'count':0x0,'rows':[]};var _0xeb5181=db[_0xb6f7('0x26')]['rawAttributes'];_0x4e823c[_0xb6f7('0x27')]=_[_0xb6f7('0x28')](_0xeb5181);_0x4e823c[_0xb6f7('0x29')]=_[_0xb6f7('0x28')](_0x1d3995['query']);_0x4e823c[_0xb6f7('0x2a')]=_[_0xb6f7('0x2b')](_0x4e823c['model'],_0x4e823c[_0xb6f7('0x29')]);_0x8fb981[_0xb6f7('0x2c')]=_[_0xb6f7('0x2b')](_0x4e823c[_0xb6f7('0x27')],qs[_0xb6f7('0x2d')](_0x1d3995['query']['fields']));_0x8fb981[_0xb6f7('0x2c')]=_0x8fb981['attributes']['length']?_0x8fb981[_0xb6f7('0x2c')]:_0x4e823c[_0xb6f7('0x27')];if(!_0x1d3995[_0xb6f7('0x29')][_0xb6f7('0x2e')]('nolimit')){_0x8fb981['limit']=qs['limit'](_0x1d3995[_0xb6f7('0x29')][_0xb6f7('0x2f')]);_0x8fb981[_0xb6f7('0x1d')]=qs['offset'](_0x1d3995[_0xb6f7('0x29')][_0xb6f7('0x1d')]);}_0x8fb981[_0xb6f7('0x30')]=qs[_0xb6f7('0x31')](_0x1d3995[_0xb6f7('0x29')]['sort']);_0x8fb981[_0xb6f7('0x32')]=qs[_0xb6f7('0x2a')](_[_0xb6f7('0x33')](_0x1d3995['query'],_0x4e823c[_0xb6f7('0x2a')]));if(_0x1d3995[_0xb6f7('0x29')][_0xb6f7('0x34')]){_0x8fb981['where']=_[_0xb6f7('0x35')](_0x8fb981[_0xb6f7('0x32')],{'$or':_[_0xb6f7('0x36')](_0xeb5181,function(_0x5aee33){if(_0x5aee33[_0xb6f7('0x37')][_0xb6f7('0x38')]!==_0xb6f7('0x39')){var _0x44f453={};_0x44f453[_0x5aee33[_0xb6f7('0x3a')]]={'$like':'%'+_0x1d3995['query'][_0xb6f7('0x34')]+'%'};return _0x44f453;}})});}_0x8fb981=_[_0xb6f7('0x35')]({},_0x8fb981,_0x1d3995[_0xb6f7('0x3b')]);var _0x569e36={'where':_0x8fb981[_0xb6f7('0x32')]};return db[_0xb6f7('0x26')][_0xb6f7('0x1c')](_0x569e36)[_0xb6f7('0x3c')](function(_0x5c41c2){_0x164db8['count']=_0x5c41c2;if(_0x1d3995['query'][_0xb6f7('0x3d')]){_0x8fb981[_0xb6f7('0x3e')]=[{'all':!![]}];}return db['ServicenowField'][_0xb6f7('0x3f')](_0x8fb981);})[_0xb6f7('0x3c')](function(_0x161451){_0x164db8[_0xb6f7('0x40')]=_0x161451;return _0x164db8;})[_0xb6f7('0x3c')](respondWithFilteredResult(_0x4c1cc5,_0x8fb981))['catch'](handleError(_0x4c1cc5,null));};exports['show']=function(_0x18c664,_0x25f06e){var _0x546867={'raw':!![],'where':{'id':_0x18c664[_0xb6f7('0x41')]['id']}},_0x4d7cbf={};_0x4d7cbf[_0xb6f7('0x27')]=_[_0xb6f7('0x28')](db[_0xb6f7('0x26')][_0xb6f7('0x42')]);_0x4d7cbf[_0xb6f7('0x29')]=_[_0xb6f7('0x28')](_0x18c664['query']);_0x4d7cbf[_0xb6f7('0x2a')]=_[_0xb6f7('0x2b')](_0x4d7cbf['model'],_0x4d7cbf[_0xb6f7('0x29')]);_0x546867[_0xb6f7('0x2c')]=_[_0xb6f7('0x2b')](_0x4d7cbf['model'],qs['fields'](_0x18c664[_0xb6f7('0x29')][_0xb6f7('0x2d')]));_0x546867[_0xb6f7('0x2c')]=_0x546867[_0xb6f7('0x2c')][_0xb6f7('0x43')]?_0x546867[_0xb6f7('0x2c')]:_0x4d7cbf[_0xb6f7('0x27')];if(_0x18c664[_0xb6f7('0x29')][_0xb6f7('0x3d')]){_0x546867[_0xb6f7('0x3e')]=[{'all':!![]}];}_0x546867=_[_0xb6f7('0x35')]({},_0x546867,_0x18c664['options']);return db[_0xb6f7('0x26')]['find'](_0x546867)['then'](handleEntityNotFound(_0x25f06e,null))[_0xb6f7('0x3c')](respondWithResult(_0x25f06e,null))[_0xb6f7('0x44')](handleError(_0x25f06e,null));};exports[_0xb6f7('0x45')]=function(_0x5b6bb2,_0x349c65){return db[_0xb6f7('0x26')][_0xb6f7('0x45')](_0x5b6bb2[_0xb6f7('0x46')],{})[_0xb6f7('0x3c')](respondWithResult(_0x349c65,0xc9))[_0xb6f7('0x44')](handleError(_0x349c65,null));};exports[_0xb6f7('0x22')]=function(_0x5be949,_0x18bf35){if(_0x5be949['body']['id']){delete _0x5be949['body']['id'];}return db[_0xb6f7('0x26')][_0xb6f7('0x47')]({'where':{'id':_0x5be949['params']['id']}})[_0xb6f7('0x3c')](handleEntityNotFound(_0x18bf35,null))[_0xb6f7('0x3c')](saveUpdates(_0x5be949[_0xb6f7('0x46')],null))[_0xb6f7('0x3c')](respondWithResult(_0x18bf35,null))[_0xb6f7('0x44')](handleError(_0x18bf35,null));};exports[_0xb6f7('0x48')]=function(_0x2292f6,_0x17b3b2){return db[_0xb6f7('0x26')][_0xb6f7('0x47')]({'where':{'id':_0x2292f6[_0xb6f7('0x41')]['id']}})[_0xb6f7('0x3c')](handleEntityNotFound(_0x17b3b2,null))[_0xb6f7('0x3c')](removeEntity(_0x17b3b2,null))[_0xb6f7('0x44')](handleError(_0x17b3b2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8a6853e..0866ea2 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 _0x5ab3=['util','../../config/logger','api','moment','bluebird','request-promise','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','FieldId','lodash'];(function(_0x1a6696,_0x35848b){var _0x1c6099=function(_0x514aaa){while(--_0x514aaa){_0x1a6696['push'](_0x1a6696['shift']());}};_0x1c6099(++_0x35848b);}(_0x5ab3,0x1a3));var _0x35ab=function(_0x40d958,_0x4f16c2){_0x40d958=_0x40d958-0x0;var _0x1369d9=_0x5ab3[_0x40d958];return _0x1369d9;};'use strict';var _=require(_0x35ab('0x0'));var util=require(_0x35ab('0x1'));var logger=require(_0x35ab('0x2'))(_0x35ab('0x3'));var moment=require(_0x35ab('0x4'));var BPromise=require(_0x35ab('0x5'));var rp=require(_0x35ab('0x6'));var attributes=require(_0x35ab('0x7'));module['exports']=function(_0x57dbb6,_0x379491){return _0x57dbb6[_0x35ab('0x8')](_0x35ab('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x35ab('0xa'),'fields':['idField',_0x35ab('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc01=['../../config/logger','api','moment','request-promise','exports','define','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x3f25b6,_0x27c453){var _0x1fe426=function(_0x1a8e93){while(--_0x1a8e93){_0x3f25b6['push'](_0x3f25b6['shift']());}};_0x1fe426(++_0x27c453);}(_0xcc01,0x1f3));var _0x1cc0=function(_0x16caf1,_0x5abf5e){_0x16caf1=_0x16caf1-0x0;var _0x4d77b7=_0xcc01[_0x16caf1];return _0x4d77b7;};'use strict';var _=require(_0x1cc0('0x0'));var util=require('util');var logger=require(_0x1cc0('0x1'))(_0x1cc0('0x2'));var moment=require(_0x1cc0('0x3'));var BPromise=require('bluebird');var rp=require(_0x1cc0('0x4'));var attributes=require('./intServicenowField.attributes');module[_0x1cc0('0x5')]=function(_0x17b706,_0x47d530){return _0x17b706[_0x1cc0('0x6')]('ServicenowField',attributes,{'tableName':_0x1cc0('0x7'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1cc0('0x8'),_0x1cc0('0x9')],'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 e603cd5..9ff722a 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x60d014,_0x35cbe2){var _0x769dbe=function(_0x496b4d){while(--_0x496b4d){_0x60d014['push'](_0x60d014['shift']());}};_0x769dbe(++_0x35cbe2);}(_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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('ServicenowField,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','ServicenowField,\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(_0x5c2d2e,_0x43e5b3){_0x5c2d2e=_0x5c2d2e-0x0;var _0x27308d=_0x7a54[_0x5c2d2e];return _0x27308d;};'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')]('ServicenowField,\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/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f0e0661..b38f3cc 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 _0x81f8=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','/:id','delete','destroy','exports','multer','path'];(function(_0x30beb8,_0x44669a){var _0x3cedb2=function(_0x1e8f38){while(--_0x1e8f38){_0x30beb8['push'](_0x30beb8['shift']());}};_0x3cedb2(++_0x44669a);}(_0x81f8,0xb2));var _0x881f=function(_0x8d0f51,_0x386e61){_0x8d0f51=_0x8d0f51-0x0;var _0x3166e7=_0x81f8[_0x8d0f51];return _0x3166e7;};'use strict';var multer=require(_0x881f('0x0'));var util=require('util');var path=require(_0x881f('0x1'));var timeout=require(_0x881f('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x881f('0x3'));var interaction=require(_0x881f('0x4'));var config=require(_0x881f('0x5'));var controller=require('./intSugarcrmAccount.controller');router['get']('/',auth[_0x881f('0x6')](),controller['index']);router[_0x881f('0x7')]('/:id',auth[_0x881f('0x6')](),controller[_0x881f('0x8')]);router[_0x881f('0x7')](_0x881f('0x9'),auth[_0x881f('0x6')](),controller[_0x881f('0xa')]);router[_0x881f('0x7')](_0x881f('0xb'),auth[_0x881f('0x6')](),controller['getFields']);router['post']('/',auth[_0x881f('0x6')](),controller[_0x881f('0xc')]);router[_0x881f('0xd')](_0x881f('0x9'),auth[_0x881f('0x6')](),controller[_0x881f('0xe')]);router[_0x881f('0xf')](_0x881f('0x10'),auth[_0x881f('0x6')](),controller['update']);router[_0x881f('0x11')]('/:id',auth[_0x881f('0x6')](),controller[_0x881f('0x12')]);module[_0x881f('0x13')]=router; \ No newline at end of file +var _0x9e2c=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations'];(function(_0x62acd5,_0x4ddb49){var _0x227ab4=function(_0x24fb97){while(--_0x24fb97){_0x62acd5['push'](_0x62acd5['shift']());}};_0x227ab4(++_0x4ddb49);}(_0x9e2c,0x77));var _0xc9e2=function(_0x15e03b,_0x2b2dda){_0x15e03b=_0x15e03b-0x0;var _0x12fc0d=_0x9e2c[_0x15e03b];return _0x12fc0d;};'use strict';var multer=require(_0xc9e2('0x0'));var util=require(_0xc9e2('0x1'));var path=require(_0xc9e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc9e2('0x3'));var interaction=require(_0xc9e2('0x4'));var config=require(_0xc9e2('0x5'));var controller=require(_0xc9e2('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc9e2('0x7')]);router['get'](_0xc9e2('0x8'),auth[_0xc9e2('0x9')](),controller[_0xc9e2('0xa')]);router[_0xc9e2('0xb')](_0xc9e2('0xc'),auth[_0xc9e2('0x9')](),controller[_0xc9e2('0xd')]);router[_0xc9e2('0xb')](_0xc9e2('0xe'),auth[_0xc9e2('0x9')](),controller[_0xc9e2('0xf')]);router[_0xc9e2('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc9e2('0xc'),auth[_0xc9e2('0x9')](),controller[_0xc9e2('0x11')]);router[_0xc9e2('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xc9e2('0x13')]);router['delete'](_0xc9e2('0x8'),auth[_0xc9e2('0x9')](),controller[_0xc9e2('0x14')]);module[_0xc9e2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index d157978..7e1aea5 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 _0x1989=['sequelize','exports','STRING','username','remoteUri'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x1989,0x82));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9198('0x0'));module[_0x9198('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9198('0x2')]},'username':{'type':Sequelize[_0x9198('0x2')],'unique':_0x9198('0x3')},'password':{'type':Sequelize[_0x9198('0x2')]},'remoteUri':{'type':Sequelize[_0x9198('0x2')],'unique':_0x9198('0x4')},'serverUrl':{'type':Sequelize[_0x9198('0x2')]}}; \ No newline at end of file +var _0x8532=['username','sequelize','STRING'];(function(_0x279d96,_0x46e655){var _0x5c3441=function(_0x387443){while(--_0x387443){_0x279d96['push'](_0x279d96['shift']());}};_0x5c3441(++_0x46e655);}(_0x8532,0x190));var _0x2853=function(_0x46588f,_0x4cb532){_0x46588f=_0x46588f-0x0;var _0x3b7bca=_0x8532[_0x46588f];return _0x3b7bca;};'use strict';var Sequelize=require(_0x2853('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2853('0x1')]},'username':{'type':Sequelize[_0x2853('0x1')],'unique':_0x2853('0x2')},'password':{'type':Sequelize[_0x2853('0x1')]},'remoteUri':{'type':Sequelize[_0x2853('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 349b206..04bed72 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 _0x6e52=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','test','Wrong\x20credentials','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/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','then','info','request\x20sent','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','index','SugarcrmAccount','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','find','create','body','findOne','SugarcrmConfiguration','map','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','values','module_fields','remove','includes','label','endsWith','value'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x6e52,0x102));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x26e5('0x0'));var rimraf=require(_0x26e5('0x1'));var zipdir=require(_0x26e5('0x2'));var jsonpatch=require(_0x26e5('0x3'));var rp=require(_0x26e5('0x4'));var moment=require(_0x26e5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x26e5('0x6'));var util=require(_0x26e5('0x7'));var path=require(_0x26e5('0x8'));var sox=require(_0x26e5('0x9'));var csv=require(_0x26e5('0xa'));var ejs=require(_0x26e5('0xb'));var fs=require('fs');var _=require(_0x26e5('0xc'));var squel=require(_0x26e5('0xd'));var crypto=require('crypto');var jsforce=require(_0x26e5('0xe'));var deskjs=require(_0x26e5('0xf'));var toCsv=require(_0x26e5('0xa'));var querystring=require(_0x26e5('0x10'));var Papa=require(_0x26e5('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x26e5('0x12'));var qs=require(_0x26e5('0x13'));var logger=require(_0x26e5('0x14'))(_0x26e5('0x15'));var utils=require(_0x26e5('0x16'));var config=require(_0x26e5('0x17'));var db=require(_0x26e5('0x18'))['db'];var integrations=require(_0x26e5('0x19'));var jayson=require('jayson/promise');var client=jayson[_0x26e5('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fa63f,_0x463829,_0x40d8f7,_0x5a89d6){return new BPromise(function(_0x4a3ae9,_0x1373d3){var _0xc01d2c=_0x5a89d6||client;return _0xc01d2c['request'](_0x3fa63f,_0x40d8f7)[_0x26e5('0x1b')](function(_0x52ed92){logger[_0x26e5('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x463829,_0x26e5('0x1d'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x463829,_0x26e5('0x1d'),JSON['stringify'](_0x52ed92));if(_0x52ed92[_0x26e5('0x1e')]){if(_0x52ed92['error'][_0x26e5('0x1f')]===0x1f4){logger[_0x26e5('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x463829,_0x52ed92['error'][_0x26e5('0x20')]);return _0x1373d3(_0x52ed92[_0x26e5('0x1e')][_0x26e5('0x20')]);}logger[_0x26e5('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x463829,_0x52ed92['error'][_0x26e5('0x20')]);return _0x4a3ae9(_0x52ed92[_0x26e5('0x1e')]['message']);}else{logger[_0x26e5('0x1c')](_0x26e5('0x21'),_0x463829,'request\x20sent');_0x4a3ae9(_0x52ed92[_0x26e5('0x22')]['message']);}})[_0x26e5('0x23')](function(_0x1e70c9){logger['error'](_0x26e5('0x21'),_0x463829,_0x1e70c9);_0x1373d3(_0x1e70c9);});});}function respondWithStatusCode(_0x588478,_0x3bcba6){_0x3bcba6=_0x3bcba6||0xcc;return function(_0x29c984){if(_0x29c984){return _0x588478[_0x26e5('0x24')](_0x3bcba6);}return _0x588478[_0x26e5('0x25')](_0x3bcba6)[_0x26e5('0x26')]();};}function respondWithResult(_0xf024b0,_0x7b378b){_0x7b378b=_0x7b378b||0xc8;return function(_0x2e4cc0){if(_0x2e4cc0){return _0xf024b0[_0x26e5('0x25')](_0x7b378b)[_0x26e5('0x27')](_0x2e4cc0);}};}function respondWithFilteredResult(_0xbf9db5,_0x5c33ee){return function(_0x3dc2e4){if(_0x3dc2e4){var _0x1a811f=_0x3dc2e4[_0x26e5('0x28')],_0x16d37b=_0x5c33ee['offset'],_0x534378=_0x5c33ee[_0x26e5('0x29')]+_0x5c33ee[_0x26e5('0x2a')],_0x485abc;if(_0x534378>=_0x1a811f){_0x534378=_0x1a811f;_0x485abc=0xc8;}else{_0x485abc=0xce;}_0xbf9db5['status'](_0x485abc);return _0xbf9db5['set'](_0x26e5('0x2b'),_0x16d37b+'-'+_0x534378+'/'+_0x1a811f)['json'](_0x3dc2e4);}return null;};}function patchUpdates(_0x1695f1){return function(_0x20dd5d){try{jsonpatch[_0x26e5('0x2c')](_0x20dd5d,_0x1695f1,!![]);}catch(_0x10c421){return BPromise[_0x26e5('0x2d')](_0x10c421);}return _0x20dd5d[_0x26e5('0x2e')]();};}function saveUpdates(_0x5cffb9,_0x5d8407){return function(_0x399de2){if(_0x399de2){return _0x399de2[_0x26e5('0x2f')](_0x5cffb9)['then'](function(_0x4e9385){return _0x4e9385;});}return null;};}function removeEntity(_0x14c20b,_0x1bd522){return function(_0x5dceb6){if(_0x5dceb6){return _0x5dceb6[_0x26e5('0x30')]()[_0x26e5('0x1b')](function(){_0x14c20b[_0x26e5('0x25')](0xcc)[_0x26e5('0x26')]();});}};}function handleEntityNotFound(_0x2392cd,_0x53b580){return function(_0x252d8c){if(!_0x252d8c){_0x2392cd[_0x26e5('0x24')](0x194);}return _0x252d8c;};}function handleError(_0x28b8ac,_0x4f63d1){_0x4f63d1=_0x4f63d1||0x1f4;return function(_0x48080c){logger['error'](_0x48080c[_0x26e5('0x31')]);if(_0x48080c[_0x26e5('0x32')]){delete _0x48080c[_0x26e5('0x32')];}_0x28b8ac['status'](_0x4f63d1)['send'](_0x48080c);};}exports[_0x26e5('0x33')]=function(_0x34fd6d,_0x5b0a95){var _0xe3fe2c={},_0x55b672={},_0x5b90d6={'count':0x0,'rows':[]};var _0x165acb=db[_0x26e5('0x34')][_0x26e5('0x35')];_0x55b672['model']=_['keys'](_0x165acb);_0x55b672[_0x26e5('0x36')]=_[_0x26e5('0x37')](_0x34fd6d['query']);_0x55b672['filters']=_[_0x26e5('0x38')](_0x55b672[_0x26e5('0x39')],_0x55b672[_0x26e5('0x36')]);_0xe3fe2c[_0x26e5('0x3a')]=_['intersection'](_0x55b672[_0x26e5('0x39')],qs[_0x26e5('0x3b')](_0x34fd6d[_0x26e5('0x36')][_0x26e5('0x3b')]));_0xe3fe2c[_0x26e5('0x3a')]=_0xe3fe2c[_0x26e5('0x3a')][_0x26e5('0x3c')]?_0xe3fe2c[_0x26e5('0x3a')]:_0x55b672[_0x26e5('0x39')];if(!_0x34fd6d[_0x26e5('0x36')][_0x26e5('0x3d')]('nolimit')){_0xe3fe2c[_0x26e5('0x2a')]=qs[_0x26e5('0x2a')](_0x34fd6d[_0x26e5('0x36')][_0x26e5('0x2a')]);_0xe3fe2c[_0x26e5('0x29')]=qs[_0x26e5('0x29')](_0x34fd6d[_0x26e5('0x36')][_0x26e5('0x29')]);}_0xe3fe2c[_0x26e5('0x3e')]=qs[_0x26e5('0x3f')](_0x34fd6d[_0x26e5('0x36')][_0x26e5('0x3f')]);_0xe3fe2c[_0x26e5('0x40')]=qs[_0x26e5('0x41')](_['pick'](_0x34fd6d['query'],_0x55b672['filters']));if(_0x34fd6d['query'][_0x26e5('0x42')]){_0xe3fe2c[_0x26e5('0x40')]=_['merge'](_0xe3fe2c[_0x26e5('0x40')],{'$or':_['map'](_0x165acb,function(_0x54b979){if(_0x54b979[_0x26e5('0x43')][_0x26e5('0x44')]!==_0x26e5('0x45')){var _0xf4d697={};_0xf4d697[_0x54b979[_0x26e5('0x46')]]={'$like':'%'+_0x34fd6d['query'][_0x26e5('0x42')]+'%'};return _0xf4d697;}})});}_0xe3fe2c=_[_0x26e5('0x47')]({},_0xe3fe2c,_0x34fd6d[_0x26e5('0x48')]);var _0x3d66fc={'where':_0xe3fe2c[_0x26e5('0x40')]};return db[_0x26e5('0x34')]['count'](_0x3d66fc)['then'](function(_0x51069e){_0x5b90d6[_0x26e5('0x28')]=_0x51069e;if(_0x34fd6d['query'][_0x26e5('0x49')]){_0xe3fe2c[_0x26e5('0x4a')]=[{'all':!![]}];}return db[_0x26e5('0x34')][_0x26e5('0x4b')](_0xe3fe2c);})[_0x26e5('0x1b')](function(_0x34f82f){_0x5b90d6['rows']=_0x34f82f;return _0x5b90d6;})[_0x26e5('0x1b')](respondWithFilteredResult(_0x5b0a95,_0xe3fe2c))['catch'](handleError(_0x5b0a95,null));};exports[_0x26e5('0x4c')]=function(_0x35df28,_0x201cf7){var _0xc9282={'raw':![],'where':{'id':_0x35df28[_0x26e5('0x4d')]['id']}},_0x435f41={};_0x435f41[_0x26e5('0x39')]=_['keys'](db[_0x26e5('0x34')][_0x26e5('0x35')]);_0x435f41[_0x26e5('0x36')]=_['keys'](_0x35df28[_0x26e5('0x36')]);_0x435f41[_0x26e5('0x41')]=_[_0x26e5('0x38')](_0x435f41['model'],_0x435f41[_0x26e5('0x36')]);_0xc9282[_0x26e5('0x3a')]=_[_0x26e5('0x38')](_0x435f41[_0x26e5('0x39')],qs[_0x26e5('0x3b')](_0x35df28['query'][_0x26e5('0x3b')]));_0xc9282[_0x26e5('0x3a')]=_0xc9282[_0x26e5('0x3a')][_0x26e5('0x3c')]?_0xc9282[_0x26e5('0x3a')]:_0x435f41[_0x26e5('0x39')];if(_0x35df28[_0x26e5('0x36')][_0x26e5('0x49')]){_0xc9282['include']=[{'all':!![]}];}_0xc9282=_[_0x26e5('0x47')]({},_0xc9282,_0x35df28[_0x26e5('0x48')]);return db['SugarcrmAccount'][_0x26e5('0x4e')](_0xc9282)[_0x26e5('0x1b')](handleEntityNotFound(_0x201cf7,null))[_0x26e5('0x1b')](respondWithResult(_0x201cf7,null))[_0x26e5('0x23')](handleError(_0x201cf7,null));};exports[_0x26e5('0x4f')]=function(_0x50c503,_0xe75b9c){return db['SugarcrmAccount'][_0x26e5('0x4f')](_0x50c503[_0x26e5('0x50')],{})[_0x26e5('0x1b')](respondWithResult(_0xe75b9c,0xc9))[_0x26e5('0x23')](handleError(_0xe75b9c,null));};exports[_0x26e5('0x2f')]=function(_0x1c6c78,_0x509439){if(_0x1c6c78[_0x26e5('0x50')]['id']){delete _0x1c6c78[_0x26e5('0x50')]['id'];}return db[_0x26e5('0x34')]['find']({'where':{'id':_0x1c6c78['params']['id']}})['then'](handleEntityNotFound(_0x509439,null))[_0x26e5('0x1b')](saveUpdates(_0x1c6c78[_0x26e5('0x50')],null))[_0x26e5('0x1b')](respondWithResult(_0x509439,null))[_0x26e5('0x23')](handleError(_0x509439,null));};exports[_0x26e5('0x30')]=function(_0x36a3f6,_0xc7afc3){return db[_0x26e5('0x34')][_0x26e5('0x4e')]({'where':{'id':_0x36a3f6['params']['id']}})[_0x26e5('0x1b')](handleEntityNotFound(_0xc7afc3,null))[_0x26e5('0x1b')](removeEntity(_0xc7afc3,null))['catch'](handleError(_0xc7afc3,null));};exports['getConfigurations']=function(_0x39fa8c,_0x114f9e,_0x562c77){var _0x2fc2b2={};var _0x3c06b1={};var _0x3aa14d;var _0x265342;return db['SugarcrmAccount'][_0x26e5('0x51')]({'where':{'id':_0x39fa8c['params']['id']}})[_0x26e5('0x1b')](handleEntityNotFound(_0x114f9e,null))[_0x26e5('0x1b')](function(_0x1346ae){if(_0x1346ae){_0x3aa14d=_0x1346ae;_0x3c06b1[_0x26e5('0x39')]=_[_0x26e5('0x37')](db[_0x26e5('0x52')]['rawAttributes']);_0x3c06b1[_0x26e5('0x36')]=_['keys'](_0x39fa8c[_0x26e5('0x36')]);_0x3c06b1[_0x26e5('0x41')]=_[_0x26e5('0x38')](_0x3c06b1[_0x26e5('0x39')],_0x3c06b1['query']);_0x2fc2b2[_0x26e5('0x3a')]=_['intersection'](_0x3c06b1[_0x26e5('0x39')],qs['fields'](_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x3b')]));_0x2fc2b2[_0x26e5('0x3a')]=_0x2fc2b2[_0x26e5('0x3a')][_0x26e5('0x3c')]?_0x2fc2b2[_0x26e5('0x3a')]:_0x3c06b1['model'];_0x2fc2b2[_0x26e5('0x3e')]=qs['sort'](_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x3f')]);_0x2fc2b2[_0x26e5('0x40')]=qs['filters'](_['pick'](_0x39fa8c[_0x26e5('0x36')],_0x3c06b1[_0x26e5('0x41')]));if(_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x42')]){_0x2fc2b2[_0x26e5('0x40')]=_['merge'](_0x2fc2b2[_0x26e5('0x40')],{'$or':_[_0x26e5('0x53')](_0x2fc2b2[_0x26e5('0x3a')],function(_0x246ba8){var _0x4df5a0={};_0x4df5a0[_0x246ba8]={'$like':'%'+_0x39fa8c['query'][_0x26e5('0x42')]+'%'};return _0x4df5a0;})});}_0x2fc2b2=_[_0x26e5('0x47')]({},_0x2fc2b2,_0x39fa8c['options']);return _0x3aa14d[_0x26e5('0x54')](_0x2fc2b2);}})[_0x26e5('0x1b')](function(_0x11557c){if(_0x11557c){_0x265342=_0x11557c['length'];if(!_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x3d')]('nolimit')){_0x2fc2b2[_0x26e5('0x2a')]=qs[_0x26e5('0x2a')](_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x2a')]);_0x2fc2b2[_0x26e5('0x29')]=qs[_0x26e5('0x29')](_0x39fa8c[_0x26e5('0x36')][_0x26e5('0x29')]);}return _0x3aa14d[_0x26e5('0x54')](_0x2fc2b2);}})[_0x26e5('0x1b')](function(_0x3e25d7){if(_0x3e25d7){return _0x3e25d7?{'count':_0x265342,'rows':_0x3e25d7}:null;}})[_0x26e5('0x1b')](respondWithResult(_0x114f9e,null))[_0x26e5('0x23')](handleError(_0x114f9e,null));};exports[_0x26e5('0x55')]=function(_0x481a82,_0x3609ab,_0x13ce3a){if(_0x481a82[_0x26e5('0x50')]['id']){delete _0x481a82['body']['id'];}return db[_0x26e5('0x34')][_0x26e5('0x51')]({'where':{'id':_0x481a82[_0x26e5('0x4d')]['id']}})[_0x26e5('0x1b')](handleEntityNotFound(_0x3609ab,null))[_0x26e5('0x1b')](function(_0x342bc3){if(_0x342bc3){_0x481a82['body'][_0x26e5('0x56')]=_0x342bc3['id'];_0x481a82[_0x26e5('0x50')]['Subjects']=integrations[_0x26e5('0x57')](_0x481a82['body'][_0x26e5('0x58')],_0x481a82[_0x26e5('0x50')][_0x26e5('0x43')]);_0x481a82[_0x26e5('0x50')]['Descriptions']=integrations[_0x26e5('0x59')](_0x481a82[_0x26e5('0x50')][_0x26e5('0x58')],_0x481a82['body']['type']);return db[_0x26e5('0x52')][_0x26e5('0x4f')](_0x481a82['body'],{'include':[{'model':db[_0x26e5('0x5a')],'as':_0x26e5('0x5b')},{'model':db[_0x26e5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x26e5('0x1b')](respondWithResult(_0x3609ab,null))[_0x26e5('0x23')](handleError(_0x3609ab,null));};exports['getFields']=function(_0x446592,_0xd5c5ba,_0x280866){var _0x1fccf5='';var _0xddd161=['id',_0x26e5('0x32'),_0x26e5('0x5c'),_0x26e5('0x5d'),'description','date_start',_0x26e5('0x5e'),_0x26e5('0x5f'),_0x26e5('0x60'),'parent_type',_0x26e5('0x61'),_0x26e5('0x62')];return db[_0x26e5('0x34')]['findOne']({'where':{'id':_0x446592['params']['id']},'attributes':['id',_0x26e5('0x63'),_0x26e5('0x64'),'remoteUri']})[_0x26e5('0x1b')](handleEntityNotFound(_0xd5c5ba,null))[_0x26e5('0x1b')](function(_0x45ef91){if(_0x45ef91){_0x1fccf5=_0x45ef91[_0x26e5('0x65')];var _0x1a6da4=_0x1fccf5[_0x26e5('0x66')](-0x1);if(_0x1a6da4==='/'){_0x1fccf5=_0x1fccf5[_0x26e5('0x67')](0x0,_0x1fccf5[_0x26e5('0x68')](_0x1a6da4));}return rp({'method':_0x26e5('0x69'),'uri':util[_0x26e5('0x6a')](_0x26e5('0x6b'),_0x1fccf5,_0x26e5('0x6c')),'json':!![],'form':{'method':'login','input_type':_0x26e5('0x6d'),'response_type':'JSON','rest_data':JSON[_0x26e5('0x6e')]({'user_auth':{'user_name':_0x45ef91[_0x26e5('0x63')],'password':_0x45ef91[_0x26e5('0x64')],'encryption':'PLAIN'},'application':_0x26e5('0x6f')})}});}})[_0x26e5('0x1b')](function(_0x22acf0){if(_0x22acf0&&_0x22acf0[_0x26e5('0x32')]!=='Invalid\x20Login'&&_0x22acf0[_0x26e5('0x32')]!==_0x26e5('0x70')){return rp({'method':'POST','uri':util['format']('%s%s',_0x1fccf5,_0x26e5('0x6c')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x26e5('0x6d'),'response_type':_0x26e5('0x6d'),'rest_data':JSON[_0x26e5('0x6e')]({'session':_0x22acf0['id'],'module_name':'Calls'})}})[_0x26e5('0x1b')](function(_0x25c3b4){if(_0x25c3b4){var _0x4f84b0=_[_0x26e5('0x71')](_0x25c3b4[_0x26e5('0x72')]);_[_0x26e5('0x73')](_0x4f84b0,function(_0x3ed082){return _0xddd161[_0x26e5('0x74')](_0x3ed082[_0x26e5('0x32')]);});return{'count':_0x4f84b0[_0x26e5('0x3c')],'rows':_[_0x26e5('0x53')](_0x4f84b0,function(_0x525642){return{'id':_0x525642[_0x26e5('0x32')],'name':_0x525642[_0x26e5('0x75')],'custom':_[_0x26e5('0x76')](_0x525642[_0x26e5('0x32')],'_c')?!![]:![],'options':_0x525642[_0x26e5('0x48')]?_[_0x26e5('0x53')](_[_0x26e5('0x71')](_0x525642[_0x26e5('0x48')]),function(_0x23a392){return{'name':_0x23a392[_0x26e5('0x77')],'value':_0x23a392[_0x26e5('0x32')]};}):[]};})};}})[_0x26e5('0x1b')](respondWithResult(_0xd5c5ba,null))[_0x26e5('0x23')](function(_0x4996e0){var _0x4caeb8=_0x446592['query']['test']?0x1f4:_0x4996e0[_0x26e5('0x78')]||0x1f4;logger[_0x26e5('0x1e')](_0x26e5('0x79'),_0x26e5('0x7a'),_0x4caeb8,JSON[_0x26e5('0x6e')](_0x4996e0));delete _0x4996e0[_0x26e5('0x32')];if(_0x4caeb8===0x191){_0x4caeb8=0x190;}_0xd5c5ba[_0x26e5('0x25')](_0x4caeb8)[_0x26e5('0x7b')](_0x446592[_0x26e5('0x36')][_0x26e5('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x4996e0[_0x26e5('0x78')]}:_0x4996e0);});}else{var _0x5bbd6c=0x1f4;_0xd5c5ba[_0x26e5('0x25')](_0x5bbd6c)[_0x26e5('0x7b')]({'message':_0x26e5('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2d90=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','then','stack','name','send','SugarcrmAccount','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','options','count','include','findAll','rows','show','includeAll','find','create','body','params','destroy','getConfigurations','findOne','SugarcrmConfiguration','length','addConfiguration','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d90,0x192));var _0x02d9=function(_0xe4f0a9,_0x56e837){_0xe4f0a9=_0xe4f0a9-0x0;var _0x3a8893=_0x2d90[_0xe4f0a9];return _0x3a8893;};'use strict';var pdf=require(_0x02d9('0x0'));var emlformat=require(_0x02d9('0x1'));var rimraf=require(_0x02d9('0x2'));var zipdir=require(_0x02d9('0x3'));var jsonpatch=require(_0x02d9('0x4'));var rp=require(_0x02d9('0x5'));var moment=require(_0x02d9('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x02d9('0x7'));var util=require(_0x02d9('0x8'));var path=require(_0x02d9('0x9'));var sox=require(_0x02d9('0xa'));var csv=require('to-csv');var ejs=require(_0x02d9('0xb'));var fs=require('fs');var _=require(_0x02d9('0xc'));var squel=require(_0x02d9('0xd'));var crypto=require(_0x02d9('0xe'));var jsforce=require(_0x02d9('0xf'));var deskjs=require(_0x02d9('0x10'));var toCsv=require(_0x02d9('0x11'));var querystring=require(_0x02d9('0x12'));var Papa=require(_0x02d9('0x13'));var authService=require(_0x02d9('0x14'));var hardwareService=require(_0x02d9('0x15'));var Redis=require(_0x02d9('0x16'));var qs=require(_0x02d9('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x02d9('0x18'));var config=require('../../config/environment');var db=require(_0x02d9('0x19'))['db'];var integrations=require(_0x02d9('0x1a'));var jayson=require(_0x02d9('0x1b'));var client=jayson[_0x02d9('0x1c')][_0x02d9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x47910b,_0x59ae1a,_0x7c2ed6,_0x24c158){return new BPromise(function(_0x103a48,_0x235958){var _0x591fe7=_0x24c158||client;return _0x591fe7[_0x02d9('0x1e')](_0x47910b,_0x7c2ed6)['then'](function(_0x1651ed){logger[_0x02d9('0x1f')](_0x02d9('0x20'),_0x59ae1a,_0x02d9('0x21'));logger['debug'](_0x02d9('0x22'),_0x59ae1a,_0x02d9('0x21'),JSON[_0x02d9('0x23')](_0x1651ed));if(_0x1651ed[_0x02d9('0x24')]){if(_0x1651ed[_0x02d9('0x24')][_0x02d9('0x25')]===0x1f4){logger[_0x02d9('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x59ae1a,_0x1651ed[_0x02d9('0x24')][_0x02d9('0x26')]);return _0x235958(_0x1651ed['error']['message']);}logger[_0x02d9('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x59ae1a,_0x1651ed['error'][_0x02d9('0x26')]);return _0x103a48(_0x1651ed[_0x02d9('0x24')][_0x02d9('0x26')]);}else{logger[_0x02d9('0x1f')](_0x02d9('0x20'),_0x59ae1a,_0x02d9('0x21'));_0x103a48(_0x1651ed[_0x02d9('0x27')][_0x02d9('0x26')]);}})[_0x02d9('0x28')](function(_0x521bcb){logger[_0x02d9('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x59ae1a,_0x521bcb);_0x235958(_0x521bcb);});});}function respondWithStatusCode(_0x3ea2d5,_0x537642){_0x537642=_0x537642||0xcc;return function(_0xf6e4b3){if(_0xf6e4b3){return _0x3ea2d5[_0x02d9('0x29')](_0x537642);}return _0x3ea2d5['status'](_0x537642)[_0x02d9('0x2a')]();};}function respondWithResult(_0x45243a,_0x32252b){_0x32252b=_0x32252b||0xc8;return function(_0x5edce7){if(_0x5edce7){return _0x45243a[_0x02d9('0x2b')](_0x32252b)[_0x02d9('0x2c')](_0x5edce7);}};}function respondWithFilteredResult(_0x5a781e,_0x4774b8){return function(_0x1019e7){if(_0x1019e7){var _0x53a7dd=_0x1019e7['count'],_0xd9fdc5=_0x4774b8[_0x02d9('0x2d')],_0xc4bcbc=_0x4774b8[_0x02d9('0x2d')]+_0x4774b8[_0x02d9('0x2e')],_0x4bb5aa;if(_0xc4bcbc>=_0x53a7dd){_0xc4bcbc=_0x53a7dd;_0x4bb5aa=0xc8;}else{_0x4bb5aa=0xce;}_0x5a781e[_0x02d9('0x2b')](_0x4bb5aa);return _0x5a781e[_0x02d9('0x2f')](_0x02d9('0x30'),_0xd9fdc5+'-'+_0xc4bcbc+'/'+_0x53a7dd)[_0x02d9('0x2c')](_0x1019e7);}return null;};}function patchUpdates(_0x44bb42){return function(_0x51013e){try{jsonpatch[_0x02d9('0x31')](_0x51013e,_0x44bb42,!![]);}catch(_0x31cd93){return BPromise[_0x02d9('0x32')](_0x31cd93);}return _0x51013e['save']();};}function saveUpdates(_0x2fdb1c,_0x5409e1){return function(_0x210aec){if(_0x210aec){return _0x210aec['update'](_0x2fdb1c)[_0x02d9('0x33')](function(_0xf3d3aa){return _0xf3d3aa;});}return null;};}function removeEntity(_0x387ea0,_0x2afc0a){return function(_0x33af17){if(_0x33af17){return _0x33af17['destroy']()['then'](function(){_0x387ea0['status'](0xcc)[_0x02d9('0x2a')]();});}};}function handleEntityNotFound(_0x3c0ddc,_0x3b37f1){return function(_0x52872a){if(!_0x52872a){_0x3c0ddc[_0x02d9('0x29')](0x194);}return _0x52872a;};}function handleError(_0x1751cd,_0x2ebf13){_0x2ebf13=_0x2ebf13||0x1f4;return function(_0x1f6972){logger[_0x02d9('0x24')](_0x1f6972[_0x02d9('0x34')]);if(_0x1f6972[_0x02d9('0x35')]){delete _0x1f6972[_0x02d9('0x35')];}_0x1751cd[_0x02d9('0x2b')](_0x2ebf13)[_0x02d9('0x36')](_0x1f6972);};}exports['index']=function(_0x5672ea,_0x1e8c9e){var _0x5754e1={},_0x59de4={},_0x8022b2={'count':0x0,'rows':[]};var _0x39b764=db[_0x02d9('0x37')][_0x02d9('0x38')];_0x59de4[_0x02d9('0x39')]=_[_0x02d9('0x3a')](_0x39b764);_0x59de4[_0x02d9('0x3b')]=_[_0x02d9('0x3a')](_0x5672ea[_0x02d9('0x3b')]);_0x59de4['filters']=_[_0x02d9('0x3c')](_0x59de4[_0x02d9('0x39')],_0x59de4['query']);_0x5754e1[_0x02d9('0x3d')]=_[_0x02d9('0x3c')](_0x59de4['model'],qs[_0x02d9('0x3e')](_0x5672ea[_0x02d9('0x3b')][_0x02d9('0x3e')]));_0x5754e1['attributes']=_0x5754e1['attributes']['length']?_0x5754e1[_0x02d9('0x3d')]:_0x59de4[_0x02d9('0x39')];if(!_0x5672ea['query'][_0x02d9('0x3f')](_0x02d9('0x40'))){_0x5754e1[_0x02d9('0x2e')]=qs[_0x02d9('0x2e')](_0x5672ea[_0x02d9('0x3b')][_0x02d9('0x2e')]);_0x5754e1['offset']=qs[_0x02d9('0x2d')](_0x5672ea[_0x02d9('0x3b')][_0x02d9('0x2d')]);}_0x5754e1[_0x02d9('0x41')]=qs[_0x02d9('0x42')](_0x5672ea['query'][_0x02d9('0x42')]);_0x5754e1['where']=qs[_0x02d9('0x43')](_[_0x02d9('0x44')](_0x5672ea[_0x02d9('0x3b')],_0x59de4[_0x02d9('0x43')]));if(_0x5672ea['query'][_0x02d9('0x45')]){_0x5754e1[_0x02d9('0x46')]=_[_0x02d9('0x47')](_0x5754e1['where'],{'$or':_[_0x02d9('0x48')](_0x39b764,function(_0xf1c5c2){if(_0xf1c5c2['type'][_0x02d9('0x49')]!==_0x02d9('0x4a')){var _0x5694d1={};_0x5694d1[_0xf1c5c2['field']]={'$like':'%'+_0x5672ea['query'][_0x02d9('0x45')]+'%'};return _0x5694d1;}})});}_0x5754e1=_[_0x02d9('0x47')]({},_0x5754e1,_0x5672ea[_0x02d9('0x4b')]);var _0x77960e={'where':_0x5754e1['where']};return db[_0x02d9('0x37')][_0x02d9('0x4c')](_0x77960e)[_0x02d9('0x33')](function(_0x241778){_0x8022b2[_0x02d9('0x4c')]=_0x241778;if(_0x5672ea[_0x02d9('0x3b')]['includeAll']){_0x5754e1[_0x02d9('0x4d')]=[{'all':!![]}];}return db[_0x02d9('0x37')][_0x02d9('0x4e')](_0x5754e1);})[_0x02d9('0x33')](function(_0x138eb4){_0x8022b2[_0x02d9('0x4f')]=_0x138eb4;return _0x8022b2;})[_0x02d9('0x33')](respondWithFilteredResult(_0x1e8c9e,_0x5754e1))['catch'](handleError(_0x1e8c9e,null));};exports[_0x02d9('0x50')]=function(_0x387021,_0x54ba5b){var _0x26800f={'raw':![],'where':{'id':_0x387021['params']['id']}},_0x55009a={};_0x55009a[_0x02d9('0x39')]=_[_0x02d9('0x3a')](db['SugarcrmAccount'][_0x02d9('0x38')]);_0x55009a[_0x02d9('0x3b')]=_['keys'](_0x387021['query']);_0x55009a['filters']=_[_0x02d9('0x3c')](_0x55009a[_0x02d9('0x39')],_0x55009a[_0x02d9('0x3b')]);_0x26800f['attributes']=_['intersection'](_0x55009a[_0x02d9('0x39')],qs['fields'](_0x387021['query']['fields']));_0x26800f[_0x02d9('0x3d')]=_0x26800f['attributes']['length']?_0x26800f[_0x02d9('0x3d')]:_0x55009a['model'];if(_0x387021[_0x02d9('0x3b')][_0x02d9('0x51')]){_0x26800f[_0x02d9('0x4d')]=[{'all':!![]}];}_0x26800f=_[_0x02d9('0x47')]({},_0x26800f,_0x387021['options']);return db['SugarcrmAccount'][_0x02d9('0x52')](_0x26800f)['then'](handleEntityNotFound(_0x54ba5b,null))['then'](respondWithResult(_0x54ba5b,null))[_0x02d9('0x28')](handleError(_0x54ba5b,null));};exports[_0x02d9('0x53')]=function(_0x1f0653,_0x52756e){return db[_0x02d9('0x37')]['create'](_0x1f0653['body'],{})[_0x02d9('0x33')](respondWithResult(_0x52756e,0xc9))[_0x02d9('0x28')](handleError(_0x52756e,null));};exports['update']=function(_0x1981f0,_0x1fd460){if(_0x1981f0['body']['id']){delete _0x1981f0[_0x02d9('0x54')]['id'];}return db[_0x02d9('0x37')][_0x02d9('0x52')]({'where':{'id':_0x1981f0[_0x02d9('0x55')]['id']}})[_0x02d9('0x33')](handleEntityNotFound(_0x1fd460,null))[_0x02d9('0x33')](saveUpdates(_0x1981f0[_0x02d9('0x54')],null))[_0x02d9('0x33')](respondWithResult(_0x1fd460,null))[_0x02d9('0x28')](handleError(_0x1fd460,null));};exports[_0x02d9('0x56')]=function(_0x3f97db,_0x1cf1fa){return db[_0x02d9('0x37')][_0x02d9('0x52')]({'where':{'id':_0x3f97db[_0x02d9('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cf1fa,null))['then'](removeEntity(_0x1cf1fa,null))['catch'](handleError(_0x1cf1fa,null));};exports[_0x02d9('0x57')]=function(_0xb7aae7,_0x1df6d5,_0x59898c){var _0x277bc5={};var _0x675070={};var _0x3db17f;var _0xc31b6;return db['SugarcrmAccount'][_0x02d9('0x58')]({'where':{'id':_0xb7aae7[_0x02d9('0x55')]['id']}})['then'](handleEntityNotFound(_0x1df6d5,null))['then'](function(_0xabebb2){if(_0xabebb2){_0x3db17f=_0xabebb2;_0x675070[_0x02d9('0x39')]=_[_0x02d9('0x3a')](db[_0x02d9('0x59')][_0x02d9('0x38')]);_0x675070[_0x02d9('0x3b')]=_[_0x02d9('0x3a')](_0xb7aae7[_0x02d9('0x3b')]);_0x675070['filters']=_['intersection'](_0x675070[_0x02d9('0x39')],_0x675070[_0x02d9('0x3b')]);_0x277bc5[_0x02d9('0x3d')]=_[_0x02d9('0x3c')](_0x675070[_0x02d9('0x39')],qs[_0x02d9('0x3e')](_0xb7aae7['query'][_0x02d9('0x3e')]));_0x277bc5[_0x02d9('0x3d')]=_0x277bc5[_0x02d9('0x3d')][_0x02d9('0x5a')]?_0x277bc5[_0x02d9('0x3d')]:_0x675070[_0x02d9('0x39')];_0x277bc5[_0x02d9('0x41')]=qs[_0x02d9('0x42')](_0xb7aae7[_0x02d9('0x3b')][_0x02d9('0x42')]);_0x277bc5[_0x02d9('0x46')]=qs['filters'](_['pick'](_0xb7aae7['query'],_0x675070[_0x02d9('0x43')]));if(_0xb7aae7[_0x02d9('0x3b')][_0x02d9('0x45')]){_0x277bc5['where']=_[_0x02d9('0x47')](_0x277bc5[_0x02d9('0x46')],{'$or':_[_0x02d9('0x48')](_0x277bc5[_0x02d9('0x3d')],function(_0x4ef8af){var _0xcb3bbd={};_0xcb3bbd[_0x4ef8af]={'$like':'%'+_0xb7aae7[_0x02d9('0x3b')][_0x02d9('0x45')]+'%'};return _0xcb3bbd;})});}_0x277bc5=_['merge']({},_0x277bc5,_0xb7aae7[_0x02d9('0x4b')]);return _0x3db17f[_0x02d9('0x57')](_0x277bc5);}})[_0x02d9('0x33')](function(_0x2ba5d9){if(_0x2ba5d9){_0xc31b6=_0x2ba5d9[_0x02d9('0x5a')];if(!_0xb7aae7[_0x02d9('0x3b')][_0x02d9('0x3f')]('nolimit')){_0x277bc5[_0x02d9('0x2e')]=qs[_0x02d9('0x2e')](_0xb7aae7[_0x02d9('0x3b')][_0x02d9('0x2e')]);_0x277bc5['offset']=qs['offset'](_0xb7aae7[_0x02d9('0x3b')]['offset']);}return _0x3db17f[_0x02d9('0x57')](_0x277bc5);}})['then'](function(_0x29f5d2){if(_0x29f5d2){return _0x29f5d2?{'count':_0xc31b6,'rows':_0x29f5d2}:null;}})[_0x02d9('0x33')](respondWithResult(_0x1df6d5,null))[_0x02d9('0x28')](handleError(_0x1df6d5,null));};exports[_0x02d9('0x5b')]=function(_0x4ea6c6,_0x495293,_0x358fab){if(_0x4ea6c6['body']['id']){delete _0x4ea6c6[_0x02d9('0x54')]['id'];}return db['SugarcrmAccount'][_0x02d9('0x58')]({'where':{'id':_0x4ea6c6[_0x02d9('0x55')]['id']}})[_0x02d9('0x33')](handleEntityNotFound(_0x495293,null))[_0x02d9('0x33')](function(_0xf00c13){if(_0xf00c13){_0x4ea6c6[_0x02d9('0x54')]['AccountId']=_0xf00c13['id'];_0x4ea6c6[_0x02d9('0x54')][_0x02d9('0x5c')]=integrations[_0x02d9('0x5d')](_0x4ea6c6[_0x02d9('0x54')][_0x02d9('0x5e')],_0x4ea6c6['body'][_0x02d9('0x5f')]);_0x4ea6c6[_0x02d9('0x54')][_0x02d9('0x60')]=integrations[_0x02d9('0x61')](_0x4ea6c6['body'][_0x02d9('0x5e')],_0x4ea6c6[_0x02d9('0x54')][_0x02d9('0x5f')]);return db['SugarcrmConfiguration'][_0x02d9('0x53')](_0x4ea6c6[_0x02d9('0x54')],{'include':[{'model':db[_0x02d9('0x62')],'as':_0x02d9('0x5c')},{'model':db[_0x02d9('0x62')],'as':'Descriptions'}]});}return null;})[_0x02d9('0x33')](respondWithResult(_0x495293,null))[_0x02d9('0x28')](handleError(_0x495293,null));};exports[_0x02d9('0x63')]=function(_0x2233ab,_0x4ba89f,_0x7c3fa5){var _0x38f287='';var _0x35a19c=['id','name',_0x02d9('0x64'),_0x02d9('0x65'),_0x02d9('0x66'),_0x02d9('0x67'),'duration_hours','duration_minutes',_0x02d9('0x68'),'parent_type',_0x02d9('0x69'),'direction'];return db[_0x02d9('0x37')][_0x02d9('0x58')]({'where':{'id':_0x2233ab[_0x02d9('0x55')]['id']},'attributes':['id',_0x02d9('0x6a'),_0x02d9('0x6b'),_0x02d9('0x6c')]})[_0x02d9('0x33')](handleEntityNotFound(_0x4ba89f,null))['then'](function(_0x18f6cc){if(_0x18f6cc){_0x38f287=_0x18f6cc[_0x02d9('0x6c')];var _0x233a6f=_0x38f287[_0x02d9('0x6d')](-0x1);if(_0x233a6f==='/'){_0x38f287=_0x38f287[_0x02d9('0x6e')](0x0,_0x38f287[_0x02d9('0x6f')](_0x233a6f));}return rp({'method':_0x02d9('0x70'),'uri':util[_0x02d9('0x71')](_0x02d9('0x72'),_0x38f287,_0x02d9('0x73')),'json':!![],'form':{'method':'login','input_type':_0x02d9('0x74'),'response_type':'JSON','rest_data':JSON[_0x02d9('0x23')]({'user_auth':{'user_name':_0x18f6cc[_0x02d9('0x6a')],'password':_0x18f6cc[_0x02d9('0x6b')],'encryption':_0x02d9('0x75')},'application':_0x02d9('0x76')})}});}})[_0x02d9('0x33')](function(_0x18c974){if(_0x18c974&&_0x18c974['name']!==_0x02d9('0x77')&&_0x18c974[_0x02d9('0x35')]!==_0x02d9('0x78')){return rp({'method':_0x02d9('0x70'),'uri':util['format']('%s%s',_0x38f287,_0x02d9('0x73')),'json':!![],'form':{'method':_0x02d9('0x79'),'input_type':'JSON','response_type':_0x02d9('0x74'),'rest_data':JSON[_0x02d9('0x23')]({'session':_0x18c974['id'],'module_name':_0x02d9('0x7a')})}})[_0x02d9('0x33')](function(_0x338d6d){if(_0x338d6d){var _0x1a5ee6=_['values'](_0x338d6d[_0x02d9('0x7b')]);_[_0x02d9('0x7c')](_0x1a5ee6,function(_0x1ae69d){return _0x35a19c[_0x02d9('0x7d')](_0x1ae69d[_0x02d9('0x35')]);});return{'count':_0x1a5ee6['length'],'rows':_[_0x02d9('0x48')](_0x1a5ee6,function(_0x35195d){return{'id':_0x35195d[_0x02d9('0x35')],'name':_0x35195d[_0x02d9('0x7e')],'custom':_[_0x02d9('0x7f')](_0x35195d[_0x02d9('0x35')],'_c')?!![]:![],'options':_0x35195d[_0x02d9('0x4b')]?_['map'](_[_0x02d9('0x80')](_0x35195d[_0x02d9('0x4b')]),function(_0x581a9c){return{'name':_0x581a9c[_0x02d9('0x81')],'value':_0x581a9c[_0x02d9('0x35')]};}):[]};})};}})[_0x02d9('0x33')](respondWithResult(_0x4ba89f,null))[_0x02d9('0x28')](function(_0x12ea74){var _0x511fca=_0x2233ab['query'][_0x02d9('0x82')]?0x1f4:_0x12ea74[_0x02d9('0x83')]||0x1f4;logger[_0x02d9('0x24')](_0x02d9('0x84'),'getFields',_0x511fca,JSON[_0x02d9('0x23')](_0x12ea74));delete _0x12ea74[_0x02d9('0x35')];if(_0x511fca===0x191){_0x511fca=0x190;}_0x4ba89f[_0x02d9('0x2b')](_0x511fca)['send'](_0x2233ab[_0x02d9('0x3b')][_0x02d9('0x82')]?{'message':_0x02d9('0x85'),'statusCode':_0x12ea74[_0x02d9('0x83')]}:_0x12ea74);});}else{var _0x46c7fb=0x1f4;_0x4ba89f[_0x02d9('0x2b')](_0x46c7fb)[_0x02d9('0x36')]({'message':_0x02d9('0x85'),'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 681500e..ba7fb08 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 _0xffdf=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','./intSugarcrmAccount.attributes','define'];(function(_0x151ae3,_0x3a9195){var _0x564680=function(_0x244bf7){while(--_0x244bf7){_0x151ae3['push'](_0x151ae3['shift']());}};_0x564680(++_0x3a9195);}(_0xffdf,0x1e9));var _0xfffd=function(_0x1e6419,_0x170099){_0x1e6419=_0x1e6419-0x0;var _0x131da0=_0xffdf[_0x1e6419];return _0x131da0;};'use strict';var _=require(_0xfffd('0x0'));var util=require('util');var logger=require(_0xfffd('0x1'))(_0xfffd('0x2'));var moment=require(_0xfffd('0x3'));var BPromise=require(_0xfffd('0x4'));var rp=require('request-promise');var attributes=require(_0xfffd('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3b93c1,_0x5a7d30){return _0x3b93c1[_0xfffd('0x6')]('SugarcrmAccount',attributes,{'tableName':_0xfffd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce8=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','api','moment','bluebird','request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x36e455,_0x513a9f){var _0x2bcd35=function(_0x9b892){while(--_0x9b892){_0x36e455['push'](_0x36e455['shift']());}};_0x2bcd35(++_0x513a9f);}(_0x2ce8,0x158));var _0x82ce=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0x2ce8[_0x112fe3];return _0x1ec903;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x82ce('0x0'));var moment=require(_0x82ce('0x1'));var BPromise=require(_0x82ce('0x2'));var rp=require(_0x82ce('0x3'));var attributes=require(_0x82ce('0x4'));var integrations=require(_0x82ce('0x5'));module[_0x82ce('0x6')]=function(_0x37151d,_0x389b10){return _0x37151d[_0x82ce('0x7')](_0x82ce('0x8'),attributes,{'tableName':_0x82ce('0x9'),'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 0532a8b..e4e9069 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 _0x5153=['find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','findAll','options','raw','limit','include','map','model','attributes','SugarcrmAccount'];(function(_0x411534,_0x10cdf1){var _0x360cb6=function(_0xc4fa4b){while(--_0xc4fa4b){_0x411534['push'](_0x411534['shift']());}};_0x360cb6(++_0x10cdf1);}(_0x5153,0x12a));var _0x3515=function(_0x2b7517,_0x2f1ef1){_0x2b7517=_0x2b7517-0x0;var _0xdcecc3=_0x5153[_0x2b7517];return _0xdcecc3;};'use strict';var _=require(_0x3515('0x0'));var util=require(_0x3515('0x1'));var moment=require(_0x3515('0x2'));var BPromise=require(_0x3515('0x3'));var rs=require(_0x3515('0x4'));var fs=require('fs');var Redis=require(_0x3515('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3515('0x6'));var logger=require(_0x3515('0x7'))(_0x3515('0x8'));var config=require('../../config/environment');var jayson=require(_0x3515('0x9'));var client=jayson[_0x3515('0xa')][_0x3515('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48f01f,_0x595901,_0x5e74f0){return new BPromise(function(_0x21fb02,_0x154a09){return client[_0x3515('0xc')](_0x48f01f,_0x5e74f0)[_0x3515('0xd')](function(_0x5aa341){logger[_0x3515('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x595901,_0x3515('0xf'));logger[_0x3515('0x10')](_0x3515('0x11'),_0x595901,_0x3515('0xf'),JSON[_0x3515('0x12')](_0x5aa341));if(_0x5aa341[_0x3515('0x13')]){if(_0x5aa341[_0x3515('0x13')][_0x3515('0x14')]===0x1f4){logger[_0x3515('0x13')](_0x3515('0x15'),_0x595901,_0x5aa341[_0x3515('0x13')][_0x3515('0x16')]);return _0x154a09(_0x5aa341[_0x3515('0x13')][_0x3515('0x16')]);}logger[_0x3515('0x13')](_0x3515('0x15'),_0x595901,_0x5aa341[_0x3515('0x13')][_0x3515('0x16')]);return _0x21fb02(_0x5aa341[_0x3515('0x13')][_0x3515('0x16')]);}else{logger[_0x3515('0xe')](_0x3515('0x15'),_0x595901,_0x3515('0xf'));_0x21fb02(_0x5aa341[_0x3515('0x17')][_0x3515('0x16')]);}})[_0x3515('0x18')](function(_0x48ad7f){logger[_0x3515('0x13')](_0x3515('0x15'),_0x595901,_0x48ad7f);_0x154a09(_0x48ad7f);});});}exports[_0x3515('0x19')]=function(_0x2401af){var _0x3c08b0=this;return new Promise(function(_0x4e9d6a,_0x336691){return db['SugarcrmAccount'][_0x3515('0x1a')]({'raw':_0x2401af[_0x3515('0x1b')]?_0x2401af['options'][_0x3515('0x1c')]===undefined?!![]:![]:!![],'where':_0x2401af[_0x3515('0x1b')]?_0x2401af[_0x3515('0x1b')]['where']||null:null,'attributes':_0x2401af[_0x3515('0x1b')]?_0x2401af[_0x3515('0x1b')]['attributes']||null:null,'limit':_0x2401af[_0x3515('0x1b')]?_0x2401af[_0x3515('0x1b')][_0x3515('0x1d')]||null:null,'include':_0x2401af[_0x3515('0x1b')]?_0x2401af[_0x3515('0x1b')][_0x3515('0x1e')]?_[_0x3515('0x1f')](_0x2401af[_0x3515('0x1b')][_0x3515('0x1e')],function(_0x4b7487){return{'model':db[_0x4b7487[_0x3515('0x20')]],'as':_0x4b7487['as'],'attributes':_0x4b7487[_0x3515('0x21')],'include':_0x4b7487[_0x3515('0x1e')]?_[_0x3515('0x1f')](_0x4b7487[_0x3515('0x1e')],function(_0x1e4ff0){return{'model':db[_0x1e4ff0[_0x3515('0x20')]],'as':_0x1e4ff0['as'],'attributes':_0x1e4ff0[_0x3515('0x21')],'include':_0x1e4ff0[_0x3515('0x1e')]?_[_0x3515('0x1f')](_0x1e4ff0['include'],function(_0x162f55){return{'model':db[_0x162f55['model']],'as':_0x162f55['as'],'attributes':_0x162f55[_0x3515('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3515('0xd')](function(_0x1384c4){logger[_0x3515('0xe')](_0x3515('0x19'),_0x2401af);logger[_0x3515('0x10')](_0x3515('0x19'),_0x2401af,JSON[_0x3515('0x12')](_0x1384c4));_0x4e9d6a(_0x1384c4);})[_0x3515('0x18')](function(_0x4ca4fd){logger[_0x3515('0x13')](_0x3515('0x19'),_0x4ca4fd[_0x3515('0x16')],_0x2401af);_0x336691(_0x3c08b0[_0x3515('0x13')](0x1f4,_0x4ca4fd[_0x3515('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x1fae57){var _0x5b78eb=this;return new Promise(function(_0x32b5ef,_0x252457){return db[_0x3515('0x22')][_0x3515('0x23')]({'raw':_0x1fae57[_0x3515('0x1b')]?_0x1fae57[_0x3515('0x1b')][_0x3515('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fae57[_0x3515('0x1b')]?_0x1fae57[_0x3515('0x1b')]['where']||null:null,'attributes':_0x1fae57['options']?_0x1fae57[_0x3515('0x1b')][_0x3515('0x21')]||null:null,'include':_0x1fae57['options']?_0x1fae57[_0x3515('0x1b')][_0x3515('0x1e')]?_[_0x3515('0x1f')](_0x1fae57['options'][_0x3515('0x1e')],function(_0x5f07a4){return{'model':db[_0x5f07a4[_0x3515('0x20')]],'as':_0x5f07a4['as'],'attributes':_0x5f07a4[_0x3515('0x21')],'include':_0x5f07a4[_0x3515('0x1e')]?_[_0x3515('0x1f')](_0x5f07a4[_0x3515('0x1e')],function(_0xb27b01){return{'model':db[_0xb27b01[_0x3515('0x20')]],'as':_0xb27b01['as'],'attributes':_0xb27b01['attributes'],'include':_0xb27b01['include']?_['map'](_0xb27b01['include'],function(_0x51cf80){return{'model':db[_0x51cf80[_0x3515('0x20')]],'as':_0x51cf80['as'],'attributes':_0x51cf80[_0x3515('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3515('0xd')](function(_0x421524){logger[_0x3515('0xe')](_0x3515('0x24'),_0x1fae57);logger[_0x3515('0x10')](_0x3515('0x24'),_0x1fae57,JSON[_0x3515('0x12')](_0x421524));_0x32b5ef(_0x421524);})[_0x3515('0x18')](function(_0x1898a3){logger[_0x3515('0x13')](_0x3515('0x24'),_0x1898a3[_0x3515('0x16')],_0x1fae57);_0x252457(_0x5b78eb[_0x3515('0x13')](0x1f4,_0x1898a3[_0x3515('0x16')]));});});}; \ No newline at end of file +var _0x1377=['jayson/promise','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','map','model','attributes','ShowSugarcrmAccount','find','raw','lodash','moment','bluebird','rpc'];(function(_0xa86679,_0x5524c7){var _0x5c2914=function(_0x20bba7){while(--_0x20bba7){_0xa86679['push'](_0xa86679['shift']());}};_0x5c2914(++_0x5524c7);}(_0x1377,0x88));var _0x7137=function(_0x42a639,_0x3fb674){_0x42a639=_0x42a639-0x0;var _0x4c4a5b=_0x1377[_0x42a639];return _0x4c4a5b;};'use strict';var _=require(_0x7137('0x0'));var util=require('util');var moment=require(_0x7137('0x1'));var BPromise=require(_0x7137('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7137('0x3'));var config=require('../../config/environment');var jayson=require(_0x7137('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56839c,_0x203eb0,_0x3aea6f){return new BPromise(function(_0x435284,_0x2851b3){return client[_0x7137('0x5')](_0x56839c,_0x3aea6f)[_0x7137('0x6')](function(_0x25b690){logger['info'](_0x7137('0x7'),_0x203eb0,'request\x20sent');logger[_0x7137('0x8')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x203eb0,_0x7137('0x9'),JSON[_0x7137('0xa')](_0x25b690));if(_0x25b690[_0x7137('0xb')]){if(_0x25b690[_0x7137('0xb')]['code']===0x1f4){logger[_0x7137('0xb')](_0x7137('0x7'),_0x203eb0,_0x25b690[_0x7137('0xb')][_0x7137('0xc')]);return _0x2851b3(_0x25b690[_0x7137('0xb')][_0x7137('0xc')]);}logger[_0x7137('0xb')](_0x7137('0x7'),_0x203eb0,_0x25b690[_0x7137('0xb')][_0x7137('0xc')]);return _0x435284(_0x25b690[_0x7137('0xb')][_0x7137('0xc')]);}else{logger[_0x7137('0xd')](_0x7137('0x7'),_0x203eb0,_0x7137('0x9'));_0x435284(_0x25b690[_0x7137('0xe')][_0x7137('0xc')]);}})[_0x7137('0xf')](function(_0x2d55c0){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x203eb0,_0x2d55c0);_0x2851b3(_0x2d55c0);});});}exports[_0x7137('0x10')]=function(_0x125ee0){var _0x258e62=this;return new Promise(function(_0x2bad29,_0x27eb0d){return db[_0x7137('0x11')][_0x7137('0x12')]({'raw':_0x125ee0[_0x7137('0x13')]?_0x125ee0[_0x7137('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x125ee0['options']?_0x125ee0['options'][_0x7137('0x14')]||null:null,'attributes':_0x125ee0[_0x7137('0x13')]?_0x125ee0[_0x7137('0x13')]['attributes']||null:null,'limit':_0x125ee0['options']?_0x125ee0[_0x7137('0x13')]['limit']||null:null,'include':_0x125ee0[_0x7137('0x13')]?_0x125ee0[_0x7137('0x13')][_0x7137('0x15')]?_[_0x7137('0x16')](_0x125ee0['options'][_0x7137('0x15')],function(_0x2c6192){return{'model':db[_0x2c6192[_0x7137('0x17')]],'as':_0x2c6192['as'],'attributes':_0x2c6192[_0x7137('0x18')],'include':_0x2c6192[_0x7137('0x15')]?_[_0x7137('0x16')](_0x2c6192[_0x7137('0x15')],function(_0x18d23e){return{'model':db[_0x18d23e[_0x7137('0x17')]],'as':_0x18d23e['as'],'attributes':_0x18d23e[_0x7137('0x18')],'include':_0x18d23e['include']?_[_0x7137('0x16')](_0x18d23e['include'],function(_0x551731){return{'model':db[_0x551731['model']],'as':_0x551731['as'],'attributes':_0x551731[_0x7137('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7137('0x6')](function(_0x5ddf88){logger[_0x7137('0xd')](_0x7137('0x10'),_0x125ee0);logger[_0x7137('0x8')]('GetSugarcrmAccount',_0x125ee0,JSON['stringify'](_0x5ddf88));_0x2bad29(_0x5ddf88);})['catch'](function(_0x3546c7){logger['error'](_0x7137('0x10'),_0x3546c7[_0x7137('0xc')],_0x125ee0);_0x27eb0d(_0x258e62[_0x7137('0xb')](0x1f4,_0x3546c7[_0x7137('0xc')]));});});};exports[_0x7137('0x19')]=function(_0x35a5eb){var _0x1fe4eb=this;return new Promise(function(_0x5af048,_0x4d398c){return db[_0x7137('0x11')][_0x7137('0x1a')]({'raw':_0x35a5eb['options']?_0x35a5eb[_0x7137('0x13')][_0x7137('0x1b')]===undefined?!![]:![]:!![],'where':_0x35a5eb[_0x7137('0x13')]?_0x35a5eb[_0x7137('0x13')][_0x7137('0x14')]||null:null,'attributes':_0x35a5eb[_0x7137('0x13')]?_0x35a5eb[_0x7137('0x13')]['attributes']||null:null,'include':_0x35a5eb[_0x7137('0x13')]?_0x35a5eb[_0x7137('0x13')][_0x7137('0x15')]?_['map'](_0x35a5eb[_0x7137('0x13')][_0x7137('0x15')],function(_0x58d3e8){return{'model':db[_0x58d3e8['model']],'as':_0x58d3e8['as'],'attributes':_0x58d3e8['attributes'],'include':_0x58d3e8['include']?_[_0x7137('0x16')](_0x58d3e8[_0x7137('0x15')],function(_0x5833b4){return{'model':db[_0x5833b4[_0x7137('0x17')]],'as':_0x5833b4['as'],'attributes':_0x5833b4['attributes'],'include':_0x5833b4[_0x7137('0x15')]?_[_0x7137('0x16')](_0x5833b4['include'],function(_0x2e453){return{'model':db[_0x2e453['model']],'as':_0x2e453['as'],'attributes':_0x2e453[_0x7137('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x115a40){logger['info'](_0x7137('0x19'),_0x35a5eb);logger['debug'](_0x7137('0x19'),_0x35a5eb,JSON[_0x7137('0xa')](_0x115a40));_0x5af048(_0x115a40);})[_0x7137('0xf')](function(_0x52fd50){logger[_0x7137('0xb')](_0x7137('0x19'),_0x52fd50[_0x7137('0xc')],_0x35a5eb);_0x4d398c(_0x1fe4eb[_0x7137('0xb')](0x1f4,_0x52fd50[_0x7137('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index eb70558..aa2788a 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 _0xbe23=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','/:id','update','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x59baca,_0x57e86c){var _0x234394=function(_0xf8efb9){while(--_0xf8efb9){_0x59baca['push'](_0x59baca['shift']());}};_0x234394(++_0x57e86c);}(_0xbe23,0x1c2));var _0x3be2=function(_0x281f63,_0x1fe661){_0x281f63=_0x281f63-0x0;var _0x1d02c9=_0xbe23[_0x281f63];return _0x1d02c9;};'use strict';var multer=require(_0x3be2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3be2('0x1'));var express=require(_0x3be2('0x2'));var router=express[_0x3be2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3be2('0x4'));var config=require(_0x3be2('0x5'));var controller=require(_0x3be2('0x6'));router[_0x3be2('0x7')]('/',auth[_0x3be2('0x8')](),controller[_0x3be2('0x9')]);router['get']('/:id',auth[_0x3be2('0x8')](),controller[_0x3be2('0xa')]);router[_0x3be2('0x7')](_0x3be2('0xb'),auth['isAuthenticated'](),controller[_0x3be2('0xc')]);router[_0x3be2('0x7')](_0x3be2('0xd'),auth[_0x3be2('0x8')](),controller[_0x3be2('0xe')]);router[_0x3be2('0x7')](_0x3be2('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x3be2('0x8')](),controller[_0x3be2('0x10')]);router['put'](_0x3be2('0x11'),auth[_0x3be2('0x8')](),controller[_0x3be2('0x12')]);router['delete'](_0x3be2('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x3be2('0x13')]=router; \ No newline at end of file +var _0xe6eb=['getDescriptions','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','show','get','getFields','/:id/subjects','getSubjects'];(function(_0xa029a,_0x2771d5){var _0x495458=function(_0x5e5e01){while(--_0x5e5e01){_0xa029a['push'](_0xa029a['shift']());}};_0x495458(++_0x2771d5);}(_0xe6eb,0xd7));var _0xbe6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6eb[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xbe6e('0x0'));var util=require(_0xbe6e('0x1'));var path=require(_0xbe6e('0x2'));var timeout=require(_0xbe6e('0x3'));var express=require(_0xbe6e('0x4'));var router=express[_0xbe6e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe6e('0x6'));var config=require(_0xbe6e('0x7'));var controller=require(_0xbe6e('0x8'));router['get']('/',auth[_0xbe6e('0x9')](),controller['index']);router['get']('/:id',auth[_0xbe6e('0x9')](),controller[_0xbe6e('0xa')]);router[_0xbe6e('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbe6e('0xc')]);router[_0xbe6e('0xb')](_0xbe6e('0xd'),auth[_0xbe6e('0x9')](),controller[_0xbe6e('0xe')]);router[_0xbe6e('0xb')]('/:id/descriptions',auth[_0xbe6e('0x9')](),controller[_0xbe6e('0xf')]);router[_0xbe6e('0x10')]('/',auth[_0xbe6e('0x9')](),controller[_0xbe6e('0x11')]);router[_0xbe6e('0x12')]('/:id',auth[_0xbe6e('0x9')](),controller[_0xbe6e('0x13')]);router['delete'](_0xbe6e('0x14'),auth[_0xbe6e('0x9')](),controller[_0xbe6e('0x15')]);module[_0xbe6e('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 1a358e3..19ed458 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 _0x2346=['sequelize','STRING'];(function(_0x3a5d87,_0x124b3a){var _0x312bf8=function(_0x266a53){while(--_0x266a53){_0x3a5d87['push'](_0x3a5d87['shift']());}};_0x312bf8(++_0x124b3a);}(_0x2346,0x74));var _0x6234=function(_0x5782a3,_0x2d54f3){_0x5782a3=_0x5782a3-0x0;var _0x5dcae1=_0x2346[_0x5782a3];return _0x5dcae1;};'use strict';var Sequelize=require(_0x6234('0x0'));module['exports']={'name':{'type':Sequelize[_0x6234('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4e00=['exports','STRING','sequelize'];(function(_0x49347f,_0x187a45){var _0x467e4f=function(_0xb8ca99){while(--_0xb8ca99){_0x49347f['push'](_0x49347f['shift']());}};_0x467e4f(++_0x187a45);}(_0x4e00,0x65));var _0x04e0=function(_0x3c1228,_0x4e893c){_0x3c1228=_0x3c1228-0x0;var _0x5ecc3a=_0x4e00[_0x3c1228];return _0x5ecc3a;};'use strict';var Sequelize=require(_0x04e0('0x0'));module[_0x04e0('0x1')]={'name':{'type':Sequelize[_0x04e0('0x2')]},'description':{'type':Sequelize[_0x04e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index eec213d..453c6b4 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 _0x4d29=['fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','apply','reject','update','destroy','stack','name','index','SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','show','params','find','create','body','getFields','SugarcrmField','map','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf'];(function(_0x16697e,_0x112bf8){var _0x218ede=function(_0x1104dd){while(--_0x1104dd){_0x16697e['push'](_0x16697e['shift']());}};_0x218ede(++_0x112bf8);}(_0x4d29,0xad));var _0x94d2=function(_0x15f3f4,_0xadf4e7){_0x15f3f4=_0x15f3f4-0x0;var _0x406586=_0x4d29[_0x15f3f4];return _0x406586;};'use strict';var pdf=require(_0x94d2('0x0'));var emlformat=require(_0x94d2('0x1'));var rimraf=require(_0x94d2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94d2('0x3'));var rp=require(_0x94d2('0x4'));var moment=require('moment');var BPromise=require(_0x94d2('0x5'));var Mustache=require(_0x94d2('0x6'));var util=require('util');var path=require(_0x94d2('0x7'));var sox=require(_0x94d2('0x8'));var csv=require(_0x94d2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x94d2('0xa'));var crypto=require('crypto');var jsforce=require(_0x94d2('0xb'));var deskjs=require(_0x94d2('0xc'));var toCsv=require(_0x94d2('0x9'));var querystring=require('querystring');var Papa=require(_0x94d2('0xd'));var authService=require(_0x94d2('0xe'));var hardwareService=require(_0x94d2('0xf'));var Redis=require(_0x94d2('0x10'));var qs=require(_0x94d2('0x11'));var logger=require('../../config/logger')(_0x94d2('0x12'));var utils=require(_0x94d2('0x13'));var config=require('../../config/environment');var db=require(_0x94d2('0x14'))['db'];var jayson=require(_0x94d2('0x15'));var client=jayson[_0x94d2('0x16')][_0x94d2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x156492,_0x336081,_0x1ad713,_0x3fb0b2){return new BPromise(function(_0x30c270,_0x315f9f){var _0x1a27a9=_0x3fb0b2||client;return _0x1a27a9[_0x94d2('0x18')](_0x156492,_0x1ad713)[_0x94d2('0x19')](function(_0x585618){logger[_0x94d2('0x1a')](_0x94d2('0x1b'),_0x336081,_0x94d2('0x1c'));logger['debug'](_0x94d2('0x1d'),_0x336081,'request\x20sent',JSON[_0x94d2('0x1e')](_0x585618));if(_0x585618[_0x94d2('0x1f')]){if(_0x585618['error'][_0x94d2('0x20')]===0x1f4){logger[_0x94d2('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x336081,_0x585618[_0x94d2('0x1f')][_0x94d2('0x21')]);return _0x315f9f(_0x585618[_0x94d2('0x1f')][_0x94d2('0x21')]);}logger[_0x94d2('0x1f')](_0x94d2('0x1b'),_0x336081,_0x585618[_0x94d2('0x1f')][_0x94d2('0x21')]);return _0x30c270(_0x585618['error'][_0x94d2('0x21')]);}else{logger['info'](_0x94d2('0x1b'),_0x336081,_0x94d2('0x1c'));_0x30c270(_0x585618[_0x94d2('0x22')]['message']);}})[_0x94d2('0x23')](function(_0x40a773){logger['error'](_0x94d2('0x1b'),_0x336081,_0x40a773);_0x315f9f(_0x40a773);});});}function respondWithStatusCode(_0x246ca2,_0x5dc38d){_0x5dc38d=_0x5dc38d||0xcc;return function(_0x42ccb8){if(_0x42ccb8){return _0x246ca2[_0x94d2('0x24')](_0x5dc38d);}return _0x246ca2['status'](_0x5dc38d)[_0x94d2('0x25')]();};}function respondWithResult(_0x464905,_0x3eb379){_0x3eb379=_0x3eb379||0xc8;return function(_0x31fd06){if(_0x31fd06){return _0x464905[_0x94d2('0x26')](_0x3eb379)[_0x94d2('0x27')](_0x31fd06);}};}function respondWithFilteredResult(_0x46970e,_0x3ed98d){return function(_0x2445e4){if(_0x2445e4){var _0x1e75cb=_0x2445e4['count'],_0x170b11=_0x3ed98d[_0x94d2('0x28')],_0x7ea655=_0x3ed98d['offset']+_0x3ed98d[_0x94d2('0x29')],_0x2f4b64;if(_0x7ea655>=_0x1e75cb){_0x7ea655=_0x1e75cb;_0x2f4b64=0xc8;}else{_0x2f4b64=0xce;}_0x46970e[_0x94d2('0x26')](_0x2f4b64);return _0x46970e[_0x94d2('0x2a')]('Content-Range',_0x170b11+'-'+_0x7ea655+'/'+_0x1e75cb)[_0x94d2('0x27')](_0x2445e4);}return null;};}function patchUpdates(_0x54c9e7){return function(_0x2c888c){try{jsonpatch[_0x94d2('0x2b')](_0x2c888c,_0x54c9e7,!![]);}catch(_0x2bf20a){return BPromise[_0x94d2('0x2c')](_0x2bf20a);}return _0x2c888c['save']();};}function saveUpdates(_0x18fcc8,_0x264fb4){return function(_0xf46c65){if(_0xf46c65){return _0xf46c65[_0x94d2('0x2d')](_0x18fcc8)[_0x94d2('0x19')](function(_0x4ad6af){return _0x4ad6af;});}return null;};}function removeEntity(_0x188aa2,_0x530852){return function(_0x107070){if(_0x107070){return _0x107070[_0x94d2('0x2e')]()['then'](function(){_0x188aa2[_0x94d2('0x26')](0xcc)[_0x94d2('0x25')]();});}};}function handleEntityNotFound(_0xc8d09d,_0x193756){return function(_0x1251c2){if(!_0x1251c2){_0xc8d09d[_0x94d2('0x24')](0x194);}return _0x1251c2;};}function handleError(_0x3ebb32,_0x57ac56){_0x57ac56=_0x57ac56||0x1f4;return function(_0x3c684d){logger[_0x94d2('0x1f')](_0x3c684d[_0x94d2('0x2f')]);if(_0x3c684d[_0x94d2('0x30')]){delete _0x3c684d[_0x94d2('0x30')];}_0x3ebb32['status'](_0x57ac56)['send'](_0x3c684d);};}exports[_0x94d2('0x31')]=function(_0x341f09,_0x56c62b){var _0x46f9f2={},_0x2f8a5f={},_0x250183={'count':0x0,'rows':[]};var _0x1cddbe=db[_0x94d2('0x32')][_0x94d2('0x33')];_0x2f8a5f[_0x94d2('0x34')]=_[_0x94d2('0x35')](_0x1cddbe);_0x2f8a5f[_0x94d2('0x36')]=_[_0x94d2('0x35')](_0x341f09['query']);_0x2f8a5f[_0x94d2('0x37')]=_[_0x94d2('0x38')](_0x2f8a5f[_0x94d2('0x34')],_0x2f8a5f['query']);_0x46f9f2['attributes']=_[_0x94d2('0x38')](_0x2f8a5f[_0x94d2('0x34')],qs[_0x94d2('0x39')](_0x341f09[_0x94d2('0x36')][_0x94d2('0x39')]));_0x46f9f2[_0x94d2('0x3a')]=_0x46f9f2[_0x94d2('0x3a')][_0x94d2('0x3b')]?_0x46f9f2['attributes']:_0x2f8a5f[_0x94d2('0x34')];if(!_0x341f09[_0x94d2('0x36')][_0x94d2('0x3c')](_0x94d2('0x3d'))){_0x46f9f2[_0x94d2('0x29')]=qs[_0x94d2('0x29')](_0x341f09[_0x94d2('0x36')][_0x94d2('0x29')]);_0x46f9f2[_0x94d2('0x28')]=qs[_0x94d2('0x28')](_0x341f09['query'][_0x94d2('0x28')]);}_0x46f9f2[_0x94d2('0x3e')]=qs[_0x94d2('0x3f')](_0x341f09[_0x94d2('0x36')][_0x94d2('0x3f')]);_0x46f9f2[_0x94d2('0x40')]=qs[_0x94d2('0x37')](_[_0x94d2('0x41')](_0x341f09[_0x94d2('0x36')],_0x2f8a5f[_0x94d2('0x37')]));if(_0x341f09[_0x94d2('0x36')]['filter']){_0x46f9f2[_0x94d2('0x40')]=_[_0x94d2('0x42')](_0x46f9f2[_0x94d2('0x40')],{'$or':_['map'](_0x1cddbe,function(_0x38f074){if(_0x38f074[_0x94d2('0x43')][_0x94d2('0x44')]!==_0x94d2('0x45')){var _0x256073={};_0x256073[_0x38f074[_0x94d2('0x46')]]={'$like':'%'+_0x341f09[_0x94d2('0x36')][_0x94d2('0x47')]+'%'};return _0x256073;}})});}_0x46f9f2=_[_0x94d2('0x42')]({},_0x46f9f2,_0x341f09[_0x94d2('0x48')]);var _0x2369e4={'where':_0x46f9f2[_0x94d2('0x40')]};return db[_0x94d2('0x32')]['count'](_0x2369e4)[_0x94d2('0x19')](function(_0x4d9d58){_0x250183[_0x94d2('0x49')]=_0x4d9d58;if(_0x341f09['query'][_0x94d2('0x4a')]){_0x46f9f2[_0x94d2('0x4b')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x94d2('0x4c')](_0x46f9f2);})[_0x94d2('0x19')](function(_0x29611f){_0x250183['rows']=_0x29611f;return _0x250183;})['then'](respondWithFilteredResult(_0x56c62b,_0x46f9f2))[_0x94d2('0x23')](handleError(_0x56c62b,null));};exports[_0x94d2('0x4d')]=function(_0x24962f,_0x691427){var _0x344f70={'raw':![],'where':{'id':_0x24962f[_0x94d2('0x4e')]['id']}},_0xa676d8={};_0xa676d8[_0x94d2('0x34')]=_[_0x94d2('0x35')](db[_0x94d2('0x32')]['rawAttributes']);_0xa676d8['query']=_[_0x94d2('0x35')](_0x24962f[_0x94d2('0x36')]);_0xa676d8[_0x94d2('0x37')]=_['intersection'](_0xa676d8['model'],_0xa676d8[_0x94d2('0x36')]);_0x344f70['attributes']=_[_0x94d2('0x38')](_0xa676d8['model'],qs[_0x94d2('0x39')](_0x24962f['query'][_0x94d2('0x39')]));_0x344f70[_0x94d2('0x3a')]=_0x344f70[_0x94d2('0x3a')][_0x94d2('0x3b')]?_0x344f70[_0x94d2('0x3a')]:_0xa676d8[_0x94d2('0x34')];if(_0x24962f[_0x94d2('0x36')][_0x94d2('0x4a')]){_0x344f70['include']=[{'all':!![]}];}_0x344f70=_[_0x94d2('0x42')]({},_0x344f70,_0x24962f[_0x94d2('0x48')]);return db['SugarcrmConfiguration'][_0x94d2('0x4f')](_0x344f70)[_0x94d2('0x19')](handleEntityNotFound(_0x691427,null))[_0x94d2('0x19')](respondWithResult(_0x691427,null))[_0x94d2('0x23')](handleError(_0x691427,null));};exports[_0x94d2('0x50')]=function(_0x371fe3,_0x2adc6e){return db['SugarcrmConfiguration']['create'](_0x371fe3[_0x94d2('0x51')],{})['then'](respondWithResult(_0x2adc6e,0xc9))[_0x94d2('0x23')](handleError(_0x2adc6e,null));};exports[_0x94d2('0x2d')]=function(_0x3b84e7,_0x53049d){if(_0x3b84e7[_0x94d2('0x51')]['id']){delete _0x3b84e7[_0x94d2('0x51')]['id'];}return db[_0x94d2('0x32')][_0x94d2('0x4f')]({'where':{'id':_0x3b84e7['params']['id']}})[_0x94d2('0x19')](handleEntityNotFound(_0x53049d,null))['then'](saveUpdates(_0x3b84e7[_0x94d2('0x51')],null))[_0x94d2('0x19')](respondWithResult(_0x53049d,null))['catch'](handleError(_0x53049d,null));};exports[_0x94d2('0x2e')]=function(_0x50d13b,_0x242a99){return db[_0x94d2('0x32')]['find']({'where':{'id':_0x50d13b[_0x94d2('0x4e')]['id']}})[_0x94d2('0x19')](handleEntityNotFound(_0x242a99,null))[_0x94d2('0x19')](removeEntity(_0x242a99,null))['catch'](handleError(_0x242a99,null));};exports[_0x94d2('0x52')]=function(_0x2217a2,_0x338e96,_0xecc5cc){var _0x2cf877={};var _0xe7fa07={};var _0x38ff8e;var _0x471027;return db[_0x94d2('0x32')]['findOne']({'where':{'id':_0x2217a2[_0x94d2('0x4e')]['id']}})[_0x94d2('0x19')](handleEntityNotFound(_0x338e96,null))[_0x94d2('0x19')](function(_0x1a2089){if(_0x1a2089){_0x38ff8e=_0x1a2089;_0xe7fa07[_0x94d2('0x34')]=_[_0x94d2('0x35')](db[_0x94d2('0x53')][_0x94d2('0x33')]);_0xe7fa07['query']=_['keys'](_0x2217a2[_0x94d2('0x36')]);_0xe7fa07[_0x94d2('0x37')]=_[_0x94d2('0x38')](_0xe7fa07[_0x94d2('0x34')],_0xe7fa07[_0x94d2('0x36')]);_0x2cf877[_0x94d2('0x3a')]=_[_0x94d2('0x38')](_0xe7fa07[_0x94d2('0x34')],qs[_0x94d2('0x39')](_0x2217a2['query']['fields']));_0x2cf877[_0x94d2('0x3a')]=_0x2cf877[_0x94d2('0x3a')][_0x94d2('0x3b')]?_0x2cf877[_0x94d2('0x3a')]:_0xe7fa07['model'];_0x2cf877[_0x94d2('0x3e')]=qs['sort'](_0x2217a2['query'][_0x94d2('0x3f')]);_0x2cf877['where']=qs['filters'](_[_0x94d2('0x41')](_0x2217a2[_0x94d2('0x36')],_0xe7fa07[_0x94d2('0x37')]));if(_0x2217a2[_0x94d2('0x36')][_0x94d2('0x47')]){_0x2cf877[_0x94d2('0x40')]=_[_0x94d2('0x42')](_0x2cf877['where'],{'$or':_[_0x94d2('0x54')](_0x2cf877['attributes'],function(_0x56ede7){var _0x26402a={};_0x26402a[_0x56ede7]={'$like':'%'+_0x2217a2[_0x94d2('0x36')][_0x94d2('0x47')]+'%'};return _0x26402a;})});}_0x2cf877=_['merge']({},_0x2cf877,_0x2217a2[_0x94d2('0x48')]);return _0x38ff8e[_0x94d2('0x52')](_0x2cf877);}})[_0x94d2('0x19')](function(_0x2a3394){if(_0x2a3394){_0x471027=_0x2a3394['length'];if(!_0x2217a2[_0x94d2('0x36')][_0x94d2('0x3c')](_0x94d2('0x3d'))){_0x2cf877[_0x94d2('0x29')]=qs[_0x94d2('0x29')](_0x2217a2[_0x94d2('0x36')]['limit']);_0x2cf877['offset']=qs[_0x94d2('0x28')](_0x2217a2['query'][_0x94d2('0x28')]);}return _0x38ff8e[_0x94d2('0x52')](_0x2cf877);}})['then'](function(_0x5125f6){if(_0x5125f6){return _0x5125f6?{'count':_0x471027,'rows':_0x5125f6}:null;}})[_0x94d2('0x19')](respondWithResult(_0x338e96,null))['catch'](handleError(_0x338e96,null));};exports[_0x94d2('0x55')]=function(_0x4591b0,_0x541587,_0x340182){var _0x52c0bc={};var _0x52c561={};var _0x44b0b3;var _0x3d01c8;return db[_0x94d2('0x32')][_0x94d2('0x56')]({'where':{'id':_0x4591b0[_0x94d2('0x4e')]['id']}})[_0x94d2('0x19')](handleEntityNotFound(_0x541587,null))['then'](function(_0x1b4b7d){if(_0x1b4b7d){_0x44b0b3=_0x1b4b7d;_0x52c561[_0x94d2('0x34')]=_[_0x94d2('0x35')](db[_0x94d2('0x53')]['rawAttributes']);_0x52c561[_0x94d2('0x36')]=_[_0x94d2('0x35')](_0x4591b0[_0x94d2('0x36')]);_0x52c561[_0x94d2('0x37')]=_[_0x94d2('0x38')](_0x52c561[_0x94d2('0x34')],_0x52c561[_0x94d2('0x36')]);_0x52c0bc[_0x94d2('0x3a')]=_['intersection'](_0x52c561[_0x94d2('0x34')],qs[_0x94d2('0x39')](_0x4591b0[_0x94d2('0x36')]['fields']));_0x52c0bc[_0x94d2('0x3a')]=_0x52c0bc[_0x94d2('0x3a')][_0x94d2('0x3b')]?_0x52c0bc['attributes']:_0x52c561['model'];_0x52c0bc[_0x94d2('0x3e')]=qs['sort'](_0x4591b0[_0x94d2('0x36')][_0x94d2('0x3f')]);_0x52c0bc['where']=qs[_0x94d2('0x37')](_[_0x94d2('0x41')](_0x4591b0['query'],_0x52c561[_0x94d2('0x37')]));if(_0x4591b0['query'][_0x94d2('0x47')]){_0x52c0bc[_0x94d2('0x40')]=_[_0x94d2('0x42')](_0x52c0bc[_0x94d2('0x40')],{'$or':_[_0x94d2('0x54')](_0x52c0bc['attributes'],function(_0x3bde2e){var _0xf3321f={};_0xf3321f[_0x3bde2e]={'$like':'%'+_0x4591b0[_0x94d2('0x36')][_0x94d2('0x47')]+'%'};return _0xf3321f;})});}_0x52c0bc=_[_0x94d2('0x42')]({},_0x52c0bc,_0x4591b0['options']);return _0x44b0b3[_0x94d2('0x55')](_0x52c0bc);}})[_0x94d2('0x19')](function(_0x57d918){if(_0x57d918){_0x3d01c8=_0x57d918[_0x94d2('0x3b')];if(!_0x4591b0['query'][_0x94d2('0x3c')](_0x94d2('0x3d'))){_0x52c0bc[_0x94d2('0x29')]=qs[_0x94d2('0x29')](_0x4591b0[_0x94d2('0x36')]['limit']);_0x52c0bc[_0x94d2('0x28')]=qs[_0x94d2('0x28')](_0x4591b0[_0x94d2('0x36')][_0x94d2('0x28')]);}return _0x44b0b3[_0x94d2('0x55')](_0x52c0bc);}})[_0x94d2('0x19')](function(_0x2d500c){if(_0x2d500c){return _0x2d500c?{'count':_0x3d01c8,'rows':_0x2d500c}:null;}})['then'](respondWithResult(_0x541587,null))[_0x94d2('0x23')](handleError(_0x541587,null));};exports['getDescriptions']=function(_0x32e978,_0x55a594,_0x51d9f8){var _0x184012={};var _0x4fef47={};var _0x1f59af;var _0x6cdb01;return db['SugarcrmConfiguration'][_0x94d2('0x56')]({'where':{'id':_0x32e978[_0x94d2('0x4e')]['id']}})[_0x94d2('0x19')](handleEntityNotFound(_0x55a594,null))['then'](function(_0x1937e1){if(_0x1937e1){_0x1f59af=_0x1937e1;_0x4fef47[_0x94d2('0x34')]=_['keys'](db[_0x94d2('0x53')][_0x94d2('0x33')]);_0x4fef47['query']=_[_0x94d2('0x35')](_0x32e978['query']);_0x4fef47[_0x94d2('0x37')]=_[_0x94d2('0x38')](_0x4fef47[_0x94d2('0x34')],_0x4fef47['query']);_0x184012[_0x94d2('0x3a')]=_[_0x94d2('0x38')](_0x4fef47[_0x94d2('0x34')],qs[_0x94d2('0x39')](_0x32e978[_0x94d2('0x36')][_0x94d2('0x39')]));_0x184012['attributes']=_0x184012[_0x94d2('0x3a')]['length']?_0x184012[_0x94d2('0x3a')]:_0x4fef47['model'];_0x184012[_0x94d2('0x3e')]=qs['sort'](_0x32e978['query'][_0x94d2('0x3f')]);_0x184012[_0x94d2('0x40')]=qs['filters'](_[_0x94d2('0x41')](_0x32e978[_0x94d2('0x36')],_0x4fef47['filters']));if(_0x32e978[_0x94d2('0x36')][_0x94d2('0x47')]){_0x184012[_0x94d2('0x40')]=_[_0x94d2('0x42')](_0x184012[_0x94d2('0x40')],{'$or':_[_0x94d2('0x54')](_0x184012['attributes'],function(_0x5c99f7){var _0xa3aa1f={};_0xa3aa1f[_0x5c99f7]={'$like':'%'+_0x32e978[_0x94d2('0x36')]['filter']+'%'};return _0xa3aa1f;})});}_0x184012=_['merge']({},_0x184012,_0x32e978['options']);return _0x1f59af['getDescriptions'](_0x184012);}})[_0x94d2('0x19')](function(_0x2febdd){if(_0x2febdd){_0x6cdb01=_0x2febdd[_0x94d2('0x3b')];if(!_0x32e978[_0x94d2('0x36')]['hasOwnProperty'](_0x94d2('0x3d'))){_0x184012[_0x94d2('0x29')]=qs[_0x94d2('0x29')](_0x32e978[_0x94d2('0x36')][_0x94d2('0x29')]);_0x184012[_0x94d2('0x28')]=qs[_0x94d2('0x28')](_0x32e978[_0x94d2('0x36')]['offset']);}return _0x1f59af[_0x94d2('0x57')](_0x184012);}})[_0x94d2('0x19')](function(_0x3001a0){if(_0x3001a0){return _0x3001a0?{'count':_0x6cdb01,'rows':_0x3001a0}:null;}})[_0x94d2('0x19')](respondWithResult(_0x55a594,null))[_0x94d2('0x23')](handleError(_0x55a594,null));}; \ No newline at end of file +var _0x692e=['debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','name','send','index','SugarcrmConfiguration','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','map','type','key','VIRTUAL','merge','includeAll','include','findAll','catch','params','length','find','create','body','destroy','getFields','findOne','SugarcrmField','order','options','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x53fb12,_0x327dd0){var _0x1ee597=function(_0x4e90c3){while(--_0x4e90c3){_0x53fb12['push'](_0x53fb12['shift']());}};_0x1ee597(++_0x327dd0);}(_0x692e,0x1a6));var _0xe692=function(_0x16d7c2,_0x3ffdbd){_0x16d7c2=_0x16d7c2-0x0;var _0x5aa869=_0x692e[_0x16d7c2];return _0x5aa869;};'use strict';var pdf=require(_0xe692('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe692('0x1'));var zipdir=require(_0xe692('0x2'));var jsonpatch=require(_0xe692('0x3'));var rp=require(_0xe692('0x4'));var moment=require(_0xe692('0x5'));var BPromise=require(_0xe692('0x6'));var Mustache=require(_0xe692('0x7'));var util=require(_0xe692('0x8'));var path=require(_0xe692('0x9'));var sox=require(_0xe692('0xa'));var csv=require('to-csv');var ejs=require(_0xe692('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe692('0xc'));var jsforce=require(_0xe692('0xd'));var deskjs=require(_0xe692('0xe'));var toCsv=require(_0xe692('0xf'));var querystring=require('querystring');var Papa=require(_0xe692('0x10'));var authService=require(_0xe692('0x11'));var hardwareService=require(_0xe692('0x12'));var Redis=require(_0xe692('0x13'));var qs=require(_0xe692('0x14'));var logger=require(_0xe692('0x15'))(_0xe692('0x16'));var utils=require(_0xe692('0x17'));var config=require(_0xe692('0x18'));var db=require(_0xe692('0x19'))['db'];var jayson=require(_0xe692('0x1a'));var client=jayson[_0xe692('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30959c,_0xabc0b5,_0x593fdb,_0x3c9629){return new BPromise(function(_0x57de70,_0xd2fa7a){var _0x549ef3=_0x3c9629||client;return _0x549ef3[_0xe692('0x1c')](_0x30959c,_0x593fdb)[_0xe692('0x1d')](function(_0x1e7318){logger[_0xe692('0x1e')](_0xe692('0x1f'),_0xabc0b5,_0xe692('0x20'));logger[_0xe692('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xabc0b5,_0xe692('0x20'),JSON[_0xe692('0x22')](_0x1e7318));if(_0x1e7318[_0xe692('0x23')]){if(_0x1e7318['error'][_0xe692('0x24')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xabc0b5,_0x1e7318['error'][_0xe692('0x25')]);return _0xd2fa7a(_0x1e7318[_0xe692('0x23')][_0xe692('0x25')]);}logger[_0xe692('0x23')](_0xe692('0x1f'),_0xabc0b5,_0x1e7318[_0xe692('0x23')][_0xe692('0x25')]);return _0x57de70(_0x1e7318[_0xe692('0x23')]['message']);}else{logger['info'](_0xe692('0x1f'),_0xabc0b5,_0xe692('0x20'));_0x57de70(_0x1e7318[_0xe692('0x26')]['message']);}})['catch'](function(_0x532a8a){logger['error'](_0xe692('0x1f'),_0xabc0b5,_0x532a8a);_0xd2fa7a(_0x532a8a);});});}function respondWithStatusCode(_0x2ee3cd,_0x1c4861){_0x1c4861=_0x1c4861||0xcc;return function(_0xe67864){if(_0xe67864){return _0x2ee3cd[_0xe692('0x27')](_0x1c4861);}return _0x2ee3cd[_0xe692('0x28')](_0x1c4861)[_0xe692('0x29')]();};}function respondWithResult(_0x2bc51a,_0x1c8cb9){_0x1c8cb9=_0x1c8cb9||0xc8;return function(_0x3a7716){if(_0x3a7716){return _0x2bc51a['status'](_0x1c8cb9)[_0xe692('0x2a')](_0x3a7716);}};}function respondWithFilteredResult(_0xda08ac,_0x4200c4){return function(_0x4f1364){if(_0x4f1364){var _0x7b44d8=_0x4f1364[_0xe692('0x2b')],_0x58f22c=_0x4200c4[_0xe692('0x2c')],_0x53cbf2=_0x4200c4[_0xe692('0x2c')]+_0x4200c4[_0xe692('0x2d')],_0x461597;if(_0x53cbf2>=_0x7b44d8){_0x53cbf2=_0x7b44d8;_0x461597=0xc8;}else{_0x461597=0xce;}_0xda08ac['status'](_0x461597);return _0xda08ac[_0xe692('0x2e')](_0xe692('0x2f'),_0x58f22c+'-'+_0x53cbf2+'/'+_0x7b44d8)[_0xe692('0x2a')](_0x4f1364);}return null;};}function patchUpdates(_0x1c6f23){return function(_0x276514){try{jsonpatch[_0xe692('0x30')](_0x276514,_0x1c6f23,!![]);}catch(_0x1c32ee){return BPromise['reject'](_0x1c32ee);}return _0x276514[_0xe692('0x31')]();};}function saveUpdates(_0x3157a3,_0x5015de){return function(_0xf70c2a){if(_0xf70c2a){return _0xf70c2a[_0xe692('0x32')](_0x3157a3)['then'](function(_0x4066e4){return _0x4066e4;});}return null;};}function removeEntity(_0x5237aa,_0x2eb298){return function(_0x34cafa){if(_0x34cafa){return _0x34cafa['destroy']()[_0xe692('0x1d')](function(){_0x5237aa['status'](0xcc)[_0xe692('0x29')]();});}};}function handleEntityNotFound(_0x25f3f9,_0x54f03b){return function(_0xec1184){if(!_0xec1184){_0x25f3f9[_0xe692('0x27')](0x194);}return _0xec1184;};}function handleError(_0x5791fc,_0xf8b9d2){_0xf8b9d2=_0xf8b9d2||0x1f4;return function(_0x4489f7){logger[_0xe692('0x23')](_0x4489f7['stack']);if(_0x4489f7[_0xe692('0x33')]){delete _0x4489f7['name'];}_0x5791fc['status'](_0xf8b9d2)[_0xe692('0x34')](_0x4489f7);};}exports[_0xe692('0x35')]=function(_0x1b6003,_0x3da2fd){var _0x25147e={},_0xca99e={},_0x504fbc={'count':0x0,'rows':[]};var _0x3e3a63=db[_0xe692('0x36')][_0xe692('0x37')];_0xca99e['model']=_[_0xe692('0x38')](_0x3e3a63);_0xca99e['query']=_[_0xe692('0x38')](_0x1b6003[_0xe692('0x39')]);_0xca99e['filters']=_[_0xe692('0x3a')](_0xca99e[_0xe692('0x3b')],_0xca99e[_0xe692('0x39')]);_0x25147e[_0xe692('0x3c')]=_[_0xe692('0x3a')](_0xca99e[_0xe692('0x3b')],qs[_0xe692('0x3d')](_0x1b6003[_0xe692('0x39')][_0xe692('0x3d')]));_0x25147e[_0xe692('0x3c')]=_0x25147e[_0xe692('0x3c')]['length']?_0x25147e[_0xe692('0x3c')]:_0xca99e[_0xe692('0x3b')];if(!_0x1b6003[_0xe692('0x39')][_0xe692('0x3e')](_0xe692('0x3f'))){_0x25147e['limit']=qs['limit'](_0x1b6003[_0xe692('0x39')][_0xe692('0x2d')]);_0x25147e[_0xe692('0x2c')]=qs[_0xe692('0x2c')](_0x1b6003['query'][_0xe692('0x2c')]);}_0x25147e['order']=qs[_0xe692('0x40')](_0x1b6003['query'][_0xe692('0x40')]);_0x25147e[_0xe692('0x41')]=qs['filters'](_[_0xe692('0x42')](_0x1b6003['query'],_0xca99e[_0xe692('0x43')]));if(_0x1b6003[_0xe692('0x39')][_0xe692('0x44')]){_0x25147e[_0xe692('0x41')]=_['merge'](_0x25147e[_0xe692('0x41')],{'$or':_[_0xe692('0x45')](_0x3e3a63,function(_0x2cad69){if(_0x2cad69[_0xe692('0x46')][_0xe692('0x47')]!==_0xe692('0x48')){var _0x53ca07={};_0x53ca07[_0x2cad69['field']]={'$like':'%'+_0x1b6003['query'][_0xe692('0x44')]+'%'};return _0x53ca07;}})});}_0x25147e=_[_0xe692('0x49')]({},_0x25147e,_0x1b6003['options']);var _0x107ed1={'where':_0x25147e[_0xe692('0x41')]};return db[_0xe692('0x36')][_0xe692('0x2b')](_0x107ed1)['then'](function(_0x51466c){_0x504fbc[_0xe692('0x2b')]=_0x51466c;if(_0x1b6003['query'][_0xe692('0x4a')]){_0x25147e[_0xe692('0x4b')]=[{'all':!![]}];}return db[_0xe692('0x36')][_0xe692('0x4c')](_0x25147e);})[_0xe692('0x1d')](function(_0x41110b){_0x504fbc['rows']=_0x41110b;return _0x504fbc;})['then'](respondWithFilteredResult(_0x3da2fd,_0x25147e))[_0xe692('0x4d')](handleError(_0x3da2fd,null));};exports['show']=function(_0x4779e0,_0x2534a5){var _0x4b222d={'raw':![],'where':{'id':_0x4779e0[_0xe692('0x4e')]['id']}},_0x2f23a2={};_0x2f23a2[_0xe692('0x3b')]=_['keys'](db[_0xe692('0x36')][_0xe692('0x37')]);_0x2f23a2[_0xe692('0x39')]=_[_0xe692('0x38')](_0x4779e0['query']);_0x2f23a2[_0xe692('0x43')]=_['intersection'](_0x2f23a2['model'],_0x2f23a2[_0xe692('0x39')]);_0x4b222d[_0xe692('0x3c')]=_[_0xe692('0x3a')](_0x2f23a2['model'],qs[_0xe692('0x3d')](_0x4779e0[_0xe692('0x39')]['fields']));_0x4b222d[_0xe692('0x3c')]=_0x4b222d[_0xe692('0x3c')][_0xe692('0x4f')]?_0x4b222d[_0xe692('0x3c')]:_0x2f23a2[_0xe692('0x3b')];if(_0x4779e0[_0xe692('0x39')]['includeAll']){_0x4b222d[_0xe692('0x4b')]=[{'all':!![]}];}_0x4b222d=_[_0xe692('0x49')]({},_0x4b222d,_0x4779e0['options']);return db[_0xe692('0x36')][_0xe692('0x50')](_0x4b222d)[_0xe692('0x1d')](handleEntityNotFound(_0x2534a5,null))['then'](respondWithResult(_0x2534a5,null))[_0xe692('0x4d')](handleError(_0x2534a5,null));};exports[_0xe692('0x51')]=function(_0x432f0f,_0x356822){return db[_0xe692('0x36')][_0xe692('0x51')](_0x432f0f[_0xe692('0x52')],{})['then'](respondWithResult(_0x356822,0xc9))[_0xe692('0x4d')](handleError(_0x356822,null));};exports[_0xe692('0x32')]=function(_0x50c5b1,_0x1970f7){if(_0x50c5b1[_0xe692('0x52')]['id']){delete _0x50c5b1[_0xe692('0x52')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x50c5b1[_0xe692('0x4e')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x1970f7,null))['then'](saveUpdates(_0x50c5b1['body'],null))[_0xe692('0x1d')](respondWithResult(_0x1970f7,null))[_0xe692('0x4d')](handleError(_0x1970f7,null));};exports[_0xe692('0x53')]=function(_0x5f015c,_0x1a9090){return db[_0xe692('0x36')][_0xe692('0x50')]({'where':{'id':_0x5f015c['params']['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x1a9090,null))[_0xe692('0x1d')](removeEntity(_0x1a9090,null))[_0xe692('0x4d')](handleError(_0x1a9090,null));};exports[_0xe692('0x54')]=function(_0x4dd4df,_0x76827,_0x3b17b6){var _0x2ee654={};var _0x645dc8={};var _0x1b81ab;var _0x578fe5;return db[_0xe692('0x36')][_0xe692('0x55')]({'where':{'id':_0x4dd4df[_0xe692('0x4e')]['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x76827,null))[_0xe692('0x1d')](function(_0x17769d){if(_0x17769d){_0x1b81ab=_0x17769d;_0x645dc8['model']=_[_0xe692('0x38')](db[_0xe692('0x56')][_0xe692('0x37')]);_0x645dc8[_0xe692('0x39')]=_[_0xe692('0x38')](_0x4dd4df[_0xe692('0x39')]);_0x645dc8[_0xe692('0x43')]=_[_0xe692('0x3a')](_0x645dc8['model'],_0x645dc8['query']);_0x2ee654[_0xe692('0x3c')]=_[_0xe692('0x3a')](_0x645dc8[_0xe692('0x3b')],qs[_0xe692('0x3d')](_0x4dd4df[_0xe692('0x39')][_0xe692('0x3d')]));_0x2ee654[_0xe692('0x3c')]=_0x2ee654['attributes'][_0xe692('0x4f')]?_0x2ee654[_0xe692('0x3c')]:_0x645dc8[_0xe692('0x3b')];_0x2ee654[_0xe692('0x57')]=qs[_0xe692('0x40')](_0x4dd4df[_0xe692('0x39')][_0xe692('0x40')]);_0x2ee654[_0xe692('0x41')]=qs['filters'](_[_0xe692('0x42')](_0x4dd4df[_0xe692('0x39')],_0x645dc8[_0xe692('0x43')]));if(_0x4dd4df[_0xe692('0x39')][_0xe692('0x44')]){_0x2ee654[_0xe692('0x41')]=_[_0xe692('0x49')](_0x2ee654[_0xe692('0x41')],{'$or':_['map'](_0x2ee654['attributes'],function(_0x384dfa){var _0x4491ba={};_0x4491ba[_0x384dfa]={'$like':'%'+_0x4dd4df['query']['filter']+'%'};return _0x4491ba;})});}_0x2ee654=_[_0xe692('0x49')]({},_0x2ee654,_0x4dd4df[_0xe692('0x58')]);return _0x1b81ab[_0xe692('0x54')](_0x2ee654);}})[_0xe692('0x1d')](function(_0x4f5930){if(_0x4f5930){_0x578fe5=_0x4f5930[_0xe692('0x4f')];if(!_0x4dd4df[_0xe692('0x39')][_0xe692('0x3e')](_0xe692('0x3f'))){_0x2ee654['limit']=qs[_0xe692('0x2d')](_0x4dd4df[_0xe692('0x39')][_0xe692('0x2d')]);_0x2ee654[_0xe692('0x2c')]=qs[_0xe692('0x2c')](_0x4dd4df[_0xe692('0x39')][_0xe692('0x2c')]);}return _0x1b81ab['getFields'](_0x2ee654);}})[_0xe692('0x1d')](function(_0xabce96){if(_0xabce96){return _0xabce96?{'count':_0x578fe5,'rows':_0xabce96}:null;}})[_0xe692('0x1d')](respondWithResult(_0x76827,null))[_0xe692('0x4d')](handleError(_0x76827,null));};exports[_0xe692('0x59')]=function(_0x48e6ab,_0x1a4f55,_0x3562f7){var _0x3d333c={};var _0x18e4e9={};var _0x5d49ee;var _0x15e953;return db[_0xe692('0x36')]['findOne']({'where':{'id':_0x48e6ab['params']['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x1a4f55,null))['then'](function(_0x30442a){if(_0x30442a){_0x5d49ee=_0x30442a;_0x18e4e9['model']=_['keys'](db['SugarcrmField'][_0xe692('0x37')]);_0x18e4e9[_0xe692('0x39')]=_['keys'](_0x48e6ab[_0xe692('0x39')]);_0x18e4e9[_0xe692('0x43')]=_[_0xe692('0x3a')](_0x18e4e9[_0xe692('0x3b')],_0x18e4e9[_0xe692('0x39')]);_0x3d333c[_0xe692('0x3c')]=_[_0xe692('0x3a')](_0x18e4e9[_0xe692('0x3b')],qs[_0xe692('0x3d')](_0x48e6ab[_0xe692('0x39')][_0xe692('0x3d')]));_0x3d333c[_0xe692('0x3c')]=_0x3d333c[_0xe692('0x3c')][_0xe692('0x4f')]?_0x3d333c[_0xe692('0x3c')]:_0x18e4e9[_0xe692('0x3b')];_0x3d333c[_0xe692('0x57')]=qs[_0xe692('0x40')](_0x48e6ab['query'][_0xe692('0x40')]);_0x3d333c[_0xe692('0x41')]=qs[_0xe692('0x43')](_[_0xe692('0x42')](_0x48e6ab[_0xe692('0x39')],_0x18e4e9[_0xe692('0x43')]));if(_0x48e6ab[_0xe692('0x39')][_0xe692('0x44')]){_0x3d333c[_0xe692('0x41')]=_[_0xe692('0x49')](_0x3d333c[_0xe692('0x41')],{'$or':_[_0xe692('0x45')](_0x3d333c['attributes'],function(_0x4312e2){var _0xaaf270={};_0xaaf270[_0x4312e2]={'$like':'%'+_0x48e6ab[_0xe692('0x39')][_0xe692('0x44')]+'%'};return _0xaaf270;})});}_0x3d333c=_['merge']({},_0x3d333c,_0x48e6ab[_0xe692('0x58')]);return _0x5d49ee[_0xe692('0x59')](_0x3d333c);}})[_0xe692('0x1d')](function(_0x37cf6c){if(_0x37cf6c){_0x15e953=_0x37cf6c[_0xe692('0x4f')];if(!_0x48e6ab[_0xe692('0x39')][_0xe692('0x3e')]('nolimit')){_0x3d333c[_0xe692('0x2d')]=qs['limit'](_0x48e6ab[_0xe692('0x39')]['limit']);_0x3d333c[_0xe692('0x2c')]=qs[_0xe692('0x2c')](_0x48e6ab[_0xe692('0x39')]['offset']);}return _0x5d49ee[_0xe692('0x59')](_0x3d333c);}})['then'](function(_0x1bcaea){if(_0x1bcaea){return _0x1bcaea?{'count':_0x15e953,'rows':_0x1bcaea}:null;}})[_0xe692('0x1d')](respondWithResult(_0x1a4f55,null))[_0xe692('0x4d')](handleError(_0x1a4f55,null));};exports[_0xe692('0x5a')]=function(_0x509003,_0x52960e,_0x246a7f){var _0x3705e4={};var _0x480d36={};var _0x5982ec;var _0xae6136;return db[_0xe692('0x36')][_0xe692('0x55')]({'where':{'id':_0x509003['params']['id']}})[_0xe692('0x1d')](handleEntityNotFound(_0x52960e,null))[_0xe692('0x1d')](function(_0x441278){if(_0x441278){_0x5982ec=_0x441278;_0x480d36[_0xe692('0x3b')]=_[_0xe692('0x38')](db['SugarcrmField'][_0xe692('0x37')]);_0x480d36[_0xe692('0x39')]=_['keys'](_0x509003[_0xe692('0x39')]);_0x480d36[_0xe692('0x43')]=_['intersection'](_0x480d36[_0xe692('0x3b')],_0x480d36[_0xe692('0x39')]);_0x3705e4['attributes']=_[_0xe692('0x3a')](_0x480d36[_0xe692('0x3b')],qs['fields'](_0x509003[_0xe692('0x39')][_0xe692('0x3d')]));_0x3705e4[_0xe692('0x3c')]=_0x3705e4[_0xe692('0x3c')][_0xe692('0x4f')]?_0x3705e4[_0xe692('0x3c')]:_0x480d36[_0xe692('0x3b')];_0x3705e4['order']=qs[_0xe692('0x40')](_0x509003[_0xe692('0x39')]['sort']);_0x3705e4[_0xe692('0x41')]=qs[_0xe692('0x43')](_[_0xe692('0x42')](_0x509003[_0xe692('0x39')],_0x480d36['filters']));if(_0x509003[_0xe692('0x39')]['filter']){_0x3705e4[_0xe692('0x41')]=_[_0xe692('0x49')](_0x3705e4[_0xe692('0x41')],{'$or':_[_0xe692('0x45')](_0x3705e4[_0xe692('0x3c')],function(_0x41e8c6){var _0x156cbb={};_0x156cbb[_0x41e8c6]={'$like':'%'+_0x509003[_0xe692('0x39')][_0xe692('0x44')]+'%'};return _0x156cbb;})});}_0x3705e4=_['merge']({},_0x3705e4,_0x509003['options']);return _0x5982ec[_0xe692('0x5a')](_0x3705e4);}})[_0xe692('0x1d')](function(_0x43062d){if(_0x43062d){_0xae6136=_0x43062d['length'];if(!_0x509003['query'][_0xe692('0x3e')](_0xe692('0x3f'))){_0x3705e4[_0xe692('0x2d')]=qs['limit'](_0x509003['query'][_0xe692('0x2d')]);_0x3705e4[_0xe692('0x2c')]=qs[_0xe692('0x2c')](_0x509003['query'][_0xe692('0x2c')]);}return _0x5982ec[_0xe692('0x5a')](_0x3705e4);}})['then'](function(_0x583117){if(_0x583117){return _0x583117?{'count':_0xae6136,'rows':_0x583117}:null;}})[_0xe692('0x1d')](respondWithResult(_0x52960e,null))[_0xe692('0x4d')](handleError(_0x52960e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 55b0946..2fe1468 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 _0x519d=['lodash','util','../../config/logger','api','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x3e29d3,_0x58bda8){var _0x208d20=function(_0x122381){while(--_0x122381){_0x3e29d3['push'](_0x3e29d3['shift']());}};_0x208d20(++_0x58bda8);}(_0x519d,0x160));var _0xd519=function(_0x239a5e,_0x4efdfe){_0x239a5e=_0x239a5e-0x0;var _0x3bd956=_0x519d[_0x239a5e];return _0x3bd956;};'use strict';var _=require(_0xd519('0x0'));var util=require(_0xd519('0x1'));var logger=require(_0xd519('0x2'))(_0xd519('0x3'));var moment=require('moment');var BPromise=require(_0xd519('0x4'));var rp=require(_0xd519('0x5'));var attributes=require(_0xd519('0x6'));module[_0xd519('0x7')]=function(_0x49a02f,_0x3db910){return _0x49a02f[_0xd519('0x8')](_0xd519('0x9'),attributes,{'tableName':_0xd519('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0764=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x43ba00,_0x3ea8d1){var _0x9798bd=function(_0x11aa7b){while(--_0x11aa7b){_0x43ba00['push'](_0x43ba00['shift']());}};_0x9798bd(++_0x3ea8d1);}(_0x0764,0x174));var _0x4076=function(_0x465bb7,_0x377d43){_0x465bb7=_0x465bb7-0x0;var _0x3c867b=_0x0764[_0x465bb7];return _0x3c867b;};'use strict';var _=require(_0x4076('0x0'));var util=require(_0x4076('0x1'));var logger=require(_0x4076('0x2'))(_0x4076('0x3'));var moment=require(_0x4076('0x4'));var BPromise=require('bluebird');var rp=require(_0x4076('0x5'));var attributes=require(_0x4076('0x6'));module[_0x4076('0x7')]=function(_0x39140b,_0x3d6b31){return _0x39140b['define'](_0x4076('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','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 53c35c9..69748bf 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 _0xcd08=['request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x6fabdb,_0x168fcd){var _0x58c0c2=function(_0x4b41e9){while(--_0x4b41e9){_0x6fabdb['push'](_0x6fabdb['shift']());}};_0x58c0c2(++_0x168fcd);}(_0xcd08,0x123));var _0x8cd0=function(_0x51001e,_0x253bad){_0x51001e=_0x51001e-0x0;var _0x5e4261=_0xcd08[_0x51001e];return _0x5e4261;};'use strict';var _=require(_0x8cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cd0('0x1'));var rs=require(_0x8cd0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8cd0('0x3'));var logger=require(_0x8cd0('0x4'))(_0x8cd0('0x5'));var config=require(_0x8cd0('0x6'));var jayson=require(_0x8cd0('0x7'));var client=jayson['client'][_0x8cd0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5765af,_0x2defdb,_0x440b96){return new BPromise(function(_0x54e1c0,_0x312393){return client[_0x8cd0('0x9')](_0x5765af,_0x440b96)[_0x8cd0('0xa')](function(_0x5cc602){logger[_0x8cd0('0xb')](_0x8cd0('0xc'),_0x2defdb,_0x8cd0('0xd'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2defdb,_0x8cd0('0xd'),JSON['stringify'](_0x5cc602));if(_0x5cc602['error']){if(_0x5cc602[_0x8cd0('0xe')][_0x8cd0('0xf')]===0x1f4){logger[_0x8cd0('0xe')](_0x8cd0('0xc'),_0x2defdb,_0x5cc602[_0x8cd0('0xe')][_0x8cd0('0x10')]);return _0x312393(_0x5cc602[_0x8cd0('0xe')]['message']);}logger[_0x8cd0('0xe')](_0x8cd0('0xc'),_0x2defdb,_0x5cc602[_0x8cd0('0xe')][_0x8cd0('0x10')]);return _0x54e1c0(_0x5cc602[_0x8cd0('0xe')][_0x8cd0('0x10')]);}else{logger['info'](_0x8cd0('0xc'),_0x2defdb,'request\x20sent');_0x54e1c0(_0x5cc602[_0x8cd0('0x11')]['message']);}})[_0x8cd0('0x12')](function(_0x5067c6){logger[_0x8cd0('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2defdb,_0x5067c6);_0x312393(_0x5067c6);});});} \ No newline at end of file +var _0x8aba=['error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1675d2,_0x472f4b){var _0x4edeb6=function(_0x208dfe){while(--_0x208dfe){_0x1675d2['push'](_0x1675d2['shift']());}};_0x4edeb6(++_0x472f4b);}(_0x8aba,0x1bd));var _0xa8ab=function(_0x139a41,_0xe416f8){_0x139a41=_0x139a41-0x0;var _0x2882f9=_0x8aba[_0x139a41];return _0x2882f9;};'use strict';var _=require(_0xa8ab('0x0'));var util=require(_0xa8ab('0x1'));var moment=require(_0xa8ab('0x2'));var BPromise=require(_0xa8ab('0x3'));var rs=require(_0xa8ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa8ab('0x5'));var logger=require(_0xa8ab('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa8ab('0x7'));var client=jayson[_0xa8ab('0x8')][_0xa8ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd744a4,_0x340136,_0xf7a98d){return new BPromise(function(_0x55cc4f,_0x5e9e9d){return client[_0xa8ab('0xa')](_0xd744a4,_0xf7a98d)[_0xa8ab('0xb')](function(_0x42c38d){logger[_0xa8ab('0xc')](_0xa8ab('0xd'),_0x340136,_0xa8ab('0xe'));logger[_0xa8ab('0xf')](_0xa8ab('0x10'),_0x340136,'request\x20sent',JSON['stringify'](_0x42c38d));if(_0x42c38d[_0xa8ab('0x11')]){if(_0x42c38d[_0xa8ab('0x11')][_0xa8ab('0x12')]===0x1f4){logger[_0xa8ab('0x11')](_0xa8ab('0xd'),_0x340136,_0x42c38d[_0xa8ab('0x11')][_0xa8ab('0x13')]);return _0x5e9e9d(_0x42c38d[_0xa8ab('0x11')][_0xa8ab('0x13')]);}logger[_0xa8ab('0x11')](_0xa8ab('0xd'),_0x340136,_0x42c38d[_0xa8ab('0x11')][_0xa8ab('0x13')]);return _0x55cc4f(_0x42c38d['error'][_0xa8ab('0x13')]);}else{logger[_0xa8ab('0xc')](_0xa8ab('0xd'),_0x340136,_0xa8ab('0xe'));_0x55cc4f(_0x42c38d[_0xa8ab('0x14')]['message']);}})['catch'](function(_0x11ba68){logger[_0xa8ab('0x11')](_0xa8ab('0xd'),_0x340136,_0x11ba68);_0x5e9e9d(_0x11ba68);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ceb89b0..9e1d58d 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 _0x4e10=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x2ca1d4,_0x5d7451){var _0x66de3d=function(_0x32c23b){while(--_0x32c23b){_0x2ca1d4['push'](_0x2ca1d4['shift']());}};_0x66de3d(++_0x5d7451);}(_0x4e10,0x1de));var _0x04e1=function(_0x578e61,_0x574774){_0x578e61=_0x578e61-0x0;var _0x7c788d=_0x4e10[_0x578e61];return _0x7c788d;};'use strict';var multer=require(_0x04e1('0x0'));var util=require(_0x04e1('0x1'));var path=require(_0x04e1('0x2'));var timeout=require(_0x04e1('0x3'));var express=require('express');var router=express[_0x04e1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x04e1('0x5'));var config=require(_0x04e1('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x04e1('0x7')]('/',auth[_0x04e1('0x8')](),controller[_0x04e1('0x9')]);router[_0x04e1('0x7')](_0x04e1('0xa'),auth['isAuthenticated'](),controller[_0x04e1('0xb')]);router[_0x04e1('0xc')]('/',auth['isAuthenticated'](),controller[_0x04e1('0xd')]);router[_0x04e1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x04e1('0xf')]);router[_0x04e1('0x10')](_0x04e1('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x04e1('0x11')]=router; \ No newline at end of file +var _0x2b44=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b44,0xb7));var _0x42b4=function(_0x22330c,_0x2013cd){_0x22330c=_0x22330c-0x0;var _0x3b6c0e=_0x2b44[_0x22330c];return _0x3b6c0e;};'use strict';var multer=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var path=require(_0x42b4('0x2'));var timeout=require(_0x42b4('0x3'));var express=require('express');var router=express[_0x42b4('0x4')]();var auth=require(_0x42b4('0x5'));var interaction=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x42b4('0x8')]('/',auth['isAuthenticated'](),controller[_0x42b4('0x9')]);router[_0x42b4('0x8')](_0x42b4('0xa'),auth[_0x42b4('0xb')](),controller[_0x42b4('0xc')]);router['post']('/',auth[_0x42b4('0xb')](),controller['create']);router[_0x42b4('0xd')](_0x42b4('0xa'),auth[_0x42b4('0xb')](),controller['update']);router[_0x42b4('0xe')](_0x42b4('0xa'),auth['isAuthenticated'](),controller[_0x42b4('0xf')]);module[_0x42b4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index b829eaf..297554d 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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0xa5038a,_0x10c3fd){var _0x1e6d4a=function(_0x390c69){while(--_0x390c69){_0xa5038a['push'](_0xa5038a['shift']());}};_0x1e6d4a(++_0x10c3fd);}(_0xb688,0xcf));var _0x8b68=function(_0x338389,_0x29ce50){_0x338389=_0x338389-0x0;var _0x5b1ca3=_0xb688[_0x338389];return _0x5b1ca3;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file +var _0x1be1=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1be1,0x192));var _0x11be=function(_0x4888f1,_0x704674){_0x4888f1=_0x4888f1-0x0;var _0x592605=_0x1be1[_0x4888f1];return _0x592605;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),'variable',_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x1')},'content':{'type':Sequelize[_0x11be('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),_0x11be('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x11be('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11be('0x4')]},'customField':{'type':Sequelize[_0x11be('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11be('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 4d08ef3..7e1b4fa 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 _0x7e0b=['../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x7e0b,0x78));var _0xb7e0=function(_0x44598f,_0x3e2ebf){_0x44598f=_0x44598f-0x0;var _0x4c9959=_0x7e0b[_0x44598f];return _0x4c9959;};'use strict';var pdf=require(_0xb7e0('0x0'));var emlformat=require(_0xb7e0('0x1'));var rimraf=require(_0xb7e0('0x2'));var zipdir=require(_0xb7e0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb7e0('0x4'));var BPromise=require(_0xb7e0('0x5'));var Mustache=require(_0xb7e0('0x6'));var util=require('util');var path=require(_0xb7e0('0x7'));var sox=require('sox');var csv=require(_0xb7e0('0x8'));var ejs=require(_0xb7e0('0x9'));var fs=require('fs');var _=require(_0xb7e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb7e0('0xb'));var deskjs=require(_0xb7e0('0xc'));var toCsv=require(_0xb7e0('0x8'));var querystring=require('querystring');var Papa=require(_0xb7e0('0xd'));var authService=require(_0xb7e0('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb7e0('0xf'));var qs=require(_0xb7e0('0x10'));var logger=require(_0xb7e0('0x11'))('api');var utils=require(_0xb7e0('0x12'));var config=require(_0xb7e0('0x13'));var db=require(_0xb7e0('0x14'))['db'];function respondWithStatusCode(_0x3b33ea,_0x17e436){_0x17e436=_0x17e436||0xcc;return function(_0x5a7fcf){if(_0x5a7fcf){return _0x3b33ea[_0xb7e0('0x15')](_0x17e436);}return _0x3b33ea['status'](_0x17e436)[_0xb7e0('0x16')]();};}function respondWithResult(_0x3a99fc,_0x1f17db){_0x1f17db=_0x1f17db||0xc8;return function(_0x55b225){if(_0x55b225){return _0x3a99fc[_0xb7e0('0x17')](_0x1f17db)[_0xb7e0('0x18')](_0x55b225);}};}function respondWithFilteredResult(_0x507156,_0x3fa4f9){return function(_0x2c1861){if(_0x2c1861){var _0x43492b=_0x2c1861[_0xb7e0('0x19')],_0x402f92=_0x3fa4f9['offset'],_0x4c0ef3=_0x3fa4f9['offset']+_0x3fa4f9[_0xb7e0('0x1a')],_0x1b6975;if(_0x4c0ef3>=_0x43492b){_0x4c0ef3=_0x43492b;_0x1b6975=0xc8;}else{_0x1b6975=0xce;}_0x507156['status'](_0x1b6975);return _0x507156['set'](_0xb7e0('0x1b'),_0x402f92+'-'+_0x4c0ef3+'/'+_0x43492b)[_0xb7e0('0x18')](_0x2c1861);}return null;};}function patchUpdates(_0x33352f){return function(_0x2ee196){try{jsonpatch['apply'](_0x2ee196,_0x33352f,!![]);}catch(_0x919c95){return BPromise['reject'](_0x919c95);}return _0x2ee196['save']();};}function saveUpdates(_0x200b9d,_0x431719){return function(_0x416c82){if(_0x416c82){return _0x416c82['update'](_0x200b9d)[_0xb7e0('0x1c')](function(_0x3e4f6f){return _0x3e4f6f;});}return null;};}function removeEntity(_0x552f93,_0x184ed4){return function(_0x10450f){if(_0x10450f){return _0x10450f[_0xb7e0('0x1d')]()['then'](function(){_0x552f93['status'](0xcc)[_0xb7e0('0x16')]();});}};}function handleEntityNotFound(_0x19d70a,_0x151973){return function(_0xb249b0){if(!_0xb249b0){_0x19d70a[_0xb7e0('0x15')](0x194);}return _0xb249b0;};}function handleError(_0x398f8f,_0x4ea26f){_0x4ea26f=_0x4ea26f||0x1f4;return function(_0x381b66){logger[_0xb7e0('0x1e')](_0x381b66[_0xb7e0('0x1f')]);if(_0x381b66[_0xb7e0('0x20')]){delete _0x381b66[_0xb7e0('0x20')];}_0x398f8f['status'](_0x4ea26f)[_0xb7e0('0x21')](_0x381b66);};}exports[_0xb7e0('0x22')]=function(_0x5b732f,_0xaf4b76){var _0x3b62b8={},_0x4e4143={},_0x32de87={'count':0x0,'rows':[]};var _0x3fcab0=db[_0xb7e0('0x23')][_0xb7e0('0x24')];_0x4e4143[_0xb7e0('0x25')]=_[_0xb7e0('0x26')](_0x3fcab0);_0x4e4143['query']=_[_0xb7e0('0x26')](_0x5b732f[_0xb7e0('0x27')]);_0x4e4143['filters']=_[_0xb7e0('0x28')](_0x4e4143[_0xb7e0('0x25')],_0x4e4143[_0xb7e0('0x27')]);_0x3b62b8[_0xb7e0('0x29')]=_[_0xb7e0('0x28')](_0x4e4143[_0xb7e0('0x25')],qs[_0xb7e0('0x2a')](_0x5b732f['query'][_0xb7e0('0x2a')]));_0x3b62b8['attributes']=_0x3b62b8['attributes'][_0xb7e0('0x2b')]?_0x3b62b8[_0xb7e0('0x29')]:_0x4e4143['model'];if(!_0x5b732f['query'][_0xb7e0('0x2c')](_0xb7e0('0x2d'))){_0x3b62b8['limit']=qs[_0xb7e0('0x1a')](_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x1a')]);_0x3b62b8[_0xb7e0('0x2e')]=qs['offset'](_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x2e')]);}_0x3b62b8[_0xb7e0('0x2f')]=qs[_0xb7e0('0x30')](_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x30')]);_0x3b62b8[_0xb7e0('0x31')]=qs[_0xb7e0('0x32')](_[_0xb7e0('0x33')](_0x5b732f['query'],_0x4e4143[_0xb7e0('0x32')]));if(_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x34')]){_0x3b62b8['where']=_['merge'](_0x3b62b8[_0xb7e0('0x31')],{'$or':_[_0xb7e0('0x35')](_0x3fcab0,function(_0x29dfae){if(_0x29dfae[_0xb7e0('0x36')][_0xb7e0('0x37')]!==_0xb7e0('0x38')){var _0x23625c={};_0x23625c[_0x29dfae['field']]={'$like':'%'+_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x34')]+'%'};return _0x23625c;}})});}_0x3b62b8=_['merge']({},_0x3b62b8,_0x5b732f[_0xb7e0('0x39')]);var _0x4778f7={'where':_0x3b62b8[_0xb7e0('0x31')]};return db[_0xb7e0('0x23')][_0xb7e0('0x19')](_0x4778f7)[_0xb7e0('0x1c')](function(_0x10ef18){_0x32de87['count']=_0x10ef18;if(_0x5b732f[_0xb7e0('0x27')][_0xb7e0('0x3a')]){_0x3b62b8[_0xb7e0('0x3b')]=[{'all':!![]}];}return db['SugarcrmField'][_0xb7e0('0x3c')](_0x3b62b8);})[_0xb7e0('0x1c')](function(_0x4c8bb4){_0x32de87[_0xb7e0('0x3d')]=_0x4c8bb4;return _0x32de87;})[_0xb7e0('0x1c')](respondWithFilteredResult(_0xaf4b76,_0x3b62b8))[_0xb7e0('0x3e')](handleError(_0xaf4b76,null));};exports[_0xb7e0('0x3f')]=function(_0x3e86a2,_0x93d9ea){var _0x6e03c6={'raw':!![],'where':{'id':_0x3e86a2[_0xb7e0('0x40')]['id']}},_0x565ed8={};_0x565ed8[_0xb7e0('0x25')]=_[_0xb7e0('0x26')](db[_0xb7e0('0x23')][_0xb7e0('0x24')]);_0x565ed8[_0xb7e0('0x27')]=_[_0xb7e0('0x26')](_0x3e86a2[_0xb7e0('0x27')]);_0x565ed8[_0xb7e0('0x32')]=_[_0xb7e0('0x28')](_0x565ed8[_0xb7e0('0x25')],_0x565ed8['query']);_0x6e03c6[_0xb7e0('0x29')]=_[_0xb7e0('0x28')](_0x565ed8[_0xb7e0('0x25')],qs[_0xb7e0('0x2a')](_0x3e86a2['query'][_0xb7e0('0x2a')]));_0x6e03c6[_0xb7e0('0x29')]=_0x6e03c6[_0xb7e0('0x29')][_0xb7e0('0x2b')]?_0x6e03c6['attributes']:_0x565ed8[_0xb7e0('0x25')];if(_0x3e86a2[_0xb7e0('0x27')][_0xb7e0('0x3a')]){_0x6e03c6[_0xb7e0('0x3b')]=[{'all':!![]}];}_0x6e03c6=_[_0xb7e0('0x41')]({},_0x6e03c6,_0x3e86a2['options']);return db[_0xb7e0('0x23')][_0xb7e0('0x42')](_0x6e03c6)[_0xb7e0('0x1c')](handleEntityNotFound(_0x93d9ea,null))['then'](respondWithResult(_0x93d9ea,null))[_0xb7e0('0x3e')](handleError(_0x93d9ea,null));};exports['create']=function(_0x594f5b,_0x3e951c){return db[_0xb7e0('0x23')][_0xb7e0('0x43')](_0x594f5b[_0xb7e0('0x44')],{})['then'](respondWithResult(_0x3e951c,0xc9))[_0xb7e0('0x3e')](handleError(_0x3e951c,null));};exports[_0xb7e0('0x45')]=function(_0xd0f23b,_0x149c4f){if(_0xd0f23b['body']['id']){delete _0xd0f23b[_0xb7e0('0x44')]['id'];}return db[_0xb7e0('0x23')][_0xb7e0('0x42')]({'where':{'id':_0xd0f23b['params']['id']}})[_0xb7e0('0x1c')](handleEntityNotFound(_0x149c4f,null))['then'](saveUpdates(_0xd0f23b[_0xb7e0('0x44')],null))[_0xb7e0('0x1c')](respondWithResult(_0x149c4f,null))[_0xb7e0('0x3e')](handleError(_0x149c4f,null));};exports[_0xb7e0('0x1d')]=function(_0x536803,_0x63e8b6){return db[_0xb7e0('0x23')][_0xb7e0('0x42')]({'where':{'id':_0x536803[_0xb7e0('0x40')]['id']}})['then'](handleEntityNotFound(_0x63e8b6,null))['then'](removeEntity(_0x63e8b6,null))[_0xb7e0('0x3e')](handleError(_0x63e8b6,null));}; \ No newline at end of file +var _0xef85=['includeAll','include','findAll','rows','catch','params','merge','create','body','find','html-pdf','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','index','SugarcrmField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','key','VIRTUAL','field','options'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0xef85,0xe5));var _0x5ef8=function(_0x3505ef,_0x5b595a){_0x3505ef=_0x3505ef-0x0;var _0x3f3536=_0xef85[_0x3505ef];return _0x3f3536;};'use strict';var pdf=require(_0x5ef8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ef8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ef8('0x2'));var moment=require(_0x5ef8('0x3'));var BPromise=require(_0x5ef8('0x4'));var Mustache=require(_0x5ef8('0x5'));var util=require('util');var path=require(_0x5ef8('0x6'));var sox=require(_0x5ef8('0x7'));var csv=require(_0x5ef8('0x8'));var ejs=require(_0x5ef8('0x9'));var fs=require('fs');var _=require(_0x5ef8('0xa'));var squel=require(_0x5ef8('0xb'));var crypto=require(_0x5ef8('0xc'));var jsforce=require(_0x5ef8('0xd'));var deskjs=require(_0x5ef8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5ef8('0xf'));var Papa=require(_0x5ef8('0x10'));var authService=require(_0x5ef8('0x11'));var hardwareService=require(_0x5ef8('0x12'));var Redis=require('ioredis');var qs=require(_0x5ef8('0x13'));var logger=require(_0x5ef8('0x14'))(_0x5ef8('0x15'));var utils=require(_0x5ef8('0x16'));var config=require(_0x5ef8('0x17'));var db=require(_0x5ef8('0x18'))['db'];function respondWithStatusCode(_0x5056f2,_0x230459){_0x230459=_0x230459||0xcc;return function(_0x3c70f3){if(_0x3c70f3){return _0x5056f2[_0x5ef8('0x19')](_0x230459);}return _0x5056f2[_0x5ef8('0x1a')](_0x230459)[_0x5ef8('0x1b')]();};}function respondWithResult(_0x204952,_0x36e4d5){_0x36e4d5=_0x36e4d5||0xc8;return function(_0x7f4650){if(_0x7f4650){return _0x204952['status'](_0x36e4d5)[_0x5ef8('0x1c')](_0x7f4650);}};}function respondWithFilteredResult(_0x3c4b0a,_0x23b62d){return function(_0x4818ad){if(_0x4818ad){var _0x4af5bc=_0x4818ad[_0x5ef8('0x1d')],_0x237545=_0x23b62d[_0x5ef8('0x1e')],_0x6a6c13=_0x23b62d[_0x5ef8('0x1e')]+_0x23b62d['limit'],_0x240736;if(_0x6a6c13>=_0x4af5bc){_0x6a6c13=_0x4af5bc;_0x240736=0xc8;}else{_0x240736=0xce;}_0x3c4b0a[_0x5ef8('0x1a')](_0x240736);return _0x3c4b0a[_0x5ef8('0x1f')](_0x5ef8('0x20'),_0x237545+'-'+_0x6a6c13+'/'+_0x4af5bc)[_0x5ef8('0x1c')](_0x4818ad);}return null;};}function patchUpdates(_0x3eb4b1){return function(_0x492dec){try{jsonpatch[_0x5ef8('0x21')](_0x492dec,_0x3eb4b1,!![]);}catch(_0x118ebb){return BPromise[_0x5ef8('0x22')](_0x118ebb);}return _0x492dec[_0x5ef8('0x23')]();};}function saveUpdates(_0x59d24b,_0x1e5157){return function(_0x5e6667){if(_0x5e6667){return _0x5e6667[_0x5ef8('0x24')](_0x59d24b)[_0x5ef8('0x25')](function(_0x3ade8e){return _0x3ade8e;});}return null;};}function removeEntity(_0x527537,_0x7268b){return function(_0x3e39bf){if(_0x3e39bf){return _0x3e39bf[_0x5ef8('0x26')]()[_0x5ef8('0x25')](function(){_0x527537['status'](0xcc)[_0x5ef8('0x1b')]();});}};}function handleEntityNotFound(_0x5bc391,_0x2b08bd){return function(_0x4a7ade){if(!_0x4a7ade){_0x5bc391['sendStatus'](0x194);}return _0x4a7ade;};}function handleError(_0x2be200,_0x2cdf12){_0x2cdf12=_0x2cdf12||0x1f4;return function(_0x461f90){logger['error'](_0x461f90['stack']);if(_0x461f90[_0x5ef8('0x27')]){delete _0x461f90[_0x5ef8('0x27')];}_0x2be200['status'](_0x2cdf12)['send'](_0x461f90);};}exports[_0x5ef8('0x28')]=function(_0x1b049b,_0x5e93d9){var _0x23ab4b={},_0x2b77d9={},_0x33d37d={'count':0x0,'rows':[]};var _0x5a5465=db[_0x5ef8('0x29')][_0x5ef8('0x2a')];_0x2b77d9[_0x5ef8('0x2b')]=_[_0x5ef8('0x2c')](_0x5a5465);_0x2b77d9['query']=_[_0x5ef8('0x2c')](_0x1b049b[_0x5ef8('0x2d')]);_0x2b77d9[_0x5ef8('0x2e')]=_[_0x5ef8('0x2f')](_0x2b77d9['model'],_0x2b77d9[_0x5ef8('0x2d')]);_0x23ab4b[_0x5ef8('0x30')]=_['intersection'](_0x2b77d9[_0x5ef8('0x2b')],qs[_0x5ef8('0x31')](_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x31')]));_0x23ab4b[_0x5ef8('0x30')]=_0x23ab4b['attributes'][_0x5ef8('0x32')]?_0x23ab4b['attributes']:_0x2b77d9['model'];if(!_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x33')](_0x5ef8('0x34'))){_0x23ab4b['limit']=qs['limit'](_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x35')]);_0x23ab4b[_0x5ef8('0x1e')]=qs[_0x5ef8('0x1e')](_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x1e')]);}_0x23ab4b[_0x5ef8('0x36')]=qs[_0x5ef8('0x37')](_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x37')]);_0x23ab4b['where']=qs[_0x5ef8('0x2e')](_[_0x5ef8('0x38')](_0x1b049b[_0x5ef8('0x2d')],_0x2b77d9[_0x5ef8('0x2e')]));if(_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x39')]){_0x23ab4b[_0x5ef8('0x3a')]=_['merge'](_0x23ab4b[_0x5ef8('0x3a')],{'$or':_['map'](_0x5a5465,function(_0x51fc5a){if(_0x51fc5a['type'][_0x5ef8('0x3b')]!==_0x5ef8('0x3c')){var _0x27a94c={};_0x27a94c[_0x51fc5a[_0x5ef8('0x3d')]]={'$like':'%'+_0x1b049b['query'][_0x5ef8('0x39')]+'%'};return _0x27a94c;}})});}_0x23ab4b=_['merge']({},_0x23ab4b,_0x1b049b[_0x5ef8('0x3e')]);var _0x4d57a9={'where':_0x23ab4b['where']};return db[_0x5ef8('0x29')][_0x5ef8('0x1d')](_0x4d57a9)['then'](function(_0x450fa3){_0x33d37d['count']=_0x450fa3;if(_0x1b049b[_0x5ef8('0x2d')][_0x5ef8('0x3f')]){_0x23ab4b[_0x5ef8('0x40')]=[{'all':!![]}];}return db[_0x5ef8('0x29')][_0x5ef8('0x41')](_0x23ab4b);})[_0x5ef8('0x25')](function(_0x2a0bd1){_0x33d37d[_0x5ef8('0x42')]=_0x2a0bd1;return _0x33d37d;})[_0x5ef8('0x25')](respondWithFilteredResult(_0x5e93d9,_0x23ab4b))[_0x5ef8('0x43')](handleError(_0x5e93d9,null));};exports['show']=function(_0x142afc,_0x531b9b){var _0x3c683b={'raw':!![],'where':{'id':_0x142afc[_0x5ef8('0x44')]['id']}},_0x3a8387={};_0x3a8387[_0x5ef8('0x2b')]=_[_0x5ef8('0x2c')](db['SugarcrmField'][_0x5ef8('0x2a')]);_0x3a8387[_0x5ef8('0x2d')]=_[_0x5ef8('0x2c')](_0x142afc[_0x5ef8('0x2d')]);_0x3a8387[_0x5ef8('0x2e')]=_[_0x5ef8('0x2f')](_0x3a8387[_0x5ef8('0x2b')],_0x3a8387[_0x5ef8('0x2d')]);_0x3c683b[_0x5ef8('0x30')]=_['intersection'](_0x3a8387[_0x5ef8('0x2b')],qs['fields'](_0x142afc[_0x5ef8('0x2d')]['fields']));_0x3c683b[_0x5ef8('0x30')]=_0x3c683b[_0x5ef8('0x30')][_0x5ef8('0x32')]?_0x3c683b['attributes']:_0x3a8387[_0x5ef8('0x2b')];if(_0x142afc['query'][_0x5ef8('0x3f')]){_0x3c683b['include']=[{'all':!![]}];}_0x3c683b=_[_0x5ef8('0x45')]({},_0x3c683b,_0x142afc['options']);return db[_0x5ef8('0x29')]['find'](_0x3c683b)[_0x5ef8('0x25')](handleEntityNotFound(_0x531b9b,null))['then'](respondWithResult(_0x531b9b,null))[_0x5ef8('0x43')](handleError(_0x531b9b,null));};exports[_0x5ef8('0x46')]=function(_0x17a12e,_0x3680d6){return db[_0x5ef8('0x29')]['create'](_0x17a12e['body'],{})[_0x5ef8('0x25')](respondWithResult(_0x3680d6,0xc9))[_0x5ef8('0x43')](handleError(_0x3680d6,null));};exports[_0x5ef8('0x24')]=function(_0xa13777,_0x1ae0d0){if(_0xa13777[_0x5ef8('0x47')]['id']){delete _0xa13777[_0x5ef8('0x47')]['id'];}return db[_0x5ef8('0x29')][_0x5ef8('0x48')]({'where':{'id':_0xa13777[_0x5ef8('0x44')]['id']}})[_0x5ef8('0x25')](handleEntityNotFound(_0x1ae0d0,null))[_0x5ef8('0x25')](saveUpdates(_0xa13777[_0x5ef8('0x47')],null))[_0x5ef8('0x25')](respondWithResult(_0x1ae0d0,null))[_0x5ef8('0x43')](handleError(_0x1ae0d0,null));};exports[_0x5ef8('0x26')]=function(_0x27126e,_0x3874bb){return db[_0x5ef8('0x29')][_0x5ef8('0x48')]({'where':{'id':_0x27126e[_0x5ef8('0x44')]['id']}})[_0x5ef8('0x25')](handleEntityNotFound(_0x3874bb,null))[_0x5ef8('0x25')](removeEntity(_0x3874bb,null))['catch'](handleError(_0x3874bb,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8eb3a72..39d076d 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 _0xd268=['FieldId','../../config/logger','api','moment','bluebird','request-promise','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x1468b9,_0x9c8dda){var _0x18ee09=function(_0x46aa0a){while(--_0x46aa0a){_0x1468b9['push'](_0x1468b9['shift']());}};_0x18ee09(++_0x9c8dda);}(_0xd268,0x76));var _0x8d26=function(_0x9fad48,_0xd587cc){_0x9fad48=_0x9fad48-0x0;var _0x16ecbe=_0xd268[_0x9fad48];return _0x16ecbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d26('0x0'))(_0x8d26('0x1'));var moment=require(_0x8d26('0x2'));var BPromise=require(_0x8d26('0x3'));var rp=require(_0x8d26('0x4'));var attributes=require(_0x8d26('0x5'));module[_0x8d26('0x6')]=function(_0x4e75ef,_0x272d82){return _0x4e75ef[_0x8d26('0x7')](_0x8d26('0x8'),attributes,{'tableName':_0x8d26('0x9'),'paranoid':![],'indexes':[{'name':_0x8d26('0xa'),'fields':[_0x8d26('0xb'),_0x8d26('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x52bb=['sugarcrm_unique_index','FieldId','moment','bluebird','request-promise','./intSugarcrmField.attributes','int_sugarcrm_fields'];(function(_0x5b3508,_0x5ba1e3){var _0x1ce36f=function(_0x4427bc){while(--_0x4427bc){_0x5b3508['push'](_0x5b3508['shift']());}};_0x1ce36f(++_0x5ba1e3);}(_0x52bb,0x1e5));var _0xb52b=function(_0xd0b2e2,_0x2c134a){_0xd0b2e2=_0xd0b2e2-0x0;var _0x3a747f=_0x52bb[_0xd0b2e2];return _0x3a747f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb52b('0x0'));var BPromise=require(_0xb52b('0x1'));var rp=require(_0xb52b('0x2'));var attributes=require(_0xb52b('0x3'));module['exports']=function(_0x3e4398,_0x1340b5){return _0x3e4398['define']('SugarcrmField',attributes,{'tableName':_0xb52b('0x4'),'paranoid':![],'indexes':[{'name':_0xb52b('0x5'),'fields':['idField',_0xb52b('0x6')],'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 cd7afd7..dae2f82 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 _0xcdfd=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5bf402,_0x5d0a5b){var _0x18b803=function(_0x2c8e65){while(--_0x2c8e65){_0x5bf402['push'](_0x5bf402['shift']());}};_0x18b803(++_0x5d0a5b);}(_0xcdfd,0x143));var _0xdcdf=function(_0x33e6fc,_0x4cfade){_0x33e6fc=_0x33e6fc-0x0;var _0x5c99f5=_0xcdfd[_0x33e6fc];return _0x5c99f5;};'use strict';var _=require(_0xdcdf('0x0'));var util=require(_0xdcdf('0x1'));var moment=require(_0xdcdf('0x2'));var BPromise=require(_0xdcdf('0x3'));var rs=require(_0xdcdf('0x4'));var fs=require('fs');var Redis=require(_0xdcdf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcdf('0x6'));var logger=require(_0xdcdf('0x7'))(_0xdcdf('0x8'));var config=require(_0xdcdf('0x9'));var jayson=require(_0xdcdf('0xa'));var client=jayson['client'][_0xdcdf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53fc2e,_0x4a6922,_0x28ee4f){return new BPromise(function(_0xcb3ba4,_0x1d5e0f){return client[_0xdcdf('0xc')](_0x53fc2e,_0x28ee4f)[_0xdcdf('0xd')](function(_0x3d9e15){logger[_0xdcdf('0xe')](_0xdcdf('0xf'),_0x4a6922,_0xdcdf('0x10'));logger[_0xdcdf('0x11')](_0xdcdf('0x12'),_0x4a6922,_0xdcdf('0x10'),JSON[_0xdcdf('0x13')](_0x3d9e15));if(_0x3d9e15[_0xdcdf('0x14')]){if(_0x3d9e15[_0xdcdf('0x14')][_0xdcdf('0x15')]===0x1f4){logger[_0xdcdf('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x4a6922,_0x3d9e15[_0xdcdf('0x14')][_0xdcdf('0x16')]);return _0x1d5e0f(_0x3d9e15[_0xdcdf('0x14')]['message']);}logger[_0xdcdf('0x14')](_0xdcdf('0xf'),_0x4a6922,_0x3d9e15[_0xdcdf('0x14')][_0xdcdf('0x16')]);return _0xcb3ba4(_0x3d9e15[_0xdcdf('0x14')]['message']);}else{logger[_0xdcdf('0xe')](_0xdcdf('0xf'),_0x4a6922,_0xdcdf('0x10'));_0xcb3ba4(_0x3d9e15[_0xdcdf('0x17')][_0xdcdf('0x16')]);}})[_0xdcdf('0x18')](function(_0x5a7459){logger[_0xdcdf('0x14')](_0xdcdf('0xf'),_0x4a6922,_0x5a7459);_0x1d5e0f(_0x5a7459);});});} \ No newline at end of file +var _0x2d16=['rpc','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf3800b,_0x305cf1){var _0x5f36d5=function(_0x1c1d79){while(--_0x1c1d79){_0xf3800b['push'](_0xf3800b['shift']());}};_0x5f36d5(++_0x305cf1);}(_0x2d16,0x12d));var _0x62d1=function(_0x4f5cd9,_0x5c164e){_0x4f5cd9=_0x4f5cd9-0x0;var _0x4cace9=_0x2d16[_0x4f5cd9];return _0x4cace9;};'use strict';var _=require('lodash');var util=require(_0x62d1('0x0'));var moment=require(_0x62d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x62d1('0x2'));var fs=require('fs');var Redis=require(_0x62d1('0x3'));var db=require(_0x62d1('0x4'))['db'];var utils=require(_0x62d1('0x5'));var logger=require(_0x62d1('0x6'))(_0x62d1('0x7'));var config=require('../../config/environment');var jayson=require(_0x62d1('0x8'));var client=jayson[_0x62d1('0x9')][_0x62d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x376f0b,_0x1c7184,_0x125de2){return new BPromise(function(_0x116b81,_0x3d25a7){return client[_0x62d1('0xb')](_0x376f0b,_0x125de2)['then'](function(_0x4876a8){logger[_0x62d1('0xc')](_0x62d1('0xd'),_0x1c7184,_0x62d1('0xe'));logger['debug'](_0x62d1('0xf'),_0x1c7184,_0x62d1('0xe'),JSON[_0x62d1('0x10')](_0x4876a8));if(_0x4876a8[_0x62d1('0x11')]){if(_0x4876a8[_0x62d1('0x11')][_0x62d1('0x12')]===0x1f4){logger[_0x62d1('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1c7184,_0x4876a8[_0x62d1('0x11')][_0x62d1('0x13')]);return _0x3d25a7(_0x4876a8['error'][_0x62d1('0x13')]);}logger[_0x62d1('0x11')](_0x62d1('0xd'),_0x1c7184,_0x4876a8[_0x62d1('0x11')]['message']);return _0x116b81(_0x4876a8[_0x62d1('0x11')][_0x62d1('0x13')]);}else{logger[_0x62d1('0xc')](_0x62d1('0xd'),_0x1c7184,'request\x20sent');_0x116b81(_0x4876a8[_0x62d1('0x14')]['message']);}})[_0x62d1('0x15')](function(_0x17ab04){logger[_0x62d1('0x11')](_0x62d1('0xd'),_0x1c7184,_0x17ab04);_0x3d25a7(_0x17ab04);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index df5eb39..6668f72 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 _0x2e82=['/:id/configurations','/:id/fields','getFields','post','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x10da67,_0x52c368){var _0x2d5d77=function(_0x35b82b){while(--_0x35b82b){_0x10da67['push'](_0x10da67['shift']());}};_0x2d5d77(++_0x52c368);}(_0x2e82,0x85));var _0x22e8=function(_0x3fb405,_0x558b44){_0x3fb405=_0x3fb405-0x0;var _0x483683=_0x2e82[_0x3fb405];return _0x483683;};'use strict';var multer=require('multer');var util=require(_0x22e8('0x0'));var path=require(_0x22e8('0x1'));var timeout=require(_0x22e8('0x2'));var express=require(_0x22e8('0x3'));var router=express['Router']();var auth=require(_0x22e8('0x4'));var interaction=require(_0x22e8('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x22e8('0x6')]('/',auth[_0x22e8('0x7')](),controller[_0x22e8('0x8')]);router[_0x22e8('0x6')](_0x22e8('0x9'),auth[_0x22e8('0x7')](),controller[_0x22e8('0xa')]);router[_0x22e8('0x6')](_0x22e8('0xb'),auth[_0x22e8('0x7')](),controller['getConfigurations']);router['get'](_0x22e8('0xc'),auth[_0x22e8('0x7')](),controller[_0x22e8('0xd')]);router['post']('/',auth[_0x22e8('0x7')](),controller['create']);router[_0x22e8('0xe')]('/:id/configurations',auth[_0x22e8('0x7')](),controller['addConfiguration']);router['put'](_0x22e8('0x9'),auth[_0x22e8('0x7')](),controller[_0x22e8('0xf')]);router[_0x22e8('0x10')](_0x22e8('0x9'),auth[_0x22e8('0x7')](),controller[_0x22e8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8e83=['Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','/:id/configurations','getConfigurations','get','/:id/fields','getFields','post','addConfiguration','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e83,0x183));var _0x38e8=function(_0x524da2,_0xa9345d){_0x524da2=_0x524da2-0x0;var _0x44ff27=_0x8e83[_0x524da2];return _0x44ff27;};'use strict';var multer=require('multer');var util=require(_0x38e8('0x0'));var path=require(_0x38e8('0x1'));var timeout=require(_0x38e8('0x2'));var express=require(_0x38e8('0x3'));var router=express[_0x38e8('0x4')]();var auth=require(_0x38e8('0x5'));var interaction=require(_0x38e8('0x6'));var config=require('../../config/environment');var controller=require(_0x38e8('0x7'));router['get']('/',auth[_0x38e8('0x8')](),controller[_0x38e8('0x9')]);router['get']('/:id',auth[_0x38e8('0x8')](),controller['show']);router['get'](_0x38e8('0xa'),auth[_0x38e8('0x8')](),controller[_0x38e8('0xb')]);router[_0x38e8('0xc')](_0x38e8('0xd'),auth[_0x38e8('0x8')](),controller[_0x38e8('0xe')]);router[_0x38e8('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x38e8('0xf')]('/:id/configurations',auth[_0x38e8('0x8')](),controller[_0x38e8('0x10')]);router[_0x38e8('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x38e8('0x12')]);router[_0x38e8('0x13')](_0x38e8('0x14'),auth['isAuthenticated'](),controller[_0x38e8('0x15')]);module[_0x38e8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 129f9f7..dfb1c3d 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 _0x173d=['STRING','sequelize'];(function(_0x23ab4d,_0x11fa9d){var _0x259a42=function(_0x2b60be){while(--_0x2b60be){_0x23ab4d['push'](_0x23ab4d['shift']());}};_0x259a42(++_0x11fa9d);}(_0x173d,0xeb));var _0xd173=function(_0x3a7c57,_0x35a256){_0x3a7c57=_0x3a7c57-0x0;var _0x2b9675=_0x173d[_0x3a7c57];return _0x2b9675;};'use strict';var Sequelize=require(_0xd173('0x0'));module['exports']={'name':{'type':Sequelize[_0xd173('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd173('0x1')]},'username':{'type':Sequelize[_0xd173('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd173('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xd173('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd173('0x1')]},'accessKey':{'type':Sequelize[_0xd173('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe626=['STRING','HelpDesk','sequelize','exports'];(function(_0x1d0236,_0x4deb06){var _0x5d4a5c=function(_0xfde01c){while(--_0xfde01c){_0x1d0236['push'](_0x1d0236['shift']());}};_0x5d4a5c(++_0x4deb06);}(_0xe626,0x12a));var _0x6e62=function(_0x36b530,_0x48d775){_0x36b530=_0x36b530-0x0;var _0x5a46f0=_0xe626[_0x36b530];return _0x5a46f0;};'use strict';var Sequelize=require(_0x6e62('0x0'));module[_0x6e62('0x1')]={'name':{'type':Sequelize[_0x6e62('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6e62('0x2')],'allowNull':![],'defaultValue':_0x6e62('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6e62('0x2')]},'accessKey':{'type':Sequelize[_0x6e62('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 756c1e9..16877a5 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 _0xeffd=['api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','VtigerAccount','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','type','key','VIRTUAL','field','count','include','findAll','show','rawAttributes','options','find','create','body','destroy','params','getConfigurations','findOne','VtigerConfiguration','order','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','GET','getchallenge','POST','login','result','success','describe','sessionName','autogenerated','remove','includes','editable','false','label','cf_','picklist','picklistValues','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xeffd,0x6b));var _0xdeff=function(_0x34691f,_0x4b427a){_0x34691f=_0x34691f-0x0;var _0x57251c=_0xeffd[_0x34691f];return _0x57251c;};'use strict';var pdf=require(_0xdeff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdeff('0x1'));var zipdir=require(_0xdeff('0x2'));var jsonpatch=require(_0xdeff('0x3'));var rp=require(_0xdeff('0x4'));var moment=require(_0xdeff('0x5'));var BPromise=require(_0xdeff('0x6'));var Mustache=require(_0xdeff('0x7'));var util=require(_0xdeff('0x8'));var path=require(_0xdeff('0x9'));var sox=require(_0xdeff('0xa'));var csv=require(_0xdeff('0xb'));var ejs=require(_0xdeff('0xc'));var fs=require('fs');var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var authService=require(_0xdeff('0x14'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xdeff('0x15'));var qs=require(_0xdeff('0x16'));var logger=require(_0xdeff('0x17'))(_0xdeff('0x18'));var utils=require(_0xdeff('0x19'));var config=require(_0xdeff('0x1a'));var db=require(_0xdeff('0x1b'))['db'];var integrations=require(_0xdeff('0x1c'));var jayson=require('jayson/promise');var client=jayson[_0xdeff('0x1d')][_0xdeff('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4952f2,_0x2e614c,_0x4e7526,_0x4d411e){return new BPromise(function(_0x3e56a1,_0x47410f){var _0x1585e8=_0x4d411e||client;return _0x1585e8[_0xdeff('0x1f')](_0x4952f2,_0x4e7526)['then'](function(_0x826132){logger[_0xdeff('0x20')](_0xdeff('0x21'),_0x2e614c,_0xdeff('0x22'));logger[_0xdeff('0x23')](_0xdeff('0x24'),_0x2e614c,'request\x20sent',JSON['stringify'](_0x826132));if(_0x826132[_0xdeff('0x25')]){if(_0x826132['error']['code']===0x1f4){logger[_0xdeff('0x25')](_0xdeff('0x21'),_0x2e614c,_0x826132['error'][_0xdeff('0x26')]);return _0x47410f(_0x826132[_0xdeff('0x25')][_0xdeff('0x26')]);}logger[_0xdeff('0x25')](_0xdeff('0x21'),_0x2e614c,_0x826132[_0xdeff('0x25')][_0xdeff('0x26')]);return _0x3e56a1(_0x826132[_0xdeff('0x25')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x2e614c,_0xdeff('0x22'));_0x3e56a1(_0x826132['result'][_0xdeff('0x26')]);}})[_0xdeff('0x27')](function(_0x543653){logger[_0xdeff('0x25')](_0xdeff('0x21'),_0x2e614c,_0x543653);_0x47410f(_0x543653);});});}function respondWithStatusCode(_0x4eb2a8,_0x5dbe96){_0x5dbe96=_0x5dbe96||0xcc;return function(_0x3b2554){if(_0x3b2554){return _0x4eb2a8[_0xdeff('0x28')](_0x5dbe96);}return _0x4eb2a8[_0xdeff('0x29')](_0x5dbe96)[_0xdeff('0x2a')]();};}function respondWithResult(_0x32add9,_0x5a00ee){_0x5a00ee=_0x5a00ee||0xc8;return function(_0xb08f19){if(_0xb08f19){return _0x32add9[_0xdeff('0x29')](_0x5a00ee)[_0xdeff('0x2b')](_0xb08f19);}};}function respondWithFilteredResult(_0x393659,_0x16974b){return function(_0x35823c){if(_0x35823c){var _0x3d0111=_0x35823c['count'],_0x52ea5d=_0x16974b['offset'],_0x31bb72=_0x16974b[_0xdeff('0x2c')]+_0x16974b[_0xdeff('0x2d')],_0x1a546c;if(_0x31bb72>=_0x3d0111){_0x31bb72=_0x3d0111;_0x1a546c=0xc8;}else{_0x1a546c=0xce;}_0x393659[_0xdeff('0x29')](_0x1a546c);return _0x393659[_0xdeff('0x2e')](_0xdeff('0x2f'),_0x52ea5d+'-'+_0x31bb72+'/'+_0x3d0111)[_0xdeff('0x2b')](_0x35823c);}return null;};}function patchUpdates(_0xbc75ee){return function(_0x4e0ff2){try{jsonpatch[_0xdeff('0x30')](_0x4e0ff2,_0xbc75ee,!![]);}catch(_0x167e07){return BPromise[_0xdeff('0x31')](_0x167e07);}return _0x4e0ff2['save']();};}function saveUpdates(_0x59f7a0,_0x346743){return function(_0x505e3f){if(_0x505e3f){return _0x505e3f[_0xdeff('0x32')](_0x59f7a0)[_0xdeff('0x33')](function(_0x44a8b3){return _0x44a8b3;});}return null;};}function removeEntity(_0x5af6b2,_0x189a51){return function(_0x563eba){if(_0x563eba){return _0x563eba['destroy']()[_0xdeff('0x33')](function(){_0x5af6b2[_0xdeff('0x29')](0xcc)[_0xdeff('0x2a')]();});}};}function handleEntityNotFound(_0x240459,_0x5b5d5f){return function(_0x3f91d8){if(!_0x3f91d8){_0x240459[_0xdeff('0x28')](0x194);}return _0x3f91d8;};}function handleError(_0x31f6c7,_0xfcfc54){_0xfcfc54=_0xfcfc54||0x1f4;return function(_0x1ae013){logger[_0xdeff('0x25')](_0x1ae013[_0xdeff('0x34')]);if(_0x1ae013['name']){delete _0x1ae013[_0xdeff('0x35')];}_0x31f6c7['status'](_0xfcfc54)[_0xdeff('0x36')](_0x1ae013);};}exports[_0xdeff('0x37')]=function(_0x2e1736,_0x28b21a){var _0x210dd6={},_0x965c5b={},_0x52baf5={'count':0x0,'rows':[]};var _0x25801b=db[_0xdeff('0x38')]['rawAttributes'];_0x965c5b[_0xdeff('0x39')]=_[_0xdeff('0x3a')](_0x25801b);_0x965c5b[_0xdeff('0x3b')]=_[_0xdeff('0x3a')](_0x2e1736[_0xdeff('0x3b')]);_0x965c5b[_0xdeff('0x3c')]=_[_0xdeff('0x3d')](_0x965c5b[_0xdeff('0x39')],_0x965c5b['query']);_0x210dd6[_0xdeff('0x3e')]=_['intersection'](_0x965c5b[_0xdeff('0x39')],qs[_0xdeff('0x3f')](_0x2e1736[_0xdeff('0x3b')]['fields']));_0x210dd6[_0xdeff('0x3e')]=_0x210dd6[_0xdeff('0x3e')][_0xdeff('0x40')]?_0x210dd6[_0xdeff('0x3e')]:_0x965c5b[_0xdeff('0x39')];if(!_0x2e1736['query'][_0xdeff('0x41')]('nolimit')){_0x210dd6[_0xdeff('0x2d')]=qs[_0xdeff('0x2d')](_0x2e1736['query'][_0xdeff('0x2d')]);_0x210dd6[_0xdeff('0x2c')]=qs[_0xdeff('0x2c')](_0x2e1736[_0xdeff('0x3b')][_0xdeff('0x2c')]);}_0x210dd6['order']=qs[_0xdeff('0x42')](_0x2e1736[_0xdeff('0x3b')][_0xdeff('0x42')]);_0x210dd6[_0xdeff('0x43')]=qs[_0xdeff('0x3c')](_['pick'](_0x2e1736['query'],_0x965c5b[_0xdeff('0x3c')]));if(_0x2e1736[_0xdeff('0x3b')][_0xdeff('0x44')]){_0x210dd6[_0xdeff('0x43')]=_[_0xdeff('0x45')](_0x210dd6[_0xdeff('0x43')],{'$or':_[_0xdeff('0x46')](_0x25801b,function(_0x4f02f5){if(_0x4f02f5[_0xdeff('0x47')][_0xdeff('0x48')]!==_0xdeff('0x49')){var _0x54fa5b={};_0x54fa5b[_0x4f02f5[_0xdeff('0x4a')]]={'$like':'%'+_0x2e1736[_0xdeff('0x3b')][_0xdeff('0x44')]+'%'};return _0x54fa5b;}})});}_0x210dd6=_[_0xdeff('0x45')]({},_0x210dd6,_0x2e1736['options']);var _0x3cd416={'where':_0x210dd6[_0xdeff('0x43')]};return db[_0xdeff('0x38')][_0xdeff('0x4b')](_0x3cd416)[_0xdeff('0x33')](function(_0x55ddb1){_0x52baf5[_0xdeff('0x4b')]=_0x55ddb1;if(_0x2e1736[_0xdeff('0x3b')]['includeAll']){_0x210dd6[_0xdeff('0x4c')]=[{'all':!![]}];}return db[_0xdeff('0x38')][_0xdeff('0x4d')](_0x210dd6);})[_0xdeff('0x33')](function(_0x21c18a){_0x52baf5['rows']=_0x21c18a;return _0x52baf5;})[_0xdeff('0x33')](respondWithFilteredResult(_0x28b21a,_0x210dd6))[_0xdeff('0x27')](handleError(_0x28b21a,null));};exports[_0xdeff('0x4e')]=function(_0x1b4277,_0x62a7df){var _0x5cddcc={'raw':![],'where':{'id':_0x1b4277['params']['id']}},_0x423ac4={};_0x423ac4[_0xdeff('0x39')]=_[_0xdeff('0x3a')](db[_0xdeff('0x38')][_0xdeff('0x4f')]);_0x423ac4[_0xdeff('0x3b')]=_[_0xdeff('0x3a')](_0x1b4277['query']);_0x423ac4['filters']=_[_0xdeff('0x3d')](_0x423ac4[_0xdeff('0x39')],_0x423ac4[_0xdeff('0x3b')]);_0x5cddcc['attributes']=_['intersection'](_0x423ac4[_0xdeff('0x39')],qs[_0xdeff('0x3f')](_0x1b4277['query'][_0xdeff('0x3f')]));_0x5cddcc[_0xdeff('0x3e')]=_0x5cddcc[_0xdeff('0x3e')]['length']?_0x5cddcc[_0xdeff('0x3e')]:_0x423ac4[_0xdeff('0x39')];if(_0x1b4277[_0xdeff('0x3b')]['includeAll']){_0x5cddcc[_0xdeff('0x4c')]=[{'all':!![]}];}_0x5cddcc=_[_0xdeff('0x45')]({},_0x5cddcc,_0x1b4277[_0xdeff('0x50')]);return db[_0xdeff('0x38')][_0xdeff('0x51')](_0x5cddcc)[_0xdeff('0x33')](handleEntityNotFound(_0x62a7df,null))[_0xdeff('0x33')](respondWithResult(_0x62a7df,null))['catch'](handleError(_0x62a7df,null));};exports[_0xdeff('0x52')]=function(_0x1b90a9,_0x5e0c60){return db[_0xdeff('0x38')][_0xdeff('0x52')](_0x1b90a9[_0xdeff('0x53')],{})[_0xdeff('0x33')](respondWithResult(_0x5e0c60,0xc9))[_0xdeff('0x27')](handleError(_0x5e0c60,null));};exports[_0xdeff('0x32')]=function(_0x473d9d,_0x2d6110){if(_0x473d9d['body']['id']){delete _0x473d9d[_0xdeff('0x53')]['id'];}return db[_0xdeff('0x38')][_0xdeff('0x51')]({'where':{'id':_0x473d9d['params']['id']}})['then'](handleEntityNotFound(_0x2d6110,null))[_0xdeff('0x33')](saveUpdates(_0x473d9d[_0xdeff('0x53')],null))[_0xdeff('0x33')](respondWithResult(_0x2d6110,null))[_0xdeff('0x27')](handleError(_0x2d6110,null));};exports[_0xdeff('0x54')]=function(_0x3db4fd,_0x5eabdf){return db['VtigerAccount'][_0xdeff('0x51')]({'where':{'id':_0x3db4fd[_0xdeff('0x55')]['id']}})['then'](handleEntityNotFound(_0x5eabdf,null))['then'](removeEntity(_0x5eabdf,null))[_0xdeff('0x27')](handleError(_0x5eabdf,null));};exports[_0xdeff('0x56')]=function(_0x53a472,_0x4107cf,_0x2ac44c){var _0x577fa8={};var _0x14fa7f={};var _0xe731d8;var _0x4f0d3d;return db[_0xdeff('0x38')][_0xdeff('0x57')]({'where':{'id':_0x53a472['params']['id']}})[_0xdeff('0x33')](handleEntityNotFound(_0x4107cf,null))[_0xdeff('0x33')](function(_0x2a83ac){if(_0x2a83ac){_0xe731d8=_0x2a83ac;_0x14fa7f['model']=_['keys'](db[_0xdeff('0x58')]['rawAttributes']);_0x14fa7f[_0xdeff('0x3b')]=_[_0xdeff('0x3a')](_0x53a472[_0xdeff('0x3b')]);_0x14fa7f[_0xdeff('0x3c')]=_[_0xdeff('0x3d')](_0x14fa7f['model'],_0x14fa7f['query']);_0x577fa8[_0xdeff('0x3e')]=_[_0xdeff('0x3d')](_0x14fa7f[_0xdeff('0x39')],qs[_0xdeff('0x3f')](_0x53a472[_0xdeff('0x3b')][_0xdeff('0x3f')]));_0x577fa8['attributes']=_0x577fa8[_0xdeff('0x3e')]['length']?_0x577fa8[_0xdeff('0x3e')]:_0x14fa7f[_0xdeff('0x39')];_0x577fa8[_0xdeff('0x59')]=qs[_0xdeff('0x42')](_0x53a472[_0xdeff('0x3b')][_0xdeff('0x42')]);_0x577fa8[_0xdeff('0x43')]=qs[_0xdeff('0x3c')](_[_0xdeff('0x5a')](_0x53a472['query'],_0x14fa7f[_0xdeff('0x3c')]));if(_0x53a472['query'][_0xdeff('0x44')]){_0x577fa8[_0xdeff('0x43')]=_['merge'](_0x577fa8[_0xdeff('0x43')],{'$or':_['map'](_0x577fa8[_0xdeff('0x3e')],function(_0x5dd5e4){var _0x52bc12={};_0x52bc12[_0x5dd5e4]={'$like':'%'+_0x53a472[_0xdeff('0x3b')][_0xdeff('0x44')]+'%'};return _0x52bc12;})});}_0x577fa8=_['merge']({},_0x577fa8,_0x53a472[_0xdeff('0x50')]);return _0xe731d8[_0xdeff('0x56')](_0x577fa8);}})[_0xdeff('0x33')](function(_0x3a04fd){if(_0x3a04fd){_0x4f0d3d=_0x3a04fd[_0xdeff('0x40')];if(!_0x53a472[_0xdeff('0x3b')][_0xdeff('0x41')](_0xdeff('0x5b'))){_0x577fa8[_0xdeff('0x2d')]=qs['limit'](_0x53a472[_0xdeff('0x3b')][_0xdeff('0x2d')]);_0x577fa8['offset']=qs['offset'](_0x53a472[_0xdeff('0x3b')][_0xdeff('0x2c')]);}return _0xe731d8['getConfigurations'](_0x577fa8);}})[_0xdeff('0x33')](function(_0x3b820c){if(_0x3b820c){return _0x3b820c?{'count':_0x4f0d3d,'rows':_0x3b820c}:null;}})[_0xdeff('0x33')](respondWithResult(_0x4107cf,null))[_0xdeff('0x27')](handleError(_0x4107cf,null));};exports[_0xdeff('0x5c')]=function(_0x41dc90,_0xa5f4a0,_0x8042f8){if(_0x41dc90[_0xdeff('0x53')]['id']){delete _0x41dc90[_0xdeff('0x53')]['id'];}return db['VtigerAccount'][_0xdeff('0x57')]({'where':{'id':_0x41dc90[_0xdeff('0x55')]['id']}})[_0xdeff('0x33')](handleEntityNotFound(_0xa5f4a0,null))[_0xdeff('0x33')](function(_0x4539c8){if(_0x4539c8){_0x41dc90['body']['AccountId']=_0x4539c8['id'];_0x41dc90['body'][_0xdeff('0x5d')]=integrations[_0xdeff('0x5e')](_0x41dc90[_0xdeff('0x53')][_0xdeff('0x5f')],_0x41dc90['body']['type']);_0x41dc90[_0xdeff('0x53')][_0xdeff('0x60')]=integrations[_0xdeff('0x61')](_0x41dc90[_0xdeff('0x53')][_0xdeff('0x5f')],_0x41dc90[_0xdeff('0x53')][_0xdeff('0x47')]);return db[_0xdeff('0x58')]['create'](_0x41dc90[_0xdeff('0x53')],{'include':[{'model':db[_0xdeff('0x62')],'as':_0xdeff('0x5d')},{'model':db[_0xdeff('0x62')],'as':_0xdeff('0x60')}]});}return null;})[_0xdeff('0x33')](respondWithResult(_0xa5f4a0,null))[_0xdeff('0x27')](handleError(_0xa5f4a0,null));};var md5=require(_0xdeff('0x63'));exports[_0xdeff('0x64')]=function(_0x3beaed,_0x2c987a,_0x2b5ada){var _0x5b60e4=null;var _0xdc88e8=null;var _0xa46f6c=null;var _0x1fa20b=null;var _0x54adce='';return db[_0xdeff('0x38')][_0xdeff('0x57')]({'where':{'id':_0x3beaed[_0xdeff('0x55')]['id']},'attributes':['id',_0xdeff('0x35'),'username',_0xdeff('0x65'),_0xdeff('0x66'),'remoteUri',_0xdeff('0x67'),_0xdeff('0x68')]})[_0xdeff('0x33')](handleEntityNotFound(_0x2c987a,null))[_0xdeff('0x33')](function(_0x2cf348){if(_0x2cf348){_0x5b60e4=_0x2cf348['username'];_0xdc88e8=_0x2cf348[_0xdeff('0x68')];_0xa46f6c=_0x2cf348[_0xdeff('0x66')];_0x54adce=_0x2cf348[_0xdeff('0x69')];var _0xabf302=_0x54adce[_0xdeff('0x6a')](-0x1);if(_0xabf302==='/'){_0x54adce=_0x54adce['substring'](0x0,_0x54adce[_0xdeff('0x6b')](_0xabf302));}_0x1fa20b=util[_0xdeff('0x6c')]('%s/webservice.php',_0x54adce);var _0x22d2fb={'method':_0xdeff('0x6d'),'uri':_0x1fa20b,'qs':{'operation':_0xdeff('0x6e'),'username':_0x2cf348['username']},'json':!![]};return rp(_0x22d2fb);}})[_0xdeff('0x33')](function(_0xea0d77){if(_0xea0d77['success']){var _0x1d51a9={'method':_0xdeff('0x6f'),'uri':_0x1fa20b,'form':{'operation':_0xdeff('0x70'),'username':_0x5b60e4,'accessKey':md5(_0xea0d77[_0xdeff('0x71')]['token']+_0xdc88e8)},'json':!![]};return rp(_0x1d51a9);}})[_0xdeff('0x33')](function(_0x3b8f20){if(_0x3b8f20[_0xdeff('0x72')]){var _0x184cb2={'method':_0xdeff('0x6d'),'uri':_0x1fa20b,'qs':{'operation':_0xdeff('0x73'),'username':_0x5b60e4,'sessionName':_0x3b8f20[_0xdeff('0x71')][_0xdeff('0x74')],'elementType':_0xa46f6c},'json':!![]};return rp(_0x184cb2);}})[_0xdeff('0x33')](function(_0x4cb3d5){if(_0x4cb3d5[_0xdeff('0x72')]){var _0x5e14f8=[_0xdeff('0x75'),'reference','owner'];_[_0xdeff('0x76')](_0x4cb3d5[_0xdeff('0x71')]['fields'],function(_0x363e5b){return _0x5e14f8[_0xdeff('0x77')](_0x363e5b[_0xdeff('0x47')][_0xdeff('0x35')]);});_['remove'](_0x4cb3d5[_0xdeff('0x71')][_0xdeff('0x3f')],function(_0x581500){return _0x581500[_0xdeff('0x78')]===_0xdeff('0x79');});return{'count':_0x4cb3d5[_0xdeff('0x71')][_0xdeff('0x3f')][_0xdeff('0x40')],'rows':_[_0xdeff('0x46')](_0x4cb3d5[_0xdeff('0x71')][_0xdeff('0x3f')],function(_0x5ada1e){return{'id':_0x5ada1e['name'],'name':_0x5ada1e[_0xdeff('0x7a')],'custom':_['startsWith'](_0x5ada1e[_0xdeff('0x35')],_0xdeff('0x7b'))?!![]:![],'options':_0x5ada1e['type'][_0xdeff('0x35')]===_0xdeff('0x7c')&&_0x5ada1e[_0xdeff('0x47')]['picklistValues'][_0xdeff('0x40')]>0x0?_[_0xdeff('0x46')](_0x5ada1e[_0xdeff('0x47')][_0xdeff('0x7d')],function(_0x5eb988){return{'name':_0x5eb988[_0xdeff('0x7a')],'value':_0x5eb988['value']};}):[]};})};}})[_0xdeff('0x33')](respondWithResult(_0x2c987a,null))['catch'](function(_0x23af68){console['log'](_0xdeff('0x7e')+_0x23af68);var _0x27c2ce=_0x3beaed[_0xdeff('0x3b')]['test']?0x1f4:_0x23af68[_0xdeff('0x7f')]||0x1f4;logger[_0xdeff('0x25')](_0xdeff('0x80'),_0xdeff('0x64'),_0x27c2ce,JSON['stringify'](_0x23af68));delete _0x23af68['name'];if(_0x27c2ce===0x191){_0x27c2ce=0x190;}_0x2c987a[_0xdeff('0x29')](_0x27c2ce)[_0xdeff('0x36')](_0x3beaed[_0xdeff('0x3b')][_0xdeff('0x81')]?{'message':_0xdeff('0x82'),'statusCode':_0x23af68[_0xdeff('0x7f')]}:_0x23af68);});}; \ No newline at end of file +var _0x657b=['options','find','create','body','update','params','getConfigurations','findOne','VtigerConfiguration','sort','map','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','VtigerField','getFields','moduleName','remoteUri','username','accessKey','slice','substring','lastIndexOf','format','GET','POST','token','describe','success','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','VtigerAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','show'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x657b,0x131));var _0xb657=function(_0x2b3c96,_0x53a6fe){_0x2b3c96=_0x2b3c96-0x0;var _0xb43666=_0x657b[_0x2b3c96];return _0xb43666;};'use strict';var pdf=require(_0xb657('0x0'));var emlformat=require(_0xb657('0x1'));var rimraf=require(_0xb657('0x2'));var zipdir=require(_0xb657('0x3'));var jsonpatch=require(_0xb657('0x4'));var rp=require('request-promise');var moment=require(_0xb657('0x5'));var BPromise=require(_0xb657('0x6'));var Mustache=require('mustache');var util=require(_0xb657('0x7'));var path=require(_0xb657('0x8'));var sox=require(_0xb657('0x9'));var csv=require(_0xb657('0xa'));var ejs=require(_0xb657('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb657('0xc'));var crypto=require('crypto');var jsforce=require(_0xb657('0xd'));var deskjs=require(_0xb657('0xe'));var toCsv=require(_0xb657('0xa'));var querystring=require('querystring');var Papa=require(_0xb657('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb657('0x10'));var Redis=require('ioredis');var qs=require(_0xb657('0x11'));var logger=require(_0xb657('0x12'))(_0xb657('0x13'));var utils=require('../../config/utils');var config=require(_0xb657('0x14'));var db=require(_0xb657('0x15'))['db'];var integrations=require(_0xb657('0x16'));var jayson=require(_0xb657('0x17'));var client=jayson['client'][_0xb657('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3ebcc2,_0x558eba,_0x11d3ad,_0x20a26){return new BPromise(function(_0xf04de9,_0x3ca0b4){var _0x4aedb7=_0x20a26||client;return _0x4aedb7[_0xb657('0x19')](_0x3ebcc2,_0x11d3ad)[_0xb657('0x1a')](function(_0x511057){logger['info'](_0xb657('0x1b'),_0x558eba,_0xb657('0x1c'));logger[_0xb657('0x1d')](_0xb657('0x1e'),_0x558eba,_0xb657('0x1c'),JSON[_0xb657('0x1f')](_0x511057));if(_0x511057[_0xb657('0x20')]){if(_0x511057[_0xb657('0x20')][_0xb657('0x21')]===0x1f4){logger[_0xb657('0x20')](_0xb657('0x1b'),_0x558eba,_0x511057['error'][_0xb657('0x22')]);return _0x3ca0b4(_0x511057[_0xb657('0x20')][_0xb657('0x22')]);}logger[_0xb657('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x558eba,_0x511057['error'][_0xb657('0x22')]);return _0xf04de9(_0x511057[_0xb657('0x20')][_0xb657('0x22')]);}else{logger['info'](_0xb657('0x1b'),_0x558eba,'request\x20sent');_0xf04de9(_0x511057[_0xb657('0x23')][_0xb657('0x22')]);}})[_0xb657('0x24')](function(_0x12fd7d){logger[_0xb657('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x558eba,_0x12fd7d);_0x3ca0b4(_0x12fd7d);});});}function respondWithStatusCode(_0x3de4eb,_0x13cea8){_0x13cea8=_0x13cea8||0xcc;return function(_0x38b4a0){if(_0x38b4a0){return _0x3de4eb[_0xb657('0x25')](_0x13cea8);}return _0x3de4eb['status'](_0x13cea8)[_0xb657('0x26')]();};}function respondWithResult(_0x595020,_0x20cae3){_0x20cae3=_0x20cae3||0xc8;return function(_0x4e8587){if(_0x4e8587){return _0x595020[_0xb657('0x27')](_0x20cae3)['json'](_0x4e8587);}};}function respondWithFilteredResult(_0x21cf65,_0x154f83){return function(_0x5d4b01){if(_0x5d4b01){var _0x241301=_0x5d4b01[_0xb657('0x28')],_0x33a639=_0x154f83[_0xb657('0x29')],_0x64b150=_0x154f83[_0xb657('0x29')]+_0x154f83[_0xb657('0x2a')],_0x54d1d9;if(_0x64b150>=_0x241301){_0x64b150=_0x241301;_0x54d1d9=0xc8;}else{_0x54d1d9=0xce;}_0x21cf65[_0xb657('0x27')](_0x54d1d9);return _0x21cf65[_0xb657('0x2b')](_0xb657('0x2c'),_0x33a639+'-'+_0x64b150+'/'+_0x241301)[_0xb657('0x2d')](_0x5d4b01);}return null;};}function patchUpdates(_0x291a32){return function(_0x410a93){try{jsonpatch[_0xb657('0x2e')](_0x410a93,_0x291a32,!![]);}catch(_0x2be8c2){return BPromise[_0xb657('0x2f')](_0x2be8c2);}return _0x410a93[_0xb657('0x30')]();};}function saveUpdates(_0x2adf01,_0x2c8e5b){return function(_0x3719c3){if(_0x3719c3){return _0x3719c3['update'](_0x2adf01)[_0xb657('0x1a')](function(_0x5897bd){return _0x5897bd;});}return null;};}function removeEntity(_0x1246ce,_0x41f397){return function(_0x4dcc2a){if(_0x4dcc2a){return _0x4dcc2a[_0xb657('0x31')]()[_0xb657('0x1a')](function(){_0x1246ce[_0xb657('0x27')](0xcc)[_0xb657('0x26')]();});}};}function handleEntityNotFound(_0xbff50,_0x5b5be3){return function(_0x36fe0d){if(!_0x36fe0d){_0xbff50[_0xb657('0x25')](0x194);}return _0x36fe0d;};}function handleError(_0x25d4c9,_0x4df56f){_0x4df56f=_0x4df56f||0x1f4;return function(_0x2041a7){logger['error'](_0x2041a7[_0xb657('0x32')]);if(_0x2041a7[_0xb657('0x33')]){delete _0x2041a7[_0xb657('0x33')];}_0x25d4c9['status'](_0x4df56f)[_0xb657('0x34')](_0x2041a7);};}exports['index']=function(_0x397b75,_0x461f65){var _0x14021f={},_0x1eac45={},_0x451fc1={'count':0x0,'rows':[]};var _0x87600a=db[_0xb657('0x35')][_0xb657('0x36')];_0x1eac45[_0xb657('0x37')]=_[_0xb657('0x38')](_0x87600a);_0x1eac45[_0xb657('0x39')]=_['keys'](_0x397b75['query']);_0x1eac45[_0xb657('0x3a')]=_[_0xb657('0x3b')](_0x1eac45[_0xb657('0x37')],_0x1eac45[_0xb657('0x39')]);_0x14021f[_0xb657('0x3c')]=_[_0xb657('0x3b')](_0x1eac45['model'],qs[_0xb657('0x3d')](_0x397b75['query'][_0xb657('0x3d')]));_0x14021f[_0xb657('0x3c')]=_0x14021f[_0xb657('0x3c')][_0xb657('0x3e')]?_0x14021f[_0xb657('0x3c')]:_0x1eac45['model'];if(!_0x397b75[_0xb657('0x39')][_0xb657('0x3f')](_0xb657('0x40'))){_0x14021f[_0xb657('0x2a')]=qs[_0xb657('0x2a')](_0x397b75[_0xb657('0x39')][_0xb657('0x2a')]);_0x14021f[_0xb657('0x29')]=qs[_0xb657('0x29')](_0x397b75[_0xb657('0x39')]['offset']);}_0x14021f[_0xb657('0x41')]=qs['sort'](_0x397b75[_0xb657('0x39')]['sort']);_0x14021f[_0xb657('0x42')]=qs[_0xb657('0x3a')](_[_0xb657('0x43')](_0x397b75[_0xb657('0x39')],_0x1eac45[_0xb657('0x3a')]));if(_0x397b75[_0xb657('0x39')]['filter']){_0x14021f[_0xb657('0x42')]=_[_0xb657('0x44')](_0x14021f[_0xb657('0x42')],{'$or':_['map'](_0x87600a,function(_0x10c4c9){if(_0x10c4c9[_0xb657('0x45')][_0xb657('0x46')]!==_0xb657('0x47')){var _0x3ca932={};_0x3ca932[_0x10c4c9[_0xb657('0x48')]]={'$like':'%'+_0x397b75[_0xb657('0x39')][_0xb657('0x49')]+'%'};return _0x3ca932;}})});}_0x14021f=_[_0xb657('0x44')]({},_0x14021f,_0x397b75['options']);var _0x3b418c={'where':_0x14021f['where']};return db[_0xb657('0x35')][_0xb657('0x28')](_0x3b418c)['then'](function(_0xd63abc){_0x451fc1['count']=_0xd63abc;if(_0x397b75['query'][_0xb657('0x4a')]){_0x14021f[_0xb657('0x4b')]=[{'all':!![]}];}return db[_0xb657('0x35')][_0xb657('0x4c')](_0x14021f);})['then'](function(_0x1324c9){_0x451fc1[_0xb657('0x4d')]=_0x1324c9;return _0x451fc1;})[_0xb657('0x1a')](respondWithFilteredResult(_0x461f65,_0x14021f))[_0xb657('0x24')](handleError(_0x461f65,null));};exports[_0xb657('0x4e')]=function(_0x5c7d53,_0x301c20){var _0x57489b={'raw':![],'where':{'id':_0x5c7d53['params']['id']}},_0x4fa491={};_0x4fa491[_0xb657('0x37')]=_['keys'](db[_0xb657('0x35')][_0xb657('0x36')]);_0x4fa491[_0xb657('0x39')]=_['keys'](_0x5c7d53[_0xb657('0x39')]);_0x4fa491[_0xb657('0x3a')]=_[_0xb657('0x3b')](_0x4fa491[_0xb657('0x37')],_0x4fa491[_0xb657('0x39')]);_0x57489b[_0xb657('0x3c')]=_['intersection'](_0x4fa491[_0xb657('0x37')],qs[_0xb657('0x3d')](_0x5c7d53['query'][_0xb657('0x3d')]));_0x57489b['attributes']=_0x57489b[_0xb657('0x3c')]['length']?_0x57489b[_0xb657('0x3c')]:_0x4fa491['model'];if(_0x5c7d53[_0xb657('0x39')]['includeAll']){_0x57489b[_0xb657('0x4b')]=[{'all':!![]}];}_0x57489b=_[_0xb657('0x44')]({},_0x57489b,_0x5c7d53[_0xb657('0x4f')]);return db[_0xb657('0x35')][_0xb657('0x50')](_0x57489b)['then'](handleEntityNotFound(_0x301c20,null))[_0xb657('0x1a')](respondWithResult(_0x301c20,null))[_0xb657('0x24')](handleError(_0x301c20,null));};exports[_0xb657('0x51')]=function(_0x2138f3,_0x34784c){return db[_0xb657('0x35')]['create'](_0x2138f3[_0xb657('0x52')],{})[_0xb657('0x1a')](respondWithResult(_0x34784c,0xc9))[_0xb657('0x24')](handleError(_0x34784c,null));};exports[_0xb657('0x53')]=function(_0xfb5b71,_0x267339){if(_0xfb5b71[_0xb657('0x52')]['id']){delete _0xfb5b71[_0xb657('0x52')]['id'];}return db[_0xb657('0x35')]['find']({'where':{'id':_0xfb5b71[_0xb657('0x54')]['id']}})[_0xb657('0x1a')](handleEntityNotFound(_0x267339,null))[_0xb657('0x1a')](saveUpdates(_0xfb5b71[_0xb657('0x52')],null))[_0xb657('0x1a')](respondWithResult(_0x267339,null))['catch'](handleError(_0x267339,null));};exports[_0xb657('0x31')]=function(_0x4e68dd,_0x4e3445){return db[_0xb657('0x35')][_0xb657('0x50')]({'where':{'id':_0x4e68dd[_0xb657('0x54')]['id']}})[_0xb657('0x1a')](handleEntityNotFound(_0x4e3445,null))[_0xb657('0x1a')](removeEntity(_0x4e3445,null))['catch'](handleError(_0x4e3445,null));};exports[_0xb657('0x55')]=function(_0x4e08a0,_0x1b7cba,_0x121a82){var _0x2fd364={};var _0x21bf95={};var _0xccc49b;var _0x162d76;return db[_0xb657('0x35')][_0xb657('0x56')]({'where':{'id':_0x4e08a0[_0xb657('0x54')]['id']}})[_0xb657('0x1a')](handleEntityNotFound(_0x1b7cba,null))[_0xb657('0x1a')](function(_0x1f6e5f){if(_0x1f6e5f){_0xccc49b=_0x1f6e5f;_0x21bf95[_0xb657('0x37')]=_[_0xb657('0x38')](db[_0xb657('0x57')][_0xb657('0x36')]);_0x21bf95[_0xb657('0x39')]=_[_0xb657('0x38')](_0x4e08a0[_0xb657('0x39')]);_0x21bf95[_0xb657('0x3a')]=_[_0xb657('0x3b')](_0x21bf95[_0xb657('0x37')],_0x21bf95[_0xb657('0x39')]);_0x2fd364['attributes']=_[_0xb657('0x3b')](_0x21bf95[_0xb657('0x37')],qs[_0xb657('0x3d')](_0x4e08a0['query'][_0xb657('0x3d')]));_0x2fd364['attributes']=_0x2fd364['attributes'][_0xb657('0x3e')]?_0x2fd364[_0xb657('0x3c')]:_0x21bf95[_0xb657('0x37')];_0x2fd364['order']=qs[_0xb657('0x58')](_0x4e08a0[_0xb657('0x39')][_0xb657('0x58')]);_0x2fd364['where']=qs['filters'](_[_0xb657('0x43')](_0x4e08a0[_0xb657('0x39')],_0x21bf95[_0xb657('0x3a')]));if(_0x4e08a0[_0xb657('0x39')][_0xb657('0x49')]){_0x2fd364['where']=_['merge'](_0x2fd364[_0xb657('0x42')],{'$or':_[_0xb657('0x59')](_0x2fd364[_0xb657('0x3c')],function(_0xe8f0b2){var _0x1abd78={};_0x1abd78[_0xe8f0b2]={'$like':'%'+_0x4e08a0['query'][_0xb657('0x49')]+'%'};return _0x1abd78;})});}_0x2fd364=_[_0xb657('0x44')]({},_0x2fd364,_0x4e08a0['options']);return _0xccc49b[_0xb657('0x55')](_0x2fd364);}})[_0xb657('0x1a')](function(_0x3f2773){if(_0x3f2773){_0x162d76=_0x3f2773[_0xb657('0x3e')];if(!_0x4e08a0[_0xb657('0x39')][_0xb657('0x3f')](_0xb657('0x40'))){_0x2fd364[_0xb657('0x2a')]=qs['limit'](_0x4e08a0['query']['limit']);_0x2fd364[_0xb657('0x29')]=qs[_0xb657('0x29')](_0x4e08a0[_0xb657('0x39')][_0xb657('0x29')]);}return _0xccc49b[_0xb657('0x55')](_0x2fd364);}})[_0xb657('0x1a')](function(_0xda2585){if(_0xda2585){return _0xda2585?{'count':_0x162d76,'rows':_0xda2585}:null;}})['then'](respondWithResult(_0x1b7cba,null))[_0xb657('0x24')](handleError(_0x1b7cba,null));};exports['addConfiguration']=function(_0x4ece89,_0x173fd6,_0x381962){if(_0x4ece89['body']['id']){delete _0x4ece89[_0xb657('0x52')]['id'];}return db[_0xb657('0x35')][_0xb657('0x56')]({'where':{'id':_0x4ece89['params']['id']}})[_0xb657('0x1a')](handleEntityNotFound(_0x173fd6,null))[_0xb657('0x1a')](function(_0x44930d){if(_0x44930d){_0x4ece89[_0xb657('0x52')][_0xb657('0x5a')]=_0x44930d['id'];_0x4ece89['body']['Subjects']=integrations[_0xb657('0x5b')](_0x4ece89[_0xb657('0x52')][_0xb657('0x5c')],_0x4ece89[_0xb657('0x52')][_0xb657('0x45')]);_0x4ece89[_0xb657('0x52')][_0xb657('0x5d')]=integrations[_0xb657('0x5e')](_0x4ece89['body'][_0xb657('0x5c')],_0x4ece89[_0xb657('0x52')]['type']);return db['VtigerConfiguration']['create'](_0x4ece89['body'],{'include':[{'model':db['VtigerField'],'as':_0xb657('0x5f')},{'model':db[_0xb657('0x60')],'as':_0xb657('0x5d')}]});}return null;})['then'](respondWithResult(_0x173fd6,null))['catch'](handleError(_0x173fd6,null));};var md5=require('md5');exports[_0xb657('0x61')]=function(_0x12de9b,_0x1fbf11,_0x1ce805){var _0x4edebd=null;var _0x3bcb24=null;var _0x44d609=null;var _0x32c144=null;var _0x4d338a='';return db[_0xb657('0x35')]['findOne']({'where':{'id':_0x12de9b[_0xb657('0x54')]['id']},'attributes':['id',_0xb657('0x33'),'username','description',_0xb657('0x62'),_0xb657('0x63'),'serverUrl','accessKey']})[_0xb657('0x1a')](handleEntityNotFound(_0x1fbf11,null))[_0xb657('0x1a')](function(_0x20a608){if(_0x20a608){_0x4edebd=_0x20a608[_0xb657('0x64')];_0x3bcb24=_0x20a608[_0xb657('0x65')];_0x44d609=_0x20a608[_0xb657('0x62')];_0x4d338a=_0x20a608['remoteUri'];var _0x593147=_0x4d338a[_0xb657('0x66')](-0x1);if(_0x593147==='/'){_0x4d338a=_0x4d338a[_0xb657('0x67')](0x0,_0x4d338a[_0xb657('0x68')](_0x593147));}_0x32c144=util[_0xb657('0x69')]('%s/webservice.php',_0x4d338a);var _0x38c030={'method':_0xb657('0x6a'),'uri':_0x32c144,'qs':{'operation':'getchallenge','username':_0x20a608[_0xb657('0x64')]},'json':!![]};return rp(_0x38c030);}})['then'](function(_0x521113){if(_0x521113['success']){var _0x5c0efb={'method':_0xb657('0x6b'),'uri':_0x32c144,'form':{'operation':'login','username':_0x4edebd,'accessKey':md5(_0x521113[_0xb657('0x23')][_0xb657('0x6c')]+_0x3bcb24)},'json':!![]};return rp(_0x5c0efb);}})[_0xb657('0x1a')](function(_0x58540e){if(_0x58540e['success']){var _0x91e6c7={'method':'GET','uri':_0x32c144,'qs':{'operation':_0xb657('0x6d'),'username':_0x4edebd,'sessionName':_0x58540e[_0xb657('0x23')]['sessionName'],'elementType':_0x44d609},'json':!![]};return rp(_0x91e6c7);}})[_0xb657('0x1a')](function(_0x592f2e){if(_0x592f2e[_0xb657('0x6e')]){var _0x47983d=[_0xb657('0x6f'),_0xb657('0x70'),_0xb657('0x71')];_[_0xb657('0x72')](_0x592f2e[_0xb657('0x23')][_0xb657('0x3d')],function(_0x5819af){return _0x47983d[_0xb657('0x73')](_0x5819af[_0xb657('0x45')][_0xb657('0x33')]);});_[_0xb657('0x72')](_0x592f2e[_0xb657('0x23')]['fields'],function(_0xb2931a){return _0xb2931a[_0xb657('0x74')]===_0xb657('0x75');});return{'count':_0x592f2e['result'][_0xb657('0x3d')]['length'],'rows':_['map'](_0x592f2e[_0xb657('0x23')][_0xb657('0x3d')],function(_0x1417fb){return{'id':_0x1417fb[_0xb657('0x33')],'name':_0x1417fb[_0xb657('0x76')],'custom':_[_0xb657('0x77')](_0x1417fb[_0xb657('0x33')],_0xb657('0x78'))?!![]:![],'options':_0x1417fb[_0xb657('0x45')][_0xb657('0x33')]===_0xb657('0x79')&&_0x1417fb[_0xb657('0x45')]['picklistValues'][_0xb657('0x3e')]>0x0?_[_0xb657('0x59')](_0x1417fb[_0xb657('0x45')]['picklistValues'],function(_0x27d455){return{'name':_0x27d455[_0xb657('0x76')],'value':_0x27d455[_0xb657('0x7a')]};}):[]};})};}})[_0xb657('0x1a')](respondWithResult(_0x1fbf11,null))['catch'](function(_0x48241f){console[_0xb657('0x7b')](_0xb657('0x7c')+_0x48241f);var _0x5386c6=_0x12de9b[_0xb657('0x39')][_0xb657('0x7d')]?0x1f4:_0x48241f[_0xb657('0x7e')]||0x1f4;logger[_0xb657('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0xb657('0x61'),_0x5386c6,JSON['stringify'](_0x48241f));delete _0x48241f['name'];if(_0x5386c6===0x191){_0x5386c6=0x190;}_0x1fbf11['status'](_0x5386c6)[_0xb657('0x34')](_0x12de9b[_0xb657('0x39')][_0xb657('0x7d')]?{'message':_0xb657('0x7f'),'statusCode':_0x48241f['statusCode']}:_0x48241f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 2de2b7a..0343284 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 _0xa865=['VtigerAccount','util','../../config/logger','moment','bluebird','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0xfbbe4e,_0x27bcac){var _0x4d8385=function(_0x1f7458){while(--_0x1f7458){_0xfbbe4e['push'](_0xfbbe4e['shift']());}};_0x4d8385(++_0x27bcac);}(_0xa865,0x196));var _0x5a86=function(_0x179ebb,_0x17fd8c){_0x179ebb=_0x179ebb-0x0;var _0x5ec822=_0xa865[_0x179ebb];return _0x5ec822;};'use strict';var _=require('lodash');var util=require(_0x5a86('0x0'));var logger=require(_0x5a86('0x1'))('api');var moment=require(_0x5a86('0x2'));var BPromise=require(_0x5a86('0x3'));var rp=require('request-promise');var attributes=require(_0x5a86('0x4'));var integrations=require(_0x5a86('0x5'));module[_0x5a86('0x6')]=function(_0x190a5c,_0x9ef16b){return _0x190a5c[_0x5a86('0x7')](_0x5a86('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7182=['./intVtigerAccount.attributes','exports','define','VtigerAccount','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7182,0x12d));var _0x2718=function(_0x52ac8e,_0x5892e1){_0x52ac8e=_0x52ac8e-0x0;var _0x22e14a=_0x7182[_0x52ac8e];return _0x22e14a;};'use strict';var _=require('lodash');var util=require(_0x2718('0x0'));var logger=require(_0x2718('0x1'))('api');var moment=require(_0x2718('0x2'));var BPromise=require(_0x2718('0x3'));var rp=require(_0x2718('0x4'));var attributes=require(_0x2718('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x2718('0x6')]=function(_0x57f8f3,_0x13c633){return _0x57f8f3[_0x2718('0x7')](_0x2718('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 629de07..414f3df 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 _0xdeda=['http','then','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowVtigerAccount','find','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3902b8,_0x4b013a){var _0x345127=function(_0x333616){while(--_0x333616){_0x3902b8['push'](_0x3902b8['shift']());}};_0x345127(++_0x4b013a);}(_0xdeda,0x1e1));var _0xaded=function(_0x429f47,_0x231e8a){_0x429f47=_0x429f47-0x0;var _0xaa330b=_0xdeda[_0x429f47];return _0xaa330b;};'use strict';var _=require(_0xaded('0x0'));var util=require('util');var moment=require(_0xaded('0x1'));var BPromise=require(_0xaded('0x2'));var rs=require(_0xaded('0x3'));var fs=require('fs');var Redis=require(_0xaded('0x4'));var db=require(_0xaded('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaded('0x6'))('rpc');var config=require(_0xaded('0x7'));var jayson=require(_0xaded('0x8'));var client=jayson['client'][_0xaded('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc60848,_0x2183ef,_0x24982d){return new BPromise(function(_0x1d3214,_0x2f28d8){return client['request'](_0xc60848,_0x24982d)[_0xaded('0xa')](function(_0x823711){logger[_0xaded('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x2183ef,_0xaded('0xc'));logger['debug'](_0xaded('0xd'),_0x2183ef,_0xaded('0xc'),JSON['stringify'](_0x823711));if(_0x823711[_0xaded('0xe')]){if(_0x823711[_0xaded('0xe')][_0xaded('0xf')]===0x1f4){logger['error'](_0xaded('0x10'),_0x2183ef,_0x823711[_0xaded('0xe')][_0xaded('0x11')]);return _0x2f28d8(_0x823711[_0xaded('0xe')][_0xaded('0x11')]);}logger[_0xaded('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x2183ef,_0x823711[_0xaded('0xe')]['message']);return _0x1d3214(_0x823711['error'][_0xaded('0x11')]);}else{logger[_0xaded('0xb')](_0xaded('0x10'),_0x2183ef,_0xaded('0xc'));_0x1d3214(_0x823711[_0xaded('0x12')][_0xaded('0x11')]);}})['catch'](function(_0xe06a25){logger[_0xaded('0xe')](_0xaded('0x10'),_0x2183ef,_0xe06a25);_0x2f28d8(_0xe06a25);});});}exports[_0xaded('0x13')]=function(_0x198b40){var _0x26d49f=this;return new Promise(function(_0x1ba843,_0x5245b9){return db[_0xaded('0x14')][_0xaded('0x15')]({'raw':_0x198b40['options']?_0x198b40[_0xaded('0x16')][_0xaded('0x17')]===undefined?!![]:![]:!![],'where':_0x198b40[_0xaded('0x16')]?_0x198b40[_0xaded('0x16')][_0xaded('0x18')]||null:null,'attributes':_0x198b40['options']?_0x198b40[_0xaded('0x16')][_0xaded('0x19')]||null:null,'limit':_0x198b40[_0xaded('0x16')]?_0x198b40['options'][_0xaded('0x1a')]||null:null,'include':_0x198b40[_0xaded('0x16')]?_0x198b40[_0xaded('0x16')][_0xaded('0x1b')]?_[_0xaded('0x1c')](_0x198b40[_0xaded('0x16')][_0xaded('0x1b')],function(_0xe0ab84){return{'model':db[_0xe0ab84['model']],'as':_0xe0ab84['as'],'attributes':_0xe0ab84[_0xaded('0x19')],'include':_0xe0ab84[_0xaded('0x1b')]?_[_0xaded('0x1c')](_0xe0ab84['include'],function(_0x464d9e){return{'model':db[_0x464d9e[_0xaded('0x1d')]],'as':_0x464d9e['as'],'attributes':_0x464d9e[_0xaded('0x19')],'include':_0x464d9e[_0xaded('0x1b')]?_['map'](_0x464d9e['include'],function(_0x424aba){return{'model':db[_0x424aba[_0xaded('0x1d')]],'as':_0x424aba['as'],'attributes':_0x424aba[_0xaded('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaded('0xa')](function(_0x25777d){logger[_0xaded('0xb')]('GetVtigerAccount',_0x198b40);logger['debug'](_0xaded('0x13'),_0x198b40,JSON[_0xaded('0x1e')](_0x25777d));_0x1ba843(_0x25777d);})[_0xaded('0x1f')](function(_0x4e3e6b){logger[_0xaded('0xe')](_0xaded('0x13'),_0x4e3e6b['message'],_0x198b40);_0x5245b9(_0x26d49f['error'](0x1f4,_0x4e3e6b[_0xaded('0x11')]));});});};exports[_0xaded('0x20')]=function(_0x4d5d14){var _0x1f12e6=this;return new Promise(function(_0x36bc15,_0x33e07f){return db['VtigerAccount'][_0xaded('0x21')]({'raw':_0x4d5d14[_0xaded('0x16')]?_0x4d5d14[_0xaded('0x16')][_0xaded('0x17')]===undefined?!![]:![]:!![],'where':_0x4d5d14['options']?_0x4d5d14[_0xaded('0x16')][_0xaded('0x18')]||null:null,'attributes':_0x4d5d14[_0xaded('0x16')]?_0x4d5d14['options'][_0xaded('0x19')]||null:null,'include':_0x4d5d14['options']?_0x4d5d14[_0xaded('0x16')]['include']?_[_0xaded('0x1c')](_0x4d5d14[_0xaded('0x16')][_0xaded('0x1b')],function(_0x3bcf9b){return{'model':db[_0x3bcf9b[_0xaded('0x1d')]],'as':_0x3bcf9b['as'],'attributes':_0x3bcf9b['attributes'],'include':_0x3bcf9b[_0xaded('0x1b')]?_[_0xaded('0x1c')](_0x3bcf9b[_0xaded('0x1b')],function(_0xd4c939){return{'model':db[_0xd4c939[_0xaded('0x1d')]],'as':_0xd4c939['as'],'attributes':_0xd4c939[_0xaded('0x19')],'include':_0xd4c939[_0xaded('0x1b')]?_['map'](_0xd4c939[_0xaded('0x1b')],function(_0x3a7566){return{'model':db[_0x3a7566[_0xaded('0x1d')]],'as':_0x3a7566['as'],'attributes':_0x3a7566[_0xaded('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ac9dd){logger[_0xaded('0xb')](_0xaded('0x20'),_0x4d5d14);logger[_0xaded('0x22')]('ShowVtigerAccount',_0x4d5d14,JSON[_0xaded('0x1e')](_0x2ac9dd));_0x36bc15(_0x2ac9dd);})[_0xaded('0x1f')](function(_0x1e9785){logger[_0xaded('0xe')](_0xaded('0x20'),_0x1e9785[_0xaded('0x11')],_0x4d5d14);_0x33e07f(_0x1f12e6['error'](0x1f4,_0x1e9785[_0xaded('0x11')]));});});}; \ No newline at end of file +var _0x9b18=['find','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','options','raw','where','attributes','include','map','model','GetVtigerAccount'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x9b18,0x18e));var _0x89b1=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x9b18[_0x37d0bc];return _0x170e60;};'use strict';var _=require(_0x89b1('0x0'));var util=require(_0x89b1('0x1'));var moment=require(_0x89b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x89b1('0x3'));var fs=require('fs');var Redis=require(_0x89b1('0x4'));var db=require(_0x89b1('0x5'))['db'];var utils=require(_0x89b1('0x6'));var logger=require(_0x89b1('0x7'))(_0x89b1('0x8'));var config=require(_0x89b1('0x9'));var jayson=require(_0x89b1('0xa'));var client=jayson[_0x89b1('0xb')][_0x89b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdd4e5e,_0x527ff1,_0x46924a){return new BPromise(function(_0x339a70,_0x4471d2){return client[_0x89b1('0xd')](_0xdd4e5e,_0x46924a)[_0x89b1('0xe')](function(_0x5995cf){logger['info'](_0x89b1('0xf'),_0x527ff1,'request\x20sent');logger[_0x89b1('0x10')](_0x89b1('0x11'),_0x527ff1,'request\x20sent',JSON[_0x89b1('0x12')](_0x5995cf));if(_0x5995cf[_0x89b1('0x13')]){if(_0x5995cf['error'][_0x89b1('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x527ff1,_0x5995cf[_0x89b1('0x13')][_0x89b1('0x15')]);return _0x4471d2(_0x5995cf['error'][_0x89b1('0x15')]);}logger[_0x89b1('0x13')](_0x89b1('0xf'),_0x527ff1,_0x5995cf[_0x89b1('0x13')][_0x89b1('0x15')]);return _0x339a70(_0x5995cf[_0x89b1('0x13')][_0x89b1('0x15')]);}else{logger[_0x89b1('0x16')](_0x89b1('0xf'),_0x527ff1,_0x89b1('0x17'));_0x339a70(_0x5995cf[_0x89b1('0x18')][_0x89b1('0x15')]);}})[_0x89b1('0x19')](function(_0x116708){logger[_0x89b1('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x527ff1,_0x116708);_0x4471d2(_0x116708);});});}exports['GetVtigerAccount']=function(_0x35bc46){var _0x5121dd=this;return new Promise(function(_0x281a9f,_0x4bc2d9){return db['VtigerAccount']['findAll']({'raw':_0x35bc46[_0x89b1('0x1a')]?_0x35bc46[_0x89b1('0x1a')][_0x89b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x35bc46[_0x89b1('0x1a')]?_0x35bc46['options'][_0x89b1('0x1c')]||null:null,'attributes':_0x35bc46[_0x89b1('0x1a')]?_0x35bc46[_0x89b1('0x1a')][_0x89b1('0x1d')]||null:null,'limit':_0x35bc46[_0x89b1('0x1a')]?_0x35bc46[_0x89b1('0x1a')]['limit']||null:null,'include':_0x35bc46[_0x89b1('0x1a')]?_0x35bc46['options'][_0x89b1('0x1e')]?_[_0x89b1('0x1f')](_0x35bc46['options'][_0x89b1('0x1e')],function(_0x587ff2){return{'model':db[_0x587ff2[_0x89b1('0x20')]],'as':_0x587ff2['as'],'attributes':_0x587ff2[_0x89b1('0x1d')],'include':_0x587ff2[_0x89b1('0x1e')]?_['map'](_0x587ff2[_0x89b1('0x1e')],function(_0x11cd82){return{'model':db[_0x11cd82[_0x89b1('0x20')]],'as':_0x11cd82['as'],'attributes':_0x11cd82[_0x89b1('0x1d')],'include':_0x11cd82[_0x89b1('0x1e')]?_['map'](_0x11cd82['include'],function(_0x290d91){return{'model':db[_0x290d91[_0x89b1('0x20')]],'as':_0x290d91['as'],'attributes':_0x290d91[_0x89b1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ee61b){logger[_0x89b1('0x16')](_0x89b1('0x21'),_0x35bc46);logger[_0x89b1('0x10')]('GetVtigerAccount',_0x35bc46,JSON[_0x89b1('0x12')](_0x3ee61b));_0x281a9f(_0x3ee61b);})[_0x89b1('0x19')](function(_0x13cd30){logger[_0x89b1('0x13')](_0x89b1('0x21'),_0x13cd30['message'],_0x35bc46);_0x4bc2d9(_0x5121dd['error'](0x1f4,_0x13cd30[_0x89b1('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x5d662c){var _0x4bd9bc=this;return new Promise(function(_0x54f580,_0x46a52a){return db['VtigerAccount'][_0x89b1('0x22')]({'raw':_0x5d662c[_0x89b1('0x1a')]?_0x5d662c[_0x89b1('0x1a')][_0x89b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d662c['options']?_0x5d662c[_0x89b1('0x1a')][_0x89b1('0x1c')]||null:null,'attributes':_0x5d662c[_0x89b1('0x1a')]?_0x5d662c[_0x89b1('0x1a')][_0x89b1('0x1d')]||null:null,'include':_0x5d662c[_0x89b1('0x1a')]?_0x5d662c[_0x89b1('0x1a')][_0x89b1('0x1e')]?_['map'](_0x5d662c[_0x89b1('0x1a')]['include'],function(_0x3d24d2){return{'model':db[_0x3d24d2[_0x89b1('0x20')]],'as':_0x3d24d2['as'],'attributes':_0x3d24d2[_0x89b1('0x1d')],'include':_0x3d24d2[_0x89b1('0x1e')]?_[_0x89b1('0x1f')](_0x3d24d2[_0x89b1('0x1e')],function(_0x159739){return{'model':db[_0x159739[_0x89b1('0x20')]],'as':_0x159739['as'],'attributes':_0x159739[_0x89b1('0x1d')],'include':_0x159739['include']?_[_0x89b1('0x1f')](_0x159739[_0x89b1('0x1e')],function(_0x5b43da){return{'model':db[_0x5b43da[_0x89b1('0x20')]],'as':_0x5b43da['as'],'attributes':_0x5b43da['attributes']};}):[]};}):[]};}):[]:[]})[_0x89b1('0xe')](function(_0x1d2248){logger[_0x89b1('0x16')](_0x89b1('0x23'),_0x5d662c);logger[_0x89b1('0x10')]('ShowVtigerAccount',_0x5d662c,JSON['stringify'](_0x1d2248));_0x54f580(_0x1d2248);})[_0x89b1('0x19')](function(_0x526634){logger[_0x89b1('0x13')]('ShowVtigerAccount',_0x526634[_0x89b1('0x15')],_0x5d662c);_0x46a52a(_0x4bd9bc[_0x89b1('0x13')](0x1f4,_0x526634[_0x89b1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 5c0f40a..55881b1 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 _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x1c5fec,_0x2d0dcb){var _0x1f9961=function(_0x23494a){while(--_0x23494a){_0x1c5fec['push'](_0x1c5fec['shift']());}};_0x1f9961(++_0x2d0dcb);}(_0xb10b,0x12a));var _0xbb10=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0xb10b[_0x524bf9];return _0x550148;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xbaf0=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','exports','util'];(function(_0x2dfd0e,_0x13739e){var _0x343af6=function(_0x206e2f){while(--_0x206e2f){_0x2dfd0e['push'](_0x2dfd0e['shift']());}};_0x343af6(++_0x13739e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0x9')](),controller['create']);router['put'](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x14')]);router[_0x0baf('0x15')]('/:id',auth[_0x0baf('0x9')](),controller['destroy']);module[_0x0baf('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 1eab999..a9b67c3 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 _0x5de0=['sequelize','exports','STRING'];(function(_0x1624ca,_0x4f56b0){var _0x2870cd=function(_0x3fc4e8){while(--_0x3fc4e8){_0x1624ca['push'](_0x1624ca['shift']());}};_0x2870cd(++_0x4f56b0);}(_0x5de0,0x1bf));var _0x05de=function(_0x59d5cb,_0x51410c){_0x59d5cb=_0x59d5cb-0x0;var _0x2d0b02=_0x5de0[_0x59d5cb];return _0x2d0b02;};'use strict';var Sequelize=require(_0x05de('0x0'));module[_0x05de('0x1')]={'name':{'type':Sequelize[_0x05de('0x2')]},'description':{'type':Sequelize[_0x05de('0x2')]}}; \ No newline at end of file +var _0xe940=['exports','STRING','sequelize'];(function(_0x5dfc93,_0x3dd33f){var _0x415b41=function(_0x462854){while(--_0x462854){_0x5dfc93['push'](_0x5dfc93['shift']());}};_0x415b41(++_0x3dd33f);}(_0xe940,0xf8));var _0x0e94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe940[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x0e94('0x0'));module[_0x0e94('0x1')]={'name':{'type':Sequelize[_0x0e94('0x2')]},'description':{'type':Sequelize[_0x0e94('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 4017ff4..7105d3b 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 _0x65c9=['merge','options','find','create','body','destroy','params','getFields','findOne','length','getSubjects','map','VtigerField','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','sendStatus','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','VtigerConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','key','VIRTUAL','field','count','includeAll','include','findAll','rows'];(function(_0x4135af,_0x23c645){var _0x548d3d=function(_0x3910cb){while(--_0x3910cb){_0x4135af['push'](_0x4135af['shift']());}};_0x548d3d(++_0x23c645);}(_0x65c9,0x182));var _0x965c=function(_0x1499c3,_0x48dcc4){_0x1499c3=_0x1499c3-0x0;var _0x3820de=_0x65c9[_0x1499c3];return _0x3820de;};'use strict';var pdf=require(_0x965c('0x0'));var emlformat=require(_0x965c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x965c('0x2'));var jsonpatch=require(_0x965c('0x3'));var rp=require(_0x965c('0x4'));var moment=require(_0x965c('0x5'));var BPromise=require(_0x965c('0x6'));var Mustache=require(_0x965c('0x7'));var util=require(_0x965c('0x8'));var path=require(_0x965c('0x9'));var sox=require(_0x965c('0xa'));var csv=require(_0x965c('0xb'));var ejs=require(_0x965c('0xc'));var fs=require('fs');var _=require(_0x965c('0xd'));var squel=require('squel');var crypto=require(_0x965c('0xe'));var jsforce=require(_0x965c('0xf'));var deskjs=require(_0x965c('0x10'));var toCsv=require(_0x965c('0xb'));var querystring=require(_0x965c('0x11'));var Papa=require(_0x965c('0x12'));var authService=require(_0x965c('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x965c('0x14'));var qs=require(_0x965c('0x15'));var logger=require(_0x965c('0x16'))(_0x965c('0x17'));var utils=require(_0x965c('0x18'));var config=require(_0x965c('0x19'));var db=require(_0x965c('0x1a'))['db'];var jayson=require(_0x965c('0x1b'));var client=jayson[_0x965c('0x1c')][_0x965c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x154827,_0x1d5cb4,_0x394cc0,_0x166f04){return new BPromise(function(_0x5039e5,_0x1e343c){var _0x26618f=_0x166f04||client;return _0x26618f[_0x965c('0x1e')](_0x154827,_0x394cc0)['then'](function(_0x438616){logger[_0x965c('0x1f')](_0x965c('0x20'),_0x1d5cb4,'request\x20sent');logger[_0x965c('0x21')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1d5cb4,'request\x20sent',JSON['stringify'](_0x438616));if(_0x438616[_0x965c('0x22')]){if(_0x438616[_0x965c('0x22')][_0x965c('0x23')]===0x1f4){logger[_0x965c('0x22')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d5cb4,_0x438616['error']['message']);return _0x1e343c(_0x438616[_0x965c('0x22')][_0x965c('0x24')]);}logger[_0x965c('0x22')](_0x965c('0x20'),_0x1d5cb4,_0x438616[_0x965c('0x22')][_0x965c('0x24')]);return _0x5039e5(_0x438616[_0x965c('0x22')][_0x965c('0x24')]);}else{logger[_0x965c('0x1f')](_0x965c('0x20'),_0x1d5cb4,_0x965c('0x25'));_0x5039e5(_0x438616['result'][_0x965c('0x24')]);}})[_0x965c('0x26')](function(_0x4e345c){logger[_0x965c('0x22')](_0x965c('0x20'),_0x1d5cb4,_0x4e345c);_0x1e343c(_0x4e345c);});});}function respondWithStatusCode(_0x5e25b2,_0x4393aa){_0x4393aa=_0x4393aa||0xcc;return function(_0x2ac16c){if(_0x2ac16c){return _0x5e25b2[_0x965c('0x27')](_0x4393aa);}return _0x5e25b2['status'](_0x4393aa)[_0x965c('0x28')]();};}function respondWithResult(_0x7b8907,_0x351971){_0x351971=_0x351971||0xc8;return function(_0x146df2){if(_0x146df2){return _0x7b8907['status'](_0x351971)[_0x965c('0x29')](_0x146df2);}};}function respondWithFilteredResult(_0x4db10a,_0x526b5a){return function(_0x4d19f6){if(_0x4d19f6){var _0xc5d241=_0x4d19f6['count'],_0x327aa6=_0x526b5a[_0x965c('0x2a')],_0x3cf10f=_0x526b5a['offset']+_0x526b5a[_0x965c('0x2b')],_0x551ed5;if(_0x3cf10f>=_0xc5d241){_0x3cf10f=_0xc5d241;_0x551ed5=0xc8;}else{_0x551ed5=0xce;}_0x4db10a['status'](_0x551ed5);return _0x4db10a[_0x965c('0x2c')](_0x965c('0x2d'),_0x327aa6+'-'+_0x3cf10f+'/'+_0xc5d241)[_0x965c('0x29')](_0x4d19f6);}return null;};}function patchUpdates(_0x8f9853){return function(_0x17a7bd){try{jsonpatch[_0x965c('0x2e')](_0x17a7bd,_0x8f9853,!![]);}catch(_0x2fd2c7){return BPromise[_0x965c('0x2f')](_0x2fd2c7);}return _0x17a7bd[_0x965c('0x30')]();};}function saveUpdates(_0x570fa6,_0x2a1b9d){return function(_0x1d465c){if(_0x1d465c){return _0x1d465c[_0x965c('0x31')](_0x570fa6)[_0x965c('0x32')](function(_0x238b4a){return _0x238b4a;});}return null;};}function removeEntity(_0x231780,_0x357106){return function(_0x3b1204){if(_0x3b1204){return _0x3b1204['destroy']()[_0x965c('0x32')](function(){_0x231780['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3c109,_0x34eb72){return function(_0x39ac64){if(!_0x39ac64){_0xe3c109['sendStatus'](0x194);}return _0x39ac64;};}function handleError(_0x11f8b1,_0x2c7cef){_0x2c7cef=_0x2c7cef||0x1f4;return function(_0x134a36){logger['error'](_0x134a36[_0x965c('0x33')]);if(_0x134a36[_0x965c('0x34')]){delete _0x134a36[_0x965c('0x34')];}_0x11f8b1['status'](_0x2c7cef)[_0x965c('0x35')](_0x134a36);};}exports[_0x965c('0x36')]=function(_0xf4c919,_0x93c737){var _0x99176b={},_0x3294df={},_0x5c2928={'count':0x0,'rows':[]};var _0x28a06a=db[_0x965c('0x37')][_0x965c('0x38')];_0x3294df[_0x965c('0x39')]=_[_0x965c('0x3a')](_0x28a06a);_0x3294df[_0x965c('0x3b')]=_[_0x965c('0x3a')](_0xf4c919[_0x965c('0x3b')]);_0x3294df['filters']=_[_0x965c('0x3c')](_0x3294df[_0x965c('0x39')],_0x3294df[_0x965c('0x3b')]);_0x99176b[_0x965c('0x3d')]=_['intersection'](_0x3294df[_0x965c('0x39')],qs[_0x965c('0x3e')](_0xf4c919[_0x965c('0x3b')][_0x965c('0x3e')]));_0x99176b['attributes']=_0x99176b[_0x965c('0x3d')]['length']?_0x99176b[_0x965c('0x3d')]:_0x3294df[_0x965c('0x39')];if(!_0xf4c919[_0x965c('0x3b')][_0x965c('0x3f')](_0x965c('0x40'))){_0x99176b['limit']=qs[_0x965c('0x2b')](_0xf4c919[_0x965c('0x3b')][_0x965c('0x2b')]);_0x99176b[_0x965c('0x2a')]=qs[_0x965c('0x2a')](_0xf4c919[_0x965c('0x3b')][_0x965c('0x2a')]);}_0x99176b[_0x965c('0x41')]=qs['sort'](_0xf4c919[_0x965c('0x3b')][_0x965c('0x42')]);_0x99176b[_0x965c('0x43')]=qs[_0x965c('0x44')](_[_0x965c('0x45')](_0xf4c919[_0x965c('0x3b')],_0x3294df[_0x965c('0x44')]));if(_0xf4c919[_0x965c('0x3b')][_0x965c('0x46')]){_0x99176b[_0x965c('0x43')]=_['merge'](_0x99176b[_0x965c('0x43')],{'$or':_['map'](_0x28a06a,function(_0x2090e4){if(_0x2090e4['type'][_0x965c('0x47')]!==_0x965c('0x48')){var _0x3903e9={};_0x3903e9[_0x2090e4[_0x965c('0x49')]]={'$like':'%'+_0xf4c919[_0x965c('0x3b')][_0x965c('0x46')]+'%'};return _0x3903e9;}})});}_0x99176b=_['merge']({},_0x99176b,_0xf4c919['options']);var _0x343299={'where':_0x99176b[_0x965c('0x43')]};return db['VtigerConfiguration'][_0x965c('0x4a')](_0x343299)[_0x965c('0x32')](function(_0x3eca00){_0x5c2928['count']=_0x3eca00;if(_0xf4c919[_0x965c('0x3b')][_0x965c('0x4b')]){_0x99176b[_0x965c('0x4c')]=[{'all':!![]}];}return db[_0x965c('0x37')][_0x965c('0x4d')](_0x99176b);})[_0x965c('0x32')](function(_0x425db2){_0x5c2928[_0x965c('0x4e')]=_0x425db2;return _0x5c2928;})['then'](respondWithFilteredResult(_0x93c737,_0x99176b))['catch'](handleError(_0x93c737,null));};exports['show']=function(_0x1b785c,_0x273230){var _0x74326a={'raw':![],'where':{'id':_0x1b785c['params']['id']}},_0x5b28af={};_0x5b28af['model']=_['keys'](db[_0x965c('0x37')]['rawAttributes']);_0x5b28af[_0x965c('0x3b')]=_[_0x965c('0x3a')](_0x1b785c[_0x965c('0x3b')]);_0x5b28af[_0x965c('0x44')]=_[_0x965c('0x3c')](_0x5b28af[_0x965c('0x39')],_0x5b28af['query']);_0x74326a[_0x965c('0x3d')]=_[_0x965c('0x3c')](_0x5b28af[_0x965c('0x39')],qs['fields'](_0x1b785c[_0x965c('0x3b')][_0x965c('0x3e')]));_0x74326a[_0x965c('0x3d')]=_0x74326a['attributes']['length']?_0x74326a[_0x965c('0x3d')]:_0x5b28af[_0x965c('0x39')];if(_0x1b785c[_0x965c('0x3b')][_0x965c('0x4b')]){_0x74326a[_0x965c('0x4c')]=[{'all':!![]}];}_0x74326a=_[_0x965c('0x4f')]({},_0x74326a,_0x1b785c[_0x965c('0x50')]);return db[_0x965c('0x37')][_0x965c('0x51')](_0x74326a)[_0x965c('0x32')](handleEntityNotFound(_0x273230,null))[_0x965c('0x32')](respondWithResult(_0x273230,null))[_0x965c('0x26')](handleError(_0x273230,null));};exports[_0x965c('0x52')]=function(_0x55ac17,_0x193e84){return db[_0x965c('0x37')][_0x965c('0x52')](_0x55ac17[_0x965c('0x53')],{})[_0x965c('0x32')](respondWithResult(_0x193e84,0xc9))[_0x965c('0x26')](handleError(_0x193e84,null));};exports[_0x965c('0x31')]=function(_0x44a9d7,_0x297e53){if(_0x44a9d7['body']['id']){delete _0x44a9d7[_0x965c('0x53')]['id'];}return db[_0x965c('0x37')]['find']({'where':{'id':_0x44a9d7['params']['id']}})[_0x965c('0x32')](handleEntityNotFound(_0x297e53,null))[_0x965c('0x32')](saveUpdates(_0x44a9d7['body'],null))['then'](respondWithResult(_0x297e53,null))[_0x965c('0x26')](handleError(_0x297e53,null));};exports[_0x965c('0x54')]=function(_0x32aaac,_0x26fb2e){return db[_0x965c('0x37')][_0x965c('0x51')]({'where':{'id':_0x32aaac[_0x965c('0x55')]['id']}})[_0x965c('0x32')](handleEntityNotFound(_0x26fb2e,null))[_0x965c('0x32')](removeEntity(_0x26fb2e,null))['catch'](handleError(_0x26fb2e,null));};exports[_0x965c('0x56')]=function(_0x53aa62,_0x1251ce,_0x572f7d){var _0x1111a3={};var _0x3e0b59={};var _0x931385;var _0x4104f6;return db['VtigerConfiguration'][_0x965c('0x57')]({'where':{'id':_0x53aa62[_0x965c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1251ce,null))[_0x965c('0x32')](function(_0x5e408b){if(_0x5e408b){_0x931385=_0x5e408b;_0x3e0b59[_0x965c('0x39')]=_[_0x965c('0x3a')](db['VtigerField'][_0x965c('0x38')]);_0x3e0b59[_0x965c('0x3b')]=_[_0x965c('0x3a')](_0x53aa62[_0x965c('0x3b')]);_0x3e0b59['filters']=_[_0x965c('0x3c')](_0x3e0b59[_0x965c('0x39')],_0x3e0b59[_0x965c('0x3b')]);_0x1111a3['attributes']=_['intersection'](_0x3e0b59[_0x965c('0x39')],qs[_0x965c('0x3e')](_0x53aa62[_0x965c('0x3b')][_0x965c('0x3e')]));_0x1111a3[_0x965c('0x3d')]=_0x1111a3[_0x965c('0x3d')][_0x965c('0x58')]?_0x1111a3[_0x965c('0x3d')]:_0x3e0b59[_0x965c('0x39')];_0x1111a3[_0x965c('0x41')]=qs[_0x965c('0x42')](_0x53aa62[_0x965c('0x3b')]['sort']);_0x1111a3[_0x965c('0x43')]=qs['filters'](_[_0x965c('0x45')](_0x53aa62[_0x965c('0x3b')],_0x3e0b59['filters']));if(_0x53aa62[_0x965c('0x3b')][_0x965c('0x46')]){_0x1111a3[_0x965c('0x43')]=_['merge'](_0x1111a3[_0x965c('0x43')],{'$or':_['map'](_0x1111a3[_0x965c('0x3d')],function(_0x35d6e6){var _0x42e9eb={};_0x42e9eb[_0x35d6e6]={'$like':'%'+_0x53aa62[_0x965c('0x3b')][_0x965c('0x46')]+'%'};return _0x42e9eb;})});}_0x1111a3=_[_0x965c('0x4f')]({},_0x1111a3,_0x53aa62['options']);return _0x931385[_0x965c('0x56')](_0x1111a3);}})['then'](function(_0x110ff8){if(_0x110ff8){_0x4104f6=_0x110ff8[_0x965c('0x58')];if(!_0x53aa62[_0x965c('0x3b')]['hasOwnProperty']('nolimit')){_0x1111a3[_0x965c('0x2b')]=qs['limit'](_0x53aa62['query']['limit']);_0x1111a3[_0x965c('0x2a')]=qs['offset'](_0x53aa62[_0x965c('0x3b')]['offset']);}return _0x931385['getFields'](_0x1111a3);}})[_0x965c('0x32')](function(_0x2f603f){if(_0x2f603f){return _0x2f603f?{'count':_0x4104f6,'rows':_0x2f603f}:null;}})[_0x965c('0x32')](respondWithResult(_0x1251ce,null))['catch'](handleError(_0x1251ce,null));};exports[_0x965c('0x59')]=function(_0x72ff67,_0x554892,_0x17ab7a){var _0x1bf4fd={};var _0x15b8ec={};var _0x36bdde;var _0x3e9482;return db[_0x965c('0x37')]['findOne']({'where':{'id':_0x72ff67[_0x965c('0x55')]['id']}})[_0x965c('0x32')](handleEntityNotFound(_0x554892,null))[_0x965c('0x32')](function(_0x523bfb){if(_0x523bfb){_0x36bdde=_0x523bfb;_0x15b8ec[_0x965c('0x39')]=_[_0x965c('0x3a')](db['VtigerField'][_0x965c('0x38')]);_0x15b8ec[_0x965c('0x3b')]=_[_0x965c('0x3a')](_0x72ff67[_0x965c('0x3b')]);_0x15b8ec['filters']=_[_0x965c('0x3c')](_0x15b8ec[_0x965c('0x39')],_0x15b8ec[_0x965c('0x3b')]);_0x1bf4fd[_0x965c('0x3d')]=_[_0x965c('0x3c')](_0x15b8ec[_0x965c('0x39')],qs['fields'](_0x72ff67[_0x965c('0x3b')][_0x965c('0x3e')]));_0x1bf4fd[_0x965c('0x3d')]=_0x1bf4fd[_0x965c('0x3d')][_0x965c('0x58')]?_0x1bf4fd[_0x965c('0x3d')]:_0x15b8ec[_0x965c('0x39')];_0x1bf4fd['order']=qs[_0x965c('0x42')](_0x72ff67[_0x965c('0x3b')]['sort']);_0x1bf4fd['where']=qs[_0x965c('0x44')](_[_0x965c('0x45')](_0x72ff67[_0x965c('0x3b')],_0x15b8ec[_0x965c('0x44')]));if(_0x72ff67[_0x965c('0x3b')]['filter']){_0x1bf4fd[_0x965c('0x43')]=_['merge'](_0x1bf4fd[_0x965c('0x43')],{'$or':_[_0x965c('0x5a')](_0x1bf4fd['attributes'],function(_0x44ea29){var _0x3bb88b={};_0x3bb88b[_0x44ea29]={'$like':'%'+_0x72ff67[_0x965c('0x3b')][_0x965c('0x46')]+'%'};return _0x3bb88b;})});}_0x1bf4fd=_[_0x965c('0x4f')]({},_0x1bf4fd,_0x72ff67[_0x965c('0x50')]);return _0x36bdde[_0x965c('0x59')](_0x1bf4fd);}})[_0x965c('0x32')](function(_0x26a937){if(_0x26a937){_0x3e9482=_0x26a937[_0x965c('0x58')];if(!_0x72ff67['query'][_0x965c('0x3f')](_0x965c('0x40'))){_0x1bf4fd[_0x965c('0x2b')]=qs['limit'](_0x72ff67['query'][_0x965c('0x2b')]);_0x1bf4fd[_0x965c('0x2a')]=qs[_0x965c('0x2a')](_0x72ff67[_0x965c('0x3b')]['offset']);}return _0x36bdde['getSubjects'](_0x1bf4fd);}})[_0x965c('0x32')](function(_0x308291){if(_0x308291){return _0x308291?{'count':_0x3e9482,'rows':_0x308291}:null;}})[_0x965c('0x32')](respondWithResult(_0x554892,null))[_0x965c('0x26')](handleError(_0x554892,null));};exports['getDescriptions']=function(_0x3d55ca,_0x4034a1,_0x4c043c){var _0x10b12d={};var _0x44fca1={};var _0xd37e70;var _0x5f18b3;return db[_0x965c('0x37')][_0x965c('0x57')]({'where':{'id':_0x3d55ca[_0x965c('0x55')]['id']}})['then'](handleEntityNotFound(_0x4034a1,null))[_0x965c('0x32')](function(_0x2254d1){if(_0x2254d1){_0xd37e70=_0x2254d1;_0x44fca1['model']=_[_0x965c('0x3a')](db[_0x965c('0x5b')][_0x965c('0x38')]);_0x44fca1['query']=_[_0x965c('0x3a')](_0x3d55ca['query']);_0x44fca1[_0x965c('0x44')]=_[_0x965c('0x3c')](_0x44fca1[_0x965c('0x39')],_0x44fca1[_0x965c('0x3b')]);_0x10b12d['attributes']=_[_0x965c('0x3c')](_0x44fca1[_0x965c('0x39')],qs[_0x965c('0x3e')](_0x3d55ca[_0x965c('0x3b')]['fields']));_0x10b12d[_0x965c('0x3d')]=_0x10b12d[_0x965c('0x3d')]['length']?_0x10b12d['attributes']:_0x44fca1[_0x965c('0x39')];_0x10b12d[_0x965c('0x41')]=qs[_0x965c('0x42')](_0x3d55ca[_0x965c('0x3b')][_0x965c('0x42')]);_0x10b12d[_0x965c('0x43')]=qs[_0x965c('0x44')](_[_0x965c('0x45')](_0x3d55ca['query'],_0x44fca1[_0x965c('0x44')]));if(_0x3d55ca[_0x965c('0x3b')][_0x965c('0x46')]){_0x10b12d[_0x965c('0x43')]=_[_0x965c('0x4f')](_0x10b12d[_0x965c('0x43')],{'$or':_[_0x965c('0x5a')](_0x10b12d['attributes'],function(_0x3d5a0d){var _0x2395c7={};_0x2395c7[_0x3d5a0d]={'$like':'%'+_0x3d55ca[_0x965c('0x3b')]['filter']+'%'};return _0x2395c7;})});}_0x10b12d=_[_0x965c('0x4f')]({},_0x10b12d,_0x3d55ca[_0x965c('0x50')]);return _0xd37e70['getDescriptions'](_0x10b12d);}})[_0x965c('0x32')](function(_0x2907fe){if(_0x2907fe){_0x5f18b3=_0x2907fe[_0x965c('0x58')];if(!_0x3d55ca[_0x965c('0x3b')][_0x965c('0x3f')]('nolimit')){_0x10b12d['limit']=qs[_0x965c('0x2b')](_0x3d55ca['query']['limit']);_0x10b12d[_0x965c('0x2a')]=qs['offset'](_0x3d55ca['query']['offset']);}return _0xd37e70[_0x965c('0x5c')](_0x10b12d);}})[_0x965c('0x32')](function(_0x3684a0){if(_0x3684a0){return _0x3684a0?{'count':_0x5f18b3,'rows':_0x3684a0}:null;}})[_0x965c('0x32')](respondWithResult(_0x4034a1,null))[_0x965c('0x26')](handleError(_0x4034a1,null));}; \ No newline at end of file +var _0x32b6=['field','filter','options','includeAll','VtigerConfiguration','findAll','rows','show','find','create','body','params','getFields','findOne','sort','map','getSubjects','VtigerField','order','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','where','merge','type','key','VIRTUAL'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x32b6,0x1d1));var _0x632b=function(_0x386075,_0x3e8aa5){_0x386075=_0x386075-0x0;var _0x566d4d=_0x32b6[_0x386075];return _0x566d4d;};'use strict';var pdf=require(_0x632b('0x0'));var emlformat=require(_0x632b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x632b('0x2'));var jsonpatch=require(_0x632b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x632b('0x4'));var Mustache=require(_0x632b('0x5'));var util=require(_0x632b('0x6'));var path=require(_0x632b('0x7'));var sox=require(_0x632b('0x8'));var csv=require(_0x632b('0x9'));var ejs=require(_0x632b('0xa'));var fs=require('fs');var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x9'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x632b('0x11'));var logger=require('../../config/logger')(_0x632b('0x12'));var utils=require(_0x632b('0x13'));var config=require(_0x632b('0x14'));var db=require(_0x632b('0x15'))['db'];var jayson=require(_0x632b('0x16'));var client=jayson[_0x632b('0x17')][_0x632b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3d8bed,_0x22c182,_0x536aa2,_0xb5416c){return new BPromise(function(_0x286f75,_0x9246a6){var _0x5a97da=_0xb5416c||client;return _0x5a97da[_0x632b('0x19')](_0x3d8bed,_0x536aa2)[_0x632b('0x1a')](function(_0x108249){logger[_0x632b('0x1b')](_0x632b('0x1c'),_0x22c182,_0x632b('0x1d'));logger['debug'](_0x632b('0x1e'),_0x22c182,'request\x20sent',JSON['stringify'](_0x108249));if(_0x108249[_0x632b('0x1f')]){if(_0x108249['error'][_0x632b('0x20')]===0x1f4){logger[_0x632b('0x1f')](_0x632b('0x1c'),_0x22c182,_0x108249['error'][_0x632b('0x21')]);return _0x9246a6(_0x108249[_0x632b('0x1f')][_0x632b('0x21')]);}logger[_0x632b('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x22c182,_0x108249[_0x632b('0x1f')][_0x632b('0x21')]);return _0x286f75(_0x108249['error'][_0x632b('0x21')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x22c182,_0x632b('0x1d'));_0x286f75(_0x108249['result'][_0x632b('0x21')]);}})[_0x632b('0x22')](function(_0x2a6833){logger['error'](_0x632b('0x1c'),_0x22c182,_0x2a6833);_0x9246a6(_0x2a6833);});});}function respondWithStatusCode(_0x43cf26,_0x59d83a){_0x59d83a=_0x59d83a||0xcc;return function(_0x1db8f5){if(_0x1db8f5){return _0x43cf26[_0x632b('0x23')](_0x59d83a);}return _0x43cf26[_0x632b('0x24')](_0x59d83a)[_0x632b('0x25')]();};}function respondWithResult(_0x45d017,_0x183c5c){_0x183c5c=_0x183c5c||0xc8;return function(_0x5ec5ea){if(_0x5ec5ea){return _0x45d017['status'](_0x183c5c)[_0x632b('0x26')](_0x5ec5ea);}};}function respondWithFilteredResult(_0x4d3a70,_0x4ebd26){return function(_0x954fa0){if(_0x954fa0){var _0x5d6855=_0x954fa0[_0x632b('0x27')],_0x273e89=_0x4ebd26[_0x632b('0x28')],_0x3f4eab=_0x4ebd26[_0x632b('0x28')]+_0x4ebd26[_0x632b('0x29')],_0x29d9aa;if(_0x3f4eab>=_0x5d6855){_0x3f4eab=_0x5d6855;_0x29d9aa=0xc8;}else{_0x29d9aa=0xce;}_0x4d3a70[_0x632b('0x24')](_0x29d9aa);return _0x4d3a70[_0x632b('0x2a')]('Content-Range',_0x273e89+'-'+_0x3f4eab+'/'+_0x5d6855)[_0x632b('0x26')](_0x954fa0);}return null;};}function patchUpdates(_0x35348e){return function(_0x1819fa){try{jsonpatch[_0x632b('0x2b')](_0x1819fa,_0x35348e,!![]);}catch(_0x17a5ba){return BPromise[_0x632b('0x2c')](_0x17a5ba);}return _0x1819fa[_0x632b('0x2d')]();};}function saveUpdates(_0x417d62,_0x1ace1b){return function(_0x319df3){if(_0x319df3){return _0x319df3[_0x632b('0x2e')](_0x417d62)[_0x632b('0x1a')](function(_0x2a7a44){return _0x2a7a44;});}return null;};}function removeEntity(_0x2e07e4,_0x227497){return function(_0x3dff99){if(_0x3dff99){return _0x3dff99[_0x632b('0x2f')]()[_0x632b('0x1a')](function(){_0x2e07e4[_0x632b('0x24')](0xcc)[_0x632b('0x25')]();});}};}function handleEntityNotFound(_0x4899b0,_0x1fc0f9){return function(_0x4401dc){if(!_0x4401dc){_0x4899b0[_0x632b('0x23')](0x194);}return _0x4401dc;};}function handleError(_0x1220a7,_0x5857e4){_0x5857e4=_0x5857e4||0x1f4;return function(_0x387677){logger['error'](_0x387677[_0x632b('0x30')]);if(_0x387677[_0x632b('0x31')]){delete _0x387677['name'];}_0x1220a7[_0x632b('0x24')](_0x5857e4)[_0x632b('0x32')](_0x387677);};}exports[_0x632b('0x33')]=function(_0x11b766,_0x27bbf5){var _0x2a7998={},_0x1a7773={},_0x300b60={'count':0x0,'rows':[]};var _0x4d374f=db['VtigerConfiguration'][_0x632b('0x34')];_0x1a7773[_0x632b('0x35')]=_[_0x632b('0x36')](_0x4d374f);_0x1a7773[_0x632b('0x37')]=_[_0x632b('0x36')](_0x11b766[_0x632b('0x37')]);_0x1a7773[_0x632b('0x38')]=_[_0x632b('0x39')](_0x1a7773['model'],_0x1a7773['query']);_0x2a7998[_0x632b('0x3a')]=_['intersection'](_0x1a7773[_0x632b('0x35')],qs[_0x632b('0x3b')](_0x11b766[_0x632b('0x37')][_0x632b('0x3b')]));_0x2a7998[_0x632b('0x3a')]=_0x2a7998[_0x632b('0x3a')][_0x632b('0x3c')]?_0x2a7998[_0x632b('0x3a')]:_0x1a7773[_0x632b('0x35')];if(!_0x11b766[_0x632b('0x37')][_0x632b('0x3d')](_0x632b('0x3e'))){_0x2a7998[_0x632b('0x29')]=qs[_0x632b('0x29')](_0x11b766[_0x632b('0x37')][_0x632b('0x29')]);_0x2a7998[_0x632b('0x28')]=qs['offset'](_0x11b766['query']['offset']);}_0x2a7998['order']=qs['sort'](_0x11b766[_0x632b('0x37')]['sort']);_0x2a7998['where']=qs['filters'](_[_0x632b('0x3f')](_0x11b766[_0x632b('0x37')],_0x1a7773[_0x632b('0x38')]));if(_0x11b766[_0x632b('0x37')]['filter']){_0x2a7998[_0x632b('0x40')]=_[_0x632b('0x41')](_0x2a7998[_0x632b('0x40')],{'$or':_['map'](_0x4d374f,function(_0x15bb30){if(_0x15bb30[_0x632b('0x42')][_0x632b('0x43')]!==_0x632b('0x44')){var _0x269f18={};_0x269f18[_0x15bb30[_0x632b('0x45')]]={'$like':'%'+_0x11b766['query'][_0x632b('0x46')]+'%'};return _0x269f18;}})});}_0x2a7998=_[_0x632b('0x41')]({},_0x2a7998,_0x11b766[_0x632b('0x47')]);var _0x4f3248={'where':_0x2a7998['where']};return db['VtigerConfiguration'][_0x632b('0x27')](_0x4f3248)[_0x632b('0x1a')](function(_0x70ddc9){_0x300b60[_0x632b('0x27')]=_0x70ddc9;if(_0x11b766[_0x632b('0x37')][_0x632b('0x48')]){_0x2a7998['include']=[{'all':!![]}];}return db[_0x632b('0x49')][_0x632b('0x4a')](_0x2a7998);})[_0x632b('0x1a')](function(_0x19ac35){_0x300b60[_0x632b('0x4b')]=_0x19ac35;return _0x300b60;})[_0x632b('0x1a')](respondWithFilteredResult(_0x27bbf5,_0x2a7998))[_0x632b('0x22')](handleError(_0x27bbf5,null));};exports[_0x632b('0x4c')]=function(_0x53f7f3,_0x876a33){var _0x56f254={'raw':![],'where':{'id':_0x53f7f3['params']['id']}},_0x2a1f09={};_0x2a1f09[_0x632b('0x35')]=_[_0x632b('0x36')](db[_0x632b('0x49')][_0x632b('0x34')]);_0x2a1f09[_0x632b('0x37')]=_['keys'](_0x53f7f3[_0x632b('0x37')]);_0x2a1f09[_0x632b('0x38')]=_[_0x632b('0x39')](_0x2a1f09['model'],_0x2a1f09[_0x632b('0x37')]);_0x56f254[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x2a1f09[_0x632b('0x35')],qs[_0x632b('0x3b')](_0x53f7f3['query'][_0x632b('0x3b')]));_0x56f254['attributes']=_0x56f254[_0x632b('0x3a')][_0x632b('0x3c')]?_0x56f254[_0x632b('0x3a')]:_0x2a1f09[_0x632b('0x35')];if(_0x53f7f3[_0x632b('0x37')]['includeAll']){_0x56f254['include']=[{'all':!![]}];}_0x56f254=_[_0x632b('0x41')]({},_0x56f254,_0x53f7f3[_0x632b('0x47')]);return db[_0x632b('0x49')][_0x632b('0x4d')](_0x56f254)[_0x632b('0x1a')](handleEntityNotFound(_0x876a33,null))[_0x632b('0x1a')](respondWithResult(_0x876a33,null))['catch'](handleError(_0x876a33,null));};exports[_0x632b('0x4e')]=function(_0x1d35b2,_0x3ff81c){return db['VtigerConfiguration'][_0x632b('0x4e')](_0x1d35b2[_0x632b('0x4f')],{})[_0x632b('0x1a')](respondWithResult(_0x3ff81c,0xc9))[_0x632b('0x22')](handleError(_0x3ff81c,null));};exports['update']=function(_0xcd2435,_0x20890c){if(_0xcd2435[_0x632b('0x4f')]['id']){delete _0xcd2435[_0x632b('0x4f')]['id'];}return db[_0x632b('0x49')]['find']({'where':{'id':_0xcd2435[_0x632b('0x50')]['id']}})[_0x632b('0x1a')](handleEntityNotFound(_0x20890c,null))[_0x632b('0x1a')](saveUpdates(_0xcd2435[_0x632b('0x4f')],null))[_0x632b('0x1a')](respondWithResult(_0x20890c,null))['catch'](handleError(_0x20890c,null));};exports[_0x632b('0x2f')]=function(_0x240d78,_0xcc0a9b){return db[_0x632b('0x49')][_0x632b('0x4d')]({'where':{'id':_0x240d78[_0x632b('0x50')]['id']}})[_0x632b('0x1a')](handleEntityNotFound(_0xcc0a9b,null))[_0x632b('0x1a')](removeEntity(_0xcc0a9b,null))[_0x632b('0x22')](handleError(_0xcc0a9b,null));};exports[_0x632b('0x51')]=function(_0x3a7e13,_0x5ca000,_0x10f174){var _0x1d2edc={};var _0xe85c2f={};var _0x3532c7;var _0x2b767a;return db['VtigerConfiguration'][_0x632b('0x52')]({'where':{'id':_0x3a7e13[_0x632b('0x50')]['id']}})[_0x632b('0x1a')](handleEntityNotFound(_0x5ca000,null))[_0x632b('0x1a')](function(_0x387d76){if(_0x387d76){_0x3532c7=_0x387d76;_0xe85c2f[_0x632b('0x35')]=_[_0x632b('0x36')](db['VtigerField'][_0x632b('0x34')]);_0xe85c2f['query']=_[_0x632b('0x36')](_0x3a7e13['query']);_0xe85c2f[_0x632b('0x38')]=_['intersection'](_0xe85c2f[_0x632b('0x35')],_0xe85c2f[_0x632b('0x37')]);_0x1d2edc['attributes']=_['intersection'](_0xe85c2f[_0x632b('0x35')],qs[_0x632b('0x3b')](_0x3a7e13[_0x632b('0x37')][_0x632b('0x3b')]));_0x1d2edc['attributes']=_0x1d2edc[_0x632b('0x3a')][_0x632b('0x3c')]?_0x1d2edc['attributes']:_0xe85c2f[_0x632b('0x35')];_0x1d2edc['order']=qs[_0x632b('0x53')](_0x3a7e13[_0x632b('0x37')]['sort']);_0x1d2edc[_0x632b('0x40')]=qs[_0x632b('0x38')](_[_0x632b('0x3f')](_0x3a7e13[_0x632b('0x37')],_0xe85c2f['filters']));if(_0x3a7e13[_0x632b('0x37')][_0x632b('0x46')]){_0x1d2edc[_0x632b('0x40')]=_[_0x632b('0x41')](_0x1d2edc['where'],{'$or':_[_0x632b('0x54')](_0x1d2edc[_0x632b('0x3a')],function(_0x2b2e95){var _0x3fd888={};_0x3fd888[_0x2b2e95]={'$like':'%'+_0x3a7e13[_0x632b('0x37')][_0x632b('0x46')]+'%'};return _0x3fd888;})});}_0x1d2edc=_['merge']({},_0x1d2edc,_0x3a7e13[_0x632b('0x47')]);return _0x3532c7[_0x632b('0x51')](_0x1d2edc);}})[_0x632b('0x1a')](function(_0x5b0c6d){if(_0x5b0c6d){_0x2b767a=_0x5b0c6d['length'];if(!_0x3a7e13[_0x632b('0x37')][_0x632b('0x3d')](_0x632b('0x3e'))){_0x1d2edc[_0x632b('0x29')]=qs[_0x632b('0x29')](_0x3a7e13[_0x632b('0x37')][_0x632b('0x29')]);_0x1d2edc['offset']=qs[_0x632b('0x28')](_0x3a7e13[_0x632b('0x37')][_0x632b('0x28')]);}return _0x3532c7[_0x632b('0x51')](_0x1d2edc);}})[_0x632b('0x1a')](function(_0x4386ad){if(_0x4386ad){return _0x4386ad?{'count':_0x2b767a,'rows':_0x4386ad}:null;}})['then'](respondWithResult(_0x5ca000,null))[_0x632b('0x22')](handleError(_0x5ca000,null));};exports[_0x632b('0x55')]=function(_0x30d5ef,_0x14b55f,_0x51cb45){var _0x3a3f80={};var _0x45e3a5={};var _0x4a1c15;var _0x5530e8;return db[_0x632b('0x49')][_0x632b('0x52')]({'where':{'id':_0x30d5ef[_0x632b('0x50')]['id']}})[_0x632b('0x1a')](handleEntityNotFound(_0x14b55f,null))[_0x632b('0x1a')](function(_0x4599fc){if(_0x4599fc){_0x4a1c15=_0x4599fc;_0x45e3a5['model']=_[_0x632b('0x36')](db[_0x632b('0x56')]['rawAttributes']);_0x45e3a5['query']=_['keys'](_0x30d5ef[_0x632b('0x37')]);_0x45e3a5[_0x632b('0x38')]=_[_0x632b('0x39')](_0x45e3a5[_0x632b('0x35')],_0x45e3a5[_0x632b('0x37')]);_0x3a3f80['attributes']=_['intersection'](_0x45e3a5[_0x632b('0x35')],qs[_0x632b('0x3b')](_0x30d5ef['query']['fields']));_0x3a3f80[_0x632b('0x3a')]=_0x3a3f80[_0x632b('0x3a')]['length']?_0x3a3f80[_0x632b('0x3a')]:_0x45e3a5[_0x632b('0x35')];_0x3a3f80[_0x632b('0x57')]=qs['sort'](_0x30d5ef['query']['sort']);_0x3a3f80[_0x632b('0x40')]=qs[_0x632b('0x38')](_[_0x632b('0x3f')](_0x30d5ef['query'],_0x45e3a5['filters']));if(_0x30d5ef['query'][_0x632b('0x46')]){_0x3a3f80['where']=_[_0x632b('0x41')](_0x3a3f80[_0x632b('0x40')],{'$or':_[_0x632b('0x54')](_0x3a3f80[_0x632b('0x3a')],function(_0x68e129){var _0x19e479={};_0x19e479[_0x68e129]={'$like':'%'+_0x30d5ef[_0x632b('0x37')][_0x632b('0x46')]+'%'};return _0x19e479;})});}_0x3a3f80=_[_0x632b('0x41')]({},_0x3a3f80,_0x30d5ef[_0x632b('0x47')]);return _0x4a1c15['getSubjects'](_0x3a3f80);}})['then'](function(_0x270c08){if(_0x270c08){_0x5530e8=_0x270c08['length'];if(!_0x30d5ef[_0x632b('0x37')][_0x632b('0x3d')](_0x632b('0x3e'))){_0x3a3f80[_0x632b('0x29')]=qs['limit'](_0x30d5ef[_0x632b('0x37')]['limit']);_0x3a3f80['offset']=qs['offset'](_0x30d5ef[_0x632b('0x37')]['offset']);}return _0x4a1c15[_0x632b('0x55')](_0x3a3f80);}})[_0x632b('0x1a')](function(_0x48ccd3){if(_0x48ccd3){return _0x48ccd3?{'count':_0x5530e8,'rows':_0x48ccd3}:null;}})[_0x632b('0x1a')](respondWithResult(_0x14b55f,null))[_0x632b('0x22')](handleError(_0x14b55f,null));};exports['getDescriptions']=function(_0x47e2a6,_0x1c44dc,_0x210b8b){var _0x245b5b={};var _0xff7d0b={};var _0x40534a;var _0xcf1fba;return db[_0x632b('0x49')]['findOne']({'where':{'id':_0x47e2a6[_0x632b('0x50')]['id']}})[_0x632b('0x1a')](handleEntityNotFound(_0x1c44dc,null))['then'](function(_0x4c2a77){if(_0x4c2a77){_0x40534a=_0x4c2a77;_0xff7d0b[_0x632b('0x35')]=_['keys'](db['VtigerField'][_0x632b('0x34')]);_0xff7d0b['query']=_[_0x632b('0x36')](_0x47e2a6['query']);_0xff7d0b[_0x632b('0x38')]=_['intersection'](_0xff7d0b[_0x632b('0x35')],_0xff7d0b[_0x632b('0x37')]);_0x245b5b['attributes']=_[_0x632b('0x39')](_0xff7d0b[_0x632b('0x35')],qs[_0x632b('0x3b')](_0x47e2a6[_0x632b('0x37')][_0x632b('0x3b')]));_0x245b5b[_0x632b('0x3a')]=_0x245b5b[_0x632b('0x3a')][_0x632b('0x3c')]?_0x245b5b['attributes']:_0xff7d0b['model'];_0x245b5b[_0x632b('0x57')]=qs[_0x632b('0x53')](_0x47e2a6[_0x632b('0x37')][_0x632b('0x53')]);_0x245b5b[_0x632b('0x40')]=qs[_0x632b('0x38')](_['pick'](_0x47e2a6[_0x632b('0x37')],_0xff7d0b['filters']));if(_0x47e2a6[_0x632b('0x37')]['filter']){_0x245b5b[_0x632b('0x40')]=_[_0x632b('0x41')](_0x245b5b[_0x632b('0x40')],{'$or':_[_0x632b('0x54')](_0x245b5b['attributes'],function(_0x198fbd){var _0x3dcad7={};_0x3dcad7[_0x198fbd]={'$like':'%'+_0x47e2a6['query'][_0x632b('0x46')]+'%'};return _0x3dcad7;})});}_0x245b5b=_[_0x632b('0x41')]({},_0x245b5b,_0x47e2a6[_0x632b('0x47')]);return _0x40534a[_0x632b('0x58')](_0x245b5b);}})[_0x632b('0x1a')](function(_0x5a541a){if(_0x5a541a){_0xcf1fba=_0x5a541a[_0x632b('0x3c')];if(!_0x47e2a6[_0x632b('0x37')]['hasOwnProperty'](_0x632b('0x3e'))){_0x245b5b['limit']=qs[_0x632b('0x29')](_0x47e2a6['query'][_0x632b('0x29')]);_0x245b5b['offset']=qs[_0x632b('0x28')](_0x47e2a6[_0x632b('0x37')][_0x632b('0x28')]);}return _0x40534a[_0x632b('0x58')](_0x245b5b);}})[_0x632b('0x1a')](function(_0x5c01b5){if(_0x5c01b5){return _0x5c01b5?{'count':_0xcf1fba,'rows':_0x5c01b5}:null;}})[_0x632b('0x1a')](respondWithResult(_0x1c44dc,null))[_0x632b('0x22')](handleError(_0x1c44dc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ef2477f..a5bc62f 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 _0x5f61=['define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','bluebird','./intVtigerConfiguration.attributes','exports'];(function(_0x5486c9,_0x460410){var _0xe5d049=function(_0x145392){while(--_0x145392){_0x5486c9['push'](_0x5486c9['shift']());}};_0xe5d049(++_0x460410);}(_0x5f61,0x1b1));var _0x15f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f61[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x15f6('0x0'));var logger=require(_0x15f6('0x1'))(_0x15f6('0x2'));var moment=require(_0x15f6('0x3'));var BPromise=require(_0x15f6('0x4'));var rp=require('request-promise');var attributes=require(_0x15f6('0x5'));module[_0x15f6('0x6')]=function(_0x5be79c,_0x38da05){return _0x5be79c[_0x15f6('0x7')](_0x15f6('0x8'),attributes,{'tableName':_0x15f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aed=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0x8aed,0xcd));var _0xd8ae=function(_0x2c874f,_0x4ecf59){_0x2c874f=_0x2c874f-0x0;var _0x1a6266=_0x8aed[_0x2c874f];return _0x1a6266;};'use strict';var _=require(_0xd8ae('0x0'));var util=require(_0xd8ae('0x1'));var logger=require(_0xd8ae('0x2'))(_0xd8ae('0x3'));var moment=require(_0xd8ae('0x4'));var BPromise=require(_0xd8ae('0x5'));var rp=require(_0xd8ae('0x6'));var attributes=require(_0xd8ae('0x7'));module[_0xd8ae('0x8')]=function(_0x482f08,_0x23dc33){return _0x482f08[_0xd8ae('0x9')](_0xd8ae('0xa'),attributes,{'tableName':_0xd8ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index a167867..3da88e0 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 _0x54b0=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x54b0,0x129));var _0x054b=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x54b0[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require(_0x054b('0x0'));var util=require(_0x054b('0x1'));var moment=require(_0x054b('0x2'));var BPromise=require(_0x054b('0x3'));var rs=require(_0x054b('0x4'));var fs=require('fs');var Redis=require(_0x054b('0x5'));var db=require(_0x054b('0x6'))['db'];var utils=require(_0x054b('0x7'));var logger=require(_0x054b('0x8'))('rpc');var config=require(_0x054b('0x9'));var jayson=require(_0x054b('0xa'));var client=jayson[_0x054b('0xb')][_0x054b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5df066,_0x39e16b,_0x59f9ee){return new BPromise(function(_0x625a65,_0x24ea98){return client[_0x054b('0xd')](_0x5df066,_0x59f9ee)['then'](function(_0x655204){logger[_0x054b('0xe')](_0x054b('0xf'),_0x39e16b,_0x054b('0x10'));logger[_0x054b('0x11')](_0x054b('0x12'),_0x39e16b,'request\x20sent',JSON[_0x054b('0x13')](_0x655204));if(_0x655204[_0x054b('0x14')]){if(_0x655204[_0x054b('0x14')][_0x054b('0x15')]===0x1f4){logger[_0x054b('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x39e16b,_0x655204[_0x054b('0x14')]['message']);return _0x24ea98(_0x655204[_0x054b('0x14')][_0x054b('0x16')]);}logger[_0x054b('0x14')](_0x054b('0xf'),_0x39e16b,_0x655204[_0x054b('0x14')][_0x054b('0x16')]);return _0x625a65(_0x655204[_0x054b('0x14')][_0x054b('0x16')]);}else{logger[_0x054b('0xe')](_0x054b('0xf'),_0x39e16b,_0x054b('0x10'));_0x625a65(_0x655204[_0x054b('0x17')]['message']);}})['catch'](function(_0x5574b7){logger[_0x054b('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x39e16b,_0x5574b7);_0x24ea98(_0x5574b7);});});} \ No newline at end of file +var _0x26a1=['request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x37b93a,_0x469f5f){var _0x182bfb=function(_0x294310){while(--_0x294310){_0x37b93a['push'](_0x37b93a['shift']());}};_0x182bfb(++_0x469f5f);}(_0x26a1,0xbb));var _0x126a=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x26a1[_0x166742];return _0xb7814a;};'use strict';var _=require(_0x126a('0x0'));var util=require(_0x126a('0x1'));var moment=require(_0x126a('0x2'));var BPromise=require(_0x126a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x126a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x126a('0x5'));var logger=require(_0x126a('0x6'))(_0x126a('0x7'));var config=require(_0x126a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x126a('0x9')][_0x126a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1cc8,_0x1f6fda,_0x23ec72){return new BPromise(function(_0x5aa9f4,_0x2ac3c3){return client[_0x126a('0xb')](_0x5c1cc8,_0x23ec72)[_0x126a('0xc')](function(_0x23646e){logger[_0x126a('0xd')](_0x126a('0xe'),_0x1f6fda,_0x126a('0xf'));logger[_0x126a('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1f6fda,_0x126a('0xf'),JSON[_0x126a('0x11')](_0x23646e));if(_0x23646e['error']){if(_0x23646e[_0x126a('0x12')]['code']===0x1f4){logger[_0x126a('0x12')](_0x126a('0xe'),_0x1f6fda,_0x23646e['error'][_0x126a('0x13')]);return _0x2ac3c3(_0x23646e[_0x126a('0x12')][_0x126a('0x13')]);}logger['error'](_0x126a('0xe'),_0x1f6fda,_0x23646e['error'][_0x126a('0x13')]);return _0x5aa9f4(_0x23646e[_0x126a('0x12')][_0x126a('0x13')]);}else{logger[_0x126a('0xd')](_0x126a('0xe'),_0x1f6fda,_0x126a('0xf'));_0x5aa9f4(_0x23646e[_0x126a('0x14')]['message']);}})[_0x126a('0x15')](function(_0x5189d3){logger[_0x126a('0x12')](_0x126a('0xe'),_0x1f6fda,_0x5189d3);_0x2ac3c3(_0x5189d3);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6d6c3c5..d68be3e 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 _0xfec1=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','put'];(function(_0x4c2c40,_0x337dcd){var _0xa1e0ac=function(_0x28d215){while(--_0x28d215){_0x4c2c40['push'](_0x4c2c40['shift']());}};_0xa1e0ac(++_0x337dcd);}(_0xfec1,0x82));var _0x1fec=function(_0xf4e030,_0x131199){_0xf4e030=_0xf4e030-0x0;var _0x30f392=_0xfec1[_0xf4e030];return _0x30f392;};'use strict';var multer=require(_0x1fec('0x0'));var util=require(_0x1fec('0x1'));var path=require(_0x1fec('0x2'));var timeout=require('connect-timeout');var express=require(_0x1fec('0x3'));var router=express[_0x1fec('0x4')]();var auth=require(_0x1fec('0x5'));var interaction=require(_0x1fec('0x6'));var config=require(_0x1fec('0x7'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x1fec('0x8')](),controller[_0x1fec('0x9')]);router['get'](_0x1fec('0xa'),auth[_0x1fec('0x8')](),controller[_0x1fec('0xb')]);router[_0x1fec('0xc')]('/',auth[_0x1fec('0x8')](),controller['create']);router[_0x1fec('0xd')]('/:id',auth[_0x1fec('0x8')](),controller[_0x1fec('0xe')]);router[_0x1fec('0xf')]('/:id',auth[_0x1fec('0x8')](),controller[_0x1fec('0x10')]);module[_0x1fec('0x11')]=router; \ No newline at end of file +var _0x1bd7=['destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','put','/:id','update','delete'];(function(_0x1f094d,_0x3556ba){var _0x53d802=function(_0x46b02f){while(--_0x46b02f){_0x1f094d['push'](_0x1f094d['shift']());}};_0x53d802(++_0x3556ba);}(_0x1bd7,0x197));var _0x71bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1bd7[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x71bd('0x0'));var path=require(_0x71bd('0x1'));var timeout=require('connect-timeout');var express=require(_0x71bd('0x2'));var router=express['Router']();var auth=require(_0x71bd('0x3'));var interaction=require(_0x71bd('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x71bd('0x5')]('/',auth[_0x71bd('0x6')](),controller[_0x71bd('0x7')]);router['get']('/:id',auth[_0x71bd('0x6')](),controller[_0x71bd('0x8')]);router['post']('/',auth[_0x71bd('0x6')](),controller['create']);router[_0x71bd('0x9')](_0x71bd('0xa'),auth[_0x71bd('0x6')](),controller[_0x71bd('0xb')]);router[_0x71bd('0xc')](_0x71bd('0xa'),auth['isAuthenticated'](),controller[_0x71bd('0xd')]);module[_0x71bd('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e12ada3..a5d88ec 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 _0xaa88=['exports','ENUM','string','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x3966cb,_0x1d59c9){var _0x123bc4=function(_0x318114){while(--_0x318114){_0x3966cb['push'](_0x3966cb['shift']());}};_0x123bc4(++_0x1d59c9);}(_0xaa88,0x137));var _0x8aa8=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xaa88[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'type':{'type':Sequelize[_0x8aa8('0x2')](_0x8aa8('0x3'),'variable',_0x8aa8('0x4'),_0x8aa8('0x5')),'defaultValue':_0x8aa8('0x3')},'content':{'type':Sequelize[_0x8aa8('0x6')]},'key':{'type':Sequelize[_0x8aa8('0x6')]},'keyType':{'type':Sequelize[_0x8aa8('0x2')]('string','variable',_0x8aa8('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8aa8('0x6')]},'nameField':{'type':Sequelize[_0x8aa8('0x6')]},'customField':{'type':Sequelize[_0x8aa8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8aa8('0x6')]}}; \ No newline at end of file +var _0x70e0=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','string','STRING','variable'];(function(_0x39513a,_0x4997cd){var _0x40a62f=function(_0x13bb05){while(--_0x13bb05){_0x39513a['push'](_0x39513a['shift']());}};_0x40a62f(++_0x4997cd);}(_0x70e0,0x17b));var _0x070e=function(_0x52e48a,_0x393718){_0x52e48a=_0x52e48a-0x0;var _0x29908f=_0x70e0[_0x52e48a];return _0x29908f;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'type':{'type':Sequelize[_0x070e('0x2')]('string','variable',_0x070e('0x3'),_0x070e('0x4')),'defaultValue':_0x070e('0x5')},'content':{'type':Sequelize[_0x070e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x070e('0x2')]('string',_0x070e('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x070e('0x6')]},'customField':{'type':Sequelize[_0x070e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 4744160..ff82823 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 _0x5de0=['moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VtigerField','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filters','merge','map','type','key','VIRTUAL','field','count','includeAll','rows','show','params','rawAttributes','length','include','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x5de0,0xd5));var _0x05de=function(_0x1a15bb,_0x94fc5){_0x1a15bb=_0x1a15bb-0x0;var _0x2def09=_0x5de0[_0x1a15bb];return _0x2def09;};'use strict';var pdf=require(_0x05de('0x0'));var emlformat=require(_0x05de('0x1'));var rimraf=require(_0x05de('0x2'));var zipdir=require(_0x05de('0x3'));var jsonpatch=require(_0x05de('0x4'));var rp=require(_0x05de('0x5'));var moment=require(_0x05de('0x6'));var BPromise=require(_0x05de('0x7'));var Mustache=require(_0x05de('0x8'));var util=require(_0x05de('0x9'));var path=require('path');var sox=require(_0x05de('0xa'));var csv=require('to-csv');var ejs=require(_0x05de('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x05de('0xc'));var crypto=require(_0x05de('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x05de('0xe'));var toCsv=require(_0x05de('0xf'));var querystring=require('querystring');var Papa=require(_0x05de('0x10'));var authService=require(_0x05de('0x11'));var hardwareService=require(_0x05de('0x12'));var Redis=require('ioredis');var qs=require(_0x05de('0x13'));var logger=require(_0x05de('0x14'))(_0x05de('0x15'));var utils=require(_0x05de('0x16'));var config=require(_0x05de('0x17'));var db=require(_0x05de('0x18'))['db'];function respondWithStatusCode(_0x5d8c45,_0x3214eb){_0x3214eb=_0x3214eb||0xcc;return function(_0x96a9bf){if(_0x96a9bf){return _0x5d8c45['sendStatus'](_0x3214eb);}return _0x5d8c45[_0x05de('0x19')](_0x3214eb)[_0x05de('0x1a')]();};}function respondWithResult(_0x9647a5,_0x560e45){_0x560e45=_0x560e45||0xc8;return function(_0x5602cd){if(_0x5602cd){return _0x9647a5[_0x05de('0x19')](_0x560e45)[_0x05de('0x1b')](_0x5602cd);}};}function respondWithFilteredResult(_0x56ecc4,_0x55107e){return function(_0x252b28){if(_0x252b28){var _0x1240d1=_0x252b28['count'],_0x5413cb=_0x55107e['offset'],_0x2ea4c1=_0x55107e[_0x05de('0x1c')]+_0x55107e['limit'],_0x5d07d9;if(_0x2ea4c1>=_0x1240d1){_0x2ea4c1=_0x1240d1;_0x5d07d9=0xc8;}else{_0x5d07d9=0xce;}_0x56ecc4[_0x05de('0x19')](_0x5d07d9);return _0x56ecc4[_0x05de('0x1d')](_0x05de('0x1e'),_0x5413cb+'-'+_0x2ea4c1+'/'+_0x1240d1)[_0x05de('0x1b')](_0x252b28);}return null;};}function patchUpdates(_0x311801){return function(_0x1230f6){try{jsonpatch[_0x05de('0x1f')](_0x1230f6,_0x311801,!![]);}catch(_0x317af6){return BPromise[_0x05de('0x20')](_0x317af6);}return _0x1230f6[_0x05de('0x21')]();};}function saveUpdates(_0xc70bd1,_0x1aa26c){return function(_0x5634cf){if(_0x5634cf){return _0x5634cf[_0x05de('0x22')](_0xc70bd1)[_0x05de('0x23')](function(_0x130d4f){return _0x130d4f;});}return null;};}function removeEntity(_0x940133,_0x4ab4b6){return function(_0x3680e9){if(_0x3680e9){return _0x3680e9[_0x05de('0x24')]()['then'](function(){_0x940133[_0x05de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd18aa,_0x16916d){return function(_0x494598){if(!_0x494598){_0xcd18aa['sendStatus'](0x194);}return _0x494598;};}function handleError(_0x432076,_0x5cdb9c){_0x5cdb9c=_0x5cdb9c||0x1f4;return function(_0x3f1c41){logger[_0x05de('0x25')](_0x3f1c41['stack']);if(_0x3f1c41['name']){delete _0x3f1c41[_0x05de('0x26')];}_0x432076['status'](_0x5cdb9c)[_0x05de('0x27')](_0x3f1c41);};}exports[_0x05de('0x28')]=function(_0xd1b960,_0x3da417){var _0x267994={},_0x426ffb={},_0x5a329c={'count':0x0,'rows':[]};var _0x177914=db[_0x05de('0x29')]['rawAttributes'];_0x426ffb[_0x05de('0x2a')]=_[_0x05de('0x2b')](_0x177914);_0x426ffb['query']=_[_0x05de('0x2b')](_0xd1b960[_0x05de('0x2c')]);_0x426ffb['filters']=_[_0x05de('0x2d')](_0x426ffb[_0x05de('0x2a')],_0x426ffb[_0x05de('0x2c')]);_0x267994[_0x05de('0x2e')]=_[_0x05de('0x2d')](_0x426ffb[_0x05de('0x2a')],qs[_0x05de('0x2f')](_0xd1b960[_0x05de('0x2c')]['fields']));_0x267994[_0x05de('0x2e')]=_0x267994[_0x05de('0x2e')]['length']?_0x267994[_0x05de('0x2e')]:_0x426ffb['model'];if(!_0xd1b960[_0x05de('0x2c')]['hasOwnProperty'](_0x05de('0x30'))){_0x267994[_0x05de('0x31')]=qs[_0x05de('0x31')](_0xd1b960[_0x05de('0x2c')][_0x05de('0x31')]);_0x267994[_0x05de('0x1c')]=qs['offset'](_0xd1b960[_0x05de('0x2c')][_0x05de('0x1c')]);}_0x267994[_0x05de('0x32')]=qs[_0x05de('0x33')](_0xd1b960[_0x05de('0x2c')]['sort']);_0x267994[_0x05de('0x34')]=qs['filters'](_[_0x05de('0x35')](_0xd1b960[_0x05de('0x2c')],_0x426ffb[_0x05de('0x36')]));if(_0xd1b960[_0x05de('0x2c')]['filter']){_0x267994[_0x05de('0x34')]=_[_0x05de('0x37')](_0x267994['where'],{'$or':_[_0x05de('0x38')](_0x177914,function(_0x14a5f0){if(_0x14a5f0[_0x05de('0x39')][_0x05de('0x3a')]!==_0x05de('0x3b')){var _0x3f6e9c={};_0x3f6e9c[_0x14a5f0[_0x05de('0x3c')]]={'$like':'%'+_0xd1b960[_0x05de('0x2c')]['filter']+'%'};return _0x3f6e9c;}})});}_0x267994=_[_0x05de('0x37')]({},_0x267994,_0xd1b960['options']);var _0xc6d71d={'where':_0x267994['where']};return db['VtigerField'][_0x05de('0x3d')](_0xc6d71d)['then'](function(_0x3324bc){_0x5a329c['count']=_0x3324bc;if(_0xd1b960['query'][_0x05de('0x3e')]){_0x267994['include']=[{'all':!![]}];}return db[_0x05de('0x29')]['findAll'](_0x267994);})['then'](function(_0xdb6415){_0x5a329c[_0x05de('0x3f')]=_0xdb6415;return _0x5a329c;})['then'](respondWithFilteredResult(_0x3da417,_0x267994))['catch'](handleError(_0x3da417,null));};exports[_0x05de('0x40')]=function(_0x34c57a,_0xa3033c){var _0x5d48e5={'raw':!![],'where':{'id':_0x34c57a[_0x05de('0x41')]['id']}},_0x43698d={};_0x43698d[_0x05de('0x2a')]=_['keys'](db['VtigerField'][_0x05de('0x42')]);_0x43698d[_0x05de('0x2c')]=_[_0x05de('0x2b')](_0x34c57a[_0x05de('0x2c')]);_0x43698d[_0x05de('0x36')]=_[_0x05de('0x2d')](_0x43698d['model'],_0x43698d[_0x05de('0x2c')]);_0x5d48e5[_0x05de('0x2e')]=_[_0x05de('0x2d')](_0x43698d[_0x05de('0x2a')],qs[_0x05de('0x2f')](_0x34c57a['query']['fields']));_0x5d48e5[_0x05de('0x2e')]=_0x5d48e5[_0x05de('0x2e')][_0x05de('0x43')]?_0x5d48e5[_0x05de('0x2e')]:_0x43698d['model'];if(_0x34c57a['query']['includeAll']){_0x5d48e5[_0x05de('0x44')]=[{'all':!![]}];}_0x5d48e5=_[_0x05de('0x37')]({},_0x5d48e5,_0x34c57a['options']);return db['VtigerField'][_0x05de('0x45')](_0x5d48e5)[_0x05de('0x23')](handleEntityNotFound(_0xa3033c,null))[_0x05de('0x23')](respondWithResult(_0xa3033c,null))[_0x05de('0x46')](handleError(_0xa3033c,null));};exports[_0x05de('0x47')]=function(_0x224e60,_0x80c62f){return db[_0x05de('0x29')][_0x05de('0x47')](_0x224e60[_0x05de('0x48')],{})['then'](respondWithResult(_0x80c62f,0xc9))['catch'](handleError(_0x80c62f,null));};exports[_0x05de('0x22')]=function(_0x13901c,_0x3ae5b6){if(_0x13901c[_0x05de('0x48')]['id']){delete _0x13901c[_0x05de('0x48')]['id'];}return db['VtigerField'][_0x05de('0x45')]({'where':{'id':_0x13901c[_0x05de('0x41')]['id']}})[_0x05de('0x23')](handleEntityNotFound(_0x3ae5b6,null))[_0x05de('0x23')](saveUpdates(_0x13901c[_0x05de('0x48')],null))[_0x05de('0x23')](respondWithResult(_0x3ae5b6,null))[_0x05de('0x46')](handleError(_0x3ae5b6,null));};exports[_0x05de('0x24')]=function(_0x391fd3,_0x69ead7){return db[_0x05de('0x29')]['find']({'where':{'id':_0x391fd3[_0x05de('0x41')]['id']}})[_0x05de('0x23')](handleEntityNotFound(_0x69ead7,null))['then'](removeEntity(_0x69ead7,null))[_0x05de('0x46')](handleError(_0x69ead7,null));}; \ No newline at end of file +var _0x185f=['rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','include','rows','catch','show','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','index','VtigerField'];(function(_0x50b8e6,_0x5b98ae){var _0x5109b5=function(_0xe03046){while(--_0xe03046){_0x50b8e6['push'](_0x50b8e6['shift']());}};_0x5109b5(++_0x5b98ae);}(_0x185f,0x1a4));var _0xf185=function(_0x355232,_0x559f4e){_0x355232=_0x355232-0x0;var _0x5eb8d0=_0x185f[_0x355232];return _0x5eb8d0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf185('0x0'));var jsonpatch=require(_0xf185('0x1'));var rp=require(_0xf185('0x2'));var moment=require(_0xf185('0x3'));var BPromise=require(_0xf185('0x4'));var Mustache=require('mustache');var util=require(_0xf185('0x5'));var path=require(_0xf185('0x6'));var sox=require(_0xf185('0x7'));var csv=require(_0xf185('0x8'));var ejs=require(_0xf185('0x9'));var fs=require('fs');var _=require(_0xf185('0xa'));var squel=require('squel');var crypto=require(_0xf185('0xb'));var jsforce=require(_0xf185('0xc'));var deskjs=require(_0xf185('0xd'));var toCsv=require(_0xf185('0x8'));var querystring=require(_0xf185('0xe'));var Papa=require('papaparse');var authService=require(_0xf185('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xf185('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xf185('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf185('0x12'));var db=require(_0xf185('0x13'))['db'];function respondWithStatusCode(_0x3e239f,_0x2d81e1){_0x2d81e1=_0x2d81e1||0xcc;return function(_0x13f9f8){if(_0x13f9f8){return _0x3e239f[_0xf185('0x14')](_0x2d81e1);}return _0x3e239f[_0xf185('0x15')](_0x2d81e1)[_0xf185('0x16')]();};}function respondWithResult(_0x18a315,_0x2d0c21){_0x2d0c21=_0x2d0c21||0xc8;return function(_0x3da81d){if(_0x3da81d){return _0x18a315[_0xf185('0x15')](_0x2d0c21)['json'](_0x3da81d);}};}function respondWithFilteredResult(_0x1f5463,_0x16804e){return function(_0x219ba4){if(_0x219ba4){var _0x58b0d3=_0x219ba4[_0xf185('0x17')],_0x32ad01=_0x16804e[_0xf185('0x18')],_0x25b673=_0x16804e[_0xf185('0x18')]+_0x16804e['limit'],_0x474236;if(_0x25b673>=_0x58b0d3){_0x25b673=_0x58b0d3;_0x474236=0xc8;}else{_0x474236=0xce;}_0x1f5463['status'](_0x474236);return _0x1f5463[_0xf185('0x19')](_0xf185('0x1a'),_0x32ad01+'-'+_0x25b673+'/'+_0x58b0d3)['json'](_0x219ba4);}return null;};}function patchUpdates(_0x52e9a5){return function(_0x158332){try{jsonpatch[_0xf185('0x1b')](_0x158332,_0x52e9a5,!![]);}catch(_0x250b5b){return BPromise[_0xf185('0x1c')](_0x250b5b);}return _0x158332['save']();};}function saveUpdates(_0x462f34,_0x25162c){return function(_0x90b724){if(_0x90b724){return _0x90b724[_0xf185('0x1d')](_0x462f34)[_0xf185('0x1e')](function(_0x1a5eef){return _0x1a5eef;});}return null;};}function removeEntity(_0x1ef393,_0x16607f){return function(_0x1102d6){if(_0x1102d6){return _0x1102d6[_0xf185('0x1f')]()[_0xf185('0x1e')](function(){_0x1ef393['status'](0xcc)[_0xf185('0x16')]();});}};}function handleEntityNotFound(_0x20a873,_0x5a1149){return function(_0xa5de87){if(!_0xa5de87){_0x20a873[_0xf185('0x14')](0x194);}return _0xa5de87;};}function handleError(_0x2743a4,_0xa153a6){_0xa153a6=_0xa153a6||0x1f4;return function(_0x50ec77){logger[_0xf185('0x20')](_0x50ec77['stack']);if(_0x50ec77['name']){delete _0x50ec77['name'];}_0x2743a4[_0xf185('0x15')](_0xa153a6)['send'](_0x50ec77);};}exports[_0xf185('0x21')]=function(_0x506ed5,_0x44ae58){var _0x5d58dd={},_0x21e7fc={},_0x3bd7f0={'count':0x0,'rows':[]};var _0x364984=db[_0xf185('0x22')][_0xf185('0x23')];_0x21e7fc[_0xf185('0x24')]=_['keys'](_0x364984);_0x21e7fc[_0xf185('0x25')]=_[_0xf185('0x26')](_0x506ed5[_0xf185('0x25')]);_0x21e7fc['filters']=_['intersection'](_0x21e7fc['model'],_0x21e7fc[_0xf185('0x25')]);_0x5d58dd[_0xf185('0x27')]=_['intersection'](_0x21e7fc[_0xf185('0x24')],qs[_0xf185('0x28')](_0x506ed5[_0xf185('0x25')][_0xf185('0x28')]));_0x5d58dd[_0xf185('0x27')]=_0x5d58dd[_0xf185('0x27')][_0xf185('0x29')]?_0x5d58dd['attributes']:_0x21e7fc[_0xf185('0x24')];if(!_0x506ed5[_0xf185('0x25')][_0xf185('0x2a')](_0xf185('0x2b'))){_0x5d58dd[_0xf185('0x2c')]=qs[_0xf185('0x2c')](_0x506ed5[_0xf185('0x25')][_0xf185('0x2c')]);_0x5d58dd['offset']=qs[_0xf185('0x18')](_0x506ed5[_0xf185('0x25')][_0xf185('0x18')]);}_0x5d58dd['order']=qs[_0xf185('0x2d')](_0x506ed5['query']['sort']);_0x5d58dd[_0xf185('0x2e')]=qs[_0xf185('0x2f')](_[_0xf185('0x30')](_0x506ed5[_0xf185('0x25')],_0x21e7fc[_0xf185('0x2f')]));if(_0x506ed5[_0xf185('0x25')][_0xf185('0x31')]){_0x5d58dd[_0xf185('0x2e')]=_[_0xf185('0x32')](_0x5d58dd[_0xf185('0x2e')],{'$or':_[_0xf185('0x33')](_0x364984,function(_0x3e1b12){if(_0x3e1b12[_0xf185('0x34')][_0xf185('0x35')]!==_0xf185('0x36')){var _0x586a00={};_0x586a00[_0x3e1b12[_0xf185('0x37')]]={'$like':'%'+_0x506ed5['query'][_0xf185('0x31')]+'%'};return _0x586a00;}})});}_0x5d58dd=_[_0xf185('0x32')]({},_0x5d58dd,_0x506ed5['options']);var _0x31ba55={'where':_0x5d58dd[_0xf185('0x2e')]};return db['VtigerField'][_0xf185('0x17')](_0x31ba55)[_0xf185('0x1e')](function(_0x1ef3f9){_0x3bd7f0[_0xf185('0x17')]=_0x1ef3f9;if(_0x506ed5[_0xf185('0x25')]['includeAll']){_0x5d58dd[_0xf185('0x38')]=[{'all':!![]}];}return db[_0xf185('0x22')]['findAll'](_0x5d58dd);})[_0xf185('0x1e')](function(_0x18d4f2){_0x3bd7f0[_0xf185('0x39')]=_0x18d4f2;return _0x3bd7f0;})['then'](respondWithFilteredResult(_0x44ae58,_0x5d58dd))[_0xf185('0x3a')](handleError(_0x44ae58,null));};exports[_0xf185('0x3b')]=function(_0x1756c6,_0x3ff9da){var _0x5849a0={'raw':!![],'where':{'id':_0x1756c6['params']['id']}},_0x3f3616={};_0x3f3616[_0xf185('0x24')]=_['keys'](db[_0xf185('0x22')][_0xf185('0x23')]);_0x3f3616[_0xf185('0x25')]=_['keys'](_0x1756c6[_0xf185('0x25')]);_0x3f3616[_0xf185('0x2f')]=_['intersection'](_0x3f3616[_0xf185('0x24')],_0x3f3616['query']);_0x5849a0['attributes']=_['intersection'](_0x3f3616['model'],qs[_0xf185('0x28')](_0x1756c6[_0xf185('0x25')][_0xf185('0x28')]));_0x5849a0[_0xf185('0x27')]=_0x5849a0[_0xf185('0x27')][_0xf185('0x29')]?_0x5849a0['attributes']:_0x3f3616[_0xf185('0x24')];if(_0x1756c6[_0xf185('0x25')]['includeAll']){_0x5849a0[_0xf185('0x38')]=[{'all':!![]}];}_0x5849a0=_[_0xf185('0x32')]({},_0x5849a0,_0x1756c6[_0xf185('0x3c')]);return db[_0xf185('0x22')][_0xf185('0x3d')](_0x5849a0)[_0xf185('0x1e')](handleEntityNotFound(_0x3ff9da,null))[_0xf185('0x1e')](respondWithResult(_0x3ff9da,null))['catch'](handleError(_0x3ff9da,null));};exports[_0xf185('0x3e')]=function(_0x4c593a,_0xc687fe){return db['VtigerField'][_0xf185('0x3e')](_0x4c593a[_0xf185('0x3f')],{})['then'](respondWithResult(_0xc687fe,0xc9))[_0xf185('0x3a')](handleError(_0xc687fe,null));};exports['update']=function(_0x33d768,_0x63e6e){if(_0x33d768[_0xf185('0x3f')]['id']){delete _0x33d768[_0xf185('0x3f')]['id'];}return db[_0xf185('0x22')]['find']({'where':{'id':_0x33d768[_0xf185('0x40')]['id']}})[_0xf185('0x1e')](handleEntityNotFound(_0x63e6e,null))['then'](saveUpdates(_0x33d768[_0xf185('0x3f')],null))['then'](respondWithResult(_0x63e6e,null))['catch'](handleError(_0x63e6e,null));};exports[_0xf185('0x1f')]=function(_0x368ce9,_0x2f65b4){return db['VtigerField'][_0xf185('0x3d')]({'where':{'id':_0x368ce9[_0xf185('0x40')]['id']}})[_0xf185('0x1e')](handleEntityNotFound(_0x2f65b4,null))[_0xf185('0x1e')](removeEntity(_0x2f65b4,null))[_0xf185('0x3a')](handleError(_0x2f65b4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 24d44ba..899d90c 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 _0x279f=['moment','bluebird','int_vtiger_fields','vtiger_unique_index','idField','api'];(function(_0x19a0d1,_0x649d2d){var _0x46cc35=function(_0x156638){while(--_0x156638){_0x19a0d1['push'](_0x19a0d1['shift']());}};_0x46cc35(++_0x649d2d);}(_0x279f,0x167));var _0xf279=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x279f[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf279('0x0'));var moment=require(_0xf279('0x1'));var BPromise=require(_0xf279('0x2'));var rp=require('request-promise');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x5508e9,_0x44c9b5){return _0x5508e9['define']('VtigerField',attributes,{'tableName':_0xf279('0x3'),'paranoid':![],'indexes':[{'name':_0xf279('0x4'),'fields':[_0xf279('0x5'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5762=['int_vtiger_fields','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','exports','define','VtigerField'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x5762,0x158));var _0x2576=function(_0x154c0e,_0x1390ca){_0x154c0e=_0x154c0e-0x0;var _0x2e57fe=_0x5762[_0x154c0e];return _0x2e57fe;};'use strict';var _=require(_0x2576('0x0'));var util=require('util');var logger=require(_0x2576('0x1'))('api');var moment=require(_0x2576('0x2'));var BPromise=require(_0x2576('0x3'));var rp=require(_0x2576('0x4'));var attributes=require('./intVtigerField.attributes');module[_0x2576('0x5')]=function(_0x151860,_0x258c54){return _0x151860[_0x2576('0x6')](_0x2576('0x7'),attributes,{'tableName':_0x2576('0x8'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x2576('0x9'),_0x2576('0xa')],'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 23a5048..c40ef81 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 _0x7cf3=['jayson/promise','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x135edc,_0x22f968){var _0x15f00d=function(_0x164403){while(--_0x164403){_0x135edc['push'](_0x135edc['shift']());}};_0x15f00d(++_0x22f968);}(_0x7cf3,0x1e0));var _0x37cf=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x7cf3[_0x479160];return _0x47ac6d;};'use strict';var _=require('lodash');var util=require(_0x37cf('0x0'));var moment=require('moment');var BPromise=require(_0x37cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37cf('0x2'));var db=require(_0x37cf('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x37cf('0x4'));var config=require(_0x37cf('0x5'));var jayson=require(_0x37cf('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfb9bec,_0x134ae4,_0x2ca642){return new BPromise(function(_0x3a44d6,_0x2ab48f){return client[_0x37cf('0x7')](_0xfb9bec,_0x2ca642)[_0x37cf('0x8')](function(_0x5a5d92){logger[_0x37cf('0x9')](_0x37cf('0xa'),_0x134ae4,_0x37cf('0xb'));logger['debug'](_0x37cf('0xc'),_0x134ae4,'request\x20sent',JSON[_0x37cf('0xd')](_0x5a5d92));if(_0x5a5d92['error']){if(_0x5a5d92[_0x37cf('0xe')][_0x37cf('0xf')]===0x1f4){logger[_0x37cf('0xe')]('VtigerField,\x20%s,\x20%s',_0x134ae4,_0x5a5d92[_0x37cf('0xe')][_0x37cf('0x10')]);return _0x2ab48f(_0x5a5d92[_0x37cf('0xe')]['message']);}logger[_0x37cf('0xe')](_0x37cf('0xa'),_0x134ae4,_0x5a5d92[_0x37cf('0xe')]['message']);return _0x3a44d6(_0x5a5d92[_0x37cf('0xe')][_0x37cf('0x10')]);}else{logger[_0x37cf('0x9')]('VtigerField,\x20%s,\x20%s',_0x134ae4,'request\x20sent');_0x3a44d6(_0x5a5d92['result'][_0x37cf('0x10')]);}})[_0x37cf('0x11')](function(_0x44e64b){logger[_0x37cf('0xe')](_0x37cf('0xa'),_0x134ae4,_0x44e64b);_0x2ab48f(_0x44e64b);});});} \ No newline at end of file +var _0x3c5c=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3c5c,0x145));var _0xc3c5=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3c5c[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xc3c5('0x0'));var util=require(_0xc3c5('0x1'));var moment=require(_0xc3c5('0x2'));var BPromise=require(_0xc3c5('0x3'));var rs=require(_0xc3c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3c5('0x5'))['db'];var utils=require(_0xc3c5('0x6'));var logger=require(_0xc3c5('0x7'))('rpc');var config=require(_0xc3c5('0x8'));var jayson=require(_0xc3c5('0x9'));var client=jayson[_0xc3c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59c001,_0x1d799b,_0x58262a){return new BPromise(function(_0xfc5405,_0x544b8b){return client[_0xc3c5('0xb')](_0x59c001,_0x58262a)[_0xc3c5('0xc')](function(_0x17ca32){logger['info'](_0xc3c5('0xd'),_0x1d799b,_0xc3c5('0xe'));logger[_0xc3c5('0xf')](_0xc3c5('0x10'),_0x1d799b,_0xc3c5('0xe'),JSON['stringify'](_0x17ca32));if(_0x17ca32[_0xc3c5('0x11')]){if(_0x17ca32[_0xc3c5('0x11')]['code']===0x1f4){logger['error'](_0xc3c5('0xd'),_0x1d799b,_0x17ca32[_0xc3c5('0x11')]['message']);return _0x544b8b(_0x17ca32[_0xc3c5('0x11')][_0xc3c5('0x12')]);}logger[_0xc3c5('0x11')](_0xc3c5('0xd'),_0x1d799b,_0x17ca32[_0xc3c5('0x11')][_0xc3c5('0x12')]);return _0xfc5405(_0x17ca32['error'][_0xc3c5('0x12')]);}else{logger[_0xc3c5('0x13')]('VtigerField,\x20%s,\x20%s',_0x1d799b,_0xc3c5('0xe'));_0xfc5405(_0x17ca32[_0xc3c5('0x14')]['message']);}})[_0xc3c5('0x15')](function(_0xc2a42e){logger[_0xc3c5('0x11')](_0xc3c5('0xd'),_0x1d799b,_0xc2a42e);_0x544b8b(_0xc2a42e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1fae495..3716ca7 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 _0x795e=['create','addConfiguration','put','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x19c978,_0x451c13){var _0x1eab29=function(_0x382ac1){while(--_0x382ac1){_0x19c978['push'](_0x19c978['shift']());}};_0x1eab29(++_0x451c13);}(_0x795e,0x124));var _0xe795=function(_0xc2f1c4,_0x130837){_0xc2f1c4=_0xc2f1c4-0x0;var _0x3a1b25=_0x795e[_0xc2f1c4];return _0x3a1b25;};'use strict';var multer=require(_0xe795('0x0'));var util=require(_0xe795('0x1'));var path=require(_0xe795('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe795('0x3'));var interaction=require(_0xe795('0x4'));var config=require(_0xe795('0x5'));var controller=require(_0xe795('0x6'));router[_0xe795('0x7')]('/',auth['isAuthenticated'](),controller[_0xe795('0x8')]);router[_0xe795('0x7')](_0xe795('0x9'),auth[_0xe795('0xa')](),controller[_0xe795('0xb')]);router[_0xe795('0x7')](_0xe795('0xc'),auth[_0xe795('0xa')](),controller['getConfigurations']);router[_0xe795('0x7')](_0xe795('0xd'),auth[_0xe795('0xa')](),controller[_0xe795('0xe')]);router[_0xe795('0xf')]('/',auth['isAuthenticated'](),controller[_0xe795('0x10')]);router[_0xe795('0xf')]('/:id/configurations',auth[_0xe795('0xa')](),controller[_0xe795('0x11')]);router[_0xe795('0x12')](_0xe795('0x9'),auth[_0xe795('0xa')](),controller['update']);router[_0xe795('0x13')](_0xe795('0x9'),auth[_0xe795('0xa')](),controller[_0xe795('0x14')]);module[_0xe795('0x15')]=router; \ No newline at end of file +var _0x9335=['./intZendeskAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xae580d,_0x5a18d8){var _0x5c4a89=function(_0x312264){while(--_0x312264){_0xae580d['push'](_0xae580d['shift']());}};_0x5c4a89(++_0x5a18d8);}(_0x9335,0x1f2));var _0x5933=function(_0xe5cf3c,_0x5b75f0){_0xe5cf3c=_0xe5cf3c-0x0;var _0x23f3d4=_0x9335[_0xe5cf3c];return _0x23f3d4;};'use strict';var multer=require('multer');var util=require(_0x5933('0x0'));var path=require(_0x5933('0x1'));var timeout=require('connect-timeout');var express=require(_0x5933('0x2'));var router=express[_0x5933('0x3')]();var auth=require(_0x5933('0x4'));var interaction=require(_0x5933('0x5'));var config=require('../../config/environment');var controller=require(_0x5933('0x6'));router['get']('/',auth[_0x5933('0x7')](),controller[_0x5933('0x8')]);router[_0x5933('0x9')]('/:id',auth[_0x5933('0x7')](),controller['show']);router[_0x5933('0x9')](_0x5933('0xa'),auth[_0x5933('0x7')](),controller[_0x5933('0xb')]);router[_0x5933('0x9')](_0x5933('0xc'),auth[_0x5933('0x7')](),controller[_0x5933('0xd')]);router[_0x5933('0xe')]('/',auth[_0x5933('0x7')](),controller[_0x5933('0xf')]);router[_0x5933('0xe')](_0x5933('0xa'),auth[_0x5933('0x7')](),controller[_0x5933('0x10')]);router[_0x5933('0x11')](_0x5933('0x12'),auth[_0x5933('0x7')](),controller[_0x5933('0x13')]);router['delete'](_0x5933('0x12'),auth[_0x5933('0x7')](),controller['destroy']);module[_0x5933('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e43838f..cae85c6 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 _0x52b2=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports'];(function(_0x338d6b,_0x21ceb5){var _0x20bf75=function(_0x7f8e3d){while(--_0x7f8e3d){_0x338d6b['push'](_0x338d6b['shift']());}};_0x20bf75(++_0x21ceb5);}(_0x52b2,0x11e));var _0x252b=function(_0x21ecc6,_0x4c8c2b){_0x21ecc6=_0x21ecc6-0x0;var _0x5393a1=_0x52b2[_0x21ecc6];return _0x5393a1;};'use strict';var Sequelize=require(_0x252b('0x0'));module[_0x252b('0x1')]={'name':{'type':Sequelize[_0x252b('0x2')]},'description':{'type':Sequelize[_0x252b('0x2')]},'username':{'type':Sequelize[_0x252b('0x2')],'unique':_0x252b('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x252b('0x2')]},'remoteUri':{'type':Sequelize[_0x252b('0x2')],'unique':_0x252b('0x4')},'authType':{'type':Sequelize[_0x252b('0x5')](_0x252b('0x6'),'token'),'defaultValue':_0x252b('0x6')},'serverUrl':{'type':Sequelize[_0x252b('0x2')]},'type':{'type':Sequelize[_0x252b('0x5')](_0x252b('0x7'),_0x252b('0x8')),'defaultValue':_0x252b('0x7')}}; \ No newline at end of file +var _0x2c47=['integrationTab','newTab','sequelize','exports','STRING','username','ENUM','password','token'];(function(_0x4b97da,_0x33b04e){var _0x197836=function(_0x2df445){while(--_0x2df445){_0x4b97da['push'](_0x4b97da['shift']());}};_0x197836(++_0x33b04e);}(_0x2c47,0x18e));var _0x72c4=function(_0x59e566,_0x333342){_0x59e566=_0x59e566-0x0;var _0x13e174=_0x2c47[_0x59e566];return _0x13e174;};'use strict';var Sequelize=require(_0x72c4('0x0'));module[_0x72c4('0x1')]={'name':{'type':Sequelize[_0x72c4('0x2')]},'description':{'type':Sequelize[_0x72c4('0x2')]},'username':{'type':Sequelize[_0x72c4('0x2')],'unique':_0x72c4('0x3')},'password':{'type':Sequelize[_0x72c4('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x72c4('0x4')](_0x72c4('0x5'),_0x72c4('0x6')),'defaultValue':_0x72c4('0x5')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x72c4('0x4')](_0x72c4('0x7'),_0x72c4('0x8')),'defaultValue':_0x72c4('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2610a4c..baaeff6 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 _0xcff9=['Sequelize','Unknown\x20authentication\x20type','group','remove','includes','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','limit','Content-Range','reject','update','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ZendeskAccount','includeAll','include','rows','show','params','length','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','toString','base64','headers'];(function(_0x18caed,_0x4da8e6){var _0x1cd080=function(_0x3baf6b){while(--_0x3baf6b){_0x18caed['push'](_0x18caed['shift']());}};_0x1cd080(++_0x4da8e6);}(_0xcff9,0x8c));var _0x9cff=function(_0x4a6baa,_0x38e94a){_0x4a6baa=_0x4a6baa-0x0;var _0x9429f1=_0xcff9[_0x4a6baa];return _0x9429f1;};'use strict';var pdf=require(_0x9cff('0x0'));var emlformat=require(_0x9cff('0x1'));var rimraf=require(_0x9cff('0x2'));var zipdir=require(_0x9cff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cff('0x4'));var moment=require(_0x9cff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cff('0x6'));var util=require(_0x9cff('0x7'));var path=require(_0x9cff('0x8'));var sox=require(_0x9cff('0x9'));var csv=require(_0x9cff('0xa'));var ejs=require(_0x9cff('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9cff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9cff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9cff('0xe'));var Papa=require(_0x9cff('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9cff('0x10'));var qs=require(_0x9cff('0x11'));var logger=require(_0x9cff('0x12'))(_0x9cff('0x13'));var utils=require('../../config/utils');var config=require(_0x9cff('0x14'));var db=require(_0x9cff('0x15'))['db'];var integrations=require(_0x9cff('0x16'));var jayson=require(_0x9cff('0x17'));var client=jayson[_0x9cff('0x18')][_0x9cff('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xe871c3,_0x4bda79,_0x453b0c,_0x41953d){return new BPromise(function(_0x4694ee,_0x597172){var _0x5ce03c=_0x41953d||client;return _0x5ce03c[_0x9cff('0x1a')](_0xe871c3,_0x453b0c)[_0x9cff('0x1b')](function(_0x2b3bf6){logger['info'](_0x9cff('0x1c'),_0x4bda79,_0x9cff('0x1d'));logger[_0x9cff('0x1e')](_0x9cff('0x1f'),_0x4bda79,_0x9cff('0x1d'),JSON[_0x9cff('0x20')](_0x2b3bf6));if(_0x2b3bf6[_0x9cff('0x21')]){if(_0x2b3bf6[_0x9cff('0x21')][_0x9cff('0x22')]===0x1f4){logger[_0x9cff('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x4bda79,_0x2b3bf6[_0x9cff('0x21')][_0x9cff('0x23')]);return _0x597172(_0x2b3bf6[_0x9cff('0x21')]['message']);}logger[_0x9cff('0x21')](_0x9cff('0x1c'),_0x4bda79,_0x2b3bf6[_0x9cff('0x21')][_0x9cff('0x23')]);return _0x4694ee(_0x2b3bf6[_0x9cff('0x21')][_0x9cff('0x23')]);}else{logger[_0x9cff('0x24')](_0x9cff('0x1c'),_0x4bda79,_0x9cff('0x1d'));_0x4694ee(_0x2b3bf6[_0x9cff('0x25')][_0x9cff('0x23')]);}})[_0x9cff('0x26')](function(_0x5d0db0){logger[_0x9cff('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x4bda79,_0x5d0db0);_0x597172(_0x5d0db0);});});}function respondWithStatusCode(_0x18f52b,_0x54298a){_0x54298a=_0x54298a||0xcc;return function(_0x35b460){if(_0x35b460){return _0x18f52b[_0x9cff('0x27')](_0x54298a);}return _0x18f52b[_0x9cff('0x28')](_0x54298a)[_0x9cff('0x29')]();};}function respondWithResult(_0x1743d8,_0x4bc9c6){_0x4bc9c6=_0x4bc9c6||0xc8;return function(_0x2594df){if(_0x2594df){return _0x1743d8[_0x9cff('0x28')](_0x4bc9c6)[_0x9cff('0x2a')](_0x2594df);}};}function respondWithFilteredResult(_0x481eb9,_0x272449){return function(_0x479d72){if(_0x479d72){var _0x464b3a=_0x479d72[_0x9cff('0x2b')],_0x31af3a=_0x272449['offset'],_0x2180ef=_0x272449['offset']+_0x272449[_0x9cff('0x2c')],_0x48c3d8;if(_0x2180ef>=_0x464b3a){_0x2180ef=_0x464b3a;_0x48c3d8=0xc8;}else{_0x48c3d8=0xce;}_0x481eb9[_0x9cff('0x28')](_0x48c3d8);return _0x481eb9['set'](_0x9cff('0x2d'),_0x31af3a+'-'+_0x2180ef+'/'+_0x464b3a)[_0x9cff('0x2a')](_0x479d72);}return null;};}function patchUpdates(_0x283ac2){return function(_0x575b22){try{jsonpatch['apply'](_0x575b22,_0x283ac2,!![]);}catch(_0x9d0da2){return BPromise[_0x9cff('0x2e')](_0x9d0da2);}return _0x575b22['save']();};}function saveUpdates(_0xf803d6,_0x18f8f3){return function(_0x53c682){if(_0x53c682){return _0x53c682[_0x9cff('0x2f')](_0xf803d6)['then'](function(_0x48708f){return _0x48708f;});}return null;};}function removeEntity(_0x16e018,_0x3aa196){return function(_0x506913){if(_0x506913){return _0x506913['destroy']()[_0x9cff('0x1b')](function(){_0x16e018[_0x9cff('0x28')](0xcc)[_0x9cff('0x29')]();});}};}function handleEntityNotFound(_0x40f151,_0x449433){return function(_0x4cf88b){if(!_0x4cf88b){_0x40f151[_0x9cff('0x27')](0x194);}return _0x4cf88b;};}function handleError(_0xe1a2c7,_0x2ae4cc){_0x2ae4cc=_0x2ae4cc||0x1f4;return function(_0x4d68bf){logger['error'](_0x4d68bf[_0x9cff('0x30')]);if(_0x4d68bf[_0x9cff('0x31')]){delete _0x4d68bf['name'];}_0xe1a2c7[_0x9cff('0x28')](_0x2ae4cc)['send'](_0x4d68bf);};}exports[_0x9cff('0x32')]=function(_0x13a7a3,_0x34b609){var _0x354918={},_0x220130={},_0x4d19b0={'count':0x0,'rows':[]};var _0x1793f2=db['ZendeskAccount'][_0x9cff('0x33')];_0x220130[_0x9cff('0x34')]=_[_0x9cff('0x35')](_0x1793f2);_0x220130[_0x9cff('0x36')]=_[_0x9cff('0x35')](_0x13a7a3[_0x9cff('0x36')]);_0x220130[_0x9cff('0x37')]=_[_0x9cff('0x38')](_0x220130[_0x9cff('0x34')],_0x220130[_0x9cff('0x36')]);_0x354918[_0x9cff('0x39')]=_[_0x9cff('0x38')](_0x220130[_0x9cff('0x34')],qs[_0x9cff('0x3a')](_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x3a')]));_0x354918['attributes']=_0x354918['attributes']['length']?_0x354918[_0x9cff('0x39')]:_0x220130[_0x9cff('0x34')];if(!_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x3b')]('nolimit')){_0x354918[_0x9cff('0x2c')]=qs[_0x9cff('0x2c')](_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x2c')]);_0x354918['offset']=qs[_0x9cff('0x3c')](_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x3c')]);}_0x354918[_0x9cff('0x3d')]=qs[_0x9cff('0x3e')](_0x13a7a3['query'][_0x9cff('0x3e')]);_0x354918[_0x9cff('0x3f')]=qs[_0x9cff('0x37')](_[_0x9cff('0x40')](_0x13a7a3['query'],_0x220130[_0x9cff('0x37')]));if(_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x41')]){_0x354918[_0x9cff('0x3f')]=_[_0x9cff('0x42')](_0x354918[_0x9cff('0x3f')],{'$or':_[_0x9cff('0x43')](_0x1793f2,function(_0x20a3fc){if(_0x20a3fc[_0x9cff('0x44')][_0x9cff('0x45')]!==_0x9cff('0x46')){var _0x2823ed={};_0x2823ed[_0x20a3fc[_0x9cff('0x47')]]={'$like':'%'+_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x41')]+'%'};return _0x2823ed;}})});}_0x354918=_[_0x9cff('0x42')]({},_0x354918,_0x13a7a3[_0x9cff('0x48')]);var _0x90edad={'where':_0x354918[_0x9cff('0x3f')]};return db[_0x9cff('0x49')][_0x9cff('0x2b')](_0x90edad)[_0x9cff('0x1b')](function(_0x4b741a){_0x4d19b0[_0x9cff('0x2b')]=_0x4b741a;if(_0x13a7a3[_0x9cff('0x36')][_0x9cff('0x4a')]){_0x354918[_0x9cff('0x4b')]=[{'all':!![]}];}return db[_0x9cff('0x49')]['findAll'](_0x354918);})[_0x9cff('0x1b')](function(_0x495d1c){_0x4d19b0[_0x9cff('0x4c')]=_0x495d1c;return _0x4d19b0;})['then'](respondWithFilteredResult(_0x34b609,_0x354918))[_0x9cff('0x26')](handleError(_0x34b609,null));};exports[_0x9cff('0x4d')]=function(_0x4c40d5,_0x57c3ac){var _0x676316={'raw':![],'where':{'id':_0x4c40d5[_0x9cff('0x4e')]['id']}},_0x36c9ac={};_0x36c9ac[_0x9cff('0x34')]=_['keys'](db[_0x9cff('0x49')][_0x9cff('0x33')]);_0x36c9ac[_0x9cff('0x36')]=_[_0x9cff('0x35')](_0x4c40d5[_0x9cff('0x36')]);_0x36c9ac['filters']=_[_0x9cff('0x38')](_0x36c9ac[_0x9cff('0x34')],_0x36c9ac[_0x9cff('0x36')]);_0x676316[_0x9cff('0x39')]=_[_0x9cff('0x38')](_0x36c9ac['model'],qs[_0x9cff('0x3a')](_0x4c40d5['query'][_0x9cff('0x3a')]));_0x676316[_0x9cff('0x39')]=_0x676316['attributes'][_0x9cff('0x4f')]?_0x676316[_0x9cff('0x39')]:_0x36c9ac[_0x9cff('0x34')];if(_0x4c40d5[_0x9cff('0x36')]['includeAll']){_0x676316[_0x9cff('0x4b')]=[{'all':!![]}];}_0x676316=_[_0x9cff('0x42')]({},_0x676316,_0x4c40d5[_0x9cff('0x48')]);return db[_0x9cff('0x49')][_0x9cff('0x50')](_0x676316)[_0x9cff('0x1b')](handleEntityNotFound(_0x57c3ac,null))[_0x9cff('0x1b')](respondWithResult(_0x57c3ac,null))[_0x9cff('0x26')](handleError(_0x57c3ac,null));};exports[_0x9cff('0x51')]=function(_0x22433d,_0x2aafb2){return db['ZendeskAccount']['create'](_0x22433d[_0x9cff('0x52')],{})[_0x9cff('0x1b')](respondWithResult(_0x2aafb2,0xc9))['catch'](handleError(_0x2aafb2,null));};exports[_0x9cff('0x2f')]=function(_0x3176ee,_0x27bb45){if(_0x3176ee['body']['id']){delete _0x3176ee[_0x9cff('0x52')]['id'];}return db[_0x9cff('0x49')][_0x9cff('0x50')]({'where':{'id':_0x3176ee[_0x9cff('0x4e')]['id']}})[_0x9cff('0x1b')](handleEntityNotFound(_0x27bb45,null))['then'](saveUpdates(_0x3176ee[_0x9cff('0x52')],null))[_0x9cff('0x1b')](respondWithResult(_0x27bb45,null))[_0x9cff('0x26')](handleError(_0x27bb45,null));};exports[_0x9cff('0x53')]=function(_0x3fabca,_0xf060b4){return db[_0x9cff('0x49')][_0x9cff('0x50')]({'where':{'id':_0x3fabca['params']['id']}})[_0x9cff('0x1b')](handleEntityNotFound(_0xf060b4,null))[_0x9cff('0x1b')](removeEntity(_0xf060b4,null))['catch'](handleError(_0xf060b4,null));};exports[_0x9cff('0x54')]=function(_0x4696ba,_0x45b9d2,_0x1744d3){var _0x33b671={};var _0x23f74f={};var _0x2a64a2;var _0x486de6;return db[_0x9cff('0x49')][_0x9cff('0x55')]({'where':{'id':_0x4696ba[_0x9cff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45b9d2,null))['then'](function(_0x4f81dc){if(_0x4f81dc){_0x2a64a2=_0x4f81dc;_0x23f74f['model']=_[_0x9cff('0x35')](db[_0x9cff('0x56')][_0x9cff('0x33')]);_0x23f74f[_0x9cff('0x36')]=_[_0x9cff('0x35')](_0x4696ba[_0x9cff('0x36')]);_0x23f74f[_0x9cff('0x37')]=_[_0x9cff('0x38')](_0x23f74f[_0x9cff('0x34')],_0x23f74f[_0x9cff('0x36')]);_0x33b671[_0x9cff('0x39')]=_[_0x9cff('0x38')](_0x23f74f['model'],qs[_0x9cff('0x3a')](_0x4696ba['query'][_0x9cff('0x3a')]));_0x33b671[_0x9cff('0x39')]=_0x33b671[_0x9cff('0x39')]['length']?_0x33b671['attributes']:_0x23f74f[_0x9cff('0x34')];_0x33b671[_0x9cff('0x3d')]=qs[_0x9cff('0x3e')](_0x4696ba[_0x9cff('0x36')][_0x9cff('0x3e')]);_0x33b671[_0x9cff('0x3f')]=qs['filters'](_[_0x9cff('0x40')](_0x4696ba[_0x9cff('0x36')],_0x23f74f['filters']));if(_0x4696ba[_0x9cff('0x36')]['filter']){_0x33b671[_0x9cff('0x3f')]=_[_0x9cff('0x42')](_0x33b671[_0x9cff('0x3f')],{'$or':_[_0x9cff('0x43')](_0x33b671['attributes'],function(_0x4736cc){var _0x3628cc={};_0x3628cc[_0x4736cc]={'$like':'%'+_0x4696ba[_0x9cff('0x36')][_0x9cff('0x41')]+'%'};return _0x3628cc;})});}_0x33b671=_[_0x9cff('0x42')]({},_0x33b671,_0x4696ba[_0x9cff('0x48')]);return _0x2a64a2['getConfigurations'](_0x33b671);}})['then'](function(_0x4ac898){if(_0x4ac898){_0x486de6=_0x4ac898[_0x9cff('0x4f')];if(!_0x4696ba[_0x9cff('0x36')][_0x9cff('0x3b')](_0x9cff('0x57'))){_0x33b671[_0x9cff('0x2c')]=qs[_0x9cff('0x2c')](_0x4696ba[_0x9cff('0x36')][_0x9cff('0x2c')]);_0x33b671['offset']=qs[_0x9cff('0x3c')](_0x4696ba[_0x9cff('0x36')][_0x9cff('0x3c')]);}return _0x2a64a2[_0x9cff('0x54')](_0x33b671);}})[_0x9cff('0x1b')](function(_0x116161){if(_0x116161){return _0x116161?{'count':_0x486de6,'rows':_0x116161}:null;}})[_0x9cff('0x1b')](respondWithResult(_0x45b9d2,null))[_0x9cff('0x26')](handleError(_0x45b9d2,null));};exports[_0x9cff('0x58')]=function(_0x3ca7fd,_0x11aecd,_0x169451){if(_0x3ca7fd[_0x9cff('0x52')]['id']){delete _0x3ca7fd[_0x9cff('0x52')]['id'];}return db[_0x9cff('0x49')][_0x9cff('0x55')]({'where':{'id':_0x3ca7fd[_0x9cff('0x4e')]['id']}})[_0x9cff('0x1b')](handleEntityNotFound(_0x11aecd,null))[_0x9cff('0x1b')](function(_0x356031){if(_0x356031){_0x3ca7fd[_0x9cff('0x52')][_0x9cff('0x59')]=_0x356031['id'];_0x3ca7fd[_0x9cff('0x52')][_0x9cff('0x5a')]=integrations[_0x9cff('0x5b')](_0x3ca7fd[_0x9cff('0x52')]['channel'],_0x3ca7fd[_0x9cff('0x52')][_0x9cff('0x44')]);_0x3ca7fd[_0x9cff('0x52')]['Descriptions']=integrations[_0x9cff('0x5c')](_0x3ca7fd[_0x9cff('0x52')][_0x9cff('0x5d')],_0x3ca7fd[_0x9cff('0x52')][_0x9cff('0x44')]);return db['ZendeskConfiguration']['create'](_0x3ca7fd[_0x9cff('0x52')],{'include':[{'model':db['ZendeskField'],'as':_0x9cff('0x5a')},{'model':db['ZendeskField'],'as':_0x9cff('0x5e')}]});}return null;})['then'](respondWithResult(_0x11aecd,null))[_0x9cff('0x26')](handleError(_0x11aecd,null));};exports[_0x9cff('0x5f')]=function(_0x17cdb2,_0x1fcd0b,_0x56595f){var _0x323de5='';return db[_0x9cff('0x49')][_0x9cff('0x55')]({'where':{'id':_0x17cdb2[_0x9cff('0x4e')]['id']},'attributes':['id',_0x9cff('0x60'),_0x9cff('0x61'),_0x9cff('0x62'),'authType','remoteUri']})[_0x9cff('0x1b')](handleEntityNotFound(_0x1fcd0b,null))[_0x9cff('0x1b')](function(_0x4b4838){if(_0x4b4838){_0x323de5=_0x4b4838[_0x9cff('0x63')];var _0x3d609f=_0x323de5[_0x9cff('0x64')](-0x1);if(_0x3d609f==='/'){_0x323de5=_0x323de5['substring'](0x0,_0x323de5[_0x9cff('0x65')](_0x3d609f));}var _0x4cb0bb={'method':_0x9cff('0x66'),'uri':util[_0x9cff('0x67')](_0x9cff('0x68'),_0x323de5,'ticket_fields'),'json':!![]};switch(_0x4b4838['authType']){case _0x9cff('0x61'):_0x4cb0bb['headers']={'Authorization':util[_0x9cff('0x67')](_0x9cff('0x69'),new Buffer(util[_0x9cff('0x67')](_0x9cff('0x6a'),_0x4b4838[_0x9cff('0x60')],_0x4b4838[_0x9cff('0x61')]))[_0x9cff('0x6b')](_0x9cff('0x6c')))};break;case'token':_0x4cb0bb[_0x9cff('0x6d')]={'Authorization':util[_0x9cff('0x67')](_0x9cff('0x69'),new Buffer(util[_0x9cff('0x67')]('%s/token:%s',_0x4b4838['username'],_0x4b4838[_0x9cff('0x62')]))['toString']('base64'))};break;default:throw new db[(_0x9cff('0x6e'))]['ValidationError'](_0x9cff('0x6f'));}return rp(_0x4cb0bb);}})[_0x9cff('0x1b')](function(_0x44bf0d){if(_0x44bf0d){var _0x3dc2f0=['subject','description',_0x9cff('0x70'),'assignee'];_[_0x9cff('0x71')](_0x44bf0d['ticket_fields'],function(_0x125b5b){return _0x3dc2f0[_0x9cff('0x72')](_0x125b5b['type']);});return{'count':_0x44bf0d[_0x9cff('0x73')]['length'],'rows':_[_0x9cff('0x43')](_0x44bf0d[_0x9cff('0x73')],function(_0x3f6890){return{'id':_0x3f6890['id'],'name':_0x3f6890[_0x9cff('0x74')]>0x7?_0x3f6890[_0x9cff('0x75')]:_0x3f6890[_0x9cff('0x44')],'custom':_0x3f6890[_0x9cff('0x74')]>0x7?!![]:![],'options':_0x3f6890[_0x9cff('0x76')]?_0x3f6890['system_field_options']:_0x3f6890[_0x9cff('0x77')]?_0x3f6890[_0x9cff('0x77')]:[]};})};}})['then'](respondWithResult(_0x1fcd0b,null))[_0x9cff('0x26')](function(_0x7ab3a2){var _0x5ef8ef=_0x17cdb2['query'][_0x9cff('0x78')]?0x1f4:_0x7ab3a2[_0x9cff('0x79')]||0x1f4;logger[_0x9cff('0x21')](_0x9cff('0x7a'),'getFields',_0x5ef8ef,JSON[_0x9cff('0x20')](_0x7ab3a2));delete _0x7ab3a2[_0x9cff('0x31')];if(_0x5ef8ef===0x191){_0x5ef8ef=0x190;}_0x1fcd0b[_0x9cff('0x28')](_0x5ef8ef)[_0x9cff('0x7b')](_0x17cdb2['query'][_0x9cff('0x78')]?{'message':_0x9cff('0x7c'),'statusCode':_0x7ab3a2[_0x9cff('0x79')]}:_0x7ab3a2);});}; \ No newline at end of file +var _0x8ae2=['status','count','set','json','apply','reject','save','then','sendStatus','name','index','rawAttributes','model','keys','filters','query','attributes','fields','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ZendeskAccount','include','findAll','rows','catch','intersection','includeAll','find','create','body','update','params','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','GET','%s/%s','headers','format','%s:%s','base64','Basic\x20%s','toString','ValidationError','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8ae2,0x143));var _0x28ae=function(_0x41015b,_0x44117d){_0x41015b=_0x41015b-0x0;var _0x5bb187=_0x8ae2[_0x41015b];return _0x5bb187;};'use strict';var pdf=require(_0x28ae('0x0'));var emlformat=require(_0x28ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x28ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ae('0x3'));var moment=require('moment');var BPromise=require(_0x28ae('0x4'));var Mustache=require(_0x28ae('0x5'));var util=require(_0x28ae('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x28ae('0x7'));var ejs=require(_0x28ae('0x8'));var fs=require('fs');var _=require(_0x28ae('0x9'));var squel=require('squel');var crypto=require(_0x28ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x28ae('0xb'));var toCsv=require(_0x28ae('0x7'));var querystring=require(_0x28ae('0xc'));var Papa=require(_0x28ae('0xd'));var authService=require(_0x28ae('0xe'));var hardwareService=require(_0x28ae('0xf'));var Redis=require(_0x28ae('0x10'));var qs=require(_0x28ae('0x11'));var logger=require('../../config/logger')(_0x28ae('0x12'));var utils=require(_0x28ae('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x28ae('0x14'));var client=jayson[_0x28ae('0x15')][_0x28ae('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x57ee3a,_0x19f998,_0x2e96d3,_0x51799d){return new BPromise(function(_0x18ddae,_0x2838a2){var _0x522c70=_0x51799d||client;return _0x522c70[_0x28ae('0x17')](_0x57ee3a,_0x2e96d3)['then'](function(_0x2f930b){logger[_0x28ae('0x18')](_0x28ae('0x19'),_0x19f998,_0x28ae('0x1a'));logger['debug'](_0x28ae('0x1b'),_0x19f998,'request\x20sent',JSON[_0x28ae('0x1c')](_0x2f930b));if(_0x2f930b['error']){if(_0x2f930b[_0x28ae('0x1d')][_0x28ae('0x1e')]===0x1f4){logger[_0x28ae('0x1d')](_0x28ae('0x19'),_0x19f998,_0x2f930b[_0x28ae('0x1d')][_0x28ae('0x1f')]);return _0x2838a2(_0x2f930b[_0x28ae('0x1d')][_0x28ae('0x1f')]);}logger[_0x28ae('0x1d')](_0x28ae('0x19'),_0x19f998,_0x2f930b['error']['message']);return _0x18ddae(_0x2f930b[_0x28ae('0x1d')][_0x28ae('0x1f')]);}else{logger[_0x28ae('0x18')]('ZendeskAccount,\x20%s,\x20%s',_0x19f998,_0x28ae('0x1a'));_0x18ddae(_0x2f930b[_0x28ae('0x20')][_0x28ae('0x1f')]);}})['catch'](function(_0x431f63){logger[_0x28ae('0x1d')](_0x28ae('0x19'),_0x19f998,_0x431f63);_0x2838a2(_0x431f63);});});}function respondWithStatusCode(_0x59a3b0,_0x5863c6){_0x5863c6=_0x5863c6||0xcc;return function(_0x1cc686){if(_0x1cc686){return _0x59a3b0['sendStatus'](_0x5863c6);}return _0x59a3b0['status'](_0x5863c6)[_0x28ae('0x21')]();};}function respondWithResult(_0x4b1037,_0xa5b958){_0xa5b958=_0xa5b958||0xc8;return function(_0x5a775d){if(_0x5a775d){return _0x4b1037[_0x28ae('0x22')](_0xa5b958)['json'](_0x5a775d);}};}function respondWithFilteredResult(_0x1c5222,_0x3fc06d){return function(_0x5a0284){if(_0x5a0284){var _0x365d6b=_0x5a0284[_0x28ae('0x23')],_0x1d6e2c=_0x3fc06d['offset'],_0x665814=_0x3fc06d['offset']+_0x3fc06d['limit'],_0x61fb72;if(_0x665814>=_0x365d6b){_0x665814=_0x365d6b;_0x61fb72=0xc8;}else{_0x61fb72=0xce;}_0x1c5222[_0x28ae('0x22')](_0x61fb72);return _0x1c5222[_0x28ae('0x24')]('Content-Range',_0x1d6e2c+'-'+_0x665814+'/'+_0x365d6b)[_0x28ae('0x25')](_0x5a0284);}return null;};}function patchUpdates(_0x306626){return function(_0x39e82d){try{jsonpatch[_0x28ae('0x26')](_0x39e82d,_0x306626,!![]);}catch(_0x2ef411){return BPromise[_0x28ae('0x27')](_0x2ef411);}return _0x39e82d[_0x28ae('0x28')]();};}function saveUpdates(_0x13df9a,_0xa17358){return function(_0x419d43){if(_0x419d43){return _0x419d43['update'](_0x13df9a)[_0x28ae('0x29')](function(_0x1298f5){return _0x1298f5;});}return null;};}function removeEntity(_0x35cf3b,_0xe670fe){return function(_0x2814f0){if(_0x2814f0){return _0x2814f0['destroy']()['then'](function(){_0x35cf3b[_0x28ae('0x22')](0xcc)[_0x28ae('0x21')]();});}};}function handleEntityNotFound(_0x29841a,_0x5027a1){return function(_0x3e69cf){if(!_0x3e69cf){_0x29841a[_0x28ae('0x2a')](0x194);}return _0x3e69cf;};}function handleError(_0x515aac,_0x120234){_0x120234=_0x120234||0x1f4;return function(_0x591387){logger[_0x28ae('0x1d')](_0x591387['stack']);if(_0x591387[_0x28ae('0x2b')]){delete _0x591387['name'];}_0x515aac[_0x28ae('0x22')](_0x120234)['send'](_0x591387);};}exports[_0x28ae('0x2c')]=function(_0x2816d3,_0x3ce4cd){var _0x483219={},_0x5a1e7b={},_0x102f15={'count':0x0,'rows':[]};var _0x579d4d=db['ZendeskAccount'][_0x28ae('0x2d')];_0x5a1e7b[_0x28ae('0x2e')]=_[_0x28ae('0x2f')](_0x579d4d);_0x5a1e7b['query']=_[_0x28ae('0x2f')](_0x2816d3['query']);_0x5a1e7b[_0x28ae('0x30')]=_['intersection'](_0x5a1e7b[_0x28ae('0x2e')],_0x5a1e7b[_0x28ae('0x31')]);_0x483219[_0x28ae('0x32')]=_['intersection'](_0x5a1e7b[_0x28ae('0x2e')],qs['fields'](_0x2816d3['query'][_0x28ae('0x33')]));_0x483219[_0x28ae('0x32')]=_0x483219[_0x28ae('0x32')][_0x28ae('0x34')]?_0x483219[_0x28ae('0x32')]:_0x5a1e7b['model'];if(!_0x2816d3[_0x28ae('0x31')]['hasOwnProperty'](_0x28ae('0x35'))){_0x483219[_0x28ae('0x36')]=qs[_0x28ae('0x36')](_0x2816d3[_0x28ae('0x31')][_0x28ae('0x36')]);_0x483219[_0x28ae('0x37')]=qs[_0x28ae('0x37')](_0x2816d3[_0x28ae('0x31')][_0x28ae('0x37')]);}_0x483219[_0x28ae('0x38')]=qs['sort'](_0x2816d3[_0x28ae('0x31')][_0x28ae('0x39')]);_0x483219[_0x28ae('0x3a')]=qs[_0x28ae('0x30')](_[_0x28ae('0x3b')](_0x2816d3[_0x28ae('0x31')],_0x5a1e7b[_0x28ae('0x30')]));if(_0x2816d3['query'][_0x28ae('0x3c')]){_0x483219[_0x28ae('0x3a')]=_[_0x28ae('0x3d')](_0x483219[_0x28ae('0x3a')],{'$or':_[_0x28ae('0x3e')](_0x579d4d,function(_0x1774c2){if(_0x1774c2[_0x28ae('0x3f')][_0x28ae('0x40')]!==_0x28ae('0x41')){var _0x201e8c={};_0x201e8c[_0x1774c2[_0x28ae('0x42')]]={'$like':'%'+_0x2816d3[_0x28ae('0x31')][_0x28ae('0x3c')]+'%'};return _0x201e8c;}})});}_0x483219=_[_0x28ae('0x3d')]({},_0x483219,_0x2816d3[_0x28ae('0x43')]);var _0x351a11={'where':_0x483219['where']};return db[_0x28ae('0x44')]['count'](_0x351a11)[_0x28ae('0x29')](function(_0x141184){_0x102f15['count']=_0x141184;if(_0x2816d3[_0x28ae('0x31')]['includeAll']){_0x483219[_0x28ae('0x45')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x28ae('0x46')](_0x483219);})[_0x28ae('0x29')](function(_0x1853b5){_0x102f15[_0x28ae('0x47')]=_0x1853b5;return _0x102f15;})['then'](respondWithFilteredResult(_0x3ce4cd,_0x483219))[_0x28ae('0x48')](handleError(_0x3ce4cd,null));};exports['show']=function(_0x58fee2,_0x4cf427){var _0x14e061={'raw':![],'where':{'id':_0x58fee2['params']['id']}},_0x5cbf75={};_0x5cbf75[_0x28ae('0x2e')]=_[_0x28ae('0x2f')](db[_0x28ae('0x44')][_0x28ae('0x2d')]);_0x5cbf75[_0x28ae('0x31')]=_[_0x28ae('0x2f')](_0x58fee2['query']);_0x5cbf75[_0x28ae('0x30')]=_[_0x28ae('0x49')](_0x5cbf75[_0x28ae('0x2e')],_0x5cbf75[_0x28ae('0x31')]);_0x14e061[_0x28ae('0x32')]=_[_0x28ae('0x49')](_0x5cbf75['model'],qs['fields'](_0x58fee2['query'][_0x28ae('0x33')]));_0x14e061['attributes']=_0x14e061['attributes']['length']?_0x14e061[_0x28ae('0x32')]:_0x5cbf75[_0x28ae('0x2e')];if(_0x58fee2['query'][_0x28ae('0x4a')]){_0x14e061['include']=[{'all':!![]}];}_0x14e061=_[_0x28ae('0x3d')]({},_0x14e061,_0x58fee2[_0x28ae('0x43')]);return db[_0x28ae('0x44')][_0x28ae('0x4b')](_0x14e061)[_0x28ae('0x29')](handleEntityNotFound(_0x4cf427,null))[_0x28ae('0x29')](respondWithResult(_0x4cf427,null))['catch'](handleError(_0x4cf427,null));};exports[_0x28ae('0x4c')]=function(_0x47bdfd,_0x429a1a){return db[_0x28ae('0x44')]['create'](_0x47bdfd[_0x28ae('0x4d')],{})['then'](respondWithResult(_0x429a1a,0xc9))[_0x28ae('0x48')](handleError(_0x429a1a,null));};exports[_0x28ae('0x4e')]=function(_0x11a226,_0x4ca19f){if(_0x11a226[_0x28ae('0x4d')]['id']){delete _0x11a226[_0x28ae('0x4d')]['id'];}return db[_0x28ae('0x44')][_0x28ae('0x4b')]({'where':{'id':_0x11a226['params']['id']}})[_0x28ae('0x29')](handleEntityNotFound(_0x4ca19f,null))[_0x28ae('0x29')](saveUpdates(_0x11a226[_0x28ae('0x4d')],null))['then'](respondWithResult(_0x4ca19f,null))[_0x28ae('0x48')](handleError(_0x4ca19f,null));};exports['destroy']=function(_0x36e06e,_0x1866f4){return db['ZendeskAccount'][_0x28ae('0x4b')]({'where':{'id':_0x36e06e[_0x28ae('0x4f')]['id']}})[_0x28ae('0x29')](handleEntityNotFound(_0x1866f4,null))['then'](removeEntity(_0x1866f4,null))[_0x28ae('0x48')](handleError(_0x1866f4,null));};exports[_0x28ae('0x50')]=function(_0x504379,_0x4df882,_0x5117f2){var _0x40c3a8={};var _0x34b549={};var _0xc0480c;var _0x51eb58;return db[_0x28ae('0x44')][_0x28ae('0x51')]({'where':{'id':_0x504379['params']['id']}})[_0x28ae('0x29')](handleEntityNotFound(_0x4df882,null))[_0x28ae('0x29')](function(_0x1483ca){if(_0x1483ca){_0xc0480c=_0x1483ca;_0x34b549['model']=_['keys'](db[_0x28ae('0x52')][_0x28ae('0x2d')]);_0x34b549[_0x28ae('0x31')]=_[_0x28ae('0x2f')](_0x504379[_0x28ae('0x31')]);_0x34b549['filters']=_[_0x28ae('0x49')](_0x34b549[_0x28ae('0x2e')],_0x34b549[_0x28ae('0x31')]);_0x40c3a8['attributes']=_[_0x28ae('0x49')](_0x34b549['model'],qs[_0x28ae('0x33')](_0x504379[_0x28ae('0x31')]['fields']));_0x40c3a8[_0x28ae('0x32')]=_0x40c3a8[_0x28ae('0x32')][_0x28ae('0x34')]?_0x40c3a8[_0x28ae('0x32')]:_0x34b549[_0x28ae('0x2e')];_0x40c3a8['order']=qs[_0x28ae('0x39')](_0x504379['query'][_0x28ae('0x39')]);_0x40c3a8[_0x28ae('0x3a')]=qs[_0x28ae('0x30')](_['pick'](_0x504379['query'],_0x34b549['filters']));if(_0x504379[_0x28ae('0x31')][_0x28ae('0x3c')]){_0x40c3a8['where']=_[_0x28ae('0x3d')](_0x40c3a8[_0x28ae('0x3a')],{'$or':_[_0x28ae('0x3e')](_0x40c3a8[_0x28ae('0x32')],function(_0x4206d7){var _0x3c0d83={};_0x3c0d83[_0x4206d7]={'$like':'%'+_0x504379[_0x28ae('0x31')]['filter']+'%'};return _0x3c0d83;})});}_0x40c3a8=_['merge']({},_0x40c3a8,_0x504379[_0x28ae('0x43')]);return _0xc0480c[_0x28ae('0x50')](_0x40c3a8);}})[_0x28ae('0x29')](function(_0x58c096){if(_0x58c096){_0x51eb58=_0x58c096['length'];if(!_0x504379[_0x28ae('0x31')][_0x28ae('0x53')]('nolimit')){_0x40c3a8[_0x28ae('0x36')]=qs['limit'](_0x504379[_0x28ae('0x31')][_0x28ae('0x36')]);_0x40c3a8[_0x28ae('0x37')]=qs[_0x28ae('0x37')](_0x504379[_0x28ae('0x31')]['offset']);}return _0xc0480c[_0x28ae('0x50')](_0x40c3a8);}})['then'](function(_0x5c5277){if(_0x5c5277){return _0x5c5277?{'count':_0x51eb58,'rows':_0x5c5277}:null;}})[_0x28ae('0x29')](respondWithResult(_0x4df882,null))[_0x28ae('0x48')](handleError(_0x4df882,null));};exports['addConfiguration']=function(_0x3f258c,_0x9197c3,_0x3159d7){if(_0x3f258c[_0x28ae('0x4d')]['id']){delete _0x3f258c[_0x28ae('0x4d')]['id'];}return db[_0x28ae('0x44')][_0x28ae('0x51')]({'where':{'id':_0x3f258c[_0x28ae('0x4f')]['id']}})[_0x28ae('0x29')](handleEntityNotFound(_0x9197c3,null))[_0x28ae('0x29')](function(_0x449904){if(_0x449904){_0x3f258c[_0x28ae('0x4d')][_0x28ae('0x54')]=_0x449904['id'];_0x3f258c['body'][_0x28ae('0x55')]=integrations[_0x28ae('0x56')](_0x3f258c[_0x28ae('0x4d')]['channel'],_0x3f258c[_0x28ae('0x4d')][_0x28ae('0x3f')]);_0x3f258c[_0x28ae('0x4d')][_0x28ae('0x57')]=integrations[_0x28ae('0x58')](_0x3f258c[_0x28ae('0x4d')][_0x28ae('0x59')],_0x3f258c[_0x28ae('0x4d')][_0x28ae('0x3f')]);return db[_0x28ae('0x52')][_0x28ae('0x4c')](_0x3f258c['body'],{'include':[{'model':db[_0x28ae('0x5a')],'as':_0x28ae('0x55')},{'model':db[_0x28ae('0x5a')],'as':'Descriptions'}]});}return null;})[_0x28ae('0x29')](respondWithResult(_0x9197c3,null))[_0x28ae('0x48')](handleError(_0x9197c3,null));};exports[_0x28ae('0x5b')]=function(_0x52b136,_0x316262,_0x24d2b4){var _0x15a590='';return db[_0x28ae('0x44')]['findOne']({'where':{'id':_0x52b136[_0x28ae('0x4f')]['id']},'attributes':['id',_0x28ae('0x5c'),_0x28ae('0x5d'),_0x28ae('0x5e'),_0x28ae('0x5f'),_0x28ae('0x60')]})[_0x28ae('0x29')](handleEntityNotFound(_0x316262,null))['then'](function(_0xf5790b){if(_0xf5790b){_0x15a590=_0xf5790b[_0x28ae('0x60')];var _0x2bf1ec=_0x15a590[_0x28ae('0x61')](-0x1);if(_0x2bf1ec==='/'){_0x15a590=_0x15a590[_0x28ae('0x62')](0x0,_0x15a590['lastIndexOf'](_0x2bf1ec));}var _0x28d921={'method':_0x28ae('0x63'),'uri':util['format'](_0x28ae('0x64'),_0x15a590,'ticket_fields'),'json':!![]};switch(_0xf5790b[_0x28ae('0x5f')]){case _0x28ae('0x5d'):_0x28d921[_0x28ae('0x65')]={'Authorization':util[_0x28ae('0x66')]('Basic\x20%s',new Buffer(util[_0x28ae('0x66')](_0x28ae('0x67'),_0xf5790b[_0x28ae('0x5c')],_0xf5790b['password']))['toString'](_0x28ae('0x68')))};break;case'token':_0x28d921[_0x28ae('0x65')]={'Authorization':util[_0x28ae('0x66')](_0x28ae('0x69'),new Buffer(util['format']('%s/token:%s',_0xf5790b['username'],_0xf5790b[_0x28ae('0x5e')]))[_0x28ae('0x6a')](_0x28ae('0x68')))};break;default:throw new db['Sequelize'][(_0x28ae('0x6b'))]('Unknown\x20authentication\x20type');}return rp(_0x28d921);}})[_0x28ae('0x29')](function(_0x570574){if(_0x570574){var _0x38425d=['subject','description','group',_0x28ae('0x6c')];_[_0x28ae('0x6d')](_0x570574[_0x28ae('0x6e')],function(_0x539bf8){return _0x38425d[_0x28ae('0x6f')](_0x539bf8[_0x28ae('0x3f')]);});return{'count':_0x570574['ticket_fields']['length'],'rows':_[_0x28ae('0x3e')](_0x570574['ticket_fields'],function(_0x1e8e4c){return{'id':_0x1e8e4c['id'],'name':_0x1e8e4c[_0x28ae('0x70')]>0x7?_0x1e8e4c[_0x28ae('0x71')]:_0x1e8e4c[_0x28ae('0x3f')],'custom':_0x1e8e4c[_0x28ae('0x70')]>0x7?!![]:![],'options':_0x1e8e4c[_0x28ae('0x72')]?_0x1e8e4c['system_field_options']:_0x1e8e4c[_0x28ae('0x73')]?_0x1e8e4c[_0x28ae('0x73')]:[]};})};}})[_0x28ae('0x29')](respondWithResult(_0x316262,null))['catch'](function(_0x4c5012){var _0x2e4467=_0x52b136[_0x28ae('0x31')][_0x28ae('0x74')]?0x1f4:_0x4c5012[_0x28ae('0x75')]||0x1f4;logger[_0x28ae('0x1d')]('getFields,\x20%s,\x20%s,\x20%s',_0x28ae('0x5b'),_0x2e4467,JSON[_0x28ae('0x1c')](_0x4c5012));delete _0x4c5012[_0x28ae('0x2b')];if(_0x2e4467===0x191){_0x2e4467=0x190;}_0x316262[_0x28ae('0x22')](_0x2e4467)['send'](_0x52b136[_0x28ae('0x31')][_0x28ae('0x74')]?{'message':_0x28ae('0x76'),'statusCode':_0x4c5012[_0x28ae('0x75')]}:_0x4c5012);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 50637d3..d4aaf39 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 _0x98fa=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','request-promise','./intZendeskAccount.attributes','exports','define'];(function(_0x4e1bed,_0x10ad73){var _0x3cb2b8=function(_0x381da7){while(--_0x381da7){_0x4e1bed['push'](_0x4e1bed['shift']());}};_0x3cb2b8(++_0x10ad73);}(_0x98fa,0x16a));var _0xa98f=function(_0x3c49f1,_0x61d4ef){_0x3c49f1=_0x3c49f1-0x0;var _0x48f240=_0x98fa[_0x3c49f1];return _0x48f240;};'use strict';var _=require(_0xa98f('0x0'));var util=require('util');var logger=require(_0xa98f('0x1'))(_0xa98f('0x2'));var moment=require('moment');var BPromise=require(_0xa98f('0x3'));var rp=require(_0xa98f('0x4'));var attributes=require(_0xa98f('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xa98f('0x6')]=function(_0x417d47,_0xec0f3d){return _0x417d47[_0xa98f('0x7')](_0xa98f('0x8'),attributes,{'tableName':_0xa98f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c81=['util','../../config/logger','api','moment','bluebird','request-promise','exports','int_zendesk_accounts'];(function(_0x55e148,_0x5975b1){var _0x8112e8=function(_0x2147ae){while(--_0x2147ae){_0x55e148['push'](_0x55e148['shift']());}};_0x8112e8(++_0x5975b1);}(_0x3c81,0x160));var _0x13c8=function(_0x59b62d,_0x35338f){_0x59b62d=_0x59b62d-0x0;var _0x5ec48f=_0x3c81[_0x59b62d];return _0x5ec48f;};'use strict';var _=require('lodash');var util=require(_0x13c8('0x0'));var logger=require(_0x13c8('0x1'))(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require(_0x13c8('0x4'));var rp=require(_0x13c8('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x13c8('0x6')]=function(_0x3bdb49,_0x3fec44){return _0x3bdb49['define']('ZendeskAccount',attributes,{'tableName':_0x13c8('0x7'),'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 da6af71..ccad455 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 _0x8095=['stringify','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowZendeskAccount','ZendeskAccount','find'];(function(_0x5bb803,_0x1d8b26){var _0x5bd35d=function(_0x31b6f7){while(--_0x31b6f7){_0x5bb803['push'](_0x5bb803['shift']());}};_0x5bd35d(++_0x1d8b26);}(_0x8095,0x121));var _0x5809=function(_0x1b5def,_0xa8d66){_0x1b5def=_0x1b5def-0x0;var _0x12bf02=_0x8095[_0x1b5def];return _0x12bf02;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5809('0x0'));var BPromise=require(_0x5809('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5809('0x2'));var db=require(_0x5809('0x3'))['db'];var utils=require(_0x5809('0x4'));var logger=require(_0x5809('0x5'))(_0x5809('0x6'));var config=require(_0x5809('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5809('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f346c,_0xfdca50,_0x27da04){return new BPromise(function(_0x59030f,_0x3d222e){return client[_0x5809('0x9')](_0x1f346c,_0x27da04)['then'](function(_0x25f3fd){logger[_0x5809('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0xfdca50,_0x5809('0xb'));logger[_0x5809('0xc')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xfdca50,_0x5809('0xb'),JSON['stringify'](_0x25f3fd));if(_0x25f3fd[_0x5809('0xd')]){if(_0x25f3fd[_0x5809('0xd')]['code']===0x1f4){logger[_0x5809('0xd')](_0x5809('0xe'),_0xfdca50,_0x25f3fd[_0x5809('0xd')]['message']);return _0x3d222e(_0x25f3fd['error'][_0x5809('0xf')]);}logger['error'](_0x5809('0xe'),_0xfdca50,_0x25f3fd[_0x5809('0xd')][_0x5809('0xf')]);return _0x59030f(_0x25f3fd[_0x5809('0xd')]['message']);}else{logger[_0x5809('0xa')](_0x5809('0xe'),_0xfdca50,_0x5809('0xb'));_0x59030f(_0x25f3fd[_0x5809('0x10')][_0x5809('0xf')]);}})[_0x5809('0x11')](function(_0x3eab4b){logger[_0x5809('0xd')](_0x5809('0xe'),_0xfdca50,_0x3eab4b);_0x3d222e(_0x3eab4b);});});}exports[_0x5809('0x12')]=function(_0x223211){var _0xff8d8f=this;return new Promise(function(_0x15419a,_0x41a6da){return db['ZendeskAccount'][_0x5809('0x13')]({'raw':_0x223211[_0x5809('0x14')]?_0x223211[_0x5809('0x14')][_0x5809('0x15')]===undefined?!![]:![]:!![],'where':_0x223211[_0x5809('0x14')]?_0x223211[_0x5809('0x14')][_0x5809('0x16')]||null:null,'attributes':_0x223211['options']?_0x223211[_0x5809('0x14')][_0x5809('0x17')]||null:null,'limit':_0x223211[_0x5809('0x14')]?_0x223211['options']['limit']||null:null,'include':_0x223211[_0x5809('0x14')]?_0x223211[_0x5809('0x14')][_0x5809('0x18')]?_[_0x5809('0x19')](_0x223211[_0x5809('0x14')][_0x5809('0x18')],function(_0x52ff3f){return{'model':db[_0x52ff3f[_0x5809('0x1a')]],'as':_0x52ff3f['as'],'attributes':_0x52ff3f[_0x5809('0x17')],'include':_0x52ff3f[_0x5809('0x18')]?_[_0x5809('0x19')](_0x52ff3f[_0x5809('0x18')],function(_0x162719){return{'model':db[_0x162719[_0x5809('0x1a')]],'as':_0x162719['as'],'attributes':_0x162719[_0x5809('0x17')],'include':_0x162719[_0x5809('0x18')]?_[_0x5809('0x19')](_0x162719[_0x5809('0x18')],function(_0x1bd30e){return{'model':db[_0x1bd30e[_0x5809('0x1a')]],'as':_0x1bd30e['as'],'attributes':_0x1bd30e[_0x5809('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5809('0x1b')](function(_0xb4d9e6){logger[_0x5809('0xa')](_0x5809('0x12'),_0x223211);logger[_0x5809('0xc')](_0x5809('0x12'),_0x223211,JSON['stringify'](_0xb4d9e6));_0x15419a(_0xb4d9e6);})[_0x5809('0x11')](function(_0x4c884f){logger[_0x5809('0xd')](_0x5809('0x12'),_0x4c884f['message'],_0x223211);_0x41a6da(_0xff8d8f['error'](0x1f4,_0x4c884f[_0x5809('0xf')]));});});};exports[_0x5809('0x1c')]=function(_0x3624d2){var _0x1d4553=this;return new Promise(function(_0x343867,_0x4cd477){return db[_0x5809('0x1d')][_0x5809('0x1e')]({'raw':_0x3624d2[_0x5809('0x14')]?_0x3624d2[_0x5809('0x14')][_0x5809('0x15')]===undefined?!![]:![]:!![],'where':_0x3624d2[_0x5809('0x14')]?_0x3624d2[_0x5809('0x14')]['where']||null:null,'attributes':_0x3624d2[_0x5809('0x14')]?_0x3624d2[_0x5809('0x14')][_0x5809('0x17')]||null:null,'include':_0x3624d2[_0x5809('0x14')]?_0x3624d2['options'][_0x5809('0x18')]?_[_0x5809('0x19')](_0x3624d2[_0x5809('0x14')][_0x5809('0x18')],function(_0x5e300d){return{'model':db[_0x5e300d[_0x5809('0x1a')]],'as':_0x5e300d['as'],'attributes':_0x5e300d[_0x5809('0x17')],'include':_0x5e300d[_0x5809('0x18')]?_[_0x5809('0x19')](_0x5e300d['include'],function(_0x4eb197){return{'model':db[_0x4eb197[_0x5809('0x1a')]],'as':_0x4eb197['as'],'attributes':_0x4eb197[_0x5809('0x17')],'include':_0x4eb197[_0x5809('0x18')]?_['map'](_0x4eb197[_0x5809('0x18')],function(_0x40ef09){return{'model':db[_0x40ef09['model']],'as':_0x40ef09['as'],'attributes':_0x40ef09[_0x5809('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5809('0x1b')](function(_0x3dd4e3){logger[_0x5809('0xa')](_0x5809('0x1c'),_0x3624d2);logger[_0x5809('0xc')](_0x5809('0x1c'),_0x3624d2,JSON[_0x5809('0x1f')](_0x3dd4e3));_0x343867(_0x3dd4e3);})[_0x5809('0x11')](function(_0x15620f){logger[_0x5809('0xd')](_0x5809('0x1c'),_0x15620f['message'],_0x3624d2);_0x4cd477(_0x1d4553[_0x5809('0xd')](0x1f4,_0x15620f['message']));});});}; \ No newline at end of file +var _0x1a0c=['../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','ZendeskAccount','findAll','options','where','attributes','include','map','model','raw','ShowZendeskAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1a0c,0xc0));var _0xc1a0=function(_0x4ad669,_0x4915e0){_0x4ad669=_0x4ad669-0x0;var _0x2c433b=_0x1a0c[_0x4ad669];return _0x2c433b;};'use strict';var _=require(_0xc1a0('0x0'));var util=require(_0xc1a0('0x1'));var moment=require('moment');var BPromise=require(_0xc1a0('0x2'));var rs=require(_0xc1a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1a0('0x4'))['db'];var utils=require(_0xc1a0('0x5'));var logger=require(_0xc1a0('0x6'))(_0xc1a0('0x7'));var config=require('../../config/environment');var jayson=require(_0xc1a0('0x8'));var client=jayson['client'][_0xc1a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56a955,_0x3bdba8,_0x4c5072){return new BPromise(function(_0x109f67,_0x1dbc7b){return client[_0xc1a0('0xa')](_0x56a955,_0x4c5072)[_0xc1a0('0xb')](function(_0x5be59d){logger[_0xc1a0('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x3bdba8,_0xc1a0('0xd'));logger[_0xc1a0('0xe')](_0xc1a0('0xf'),_0x3bdba8,_0xc1a0('0xd'),JSON[_0xc1a0('0x10')](_0x5be59d));if(_0x5be59d[_0xc1a0('0x11')]){if(_0x5be59d[_0xc1a0('0x11')][_0xc1a0('0x12')]===0x1f4){logger['error'](_0xc1a0('0x13'),_0x3bdba8,_0x5be59d[_0xc1a0('0x11')][_0xc1a0('0x14')]);return _0x1dbc7b(_0x5be59d[_0xc1a0('0x11')][_0xc1a0('0x14')]);}logger[_0xc1a0('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x3bdba8,_0x5be59d[_0xc1a0('0x11')][_0xc1a0('0x14')]);return _0x109f67(_0x5be59d['error'][_0xc1a0('0x14')]);}else{logger[_0xc1a0('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x3bdba8,_0xc1a0('0xd'));_0x109f67(_0x5be59d[_0xc1a0('0x15')][_0xc1a0('0x14')]);}})[_0xc1a0('0x16')](function(_0x8e4f5f){logger[_0xc1a0('0x11')](_0xc1a0('0x13'),_0x3bdba8,_0x8e4f5f);_0x1dbc7b(_0x8e4f5f);});});}exports['GetZendeskAccount']=function(_0x111c84){var _0x4cafc6=this;return new Promise(function(_0x4e5396,_0x5b7df3){return db[_0xc1a0('0x17')][_0xc1a0('0x18')]({'raw':_0x111c84[_0xc1a0('0x19')]?_0x111c84['options']['raw']===undefined?!![]:![]:!![],'where':_0x111c84['options']?_0x111c84[_0xc1a0('0x19')][_0xc1a0('0x1a')]||null:null,'attributes':_0x111c84[_0xc1a0('0x19')]?_0x111c84['options'][_0xc1a0('0x1b')]||null:null,'limit':_0x111c84[_0xc1a0('0x19')]?_0x111c84[_0xc1a0('0x19')]['limit']||null:null,'include':_0x111c84[_0xc1a0('0x19')]?_0x111c84[_0xc1a0('0x19')][_0xc1a0('0x1c')]?_[_0xc1a0('0x1d')](_0x111c84[_0xc1a0('0x19')]['include'],function(_0x1fb954){return{'model':db[_0x1fb954['model']],'as':_0x1fb954['as'],'attributes':_0x1fb954[_0xc1a0('0x1b')],'include':_0x1fb954[_0xc1a0('0x1c')]?_[_0xc1a0('0x1d')](_0x1fb954[_0xc1a0('0x1c')],function(_0x1e8318){return{'model':db[_0x1e8318[_0xc1a0('0x1e')]],'as':_0x1e8318['as'],'attributes':_0x1e8318[_0xc1a0('0x1b')],'include':_0x1e8318[_0xc1a0('0x1c')]?_[_0xc1a0('0x1d')](_0x1e8318['include'],function(_0x50a9e5){return{'model':db[_0x50a9e5[_0xc1a0('0x1e')]],'as':_0x50a9e5['as'],'attributes':_0x50a9e5[_0xc1a0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1a0('0xb')](function(_0x2d6f19){logger[_0xc1a0('0xc')]('GetZendeskAccount',_0x111c84);logger[_0xc1a0('0xe')]('GetZendeskAccount',_0x111c84,JSON[_0xc1a0('0x10')](_0x2d6f19));_0x4e5396(_0x2d6f19);})[_0xc1a0('0x16')](function(_0x2d86a5){logger[_0xc1a0('0x11')]('GetZendeskAccount',_0x2d86a5[_0xc1a0('0x14')],_0x111c84);_0x5b7df3(_0x4cafc6['error'](0x1f4,_0x2d86a5[_0xc1a0('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x4bd0f4){var _0xd730ea=this;return new Promise(function(_0x20ce07,_0x4a25d6){return db[_0xc1a0('0x17')]['find']({'raw':_0x4bd0f4[_0xc1a0('0x19')]?_0x4bd0f4[_0xc1a0('0x19')][_0xc1a0('0x1f')]===undefined?!![]:![]:!![],'where':_0x4bd0f4[_0xc1a0('0x19')]?_0x4bd0f4[_0xc1a0('0x19')][_0xc1a0('0x1a')]||null:null,'attributes':_0x4bd0f4[_0xc1a0('0x19')]?_0x4bd0f4[_0xc1a0('0x19')]['attributes']||null:null,'include':_0x4bd0f4[_0xc1a0('0x19')]?_0x4bd0f4['options'][_0xc1a0('0x1c')]?_[_0xc1a0('0x1d')](_0x4bd0f4[_0xc1a0('0x19')]['include'],function(_0x1cd0f2){return{'model':db[_0x1cd0f2[_0xc1a0('0x1e')]],'as':_0x1cd0f2['as'],'attributes':_0x1cd0f2['attributes'],'include':_0x1cd0f2[_0xc1a0('0x1c')]?_[_0xc1a0('0x1d')](_0x1cd0f2[_0xc1a0('0x1c')],function(_0x2faec3){return{'model':db[_0x2faec3[_0xc1a0('0x1e')]],'as':_0x2faec3['as'],'attributes':_0x2faec3[_0xc1a0('0x1b')],'include':_0x2faec3[_0xc1a0('0x1c')]?_['map'](_0x2faec3[_0xc1a0('0x1c')],function(_0x4740c2){return{'model':db[_0x4740c2[_0xc1a0('0x1e')]],'as':_0x4740c2['as'],'attributes':_0x4740c2[_0xc1a0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1a0('0xb')](function(_0x179c5b){logger[_0xc1a0('0xc')](_0xc1a0('0x20'),_0x4bd0f4);logger['debug'](_0xc1a0('0x20'),_0x4bd0f4,JSON['stringify'](_0x179c5b));_0x20ce07(_0x179c5b);})['catch'](function(_0x2c92a3){logger['error'](_0xc1a0('0x20'),_0x2c92a3['message'],_0x4bd0f4);_0x4a25d6(_0xd730ea[_0xc1a0('0x11')](0x1f4,_0x2c92a3[_0xc1a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1b8e1e8..46d5f93 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 _0xbba9=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xbba9,0xca));var _0x9bba=function(_0x42bc61,_0x4101d1){_0x42bc61=_0x42bc61-0x0;var _0x2b98e2=_0xbba9[_0x42bc61];return _0x2b98e2;};'use strict';var multer=require(_0x9bba('0x0'));var util=require('util');var path=require(_0x9bba('0x1'));var timeout=require(_0x9bba('0x2'));var express=require(_0x9bba('0x3'));var router=express[_0x9bba('0x4')]();var auth=require(_0x9bba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskConfiguration.controller');router[_0x9bba('0x6')]('/',auth[_0x9bba('0x7')](),controller[_0x9bba('0x8')]);router[_0x9bba('0x6')](_0x9bba('0x9'),auth[_0x9bba('0x7')](),controller[_0x9bba('0xa')]);router[_0x9bba('0x6')](_0x9bba('0xb'),auth[_0x9bba('0x7')](),controller[_0x9bba('0xc')]);router[_0x9bba('0x6')](_0x9bba('0xd'),auth[_0x9bba('0x7')](),controller[_0x9bba('0xe')]);router['get'](_0x9bba('0xf'),auth['isAuthenticated'](),controller[_0x9bba('0x10')]);router[_0x9bba('0x6')](_0x9bba('0x11'),auth[_0x9bba('0x7')](),controller[_0x9bba('0x12')]);router['post']('/',auth[_0x9bba('0x7')](),controller[_0x9bba('0x13')]);router[_0x9bba('0x14')](_0x9bba('0x11'),auth[_0x9bba('0x7')](),controller['setTags']);router['put']('/:id',auth[_0x9bba('0x7')](),controller[_0x9bba('0x15')]);router[_0x9bba('0x16')](_0x9bba('0x9'),auth[_0x9bba('0x7')](),controller[_0x9bba('0x17')]);module['exports']=router; \ No newline at end of file +var _0x4e17=['post','setTags','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x3ff563,_0x52b4f4){var _0x1a64cf=function(_0x13a726){while(--_0x13a726){_0x3ff563['push'](_0x3ff563['shift']());}};_0x1a64cf(++_0x52b4f4);}(_0x4e17,0x1ce));var _0x74e1=function(_0x3bc098,_0x5ada47){_0x3bc098=_0x3bc098-0x0;var _0x27e1bf=_0x4e17[_0x3bc098];return _0x27e1bf;};'use strict';var multer=require(_0x74e1('0x0'));var util=require(_0x74e1('0x1'));var path=require(_0x74e1('0x2'));var timeout=require(_0x74e1('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x74e1('0x4'));var config=require(_0x74e1('0x5'));var controller=require(_0x74e1('0x6'));router[_0x74e1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74e1('0x7')](_0x74e1('0x8'),auth[_0x74e1('0x9')](),controller[_0x74e1('0xa')]);router[_0x74e1('0x7')]('/:id/fields',auth[_0x74e1('0x9')](),controller[_0x74e1('0xb')]);router[_0x74e1('0x7')](_0x74e1('0xc'),auth[_0x74e1('0x9')](),controller[_0x74e1('0xd')]);router[_0x74e1('0x7')](_0x74e1('0xe'),auth[_0x74e1('0x9')](),controller[_0x74e1('0xf')]);router[_0x74e1('0x7')](_0x74e1('0x10'),auth[_0x74e1('0x9')](),controller[_0x74e1('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x74e1('0x12')](_0x74e1('0x10'),auth[_0x74e1('0x9')](),controller[_0x74e1('0x13')]);router[_0x74e1('0x14')]('/:id',auth[_0x74e1('0x9')](),controller['update']);router[_0x74e1('0x15')](_0x74e1('0x8'),auth[_0x74e1('0x9')](),controller[_0x74e1('0x16')]);module[_0x74e1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 58ab0e6..882c44e 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 _0x4533=['exports','STRING','sequelize'];(function(_0x11da92,_0x3387b7){var _0x626bff=function(_0xea1a16){while(--_0xea1a16){_0x11da92['push'](_0x11da92['shift']());}};_0x626bff(++_0x3387b7);}(_0x4533,0x98));var _0x3453=function(_0x392886,_0x56f1d5){_0x392886=_0x392886-0x0;var _0x2bc44e=_0x4533[_0x392886];return _0x2bc44e;};'use strict';var Sequelize=require(_0x3453('0x0'));module[_0x3453('0x1')]={'name':{'type':Sequelize[_0x3453('0x2')]},'description':{'type':Sequelize[_0x3453('0x2')]}}; \ No newline at end of file +var _0x4bb2=['sequelize','exports','STRING'];(function(_0x5d3336,_0x10fa7e){var _0x141747=function(_0x4f134a){while(--_0x4f134a){_0x5d3336['push'](_0x5d3336['shift']());}};_0x141747(++_0x10fa7e);}(_0x4bb2,0x19e));var _0x24bb=function(_0x379ba9,_0x1c4d06){_0x379ba9=_0x379ba9-0x0;var _0x3ab52f=_0x4bb2[_0x379ba9];return _0x3ab52f;};'use strict';var Sequelize=require(_0x24bb('0x0'));module[_0x24bb('0x1')]={'name':{'type':Sequelize[_0x24bb('0x2')]},'description':{'type':Sequelize[_0x24bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e4398ab..96c29d8 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 _0x9a6a=['findAll','rows','params','create','body','update','find','destroy','getFields','findOne','ZendeskField','order','map','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','stack','name','send','index','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','field','options','ZendeskConfiguration','includeAll','include'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x9a6a,0xce));var _0xa9a6=function(_0x133d80,_0xb98384){_0x133d80=_0x133d80-0x0;var _0x448b09=_0x9a6a[_0x133d80];return _0x448b09;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa9a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9a6('0x1'));var jsonpatch=require(_0xa9a6('0x2'));var rp=require('request-promise');var moment=require(_0xa9a6('0x3'));var BPromise=require(_0xa9a6('0x4'));var Mustache=require(_0xa9a6('0x5'));var util=require(_0xa9a6('0x6'));var path=require(_0xa9a6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa9a6('0x8'));var fs=require('fs');var _=require(_0xa9a6('0x9'));var squel=require(_0xa9a6('0xa'));var crypto=require(_0xa9a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa9a6('0xc'));var toCsv=require(_0xa9a6('0xd'));var querystring=require(_0xa9a6('0xe'));var Papa=require(_0xa9a6('0xf'));var authService=require(_0xa9a6('0x10'));var hardwareService=require(_0xa9a6('0x11'));var Redis=require(_0xa9a6('0x12'));var qs=require(_0xa9a6('0x13'));var logger=require(_0xa9a6('0x14'))(_0xa9a6('0x15'));var utils=require(_0xa9a6('0x16'));var config=require(_0xa9a6('0x17'));var db=require(_0xa9a6('0x18'))['db'];var jayson=require(_0xa9a6('0x19'));var client=jayson[_0xa9a6('0x1a')][_0xa9a6('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2d469a,_0x8a2d3c,_0x4bf75f,_0xc4e9fd){return new BPromise(function(_0x3fb570,_0x11356f){var _0x245517=_0xc4e9fd||client;return _0x245517['request'](_0x2d469a,_0x4bf75f)['then'](function(_0x12dd24){logger['info'](_0xa9a6('0x1c'),_0x8a2d3c,_0xa9a6('0x1d'));logger[_0xa9a6('0x1e')](_0xa9a6('0x1f'),_0x8a2d3c,_0xa9a6('0x1d'),JSON[_0xa9a6('0x20')](_0x12dd24));if(_0x12dd24[_0xa9a6('0x21')]){if(_0x12dd24[_0xa9a6('0x21')][_0xa9a6('0x22')]===0x1f4){logger[_0xa9a6('0x21')](_0xa9a6('0x1c'),_0x8a2d3c,_0x12dd24[_0xa9a6('0x21')][_0xa9a6('0x23')]);return _0x11356f(_0x12dd24[_0xa9a6('0x21')][_0xa9a6('0x23')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x8a2d3c,_0x12dd24[_0xa9a6('0x21')][_0xa9a6('0x23')]);return _0x3fb570(_0x12dd24[_0xa9a6('0x21')][_0xa9a6('0x23')]);}else{logger['info'](_0xa9a6('0x1c'),_0x8a2d3c,_0xa9a6('0x1d'));_0x3fb570(_0x12dd24[_0xa9a6('0x24')][_0xa9a6('0x23')]);}})[_0xa9a6('0x25')](function(_0x45ff9b){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x8a2d3c,_0x45ff9b);_0x11356f(_0x45ff9b);});});}function respondWithStatusCode(_0x14970d,_0x5c53b1){_0x5c53b1=_0x5c53b1||0xcc;return function(_0x3209a9){if(_0x3209a9){return _0x14970d[_0xa9a6('0x26')](_0x5c53b1);}return _0x14970d[_0xa9a6('0x27')](_0x5c53b1)[_0xa9a6('0x28')]();};}function respondWithResult(_0x10ea2d,_0x40f27d){_0x40f27d=_0x40f27d||0xc8;return function(_0x15e08c){if(_0x15e08c){return _0x10ea2d[_0xa9a6('0x27')](_0x40f27d)[_0xa9a6('0x29')](_0x15e08c);}};}function respondWithFilteredResult(_0x39af0b,_0x103f12){return function(_0x13604d){if(_0x13604d){var _0x5f4341=_0x13604d[_0xa9a6('0x2a')],_0x546ac0=_0x103f12[_0xa9a6('0x2b')],_0x4f65e6=_0x103f12[_0xa9a6('0x2b')]+_0x103f12[_0xa9a6('0x2c')],_0x4f4b89;if(_0x4f65e6>=_0x5f4341){_0x4f65e6=_0x5f4341;_0x4f4b89=0xc8;}else{_0x4f4b89=0xce;}_0x39af0b[_0xa9a6('0x27')](_0x4f4b89);return _0x39af0b[_0xa9a6('0x2d')]('Content-Range',_0x546ac0+'-'+_0x4f65e6+'/'+_0x5f4341)[_0xa9a6('0x29')](_0x13604d);}return null;};}function patchUpdates(_0x5517e9){return function(_0x159aba){try{jsonpatch['apply'](_0x159aba,_0x5517e9,!![]);}catch(_0x47e2ce){return BPromise[_0xa9a6('0x2e')](_0x47e2ce);}return _0x159aba[_0xa9a6('0x2f')]();};}function saveUpdates(_0x45ad6f,_0x46d21d){return function(_0x35d2e6){if(_0x35d2e6){return _0x35d2e6['update'](_0x45ad6f)[_0xa9a6('0x30')](function(_0x539d16){return _0x539d16;});}return null;};}function removeEntity(_0x1757c2,_0x25dcba){return function(_0x561c6c){if(_0x561c6c){return _0x561c6c['destroy']()[_0xa9a6('0x30')](function(){_0x1757c2[_0xa9a6('0x27')](0xcc)[_0xa9a6('0x28')]();});}};}function handleEntityNotFound(_0x3c24db,_0x33707c){return function(_0x4c6c03){if(!_0x4c6c03){_0x3c24db['sendStatus'](0x194);}return _0x4c6c03;};}function handleError(_0x128359,_0x160764){_0x160764=_0x160764||0x1f4;return function(_0x21eacd){logger[_0xa9a6('0x21')](_0x21eacd[_0xa9a6('0x31')]);if(_0x21eacd['name']){delete _0x21eacd[_0xa9a6('0x32')];}_0x128359[_0xa9a6('0x27')](_0x160764)[_0xa9a6('0x33')](_0x21eacd);};}exports[_0xa9a6('0x34')]=function(_0xaab0f7,_0x26f2a1){var _0x45c66b={},_0x2d0be0={},_0x1e9cb3={'count':0x0,'rows':[]};var _0x499157=db['ZendeskConfiguration'][_0xa9a6('0x35')];_0x2d0be0['model']=_['keys'](_0x499157);_0x2d0be0[_0xa9a6('0x36')]=_[_0xa9a6('0x37')](_0xaab0f7[_0xa9a6('0x36')]);_0x2d0be0[_0xa9a6('0x38')]=_[_0xa9a6('0x39')](_0x2d0be0[_0xa9a6('0x3a')],_0x2d0be0[_0xa9a6('0x36')]);_0x45c66b[_0xa9a6('0x3b')]=_[_0xa9a6('0x39')](_0x2d0be0['model'],qs[_0xa9a6('0x3c')](_0xaab0f7[_0xa9a6('0x36')][_0xa9a6('0x3c')]));_0x45c66b['attributes']=_0x45c66b[_0xa9a6('0x3b')][_0xa9a6('0x3d')]?_0x45c66b[_0xa9a6('0x3b')]:_0x2d0be0['model'];if(!_0xaab0f7[_0xa9a6('0x36')][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x45c66b[_0xa9a6('0x2c')]=qs[_0xa9a6('0x2c')](_0xaab0f7['query'][_0xa9a6('0x2c')]);_0x45c66b[_0xa9a6('0x2b')]=qs[_0xa9a6('0x2b')](_0xaab0f7['query']['offset']);}_0x45c66b['order']=qs[_0xa9a6('0x40')](_0xaab0f7[_0xa9a6('0x36')][_0xa9a6('0x40')]);_0x45c66b[_0xa9a6('0x41')]=qs['filters'](_[_0xa9a6('0x42')](_0xaab0f7[_0xa9a6('0x36')],_0x2d0be0[_0xa9a6('0x38')]));if(_0xaab0f7[_0xa9a6('0x36')][_0xa9a6('0x43')]){_0x45c66b[_0xa9a6('0x41')]=_[_0xa9a6('0x44')](_0x45c66b[_0xa9a6('0x41')],{'$or':_['map'](_0x499157,function(_0x11715b){if(_0x11715b[_0xa9a6('0x45')][_0xa9a6('0x46')]!=='VIRTUAL'){var _0x505691={};_0x505691[_0x11715b[_0xa9a6('0x47')]]={'$like':'%'+_0xaab0f7['query']['filter']+'%'};return _0x505691;}})});}_0x45c66b=_[_0xa9a6('0x44')]({},_0x45c66b,_0xaab0f7[_0xa9a6('0x48')]);var _0x68223b={'where':_0x45c66b[_0xa9a6('0x41')]};return db[_0xa9a6('0x49')][_0xa9a6('0x2a')](_0x68223b)[_0xa9a6('0x30')](function(_0x3dce03){_0x1e9cb3[_0xa9a6('0x2a')]=_0x3dce03;if(_0xaab0f7[_0xa9a6('0x36')][_0xa9a6('0x4a')]){_0x45c66b[_0xa9a6('0x4b')]=[{'all':!![]}];}return db[_0xa9a6('0x49')][_0xa9a6('0x4c')](_0x45c66b);})[_0xa9a6('0x30')](function(_0x4197ee){_0x1e9cb3[_0xa9a6('0x4d')]=_0x4197ee;return _0x1e9cb3;})[_0xa9a6('0x30')](respondWithFilteredResult(_0x26f2a1,_0x45c66b))[_0xa9a6('0x25')](handleError(_0x26f2a1,null));};exports['show']=function(_0x5c491b,_0x3a9ce3){var _0x1827a5={'raw':![],'where':{'id':_0x5c491b[_0xa9a6('0x4e')]['id']}},_0x432355={};_0x432355[_0xa9a6('0x3a')]=_[_0xa9a6('0x37')](db['ZendeskConfiguration'][_0xa9a6('0x35')]);_0x432355[_0xa9a6('0x36')]=_[_0xa9a6('0x37')](_0x5c491b['query']);_0x432355['filters']=_[_0xa9a6('0x39')](_0x432355[_0xa9a6('0x3a')],_0x432355[_0xa9a6('0x36')]);_0x1827a5[_0xa9a6('0x3b')]=_[_0xa9a6('0x39')](_0x432355[_0xa9a6('0x3a')],qs[_0xa9a6('0x3c')](_0x5c491b[_0xa9a6('0x36')][_0xa9a6('0x3c')]));_0x1827a5['attributes']=_0x1827a5[_0xa9a6('0x3b')][_0xa9a6('0x3d')]?_0x1827a5[_0xa9a6('0x3b')]:_0x432355[_0xa9a6('0x3a')];if(_0x5c491b[_0xa9a6('0x36')][_0xa9a6('0x4a')]){_0x1827a5['include']=[{'all':!![]}];}_0x1827a5=_['merge']({},_0x1827a5,_0x5c491b[_0xa9a6('0x48')]);return db['ZendeskConfiguration']['find'](_0x1827a5)[_0xa9a6('0x30')](handleEntityNotFound(_0x3a9ce3,null))[_0xa9a6('0x30')](respondWithResult(_0x3a9ce3,null))[_0xa9a6('0x25')](handleError(_0x3a9ce3,null));};exports[_0xa9a6('0x4f')]=function(_0x4f0059,_0x331ee2){return db[_0xa9a6('0x49')][_0xa9a6('0x4f')](_0x4f0059[_0xa9a6('0x50')],{})[_0xa9a6('0x30')](respondWithResult(_0x331ee2,0xc9))[_0xa9a6('0x25')](handleError(_0x331ee2,null));};exports[_0xa9a6('0x51')]=function(_0x5526e9,_0x15f0f6){if(_0x5526e9[_0xa9a6('0x50')]['id']){delete _0x5526e9[_0xa9a6('0x50')]['id'];}return db[_0xa9a6('0x49')][_0xa9a6('0x52')]({'where':{'id':_0x5526e9[_0xa9a6('0x4e')]['id']}})[_0xa9a6('0x30')](handleEntityNotFound(_0x15f0f6,null))[_0xa9a6('0x30')](saveUpdates(_0x5526e9['body'],null))[_0xa9a6('0x30')](respondWithResult(_0x15f0f6,null))[_0xa9a6('0x25')](handleError(_0x15f0f6,null));};exports[_0xa9a6('0x53')]=function(_0x415877,_0x4df639){return db['ZendeskConfiguration'][_0xa9a6('0x52')]({'where':{'id':_0x415877[_0xa9a6('0x4e')]['id']}})[_0xa9a6('0x30')](handleEntityNotFound(_0x4df639,null))[_0xa9a6('0x30')](removeEntity(_0x4df639,null))['catch'](handleError(_0x4df639,null));};exports[_0xa9a6('0x54')]=function(_0x13455,_0x1e3f1a,_0x1a2a21){var _0x26a23e={};var _0x111ff3={};var _0xdb3b32;var _0x5cbaa9;return db[_0xa9a6('0x49')][_0xa9a6('0x55')]({'where':{'id':_0x13455[_0xa9a6('0x4e')]['id']}})[_0xa9a6('0x30')](handleEntityNotFound(_0x1e3f1a,null))[_0xa9a6('0x30')](function(_0x3e722a){if(_0x3e722a){_0xdb3b32=_0x3e722a;_0x111ff3[_0xa9a6('0x3a')]=_[_0xa9a6('0x37')](db[_0xa9a6('0x56')][_0xa9a6('0x35')]);_0x111ff3[_0xa9a6('0x36')]=_[_0xa9a6('0x37')](_0x13455[_0xa9a6('0x36')]);_0x111ff3['filters']=_[_0xa9a6('0x39')](_0x111ff3['model'],_0x111ff3['query']);_0x26a23e['attributes']=_[_0xa9a6('0x39')](_0x111ff3['model'],qs[_0xa9a6('0x3c')](_0x13455[_0xa9a6('0x36')][_0xa9a6('0x3c')]));_0x26a23e['attributes']=_0x26a23e[_0xa9a6('0x3b')][_0xa9a6('0x3d')]?_0x26a23e[_0xa9a6('0x3b')]:_0x111ff3['model'];_0x26a23e[_0xa9a6('0x57')]=qs[_0xa9a6('0x40')](_0x13455[_0xa9a6('0x36')]['sort']);_0x26a23e['where']=qs['filters'](_['pick'](_0x13455[_0xa9a6('0x36')],_0x111ff3[_0xa9a6('0x38')]));if(_0x13455[_0xa9a6('0x36')][_0xa9a6('0x43')]){_0x26a23e[_0xa9a6('0x41')]=_[_0xa9a6('0x44')](_0x26a23e[_0xa9a6('0x41')],{'$or':_[_0xa9a6('0x58')](_0x26a23e[_0xa9a6('0x3b')],function(_0x12fbbc){var _0x3b7365={};_0x3b7365[_0x12fbbc]={'$like':'%'+_0x13455[_0xa9a6('0x36')][_0xa9a6('0x43')]+'%'};return _0x3b7365;})});}_0x26a23e=_[_0xa9a6('0x44')]({},_0x26a23e,_0x13455['options']);return _0xdb3b32[_0xa9a6('0x54')](_0x26a23e);}})[_0xa9a6('0x30')](function(_0x5c60e3){if(_0x5c60e3){_0x5cbaa9=_0x5c60e3['length'];if(!_0x13455[_0xa9a6('0x36')]['hasOwnProperty'](_0xa9a6('0x3f'))){_0x26a23e[_0xa9a6('0x2c')]=qs[_0xa9a6('0x2c')](_0x13455[_0xa9a6('0x36')][_0xa9a6('0x2c')]);_0x26a23e[_0xa9a6('0x2b')]=qs[_0xa9a6('0x2b')](_0x13455[_0xa9a6('0x36')][_0xa9a6('0x2b')]);}return _0xdb3b32['getFields'](_0x26a23e);}})[_0xa9a6('0x30')](function(_0x257c3f){if(_0x257c3f){return _0x257c3f?{'count':_0x5cbaa9,'rows':_0x257c3f}:null;}})[_0xa9a6('0x30')](respondWithResult(_0x1e3f1a,null))[_0xa9a6('0x25')](handleError(_0x1e3f1a,null));};exports[_0xa9a6('0x59')]=function(_0x3d3d6b,_0xcdd63e,_0x437d2d){var _0x3f21a0={};var _0x33eb1c={};var _0x39522c;var _0xdf28ee;return db[_0xa9a6('0x49')]['findOne']({'where':{'id':_0x3d3d6b[_0xa9a6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xcdd63e,null))['then'](function(_0x47f9fd){if(_0x47f9fd){_0x39522c=_0x47f9fd;_0x33eb1c[_0xa9a6('0x3a')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x33eb1c[_0xa9a6('0x36')]=_[_0xa9a6('0x37')](_0x3d3d6b['query']);_0x33eb1c['filters']=_[_0xa9a6('0x39')](_0x33eb1c[_0xa9a6('0x3a')],_0x33eb1c['query']);_0x3f21a0[_0xa9a6('0x3b')]=_[_0xa9a6('0x39')](_0x33eb1c['model'],qs[_0xa9a6('0x3c')](_0x3d3d6b['query'][_0xa9a6('0x3c')]));_0x3f21a0[_0xa9a6('0x3b')]=_0x3f21a0['attributes'][_0xa9a6('0x3d')]?_0x3f21a0[_0xa9a6('0x3b')]:_0x33eb1c[_0xa9a6('0x3a')];_0x3f21a0[_0xa9a6('0x57')]=qs[_0xa9a6('0x40')](_0x3d3d6b[_0xa9a6('0x36')][_0xa9a6('0x40')]);_0x3f21a0['where']=qs[_0xa9a6('0x38')](_[_0xa9a6('0x42')](_0x3d3d6b[_0xa9a6('0x36')],_0x33eb1c['filters']));if(_0x3d3d6b[_0xa9a6('0x36')][_0xa9a6('0x43')]){_0x3f21a0[_0xa9a6('0x41')]=_['merge'](_0x3f21a0[_0xa9a6('0x41')],{'$or':_[_0xa9a6('0x58')](_0x3f21a0[_0xa9a6('0x3b')],function(_0x161c27){var _0x35d5ed={};_0x35d5ed[_0x161c27]={'$like':'%'+_0x3d3d6b['query']['filter']+'%'};return _0x35d5ed;})});}_0x3f21a0=_[_0xa9a6('0x44')]({},_0x3f21a0,_0x3d3d6b[_0xa9a6('0x48')]);return _0x39522c[_0xa9a6('0x59')](_0x3f21a0);}})[_0xa9a6('0x30')](function(_0x955347){if(_0x955347){_0xdf28ee=_0x955347[_0xa9a6('0x3d')];if(!_0x3d3d6b[_0xa9a6('0x36')][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x3f21a0[_0xa9a6('0x2c')]=qs[_0xa9a6('0x2c')](_0x3d3d6b[_0xa9a6('0x36')][_0xa9a6('0x2c')]);_0x3f21a0[_0xa9a6('0x2b')]=qs[_0xa9a6('0x2b')](_0x3d3d6b['query'][_0xa9a6('0x2b')]);}return _0x39522c[_0xa9a6('0x59')](_0x3f21a0);}})[_0xa9a6('0x30')](function(_0x15250a){if(_0x15250a){return _0x15250a?{'count':_0xdf28ee,'rows':_0x15250a}:null;}})[_0xa9a6('0x30')](respondWithResult(_0xcdd63e,null))['catch'](handleError(_0xcdd63e,null));};exports[_0xa9a6('0x5a')]=function(_0x15b734,_0x2fbe19,_0x58f3a4){var _0x4940c6={};var _0x25b688={};var _0x4c5e48;var _0x198609;return db['ZendeskConfiguration'][_0xa9a6('0x55')]({'where':{'id':_0x15b734[_0xa9a6('0x4e')]['id']}})[_0xa9a6('0x30')](handleEntityNotFound(_0x2fbe19,null))[_0xa9a6('0x30')](function(_0x56090c){if(_0x56090c){_0x4c5e48=_0x56090c;_0x25b688[_0xa9a6('0x3a')]=_['keys'](db[_0xa9a6('0x56')][_0xa9a6('0x35')]);_0x25b688['query']=_[_0xa9a6('0x37')](_0x15b734[_0xa9a6('0x36')]);_0x25b688[_0xa9a6('0x38')]=_['intersection'](_0x25b688[_0xa9a6('0x3a')],_0x25b688[_0xa9a6('0x36')]);_0x4940c6['attributes']=_[_0xa9a6('0x39')](_0x25b688[_0xa9a6('0x3a')],qs['fields'](_0x15b734[_0xa9a6('0x36')][_0xa9a6('0x3c')]));_0x4940c6[_0xa9a6('0x3b')]=_0x4940c6[_0xa9a6('0x3b')][_0xa9a6('0x3d')]?_0x4940c6['attributes']:_0x25b688[_0xa9a6('0x3a')];_0x4940c6[_0xa9a6('0x57')]=qs['sort'](_0x15b734[_0xa9a6('0x36')]['sort']);_0x4940c6[_0xa9a6('0x41')]=qs[_0xa9a6('0x38')](_[_0xa9a6('0x42')](_0x15b734['query'],_0x25b688['filters']));if(_0x15b734[_0xa9a6('0x36')]['filter']){_0x4940c6[_0xa9a6('0x41')]=_[_0xa9a6('0x44')](_0x4940c6[_0xa9a6('0x41')],{'$or':_[_0xa9a6('0x58')](_0x4940c6[_0xa9a6('0x3b')],function(_0x3104b2){var _0x55a5e1={};_0x55a5e1[_0x3104b2]={'$like':'%'+_0x15b734['query'][_0xa9a6('0x43')]+'%'};return _0x55a5e1;})});}_0x4940c6=_[_0xa9a6('0x44')]({},_0x4940c6,_0x15b734[_0xa9a6('0x48')]);return _0x4c5e48[_0xa9a6('0x5a')](_0x4940c6);}})[_0xa9a6('0x30')](function(_0x45603c){if(_0x45603c){_0x198609=_0x45603c[_0xa9a6('0x3d')];if(!_0x15b734['query']['hasOwnProperty'](_0xa9a6('0x3f'))){_0x4940c6['limit']=qs[_0xa9a6('0x2c')](_0x15b734[_0xa9a6('0x36')][_0xa9a6('0x2c')]);_0x4940c6[_0xa9a6('0x2b')]=qs[_0xa9a6('0x2b')](_0x15b734[_0xa9a6('0x36')][_0xa9a6('0x2b')]);}return _0x4c5e48[_0xa9a6('0x5a')](_0x4940c6);}})[_0xa9a6('0x30')](function(_0x328871){if(_0x328871){return _0x328871?{'count':_0x198609,'rows':_0x328871}:null;}})[_0xa9a6('0x30')](respondWithResult(_0x2fbe19,null))['catch'](handleError(_0x2fbe19,null));};exports[_0xa9a6('0x5b')]=function(_0x351f36,_0xa92223,_0x518008){var _0x1159d1={};var _0x1bd130={};var _0x470aa9;var _0x8ec0d;return db[_0xa9a6('0x49')][_0xa9a6('0x55')]({'where':{'id':_0x351f36[_0xa9a6('0x4e')]['id']}})[_0xa9a6('0x30')](handleEntityNotFound(_0xa92223,null))[_0xa9a6('0x30')](function(_0xaa9ddd){if(_0xaa9ddd){_0x470aa9=_0xaa9ddd;_0x1bd130[_0xa9a6('0x3a')]=_[_0xa9a6('0x37')](db['Tag']['rawAttributes']);_0x1bd130['query']=_[_0xa9a6('0x37')](_0x351f36[_0xa9a6('0x36')]);_0x1bd130[_0xa9a6('0x38')]=_['intersection'](_0x1bd130[_0xa9a6('0x3a')],_0x1bd130[_0xa9a6('0x36')]);_0x1159d1[_0xa9a6('0x3b')]=_[_0xa9a6('0x39')](_0x1bd130[_0xa9a6('0x3a')],qs[_0xa9a6('0x3c')](_0x351f36[_0xa9a6('0x36')][_0xa9a6('0x3c')]));_0x1159d1['attributes']=_0x1159d1[_0xa9a6('0x3b')][_0xa9a6('0x3d')]?_0x1159d1[_0xa9a6('0x3b')]:_0x1bd130['model'];_0x1159d1[_0xa9a6('0x57')]=qs[_0xa9a6('0x40')](_0x351f36[_0xa9a6('0x36')]['sort']);_0x1159d1[_0xa9a6('0x41')]=qs[_0xa9a6('0x38')](_[_0xa9a6('0x42')](_0x351f36[_0xa9a6('0x36')],_0x1bd130[_0xa9a6('0x38')]));if(_0x351f36['query']['filter']){_0x1159d1['where']=_[_0xa9a6('0x44')](_0x1159d1[_0xa9a6('0x41')],{'$or':_[_0xa9a6('0x58')](_0x1159d1['attributes'],function(_0x52616d){var _0x3e6f6b={};_0x3e6f6b[_0x52616d]={'$like':'%'+_0x351f36[_0xa9a6('0x36')][_0xa9a6('0x43')]+'%'};return _0x3e6f6b;})});}_0x1159d1=_[_0xa9a6('0x44')]({},_0x1159d1,_0x351f36[_0xa9a6('0x48')]);return _0x470aa9[_0xa9a6('0x5b')](_0x1159d1);}})[_0xa9a6('0x30')](function(_0x3afa7d){if(_0x3afa7d){_0x8ec0d=_0x3afa7d[_0xa9a6('0x3d')];if(!_0x351f36['query'][_0xa9a6('0x3e')](_0xa9a6('0x3f'))){_0x1159d1[_0xa9a6('0x2c')]=qs[_0xa9a6('0x2c')](_0x351f36[_0xa9a6('0x36')]['limit']);_0x1159d1[_0xa9a6('0x2b')]=qs[_0xa9a6('0x2b')](_0x351f36[_0xa9a6('0x36')]['offset']);}return _0x470aa9[_0xa9a6('0x5b')](_0x1159d1);}})[_0xa9a6('0x30')](function(_0x2d8d0a){if(_0x2d8d0a){return _0x2d8d0a?{'count':_0x8ec0d,'rows':_0x2d8d0a}:null;}})[_0xa9a6('0x30')](respondWithResult(_0xa92223,null))['catch'](handleError(_0xa92223,null));};exports[_0xa9a6('0x5c')]=function(_0x4dd576,_0xcda175,_0x22fdd2){if(_0x4dd576[_0xa9a6('0x50')]['id']){delete _0x4dd576[_0xa9a6('0x50')]['id'];}return db[_0xa9a6('0x49')][_0xa9a6('0x55')]({'where':{'id':_0x4dd576['params']['id']}})['then'](handleEntityNotFound(_0xcda175,null))[_0xa9a6('0x30')](function(_0x4313bc){if(_0x4313bc){return _0x4313bc['setTags'](_0x4dd576[_0xa9a6('0x50')][_0xa9a6('0x5d')]||[]);}return null;})[_0xa9a6('0x30')](respondWithResult(_0xcda175,null))[_0xa9a6('0x25')](handleError(_0xcda175,null));}; \ No newline at end of file +var _0x4c87=['papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','save','stack','name','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','filter','merge','ZendeskConfiguration','includeAll','findAll','rows','rawAttributes','intersection','include','find','body','params','destroy','ZendeskField','options','getFields','findOne','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x31309c,_0x50ee05){var _0x150d58=function(_0xff6707){while(--_0xff6707){_0x31309c['push'](_0x31309c['shift']());}};_0x150d58(++_0x50ee05);}(_0x4c87,0x163));var _0x74c8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4c87[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x74c8('0x0'));var rimraf=require(_0x74c8('0x1'));var zipdir=require(_0x74c8('0x2'));var jsonpatch=require(_0x74c8('0x3'));var rp=require(_0x74c8('0x4'));var moment=require(_0x74c8('0x5'));var BPromise=require(_0x74c8('0x6'));var Mustache=require(_0x74c8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x74c8('0x8'));var csv=require(_0x74c8('0x9'));var ejs=require(_0x74c8('0xa'));var fs=require('fs');var _=require(_0x74c8('0xb'));var squel=require(_0x74c8('0xc'));var crypto=require(_0x74c8('0xd'));var jsforce=require(_0x74c8('0xe'));var deskjs=require(_0x74c8('0xf'));var toCsv=require(_0x74c8('0x9'));var querystring=require(_0x74c8('0x10'));var Papa=require(_0x74c8('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x74c8('0x12'));var Redis=require(_0x74c8('0x13'));var qs=require(_0x74c8('0x14'));var logger=require(_0x74c8('0x15'))(_0x74c8('0x16'));var utils=require(_0x74c8('0x17'));var config=require(_0x74c8('0x18'));var db=require(_0x74c8('0x19'))['db'];var jayson=require(_0x74c8('0x1a'));var client=jayson[_0x74c8('0x1b')][_0x74c8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x48e298,_0x1a5964,_0x37e503,_0x1459f7){return new BPromise(function(_0x3dd40d,_0x2e7b9f){var _0xccf78c=_0x1459f7||client;return _0xccf78c['request'](_0x48e298,_0x37e503)[_0x74c8('0x1d')](function(_0x40f00e){logger['info'](_0x74c8('0x1e'),_0x1a5964,_0x74c8('0x1f'));logger[_0x74c8('0x20')](_0x74c8('0x21'),_0x1a5964,_0x74c8('0x1f'),JSON[_0x74c8('0x22')](_0x40f00e));if(_0x40f00e[_0x74c8('0x23')]){if(_0x40f00e[_0x74c8('0x23')][_0x74c8('0x24')]===0x1f4){logger['error'](_0x74c8('0x1e'),_0x1a5964,_0x40f00e[_0x74c8('0x23')][_0x74c8('0x25')]);return _0x2e7b9f(_0x40f00e[_0x74c8('0x23')][_0x74c8('0x25')]);}logger[_0x74c8('0x23')](_0x74c8('0x1e'),_0x1a5964,_0x40f00e[_0x74c8('0x23')]['message']);return _0x3dd40d(_0x40f00e['error'][_0x74c8('0x25')]);}else{logger[_0x74c8('0x26')](_0x74c8('0x1e'),_0x1a5964,_0x74c8('0x1f'));_0x3dd40d(_0x40f00e[_0x74c8('0x27')][_0x74c8('0x25')]);}})[_0x74c8('0x28')](function(_0x444933){logger[_0x74c8('0x23')](_0x74c8('0x1e'),_0x1a5964,_0x444933);_0x2e7b9f(_0x444933);});});}function respondWithStatusCode(_0x5b2b89,_0xc04311){_0xc04311=_0xc04311||0xcc;return function(_0xb4594e){if(_0xb4594e){return _0x5b2b89[_0x74c8('0x29')](_0xc04311);}return _0x5b2b89['status'](_0xc04311)[_0x74c8('0x2a')]();};}function respondWithResult(_0x18404d,_0x11d20f){_0x11d20f=_0x11d20f||0xc8;return function(_0x4596b2){if(_0x4596b2){return _0x18404d['status'](_0x11d20f)[_0x74c8('0x2b')](_0x4596b2);}};}function respondWithFilteredResult(_0x37e7d9,_0x442e81){return function(_0x498314){if(_0x498314){var _0x1b0eab=_0x498314[_0x74c8('0x2c')],_0x346ca5=_0x442e81[_0x74c8('0x2d')],_0x8cd4b9=_0x442e81['offset']+_0x442e81[_0x74c8('0x2e')],_0x359683;if(_0x8cd4b9>=_0x1b0eab){_0x8cd4b9=_0x1b0eab;_0x359683=0xc8;}else{_0x359683=0xce;}_0x37e7d9['status'](_0x359683);return _0x37e7d9['set'](_0x74c8('0x2f'),_0x346ca5+'-'+_0x8cd4b9+'/'+_0x1b0eab)[_0x74c8('0x2b')](_0x498314);}return null;};}function patchUpdates(_0x377a99){return function(_0x4f59a1){try{jsonpatch[_0x74c8('0x30')](_0x4f59a1,_0x377a99,!![]);}catch(_0xd308d4){return BPromise[_0x74c8('0x31')](_0xd308d4);}return _0x4f59a1[_0x74c8('0x32')]();};}function saveUpdates(_0x3d1aaf,_0x335525){return function(_0x34a7c8){if(_0x34a7c8){return _0x34a7c8['update'](_0x3d1aaf)[_0x74c8('0x1d')](function(_0x4d8544){return _0x4d8544;});}return null;};}function removeEntity(_0x3f266b,_0x4f2c3b){return function(_0x2e5f56){if(_0x2e5f56){return _0x2e5f56['destroy']()[_0x74c8('0x1d')](function(){_0x3f266b['status'](0xcc)[_0x74c8('0x2a')]();});}};}function handleEntityNotFound(_0x23b3ce,_0x5ca433){return function(_0x1b4bba){if(!_0x1b4bba){_0x23b3ce['sendStatus'](0x194);}return _0x1b4bba;};}function handleError(_0x518e1c,_0x1727f0){_0x1727f0=_0x1727f0||0x1f4;return function(_0xf92ed0){logger['error'](_0xf92ed0[_0x74c8('0x33')]);if(_0xf92ed0[_0x74c8('0x34')]){delete _0xf92ed0[_0x74c8('0x34')];}_0x518e1c['status'](_0x1727f0)['send'](_0xf92ed0);};}exports['index']=function(_0xacb444,_0x26806b){var _0x3e1c7b={},_0x2c3bf3={},_0x17407d={'count':0x0,'rows':[]};var _0x333703=db['ZendeskConfiguration']['rawAttributes'];_0x2c3bf3[_0x74c8('0x35')]=_[_0x74c8('0x36')](_0x333703);_0x2c3bf3[_0x74c8('0x37')]=_[_0x74c8('0x36')](_0xacb444[_0x74c8('0x37')]);_0x2c3bf3[_0x74c8('0x38')]=_['intersection'](_0x2c3bf3['model'],_0x2c3bf3['query']);_0x3e1c7b[_0x74c8('0x39')]=_['intersection'](_0x2c3bf3[_0x74c8('0x35')],qs[_0x74c8('0x3a')](_0xacb444[_0x74c8('0x37')]['fields']));_0x3e1c7b[_0x74c8('0x39')]=_0x3e1c7b[_0x74c8('0x39')][_0x74c8('0x3b')]?_0x3e1c7b[_0x74c8('0x39')]:_0x2c3bf3[_0x74c8('0x35')];if(!_0xacb444[_0x74c8('0x37')][_0x74c8('0x3c')](_0x74c8('0x3d'))){_0x3e1c7b[_0x74c8('0x2e')]=qs[_0x74c8('0x2e')](_0xacb444['query'][_0x74c8('0x2e')]);_0x3e1c7b['offset']=qs['offset'](_0xacb444[_0x74c8('0x37')]['offset']);}_0x3e1c7b[_0x74c8('0x3e')]=qs['sort'](_0xacb444[_0x74c8('0x37')][_0x74c8('0x3f')]);_0x3e1c7b[_0x74c8('0x40')]=qs[_0x74c8('0x38')](_['pick'](_0xacb444[_0x74c8('0x37')],_0x2c3bf3['filters']));if(_0xacb444[_0x74c8('0x37')]['filter']){_0x3e1c7b[_0x74c8('0x40')]=_['merge'](_0x3e1c7b[_0x74c8('0x40')],{'$or':_[_0x74c8('0x41')](_0x333703,function(_0x5789a2){if(_0x5789a2[_0x74c8('0x42')][_0x74c8('0x43')]!==_0x74c8('0x44')){var _0x165ce0={};_0x165ce0[_0x5789a2['field']]={'$like':'%'+_0xacb444[_0x74c8('0x37')][_0x74c8('0x45')]+'%'};return _0x165ce0;}})});}_0x3e1c7b=_[_0x74c8('0x46')]({},_0x3e1c7b,_0xacb444['options']);var _0x50dc96={'where':_0x3e1c7b[_0x74c8('0x40')]};return db[_0x74c8('0x47')]['count'](_0x50dc96)[_0x74c8('0x1d')](function(_0xb19f38){_0x17407d[_0x74c8('0x2c')]=_0xb19f38;if(_0xacb444[_0x74c8('0x37')][_0x74c8('0x48')]){_0x3e1c7b['include']=[{'all':!![]}];}return db[_0x74c8('0x47')][_0x74c8('0x49')](_0x3e1c7b);})[_0x74c8('0x1d')](function(_0x260300){_0x17407d[_0x74c8('0x4a')]=_0x260300;return _0x17407d;})[_0x74c8('0x1d')](respondWithFilteredResult(_0x26806b,_0x3e1c7b))[_0x74c8('0x28')](handleError(_0x26806b,null));};exports['show']=function(_0x385d9f,_0xa079d0){var _0x5a0123={'raw':![],'where':{'id':_0x385d9f['params']['id']}},_0x4e0d2c={};_0x4e0d2c['model']=_['keys'](db[_0x74c8('0x47')][_0x74c8('0x4b')]);_0x4e0d2c[_0x74c8('0x37')]=_['keys'](_0x385d9f[_0x74c8('0x37')]);_0x4e0d2c['filters']=_[_0x74c8('0x4c')](_0x4e0d2c[_0x74c8('0x35')],_0x4e0d2c[_0x74c8('0x37')]);_0x5a0123[_0x74c8('0x39')]=_[_0x74c8('0x4c')](_0x4e0d2c[_0x74c8('0x35')],qs[_0x74c8('0x3a')](_0x385d9f[_0x74c8('0x37')][_0x74c8('0x3a')]));_0x5a0123[_0x74c8('0x39')]=_0x5a0123['attributes'][_0x74c8('0x3b')]?_0x5a0123['attributes']:_0x4e0d2c['model'];if(_0x385d9f['query'][_0x74c8('0x48')]){_0x5a0123[_0x74c8('0x4d')]=[{'all':!![]}];}_0x5a0123=_[_0x74c8('0x46')]({},_0x5a0123,_0x385d9f['options']);return db[_0x74c8('0x47')][_0x74c8('0x4e')](_0x5a0123)[_0x74c8('0x1d')](handleEntityNotFound(_0xa079d0,null))[_0x74c8('0x1d')](respondWithResult(_0xa079d0,null))['catch'](handleError(_0xa079d0,null));};exports['create']=function(_0x88a154,_0x3011b0){return db['ZendeskConfiguration']['create'](_0x88a154[_0x74c8('0x4f')],{})[_0x74c8('0x1d')](respondWithResult(_0x3011b0,0xc9))[_0x74c8('0x28')](handleError(_0x3011b0,null));};exports['update']=function(_0x157adc,_0x335429){if(_0x157adc['body']['id']){delete _0x157adc[_0x74c8('0x4f')]['id'];}return db[_0x74c8('0x47')]['find']({'where':{'id':_0x157adc[_0x74c8('0x50')]['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x335429,null))['then'](saveUpdates(_0x157adc[_0x74c8('0x4f')],null))[_0x74c8('0x1d')](respondWithResult(_0x335429,null))[_0x74c8('0x28')](handleError(_0x335429,null));};exports[_0x74c8('0x51')]=function(_0x18ec99,_0x993a79){return db[_0x74c8('0x47')]['find']({'where':{'id':_0x18ec99[_0x74c8('0x50')]['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x993a79,null))['then'](removeEntity(_0x993a79,null))[_0x74c8('0x28')](handleError(_0x993a79,null));};exports['getFields']=function(_0x257bde,_0x1a9f39,_0x21f0a2){var _0x261be9={};var _0x31bb85={};var _0x16e0b4;var _0x518ab0;return db[_0x74c8('0x47')]['findOne']({'where':{'id':_0x257bde['params']['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x1a9f39,null))[_0x74c8('0x1d')](function(_0x40ccb8){if(_0x40ccb8){_0x16e0b4=_0x40ccb8;_0x31bb85[_0x74c8('0x35')]=_['keys'](db[_0x74c8('0x52')][_0x74c8('0x4b')]);_0x31bb85[_0x74c8('0x37')]=_[_0x74c8('0x36')](_0x257bde[_0x74c8('0x37')]);_0x31bb85[_0x74c8('0x38')]=_[_0x74c8('0x4c')](_0x31bb85[_0x74c8('0x35')],_0x31bb85['query']);_0x261be9['attributes']=_[_0x74c8('0x4c')](_0x31bb85['model'],qs[_0x74c8('0x3a')](_0x257bde[_0x74c8('0x37')][_0x74c8('0x3a')]));_0x261be9['attributes']=_0x261be9['attributes'][_0x74c8('0x3b')]?_0x261be9['attributes']:_0x31bb85[_0x74c8('0x35')];_0x261be9[_0x74c8('0x3e')]=qs['sort'](_0x257bde[_0x74c8('0x37')][_0x74c8('0x3f')]);_0x261be9[_0x74c8('0x40')]=qs[_0x74c8('0x38')](_['pick'](_0x257bde[_0x74c8('0x37')],_0x31bb85[_0x74c8('0x38')]));if(_0x257bde[_0x74c8('0x37')][_0x74c8('0x45')]){_0x261be9[_0x74c8('0x40')]=_[_0x74c8('0x46')](_0x261be9[_0x74c8('0x40')],{'$or':_[_0x74c8('0x41')](_0x261be9[_0x74c8('0x39')],function(_0x300729){var _0x17391b={};_0x17391b[_0x300729]={'$like':'%'+_0x257bde[_0x74c8('0x37')][_0x74c8('0x45')]+'%'};return _0x17391b;})});}_0x261be9=_[_0x74c8('0x46')]({},_0x261be9,_0x257bde[_0x74c8('0x53')]);return _0x16e0b4[_0x74c8('0x54')](_0x261be9);}})[_0x74c8('0x1d')](function(_0x51cfb2){if(_0x51cfb2){_0x518ab0=_0x51cfb2[_0x74c8('0x3b')];if(!_0x257bde[_0x74c8('0x37')][_0x74c8('0x3c')](_0x74c8('0x3d'))){_0x261be9['limit']=qs[_0x74c8('0x2e')](_0x257bde[_0x74c8('0x37')][_0x74c8('0x2e')]);_0x261be9['offset']=qs[_0x74c8('0x2d')](_0x257bde['query']['offset']);}return _0x16e0b4['getFields'](_0x261be9);}})[_0x74c8('0x1d')](function(_0x1f6e1b){if(_0x1f6e1b){return _0x1f6e1b?{'count':_0x518ab0,'rows':_0x1f6e1b}:null;}})[_0x74c8('0x1d')](respondWithResult(_0x1a9f39,null))['catch'](handleError(_0x1a9f39,null));};exports['getSubjects']=function(_0x4802af,_0x11dd6d,_0x4f15da){var _0x538d29={};var _0x3bb490={};var _0x34d315;var _0x5d4ba7;return db[_0x74c8('0x47')][_0x74c8('0x55')]({'where':{'id':_0x4802af[_0x74c8('0x50')]['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x11dd6d,null))[_0x74c8('0x1d')](function(_0x9d6751){if(_0x9d6751){_0x34d315=_0x9d6751;_0x3bb490[_0x74c8('0x35')]=_[_0x74c8('0x36')](db[_0x74c8('0x52')][_0x74c8('0x4b')]);_0x3bb490[_0x74c8('0x37')]=_[_0x74c8('0x36')](_0x4802af[_0x74c8('0x37')]);_0x3bb490[_0x74c8('0x38')]=_[_0x74c8('0x4c')](_0x3bb490[_0x74c8('0x35')],_0x3bb490[_0x74c8('0x37')]);_0x538d29['attributes']=_['intersection'](_0x3bb490[_0x74c8('0x35')],qs[_0x74c8('0x3a')](_0x4802af[_0x74c8('0x37')][_0x74c8('0x3a')]));_0x538d29[_0x74c8('0x39')]=_0x538d29[_0x74c8('0x39')][_0x74c8('0x3b')]?_0x538d29['attributes']:_0x3bb490[_0x74c8('0x35')];_0x538d29[_0x74c8('0x3e')]=qs[_0x74c8('0x3f')](_0x4802af[_0x74c8('0x37')][_0x74c8('0x3f')]);_0x538d29[_0x74c8('0x40')]=qs[_0x74c8('0x38')](_[_0x74c8('0x56')](_0x4802af[_0x74c8('0x37')],_0x3bb490['filters']));if(_0x4802af[_0x74c8('0x37')][_0x74c8('0x45')]){_0x538d29['where']=_[_0x74c8('0x46')](_0x538d29[_0x74c8('0x40')],{'$or':_['map'](_0x538d29[_0x74c8('0x39')],function(_0x39ad68){var _0xe6ce={};_0xe6ce[_0x39ad68]={'$like':'%'+_0x4802af[_0x74c8('0x37')]['filter']+'%'};return _0xe6ce;})});}_0x538d29=_[_0x74c8('0x46')]({},_0x538d29,_0x4802af['options']);return _0x34d315[_0x74c8('0x57')](_0x538d29);}})[_0x74c8('0x1d')](function(_0x453f1d){if(_0x453f1d){_0x5d4ba7=_0x453f1d[_0x74c8('0x3b')];if(!_0x4802af[_0x74c8('0x37')][_0x74c8('0x3c')]('nolimit')){_0x538d29[_0x74c8('0x2e')]=qs['limit'](_0x4802af[_0x74c8('0x37')]['limit']);_0x538d29[_0x74c8('0x2d')]=qs['offset'](_0x4802af[_0x74c8('0x37')][_0x74c8('0x2d')]);}return _0x34d315['getSubjects'](_0x538d29);}})[_0x74c8('0x1d')](function(_0x19d884){if(_0x19d884){return _0x19d884?{'count':_0x5d4ba7,'rows':_0x19d884}:null;}})[_0x74c8('0x1d')](respondWithResult(_0x11dd6d,null))['catch'](handleError(_0x11dd6d,null));};exports[_0x74c8('0x58')]=function(_0x6428e1,_0x18ca5b,_0x5a5600){var _0x2426d9={};var _0x3e09e4={};var _0x12a2a9;var _0xd30d07;return db['ZendeskConfiguration'][_0x74c8('0x55')]({'where':{'id':_0x6428e1['params']['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x18ca5b,null))[_0x74c8('0x1d')](function(_0x5ab86f){if(_0x5ab86f){_0x12a2a9=_0x5ab86f;_0x3e09e4[_0x74c8('0x35')]=_['keys'](db[_0x74c8('0x52')]['rawAttributes']);_0x3e09e4[_0x74c8('0x37')]=_[_0x74c8('0x36')](_0x6428e1['query']);_0x3e09e4['filters']=_['intersection'](_0x3e09e4[_0x74c8('0x35')],_0x3e09e4[_0x74c8('0x37')]);_0x2426d9[_0x74c8('0x39')]=_[_0x74c8('0x4c')](_0x3e09e4[_0x74c8('0x35')],qs[_0x74c8('0x3a')](_0x6428e1['query'][_0x74c8('0x3a')]));_0x2426d9[_0x74c8('0x39')]=_0x2426d9[_0x74c8('0x39')][_0x74c8('0x3b')]?_0x2426d9['attributes']:_0x3e09e4[_0x74c8('0x35')];_0x2426d9[_0x74c8('0x3e')]=qs['sort'](_0x6428e1[_0x74c8('0x37')][_0x74c8('0x3f')]);_0x2426d9[_0x74c8('0x40')]=qs[_0x74c8('0x38')](_[_0x74c8('0x56')](_0x6428e1['query'],_0x3e09e4[_0x74c8('0x38')]));if(_0x6428e1[_0x74c8('0x37')][_0x74c8('0x45')]){_0x2426d9[_0x74c8('0x40')]=_[_0x74c8('0x46')](_0x2426d9['where'],{'$or':_[_0x74c8('0x41')](_0x2426d9[_0x74c8('0x39')],function(_0x3c3e8c){var _0x39cbb5={};_0x39cbb5[_0x3c3e8c]={'$like':'%'+_0x6428e1[_0x74c8('0x37')][_0x74c8('0x45')]+'%'};return _0x39cbb5;})});}_0x2426d9=_['merge']({},_0x2426d9,_0x6428e1[_0x74c8('0x53')]);return _0x12a2a9[_0x74c8('0x58')](_0x2426d9);}})[_0x74c8('0x1d')](function(_0x544c37){if(_0x544c37){_0xd30d07=_0x544c37[_0x74c8('0x3b')];if(!_0x6428e1[_0x74c8('0x37')][_0x74c8('0x3c')]('nolimit')){_0x2426d9[_0x74c8('0x2e')]=qs[_0x74c8('0x2e')](_0x6428e1[_0x74c8('0x37')][_0x74c8('0x2e')]);_0x2426d9[_0x74c8('0x2d')]=qs['offset'](_0x6428e1['query'][_0x74c8('0x2d')]);}return _0x12a2a9['getDescriptions'](_0x2426d9);}})['then'](function(_0x684cb0){if(_0x684cb0){return _0x684cb0?{'count':_0xd30d07,'rows':_0x684cb0}:null;}})[_0x74c8('0x1d')](respondWithResult(_0x18ca5b,null))[_0x74c8('0x28')](handleError(_0x18ca5b,null));};exports[_0x74c8('0x59')]=function(_0x5f2c6e,_0x202680,_0x4109cf){var _0x5a3611={};var _0x1934e6={};var _0x11d309;var _0x21d965;return db[_0x74c8('0x47')]['findOne']({'where':{'id':_0x5f2c6e[_0x74c8('0x50')]['id']}})['then'](handleEntityNotFound(_0x202680,null))[_0x74c8('0x1d')](function(_0x527ef0){if(_0x527ef0){_0x11d309=_0x527ef0;_0x1934e6[_0x74c8('0x35')]=_['keys'](db[_0x74c8('0x5a')][_0x74c8('0x4b')]);_0x1934e6[_0x74c8('0x37')]=_[_0x74c8('0x36')](_0x5f2c6e[_0x74c8('0x37')]);_0x1934e6[_0x74c8('0x38')]=_[_0x74c8('0x4c')](_0x1934e6[_0x74c8('0x35')],_0x1934e6['query']);_0x5a3611[_0x74c8('0x39')]=_[_0x74c8('0x4c')](_0x1934e6[_0x74c8('0x35')],qs[_0x74c8('0x3a')](_0x5f2c6e['query'][_0x74c8('0x3a')]));_0x5a3611[_0x74c8('0x39')]=_0x5a3611[_0x74c8('0x39')]['length']?_0x5a3611[_0x74c8('0x39')]:_0x1934e6[_0x74c8('0x35')];_0x5a3611[_0x74c8('0x3e')]=qs['sort'](_0x5f2c6e[_0x74c8('0x37')]['sort']);_0x5a3611['where']=qs[_0x74c8('0x38')](_[_0x74c8('0x56')](_0x5f2c6e[_0x74c8('0x37')],_0x1934e6['filters']));if(_0x5f2c6e[_0x74c8('0x37')][_0x74c8('0x45')]){_0x5a3611['where']=_[_0x74c8('0x46')](_0x5a3611[_0x74c8('0x40')],{'$or':_[_0x74c8('0x41')](_0x5a3611[_0x74c8('0x39')],function(_0x1d2f8e){var _0x583615={};_0x583615[_0x1d2f8e]={'$like':'%'+_0x5f2c6e[_0x74c8('0x37')][_0x74c8('0x45')]+'%'};return _0x583615;})});}_0x5a3611=_[_0x74c8('0x46')]({},_0x5a3611,_0x5f2c6e[_0x74c8('0x53')]);return _0x11d309['getTags'](_0x5a3611);}})['then'](function(_0x32f1d9){if(_0x32f1d9){_0x21d965=_0x32f1d9[_0x74c8('0x3b')];if(!_0x5f2c6e[_0x74c8('0x37')][_0x74c8('0x3c')](_0x74c8('0x3d'))){_0x5a3611[_0x74c8('0x2e')]=qs['limit'](_0x5f2c6e[_0x74c8('0x37')][_0x74c8('0x2e')]);_0x5a3611[_0x74c8('0x2d')]=qs['offset'](_0x5f2c6e['query']['offset']);}return _0x11d309[_0x74c8('0x59')](_0x5a3611);}})[_0x74c8('0x1d')](function(_0x5a1e68){if(_0x5a1e68){return _0x5a1e68?{'count':_0x21d965,'rows':_0x5a1e68}:null;}})[_0x74c8('0x1d')](respondWithResult(_0x202680,null))[_0x74c8('0x28')](handleError(_0x202680,null));};exports[_0x74c8('0x5b')]=function(_0x3ffd4b,_0x5c78f6,_0x30b936){if(_0x3ffd4b['body']['id']){delete _0x3ffd4b[_0x74c8('0x4f')]['id'];}return db['ZendeskConfiguration'][_0x74c8('0x55')]({'where':{'id':_0x3ffd4b['params']['id']}})[_0x74c8('0x1d')](handleEntityNotFound(_0x5c78f6,null))[_0x74c8('0x1d')](function(_0x4919a7){if(_0x4919a7){return _0x4919a7[_0x74c8('0x5b')](_0x3ffd4b['body'][_0x74c8('0x5c')]||[]);}return null;})[_0x74c8('0x1d')](respondWithResult(_0x5c78f6,null))[_0x74c8('0x28')](handleError(_0x5c78f6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index fca58b6..0dbcd2e 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 _0x721d=['../../config/logger','api','bluebird','request-promise','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','util'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0x721d,0x19d));var _0xd721=function(_0xb08792,_0x298252){_0xb08792=_0xb08792-0x0;var _0x2d9992=_0x721d[_0xb08792];return _0x2d9992;};'use strict';var _=require('lodash');var util=require(_0xd721('0x0'));var logger=require(_0xd721('0x1'))(_0xd721('0x2'));var moment=require('moment');var BPromise=require(_0xd721('0x3'));var rp=require(_0xd721('0x4'));var attributes=require(_0xd721('0x5'));module[_0xd721('0x6')]=function(_0x4f33a7,_0x353f5b){return _0x4f33a7[_0xd721('0x7')](_0xd721('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x807b=['./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x807b,0x17e));var _0xb807=function(_0x344089,_0x481955){_0x344089=_0x344089-0x0;var _0x27b276=_0x807b[_0x344089];return _0x27b276;};'use strict';var _=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var moment=require(_0xb807('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xb807('0x5'));module[_0xb807('0x6')]=function(_0x240a90,_0x31275d){return _0x240a90[_0xb807('0x7')]('ZendeskConfiguration',attributes,{'tableName':_0xb807('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 3f20d5c..cc2270f 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 _0x00f4=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x437161,_0x589640){var _0x3ff93d=function(_0x15954e){while(--_0x15954e){_0x437161['push'](_0x437161['shift']());}};_0x3ff93d(++_0x589640);}(_0x00f4,0x125));var _0x400f=function(_0x108191,_0x4fff25){_0x108191=_0x108191-0x0;var _0xf25143=_0x00f4[_0x108191];return _0xf25143;};'use strict';var _=require(_0x400f('0x0'));var util=require(_0x400f('0x1'));var moment=require(_0x400f('0x2'));var BPromise=require(_0x400f('0x3'));var rs=require(_0x400f('0x4'));var fs=require('fs');var Redis=require(_0x400f('0x5'));var db=require(_0x400f('0x6'))['db'];var utils=require(_0x400f('0x7'));var logger=require('../../config/logger')(_0x400f('0x8'));var config=require(_0x400f('0x9'));var jayson=require(_0x400f('0xa'));var client=jayson['client'][_0x400f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5fd2,_0x5c9426,_0x1df47a){return new BPromise(function(_0x54674c,_0x22f98d){return client[_0x400f('0xc')](_0x4f5fd2,_0x1df47a)['then'](function(_0x2562b8){logger[_0x400f('0xd')](_0x400f('0xe'),_0x5c9426,_0x400f('0xf'));logger[_0x400f('0x10')](_0x400f('0x11'),_0x5c9426,_0x400f('0xf'),JSON[_0x400f('0x12')](_0x2562b8));if(_0x2562b8[_0x400f('0x13')]){if(_0x2562b8['error'][_0x400f('0x14')]===0x1f4){logger[_0x400f('0x13')](_0x400f('0xe'),_0x5c9426,_0x2562b8[_0x400f('0x13')]['message']);return _0x22f98d(_0x2562b8['error'][_0x400f('0x15')]);}logger[_0x400f('0x13')](_0x400f('0xe'),_0x5c9426,_0x2562b8[_0x400f('0x13')][_0x400f('0x15')]);return _0x54674c(_0x2562b8['error'][_0x400f('0x15')]);}else{logger[_0x400f('0xd')](_0x400f('0xe'),_0x5c9426,_0x400f('0xf'));_0x54674c(_0x2562b8['result'][_0x400f('0x15')]);}})['catch'](function(_0x24d395){logger[_0x400f('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5c9426,_0x24d395);_0x22f98d(_0x24d395);});});} \ No newline at end of file +var _0x9ac7=['code','message','info','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','request\x20sent','error'];(function(_0x5f4032,_0xfbc4e8){var _0x4a85ff=function(_0x166798){while(--_0x166798){_0x5f4032['push'](_0x5f4032['shift']());}};_0x4a85ff(++_0xfbc4e8);}(_0x9ac7,0xd1));var _0x79ac=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9ac7[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x79ac('0x0'));var util=require(_0x79ac('0x1'));var moment=require(_0x79ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x79ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x79ac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x79ac('0x6'));var client=jayson[_0x79ac('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50aa6e,_0x5f56a1,_0x47d7e1){return new BPromise(function(_0x2b4486,_0x39e631){return client[_0x79ac('0x8')](_0x50aa6e,_0x47d7e1)[_0x79ac('0x9')](function(_0x4bedf5){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5f56a1,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5f56a1,_0x79ac('0xa'),JSON['stringify'](_0x4bedf5));if(_0x4bedf5['error']){if(_0x4bedf5[_0x79ac('0xb')][_0x79ac('0xc')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5f56a1,_0x4bedf5['error']['message']);return _0x39e631(_0x4bedf5[_0x79ac('0xb')][_0x79ac('0xd')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5f56a1,_0x4bedf5[_0x79ac('0xb')][_0x79ac('0xd')]);return _0x2b4486(_0x4bedf5[_0x79ac('0xb')][_0x79ac('0xd')]);}else{logger[_0x79ac('0xe')](_0x79ac('0xf'),_0x5f56a1,_0x79ac('0xa'));_0x2b4486(_0x4bedf5['result']['message']);}})[_0x79ac('0x10')](function(_0x389d08){logger[_0x79ac('0xb')](_0x79ac('0xf'),_0x5f56a1,_0x389d08);_0x39e631(_0x389d08);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index bf4c64b..f770ea6 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x248049,_0x4cf59e){var _0x128f09=function(_0x4ceac4){while(--_0x4ceac4){_0x248049['push'](_0x248049['shift']());}};_0x128f09(++_0x4cf59e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x144796,_0x292257){var _0x519c6a=function(_0x18eee7){while(--_0x18eee7){_0x144796['push'](_0x144796['shift']());}};_0x519c6a(++_0x292257);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index db8aace..15b8be8 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 _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x3827dd,_0x403c57){var _0x52308d=function(_0x2d63e3){while(--_0x2d63e3){_0x3827dd['push'](_0x3827dd['shift']());}};_0x52308d(++_0x403c57);}(_0xd64b,0xc1));var _0xbd64=function(_0x1702b8,_0x28c7da){_0x1702b8=_0x1702b8-0x0;var _0x50028a=_0xd64b[_0x1702b8];return _0x50028a;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file +var _0x4522=['STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0x4d509e,_0x5dd35d){var _0x3de688=function(_0x410e8f){while(--_0x410e8f){_0x4d509e['push'](_0x4d509e['shift']());}};_0x3de688(++_0x5dd35d);}(_0x4522,0x1a0));var _0x2452=function(_0x5d9ce1,_0x4a1556){_0x5d9ce1=_0x5d9ce1-0x0;var _0x1fd84e=_0x4522[_0x5d9ce1];return _0x1fd84e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),'customVariable',_0x2452('0x3')),'defaultValue':_0x2452('0x1')},'content':{'type':Sequelize[_0x2452('0x4')]},'key':{'type':Sequelize[_0x2452('0x4')]},'keyType':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),_0x2452('0x5'))},'keyContent':{'type':Sequelize[_0x2452('0x4')]},'idField':{'type':Sequelize[_0x2452('0x4')]},'nameField':{'type':Sequelize[_0x2452('0x4')]},'customField':{'type':Sequelize[_0x2452('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2452('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index cfc853e..6635feb 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 _0xb7da=['end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','map','key','VIRTUAL','field','where','includeAll','findAll','rows','show','params','include','options','catch','create','body','find','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3c130d,_0x382a38){var _0x58cab6=function(_0x3ff996){while(--_0x3ff996){_0x3c130d['push'](_0x3c130d['shift']());}};_0x58cab6(++_0x382a38);}(_0xb7da,0xc6));var _0xab7d=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xb7da[_0x462fe4];return _0x82b23a;};'use strict';var pdf=require(_0xab7d('0x0'));var emlformat=require(_0xab7d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab7d('0x3'));var moment=require(_0xab7d('0x4'));var BPromise=require(_0xab7d('0x5'));var Mustache=require(_0xab7d('0x6'));var util=require('util');var path=require(_0xab7d('0x7'));var sox=require('sox');var csv=require(_0xab7d('0x8'));var ejs=require(_0xab7d('0x9'));var fs=require('fs');var _=require(_0xab7d('0xa'));var squel=require(_0xab7d('0xb'));var crypto=require(_0xab7d('0xc'));var jsforce=require(_0xab7d('0xd'));var deskjs=require(_0xab7d('0xe'));var toCsv=require(_0xab7d('0x8'));var querystring=require(_0xab7d('0xf'));var Papa=require(_0xab7d('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xab7d('0x11'));var Redis=require('ioredis');var qs=require(_0xab7d('0x12'));var logger=require(_0xab7d('0x13'))('api');var utils=require(_0xab7d('0x14'));var config=require(_0xab7d('0x15'));var db=require(_0xab7d('0x16'))['db'];function respondWithStatusCode(_0x296043,_0x32fb93){_0x32fb93=_0x32fb93||0xcc;return function(_0x3223c0){if(_0x3223c0){return _0x296043[_0xab7d('0x17')](_0x32fb93);}return _0x296043['status'](_0x32fb93)[_0xab7d('0x18')]();};}function respondWithResult(_0x5e681d,_0xdb448a){_0xdb448a=_0xdb448a||0xc8;return function(_0x56c4ac){if(_0x56c4ac){return _0x5e681d[_0xab7d('0x19')](_0xdb448a)['json'](_0x56c4ac);}};}function respondWithFilteredResult(_0x26b7cf,_0x1f11eb){return function(_0x5a8d11){if(_0x5a8d11){var _0x5268da=_0x5a8d11['count'],_0x44368f=_0x1f11eb[_0xab7d('0x1a')],_0x2ec5ee=_0x1f11eb['offset']+_0x1f11eb[_0xab7d('0x1b')],_0x203729;if(_0x2ec5ee>=_0x5268da){_0x2ec5ee=_0x5268da;_0x203729=0xc8;}else{_0x203729=0xce;}_0x26b7cf[_0xab7d('0x19')](_0x203729);return _0x26b7cf[_0xab7d('0x1c')](_0xab7d('0x1d'),_0x44368f+'-'+_0x2ec5ee+'/'+_0x5268da)[_0xab7d('0x1e')](_0x5a8d11);}return null;};}function patchUpdates(_0x108ca5){return function(_0x377ee8){try{jsonpatch[_0xab7d('0x1f')](_0x377ee8,_0x108ca5,!![]);}catch(_0x1d78e0){return BPromise[_0xab7d('0x20')](_0x1d78e0);}return _0x377ee8[_0xab7d('0x21')]();};}function saveUpdates(_0xde7d5,_0x1b4500){return function(_0x34a924){if(_0x34a924){return _0x34a924[_0xab7d('0x22')](_0xde7d5)[_0xab7d('0x23')](function(_0x8783e5){return _0x8783e5;});}return null;};}function removeEntity(_0x820a30,_0x373910){return function(_0x389433){if(_0x389433){return _0x389433[_0xab7d('0x24')]()[_0xab7d('0x23')](function(){_0x820a30[_0xab7d('0x19')](0xcc)[_0xab7d('0x18')]();});}};}function handleEntityNotFound(_0x311ec3,_0x2a9ac1){return function(_0x2a2737){if(!_0x2a2737){_0x311ec3[_0xab7d('0x17')](0x194);}return _0x2a2737;};}function handleError(_0x38333b,_0x133368){_0x133368=_0x133368||0x1f4;return function(_0x2edff6){logger[_0xab7d('0x25')](_0x2edff6[_0xab7d('0x26')]);if(_0x2edff6['name']){delete _0x2edff6[_0xab7d('0x27')];}_0x38333b['status'](_0x133368)[_0xab7d('0x28')](_0x2edff6);};}exports[_0xab7d('0x29')]=function(_0x4bfe0a,_0x40ee9b){var _0x449cf3={},_0x183e72={},_0x36ddaa={'count':0x0,'rows':[]};var _0x496843=db[_0xab7d('0x2a')][_0xab7d('0x2b')];_0x183e72['model']=_[_0xab7d('0x2c')](_0x496843);_0x183e72[_0xab7d('0x2d')]=_['keys'](_0x4bfe0a[_0xab7d('0x2d')]);_0x183e72['filters']=_['intersection'](_0x183e72[_0xab7d('0x2e')],_0x183e72[_0xab7d('0x2d')]);_0x449cf3[_0xab7d('0x2f')]=_[_0xab7d('0x30')](_0x183e72['model'],qs[_0xab7d('0x31')](_0x4bfe0a[_0xab7d('0x2d')][_0xab7d('0x31')]));_0x449cf3[_0xab7d('0x2f')]=_0x449cf3['attributes'][_0xab7d('0x32')]?_0x449cf3[_0xab7d('0x2f')]:_0x183e72[_0xab7d('0x2e')];if(!_0x4bfe0a[_0xab7d('0x2d')][_0xab7d('0x33')](_0xab7d('0x34'))){_0x449cf3[_0xab7d('0x1b')]=qs[_0xab7d('0x1b')](_0x4bfe0a[_0xab7d('0x2d')][_0xab7d('0x1b')]);_0x449cf3['offset']=qs[_0xab7d('0x1a')](_0x4bfe0a[_0xab7d('0x2d')]['offset']);}_0x449cf3[_0xab7d('0x35')]=qs[_0xab7d('0x36')](_0x4bfe0a['query'][_0xab7d('0x36')]);_0x449cf3['where']=qs[_0xab7d('0x37')](_['pick'](_0x4bfe0a[_0xab7d('0x2d')],_0x183e72[_0xab7d('0x37')]));if(_0x4bfe0a[_0xab7d('0x2d')][_0xab7d('0x38')]){_0x449cf3['where']=_[_0xab7d('0x39')](_0x449cf3['where'],{'$or':_[_0xab7d('0x3a')](_0x496843,function(_0x47600f){if(_0x47600f['type'][_0xab7d('0x3b')]!==_0xab7d('0x3c')){var _0x4e916c={};_0x4e916c[_0x47600f[_0xab7d('0x3d')]]={'$like':'%'+_0x4bfe0a[_0xab7d('0x2d')][_0xab7d('0x38')]+'%'};return _0x4e916c;}})});}_0x449cf3=_['merge']({},_0x449cf3,_0x4bfe0a['options']);var _0x7e6efb={'where':_0x449cf3[_0xab7d('0x3e')]};return db[_0xab7d('0x2a')]['count'](_0x7e6efb)[_0xab7d('0x23')](function(_0x23f067){_0x36ddaa['count']=_0x23f067;if(_0x4bfe0a['query'][_0xab7d('0x3f')]){_0x449cf3['include']=[{'all':!![]}];}return db[_0xab7d('0x2a')][_0xab7d('0x40')](_0x449cf3);})[_0xab7d('0x23')](function(_0x45c5ce){_0x36ddaa[_0xab7d('0x41')]=_0x45c5ce;return _0x36ddaa;})[_0xab7d('0x23')](respondWithFilteredResult(_0x40ee9b,_0x449cf3))['catch'](handleError(_0x40ee9b,null));};exports[_0xab7d('0x42')]=function(_0x43bbe7,_0x4d8e2b){var _0x5a8804={'raw':!![],'where':{'id':_0x43bbe7[_0xab7d('0x43')]['id']}},_0x3e911b={};_0x3e911b[_0xab7d('0x2e')]=_[_0xab7d('0x2c')](db['ZendeskField'][_0xab7d('0x2b')]);_0x3e911b['query']=_['keys'](_0x43bbe7[_0xab7d('0x2d')]);_0x3e911b['filters']=_[_0xab7d('0x30')](_0x3e911b[_0xab7d('0x2e')],_0x3e911b[_0xab7d('0x2d')]);_0x5a8804[_0xab7d('0x2f')]=_['intersection'](_0x3e911b[_0xab7d('0x2e')],qs[_0xab7d('0x31')](_0x43bbe7[_0xab7d('0x2d')]['fields']));_0x5a8804[_0xab7d('0x2f')]=_0x5a8804['attributes'][_0xab7d('0x32')]?_0x5a8804[_0xab7d('0x2f')]:_0x3e911b[_0xab7d('0x2e')];if(_0x43bbe7[_0xab7d('0x2d')][_0xab7d('0x3f')]){_0x5a8804[_0xab7d('0x44')]=[{'all':!![]}];}_0x5a8804=_[_0xab7d('0x39')]({},_0x5a8804,_0x43bbe7[_0xab7d('0x45')]);return db['ZendeskField']['find'](_0x5a8804)[_0xab7d('0x23')](handleEntityNotFound(_0x4d8e2b,null))['then'](respondWithResult(_0x4d8e2b,null))[_0xab7d('0x46')](handleError(_0x4d8e2b,null));};exports[_0xab7d('0x47')]=function(_0x4f594c,_0x1b27a9){return db['ZendeskField']['create'](_0x4f594c[_0xab7d('0x48')],{})[_0xab7d('0x23')](respondWithResult(_0x1b27a9,0xc9))[_0xab7d('0x46')](handleError(_0x1b27a9,null));};exports[_0xab7d('0x22')]=function(_0x4c1371,_0x29390c){if(_0x4c1371['body']['id']){delete _0x4c1371['body']['id'];}return db[_0xab7d('0x2a')][_0xab7d('0x49')]({'where':{'id':_0x4c1371[_0xab7d('0x43')]['id']}})['then'](handleEntityNotFound(_0x29390c,null))[_0xab7d('0x23')](saveUpdates(_0x4c1371['body'],null))['then'](respondWithResult(_0x29390c,null))[_0xab7d('0x46')](handleError(_0x29390c,null));};exports[_0xab7d('0x24')]=function(_0x17c08d,_0x49e965){return db[_0xab7d('0x2a')][_0xab7d('0x49')]({'where':{'id':_0x17c08d[_0xab7d('0x43')]['id']}})[_0xab7d('0x23')](handleEntityNotFound(_0x49e965,null))['then'](removeEntity(_0x49e965,null))[_0xab7d('0x46')](handleError(_0x49e965,null));}; \ No newline at end of file +var _0x76bf=['order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','status','end','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','stack','name','send','ZendeskField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x76bf,0x12e));var _0xf76b=function(_0x271ffe,_0x16d8de){_0x271ffe=_0x271ffe-0x0;var _0x14c463=_0x76bf[_0x271ffe];return _0x14c463;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf76b('0x0'));var rimraf=require(_0xf76b('0x1'));var zipdir=require(_0xf76b('0x2'));var jsonpatch=require(_0xf76b('0x3'));var rp=require(_0xf76b('0x4'));var moment=require(_0xf76b('0x5'));var BPromise=require(_0xf76b('0x6'));var Mustache=require(_0xf76b('0x7'));var util=require(_0xf76b('0x8'));var path=require('path');var sox=require(_0xf76b('0x9'));var csv=require(_0xf76b('0xa'));var ejs=require(_0xf76b('0xb'));var fs=require('fs');var _=require(_0xf76b('0xc'));var squel=require(_0xf76b('0xd'));var crypto=require(_0xf76b('0xe'));var jsforce=require(_0xf76b('0xf'));var deskjs=require(_0xf76b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf76b('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf76b('0x12'));var Redis=require(_0xf76b('0x13'));var qs=require(_0xf76b('0x14'));var logger=require('../../config/logger')(_0xf76b('0x15'));var utils=require(_0xf76b('0x16'));var config=require('../../config/environment');var db=require(_0xf76b('0x17'))['db'];function respondWithStatusCode(_0x1e8906,_0x34b6ad){_0x34b6ad=_0x34b6ad||0xcc;return function(_0x1d6722){if(_0x1d6722){return _0x1e8906['sendStatus'](_0x34b6ad);}return _0x1e8906[_0xf76b('0x18')](_0x34b6ad)[_0xf76b('0x19')]();};}function respondWithResult(_0x1684c9,_0x219cba){_0x219cba=_0x219cba||0xc8;return function(_0x366730){if(_0x366730){return _0x1684c9[_0xf76b('0x18')](_0x219cba)['json'](_0x366730);}};}function respondWithFilteredResult(_0x2067d1,_0x4a5b43){return function(_0x6099a4){if(_0x6099a4){var _0xc9c14b=_0x6099a4[_0xf76b('0x1a')],_0x5def84=_0x4a5b43[_0xf76b('0x1b')],_0x135ce3=_0x4a5b43[_0xf76b('0x1b')]+_0x4a5b43['limit'],_0x2cd972;if(_0x135ce3>=_0xc9c14b){_0x135ce3=_0xc9c14b;_0x2cd972=0xc8;}else{_0x2cd972=0xce;}_0x2067d1['status'](_0x2cd972);return _0x2067d1[_0xf76b('0x1c')](_0xf76b('0x1d'),_0x5def84+'-'+_0x135ce3+'/'+_0xc9c14b)[_0xf76b('0x1e')](_0x6099a4);}return null;};}function patchUpdates(_0x1c43a1){return function(_0x5bc1f1){try{jsonpatch[_0xf76b('0x1f')](_0x5bc1f1,_0x1c43a1,!![]);}catch(_0x20eb66){return BPromise['reject'](_0x20eb66);}return _0x5bc1f1[_0xf76b('0x20')]();};}function saveUpdates(_0x63bd34,_0x162827){return function(_0x442198){if(_0x442198){return _0x442198[_0xf76b('0x21')](_0x63bd34)['then'](function(_0x500165){return _0x500165;});}return null;};}function removeEntity(_0xc5d607,_0x3bd12b){return function(_0x194156){if(_0x194156){return _0x194156[_0xf76b('0x22')]()[_0xf76b('0x23')](function(){_0xc5d607[_0xf76b('0x18')](0xcc)[_0xf76b('0x19')]();});}};}function handleEntityNotFound(_0x3e6490,_0x5f3268){return function(_0x41cdda){if(!_0x41cdda){_0x3e6490[_0xf76b('0x24')](0x194);}return _0x41cdda;};}function handleError(_0x563aa0,_0x57636a){_0x57636a=_0x57636a||0x1f4;return function(_0x3f2deb){logger[_0xf76b('0x25')](_0x3f2deb[_0xf76b('0x26')]);if(_0x3f2deb[_0xf76b('0x27')]){delete _0x3f2deb[_0xf76b('0x27')];}_0x563aa0['status'](_0x57636a)[_0xf76b('0x28')](_0x3f2deb);};}exports['index']=function(_0x426099,_0x17e835){var _0x36f650={},_0x35ef6d={},_0x12886d={'count':0x0,'rows':[]};var _0x42f1bd=db[_0xf76b('0x29')][_0xf76b('0x2a')];_0x35ef6d[_0xf76b('0x2b')]=_['keys'](_0x42f1bd);_0x35ef6d[_0xf76b('0x2c')]=_[_0xf76b('0x2d')](_0x426099[_0xf76b('0x2c')]);_0x35ef6d[_0xf76b('0x2e')]=_[_0xf76b('0x2f')](_0x35ef6d[_0xf76b('0x2b')],_0x35ef6d[_0xf76b('0x2c')]);_0x36f650[_0xf76b('0x30')]=_[_0xf76b('0x2f')](_0x35ef6d[_0xf76b('0x2b')],qs['fields'](_0x426099[_0xf76b('0x2c')][_0xf76b('0x31')]));_0x36f650['attributes']=_0x36f650[_0xf76b('0x30')][_0xf76b('0x32')]?_0x36f650['attributes']:_0x35ef6d[_0xf76b('0x2b')];if(!_0x426099['query'][_0xf76b('0x33')]('nolimit')){_0x36f650[_0xf76b('0x34')]=qs[_0xf76b('0x34')](_0x426099[_0xf76b('0x2c')]['limit']);_0x36f650[_0xf76b('0x1b')]=qs[_0xf76b('0x1b')](_0x426099[_0xf76b('0x2c')]['offset']);}_0x36f650[_0xf76b('0x35')]=qs['sort'](_0x426099[_0xf76b('0x2c')][_0xf76b('0x36')]);_0x36f650[_0xf76b('0x37')]=qs[_0xf76b('0x2e')](_['pick'](_0x426099[_0xf76b('0x2c')],_0x35ef6d[_0xf76b('0x2e')]));if(_0x426099[_0xf76b('0x2c')][_0xf76b('0x38')]){_0x36f650['where']=_[_0xf76b('0x39')](_0x36f650[_0xf76b('0x37')],{'$or':_[_0xf76b('0x3a')](_0x42f1bd,function(_0xda2abd){if(_0xda2abd['type']['key']!==_0xf76b('0x3b')){var _0x393578={};_0x393578[_0xda2abd['field']]={'$like':'%'+_0x426099[_0xf76b('0x2c')][_0xf76b('0x38')]+'%'};return _0x393578;}})});}_0x36f650=_['merge']({},_0x36f650,_0x426099[_0xf76b('0x3c')]);var _0x9503f7={'where':_0x36f650[_0xf76b('0x37')]};return db[_0xf76b('0x29')][_0xf76b('0x1a')](_0x9503f7)[_0xf76b('0x23')](function(_0x9d7e42){_0x12886d[_0xf76b('0x1a')]=_0x9d7e42;if(_0x426099[_0xf76b('0x2c')][_0xf76b('0x3d')]){_0x36f650['include']=[{'all':!![]}];}return db[_0xf76b('0x29')][_0xf76b('0x3e')](_0x36f650);})[_0xf76b('0x23')](function(_0x51f4e6){_0x12886d[_0xf76b('0x3f')]=_0x51f4e6;return _0x12886d;})['then'](respondWithFilteredResult(_0x17e835,_0x36f650))[_0xf76b('0x40')](handleError(_0x17e835,null));};exports[_0xf76b('0x41')]=function(_0x1c4d52,_0xf79eea){var _0x3aefce={'raw':!![],'where':{'id':_0x1c4d52[_0xf76b('0x42')]['id']}},_0x36e084={};_0x36e084[_0xf76b('0x2b')]=_[_0xf76b('0x2d')](db[_0xf76b('0x29')][_0xf76b('0x2a')]);_0x36e084['query']=_[_0xf76b('0x2d')](_0x1c4d52[_0xf76b('0x2c')]);_0x36e084[_0xf76b('0x2e')]=_[_0xf76b('0x2f')](_0x36e084['model'],_0x36e084['query']);_0x3aefce['attributes']=_['intersection'](_0x36e084[_0xf76b('0x2b')],qs['fields'](_0x1c4d52[_0xf76b('0x2c')][_0xf76b('0x31')]));_0x3aefce[_0xf76b('0x30')]=_0x3aefce[_0xf76b('0x30')]['length']?_0x3aefce['attributes']:_0x36e084[_0xf76b('0x2b')];if(_0x1c4d52['query']['includeAll']){_0x3aefce[_0xf76b('0x43')]=[{'all':!![]}];}_0x3aefce=_[_0xf76b('0x39')]({},_0x3aefce,_0x1c4d52['options']);return db[_0xf76b('0x29')][_0xf76b('0x44')](_0x3aefce)[_0xf76b('0x23')](handleEntityNotFound(_0xf79eea,null))[_0xf76b('0x23')](respondWithResult(_0xf79eea,null))[_0xf76b('0x40')](handleError(_0xf79eea,null));};exports[_0xf76b('0x45')]=function(_0x9182df,_0x5957e9){return db[_0xf76b('0x29')][_0xf76b('0x45')](_0x9182df['body'],{})[_0xf76b('0x23')](respondWithResult(_0x5957e9,0xc9))[_0xf76b('0x40')](handleError(_0x5957e9,null));};exports[_0xf76b('0x21')]=function(_0x598c1a,_0x4aa82b){if(_0x598c1a[_0xf76b('0x46')]['id']){delete _0x598c1a['body']['id'];}return db[_0xf76b('0x29')][_0xf76b('0x44')]({'where':{'id':_0x598c1a[_0xf76b('0x42')]['id']}})[_0xf76b('0x23')](handleEntityNotFound(_0x4aa82b,null))[_0xf76b('0x23')](saveUpdates(_0x598c1a[_0xf76b('0x46')],null))[_0xf76b('0x23')](respondWithResult(_0x4aa82b,null))[_0xf76b('0x40')](handleError(_0x4aa82b,null));};exports[_0xf76b('0x22')]=function(_0x5a1190,_0x141886){return db[_0xf76b('0x29')][_0xf76b('0x44')]({'where':{'id':_0x5a1190[_0xf76b('0x42')]['id']}})[_0xf76b('0x23')](handleEntityNotFound(_0x141886,null))['then'](removeEntity(_0x141886,null))[_0xf76b('0x40')](handleError(_0x141886,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8ee8151..2028978 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 _0xe511=['api','bluebird','request-promise','exports','define','int_zendesk_fields','zendesk_unique_index','lodash','util'];(function(_0xb6208,_0x15d60d){var _0x37e8d1=function(_0x55ea1d){while(--_0x55ea1d){_0xb6208['push'](_0xb6208['shift']());}};_0x37e8d1(++_0x15d60d);}(_0xe511,0x16f));var _0x1e51=function(_0x5a43b8,_0x2e0eb2){_0x5a43b8=_0x5a43b8-0x0;var _0x26eeef=_0xe511[_0x5a43b8];return _0x26eeef;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var attributes=require('./intZendeskField.attributes');module[_0x1e51('0x5')]=function(_0x2be2b7,_0x204da7){return _0x2be2b7[_0x1e51('0x6')]('ZendeskField',attributes,{'tableName':_0x1e51('0x7'),'paranoid':![],'indexes':[{'name':_0x1e51('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80ed=['request-promise','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x3b318e,_0x2740ae){var _0x5e743c=function(_0x13190a){while(--_0x13190a){_0x3b318e['push'](_0x3b318e['shift']());}};_0x5e743c(++_0x2740ae);}(_0x80ed,0x11c));var _0xd80e=function(_0x3dd5dd,_0x20ea6e){_0x3dd5dd=_0x3dd5dd-0x0;var _0x1f1622=_0x80ed[_0x3dd5dd];return _0x1f1622;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var attributes=require(_0xd80e('0x5'));module[_0xd80e('0x6')]=function(_0x3413d4,_0x5ae6c6){return _0x3413d4[_0xd80e('0x7')](_0xd80e('0x8'),attributes,{'tableName':_0xd80e('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xd80e('0xa'),_0xd80e('0xb')],'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 2c77e58..049ebd5 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 _0x4cf8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result'];(function(_0x5242b4,_0x3f3d57){var _0x340ed4=function(_0x403b8a){while(--_0x403b8a){_0x5242b4['push'](_0x5242b4['shift']());}};_0x340ed4(++_0x3f3d57);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0x4cf8[_0x3c40f4];return _0x1209d;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2e84b04..7fe3862 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 _0x0972=['post','create','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x0972,0x64));var _0x2097=function(_0x5e92d0,_0x18c9b4){_0x5e92d0=_0x5e92d0-0x0;var _0x3f6a64=_0x0972[_0x5e92d0];return _0x3f6a64;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')]('/',auth[_0x2097('0x7')](),controller[_0x2097('0x8')]);router[_0x2097('0x6')](_0x2097('0x9'),auth['isAuthenticated'](),controller[_0x2097('0xa')]);router[_0x2097('0x6')](_0x2097('0xb'),auth[_0x2097('0x7')](),controller[_0x2097('0xc')]);router['get'](_0x2097('0xd'),auth[_0x2097('0x7')](),controller[_0x2097('0xe')]);router[_0x2097('0xf')]('/',auth[_0x2097('0x7')](),controller[_0x2097('0x10')]);router[_0x2097('0xf')](_0x2097('0xb'),auth[_0x2097('0x7')](),controller[_0x2097('0x11')]);router[_0x2097('0x12')](_0x2097('0x9'),auth[_0x2097('0x7')](),controller[_0x2097('0x13')]);router[_0x2097('0x14')](_0x2097('0x9'),auth[_0x2097('0x7')](),controller[_0x2097('0x15')]);module[_0x2097('0x16')]=router; \ No newline at end of file +var _0x6e6c=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x152cb8,_0x2cd976){var _0x494c94=function(_0x33b057){while(--_0x33b057){_0x152cb8['push'](_0x152cb8['shift']());}};_0x494c94(++_0x2cd976);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc6e6('0x4'));var config=require('../../config/environment');var controller=require(_0xc6e6('0x5'));router['get']('/',auth[_0xc6e6('0x6')](),controller[_0xc6e6('0x7')]);router['get'](_0xc6e6('0x8'),auth[_0xc6e6('0x6')](),controller['show']);router[_0xc6e6('0x9')](_0xc6e6('0xa'),auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['get'](_0xc6e6('0xc'),auth[_0xc6e6('0x6')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xe')]('/',auth[_0xc6e6('0x6')](),controller[_0xc6e6('0xf')]);router[_0xc6e6('0xe')](_0xc6e6('0xa'),auth[_0xc6e6('0x6')](),controller['addConfiguration']);router[_0xc6e6('0x10')]('/:id',auth[_0xc6e6('0x6')](),controller[_0xc6e6('0x11')]);router[_0xc6e6('0x12')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x13')]);module[_0xc6e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 7c5a107..17105d3 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 _0xeb22=['sequelize','STRING'];(function(_0x273132,_0x26f68a){var _0x3cf09e=function(_0x3063ef){while(--_0x3063ef){_0x273132['push'](_0x273132['shift']());}};_0x3cf09e(++_0x26f68a);}(_0xeb22,0x10e));var _0x2eb2=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0xeb22[_0x57cbfb];return _0x4cb933;};'use strict';var Sequelize=require(_0x2eb2('0x0'));module['exports']={'name':{'type':Sequelize[_0x2eb2('0x1')]},'description':{'type':Sequelize[_0x2eb2('0x1')]},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x2eb2('0x1')]},'serverUrl':{'type':Sequelize[_0x2eb2('0x1')]}}; \ No newline at end of file +var _0xf4df=['STRING','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xf4df,0x1d1));var _0xff4d=function(_0x55a41c,_0x2ced02){_0x55a41c=_0x55a41c-0x0;var _0x278b73=_0xf4df[_0x55a41c];return _0x278b73;};'use strict';var Sequelize=require(_0xff4d('0x0'));module['exports']={'name':{'type':Sequelize[_0xff4d('0x1')]},'description':{'type':Sequelize[_0xff4d('0x1')]},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xff4d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index fd8b225..b228bfe 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 _0x1224=['show','params','length','includeAll','merge','find','create','body','findOne','ZohoConfiguration','order','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','getFields','authToken','host','substring','GET','response','Calls','section','includes','push','label','customfield','true','Pick\x20List','val','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','json','count','offset','limit','status','Content-Range','save','update','destroy','end','name','send','index','ZohoAccount','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch'];(function(_0x2ed27f,_0x5af558){var _0x5152f4=function(_0x1f99e2){while(--_0x1f99e2){_0x2ed27f['push'](_0x2ed27f['shift']());}};_0x5152f4(++_0x5af558);}(_0x1224,0x10d));var _0x4122=function(_0x3aa0f4,_0x49fa72){_0x3aa0f4=_0x3aa0f4-0x0;var _0x3ce03e=_0x1224[_0x3aa0f4];return _0x3ce03e;};'use strict';var pdf=require(_0x4122('0x0'));var emlformat=require(_0x4122('0x1'));var rimraf=require(_0x4122('0x2'));var zipdir=require(_0x4122('0x3'));var jsonpatch=require(_0x4122('0x4'));var rp=require(_0x4122('0x5'));var moment=require('moment');var BPromise=require(_0x4122('0x6'));var Mustache=require(_0x4122('0x7'));var util=require(_0x4122('0x8'));var path=require('path');var sox=require(_0x4122('0x9'));var csv=require(_0x4122('0xa'));var ejs=require(_0x4122('0xb'));var fs=require('fs');var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0xa'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var authService=require(_0x4122('0x13'));var hardwareService=require(_0x4122('0x14'));var Redis=require(_0x4122('0x15'));var qs=require(_0x4122('0x16'));var logger=require(_0x4122('0x17'))(_0x4122('0x18'));var utils=require(_0x4122('0x19'));var config=require(_0x4122('0x1a'));var db=require(_0x4122('0x1b'))['db'];var integrations=require(_0x4122('0x1c'));var jayson=require(_0x4122('0x1d'));var client=jayson[_0x4122('0x1e')][_0x4122('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xe213d,_0x292932,_0x401abb,_0x33278f){return new BPromise(function(_0x421ee3,_0x1a701e){var _0x3a88fe=_0x33278f||client;return _0x3a88fe['request'](_0xe213d,_0x401abb)[_0x4122('0x20')](function(_0x3c674e){logger[_0x4122('0x21')](_0x4122('0x22'),_0x292932,'request\x20sent');logger[_0x4122('0x23')](_0x4122('0x24'),_0x292932,'request\x20sent',JSON[_0x4122('0x25')](_0x3c674e));if(_0x3c674e[_0x4122('0x26')]){if(_0x3c674e[_0x4122('0x26')][_0x4122('0x27')]===0x1f4){logger[_0x4122('0x26')](_0x4122('0x22'),_0x292932,_0x3c674e[_0x4122('0x26')]['message']);return _0x1a701e(_0x3c674e['error']['message']);}logger[_0x4122('0x26')](_0x4122('0x22'),_0x292932,_0x3c674e[_0x4122('0x26')][_0x4122('0x28')]);return _0x421ee3(_0x3c674e[_0x4122('0x26')][_0x4122('0x28')]);}else{logger[_0x4122('0x21')](_0x4122('0x22'),_0x292932,'request\x20sent');_0x421ee3(_0x3c674e[_0x4122('0x29')]['message']);}})['catch'](function(_0x508cd7){logger[_0x4122('0x26')](_0x4122('0x22'),_0x292932,_0x508cd7);_0x1a701e(_0x508cd7);});});}function respondWithStatusCode(_0x317418,_0x4eb35b){_0x4eb35b=_0x4eb35b||0xcc;return function(_0x128fde){if(_0x128fde){return _0x317418[_0x4122('0x2a')](_0x4eb35b);}return _0x317418['status'](_0x4eb35b)['end']();};}function respondWithResult(_0x1b7848,_0x5ba3c1){_0x5ba3c1=_0x5ba3c1||0xc8;return function(_0x4db23e){if(_0x4db23e){return _0x1b7848['status'](_0x5ba3c1)[_0x4122('0x2b')](_0x4db23e);}};}function respondWithFilteredResult(_0x2e71f4,_0xbb76e1){return function(_0x1bb51b){if(_0x1bb51b){var _0x31568f=_0x1bb51b[_0x4122('0x2c')],_0x58a9ba=_0xbb76e1[_0x4122('0x2d')],_0x26768b=_0xbb76e1[_0x4122('0x2d')]+_0xbb76e1[_0x4122('0x2e')],_0x7fe50d;if(_0x26768b>=_0x31568f){_0x26768b=_0x31568f;_0x7fe50d=0xc8;}else{_0x7fe50d=0xce;}_0x2e71f4[_0x4122('0x2f')](_0x7fe50d);return _0x2e71f4['set'](_0x4122('0x30'),_0x58a9ba+'-'+_0x26768b+'/'+_0x31568f)[_0x4122('0x2b')](_0x1bb51b);}return null;};}function patchUpdates(_0x79c85){return function(_0x31f141){try{jsonpatch['apply'](_0x31f141,_0x79c85,!![]);}catch(_0x115caa){return BPromise['reject'](_0x115caa);}return _0x31f141[_0x4122('0x31')]();};}function saveUpdates(_0x431430,_0x3a9633){return function(_0xd8634b){if(_0xd8634b){return _0xd8634b[_0x4122('0x32')](_0x431430)[_0x4122('0x20')](function(_0xb98ce8){return _0xb98ce8;});}return null;};}function removeEntity(_0x427e8a,_0x57c0a7){return function(_0x17968f){if(_0x17968f){return _0x17968f[_0x4122('0x33')]()['then'](function(){_0x427e8a[_0x4122('0x2f')](0xcc)[_0x4122('0x34')]();});}};}function handleEntityNotFound(_0x384787,_0x1876f8){return function(_0x5af51c){if(!_0x5af51c){_0x384787[_0x4122('0x2a')](0x194);}return _0x5af51c;};}function handleError(_0x9e43bd,_0x57416e){_0x57416e=_0x57416e||0x1f4;return function(_0x568cd0){logger[_0x4122('0x26')](_0x568cd0['stack']);if(_0x568cd0[_0x4122('0x35')]){delete _0x568cd0[_0x4122('0x35')];}_0x9e43bd['status'](_0x57416e)[_0x4122('0x36')](_0x568cd0);};}exports[_0x4122('0x37')]=function(_0x31ba4b,_0x5bb6d6){var _0x35971b={},_0x5b925d={},_0x4063cb={'count':0x0,'rows':[]};var _0x3ac9a1=db[_0x4122('0x38')]['rawAttributes'];_0x5b925d[_0x4122('0x39')]=_['keys'](_0x3ac9a1);_0x5b925d[_0x4122('0x3a')]=_[_0x4122('0x3b')](_0x31ba4b['query']);_0x5b925d['filters']=_['intersection'](_0x5b925d[_0x4122('0x39')],_0x5b925d['query']);_0x35971b[_0x4122('0x3c')]=_[_0x4122('0x3d')](_0x5b925d[_0x4122('0x39')],qs[_0x4122('0x3e')](_0x31ba4b[_0x4122('0x3a')]['fields']));_0x35971b['attributes']=_0x35971b[_0x4122('0x3c')]['length']?_0x35971b[_0x4122('0x3c')]:_0x5b925d['model'];if(!_0x31ba4b[_0x4122('0x3a')][_0x4122('0x3f')]('nolimit')){_0x35971b[_0x4122('0x2e')]=qs[_0x4122('0x2e')](_0x31ba4b[_0x4122('0x3a')][_0x4122('0x2e')]);_0x35971b[_0x4122('0x2d')]=qs[_0x4122('0x2d')](_0x31ba4b['query'][_0x4122('0x2d')]);}_0x35971b['order']=qs[_0x4122('0x40')](_0x31ba4b['query'][_0x4122('0x40')]);_0x35971b[_0x4122('0x41')]=qs[_0x4122('0x42')](_[_0x4122('0x43')](_0x31ba4b[_0x4122('0x3a')],_0x5b925d['filters']));if(_0x31ba4b[_0x4122('0x3a')][_0x4122('0x44')]){_0x35971b['where']=_['merge'](_0x35971b['where'],{'$or':_[_0x4122('0x45')](_0x3ac9a1,function(_0x1d7442){if(_0x1d7442[_0x4122('0x46')][_0x4122('0x47')]!==_0x4122('0x48')){var _0x1183f5={};_0x1183f5[_0x1d7442[_0x4122('0x49')]]={'$like':'%'+_0x31ba4b[_0x4122('0x3a')][_0x4122('0x44')]+'%'};return _0x1183f5;}})});}_0x35971b=_['merge']({},_0x35971b,_0x31ba4b[_0x4122('0x4a')]);var _0x4c6578={'where':_0x35971b['where']};return db[_0x4122('0x38')][_0x4122('0x2c')](_0x4c6578)[_0x4122('0x20')](function(_0x5ed2c7){_0x4063cb[_0x4122('0x2c')]=_0x5ed2c7;if(_0x31ba4b[_0x4122('0x3a')]['includeAll']){_0x35971b[_0x4122('0x4b')]=[{'all':!![]}];}return db[_0x4122('0x38')][_0x4122('0x4c')](_0x35971b);})[_0x4122('0x20')](function(_0x49d246){_0x4063cb[_0x4122('0x4d')]=_0x49d246;return _0x4063cb;})[_0x4122('0x20')](respondWithFilteredResult(_0x5bb6d6,_0x35971b))[_0x4122('0x4e')](handleError(_0x5bb6d6,null));};exports[_0x4122('0x4f')]=function(_0x358f4c,_0x5d43de){var _0x531117={'raw':![],'where':{'id':_0x358f4c[_0x4122('0x50')]['id']}},_0x16b917={};_0x16b917[_0x4122('0x39')]=_[_0x4122('0x3b')](db[_0x4122('0x38')]['rawAttributes']);_0x16b917[_0x4122('0x3a')]=_[_0x4122('0x3b')](_0x358f4c[_0x4122('0x3a')]);_0x16b917['filters']=_[_0x4122('0x3d')](_0x16b917['model'],_0x16b917[_0x4122('0x3a')]);_0x531117[_0x4122('0x3c')]=_[_0x4122('0x3d')](_0x16b917[_0x4122('0x39')],qs['fields'](_0x358f4c['query'][_0x4122('0x3e')]));_0x531117[_0x4122('0x3c')]=_0x531117[_0x4122('0x3c')][_0x4122('0x51')]?_0x531117['attributes']:_0x16b917[_0x4122('0x39')];if(_0x358f4c['query'][_0x4122('0x52')]){_0x531117['include']=[{'all':!![]}];}_0x531117=_[_0x4122('0x53')]({},_0x531117,_0x358f4c[_0x4122('0x4a')]);return db[_0x4122('0x38')][_0x4122('0x54')](_0x531117)[_0x4122('0x20')](handleEntityNotFound(_0x5d43de,null))[_0x4122('0x20')](respondWithResult(_0x5d43de,null))['catch'](handleError(_0x5d43de,null));};exports[_0x4122('0x55')]=function(_0x5f4aea,_0x167805){return db[_0x4122('0x38')][_0x4122('0x55')](_0x5f4aea[_0x4122('0x56')],{})[_0x4122('0x20')](respondWithResult(_0x167805,0xc9))['catch'](handleError(_0x167805,null));};exports[_0x4122('0x32')]=function(_0x290e5a,_0x270067){if(_0x290e5a[_0x4122('0x56')]['id']){delete _0x290e5a['body']['id'];}return db[_0x4122('0x38')]['find']({'where':{'id':_0x290e5a[_0x4122('0x50')]['id']}})[_0x4122('0x20')](handleEntityNotFound(_0x270067,null))[_0x4122('0x20')](saveUpdates(_0x290e5a[_0x4122('0x56')],null))[_0x4122('0x20')](respondWithResult(_0x270067,null))[_0x4122('0x4e')](handleError(_0x270067,null));};exports[_0x4122('0x33')]=function(_0x45f112,_0x44b981){return db['ZohoAccount'][_0x4122('0x54')]({'where':{'id':_0x45f112[_0x4122('0x50')]['id']}})[_0x4122('0x20')](handleEntityNotFound(_0x44b981,null))['then'](removeEntity(_0x44b981,null))['catch'](handleError(_0x44b981,null));};exports['getConfigurations']=function(_0x452295,_0xcc49e8,_0x80363c){var _0x4ef2f5={};var _0x2764c7={};var _0x47800c;var _0x31421f;return db[_0x4122('0x38')][_0x4122('0x57')]({'where':{'id':_0x452295[_0x4122('0x50')]['id']}})[_0x4122('0x20')](handleEntityNotFound(_0xcc49e8,null))[_0x4122('0x20')](function(_0x23fe34){if(_0x23fe34){_0x47800c=_0x23fe34;_0x2764c7[_0x4122('0x39')]=_[_0x4122('0x3b')](db[_0x4122('0x58')]['rawAttributes']);_0x2764c7[_0x4122('0x3a')]=_['keys'](_0x452295[_0x4122('0x3a')]);_0x2764c7[_0x4122('0x42')]=_[_0x4122('0x3d')](_0x2764c7[_0x4122('0x39')],_0x2764c7[_0x4122('0x3a')]);_0x4ef2f5[_0x4122('0x3c')]=_['intersection'](_0x2764c7[_0x4122('0x39')],qs['fields'](_0x452295[_0x4122('0x3a')][_0x4122('0x3e')]));_0x4ef2f5[_0x4122('0x3c')]=_0x4ef2f5['attributes'][_0x4122('0x51')]?_0x4ef2f5[_0x4122('0x3c')]:_0x2764c7['model'];_0x4ef2f5[_0x4122('0x59')]=qs[_0x4122('0x40')](_0x452295['query'][_0x4122('0x40')]);_0x4ef2f5[_0x4122('0x41')]=qs[_0x4122('0x42')](_[_0x4122('0x43')](_0x452295[_0x4122('0x3a')],_0x2764c7[_0x4122('0x42')]));if(_0x452295[_0x4122('0x3a')][_0x4122('0x44')]){_0x4ef2f5[_0x4122('0x41')]=_[_0x4122('0x53')](_0x4ef2f5['where'],{'$or':_[_0x4122('0x45')](_0x4ef2f5[_0x4122('0x3c')],function(_0xc98a28){var _0xb7c488={};_0xb7c488[_0xc98a28]={'$like':'%'+_0x452295['query'][_0x4122('0x44')]+'%'};return _0xb7c488;})});}_0x4ef2f5=_[_0x4122('0x53')]({},_0x4ef2f5,_0x452295['options']);return _0x47800c['getConfigurations'](_0x4ef2f5);}})[_0x4122('0x20')](function(_0xf2e8b7){if(_0xf2e8b7){_0x31421f=_0xf2e8b7[_0x4122('0x51')];if(!_0x452295['query']['hasOwnProperty']('nolimit')){_0x4ef2f5[_0x4122('0x2e')]=qs['limit'](_0x452295['query'][_0x4122('0x2e')]);_0x4ef2f5[_0x4122('0x2d')]=qs[_0x4122('0x2d')](_0x452295['query'][_0x4122('0x2d')]);}return _0x47800c[_0x4122('0x5a')](_0x4ef2f5);}})[_0x4122('0x20')](function(_0x33619f){if(_0x33619f){return _0x33619f?{'count':_0x31421f,'rows':_0x33619f}:null;}})[_0x4122('0x20')](respondWithResult(_0xcc49e8,null))[_0x4122('0x4e')](handleError(_0xcc49e8,null));};exports[_0x4122('0x5b')]=function(_0x392d8f,_0x13d7ed,_0xec3e18){if(_0x392d8f[_0x4122('0x56')]['id']){delete _0x392d8f[_0x4122('0x56')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x392d8f[_0x4122('0x50')]['id']}})[_0x4122('0x20')](handleEntityNotFound(_0x13d7ed,null))[_0x4122('0x20')](function(_0x57a98e){if(_0x57a98e){_0x392d8f[_0x4122('0x56')]['AccountId']=_0x57a98e['id'];_0x392d8f[_0x4122('0x56')][_0x4122('0x5c')]=integrations[_0x4122('0x5d')](_0x392d8f[_0x4122('0x56')][_0x4122('0x5e')],_0x392d8f['body'][_0x4122('0x46')]);_0x392d8f[_0x4122('0x56')][_0x4122('0x5f')]=integrations[_0x4122('0x60')](_0x392d8f[_0x4122('0x56')][_0x4122('0x5e')],_0x392d8f['body'][_0x4122('0x46')]);return db[_0x4122('0x58')][_0x4122('0x55')](_0x392d8f['body'],{'include':[{'model':db[_0x4122('0x61')],'as':_0x4122('0x5c')},{'model':db[_0x4122('0x61')],'as':_0x4122('0x5f')}]});}return null;})[_0x4122('0x20')](respondWithResult(_0x13d7ed,null))['catch'](handleError(_0x13d7ed,null));};exports[_0x4122('0x62')]=function(_0x1f57b5,_0x37c8ff,_0x5609de){var _0x18ea60='';return db[_0x4122('0x38')]['findOne']({'where':{'id':_0x1f57b5[_0x4122('0x50')]['id']},'attributes':['id','host',_0x4122('0x63')]})[_0x4122('0x20')](handleEntityNotFound(_0x37c8ff,null))[_0x4122('0x20')](function(_0x112561){if(_0x112561){_0x18ea60=_0x112561[_0x4122('0x64')];var _0x4ff046=_0x18ea60['slice'](-0x1);if(_0x4ff046==='/'){_0x18ea60=_0x18ea60[_0x4122('0x65')](0x0,_0x18ea60['lastIndexOf'](_0x4ff046));}return rp({'method':_0x4122('0x66'),'uri':util['format']('https://crm.%s/crm/private/json/Calls/getFields',_0x18ea60),'qs':{'authtoken':_0x112561['authToken'],'scope':'crmapi'},'json':!![]});}})[_0x4122('0x20')](function(_0x5f0135){if(_0x5f0135){if(_0x5f0135['response']&&_0x5f0135[_0x4122('0x67')]['error']){throw new Error(_0x5f0135[_0x4122('0x67')]['error'][_0x4122('0x28')]);}var _0x42e098=[];if(_0x5f0135[_0x4122('0x68')]&&_0x5f0135['Calls'][_0x4122('0x69')]){if(_0x5f0135['Calls'][_0x4122('0x69')]['FL']){var _0xf3f0c1=['Call\x20Purpose'];for(var _0x32f851=0x0,_0x2e515b=_0x5f0135[_0x4122('0x68')][_0x4122('0x69')]['FL'][_0x4122('0x51')];_0x32f851<_0x2e515b;_0x32f851++){if(_[_0x4122('0x6a')](_0xf3f0c1,_0x5f0135['Calls']['section']['FL'][_0x32f851]['dv'])){_0x42e098[_0x4122('0x6b')]({'id':_0x5f0135[_0x4122('0x68')]['section']['FL'][_0x32f851]['dv'],'name':_0x5f0135['Calls'][_0x4122('0x69')]['FL'][_0x32f851][_0x4122('0x6c')],'custom':_0x5f0135[_0x4122('0x68')][_0x4122('0x69')]['FL'][_0x32f851][_0x4122('0x6d')]===_0x4122('0x6e')?!![]:![],'options':_0x5f0135['Calls'][_0x4122('0x69')]['FL'][_0x32f851]['type']===_0x4122('0x6f')&&_0x5f0135['Calls'][_0x4122('0x69')]['FL'][_0x32f851]['val']?_[_0x4122('0x45')](_0x5f0135['Calls'][_0x4122('0x69')]['FL'][_0x32f851][_0x4122('0x70')],function(_0x5e313f){return{'name':_0x5e313f,'value':_0x5e313f};}):[]});}}}}return{'count':_0x42e098['length'],'rows':_0x42e098};}})[_0x4122('0x20')](respondWithResult(_0x37c8ff,null))['catch'](function(_0x5ca916){var _0x57dadc=_0x1f57b5['query'][_0x4122('0x71')]?0x1f4:_0x5ca916['statusCode']||0x1f4;logger[_0x4122('0x26')](_0x4122('0x72'),'getFields',_0x57dadc,JSON[_0x4122('0x25')](_0x5ca916));delete _0x5ca916[_0x4122('0x35')];if(_0x57dadc===0x191){_0x57dadc=0x190;}_0x37c8ff['status'](_0x57dadc)[_0x4122('0x36')](_0x1f57b5[_0x4122('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5ca916[_0x4122('0x73')]}:_0x5ca916);});}; \ No newline at end of file +var _0x018d=['Call\x20Purpose','push','label','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','include','ZohoAccount','findAll','show','params','find','create','body','getConfigurations','findOne','sort','addConfiguration','AccountId','channel','ZohoConfiguration','ZohoField','Descriptions','getFields','host','authToken','slice','substring','GET','format','crmapi','response','Calls','section'];(function(_0xb9d327,_0x56a96c){var _0x451f36=function(_0x1b506c){while(--_0x1b506c){_0xb9d327['push'](_0xb9d327['shift']());}};_0x451f36(++_0x56a96c);}(_0x018d,0x79));var _0xd018=function(_0x3dff0d,_0x4d59ff){_0x3dff0d=_0x3dff0d-0x0;var _0x352383=_0x018d[_0x3dff0d];return _0x352383;};'use strict';var pdf=require(_0xd018('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd018('0x1'));var zipdir=require(_0xd018('0x2'));var jsonpatch=require(_0xd018('0x3'));var rp=require(_0xd018('0x4'));var moment=require('moment');var BPromise=require(_0xd018('0x5'));var Mustache=require('mustache');var util=require(_0xd018('0x6'));var path=require(_0xd018('0x7'));var sox=require('sox');var csv=require(_0xd018('0x8'));var ejs=require(_0xd018('0x9'));var fs=require('fs');var _=require(_0xd018('0xa'));var squel=require('squel');var crypto=require(_0xd018('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd018('0x8'));var querystring=require(_0xd018('0xc'));var Papa=require('papaparse');var authService=require(_0xd018('0xd'));var hardwareService=require(_0xd018('0xe'));var Redis=require(_0xd018('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xd018('0x10'))(_0xd018('0x11'));var utils=require('../../config/utils');var config=require(_0xd018('0x12'));var db=require(_0xd018('0x13'))['db'];var integrations=require(_0xd018('0x14'));var jayson=require(_0xd018('0x15'));var client=jayson['client'][_0xd018('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x38d43c,_0x2649a5,_0x3fe4c5,_0x51ebe4){return new BPromise(function(_0x1ca820,_0x219491){var _0x4f3fa2=_0x51ebe4||client;return _0x4f3fa2[_0xd018('0x17')](_0x38d43c,_0x3fe4c5)[_0xd018('0x18')](function(_0x52cd8d){logger[_0xd018('0x19')](_0xd018('0x1a'),_0x2649a5,_0xd018('0x1b'));logger[_0xd018('0x1c')](_0xd018('0x1d'),_0x2649a5,_0xd018('0x1b'),JSON['stringify'](_0x52cd8d));if(_0x52cd8d['error']){if(_0x52cd8d[_0xd018('0x1e')][_0xd018('0x1f')]===0x1f4){logger[_0xd018('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0x2649a5,_0x52cd8d['error']['message']);return _0x219491(_0x52cd8d[_0xd018('0x1e')][_0xd018('0x20')]);}logger[_0xd018('0x1e')](_0xd018('0x1a'),_0x2649a5,_0x52cd8d[_0xd018('0x1e')][_0xd018('0x20')]);return _0x1ca820(_0x52cd8d[_0xd018('0x1e')][_0xd018('0x20')]);}else{logger[_0xd018('0x19')](_0xd018('0x1a'),_0x2649a5,'request\x20sent');_0x1ca820(_0x52cd8d[_0xd018('0x21')][_0xd018('0x20')]);}})[_0xd018('0x22')](function(_0x4d517f){logger[_0xd018('0x1e')](_0xd018('0x1a'),_0x2649a5,_0x4d517f);_0x219491(_0x4d517f);});});}function respondWithStatusCode(_0x5bcb08,_0xc8edeb){_0xc8edeb=_0xc8edeb||0xcc;return function(_0x405404){if(_0x405404){return _0x5bcb08['sendStatus'](_0xc8edeb);}return _0x5bcb08[_0xd018('0x23')](_0xc8edeb)[_0xd018('0x24')]();};}function respondWithResult(_0x59856e,_0x4e2d9d){_0x4e2d9d=_0x4e2d9d||0xc8;return function(_0x858f3d){if(_0x858f3d){return _0x59856e[_0xd018('0x23')](_0x4e2d9d)[_0xd018('0x25')](_0x858f3d);}};}function respondWithFilteredResult(_0x533bf9,_0x45e81a){return function(_0x4be6eb){if(_0x4be6eb){var _0x2c0dd3=_0x4be6eb['count'],_0x1abc69=_0x45e81a[_0xd018('0x26')],_0x1d11df=_0x45e81a[_0xd018('0x26')]+_0x45e81a['limit'],_0x369253;if(_0x1d11df>=_0x2c0dd3){_0x1d11df=_0x2c0dd3;_0x369253=0xc8;}else{_0x369253=0xce;}_0x533bf9[_0xd018('0x23')](_0x369253);return _0x533bf9['set'](_0xd018('0x27'),_0x1abc69+'-'+_0x1d11df+'/'+_0x2c0dd3)[_0xd018('0x25')](_0x4be6eb);}return null;};}function patchUpdates(_0x405a5a){return function(_0x4cae4c){try{jsonpatch[_0xd018('0x28')](_0x4cae4c,_0x405a5a,!![]);}catch(_0x596464){return BPromise[_0xd018('0x29')](_0x596464);}return _0x4cae4c[_0xd018('0x2a')]();};}function saveUpdates(_0x13d0fb,_0x375456){return function(_0x40d68a){if(_0x40d68a){return _0x40d68a[_0xd018('0x2b')](_0x13d0fb)[_0xd018('0x18')](function(_0x37be42){return _0x37be42;});}return null;};}function removeEntity(_0x406f27,_0x14c884){return function(_0x1aee85){if(_0x1aee85){return _0x1aee85[_0xd018('0x2c')]()[_0xd018('0x18')](function(){_0x406f27[_0xd018('0x23')](0xcc)[_0xd018('0x24')]();});}};}function handleEntityNotFound(_0x3f167b,_0x5256a5){return function(_0x18f0d4){if(!_0x18f0d4){_0x3f167b['sendStatus'](0x194);}return _0x18f0d4;};}function handleError(_0x12d428,_0x3d7b6c){_0x3d7b6c=_0x3d7b6c||0x1f4;return function(_0x373329){logger['error'](_0x373329[_0xd018('0x2d')]);if(_0x373329['name']){delete _0x373329[_0xd018('0x2e')];}_0x12d428[_0xd018('0x23')](_0x3d7b6c)[_0xd018('0x2f')](_0x373329);};}exports[_0xd018('0x30')]=function(_0x10c902,_0x536864){var _0x2c0bd7={},_0x651578={},_0x2276d1={'count':0x0,'rows':[]};var _0x695c88=db['ZohoAccount'][_0xd018('0x31')];_0x651578['model']=_[_0xd018('0x32')](_0x695c88);_0x651578[_0xd018('0x33')]=_[_0xd018('0x32')](_0x10c902['query']);_0x651578[_0xd018('0x34')]=_[_0xd018('0x35')](_0x651578[_0xd018('0x36')],_0x651578['query']);_0x2c0bd7[_0xd018('0x37')]=_['intersection'](_0x651578['model'],qs['fields'](_0x10c902['query'][_0xd018('0x38')]));_0x2c0bd7[_0xd018('0x37')]=_0x2c0bd7[_0xd018('0x37')][_0xd018('0x39')]?_0x2c0bd7[_0xd018('0x37')]:_0x651578['model'];if(!_0x10c902[_0xd018('0x33')][_0xd018('0x3a')](_0xd018('0x3b'))){_0x2c0bd7[_0xd018('0x3c')]=qs[_0xd018('0x3c')](_0x10c902[_0xd018('0x33')]['limit']);_0x2c0bd7[_0xd018('0x26')]=qs[_0xd018('0x26')](_0x10c902[_0xd018('0x33')][_0xd018('0x26')]);}_0x2c0bd7[_0xd018('0x3d')]=qs['sort'](_0x10c902['query']['sort']);_0x2c0bd7[_0xd018('0x3e')]=qs[_0xd018('0x34')](_[_0xd018('0x3f')](_0x10c902[_0xd018('0x33')],_0x651578['filters']));if(_0x10c902[_0xd018('0x33')][_0xd018('0x40')]){_0x2c0bd7[_0xd018('0x3e')]=_['merge'](_0x2c0bd7['where'],{'$or':_[_0xd018('0x41')](_0x695c88,function(_0x890372){if(_0x890372[_0xd018('0x42')][_0xd018('0x43')]!==_0xd018('0x44')){var _0x50abae={};_0x50abae[_0x890372['field']]={'$like':'%'+_0x10c902['query']['filter']+'%'};return _0x50abae;}})});}_0x2c0bd7=_[_0xd018('0x45')]({},_0x2c0bd7,_0x10c902[_0xd018('0x46')]);var _0x18d7f4={'where':_0x2c0bd7[_0xd018('0x3e')]};return db['ZohoAccount'][_0xd018('0x47')](_0x18d7f4)['then'](function(_0xed3869){_0x2276d1['count']=_0xed3869;if(_0x10c902['query'][_0xd018('0x48')]){_0x2c0bd7[_0xd018('0x49')]=[{'all':!![]}];}return db[_0xd018('0x4a')][_0xd018('0x4b')](_0x2c0bd7);})[_0xd018('0x18')](function(_0x3969d4){_0x2276d1['rows']=_0x3969d4;return _0x2276d1;})[_0xd018('0x18')](respondWithFilteredResult(_0x536864,_0x2c0bd7))[_0xd018('0x22')](handleError(_0x536864,null));};exports[_0xd018('0x4c')]=function(_0x3faca4,_0x3702ca){var _0x294141={'raw':![],'where':{'id':_0x3faca4[_0xd018('0x4d')]['id']}},_0x4d2e12={};_0x4d2e12[_0xd018('0x36')]=_[_0xd018('0x32')](db[_0xd018('0x4a')][_0xd018('0x31')]);_0x4d2e12[_0xd018('0x33')]=_[_0xd018('0x32')](_0x3faca4['query']);_0x4d2e12[_0xd018('0x34')]=_['intersection'](_0x4d2e12[_0xd018('0x36')],_0x4d2e12[_0xd018('0x33')]);_0x294141[_0xd018('0x37')]=_[_0xd018('0x35')](_0x4d2e12['model'],qs[_0xd018('0x38')](_0x3faca4['query'][_0xd018('0x38')]));_0x294141[_0xd018('0x37')]=_0x294141[_0xd018('0x37')][_0xd018('0x39')]?_0x294141[_0xd018('0x37')]:_0x4d2e12['model'];if(_0x3faca4[_0xd018('0x33')][_0xd018('0x48')]){_0x294141[_0xd018('0x49')]=[{'all':!![]}];}_0x294141=_[_0xd018('0x45')]({},_0x294141,_0x3faca4[_0xd018('0x46')]);return db[_0xd018('0x4a')][_0xd018('0x4e')](_0x294141)[_0xd018('0x18')](handleEntityNotFound(_0x3702ca,null))[_0xd018('0x18')](respondWithResult(_0x3702ca,null))[_0xd018('0x22')](handleError(_0x3702ca,null));};exports[_0xd018('0x4f')]=function(_0x345374,_0x303612){return db[_0xd018('0x4a')][_0xd018('0x4f')](_0x345374[_0xd018('0x50')],{})[_0xd018('0x18')](respondWithResult(_0x303612,0xc9))['catch'](handleError(_0x303612,null));};exports[_0xd018('0x2b')]=function(_0x2f4e36,_0x49188c){if(_0x2f4e36[_0xd018('0x50')]['id']){delete _0x2f4e36['body']['id'];}return db[_0xd018('0x4a')][_0xd018('0x4e')]({'where':{'id':_0x2f4e36[_0xd018('0x4d')]['id']}})[_0xd018('0x18')](handleEntityNotFound(_0x49188c,null))[_0xd018('0x18')](saveUpdates(_0x2f4e36['body'],null))[_0xd018('0x18')](respondWithResult(_0x49188c,null))['catch'](handleError(_0x49188c,null));};exports['destroy']=function(_0x25f5c2,_0x1d3a89){return db[_0xd018('0x4a')][_0xd018('0x4e')]({'where':{'id':_0x25f5c2[_0xd018('0x4d')]['id']}})[_0xd018('0x18')](handleEntityNotFound(_0x1d3a89,null))[_0xd018('0x18')](removeEntity(_0x1d3a89,null))['catch'](handleError(_0x1d3a89,null));};exports[_0xd018('0x51')]=function(_0x426ff8,_0xa7cd65,_0x236024){var _0x1db439={};var _0xd1bd5c={};var _0x158562;var _0x44e033;return db[_0xd018('0x4a')][_0xd018('0x52')]({'where':{'id':_0x426ff8[_0xd018('0x4d')]['id']}})[_0xd018('0x18')](handleEntityNotFound(_0xa7cd65,null))['then'](function(_0x3e9b27){if(_0x3e9b27){_0x158562=_0x3e9b27;_0xd1bd5c['model']=_[_0xd018('0x32')](db['ZohoConfiguration'][_0xd018('0x31')]);_0xd1bd5c['query']=_['keys'](_0x426ff8[_0xd018('0x33')]);_0xd1bd5c[_0xd018('0x34')]=_['intersection'](_0xd1bd5c['model'],_0xd1bd5c[_0xd018('0x33')]);_0x1db439['attributes']=_[_0xd018('0x35')](_0xd1bd5c['model'],qs[_0xd018('0x38')](_0x426ff8['query'][_0xd018('0x38')]));_0x1db439[_0xd018('0x37')]=_0x1db439['attributes'][_0xd018('0x39')]?_0x1db439['attributes']:_0xd1bd5c[_0xd018('0x36')];_0x1db439['order']=qs[_0xd018('0x53')](_0x426ff8[_0xd018('0x33')][_0xd018('0x53')]);_0x1db439[_0xd018('0x3e')]=qs['filters'](_[_0xd018('0x3f')](_0x426ff8[_0xd018('0x33')],_0xd1bd5c[_0xd018('0x34')]));if(_0x426ff8['query'][_0xd018('0x40')]){_0x1db439[_0xd018('0x3e')]=_['merge'](_0x1db439[_0xd018('0x3e')],{'$or':_[_0xd018('0x41')](_0x1db439['attributes'],function(_0x21e3d1){var _0x356945={};_0x356945[_0x21e3d1]={'$like':'%'+_0x426ff8['query'][_0xd018('0x40')]+'%'};return _0x356945;})});}_0x1db439=_[_0xd018('0x45')]({},_0x1db439,_0x426ff8[_0xd018('0x46')]);return _0x158562[_0xd018('0x51')](_0x1db439);}})[_0xd018('0x18')](function(_0x1b80dc){if(_0x1b80dc){_0x44e033=_0x1b80dc[_0xd018('0x39')];if(!_0x426ff8[_0xd018('0x33')][_0xd018('0x3a')](_0xd018('0x3b'))){_0x1db439[_0xd018('0x3c')]=qs[_0xd018('0x3c')](_0x426ff8['query']['limit']);_0x1db439[_0xd018('0x26')]=qs[_0xd018('0x26')](_0x426ff8[_0xd018('0x33')]['offset']);}return _0x158562[_0xd018('0x51')](_0x1db439);}})[_0xd018('0x18')](function(_0x40be89){if(_0x40be89){return _0x40be89?{'count':_0x44e033,'rows':_0x40be89}:null;}})[_0xd018('0x18')](respondWithResult(_0xa7cd65,null))[_0xd018('0x22')](handleError(_0xa7cd65,null));};exports[_0xd018('0x54')]=function(_0x270f92,_0x5d5b02,_0x278a07){if(_0x270f92[_0xd018('0x50')]['id']){delete _0x270f92[_0xd018('0x50')]['id'];}return db[_0xd018('0x4a')][_0xd018('0x52')]({'where':{'id':_0x270f92['params']['id']}})[_0xd018('0x18')](handleEntityNotFound(_0x5d5b02,null))[_0xd018('0x18')](function(_0x5179c8){if(_0x5179c8){_0x270f92[_0xd018('0x50')][_0xd018('0x55')]=_0x5179c8['id'];_0x270f92[_0xd018('0x50')]['Subjects']=integrations['getSubjects'](_0x270f92[_0xd018('0x50')][_0xd018('0x56')],_0x270f92[_0xd018('0x50')]['type']);_0x270f92[_0xd018('0x50')]['Descriptions']=integrations['getDescriptions'](_0x270f92[_0xd018('0x50')][_0xd018('0x56')],_0x270f92[_0xd018('0x50')][_0xd018('0x42')]);return db[_0xd018('0x57')][_0xd018('0x4f')](_0x270f92[_0xd018('0x50')],{'include':[{'model':db[_0xd018('0x58')],'as':'Subjects'},{'model':db[_0xd018('0x58')],'as':_0xd018('0x59')}]});}return null;})[_0xd018('0x18')](respondWithResult(_0x5d5b02,null))[_0xd018('0x22')](handleError(_0x5d5b02,null));};exports[_0xd018('0x5a')]=function(_0x59395a,_0x38c1c7,_0x178bb2){var _0x199778='';return db[_0xd018('0x4a')][_0xd018('0x52')]({'where':{'id':_0x59395a[_0xd018('0x4d')]['id']},'attributes':['id',_0xd018('0x5b'),_0xd018('0x5c')]})[_0xd018('0x18')](handleEntityNotFound(_0x38c1c7,null))['then'](function(_0x6c2db7){if(_0x6c2db7){_0x199778=_0x6c2db7['host'];var _0x3560c9=_0x199778[_0xd018('0x5d')](-0x1);if(_0x3560c9==='/'){_0x199778=_0x199778[_0xd018('0x5e')](0x0,_0x199778['lastIndexOf'](_0x3560c9));}return rp({'method':_0xd018('0x5f'),'uri':util[_0xd018('0x60')]('https://crm.%s/crm/private/json/Calls/getFields',_0x199778),'qs':{'authtoken':_0x6c2db7['authToken'],'scope':_0xd018('0x61')},'json':!![]});}})[_0xd018('0x18')](function(_0x1edb14){if(_0x1edb14){if(_0x1edb14[_0xd018('0x62')]&&_0x1edb14[_0xd018('0x62')][_0xd018('0x1e')]){throw new Error(_0x1edb14[_0xd018('0x62')][_0xd018('0x1e')][_0xd018('0x20')]);}var _0x3a22d4=[];if(_0x1edb14[_0xd018('0x63')]&&_0x1edb14[_0xd018('0x63')][_0xd018('0x64')]){if(_0x1edb14[_0xd018('0x63')][_0xd018('0x64')]['FL']){var _0x440821=[_0xd018('0x65')];for(var _0x426c2f=0x0,_0x3d47b0=_0x1edb14['Calls']['section']['FL'][_0xd018('0x39')];_0x426c2f<_0x3d47b0;_0x426c2f++){if(_['includes'](_0x440821,_0x1edb14[_0xd018('0x63')][_0xd018('0x64')]['FL'][_0x426c2f]['dv'])){_0x3a22d4[_0xd018('0x66')]({'id':_0x1edb14[_0xd018('0x63')]['section']['FL'][_0x426c2f]['dv'],'name':_0x1edb14['Calls'][_0xd018('0x64')]['FL'][_0x426c2f][_0xd018('0x67')],'custom':_0x1edb14['Calls'][_0xd018('0x64')]['FL'][_0x426c2f]['customfield']==='true'?!![]:![],'options':_0x1edb14[_0xd018('0x63')][_0xd018('0x64')]['FL'][_0x426c2f][_0xd018('0x42')]===_0xd018('0x68')&&_0x1edb14[_0xd018('0x63')]['section']['FL'][_0x426c2f][_0xd018('0x69')]?_[_0xd018('0x41')](_0x1edb14[_0xd018('0x63')][_0xd018('0x64')]['FL'][_0x426c2f][_0xd018('0x69')],function(_0x5c7fed){return{'name':_0x5c7fed,'value':_0x5c7fed};}):[]});}}}}return{'count':_0x3a22d4[_0xd018('0x39')],'rows':_0x3a22d4};}})[_0xd018('0x18')](respondWithResult(_0x38c1c7,null))['catch'](function(_0x3f08ec){var _0x21f4d6=_0x59395a['query']['test']?0x1f4:_0x3f08ec[_0xd018('0x6a')]||0x1f4;logger[_0xd018('0x1e')](_0xd018('0x6b'),_0xd018('0x5a'),_0x21f4d6,JSON[_0xd018('0x6c')](_0x3f08ec));delete _0x3f08ec[_0xd018('0x2e')];if(_0x21f4d6===0x191){_0x21f4d6=0x190;}_0x38c1c7[_0xd018('0x23')](_0x21f4d6)[_0xd018('0x2f')](_0x59395a[_0xd018('0x33')][_0xd018('0x6d')]?{'message':_0xd018('0x6e'),'statusCode':_0x3f08ec[_0xd018('0x6a')]}:_0x3f08ec);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 52d3f7e..c970676 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 _0x5770=['exports','ZohoAccount','int_zoho_accounts','lodash','../../config/logger','moment','bluebird','request-promise','./intZohoAccount.attributes'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5770,0x8a));var _0x0577=function(_0x1968ab,_0x1a70dd){_0x1968ab=_0x1968ab-0x0;var _0x46be3d=_0x5770[_0x1968ab];return _0x46be3d;};'use strict';var _=require(_0x0577('0x0'));var util=require('util');var logger=require(_0x0577('0x1'))('api');var moment=require(_0x0577('0x2'));var BPromise=require(_0x0577('0x3'));var rp=require(_0x0577('0x4'));var attributes=require(_0x0577('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x0577('0x6')]=function(_0x341fe9,_0xffa871){return _0x341fe9['define'](_0x0577('0x7'),attributes,{'tableName':_0x0577('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0f6=['./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x57f171,_0x17cc21){var _0x4ec8aa=function(_0x46d755){while(--_0x46d755){_0x57f171['push'](_0x57f171['shift']());}};_0x4ec8aa(++_0x17cc21);}(_0xd0f6,0x66));var _0x6d0f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd0f6[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6d0f('0x0'));var util=require(_0x6d0f('0x1'));var logger=require('../../config/logger')(_0x6d0f('0x2'));var moment=require(_0x6d0f('0x3'));var BPromise=require(_0x6d0f('0x4'));var rp=require(_0x6d0f('0x5'));var attributes=require(_0x6d0f('0x6'));var integrations=require(_0x6d0f('0x7'));module[_0x6d0f('0x8')]=function(_0x3ad732,_0x5f41e7){return _0x3ad732[_0x6d0f('0x9')](_0x6d0f('0xa'),attributes,{'tableName':_0x6d0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 034d88d..09f7f35 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 _0xbac0=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','ShowZohoAccount','find'];(function(_0x4177cb,_0x5bbed6){var _0x53decd=function(_0x357334){while(--_0x357334){_0x4177cb['push'](_0x4177cb['shift']());}};_0x53decd(++_0x5bbed6);}(_0xbac0,0x8c));var _0x0bac=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0xbac0[_0x1fa381];return _0x47eefe;};'use strict';var _=require(_0x0bac('0x0'));var util=require('util');var moment=require(_0x0bac('0x1'));var BPromise=require(_0x0bac('0x2'));var rs=require(_0x0bac('0x3'));var fs=require('fs');var Redis=require(_0x0bac('0x4'));var db=require(_0x0bac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bac('0x6'))(_0x0bac('0x7'));var config=require(_0x0bac('0x8'));var jayson=require(_0x0bac('0x9'));var client=jayson[_0x0bac('0xa')][_0x0bac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ad9ce,_0x28836b,_0x1d6908){return new BPromise(function(_0x1838cb,_0x12e967){return client[_0x0bac('0xc')](_0x2ad9ce,_0x1d6908)[_0x0bac('0xd')](function(_0xdcfb4){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x28836b,_0x0bac('0xe'));logger[_0x0bac('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x28836b,_0x0bac('0xe'),JSON[_0x0bac('0x10')](_0xdcfb4));if(_0xdcfb4[_0x0bac('0x11')]){if(_0xdcfb4[_0x0bac('0x11')]['code']===0x1f4){logger[_0x0bac('0x11')](_0x0bac('0x12'),_0x28836b,_0xdcfb4[_0x0bac('0x11')][_0x0bac('0x13')]);return _0x12e967(_0xdcfb4[_0x0bac('0x11')][_0x0bac('0x13')]);}logger[_0x0bac('0x11')](_0x0bac('0x12'),_0x28836b,_0xdcfb4[_0x0bac('0x11')]['message']);return _0x1838cb(_0xdcfb4[_0x0bac('0x11')][_0x0bac('0x13')]);}else{logger[_0x0bac('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x28836b,_0x0bac('0xe'));_0x1838cb(_0xdcfb4[_0x0bac('0x15')][_0x0bac('0x13')]);}})[_0x0bac('0x16')](function(_0x52f586){logger['error'](_0x0bac('0x12'),_0x28836b,_0x52f586);_0x12e967(_0x52f586);});});}exports[_0x0bac('0x17')]=function(_0x81a67){var _0x280f3c=this;return new Promise(function(_0x4a268d,_0x159756){return db[_0x0bac('0x18')][_0x0bac('0x19')]({'raw':_0x81a67[_0x0bac('0x1a')]?_0x81a67[_0x0bac('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x81a67['options']?_0x81a67[_0x0bac('0x1a')][_0x0bac('0x1b')]||null:null,'attributes':_0x81a67['options']?_0x81a67[_0x0bac('0x1a')][_0x0bac('0x1c')]||null:null,'limit':_0x81a67[_0x0bac('0x1a')]?_0x81a67[_0x0bac('0x1a')][_0x0bac('0x1d')]||null:null,'include':_0x81a67[_0x0bac('0x1a')]?_0x81a67[_0x0bac('0x1a')][_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x81a67[_0x0bac('0x1a')][_0x0bac('0x1e')],function(_0x18b4f5){return{'model':db[_0x18b4f5[_0x0bac('0x20')]],'as':_0x18b4f5['as'],'attributes':_0x18b4f5[_0x0bac('0x1c')],'include':_0x18b4f5[_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x18b4f5[_0x0bac('0x1e')],function(_0x5b5f1d){return{'model':db[_0x5b5f1d[_0x0bac('0x20')]],'as':_0x5b5f1d['as'],'attributes':_0x5b5f1d[_0x0bac('0x1c')],'include':_0x5b5f1d[_0x0bac('0x1e')]?_['map'](_0x5b5f1d[_0x0bac('0x1e')],function(_0x419f51){return{'model':db[_0x419f51[_0x0bac('0x20')]],'as':_0x419f51['as'],'attributes':_0x419f51[_0x0bac('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e0a14){logger[_0x0bac('0x14')](_0x0bac('0x17'),_0x81a67);logger[_0x0bac('0xf')](_0x0bac('0x17'),_0x81a67,JSON['stringify'](_0x3e0a14));_0x4a268d(_0x3e0a14);})[_0x0bac('0x16')](function(_0x1f30c7){logger[_0x0bac('0x11')](_0x0bac('0x17'),_0x1f30c7[_0x0bac('0x13')],_0x81a67);_0x159756(_0x280f3c[_0x0bac('0x11')](0x1f4,_0x1f30c7['message']));});});};exports[_0x0bac('0x21')]=function(_0xb2b132){var _0x293080=this;return new Promise(function(_0x357b5b,_0x3b6c39){return db['ZohoAccount'][_0x0bac('0x22')]({'raw':_0xb2b132[_0x0bac('0x1a')]?_0xb2b132[_0x0bac('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xb2b132[_0x0bac('0x1a')]?_0xb2b132[_0x0bac('0x1a')]['where']||null:null,'attributes':_0xb2b132[_0x0bac('0x1a')]?_0xb2b132['options'][_0x0bac('0x1c')]||null:null,'include':_0xb2b132['options']?_0xb2b132[_0x0bac('0x1a')][_0x0bac('0x1e')]?_['map'](_0xb2b132[_0x0bac('0x1a')][_0x0bac('0x1e')],function(_0x3b9298){return{'model':db[_0x3b9298[_0x0bac('0x20')]],'as':_0x3b9298['as'],'attributes':_0x3b9298[_0x0bac('0x1c')],'include':_0x3b9298[_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x3b9298[_0x0bac('0x1e')],function(_0x252627){return{'model':db[_0x252627[_0x0bac('0x20')]],'as':_0x252627['as'],'attributes':_0x252627[_0x0bac('0x1c')],'include':_0x252627[_0x0bac('0x1e')]?_[_0x0bac('0x1f')](_0x252627[_0x0bac('0x1e')],function(_0x398997){return{'model':db[_0x398997[_0x0bac('0x20')]],'as':_0x398997['as'],'attributes':_0x398997[_0x0bac('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46daf0){logger[_0x0bac('0x14')](_0x0bac('0x21'),_0xb2b132);logger[_0x0bac('0xf')](_0x0bac('0x21'),_0xb2b132,JSON[_0x0bac('0x10')](_0x46daf0));_0x357b5b(_0x46daf0);})[_0x0bac('0x16')](function(_0x583be6){logger[_0x0bac('0x11')]('ShowZohoAccount',_0x583be6[_0x0bac('0x13')],_0xb2b132);_0x3b6c39(_0x293080[_0x0bac('0x11')](0x1f4,_0x583be6['message']));});});}; \ No newline at end of file +var _0xc7ca=['include','map','model','attributes','then','debug','GetZohoAccount','stringify','find','raw','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','catch','ZohoAccount','findAll','options','where','limit'];(function(_0x1ed353,_0x18317e){var _0x24472d=function(_0x51bd1b){while(--_0x51bd1b){_0x1ed353['push'](_0x1ed353['shift']());}};_0x24472d(++_0x18317e);}(_0xc7ca,0xdd));var _0xac7c=function(_0x21dcb7,_0x5c2391){_0x21dcb7=_0x21dcb7-0x0;var _0x2ae697=_0xc7ca[_0x21dcb7];return _0x2ae697;};'use strict';var _=require(_0xac7c('0x0'));var util=require('util');var moment=require(_0xac7c('0x1'));var BPromise=require(_0xac7c('0x2'));var rs=require(_0xac7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac7c('0x4'))['db'];var utils=require(_0xac7c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xac7c('0x6'));var jayson=require(_0xac7c('0x7'));var client=jayson[_0xac7c('0x8')][_0xac7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bfedf,_0x32779f,_0x17ecb6){return new BPromise(function(_0x30422f,_0x1b283b){return client[_0xac7c('0xa')](_0x2bfedf,_0x17ecb6)['then'](function(_0x3810b0){logger[_0xac7c('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x32779f,_0xac7c('0xc'));logger['debug'](_0xac7c('0xd'),_0x32779f,_0xac7c('0xc'),JSON['stringify'](_0x3810b0));if(_0x3810b0[_0xac7c('0xe')]){if(_0x3810b0[_0xac7c('0xe')][_0xac7c('0xf')]===0x1f4){logger[_0xac7c('0xe')](_0xac7c('0x10'),_0x32779f,_0x3810b0[_0xac7c('0xe')][_0xac7c('0x11')]);return _0x1b283b(_0x3810b0[_0xac7c('0xe')][_0xac7c('0x11')]);}logger[_0xac7c('0xe')](_0xac7c('0x10'),_0x32779f,_0x3810b0[_0xac7c('0xe')][_0xac7c('0x11')]);return _0x30422f(_0x3810b0[_0xac7c('0xe')][_0xac7c('0x11')]);}else{logger['info'](_0xac7c('0x10'),_0x32779f,_0xac7c('0xc'));_0x30422f(_0x3810b0['result'][_0xac7c('0x11')]);}})[_0xac7c('0x12')](function(_0x44867f){logger['error'](_0xac7c('0x10'),_0x32779f,_0x44867f);_0x1b283b(_0x44867f);});});}exports['GetZohoAccount']=function(_0x1acd78){var _0x5eb07c=this;return new Promise(function(_0x22861a,_0xc4d86f){return db[_0xac7c('0x13')][_0xac7c('0x14')]({'raw':_0x1acd78['options']?_0x1acd78[_0xac7c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1acd78[_0xac7c('0x15')]?_0x1acd78[_0xac7c('0x15')][_0xac7c('0x16')]||null:null,'attributes':_0x1acd78[_0xac7c('0x15')]?_0x1acd78[_0xac7c('0x15')]['attributes']||null:null,'limit':_0x1acd78[_0xac7c('0x15')]?_0x1acd78[_0xac7c('0x15')][_0xac7c('0x17')]||null:null,'include':_0x1acd78[_0xac7c('0x15')]?_0x1acd78[_0xac7c('0x15')][_0xac7c('0x18')]?_[_0xac7c('0x19')](_0x1acd78['options'][_0xac7c('0x18')],function(_0x59c086){return{'model':db[_0x59c086[_0xac7c('0x1a')]],'as':_0x59c086['as'],'attributes':_0x59c086[_0xac7c('0x1b')],'include':_0x59c086['include']?_[_0xac7c('0x19')](_0x59c086['include'],function(_0x405ac9){return{'model':db[_0x405ac9[_0xac7c('0x1a')]],'as':_0x405ac9['as'],'attributes':_0x405ac9['attributes'],'include':_0x405ac9[_0xac7c('0x18')]?_['map'](_0x405ac9[_0xac7c('0x18')],function(_0x3c587d){return{'model':db[_0x3c587d['model']],'as':_0x3c587d['as'],'attributes':_0x3c587d[_0xac7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac7c('0x1c')](function(_0x17ee57){logger[_0xac7c('0xb')]('GetZohoAccount',_0x1acd78);logger[_0xac7c('0x1d')](_0xac7c('0x1e'),_0x1acd78,JSON[_0xac7c('0x1f')](_0x17ee57));_0x22861a(_0x17ee57);})[_0xac7c('0x12')](function(_0x127b39){logger[_0xac7c('0xe')](_0xac7c('0x1e'),_0x127b39[_0xac7c('0x11')],_0x1acd78);_0xc4d86f(_0x5eb07c[_0xac7c('0xe')](0x1f4,_0x127b39[_0xac7c('0x11')]));});});};exports['ShowZohoAccount']=function(_0x4c6e88){var _0x1837ad=this;return new Promise(function(_0x3280b1,_0x31dfe3){return db[_0xac7c('0x13')][_0xac7c('0x20')]({'raw':_0x4c6e88[_0xac7c('0x15')]?_0x4c6e88[_0xac7c('0x15')][_0xac7c('0x21')]===undefined?!![]:![]:!![],'where':_0x4c6e88[_0xac7c('0x15')]?_0x4c6e88[_0xac7c('0x15')][_0xac7c('0x16')]||null:null,'attributes':_0x4c6e88[_0xac7c('0x15')]?_0x4c6e88['options'][_0xac7c('0x1b')]||null:null,'include':_0x4c6e88[_0xac7c('0x15')]?_0x4c6e88[_0xac7c('0x15')][_0xac7c('0x18')]?_[_0xac7c('0x19')](_0x4c6e88['options'][_0xac7c('0x18')],function(_0x3c0682){return{'model':db[_0x3c0682[_0xac7c('0x1a')]],'as':_0x3c0682['as'],'attributes':_0x3c0682['attributes'],'include':_0x3c0682[_0xac7c('0x18')]?_[_0xac7c('0x19')](_0x3c0682[_0xac7c('0x18')],function(_0x2a4714){return{'model':db[_0x2a4714['model']],'as':_0x2a4714['as'],'attributes':_0x2a4714[_0xac7c('0x1b')],'include':_0x2a4714[_0xac7c('0x18')]?_[_0xac7c('0x19')](_0x2a4714[_0xac7c('0x18')],function(_0x3bfb9a){return{'model':db[_0x3bfb9a[_0xac7c('0x1a')]],'as':_0x3bfb9a['as'],'attributes':_0x3bfb9a[_0xac7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac7c('0x1c')](function(_0x1b4fde){logger[_0xac7c('0xb')](_0xac7c('0x22'),_0x4c6e88);logger[_0xac7c('0x1d')](_0xac7c('0x22'),_0x4c6e88,JSON[_0xac7c('0x1f')](_0x1b4fde));_0x3280b1(_0x1b4fde);})[_0xac7c('0x12')](function(_0x3392e6){logger['error'](_0xac7c('0x22'),_0x3392e6['message'],_0x4c6e88);_0x31dfe3(_0x1837ad[_0xac7c('0xe')](0x1f4,_0x3392e6['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e0adbc5..ccfd9ca 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 _0x3de8=['util','connect-timeout','express','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','create','update','destroy','multer'];(function(_0x4a3c2a,_0x972c8a){var _0x14a1f0=function(_0x168666){while(--_0x168666){_0x4a3c2a['push'](_0x4a3c2a['shift']());}};_0x14a1f0(++_0x972c8a);}(_0x3de8,0xe9));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x83de('0x0'));var util=require(_0x83de('0x1'));var path=require('path');var timeout=require(_0x83de('0x2'));var express=require(_0x83de('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x83de('0x4'));var controller=require(_0x83de('0x5'));router[_0x83de('0x6')]('/',auth[_0x83de('0x7')](),controller[_0x83de('0x8')]);router['get'](_0x83de('0x9'),auth[_0x83de('0x7')](),controller[_0x83de('0xa')]);router['get']('/:id/fields',auth[_0x83de('0x7')](),controller[_0x83de('0xb')]);router['get']('/:id/subjects',auth[_0x83de('0x7')](),controller[_0x83de('0xc')]);router[_0x83de('0x6')](_0x83de('0xd'),auth[_0x83de('0x7')](),controller[_0x83de('0xe')]);router['post']('/',auth[_0x83de('0x7')](),controller[_0x83de('0xf')]);router['put'](_0x83de('0x9'),auth[_0x83de('0x7')](),controller[_0x83de('0x10')]);router['delete'](_0x83de('0x9'),auth['isAuthenticated'](),controller[_0x83de('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb38e=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','multer'];(function(_0x46abbb,_0x262d1e){var _0x11d318=function(_0x235223){while(--_0x235223){_0x46abbb['push'](_0x46abbb['shift']());}};_0x11d318(++_0x262d1e);}(_0xb38e,0xa7));var _0xeb38=function(_0xf35777,_0xa50360){_0xf35777=_0xf35777-0x0;var _0x3fdd8e=_0xb38e[_0xf35777];return _0x3fdd8e;};'use strict';var multer=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var path=require(_0xeb38('0x2'));var timeout=require(_0xeb38('0x3'));var express=require(_0xeb38('0x4'));var router=express[_0xeb38('0x5')]();var auth=require(_0xeb38('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb38('0x7'));var controller=require(_0xeb38('0x8'));router['get']('/',auth[_0xeb38('0x9')](),controller[_0xeb38('0xa')]);router[_0xeb38('0xb')](_0xeb38('0xc'),auth['isAuthenticated'](),controller[_0xeb38('0xd')]);router[_0xeb38('0xb')](_0xeb38('0xe'),auth[_0xeb38('0x9')](),controller['getFields']);router[_0xeb38('0xb')](_0xeb38('0xf'),auth[_0xeb38('0x9')](),controller[_0xeb38('0x10')]);router[_0xeb38('0xb')](_0xeb38('0x11'),auth[_0xeb38('0x9')](),controller['getDescriptions']);router[_0xeb38('0x12')]('/',auth['isAuthenticated'](),controller[_0xeb38('0x13')]);router[_0xeb38('0x14')]('/:id',auth[_0xeb38('0x9')](),controller[_0xeb38('0x15')]);router[_0xeb38('0x16')](_0xeb38('0xc'),auth[_0xeb38('0x9')](),controller[_0xeb38('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 5321bb0..169ba20 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 _0x7b0e=['sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7b0e,0x18f));var _0xe7b0=function(_0x363db2,_0x260b00){_0x363db2=_0x363db2-0x0;var _0x5e3c32=_0x7b0e[_0x363db2];return _0x5e3c32;};'use strict';var Sequelize=require(_0xe7b0('0x0'));module[_0xe7b0('0x1')]={'name':{'type':Sequelize[_0xe7b0('0x2')]},'description':{'type':Sequelize[_0xe7b0('0x2')]}}; \ No newline at end of file +var _0xc568=['STRING','sequelize'];(function(_0x2a49f7,_0x50dacc){var _0x471473=function(_0x5055b1){while(--_0x5055b1){_0x2a49f7['push'](_0x2a49f7['shift']());}};_0x471473(++_0x50dacc);}(_0xc568,0xfd));var _0x8c56=function(_0x105ed5,_0x48bff3){_0x105ed5=_0x105ed5-0x0;var _0x493752=_0xc568[_0x105ed5];return _0x493752;};'use strict';var Sequelize=require(_0x8c56('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c56('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 42d152b..1d5f394 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 _0xab89=['findOne','length','order','filter','getSubjects','nolimit','getDescriptions','ZohoField','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','name','send','index','ZohoConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','map','type','key','field','merge','options','findAll','rows','show','params','include','find','create','body','destroy','getFields'];(function(_0x26c9f2,_0x1c5b48){var _0x50a700=function(_0x282a37){while(--_0x282a37){_0x26c9f2['push'](_0x26c9f2['shift']());}};_0x50a700(++_0x1c5b48);}(_0xab89,0x66));var _0x9ab8=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xab89[_0x341e0f];return _0x59555a;};'use strict';var pdf=require(_0x9ab8('0x0'));var emlformat=require(_0x9ab8('0x1'));var rimraf=require(_0x9ab8('0x2'));var zipdir=require(_0x9ab8('0x3'));var jsonpatch=require(_0x9ab8('0x4'));var rp=require(_0x9ab8('0x5'));var moment=require(_0x9ab8('0x6'));var BPromise=require(_0x9ab8('0x7'));var Mustache=require(_0x9ab8('0x8'));var util=require('util');var path=require(_0x9ab8('0x9'));var sox=require(_0x9ab8('0xa'));var csv=require('to-csv');var ejs=require(_0x9ab8('0xb'));var fs=require('fs');var _=require(_0x9ab8('0xc'));var squel=require(_0x9ab8('0xd'));var crypto=require(_0x9ab8('0xe'));var jsforce=require(_0x9ab8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9ab8('0x10'));var querystring=require(_0x9ab8('0x11'));var Papa=require(_0x9ab8('0x12'));var authService=require(_0x9ab8('0x13'));var hardwareService=require(_0x9ab8('0x14'));var Redis=require(_0x9ab8('0x15'));var qs=require(_0x9ab8('0x16'));var logger=require(_0x9ab8('0x17'))(_0x9ab8('0x18'));var utils=require(_0x9ab8('0x19'));var config=require(_0x9ab8('0x1a'));var db=require(_0x9ab8('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9ab8('0x1c')][_0x9ab8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x33d469,_0x3a42a5,_0x4b9ac6,_0x19925f){return new BPromise(function(_0x40ba3f,_0xbb765c){var _0x26ef7b=_0x19925f||client;return _0x26ef7b[_0x9ab8('0x1e')](_0x33d469,_0x4b9ac6)[_0x9ab8('0x1f')](function(_0x28ae2a){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3a42a5,_0x9ab8('0x20'));logger[_0x9ab8('0x21')](_0x9ab8('0x22'),_0x3a42a5,_0x9ab8('0x20'),JSON[_0x9ab8('0x23')](_0x28ae2a));if(_0x28ae2a[_0x9ab8('0x24')]){if(_0x28ae2a[_0x9ab8('0x24')][_0x9ab8('0x25')]===0x1f4){logger[_0x9ab8('0x24')](_0x9ab8('0x26'),_0x3a42a5,_0x28ae2a[_0x9ab8('0x24')][_0x9ab8('0x27')]);return _0xbb765c(_0x28ae2a['error'][_0x9ab8('0x27')]);}logger['error'](_0x9ab8('0x26'),_0x3a42a5,_0x28ae2a['error']['message']);return _0x40ba3f(_0x28ae2a[_0x9ab8('0x24')][_0x9ab8('0x27')]);}else{logger[_0x9ab8('0x28')](_0x9ab8('0x26'),_0x3a42a5,_0x9ab8('0x20'));_0x40ba3f(_0x28ae2a[_0x9ab8('0x29')][_0x9ab8('0x27')]);}})[_0x9ab8('0x2a')](function(_0x45bed0){logger[_0x9ab8('0x24')](_0x9ab8('0x26'),_0x3a42a5,_0x45bed0);_0xbb765c(_0x45bed0);});});}function respondWithStatusCode(_0x499feb,_0x161576){_0x161576=_0x161576||0xcc;return function(_0x15d20e){if(_0x15d20e){return _0x499feb[_0x9ab8('0x2b')](_0x161576);}return _0x499feb[_0x9ab8('0x2c')](_0x161576)[_0x9ab8('0x2d')]();};}function respondWithResult(_0x44ef6e,_0x571a24){_0x571a24=_0x571a24||0xc8;return function(_0x58d925){if(_0x58d925){return _0x44ef6e[_0x9ab8('0x2c')](_0x571a24)[_0x9ab8('0x2e')](_0x58d925);}};}function respondWithFilteredResult(_0xc03154,_0x46e611){return function(_0x57ec09){if(_0x57ec09){var _0x11411c=_0x57ec09[_0x9ab8('0x2f')],_0x293f7c=_0x46e611[_0x9ab8('0x30')],_0x485212=_0x46e611[_0x9ab8('0x30')]+_0x46e611[_0x9ab8('0x31')],_0x43fe66;if(_0x485212>=_0x11411c){_0x485212=_0x11411c;_0x43fe66=0xc8;}else{_0x43fe66=0xce;}_0xc03154[_0x9ab8('0x2c')](_0x43fe66);return _0xc03154[_0x9ab8('0x32')](_0x9ab8('0x33'),_0x293f7c+'-'+_0x485212+'/'+_0x11411c)[_0x9ab8('0x2e')](_0x57ec09);}return null;};}function patchUpdates(_0x414e07){return function(_0x3d7a8c){try{jsonpatch[_0x9ab8('0x34')](_0x3d7a8c,_0x414e07,!![]);}catch(_0x247cf0){return BPromise['reject'](_0x247cf0);}return _0x3d7a8c['save']();};}function saveUpdates(_0x14dec7,_0xc9e23f){return function(_0x41cf8e){if(_0x41cf8e){return _0x41cf8e[_0x9ab8('0x35')](_0x14dec7)[_0x9ab8('0x1f')](function(_0x335e8){return _0x335e8;});}return null;};}function removeEntity(_0x403443,_0x53a231){return function(_0x2eba08){if(_0x2eba08){return _0x2eba08['destroy']()[_0x9ab8('0x1f')](function(){_0x403443[_0x9ab8('0x2c')](0xcc)[_0x9ab8('0x2d')]();});}};}function handleEntityNotFound(_0x2a09e5,_0xa7f09e){return function(_0x14b670){if(!_0x14b670){_0x2a09e5[_0x9ab8('0x2b')](0x194);}return _0x14b670;};}function handleError(_0x5108f9,_0x4a4737){_0x4a4737=_0x4a4737||0x1f4;return function(_0x4fa098){logger[_0x9ab8('0x24')](_0x4fa098['stack']);if(_0x4fa098['name']){delete _0x4fa098[_0x9ab8('0x36')];}_0x5108f9[_0x9ab8('0x2c')](_0x4a4737)[_0x9ab8('0x37')](_0x4fa098);};}exports[_0x9ab8('0x38')]=function(_0x5978d8,_0x5070d5){var _0x5e9143={},_0x1f7b2c={},_0xe8cbb1={'count':0x0,'rows':[]};var _0x39c272=db[_0x9ab8('0x39')][_0x9ab8('0x3a')];_0x1f7b2c[_0x9ab8('0x3b')]=_[_0x9ab8('0x3c')](_0x39c272);_0x1f7b2c[_0x9ab8('0x3d')]=_[_0x9ab8('0x3c')](_0x5978d8['query']);_0x1f7b2c['filters']=_['intersection'](_0x1f7b2c[_0x9ab8('0x3b')],_0x1f7b2c['query']);_0x5e9143[_0x9ab8('0x3e')]=_[_0x9ab8('0x3f')](_0x1f7b2c[_0x9ab8('0x3b')],qs[_0x9ab8('0x40')](_0x5978d8[_0x9ab8('0x3d')][_0x9ab8('0x40')]));_0x5e9143[_0x9ab8('0x3e')]=_0x5e9143[_0x9ab8('0x3e')]['length']?_0x5e9143[_0x9ab8('0x3e')]:_0x1f7b2c[_0x9ab8('0x3b')];if(!_0x5978d8[_0x9ab8('0x3d')][_0x9ab8('0x41')]('nolimit')){_0x5e9143[_0x9ab8('0x31')]=qs[_0x9ab8('0x31')](_0x5978d8[_0x9ab8('0x3d')]['limit']);_0x5e9143[_0x9ab8('0x30')]=qs[_0x9ab8('0x30')](_0x5978d8[_0x9ab8('0x3d')][_0x9ab8('0x30')]);}_0x5e9143['order']=qs[_0x9ab8('0x42')](_0x5978d8[_0x9ab8('0x3d')][_0x9ab8('0x42')]);_0x5e9143[_0x9ab8('0x43')]=qs[_0x9ab8('0x44')](_[_0x9ab8('0x45')](_0x5978d8[_0x9ab8('0x3d')],_0x1f7b2c[_0x9ab8('0x44')]));if(_0x5978d8['query']['filter']){_0x5e9143[_0x9ab8('0x43')]=_['merge'](_0x5e9143[_0x9ab8('0x43')],{'$or':_[_0x9ab8('0x46')](_0x39c272,function(_0x25d19e){if(_0x25d19e[_0x9ab8('0x47')][_0x9ab8('0x48')]!=='VIRTUAL'){var _0x1a177c={};_0x1a177c[_0x25d19e[_0x9ab8('0x49')]]={'$like':'%'+_0x5978d8[_0x9ab8('0x3d')]['filter']+'%'};return _0x1a177c;}})});}_0x5e9143=_[_0x9ab8('0x4a')]({},_0x5e9143,_0x5978d8[_0x9ab8('0x4b')]);var _0x8ef085={'where':_0x5e9143['where']};return db[_0x9ab8('0x39')][_0x9ab8('0x2f')](_0x8ef085)[_0x9ab8('0x1f')](function(_0x372f21){_0xe8cbb1['count']=_0x372f21;if(_0x5978d8[_0x9ab8('0x3d')]['includeAll']){_0x5e9143['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x9ab8('0x4c')](_0x5e9143);})[_0x9ab8('0x1f')](function(_0x5190ed){_0xe8cbb1[_0x9ab8('0x4d')]=_0x5190ed;return _0xe8cbb1;})[_0x9ab8('0x1f')](respondWithFilteredResult(_0x5070d5,_0x5e9143))['catch'](handleError(_0x5070d5,null));};exports[_0x9ab8('0x4e')]=function(_0x1bef31,_0xeb86f8){var _0x55c4ea={'raw':![],'where':{'id':_0x1bef31[_0x9ab8('0x4f')]['id']}},_0x38db62={};_0x38db62['model']=_['keys'](db[_0x9ab8('0x39')]['rawAttributes']);_0x38db62[_0x9ab8('0x3d')]=_['keys'](_0x1bef31[_0x9ab8('0x3d')]);_0x38db62['filters']=_['intersection'](_0x38db62[_0x9ab8('0x3b')],_0x38db62[_0x9ab8('0x3d')]);_0x55c4ea[_0x9ab8('0x3e')]=_['intersection'](_0x38db62['model'],qs[_0x9ab8('0x40')](_0x1bef31['query'][_0x9ab8('0x40')]));_0x55c4ea[_0x9ab8('0x3e')]=_0x55c4ea[_0x9ab8('0x3e')]['length']?_0x55c4ea[_0x9ab8('0x3e')]:_0x38db62['model'];if(_0x1bef31[_0x9ab8('0x3d')]['includeAll']){_0x55c4ea[_0x9ab8('0x50')]=[{'all':!![]}];}_0x55c4ea=_[_0x9ab8('0x4a')]({},_0x55c4ea,_0x1bef31['options']);return db[_0x9ab8('0x39')][_0x9ab8('0x51')](_0x55c4ea)['then'](handleEntityNotFound(_0xeb86f8,null))['then'](respondWithResult(_0xeb86f8,null))[_0x9ab8('0x2a')](handleError(_0xeb86f8,null));};exports['create']=function(_0x55bd6c,_0x5d1272){return db[_0x9ab8('0x39')][_0x9ab8('0x52')](_0x55bd6c['body'],{})[_0x9ab8('0x1f')](respondWithResult(_0x5d1272,0xc9))[_0x9ab8('0x2a')](handleError(_0x5d1272,null));};exports['update']=function(_0x4671a0,_0x210afb){if(_0x4671a0['body']['id']){delete _0x4671a0[_0x9ab8('0x53')]['id'];}return db['ZohoConfiguration'][_0x9ab8('0x51')]({'where':{'id':_0x4671a0[_0x9ab8('0x4f')]['id']}})[_0x9ab8('0x1f')](handleEntityNotFound(_0x210afb,null))[_0x9ab8('0x1f')](saveUpdates(_0x4671a0[_0x9ab8('0x53')],null))[_0x9ab8('0x1f')](respondWithResult(_0x210afb,null))[_0x9ab8('0x2a')](handleError(_0x210afb,null));};exports[_0x9ab8('0x54')]=function(_0x38969c,_0x4e5325){return db[_0x9ab8('0x39')][_0x9ab8('0x51')]({'where':{'id':_0x38969c[_0x9ab8('0x4f')]['id']}})[_0x9ab8('0x1f')](handleEntityNotFound(_0x4e5325,null))[_0x9ab8('0x1f')](removeEntity(_0x4e5325,null))[_0x9ab8('0x2a')](handleError(_0x4e5325,null));};exports[_0x9ab8('0x55')]=function(_0x103938,_0xf3185b,_0x224337){var _0xf79684={};var _0x495a57={};var _0x3a59b4;var _0x1b3ab1;return db[_0x9ab8('0x39')][_0x9ab8('0x56')]({'where':{'id':_0x103938['params']['id']}})[_0x9ab8('0x1f')](handleEntityNotFound(_0xf3185b,null))['then'](function(_0x4b700d){if(_0x4b700d){_0x3a59b4=_0x4b700d;_0x495a57[_0x9ab8('0x3b')]=_[_0x9ab8('0x3c')](db['ZohoField'][_0x9ab8('0x3a')]);_0x495a57[_0x9ab8('0x3d')]=_[_0x9ab8('0x3c')](_0x103938[_0x9ab8('0x3d')]);_0x495a57['filters']=_[_0x9ab8('0x3f')](_0x495a57[_0x9ab8('0x3b')],_0x495a57[_0x9ab8('0x3d')]);_0xf79684[_0x9ab8('0x3e')]=_[_0x9ab8('0x3f')](_0x495a57[_0x9ab8('0x3b')],qs[_0x9ab8('0x40')](_0x103938['query'][_0x9ab8('0x40')]));_0xf79684['attributes']=_0xf79684[_0x9ab8('0x3e')][_0x9ab8('0x57')]?_0xf79684[_0x9ab8('0x3e')]:_0x495a57[_0x9ab8('0x3b')];_0xf79684[_0x9ab8('0x58')]=qs[_0x9ab8('0x42')](_0x103938['query']['sort']);_0xf79684[_0x9ab8('0x43')]=qs[_0x9ab8('0x44')](_[_0x9ab8('0x45')](_0x103938[_0x9ab8('0x3d')],_0x495a57['filters']));if(_0x103938['query'][_0x9ab8('0x59')]){_0xf79684[_0x9ab8('0x43')]=_['merge'](_0xf79684[_0x9ab8('0x43')],{'$or':_[_0x9ab8('0x46')](_0xf79684['attributes'],function(_0x326d2a){var _0x3cdcd5={};_0x3cdcd5[_0x326d2a]={'$like':'%'+_0x103938[_0x9ab8('0x3d')][_0x9ab8('0x59')]+'%'};return _0x3cdcd5;})});}_0xf79684=_[_0x9ab8('0x4a')]({},_0xf79684,_0x103938[_0x9ab8('0x4b')]);return _0x3a59b4[_0x9ab8('0x55')](_0xf79684);}})[_0x9ab8('0x1f')](function(_0x5ee609){if(_0x5ee609){_0x1b3ab1=_0x5ee609[_0x9ab8('0x57')];if(!_0x103938[_0x9ab8('0x3d')][_0x9ab8('0x41')]('nolimit')){_0xf79684['limit']=qs['limit'](_0x103938[_0x9ab8('0x3d')][_0x9ab8('0x31')]);_0xf79684['offset']=qs[_0x9ab8('0x30')](_0x103938[_0x9ab8('0x3d')]['offset']);}return _0x3a59b4[_0x9ab8('0x55')](_0xf79684);}})[_0x9ab8('0x1f')](function(_0x41f532){if(_0x41f532){return _0x41f532?{'count':_0x1b3ab1,'rows':_0x41f532}:null;}})[_0x9ab8('0x1f')](respondWithResult(_0xf3185b,null))[_0x9ab8('0x2a')](handleError(_0xf3185b,null));};exports['getSubjects']=function(_0x1cce4b,_0x1dfdd4,_0x19e54d){var _0x5a68a7={};var _0x5181b9={};var _0x131073;var _0x554cfb;return db[_0x9ab8('0x39')][_0x9ab8('0x56')]({'where':{'id':_0x1cce4b[_0x9ab8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1dfdd4,null))[_0x9ab8('0x1f')](function(_0x49adc9){if(_0x49adc9){_0x131073=_0x49adc9;_0x5181b9['model']=_[_0x9ab8('0x3c')](db['ZohoField'][_0x9ab8('0x3a')]);_0x5181b9[_0x9ab8('0x3d')]=_[_0x9ab8('0x3c')](_0x1cce4b[_0x9ab8('0x3d')]);_0x5181b9[_0x9ab8('0x44')]=_[_0x9ab8('0x3f')](_0x5181b9['model'],_0x5181b9[_0x9ab8('0x3d')]);_0x5a68a7['attributes']=_[_0x9ab8('0x3f')](_0x5181b9[_0x9ab8('0x3b')],qs[_0x9ab8('0x40')](_0x1cce4b[_0x9ab8('0x3d')][_0x9ab8('0x40')]));_0x5a68a7[_0x9ab8('0x3e')]=_0x5a68a7['attributes'][_0x9ab8('0x57')]?_0x5a68a7['attributes']:_0x5181b9[_0x9ab8('0x3b')];_0x5a68a7['order']=qs['sort'](_0x1cce4b[_0x9ab8('0x3d')][_0x9ab8('0x42')]);_0x5a68a7[_0x9ab8('0x43')]=qs[_0x9ab8('0x44')](_['pick'](_0x1cce4b['query'],_0x5181b9['filters']));if(_0x1cce4b[_0x9ab8('0x3d')]['filter']){_0x5a68a7[_0x9ab8('0x43')]=_['merge'](_0x5a68a7['where'],{'$or':_[_0x9ab8('0x46')](_0x5a68a7[_0x9ab8('0x3e')],function(_0x570661){var _0x185371={};_0x185371[_0x570661]={'$like':'%'+_0x1cce4b['query'][_0x9ab8('0x59')]+'%'};return _0x185371;})});}_0x5a68a7=_['merge']({},_0x5a68a7,_0x1cce4b['options']);return _0x131073[_0x9ab8('0x5a')](_0x5a68a7);}})[_0x9ab8('0x1f')](function(_0x54ba4e){if(_0x54ba4e){_0x554cfb=_0x54ba4e['length'];if(!_0x1cce4b[_0x9ab8('0x3d')][_0x9ab8('0x41')](_0x9ab8('0x5b'))){_0x5a68a7[_0x9ab8('0x31')]=qs[_0x9ab8('0x31')](_0x1cce4b[_0x9ab8('0x3d')][_0x9ab8('0x31')]);_0x5a68a7[_0x9ab8('0x30')]=qs[_0x9ab8('0x30')](_0x1cce4b[_0x9ab8('0x3d')][_0x9ab8('0x30')]);}return _0x131073[_0x9ab8('0x5a')](_0x5a68a7);}})[_0x9ab8('0x1f')](function(_0x548e53){if(_0x548e53){return _0x548e53?{'count':_0x554cfb,'rows':_0x548e53}:null;}})['then'](respondWithResult(_0x1dfdd4,null))[_0x9ab8('0x2a')](handleError(_0x1dfdd4,null));};exports[_0x9ab8('0x5c')]=function(_0x4e6d56,_0x478d45,_0x58e987){var _0x3ab9b1={};var _0xcadd49={};var _0x3ab71e;var _0x537169;return db[_0x9ab8('0x39')]['findOne']({'where':{'id':_0x4e6d56[_0x9ab8('0x4f')]['id']}})[_0x9ab8('0x1f')](handleEntityNotFound(_0x478d45,null))['then'](function(_0x1fe1ea){if(_0x1fe1ea){_0x3ab71e=_0x1fe1ea;_0xcadd49[_0x9ab8('0x3b')]=_[_0x9ab8('0x3c')](db[_0x9ab8('0x5d')][_0x9ab8('0x3a')]);_0xcadd49[_0x9ab8('0x3d')]=_['keys'](_0x4e6d56[_0x9ab8('0x3d')]);_0xcadd49[_0x9ab8('0x44')]=_[_0x9ab8('0x3f')](_0xcadd49[_0x9ab8('0x3b')],_0xcadd49['query']);_0x3ab9b1['attributes']=_['intersection'](_0xcadd49[_0x9ab8('0x3b')],qs[_0x9ab8('0x40')](_0x4e6d56['query'][_0x9ab8('0x40')]));_0x3ab9b1[_0x9ab8('0x3e')]=_0x3ab9b1['attributes'][_0x9ab8('0x57')]?_0x3ab9b1[_0x9ab8('0x3e')]:_0xcadd49[_0x9ab8('0x3b')];_0x3ab9b1['order']=qs[_0x9ab8('0x42')](_0x4e6d56[_0x9ab8('0x3d')][_0x9ab8('0x42')]);_0x3ab9b1[_0x9ab8('0x43')]=qs[_0x9ab8('0x44')](_[_0x9ab8('0x45')](_0x4e6d56[_0x9ab8('0x3d')],_0xcadd49[_0x9ab8('0x44')]));if(_0x4e6d56[_0x9ab8('0x3d')]['filter']){_0x3ab9b1['where']=_[_0x9ab8('0x4a')](_0x3ab9b1[_0x9ab8('0x43')],{'$or':_[_0x9ab8('0x46')](_0x3ab9b1['attributes'],function(_0x58e2df){var _0x517bc2={};_0x517bc2[_0x58e2df]={'$like':'%'+_0x4e6d56[_0x9ab8('0x3d')][_0x9ab8('0x59')]+'%'};return _0x517bc2;})});}_0x3ab9b1=_[_0x9ab8('0x4a')]({},_0x3ab9b1,_0x4e6d56['options']);return _0x3ab71e[_0x9ab8('0x5c')](_0x3ab9b1);}})[_0x9ab8('0x1f')](function(_0x175c0e){if(_0x175c0e){_0x537169=_0x175c0e[_0x9ab8('0x57')];if(!_0x4e6d56['query'][_0x9ab8('0x41')](_0x9ab8('0x5b'))){_0x3ab9b1[_0x9ab8('0x31')]=qs[_0x9ab8('0x31')](_0x4e6d56[_0x9ab8('0x3d')][_0x9ab8('0x31')]);_0x3ab9b1[_0x9ab8('0x30')]=qs['offset'](_0x4e6d56[_0x9ab8('0x3d')][_0x9ab8('0x30')]);}return _0x3ab71e[_0x9ab8('0x5c')](_0x3ab9b1);}})['then'](function(_0xa9e228){if(_0xa9e228){return _0xa9e228?{'count':_0x537169,'rows':_0xa9e228}:null;}})[_0x9ab8('0x1f')](respondWithResult(_0x478d45,null))[_0x9ab8('0x2a')](handleError(_0x478d45,null));}; \ No newline at end of file +var _0xd71b=['includeAll','include','findAll','rows','show','params','length','find','create','body','findOne','ZohoField','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','status','end','json','offset','Content-Range','apply','update','destroy','stack','name','send','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','nolimit','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','ZohoConfiguration','count'];(function(_0xe1441d,_0x36fb8e){var _0x2ef242=function(_0x52bf2d){while(--_0x52bf2d){_0xe1441d['push'](_0xe1441d['shift']());}};_0x2ef242(++_0x36fb8e);}(_0xd71b,0xbc));var _0xbd71=function(_0x2a0485,_0x57f89c){_0x2a0485=_0x2a0485-0x0;var _0x5e4925=_0xd71b[_0x2a0485];return _0x5e4925;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd71('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd71('0x1'));var rp=require('request-promise');var moment=require(_0xbd71('0x2'));var BPromise=require(_0xbd71('0x3'));var Mustache=require(_0xbd71('0x4'));var util=require(_0xbd71('0x5'));var path=require(_0xbd71('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd71('0x7'));var fs=require('fs');var _=require(_0xbd71('0x8'));var squel=require(_0xbd71('0x9'));var crypto=require(_0xbd71('0xa'));var jsforce=require(_0xbd71('0xb'));var deskjs=require(_0xbd71('0xc'));var toCsv=require(_0xbd71('0xd'));var querystring=require(_0xbd71('0xe'));var Papa=require(_0xbd71('0xf'));var authService=require(_0xbd71('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xbd71('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xbd71('0x12'))('api');var utils=require(_0xbd71('0x13'));var config=require('../../config/environment');var db=require(_0xbd71('0x14'))['db'];var jayson=require(_0xbd71('0x15'));var client=jayson[_0xbd71('0x16')][_0xbd71('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xa9b2b6,_0x180422,_0x11d350,_0x388352){return new BPromise(function(_0x3090a8,_0x18d4d5){var _0x2a7341=_0x388352||client;return _0x2a7341[_0xbd71('0x18')](_0xa9b2b6,_0x11d350)[_0xbd71('0x19')](function(_0x1e2b28){logger[_0xbd71('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0x180422,_0xbd71('0x1b'));logger[_0xbd71('0x1c')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x180422,_0xbd71('0x1b'),JSON['stringify'](_0x1e2b28));if(_0x1e2b28[_0xbd71('0x1d')]){if(_0x1e2b28[_0xbd71('0x1d')][_0xbd71('0x1e')]===0x1f4){logger['error'](_0xbd71('0x1f'),_0x180422,_0x1e2b28[_0xbd71('0x1d')][_0xbd71('0x20')]);return _0x18d4d5(_0x1e2b28['error']['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x180422,_0x1e2b28[_0xbd71('0x1d')][_0xbd71('0x20')]);return _0x3090a8(_0x1e2b28[_0xbd71('0x1d')][_0xbd71('0x20')]);}else{logger['info'](_0xbd71('0x1f'),_0x180422,_0xbd71('0x1b'));_0x3090a8(_0x1e2b28[_0xbd71('0x21')]['message']);}})[_0xbd71('0x22')](function(_0x419b1e){logger['error'](_0xbd71('0x1f'),_0x180422,_0x419b1e);_0x18d4d5(_0x419b1e);});});}function respondWithStatusCode(_0x1e2327,_0x55c844){_0x55c844=_0x55c844||0xcc;return function(_0x5c9e1c){if(_0x5c9e1c){return _0x1e2327['sendStatus'](_0x55c844);}return _0x1e2327[_0xbd71('0x23')](_0x55c844)[_0xbd71('0x24')]();};}function respondWithResult(_0x47ef8e,_0x4065d4){_0x4065d4=_0x4065d4||0xc8;return function(_0x1de222){if(_0x1de222){return _0x47ef8e[_0xbd71('0x23')](_0x4065d4)[_0xbd71('0x25')](_0x1de222);}};}function respondWithFilteredResult(_0x4d414d,_0x54bbbe){return function(_0x5d693e){if(_0x5d693e){var _0x15c962=_0x5d693e['count'],_0x2d4ce6=_0x54bbbe[_0xbd71('0x26')],_0x1b0e43=_0x54bbbe['offset']+_0x54bbbe['limit'],_0x1faff2;if(_0x1b0e43>=_0x15c962){_0x1b0e43=_0x15c962;_0x1faff2=0xc8;}else{_0x1faff2=0xce;}_0x4d414d['status'](_0x1faff2);return _0x4d414d['set'](_0xbd71('0x27'),_0x2d4ce6+'-'+_0x1b0e43+'/'+_0x15c962)['json'](_0x5d693e);}return null;};}function patchUpdates(_0x30d7da){return function(_0x5e07c7){try{jsonpatch[_0xbd71('0x28')](_0x5e07c7,_0x30d7da,!![]);}catch(_0x249d40){return BPromise['reject'](_0x249d40);}return _0x5e07c7['save']();};}function saveUpdates(_0x163baf,_0x40df59){return function(_0x45df4c){if(_0x45df4c){return _0x45df4c[_0xbd71('0x29')](_0x163baf)['then'](function(_0x4253f1){return _0x4253f1;});}return null;};}function removeEntity(_0x4b6169,_0x585d29){return function(_0x277091){if(_0x277091){return _0x277091[_0xbd71('0x2a')]()[_0xbd71('0x19')](function(){_0x4b6169[_0xbd71('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4de656,_0x9a688){return function(_0x278b99){if(!_0x278b99){_0x4de656['sendStatus'](0x194);}return _0x278b99;};}function handleError(_0x497269,_0x10052a){_0x10052a=_0x10052a||0x1f4;return function(_0x3c9c08){logger[_0xbd71('0x1d')](_0x3c9c08[_0xbd71('0x2b')]);if(_0x3c9c08[_0xbd71('0x2c')]){delete _0x3c9c08[_0xbd71('0x2c')];}_0x497269[_0xbd71('0x23')](_0x10052a)[_0xbd71('0x2d')](_0x3c9c08);};}exports[_0xbd71('0x2e')]=function(_0x5ab35f,_0x572e54){var _0x21be58={},_0x2d72ff={},_0x189267={'count':0x0,'rows':[]};var _0x352913=db['ZohoConfiguration'][_0xbd71('0x2f')];_0x2d72ff[_0xbd71('0x30')]=_[_0xbd71('0x31')](_0x352913);_0x2d72ff['query']=_['keys'](_0x5ab35f['query']);_0x2d72ff[_0xbd71('0x32')]=_[_0xbd71('0x33')](_0x2d72ff[_0xbd71('0x30')],_0x2d72ff[_0xbd71('0x34')]);_0x21be58[_0xbd71('0x35')]=_['intersection'](_0x2d72ff['model'],qs[_0xbd71('0x36')](_0x5ab35f['query'][_0xbd71('0x36')]));_0x21be58[_0xbd71('0x35')]=_0x21be58[_0xbd71('0x35')]['length']?_0x21be58[_0xbd71('0x35')]:_0x2d72ff[_0xbd71('0x30')];if(!_0x5ab35f[_0xbd71('0x34')]['hasOwnProperty'](_0xbd71('0x37'))){_0x21be58['limit']=qs[_0xbd71('0x38')](_0x5ab35f[_0xbd71('0x34')][_0xbd71('0x38')]);_0x21be58[_0xbd71('0x26')]=qs['offset'](_0x5ab35f[_0xbd71('0x34')]['offset']);}_0x21be58[_0xbd71('0x39')]=qs['sort'](_0x5ab35f['query'][_0xbd71('0x3a')]);_0x21be58[_0xbd71('0x3b')]=qs['filters'](_[_0xbd71('0x3c')](_0x5ab35f[_0xbd71('0x34')],_0x2d72ff[_0xbd71('0x32')]));if(_0x5ab35f[_0xbd71('0x34')]['filter']){_0x21be58[_0xbd71('0x3b')]=_[_0xbd71('0x3d')](_0x21be58[_0xbd71('0x3b')],{'$or':_[_0xbd71('0x3e')](_0x352913,function(_0x22eb6d){if(_0x22eb6d[_0xbd71('0x3f')][_0xbd71('0x40')]!==_0xbd71('0x41')){var _0x5dcc34={};_0x5dcc34[_0x22eb6d['field']]={'$like':'%'+_0x5ab35f['query'][_0xbd71('0x42')]+'%'};return _0x5dcc34;}})});}_0x21be58=_[_0xbd71('0x3d')]({},_0x21be58,_0x5ab35f[_0xbd71('0x43')]);var _0x47c23b={'where':_0x21be58[_0xbd71('0x3b')]};return db[_0xbd71('0x44')][_0xbd71('0x45')](_0x47c23b)[_0xbd71('0x19')](function(_0x17b942){_0x189267[_0xbd71('0x45')]=_0x17b942;if(_0x5ab35f[_0xbd71('0x34')][_0xbd71('0x46')]){_0x21be58[_0xbd71('0x47')]=[{'all':!![]}];}return db[_0xbd71('0x44')][_0xbd71('0x48')](_0x21be58);})[_0xbd71('0x19')](function(_0x5be44b){_0x189267[_0xbd71('0x49')]=_0x5be44b;return _0x189267;})[_0xbd71('0x19')](respondWithFilteredResult(_0x572e54,_0x21be58))['catch'](handleError(_0x572e54,null));};exports[_0xbd71('0x4a')]=function(_0x486448,_0x500c4a){var _0x5def48={'raw':![],'where':{'id':_0x486448[_0xbd71('0x4b')]['id']}},_0x25e722={};_0x25e722[_0xbd71('0x30')]=_[_0xbd71('0x31')](db['ZohoConfiguration'][_0xbd71('0x2f')]);_0x25e722[_0xbd71('0x34')]=_[_0xbd71('0x31')](_0x486448[_0xbd71('0x34')]);_0x25e722[_0xbd71('0x32')]=_[_0xbd71('0x33')](_0x25e722[_0xbd71('0x30')],_0x25e722[_0xbd71('0x34')]);_0x5def48[_0xbd71('0x35')]=_[_0xbd71('0x33')](_0x25e722[_0xbd71('0x30')],qs[_0xbd71('0x36')](_0x486448['query'][_0xbd71('0x36')]));_0x5def48[_0xbd71('0x35')]=_0x5def48['attributes'][_0xbd71('0x4c')]?_0x5def48['attributes']:_0x25e722[_0xbd71('0x30')];if(_0x486448[_0xbd71('0x34')]['includeAll']){_0x5def48[_0xbd71('0x47')]=[{'all':!![]}];}_0x5def48=_['merge']({},_0x5def48,_0x486448['options']);return db[_0xbd71('0x44')][_0xbd71('0x4d')](_0x5def48)['then'](handleEntityNotFound(_0x500c4a,null))[_0xbd71('0x19')](respondWithResult(_0x500c4a,null))['catch'](handleError(_0x500c4a,null));};exports[_0xbd71('0x4e')]=function(_0x2dd88c,_0x1daa79){return db[_0xbd71('0x44')][_0xbd71('0x4e')](_0x2dd88c[_0xbd71('0x4f')],{})[_0xbd71('0x19')](respondWithResult(_0x1daa79,0xc9))[_0xbd71('0x22')](handleError(_0x1daa79,null));};exports[_0xbd71('0x29')]=function(_0x59329f,_0x30a395){if(_0x59329f[_0xbd71('0x4f')]['id']){delete _0x59329f[_0xbd71('0x4f')]['id'];}return db[_0xbd71('0x44')][_0xbd71('0x4d')]({'where':{'id':_0x59329f[_0xbd71('0x4b')]['id']}})[_0xbd71('0x19')](handleEntityNotFound(_0x30a395,null))[_0xbd71('0x19')](saveUpdates(_0x59329f['body'],null))[_0xbd71('0x19')](respondWithResult(_0x30a395,null))[_0xbd71('0x22')](handleError(_0x30a395,null));};exports[_0xbd71('0x2a')]=function(_0x4cabaf,_0x59ae49){return db[_0xbd71('0x44')]['find']({'where':{'id':_0x4cabaf[_0xbd71('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59ae49,null))[_0xbd71('0x19')](removeEntity(_0x59ae49,null))[_0xbd71('0x22')](handleError(_0x59ae49,null));};exports['getFields']=function(_0x5d6493,_0x1c69f3,_0x49378d){var _0x2cf4de={};var _0x53993a={};var _0xcd7381;var _0x4120fb;return db['ZohoConfiguration'][_0xbd71('0x50')]({'where':{'id':_0x5d6493[_0xbd71('0x4b')]['id']}})[_0xbd71('0x19')](handleEntityNotFound(_0x1c69f3,null))[_0xbd71('0x19')](function(_0x341afc){if(_0x341afc){_0xcd7381=_0x341afc;_0x53993a[_0xbd71('0x30')]=_[_0xbd71('0x31')](db[_0xbd71('0x51')]['rawAttributes']);_0x53993a['query']=_[_0xbd71('0x31')](_0x5d6493[_0xbd71('0x34')]);_0x53993a[_0xbd71('0x32')]=_[_0xbd71('0x33')](_0x53993a['model'],_0x53993a[_0xbd71('0x34')]);_0x2cf4de[_0xbd71('0x35')]=_[_0xbd71('0x33')](_0x53993a['model'],qs[_0xbd71('0x36')](_0x5d6493['query'][_0xbd71('0x36')]));_0x2cf4de[_0xbd71('0x35')]=_0x2cf4de[_0xbd71('0x35')][_0xbd71('0x4c')]?_0x2cf4de[_0xbd71('0x35')]:_0x53993a[_0xbd71('0x30')];_0x2cf4de['order']=qs['sort'](_0x5d6493['query']['sort']);_0x2cf4de['where']=qs[_0xbd71('0x32')](_[_0xbd71('0x3c')](_0x5d6493['query'],_0x53993a[_0xbd71('0x32')]));if(_0x5d6493[_0xbd71('0x34')]['filter']){_0x2cf4de[_0xbd71('0x3b')]=_[_0xbd71('0x3d')](_0x2cf4de[_0xbd71('0x3b')],{'$or':_[_0xbd71('0x3e')](_0x2cf4de['attributes'],function(_0x21298c){var _0x11e850={};_0x11e850[_0x21298c]={'$like':'%'+_0x5d6493['query'][_0xbd71('0x42')]+'%'};return _0x11e850;})});}_0x2cf4de=_['merge']({},_0x2cf4de,_0x5d6493[_0xbd71('0x43')]);return _0xcd7381[_0xbd71('0x52')](_0x2cf4de);}})[_0xbd71('0x19')](function(_0x37fbb9){if(_0x37fbb9){_0x4120fb=_0x37fbb9['length'];if(!_0x5d6493[_0xbd71('0x34')][_0xbd71('0x53')](_0xbd71('0x37'))){_0x2cf4de[_0xbd71('0x38')]=qs[_0xbd71('0x38')](_0x5d6493[_0xbd71('0x34')][_0xbd71('0x38')]);_0x2cf4de[_0xbd71('0x26')]=qs[_0xbd71('0x26')](_0x5d6493[_0xbd71('0x34')][_0xbd71('0x26')]);}return _0xcd7381['getFields'](_0x2cf4de);}})['then'](function(_0x423f23){if(_0x423f23){return _0x423f23?{'count':_0x4120fb,'rows':_0x423f23}:null;}})['then'](respondWithResult(_0x1c69f3,null))[_0xbd71('0x22')](handleError(_0x1c69f3,null));};exports[_0xbd71('0x54')]=function(_0x4bfe0a,_0x68520a,_0x551c2c){var _0x1aaa74={};var _0x41fa98={};var _0x4fce30;var _0xabd3de;return db[_0xbd71('0x44')][_0xbd71('0x50')]({'where':{'id':_0x4bfe0a[_0xbd71('0x4b')]['id']}})[_0xbd71('0x19')](handleEntityNotFound(_0x68520a,null))[_0xbd71('0x19')](function(_0x376ed3){if(_0x376ed3){_0x4fce30=_0x376ed3;_0x41fa98[_0xbd71('0x30')]=_[_0xbd71('0x31')](db[_0xbd71('0x51')]['rawAttributes']);_0x41fa98[_0xbd71('0x34')]=_[_0xbd71('0x31')](_0x4bfe0a[_0xbd71('0x34')]);_0x41fa98[_0xbd71('0x32')]=_['intersection'](_0x41fa98[_0xbd71('0x30')],_0x41fa98[_0xbd71('0x34')]);_0x1aaa74[_0xbd71('0x35')]=_['intersection'](_0x41fa98[_0xbd71('0x30')],qs[_0xbd71('0x36')](_0x4bfe0a['query'][_0xbd71('0x36')]));_0x1aaa74[_0xbd71('0x35')]=_0x1aaa74['attributes'][_0xbd71('0x4c')]?_0x1aaa74['attributes']:_0x41fa98['model'];_0x1aaa74[_0xbd71('0x39')]=qs[_0xbd71('0x3a')](_0x4bfe0a[_0xbd71('0x34')][_0xbd71('0x3a')]);_0x1aaa74[_0xbd71('0x3b')]=qs[_0xbd71('0x32')](_[_0xbd71('0x3c')](_0x4bfe0a[_0xbd71('0x34')],_0x41fa98[_0xbd71('0x32')]));if(_0x4bfe0a[_0xbd71('0x34')][_0xbd71('0x42')]){_0x1aaa74[_0xbd71('0x3b')]=_[_0xbd71('0x3d')](_0x1aaa74[_0xbd71('0x3b')],{'$or':_[_0xbd71('0x3e')](_0x1aaa74[_0xbd71('0x35')],function(_0x29e91d){var _0x213782={};_0x213782[_0x29e91d]={'$like':'%'+_0x4bfe0a['query']['filter']+'%'};return _0x213782;})});}_0x1aaa74=_[_0xbd71('0x3d')]({},_0x1aaa74,_0x4bfe0a[_0xbd71('0x43')]);return _0x4fce30['getSubjects'](_0x1aaa74);}})[_0xbd71('0x19')](function(_0x91c601){if(_0x91c601){_0xabd3de=_0x91c601[_0xbd71('0x4c')];if(!_0x4bfe0a[_0xbd71('0x34')][_0xbd71('0x53')](_0xbd71('0x37'))){_0x1aaa74['limit']=qs[_0xbd71('0x38')](_0x4bfe0a[_0xbd71('0x34')][_0xbd71('0x38')]);_0x1aaa74[_0xbd71('0x26')]=qs['offset'](_0x4bfe0a[_0xbd71('0x34')][_0xbd71('0x26')]);}return _0x4fce30[_0xbd71('0x54')](_0x1aaa74);}})['then'](function(_0x24b97f){if(_0x24b97f){return _0x24b97f?{'count':_0xabd3de,'rows':_0x24b97f}:null;}})[_0xbd71('0x19')](respondWithResult(_0x68520a,null))[_0xbd71('0x22')](handleError(_0x68520a,null));};exports[_0xbd71('0x55')]=function(_0x32ffe1,_0x6931ed,_0x309f56){var _0x54796c={};var _0x400135={};var _0x1ec947;var _0x3f9066;return db[_0xbd71('0x44')][_0xbd71('0x50')]({'where':{'id':_0x32ffe1[_0xbd71('0x4b')]['id']}})[_0xbd71('0x19')](handleEntityNotFound(_0x6931ed,null))['then'](function(_0x50ef88){if(_0x50ef88){_0x1ec947=_0x50ef88;_0x400135[_0xbd71('0x30')]=_[_0xbd71('0x31')](db['ZohoField'][_0xbd71('0x2f')]);_0x400135[_0xbd71('0x34')]=_['keys'](_0x32ffe1[_0xbd71('0x34')]);_0x400135[_0xbd71('0x32')]=_[_0xbd71('0x33')](_0x400135['model'],_0x400135[_0xbd71('0x34')]);_0x54796c[_0xbd71('0x35')]=_[_0xbd71('0x33')](_0x400135[_0xbd71('0x30')],qs[_0xbd71('0x36')](_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x36')]));_0x54796c[_0xbd71('0x35')]=_0x54796c[_0xbd71('0x35')][_0xbd71('0x4c')]?_0x54796c['attributes']:_0x400135[_0xbd71('0x30')];_0x54796c[_0xbd71('0x39')]=qs[_0xbd71('0x3a')](_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x3a')]);_0x54796c['where']=qs[_0xbd71('0x32')](_['pick'](_0x32ffe1[_0xbd71('0x34')],_0x400135[_0xbd71('0x32')]));if(_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x42')]){_0x54796c[_0xbd71('0x3b')]=_[_0xbd71('0x3d')](_0x54796c[_0xbd71('0x3b')],{'$or':_[_0xbd71('0x3e')](_0x54796c[_0xbd71('0x35')],function(_0x7c9c4){var _0x413a1d={};_0x413a1d[_0x7c9c4]={'$like':'%'+_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x42')]+'%'};return _0x413a1d;})});}_0x54796c=_['merge']({},_0x54796c,_0x32ffe1[_0xbd71('0x43')]);return _0x1ec947['getDescriptions'](_0x54796c);}})['then'](function(_0x51cab2){if(_0x51cab2){_0x3f9066=_0x51cab2[_0xbd71('0x4c')];if(!_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x53')](_0xbd71('0x37'))){_0x54796c['limit']=qs[_0xbd71('0x38')](_0x32ffe1[_0xbd71('0x34')][_0xbd71('0x38')]);_0x54796c[_0xbd71('0x26')]=qs['offset'](_0x32ffe1[_0xbd71('0x34')]['offset']);}return _0x1ec947[_0xbd71('0x55')](_0x54796c);}})[_0xbd71('0x19')](function(_0x2911c3){if(_0x2911c3){return _0x2911c3?{'count':_0x3f9066,'rows':_0x2911c3}:null;}})['then'](respondWithResult(_0x6931ed,null))['catch'](handleError(_0x6931ed,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 12e4806..7bf888a 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 _0x7aa7=['int_zoho_configurations','../../config/logger','api','moment','request-promise','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x327cee,_0x3a0a22){var _0x54a66c=function(_0x42da6f){while(--_0x42da6f){_0x327cee['push'](_0x327cee['shift']());}};_0x54a66c(++_0x3a0a22);}(_0x7aa7,0xfd));var _0x77aa=function(_0x4e74db,_0x14742b){_0x4e74db=_0x4e74db-0x0;var _0x313aee=_0x7aa7[_0x4e74db];return _0x313aee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x77aa('0x0'))(_0x77aa('0x1'));var moment=require(_0x77aa('0x2'));var BPromise=require('bluebird');var rp=require(_0x77aa('0x3'));var attributes=require(_0x77aa('0x4'));module[_0x77aa('0x5')]=function(_0x1be643,_0x321bf2){return _0x1be643[_0x77aa('0x6')](_0x77aa('0x7'),attributes,{'tableName':_0x77aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1db=['request-promise','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x5da794,_0xf1cf6){var _0x2517ad=function(_0xd052e3){while(--_0xd052e3){_0x5da794['push'](_0x5da794['shift']());}};_0x2517ad(++_0xf1cf6);}(_0xa1db,0xb0));var _0xba1d=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0xa1db[_0x4fdc46];return _0x2c178a;};'use strict';var _=require(_0xba1d('0x0'));var util=require(_0xba1d('0x1'));var logger=require(_0xba1d('0x2'))(_0xba1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba1d('0x4'));var attributes=require(_0xba1d('0x5'));module['exports']=function(_0x256502,_0x314523){return _0x256502[_0xba1d('0x6')](_0xba1d('0x7'),attributes,{'tableName':_0xba1d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 55df2da..48860fa 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 _0x20b0=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb8828d,_0x2dd8d3){var _0x309900=function(_0x5a416a){while(--_0x5a416a){_0xb8828d['push'](_0xb8828d['shift']());}};_0x309900(++_0x2dd8d3);}(_0x20b0,0x1c3));var _0x020b=function(_0x3ccfc9,_0x5d0ec2){_0x3ccfc9=_0x3ccfc9-0x0;var _0x21a2c5=_0x20b0[_0x3ccfc9];return _0x21a2c5;};'use strict';var _=require(_0x020b('0x0'));var util=require(_0x020b('0x1'));var moment=require(_0x020b('0x2'));var BPromise=require(_0x020b('0x3'));var rs=require(_0x020b('0x4'));var fs=require('fs');var Redis=require(_0x020b('0x5'));var db=require(_0x020b('0x6'))['db'];var utils=require(_0x020b('0x7'));var logger=require(_0x020b('0x8'))(_0x020b('0x9'));var config=require('../../config/environment');var jayson=require(_0x020b('0xa'));var client=jayson[_0x020b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14956e,_0x294f30,_0x3c0ddd){return new BPromise(function(_0x583919,_0x109693){return client[_0x020b('0xc')](_0x14956e,_0x3c0ddd)[_0x020b('0xd')](function(_0x4a0cd0){logger[_0x020b('0xe')](_0x020b('0xf'),_0x294f30,_0x020b('0x10'));logger[_0x020b('0x11')](_0x020b('0x12'),_0x294f30,_0x020b('0x10'),JSON[_0x020b('0x13')](_0x4a0cd0));if(_0x4a0cd0[_0x020b('0x14')]){if(_0x4a0cd0[_0x020b('0x14')][_0x020b('0x15')]===0x1f4){logger[_0x020b('0x14')](_0x020b('0xf'),_0x294f30,_0x4a0cd0[_0x020b('0x14')]['message']);return _0x109693(_0x4a0cd0[_0x020b('0x14')][_0x020b('0x16')]);}logger[_0x020b('0x14')](_0x020b('0xf'),_0x294f30,_0x4a0cd0[_0x020b('0x14')][_0x020b('0x16')]);return _0x583919(_0x4a0cd0[_0x020b('0x14')][_0x020b('0x16')]);}else{logger['info'](_0x020b('0xf'),_0x294f30,_0x020b('0x10'));_0x583919(_0x4a0cd0[_0x020b('0x17')][_0x020b('0x16')]);}})[_0x020b('0x18')](function(_0x5e6e09){logger['error'](_0x020b('0xf'),_0x294f30,_0x5e6e09);_0x109693(_0x5e6e09);});});} \ No newline at end of file +var _0x3025=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x22da96,_0xfc5108){var _0x5a35dd=function(_0x19f9bc){while(--_0x19f9bc){_0x22da96['push'](_0x22da96['shift']());}};_0x5a35dd(++_0xfc5108);}(_0x3025,0x153));var _0x5302=function(_0x39fa88,_0x5f253b){_0x39fa88=_0x39fa88-0x0;var _0x141781=_0x3025[_0x39fa88];return _0x141781;};'use strict';var _=require('lodash');var util=require(_0x5302('0x0'));var moment=require(_0x5302('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5302('0x2'));var db=require(_0x5302('0x3'))['db'];var utils=require(_0x5302('0x4'));var logger=require(_0x5302('0x5'))(_0x5302('0x6'));var config=require('../../config/environment');var jayson=require(_0x5302('0x7'));var client=jayson[_0x5302('0x8')][_0x5302('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c1d43,_0x2a0503,_0x393184){return new BPromise(function(_0x880658,_0xaf77a8){return client[_0x5302('0xa')](_0x4c1d43,_0x393184)['then'](function(_0x8a7f98){logger[_0x5302('0xb')](_0x5302('0xc'),_0x2a0503,_0x5302('0xd'));logger[_0x5302('0xe')](_0x5302('0xf'),_0x2a0503,_0x5302('0xd'),JSON['stringify'](_0x8a7f98));if(_0x8a7f98['error']){if(_0x8a7f98['error'][_0x5302('0x10')]===0x1f4){logger[_0x5302('0x11')](_0x5302('0xc'),_0x2a0503,_0x8a7f98[_0x5302('0x11')][_0x5302('0x12')]);return _0xaf77a8(_0x8a7f98['error'][_0x5302('0x12')]);}logger[_0x5302('0x11')](_0x5302('0xc'),_0x2a0503,_0x8a7f98[_0x5302('0x11')]['message']);return _0x880658(_0x8a7f98['error'][_0x5302('0x12')]);}else{logger[_0x5302('0xb')](_0x5302('0xc'),_0x2a0503,_0x5302('0xd'));_0x880658(_0x8a7f98[_0x5302('0x13')][_0x5302('0x12')]);}})[_0x5302('0x14')](function(_0x25ed4c){logger[_0x5302('0x11')](_0x5302('0xc'),_0x2a0503,_0x25ed4c);_0xaf77a8(_0x25ed4c);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6ef2e4a..74cca89 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 _0xd936=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','get','/:id','show','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x596bc2,_0xe73cd4){var _0x27f607=function(_0x1a60be){while(--_0x1a60be){_0x596bc2['push'](_0x596bc2['shift']());}};_0x27f607(++_0xe73cd4);}(_0xd936,0x1d1));var _0x6d93=function(_0x4e98d5,_0xf62115){_0x4e98d5=_0x4e98d5-0x0;var _0x4cef96=_0xd936[_0x4e98d5];return _0x4cef96;};'use strict';var multer=require(_0x6d93('0x0'));var util=require(_0x6d93('0x1'));var path=require('path');var timeout=require(_0x6d93('0x2'));var express=require(_0x6d93('0x3'));var router=express[_0x6d93('0x4')]();var auth=require(_0x6d93('0x5'));var interaction=require(_0x6d93('0x6'));var config=require(_0x6d93('0x7'));var controller=require(_0x6d93('0x8'));router['get']('/',auth[_0x6d93('0x9')](),controller['index']);router[_0x6d93('0xa')](_0x6d93('0xb'),auth[_0x6d93('0x9')](),controller[_0x6d93('0xc')]);router['post']('/',auth[_0x6d93('0x9')](),controller[_0x6d93('0xd')]);router[_0x6d93('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6d93('0xf')]);router['delete'](_0x6d93('0xb'),auth['isAuthenticated'](),controller[_0x6d93('0x10')]);module[_0x6d93('0x11')]=router; \ No newline at end of file +var _0x7752=['/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','update','delete'];(function(_0x5607f9,_0x2036fe){var _0x240a62=function(_0x393fb4){while(--_0x393fb4){_0x5607f9['push'](_0x5607f9['shift']());}};_0x240a62(++_0x2036fe);}(_0x7752,0xfe));var _0x2775=function(_0x414b1e,_0x1ba40d){_0x414b1e=_0x414b1e-0x0;var _0x3f725e=_0x7752[_0x414b1e];return _0x3f725e;};'use strict';var multer=require(_0x2775('0x0'));var util=require(_0x2775('0x1'));var path=require(_0x2775('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2775('0x3')]();var auth=require(_0x2775('0x4'));var interaction=require(_0x2775('0x5'));var config=require(_0x2775('0x6'));var controller=require(_0x2775('0x7'));router[_0x2775('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x2775('0x9')](),controller[_0x2775('0xa')]);router[_0x2775('0xb')]('/',auth[_0x2775('0x9')](),controller[_0x2775('0xc')]);router[_0x2775('0xd')]('/:id',auth[_0x2775('0x9')](),controller[_0x2775('0xe')]);router[_0x2775('0xf')](_0x2775('0x10'),auth[_0x2775('0x9')](),controller[_0x2775('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 5982c9f..2f1538c 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 _0x9348=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x21219b,_0x215e1f){var _0x54b5ed=function(_0x6647ee){while(--_0x6647ee){_0x21219b['push'](_0x21219b['shift']());}};_0x54b5ed(++_0x215e1f);}(_0x9348,0x10d));var _0x8934=function(_0x36ccb7,_0x59579d){_0x36ccb7=_0x36ccb7-0x0;var _0x31034c=_0x9348[_0x36ccb7];return _0x31034c;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'type':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),'customVariable',_0x8934('0x5')),'defaultValue':_0x8934('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8934('0x6')]},'keyType':{'type':Sequelize[_0x8934('0x2')](_0x8934('0x3'),_0x8934('0x4'),_0x8934('0x7'))},'keyContent':{'type':Sequelize[_0x8934('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8934('0x6')]},'customField':{'type':Sequelize[_0x8934('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8934('0x6')]}}; \ No newline at end of file +var _0x1be1=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1be1,0x192));var _0x11be=function(_0x13b75a,_0x4551f6){_0x13b75a=_0x13b75a-0x0;var _0x1ffd65=_0x1be1[_0x13b75a];return _0x1ffd65;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),'variable',_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x1')},'content':{'type':Sequelize[_0x11be('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),_0x11be('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x11be('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11be('0x4')]},'customField':{'type':Sequelize[_0x11be('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11be('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b3835df..3580f06 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 _0x7a61=['ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','ZohoField','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x56d529,_0x39a8b0){var _0x1fa506=function(_0x3a6e79){while(--_0x3a6e79){_0x56d529['push'](_0x56d529['shift']());}};_0x1fa506(++_0x39a8b0);}(_0x7a61,0xc4));var _0x17a6=function(_0x5144fd,_0x3009ed){_0x5144fd=_0x5144fd-0x0;var _0x3f9b89=_0x7a61[_0x5144fd];return _0x3f9b89;};'use strict';var pdf=require(_0x17a6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x17a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x17a6('0x2'));var rp=require(_0x17a6('0x3'));var moment=require(_0x17a6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x17a6('0x5'));var path=require(_0x17a6('0x6'));var sox=require(_0x17a6('0x7'));var csv=require(_0x17a6('0x8'));var ejs=require(_0x17a6('0x9'));var fs=require('fs');var _=require(_0x17a6('0xa'));var squel=require(_0x17a6('0xb'));var crypto=require(_0x17a6('0xc'));var jsforce=require(_0x17a6('0xd'));var deskjs=require(_0x17a6('0xe'));var toCsv=require(_0x17a6('0x8'));var querystring=require(_0x17a6('0xf'));var Papa=require(_0x17a6('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x17a6('0x11'));var qs=require(_0x17a6('0x12'));var logger=require(_0x17a6('0x13'))(_0x17a6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x17a6('0x15'))['db'];function respondWithStatusCode(_0x59809c,_0x2e88f9){_0x2e88f9=_0x2e88f9||0xcc;return function(_0x2414f3){if(_0x2414f3){return _0x59809c[_0x17a6('0x16')](_0x2e88f9);}return _0x59809c[_0x17a6('0x17')](_0x2e88f9)['end']();};}function respondWithResult(_0x1d3d03,_0xff1a44){_0xff1a44=_0xff1a44||0xc8;return function(_0x277f2a){if(_0x277f2a){return _0x1d3d03[_0x17a6('0x17')](_0xff1a44)[_0x17a6('0x18')](_0x277f2a);}};}function respondWithFilteredResult(_0x31a936,_0x3e864f){return function(_0x509918){if(_0x509918){var _0x283a23=_0x509918[_0x17a6('0x19')],_0x572dd2=_0x3e864f[_0x17a6('0x1a')],_0x4c66a9=_0x3e864f[_0x17a6('0x1a')]+_0x3e864f[_0x17a6('0x1b')],_0x5bdc17;if(_0x4c66a9>=_0x283a23){_0x4c66a9=_0x283a23;_0x5bdc17=0xc8;}else{_0x5bdc17=0xce;}_0x31a936['status'](_0x5bdc17);return _0x31a936[_0x17a6('0x1c')](_0x17a6('0x1d'),_0x572dd2+'-'+_0x4c66a9+'/'+_0x283a23)[_0x17a6('0x18')](_0x509918);}return null;};}function patchUpdates(_0x204c64){return function(_0x56b706){try{jsonpatch[_0x17a6('0x1e')](_0x56b706,_0x204c64,!![]);}catch(_0x36a971){return BPromise[_0x17a6('0x1f')](_0x36a971);}return _0x56b706[_0x17a6('0x20')]();};}function saveUpdates(_0xd4e3d2,_0x5a0fa5){return function(_0x4e60fc){if(_0x4e60fc){return _0x4e60fc[_0x17a6('0x21')](_0xd4e3d2)[_0x17a6('0x22')](function(_0x1fbef8){return _0x1fbef8;});}return null;};}function removeEntity(_0x32224f,_0x1173b8){return function(_0x422649){if(_0x422649){return _0x422649[_0x17a6('0x23')]()[_0x17a6('0x22')](function(){_0x32224f[_0x17a6('0x17')](0xcc)[_0x17a6('0x24')]();});}};}function handleEntityNotFound(_0x2c1c2e,_0x5d85df){return function(_0x9dd75e){if(!_0x9dd75e){_0x2c1c2e[_0x17a6('0x16')](0x194);}return _0x9dd75e;};}function handleError(_0x2c11e6,_0xab6b74){_0xab6b74=_0xab6b74||0x1f4;return function(_0x1fdecd){logger['error'](_0x1fdecd[_0x17a6('0x25')]);if(_0x1fdecd[_0x17a6('0x26')]){delete _0x1fdecd[_0x17a6('0x26')];}_0x2c11e6[_0x17a6('0x17')](_0xab6b74)[_0x17a6('0x27')](_0x1fdecd);};}exports['index']=function(_0xa6ac13,_0x444b47){var _0x2254d6={},_0x53e6d7={},_0x248cf6={'count':0x0,'rows':[]};var _0x1ce18d=db[_0x17a6('0x28')]['rawAttributes'];_0x53e6d7['model']=_[_0x17a6('0x29')](_0x1ce18d);_0x53e6d7[_0x17a6('0x2a')]=_[_0x17a6('0x29')](_0xa6ac13[_0x17a6('0x2a')]);_0x53e6d7['filters']=_[_0x17a6('0x2b')](_0x53e6d7[_0x17a6('0x2c')],_0x53e6d7[_0x17a6('0x2a')]);_0x2254d6[_0x17a6('0x2d')]=_[_0x17a6('0x2b')](_0x53e6d7[_0x17a6('0x2c')],qs[_0x17a6('0x2e')](_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x2e')]));_0x2254d6[_0x17a6('0x2d')]=_0x2254d6[_0x17a6('0x2d')][_0x17a6('0x2f')]?_0x2254d6['attributes']:_0x53e6d7[_0x17a6('0x2c')];if(!_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x30')](_0x17a6('0x31'))){_0x2254d6[_0x17a6('0x1b')]=qs[_0x17a6('0x1b')](_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x1b')]);_0x2254d6[_0x17a6('0x1a')]=qs[_0x17a6('0x1a')](_0xa6ac13['query'][_0x17a6('0x1a')]);}_0x2254d6[_0x17a6('0x32')]=qs[_0x17a6('0x33')](_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x33')]);_0x2254d6[_0x17a6('0x34')]=qs[_0x17a6('0x35')](_[_0x17a6('0x36')](_0xa6ac13[_0x17a6('0x2a')],_0x53e6d7[_0x17a6('0x35')]));if(_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x37')]){_0x2254d6[_0x17a6('0x34')]=_[_0x17a6('0x38')](_0x2254d6[_0x17a6('0x34')],{'$or':_[_0x17a6('0x39')](_0x1ce18d,function(_0x34d924){if(_0x34d924[_0x17a6('0x3a')]['key']!==_0x17a6('0x3b')){var _0x211ad1={};_0x211ad1[_0x34d924['field']]={'$like':'%'+_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x37')]+'%'};return _0x211ad1;}})});}_0x2254d6=_[_0x17a6('0x38')]({},_0x2254d6,_0xa6ac13[_0x17a6('0x3c')]);var _0x503453={'where':_0x2254d6[_0x17a6('0x34')]};return db[_0x17a6('0x28')][_0x17a6('0x19')](_0x503453)['then'](function(_0x569841){_0x248cf6[_0x17a6('0x19')]=_0x569841;if(_0xa6ac13[_0x17a6('0x2a')][_0x17a6('0x3d')]){_0x2254d6[_0x17a6('0x3e')]=[{'all':!![]}];}return db[_0x17a6('0x28')]['findAll'](_0x2254d6);})[_0x17a6('0x22')](function(_0x336437){_0x248cf6[_0x17a6('0x3f')]=_0x336437;return _0x248cf6;})['then'](respondWithFilteredResult(_0x444b47,_0x2254d6))[_0x17a6('0x40')](handleError(_0x444b47,null));};exports[_0x17a6('0x41')]=function(_0x50666d,_0x37b8e7){var _0x7ebd76={'raw':!![],'where':{'id':_0x50666d[_0x17a6('0x42')]['id']}},_0x3bc98a={};_0x3bc98a[_0x17a6('0x2c')]=_[_0x17a6('0x29')](db[_0x17a6('0x28')][_0x17a6('0x43')]);_0x3bc98a[_0x17a6('0x2a')]=_[_0x17a6('0x29')](_0x50666d[_0x17a6('0x2a')]);_0x3bc98a[_0x17a6('0x35')]=_['intersection'](_0x3bc98a[_0x17a6('0x2c')],_0x3bc98a['query']);_0x7ebd76[_0x17a6('0x2d')]=_['intersection'](_0x3bc98a['model'],qs['fields'](_0x50666d[_0x17a6('0x2a')][_0x17a6('0x2e')]));_0x7ebd76[_0x17a6('0x2d')]=_0x7ebd76[_0x17a6('0x2d')][_0x17a6('0x2f')]?_0x7ebd76[_0x17a6('0x2d')]:_0x3bc98a[_0x17a6('0x2c')];if(_0x50666d[_0x17a6('0x2a')][_0x17a6('0x3d')]){_0x7ebd76[_0x17a6('0x3e')]=[{'all':!![]}];}_0x7ebd76=_['merge']({},_0x7ebd76,_0x50666d[_0x17a6('0x3c')]);return db[_0x17a6('0x28')][_0x17a6('0x44')](_0x7ebd76)[_0x17a6('0x22')](handleEntityNotFound(_0x37b8e7,null))[_0x17a6('0x22')](respondWithResult(_0x37b8e7,null))['catch'](handleError(_0x37b8e7,null));};exports['create']=function(_0x4829d1,_0x66ccba){return db[_0x17a6('0x28')][_0x17a6('0x45')](_0x4829d1['body'],{})[_0x17a6('0x22')](respondWithResult(_0x66ccba,0xc9))[_0x17a6('0x40')](handleError(_0x66ccba,null));};exports['update']=function(_0x5e3064,_0xa94013){if(_0x5e3064[_0x17a6('0x46')]['id']){delete _0x5e3064[_0x17a6('0x46')]['id'];}return db[_0x17a6('0x28')]['find']({'where':{'id':_0x5e3064[_0x17a6('0x42')]['id']}})[_0x17a6('0x22')](handleEntityNotFound(_0xa94013,null))[_0x17a6('0x22')](saveUpdates(_0x5e3064[_0x17a6('0x46')],null))[_0x17a6('0x22')](respondWithResult(_0xa94013,null))['catch'](handleError(_0xa94013,null));};exports[_0x17a6('0x23')]=function(_0x1e9173,_0x541783){return db[_0x17a6('0x28')]['find']({'where':{'id':_0x1e9173[_0x17a6('0x42')]['id']}})[_0x17a6('0x22')](handleEntityNotFound(_0x541783,null))[_0x17a6('0x22')](removeEntity(_0x541783,null))[_0x17a6('0x40')](handleError(_0x541783,null));}; \ No newline at end of file +var _0x32b1=['../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','merge','options','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x32b1,0xbc));var _0x132b=function(_0x1f5652,_0x5e9d27){_0x1f5652=_0x1f5652-0x0;var _0x2d6ef8=_0x32b1[_0x1f5652];return _0x2d6ef8;};'use strict';var pdf=require(_0x132b('0x0'));var emlformat=require(_0x132b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x132b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x132b('0x3'));var moment=require(_0x132b('0x4'));var BPromise=require(_0x132b('0x5'));var Mustache=require('mustache');var util=require(_0x132b('0x6'));var path=require('path');var sox=require(_0x132b('0x7'));var csv=require(_0x132b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x132b('0x9'));var crypto=require(_0x132b('0xa'));var jsforce=require(_0x132b('0xb'));var deskjs=require(_0x132b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x132b('0xd'));var Papa=require(_0x132b('0xe'));var authService=require(_0x132b('0xf'));var hardwareService=require(_0x132b('0x10'));var Redis=require('ioredis');var qs=require(_0x132b('0x11'));var logger=require(_0x132b('0x12'))('api');var utils=require(_0x132b('0x13'));var config=require(_0x132b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2558f9,_0x4fd523){_0x4fd523=_0x4fd523||0xcc;return function(_0x43b993){if(_0x43b993){return _0x2558f9[_0x132b('0x15')](_0x4fd523);}return _0x2558f9[_0x132b('0x16')](_0x4fd523)[_0x132b('0x17')]();};}function respondWithResult(_0x51b2d9,_0x2a4ce2){_0x2a4ce2=_0x2a4ce2||0xc8;return function(_0x4b8dd9){if(_0x4b8dd9){return _0x51b2d9[_0x132b('0x16')](_0x2a4ce2)[_0x132b('0x18')](_0x4b8dd9);}};}function respondWithFilteredResult(_0xd79e,_0x266342){return function(_0x725e70){if(_0x725e70){var _0x9c5ddd=_0x725e70[_0x132b('0x19')],_0x44182f=_0x266342['offset'],_0x4f5d14=_0x266342[_0x132b('0x1a')]+_0x266342['limit'],_0x2f14d0;if(_0x4f5d14>=_0x9c5ddd){_0x4f5d14=_0x9c5ddd;_0x2f14d0=0xc8;}else{_0x2f14d0=0xce;}_0xd79e['status'](_0x2f14d0);return _0xd79e[_0x132b('0x1b')](_0x132b('0x1c'),_0x44182f+'-'+_0x4f5d14+'/'+_0x9c5ddd)[_0x132b('0x18')](_0x725e70);}return null;};}function patchUpdates(_0x40a066){return function(_0x1a8782){try{jsonpatch[_0x132b('0x1d')](_0x1a8782,_0x40a066,!![]);}catch(_0x41c196){return BPromise[_0x132b('0x1e')](_0x41c196);}return _0x1a8782[_0x132b('0x1f')]();};}function saveUpdates(_0xc09289,_0x3779c2){return function(_0x18e81a){if(_0x18e81a){return _0x18e81a[_0x132b('0x20')](_0xc09289)[_0x132b('0x21')](function(_0x16173b){return _0x16173b;});}return null;};}function removeEntity(_0x135c31,_0x5cf66a){return function(_0x79b879){if(_0x79b879){return _0x79b879[_0x132b('0x22')]()[_0x132b('0x21')](function(){_0x135c31[_0x132b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x82b7ef,_0x29238f){return function(_0x290487){if(!_0x290487){_0x82b7ef[_0x132b('0x15')](0x194);}return _0x290487;};}function handleError(_0x284d37,_0x54450f){_0x54450f=_0x54450f||0x1f4;return function(_0x1b30ed){logger[_0x132b('0x23')](_0x1b30ed[_0x132b('0x24')]);if(_0x1b30ed[_0x132b('0x25')]){delete _0x1b30ed['name'];}_0x284d37[_0x132b('0x16')](_0x54450f)['send'](_0x1b30ed);};}exports[_0x132b('0x26')]=function(_0x1431ae,_0xf66eff){var _0x424718={},_0x5b2b14={},_0x19e5b8={'count':0x0,'rows':[]};var _0x12af0e=db[_0x132b('0x27')][_0x132b('0x28')];_0x5b2b14[_0x132b('0x29')]=_[_0x132b('0x2a')](_0x12af0e);_0x5b2b14[_0x132b('0x2b')]=_['keys'](_0x1431ae[_0x132b('0x2b')]);_0x5b2b14[_0x132b('0x2c')]=_[_0x132b('0x2d')](_0x5b2b14[_0x132b('0x29')],_0x5b2b14[_0x132b('0x2b')]);_0x424718[_0x132b('0x2e')]=_[_0x132b('0x2d')](_0x5b2b14[_0x132b('0x29')],qs[_0x132b('0x2f')](_0x1431ae[_0x132b('0x2b')][_0x132b('0x2f')]));_0x424718[_0x132b('0x2e')]=_0x424718[_0x132b('0x2e')][_0x132b('0x30')]?_0x424718[_0x132b('0x2e')]:_0x5b2b14[_0x132b('0x29')];if(!_0x1431ae['query'][_0x132b('0x31')](_0x132b('0x32'))){_0x424718[_0x132b('0x33')]=qs['limit'](_0x1431ae[_0x132b('0x2b')]['limit']);_0x424718[_0x132b('0x1a')]=qs[_0x132b('0x1a')](_0x1431ae[_0x132b('0x2b')][_0x132b('0x1a')]);}_0x424718[_0x132b('0x34')]=qs[_0x132b('0x35')](_0x1431ae[_0x132b('0x2b')]['sort']);_0x424718[_0x132b('0x36')]=qs[_0x132b('0x2c')](_[_0x132b('0x37')](_0x1431ae['query'],_0x5b2b14[_0x132b('0x2c')]));if(_0x1431ae['query'][_0x132b('0x38')]){_0x424718['where']=_['merge'](_0x424718[_0x132b('0x36')],{'$or':_[_0x132b('0x39')](_0x12af0e,function(_0xdb1fb8){if(_0xdb1fb8[_0x132b('0x3a')]['key']!=='VIRTUAL'){var _0x2a0154={};_0x2a0154[_0xdb1fb8['field']]={'$like':'%'+_0x1431ae['query'][_0x132b('0x38')]+'%'};return _0x2a0154;}})});}_0x424718=_[_0x132b('0x3b')]({},_0x424718,_0x1431ae[_0x132b('0x3c')]);var _0x456f43={'where':_0x424718[_0x132b('0x36')]};return db['ZohoField'][_0x132b('0x19')](_0x456f43)[_0x132b('0x21')](function(_0x2b0523){_0x19e5b8['count']=_0x2b0523;if(_0x1431ae['query']['includeAll']){_0x424718[_0x132b('0x3d')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x424718);})[_0x132b('0x21')](function(_0x42560c){_0x19e5b8[_0x132b('0x3e')]=_0x42560c;return _0x19e5b8;})['then'](respondWithFilteredResult(_0xf66eff,_0x424718))[_0x132b('0x3f')](handleError(_0xf66eff,null));};exports[_0x132b('0x40')]=function(_0x3c555f,_0x2dde0a){var _0x25bc9a={'raw':!![],'where':{'id':_0x3c555f[_0x132b('0x41')]['id']}},_0x20fbd7={};_0x20fbd7['model']=_[_0x132b('0x2a')](db[_0x132b('0x27')][_0x132b('0x28')]);_0x20fbd7['query']=_[_0x132b('0x2a')](_0x3c555f[_0x132b('0x2b')]);_0x20fbd7[_0x132b('0x2c')]=_['intersection'](_0x20fbd7['model'],_0x20fbd7[_0x132b('0x2b')]);_0x25bc9a[_0x132b('0x2e')]=_['intersection'](_0x20fbd7[_0x132b('0x29')],qs[_0x132b('0x2f')](_0x3c555f[_0x132b('0x2b')]['fields']));_0x25bc9a['attributes']=_0x25bc9a[_0x132b('0x2e')][_0x132b('0x30')]?_0x25bc9a[_0x132b('0x2e')]:_0x20fbd7[_0x132b('0x29')];if(_0x3c555f[_0x132b('0x2b')]['includeAll']){_0x25bc9a['include']=[{'all':!![]}];}_0x25bc9a=_[_0x132b('0x3b')]({},_0x25bc9a,_0x3c555f[_0x132b('0x3c')]);return db[_0x132b('0x27')][_0x132b('0x42')](_0x25bc9a)[_0x132b('0x21')](handleEntityNotFound(_0x2dde0a,null))['then'](respondWithResult(_0x2dde0a,null))[_0x132b('0x3f')](handleError(_0x2dde0a,null));};exports[_0x132b('0x43')]=function(_0x21bbd1,_0x2ff745){return db[_0x132b('0x27')][_0x132b('0x43')](_0x21bbd1[_0x132b('0x44')],{})[_0x132b('0x21')](respondWithResult(_0x2ff745,0xc9))[_0x132b('0x3f')](handleError(_0x2ff745,null));};exports['update']=function(_0x5eef1a,_0x4d04a6){if(_0x5eef1a[_0x132b('0x44')]['id']){delete _0x5eef1a[_0x132b('0x44')]['id'];}return db[_0x132b('0x27')][_0x132b('0x42')]({'where':{'id':_0x5eef1a[_0x132b('0x41')]['id']}})[_0x132b('0x21')](handleEntityNotFound(_0x4d04a6,null))[_0x132b('0x21')](saveUpdates(_0x5eef1a['body'],null))['then'](respondWithResult(_0x4d04a6,null))[_0x132b('0x3f')](handleError(_0x4d04a6,null));};exports[_0x132b('0x22')]=function(_0xa4b568,_0x4274a8){return db['ZohoField'][_0x132b('0x42')]({'where':{'id':_0xa4b568[_0x132b('0x41')]['id']}})['then'](handleEntityNotFound(_0x4274a8,null))[_0x132b('0x21')](removeEntity(_0x4274a8,null))[_0x132b('0x3f')](handleError(_0x4274a8,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 1437fad..e966a97 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 _0x974c=['int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','./intZohoField.attributes','define'];(function(_0x47ae01,_0x2dd0b0){var _0x15b3b7=function(_0x540ebc){while(--_0x540ebc){_0x47ae01['push'](_0x47ae01['shift']());}};_0x15b3b7(++_0x2dd0b0);}(_0x974c,0xd4));var _0xc974=function(_0x3d1a96,_0x5f1511){_0x3d1a96=_0x3d1a96-0x0;var _0x3365ba=_0x974c[_0x3d1a96];return _0x3365ba;};'use strict';var _=require(_0xc974('0x0'));var util=require(_0xc974('0x1'));var logger=require(_0xc974('0x2'))(_0xc974('0x3'));var moment=require('moment');var BPromise=require(_0xc974('0x4'));var rp=require(_0xc974('0x5'));var attributes=require(_0xc974('0x6'));module['exports']=function(_0xc39e58,_0x30c487){return _0xc39e58[_0xc974('0x7')]('ZohoField',attributes,{'tableName':_0xc974('0x8'),'paranoid':![],'indexes':[{'name':_0xc974('0x9'),'fields':[_0xc974('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf34f=['zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','./intZohoField.attributes','define','ZohoField'];(function(_0x18e847,_0x255dbf){var _0x1c4f5d=function(_0x5a08fb){while(--_0x5a08fb){_0x18e847['push'](_0x18e847['shift']());}};_0x1c4f5d(++_0x255dbf);}(_0xf34f,0x14d));var _0xff34=function(_0x922570,_0x2733c8){_0x922570=_0x922570-0x0;var _0x1acb10=_0xf34f[_0x922570];return _0x1acb10;};'use strict';var _=require('lodash');var util=require(_0xff34('0x0'));var logger=require(_0xff34('0x1'))(_0xff34('0x2'));var moment=require(_0xff34('0x3'));var BPromise=require('bluebird');var rp=require(_0xff34('0x4'));var attributes=require(_0xff34('0x5'));module['exports']=function(_0x102211,_0x5b4814){return _0x102211[_0xff34('0x6')](_0xff34('0x7'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xff34('0x8'),'fields':[_0xff34('0x9'),_0xff34('0xa')],'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 17e5195..6356aa0 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 _0x6892=['ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c3e24,_0x375a27){var _0x2239ed=function(_0x568fc3){while(--_0x568fc3){_0x5c3e24['push'](_0x5c3e24['shift']());}};_0x2239ed(++_0x375a27);}(_0x6892,0x1bb));var _0x2689=function(_0x2ad871,_0x288a61){_0x2ad871=_0x2ad871-0x0;var _0x538be7=_0x6892[_0x2ad871];return _0x538be7;};'use strict';var _=require(_0x2689('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2689('0x1'));var rs=require(_0x2689('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2689('0x3'))['db'];var utils=require(_0x2689('0x4'));var logger=require('../../config/logger')(_0x2689('0x5'));var config=require('../../config/environment');var jayson=require(_0x2689('0x6'));var client=jayson['client'][_0x2689('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a55d9,_0x1230db,_0x2a8ba6){return new BPromise(function(_0x399b41,_0x4a66fe){return client['request'](_0x1a55d9,_0x2a8ba6)[_0x2689('0x8')](function(_0x5a7544){logger[_0x2689('0x9')](_0x2689('0xa'),_0x1230db,_0x2689('0xb'));logger[_0x2689('0xc')](_0x2689('0xd'),_0x1230db,_0x2689('0xb'),JSON['stringify'](_0x5a7544));if(_0x5a7544[_0x2689('0xe')]){if(_0x5a7544[_0x2689('0xe')][_0x2689('0xf')]===0x1f4){logger[_0x2689('0xe')](_0x2689('0xa'),_0x1230db,_0x5a7544['error']['message']);return _0x4a66fe(_0x5a7544['error'][_0x2689('0x10')]);}logger[_0x2689('0xe')](_0x2689('0xa'),_0x1230db,_0x5a7544[_0x2689('0xe')][_0x2689('0x10')]);return _0x399b41(_0x5a7544[_0x2689('0xe')]['message']);}else{logger[_0x2689('0x9')](_0x2689('0xa'),_0x1230db,'request\x20sent');_0x399b41(_0x5a7544[_0x2689('0x11')]['message']);}})[_0x2689('0x12')](function(_0x5c2adc){logger[_0x2689('0xe')]('ZohoField,\x20%s,\x20%s',_0x1230db,_0x5c2adc);_0x4a66fe(_0x5c2adc);});});} \ No newline at end of file +var _0x0e54=['randomstring','../../mysqldb','../../config/utils','../../config/environment','client','then','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x0e54,0x100));var _0x40e5=function(_0x341356,_0xa85bf2){_0x341356=_0x341356-0x0;var _0xcffc2d=_0x0e54[_0x341356];return _0xcffc2d;};'use strict';var _=require(_0x40e5('0x0'));var util=require(_0x40e5('0x1'));var moment=require(_0x40e5('0x2'));var BPromise=require(_0x40e5('0x3'));var rs=require(_0x40e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40e5('0x5'))['db'];var utils=require(_0x40e5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x40e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x40e5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f598a,_0x5a4820,_0xd24e40){return new BPromise(function(_0x4e8176,_0x573a22){return client['request'](_0x2f598a,_0xd24e40)[_0x40e5('0x9')](function(_0x2bc58f){logger['info']('ZohoField,\x20%s,\x20%s',_0x5a4820,_0x40e5('0xa'));logger[_0x40e5('0xb')](_0x40e5('0xc'),_0x5a4820,_0x40e5('0xa'),JSON[_0x40e5('0xd')](_0x2bc58f));if(_0x2bc58f[_0x40e5('0xe')]){if(_0x2bc58f[_0x40e5('0xe')][_0x40e5('0xf')]===0x1f4){logger[_0x40e5('0xe')](_0x40e5('0x10'),_0x5a4820,_0x2bc58f[_0x40e5('0xe')][_0x40e5('0x11')]);return _0x573a22(_0x2bc58f[_0x40e5('0xe')][_0x40e5('0x11')]);}logger[_0x40e5('0xe')](_0x40e5('0x10'),_0x5a4820,_0x2bc58f['error'][_0x40e5('0x11')]);return _0x4e8176(_0x2bc58f[_0x40e5('0xe')]['message']);}else{logger['info'](_0x40e5('0x10'),_0x5a4820,_0x40e5('0xa'));_0x4e8176(_0x2bc58f[_0x40e5('0x12')][_0x40e5('0x11')]);}})[_0x40e5('0x13')](function(_0x1c99dd){logger[_0x40e5('0xe')](_0x40e5('0x10'),_0x5a4820,_0x1c99dd);_0x573a22(_0x1c99dd);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dbc225b..b065229 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 _0x7409=['../../config/environment','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4a3fea,_0x44f03b){var _0x1b01e4=function(_0x434b6a){while(--_0x434b6a){_0x4a3fea['push'](_0x4a3fea['shift']());}};_0x1b01e4(++_0x44f03b);}(_0x7409,0x6e));var _0x9740=function(_0x55e099,_0x9fa64a){_0x55e099=_0x55e099-0x0;var _0x551a58=_0x7409[_0x55e099];return _0x551a58;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var auth=require(_0x9740('0x5'));var interaction=require(_0x9740('0x6'));var config=require(_0x9740('0x7'));module[_0x9740('0x8')]=router; \ No newline at end of file +var _0xb470=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x1001d2,_0x3be9a1){var _0x382391=function(_0x1c1300){while(--_0x1c1300){_0x1001d2['push'](_0x1001d2['shift']());}};_0x382391(++_0x3be9a1);}(_0xb470,0x75));var _0x0b47=function(_0x23f2c7,_0x115cc6){_0x23f2c7=_0x23f2c7-0x0;var _0x492cde=_0xb470[_0x23f2c7];return _0x492cde;};'use strict';var multer=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require(_0x0b47('0x2'));var timeout=require(_0x0b47('0x3'));var express=require('express');var router=express[_0x0b47('0x4')]();var auth=require(_0x0b47('0x5'));var interaction=require(_0x0b47('0x6'));var config=require('../../config/environment');module[_0x0b47('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7ecb617..21139df 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 _0xcd07=['sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x2a58ff,_0x210e9c){var _0x2a68dd=function(_0x253278){while(--_0x253278){_0x2a58ff['push'](_0x2a58ff['shift']());}};_0x2a68dd(++_0x210e9c);}(_0xcd07,0x9c));var _0x7cd0=function(_0x1484b5,_0x4736bb){_0x1484b5=_0x1484b5-0x0;var _0xd6298c=_0xcd07[_0x1484b5];return _0xd6298c;};'use strict';var Sequelize=require(_0x7cd0('0x0'));module[_0x7cd0('0x1')]={'name':{'type':Sequelize[_0x7cd0('0x2')],'allowNull':![],'unique':_0x7cd0('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7cd0('0x3')},'main':{'type':Sequelize[_0x7cd0('0x2')],'defaultValue':_0x7cd0('0x4')},'filename':{'type':Sequelize[_0x7cd0('0x2')]},'path':{'type':Sequelize[_0x7cd0('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x7cd0('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x7cd0('0x2')]},'logo':{'type':Sequelize[_0x7cd0('0x2')]},'state':{'type':Sequelize[_0x7cd0('0x2')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x7cd0('0x2')]},'remoteUri':{'type':Sequelize[_0x7cd0('0x2')]},'link':{'type':Sequelize[_0x7cd0('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x92eb=['app.js','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x92eb,0x12f));var _0xb92e=function(_0x1ca5da,_0x1d8026){_0x1ca5da=_0x1ca5da-0x0;var _0x5a61b7=_0x92eb[_0x1ca5da];return _0x5a61b7;};'use strict';var Sequelize=require(_0xb92e('0x0'));module[_0xb92e('0x1')]={'name':{'type':Sequelize[_0xb92e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb92e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xb92e('0x2')],'defaultValue':_0xb92e('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb92e('0x2')]},'size':{'type':Sequelize[_0xb92e('0x4')]},'active':{'type':Sequelize[_0xb92e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xb92e('0x2')]},'logo':{'type':Sequelize[_0xb92e('0x2')]},'state':{'type':Sequelize[_0xb92e('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xb92e('0x2')]},'title':{'type':Sequelize[_0xb92e('0x2')]},'remoteUri':{'type':Sequelize[_0xb92e('0x2')]},'link':{'type':Sequelize[_0xb92e('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 9d7ed00..39bd0ab 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 _0xa1c5=['findAll','show','params','intersection','merge','find','then','catch','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','VIRTUAL','options','Integration','includeAll','include'];(function(_0x5af23e,_0x239a29){var _0x2d481e=function(_0x1168c4){while(--_0x1168c4){_0x5af23e['push'](_0x5af23e['shift']());}};_0x2d481e(++_0x239a29);}(_0xa1c5,0x96));var _0x5a1c=function(_0x3f5618,_0x5717e5){_0x3f5618=_0x3f5618-0x0;var _0x46ee06=_0xa1c5[_0x3f5618];return _0x46ee06;};'use strict';var pdf=require(_0x5a1c('0x0'));var emlformat=require(_0x5a1c('0x1'));var rimraf=require(_0x5a1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a1c('0x3'));var moment=require(_0x5a1c('0x4'));var BPromise=require(_0x5a1c('0x5'));var Mustache=require('mustache');var util=require(_0x5a1c('0x6'));var path=require(_0x5a1c('0x7'));var sox=require(_0x5a1c('0x8'));var csv=require('to-csv');var ejs=require(_0x5a1c('0x9'));var fs=require('fs');var _=require(_0x5a1c('0xa'));var squel=require('squel');var crypto=require(_0x5a1c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a1c('0xc'));var toCsv=require(_0x5a1c('0xd'));var querystring=require(_0x5a1c('0xe'));var Papa=require(_0x5a1c('0xf'));var authService=require(_0x5a1c('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5a1c('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x5a1c('0x12'))(_0x5a1c('0x13'));var utils=require('../../config/utils');var config=require(_0x5a1c('0x14'));var db=require(_0x5a1c('0x15'))['db'];function respondWithStatusCode(_0x4fa460,_0xa94ed5){_0xa94ed5=_0xa94ed5||0xcc;return function(_0x307279){if(_0x307279){return _0x4fa460['sendStatus'](_0xa94ed5);}return _0x4fa460[_0x5a1c('0x16')](_0xa94ed5)[_0x5a1c('0x17')]();};}function respondWithResult(_0x53bbde,_0x5acb82){_0x5acb82=_0x5acb82||0xc8;return function(_0x31025d){if(_0x31025d){return _0x53bbde['status'](_0x5acb82)[_0x5a1c('0x18')](_0x31025d);}};}function respondWithFilteredResult(_0x3491c5,_0x133368){return function(_0x55bbd8){if(_0x55bbd8){var _0x5af07e=_0x55bbd8[_0x5a1c('0x19')],_0x4404e7=_0x133368[_0x5a1c('0x1a')],_0x1bebd0=_0x133368['offset']+_0x133368[_0x5a1c('0x1b')],_0x5ad7b;if(_0x1bebd0>=_0x5af07e){_0x1bebd0=_0x5af07e;_0x5ad7b=0xc8;}else{_0x5ad7b=0xce;}_0x3491c5[_0x5a1c('0x16')](_0x5ad7b);return _0x3491c5[_0x5a1c('0x1c')](_0x5a1c('0x1d'),_0x4404e7+'-'+_0x1bebd0+'/'+_0x5af07e)[_0x5a1c('0x18')](_0x55bbd8);}return null;};}function patchUpdates(_0x4789b1){return function(_0x1d8836){try{jsonpatch[_0x5a1c('0x1e')](_0x1d8836,_0x4789b1,!![]);}catch(_0x2ec45c){return BPromise[_0x5a1c('0x1f')](_0x2ec45c);}return _0x1d8836['save']();};}function saveUpdates(_0xfeb722,_0x341d40){return function(_0x12d565){if(_0x12d565){return _0x12d565[_0x5a1c('0x20')](_0xfeb722)['then'](function(_0x29eb79){return _0x29eb79;});}return null;};}function removeEntity(_0x9c0a8e,_0xf33edc){return function(_0x42845d){if(_0x42845d){return _0x42845d[_0x5a1c('0x21')]()['then'](function(){_0x9c0a8e[_0x5a1c('0x16')](0xcc)[_0x5a1c('0x17')]();});}};}function handleEntityNotFound(_0x40d43e,_0x45311d){return function(_0x10eb4b){if(!_0x10eb4b){_0x40d43e[_0x5a1c('0x22')](0x194);}return _0x10eb4b;};}function handleError(_0x1b377b,_0x2ac304){_0x2ac304=_0x2ac304||0x1f4;return function(_0x3003d0){logger['error'](_0x3003d0[_0x5a1c('0x23')]);if(_0x3003d0[_0x5a1c('0x24')]){delete _0x3003d0[_0x5a1c('0x24')];}_0x1b377b[_0x5a1c('0x16')](_0x2ac304)[_0x5a1c('0x25')](_0x3003d0);};}exports[_0x5a1c('0x26')]=function(_0x2baf02,_0x1e8e48){var _0x374271={},_0x290fbc={},_0x493efd={'count':0x0,'rows':[]};var _0x18413b=db['Integration'][_0x5a1c('0x27')];_0x290fbc[_0x5a1c('0x28')]=_[_0x5a1c('0x29')](_0x18413b);_0x290fbc['query']=_[_0x5a1c('0x29')](_0x2baf02[_0x5a1c('0x2a')]);_0x290fbc[_0x5a1c('0x2b')]=_['intersection'](_0x290fbc['model'],_0x290fbc[_0x5a1c('0x2a')]);_0x374271[_0x5a1c('0x2c')]=_['intersection'](_0x290fbc[_0x5a1c('0x28')],qs[_0x5a1c('0x2d')](_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x2d')]));_0x374271[_0x5a1c('0x2c')]=_0x374271[_0x5a1c('0x2c')][_0x5a1c('0x2e')]?_0x374271[_0x5a1c('0x2c')]:_0x290fbc[_0x5a1c('0x28')];if(!_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x2f')](_0x5a1c('0x30'))){_0x374271[_0x5a1c('0x1b')]=qs[_0x5a1c('0x1b')](_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x1b')]);_0x374271[_0x5a1c('0x1a')]=qs[_0x5a1c('0x1a')](_0x2baf02[_0x5a1c('0x2a')]['offset']);}_0x374271[_0x5a1c('0x31')]=qs[_0x5a1c('0x32')](_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x32')]);_0x374271[_0x5a1c('0x33')]=qs[_0x5a1c('0x2b')](_['pick'](_0x2baf02[_0x5a1c('0x2a')],_0x290fbc[_0x5a1c('0x2b')]));if(_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x34')]){_0x374271['where']=_['merge'](_0x374271['where'],{'$or':_[_0x5a1c('0x35')](_0x18413b,function(_0x3f8a4c){if(_0x3f8a4c[_0x5a1c('0x36')]['key']!==_0x5a1c('0x37')){var _0x3520dc={};_0x3520dc[_0x3f8a4c['field']]={'$like':'%'+_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x34')]+'%'};return _0x3520dc;}})});}_0x374271=_['merge']({},_0x374271,_0x2baf02[_0x5a1c('0x38')]);var _0x455388={'where':_0x374271['where']};return db[_0x5a1c('0x39')][_0x5a1c('0x19')](_0x455388)['then'](function(_0x335d7a){_0x493efd[_0x5a1c('0x19')]=_0x335d7a;if(_0x2baf02[_0x5a1c('0x2a')][_0x5a1c('0x3a')]){_0x374271[_0x5a1c('0x3b')]=[{'all':!![]}];}return db[_0x5a1c('0x39')][_0x5a1c('0x3c')](_0x374271);})['then'](function(_0x5bc833){_0x493efd['rows']=_0x5bc833;return _0x493efd;})['then'](respondWithFilteredResult(_0x1e8e48,_0x374271))['catch'](handleError(_0x1e8e48,null));};exports[_0x5a1c('0x3d')]=function(_0x525089,_0x1b6fa2){var _0x149890={'raw':![],'where':{'id':_0x525089[_0x5a1c('0x3e')]['id']}},_0xaca53b={};_0xaca53b[_0x5a1c('0x28')]=_[_0x5a1c('0x29')](db['Integration'][_0x5a1c('0x27')]);_0xaca53b[_0x5a1c('0x2a')]=_[_0x5a1c('0x29')](_0x525089[_0x5a1c('0x2a')]);_0xaca53b[_0x5a1c('0x2b')]=_[_0x5a1c('0x3f')](_0xaca53b[_0x5a1c('0x28')],_0xaca53b[_0x5a1c('0x2a')]);_0x149890['attributes']=_[_0x5a1c('0x3f')](_0xaca53b[_0x5a1c('0x28')],qs['fields'](_0x525089[_0x5a1c('0x2a')]['fields']));_0x149890[_0x5a1c('0x2c')]=_0x149890[_0x5a1c('0x2c')][_0x5a1c('0x2e')]?_0x149890[_0x5a1c('0x2c')]:_0xaca53b[_0x5a1c('0x28')];if(_0x525089[_0x5a1c('0x2a')][_0x5a1c('0x3a')]){_0x149890[_0x5a1c('0x3b')]=[{'all':!![]}];}_0x149890=_[_0x5a1c('0x40')]({},_0x149890,_0x525089[_0x5a1c('0x38')]);return db[_0x5a1c('0x39')][_0x5a1c('0x41')](_0x149890)[_0x5a1c('0x42')](handleEntityNotFound(_0x1b6fa2,null))[_0x5a1c('0x42')](respondWithResult(_0x1b6fa2,null))[_0x5a1c('0x43')](handleError(_0x1b6fa2,null));};exports[_0x5a1c('0x44')]=function(_0x17bd61,_0x21ddfa){return db[_0x5a1c('0x39')][_0x5a1c('0x44')](_0x17bd61['body'],{})['then'](respondWithResult(_0x21ddfa,0xc9))[_0x5a1c('0x43')](handleError(_0x21ddfa,null));};exports[_0x5a1c('0x20')]=function(_0x5e12a6,_0x5d7d8b){if(_0x5e12a6['body']['id']){delete _0x5e12a6[_0x5a1c('0x45')]['id'];}return db['Integration'][_0x5a1c('0x41')]({'where':{'id':_0x5e12a6[_0x5a1c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5d7d8b,null))[_0x5a1c('0x42')](saveUpdates(_0x5e12a6[_0x5a1c('0x45')],null))[_0x5a1c('0x42')](respondWithResult(_0x5d7d8b,null))[_0x5a1c('0x43')](handleError(_0x5d7d8b,null));};exports[_0x5a1c('0x21')]=function(_0x4a9ae4,_0x593b0b){return db[_0x5a1c('0x39')][_0x5a1c('0x41')]({'where':{'id':_0x4a9ae4[_0x5a1c('0x3e')]['id']}})[_0x5a1c('0x42')](handleEntityNotFound(_0x593b0b,null))[_0x5a1c('0x42')](removeEntity(_0x593b0b,null))[_0x5a1c('0x43')](handleError(_0x593b0b,null));}; \ No newline at end of file +var _0x9e6b=['options','find','create','body','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','where','merge','map','type','VIRTUAL','field','filter','include','findAll','catch','params','length','includeAll'];(function(_0x574448,_0x48528c){var _0x131f65=function(_0x2ad188){while(--_0x2ad188){_0x574448['push'](_0x574448['shift']());}};_0x131f65(++_0x48528c);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e6b[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xb9e6('0x0'));var emlformat=require(_0xb9e6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb9e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb9e6('0x3'));var BPromise=require(_0xb9e6('0x4'));var Mustache=require(_0xb9e6('0x5'));var util=require(_0xb9e6('0x6'));var path=require('path');var sox=require(_0xb9e6('0x7'));var csv=require(_0xb9e6('0x8'));var ejs=require(_0xb9e6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9e6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb9e6('0x8'));var querystring=require('querystring');var Papa=require(_0xb9e6('0xb'));var authService=require(_0xb9e6('0xc'));var hardwareService=require(_0xb9e6('0xd'));var Redis=require(_0xb9e6('0xe'));var qs=require(_0xb9e6('0xf'));var logger=require(_0xb9e6('0x10'))(_0xb9e6('0x11'));var utils=require(_0xb9e6('0x12'));var config=require(_0xb9e6('0x13'));var db=require(_0xb9e6('0x14'))['db'];function respondWithStatusCode(_0x5a8602,_0x17654a){_0x17654a=_0x17654a||0xcc;return function(_0x21ee09){if(_0x21ee09){return _0x5a8602[_0xb9e6('0x15')](_0x17654a);}return _0x5a8602[_0xb9e6('0x16')](_0x17654a)['end']();};}function respondWithResult(_0x21840b,_0x3a0738){_0x3a0738=_0x3a0738||0xc8;return function(_0x54e412){if(_0x54e412){return _0x21840b['status'](_0x3a0738)[_0xb9e6('0x17')](_0x54e412);}};}function respondWithFilteredResult(_0xa22bf1,_0x2673f6){return function(_0x76922c){if(_0x76922c){var _0x5f22f3=_0x76922c[_0xb9e6('0x18')],_0x2657a0=_0x2673f6[_0xb9e6('0x19')],_0x1969e6=_0x2673f6[_0xb9e6('0x19')]+_0x2673f6[_0xb9e6('0x1a')],_0x40b508;if(_0x1969e6>=_0x5f22f3){_0x1969e6=_0x5f22f3;_0x40b508=0xc8;}else{_0x40b508=0xce;}_0xa22bf1[_0xb9e6('0x16')](_0x40b508);return _0xa22bf1[_0xb9e6('0x1b')](_0xb9e6('0x1c'),_0x2657a0+'-'+_0x1969e6+'/'+_0x5f22f3)['json'](_0x76922c);}return null;};}function patchUpdates(_0xffcdad){return function(_0x53a357){try{jsonpatch[_0xb9e6('0x1d')](_0x53a357,_0xffcdad,!![]);}catch(_0x312091){return BPromise[_0xb9e6('0x1e')](_0x312091);}return _0x53a357[_0xb9e6('0x1f')]();};}function saveUpdates(_0x55d628,_0x3f0598){return function(_0x2de3ab){if(_0x2de3ab){return _0x2de3ab[_0xb9e6('0x20')](_0x55d628)[_0xb9e6('0x21')](function(_0x5ecc3b){return _0x5ecc3b;});}return null;};}function removeEntity(_0x4f0d23,_0x4daf8a){return function(_0x31b2ca){if(_0x31b2ca){return _0x31b2ca[_0xb9e6('0x22')]()['then'](function(){_0x4f0d23[_0xb9e6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34dd9b,_0x356c89){return function(_0x13c2b1){if(!_0x13c2b1){_0x34dd9b[_0xb9e6('0x15')](0x194);}return _0x13c2b1;};}function handleError(_0x17885d,_0x5cc468){_0x5cc468=_0x5cc468||0x1f4;return function(_0x1b8ea3){logger[_0xb9e6('0x23')](_0x1b8ea3[_0xb9e6('0x24')]);if(_0x1b8ea3[_0xb9e6('0x25')]){delete _0x1b8ea3[_0xb9e6('0x25')];}_0x17885d['status'](_0x5cc468)[_0xb9e6('0x26')](_0x1b8ea3);};}exports[_0xb9e6('0x27')]=function(_0x5b9667,_0x3ad9d5){var _0x5de404={},_0x2fbdca={},_0x4601a1={'count':0x0,'rows':[]};var _0x2001b=db[_0xb9e6('0x28')][_0xb9e6('0x29')];_0x2fbdca[_0xb9e6('0x2a')]=_[_0xb9e6('0x2b')](_0x2001b);_0x2fbdca[_0xb9e6('0x2c')]=_['keys'](_0x5b9667[_0xb9e6('0x2c')]);_0x2fbdca[_0xb9e6('0x2d')]=_['intersection'](_0x2fbdca[_0xb9e6('0x2a')],_0x2fbdca[_0xb9e6('0x2c')]);_0x5de404['attributes']=_[_0xb9e6('0x2e')](_0x2fbdca[_0xb9e6('0x2a')],qs[_0xb9e6('0x2f')](_0x5b9667[_0xb9e6('0x2c')][_0xb9e6('0x2f')]));_0x5de404[_0xb9e6('0x30')]=_0x5de404[_0xb9e6('0x30')]['length']?_0x5de404[_0xb9e6('0x30')]:_0x2fbdca[_0xb9e6('0x2a')];if(!_0x5b9667['query'][_0xb9e6('0x31')](_0xb9e6('0x32'))){_0x5de404['limit']=qs[_0xb9e6('0x1a')](_0x5b9667['query'][_0xb9e6('0x1a')]);_0x5de404[_0xb9e6('0x19')]=qs[_0xb9e6('0x19')](_0x5b9667[_0xb9e6('0x2c')]['offset']);}_0x5de404[_0xb9e6('0x33')]=qs['sort'](_0x5b9667[_0xb9e6('0x2c')]['sort']);_0x5de404['where']=qs[_0xb9e6('0x2d')](_[_0xb9e6('0x34')](_0x5b9667[_0xb9e6('0x2c')],_0x2fbdca[_0xb9e6('0x2d')]));if(_0x5b9667[_0xb9e6('0x2c')]['filter']){_0x5de404[_0xb9e6('0x35')]=_[_0xb9e6('0x36')](_0x5de404[_0xb9e6('0x35')],{'$or':_[_0xb9e6('0x37')](_0x2001b,function(_0x88099d){if(_0x88099d[_0xb9e6('0x38')]['key']!==_0xb9e6('0x39')){var _0x1a157e={};_0x1a157e[_0x88099d[_0xb9e6('0x3a')]]={'$like':'%'+_0x5b9667[_0xb9e6('0x2c')][_0xb9e6('0x3b')]+'%'};return _0x1a157e;}})});}_0x5de404=_[_0xb9e6('0x36')]({},_0x5de404,_0x5b9667['options']);var _0x16436f={'where':_0x5de404[_0xb9e6('0x35')]};return db[_0xb9e6('0x28')][_0xb9e6('0x18')](_0x16436f)[_0xb9e6('0x21')](function(_0x10cba3){_0x4601a1['count']=_0x10cba3;if(_0x5b9667['query']['includeAll']){_0x5de404[_0xb9e6('0x3c')]=[{'all':!![]}];}return db['Integration'][_0xb9e6('0x3d')](_0x5de404);})[_0xb9e6('0x21')](function(_0x1f9966){_0x4601a1['rows']=_0x1f9966;return _0x4601a1;})['then'](respondWithFilteredResult(_0x3ad9d5,_0x5de404))[_0xb9e6('0x3e')](handleError(_0x3ad9d5,null));};exports['show']=function(_0x52facc,_0x523c92){var _0x31fd7f={'raw':![],'where':{'id':_0x52facc[_0xb9e6('0x3f')]['id']}},_0x361f31={};_0x361f31[_0xb9e6('0x2a')]=_[_0xb9e6('0x2b')](db['Integration'][_0xb9e6('0x29')]);_0x361f31[_0xb9e6('0x2c')]=_['keys'](_0x52facc['query']);_0x361f31[_0xb9e6('0x2d')]=_['intersection'](_0x361f31[_0xb9e6('0x2a')],_0x361f31['query']);_0x31fd7f['attributes']=_['intersection'](_0x361f31[_0xb9e6('0x2a')],qs[_0xb9e6('0x2f')](_0x52facc[_0xb9e6('0x2c')][_0xb9e6('0x2f')]));_0x31fd7f['attributes']=_0x31fd7f[_0xb9e6('0x30')][_0xb9e6('0x40')]?_0x31fd7f[_0xb9e6('0x30')]:_0x361f31['model'];if(_0x52facc[_0xb9e6('0x2c')][_0xb9e6('0x41')]){_0x31fd7f['include']=[{'all':!![]}];}_0x31fd7f=_['merge']({},_0x31fd7f,_0x52facc[_0xb9e6('0x42')]);return db[_0xb9e6('0x28')][_0xb9e6('0x43')](_0x31fd7f)['then'](handleEntityNotFound(_0x523c92,null))['then'](respondWithResult(_0x523c92,null))[_0xb9e6('0x3e')](handleError(_0x523c92,null));};exports[_0xb9e6('0x44')]=function(_0x202ba9,_0x47f645){return db['Integration']['create'](_0x202ba9['body'],{})['then'](respondWithResult(_0x47f645,0xc9))['catch'](handleError(_0x47f645,null));};exports[_0xb9e6('0x20')]=function(_0xa85c5e,_0x50fb77){if(_0xa85c5e[_0xb9e6('0x45')]['id']){delete _0xa85c5e[_0xb9e6('0x45')]['id'];}return db[_0xb9e6('0x28')][_0xb9e6('0x43')]({'where':{'id':_0xa85c5e[_0xb9e6('0x3f')]['id']}})[_0xb9e6('0x21')](handleEntityNotFound(_0x50fb77,null))[_0xb9e6('0x21')](saveUpdates(_0xa85c5e[_0xb9e6('0x45')],null))[_0xb9e6('0x21')](respondWithResult(_0x50fb77,null))[_0xb9e6('0x3e')](handleError(_0x50fb77,null));};exports[_0xb9e6('0x22')]=function(_0x4fe140,_0x29b400){return db[_0xb9e6('0x28')]['find']({'where':{'id':_0x4fe140[_0xb9e6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29b400,null))[_0xb9e6('0x21')](removeEntity(_0x29b400,null))[_0xb9e6('0x3e')](handleError(_0x29b400,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 70465a0..891e9ca 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 _0x187d=['./integration.attributes','Integration','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57c4cb,_0x2827f5){var _0x337c86=function(_0x1fb9e4){while(--_0x1fb9e4){_0x57c4cb['push'](_0x57c4cb['shift']());}};_0x337c86(++_0x2827f5);}(_0x187d,0x93));var _0xd187=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x187d[_0x14add3];return _0x4a174f;};'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 attributes=require(_0xd187('0x6'));module['exports']=function(_0x28fa0b,_0x163807){return _0x28fa0b['define'](_0xd187('0x7'),attributes,{'tableName':_0xd187('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['bluebird','request-promise','./integration.attributes','exports','define','Integration','lodash','api'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var attributes=require(_0xee2f('0x4'));module[_0xee2f('0x5')]=function(_0xcb45e6,_0x4ba89f){return _0xcb45e6[_0xee2f('0x6')](_0xee2f('0x7'),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 72088d8..b653b89 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 _0x6659=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x468210,_0x5964aa){var _0x55199f=function(_0x1fcc93){while(--_0x1fcc93){_0x468210['push'](_0x468210['shift']());}};_0x55199f(++_0x5964aa);}(_0x6659,0xb4));var _0x9665=function(_0x3d0e1d,_0x345a6b){_0x3d0e1d=_0x3d0e1d-0x0;var _0x1acbd4=_0x6659[_0x3d0e1d];return _0x1acbd4;};'use strict';var _=require(_0x9665('0x0'));var util=require('util');var moment=require(_0x9665('0x1'));var BPromise=require(_0x9665('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9665('0x3'));var db=require(_0x9665('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9665('0x5'))(_0x9665('0x6'));var config=require(_0x9665('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x300f1e,_0x3346ee,_0x5d1f85){return new BPromise(function(_0x5910d0,_0x154a0a){return client[_0x9665('0x8')](_0x300f1e,_0x5d1f85)[_0x9665('0x9')](function(_0x365424){logger['info'](_0x9665('0xa'),_0x3346ee,_0x9665('0xb'));logger[_0x9665('0xc')](_0x9665('0xd'),_0x3346ee,_0x9665('0xb'),JSON[_0x9665('0xe')](_0x365424));if(_0x365424[_0x9665('0xf')]){if(_0x365424['error'][_0x9665('0x10')]===0x1f4){logger['error'](_0x9665('0xa'),_0x3346ee,_0x365424[_0x9665('0xf')][_0x9665('0x11')]);return _0x154a0a(_0x365424[_0x9665('0xf')][_0x9665('0x11')]);}logger[_0x9665('0xf')](_0x9665('0xa'),_0x3346ee,_0x365424['error'][_0x9665('0x11')]);return _0x5910d0(_0x365424[_0x9665('0xf')][_0x9665('0x11')]);}else{logger[_0x9665('0x12')](_0x9665('0xa'),_0x3346ee,_0x9665('0xb'));_0x5910d0(_0x365424['result'][_0x9665('0x11')]);}})[_0x9665('0x13')](function(_0x5d77ae){logger[_0x9665('0xf')](_0x9665('0xa'),_0x3346ee,_0x5d77ae);_0x154a0a(_0x5d77ae);});});} \ No newline at end of file +var _0x79ff=['result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x24d232,_0xbf83e7){var _0x11914e=function(_0x2fd1b0){while(--_0x2fd1b0){_0x24d232['push'](_0x24d232['shift']());}};_0x11914e(++_0xbf83e7);}(_0x79ff,0x1d0));var _0xf79f=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0x79ff[_0x5ecff9];return _0x5e1415;};'use strict';var _=require(_0xf79f('0x0'));var util=require(_0xf79f('0x1'));var moment=require('moment');var BPromise=require(_0xf79f('0x2'));var rs=require(_0xf79f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf79f('0x4'));var logger=require(_0xf79f('0x5'))('rpc');var config=require(_0xf79f('0x6'));var jayson=require(_0xf79f('0x7'));var client=jayson[_0xf79f('0x8')][_0xf79f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a69e7,_0xbc316f,_0x2bd288){return new BPromise(function(_0x2966a5,_0x34c003){return client[_0xf79f('0xa')](_0x5a69e7,_0x2bd288)[_0xf79f('0xb')](function(_0xc5a7b2){logger['info'](_0xf79f('0xc'),_0xbc316f,_0xf79f('0xd'));logger[_0xf79f('0xe')](_0xf79f('0xf'),_0xbc316f,'request\x20sent',JSON['stringify'](_0xc5a7b2));if(_0xc5a7b2[_0xf79f('0x10')]){if(_0xc5a7b2[_0xf79f('0x10')]['code']===0x1f4){logger[_0xf79f('0x10')]('Integration,\x20%s,\x20%s',_0xbc316f,_0xc5a7b2[_0xf79f('0x10')][_0xf79f('0x11')]);return _0x34c003(_0xc5a7b2[_0xf79f('0x10')][_0xf79f('0x11')]);}logger['error'](_0xf79f('0xc'),_0xbc316f,_0xc5a7b2['error'][_0xf79f('0x11')]);return _0x2966a5(_0xc5a7b2[_0xf79f('0x10')]['message']);}else{logger[_0xf79f('0x12')](_0xf79f('0xc'),_0xbc316f,_0xf79f('0xd'));_0x2966a5(_0xc5a7b2[_0xf79f('0x13')][_0xf79f('0x11')]);}})[_0xf79f('0x14')](function(_0x40aaf1){logger[_0xf79f('0x10')]('Integration,\x20%s,\x20%s',_0xbc316f,_0x40aaf1);_0x34c003(_0x40aaf1);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 73b8cf7..f4d54ec 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 _0x6a73=['get','index','isAuthenticated','describe','show','post','create','update','delete','/:id','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x6a73,0x171));var _0x36a7=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x6a73[_0x15876a];return _0xbd900f;};'use strict';var multer=require(_0x36a7('0x0'));var util=require(_0x36a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x36a7('0x2')]();var auth=require(_0x36a7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x36a7('0x4'));var controller=require('./integrationReport.controller');router[_0x36a7('0x5')]('/',auth['isAuthenticated'](),controller[_0x36a7('0x6')]);router[_0x36a7('0x5')]('/describe',auth[_0x36a7('0x7')](),controller[_0x36a7('0x8')]);router[_0x36a7('0x5')]('/:id',auth[_0x36a7('0x7')](),controller[_0x36a7('0x9')]);router[_0x36a7('0xa')]('/',auth[_0x36a7('0x7')](),controller[_0x36a7('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x36a7('0xc')]);router[_0x36a7('0xd')](_0x36a7('0xe'),auth['isAuthenticated'](),controller[_0x36a7('0xf')]);module[_0x36a7('0x10')]=router; \ No newline at end of file +var _0xad2c=['index','/describe','describe','/:id','show','put','update','destroy','exports','util','path','express','Router','../../components/auth/service','./integrationReport.controller','get','isAuthenticated'];(function(_0xdaa6d9,_0x27d9c0){var _0x21c313=function(_0xf79ad7){while(--_0xf79ad7){_0xdaa6d9['push'](_0xdaa6d9['shift']());}};_0x21c313(++_0x27d9c0);}(_0xad2c,0x1c3));var _0xcad2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xad2c[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0xcad2('0x0'));var path=require(_0xcad2('0x1'));var timeout=require('connect-timeout');var express=require(_0xcad2('0x2'));var router=express[_0xcad2('0x3')]();var auth=require(_0xcad2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcad2('0x5'));router[_0xcad2('0x6')]('/',auth[_0xcad2('0x7')](),controller[_0xcad2('0x8')]);router[_0xcad2('0x6')](_0xcad2('0x9'),auth[_0xcad2('0x7')](),controller[_0xcad2('0xa')]);router[_0xcad2('0x6')](_0xcad2('0xb'),auth[_0xcad2('0x7')](),controller[_0xcad2('0xc')]);router['post']('/',auth[_0xcad2('0x7')](),controller['create']);router[_0xcad2('0xd')](_0xcad2('0xb'),auth[_0xcad2('0x7')](),controller[_0xcad2('0xe')]);router['delete']('/:id',auth[_0xcad2('0x7')](),controller[_0xcad2('0xf')]);module[_0xcad2('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a7cbbc7..5cc208b 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 _0x24c8=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','ENUM','RECEIVED'];(function(_0x1eca4a,_0x3af6af){var _0x35226e=function(_0x2dc21b){while(--_0x2dc21b){_0x1eca4a['push'](_0x1eca4a['shift']());}};_0x35226e(++_0x3af6af);}(_0x24c8,0x12a));var _0x824c=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x24c8[_0x4f2c3a];return _0x17d91c;};'use strict';var Sequelize=require(_0x824c('0x0'));module[_0x824c('0x1')]={'integration':{'type':Sequelize[_0x824c('0x2')]},'eventChannel':{'type':Sequelize[_0x824c('0x2')]},'exitStatus':{'type':Sequelize[_0x824c('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x824c('0x3')]},'contacts':{'type':Sequelize[_0x824c('0x2')]},'uniqueid':{'type':Sequelize[_0x824c('0x2')]},'calleridnum':{'type':Sequelize[_0x824c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x824c('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x824c('0x4')]},'agentconnectAt':{'type':Sequelize[_0x824c('0x4')]},'holdtime':{'type':Sequelize[_0x824c('0x3')]},'agentcomplete':{'type':Sequelize[_0x824c('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x824c('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x824c('0x3')]},'reason':{'type':Sequelize[_0x824c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x824c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x824c('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x824c('0x4')]},'lastevent':{'type':Sequelize[_0x824c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x824c('0x2')]},'connectedlinename':{'type':Sequelize[_0x824c('0x2')]},'language':{'type':Sequelize[_0x824c('0x2')]},'accountcode':{'type':Sequelize[_0x824c('0x2')]},'context':{'type':Sequelize[_0x824c('0x2')]},'exten':{'type':Sequelize[_0x824c('0x2')]},'priority':{'type':Sequelize[_0x824c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x824c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x824c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x824c('0x2')]},'destcalleridname':{'type':Sequelize[_0x824c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x824c('0x2')]},'destcontext':{'type':Sequelize[_0x824c('0x2')]},'destexten':{'type':Sequelize[_0x824c('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x824c('0x2')]},'inReplyTo':{'type':Sequelize[_0x824c('0x2')]},'subject':{'type':Sequelize[_0x824c('0x2')]},'from':{'type':Sequelize[_0x824c('0x2')]},'to':{'type':Sequelize[_0x824c('0x2')]},'cc':{'type':Sequelize[_0x824c('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x824c('0x6')]('SENT','SENDING',_0x824c('0x7'),_0x824c('0x8'))},'url':{'type':Sequelize[_0x824c('0x2')]},'app':{'type':Sequelize[_0x824c('0x2')]},'appdata':{'type':Sequelize[_0x824c('0x2')]},'projectId':{'type':Sequelize[_0x824c('0x3')]}}; \ No newline at end of file +var _0x4564=['ENUM','SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x454d48,_0x516b6a){var _0x23fcfe=function(_0x385af2){while(--_0x385af2){_0x454d48['push'](_0x454d48['shift']());}};_0x23fcfe(++_0x516b6a);}(_0x4564,0xf3));var _0x4456=function(_0x32ade2,_0x4f80b2){_0x32ade2=_0x32ade2-0x0;var _0x528a80=_0x4564[_0x32ade2];return _0x528a80;};'use strict';var Sequelize=require(_0x4456('0x0'));module[_0x4456('0x1')]={'integration':{'type':Sequelize[_0x4456('0x2')]},'eventChannel':{'type':Sequelize[_0x4456('0x2')]},'exitStatus':{'type':Sequelize[_0x4456('0x2')]},'ticketId':{'type':Sequelize[_0x4456('0x2')]},'integrationId':{'type':Sequelize[_0x4456('0x3')]},'contacts':{'type':Sequelize[_0x4456('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4456('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4456('0x2')]},'membername':{'type':Sequelize[_0x4456('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4456('0x4')]},'agentconnectAt':{'type':Sequelize[_0x4456('0x4')]},'holdtime':{'type':Sequelize[_0x4456('0x3')]},'agentcomplete':{'type':Sequelize[_0x4456('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x4456('0x3')]},'agentacw':{'type':Sequelize[_0x4456('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4456('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4456('0x4')]},'agentdump':{'type':Sequelize[_0x4456('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4456('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4456('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4456('0x2')]},'connectedlinename':{'type':Sequelize[_0x4456('0x2')]},'language':{'type':Sequelize[_0x4456('0x2')]},'accountcode':{'type':Sequelize[_0x4456('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4456('0x2')]},'priority':{'type':Sequelize[_0x4456('0x2')]},'destchannel':{'type':Sequelize[_0x4456('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4456('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4456('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4456('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4456('0x2')]},'destlanguage':{'type':Sequelize[_0x4456('0x2')]},'destaccountcode':{'type':Sequelize[_0x4456('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4456('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x4456('0x2')]},'from':{'type':Sequelize[_0x4456('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x4456('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x4456('0x6')]},'status':{'type':Sequelize[_0x4456('0x7')]('SENT',_0x4456('0x8'),'RECEIVED',_0x4456('0x9'))},'url':{'type':Sequelize[_0x4456('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4456('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 862ac03..16f9752 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 _0x4b3a=['querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','IntegrationReport','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','options','rows','catch','show','params','rawAttributes','includeAll','include','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x4b3a,0x83));var _0xa4b3=function(_0x405211,_0x418bb2){_0x405211=_0x405211-0x0;var _0x402e26=_0x4b3a[_0x405211];return _0x402e26;};'use strict';var pdf=require(_0xa4b3('0x0'));var emlformat=require(_0xa4b3('0x1'));var rimraf=require(_0xa4b3('0x2'));var zipdir=require(_0xa4b3('0x3'));var jsonpatch=require(_0xa4b3('0x4'));var rp=require(_0xa4b3('0x5'));var moment=require(_0xa4b3('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa4b3('0x7'));var util=require(_0xa4b3('0x8'));var path=require(_0xa4b3('0x9'));var sox=require(_0xa4b3('0xa'));var csv=require(_0xa4b3('0xb'));var ejs=require(_0xa4b3('0xc'));var fs=require('fs');var _=require(_0xa4b3('0xd'));var squel=require(_0xa4b3('0xe'));var crypto=require(_0xa4b3('0xf'));var jsforce=require(_0xa4b3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa4b3('0xb'));var querystring=require(_0xa4b3('0x11'));var Papa=require(_0xa4b3('0x12'));var authService=require(_0xa4b3('0x13'));var hardwareService=require(_0xa4b3('0x14'));var Redis=require('ioredis');var qs=require(_0xa4b3('0x15'));var logger=require('../../config/logger')(_0xa4b3('0x16'));var utils=require(_0xa4b3('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3876f9,_0x4be792){_0x4be792=_0x4be792||0xcc;return function(_0x3b8b2b){if(_0x3b8b2b){return _0x3876f9[_0xa4b3('0x18')](_0x4be792);}return _0x3876f9[_0xa4b3('0x19')](_0x4be792)[_0xa4b3('0x1a')]();};}function respondWithResult(_0x30c3ed,_0x5b596c){_0x5b596c=_0x5b596c||0xc8;return function(_0xd4db90){if(_0xd4db90){return _0x30c3ed[_0xa4b3('0x19')](_0x5b596c)['json'](_0xd4db90);}};}function respondWithFilteredResult(_0x572536,_0x3a5cc8){return function(_0x50b7bc){if(_0x50b7bc){var _0x2c889c=_0x50b7bc[_0xa4b3('0x1b')],_0xe99bbb=_0x3a5cc8[_0xa4b3('0x1c')],_0x1508be=_0x3a5cc8[_0xa4b3('0x1c')]+_0x3a5cc8['limit'],_0x13bf08;if(_0x1508be>=_0x2c889c){_0x1508be=_0x2c889c;_0x13bf08=0xc8;}else{_0x13bf08=0xce;}_0x572536[_0xa4b3('0x19')](_0x13bf08);return _0x572536[_0xa4b3('0x1d')](_0xa4b3('0x1e'),_0xe99bbb+'-'+_0x1508be+'/'+_0x2c889c)[_0xa4b3('0x1f')](_0x50b7bc);}return null;};}function patchUpdates(_0x5f0b4a){return function(_0x1b1995){try{jsonpatch[_0xa4b3('0x20')](_0x1b1995,_0x5f0b4a,!![]);}catch(_0x3e006a){return BPromise[_0xa4b3('0x21')](_0x3e006a);}return _0x1b1995[_0xa4b3('0x22')]();};}function saveUpdates(_0x2024cf,_0x810e66){return function(_0x2fb51c){if(_0x2fb51c){return _0x2fb51c['update'](_0x2024cf)[_0xa4b3('0x23')](function(_0x1e4d60){return _0x1e4d60;});}return null;};}function removeEntity(_0x2edd8f,_0x38ac8d){return function(_0x58cbee){if(_0x58cbee){return _0x58cbee[_0xa4b3('0x24')]()[_0xa4b3('0x23')](function(){_0x2edd8f[_0xa4b3('0x19')](0xcc)[_0xa4b3('0x1a')]();});}};}function handleEntityNotFound(_0x3b6621,_0x55d0ee){return function(_0x298fdf){if(!_0x298fdf){_0x3b6621[_0xa4b3('0x18')](0x194);}return _0x298fdf;};}function handleError(_0x158e43,_0x4797a8){_0x4797a8=_0x4797a8||0x1f4;return function(_0x47d8a7){logger[_0xa4b3('0x25')](_0x47d8a7[_0xa4b3('0x26')]);if(_0x47d8a7[_0xa4b3('0x27')]){delete _0x47d8a7[_0xa4b3('0x27')];}_0x158e43[_0xa4b3('0x19')](_0x4797a8)[_0xa4b3('0x28')](_0x47d8a7);};}exports[_0xa4b3('0x29')]=function(_0x30ffb4,_0x14fb43){var _0x58c892={},_0x39ec42={},_0x5863d7={'count':0x0,'rows':[]};var _0x1c7099=db[_0xa4b3('0x2a')]['rawAttributes'];_0x39ec42[_0xa4b3('0x2b')]=_['keys'](_0x1c7099);_0x39ec42[_0xa4b3('0x2c')]=_[_0xa4b3('0x2d')](_0x30ffb4['query']);_0x39ec42[_0xa4b3('0x2e')]=_['intersection'](_0x39ec42[_0xa4b3('0x2b')],_0x39ec42[_0xa4b3('0x2c')]);_0x58c892[_0xa4b3('0x2f')]=_[_0xa4b3('0x30')](_0x39ec42['model'],qs[_0xa4b3('0x31')](_0x30ffb4[_0xa4b3('0x2c')]['fields']));_0x58c892['attributes']=_0x58c892[_0xa4b3('0x2f')][_0xa4b3('0x32')]?_0x58c892['attributes']:_0x39ec42['model'];if(!_0x30ffb4[_0xa4b3('0x2c')]['hasOwnProperty'](_0xa4b3('0x33'))){_0x58c892['limit']=qs[_0xa4b3('0x34')](_0x30ffb4[_0xa4b3('0x2c')]['limit']);_0x58c892[_0xa4b3('0x1c')]=qs['offset'](_0x30ffb4[_0xa4b3('0x2c')]['offset']);}_0x58c892['order']=qs[_0xa4b3('0x35')](_0x30ffb4[_0xa4b3('0x2c')][_0xa4b3('0x35')]);_0x58c892[_0xa4b3('0x36')]=qs[_0xa4b3('0x2e')](_[_0xa4b3('0x37')](_0x30ffb4[_0xa4b3('0x2c')],_0x39ec42[_0xa4b3('0x2e')]));if(_0x30ffb4[_0xa4b3('0x2c')][_0xa4b3('0x38')]){_0x58c892[_0xa4b3('0x36')]=_[_0xa4b3('0x39')](_0x58c892['where'],{'$or':_[_0xa4b3('0x3a')](_0x1c7099,function(_0xec513f){if(_0xec513f[_0xa4b3('0x3b')][_0xa4b3('0x3c')]!=='VIRTUAL'){var _0x2ec6dd={};_0x2ec6dd[_0xec513f['field']]={'$like':'%'+_0x30ffb4[_0xa4b3('0x2c')][_0xa4b3('0x38')]+'%'};return _0x2ec6dd;}})});}_0x58c892=_[_0xa4b3('0x39')]({},_0x58c892,_0x30ffb4[_0xa4b3('0x3d')]);var _0x42abed={'where':_0x58c892[_0xa4b3('0x36')]};return db[_0xa4b3('0x2a')][_0xa4b3('0x1b')](_0x42abed)[_0xa4b3('0x23')](function(_0x347fae){_0x5863d7['count']=_0x347fae;if(_0x30ffb4[_0xa4b3('0x2c')]['includeAll']){_0x58c892['include']=[{'all':!![]}];}return db[_0xa4b3('0x2a')]['findAll'](_0x58c892);})[_0xa4b3('0x23')](function(_0x418328){_0x5863d7[_0xa4b3('0x3e')]=_0x418328;return _0x5863d7;})[_0xa4b3('0x23')](respondWithFilteredResult(_0x14fb43,_0x58c892))[_0xa4b3('0x3f')](handleError(_0x14fb43,null));};exports[_0xa4b3('0x40')]=function(_0x1fbaf4,_0x4304f){var _0x2e2ea0={'raw':![],'where':{'id':_0x1fbaf4[_0xa4b3('0x41')]['id']}},_0x3615bf={};_0x3615bf[_0xa4b3('0x2b')]=_[_0xa4b3('0x2d')](db[_0xa4b3('0x2a')][_0xa4b3('0x42')]);_0x3615bf[_0xa4b3('0x2c')]=_[_0xa4b3('0x2d')](_0x1fbaf4[_0xa4b3('0x2c')]);_0x3615bf[_0xa4b3('0x2e')]=_['intersection'](_0x3615bf[_0xa4b3('0x2b')],_0x3615bf['query']);_0x2e2ea0['attributes']=_['intersection'](_0x3615bf[_0xa4b3('0x2b')],qs['fields'](_0x1fbaf4[_0xa4b3('0x2c')]['fields']));_0x2e2ea0[_0xa4b3('0x2f')]=_0x2e2ea0[_0xa4b3('0x2f')][_0xa4b3('0x32')]?_0x2e2ea0[_0xa4b3('0x2f')]:_0x3615bf[_0xa4b3('0x2b')];if(_0x1fbaf4[_0xa4b3('0x2c')][_0xa4b3('0x43')]){_0x2e2ea0[_0xa4b3('0x44')]=[{'all':!![]}];}_0x2e2ea0=_[_0xa4b3('0x39')]({},_0x2e2ea0,_0x1fbaf4[_0xa4b3('0x3d')]);return db['IntegrationReport']['find'](_0x2e2ea0)['then'](handleEntityNotFound(_0x4304f,null))[_0xa4b3('0x23')](respondWithResult(_0x4304f,null))['catch'](handleError(_0x4304f,null));};exports[_0xa4b3('0x45')]=function(_0x4cd489,_0x533846){return db['IntegrationReport'][_0xa4b3('0x45')](_0x4cd489[_0xa4b3('0x46')],{})[_0xa4b3('0x23')](respondWithResult(_0x533846,0xc9))[_0xa4b3('0x3f')](handleError(_0x533846,null));};exports[_0xa4b3('0x47')]=function(_0x53cc85,_0x5dce34){if(_0x53cc85[_0xa4b3('0x46')]['id']){delete _0x53cc85[_0xa4b3('0x46')]['id'];}return db[_0xa4b3('0x2a')]['find']({'where':{'id':_0x53cc85[_0xa4b3('0x41')]['id']}})[_0xa4b3('0x23')](handleEntityNotFound(_0x5dce34,null))[_0xa4b3('0x23')](saveUpdates(_0x53cc85[_0xa4b3('0x46')],null))['then'](respondWithResult(_0x5dce34,null))[_0xa4b3('0x3f')](handleError(_0x5dce34,null));};exports[_0xa4b3('0x24')]=function(_0x58383b,_0x2e1121){return db['IntegrationReport'][_0xa4b3('0x48')]({'where':{'id':_0x58383b[_0xa4b3('0x41')]['id']}})[_0xa4b3('0x23')](handleEntityNotFound(_0x2e1121,null))[_0xa4b3('0x23')](removeEntity(_0x2e1121,null))[_0xa4b3('0x3f')](handleError(_0x2e1121,null));};exports['describe']=function(_0xaa04a3,_0x1e9942){return db[_0xa4b3('0x2a')][_0xa4b3('0x49')]()['then'](respondWithResult(_0x1e9942,null))['catch'](handleError(_0x1e9942,null));}; \ No newline at end of file +var _0xa2aa=['where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','show','params','length','find','create','body','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','IntegrationReport','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa2aa,0x139));var _0xaa2a=function(_0x1f29f4,_0x12c5b2){_0x1f29f4=_0x1f29f4-0x0;var _0x1fc05b=_0xa2aa[_0x1f29f4];return _0x1fc05b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa2a('0x0'));var moment=require(_0xaa2a('0x1'));var BPromise=require(_0xaa2a('0x2'));var Mustache=require(_0xaa2a('0x3'));var util=require(_0xaa2a('0x4'));var path=require(_0xaa2a('0x5'));var sox=require(_0xaa2a('0x6'));var csv=require(_0xaa2a('0x7'));var ejs=require(_0xaa2a('0x8'));var fs=require('fs');var _=require(_0xaa2a('0x9'));var squel=require(_0xaa2a('0xa'));var crypto=require(_0xaa2a('0xb'));var jsforce=require(_0xaa2a('0xc'));var deskjs=require(_0xaa2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa2a('0xe'));var Papa=require(_0xaa2a('0xf'));var authService=require(_0xaa2a('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xaa2a('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xaa2a('0x12'))(_0xaa2a('0x13'));var utils=require(_0xaa2a('0x14'));var config=require(_0xaa2a('0x15'));var db=require(_0xaa2a('0x16'))['db'];function respondWithStatusCode(_0x47fdb1,_0x3ff11e){_0x3ff11e=_0x3ff11e||0xcc;return function(_0x4a85a7){if(_0x4a85a7){return _0x47fdb1[_0xaa2a('0x17')](_0x3ff11e);}return _0x47fdb1[_0xaa2a('0x18')](_0x3ff11e)[_0xaa2a('0x19')]();};}function respondWithResult(_0x456726,_0x2af25d){_0x2af25d=_0x2af25d||0xc8;return function(_0x7f0a00){if(_0x7f0a00){return _0x456726[_0xaa2a('0x18')](_0x2af25d)[_0xaa2a('0x1a')](_0x7f0a00);}};}function respondWithFilteredResult(_0x1332b5,_0x2e68cb){return function(_0x4cb9a2){if(_0x4cb9a2){var _0x3c9b20=_0x4cb9a2[_0xaa2a('0x1b')],_0x4dae98=_0x2e68cb[_0xaa2a('0x1c')],_0x5811eb=_0x2e68cb['offset']+_0x2e68cb[_0xaa2a('0x1d')],_0x55dd8a;if(_0x5811eb>=_0x3c9b20){_0x5811eb=_0x3c9b20;_0x55dd8a=0xc8;}else{_0x55dd8a=0xce;}_0x1332b5[_0xaa2a('0x18')](_0x55dd8a);return _0x1332b5[_0xaa2a('0x1e')]('Content-Range',_0x4dae98+'-'+_0x5811eb+'/'+_0x3c9b20)[_0xaa2a('0x1a')](_0x4cb9a2);}return null;};}function patchUpdates(_0x217b43){return function(_0x17776d){try{jsonpatch[_0xaa2a('0x1f')](_0x17776d,_0x217b43,!![]);}catch(_0xbe7a1){return BPromise[_0xaa2a('0x20')](_0xbe7a1);}return _0x17776d[_0xaa2a('0x21')]();};}function saveUpdates(_0x2017d8,_0x64f7f3){return function(_0x45a417){if(_0x45a417){return _0x45a417[_0xaa2a('0x22')](_0x2017d8)['then'](function(_0x16d4ea){return _0x16d4ea;});}return null;};}function removeEntity(_0x409683,_0x54051c){return function(_0x194a3a){if(_0x194a3a){return _0x194a3a[_0xaa2a('0x23')]()[_0xaa2a('0x24')](function(){_0x409683[_0xaa2a('0x18')](0xcc)[_0xaa2a('0x19')]();});}};}function handleEntityNotFound(_0x2151df,_0x49c02a){return function(_0x21758f){if(!_0x21758f){_0x2151df[_0xaa2a('0x17')](0x194);}return _0x21758f;};}function handleError(_0x3a9b7e,_0x639ed9){_0x639ed9=_0x639ed9||0x1f4;return function(_0x427d0b){logger[_0xaa2a('0x25')](_0x427d0b[_0xaa2a('0x26')]);if(_0x427d0b[_0xaa2a('0x27')]){delete _0x427d0b[_0xaa2a('0x27')];}_0x3a9b7e['status'](_0x639ed9)['send'](_0x427d0b);};}exports[_0xaa2a('0x28')]=function(_0x201d53,_0x298c55){var _0x1252d3={},_0x347186={},_0x7f1115={'count':0x0,'rows':[]};var _0x59b37d=db[_0xaa2a('0x29')][_0xaa2a('0x2a')];_0x347186[_0xaa2a('0x2b')]=_[_0xaa2a('0x2c')](_0x59b37d);_0x347186[_0xaa2a('0x2d')]=_[_0xaa2a('0x2c')](_0x201d53[_0xaa2a('0x2d')]);_0x347186['filters']=_['intersection'](_0x347186[_0xaa2a('0x2b')],_0x347186['query']);_0x1252d3['attributes']=_[_0xaa2a('0x2e')](_0x347186[_0xaa2a('0x2b')],qs['fields'](_0x201d53[_0xaa2a('0x2d')][_0xaa2a('0x2f')]));_0x1252d3['attributes']=_0x1252d3[_0xaa2a('0x30')]['length']?_0x1252d3['attributes']:_0x347186[_0xaa2a('0x2b')];if(!_0x201d53['query'][_0xaa2a('0x31')](_0xaa2a('0x32'))){_0x1252d3['limit']=qs['limit'](_0x201d53[_0xaa2a('0x2d')][_0xaa2a('0x1d')]);_0x1252d3[_0xaa2a('0x1c')]=qs[_0xaa2a('0x1c')](_0x201d53[_0xaa2a('0x2d')]['offset']);}_0x1252d3['order']=qs['sort'](_0x201d53[_0xaa2a('0x2d')][_0xaa2a('0x33')]);_0x1252d3[_0xaa2a('0x34')]=qs[_0xaa2a('0x35')](_[_0xaa2a('0x36')](_0x201d53[_0xaa2a('0x2d')],_0x347186[_0xaa2a('0x35')]));if(_0x201d53[_0xaa2a('0x2d')]['filter']){_0x1252d3[_0xaa2a('0x34')]=_[_0xaa2a('0x37')](_0x1252d3['where'],{'$or':_[_0xaa2a('0x38')](_0x59b37d,function(_0x3eede6){if(_0x3eede6[_0xaa2a('0x39')][_0xaa2a('0x3a')]!==_0xaa2a('0x3b')){var _0x489417={};_0x489417[_0x3eede6[_0xaa2a('0x3c')]]={'$like':'%'+_0x201d53[_0xaa2a('0x2d')][_0xaa2a('0x3d')]+'%'};return _0x489417;}})});}_0x1252d3=_[_0xaa2a('0x37')]({},_0x1252d3,_0x201d53[_0xaa2a('0x3e')]);var _0x36b4d1={'where':_0x1252d3[_0xaa2a('0x34')]};return db[_0xaa2a('0x29')][_0xaa2a('0x1b')](_0x36b4d1)[_0xaa2a('0x24')](function(_0x243747){_0x7f1115[_0xaa2a('0x1b')]=_0x243747;if(_0x201d53['query']['includeAll']){_0x1252d3[_0xaa2a('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0xaa2a('0x40')](_0x1252d3);})[_0xaa2a('0x24')](function(_0x3288ba){_0x7f1115[_0xaa2a('0x41')]=_0x3288ba;return _0x7f1115;})[_0xaa2a('0x24')](respondWithFilteredResult(_0x298c55,_0x1252d3))[_0xaa2a('0x42')](handleError(_0x298c55,null));};exports[_0xaa2a('0x43')]=function(_0xe1f79e,_0x2e7772){var _0x37153b={'raw':![],'where':{'id':_0xe1f79e[_0xaa2a('0x44')]['id']}},_0x905048={};_0x905048[_0xaa2a('0x2b')]=_['keys'](db[_0xaa2a('0x29')]['rawAttributes']);_0x905048[_0xaa2a('0x2d')]=_[_0xaa2a('0x2c')](_0xe1f79e[_0xaa2a('0x2d')]);_0x905048[_0xaa2a('0x35')]=_[_0xaa2a('0x2e')](_0x905048['model'],_0x905048[_0xaa2a('0x2d')]);_0x37153b[_0xaa2a('0x30')]=_[_0xaa2a('0x2e')](_0x905048['model'],qs['fields'](_0xe1f79e[_0xaa2a('0x2d')][_0xaa2a('0x2f')]));_0x37153b['attributes']=_0x37153b[_0xaa2a('0x30')][_0xaa2a('0x45')]?_0x37153b['attributes']:_0x905048['model'];if(_0xe1f79e['query']['includeAll']){_0x37153b[_0xaa2a('0x3f')]=[{'all':!![]}];}_0x37153b=_['merge']({},_0x37153b,_0xe1f79e[_0xaa2a('0x3e')]);return db[_0xaa2a('0x29')][_0xaa2a('0x46')](_0x37153b)[_0xaa2a('0x24')](handleEntityNotFound(_0x2e7772,null))[_0xaa2a('0x24')](respondWithResult(_0x2e7772,null))['catch'](handleError(_0x2e7772,null));};exports[_0xaa2a('0x47')]=function(_0x46e9ff,_0x4572c8){return db[_0xaa2a('0x29')][_0xaa2a('0x47')](_0x46e9ff['body'],{})[_0xaa2a('0x24')](respondWithResult(_0x4572c8,0xc9))[_0xaa2a('0x42')](handleError(_0x4572c8,null));};exports[_0xaa2a('0x22')]=function(_0x5d9e83,_0x581a9d){if(_0x5d9e83[_0xaa2a('0x48')]['id']){delete _0x5d9e83['body']['id'];}return db[_0xaa2a('0x29')]['find']({'where':{'id':_0x5d9e83['params']['id']}})['then'](handleEntityNotFound(_0x581a9d,null))[_0xaa2a('0x24')](saveUpdates(_0x5d9e83[_0xaa2a('0x48')],null))['then'](respondWithResult(_0x581a9d,null))[_0xaa2a('0x42')](handleError(_0x581a9d,null));};exports[_0xaa2a('0x23')]=function(_0x1a51b5,_0x91d5cc){return db['IntegrationReport'][_0xaa2a('0x46')]({'where':{'id':_0x1a51b5[_0xaa2a('0x44')]['id']}})[_0xaa2a('0x24')](handleEntityNotFound(_0x91d5cc,null))[_0xaa2a('0x24')](removeEntity(_0x91d5cc,null))[_0xaa2a('0x42')](handleError(_0x91d5cc,null));};exports['describe']=function(_0x4ef4e5,_0x13b1e9){return db[_0xaa2a('0x29')]['describe']()[_0xaa2a('0x24')](respondWithResult(_0x13b1e9,null))['catch'](handleError(_0x13b1e9,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index f6cd616..2eb70c3 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 _0x3baf=['bluebird','request-promise','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x589953,_0x47afe0){var _0x17c28c=function(_0x192db8){while(--_0x192db8){_0x589953['push'](_0x589953['shift']());}};_0x17c28c(++_0x47afe0);}(_0x3baf,0xf7));var _0xf3ba=function(_0x423a82,_0x5e6c40){_0x423a82=_0x423a82-0x0;var _0x5a7a2c=_0x3baf[_0x423a82];return _0x5a7a2c;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var attributes=require(_0xf3ba('0x7'));module[_0xf3ba('0x8')]=function(_0x1ae6e6,_0x57e17d){return _0x1ae6e6[_0xf3ba('0x9')](_0xf3ba('0xa'),attributes,{'tableName':_0xf3ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['./integrationReport.attributes','exports','report_integration','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x477518,_0x1903f5){var _0x37e04a=function(_0x2d6983){while(--_0x2d6983){_0x477518['push'](_0x477518['shift']());}};_0x37e04a(++_0x1903f5);}(_0x90b1,0x1bb));var _0x190b=function(_0x48c1bc,_0xb8641f){_0x48c1bc=_0x48c1bc-0x0;var _0x26dfa8=_0x90b1[_0x48c1bc];return _0x26dfa8;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var attributes=require(_0x190b('0x5'));module[_0x190b('0x6')]=function(_0x4fbcad,_0x4c355f){return _0x4fbcad['define']('IntegrationReport',attributes,{'tableName':_0x190b('0x7'),'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 b537ae7..e61a114 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 _0x6ca0=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1966fd,_0x5b737){var _0x6df99e=function(_0x451782){while(--_0x451782){_0x1966fd['push'](_0x1966fd['shift']());}};_0x6df99e(++_0x5b737);}(_0x6ca0,0xfe));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var util=require(_0x06ca('0x1'));var moment=require(_0x06ca('0x2'));var BPromise=require(_0x06ca('0x3'));var rs=require(_0x06ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x06ca('0x6'))(_0x06ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x06ca('0x8'));var client=jayson['client'][_0x06ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a0bb4,_0xecbd9b,_0x5ec8c8){return new BPromise(function(_0x38f092,_0x1f74be){return client[_0x06ca('0xa')](_0x3a0bb4,_0x5ec8c8)[_0x06ca('0xb')](function(_0x1ced13){logger[_0x06ca('0xc')](_0x06ca('0xd'),_0xecbd9b,_0x06ca('0xe'));logger[_0x06ca('0xf')](_0x06ca('0x10'),_0xecbd9b,_0x06ca('0xe'),JSON[_0x06ca('0x11')](_0x1ced13));if(_0x1ced13[_0x06ca('0x12')]){if(_0x1ced13[_0x06ca('0x12')]['code']===0x1f4){logger[_0x06ca('0x12')](_0x06ca('0xd'),_0xecbd9b,_0x1ced13[_0x06ca('0x12')]['message']);return _0x1f74be(_0x1ced13[_0x06ca('0x12')][_0x06ca('0x13')]);}logger[_0x06ca('0x12')]('IntegrationReport,\x20%s,\x20%s',_0xecbd9b,_0x1ced13[_0x06ca('0x12')]['message']);return _0x38f092(_0x1ced13[_0x06ca('0x12')][_0x06ca('0x13')]);}else{logger[_0x06ca('0xc')](_0x06ca('0xd'),_0xecbd9b,_0x06ca('0xe'));_0x38f092(_0x1ced13['result'][_0x06ca('0x13')]);}})[_0x06ca('0x14')](function(_0x3db8d0){logger['error'](_0x06ca('0xd'),_0xecbd9b,_0x3db8d0);_0x1f74be(_0x3db8d0);});});} \ No newline at end of file +var _0xcbb1=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x1be5a6,_0x50dff7){var _0x1c3173=function(_0x3091e5){while(--_0x3091e5){_0x1be5a6['push'](_0x1be5a6['shift']());}};_0x1c3173(++_0x50dff7);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x29f6a3,_0x45571a){_0x29f6a3=_0x29f6a3-0x0;var _0xfdce59=_0xcbb1[_0x29f6a3];return _0xfdce59;};'use strict';var _=require('lodash');var util=require(_0x1cbb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1cbb('0x1'));var fs=require('fs');var Redis=require(_0x1cbb('0x2'));var db=require(_0x1cbb('0x3'))['db'];var utils=require(_0x1cbb('0x4'));var logger=require('../../config/logger')(_0x1cbb('0x5'));var config=require(_0x1cbb('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1cbb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a3ee0,_0x3d2d8e,_0x5381a3){return new BPromise(function(_0x3ce201,_0x2617b8){return client[_0x1cbb('0x8')](_0x2a3ee0,_0x5381a3)[_0x1cbb('0x9')](function(_0x571bcc){logger[_0x1cbb('0xa')](_0x1cbb('0xb'),_0x3d2d8e,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3d2d8e,_0x1cbb('0xc'),JSON[_0x1cbb('0xd')](_0x571bcc));if(_0x571bcc[_0x1cbb('0xe')]){if(_0x571bcc[_0x1cbb('0xe')][_0x1cbb('0xf')]===0x1f4){logger[_0x1cbb('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x3d2d8e,_0x571bcc[_0x1cbb('0xe')][_0x1cbb('0x10')]);return _0x2617b8(_0x571bcc[_0x1cbb('0xe')][_0x1cbb('0x10')]);}logger[_0x1cbb('0xe')](_0x1cbb('0xb'),_0x3d2d8e,_0x571bcc['error'][_0x1cbb('0x10')]);return _0x3ce201(_0x571bcc[_0x1cbb('0xe')]['message']);}else{logger[_0x1cbb('0xa')]('IntegrationReport,\x20%s,\x20%s',_0x3d2d8e,_0x1cbb('0xc'));_0x3ce201(_0x571bcc[_0x1cbb('0x11')][_0x1cbb('0x10')]);}})[_0x1cbb('0x12')](function(_0x4b8998){logger[_0x1cbb('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x3d2d8e,_0x4b8998);_0x2617b8(_0x4b8998);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 6af39bc..1749ce1 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 _0x5713=['isAuthenticated','index','get','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5713,0x1c7));var _0x3571=function(_0x291b08,_0x299409){_0x291b08=_0x291b08-0x0;var _0x426827=_0x5713[_0x291b08];return _0x426827;};'use strict';var multer=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var path=require('path');var timeout=require(_0x3571('0x2'));var express=require('express');var router=express[_0x3571('0x3')]();var auth=require(_0x3571('0x4'));var interaction=require(_0x3571('0x5'));var config=require(_0x3571('0x6'));var controller=require('./interval.controller');router['get']('/',auth[_0x3571('0x7')](),controller[_0x3571('0x8')]);router[_0x3571('0x9')](_0x3571('0xa'),auth[_0x3571('0x7')](),controller[_0x3571('0xb')]);router['get'](_0x3571('0xc'),auth[_0x3571('0x7')](),controller[_0x3571('0xd')]);router[_0x3571('0xe')]('/',auth[_0x3571('0x7')](),controller['create']);router['post'](_0x3571('0xc'),auth[_0x3571('0x7')](),controller[_0x3571('0xf')]);router['post']('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router[_0x3571('0x10')](_0x3571('0xa'),auth[_0x3571('0x7')](),controller[_0x3571('0x11')]);router[_0x3571('0x12')](_0x3571('0xa'),auth[_0x3571('0x7')](),controller[_0x3571('0x13')]);module[_0x3571('0x14')]=router; \ No newline at end of file +var _0x35d2=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','post','create','/:id/sub_intervals','addIntervals','put','/:id','update','delete'];(function(_0x3ab336,_0x11511c){var _0x15ebb3=function(_0x14b638){while(--_0x14b638){_0x3ab336['push'](_0x3ab336['shift']());}};_0x15ebb3(++_0x11511c);}(_0x35d2,0xd4));var _0x235d=function(_0x27f890,_0xb6c75b){_0x27f890=_0x27f890-0x0;var _0x20b887=_0x35d2[_0x27f890];return _0x20b887;};'use strict';var multer=require(_0x235d('0x0'));var util=require('util');var path=require(_0x235d('0x1'));var timeout=require(_0x235d('0x2'));var express=require(_0x235d('0x3'));var router=express[_0x235d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x235d('0x5'));var config=require(_0x235d('0x6'));var controller=require(_0x235d('0x7'));router[_0x235d('0x8')]('/',auth['isAuthenticated'](),controller[_0x235d('0x9')]);router[_0x235d('0x8')]('/:id',auth[_0x235d('0xa')](),controller['show']);router[_0x235d('0x8')]('/:id/sub_intervals',auth[_0x235d('0xa')](),controller['getIntervals']);router[_0x235d('0xb')]('/',auth[_0x235d('0xa')](),controller[_0x235d('0xc')]);router['post'](_0x235d('0xd'),auth['isAuthenticated'](),controller['addInterval']);router['post']('/:id/sub_intervals/create_many',auth[_0x235d('0xa')](),controller[_0x235d('0xe')]);router[_0x235d('0xf')](_0x235d('0x10'),auth[_0x235d('0xa')](),controller[_0x235d('0x11')]);router[_0x235d('0x12')](_0x235d('0x10'),auth['isAuthenticated'](),controller[_0x235d('0x13')]);module[_0x235d('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index f40c09e..3d5d558 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 _0x4eb3=['STRING','sequelize'];(function(_0x11d7ae,_0x3e75cc){var _0xf3d528=function(_0x3816ac){while(--_0x3816ac){_0x11d7ae['push'](_0x11d7ae['shift']());}};_0xf3d528(++_0x3e75cc);}(_0x4eb3,0x101));var _0x34eb=function(_0x150fd1,_0x5b314b){_0x150fd1=_0x150fd1-0x0;var _0x52538a=_0x4eb3[_0x150fd1];return _0x52538a;};'use strict';var Sequelize=require(_0x34eb('0x0'));module['exports']={'name':{'type':Sequelize[_0x34eb('0x1')]},'description':{'type':Sequelize[_0x34eb('0x1')]},'interval':{'type':Sequelize[_0x34eb('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd6bc=['sequelize','exports','STRING'];(function(_0x4ad52c,_0x43fb1b){var _0x4e109f=function(_0x498bcb){while(--_0x498bcb){_0x4ad52c['push'](_0x4ad52c['shift']());}};_0x4e109f(++_0x43fb1b);}(_0xd6bc,0x126));var _0xcd6b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xd6bc[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0xcd6b('0x0'));module[_0xcd6b('0x1')]={'name':{'type':Sequelize[_0xcd6b('0x2')]},'description':{'type':Sequelize[_0xcd6b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index b0b7e1a..9c9c0aa 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 _0x2e66=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','Interval','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','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','addInterval','findOne','params','rawAttributes','order','map','getIntervals','nolimit','sequelize','transaction','IntervalId'];(function(_0x1e441f,_0x51dcad){var _0x5dc8d4=function(_0x2a9696){while(--_0x2a9696){_0x1e441f['push'](_0x1e441f['shift']());}};_0x5dc8d4(++_0x51dcad);}(_0x2e66,0xb6));var _0x62e6=function(_0x673e94,_0x359dc1){_0x673e94=_0x673e94-0x0;var _0x5a003d=_0x2e66[_0x673e94];return _0x5a003d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x62e6('0x0'));var rimraf=require(_0x62e6('0x1'));var zipdir=require(_0x62e6('0x2'));var jsonpatch=require(_0x62e6('0x3'));var rp=require(_0x62e6('0x4'));var moment=require(_0x62e6('0x5'));var BPromise=require(_0x62e6('0x6'));var Mustache=require(_0x62e6('0x7'));var util=require(_0x62e6('0x8'));var path=require(_0x62e6('0x9'));var sox=require(_0x62e6('0xa'));var csv=require(_0x62e6('0xb'));var ejs=require(_0x62e6('0xc'));var fs=require('fs');var _=require(_0x62e6('0xd'));var squel=require(_0x62e6('0xe'));var crypto=require(_0x62e6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x62e6('0x10'));var toCsv=require(_0x62e6('0xb'));var querystring=require('querystring');var Papa=require(_0x62e6('0x11'));var authService=require(_0x62e6('0x12'));var hardwareService=require(_0x62e6('0x13'));var Redis=require(_0x62e6('0x14'));var qs=require(_0x62e6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x62e6('0x16'));var db=require(_0x62e6('0x17'))['db'];var extensions=require(_0x62e6('0x18'));function respondWithStatusCode(_0x49f2e8,_0x223a34){_0x223a34=_0x223a34||0xcc;return function(_0x5351e9){if(_0x5351e9){return _0x49f2e8[_0x62e6('0x19')](_0x223a34);}return _0x49f2e8[_0x62e6('0x1a')](_0x223a34)[_0x62e6('0x1b')]();};}function respondWithResult(_0x33644e,_0x567206){_0x567206=_0x567206||0xc8;return function(_0x36f196){if(_0x36f196){return _0x33644e['status'](_0x567206)['json'](_0x36f196);}};}function respondWithFilteredResult(_0x14b9f8,_0x334c07){return function(_0xd91990){if(_0xd91990){var _0x2f46ba=_0xd91990[_0x62e6('0x1c')],_0x1f77c6=_0x334c07[_0x62e6('0x1d')],_0x2540f0=_0x334c07[_0x62e6('0x1d')]+_0x334c07['limit'],_0x73e74b;if(_0x2540f0>=_0x2f46ba){_0x2540f0=_0x2f46ba;_0x73e74b=0xc8;}else{_0x73e74b=0xce;}_0x14b9f8[_0x62e6('0x1a')](_0x73e74b);return _0x14b9f8['set'](_0x62e6('0x1e'),_0x1f77c6+'-'+_0x2540f0+'/'+_0x2f46ba)[_0x62e6('0x1f')](_0xd91990);}return null;};}function patchUpdates(_0xd3d58d){return function(_0x1cf018){try{jsonpatch[_0x62e6('0x20')](_0x1cf018,_0xd3d58d,!![]);}catch(_0x32acca){return BPromise[_0x62e6('0x21')](_0x32acca);}return _0x1cf018[_0x62e6('0x22')]();};}function saveUpdates(_0x4efed2,_0x23762c){return function(_0x22d5f7){if(_0x22d5f7){return _0x22d5f7[_0x62e6('0x23')](_0x4efed2)[_0x62e6('0x24')](function(_0x563aba){return _0x563aba;});}return null;};}function removeEntity(_0x1396f4,_0x2a936c){return function(_0x35e37a){if(_0x35e37a){return _0x35e37a[_0x62e6('0x25')]()[_0x62e6('0x24')](function(){var _0x36d941=_0x35e37a[_0x62e6('0x26')]({'plain':!![]});var _0x154846=_0x62e6('0x27');return db[_0x62e6('0x28')][_0x62e6('0x25')]({'where':{'type':_0x154846,'resourceId':_0x36d941['id']}})[_0x62e6('0x24')](function(){return _0x35e37a;});})[_0x62e6('0x24')](function(){_0x1396f4[_0x62e6('0x1a')](0xcc)[_0x62e6('0x1b')]();});}};}function handleEntityNotFound(_0x410963,_0x16ef99){return function(_0x20f2fa){if(!_0x20f2fa){_0x410963[_0x62e6('0x19')](0x194);}return _0x20f2fa;};}function handleError(_0xaf8f76,_0x334652){_0x334652=_0x334652||0x1f4;return function(_0x12398b){logger[_0x62e6('0x29')](_0x12398b[_0x62e6('0x2a')]);if(_0x12398b[_0x62e6('0x2b')]){delete _0x12398b[_0x62e6('0x2b')];}_0xaf8f76[_0x62e6('0x1a')](_0x334652)[_0x62e6('0x2c')](_0x12398b);};}exports['index']=function(_0x4965ba,_0x4d8a76){var _0x2c74b4={},_0x35fd5d={},_0x5d3638={'count':0x0,'rows':[]};var _0x4c4bd2=db[_0x62e6('0x2d')]['rawAttributes'];_0x35fd5d[_0x62e6('0x2e')]=_[_0x62e6('0x2f')](_0x4c4bd2);_0x35fd5d[_0x62e6('0x30')]=_[_0x62e6('0x2f')](_0x4965ba[_0x62e6('0x30')]);_0x35fd5d[_0x62e6('0x31')]=_[_0x62e6('0x32')](_0x35fd5d[_0x62e6('0x2e')],_0x35fd5d[_0x62e6('0x30')]);_0x2c74b4['attributes']=_['intersection'](_0x35fd5d[_0x62e6('0x2e')],qs[_0x62e6('0x33')](_0x4965ba['query']['fields']));_0x2c74b4['attributes']=_0x2c74b4[_0x62e6('0x34')][_0x62e6('0x35')]?_0x2c74b4['attributes']:_0x35fd5d['model'];if(!_0x4965ba[_0x62e6('0x30')][_0x62e6('0x36')]('nolimit')){_0x2c74b4[_0x62e6('0x37')]=qs[_0x62e6('0x37')](_0x4965ba[_0x62e6('0x30')][_0x62e6('0x37')]);_0x2c74b4[_0x62e6('0x1d')]=qs[_0x62e6('0x1d')](_0x4965ba[_0x62e6('0x30')][_0x62e6('0x1d')]);}_0x2c74b4['order']=qs[_0x62e6('0x38')](_0x4965ba[_0x62e6('0x30')][_0x62e6('0x38')]);_0x2c74b4[_0x62e6('0x39')]=qs[_0x62e6('0x31')](_['pick'](_0x4965ba[_0x62e6('0x30')],_0x35fd5d['filters']));if(_0x4965ba[_0x62e6('0x30')][_0x62e6('0x3a')]){_0x2c74b4['where']=_[_0x62e6('0x3b')](_0x2c74b4[_0x62e6('0x39')],{'$or':_['map'](_0x4c4bd2,function(_0x3275a7){if(_0x3275a7['type'][_0x62e6('0x3c')]!==_0x62e6('0x3d')){var _0x47af40={};_0x47af40[_0x3275a7[_0x62e6('0x3e')]]={'$like':'%'+_0x4965ba[_0x62e6('0x30')][_0x62e6('0x3a')]+'%'};return _0x47af40;}})});}_0x2c74b4=_[_0x62e6('0x3b')]({},_0x2c74b4,_0x4965ba[_0x62e6('0x3f')]);var _0x4b4ef4={'where':_0x2c74b4[_0x62e6('0x39')]};return db['Interval']['count'](_0x4b4ef4)['then'](function(_0x10fc07){_0x5d3638[_0x62e6('0x1c')]=_0x10fc07;if(_0x4965ba['query'][_0x62e6('0x40')]){_0x2c74b4[_0x62e6('0x41')]=[{'all':!![]}];}return db['Interval'][_0x62e6('0x42')](_0x2c74b4);})[_0x62e6('0x24')](function(_0x395e28){_0x5d3638[_0x62e6('0x43')]=_0x395e28;return _0x5d3638;})[_0x62e6('0x24')](respondWithFilteredResult(_0x4d8a76,_0x2c74b4))[_0x62e6('0x44')](handleError(_0x4d8a76,null));};exports[_0x62e6('0x45')]=function(_0x5659f6,_0x4052d2){var _0x4e9eed={'raw':!![],'where':{'id':_0x5659f6['params']['id']}},_0x115691={};_0x115691['model']=_['keys'](db[_0x62e6('0x2d')]['rawAttributes']);_0x115691['query']=_[_0x62e6('0x2f')](_0x5659f6['query']);_0x115691[_0x62e6('0x31')]=_['intersection'](_0x115691[_0x62e6('0x2e')],_0x115691['query']);_0x4e9eed['attributes']=_[_0x62e6('0x32')](_0x115691[_0x62e6('0x2e')],qs[_0x62e6('0x33')](_0x5659f6[_0x62e6('0x30')][_0x62e6('0x33')]));_0x4e9eed[_0x62e6('0x34')]=_0x4e9eed[_0x62e6('0x34')][_0x62e6('0x35')]?_0x4e9eed[_0x62e6('0x34')]:_0x115691[_0x62e6('0x2e')];if(_0x5659f6[_0x62e6('0x30')]['includeAll']){_0x4e9eed[_0x62e6('0x41')]=[{'all':!![]}];}_0x4e9eed=_[_0x62e6('0x3b')]({},_0x4e9eed,_0x5659f6[_0x62e6('0x3f')]);return db['Interval'][_0x62e6('0x46')](_0x4e9eed)[_0x62e6('0x24')](handleEntityNotFound(_0x4052d2,null))[_0x62e6('0x24')](respondWithResult(_0x4052d2,null))[_0x62e6('0x44')](handleError(_0x4052d2,null));};exports[_0x62e6('0x47')]=function(_0x45adba,_0x592693){return db[_0x62e6('0x2d')]['create'](_0x45adba[_0x62e6('0x48')],{})[_0x62e6('0x24')](function(_0x491c84){var _0x2010ae=_0x45adba[_0x62e6('0x49')][_0x62e6('0x26')]({'plain':!![]});if(!_0x2010ae)throw new Error(_0x62e6('0x4a'));if(_0x2010ae[_0x62e6('0x4b')]==='user'){var _0x56c621=_0x491c84[_0x62e6('0x26')]({'plain':!![]});var _0x55ce81=_0x62e6('0x27');return db[_0x62e6('0x4c')][_0x62e6('0x46')]({'where':{'name':_0x55ce81,'userProfileId':_0x2010ae[_0x62e6('0x4d')]},'raw':!![]})['then'](function(_0x502f09){if(_0x502f09&&_0x502f09[_0x62e6('0x4e')]===0x0){return db[_0x62e6('0x28')][_0x62e6('0x47')]({'name':_0x56c621['name'],'resourceId':_0x56c621['id'],'type':_0x502f09[_0x62e6('0x2b')],'sectionId':_0x502f09['id']},{})['then'](function(){return _0x491c84;});}else{return _0x491c84;}})['catch'](function(_0x30605c){logger[_0x62e6('0x29')](_0x62e6('0x4f'),_0x30605c);throw _0x30605c;});}return _0x491c84;})[_0x62e6('0x24')](respondWithResult(_0x592693,0xc9))[_0x62e6('0x44')](handleError(_0x592693,null));};exports[_0x62e6('0x23')]=function(_0x2fef6c,_0x2f1b06){if(_0x2fef6c[_0x62e6('0x48')]['id']){delete _0x2fef6c[_0x62e6('0x48')]['id'];}return db[_0x62e6('0x2d')][_0x62e6('0x46')]({'where':{'id':_0x2fef6c['params']['id']}})[_0x62e6('0x24')](handleEntityNotFound(_0x2f1b06,null))[_0x62e6('0x24')](saveUpdates(_0x2fef6c[_0x62e6('0x48')],null))[_0x62e6('0x24')](respondWithResult(_0x2f1b06,null))[_0x62e6('0x44')](handleError(_0x2f1b06,null));};exports[_0x62e6('0x25')]=function(_0x2f4423,_0x4e9735){return db[_0x62e6('0x2d')][_0x62e6('0x46')]({'where':{'id':_0x2f4423['params']['id']}})[_0x62e6('0x24')](handleEntityNotFound(_0x4e9735,null))[_0x62e6('0x24')](removeEntity(_0x4e9735,null))[_0x62e6('0x44')](handleError(_0x4e9735,null));};exports[_0x62e6('0x50')]=function(_0x416988,_0x5118ac,_0x37acb8){if(_0x416988['body']['id']){delete _0x416988[_0x62e6('0x48')]['id'];}return db[_0x62e6('0x2d')][_0x62e6('0x46')]({'where':{'id':_0x416988['params']['id']}})['then'](handleEntityNotFound(_0x5118ac,null))[_0x62e6('0x24')](function(_0x5091fb){if(_0x5091fb){_0x416988[_0x62e6('0x48')]['IntervalId']=_0x5091fb['id'];return db['Interval'][_0x62e6('0x47')](_0x416988[_0x62e6('0x48')]);}})[_0x62e6('0x24')](respondWithResult(_0x5118ac,null))[_0x62e6('0x44')](handleError(_0x5118ac,null));};exports['getIntervals']=function(_0x3fe876,_0x4bd35b,_0x563d62){var _0x40685b={};var _0x4e325a={};var _0x3a7975;var _0x2eefd2;return db['Interval'][_0x62e6('0x51')]({'where':{'id':_0x3fe876[_0x62e6('0x52')]['id']}})[_0x62e6('0x24')](handleEntityNotFound(_0x4bd35b,null))['then'](function(_0x2e89d1){if(_0x2e89d1){_0x3a7975=_0x2e89d1;_0x4e325a[_0x62e6('0x2e')]=_['keys'](db['Interval'][_0x62e6('0x53')]);_0x4e325a[_0x62e6('0x30')]=_[_0x62e6('0x2f')](_0x3fe876['query']);_0x4e325a[_0x62e6('0x31')]=_[_0x62e6('0x32')](_0x4e325a['model'],_0x4e325a[_0x62e6('0x30')]);_0x40685b[_0x62e6('0x34')]=_[_0x62e6('0x32')](_0x4e325a[_0x62e6('0x2e')],qs[_0x62e6('0x33')](_0x3fe876['query'][_0x62e6('0x33')]));_0x40685b[_0x62e6('0x34')]=_0x40685b[_0x62e6('0x34')][_0x62e6('0x35')]?_0x40685b[_0x62e6('0x34')]:_0x4e325a[_0x62e6('0x2e')];_0x40685b[_0x62e6('0x54')]=qs['sort'](_0x3fe876['query'][_0x62e6('0x38')]);_0x40685b['where']=qs[_0x62e6('0x31')](_['pick'](_0x3fe876[_0x62e6('0x30')],_0x4e325a['filters']));if(_0x3fe876[_0x62e6('0x30')][_0x62e6('0x3a')]){_0x40685b[_0x62e6('0x39')]=_[_0x62e6('0x3b')](_0x40685b[_0x62e6('0x39')],{'$or':_[_0x62e6('0x55')](_0x40685b[_0x62e6('0x34')],function(_0x134d0e){var _0x2d8314={};_0x2d8314[_0x134d0e]={'$like':'%'+_0x3fe876[_0x62e6('0x30')][_0x62e6('0x3a')]+'%'};return _0x2d8314;})});}_0x40685b=_[_0x62e6('0x3b')]({},_0x40685b,_0x3fe876[_0x62e6('0x3f')]);return _0x3a7975[_0x62e6('0x56')](_0x40685b);}})['then'](function(_0x226e58){if(_0x226e58){_0x2eefd2=_0x226e58[_0x62e6('0x35')];if(!_0x3fe876[_0x62e6('0x30')][_0x62e6('0x36')](_0x62e6('0x57'))){_0x40685b['limit']=qs[_0x62e6('0x37')](_0x3fe876['query'][_0x62e6('0x37')]);_0x40685b[_0x62e6('0x1d')]=qs['offset'](_0x3fe876[_0x62e6('0x30')][_0x62e6('0x1d')]);}return _0x3a7975[_0x62e6('0x56')](_0x40685b);}})[_0x62e6('0x24')](function(_0x16f79f){if(_0x16f79f){return _0x16f79f?{'count':_0x2eefd2,'rows':_0x16f79f}:null;}})['then'](respondWithResult(_0x4bd35b,null))['catch'](handleError(_0x4bd35b,null));};exports['addIntervals']=function(_0x69a6f1,_0x48ccb6,_0x5b6723){return db[_0x62e6('0x2d')]['findOne']({'where':{'id':_0x69a6f1[_0x62e6('0x52')]['id']}})[_0x62e6('0x24')](handleEntityNotFound(_0x48ccb6,null))[_0x62e6('0x24')](function(_0xe61590){if(_0xe61590){return db[_0x62e6('0x58')][_0x62e6('0x59')](function(_0x38658d){return db[_0x62e6('0x2d')][_0x62e6('0x25')]({'where':{'IntervalId':_0x69a6f1[_0x62e6('0x52')]['id']},'transaction':_0x38658d})[_0x62e6('0x24')](function(_0x4f1e25){var _0x27c501=_[_0x62e6('0x55')](_0x69a6f1[_0x62e6('0x48')],function(_0x4ab65b){delete _0x4ab65b['id'];_0x4ab65b[_0x62e6('0x5a')]=_0x69a6f1[_0x62e6('0x52')]['id'];return _0x4ab65b;});return db[_0x62e6('0x2d')]['bulkCreate'](_0x27c501,{'transaction':_0x38658d});});})['then'](function(){return db['Interval'][_0x62e6('0x42')]({'where':{'IntervalId':_0x69a6f1[_0x62e6('0x52')]['id']}});});}})[_0x62e6('0x24')](respondWithResult(_0x48ccb6,null))[_0x62e6('0x44')](handleError(_0x48ccb6,null));}; \ No newline at end of file +var _0xb1fa=['UserProfileResource','error','stack','name','Interval','rawAttributes','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','pick','filter','addIntervals','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','save','update','destroy','then','get','Intervals'];(function(_0x3bd955,_0xe0997f){var _0x150d96=function(_0xfd3675){while(--_0xfd3675){_0x3bd955['push'](_0x3bd955['shift']());}};_0x150d96(++_0xe0997f);}(_0xb1fa,0x13c));var _0xab1f=function(_0x2c8c55,_0x4fe848){_0x2c8c55=_0x2c8c55-0x0;var _0x1faf87=_0xb1fa[_0x2c8c55];return _0x1faf87;};'use strict';var pdf=require(_0xab1f('0x0'));var emlformat=require(_0xab1f('0x1'));var rimraf=require(_0xab1f('0x2'));var zipdir=require(_0xab1f('0x3'));var jsonpatch=require(_0xab1f('0x4'));var rp=require(_0xab1f('0x5'));var moment=require('moment');var BPromise=require(_0xab1f('0x6'));var Mustache=require('mustache');var util=require(_0xab1f('0x7'));var path=require(_0xab1f('0x8'));var sox=require('sox');var csv=require(_0xab1f('0x9'));var ejs=require(_0xab1f('0xa'));var fs=require('fs');var _=require(_0xab1f('0xb'));var squel=require(_0xab1f('0xc'));var crypto=require('crypto');var jsforce=require(_0xab1f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xab1f('0x9'));var querystring=require(_0xab1f('0xe'));var Papa=require('papaparse');var authService=require(_0xab1f('0xf'));var hardwareService=require(_0xab1f('0x10'));var Redis=require('ioredis');var qs=require(_0xab1f('0x11'));var logger=require('../../config/logger')(_0xab1f('0x12'));var utils=require(_0xab1f('0x13'));var config=require(_0xab1f('0x14'));var db=require(_0xab1f('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x15e220,_0x3e376a){_0x3e376a=_0x3e376a||0xcc;return function(_0x3a95bc){if(_0x3a95bc){return _0x15e220[_0xab1f('0x16')](_0x3e376a);}return _0x15e220[_0xab1f('0x17')](_0x3e376a)[_0xab1f('0x18')]();};}function respondWithResult(_0x28b5f4,_0x2867fb){_0x2867fb=_0x2867fb||0xc8;return function(_0x505d1d){if(_0x505d1d){return _0x28b5f4[_0xab1f('0x17')](_0x2867fb)[_0xab1f('0x19')](_0x505d1d);}};}function respondWithFilteredResult(_0x2584db,_0x4ea134){return function(_0x4f39eb){if(_0x4f39eb){var _0xcc14e=_0x4f39eb[_0xab1f('0x1a')],_0x1c0bf3=_0x4ea134['offset'],_0x4833a5=_0x4ea134['offset']+_0x4ea134['limit'],_0x37216e;if(_0x4833a5>=_0xcc14e){_0x4833a5=_0xcc14e;_0x37216e=0xc8;}else{_0x37216e=0xce;}_0x2584db[_0xab1f('0x17')](_0x37216e);return _0x2584db[_0xab1f('0x1b')](_0xab1f('0x1c'),_0x1c0bf3+'-'+_0x4833a5+'/'+_0xcc14e)[_0xab1f('0x19')](_0x4f39eb);}return null;};}function patchUpdates(_0x226f87){return function(_0x29c59e){try{jsonpatch[_0xab1f('0x1d')](_0x29c59e,_0x226f87,!![]);}catch(_0x2a1393){return BPromise['reject'](_0x2a1393);}return _0x29c59e[_0xab1f('0x1e')]();};}function saveUpdates(_0x10b538,_0x1bd52d){return function(_0x554c05){if(_0x554c05){return _0x554c05[_0xab1f('0x1f')](_0x10b538)['then'](function(_0x23a481){return _0x23a481;});}return null;};}function removeEntity(_0x60f612,_0x2708da){return function(_0x2e1770){if(_0x2e1770){return _0x2e1770[_0xab1f('0x20')]()[_0xab1f('0x21')](function(){var _0x535242=_0x2e1770[_0xab1f('0x22')]({'plain':!![]});var _0x12d95c=_0xab1f('0x23');return db[_0xab1f('0x24')]['destroy']({'where':{'type':_0x12d95c,'resourceId':_0x535242['id']}})[_0xab1f('0x21')](function(){return _0x2e1770;});})[_0xab1f('0x21')](function(){_0x60f612[_0xab1f('0x17')](0xcc)[_0xab1f('0x18')]();});}};}function handleEntityNotFound(_0x4ef65f,_0x5ebae6){return function(_0x5f3559){if(!_0x5f3559){_0x4ef65f[_0xab1f('0x16')](0x194);}return _0x5f3559;};}function handleError(_0x3b1535,_0x199198){_0x199198=_0x199198||0x1f4;return function(_0xae86c8){logger[_0xab1f('0x25')](_0xae86c8[_0xab1f('0x26')]);if(_0xae86c8['name']){delete _0xae86c8[_0xab1f('0x27')];}_0x3b1535[_0xab1f('0x17')](_0x199198)['send'](_0xae86c8);};}exports['index']=function(_0x711c14,_0x48000e){var _0x11c4d6={},_0x520747={},_0x3248be={'count':0x0,'rows':[]};var _0x3e15f3=db[_0xab1f('0x28')][_0xab1f('0x29')];_0x520747[_0xab1f('0x2a')]=_['keys'](_0x3e15f3);_0x520747['query']=_['keys'](_0x711c14['query']);_0x520747[_0xab1f('0x2b')]=_[_0xab1f('0x2c')](_0x520747[_0xab1f('0x2a')],_0x520747[_0xab1f('0x2d')]);_0x11c4d6[_0xab1f('0x2e')]=_[_0xab1f('0x2c')](_0x520747[_0xab1f('0x2a')],qs[_0xab1f('0x2f')](_0x711c14['query'][_0xab1f('0x2f')]));_0x11c4d6['attributes']=_0x11c4d6[_0xab1f('0x2e')][_0xab1f('0x30')]?_0x11c4d6[_0xab1f('0x2e')]:_0x520747[_0xab1f('0x2a')];if(!_0x711c14['query'][_0xab1f('0x31')](_0xab1f('0x32'))){_0x11c4d6['limit']=qs[_0xab1f('0x33')](_0x711c14[_0xab1f('0x2d')]['limit']);_0x11c4d6[_0xab1f('0x34')]=qs['offset'](_0x711c14['query']['offset']);}_0x11c4d6[_0xab1f('0x35')]=qs[_0xab1f('0x36')](_0x711c14[_0xab1f('0x2d')][_0xab1f('0x36')]);_0x11c4d6[_0xab1f('0x37')]=qs[_0xab1f('0x2b')](_['pick'](_0x711c14[_0xab1f('0x2d')],_0x520747[_0xab1f('0x2b')]));if(_0x711c14[_0xab1f('0x2d')]['filter']){_0x11c4d6[_0xab1f('0x37')]=_[_0xab1f('0x38')](_0x11c4d6['where'],{'$or':_[_0xab1f('0x39')](_0x3e15f3,function(_0x1595be){if(_0x1595be[_0xab1f('0x3a')][_0xab1f('0x3b')]!==_0xab1f('0x3c')){var _0x3c9519={};_0x3c9519[_0x1595be[_0xab1f('0x3d')]]={'$like':'%'+_0x711c14['query']['filter']+'%'};return _0x3c9519;}})});}_0x11c4d6=_[_0xab1f('0x38')]({},_0x11c4d6,_0x711c14[_0xab1f('0x3e')]);var _0x3120b2={'where':_0x11c4d6[_0xab1f('0x37')]};return db[_0xab1f('0x28')][_0xab1f('0x1a')](_0x3120b2)[_0xab1f('0x21')](function(_0xfa9046){_0x3248be['count']=_0xfa9046;if(_0x711c14['query'][_0xab1f('0x3f')]){_0x11c4d6[_0xab1f('0x40')]=[{'all':!![]}];}return db['Interval'][_0xab1f('0x41')](_0x11c4d6);})['then'](function(_0x13d418){_0x3248be[_0xab1f('0x42')]=_0x13d418;return _0x3248be;})[_0xab1f('0x21')](respondWithFilteredResult(_0x48000e,_0x11c4d6))[_0xab1f('0x43')](handleError(_0x48000e,null));};exports[_0xab1f('0x44')]=function(_0x41251f,_0x182c87){var _0x3e1763={'raw':!![],'where':{'id':_0x41251f[_0xab1f('0x45')]['id']}},_0x3849c6={};_0x3849c6[_0xab1f('0x2a')]=_[_0xab1f('0x46')](db['Interval']['rawAttributes']);_0x3849c6[_0xab1f('0x2d')]=_[_0xab1f('0x46')](_0x41251f['query']);_0x3849c6['filters']=_[_0xab1f('0x2c')](_0x3849c6[_0xab1f('0x2a')],_0x3849c6[_0xab1f('0x2d')]);_0x3e1763[_0xab1f('0x2e')]=_[_0xab1f('0x2c')](_0x3849c6[_0xab1f('0x2a')],qs[_0xab1f('0x2f')](_0x41251f[_0xab1f('0x2d')][_0xab1f('0x2f')]));_0x3e1763['attributes']=_0x3e1763['attributes'][_0xab1f('0x30')]?_0x3e1763[_0xab1f('0x2e')]:_0x3849c6[_0xab1f('0x2a')];if(_0x41251f['query'][_0xab1f('0x3f')]){_0x3e1763[_0xab1f('0x40')]=[{'all':!![]}];}_0x3e1763=_['merge']({},_0x3e1763,_0x41251f[_0xab1f('0x3e')]);return db[_0xab1f('0x28')]['find'](_0x3e1763)[_0xab1f('0x21')](handleEntityNotFound(_0x182c87,null))['then'](respondWithResult(_0x182c87,null))[_0xab1f('0x43')](handleError(_0x182c87,null));};exports['create']=function(_0x19079e,_0x942dd5){return db[_0xab1f('0x28')][_0xab1f('0x47')](_0x19079e[_0xab1f('0x48')],{})['then'](function(_0x451c8f){var _0x560bb4=_0x19079e[_0xab1f('0x49')][_0xab1f('0x22')]({'plain':!![]});if(!_0x560bb4)throw new Error(_0xab1f('0x4a'));if(_0x560bb4[_0xab1f('0x4b')]===_0xab1f('0x49')){var _0x3dcd02=_0x451c8f[_0xab1f('0x22')]({'plain':!![]});var _0x250793=_0xab1f('0x23');return db[_0xab1f('0x4c')][_0xab1f('0x4d')]({'where':{'name':_0x250793,'userProfileId':_0x560bb4['userProfileId']},'raw':!![]})['then'](function(_0xa0692e){if(_0xa0692e&&_0xa0692e['autoAssociation']===0x0){return db[_0xab1f('0x24')]['create']({'name':_0x3dcd02[_0xab1f('0x27')],'resourceId':_0x3dcd02['id'],'type':_0xa0692e[_0xab1f('0x27')],'sectionId':_0xa0692e['id']},{})['then'](function(){return _0x451c8f;});}else{return _0x451c8f;}})['catch'](function(_0x5c67f3){logger[_0xab1f('0x25')](_0xab1f('0x4e'),_0x5c67f3);throw _0x5c67f3;});}return _0x451c8f;})[_0xab1f('0x21')](respondWithResult(_0x942dd5,0xc9))[_0xab1f('0x43')](handleError(_0x942dd5,null));};exports[_0xab1f('0x1f')]=function(_0x27d9f7,_0x7b7579){if(_0x27d9f7[_0xab1f('0x48')]['id']){delete _0x27d9f7[_0xab1f('0x48')]['id'];}return db[_0xab1f('0x28')][_0xab1f('0x4d')]({'where':{'id':_0x27d9f7[_0xab1f('0x45')]['id']}})['then'](handleEntityNotFound(_0x7b7579,null))[_0xab1f('0x21')](saveUpdates(_0x27d9f7[_0xab1f('0x48')],null))[_0xab1f('0x21')](respondWithResult(_0x7b7579,null))[_0xab1f('0x43')](handleError(_0x7b7579,null));};exports[_0xab1f('0x20')]=function(_0x2cc526,_0x17b84e){return db[_0xab1f('0x28')]['find']({'where':{'id':_0x2cc526[_0xab1f('0x45')]['id']}})[_0xab1f('0x21')](handleEntityNotFound(_0x17b84e,null))[_0xab1f('0x21')](removeEntity(_0x17b84e,null))[_0xab1f('0x43')](handleError(_0x17b84e,null));};exports['addInterval']=function(_0x5c592b,_0xc6cbcf,_0x392b1b){if(_0x5c592b[_0xab1f('0x48')]['id']){delete _0x5c592b[_0xab1f('0x48')]['id'];}return db[_0xab1f('0x28')]['find']({'where':{'id':_0x5c592b[_0xab1f('0x45')]['id']}})[_0xab1f('0x21')](handleEntityNotFound(_0xc6cbcf,null))[_0xab1f('0x21')](function(_0x1709ce){if(_0x1709ce){_0x5c592b[_0xab1f('0x48')][_0xab1f('0x4f')]=_0x1709ce['id'];return db['Interval'][_0xab1f('0x47')](_0x5c592b[_0xab1f('0x48')]);}})[_0xab1f('0x21')](respondWithResult(_0xc6cbcf,null))['catch'](handleError(_0xc6cbcf,null));};exports[_0xab1f('0x50')]=function(_0x3bde27,_0x3c015d,_0x2d19aa){var _0x491acf={};var _0x2c4328={};var _0x3a7afd;var _0xf1b367;return db[_0xab1f('0x28')][_0xab1f('0x51')]({'where':{'id':_0x3bde27[_0xab1f('0x45')]['id']}})[_0xab1f('0x21')](handleEntityNotFound(_0x3c015d,null))['then'](function(_0x36f49f){if(_0x36f49f){_0x3a7afd=_0x36f49f;_0x2c4328[_0xab1f('0x2a')]=_[_0xab1f('0x46')](db[_0xab1f('0x28')][_0xab1f('0x29')]);_0x2c4328['query']=_['keys'](_0x3bde27[_0xab1f('0x2d')]);_0x2c4328[_0xab1f('0x2b')]=_[_0xab1f('0x2c')](_0x2c4328[_0xab1f('0x2a')],_0x2c4328[_0xab1f('0x2d')]);_0x491acf[_0xab1f('0x2e')]=_[_0xab1f('0x2c')](_0x2c4328[_0xab1f('0x2a')],qs[_0xab1f('0x2f')](_0x3bde27[_0xab1f('0x2d')][_0xab1f('0x2f')]));_0x491acf[_0xab1f('0x2e')]=_0x491acf[_0xab1f('0x2e')][_0xab1f('0x30')]?_0x491acf[_0xab1f('0x2e')]:_0x2c4328[_0xab1f('0x2a')];_0x491acf[_0xab1f('0x35')]=qs[_0xab1f('0x36')](_0x3bde27[_0xab1f('0x2d')][_0xab1f('0x36')]);_0x491acf['where']=qs['filters'](_[_0xab1f('0x52')](_0x3bde27[_0xab1f('0x2d')],_0x2c4328[_0xab1f('0x2b')]));if(_0x3bde27[_0xab1f('0x2d')][_0xab1f('0x53')]){_0x491acf['where']=_[_0xab1f('0x38')](_0x491acf[_0xab1f('0x37')],{'$or':_[_0xab1f('0x39')](_0x491acf[_0xab1f('0x2e')],function(_0x49b5d3){var _0x680e40={};_0x680e40[_0x49b5d3]={'$like':'%'+_0x3bde27['query'][_0xab1f('0x53')]+'%'};return _0x680e40;})});}_0x491acf=_[_0xab1f('0x38')]({},_0x491acf,_0x3bde27[_0xab1f('0x3e')]);return _0x3a7afd[_0xab1f('0x50')](_0x491acf);}})[_0xab1f('0x21')](function(_0x1eb2c9){if(_0x1eb2c9){_0xf1b367=_0x1eb2c9['length'];if(!_0x3bde27[_0xab1f('0x2d')][_0xab1f('0x31')]('nolimit')){_0x491acf['limit']=qs[_0xab1f('0x33')](_0x3bde27[_0xab1f('0x2d')]['limit']);_0x491acf['offset']=qs[_0xab1f('0x34')](_0x3bde27[_0xab1f('0x2d')]['offset']);}return _0x3a7afd[_0xab1f('0x50')](_0x491acf);}})['then'](function(_0x24706e){if(_0x24706e){return _0x24706e?{'count':_0xf1b367,'rows':_0x24706e}:null;}})[_0xab1f('0x21')](respondWithResult(_0x3c015d,null))[_0xab1f('0x43')](handleError(_0x3c015d,null));};exports[_0xab1f('0x54')]=function(_0x7330b0,_0x4115b0,_0x229909){return db[_0xab1f('0x28')]['findOne']({'where':{'id':_0x7330b0[_0xab1f('0x45')]['id']}})['then'](handleEntityNotFound(_0x4115b0,null))['then'](function(_0x5f0863){if(_0x5f0863){return db[_0xab1f('0x55')][_0xab1f('0x56')](function(_0x2619f7){return db['Interval'][_0xab1f('0x20')]({'where':{'IntervalId':_0x7330b0[_0xab1f('0x45')]['id']},'transaction':_0x2619f7})[_0xab1f('0x21')](function(_0x95a4dd){var _0x494b04=_[_0xab1f('0x39')](_0x7330b0['body'],function(_0x5a9b39){delete _0x5a9b39['id'];_0x5a9b39[_0xab1f('0x4f')]=_0x7330b0[_0xab1f('0x45')]['id'];return _0x5a9b39;});return db['Interval'][_0xab1f('0x57')](_0x494b04,{'transaction':_0x2619f7});});})['then'](function(){return db[_0xab1f('0x28')][_0xab1f('0x41')]({'where':{'IntervalId':_0x7330b0[_0xab1f('0x45')]['id']}});});}})[_0xab1f('0x21')](respondWithResult(_0x4115b0,null))[_0xab1f('0x43')](handleError(_0x4115b0,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index f6195ab..70f90a0 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 _0x436a=['../../config/logger','moment','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util'];(function(_0x541764,_0xd49cae){var _0x41e52b=function(_0xede6ef){while(--_0xede6ef){_0x541764['push'](_0x541764['shift']());}};_0x41e52b(++_0xd49cae);}(_0x436a,0x1ea));var _0xa436=function(_0x4d6679,_0x3ea59a){_0x4d6679=_0x4d6679-0x0;var _0x50fc8b=_0x436a[_0x4d6679];return _0x50fc8b;};'use strict';var _=require(_0xa436('0x0'));var util=require(_0xa436('0x1'));var logger=require(_0xa436('0x2'))('api');var moment=require(_0xa436('0x3'));var BPromise=require(_0xa436('0x4'));var rp=require(_0xa436('0x5'));var attributes=require(_0xa436('0x6'));var extensions=require(_0xa436('0x7'));module[_0xa436('0x8')]=function(_0x17958d,_0x41eb6b){return _0x17958d[_0xa436('0x9')]('Interval',attributes,{'tableName':_0xa436('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fea38,_0x313500){extensions[_0xa436('0xb')](_0x17958d,_0x4fea38);},'afterBulkCreate':function(_0x1cc0d3,_0x36fcad,_0x5e9e6c){_0x5e9e6c();extensions[_0xa436('0xb')](_0x17958d,_0x1cc0d3[0x0]);},'afterUpdate':function(_0x58d452,_0x10ff7c){extensions['rewrite'](_0x17958d,_0x58d452);},'afterDestroy':function(_0x482e7d,_0x26ee5c){extensions[_0xa436('0xb')](_0x17958d,_0x482e7d);}}});}; \ No newline at end of file +var _0x2459=['api','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite'];(function(_0x59c238,_0x4a6394){var _0x32513b=function(_0x596ad9){while(--_0x596ad9){_0x59c238['push'](_0x59c238['shift']());}};_0x32513b(++_0x4a6394);}(_0x2459,0xbd));var _0x9245=function(_0x77a933,_0x1cdd24){_0x77a933=_0x77a933-0x0;var _0x9df572=_0x2459[_0x77a933];return _0x9df572;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9245('0x0'));var moment=require('moment');var BPromise=require(_0x9245('0x1'));var rp=require(_0x9245('0x2'));var attributes=require(_0x9245('0x3'));var extensions=require(_0x9245('0x4'));module[_0x9245('0x5')]=function(_0x3b1c1c,_0x1690a1){return _0x3b1c1c[_0x9245('0x6')](_0x9245('0x7'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41314c,_0xed9d33){extensions[_0x9245('0x8')](_0x3b1c1c,_0x41314c);},'afterBulkCreate':function(_0x53a726,_0x567094,_0x3b083f){_0x3b083f();extensions[_0x9245('0x8')](_0x3b1c1c,_0x53a726[0x0]);},'afterUpdate':function(_0x4fe32e,_0xe2ed03){extensions[_0x9245('0x8')](_0x3b1c1c,_0x4fe32e);},'afterDestroy':function(_0x457f4c,_0x4eea87){extensions[_0x9245('0x8')](_0x3b1c1c,_0x457f4c);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 801dd69..baa2286 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 _0x8ef6=['jayson/promise','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Interval','findAll','options','raw','limit','map','include','model','attributes','GetInterval','ShowInterval','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x418f03,_0x3412e8){var _0xca988b=function(_0x80e8f5){while(--_0x80e8f5){_0x418f03['push'](_0x418f03['shift']());}};_0xca988b(++_0x3412e8);}(_0x8ef6,0xf2));var _0x68ef=function(_0x47aca0,_0x37389f){_0x47aca0=_0x47aca0-0x0;var _0x3ab881=_0x8ef6[_0x47aca0];return _0x3ab881;};'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')]('Interval,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Interval,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['GetInterval']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'limit':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]||null:null,'include':_0x2633c1['options']?_0x2633c1['options']['include']?_[_0x68ef('0x1d')](_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1e')],function(_0x2e6e39){return{'model':db[_0x2e6e39[_0x68ef('0x1f')]],'as':_0x2e6e39['as'],'attributes':_0x2e6e39[_0x68ef('0x20')],'include':_0x2e6e39[_0x68ef('0x1e')]?_[_0x68ef('0x1d')](_0x2e6e39[_0x68ef('0x1e')],function(_0x13280b){return{'model':db[_0x13280b['model']],'as':_0x13280b['as'],'attributes':_0x13280b[_0x68ef('0x20')],'include':_0x13280b['include']?_['map'](_0x13280b['include'],function(_0x1a7ce1){return{'model':db[_0x1a7ce1[_0x68ef('0x1f')]],'as':_0x1a7ce1['as'],'attributes':_0x1a7ce1[_0x68ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x52e67e){logger['info'](_0x68ef('0x21'),_0x2633c1);logger[_0x68ef('0x10')](_0x68ef('0x21'),_0x2633c1,JSON[_0x68ef('0x12')](_0x52e67e));_0x4ade0d(_0x52e67e);})[_0x68ef('0x17')](function(_0x201884){logger[_0x68ef('0x13')](_0x68ef('0x21'),_0x201884['message'],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x201884[_0x68ef('0x15')]));});});};exports[_0x68ef('0x22')]=function(_0x4c25aa){var _0x370a8f=this;return new Promise(function(_0x523120,_0x133788){return db[_0x68ef('0x18')]['find']({'raw':_0x4c25aa['options']?_0x4c25aa[_0x68ef('0x1a')][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c25aa['options']?_0x4c25aa[_0x68ef('0x1a')][_0x68ef('0x23')]||null:null,'attributes':_0x4c25aa[_0x68ef('0x1a')]?_0x4c25aa[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x4c25aa[_0x68ef('0x1a')]?_0x4c25aa[_0x68ef('0x1a')]['include']?_[_0x68ef('0x1d')](_0x4c25aa['options'][_0x68ef('0x1e')],function(_0xab3c17){return{'model':db[_0xab3c17['model']],'as':_0xab3c17['as'],'attributes':_0xab3c17[_0x68ef('0x20')],'include':_0xab3c17['include']?_[_0x68ef('0x1d')](_0xab3c17['include'],function(_0x2fbb0d){return{'model':db[_0x2fbb0d[_0x68ef('0x1f')]],'as':_0x2fbb0d['as'],'attributes':_0x2fbb0d[_0x68ef('0x20')],'include':_0x2fbb0d['include']?_[_0x68ef('0x1d')](_0x2fbb0d['include'],function(_0x476938){return{'model':db[_0x476938['model']],'as':_0x476938['as'],'attributes':_0x476938[_0x68ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x102df9){logger[_0x68ef('0xd')](_0x68ef('0x22'),_0x4c25aa);logger[_0x68ef('0x10')]('ShowInterval',_0x4c25aa,JSON[_0x68ef('0x12')](_0x102df9));_0x523120(_0x102df9);})[_0x68ef('0x17')](function(_0x32074a){logger['error'](_0x68ef('0x22'),_0x32074a[_0x68ef('0x15')],_0x4c25aa);_0x133788(_0x370a8f[_0x68ef('0x13')](0x1f4,_0x32074a['message']));});});}; \ No newline at end of file +var _0x6c7b=['../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetInterval','Interval','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowInterval','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x558674,_0x29686a){var _0x26333e=function(_0x3ae221){while(--_0x3ae221){_0x558674['push'](_0x558674['shift']());}};_0x26333e(++_0x29686a);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x580bab,_0x319f08){_0x580bab=_0x580bab-0x0;var _0x53e7e7=_0x6c7b[_0x580bab];return _0x53e7e7;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6c7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6c7('0x2'))['db'];var utils=require(_0xb6c7('0x3'));var logger=require(_0xb6c7('0x4'))('rpc');var config=require(_0xb6c7('0x5'));var jayson=require(_0xb6c7('0x6'));var client=jayson[_0xb6c7('0x7')][_0xb6c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb889c3,_0x5dd47a,_0x12e97e){return new BPromise(function(_0x41a5a5,_0xe2ce08){return client[_0xb6c7('0x9')](_0xb889c3,_0x12e97e)[_0xb6c7('0xa')](function(_0x34dbbd){logger[_0xb6c7('0xb')](_0xb6c7('0xc'),_0x5dd47a,'request\x20sent');logger['debug'](_0xb6c7('0xd'),_0x5dd47a,_0xb6c7('0xe'),JSON[_0xb6c7('0xf')](_0x34dbbd));if(_0x34dbbd[_0xb6c7('0x10')]){if(_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x11')]===0x1f4){logger[_0xb6c7('0x10')]('Interval,\x20%s,\x20%s',_0x5dd47a,_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x12')]);return _0xe2ce08(_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x12')]);}logger[_0xb6c7('0x10')](_0xb6c7('0xc'),_0x5dd47a,_0x34dbbd[_0xb6c7('0x10')]['message']);return _0x41a5a5(_0x34dbbd[_0xb6c7('0x10')]['message']);}else{logger['info']('Interval,\x20%s,\x20%s',_0x5dd47a,_0xb6c7('0xe'));_0x41a5a5(_0x34dbbd['result'][_0xb6c7('0x12')]);}})[_0xb6c7('0x13')](function(_0x23971b){logger[_0xb6c7('0x10')](_0xb6c7('0xc'),_0x5dd47a,_0x23971b);_0xe2ce08(_0x23971b);});});}exports[_0xb6c7('0x14')]=function(_0x2c819d){var _0x1317f5=this;return new Promise(function(_0x1a591f,_0xd0434e){return db[_0xb6c7('0x15')][_0xb6c7('0x16')]({'raw':_0x2c819d[_0xb6c7('0x17')]?_0x2c819d['options'][_0xb6c7('0x18')]===undefined?!![]:![]:!![],'where':_0x2c819d[_0xb6c7('0x17')]?_0x2c819d['options'][_0xb6c7('0x19')]||null:null,'attributes':_0x2c819d['options']?_0x2c819d[_0xb6c7('0x17')]['attributes']||null:null,'limit':_0x2c819d[_0xb6c7('0x17')]?_0x2c819d['options'][_0xb6c7('0x1a')]||null:null,'include':_0x2c819d[_0xb6c7('0x17')]?_0x2c819d['options'][_0xb6c7('0x1b')]?_[_0xb6c7('0x1c')](_0x2c819d[_0xb6c7('0x17')][_0xb6c7('0x1b')],function(_0xd33675){return{'model':db[_0xd33675[_0xb6c7('0x1d')]],'as':_0xd33675['as'],'attributes':_0xd33675['attributes'],'include':_0xd33675[_0xb6c7('0x1b')]?_[_0xb6c7('0x1c')](_0xd33675[_0xb6c7('0x1b')],function(_0x418920){return{'model':db[_0x418920['model']],'as':_0x418920['as'],'attributes':_0x418920[_0xb6c7('0x1e')],'include':_0x418920[_0xb6c7('0x1b')]?_['map'](_0x418920[_0xb6c7('0x1b')],function(_0x164801){return{'model':db[_0x164801[_0xb6c7('0x1d')]],'as':_0x164801['as'],'attributes':_0x164801[_0xb6c7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30eeb4){logger['info'](_0xb6c7('0x14'),_0x2c819d);logger[_0xb6c7('0x1f')](_0xb6c7('0x14'),_0x2c819d,JSON['stringify'](_0x30eeb4));_0x1a591f(_0x30eeb4);})['catch'](function(_0x4f19da){logger[_0xb6c7('0x10')](_0xb6c7('0x14'),_0x4f19da[_0xb6c7('0x12')],_0x2c819d);_0xd0434e(_0x1317f5[_0xb6c7('0x10')](0x1f4,_0x4f19da[_0xb6c7('0x12')]));});});};exports[_0xb6c7('0x20')]=function(_0x14f878){var _0x476d16=this;return new Promise(function(_0x1f82bd,_0x357507){return db['Interval'][_0xb6c7('0x21')]({'raw':_0x14f878['options']?_0x14f878[_0xb6c7('0x17')][_0xb6c7('0x18')]===undefined?!![]:![]:!![],'where':_0x14f878[_0xb6c7('0x17')]?_0x14f878[_0xb6c7('0x17')][_0xb6c7('0x19')]||null:null,'attributes':_0x14f878['options']?_0x14f878['options']['attributes']||null:null,'include':_0x14f878[_0xb6c7('0x17')]?_0x14f878[_0xb6c7('0x17')]['include']?_[_0xb6c7('0x1c')](_0x14f878[_0xb6c7('0x17')]['include'],function(_0x265a01){return{'model':db[_0x265a01[_0xb6c7('0x1d')]],'as':_0x265a01['as'],'attributes':_0x265a01[_0xb6c7('0x1e')],'include':_0x265a01[_0xb6c7('0x1b')]?_[_0xb6c7('0x1c')](_0x265a01[_0xb6c7('0x1b')],function(_0x51b62c){return{'model':db[_0x51b62c[_0xb6c7('0x1d')]],'as':_0x51b62c['as'],'attributes':_0x51b62c[_0xb6c7('0x1e')],'include':_0x51b62c[_0xb6c7('0x1b')]?_[_0xb6c7('0x1c')](_0x51b62c[_0xb6c7('0x1b')],function(_0x158bf7){return{'model':db[_0x158bf7[_0xb6c7('0x1d')]],'as':_0x158bf7['as'],'attributes':_0x158bf7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bae95){logger[_0xb6c7('0xb')](_0xb6c7('0x20'),_0x14f878);logger[_0xb6c7('0x1f')](_0xb6c7('0x20'),_0x14f878,JSON[_0xb6c7('0xf')](_0x3bae95));_0x1f82bd(_0x3bae95);})[_0xb6c7('0x13')](function(_0x157b86){logger[_0xb6c7('0x10')](_0xb6c7('0x20'),_0x157b86['message'],_0x14f878);_0x357507(_0x476d16[_0xb6c7('0x10')](0x1f4,_0x157b86['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2481b83..7a6265b 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x14f7fe,_0x5132c4){_0x14f7fe=_0x14f7fe-0x0;var _0x3d8309=_0x0b0e[_0x14f7fe];return _0x3d8309;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x1299f0,_0x53a52a){var _0x1650f5=function(_0x56104c){while(--_0x56104c){_0x1299f0['push'](_0x1299f0['shift']());}};_0x1650f5(++_0x53a52a);}(_0xdb28,0x106));var _0x8db2=function(_0x56cd50,_0x321592){_0x56cd50=_0x56cd50-0x0;var _0x420306=_0xdb28[_0x56cd50];return _0x420306;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 666476d..a6a560a 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 _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x95a82a,_0x130ed2){var _0x46ab08=function(_0x82088d){while(--_0x82088d){_0x95a82a['push'](_0x95a82a['shift']());}};_0x46ab08(++_0x130ed2);}(_0xe706,0xa3));var _0x6e70=function(_0x447725,_0x49753b){_0x447725=_0x447725-0x0;var _0x399167=_0xe706[_0x447725];return _0x399167;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);}; \ No newline at end of file +var _0xcb91=['summary','\x20from\x20','description','issuetype','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','stringify','setEncoding','utf8','data','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','api','support','3eAmWpBVP0','MOTGUI'];(function(_0x23e4cf,_0x12704d){var _0x2bd35a=function(_0xaa827a){while(--_0xaa827a){_0x23e4cf['push'](_0x23e4cf['shift']());}};_0x2bd35a(++_0x12704d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xcb91[_0x3c8e9a];return _0x2d4c57;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var USERNAME=_0x1cb9('0x2');var PASSWORD=_0x1cb9('0x3');function openIssue(_0x4c37e8,_0x8c392f){var _0x2c17b8={'fields':{'project':{'key':_0x4c37e8['key']||_0x1cb9('0x4')},'summary':(_0x4c37e8[_0x1cb9('0x5')]||'Report')+_0x1cb9('0x6')+_0x4c37e8['ip'],'description':_0x4c37e8[_0x1cb9('0x7')]||JSON['stringify'](_0x4c37e8),'issuetype':{'name':_0x4c37e8[_0x1cb9('0x8')]||_0x1cb9('0x9')}}};_0x2c17b8['fields'][_0x1cb9('0xa')]=_0x4c37e8['email'];_0x2c17b8['fields'][_0x1cb9('0xb')]=_0x4c37e8[_0x1cb9('0xc')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0xe')]=_0x4c37e8[_0x1cb9('0xf')];_0x2c17b8['fields'][_0x1cb9('0x10')]=_0x4c37e8[_0x1cb9('0x11')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0x12')]=_0x4c37e8[_0x1cb9('0x13')];_0x2c17b8['fields']['customfield_10102']=_0x4c37e8['ip'];var _0x59dec3={'host':_0x1cb9('0x14'),'port':0x1bb,'path':_0x1cb9('0x15'),'method':_0x1cb9('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x1cb9('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1cb9('0x18')](_0x1cb9('0x19'))}};var _0x1b3cd7=JSON[_0x1cb9('0x1a')](_0x2c17b8);var _0x3e2d11=https['request'](_0x59dec3,function(_0x5572cb){_0x5572cb[_0x1cb9('0x1b')](_0x1cb9('0x1c'));var _0x3904b7='';_0x5572cb['on'](_0x1cb9('0x1d'),function(_0x3e21e0){_0x3904b7+=_0x3e21e0;});_0x5572cb['on'](_0x1cb9('0x1e'),function(){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](_0x5572cb['statusCode'])['json'](JSON[_0x1cb9('0x20')](_0x3904b7));}});});_0x3e2d11['on'](_0x1cb9('0x21'),function(_0x2b2669){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](0x1f4)[_0x1cb9('0x22')]({'errors':[{'message':_0x1cb9('0x23'),'type':_0x1cb9('0x24')}]});}});_0x3e2d11['write'](_0x1b3cd7);_0x3e2d11['end']();}exports[_0x1cb9('0x25')]=openIssue;exports['send']=function(_0x4750b1,_0x2265ea){_0x4750b1['body']['ip']=_0x4750b1['headers'][_0x1cb9('0x26')]||_0x4750b1[_0x1cb9('0x27')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x29')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x27')]['socket']['remoteAddress'];return openIssue(_0x4750b1[_0x1cb9('0x2a')],_0x2265ea);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 96568b2..0ff4e66 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 _0xb925=['index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x5283ed,_0x4fd0a1){var _0x532df5=function(_0x498160){while(--_0x498160){_0x5283ed['push'](_0x5283ed['shift']());}};_0x532df5(++_0x4fd0a1);}(_0xb925,0xbe));var _0x5b92=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xb925[_0x296754];return _0x1d9f1d;};'use strict';var multer=require(_0x5b92('0x0'));var util=require('util');var path=require(_0x5b92('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b92('0x2'));var router=express[_0x5b92('0x3')]();var auth=require(_0x5b92('0x4'));var interaction=require(_0x5b92('0x5'));var config=require(_0x5b92('0x6'));var controller=require(_0x5b92('0x7'));router[_0x5b92('0x8')]('/',auth[_0x5b92('0x9')](),controller[_0x5b92('0xa')]);router[_0x5b92('0x8')](_0x5b92('0xb'),auth[_0x5b92('0x9')](),controller[_0x5b92('0xc')]);router[_0x5b92('0x8')](_0x5b92('0xd'),auth[_0x5b92('0x9')](),controller[_0x5b92('0xe')]);router[_0x5b92('0xf')]('/',auth[_0x5b92('0x9')](),controller['create']);router[_0x5b92('0x10')]('/:id',auth[_0x5b92('0x9')](),controller[_0x5b92('0x11')]);router['delete'](_0x5b92('0xd'),auth['isAuthenticated'](),controller[_0x5b92('0x12')]);module[_0x5b92('0x13')]=router; \ No newline at end of file +var _0x3ceb=['index','describe','/:id','show','post','create','put','update','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3ceb,0x14d));var _0xb3ce=function(_0x2ba22b,_0x1a278c){_0x2ba22b=_0x2ba22b-0x0;var _0x12f1d5=_0x3ceb[_0x2ba22b];return _0x12f1d5;};'use strict';var multer=require(_0xb3ce('0x0'));var util=require(_0xb3ce('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb3ce('0x2'));var router=express[_0xb3ce('0x3')]();var auth=require(_0xb3ce('0x4'));var interaction=require(_0xb3ce('0x5'));var config=require('../../config/environment');var controller=require(_0xb3ce('0x6'));router[_0xb3ce('0x7')]('/',auth[_0xb3ce('0x8')](),controller[_0xb3ce('0x9')]);router[_0xb3ce('0x7')]('/describe',auth[_0xb3ce('0x8')](),controller[_0xb3ce('0xa')]);router['get'](_0xb3ce('0xb'),auth[_0xb3ce('0x8')](),controller[_0xb3ce('0xc')]);router[_0xb3ce('0xd')]('/',auth['isAuthenticated'](),controller[_0xb3ce('0xe')]);router[_0xb3ce('0xf')]('/:id',auth[_0xb3ce('0x8')](),controller[_0xb3ce('0x10')]);router['delete'](_0xb3ce('0xb'),auth['isAuthenticated'](),controller[_0xb3ce('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 4733fc6..22298bd 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 _0x9780=['STRING','TEXT','long'];(function(_0x522e78,_0x5bc17e){var _0x1d3a65=function(_0x4035b9){while(--_0x4035b9){_0x522e78['push'](_0x522e78['shift']());}};_0x1d3a65(++_0x5bc17e);}(_0x9780,0x1d4));var _0x0978=function(_0x19be15,_0x5271d3){_0x19be15=_0x19be15-0x0;var _0x28b46d=_0x9780[_0x19be15];return _0x28b46d;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x0978('0x0')]},'answer':{'type':Sequelize[_0x0978('0x1')](_0x0978('0x2'))},'membername':{'type':Sequelize[_0x0978('0x0')]},'projectname':{'type':Sequelize[_0x0978('0x0')]},'queue':{'type':Sequelize[_0x0978('0x0')]},'uniqueid':{'type':Sequelize[_0x0978('0x0')]},'calleridname':{'type':Sequelize[_0x0978('0x0')]},'calleridnum':{'type':Sequelize[_0x0978('0x0')]},'questionId':{'type':Sequelize[_0x0978('0x0')]}}; \ No newline at end of file +var _0xc041=['TEXT','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc041,0x1ea));var _0x1c04=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0xc041[_0x4fdc46];return _0x2c178a;};'use strict';var Sequelize=require(_0x1c04('0x0'));module[_0x1c04('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x1c04('0x2')]('long')},'membername':{'type':Sequelize[_0x1c04('0x3')]},'projectname':{'type':Sequelize[_0x1c04('0x3')]},'queue':{'type':Sequelize[_0x1c04('0x3')]},'uniqueid':{'type':Sequelize[_0x1c04('0x3')]},'calleridname':{'type':Sequelize[_0x1c04('0x3')]},'calleridnum':{'type':Sequelize[_0x1c04('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 210e1b4..fb46d84 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x176259,_0x30e46f){var _0x48dc40=function(_0x3aa524){while(--_0x3aa524){_0x176259['push'](_0x176259['shift']());}};_0x48dc40(++_0x30e46f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 authService=require(_0x7995('0x12'));var hardwareService=require(_0x7995('0x13'));var Redis=require(_0x7995('0x14'));var qs=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['JscriptyAnswerReport']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['JscriptyAnswerReport'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 authService=require(_0x7995('0x12'));var hardwareService=require(_0x7995('0x13'));var Redis=require(_0x7995('0x14'));var qs=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['JscriptyAnswerReport']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['JscriptyAnswerReport'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 01ed911..e8f7d6f 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 _0x3276=['define','JscriptyAnswerReport','lodash','util','../../config/logger','api','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x3276,0x1d8));var _0x6327=function(_0x199670,_0x29236a){_0x199670=_0x199670-0x0;var _0x1c385e=_0x3276[_0x199670];return _0x1c385e;};'use strict';var _=require(_0x6327('0x0'));var util=require(_0x6327('0x1'));var logger=require(_0x6327('0x2'))(_0x6327('0x3'));var moment=require('moment');var BPromise=require(_0x6327('0x4'));var rp=require(_0x6327('0x5'));var attributes=require(_0x6327('0x6'));module[_0x6327('0x7')]=function(_0x4d2b5e,_0xc4c760){return _0x4d2b5e[_0x6327('0x8')](_0x6327('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb12e=['moment','bluebird','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','util','api'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0xb12e,0x66));var _0xeb12=function(_0x357773,_0xd8906d){_0x357773=_0x357773-0x0;var _0x238e9b=_0xb12e[_0x357773];return _0x238e9b;};'use strict';var _=require('lodash');var util=require(_0xeb12('0x0'));var logger=require('../../config/logger')(_0xeb12('0x1'));var moment=require(_0xeb12('0x2'));var BPromise=require(_0xeb12('0x3'));var rp=require('request-promise');var attributes=require(_0xeb12('0x4'));module[_0xeb12('0x5')]=function(_0x514a8e,_0x18a76a){return _0x514a8e[_0xeb12('0x6')](_0xeb12('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 1e50431..342ff45 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 _0xd1e7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd1e7,0x1b3));var _0x7d1e=function(_0x93c3c0,_0x8f9b99){_0x93c3c0=_0x93c3c0-0x0;var _0x12ed9a=_0xd1e7[_0x93c3c0];return _0x12ed9a;};'use strict';var _=require(_0x7d1e('0x0'));var util=require('util');var moment=require(_0x7d1e('0x1'));var BPromise=require(_0x7d1e('0x2'));var rs=require(_0x7d1e('0x3'));var fs=require('fs');var Redis=require(_0x7d1e('0x4'));var db=require(_0x7d1e('0x5'))['db'];var utils=require(_0x7d1e('0x6'));var logger=require(_0x7d1e('0x7'))('rpc');var config=require(_0x7d1e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d1e('0x9')][_0x7d1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x192b47,_0x188a19,_0x38e7e5){return new BPromise(function(_0x5b9d1a,_0x4b2696){return client[_0x7d1e('0xb')](_0x192b47,_0x38e7e5)['then'](function(_0xd7148b){logger[_0x7d1e('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x188a19,'request\x20sent');logger[_0x7d1e('0xd')](_0x7d1e('0xe'),_0x188a19,_0x7d1e('0xf'),JSON[_0x7d1e('0x10')](_0xd7148b));if(_0xd7148b[_0x7d1e('0x11')]){if(_0xd7148b[_0x7d1e('0x11')]['code']===0x1f4){logger[_0x7d1e('0x11')](_0x7d1e('0x12'),_0x188a19,_0xd7148b[_0x7d1e('0x11')][_0x7d1e('0x13')]);return _0x4b2696(_0xd7148b['error'][_0x7d1e('0x13')]);}logger[_0x7d1e('0x11')](_0x7d1e('0x12'),_0x188a19,_0xd7148b[_0x7d1e('0x11')]['message']);return _0x5b9d1a(_0xd7148b[_0x7d1e('0x11')]['message']);}else{logger['info'](_0x7d1e('0x12'),_0x188a19,_0x7d1e('0xf'));_0x5b9d1a(_0xd7148b[_0x7d1e('0x14')]['message']);}})[_0x7d1e('0x15')](function(_0x55b3fc){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x188a19,_0x55b3fc);_0x4b2696(_0x55b3fc);});});} \ No newline at end of file +var _0x698c=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xd27261,_0x472afd){var _0x16a10e=function(_0x93fa64){while(--_0x93fa64){_0xd27261['push'](_0xd27261['shift']());}};_0x16a10e(++_0x472afd);}(_0x698c,0x15b));var _0xc698=function(_0x276f2a,_0x404f87){_0x276f2a=_0x276f2a-0x0;var _0x5d4841=_0x698c[_0x276f2a];return _0x5d4841;};'use strict';var _=require(_0xc698('0x0'));var util=require(_0xc698('0x1'));var moment=require(_0xc698('0x2'));var BPromise=require(_0xc698('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc698('0x4'))['db'];var utils=require(_0xc698('0x5'));var logger=require('../../config/logger')(_0xc698('0x6'));var config=require(_0xc698('0x7'));var jayson=require(_0xc698('0x8'));var client=jayson[_0xc698('0x9')][_0xc698('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf3b6,_0x21dcb2,_0x592b7b){return new BPromise(function(_0x143d4d,_0x35fe10){return client[_0xc698('0xb')](_0x2bf3b6,_0x592b7b)[_0xc698('0xc')](function(_0x6370c7){logger[_0xc698('0xd')](_0xc698('0xe'),_0x21dcb2,_0xc698('0xf'));logger[_0xc698('0x10')](_0xc698('0x11'),_0x21dcb2,_0xc698('0xf'),JSON[_0xc698('0x12')](_0x6370c7));if(_0x6370c7['error']){if(_0x6370c7['error']['code']===0x1f4){logger[_0xc698('0x13')](_0xc698('0xe'),_0x21dcb2,_0x6370c7[_0xc698('0x13')][_0xc698('0x14')]);return _0x35fe10(_0x6370c7[_0xc698('0x13')][_0xc698('0x14')]);}logger[_0xc698('0x13')](_0xc698('0xe'),_0x21dcb2,_0x6370c7[_0xc698('0x13')]['message']);return _0x143d4d(_0x6370c7[_0xc698('0x13')][_0xc698('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x21dcb2,'request\x20sent');_0x143d4d(_0x6370c7[_0xc698('0x15')]['message']);}})[_0xc698('0x16')](function(_0x493b88){logger[_0xc698('0x13')](_0xc698('0xe'),_0x21dcb2,_0x493b88);_0x35fe10(_0x493b88);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index cbb5ce3..4810349 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 _0x5d6f=['/:id/sessions','getSessions','getAnswers','/:id/summary','30s','create','post','/:id/clone','clone','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x36176e,_0x3719b7){var _0xbe79bc=function(_0x2eea8f){while(--_0x2eea8f){_0x36176e['push'](_0x36176e['shift']());}};_0xbe79bc(++_0x3719b7);}(_0x5d6f,0x1d8));var _0xf5d6=function(_0x2ca249,_0x5cb677){_0x2ca249=_0x2ca249-0x0;var _0x526cda=_0x5d6f[_0x2ca249];return _0x526cda;};'use strict';var multer=require(_0xf5d6('0x0'));var util=require(_0xf5d6('0x1'));var path=require(_0xf5d6('0x2'));var timeout=require(_0xf5d6('0x3'));var express=require(_0xf5d6('0x4'));var router=express[_0xf5d6('0x5')]();var auth=require(_0xf5d6('0x6'));var interaction=require(_0xf5d6('0x7'));var config=require(_0xf5d6('0x8'));var controller=require(_0xf5d6('0x9'));router[_0xf5d6('0xa')]('/',auth[_0xf5d6('0xb')](),controller[_0xf5d6('0xc')]);router[_0xf5d6('0xa')](_0xf5d6('0xd'),auth[_0xf5d6('0xb')](),controller['show']);router[_0xf5d6('0xa')](_0xf5d6('0xe'),auth['isAuthenticated'](),controller[_0xf5d6('0xf')]);router[_0xf5d6('0xa')]('/:id/answers',auth['isAuthenticated'](),controller[_0xf5d6('0x10')]);router[_0xf5d6('0xa')](_0xf5d6('0x11'),auth[_0xf5d6('0xb')](),timeout(_0xf5d6('0x12')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller[_0xf5d6('0x13')]);router[_0xf5d6('0x14')](_0xf5d6('0x15'),auth[_0xf5d6('0xb')](),controller[_0xf5d6('0x16')]);router[_0xf5d6('0x17')](_0xf5d6('0xd'),auth['isAuthenticated'](),controller[_0xf5d6('0x18')]);router['delete'](_0xf5d6('0xd'),auth[_0xf5d6('0xb')](),controller[_0xf5d6('0x19')]);module[_0xf5d6('0x1a')]=router; \ No newline at end of file +var _0xcc04=['/:id','show','get','getSessions','30s','getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index'];(function(_0x234fd8,_0x1def03){var _0x52bb3b=function(_0x1c81d6){while(--_0x1c81d6){_0x234fd8['push'](_0x234fd8['shift']());}};_0x52bb3b(++_0x1def03);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x13b5fa,_0x567299){_0x13b5fa=_0x13b5fa-0x0;var _0x1ac737=_0xcc04[_0x13b5fa];return _0x1ac737;};'use strict';var multer=require(_0x4cc0('0x0'));var util=require(_0x4cc0('0x1'));var path=require(_0x4cc0('0x2'));var timeout=require(_0x4cc0('0x3'));var express=require(_0x4cc0('0x4'));var router=express[_0x4cc0('0x5')]();var auth=require(_0x4cc0('0x6'));var interaction=require(_0x4cc0('0x7'));var config=require(_0x4cc0('0x8'));var controller=require(_0x4cc0('0x9'));router['get']('/',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xb')]);router['get'](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xd')]);router[_0x4cc0('0xe')]('/:id/sessions',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xf')]);router[_0x4cc0('0xe')]('/:id/answers',auth[_0x4cc0('0xa')](),controller['getAnswers']);router[_0x4cc0('0xe')]('/:id/summary',auth[_0x4cc0('0xa')](),timeout(_0x4cc0('0x10')),controller[_0x4cc0('0x11')]);router[_0x4cc0('0x12')]('/',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x13')]);router[_0x4cc0('0x12')](_0x4cc0('0x14'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x15')]);router[_0x4cc0('0x16')](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller['update']);router[_0x4cc0('0x17')](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x18')]);module[_0x4cc0('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index e67c68d..4fba0e4 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 _0x619e=['sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x619e,0x77));var _0xe619=function(_0x23bf7f,_0x578f6c){_0x23bf7f=_0x23bf7f-0x0;var _0x64b00e=_0x619e[_0x23bf7f];return _0x64b00e;};'use strict';var Sequelize=require(_0xe619('0x0'));var _=require(_0xe619('0x1'));var util=require(_0xe619('0x2'));module[_0xe619('0x3')]={'name':{'type':Sequelize[_0xe619('0x4')],'unique':_0xe619('0x5')},'description':{'type':Sequelize[_0xe619('0x4')]},'formData':{'type':Sequelize[_0xe619('0x6')]('long'),'set':function(_0x4968d4){if(_[_0xe619('0x7')](_0x4968d4)){this['setDataValue'](_0xe619('0x8'),JSON[_0xe619('0x9')](_0x4968d4));}else if(_[_0xe619('0xa')](_0x4968d4)){this['setDataValue'](_0xe619('0x8'),_0x4968d4);}else{this[_0xe619('0xb')](_0xe619('0x8'),util[_0xe619('0xc')](_0xe619('0xd'),this[_0xe619('0xe')](_0xe619('0x5'))||'',this['getDataValue'](_0xe619('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe619('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9669=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','long','isObjectLike','setDataValue','formData','isString','format'];(function(_0x53c329,_0x24dee3){var _0x2861b2=function(_0x1a4d6d){while(--_0x1a4d6d){_0x53c329['push'](_0x53c329['shift']());}};_0x2861b2(++_0x24dee3);}(_0x9669,0xf4));var _0x9966=function(_0x162122,_0x27b1d1){_0x162122=_0x162122-0x0;var _0x2fc417=_0x9669[_0x162122];return _0x2fc417;};'use strict';var Sequelize=require(_0x9966('0x0'));var _=require(_0x9966('0x1'));var util=require(_0x9966('0x2'));module[_0x9966('0x3')]={'name':{'type':Sequelize[_0x9966('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x9966('0x5')),'set':function(_0x3af1e6){if(_[_0x9966('0x6')](_0x3af1e6)){this[_0x9966('0x7')](_0x9966('0x8'),JSON['stringify'](_0x3af1e6));}else if(_[_0x9966('0x9')](_0x3af1e6)){this['setDataValue']('formData',_0x3af1e6);}else{this[_0x9966('0x7')](_0x9966('0x8'),util[_0x9966('0xa')](_0x9966('0xb'),this['getDataValue'](_0x9966('0xc'))||'',this[_0x9966('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9966('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 c0ebad9..37f3dd3 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 _0x811a=['JscriptyAnswerReport','number','toString','indexOf','startTime','parse','JscriptyQuestionReport','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','getAnswers'];(function(_0x21b3ab,_0x240d0d){var _0x2b95a9=function(_0x2186fe){while(--_0x2186fe){_0x21b3ab['push'](_0x21b3ab['shift']());}};_0x2b95a9(++_0x240d0d);}(_0x811a,0x105));var _0xa811=function(_0x7d37bc,_0x27289b){_0x7d37bc=_0x7d37bc-0x0;var _0x1e6b2f=_0x811a[_0x7d37bc];return _0x1e6b2f;};'use strict';var pdf=require(_0xa811('0x0'));var emlformat=require(_0xa811('0x1'));var rimraf=require(_0xa811('0x2'));var zipdir=require(_0xa811('0x3'));var jsonpatch=require(_0xa811('0x4'));var rp=require('request-promise');var moment=require(_0xa811('0x5'));var BPromise=require(_0xa811('0x6'));var Mustache=require(_0xa811('0x7'));var util=require(_0xa811('0x8'));var path=require(_0xa811('0x9'));var sox=require(_0xa811('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa811('0xb'));var squel=require('squel');var crypto=require(_0xa811('0xc'));var jsforce=require(_0xa811('0xd'));var deskjs=require(_0xa811('0xe'));var toCsv=require(_0xa811('0xf'));var querystring=require(_0xa811('0x10'));var Papa=require(_0xa811('0x11'));var authService=require(_0xa811('0x12'));var hardwareService=require(_0xa811('0x13'));var Redis=require(_0xa811('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xa811('0x15'))('api');var utils=require(_0xa811('0x16'));var config=require(_0xa811('0x17'));var db=require(_0xa811('0x18'))['db'];function respondWithStatusCode(_0x486b4f,_0x23be69){_0x23be69=_0x23be69||0xcc;return function(_0x1e098f){if(_0x1e098f){return _0x486b4f[_0xa811('0x19')](_0x23be69);}return _0x486b4f[_0xa811('0x1a')](_0x23be69)[_0xa811('0x1b')]();};}function respondWithResult(_0x15e981,_0x4ef83c){_0x4ef83c=_0x4ef83c||0xc8;return function(_0x14a43a){if(_0x14a43a){return _0x15e981[_0xa811('0x1a')](_0x4ef83c)['json'](_0x14a43a);}};}function respondWithFilteredResult(_0x4b4d3b,_0x789ce8){return function(_0x2ee99e){if(_0x2ee99e){var _0x4084a6=_0x2ee99e['count'],_0xcb8015=_0x789ce8[_0xa811('0x1c')],_0x369658=_0x789ce8[_0xa811('0x1c')]+_0x789ce8[_0xa811('0x1d')],_0x50a662;if(_0x369658>=_0x4084a6){_0x369658=_0x4084a6;_0x50a662=0xc8;}else{_0x50a662=0xce;}_0x4b4d3b[_0xa811('0x1a')](_0x50a662);return _0x4b4d3b[_0xa811('0x1e')]('Content-Range',_0xcb8015+'-'+_0x369658+'/'+_0x4084a6)[_0xa811('0x1f')](_0x2ee99e);}return null;};}function patchUpdates(_0x34ba3b){return function(_0x348d18){try{jsonpatch[_0xa811('0x20')](_0x348d18,_0x34ba3b,!![]);}catch(_0x444cf8){return BPromise['reject'](_0x444cf8);}return _0x348d18[_0xa811('0x21')]();};}function saveUpdates(_0x1e91dd,_0xf025b7){return function(_0x3c0760){if(_0x3c0760){return _0x3c0760[_0xa811('0x22')](_0x1e91dd)[_0xa811('0x23')](function(_0xeb14d2){return _0xeb14d2;});}return null;};}function removeEntity(_0x31f65d,_0x160cf4){return function(_0x1d6906){if(_0x1d6906){return _0x1d6906[_0xa811('0x24')]()[_0xa811('0x23')](function(){var _0x287d3e=_0x1d6906[_0xa811('0x25')]({'plain':!![]});var _0x2eb9e3=_0xa811('0x26');return db[_0xa811('0x27')][_0xa811('0x24')]({'where':{'type':_0x2eb9e3,'resourceId':_0x287d3e['id']}})['then'](function(){return _0x1d6906;});})[_0xa811('0x23')](function(){_0x31f65d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6ccfe,_0x5302c8){return function(_0x24b3d2){if(!_0x24b3d2){_0xd6ccfe['sendStatus'](0x194);}return _0x24b3d2;};}function handleError(_0x1007ec,_0x2d722d){_0x2d722d=_0x2d722d||0x1f4;return function(_0x5ae928){logger[_0xa811('0x28')](_0x5ae928[_0xa811('0x29')]);if(_0x5ae928[_0xa811('0x2a')]){delete _0x5ae928[_0xa811('0x2a')];}_0x1007ec['status'](_0x2d722d)[_0xa811('0x2b')](_0x5ae928);};}exports[_0xa811('0x2c')]=function(_0x23d2a9,_0x1ecd4d){var _0xef5945={},_0x561973={},_0x14aed0={'count':0x0,'rows':[]};var _0x39acc8=db[_0xa811('0x2d')][_0xa811('0x2e')];_0x561973[_0xa811('0x2f')]=_[_0xa811('0x30')](_0x39acc8);_0x561973[_0xa811('0x31')]=_[_0xa811('0x30')](_0x23d2a9[_0xa811('0x31')]);_0x561973[_0xa811('0x32')]=_['intersection'](_0x561973[_0xa811('0x2f')],_0x561973['query']);_0xef5945[_0xa811('0x33')]=_[_0xa811('0x34')](_0x561973['model'],qs[_0xa811('0x35')](_0x23d2a9[_0xa811('0x31')][_0xa811('0x35')]));_0xef5945[_0xa811('0x33')]=_0xef5945[_0xa811('0x33')]['length']?_0xef5945[_0xa811('0x33')]:_0x561973[_0xa811('0x2f')];if(!_0x23d2a9[_0xa811('0x31')][_0xa811('0x36')](_0xa811('0x37'))){_0xef5945[_0xa811('0x1d')]=qs[_0xa811('0x1d')](_0x23d2a9[_0xa811('0x31')]['limit']);_0xef5945[_0xa811('0x1c')]=qs['offset'](_0x23d2a9[_0xa811('0x31')][_0xa811('0x1c')]);}_0xef5945[_0xa811('0x38')]=qs[_0xa811('0x39')](_0x23d2a9[_0xa811('0x31')][_0xa811('0x39')]);_0xef5945[_0xa811('0x3a')]=qs[_0xa811('0x32')](_['pick'](_0x23d2a9[_0xa811('0x31')],_0x561973[_0xa811('0x32')]));if(_0x23d2a9[_0xa811('0x31')][_0xa811('0x3b')]){_0xef5945[_0xa811('0x3a')]=_[_0xa811('0x3c')](_0xef5945[_0xa811('0x3a')],{'$or':_[_0xa811('0x3d')](_0x39acc8,function(_0x30ad85){if(_0x30ad85[_0xa811('0x3e')][_0xa811('0x3f')]!==_0xa811('0x40')){var _0x175cfa={};_0x175cfa[_0x30ad85[_0xa811('0x41')]]={'$like':'%'+_0x23d2a9[_0xa811('0x31')][_0xa811('0x3b')]+'%'};return _0x175cfa;}})});}_0xef5945=_['merge']({},_0xef5945,_0x23d2a9[_0xa811('0x42')]);var _0x1ecc06={'where':_0xef5945[_0xa811('0x3a')]};return db[_0xa811('0x2d')][_0xa811('0x43')](_0x1ecc06)[_0xa811('0x23')](function(_0x332adf){_0x14aed0[_0xa811('0x43')]=_0x332adf;if(_0x23d2a9[_0xa811('0x31')][_0xa811('0x44')]){_0xef5945[_0xa811('0x45')]=[{'all':!![]}];}return db[_0xa811('0x2d')]['findAll'](_0xef5945);})[_0xa811('0x23')](function(_0x1eef54){_0x14aed0[_0xa811('0x46')]=_0x1eef54;return _0x14aed0;})[_0xa811('0x23')](respondWithFilteredResult(_0x1ecd4d,_0xef5945))[_0xa811('0x47')](handleError(_0x1ecd4d,null));};exports[_0xa811('0x48')]=function(_0x41bdb9,_0x266d2c){var _0x56bd97={'raw':![],'where':{'id':_0x41bdb9[_0xa811('0x49')]['id']}},_0x2d7550={};_0x2d7550[_0xa811('0x2f')]=_[_0xa811('0x30')](db[_0xa811('0x2d')]['rawAttributes']);_0x2d7550['query']=_[_0xa811('0x30')](_0x41bdb9[_0xa811('0x31')]);_0x2d7550['filters']=_[_0xa811('0x34')](_0x2d7550[_0xa811('0x2f')],_0x2d7550[_0xa811('0x31')]);_0x56bd97[_0xa811('0x33')]=_['intersection'](_0x2d7550[_0xa811('0x2f')],qs[_0xa811('0x35')](_0x41bdb9[_0xa811('0x31')][_0xa811('0x35')]));_0x56bd97[_0xa811('0x33')]=_0x56bd97[_0xa811('0x33')][_0xa811('0x4a')]?_0x56bd97[_0xa811('0x33')]:_0x2d7550[_0xa811('0x2f')];if(_0x41bdb9[_0xa811('0x31')][_0xa811('0x44')]){_0x56bd97[_0xa811('0x45')]=[{'all':!![]}];}_0x56bd97=_[_0xa811('0x3c')]({},_0x56bd97,_0x41bdb9[_0xa811('0x42')]);return db[_0xa811('0x2d')][_0xa811('0x4b')](_0x56bd97)[_0xa811('0x23')](handleEntityNotFound(_0x266d2c,null))[_0xa811('0x23')](respondWithResult(_0x266d2c,null))[_0xa811('0x47')](handleError(_0x266d2c,null));};exports[_0xa811('0x4c')]=function(_0x3e70fc,_0x16e23c){return db['JscriptyProject']['create'](_0x3e70fc[_0xa811('0x4d')],{})[_0xa811('0x23')](function(_0x49a60a){var _0x152a25=_0x3e70fc[_0xa811('0x4e')][_0xa811('0x25')]({'plain':!![]});if(!_0x152a25)throw new Error(_0xa811('0x4f'));if(_0x152a25[_0xa811('0x50')]===_0xa811('0x4e')){var _0xdfcd94=_0x49a60a[_0xa811('0x25')]({'plain':!![]});var _0x10002b=_0xa811('0x26');return db[_0xa811('0x51')][_0xa811('0x4b')]({'where':{'name':_0x10002b,'userProfileId':_0x152a25[_0xa811('0x52')]},'raw':!![]})['then'](function(_0x37bca8){if(_0x37bca8&&_0x37bca8['autoAssociation']===0x0){return db[_0xa811('0x27')][_0xa811('0x4c')]({'name':_0xdfcd94[_0xa811('0x2a')],'resourceId':_0xdfcd94['id'],'type':_0x37bca8[_0xa811('0x2a')],'sectionId':_0x37bca8['id']},{})['then'](function(){return _0x49a60a;});}else{return _0x49a60a;}})[_0xa811('0x47')](function(_0x36f7fc){logger['error'](_0xa811('0x53'),_0x36f7fc);throw _0x36f7fc;});}return _0x49a60a;})[_0xa811('0x23')](respondWithResult(_0x16e23c,0xc9))['catch'](handleError(_0x16e23c,null));};exports[_0xa811('0x54')]=function(_0x238a4b,_0x5aaf04){var _0x1778bc={'raw':![],'where':{'id':_0x238a4b['params']['id']}},_0x2812b3={};_0x2812b3[_0xa811('0x2f')]=_[_0xa811('0x30')](db['JscriptyProject'][_0xa811('0x2e')]);_0x1778bc['attributes']=_[_0xa811('0x34')](_0x2812b3[_0xa811('0x2f')],qs[_0xa811('0x35')](_0x238a4b[_0xa811('0x31')][_0xa811('0x35')]));_0x1778bc[_0xa811('0x33')]=_0x1778bc[_0xa811('0x33')][_0xa811('0x4a')]?_0x1778bc['attributes']:_0x2812b3[_0xa811('0x2f')];if(_0x238a4b[_0xa811('0x31')][_0xa811('0x44')]){_0x1778bc[_0xa811('0x45')]=[{'all':!![]}];}_0x1778bc=_['merge']({},_0x1778bc,_0x238a4b[_0xa811('0x42')]);return db[_0xa811('0x2d')][_0xa811('0x4b')](_0x1778bc)[_0xa811('0x23')](handleEntityNotFound(_0x5aaf04,null))[_0xa811('0x23')](function(_0x24b0eb){if(_0x24b0eb){var _0x2c8cae=_0x24b0eb[_0xa811('0x25')]({'plain':!![]});_0x2c8cae=qs[_0xa811('0x55')](_0x2c8cae,['id',_0xa811('0x56'),_0xa811('0x57')]);_0x238a4b[_0xa811('0x4d')]=_[_0xa811('0x55')](_0x238a4b['body'],['id',_0xa811('0x56'),_0xa811('0x57')]);return db[_0xa811('0x2d')][_0xa811('0x4c')](_[_0xa811('0x3c')](_0x2c8cae,_0x238a4b['body']),{'include':_0x238a4b[_0xa811('0x31')][_0xa811('0x44')]?[{'all':!![]}]:undefined})[_0xa811('0x23')](function(_0x16ea8d){var _0x1d5f66=_0x238a4b[_0xa811('0x4e')][_0xa811('0x25')]({'plain':!![]});if(!_0x1d5f66)throw new Error(_0xa811('0x4f'));if(_0x1d5f66[_0xa811('0x50')]===_0xa811('0x4e')){var _0xe423d2=_0x16ea8d[_0xa811('0x25')]({'plain':!![]});var _0x9a9c5f=_0xa811('0x26');return db[_0xa811('0x51')][_0xa811('0x4b')]({'where':{'name':_0x9a9c5f,'userProfileId':_0x1d5f66['userProfileId']},'raw':!![]})[_0xa811('0x23')](function(_0x5c7852){if(_0x5c7852&&_0x5c7852[_0xa811('0x58')]===0x0){return db['UserProfileResource'][_0xa811('0x4c')]({'name':_0xe423d2[_0xa811('0x2a')],'resourceId':_0xe423d2['id'],'type':_0x5c7852[_0xa811('0x2a')],'sectionId':_0x5c7852['id']},{})[_0xa811('0x23')](function(){return _0x16ea8d;});}else{return _0x16ea8d;}})[_0xa811('0x47')](function(_0x1160cc){logger[_0xa811('0x28')](_0xa811('0x53'),_0x1160cc);throw _0x1160cc;});}return _0x16ea8d;});}})['then'](respondWithResult(_0x5aaf04,0xc9))[_0xa811('0x47')](handleError(_0x5aaf04,null));};exports['update']=function(_0x5d2676,_0x2ec25c){if(_0x5d2676['body']['id']){delete _0x5d2676[_0xa811('0x4d')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x5d2676[_0xa811('0x49')]['id']}})[_0xa811('0x23')](handleEntityNotFound(_0x2ec25c,null))[_0xa811('0x23')](saveUpdates(_0x5d2676[_0xa811('0x4d')],null))[_0xa811('0x23')](respondWithResult(_0x2ec25c,null))[_0xa811('0x47')](handleError(_0x2ec25c,null));};exports['destroy']=function(_0x10036c,_0x26f9bf){return db['JscriptyProject'][_0xa811('0x4b')]({'where':{'id':_0x10036c[_0xa811('0x49')]['id']}})['then'](handleEntityNotFound(_0x26f9bf,null))[_0xa811('0x23')](removeEntity(_0x26f9bf,null))['catch'](handleError(_0x26f9bf,null));};exports[_0xa811('0x59')]=function(_0x4ccbf5,_0x4c5a9b,_0x117bb5){var _0xe9d77b={'raw':!![],'where':{}};var _0x5ab450={};var _0x1d8858={'count':0x0,'rows':[]};return db[_0xa811('0x2d')][_0xa811('0x5a')]({'where':{'id':_0x4ccbf5[_0xa811('0x49')]['id']}})[_0xa811('0x23')](handleEntityNotFound(_0x4c5a9b,null))[_0xa811('0x23')](function(_0x18acbc){if(_0x18acbc){_0x5ab450[_0xa811('0x2f')]=_[_0xa811('0x30')](db[_0xa811('0x5b')][_0xa811('0x2e')]);_0x5ab450[_0xa811('0x31')]=_[_0xa811('0x30')](_0x4ccbf5[_0xa811('0x31')]);_0x5ab450['filters']=_[_0xa811('0x34')](_0x5ab450['model'],_0x5ab450[_0xa811('0x31')]);_0xe9d77b[_0xa811('0x33')]=_['intersection'](_0x5ab450['model'],qs[_0xa811('0x35')](_0x4ccbf5[_0xa811('0x31')][_0xa811('0x35')]));_0xe9d77b[_0xa811('0x33')]=_0xe9d77b[_0xa811('0x33')][_0xa811('0x4a')]?_0xe9d77b[_0xa811('0x33')]:_0x5ab450[_0xa811('0x2f')];if(!_0x4ccbf5[_0xa811('0x31')]['hasOwnProperty'](_0xa811('0x37'))){_0xe9d77b[_0xa811('0x1d')]=qs['limit'](_0x4ccbf5[_0xa811('0x31')][_0xa811('0x1d')]);_0xe9d77b['offset']=qs['offset'](_0x4ccbf5[_0xa811('0x31')]['offset']);}_0xe9d77b['order']=qs[_0xa811('0x39')](_0x4ccbf5[_0xa811('0x31')][_0xa811('0x39')]);_0xe9d77b['where']=qs[_0xa811('0x32')](_[_0xa811('0x5c')](_0x4ccbf5[_0xa811('0x31')],_0x5ab450[_0xa811('0x32')]));_0xe9d77b[_0xa811('0x3a')][_0xa811('0x5d')]=_0x18acbc['id'];if(_0x4ccbf5[_0xa811('0x31')][_0xa811('0x3b')]){_0xe9d77b[_0xa811('0x3a')]=_[_0xa811('0x3c')](_0xe9d77b[_0xa811('0x3a')],{'$or':_[_0xa811('0x3d')](_0xe9d77b[_0xa811('0x33')],function(_0x593dd7){var _0x240e43={};_0x240e43[_0x593dd7]={'$like':'%'+_0x4ccbf5['query'][_0xa811('0x3b')]+'%'};return _0x240e43;})});}_0xe9d77b=_[_0xa811('0x3c')]({},_0xe9d77b,_0x4ccbf5['options']);return db[_0xa811('0x5b')][_0xa811('0x43')]({'where':_0xe9d77b[_0xa811('0x3a')]})['then'](function(_0x5cba2d){_0x1d8858['count']=_0x5cba2d;if(_0x4ccbf5[_0xa811('0x31')][_0xa811('0x44')]){_0xe9d77b[_0xa811('0x45')]=[{'all':!![]}];}return db[_0xa811('0x5b')][_0xa811('0x5e')](_0xe9d77b);})[_0xa811('0x23')](function(_0x3e6919){_0x1d8858[_0xa811('0x46')]=_0x3e6919;return _0x1d8858;});}})['then'](respondWithFilteredResult(_0x4c5a9b,_0xe9d77b))[_0xa811('0x47')](handleError(_0x4c5a9b,null));};exports[_0xa811('0x5f')]=function(_0x10d632,_0x167ba9,_0x11f2ea){var _0x247445={'raw':!![],'where':{}};var _0x34aa2b={};var _0x315b21={'count':0x0,'rows':[]};return db[_0xa811('0x2d')]['findOne']({'where':{'id':_0x10d632[_0xa811('0x49')]['id']}})['then'](handleEntityNotFound(_0x167ba9,null))[_0xa811('0x23')](function(_0x5cb88e){if(_0x5cb88e){_0x34aa2b[_0xa811('0x2f')]=_[_0xa811('0x30')](db[_0xa811('0x60')][_0xa811('0x2e')]);_0x34aa2b[_0xa811('0x31')]=_[_0xa811('0x30')](_0x10d632['query']);_0x34aa2b[_0xa811('0x32')]=_[_0xa811('0x34')](_0x34aa2b[_0xa811('0x2f')],_0x34aa2b['query']);_0x247445[_0xa811('0x33')]=_[_0xa811('0x34')](_0x34aa2b[_0xa811('0x2f')],qs[_0xa811('0x35')](_0x10d632['query'][_0xa811('0x35')]));_0x247445[_0xa811('0x33')]=_0x247445[_0xa811('0x33')]['length']?_0x247445[_0xa811('0x33')]:_0x34aa2b['model'];if(!_0x10d632[_0xa811('0x31')][_0xa811('0x36')](_0xa811('0x37'))){_0x247445[_0xa811('0x1d')]=qs['limit'](_0x10d632[_0xa811('0x31')][_0xa811('0x1d')]);_0x247445[_0xa811('0x1c')]=qs[_0xa811('0x1c')](_0x10d632['query'][_0xa811('0x1c')]);}_0x247445[_0xa811('0x38')]=qs['sort'](_0x10d632[_0xa811('0x31')]['sort']);_0x247445[_0xa811('0x3a')]=qs['filters'](_[_0xa811('0x5c')](_0x10d632[_0xa811('0x31')],_0x34aa2b['filters']));_0x247445['where'][_0xa811('0x5d')]=_0x5cb88e['id'];if(_0x10d632[_0xa811('0x31')][_0xa811('0x3b')]){_0x247445[_0xa811('0x3a')]=_[_0xa811('0x3c')](_0x247445[_0xa811('0x3a')],{'$or':_[_0xa811('0x3d')](_0x247445[_0xa811('0x33')],function(_0x1379d8){var _0x38950a={};_0x38950a[_0x1379d8]={'$like':'%'+_0x10d632['query'][_0xa811('0x3b')]+'%'};return _0x38950a;})});}_0x247445=_[_0xa811('0x3c')]({},_0x247445,_0x10d632[_0xa811('0x42')]);return db[_0xa811('0x60')]['count']({'where':_0x247445[_0xa811('0x3a')]})[_0xa811('0x23')](function(_0x29c58b){_0x315b21[_0xa811('0x43')]=_0x29c58b;if(_0x10d632[_0xa811('0x31')]['includeAll']){_0x247445[_0xa811('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa811('0x5e')](_0x247445);})['then'](function(_0x23f01c){_0x315b21[_0xa811('0x46')]=_0x23f01c;return _0x315b21;});}})['then'](respondWithFilteredResult(_0x167ba9,_0x247445))['catch'](handleError(_0x167ba9,null));};function char(_0x3ad2dc){return _0xa811('0x61')===typeof _0x3ad2dc?String['fromCharCode'][_0xa811('0x20')](null,arguments):_0x3ad2dc;}function needsEncapsulation(_0x39e2a9){return!!_0x39e2a9&&(_0x39e2a9[_0xa811('0x62')]()[_0xa811('0x63')](char(0xd))>=0x0||_0x39e2a9['toString']()[_0xa811('0x63')](char(0xa))>=0x0||_0x39e2a9[_0xa811('0x62')]()[_0xa811('0x63')](char(0x2c))>=0x0||_0x39e2a9['toString']()[_0xa811('0x63')](char(0x22))>=0x0);}function encapsulate(_0x24ece7){var _0x55bbeb=char(0x22),_0x5d16d3='\x5c'+char(0x22),_0x3e1756=_0x24ece7['toString']()['replace'](new RegExp(_0x55bbeb,'g'),_0x5d16d3);return _0x55bbeb+_0x3e1756+_0x55bbeb;}exports['getSummary']=function(_0x3c7d9d,_0x46bfae,_0x2738ca){var _0x228a34,_0x21e4c7;var _0x4f8b58={'where':{'ProjectId':_0x3c7d9d[_0xa811('0x49')]['id']}};if(_0x3c7d9d[_0xa811('0x31')][_0xa811('0x64')]){_0x4f8b58[_0xa811('0x3a')]['starttime']=JSON[_0xa811('0x65')](_0x3c7d9d['query'][_0xa811('0x64')]);}return db[_0xa811('0x5b')][_0xa811('0x5e')](_0x4f8b58)['then'](handleEntityNotFound(_0x46bfae,null))['then'](function(_0x58343d){if(_0x58343d){_0x228a34=_0x58343d;return db[_0xa811('0x66')][_0xa811('0x5e')]({'where':{'SessionId':{'$in':_[_0xa811('0x3d')](_0x228a34,'id')},'ProjectId':_0x3c7d9d[_0xa811('0x49')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x46bfae,null))['then'](function(_0x5f5cef){if(_0x5f5cef){_0x21e4c7=_0x5f5cef;var _0x570d67={};for(var _0xf4814b=0x0,_0x405bcd=_0x21e4c7[_0xa811('0x4a')];_0xf4814b<_0x405bcd;_0xf4814b++){if(!_0x570d67[_0xa811('0x36')](_0x21e4c7[_0xf4814b][_0xa811('0x67')])){_0x570d67[_0x21e4c7[_0xf4814b][_0xa811('0x67')]]=needsEncapsulation(_0x21e4c7[_0xf4814b][_0xa811('0x68')])?encapsulate(_0x21e4c7[_0xf4814b][_0xa811('0x68')]):_0x21e4c7[_0xf4814b][_0xa811('0x68')];}}var _0x5dfd41=[],_0x178d38={};for(var _0x319956=0x0,_0x34f3c3=_0x228a34['length'];_0x319956<_0x34f3c3;_0x319956++){_0x178d38={'ProjectId':_0x3c7d9d[_0xa811('0x49')]['id'],'SessionId':_0x228a34[_0x319956]['id'],'StartTime':moment(_0x228a34[_0x319956][_0xa811('0x69')])[_0xa811('0x6a')](_0xa811('0x6b'))};for(var _0x30492e=0x0,_0x2133d8=_0x21e4c7['length'];_0x30492e<_0x2133d8;_0x30492e++){if(_0x21e4c7[_0x30492e][_0xa811('0x6c')]==_0x228a34[_0x319956]['id']&&_0x570d67[_0xa811('0x36')](_0x21e4c7[_0x30492e][_0xa811('0x67')])){_0x178d38[_0x570d67[_0x21e4c7[_0x30492e]['questionId']]]=_0x21e4c7[_0x30492e]['answer'];}}for(var _0x5b72a0 in _0x570d67){if(!_0x178d38[_0xa811('0x36')](_0x570d67[_0x5b72a0])){_0x178d38[_0x570d67[_0x5b72a0]]=null;}}_0x5dfd41[_0xa811('0x6d')](_0x178d38);}return _0x5dfd41;}})[_0xa811('0x23')](function(_0x495f04){if(!_[_0xa811('0x6e')](_0x495f04)){var _0xd5e5bc=toCsv(_0x495f04);var _0x362154=Date['now']();fs[_0xa811('0x6f')](util[_0xa811('0x6a')](_0xa811('0x70'),_0x3c7d9d[_0xa811('0x49')]['id'],_0x362154),_0xd5e5bc);_0x46bfae[_0xa811('0x71')]('Content-disposition',_0xa811('0x72')+util[_0xa811('0x6a')](_0xa811('0x73'),_0x3c7d9d[_0xa811('0x49')]['id'],_0x362154));_0x46bfae[_0xa811('0x71')](_0xa811('0x74'),_0xa811('0x75'));return _0x46bfae[_0xa811('0x76')](util[_0xa811('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3c7d9d['params']['id'],_0x362154));}else{return _0x46bfae[_0xa811('0x19')](0xcc);}})[_0xa811('0x47')](handleError(_0x46bfae,null));}; \ No newline at end of file +var _0x46d6=['SessionId','answer','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','api','end','status','json','count','offset','set','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','findOne','JscriptySessionReport','ProjectId','map','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x46d6,0x81));var _0x646d=function(_0x4f1afe,_0x29a790){_0x4f1afe=_0x4f1afe-0x0;var _0x552767=_0x46d6[_0x4f1afe];return _0x552767;};'use strict';var pdf=require(_0x646d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x646d('0x1'));var zipdir=require(_0x646d('0x2'));var jsonpatch=require(_0x646d('0x3'));var rp=require(_0x646d('0x4'));var moment=require(_0x646d('0x5'));var BPromise=require(_0x646d('0x6'));var Mustache=require(_0x646d('0x7'));var util=require(_0x646d('0x8'));var path=require(_0x646d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x646d('0xa'));var squel=require(_0x646d('0xb'));var crypto=require(_0x646d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x646d('0xd'));var toCsv=require(_0x646d('0xe'));var querystring=require(_0x646d('0xf'));var Papa=require('papaparse');var authService=require(_0x646d('0x10'));var hardwareService=require(_0x646d('0x11'));var Redis=require(_0x646d('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x646d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469494,_0x49bdbd){_0x49bdbd=_0x49bdbd||0xcc;return function(_0x3cfa99){if(_0x3cfa99){return _0x469494['sendStatus'](_0x49bdbd);}return _0x469494['status'](_0x49bdbd)[_0x646d('0x14')]();};}function respondWithResult(_0x1ed2d8,_0x2859f0){_0x2859f0=_0x2859f0||0xc8;return function(_0x516097){if(_0x516097){return _0x1ed2d8[_0x646d('0x15')](_0x2859f0)[_0x646d('0x16')](_0x516097);}};}function respondWithFilteredResult(_0x125036,_0x1e6414){return function(_0x3d1d42){if(_0x3d1d42){var _0x154ee5=_0x3d1d42[_0x646d('0x17')],_0x36d851=_0x1e6414[_0x646d('0x18')],_0x24d52e=_0x1e6414['offset']+_0x1e6414['limit'],_0x2a6fdc;if(_0x24d52e>=_0x154ee5){_0x24d52e=_0x154ee5;_0x2a6fdc=0xc8;}else{_0x2a6fdc=0xce;}_0x125036[_0x646d('0x15')](_0x2a6fdc);return _0x125036[_0x646d('0x19')]('Content-Range',_0x36d851+'-'+_0x24d52e+'/'+_0x154ee5)[_0x646d('0x16')](_0x3d1d42);}return null;};}function patchUpdates(_0x5baffc){return function(_0x253c3b){try{jsonpatch[_0x646d('0x1a')](_0x253c3b,_0x5baffc,!![]);}catch(_0x3be1f7){return BPromise[_0x646d('0x1b')](_0x3be1f7);}return _0x253c3b[_0x646d('0x1c')]();};}function saveUpdates(_0x357723,_0x1168e2){return function(_0x1d3805){if(_0x1d3805){return _0x1d3805[_0x646d('0x1d')](_0x357723)['then'](function(_0x2785a3){return _0x2785a3;});}return null;};}function removeEntity(_0x4a52b9,_0x5680a4){return function(_0x12c010){if(_0x12c010){return _0x12c010[_0x646d('0x1e')]()[_0x646d('0x1f')](function(){var _0x17fad1=_0x12c010[_0x646d('0x20')]({'plain':!![]});var _0x1de020=_0x646d('0x21');return db[_0x646d('0x22')][_0x646d('0x1e')]({'where':{'type':_0x1de020,'resourceId':_0x17fad1['id']}})['then'](function(){return _0x12c010;});})[_0x646d('0x1f')](function(){_0x4a52b9[_0x646d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x400ef5,_0x2c764b){return function(_0x4d58f2){if(!_0x4d58f2){_0x400ef5['sendStatus'](0x194);}return _0x4d58f2;};}function handleError(_0x133e9e,_0x57e785){_0x57e785=_0x57e785||0x1f4;return function(_0x462eaa){logger[_0x646d('0x23')](_0x462eaa[_0x646d('0x24')]);if(_0x462eaa[_0x646d('0x25')]){delete _0x462eaa['name'];}_0x133e9e[_0x646d('0x15')](_0x57e785)[_0x646d('0x26')](_0x462eaa);};}exports[_0x646d('0x27')]=function(_0x37186f,_0x1f5a1d){var _0x194cff={},_0x4ac139={},_0x13a293={'count':0x0,'rows':[]};var _0x9ef746=db[_0x646d('0x28')][_0x646d('0x29')];_0x4ac139[_0x646d('0x2a')]=_[_0x646d('0x2b')](_0x9ef746);_0x4ac139['query']=_[_0x646d('0x2b')](_0x37186f[_0x646d('0x2c')]);_0x4ac139[_0x646d('0x2d')]=_[_0x646d('0x2e')](_0x4ac139[_0x646d('0x2a')],_0x4ac139['query']);_0x194cff[_0x646d('0x2f')]=_[_0x646d('0x2e')](_0x4ac139[_0x646d('0x2a')],qs['fields'](_0x37186f[_0x646d('0x2c')]['fields']));_0x194cff[_0x646d('0x2f')]=_0x194cff[_0x646d('0x2f')]['length']?_0x194cff['attributes']:_0x4ac139['model'];if(!_0x37186f[_0x646d('0x2c')][_0x646d('0x30')](_0x646d('0x31'))){_0x194cff[_0x646d('0x32')]=qs[_0x646d('0x32')](_0x37186f[_0x646d('0x2c')][_0x646d('0x32')]);_0x194cff['offset']=qs[_0x646d('0x18')](_0x37186f['query'][_0x646d('0x18')]);}_0x194cff[_0x646d('0x33')]=qs['sort'](_0x37186f[_0x646d('0x2c')][_0x646d('0x34')]);_0x194cff[_0x646d('0x35')]=qs[_0x646d('0x2d')](_[_0x646d('0x36')](_0x37186f[_0x646d('0x2c')],_0x4ac139['filters']));if(_0x37186f['query'][_0x646d('0x37')]){_0x194cff[_0x646d('0x35')]=_[_0x646d('0x38')](_0x194cff[_0x646d('0x35')],{'$or':_['map'](_0x9ef746,function(_0x2923d6){if(_0x2923d6[_0x646d('0x39')][_0x646d('0x3a')]!==_0x646d('0x3b')){var _0x2e360d={};_0x2e360d[_0x2923d6['field']]={'$like':'%'+_0x37186f[_0x646d('0x2c')][_0x646d('0x37')]+'%'};return _0x2e360d;}})});}_0x194cff=_[_0x646d('0x38')]({},_0x194cff,_0x37186f[_0x646d('0x3c')]);var _0x18ee7f={'where':_0x194cff[_0x646d('0x35')]};return db[_0x646d('0x28')][_0x646d('0x17')](_0x18ee7f)['then'](function(_0x341382){_0x13a293[_0x646d('0x17')]=_0x341382;if(_0x37186f[_0x646d('0x2c')][_0x646d('0x3d')]){_0x194cff[_0x646d('0x3e')]=[{'all':!![]}];}return db[_0x646d('0x28')][_0x646d('0x3f')](_0x194cff);})[_0x646d('0x1f')](function(_0x149a78){_0x13a293[_0x646d('0x40')]=_0x149a78;return _0x13a293;})['then'](respondWithFilteredResult(_0x1f5a1d,_0x194cff))[_0x646d('0x41')](handleError(_0x1f5a1d,null));};exports[_0x646d('0x42')]=function(_0x12d5bb,_0x558016){var _0xa623f4={'raw':![],'where':{'id':_0x12d5bb[_0x646d('0x43')]['id']}},_0x3bd233={};_0x3bd233[_0x646d('0x2a')]=_[_0x646d('0x2b')](db['JscriptyProject'][_0x646d('0x29')]);_0x3bd233[_0x646d('0x2c')]=_[_0x646d('0x2b')](_0x12d5bb[_0x646d('0x2c')]);_0x3bd233['filters']=_[_0x646d('0x2e')](_0x3bd233[_0x646d('0x2a')],_0x3bd233[_0x646d('0x2c')]);_0xa623f4[_0x646d('0x2f')]=_[_0x646d('0x2e')](_0x3bd233[_0x646d('0x2a')],qs[_0x646d('0x44')](_0x12d5bb['query']['fields']));_0xa623f4['attributes']=_0xa623f4[_0x646d('0x2f')][_0x646d('0x45')]?_0xa623f4[_0x646d('0x2f')]:_0x3bd233[_0x646d('0x2a')];if(_0x12d5bb[_0x646d('0x2c')]['includeAll']){_0xa623f4[_0x646d('0x3e')]=[{'all':!![]}];}_0xa623f4=_[_0x646d('0x38')]({},_0xa623f4,_0x12d5bb[_0x646d('0x3c')]);return db['JscriptyProject'][_0x646d('0x46')](_0xa623f4)[_0x646d('0x1f')](handleEntityNotFound(_0x558016,null))[_0x646d('0x1f')](respondWithResult(_0x558016,null))[_0x646d('0x41')](handleError(_0x558016,null));};exports[_0x646d('0x47')]=function(_0x21d50b,_0x520389){return db[_0x646d('0x28')]['create'](_0x21d50b[_0x646d('0x48')],{})[_0x646d('0x1f')](function(_0x5aaf3d){var _0x47ec83=_0x21d50b[_0x646d('0x49')][_0x646d('0x20')]({'plain':!![]});if(!_0x47ec83)throw new Error(_0x646d('0x4a'));if(_0x47ec83['role']===_0x646d('0x49')){var _0x37c2be=_0x5aaf3d[_0x646d('0x20')]({'plain':!![]});var _0x528414=_0x646d('0x21');return db['UserProfileSection'][_0x646d('0x46')]({'where':{'name':_0x528414,'userProfileId':_0x47ec83[_0x646d('0x4b')]},'raw':!![]})['then'](function(_0x5220df){if(_0x5220df&&_0x5220df[_0x646d('0x4c')]===0x0){return db[_0x646d('0x22')]['create']({'name':_0x37c2be[_0x646d('0x25')],'resourceId':_0x37c2be['id'],'type':_0x5220df[_0x646d('0x25')],'sectionId':_0x5220df['id']},{})[_0x646d('0x1f')](function(){return _0x5aaf3d;});}else{return _0x5aaf3d;}})[_0x646d('0x41')](function(_0xd4ca3f){logger[_0x646d('0x23')](_0x646d('0x4d'),_0xd4ca3f);throw _0xd4ca3f;});}return _0x5aaf3d;})[_0x646d('0x1f')](respondWithResult(_0x520389,0xc9))[_0x646d('0x41')](handleError(_0x520389,null));};exports[_0x646d('0x4e')]=function(_0x2e73a2,_0x311315){var _0x15e803={'raw':![],'where':{'id':_0x2e73a2[_0x646d('0x43')]['id']}},_0x3f4c56={};_0x3f4c56['model']=_[_0x646d('0x2b')](db[_0x646d('0x28')]['rawAttributes']);_0x15e803['attributes']=_[_0x646d('0x2e')](_0x3f4c56[_0x646d('0x2a')],qs['fields'](_0x2e73a2['query']['fields']));_0x15e803[_0x646d('0x2f')]=_0x15e803[_0x646d('0x2f')][_0x646d('0x45')]?_0x15e803['attributes']:_0x3f4c56[_0x646d('0x2a')];if(_0x2e73a2[_0x646d('0x2c')][_0x646d('0x3d')]){_0x15e803[_0x646d('0x3e')]=[{'all':!![]}];}_0x15e803=_[_0x646d('0x38')]({},_0x15e803,_0x2e73a2[_0x646d('0x3c')]);return db[_0x646d('0x28')]['find'](_0x15e803)[_0x646d('0x1f')](handleEntityNotFound(_0x311315,null))[_0x646d('0x1f')](function(_0x1d2432){if(_0x1d2432){var _0x5008d7=_0x1d2432[_0x646d('0x20')]({'plain':!![]});_0x5008d7=qs[_0x646d('0x4f')](_0x5008d7,['id',_0x646d('0x50'),_0x646d('0x51')]);_0x2e73a2['body']=_['omit'](_0x2e73a2[_0x646d('0x48')],['id',_0x646d('0x50'),_0x646d('0x51')]);return db['JscriptyProject'][_0x646d('0x47')](_[_0x646d('0x38')](_0x5008d7,_0x2e73a2['body']),{'include':_0x2e73a2[_0x646d('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x646d('0x1f')](function(_0xb5430d){var _0x4311cc=_0x2e73a2[_0x646d('0x49')][_0x646d('0x20')]({'plain':!![]});if(!_0x4311cc)throw new Error(_0x646d('0x4a'));if(_0x4311cc[_0x646d('0x52')]===_0x646d('0x49')){var _0x5511b7=_0xb5430d[_0x646d('0x20')]({'plain':!![]});var _0x29f16b=_0x646d('0x21');return db[_0x646d('0x53')]['find']({'where':{'name':_0x29f16b,'userProfileId':_0x4311cc[_0x646d('0x4b')]},'raw':!![]})[_0x646d('0x1f')](function(_0x64ab69){if(_0x64ab69&&_0x64ab69[_0x646d('0x4c')]===0x0){return db[_0x646d('0x22')]['create']({'name':_0x5511b7[_0x646d('0x25')],'resourceId':_0x5511b7['id'],'type':_0x64ab69[_0x646d('0x25')],'sectionId':_0x64ab69['id']},{})[_0x646d('0x1f')](function(){return _0xb5430d;});}else{return _0xb5430d;}})[_0x646d('0x41')](function(_0x25adaa){logger['error'](_0x646d('0x4d'),_0x25adaa);throw _0x25adaa;});}return _0xb5430d;});}})[_0x646d('0x1f')](respondWithResult(_0x311315,0xc9))[_0x646d('0x41')](handleError(_0x311315,null));};exports[_0x646d('0x1d')]=function(_0x7646a3,_0x3b8343){if(_0x7646a3[_0x646d('0x48')]['id']){delete _0x7646a3[_0x646d('0x48')]['id'];}return db[_0x646d('0x28')][_0x646d('0x46')]({'where':{'id':_0x7646a3[_0x646d('0x43')]['id']}})[_0x646d('0x1f')](handleEntityNotFound(_0x3b8343,null))[_0x646d('0x1f')](saveUpdates(_0x7646a3[_0x646d('0x48')],null))[_0x646d('0x1f')](respondWithResult(_0x3b8343,null))[_0x646d('0x41')](handleError(_0x3b8343,null));};exports[_0x646d('0x1e')]=function(_0x50b05b,_0x99d37d){return db['JscriptyProject']['find']({'where':{'id':_0x50b05b[_0x646d('0x43')]['id']}})[_0x646d('0x1f')](handleEntityNotFound(_0x99d37d,null))[_0x646d('0x1f')](removeEntity(_0x99d37d,null))[_0x646d('0x41')](handleError(_0x99d37d,null));};exports['getSessions']=function(_0x25e98f,_0x3ea07c,_0x10d943){var _0x5ea1d6={'raw':!![],'where':{}};var _0x312b7c={};var _0x254aef={'count':0x0,'rows':[]};return db[_0x646d('0x28')][_0x646d('0x54')]({'where':{'id':_0x25e98f['params']['id']}})[_0x646d('0x1f')](handleEntityNotFound(_0x3ea07c,null))['then'](function(_0x1fe4c3){if(_0x1fe4c3){_0x312b7c['model']=_[_0x646d('0x2b')](db[_0x646d('0x55')][_0x646d('0x29')]);_0x312b7c[_0x646d('0x2c')]=_['keys'](_0x25e98f[_0x646d('0x2c')]);_0x312b7c['filters']=_[_0x646d('0x2e')](_0x312b7c[_0x646d('0x2a')],_0x312b7c[_0x646d('0x2c')]);_0x5ea1d6[_0x646d('0x2f')]=_[_0x646d('0x2e')](_0x312b7c[_0x646d('0x2a')],qs[_0x646d('0x44')](_0x25e98f[_0x646d('0x2c')][_0x646d('0x44')]));_0x5ea1d6[_0x646d('0x2f')]=_0x5ea1d6['attributes']['length']?_0x5ea1d6[_0x646d('0x2f')]:_0x312b7c[_0x646d('0x2a')];if(!_0x25e98f[_0x646d('0x2c')]['hasOwnProperty'](_0x646d('0x31'))){_0x5ea1d6['limit']=qs[_0x646d('0x32')](_0x25e98f[_0x646d('0x2c')][_0x646d('0x32')]);_0x5ea1d6[_0x646d('0x18')]=qs[_0x646d('0x18')](_0x25e98f['query']['offset']);}_0x5ea1d6['order']=qs[_0x646d('0x34')](_0x25e98f[_0x646d('0x2c')][_0x646d('0x34')]);_0x5ea1d6[_0x646d('0x35')]=qs['filters'](_[_0x646d('0x36')](_0x25e98f['query'],_0x312b7c[_0x646d('0x2d')]));_0x5ea1d6[_0x646d('0x35')][_0x646d('0x56')]=_0x1fe4c3['id'];if(_0x25e98f['query'][_0x646d('0x37')]){_0x5ea1d6[_0x646d('0x35')]=_[_0x646d('0x38')](_0x5ea1d6['where'],{'$or':_[_0x646d('0x57')](_0x5ea1d6[_0x646d('0x2f')],function(_0x46d7d2){var _0x3549b8={};_0x3549b8[_0x46d7d2]={'$like':'%'+_0x25e98f['query']['filter']+'%'};return _0x3549b8;})});}_0x5ea1d6=_[_0x646d('0x38')]({},_0x5ea1d6,_0x25e98f[_0x646d('0x3c')]);return db['JscriptySessionReport'][_0x646d('0x17')]({'where':_0x5ea1d6[_0x646d('0x35')]})[_0x646d('0x1f')](function(_0x1e55af){_0x254aef[_0x646d('0x17')]=_0x1e55af;if(_0x25e98f['query'][_0x646d('0x3d')]){_0x5ea1d6[_0x646d('0x3e')]=[{'all':!![]}];}return db[_0x646d('0x55')][_0x646d('0x3f')](_0x5ea1d6);})['then'](function(_0x58cb7f){_0x254aef['rows']=_0x58cb7f;return _0x254aef;});}})[_0x646d('0x1f')](respondWithFilteredResult(_0x3ea07c,_0x5ea1d6))['catch'](handleError(_0x3ea07c,null));};exports[_0x646d('0x58')]=function(_0x2c230a,_0x1c9e39,_0x385985){var _0x5185e3={'raw':!![],'where':{}};var _0x8123af={};var _0x3b9756={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x646d('0x54')]({'where':{'id':_0x2c230a['params']['id']}})['then'](handleEntityNotFound(_0x1c9e39,null))[_0x646d('0x1f')](function(_0x22f26c){if(_0x22f26c){_0x8123af[_0x646d('0x2a')]=_['keys'](db['JscriptyAnswerReport'][_0x646d('0x29')]);_0x8123af[_0x646d('0x2c')]=_[_0x646d('0x2b')](_0x2c230a[_0x646d('0x2c')]);_0x8123af['filters']=_[_0x646d('0x2e')](_0x8123af['model'],_0x8123af['query']);_0x5185e3[_0x646d('0x2f')]=_[_0x646d('0x2e')](_0x8123af[_0x646d('0x2a')],qs['fields'](_0x2c230a[_0x646d('0x2c')][_0x646d('0x44')]));_0x5185e3['attributes']=_0x5185e3[_0x646d('0x2f')][_0x646d('0x45')]?_0x5185e3['attributes']:_0x8123af[_0x646d('0x2a')];if(!_0x2c230a[_0x646d('0x2c')][_0x646d('0x30')](_0x646d('0x31'))){_0x5185e3[_0x646d('0x32')]=qs['limit'](_0x2c230a[_0x646d('0x2c')][_0x646d('0x32')]);_0x5185e3['offset']=qs[_0x646d('0x18')](_0x2c230a[_0x646d('0x2c')][_0x646d('0x18')]);}_0x5185e3['order']=qs[_0x646d('0x34')](_0x2c230a['query'][_0x646d('0x34')]);_0x5185e3[_0x646d('0x35')]=qs['filters'](_[_0x646d('0x36')](_0x2c230a[_0x646d('0x2c')],_0x8123af[_0x646d('0x2d')]));_0x5185e3[_0x646d('0x35')][_0x646d('0x56')]=_0x22f26c['id'];if(_0x2c230a[_0x646d('0x2c')]['filter']){_0x5185e3[_0x646d('0x35')]=_[_0x646d('0x38')](_0x5185e3['where'],{'$or':_[_0x646d('0x57')](_0x5185e3[_0x646d('0x2f')],function(_0x2c1f2b){var _0x2ef006={};_0x2ef006[_0x2c1f2b]={'$like':'%'+_0x2c230a[_0x646d('0x2c')][_0x646d('0x37')]+'%'};return _0x2ef006;})});}_0x5185e3=_['merge']({},_0x5185e3,_0x2c230a[_0x646d('0x3c')]);return db[_0x646d('0x59')][_0x646d('0x17')]({'where':_0x5185e3['where']})[_0x646d('0x1f')](function(_0xf6873c){_0x3b9756[_0x646d('0x17')]=_0xf6873c;if(_0x2c230a[_0x646d('0x2c')][_0x646d('0x3d')]){_0x5185e3[_0x646d('0x3e')]=[{'all':!![]}];}return db[_0x646d('0x59')][_0x646d('0x3f')](_0x5185e3);})[_0x646d('0x1f')](function(_0x15db6c){_0x3b9756[_0x646d('0x40')]=_0x15db6c;return _0x3b9756;});}})[_0x646d('0x1f')](respondWithFilteredResult(_0x1c9e39,_0x5185e3))['catch'](handleError(_0x1c9e39,null));};function char(_0x246d30){return _0x646d('0x5a')===typeof _0x246d30?String[_0x646d('0x5b')][_0x646d('0x1a')](null,arguments):_0x246d30;}function needsEncapsulation(_0x1f2048){return!!_0x1f2048&&(_0x1f2048[_0x646d('0x5c')]()[_0x646d('0x5d')](char(0xd))>=0x0||_0x1f2048['toString']()[_0x646d('0x5d')](char(0xa))>=0x0||_0x1f2048[_0x646d('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x1f2048[_0x646d('0x5c')]()[_0x646d('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4eb5ac){var _0x58de7b=char(0x22),_0x5d3690='\x5c'+char(0x22),_0x280b7a=_0x4eb5ac[_0x646d('0x5c')]()[_0x646d('0x5e')](new RegExp(_0x58de7b,'g'),_0x5d3690);return _0x58de7b+_0x280b7a+_0x58de7b;}exports['getSummary']=function(_0x70488d,_0x168edf,_0x50d424){var _0x5ab9de,_0x2b4e3d;var _0x4311de={'where':{'ProjectId':_0x70488d[_0x646d('0x43')]['id']}};if(_0x70488d[_0x646d('0x2c')][_0x646d('0x5f')]){_0x4311de[_0x646d('0x35')]['starttime']=JSON[_0x646d('0x60')](_0x70488d[_0x646d('0x2c')][_0x646d('0x5f')]);}return db[_0x646d('0x55')][_0x646d('0x3f')](_0x4311de)[_0x646d('0x1f')](handleEntityNotFound(_0x168edf,null))[_0x646d('0x1f')](function(_0x405ead){if(_0x405ead){_0x5ab9de=_0x405ead;return db[_0x646d('0x61')][_0x646d('0x3f')]({'where':{'SessionId':{'$in':_[_0x646d('0x57')](_0x5ab9de,'id')},'ProjectId':_0x70488d['params']['id']},'order':_0x646d('0x62')});}})[_0x646d('0x1f')](handleEntityNotFound(_0x168edf,null))[_0x646d('0x1f')](function(_0xed90c4){if(_0xed90c4){_0x2b4e3d=_0xed90c4;var _0x1d8e55={};for(var _0x5d94b0=0x0,_0x428420=_0x2b4e3d[_0x646d('0x45')];_0x5d94b0<_0x428420;_0x5d94b0++){if(!_0x1d8e55['hasOwnProperty'](_0x2b4e3d[_0x5d94b0][_0x646d('0x63')])){_0x1d8e55[_0x2b4e3d[_0x5d94b0][_0x646d('0x63')]]=needsEncapsulation(_0x2b4e3d[_0x5d94b0]['question'])?encapsulate(_0x2b4e3d[_0x5d94b0][_0x646d('0x64')]):_0x2b4e3d[_0x5d94b0][_0x646d('0x64')];}}var _0xb0520f=[],_0x1e5e27={};for(var _0xeb0aff=0x0,_0x32fb9e=_0x5ab9de[_0x646d('0x45')];_0xeb0aff<_0x32fb9e;_0xeb0aff++){_0x1e5e27={'ProjectId':_0x70488d[_0x646d('0x43')]['id'],'SessionId':_0x5ab9de[_0xeb0aff]['id'],'StartTime':moment(_0x5ab9de[_0xeb0aff][_0x646d('0x65')])['format'](_0x646d('0x66'))};for(var _0x2226d6=0x0,_0x3d60de=_0x2b4e3d[_0x646d('0x45')];_0x2226d6<_0x3d60de;_0x2226d6++){if(_0x2b4e3d[_0x2226d6][_0x646d('0x67')]==_0x5ab9de[_0xeb0aff]['id']&&_0x1d8e55['hasOwnProperty'](_0x2b4e3d[_0x2226d6][_0x646d('0x63')])){_0x1e5e27[_0x1d8e55[_0x2b4e3d[_0x2226d6][_0x646d('0x63')]]]=_0x2b4e3d[_0x2226d6][_0x646d('0x68')];}}for(var _0x91492d in _0x1d8e55){if(!_0x1e5e27['hasOwnProperty'](_0x1d8e55[_0x91492d])){_0x1e5e27[_0x1d8e55[_0x91492d]]=null;}}_0xb0520f['push'](_0x1e5e27);}return _0xb0520f;}})[_0x646d('0x1f')](function(_0x309a04){if(!_['isEmpty'](_0x309a04)){var _0x5942f1=toCsv(_0x309a04);var _0x1dd6e3=Date[_0x646d('0x69')]();fs[_0x646d('0x6a')](util[_0x646d('0x6b')](_0x646d('0x6c'),_0x70488d['params']['id'],_0x1dd6e3),_0x5942f1);_0x168edf[_0x646d('0x6d')](_0x646d('0x6e'),_0x646d('0x6f')+util[_0x646d('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x70488d[_0x646d('0x43')]['id'],_0x1dd6e3));_0x168edf[_0x646d('0x6d')](_0x646d('0x70'),_0x646d('0x71'));return _0x168edf[_0x646d('0x72')](util[_0x646d('0x6b')](_0x646d('0x6c'),_0x70488d[_0x646d('0x43')]['id'],_0x1dd6e3));}else{return _0x168edf[_0x646d('0x73')](0xcc);}})[_0x646d('0x41')](handleError(_0x168edf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f2925f7..b9dd961 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 _0x2b81=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x51104d,_0x587c28){var _0x3cf207=function(_0x112400){while(--_0x112400){_0x51104d['push'](_0x51104d['shift']());}};_0x3cf207(++_0x587c28);}(_0x2b81,0x1ef));var _0x12b8=function(_0x61df12,_0x248233){_0x61df12=_0x61df12-0x0;var _0xec518c=_0x2b81[_0x61df12];return _0xec518c;};'use strict';var _=require(_0x12b8('0x0'));var util=require(_0x12b8('0x1'));var logger=require(_0x12b8('0x2'))(_0x12b8('0x3'));var moment=require(_0x12b8('0x4'));var BPromise=require(_0x12b8('0x5'));var rp=require(_0x12b8('0x6'));var attributes=require(_0x12b8('0x7'));module[_0x12b8('0x8')]=function(_0x3e5bba,_0x554505){return _0x3e5bba[_0x12b8('0x9')]('JscriptyProject',attributes,{'tableName':_0x12b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ab7=['jscripty_projects','util','api','bluebird','request-promise','define'];(function(_0x5fd77e,_0x30b707){var _0x116027=function(_0x3c19a1){while(--_0x3c19a1){_0x5fd77e['push'](_0x5fd77e['shift']());}};_0x116027(++_0x30b707);}(_0x2ab7,0x187));var _0x72ab=function(_0x5d8492,_0x10ce3a){_0x5d8492=_0x5d8492-0x0;var _0x1a17c2=_0x2ab7[_0x5d8492];return _0x1a17c2;};'use strict';var _=require('lodash');var util=require(_0x72ab('0x0'));var logger=require('../../config/logger')(_0x72ab('0x1'));var moment=require('moment');var BPromise=require(_0x72ab('0x2'));var rp=require(_0x72ab('0x3'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x218e13,_0x2b01b1){return _0x218e13[_0x72ab('0x4')]('JscriptyProject',attributes,{'tableName':_0x72ab('0x5'),'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 d344839..324edbf 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 _0x8865=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0xe16a48,_0x5309ea){var _0x170855=function(_0x5e1345){while(--_0x5e1345){_0xe16a48['push'](_0xe16a48['shift']());}};_0x170855(++_0x5309ea);}(_0x8865,0x1dc));var _0x5886=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x8865[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require(_0x5886('0x0'));var moment=require(_0x5886('0x1'));var BPromise=require(_0x5886('0x2'));var rs=require(_0x5886('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5886('0x4'))['db'];var utils=require(_0x5886('0x5'));var logger=require(_0x5886('0x6'))(_0x5886('0x7'));var config=require(_0x5886('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5886('0x9')][_0x5886('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8d47ba,_0x554ecb,_0x4bdccd){return new BPromise(function(_0x523b7b,_0x33e3fd){return client['request'](_0x8d47ba,_0x4bdccd)[_0x5886('0xb')](function(_0x3b7e9f){logger[_0x5886('0xc')](_0x5886('0xd'),_0x554ecb,_0x5886('0xe'));logger[_0x5886('0xf')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x554ecb,_0x5886('0xe'),JSON['stringify'](_0x3b7e9f));if(_0x3b7e9f[_0x5886('0x10')]){if(_0x3b7e9f[_0x5886('0x10')][_0x5886('0x11')]===0x1f4){logger[_0x5886('0x10')](_0x5886('0xd'),_0x554ecb,_0x3b7e9f['error']['message']);return _0x33e3fd(_0x3b7e9f[_0x5886('0x10')]['message']);}logger[_0x5886('0x10')](_0x5886('0xd'),_0x554ecb,_0x3b7e9f[_0x5886('0x10')][_0x5886('0x12')]);return _0x523b7b(_0x3b7e9f[_0x5886('0x10')][_0x5886('0x12')]);}else{logger['info'](_0x5886('0xd'),_0x554ecb,_0x5886('0xe'));_0x523b7b(_0x3b7e9f['result'][_0x5886('0x12')]);}})[_0x5886('0x13')](function(_0x4ff965){logger[_0x5886('0x10')](_0x5886('0xd'),_0x554ecb,_0x4ff965);_0x33e3fd(_0x4ff965);});});} \ No newline at end of file +var _0x842d=['http','request','then','info','request\x20sent','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x3d3c4e,_0x178b30){var _0x7a22a9=function(_0xcc2361){while(--_0xcc2361){_0x3d3c4e['push'](_0x3d3c4e['shift']());}};_0x7a22a9(++_0x178b30);}(_0x842d,0x1ae));var _0xd842=function(_0x56085e,_0x5c69e9){_0x56085e=_0x56085e-0x0;var _0x4de130=_0x842d[_0x56085e];return _0x4de130;};'use strict';var _=require('lodash');var util=require(_0xd842('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd842('0x1'));var fs=require('fs');var Redis=require(_0xd842('0x2'));var db=require(_0xd842('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd842('0x4'))('rpc');var config=require(_0xd842('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd842('0x6')][_0xd842('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d662,_0x311f8d,_0x4cc1fe){return new BPromise(function(_0xeb4ea9,_0x4050a8){return client[_0xd842('0x8')](_0x5d662,_0x4cc1fe)[_0xd842('0x9')](function(_0xef75db){logger[_0xd842('0xa')]('JscriptyProject,\x20%s,\x20%s',_0x311f8d,'request\x20sent');logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x311f8d,_0xd842('0xb'),JSON[_0xd842('0xc')](_0xef75db));if(_0xef75db[_0xd842('0xd')]){if(_0xef75db[_0xd842('0xd')][_0xd842('0xe')]===0x1f4){logger[_0xd842('0xd')](_0xd842('0xf'),_0x311f8d,_0xef75db[_0xd842('0xd')][_0xd842('0x10')]);return _0x4050a8(_0xef75db[_0xd842('0xd')][_0xd842('0x10')]);}logger['error'](_0xd842('0xf'),_0x311f8d,_0xef75db['error']['message']);return _0xeb4ea9(_0xef75db['error'][_0xd842('0x10')]);}else{logger[_0xd842('0xa')](_0xd842('0xf'),_0x311f8d,'request\x20sent');_0xeb4ea9(_0xef75db[_0xd842('0x11')][_0xd842('0x10')]);}})[_0xd842('0x12')](function(_0x22d61a){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x311f8d,_0x22d61a);_0x4050a8(_0x22d61a);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index aa2e777..7a2d7ab 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 _0xfdf2=['show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xfdf2,0xfa));var _0x2fdf=function(_0x2e8496,_0x52cb21){_0x2e8496=_0x2e8496-0x0;var _0x1a09e1=_0xfdf2[_0x2e8496];return _0x1a09e1;};'use strict';var multer=require(_0x2fdf('0x0'));var util=require(_0x2fdf('0x1'));var path=require('path');var timeout=require(_0x2fdf('0x2'));var express=require('express');var router=express[_0x2fdf('0x3')]();var auth=require(_0x2fdf('0x4'));var interaction=require(_0x2fdf('0x5'));var config=require(_0x2fdf('0x6'));var controller=require(_0x2fdf('0x7'));router[_0x2fdf('0x8')]('/',auth[_0x2fdf('0x9')](),controller[_0x2fdf('0xa')]);router[_0x2fdf('0x8')](_0x2fdf('0xb'),auth[_0x2fdf('0x9')](),controller[_0x2fdf('0xc')]);router[_0x2fdf('0x8')](_0x2fdf('0xd'),auth[_0x2fdf('0x9')](),controller[_0x2fdf('0xe')]);router[_0x2fdf('0xf')]('/',auth[_0x2fdf('0x9')](),controller[_0x2fdf('0x10')]);router[_0x2fdf('0x11')](_0x2fdf('0xd'),auth[_0x2fdf('0x9')](),controller[_0x2fdf('0x12')]);router[_0x2fdf('0x13')](_0x2fdf('0xd'),auth[_0x2fdf('0x9')](),controller[_0x2fdf('0x14')]);module[_0x2fdf('0x15')]=router; \ No newline at end of file +var _0x6eea=['Router','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','destroy','exports','multer','util','path','express'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x6eea,0x1c7));var _0xa6ee=function(_0x572ee8,_0x24ea07){_0x572ee8=_0x572ee8-0x0;var _0xb87b08=_0x6eea[_0x572ee8];return _0xb87b08;};'use strict';var multer=require(_0xa6ee('0x0'));var util=require(_0xa6ee('0x1'));var path=require(_0xa6ee('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6ee('0x3'));var router=express[_0xa6ee('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa6ee('0x5'));var controller=require(_0xa6ee('0x6'));router['get']('/',auth[_0xa6ee('0x7')](),controller[_0xa6ee('0x8')]);router[_0xa6ee('0x9')]('/describe',auth[_0xa6ee('0x7')](),controller[_0xa6ee('0xa')]);router[_0xa6ee('0x9')](_0xa6ee('0xb'),auth['isAuthenticated'](),controller[_0xa6ee('0xc')]);router[_0xa6ee('0xd')]('/',auth[_0xa6ee('0x7')](),controller['create']);router[_0xa6ee('0xe')]('/:id',auth[_0xa6ee('0x7')](),controller['update']);router['delete']('/:id',auth[_0xa6ee('0x7')](),controller[_0xa6ee('0xf')]);module[_0xa6ee('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index be88103..68bbea1 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 _0x2333=['long','STRING','sequelize','exports'];(function(_0x269b97,_0x10d133){var _0x120efa=function(_0xef252d){while(--_0xef252d){_0x269b97['push'](_0x269b97['shift']());}};_0x120efa(++_0x10d133);}(_0x2333,0x11a));var _0x3233=function(_0x3a5119,_0x4a9167){_0x3a5119=_0x3a5119-0x0;var _0x56b46a=_0x2333[_0x3a5119];return _0x56b46a;};'use strict';var Sequelize=require(_0x3233('0x0'));module[_0x3233('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0x3233('0x2'))},'membername':{'type':Sequelize[_0x3233('0x3')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3233('0x3')]},'uniqueid':{'type':Sequelize[_0x3233('0x3')]},'calleridname':{'type':Sequelize[_0x3233('0x3')]},'calleridnum':{'type':Sequelize[_0x3233('0x3')]},'questionId':{'type':Sequelize[_0x3233('0x3')]}}; \ No newline at end of file +var _0xad13=['long','sequelize','STRING','TEXT'];(function(_0x548b9c,_0x453ffd){var _0x1e2418=function(_0x26790b){while(--_0x26790b){_0x548b9c['push'](_0x548b9c['shift']());}};_0x1e2418(++_0x453ffd);}(_0xad13,0x79));var _0x3ad1=function(_0x1600fd,_0x454a95){_0x1600fd=_0x1600fd-0x0;var _0x3cd96c=_0xad13[_0x1600fd];return _0x3cd96c;};'use strict';var Sequelize=require(_0x3ad1('0x0'));module['exports']={'question':{'type':Sequelize[_0x3ad1('0x1')]},'answer':{'type':Sequelize[_0x3ad1('0x2')](_0x3ad1('0x3'))},'membername':{'type':Sequelize[_0x3ad1('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3ad1('0x1')]},'uniqueid':{'type':Sequelize[_0x3ad1('0x1')]},'calleridname':{'type':Sequelize[_0x3ad1('0x1')]},'calleridnum':{'type':Sequelize[_0x3ad1('0x1')]},'questionId':{'type':Sequelize[_0x3ad1('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 5cbe837..fd29493 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 _0xbbbc=['name','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','type','key','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x363e6f,_0x342898){_0x363e6f=_0x363e6f-0x0;var _0x14cf12=_0xbbbc[_0x363e6f];return _0x14cf12;};'use strict';var pdf=require(_0xcbbb('0x0'));var emlformat=require(_0xcbbb('0x1'));var rimraf=require(_0xcbbb('0x2'));var zipdir=require(_0xcbbb('0x3'));var jsonpatch=require(_0xcbbb('0x4'));var rp=require(_0xcbbb('0x5'));var moment=require(_0xcbbb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcbbb('0x7'));var util=require(_0xcbbb('0x8'));var path=require(_0xcbbb('0x9'));var sox=require(_0xcbbb('0xa'));var csv=require(_0xcbbb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xb'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var authService=require(_0xcbbb('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xcbbb('0x13'));var logger=require('../../config/logger')(_0xcbbb('0x14'));var utils=require('../../config/utils');var config=require(_0xcbbb('0x15'));var db=require(_0xcbbb('0x16'))['db'];function respondWithStatusCode(_0x572e50,_0x631188){_0x631188=_0x631188||0xcc;return function(_0x53e651){if(_0x53e651){return _0x572e50[_0xcbbb('0x17')](_0x631188);}return _0x572e50['status'](_0x631188)[_0xcbbb('0x18')]();};}function respondWithResult(_0x15ba43,_0x1cece7){_0x1cece7=_0x1cece7||0xc8;return function(_0x47ea6a){if(_0x47ea6a){return _0x15ba43[_0xcbbb('0x19')](_0x1cece7)[_0xcbbb('0x1a')](_0x47ea6a);}};}function respondWithFilteredResult(_0x8a325c,_0x273e13){return function(_0x47e679){if(_0x47e679){var _0x5af226=_0x47e679[_0xcbbb('0x1b')],_0x1bba39=_0x273e13['offset'],_0x30297d=_0x273e13[_0xcbbb('0x1c')]+_0x273e13['limit'],_0xf76038;if(_0x30297d>=_0x5af226){_0x30297d=_0x5af226;_0xf76038=0xc8;}else{_0xf76038=0xce;}_0x8a325c[_0xcbbb('0x19')](_0xf76038);return _0x8a325c[_0xcbbb('0x1d')](_0xcbbb('0x1e'),_0x1bba39+'-'+_0x30297d+'/'+_0x5af226)['json'](_0x47e679);}return null;};}function patchUpdates(_0x57c5e9){return function(_0x4bcd9a){try{jsonpatch[_0xcbbb('0x1f')](_0x4bcd9a,_0x57c5e9,!![]);}catch(_0x3ae91b){return BPromise[_0xcbbb('0x20')](_0x3ae91b);}return _0x4bcd9a[_0xcbbb('0x21')]();};}function saveUpdates(_0x658337,_0x1cca90){return function(_0x45de5f){if(_0x45de5f){return _0x45de5f[_0xcbbb('0x22')](_0x658337)[_0xcbbb('0x23')](function(_0x2d4335){return _0x2d4335;});}return null;};}function removeEntity(_0x594b3f,_0x44a568){return function(_0xe07b0){if(_0xe07b0){return _0xe07b0[_0xcbbb('0x24')]()[_0xcbbb('0x23')](function(){_0x594b3f[_0xcbbb('0x19')](0xcc)[_0xcbbb('0x18')]();});}};}function handleEntityNotFound(_0x297eae,_0xabb565){return function(_0x3ca570){if(!_0x3ca570){_0x297eae['sendStatus'](0x194);}return _0x3ca570;};}function handleError(_0xf39ddd,_0x4490c1){_0x4490c1=_0x4490c1||0x1f4;return function(_0x4c543a){logger[_0xcbbb('0x25')](_0x4c543a['stack']);if(_0x4c543a['name']){delete _0x4c543a[_0xcbbb('0x26')];}_0xf39ddd[_0xcbbb('0x19')](_0x4490c1)['send'](_0x4c543a);};}exports['index']=function(_0x5499a1,_0x4439ea){var _0x55e1d8={},_0x4da775={},_0x21e3b1={'count':0x0,'rows':[]};var _0x2902c6=db[_0xcbbb('0x27')][_0xcbbb('0x28')];_0x4da775[_0xcbbb('0x29')]=_[_0xcbbb('0x2a')](_0x2902c6);_0x4da775[_0xcbbb('0x2b')]=_[_0xcbbb('0x2a')](_0x5499a1[_0xcbbb('0x2b')]);_0x4da775[_0xcbbb('0x2c')]=_[_0xcbbb('0x2d')](_0x4da775[_0xcbbb('0x29')],_0x4da775[_0xcbbb('0x2b')]);_0x55e1d8[_0xcbbb('0x2e')]=_[_0xcbbb('0x2d')](_0x4da775[_0xcbbb('0x29')],qs[_0xcbbb('0x2f')](_0x5499a1[_0xcbbb('0x2b')]['fields']));_0x55e1d8[_0xcbbb('0x2e')]=_0x55e1d8[_0xcbbb('0x2e')]['length']?_0x55e1d8[_0xcbbb('0x2e')]:_0x4da775['model'];if(!_0x5499a1[_0xcbbb('0x2b')][_0xcbbb('0x30')](_0xcbbb('0x31'))){_0x55e1d8['limit']=qs[_0xcbbb('0x32')](_0x5499a1[_0xcbbb('0x2b')][_0xcbbb('0x32')]);_0x55e1d8[_0xcbbb('0x1c')]=qs[_0xcbbb('0x1c')](_0x5499a1[_0xcbbb('0x2b')][_0xcbbb('0x1c')]);}_0x55e1d8[_0xcbbb('0x33')]=qs[_0xcbbb('0x34')](_0x5499a1[_0xcbbb('0x2b')]['sort']);_0x55e1d8['where']=qs['filters'](_['pick'](_0x5499a1[_0xcbbb('0x2b')],_0x4da775[_0xcbbb('0x2c')]));if(_0x5499a1[_0xcbbb('0x2b')][_0xcbbb('0x35')]){_0x55e1d8[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x55e1d8[_0xcbbb('0x36')],{'$or':_[_0xcbbb('0x38')](_0x2902c6,function(_0x1ef121){if(_0x1ef121[_0xcbbb('0x39')][_0xcbbb('0x3a')]!==_0xcbbb('0x3b')){var _0x5b62f0={};_0x5b62f0[_0x1ef121['field']]={'$like':'%'+_0x5499a1[_0xcbbb('0x2b')]['filter']+'%'};return _0x5b62f0;}})});}_0x55e1d8=_['merge']({},_0x55e1d8,_0x5499a1['options']);var _0x3c1fb2={'where':_0x55e1d8[_0xcbbb('0x36')]};return db[_0xcbbb('0x27')][_0xcbbb('0x1b')](_0x3c1fb2)[_0xcbbb('0x23')](function(_0x2727f5){_0x21e3b1[_0xcbbb('0x1b')]=_0x2727f5;if(_0x5499a1[_0xcbbb('0x2b')][_0xcbbb('0x3c')]){_0x55e1d8[_0xcbbb('0x3d')]=[{'all':!![]}];}return db[_0xcbbb('0x27')]['findAll'](_0x55e1d8);})[_0xcbbb('0x23')](function(_0x55d349){_0x21e3b1[_0xcbbb('0x3e')]=_0x55d349;return _0x21e3b1;})[_0xcbbb('0x23')](respondWithFilteredResult(_0x4439ea,_0x55e1d8))[_0xcbbb('0x3f')](handleError(_0x4439ea,null));};exports[_0xcbbb('0x40')]=function(_0x433065,_0x3107a6){var _0x5651fd={'raw':!![],'where':{'id':_0x433065['params']['id']}},_0x4d31d2={};_0x4d31d2[_0xcbbb('0x29')]=_[_0xcbbb('0x2a')](db[_0xcbbb('0x27')][_0xcbbb('0x28')]);_0x4d31d2[_0xcbbb('0x2b')]=_[_0xcbbb('0x2a')](_0x433065[_0xcbbb('0x2b')]);_0x4d31d2['filters']=_[_0xcbbb('0x2d')](_0x4d31d2[_0xcbbb('0x29')],_0x4d31d2['query']);_0x5651fd[_0xcbbb('0x2e')]=_[_0xcbbb('0x2d')](_0x4d31d2[_0xcbbb('0x29')],qs[_0xcbbb('0x2f')](_0x433065[_0xcbbb('0x2b')]['fields']));_0x5651fd[_0xcbbb('0x2e')]=_0x5651fd['attributes']['length']?_0x5651fd[_0xcbbb('0x2e')]:_0x4d31d2[_0xcbbb('0x29')];if(_0x433065[_0xcbbb('0x2b')][_0xcbbb('0x3c')]){_0x5651fd[_0xcbbb('0x3d')]=[{'all':!![]}];}_0x5651fd=_[_0xcbbb('0x37')]({},_0x5651fd,_0x433065[_0xcbbb('0x41')]);return db[_0xcbbb('0x27')][_0xcbbb('0x42')](_0x5651fd)[_0xcbbb('0x23')](handleEntityNotFound(_0x3107a6,null))[_0xcbbb('0x23')](respondWithResult(_0x3107a6,null))[_0xcbbb('0x3f')](handleError(_0x3107a6,null));};exports[_0xcbbb('0x43')]=function(_0x667db6,_0x5d1c68){return db[_0xcbbb('0x27')][_0xcbbb('0x43')](_0x667db6[_0xcbbb('0x44')],{})[_0xcbbb('0x23')](respondWithResult(_0x5d1c68,0xc9))['catch'](handleError(_0x5d1c68,null));};exports['update']=function(_0x58ba49,_0x225b58){if(_0x58ba49[_0xcbbb('0x44')]['id']){delete _0x58ba49[_0xcbbb('0x44')]['id'];}return db[_0xcbbb('0x27')][_0xcbbb('0x42')]({'where':{'id':_0x58ba49[_0xcbbb('0x45')]['id']}})[_0xcbbb('0x23')](handleEntityNotFound(_0x225b58,null))['then'](saveUpdates(_0x58ba49[_0xcbbb('0x44')],null))[_0xcbbb('0x23')](respondWithResult(_0x225b58,null))[_0xcbbb('0x3f')](handleError(_0x225b58,null));};exports[_0xcbbb('0x24')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x27')][_0xcbbb('0x42')]({'where':{'id':_0x478c22[_0xcbbb('0x45')]['id']}})['then'](handleEntityNotFound(_0x3378cd,null))['then'](removeEntity(_0x3378cd,null))[_0xcbbb('0x3f')](handleError(_0x3378cd,null));};exports[_0xcbbb('0x46')]=function(_0x3dc052,_0x4bf633){return db['JscriptyQuestionReport']['describe']()[_0xcbbb('0x23')](respondWithResult(_0x4bf633,null))[_0xcbbb('0x3f')](handleError(_0x4bf633,null));}; \ No newline at end of file +var _0x4af8=['reject','save','update','destroy','then','error','stack','name','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','filter','map','key','VIRTUAL','field','options','JscriptyQuestionReport','include','rows','catch','params','includeAll','merge','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x4912c7,_0x330737){var _0x5476b5=function(_0x4052c2){while(--_0x4052c2){_0x4912c7['push'](_0x4912c7['shift']());}};_0x5476b5(++_0x330737);}(_0x4af8,0x1ad));var _0x84af=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x4af8[_0x4ae625];return _0x31accf;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x84af('0x0'));var rp=require(_0x84af('0x1'));var moment=require(_0x84af('0x2'));var BPromise=require(_0x84af('0x3'));var Mustache=require('mustache');var util=require(_0x84af('0x4'));var path=require(_0x84af('0x5'));var sox=require('sox');var csv=require(_0x84af('0x6'));var ejs=require(_0x84af('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x84af('0x8'));var crypto=require(_0x84af('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x84af('0x6'));var querystring=require(_0x84af('0xa'));var Papa=require('papaparse');var authService=require(_0x84af('0xb'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x84af('0xc'));var qs=require(_0x84af('0xd'));var logger=require(_0x84af('0xe'))(_0x84af('0xf'));var utils=require('../../config/utils');var config=require(_0x84af('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0d60,_0xe60937){_0xe60937=_0xe60937||0xcc;return function(_0x588eec){if(_0x588eec){return _0x2a0d60[_0x84af('0x11')](_0xe60937);}return _0x2a0d60[_0x84af('0x12')](_0xe60937)[_0x84af('0x13')]();};}function respondWithResult(_0x427213,_0x4b5186){_0x4b5186=_0x4b5186||0xc8;return function(_0x24fe78){if(_0x24fe78){return _0x427213['status'](_0x4b5186)[_0x84af('0x14')](_0x24fe78);}};}function respondWithFilteredResult(_0x259c47,_0x5f07fc){return function(_0x43449b){if(_0x43449b){var _0x33af0e=_0x43449b[_0x84af('0x15')],_0x49c38d=_0x5f07fc[_0x84af('0x16')],_0x4490a9=_0x5f07fc['offset']+_0x5f07fc['limit'],_0x505476;if(_0x4490a9>=_0x33af0e){_0x4490a9=_0x33af0e;_0x505476=0xc8;}else{_0x505476=0xce;}_0x259c47[_0x84af('0x12')](_0x505476);return _0x259c47[_0x84af('0x17')](_0x84af('0x18'),_0x49c38d+'-'+_0x4490a9+'/'+_0x33af0e)['json'](_0x43449b);}return null;};}function patchUpdates(_0x4d0cf0){return function(_0x187195){try{jsonpatch[_0x84af('0x19')](_0x187195,_0x4d0cf0,!![]);}catch(_0x2a4b34){return BPromise[_0x84af('0x1a')](_0x2a4b34);}return _0x187195[_0x84af('0x1b')]();};}function saveUpdates(_0xad929e,_0x44e19b){return function(_0x334875){if(_0x334875){return _0x334875[_0x84af('0x1c')](_0xad929e)['then'](function(_0x3daf8f){return _0x3daf8f;});}return null;};}function removeEntity(_0x12d0a3,_0x166aac){return function(_0x4ee3d1){if(_0x4ee3d1){return _0x4ee3d1[_0x84af('0x1d')]()[_0x84af('0x1e')](function(){_0x12d0a3[_0x84af('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59df5d,_0x3092f6){return function(_0x2a73ff){if(!_0x2a73ff){_0x59df5d[_0x84af('0x11')](0x194);}return _0x2a73ff;};}function handleError(_0x24aa07,_0x21823e){_0x21823e=_0x21823e||0x1f4;return function(_0x1b23fb){logger[_0x84af('0x1f')](_0x1b23fb[_0x84af('0x20')]);if(_0x1b23fb[_0x84af('0x21')]){delete _0x1b23fb[_0x84af('0x21')];}_0x24aa07[_0x84af('0x12')](_0x21823e)['send'](_0x1b23fb);};}exports[_0x84af('0x22')]=function(_0x418b7c,_0x3b7534){var _0x432d80={},_0x405bfb={},_0x881a95={'count':0x0,'rows':[]};var _0x6e50b=db['JscriptyQuestionReport'][_0x84af('0x23')];_0x405bfb[_0x84af('0x24')]=_['keys'](_0x6e50b);_0x405bfb[_0x84af('0x25')]=_[_0x84af('0x26')](_0x418b7c[_0x84af('0x25')]);_0x405bfb[_0x84af('0x27')]=_['intersection'](_0x405bfb['model'],_0x405bfb[_0x84af('0x25')]);_0x432d80[_0x84af('0x28')]=_[_0x84af('0x29')](_0x405bfb[_0x84af('0x24')],qs[_0x84af('0x2a')](_0x418b7c[_0x84af('0x25')]['fields']));_0x432d80[_0x84af('0x28')]=_0x432d80[_0x84af('0x28')]['length']?_0x432d80[_0x84af('0x28')]:_0x405bfb[_0x84af('0x24')];if(!_0x418b7c['query']['hasOwnProperty'](_0x84af('0x2b'))){_0x432d80['limit']=qs[_0x84af('0x2c')](_0x418b7c[_0x84af('0x25')]['limit']);_0x432d80[_0x84af('0x16')]=qs[_0x84af('0x16')](_0x418b7c[_0x84af('0x25')][_0x84af('0x16')]);}_0x432d80[_0x84af('0x2d')]=qs[_0x84af('0x2e')](_0x418b7c[_0x84af('0x25')][_0x84af('0x2e')]);_0x432d80[_0x84af('0x2f')]=qs[_0x84af('0x27')](_['pick'](_0x418b7c[_0x84af('0x25')],_0x405bfb['filters']));if(_0x418b7c['query'][_0x84af('0x30')]){_0x432d80['where']=_['merge'](_0x432d80[_0x84af('0x2f')],{'$or':_[_0x84af('0x31')](_0x6e50b,function(_0x292a0e){if(_0x292a0e['type'][_0x84af('0x32')]!==_0x84af('0x33')){var _0x4b9888={};_0x4b9888[_0x292a0e[_0x84af('0x34')]]={'$like':'%'+_0x418b7c[_0x84af('0x25')]['filter']+'%'};return _0x4b9888;}})});}_0x432d80=_['merge']({},_0x432d80,_0x418b7c[_0x84af('0x35')]);var _0x48b1f5={'where':_0x432d80[_0x84af('0x2f')]};return db[_0x84af('0x36')]['count'](_0x48b1f5)['then'](function(_0x34e43e){_0x881a95[_0x84af('0x15')]=_0x34e43e;if(_0x418b7c[_0x84af('0x25')]['includeAll']){_0x432d80[_0x84af('0x37')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x432d80);})[_0x84af('0x1e')](function(_0x4dc420){_0x881a95[_0x84af('0x38')]=_0x4dc420;return _0x881a95;})[_0x84af('0x1e')](respondWithFilteredResult(_0x3b7534,_0x432d80))[_0x84af('0x39')](handleError(_0x3b7534,null));};exports['show']=function(_0x255733,_0x372641){var _0x548aa2={'raw':!![],'where':{'id':_0x255733[_0x84af('0x3a')]['id']}},_0x4769ee={};_0x4769ee[_0x84af('0x24')]=_[_0x84af('0x26')](db['JscriptyQuestionReport'][_0x84af('0x23')]);_0x4769ee[_0x84af('0x25')]=_['keys'](_0x255733[_0x84af('0x25')]);_0x4769ee[_0x84af('0x27')]=_[_0x84af('0x29')](_0x4769ee[_0x84af('0x24')],_0x4769ee['query']);_0x548aa2[_0x84af('0x28')]=_[_0x84af('0x29')](_0x4769ee[_0x84af('0x24')],qs[_0x84af('0x2a')](_0x255733[_0x84af('0x25')][_0x84af('0x2a')]));_0x548aa2['attributes']=_0x548aa2[_0x84af('0x28')]['length']?_0x548aa2[_0x84af('0x28')]:_0x4769ee[_0x84af('0x24')];if(_0x255733['query'][_0x84af('0x3b')]){_0x548aa2[_0x84af('0x37')]=[{'all':!![]}];}_0x548aa2=_[_0x84af('0x3c')]({},_0x548aa2,_0x255733[_0x84af('0x35')]);return db[_0x84af('0x36')][_0x84af('0x3d')](_0x548aa2)[_0x84af('0x1e')](handleEntityNotFound(_0x372641,null))[_0x84af('0x1e')](respondWithResult(_0x372641,null))[_0x84af('0x39')](handleError(_0x372641,null));};exports[_0x84af('0x3e')]=function(_0x1026c3,_0x522abf){return db['JscriptyQuestionReport'][_0x84af('0x3e')](_0x1026c3['body'],{})['then'](respondWithResult(_0x522abf,0xc9))['catch'](handleError(_0x522abf,null));};exports[_0x84af('0x1c')]=function(_0x42a681,_0x3b3791){if(_0x42a681[_0x84af('0x3f')]['id']){delete _0x42a681[_0x84af('0x3f')]['id'];}return db[_0x84af('0x36')][_0x84af('0x3d')]({'where':{'id':_0x42a681['params']['id']}})[_0x84af('0x1e')](handleEntityNotFound(_0x3b3791,null))[_0x84af('0x1e')](saveUpdates(_0x42a681['body'],null))[_0x84af('0x1e')](respondWithResult(_0x3b3791,null))[_0x84af('0x39')](handleError(_0x3b3791,null));};exports['destroy']=function(_0x38d333,_0x2cc34a){return db[_0x84af('0x36')][_0x84af('0x3d')]({'where':{'id':_0x38d333[_0x84af('0x3a')]['id']}})[_0x84af('0x1e')](handleEntityNotFound(_0x2cc34a,null))[_0x84af('0x1e')](removeEntity(_0x2cc34a,null))['catch'](handleError(_0x2cc34a,null));};exports[_0x84af('0x40')]=function(_0x58c4d9,_0x13a99c){return db[_0x84af('0x36')][_0x84af('0x40')]()[_0x84af('0x1e')](respondWithResult(_0x13a99c,null))[_0x84af('0x39')](handleError(_0x13a99c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e7248fc..f1fdcf3 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 _0x13e6=['exports','define','JscriptyQuestionReport','lodash','../../config/logger','api','request-promise','./jscriptyQuestionReport.attributes'];(function(_0xfa4453,_0x4e18a2){var _0x2a1704=function(_0x591acf){while(--_0x591acf){_0xfa4453['push'](_0xfa4453['shift']());}};_0x2a1704(++_0x4e18a2);}(_0x13e6,0x1a3));var _0x613e=function(_0x250f1e,_0x38c0aa){_0x250f1e=_0x250f1e-0x0;var _0x4e069a=_0x13e6[_0x250f1e];return _0x4e069a;};'use strict';var _=require(_0x613e('0x0'));var util=require('util');var logger=require(_0x613e('0x1'))(_0x613e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x613e('0x3'));var attributes=require(_0x613e('0x4'));module[_0x613e('0x5')]=function(_0x6a3491,_0x515ca2){return _0x6a3491[_0x613e('0x6')](_0x613e('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x210b=['JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x45aef9,_0x12ab1f){var _0x678851=function(_0x8f59f2){while(--_0x8f59f2){_0x45aef9['push'](_0x45aef9['shift']());}};_0x678851(++_0x12ab1f);}(_0x210b,0xfa));var _0xb210=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x210b[_0x12bcf7];return _0x2825a;};'use strict';var _=require('lodash');var util=require(_0xb210('0x0'));var logger=require(_0xb210('0x1'))('api');var moment=require(_0xb210('0x2'));var BPromise=require(_0xb210('0x3'));var rp=require(_0xb210('0x4'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xb210('0x5')]=function(_0x593960,_0x1d1594){return _0x593960['define'](_0xb210('0x6'),attributes,{'tableName':_0xb210('0x7'),'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 1decfcc..dec57c3 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 _0x9b66=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x3aaf3b,_0x32cdb0){var _0x5129cd=function(_0x1427f9){while(--_0x1427f9){_0x3aaf3b['push'](_0x3aaf3b['shift']());}};_0x5129cd(++_0x32cdb0);}(_0x9b66,0xab));var _0x69b6=function(_0x242177,_0x1e7684){_0x242177=_0x242177-0x0;var _0x18821c=_0x9b66[_0x242177];return _0x18821c;};'use strict';var _=require(_0x69b6('0x0'));var util=require(_0x69b6('0x1'));var moment=require('moment');var BPromise=require(_0x69b6('0x2'));var rs=require(_0x69b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69b6('0x4'))['db'];var utils=require(_0x69b6('0x5'));var logger=require(_0x69b6('0x6'))(_0x69b6('0x7'));var config=require('../../config/environment');var jayson=require(_0x69b6('0x8'));var client=jayson[_0x69b6('0x9')][_0x69b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cd155,_0x34a826,_0x5319c5){return new BPromise(function(_0x11434e,_0x5eb295){return client[_0x69b6('0xb')](_0x4cd155,_0x5319c5)['then'](function(_0x5d06f8){logger[_0x69b6('0xc')](_0x69b6('0xd'),_0x34a826,_0x69b6('0xe'));logger[_0x69b6('0xf')](_0x69b6('0x10'),_0x34a826,_0x69b6('0xe'),JSON[_0x69b6('0x11')](_0x5d06f8));if(_0x5d06f8[_0x69b6('0x12')]){if(_0x5d06f8['error'][_0x69b6('0x13')]===0x1f4){logger['error'](_0x69b6('0xd'),_0x34a826,_0x5d06f8[_0x69b6('0x12')][_0x69b6('0x14')]);return _0x5eb295(_0x5d06f8['error'][_0x69b6('0x14')]);}logger[_0x69b6('0x12')](_0x69b6('0xd'),_0x34a826,_0x5d06f8['error']['message']);return _0x11434e(_0x5d06f8[_0x69b6('0x12')][_0x69b6('0x14')]);}else{logger[_0x69b6('0xc')](_0x69b6('0xd'),_0x34a826,_0x69b6('0xe'));_0x11434e(_0x5d06f8[_0x69b6('0x15')]['message']);}})['catch'](function(_0x41a63c){logger[_0x69b6('0x12')](_0x69b6('0xd'),_0x34a826,_0x41a63c);_0x5eb295(_0x41a63c);});});} \ No newline at end of file +var _0x8d3e=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x41cac3,_0x26aadf){var _0x5b6ad9=function(_0x5f1ed7){while(--_0x5f1ed7){_0x41cac3['push'](_0x41cac3['shift']());}};_0x5b6ad9(++_0x26aadf);}(_0x8d3e,0x198));var _0xe8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8d3('0x0'));var util=require(_0xe8d3('0x1'));var moment=require(_0xe8d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8d3('0x3'));var fs=require('fs');var Redis=require(_0xe8d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8d3('0x5'));var logger=require(_0xe8d3('0x6'))(_0xe8d3('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8d3('0x8'));var client=jayson[_0xe8d3('0x9')][_0xe8d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b6784,_0x57d7c1,_0x825ee9){return new BPromise(function(_0x17f113,_0x58f76f){return client[_0xe8d3('0xb')](_0x2b6784,_0x825ee9)[_0xe8d3('0xc')](function(_0x385c87){logger[_0xe8d3('0xd')](_0xe8d3('0xe'),_0x57d7c1,_0xe8d3('0xf'));logger[_0xe8d3('0x10')](_0xe8d3('0x11'),_0x57d7c1,_0xe8d3('0xf'),JSON[_0xe8d3('0x12')](_0x385c87));if(_0x385c87[_0xe8d3('0x13')]){if(_0x385c87['error']['code']===0x1f4){logger[_0xe8d3('0x13')](_0xe8d3('0xe'),_0x57d7c1,_0x385c87[_0xe8d3('0x13')][_0xe8d3('0x14')]);return _0x58f76f(_0x385c87[_0xe8d3('0x13')]['message']);}logger['error'](_0xe8d3('0xe'),_0x57d7c1,_0x385c87[_0xe8d3('0x13')][_0xe8d3('0x14')]);return _0x17f113(_0x385c87[_0xe8d3('0x13')][_0xe8d3('0x14')]);}else{logger['info'](_0xe8d3('0xe'),_0x57d7c1,_0xe8d3('0xf'));_0x17f113(_0x385c87['result'][_0xe8d3('0x14')]);}})[_0xe8d3('0x15')](function(_0x127dee){logger[_0xe8d3('0x13')](_0xe8d3('0xe'),_0x57d7c1,_0x127dee);_0x58f76f(_0x127dee);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a7504ec..d3ff5c0 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 _0x99f7=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','getQuestions','post','create','put','update','destroy','exports','util'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x99f7,0x9f));var _0x799f=function(_0xca0542,_0xda307d){_0xca0542=_0xca0542-0x0;var _0x52ee5c=_0x99f7[_0xca0542];return _0x52ee5c;};'use strict';var multer=require('multer');var util=require(_0x799f('0x0'));var path=require(_0x799f('0x1'));var timeout=require(_0x799f('0x2'));var express=require(_0x799f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x799f('0x4'));var config=require(_0x799f('0x5'));var controller=require(_0x799f('0x6'));router[_0x799f('0x7')]('/',auth['isAuthenticated'](),controller[_0x799f('0x8')]);router[_0x799f('0x7')](_0x799f('0x9'),auth['isAuthenticated'](),controller[_0x799f('0xa')]);router[_0x799f('0x7')](_0x799f('0xb'),auth[_0x799f('0xc')](),controller['show']);router['get']('/:id/questions',auth[_0x799f('0xc')](),controller[_0x799f('0xd')]);router[_0x799f('0xe')]('/',auth[_0x799f('0xc')](),controller[_0x799f('0xf')]);router[_0x799f('0x10')]('/:id',auth[_0x799f('0xc')](),controller[_0x799f('0x11')]);router['delete'](_0x799f('0xb'),auth[_0x799f('0xc')](),controller[_0x799f('0x12')]);module[_0x799f('0x13')]=router; \ No newline at end of file +var _0x2843=['isAuthenticated','describe','show','getQuestions','post','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','get','/describe'];(function(_0x47b107,_0x40d5e6){var _0xd19c2=function(_0x1209a5){while(--_0x1209a5){_0x47b107['push'](_0x47b107['shift']());}};_0xd19c2(++_0x40d5e6);}(_0x2843,0xe9));var _0x3284=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x2843[_0x333798];return _0x389f4e;};'use strict';var multer=require(_0x3284('0x0'));var util=require(_0x3284('0x1'));var path=require(_0x3284('0x2'));var timeout=require(_0x3284('0x3'));var express=require(_0x3284('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x3284('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3284('0x5')](_0x3284('0x6'),auth[_0x3284('0x7')](),controller[_0x3284('0x8')]);router[_0x3284('0x5')]('/:id',auth[_0x3284('0x7')](),controller[_0x3284('0x9')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller[_0x3284('0xa')]);router[_0x3284('0xb')]('/',auth[_0x3284('0x7')](),controller['create']);router[_0x3284('0xc')](_0x3284('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3284('0xd'),auth[_0x3284('0x7')](),controller[_0x3284('0xe')]);module[_0x3284('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index bb8be78..73f724b 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 _0x5ec6=['sequelize','exports','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x5ec6,0x7f));var _0x65ec=function(_0xed85ce,_0x1815d3){_0xed85ce=_0xed85ce-0x0;var _0x25cc1c=_0x5ec6[_0xed85ce];return _0x25cc1c;};'use strict';var moment=require(_0x65ec('0x0'));var Sequelize=require(_0x65ec('0x1'));module[_0x65ec('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1b924d){this['setDataValue'](_0x65ec('0x3'),_0x1b924d);this['setDataValue'](_0x65ec('0x4'),moment()['format'](_0x65ec('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x65ec('0x6')]},'projectname':{'type':Sequelize[_0x65ec('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x65ec('0x6')]},'calleridname':{'type':Sequelize[_0x65ec('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x65ec('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x7cc4=['setDataValue','starttime','format','STRING','sequelize','exports','DATE'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x7cc4,0x1a8));var _0x47cc=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x7cc4[_0x602ca8];return _0x26e8ab;};'use strict';var moment=require('moment');var Sequelize=require(_0x47cc('0x0'));module[_0x47cc('0x1')]={'starttime':{'type':Sequelize[_0x47cc('0x2')],'set':function(_0x1e7bbf){this[_0x47cc('0x3')](_0x47cc('0x4'),_0x1e7bbf);this[_0x47cc('0x3')]('endtime',moment()[_0x47cc('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x47cc('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47cc('0x6')]},'uniqueid':{'type':Sequelize[_0x47cc('0x6')]},'calleridname':{'type':Sequelize[_0x47cc('0x6')]},'calleridnum':{'type':Sequelize[_0x47cc('0x6')]},'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 3058832..d3d979a 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 _0xd76e=['rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','map','type','key','merge','options','includeAll','show','params','length','include','find','catch','body','describe','getQuestions','pick','SessionId','JscriptyQuestionReport','findAll','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','count','offset','json','apply','reject','save','update','destroy','then','end','sendStatus','name','send','index','JscriptySessionReport'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xd76e,0x18f));var _0xed76=function(_0x35c0e4,_0x4afecb){_0x35c0e4=_0x35c0e4-0x0;var _0x2c64fe=_0xd76e[_0x35c0e4];return _0x2c64fe;};'use strict';var pdf=require(_0xed76('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed76('0x1'));var jsonpatch=require(_0xed76('0x2'));var rp=require(_0xed76('0x3'));var moment=require('moment');var BPromise=require(_0xed76('0x4'));var Mustache=require(_0xed76('0x5'));var util=require(_0xed76('0x6'));var path=require(_0xed76('0x7'));var sox=require('sox');var csv=require(_0xed76('0x8'));var ejs=require(_0xed76('0x9'));var fs=require('fs');var _=require(_0xed76('0xa'));var squel=require(_0xed76('0xb'));var crypto=require(_0xed76('0xc'));var jsforce=require(_0xed76('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xed76('0x8'));var querystring=require(_0xed76('0xe'));var Papa=require(_0xed76('0xf'));var authService=require(_0xed76('0x10'));var hardwareService=require(_0xed76('0x11'));var Redis=require(_0xed76('0x12'));var qs=require(_0xed76('0x13'));var logger=require(_0xed76('0x14'))(_0xed76('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xed76('0x16'))['db'];function respondWithStatusCode(_0x422aa3,_0x27fe2f){_0x27fe2f=_0x27fe2f||0xcc;return function(_0x1c9e7a){if(_0x1c9e7a){return _0x422aa3['sendStatus'](_0x27fe2f);}return _0x422aa3['status'](_0x27fe2f)['end']();};}function respondWithResult(_0x5e53b2,_0x54d08c){_0x54d08c=_0x54d08c||0xc8;return function(_0x19b6eb){if(_0x19b6eb){return _0x5e53b2[_0xed76('0x17')](_0x54d08c)['json'](_0x19b6eb);}};}function respondWithFilteredResult(_0x1acc5a,_0x21852f){return function(_0x24cb22){if(_0x24cb22){var _0x309d1f=_0x24cb22[_0xed76('0x18')],_0x2179e=_0x21852f[_0xed76('0x19')],_0x29a798=_0x21852f[_0xed76('0x19')]+_0x21852f['limit'],_0x2db6f2;if(_0x29a798>=_0x309d1f){_0x29a798=_0x309d1f;_0x2db6f2=0xc8;}else{_0x2db6f2=0xce;}_0x1acc5a['status'](_0x2db6f2);return _0x1acc5a['set']('Content-Range',_0x2179e+'-'+_0x29a798+'/'+_0x309d1f)[_0xed76('0x1a')](_0x24cb22);}return null;};}function patchUpdates(_0x318d4b){return function(_0x33f0ad){try{jsonpatch[_0xed76('0x1b')](_0x33f0ad,_0x318d4b,!![]);}catch(_0x55a99a){return BPromise[_0xed76('0x1c')](_0x55a99a);}return _0x33f0ad[_0xed76('0x1d')]();};}function saveUpdates(_0x33f008,_0x1a8725){return function(_0x285f9d){if(_0x285f9d){return _0x285f9d[_0xed76('0x1e')](_0x33f008)['then'](function(_0x587f7f){return _0x587f7f;});}return null;};}function removeEntity(_0x11c081,_0x425e57){return function(_0x1f6ede){if(_0x1f6ede){return _0x1f6ede[_0xed76('0x1f')]()[_0xed76('0x20')](function(){_0x11c081[_0xed76('0x17')](0xcc)[_0xed76('0x21')]();});}};}function handleEntityNotFound(_0x37bead,_0x45ce10){return function(_0x50776b){if(!_0x50776b){_0x37bead[_0xed76('0x22')](0x194);}return _0x50776b;};}function handleError(_0x1e1e2b,_0x55f1e0){_0x55f1e0=_0x55f1e0||0x1f4;return function(_0x4f7887){logger['error'](_0x4f7887['stack']);if(_0x4f7887[_0xed76('0x23')]){delete _0x4f7887['name'];}_0x1e1e2b[_0xed76('0x17')](_0x55f1e0)[_0xed76('0x24')](_0x4f7887);};}exports[_0xed76('0x25')]=function(_0x5f06dc,_0x57b5ba){var _0x4a6cf7={},_0x247953={},_0x3dd29e={'count':0x0,'rows':[]};var _0x3560ae=db[_0xed76('0x26')][_0xed76('0x27')];_0x247953[_0xed76('0x28')]=_[_0xed76('0x29')](_0x3560ae);_0x247953[_0xed76('0x2a')]=_['keys'](_0x5f06dc[_0xed76('0x2a')]);_0x247953['filters']=_[_0xed76('0x2b')](_0x247953['model'],_0x247953[_0xed76('0x2a')]);_0x4a6cf7[_0xed76('0x2c')]=_[_0xed76('0x2b')](_0x247953['model'],qs[_0xed76('0x2d')](_0x5f06dc['query'][_0xed76('0x2d')]));_0x4a6cf7[_0xed76('0x2c')]=_0x4a6cf7[_0xed76('0x2c')]['length']?_0x4a6cf7[_0xed76('0x2c')]:_0x247953[_0xed76('0x28')];if(!_0x5f06dc[_0xed76('0x2a')][_0xed76('0x2e')](_0xed76('0x2f'))){_0x4a6cf7[_0xed76('0x30')]=qs[_0xed76('0x30')](_0x5f06dc[_0xed76('0x2a')][_0xed76('0x30')]);_0x4a6cf7[_0xed76('0x19')]=qs[_0xed76('0x19')](_0x5f06dc[_0xed76('0x2a')]['offset']);}_0x4a6cf7[_0xed76('0x31')]=qs[_0xed76('0x32')](_0x5f06dc[_0xed76('0x2a')]['sort']);_0x4a6cf7[_0xed76('0x33')]=qs[_0xed76('0x34')](_['pick'](_0x5f06dc[_0xed76('0x2a')],_0x247953[_0xed76('0x34')]));if(_0x5f06dc[_0xed76('0x2a')][_0xed76('0x35')]){_0x4a6cf7[_0xed76('0x33')]=_['merge'](_0x4a6cf7[_0xed76('0x33')],{'$or':_[_0xed76('0x36')](_0x3560ae,function(_0x2c98e7){if(_0x2c98e7[_0xed76('0x37')][_0xed76('0x38')]!=='VIRTUAL'){var _0x25eb1c={};_0x25eb1c[_0x2c98e7['field']]={'$like':'%'+_0x5f06dc[_0xed76('0x2a')][_0xed76('0x35')]+'%'};return _0x25eb1c;}})});}_0x4a6cf7=_[_0xed76('0x39')]({},_0x4a6cf7,_0x5f06dc[_0xed76('0x3a')]);var _0x486d3d={'where':_0x4a6cf7[_0xed76('0x33')]};return db[_0xed76('0x26')][_0xed76('0x18')](_0x486d3d)[_0xed76('0x20')](function(_0x210fa9){_0x3dd29e['count']=_0x210fa9;if(_0x5f06dc[_0xed76('0x2a')][_0xed76('0x3b')]){_0x4a6cf7['include']=[{'all':!![]}];}return db[_0xed76('0x26')]['findAll'](_0x4a6cf7);})[_0xed76('0x20')](function(_0x5f1da8){_0x3dd29e['rows']=_0x5f1da8;return _0x3dd29e;})['then'](respondWithFilteredResult(_0x57b5ba,_0x4a6cf7))['catch'](handleError(_0x57b5ba,null));};exports[_0xed76('0x3c')]=function(_0x1755c1,_0x145f8d){var _0x284f02={'raw':!![],'where':{'id':_0x1755c1[_0xed76('0x3d')]['id']}},_0x3c6edf={};_0x3c6edf['model']=_[_0xed76('0x29')](db[_0xed76('0x26')]['rawAttributes']);_0x3c6edf[_0xed76('0x2a')]=_[_0xed76('0x29')](_0x1755c1[_0xed76('0x2a')]);_0x3c6edf[_0xed76('0x34')]=_[_0xed76('0x2b')](_0x3c6edf[_0xed76('0x28')],_0x3c6edf['query']);_0x284f02[_0xed76('0x2c')]=_['intersection'](_0x3c6edf['model'],qs[_0xed76('0x2d')](_0x1755c1[_0xed76('0x2a')]['fields']));_0x284f02[_0xed76('0x2c')]=_0x284f02['attributes'][_0xed76('0x3e')]?_0x284f02['attributes']:_0x3c6edf[_0xed76('0x28')];if(_0x1755c1['query'][_0xed76('0x3b')]){_0x284f02[_0xed76('0x3f')]=[{'all':!![]}];}_0x284f02=_[_0xed76('0x39')]({},_0x284f02,_0x1755c1[_0xed76('0x3a')]);return db['JscriptySessionReport'][_0xed76('0x40')](_0x284f02)[_0xed76('0x20')](handleEntityNotFound(_0x145f8d,null))['then'](respondWithResult(_0x145f8d,null))[_0xed76('0x41')](handleError(_0x145f8d,null));};exports['create']=function(_0x36613c,_0x4c8b08){return db[_0xed76('0x26')]['create'](_0x36613c[_0xed76('0x42')],{})['then'](respondWithResult(_0x4c8b08,0xc9))[_0xed76('0x41')](handleError(_0x4c8b08,null));};exports[_0xed76('0x1e')]=function(_0x269872,_0x555250){if(_0x269872[_0xed76('0x42')]['id']){delete _0x269872['body']['id'];}return db[_0xed76('0x26')][_0xed76('0x40')]({'where':{'id':_0x269872[_0xed76('0x3d')]['id']}})[_0xed76('0x20')](handleEntityNotFound(_0x555250,null))['then'](saveUpdates(_0x269872[_0xed76('0x42')],null))['then'](respondWithResult(_0x555250,null))[_0xed76('0x41')](handleError(_0x555250,null));};exports[_0xed76('0x1f')]=function(_0x2fc137,_0x1dad3c){return db[_0xed76('0x26')][_0xed76('0x40')]({'where':{'id':_0x2fc137[_0xed76('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1dad3c,null))[_0xed76('0x20')](removeEntity(_0x1dad3c,null))['catch'](handleError(_0x1dad3c,null));};exports['describe']=function(_0x1c1bd2,_0x3aaca7){return db[_0xed76('0x26')][_0xed76('0x43')]()[_0xed76('0x20')](respondWithResult(_0x3aaca7,null))[_0xed76('0x41')](handleError(_0x3aaca7,null));};exports[_0xed76('0x44')]=function(_0x507178,_0x104d73,_0x4ee024){var _0x32fb27={'raw':!![],'where':{}};var _0x4c93cc={};var _0x17ce06={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x507178[_0xed76('0x3d')]['id']}})['then'](handleEntityNotFound(_0x104d73,null))[_0xed76('0x20')](function(_0x6d2ba0){if(_0x6d2ba0){_0x4c93cc['model']=_[_0xed76('0x29')](db['JscriptyQuestionReport'][_0xed76('0x27')]);_0x4c93cc['query']=_[_0xed76('0x29')](_0x507178[_0xed76('0x2a')]);_0x4c93cc[_0xed76('0x34')]=_[_0xed76('0x2b')](_0x4c93cc[_0xed76('0x28')],_0x4c93cc[_0xed76('0x2a')]);_0x32fb27[_0xed76('0x2c')]=_[_0xed76('0x2b')](_0x4c93cc[_0xed76('0x28')],qs['fields'](_0x507178['query'][_0xed76('0x2d')]));_0x32fb27['attributes']=_0x32fb27[_0xed76('0x2c')][_0xed76('0x3e')]?_0x32fb27[_0xed76('0x2c')]:_0x4c93cc[_0xed76('0x28')];if(!_0x507178[_0xed76('0x2a')][_0xed76('0x2e')](_0xed76('0x2f'))){_0x32fb27['limit']=qs['limit'](_0x507178['query'][_0xed76('0x30')]);_0x32fb27[_0xed76('0x19')]=qs['offset'](_0x507178[_0xed76('0x2a')][_0xed76('0x19')]);}_0x32fb27[_0xed76('0x31')]=qs[_0xed76('0x32')](_0x507178[_0xed76('0x2a')][_0xed76('0x32')]);_0x32fb27[_0xed76('0x33')]=qs[_0xed76('0x34')](_[_0xed76('0x45')](_0x507178['query'],_0x4c93cc['filters']));_0x32fb27[_0xed76('0x33')][_0xed76('0x46')]=_0x6d2ba0['id'];if(_0x507178[_0xed76('0x2a')][_0xed76('0x35')]){_0x32fb27['where']=_[_0xed76('0x39')](_0x32fb27[_0xed76('0x33')],{'$or':_[_0xed76('0x36')](_0x32fb27[_0xed76('0x2c')],function(_0x486bc0){var _0x2a0c3c={};_0x2a0c3c[_0x486bc0]={'$like':'%'+_0x507178['query'][_0xed76('0x35')]+'%'};return _0x2a0c3c;})});}_0x32fb27=_[_0xed76('0x39')]({},_0x32fb27,_0x507178[_0xed76('0x3a')]);return db[_0xed76('0x47')][_0xed76('0x18')]({'where':_0x32fb27[_0xed76('0x33')]})[_0xed76('0x20')](function(_0x4b2b54){_0x17ce06[_0xed76('0x18')]=_0x4b2b54;if(_0x507178['query'][_0xed76('0x3b')]){_0x32fb27[_0xed76('0x3f')]=[{'all':!![]}];}return db[_0xed76('0x47')][_0xed76('0x48')](_0x32fb27);})[_0xed76('0x20')](function(_0x415737){_0x17ce06['rows']=_0x415737;return _0x17ce06;});}})['then'](respondWithFilteredResult(_0x104d73,_0x32fb27))[_0xed76('0x41')](handleError(_0x104d73,null));}; \ No newline at end of file +var _0xe6a8=['limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','JscriptySessionReport','include','findAll','catch','show','includeAll','create','body','find','params','getQuestions','findOne','JscriptyQuestionReport','nolimit','map','rows','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','set','json','reject','save','update','destroy','then','error','stack','name','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length'];(function(_0x4f9cca,_0x297dbb){var _0x299852=function(_0x2f7621){while(--_0x2f7621){_0x4f9cca['push'](_0x4f9cca['shift']());}};_0x299852(++_0x297dbb);}(_0xe6a8,0x193));var _0x8e6a=function(_0x2ef56f,_0xeed987){_0x2ef56f=_0x2ef56f-0x0;var _0x56947f=_0xe6a8[_0x2ef56f];return _0x56947f;};'use strict';var pdf=require(_0x8e6a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8e6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e6a('0x2'));var rp=require(_0x8e6a('0x3'));var moment=require(_0x8e6a('0x4'));var BPromise=require(_0x8e6a('0x5'));var Mustache=require(_0x8e6a('0x6'));var util=require(_0x8e6a('0x7'));var path=require(_0x8e6a('0x8'));var sox=require('sox');var csv=require(_0x8e6a('0x9'));var ejs=require(_0x8e6a('0xa'));var fs=require('fs');var _=require(_0x8e6a('0xb'));var squel=require(_0x8e6a('0xc'));var crypto=require(_0x8e6a('0xd'));var jsforce=require(_0x8e6a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8e6a('0x9'));var querystring=require(_0x8e6a('0xf'));var Papa=require(_0x8e6a('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8e6a('0x11'));var Redis=require(_0x8e6a('0x12'));var qs=require(_0x8e6a('0x13'));var logger=require(_0x8e6a('0x14'))(_0x8e6a('0x15'));var utils=require(_0x8e6a('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521b18,_0x57e097){_0x57e097=_0x57e097||0xcc;return function(_0x3c1dc2){if(_0x3c1dc2){return _0x521b18[_0x8e6a('0x17')](_0x57e097);}return _0x521b18[_0x8e6a('0x18')](_0x57e097)[_0x8e6a('0x19')]();};}function respondWithResult(_0x3a693d,_0x240453){_0x240453=_0x240453||0xc8;return function(_0x584955){if(_0x584955){return _0x3a693d[_0x8e6a('0x18')](_0x240453)['json'](_0x584955);}};}function respondWithFilteredResult(_0x4c6db9,_0x25a9e9){return function(_0x351278){if(_0x351278){var _0x33bd16=_0x351278[_0x8e6a('0x1a')],_0x5cc57d=_0x25a9e9[_0x8e6a('0x1b')],_0x244a71=_0x25a9e9[_0x8e6a('0x1b')]+_0x25a9e9['limit'],_0x25dd77;if(_0x244a71>=_0x33bd16){_0x244a71=_0x33bd16;_0x25dd77=0xc8;}else{_0x25dd77=0xce;}_0x4c6db9[_0x8e6a('0x18')](_0x25dd77);return _0x4c6db9[_0x8e6a('0x1c')]('Content-Range',_0x5cc57d+'-'+_0x244a71+'/'+_0x33bd16)[_0x8e6a('0x1d')](_0x351278);}return null;};}function patchUpdates(_0x3bfe79){return function(_0x35183f){try{jsonpatch['apply'](_0x35183f,_0x3bfe79,!![]);}catch(_0x53499a){return BPromise[_0x8e6a('0x1e')](_0x53499a);}return _0x35183f[_0x8e6a('0x1f')]();};}function saveUpdates(_0x31c5f4,_0x4e4ba0){return function(_0x4ded7a){if(_0x4ded7a){return _0x4ded7a[_0x8e6a('0x20')](_0x31c5f4)['then'](function(_0x3ed345){return _0x3ed345;});}return null;};}function removeEntity(_0x38c0fb,_0x13410e){return function(_0x17095a){if(_0x17095a){return _0x17095a[_0x8e6a('0x21')]()[_0x8e6a('0x22')](function(){_0x38c0fb[_0x8e6a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d583d,_0x3d54f2){return function(_0x402ff0){if(!_0x402ff0){_0x5d583d[_0x8e6a('0x17')](0x194);}return _0x402ff0;};}function handleError(_0x263373,_0x2370be){_0x2370be=_0x2370be||0x1f4;return function(_0x4189c5){logger[_0x8e6a('0x23')](_0x4189c5[_0x8e6a('0x24')]);if(_0x4189c5['name']){delete _0x4189c5[_0x8e6a('0x25')];}_0x263373[_0x8e6a('0x18')](_0x2370be)['send'](_0x4189c5);};}exports['index']=function(_0x3cf146,_0xc016a9){var _0x326d8c={},_0x1d50bc={},_0xb26ac={'count':0x0,'rows':[]};var _0x33aff5=db['JscriptySessionReport'][_0x8e6a('0x26')];_0x1d50bc['model']=_[_0x8e6a('0x27')](_0x33aff5);_0x1d50bc[_0x8e6a('0x28')]=_[_0x8e6a('0x27')](_0x3cf146[_0x8e6a('0x28')]);_0x1d50bc[_0x8e6a('0x29')]=_[_0x8e6a('0x2a')](_0x1d50bc[_0x8e6a('0x2b')],_0x1d50bc[_0x8e6a('0x28')]);_0x326d8c[_0x8e6a('0x2c')]=_[_0x8e6a('0x2a')](_0x1d50bc['model'],qs[_0x8e6a('0x2d')](_0x3cf146[_0x8e6a('0x28')]['fields']));_0x326d8c[_0x8e6a('0x2c')]=_0x326d8c[_0x8e6a('0x2c')][_0x8e6a('0x2e')]?_0x326d8c[_0x8e6a('0x2c')]:_0x1d50bc['model'];if(!_0x3cf146[_0x8e6a('0x28')]['hasOwnProperty']('nolimit')){_0x326d8c[_0x8e6a('0x2f')]=qs[_0x8e6a('0x2f')](_0x3cf146[_0x8e6a('0x28')][_0x8e6a('0x2f')]);_0x326d8c['offset']=qs['offset'](_0x3cf146[_0x8e6a('0x28')]['offset']);}_0x326d8c[_0x8e6a('0x30')]=qs[_0x8e6a('0x31')](_0x3cf146[_0x8e6a('0x28')][_0x8e6a('0x31')]);_0x326d8c[_0x8e6a('0x32')]=qs['filters'](_[_0x8e6a('0x33')](_0x3cf146[_0x8e6a('0x28')],_0x1d50bc['filters']));if(_0x3cf146[_0x8e6a('0x28')][_0x8e6a('0x34')]){_0x326d8c[_0x8e6a('0x32')]=_[_0x8e6a('0x35')](_0x326d8c[_0x8e6a('0x32')],{'$or':_['map'](_0x33aff5,function(_0x270d26){if(_0x270d26[_0x8e6a('0x36')][_0x8e6a('0x37')]!==_0x8e6a('0x38')){var _0x43d1cb={};_0x43d1cb[_0x270d26[_0x8e6a('0x39')]]={'$like':'%'+_0x3cf146[_0x8e6a('0x28')]['filter']+'%'};return _0x43d1cb;}})});}_0x326d8c=_[_0x8e6a('0x35')]({},_0x326d8c,_0x3cf146[_0x8e6a('0x3a')]);var _0x53bb30={'where':_0x326d8c[_0x8e6a('0x32')]};return db[_0x8e6a('0x3b')][_0x8e6a('0x1a')](_0x53bb30)['then'](function(_0x28c1f0){_0xb26ac[_0x8e6a('0x1a')]=_0x28c1f0;if(_0x3cf146['query']['includeAll']){_0x326d8c[_0x8e6a('0x3c')]=[{'all':!![]}];}return db[_0x8e6a('0x3b')][_0x8e6a('0x3d')](_0x326d8c);})[_0x8e6a('0x22')](function(_0x5e431e){_0xb26ac['rows']=_0x5e431e;return _0xb26ac;})[_0x8e6a('0x22')](respondWithFilteredResult(_0xc016a9,_0x326d8c))[_0x8e6a('0x3e')](handleError(_0xc016a9,null));};exports[_0x8e6a('0x3f')]=function(_0x3e9904,_0xce3693){var _0x410c46={'raw':!![],'where':{'id':_0x3e9904['params']['id']}},_0x1f80d3={};_0x1f80d3[_0x8e6a('0x2b')]=_['keys'](db[_0x8e6a('0x3b')][_0x8e6a('0x26')]);_0x1f80d3['query']=_[_0x8e6a('0x27')](_0x3e9904[_0x8e6a('0x28')]);_0x1f80d3[_0x8e6a('0x29')]=_[_0x8e6a('0x2a')](_0x1f80d3['model'],_0x1f80d3[_0x8e6a('0x28')]);_0x410c46[_0x8e6a('0x2c')]=_[_0x8e6a('0x2a')](_0x1f80d3['model'],qs[_0x8e6a('0x2d')](_0x3e9904['query']['fields']));_0x410c46[_0x8e6a('0x2c')]=_0x410c46[_0x8e6a('0x2c')][_0x8e6a('0x2e')]?_0x410c46[_0x8e6a('0x2c')]:_0x1f80d3[_0x8e6a('0x2b')];if(_0x3e9904[_0x8e6a('0x28')][_0x8e6a('0x40')]){_0x410c46[_0x8e6a('0x3c')]=[{'all':!![]}];}_0x410c46=_['merge']({},_0x410c46,_0x3e9904[_0x8e6a('0x3a')]);return db[_0x8e6a('0x3b')]['find'](_0x410c46)[_0x8e6a('0x22')](handleEntityNotFound(_0xce3693,null))[_0x8e6a('0x22')](respondWithResult(_0xce3693,null))[_0x8e6a('0x3e')](handleError(_0xce3693,null));};exports[_0x8e6a('0x41')]=function(_0x1909ab,_0x59989d){return db[_0x8e6a('0x3b')]['create'](_0x1909ab[_0x8e6a('0x42')],{})['then'](respondWithResult(_0x59989d,0xc9))[_0x8e6a('0x3e')](handleError(_0x59989d,null));};exports['update']=function(_0x16a669,_0xa73f15){if(_0x16a669[_0x8e6a('0x42')]['id']){delete _0x16a669[_0x8e6a('0x42')]['id'];}return db[_0x8e6a('0x3b')][_0x8e6a('0x43')]({'where':{'id':_0x16a669[_0x8e6a('0x44')]['id']}})[_0x8e6a('0x22')](handleEntityNotFound(_0xa73f15,null))[_0x8e6a('0x22')](saveUpdates(_0x16a669['body'],null))[_0x8e6a('0x22')](respondWithResult(_0xa73f15,null))[_0x8e6a('0x3e')](handleError(_0xa73f15,null));};exports['destroy']=function(_0x12f179,_0x3cffed){return db[_0x8e6a('0x3b')][_0x8e6a('0x43')]({'where':{'id':_0x12f179[_0x8e6a('0x44')]['id']}})[_0x8e6a('0x22')](handleEntityNotFound(_0x3cffed,null))['then'](removeEntity(_0x3cffed,null))[_0x8e6a('0x3e')](handleError(_0x3cffed,null));};exports['describe']=function(_0x47f99b,_0xeda911){return db['JscriptySessionReport']['describe']()[_0x8e6a('0x22')](respondWithResult(_0xeda911,null))[_0x8e6a('0x3e')](handleError(_0xeda911,null));};exports[_0x8e6a('0x45')]=function(_0x579e5c,_0x27400c,_0x57617f){var _0x1726ed={'raw':!![],'where':{}};var _0x477c5c={};var _0x500e81={'count':0x0,'rows':[]};return db[_0x8e6a('0x3b')][_0x8e6a('0x46')]({'where':{'id':_0x579e5c[_0x8e6a('0x44')]['id']}})[_0x8e6a('0x22')](handleEntityNotFound(_0x27400c,null))[_0x8e6a('0x22')](function(_0x2d1e49){if(_0x2d1e49){_0x477c5c[_0x8e6a('0x2b')]=_[_0x8e6a('0x27')](db[_0x8e6a('0x47')]['rawAttributes']);_0x477c5c[_0x8e6a('0x28')]=_[_0x8e6a('0x27')](_0x579e5c['query']);_0x477c5c[_0x8e6a('0x29')]=_[_0x8e6a('0x2a')](_0x477c5c[_0x8e6a('0x2b')],_0x477c5c[_0x8e6a('0x28')]);_0x1726ed['attributes']=_[_0x8e6a('0x2a')](_0x477c5c[_0x8e6a('0x2b')],qs[_0x8e6a('0x2d')](_0x579e5c[_0x8e6a('0x28')][_0x8e6a('0x2d')]));_0x1726ed[_0x8e6a('0x2c')]=_0x1726ed[_0x8e6a('0x2c')][_0x8e6a('0x2e')]?_0x1726ed['attributes']:_0x477c5c['model'];if(!_0x579e5c[_0x8e6a('0x28')]['hasOwnProperty'](_0x8e6a('0x48'))){_0x1726ed[_0x8e6a('0x2f')]=qs[_0x8e6a('0x2f')](_0x579e5c[_0x8e6a('0x28')][_0x8e6a('0x2f')]);_0x1726ed[_0x8e6a('0x1b')]=qs['offset'](_0x579e5c['query']['offset']);}_0x1726ed['order']=qs['sort'](_0x579e5c[_0x8e6a('0x28')]['sort']);_0x1726ed['where']=qs[_0x8e6a('0x29')](_[_0x8e6a('0x33')](_0x579e5c[_0x8e6a('0x28')],_0x477c5c[_0x8e6a('0x29')]));_0x1726ed['where']['SessionId']=_0x2d1e49['id'];if(_0x579e5c[_0x8e6a('0x28')][_0x8e6a('0x34')]){_0x1726ed[_0x8e6a('0x32')]=_[_0x8e6a('0x35')](_0x1726ed['where'],{'$or':_[_0x8e6a('0x49')](_0x1726ed['attributes'],function(_0x564ac3){var _0x2a381a={};_0x2a381a[_0x564ac3]={'$like':'%'+_0x579e5c[_0x8e6a('0x28')][_0x8e6a('0x34')]+'%'};return _0x2a381a;})});}_0x1726ed=_['merge']({},_0x1726ed,_0x579e5c[_0x8e6a('0x3a')]);return db[_0x8e6a('0x47')][_0x8e6a('0x1a')]({'where':_0x1726ed[_0x8e6a('0x32')]})[_0x8e6a('0x22')](function(_0x158d10){_0x500e81[_0x8e6a('0x1a')]=_0x158d10;if(_0x579e5c[_0x8e6a('0x28')][_0x8e6a('0x40')]){_0x1726ed[_0x8e6a('0x3c')]=[{'all':!![]}];}return db[_0x8e6a('0x47')][_0x8e6a('0x3d')](_0x1726ed);})['then'](function(_0x591c4e){_0x500e81[_0x8e6a('0x4a')]=_0x591c4e;return _0x500e81;});}})[_0x8e6a('0x22')](respondWithFilteredResult(_0x27400c,_0x1726ed))['catch'](handleError(_0x27400c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index af969b6..70a3b9b 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 _0xe4c1=['moment','request-promise','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','api'];(function(_0x44bbc8,_0x7bd5a8){var _0x3b716c=function(_0x990253){while(--_0x990253){_0x44bbc8['push'](_0x44bbc8['shift']());}};_0x3b716c(++_0x7bd5a8);}(_0xe4c1,0x9d));var _0x1e4c=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xe4c1[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x1e4c('0x0'));var util=require(_0x1e4c('0x1'));var logger=require('../../config/logger')(_0x1e4c('0x2'));var moment=require(_0x1e4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e4c('0x4'));var attributes=require(_0x1e4c('0x5'));module[_0x1e4c('0x6')]=function(_0x37f71e,_0x220607){return _0x37f71e[_0x1e4c('0x7')](_0x1e4c('0x8'),attributes,{'tableName':_0x1e4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4354=['util','../../config/logger','api','moment','bluebird','request-promise','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions','lodash'];(function(_0x11a1ae,_0x3766b3){var _0x4189f5=function(_0x826187){while(--_0x826187){_0x11a1ae['push'](_0x11a1ae['shift']());}};_0x4189f5(++_0x3766b3);}(_0x4354,0xdb));var _0x4435=function(_0x4f5fc4,_0x3159b1){_0x4f5fc4=_0x4f5fc4-0x0;var _0x26cdd8=_0x4354[_0x4f5fc4];return _0x26cdd8;};'use strict';var _=require(_0x4435('0x0'));var util=require(_0x4435('0x1'));var logger=require(_0x4435('0x2'))(_0x4435('0x3'));var moment=require(_0x4435('0x4'));var BPromise=require(_0x4435('0x5'));var rp=require(_0x4435('0x6'));var attributes=require(_0x4435('0x7'));module['exports']=function(_0x22d738,_0x131d47){return _0x22d738['define'](_0x4435('0x8'),attributes,{'tableName':_0x4435('0x9'),'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 777e9b1..0c15662 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 _0x0e4b=['lodash','util','moment','randomstring','rpc','../../config/environment','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x38a36e,_0x29e3bc){var _0x363af2=function(_0x51706f){while(--_0x51706f){_0x38a36e['push'](_0x38a36e['shift']());}};_0x363af2(++_0x29e3bc);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x20c9d6,_0x160bea){_0x20c9d6=_0x20c9d6-0x0;var _0x3b8794=_0x0e4b[_0x20c9d6];return _0x3b8794;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var moment=require(_0xb0e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0e4('0x4'));var config=require(_0xb0e4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0e4('0x6')][_0xb0e4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x78e4ed,_0x3dff2f,_0x35aa64){return new BPromise(function(_0x57f45d,_0x5192f0){return client[_0xb0e4('0x8')](_0x78e4ed,_0x35aa64)[_0xb0e4('0x9')](function(_0x1d6452){logger[_0xb0e4('0xa')](_0xb0e4('0xb'),_0x3dff2f,_0xb0e4('0xc'));logger[_0xb0e4('0xd')](_0xb0e4('0xe'),_0x3dff2f,_0xb0e4('0xc'),JSON[_0xb0e4('0xf')](_0x1d6452));if(_0x1d6452[_0xb0e4('0x10')]){if(_0x1d6452[_0xb0e4('0x10')][_0xb0e4('0x11')]===0x1f4){logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0x1d6452['error'][_0xb0e4('0x12')]);return _0x5192f0(_0x1d6452[_0xb0e4('0x10')]['message']);}logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0x1d6452[_0xb0e4('0x10')][_0xb0e4('0x12')]);return _0x57f45d(_0x1d6452[_0xb0e4('0x10')]['message']);}else{logger['info'](_0xb0e4('0xb'),_0x3dff2f,_0xb0e4('0xc'));_0x57f45d(_0x1d6452['result'][_0xb0e4('0x12')]);}})[_0xb0e4('0x13')](function(_0xc12df2){logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0xc12df2);_0x5192f0(_0xc12df2);});});} \ No newline at end of file +var _0xee87=['error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0xee87,0x10d));var _0x7ee8=function(_0xcc226c,_0x31e8f1){_0xcc226c=_0xcc226c-0x0;var _0x2cc819=_0xee87[_0xcc226c];return _0x2cc819;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require(_0x7ee8('0x1'));var BPromise=require(_0x7ee8('0x2'));var rs=require(_0x7ee8('0x3'));var fs=require('fs');var Redis=require(_0x7ee8('0x4'));var db=require(_0x7ee8('0x5'))['db'];var utils=require(_0x7ee8('0x6'));var logger=require(_0x7ee8('0x7'))(_0x7ee8('0x8'));var config=require(_0x7ee8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dfed7,_0x4241bf,_0x2a9ea3){return new BPromise(function(_0x4275fc,_0x287224){return client['request'](_0x2dfed7,_0x2a9ea3)['then'](function(_0x3d984c){logger['info'](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));logger[_0x7ee8('0xd')](_0x7ee8('0xe'),_0x4241bf,_0x7ee8('0xc'),JSON[_0x7ee8('0xf')](_0x3d984c));if(_0x3d984c['error']){if(_0x3d984c['error'][_0x7ee8('0x10')]===0x1f4){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x287224(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x4275fc(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}else{logger[_0x7ee8('0x13')](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));_0x4275fc(_0x3d984c[_0x7ee8('0x14')][_0x7ee8('0x12')]);}})[_0x7ee8('0x15')](function(_0x3de0b8){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3de0b8);_0x287224(_0x3de0b8);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0ab1db5..16a5c63 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 _0xdc49=['/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','put'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xdc49,0xb8));var _0x9dc4=function(_0x23aec5,_0x3d3418){_0x23aec5=_0x23aec5-0x0;var _0x433044=_0xdc49[_0x23aec5];return _0x433044;};'use strict';var multer=require(_0x9dc4('0x0'));var util=require(_0x9dc4('0x1'));var path=require(_0x9dc4('0x2'));var timeout=require(_0x9dc4('0x3'));var express=require('express');var router=express[_0x9dc4('0x4')]();var auth=require(_0x9dc4('0x5'));var interaction=require(_0x9dc4('0x6'));var config=require(_0x9dc4('0x7'));var controller=require('./license.controller');router[_0x9dc4('0x8')]('/',controller[_0x9dc4('0x9')]);router[_0x9dc4('0xa')](_0x9dc4('0xb'),auth[_0x9dc4('0xc')](),controller[_0x9dc4('0xd')]);module[_0x9dc4('0xe')]=router; \ No newline at end of file +var _0xd1ed=['express','Router','../../components/auth/service','./license.controller','get','isAuthenticated','update','exports','multer','util','path','connect-timeout'];(function(_0xe1ac3,_0x4743c8){var _0x5c7705=function(_0x5bea4d){while(--_0x5bea4d){_0xe1ac3['push'](_0xe1ac3['shift']());}};_0x5c7705(++_0x4743c8);}(_0xd1ed,0x68));var _0xdd1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdd1e('0x0'));var util=require(_0xdd1e('0x1'));var path=require(_0xdd1e('0x2'));var timeout=require(_0xdd1e('0x3'));var express=require(_0xdd1e('0x4'));var router=express[_0xdd1e('0x5')]();var auth=require(_0xdd1e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdd1e('0x7'));router[_0xdd1e('0x8')]('/',controller['index']);router['put']('/:id',auth[_0xdd1e('0x9')](),controller[_0xdd1e('0xa')]);module[_0xdd1e('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0adfe9c..342a50c 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 _0x5515=['STRING','sequelize','exports','TEXT'];(function(_0x335da8,_0x5d6143){var _0x826664=function(_0x113c39){while(--_0x113c39){_0x335da8['push'](_0x335da8['shift']());}};_0x826664(++_0x5d6143);}(_0x5515,0x131));var _0x5551=function(_0x250897,_0x384993){_0x250897=_0x250897-0x0;var _0x166f5e=_0x5515[_0x250897];return _0x166f5e;};'use strict';var Sequelize=require(_0x5551('0x0'));module[_0x5551('0x1')]={'license':{'type':Sequelize[_0x5551('0x2')]},'data1':{'type':Sequelize[_0x5551('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x05f7=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x52e9e3,_0xe465a7){var _0x960a8d=function(_0x572a0d){while(--_0x572a0d){_0x52e9e3['push'](_0x52e9e3['shift']());}};_0x960a8d(++_0xe465a7);}(_0x05f7,0x16c));var _0x705f=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x05f7[_0x3042c5];return _0x7cd140;};'use strict';var Sequelize=require(_0x705f('0x0'));module[_0x705f('0x1')]={'license':{'type':Sequelize[_0x705f('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x705f('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x705f('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 001e92e..a5aa864 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 _0x1564=['../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','json','reject','save','then','stack','name','send','../../config/license/util','index','model','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','params','get','checkLicense','key','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4ddd6e,_0x2336ae){var _0x354a5a=function(_0x92a6c4){while(--_0x92a6c4){_0x4ddd6e['push'](_0x4ddd6e['shift']());}};_0x354a5a(++_0x2336ae);}(_0x1564,0x8f));var _0x4156=function(_0x1c1b8c,_0x4c253d){_0x1c1b8c=_0x1c1b8c-0x0;var _0x1ee4c4=_0x1564[_0x1c1b8c];return _0x1ee4c4;};'use strict';var pdf=require(_0x4156('0x0'));var emlformat=require(_0x4156('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4156('0x2'));var moment=require(_0x4156('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4156('0x4'));var util=require(_0x4156('0x5'));var path=require(_0x4156('0x6'));var sox=require(_0x4156('0x7'));var csv=require(_0x4156('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4156('0x9'));var crypto=require(_0x4156('0xa'));var jsforce=require(_0x4156('0xb'));var deskjs=require(_0x4156('0xc'));var toCsv=require(_0x4156('0x8'));var querystring=require(_0x4156('0xd'));var Papa=require(_0x4156('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4156('0xf'));var qs=require(_0x4156('0x10'));var logger=require('../../config/logger')(_0x4156('0x11'));var utils=require(_0x4156('0x12'));var config=require(_0x4156('0x13'));var db=require(_0x4156('0x14'))['db'];function respondWithStatusCode(_0x3add17,_0x38c66c){_0x38c66c=_0x38c66c||0xcc;return function(_0x542147){if(_0x542147){return _0x3add17[_0x4156('0x15')](_0x38c66c);}return _0x3add17['status'](_0x38c66c)[_0x4156('0x16')]();};}function respondWithResult(_0x4ecb4a,_0x2fa083){_0x2fa083=_0x2fa083||0xc8;return function(_0x272149){if(_0x272149){return _0x4ecb4a[_0x4156('0x17')](_0x2fa083)['json'](_0x272149);}};}function respondWithFilteredResult(_0x283d03,_0x97700f){return function(_0x24f321){if(_0x24f321){var _0x4e3cce=_0x24f321['count'],_0x38b5c4=_0x97700f[_0x4156('0x18')],_0x3a8bdc=_0x97700f[_0x4156('0x18')]+_0x97700f[_0x4156('0x19')],_0x2fc111;if(_0x3a8bdc>=_0x4e3cce){_0x3a8bdc=_0x4e3cce;_0x2fc111=0xc8;}else{_0x2fc111=0xce;}_0x283d03[_0x4156('0x17')](_0x2fc111);return _0x283d03[_0x4156('0x1a')]('Content-Range',_0x38b5c4+'-'+_0x3a8bdc+'/'+_0x4e3cce)[_0x4156('0x1b')](_0x24f321);}return null;};}function patchUpdates(_0x1773be){return function(_0x5a004){try{jsonpatch['apply'](_0x5a004,_0x1773be,!![]);}catch(_0x1d1d6d){return BPromise[_0x4156('0x1c')](_0x1d1d6d);}return _0x5a004[_0x4156('0x1d')]();};}function saveUpdates(_0x36f0e5,_0xf3d51b){return function(_0x1f0887){if(_0x1f0887){return _0x1f0887['update'](_0x36f0e5)[_0x4156('0x1e')](function(_0x242eb){return _0x242eb;});}return null;};}function removeEntity(_0xabddc1,_0x5d19a7){return function(_0x1b5955){if(_0x1b5955){return _0x1b5955['destroy']()['then'](function(){_0xabddc1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48ac87,_0x5780e7){return function(_0x164308){if(!_0x164308){_0x48ac87[_0x4156('0x15')](0x194);}return _0x164308;};}function handleError(_0x518dbc,_0x3a7a6d){_0x3a7a6d=_0x3a7a6d||0x1f4;return function(_0x2ebda3){logger['error'](_0x2ebda3[_0x4156('0x1f')]);if(_0x2ebda3[_0x4156('0x20')]){delete _0x2ebda3['name'];}_0x518dbc['status'](_0x3a7a6d)[_0x4156('0x21')](_0x2ebda3);};}var utilLicense=require(_0x4156('0x22'));exports[_0x4156('0x23')]=function(_0x5614d2,_0x2c06e0){var _0x30f0a5={'raw':!![],'where':{'id':0x1}},_0x494ec2={};_0x494ec2[_0x4156('0x24')]=_['keys'](db['License'][_0x4156('0x25')]);_0x494ec2[_0x4156('0x26')]=_['keys'](_0x5614d2[_0x4156('0x26')]);_0x494ec2['filters']=_[_0x4156('0x27')](_0x494ec2[_0x4156('0x24')],_0x494ec2['query']);_0x30f0a5[_0x4156('0x28')]=_[_0x4156('0x27')](_0x494ec2['model'],qs['fields'](_0x5614d2[_0x4156('0x26')][_0x4156('0x29')]));_0x30f0a5['attributes']=_0x30f0a5[_0x4156('0x28')][_0x4156('0x2a')]?_0x30f0a5[_0x4156('0x28')]:_0x494ec2[_0x4156('0x24')];_0x30f0a5=_[_0x4156('0x2b')]({},_0x30f0a5,_0x5614d2[_0x4156('0x2c')]);return utilLicense[_0x4156('0x2d')](_0x30f0a5)[_0x4156('0x1e')](respondWithResult(_0x2c06e0,null))[_0x4156('0x2e')](handleError(_0x2c06e0,null));};exports[_0x4156('0x2f')]=function(_0x460480,_0x586542){if(_0x460480[_0x4156('0x30')]['id']){delete _0x460480['body']['id'];}return db['License']['find']({'where':{'id':_0x460480[_0x4156('0x31')]['id']}})[_0x4156('0x1e')](handleEntityNotFound(_0x586542,null))['then'](function(_0x394642){var _0x2d662c=_0x394642[_0x4156('0x32')]({'plain':!![]});return utilLicense[_0x4156('0x33')](_0x2d662c,_0x460480['body'][_0x4156('0x34')]);})[_0x4156('0x1e')](function(_0x441691){if(!_0x441691['demo']){return saveUpdates(_0x460480[_0x4156('0x30')],null);}return _0x441691;})['then'](respondWithResult(_0x586542,null))[_0x4156('0x2e')](handleError(_0x586542,null));}; \ No newline at end of file +var _0x0651=['reject','save','update','then','end','error','stack','name','send','index','model','rawAttributes','query','keys','filters','intersection','attributes','fields','merge','options','getLicense','body','License','params','get','demo','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x0651,0x1f3));var _0x1065=function(_0x22edcd,_0x4361b5){_0x22edcd=_0x22edcd-0x0;var _0x75f49c=_0x0651[_0x22edcd];return _0x75f49c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1065('0x0'));var rimraf=require(_0x1065('0x1'));var zipdir=require(_0x1065('0x2'));var jsonpatch=require(_0x1065('0x3'));var rp=require(_0x1065('0x4'));var moment=require(_0x1065('0x5'));var BPromise=require(_0x1065('0x6'));var Mustache=require(_0x1065('0x7'));var util=require('util');var path=require(_0x1065('0x8'));var sox=require(_0x1065('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1065('0xa'));var squel=require('squel');var crypto=require(_0x1065('0xb'));var jsforce=require(_0x1065('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1065('0xd'));var querystring=require(_0x1065('0xe'));var Papa=require(_0x1065('0xf'));var authService=require(_0x1065('0x10'));var hardwareService=require(_0x1065('0x11'));var Redis=require(_0x1065('0x12'));var qs=require(_0x1065('0x13'));var logger=require(_0x1065('0x14'))(_0x1065('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1065('0x16'))['db'];function respondWithStatusCode(_0x7a9184,_0x504c33){_0x504c33=_0x504c33||0xcc;return function(_0x39d3f8){if(_0x39d3f8){return _0x7a9184[_0x1065('0x17')](_0x504c33);}return _0x7a9184['status'](_0x504c33)['end']();};}function respondWithResult(_0x18971c,_0x479872){_0x479872=_0x479872||0xc8;return function(_0x17db49){if(_0x17db49){return _0x18971c[_0x1065('0x18')](_0x479872)[_0x1065('0x19')](_0x17db49);}};}function respondWithFilteredResult(_0x3e8019,_0x2591b7){return function(_0x450a95){if(_0x450a95){var _0x1ea887=_0x450a95[_0x1065('0x1a')],_0x589edf=_0x2591b7[_0x1065('0x1b')],_0x32af6b=_0x2591b7[_0x1065('0x1b')]+_0x2591b7[_0x1065('0x1c')],_0xdd9177;if(_0x32af6b>=_0x1ea887){_0x32af6b=_0x1ea887;_0xdd9177=0xc8;}else{_0xdd9177=0xce;}_0x3e8019[_0x1065('0x18')](_0xdd9177);return _0x3e8019[_0x1065('0x1d')](_0x1065('0x1e'),_0x589edf+'-'+_0x32af6b+'/'+_0x1ea887)[_0x1065('0x19')](_0x450a95);}return null;};}function patchUpdates(_0x2b1a9b){return function(_0x49011f){try{jsonpatch[_0x1065('0x1f')](_0x49011f,_0x2b1a9b,!![]);}catch(_0x1c6f5c){return BPromise[_0x1065('0x20')](_0x1c6f5c);}return _0x49011f[_0x1065('0x21')]();};}function saveUpdates(_0x483656,_0x552ece){return function(_0x5e823d){if(_0x5e823d){return _0x5e823d[_0x1065('0x22')](_0x483656)[_0x1065('0x23')](function(_0x1c0660){return _0x1c0660;});}return null;};}function removeEntity(_0x22f0c0,_0x2a3be4){return function(_0x25b0bd){if(_0x25b0bd){return _0x25b0bd['destroy']()[_0x1065('0x23')](function(){_0x22f0c0[_0x1065('0x18')](0xcc)[_0x1065('0x24')]();});}};}function handleEntityNotFound(_0x47af71,_0xea8998){return function(_0x30ad4e){if(!_0x30ad4e){_0x47af71['sendStatus'](0x194);}return _0x30ad4e;};}function handleError(_0xee5f2a,_0x2cf4a9){_0x2cf4a9=_0x2cf4a9||0x1f4;return function(_0x1acdfe){logger[_0x1065('0x25')](_0x1acdfe[_0x1065('0x26')]);if(_0x1acdfe[_0x1065('0x27')]){delete _0x1acdfe[_0x1065('0x27')];}_0xee5f2a[_0x1065('0x18')](_0x2cf4a9)[_0x1065('0x28')](_0x1acdfe);};}var utilLicense=require('../../config/license/util');exports[_0x1065('0x29')]=function(_0x3dfaaa,_0xa7b89){var _0x58b1e7={'raw':!![],'where':{'id':0x1}},_0x1ee3b5={};_0x1ee3b5[_0x1065('0x2a')]=_['keys'](db['License'][_0x1065('0x2b')]);_0x1ee3b5[_0x1065('0x2c')]=_[_0x1065('0x2d')](_0x3dfaaa[_0x1065('0x2c')]);_0x1ee3b5[_0x1065('0x2e')]=_[_0x1065('0x2f')](_0x1ee3b5[_0x1065('0x2a')],_0x1ee3b5['query']);_0x58b1e7[_0x1065('0x30')]=_[_0x1065('0x2f')](_0x1ee3b5[_0x1065('0x2a')],qs[_0x1065('0x31')](_0x3dfaaa[_0x1065('0x2c')][_0x1065('0x31')]));_0x58b1e7[_0x1065('0x30')]=_0x58b1e7[_0x1065('0x30')]['length']?_0x58b1e7['attributes']:_0x1ee3b5[_0x1065('0x2a')];_0x58b1e7=_[_0x1065('0x32')]({},_0x58b1e7,_0x3dfaaa[_0x1065('0x33')]);return utilLicense[_0x1065('0x34')](_0x58b1e7)[_0x1065('0x23')](respondWithResult(_0xa7b89,null))['catch'](handleError(_0xa7b89,null));};exports[_0x1065('0x22')]=function(_0x32f3f9,_0x17dfbc){if(_0x32f3f9[_0x1065('0x35')]['id']){delete _0x32f3f9[_0x1065('0x35')]['id'];}return db[_0x1065('0x36')]['find']({'where':{'id':_0x32f3f9[_0x1065('0x37')]['id']}})[_0x1065('0x23')](handleEntityNotFound(_0x17dfbc,null))[_0x1065('0x23')](function(_0x5c0e17){var _0x501a7d=_0x5c0e17[_0x1065('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x501a7d,_0x32f3f9[_0x1065('0x35')]['key']);})[_0x1065('0x23')](function(_0x1a9c66){if(!_0x1a9c66[_0x1065('0x39')]){return saveUpdates(_0x32f3f9['body'],null);}return _0x1a9c66;})['then'](respondWithResult(_0x17dfbc,null))[_0x1065('0x3a')](handleError(_0x17dfbc,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0fc2ad9..a4c8837 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 _0x0faf=['bluebird','request-promise','./license.attributes','exports','License','license','lodash','../../config/logger','api','moment'];(function(_0x2a3133,_0x1df26a){var _0x22d9a1=function(_0x3636e1){while(--_0x3636e1){_0x2a3133['push'](_0x2a3133['shift']());}};_0x22d9a1(++_0x1df26a);}(_0x0faf,0x132));var _0xf0fa=function(_0x494f7f,_0x34a09b){_0x494f7f=_0x494f7f-0x0;var _0x18ebe4=_0x0faf[_0x494f7f];return _0x18ebe4;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var attributes=require(_0xf0fa('0x6'));module[_0xf0fa('0x7')]=function(_0xc83253,_0x283f04){return _0xc83253['define'](_0xf0fa('0x8'),attributes,{'tableName':_0xf0fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d55=['request-promise','./license.attributes','exports','define','License','license','util','api','moment'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x5d55,0x1a4));var _0x55d5=function(_0x415958,_0x1655f1){_0x415958=_0x415958-0x0;var _0xd4c111=_0x5d55[_0x415958];return _0xd4c111;};'use strict';var _=require('lodash');var util=require(_0x55d5('0x0'));var logger=require('../../config/logger')(_0x55d5('0x1'));var moment=require(_0x55d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x55d5('0x3'));var attributes=require(_0x55d5('0x4'));module[_0x55d5('0x5')]=function(_0x546e6c,_0x2b35a2){return _0x546e6c[_0x55d5('0x6')](_0x55d5('0x7'),attributes,{'tableName':_0x55d5('0x8'),'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 435eb53..a563f70 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 _0x7ee4=['request\x20sent','debug','stringify','error','code','message','License,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3177bb,_0x12ac02){var _0x37adaa=function(_0x2c6c05){while(--_0x2c6c05){_0x3177bb['push'](_0x3177bb['shift']());}};_0x37adaa(++_0x12ac02);}(_0x7ee4,0x158));var _0x47ee=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0x7ee4[_0x1f1837];return _0x25ab57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x47ee('0x0'));var BPromise=require(_0x47ee('0x1'));var rs=require(_0x47ee('0x2'));var fs=require('fs');var Redis=require(_0x47ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x47ee('0x4'));var logger=require('../../config/logger')(_0x47ee('0x5'));var config=require(_0x47ee('0x6'));var jayson=require(_0x47ee('0x7'));var client=jayson[_0x47ee('0x8')][_0x47ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dde4b,_0x283eb6,_0x3d551b){return new BPromise(function(_0x7ac3f9,_0x51361e){return client[_0x47ee('0xa')](_0x5dde4b,_0x3d551b)[_0x47ee('0xb')](function(_0x21dc8a){logger[_0x47ee('0xc')]('License,\x20%s,\x20%s',_0x283eb6,_0x47ee('0xd'));logger[_0x47ee('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x283eb6,_0x47ee('0xd'),JSON[_0x47ee('0xf')](_0x21dc8a));if(_0x21dc8a[_0x47ee('0x10')]){if(_0x21dc8a['error'][_0x47ee('0x11')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x283eb6,_0x21dc8a['error'][_0x47ee('0x12')]);return _0x51361e(_0x21dc8a[_0x47ee('0x10')][_0x47ee('0x12')]);}logger[_0x47ee('0x10')](_0x47ee('0x13'),_0x283eb6,_0x21dc8a[_0x47ee('0x10')][_0x47ee('0x12')]);return _0x7ac3f9(_0x21dc8a[_0x47ee('0x10')]['message']);}else{logger['info'](_0x47ee('0x13'),_0x283eb6,_0x47ee('0xd'));_0x7ac3f9(_0x21dc8a[_0x47ee('0x14')][_0x47ee('0x12')]);}})['catch'](function(_0x3162da){logger[_0x47ee('0x10')](_0x47ee('0x13'),_0x283eb6,_0x3162da);_0x51361e(_0x3162da);});});} \ No newline at end of file +var _0x2d40=['request','then','License,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x57460c,_0x20f7ad){var _0x5b3a82=function(_0x2195c1){while(--_0x2195c1){_0x57460c['push'](_0x57460c['shift']());}};_0x5b3a82(++_0x20f7ad);}(_0x2d40,0x121));var _0x02d4=function(_0x457621,_0x31e731){_0x457621=_0x457621-0x0;var _0x57b21c=_0x2d40[_0x457621];return _0x57b21c;};'use strict';var _=require('lodash');var util=require(_0x02d4('0x0'));var moment=require(_0x02d4('0x1'));var BPromise=require(_0x02d4('0x2'));var rs=require(_0x02d4('0x3'));var fs=require('fs');var Redis=require(_0x02d4('0x4'));var db=require(_0x02d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02d4('0x6'))(_0x02d4('0x7'));var config=require(_0x02d4('0x8'));var jayson=require(_0x02d4('0x9'));var client=jayson['client'][_0x02d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1386bf,_0x1c4a47,_0x56f414){return new BPromise(function(_0x3802ad,_0x3f9b0c){return client[_0x02d4('0xb')](_0x1386bf,_0x56f414)[_0x02d4('0xc')](function(_0x1cb47e){logger['info'](_0x02d4('0xd'),_0x1c4a47,_0x02d4('0xe'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x1c4a47,_0x02d4('0xe'),JSON[_0x02d4('0xf')](_0x1cb47e));if(_0x1cb47e[_0x02d4('0x10')]){if(_0x1cb47e[_0x02d4('0x10')][_0x02d4('0x11')]===0x1f4){logger['error'](_0x02d4('0xd'),_0x1c4a47,_0x1cb47e['error'][_0x02d4('0x12')]);return _0x3f9b0c(_0x1cb47e[_0x02d4('0x10')][_0x02d4('0x12')]);}logger[_0x02d4('0x10')]('License,\x20%s,\x20%s',_0x1c4a47,_0x1cb47e[_0x02d4('0x10')][_0x02d4('0x12')]);return _0x3802ad(_0x1cb47e[_0x02d4('0x10')][_0x02d4('0x12')]);}else{logger['info'](_0x02d4('0xd'),_0x1c4a47,'request\x20sent');_0x3802ad(_0x1cb47e[_0x02d4('0x13')]['message']);}})['catch'](function(_0x505049){logger[_0x02d4('0x10')]('License,\x20%s,\x20%s',_0x1c4a47,_0x505049);_0x3f9b0c(_0x505049);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 3a602d0..b6309b8 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 _0xbb69=['getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions'];(function(_0x4653c7,_0x38862d){var _0x2bbaed=function(_0x501512){while(--_0x501512){_0x4653c7['push'](_0x4653c7['shift']());}};_0x2bbaed(++_0x38862d);}(_0xbb69,0x135));var _0x9bb6=function(_0x40a95e,_0x4bd1bb){_0x40a95e=_0x40a95e-0x0;var _0x4f5896=_0xbb69[_0x40a95e];return _0x4f5896;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9bb6('0x0'));var timeout=require(_0x9bb6('0x1'));var express=require('express');var router=express[_0x9bb6('0x2')]();var auth=require(_0x9bb6('0x3'));var interaction=require(_0x9bb6('0x4'));var config=require(_0x9bb6('0x5'));var controller=require(_0x9bb6('0x6'));router[_0x9bb6('0x7')]('/',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x9')]);router['get'](_0x9bb6('0xa'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9bb6('0xc')]);router[_0x9bb6('0x7')](_0x9bb6('0xd'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0xe')]);router[_0x9bb6('0x7')](_0x9bb6('0xf'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x10')]);router['get'](_0x9bb6('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0x9bb6('0x7')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9bb6('0x12')]);router[_0x9bb6('0x7')](_0x9bb6('0x13'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x14')]);router[_0x9bb6('0x7')](_0x9bb6('0x15'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x16')]);router['get']('/:id/messages',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x17')]);router['get']('/:id/verify',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x18')]);router['get'](_0x9bb6('0x19'),auth[_0x9bb6('0x8')](),controller['getAgents']);router[_0x9bb6('0x1a')](_0x9bb6('0xd'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x1b')]);router['post'](_0x9bb6('0xf'),auth['isAuthenticated'](),controller[_0x9bb6('0x1c')]);router[_0x9bb6('0x1a')]('/',auth['isAuthenticated'](),controller[_0x9bb6('0x1d')]);router[_0x9bb6('0x1a')](_0x9bb6('0x11'),auth['isAuthenticated'](),controller[_0x9bb6('0x1e')]);router[_0x9bb6('0x1a')](_0x9bb6('0x1f'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x20')]);router[_0x9bb6('0x1a')](_0x9bb6('0x13'),auth[_0x9bb6('0x8')](),controller['addInteraction']);router[_0x9bb6('0x1a')](_0x9bb6('0x15'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x21')]);router[_0x9bb6('0x1a')](_0x9bb6('0x22'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x23')]);router[_0x9bb6('0x1a')](_0x9bb6('0x19'),auth['isAuthenticated'](),controller[_0x9bb6('0x24')]);router[_0x9bb6('0x25')]('/:id',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x26')]);router[_0x9bb6('0x27')](_0x9bb6('0xd'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x28')]);router[_0x9bb6('0x27')](_0x9bb6('0xf'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x29')]);router['delete'](_0x9bb6('0x11'),auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x2a')]);router[_0x9bb6('0x27')]('/:id/out_servers',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x2b')]);router[_0x9bb6('0x27')]('/:id',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x2c')]);router[_0x9bb6('0x27')]('/:id/users',auth[_0x9bb6('0x8')](),controller[_0x9bb6('0x2d')]);module[_0x9bb6('0x2e')]=router; \ No newline at end of file +var _0x3659=['send','addAgents','/:id','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','getAnswers','/:id/in_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x3659,0x1a0));var _0x9365=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0x3659[_0x216799];return _0x3661c3;};'use strict';var multer=require(_0x9365('0x0'));var util=require('util');var path=require(_0x9365('0x1'));var timeout=require(_0x9365('0x2'));var express=require(_0x9365('0x3'));var router=express['Router']();var auth=require(_0x9365('0x4'));var interaction=require(_0x9365('0x5'));var config=require('../../config/environment');var controller=require(_0x9365('0x6'));router[_0x9365('0x7')]('/',auth[_0x9365('0x8')](),controller[_0x9365('0x9')]);router['get'](_0x9365('0xa'),auth[_0x9365('0x8')](),controller[_0x9365('0xb')]);router[_0x9365('0x7')]('/:id',auth[_0x9365('0x8')](),controller[_0x9365('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x9365('0x7')]('/:id/canned_answers',auth[_0x9365('0x8')](),controller[_0x9365('0xd')]);router[_0x9365('0x7')](_0x9365('0xe'),auth[_0x9365('0x8')](),controller['getImap']);router[_0x9365('0x7')]('/:id/out_servers',auth[_0x9365('0x8')](),controller[_0x9365('0xf')]);router[_0x9365('0x7')]('/:id/interactions',auth[_0x9365('0x8')](),controller[_0x9365('0x10')]);router[_0x9365('0x7')](_0x9365('0x11'),auth['isAuthenticated'](),controller[_0x9365('0x12')]);router[_0x9365('0x7')](_0x9365('0x13'),auth[_0x9365('0x8')](),controller[_0x9365('0x14')]);router[_0x9365('0x7')]('/:id/verify',auth[_0x9365('0x8')](),controller['verifySmtp']);router[_0x9365('0x7')](_0x9365('0x15'),auth[_0x9365('0x8')](),controller[_0x9365('0x16')]);router[_0x9365('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9365('0x18')]);router[_0x9365('0x17')](_0x9365('0x19'),auth[_0x9365('0x8')](),controller[_0x9365('0x1a')]);router[_0x9365('0x17')]('/',auth['isAuthenticated'](),controller[_0x9365('0x1b')]);router[_0x9365('0x17')](_0x9365('0xe'),auth[_0x9365('0x8')](),controller[_0x9365('0x1c')]);router[_0x9365('0x17')](_0x9365('0x1d'),auth['isAuthenticated'](),controller[_0x9365('0x1e')]);router[_0x9365('0x17')]('/:id/interactions',auth[_0x9365('0x8')](),controller[_0x9365('0x1f')]);router['post'](_0x9365('0x11'),auth[_0x9365('0x8')](),controller[_0x9365('0x20')]);router[_0x9365('0x17')](_0x9365('0x21'),auth[_0x9365('0x8')](),controller[_0x9365('0x22')]);router[_0x9365('0x17')](_0x9365('0x15'),auth[_0x9365('0x8')](),controller[_0x9365('0x23')]);router['put'](_0x9365('0x24'),auth[_0x9365('0x8')](),controller[_0x9365('0x25')]);router[_0x9365('0x26')](_0x9365('0x27'),auth[_0x9365('0x8')](),controller[_0x9365('0x28')]);router[_0x9365('0x26')](_0x9365('0x19'),auth['isAuthenticated'](),controller[_0x9365('0x29')]);router[_0x9365('0x26')](_0x9365('0xe'),auth[_0x9365('0x8')](),controller[_0x9365('0x2a')]);router[_0x9365('0x26')](_0x9365('0x1d'),auth[_0x9365('0x8')](),controller[_0x9365('0x2b')]);router['delete'](_0x9365('0x24'),auth[_0x9365('0x8')](),controller['destroy']);router[_0x9365('0x26')]('/:id/users',auth['isAuthenticated'](),controller[_0x9365('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2fc488b..0b8a31a 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 _0xc5c4=['mandatoryDispositionPauseId','mandatoryDisposition','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','setDataValue'];(function(_0x5bc87d,_0x51cfed){var _0x5958ac=function(_0xef0568){while(--_0xef0568){_0x5bc87d['push'](_0x5bc87d['shift']());}};_0x5958ac(++_0x51cfed);}(_0xc5c4,0x9e));var _0x4c5c=function(_0x351129,_0x193893){_0x351129=_0x351129-0x0;var _0x23ea9d=_0xc5c4[_0x351129];return _0x23ea9d;};'use strict';var Sequelize=require(_0x4c5c('0x0'));module[_0x4c5c('0x1')]={'description':{'type':Sequelize[_0x4c5c('0x2')]},'name':{'type':Sequelize[_0x4c5c('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4c5c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4c5c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4c5c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x4c5c('0x4')]},'markAsUnread':{'type':Sequelize[_0x4c5c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c5c('0x5')},'fontSize':{'type':Sequelize[_0x4c5c('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4c5c('0x4')],'defaultValue':function(){return _0x4c5c('0x7');}},'notificationSound':{'type':Sequelize[_0x4c5c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4c5c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4c5c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4c5c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4c5c('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x4c5c('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x526e4e){if(!_0x526e4e)this[_0x4c5c('0x9')](_0x4c5c('0xa'),null);this[_0x4c5c('0x9')](_0x4c5c('0xb'),_0x526e4e);}}}; \ No newline at end of file +var _0x3650=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','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}}'];(function(_0x3bb557,_0x2d4e15){var _0x5eebcb=function(_0x309c44){while(--_0x309c44){_0x3bb557['push'](_0x3bb557['shift']());}};_0x5eebcb(++_0x2d4e15);}(_0x3650,0xff));var _0x0365=function(_0x560986,_0x263742){_0x560986=_0x560986-0x0;var _0x1415a0=_0x3650[_0x560986];return _0x1415a0;};'use strict';var Sequelize=require(_0x0365('0x0'));module[_0x0365('0x1')]={'description':{'type':Sequelize[_0x0365('0x2')]},'name':{'type':Sequelize[_0x0365('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x0365('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0365('0x2')],'allowNull':![],'defaultValue':_0x0365('0x4')},'fontSize':{'type':Sequelize[_0x0365('0x5')](0x2)[_0x0365('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0365('0x7')],'defaultValue':function(){return _0x0365('0x8');}},'notificationSound':{'type':Sequelize[_0x0365('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0365('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0365('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0365('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0365('0x3')],'defaultValue':![],'comment':_0x0365('0x9'),'set':function(_0x1c1dac){if(!_0x1c1dac)this[_0x0365('0xa')]('mandatoryDispositionPauseId',null);this[_0x0365('0xa')](_0x0365('0xb'),_0x1c1dac);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index d793fdc..583aa0b 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 _0x34e5=['ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','destroy','get','MailAccounts','UserProfileResource','name','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','pick','filter','where','map','key','field','merge','options','includeAll','include','findAll','rows','show','params','Imap','Pause','find','update','body','describe','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','authentication','host','port','service','password','pass','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','format','YYYY-MM-DD\x20HH:mm:ss','send','split','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','Contacts','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0xfce1b3,_0x3f5c69){var _0x389c19=function(_0x37c654){while(--_0x37c654){_0xfce1b3['push'](_0xfce1b3['shift']());}};_0x389c19(++_0x3f5c69);}(_0x34e5,0x172));var _0x534e=function(_0x4d89f9,_0x90f837){_0x4d89f9=_0x4d89f9-0x0;var _0x47d543=_0x34e5[_0x4d89f9];return _0x47d543;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x534e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x534e('0x1'));var jsonpatch=require(_0x534e('0x2'));var rp=require(_0x534e('0x3'));var moment=require(_0x534e('0x4'));var BPromise=require(_0x534e('0x5'));var Mustache=require('mustache');var util=require(_0x534e('0x6'));var path=require(_0x534e('0x7'));var sox=require(_0x534e('0x8'));var csv=require(_0x534e('0x9'));var ejs=require(_0x534e('0xa'));var fs=require('fs');var _=require(_0x534e('0xb'));var squel=require(_0x534e('0xc'));var crypto=require('crypto');var jsforce=require(_0x534e('0xd'));var deskjs=require(_0x534e('0xe'));var toCsv=require(_0x534e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x534e('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x534e('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x534e('0x11'))(_0x534e('0x12'));var utils=require(_0x534e('0x13'));var config=require('../../config/environment');var db=require(_0x534e('0x14'))['db'];config[_0x534e('0x15')]=_[_0x534e('0x16')](config[_0x534e('0x15')],{'host':_0x534e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x534e('0x15')]));require(_0x534e('0x18'))[_0x534e('0x19')](socket);var jayson=require(_0x534e('0x1a'));var client=jayson[_0x534e('0x1b')][_0x534e('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x3e1411,_0x17c068,_0x536c9e,_0x5282cb){return new BPromise(function(_0x4171d6,_0x3940c3){var _0x5bdae2=_0x5282cb||client;return _0x5bdae2['request'](_0x3e1411,_0x536c9e)[_0x534e('0x1d')](function(_0x28ff67){logger[_0x534e('0x1e')](_0x534e('0x1f'),_0x17c068,_0x534e('0x20'));logger[_0x534e('0x21')](_0x534e('0x22'),_0x17c068,'request\x20sent',JSON[_0x534e('0x23')](_0x28ff67));if(_0x28ff67[_0x534e('0x24')]){if(_0x28ff67[_0x534e('0x24')][_0x534e('0x25')]===0x1f4){logger[_0x534e('0x24')]('MailAccount,\x20%s,\x20%s',_0x17c068,_0x28ff67[_0x534e('0x24')][_0x534e('0x26')]);return _0x3940c3(_0x28ff67[_0x534e('0x24')][_0x534e('0x26')]);}logger[_0x534e('0x24')](_0x534e('0x1f'),_0x17c068,_0x28ff67[_0x534e('0x24')][_0x534e('0x26')]);return _0x4171d6(_0x28ff67[_0x534e('0x24')]['message']);}else{logger[_0x534e('0x1e')](_0x534e('0x1f'),_0x17c068,_0x534e('0x20'));_0x4171d6(_0x28ff67[_0x534e('0x27')][_0x534e('0x26')]);}})[_0x534e('0x28')](function(_0xf60d40){logger[_0x534e('0x24')]('MailAccount,\x20%s,\x20%s',_0x17c068,_0xf60d40);_0x3940c3(_0xf60d40);});});}function respondWithStatusCode(_0x42beee,_0x588c08){_0x588c08=_0x588c08||0xcc;return function(_0xb83f1){if(_0xb83f1){return _0x42beee[_0x534e('0x29')](_0x588c08);}return _0x42beee[_0x534e('0x2a')](_0x588c08)[_0x534e('0x2b')]();};}function respondWithResult(_0x174577,_0x57b216){_0x57b216=_0x57b216||0xc8;return function(_0x743974){if(_0x743974){return _0x174577[_0x534e('0x2a')](_0x57b216)['json'](_0x743974);}};}function respondWithFilteredResult(_0x4bd073,_0x3abacf){return function(_0x534783){if(_0x534783){var _0x42fe90=_0x534783[_0x534e('0x2c')],_0x3c5c11=_0x3abacf[_0x534e('0x2d')],_0x281cda=_0x3abacf[_0x534e('0x2d')]+_0x3abacf['limit'],_0x122225;if(_0x281cda>=_0x42fe90){_0x281cda=_0x42fe90;_0x122225=0xc8;}else{_0x122225=0xce;}_0x4bd073['status'](_0x122225);return _0x4bd073[_0x534e('0x2e')](_0x534e('0x2f'),_0x3c5c11+'-'+_0x281cda+'/'+_0x42fe90)[_0x534e('0x30')](_0x534783);}return null;};}function patchUpdates(_0x2f1c49){return function(_0x423502){try{jsonpatch[_0x534e('0x31')](_0x423502,_0x2f1c49,!![]);}catch(_0x2e6e15){return BPromise[_0x534e('0x32')](_0x2e6e15);}return _0x423502[_0x534e('0x33')]();};}function saveUpdates(_0x312744,_0x2867c9){return function(_0x1d6fb1){if(_0x1d6fb1){return _0x1d6fb1['update'](_0x312744)[_0x534e('0x1d')](function(_0x3ad091){return _0x3ad091;});}return null;};}function removeEntity(_0x5ba52a,_0x2c01a0){return function(_0x4db6b5){if(_0x4db6b5){return _0x4db6b5[_0x534e('0x34')]()[_0x534e('0x1d')](function(){var _0x2b565a=_0x4db6b5[_0x534e('0x35')]({'plain':!![]});var _0x508b94=_0x534e('0x36');return db[_0x534e('0x37')]['destroy']({'where':{'type':_0x508b94,'resourceId':_0x2b565a['id']}})['then'](function(){return _0x4db6b5;});})[_0x534e('0x1d')](function(){_0x5ba52a[_0x534e('0x2a')](0xcc)[_0x534e('0x2b')]();});}};}function handleEntityNotFound(_0x1ec431,_0x50f19c){return function(_0x348573){if(!_0x348573){_0x1ec431['sendStatus'](0x194);}return _0x348573;};}function handleError(_0x3e2445,_0x4a5aa1){_0x4a5aa1=_0x4a5aa1||0x1f4;return function(_0x3c74d2){logger[_0x534e('0x24')](_0x3c74d2['stack']);if(_0x3c74d2[_0x534e('0x38')]){delete _0x3c74d2['name'];}_0x3e2445['status'](_0x4a5aa1)['send'](_0x3c74d2);};}exports['index']=function(_0x422a7d,_0x4de87f){var _0x49f188={'include':[{'model':db[_0x534e('0x39')],'as':'Imap'},{'model':db[_0x534e('0x3a')],'as':_0x534e('0x3b')},{'model':db['Pause'],'as':_0x534e('0x3c')}]},_0x2b8b70={},_0xa5227d={'count':0x0,'rows':[]};var _0x47c952=db[_0x534e('0x3d')][_0x534e('0x3e')];_0x2b8b70['model']=_[_0x534e('0x3f')](_0x47c952);_0x2b8b70['query']=_[_0x534e('0x3f')](_0x422a7d[_0x534e('0x40')]);_0x2b8b70[_0x534e('0x41')]=_[_0x534e('0x42')](_0x2b8b70['model'],_0x2b8b70['query']);_0x49f188[_0x534e('0x43')]=_['intersection'](_0x2b8b70[_0x534e('0x44')],qs[_0x534e('0x45')](_0x422a7d[_0x534e('0x40')][_0x534e('0x45')]));_0x49f188['attributes']=_0x49f188[_0x534e('0x43')][_0x534e('0x46')]?_0x49f188[_0x534e('0x43')]:_0x2b8b70['model'];if(!_0x422a7d[_0x534e('0x40')]['hasOwnProperty'](_0x534e('0x47'))){_0x49f188[_0x534e('0x48')]=qs[_0x534e('0x48')](_0x422a7d['query'][_0x534e('0x48')]);_0x49f188[_0x534e('0x2d')]=qs[_0x534e('0x2d')](_0x422a7d[_0x534e('0x40')][_0x534e('0x2d')]);}_0x49f188[_0x534e('0x49')]=qs[_0x534e('0x4a')](_0x422a7d['query'][_0x534e('0x4a')]);_0x49f188['where']=qs['filters'](_[_0x534e('0x4b')](_0x422a7d[_0x534e('0x40')],_0x2b8b70[_0x534e('0x41')]));if(_0x422a7d[_0x534e('0x40')][_0x534e('0x4c')]){_0x49f188[_0x534e('0x4d')]=_['merge'](_0x49f188[_0x534e('0x4d')],{'$or':_[_0x534e('0x4e')](_0x47c952,function(_0x43436d){if(_0x43436d['type'][_0x534e('0x4f')]!=='VIRTUAL'){var _0x2057d0={};_0x2057d0[_0x43436d[_0x534e('0x50')]]={'$like':'%'+_0x422a7d[_0x534e('0x40')][_0x534e('0x4c')]+'%'};return _0x2057d0;}})});}_0x49f188=_[_0x534e('0x51')]({},_0x49f188,_0x422a7d[_0x534e('0x52')]);var _0x47ca68={'where':_0x49f188[_0x534e('0x4d')]};return db['MailAccount']['count'](_0x47ca68)[_0x534e('0x1d')](function(_0x1f93be){_0xa5227d[_0x534e('0x2c')]=_0x1f93be;if(_0x422a7d[_0x534e('0x40')][_0x534e('0x53')]){_0x49f188[_0x534e('0x54')]=[{'all':!![]}];}return db[_0x534e('0x3d')][_0x534e('0x55')](_0x49f188);})[_0x534e('0x1d')](function(_0x5d9c28){_0xa5227d[_0x534e('0x56')]=_0x5d9c28;return _0xa5227d;})[_0x534e('0x1d')](respondWithFilteredResult(_0x4de87f,_0x49f188))[_0x534e('0x28')](handleError(_0x4de87f,null));};exports[_0x534e('0x57')]=function(_0x49118f,_0x53bee4){var _0x40b59a={'raw':![],'where':{'id':_0x49118f[_0x534e('0x58')]['id']},'include':[{'model':db[_0x534e('0x39')],'as':_0x534e('0x59')},{'model':db[_0x534e('0x3a')],'as':_0x534e('0x3b')},{'model':db[_0x534e('0x5a')],'as':_0x534e('0x3c')}]},_0x27da25={};_0x27da25[_0x534e('0x44')]=_[_0x534e('0x3f')](db['MailAccount'][_0x534e('0x3e')]);_0x27da25[_0x534e('0x40')]=_['keys'](_0x49118f[_0x534e('0x40')]);_0x27da25[_0x534e('0x41')]=_[_0x534e('0x42')](_0x27da25['model'],_0x27da25['query']);_0x40b59a[_0x534e('0x43')]=_[_0x534e('0x42')](_0x27da25[_0x534e('0x44')],qs[_0x534e('0x45')](_0x49118f[_0x534e('0x40')][_0x534e('0x45')]));_0x40b59a[_0x534e('0x43')]=_0x40b59a[_0x534e('0x43')][_0x534e('0x46')]?_0x40b59a['attributes']:_0x27da25['model'];if(_0x49118f[_0x534e('0x40')]['includeAll']){_0x40b59a[_0x534e('0x54')]=[{'all':!![]}];}_0x40b59a=_[_0x534e('0x51')]({},_0x40b59a,_0x49118f[_0x534e('0x52')]);return db[_0x534e('0x3d')][_0x534e('0x5b')](_0x40b59a)['then'](handleEntityNotFound(_0x53bee4,null))[_0x534e('0x1d')](respondWithResult(_0x53bee4,null))[_0x534e('0x28')](handleError(_0x53bee4,null));};exports['update']=function(_0x5013e4,_0x140727){if(_0x5013e4['body']['id']){delete _0x5013e4['body']['id'];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x5013e4[_0x534e('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x534e('0x59')},{'model':db[_0x534e('0x3a')],'as':'Smtp'},{'model':db['Pause'],'as':_0x534e('0x3c')}]})[_0x534e('0x1d')](handleEntityNotFound(_0x140727,null))['then'](saveUpdates(_0x5013e4['body'],null))[_0x534e('0x1d')](function(_0x590153){if(_0x590153&&_0x5013e4['body']['Imap']){return db[_0x534e('0x39')][_0x534e('0x5c')](_0x5013e4[_0x534e('0x5d')][_0x534e('0x59')],{'where':{'MailAccountId':_0x590153['id']}})[_0x534e('0x1d')](function(){return _0x590153;});}return _0x590153;})[_0x534e('0x1d')](function(_0xe0b1bd){if(_0xe0b1bd&&_0x5013e4[_0x534e('0x5d')][_0x534e('0x3b')]){return db[_0x534e('0x3a')]['update'](_0x5013e4[_0x534e('0x5d')][_0x534e('0x3b')],{'where':{'MailAccountId':_0xe0b1bd['id']}})[_0x534e('0x1d')](function(){return _0xe0b1bd;});}return _0xe0b1bd;})[_0x534e('0x1d')](respondWithResult(_0x140727,null))[_0x534e('0x28')](handleError(_0x140727,null));};exports['describe']=function(_0x42f39f,_0x5058d0){return db[_0x534e('0x3d')][_0x534e('0x5e')]()[_0x534e('0x1d')](respondWithResult(_0x5058d0,null))[_0x534e('0x28')](handleError(_0x5058d0,null));};exports['addDisposition']=function(_0x81359d,_0x5b1301,_0x33b44e){if(_0x81359d[_0x534e('0x5d')]['id']){delete _0x81359d[_0x534e('0x5d')]['id'];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x81359d[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x5b1301,null))[_0x534e('0x1d')](function(_0x5775e7){if(_0x5775e7){_0x81359d['body'][_0x534e('0x5f')]=_0x5775e7['id'];return db[_0x534e('0x60')][_0x534e('0x61')](_0x81359d['body']);}})[_0x534e('0x1d')](respondWithResult(_0x5b1301,null))[_0x534e('0x28')](handleError(_0x5b1301,null));};exports[_0x534e('0x62')]=function(_0x145771,_0x29c1d4,_0x5d7978){var _0x1927a8={'raw':![],'where':{}};var _0x17cfe0={};var _0x30b3e4={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x145771[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x29c1d4,null))['then'](function(_0x411b3c){if(_0x411b3c){_0x17cfe0[_0x534e('0x44')]=_[_0x534e('0x3f')](db['Disposition']['rawAttributes']);_0x17cfe0[_0x534e('0x40')]=_[_0x534e('0x3f')](_0x145771[_0x534e('0x40')]);_0x17cfe0[_0x534e('0x41')]=_[_0x534e('0x42')](_0x17cfe0['model'],_0x17cfe0[_0x534e('0x40')]);_0x1927a8['attributes']=_[_0x534e('0x42')](_0x17cfe0[_0x534e('0x44')],qs[_0x534e('0x45')](_0x145771['query'][_0x534e('0x45')]));_0x1927a8[_0x534e('0x43')]=_0x1927a8[_0x534e('0x43')][_0x534e('0x46')]?_0x1927a8['attributes']:_0x17cfe0[_0x534e('0x44')];if(!_0x145771['query'][_0x534e('0x63')](_0x534e('0x47'))){_0x1927a8['limit']=qs[_0x534e('0x48')](_0x145771[_0x534e('0x40')][_0x534e('0x48')]);_0x1927a8[_0x534e('0x2d')]=qs[_0x534e('0x2d')](_0x145771['query'][_0x534e('0x2d')]);}_0x1927a8[_0x534e('0x49')]=qs[_0x534e('0x4a')](_0x145771[_0x534e('0x40')]['sort']);_0x1927a8[_0x534e('0x4d')]=qs['filters'](_[_0x534e('0x4b')](_0x145771[_0x534e('0x40')],_0x17cfe0[_0x534e('0x41')]));_0x1927a8[_0x534e('0x4d')]['MailAccountId']=_0x411b3c['id'];if(_0x145771[_0x534e('0x40')][_0x534e('0x4c')]){_0x1927a8[_0x534e('0x4d')]=_[_0x534e('0x51')](_0x1927a8[_0x534e('0x4d')],{'$or':_['map'](_0x1927a8['attributes'],function(_0x73d2fd){var _0x2da14f={};_0x2da14f[_0x73d2fd]={'$like':'%'+_0x145771['query'][_0x534e('0x4c')]+'%'};return _0x2da14f;})});}_0x1927a8=_[_0x534e('0x51')]({},_0x1927a8,_0x145771[_0x534e('0x52')]);return db[_0x534e('0x60')][_0x534e('0x2c')]({'where':_0x1927a8[_0x534e('0x4d')]})['then'](function(_0x2d91e7){_0x30b3e4[_0x534e('0x2c')]=_0x2d91e7;if(_0x145771[_0x534e('0x40')][_0x534e('0x53')]){_0x1927a8[_0x534e('0x54')]=[{'all':!![]}];}return db[_0x534e('0x60')]['findAll'](_0x1927a8);})['then'](function(_0x39c646){_0x30b3e4[_0x534e('0x56')]=_0x39c646;return _0x30b3e4;});}})['then'](respondWithFilteredResult(_0x29c1d4,_0x1927a8))['catch'](handleError(_0x29c1d4,null));};exports[_0x534e('0x64')]=function(_0x12098a,_0x5363c2,_0x1602cf){var _0x12f4fc;return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x12098a[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x5363c2,null))[_0x534e('0x1d')](function(_0x4cf84f){if(_0x4cf84f){return _0x4cf84f[_0x534e('0x64')](_0x12098a[_0x534e('0x40')][_0x534e('0x65')]);}})[_0x534e('0x1d')](respondWithStatusCode(_0x5363c2,null))['catch'](handleError(_0x5363c2,null));};exports[_0x534e('0x66')]=function(_0xb2a129,_0x5e2a23,_0x5a5c01){if(_0xb2a129[_0x534e('0x5d')]['id']){delete _0xb2a129['body']['id'];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0xb2a129[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x5e2a23,null))[_0x534e('0x1d')](function(_0xbeca87){if(_0xbeca87){_0xb2a129[_0x534e('0x5d')][_0x534e('0x5f')]=_0xbeca87['id'];return db['CannedAnswer'][_0x534e('0x61')](_0xb2a129['body']);}})[_0x534e('0x1d')](respondWithResult(_0x5e2a23,null))[_0x534e('0x28')](handleError(_0x5e2a23,null));};exports['getAnswers']=function(_0x567a7c,_0x4e39c4,_0x238438){var _0x34e416={'raw':![],'where':{}};var _0x5f2993={};var _0x15281b={'count':0x0,'rows':[]};return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x567a7c['params']['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x4e39c4,null))[_0x534e('0x1d')](function(_0x5203d0){if(_0x5203d0){_0x5f2993[_0x534e('0x44')]=_[_0x534e('0x3f')](db[_0x534e('0x68')][_0x534e('0x3e')]);_0x5f2993[_0x534e('0x40')]=_[_0x534e('0x3f')](_0x567a7c[_0x534e('0x40')]);_0x5f2993[_0x534e('0x41')]=_[_0x534e('0x42')](_0x5f2993[_0x534e('0x44')],_0x5f2993[_0x534e('0x40')]);_0x34e416['attributes']=_[_0x534e('0x42')](_0x5f2993['model'],qs[_0x534e('0x45')](_0x567a7c[_0x534e('0x40')][_0x534e('0x45')]));_0x34e416['attributes']=_0x34e416[_0x534e('0x43')][_0x534e('0x46')]?_0x34e416[_0x534e('0x43')]:_0x5f2993[_0x534e('0x44')];if(!_0x567a7c[_0x534e('0x40')]['hasOwnProperty'](_0x534e('0x47'))){_0x34e416['limit']=qs['limit'](_0x567a7c[_0x534e('0x40')][_0x534e('0x48')]);_0x34e416['offset']=qs['offset'](_0x567a7c[_0x534e('0x40')]['offset']);}_0x34e416[_0x534e('0x49')]=qs[_0x534e('0x4a')](_0x567a7c[_0x534e('0x40')][_0x534e('0x4a')]);_0x34e416[_0x534e('0x4d')]=qs[_0x534e('0x41')](_[_0x534e('0x4b')](_0x567a7c[_0x534e('0x40')],_0x5f2993['filters']));_0x34e416['where'][_0x534e('0x5f')]=_0x5203d0['id'];if(_0x567a7c[_0x534e('0x40')]['filter']){_0x34e416[_0x534e('0x4d')]=_[_0x534e('0x51')](_0x34e416[_0x534e('0x4d')],{'$or':_['map'](_0x34e416[_0x534e('0x43')],function(_0x42dcf6){var _0x45a8d8={};_0x45a8d8[_0x42dcf6]={'$like':'%'+_0x567a7c[_0x534e('0x40')][_0x534e('0x4c')]+'%'};return _0x45a8d8;})});}_0x34e416=_[_0x534e('0x51')]({},_0x34e416,_0x567a7c[_0x534e('0x52')]);return db[_0x534e('0x68')][_0x534e('0x2c')]({'where':_0x34e416['where']})['then'](function(_0x4c3c23){_0x15281b[_0x534e('0x2c')]=_0x4c3c23;if(_0x567a7c[_0x534e('0x40')][_0x534e('0x53')]){_0x34e416[_0x534e('0x54')]=[{'all':!![]}];}return db[_0x534e('0x68')][_0x534e('0x55')](_0x34e416);})[_0x534e('0x1d')](function(_0x3017f3){_0x15281b['rows']=_0x3017f3;return _0x15281b;});}})[_0x534e('0x1d')](respondWithFilteredResult(_0x4e39c4,_0x34e416))['catch'](handleError(_0x4e39c4,null));};exports[_0x534e('0x69')]=function(_0x4aca66,_0x5066db,_0x4a25ae){var _0x41b538;return db['MailAccount'][_0x534e('0x5b')]({'where':{'id':_0x4aca66[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x5066db,null))['then'](function(_0x187195){if(_0x187195){return _0x187195['removeAnswers'](_0x4aca66['query'][_0x534e('0x65')]);}})[_0x534e('0x1d')](respondWithStatusCode(_0x5066db,null))[_0x534e('0x28')](handleError(_0x5066db,null));};exports[_0x534e('0x61')]=function(_0x49ea32,_0x316a75){var _0x1380c9={'name':_0x49ea32[_0x534e('0x5d')][_0x534e('0x38')],'key':_0x49ea32['body']['key'],'email':_0x49ea32[_0x534e('0x5d')][_0x534e('0x6a')],'ListId':_0x49ea32[_0x534e('0x5d')][_0x534e('0x6b')],'active':!_['isNil'](_0x49ea32[_0x534e('0x5d')][_0x534e('0x6c')])?_0x49ea32[_0x534e('0x5d')][_0x534e('0x6c')]:!![],'description':_0x49ea32[_0x534e('0x5d')][_0x534e('0x6d')]||null,'Imap':{},'Smtp':{}};if(_[_0x534e('0x6e')](_0x49ea32[_0x534e('0x5d')][_0x534e('0x6f')])){if(_0x49ea32[_0x534e('0x5d')][_0x534e('0x70')]){_0x1380c9[_0x534e('0x59')][_0x534e('0x71')]=_0x1380c9['Smtp'][_0x534e('0x71')]=_0x49ea32[_0x534e('0x5d')][_0x534e('0x72')];_0x1380c9[_0x534e('0x59')]['password']=_0x1380c9[_0x534e('0x3b')]['pass']=_0x49ea32[_0x534e('0x5d')]['cpassword'];}else{_0x1380c9[_0x534e('0x59')][_0x534e('0x73')]=_0x1380c9['Smtp'][_0x534e('0x73')]=![];}_0x1380c9[_0x534e('0x59')]['host']=_0x49ea32['body'][_0x534e('0x59')][_0x534e('0x74')];_0x1380c9['Imap'][_0x534e('0x75')]=_0x49ea32[_0x534e('0x5d')][_0x534e('0x59')][_0x534e('0x75')];_0x1380c9[_0x534e('0x3b')][_0x534e('0x74')]=_0x49ea32[_0x534e('0x5d')][_0x534e('0x3b')][_0x534e('0x74')];_0x1380c9[_0x534e('0x3b')]['port']=_0x49ea32['body'][_0x534e('0x3b')][_0x534e('0x75')];}else{_0x1380c9[_0x534e('0x59')][_0x534e('0x76')]=_0x1380c9['Smtp'][_0x534e('0x76')]=_0x49ea32['body'][_0x534e('0x6f')];_0x1380c9[_0x534e('0x59')][_0x534e('0x71')]=_0x1380c9[_0x534e('0x3b')]['user']=_0x49ea32['body'][_0x534e('0x72')];_0x1380c9[_0x534e('0x59')][_0x534e('0x77')]=_0x1380c9[_0x534e('0x3b')][_0x534e('0x78')]=_0x49ea32[_0x534e('0x5d')][_0x534e('0x79')];}return db[_0x534e('0x3d')]['create'](_0x1380c9,{'include':[{'model':db[_0x534e('0x3a')],'as':_0x534e('0x3b')},{'model':db[_0x534e('0x39')],'as':_0x534e('0x59')}]})['then'](function(_0x5b1981){var _0x130a33=_0x49ea32[_0x534e('0x71')][_0x534e('0x35')]({'plain':!![]});if(!_0x130a33)throw new Error(_0x534e('0x7a'));if(_0x130a33[_0x534e('0x7b')]===_0x534e('0x71')){var _0x580201=_0x5b1981[_0x534e('0x35')]({'plain':!![]});return db[_0x534e('0x7c')]['find']({'where':{'name':_0x534e('0x36'),'userProfileId':_0x130a33[_0x534e('0x7d')]},'raw':!![]})[_0x534e('0x1d')](function(_0x5c58ab){if(_0x5c58ab&&_0x5c58ab[_0x534e('0x7e')]===0x0){return db[_0x534e('0x37')][_0x534e('0x61')]({'name':_0x580201[_0x534e('0x38')],'resourceId':_0x580201['id'],'type':_0x5c58ab[_0x534e('0x38')],'sectionId':_0x5c58ab['id']},{})[_0x534e('0x1d')](function(){return _0x5b1981;});}else{return _0x5b1981;}})[_0x534e('0x28')](function(_0x11b5ad){logger[_0x534e('0x24')](_0x534e('0x7f'),_0x11b5ad);throw _0x11b5ad;});}return _0x5b1981;})[_0x534e('0x1d')](respondWithResult(_0x316a75,0xc9))['catch'](handleError(_0x316a75,null));};exports[_0x534e('0x80')]=function(_0x4d54fb,_0x2f2fb1,_0xbbd6b2){return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x4d54fb['params']['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x2f2fb1,null))['then'](function(_0x326864){if(_0x326864){return _0x326864['getImap']();}return null;})[_0x534e('0x1d')](respondWithResult(_0x2f2fb1,null))[_0x534e('0x28')](handleError(_0x2f2fb1,null));};exports[_0x534e('0x81')]=function(_0x53e8eb,_0x2e79ea,_0x5df13f){if(_0x53e8eb['body']['id']){delete _0x53e8eb[_0x534e('0x5d')]['id'];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x53e8eb[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x2e79ea,null))[_0x534e('0x1d')](function(_0x2228f2){if(_0x2228f2){_0x53e8eb[_0x534e('0x5d')]['MailAccountId']=_0x2228f2['id'];return db['MailServerIn'][_0x534e('0x61')](_0x53e8eb['body']);}})['then'](respondWithResult(_0x2e79ea,null))[_0x534e('0x28')](handleError(_0x2e79ea,null));};exports[_0x534e('0x82')]=function(_0x2f84cc,_0x3589d2,_0x276e84){return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x2f84cc[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x3589d2,null))[_0x534e('0x1d')](function(_0x3c5bd5){if(_0x3c5bd5){return _0x3c5bd5['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x3589d2,null))[_0x534e('0x28')](handleError(_0x3589d2,null));};exports[_0x534e('0x83')]=function(_0x19d07,_0x4ed1d4,_0x5e87ef){return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x19d07[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x4ed1d4,null))[_0x534e('0x1d')](function(_0x44719f){if(_0x44719f){return _0x44719f['getSmtp']();}return null;})['then'](respondWithResult(_0x4ed1d4,null))[_0x534e('0x28')](handleError(_0x4ed1d4,null));};exports[_0x534e('0x84')]=function(_0x7eea5f,_0x4182db,_0x2a303d){if(_0x7eea5f[_0x534e('0x5d')]['id']){delete _0x7eea5f[_0x534e('0x5d')]['id'];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x7eea5f[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x4182db,null))[_0x534e('0x1d')](function(_0x5d1f51){if(_0x5d1f51){_0x7eea5f['body'][_0x534e('0x5f')]=_0x5d1f51['id'];return db[_0x534e('0x3a')][_0x534e('0x61')](_0x7eea5f[_0x534e('0x5d')]);}})[_0x534e('0x1d')](respondWithResult(_0x4182db,null))[_0x534e('0x28')](handleError(_0x4182db,null));};exports[_0x534e('0x85')]=function(_0x1caead,_0x226505,_0x2ff4f4){return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x1caead[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x226505,null))[_0x534e('0x1d')](function(_0xb8325){if(_0xb8325){return _0xb8325[_0x534e('0x86')](null);}return null;})[_0x534e('0x1d')](respondWithStatusCode(_0x226505,null))[_0x534e('0x28')](handleError(_0x226505,null));};exports['addInteraction']=function(_0x2be9e2,_0x5c8e69,_0x2dbbde){return db['MailInteraction']['find']({'where':{'id':_0x2be9e2[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x5c8e69,null))[_0x534e('0x1d')](function(_0x285abe){if(_0x285abe){return _0x285abe[_0x534e('0x87')](_0x2be9e2[_0x534e('0x5d')][_0x534e('0x65')],_[_0x534e('0x88')](_0x2be9e2[_0x534e('0x5d')],[_0x534e('0x65'),'id'])||{});}})[_0x534e('0x1d')](respondWithResult(_0x5c8e69,null))[_0x534e('0x28')](handleError(_0x5c8e69,null));};exports[_0x534e('0x89')]=function(_0x2e8b8e,_0x1bfc78,_0x4c1f8b){var _0x112479={'raw':![],'where':{}};var _0xec1931={};var _0x3ef0b9={'count':0x0,'rows':[]};return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x2e8b8e['params']['id']}})['then'](handleEntityNotFound(_0x1bfc78,null))[_0x534e('0x1d')](function(_0x3f9b43){if(_0x3f9b43){_0xec1931[_0x534e('0x44')]=_[_0x534e('0x3f')](db[_0x534e('0x8a')][_0x534e('0x3e')]);_0xec1931[_0x534e('0x40')]=_['keys'](_0x2e8b8e[_0x534e('0x40')]);_0xec1931[_0x534e('0x41')]=_[_0x534e('0x42')](_0xec1931[_0x534e('0x44')],_0xec1931[_0x534e('0x40')]);_0x112479['attributes']=_[_0x534e('0x42')](_0xec1931[_0x534e('0x44')],qs[_0x534e('0x45')](_0x2e8b8e[_0x534e('0x40')]['fields']));_0x112479['attributes']=_0x112479['attributes'][_0x534e('0x46')]?_0x112479['attributes']:_0xec1931[_0x534e('0x44')];if(!_0x2e8b8e[_0x534e('0x40')][_0x534e('0x63')](_0x534e('0x47'))){_0x112479['limit']=qs[_0x534e('0x48')](_0x2e8b8e[_0x534e('0x40')][_0x534e('0x48')]);_0x112479['offset']=qs[_0x534e('0x2d')](_0x2e8b8e[_0x534e('0x40')]['offset']);}_0x112479[_0x534e('0x49')]=qs[_0x534e('0x4a')](_0x2e8b8e[_0x534e('0x40')][_0x534e('0x4a')]);_0x112479[_0x534e('0x4d')]=qs[_0x534e('0x41')](_[_0x534e('0x4b')](_0x2e8b8e[_0x534e('0x40')],_0xec1931['filters']));_0x112479['where']['MailAccountId']=_0x3f9b43['id'];if(_0x2e8b8e[_0x534e('0x40')][_0x534e('0x4c')]){_0x112479[_0x534e('0x4d')]=_[_0x534e('0x51')](_0x112479[_0x534e('0x4d')],{'$or':_[_0x534e('0x4e')](_0x112479[_0x534e('0x43')],function(_0x36289c){var _0x580de1={};_0x580de1[_0x36289c]={'$like':'%'+_0x2e8b8e[_0x534e('0x40')][_0x534e('0x4c')]+'%'};return _0x580de1;})});}_0x112479=_[_0x534e('0x51')]({},_0x112479,_0x2e8b8e[_0x534e('0x52')]);return db['MailInteraction'][_0x534e('0x2c')]({'where':_0x112479[_0x534e('0x4d')]})[_0x534e('0x1d')](function(_0x12d30d){_0x3ef0b9[_0x534e('0x2c')]=_0x12d30d;if(_0x2e8b8e['query'][_0x534e('0x53')]){_0x112479[_0x534e('0x54')]=[{'model':db[_0x534e('0x8b')],'as':_0x534e('0x8c'),'required':![]},{'model':db[_0x534e('0x8d')],'as':'Owner','attributes':[_0x534e('0x38'),_0x534e('0x8e'),_0x534e('0x8f')],'required':![]},{'model':db['Tag'],'as':_0x534e('0x90'),'attributes':['id',_0x534e('0x38'),_0x534e('0x91')],'where':_0x2e8b8e[_0x534e('0x40')][_0x534e('0x92')]?{'id':_0x2e8b8e[_0x534e('0x40')][_0x534e('0x92')]}:undefined,'required':_0x2e8b8e[_0x534e('0x40')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x534e('0x55')](_0x112479);})[_0x534e('0x1d')](function(_0x510251){_0x3ef0b9[_0x534e('0x56')]=_0x510251;return _0x3ef0b9;});}})[_0x534e('0x1d')](respondWithFilteredResult(_0x1bfc78,_0x112479))[_0x534e('0x28')](handleError(_0x1bfc78,null));};exports[_0x534e('0x93')]=function(_0x2d6bb1,_0xe8415c,_0x1013b5){return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x2d6bb1[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0xe8415c,null))['then'](function(_0xcf852f){if(_0xcf852f){return db['sequelize'][_0x534e('0x94')](function(_0x5e2bdd){return db[_0x534e('0x95')][_0x534e('0x34')]({'where':{'MailAccountId':_0x2d6bb1['params']['id']},'transaction':_0x5e2bdd})[_0x534e('0x1d')](function(_0x464fd1){var _0x17cede=_[_0x534e('0x4e')](_0x2d6bb1[_0x534e('0x5d')],function(_0x3206bb){_0x3206bb[_0x534e('0x5f')]=_0x2d6bb1[_0x534e('0x58')]['id'];return _0x3206bb;});return db['MailApplication'][_0x534e('0x96')](_0x17cede,{'transaction':_0x5e2bdd});});})[_0x534e('0x1d')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x2d6bb1[_0x534e('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xe8415c,null))[_0x534e('0x28')](handleError(_0xe8415c,null));};exports['getApplications']=function(_0x5d28d8,_0x5995ac,_0x28c2ff){var _0x3adb3f={};var _0x45f842={};var _0x6a4c83;var _0x29eb3c;return db[_0x534e('0x3d')]['findOne']({'where':{'id':_0x5d28d8['params']['id']}})['then'](handleEntityNotFound(_0x5995ac,null))[_0x534e('0x1d')](function(_0x46d404){if(_0x46d404){_0x6a4c83=_0x46d404;_0x45f842[_0x534e('0x44')]=_['keys'](db[_0x534e('0x95')][_0x534e('0x3e')]);_0x45f842[_0x534e('0x40')]=_['keys'](_0x5d28d8['query']);_0x45f842[_0x534e('0x41')]=_[_0x534e('0x42')](_0x45f842[_0x534e('0x44')],_0x45f842['query']);_0x3adb3f[_0x534e('0x43')]=_['intersection'](_0x45f842[_0x534e('0x44')],qs[_0x534e('0x45')](_0x5d28d8[_0x534e('0x40')][_0x534e('0x45')]));_0x3adb3f[_0x534e('0x43')]=_0x3adb3f[_0x534e('0x43')]['length']?_0x3adb3f['attributes']:_0x45f842['model'];_0x3adb3f[_0x534e('0x49')]=qs[_0x534e('0x4a')](_0x5d28d8[_0x534e('0x40')][_0x534e('0x4a')]);_0x3adb3f[_0x534e('0x4d')]=qs[_0x534e('0x41')](_['pick'](_0x5d28d8[_0x534e('0x40')],_0x45f842[_0x534e('0x41')]));if(_0x5d28d8[_0x534e('0x40')][_0x534e('0x4c')]){_0x3adb3f[_0x534e('0x4d')]=_[_0x534e('0x51')](_0x3adb3f['where'],{'$or':_[_0x534e('0x4e')](_0x3adb3f[_0x534e('0x43')],function(_0x25ac28){var _0x316261={};_0x316261[_0x25ac28]={'$like':'%'+_0x5d28d8[_0x534e('0x40')][_0x534e('0x4c')]+'%'};return _0x316261;})});}_0x3adb3f=_[_0x534e('0x51')]({},_0x3adb3f,_0x5d28d8[_0x534e('0x52')]);return _0x6a4c83['getApplications'](_0x3adb3f);}})[_0x534e('0x1d')](function(_0x225296){if(_0x225296){_0x29eb3c=_0x225296[_0x534e('0x46')];if(!_0x5d28d8[_0x534e('0x40')][_0x534e('0x63')](_0x534e('0x47'))){_0x3adb3f['limit']=qs[_0x534e('0x48')](_0x5d28d8['query'][_0x534e('0x48')]);_0x3adb3f[_0x534e('0x2d')]=qs[_0x534e('0x2d')](_0x5d28d8[_0x534e('0x40')][_0x534e('0x2d')]);}return _0x6a4c83[_0x534e('0x97')](_0x3adb3f);}})[_0x534e('0x1d')](function(_0xfba315){if(_0xfba315){return _0xfba315?{'count':_0x29eb3c,'rows':_0xfba315}:null;}})[_0x534e('0x1d')](respondWithResult(_0x5995ac,null))[_0x534e('0x28')](handleError(_0x5995ac,null));};exports[_0x534e('0x98')]=function(_0x502e04,_0x97be3d,_0x9aa50){var _0xae1507={'raw':!![],'where':{}};var _0x5217dc={};var _0x321be5={'count':0x0,'rows':[]};return db[_0x534e('0x3d')][_0x534e('0x67')]({'where':{'id':_0x502e04['params']['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x97be3d,null))[_0x534e('0x1d')](function(_0x97e40e){if(_0x97e40e){_0x5217dc[_0x534e('0x44')]=_[_0x534e('0x3f')](db[_0x534e('0x99')][_0x534e('0x3e')]);_0x5217dc[_0x534e('0x40')]=_[_0x534e('0x3f')](_0x502e04[_0x534e('0x40')]);_0x5217dc['filters']=_[_0x534e('0x42')](_0x5217dc['model'],_0x5217dc['query']);_0xae1507[_0x534e('0x43')]=_[_0x534e('0x42')](_0x5217dc[_0x534e('0x44')],qs['fields'](_0x502e04[_0x534e('0x40')]['fields']));_0xae1507[_0x534e('0x43')]=_0xae1507[_0x534e('0x43')][_0x534e('0x46')]?_0xae1507[_0x534e('0x43')]:_0x5217dc['model'];if(!_0x502e04[_0x534e('0x40')][_0x534e('0x63')](_0x534e('0x47'))){_0xae1507[_0x534e('0x48')]=qs[_0x534e('0x48')](_0x502e04[_0x534e('0x40')]['limit']);_0xae1507[_0x534e('0x2d')]=qs[_0x534e('0x2d')](_0x502e04[_0x534e('0x40')][_0x534e('0x2d')]);}_0xae1507[_0x534e('0x49')]=qs['sort'](_0x502e04[_0x534e('0x40')][_0x534e('0x4a')]);_0xae1507[_0x534e('0x4d')]=qs[_0x534e('0x41')](_[_0x534e('0x4b')](_0x502e04['query'],_0x5217dc[_0x534e('0x41')]));_0xae1507[_0x534e('0x4d')][_0x534e('0x5f')]=_0x97e40e['id'];if(_0x502e04[_0x534e('0x40')][_0x534e('0x4c')]){_0xae1507['where']=_[_0x534e('0x51')](_0xae1507[_0x534e('0x4d')],{'$or':_[_0x534e('0x4e')](_0xae1507['attributes'],function(_0x5353ad){var _0x423c14={};_0x423c14[_0x5353ad]={'$like':'%'+_0x502e04['query']['filter']+'%'};return _0x423c14;})});}if(_0x502e04[_0x534e('0x40')]['$gte']){var _0x470661=_0x502e04[_0x534e('0x40')]['$gte']['split'](',');var _0x2e0010={};_0x2e0010[_0x470661[0x0]]={'$gte':moment(_0x470661[0x1])[_0x534e('0x9a')](_0x534e('0x9b'))};_0xae1507[_0x534e('0x4d')]=_[_0x534e('0x51')](_0xae1507[_0x534e('0x4d')],_0x2e0010);}_0xae1507=_[_0x534e('0x51')]({},_0xae1507,_0x502e04[_0x534e('0x52')]);return db[_0x534e('0x99')]['count']({'where':_0xae1507['where']})[_0x534e('0x1d')](function(_0x300ec2){_0x321be5[_0x534e('0x2c')]=_0x300ec2;if(_0x502e04['query']['includeAll']){_0xae1507[_0x534e('0x54')]=[{'all':!![]}];}return db[_0x534e('0x99')][_0x534e('0x55')](_0xae1507);})[_0x534e('0x1d')](function(_0x1ed8a7){_0x321be5['rows']=_0x1ed8a7;return _0x321be5;});}})[_0x534e('0x1d')](respondWithFilteredResult(_0x97be3d,_0xae1507))[_0x534e('0x28')](handleError(_0x97be3d,null));};exports[_0x534e('0x9c')]=function(_0x19735d,_0x5610ef,_0x2b7d77){var _0x1d6b1c,_0x804096={},_0x321451;if(_0x19735d[_0x534e('0x5d')]['to']){_0x321451=_0x19735d[_0x534e('0x5d')]['to'][_0x534e('0x9d')](',')[0x0];}return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x19735d[_0x534e('0x58')]['id']},'include':[{'model':db[_0x534e('0x9e')],'as':_0x534e('0x9f'),'include':[{'model':db[_0x534e('0x8b')],'as':'Contacts','where':{'email':_0x321451},'limit':0x1,'order':[[_0x534e('0xa0'),_0x534e('0xa1')]]}]},{'model':db[_0x534e('0x3a')],'as':'Smtp','raw':!![]}]})[_0x534e('0x1d')](handleEntityNotFound(_0x5610ef,null))[_0x534e('0x1d')](function(_0x13b6ca){if(_0x13b6ca){_0x1d6b1c=_0x13b6ca;if(_0x13b6ca[_0x534e('0x3b')]){if(_['isNil'](_0x19735d[_0x534e('0x5d')][_0x534e('0xa2')])){_0x19735d[_0x534e('0x5d')][_0x534e('0xa2')]=util['format'](_0x534e('0xa3'),_0x13b6ca[_0x534e('0x38')],_0x13b6ca[_0x534e('0x6a')]||_0x13b6ca[_0x534e('0x3b')][_0x534e('0x71')]);}if(_0x19735d[_0x534e('0x5d')]['attachments']&&_0x19735d[_0x534e('0x5d')][_0x534e('0xa4')][_0x534e('0x46')]){for(var _0x20dba4=0x0;_0x20dba4<_0x19735d[_0x534e('0x5d')][_0x534e('0xa4')][_0x534e('0x46')];_0x20dba4+=0x1){_0x19735d[_0x534e('0x5d')][_0x534e('0xa4')][_0x20dba4]={'filename':_0x19735d['body'][_0x534e('0xa4')][_0x20dba4][_0x534e('0x38')],'path':path['join'](config[_0x534e('0xa5')],_0x534e('0xa6'),_0x19735d[_0x534e('0x5d')][_0x534e('0xa4')][_0x20dba4][_0x534e('0xa7')])};}}var _0x14a3a1={'tls':{'rejectUnauthorized':![]}};if(_[_0x534e('0x6e')](_0x13b6ca[_0x534e('0x3b')][_0x534e('0x76')])){if(_0x13b6ca['Smtp'][_0x534e('0x73')]){_0x14a3a1[_0x534e('0xa8')]={'user':_0x13b6ca[_0x534e('0x3b')][_0x534e('0x71')],'pass':_0x13b6ca['Smtp']['pass']};}_0x14a3a1[_0x534e('0x74')]=_0x13b6ca[_0x534e('0x3b')]['host'];_0x14a3a1[_0x534e('0x75')]=_0x13b6ca[_0x534e('0x3b')][_0x534e('0x75')];_0x14a3a1[_0x534e('0xa9')]=_0x13b6ca[_0x534e('0x3b')][_0x534e('0xa9')];}else{_0x14a3a1['service']=_0x13b6ca[_0x534e('0x3b')]['service'];_0x14a3a1[_0x534e('0xa8')]={'user':_0x13b6ca[_0x534e('0x3b')][_0x534e('0x71')],'pass':_0x13b6ca[_0x534e('0x3b')]['pass']};}return respondWithRpcPromise(_0x534e('0xaa'),_0x534e('0xab'),{'account':_0x14a3a1,'message':_0x19735d[_0x534e('0x5d')]});}else{throw new Error('List\x20not\x20found');}}})[_0x534e('0x1d')](function(_0x178357){if(_0x178357){_0x804096=_0x178357;if(_0x1d6b1c['List']){if(_0x1d6b1c[_0x534e('0x9f')][_0x534e('0xac')][_0x534e('0x46')]){return _0x1d6b1c['List'][_0x534e('0xac')][0x0];}else{return db[_0x534e('0x8b')]['create'](_[_0x534e('0x16')](_0x19735d[_0x534e('0x5d')],{'firstName':_0x19735d[_0x534e('0x5d')]['to'],'email':_0x19735d['body']['to'],'phone':_0x19735d[_0x534e('0x5d')]['to'],'ListId':_0x1d6b1c['ListId']}));}}else{throw new Error(_0x534e('0xad'));}}})[_0x534e('0x1d')](function(_0x44173c){if(_0x44173c){var _0x1816a1={'UserId':_0x19735d[_0x534e('0x71')]['id'],'ContactId':_0x44173c['id'],'MailAccountId':_0x1d6b1c['id'],'inReplyTo':_0x804096[_0x534e('0xae')],'to':_0x19735d[_0x534e('0x5d')]['from'],'cc':_0x19735d[_0x534e('0x5d')]['cc'],'subject':_0x19735d[_0x534e('0x5d')][_0x534e('0xaf')],'attach':_0x19735d[_0x534e('0x5d')]['attach'],'firstMsgDirection':_0x534e('0xb0'),'lastMsgAt':moment()[_0x534e('0x9a')](_0x534e('0x9b')),'lastMsgDirection':'out','lastMsgBody':_0x19735d[_0x534e('0x5d')]['body'],'Messages':[_[_0x534e('0x51')](_0x19735d[_0x534e('0x5d')],{'messageId':_0x804096['messageId'],'sentAt':moment()[_0x534e('0x9a')](_0x534e('0x9b')),'read':!![],'MailAccountId':_0x1d6b1c['id'],'UserId':_0x19735d[_0x534e('0x71')]['id'],'ContactId':_0x44173c['id']})]};if(_0x19735d[_0x534e('0x5d')]['Interaction']){_0x1816a1=_[_0x534e('0x51')](_0x1816a1,_0x19735d['body'][_0x534e('0xb1')]);}return db[_0x534e('0x8a')]['create'](_0x1816a1,{'include':[{'model':db[_0x534e('0x99')],'as':_0x534e('0xb2')}]});}})['then'](respondWithResult(_0x5610ef,null))[_0x534e('0x28')](handleError(_0x5610ef,null));};exports['verifySmtp']=function(_0x49f148,_0x3bc8d6,_0x5444fd){return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x49f148['params']['id']},'include':[{'model':db[_0x534e('0x3a')],'as':_0x534e('0x3b'),'raw':!![]}]})[_0x534e('0x1d')](handleEntityNotFound(_0x3bc8d6,null))[_0x534e('0x1d')](function(_0x2d421a){if(_0x2d421a&&_0x2d421a[_0x534e('0x3b')]){var _0x86df37={'id':_0x2d421a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2d421a['Smtp'][_0x534e('0x76')]){_0x86df37[_0x534e('0x76')]=_0x2d421a[_0x534e('0x3b')]['service'];}else{_0x86df37[_0x534e('0x74')]=_0x2d421a[_0x534e('0x3b')][_0x534e('0x74')];_0x86df37[_0x534e('0x75')]=_0x2d421a[_0x534e('0x3b')][_0x534e('0x75')];_0x86df37[_0x534e('0xa9')]=_0x2d421a['Smtp'][_0x534e('0xa9')];}if(_0x2d421a[_0x534e('0x3b')][_0x534e('0x73')]){_0x86df37[_0x534e('0xa8')]={'user':_0x2d421a[_0x534e('0x3b')][_0x534e('0x71')],'pass':_0x2d421a[_0x534e('0x3b')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x534e('0xb3'),{'account':_0x86df37});}})['then'](respondWithResult(_0x3bc8d6,null))[_0x534e('0x28')](handleError(_0x3bc8d6,null));};exports[_0x534e('0x34')]=function(_0x5f5f99,_0x7de0d4){return db['MailAccount']['find']({'where':{'id':_0x5f5f99['params']['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x7de0d4,null))[_0x534e('0x1d')](function(_0x48cc94){if(_0x48cc94&&_0x48cc94['service']){throw new db[(_0x534e('0xb4'))][(_0x534e('0xb5'))](_0x534e('0xb6'));}return _0x48cc94;})[_0x534e('0x1d')](removeEntity(_0x7de0d4,null))['catch'](handleError(_0x7de0d4,null));};exports['addAgents']=function(_0x4323e7,_0x2cf0df,_0x527065){return db[_0x534e('0x3d')][_0x534e('0x5b')]({'where':{'id':_0x4323e7[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x2cf0df,null))[_0x534e('0x1d')](function(_0x3da89e){if(_0x3da89e){return _0x3da89e[_0x534e('0xb7')](_0x4323e7[_0x534e('0x5d')][_0x534e('0x65')],_[_0x534e('0x88')](_0x4323e7[_0x534e('0x5d')],[_0x534e('0x65'),'id'])||{})[_0x534e('0xb8')](function(_0x5115c1){for(var _0x2bea79=0x0;_0x2bea79<_0x4323e7[_0x534e('0x5d')][_0x534e('0x65')][_0x534e('0x46')];_0x2bea79+=0x1){socket[_0x534e('0xb9')](_0x534e('0xba'),{'UserId':_0x4323e7[_0x534e('0x5d')][_0x534e('0x65')][_0x2bea79],'MailAccountId':_0x4323e7['params']['id']});}return _0x5115c1;});}})['then'](respondWithResult(_0x2cf0df,null))[_0x534e('0x28')](handleError(_0x2cf0df,null));};exports[_0x534e('0xbb')]=function(_0x17d4cb,_0x37af06,_0x39eef9){var _0x1a87c2;return db['MailAccount'][_0x534e('0x5b')]({'where':{'id':_0x17d4cb[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x37af06,null))[_0x534e('0x1d')](function(_0x3891bc){if(_0x3891bc){return _0x3891bc[_0x534e('0xbb')](_0x17d4cb[_0x534e('0x40')][_0x534e('0x65')])[_0x534e('0x1d')](function(_0x412386){if(_['isArray'](_0x17d4cb[_0x534e('0x40')][_0x534e('0x65')])){for(var _0x408cbe=0x0;_0x408cbe<_0x17d4cb[_0x534e('0x40')][_0x534e('0x65')][_0x534e('0x46')];_0x408cbe+=0x1){socket[_0x534e('0xb9')](_0x534e('0xbc'),{'UserId':_0x17d4cb[_0x534e('0x40')][_0x534e('0x65')][_0x408cbe],'MailAccountId':_0x17d4cb[_0x534e('0x58')]['id']});}}else{socket[_0x534e('0xb9')](_0x534e('0xbc'),{'UserId':_0x17d4cb['query'][_0x534e('0x65')],'MailAccountId':_0x17d4cb[_0x534e('0x58')]['id']});}});}})[_0x534e('0x1d')](respondWithStatusCode(_0x37af06,null))[_0x534e('0x28')](handleError(_0x37af06,null));};exports[_0x534e('0xbd')]=function(_0x25b112,_0x270a8f,_0x81e71e){var _0x1d3cec={};var _0x205486={};var _0xde0348;var _0x1852c4;return db['MailAccount']['findOne']({'where':{'id':_0x25b112[_0x534e('0x58')]['id']}})[_0x534e('0x1d')](handleEntityNotFound(_0x270a8f,null))[_0x534e('0x1d')](function(_0x4b183f){if(_0x4b183f){_0xde0348=_0x4b183f;_0x205486[_0x534e('0x44')]=_[_0x534e('0x3f')](db[_0x534e('0x8d')][_0x534e('0x3e')]);_0x205486['query']=_[_0x534e('0x3f')](_0x25b112[_0x534e('0x40')]);_0x205486['filters']=_['intersection'](_0x205486[_0x534e('0x44')],_0x205486[_0x534e('0x40')]);_0x1d3cec[_0x534e('0x43')]=_[_0x534e('0x42')](_0x205486[_0x534e('0x44')],qs[_0x534e('0x45')](_0x25b112[_0x534e('0x40')]['fields']));_0x1d3cec[_0x534e('0x43')]=_0x1d3cec['attributes'][_0x534e('0x46')]?_0x1d3cec[_0x534e('0x43')]:_0x205486[_0x534e('0x44')];_0x1d3cec[_0x534e('0x49')]=qs['sort'](_0x25b112['query'][_0x534e('0x4a')]);_0x1d3cec[_0x534e('0x4d')]=qs[_0x534e('0x41')](_[_0x534e('0x4b')](_0x25b112['query'],_0x205486['filters']));if(_0x25b112[_0x534e('0x40')]['filter']){_0x1d3cec[_0x534e('0x4d')]=_['merge'](_0x1d3cec[_0x534e('0x4d')],{'$or':_['map'](_0x1d3cec[_0x534e('0x43')],function(_0x598036){var _0x436f7a={};_0x436f7a[_0x598036]={'$like':'%'+_0x25b112[_0x534e('0x40')][_0x534e('0x4c')]+'%'};return _0x436f7a;})});}_0x1d3cec=_[_0x534e('0x51')]({},_0x1d3cec,_0x25b112[_0x534e('0x52')]);return _0xde0348['getAgents'](_0x1d3cec);}})[_0x534e('0x1d')](function(_0x1941c2){if(_0x1941c2){_0x1852c4=_0x1941c2['length'];if(!_0x25b112['query'][_0x534e('0x63')](_0x534e('0x47'))){_0x1d3cec[_0x534e('0x48')]=qs[_0x534e('0x48')](_0x25b112[_0x534e('0x40')][_0x534e('0x48')]);_0x1d3cec[_0x534e('0x2d')]=qs[_0x534e('0x2d')](_0x25b112[_0x534e('0x40')][_0x534e('0x2d')]);}return _0xde0348[_0x534e('0xbd')](_0x1d3cec);}})['then'](function(_0x2f4ce3){if(_0x2f4ce3){return _0x2f4ce3?{'count':_0x1852c4,'rows':_0x2f4ce3}:null;}})[_0x534e('0x1d')](respondWithResult(_0x270a8f,null))[_0x534e('0x28')](handleError(_0x270a8f,null));}; \ No newline at end of file +var _0x04de=['setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','transaction','MailApplication','findAndCountAll','priority','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','set','Content-Range','json','apply','reject','update','destroy','then','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','filter','where','merge','map','type','key','field','MailAccount','count','includeAll','include','show','params','MailServerOut','rawAttributes','options','find','body','Imap','describe','Disposition','create','getDispositions','findOne','length','nolimit','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','MailAccountId','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','password','cpassword','authentication','port','host','service','pass','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','addImap','removeImap'];(function(_0x3408b2,_0x41cee5){var _0x244f81=function(_0x4d7e51){while(--_0x4d7e51){_0x3408b2['push'](_0x3408b2['shift']());}};_0x244f81(++_0x41cee5);}(_0x04de,0x107));var _0xe04d=function(_0x2550eb,_0x2b1414){_0x2550eb=_0x2550eb-0x0;var _0x32d197=_0x04de[_0x2550eb];return _0x32d197;};'use strict';var pdf=require(_0xe04d('0x0'));var emlformat=require(_0xe04d('0x1'));var rimraf=require(_0xe04d('0x2'));var zipdir=require(_0xe04d('0x3'));var jsonpatch=require(_0xe04d('0x4'));var rp=require(_0xe04d('0x5'));var moment=require(_0xe04d('0x6'));var BPromise=require(_0xe04d('0x7'));var Mustache=require(_0xe04d('0x8'));var util=require(_0xe04d('0x9'));var path=require(_0xe04d('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe04d('0xb'));var crypto=require(_0xe04d('0xc'));var jsforce=require(_0xe04d('0xd'));var deskjs=require(_0xe04d('0xe'));var toCsv=require(_0xe04d('0xf'));var querystring=require(_0xe04d('0x10'));var Papa=require(_0xe04d('0x11'));var authService=require(_0xe04d('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe04d('0x13'));var qs=require(_0xe04d('0x14'));var logger=require(_0xe04d('0x15'))(_0xe04d('0x16'));var utils=require(_0xe04d('0x17'));var config=require(_0xe04d('0x18'));var db=require(_0xe04d('0x19'))['db'];config[_0xe04d('0x1a')]=_[_0xe04d('0x1b')](config['redis'],{'host':_0xe04d('0x1c'),'port':0x18eb});var socket=require(_0xe04d('0x1d'))(new Redis(config[_0xe04d('0x1a')]));require(_0xe04d('0x1e'))[_0xe04d('0x1f')](socket);var jayson=require(_0xe04d('0x20'));var client=jayson[_0xe04d('0x21')][_0xe04d('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x2fb7b6,_0x16b305,_0xbc5cc7,_0x1aa69b){return new BPromise(function(_0x5cfd5b,_0x1f29a7){var _0x5b05a2=_0x1aa69b||client;return _0x5b05a2[_0xe04d('0x23')](_0x2fb7b6,_0xbc5cc7)['then'](function(_0x353aaf){logger[_0xe04d('0x24')](_0xe04d('0x25'),_0x16b305,_0xe04d('0x26'));logger[_0xe04d('0x27')](_0xe04d('0x28'),_0x16b305,_0xe04d('0x26'),JSON[_0xe04d('0x29')](_0x353aaf));if(_0x353aaf[_0xe04d('0x2a')]){if(_0x353aaf['error'][_0xe04d('0x2b')]===0x1f4){logger[_0xe04d('0x2a')](_0xe04d('0x25'),_0x16b305,_0x353aaf[_0xe04d('0x2a')][_0xe04d('0x2c')]);return _0x1f29a7(_0x353aaf[_0xe04d('0x2a')]['message']);}logger[_0xe04d('0x2a')](_0xe04d('0x25'),_0x16b305,_0x353aaf['error']['message']);return _0x5cfd5b(_0x353aaf['error'][_0xe04d('0x2c')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x16b305,_0xe04d('0x26'));_0x5cfd5b(_0x353aaf[_0xe04d('0x2d')]['message']);}})[_0xe04d('0x2e')](function(_0x5de700){logger[_0xe04d('0x2a')]('MailAccount,\x20%s,\x20%s',_0x16b305,_0x5de700);_0x1f29a7(_0x5de700);});});}function respondWithStatusCode(_0x3df571,_0x456822){_0x456822=_0x456822||0xcc;return function(_0x48db4e){if(_0x48db4e){return _0x3df571[_0xe04d('0x2f')](_0x456822);}return _0x3df571[_0xe04d('0x30')](_0x456822)['end']();};}function respondWithResult(_0x10aa20,_0x3e43ca){_0x3e43ca=_0x3e43ca||0xc8;return function(_0x145f2c){if(_0x145f2c){return _0x10aa20[_0xe04d('0x30')](_0x3e43ca)['json'](_0x145f2c);}};}function respondWithFilteredResult(_0xc73068,_0x6eba3b){return function(_0x19ad13){if(_0x19ad13){var _0x4824e8=_0x19ad13['count'],_0x187c29=_0x6eba3b[_0xe04d('0x31')],_0x5a3899=_0x6eba3b[_0xe04d('0x31')]+_0x6eba3b['limit'],_0x4f5883;if(_0x5a3899>=_0x4824e8){_0x5a3899=_0x4824e8;_0x4f5883=0xc8;}else{_0x4f5883=0xce;}_0xc73068['status'](_0x4f5883);return _0xc73068[_0xe04d('0x32')](_0xe04d('0x33'),_0x187c29+'-'+_0x5a3899+'/'+_0x4824e8)[_0xe04d('0x34')](_0x19ad13);}return null;};}function patchUpdates(_0x4a2a10){return function(_0x2cf005){try{jsonpatch[_0xe04d('0x35')](_0x2cf005,_0x4a2a10,!![]);}catch(_0x47cd45){return BPromise[_0xe04d('0x36')](_0x47cd45);}return _0x2cf005['save']();};}function saveUpdates(_0x397bb7,_0x25d401){return function(_0x5406e3){if(_0x5406e3){return _0x5406e3[_0xe04d('0x37')](_0x397bb7)['then'](function(_0x1dc0bc){return _0x1dc0bc;});}return null;};}function removeEntity(_0x3bec7e,_0x2a3fd9){return function(_0x3a5a26){if(_0x3a5a26){return _0x3a5a26[_0xe04d('0x38')]()[_0xe04d('0x39')](function(){var _0x372161=_0x3a5a26['get']({'plain':!![]});var _0x1c9f7a=_0xe04d('0x3a');return db[_0xe04d('0x3b')][_0xe04d('0x38')]({'where':{'type':_0x1c9f7a,'resourceId':_0x372161['id']}})[_0xe04d('0x39')](function(){return _0x3a5a26;});})[_0xe04d('0x39')](function(){_0x3bec7e[_0xe04d('0x30')](0xcc)[_0xe04d('0x3c')]();});}};}function handleEntityNotFound(_0x26c6c5,_0x59ed1c){return function(_0x151057){if(!_0x151057){_0x26c6c5['sendStatus'](0x194);}return _0x151057;};}function handleError(_0x27c8f7,_0x547f56){_0x547f56=_0x547f56||0x1f4;return function(_0x4a3534){logger[_0xe04d('0x2a')](_0x4a3534[_0xe04d('0x3d')]);if(_0x4a3534[_0xe04d('0x3e')]){delete _0x4a3534[_0xe04d('0x3e')];}_0x27c8f7['status'](_0x547f56)[_0xe04d('0x3f')](_0x4a3534);};}exports[_0xe04d('0x40')]=function(_0xdfb954,_0x3524ce){var _0x322228={'include':[{'model':db[_0xe04d('0x41')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xe04d('0x42')},{'model':db[_0xe04d('0x43')],'as':_0xe04d('0x44')}]},_0x5d448c={},_0x51c771={'count':0x0,'rows':[]};var _0x1cbd04=db['MailAccount']['rawAttributes'];_0x5d448c[_0xe04d('0x45')]=_[_0xe04d('0x46')](_0x1cbd04);_0x5d448c[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0xdfb954[_0xe04d('0x47')]);_0x5d448c[_0xe04d('0x48')]=_['intersection'](_0x5d448c[_0xe04d('0x45')],_0x5d448c['query']);_0x322228[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x5d448c[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0xdfb954[_0xe04d('0x47')][_0xe04d('0x4b')]));_0x322228[_0xe04d('0x49')]=_0x322228[_0xe04d('0x49')]['length']?_0x322228[_0xe04d('0x49')]:_0x5d448c[_0xe04d('0x45')];if(!_0xdfb954['query'][_0xe04d('0x4c')]('nolimit')){_0x322228[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0xdfb954['query'][_0xe04d('0x4d')]);_0x322228[_0xe04d('0x31')]=qs[_0xe04d('0x31')](_0xdfb954[_0xe04d('0x47')][_0xe04d('0x31')]);}_0x322228[_0xe04d('0x4e')]=qs[_0xe04d('0x4f')](_0xdfb954[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x322228['where']=qs['filters'](_['pick'](_0xdfb954[_0xe04d('0x47')],_0x5d448c['filters']));if(_0xdfb954[_0xe04d('0x47')][_0xe04d('0x50')]){_0x322228[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x322228[_0xe04d('0x51')],{'$or':_[_0xe04d('0x53')](_0x1cbd04,function(_0x54b243){if(_0x54b243[_0xe04d('0x54')][_0xe04d('0x55')]!=='VIRTUAL'){var _0x4c94d7={};_0x4c94d7[_0x54b243[_0xe04d('0x56')]]={'$like':'%'+_0xdfb954[_0xe04d('0x47')]['filter']+'%'};return _0x4c94d7;}})});}_0x322228=_[_0xe04d('0x52')]({},_0x322228,_0xdfb954['options']);var _0x1e3722={'where':_0x322228[_0xe04d('0x51')]};return db[_0xe04d('0x57')][_0xe04d('0x58')](_0x1e3722)[_0xe04d('0x39')](function(_0x3ed027){_0x51c771[_0xe04d('0x58')]=_0x3ed027;if(_0xdfb954[_0xe04d('0x47')][_0xe04d('0x59')]){_0x322228[_0xe04d('0x5a')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x322228);})[_0xe04d('0x39')](function(_0x4b8822){_0x51c771['rows']=_0x4b8822;return _0x51c771;})['then'](respondWithFilteredResult(_0x3524ce,_0x322228))[_0xe04d('0x2e')](handleError(_0x3524ce,null));};exports[_0xe04d('0x5b')]=function(_0x113876,_0x59a02d){var _0x4b77e3={'raw':![],'where':{'id':_0x113876[_0xe04d('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xe04d('0x5d')],'as':'Smtp'},{'model':db[_0xe04d('0x43')],'as':_0xe04d('0x44')}]},_0x1b239a={};_0x1b239a[_0xe04d('0x45')]=_[_0xe04d('0x46')](db[_0xe04d('0x57')][_0xe04d('0x5e')]);_0x1b239a[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0x113876['query']);_0x1b239a['filters']=_[_0xe04d('0x4a')](_0x1b239a[_0xe04d('0x45')],_0x1b239a[_0xe04d('0x47')]);_0x4b77e3[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x1b239a['model'],qs['fields'](_0x113876[_0xe04d('0x47')]['fields']));_0x4b77e3['attributes']=_0x4b77e3[_0xe04d('0x49')]['length']?_0x4b77e3[_0xe04d('0x49')]:_0x1b239a['model'];if(_0x113876[_0xe04d('0x47')]['includeAll']){_0x4b77e3['include']=[{'all':!![]}];}_0x4b77e3=_[_0xe04d('0x52')]({},_0x4b77e3,_0x113876[_0xe04d('0x5f')]);return db[_0xe04d('0x57')][_0xe04d('0x60')](_0x4b77e3)[_0xe04d('0x39')](handleEntityNotFound(_0x59a02d,null))[_0xe04d('0x39')](respondWithResult(_0x59a02d,null))[_0xe04d('0x2e')](handleError(_0x59a02d,null));};exports[_0xe04d('0x37')]=function(_0xa032af,_0xcd69e8){if(_0xa032af[_0xe04d('0x61')]['id']){delete _0xa032af['body']['id'];}return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0xa032af[_0xe04d('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe04d('0x62')},{'model':db['MailServerOut'],'as':_0xe04d('0x42')},{'model':db[_0xe04d('0x43')],'as':'mandatoryDispositionPause'}]})[_0xe04d('0x39')](handleEntityNotFound(_0xcd69e8,null))[_0xe04d('0x39')](saveUpdates(_0xa032af[_0xe04d('0x61')],null))['then'](function(_0x928e28){if(_0x928e28&&_0xa032af['body'][_0xe04d('0x62')]){return db[_0xe04d('0x41')][_0xe04d('0x37')](_0xa032af[_0xe04d('0x61')]['Imap'],{'where':{'MailAccountId':_0x928e28['id']}})[_0xe04d('0x39')](function(){return _0x928e28;});}return _0x928e28;})['then'](function(_0x1f8535){if(_0x1f8535&&_0xa032af['body'][_0xe04d('0x42')]){return db[_0xe04d('0x5d')][_0xe04d('0x37')](_0xa032af[_0xe04d('0x61')]['Smtp'],{'where':{'MailAccountId':_0x1f8535['id']}})[_0xe04d('0x39')](function(){return _0x1f8535;});}return _0x1f8535;})['then'](respondWithResult(_0xcd69e8,null))['catch'](handleError(_0xcd69e8,null));};exports[_0xe04d('0x63')]=function(_0x4195a1,_0x470cab){return db[_0xe04d('0x57')]['describe']()['then'](respondWithResult(_0x470cab,null))['catch'](handleError(_0x470cab,null));};exports['addDisposition']=function(_0x39bf6a,_0x4169fb,_0x4972d4){if(_0x39bf6a[_0xe04d('0x61')]['id']){delete _0x39bf6a[_0xe04d('0x61')]['id'];}return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x39bf6a[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4169fb,null))[_0xe04d('0x39')](function(_0x49d579){if(_0x49d579){_0x39bf6a[_0xe04d('0x61')]['MailAccountId']=_0x49d579['id'];return db[_0xe04d('0x64')][_0xe04d('0x65')](_0x39bf6a[_0xe04d('0x61')]);}})['then'](respondWithResult(_0x4169fb,null))[_0xe04d('0x2e')](handleError(_0x4169fb,null));};exports[_0xe04d('0x66')]=function(_0x143940,_0x1f7255,_0x3631d5){var _0x1ec07d={'raw':![],'where':{}};var _0x924d49={};var _0x558d3c={'count':0x0,'rows':[]};return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0x143940[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x1f7255,null))[_0xe04d('0x39')](function(_0x597f30){if(_0x597f30){_0x924d49[_0xe04d('0x45')]=_[_0xe04d('0x46')](db[_0xe04d('0x64')][_0xe04d('0x5e')]);_0x924d49['query']=_[_0xe04d('0x46')](_0x143940[_0xe04d('0x47')]);_0x924d49['filters']=_[_0xe04d('0x4a')](_0x924d49[_0xe04d('0x45')],_0x924d49[_0xe04d('0x47')]);_0x1ec07d['attributes']=_[_0xe04d('0x4a')](_0x924d49[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0x143940[_0xe04d('0x47')][_0xe04d('0x4b')]));_0x1ec07d[_0xe04d('0x49')]=_0x1ec07d[_0xe04d('0x49')][_0xe04d('0x68')]?_0x1ec07d[_0xe04d('0x49')]:_0x924d49['model'];if(!_0x143940[_0xe04d('0x47')][_0xe04d('0x4c')](_0xe04d('0x69'))){_0x1ec07d[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0x143940[_0xe04d('0x47')][_0xe04d('0x4d')]);_0x1ec07d[_0xe04d('0x31')]=qs[_0xe04d('0x31')](_0x143940['query'][_0xe04d('0x31')]);}_0x1ec07d[_0xe04d('0x4e')]=qs['sort'](_0x143940[_0xe04d('0x47')]['sort']);_0x1ec07d['where']=qs[_0xe04d('0x48')](_[_0xe04d('0x6a')](_0x143940[_0xe04d('0x47')],_0x924d49[_0xe04d('0x48')]));_0x1ec07d[_0xe04d('0x51')]['MailAccountId']=_0x597f30['id'];if(_0x143940[_0xe04d('0x47')][_0xe04d('0x50')]){_0x1ec07d['where']=_[_0xe04d('0x52')](_0x1ec07d['where'],{'$or':_['map'](_0x1ec07d['attributes'],function(_0x3370bf){var _0x5a6d0d={};_0x5a6d0d[_0x3370bf]={'$like':'%'+_0x143940[_0xe04d('0x47')]['filter']+'%'};return _0x5a6d0d;})});}_0x1ec07d=_[_0xe04d('0x52')]({},_0x1ec07d,_0x143940[_0xe04d('0x5f')]);return db['Disposition'][_0xe04d('0x58')]({'where':_0x1ec07d['where']})[_0xe04d('0x39')](function(_0x5e2199){_0x558d3c[_0xe04d('0x58')]=_0x5e2199;if(_0x143940[_0xe04d('0x47')][_0xe04d('0x59')]){_0x1ec07d[_0xe04d('0x5a')]=[{'all':!![]}];}return db[_0xe04d('0x64')][_0xe04d('0x6b')](_0x1ec07d);})[_0xe04d('0x39')](function(_0x4be3bd){_0x558d3c[_0xe04d('0x6c')]=_0x4be3bd;return _0x558d3c;});}})['then'](respondWithFilteredResult(_0x1f7255,_0x1ec07d))[_0xe04d('0x2e')](handleError(_0x1f7255,null));};exports[_0xe04d('0x6d')]=function(_0x50a2e3,_0x27ba30,_0x2016bd){var _0x1f2186;return db[_0xe04d('0x57')]['find']({'where':{'id':_0x50a2e3[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27ba30,null))['then'](function(_0x306916){if(_0x306916){return _0x306916[_0xe04d('0x6d')](_0x50a2e3[_0xe04d('0x47')][_0xe04d('0x6e')]);}})[_0xe04d('0x39')](respondWithStatusCode(_0x27ba30,null))[_0xe04d('0x2e')](handleError(_0x27ba30,null));};exports[_0xe04d('0x6f')]=function(_0x493bca,_0x2fa003,_0xc6d30e){if(_0x493bca[_0xe04d('0x61')]['id']){delete _0x493bca[_0xe04d('0x61')]['id'];}return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x493bca[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x2fa003,null))[_0xe04d('0x39')](function(_0x33fa74){if(_0x33fa74){_0x493bca[_0xe04d('0x61')]['MailAccountId']=_0x33fa74['id'];return db[_0xe04d('0x70')]['create'](_0x493bca[_0xe04d('0x61')]);}})[_0xe04d('0x39')](respondWithResult(_0x2fa003,null))[_0xe04d('0x2e')](handleError(_0x2fa003,null));};exports[_0xe04d('0x71')]=function(_0xe31fe0,_0x4dfd4a,_0x5c7e3d){var _0x5e7136={'raw':![],'where':{}};var _0x5879e6={};var _0x409bfb={'count':0x0,'rows':[]};return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0xe31fe0['params']['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x4dfd4a,null))[_0xe04d('0x39')](function(_0x5c5a07){if(_0x5c5a07){_0x5879e6[_0xe04d('0x45')]=_[_0xe04d('0x46')](db['CannedAnswer']['rawAttributes']);_0x5879e6['query']=_['keys'](_0xe31fe0[_0xe04d('0x47')]);_0x5879e6[_0xe04d('0x48')]=_['intersection'](_0x5879e6[_0xe04d('0x45')],_0x5879e6[_0xe04d('0x47')]);_0x5e7136[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x5879e6[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0xe31fe0[_0xe04d('0x47')]['fields']));_0x5e7136[_0xe04d('0x49')]=_0x5e7136['attributes']['length']?_0x5e7136[_0xe04d('0x49')]:_0x5879e6[_0xe04d('0x45')];if(!_0xe31fe0[_0xe04d('0x47')][_0xe04d('0x4c')]('nolimit')){_0x5e7136[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0xe31fe0[_0xe04d('0x47')]['limit']);_0x5e7136['offset']=qs[_0xe04d('0x31')](_0xe31fe0[_0xe04d('0x47')][_0xe04d('0x31')]);}_0x5e7136['order']=qs['sort'](_0xe31fe0[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x5e7136[_0xe04d('0x51')]=qs['filters'](_['pick'](_0xe31fe0['query'],_0x5879e6['filters']));_0x5e7136[_0xe04d('0x51')][_0xe04d('0x72')]=_0x5c5a07['id'];if(_0xe31fe0[_0xe04d('0x47')][_0xe04d('0x50')]){_0x5e7136[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x5e7136[_0xe04d('0x51')],{'$or':_[_0xe04d('0x53')](_0x5e7136[_0xe04d('0x49')],function(_0x563f6d){var _0xc8442a={};_0xc8442a[_0x563f6d]={'$like':'%'+_0xe31fe0[_0xe04d('0x47')][_0xe04d('0x50')]+'%'};return _0xc8442a;})});}_0x5e7136=_[_0xe04d('0x52')]({},_0x5e7136,_0xe31fe0[_0xe04d('0x5f')]);return db[_0xe04d('0x70')][_0xe04d('0x58')]({'where':_0x5e7136[_0xe04d('0x51')]})[_0xe04d('0x39')](function(_0x254e2f){_0x409bfb[_0xe04d('0x58')]=_0x254e2f;if(_0xe31fe0[_0xe04d('0x47')]['includeAll']){_0x5e7136[_0xe04d('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe04d('0x6b')](_0x5e7136);})[_0xe04d('0x39')](function(_0x30b924){_0x409bfb[_0xe04d('0x6c')]=_0x30b924;return _0x409bfb;});}})[_0xe04d('0x39')](respondWithFilteredResult(_0x4dfd4a,_0x5e7136))[_0xe04d('0x2e')](handleError(_0x4dfd4a,null));};exports[_0xe04d('0x73')]=function(_0x22b8d8,_0x10d47e,_0x109145){var _0xac2d57;return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x22b8d8[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x10d47e,null))[_0xe04d('0x39')](function(_0x570669){if(_0x570669){return _0x570669['removeAnswers'](_0x22b8d8['query'][_0xe04d('0x6e')]);}})[_0xe04d('0x39')](respondWithStatusCode(_0x10d47e,null))[_0xe04d('0x2e')](handleError(_0x10d47e,null));};exports[_0xe04d('0x65')]=function(_0x20c2a5,_0x321118){var _0x2d4b82={'name':_0x20c2a5[_0xe04d('0x61')]['name'],'key':_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x55')],'email':_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x74')],'ListId':_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x75')],'active':!_[_0xe04d('0x76')](_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x77')])?_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x77')]:!![],'description':_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x78')]||null,'Imap':{},'Smtp':{}};if(_[_0xe04d('0x76')](_0x20c2a5['body'][_0xe04d('0x79')])){if(_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x7a')]){_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x7b')]=_0x2d4b82[_0xe04d('0x42')][_0xe04d('0x7b')]=_0x20c2a5[_0xe04d('0x61')]['cuser'];_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x7c')]=_0x2d4b82[_0xe04d('0x42')]['pass']=_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x7d')];}else{_0x2d4b82[_0xe04d('0x62')]['authentication']=_0x2d4b82[_0xe04d('0x42')][_0xe04d('0x7e')]=![];}_0x2d4b82['Imap']['host']=_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x62')]['host'];_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x7f')]=_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x62')][_0xe04d('0x7f')];_0x2d4b82['Smtp'][_0xe04d('0x80')]=_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x42')][_0xe04d('0x80')];_0x2d4b82[_0xe04d('0x42')][_0xe04d('0x7f')]=_0x20c2a5[_0xe04d('0x61')][_0xe04d('0x42')][_0xe04d('0x7f')];}else{_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x81')]=_0x2d4b82[_0xe04d('0x42')]['service']=_0x20c2a5['body'][_0xe04d('0x79')];_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x7b')]=_0x2d4b82['Smtp'][_0xe04d('0x7b')]=_0x20c2a5[_0xe04d('0x61')]['cuser'];_0x2d4b82[_0xe04d('0x62')][_0xe04d('0x7c')]=_0x2d4b82['Smtp'][_0xe04d('0x82')]=_0x20c2a5['body']['cpassword'];}return db[_0xe04d('0x57')][_0xe04d('0x65')](_0x2d4b82,{'include':[{'model':db[_0xe04d('0x5d')],'as':_0xe04d('0x42')},{'model':db[_0xe04d('0x41')],'as':_0xe04d('0x62')}]})['then'](function(_0x50fc83){var _0xebfff=_0x20c2a5['user'][_0xe04d('0x83')]({'plain':!![]});if(!_0xebfff)throw new Error(_0xe04d('0x84'));if(_0xebfff[_0xe04d('0x85')]===_0xe04d('0x7b')){var _0x318496=_0x50fc83[_0xe04d('0x83')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe04d('0x3a'),'userProfileId':_0xebfff[_0xe04d('0x86')]},'raw':!![]})[_0xe04d('0x39')](function(_0x24dcb2){if(_0x24dcb2&&_0x24dcb2[_0xe04d('0x87')]===0x0){return db[_0xe04d('0x3b')][_0xe04d('0x65')]({'name':_0x318496[_0xe04d('0x3e')],'resourceId':_0x318496['id'],'type':_0x24dcb2[_0xe04d('0x3e')],'sectionId':_0x24dcb2['id']},{})['then'](function(){return _0x50fc83;});}else{return _0x50fc83;}})[_0xe04d('0x2e')](function(_0x40ccca){logger[_0xe04d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40ccca);throw _0x40ccca;});}return _0x50fc83;})[_0xe04d('0x39')](respondWithResult(_0x321118,0xc9))[_0xe04d('0x2e')](handleError(_0x321118,null));};exports[_0xe04d('0x88')]=function(_0x470858,_0x59d4a3,_0x10d22d){return db[_0xe04d('0x57')][_0xe04d('0x67')]({'where':{'id':_0x470858[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x59d4a3,null))[_0xe04d('0x39')](function(_0x2c628d){if(_0x2c628d){return _0x2c628d[_0xe04d('0x88')]();}return null;})[_0xe04d('0x39')](respondWithResult(_0x59d4a3,null))[_0xe04d('0x2e')](handleError(_0x59d4a3,null));};exports[_0xe04d('0x89')]=function(_0x3d8f8c,_0x1e4d1b,_0x1c10b1){if(_0x3d8f8c['body']['id']){delete _0x3d8f8c[_0xe04d('0x61')]['id'];}return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x3d8f8c[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1e4d1b,null))[_0xe04d('0x39')](function(_0x2eb4af){if(_0x2eb4af){_0x3d8f8c['body']['MailAccountId']=_0x2eb4af['id'];return db[_0xe04d('0x41')][_0xe04d('0x65')](_0x3d8f8c[_0xe04d('0x61')]);}})[_0xe04d('0x39')](respondWithResult(_0x1e4d1b,null))[_0xe04d('0x2e')](handleError(_0x1e4d1b,null));};exports[_0xe04d('0x8a')]=function(_0x41f09e,_0x1a9c19,_0x494129){return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0x41f09e[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x1a9c19,null))[_0xe04d('0x39')](function(_0x4f1870){if(_0x4f1870){return _0x4f1870[_0xe04d('0x8b')](null);}return null;})[_0xe04d('0x39')](respondWithStatusCode(_0x1a9c19,null))[_0xe04d('0x2e')](handleError(_0x1a9c19,null));};exports[_0xe04d('0x8c')]=function(_0x280cc5,_0x257a64,_0xa22bc2){return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0x280cc5[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x257a64,null))['then'](function(_0x54d5ad){if(_0x54d5ad){return _0x54d5ad['getSmtp']();}return null;})['then'](respondWithResult(_0x257a64,null))[_0xe04d('0x2e')](handleError(_0x257a64,null));};exports[_0xe04d('0x8d')]=function(_0x400888,_0x10f655,_0x108c1e){if(_0x400888[_0xe04d('0x61')]['id']){delete _0x400888[_0xe04d('0x61')]['id'];}return db['MailAccount'][_0xe04d('0x60')]({'where':{'id':_0x400888[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x10f655,null))['then'](function(_0x5d6240){if(_0x5d6240){_0x400888['body'][_0xe04d('0x72')]=_0x5d6240['id'];return db[_0xe04d('0x5d')][_0xe04d('0x65')](_0x400888['body']);}})[_0xe04d('0x39')](respondWithResult(_0x10f655,null))[_0xe04d('0x2e')](handleError(_0x10f655,null));};exports[_0xe04d('0x8e')]=function(_0x3f9b3a,_0x3217f1,_0x31ce1d){return db[_0xe04d('0x57')][_0xe04d('0x67')]({'where':{'id':_0x3f9b3a['params']['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x3217f1,null))[_0xe04d('0x39')](function(_0x1249de){if(_0x1249de){return _0x1249de[_0xe04d('0x8f')](null);}return null;})[_0xe04d('0x39')](respondWithStatusCode(_0x3217f1,null))[_0xe04d('0x2e')](handleError(_0x3217f1,null));};exports[_0xe04d('0x90')]=function(_0x4ae0bf,_0x344546,_0x407d73){return db[_0xe04d('0x91')][_0xe04d('0x60')]({'where':{'id':_0x4ae0bf['params']['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x344546,null))['then'](function(_0x2343b7){if(_0x2343b7){return _0x2343b7[_0xe04d('0x90')](_0x4ae0bf[_0xe04d('0x61')][_0xe04d('0x6e')],_['omit'](_0x4ae0bf[_0xe04d('0x61')],[_0xe04d('0x6e'),'id'])||{});}})[_0xe04d('0x39')](respondWithResult(_0x344546,null))[_0xe04d('0x2e')](handleError(_0x344546,null));};exports[_0xe04d('0x92')]=function(_0x3c2dc4,_0x127cc5,_0xd29195){var _0x58aecb={'raw':![],'where':{}};var _0x37d34c={};var _0x44bf64={'count':0x0,'rows':[]};return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0x3c2dc4[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x127cc5,null))['then'](function(_0x30606e){if(_0x30606e){_0x37d34c[_0xe04d('0x45')]=_['keys'](db[_0xe04d('0x91')][_0xe04d('0x5e')]);_0x37d34c[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0x3c2dc4['query']);_0x37d34c['filters']=_[_0xe04d('0x4a')](_0x37d34c[_0xe04d('0x45')],_0x37d34c[_0xe04d('0x47')]);_0x58aecb[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x37d34c[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0x3c2dc4['query']['fields']));_0x58aecb[_0xe04d('0x49')]=_0x58aecb[_0xe04d('0x49')][_0xe04d('0x68')]?_0x58aecb[_0xe04d('0x49')]:_0x37d34c[_0xe04d('0x45')];if(!_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x4c')](_0xe04d('0x69'))){_0x58aecb[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x4d')]);_0x58aecb['offset']=qs[_0xe04d('0x31')](_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x31')]);}_0x58aecb[_0xe04d('0x4e')]=qs['sort'](_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x58aecb[_0xe04d('0x51')]=qs['filters'](_['pick'](_0x3c2dc4['query'],_0x37d34c[_0xe04d('0x48')]));_0x58aecb[_0xe04d('0x51')][_0xe04d('0x72')]=_0x30606e['id'];if(_0x3c2dc4['query'][_0xe04d('0x50')]){_0x58aecb[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x58aecb['where'],{'$or':_[_0xe04d('0x53')](_0x58aecb['attributes'],function(_0x2969b1){var _0x2da37c={};_0x2da37c[_0x2969b1]={'$like':'%'+_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x50')]+'%'};return _0x2da37c;})});}_0x58aecb=_[_0xe04d('0x52')]({},_0x58aecb,_0x3c2dc4[_0xe04d('0x5f')]);return db['MailInteraction']['count']({'where':_0x58aecb[_0xe04d('0x51')]})[_0xe04d('0x39')](function(_0x32f9a2){_0x44bf64[_0xe04d('0x58')]=_0x32f9a2;if(_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x59')]){_0x58aecb[_0xe04d('0x5a')]=[{'model':db[_0xe04d('0x93')],'as':_0xe04d('0x94'),'required':![]},{'model':db['User'],'as':_0xe04d('0x95'),'attributes':[_0xe04d('0x3e'),_0xe04d('0x96'),_0xe04d('0x97')],'required':![]},{'model':db[_0xe04d('0x98')],'as':_0xe04d('0x99'),'attributes':['id','name',_0xe04d('0x9a')],'where':_0x3c2dc4[_0xe04d('0x47')][_0xe04d('0x9b')]?{'id':_0x3c2dc4['query'][_0xe04d('0x9b')]}:undefined,'required':_0x3c2dc4[_0xe04d('0x47')]['tag']?!![]:![]}];}return db[_0xe04d('0x91')][_0xe04d('0x6b')](_0x58aecb);})[_0xe04d('0x39')](function(_0x173804){_0x44bf64[_0xe04d('0x6c')]=_0x173804;return _0x44bf64;});}})['then'](respondWithFilteredResult(_0x127cc5,_0x58aecb))[_0xe04d('0x2e')](handleError(_0x127cc5,null));};exports['addApplications']=function(_0x22f279,_0x42ec55,_0x464977){return db['MailAccount'][_0xe04d('0x67')]({'where':{'id':_0x22f279[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x42ec55,null))['then'](function(_0xce7800){if(_0xce7800){return db['sequelize'][_0xe04d('0x9c')](function(_0x4dfbc8){return db[_0xe04d('0x9d')]['destroy']({'where':{'MailAccountId':_0x22f279['params']['id']},'transaction':_0x4dfbc8})[_0xe04d('0x39')](function(_0x1263de){var _0x53de2c=_[_0xe04d('0x53')](_0x22f279[_0xe04d('0x61')],function(_0x2fc16c){_0x2fc16c['MailAccountId']=_0x22f279[_0xe04d('0x5c')]['id'];return _0x2fc16c;});return db[_0xe04d('0x9d')]['bulkCreate'](_0x53de2c,{'transaction':_0x4dfbc8});});})[_0xe04d('0x39')](function(){return db[_0xe04d('0x9d')][_0xe04d('0x9e')]({'where':{'MailAccountId':_0x22f279[_0xe04d('0x5c')]['id']},'order':_0xe04d('0x9f')});});}})[_0xe04d('0x39')](respondWithResult(_0x42ec55,null))[_0xe04d('0x2e')](handleError(_0x42ec55,null));};exports['getApplications']=function(_0xf2ed12,_0xc9daec,_0x2fe33e){var _0x271258={};var _0x3014e9={};var _0x86cfd9;var _0x3a3e22;return db[_0xe04d('0x57')][_0xe04d('0x67')]({'where':{'id':_0xf2ed12[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0xc9daec,null))[_0xe04d('0x39')](function(_0x957f22){if(_0x957f22){_0x86cfd9=_0x957f22;_0x3014e9[_0xe04d('0x45')]=_['keys'](db['MailApplication']['rawAttributes']);_0x3014e9[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0xf2ed12['query']);_0x3014e9['filters']=_[_0xe04d('0x4a')](_0x3014e9[_0xe04d('0x45')],_0x3014e9[_0xe04d('0x47')]);_0x271258[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x3014e9[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0xf2ed12[_0xe04d('0x47')][_0xe04d('0x4b')]));_0x271258[_0xe04d('0x49')]=_0x271258[_0xe04d('0x49')][_0xe04d('0x68')]?_0x271258[_0xe04d('0x49')]:_0x3014e9[_0xe04d('0x45')];_0x271258['order']=qs[_0xe04d('0x4f')](_0xf2ed12[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x271258['where']=qs['filters'](_['pick'](_0xf2ed12['query'],_0x3014e9[_0xe04d('0x48')]));if(_0xf2ed12[_0xe04d('0x47')]['filter']){_0x271258[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x271258[_0xe04d('0x51')],{'$or':_[_0xe04d('0x53')](_0x271258[_0xe04d('0x49')],function(_0x2e9834){var _0x1a876a={};_0x1a876a[_0x2e9834]={'$like':'%'+_0xf2ed12[_0xe04d('0x47')][_0xe04d('0x50')]+'%'};return _0x1a876a;})});}_0x271258=_['merge']({},_0x271258,_0xf2ed12['options']);return _0x86cfd9[_0xe04d('0xa0')](_0x271258);}})['then'](function(_0x50691e){if(_0x50691e){_0x3a3e22=_0x50691e[_0xe04d('0x68')];if(!_0xf2ed12[_0xe04d('0x47')][_0xe04d('0x4c')](_0xe04d('0x69'))){_0x271258[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0xf2ed12[_0xe04d('0x47')][_0xe04d('0x4d')]);_0x271258[_0xe04d('0x31')]=qs[_0xe04d('0x31')](_0xf2ed12['query']['offset']);}return _0x86cfd9[_0xe04d('0xa0')](_0x271258);}})[_0xe04d('0x39')](function(_0x451d7a){if(_0x451d7a){return _0x451d7a?{'count':_0x3a3e22,'rows':_0x451d7a}:null;}})[_0xe04d('0x39')](respondWithResult(_0xc9daec,null))[_0xe04d('0x2e')](handleError(_0xc9daec,null));};exports['getMessages']=function(_0x4ca27b,_0x17e8d1,_0x4b8972){var _0x2539d4={'raw':!![],'where':{}};var _0x486791={};var _0x3e31d9={'count':0x0,'rows':[]};return db[_0xe04d('0x57')][_0xe04d('0x67')]({'where':{'id':_0x4ca27b[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x17e8d1,null))[_0xe04d('0x39')](function(_0x40fa69){if(_0x40fa69){_0x486791[_0xe04d('0x45')]=_['keys'](db['MailMessage'][_0xe04d('0x5e')]);_0x486791[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0x4ca27b[_0xe04d('0x47')]);_0x486791[_0xe04d('0x48')]=_[_0xe04d('0x4a')](_0x486791[_0xe04d('0x45')],_0x486791[_0xe04d('0x47')]);_0x2539d4['attributes']=_[_0xe04d('0x4a')](_0x486791[_0xe04d('0x45')],qs[_0xe04d('0x4b')](_0x4ca27b['query'][_0xe04d('0x4b')]));_0x2539d4[_0xe04d('0x49')]=_0x2539d4[_0xe04d('0x49')][_0xe04d('0x68')]?_0x2539d4[_0xe04d('0x49')]:_0x486791['model'];if(!_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x4c')]('nolimit')){_0x2539d4[_0xe04d('0x4d')]=qs['limit'](_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x4d')]);_0x2539d4[_0xe04d('0x31')]=qs[_0xe04d('0x31')](_0x4ca27b['query'][_0xe04d('0x31')]);}_0x2539d4['order']=qs[_0xe04d('0x4f')](_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x2539d4[_0xe04d('0x51')]=qs[_0xe04d('0x48')](_[_0xe04d('0x6a')](_0x4ca27b[_0xe04d('0x47')],_0x486791[_0xe04d('0x48')]));_0x2539d4[_0xe04d('0x51')][_0xe04d('0x72')]=_0x40fa69['id'];if(_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x50')]){_0x2539d4[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x2539d4['where'],{'$or':_[_0xe04d('0x53')](_0x2539d4[_0xe04d('0x49')],function(_0x187fad){var _0x3d2b89={};_0x3d2b89[_0x187fad]={'$like':'%'+_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x50')]+'%'};return _0x3d2b89;})});}if(_0x4ca27b[_0xe04d('0x47')]['$gte']){var _0x333bc0=_0x4ca27b[_0xe04d('0x47')][_0xe04d('0xa1')][_0xe04d('0xa2')](',');var _0x53ef33={};_0x53ef33[_0x333bc0[0x0]]={'$gte':moment(_0x333bc0[0x1])[_0xe04d('0xa3')](_0xe04d('0xa4'))};_0x2539d4[_0xe04d('0x51')]=_['merge'](_0x2539d4[_0xe04d('0x51')],_0x53ef33);}_0x2539d4=_[_0xe04d('0x52')]({},_0x2539d4,_0x4ca27b[_0xe04d('0x5f')]);return db[_0xe04d('0xa5')][_0xe04d('0x58')]({'where':_0x2539d4[_0xe04d('0x51')]})['then'](function(_0x185caa){_0x3e31d9['count']=_0x185caa;if(_0x4ca27b[_0xe04d('0x47')][_0xe04d('0x59')]){_0x2539d4[_0xe04d('0x5a')]=[{'all':!![]}];}return db[_0xe04d('0xa5')][_0xe04d('0x6b')](_0x2539d4);})['then'](function(_0xe2de8f){_0x3e31d9['rows']=_0xe2de8f;return _0x3e31d9;});}})[_0xe04d('0x39')](respondWithFilteredResult(_0x17e8d1,_0x2539d4))[_0xe04d('0x2e')](handleError(_0x17e8d1,null));};exports['send']=function(_0x5cc1eb,_0x2d9fb7,_0x4c3ae7){var _0x59a3b5,_0x23d351={},_0x4ef665;if(_0x5cc1eb[_0xe04d('0x61')]['to']){_0x4ef665=_0x5cc1eb[_0xe04d('0x61')]['to'][_0xe04d('0xa2')](',')[0x0];}return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x5cc1eb[_0xe04d('0x5c')]['id']},'include':[{'model':db[_0xe04d('0xa6')],'as':_0xe04d('0xa7'),'include':[{'model':db[_0xe04d('0x93')],'as':_0xe04d('0xa8'),'where':{'email':_0x4ef665},'limit':0x1,'order':[[_0xe04d('0xa9'),_0xe04d('0xaa')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xe04d('0x39')](handleEntityNotFound(_0x2d9fb7,null))[_0xe04d('0x39')](function(_0x522ab9){if(_0x522ab9){_0x59a3b5=_0x522ab9;if(_0x522ab9[_0xe04d('0x42')]){if(_[_0xe04d('0x76')](_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xab')])){_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xab')]=util['format'](_0xe04d('0xac'),_0x522ab9['name'],_0x522ab9['email']||_0x522ab9[_0xe04d('0x42')][_0xe04d('0x7b')]);}if(_0x5cc1eb['body'][_0xe04d('0xad')]&&_0x5cc1eb['body']['attachments'][_0xe04d('0x68')]){for(var _0x231e79=0x0;_0x231e79<_0x5cc1eb['body'][_0xe04d('0xad')][_0xe04d('0x68')];_0x231e79+=0x1){_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xad')][_0x231e79]={'filename':_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xad')][_0x231e79][_0xe04d('0x3e')],'path':path['join'](config[_0xe04d('0xae')],_0xe04d('0xaf'),_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xad')][_0x231e79][_0xe04d('0xb0')])};}}var _0x5e5689={'tls':{'rejectUnauthorized':![]}};if(_[_0xe04d('0x76')](_0x522ab9['Smtp'][_0xe04d('0x81')])){if(_0x522ab9[_0xe04d('0x42')][_0xe04d('0x7e')]){_0x5e5689[_0xe04d('0xb1')]={'user':_0x522ab9[_0xe04d('0x42')][_0xe04d('0x7b')],'pass':_0x522ab9[_0xe04d('0x42')]['pass']};}_0x5e5689[_0xe04d('0x80')]=_0x522ab9['Smtp'][_0xe04d('0x80')];_0x5e5689['port']=_0x522ab9[_0xe04d('0x42')][_0xe04d('0x7f')];_0x5e5689['secure']=_0x522ab9[_0xe04d('0x42')][_0xe04d('0xb2')];}else{_0x5e5689[_0xe04d('0x81')]=_0x522ab9['Smtp'][_0xe04d('0x81')];_0x5e5689[_0xe04d('0xb1')]={'user':_0x522ab9[_0xe04d('0x42')][_0xe04d('0x7b')],'pass':_0x522ab9[_0xe04d('0x42')]['pass']};}return respondWithRpcPromise(_0xe04d('0xb3'),_0xe04d('0xb4'),{'account':_0x5e5689,'message':_0x5cc1eb['body']});}else{throw new Error(_0xe04d('0xb5'));}}})[_0xe04d('0x39')](function(_0x465022){if(_0x465022){_0x23d351=_0x465022;if(_0x59a3b5[_0xe04d('0xa7')]){if(_0x59a3b5[_0xe04d('0xa7')][_0xe04d('0xa8')][_0xe04d('0x68')]){return _0x59a3b5[_0xe04d('0xa7')]['Contacts'][0x0];}else{return db[_0xe04d('0x93')][_0xe04d('0x65')](_[_0xe04d('0x1b')](_0x5cc1eb[_0xe04d('0x61')],{'firstName':_0x5cc1eb[_0xe04d('0x61')]['to'],'email':_0x5cc1eb['body']['to'],'phone':_0x5cc1eb[_0xe04d('0x61')]['to'],'ListId':_0x59a3b5['ListId']}));}}else{throw new Error(_0xe04d('0xb5'));}}})['then'](function(_0x26463b){if(_0x26463b){var _0x310cbe={'UserId':_0x5cc1eb[_0xe04d('0x7b')]['id'],'ContactId':_0x26463b['id'],'MailAccountId':_0x59a3b5['id'],'inReplyTo':_0x23d351['messageId'],'to':_0x5cc1eb[_0xe04d('0x61')]['from'],'cc':_0x5cc1eb[_0xe04d('0x61')]['cc'],'subject':_0x5cc1eb[_0xe04d('0x61')]['subject'],'attach':_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xe04d('0xa3')](_0xe04d('0xa4')),'lastMsgDirection':_0xe04d('0xb7'),'lastMsgBody':_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0x61')],'Messages':[_[_0xe04d('0x52')](_0x5cc1eb[_0xe04d('0x61')],{'messageId':_0x23d351[_0xe04d('0xb8')],'sentAt':moment()[_0xe04d('0xa3')](_0xe04d('0xa4')),'read':!![],'MailAccountId':_0x59a3b5['id'],'UserId':_0x5cc1eb[_0xe04d('0x7b')]['id'],'ContactId':_0x26463b['id']})]};if(_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xb9')]){_0x310cbe=_[_0xe04d('0x52')](_0x310cbe,_0x5cc1eb[_0xe04d('0x61')][_0xe04d('0xb9')]);}return db[_0xe04d('0x91')][_0xe04d('0x65')](_0x310cbe,{'include':[{'model':db['MailMessage'],'as':_0xe04d('0xba')}]});}})[_0xe04d('0x39')](respondWithResult(_0x2d9fb7,null))[_0xe04d('0x2e')](handleError(_0x2d9fb7,null));};exports[_0xe04d('0xbb')]=function(_0x1eb532,_0x5c17a6,_0x384068){return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x1eb532['params']['id']},'include':[{'model':db[_0xe04d('0x5d')],'as':_0xe04d('0x42'),'raw':!![]}]})[_0xe04d('0x39')](handleEntityNotFound(_0x5c17a6,null))[_0xe04d('0x39')](function(_0x9d40f6){if(_0x9d40f6&&_0x9d40f6[_0xe04d('0x42')]){var _0x1b94c5={'id':_0x9d40f6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x9d40f6['Smtp'][_0xe04d('0x81')]){_0x1b94c5[_0xe04d('0x81')]=_0x9d40f6[_0xe04d('0x42')][_0xe04d('0x81')];}else{_0x1b94c5[_0xe04d('0x80')]=_0x9d40f6['Smtp'][_0xe04d('0x80')];_0x1b94c5[_0xe04d('0x7f')]=_0x9d40f6[_0xe04d('0x42')][_0xe04d('0x7f')];_0x1b94c5[_0xe04d('0xb2')]=_0x9d40f6['Smtp']['secure'];}if(_0x9d40f6[_0xe04d('0x42')]['authentication']){_0x1b94c5['auth']={'user':_0x9d40f6['Smtp'][_0xe04d('0x7b')],'pass':_0x9d40f6[_0xe04d('0x42')][_0xe04d('0x82')]};}return respondWithRpcPromise(_0xe04d('0xbc'),'verifySmtp',{'account':_0x1b94c5});}})[_0xe04d('0x39')](respondWithResult(_0x5c17a6,null))[_0xe04d('0x2e')](handleError(_0x5c17a6,null));};exports[_0xe04d('0x38')]=function(_0x2baf41,_0x3cbfa4){return db['MailAccount'][_0xe04d('0x60')]({'where':{'id':_0x2baf41[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x3cbfa4,null))[_0xe04d('0x39')](function(_0x8dacb){if(_0x8dacb&&_0x8dacb['service']){throw new db[(_0xe04d('0xbd'))][(_0xe04d('0xbe'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x8dacb;})[_0xe04d('0x39')](removeEntity(_0x3cbfa4,null))[_0xe04d('0x2e')](handleError(_0x3cbfa4,null));};exports[_0xe04d('0xbf')]=function(_0x125173,_0x484968,_0x281356){return db[_0xe04d('0x57')][_0xe04d('0x60')]({'where':{'id':_0x125173[_0xe04d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x484968,null))[_0xe04d('0x39')](function(_0x47e4ac){if(_0x47e4ac){return _0x47e4ac[_0xe04d('0xbf')](_0x125173[_0xe04d('0x61')][_0xe04d('0x6e')],_[_0xe04d('0xc0')](_0x125173[_0xe04d('0x61')],['ids','id'])||{})[_0xe04d('0xc1')](function(_0x379c7f){for(var _0x2ef301=0x0;_0x2ef301<_0x125173[_0xe04d('0x61')][_0xe04d('0x6e')][_0xe04d('0x68')];_0x2ef301+=0x1){socket[_0xe04d('0xc2')](_0xe04d('0xc3'),{'UserId':_0x125173[_0xe04d('0x61')][_0xe04d('0x6e')][_0x2ef301],'MailAccountId':_0x125173[_0xe04d('0x5c')]['id']});}return _0x379c7f;});}})[_0xe04d('0x39')](respondWithResult(_0x484968,null))[_0xe04d('0x2e')](handleError(_0x484968,null));};exports[_0xe04d('0xc4')]=function(_0x5aa70f,_0x2cef1f,_0x5a2667){var _0x56c71f;return db['MailAccount'][_0xe04d('0x60')]({'where':{'id':_0x5aa70f['params']['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x2cef1f,null))[_0xe04d('0x39')](function(_0x571c67){if(_0x571c67){return _0x571c67[_0xe04d('0xc4')](_0x5aa70f[_0xe04d('0x47')][_0xe04d('0x6e')])['then'](function(_0x378fab){if(_[_0xe04d('0xc5')](_0x5aa70f[_0xe04d('0x47')][_0xe04d('0x6e')])){for(var _0x4bf3f7=0x0;_0x4bf3f7<_0x5aa70f['query'][_0xe04d('0x6e')][_0xe04d('0x68')];_0x4bf3f7+=0x1){socket[_0xe04d('0xc2')](_0xe04d('0xc6'),{'UserId':_0x5aa70f[_0xe04d('0x47')][_0xe04d('0x6e')][_0x4bf3f7],'MailAccountId':_0x5aa70f['params']['id']});}}else{socket['emit']('userMailAccount:remove',{'UserId':_0x5aa70f[_0xe04d('0x47')][_0xe04d('0x6e')],'MailAccountId':_0x5aa70f[_0xe04d('0x5c')]['id']});}});}})['then'](respondWithStatusCode(_0x2cef1f,null))[_0xe04d('0x2e')](handleError(_0x2cef1f,null));};exports[_0xe04d('0xc7')]=function(_0x50ef28,_0x40fdd1,_0x4b42cc){var _0x237f9b={};var _0x269f6d={};var _0x5e68ff;var _0x51fc7b;return db[_0xe04d('0x57')][_0xe04d('0x67')]({'where':{'id':_0x50ef28[_0xe04d('0x5c')]['id']}})[_0xe04d('0x39')](handleEntityNotFound(_0x40fdd1,null))[_0xe04d('0x39')](function(_0x45dd16){if(_0x45dd16){_0x5e68ff=_0x45dd16;_0x269f6d[_0xe04d('0x45')]=_[_0xe04d('0x46')](db[_0xe04d('0xc8')][_0xe04d('0x5e')]);_0x269f6d[_0xe04d('0x47')]=_[_0xe04d('0x46')](_0x50ef28[_0xe04d('0x47')]);_0x269f6d['filters']=_[_0xe04d('0x4a')](_0x269f6d[_0xe04d('0x45')],_0x269f6d['query']);_0x237f9b[_0xe04d('0x49')]=_[_0xe04d('0x4a')](_0x269f6d['model'],qs['fields'](_0x50ef28[_0xe04d('0x47')][_0xe04d('0x4b')]));_0x237f9b[_0xe04d('0x49')]=_0x237f9b[_0xe04d('0x49')][_0xe04d('0x68')]?_0x237f9b[_0xe04d('0x49')]:_0x269f6d[_0xe04d('0x45')];_0x237f9b[_0xe04d('0x4e')]=qs[_0xe04d('0x4f')](_0x50ef28[_0xe04d('0x47')][_0xe04d('0x4f')]);_0x237f9b[_0xe04d('0x51')]=qs[_0xe04d('0x48')](_['pick'](_0x50ef28['query'],_0x269f6d[_0xe04d('0x48')]));if(_0x50ef28[_0xe04d('0x47')][_0xe04d('0x50')]){_0x237f9b[_0xe04d('0x51')]=_[_0xe04d('0x52')](_0x237f9b[_0xe04d('0x51')],{'$or':_['map'](_0x237f9b[_0xe04d('0x49')],function(_0x1887c7){var _0x48f22e={};_0x48f22e[_0x1887c7]={'$like':'%'+_0x50ef28[_0xe04d('0x47')]['filter']+'%'};return _0x48f22e;})});}_0x237f9b=_[_0xe04d('0x52')]({},_0x237f9b,_0x50ef28[_0xe04d('0x5f')]);return _0x5e68ff[_0xe04d('0xc7')](_0x237f9b);}})['then'](function(_0xc3e753){if(_0xc3e753){_0x51fc7b=_0xc3e753[_0xe04d('0x68')];if(!_0x50ef28[_0xe04d('0x47')][_0xe04d('0x4c')](_0xe04d('0x69'))){_0x237f9b[_0xe04d('0x4d')]=qs[_0xe04d('0x4d')](_0x50ef28['query'][_0xe04d('0x4d')]);_0x237f9b[_0xe04d('0x31')]=qs['offset'](_0x50ef28['query'][_0xe04d('0x31')]);}return _0x5e68ff[_0xe04d('0xc7')](_0x237f9b);}})['then'](function(_0x1203a3){if(_0x1203a3){return _0x1203a3?{'count':_0x51fc7b,'rows':_0x1203a3}:null;}})[_0xe04d('0x39')](respondWithResult(_0x40fdd1,null))[_0xe04d('0x2e')](handleError(_0x40fdd1,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 4095164..42227b0 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 _0x38e2=['hook','events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x38e2,0x12a));var _0x238e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x38e2[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x238e('0x0'));var MailAccount=require(_0x238e('0x1'))['db'][_0x238e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x238e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x238e('0x4'),'afterDestroy':_0x238e('0x5')};function emitEvent(_0x432cbb){return function(_0x1d9790,_0x3697dc,_0x4810b6){MailAccountEvents[_0x238e('0x6')](_0x432cbb+':'+_0x1d9790['id'],_0x1d9790);MailAccountEvents[_0x238e('0x6')](_0x432cbb,_0x1d9790);_0x4810b6(null);};}for(var e in events){if(events[_0x238e('0x7')](e)){var event=events[e];MailAccount[_0x238e('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xf0c1=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xd93ea8,_0x209d63){var _0x13a865=function(_0x56c2e5){while(--_0x56c2e5){_0xd93ea8['push'](_0xd93ea8['shift']());}};_0x13a865(++_0x209d63);}(_0xf0c1,0x1b7));var _0x1f0c=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xf0c1[_0x576e2b];return _0x46461a;};'use strict';var EventEmitter=require(_0x1f0c('0x0'));var MailAccount=require(_0x1f0c('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1f0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f0c('0x3'),'afterDestroy':_0x1f0c('0x4')};function emitEvent(_0x590f59){return function(_0x15d6fc,_0x29d725,_0x185ab1){MailAccountEvents[_0x1f0c('0x5')](_0x590f59+':'+_0x15d6fc['id'],_0x15d6fc);MailAccountEvents[_0x1f0c('0x5')](_0x590f59,_0x15d6fc);_0x185ab1(null);};}for(var e in events){if(events[_0x1f0c('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 920f594..0fc17a3 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 _0x4ba5=['request-promise','./mailAccount.attributes','exports','MailAccount','mail_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x3cd133,_0x222fcb){var _0x2512c8=function(_0x484491){while(--_0x484491){_0x3cd133['push'](_0x3cd133['shift']());}};_0x2512c8(++_0x222fcb);}(_0x4ba5,0x109));var _0x54ba=function(_0x4dcb54,_0x56b806){_0x4dcb54=_0x4dcb54-0x0;var _0x1486fd=_0x4ba5[_0x4dcb54];return _0x1486fd;};'use strict';var _=require('lodash');var util=require(_0x54ba('0x0'));var logger=require(_0x54ba('0x1'))(_0x54ba('0x2'));var moment=require(_0x54ba('0x3'));var BPromise=require(_0x54ba('0x4'));var rp=require(_0x54ba('0x5'));var attributes=require(_0x54ba('0x6'));module[_0x54ba('0x7')]=function(_0x4b0e21,_0x4420fa){return _0x4b0e21['define'](_0x54ba('0x8'),attributes,{'tableName':_0x54ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fe4=['define','mail_accounts','lodash','util','../../config/logger','api','moment','request-promise','exports'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x8fe4,0xf5));var _0x48fe=function(_0x423486,_0x4fd032){_0x423486=_0x423486-0x0;var _0x41c5dc=_0x8fe4[_0x423486];return _0x41c5dc;};'use strict';var _=require(_0x48fe('0x0'));var util=require(_0x48fe('0x1'));var logger=require(_0x48fe('0x2'))(_0x48fe('0x3'));var moment=require(_0x48fe('0x4'));var BPromise=require('bluebird');var rp=require(_0x48fe('0x5'));var attributes=require('./mailAccount.attributes');module[_0x48fe('0x6')]=function(_0x5958b7,_0x5b7a58){return _0x5958b7[_0x48fe('0x7')]('MailAccount',attributes,{'tableName':_0x48fe('0x8'),'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 fbd0724..47fa213 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 _0xc508=['push','length','close','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','originTo','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','MailAccount','findAll','options','raw','where','attributes','include','map','model','GetMailAccount','find','ShowMailAccount','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','updatedAt','MailApplication','MailServerOut','Smtp','get','omit','Applications','applications','orderBy','priority','autoclose'];(function(_0x5de072,_0x4ca272){var _0x4d1dbd=function(_0x21de46){while(--_0x21de46){_0x5de072['push'](_0x5de072['shift']());}};_0x4d1dbd(++_0x4ca272);}(_0xc508,0xe9));var _0x8c50=function(_0x1a8adb,_0x40b6b0){_0x1a8adb=_0x1a8adb-0x0;var _0x222790=_0xc508[_0x1a8adb];return _0x222790;};'use strict';var _=require(_0x8c50('0x0'));var util=require(_0x8c50('0x1'));var moment=require(_0x8c50('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c50('0x3'));var db=require(_0x8c50('0x4'))['db'];var utils=require(_0x8c50('0x5'));var logger=require(_0x8c50('0x6'))(_0x8c50('0x7'));var config=require(_0x8c50('0x8'));var jayson=require(_0x8c50('0x9'));var client=jayson[_0x8c50('0xa')]['http']({'port':0x232c});config['redis']=_[_0x8c50('0xb')](config['redis'],{'host':_0x8c50('0xc'),'port':0x18eb});var socket=require(_0x8c50('0xd'))(new Redis(config[_0x8c50('0xe')]));require('./mailAccount.socket')[_0x8c50('0xf')](socket);function respondWithRpcPromise(_0x2c0ec9,_0x161c18,_0x14221b){return new BPromise(function(_0x49da20,_0x14f021){return client['request'](_0x2c0ec9,_0x14221b)[_0x8c50('0x10')](function(_0x2d4dd3){logger['info'](_0x8c50('0x11'),_0x161c18,'request\x20sent');logger[_0x8c50('0x12')](_0x8c50('0x13'),_0x161c18,_0x8c50('0x14'),JSON[_0x8c50('0x15')](_0x2d4dd3));if(_0x2d4dd3[_0x8c50('0x16')]){if(_0x2d4dd3[_0x8c50('0x16')]['code']===0x1f4){logger[_0x8c50('0x16')](_0x8c50('0x11'),_0x161c18,_0x2d4dd3[_0x8c50('0x16')][_0x8c50('0x17')]);return _0x14f021(_0x2d4dd3[_0x8c50('0x16')][_0x8c50('0x17')]);}logger[_0x8c50('0x16')]('MailAccount,\x20%s,\x20%s',_0x161c18,_0x2d4dd3[_0x8c50('0x16')][_0x8c50('0x17')]);return _0x49da20(_0x2d4dd3[_0x8c50('0x16')]['message']);}else{logger[_0x8c50('0x18')](_0x8c50('0x11'),_0x161c18,_0x8c50('0x14'));_0x49da20(_0x2d4dd3[_0x8c50('0x19')][_0x8c50('0x17')]);}})[_0x8c50('0x1a')](function(_0x1a3b0e){logger[_0x8c50('0x16')](_0x8c50('0x11'),_0x161c18,_0x1a3b0e);_0x14f021(_0x1a3b0e);});});}exports['GetMailAccount']=function(_0xfaa2b3){var _0x53576d=this;return new Promise(function(_0x59df07,_0x10eced){return db[_0x8c50('0x1b')][_0x8c50('0x1c')]({'raw':_0xfaa2b3[_0x8c50('0x1d')]?_0xfaa2b3[_0x8c50('0x1d')][_0x8c50('0x1e')]===undefined?!![]:![]:!![],'where':_0xfaa2b3[_0x8c50('0x1d')]?_0xfaa2b3[_0x8c50('0x1d')][_0x8c50('0x1f')]||null:null,'attributes':_0xfaa2b3[_0x8c50('0x1d')]?_0xfaa2b3[_0x8c50('0x1d')][_0x8c50('0x20')]||null:null,'limit':_0xfaa2b3[_0x8c50('0x1d')]?_0xfaa2b3[_0x8c50('0x1d')]['limit']||null:null,'include':_0xfaa2b3['options']?_0xfaa2b3['options'][_0x8c50('0x21')]?_[_0x8c50('0x22')](_0xfaa2b3[_0x8c50('0x1d')][_0x8c50('0x21')],function(_0x1088ef){return{'model':db[_0x1088ef[_0x8c50('0x23')]],'as':_0x1088ef['as'],'attributes':_0x1088ef[_0x8c50('0x20')],'include':_0x1088ef['include']?_[_0x8c50('0x22')](_0x1088ef[_0x8c50('0x21')],function(_0x25dead){return{'model':db[_0x25dead[_0x8c50('0x23')]],'as':_0x25dead['as'],'attributes':_0x25dead[_0x8c50('0x20')],'include':_0x25dead[_0x8c50('0x21')]?_[_0x8c50('0x22')](_0x25dead[_0x8c50('0x21')],function(_0x289d01){return{'model':db[_0x289d01['model']],'as':_0x289d01['as'],'attributes':_0x289d01[_0x8c50('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x281b33){logger[_0x8c50('0x18')]('GetMailAccount',_0xfaa2b3);logger['debug'](_0x8c50('0x24'),_0xfaa2b3,JSON['stringify'](_0x281b33));_0x59df07(_0x281b33);})[_0x8c50('0x1a')](function(_0x133085){logger[_0x8c50('0x16')](_0x8c50('0x24'),_0x133085[_0x8c50('0x17')],_0xfaa2b3);_0x10eced(_0x53576d[_0x8c50('0x16')](0x1f4,_0x133085['message']));});});};exports['ShowMailAccount']=function(_0x3a10ac){var _0x1baacf=this;return new Promise(function(_0x5ca8e5,_0x456f23){return db[_0x8c50('0x1b')][_0x8c50('0x25')]({'raw':_0x3a10ac[_0x8c50('0x1d')]?_0x3a10ac[_0x8c50('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3a10ac[_0x8c50('0x1d')]?_0x3a10ac[_0x8c50('0x1d')][_0x8c50('0x1f')]||null:null,'attributes':_0x3a10ac['options']?_0x3a10ac[_0x8c50('0x1d')][_0x8c50('0x20')]||null:null,'include':_0x3a10ac['options']?_0x3a10ac[_0x8c50('0x1d')][_0x8c50('0x21')]?_['map'](_0x3a10ac['options']['include'],function(_0x88324f){return{'model':db[_0x88324f[_0x8c50('0x23')]],'as':_0x88324f['as'],'attributes':_0x88324f['attributes'],'include':_0x88324f[_0x8c50('0x21')]?_[_0x8c50('0x22')](_0x88324f[_0x8c50('0x21')],function(_0x4d63a7){return{'model':db[_0x4d63a7[_0x8c50('0x23')]],'as':_0x4d63a7['as'],'attributes':_0x4d63a7[_0x8c50('0x20')],'include':_0x4d63a7[_0x8c50('0x21')]?_[_0x8c50('0x22')](_0x4d63a7[_0x8c50('0x21')],function(_0x34fdb3){return{'model':db[_0x34fdb3[_0x8c50('0x23')]],'as':_0x34fdb3['as'],'attributes':_0x34fdb3[_0x8c50('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ca947){logger[_0x8c50('0x18')](_0x8c50('0x26'),_0x3a10ac);logger['debug'](_0x8c50('0x26'),_0x3a10ac,JSON[_0x8c50('0x15')](_0x2ca947));_0x5ca8e5(_0x2ca947);})['catch'](function(_0x2bacfa){logger[_0x8c50('0x16')](_0x8c50('0x26'),_0x2bacfa[_0x8c50('0x17')],_0x3a10ac);_0x456f23(_0x1baacf[_0x8c50('0x16')](0x1f4,_0x2bacfa['message']));});});};exports[_0x8c50('0x27')]=function(_0x1356df){var _0x202517=this;return new Promise(function(_0x30bf45,_0x56ccbb){var _0x24dbfd={'body':_0x1356df[_0x8c50('0x28')],'channel':_0x8c50('0x29')};var _0x50ead7=_['difference'](_[_0x8c50('0x2a')](db[_0x8c50('0x2b')][_0x8c50('0x2c')]),['createdAt','updatedAt',_0x8c50('0x2d'),'ListId']);var _0x15b86d=![];if(_0x1356df[_0x8c50('0x28')]['id']){delete _0x1356df[_0x8c50('0x28')]['id'];}if(_[_0x8c50('0x2e')](_0x1356df[_0x8c50('0x28')][_0x8c50('0x2f')])){return _0x56ccbb(_0x202517['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x8c50('0x2e')](_0x1356df['body'][_0x8c50('0x28')])||_0x1356df[_0x8c50('0x28')][_0x8c50('0x28')]===''){return _0x56ccbb(_0x202517[_0x8c50('0x16')](0x1f4,_0x8c50('0x30')));}if(_[_0x8c50('0x2e')](_0x1356df[_0x8c50('0x28')][_0x8c50('0x31')])){return _0x56ccbb(_0x202517[_0x8c50('0x16')](0x1f4,_0x8c50('0x32')+_0x50ead7));}if(!_['includes'](_0x50ead7,_0x1356df[_0x8c50('0x28')]['mapKey'])){return _0x56ccbb(_0x202517['error'](0x1f4,_0x8c50('0x33')+_0x50ead7));}var _0x51d144={};_0x51d144[_0x1356df[_0x8c50('0x28')][_0x8c50('0x31')]]=_0x1356df[_0x8c50('0x28')][_0x8c50('0x2f')];return db[_0x8c50('0x1b')][_0x8c50('0x25')]({'where':{'id':_0x1356df[_0x8c50('0x34')]['id']},'include':[{'model':db[_0x8c50('0x35')],'as':_0x8c50('0x36'),'include':[{'model':db['CmContact'],'as':_0x8c50('0x37'),'where':_0x51d144,'limit':0x1,'order':[[_0x8c50('0x38'),'DESC']]}]},{'model':db[_0x8c50('0x39')],'as':'Applications'},{'model':db[_0x8c50('0x3a')],'as':_0x8c50('0x3b')}]})[_0x8c50('0x10')](function(_0x4814f4){if(_0x4814f4&&_0x4814f4[_0x8c50('0x36')]){var _0x596030=_0x4814f4[_0x8c50('0x3c')]({'plain':!![]});_0x24dbfd[_0x8c50('0x34')]=_[_0x8c50('0x3d')](_0x596030,[_0x8c50('0x3e'),_0x8c50('0x36')]);_0x24dbfd[_0x8c50('0x3f')]=_0x596030[_0x8c50('0x3e')];_0x24dbfd['list']=_0x596030[_0x8c50('0x36')];_0x24dbfd[_0x8c50('0x3f')]=_[_0x8c50('0x40')](_0x24dbfd['applications'],[_0x8c50('0x41')],['asc']);if(_0x24dbfd[_0x8c50('0x34')]&&_0x24dbfd[_0x8c50('0x34')][_0x8c50('0x42')]){_0x24dbfd[_0x8c50('0x3f')][_0x8c50('0x43')]({'id':0x0,'priority':_0x24dbfd[_0x8c50('0x3f')][_0x8c50('0x44')]+0x1,'app':_0x8c50('0x45'),'appdata':'autoclose','interval':_0x8c50('0x46')});}if(_0x24dbfd[_0x8c50('0x34')]['Applications']){delete _0x24dbfd['account'][_0x8c50('0x3e')];}if(_0x24dbfd[_0x8c50('0x34')][_0x8c50('0x36')]){delete _0x24dbfd[_0x8c50('0x34')]['List'];}if(_0x596030[_0x8c50('0x36')][_0x8c50('0x37')][_0x8c50('0x44')]){return _0x596030[_0x8c50('0x36')][_0x8c50('0x37')][0x0];}var _0x2055af=_['defaults'](_0x1356df[_0x8c50('0x28')],{'firstName':_0x1356df[_0x8c50('0x28')]['from'],'ListId':_0x596030[_0x8c50('0x47')]});_0x2055af[_0x1356df[_0x8c50('0x28')][_0x8c50('0x31')]]=_0x1356df[_0x8c50('0x28')]['from'];return db[_0x8c50('0x2b')][_0x8c50('0x48')](_0x2055af);}else{throw new Error(_0x8c50('0x49'));}})[_0x8c50('0x10')](function(_0x351ea0){_0x24dbfd[_0x8c50('0x4a')]=_0x351ea0;if(_0x351ea0){if(!_0x1356df['body'][_0x8c50('0x17')][_0x8c50('0x4b')]){_0x1356df['body']['message'][_0x8c50('0x4b')]=rs[_0x8c50('0x4c')]()+'\x20'+_0x1356df['body'][_0x8c50('0x17')][_0x8c50('0x2f')];}var _0x16ec19={'ContactId':_0x351ea0['id'],'MailAccountId':_0x1356df['account']['id'],'inReplyTo':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')][_0x8c50('0x4b')],'to':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')][_0x8c50('0x2f')],'cc':_0x1356df['body']['message']['cc'],'subject':_0x1356df[_0x8c50('0x28')]['message'][_0x8c50('0x4d')],'attach':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')][_0x8c50('0x4e')],'lastMsgAt':moment()['format'](_0x8c50('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x1356df[_0x8c50('0x28')][_0x8c50('0x28')]};return db[_0x8c50('0x50')][_0x8c50('0x25')]({'where':{'closed':![],'MailAccountId':_0x1356df['account']['id']},'include':[{'model':db[_0x8c50('0x51')],'as':_0x8c50('0x52'),'attributes':['messageId'],'where':{'messageId':_0x1356df[_0x8c50('0x28')]['message'][_0x8c50('0x53')]}}]})[_0x8c50('0x10')](function(_0x5a5e58){if(_0x5a5e58){return[_0x5a5e58,![]];}return db['MailInteraction'][_0x8c50('0x48')](_0x16ec19)['then'](function(_0x33a2a0){return[_0x33a2a0,!![]];});});}else{throw new Error(_0x8c50('0x54'));}})[_0x8c50('0x55')](function(_0x2e1eea,_0x51feb0){if(_0x2e1eea){_0x15b86d=_0x51feb0;if(!_0x51feb0){return _0x2e1eea[_0x8c50('0x56')]({'inReplyTo':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')][_0x8c50('0x4b')],'to':_0x1356df['body'][_0x8c50('0x17')]['from'],'cc':_0x1356df['body'][_0x8c50('0x17')]['cc'],'subject':_0x1356df['body'][_0x8c50('0x17')][_0x8c50('0x4d')],'attach':_0x2e1eea['attach']?_0x2e1eea[_0x8c50('0x4e')]:_0x1356df['body'][_0x8c50('0x17')][_0x8c50('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0x8c50('0x4f')),'lastMsgAt':moment()[_0x8c50('0x57')](_0x8c50('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x1356df[_0x8c50('0x28')]['body']});}else{return _0x2e1eea;}}})[_0x8c50('0x10')](function(_0x49596f){_0x24dbfd[_0x8c50('0x58')]=_0x49596f[_0x8c50('0x3c')]({'plain':!![]});_0x24dbfd['interaction'][_0x8c50('0x59')]=_0x15b86d;return db[_0x8c50('0x51')][_0x8c50('0x48')]({'body':_0x1356df[_0x8c50('0x28')][_0x8c50('0x28')],'MailAccountId':_0x1356df[_0x8c50('0x34')]['id'],'MailInteractionId':_0x49596f['id'],'direction':'in','ContactId':_0x24dbfd[_0x8c50('0x4a')]['id'],'messageId':_0x1356df['body']['message'][_0x8c50('0x4b')],'from':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['from'],'to':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['to'],'cc':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['cc'],'subject':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['subject'],'attach':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')][_0x8c50('0x4e')],'Attachments':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['attachments'],'originTo':_0x1356df[_0x8c50('0x28')]['message'][_0x8c50('0x5a')],'originCc':_0x1356df[_0x8c50('0x28')][_0x8c50('0x17')]['originCc'],'bcc':_0x1356df['body']['message']['bcc']},{'include':[{'model':db[_0x8c50('0x5b')],'as':_0x8c50('0x5c')}]});})['then'](function(_0x1ce9be){_0x24dbfd[_0x8c50('0x17')]=_0x1ce9be;if(_0x24dbfd[_0x8c50('0x58')][_0x8c50('0x5d')]){return db[_0x8c50('0x5e')][_0x8c50('0x25')]({'attributes':['id',_0x8c50('0x5f')],'where':{'id':_0x24dbfd[_0x8c50('0x58')][_0x8c50('0x5d')]}})[_0x8c50('0x10')](function(_0xb342ee){if(_0xb342ee){_0x24dbfd[_0x8c50('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8c50('0x60'),'appdata':_0xb342ee[_0x8c50('0x5f')]+','+(_0x24dbfd['account'][_0x8c50('0x61')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x8c50('0x62'),_0x8c50('0x63'),_0x24dbfd);});}return respondWithRpcPromise('Start','startRouting',_0x24dbfd);})[_0x8c50('0x10')](function(_0x53e40e){_0x30bf45(_0x53e40e);})[_0x8c50('0x1a')](function(_0xbb6330){_0x56ccbb(_0x202517['error'](0x1f4,_0xbb6330['message']));});});}; \ No newline at end of file +var _0xa1e0=['ShowMailAccount','find','raw','NotifyMailAccount','body','mail','keys','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','Applications','Smtp','omit','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','Contacts','ListId','create','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','interaction','get','created','contact','attachments','originTo','originCc','bcc','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent','startRouting','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','include','map','model'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa1e0,0x104));var _0x0a1e=function(_0x4bb549,_0x4e2a74){_0x4bb549=_0x4bb549-0x0;var _0x5bc042=_0xa1e0[_0x4bb549];return _0x5bc042;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0a1e('0x0'));var BPromise=require('bluebird');var rs=require(_0x0a1e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a1e('0x2'))['db'];var utils=require(_0x0a1e('0x3'));var logger=require('../../config/logger')(_0x0a1e('0x4'));var config=require(_0x0a1e('0x5'));var jayson=require(_0x0a1e('0x6'));var client=jayson[_0x0a1e('0x7')]['http']({'port':0x232c});config['redis']=_[_0x0a1e('0x8')](config[_0x0a1e('0x9')],{'host':_0x0a1e('0xa'),'port':0x18eb});var socket=require(_0x0a1e('0xb'))(new Redis(config[_0x0a1e('0x9')]));require(_0x0a1e('0xc'))[_0x0a1e('0xd')](socket);function respondWithRpcPromise(_0x483fe2,_0x43d857,_0x386cb4){return new BPromise(function(_0x144e4d,_0x5c4847){return client[_0x0a1e('0xe')](_0x483fe2,_0x386cb4)[_0x0a1e('0xf')](function(_0x2ec437){logger[_0x0a1e('0x10')](_0x0a1e('0x11'),_0x43d857,_0x0a1e('0x12'));logger[_0x0a1e('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x43d857,_0x0a1e('0x12'),JSON[_0x0a1e('0x14')](_0x2ec437));if(_0x2ec437[_0x0a1e('0x15')]){if(_0x2ec437['error'][_0x0a1e('0x16')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x43d857,_0x2ec437[_0x0a1e('0x15')][_0x0a1e('0x17')]);return _0x5c4847(_0x2ec437[_0x0a1e('0x15')][_0x0a1e('0x17')]);}logger[_0x0a1e('0x15')](_0x0a1e('0x11'),_0x43d857,_0x2ec437[_0x0a1e('0x15')][_0x0a1e('0x17')]);return _0x144e4d(_0x2ec437[_0x0a1e('0x15')][_0x0a1e('0x17')]);}else{logger[_0x0a1e('0x10')](_0x0a1e('0x11'),_0x43d857,_0x0a1e('0x12'));_0x144e4d(_0x2ec437[_0x0a1e('0x18')][_0x0a1e('0x17')]);}})[_0x0a1e('0x19')](function(_0x448b93){logger[_0x0a1e('0x15')](_0x0a1e('0x11'),_0x43d857,_0x448b93);_0x5c4847(_0x448b93);});});}exports[_0x0a1e('0x1a')]=function(_0x4b38af){var _0x1ffbd6=this;return new Promise(function(_0x1f82fd,_0x977cf1){return db[_0x0a1e('0x1b')]['findAll']({'raw':_0x4b38af[_0x0a1e('0x1c')]?_0x4b38af[_0x0a1e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4b38af['options']?_0x4b38af[_0x0a1e('0x1c')][_0x0a1e('0x1d')]||null:null,'attributes':_0x4b38af[_0x0a1e('0x1c')]?_0x4b38af[_0x0a1e('0x1c')][_0x0a1e('0x1e')]||null:null,'limit':_0x4b38af[_0x0a1e('0x1c')]?_0x4b38af[_0x0a1e('0x1c')]['limit']||null:null,'include':_0x4b38af[_0x0a1e('0x1c')]?_0x4b38af[_0x0a1e('0x1c')][_0x0a1e('0x1f')]?_[_0x0a1e('0x20')](_0x4b38af['options']['include'],function(_0x26dd4b){return{'model':db[_0x26dd4b[_0x0a1e('0x21')]],'as':_0x26dd4b['as'],'attributes':_0x26dd4b[_0x0a1e('0x1e')],'include':_0x26dd4b[_0x0a1e('0x1f')]?_[_0x0a1e('0x20')](_0x26dd4b[_0x0a1e('0x1f')],function(_0x324d74){return{'model':db[_0x324d74['model']],'as':_0x324d74['as'],'attributes':_0x324d74[_0x0a1e('0x1e')],'include':_0x324d74[_0x0a1e('0x1f')]?_[_0x0a1e('0x20')](_0x324d74[_0x0a1e('0x1f')],function(_0x2e7bc7){return{'model':db[_0x2e7bc7['model']],'as':_0x2e7bc7['as'],'attributes':_0x2e7bc7['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a1e('0xf')](function(_0x3f196e){logger[_0x0a1e('0x10')](_0x0a1e('0x1a'),_0x4b38af);logger[_0x0a1e('0x13')](_0x0a1e('0x1a'),_0x4b38af,JSON[_0x0a1e('0x14')](_0x3f196e));_0x1f82fd(_0x3f196e);})[_0x0a1e('0x19')](function(_0x5ce099){logger[_0x0a1e('0x15')](_0x0a1e('0x1a'),_0x5ce099[_0x0a1e('0x17')],_0x4b38af);_0x977cf1(_0x1ffbd6[_0x0a1e('0x15')](0x1f4,_0x5ce099[_0x0a1e('0x17')]));});});};exports[_0x0a1e('0x22')]=function(_0x1655c1){var _0x46446a=this;return new Promise(function(_0x43f035,_0x3b14d4){return db[_0x0a1e('0x1b')][_0x0a1e('0x23')]({'raw':_0x1655c1[_0x0a1e('0x1c')]?_0x1655c1[_0x0a1e('0x1c')][_0x0a1e('0x24')]===undefined?!![]:![]:!![],'where':_0x1655c1[_0x0a1e('0x1c')]?_0x1655c1[_0x0a1e('0x1c')][_0x0a1e('0x1d')]||null:null,'attributes':_0x1655c1['options']?_0x1655c1[_0x0a1e('0x1c')][_0x0a1e('0x1e')]||null:null,'include':_0x1655c1['options']?_0x1655c1[_0x0a1e('0x1c')][_0x0a1e('0x1f')]?_[_0x0a1e('0x20')](_0x1655c1[_0x0a1e('0x1c')]['include'],function(_0x2c319e){return{'model':db[_0x2c319e[_0x0a1e('0x21')]],'as':_0x2c319e['as'],'attributes':_0x2c319e['attributes'],'include':_0x2c319e[_0x0a1e('0x1f')]?_[_0x0a1e('0x20')](_0x2c319e[_0x0a1e('0x1f')],function(_0x58cf90){return{'model':db[_0x58cf90[_0x0a1e('0x21')]],'as':_0x58cf90['as'],'attributes':_0x58cf90[_0x0a1e('0x1e')],'include':_0x58cf90['include']?_[_0x0a1e('0x20')](_0x58cf90[_0x0a1e('0x1f')],function(_0x20ba17){return{'model':db[_0x20ba17[_0x0a1e('0x21')]],'as':_0x20ba17['as'],'attributes':_0x20ba17[_0x0a1e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3635fb){logger[_0x0a1e('0x10')]('ShowMailAccount',_0x1655c1);logger[_0x0a1e('0x13')]('ShowMailAccount',_0x1655c1,JSON[_0x0a1e('0x14')](_0x3635fb));_0x43f035(_0x3635fb);})[_0x0a1e('0x19')](function(_0x575861){logger[_0x0a1e('0x15')](_0x0a1e('0x22'),_0x575861[_0x0a1e('0x17')],_0x1655c1);_0x3b14d4(_0x46446a[_0x0a1e('0x15')](0x1f4,_0x575861[_0x0a1e('0x17')]));});});};exports[_0x0a1e('0x25')]=function(_0x2c5399){var _0x49e106=this;return new Promise(function(_0x20f39d,_0x33303b){var _0x21abda={'body':_0x2c5399[_0x0a1e('0x26')],'channel':_0x0a1e('0x27')};var _0x52034d=_['difference'](_[_0x0a1e('0x28')](db['CmContact'][_0x0a1e('0x29')]),[_0x0a1e('0x2a'),_0x0a1e('0x2b'),_0x0a1e('0x2c'),'ListId']);var _0x4b8095=![];if(_0x2c5399['body']['id']){delete _0x2c5399[_0x0a1e('0x26')]['id'];}if(_[_0x0a1e('0x2d')](_0x2c5399['body'][_0x0a1e('0x2e')])){return _0x33303b(_0x49e106[_0x0a1e('0x15')](0x1f4,_0x0a1e('0x2f')));}if(_[_0x0a1e('0x2d')](_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x26')])||_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x26')]===''){return _0x33303b(_0x49e106[_0x0a1e('0x15')](0x1f4,_0x0a1e('0x30')));}if(_[_0x0a1e('0x2d')](_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x31')])){return _0x33303b(_0x49e106[_0x0a1e('0x15')](0x1f4,_0x0a1e('0x32')+_0x52034d));}if(!_[_0x0a1e('0x33')](_0x52034d,_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x31')])){return _0x33303b(_0x49e106[_0x0a1e('0x15')](0x1f4,_0x0a1e('0x34')+_0x52034d));}var _0x254c6c={};_0x254c6c[_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x31')]]=_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x2e')];return db['MailAccount'][_0x0a1e('0x23')]({'where':{'id':_0x2c5399[_0x0a1e('0x35')]['id']},'include':[{'model':db[_0x0a1e('0x36')],'as':_0x0a1e('0x37'),'include':[{'model':db[_0x0a1e('0x38')],'as':'Contacts','where':_0x254c6c,'limit':0x1,'order':[['updatedAt',_0x0a1e('0x39')]]}]},{'model':db[_0x0a1e('0x3a')],'as':_0x0a1e('0x3b')},{'model':db['MailServerOut'],'as':_0x0a1e('0x3c')}]})[_0x0a1e('0xf')](function(_0x40e14c){if(_0x40e14c&&_0x40e14c[_0x0a1e('0x37')]){var _0x43edf5=_0x40e14c['get']({'plain':!![]});_0x21abda[_0x0a1e('0x35')]=_[_0x0a1e('0x3d')](_0x43edf5,[_0x0a1e('0x3b'),_0x0a1e('0x37')]);_0x21abda[_0x0a1e('0x3e')]=_0x43edf5[_0x0a1e('0x3b')];_0x21abda['list']=_0x43edf5['List'];_0x21abda[_0x0a1e('0x3e')]=_[_0x0a1e('0x3f')](_0x21abda[_0x0a1e('0x3e')],[_0x0a1e('0x40')],[_0x0a1e('0x41')]);if(_0x21abda[_0x0a1e('0x35')]&&_0x21abda['account'][_0x0a1e('0x42')]){_0x21abda['applications'][_0x0a1e('0x43')]({'id':0x0,'priority':_0x21abda[_0x0a1e('0x3e')][_0x0a1e('0x44')]+0x1,'app':'close','appdata':_0x0a1e('0x42'),'interval':_0x0a1e('0x45')});}if(_0x21abda[_0x0a1e('0x35')][_0x0a1e('0x3b')]){delete _0x21abda[_0x0a1e('0x35')][_0x0a1e('0x3b')];}if(_0x21abda['account'][_0x0a1e('0x37')]){delete _0x21abda[_0x0a1e('0x35')][_0x0a1e('0x37')];}if(_0x43edf5[_0x0a1e('0x37')][_0x0a1e('0x46')][_0x0a1e('0x44')]){return _0x43edf5[_0x0a1e('0x37')][_0x0a1e('0x46')][0x0];}var _0x49a71a=_[_0x0a1e('0x8')](_0x2c5399[_0x0a1e('0x26')],{'firstName':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x2e')],'ListId':_0x43edf5[_0x0a1e('0x47')]});_0x49a71a[_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x31')]]=_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x2e')];return db['CmContact'][_0x0a1e('0x48')](_0x49a71a);}else{throw new Error(_0x0a1e('0x49'));}})[_0x0a1e('0xf')](function(_0x5886fe){_0x21abda['contact']=_0x5886fe;if(_0x5886fe){if(!_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4a')]){_0x2c5399['body']['message']['messageId']=rs['generate']()+'\x20'+_0x2c5399[_0x0a1e('0x26')]['message']['from'];}var _0x2f300e={'ContactId':_0x5886fe['id'],'MailAccountId':_0x2c5399[_0x0a1e('0x35')]['id'],'inReplyTo':_0x2c5399['body'][_0x0a1e('0x17')][_0x0a1e('0x4a')],'to':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x2e')],'cc':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['cc'],'subject':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4b')],'attach':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4c')],'lastMsgAt':moment()['format'](_0x0a1e('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x26')]};return db[_0x0a1e('0x4e')][_0x0a1e('0x23')]({'where':{'closed':![],'MailAccountId':_0x2c5399[_0x0a1e('0x35')]['id']},'include':[{'model':db[_0x0a1e('0x4f')],'as':_0x0a1e('0x50'),'attributes':[_0x0a1e('0x4a')],'where':{'messageId':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['inReplyTo']}}]})[_0x0a1e('0xf')](function(_0x2c540f){if(_0x2c540f){return[_0x2c540f,![]];}return db[_0x0a1e('0x4e')][_0x0a1e('0x48')](_0x2f300e)[_0x0a1e('0xf')](function(_0xa97632){return[_0xa97632,!![]];});});}else{throw new Error(_0x0a1e('0x51'));}})[_0x0a1e('0x52')](function(_0x5cfaa4,_0x4e6c0e){if(_0x5cfaa4){_0x4b8095=_0x4e6c0e;if(!_0x4e6c0e){return _0x5cfaa4['update']({'inReplyTo':_0x2c5399['body'][_0x0a1e('0x17')][_0x0a1e('0x4a')],'to':_0x2c5399[_0x0a1e('0x26')]['message'][_0x0a1e('0x2e')],'cc':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['cc'],'subject':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4b')],'attach':_0x5cfaa4[_0x0a1e('0x4c')]?_0x5cfaa4['attach']:_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4c')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x0a1e('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x26')]});}else{return _0x5cfaa4;}}})['then'](function(_0x2e124c){_0x21abda[_0x0a1e('0x53')]=_0x2e124c[_0x0a1e('0x54')]({'plain':!![]});_0x21abda['interaction'][_0x0a1e('0x55')]=_0x4b8095;return db[_0x0a1e('0x4f')][_0x0a1e('0x48')]({'body':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x26')],'MailAccountId':_0x2c5399[_0x0a1e('0x35')]['id'],'MailInteractionId':_0x2e124c['id'],'direction':'in','ContactId':_0x21abda[_0x0a1e('0x56')]['id'],'messageId':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4a')],'from':_0x2c5399['body'][_0x0a1e('0x17')][_0x0a1e('0x2e')],'to':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['to'],'cc':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['cc'],'subject':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')][_0x0a1e('0x4b')],'attach':_0x2c5399[_0x0a1e('0x26')][_0x0a1e('0x17')]['attach'],'Attachments':_0x2c5399[_0x0a1e('0x26')]['message'][_0x0a1e('0x57')],'originTo':_0x2c5399[_0x0a1e('0x26')]['message'][_0x0a1e('0x58')],'originCc':_0x2c5399['body'][_0x0a1e('0x17')][_0x0a1e('0x59')],'bcc':_0x2c5399['body']['message'][_0x0a1e('0x5a')]},{'include':[{'model':db[_0x0a1e('0x5b')],'as':_0x0a1e('0x5c')}]});})['then'](function(_0x8602b){_0x21abda[_0x0a1e('0x17')]=_0x8602b;if(_0x21abda[_0x0a1e('0x53')][_0x0a1e('0x5d')]){return db['User'][_0x0a1e('0x23')]({'attributes':['id',_0x0a1e('0x5e')],'where':{'id':_0x21abda[_0x0a1e('0x53')]['UserId']}})[_0x0a1e('0xf')](function(_0x7066de){if(_0x7066de){_0x21abda[_0x0a1e('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0a1e('0x5f'),'appdata':_0x7066de['name']+','+(_0x21abda['account'][_0x0a1e('0x60')]||0xa),'interval':_0x0a1e('0x45')});}return respondWithRpcPromise('Start',_0x0a1e('0x61'),_0x21abda);});}return respondWithRpcPromise('Start',_0x0a1e('0x61'),_0x21abda);})[_0x0a1e('0xf')](function(_0x35e8ee){_0x20f39d(_0x35e8ee);})[_0x0a1e('0x19')](function(_0x3bf30e){_0x33303b(_0x49e106[_0x0a1e('0x15')](0x1f4,_0x3bf30e[_0x0a1e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index d221ce2..54b7bbe 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 _0x8ba2=['emit','removeListener','length','mailAccount:','./mailAccount.events','remove','update'];(function(_0x480a5f,_0x16db53){var _0x46dbc8=function(_0x390edb){while(--_0x390edb){_0x480a5f['push'](_0x480a5f['shift']());}};_0x46dbc8(++_0x16db53);}(_0x8ba2,0x12a));var _0x28ba=function(_0x33a819,_0x4f7161){_0x33a819=_0x33a819-0x0;var _0x2d112f=_0x8ba2[_0x33a819];return _0x2d112f;};'use strict';var MailAccountEvents=require(_0x28ba('0x0'));var events=['save',_0x28ba('0x1'),_0x28ba('0x2')];function createListener(_0x26f137,_0x4640b3){return function(_0x1acd5d){_0x4640b3[_0x28ba('0x3')](_0x26f137,_0x1acd5d);};}function removeListener(_0x3eddb2,_0x4d37c5){return function(){MailAccountEvents[_0x28ba('0x4')](_0x3eddb2,_0x4d37c5);};}exports['register']=function(_0x23d7ac){for(var _0x3ccd7d=0x0,_0x20d914=events[_0x28ba('0x5')];_0x3ccd7d<_0x20d914;_0x3ccd7d++){var _0x59726e=events[_0x3ccd7d];var _0x33784a=createListener(_0x28ba('0x6')+_0x59726e,_0x23d7ac);MailAccountEvents['on'](_0x59726e,_0x33784a);}}; \ No newline at end of file +var _0xc759=['mailAccount:','./mailAccount.events','save','update','emit','register','length'];(function(_0x178de3,_0x5f4552){var _0x50e06c=function(_0x28f92d){while(--_0x28f92d){_0x178de3['push'](_0x178de3['shift']());}};_0x50e06c(++_0x5f4552);}(_0xc759,0x17b));var _0x9c75=function(_0x184be3,_0x2a60dd){_0x184be3=_0x184be3-0x0;var _0x543073=_0xc759[_0x184be3];return _0x543073;};'use strict';var MailAccountEvents=require(_0x9c75('0x0'));var events=[_0x9c75('0x1'),'remove',_0x9c75('0x2')];function createListener(_0x35f977,_0x756e9c){return function(_0x5c98f1){_0x756e9c[_0x9c75('0x3')](_0x35f977,_0x5c98f1);};}function removeListener(_0x57627d,_0x30ed30){return function(){MailAccountEvents['removeListener'](_0x57627d,_0x30ed30);};}exports[_0x9c75('0x4')]=function(_0x4a1b45){for(var _0x5daab1=0x0,_0xa355a0=events[_0x9c75('0x5')];_0x5daab1<_0xa355a0;_0x5daab1++){var _0x398092=events[_0x5daab1];var _0x2f22ea=createListener(_0x9c75('0x6')+_0x398092,_0x4a1b45);MailAccountEvents['on'](_0x398092,_0x2f22ea);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 104a628..089fa2a 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 _0x4746=['delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','put','update'];(function(_0x4631eb,_0x55649e){var _0x562eca=function(_0x25a436){while(--_0x25a436){_0x4631eb['push'](_0x4631eb['shift']());}};_0x562eca(++_0x55649e);}(_0x4746,0xc6));var _0x6474=function(_0x56b9ee,_0x25a747){_0x56b9ee=_0x56b9ee-0x0;var _0x371286=_0x4746[_0x56b9ee];return _0x371286;};'use strict';var multer=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var path=require('path');var timeout=require(_0x6474('0x2'));var express=require('express');var router=express[_0x6474('0x3')]();var auth=require(_0x6474('0x4'));var interaction=require(_0x6474('0x5'));var config=require(_0x6474('0x6'));var controller=require(_0x6474('0x7'));router['get'](_0x6474('0x8'),auth[_0x6474('0x9')](),controller['show']);router[_0x6474('0xa')](_0x6474('0x8'),auth[_0x6474('0x9')](),controller[_0x6474('0xb')]);router[_0x6474('0xc')](_0x6474('0x8'),auth['isAuthenticated'](),controller[_0x6474('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd52a=['./mailApplication.controller','get','put','isAuthenticated','delete','/:id','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5f1819,_0x33252){var _0x24d6bf=function(_0x321620){while(--_0x321620){_0x5f1819['push'](_0x5f1819['shift']());}};_0x24d6bf(++_0x33252);}(_0xd52a,0xca));var _0xad52=function(_0x5f5be3,_0x18f4b0){_0x5f5be3=_0x5f5be3-0x0;var _0x411f8e=_0xd52a[_0x5f5be3];return _0x411f8e;};'use strict';var multer=require('multer');var util=require(_0xad52('0x0'));var path=require('path');var timeout=require(_0xad52('0x1'));var express=require(_0xad52('0x2'));var router=express[_0xad52('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xad52('0x4'));var config=require(_0xad52('0x5'));var controller=require(_0xad52('0x6'));router[_0xad52('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad52('0x8')]('/:id',auth[_0xad52('0x9')](),controller['update']);router[_0xad52('0xa')](_0xad52('0xb'),auth['isAuthenticated'](),controller[_0xad52('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index b66f93e..54687a5 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 _0x29c1=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3ab8d3,_0x49c69d){var _0x3c23e0=function(_0x41de88){while(--_0x41de88){_0x3ab8d3['push'](_0x3ab8d3['shift']());}};_0x3c23e0(++_0x49c69d);}(_0x29c1,0x1c7));var _0x129c=function(_0x1f45d8,_0x31fd02){_0x1f45d8=_0x1f45d8-0x0;var _0xd12334=_0x29c1[_0x1f45d8];return _0xd12334;};'use strict';var Sequelize=require(_0x129c('0x0'));module[_0x129c('0x1')]={'priority':{'type':Sequelize[_0x129c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x129c('0x3')],'allowNull':![],'defaultValue':_0x129c('0x4')},'appdata':{'type':Sequelize[_0x129c('0x5')]()},'description':{'type':Sequelize[_0x129c('0x3')]},'interval':{'type':Sequelize[_0x129c('0x3')],'defaultValue':_0x129c('0x6')}}; \ No newline at end of file +var _0xe81b=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x225074,_0x1abb16){var _0x3fb50c=function(_0xf22c61){while(--_0xf22c61){_0x225074['push'](_0x225074['shift']());}};_0x3fb50c(++_0x1abb16);}(_0xe81b,0xe4));var _0xbe81=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xe81b[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xbe81('0x0'));module[_0xbe81('0x1')]={'priority':{'type':Sequelize[_0xbe81('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbe81('0x3')],'allowNull':![],'defaultValue':_0xbe81('0x4')},'appdata':{'type':Sequelize[_0xbe81('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 5907035..d35b13b 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 _0xa9e0=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x82619d,_0x44df9c){var _0x4683a5=function(_0x356ad7){while(--_0x356ad7){_0x82619d['push'](_0x82619d['shift']());}};_0x4683a5(++_0x44df9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file +var _0xa9e0=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x1b4339,_0x4eb85a){var _0x147da2=function(_0x5983ec){while(--_0x5983ec){_0x1b4339['push'](_0x1b4339['shift']());}};_0x147da2(++_0x4eb85a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d4f191d..b5ee942 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 _0x9716=['bluebird','request-promise','./mailApplication.attributes','exports','MailApplication','mail_applications','lodash','util','api','moment'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x9716,0xba));var _0x6971=function(_0x2523c1,_0x30e3fe){_0x2523c1=_0x2523c1-0x0;var _0x5357bf=_0x9716[_0x2523c1];return _0x5357bf;};'use strict';var _=require(_0x6971('0x0'));var util=require(_0x6971('0x1'));var logger=require('../../config/logger')(_0x6971('0x2'));var moment=require(_0x6971('0x3'));var BPromise=require(_0x6971('0x4'));var rp=require(_0x6971('0x5'));var attributes=require(_0x6971('0x6'));module[_0x6971('0x7')]=function(_0xc587f0,_0x520ceb){return _0xc587f0['define'](_0x6971('0x8'),attributes,{'tableName':_0x6971('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcad=['moment','bluebird','request-promise','./mailApplication.attributes','mail_applications','lodash','util','../../config/logger','api'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xdcad,0x1be));var _0xddca=function(_0x3740c8,_0x3a9c88){_0x3740c8=_0x3740c8-0x0;var _0x2f7acd=_0xdcad[_0x3740c8];return _0x2f7acd;};'use strict';var _=require(_0xddca('0x0'));var util=require(_0xddca('0x1'));var logger=require(_0xddca('0x2'))(_0xddca('0x3'));var moment=require(_0xddca('0x4'));var BPromise=require(_0xddca('0x5'));var rp=require(_0xddca('0x6'));var attributes=require(_0xddca('0x7'));module['exports']=function(_0x5f0d0e,_0x4a760e){return _0x5f0d0e['define']('MailApplication',attributes,{'tableName':_0xddca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index cf78fe8..05bd2d7 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 _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x572625,_0x27073f){var _0x51aea1=function(_0x276538){while(--_0x276538){_0x572625['push'](_0x572625['shift']());}};_0x51aea1(++_0x27073f);}(_0x7a54,0x106));var _0x47a5=function(_0x467270,_0x5ac816){_0x467270=_0x467270-0x0;var _0x142ff5=_0x7a54[_0x467270];return _0x142ff5;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4be512,_0x106828){var _0x126651=function(_0x533b03){while(--_0x533b03){_0x4be512['push'](_0x4be512['shift']());}};_0x126651(++_0x106828);}(_0x7a54,0x106));var _0x47a5=function(_0x4c1acc,_0x326e54){_0x4c1acc=_0x4c1acc-0x0;var _0x46bd48=_0x7a54[_0x4c1acc];return _0x46bd48;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5eb294e..76a0d62 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 _0x75ad=['mail','mailinteraction:addtags','addTags','put','/:id','update','mailinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x75ad,0xca));var _0xd75a=function(_0x2f9ccf,_0x32de98){_0x2f9ccf=_0x2f9ccf-0x0;var _0x37e407=_0x75ad[_0x2f9ccf];return _0x37e407;};'use strict';var multer=require(_0xd75a('0x0'));var util=require(_0xd75a('0x1'));var path=require(_0xd75a('0x2'));var timeout=require(_0xd75a('0x3'));var express=require(_0xd75a('0x4'));var router=express[_0xd75a('0x5')]();var auth=require(_0xd75a('0x6'));var interaction=require(_0xd75a('0x7'));var config=require(_0xd75a('0x8'));var controller=require(_0xd75a('0x9'));router[_0xd75a('0xa')]('/',auth[_0xd75a('0xb')](),controller['index']);router[_0xd75a('0xa')]('/describe',auth[_0xd75a('0xb')](),controller[_0xd75a('0xc')]);router['get']('/:id',auth[_0xd75a('0xb')](),controller['show']);router[_0xd75a('0xa')](_0xd75a('0xd'),auth[_0xd75a('0xb')](),controller[_0xd75a('0xe')]);router[_0xd75a('0xa')](_0xd75a('0xf'),auth[_0xd75a('0xb')](),controller[_0xd75a('0x10')]);router[_0xd75a('0x11')]('/',auth[_0xd75a('0xb')](),controller[_0xd75a('0x12')]);router['post'](_0xd75a('0xd'),auth[_0xd75a('0xb')](),controller[_0xd75a('0x13')]);router[_0xd75a('0x11')](_0xd75a('0x14'),auth[_0xd75a('0xb')](),interaction[_0xd75a('0x15')](_0xd75a('0x16'),_0xd75a('0x17')),controller[_0xd75a('0x18')]);router[_0xd75a('0x19')](_0xd75a('0x1a'),auth[_0xd75a('0xb')](),interaction[_0xd75a('0x15')](_0xd75a('0x16'),'mailinteraction:update'),controller[_0xd75a('0x1b')]);router['delete'](_0xd75a('0x1a'),auth['isAuthenticated'](),interaction[_0xd75a('0x15')]('mail',_0xd75a('0x1c')),controller[_0xd75a('0x1d')]);router[_0xd75a('0x1e')]('/:id/tags',auth[_0xd75a('0xb')](),controller['removeTags']);module[_0xd75a('0x1f')]=router; \ No newline at end of file +var _0x9619=['../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','tracked','mailinteraction:destroy','/:id/tags','removeTags','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x9619,0xd3));var _0x9961=function(_0x3e5752,_0x36e00a){_0x3e5752=_0x3e5752-0x0;var _0x2464fb=_0x9619[_0x3e5752];return _0x2464fb;};'use strict';var multer=require(_0x9961('0x0'));var util=require(_0x9961('0x1'));var path=require('path');var timeout=require(_0x9961('0x2'));var express=require('express');var router=express[_0x9961('0x3')]();var auth=require(_0x9961('0x4'));var interaction=require(_0x9961('0x5'));var config=require(_0x9961('0x6'));var controller=require(_0x9961('0x7'));router[_0x9961('0x8')]('/',auth[_0x9961('0x9')](),controller[_0x9961('0xa')]);router[_0x9961('0x8')](_0x9961('0xb'),auth[_0x9961('0x9')](),controller[_0x9961('0xc')]);router[_0x9961('0x8')](_0x9961('0xd'),auth[_0x9961('0x9')](),controller[_0x9961('0xe')]);router['get'](_0x9961('0xf'),auth[_0x9961('0x9')](),controller[_0x9961('0x10')]);router[_0x9961('0x8')](_0x9961('0x11'),auth[_0x9961('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x9961('0x12')]);router[_0x9961('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x9961('0x14')]);router[_0x9961('0x13')]('/:id/tags',auth[_0x9961('0x9')](),interaction['tracked'](_0x9961('0x15'),_0x9961('0x16')),controller[_0x9961('0x17')]);router[_0x9961('0x18')](_0x9961('0xd'),auth[_0x9961('0x9')](),interaction['tracked'](_0x9961('0x15'),_0x9961('0x19')),controller[_0x9961('0x1a')]);router['delete'](_0x9961('0xd'),auth[_0x9961('0x9')](),interaction[_0x9961('0x1b')](_0x9961('0x15'),_0x9961('0x1c')),controller['destroy']);router['delete'](_0x9961('0x1d'),auth[_0x9961('0x9')](),controller[_0x9961('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 42f057c..a0df0a9 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 _0x9613=['fromString','getDataValue','split','slice','join','sequelize','html-to-text','iconv','exports','BOOLEAN','DATE','STRING','long','ENUM','out'];(function(_0x51c591,_0x25cfd0){var _0xe8117b=function(_0x186fd6){while(--_0x186fd6){_0x51c591['push'](_0x51c591['shift']());}};_0xe8117b(++_0x25cfd0);}(_0x9613,0xd7));var _0x3961=function(_0x1eb8be,_0x530eec){_0x1eb8be=_0x1eb8be-0x0;var _0x18d983=_0x9613[_0x1eb8be];return _0x18d983;};'use strict';var Sequelize=require(_0x3961('0x0'));var htmlToText=require(_0x3961('0x1'));var iconv=require(_0x3961('0x2'));module[_0x3961('0x3')]={'closed':{'type':Sequelize[_0x3961('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3961('0x5')]},'disposition':{'type':Sequelize[_0x3961('0x6')]},'note':{'type':Sequelize[_0x3961('0x6')]},'inReplyTo':{'type':Sequelize[_0x3961('0x6')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x3961('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3961('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3961('0x5')]},'substatus':{'type':Sequelize[_0x3961('0x6')](0x3c)},'substatusAt':{'type':Sequelize[_0x3961('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x3961('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3961('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x3961('0x8')]('in',_0x3961('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x3961('0x7')),'get':function(){try{return this['getDataValue']('lastMsgBody')?htmlToText[_0x3961('0xa')](this[_0x3961('0xb')]('lastMsgBody'),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x3961('0xc')]('\x0a')[_0x3961('0xd')](0x0,0x6)[_0x3961('0xe')]('\x0a'):null;}catch(_0x276640){return null;}}}}; \ No newline at end of file +var _0x3f6d=['STRING','TEXT','ENUM','long','getDataValue','lastMsgBody','fromString','slice','join','sequelize','iconv','exports','DATE'];(function(_0x36fe77,_0x44c701){var _0x278fd5=function(_0x4377ac){while(--_0x4377ac){_0x36fe77['push'](_0x36fe77['shift']());}};_0x278fd5(++_0x44c701);}(_0x3f6d,0x1d0));var _0xd3f6=function(_0x378e3c,_0x3dc11a){_0x378e3c=_0x378e3c-0x0;var _0x855bee=_0x3f6d[_0x378e3c];return _0x855bee;};'use strict';var Sequelize=require(_0xd3f6('0x0'));var htmlToText=require('html-to-text');var iconv=require(_0xd3f6('0x1'));module[_0xd3f6('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd3f6('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xd3f6('0x4')](0x1fe)},'to':{'type':Sequelize[_0xd3f6('0x4')]},'cc':{'type':Sequelize[_0xd3f6('0x5')]('long')},'subject':{'type':Sequelize[_0xd3f6('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd3f6('0x3')]},'substatus':{'type':Sequelize[_0xd3f6('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xd3f6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd3f6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd3f6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd3f6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xd3f6('0x5')](_0xd3f6('0x7')),'get':function(){try{return this[_0xd3f6('0x8')](_0xd3f6('0x9'))?htmlToText[_0xd3f6('0xa')](this['getDataValue'](_0xd3f6('0x9')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})['split']('\x0a')[_0xd3f6('0xb')](0x0,0x6)[_0xd3f6('0xc')]('\x0a'):null;}catch(_0x5dd8d0){return null;}}}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 7cf8a23..eb74a96 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 _0x9c54=['omit','emit','mailInteractionTags:save','download','unix','toString','server','files','attachments','join','tmp','interaction-%s.zip','bcc','subject','Attachment','Attachments','length','mkdirSync','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','type','build','message%d.eml','log','err','html-pdf','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','map','VIRTUAL','field','filter','include','tag','push','Tag','Tags','distinct','read','MailMessage','Messages','direction','createdAt','count','includeAll','User','Contact','Owner','internal','MailAccount','Account','key','email','color','ThroughTags','MailInteraction','findAll','rows','catch','show','params','options','find','create','body','describe','addMessage','ids','getMessages','pick','MailInteractionId','$gte','split','format','addTags','setTags'];(function(_0x3cec45,_0x37d817){var _0x51d691=function(_0x2c671f){while(--_0x2c671f){_0x3cec45['push'](_0x3cec45['shift']());}};_0x51d691(++_0x37d817);}(_0x9c54,0x120));var _0x49c5=function(_0x4c4121,_0x3637f9){_0x4c4121=_0x4c4121-0x0;var _0x325bde=_0x9c54[_0x4c4121];return _0x325bde;};'use strict';var pdf=require(_0x49c5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x49c5('0x1'));var moment=require(_0x49c5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x49c5('0x3'));var util=require(_0x49c5('0x4'));var path=require(_0x49c5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x49c5('0x6'));var fs=require('fs');var _=require(_0x49c5('0x7'));var squel=require(_0x49c5('0x8'));var crypto=require(_0x49c5('0x9'));var jsforce=require(_0x49c5('0xa'));var deskjs=require(_0x49c5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x49c5('0xc'));var Papa=require(_0x49c5('0xd'));var authService=require(_0x49c5('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x49c5('0xf'));var logger=require('../../config/logger')(_0x49c5('0x10'));var utils=require(_0x49c5('0x11'));var config=require(_0x49c5('0x12'));var db=require(_0x49c5('0x13'))['db'];config['redis']=_[_0x49c5('0x14')](config[_0x49c5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c5('0x16'))(new Redis(config[_0x49c5('0x15')]));require('./mailInteraction.socket')[_0x49c5('0x17')](socket);function respondWithStatusCode(_0x5b4124,_0x35424c){_0x35424c=_0x35424c||0xcc;return function(_0x138840){if(_0x138840){return _0x5b4124[_0x49c5('0x18')](_0x35424c);}return _0x5b4124[_0x49c5('0x19')](_0x35424c)['end']();};}function respondWithResult(_0x361041,_0x406085){_0x406085=_0x406085||0xc8;return function(_0x3de2fc){if(_0x3de2fc){return _0x361041['status'](_0x406085)[_0x49c5('0x1a')](_0x3de2fc);}};}function respondWithFilteredResult(_0x148d20,_0x4e0479){return function(_0x445fc3){if(_0x445fc3){var _0x43826b=_0x445fc3['count'],_0x43f568=_0x4e0479[_0x49c5('0x1b')],_0x17b6e4=_0x4e0479[_0x49c5('0x1b')]+_0x4e0479[_0x49c5('0x1c')],_0x1700b0;if(_0x17b6e4>=_0x43826b){_0x17b6e4=_0x43826b;_0x1700b0=0xc8;}else{_0x1700b0=0xce;}_0x148d20['status'](_0x1700b0);return _0x148d20[_0x49c5('0x1d')](_0x49c5('0x1e'),_0x43f568+'-'+_0x17b6e4+'/'+_0x43826b)[_0x49c5('0x1a')](_0x445fc3);}return null;};}function patchUpdates(_0x2add64){return function(_0x4dedd3){try{jsonpatch['apply'](_0x4dedd3,_0x2add64,!![]);}catch(_0x181eed){return BPromise[_0x49c5('0x1f')](_0x181eed);}return _0x4dedd3[_0x49c5('0x20')]();};}function saveUpdates(_0x370717,_0x293c95){return function(_0x12d5ca){if(_0x12d5ca){return _0x12d5ca[_0x49c5('0x21')](_0x370717)[_0x49c5('0x22')](function(_0x525626){return _0x525626;});}return null;};}function removeEntity(_0x270fbc,_0x4eb5a9){return function(_0x37d70c){if(_0x37d70c){return _0x37d70c[_0x49c5('0x23')]()[_0x49c5('0x22')](function(){_0x270fbc[_0x49c5('0x19')](0xcc)[_0x49c5('0x24')]();});}};}function handleEntityNotFound(_0x59e7bc,_0x6f5f51){return function(_0x198870){if(!_0x198870){_0x59e7bc[_0x49c5('0x18')](0x194);}return _0x198870;};}function handleError(_0x589ce8,_0x3661fc){_0x3661fc=_0x3661fc||0x1f4;return function(_0x4f2dc7){logger[_0x49c5('0x25')](_0x4f2dc7['stack']);if(_0x4f2dc7[_0x49c5('0x26')]){delete _0x4f2dc7[_0x49c5('0x26')];}_0x589ce8[_0x49c5('0x19')](_0x3661fc)[_0x49c5('0x27')](_0x4f2dc7);};}exports['index']=function(_0x4589ed,_0x43302e){var _0x5e9611={},_0x4e5354={},_0x1f89a4={'count':0x0,'rows':[]};var _0x40716a=db['MailInteraction'][_0x49c5('0x28')];_0x4e5354[_0x49c5('0x29')]=_[_0x49c5('0x2a')](_0x40716a);_0x4e5354[_0x49c5('0x2b')]=_[_0x49c5('0x2a')](_0x4589ed['query']);_0x4e5354[_0x49c5('0x2c')]=_[_0x49c5('0x2d')](_0x4e5354['model'],_0x4e5354[_0x49c5('0x2b')]);_0x5e9611[_0x49c5('0x2e')]=_[_0x49c5('0x2d')](_0x4e5354[_0x49c5('0x29')],qs['fields'](_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x2f')]));_0x5e9611['attributes']=_0x5e9611['attributes']['length']?_0x5e9611[_0x49c5('0x2e')]:_0x4e5354[_0x49c5('0x29')];if(!_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x30')](_0x49c5('0x31'))){_0x5e9611[_0x49c5('0x1c')]=qs['limit'](_0x4589ed[_0x49c5('0x2b')]['limit']);_0x5e9611[_0x49c5('0x1b')]=qs[_0x49c5('0x1b')](_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x1b')]);}_0x5e9611[_0x49c5('0x32')]=qs[_0x49c5('0x33')](_0x4589ed['query'][_0x49c5('0x33')]);_0x5e9611['where']=qs['filters'](_['pick'](_0x4589ed[_0x49c5('0x2b')],_0x4e5354[_0x49c5('0x2c')]));if(_0x4589ed[_0x49c5('0x2b')]['filter']){_0x5e9611['where']=_[_0x49c5('0x34')](_0x5e9611[_0x49c5('0x35')],{'$or':_[_0x49c5('0x36')](_0x40716a,function(_0x598115){if(_0x598115['type']['key']!==_0x49c5('0x37')){var _0x524849={};_0x524849[_0x598115[_0x49c5('0x38')]]={'$like':'%'+_0x4589ed['query'][_0x49c5('0x39')]+'%'};return _0x524849;}})});}_0x5e9611=_['merge']({},_0x5e9611,_0x4589ed['options']);var _0x125016={'where':_0x5e9611['where']};_0x125016[_0x49c5('0x3a')]=[];if(_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x3b')]){_0x125016['include'][_0x49c5('0x3c')]({'model':db[_0x49c5('0x3d')],'as':_0x49c5('0x3e'),'attributes':['id'],'where':{'id':_0x4589ed['query'][_0x49c5('0x3b')]},'required':!![]});_0x125016[_0x49c5('0x3f')]=!![];}if(_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x40')]){_0x125016[_0x49c5('0x3a')][_0x49c5('0x3c')]({'model':db[_0x49c5('0x41')],'as':_0x49c5('0x42'),'attributes':['id',_0x49c5('0x43'),_0x49c5('0x44'),_0x49c5('0x40')],'where':{'direction':'in','read':_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x40')]||![]},'required':!![]});_0x125016[_0x49c5('0x3f')]=!![];}return db['MailInteraction']['count'](_0x125016)[_0x49c5('0x22')](function(_0x13ec1e){_0x1f89a4[_0x49c5('0x45')]=_0x13ec1e;if(_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x46')]){_0x5e9611[_0x49c5('0x3a')]=[{'model':db[_0x49c5('0x47')],'as':'Users','required':![],'attributes':['id',_0x49c5('0x26'),'fullname']},{'model':db['CmContact'],'as':_0x49c5('0x48'),'required':![]},{'model':db['User'],'as':_0x49c5('0x49'),'attributes':[_0x49c5('0x26'),'fullname',_0x49c5('0x4a')],'required':![]},{'model':db[_0x49c5('0x4b')],'as':_0x49c5('0x4c'),'attributes':[_0x49c5('0x26'),_0x49c5('0x4d'),_0x49c5('0x4e')],'required':![]},{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x49c5('0x43'),_0x49c5('0x44'),_0x49c5('0x40')],'where':{'direction':'in','read':_0x4589ed['query'][_0x49c5('0x40')]||![]},'required':_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x40')]||![]},{'model':db[_0x49c5('0x3d')],'as':_0x49c5('0x3e'),'attributes':['id','name',_0x49c5('0x4f')],'required':_0x4589ed['query'][_0x49c5('0x3b')]?!![]:![]},{'model':db[_0x49c5('0x3d')],'as':_0x49c5('0x50'),'attributes':['id',_0x49c5('0x26'),_0x49c5('0x4f')],'through':_0x4589ed[_0x49c5('0x2b')][_0x49c5('0x3b')]?{'attributes':[],'where':{'TagId':_0x4589ed['query'][_0x49c5('0x3b')]||undefined}}:{},'required':_0x4589ed[_0x49c5('0x2b')]['tag']?!![]:![]}];}return db[_0x49c5('0x51')][_0x49c5('0x52')](_0x5e9611);})[_0x49c5('0x22')](function(_0x1d4be6){_0x1f89a4[_0x49c5('0x53')]=_0x1d4be6;return _0x1f89a4;})[_0x49c5('0x22')](respondWithFilteredResult(_0x43302e,_0x5e9611))[_0x49c5('0x54')](handleError(_0x43302e,null));};exports[_0x49c5('0x55')]=function(_0x3a08ef,_0xe6b003){var _0x175f10={'raw':![],'where':{'id':_0x3a08ef[_0x49c5('0x56')]['id']}},_0x25118e={};_0x25118e['model']=_['keys'](db[_0x49c5('0x51')]['rawAttributes']);_0x25118e[_0x49c5('0x2b')]=_['keys'](_0x3a08ef['query']);_0x25118e[_0x49c5('0x2c')]=_[_0x49c5('0x2d')](_0x25118e[_0x49c5('0x29')],_0x25118e['query']);_0x175f10[_0x49c5('0x2e')]=_['intersection'](_0x25118e[_0x49c5('0x29')],qs[_0x49c5('0x2f')](_0x3a08ef[_0x49c5('0x2b')][_0x49c5('0x2f')]));_0x175f10[_0x49c5('0x2e')]=_0x175f10['attributes']['length']?_0x175f10[_0x49c5('0x2e')]:_0x25118e[_0x49c5('0x29')];if(_0x3a08ef[_0x49c5('0x2b')][_0x49c5('0x46')]){_0x175f10[_0x49c5('0x3a')]=[{'all':!![]}];}_0x175f10=_[_0x49c5('0x34')]({},_0x175f10,_0x3a08ef[_0x49c5('0x57')]);return db[_0x49c5('0x51')][_0x49c5('0x58')](_0x175f10)[_0x49c5('0x22')](handleEntityNotFound(_0xe6b003,null))['then'](respondWithResult(_0xe6b003,null))[_0x49c5('0x54')](handleError(_0xe6b003,null));};exports['create']=function(_0x542e5a,_0x25fc32){return db[_0x49c5('0x51')][_0x49c5('0x59')](_0x542e5a[_0x49c5('0x5a')],{})[_0x49c5('0x22')](respondWithResult(_0x25fc32,0xc9))[_0x49c5('0x54')](handleError(_0x25fc32,null));};exports['update']=function(_0x15c85a,_0x12ab63){if(_0x15c85a[_0x49c5('0x5a')]['id']){delete _0x15c85a[_0x49c5('0x5a')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x15c85a[_0x49c5('0x56')]['id']}})[_0x49c5('0x22')](handleEntityNotFound(_0x12ab63,null))['then'](saveUpdates(_0x15c85a[_0x49c5('0x5a')],null))[_0x49c5('0x22')](respondWithResult(_0x12ab63,null))['catch'](handleError(_0x12ab63,null));};exports[_0x49c5('0x23')]=function(_0x3f50a3,_0x3b3eea){return db['MailInteraction']['find']({'where':{'id':_0x3f50a3[_0x49c5('0x56')]['id']}})[_0x49c5('0x22')](handleEntityNotFound(_0x3b3eea,null))[_0x49c5('0x22')](removeEntity(_0x3b3eea,null))['catch'](handleError(_0x3b3eea,null));};exports[_0x49c5('0x5b')]=function(_0x23ee26,_0x5380c5){return db[_0x49c5('0x51')][_0x49c5('0x5b')]()[_0x49c5('0x22')](respondWithResult(_0x5380c5,null))[_0x49c5('0x54')](handleError(_0x5380c5,null));};exports[_0x49c5('0x5c')]=function(_0x45cb5d,_0x1504f8,_0x25af35){return db[_0x49c5('0x41')][_0x49c5('0x58')]({'where':{'id':_0x45cb5d[_0x49c5('0x56')]['id']}})[_0x49c5('0x22')](handleEntityNotFound(_0x1504f8,null))['then'](function(_0x51d428){if(_0x51d428){return _0x51d428[_0x49c5('0x5c')](_0x45cb5d[_0x49c5('0x5a')][_0x49c5('0x5d')],_['omit'](_0x45cb5d['body'],[_0x49c5('0x5d'),'id'])||{});}})[_0x49c5('0x22')](respondWithResult(_0x1504f8,null))[_0x49c5('0x54')](handleError(_0x1504f8,null));};exports[_0x49c5('0x5e')]=function(_0x11de6f,_0x27ceb7,_0x369f79){var _0xd37baa={'raw':![],'where':{}};var _0xd0cff6={};var _0xb6d883={'count':0x0,'rows':[]};return db[_0x49c5('0x51')]['findOne']({'where':{'id':_0x11de6f[_0x49c5('0x56')]['id']}})['then'](handleEntityNotFound(_0x27ceb7,null))[_0x49c5('0x22')](function(_0x32a2e2){if(_0x32a2e2){_0xd0cff6[_0x49c5('0x29')]=_[_0x49c5('0x2a')](db[_0x49c5('0x41')]['rawAttributes']);_0xd0cff6[_0x49c5('0x2b')]=_[_0x49c5('0x2a')](_0x11de6f[_0x49c5('0x2b')]);_0xd0cff6[_0x49c5('0x2c')]=_[_0x49c5('0x2d')](_0xd0cff6[_0x49c5('0x29')],_0xd0cff6['query']);_0xd37baa[_0x49c5('0x2e')]=_[_0x49c5('0x2d')](_0xd0cff6[_0x49c5('0x29')],qs['fields'](_0x11de6f['query'][_0x49c5('0x2f')]));_0xd37baa['attributes']=_0xd37baa[_0x49c5('0x2e')]['length']?_0xd37baa[_0x49c5('0x2e')]:_0xd0cff6[_0x49c5('0x29')];if(!_0x11de6f['query'][_0x49c5('0x30')](_0x49c5('0x31'))){_0xd37baa[_0x49c5('0x1c')]=qs[_0x49c5('0x1c')](_0x11de6f['query'][_0x49c5('0x1c')]);_0xd37baa[_0x49c5('0x1b')]=qs['offset'](_0x11de6f['query'][_0x49c5('0x1b')]);}_0xd37baa[_0x49c5('0x32')]=qs[_0x49c5('0x33')](_0x11de6f[_0x49c5('0x2b')][_0x49c5('0x33')]);_0xd37baa[_0x49c5('0x35')]=qs[_0x49c5('0x2c')](_[_0x49c5('0x5f')](_0x11de6f[_0x49c5('0x2b')],_0xd0cff6[_0x49c5('0x2c')]));_0xd37baa['where'][_0x49c5('0x60')]=_0x32a2e2['id'];if(_0x11de6f['query'][_0x49c5('0x39')]){_0xd37baa[_0x49c5('0x35')]=_[_0x49c5('0x34')](_0xd37baa[_0x49c5('0x35')],{'$or':_[_0x49c5('0x36')](_0xd37baa[_0x49c5('0x2e')],function(_0x426852){var _0x5c00f8={};_0x5c00f8[_0x426852]={'$like':'%'+_0x11de6f[_0x49c5('0x2b')][_0x49c5('0x39')]+'%'};return _0x5c00f8;})});}if(_0x11de6f[_0x49c5('0x2b')]['$gte']){var _0x47a55f=_0x11de6f[_0x49c5('0x2b')][_0x49c5('0x61')][_0x49c5('0x62')](',');var _0x933d6b={};_0x933d6b[_0x47a55f[0x0]]={'$gte':moment(_0x47a55f[0x1])[_0x49c5('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd37baa[_0x49c5('0x35')]=_[_0x49c5('0x34')](_0xd37baa[_0x49c5('0x35')],_0x933d6b);}_0xd37baa=_['merge']({},_0xd37baa,_0x11de6f[_0x49c5('0x57')]);return db[_0x49c5('0x41')][_0x49c5('0x45')]({'where':_0xd37baa[_0x49c5('0x35')]})[_0x49c5('0x22')](function(_0x33f5ca){_0xb6d883[_0x49c5('0x45')]=_0x33f5ca;if(_0x11de6f[_0x49c5('0x2b')][_0x49c5('0x46')]){_0xd37baa[_0x49c5('0x3a')]=[{'all':!![]}];}return db['MailMessage'][_0x49c5('0x52')](_0xd37baa);})[_0x49c5('0x22')](function(_0x2efc00){_0xb6d883['rows']=_0x2efc00;return _0xb6d883;});}})[_0x49c5('0x22')](respondWithFilteredResult(_0x27ceb7,_0xd37baa))[_0x49c5('0x54')](handleError(_0x27ceb7,null));};exports[_0x49c5('0x64')]=function(_0x1ffb30,_0x35faf0,_0x52bcd0){return db[_0x49c5('0x51')][_0x49c5('0x58')]({'where':{'id':_0x1ffb30[_0x49c5('0x56')]['id']}})[_0x49c5('0x22')](handleEntityNotFound(_0x35faf0,null))[_0x49c5('0x22')](function(_0x1aae26){if(_0x1aae26){return _0x1aae26[_0x49c5('0x65')](_0x1ffb30[_0x49c5('0x5a')][_0x49c5('0x5d')],_[_0x49c5('0x66')](_0x1ffb30[_0x49c5('0x5a')],[_0x49c5('0x5d'),'id'])||{})['spread'](function(){return db[_0x49c5('0x3d')][_0x49c5('0x52')]({'attributes':['id',_0x49c5('0x26'),_0x49c5('0x4f')],'where':{'id':_0x1ffb30[_0x49c5('0x5a')][_0x49c5('0x5d')]}});})['then'](function(_0x2cb4fb){socket[_0x49c5('0x67')](_0x49c5('0x68'),{'id':Number(_0x1ffb30[_0x49c5('0x56')]['id']),'tags':_0x2cb4fb||[]});return{'id':Number(_0x1ffb30[_0x49c5('0x56')]['id']),'tags':_0x2cb4fb||[]};});}})[_0x49c5('0x22')](respondWithResult(_0x35faf0,null))[_0x49c5('0x54')](handleError(_0x35faf0,null));};exports['removeTags']=function(_0x4903a6,_0x2785d6,_0x2bd16a){var _0x35741f;return db[_0x49c5('0x51')][_0x49c5('0x58')]({'where':{'id':_0x4903a6[_0x49c5('0x56')]['id']}})[_0x49c5('0x22')](handleEntityNotFound(_0x2785d6,null))['then'](function(_0x54abee){if(_0x54abee){return _0x54abee['removeTags'](_0x4903a6[_0x49c5('0x2b')][_0x49c5('0x5d')]);}})[_0x49c5('0x22')](respondWithStatusCode(_0x2785d6,null))[_0x49c5('0x54')](handleError(_0x2785d6,null));};exports[_0x49c5('0x69')]=function(_0x3f2999,_0x281b9c){var _0x76ed06=moment()[_0x49c5('0x6a')]()[_0x49c5('0x6b')]();var _0x2f6f7a=path['join'](config['root'],_0x49c5('0x6c'),_0x49c5('0x6d'),_0x49c5('0x6e'));var _0x58b1ba=path[_0x49c5('0x6f')](config['root'],_0x49c5('0x6c'),'files',_0x49c5('0x70'));var _0xad5385=path['join'](_0x58b1ba,_0x76ed06);var _0x4ad7a8=util['format'](_0x49c5('0x71'),_0x76ed06);var _0x1147c5=path[_0x49c5('0x6f')](_0x58b1ba,_0x4ad7a8);var _0x4eb484=![];return db[_0x49c5('0x51')]['find']({'where':{'id':_0x3f2999['params']['id']}})['then'](handleEntityNotFound(_0x281b9c,null))[_0x49c5('0x22')](function(_0x4544e4){if(_0x4544e4){return _0x4544e4[_0x49c5('0x5e')]({'attributes':['id',_0x49c5('0x5a'),'from','to','cc',_0x49c5('0x72'),_0x49c5('0x73'),_0x49c5('0x44')],'where':{'secret':![]},'include':_0x3f2999[_0x49c5('0x2b')]['attachments']?[{'model':db[_0x49c5('0x74')],'as':_0x49c5('0x75')}]:undefined,'order':qs['sort']('id')});}return[];})[_0x49c5('0x22')](function(_0x2a1581){_0x4eb484=_0x2a1581['length'];if(_0x2a1581[_0x49c5('0x76')]){fs[_0x49c5('0x77')](_0xad5385);return BPromise['each'](_0x2a1581,function(_0x183ba3,_0x2473ab){var _0x44da93=_0x183ba3;var _0x4674bd={'from':_0x44da93[_0x49c5('0x78')],'to':_0x44da93['to'],'subject':_0x44da93[_0x49c5('0x73')],'html':_0x44da93[_0x49c5('0x5a')],'headers':{'Date':moment(_0x44da93[_0x49c5('0x44')])[_0x49c5('0x63')](_0x49c5('0x79'))},'attachments':[]};if(_0x183ba3['cc']){_0x4674bd[_0x49c5('0x7a')]['Cc']=_0x183ba3['cc'];}if(_0x183ba3[_0x49c5('0x72')]){_0x4674bd[_0x49c5('0x7a')]['Bcc']=_0x183ba3[_0x49c5('0x72')];}return new BPromise(function(_0x4da891,_0x550819){if(_0x183ba3[_0x49c5('0x75')]){for(var _0x31f3d0=0x0;_0x31f3d0<_0x183ba3[_0x49c5('0x75')][_0x49c5('0x76')];_0x31f3d0++){var _0x509ffc=_0x183ba3[_0x49c5('0x75')][_0x31f3d0];var _0x379730=path[_0x49c5('0x6f')](_0x2f6f7a,_0x509ffc[_0x49c5('0x7b')]);if(fs[_0x49c5('0x7c')](_0x379730)){_0x4674bd[_0x49c5('0x6e')][_0x49c5('0x3c')]({'name':_0x509ffc[_0x49c5('0x26')],'contentType':_0x509ffc[_0x49c5('0x7d')],'data':fs['readFileSync'](_0x379730)});}}}emlformat[_0x49c5('0x7e')](_0x4674bd,function(_0x5b6055,_0x4fa358){if(_0x5b6055)return _0x550819(_0x5b6055);fs['writeFileSync'](path[_0x49c5('0x6f')](_0xad5385,util[_0x49c5('0x63')](_0x49c5('0x7f'),_0x2473ab)),_0x4fa358);return _0x4da891(_0x4fa358);});});});}})['then'](function(){if(_0x4eb484){return new BPromise(function(_0x4d3c3d,_0x56d92c){zipdir(_0xad5385,{'saveTo':_0x1147c5},function(_0x1ed602,_0x49c06a){if(_0x1ed602)return _0x56d92c(_0x1ed602);return _0x4d3c3d(_0x49c06a);});});}})[_0x49c5('0x22')](function(){if(_0x4eb484){return new BPromise(function(_0x3c2e93,_0x4f643e){rimraf(_0xad5385,function(_0x2eda21){if(_0x2eda21)_0x4f643e(_0x2eda21);return _0x3c2e93();});});}})['then'](function(){if(_0x4eb484){return _0x281b9c[_0x49c5('0x69')](_0x1147c5,_0x4ad7a8,function(_0xc872b0){if(_0xc872b0){console[_0x49c5('0x80')](_0x49c5('0x81'),_0xc872b0);}else{fs['unlinkSync'](_0x1147c5);}});}else{return _0x281b9c[_0x49c5('0x18')](0xc8);}})[_0x49c5('0x54')](handleError(_0x281b9c,null));}; \ No newline at end of file +var _0xa5d4=['getMessages','order','MailInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','attachments','join','tmp','format','interaction-%s.zip','from','bcc','subject','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','readFileSync','build','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','redis','./mailInteraction.socket','register','sendStatus','end','status','json','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','index','MailInteraction','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','tag','include','push','Tags','distinct','createdAt','read','count','includeAll','User','Users','fullname','CmContact','Contact','Owner','MailAccount','MailMessage','Tag','color','ThroughTags','findAll','rows','show','params','options','find','catch','create','body','describe','addMessage','ids','omit'];(function(_0x5e201c,_0x4b9fb2){var _0x2190d8=function(_0x40108d){while(--_0x40108d){_0x5e201c['push'](_0x5e201c['shift']());}};_0x2190d8(++_0x4b9fb2);}(_0xa5d4,0x135));var _0x4a5d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa5d4[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x4a5d('0x0'));var emlformat=require(_0x4a5d('0x1'));var rimraf=require(_0x4a5d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a5d('0x3'));var rp=require(_0x4a5d('0x4'));var moment=require(_0x4a5d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4a5d('0x6'));var util=require(_0x4a5d('0x7'));var path=require(_0x4a5d('0x8'));var sox=require(_0x4a5d('0x9'));var csv=require('to-csv');var ejs=require(_0x4a5d('0xa'));var fs=require('fs');var _=require(_0x4a5d('0xb'));var squel=require(_0x4a5d('0xc'));var crypto=require(_0x4a5d('0xd'));var jsforce=require(_0x4a5d('0xe'));var deskjs=require(_0x4a5d('0xf'));var toCsv=require(_0x4a5d('0x10'));var querystring=require(_0x4a5d('0x11'));var Papa=require(_0x4a5d('0x12'));var authService=require(_0x4a5d('0x13'));var hardwareService=require(_0x4a5d('0x14'));var Redis=require(_0x4a5d('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0x4a5d('0x16'))(_0x4a5d('0x17'));var utils=require('../../config/utils');var config=require(_0x4a5d('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a5d('0x19')]));require(_0x4a5d('0x1a'))[_0x4a5d('0x1b')](socket);function respondWithStatusCode(_0x5a00ff,_0x64be){_0x64be=_0x64be||0xcc;return function(_0x3619fd){if(_0x3619fd){return _0x5a00ff[_0x4a5d('0x1c')](_0x64be);}return _0x5a00ff['status'](_0x64be)[_0x4a5d('0x1d')]();};}function respondWithResult(_0x26ed4e,_0x5ce7d3){_0x5ce7d3=_0x5ce7d3||0xc8;return function(_0x394326){if(_0x394326){return _0x26ed4e[_0x4a5d('0x1e')](_0x5ce7d3)[_0x4a5d('0x1f')](_0x394326);}};}function respondWithFilteredResult(_0xb38349,_0xd2e831){return function(_0x525a72){if(_0x525a72){var _0x23d578=_0x525a72['count'],_0x3f46ba=_0xd2e831[_0x4a5d('0x20')],_0x5019a7=_0xd2e831[_0x4a5d('0x20')]+_0xd2e831['limit'],_0x24cd54;if(_0x5019a7>=_0x23d578){_0x5019a7=_0x23d578;_0x24cd54=0xc8;}else{_0x24cd54=0xce;}_0xb38349[_0x4a5d('0x1e')](_0x24cd54);return _0xb38349[_0x4a5d('0x21')](_0x4a5d('0x22'),_0x3f46ba+'-'+_0x5019a7+'/'+_0x23d578)[_0x4a5d('0x1f')](_0x525a72);}return null;};}function patchUpdates(_0x5885ff){return function(_0x654609){try{jsonpatch[_0x4a5d('0x23')](_0x654609,_0x5885ff,!![]);}catch(_0x338045){return BPromise['reject'](_0x338045);}return _0x654609[_0x4a5d('0x24')]();};}function saveUpdates(_0x15db10,_0x275be1){return function(_0x26e09b){if(_0x26e09b){return _0x26e09b[_0x4a5d('0x25')](_0x15db10)[_0x4a5d('0x26')](function(_0x10cd31){return _0x10cd31;});}return null;};}function removeEntity(_0x34f687,_0x334697){return function(_0xf49051){if(_0xf49051){return _0xf49051[_0x4a5d('0x27')]()[_0x4a5d('0x26')](function(){_0x34f687['status'](0xcc)[_0x4a5d('0x1d')]();});}};}function handleEntityNotFound(_0x203a20,_0x555add){return function(_0x2451c5){if(!_0x2451c5){_0x203a20[_0x4a5d('0x1c')](0x194);}return _0x2451c5;};}function handleError(_0x1827e6,_0xc9d984){_0xc9d984=_0xc9d984||0x1f4;return function(_0x27f4f4){logger['error'](_0x27f4f4[_0x4a5d('0x28')]);if(_0x27f4f4['name']){delete _0x27f4f4[_0x4a5d('0x29')];}_0x1827e6[_0x4a5d('0x1e')](_0xc9d984)['send'](_0x27f4f4);};}exports[_0x4a5d('0x2a')]=function(_0x3d8dd0,_0x27fc4c){var _0x2bc95f={},_0x4cfbd9={},_0x75ab00={'count':0x0,'rows':[]};var _0x330192=db[_0x4a5d('0x2b')][_0x4a5d('0x2c')];_0x4cfbd9[_0x4a5d('0x2d')]=_[_0x4a5d('0x2e')](_0x330192);_0x4cfbd9[_0x4a5d('0x2f')]=_[_0x4a5d('0x2e')](_0x3d8dd0[_0x4a5d('0x2f')]);_0x4cfbd9[_0x4a5d('0x30')]=_['intersection'](_0x4cfbd9[_0x4a5d('0x2d')],_0x4cfbd9['query']);_0x2bc95f[_0x4a5d('0x31')]=_[_0x4a5d('0x32')](_0x4cfbd9[_0x4a5d('0x2d')],qs[_0x4a5d('0x33')](_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x33')]));_0x2bc95f[_0x4a5d('0x31')]=_0x2bc95f[_0x4a5d('0x31')][_0x4a5d('0x34')]?_0x2bc95f[_0x4a5d('0x31')]:_0x4cfbd9[_0x4a5d('0x2d')];if(!_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x35')](_0x4a5d('0x36'))){_0x2bc95f[_0x4a5d('0x37')]=qs['limit'](_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x37')]);_0x2bc95f[_0x4a5d('0x20')]=qs['offset'](_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x20')]);}_0x2bc95f['order']=qs[_0x4a5d('0x38')](_0x3d8dd0['query']['sort']);_0x2bc95f[_0x4a5d('0x39')]=qs[_0x4a5d('0x30')](_[_0x4a5d('0x3a')](_0x3d8dd0[_0x4a5d('0x2f')],_0x4cfbd9[_0x4a5d('0x30')]));if(_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x3b')]){_0x2bc95f[_0x4a5d('0x39')]=_[_0x4a5d('0x3c')](_0x2bc95f['where'],{'$or':_[_0x4a5d('0x3d')](_0x330192,function(_0x1534dc){if(_0x1534dc[_0x4a5d('0x3e')][_0x4a5d('0x3f')]!==_0x4a5d('0x40')){var _0x259fda={};_0x259fda[_0x1534dc[_0x4a5d('0x41')]]={'$like':'%'+_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x3b')]+'%'};return _0x259fda;}})});}_0x2bc95f=_[_0x4a5d('0x3c')]({},_0x2bc95f,_0x3d8dd0['options']);var _0x399506={'where':_0x2bc95f['where']};_0x399506['include']=[];if(_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x42')]){_0x399506[_0x4a5d('0x43')][_0x4a5d('0x44')]({'model':db['Tag'],'as':_0x4a5d('0x45'),'attributes':['id'],'where':{'id':_0x3d8dd0[_0x4a5d('0x2f')]['tag']},'required':!![]});_0x399506[_0x4a5d('0x46')]=!![];}if(_0x3d8dd0[_0x4a5d('0x2f')]['read']){_0x399506[_0x4a5d('0x43')][_0x4a5d('0x44')]({'model':db['MailMessage'],'as':'Messages','attributes':['id','direction',_0x4a5d('0x47'),_0x4a5d('0x48')],'where':{'direction':'in','read':_0x3d8dd0[_0x4a5d('0x2f')]['read']||![]},'required':!![]});_0x399506['distinct']=!![];}return db[_0x4a5d('0x2b')][_0x4a5d('0x49')](_0x399506)[_0x4a5d('0x26')](function(_0x7c6ed7){_0x75ab00[_0x4a5d('0x49')]=_0x7c6ed7;if(_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x4a')]){_0x2bc95f[_0x4a5d('0x43')]=[{'model':db[_0x4a5d('0x4b')],'as':_0x4a5d('0x4c'),'required':![],'attributes':['id',_0x4a5d('0x29'),_0x4a5d('0x4d')]},{'model':db[_0x4a5d('0x4e')],'as':_0x4a5d('0x4f'),'required':![]},{'model':db['User'],'as':_0x4a5d('0x50'),'attributes':['name',_0x4a5d('0x4d'),'internal'],'required':![]},{'model':db[_0x4a5d('0x51')],'as':'Account','attributes':[_0x4a5d('0x29'),_0x4a5d('0x3f'),'email'],'required':![]},{'model':db[_0x4a5d('0x52')],'as':'Messages','attributes':['id','direction','createdAt',_0x4a5d('0x48')],'where':{'direction':'in','read':_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x48')]||![]},'required':_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x48')]||![]},{'model':db[_0x4a5d('0x53')],'as':_0x4a5d('0x45'),'attributes':['id',_0x4a5d('0x29'),_0x4a5d('0x54')],'required':_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x42')]?!![]:![]},{'model':db[_0x4a5d('0x53')],'as':_0x4a5d('0x55'),'attributes':['id',_0x4a5d('0x29'),_0x4a5d('0x54')],'through':_0x3d8dd0['query']['tag']?{'attributes':[],'where':{'TagId':_0x3d8dd0[_0x4a5d('0x2f')][_0x4a5d('0x42')]||undefined}}:{},'required':_0x3d8dd0[_0x4a5d('0x2f')]['tag']?!![]:![]}];}return db[_0x4a5d('0x2b')][_0x4a5d('0x56')](_0x2bc95f);})[_0x4a5d('0x26')](function(_0x5d27fe){_0x75ab00[_0x4a5d('0x57')]=_0x5d27fe;return _0x75ab00;})[_0x4a5d('0x26')](respondWithFilteredResult(_0x27fc4c,_0x2bc95f))['catch'](handleError(_0x27fc4c,null));};exports[_0x4a5d('0x58')]=function(_0x4c788a,_0x3a31e1){var _0x299cf8={'raw':![],'where':{'id':_0x4c788a[_0x4a5d('0x59')]['id']}},_0x165ed6={};_0x165ed6['model']=_[_0x4a5d('0x2e')](db[_0x4a5d('0x2b')][_0x4a5d('0x2c')]);_0x165ed6[_0x4a5d('0x2f')]=_['keys'](_0x4c788a['query']);_0x165ed6['filters']=_[_0x4a5d('0x32')](_0x165ed6[_0x4a5d('0x2d')],_0x165ed6[_0x4a5d('0x2f')]);_0x299cf8['attributes']=_[_0x4a5d('0x32')](_0x165ed6[_0x4a5d('0x2d')],qs[_0x4a5d('0x33')](_0x4c788a[_0x4a5d('0x2f')][_0x4a5d('0x33')]));_0x299cf8[_0x4a5d('0x31')]=_0x299cf8[_0x4a5d('0x31')][_0x4a5d('0x34')]?_0x299cf8[_0x4a5d('0x31')]:_0x165ed6['model'];if(_0x4c788a[_0x4a5d('0x2f')][_0x4a5d('0x4a')]){_0x299cf8[_0x4a5d('0x43')]=[{'all':!![]}];}_0x299cf8=_[_0x4a5d('0x3c')]({},_0x299cf8,_0x4c788a[_0x4a5d('0x5a')]);return db[_0x4a5d('0x2b')][_0x4a5d('0x5b')](_0x299cf8)[_0x4a5d('0x26')](handleEntityNotFound(_0x3a31e1,null))[_0x4a5d('0x26')](respondWithResult(_0x3a31e1,null))[_0x4a5d('0x5c')](handleError(_0x3a31e1,null));};exports[_0x4a5d('0x5d')]=function(_0x4a886e,_0xf711a){return db[_0x4a5d('0x2b')]['create'](_0x4a886e[_0x4a5d('0x5e')],{})[_0x4a5d('0x26')](respondWithResult(_0xf711a,0xc9))[_0x4a5d('0x5c')](handleError(_0xf711a,null));};exports[_0x4a5d('0x25')]=function(_0x2fe0ba,_0x2c5583){if(_0x2fe0ba[_0x4a5d('0x5e')]['id']){delete _0x2fe0ba[_0x4a5d('0x5e')]['id'];}return db['MailInteraction'][_0x4a5d('0x5b')]({'where':{'id':_0x2fe0ba[_0x4a5d('0x59')]['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x2c5583,null))[_0x4a5d('0x26')](saveUpdates(_0x2fe0ba['body'],null))['then'](respondWithResult(_0x2c5583,null))[_0x4a5d('0x5c')](handleError(_0x2c5583,null));};exports[_0x4a5d('0x27')]=function(_0x3a9d86,_0x393219){return db[_0x4a5d('0x2b')][_0x4a5d('0x5b')]({'where':{'id':_0x3a9d86[_0x4a5d('0x59')]['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x393219,null))[_0x4a5d('0x26')](removeEntity(_0x393219,null))[_0x4a5d('0x5c')](handleError(_0x393219,null));};exports[_0x4a5d('0x5f')]=function(_0xe4a2af,_0x4a5bae){return db['MailInteraction'][_0x4a5d('0x5f')]()[_0x4a5d('0x26')](respondWithResult(_0x4a5bae,null))[_0x4a5d('0x5c')](handleError(_0x4a5bae,null));};exports[_0x4a5d('0x60')]=function(_0x343b0c,_0x1f8cd3,_0x5044f5){return db[_0x4a5d('0x52')]['find']({'where':{'id':_0x343b0c[_0x4a5d('0x59')]['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x1f8cd3,null))[_0x4a5d('0x26')](function(_0x2c7f97){if(_0x2c7f97){return _0x2c7f97['addMessage'](_0x343b0c[_0x4a5d('0x5e')][_0x4a5d('0x61')],_[_0x4a5d('0x62')](_0x343b0c[_0x4a5d('0x5e')],[_0x4a5d('0x61'),'id'])||{});}})['then'](respondWithResult(_0x1f8cd3,null))[_0x4a5d('0x5c')](handleError(_0x1f8cd3,null));};exports[_0x4a5d('0x63')]=function(_0x5a1f00,_0x468f06,_0x5861f8){var _0x3c544f={'raw':![],'where':{}};var _0x538a46={};var _0x15fb9f={'count':0x0,'rows':[]};return db[_0x4a5d('0x2b')]['findOne']({'where':{'id':_0x5a1f00['params']['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x468f06,null))[_0x4a5d('0x26')](function(_0x3a4e5f){if(_0x3a4e5f){_0x538a46['model']=_[_0x4a5d('0x2e')](db[_0x4a5d('0x52')]['rawAttributes']);_0x538a46[_0x4a5d('0x2f')]=_[_0x4a5d('0x2e')](_0x5a1f00[_0x4a5d('0x2f')]);_0x538a46[_0x4a5d('0x30')]=_[_0x4a5d('0x32')](_0x538a46[_0x4a5d('0x2d')],_0x538a46[_0x4a5d('0x2f')]);_0x3c544f[_0x4a5d('0x31')]=_[_0x4a5d('0x32')](_0x538a46[_0x4a5d('0x2d')],qs[_0x4a5d('0x33')](_0x5a1f00['query'][_0x4a5d('0x33')]));_0x3c544f[_0x4a5d('0x31')]=_0x3c544f[_0x4a5d('0x31')][_0x4a5d('0x34')]?_0x3c544f[_0x4a5d('0x31')]:_0x538a46[_0x4a5d('0x2d')];if(!_0x5a1f00[_0x4a5d('0x2f')][_0x4a5d('0x35')](_0x4a5d('0x36'))){_0x3c544f[_0x4a5d('0x37')]=qs[_0x4a5d('0x37')](_0x5a1f00[_0x4a5d('0x2f')][_0x4a5d('0x37')]);_0x3c544f['offset']=qs[_0x4a5d('0x20')](_0x5a1f00[_0x4a5d('0x2f')]['offset']);}_0x3c544f[_0x4a5d('0x64')]=qs[_0x4a5d('0x38')](_0x5a1f00['query']['sort']);_0x3c544f['where']=qs[_0x4a5d('0x30')](_[_0x4a5d('0x3a')](_0x5a1f00[_0x4a5d('0x2f')],_0x538a46[_0x4a5d('0x30')]));_0x3c544f['where'][_0x4a5d('0x65')]=_0x3a4e5f['id'];if(_0x5a1f00['query'][_0x4a5d('0x3b')]){_0x3c544f['where']=_[_0x4a5d('0x3c')](_0x3c544f[_0x4a5d('0x39')],{'$or':_[_0x4a5d('0x3d')](_0x3c544f['attributes'],function(_0x5906d6){var _0x1db94a={};_0x1db94a[_0x5906d6]={'$like':'%'+_0x5a1f00['query'][_0x4a5d('0x3b')]+'%'};return _0x1db94a;})});}if(_0x5a1f00[_0x4a5d('0x2f')]['$gte']){var _0x1a27d9=_0x5a1f00[_0x4a5d('0x2f')][_0x4a5d('0x66')][_0x4a5d('0x67')](',');var _0x8e9681={};_0x8e9681[_0x1a27d9[0x0]]={'$gte':moment(_0x1a27d9[0x1])['format'](_0x4a5d('0x68'))};_0x3c544f[_0x4a5d('0x39')]=_['merge'](_0x3c544f[_0x4a5d('0x39')],_0x8e9681);}_0x3c544f=_[_0x4a5d('0x3c')]({},_0x3c544f,_0x5a1f00[_0x4a5d('0x5a')]);return db[_0x4a5d('0x52')][_0x4a5d('0x49')]({'where':_0x3c544f[_0x4a5d('0x39')]})[_0x4a5d('0x26')](function(_0x28005a){_0x15fb9f[_0x4a5d('0x49')]=_0x28005a;if(_0x5a1f00[_0x4a5d('0x2f')]['includeAll']){_0x3c544f[_0x4a5d('0x43')]=[{'all':!![]}];}return db[_0x4a5d('0x52')][_0x4a5d('0x56')](_0x3c544f);})[_0x4a5d('0x26')](function(_0x1d8ece){_0x15fb9f[_0x4a5d('0x57')]=_0x1d8ece;return _0x15fb9f;});}})[_0x4a5d('0x26')](respondWithFilteredResult(_0x468f06,_0x3c544f))[_0x4a5d('0x5c')](handleError(_0x468f06,null));};exports[_0x4a5d('0x69')]=function(_0x4d2336,_0x2b335b,_0x28bd74){return db[_0x4a5d('0x2b')][_0x4a5d('0x5b')]({'where':{'id':_0x4d2336[_0x4a5d('0x59')]['id']}})['then'](handleEntityNotFound(_0x2b335b,null))['then'](function(_0x31a05e){if(_0x31a05e){return _0x31a05e[_0x4a5d('0x6a')](_0x4d2336[_0x4a5d('0x5e')]['ids'],_[_0x4a5d('0x62')](_0x4d2336['body'],[_0x4a5d('0x61'),'id'])||{})[_0x4a5d('0x6b')](function(){return db[_0x4a5d('0x53')][_0x4a5d('0x56')]({'attributes':['id',_0x4a5d('0x29'),_0x4a5d('0x54')],'where':{'id':_0x4d2336[_0x4a5d('0x5e')]['ids']}});})['then'](function(_0x2da1ae){socket[_0x4a5d('0x6c')](_0x4a5d('0x6d'),{'id':Number(_0x4d2336['params']['id']),'tags':_0x2da1ae||[]});return{'id':Number(_0x4d2336[_0x4a5d('0x59')]['id']),'tags':_0x2da1ae||[]};});}})[_0x4a5d('0x26')](respondWithResult(_0x2b335b,null))[_0x4a5d('0x5c')](handleError(_0x2b335b,null));};exports[_0x4a5d('0x6e')]=function(_0xeedf09,_0x59db97,_0x27ed85){var _0x3288ab;return db['MailInteraction']['find']({'where':{'id':_0xeedf09[_0x4a5d('0x59')]['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x59db97,null))['then'](function(_0x7fcb56){if(_0x7fcb56){return _0x7fcb56[_0x4a5d('0x6e')](_0xeedf09[_0x4a5d('0x2f')][_0x4a5d('0x61')]);}})[_0x4a5d('0x26')](respondWithStatusCode(_0x59db97,null))[_0x4a5d('0x5c')](handleError(_0x59db97,null));};exports[_0x4a5d('0x6f')]=function(_0x20db71,_0x413e85){var _0x1ac17a=moment()[_0x4a5d('0x70')]()[_0x4a5d('0x71')]();var _0xf250d9=path['join'](config[_0x4a5d('0x72')],_0x4a5d('0x73'),_0x4a5d('0x74'),_0x4a5d('0x75'));var _0x1057aa=path[_0x4a5d('0x76')](config['root'],_0x4a5d('0x73'),_0x4a5d('0x74'),_0x4a5d('0x77'));var _0x2fda89=path['join'](_0x1057aa,_0x1ac17a);var _0x1f9545=util[_0x4a5d('0x78')](_0x4a5d('0x79'),_0x1ac17a);var _0x43fa9e=path[_0x4a5d('0x76')](_0x1057aa,_0x1f9545);var _0x2a8367=![];return db[_0x4a5d('0x2b')]['find']({'where':{'id':_0x20db71[_0x4a5d('0x59')]['id']}})[_0x4a5d('0x26')](handleEntityNotFound(_0x413e85,null))[_0x4a5d('0x26')](function(_0x4770d0){if(_0x4770d0){return _0x4770d0[_0x4a5d('0x63')]({'attributes':['id',_0x4a5d('0x5e'),_0x4a5d('0x7a'),'to','cc',_0x4a5d('0x7b'),_0x4a5d('0x7c'),_0x4a5d('0x47')],'where':{'secret':![]},'include':_0x20db71[_0x4a5d('0x2f')][_0x4a5d('0x75')]?[{'model':db[_0x4a5d('0x7d')],'as':'Attachments'}]:undefined,'order':qs[_0x4a5d('0x38')]('id')});}return[];})[_0x4a5d('0x26')](function(_0x48efb4){_0x2a8367=_0x48efb4[_0x4a5d('0x34')];if(_0x48efb4['length']){fs['mkdirSync'](_0x2fda89);return BPromise['each'](_0x48efb4,function(_0x25cf29,_0x3581d0){var _0x2156e2=_0x25cf29;var _0x3924e6={'from':_0x2156e2[_0x4a5d('0x7a')],'to':_0x2156e2['to'],'subject':_0x2156e2[_0x4a5d('0x7c')],'html':_0x2156e2[_0x4a5d('0x5e')],'headers':{'Date':moment(_0x2156e2['createdAt'])[_0x4a5d('0x78')](_0x4a5d('0x7e'))},'attachments':[]};if(_0x25cf29['cc']){_0x3924e6[_0x4a5d('0x7f')]['Cc']=_0x25cf29['cc'];}if(_0x25cf29['bcc']){_0x3924e6[_0x4a5d('0x7f')][_0x4a5d('0x80')]=_0x25cf29['bcc'];}return new BPromise(function(_0x4dbb6e,_0x597e8b){if(_0x25cf29[_0x4a5d('0x81')]){for(var _0x100b19=0x0;_0x100b19<_0x25cf29[_0x4a5d('0x81')][_0x4a5d('0x34')];_0x100b19++){var _0x45994c=_0x25cf29[_0x4a5d('0x81')][_0x100b19];var _0x3cabb1=path[_0x4a5d('0x76')](_0xf250d9,_0x45994c[_0x4a5d('0x82')]);if(fs['existsSync'](_0x3cabb1)){_0x3924e6[_0x4a5d('0x75')][_0x4a5d('0x44')]({'name':_0x45994c['name'],'contentType':_0x45994c[_0x4a5d('0x3e')],'data':fs[_0x4a5d('0x83')](_0x3cabb1)});}}}emlformat[_0x4a5d('0x84')](_0x3924e6,function(_0x390779,_0x304870){if(_0x390779)return _0x597e8b(_0x390779);fs[_0x4a5d('0x85')](path[_0x4a5d('0x76')](_0x2fda89,util[_0x4a5d('0x78')]('message%d.eml',_0x3581d0)),_0x304870);return _0x4dbb6e(_0x304870);});});});}})[_0x4a5d('0x26')](function(){if(_0x2a8367){return new BPromise(function(_0x5f4de7,_0x58ffc4){zipdir(_0x2fda89,{'saveTo':_0x43fa9e},function(_0x5aa0cb,_0x54417f){if(_0x5aa0cb)return _0x58ffc4(_0x5aa0cb);return _0x5f4de7(_0x54417f);});});}})[_0x4a5d('0x26')](function(){if(_0x2a8367){return new BPromise(function(_0x6696e4,_0x22d118){rimraf(_0x2fda89,function(_0x24b133){if(_0x24b133)_0x22d118(_0x24b133);return _0x6696e4();});});}})[_0x4a5d('0x26')](function(){if(_0x2a8367){return _0x413e85[_0x4a5d('0x6f')](_0x43fa9e,_0x1f9545,function(_0x28d44e){if(_0x28d44e){console[_0x4a5d('0x86')]('err',_0x28d44e);}else{fs[_0x4a5d('0x87')](_0x43fa9e);}});}else{return _0x413e85[_0x4a5d('0x1c')](0xc8);}})[_0x4a5d('0x5c')](handleError(_0x413e85,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 2b437c1..b423780 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 _0x55ef=['emit','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ef,0x19d));var _0xf55e=function(_0x5c0280,_0x1deab0){_0x5c0280=_0x5c0280-0x0;var _0x27c7f1=_0x55ef[_0x5c0280];return _0x27c7f1;};'use strict';var EventEmitter=require(_0xf55e('0x0'));var MailInteraction=require(_0xf55e('0x1'))['db'][_0xf55e('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf55e('0x3')](0x0);var events={'afterCreate':_0xf55e('0x4'),'afterUpdate':_0xf55e('0x5'),'afterDestroy':_0xf55e('0x6')};function emitEvent(_0x5f4bc2){return function(_0x4621a6,_0x2220c6,_0x55f407){MailInteractionEvents['emit'](_0x5f4bc2+':'+_0x4621a6['id'],_0x4621a6);MailInteractionEvents[_0xf55e('0x7')](_0x5f4bc2,_0x4621a6);_0x55f407(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf55e('0x8')](e,emitEvent(event));}}module[_0xf55e('0x9')]=MailInteractionEvents; \ No newline at end of file +var _0x049c=['remove','emit','hasOwnProperty','events','MailInteraction','setMaxListeners','save','update'];(function(_0x50cc01,_0x295f50){var _0xdead26=function(_0x1da82c){while(--_0x1da82c){_0x50cc01['push'](_0x50cc01['shift']());}};_0xdead26(++_0x295f50);}(_0x049c,0xdb));var _0xc049=function(_0x2a3f1a,_0x5d93f7){_0x2a3f1a=_0x2a3f1a-0x0;var _0x121db2=_0x049c[_0x2a3f1a];return _0x121db2;};'use strict';var EventEmitter=require(_0xc049('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xc049('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc049('0x2')](0x0);var events={'afterCreate':_0xc049('0x3'),'afterUpdate':_0xc049('0x4'),'afterDestroy':_0xc049('0x5')};function emitEvent(_0x41ea2){return function(_0x4d560b,_0x21db2b,_0x29847b){MailInteractionEvents[_0xc049('0x6')](_0x41ea2+':'+_0x4d560b['id'],_0x4d560b);MailInteractionEvents[_0xc049('0x6')](_0x41ea2,_0x4d560b);_0x29847b(null);};}for(var e in events){if(events[_0xc049('0x7')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b894e0a..1911c7e 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 _0xcb9a=['mail_interactions','substatus','closed','format','YYYY-MM-DD\x20HH:mm:ss','substatusAt','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','./mailInteraction.attributes','MailInteraction'];(function(_0x18cf14,_0x76b574){var _0x43a663=function(_0x4db80f){while(--_0x4db80f){_0x18cf14['push'](_0x18cf14['shift']());}};_0x43a663(++_0x76b574);}(_0xcb9a,0xac));var _0xacb9=function(_0x10a622,_0x1804be){_0x10a622=_0x10a622-0x0;var _0x707210=_0xcb9a[_0x10a622];return _0x707210;};'use strict';var _=require(_0xacb9('0x0'));var util=require(_0xacb9('0x1'));var logger=require(_0xacb9('0x2'))('api');var moment=require(_0xacb9('0x3'));var BPromise=require(_0xacb9('0x4'));var rp=require(_0xacb9('0x5'));var attributes=require(_0xacb9('0x6'));module['exports']=function(_0x48618b,_0x27d50e){return _0x48618b['define'](_0xacb9('0x7'),attributes,{'tableName':_0xacb9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x356509,_0x383d99,_0x4eaadb){if(_0x356509[_0xacb9('0x9')]){_0x356509['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x356509[_0xacb9('0xa')]){_0x356509['closedAt']=moment()[_0xacb9('0xb')](_0xacb9('0xc'));}_0x4eaadb(null,_0x383d99);},'beforeUpdate':function(_0x37e401,_0x1dbaec,_0x5d9c1e){if(_0x37e401['changed'](_0xacb9('0x9'))){_0x37e401[_0xacb9('0xd')]=moment()[_0xacb9('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x37e401[_0xacb9('0xe')](_0xacb9('0xa'))){_0x37e401[_0xacb9('0xf')]=moment()[_0xacb9('0xb')](_0xacb9('0xc'));}_0x5d9c1e(null,_0x37e401);}},'charset':_0xacb9('0x10'),'collate':_0xacb9('0x11')});}; \ No newline at end of file +var _0x0795=['closedAt','format','changed','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','MailInteraction','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x0795,0x94));var _0x5079=function(_0x362509,_0x22d9ab){_0x362509=_0x362509-0x0;var _0x201767=_0x0795[_0x362509];return _0x201767;};'use strict';var _=require(_0x5079('0x0'));var util=require(_0x5079('0x1'));var logger=require(_0x5079('0x2'))(_0x5079('0x3'));var moment=require(_0x5079('0x4'));var BPromise=require(_0x5079('0x5'));var rp=require(_0x5079('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x5079('0x7')]=function(_0x29a7f8,_0x5b0977){return _0x29a7f8[_0x5079('0x8')](_0x5079('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28c770,_0x5b5516,_0x2e6885){if(_0x28c770[_0x5079('0xa')]){_0x28c770[_0x5079('0xb')]=moment()['format'](_0x5079('0xc'));}if(_0x28c770[_0x5079('0xd')]){_0x28c770[_0x5079('0xe')]=moment()[_0x5079('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2e6885(null,_0x5b5516);},'beforeUpdate':function(_0x7e735e,_0x37b4a3,_0x7cfe01){if(_0x7e735e[_0x5079('0x10')](_0x5079('0xa'))){_0x7e735e[_0x5079('0xb')]=moment()[_0x5079('0xf')](_0x5079('0xc'));}if(_0x7e735e[_0x5079('0x10')](_0x5079('0xd'))){_0x7e735e[_0x5079('0xe')]=moment()[_0x5079('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7cfe01(null,_0x7e735e);}},'charset':'utf8mb4','collate':_0x5079('0x11')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 62b4a42..db44513 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 _0xa23f=['AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','then','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','spread'];(function(_0x16e065,_0x50597a){var _0x309064=function(_0x2a5ab0){while(--_0x2a5ab0){_0x16e065['push'](_0x16e065['shift']());}};_0x309064(++_0x50597a);}(_0xa23f,0x7c));var _0xfa23=function(_0x8443b9,_0x1767c3){_0x8443b9=_0x8443b9-0x0;var _0x463577=_0xa23f[_0x8443b9];return _0x463577;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa23('0x2'));var fs=require('fs');var Redis=require(_0xfa23('0x3'));var db=require(_0xfa23('0x4'))['db'];var utils=require(_0xfa23('0x5'));var logger=require('../../config/logger')(_0xfa23('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa23('0x7'));var client=jayson[_0xfa23('0x8')][_0xfa23('0x9')]({'port':0x232a});config[_0xfa23('0xa')]=_['defaults'](config[_0xfa23('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa23('0xb'))(new Redis(config[_0xfa23('0xa')]));require(_0xfa23('0xc'))[_0xfa23('0xd')](socket);function respondWithRpcPromise(_0x798943,_0x539453,_0x4b59d1){return new BPromise(function(_0x20a9b6,_0x4ea7a8){return client[_0xfa23('0xe')](_0x798943,_0x4b59d1)['then'](function(_0x1b99b7){logger[_0xfa23('0xf')](_0xfa23('0x10'),_0x539453,'request\x20sent');logger[_0xfa23('0x11')](_0xfa23('0x12'),_0x539453,_0xfa23('0x13'),JSON['stringify'](_0x1b99b7));if(_0x1b99b7['error']){if(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x15')]===0x1f4){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x1b99b7['error'][_0xfa23('0x16')]);return _0x4ea7a8(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}logger[_0xfa23('0x14')]('MailInteraction,\x20%s,\x20%s',_0x539453,_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);return _0x20a9b6(_0x1b99b7[_0xfa23('0x14')][_0xfa23('0x16')]);}else{logger[_0xfa23('0xf')]('MailInteraction,\x20%s,\x20%s',_0x539453,'request\x20sent');_0x20a9b6(_0x1b99b7['result'][_0xfa23('0x16')]);}})[_0xfa23('0x17')](function(_0x4bd0e0){logger[_0xfa23('0x14')](_0xfa23('0x10'),_0x539453,_0x4bd0e0);_0x4ea7a8(_0x4bd0e0);});});}exports[_0xfa23('0x18')]=function(_0x54bb04){var _0x1970ec=this;return new Promise(function(_0x452604,_0x47c323){return db[_0xfa23('0x19')][_0xfa23('0x1a')](_0x54bb04[_0xfa23('0x1b')],{'raw':_0x54bb04[_0xfa23('0x1c')]?_0x54bb04[_0xfa23('0x1c')][_0xfa23('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54bb04[_0xfa23('0x1c')]?_0x54bb04['options'][_0xfa23('0x1e')]||null:null,'attributes':_0x54bb04[_0xfa23('0x1c')]?_0x54bb04[_0xfa23('0x1c')][_0xfa23('0x1f')]||null:null,'limit':_0x54bb04['options']?_0x54bb04[_0xfa23('0x1c')]['limit']||null:null})[_0xfa23('0x20')](function(_0x1abb42){logger[_0xfa23('0xf')](_0xfa23('0x18'),_0x54bb04);logger[_0xfa23('0x11')](_0xfa23('0x18'),_0x54bb04,JSON[_0xfa23('0x21')](_0x1abb42));_0x452604(_0x1abb42);})[_0xfa23('0x17')](function(_0x5e1780){logger[_0xfa23('0x14')]('UpdateMailInteraction',_0x5e1780[_0xfa23('0x16')],_0x54bb04);_0x47c323(_0x1970ec['error'](0x1f4,_0x5e1780['message']));});});};exports[_0xfa23('0x22')]=function(_0x1a9a90){return new Promise(function(_0xbf9d19,_0x3b00a8){return db[_0xfa23('0x19')][_0xfa23('0x23')]({'where':_0x1a9a90[_0xfa23('0x1c')]?_0x1a9a90['options'][_0xfa23('0x1e')]||null:null})['then'](function(_0x380d42){if(_0x380d42){return _0x380d42[_0xfa23('0x24')](_0x1a9a90['body'][_0xfa23('0x25')],_[_0xfa23('0x26')](_0x1a9a90[_0xfa23('0x1b')],[_0xfa23('0x25'),'id'])||{});}})[_0xfa23('0x27')](function(_0x16393f){logger[_0xfa23('0xf')](_0xfa23('0x28'),_0x1a9a90);logger[_0xfa23('0x11')]('AddTags',_0x1a9a90,JSON[_0xfa23('0x21')](_0x16393f));_0xbf9d19(_0x16393f);})['catch'](function(_0x9d0602){logger[_0xfa23('0x14')](_0xfa23('0x28'),_0x9d0602[_0xfa23('0x16')],_0x1a9a90);_0x3b00a8(_this[_0xfa23('0x14')](0x1f4,_0x9d0602[_0xfa23('0x16')]));});});}; \ No newline at end of file +var _0xbd36=['result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1753c6,_0x56b27c){var _0x27bc50=function(_0x33b325){while(--_0x33b325){_0x1753c6['push'](_0x1753c6['shift']());}};_0x27bc50(++_0x56b27c);}(_0xbd36,0x65));var _0x6bd3=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xbd36[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var moment=require(_0x6bd3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bd3('0x3'));var db=require(_0x6bd3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bd3('0x5'))(_0x6bd3('0x6'));var config=require(_0x6bd3('0x7'));var jayson=require(_0x6bd3('0x8'));var client=jayson['client'][_0x6bd3('0x9')]({'port':0x232a});config[_0x6bd3('0xa')]=_[_0x6bd3('0xb')](config[_0x6bd3('0xa')],{'host':_0x6bd3('0xc'),'port':0x18eb});var socket=require(_0x6bd3('0xd'))(new Redis(config[_0x6bd3('0xa')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x310f54,_0x50f7f4,_0x2ce148){return new BPromise(function(_0x18004a,_0x25056a){return client[_0x6bd3('0xe')](_0x310f54,_0x2ce148)[_0x6bd3('0xf')](function(_0x56e88f){logger[_0x6bd3('0x10')](_0x6bd3('0x11'),_0x50f7f4,'request\x20sent');logger[_0x6bd3('0x12')](_0x6bd3('0x13'),_0x50f7f4,_0x6bd3('0x14'),JSON[_0x6bd3('0x15')](_0x56e88f));if(_0x56e88f[_0x6bd3('0x16')]){if(_0x56e88f[_0x6bd3('0x16')][_0x6bd3('0x17')]===0x1f4){logger[_0x6bd3('0x16')]('MailInteraction,\x20%s,\x20%s',_0x50f7f4,_0x56e88f[_0x6bd3('0x16')][_0x6bd3('0x18')]);return _0x25056a(_0x56e88f['error']['message']);}logger['error'](_0x6bd3('0x11'),_0x50f7f4,_0x56e88f['error'][_0x6bd3('0x18')]);return _0x18004a(_0x56e88f[_0x6bd3('0x16')][_0x6bd3('0x18')]);}else{logger[_0x6bd3('0x10')]('MailInteraction,\x20%s,\x20%s',_0x50f7f4,'request\x20sent');_0x18004a(_0x56e88f[_0x6bd3('0x19')][_0x6bd3('0x18')]);}})[_0x6bd3('0x1a')](function(_0x45ae0e){logger[_0x6bd3('0x16')](_0x6bd3('0x11'),_0x50f7f4,_0x45ae0e);_0x25056a(_0x45ae0e);});});}exports[_0x6bd3('0x1b')]=function(_0x3cdbe2){var _0x1bd97c=this;return new Promise(function(_0x120c7a,_0x256bca){return db[_0x6bd3('0x1c')][_0x6bd3('0x1d')](_0x3cdbe2[_0x6bd3('0x1e')],{'raw':_0x3cdbe2[_0x6bd3('0x1f')]?_0x3cdbe2[_0x6bd3('0x1f')][_0x6bd3('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cdbe2[_0x6bd3('0x1f')]?_0x3cdbe2[_0x6bd3('0x1f')][_0x6bd3('0x21')]||null:null,'attributes':_0x3cdbe2['options']?_0x3cdbe2[_0x6bd3('0x1f')][_0x6bd3('0x22')]||null:null,'limit':_0x3cdbe2[_0x6bd3('0x1f')]?_0x3cdbe2['options'][_0x6bd3('0x23')]||null:null})[_0x6bd3('0xf')](function(_0x39775e){logger[_0x6bd3('0x10')](_0x6bd3('0x1b'),_0x3cdbe2);logger[_0x6bd3('0x12')](_0x6bd3('0x1b'),_0x3cdbe2,JSON[_0x6bd3('0x15')](_0x39775e));_0x120c7a(_0x39775e);})['catch'](function(_0xab162b){logger['error'](_0x6bd3('0x1b'),_0xab162b[_0x6bd3('0x18')],_0x3cdbe2);_0x256bca(_0x1bd97c['error'](0x1f4,_0xab162b[_0x6bd3('0x18')]));});});};exports[_0x6bd3('0x24')]=function(_0x41dfae){return new Promise(function(_0x18cfc3,_0x4444bd){return db[_0x6bd3('0x1c')][_0x6bd3('0x25')]({'where':_0x41dfae['options']?_0x41dfae[_0x6bd3('0x1f')][_0x6bd3('0x21')]||null:null})[_0x6bd3('0xf')](function(_0x434523){if(_0x434523){return _0x434523['addTags'](_0x41dfae['body']['ids'],_[_0x6bd3('0x26')](_0x41dfae[_0x6bd3('0x1e')],[_0x6bd3('0x27'),'id'])||{});}})[_0x6bd3('0x28')](function(_0x32eef5){logger['info'](_0x6bd3('0x29'),_0x41dfae);logger[_0x6bd3('0x12')]('AddTags',_0x41dfae,JSON[_0x6bd3('0x15')](_0x32eef5));_0x18cfc3(_0x32eef5);})[_0x6bd3('0x1a')](function(_0x18cd4f){logger['error'](_0x6bd3('0x29'),_0x18cd4f[_0x6bd3('0x18')],_0x41dfae);_0x4444bd(_this['error'](0x1f4,_0x18cd4f[_0x6bd3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 66fe401..ce7f5e0 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 _0x78d7=['update','emit','removeListener','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x78d7,0x145));var _0x778d=function(_0x282b0b,_0x542c22){_0x282b0b=_0x282b0b-0x0;var _0x323f6f=_0x78d7[_0x282b0b];return _0x323f6f;};'use strict';var MailInteractionEvents=require(_0x778d('0x0'));var events=[_0x778d('0x1'),_0x778d('0x2'),_0x778d('0x3')];function createListener(_0x3aca8a,_0x4f6c34){return function(_0x3cfb4c){_0x4f6c34[_0x778d('0x4')](_0x3aca8a,_0x3cfb4c);};}function removeListener(_0x5c4f08,_0x5f04e2){return function(){MailInteractionEvents[_0x778d('0x5')](_0x5c4f08,_0x5f04e2);};}exports['register']=function(_0xff5a93){for(var _0x3d18f2=0x0,_0x15184b=events[_0x778d('0x6')];_0x3d18f2<_0x15184b;_0x3d18f2++){var _0x31a183=events[_0x3d18f2];var _0x3fec06=createListener(_0x778d('0x7')+_0x31a183,_0xff5a93);MailInteractionEvents['on'](_0x31a183,_0x3fec06);}}; \ No newline at end of file +var _0x2dcf=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2dcf,0x1be));var _0xf2dc=function(_0x34459c,_0x16fa1f){_0x34459c=_0x34459c-0x0;var _0x2fbde6=_0x2dcf[_0x34459c];return _0x2fbde6;};'use strict';var MailInteractionEvents=require(_0xf2dc('0x0'));var events=[_0xf2dc('0x1'),_0xf2dc('0x2'),_0xf2dc('0x3')];function createListener(_0x1ba743,_0x3b1b00){return function(_0x8a6631){_0x3b1b00[_0xf2dc('0x4')](_0x1ba743,_0x8a6631);};}function removeListener(_0x542f01,_0x59fb47){return function(){MailInteractionEvents[_0xf2dc('0x5')](_0x542f01,_0x59fb47);};}exports[_0xf2dc('0x6')]=function(_0x572741){for(var _0x1e8dac=0x0,_0x43ec2e=events[_0xf2dc('0x7')];_0x1e8dac<_0x43ec2e;_0x1e8dac++){var _0x190317=events[_0x1e8dac];var _0x4d3253=createListener(_0xf2dc('0x8')+_0x190317,_0x572741);MailInteractionEvents['on'](_0x190317,_0x4d3253);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c126f47..9ac0e9a 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 _0x5d58=['index','get','/describe','describe','/:id/download','tracked','mail','mailmessage:create','create','put','/:id','accept','/:id/reject','reject','delete','destroy','exports','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated'];(function(_0xd2f4f5,_0x341930){var _0x41fc10=function(_0x496824){while(--_0x496824){_0xd2f4f5['push'](_0xd2f4f5['shift']());}};_0x41fc10(++_0x341930);}(_0x5d58,0x187));var _0x85d5=function(_0x5b9e79,_0x55d58c){_0x5b9e79=_0x5b9e79-0x0;var _0x72bc5c=_0x5d58[_0x5b9e79];return _0x72bc5c;};'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[_0x85d5('0x0')]();var auth=require(_0x85d5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x85d5('0x2'));var controller=require(_0x85d5('0x3'));router['get']('/',auth[_0x85d5('0x4')](),controller[_0x85d5('0x5')]);router[_0x85d5('0x6')](_0x85d5('0x7'),auth['isAuthenticated'](),controller[_0x85d5('0x8')]);router[_0x85d5('0x6')]('/:id',auth[_0x85d5('0x4')](),controller['show']);router[_0x85d5('0x6')](_0x85d5('0x9'),auth[_0x85d5('0x4')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction[_0x85d5('0xa')](_0x85d5('0xb'),_0x85d5('0xc')),controller[_0x85d5('0xd')]);router[_0x85d5('0xe')](_0x85d5('0xf'),auth[_0x85d5('0x4')](),controller['update']);router['put']('/:id/accept',auth[_0x85d5('0x4')](),controller[_0x85d5('0x10')]);router[_0x85d5('0xe')](_0x85d5('0x11'),auth[_0x85d5('0x4')](),controller[_0x85d5('0x12')]);router[_0x85d5('0x13')]('/:id',auth[_0x85d5('0x4')](),controller[_0x85d5('0x14')]);module[_0x85d5('0x15')]=router; \ No newline at end of file +var _0xbd51=['path','connect-timeout','express','Router','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2729b5,_0x1a558c){_0x2729b5=_0x2729b5-0x0;var _0x33ff7a=_0xbd51[_0x2729b5];return _0x33ff7a;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x1bd5('0x5')]('/',auth[_0x1bd5('0x6')](),controller[_0x1bd5('0x7')]);router['get'](_0x1bd5('0x8'),auth[_0x1bd5('0x6')](),controller[_0x1bd5('0x9')]);router[_0x1bd5('0x5')](_0x1bd5('0xa'),auth['isAuthenticated'](),controller[_0x1bd5('0xb')]);router['get'](_0x1bd5('0xc'),auth[_0x1bd5('0x6')](),controller[_0x1bd5('0xd')]);router[_0x1bd5('0xe')]('/',auth[_0x1bd5('0x6')](),interaction[_0x1bd5('0xf')]('mail',_0x1bd5('0x10')),controller['create']);router[_0x1bd5('0x11')](_0x1bd5('0xa'),auth[_0x1bd5('0x6')](),controller[_0x1bd5('0x12')]);router[_0x1bd5('0x11')](_0x1bd5('0x13'),auth[_0x1bd5('0x6')](),controller['accept']);router['put'](_0x1bd5('0x14'),auth[_0x1bd5('0x6')](),controller[_0x1bd5('0x15')]);router[_0x1bd5('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x1bd5('0x17')]);module[_0x1bd5('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index e3a62ad..29e93bc 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 _0x3135=['long','BOOLEAN','ENUM','STRING','TEXT','DATE','INTEGER','sequelize','lodash'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x3135,0xe8));var _0x5313=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3135[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5313('0x0'));var _=require(_0x5313('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5313('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5313('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5313('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5313('0x5')](0x1fe)},'from':{'type':Sequelize[_0x5313('0x5')]},'to':{'type':Sequelize[_0x5313('0x6')]('long')},'cc':{'type':Sequelize[_0x5313('0x6')]('long')},'bcc':{'type':Sequelize[_0x5313('0x6')]('long')},'subject':{'type':Sequelize[_0x5313('0x6')]},'sentAt':{'type':Sequelize[_0x5313('0x7')]},'attach':{'type':Sequelize[_0x5313('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5313('0x7')]},'originTo':{'type':Sequelize[_0x5313('0x6')](_0x5313('0x2'))},'originCc':{'type':Sequelize[_0x5313('0x6')](_0x5313('0x2'))}}; \ No newline at end of file +var _0x1f4d=['out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT','long','BOOLEAN'];(function(_0x5c5ec2,_0x49b7b0){var _0x58a5f2=function(_0x373ea1){while(--_0x373ea1){_0x5c5ec2['push'](_0x5c5ec2['shift']());}};_0x58a5f2(++_0x49b7b0);}(_0x1f4d,0x86));var _0xd1f4=function(_0x336cbe,_0x407b9d){_0x336cbe=_0x336cbe-0x0;var _0x133bd4=_0x1f4d[_0x336cbe];return _0x133bd4;};'use strict';var Sequelize=require(_0xd1f4('0x0'));var _=require(_0xd1f4('0x1'));module[_0xd1f4('0x2')]={'body':{'type':Sequelize[_0xd1f4('0x3')](_0xd1f4('0x4')),'allowNull':![]},'read':{'type':Sequelize[_0xd1f4('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd1f4('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd1f4('0x7')](0x1fe)},'from':{'type':Sequelize[_0xd1f4('0x7')]},'to':{'type':Sequelize[_0xd1f4('0x3')](_0xd1f4('0x4'))},'cc':{'type':Sequelize[_0xd1f4('0x3')](_0xd1f4('0x4'))},'bcc':{'type':Sequelize[_0xd1f4('0x3')]('long')},'subject':{'type':Sequelize[_0xd1f4('0x3')]},'sentAt':{'type':Sequelize[_0xd1f4('0x8')]},'attach':{'type':Sequelize[_0xd1f4('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd1f4('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd1f4('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xd1f4('0x3')](_0xd1f4('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index bda399e..a03b5c0 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 _0xb96a=['MailMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','options','count','findAll','rows','show','params','includeAll','include','find','body','create','direction','out','secret','MailAccount','findOne','MailAccountId','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail-interactions','accept','mail','read','readAt','UserId','CmContact','MailInteraction','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','reject','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','download','unix','join','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','from','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','update','destroy','stack','name','index'];(function(_0x4eac0c,_0x2228f1){var _0x4fcdb2=function(_0x193e74){while(--_0x193e74){_0x4eac0c['push'](_0x4eac0c['shift']());}};_0x4fcdb2(++_0x2228f1);}(_0xb96a,0x10c));var _0xab96=function(_0x25c8f7,_0x2402da){_0x25c8f7=_0x25c8f7-0x0;var _0x211ae3=_0xb96a[_0x25c8f7];return _0x211ae3;};'use strict';var pdf=require(_0xab96('0x0'));var emlformat=require(_0xab96('0x1'));var rimraf=require(_0xab96('0x2'));var zipdir=require(_0xab96('0x3'));var jsonpatch=require(_0xab96('0x4'));var rp=require(_0xab96('0x5'));var moment=require(_0xab96('0x6'));var BPromise=require(_0xab96('0x7'));var Mustache=require(_0xab96('0x8'));var util=require('util');var path=require(_0xab96('0x9'));var sox=require(_0xab96('0xa'));var csv=require(_0xab96('0xb'));var ejs=require(_0xab96('0xc'));var fs=require('fs');var _=require(_0xab96('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab96('0xe'));var deskjs=require(_0xab96('0xf'));var toCsv=require(_0xab96('0xb'));var querystring=require('querystring');var Papa=require(_0xab96('0x10'));var authService=require(_0xab96('0x11'));var hardwareService=require(_0xab96('0x12'));var Redis=require('ioredis');var qs=require(_0xab96('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xab96('0x14'));var config=require(_0xab96('0x15'));var db=require(_0xab96('0x16'))['db'];config[_0xab96('0x17')]=_[_0xab96('0x18')](config[_0xab96('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab96('0x17')]));require(_0xab96('0x19'))[_0xab96('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xab96('0x1b')][_0xab96('0x1c')]({'port':0x232c});var client9003=jayson[_0xab96('0x1b')][_0xab96('0x1c')]({'port':0x232b});var client9002=jayson[_0xab96('0x1b')][_0xab96('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x14bad8,_0x524c46,_0x1e110d,_0x48411d){return new BPromise(function(_0x4b9830,_0x4c1161){var _0x1546c6=_0x48411d||client;return _0x1546c6[_0xab96('0x1d')](_0x14bad8,_0x1e110d)[_0xab96('0x1e')](function(_0x2a77d2){logger[_0xab96('0x1f')](_0xab96('0x20'),_0x524c46,_0xab96('0x21'));logger[_0xab96('0x22')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x524c46,_0xab96('0x21'),JSON[_0xab96('0x23')](_0x2a77d2));if(_0x2a77d2[_0xab96('0x24')]){if(_0x2a77d2['error'][_0xab96('0x25')]===0x1f4){logger[_0xab96('0x24')](_0xab96('0x20'),_0x524c46,_0x2a77d2[_0xab96('0x24')][_0xab96('0x26')]);return _0x4c1161(_0x2a77d2[_0xab96('0x24')][_0xab96('0x26')]);}logger[_0xab96('0x24')](_0xab96('0x20'),_0x524c46,_0x2a77d2[_0xab96('0x24')]['message']);return _0x4b9830(_0x2a77d2[_0xab96('0x24')][_0xab96('0x26')]);}else{logger[_0xab96('0x1f')]('MailMessage,\x20%s,\x20%s',_0x524c46,'request\x20sent');_0x4b9830(_0x2a77d2[_0xab96('0x27')][_0xab96('0x26')]);}})[_0xab96('0x28')](function(_0x343256){logger[_0xab96('0x24')](_0xab96('0x20'),_0x524c46,_0x343256);_0x4c1161(_0x343256);});});}function respondWithStatusCode(_0x500117,_0x4f197a){_0x4f197a=_0x4f197a||0xcc;return function(_0x781dfe){if(_0x781dfe){return _0x500117[_0xab96('0x29')](_0x4f197a);}return _0x500117[_0xab96('0x2a')](_0x4f197a)[_0xab96('0x2b')]();};}function respondWithResult(_0x4bbe34,_0x217daf){_0x217daf=_0x217daf||0xc8;return function(_0x1818fd){if(_0x1818fd){return _0x4bbe34[_0xab96('0x2a')](_0x217daf)['json'](_0x1818fd);}};}function respondWithFilteredResult(_0x46b12c,_0x34bd4d){return function(_0x41d058){if(_0x41d058){var _0x569cb3=_0x41d058['count'],_0xe21655=_0x34bd4d[_0xab96('0x2c')],_0x4e94ac=_0x34bd4d[_0xab96('0x2c')]+_0x34bd4d[_0xab96('0x2d')],_0x5bb589;if(_0x4e94ac>=_0x569cb3){_0x4e94ac=_0x569cb3;_0x5bb589=0xc8;}else{_0x5bb589=0xce;}_0x46b12c[_0xab96('0x2a')](_0x5bb589);return _0x46b12c['set'](_0xab96('0x2e'),_0xe21655+'-'+_0x4e94ac+'/'+_0x569cb3)[_0xab96('0x2f')](_0x41d058);}return null;};}function patchUpdates(_0x4d0b5c){return function(_0x58833c){try{jsonpatch[_0xab96('0x30')](_0x58833c,_0x4d0b5c,!![]);}catch(_0xcd6153){return BPromise['reject'](_0xcd6153);}return _0x58833c['save']();};}function saveUpdates(_0xf2f8f4,_0x2f2be4){return function(_0x233fd9){if(_0x233fd9){return _0x233fd9[_0xab96('0x31')](_0xf2f8f4)[_0xab96('0x1e')](function(_0x2beb3f){return _0x2beb3f;});}return null;};}function removeEntity(_0x32999c,_0x17ff33){return function(_0x52f936){if(_0x52f936){return _0x52f936[_0xab96('0x32')]()[_0xab96('0x1e')](function(){_0x32999c[_0xab96('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481d02,_0x1decdb){return function(_0x4da75e){if(!_0x4da75e){_0x481d02[_0xab96('0x29')](0x194);}return _0x4da75e;};}function handleError(_0x248c10,_0x3fa251){_0x3fa251=_0x3fa251||0x1f4;return function(_0x2fac61){logger['error'](_0x2fac61[_0xab96('0x33')]);if(_0x2fac61[_0xab96('0x34')]){delete _0x2fac61[_0xab96('0x34')];}_0x248c10[_0xab96('0x2a')](_0x3fa251)['send'](_0x2fac61);};}exports[_0xab96('0x35')]=function(_0x538323,_0x3a08d3){var _0x5ee898={},_0x36c998={},_0xff03c2={'count':0x0,'rows':[]};var _0x45924a=db[_0xab96('0x36')][_0xab96('0x37')];_0x36c998[_0xab96('0x38')]=_[_0xab96('0x39')](_0x45924a);_0x36c998[_0xab96('0x3a')]=_['keys'](_0x538323[_0xab96('0x3a')]);_0x36c998[_0xab96('0x3b')]=_[_0xab96('0x3c')](_0x36c998['model'],_0x36c998[_0xab96('0x3a')]);_0x5ee898['attributes']=_['intersection'](_0x36c998[_0xab96('0x38')],qs[_0xab96('0x3d')](_0x538323[_0xab96('0x3a')][_0xab96('0x3d')]));_0x5ee898['attributes']=_0x5ee898[_0xab96('0x3e')][_0xab96('0x3f')]?_0x5ee898[_0xab96('0x3e')]:_0x36c998[_0xab96('0x38')];if(!_0x538323[_0xab96('0x3a')][_0xab96('0x40')]('nolimit')){_0x5ee898['limit']=qs[_0xab96('0x2d')](_0x538323['query']['limit']);_0x5ee898[_0xab96('0x2c')]=qs[_0xab96('0x2c')](_0x538323[_0xab96('0x3a')][_0xab96('0x2c')]);}_0x5ee898[_0xab96('0x41')]=qs[_0xab96('0x42')](_0x538323[_0xab96('0x3a')]['sort']);_0x5ee898['where']=qs[_0xab96('0x3b')](_[_0xab96('0x43')](_0x538323[_0xab96('0x3a')],_0x36c998[_0xab96('0x3b')]));if(_0x538323[_0xab96('0x3a')]['filter']){_0x5ee898[_0xab96('0x44')]=_[_0xab96('0x45')](_0x5ee898['where'],{'$or':_[_0xab96('0x46')](_0x45924a,function(_0x3b8cc0){if(_0x3b8cc0[_0xab96('0x47')][_0xab96('0x48')]!==_0xab96('0x49')){var _0x21a0c7={};_0x21a0c7[_0x3b8cc0[_0xab96('0x4a')]]={'$like':'%'+_0x538323['query']['filter']+'%'};return _0x21a0c7;}})});}_0x5ee898=_[_0xab96('0x45')]({},_0x5ee898,_0x538323[_0xab96('0x4b')]);var _0x4d32d8={'where':_0x5ee898[_0xab96('0x44')]};return db['MailMessage']['count'](_0x4d32d8)[_0xab96('0x1e')](function(_0x34c9cd){_0xff03c2[_0xab96('0x4c')]=_0x34c9cd;if(_0x538323['query']['includeAll']){_0x5ee898['include']=[{'all':!![]}];}return db[_0xab96('0x36')][_0xab96('0x4d')](_0x5ee898);})[_0xab96('0x1e')](function(_0x21d025){_0xff03c2[_0xab96('0x4e')]=_0x21d025;return _0xff03c2;})['then'](respondWithFilteredResult(_0x3a08d3,_0x5ee898))[_0xab96('0x28')](handleError(_0x3a08d3,null));};exports[_0xab96('0x4f')]=function(_0x347257,_0x424f0b){var _0x5b40bd={'raw':!![],'where':{'id':_0x347257[_0xab96('0x50')]['id']}},_0x5d57e9={};_0x5d57e9[_0xab96('0x38')]=_[_0xab96('0x39')](db[_0xab96('0x36')][_0xab96('0x37')]);_0x5d57e9[_0xab96('0x3a')]=_[_0xab96('0x39')](_0x347257[_0xab96('0x3a')]);_0x5d57e9['filters']=_[_0xab96('0x3c')](_0x5d57e9[_0xab96('0x38')],_0x5d57e9[_0xab96('0x3a')]);_0x5b40bd[_0xab96('0x3e')]=_[_0xab96('0x3c')](_0x5d57e9[_0xab96('0x38')],qs[_0xab96('0x3d')](_0x347257[_0xab96('0x3a')][_0xab96('0x3d')]));_0x5b40bd[_0xab96('0x3e')]=_0x5b40bd[_0xab96('0x3e')][_0xab96('0x3f')]?_0x5b40bd[_0xab96('0x3e')]:_0x5d57e9[_0xab96('0x38')];if(_0x347257[_0xab96('0x3a')][_0xab96('0x51')]){_0x5b40bd[_0xab96('0x52')]=[{'all':!![]}];}_0x5b40bd=_['merge']({},_0x5b40bd,_0x347257[_0xab96('0x4b')]);return db[_0xab96('0x36')][_0xab96('0x53')](_0x5b40bd)[_0xab96('0x1e')](handleEntityNotFound(_0x424f0b,null))[_0xab96('0x1e')](respondWithResult(_0x424f0b,null))[_0xab96('0x28')](handleError(_0x424f0b,null));};exports[_0xab96('0x31')]=function(_0x22b7c7,_0x1e7d6e){if(_0x22b7c7['body']['id']){delete _0x22b7c7[_0xab96('0x54')]['id'];}return db[_0xab96('0x36')]['find']({'where':{'id':_0x22b7c7[_0xab96('0x50')]['id']}})[_0xab96('0x1e')](handleEntityNotFound(_0x1e7d6e,null))['then'](saveUpdates(_0x22b7c7[_0xab96('0x54')],null))[_0xab96('0x1e')](respondWithResult(_0x1e7d6e,null))[_0xab96('0x28')](handleError(_0x1e7d6e,null));};exports[_0xab96('0x32')]=function(_0x149cf5,_0x4ecb65){return db[_0xab96('0x36')][_0xab96('0x53')]({'where':{'id':_0x149cf5[_0xab96('0x50')]['id']}})[_0xab96('0x1e')](handleEntityNotFound(_0x4ecb65,null))[_0xab96('0x1e')](removeEntity(_0x4ecb65,null))[_0xab96('0x28')](handleError(_0x4ecb65,null));};exports['describe']=function(_0x34136c,_0x431bf3){return db[_0xab96('0x36')]['describe']()[_0xab96('0x1e')](respondWithResult(_0x431bf3,null))[_0xab96('0x28')](handleError(_0x431bf3,null));};exports[_0xab96('0x55')]=function(_0x38528f,_0x18a09){return db[_0xab96('0x36')]['create'](_0x38528f[_0xab96('0x54')])[_0xab96('0x1e')](function(_0x339a5a){if(_0x339a5a){if(_0x339a5a[_0xab96('0x56')]===_0xab96('0x57')&&!_0x339a5a[_0xab96('0x58')]){return db[_0xab96('0x59')][_0xab96('0x5a')]({'where':{'id':_0x339a5a[_0xab96('0x5b')]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xab96('0x1e')](function(_0x24cdb9){if(_0x24cdb9&&_0x24cdb9['Smtp']){var _0x2f743a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x24cdb9[_0xab96('0x5c')][_0xab96('0x5d')])){_0x2f743a[_0xab96('0x5e')]=_0x24cdb9['Smtp'][_0xab96('0x5e')];_0x2f743a['port']=_0x24cdb9['Smtp'][_0xab96('0x5f')];_0x2f743a[_0xab96('0x60')]=_0x24cdb9[_0xab96('0x5c')][_0xab96('0x60')];if(_0x24cdb9['Smtp'][_0xab96('0x61')]){_0x2f743a[_0xab96('0x62')]={'user':_0x24cdb9[_0xab96('0x5c')][_0xab96('0x63')],'pass':_0x24cdb9[_0xab96('0x5c')][_0xab96('0x64')]};}}else{_0x2f743a[_0xab96('0x5d')]=_0x24cdb9[_0xab96('0x5c')][_0xab96('0x5d')];_0x2f743a[_0xab96('0x62')]={'user':_0x24cdb9[_0xab96('0x5c')][_0xab96('0x63')],'pass':_0x24cdb9[_0xab96('0x5c')][_0xab96('0x64')]};_0x2f743a[_0xab96('0x60')]=_0x24cdb9['Smtp']['secure'];}if(_0x38528f[_0xab96('0x54')][_0xab96('0x65')]&&_0x38528f[_0xab96('0x54')][_0xab96('0x65')][_0xab96('0x3f')]){for(var _0xad39b2=0x0;_0xad39b2<_0x38528f[_0xab96('0x54')]['attachments'][_0xab96('0x3f')];_0xad39b2+=0x1){_0x38528f[_0xab96('0x54')][_0xab96('0x65')][_0xad39b2]={'filename':_0x38528f[_0xab96('0x54')][_0xab96('0x65')][_0xad39b2][_0xab96('0x34')],'path':path['join'](config[_0xab96('0x66')],_0xab96('0x67'),_0x38528f[_0xab96('0x54')][_0xab96('0x65')][_0xad39b2][_0xab96('0x68')])};}}return{'account':_0x2f743a,'message':_0x38528f['body']};}})['then'](function(_0x4b4c15){if(_0x4b4c15){return respondWithRpcPromise(_0xab96('0x69'),_0xab96('0x6a'),_0x4b4c15,client9003)[_0xab96('0x1e')](function(_0x3ace3d){return _0x339a5a[_0xab96('0x31')]({'read':!![],'messageId':_0x3ace3d[_0xab96('0x6b')],'sentAt':moment()[_0xab96('0x6c')](_0xab96('0x6d'))});})['catch'](function(_0x745f04){logger[_0xab96('0x24')]('%s',JSON[_0xab96('0x23')](_0x745f04));return _0x339a5a;});}return _0x339a5a;});}return _0x339a5a;}})[_0xab96('0x1e')](respondWithResult(_0x18a09,0xc9))[_0xab96('0x28')](handleError(_0x18a09,null));};var interaction_log=require(_0xab96('0x6e'))(_0xab96('0x6f'));exports[_0xab96('0x70')]=function(_0x445290,_0x28bbdb,_0x20c937){var _0xc0682b={'channel':_0xab96('0x71')};if(_0x445290[_0xab96('0x54')]['id']){delete _0x445290[_0xab96('0x54')]['id'];}_0x445290[_0xab96('0x54')][_0xab96('0x72')]=!![];_0x445290[_0xab96('0x54')][_0xab96('0x73')]=moment()[_0xab96('0x6c')](_0xab96('0x6d'));_0x445290['body'][_0xab96('0x74')]=_0x445290[_0xab96('0x54')][_0xab96('0x74')]||_0x445290[_0xab96('0x63')]['id'];return db[_0xab96('0x36')][_0xab96('0x53')]({'where':{'id':_0x445290[_0xab96('0x50')]['id'],'UserId':null},'include':[{'model':db[_0xab96('0x75')],'as':'Contact'}]})[_0xab96('0x1e')](handleEntityNotFound(_0x28bbdb,null))[_0xab96('0x1e')](saveUpdates(_0x445290[_0xab96('0x54')],null))['then'](function(_0x1fc33d){if(_0x1fc33d){_0xc0682b['message']=_0x1fc33d['get']({'plain':!![]});return db[_0xab96('0x76')][_0xab96('0x53')]({'where':{'id':_0x1fc33d['MailInteractionId']}});}return null;})[_0xab96('0x1e')](handleEntityNotFound(_0x28bbdb,null))[_0xab96('0x1e')](function(_0x19ccb9){if(_0x19ccb9){return _0x19ccb9[_0xab96('0x31')]({'UserId':_0x445290[_0xab96('0x54')][_0xab96('0x74')],'read1stAt':_[_0xab96('0x77')](_0x19ccb9[_0xab96('0x78')])?moment()[_0xab96('0x6c')](_0xab96('0x6d')):undefined});}return null;})[_0xab96('0x1e')](function(_0x4fbbf2){if(_0x4fbbf2){_0xc0682b[_0xab96('0x79')]=_0x4fbbf2[_0xab96('0x7a')]({'plain':!![]});interaction_log[_0xab96('0x1f')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x445290[_0xab96('0x63')]['id'],_0x445290['user'][_0xab96('0x34')],_0x445290['user'][_0xab96('0x7b')],_0xc0682b[_0xab96('0x79')]['id'],_0x445290[_0xab96('0x54')]?JSON['stringify'](_0x445290['body']):_0xab96('0x7c'));return respondWithRpcPromise(_0xab96('0x7d'),_0xab96('0x7e'),_0xc0682b);}return null;})[_0xab96('0x1e')](function(_0x2b50d7){if(_0x2b50d7){if(_0x445290[_0xab96('0x54')][_0xab96('0x7f')]){_0xc0682b[_0xab96('0x26')][_0xab96('0x80')]=util[_0xab96('0x6c')](_0xab96('0x81'),_0x445290[_0xab96('0x63')][_0xab96('0x34')]);_0xc0682b[_0xab96('0x26')][_0xab96('0x82')]=_0xc0682b[_0xab96('0x82')];_0xc0682b[_0xab96('0x26')]['event']=_0xab96('0x70');return respondWithRpcPromise(_0xab96('0x83'),_0xab96('0x83'),{'event':'acceptmessage','message':_0xc0682b[_0xab96('0x26')]},client9002)[_0xab96('0x1e')](function(){return _0xc0682b;});}return _0xc0682b;}return null;})['then'](respondWithResult(_0x28bbdb,null))[_0xab96('0x28')](handleError(_0x28bbdb,null));};var interaction_log=require(_0xab96('0x6e'))(_0xab96('0x6f'));exports[_0xab96('0x84')]=function(_0x4d01ff,_0x461214,_0x68e2e3){var _0x51d04f={'agent':{},'channel':_0xab96('0x71')};if(_0x4d01ff['body']['id']){delete _0x4d01ff['body']['id'];}_0x4d01ff[_0xab96('0x54')][_0xab96('0x74')]=_0x4d01ff[_0xab96('0x54')][_0xab96('0x74')]||_0x4d01ff[_0xab96('0x63')]['id'];_0x51d04f[_0xab96('0x85')]['id']=_0x4d01ff[_0xab96('0x54')][_0xab96('0x74')];return db[_0xab96('0x36')][_0xab96('0x53')]({'where':{'id':_0x4d01ff[_0xab96('0x50')]['id'],'UserId':null}})[_0xab96('0x1e')](handleEntityNotFound(_0x461214,null))[_0xab96('0x1e')](function(_0x28202f){if(_0x28202f){_0x51d04f[_0xab96('0x26')]=_0x28202f['get']({'plain':!![]});return db['MailInteraction'][_0xab96('0x53')]({'where':{'id':_0x28202f['MailInteractionId']}});}return null;})[_0xab96('0x1e')](handleEntityNotFound(_0x461214,null))[_0xab96('0x1e')](function(_0x55de51){if(_0x55de51){_0x51d04f[_0xab96('0x79')]=_0x55de51['get']({'plain':!![]});interaction_log[_0xab96('0x1f')](_0xab96('0x86'),_0x4d01ff[_0xab96('0x63')]['id'],_0x4d01ff['user']['name'],_0x4d01ff['user'][_0xab96('0x7b')],_0x51d04f[_0xab96('0x79')]['id'],_0x4d01ff[_0xab96('0x54')]?JSON[_0xab96('0x23')](_0x4d01ff[_0xab96('0x54')]):_0xab96('0x7c'));return respondWithRpcPromise(_0xab96('0x87'),_0xab96('0x88'),_0x51d04f);}return null;})[_0xab96('0x1e')](function(_0x162c1d){if(_0x162c1d){_0x162c1d[_0xab96('0x26')][_0xab96('0x80')]=util[_0xab96('0x6c')](_0xab96('0x81'),_0x4d01ff['user'][_0xab96('0x34')]);_0x162c1d[_0xab96('0x26')][_0xab96('0x82')]=_0x51d04f[_0xab96('0x82')];_0x162c1d['message'][_0xab96('0x89')]=_0xab96('0x84');respondWithRpcPromise(_0xab96('0x83'),_0xab96('0x83'),{'event':_0xab96('0x8a'),'message':_0x162c1d['message']},client9002);return _0x51d04f;}return null;})[_0xab96('0x1e')](respondWithResult(_0x461214,null))['catch'](handleError(_0x461214,null));};exports[_0xab96('0x8b')]=function(_0x1f83a1,_0x10cd2f){var _0x47f99f=moment()[_0xab96('0x8c')]()['toString']();var _0x411e9e=path[_0xab96('0x8d')](config['root'],_0xab96('0x8e'),_0xab96('0x8f'),_0xab96('0x90'));var _0x55e901=path[_0xab96('0x8d')](config[_0xab96('0x66')],_0xab96('0x8e'),'files',_0xab96('0x65'));var _0x74f17e=util[_0xab96('0x6c')](_0xab96('0x91'),_0x47f99f);return db[_0xab96('0x36')][_0xab96('0x53')]({'where':{'id':_0x1f83a1[_0xab96('0x50')]['id']},'attributes':['id',_0xab96('0x54'),'from','to','cc',_0xab96('0x92'),_0xab96('0x93'),'createdAt'],'include':_0x1f83a1[_0xab96('0x3a')][_0xab96('0x65')]?[{'model':db[_0xab96('0x94')],'as':_0xab96('0x95')}]:undefined})['then'](handleEntityNotFound(_0x10cd2f,null))[_0xab96('0x1e')](function(_0x15856c){if(_0x15856c){var _0x3b8505=_0x15856c;var _0x495a48={'from':_0x3b8505[_0xab96('0x96')],'to':_0x3b8505['to'],'subject':_0x3b8505['subject'],'html':_0x3b8505[_0xab96('0x54')],'headers':{'Date':moment(_0x3b8505[_0xab96('0x97')])[_0xab96('0x6c')](_0xab96('0x98'))},'attachments':[]};if(_0x15856c['cc']){_0x495a48[_0xab96('0x99')]['Cc']=_0x15856c['cc'];}if(_0x15856c[_0xab96('0x92')]){_0x495a48[_0xab96('0x99')][_0xab96('0x9a')]=_0x15856c[_0xab96('0x92')];}return new BPromise(function(_0x536cd9,_0x5c2b72){if(_0x15856c[_0xab96('0x95')]){for(var _0x50a7b6=0x0;_0x50a7b6<_0x15856c[_0xab96('0x95')][_0xab96('0x3f')];_0x50a7b6++){var _0x2c39f3=_0x15856c[_0xab96('0x95')][_0x50a7b6];var _0x2f3b18=path['join'](_0x55e901,_0x2c39f3[_0xab96('0x68')]);if(fs['existsSync'](_0x2f3b18)){_0x495a48[_0xab96('0x65')][_0xab96('0x9b')]({'name':_0x2c39f3[_0xab96('0x34')],'contentType':_0x2c39f3[_0xab96('0x47')],'data':fs[_0xab96('0x9c')](_0x2f3b18)});}}}emlformat[_0xab96('0x9d')](_0x495a48,function(_0x41b040,_0x279bbe){if(_0x41b040)return _0x5c2b72(_0x41b040);fs[_0xab96('0x9e')](path[_0xab96('0x8d')](_0x411e9e,_0x74f17e),_0x279bbe);return _0x536cd9(_0x279bbe);});});}})['then'](function(_0x301738){if(_0x301738){return _0x10cd2f[_0xab96('0x8b')](path[_0xab96('0x8d')](_0x411e9e,_0x74f17e),_0x74f17e,function(_0x36cddc){if(_0x36cddc){console[_0xab96('0x9f')]('err',_0x36cddc);}else{fs[_0xab96('0xa0')](path[_0xab96('0x8d')](_0x411e9e,_0x74f17e));}});}})[_0xab96('0x28')](handleError(_0x10cd2f,null));}; \ No newline at end of file +var _0xa094=['server','files','tmp','message-%s.eml','from','bcc','Attachment','Attachments','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','findAll','rows','show','params','options','find','body','describe','create','direction','out','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','service','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail-interactions','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','download','unix','toString','root'];(function(_0x549b7e,_0x4f06a1){var _0x51ab2e=function(_0x2f8240){while(--_0x2f8240){_0x549b7e['push'](_0x549b7e['shift']());}};_0x51ab2e(++_0x4f06a1);}(_0xa094,0x156));var _0x4a09=function(_0x2823e8,_0x19cb41){_0x2823e8=_0x2823e8-0x0;var _0x4e954c=_0xa094[_0x2823e8];return _0x4e954c;};'use strict';var pdf=require(_0x4a09('0x0'));var emlformat=require(_0x4a09('0x1'));var rimraf=require(_0x4a09('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a09('0x3'));var rp=require(_0x4a09('0x4'));var moment=require(_0x4a09('0x5'));var BPromise=require(_0x4a09('0x6'));var Mustache=require('mustache');var util=require(_0x4a09('0x7'));var path=require(_0x4a09('0x8'));var sox=require(_0x4a09('0x9'));var csv=require(_0x4a09('0xa'));var ejs=require(_0x4a09('0xb'));var fs=require('fs');var _=require(_0x4a09('0xc'));var squel=require(_0x4a09('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a09('0xe'));var deskjs=require(_0x4a09('0xf'));var toCsv=require(_0x4a09('0xa'));var querystring=require(_0x4a09('0x10'));var Papa=require('papaparse');var authService=require(_0x4a09('0x11'));var hardwareService=require(_0x4a09('0x12'));var Redis=require(_0x4a09('0x13'));var qs=require(_0x4a09('0x14'));var logger=require(_0x4a09('0x15'))('api');var utils=require(_0x4a09('0x16'));var config=require(_0x4a09('0x17'));var db=require('../../mysqldb')['db'];config[_0x4a09('0x18')]=_[_0x4a09('0x19')](config[_0x4a09('0x18')],{'host':_0x4a09('0x1a'),'port':0x18eb});var socket=require(_0x4a09('0x1b'))(new Redis(config[_0x4a09('0x18')]));require(_0x4a09('0x1c'))[_0x4a09('0x1d')](socket);var jayson=require(_0x4a09('0x1e'));var client=jayson['client'][_0x4a09('0x1f')]({'port':0x232c});var client9003=jayson[_0x4a09('0x20')]['http']({'port':0x232b});var client9002=jayson[_0x4a09('0x20')][_0x4a09('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x494571,_0x199708,_0x2de998,_0x4a0577){return new BPromise(function(_0x4a9ad7,_0x22b844){var _0x341dc1=_0x4a0577||client;return _0x341dc1['request'](_0x494571,_0x2de998)[_0x4a09('0x21')](function(_0x51c527){logger[_0x4a09('0x22')](_0x4a09('0x23'),_0x199708,_0x4a09('0x24'));logger['debug'](_0x4a09('0x25'),_0x199708,_0x4a09('0x24'),JSON[_0x4a09('0x26')](_0x51c527));if(_0x51c527['error']){if(_0x51c527[_0x4a09('0x27')][_0x4a09('0x28')]===0x1f4){logger['error'](_0x4a09('0x23'),_0x199708,_0x51c527[_0x4a09('0x27')][_0x4a09('0x29')]);return _0x22b844(_0x51c527[_0x4a09('0x27')][_0x4a09('0x29')]);}logger[_0x4a09('0x27')](_0x4a09('0x23'),_0x199708,_0x51c527[_0x4a09('0x27')][_0x4a09('0x29')]);return _0x4a9ad7(_0x51c527[_0x4a09('0x27')][_0x4a09('0x29')]);}else{logger[_0x4a09('0x22')]('MailMessage,\x20%s,\x20%s',_0x199708,'request\x20sent');_0x4a9ad7(_0x51c527['result'][_0x4a09('0x29')]);}})[_0x4a09('0x2a')](function(_0x530382){logger['error'](_0x4a09('0x23'),_0x199708,_0x530382);_0x22b844(_0x530382);});});}function respondWithStatusCode(_0x3386f0,_0x2f38d9){_0x2f38d9=_0x2f38d9||0xcc;return function(_0x30b68e){if(_0x30b68e){return _0x3386f0[_0x4a09('0x2b')](_0x2f38d9);}return _0x3386f0[_0x4a09('0x2c')](_0x2f38d9)[_0x4a09('0x2d')]();};}function respondWithResult(_0x516c22,_0x2a8c95){_0x2a8c95=_0x2a8c95||0xc8;return function(_0x4f5587){if(_0x4f5587){return _0x516c22[_0x4a09('0x2c')](_0x2a8c95)[_0x4a09('0x2e')](_0x4f5587);}};}function respondWithFilteredResult(_0x546b0b,_0x3015e6){return function(_0x1ec6dd){if(_0x1ec6dd){var _0x228391=_0x1ec6dd['count'],_0x5d2c9e=_0x3015e6['offset'],_0x1e19e9=_0x3015e6[_0x4a09('0x2f')]+_0x3015e6[_0x4a09('0x30')],_0x46beaa;if(_0x1e19e9>=_0x228391){_0x1e19e9=_0x228391;_0x46beaa=0xc8;}else{_0x46beaa=0xce;}_0x546b0b['status'](_0x46beaa);return _0x546b0b[_0x4a09('0x31')]('Content-Range',_0x5d2c9e+'-'+_0x1e19e9+'/'+_0x228391)[_0x4a09('0x2e')](_0x1ec6dd);}return null;};}function patchUpdates(_0x420288){return function(_0x16f3fd){try{jsonpatch[_0x4a09('0x32')](_0x16f3fd,_0x420288,!![]);}catch(_0x168199){return BPromise[_0x4a09('0x33')](_0x168199);}return _0x16f3fd[_0x4a09('0x34')]();};}function saveUpdates(_0x190861,_0x506771){return function(_0x490ff0){if(_0x490ff0){return _0x490ff0[_0x4a09('0x35')](_0x190861)[_0x4a09('0x21')](function(_0x43142e){return _0x43142e;});}return null;};}function removeEntity(_0x26cbf1,_0x12d51f){return function(_0x2e3a56){if(_0x2e3a56){return _0x2e3a56[_0x4a09('0x36')]()[_0x4a09('0x21')](function(){_0x26cbf1[_0x4a09('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x874dd7,_0x550bc7){return function(_0x101016){if(!_0x101016){_0x874dd7[_0x4a09('0x2b')](0x194);}return _0x101016;};}function handleError(_0x51da38,_0xde3635){_0xde3635=_0xde3635||0x1f4;return function(_0x17582e){logger[_0x4a09('0x27')](_0x17582e[_0x4a09('0x37')]);if(_0x17582e[_0x4a09('0x38')]){delete _0x17582e[_0x4a09('0x38')];}_0x51da38[_0x4a09('0x2c')](_0xde3635)[_0x4a09('0x39')](_0x17582e);};}exports[_0x4a09('0x3a')]=function(_0x568036,_0x2ea5f6){var _0x47d88d={},_0x11b6f8={},_0x238e65={'count':0x0,'rows':[]};var _0x212717=db[_0x4a09('0x3b')][_0x4a09('0x3c')];_0x11b6f8[_0x4a09('0x3d')]=_[_0x4a09('0x3e')](_0x212717);_0x11b6f8[_0x4a09('0x3f')]=_[_0x4a09('0x3e')](_0x568036[_0x4a09('0x3f')]);_0x11b6f8[_0x4a09('0x40')]=_['intersection'](_0x11b6f8[_0x4a09('0x3d')],_0x11b6f8[_0x4a09('0x3f')]);_0x47d88d[_0x4a09('0x41')]=_[_0x4a09('0x42')](_0x11b6f8[_0x4a09('0x3d')],qs[_0x4a09('0x43')](_0x568036[_0x4a09('0x3f')][_0x4a09('0x43')]));_0x47d88d['attributes']=_0x47d88d['attributes'][_0x4a09('0x44')]?_0x47d88d['attributes']:_0x11b6f8['model'];if(!_0x568036[_0x4a09('0x3f')][_0x4a09('0x45')](_0x4a09('0x46'))){_0x47d88d[_0x4a09('0x30')]=qs[_0x4a09('0x30')](_0x568036[_0x4a09('0x3f')][_0x4a09('0x30')]);_0x47d88d[_0x4a09('0x2f')]=qs[_0x4a09('0x2f')](_0x568036['query'][_0x4a09('0x2f')]);}_0x47d88d['order']=qs[_0x4a09('0x47')](_0x568036['query']['sort']);_0x47d88d[_0x4a09('0x48')]=qs[_0x4a09('0x40')](_[_0x4a09('0x49')](_0x568036[_0x4a09('0x3f')],_0x11b6f8[_0x4a09('0x40')]));if(_0x568036['query'][_0x4a09('0x4a')]){_0x47d88d[_0x4a09('0x48')]=_[_0x4a09('0x4b')](_0x47d88d[_0x4a09('0x48')],{'$or':_[_0x4a09('0x4c')](_0x212717,function(_0x39497b){if(_0x39497b[_0x4a09('0x4d')][_0x4a09('0x4e')]!==_0x4a09('0x4f')){var _0x5a5717={};_0x5a5717[_0x39497b[_0x4a09('0x50')]]={'$like':'%'+_0x568036[_0x4a09('0x3f')][_0x4a09('0x4a')]+'%'};return _0x5a5717;}})});}_0x47d88d=_[_0x4a09('0x4b')]({},_0x47d88d,_0x568036['options']);var _0x26b874={'where':_0x47d88d[_0x4a09('0x48')]};return db[_0x4a09('0x3b')][_0x4a09('0x51')](_0x26b874)[_0x4a09('0x21')](function(_0x2c3bd5){_0x238e65['count']=_0x2c3bd5;if(_0x568036['query']['includeAll']){_0x47d88d['include']=[{'all':!![]}];}return db['MailMessage'][_0x4a09('0x52')](_0x47d88d);})[_0x4a09('0x21')](function(_0x5f3421){_0x238e65[_0x4a09('0x53')]=_0x5f3421;return _0x238e65;})[_0x4a09('0x21')](respondWithFilteredResult(_0x2ea5f6,_0x47d88d))[_0x4a09('0x2a')](handleError(_0x2ea5f6,null));};exports[_0x4a09('0x54')]=function(_0x37dc6e,_0x590652){var _0x6fac7={'raw':!![],'where':{'id':_0x37dc6e[_0x4a09('0x55')]['id']}},_0x495a62={};_0x495a62[_0x4a09('0x3d')]=_[_0x4a09('0x3e')](db[_0x4a09('0x3b')][_0x4a09('0x3c')]);_0x495a62[_0x4a09('0x3f')]=_[_0x4a09('0x3e')](_0x37dc6e[_0x4a09('0x3f')]);_0x495a62[_0x4a09('0x40')]=_[_0x4a09('0x42')](_0x495a62[_0x4a09('0x3d')],_0x495a62[_0x4a09('0x3f')]);_0x6fac7[_0x4a09('0x41')]=_[_0x4a09('0x42')](_0x495a62['model'],qs[_0x4a09('0x43')](_0x37dc6e[_0x4a09('0x3f')][_0x4a09('0x43')]));_0x6fac7['attributes']=_0x6fac7[_0x4a09('0x41')][_0x4a09('0x44')]?_0x6fac7[_0x4a09('0x41')]:_0x495a62['model'];if(_0x37dc6e[_0x4a09('0x3f')]['includeAll']){_0x6fac7['include']=[{'all':!![]}];}_0x6fac7=_[_0x4a09('0x4b')]({},_0x6fac7,_0x37dc6e[_0x4a09('0x56')]);return db[_0x4a09('0x3b')][_0x4a09('0x57')](_0x6fac7)['then'](handleEntityNotFound(_0x590652,null))[_0x4a09('0x21')](respondWithResult(_0x590652,null))[_0x4a09('0x2a')](handleError(_0x590652,null));};exports[_0x4a09('0x35')]=function(_0x39652e,_0x162138){if(_0x39652e[_0x4a09('0x58')]['id']){delete _0x39652e[_0x4a09('0x58')]['id'];}return db['MailMessage'][_0x4a09('0x57')]({'where':{'id':_0x39652e[_0x4a09('0x55')]['id']}})[_0x4a09('0x21')](handleEntityNotFound(_0x162138,null))[_0x4a09('0x21')](saveUpdates(_0x39652e[_0x4a09('0x58')],null))['then'](respondWithResult(_0x162138,null))[_0x4a09('0x2a')](handleError(_0x162138,null));};exports['destroy']=function(_0x28f251,_0x38a112){return db[_0x4a09('0x3b')]['find']({'where':{'id':_0x28f251[_0x4a09('0x55')]['id']}})['then'](handleEntityNotFound(_0x38a112,null))['then'](removeEntity(_0x38a112,null))['catch'](handleError(_0x38a112,null));};exports[_0x4a09('0x59')]=function(_0x429d19,_0x1f551a){return db[_0x4a09('0x3b')][_0x4a09('0x59')]()[_0x4a09('0x21')](respondWithResult(_0x1f551a,null))[_0x4a09('0x2a')](handleError(_0x1f551a,null));};exports[_0x4a09('0x5a')]=function(_0x5a9114,_0x575bfd){return db[_0x4a09('0x3b')][_0x4a09('0x5a')](_0x5a9114[_0x4a09('0x58')])[_0x4a09('0x21')](function(_0x42f64d){if(_0x42f64d){if(_0x42f64d[_0x4a09('0x5b')]===_0x4a09('0x5c')&&!_0x42f64d['secret']){return db[_0x4a09('0x5d')]['findOne']({'where':{'id':_0x42f64d[_0x4a09('0x5e')]},'include':[{'model':db[_0x4a09('0x5f')],'as':_0x4a09('0x60'),'raw':!![]}]})[_0x4a09('0x21')](function(_0x428e19){if(_0x428e19&&_0x428e19[_0x4a09('0x60')]){var _0x17a0b4={'tls':{'rejectUnauthorized':![]}};if(_[_0x4a09('0x61')](_0x428e19[_0x4a09('0x60')][_0x4a09('0x62')])){_0x17a0b4['host']=_0x428e19[_0x4a09('0x60')]['host'];_0x17a0b4[_0x4a09('0x63')]=_0x428e19[_0x4a09('0x60')][_0x4a09('0x63')];_0x17a0b4[_0x4a09('0x64')]=_0x428e19[_0x4a09('0x60')][_0x4a09('0x64')];if(_0x428e19['Smtp'][_0x4a09('0x65')]){_0x17a0b4[_0x4a09('0x66')]={'user':_0x428e19[_0x4a09('0x60')][_0x4a09('0x67')],'pass':_0x428e19['Smtp'][_0x4a09('0x68')]};}}else{_0x17a0b4[_0x4a09('0x62')]=_0x428e19[_0x4a09('0x60')]['service'];_0x17a0b4[_0x4a09('0x66')]={'user':_0x428e19[_0x4a09('0x60')][_0x4a09('0x67')],'pass':_0x428e19[_0x4a09('0x60')][_0x4a09('0x68')]};_0x17a0b4['secure']=_0x428e19[_0x4a09('0x60')]['secure'];}if(_0x5a9114['body'][_0x4a09('0x69')]&&_0x5a9114['body']['attachments'][_0x4a09('0x44')]){for(var _0x4928a7=0x0;_0x4928a7<_0x5a9114[_0x4a09('0x58')][_0x4a09('0x69')][_0x4a09('0x44')];_0x4928a7+=0x1){_0x5a9114[_0x4a09('0x58')][_0x4a09('0x69')][_0x4928a7]={'filename':_0x5a9114[_0x4a09('0x58')]['attachments'][_0x4928a7][_0x4a09('0x38')],'path':path[_0x4a09('0x6a')](config['root'],_0x4a09('0x6b'),_0x5a9114[_0x4a09('0x58')]['attachments'][_0x4928a7][_0x4a09('0x6c')])};}}return{'account':_0x17a0b4,'message':_0x5a9114[_0x4a09('0x58')]};}})[_0x4a09('0x21')](function(_0x27f700){if(_0x27f700){return respondWithRpcPromise('SendMail','sendMail',_0x27f700,client9003)[_0x4a09('0x21')](function(_0x5eb007){return _0x42f64d[_0x4a09('0x35')]({'read':!![],'messageId':_0x5eb007[_0x4a09('0x6d')],'sentAt':moment()[_0x4a09('0x6e')](_0x4a09('0x6f'))});})['catch'](function(_0x5dafb8){logger[_0x4a09('0x27')]('%s',JSON[_0x4a09('0x26')](_0x5dafb8));return _0x42f64d;});}return _0x42f64d;});}return _0x42f64d;}})[_0x4a09('0x21')](respondWithResult(_0x575bfd,0xc9))[_0x4a09('0x2a')](handleError(_0x575bfd,null));};var interaction_log=require(_0x4a09('0x15'))('mail-interactions');exports[_0x4a09('0x70')]=function(_0x3877b0,_0x54a8c2,_0xbb388a){var _0x2f9531={'channel':_0x4a09('0x71')};if(_0x3877b0[_0x4a09('0x58')]['id']){delete _0x3877b0[_0x4a09('0x58')]['id'];}_0x3877b0['body'][_0x4a09('0x72')]=!![];_0x3877b0['body']['readAt']=moment()['format'](_0x4a09('0x6f'));_0x3877b0[_0x4a09('0x58')][_0x4a09('0x73')]=_0x3877b0['body']['UserId']||_0x3877b0[_0x4a09('0x67')]['id'];return db['MailMessage']['find']({'where':{'id':_0x3877b0[_0x4a09('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x4a09('0x74')],'as':_0x4a09('0x75')}]})['then'](handleEntityNotFound(_0x54a8c2,null))[_0x4a09('0x21')](saveUpdates(_0x3877b0[_0x4a09('0x58')],null))[_0x4a09('0x21')](function(_0x399407){if(_0x399407){_0x2f9531[_0x4a09('0x29')]=_0x399407[_0x4a09('0x76')]({'plain':!![]});return db[_0x4a09('0x77')][_0x4a09('0x57')]({'where':{'id':_0x399407[_0x4a09('0x78')]}});}return null;})[_0x4a09('0x21')](handleEntityNotFound(_0x54a8c2,null))[_0x4a09('0x21')](function(_0x2029d5){if(_0x2029d5){return _0x2029d5[_0x4a09('0x35')]({'UserId':_0x3877b0[_0x4a09('0x58')][_0x4a09('0x73')],'read1stAt':_['isNil'](_0x2029d5[_0x4a09('0x79')])?moment()[_0x4a09('0x6e')](_0x4a09('0x6f')):undefined});}return null;})[_0x4a09('0x21')](function(_0x107b4d){if(_0x107b4d){_0x2f9531['interaction']=_0x107b4d[_0x4a09('0x76')]({'plain':!![]});interaction_log[_0x4a09('0x22')](_0x4a09('0x7a'),_0x3877b0['user']['id'],_0x3877b0[_0x4a09('0x67')][_0x4a09('0x38')],_0x3877b0[_0x4a09('0x67')][_0x4a09('0x7b')],_0x2f9531[_0x4a09('0x7c')]['id'],_0x3877b0[_0x4a09('0x58')]?JSON[_0x4a09('0x26')](_0x3877b0[_0x4a09('0x58')]):_0x4a09('0x7d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2f9531);}return null;})[_0x4a09('0x21')](function(_0x4c631d){if(_0x4c631d){if(_0x3877b0[_0x4a09('0x58')][_0x4a09('0x7e')]){_0x2f9531[_0x4a09('0x29')][_0x4a09('0x7f')]=util[_0x4a09('0x6e')](_0x4a09('0x80'),_0x3877b0[_0x4a09('0x67')]['name']);_0x2f9531[_0x4a09('0x29')][_0x4a09('0x81')]=_0x2f9531[_0x4a09('0x81')];_0x2f9531[_0x4a09('0x29')][_0x4a09('0x82')]=_0x4a09('0x70');return respondWithRpcPromise('EventManager',_0x4a09('0x83'),{'event':_0x4a09('0x84'),'message':_0x2f9531['message']},client9002)[_0x4a09('0x21')](function(){return _0x2f9531;});}return _0x2f9531;}return null;})['then'](respondWithResult(_0x54a8c2,null))[_0x4a09('0x2a')](handleError(_0x54a8c2,null));};var interaction_log=require(_0x4a09('0x15'))(_0x4a09('0x85'));exports[_0x4a09('0x33')]=function(_0x4e015e,_0x4fb1cf,_0x2a5105){var _0x5699e6={'agent':{},'channel':_0x4a09('0x71')};if(_0x4e015e['body']['id']){delete _0x4e015e[_0x4a09('0x58')]['id'];}_0x4e015e[_0x4a09('0x58')][_0x4a09('0x73')]=_0x4e015e[_0x4a09('0x58')][_0x4a09('0x73')]||_0x4e015e[_0x4a09('0x67')]['id'];_0x5699e6['agent']['id']=_0x4e015e[_0x4a09('0x58')]['UserId'];return db[_0x4a09('0x3b')][_0x4a09('0x57')]({'where':{'id':_0x4e015e[_0x4a09('0x55')]['id'],'UserId':null}})[_0x4a09('0x21')](handleEntityNotFound(_0x4fb1cf,null))[_0x4a09('0x21')](function(_0x4a1818){if(_0x4a1818){_0x5699e6[_0x4a09('0x29')]=_0x4a1818[_0x4a09('0x76')]({'plain':!![]});return db['MailInteraction'][_0x4a09('0x57')]({'where':{'id':_0x4a1818[_0x4a09('0x78')]}});}return null;})[_0x4a09('0x21')](handleEntityNotFound(_0x4fb1cf,null))[_0x4a09('0x21')](function(_0x3fdd0d){if(_0x3fdd0d){_0x5699e6[_0x4a09('0x7c')]=_0x3fdd0d['get']({'plain':!![]});interaction_log['info'](_0x4a09('0x86'),_0x4e015e['user']['id'],_0x4e015e[_0x4a09('0x67')][_0x4a09('0x38')],_0x4e015e[_0x4a09('0x67')]['role'],_0x5699e6[_0x4a09('0x7c')]['id'],_0x4e015e[_0x4a09('0x58')]?JSON[_0x4a09('0x26')](_0x4e015e['body']):'null');return respondWithRpcPromise(_0x4a09('0x87'),'rejectMessage',_0x5699e6);}return null;})[_0x4a09('0x21')](function(_0x1bf49c){if(_0x1bf49c){_0x1bf49c[_0x4a09('0x29')][_0x4a09('0x7f')]=util[_0x4a09('0x6e')](_0x4a09('0x80'),_0x4e015e['user'][_0x4a09('0x38')]);_0x1bf49c[_0x4a09('0x29')][_0x4a09('0x81')]=_0x5699e6['channel'];_0x1bf49c[_0x4a09('0x29')][_0x4a09('0x82')]=_0x4a09('0x33');respondWithRpcPromise(_0x4a09('0x83'),_0x4a09('0x83'),{'event':_0x4a09('0x88'),'message':_0x1bf49c['message']},client9002);return _0x5699e6;}return null;})[_0x4a09('0x21')](respondWithResult(_0x4fb1cf,null))[_0x4a09('0x2a')](handleError(_0x4fb1cf,null));};exports[_0x4a09('0x89')]=function(_0x5e8e92,_0x2ec5d1){var _0x5b3aed=moment()[_0x4a09('0x8a')]()[_0x4a09('0x8b')]();var _0xb4626a=path['join'](config[_0x4a09('0x8c')],_0x4a09('0x8d'),_0x4a09('0x8e'),_0x4a09('0x8f'));var _0x5f1203=path[_0x4a09('0x6a')](config[_0x4a09('0x8c')],'server',_0x4a09('0x8e'),_0x4a09('0x69'));var _0x258b7e=util[_0x4a09('0x6e')](_0x4a09('0x90'),_0x5b3aed);return db[_0x4a09('0x3b')][_0x4a09('0x57')]({'where':{'id':_0x5e8e92[_0x4a09('0x55')]['id']},'attributes':['id',_0x4a09('0x58'),_0x4a09('0x91'),'to','cc',_0x4a09('0x92'),'subject','createdAt'],'include':_0x5e8e92[_0x4a09('0x3f')][_0x4a09('0x69')]?[{'model':db[_0x4a09('0x93')],'as':_0x4a09('0x94')}]:undefined})[_0x4a09('0x21')](handleEntityNotFound(_0x2ec5d1,null))[_0x4a09('0x21')](function(_0x595ce1){if(_0x595ce1){var _0x59423f=_0x595ce1;var _0x44249a={'from':_0x59423f['from'],'to':_0x59423f['to'],'subject':_0x59423f[_0x4a09('0x95')],'html':_0x59423f[_0x4a09('0x58')],'headers':{'Date':moment(_0x59423f[_0x4a09('0x96')])[_0x4a09('0x6e')](_0x4a09('0x97'))},'attachments':[]};if(_0x595ce1['cc']){_0x44249a[_0x4a09('0x98')]['Cc']=_0x595ce1['cc'];}if(_0x595ce1['bcc']){_0x44249a[_0x4a09('0x98')]['Bcc']=_0x595ce1[_0x4a09('0x92')];}return new BPromise(function(_0x56cb64,_0x299f59){if(_0x595ce1[_0x4a09('0x94')]){for(var _0x30c925=0x0;_0x30c925<_0x595ce1[_0x4a09('0x94')][_0x4a09('0x44')];_0x30c925++){var _0x4197f0=_0x595ce1['Attachments'][_0x30c925];var _0x50e4ec=path[_0x4a09('0x6a')](_0x5f1203,_0x4197f0[_0x4a09('0x6c')]);if(fs[_0x4a09('0x99')](_0x50e4ec)){_0x44249a['attachments'][_0x4a09('0x9a')]({'name':_0x4197f0[_0x4a09('0x38')],'contentType':_0x4197f0['type'],'data':fs[_0x4a09('0x9b')](_0x50e4ec)});}}}emlformat[_0x4a09('0x9c')](_0x44249a,function(_0x5619b3,_0xf7e291){if(_0x5619b3)return _0x299f59(_0x5619b3);fs[_0x4a09('0x9d')](path[_0x4a09('0x6a')](_0xb4626a,_0x258b7e),_0xf7e291);return _0x56cb64(_0xf7e291);});});}})['then'](function(_0x2d2c65){if(_0x2d2c65){return _0x2ec5d1[_0x4a09('0x89')](path[_0x4a09('0x6a')](_0xb4626a,_0x258b7e),_0x258b7e,function(_0x15f10e){if(_0x15f10e){console[_0x4a09('0x9e')](_0x4a09('0x9f'),_0x15f10e);}else{fs[_0x4a09('0xa0')](path[_0x4a09('0x6a')](_0xb4626a,_0x258b7e));}});}})['catch'](handleError(_0x2ec5d1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index acd0289..0ffe0ab 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 _0x50d0=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x3ab4af,_0x67eac7){var _0x3e91d2=function(_0x323051){while(--_0x323051){_0x3ab4af['push'](_0x3ab4af['shift']());}};_0x3e91d2(++_0x67eac7);}(_0x50d0,0x101));var _0x050d=function(_0x53ca1b,_0xce98bf){_0x53ca1b=_0x53ca1b-0x0;var _0x45507f=_0x50d0[_0x53ca1b];return _0x45507f;};'use strict';var EventEmitter=require(_0x050d('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x050d('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x050d('0x2')](0x0);var events={'afterCreate':_0x050d('0x3'),'afterUpdate':_0x050d('0x4'),'afterDestroy':_0x050d('0x5')};function emitEvent(_0x4d3877){return function(_0x3553e3,_0xd37556,_0x5ea985){MailMessageEvents[_0x050d('0x6')](_0x4d3877+':'+_0x3553e3['id'],_0x3553e3);MailMessageEvents[_0x050d('0x6')](_0x4d3877,_0x3553e3);_0x5ea985(null);};}for(var e in events){if(events[_0x050d('0x7')](e)){var event=events[e];MailMessage[_0x050d('0x8')](e,emitEvent(event));}}module[_0x050d('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x20d7=['exports','MailMessage','setMaxListeners','save','hasOwnProperty'];(function(_0x8b47c4,_0x1bb9d9){var _0xdbf1c=function(_0x4662e8){while(--_0x4662e8){_0x8b47c4['push'](_0x8b47c4['shift']());}};_0xdbf1c(++_0x1bb9d9);}(_0x20d7,0x146));var _0x720d=function(_0x35d253,_0x5f250c){_0x35d253=_0x35d253-0x0;var _0xa9d89a=_0x20d7[_0x35d253];return _0xa9d89a;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x720d('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x720d('0x1')](0x0);var events={'afterCreate':_0x720d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b4c54){return function(_0x3a9884,_0x241e8d,_0x4cb8df){MailMessageEvents['emit'](_0x5b4c54+':'+_0x3a9884['id'],_0x3a9884);MailMessageEvents['emit'](_0x5b4c54,_0x3a9884);_0x4cb8df(null);};}for(var e in events){if(events[_0x720d('0x3')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x720d('0x4')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 2514392..d7076fa 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 _0xc5ba=['toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','direction','body','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','exports','define','MailMessage','mail_messages','messageId','models','get'];(function(_0x220cf1,_0x5a4da4){var _0x239ca1=function(_0x42c6bb){while(--_0x42c6bb){_0x220cf1['push'](_0x220cf1['shift']());}};_0x239ca1(++_0x5a4da4);}(_0xc5ba,0x1cf));var _0xac5b=function(_0xba0394,_0x2c6844){_0xba0394=_0xba0394-0x0;var _0x1789dd=_0xc5ba[_0xba0394];return _0x1789dd;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var logger=require(_0xac5b('0x2'))(_0xac5b('0x3'));var moment=require(_0xac5b('0x4'));var BPromise=require(_0xac5b('0x5'));var rp=require('request-promise');var attributes=require('./mailMessage.attributes');module[_0xac5b('0x6')]=function(_0x5e0a93,_0x249470){return _0x5e0a93[_0xac5b('0x7')](_0xac5b('0x8'),attributes,{'tableName':_0xac5b('0x9'),'paranoid':![],'indexes':[{'name':_0xac5b('0xa'),'fields':[_0xac5b('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x214205,_0x83896a,_0x666e4c){var _0x63c7c0=_0x5e0a93[_0xac5b('0xb')];var _0x3c2882=_0x214205[_0xac5b('0xc')]({'plain':!![]});if(_0x3c2882['direction'][_0xac5b('0xd')]()==='in'||_0x3c2882['direction'][_0xac5b('0xd')]()===_0xac5b('0xe')&&!_0x3c2882[_0xac5b('0xf')]&&!_[_0xac5b('0x10')](_0x3c2882[_0xac5b('0x11')])){_0x63c7c0[_0xac5b('0x12')][_0xac5b('0x13')]({'where':{'id':_0x3c2882[_0xac5b('0x14')]}})[_0xac5b('0x15')](function(_0x13c841){if(_0x13c841){_0x13c841['update']({'lastMsgAt':_0x3c2882[_0xac5b('0x16')],'lastMsgDirection':_0x3c2882[_0xac5b('0x17')]['toLowerCase'](),'lastMsgBody':_0x3c2882[_0xac5b('0x18')]});}})['catch'](function(_0x355d4a){console[_0xac5b('0x19')](_0x355d4a);});}_0x666e4c();}},'charset':_0xac5b('0x1a'),'collate':_0xac5b('0x1b')});}; \ No newline at end of file +var _0xdcb2=['bluebird','request-promise','define','MailMessage','mail_messages','messageId','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','update','body','error','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x3bd7ac,_0x20a97b){var _0x20375b=function(_0x5f3d9f){while(--_0x5f3d9f){_0x3bd7ac['push'](_0x3bd7ac['shift']());}};_0x20375b(++_0x20a97b);}(_0xdcb2,0x140));var _0x2dcb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xdcb2[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2dcb('0x0'));var util=require(_0x2dcb('0x1'));var logger=require(_0x2dcb('0x2'))(_0x2dcb('0x3'));var moment=require(_0x2dcb('0x4'));var BPromise=require(_0x2dcb('0x5'));var rp=require(_0x2dcb('0x6'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x4d43d0,_0x41f3b0){return _0x4d43d0[_0x2dcb('0x7')](_0x2dcb('0x8'),attributes,{'tableName':_0x2dcb('0x9'),'paranoid':![],'indexes':[{'name':_0x2dcb('0xa'),'fields':[_0x2dcb('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41b3c8,_0x529623,_0x5963a1){var _0x43bcda=_0x4d43d0[_0x2dcb('0xb')];var _0x37bb93=_0x41b3c8[_0x2dcb('0xc')]({'plain':!![]});if(_0x37bb93[_0x2dcb('0xd')][_0x2dcb('0xe')]()==='in'||_0x37bb93[_0x2dcb('0xd')][_0x2dcb('0xe')]()===_0x2dcb('0xf')&&!_0x37bb93[_0x2dcb('0x10')]&&!_['isNil'](_0x37bb93[_0x2dcb('0x11')])){_0x43bcda[_0x2dcb('0x12')][_0x2dcb('0x13')]({'where':{'id':_0x37bb93[_0x2dcb('0x14')]}})['then'](function(_0x157ace){if(_0x157ace){_0x157ace[_0x2dcb('0x15')]({'lastMsgAt':_0x37bb93['createdAt'],'lastMsgDirection':_0x37bb93['direction'][_0x2dcb('0xe')](),'lastMsgBody':_0x37bb93[_0x2dcb('0x16')]});}})['catch'](function(_0x2dd7e2){console[_0x2dcb('0x17')](_0x2dd7e2);});}_0x5963a1();}},'charset':_0x2dcb('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 69d5447..3657c3a 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 _0x78d3=['message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s'];(function(_0xcb19e1,_0x465489){var _0x121872=function(_0x5c9cd1){while(--_0x5c9cd1){_0xcb19e1['push'](_0xcb19e1['shift']());}};_0x121872(++_0x465489);}(_0x78d3,0x73));var _0x378d=function(_0x53e008,_0x589cdd){_0x53e008=_0x53e008-0x0;var _0x120b99=_0x78d3[_0x53e008];return _0x120b99;};'use strict';var _=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var moment=require(_0x378d('0x2'));var BPromise=require(_0x378d('0x3'));var rs=require(_0x378d('0x4'));var fs=require('fs');var Redis=require(_0x378d('0x5'));var db=require(_0x378d('0x6'))['db'];var utils=require(_0x378d('0x7'));var logger=require(_0x378d('0x8'))(_0x378d('0x9'));var config=require(_0x378d('0xa'));var jayson=require(_0x378d('0xb'));var client=jayson[_0x378d('0xc')][_0x378d('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0x378d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x378d('0xf'))(new Redis(config[_0x378d('0xe')]));require(_0x378d('0x10'))[_0x378d('0x11')](socket);function respondWithRpcPromise(_0x43da5f,_0x12d960,_0x53a4b6){return new BPromise(function(_0x1c4d11,_0x21bf21){return client[_0x378d('0x12')](_0x43da5f,_0x53a4b6)['then'](function(_0x378254){logger['info']('MailMessage,\x20%s,\x20%s',_0x12d960,_0x378d('0x13'));logger[_0x378d('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x12d960,_0x378d('0x13'),JSON[_0x378d('0x15')](_0x378254));if(_0x378254[_0x378d('0x16')]){if(_0x378254['error'][_0x378d('0x17')]===0x1f4){logger['error'](_0x378d('0x18'),_0x12d960,_0x378254[_0x378d('0x16')][_0x378d('0x19')]);return _0x21bf21(_0x378254[_0x378d('0x16')][_0x378d('0x19')]);}logger['error'](_0x378d('0x18'),_0x12d960,_0x378254['error'][_0x378d('0x19')]);return _0x1c4d11(_0x378254[_0x378d('0x16')][_0x378d('0x19')]);}else{logger[_0x378d('0x1a')](_0x378d('0x18'),_0x12d960,'request\x20sent');_0x1c4d11(_0x378254[_0x378d('0x1b')]['message']);}})[_0x378d('0x1c')](function(_0x4067d9){logger[_0x378d('0x16')](_0x378d('0x18'),_0x12d960,_0x4067d9);_0x21bf21(_0x4067d9);});});}exports[_0x378d('0x1d')]=function(_0x11584b){var _0x1c9244=this;return new Promise(function(_0x521d40,_0x5a936c){return db[_0x378d('0x1e')][_0x378d('0x1f')](_0x11584b['body'],{'raw':_0x11584b[_0x378d('0x20')]?_0x11584b[_0x378d('0x20')][_0x378d('0x21')]===undefined?!![]:![]:!![]})[_0x378d('0x22')](function(_0x3acdf9){logger['info'](_0x378d('0x1d'),_0x11584b);logger['debug'](_0x378d('0x1d'),_0x11584b,JSON[_0x378d('0x15')](_0x3acdf9));_0x521d40(_0x3acdf9);})[_0x378d('0x1c')](function(_0x57e2b2){logger[_0x378d('0x16')](_0x378d('0x1d'),_0x57e2b2[_0x378d('0x19')],_0x11584b);_0x5a936c(_0x1c9244['error'](0x1f4,_0x57e2b2[_0x378d('0x19')]));});});}; \ No newline at end of file +var _0xc569=['body','options','raw','then','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create'];(function(_0x4b3c7e,_0x58aef9){var _0x3015af=function(_0x12e3f7){while(--_0x12e3f7){_0x4b3c7e['push'](_0x4b3c7e['shift']());}};_0x3015af(++_0x58aef9);}(_0xc569,0x159));var _0x9c56=function(_0x21e104,_0x3a6a0a){_0x21e104=_0x21e104-0x0;var _0x3541e5=_0xc569[_0x21e104];return _0x3541e5;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});config[_0x9c56('0xb')]=_['defaults'](config[_0x9c56('0xb')],{'host':_0x9c56('0xc'),'port':0x18eb});var socket=require(_0x9c56('0xd'))(new Redis(config[_0x9c56('0xb')]));require(_0x9c56('0xe'))['register'](socket);function respondWithRpcPromise(_0x478bf3,_0x533731,_0x16bc76){return new BPromise(function(_0xee51af,_0x5a6a26){return client[_0x9c56('0xf')](_0x478bf3,_0x16bc76)['then'](function(_0x36cb53){logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));logger[_0x9c56('0x13')](_0x9c56('0x14'),_0x533731,_0x9c56('0x12'),JSON['stringify'](_0x36cb53));if(_0x36cb53[_0x9c56('0x15')]){if(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x16')]===0x1f4){logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53['error'][_0x9c56('0x17')]);return _0x5a6a26(_0x36cb53['error'][_0x9c56('0x17')]);}logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);return _0xee51af(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);}else{logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));_0xee51af(_0x36cb53[_0x9c56('0x18')][_0x9c56('0x17')]);}})[_0x9c56('0x19')](function(_0x8ef95e){logger[_0x9c56('0x15')]('MailMessage,\x20%s,\x20%s',_0x533731,_0x8ef95e);_0x5a6a26(_0x8ef95e);});});}exports[_0x9c56('0x1a')]=function(_0x3b2124){var _0x6d7bf6=this;return new Promise(function(_0x56bf0a,_0xf074f9){return db[_0x9c56('0x1b')][_0x9c56('0x1c')](_0x3b2124[_0x9c56('0x1d')],{'raw':_0x3b2124[_0x9c56('0x1e')]?_0x3b2124[_0x9c56('0x1e')][_0x9c56('0x1f')]===undefined?!![]:![]:!![]})[_0x9c56('0x20')](function(_0x31da15){logger['info'](_0x9c56('0x1a'),_0x3b2124);logger[_0x9c56('0x13')]('CreateMailMessage',_0x3b2124,JSON[_0x9c56('0x21')](_0x31da15));_0x56bf0a(_0x31da15);})[_0x9c56('0x19')](function(_0x399ffc){logger[_0x9c56('0x15')](_0x9c56('0x1a'),_0x399ffc['message'],_0x3b2124);_0xf074f9(_0x6d7bf6['error'](0x1f4,_0x399ffc[_0x9c56('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b306ec3..0276658 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 _0xe160=['removeListener','register','mailMessage:','./mailMessage.events','update'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xe160,0x175));var _0x0e16=function(_0x42203c,_0x18d762){_0x42203c=_0x42203c-0x0;var _0x4ca559=_0xe160[_0x42203c];return _0x4ca559;};'use strict';var MailMessageEvents=require(_0x0e16('0x0'));var events=['save','remove',_0x0e16('0x1')];function createListener(_0x43bbf6,_0x484790){return function(_0x26b5b0){_0x484790['emit'](_0x43bbf6,_0x26b5b0);};}function removeListener(_0x5a1558,_0x20023e){return function(){MailMessageEvents[_0x0e16('0x2')](_0x5a1558,_0x20023e);};}exports[_0x0e16('0x3')]=function(_0xda579e){for(var _0x4620cd=0x0,_0x2e181e=events['length'];_0x4620cd<_0x2e181e;_0x4620cd++){var _0x5cf778=events[_0x4620cd];var _0x4ceec7=createListener(_0x0e16('0x4')+_0x5cf778,_0xda579e);MailMessageEvents['on'](_0x5cf778,_0x4ceec7);}}; \ No newline at end of file +var _0x40b8=['removeListener','register','length','mailMessage:','save','remove','update','emit'];(function(_0x10e151,_0x136e6a){var _0x1a0248=function(_0x41c7f5){while(--_0x41c7f5){_0x10e151['push'](_0x10e151['shift']());}};_0x1a0248(++_0x136e6a);}(_0x40b8,0x194));var _0x840b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x40b8[_0x2112d4];return _0x434972;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x840b('0x0'),_0x840b('0x1'),_0x840b('0x2')];function createListener(_0x3eb6f9,_0x10e1b6){return function(_0x493fd4){_0x10e1b6[_0x840b('0x3')](_0x3eb6f9,_0x493fd4);};}function removeListener(_0x3e377e,_0x2cba8b){return function(){MailMessageEvents[_0x840b('0x4')](_0x3e377e,_0x2cba8b);};}exports[_0x840b('0x5')]=function(_0x524795){for(var _0x28b37c=0x0,_0x1a5dca=events[_0x840b('0x6')];_0x28b37c<_0x1a5dca;_0x28b37c++){var _0x333fdc=events[_0x28b37c];var _0x5ecd6c=createListener(_0x840b('0x7')+_0x333fdc,_0x524795);MailMessageEvents['on'](_0x333fdc,_0x5ecd6c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8148fd8..7300633 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 _0xa19d=['getAgents','post','create','/:id/teams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/users'];(function(_0x1a8c55,_0xaa4cd9){var _0x43ea5d=function(_0x2f3579){while(--_0x2f3579){_0x1a8c55['push'](_0x1a8c55['shift']());}};_0x43ea5d(++_0xaa4cd9);}(_0xa19d,0x177));var _0xda19=function(_0x4df834,_0xdb3878){_0x4df834=_0x4df834-0x0;var _0x2b5c0b=_0xa19d[_0x4df834];return _0x2b5c0b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda19('0x0'));var timeout=require(_0xda19('0x1'));var express=require(_0xda19('0x2'));var router=express[_0xda19('0x3')]();var auth=require(_0xda19('0x4'));var interaction=require(_0xda19('0x5'));var config=require('../../config/environment');var controller=require(_0xda19('0x6'));router[_0xda19('0x7')]('/',auth[_0xda19('0x8')](),controller['index']);router[_0xda19('0x7')](_0xda19('0x9'),auth['isAuthenticated'](),controller[_0xda19('0xa')]);router[_0xda19('0x7')](_0xda19('0xb'),auth[_0xda19('0x8')](),controller[_0xda19('0xc')]);router['get'](_0xda19('0xd'),auth[_0xda19('0x8')](),controller['getMembers']);router[_0xda19('0x7')]('/:id/teams',auth[_0xda19('0x8')](),controller['getTeams']);router[_0xda19('0x7')](_0xda19('0xe'),auth['isAuthenticated'](),controller[_0xda19('0xf')]);router[_0xda19('0x10')]('/',auth[_0xda19('0x8')](),controller[_0xda19('0x11')]);router['post'](_0xda19('0x12'),auth[_0xda19('0x8')](),controller['addTeams']);router[_0xda19('0x10')](_0xda19('0xe'),auth[_0xda19('0x8')](),controller[_0xda19('0x13')]);router['put']('/:id',auth[_0xda19('0x8')](),controller[_0xda19('0x14')]);router[_0xda19('0x15')](_0xda19('0xb'),auth['isAuthenticated'](),controller[_0xda19('0x16')]);router['delete'](_0xda19('0x12'),auth['isAuthenticated'](),controller[_0xda19('0x17')]);router[_0xda19('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xda19('0x18')]);module[_0xda19('0x19')]=router; \ No newline at end of file +var _0xc53a=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0xc53a,0x1f3));var _0xac53=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc53a[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xac53('0x0'));var util=require(_0xac53('0x1'));var path=require(_0xac53('0x2'));var timeout=require(_0xac53('0x3'));var express=require(_0xac53('0x4'));var router=express[_0xac53('0x5')]();var auth=require(_0xac53('0x6'));var interaction=require(_0xac53('0x7'));var config=require(_0xac53('0x8'));var controller=require(_0xac53('0x9'));router[_0xac53('0xa')]('/',auth[_0xac53('0xb')](),controller['index']);router[_0xac53('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xac53('0xc')]);router[_0xac53('0xa')](_0xac53('0xd'),auth['isAuthenticated'](),controller[_0xac53('0xe')]);router[_0xac53('0xa')](_0xac53('0xf'),auth[_0xac53('0xb')](),controller[_0xac53('0x10')]);router['get'](_0xac53('0x11'),auth[_0xac53('0xb')](),controller[_0xac53('0x12')]);router[_0xac53('0xa')]('/:id/users',auth[_0xac53('0xb')](),controller[_0xac53('0x13')]);router[_0xac53('0x14')]('/',auth['isAuthenticated'](),controller[_0xac53('0x15')]);router[_0xac53('0x14')](_0xac53('0x11'),auth[_0xac53('0xb')](),controller[_0xac53('0x16')]);router[_0xac53('0x14')](_0xac53('0x17'),auth['isAuthenticated'](),controller['addAgents']);router[_0xac53('0x18')](_0xac53('0xd'),auth[_0xac53('0xb')](),controller[_0xac53('0x19')]);router[_0xac53('0x1a')](_0xac53('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xac53('0x1a')](_0xac53('0x11'),auth[_0xac53('0xb')](),controller[_0xac53('0x1b')]);router['delete'](_0xac53('0x17'),auth['isAuthenticated'](),controller[_0xac53('0x1c')]);module[_0xac53('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 dbb6e42..4b88eae 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 _0x06c5=['rrmemory','beepall','roundrobin','sequelize','name','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x06c5,0xb1));var _0x506c=function(_0x76b1dd,_0x336235){_0x76b1dd=_0x76b1dd-0x0;var _0x5d3c36=_0x06c5[_0x76b1dd];return _0x5d3c36;};'use strict';var Sequelize=require(_0x506c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x506c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x506c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x506c('0x3'),_0x506c('0x4'),_0x506c('0x5'))}}; \ No newline at end of file +var _0xb82c=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0xb82c,0x6a));var _0xcb82=function(_0xa918dd,_0x92a199){_0xa918dd=_0xa918dd-0x0;var _0x49f32f=_0xb82c[_0xa918dd];return _0x49f32f;};'use strict';var Sequelize=require(_0xcb82('0x0'));module[_0xcb82('0x1')]={'name':{'type':Sequelize[_0xcb82('0x2')],'unique':_0xcb82('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcb82('0x2')]},'timeout':{'type':Sequelize[_0xcb82('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xcb82('0x5'),_0xcb82('0x6'),_0xcb82('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 40cdd48..cc7129e 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 _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x22889a,_0x4b75f7){var _0x763d34=function(_0x2040e5){while(--_0x2040e5){_0x22889a['push'](_0x22889a['shift']());}};_0x763d34(++_0x4b75f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file +var _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x5348bd,_0x1c75c2){var _0x4f2a40=function(_0x580c6d){while(--_0x580c6d){_0x5348bd['push'](_0x5348bd['shift']());}};_0x4f2a40(++_0x1c75c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index bd32e86..b5950e7 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 _0x54b4=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5b3977,_0x4253c6){var _0x5b836c=function(_0x163c16){while(--_0x163c16){_0x5b3977['push'](_0x5b3977['shift']());}};_0x5b836c(++_0x4253c6);}(_0x54b4,0x64));var _0x454b=function(_0x1c3730,_0x95ad81){_0x1c3730=_0x1c3730-0x0;var _0x4c9f36=_0x54b4[_0x1c3730];return _0x4c9f36;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x454b('0x0'))['db'][_0x454b('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x454b('0x2')](0x0);var events={'afterCreate':_0x454b('0x3'),'afterUpdate':_0x454b('0x4'),'afterDestroy':_0x454b('0x5')};function emitEvent(_0x35b282){return function(_0x2f41b0,_0x5ba908,_0x39d299){MailQueueEvents[_0x454b('0x6')](_0x35b282+':'+_0x2f41b0['id'],_0x2f41b0);MailQueueEvents['emit'](_0x35b282,_0x2f41b0);_0x39d299(null);};}for(var e in events){if(events[_0x454b('0x7')](e)){var event=events[e];MailQueue[_0x454b('0x8')](e,emitEvent(event));}}module[_0x454b('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x44c7=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2ad9d9,_0x4713d7){var _0x5d69e1=function(_0x422c9c){while(--_0x422c9c){_0x2ad9d9['push'](_0x2ad9d9['shift']());}};_0x5d69e1(++_0x4713d7);}(_0x44c7,0x81));var _0x744c=function(_0x3c6b07,_0x39d842){_0x3c6b07=_0x3c6b07-0x0;var _0x16d991=_0x44c7[_0x3c6b07];return _0x16d991;};'use strict';var EventEmitter=require(_0x744c('0x0'));var MailQueue=require(_0x744c('0x1'))['db'][_0x744c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x744c('0x3')](0x0);var events={'afterCreate':_0x744c('0x4'),'afterUpdate':_0x744c('0x5'),'afterDestroy':_0x744c('0x6')};function emitEvent(_0x481d59){return function(_0x1fb12e,_0xfb6e8d,_0x24f294){MailQueueEvents[_0x744c('0x7')](_0x481d59+':'+_0x1fb12e['id'],_0x1fb12e);MailQueueEvents[_0x744c('0x7')](_0x481d59,_0x1fb12e);_0x24f294(null);};}for(var e in events){if(events[_0x744c('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x744c('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 50571d0..d2619cf 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 _0xa4b7=['exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailQueue.attributes'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa4b7,0x64));var _0x7a4b=function(_0x3d31a0,_0xfd3b59){_0x3d31a0=_0x3d31a0-0x0;var _0x39eac5=_0xa4b7[_0x3d31a0];return _0x39eac5;};'use strict';var _=require(_0x7a4b('0x0'));var util=require(_0x7a4b('0x1'));var logger=require(_0x7a4b('0x2'))(_0x7a4b('0x3'));var moment=require(_0x7a4b('0x4'));var BPromise=require(_0x7a4b('0x5'));var rp=require(_0x7a4b('0x6'));var attributes=require(_0x7a4b('0x7'));module[_0x7a4b('0x8')]=function(_0x1be11e,_0x35e75a){return _0x1be11e[_0x7a4b('0x9')](_0x7a4b('0xa'),attributes,{'tableName':_0x7a4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x853d=['define','MailQueue','mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','./mailQueue.attributes','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x853d,0x10b));var _0xd853=function(_0x69b218,_0x29e70c){_0x69b218=_0x69b218-0x0;var _0xc986ef=_0x853d[_0x69b218];return _0xc986ef;};'use strict';var _=require(_0xd853('0x0'));var util=require('util');var logger=require(_0xd853('0x1'))(_0xd853('0x2'));var moment=require(_0xd853('0x3'));var BPromise=require(_0xd853('0x4'));var rp=require(_0xd853('0x5'));var attributes=require(_0xd853('0x6'));module[_0xd853('0x7')]=function(_0x4345f3,_0x15defc){return _0x4345f3[_0xd853('0x8')](_0xd853('0x9'),attributes,{'tableName':_0xd853('0xa'),'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 91c2e63..6ecbd69 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 _0xf739=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','findAll','options','where','limit','map','include','model','attributes','ShowMailQueue','MailQueue','find','raw'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xf739,0xaf));var _0x9f73=function(_0x34e030,_0x57c46d){_0x34e030=_0x34e030-0x0;var _0x1a6406=_0xf739[_0x34e030];return _0x1a6406;};'use strict';var _=require(_0x9f73('0x0'));var util=require('util');var moment=require(_0x9f73('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f73('0x3'))['db'];var utils=require(_0x9f73('0x4'));var logger=require(_0x9f73('0x5'))(_0x9f73('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9f73('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9f73('0x8')],{'host':_0x9f73('0x9'),'port':0x18eb});var socket=require(_0x9f73('0xa'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1b3bf4,_0x63d4f4,_0x484b74){return new BPromise(function(_0x17066a,_0x5426e4){return client['request'](_0x1b3bf4,_0x484b74)[_0x9f73('0xb')](function(_0x22d9f3){logger[_0x9f73('0xc')](_0x9f73('0xd'),_0x63d4f4,_0x9f73('0xe'));logger[_0x9f73('0xf')](_0x9f73('0x10'),_0x63d4f4,'request\x20sent',JSON[_0x9f73('0x11')](_0x22d9f3));if(_0x22d9f3['error']){if(_0x22d9f3[_0x9f73('0x12')]['code']===0x1f4){logger[_0x9f73('0x12')](_0x9f73('0xd'),_0x63d4f4,_0x22d9f3[_0x9f73('0x12')][_0x9f73('0x13')]);return _0x5426e4(_0x22d9f3[_0x9f73('0x12')]['message']);}logger[_0x9f73('0x12')](_0x9f73('0xd'),_0x63d4f4,_0x22d9f3[_0x9f73('0x12')][_0x9f73('0x13')]);return _0x17066a(_0x22d9f3[_0x9f73('0x12')][_0x9f73('0x13')]);}else{logger[_0x9f73('0xc')](_0x9f73('0xd'),_0x63d4f4,_0x9f73('0xe'));_0x17066a(_0x22d9f3[_0x9f73('0x14')]['message']);}})[_0x9f73('0x15')](function(_0x304e02){logger[_0x9f73('0x12')](_0x9f73('0xd'),_0x63d4f4,_0x304e02);_0x5426e4(_0x304e02);});});}exports[_0x9f73('0x16')]=function(_0x41484f){var _0xe8e530=this;return new Promise(function(_0x3e9a6b,_0x4ac5dd){return db['MailQueue'][_0x9f73('0x17')]({'raw':_0x41484f[_0x9f73('0x18')]?_0x41484f[_0x9f73('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x41484f[_0x9f73('0x18')]?_0x41484f[_0x9f73('0x18')][_0x9f73('0x19')]||null:null,'attributes':_0x41484f['options']?_0x41484f[_0x9f73('0x18')]['attributes']||null:null,'limit':_0x41484f[_0x9f73('0x18')]?_0x41484f[_0x9f73('0x18')][_0x9f73('0x1a')]||null:null,'include':_0x41484f[_0x9f73('0x18')]?_0x41484f[_0x9f73('0x18')]['include']?_[_0x9f73('0x1b')](_0x41484f[_0x9f73('0x18')][_0x9f73('0x1c')],function(_0x541fd7){return{'model':db[_0x541fd7[_0x9f73('0x1d')]],'as':_0x541fd7['as'],'attributes':_0x541fd7[_0x9f73('0x1e')],'include':_0x541fd7['include']?_[_0x9f73('0x1b')](_0x541fd7[_0x9f73('0x1c')],function(_0x574369){return{'model':db[_0x574369[_0x9f73('0x1d')]],'as':_0x574369['as'],'attributes':_0x574369['attributes'],'include':_0x574369[_0x9f73('0x1c')]?_['map'](_0x574369['include'],function(_0x20a59b){return{'model':db[_0x20a59b[_0x9f73('0x1d')]],'as':_0x20a59b['as'],'attributes':_0x20a59b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f73('0xb')](function(_0x3e5fde){logger[_0x9f73('0xc')]('GetMailQueue',_0x41484f);logger[_0x9f73('0xf')](_0x9f73('0x16'),_0x41484f,JSON['stringify'](_0x3e5fde));_0x3e9a6b(_0x3e5fde);})[_0x9f73('0x15')](function(_0x36798e){logger[_0x9f73('0x12')](_0x9f73('0x16'),_0x36798e[_0x9f73('0x13')],_0x41484f);_0x4ac5dd(_0xe8e530[_0x9f73('0x12')](0x1f4,_0x36798e[_0x9f73('0x13')]));});});};exports[_0x9f73('0x1f')]=function(_0x41c013){var _0x44c78e=this;return new Promise(function(_0xaa740d,_0x4bd1c3){return db[_0x9f73('0x20')][_0x9f73('0x21')]({'raw':_0x41c013[_0x9f73('0x18')]?_0x41c013[_0x9f73('0x18')][_0x9f73('0x22')]===undefined?!![]:![]:!![],'where':_0x41c013['options']?_0x41c013[_0x9f73('0x18')][_0x9f73('0x19')]||null:null,'attributes':_0x41c013[_0x9f73('0x18')]?_0x41c013[_0x9f73('0x18')][_0x9f73('0x1e')]||null:null,'include':_0x41c013['options']?_0x41c013[_0x9f73('0x18')][_0x9f73('0x1c')]?_[_0x9f73('0x1b')](_0x41c013[_0x9f73('0x18')][_0x9f73('0x1c')],function(_0x361d93){return{'model':db[_0x361d93[_0x9f73('0x1d')]],'as':_0x361d93['as'],'attributes':_0x361d93['attributes'],'include':_0x361d93['include']?_[_0x9f73('0x1b')](_0x361d93[_0x9f73('0x1c')],function(_0x4a2dcd){return{'model':db[_0x4a2dcd[_0x9f73('0x1d')]],'as':_0x4a2dcd['as'],'attributes':_0x4a2dcd[_0x9f73('0x1e')],'include':_0x4a2dcd[_0x9f73('0x1c')]?_[_0x9f73('0x1b')](_0x4a2dcd[_0x9f73('0x1c')],function(_0x3d1f1d){return{'model':db[_0x3d1f1d[_0x9f73('0x1d')]],'as':_0x3d1f1d['as'],'attributes':_0x3d1f1d[_0x9f73('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x166a59){logger['info'](_0x9f73('0x1f'),_0x41c013);logger[_0x9f73('0xf')](_0x9f73('0x1f'),_0x41c013,JSON['stringify'](_0x166a59));_0xaa740d(_0x166a59);})[_0x9f73('0x15')](function(_0x3ca531){logger[_0x9f73('0x12')]('ShowMailQueue',_0x3ca531[_0x9f73('0x13')],_0x41c013);_0x4bd1c3(_0x44c78e[_0x9f73('0x12')](0x1f4,_0x3ca531[_0x9f73('0x13')]));});});}; \ No newline at end of file +var _0x9ca3=['include','ShowMailQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','request','then','request\x20sent','debug','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ca3,0xe8));var _0x39ca=function(_0x17bd85,_0x4d6a72){_0x17bd85=_0x17bd85-0x0;var _0x3e17bb=_0x9ca3[_0x17bd85];return _0x3e17bb;};'use strict';var _=require(_0x39ca('0x0'));var util=require('util');var moment=require(_0x39ca('0x1'));var BPromise=require(_0x39ca('0x2'));var rs=require(_0x39ca('0x3'));var fs=require('fs');var Redis=require(_0x39ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39ca('0x5'));var logger=require(_0x39ca('0x6'))(_0x39ca('0x7'));var config=require(_0x39ca('0x8'));var jayson=require(_0x39ca('0x9'));var client=jayson[_0x39ca('0xa')][_0x39ca('0xb')]({'port':0x232a});config['redis']=_[_0x39ca('0xc')](config[_0x39ca('0xd')],{'host':_0x39ca('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39ca('0xd')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1c8a7c,_0x1c2726,_0x4c6b41){return new BPromise(function(_0x144ebe,_0x2d9726){return client[_0x39ca('0xf')](_0x1c8a7c,_0x4c6b41)[_0x39ca('0x10')](function(_0x15f036){logger['info']('MailQueue,\x20%s,\x20%s',_0x1c2726,_0x39ca('0x11'));logger[_0x39ca('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1c2726,_0x39ca('0x11'),JSON[_0x39ca('0x13')](_0x15f036));if(_0x15f036[_0x39ca('0x14')]){if(_0x15f036[_0x39ca('0x14')][_0x39ca('0x15')]===0x1f4){logger[_0x39ca('0x14')](_0x39ca('0x16'),_0x1c2726,_0x15f036[_0x39ca('0x14')][_0x39ca('0x17')]);return _0x2d9726(_0x15f036[_0x39ca('0x14')][_0x39ca('0x17')]);}logger['error'](_0x39ca('0x16'),_0x1c2726,_0x15f036['error'][_0x39ca('0x17')]);return _0x144ebe(_0x15f036[_0x39ca('0x14')][_0x39ca('0x17')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x1c2726,_0x39ca('0x11'));_0x144ebe(_0x15f036[_0x39ca('0x18')][_0x39ca('0x17')]);}})['catch'](function(_0x42841e){logger[_0x39ca('0x14')](_0x39ca('0x16'),_0x1c2726,_0x42841e);_0x2d9726(_0x42841e);});});}exports[_0x39ca('0x19')]=function(_0x750834){var _0x1c5505=this;return new Promise(function(_0x2494ff,_0x179054){return db[_0x39ca('0x1a')]['findAll']({'raw':_0x750834['options']?_0x750834[_0x39ca('0x1b')][_0x39ca('0x1c')]===undefined?!![]:![]:!![],'where':_0x750834[_0x39ca('0x1b')]?_0x750834['options'][_0x39ca('0x1d')]||null:null,'attributes':_0x750834[_0x39ca('0x1b')]?_0x750834[_0x39ca('0x1b')][_0x39ca('0x1e')]||null:null,'limit':_0x750834[_0x39ca('0x1b')]?_0x750834[_0x39ca('0x1b')][_0x39ca('0x1f')]||null:null,'include':_0x750834[_0x39ca('0x1b')]?_0x750834[_0x39ca('0x1b')]['include']?_[_0x39ca('0x20')](_0x750834[_0x39ca('0x1b')]['include'],function(_0x3d777b){return{'model':db[_0x3d777b[_0x39ca('0x21')]],'as':_0x3d777b['as'],'attributes':_0x3d777b[_0x39ca('0x1e')],'include':_0x3d777b['include']?_['map'](_0x3d777b[_0x39ca('0x22')],function(_0x10b270){return{'model':db[_0x10b270[_0x39ca('0x21')]],'as':_0x10b270['as'],'attributes':_0x10b270['attributes'],'include':_0x10b270[_0x39ca('0x22')]?_['map'](_0x10b270[_0x39ca('0x22')],function(_0x5e9e6c){return{'model':db[_0x5e9e6c['model']],'as':_0x5e9e6c['as'],'attributes':_0x5e9e6c['attributes']};}):[]};}):[]};}):[]:[]})[_0x39ca('0x10')](function(_0xc80c33){logger['info'](_0x39ca('0x19'),_0x750834);logger[_0x39ca('0x12')](_0x39ca('0x19'),_0x750834,JSON[_0x39ca('0x13')](_0xc80c33));_0x2494ff(_0xc80c33);})['catch'](function(_0x3d5565){logger[_0x39ca('0x14')](_0x39ca('0x19'),_0x3d5565[_0x39ca('0x17')],_0x750834);_0x179054(_0x1c5505[_0x39ca('0x14')](0x1f4,_0x3d5565['message']));});});};exports[_0x39ca('0x23')]=function(_0xaf5ff6){var _0x4f9dc8=this;return new Promise(function(_0x2debbf,_0x551b96){return db[_0x39ca('0x1a')][_0x39ca('0x24')]({'raw':_0xaf5ff6[_0x39ca('0x1b')]?_0xaf5ff6[_0x39ca('0x1b')][_0x39ca('0x1c')]===undefined?!![]:![]:!![],'where':_0xaf5ff6['options']?_0xaf5ff6[_0x39ca('0x1b')][_0x39ca('0x1d')]||null:null,'attributes':_0xaf5ff6[_0x39ca('0x1b')]?_0xaf5ff6[_0x39ca('0x1b')]['attributes']||null:null,'include':_0xaf5ff6[_0x39ca('0x1b')]?_0xaf5ff6[_0x39ca('0x1b')][_0x39ca('0x22')]?_[_0x39ca('0x20')](_0xaf5ff6[_0x39ca('0x1b')][_0x39ca('0x22')],function(_0x5d2f32){return{'model':db[_0x5d2f32[_0x39ca('0x21')]],'as':_0x5d2f32['as'],'attributes':_0x5d2f32[_0x39ca('0x1e')],'include':_0x5d2f32[_0x39ca('0x22')]?_[_0x39ca('0x20')](_0x5d2f32['include'],function(_0x2a976c){return{'model':db[_0x2a976c[_0x39ca('0x21')]],'as':_0x2a976c['as'],'attributes':_0x2a976c[_0x39ca('0x1e')],'include':_0x2a976c[_0x39ca('0x22')]?_[_0x39ca('0x20')](_0x2a976c[_0x39ca('0x22')],function(_0x4fde4d){return{'model':db[_0x4fde4d['model']],'as':_0x4fde4d['as'],'attributes':_0x4fde4d[_0x39ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x39ca('0x10')](function(_0x46b66c){logger[_0x39ca('0x25')]('ShowMailQueue',_0xaf5ff6);logger[_0x39ca('0x12')](_0x39ca('0x23'),_0xaf5ff6,JSON[_0x39ca('0x13')](_0x46b66c));_0x2debbf(_0x46b66c);})['catch'](function(_0x3145cf){logger[_0x39ca('0x14')](_0x39ca('0x23'),_0x3145cf[_0x39ca('0x17')],_0xaf5ff6);_0x551b96(_0x4f9dc8[_0x39ca('0x14')](0x1f4,_0x3145cf[_0x39ca('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 0cacfca..3a7d39f 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 _0x1006=['mailQueue:','./mailQueue.events','save','remove','update','emit','register','length'];(function(_0x501f4d,_0x51b9d9){var _0x199d85=function(_0x4c8370){while(--_0x4c8370){_0x501f4d['push'](_0x501f4d['shift']());}};_0x199d85(++_0x51b9d9);}(_0x1006,0x1e9));var _0x6100=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1006[_0x3ab51d];return _0x29a04e;};'use strict';var MailQueueEvents=require(_0x6100('0x0'));var events=[_0x6100('0x1'),_0x6100('0x2'),_0x6100('0x3')];function createListener(_0x296e06,_0x4fc4a4){return function(_0x228bab){_0x4fc4a4[_0x6100('0x4')](_0x296e06,_0x228bab);};}function removeListener(_0x1bdb26,_0x42f7e3){return function(){MailQueueEvents['removeListener'](_0x1bdb26,_0x42f7e3);};}exports[_0x6100('0x5')]=function(_0x34409){for(var _0x360205=0x0,_0x28d5cd=events[_0x6100('0x6')];_0x360205<_0x28d5cd;_0x360205++){var _0x1c75db=events[_0x360205];var _0xdf48ba=createListener(_0x6100('0x7')+_0x1c75db,_0x34409);MailQueueEvents['on'](_0x1c75db,_0xdf48ba);}}; \ No newline at end of file +var _0x63bc=['remove','update','register','mailQueue:','./mailQueue.events'];(function(_0x9545e3,_0x41e1e8){var _0x6d8667=function(_0x211b1b){while(--_0x211b1b){_0x9545e3['push'](_0x9545e3['shift']());}};_0x6d8667(++_0x41e1e8);}(_0x63bc,0x180));var _0xc63b=function(_0xa6ac74,_0x33b897){_0xa6ac74=_0xa6ac74-0x0;var _0x3b52cf=_0x63bc[_0xa6ac74];return _0x3b52cf;};'use strict';var MailQueueEvents=require(_0xc63b('0x0'));var events=['save',_0xc63b('0x1'),_0xc63b('0x2')];function createListener(_0xe02d37,_0x3ec799){return function(_0x151506){_0x3ec799['emit'](_0xe02d37,_0x151506);};}function removeListener(_0x1183ec,_0x5d4c66){return function(){MailQueueEvents['removeListener'](_0x1183ec,_0x5d4c66);};}exports[_0xc63b('0x3')]=function(_0x225684){for(var _0x3b59d5=0x0,_0xcf64a=events['length'];_0x3b59d5<_0xcf64a;_0x3b59d5++){var _0xa50805=events[_0x3b59d5];var _0x2f2ba7=createListener(_0xc63b('0x4')+_0xa50805,_0x225684);MailQueueEvents['on'](_0xa50805,_0x2f2ba7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 47069c7..b37eff9 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 _0xae45=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xae45,0x69));var _0x5ae4=function(_0x74f408,_0x30df2c){_0x74f408=_0x74f408-0x0;var _0x48628c=_0xae45[_0x74f408];return _0x48628c;};'use strict';var multer=require(_0x5ae4('0x0'));var util=require('util');var path=require(_0x5ae4('0x1'));var timeout=require(_0x5ae4('0x2'));var express=require('express');var router=express[_0x5ae4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ae4('0x4'));var config=require(_0x5ae4('0x5'));var controller=require(_0x5ae4('0x6'));router[_0x5ae4('0x7')]('/',auth[_0x5ae4('0x8')](),controller['index']);router[_0x5ae4('0x7')](_0x5ae4('0x9'),auth[_0x5ae4('0x8')](),controller[_0x5ae4('0xa')]);router[_0x5ae4('0x7')]('/:id',auth[_0x5ae4('0x8')](),controller['show']);router[_0x5ae4('0xb')]('/',auth[_0x5ae4('0x8')](),controller[_0x5ae4('0xc')]);router[_0x5ae4('0xd')]('/:id',auth[_0x5ae4('0x8')](),controller['update']);router[_0x5ae4('0xe')]('/:id',auth[_0x5ae4('0x8')](),controller[_0x5ae4('0xf')]);module[_0x5ae4('0x10')]=router; \ No newline at end of file +var _0x712c=['destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailQueueReport.controller','/describe','isAuthenticated','describe','get','show','post','create','put','update','delete','/:id'];(function(_0x2c5971,_0x69e0b){var _0x29e97c=function(_0x1f7113){while(--_0x1f7113){_0x2c5971['push'](_0x2c5971['shift']());}};_0x29e97c(++_0x69e0b);}(_0x712c,0xdd));var _0xc712=function(_0x1b3a14,_0x5d54b3){_0x1b3a14=_0x1b3a14-0x0;var _0x39c132=_0x712c[_0x1b3a14];return _0x39c132;};'use strict';var multer=require(_0xc712('0x0'));var util=require(_0xc712('0x1'));var path=require(_0xc712('0x2'));var timeout=require(_0xc712('0x3'));var express=require(_0xc712('0x4'));var router=express[_0xc712('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc712('0x6'));var config=require('../../config/environment');var controller=require(_0xc712('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc712('0x8'),auth[_0xc712('0x9')](),controller[_0xc712('0xa')]);router[_0xc712('0xb')]('/:id',auth[_0xc712('0x9')](),controller[_0xc712('0xc')]);router[_0xc712('0xd')]('/',auth[_0xc712('0x9')](),controller[_0xc712('0xe')]);router[_0xc712('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc712('0x10')]);router[_0xc712('0x11')](_0xc712('0x12'),auth[_0xc712('0x9')](),controller[_0xc712('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 9b5bcdd..34c6f51 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 _0xb1f5=['sequelize','exports','STRING','DATE'];(function(_0x2fb74f,_0x2f053e){var _0x442ccd=function(_0x27d240){while(--_0x27d240){_0x2fb74f['push'](_0x2fb74f['shift']());}};_0x442ccd(++_0x2f053e);}(_0xb1f5,0x110));var _0x5b1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1f5[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b1f('0x0'));module[_0x5b1f('0x1')]={'uniqueid':{'type':Sequelize[_0x5b1f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5b1f('0x2')]},'joinAt':{'type':Sequelize[_0x5b1f('0x3')]},'leaveAt':{'type':Sequelize[_0x5b1f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5b1f('0x3')]},'reason':{'type':Sequelize[_0x5b1f('0x2')]}}; \ No newline at end of file +var _0xae67=['STRING','DATE','sequelize','exports'];(function(_0x1289a7,_0x21f994){var _0x4bf3f2=function(_0xeaf9e4){while(--_0xeaf9e4){_0x1289a7['push'](_0x1289a7['shift']());}};_0x4bf3f2(++_0x21f994);}(_0xae67,0xc6));var _0x7ae6=function(_0x199a44,_0x150347){_0x199a44=_0x199a44-0x0;var _0x276612=_0xae67[_0x199a44];return _0x276612;};'use strict';var moment=require('moment');var Sequelize=require(_0x7ae6('0x0'));module[_0x7ae6('0x1')]={'uniqueid':{'type':Sequelize[_0x7ae6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7ae6('0x2')]},'joinAt':{'type':Sequelize[_0x7ae6('0x3')]},'leaveAt':{'type':Sequelize[_0x7ae6('0x3')]},'acceptAt':{'type':Sequelize[_0x7ae6('0x3')]},'exitAt':{'type':Sequelize[_0x7ae6('0x3')]},'reason':{'type':Sequelize[_0x7ae6('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3e79b64..cd90145 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 _0xf928=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','stack','rawAttributes','model','query','keys','intersection','attributes','fields','length','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','MailQueueReport','include','show','params','includeAll','find','create','body','catch','describe','eml-format','rimraf'];(function(_0x44fe8f,_0x46c7e8){var _0x397ce3=function(_0x5e0e9f){while(--_0x5e0e9f){_0x44fe8f['push'](_0x44fe8f['shift']());}};_0x397ce3(++_0x46c7e8);}(_0xf928,0x10e));var _0x8f92=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf928[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8f92('0x0'));var rimraf=require(_0x8f92('0x1'));var zipdir=require(_0x8f92('0x2'));var jsonpatch=require(_0x8f92('0x3'));var rp=require(_0x8f92('0x4'));var moment=require(_0x8f92('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f92('0x6'));var util=require(_0x8f92('0x7'));var path=require(_0x8f92('0x8'));var sox=require(_0x8f92('0x9'));var csv=require('to-csv');var ejs=require(_0x8f92('0xa'));var fs=require('fs');var _=require(_0x8f92('0xb'));var squel=require(_0x8f92('0xc'));var crypto=require(_0x8f92('0xd'));var jsforce=require(_0x8f92('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8f92('0xf'));var querystring=require(_0x8f92('0x10'));var Papa=require('papaparse');var authService=require(_0x8f92('0x11'));var hardwareService=require(_0x8f92('0x12'));var Redis=require(_0x8f92('0x13'));var qs=require(_0x8f92('0x14'));var logger=require('../../config/logger')(_0x8f92('0x15'));var utils=require(_0x8f92('0x16'));var config=require(_0x8f92('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347b09,_0x5a793c){_0x5a793c=_0x5a793c||0xcc;return function(_0x524ca8){if(_0x524ca8){return _0x347b09[_0x8f92('0x18')](_0x5a793c);}return _0x347b09[_0x8f92('0x19')](_0x5a793c)[_0x8f92('0x1a')]();};}function respondWithResult(_0x5032ca,_0x1f0451){_0x1f0451=_0x1f0451||0xc8;return function(_0x55a723){if(_0x55a723){return _0x5032ca[_0x8f92('0x19')](_0x1f0451)['json'](_0x55a723);}};}function respondWithFilteredResult(_0x242214,_0x5e3505){return function(_0x4ab542){if(_0x4ab542){var _0x186255=_0x4ab542[_0x8f92('0x1b')],_0x47fc71=_0x5e3505[_0x8f92('0x1c')],_0x53d8d3=_0x5e3505[_0x8f92('0x1c')]+_0x5e3505[_0x8f92('0x1d')],_0x32ebde;if(_0x53d8d3>=_0x186255){_0x53d8d3=_0x186255;_0x32ebde=0xc8;}else{_0x32ebde=0xce;}_0x242214['status'](_0x32ebde);return _0x242214[_0x8f92('0x1e')](_0x8f92('0x1f'),_0x47fc71+'-'+_0x53d8d3+'/'+_0x186255)[_0x8f92('0x20')](_0x4ab542);}return null;};}function patchUpdates(_0x3261f3){return function(_0x1dbd3b){try{jsonpatch[_0x8f92('0x21')](_0x1dbd3b,_0x3261f3,!![]);}catch(_0x548d74){return BPromise['reject'](_0x548d74);}return _0x1dbd3b[_0x8f92('0x22')]();};}function saveUpdates(_0x441aaa,_0x5ee0f2){return function(_0x629c74){if(_0x629c74){return _0x629c74[_0x8f92('0x23')](_0x441aaa)['then'](function(_0x2c6121){return _0x2c6121;});}return null;};}function removeEntity(_0xf82454,_0x11f6ed){return function(_0x2ec82e){if(_0x2ec82e){return _0x2ec82e[_0x8f92('0x24')]()[_0x8f92('0x25')](function(){_0xf82454[_0x8f92('0x19')](0xcc)[_0x8f92('0x1a')]();});}};}function handleEntityNotFound(_0x38f973,_0x24e405){return function(_0x234e05){if(!_0x234e05){_0x38f973[_0x8f92('0x18')](0x194);}return _0x234e05;};}function handleError(_0x2ec3ae,_0x2f5c9e){_0x2f5c9e=_0x2f5c9e||0x1f4;return function(_0x196d0b){logger['error'](_0x196d0b[_0x8f92('0x26')]);if(_0x196d0b['name']){delete _0x196d0b['name'];}_0x2ec3ae[_0x8f92('0x19')](_0x2f5c9e)['send'](_0x196d0b);};}exports['index']=function(_0x3455e9,_0xb82aa3){var _0x993848={},_0x3b25a5={},_0x3f8815={'count':0x0,'rows':[]};var _0x20ba44=db['MailQueueReport'][_0x8f92('0x27')];_0x3b25a5[_0x8f92('0x28')]=_['keys'](_0x20ba44);_0x3b25a5[_0x8f92('0x29')]=_[_0x8f92('0x2a')](_0x3455e9[_0x8f92('0x29')]);_0x3b25a5['filters']=_[_0x8f92('0x2b')](_0x3b25a5[_0x8f92('0x28')],_0x3b25a5[_0x8f92('0x29')]);_0x993848[_0x8f92('0x2c')]=_['intersection'](_0x3b25a5[_0x8f92('0x28')],qs[_0x8f92('0x2d')](_0x3455e9[_0x8f92('0x29')][_0x8f92('0x2d')]));_0x993848[_0x8f92('0x2c')]=_0x993848[_0x8f92('0x2c')][_0x8f92('0x2e')]?_0x993848[_0x8f92('0x2c')]:_0x3b25a5[_0x8f92('0x28')];if(!_0x3455e9[_0x8f92('0x29')]['hasOwnProperty']('nolimit')){_0x993848[_0x8f92('0x1d')]=qs[_0x8f92('0x1d')](_0x3455e9[_0x8f92('0x29')]['limit']);_0x993848['offset']=qs[_0x8f92('0x1c')](_0x3455e9['query'][_0x8f92('0x1c')]);}_0x993848['order']=qs['sort'](_0x3455e9[_0x8f92('0x29')]['sort']);_0x993848[_0x8f92('0x2f')]=qs[_0x8f92('0x30')](_[_0x8f92('0x31')](_0x3455e9[_0x8f92('0x29')],_0x3b25a5['filters']));if(_0x3455e9[_0x8f92('0x29')][_0x8f92('0x32')]){_0x993848[_0x8f92('0x2f')]=_[_0x8f92('0x33')](_0x993848[_0x8f92('0x2f')],{'$or':_[_0x8f92('0x34')](_0x20ba44,function(_0x57ea64){if(_0x57ea64[_0x8f92('0x35')][_0x8f92('0x36')]!==_0x8f92('0x37')){var _0x148ca2={};_0x148ca2[_0x57ea64[_0x8f92('0x38')]]={'$like':'%'+_0x3455e9[_0x8f92('0x29')][_0x8f92('0x32')]+'%'};return _0x148ca2;}})});}_0x993848=_['merge']({},_0x993848,_0x3455e9[_0x8f92('0x39')]);var _0x41237e={'where':_0x993848[_0x8f92('0x2f')]};return db[_0x8f92('0x3a')][_0x8f92('0x1b')](_0x41237e)[_0x8f92('0x25')](function(_0x48c46d){_0x3f8815[_0x8f92('0x1b')]=_0x48c46d;if(_0x3455e9[_0x8f92('0x29')]['includeAll']){_0x993848[_0x8f92('0x3b')]=[{'all':!![]}];}return db[_0x8f92('0x3a')]['findAll'](_0x993848);})[_0x8f92('0x25')](function(_0x2621bb){_0x3f8815['rows']=_0x2621bb;return _0x3f8815;})[_0x8f92('0x25')](respondWithFilteredResult(_0xb82aa3,_0x993848))['catch'](handleError(_0xb82aa3,null));};exports[_0x8f92('0x3c')]=function(_0x3ed623,_0x24e902){var _0x6f6822={'raw':!![],'where':{'id':_0x3ed623[_0x8f92('0x3d')]['id']}},_0x43fd29={};_0x43fd29[_0x8f92('0x28')]=_[_0x8f92('0x2a')](db[_0x8f92('0x3a')]['rawAttributes']);_0x43fd29[_0x8f92('0x29')]=_[_0x8f92('0x2a')](_0x3ed623['query']);_0x43fd29[_0x8f92('0x30')]=_[_0x8f92('0x2b')](_0x43fd29[_0x8f92('0x28')],_0x43fd29[_0x8f92('0x29')]);_0x6f6822['attributes']=_['intersection'](_0x43fd29[_0x8f92('0x28')],qs[_0x8f92('0x2d')](_0x3ed623[_0x8f92('0x29')][_0x8f92('0x2d')]));_0x6f6822[_0x8f92('0x2c')]=_0x6f6822[_0x8f92('0x2c')]['length']?_0x6f6822[_0x8f92('0x2c')]:_0x43fd29['model'];if(_0x3ed623[_0x8f92('0x29')][_0x8f92('0x3e')]){_0x6f6822['include']=[{'all':!![]}];}_0x6f6822=_[_0x8f92('0x33')]({},_0x6f6822,_0x3ed623[_0x8f92('0x39')]);return db['MailQueueReport'][_0x8f92('0x3f')](_0x6f6822)['then'](handleEntityNotFound(_0x24e902,null))[_0x8f92('0x25')](respondWithResult(_0x24e902,null))['catch'](handleError(_0x24e902,null));};exports[_0x8f92('0x40')]=function(_0x575318,_0x275ad5){return db[_0x8f92('0x3a')][_0x8f92('0x40')](_0x575318[_0x8f92('0x41')],{})[_0x8f92('0x25')](respondWithResult(_0x275ad5,0xc9))[_0x8f92('0x42')](handleError(_0x275ad5,null));};exports[_0x8f92('0x23')]=function(_0x2573ab,_0x20e745){if(_0x2573ab[_0x8f92('0x41')]['id']){delete _0x2573ab['body']['id'];}return db[_0x8f92('0x3a')][_0x8f92('0x3f')]({'where':{'id':_0x2573ab[_0x8f92('0x3d')]['id']}})['then'](handleEntityNotFound(_0x20e745,null))[_0x8f92('0x25')](saveUpdates(_0x2573ab['body'],null))['then'](respondWithResult(_0x20e745,null))[_0x8f92('0x42')](handleError(_0x20e745,null));};exports[_0x8f92('0x24')]=function(_0xf85042,_0xc21e93){return db[_0x8f92('0x3a')]['find']({'where':{'id':_0xf85042[_0x8f92('0x3d')]['id']}})[_0x8f92('0x25')](handleEntityNotFound(_0xc21e93,null))[_0x8f92('0x25')](removeEntity(_0xc21e93,null))[_0x8f92('0x42')](handleError(_0xc21e93,null));};exports[_0x8f92('0x43')]=function(_0x467e8e,_0x2ea62e){return db[_0x8f92('0x3a')][_0x8f92('0x43')]()[_0x8f92('0x25')](respondWithResult(_0x2ea62e,null))[_0x8f92('0x42')](handleError(_0x2ea62e,null));}; \ No newline at end of file +var _0x573f=['filter','where','merge','type','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','status','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','MailQueueReport','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','limit','order','filters','pick'];(function(_0x5d8de7,_0x1cd195){var _0x55df29=function(_0x20e6d9){while(--_0x20e6d9){_0x5d8de7['push'](_0x5d8de7['shift']());}};_0x55df29(++_0x1cd195);}(_0x573f,0x122));var _0xf573=function(_0x2a04bf,_0x4fb891){_0x2a04bf=_0x2a04bf-0x0;var _0x319a71=_0x573f[_0x2a04bf];return _0x319a71;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf573('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf573('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf573('0x2'));var moment=require(_0xf573('0x3'));var BPromise=require(_0xf573('0x4'));var Mustache=require('mustache');var util=require(_0xf573('0x5'));var path=require(_0xf573('0x6'));var sox=require('sox');var csv=require(_0xf573('0x7'));var ejs=require(_0xf573('0x8'));var fs=require('fs');var _=require(_0xf573('0x9'));var squel=require(_0xf573('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf573('0xb'));var toCsv=require(_0xf573('0x7'));var querystring=require(_0xf573('0xc'));var Papa=require(_0xf573('0xd'));var authService=require(_0xf573('0xe'));var hardwareService=require(_0xf573('0xf'));var Redis=require(_0xf573('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xf573('0x11'))(_0xf573('0x12'));var utils=require(_0xf573('0x13'));var config=require(_0xf573('0x14'));var db=require(_0xf573('0x15'))['db'];function respondWithStatusCode(_0x1dcf5f,_0x51a6ba){_0x51a6ba=_0x51a6ba||0xcc;return function(_0x16e207){if(_0x16e207){return _0x1dcf5f['sendStatus'](_0x51a6ba);}return _0x1dcf5f['status'](_0x51a6ba)[_0xf573('0x16')]();};}function respondWithResult(_0x2d8a2d,_0xecb86f){_0xecb86f=_0xecb86f||0xc8;return function(_0x5ef118){if(_0x5ef118){return _0x2d8a2d['status'](_0xecb86f)[_0xf573('0x17')](_0x5ef118);}};}function respondWithFilteredResult(_0x537ce9,_0x236b68){return function(_0x24d37a){if(_0x24d37a){var _0x3f0e95=_0x24d37a[_0xf573('0x18')],_0x42db72=_0x236b68[_0xf573('0x19')],_0x4e619d=_0x236b68[_0xf573('0x19')]+_0x236b68['limit'],_0x38c89a;if(_0x4e619d>=_0x3f0e95){_0x4e619d=_0x3f0e95;_0x38c89a=0xc8;}else{_0x38c89a=0xce;}_0x537ce9[_0xf573('0x1a')](_0x38c89a);return _0x537ce9[_0xf573('0x1b')](_0xf573('0x1c'),_0x42db72+'-'+_0x4e619d+'/'+_0x3f0e95)[_0xf573('0x17')](_0x24d37a);}return null;};}function patchUpdates(_0x41f38e){return function(_0x1a0309){try{jsonpatch['apply'](_0x1a0309,_0x41f38e,!![]);}catch(_0x54d72f){return BPromise[_0xf573('0x1d')](_0x54d72f);}return _0x1a0309[_0xf573('0x1e')]();};}function saveUpdates(_0x285e03,_0x123cb7){return function(_0x47c8a2){if(_0x47c8a2){return _0x47c8a2['update'](_0x285e03)[_0xf573('0x1f')](function(_0x202d4b){return _0x202d4b;});}return null;};}function removeEntity(_0x5dd7d8,_0x87d719){return function(_0x156ec0){if(_0x156ec0){return _0x156ec0[_0xf573('0x20')]()['then'](function(){_0x5dd7d8['status'](0xcc)[_0xf573('0x16')]();});}};}function handleEntityNotFound(_0x430716,_0xc08a41){return function(_0x5b8d60){if(!_0x5b8d60){_0x430716[_0xf573('0x21')](0x194);}return _0x5b8d60;};}function handleError(_0x58c883,_0x29fd31){_0x29fd31=_0x29fd31||0x1f4;return function(_0x5e8b7e){logger[_0xf573('0x22')](_0x5e8b7e['stack']);if(_0x5e8b7e['name']){delete _0x5e8b7e[_0xf573('0x23')];}_0x58c883[_0xf573('0x1a')](_0x29fd31)['send'](_0x5e8b7e);};}exports['index']=function(_0x57fe5b,_0xacc0d7){var _0x16d395={},_0x44adf8={},_0x4092f4={'count':0x0,'rows':[]};var _0x474985=db[_0xf573('0x24')][_0xf573('0x25')];_0x44adf8[_0xf573('0x26')]=_[_0xf573('0x27')](_0x474985);_0x44adf8[_0xf573('0x28')]=_[_0xf573('0x27')](_0x57fe5b[_0xf573('0x28')]);_0x44adf8['filters']=_['intersection'](_0x44adf8[_0xf573('0x26')],_0x44adf8['query']);_0x16d395[_0xf573('0x29')]=_[_0xf573('0x2a')](_0x44adf8[_0xf573('0x26')],qs[_0xf573('0x2b')](_0x57fe5b[_0xf573('0x28')][_0xf573('0x2b')]));_0x16d395[_0xf573('0x29')]=_0x16d395[_0xf573('0x29')][_0xf573('0x2c')]?_0x16d395[_0xf573('0x29')]:_0x44adf8[_0xf573('0x26')];if(!_0x57fe5b['query']['hasOwnProperty'](_0xf573('0x2d'))){_0x16d395[_0xf573('0x2e')]=qs[_0xf573('0x2e')](_0x57fe5b[_0xf573('0x28')][_0xf573('0x2e')]);_0x16d395['offset']=qs[_0xf573('0x19')](_0x57fe5b['query'][_0xf573('0x19')]);}_0x16d395[_0xf573('0x2f')]=qs['sort'](_0x57fe5b['query']['sort']);_0x16d395['where']=qs[_0xf573('0x30')](_[_0xf573('0x31')](_0x57fe5b['query'],_0x44adf8['filters']));if(_0x57fe5b['query'][_0xf573('0x32')]){_0x16d395[_0xf573('0x33')]=_[_0xf573('0x34')](_0x16d395['where'],{'$or':_['map'](_0x474985,function(_0x58ff55){if(_0x58ff55[_0xf573('0x35')]['key']!==_0xf573('0x36')){var _0x21432b={};_0x21432b[_0x58ff55[_0xf573('0x37')]]={'$like':'%'+_0x57fe5b[_0xf573('0x28')][_0xf573('0x32')]+'%'};return _0x21432b;}})});}_0x16d395=_[_0xf573('0x34')]({},_0x16d395,_0x57fe5b[_0xf573('0x38')]);var _0x5d30e3={'where':_0x16d395[_0xf573('0x33')]};return db[_0xf573('0x24')][_0xf573('0x18')](_0x5d30e3)[_0xf573('0x1f')](function(_0x18ff47){_0x4092f4[_0xf573('0x18')]=_0x18ff47;if(_0x57fe5b['query']['includeAll']){_0x16d395[_0xf573('0x39')]=[{'all':!![]}];}return db[_0xf573('0x24')][_0xf573('0x3a')](_0x16d395);})[_0xf573('0x1f')](function(_0x130cd0){_0x4092f4[_0xf573('0x3b')]=_0x130cd0;return _0x4092f4;})[_0xf573('0x1f')](respondWithFilteredResult(_0xacc0d7,_0x16d395))[_0xf573('0x3c')](handleError(_0xacc0d7,null));};exports[_0xf573('0x3d')]=function(_0x5441c6,_0x211986){var _0x30644a={'raw':!![],'where':{'id':_0x5441c6[_0xf573('0x3e')]['id']}},_0x1eaf5d={};_0x1eaf5d[_0xf573('0x26')]=_['keys'](db[_0xf573('0x24')]['rawAttributes']);_0x1eaf5d[_0xf573('0x28')]=_[_0xf573('0x27')](_0x5441c6[_0xf573('0x28')]);_0x1eaf5d[_0xf573('0x30')]=_[_0xf573('0x2a')](_0x1eaf5d[_0xf573('0x26')],_0x1eaf5d[_0xf573('0x28')]);_0x30644a[_0xf573('0x29')]=_[_0xf573('0x2a')](_0x1eaf5d[_0xf573('0x26')],qs[_0xf573('0x2b')](_0x5441c6[_0xf573('0x28')]['fields']));_0x30644a[_0xf573('0x29')]=_0x30644a[_0xf573('0x29')]['length']?_0x30644a[_0xf573('0x29')]:_0x1eaf5d[_0xf573('0x26')];if(_0x5441c6['query'][_0xf573('0x3f')]){_0x30644a[_0xf573('0x39')]=[{'all':!![]}];}_0x30644a=_[_0xf573('0x34')]({},_0x30644a,_0x5441c6[_0xf573('0x38')]);return db[_0xf573('0x24')][_0xf573('0x40')](_0x30644a)[_0xf573('0x1f')](handleEntityNotFound(_0x211986,null))['then'](respondWithResult(_0x211986,null))[_0xf573('0x3c')](handleError(_0x211986,null));};exports['create']=function(_0xab034f,_0x49f6f4){return db[_0xf573('0x24')][_0xf573('0x41')](_0xab034f[_0xf573('0x42')],{})[_0xf573('0x1f')](respondWithResult(_0x49f6f4,0xc9))[_0xf573('0x3c')](handleError(_0x49f6f4,null));};exports['update']=function(_0x383a69,_0x86c6e7){if(_0x383a69[_0xf573('0x42')]['id']){delete _0x383a69[_0xf573('0x42')]['id'];}return db[_0xf573('0x24')][_0xf573('0x40')]({'where':{'id':_0x383a69[_0xf573('0x3e')]['id']}})[_0xf573('0x1f')](handleEntityNotFound(_0x86c6e7,null))[_0xf573('0x1f')](saveUpdates(_0x383a69['body'],null))['then'](respondWithResult(_0x86c6e7,null))[_0xf573('0x3c')](handleError(_0x86c6e7,null));};exports[_0xf573('0x20')]=function(_0x12f627,_0x47b1e8){return db[_0xf573('0x24')][_0xf573('0x40')]({'where':{'id':_0x12f627['params']['id']}})[_0xf573('0x1f')](handleEntityNotFound(_0x47b1e8,null))[_0xf573('0x1f')](removeEntity(_0x47b1e8,null))[_0xf573('0x3c')](handleError(_0x47b1e8,null));};exports[_0xf573('0x43')]=function(_0x3977f0,_0xf8d6d8){return db[_0xf573('0x24')]['describe']()[_0xf573('0x1f')](respondWithResult(_0xf8d6d8,null))['catch'](handleError(_0xf8d6d8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a20d0d6..edf08d5 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 _0xcfca=['bluebird','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x17a7a5,_0x46b5c1){var _0x152d79=function(_0x5915a9){while(--_0x5915a9){_0x17a7a5['push'](_0x17a7a5['shift']());}};_0x152d79(++_0x46b5c1);}(_0xcfca,0x150));var _0xacfc=function(_0x2ff1e9,_0x4bfcd5){_0x2ff1e9=_0x2ff1e9-0x0;var _0x59285c=_0xcfca[_0x2ff1e9];return _0x59285c;};'use strict';var _=require(_0xacfc('0x0'));var util=require(_0xacfc('0x1'));var logger=require(_0xacfc('0x2'))('api');var moment=require(_0xacfc('0x3'));var BPromise=require(_0xacfc('0x4'));var rp=require('request-promise');var attributes=require(_0xacfc('0x5'));module[_0xacfc('0x6')]=function(_0x394431,_0x226a05){return _0x394431[_0xacfc('0x7')](_0xacfc('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xacfc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1327=['util','../../config/logger','api','moment','bluebird','request-promise','./mailQueueReport.attributes','exports','uniqueid','lodash'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x1327,0xa9));var _0x7132=function(_0x13a42e,_0x168629){_0x13a42e=_0x13a42e-0x0;var _0x498429=_0x1327[_0x13a42e];return _0x498429;};'use strict';var _=require(_0x7132('0x0'));var util=require(_0x7132('0x1'));var logger=require(_0x7132('0x2'))(_0x7132('0x3'));var moment=require(_0x7132('0x4'));var BPromise=require(_0x7132('0x5'));var rp=require(_0x7132('0x6'));var attributes=require(_0x7132('0x7'));module[_0x7132('0x8')]=function(_0x1970c7,_0x544dfc){return _0x1970c7['define']('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7132('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 1009dea..f53b738 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 _0xe528=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailQueueReport,\x20%s,\x20%s'];(function(_0x55452b,_0x3b9f75){var _0x49b464=function(_0x3548f9){while(--_0x3548f9){_0x55452b['push'](_0x55452b['shift']());}};_0x49b464(++_0x3b9f75);}(_0xe528,0x8d));var _0x8e52=function(_0x263bc9,_0x58dd06){_0x263bc9=_0x263bc9-0x0;var _0xe331e7=_0xe528[_0x263bc9];return _0xe331e7;};'use strict';var _=require(_0x8e52('0x0'));var util=require('util');var moment=require(_0x8e52('0x1'));var BPromise=require('bluebird');var rs=require(_0x8e52('0x2'));var fs=require('fs');var Redis=require(_0x8e52('0x3'));var db=require(_0x8e52('0x4'))['db'];var utils=require(_0x8e52('0x5'));var logger=require(_0x8e52('0x6'))(_0x8e52('0x7'));var config=require(_0x8e52('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e52('0x9')][_0x8e52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13e854,_0x4c71fb,_0x5e110c){return new BPromise(function(_0x3b0dad,_0x3b489e){return client['request'](_0x13e854,_0x5e110c)[_0x8e52('0xb')](function(_0x43bcab){logger[_0x8e52('0xc')](_0x8e52('0xd'),_0x4c71fb,_0x8e52('0xe'));logger[_0x8e52('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x4c71fb,_0x8e52('0xe'),JSON[_0x8e52('0x10')](_0x43bcab));if(_0x43bcab[_0x8e52('0x11')]){if(_0x43bcab[_0x8e52('0x11')][_0x8e52('0x12')]===0x1f4){logger[_0x8e52('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x4c71fb,_0x43bcab[_0x8e52('0x11')][_0x8e52('0x13')]);return _0x3b489e(_0x43bcab[_0x8e52('0x11')]['message']);}logger[_0x8e52('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x4c71fb,_0x43bcab[_0x8e52('0x11')][_0x8e52('0x13')]);return _0x3b0dad(_0x43bcab[_0x8e52('0x11')][_0x8e52('0x13')]);}else{logger[_0x8e52('0xc')](_0x8e52('0xd'),_0x4c71fb,_0x8e52('0xe'));_0x3b0dad(_0x43bcab[_0x8e52('0x14')]['message']);}})[_0x8e52('0x15')](function(_0x77353b){logger['error'](_0x8e52('0xd'),_0x4c71fb,_0x77353b);_0x3b489e(_0x77353b);});});}exports[_0x8e52('0x16')]=function(_0x37d14b){var _0x3fc4dd=this;return new Promise(function(_0x3e8207,_0x3321b3){return db[_0x8e52('0x17')][_0x8e52('0x18')](_0x37d14b[_0x8e52('0x19')],{'raw':_0x37d14b['options']?_0x37d14b[_0x8e52('0x1a')][_0x8e52('0x1b')]===undefined?!![]:![]:!![]})[_0x8e52('0xb')](function(_0x161f0c){logger[_0x8e52('0xc')](_0x8e52('0x16'),_0x37d14b);logger[_0x8e52('0xf')](_0x8e52('0x16'),_0x37d14b,JSON[_0x8e52('0x10')](_0x161f0c));_0x3e8207(_0x161f0c);})[_0x8e52('0x15')](function(_0x2497bc){logger['error']('CreateMailQueueReport',_0x2497bc[_0x8e52('0x13')],_0x37d14b);_0x3321b3(_0x3fc4dd[_0x8e52('0x11')](0x1f4,_0x2497bc[_0x8e52('0x13')]));});});};exports[_0x8e52('0x1c')]=function(_0x374003){var _0x4af484=this;return new Promise(function(_0x3e72c3,_0x207afd){return db[_0x8e52('0x17')]['update'](_0x374003[_0x8e52('0x19')],{'raw':_0x374003[_0x8e52('0x1a')]?_0x374003[_0x8e52('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374003[_0x8e52('0x1a')]?_0x374003[_0x8e52('0x1a')]['where']||null:null,'attributes':_0x374003[_0x8e52('0x1a')]?_0x374003[_0x8e52('0x1a')][_0x8e52('0x1d')]||null:null,'limit':_0x374003[_0x8e52('0x1a')]?_0x374003['options'][_0x8e52('0x1e')]||null:null})[_0x8e52('0xb')](function(_0x118810){logger[_0x8e52('0xc')]('UpdateMailQueueReport',_0x374003);logger[_0x8e52('0xf')](_0x8e52('0x1c'),_0x374003,JSON[_0x8e52('0x10')](_0x118810));_0x3e72c3(_0x118810);})[_0x8e52('0x15')](function(_0x16f045){logger[_0x8e52('0x11')](_0x8e52('0x1c'),_0x16f045[_0x8e52('0x13')],_0x374003);_0x207afd(_0x4af484[_0x8e52('0x11')](0x1f4,_0x16f045['message']));});});}; \ No newline at end of file +var _0xf4a3=['attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','raw','then','UpdateMailQueueReport','update','body','where'];(function(_0xd801d7,_0x277fa1){var _0x248032=function(_0x19d53a){while(--_0x19d53a){_0xd801d7['push'](_0xd801d7['shift']());}};_0x248032(++_0x277fa1);}(_0xf4a3,0x8e));var _0x3f4a=function(_0x9c563e,_0x166e41){_0x9c563e=_0x9c563e-0x0;var _0x94dcf3=_0xf4a3[_0x9c563e];return _0x94dcf3;};'use strict';var _=require(_0x3f4a('0x0'));var util=require('util');var moment=require(_0x3f4a('0x1'));var BPromise=require(_0x3f4a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f4a('0x3'));var db=require(_0x3f4a('0x4'))['db'];var utils=require(_0x3f4a('0x5'));var logger=require(_0x3f4a('0x6'))(_0x3f4a('0x7'));var config=require(_0x3f4a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f4a('0x9')][_0x3f4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb901b2,_0x186bc0,_0x3bb615){return new BPromise(function(_0x4bdd43,_0x4afd52){return client[_0x3f4a('0xb')](_0xb901b2,_0x3bb615)['then'](function(_0x1eec44){logger[_0x3f4a('0xc')](_0x3f4a('0xd'),_0x186bc0,'request\x20sent');logger[_0x3f4a('0xe')](_0x3f4a('0xf'),_0x186bc0,_0x3f4a('0x10'),JSON[_0x3f4a('0x11')](_0x1eec44));if(_0x1eec44[_0x3f4a('0x12')]){if(_0x1eec44['error'][_0x3f4a('0x13')]===0x1f4){logger[_0x3f4a('0x12')](_0x3f4a('0xd'),_0x186bc0,_0x1eec44['error']['message']);return _0x4afd52(_0x1eec44['error'][_0x3f4a('0x14')]);}logger['error'](_0x3f4a('0xd'),_0x186bc0,_0x1eec44['error']['message']);return _0x4bdd43(_0x1eec44[_0x3f4a('0x12')][_0x3f4a('0x14')]);}else{logger[_0x3f4a('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x186bc0,_0x3f4a('0x10'));_0x4bdd43(_0x1eec44[_0x3f4a('0x15')][_0x3f4a('0x14')]);}})[_0x3f4a('0x16')](function(_0x1a3277){logger['error'](_0x3f4a('0xd'),_0x186bc0,_0x1a3277);_0x4afd52(_0x1a3277);});});}exports[_0x3f4a('0x17')]=function(_0x1c94ee){var _0x2f7ac9=this;return new Promise(function(_0x112615,_0x210909){return db[_0x3f4a('0x18')][_0x3f4a('0x19')](_0x1c94ee['body'],{'raw':_0x1c94ee['options']?_0x1c94ee[_0x3f4a('0x1a')][_0x3f4a('0x1b')]===undefined?!![]:![]:!![]})[_0x3f4a('0x1c')](function(_0x5cb004){logger['info']('CreateMailQueueReport',_0x1c94ee);logger[_0x3f4a('0xe')]('CreateMailQueueReport',_0x1c94ee,JSON[_0x3f4a('0x11')](_0x5cb004));_0x112615(_0x5cb004);})['catch'](function(_0x219fc4){logger['error'](_0x3f4a('0x17'),_0x219fc4[_0x3f4a('0x14')],_0x1c94ee);_0x210909(_0x2f7ac9[_0x3f4a('0x12')](0x1f4,_0x219fc4[_0x3f4a('0x14')]));});});};exports[_0x3f4a('0x1d')]=function(_0xb4f415){var _0x588cf1=this;return new Promise(function(_0x15e868,_0x224aaf){return db[_0x3f4a('0x18')][_0x3f4a('0x1e')](_0xb4f415[_0x3f4a('0x1f')],{'raw':_0xb4f415['options']?_0xb4f415[_0x3f4a('0x1a')][_0x3f4a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4f415[_0x3f4a('0x1a')]?_0xb4f415['options'][_0x3f4a('0x20')]||null:null,'attributes':_0xb4f415[_0x3f4a('0x1a')]?_0xb4f415[_0x3f4a('0x1a')][_0x3f4a('0x21')]||null:null,'limit':_0xb4f415['options']?_0xb4f415[_0x3f4a('0x1a')][_0x3f4a('0x22')]||null:null})[_0x3f4a('0x1c')](function(_0x2eda01){logger['info']('UpdateMailQueueReport',_0xb4f415);logger['debug'](_0x3f4a('0x1d'),_0xb4f415,JSON[_0x3f4a('0x11')](_0x2eda01));_0x15e868(_0x2eda01);})[_0x3f4a('0x16')](function(_0x100a37){logger[_0x3f4a('0x12')]('UpdateMailQueueReport',_0x100a37[_0x3f4a('0x14')],_0xb4f415);_0x224aaf(_0x588cf1['error'](0x1f4,_0x100a37[_0x3f4a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 64096cd..b9800d9 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 _0x9576=['../../config/environment','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9576,0x182));var _0x6957=function(_0x51b57b,_0x44627c){_0x51b57b=_0x51b57b-0x0;var _0x222c3a=_0x9576[_0x51b57b];return _0x222c3a;};'use strict';var multer=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var path=require(_0x6957('0x2'));var timeout=require(_0x6957('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6957('0x4'));var interaction=require(_0x6957('0x5'));var config=require(_0x6957('0x6'));module[_0x6957('0x7')]=router; \ No newline at end of file +var _0x277c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x23b2e6,_0x301f6){var _0x298bd2=function(_0x2a93d2){while(--_0x2a93d2){_0x23b2e6['push'](_0x23b2e6['shift']());}};_0x298bd2(++_0x301f6);}(_0x277c,0x153));var _0xc277=function(_0x4b12e8,_0x3d7be0){_0x4b12e8=_0x4b12e8-0x0;var _0x4be7f5=_0x277c[_0x4b12e8];return _0x4be7f5;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));module[_0xc277('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b09b5e2..ca79d3e 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 _0x668b=['username','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x5aba3f,_0x486205){var _0x14a4a7=function(_0x1437f8){while(--_0x1437f8){_0x5aba3f['push'](_0x5aba3f['shift']());}};_0x14a4a7(++_0x486205);}(_0x668b,0x140));var _0xb668=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x668b[_0x1d94d1];return _0x23c397;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb668('0x2')]},'authentication':{'type':Sequelize[_0xb668('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xb668('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb668('0x5')]},'tls':{'type':Sequelize[_0xb668('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb668('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xb668('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb668('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file +var _0x34b7=['INTEGER','STRING','BOOLEAN','username','INBOX'];(function(_0x3d1b85,_0x10e828){var _0x31b1aa=function(_0xe883ca){while(--_0xe883ca){_0x3d1b85['push'](_0x3d1b85['shift']());}};_0x31b1aa(++_0x10e828);}(_0x34b7,0x196));var _0x734b=function(_0x489ba5,_0xa1a03c){_0x489ba5=_0x489ba5-0x0;var _0x3727e9=_0x34b7[_0x489ba5];return _0x3727e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x734b('0x0')]},'host':{'type':Sequelize[_0x734b('0x0')]},'authentication':{'type':Sequelize[_0x734b('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x734b('0x0')],'unique':_0x734b('0x2')},'password':{'type':Sequelize[_0x734b('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x734b('0x0')],'defaultValue':_0x734b('0x3')},'connTimeout':{'type':Sequelize[_0x734b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x734b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x734b('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 89e8b12..72a02d5 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 _0xbde2=['define','MailServerIn','util','../../config/logger','api','bluebird','request-promise','./mailServerIn.attributes'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0xbde2,0x7a));var _0x2bde=function(_0x3eef05,_0x5bae39){_0x3eef05=_0x3eef05-0x0;var _0x2c3dcd=_0xbde2[_0x3eef05];return _0x2c3dcd;};'use strict';var _=require('lodash');var util=require(_0x2bde('0x0'));var logger=require(_0x2bde('0x1'))(_0x2bde('0x2'));var moment=require('moment');var BPromise=require(_0x2bde('0x3'));var rp=require(_0x2bde('0x4'));var attributes=require(_0x2bde('0x5'));module['exports']=function(_0x3622bb,_0x211d7c){return _0x3622bb[_0x2bde('0x6')](_0x2bde('0x7'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5e=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','exports'];(function(_0x5a1252,_0x5c436a){var _0x55888d=function(_0x45a5d9){while(--_0x45a5d9){_0x5a1252['push'](_0x5a1252['shift']());}};_0x55888d(++_0x5c436a);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x1945a2,_0x2930a8){_0x1945a2=_0x1945a2-0x0;var _0x1a2695=_0x9c5e[_0x1945a2];return _0x1a2695;};'use strict';var _=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var logger=require(_0xe9c5('0x2'))(_0xe9c5('0x3'));var moment=require(_0xe9c5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./mailServerIn.attributes');module[_0xe9c5('0x5')]=function(_0x13d5d7,_0x4fa4c5){return _0x13d5d7[_0xe9c5('0x6')](_0xe9c5('0x7'),attributes,{'tableName':_0xe9c5('0x8'),'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 858df79..0f84b82 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 _0x09da=['result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3158e5,_0x25e184){var _0x4a9a3a=function(_0x5b3cac){while(--_0x5b3cac){_0x3158e5['push'](_0x3158e5['shift']());}};_0x4a9a3a(++_0x25e184);}(_0x09da,0xf4));var _0xa09d=function(_0x52b027,_0xc07d0f){_0x52b027=_0x52b027-0x0;var _0x51dc79=_0x09da[_0x52b027];return _0x51dc79;};'use strict';var _=require('lodash');var util=require(_0xa09d('0x0'));var moment=require(_0xa09d('0x1'));var BPromise=require(_0xa09d('0x2'));var rs=require(_0xa09d('0x3'));var fs=require('fs');var Redis=require(_0xa09d('0x4'));var db=require(_0xa09d('0x5'))['db'];var utils=require(_0xa09d('0x6'));var logger=require('../../config/logger')(_0xa09d('0x7'));var config=require(_0xa09d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa09d('0x9')][_0xa09d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3019ef,_0x3fa6d8,_0x4c5d78){return new BPromise(function(_0x4b2b7c,_0x3ce547){return client[_0xa09d('0xb')](_0x3019ef,_0x4c5d78)['then'](function(_0x2989ce){logger['info'](_0xa09d('0xc'),_0x3fa6d8,_0xa09d('0xd'));logger[_0xa09d('0xe')](_0xa09d('0xf'),_0x3fa6d8,_0xa09d('0xd'),JSON[_0xa09d('0x10')](_0x2989ce));if(_0x2989ce[_0xa09d('0x11')]){if(_0x2989ce[_0xa09d('0x11')][_0xa09d('0x12')]===0x1f4){logger[_0xa09d('0x11')](_0xa09d('0xc'),_0x3fa6d8,_0x2989ce[_0xa09d('0x11')]['message']);return _0x3ce547(_0x2989ce[_0xa09d('0x11')][_0xa09d('0x13')]);}logger['error'](_0xa09d('0xc'),_0x3fa6d8,_0x2989ce[_0xa09d('0x11')][_0xa09d('0x13')]);return _0x4b2b7c(_0x2989ce['error']['message']);}else{logger['info'](_0xa09d('0xc'),_0x3fa6d8,_0xa09d('0xd'));_0x4b2b7c(_0x2989ce[_0xa09d('0x14')][_0xa09d('0x13')]);}})[_0xa09d('0x15')](function(_0x4c0fc9){logger[_0xa09d('0x11')](_0xa09d('0xc'),_0x3fa6d8,_0x4c0fc9);_0x3ce547(_0x4c0fc9);});});}exports[_0xa09d('0x16')]=function(_0xe478a6){var _0x7a8c07=this;return new Promise(function(_0x5a6754,_0x442bbf){return db[_0xa09d('0x17')][_0xa09d('0x18')]({'raw':_0xe478a6[_0xa09d('0x19')]?_0xe478a6[_0xa09d('0x19')][_0xa09d('0x1a')]===undefined?!![]:![]:!![],'where':_0xe478a6[_0xa09d('0x19')]?_0xe478a6[_0xa09d('0x19')][_0xa09d('0x1b')]||null:null,'attributes':_0xe478a6[_0xa09d('0x19')]?_0xe478a6[_0xa09d('0x19')][_0xa09d('0x1c')]||null:null,'limit':_0xe478a6[_0xa09d('0x19')]?_0xe478a6[_0xa09d('0x19')]['limit']||null:null,'include':_0xe478a6[_0xa09d('0x19')]?_0xe478a6['options']['include']?_[_0xa09d('0x1d')](_0xe478a6[_0xa09d('0x19')][_0xa09d('0x1e')],function(_0x9103ed){return{'model':db[_0x9103ed[_0xa09d('0x1f')]],'as':_0x9103ed['as'],'attributes':_0x9103ed[_0xa09d('0x1c')],'include':_0x9103ed[_0xa09d('0x1e')]?_[_0xa09d('0x1d')](_0x9103ed['include'],function(_0x8bce52){return{'model':db[_0x8bce52[_0xa09d('0x1f')]],'as':_0x8bce52['as'],'attributes':_0x8bce52['attributes'],'include':_0x8bce52['include']?_[_0xa09d('0x1d')](_0x8bce52[_0xa09d('0x1e')],function(_0x9041e){return{'model':db[_0x9041e['model']],'as':_0x9041e['as'],'attributes':_0x9041e[_0xa09d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa09d('0x20')](function(_0x2fed73){logger['info'](_0xa09d('0x16'),_0xe478a6);logger[_0xa09d('0xe')](_0xa09d('0x16'),_0xe478a6,JSON['stringify'](_0x2fed73));_0x5a6754(_0x2fed73);})[_0xa09d('0x15')](function(_0x642870){logger[_0xa09d('0x11')](_0xa09d('0x16'),_0x642870[_0xa09d('0x13')],_0xe478a6);_0x442bbf(_0x7a8c07['error'](0x1f4,_0x642870['message']));});});}; \ No newline at end of file +var _0x04a8=['options','where','attributes','limit','include','map','model','then','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn'];(function(_0xa9df4e,_0x8aeca8){var _0x1cbb7c=function(_0x9250bb){while(--_0x9250bb){_0xa9df4e['push'](_0xa9df4e['shift']());}};_0x1cbb7c(++_0x8aeca8);}(_0x04a8,0xb9));var _0x804a=function(_0x35a3e9,_0x198411){_0x35a3e9=_0x35a3e9-0x0;var _0x2eb3eb=_0x04a8[_0x35a3e9];return _0x2eb3eb;};'use strict';var _=require(_0x804a('0x0'));var util=require(_0x804a('0x1'));var moment=require(_0x804a('0x2'));var BPromise=require(_0x804a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x804a('0x4'));var db=require(_0x804a('0x5'))['db'];var utils=require(_0x804a('0x6'));var logger=require(_0x804a('0x7'))(_0x804a('0x8'));var config=require(_0x804a('0x9'));var jayson=require(_0x804a('0xa'));var client=jayson[_0x804a('0xb')][_0x804a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20d90a,_0x2f7691,_0x123933){return new BPromise(function(_0x34eadc,_0x47e56c){return client[_0x804a('0xd')](_0x20d90a,_0x123933)['then'](function(_0x3f8dda){logger[_0x804a('0xe')](_0x804a('0xf'),_0x2f7691,_0x804a('0x10'));logger['debug'](_0x804a('0x11'),_0x2f7691,_0x804a('0x10'),JSON[_0x804a('0x12')](_0x3f8dda));if(_0x3f8dda[_0x804a('0x13')]){if(_0x3f8dda['error'][_0x804a('0x14')]===0x1f4){logger[_0x804a('0x13')](_0x804a('0xf'),_0x2f7691,_0x3f8dda[_0x804a('0x13')][_0x804a('0x15')]);return _0x47e56c(_0x3f8dda[_0x804a('0x13')][_0x804a('0x15')]);}logger[_0x804a('0x13')](_0x804a('0xf'),_0x2f7691,_0x3f8dda['error'][_0x804a('0x15')]);return _0x34eadc(_0x3f8dda[_0x804a('0x13')][_0x804a('0x15')]);}else{logger['info'](_0x804a('0xf'),_0x2f7691,'request\x20sent');_0x34eadc(_0x3f8dda[_0x804a('0x16')][_0x804a('0x15')]);}})['catch'](function(_0x42beab){logger[_0x804a('0x13')](_0x804a('0xf'),_0x2f7691,_0x42beab);_0x47e56c(_0x42beab);});});}exports[_0x804a('0x17')]=function(_0x167dce){var _0x4c55d6=this;return new Promise(function(_0x548638,_0x4b4377){return db[_0x804a('0x18')]['findAll']({'raw':_0x167dce[_0x804a('0x19')]?_0x167dce[_0x804a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x167dce['options']?_0x167dce[_0x804a('0x19')][_0x804a('0x1a')]||null:null,'attributes':_0x167dce['options']?_0x167dce['options'][_0x804a('0x1b')]||null:null,'limit':_0x167dce['options']?_0x167dce[_0x804a('0x19')][_0x804a('0x1c')]||null:null,'include':_0x167dce[_0x804a('0x19')]?_0x167dce['options'][_0x804a('0x1d')]?_[_0x804a('0x1e')](_0x167dce[_0x804a('0x19')][_0x804a('0x1d')],function(_0x1eb33e){return{'model':db[_0x1eb33e['model']],'as':_0x1eb33e['as'],'attributes':_0x1eb33e[_0x804a('0x1b')],'include':_0x1eb33e['include']?_['map'](_0x1eb33e['include'],function(_0x415c45){return{'model':db[_0x415c45['model']],'as':_0x415c45['as'],'attributes':_0x415c45['attributes'],'include':_0x415c45['include']?_[_0x804a('0x1e')](_0x415c45['include'],function(_0x10ad19){return{'model':db[_0x10ad19[_0x804a('0x1f')]],'as':_0x10ad19['as'],'attributes':_0x10ad19[_0x804a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x804a('0x20')](function(_0x1ab558){logger['info'](_0x804a('0x17'),_0x167dce);logger[_0x804a('0x21')](_0x804a('0x17'),_0x167dce,JSON['stringify'](_0x1ab558));_0x548638(_0x1ab558);})[_0x804a('0x22')](function(_0x2716ab){logger[_0x804a('0x13')](_0x804a('0x17'),_0x2716ab[_0x804a('0x15')],_0x167dce);_0x4b4377(_0x4c55d6[_0x804a('0x13')](0x1f4,_0x2716ab[_0x804a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4d732ad..a4eba3d 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 _0x2b84=['post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../config/environment','./mailServerOut.controller','isAuthenticated','index','get','/:id','show'];(function(_0xa7991d,_0x32459c){var _0x459970=function(_0x5f536f){while(--_0x5f536f){_0xa7991d['push'](_0xa7991d['shift']());}};_0x459970(++_0x32459c);}(_0x2b84,0x8f));var _0x42b8=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x2b84[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x42b8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42b8('0x1'));var express=require('express');var router=express[_0x42b8('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x42b8('0x3'));var controller=require(_0x42b8('0x4'));router['get']('/',auth[_0x42b8('0x5')](),controller[_0x42b8('0x6')]);router[_0x42b8('0x7')](_0x42b8('0x8'),auth[_0x42b8('0x5')](),controller[_0x42b8('0x9')]);router[_0x42b8('0xa')]('/',auth[_0x42b8('0x5')](),controller[_0x42b8('0xb')]);router[_0x42b8('0xc')](_0x42b8('0x8'),auth[_0x42b8('0x5')](),controller[_0x42b8('0xd')]);router[_0x42b8('0xe')]('/:id',auth[_0x42b8('0x5')](),controller[_0x42b8('0xf')]);module[_0x42b8('0x10')]=router; \ No newline at end of file +var _0x8de2=['get','isAuthenticated','index','show','create','update','delete','destroy','multer','util','express','../../components/auth/service','../../config/environment','./mailServerOut.controller'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8de2,0x104));var _0x28de=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x8de2[_0x403cff];return _0x5a7c56;};'use strict';var multer=require(_0x28de('0x0'));var util=require(_0x28de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x28de('0x2'));var router=express['Router']();var auth=require(_0x28de('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x28de('0x4'));var controller=require(_0x28de('0x5'));router[_0x28de('0x6')]('/',auth[_0x28de('0x7')](),controller[_0x28de('0x8')]);router[_0x28de('0x6')]('/:id',auth[_0x28de('0x7')](),controller[_0x28de('0x9')]);router['post']('/',auth[_0x28de('0x7')](),controller[_0x28de('0xa')]);router['put']('/:id',auth[_0x28de('0x7')](),controller[_0x28de('0xb')]);router[_0x28de('0xc')]('/:id',auth[_0x28de('0x7')](),controller[_0x28de('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index eee2d5d..594ef92 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 _0xf56e=['BOOLEAN','exports','STRING'];(function(_0x142135,_0x4aaa92){var _0x462de8=function(_0x52e7f5){while(--_0x52e7f5){_0x142135['push'](_0x142135['shift']());}};_0x462de8(++_0x4aaa92);}(_0xf56e,0xdf));var _0xef56=function(_0x2c4b06,_0x5e8a08){_0x2c4b06=_0x2c4b06-0x0;var _0x3669d5=_0xf56e[_0x2c4b06];return _0x3669d5;};'use strict';var Sequelize=require('sequelize');module[_0xef56('0x0')]={'description':{'type':Sequelize[_0xef56('0x1')]},'host':{'type':Sequelize[_0xef56('0x1')]},'user':{'type':Sequelize[_0xef56('0x1')]},'pass':{'type':Sequelize[_0xef56('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xef56('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xef56('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x325b=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x4297f,_0x5b0bd8){var _0x23db77=function(_0x2cfd62){while(--_0x2cfd62){_0x4297f['push'](_0x4297f['shift']());}};_0x23db77(++_0x5b0bd8);}(_0x325b,0x118));var _0xb325=function(_0x35cffd,_0x3e924f){_0x35cffd=_0x35cffd-0x0;var _0x265cf4=_0x325b[_0x35cffd];return _0x265cf4;};'use strict';var Sequelize=require(_0xb325('0x0'));module[_0xb325('0x1')]={'description':{'type':Sequelize[_0xb325('0x2')]},'host':{'type':Sequelize[_0xb325('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xb325('0x2')]},'port':{'type':Sequelize[_0xb325('0x3')]},'secure':{'type':Sequelize[_0xb325('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb325('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 373858e..b747205 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 _0x34e8=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','key','VIRTUAL','field','options','MailServerOut','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x34e8,0x12c));var _0x834e=function(_0x482957,_0x5347bc){_0x482957=_0x482957-0x0;var _0x58ad10=_0x34e8[_0x482957];return _0x58ad10;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var hardwareService=require(_0x834e('0x14'));var Redis=require(_0x834e('0x15'));var qs=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];function respondWithStatusCode(_0x2fd95c,_0x538bb3){_0x538bb3=_0x538bb3||0xcc;return function(_0x5e5b6d){if(_0x5e5b6d){return _0x2fd95c[_0x834e('0x1c')](_0x538bb3);}return _0x2fd95c['status'](_0x538bb3)[_0x834e('0x1d')]();};}function respondWithResult(_0x2d95f2,_0x28e659){_0x28e659=_0x28e659||0xc8;return function(_0x21cc0a){if(_0x21cc0a){return _0x2d95f2['status'](_0x28e659)[_0x834e('0x1e')](_0x21cc0a);}};}function respondWithFilteredResult(_0x302cbd,_0x57274a){return function(_0x316205){if(_0x316205){var _0x4a9cdc=_0x316205[_0x834e('0x1f')],_0x38a8cd=_0x57274a[_0x834e('0x20')],_0x36d443=_0x57274a[_0x834e('0x20')]+_0x57274a['limit'],_0x478afe;if(_0x36d443>=_0x4a9cdc){_0x36d443=_0x4a9cdc;_0x478afe=0xc8;}else{_0x478afe=0xce;}_0x302cbd[_0x834e('0x21')](_0x478afe);return _0x302cbd[_0x834e('0x22')](_0x834e('0x23'),_0x38a8cd+'-'+_0x36d443+'/'+_0x4a9cdc)[_0x834e('0x1e')](_0x316205);}return null;};}function patchUpdates(_0x237947){return function(_0x254677){try{jsonpatch[_0x834e('0x24')](_0x254677,_0x237947,!![]);}catch(_0x595515){return BPromise[_0x834e('0x25')](_0x595515);}return _0x254677[_0x834e('0x26')]();};}function saveUpdates(_0x113ff4,_0x325a99){return function(_0x4ab05d){if(_0x4ab05d){return _0x4ab05d[_0x834e('0x27')](_0x113ff4)[_0x834e('0x28')](function(_0x5a05c0){return _0x5a05c0;});}return null;};}function removeEntity(_0x1b4bdf,_0x28d687){return function(_0x8d406e){if(_0x8d406e){return _0x8d406e['destroy']()['then'](function(){_0x1b4bdf[_0x834e('0x21')](0xcc)[_0x834e('0x1d')]();});}};}function handleEntityNotFound(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(!_0x1dc1e0){_0x589dde['sendStatus'](0x194);}return _0x1dc1e0;};}function handleError(_0x3bc4f7,_0x2e1983){_0x2e1983=_0x2e1983||0x1f4;return function(_0x338636){logger['error'](_0x338636[_0x834e('0x29')]);if(_0x338636[_0x834e('0x2a')]){delete _0x338636['name'];}_0x3bc4f7['status'](_0x2e1983)[_0x834e('0x2b')](_0x338636);};}exports['index']=function(_0x2826ec,_0x3f1b0b){var _0x3db026={},_0x2cc2eb={},_0x3cd928={'count':0x0,'rows':[]};var _0x130cc5=db['MailServerOut']['rawAttributes'];_0x2cc2eb['model']=_['keys'](_0x130cc5);_0x2cc2eb[_0x834e('0x2c')]=_[_0x834e('0x2d')](_0x2826ec[_0x834e('0x2c')]);_0x2cc2eb['filters']=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],_0x2cc2eb[_0x834e('0x2c')]);_0x3db026[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x2cc2eb[_0x834e('0x2f')],qs[_0x834e('0x31')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x31')]));_0x3db026['attributes']=_0x3db026[_0x834e('0x30')]['length']?_0x3db026[_0x834e('0x30')]:_0x2cc2eb[_0x834e('0x2f')];if(!_0x2826ec[_0x834e('0x2c')][_0x834e('0x32')](_0x834e('0x33'))){_0x3db026[_0x834e('0x34')]=qs[_0x834e('0x34')](_0x2826ec[_0x834e('0x2c')][_0x834e('0x34')]);_0x3db026[_0x834e('0x20')]=qs['offset'](_0x2826ec[_0x834e('0x2c')][_0x834e('0x20')]);}_0x3db026[_0x834e('0x35')]=qs[_0x834e('0x36')](_0x2826ec['query'][_0x834e('0x36')]);_0x3db026[_0x834e('0x37')]=qs['filters'](_['pick'](_0x2826ec['query'],_0x2cc2eb[_0x834e('0x38')]));if(_0x2826ec[_0x834e('0x2c')][_0x834e('0x39')]){_0x3db026[_0x834e('0x37')]=_[_0x834e('0x3a')](_0x3db026[_0x834e('0x37')],{'$or':_['map'](_0x130cc5,function(_0x2c2d94){if(_0x2c2d94['type'][_0x834e('0x3b')]!==_0x834e('0x3c')){var _0x47abed={};_0x47abed[_0x2c2d94[_0x834e('0x3d')]]={'$like':'%'+_0x2826ec[_0x834e('0x2c')]['filter']+'%'};return _0x47abed;}})});}_0x3db026=_['merge']({},_0x3db026,_0x2826ec[_0x834e('0x3e')]);var _0xd0d43a={'where':_0x3db026[_0x834e('0x37')]};return db[_0x834e('0x3f')][_0x834e('0x1f')](_0xd0d43a)['then'](function(_0x1c5ed6){_0x3cd928['count']=_0x1c5ed6;if(_0x2826ec['query'][_0x834e('0x40')]){_0x3db026['include']=[{'all':!![]}];}return db[_0x834e('0x3f')][_0x834e('0x41')](_0x3db026);})[_0x834e('0x28')](function(_0x3c59af){_0x3cd928[_0x834e('0x42')]=_0x3c59af;return _0x3cd928;})['then'](respondWithFilteredResult(_0x3f1b0b,_0x3db026))[_0x834e('0x43')](handleError(_0x3f1b0b,null));};exports[_0x834e('0x44')]=function(_0x38f266,_0x58c5fb){var _0x35380e={'raw':!![],'where':{'id':_0x38f266['params']['id']}},_0x16ac45={};_0x16ac45[_0x834e('0x2f')]=_['keys'](db[_0x834e('0x3f')][_0x834e('0x45')]);_0x16ac45['query']=_['keys'](_0x38f266[_0x834e('0x2c')]);_0x16ac45[_0x834e('0x38')]=_[_0x834e('0x2e')](_0x16ac45[_0x834e('0x2f')],_0x16ac45[_0x834e('0x2c')]);_0x35380e[_0x834e('0x30')]=_[_0x834e('0x2e')](_0x16ac45['model'],qs[_0x834e('0x31')](_0x38f266['query'][_0x834e('0x31')]));_0x35380e['attributes']=_0x35380e[_0x834e('0x30')]['length']?_0x35380e[_0x834e('0x30')]:_0x16ac45[_0x834e('0x2f')];if(_0x38f266['query'][_0x834e('0x40')]){_0x35380e[_0x834e('0x46')]=[{'all':!![]}];}_0x35380e=_[_0x834e('0x3a')]({},_0x35380e,_0x38f266[_0x834e('0x3e')]);return db[_0x834e('0x3f')][_0x834e('0x47')](_0x35380e)[_0x834e('0x28')](handleEntityNotFound(_0x58c5fb,null))[_0x834e('0x28')](respondWithResult(_0x58c5fb,null))[_0x834e('0x43')](handleError(_0x58c5fb,null));};exports[_0x834e('0x48')]=function(_0x5f3943,_0x3124be){return db[_0x834e('0x3f')]['create'](_0x5f3943[_0x834e('0x49')],{})[_0x834e('0x28')](respondWithResult(_0x3124be,0xc9))[_0x834e('0x43')](handleError(_0x3124be,null));};exports[_0x834e('0x27')]=function(_0x19b5ef,_0x4264b8){if(_0x19b5ef['body']['id']){delete _0x19b5ef['body']['id'];}return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x19b5ef[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x4264b8,null))[_0x834e('0x28')](saveUpdates(_0x19b5ef[_0x834e('0x49')],null))[_0x834e('0x28')](respondWithResult(_0x4264b8,null))[_0x834e('0x43')](handleError(_0x4264b8,null));};exports[_0x834e('0x4b')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x3f')][_0x834e('0x47')]({'where':{'id':_0x390c45[_0x834e('0x4a')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x28')](removeEntity(_0xf02f0d,null))[_0x834e('0x43')](handleError(_0xf02f0d,null));}; \ No newline at end of file +var _0x008c=['body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','MailServerOut','rawAttributes','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','create'];(function(_0x28fb72,_0x240745){var _0x9dacc0=function(_0x1812ab){while(--_0x1812ab){_0x28fb72['push'](_0x28fb72['shift']());}};_0x9dacc0(++_0x240745);}(_0x008c,0x188));var _0xc008=function(_0x41358a,_0x322144){_0x41358a=_0x41358a-0x0;var _0x8c40ce=_0x008c[_0x41358a];return _0x8c40ce;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var authService=require(_0xc008('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['keys'](_0x4caaf4);_0x4fce9c[_0xc008('0x25')]=_[_0xc008('0x26')](_0x2e31c2[_0xc008('0x25')]);_0x4fce9c[_0xc008('0x27')]=_['intersection'](_0x4fce9c[_0xc008('0x24')],_0x4fce9c[_0xc008('0x25')]);_0x5e2aca['attributes']=_['intersection'](_0x4fce9c['model'],qs[_0xc008('0x28')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x28')]));_0x5e2aca[_0xc008('0x29')]=_0x5e2aca[_0xc008('0x29')][_0xc008('0x2a')]?_0x5e2aca[_0xc008('0x29')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x25')][_0xc008('0x2b')](_0xc008('0x2c'))){_0x5e2aca[_0xc008('0x2d')]=qs['limit'](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2d')]);_0x5e2aca['offset']=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2f')](_0x2e31c2[_0xc008('0x25')][_0xc008('0x2f')]);_0x5e2aca[_0xc008('0x30')]=qs[_0xc008('0x27')](_['pick'](_0x2e31c2[_0xc008('0x25')],_0x4fce9c[_0xc008('0x27')]));if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]){_0x5e2aca[_0xc008('0x30')]=_[_0xc008('0x32')](_0x5e2aca[_0xc008('0x30')],{'$or':_['map'](_0x4caaf4,function(_0x35f360){if(_0x35f360[_0xc008('0x33')]['key']!==_0xc008('0x34')){var _0x15453c={};_0x15453c[_0x35f360['field']]={'$like':'%'+_0x2e31c2[_0xc008('0x25')][_0xc008('0x31')]+'%'};return _0x15453c;}})});}_0x5e2aca=_[_0xc008('0x32')]({},_0x5e2aca,_0x2e31c2['options']);var _0x53b353={'where':_0x5e2aca['where']};return db[_0xc008('0x22')]['count'](_0x53b353)[_0xc008('0x1d')](function(_0x3884dd){_0x4adbab[_0xc008('0x19')]=_0x3884dd;if(_0x2e31c2[_0xc008('0x25')][_0xc008('0x35')]){_0x5e2aca[_0xc008('0x36')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x37')](_0x5e2aca);})[_0xc008('0x1d')](function(_0x387dfd){_0x4adbab[_0xc008('0x38')]=_0x387dfd;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))[_0xc008('0x39')](handleError(_0x5bebd9,null));};exports[_0xc008('0x3a')]=function(_0x4cace5,_0x3238b4){var _0x23c4db={'raw':!![],'where':{'id':_0x4cace5[_0xc008('0x3b')]['id']}},_0x30b7df={};_0x30b7df['model']=_[_0xc008('0x26')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x30b7df[_0xc008('0x25')]=_[_0xc008('0x26')](_0x4cace5['query']);_0x30b7df[_0xc008('0x27')]=_[_0xc008('0x3c')](_0x30b7df[_0xc008('0x24')],_0x30b7df[_0xc008('0x25')]);_0x23c4db[_0xc008('0x29')]=_['intersection'](_0x30b7df[_0xc008('0x24')],qs[_0xc008('0x28')](_0x4cace5[_0xc008('0x25')][_0xc008('0x28')]));_0x23c4db['attributes']=_0x23c4db[_0xc008('0x29')][_0xc008('0x2a')]?_0x23c4db[_0xc008('0x29')]:_0x30b7df['model'];if(_0x4cace5[_0xc008('0x25')]['includeAll']){_0x23c4db[_0xc008('0x36')]=[{'all':!![]}];}_0x23c4db=_['merge']({},_0x23c4db,_0x4cace5[_0xc008('0x3d')]);return db[_0xc008('0x22')]['find'](_0x23c4db)[_0xc008('0x1d')](handleEntityNotFound(_0x3238b4,null))[_0xc008('0x1d')](respondWithResult(_0x3238b4,null))[_0xc008('0x39')](handleError(_0x3238b4,null));};exports['create']=function(_0x1cec64,_0x2a9b5c){return db[_0xc008('0x22')][_0xc008('0x3e')](_0x1cec64[_0xc008('0x3f')],{})[_0xc008('0x1d')](respondWithResult(_0x2a9b5c,0xc9))['catch'](handleError(_0x2a9b5c,null));};exports['update']=function(_0x5283a8,_0x4552ed){if(_0x5283a8[_0xc008('0x3f')]['id']){delete _0x5283a8[_0xc008('0x3f')]['id'];}return db[_0xc008('0x22')][_0xc008('0x40')]({'where':{'id':_0x5283a8[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x4552ed,null))[_0xc008('0x1d')](saveUpdates(_0x5283a8['body'],null))['then'](respondWithResult(_0x4552ed,null))['catch'](handleError(_0x4552ed,null));};exports[_0xc008('0x1c')]=function(_0x2651cf,_0x158eae){return db['MailServerOut'][_0xc008('0x40')]({'where':{'id':_0x2651cf[_0xc008('0x3b')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x1d')](removeEntity(_0x158eae,null))[_0xc008('0x39')](handleError(_0x158eae,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 174d2b2..60d08c1 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 _0xe0ae=['api','bluebird','./mailServerOut.attributes','exports','mail_servers_out','../../config/logger'];(function(_0x23557d,_0x1b5296){var _0x2a39a1=function(_0x54ebd2){while(--_0x54ebd2){_0x23557d['push'](_0x23557d['shift']());}};_0x2a39a1(++_0x1b5296);}(_0xe0ae,0xa1));var _0xee0a=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xe0ae[_0x271060];return _0x40540b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var attributes=require(_0xee0a('0x3'));module[_0xee0a('0x4')]=function(_0x4cd518,_0x13a94a){return _0x4cd518['define']('MailServerOut',attributes,{'tableName':_0xee0a('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db9=['moment','bluebird','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x3a43f2,_0x126074){var _0x398797=function(_0x1e2e1a){while(--_0x1e2e1a){_0x3a43f2['push'](_0x3a43f2['shift']());}};_0x398797(++_0x126074);}(_0x1db9,0x176));var _0x91db=function(_0x349ab3,_0x446f71){_0x349ab3=_0x349ab3-0x0;var _0x2ab1c4=_0x1db9[_0x349ab3];return _0x2ab1c4;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var attributes=require(_0x91db('0x6'));module[_0x91db('0x7')]=function(_0x59c944,_0x4c9f59){return _0x59c944[_0x91db('0x8')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 4f34c07..5f016a4 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 _0x4357=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','MailServerOut,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5a94f2,_0x2c2877){var _0x2104fd=function(_0x10581b){while(--_0x10581b){_0x5a94f2['push'](_0x5a94f2['shift']());}};_0x2104fd(++_0x2c2877);}(_0x4357,0xd8));var _0x7435=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x4357[_0x4c9380];return _0x49a523;};'use strict';var _=require(_0x7435('0x0'));var util=require(_0x7435('0x1'));var moment=require(_0x7435('0x2'));var BPromise=require(_0x7435('0x3'));var rs=require(_0x7435('0x4'));var fs=require('fs');var Redis=require(_0x7435('0x5'));var db=require(_0x7435('0x6'))['db'];var utils=require(_0x7435('0x7'));var logger=require(_0x7435('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7435('0x9'));var client=jayson['client'][_0x7435('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5ee2,_0x37a97f,_0x2217d4){return new BPromise(function(_0x42ac9e,_0x498e50){return client[_0x7435('0xb')](_0x2a5ee2,_0x2217d4)['then'](function(_0x31a046){logger[_0x7435('0xc')]('MailServerOut,\x20%s,\x20%s',_0x37a97f,_0x7435('0xd'));logger[_0x7435('0xe')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x37a97f,'request\x20sent',JSON[_0x7435('0xf')](_0x31a046));if(_0x31a046[_0x7435('0x10')]){if(_0x31a046[_0x7435('0x10')][_0x7435('0x11')]===0x1f4){logger[_0x7435('0x10')](_0x7435('0x12'),_0x37a97f,_0x31a046[_0x7435('0x10')]['message']);return _0x498e50(_0x31a046[_0x7435('0x10')][_0x7435('0x13')]);}logger['error'](_0x7435('0x12'),_0x37a97f,_0x31a046['error'][_0x7435('0x13')]);return _0x42ac9e(_0x31a046[_0x7435('0x10')][_0x7435('0x13')]);}else{logger[_0x7435('0xc')]('MailServerOut,\x20%s,\x20%s',_0x37a97f,_0x7435('0xd'));_0x42ac9e(_0x31a046[_0x7435('0x14')]['message']);}})[_0x7435('0x15')](function(_0x47fd7b){logger[_0x7435('0x10')](_0x7435('0x12'),_0x37a97f,_0x47fd7b);_0x498e50(_0x47fd7b);});});} \ No newline at end of file +var _0xa536=['request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http','request','then','info','MailServerOut,\x20%s,\x20%s'];(function(_0x4e5e4d,_0x4b2f9b){var _0x18c78e=function(_0x5766d7){while(--_0x5766d7){_0x4e5e4d['push'](_0x4e5e4d['shift']());}};_0x18c78e(++_0x4b2f9b);}(_0xa536,0x15b));var _0x6a53=function(_0x1bc308,_0x5b1cff){_0x1bc308=_0x1bc308-0x0;var _0x371084=_0xa536[_0x1bc308];return _0x371084;};'use strict';var _=require(_0x6a53('0x0'));var util=require(_0x6a53('0x1'));var moment=require(_0x6a53('0x2'));var BPromise=require(_0x6a53('0x3'));var rs=require(_0x6a53('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a53('0x5'))['db'];var utils=require(_0x6a53('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a53('0x7')][_0x6a53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2640f3,_0x2811c2,_0x401ccf){return new BPromise(function(_0x326642,_0x2643c6){return client[_0x6a53('0x9')](_0x2640f3,_0x401ccf)[_0x6a53('0xa')](function(_0x14c485){logger[_0x6a53('0xb')](_0x6a53('0xc'),_0x2811c2,_0x6a53('0xd'));logger[_0x6a53('0xe')](_0x6a53('0xf'),_0x2811c2,_0x6a53('0xd'),JSON['stringify'](_0x14c485));if(_0x14c485[_0x6a53('0x10')]){if(_0x14c485[_0x6a53('0x10')][_0x6a53('0x11')]===0x1f4){logger[_0x6a53('0x10')](_0x6a53('0xc'),_0x2811c2,_0x14c485[_0x6a53('0x10')][_0x6a53('0x12')]);return _0x2643c6(_0x14c485[_0x6a53('0x10')][_0x6a53('0x12')]);}logger['error'](_0x6a53('0xc'),_0x2811c2,_0x14c485[_0x6a53('0x10')]['message']);return _0x326642(_0x14c485[_0x6a53('0x10')][_0x6a53('0x12')]);}else{logger['info'](_0x6a53('0xc'),_0x2811c2,'request\x20sent');_0x326642(_0x14c485['result'][_0x6a53('0x12')]);}})[_0x6a53('0x13')](function(_0x3c8ce8){logger[_0x6a53('0x10')]('MailServerOut,\x20%s,\x20%s',_0x2811c2,_0x3c8ce8);_0x2643c6(_0x3c8ce8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 329baf3..5445870 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 _0x4efd=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe','describe','get','show','post','create','put','/:id','update','delete'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x4efd,0x9c));var _0xd4ef=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x4efd[_0x35ef6b];return _0x3ad145;};'use strict';var multer=require(_0xd4ef('0x0'));var util=require(_0xd4ef('0x1'));var path=require(_0xd4ef('0x2'));var timeout=require(_0xd4ef('0x3'));var express=require('express');var router=express[_0xd4ef('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4ef('0x5'));var config=require(_0xd4ef('0x6'));var controller=require(_0xd4ef('0x7'));router['get']('/',auth[_0xd4ef('0x8')](),controller[_0xd4ef('0x9')]);router['get'](_0xd4ef('0xa'),auth[_0xd4ef('0x8')](),controller[_0xd4ef('0xb')]);router[_0xd4ef('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd4ef('0xd')]);router[_0xd4ef('0xe')]('/',auth['isAuthenticated'](),controller[_0xd4ef('0xf')]);router[_0xd4ef('0x10')](_0xd4ef('0x11'),auth[_0xd4ef('0x8')](),controller[_0xd4ef('0x12')]);router[_0xd4ef('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd4ef('0x14')]);module[_0xd4ef('0x15')]=router; \ No newline at end of file +var _0x192b=['multer','connect-timeout','express','Router','../../components/auth/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','delete','exports'];(function(_0xf8da14,_0x49b2f2){var _0x61d88c=function(_0x23c987){while(--_0x23c987){_0xf8da14['push'](_0xf8da14['shift']());}};_0x61d88c(++_0x49b2f2);}(_0x192b,0x1a0));var _0xb192=function(_0x187f53,_0x3a421b){_0x187f53=_0x187f53-0x0;var _0x5abf0d=_0x192b[_0x187f53];return _0x5abf0d;};'use strict';var multer=require(_0xb192('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb192('0x1'));var express=require(_0xb192('0x2'));var router=express[_0xb192('0x3')]();var auth=require(_0xb192('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb192('0x5'));router['get']('/',auth[_0xb192('0x6')](),controller[_0xb192('0x7')]);router[_0xb192('0x8')](_0xb192('0x9'),auth[_0xb192('0x6')](),controller[_0xb192('0xa')]);router[_0xb192('0x8')](_0xb192('0xb'),auth[_0xb192('0x6')](),controller['show']);router[_0xb192('0xc')]('/',auth[_0xb192('0x6')](),controller[_0xb192('0xd')]);router['put']('/:id',auth[_0xb192('0x6')](),controller['update']);router[_0xb192('0xe')](_0xb192('0xb'),auth[_0xb192('0x6')](),controller['destroy']);module[_0xb192('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 03afd59..f23f71c 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 _0x8c7a=['sequelize','name'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x8c7a,0x8c));var _0xa8c7=function(_0xed75df,_0x135c2a){_0xed75df=_0xed75df-0x0;var _0x5ca110=_0x8c7a[_0xed75df];return _0x5ca110;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa8c7('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x282b=['sequelize','exports','STRING','name'];(function(_0x132bcb,_0x346a69){var _0x28b4d9=function(_0x1c3e3b){while(--_0x1c3e3b){_0x132bcb['push'](_0x132bcb['shift']());}};_0x28b4d9(++_0x346a69);}(_0x282b,0xec));var _0xb282=function(_0x58df9f,_0x391acf){_0x58df9f=_0x58df9f-0x0;var _0x4fb51d=_0x282b[_0x58df9f];return _0x4fb51d;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'unique':_0xb282('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb282('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 551389e..60ba253 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 _0xf40b=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','key','field','filter','options','MailSubstatus','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection'];(function(_0x469ef1,_0x2487f2){var _0xd9100c=function(_0xef7252){while(--_0xef7252){_0x469ef1['push'](_0x469ef1['shift']());}};_0xd9100c(++_0x2487f2);}(_0xf40b,0xb0));var _0xbf40=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0xf40b[_0x4f3e33];return _0x1a070c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf40('0x0'));var rimraf=require(_0xbf40('0x1'));var zipdir=require(_0xbf40('0x2'));var jsonpatch=require(_0xbf40('0x3'));var rp=require('request-promise');var moment=require(_0xbf40('0x4'));var BPromise=require(_0xbf40('0x5'));var Mustache=require(_0xbf40('0x6'));var util=require(_0xbf40('0x7'));var path=require(_0xbf40('0x8'));var sox=require('sox');var csv=require(_0xbf40('0x9'));var ejs=require(_0xbf40('0xa'));var fs=require('fs');var _=require(_0xbf40('0xb'));var squel=require(_0xbf40('0xc'));var crypto=require(_0xbf40('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf40('0xe'));var toCsv=require(_0xbf40('0x9'));var querystring=require(_0xbf40('0xf'));var Papa=require(_0xbf40('0x10'));var authService=require(_0xbf40('0x11'));var hardwareService=require(_0xbf40('0x12'));var Redis=require(_0xbf40('0x13'));var qs=require(_0xbf40('0x14'));var logger=require('../../config/logger')(_0xbf40('0x15'));var utils=require(_0xbf40('0x16'));var config=require(_0xbf40('0x17'));var db=require(_0xbf40('0x18'))['db'];function respondWithStatusCode(_0x380a1e,_0x1eef4c){_0x1eef4c=_0x1eef4c||0xcc;return function(_0x2417ae){if(_0x2417ae){return _0x380a1e[_0xbf40('0x19')](_0x1eef4c);}return _0x380a1e['status'](_0x1eef4c)['end']();};}function respondWithResult(_0x6e3496,_0x3f86b5){_0x3f86b5=_0x3f86b5||0xc8;return function(_0x2cecca){if(_0x2cecca){return _0x6e3496[_0xbf40('0x1a')](_0x3f86b5)['json'](_0x2cecca);}};}function respondWithFilteredResult(_0xb61909,_0x3c9329){return function(_0x3965f6){if(_0x3965f6){var _0x347473=_0x3965f6[_0xbf40('0x1b')],_0x39a323=_0x3c9329['offset'],_0x203056=_0x3c9329[_0xbf40('0x1c')]+_0x3c9329[_0xbf40('0x1d')],_0x128f7d;if(_0x203056>=_0x347473){_0x203056=_0x347473;_0x128f7d=0xc8;}else{_0x128f7d=0xce;}_0xb61909[_0xbf40('0x1a')](_0x128f7d);return _0xb61909[_0xbf40('0x1e')](_0xbf40('0x1f'),_0x39a323+'-'+_0x203056+'/'+_0x347473)[_0xbf40('0x20')](_0x3965f6);}return null;};}function patchUpdates(_0x325545){return function(_0x3cca3c){try{jsonpatch['apply'](_0x3cca3c,_0x325545,!![]);}catch(_0x2c8af5){return BPromise[_0xbf40('0x21')](_0x2c8af5);}return _0x3cca3c[_0xbf40('0x22')]();};}function saveUpdates(_0x2d6492,_0x5540a6){return function(_0x46a864){if(_0x46a864){return _0x46a864[_0xbf40('0x23')](_0x2d6492)[_0xbf40('0x24')](function(_0x1922c8){return _0x1922c8;});}return null;};}function removeEntity(_0x2db94f,_0x23fc5b){return function(_0x275ff1){if(_0x275ff1){return _0x275ff1[_0xbf40('0x25')]()[_0xbf40('0x24')](function(){_0x2db94f[_0xbf40('0x1a')](0xcc)[_0xbf40('0x26')]();});}};}function handleEntityNotFound(_0x1487d0,_0x17fa9a){return function(_0x1471ee){if(!_0x1471ee){_0x1487d0[_0xbf40('0x19')](0x194);}return _0x1471ee;};}function handleError(_0xadf34b,_0x5c5e6d){_0x5c5e6d=_0x5c5e6d||0x1f4;return function(_0x2df7a8){logger[_0xbf40('0x27')](_0x2df7a8[_0xbf40('0x28')]);if(_0x2df7a8[_0xbf40('0x29')]){delete _0x2df7a8[_0xbf40('0x29')];}_0xadf34b[_0xbf40('0x1a')](_0x5c5e6d)[_0xbf40('0x2a')](_0x2df7a8);};}exports[_0xbf40('0x2b')]=function(_0x40f563,_0x266468){var _0x2faef5={},_0x2528f2={},_0x2af9ce={'count':0x0,'rows':[]};var _0x3db5e7=db['MailSubstatus'][_0xbf40('0x2c')];_0x2528f2['model']=_[_0xbf40('0x2d')](_0x3db5e7);_0x2528f2[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0x40f563['query']);_0x2528f2[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x2528f2[_0xbf40('0x31')],_0x2528f2['query']);_0x2faef5[_0xbf40('0x32')]=_['intersection'](_0x2528f2[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0x40f563[_0xbf40('0x2e')]['fields']));_0x2faef5[_0xbf40('0x32')]=_0x2faef5[_0xbf40('0x32')][_0xbf40('0x34')]?_0x2faef5[_0xbf40('0x32')]:_0x2528f2[_0xbf40('0x31')];if(!_0x40f563[_0xbf40('0x2e')][_0xbf40('0x35')](_0xbf40('0x36'))){_0x2faef5[_0xbf40('0x1d')]=qs['limit'](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x1d')]);_0x2faef5[_0xbf40('0x1c')]=qs[_0xbf40('0x1c')](_0x40f563['query'][_0xbf40('0x1c')]);}_0x2faef5['order']=qs[_0xbf40('0x37')](_0x40f563[_0xbf40('0x2e')][_0xbf40('0x37')]);_0x2faef5['where']=qs[_0xbf40('0x2f')](_[_0xbf40('0x38')](_0x40f563[_0xbf40('0x2e')],_0x2528f2[_0xbf40('0x2f')]));if(_0x40f563[_0xbf40('0x2e')]['filter']){_0x2faef5[_0xbf40('0x39')]=_[_0xbf40('0x3a')](_0x2faef5[_0xbf40('0x39')],{'$or':_['map'](_0x3db5e7,function(_0x38511f){if(_0x38511f[_0xbf40('0x3b')][_0xbf40('0x3c')]!=='VIRTUAL'){var _0x408ec9={};_0x408ec9[_0x38511f[_0xbf40('0x3d')]]={'$like':'%'+_0x40f563[_0xbf40('0x2e')][_0xbf40('0x3e')]+'%'};return _0x408ec9;}})});}_0x2faef5=_[_0xbf40('0x3a')]({},_0x2faef5,_0x40f563[_0xbf40('0x3f')]);var _0xb24d88={'where':_0x2faef5[_0xbf40('0x39')]};return db[_0xbf40('0x40')][_0xbf40('0x1b')](_0xb24d88)[_0xbf40('0x24')](function(_0x41aaff){_0x2af9ce[_0xbf40('0x1b')]=_0x41aaff;if(_0x40f563[_0xbf40('0x2e')]['includeAll']){_0x2faef5[_0xbf40('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbf40('0x42')](_0x2faef5);})[_0xbf40('0x24')](function(_0x322c32){_0x2af9ce[_0xbf40('0x43')]=_0x322c32;return _0x2af9ce;})[_0xbf40('0x24')](respondWithFilteredResult(_0x266468,_0x2faef5))['catch'](handleError(_0x266468,null));};exports[_0xbf40('0x44')]=function(_0xfd6710,_0x51aa33){var _0x14f87c={'raw':!![],'where':{'id':_0xfd6710[_0xbf40('0x45')]['id']}},_0x58bd28={};_0x58bd28[_0xbf40('0x31')]=_[_0xbf40('0x2d')](db[_0xbf40('0x40')][_0xbf40('0x2c')]);_0x58bd28[_0xbf40('0x2e')]=_[_0xbf40('0x2d')](_0xfd6710['query']);_0x58bd28[_0xbf40('0x2f')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],_0x58bd28[_0xbf40('0x2e')]);_0x14f87c[_0xbf40('0x32')]=_[_0xbf40('0x30')](_0x58bd28[_0xbf40('0x31')],qs[_0xbf40('0x33')](_0xfd6710['query'][_0xbf40('0x33')]));_0x14f87c['attributes']=_0x14f87c[_0xbf40('0x32')][_0xbf40('0x34')]?_0x14f87c[_0xbf40('0x32')]:_0x58bd28[_0xbf40('0x31')];if(_0xfd6710['query']['includeAll']){_0x14f87c[_0xbf40('0x41')]=[{'all':!![]}];}_0x14f87c=_[_0xbf40('0x3a')]({},_0x14f87c,_0xfd6710[_0xbf40('0x3f')]);return db['MailSubstatus']['find'](_0x14f87c)[_0xbf40('0x24')](handleEntityNotFound(_0x51aa33,null))['then'](respondWithResult(_0x51aa33,null))[_0xbf40('0x46')](handleError(_0x51aa33,null));};exports['create']=function(_0x18758d,_0x420cd9){return db['MailSubstatus'][_0xbf40('0x47')](_0x18758d[_0xbf40('0x48')],{})['then'](respondWithResult(_0x420cd9,0xc9))['catch'](handleError(_0x420cd9,null));};exports[_0xbf40('0x23')]=function(_0x17dc02,_0x518794){if(_0x17dc02[_0xbf40('0x48')]['id']){delete _0x17dc02[_0xbf40('0x48')]['id'];}return db[_0xbf40('0x40')][_0xbf40('0x49')]({'where':{'id':_0x17dc02[_0xbf40('0x45')]['id']}})['then'](handleEntityNotFound(_0x518794,null))[_0xbf40('0x24')](saveUpdates(_0x17dc02[_0xbf40('0x48')],null))[_0xbf40('0x24')](respondWithResult(_0x518794,null))[_0xbf40('0x46')](handleError(_0x518794,null));};exports[_0xbf40('0x25')]=function(_0x105387,_0x2d0a27){return db['MailSubstatus']['find']({'where':{'id':_0x105387[_0xbf40('0x45')]['id']}})[_0xbf40('0x24')](handleEntityNotFound(_0x2d0a27,null))['then'](removeEntity(_0x2d0a27,null))[_0xbf40('0x46')](handleError(_0x2d0a27,null));};exports[_0xbf40('0x4a')]=function(_0xc10f3a,_0x51a8c3){return db[_0xbf40('0x40')][_0xbf40('0x4a')]()[_0xbf40('0x24')](respondWithResult(_0x51a8c3,null))['catch'](handleError(_0x51a8c3,null));}; \ No newline at end of file +var _0x90b1=['options','includeAll','include','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','MailSubstatus','rawAttributes','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','field'];(function(_0x50dc5e,_0x352e6d){var _0x420262=function(_0x54b61f){while(--_0x54b61f){_0x50dc5e['push'](_0x50dc5e['shift']());}};_0x420262(++_0x352e6d);}(_0x90b1,0x1bb));var _0x190b=function(_0x1b3a9e,_0x3b6e29){_0x1b3a9e=_0x1b3a9e-0x0;var _0x53cdc2=_0x90b1[_0x1b3a9e];return _0x53cdc2;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var authService=require(_0x190b('0xf'));var hardwareService=require(_0x190b('0x10'));var Redis=require(_0x190b('0x11'));var qs=require(_0x190b('0x12'));var logger=require(_0x190b('0x13'))(_0x190b('0x14'));var utils=require(_0x190b('0x15'));var config=require('../../config/environment');var db=require(_0x190b('0x16'))['db'];function respondWithStatusCode(_0x5cf995,_0x5701ad){_0x5701ad=_0x5701ad||0xcc;return function(_0x4d63ac){if(_0x4d63ac){return _0x5cf995[_0x190b('0x17')](_0x5701ad);}return _0x5cf995[_0x190b('0x18')](_0x5701ad)[_0x190b('0x19')]();};}function respondWithResult(_0x3cd4cd,_0x1e1fd5){_0x1e1fd5=_0x1e1fd5||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x3cd4cd[_0x190b('0x18')](_0x1e1fd5)[_0x190b('0x1a')](_0x2e12d4);}};}function respondWithFilteredResult(_0x441e58,_0x186941){return function(_0x1a046f){if(_0x1a046f){var _0xab346=_0x1a046f[_0x190b('0x1b')],_0x3e8781=_0x186941['offset'],_0x3fbfc3=_0x186941[_0x190b('0x1c')]+_0x186941['limit'],_0x121867;if(_0x3fbfc3>=_0xab346){_0x3fbfc3=_0xab346;_0x121867=0xc8;}else{_0x121867=0xce;}_0x441e58[_0x190b('0x18')](_0x121867);return _0x441e58[_0x190b('0x1d')](_0x190b('0x1e'),_0x3e8781+'-'+_0x3fbfc3+'/'+_0xab346)[_0x190b('0x1a')](_0x1a046f);}return null;};}function patchUpdates(_0x50a3c4){return function(_0x298343){try{jsonpatch[_0x190b('0x1f')](_0x298343,_0x50a3c4,!![]);}catch(_0x441a2b){return BPromise[_0x190b('0x20')](_0x441a2b);}return _0x298343[_0x190b('0x21')]();};}function saveUpdates(_0x177170,_0x47d704){return function(_0x3ed24c){if(_0x3ed24c){return _0x3ed24c[_0x190b('0x22')](_0x177170)['then'](function(_0xb4c32b){return _0xb4c32b;});}return null;};}function removeEntity(_0x5740af,_0x55de01){return function(_0xcd15e5){if(_0xcd15e5){return _0xcd15e5[_0x190b('0x23')]()[_0x190b('0x24')](function(){_0x5740af['status'](0xcc)[_0x190b('0x19')]();});}};}function handleEntityNotFound(_0x2e633e,_0x16e989){return function(_0x292ce3){if(!_0x292ce3){_0x2e633e[_0x190b('0x17')](0x194);}return _0x292ce3;};}function handleError(_0x3ad3a5,_0x1bce97){_0x1bce97=_0x1bce97||0x1f4;return function(_0x519a76){logger['error'](_0x519a76[_0x190b('0x25')]);if(_0x519a76[_0x190b('0x26')]){delete _0x519a76['name'];}_0x3ad3a5['status'](_0x1bce97)[_0x190b('0x27')](_0x519a76);};}exports['index']=function(_0x328e5e,_0x3b6aaf){var _0x51f8b4={},_0x3e7a10={},_0x1deea6={'count':0x0,'rows':[]};var _0x5c89ab=db[_0x190b('0x28')][_0x190b('0x29')];_0x3e7a10[_0x190b('0x2a')]=_['keys'](_0x5c89ab);_0x3e7a10['query']=_[_0x190b('0x2b')](_0x328e5e['query']);_0x3e7a10[_0x190b('0x2c')]=_[_0x190b('0x2d')](_0x3e7a10['model'],_0x3e7a10[_0x190b('0x2e')]);_0x51f8b4['attributes']=_[_0x190b('0x2d')](_0x3e7a10['model'],qs[_0x190b('0x2f')](_0x328e5e['query'][_0x190b('0x2f')]));_0x51f8b4[_0x190b('0x30')]=_0x51f8b4['attributes'][_0x190b('0x31')]?_0x51f8b4[_0x190b('0x30')]:_0x3e7a10[_0x190b('0x2a')];if(!_0x328e5e[_0x190b('0x2e')][_0x190b('0x32')](_0x190b('0x33'))){_0x51f8b4[_0x190b('0x34')]=qs[_0x190b('0x34')](_0x328e5e['query']['limit']);_0x51f8b4[_0x190b('0x1c')]=qs[_0x190b('0x1c')](_0x328e5e['query'][_0x190b('0x1c')]);}_0x51f8b4[_0x190b('0x35')]=qs[_0x190b('0x36')](_0x328e5e[_0x190b('0x2e')][_0x190b('0x36')]);_0x51f8b4[_0x190b('0x37')]=qs[_0x190b('0x2c')](_['pick'](_0x328e5e['query'],_0x3e7a10[_0x190b('0x2c')]));if(_0x328e5e[_0x190b('0x2e')][_0x190b('0x38')]){_0x51f8b4['where']=_[_0x190b('0x39')](_0x51f8b4[_0x190b('0x37')],{'$or':_[_0x190b('0x3a')](_0x5c89ab,function(_0x5a9669){if(_0x5a9669[_0x190b('0x3b')]['key']!=='VIRTUAL'){var _0x1368b2={};_0x1368b2[_0x5a9669[_0x190b('0x3c')]]={'$like':'%'+_0x328e5e['query'][_0x190b('0x38')]+'%'};return _0x1368b2;}})});}_0x51f8b4=_[_0x190b('0x39')]({},_0x51f8b4,_0x328e5e[_0x190b('0x3d')]);var _0x5a9cba={'where':_0x51f8b4[_0x190b('0x37')]};return db[_0x190b('0x28')]['count'](_0x5a9cba)['then'](function(_0x2b9de5){_0x1deea6['count']=_0x2b9de5;if(_0x328e5e[_0x190b('0x2e')][_0x190b('0x3e')]){_0x51f8b4[_0x190b('0x3f')]=[{'all':!![]}];}return db[_0x190b('0x28')]['findAll'](_0x51f8b4);})[_0x190b('0x24')](function(_0x5f118c){_0x1deea6[_0x190b('0x40')]=_0x5f118c;return _0x1deea6;})[_0x190b('0x24')](respondWithFilteredResult(_0x3b6aaf,_0x51f8b4))['catch'](handleError(_0x3b6aaf,null));};exports[_0x190b('0x41')]=function(_0x2a75d2,_0x45b296){var _0x5d9548={'raw':!![],'where':{'id':_0x2a75d2['params']['id']}},_0x2c7c0e={};_0x2c7c0e['model']=_['keys'](db[_0x190b('0x28')][_0x190b('0x29')]);_0x2c7c0e[_0x190b('0x2e')]=_[_0x190b('0x2b')](_0x2a75d2['query']);_0x2c7c0e['filters']=_[_0x190b('0x2d')](_0x2c7c0e['model'],_0x2c7c0e[_0x190b('0x2e')]);_0x5d9548[_0x190b('0x30')]=_['intersection'](_0x2c7c0e[_0x190b('0x2a')],qs[_0x190b('0x2f')](_0x2a75d2[_0x190b('0x2e')]['fields']));_0x5d9548[_0x190b('0x30')]=_0x5d9548[_0x190b('0x30')]['length']?_0x5d9548[_0x190b('0x30')]:_0x2c7c0e['model'];if(_0x2a75d2[_0x190b('0x2e')][_0x190b('0x3e')]){_0x5d9548[_0x190b('0x3f')]=[{'all':!![]}];}_0x5d9548=_['merge']({},_0x5d9548,_0x2a75d2[_0x190b('0x3d')]);return db['MailSubstatus'][_0x190b('0x42')](_0x5d9548)[_0x190b('0x24')](handleEntityNotFound(_0x45b296,null))[_0x190b('0x24')](respondWithResult(_0x45b296,null))[_0x190b('0x43')](handleError(_0x45b296,null));};exports[_0x190b('0x44')]=function(_0xe736d9,_0x10bb82){return db['MailSubstatus'][_0x190b('0x44')](_0xe736d9[_0x190b('0x45')],{})[_0x190b('0x24')](respondWithResult(_0x10bb82,0xc9))['catch'](handleError(_0x10bb82,null));};exports[_0x190b('0x22')]=function(_0x27314f,_0x51af04){if(_0x27314f[_0x190b('0x45')]['id']){delete _0x27314f[_0x190b('0x45')]['id'];}return db['MailSubstatus'][_0x190b('0x42')]({'where':{'id':_0x27314f[_0x190b('0x46')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x51af04,null))['then'](saveUpdates(_0x27314f[_0x190b('0x45')],null))[_0x190b('0x24')](respondWithResult(_0x51af04,null))[_0x190b('0x43')](handleError(_0x51af04,null));};exports['destroy']=function(_0x4cb561,_0x14958e){return db[_0x190b('0x28')][_0x190b('0x42')]({'where':{'id':_0x4cb561[_0x190b('0x46')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x14958e,null))[_0x190b('0x24')](removeEntity(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x47')]=function(_0x177c32,_0x30b23b){return db['MailSubstatus'][_0x190b('0x47')]()[_0x190b('0x24')](respondWithResult(_0x30b23b,null))[_0x190b('0x43')](handleError(_0x30b23b,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b4b23a1..46699bd 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 _0x10f6=['mail_substatuses','lodash','util','../../config/logger','moment','bluebird','request-promise','./mailSubstatus.attributes','exports','define','MailSubstatus'];(function(_0x1875a5,_0x47d572){var _0x17f27d=function(_0x44c716){while(--_0x44c716){_0x1875a5['push'](_0x1875a5['shift']());}};_0x17f27d(++_0x47d572);}(_0x10f6,0x198));var _0x610f=function(_0xef7409,_0x58ffc5){_0xef7409=_0xef7409-0x0;var _0xebe8f4=_0x10f6[_0xef7409];return _0xebe8f4;};'use strict';var _=require(_0x610f('0x0'));var util=require(_0x610f('0x1'));var logger=require(_0x610f('0x2'))('api');var moment=require(_0x610f('0x3'));var BPromise=require(_0x610f('0x4'));var rp=require(_0x610f('0x5'));var attributes=require(_0x610f('0x6'));module[_0x610f('0x7')]=function(_0x2ab913,_0x265db0){return _0x2ab913[_0x610f('0x8')](_0x610f('0x9'),attributes,{'tableName':_0x610f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7c6=['request-promise','exports','define','mail_substatuses','lodash','util','../../config/logger','api','bluebird'];(function(_0x54d5d5,_0x4238cf){var _0x1a4195=function(_0x378f1a){while(--_0x378f1a){_0x54d5d5['push'](_0x54d5d5['shift']());}};_0x1a4195(++_0x4238cf);}(_0xf7c6,0x175));var _0x6f7c=function(_0x52b828,_0x359d0f){_0x52b828=_0x52b828-0x0;var _0x2721d8=_0xf7c6[_0x52b828];return _0x2721d8;};'use strict';var _=require(_0x6f7c('0x0'));var util=require(_0x6f7c('0x1'));var logger=require(_0x6f7c('0x2'))(_0x6f7c('0x3'));var moment=require('moment');var BPromise=require(_0x6f7c('0x4'));var rp=require(_0x6f7c('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0x6f7c('0x6')]=function(_0x377851,_0x2b4f74){return _0x377851[_0x6f7c('0x7')]('MailSubstatus',attributes,{'tableName':_0x6f7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index d9caabd..a052b8a 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 _0xaa63=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4f770b,_0x48ca59){var _0x521801=function(_0x44f498){while(--_0x44f498){_0x4f770b['push'](_0x4f770b['shift']());}};_0x521801(++_0x48ca59);}(_0xaa63,0x1cc));var _0x3aa6=function(_0x583a0b,_0x3c4d27){_0x583a0b=_0x583a0b-0x0;var _0x234c4a=_0xaa63[_0x583a0b];return _0x234c4a;};'use strict';var _=require(_0x3aa6('0x0'));var util=require(_0x3aa6('0x1'));var moment=require(_0x3aa6('0x2'));var BPromise=require(_0x3aa6('0x3'));var rs=require(_0x3aa6('0x4'));var fs=require('fs');var Redis=require(_0x3aa6('0x5'));var db=require(_0x3aa6('0x6'))['db'];var utils=require(_0x3aa6('0x7'));var logger=require(_0x3aa6('0x8'))(_0x3aa6('0x9'));var config=require(_0x3aa6('0xa'));var jayson=require(_0x3aa6('0xb'));var client=jayson['client'][_0x3aa6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3abb89,_0x358fa5,_0x5ec58d){return new BPromise(function(_0x3de0ff,_0x486b14){return client['request'](_0x3abb89,_0x5ec58d)[_0x3aa6('0xd')](function(_0x425318){logger['info'](_0x3aa6('0xe'),_0x358fa5,_0x3aa6('0xf'));logger['debug'](_0x3aa6('0x10'),_0x358fa5,_0x3aa6('0xf'),JSON[_0x3aa6('0x11')](_0x425318));if(_0x425318[_0x3aa6('0x12')]){if(_0x425318[_0x3aa6('0x12')][_0x3aa6('0x13')]===0x1f4){logger['error'](_0x3aa6('0xe'),_0x358fa5,_0x425318[_0x3aa6('0x12')][_0x3aa6('0x14')]);return _0x486b14(_0x425318[_0x3aa6('0x12')][_0x3aa6('0x14')]);}logger[_0x3aa6('0x12')](_0x3aa6('0xe'),_0x358fa5,_0x425318[_0x3aa6('0x12')]['message']);return _0x3de0ff(_0x425318['error']['message']);}else{logger['info'](_0x3aa6('0xe'),_0x358fa5,_0x3aa6('0xf'));_0x3de0ff(_0x425318[_0x3aa6('0x15')][_0x3aa6('0x14')]);}})[_0x3aa6('0x16')](function(_0x3ace50){logger[_0x3aa6('0x12')](_0x3aa6('0xe'),_0x358fa5,_0x3ace50);_0x486b14(_0x3ace50);});});} \ No newline at end of file +var _0xb473=['rpc','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x59b533,_0x59fdcc){var _0x2beced=function(_0xd3aaf3){while(--_0xd3aaf3){_0x59b533['push'](_0x59b533['shift']());}};_0x2beced(++_0x59fdcc);}(_0xb473,0x94));var _0x3b47=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xb473[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x3b47('0x0'));var util=require(_0x3b47('0x1'));var moment=require(_0x3b47('0x2'));var BPromise=require(_0x3b47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b47('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b47('0x5'));var logger=require('../../config/logger')(_0x3b47('0x6'));var config=require('../../config/environment');var jayson=require(_0x3b47('0x7'));var client=jayson[_0x3b47('0x8')][_0x3b47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x580356,_0x542974,_0x1a4777){return new BPromise(function(_0x2ad537,_0x403aef){return client[_0x3b47('0xa')](_0x580356,_0x1a4777)[_0x3b47('0xb')](function(_0x42e653){logger[_0x3b47('0xc')](_0x3b47('0xd'),_0x542974,_0x3b47('0xe'));logger[_0x3b47('0xf')](_0x3b47('0x10'),_0x542974,_0x3b47('0xe'),JSON['stringify'](_0x42e653));if(_0x42e653['error']){if(_0x42e653[_0x3b47('0x11')][_0x3b47('0x12')]===0x1f4){logger[_0x3b47('0x11')](_0x3b47('0xd'),_0x542974,_0x42e653[_0x3b47('0x11')][_0x3b47('0x13')]);return _0x403aef(_0x42e653['error'][_0x3b47('0x13')]);}logger[_0x3b47('0x11')](_0x3b47('0xd'),_0x542974,_0x42e653['error']['message']);return _0x2ad537(_0x42e653['error'][_0x3b47('0x13')]);}else{logger[_0x3b47('0xc')](_0x3b47('0xd'),_0x542974,_0x3b47('0xe'));_0x2ad537(_0x42e653[_0x3b47('0x14')][_0x3b47('0x13')]);}})[_0x3b47('0x15')](function(_0x5e30f6){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x542974,_0x5e30f6);_0x403aef(_0x5e30f6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index aebcf1a..e6c7f7b 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 _0xd9fb=['../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x542645,_0x2fdede){var _0x3ed498=function(_0x515390){while(--_0x515390){_0x542645['push'](_0x542645['shift']());}};_0x3ed498(++_0x2fdede);}(_0xd9fb,0x189));var _0xbd9f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xd9fb[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var path=require(_0xbd9f('0x2'));var timeout=require(_0xbd9f('0x3'));var express=require(_0xbd9f('0x4'));var router=express[_0xbd9f('0x5')]();var auth=require(_0xbd9f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbd9f('0x7'));var controller=require(_0xbd9f('0x8'));router['get']('/',auth[_0xbd9f('0x9')](),controller['index']);router[_0xbd9f('0xa')](_0xbd9f('0xb'),auth['isAuthenticated'](),controller[_0xbd9f('0xc')]);router[_0xbd9f('0xa')](_0xbd9f('0xd'),auth[_0xbd9f('0x9')](),controller['show']);router[_0xbd9f('0xe')]('/',auth[_0xbd9f('0x9')](),controller[_0xbd9f('0xf')]);router[_0xbd9f('0x10')](_0xbd9f('0xd'),auth[_0xbd9f('0x9')](),controller[_0xbd9f('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbd9f('0x12')]=router; \ No newline at end of file +var _0x7bd0=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x49f1f5,_0x3cfe20){var _0xf8dcf8=function(_0x100754){while(--_0x100754){_0x49f1f5['push'](_0x49f1f5['shift']());}};_0xf8dcf8(++_0x3cfe20);}(_0x7bd0,0x111));var _0x07bd=function(_0x58381c,_0x3b9374){_0x58381c=_0x58381c-0x0;var _0x1a7440=_0x7bd0[_0x58381c];return _0x1a7440;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var auth=require(_0x07bd('0x6'));var interaction=require(_0x07bd('0x7'));var config=require('../../config/environment');var controller=require(_0x07bd('0x8'));router[_0x07bd('0x9')]('/',auth[_0x07bd('0xa')](),controller[_0x07bd('0xb')]);router[_0x07bd('0x9')](_0x07bd('0xc'),auth[_0x07bd('0xa')](),controller['describe']);router[_0x07bd('0x9')]('/:id',auth[_0x07bd('0xa')](),controller[_0x07bd('0xd')]);router[_0x07bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x07bd('0xf')]);router[_0x07bd('0x10')](_0x07bd('0x11'),auth[_0x07bd('0xa')](),controller['update']);router[_0x07bd('0x12')](_0x07bd('0x11'),auth[_0x07bd('0xa')](),controller[_0x07bd('0x13')]);module[_0x07bd('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index edd3af5..9a8c08e 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 _0xb435=['sequelize','exports','account','agent','queue','DATE'];(function(_0x1d056a,_0x293d07){var _0x8e14c0=function(_0xb2a20a){while(--_0xb2a20a){_0x1d056a['push'](_0x1d056a['shift']());}};_0x8e14c0(++_0x293d07);}(_0xb435,0xde));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b43('0x0'));module[_0x5b43('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5b43('0x2'),_0x5b43('0x3'),_0x5b43('0x4')),'allowNull':![],'defaultValue':_0x5b43('0x4')},'transferredAt':{'type':Sequelize[_0x5b43('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x1809=['ENUM','agent','DATE','NOW','exports','STRING'];(function(_0x4ffee5,_0x14b18a){var _0x520241=function(_0x3dfb46){while(--_0x3dfb46){_0x4ffee5['push'](_0x4ffee5['shift']());}};_0x520241(++_0x14b18a);}(_0x1809,0x14e));var _0x9180=function(_0x31542f,_0x3d128e){_0x31542f=_0x31542f-0x0;var _0x397937=_0x1809[_0x31542f];return _0x397937;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9180('0x0')]={'uniqueid':{'type':Sequelize[_0x9180('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9180('0x2')]('account',_0x9180('0x3'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x9180('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x9180('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 8151b42..fe2b4f2 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 _0xbaf0=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var authService=require(_0x0baf('0x12'));var hardwareService=require(_0x0baf('0x13'));var Redis=require(_0x0baf('0x14'));var qs=require(_0x0baf('0x15'));var logger=require(_0x0baf('0x16'))(_0x0baf('0x17'));var utils=require(_0x0baf('0x18'));var config=require(_0x0baf('0x19'));var db=require(_0x0baf('0x1a'))['db'];function respondWithStatusCode(_0x51d93c,_0x5a53e2){_0x5a53e2=_0x5a53e2||0xcc;return function(_0x465dd7){if(_0x465dd7){return _0x51d93c[_0x0baf('0x1b')](_0x5a53e2);}return _0x51d93c[_0x0baf('0x1c')](_0x5a53e2)[_0x0baf('0x1d')]();};}function respondWithResult(_0x5a0583,_0x2ab33e){_0x2ab33e=_0x2ab33e||0xc8;return function(_0x49e44b){if(_0x49e44b){return _0x5a0583[_0x0baf('0x1c')](_0x2ab33e)[_0x0baf('0x1e')](_0x49e44b);}};}function respondWithFilteredResult(_0x7fbf67,_0x2bc381){return function(_0xb8339e){if(_0xb8339e){var _0x469599=_0xb8339e[_0x0baf('0x1f')],_0x4f80a8=_0x2bc381[_0x0baf('0x20')],_0x4cd79d=_0x2bc381[_0x0baf('0x20')]+_0x2bc381[_0x0baf('0x21')],_0x2312c7;if(_0x4cd79d>=_0x469599){_0x4cd79d=_0x469599;_0x2312c7=0xc8;}else{_0x2312c7=0xce;}_0x7fbf67[_0x0baf('0x1c')](_0x2312c7);return _0x7fbf67['set'](_0x0baf('0x22'),_0x4f80a8+'-'+_0x4cd79d+'/'+_0x469599)[_0x0baf('0x1e')](_0xb8339e);}return null;};}function patchUpdates(_0x1ef0e5){return function(_0x3e9cb4){try{jsonpatch[_0x0baf('0x23')](_0x3e9cb4,_0x1ef0e5,!![]);}catch(_0x42b7f2){return BPromise['reject'](_0x42b7f2);}return _0x3e9cb4['save']();};}function saveUpdates(_0x1410ec,_0x154f48){return function(_0x32e839){if(_0x32e839){return _0x32e839[_0x0baf('0x24')](_0x1410ec)[_0x0baf('0x25')](function(_0x3e3e20){return _0x3e3e20;});}return null;};}function removeEntity(_0x210cd8,_0x636a13){return function(_0x2c42e2){if(_0x2c42e2){return _0x2c42e2[_0x0baf('0x26')]()['then'](function(){_0x210cd8[_0x0baf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6c158,_0x5dbf00){return function(_0x4de74c){if(!_0x4de74c){_0xf6c158[_0x0baf('0x1b')](0x194);}return _0x4de74c;};}function handleError(_0x48a0e9,_0x4be1b9){_0x4be1b9=_0x4be1b9||0x1f4;return function(_0x47c4b){logger[_0x0baf('0x27')](_0x47c4b[_0x0baf('0x28')]);if(_0x47c4b[_0x0baf('0x29')]){delete _0x47c4b[_0x0baf('0x29')];}_0x48a0e9['status'](_0x4be1b9)[_0x0baf('0x2a')](_0x47c4b);};}exports[_0x0baf('0x2b')]=function(_0x1ca35a,_0x366e71){var _0x3843b8={},_0x3b9b31={},_0x453525={'count':0x0,'rows':[]};var _0x549fd0=db[_0x0baf('0x2c')][_0x0baf('0x2d')];_0x3b9b31[_0x0baf('0x2e')]=_[_0x0baf('0x2f')](_0x549fd0);_0x3b9b31['query']=_[_0x0baf('0x2f')](_0x1ca35a[_0x0baf('0x30')]);_0x3b9b31['filters']=_[_0x0baf('0x31')](_0x3b9b31[_0x0baf('0x2e')],_0x3b9b31[_0x0baf('0x30')]);_0x3843b8[_0x0baf('0x32')]=_[_0x0baf('0x31')](_0x3b9b31[_0x0baf('0x2e')],qs[_0x0baf('0x33')](_0x1ca35a['query'][_0x0baf('0x33')]));_0x3843b8[_0x0baf('0x32')]=_0x3843b8[_0x0baf('0x32')][_0x0baf('0x34')]?_0x3843b8[_0x0baf('0x32')]:_0x3b9b31[_0x0baf('0x2e')];if(!_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x35')](_0x0baf('0x36'))){_0x3843b8[_0x0baf('0x21')]=qs[_0x0baf('0x21')](_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x21')]);_0x3843b8[_0x0baf('0x20')]=qs['offset'](_0x1ca35a[_0x0baf('0x30')]['offset']);}_0x3843b8[_0x0baf('0x37')]=qs[_0x0baf('0x38')](_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x38')]);_0x3843b8['where']=qs[_0x0baf('0x39')](_[_0x0baf('0x3a')](_0x1ca35a['query'],_0x3b9b31[_0x0baf('0x39')]));if(_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x3b')]){_0x3843b8[_0x0baf('0x3c')]=_[_0x0baf('0x3d')](_0x3843b8[_0x0baf('0x3c')],{'$or':_[_0x0baf('0x3e')](_0x549fd0,function(_0x675461){if(_0x675461['type'][_0x0baf('0x3f')]!==_0x0baf('0x40')){var _0x5b991f={};_0x5b991f[_0x675461[_0x0baf('0x41')]]={'$like':'%'+_0x1ca35a['query']['filter']+'%'};return _0x5b991f;}})});}_0x3843b8=_[_0x0baf('0x3d')]({},_0x3843b8,_0x1ca35a[_0x0baf('0x42')]);var _0x5d3ad1={'where':_0x3843b8['where']};return db[_0x0baf('0x2c')][_0x0baf('0x1f')](_0x5d3ad1)[_0x0baf('0x25')](function(_0xb2d9ab){_0x453525[_0x0baf('0x1f')]=_0xb2d9ab;if(_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x43')]){_0x3843b8[_0x0baf('0x44')]=[{'all':!![]}];}return db[_0x0baf('0x2c')][_0x0baf('0x45')](_0x3843b8);})[_0x0baf('0x25')](function(_0x148540){_0x453525[_0x0baf('0x46')]=_0x148540;return _0x453525;})[_0x0baf('0x25')](respondWithFilteredResult(_0x366e71,_0x3843b8))['catch'](handleError(_0x366e71,null));};exports[_0x0baf('0x47')]=function(_0x1435d5,_0x4f1de9){var _0x38006a={'raw':!![],'where':{'id':_0x1435d5[_0x0baf('0x48')]['id']}},_0x324369={};_0x324369[_0x0baf('0x2e')]=_[_0x0baf('0x2f')](db[_0x0baf('0x2c')]['rawAttributes']);_0x324369[_0x0baf('0x30')]=_[_0x0baf('0x2f')](_0x1435d5['query']);_0x324369[_0x0baf('0x39')]=_[_0x0baf('0x31')](_0x324369[_0x0baf('0x2e')],_0x324369[_0x0baf('0x30')]);_0x38006a['attributes']=_[_0x0baf('0x31')](_0x324369[_0x0baf('0x2e')],qs[_0x0baf('0x33')](_0x1435d5[_0x0baf('0x30')][_0x0baf('0x33')]));_0x38006a[_0x0baf('0x32')]=_0x38006a[_0x0baf('0x32')][_0x0baf('0x34')]?_0x38006a[_0x0baf('0x32')]:_0x324369[_0x0baf('0x2e')];if(_0x1435d5['query'][_0x0baf('0x43')]){_0x38006a[_0x0baf('0x44')]=[{'all':!![]}];}_0x38006a=_[_0x0baf('0x3d')]({},_0x38006a,_0x1435d5[_0x0baf('0x42')]);return db[_0x0baf('0x2c')]['find'](_0x38006a)[_0x0baf('0x25')](handleEntityNotFound(_0x4f1de9,null))[_0x0baf('0x25')](respondWithResult(_0x4f1de9,null))[_0x0baf('0x49')](handleError(_0x4f1de9,null));};exports[_0x0baf('0x4a')]=function(_0x35b5db,_0x54ed41){return db[_0x0baf('0x2c')][_0x0baf('0x4a')](_0x35b5db[_0x0baf('0x4b')],{})[_0x0baf('0x25')](respondWithResult(_0x54ed41,0xc9))[_0x0baf('0x49')](handleError(_0x54ed41,null));};exports[_0x0baf('0x24')]=function(_0x178995,_0x5679d9){if(_0x178995[_0x0baf('0x4b')]['id']){delete _0x178995[_0x0baf('0x4b')]['id'];}return db[_0x0baf('0x2c')]['find']({'where':{'id':_0x178995[_0x0baf('0x48')]['id']}})[_0x0baf('0x25')](handleEntityNotFound(_0x5679d9,null))[_0x0baf('0x25')](saveUpdates(_0x178995[_0x0baf('0x4b')],null))[_0x0baf('0x25')](respondWithResult(_0x5679d9,null))[_0x0baf('0x49')](handleError(_0x5679d9,null));};exports[_0x0baf('0x26')]=function(_0x5a54bb,_0x22c451){return db[_0x0baf('0x2c')][_0x0baf('0x4c')]({'where':{'id':_0x5a54bb[_0x0baf('0x48')]['id']}})[_0x0baf('0x25')](handleEntityNotFound(_0x22c451,null))[_0x0baf('0x25')](removeEntity(_0x22c451,null))[_0x0baf('0x49')](handleError(_0x22c451,null));};exports[_0x0baf('0x4d')]=function(_0x2be7fe,_0x19c008){return db[_0x0baf('0x2c')]['describe']()['then'](respondWithResult(_0x19c008,null))[_0x0baf('0x49')](handleError(_0x19c008,null));}; \ No newline at end of file +var _0xbdb7=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','map','type','key','VIRTUAL','field','include','findAll','rows','catch','show','includeAll','options','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','MailTransferReport','rawAttributes'];(function(_0x30baa5,_0x55f49d){var _0x2feff9=function(_0x19114b){while(--_0x19114b){_0x30baa5['push'](_0x30baa5['shift']());}};_0x2feff9(++_0x55f49d);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0xbdb7[_0x3825a8];return _0xabc9bc;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var authService=require(_0x7bdb('0xf'));var hardwareService=require(_0x7bdb('0x10'));var Redis=require(_0x7bdb('0x11'));var qs=require(_0x7bdb('0x12'));var logger=require(_0x7bdb('0x13'))(_0x7bdb('0x14'));var utils=require(_0x7bdb('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b9b9,_0x3053d0){_0x3053d0=_0x3053d0||0xcc;return function(_0x25e3cb){if(_0x25e3cb){return _0x52b9b9['sendStatus'](_0x3053d0);}return _0x52b9b9[_0x7bdb('0x16')](_0x3053d0)['end']();};}function respondWithResult(_0x5898c1,_0x2abca6){_0x2abca6=_0x2abca6||0xc8;return function(_0x46dd4a){if(_0x46dd4a){return _0x5898c1['status'](_0x2abca6)['json'](_0x46dd4a);}};}function respondWithFilteredResult(_0x4e98f7,_0x4476ff){return function(_0x195b2e){if(_0x195b2e){var _0xe9919f=_0x195b2e[_0x7bdb('0x17')],_0x25d417=_0x4476ff[_0x7bdb('0x18')],_0x31c909=_0x4476ff['offset']+_0x4476ff[_0x7bdb('0x19')],_0xbde12a;if(_0x31c909>=_0xe9919f){_0x31c909=_0xe9919f;_0xbde12a=0xc8;}else{_0xbde12a=0xce;}_0x4e98f7[_0x7bdb('0x16')](_0xbde12a);return _0x4e98f7[_0x7bdb('0x1a')](_0x7bdb('0x1b'),_0x25d417+'-'+_0x31c909+'/'+_0xe9919f)['json'](_0x195b2e);}return null;};}function patchUpdates(_0x41f540){return function(_0x23e9eb){try{jsonpatch['apply'](_0x23e9eb,_0x41f540,!![]);}catch(_0x3e5f8e){return BPromise[_0x7bdb('0x1c')](_0x3e5f8e);}return _0x23e9eb[_0x7bdb('0x1d')]();};}function saveUpdates(_0x45d552,_0x112793){return function(_0x5bfc35){if(_0x5bfc35){return _0x5bfc35['update'](_0x45d552)[_0x7bdb('0x1e')](function(_0xcb25f2){return _0xcb25f2;});}return null;};}function removeEntity(_0x5daea4,_0x341fe4){return function(_0x118ea1){if(_0x118ea1){return _0x118ea1[_0x7bdb('0x1f')]()[_0x7bdb('0x1e')](function(){_0x5daea4[_0x7bdb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d37ac,_0xdad53d){return function(_0x40c447){if(!_0x40c447){_0x1d37ac[_0x7bdb('0x20')](0x194);}return _0x40c447;};}function handleError(_0x481f4b,_0x4d6e44){_0x4d6e44=_0x4d6e44||0x1f4;return function(_0x3c423f){logger['error'](_0x3c423f['stack']);if(_0x3c423f['name']){delete _0x3c423f[_0x7bdb('0x21')];}_0x481f4b['status'](_0x4d6e44)[_0x7bdb('0x22')](_0x3c423f);};}exports[_0x7bdb('0x23')]=function(_0x3ec129,_0x7c09cf){var _0x2a494e={},_0x523869={},_0x10e818={'count':0x0,'rows':[]};var _0x32242d=db[_0x7bdb('0x24')][_0x7bdb('0x25')];_0x523869[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](_0x32242d);_0x523869[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x3ec129[_0x7bdb('0x28')]);_0x523869[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],_0x523869['query']);_0x2a494e[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x523869[_0x7bdb('0x26')],qs[_0x7bdb('0x2c')](_0x3ec129[_0x7bdb('0x28')]['fields']));_0x2a494e[_0x7bdb('0x2b')]=_0x2a494e[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2a494e[_0x7bdb('0x2b')]:_0x523869['model'];if(!_0x3ec129['query']['hasOwnProperty'](_0x7bdb('0x2e'))){_0x2a494e['limit']=qs[_0x7bdb('0x19')](_0x3ec129['query'][_0x7bdb('0x19')]);_0x2a494e[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x3ec129['query'][_0x7bdb('0x18')]);}_0x2a494e['order']=qs['sort'](_0x3ec129[_0x7bdb('0x28')]['sort']);_0x2a494e[_0x7bdb('0x2f')]=qs['filters'](_['pick'](_0x3ec129[_0x7bdb('0x28')],_0x523869[_0x7bdb('0x29')]));if(_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]){_0x2a494e[_0x7bdb('0x2f')]=_[_0x7bdb('0x31')](_0x2a494e['where'],{'$or':_[_0x7bdb('0x32')](_0x32242d,function(_0x464fde){if(_0x464fde[_0x7bdb('0x33')][_0x7bdb('0x34')]!==_0x7bdb('0x35')){var _0x14c522={};_0x14c522[_0x464fde[_0x7bdb('0x36')]]={'$like':'%'+_0x3ec129[_0x7bdb('0x28')][_0x7bdb('0x30')]+'%'};return _0x14c522;}})});}_0x2a494e=_['merge']({},_0x2a494e,_0x3ec129['options']);var _0x19c237={'where':_0x2a494e[_0x7bdb('0x2f')]};return db[_0x7bdb('0x24')][_0x7bdb('0x17')](_0x19c237)[_0x7bdb('0x1e')](function(_0x509e90){_0x10e818['count']=_0x509e90;if(_0x3ec129[_0x7bdb('0x28')]['includeAll']){_0x2a494e[_0x7bdb('0x37')]=[{'all':!![]}];}return db['MailTransferReport'][_0x7bdb('0x38')](_0x2a494e);})['then'](function(_0x4cf3fa){_0x10e818[_0x7bdb('0x39')]=_0x4cf3fa;return _0x10e818;})[_0x7bdb('0x1e')](respondWithFilteredResult(_0x7c09cf,_0x2a494e))[_0x7bdb('0x3a')](handleError(_0x7c09cf,null));};exports[_0x7bdb('0x3b')]=function(_0x43c7d3,_0x2b4829){var _0x2e10f3={'raw':!![],'where':{'id':_0x43c7d3['params']['id']}},_0x501aff={};_0x501aff[_0x7bdb('0x26')]=_[_0x7bdb('0x27')](db[_0x7bdb('0x24')][_0x7bdb('0x25')]);_0x501aff[_0x7bdb('0x28')]=_[_0x7bdb('0x27')](_0x43c7d3[_0x7bdb('0x28')]);_0x501aff['filters']=_['intersection'](_0x501aff[_0x7bdb('0x26')],_0x501aff[_0x7bdb('0x28')]);_0x2e10f3[_0x7bdb('0x2b')]=_[_0x7bdb('0x2a')](_0x501aff['model'],qs[_0x7bdb('0x2c')](_0x43c7d3['query'][_0x7bdb('0x2c')]));_0x2e10f3[_0x7bdb('0x2b')]=_0x2e10f3[_0x7bdb('0x2b')][_0x7bdb('0x2d')]?_0x2e10f3[_0x7bdb('0x2b')]:_0x501aff[_0x7bdb('0x26')];if(_0x43c7d3[_0x7bdb('0x28')][_0x7bdb('0x3c')]){_0x2e10f3[_0x7bdb('0x37')]=[{'all':!![]}];}_0x2e10f3=_['merge']({},_0x2e10f3,_0x43c7d3[_0x7bdb('0x3d')]);return db[_0x7bdb('0x24')]['find'](_0x2e10f3)[_0x7bdb('0x1e')](handleEntityNotFound(_0x2b4829,null))['then'](respondWithResult(_0x2b4829,null))[_0x7bdb('0x3a')](handleError(_0x2b4829,null));};exports[_0x7bdb('0x3e')]=function(_0x122beb,_0x3a8415){return db[_0x7bdb('0x24')]['create'](_0x122beb[_0x7bdb('0x3f')],{})[_0x7bdb('0x1e')](respondWithResult(_0x3a8415,0xc9))[_0x7bdb('0x3a')](handleError(_0x3a8415,null));};exports[_0x7bdb('0x40')]=function(_0x31244f,_0x5021cd){if(_0x31244f[_0x7bdb('0x3f')]['id']){delete _0x31244f[_0x7bdb('0x3f')]['id'];}return db[_0x7bdb('0x24')][_0x7bdb('0x41')]({'where':{'id':_0x31244f[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x1e')](handleEntityNotFound(_0x5021cd,null))[_0x7bdb('0x1e')](saveUpdates(_0x31244f[_0x7bdb('0x3f')],null))[_0x7bdb('0x1e')](respondWithResult(_0x5021cd,null))[_0x7bdb('0x3a')](handleError(_0x5021cd,null));};exports['destroy']=function(_0x189cf8,_0x58c4bc){return db['MailTransferReport'][_0x7bdb('0x41')]({'where':{'id':_0x189cf8[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x58c4bc,null))[_0x7bdb('0x1e')](removeEntity(_0x58c4bc,null))[_0x7bdb('0x3a')](handleError(_0x58c4bc,null));};exports['describe']=function(_0x54ac12,_0x4edd0d){return db[_0x7bdb('0x24')][_0x7bdb('0x43')]()[_0x7bdb('0x1e')](respondWithResult(_0x4edd0d,null))[_0x7bdb('0x3a')](handleError(_0x4edd0d,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8791f3c..a6585ff 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 _0x9861=['lodash','api','moment','bluebird','request-promise','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x3aeb31,_0x141748){var _0x5ebc7f=function(_0x5d9c2c){while(--_0x5d9c2c){_0x3aeb31['push'](_0x3aeb31['shift']());}};_0x5ebc7f(++_0x141748);}(_0x9861,0x176));var _0x1986=function(_0x141523,_0x21fbca){_0x141523=_0x141523-0x0;var _0x5b6ea5=_0x9861[_0x141523];return _0x5b6ea5;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var attributes=require(_0x1986('0x5'));module[_0x1986('0x6')]=function(_0x5462a7,_0xe033ef){return _0x5462a7[_0x1986('0x7')](_0x1986('0x8'),attributes,{'tableName':_0x1986('0x9'),'paranoid':![],'indexes':[{'name':_0x1986('0xa'),'fields':[_0x1986('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x353f=['define','MailTransferReport','uniqueid','util','api','moment','request-promise','./mailTransferReport.attributes','exports'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0x353f,0x1d7));var _0xf353=function(_0x2daad0,_0x173afe){_0x2daad0=_0x2daad0-0x0;var _0x56d367=_0x353f[_0x2daad0];return _0x56d367;};'use strict';var _=require('lodash');var util=require(_0xf353('0x0'));var logger=require('../../config/logger')(_0xf353('0x1'));var moment=require(_0xf353('0x2'));var BPromise=require('bluebird');var rp=require(_0xf353('0x3'));var attributes=require(_0xf353('0x4'));module[_0xf353('0x5')]=function(_0x5e17d0,_0x2a36f0){return _0x5e17d0[_0xf353('0x6')](_0xf353('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf353('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6b337eb..4544516 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 _0xffae=['MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','then','info'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xffae,0x138));var _0xeffa=function(_0x1d77b0,_0x445be4){_0x1d77b0=_0x1d77b0-0x0;var _0x517e78=_0xffae[_0x1d77b0];return _0x517e78;};'use strict';var _=require('lodash');var util=require(_0xeffa('0x0'));var moment=require(_0xeffa('0x1'));var BPromise=require(_0xeffa('0x2'));var rs=require(_0xeffa('0x3'));var fs=require('fs');var Redis=require(_0xeffa('0x4'));var db=require(_0xeffa('0x5'))['db'];var utils=require(_0xeffa('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeffa('0x7'));var jayson=require(_0xeffa('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ac54d,_0x40fa9b,_0x49f214){return new BPromise(function(_0x562f5,_0x12b552){return client['request'](_0x4ac54d,_0x49f214)[_0xeffa('0x9')](function(_0x24b8c9){logger[_0xeffa('0xa')](_0xeffa('0xb'),_0x40fa9b,_0xeffa('0xc'));logger['debug'](_0xeffa('0xd'),_0x40fa9b,_0xeffa('0xc'),JSON[_0xeffa('0xe')](_0x24b8c9));if(_0x24b8c9[_0xeffa('0xf')]){if(_0x24b8c9[_0xeffa('0xf')][_0xeffa('0x10')]===0x1f4){logger['error'](_0xeffa('0xb'),_0x40fa9b,_0x24b8c9[_0xeffa('0xf')]['message']);return _0x12b552(_0x24b8c9[_0xeffa('0xf')][_0xeffa('0x11')]);}logger[_0xeffa('0xf')](_0xeffa('0xb'),_0x40fa9b,_0x24b8c9['error'][_0xeffa('0x11')]);return _0x562f5(_0x24b8c9[_0xeffa('0xf')][_0xeffa('0x11')]);}else{logger[_0xeffa('0xa')](_0xeffa('0xb'),_0x40fa9b,'request\x20sent');_0x562f5(_0x24b8c9[_0xeffa('0x12')][_0xeffa('0x11')]);}})['catch'](function(_0x546c5b){logger['error'](_0xeffa('0xb'),_0x40fa9b,_0x546c5b);_0x12b552(_0x546c5b);});});} \ No newline at end of file +var _0xb799=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4316e7,_0x44d9d6){var _0x3daa97=function(_0x50d3ab){while(--_0x50d3ab){_0x4316e7['push'](_0x4316e7['shift']());}};_0x3daa97(++_0x44d9d6);}(_0xb799,0x180));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b79('0x0'));var util=require(_0x9b79('0x1'));var moment=require('moment');var BPromise=require(_0x9b79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b79('0x3'));var db=require(_0x9b79('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b79('0x5'))(_0x9b79('0x6'));var config=require(_0x9b79('0x7'));var jayson=require(_0x9b79('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21a718,_0x8c66a2,_0x16082e){return new BPromise(function(_0x3a06e8,_0x460ecf){return client[_0x9b79('0x9')](_0x21a718,_0x16082e)['then'](function(_0x2d98fa){logger[_0x9b79('0xa')](_0x9b79('0xb'),_0x8c66a2,_0x9b79('0xc'));logger['debug'](_0x9b79('0xd'),_0x8c66a2,_0x9b79('0xc'),JSON[_0x9b79('0xe')](_0x2d98fa));if(_0x2d98fa[_0x9b79('0xf')]){if(_0x2d98fa['error'][_0x9b79('0x10')]===0x1f4){logger[_0x9b79('0xf')](_0x9b79('0xb'),_0x8c66a2,_0x2d98fa['error'][_0x9b79('0x11')]);return _0x460ecf(_0x2d98fa[_0x9b79('0xf')][_0x9b79('0x11')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x8c66a2,_0x2d98fa[_0x9b79('0xf')][_0x9b79('0x11')]);return _0x3a06e8(_0x2d98fa[_0x9b79('0xf')]['message']);}else{logger['info'](_0x9b79('0xb'),_0x8c66a2,_0x9b79('0xc'));_0x3a06e8(_0x2d98fa[_0x9b79('0x12')][_0x9b79('0x11')]);}})[_0x9b79('0x13')](function(_0x55d3c4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x8c66a2,_0x55d3c4);_0x460ecf(_0x55d3c4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index ff13596..dc249fb 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 _0xdb9e=['/:id','update','util','connect-timeout','express','Router','../../config/environment','./memberReport.controller','isAuthenticated','/describe','describe','get','show','post','create','put'];(function(_0xe813ea,_0x54fea6){var _0x1df6fc=function(_0x5b5723){while(--_0x5b5723){_0xe813ea['push'](_0xe813ea['shift']());}};_0x1df6fc(++_0x54fea6);}(_0xdb9e,0x1b2));var _0xedb9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdb9e[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xedb9('0x0'));var path=require('path');var timeout=require(_0xedb9('0x1'));var express=require(_0xedb9('0x2'));var router=express[_0xedb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xedb9('0x4'));var controller=require(_0xedb9('0x5'));router['get']('/',auth[_0xedb9('0x6')](),controller['index']);router['get'](_0xedb9('0x7'),auth[_0xedb9('0x6')](),controller[_0xedb9('0x8')]);router[_0xedb9('0x9')]('/:id',auth[_0xedb9('0x6')](),controller[_0xedb9('0xa')]);router[_0xedb9('0xb')]('/',auth['isAuthenticated'](),controller[_0xedb9('0xc')]);router[_0xedb9('0xd')](_0xedb9('0xe'),auth['isAuthenticated'](),controller[_0xedb9('0xf')]);router['delete']('/:id',auth[_0xedb9('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x142b=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get'];(function(_0x57b933,_0x4860e5){var _0x36cb07=function(_0x27aadd){while(--_0x27aadd){_0x57b933['push'](_0x57b933['shift']());}};_0x36cb07(++_0x4860e5);}(_0x142b,0x17b));var _0xb142=function(_0x23bcaa,_0x15a71a){_0x23bcaa=_0x23bcaa-0x0;var _0x38cb22=_0x142b[_0x23bcaa];return _0x38cb22;};'use strict';var multer=require(_0xb142('0x0'));var util=require(_0xb142('0x1'));var path=require('path');var timeout=require(_0xb142('0x2'));var express=require(_0xb142('0x3'));var router=express[_0xb142('0x4')]();var auth=require(_0xb142('0x5'));var interaction=require(_0xb142('0x6'));var config=require(_0xb142('0x7'));var controller=require(_0xb142('0x8'));router['get']('/',auth[_0xb142('0x9')](),controller[_0xb142('0xa')]);router[_0xb142('0xb')](_0xb142('0xc'),auth[_0xb142('0x9')](),controller[_0xb142('0xd')]);router[_0xb142('0xb')](_0xb142('0xe'),auth[_0xb142('0x9')](),controller[_0xb142('0xf')]);router[_0xb142('0x10')]('/',auth[_0xb142('0x9')](),controller[_0xb142('0x11')]);router[_0xb142('0x12')]('/:id',auth[_0xb142('0x9')](),controller[_0xb142('0x13')]);router[_0xb142('0x14')](_0xb142('0xe'),auth[_0xb142('0x9')](),controller[_0xb142('0x15')]);module[_0xb142('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e8a28a3..079d195 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 _0xd192=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x1f963c,_0x5d8dab){var _0x3f6bba=function(_0x911927){while(--_0x911927){_0x1f963c['push'](_0x1f963c['shift']());}};_0x3f6bba(++_0x5d8dab);}(_0xd192,0x14f));var _0x2d19=function(_0x4a9e2e,_0x1b3111){_0x4a9e2e=_0x4a9e2e-0x0;var _0xdfbcd1=_0xd192[_0x4a9e2e];return _0xdfbcd1;};'use strict';var Sequelize=require(_0x2d19('0x0'));var moment=require('moment');module[_0x2d19('0x1')]={'channel':{'type':Sequelize[_0x2d19('0x2')]},'membername':{'type':Sequelize[_0x2d19('0x2')]},'interface':{'type':Sequelize[_0x2d19('0x2')]},'type':{'type':Sequelize[_0x2d19('0x2')],'defaultValue':_0x2d19('0x3'),'comment':_0x2d19('0x4')},'duration':{'type':Sequelize[_0x2d19('0x5')]},'enterAt':{'type':Sequelize[_0x2d19('0x6')]},'exitAt':{'type':Sequelize[_0x2d19('0x6')],'set':function(_0xfeb472){var _0x42919a=moment(_0xfeb472);var _0x4e44e=moment(this['getDataValue'](_0x2d19('0x7')));var _0xeec0ef=_0x42919a[_0x2d19('0x8')](_0x4e44e,'seconds');this[_0x2d19('0x9')](_0x2d19('0xa'),_0xfeb472);this[_0x2d19('0x9')](_0x2d19('0xb'),_0xeec0ef||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x2d19('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x2d19('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x2d19('0xe')},'data4':{'type':Sequelize[_0x2d19('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x2d19('0xf')},'role':{'type':Sequelize[_0x2d19('0x2')]},'internal':{'type':Sequelize[_0x2d19('0x5')]},'uniqueid':{'type':Sequelize[_0x2d19('0x2')]}}; \ No newline at end of file +var _0x0bd6=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds'];(function(_0x495110,_0x3a7833){var _0x18707e=function(_0x531fe2){while(--_0x531fe2){_0x495110['push'](_0x495110['shift']());}};_0x18707e(++_0x3a7833);}(_0x0bd6,0x182));var _0x60bd=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0bd6[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x60bd('0x0'));var moment=require('moment');module[_0x60bd('0x1')]={'channel':{'type':Sequelize[_0x60bd('0x2')]},'membername':{'type':Sequelize[_0x60bd('0x2')]},'interface':{'type':Sequelize[_0x60bd('0x2')]},'type':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x3'),'comment':_0x60bd('0x4')},'duration':{'type':Sequelize[_0x60bd('0x5')]},'enterAt':{'type':Sequelize[_0x60bd('0x6')]},'exitAt':{'type':Sequelize[_0x60bd('0x6')],'set':function(_0x1193a1){var _0x3182b0=moment(_0x1193a1);var _0x44147a=moment(this[_0x60bd('0x7')](_0x60bd('0x8')));var _0x3e0607=_0x3182b0['diff'](_0x44147a,_0x60bd('0x9'));this[_0x60bd('0xa')](_0x60bd('0xb'),_0x1193a1);this[_0x60bd('0xa')](_0x60bd('0xc'),_0x3e0607||null);}},'data1':{'type':Sequelize[_0x60bd('0x2')],'comment':_0x60bd('0xd')},'data2':{'type':Sequelize[_0x60bd('0x2')],'comment':_0x60bd('0xe')},'data3':{'type':Sequelize[_0x60bd('0x2')],'comment':_0x60bd('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0x60bd('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0x60bd('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x60bd('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b01c744..c88e8f9 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 _0xe3cc=['mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','MemberReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x30db95,_0x180bd6){var _0x24ed8d=function(_0x2409b9){while(--_0x2409b9){_0x30db95['push'](_0x30db95['shift']());}};_0x24ed8d(++_0x180bd6);}(_0xe3cc,0x122));var _0xce3c=function(_0x518833,_0x5ce036){_0x518833=_0x518833-0x0;var _0x94a4b2=_0xe3cc[_0x518833];return _0x94a4b2;};'use strict';var pdf=require(_0xce3c('0x0'));var emlformat=require(_0xce3c('0x1'));var rimraf=require(_0xce3c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce3c('0x3'));var rp=require(_0xce3c('0x4'));var moment=require('moment');var BPromise=require(_0xce3c('0x5'));var Mustache=require(_0xce3c('0x6'));var util=require(_0xce3c('0x7'));var path=require(_0xce3c('0x8'));var sox=require(_0xce3c('0x9'));var csv=require(_0xce3c('0xa'));var ejs=require(_0xce3c('0xb'));var fs=require('fs');var _=require(_0xce3c('0xc'));var squel=require('squel');var crypto=require(_0xce3c('0xd'));var jsforce=require(_0xce3c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce3c('0xa'));var querystring=require(_0xce3c('0xf'));var Papa=require(_0xce3c('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xce3c('0x11'));var Redis=require(_0xce3c('0x12'));var qs=require(_0xce3c('0x13'));var logger=require(_0xce3c('0x14'))(_0xce3c('0x15'));var utils=require(_0xce3c('0x16'));var config=require(_0xce3c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e4ae,_0x28e3c4){_0x28e3c4=_0x28e3c4||0xcc;return function(_0xf2acbb){if(_0xf2acbb){return _0x23e4ae['sendStatus'](_0x28e3c4);}return _0x23e4ae['status'](_0x28e3c4)[_0xce3c('0x18')]();};}function respondWithResult(_0x38e07a,_0x3f0361){_0x3f0361=_0x3f0361||0xc8;return function(_0x77cfc1){if(_0x77cfc1){return _0x38e07a[_0xce3c('0x19')](_0x3f0361)[_0xce3c('0x1a')](_0x77cfc1);}};}function respondWithFilteredResult(_0x168815,_0x4166fc){return function(_0x5f2cbc){if(_0x5f2cbc){var _0x4872ca=_0x5f2cbc[_0xce3c('0x1b')],_0x922b9e=_0x4166fc[_0xce3c('0x1c')],_0x75c781=_0x4166fc[_0xce3c('0x1c')]+_0x4166fc[_0xce3c('0x1d')],_0x5de011;if(_0x75c781>=_0x4872ca){_0x75c781=_0x4872ca;_0x5de011=0xc8;}else{_0x5de011=0xce;}_0x168815[_0xce3c('0x19')](_0x5de011);return _0x168815['set'](_0xce3c('0x1e'),_0x922b9e+'-'+_0x75c781+'/'+_0x4872ca)[_0xce3c('0x1a')](_0x5f2cbc);}return null;};}function patchUpdates(_0x530167){return function(_0x54a35e){try{jsonpatch[_0xce3c('0x1f')](_0x54a35e,_0x530167,!![]);}catch(_0x415c04){return BPromise[_0xce3c('0x20')](_0x415c04);}return _0x54a35e[_0xce3c('0x21')]();};}function saveUpdates(_0x17dd20,_0x25681c){return function(_0x16493e){if(_0x16493e){return _0x16493e[_0xce3c('0x22')](_0x17dd20)[_0xce3c('0x23')](function(_0x50bf35){return _0x50bf35;});}return null;};}function removeEntity(_0x106fc3,_0xcaffb7){return function(_0x671df2){if(_0x671df2){return _0x671df2['destroy']()[_0xce3c('0x23')](function(){_0x106fc3[_0xce3c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fa0e3,_0x51856b){return function(_0x3ccb78){if(!_0x3ccb78){_0x4fa0e3[_0xce3c('0x24')](0x194);}return _0x3ccb78;};}function handleError(_0x31ccd0,_0x54b977){_0x54b977=_0x54b977||0x1f4;return function(_0x19cd46){logger[_0xce3c('0x25')](_0x19cd46[_0xce3c('0x26')]);if(_0x19cd46['name']){delete _0x19cd46[_0xce3c('0x27')];}_0x31ccd0[_0xce3c('0x19')](_0x54b977)['send'](_0x19cd46);};}exports[_0xce3c('0x28')]=function(_0x56294f,_0x78825f){var _0xcb505c={},_0x3c9444={},_0x42ba6d={'count':0x0,'rows':[]};var _0x117ad8=db[_0xce3c('0x29')][_0xce3c('0x2a')];_0x3c9444[_0xce3c('0x2b')]=_[_0xce3c('0x2c')](_0x117ad8);_0x3c9444[_0xce3c('0x2d')]=_['keys'](_0x56294f[_0xce3c('0x2d')]);_0x3c9444[_0xce3c('0x2e')]=_[_0xce3c('0x2f')](_0x3c9444['model'],_0x3c9444[_0xce3c('0x2d')]);_0xcb505c[_0xce3c('0x30')]=_[_0xce3c('0x2f')](_0x3c9444[_0xce3c('0x2b')],qs['fields'](_0x56294f[_0xce3c('0x2d')][_0xce3c('0x31')]));_0xcb505c[_0xce3c('0x30')]=_0xcb505c['attributes'][_0xce3c('0x32')]?_0xcb505c['attributes']:_0x3c9444[_0xce3c('0x2b')];if(!_0x56294f['query'][_0xce3c('0x33')](_0xce3c('0x34'))){_0xcb505c[_0xce3c('0x1d')]=qs[_0xce3c('0x1d')](_0x56294f[_0xce3c('0x2d')]['limit']);_0xcb505c['offset']=qs['offset'](_0x56294f['query'][_0xce3c('0x1c')]);}_0xcb505c[_0xce3c('0x35')]=qs['sort'](_0x56294f[_0xce3c('0x2d')][_0xce3c('0x36')]);_0xcb505c[_0xce3c('0x37')]=qs[_0xce3c('0x2e')](_[_0xce3c('0x38')](_0x56294f['query'],_0x3c9444[_0xce3c('0x2e')]));if(_0x56294f['query'][_0xce3c('0x39')]){_0xcb505c[_0xce3c('0x37')]=_[_0xce3c('0x3a')](_0xcb505c['where'],{'$or':_['map'](_0x117ad8,function(_0x27161b){if(_0x27161b[_0xce3c('0x3b')]['key']!=='VIRTUAL'){var _0x4d3544={};_0x4d3544[_0x27161b[_0xce3c('0x3c')]]={'$like':'%'+_0x56294f[_0xce3c('0x2d')][_0xce3c('0x39')]+'%'};return _0x4d3544;}})});}_0xcb505c=_[_0xce3c('0x3a')]({},_0xcb505c,_0x56294f[_0xce3c('0x3d')]);var _0x50bd72={'where':_0xcb505c['where']};return db['MemberReport'][_0xce3c('0x1b')](_0x50bd72)[_0xce3c('0x23')](function(_0x400b1c){_0x42ba6d[_0xce3c('0x1b')]=_0x400b1c;if(_0x56294f[_0xce3c('0x2d')][_0xce3c('0x3e')]){_0xcb505c[_0xce3c('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0xce3c('0x40')](_0xcb505c);})['then'](function(_0x4bbf83){_0x42ba6d[_0xce3c('0x41')]=_0x4bbf83;return _0x42ba6d;})[_0xce3c('0x23')](respondWithFilteredResult(_0x78825f,_0xcb505c))[_0xce3c('0x42')](handleError(_0x78825f,null));};exports[_0xce3c('0x43')]=function(_0x3d30c2,_0x2eea17){var _0x4f776c={'raw':!![],'where':{'id':_0x3d30c2[_0xce3c('0x44')]['id']}},_0x878f={};_0x878f[_0xce3c('0x2b')]=_['keys'](db[_0xce3c('0x29')]['rawAttributes']);_0x878f[_0xce3c('0x2d')]=_[_0xce3c('0x2c')](_0x3d30c2[_0xce3c('0x2d')]);_0x878f[_0xce3c('0x2e')]=_[_0xce3c('0x2f')](_0x878f['model'],_0x878f[_0xce3c('0x2d')]);_0x4f776c[_0xce3c('0x30')]=_['intersection'](_0x878f[_0xce3c('0x2b')],qs['fields'](_0x3d30c2[_0xce3c('0x2d')][_0xce3c('0x31')]));_0x4f776c['attributes']=_0x4f776c['attributes'][_0xce3c('0x32')]?_0x4f776c['attributes']:_0x878f[_0xce3c('0x2b')];if(_0x3d30c2['query']['includeAll']){_0x4f776c[_0xce3c('0x3f')]=[{'all':!![]}];}_0x4f776c=_['merge']({},_0x4f776c,_0x3d30c2['options']);return db[_0xce3c('0x29')][_0xce3c('0x45')](_0x4f776c)['then'](handleEntityNotFound(_0x2eea17,null))[_0xce3c('0x23')](respondWithResult(_0x2eea17,null))['catch'](handleError(_0x2eea17,null));};exports[_0xce3c('0x46')]=function(_0x4ea49c,_0x128bef){return db['MemberReport'][_0xce3c('0x46')](_0x4ea49c[_0xce3c('0x47')],{})[_0xce3c('0x23')](respondWithResult(_0x128bef,0xc9))[_0xce3c('0x42')](handleError(_0x128bef,null));};exports['update']=function(_0x1b576f,_0x4b4b1d){if(_0x1b576f['body']['id']){delete _0x1b576f[_0xce3c('0x47')]['id'];}return db[_0xce3c('0x29')][_0xce3c('0x45')]({'where':{'id':_0x1b576f[_0xce3c('0x44')]['id']}})[_0xce3c('0x23')](handleEntityNotFound(_0x4b4b1d,null))[_0xce3c('0x23')](saveUpdates(_0x1b576f[_0xce3c('0x47')],null))[_0xce3c('0x23')](respondWithResult(_0x4b4b1d,null))[_0xce3c('0x42')](handleError(_0x4b4b1d,null));};exports[_0xce3c('0x48')]=function(_0x36251e,_0x133a54){return db[_0xce3c('0x29')][_0xce3c('0x45')]({'where':{'id':_0x36251e[_0xce3c('0x44')]['id']}})[_0xce3c('0x23')](handleEntityNotFound(_0x133a54,null))[_0xce3c('0x23')](removeEntity(_0x133a54,null))['catch'](handleError(_0x133a54,null));};exports['describe']=function(_0x321782,_0x296667){return db['MemberReport'][_0xce3c('0x49')]()[_0xce3c('0x23')](respondWithResult(_0x296667,null))['catch'](handleError(_0x296667,null));}; \ No newline at end of file +var _0x98f1=['query','filters','intersection','attributes','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','MemberReport','includeAll','include','findAll','params','fields','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','error','name','index','keys'];(function(_0x9f9322,_0x3800fd){var _0x56fb0a=function(_0x17f0fc){while(--_0x17f0fc){_0x9f9322['push'](_0x9f9322['shift']());}};_0x56fb0a(++_0x3800fd);}(_0x98f1,0x1cf));var _0x198f=function(_0x5e4a0a,_0x44b745){_0x5e4a0a=_0x5e4a0a-0x0;var _0x487960=_0x98f1[_0x5e4a0a];return _0x487960;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x198f('0x0'));var zipdir=require(_0x198f('0x1'));var jsonpatch=require(_0x198f('0x2'));var rp=require(_0x198f('0x3'));var moment=require(_0x198f('0x4'));var BPromise=require(_0x198f('0x5'));var Mustache=require('mustache');var util=require(_0x198f('0x6'));var path=require(_0x198f('0x7'));var sox=require(_0x198f('0x8'));var csv=require('to-csv');var ejs=require(_0x198f('0x9'));var fs=require('fs');var _=require(_0x198f('0xa'));var squel=require(_0x198f('0xb'));var crypto=require('crypto');var jsforce=require(_0x198f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x198f('0xd'));var querystring=require(_0x198f('0xe'));var Papa=require(_0x198f('0xf'));var authService=require(_0x198f('0x10'));var hardwareService=require(_0x198f('0x11'));var Redis=require(_0x198f('0x12'));var qs=require(_0x198f('0x13'));var logger=require(_0x198f('0x14'))(_0x198f('0x15'));var utils=require(_0x198f('0x16'));var config=require(_0x198f('0x17'));var db=require(_0x198f('0x18'))['db'];function respondWithStatusCode(_0x4c1728,_0x254c70){_0x254c70=_0x254c70||0xcc;return function(_0x10e25a){if(_0x10e25a){return _0x4c1728[_0x198f('0x19')](_0x254c70);}return _0x4c1728[_0x198f('0x1a')](_0x254c70)[_0x198f('0x1b')]();};}function respondWithResult(_0x1332ec,_0x426f29){_0x426f29=_0x426f29||0xc8;return function(_0x492ad9){if(_0x492ad9){return _0x1332ec[_0x198f('0x1a')](_0x426f29)[_0x198f('0x1c')](_0x492ad9);}};}function respondWithFilteredResult(_0x58907e,_0x2cc9ac){return function(_0x569ee6){if(_0x569ee6){var _0x56b901=_0x569ee6[_0x198f('0x1d')],_0x3377a7=_0x2cc9ac['offset'],_0x489846=_0x2cc9ac[_0x198f('0x1e')]+_0x2cc9ac['limit'],_0x3d5f1a;if(_0x489846>=_0x56b901){_0x489846=_0x56b901;_0x3d5f1a=0xc8;}else{_0x3d5f1a=0xce;}_0x58907e[_0x198f('0x1a')](_0x3d5f1a);return _0x58907e['set']('Content-Range',_0x3377a7+'-'+_0x489846+'/'+_0x56b901)[_0x198f('0x1c')](_0x569ee6);}return null;};}function patchUpdates(_0x2fa4cd){return function(_0xa1c571){try{jsonpatch[_0x198f('0x1f')](_0xa1c571,_0x2fa4cd,!![]);}catch(_0x5eba0a){return BPromise[_0x198f('0x20')](_0x5eba0a);}return _0xa1c571[_0x198f('0x21')]();};}function saveUpdates(_0x20796e,_0x5c2ab7){return function(_0x58a8a9){if(_0x58a8a9){return _0x58a8a9[_0x198f('0x22')](_0x20796e)[_0x198f('0x23')](function(_0x5caf68){return _0x5caf68;});}return null;};}function removeEntity(_0x388a38,_0x2089d2){return function(_0x25ecb7){if(_0x25ecb7){return _0x25ecb7[_0x198f('0x24')]()[_0x198f('0x23')](function(){_0x388a38[_0x198f('0x1a')](0xcc)[_0x198f('0x1b')]();});}};}function handleEntityNotFound(_0x313e92,_0x109fc1){return function(_0x48b632){if(!_0x48b632){_0x313e92[_0x198f('0x19')](0x194);}return _0x48b632;};}function handleError(_0x418aa4,_0x2fe3bd){_0x2fe3bd=_0x2fe3bd||0x1f4;return function(_0xc11fa1){logger[_0x198f('0x25')](_0xc11fa1['stack']);if(_0xc11fa1[_0x198f('0x26')]){delete _0xc11fa1[_0x198f('0x26')];}_0x418aa4[_0x198f('0x1a')](_0x2fe3bd)['send'](_0xc11fa1);};}exports[_0x198f('0x27')]=function(_0x511c32,_0x4d03c2){var _0x311db1={},_0x242824={},_0x1f9707={'count':0x0,'rows':[]};var _0x5e86c2=db['MemberReport']['rawAttributes'];_0x242824['model']=_[_0x198f('0x28')](_0x5e86c2);_0x242824['query']=_[_0x198f('0x28')](_0x511c32[_0x198f('0x29')]);_0x242824[_0x198f('0x2a')]=_[_0x198f('0x2b')](_0x242824['model'],_0x242824[_0x198f('0x29')]);_0x311db1[_0x198f('0x2c')]=_[_0x198f('0x2b')](_0x242824[_0x198f('0x2d')],qs['fields'](_0x511c32[_0x198f('0x29')]['fields']));_0x311db1['attributes']=_0x311db1[_0x198f('0x2c')]['length']?_0x311db1['attributes']:_0x242824[_0x198f('0x2d')];if(!_0x511c32[_0x198f('0x29')][_0x198f('0x2e')](_0x198f('0x2f'))){_0x311db1[_0x198f('0x30')]=qs[_0x198f('0x30')](_0x511c32[_0x198f('0x29')][_0x198f('0x30')]);_0x311db1[_0x198f('0x1e')]=qs[_0x198f('0x1e')](_0x511c32[_0x198f('0x29')][_0x198f('0x1e')]);}_0x311db1[_0x198f('0x31')]=qs['sort'](_0x511c32[_0x198f('0x29')][_0x198f('0x32')]);_0x311db1[_0x198f('0x33')]=qs['filters'](_[_0x198f('0x34')](_0x511c32['query'],_0x242824[_0x198f('0x2a')]));if(_0x511c32['query'][_0x198f('0x35')]){_0x311db1[_0x198f('0x33')]=_[_0x198f('0x36')](_0x311db1[_0x198f('0x33')],{'$or':_[_0x198f('0x37')](_0x5e86c2,function(_0xa06493){if(_0xa06493[_0x198f('0x38')][_0x198f('0x39')]!==_0x198f('0x3a')){var _0x254305={};_0x254305[_0xa06493[_0x198f('0x3b')]]={'$like':'%'+_0x511c32[_0x198f('0x29')][_0x198f('0x35')]+'%'};return _0x254305;}})});}_0x311db1=_[_0x198f('0x36')]({},_0x311db1,_0x511c32[_0x198f('0x3c')]);var _0x34cdd1={'where':_0x311db1[_0x198f('0x33')]};return db[_0x198f('0x3d')]['count'](_0x34cdd1)[_0x198f('0x23')](function(_0x402747){_0x1f9707[_0x198f('0x1d')]=_0x402747;if(_0x511c32['query'][_0x198f('0x3e')]){_0x311db1[_0x198f('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0x198f('0x40')](_0x311db1);})[_0x198f('0x23')](function(_0xd1c474){_0x1f9707['rows']=_0xd1c474;return _0x1f9707;})[_0x198f('0x23')](respondWithFilteredResult(_0x4d03c2,_0x311db1))['catch'](handleError(_0x4d03c2,null));};exports['show']=function(_0x468b1f,_0x3bd216){var _0x59eff6={'raw':!![],'where':{'id':_0x468b1f[_0x198f('0x41')]['id']}},_0x5f8fa0={};_0x5f8fa0['model']=_[_0x198f('0x28')](db['MemberReport']['rawAttributes']);_0x5f8fa0['query']=_[_0x198f('0x28')](_0x468b1f[_0x198f('0x29')]);_0x5f8fa0['filters']=_['intersection'](_0x5f8fa0[_0x198f('0x2d')],_0x5f8fa0[_0x198f('0x29')]);_0x59eff6[_0x198f('0x2c')]=_['intersection'](_0x5f8fa0[_0x198f('0x2d')],qs[_0x198f('0x42')](_0x468b1f['query'][_0x198f('0x42')]));_0x59eff6['attributes']=_0x59eff6[_0x198f('0x2c')]['length']?_0x59eff6['attributes']:_0x5f8fa0['model'];if(_0x468b1f[_0x198f('0x29')]['includeAll']){_0x59eff6[_0x198f('0x3f')]=[{'all':!![]}];}_0x59eff6=_[_0x198f('0x36')]({},_0x59eff6,_0x468b1f[_0x198f('0x3c')]);return db[_0x198f('0x3d')][_0x198f('0x43')](_0x59eff6)[_0x198f('0x23')](handleEntityNotFound(_0x3bd216,null))[_0x198f('0x23')](respondWithResult(_0x3bd216,null))[_0x198f('0x44')](handleError(_0x3bd216,null));};exports['create']=function(_0x17a0ad,_0x36017a){return db[_0x198f('0x3d')][_0x198f('0x45')](_0x17a0ad[_0x198f('0x46')],{})[_0x198f('0x23')](respondWithResult(_0x36017a,0xc9))[_0x198f('0x44')](handleError(_0x36017a,null));};exports[_0x198f('0x22')]=function(_0x455ac1,_0x189a81){if(_0x455ac1[_0x198f('0x46')]['id']){delete _0x455ac1[_0x198f('0x46')]['id'];}return db[_0x198f('0x3d')][_0x198f('0x43')]({'where':{'id':_0x455ac1['params']['id']}})[_0x198f('0x23')](handleEntityNotFound(_0x189a81,null))[_0x198f('0x23')](saveUpdates(_0x455ac1['body'],null))['then'](respondWithResult(_0x189a81,null))['catch'](handleError(_0x189a81,null));};exports[_0x198f('0x24')]=function(_0xae5d28,_0x1dbda4){return db[_0x198f('0x3d')][_0x198f('0x43')]({'where':{'id':_0xae5d28[_0x198f('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dbda4,null))['then'](removeEntity(_0x1dbda4,null))[_0x198f('0x44')](handleError(_0x1dbda4,null));};exports[_0x198f('0x47')]=function(_0xa7da4c,_0x1549e8){return db[_0x198f('0x3d')][_0x198f('0x47')]()['then'](respondWithResult(_0x1549e8,null))[_0x198f('0x44')](handleError(_0x1549e8,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 9d53aba..e3ef6ae 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 _0x0704=['../../config/logger','api','moment','bluebird','request-promise','exports','MemberReport','report_member','membername_interface','interface','lodash','util'];(function(_0x45f6a7,_0x2b7052){var _0x37a607=function(_0x389993){while(--_0x389993){_0x45f6a7['push'](_0x45f6a7['shift']());}};_0x37a607(++_0x2b7052);}(_0x0704,0xca));var _0x4070=function(_0x19561b,_0x2dccef){_0x19561b=_0x19561b-0x0;var _0x135586=_0x0704[_0x19561b];return _0x135586;};'use strict';var _=require(_0x4070('0x0'));var util=require(_0x4070('0x1'));var logger=require(_0x4070('0x2'))(_0x4070('0x3'));var moment=require(_0x4070('0x4'));var BPromise=require(_0x4070('0x5'));var rp=require(_0x4070('0x6'));var attributes=require('./memberReport.attributes');module[_0x4070('0x7')]=function(_0x52b82f,_0x1d82b0){return _0x52b82f['define'](_0x4070('0x8'),attributes,{'tableName':_0x4070('0x9'),'paranoid':![],'indexes':[{'name':_0x4070('0xa'),'fields':['membername',_0x4070('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4c8=['request-promise','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api'];(function(_0x33808c,_0x4022a6){var _0xdb4d45=function(_0x20dc68){while(--_0x20dc68){_0x33808c['push'](_0x33808c['shift']());}};_0xdb4d45(++_0x4022a6);}(_0xe4c8,0x64));var _0x8e4c=function(_0x500101,_0x5ad8bd){_0x500101=_0x500101-0x0;var _0x10caaf=_0xe4c8[_0x500101];return _0x10caaf;};'use strict';var _=require(_0x8e4c('0x0'));var util=require(_0x8e4c('0x1'));var logger=require(_0x8e4c('0x2'))(_0x8e4c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e4c('0x4'));var attributes=require(_0x8e4c('0x5'));module[_0x8e4c('0x6')]=function(_0x27f01f,_0x324479){return _0x27f01f[_0x8e4c('0x7')](_0x8e4c('0x8'),attributes,{'tableName':_0x8e4c('0x9'),'paranoid':![],'indexes':[{'name':_0x8e4c('0xa'),'fields':[_0x8e4c('0xb'),_0x8e4c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 346a31a..784e645 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 _0x0d43=['message','MemberReport,\x20%s,\x20%s','result','MemberReport','options','raw','limit','include','attributes','map','model','info','GetMemberReport','catch','CreateMemberReport','create','body','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x19f2b7,_0x29c0d0){var _0x18e93e=function(_0x55638b){while(--_0x55638b){_0x19f2b7['push'](_0x19f2b7['shift']());}};_0x18e93e(++_0x29c0d0);}(_0x0d43,0x15c));var _0x30d4=function(_0x122cc1,_0x5c956e){_0x122cc1=_0x122cc1-0x0;var _0x1e33af=_0x0d43[_0x122cc1];return _0x1e33af;};'use strict';var _=require(_0x30d4('0x0'));var util=require(_0x30d4('0x1'));var moment=require(_0x30d4('0x2'));var BPromise=require(_0x30d4('0x3'));var rs=require(_0x30d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30d4('0x5'))['db'];var utils=require(_0x30d4('0x6'));var logger=require(_0x30d4('0x7'))(_0x30d4('0x8'));var config=require(_0x30d4('0x9'));var jayson=require(_0x30d4('0xa'));var client=jayson[_0x30d4('0xb')][_0x30d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d307b,_0x132157,_0x5cbaf8){return new BPromise(function(_0x380467,_0x4e9fa4){return client[_0x30d4('0xd')](_0x1d307b,_0x5cbaf8)[_0x30d4('0xe')](function(_0x44dc2e){logger['info']('MemberReport,\x20%s,\x20%s',_0x132157,_0x30d4('0xf'));logger[_0x30d4('0x10')](_0x30d4('0x11'),_0x132157,_0x30d4('0xf'),JSON[_0x30d4('0x12')](_0x44dc2e));if(_0x44dc2e[_0x30d4('0x13')]){if(_0x44dc2e[_0x30d4('0x13')][_0x30d4('0x14')]===0x1f4){logger[_0x30d4('0x13')]('MemberReport,\x20%s,\x20%s',_0x132157,_0x44dc2e[_0x30d4('0x13')][_0x30d4('0x15')]);return _0x4e9fa4(_0x44dc2e[_0x30d4('0x13')]['message']);}logger['error'](_0x30d4('0x16'),_0x132157,_0x44dc2e[_0x30d4('0x13')][_0x30d4('0x15')]);return _0x380467(_0x44dc2e[_0x30d4('0x13')][_0x30d4('0x15')]);}else{logger['info'](_0x30d4('0x16'),_0x132157,'request\x20sent');_0x380467(_0x44dc2e[_0x30d4('0x17')]['message']);}})['catch'](function(_0x53dcec){logger[_0x30d4('0x13')](_0x30d4('0x16'),_0x132157,_0x53dcec);_0x4e9fa4(_0x53dcec);});});}exports['GetMemberReport']=function(_0x384a86){var _0x5d28dc=this;return new Promise(function(_0x2ace54,_0x3c5597){return db[_0x30d4('0x18')]['findAll']({'raw':_0x384a86[_0x30d4('0x19')]?_0x384a86['options'][_0x30d4('0x1a')]===undefined?!![]:![]:!![],'where':_0x384a86[_0x30d4('0x19')]?_0x384a86[_0x30d4('0x19')]['where']||null:null,'attributes':_0x384a86[_0x30d4('0x19')]?_0x384a86[_0x30d4('0x19')]['attributes']||null:null,'limit':_0x384a86[_0x30d4('0x19')]?_0x384a86[_0x30d4('0x19')][_0x30d4('0x1b')]||null:null,'include':_0x384a86[_0x30d4('0x19')]?_0x384a86[_0x30d4('0x19')][_0x30d4('0x1c')]?_['map'](_0x384a86[_0x30d4('0x19')][_0x30d4('0x1c')],function(_0x5cf158){return{'model':db[_0x5cf158['model']],'as':_0x5cf158['as'],'attributes':_0x5cf158[_0x30d4('0x1d')],'include':_0x5cf158[_0x30d4('0x1c')]?_[_0x30d4('0x1e')](_0x5cf158[_0x30d4('0x1c')],function(_0x3d7beb){return{'model':db[_0x3d7beb[_0x30d4('0x1f')]],'as':_0x3d7beb['as'],'attributes':_0x3d7beb[_0x30d4('0x1d')],'include':_0x3d7beb[_0x30d4('0x1c')]?_[_0x30d4('0x1e')](_0x3d7beb[_0x30d4('0x1c')],function(_0x503ee6){return{'model':db[_0x503ee6[_0x30d4('0x1f')]],'as':_0x503ee6['as'],'attributes':_0x503ee6[_0x30d4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5059fe){logger[_0x30d4('0x20')](_0x30d4('0x21'),_0x384a86);logger['debug'](_0x30d4('0x21'),_0x384a86,JSON[_0x30d4('0x12')](_0x5059fe));_0x2ace54(_0x5059fe);})[_0x30d4('0x22')](function(_0x2b631c){logger['error']('GetMemberReport',_0x2b631c[_0x30d4('0x15')],_0x384a86);_0x3c5597(_0x5d28dc['error'](0x1f4,_0x2b631c[_0x30d4('0x15')]));});});};exports[_0x30d4('0x23')]=function(_0x2eede6){var _0x16692d=this;return new Promise(function(_0x742219,_0x2c42f8){return db['MemberReport'][_0x30d4('0x24')](_0x2eede6[_0x30d4('0x25')],{'raw':_0x2eede6['options']?_0x2eede6['options'][_0x30d4('0x1a')]===undefined?!![]:![]:!![]})[_0x30d4('0xe')](function(_0x4712c1){logger[_0x30d4('0x20')](_0x30d4('0x23'),_0x2eede6);logger[_0x30d4('0x10')](_0x30d4('0x23'),_0x2eede6,JSON['stringify'](_0x4712c1));_0x742219(_0x4712c1);})[_0x30d4('0x22')](function(_0x391369){logger[_0x30d4('0x13')](_0x30d4('0x23'),_0x391369[_0x30d4('0x15')],_0x2eede6);_0x2c42f8(_0x16692d[_0x30d4('0x13')](0x1f4,_0x391369['message']));});});};exports[_0x30d4('0x26')]=function(_0x449921){var _0x4ec71e=this;return new Promise(function(_0x291dd7,_0x2b5a1d){return db['MemberReport'][_0x30d4('0x27')](_0x449921['body'],{'raw':_0x449921[_0x30d4('0x19')]?_0x449921[_0x30d4('0x19')][_0x30d4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449921['options']?_0x449921[_0x30d4('0x19')][_0x30d4('0x28')]||null:null,'attributes':_0x449921[_0x30d4('0x19')]?_0x449921[_0x30d4('0x19')][_0x30d4('0x1d')]||null:null,'limit':_0x449921[_0x30d4('0x19')]?_0x449921[_0x30d4('0x19')]['limit']||null:null})[_0x30d4('0xe')](function(_0x2ae261){logger['info'](_0x30d4('0x26'),_0x449921);logger[_0x30d4('0x10')](_0x30d4('0x26'),_0x449921,JSON['stringify'](_0x2ae261));_0x291dd7(_0x2ae261);})[_0x30d4('0x22')](function(_0x1099d4){logger[_0x30d4('0x13')](_0x30d4('0x26'),_0x1099d4[_0x30d4('0x15')],_0x449921);_0x2b5a1d(_0x4ec71e[_0x30d4('0x13')](0x1f4,_0x1099d4['message']));});});}; \ No newline at end of file +var _0x14e0=['where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMemberReport','MemberReport','options','raw','attributes','include','model','map','catch','create','body','CreateMemberReport','UpdateMemberReport','update'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x14e0,0x9a));var _0x014e=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x14e0[_0x46a671];return _0x526d75;};'use strict';var _=require(_0x014e('0x0'));var util=require('util');var moment=require(_0x014e('0x1'));var BPromise=require(_0x014e('0x2'));var rs=require(_0x014e('0x3'));var fs=require('fs');var Redis=require(_0x014e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x014e('0x5'));var logger=require('../../config/logger')(_0x014e('0x6'));var config=require(_0x014e('0x7'));var jayson=require(_0x014e('0x8'));var client=jayson[_0x014e('0x9')][_0x014e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23b1ad,_0x9516a8,_0x1db4f1){return new BPromise(function(_0x28db1c,_0x4a24d9){return client[_0x014e('0xb')](_0x23b1ad,_0x1db4f1)[_0x014e('0xc')](function(_0x3d551d){logger[_0x014e('0xd')](_0x014e('0xe'),_0x9516a8,_0x014e('0xf'));logger[_0x014e('0x10')](_0x014e('0x11'),_0x9516a8,_0x014e('0xf'),JSON[_0x014e('0x12')](_0x3d551d));if(_0x3d551d[_0x014e('0x13')]){if(_0x3d551d[_0x014e('0x13')]['code']===0x1f4){logger[_0x014e('0x13')](_0x014e('0xe'),_0x9516a8,_0x3d551d[_0x014e('0x13')][_0x014e('0x14')]);return _0x4a24d9(_0x3d551d['error'][_0x014e('0x14')]);}logger[_0x014e('0x13')]('MemberReport,\x20%s,\x20%s',_0x9516a8,_0x3d551d['error']['message']);return _0x28db1c(_0x3d551d[_0x014e('0x13')]['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x9516a8,_0x014e('0xf'));_0x28db1c(_0x3d551d[_0x014e('0x15')][_0x014e('0x14')]);}})['catch'](function(_0x158eb3){logger[_0x014e('0x13')](_0x014e('0xe'),_0x9516a8,_0x158eb3);_0x4a24d9(_0x158eb3);});});}exports[_0x014e('0x16')]=function(_0x5310aa){var _0x8d6f00=this;return new Promise(function(_0x28791f,_0x4f8097){return db[_0x014e('0x17')]['findAll']({'raw':_0x5310aa[_0x014e('0x18')]?_0x5310aa['options'][_0x014e('0x19')]===undefined?!![]:![]:!![],'where':_0x5310aa[_0x014e('0x18')]?_0x5310aa['options']['where']||null:null,'attributes':_0x5310aa['options']?_0x5310aa[_0x014e('0x18')][_0x014e('0x1a')]||null:null,'limit':_0x5310aa[_0x014e('0x18')]?_0x5310aa['options']['limit']||null:null,'include':_0x5310aa[_0x014e('0x18')]?_0x5310aa[_0x014e('0x18')][_0x014e('0x1b')]?_['map'](_0x5310aa[_0x014e('0x18')][_0x014e('0x1b')],function(_0x198560){return{'model':db[_0x198560[_0x014e('0x1c')]],'as':_0x198560['as'],'attributes':_0x198560['attributes'],'include':_0x198560[_0x014e('0x1b')]?_[_0x014e('0x1d')](_0x198560[_0x014e('0x1b')],function(_0x5728dc){return{'model':db[_0x5728dc[_0x014e('0x1c')]],'as':_0x5728dc['as'],'attributes':_0x5728dc[_0x014e('0x1a')],'include':_0x5728dc[_0x014e('0x1b')]?_[_0x014e('0x1d')](_0x5728dc[_0x014e('0x1b')],function(_0x3b0eae){return{'model':db[_0x3b0eae['model']],'as':_0x3b0eae['as'],'attributes':_0x3b0eae[_0x014e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x014e('0xc')](function(_0x156899){logger['info'](_0x014e('0x16'),_0x5310aa);logger['debug']('GetMemberReport',_0x5310aa,JSON[_0x014e('0x12')](_0x156899));_0x28791f(_0x156899);})[_0x014e('0x1e')](function(_0x189071){logger[_0x014e('0x13')](_0x014e('0x16'),_0x189071[_0x014e('0x14')],_0x5310aa);_0x4f8097(_0x8d6f00['error'](0x1f4,_0x189071[_0x014e('0x14')]));});});};exports['CreateMemberReport']=function(_0x32b897){var _0x13d981=this;return new Promise(function(_0x1d6363,_0x12636f){return db[_0x014e('0x17')][_0x014e('0x1f')](_0x32b897[_0x014e('0x20')],{'raw':_0x32b897[_0x014e('0x18')]?_0x32b897[_0x014e('0x18')][_0x014e('0x19')]===undefined?!![]:![]:!![]})[_0x014e('0xc')](function(_0x3077cc){logger['info'](_0x014e('0x21'),_0x32b897);logger[_0x014e('0x10')](_0x014e('0x21'),_0x32b897,JSON[_0x014e('0x12')](_0x3077cc));_0x1d6363(_0x3077cc);})['catch'](function(_0x11f39a){logger[_0x014e('0x13')](_0x014e('0x21'),_0x11f39a[_0x014e('0x14')],_0x32b897);_0x12636f(_0x13d981[_0x014e('0x13')](0x1f4,_0x11f39a[_0x014e('0x14')]));});});};exports[_0x014e('0x22')]=function(_0x3247e9){var _0x119db5=this;return new Promise(function(_0x14a212,_0x572744){return db['MemberReport'][_0x014e('0x23')](_0x3247e9[_0x014e('0x20')],{'raw':_0x3247e9[_0x014e('0x18')]?_0x3247e9[_0x014e('0x18')][_0x014e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3247e9[_0x014e('0x18')]?_0x3247e9[_0x014e('0x18')][_0x014e('0x24')]||null:null,'attributes':_0x3247e9[_0x014e('0x18')]?_0x3247e9[_0x014e('0x18')][_0x014e('0x1a')]||null:null,'limit':_0x3247e9[_0x014e('0x18')]?_0x3247e9[_0x014e('0x18')][_0x014e('0x25')]||null:null})[_0x014e('0xc')](function(_0x3afb4c){logger[_0x014e('0xd')](_0x014e('0x22'),_0x3247e9);logger['debug']('UpdateMemberReport',_0x3247e9,JSON[_0x014e('0x12')](_0x3afb4c));_0x14a212(_0x3afb4c);})[_0x014e('0x1e')](function(_0x2118f5){logger[_0x014e('0x13')]('UpdateMemberReport',_0x2118f5[_0x014e('0x14')],_0x3247e9);_0x572744(_0x119db5['error'](0x1f4,_0x2118f5[_0x014e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index ca71618..53b62aa 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 _0x1e69=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x1e69,0x177));var _0x91e6=function(_0x252834,_0x55f763){_0x252834=_0x252834-0x0;var _0x58c864=_0x1e69[_0x252834];return _0x58c864;};'use strict';var multer=require(_0x91e6('0x0'));var util=require('util');var path=require(_0x91e6('0x1'));var timeout=require(_0x91e6('0x2'));var express=require(_0x91e6('0x3'));var router=express['Router']();var auth=require(_0x91e6('0x4'));var interaction=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var controller=require(_0x91e6('0x7'));router[_0x91e6('0x8')]('/',controller[_0x91e6('0x9')]);module[_0x91e6('0xa')]=router; \ No newline at end of file +var _0x8a0a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x8a0a,0x14d));var _0xa8a0=function(_0xa3514c,_0x9c937b){_0xa3514c=_0xa3514c-0x0;var _0x31f6a0=_0x8a0a[_0xa3514c];return _0x31f6a0;};'use strict';var multer=require(_0xa8a0('0x0'));var util=require(_0xa8a0('0x1'));var path=require(_0xa8a0('0x2'));var timeout=require(_0xa8a0('0x3'));var express=require(_0xa8a0('0x4'));var router=express[_0xa8a0('0x5')]();var auth=require(_0xa8a0('0x6'));var interaction=require(_0xa8a0('0x7'));var config=require(_0xa8a0('0x8'));var controller=require(_0xa8a0('0x9'));router[_0xa8a0('0xa')]('/',controller[_0xa8a0('0xb')]);module[_0xa8a0('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b2467e9..313bb4d 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 _0x5f21=['exports','STRING','sequelize'];(function(_0x4d6726,_0x3c9522){var _0x26609c=function(_0x14a4b5){while(--_0x14a4b5){_0x4d6726['push'](_0x4d6726['shift']());}};_0x26609c(++_0x3c9522);}(_0x5f21,0x1a9));var _0x15f2=function(_0x1a32f2,_0x5e557e){_0x1a32f2=_0x1a32f2-0x0;var _0x5e9d3b=_0x5f21[_0x1a32f2];return _0x5e9d3b;};'use strict';var Sequelize=require(_0x15f2('0x0'));module[_0x15f2('0x1')]={'version':{'type':Sequelize[_0x15f2('0x2')],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file +var _0xe749=['exports','sequelize'];(function(_0x4428f1,_0x2047dc){var _0x4c3d3a=function(_0x487d38){while(--_0x487d38){_0x4428f1['push'](_0x4428f1['shift']());}};_0x4c3d3a(++_0x2047dc);}(_0xe749,0x1ef));var _0x9e74=function(_0x3efcd6,_0x416e7a){_0x3efcd6=_0x3efcd6-0x0;var _0x25eab1=_0xe749[_0x3efcd6];return _0x25eab1;};'use strict';var Sequelize=require(_0x9e74('0x0'));module[_0x9e74('0x1')]={'version':{'type':Sequelize['STRING'],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 99c9d3b..43237a5 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 _0xd8d7=['where','pick','filter','merge','type','key','options','Migration','count','includeAll','include','findAll','rows','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','nolimit','sort'];(function(_0x82f996,_0x489210){var _0x5a4ec7=function(_0xd94b59){while(--_0xd94b59){_0x82f996['push'](_0x82f996['shift']());}};_0x5a4ec7(++_0x489210);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0xd8d7[_0x3bef2c];return _0x331503;};'use strict';var pdf=require(_0x7d8d('0x0'));var emlformat=require(_0x7d8d('0x1'));var rimraf=require(_0x7d8d('0x2'));var zipdir=require(_0x7d8d('0x3'));var jsonpatch=require(_0x7d8d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d8d('0x5'));var path=require('path');var sox=require(_0x7d8d('0x6'));var csv=require(_0x7d8d('0x7'));var ejs=require(_0x7d8d('0x8'));var fs=require('fs');var _=require(_0x7d8d('0x9'));var squel=require(_0x7d8d('0xa'));var crypto=require(_0x7d8d('0xb'));var jsforce=require(_0x7d8d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7d8d('0x7'));var querystring=require(_0x7d8d('0xd'));var Papa=require(_0x7d8d('0xe'));var authService=require(_0x7d8d('0xf'));var hardwareService=require(_0x7d8d('0x10'));var Redis=require(_0x7d8d('0x11'));var qs=require(_0x7d8d('0x12'));var logger=require('../../config/logger')(_0x7d8d('0x13'));var utils=require(_0x7d8d('0x14'));var config=require(_0x7d8d('0x15'));var db=require(_0x7d8d('0x16'))['db'];function respondWithStatusCode(_0xfc6750,_0x47b857){_0x47b857=_0x47b857||0xcc;return function(_0x1ba2b9){if(_0x1ba2b9){return _0xfc6750[_0x7d8d('0x17')](_0x47b857);}return _0xfc6750[_0x7d8d('0x18')](_0x47b857)[_0x7d8d('0x19')]();};}function respondWithResult(_0x44203e,_0x2bcf5a){_0x2bcf5a=_0x2bcf5a||0xc8;return function(_0x56d307){if(_0x56d307){return _0x44203e[_0x7d8d('0x18')](_0x2bcf5a)[_0x7d8d('0x1a')](_0x56d307);}};}function respondWithFilteredResult(_0x2065c4,_0x365044){return function(_0x486f68){if(_0x486f68){var _0x5f443e=_0x486f68['count'],_0x349c01=_0x365044[_0x7d8d('0x1b')],_0x5dfb62=_0x365044[_0x7d8d('0x1b')]+_0x365044[_0x7d8d('0x1c')],_0x4093d4;if(_0x5dfb62>=_0x5f443e){_0x5dfb62=_0x5f443e;_0x4093d4=0xc8;}else{_0x4093d4=0xce;}_0x2065c4[_0x7d8d('0x18')](_0x4093d4);return _0x2065c4[_0x7d8d('0x1d')](_0x7d8d('0x1e'),_0x349c01+'-'+_0x5dfb62+'/'+_0x5f443e)[_0x7d8d('0x1a')](_0x486f68);}return null;};}function patchUpdates(_0x37fe93){return function(_0x4b15c0){try{jsonpatch[_0x7d8d('0x1f')](_0x4b15c0,_0x37fe93,!![]);}catch(_0x3b3c2a){return BPromise[_0x7d8d('0x20')](_0x3b3c2a);}return _0x4b15c0[_0x7d8d('0x21')]();};}function saveUpdates(_0x888ca2,_0x3db362){return function(_0x3b32d3){if(_0x3b32d3){return _0x3b32d3[_0x7d8d('0x22')](_0x888ca2)[_0x7d8d('0x23')](function(_0x910594){return _0x910594;});}return null;};}function removeEntity(_0x2d19f0,_0x153b7c){return function(_0x1d822a){if(_0x1d822a){return _0x1d822a[_0x7d8d('0x24')]()['then'](function(){_0x2d19f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb4361d,_0xf40f41){return function(_0x2ab3b8){if(!_0x2ab3b8){_0xb4361d[_0x7d8d('0x17')](0x194);}return _0x2ab3b8;};}function handleError(_0x43e4d0,_0x4e06bd){_0x4e06bd=_0x4e06bd||0x1f4;return function(_0x4fdcb7){logger[_0x7d8d('0x25')](_0x4fdcb7[_0x7d8d('0x26')]);if(_0x4fdcb7[_0x7d8d('0x27')]){delete _0x4fdcb7[_0x7d8d('0x27')];}_0x43e4d0[_0x7d8d('0x18')](_0x4e06bd)[_0x7d8d('0x28')](_0x4fdcb7);};}exports['index']=function(_0x414da4,_0x28382d){var _0x23afc4={},_0x80ea6c={},_0xedad25={'count':0x0,'rows':[]};var _0x47dbef=db['Migration'][_0x7d8d('0x29')];_0x80ea6c[_0x7d8d('0x2a')]=_[_0x7d8d('0x2b')](_0x47dbef);_0x80ea6c['query']=_[_0x7d8d('0x2b')](_0x414da4[_0x7d8d('0x2c')]);_0x80ea6c[_0x7d8d('0x2d')]=_['intersection'](_0x80ea6c[_0x7d8d('0x2a')],_0x80ea6c[_0x7d8d('0x2c')]);_0x23afc4['attributes']=_[_0x7d8d('0x2e')](_0x80ea6c[_0x7d8d('0x2a')],qs[_0x7d8d('0x2f')](_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x2f')]));_0x23afc4['attributes']=_0x23afc4['attributes'][_0x7d8d('0x30')]?_0x23afc4[_0x7d8d('0x31')]:_0x80ea6c['model'];if(!_0x414da4[_0x7d8d('0x2c')]['hasOwnProperty'](_0x7d8d('0x32'))){_0x23afc4[_0x7d8d('0x1c')]=qs['limit'](_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x1c')]);_0x23afc4[_0x7d8d('0x1b')]=qs[_0x7d8d('0x1b')](_0x414da4['query'][_0x7d8d('0x1b')]);}_0x23afc4['order']=qs[_0x7d8d('0x33')](_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x33')]);_0x23afc4[_0x7d8d('0x34')]=qs['filters'](_[_0x7d8d('0x35')](_0x414da4[_0x7d8d('0x2c')],_0x80ea6c[_0x7d8d('0x2d')]));if(_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x36')]){_0x23afc4[_0x7d8d('0x34')]=_[_0x7d8d('0x37')](_0x23afc4[_0x7d8d('0x34')],{'$or':_['map'](_0x47dbef,function(_0x185820){if(_0x185820[_0x7d8d('0x38')][_0x7d8d('0x39')]!=='VIRTUAL'){var _0x59b71c={};_0x59b71c[_0x185820['field']]={'$like':'%'+_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x36')]+'%'};return _0x59b71c;}})});}_0x23afc4=_[_0x7d8d('0x37')]({},_0x23afc4,_0x414da4[_0x7d8d('0x3a')]);var _0x183fcd={'where':_0x23afc4['where']};return db[_0x7d8d('0x3b')][_0x7d8d('0x3c')](_0x183fcd)['then'](function(_0x10679f){_0xedad25[_0x7d8d('0x3c')]=_0x10679f;if(_0x414da4[_0x7d8d('0x2c')][_0x7d8d('0x3d')]){_0x23afc4[_0x7d8d('0x3e')]=[{'all':!![]}];}return db[_0x7d8d('0x3b')][_0x7d8d('0x3f')](_0x23afc4);})[_0x7d8d('0x23')](function(_0x22feb3){_0xedad25[_0x7d8d('0x40')]=_0x22feb3;return _0xedad25;})['then'](respondWithFilteredResult(_0x28382d,_0x23afc4))['catch'](handleError(_0x28382d,null));}; \ No newline at end of file +var _0x2ccd=['type','key','VIRTUAL','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','Migration','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map'];(function(_0x4d1843,_0x27272b){var _0xa03191=function(_0x2a251c){while(--_0x2a251c){_0x4d1843['push'](_0x4d1843['shift']());}};_0xa03191(++_0x27272b);}(_0x2ccd,0x142));var _0xd2cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ccd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd2cc('0x0'));var emlformat=require(_0xd2cc('0x1'));var rimraf=require(_0xd2cc('0x2'));var zipdir=require(_0xd2cc('0x3'));var jsonpatch=require(_0xd2cc('0x4'));var rp=require(_0xd2cc('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2cc('0x6'));var util=require(_0xd2cc('0x7'));var path=require(_0xd2cc('0x8'));var sox=require(_0xd2cc('0x9'));var csv=require(_0xd2cc('0xa'));var ejs=require(_0xd2cc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd2cc('0xc'));var crypto=require(_0xd2cc('0xd'));var jsforce=require(_0xd2cc('0xe'));var deskjs=require(_0xd2cc('0xf'));var toCsv=require(_0xd2cc('0xa'));var querystring=require(_0xd2cc('0x10'));var Papa=require(_0xd2cc('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd2cc('0x12'));var Redis=require(_0xd2cc('0x13'));var qs=require(_0xd2cc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd2cc('0x15'));var db=require(_0xd2cc('0x16'))['db'];function respondWithStatusCode(_0x599887,_0x57effd){_0x57effd=_0x57effd||0xcc;return function(_0x8a4cc4){if(_0x8a4cc4){return _0x599887[_0xd2cc('0x17')](_0x57effd);}return _0x599887[_0xd2cc('0x18')](_0x57effd)[_0xd2cc('0x19')]();};}function respondWithResult(_0x1af1c5,_0x24ab1d){_0x24ab1d=_0x24ab1d||0xc8;return function(_0xf1b8b2){if(_0xf1b8b2){return _0x1af1c5[_0xd2cc('0x18')](_0x24ab1d)[_0xd2cc('0x1a')](_0xf1b8b2);}};}function respondWithFilteredResult(_0x573c7f,_0x5b4c0a){return function(_0x50ce53){if(_0x50ce53){var _0x452faf=_0x50ce53[_0xd2cc('0x1b')],_0x4a8cab=_0x5b4c0a[_0xd2cc('0x1c')],_0x1b0c30=_0x5b4c0a[_0xd2cc('0x1c')]+_0x5b4c0a['limit'],_0x382366;if(_0x1b0c30>=_0x452faf){_0x1b0c30=_0x452faf;_0x382366=0xc8;}else{_0x382366=0xce;}_0x573c7f[_0xd2cc('0x18')](_0x382366);return _0x573c7f[_0xd2cc('0x1d')](_0xd2cc('0x1e'),_0x4a8cab+'-'+_0x1b0c30+'/'+_0x452faf)[_0xd2cc('0x1a')](_0x50ce53);}return null;};}function patchUpdates(_0xd538d7){return function(_0x35d256){try{jsonpatch[_0xd2cc('0x1f')](_0x35d256,_0xd538d7,!![]);}catch(_0x469e45){return BPromise[_0xd2cc('0x20')](_0x469e45);}return _0x35d256[_0xd2cc('0x21')]();};}function saveUpdates(_0x2d22ad,_0x12e39e){return function(_0x55a1a1){if(_0x55a1a1){return _0x55a1a1[_0xd2cc('0x22')](_0x2d22ad)['then'](function(_0x1b7fe9){return _0x1b7fe9;});}return null;};}function removeEntity(_0x2f45e9,_0x1aa190){return function(_0x4ef9b2){if(_0x4ef9b2){return _0x4ef9b2['destroy']()[_0xd2cc('0x23')](function(){_0x2f45e9[_0xd2cc('0x18')](0xcc)[_0xd2cc('0x19')]();});}};}function handleEntityNotFound(_0x152312,_0x20e3e2){return function(_0x379d01){if(!_0x379d01){_0x152312['sendStatus'](0x194);}return _0x379d01;};}function handleError(_0x3545cc,_0x1fa0a4){_0x1fa0a4=_0x1fa0a4||0x1f4;return function(_0x3e4fd5){logger[_0xd2cc('0x24')](_0x3e4fd5['stack']);if(_0x3e4fd5[_0xd2cc('0x25')]){delete _0x3e4fd5[_0xd2cc('0x25')];}_0x3545cc[_0xd2cc('0x18')](_0x1fa0a4)[_0xd2cc('0x26')](_0x3e4fd5);};}exports['index']=function(_0x582850,_0x3c8211){var _0x3c421a={},_0x24e3f9={},_0x4cce01={'count':0x0,'rows':[]};var _0x58c0f1=db[_0xd2cc('0x27')]['rawAttributes'];_0x24e3f9[_0xd2cc('0x28')]=_['keys'](_0x58c0f1);_0x24e3f9[_0xd2cc('0x29')]=_[_0xd2cc('0x2a')](_0x582850[_0xd2cc('0x29')]);_0x24e3f9['filters']=_['intersection'](_0x24e3f9[_0xd2cc('0x28')],_0x24e3f9[_0xd2cc('0x29')]);_0x3c421a[_0xd2cc('0x2b')]=_[_0xd2cc('0x2c')](_0x24e3f9[_0xd2cc('0x28')],qs[_0xd2cc('0x2d')](_0x582850[_0xd2cc('0x29')]['fields']));_0x3c421a[_0xd2cc('0x2b')]=_0x3c421a[_0xd2cc('0x2b')]['length']?_0x3c421a[_0xd2cc('0x2b')]:_0x24e3f9['model'];if(!_0x582850[_0xd2cc('0x29')][_0xd2cc('0x2e')](_0xd2cc('0x2f'))){_0x3c421a[_0xd2cc('0x30')]=qs['limit'](_0x582850[_0xd2cc('0x29')]['limit']);_0x3c421a[_0xd2cc('0x1c')]=qs[_0xd2cc('0x1c')](_0x582850[_0xd2cc('0x29')][_0xd2cc('0x1c')]);}_0x3c421a[_0xd2cc('0x31')]=qs['sort'](_0x582850['query'][_0xd2cc('0x32')]);_0x3c421a[_0xd2cc('0x33')]=qs[_0xd2cc('0x34')](_[_0xd2cc('0x35')](_0x582850[_0xd2cc('0x29')],_0x24e3f9['filters']));if(_0x582850[_0xd2cc('0x29')]['filter']){_0x3c421a['where']=_[_0xd2cc('0x36')](_0x3c421a[_0xd2cc('0x33')],{'$or':_[_0xd2cc('0x37')](_0x58c0f1,function(_0x5ef085){if(_0x5ef085[_0xd2cc('0x38')][_0xd2cc('0x39')]!==_0xd2cc('0x3a')){var _0x455fd7={};_0x455fd7[_0x5ef085['field']]={'$like':'%'+_0x582850['query']['filter']+'%'};return _0x455fd7;}})});}_0x3c421a=_[_0xd2cc('0x36')]({},_0x3c421a,_0x582850['options']);var _0x5ed0cb={'where':_0x3c421a[_0xd2cc('0x33')]};return db[_0xd2cc('0x27')]['count'](_0x5ed0cb)['then'](function(_0x4e5861){_0x4cce01['count']=_0x4e5861;if(_0x582850[_0xd2cc('0x29')][_0xd2cc('0x3b')]){_0x3c421a['include']=[{'all':!![]}];}return db[_0xd2cc('0x27')][_0xd2cc('0x3c')](_0x3c421a);})[_0xd2cc('0x23')](function(_0x585051){_0x4cce01[_0xd2cc('0x3d')]=_0x585051;return _0x4cce01;})[_0xd2cc('0x23')](respondWithFilteredResult(_0x3c8211,_0x3c421a))[_0xd2cc('0x3e')](handleError(_0x3c8211,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ba37cf0..90de52e 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 _0x1b64=['util','api','./migration.attributes','exports','Migration','migrations','lodash'];(function(_0x31262a,_0x494328){var _0x187757=function(_0x5bcaf1){while(--_0x5bcaf1){_0x31262a['push'](_0x31262a['shift']());}};_0x187757(++_0x494328);}(_0x1b64,0x76));var _0x41b6=function(_0xb24c45,_0x4ce60f){_0xb24c45=_0xb24c45-0x0;var _0x38cc03=_0x1b64[_0xb24c45];return _0x38cc03;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var logger=require('../../config/logger')(_0x41b6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x41b6('0x3'));module[_0x41b6('0x4')]=function(_0xd38c24,_0x19f577){return _0xd38c24['define'](_0x41b6('0x5'),attributes,{'tableName':_0x41b6('0x6'),'paranoid':![],'indexes':[],'timestamps':![]});}; \ No newline at end of file +var _0xee87=['../../config/logger','api','moment','bluebird','request-promise','./migration.attributes','exports','Migration','util'];(function(_0x535ed5,_0x24153d){var _0x43efea=function(_0x158f72){while(--_0x158f72){_0x535ed5['push'](_0x535ed5['shift']());}};_0x43efea(++_0x24153d);}(_0xee87,0x10d));var _0x7ee8=function(_0x5a8f4c,_0x53ace9){_0x5a8f4c=_0x5a8f4c-0x0;var _0x1edeb2=_0xee87[_0x5a8f4c];return _0x1edeb2;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var logger=require(_0x7ee8('0x1'))(_0x7ee8('0x2'));var moment=require(_0x7ee8('0x3'));var BPromise=require(_0x7ee8('0x4'));var rp=require(_0x7ee8('0x5'));var attributes=require(_0x7ee8('0x6'));module[_0x7ee8('0x7')]=function(_0x32466c,_0x23a89c){return _0x32466c['define'](_0x7ee8('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 2d48464..6187bd7 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 _0xed1f=['request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2065c1,_0x1246d1){var _0x162351=function(_0x5d0830){while(--_0x5d0830){_0x2065c1['push'](_0x2065c1['shift']());}};_0x162351(++_0x1246d1);}(_0xed1f,0x6a));var _0xfed1=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xed1f[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('Migration,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('Migration,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('Migration,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('Migration,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x7da7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x1253eb,_0x363f48){var _0x36234c=function(_0x2c7df8){while(--_0x2c7df8){_0x1253eb['push'](_0x1253eb['shift']());}};_0x36234c(++_0x363f48);}(_0x7da7,0x10d));var _0x77da=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x7da7[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){return client[_0x77da('0x9')](_0x30afe0,_0x1191de)[_0x77da('0xa')](function(_0x58f3fe){logger[_0x77da('0xb')](_0x77da('0xc'),_0x47cf1d,_0x77da('0xd'));logger['debug'](_0x77da('0xe'),_0x47cf1d,_0x77da('0xd'),JSON[_0x77da('0xf')](_0x58f3fe));if(_0x58f3fe[_0x77da('0x10')]){if(_0x58f3fe['error'][_0x77da('0x11')]===0x1f4){logger[_0x77da('0x10')](_0x77da('0xc'),_0x47cf1d,_0x58f3fe['error']['message']);return _0x37c5ab(_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);}logger['error'](_0x77da('0xc'),_0x47cf1d,_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);return _0x13992e(_0x58f3fe[_0x77da('0x10')]['message']);}else{logger[_0x77da('0xb')]('Migration,\x20%s,\x20%s',_0x47cf1d,_0x77da('0xd'));_0x13992e(_0x58f3fe[_0x77da('0x13')][_0x77da('0x12')]);}})[_0x77da('0x14')](function(_0x4ecd98){logger['error']('Migration,\x20%s,\x20%s',_0x47cf1d,_0x4ecd98);_0x37c5ab(_0x4ecd98);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 330a850..69f4e90 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 _0xd3c6=['Router','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c497f,_0x2f6e2a){var _0x10a176=function(_0x1a861e){while(--_0x1a861e){_0x4c497f['push'](_0x4c497f['shift']());}};_0x10a176(++_0x2f6e2a);}(_0xd3c6,0x121));var _0x6d3c=function(_0x13d450,_0x2f3a11){_0x13d450=_0x13d450-0x0;var _0x159f14=_0xd3c6[_0x13d450];return _0x159f14;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var path=require(_0x6d3c('0x2'));var timeout=require(_0x6d3c('0x3'));var express=require(_0x6d3c('0x4'));var router=express[_0x6d3c('0x5')]();var auth=require(_0x6d3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d3c('0x7'));var controller=require(_0x6d3c('0x8'));router['get']('/',auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xa')]);router[_0x6d3c('0xb')](_0x6d3c('0xc'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xd')]);router[_0x6d3c('0xe')]('/',auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xf')]);router[_0x6d3c('0x10')](_0x6d3c('0xc'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0x11')]);router[_0x6d3c('0x12')](_0x6d3c('0xc'),auth['isAuthenticated'](),controller[_0x6d3c('0x13')]);module[_0x6d3c('0x14')]=router; \ No newline at end of file +var _0x7103=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2ff863,_0x304b59){var _0x3a422f=function(_0x3d8178){while(--_0x3d8178){_0x2ff863['push'](_0x2ff863['shift']());}};_0x3a422f(++_0x304b59);}(_0x7103,0x1db));var _0x3710=function(_0x46a9f2,_0x63d490){_0x46a9f2=_0x46a9f2-0x0;var _0x23117e=_0x7103[_0x46a9f2];return _0x23117e;};'use strict';var multer=require(_0x3710('0x0'));var util=require(_0x3710('0x1'));var path=require(_0x3710('0x2'));var timeout=require(_0x3710('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3710('0x4'));var interaction=require(_0x3710('0x5'));var config=require(_0x3710('0x6'));var controller=require('./network.controller');router['get']('/',auth[_0x3710('0x7')](),controller[_0x3710('0x8')]);router[_0x3710('0x9')]('/:id',auth[_0x3710('0x7')](),controller[_0x3710('0xa')]);router[_0x3710('0xb')]('/',auth[_0x3710('0x7')](),controller[_0x3710('0xc')]);router[_0x3710('0xd')](_0x3710('0xe'),auth[_0x3710('0x7')](),controller[_0x3710('0xf')]);router[_0x3710('0x10')](_0x3710('0xe'),auth[_0x3710('0x7')](),controller[_0x3710('0x11')]);module[_0x3710('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 7da750c..dee5e60 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 _0xe162=['exports','ENUM','localnet','externip','sequelize'];(function(_0x5c54a5,_0x3ea278){var _0x30c2a2=function(_0x52b305){while(--_0x52b305){_0x5c54a5['push'](_0x5c54a5['shift']());}};_0x30c2a2(++_0x3ea278);}(_0xe162,0x81));var _0x2e16=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe162[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x2e16('0x0'));module[_0x2e16('0x1')]={'type':{'type':Sequelize[_0x2e16('0x2')](_0x2e16('0x3'),_0x2e16('0x4'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3ad8=['exports','ENUM','localnet','externip','STRING'];(function(_0x1cb53c,_0x140a0e){var _0x17d36c=function(_0x243d06){while(--_0x243d06){_0x1cb53c['push'](_0x1cb53c['shift']());}};_0x17d36c(++_0x140a0e);}(_0x3ad8,0xff));var _0x83ad=function(_0x370b30,_0x2f28c2){_0x370b30=_0x370b30-0x0;var _0x1fa77e=_0x3ad8[_0x370b30];return _0x1fa77e;};'use strict';var Sequelize=require('sequelize');module[_0x83ad('0x0')]={'type':{'type':Sequelize[_0x83ad('0x1')](_0x83ad('0x2'),_0x83ad('0x3'))},'value':{'type':Sequelize[_0x83ad('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 64927e6..b664be1 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 _0x197f=['pick','filter','map','type','key','field','options','Network','count','includeAll','include','findAll','rows','catch','show','merge','find','sequelize','transaction','body','readFileSync','root','server/files/templates/network.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','params','format','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','rawAttributes','keys','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x197f,0x143));var _0xf197=function(_0x3f9bd9,_0x2d58d2){_0x3f9bd9=_0x3f9bd9-0x0;var _0x4463a4=_0x197f[_0x3f9bd9];return _0x4463a4;};'use strict';var pdf=require(_0xf197('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf197('0x1'));var zipdir=require(_0xf197('0x2'));var jsonpatch=require(_0xf197('0x3'));var rp=require(_0xf197('0x4'));var moment=require('moment');var BPromise=require(_0xf197('0x5'));var Mustache=require(_0xf197('0x6'));var util=require(_0xf197('0x7'));var path=require('path');var sox=require(_0xf197('0x8'));var csv=require(_0xf197('0x9'));var ejs=require(_0xf197('0xa'));var fs=require('fs');var _=require(_0xf197('0xb'));var squel=require(_0xf197('0xc'));var crypto=require(_0xf197('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf197('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf197('0xf'));var Papa=require(_0xf197('0x10'));var authService=require(_0xf197('0x11'));var hardwareService=require(_0xf197('0x12'));var Redis=require(_0xf197('0x13'));var qs=require(_0xf197('0x14'));var logger=require(_0xf197('0x15'))(_0xf197('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf197('0x17'))['db'];var jayson=require(_0xf197('0x18'));var client=jayson[_0xf197('0x19')][_0xf197('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x259c16,_0x1bee25,_0x584b89,_0x110275){return new BPromise(function(_0xd48776,_0x128520){var _0x2d6ce1=_0x110275||client;return _0x2d6ce1[_0xf197('0x1b')](_0x259c16,_0x584b89)[_0xf197('0x1c')](function(_0x268a60){logger[_0xf197('0x1d')](_0xf197('0x1e'),_0x1bee25,_0xf197('0x1f'));logger[_0xf197('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0x1bee25,'request\x20sent',JSON[_0xf197('0x21')](_0x268a60));if(_0x268a60[_0xf197('0x22')]){if(_0x268a60[_0xf197('0x22')][_0xf197('0x23')]===0x1f4){logger[_0xf197('0x22')](_0xf197('0x1e'),_0x1bee25,_0x268a60[_0xf197('0x22')][_0xf197('0x24')]);return _0x128520(_0x268a60[_0xf197('0x22')][_0xf197('0x24')]);}logger['error'](_0xf197('0x1e'),_0x1bee25,_0x268a60[_0xf197('0x22')]['message']);return _0xd48776(_0x268a60[_0xf197('0x22')][_0xf197('0x24')]);}else{logger['info'](_0xf197('0x1e'),_0x1bee25,_0xf197('0x1f'));_0xd48776(_0x268a60[_0xf197('0x25')][_0xf197('0x24')]);}})['catch'](function(_0x2de3da){logger[_0xf197('0x22')](_0xf197('0x1e'),_0x1bee25,_0x2de3da);_0x128520(_0x2de3da);});});}function respondWithStatusCode(_0x5d31c,_0x275376){_0x275376=_0x275376||0xcc;return function(_0x3a4167){if(_0x3a4167){return _0x5d31c['sendStatus'](_0x275376);}return _0x5d31c[_0xf197('0x26')](_0x275376)[_0xf197('0x27')]();};}function respondWithResult(_0x25e9da,_0x106262){_0x106262=_0x106262||0xc8;return function(_0x382cd1){if(_0x382cd1){return _0x25e9da[_0xf197('0x26')](_0x106262)['json'](_0x382cd1);}};}function respondWithFilteredResult(_0x405280,_0x110b9c){return function(_0x298892){if(_0x298892){var _0x55901a=_0x298892['count'],_0x2a588e=_0x110b9c[_0xf197('0x28')],_0x10c619=_0x110b9c[_0xf197('0x28')]+_0x110b9c[_0xf197('0x29')],_0x302262;if(_0x10c619>=_0x55901a){_0x10c619=_0x55901a;_0x302262=0xc8;}else{_0x302262=0xce;}_0x405280[_0xf197('0x26')](_0x302262);return _0x405280[_0xf197('0x2a')](_0xf197('0x2b'),_0x2a588e+'-'+_0x10c619+'/'+_0x55901a)['json'](_0x298892);}return null;};}function patchUpdates(_0x14ae93){return function(_0x5dcd83){try{jsonpatch['apply'](_0x5dcd83,_0x14ae93,!![]);}catch(_0x542016){return BPromise[_0xf197('0x2c')](_0x542016);}return _0x5dcd83[_0xf197('0x2d')]();};}function saveUpdates(_0x13dce6,_0x158ddc){return function(_0x1bba64){if(_0x1bba64){return _0x1bba64[_0xf197('0x2e')](_0x13dce6)[_0xf197('0x1c')](function(_0x3fc55b){return _0x3fc55b;});}return null;};}function removeEntity(_0x581d4e,_0x560eca){return function(_0x5a68fd){if(_0x5a68fd){return _0x5a68fd[_0xf197('0x2f')]()[_0xf197('0x1c')](function(){_0x581d4e[_0xf197('0x26')](0xcc)[_0xf197('0x27')]();});}};}function handleEntityNotFound(_0x4a68a9,_0x16f215){return function(_0xeeaa93){if(!_0xeeaa93){_0x4a68a9['sendStatus'](0x194);}return _0xeeaa93;};}function handleError(_0x108c24,_0x143b3f){_0x143b3f=_0x143b3f||0x1f4;return function(_0x336211){logger[_0xf197('0x22')](_0x336211[_0xf197('0x30')]);if(_0x336211[_0xf197('0x31')]){delete _0x336211['name'];}_0x108c24[_0xf197('0x26')](_0x143b3f)[_0xf197('0x32')](_0x336211);};}exports[_0xf197('0x33')]=function(_0x5600d4,_0x45e21d){var _0x4c3431={},_0x33fb9d={},_0x3149d4={'count':0x0,'rows':[]};var _0x3946b1=db['Network'][_0xf197('0x34')];_0x33fb9d['model']=_[_0xf197('0x35')](_0x3946b1);_0x33fb9d['query']=_[_0xf197('0x35')](_0x5600d4['query']);_0x33fb9d['filters']=_[_0xf197('0x36')](_0x33fb9d[_0xf197('0x37')],_0x33fb9d[_0xf197('0x38')]);_0x4c3431['attributes']=_[_0xf197('0x36')](_0x33fb9d['model'],qs['fields'](_0x5600d4[_0xf197('0x38')][_0xf197('0x39')]));_0x4c3431[_0xf197('0x3a')]=_0x4c3431['attributes']['length']?_0x4c3431[_0xf197('0x3a')]:_0x33fb9d[_0xf197('0x37')];if(!_0x5600d4[_0xf197('0x38')][_0xf197('0x3b')](_0xf197('0x3c'))){_0x4c3431[_0xf197('0x29')]=qs[_0xf197('0x29')](_0x5600d4['query'][_0xf197('0x29')]);_0x4c3431[_0xf197('0x28')]=qs[_0xf197('0x28')](_0x5600d4[_0xf197('0x38')]['offset']);}_0x4c3431[_0xf197('0x3d')]=qs[_0xf197('0x3e')](_0x5600d4[_0xf197('0x38')][_0xf197('0x3e')]);_0x4c3431[_0xf197('0x3f')]=qs[_0xf197('0x40')](_[_0xf197('0x41')](_0x5600d4[_0xf197('0x38')],_0x33fb9d['filters']));if(_0x5600d4[_0xf197('0x38')][_0xf197('0x42')]){_0x4c3431['where']=_['merge'](_0x4c3431[_0xf197('0x3f')],{'$or':_[_0xf197('0x43')](_0x3946b1,function(_0xfa81b0){if(_0xfa81b0[_0xf197('0x44')][_0xf197('0x45')]!=='VIRTUAL'){var _0x448b4f={};_0x448b4f[_0xfa81b0[_0xf197('0x46')]]={'$like':'%'+_0x5600d4[_0xf197('0x38')][_0xf197('0x42')]+'%'};return _0x448b4f;}})});}_0x4c3431=_['merge']({},_0x4c3431,_0x5600d4[_0xf197('0x47')]);var _0xea2b23={'where':_0x4c3431[_0xf197('0x3f')]};return db[_0xf197('0x48')][_0xf197('0x49')](_0xea2b23)[_0xf197('0x1c')](function(_0x41fe40){_0x3149d4[_0xf197('0x49')]=_0x41fe40;if(_0x5600d4['query'][_0xf197('0x4a')]){_0x4c3431[_0xf197('0x4b')]=[{'all':!![]}];}return db[_0xf197('0x48')][_0xf197('0x4c')](_0x4c3431);})['then'](function(_0x275000){_0x3149d4[_0xf197('0x4d')]=_0x275000;return _0x3149d4;})[_0xf197('0x1c')](respondWithFilteredResult(_0x45e21d,_0x4c3431))[_0xf197('0x4e')](handleError(_0x45e21d,null));};exports[_0xf197('0x4f')]=function(_0x3bda59,_0x1162a1){var _0x5bf113={'raw':!![],'where':{'id':_0x3bda59['params']['id']}},_0x63ac10={};_0x63ac10['model']=_[_0xf197('0x35')](db[_0xf197('0x48')][_0xf197('0x34')]);_0x63ac10['query']=_[_0xf197('0x35')](_0x3bda59[_0xf197('0x38')]);_0x63ac10[_0xf197('0x40')]=_['intersection'](_0x63ac10['model'],_0x63ac10['query']);_0x5bf113[_0xf197('0x3a')]=_[_0xf197('0x36')](_0x63ac10['model'],qs['fields'](_0x3bda59[_0xf197('0x38')][_0xf197('0x39')]));_0x5bf113['attributes']=_0x5bf113[_0xf197('0x3a')]['length']?_0x5bf113[_0xf197('0x3a')]:_0x63ac10[_0xf197('0x37')];if(_0x3bda59['query'][_0xf197('0x4a')]){_0x5bf113[_0xf197('0x4b')]=[{'all':!![]}];}_0x5bf113=_[_0xf197('0x50')]({},_0x5bf113,_0x3bda59[_0xf197('0x47')]);return db[_0xf197('0x48')][_0xf197('0x51')](_0x5bf113)[_0xf197('0x1c')](handleEntityNotFound(_0x1162a1,null))[_0xf197('0x1c')](respondWithResult(_0x1162a1,null))['catch'](handleError(_0x1162a1,null));};exports['create']=function(_0x30008b,_0x1ee2c8,_0x4a785e){var _0x2e10c3;return db[_0xf197('0x52')][_0xf197('0x53')](function(_0x22d378){return db['Network']['create'](_0x30008b[_0xf197('0x54')],{'raw':!![]})['then'](function(_0x463a3d){_0x2e10c3=_0x463a3d;return db[_0xf197('0x48')][_0xf197('0x4c')]({'where':{'type':_0x30008b['body'][_0xf197('0x44')]},'raw':!![]});})[_0xf197('0x1c')](function(_0x121f3f){var _0x3c3628=fs[_0xf197('0x55')](path['join'](config[_0xf197('0x56')],_0xf197('0x57')),_0xf197('0x58'));var _0x278ce0=ejs[_0xf197('0x59')](_0x3c3628,{'networks':_0x121f3f||[]});fs[_0xf197('0x5a')](util['format'](_0xf197('0x5b'),_0x30008b['body'][_0xf197('0x44')][_0xf197('0x5c')]()),_0x278ce0);})['then'](function(){return respondWithRpcPromise(_0xf197('0x5d'),'create',{'module':_0xf197('0x5e')});})['then'](function(){return _0x2e10c3;});})[_0xf197('0x1c')](respondWithResult(_0x1ee2c8,0xc9))['catch'](handleError(_0x1ee2c8,null));};exports['update']=function(_0x512b67,_0x70ff6d,_0x4902d8){var _0x5e0f5c;return db[_0xf197('0x52')][_0xf197('0x53')](function(_0x3d10f5){return db[_0xf197('0x48')]['find']({'where':{'id':_0x512b67[_0xf197('0x5f')]['id']}})[_0xf197('0x1c')](handleEntityNotFound(_0x70ff6d,null))['then'](saveUpdates(_0x512b67['body'],null))[_0xf197('0x1c')](function(_0x3473e3){if(_0x3473e3){_0x5e0f5c=_0x3473e3;return db[_0xf197('0x48')][_0xf197('0x4c')]({'where':{'type':_0x5e0f5c['type']},'raw':!![]});}return null;})[_0xf197('0x1c')](function(_0x606b6f){if(_0x606b6f){var _0x5e299b=fs[_0xf197('0x55')](path['join'](config[_0xf197('0x56')],'server/files/templates/network.ejs'),_0xf197('0x58'));var _0x5d89ef=ejs['render'](_0x5e299b,{'networks':_0x606b6f||[]});fs[_0xf197('0x5a')](util[_0xf197('0x60')](_0xf197('0x5b'),_0x5e0f5c[_0xf197('0x44')][_0xf197('0x5c')]()),_0x5d89ef);return respondWithRpcPromise(_0xf197('0x5d'),'update',{'module':_0xf197('0x5e')});}return null;})[_0xf197('0x1c')](function(_0x2531dc){if(_0x2531dc){return _0x5e0f5c;}return null;});})['then'](respondWithResult(_0x70ff6d,null))[_0xf197('0x4e')](handleError(_0x70ff6d,null));};exports[_0xf197('0x2f')]=function(_0x29b855,_0x23b1d2,_0x1b55e2){var _0x4df7c2;return db[_0xf197('0x48')][_0xf197('0x51')]({'where':{'id':_0x29b855['params']['id']}})[_0xf197('0x1c')](function(_0x415a89){_0x4df7c2=_0x415a89;return _0x415a89;})[_0xf197('0x1c')](handleEntityNotFound(_0x23b1d2,null))[_0xf197('0x1c')](removeEntity(_0x23b1d2,null))[_0xf197('0x1c')](function(){if(_0x4df7c2){return db['Network'][_0xf197('0x4c')]({'where':{'type':_0x4df7c2[_0xf197('0x44')]},'raw':!![]});}})[_0xf197('0x1c')](function(_0x262ae6){if(_0x262ae6){var _0x31de3d=fs[_0xf197('0x55')](path['join'](config[_0xf197('0x56')],'server/files/templates/network.ejs'),_0xf197('0x58'));var _0x3f1c2a=ejs[_0xf197('0x59')](_0x31de3d,{'networks':_0x262ae6||[]});fs[_0xf197('0x5a')](util[_0xf197('0x60')](_0xf197('0x5b'),_0x4df7c2[_0xf197('0x44')]['toLowerCase']()),_0x3f1c2a);return respondWithRpcPromise(_0xf197('0x5d'),_0xf197('0x2f'),{'module':_0xf197('0x5e')});}})[_0xf197('0x4e')](handleError(_0x23b1d2,null));}; \ No newline at end of file +var _0x2d37=['Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','findAll','catch','includeAll','include','options','sequelize','transaction','create','body','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','params','readFileSync','find','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','info'];(function(_0x252485,_0x366476){var _0x4d3606=function(_0x7593a6){while(--_0x7593a6){_0x252485['push'](_0x252485['shift']());}};_0x4d3606(++_0x366476);}(_0x2d37,0xa8));var _0x72d3=function(_0x4e5d2d,_0x522f39){_0x4e5d2d=_0x4e5d2d-0x0;var _0x2fa9dc=_0x2d37[_0x4e5d2d];return _0x2fa9dc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x72d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x72d3('0x3'));var path=require(_0x72d3('0x4'));var sox=require(_0x72d3('0x5'));var csv=require(_0x72d3('0x6'));var ejs=require(_0x72d3('0x7'));var fs=require('fs');var _=require(_0x72d3('0x8'));var squel=require(_0x72d3('0x9'));var crypto=require(_0x72d3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x72d3('0xb'));var toCsv=require(_0x72d3('0x6'));var querystring=require(_0x72d3('0xc'));var Papa=require(_0x72d3('0xd'));var authService=require(_0x72d3('0xe'));var hardwareService=require(_0x72d3('0xf'));var Redis=require(_0x72d3('0x10'));var qs=require(_0x72d3('0x11'));var logger=require(_0x72d3('0x12'))('api');var utils=require(_0x72d3('0x13'));var config=require(_0x72d3('0x14'));var db=require(_0x72d3('0x15'))['db'];var jayson=require(_0x72d3('0x16'));var client=jayson[_0x72d3('0x17')][_0x72d3('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x524c04,_0x1fa51f,_0x3c488e,_0x1950ea){return new BPromise(function(_0x378c03,_0xb0cb4){var _0x14e5e9=_0x1950ea||client;return _0x14e5e9['request'](_0x524c04,_0x3c488e)['then'](function(_0x208ede){logger[_0x72d3('0x19')](_0x72d3('0x1a'),_0x1fa51f,_0x72d3('0x1b'));logger['debug'](_0x72d3('0x1c'),_0x1fa51f,_0x72d3('0x1b'),JSON[_0x72d3('0x1d')](_0x208ede));if(_0x208ede[_0x72d3('0x1e')]){if(_0x208ede['error'][_0x72d3('0x1f')]===0x1f4){logger[_0x72d3('0x1e')](_0x72d3('0x1a'),_0x1fa51f,_0x208ede[_0x72d3('0x1e')][_0x72d3('0x20')]);return _0xb0cb4(_0x208ede['error'][_0x72d3('0x20')]);}logger[_0x72d3('0x1e')](_0x72d3('0x1a'),_0x1fa51f,_0x208ede['error'][_0x72d3('0x20')]);return _0x378c03(_0x208ede[_0x72d3('0x1e')][_0x72d3('0x20')]);}else{logger['info'](_0x72d3('0x1a'),_0x1fa51f,_0x72d3('0x1b'));_0x378c03(_0x208ede[_0x72d3('0x21')][_0x72d3('0x20')]);}})['catch'](function(_0x5177b9){logger[_0x72d3('0x1e')](_0x72d3('0x1a'),_0x1fa51f,_0x5177b9);_0xb0cb4(_0x5177b9);});});}function respondWithStatusCode(_0x3e2abd,_0x5347a3){_0x5347a3=_0x5347a3||0xcc;return function(_0x14d0e4){if(_0x14d0e4){return _0x3e2abd[_0x72d3('0x22')](_0x5347a3);}return _0x3e2abd[_0x72d3('0x23')](_0x5347a3)[_0x72d3('0x24')]();};}function respondWithResult(_0x193603,_0x33d552){_0x33d552=_0x33d552||0xc8;return function(_0x3faf4b){if(_0x3faf4b){return _0x193603[_0x72d3('0x23')](_0x33d552)[_0x72d3('0x25')](_0x3faf4b);}};}function respondWithFilteredResult(_0x1e60d8,_0x535680){return function(_0x3f6e96){if(_0x3f6e96){var _0x23f9db=_0x3f6e96[_0x72d3('0x26')],_0x5e6a88=_0x535680['offset'],_0x1d7c80=_0x535680[_0x72d3('0x27')]+_0x535680['limit'],_0x430121;if(_0x1d7c80>=_0x23f9db){_0x1d7c80=_0x23f9db;_0x430121=0xc8;}else{_0x430121=0xce;}_0x1e60d8[_0x72d3('0x23')](_0x430121);return _0x1e60d8[_0x72d3('0x28')](_0x72d3('0x29'),_0x5e6a88+'-'+_0x1d7c80+'/'+_0x23f9db)[_0x72d3('0x25')](_0x3f6e96);}return null;};}function patchUpdates(_0x1e06b3){return function(_0x3ae901){try{jsonpatch[_0x72d3('0x2a')](_0x3ae901,_0x1e06b3,!![]);}catch(_0x40f369){return BPromise[_0x72d3('0x2b')](_0x40f369);}return _0x3ae901['save']();};}function saveUpdates(_0x5b7b08,_0x4f2340){return function(_0x2c5e52){if(_0x2c5e52){return _0x2c5e52['update'](_0x5b7b08)[_0x72d3('0x2c')](function(_0x5603cf){return _0x5603cf;});}return null;};}function removeEntity(_0x48a78a,_0xa80c15){return function(_0x26fd06){if(_0x26fd06){return _0x26fd06[_0x72d3('0x2d')]()['then'](function(){_0x48a78a[_0x72d3('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1535c6,_0x14ad46){return function(_0x2faaf6){if(!_0x2faaf6){_0x1535c6[_0x72d3('0x22')](0x194);}return _0x2faaf6;};}function handleError(_0x278df5,_0x4299ab){_0x4299ab=_0x4299ab||0x1f4;return function(_0x355c5c){logger[_0x72d3('0x1e')](_0x355c5c[_0x72d3('0x2e')]);if(_0x355c5c[_0x72d3('0x2f')]){delete _0x355c5c[_0x72d3('0x2f')];}_0x278df5[_0x72d3('0x23')](_0x4299ab)[_0x72d3('0x30')](_0x355c5c);};}exports[_0x72d3('0x31')]=function(_0x3a46f4,_0x1258c0){var _0x1be638={},_0x263df0={},_0x2d6525={'count':0x0,'rows':[]};var _0x2e3ce4=db[_0x72d3('0x32')][_0x72d3('0x33')];_0x263df0[_0x72d3('0x34')]=_[_0x72d3('0x35')](_0x2e3ce4);_0x263df0[_0x72d3('0x36')]=_[_0x72d3('0x35')](_0x3a46f4['query']);_0x263df0[_0x72d3('0x37')]=_[_0x72d3('0x38')](_0x263df0[_0x72d3('0x34')],_0x263df0[_0x72d3('0x36')]);_0x1be638[_0x72d3('0x39')]=_['intersection'](_0x263df0[_0x72d3('0x34')],qs[_0x72d3('0x3a')](_0x3a46f4[_0x72d3('0x36')][_0x72d3('0x3a')]));_0x1be638[_0x72d3('0x39')]=_0x1be638[_0x72d3('0x39')][_0x72d3('0x3b')]?_0x1be638[_0x72d3('0x39')]:_0x263df0[_0x72d3('0x34')];if(!_0x3a46f4[_0x72d3('0x36')][_0x72d3('0x3c')](_0x72d3('0x3d'))){_0x1be638['limit']=qs['limit'](_0x3a46f4['query'][_0x72d3('0x3e')]);_0x1be638[_0x72d3('0x27')]=qs['offset'](_0x3a46f4[_0x72d3('0x36')][_0x72d3('0x27')]);}_0x1be638[_0x72d3('0x3f')]=qs[_0x72d3('0x40')](_0x3a46f4[_0x72d3('0x36')][_0x72d3('0x40')]);_0x1be638[_0x72d3('0x41')]=qs[_0x72d3('0x37')](_[_0x72d3('0x42')](_0x3a46f4['query'],_0x263df0[_0x72d3('0x37')]));if(_0x3a46f4['query'][_0x72d3('0x43')]){_0x1be638[_0x72d3('0x41')]=_[_0x72d3('0x44')](_0x1be638['where'],{'$or':_[_0x72d3('0x45')](_0x2e3ce4,function(_0x26f3c2){if(_0x26f3c2[_0x72d3('0x46')]['key']!==_0x72d3('0x47')){var _0xcf668f={};_0xcf668f[_0x26f3c2[_0x72d3('0x48')]]={'$like':'%'+_0x3a46f4[_0x72d3('0x36')][_0x72d3('0x43')]+'%'};return _0xcf668f;}})});}_0x1be638=_['merge']({},_0x1be638,_0x3a46f4['options']);var _0x2101f9={'where':_0x1be638[_0x72d3('0x41')]};return db[_0x72d3('0x32')][_0x72d3('0x26')](_0x2101f9)['then'](function(_0x2fc70b){_0x2d6525['count']=_0x2fc70b;if(_0x3a46f4[_0x72d3('0x36')]['includeAll']){_0x1be638['include']=[{'all':!![]}];}return db[_0x72d3('0x32')][_0x72d3('0x49')](_0x1be638);})[_0x72d3('0x2c')](function(_0x18bef2){_0x2d6525['rows']=_0x18bef2;return _0x2d6525;})['then'](respondWithFilteredResult(_0x1258c0,_0x1be638))[_0x72d3('0x4a')](handleError(_0x1258c0,null));};exports['show']=function(_0x1ddf17,_0x26a2e9){var _0x3bd2c5={'raw':!![],'where':{'id':_0x1ddf17['params']['id']}},_0x566535={};_0x566535[_0x72d3('0x34')]=_[_0x72d3('0x35')](db[_0x72d3('0x32')][_0x72d3('0x33')]);_0x566535[_0x72d3('0x36')]=_[_0x72d3('0x35')](_0x1ddf17['query']);_0x566535[_0x72d3('0x37')]=_['intersection'](_0x566535[_0x72d3('0x34')],_0x566535[_0x72d3('0x36')]);_0x3bd2c5[_0x72d3('0x39')]=_['intersection'](_0x566535[_0x72d3('0x34')],qs[_0x72d3('0x3a')](_0x1ddf17[_0x72d3('0x36')][_0x72d3('0x3a')]));_0x3bd2c5[_0x72d3('0x39')]=_0x3bd2c5['attributes'][_0x72d3('0x3b')]?_0x3bd2c5[_0x72d3('0x39')]:_0x566535[_0x72d3('0x34')];if(_0x1ddf17[_0x72d3('0x36')][_0x72d3('0x4b')]){_0x3bd2c5[_0x72d3('0x4c')]=[{'all':!![]}];}_0x3bd2c5=_['merge']({},_0x3bd2c5,_0x1ddf17[_0x72d3('0x4d')]);return db[_0x72d3('0x32')]['find'](_0x3bd2c5)[_0x72d3('0x2c')](handleEntityNotFound(_0x26a2e9,null))[_0x72d3('0x2c')](respondWithResult(_0x26a2e9,null))[_0x72d3('0x4a')](handleError(_0x26a2e9,null));};exports['create']=function(_0x61e98e,_0x5c7422,_0x1e57fe){var _0x2ab861;return db[_0x72d3('0x4e')][_0x72d3('0x4f')](function(_0x5d2154){return db[_0x72d3('0x32')][_0x72d3('0x50')](_0x61e98e[_0x72d3('0x51')],{'raw':!![]})['then'](function(_0x3037df){_0x2ab861=_0x3037df;return db['Network'][_0x72d3('0x49')]({'where':{'type':_0x61e98e['body'][_0x72d3('0x46')]},'raw':!![]});})[_0x72d3('0x2c')](function(_0x49a9f1){var _0xd3b56e=fs['readFileSync'](path[_0x72d3('0x52')](config[_0x72d3('0x53')],_0x72d3('0x54')),_0x72d3('0x55'));var _0x36b519=ejs[_0x72d3('0x56')](_0xd3b56e,{'networks':_0x49a9f1||[]});fs[_0x72d3('0x57')](util[_0x72d3('0x58')](_0x72d3('0x59'),_0x61e98e[_0x72d3('0x51')][_0x72d3('0x46')][_0x72d3('0x5a')]()),_0x36b519);})[_0x72d3('0x2c')](function(){return respondWithRpcPromise(_0x72d3('0x5b'),'create',{'module':_0x72d3('0x5c')});})['then'](function(){return _0x2ab861;});})['then'](respondWithResult(_0x5c7422,0xc9))[_0x72d3('0x4a')](handleError(_0x5c7422,null));};exports[_0x72d3('0x5d')]=function(_0x356baf,_0x2ab8c0,_0x51baae){var _0xfc3ab3;return db[_0x72d3('0x4e')][_0x72d3('0x4f')](function(_0x4179a0){return db['Network']['find']({'where':{'id':_0x356baf[_0x72d3('0x5e')]['id']}})[_0x72d3('0x2c')](handleEntityNotFound(_0x2ab8c0,null))['then'](saveUpdates(_0x356baf[_0x72d3('0x51')],null))[_0x72d3('0x2c')](function(_0x32d74c){if(_0x32d74c){_0xfc3ab3=_0x32d74c;return db[_0x72d3('0x32')][_0x72d3('0x49')]({'where':{'type':_0xfc3ab3['type']},'raw':!![]});}return null;})[_0x72d3('0x2c')](function(_0x326c04){if(_0x326c04){var _0x3c0cd8=fs[_0x72d3('0x5f')](path['join'](config['root'],_0x72d3('0x54')),'utf8');var _0x1c2381=ejs['render'](_0x3c0cd8,{'networks':_0x326c04||[]});fs['writeFileSync'](util[_0x72d3('0x58')](_0x72d3('0x59'),_0xfc3ab3[_0x72d3('0x46')][_0x72d3('0x5a')]()),_0x1c2381);return respondWithRpcPromise(_0x72d3('0x5b'),_0x72d3('0x5d'),{'module':_0x72d3('0x5c')});}return null;})['then'](function(_0x30c435){if(_0x30c435){return _0xfc3ab3;}return null;});})['then'](respondWithResult(_0x2ab8c0,null))[_0x72d3('0x4a')](handleError(_0x2ab8c0,null));};exports['destroy']=function(_0x528983,_0x3c5b66,_0x5888d6){var _0x3490bd;return db['Network'][_0x72d3('0x60')]({'where':{'id':_0x528983[_0x72d3('0x5e')]['id']}})[_0x72d3('0x2c')](function(_0x5ab062){_0x3490bd=_0x5ab062;return _0x5ab062;})['then'](handleEntityNotFound(_0x3c5b66,null))[_0x72d3('0x2c')](removeEntity(_0x3c5b66,null))['then'](function(){if(_0x3490bd){return db['Network']['findAll']({'where':{'type':_0x3490bd[_0x72d3('0x46')]},'raw':!![]});}})[_0x72d3('0x2c')](function(_0x5d5730){if(_0x5d5730){var _0x3e6a4e=fs[_0x72d3('0x5f')](path[_0x72d3('0x52')](config[_0x72d3('0x53')],_0x72d3('0x54')),_0x72d3('0x55'));var _0x79f8c=ejs[_0x72d3('0x56')](_0x3e6a4e,{'networks':_0x5d5730||[]});fs[_0x72d3('0x57')](util[_0x72d3('0x58')](_0x72d3('0x59'),_0x3490bd[_0x72d3('0x46')][_0x72d3('0x5a')]()),_0x79f8c);return respondWithRpcPromise(_0x72d3('0x5b'),_0x72d3('0x2d'),{'module':_0x72d3('0x5c')});}})[_0x72d3('0x4a')](handleError(_0x3c5b66,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 255f1a4..88b1efc 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 _0x8a30=['request-promise','./network.attributes','exports','define','network','lodash','util','../../config/logger','api'];(function(_0x113787,_0x48222e){var _0x4ff086=function(_0x32fc61){while(--_0x32fc61){_0x113787['push'](_0x113787['shift']());}};_0x4ff086(++_0x48222e);}(_0x8a30,0x1e2));var _0x08a3=function(_0x2d8527,_0x329df2){_0x2d8527=_0x2d8527-0x0;var _0x35c05a=_0x8a30[_0x2d8527];return _0x35c05a;};'use strict';var _=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var logger=require(_0x08a3('0x2'))(_0x08a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x08a3('0x4'));var attributes=require(_0x08a3('0x5'));module[_0x08a3('0x6')]=function(_0x141ca6,_0x16e40d){return _0x141ca6[_0x08a3('0x7')]('Network',attributes,{'tableName':_0x08a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f6=['api','moment','request-promise','./network.attributes','Network','network','lodash','util','../../config/logger'];(function(_0x82047b,_0x13d66a){var _0x34b5db=function(_0x3503c7){while(--_0x3503c7){_0x82047b['push'](_0x82047b['shift']());}};_0x34b5db(++_0x13d66a);}(_0xf0f6,0xde));var _0x6f0f=function(_0x28db79,_0x2659e1){_0x28db79=_0x28db79-0x0;var _0x1453ca=_0xf0f6[_0x28db79];return _0x1453ca;};'use strict';var _=require(_0x6f0f('0x0'));var util=require(_0x6f0f('0x1'));var logger=require(_0x6f0f('0x2'))(_0x6f0f('0x3'));var moment=require(_0x6f0f('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f0f('0x5'));var attributes=require(_0x6f0f('0x6'));module['exports']=function(_0x1b746d,_0x424594){return _0x1b746d['define'](_0x6f0f('0x7'),attributes,{'tableName':_0x6f0f('0x8'),'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 68ce02e..7c4989c 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x808154,_0xc5a5ed){var _0x128ab6=function(_0x4d4f2e){while(--_0x4d4f2e){_0x808154['push'](_0x808154['shift']());}};_0x128ab6(++_0xc5a5ed);}(_0x2675,0x75));var _0x5267=function(_0x399c18,_0x29f499){_0x399c18=_0x399c18-0x0;var _0x4c2d69=_0x2675[_0x399c18];return _0x4c2d69;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x814b=['info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\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(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x814b,0x1a2));var _0xb814=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x814b[_0x4fc421];return _0x8c6d63;};'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')]('Network,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index cfb0f43..ec58421 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 _0x9842=['addApplications','send','put','update','delete','destroy','removeDispositions','exports','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify'];(function(_0x521e29,_0x4ddc71){var _0x509460=function(_0x1e3738){while(--_0x1e3738){_0x521e29['push'](_0x521e29['shift']());}};_0x509460(++_0x4ddc71);}(_0x9842,0x6b));var _0x2984=function(_0x364758,_0x521639){_0x364758=_0x364758-0x0;var _0x243e21=_0x9842[_0x364758];return _0x243e21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2984('0x0'));var timeout=require(_0x2984('0x1'));var express=require(_0x2984('0x2'));var router=express[_0x2984('0x3')]();var auth=require(_0x2984('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x2984('0x5')]('/',auth[_0x2984('0x6')](),controller[_0x2984('0x7')]);router['get'](_0x2984('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2984('0x9'),auth[_0x2984('0x6')](),controller[_0x2984('0xa')]);router[_0x2984('0x5')]('/:id/dispositions',auth[_0x2984('0x6')](),controller[_0x2984('0xb')]);router['get'](_0x2984('0xc'),auth[_0x2984('0x6')](),controller[_0x2984('0xd')]);router[_0x2984('0x5')](_0x2984('0xe'),auth[_0x2984('0x6')](),controller[_0x2984('0xf')]);router[_0x2984('0x5')]('/:id/interactions',auth[_0x2984('0x6')](),controller[_0x2984('0x10')]);router[_0x2984('0x5')](_0x2984('0x11'),auth[_0x2984('0x6')](),controller[_0x2984('0x12')]);router[_0x2984('0x13')]('/',auth[_0x2984('0x6')](),controller[_0x2984('0x14')]);router[_0x2984('0x13')]('/:id/dispositions',auth[_0x2984('0x6')](),controller[_0x2984('0x15')]);router[_0x2984('0x13')](_0x2984('0xc'),auth[_0x2984('0x6')](),controller[_0x2984('0x16')]);router[_0x2984('0x13')](_0x2984('0x17'),controller[_0x2984('0x18')]);router[_0x2984('0x13')](_0x2984('0xe'),auth[_0x2984('0x6')](),controller[_0x2984('0x19')]);router[_0x2984('0x13')](_0x2984('0x11'),auth[_0x2984('0x6')](),controller['addAgents']);router['post']('/:id/send',auth[_0x2984('0x6')](),controller[_0x2984('0x1a')]);router[_0x2984('0x1b')](_0x2984('0x9'),auth[_0x2984('0x6')](),controller[_0x2984('0x1c')]);router[_0x2984('0x1d')](_0x2984('0x9'),auth[_0x2984('0x6')](),controller[_0x2984('0x1e')]);router[_0x2984('0x1d')]('/:id/dispositions',auth[_0x2984('0x6')](),controller[_0x2984('0x1f')]);router['delete'](_0x2984('0xc'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x2984('0x11'),auth[_0x2984('0x6')](),controller['removeAgents']);module[_0x2984('0x20')]=router; \ No newline at end of file +var _0xf964=['addDisposition','/:id/notify','notify','addApplications','/:id/users','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create'];(function(_0x3a0eea,_0x5828e7){var _0xbef3d3=function(_0x4b3951){while(--_0x4b3951){_0x3a0eea['push'](_0x3a0eea['shift']());}};_0xbef3d3(++_0x5828e7);}(_0xf964,0xd7));var _0x4f96=function(_0xdbc5d8,_0x51a947){_0xdbc5d8=_0xdbc5d8-0x0;var _0x2e688e=_0xf964[_0xdbc5d8];return _0x2e688e;};'use strict';var multer=require(_0x4f96('0x0'));var util=require(_0x4f96('0x1'));var path=require(_0x4f96('0x2'));var timeout=require(_0x4f96('0x3'));var express=require(_0x4f96('0x4'));var router=express[_0x4f96('0x5')]();var auth=require(_0x4f96('0x6'));var interaction=require(_0x4f96('0x7'));var config=require('../../config/environment');var controller=require(_0x4f96('0x8'));router[_0x4f96('0x9')]('/',auth[_0x4f96('0xa')](),controller[_0x4f96('0xb')]);router['get'](_0x4f96('0xc'),auth['isAuthenticated'](),controller[_0x4f96('0xd')]);router[_0x4f96('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4f96('0xe')]);router[_0x4f96('0x9')](_0x4f96('0xf'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x10')]);router['get'](_0x4f96('0x11'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x12')]);router[_0x4f96('0x9')](_0x4f96('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0x4f96('0x9')](_0x4f96('0x14'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x15')]);router[_0x4f96('0x9')]('/:id/users',auth[_0x4f96('0xa')](),controller[_0x4f96('0x16')]);router[_0x4f96('0x17')]('/',auth[_0x4f96('0xa')](),controller[_0x4f96('0x18')]);router[_0x4f96('0x17')](_0x4f96('0xf'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x19')]);router[_0x4f96('0x17')]('/:id/canned_answers',auth[_0x4f96('0xa')](),controller['addAnswer']);router['post'](_0x4f96('0x1a'),controller[_0x4f96('0x1b')]);router['post'](_0x4f96('0x13'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x1c')]);router[_0x4f96('0x17')](_0x4f96('0x1d'),auth['isAuthenticated'](),controller[_0x4f96('0x1e')]);router[_0x4f96('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0x4f96('0x1f')]);router[_0x4f96('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x4f96('0x21')]);router[_0x4f96('0x22')]('/:id',auth[_0x4f96('0xa')](),controller[_0x4f96('0x23')]);router[_0x4f96('0x22')](_0x4f96('0xf'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x24')]);router[_0x4f96('0x22')](_0x4f96('0x11'),auth[_0x4f96('0xa')](),controller[_0x4f96('0x25')]);router[_0x4f96('0x22')](_0x4f96('0x1d'),auth['isAuthenticated'](),controller[_0x4f96('0x26')]);module[_0x4f96('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 99b7ae5..b409586 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 _0x5699=['BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','INTEGER'];(function(_0x3998ff,_0x58f511){var _0xfd997d=function(_0x114dc6){while(--_0x114dc6){_0x3998ff['push'](_0x3998ff['shift']());}};_0xfd997d(++_0x58f511);}(_0x5699,0x68));var _0x9569=function(_0x2a34d1,_0x1a74c1){_0x2a34d1=_0x2a34d1-0x0;var _0x16badd=_0x5699[_0x2a34d1];return _0x16badd;};'use strict';var Sequelize=require(_0x9569('0x0'));var rs=require(_0x9569('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9569('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9569('0x3')],'defaultValue':function(){return rs[_0x9569('0x4')]();}},'replyUri':{'type':Sequelize[_0x9569('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9569('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9569('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9569('0x3')]},'queueTransfer':{'type':Sequelize[_0x9569('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9569('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9569('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9569('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9569('0x7'),'set':function(_0x23ba84){if(!_0x23ba84)this['setDataValue'](_0x9569('0x8'),null);this['setDataValue'](_0x9569('0x9'),_0x23ba84);}}}; \ No newline at end of file +var _0xb9c0=['randomstring','exports','name','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize'];(function(_0x360641,_0x3cf8be){var _0x25056b=function(_0x1472ef){while(--_0x1472ef){_0x360641['push'](_0x360641['shift']());}};_0x25056b(++_0x3cf8be);}(_0xb9c0,0xb3));var _0x0b9c=function(_0x14dea0,_0x145172){_0x14dea0=_0x14dea0-0x0;var _0x28f00b=_0xb9c0[_0x14dea0];return _0x28f00b;};'use strict';var Sequelize=require(_0x0b9c('0x0'));var rs=require(_0x0b9c('0x1'));module[_0x0b9c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0b9c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0b9c('0x4')]},'token':{'type':Sequelize[_0x0b9c('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0b9c('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0b9c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0b9c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0b9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0b9c('0x4')]},'queueTransfer':{'type':Sequelize[_0x0b9c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0b9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0b9c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0b9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0b9c('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x0b9c('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0b9c('0x9'),'set':function(_0x2ccb8c){if(!_0x2ccb8c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x0b9c('0xa')](_0x0b9c('0xb'),_0x2ccb8c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 70a8883..b22a63e 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 _0x9d92=['messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','priority','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','push','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','status','json','count','set','Content-Range','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','OpenchannelAccount','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','offset','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','addDisposition','findOne','Disposition','rawAttributes','nolimit','order','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','asc','from','CmContact','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread'];(function(_0x27b07e,_0x271b0f){var _0x7175db=function(_0x19ef19){while(--_0x19ef19){_0x27b07e['push'](_0x27b07e['shift']());}};_0x7175db(++_0x271b0f);}(_0x9d92,0xdf));var _0x29d9=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x9d92[_0x2af160];return _0x439d67;};'use strict';var pdf=require(_0x29d9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x29d9('0x1'));var jsonpatch=require(_0x29d9('0x2'));var rp=require('request-promise');var moment=require(_0x29d9('0x3'));var BPromise=require(_0x29d9('0x4'));var Mustache=require(_0x29d9('0x5'));var util=require(_0x29d9('0x6'));var path=require(_0x29d9('0x7'));var sox=require(_0x29d9('0x8'));var csv=require(_0x29d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x29d9('0xa'));var squel=require(_0x29d9('0xb'));var crypto=require(_0x29d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29d9('0xd'));var toCsv=require(_0x29d9('0x9'));var querystring=require(_0x29d9('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x29d9('0xf'));var logger=require(_0x29d9('0x10'))(_0x29d9('0x11'));var utils=require('../../config/utils');var config=require(_0x29d9('0x12'));var db=require(_0x29d9('0x13'))['db'];config[_0x29d9('0x14')]=_[_0x29d9('0x15')](config['redis'],{'host':_0x29d9('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x29d9('0x17')](socket);var jayson=require(_0x29d9('0x18'));var client=jayson[_0x29d9('0x19')][_0x29d9('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x29d9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2a2603,_0xa5b923,_0x446a80,_0x2e6290){return new BPromise(function(_0x36f1f7,_0x3f382e){var _0x327c5f=_0x2e6290||client;return _0x327c5f[_0x29d9('0x1b')](_0x2a2603,_0x446a80)[_0x29d9('0x1c')](function(_0x2b4f42){logger['info'](_0x29d9('0x1d'),_0xa5b923,'request\x20sent');logger['debug'](_0x29d9('0x1e'),_0xa5b923,_0x29d9('0x1f'),JSON['stringify'](_0x2b4f42));if(_0x2b4f42[_0x29d9('0x20')]){if(_0x2b4f42[_0x29d9('0x20')][_0x29d9('0x21')]===0x1f4){logger[_0x29d9('0x20')](_0x29d9('0x1d'),_0xa5b923,_0x2b4f42[_0x29d9('0x20')][_0x29d9('0x22')]);return _0x3f382e(_0x2b4f42['error'][_0x29d9('0x22')]);}logger[_0x29d9('0x20')](_0x29d9('0x1d'),_0xa5b923,_0x2b4f42[_0x29d9('0x20')]['message']);return _0x36f1f7(_0x2b4f42['error'][_0x29d9('0x22')]);}else{logger[_0x29d9('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0xa5b923,'request\x20sent');_0x36f1f7(_0x2b4f42['result'][_0x29d9('0x22')]);}})[_0x29d9('0x24')](function(_0x302a7b){logger['error'](_0x29d9('0x1d'),_0xa5b923,_0x302a7b);_0x3f382e(_0x302a7b);});});}function respondWithStatusCode(_0x10b1e8,_0xb564c2){_0xb564c2=_0xb564c2||0xcc;return function(_0x1d8903){if(_0x1d8903){return _0x10b1e8['sendStatus'](_0xb564c2);}return _0x10b1e8[_0x29d9('0x25')](_0xb564c2)['end']();};}function respondWithResult(_0x5e664f,_0x4334a8){_0x4334a8=_0x4334a8||0xc8;return function(_0x1dbe5a){if(_0x1dbe5a){return _0x5e664f['status'](_0x4334a8)[_0x29d9('0x26')](_0x1dbe5a);}};}function respondWithFilteredResult(_0x5c5de5,_0x383b69){return function(_0x29a034){if(_0x29a034){var _0x3c10da=_0x29a034[_0x29d9('0x27')],_0x30d4e7=_0x383b69['offset'],_0x30212d=_0x383b69['offset']+_0x383b69['limit'],_0x286b72;if(_0x30212d>=_0x3c10da){_0x30212d=_0x3c10da;_0x286b72=0xc8;}else{_0x286b72=0xce;}_0x5c5de5[_0x29d9('0x25')](_0x286b72);return _0x5c5de5[_0x29d9('0x28')](_0x29d9('0x29'),_0x30d4e7+'-'+_0x30212d+'/'+_0x3c10da)[_0x29d9('0x26')](_0x29a034);}return null;};}function patchUpdates(_0x38003b){return function(_0x165a5b){try{jsonpatch['apply'](_0x165a5b,_0x38003b,!![]);}catch(_0x2c0b5d){return BPromise['reject'](_0x2c0b5d);}return _0x165a5b[_0x29d9('0x2a')]();};}function saveUpdates(_0x168f26,_0x1a1676){return function(_0x4b8ca3){if(_0x4b8ca3){return _0x4b8ca3['update'](_0x168f26)['then'](function(_0x576c86){return _0x576c86;});}return null;};}function removeEntity(_0x54bdbe,_0x18265d){return function(_0x36d731){if(_0x36d731){return _0x36d731[_0x29d9('0x2b')]()['then'](function(){var _0x1bec86=_0x36d731[_0x29d9('0x2c')]({'plain':!![]});var _0x3ff48d=_0x29d9('0x2d');return db[_0x29d9('0x2e')][_0x29d9('0x2b')]({'where':{'type':_0x3ff48d,'resourceId':_0x1bec86['id']}})['then'](function(){return _0x36d731;});})[_0x29d9('0x1c')](function(){_0x54bdbe[_0x29d9('0x25')](0xcc)[_0x29d9('0x2f')]();});}};}function handleEntityNotFound(_0xa51c27,_0xe170d9){return function(_0x51e6a9){if(!_0x51e6a9){_0xa51c27[_0x29d9('0x30')](0x194);}return _0x51e6a9;};}function handleError(_0x1b0999,_0x753805){_0x753805=_0x753805||0x1f4;return function(_0x2e5759){logger[_0x29d9('0x20')](_0x2e5759[_0x29d9('0x31')]);if(_0x2e5759[_0x29d9('0x32')]){delete _0x2e5759['name'];}_0x1b0999[_0x29d9('0x25')](_0x753805)[_0x29d9('0x33')](_0x2e5759);};}exports[_0x29d9('0x34')]=function(_0x28c36d,_0x332554){var _0x2d534c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x53627f={},_0x41e89a={'count':0x0,'rows':[]};var _0x4c2157=db[_0x29d9('0x35')]['rawAttributes'];_0x53627f[_0x29d9('0x36')]=_[_0x29d9('0x37')](_0x4c2157);_0x53627f[_0x29d9('0x38')]=_[_0x29d9('0x37')](_0x28c36d[_0x29d9('0x38')]);_0x53627f[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x53627f[_0x29d9('0x36')],_0x53627f[_0x29d9('0x38')]);_0x2d534c[_0x29d9('0x3b')]=_[_0x29d9('0x3a')](_0x53627f['model'],qs[_0x29d9('0x3c')](_0x28c36d[_0x29d9('0x38')]['fields']));_0x2d534c['attributes']=_0x2d534c['attributes'][_0x29d9('0x3d')]?_0x2d534c[_0x29d9('0x3b')]:_0x53627f[_0x29d9('0x36')];if(!_0x28c36d[_0x29d9('0x38')][_0x29d9('0x3e')]('nolimit')){_0x2d534c[_0x29d9('0x3f')]=qs[_0x29d9('0x3f')](_0x28c36d[_0x29d9('0x38')]['limit']);_0x2d534c[_0x29d9('0x40')]=qs[_0x29d9('0x40')](_0x28c36d[_0x29d9('0x38')][_0x29d9('0x40')]);}_0x2d534c['order']=qs[_0x29d9('0x41')](_0x28c36d[_0x29d9('0x38')][_0x29d9('0x41')]);_0x2d534c[_0x29d9('0x42')]=qs['filters'](_[_0x29d9('0x43')](_0x28c36d['query'],_0x53627f['filters']));if(_0x28c36d[_0x29d9('0x38')][_0x29d9('0x44')]){_0x2d534c[_0x29d9('0x42')]=_[_0x29d9('0x45')](_0x2d534c[_0x29d9('0x42')],{'$or':_[_0x29d9('0x46')](_0x4c2157,function(_0x32c296){if(_0x32c296[_0x29d9('0x47')]['key']!==_0x29d9('0x48')){var _0x53b007={};_0x53b007[_0x32c296['field']]={'$like':'%'+_0x28c36d[_0x29d9('0x38')]['filter']+'%'};return _0x53b007;}})});}_0x2d534c=_[_0x29d9('0x45')]({},_0x2d534c,_0x28c36d[_0x29d9('0x49')]);var _0x69a39f={'where':_0x2d534c[_0x29d9('0x42')]};return db[_0x29d9('0x35')]['count'](_0x69a39f)['then'](function(_0x26d1a3){_0x41e89a[_0x29d9('0x27')]=_0x26d1a3;if(_0x28c36d[_0x29d9('0x38')][_0x29d9('0x4a')]){_0x2d534c[_0x29d9('0x4b')]=[{'all':!![]}];}return db[_0x29d9('0x35')][_0x29d9('0x4c')](_0x2d534c);})[_0x29d9('0x1c')](function(_0xa4be4a){_0x41e89a[_0x29d9('0x4d')]=_0xa4be4a;return _0x41e89a;})[_0x29d9('0x1c')](respondWithFilteredResult(_0x332554,_0x2d534c))['catch'](handleError(_0x332554,null));};exports[_0x29d9('0x4e')]=function(_0x2e0623,_0x16f0fa){var _0x2a2cc3={'raw':![],'where':{'id':_0x2e0623[_0x29d9('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x29d9('0x50')}]},_0x44bafa={};_0x44bafa['model']=_[_0x29d9('0x37')](db[_0x29d9('0x35')]['rawAttributes']);_0x44bafa[_0x29d9('0x38')]=_['keys'](_0x2e0623[_0x29d9('0x38')]);_0x44bafa[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x44bafa[_0x29d9('0x36')],_0x44bafa['query']);_0x2a2cc3[_0x29d9('0x3b')]=_['intersection'](_0x44bafa['model'],qs[_0x29d9('0x3c')](_0x2e0623[_0x29d9('0x38')][_0x29d9('0x3c')]));_0x2a2cc3[_0x29d9('0x3b')]=_0x2a2cc3[_0x29d9('0x3b')][_0x29d9('0x3d')]?_0x2a2cc3[_0x29d9('0x3b')]:_0x44bafa[_0x29d9('0x36')];if(_0x2e0623[_0x29d9('0x38')][_0x29d9('0x4a')]){_0x2a2cc3['include']=[{'all':!![]}];}_0x2a2cc3=_[_0x29d9('0x45')]({},_0x2a2cc3,_0x2e0623[_0x29d9('0x49')]);return db[_0x29d9('0x35')][_0x29d9('0x51')](_0x2a2cc3)['then'](handleEntityNotFound(_0x16f0fa,null))[_0x29d9('0x1c')](respondWithResult(_0x16f0fa,null))['catch'](handleError(_0x16f0fa,null));};exports['create']=function(_0x4ce50f,_0x5c7f6b){return db[_0x29d9('0x35')][_0x29d9('0x52')](_0x4ce50f[_0x29d9('0x53')],{})[_0x29d9('0x1c')](function(_0x28bf93){var _0xa92dfb=_0x4ce50f[_0x29d9('0x54')]['get']({'plain':!![]});if(!_0xa92dfb)throw new Error(_0x29d9('0x55'));if(_0xa92dfb[_0x29d9('0x56')]===_0x29d9('0x54')){var _0x14cd83=_0x28bf93[_0x29d9('0x2c')]({'plain':!![]});var _0x21a3fd=_0x29d9('0x2d');return db['UserProfileSection'][_0x29d9('0x51')]({'where':{'name':_0x21a3fd,'userProfileId':_0xa92dfb[_0x29d9('0x57')]},'raw':!![]})[_0x29d9('0x1c')](function(_0x8b5df3){if(_0x8b5df3&&_0x8b5df3[_0x29d9('0x58')]===0x0){return db[_0x29d9('0x2e')][_0x29d9('0x52')]({'name':_0x14cd83[_0x29d9('0x32')],'resourceId':_0x14cd83['id'],'type':_0x8b5df3[_0x29d9('0x32')],'sectionId':_0x8b5df3['id']},{})[_0x29d9('0x1c')](function(){return _0x28bf93;});}else{return _0x28bf93;}})[_0x29d9('0x24')](function(_0x5c6e42){logger[_0x29d9('0x20')](_0x29d9('0x59'),_0x5c6e42);throw _0x5c6e42;});}return _0x28bf93;})['then'](respondWithResult(_0x5c7f6b,0xc9))[_0x29d9('0x24')](handleError(_0x5c7f6b,null));};exports[_0x29d9('0x5a')]=function(_0x2d32b2,_0x3948aa){if(_0x2d32b2[_0x29d9('0x53')]['id']){delete _0x2d32b2[_0x29d9('0x53')]['id'];}return db['OpenchannelAccount'][_0x29d9('0x51')]({'where':{'id':_0x2d32b2['params']['id']},'include':[{'model':db[_0x29d9('0x5b')],'as':_0x29d9('0x50')}]})[_0x29d9('0x1c')](handleEntityNotFound(_0x3948aa,null))[_0x29d9('0x1c')](saveUpdates(_0x2d32b2[_0x29d9('0x53')],null))[_0x29d9('0x1c')](respondWithResult(_0x3948aa,null))[_0x29d9('0x24')](handleError(_0x3948aa,null));};exports['destroy']=function(_0x3a829f,_0x3e6c68){return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x3a829f['params']['id']}})['then'](handleEntityNotFound(_0x3e6c68,null))[_0x29d9('0x1c')](removeEntity(_0x3e6c68,null))[_0x29d9('0x24')](handleError(_0x3e6c68,null));};exports[_0x29d9('0x5c')]=function(_0x421e3a,_0x14bdb4){return db[_0x29d9('0x35')][_0x29d9('0x5c')]()[_0x29d9('0x1c')](respondWithResult(_0x14bdb4,null))['catch'](handleError(_0x14bdb4,null));};exports[_0x29d9('0x5d')]=function(_0x1e51fe,_0x12ef33,_0x2c37c2){if(_0x1e51fe['body']['id']){delete _0x1e51fe[_0x29d9('0x53')]['id'];}return db['OpenchannelAccount'][_0x29d9('0x51')]({'where':{'id':_0x1e51fe['params']['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x12ef33,null))[_0x29d9('0x1c')](function(_0x418dc0){if(_0x418dc0){_0x1e51fe[_0x29d9('0x53')]['OpnechannelAccountId']=_0x418dc0['id'];return db['Disposition'][_0x29d9('0x52')](_0x1e51fe[_0x29d9('0x53')]);}})[_0x29d9('0x1c')](respondWithResult(_0x12ef33,null))[_0x29d9('0x24')](handleError(_0x12ef33,null));};exports['getDispositions']=function(_0x135e31,_0x4c64a6,_0x1cfae6){var _0x49c30b={'raw':![],'where':{}};var _0x122b07={};var _0x4ee3e4={'count':0x0,'rows':[]};return db[_0x29d9('0x35')][_0x29d9('0x5e')]({'where':{'id':_0x135e31[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x4c64a6,null))[_0x29d9('0x1c')](function(_0x5cafd4){if(_0x5cafd4){_0x122b07[_0x29d9('0x36')]=_[_0x29d9('0x37')](db[_0x29d9('0x5f')][_0x29d9('0x60')]);_0x122b07[_0x29d9('0x38')]=_[_0x29d9('0x37')](_0x135e31[_0x29d9('0x38')]);_0x122b07[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x122b07[_0x29d9('0x36')],_0x122b07['query']);_0x49c30b['attributes']=_['intersection'](_0x122b07[_0x29d9('0x36')],qs[_0x29d9('0x3c')](_0x135e31[_0x29d9('0x38')]['fields']));_0x49c30b['attributes']=_0x49c30b[_0x29d9('0x3b')][_0x29d9('0x3d')]?_0x49c30b['attributes']:_0x122b07['model'];if(!_0x135e31['query'][_0x29d9('0x3e')](_0x29d9('0x61'))){_0x49c30b['limit']=qs[_0x29d9('0x3f')](_0x135e31[_0x29d9('0x38')][_0x29d9('0x3f')]);_0x49c30b['offset']=qs[_0x29d9('0x40')](_0x135e31[_0x29d9('0x38')][_0x29d9('0x40')]);}_0x49c30b[_0x29d9('0x62')]=qs[_0x29d9('0x41')](_0x135e31[_0x29d9('0x38')][_0x29d9('0x41')]);_0x49c30b[_0x29d9('0x42')]=qs['filters'](_[_0x29d9('0x43')](_0x135e31[_0x29d9('0x38')],_0x122b07[_0x29d9('0x39')]));_0x49c30b[_0x29d9('0x42')][_0x29d9('0x63')]=_0x5cafd4['id'];if(_0x135e31[_0x29d9('0x38')][_0x29d9('0x44')]){_0x49c30b['where']=_['merge'](_0x49c30b[_0x29d9('0x42')],{'$or':_[_0x29d9('0x46')](_0x49c30b[_0x29d9('0x3b')],function(_0x1e6430){var _0x42ae0c={};_0x42ae0c[_0x1e6430]={'$like':'%'+_0x135e31[_0x29d9('0x38')]['filter']+'%'};return _0x42ae0c;})});}_0x49c30b=_['merge']({},_0x49c30b,_0x135e31[_0x29d9('0x49')]);return db['Disposition'][_0x29d9('0x27')]({'where':_0x49c30b[_0x29d9('0x42')]})[_0x29d9('0x1c')](function(_0x2c2125){_0x4ee3e4['count']=_0x2c2125;if(_0x135e31[_0x29d9('0x38')][_0x29d9('0x4a')]){_0x49c30b['include']=[{'all':!![]}];}return db[_0x29d9('0x5f')][_0x29d9('0x4c')](_0x49c30b);})[_0x29d9('0x1c')](function(_0x4ee5d1){_0x4ee3e4[_0x29d9('0x4d')]=_0x4ee5d1;return _0x4ee3e4;});}})[_0x29d9('0x1c')](respondWithFilteredResult(_0x4c64a6,_0x49c30b))[_0x29d9('0x24')](handleError(_0x4c64a6,null));};exports[_0x29d9('0x64')]=function(_0x3d673b,_0xdf87be,_0x26c43d){var _0x2ed9a0;return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x3d673b['params']['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0xdf87be,null))[_0x29d9('0x1c')](function(_0x100942){if(_0x100942){return _0x100942['removeDispositions'](_0x3d673b[_0x29d9('0x38')][_0x29d9('0x65')]);}})['then'](respondWithStatusCode(_0xdf87be,null))['catch'](handleError(_0xdf87be,null));};exports[_0x29d9('0x66')]=function(_0x2c3bfa,_0x473b06,_0x538972){if(_0x2c3bfa[_0x29d9('0x53')]['id']){delete _0x2c3bfa[_0x29d9('0x53')]['id'];}return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x2c3bfa[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x473b06,null))[_0x29d9('0x1c')](function(_0x575f52){if(_0x575f52){_0x2c3bfa['body'][_0x29d9('0x63')]=_0x575f52['id'];return db[_0x29d9('0x67')]['create'](_0x2c3bfa['body']);}})[_0x29d9('0x1c')](respondWithResult(_0x473b06,null))[_0x29d9('0x24')](handleError(_0x473b06,null));};exports[_0x29d9('0x68')]=function(_0x396dc2,_0x144aaf,_0x6375b7){var _0x302ca7={'raw':![],'where':{}};var _0x4fa9ac={};var _0x1f4683={'count':0x0,'rows':[]};return db[_0x29d9('0x35')]['findOne']({'where':{'id':_0x396dc2['params']['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x144aaf,null))[_0x29d9('0x1c')](function(_0x55dfaa){if(_0x55dfaa){_0x4fa9ac['model']=_['keys'](db[_0x29d9('0x67')]['rawAttributes']);_0x4fa9ac['query']=_[_0x29d9('0x37')](_0x396dc2[_0x29d9('0x38')]);_0x4fa9ac[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x4fa9ac['model'],_0x4fa9ac['query']);_0x302ca7['attributes']=_[_0x29d9('0x3a')](_0x4fa9ac[_0x29d9('0x36')],qs['fields'](_0x396dc2['query'][_0x29d9('0x3c')]));_0x302ca7[_0x29d9('0x3b')]=_0x302ca7['attributes'][_0x29d9('0x3d')]?_0x302ca7[_0x29d9('0x3b')]:_0x4fa9ac[_0x29d9('0x36')];if(!_0x396dc2['query'][_0x29d9('0x3e')](_0x29d9('0x61'))){_0x302ca7[_0x29d9('0x3f')]=qs[_0x29d9('0x3f')](_0x396dc2[_0x29d9('0x38')][_0x29d9('0x3f')]);_0x302ca7['offset']=qs['offset'](_0x396dc2['query'][_0x29d9('0x40')]);}_0x302ca7[_0x29d9('0x62')]=qs['sort'](_0x396dc2[_0x29d9('0x38')][_0x29d9('0x41')]);_0x302ca7[_0x29d9('0x42')]=qs[_0x29d9('0x39')](_[_0x29d9('0x43')](_0x396dc2[_0x29d9('0x38')],_0x4fa9ac['filters']));_0x302ca7[_0x29d9('0x42')][_0x29d9('0x63')]=_0x55dfaa['id'];if(_0x396dc2[_0x29d9('0x38')]['filter']){_0x302ca7[_0x29d9('0x42')]=_['merge'](_0x302ca7[_0x29d9('0x42')],{'$or':_[_0x29d9('0x46')](_0x302ca7[_0x29d9('0x3b')],function(_0x4e4e7){var _0x57be10={};_0x57be10[_0x4e4e7]={'$like':'%'+_0x396dc2[_0x29d9('0x38')][_0x29d9('0x44')]+'%'};return _0x57be10;})});}_0x302ca7=_[_0x29d9('0x45')]({},_0x302ca7,_0x396dc2['options']);return db[_0x29d9('0x67')][_0x29d9('0x27')]({'where':_0x302ca7['where']})[_0x29d9('0x1c')](function(_0x1d2081){_0x1f4683[_0x29d9('0x27')]=_0x1d2081;if(_0x396dc2[_0x29d9('0x38')][_0x29d9('0x4a')]){_0x302ca7['include']=[{'all':!![]}];}return db[_0x29d9('0x67')][_0x29d9('0x4c')](_0x302ca7);})[_0x29d9('0x1c')](function(_0x432f80){_0x1f4683[_0x29d9('0x4d')]=_0x432f80;return _0x1f4683;});}})['then'](respondWithFilteredResult(_0x144aaf,_0x302ca7))['catch'](handleError(_0x144aaf,null));};exports[_0x29d9('0x69')]=function(_0x2da50a,_0x451f4c,_0x2c98a3){var _0x59e90f;return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x2da50a[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x451f4c,null))[_0x29d9('0x1c')](function(_0x35632e){if(_0x35632e){return _0x35632e[_0x29d9('0x69')](_0x2da50a['query'][_0x29d9('0x65')]);}})[_0x29d9('0x1c')](respondWithStatusCode(_0x451f4c,null))[_0x29d9('0x24')](handleError(_0x451f4c,null));};exports[_0x29d9('0x6a')]=function(_0x39bb35,_0x799000,_0x54f719){var _0x22c062={'body':_0x39bb35['body'],'channel':_0x29d9('0x6b')};var _0xa0698a=[];var _0xbe8101=[];var _0x330170={};var _0x1b0cfc=![];return db['CmContact'][_0x29d9('0x5c')]()[_0x29d9('0x1c')](function(_0x5c8673){if(!_0x5c8673){throw new db['Sequelize'][(_0x29d9('0x6c'))](_0x29d9('0x6d'));}_0xa0698a=_['difference'](_[_0x29d9('0x37')](_0x5c8673),[_0x29d9('0x6e'),_0x29d9('0x6f')]);_0xbe8101=_[_0x29d9('0x70')](_[_0x29d9('0x37')](_0x5c8673),[_0x29d9('0x6e'),'updatedAt',_0x29d9('0x71'),_0x29d9('0x72')]);if(_0x39bb35[_0x29d9('0x53')]['id']){delete _0x39bb35['body']['id'];}if(_[_0x29d9('0x73')](_0x39bb35['body']['from'])){throw new db[(_0x29d9('0x74'))][(_0x29d9('0x6c'))](_0x29d9('0x75'));}if(_['isNil'](_0x39bb35[_0x29d9('0x53')][_0x29d9('0x53')])||_0x39bb35[_0x29d9('0x53')][_0x29d9('0x53')]===''){throw new db['Sequelize'][(_0x29d9('0x6c'))](_0x29d9('0x76'));}if(_[_0x29d9('0x73')](_0x39bb35['body'][_0x29d9('0x77')])){throw new db[(_0x29d9('0x74'))]['ValidationError'](_0x29d9('0x78')+_0xbe8101);}if(!_['includes'](_0xbe8101,_0x39bb35[_0x29d9('0x53')][_0x29d9('0x77')])){throw new db[(_0x29d9('0x74'))][(_0x29d9('0x6c'))](_0x29d9('0x79')+_0xbe8101);}_0x330170[_0x39bb35['body'][_0x29d9('0x77')]]=_0x39bb35[_0x29d9('0x53')]['from'];})[_0x29d9('0x1c')](function(){return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x39bb35[_0x29d9('0x4f')]['id']},'include':[{'model':db[_0x29d9('0x7a')],'as':_0x29d9('0x7b'),'include':[{'model':db['CmContact'],'as':_0x29d9('0x7c'),'where':_0x330170,'limit':0x1,'order':[[_0x29d9('0x6f'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x29d9('0x7d')}]});})[_0x29d9('0x1c')](handleEntityNotFound(_0x799000,null))['then'](function(_0x536fc0){if(_0x536fc0&&_0x536fc0[_0x29d9('0x7b')]){_0x22c062[_0x29d9('0x7e')]=_0x536fc0;_0x22c062[_0x29d9('0x7f')]=_0x536fc0[_0x29d9('0x7d')];_0x22c062[_0x29d9('0x80')]=_0x536fc0['List'];_0x22c062[_0x29d9('0x7f')]=_[_0x29d9('0x81')](_0x22c062['applications'],['priority'],[_0x29d9('0x82')]);if(_0x22c062[_0x29d9('0x7e')][_0x29d9('0x7d')]){delete _0x22c062['account'][_0x29d9('0x7d')];}if(_0x22c062['account'][_0x29d9('0x7b')]&&_0x22c062[_0x29d9('0x7e')][_0x29d9('0x7b')][_0x29d9('0x7c')]['length']){return _0x22c062[_0x29d9('0x7e')]['List']['Contacts'][0x0];}var _0x5b3ed8=_[_0x29d9('0x15')](_0x39bb35[_0x29d9('0x53')],{'firstName':_0x39bb35['body'][_0x29d9('0x83')],'ListId':_0x536fc0[_0x29d9('0x72')]});_0x5b3ed8[_0x39bb35[_0x29d9('0x53')]['mapKey']]=_0x39bb35[_0x29d9('0x53')]['from'];return db[_0x29d9('0x84')][_0x29d9('0x52')](_0x5b3ed8,{'fields':_0xa0698a,'raw':!![]});}})[_0x29d9('0x1c')](handleEntityNotFound(_0x799000,null))['then'](function(_0x3852d){_0x22c062[_0x29d9('0x85')]=_0x3852d;if(_0x3852d){var _0x59d2cd={'ContactId':_0x3852d['id'],'OpenchannelAccountId':_0x39bb35[_0x29d9('0x4f')]['id'],'from':(_0x3852d[_0x29d9('0x86')]||'')+'\x20'+(_0x3852d['lastName']||'')};var _0x10b45c={'OpenchannelAccountId':_0x39bb35[_0x29d9('0x4f')]['id'],'closed':![]};if(_0x39bb35[_0x29d9('0x53')]['threadId']){_0x10b45c['threadId']=_0x39bb35[_0x29d9('0x53')][_0x29d9('0x87')];return db[_0x29d9('0x88')][_0x29d9('0x51')]({'where':_0x10b45c})[_0x29d9('0x1c')](function(_0xd1c7bd){if(_0xd1c7bd){return[_0xd1c7bd,![]];}_0x59d2cd[_0x29d9('0x87')]=_0x39bb35[_0x29d9('0x53')][_0x29d9('0x87')];_0x59d2cd[_0x29d9('0x89')]=_0x39bb35[_0x29d9('0x53')][_0x29d9('0x89')];return db[_0x29d9('0x88')]['create'](_0x59d2cd)['then'](function(_0x47042f){return[_0x47042f,!![]];});});}else{_0x10b45c['threadId']=null;}_0x10b45c['ContactId']=_0x3852d['id'];return db[_0x29d9('0x88')]['find']({'where':_0x10b45c})['then'](function(_0x44fb63){if(_0x44fb63){return[_0x44fb63,![]];}return db[_0x29d9('0x88')][_0x29d9('0x52')](_0x59d2cd)[_0x29d9('0x1c')](function(_0x250f06){return[_0x250f06,!![]];});});}})[_0x29d9('0x8a')](function(_0x687d9a,_0x5a4d25){if(_0x687d9a){_0x1b0cfc=_0x5a4d25;if(!_0x5a4d25){var _0x56d8ae={'from':(_0x22c062[_0x29d9('0x85')]['firstName']||'')+'\x20'+(_0x22c062[_0x29d9('0x85')]['lastName']||'')};if(_0x39bb35[_0x29d9('0x53')][_0x29d9('0x87')]&&_0x39bb35[_0x29d9('0x53')][_0x29d9('0x8b')]&&_0x39bb35[_0x29d9('0x53')][_0x29d9('0x87')]!=_0x39bb35[_0x29d9('0x53')][_0x29d9('0x8b')]){_0x56d8ae['threadId']=_0x39bb35['body'][_0x29d9('0x8b')];}return _0x687d9a[_0x29d9('0x5a')](_0x56d8ae);}else{return _0x687d9a;}}})['then'](function(_0x2cdbbf){_0x22c062['interaction']=_0x2cdbbf[_0x29d9('0x2c')]({'plain':!![]});_0x22c062[_0x29d9('0x8c')][_0x29d9('0x8d')]=_0x1b0cfc;if(_0x22c062[_0x29d9('0x8c')]['created']){if(_0x22c062['account'][_0x29d9('0x8e')]){_0x22c062['applications']['push']({'id':0x0,'priority':_0x22c062[_0x29d9('0x7f')][_0x29d9('0x3d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x29d9('0x8f')});}}return db[_0x29d9('0x90')][_0x29d9('0x52')]({'body':_0x39bb35[_0x29d9('0x53')][_0x29d9('0x53')],'OpenchannelAccountId':_0x39bb35[_0x29d9('0x4f')]['id'],'OpenchannelInteractionId':_0x2cdbbf['id'],'direction':'in','ContactId':_0x22c062[_0x29d9('0x85')]['id'],'AttachmentId':_0x39bb35[_0x29d9('0x53')][_0x29d9('0x91')]});})[_0x29d9('0x1c')](function(_0x2393a4){_0x22c062[_0x29d9('0x22')]=_0x2393a4;if(_0x22c062[_0x29d9('0x8c')][_0x29d9('0x92')]){return db[_0x29d9('0x93')]['find']({'attributes':['id',_0x29d9('0x32')],'where':{'id':_0x22c062['interaction'][_0x29d9('0x92')]}})[_0x29d9('0x1c')](function(_0x4c4248){if(_0x4c4248){_0x22c062['applications'][_0x29d9('0x94')]({'id':0x0,'priority':0x0,'app':_0x29d9('0x95'),'appdata':_0x4c4248['name']+','+(_0x22c062['account'][_0x29d9('0x96')]||0xa),'interval':'*,*,*,*'});_0x22c062[_0x29d9('0x97')]=![];}return respondWithRpcPromise('Start',_0x29d9('0x98'),_0x22c062);});}return respondWithRpcPromise(_0x29d9('0x99'),'startRouting',_0x22c062);})[_0x29d9('0x1c')](function(_0x3d224d){respondWithRpcPromise(_0x29d9('0x9a'),'EventManager',{'event':_0x29d9('0x6a'),'message':_0x3d224d},client9002);return _0x3d224d;})[_0x29d9('0x1c')](respondWithResult(_0x799000,null))[_0x29d9('0x24')](handleError(_0x799000,null));};exports[_0x29d9('0x9b')]=function(_0x267b5c,_0x1d59d6,_0x50bae8){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x267b5c[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x1d59d6,null))[_0x29d9('0x1c')](function(_0x305f57){if(_0x305f57){return db[_0x29d9('0x9c')][_0x29d9('0x9d')](function(_0x3bb951){return db[_0x29d9('0x9e')][_0x29d9('0x2b')]({'where':{'OpenchannelAccountId':_0x267b5c[_0x29d9('0x4f')]['id']},'transaction':_0x3bb951})[_0x29d9('0x1c')](function(_0x3a34fc){var _0x53c44a=_['map'](_0x267b5c[_0x29d9('0x53')],function(_0x2ea25b){_0x2ea25b['OpenchannelAccountId']=_0x267b5c[_0x29d9('0x4f')]['id'];return _0x2ea25b;});return db[_0x29d9('0x9e')]['bulkCreate'](_0x53c44a,{'transaction':_0x3bb951});});})['then'](function(){return db[_0x29d9('0x9e')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x267b5c[_0x29d9('0x4f')]['id']},'order':_0x29d9('0x9f')});});}})['then'](respondWithResult(_0x1d59d6,null))[_0x29d9('0x24')](handleError(_0x1d59d6,null));};exports[_0x29d9('0xa0')]=function(_0x128dbe,_0x5c3022,_0x355686){var _0x3744f2={};var _0x3b2a95={};var _0x5e16ae;var _0x1ccd93;return db[_0x29d9('0x35')]['findOne']({'where':{'id':_0x128dbe[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x5c3022,null))[_0x29d9('0x1c')](function(_0x17b046){if(_0x17b046){_0x5e16ae=_0x17b046;_0x3b2a95[_0x29d9('0x36')]=_['keys'](db[_0x29d9('0x9e')][_0x29d9('0x60')]);_0x3b2a95['query']=_[_0x29d9('0x37')](_0x128dbe['query']);_0x3b2a95[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x3b2a95[_0x29d9('0x36')],_0x3b2a95[_0x29d9('0x38')]);_0x3744f2[_0x29d9('0x3b')]=_[_0x29d9('0x3a')](_0x3b2a95['model'],qs['fields'](_0x128dbe[_0x29d9('0x38')][_0x29d9('0x3c')]));_0x3744f2[_0x29d9('0x3b')]=_0x3744f2[_0x29d9('0x3b')][_0x29d9('0x3d')]?_0x3744f2['attributes']:_0x3b2a95[_0x29d9('0x36')];_0x3744f2['order']=qs[_0x29d9('0x41')](_0x128dbe[_0x29d9('0x38')][_0x29d9('0x41')]);_0x3744f2[_0x29d9('0x42')]=qs[_0x29d9('0x39')](_[_0x29d9('0x43')](_0x128dbe[_0x29d9('0x38')],_0x3b2a95[_0x29d9('0x39')]));if(_0x128dbe[_0x29d9('0x38')][_0x29d9('0x44')]){_0x3744f2[_0x29d9('0x42')]=_[_0x29d9('0x45')](_0x3744f2['where'],{'$or':_['map'](_0x3744f2[_0x29d9('0x3b')],function(_0x170bdc){var _0x5b29e8={};_0x5b29e8[_0x170bdc]={'$like':'%'+_0x128dbe[_0x29d9('0x38')]['filter']+'%'};return _0x5b29e8;})});}_0x3744f2=_[_0x29d9('0x45')]({},_0x3744f2,_0x128dbe[_0x29d9('0x49')]);return _0x5e16ae[_0x29d9('0xa0')](_0x3744f2);}})[_0x29d9('0x1c')](function(_0x21ca75){if(_0x21ca75){_0x1ccd93=_0x21ca75['length'];if(!_0x128dbe[_0x29d9('0x38')][_0x29d9('0x3e')](_0x29d9('0x61'))){_0x3744f2['limit']=qs[_0x29d9('0x3f')](_0x128dbe['query'][_0x29d9('0x3f')]);_0x3744f2['offset']=qs[_0x29d9('0x40')](_0x128dbe[_0x29d9('0x38')]['offset']);}return _0x5e16ae[_0x29d9('0xa0')](_0x3744f2);}})[_0x29d9('0x1c')](function(_0x3b11b0){if(_0x3b11b0){return _0x3b11b0?{'count':_0x1ccd93,'rows':_0x3b11b0}:null;}})[_0x29d9('0x1c')](respondWithResult(_0x5c3022,null))[_0x29d9('0x24')](handleError(_0x5c3022,null));};exports[_0x29d9('0xa1')]=function(_0x555a95,_0x2e2e61,_0x4aff7c){var _0x272612={'raw':![],'where':{}};var _0x1b9cd3={};var _0xd14740={'count':0x0,'rows':[]};return db[_0x29d9('0x35')][_0x29d9('0x5e')]({'where':{'id':_0x555a95[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x2e2e61,null))[_0x29d9('0x1c')](function(_0x4a7b84){if(_0x4a7b84){_0x1b9cd3[_0x29d9('0x36')]=_['keys'](db[_0x29d9('0x88')][_0x29d9('0x60')]);_0x1b9cd3[_0x29d9('0x38')]=_[_0x29d9('0x37')](_0x555a95['query']);_0x1b9cd3[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x1b9cd3[_0x29d9('0x36')],_0x1b9cd3[_0x29d9('0x38')]);_0x272612['attributes']=_[_0x29d9('0x3a')](_0x1b9cd3[_0x29d9('0x36')],qs[_0x29d9('0x3c')](_0x555a95[_0x29d9('0x38')][_0x29d9('0x3c')]));_0x272612['attributes']=_0x272612[_0x29d9('0x3b')][_0x29d9('0x3d')]?_0x272612[_0x29d9('0x3b')]:_0x1b9cd3[_0x29d9('0x36')];if(!_0x555a95['query']['hasOwnProperty'](_0x29d9('0x61'))){_0x272612[_0x29d9('0x3f')]=qs[_0x29d9('0x3f')](_0x555a95[_0x29d9('0x38')][_0x29d9('0x3f')]);_0x272612['offset']=qs[_0x29d9('0x40')](_0x555a95['query'][_0x29d9('0x40')]);}_0x272612['order']=qs[_0x29d9('0x41')](_0x555a95[_0x29d9('0x38')]['sort']);_0x272612[_0x29d9('0x42')]=qs[_0x29d9('0x39')](_['pick'](_0x555a95['query'],_0x1b9cd3['filters']));_0x272612[_0x29d9('0x42')][_0x29d9('0x63')]=_0x4a7b84['id'];if(_0x555a95[_0x29d9('0x38')][_0x29d9('0x44')]){_0x272612['where']=_[_0x29d9('0x45')](_0x272612[_0x29d9('0x42')],{'$or':_[_0x29d9('0x46')](_0x272612[_0x29d9('0x3b')],function(_0x4376da){var _0x18f969={};_0x18f969[_0x4376da]={'$like':'%'+_0x555a95['query'][_0x29d9('0x44')]+'%'};return _0x18f969;})});}_0x272612=_[_0x29d9('0x45')]({},_0x272612,_0x555a95[_0x29d9('0x49')]);return db[_0x29d9('0x88')][_0x29d9('0x27')]({'where':_0x272612[_0x29d9('0x42')]})[_0x29d9('0x1c')](function(_0x554f70){_0xd14740[_0x29d9('0x27')]=_0x554f70;if(_0x555a95[_0x29d9('0x38')]['includeAll']){_0x272612[_0x29d9('0x4b')]=[{'model':db['CmContact'],'as':_0x29d9('0xa2'),'required':![]},{'model':db[_0x29d9('0x93')],'as':'Owner','attributes':[_0x29d9('0x32'),_0x29d9('0xa3'),_0x29d9('0xa4')],'required':![]},{'model':db[_0x29d9('0xa5')],'as':'Tags','attributes':['id',_0x29d9('0x32'),_0x29d9('0xa6')],'where':_0x555a95[_0x29d9('0x38')][_0x29d9('0xa7')]?{'id':_0x555a95[_0x29d9('0x38')][_0x29d9('0xa7')]}:undefined,'required':_0x555a95[_0x29d9('0x38')][_0x29d9('0xa7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x29d9('0x4c')](_0x272612);})['then'](function(_0x413b48){_0xd14740['rows']=_0x413b48;return _0xd14740;});}})[_0x29d9('0x1c')](respondWithFilteredResult(_0x2e2e61,_0x272612))[_0x29d9('0x24')](handleError(_0x2e2e61,null));};exports[_0x29d9('0xa8')]=function(_0x58918a,_0x446477,_0x3d6e75){return db['OpenchannelAccount'][_0x29d9('0x51')]({'where':{'id':_0x58918a[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x446477,null))[_0x29d9('0x1c')](function(_0x14a06c){if(_0x14a06c){return _0x14a06c[_0x29d9('0xa8')](_0x58918a[_0x29d9('0x53')]['ids'],_[_0x29d9('0xa9')](_0x58918a[_0x29d9('0x53')],[_0x29d9('0x65'),'id'])||{})[_0x29d9('0x8a')](function(_0x2858ea){for(var _0x549b39=0x0;_0x549b39<_0x58918a['body'][_0x29d9('0x65')][_0x29d9('0x3d')];_0x549b39+=0x1){socket[_0x29d9('0xaa')](_0x29d9('0xab'),{'UserId':_0x58918a[_0x29d9('0x53')][_0x29d9('0x65')][_0x549b39],'OpenchannelAccountId':_0x58918a['params']['id']});}return _0x2858ea;});}})['then'](respondWithResult(_0x446477,null))[_0x29d9('0x24')](handleError(_0x446477,null));};exports[_0x29d9('0xac')]=function(_0x189453,_0x38836b,_0x3ea8b5){var _0x53d340;return db[_0x29d9('0x35')][_0x29d9('0x51')]({'where':{'id':_0x189453['params']['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x38836b,null))[_0x29d9('0x1c')](function(_0x58c217){if(_0x58c217){return _0x58c217[_0x29d9('0xac')](_0x189453[_0x29d9('0x38')]['ids'])[_0x29d9('0x1c')](function(_0x313afc){if(_[_0x29d9('0xad')](_0x189453['query'][_0x29d9('0x65')])){for(var _0x3c715c=0x0;_0x3c715c<_0x189453[_0x29d9('0x38')][_0x29d9('0x65')]['length'];_0x3c715c+=0x1){socket['emit'](_0x29d9('0xae'),{'UserId':_0x189453[_0x29d9('0x38')][_0x29d9('0x65')][_0x3c715c],'OpenchannelAccountId':_0x189453[_0x29d9('0x4f')]['id']});}}else{socket[_0x29d9('0xaa')]('userOpenchannelAccount:remove',{'UserId':_0x189453[_0x29d9('0x38')][_0x29d9('0x65')],'OpenchannelAccountId':_0x189453[_0x29d9('0x4f')]['id']});}});}})[_0x29d9('0x1c')](respondWithStatusCode(_0x38836b,null))[_0x29d9('0x24')](handleError(_0x38836b,null));};exports[_0x29d9('0xaf')]=function(_0x36fdf1,_0x39a4c4,_0x572d1e){var _0x43fea6={};var _0x2b02e8={};var _0x2369d5;var _0x381006;return db['OpenchannelAccount'][_0x29d9('0x5e')]({'where':{'id':_0x36fdf1['params']['id']}})['then'](handleEntityNotFound(_0x39a4c4,null))[_0x29d9('0x1c')](function(_0x2fbf42){if(_0x2fbf42){_0x2369d5=_0x2fbf42;_0x2b02e8[_0x29d9('0x36')]=_[_0x29d9('0x37')](db[_0x29d9('0x93')]['rawAttributes']);_0x2b02e8[_0x29d9('0x38')]=_['keys'](_0x36fdf1[_0x29d9('0x38')]);_0x2b02e8[_0x29d9('0x39')]=_[_0x29d9('0x3a')](_0x2b02e8[_0x29d9('0x36')],_0x2b02e8[_0x29d9('0x38')]);_0x43fea6[_0x29d9('0x3b')]=_[_0x29d9('0x3a')](_0x2b02e8['model'],qs[_0x29d9('0x3c')](_0x36fdf1[_0x29d9('0x38')]['fields']));_0x43fea6[_0x29d9('0x3b')]=_0x43fea6['attributes'][_0x29d9('0x3d')]?_0x43fea6[_0x29d9('0x3b')]:_0x2b02e8[_0x29d9('0x36')];_0x43fea6[_0x29d9('0x62')]=qs['sort'](_0x36fdf1['query']['sort']);_0x43fea6[_0x29d9('0x42')]=qs[_0x29d9('0x39')](_[_0x29d9('0x43')](_0x36fdf1[_0x29d9('0x38')],_0x2b02e8[_0x29d9('0x39')]));if(_0x36fdf1[_0x29d9('0x38')][_0x29d9('0x44')]){_0x43fea6[_0x29d9('0x42')]=_['merge'](_0x43fea6[_0x29d9('0x42')],{'$or':_[_0x29d9('0x46')](_0x43fea6[_0x29d9('0x3b')],function(_0x337862){var _0x5cba13={};_0x5cba13[_0x337862]={'$like':'%'+_0x36fdf1[_0x29d9('0x38')][_0x29d9('0x44')]+'%'};return _0x5cba13;})});}_0x43fea6=_[_0x29d9('0x45')]({},_0x43fea6,_0x36fdf1[_0x29d9('0x49')]);return _0x2369d5[_0x29d9('0xaf')](_0x43fea6);}})[_0x29d9('0x1c')](function(_0x36c208){if(_0x36c208){_0x381006=_0x36c208[_0x29d9('0x3d')];if(!_0x36fdf1['query'][_0x29d9('0x3e')](_0x29d9('0x61'))){_0x43fea6[_0x29d9('0x3f')]=qs['limit'](_0x36fdf1['query'][_0x29d9('0x3f')]);_0x43fea6['offset']=qs['offset'](_0x36fdf1[_0x29d9('0x38')][_0x29d9('0x40')]);}return _0x2369d5[_0x29d9('0xaf')](_0x43fea6);}})[_0x29d9('0x1c')](function(_0x24081d){if(_0x24081d){return _0x24081d?{'count':_0x381006,'rows':_0x24081d}:null;}})['then'](respondWithResult(_0x39a4c4,null))[_0x29d9('0x24')](handleError(_0x39a4c4,null));};exports['send']=function(_0x49eb35,_0x50cb4c,_0x132cc0){var _0x2fe69d,_0x11dc87,_0x34259d;if(_[_0x29d9('0x73')](_0x49eb35[_0x29d9('0x53')][_0x29d9('0x53')])||_0x49eb35[_0x29d9('0x53')][_0x29d9('0x53')]===''){throw new db[(_0x29d9('0x74'))][(_0x29d9('0x6c'))](_0x29d9('0x76'));}if(_[_0x29d9('0x73')](_0x49eb35[_0x29d9('0x53')]['to'])){}_0x2fe69d=_0x49eb35['body']['to'];return db[_0x29d9('0x35')][_0x29d9('0x5e')]({'where':{'id':_0x49eb35[_0x29d9('0x4f')]['id']}})[_0x29d9('0x1c')](handleEntityNotFound(_0x50cb4c,null))[_0x29d9('0x1c')](function(_0x4a9c0c){if(_0x4a9c0c){return db['OpenchannelAccount'][_0x29d9('0x51')]({'where':{'id':_0x4a9c0c['id']},'include':[{'model':db[_0x29d9('0x7a')],'as':_0x29d9('0x7b'),'include':[{'model':db[_0x29d9('0x84')],'as':'Contacts','where':{[_0x4a9c0c[_0x29d9('0x77')]]:_0x2fe69d},'limit':0x1,'order':[[_0x29d9('0x6f'),_0x29d9('0xb0')]]}]}]})[_0x29d9('0x1c')](handleEntityNotFound(_0x50cb4c,null))[_0x29d9('0x1c')](function(_0x183a3b){if(_0x183a3b&&_0x183a3b[_0x29d9('0x7b')]){_0x11dc87=_0x183a3b[_0x29d9('0x2c')]({'plain':!![]});if(_0x11dc87[_0x29d9('0x7b')]&&_0x11dc87['List'][_0x29d9('0x7c')][_0x29d9('0x3d')]){return _0x11dc87[_0x29d9('0x7b')][_0x29d9('0x7c')][0x0];}return db['CmContact'][_0x29d9('0x52')](_['defaults'](_0x49eb35[_0x29d9('0x53')],{'firstName':_0x2fe69d,[_0x183a3b[_0x29d9('0x77')]]:_0x2fe69d,'phone':_0x2fe69d,'ListId':_0x11dc87[_0x29d9('0x72')]}));}})[_0x29d9('0x1c')](handleEntityNotFound(_0x50cb4c,null))[_0x29d9('0x1c')](function(_0x3da116){if(_0x3da116){_0x34259d=_0x3da116;return db['OpenchannelInteraction'][_0x29d9('0x51')]({'where':{'ContactId':_0x34259d['id'],'closed':![],'OpenchannelAccountId':_0x11dc87['id']}})[_0x29d9('0x1c')](function(_0x436be1){if(_0x436be1){return[_0x436be1,![]];}return db[_0x29d9('0x88')][_0x29d9('0x52')]({'UserId':_0x49eb35[_0x29d9('0x54')]['id'],'ContactId':_0x34259d['id'],'OpenchannelAccountId':_0x11dc87['id'],'lastMsgDirection':_0x29d9('0xb1'),'Messages':[_[_0x29d9('0x45')](_0x49eb35[_0x29d9('0x53')],{'read':![],'body':_0x49eb35['body'][_0x29d9('0x53')],'OpenchannelAccountId':_0x11dc87['id'],'UserId':_0x49eb35[_0x29d9('0x54')]['id'],'ContactId':_0x34259d['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x29d9('0xb2')}]})[_0x29d9('0x1c')](function(_0x1fcb93){return[_0x1fcb93,!![]];});});}})[_0x29d9('0x8a')](function(_0x4d27b5,_0x3f14f8){if(_0x3f14f8){return _0x4d27b5;}return db[_0x29d9('0x90')][_0x29d9('0x52')](_[_0x29d9('0x45')](_0x49eb35[_0x29d9('0x53')],{'read':![],'body':_0x49eb35['body']['body'],'OpenchannelAccountId':_0x11dc87['id'],'OpenchannelInteractionId':_0x4d27b5['id'],'UserId':_0x49eb35[_0x29d9('0x54')]['id'],'ContactId':_0x34259d['id']}))[_0x29d9('0x1c')](function(_0x12ab4f){_0x4d27b5[_0x29d9('0xb3')][_0x29d9('0xb2')]=[];_0x4d27b5['dataValues']['Messages'][_0x29d9('0xb4')](_0x12ab4f['dataValues']);return _0x4d27b5;});});}})[_0x29d9('0x1c')](respondWithResult(_0x50cb4c,null))[_0x29d9('0x24')](handleError(_0x50cb4c,null));}; \ No newline at end of file +var _0x28a2=['offset','set','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','stack','name','send','Pause','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','map','type','key','VIRTUAL','field','options','OpenchannelAccount','count','includeAll','findAll','show','params','rawAttributes','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','filter','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','OpenchannelApplication','Applications','List','account','applications','list','priority','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tags','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x476f3a,_0x16a44c){var _0x28aae4=function(_0x2cea29){while(--_0x2cea29){_0x476f3a['push'](_0x476f3a['shift']());}};_0x28aae4(++_0x16a44c);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x228a('0x0'));var emlformat=require(_0x228a('0x1'));var rimraf=require(_0x228a('0x2'));var zipdir=require(_0x228a('0x3'));var jsonpatch=require(_0x228a('0x4'));var rp=require(_0x228a('0x5'));var moment=require(_0x228a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x228a('0x7'));var util=require('util');var path=require(_0x228a('0x8'));var sox=require(_0x228a('0x9'));var csv=require(_0x228a('0xa'));var ejs=require(_0x228a('0xb'));var fs=require('fs');var _=require(_0x228a('0xc'));var squel=require('squel');var crypto=require(_0x228a('0xd'));var jsforce=require(_0x228a('0xe'));var deskjs=require(_0x228a('0xf'));var toCsv=require(_0x228a('0xa'));var querystring=require('querystring');var Papa=require(_0x228a('0x10'));var authService=require(_0x228a('0x11'));var hardwareService=require(_0x228a('0x12'));var Redis=require(_0x228a('0x13'));var qs=require(_0x228a('0x14'));var logger=require(_0x228a('0x15'))(_0x228a('0x16'));var utils=require(_0x228a('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x228a('0x18')](config[_0x228a('0x19')],{'host':_0x228a('0x1a'),'port':0x18eb});var socket=require(_0x228a('0x1b'))(new Redis(config[_0x228a('0x19')]));require('./openchannelAccount.socket')[_0x228a('0x1c')](socket);var jayson=require(_0x228a('0x1d'));var client=jayson[_0x228a('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x228a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xdcc2c3,_0x11ffa3,_0x2e4f17,_0x262ce9){return new BPromise(function(_0x36f4d1,_0xa01bc){var _0x40c8de=_0x262ce9||client;return _0x40c8de['request'](_0xdcc2c3,_0x2e4f17)[_0x228a('0x20')](function(_0x4adff3){logger[_0x228a('0x21')](_0x228a('0x22'),_0x11ffa3,_0x228a('0x23'));logger[_0x228a('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11ffa3,'request\x20sent',JSON[_0x228a('0x25')](_0x4adff3));if(_0x4adff3[_0x228a('0x26')]){if(_0x4adff3[_0x228a('0x26')][_0x228a('0x27')]===0x1f4){logger[_0x228a('0x26')](_0x228a('0x22'),_0x11ffa3,_0x4adff3[_0x228a('0x26')][_0x228a('0x28')]);return _0xa01bc(_0x4adff3[_0x228a('0x26')]['message']);}logger[_0x228a('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x11ffa3,_0x4adff3[_0x228a('0x26')]['message']);return _0x36f4d1(_0x4adff3[_0x228a('0x26')][_0x228a('0x28')]);}else{logger[_0x228a('0x21')](_0x228a('0x22'),_0x11ffa3,_0x228a('0x23'));_0x36f4d1(_0x4adff3[_0x228a('0x29')][_0x228a('0x28')]);}})[_0x228a('0x2a')](function(_0x149da9){logger[_0x228a('0x26')](_0x228a('0x22'),_0x11ffa3,_0x149da9);_0xa01bc(_0x149da9);});});}function respondWithStatusCode(_0x4d3363,_0x58b3d3){_0x58b3d3=_0x58b3d3||0xcc;return function(_0xda1c4c){if(_0xda1c4c){return _0x4d3363[_0x228a('0x2b')](_0x58b3d3);}return _0x4d3363[_0x228a('0x2c')](_0x58b3d3)['end']();};}function respondWithResult(_0x22b499,_0x148a62){_0x148a62=_0x148a62||0xc8;return function(_0x28e4d6){if(_0x28e4d6){return _0x22b499['status'](_0x148a62)['json'](_0x28e4d6);}};}function respondWithFilteredResult(_0x4d8c9e,_0x31d047){return function(_0x196f7){if(_0x196f7){var _0x4b5961=_0x196f7['count'],_0x1d6d87=_0x31d047[_0x228a('0x2d')],_0x4065e0=_0x31d047[_0x228a('0x2d')]+_0x31d047['limit'],_0x52995b;if(_0x4065e0>=_0x4b5961){_0x4065e0=_0x4b5961;_0x52995b=0xc8;}else{_0x52995b=0xce;}_0x4d8c9e['status'](_0x52995b);return _0x4d8c9e[_0x228a('0x2e')]('Content-Range',_0x1d6d87+'-'+_0x4065e0+'/'+_0x4b5961)[_0x228a('0x2f')](_0x196f7);}return null;};}function patchUpdates(_0x79dd28){return function(_0x32d874){try{jsonpatch[_0x228a('0x30')](_0x32d874,_0x79dd28,!![]);}catch(_0x5535c0){return BPromise[_0x228a('0x31')](_0x5535c0);}return _0x32d874[_0x228a('0x32')]();};}function saveUpdates(_0x4c3f63,_0x15739f){return function(_0x269b81){if(_0x269b81){return _0x269b81[_0x228a('0x33')](_0x4c3f63)[_0x228a('0x20')](function(_0xf8f5bc){return _0xf8f5bc;});}return null;};}function removeEntity(_0x2d9c36,_0x2f1dc2){return function(_0x345a54){if(_0x345a54){return _0x345a54[_0x228a('0x34')]()[_0x228a('0x20')](function(){var _0x5f4d97=_0x345a54[_0x228a('0x35')]({'plain':!![]});var _0x3ca313=_0x228a('0x36');return db['UserProfileResource'][_0x228a('0x34')]({'where':{'type':_0x3ca313,'resourceId':_0x5f4d97['id']}})[_0x228a('0x20')](function(){return _0x345a54;});})[_0x228a('0x20')](function(){_0x2d9c36[_0x228a('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f1f3,_0x30b746){return function(_0x1a00a9){if(!_0x1a00a9){_0x51f1f3['sendStatus'](0x194);}return _0x1a00a9;};}function handleError(_0x55ae8c,_0x5adb07){_0x5adb07=_0x5adb07||0x1f4;return function(_0x28f350){logger[_0x228a('0x26')](_0x28f350[_0x228a('0x37')]);if(_0x28f350['name']){delete _0x28f350[_0x228a('0x38')];}_0x55ae8c[_0x228a('0x2c')](_0x5adb07)[_0x228a('0x39')](_0x28f350);};}exports['index']=function(_0x67e498,_0x8ac2b0){var _0x13dd9e={'include':[{'model':db[_0x228a('0x3a')],'as':'mandatoryDispositionPause'}]},_0x3af8c1={},_0x6a5bb7={'count':0x0,'rows':[]};var _0x4ffb7b=db['OpenchannelAccount']['rawAttributes'];_0x3af8c1[_0x228a('0x3b')]=_[_0x228a('0x3c')](_0x4ffb7b);_0x3af8c1[_0x228a('0x3d')]=_[_0x228a('0x3c')](_0x67e498[_0x228a('0x3d')]);_0x3af8c1['filters']=_['intersection'](_0x3af8c1[_0x228a('0x3b')],_0x3af8c1['query']);_0x13dd9e['attributes']=_[_0x228a('0x3e')](_0x3af8c1['model'],qs[_0x228a('0x3f')](_0x67e498[_0x228a('0x3d')][_0x228a('0x3f')]));_0x13dd9e[_0x228a('0x40')]=_0x13dd9e[_0x228a('0x40')][_0x228a('0x41')]?_0x13dd9e[_0x228a('0x40')]:_0x3af8c1[_0x228a('0x3b')];if(!_0x67e498[_0x228a('0x3d')][_0x228a('0x42')](_0x228a('0x43'))){_0x13dd9e[_0x228a('0x44')]=qs[_0x228a('0x44')](_0x67e498[_0x228a('0x3d')]['limit']);_0x13dd9e['offset']=qs[_0x228a('0x2d')](_0x67e498[_0x228a('0x3d')][_0x228a('0x2d')]);}_0x13dd9e[_0x228a('0x45')]=qs[_0x228a('0x46')](_0x67e498[_0x228a('0x3d')][_0x228a('0x46')]);_0x13dd9e[_0x228a('0x47')]=qs['filters'](_[_0x228a('0x48')](_0x67e498[_0x228a('0x3d')],_0x3af8c1[_0x228a('0x49')]));if(_0x67e498[_0x228a('0x3d')]['filter']){_0x13dd9e['where']=_['merge'](_0x13dd9e[_0x228a('0x47')],{'$or':_[_0x228a('0x4a')](_0x4ffb7b,function(_0x380de5){if(_0x380de5[_0x228a('0x4b')][_0x228a('0x4c')]!==_0x228a('0x4d')){var _0x3fe367={};_0x3fe367[_0x380de5[_0x228a('0x4e')]]={'$like':'%'+_0x67e498['query']['filter']+'%'};return _0x3fe367;}})});}_0x13dd9e=_['merge']({},_0x13dd9e,_0x67e498[_0x228a('0x4f')]);var _0x379253={'where':_0x13dd9e[_0x228a('0x47')]};return db[_0x228a('0x50')]['count'](_0x379253)[_0x228a('0x20')](function(_0xd6bfb2){_0x6a5bb7[_0x228a('0x51')]=_0xd6bfb2;if(_0x67e498['query'][_0x228a('0x52')]){_0x13dd9e['include']=[{'all':!![]}];}return db[_0x228a('0x50')][_0x228a('0x53')](_0x13dd9e);})[_0x228a('0x20')](function(_0x310a75){_0x6a5bb7['rows']=_0x310a75;return _0x6a5bb7;})[_0x228a('0x20')](respondWithFilteredResult(_0x8ac2b0,_0x13dd9e))[_0x228a('0x2a')](handleError(_0x8ac2b0,null));};exports[_0x228a('0x54')]=function(_0x56e717,_0x3e3603){var _0x1798d8={'raw':![],'where':{'id':_0x56e717[_0x228a('0x55')]['id']},'include':[{'model':db[_0x228a('0x3a')],'as':'mandatoryDispositionPause'}]},_0x199e6b={};_0x199e6b['model']=_[_0x228a('0x3c')](db['OpenchannelAccount'][_0x228a('0x56')]);_0x199e6b['query']=_[_0x228a('0x3c')](_0x56e717[_0x228a('0x3d')]);_0x199e6b['filters']=_['intersection'](_0x199e6b[_0x228a('0x3b')],_0x199e6b[_0x228a('0x3d')]);_0x1798d8[_0x228a('0x40')]=_['intersection'](_0x199e6b['model'],qs[_0x228a('0x3f')](_0x56e717[_0x228a('0x3d')][_0x228a('0x3f')]));_0x1798d8[_0x228a('0x40')]=_0x1798d8[_0x228a('0x40')]['length']?_0x1798d8[_0x228a('0x40')]:_0x199e6b[_0x228a('0x3b')];if(_0x56e717[_0x228a('0x3d')]['includeAll']){_0x1798d8['include']=[{'all':!![]}];}_0x1798d8=_[_0x228a('0x57')]({},_0x1798d8,_0x56e717[_0x228a('0x4f')]);return db[_0x228a('0x50')][_0x228a('0x58')](_0x1798d8)[_0x228a('0x20')](handleEntityNotFound(_0x3e3603,null))[_0x228a('0x20')](respondWithResult(_0x3e3603,null))['catch'](handleError(_0x3e3603,null));};exports[_0x228a('0x59')]=function(_0x57b5dc,_0x4badba){return db[_0x228a('0x50')][_0x228a('0x59')](_0x57b5dc[_0x228a('0x5a')],{})['then'](function(_0x29fed3){var _0x17657f=_0x57b5dc['user'][_0x228a('0x35')]({'plain':!![]});if(!_0x17657f)throw new Error(_0x228a('0x5b'));if(_0x17657f[_0x228a('0x5c')]===_0x228a('0x5d')){var _0x46fe25=_0x29fed3[_0x228a('0x35')]({'plain':!![]});var _0x51ef4c=_0x228a('0x36');return db[_0x228a('0x5e')][_0x228a('0x58')]({'where':{'name':_0x51ef4c,'userProfileId':_0x17657f[_0x228a('0x5f')]},'raw':!![]})[_0x228a('0x20')](function(_0x9490ea){if(_0x9490ea&&_0x9490ea['autoAssociation']===0x0){return db[_0x228a('0x60')][_0x228a('0x59')]({'name':_0x46fe25[_0x228a('0x38')],'resourceId':_0x46fe25['id'],'type':_0x9490ea[_0x228a('0x38')],'sectionId':_0x9490ea['id']},{})[_0x228a('0x20')](function(){return _0x29fed3;});}else{return _0x29fed3;}})[_0x228a('0x2a')](function(_0x41e530){logger[_0x228a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41e530);throw _0x41e530;});}return _0x29fed3;})['then'](respondWithResult(_0x4badba,0xc9))[_0x228a('0x2a')](handleError(_0x4badba,null));};exports[_0x228a('0x33')]=function(_0x8634a0,_0x5ee6c1){if(_0x8634a0[_0x228a('0x5a')]['id']){delete _0x8634a0[_0x228a('0x5a')]['id'];}return db[_0x228a('0x50')]['find']({'where':{'id':_0x8634a0[_0x228a('0x55')]['id']},'include':[{'model':db[_0x228a('0x3a')],'as':_0x228a('0x61')}]})[_0x228a('0x20')](handleEntityNotFound(_0x5ee6c1,null))[_0x228a('0x20')](saveUpdates(_0x8634a0['body'],null))[_0x228a('0x20')](respondWithResult(_0x5ee6c1,null))[_0x228a('0x2a')](handleError(_0x5ee6c1,null));};exports[_0x228a('0x34')]=function(_0x38651e,_0x3020a0){return db[_0x228a('0x50')]['find']({'where':{'id':_0x38651e[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x3020a0,null))[_0x228a('0x20')](removeEntity(_0x3020a0,null))['catch'](handleError(_0x3020a0,null));};exports[_0x228a('0x62')]=function(_0x213d2c,_0x121d46){return db[_0x228a('0x50')][_0x228a('0x62')]()[_0x228a('0x20')](respondWithResult(_0x121d46,null))[_0x228a('0x2a')](handleError(_0x121d46,null));};exports[_0x228a('0x63')]=function(_0x379f73,_0x22bd47,_0x36bdc8){if(_0x379f73[_0x228a('0x5a')]['id']){delete _0x379f73[_0x228a('0x5a')]['id'];}return db[_0x228a('0x50')][_0x228a('0x58')]({'where':{'id':_0x379f73['params']['id']}})['then'](handleEntityNotFound(_0x22bd47,null))[_0x228a('0x20')](function(_0x3a6bbe){if(_0x3a6bbe){_0x379f73[_0x228a('0x5a')]['OpnechannelAccountId']=_0x3a6bbe['id'];return db[_0x228a('0x64')][_0x228a('0x59')](_0x379f73[_0x228a('0x5a')]);}})[_0x228a('0x20')](respondWithResult(_0x22bd47,null))[_0x228a('0x2a')](handleError(_0x22bd47,null));};exports[_0x228a('0x65')]=function(_0x98eb05,_0x7ef366,_0x4b2d6c){var _0x1008ca={'raw':![],'where':{}};var _0x2f6e83={};var _0x4c8945={'count':0x0,'rows':[]};return db[_0x228a('0x50')]['findOne']({'where':{'id':_0x98eb05['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x7ef366,null))['then'](function(_0x5b2957){if(_0x5b2957){_0x2f6e83[_0x228a('0x3b')]=_[_0x228a('0x3c')](db[_0x228a('0x64')][_0x228a('0x56')]);_0x2f6e83['query']=_[_0x228a('0x3c')](_0x98eb05['query']);_0x2f6e83[_0x228a('0x49')]=_[_0x228a('0x3e')](_0x2f6e83[_0x228a('0x3b')],_0x2f6e83[_0x228a('0x3d')]);_0x1008ca[_0x228a('0x40')]=_[_0x228a('0x3e')](_0x2f6e83['model'],qs[_0x228a('0x3f')](_0x98eb05[_0x228a('0x3d')][_0x228a('0x3f')]));_0x1008ca[_0x228a('0x40')]=_0x1008ca[_0x228a('0x40')][_0x228a('0x41')]?_0x1008ca['attributes']:_0x2f6e83[_0x228a('0x3b')];if(!_0x98eb05[_0x228a('0x3d')]['hasOwnProperty']('nolimit')){_0x1008ca[_0x228a('0x44')]=qs[_0x228a('0x44')](_0x98eb05[_0x228a('0x3d')][_0x228a('0x44')]);_0x1008ca[_0x228a('0x2d')]=qs[_0x228a('0x2d')](_0x98eb05[_0x228a('0x3d')][_0x228a('0x2d')]);}_0x1008ca[_0x228a('0x45')]=qs[_0x228a('0x46')](_0x98eb05[_0x228a('0x3d')][_0x228a('0x46')]);_0x1008ca['where']=qs[_0x228a('0x49')](_[_0x228a('0x48')](_0x98eb05['query'],_0x2f6e83['filters']));_0x1008ca[_0x228a('0x47')][_0x228a('0x66')]=_0x5b2957['id'];if(_0x98eb05['query']['filter']){_0x1008ca[_0x228a('0x47')]=_[_0x228a('0x57')](_0x1008ca['where'],{'$or':_['map'](_0x1008ca[_0x228a('0x40')],function(_0x5e2d28){var _0x64c3f7={};_0x64c3f7[_0x5e2d28]={'$like':'%'+_0x98eb05['query']['filter']+'%'};return _0x64c3f7;})});}_0x1008ca=_['merge']({},_0x1008ca,_0x98eb05['options']);return db['Disposition']['count']({'where':_0x1008ca[_0x228a('0x47')]})[_0x228a('0x20')](function(_0x27fd7e){_0x4c8945['count']=_0x27fd7e;if(_0x98eb05[_0x228a('0x3d')][_0x228a('0x52')]){_0x1008ca[_0x228a('0x67')]=[{'all':!![]}];}return db[_0x228a('0x64')]['findAll'](_0x1008ca);})[_0x228a('0x20')](function(_0x3a6569){_0x4c8945[_0x228a('0x68')]=_0x3a6569;return _0x4c8945;});}})[_0x228a('0x20')](respondWithFilteredResult(_0x7ef366,_0x1008ca))['catch'](handleError(_0x7ef366,null));};exports[_0x228a('0x69')]=function(_0x1b2e69,_0x59ba1c,_0x25257f){var _0x5a3057;return db[_0x228a('0x50')][_0x228a('0x58')]({'where':{'id':_0x1b2e69[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x59ba1c,null))[_0x228a('0x20')](function(_0x59b6fa){if(_0x59b6fa){return _0x59b6fa['removeDispositions'](_0x1b2e69[_0x228a('0x3d')][_0x228a('0x6a')]);}})[_0x228a('0x20')](respondWithStatusCode(_0x59ba1c,null))[_0x228a('0x2a')](handleError(_0x59ba1c,null));};exports[_0x228a('0x6b')]=function(_0x5a3af9,_0x3ae938,_0x24cd6d){if(_0x5a3af9[_0x228a('0x5a')]['id']){delete _0x5a3af9[_0x228a('0x5a')]['id'];}return db[_0x228a('0x50')][_0x228a('0x58')]({'where':{'id':_0x5a3af9['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x3ae938,null))[_0x228a('0x20')](function(_0x5af8a0){if(_0x5af8a0){_0x5a3af9['body']['OpenchannelAccountId']=_0x5af8a0['id'];return db[_0x228a('0x6c')][_0x228a('0x59')](_0x5a3af9[_0x228a('0x5a')]);}})[_0x228a('0x20')](respondWithResult(_0x3ae938,null))[_0x228a('0x2a')](handleError(_0x3ae938,null));};exports['getAnswers']=function(_0x492360,_0x55f5c0,_0x330244){var _0x52528b={'raw':![],'where':{}};var _0x5e35ca={};var _0x18fcfd={'count':0x0,'rows':[]};return db[_0x228a('0x50')][_0x228a('0x6d')]({'where':{'id':_0x492360['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x55f5c0,null))[_0x228a('0x20')](function(_0x5becc2){if(_0x5becc2){_0x5e35ca[_0x228a('0x3b')]=_[_0x228a('0x3c')](db[_0x228a('0x6c')][_0x228a('0x56')]);_0x5e35ca[_0x228a('0x3d')]=_['keys'](_0x492360[_0x228a('0x3d')]);_0x5e35ca['filters']=_[_0x228a('0x3e')](_0x5e35ca[_0x228a('0x3b')],_0x5e35ca[_0x228a('0x3d')]);_0x52528b[_0x228a('0x40')]=_['intersection'](_0x5e35ca[_0x228a('0x3b')],qs[_0x228a('0x3f')](_0x492360[_0x228a('0x3d')][_0x228a('0x3f')]));_0x52528b[_0x228a('0x40')]=_0x52528b[_0x228a('0x40')][_0x228a('0x41')]?_0x52528b[_0x228a('0x40')]:_0x5e35ca['model'];if(!_0x492360[_0x228a('0x3d')][_0x228a('0x42')](_0x228a('0x43'))){_0x52528b[_0x228a('0x44')]=qs[_0x228a('0x44')](_0x492360[_0x228a('0x3d')][_0x228a('0x44')]);_0x52528b[_0x228a('0x2d')]=qs[_0x228a('0x2d')](_0x492360[_0x228a('0x3d')][_0x228a('0x2d')]);}_0x52528b['order']=qs[_0x228a('0x46')](_0x492360['query'][_0x228a('0x46')]);_0x52528b[_0x228a('0x47')]=qs[_0x228a('0x49')](_[_0x228a('0x48')](_0x492360[_0x228a('0x3d')],_0x5e35ca[_0x228a('0x49')]));_0x52528b[_0x228a('0x47')][_0x228a('0x66')]=_0x5becc2['id'];if(_0x492360[_0x228a('0x3d')][_0x228a('0x6e')]){_0x52528b[_0x228a('0x47')]=_[_0x228a('0x57')](_0x52528b['where'],{'$or':_['map'](_0x52528b[_0x228a('0x40')],function(_0x421d3a){var _0x7b301f={};_0x7b301f[_0x421d3a]={'$like':'%'+_0x492360[_0x228a('0x3d')][_0x228a('0x6e')]+'%'};return _0x7b301f;})});}_0x52528b=_[_0x228a('0x57')]({},_0x52528b,_0x492360[_0x228a('0x4f')]);return db[_0x228a('0x6c')][_0x228a('0x51')]({'where':_0x52528b['where']})[_0x228a('0x20')](function(_0x1dfa80){_0x18fcfd['count']=_0x1dfa80;if(_0x492360['query'][_0x228a('0x52')]){_0x52528b[_0x228a('0x67')]=[{'all':!![]}];}return db[_0x228a('0x6c')][_0x228a('0x53')](_0x52528b);})[_0x228a('0x20')](function(_0x118eab){_0x18fcfd['rows']=_0x118eab;return _0x18fcfd;});}})[_0x228a('0x20')](respondWithFilteredResult(_0x55f5c0,_0x52528b))[_0x228a('0x2a')](handleError(_0x55f5c0,null));};exports[_0x228a('0x6f')]=function(_0x29786d,_0x2f79d6,_0x5a1c61){var _0x397a63;return db[_0x228a('0x50')][_0x228a('0x58')]({'where':{'id':_0x29786d[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x2f79d6,null))['then'](function(_0x2100f2){if(_0x2100f2){return _0x2100f2['removeAnswers'](_0x29786d[_0x228a('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x2f79d6,null))[_0x228a('0x2a')](handleError(_0x2f79d6,null));};exports[_0x228a('0x70')]=function(_0xfcf4a5,_0x2ff91a,_0x3d297c){var _0x24648c={'body':_0xfcf4a5[_0x228a('0x5a')],'channel':_0x228a('0x71')};var _0x1c7578=[];var _0x3ec26b=[];var _0x4b04b1={};var _0x34aa1a=![];return db[_0x228a('0x72')]['describe']()[_0x228a('0x20')](function(_0x637e59){if(!_0x637e59){throw new db[(_0x228a('0x73'))][(_0x228a('0x74'))](_0x228a('0x75'));}_0x1c7578=_[_0x228a('0x76')](_[_0x228a('0x3c')](_0x637e59),[_0x228a('0x77'),_0x228a('0x78')]);_0x3ec26b=_[_0x228a('0x76')](_[_0x228a('0x3c')](_0x637e59),[_0x228a('0x77'),'updatedAt',_0x228a('0x79'),_0x228a('0x7a')]);if(_0xfcf4a5[_0x228a('0x5a')]['id']){delete _0xfcf4a5[_0x228a('0x5a')]['id'];}if(_[_0x228a('0x7b')](_0xfcf4a5['body'][_0x228a('0x7c')])){throw new db[(_0x228a('0x73'))][(_0x228a('0x74'))](_0x228a('0x7d'));}if(_[_0x228a('0x7b')](_0xfcf4a5[_0x228a('0x5a')]['body'])||_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x5a')]===''){throw new db[(_0x228a('0x73'))][(_0x228a('0x74'))](_0x228a('0x7e'));}if(_[_0x228a('0x7b')](_0xfcf4a5['body'][_0x228a('0x7f')])){throw new db[(_0x228a('0x73'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ec26b);}if(!_['includes'](_0x3ec26b,_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x7f')])){throw new db[(_0x228a('0x73'))][(_0x228a('0x74'))](_0x228a('0x80')+_0x3ec26b);}_0x4b04b1[_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x7f')]]=_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x7c')];})['then'](function(){return db['OpenchannelAccount'][_0x228a('0x58')]({'where':{'id':_0xfcf4a5[_0x228a('0x55')]['id']},'include':[{'model':db[_0x228a('0x81')],'as':'List','include':[{'model':db[_0x228a('0x72')],'as':_0x228a('0x82'),'where':_0x4b04b1,'limit':0x1,'order':[[_0x228a('0x78'),'DESC']]}]},{'model':db[_0x228a('0x83')],'as':_0x228a('0x84')}]});})[_0x228a('0x20')](handleEntityNotFound(_0x2ff91a,null))[_0x228a('0x20')](function(_0x558ea4){if(_0x558ea4&&_0x558ea4[_0x228a('0x85')]){_0x24648c[_0x228a('0x86')]=_0x558ea4;_0x24648c[_0x228a('0x87')]=_0x558ea4[_0x228a('0x84')];_0x24648c[_0x228a('0x88')]=_0x558ea4[_0x228a('0x85')];_0x24648c[_0x228a('0x87')]=_['orderBy'](_0x24648c[_0x228a('0x87')],[_0x228a('0x89')],['asc']);if(_0x24648c[_0x228a('0x86')]['Applications']){delete _0x24648c[_0x228a('0x86')]['Applications'];}if(_0x24648c[_0x228a('0x86')][_0x228a('0x85')]&&_0x24648c[_0x228a('0x86')][_0x228a('0x85')][_0x228a('0x82')][_0x228a('0x41')]){return _0x24648c[_0x228a('0x86')][_0x228a('0x85')][_0x228a('0x82')][0x0];}var _0x376ba9=_['defaults'](_0xfcf4a5[_0x228a('0x5a')],{'firstName':_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x7c')],'ListId':_0x558ea4[_0x228a('0x7a')]});_0x376ba9[_0xfcf4a5[_0x228a('0x5a')]['mapKey']]=_0xfcf4a5[_0x228a('0x5a')]['from'];return db[_0x228a('0x72')][_0x228a('0x59')](_0x376ba9,{'fields':_0x1c7578,'raw':!![]});}})['then'](handleEntityNotFound(_0x2ff91a,null))['then'](function(_0xea7542){_0x24648c[_0x228a('0x8a')]=_0xea7542;if(_0xea7542){var _0x253ff0={'ContactId':_0xea7542['id'],'OpenchannelAccountId':_0xfcf4a5[_0x228a('0x55')]['id'],'from':(_0xea7542[_0x228a('0x8b')]||'')+'\x20'+(_0xea7542[_0x228a('0x8c')]||'')};var _0x2bfd05={'OpenchannelAccountId':_0xfcf4a5[_0x228a('0x55')]['id'],'closed':![]};if(_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x8d')]){_0x2bfd05[_0x228a('0x8d')]=_0xfcf4a5['body'][_0x228a('0x8d')];return db[_0x228a('0x8e')][_0x228a('0x58')]({'where':_0x2bfd05})[_0x228a('0x20')](function(_0x41a241){if(_0x41a241){return[_0x41a241,![]];}_0x253ff0[_0x228a('0x8d')]=_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x8d')];_0x253ff0[_0x228a('0x8f')]=_0xfcf4a5[_0x228a('0x5a')]['externalUrl'];return db[_0x228a('0x8e')][_0x228a('0x59')](_0x253ff0)[_0x228a('0x20')](function(_0x12f8e2){return[_0x12f8e2,!![]];});});}else{_0x2bfd05[_0x228a('0x8d')]=null;}_0x2bfd05[_0x228a('0x90')]=_0xea7542['id'];return db[_0x228a('0x8e')][_0x228a('0x58')]({'where':_0x2bfd05})['then'](function(_0x3c8e80){if(_0x3c8e80){return[_0x3c8e80,![]];}return db[_0x228a('0x8e')]['create'](_0x253ff0)[_0x228a('0x20')](function(_0x593890){return[_0x593890,!![]];});});}})['spread'](function(_0x247055,_0x2e4f83){if(_0x247055){_0x34aa1a=_0x2e4f83;if(!_0x2e4f83){var _0x4d0d8a={'from':(_0x24648c[_0x228a('0x8a')][_0x228a('0x8b')]||'')+'\x20'+(_0x24648c[_0x228a('0x8a')]['lastName']||'')};if(_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x8d')]&&_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x91')]&&_0xfcf4a5[_0x228a('0x5a')]['threadId']!=_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x91')]){_0x4d0d8a['threadId']=_0xfcf4a5[_0x228a('0x5a')]['messageId'];}return _0x247055[_0x228a('0x33')](_0x4d0d8a);}else{return _0x247055;}}})[_0x228a('0x20')](function(_0x42cf9f){_0x24648c[_0x228a('0x92')]=_0x42cf9f[_0x228a('0x35')]({'plain':!![]});_0x24648c[_0x228a('0x92')][_0x228a('0x93')]=_0x34aa1a;if(_0x24648c[_0x228a('0x92')][_0x228a('0x93')]){if(_0x24648c['account'][_0x228a('0x94')]){_0x24648c[_0x228a('0x87')][_0x228a('0x95')]({'id':0x0,'priority':_0x24648c[_0x228a('0x87')][_0x228a('0x41')]+0x1,'app':'close','appdata':_0x228a('0x96'),'interval':_0x228a('0x97')});}}return db[_0x228a('0x98')][_0x228a('0x59')]({'body':_0xfcf4a5[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0xfcf4a5[_0x228a('0x55')]['id'],'OpenchannelInteractionId':_0x42cf9f['id'],'direction':'in','ContactId':_0x24648c[_0x228a('0x8a')]['id'],'AttachmentId':_0xfcf4a5['body'][_0x228a('0x99')]});})['then'](function(_0x116e21){_0x24648c[_0x228a('0x28')]=_0x116e21;if(_0x24648c['interaction']['UserId']){return db[_0x228a('0x9a')][_0x228a('0x58')]({'attributes':['id','name'],'where':{'id':_0x24648c[_0x228a('0x92')]['UserId']}})[_0x228a('0x20')](function(_0x507897){if(_0x507897){_0x24648c[_0x228a('0x87')][_0x228a('0x9b')]({'id':0x0,'priority':0x0,'app':_0x228a('0x9c'),'appdata':_0x507897[_0x228a('0x38')]+','+(_0x24648c['account']['waitForTheAssignedAgent']||0xa),'interval':_0x228a('0x97')});_0x24648c[_0x228a('0x9d')]=![];}return respondWithRpcPromise(_0x228a('0x9e'),_0x228a('0x9f'),_0x24648c);});}return respondWithRpcPromise('Start','startRouting',_0x24648c);})[_0x228a('0x20')](function(_0x2fe848){respondWithRpcPromise('EventManager',_0x228a('0xa0'),{'event':_0x228a('0x70'),'message':_0x2fe848},client9002);return _0x2fe848;})[_0x228a('0x20')](respondWithResult(_0x2ff91a,null))['catch'](handleError(_0x2ff91a,null));};exports[_0x228a('0xa1')]=function(_0x166084,_0x58e33f,_0x877ec6){return db[_0x228a('0x50')][_0x228a('0x6d')]({'where':{'id':_0x166084[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x58e33f,null))['then'](function(_0x4e4a8d){if(_0x4e4a8d){return db[_0x228a('0xa2')][_0x228a('0xa3')](function(_0x4ad046){return db[_0x228a('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x166084[_0x228a('0x55')]['id']},'transaction':_0x4ad046})[_0x228a('0x20')](function(_0x2e9cf8){var _0x3d5f39=_['map'](_0x166084[_0x228a('0x5a')],function(_0x386987){_0x386987[_0x228a('0x66')]=_0x166084[_0x228a('0x55')]['id'];return _0x386987;});return db[_0x228a('0x83')][_0x228a('0xa4')](_0x3d5f39,{'transaction':_0x4ad046});});})['then'](function(){return db[_0x228a('0x83')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x166084[_0x228a('0x55')]['id']},'order':'priority'});});}})[_0x228a('0x20')](respondWithResult(_0x58e33f,null))['catch'](handleError(_0x58e33f,null));};exports[_0x228a('0xa5')]=function(_0x3244b8,_0x343d34,_0x47ba68){var _0x199a47={};var _0x25f492={};var _0x57ec5d;var _0x1d23e0;return db[_0x228a('0x50')][_0x228a('0x6d')]({'where':{'id':_0x3244b8[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x343d34,null))[_0x228a('0x20')](function(_0x102733){if(_0x102733){_0x57ec5d=_0x102733;_0x25f492[_0x228a('0x3b')]=_[_0x228a('0x3c')](db[_0x228a('0x83')]['rawAttributes']);_0x25f492['query']=_[_0x228a('0x3c')](_0x3244b8['query']);_0x25f492[_0x228a('0x49')]=_[_0x228a('0x3e')](_0x25f492[_0x228a('0x3b')],_0x25f492[_0x228a('0x3d')]);_0x199a47[_0x228a('0x40')]=_['intersection'](_0x25f492[_0x228a('0x3b')],qs['fields'](_0x3244b8['query'][_0x228a('0x3f')]));_0x199a47[_0x228a('0x40')]=_0x199a47['attributes']['length']?_0x199a47[_0x228a('0x40')]:_0x25f492[_0x228a('0x3b')];_0x199a47[_0x228a('0x45')]=qs['sort'](_0x3244b8[_0x228a('0x3d')][_0x228a('0x46')]);_0x199a47[_0x228a('0x47')]=qs[_0x228a('0x49')](_[_0x228a('0x48')](_0x3244b8[_0x228a('0x3d')],_0x25f492[_0x228a('0x49')]));if(_0x3244b8[_0x228a('0x3d')]['filter']){_0x199a47[_0x228a('0x47')]=_['merge'](_0x199a47[_0x228a('0x47')],{'$or':_[_0x228a('0x4a')](_0x199a47[_0x228a('0x40')],function(_0xad6458){var _0xd9e0b0={};_0xd9e0b0[_0xad6458]={'$like':'%'+_0x3244b8[_0x228a('0x3d')]['filter']+'%'};return _0xd9e0b0;})});}_0x199a47=_[_0x228a('0x57')]({},_0x199a47,_0x3244b8[_0x228a('0x4f')]);return _0x57ec5d[_0x228a('0xa5')](_0x199a47);}})[_0x228a('0x20')](function(_0x398e8b){if(_0x398e8b){_0x1d23e0=_0x398e8b[_0x228a('0x41')];if(!_0x3244b8[_0x228a('0x3d')][_0x228a('0x42')](_0x228a('0x43'))){_0x199a47['limit']=qs[_0x228a('0x44')](_0x3244b8['query'][_0x228a('0x44')]);_0x199a47[_0x228a('0x2d')]=qs['offset'](_0x3244b8['query'][_0x228a('0x2d')]);}return _0x57ec5d[_0x228a('0xa5')](_0x199a47);}})['then'](function(_0x137315){if(_0x137315){return _0x137315?{'count':_0x1d23e0,'rows':_0x137315}:null;}})[_0x228a('0x20')](respondWithResult(_0x343d34,null))['catch'](handleError(_0x343d34,null));};exports[_0x228a('0xa6')]=function(_0x361430,_0x2b2b5a,_0x20a8ae){var _0x43b776={'raw':![],'where':{}};var _0x16cac2={};var _0x5a3cd5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x228a('0x6d')]({'where':{'id':_0x361430[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x2b2b5a,null))['then'](function(_0x5cc3e9){if(_0x5cc3e9){_0x16cac2[_0x228a('0x3b')]=_['keys'](db[_0x228a('0x8e')][_0x228a('0x56')]);_0x16cac2[_0x228a('0x3d')]=_[_0x228a('0x3c')](_0x361430[_0x228a('0x3d')]);_0x16cac2[_0x228a('0x49')]=_['intersection'](_0x16cac2[_0x228a('0x3b')],_0x16cac2[_0x228a('0x3d')]);_0x43b776['attributes']=_[_0x228a('0x3e')](_0x16cac2[_0x228a('0x3b')],qs[_0x228a('0x3f')](_0x361430[_0x228a('0x3d')]['fields']));_0x43b776[_0x228a('0x40')]=_0x43b776[_0x228a('0x40')][_0x228a('0x41')]?_0x43b776[_0x228a('0x40')]:_0x16cac2[_0x228a('0x3b')];if(!_0x361430[_0x228a('0x3d')][_0x228a('0x42')](_0x228a('0x43'))){_0x43b776[_0x228a('0x44')]=qs[_0x228a('0x44')](_0x361430['query']['limit']);_0x43b776[_0x228a('0x2d')]=qs[_0x228a('0x2d')](_0x361430[_0x228a('0x3d')]['offset']);}_0x43b776[_0x228a('0x45')]=qs[_0x228a('0x46')](_0x361430[_0x228a('0x3d')][_0x228a('0x46')]);_0x43b776[_0x228a('0x47')]=qs[_0x228a('0x49')](_['pick'](_0x361430[_0x228a('0x3d')],_0x16cac2[_0x228a('0x49')]));_0x43b776[_0x228a('0x47')][_0x228a('0x66')]=_0x5cc3e9['id'];if(_0x361430[_0x228a('0x3d')][_0x228a('0x6e')]){_0x43b776[_0x228a('0x47')]=_['merge'](_0x43b776['where'],{'$or':_['map'](_0x43b776[_0x228a('0x40')],function(_0x42a570){var _0x5c850b={};_0x5c850b[_0x42a570]={'$like':'%'+_0x361430[_0x228a('0x3d')][_0x228a('0x6e')]+'%'};return _0x5c850b;})});}_0x43b776=_['merge']({},_0x43b776,_0x361430[_0x228a('0x4f')]);return db[_0x228a('0x8e')]['count']({'where':_0x43b776[_0x228a('0x47')]})[_0x228a('0x20')](function(_0x4e8d8b){_0x5a3cd5[_0x228a('0x51')]=_0x4e8d8b;if(_0x361430[_0x228a('0x3d')][_0x228a('0x52')]){_0x43b776['include']=[{'model':db[_0x228a('0x72')],'as':_0x228a('0xa7'),'required':![]},{'model':db['User'],'as':_0x228a('0xa8'),'attributes':['name','fullname',_0x228a('0xa9')],'required':![]},{'model':db['Tag'],'as':_0x228a('0xaa'),'attributes':['id',_0x228a('0x38'),'color'],'where':_0x361430[_0x228a('0x3d')][_0x228a('0xab')]?{'id':_0x361430[_0x228a('0x3d')][_0x228a('0xab')]}:undefined,'required':_0x361430[_0x228a('0x3d')][_0x228a('0xab')]?!![]:![]}];}return db[_0x228a('0x8e')]['findAll'](_0x43b776);})[_0x228a('0x20')](function(_0x2383c6){_0x5a3cd5[_0x228a('0x68')]=_0x2383c6;return _0x5a3cd5;});}})[_0x228a('0x20')](respondWithFilteredResult(_0x2b2b5a,_0x43b776))[_0x228a('0x2a')](handleError(_0x2b2b5a,null));};exports[_0x228a('0xac')]=function(_0x50de50,_0x329e53,_0x36d34b){return db[_0x228a('0x50')]['find']({'where':{'id':_0x50de50['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x329e53,null))[_0x228a('0x20')](function(_0x2ab7f5){if(_0x2ab7f5){return _0x2ab7f5[_0x228a('0xac')](_0x50de50[_0x228a('0x5a')]['ids'],_['omit'](_0x50de50[_0x228a('0x5a')],['ids','id'])||{})[_0x228a('0xad')](function(_0x1f9151){for(var _0x35be8c=0x0;_0x35be8c<_0x50de50[_0x228a('0x5a')][_0x228a('0x6a')][_0x228a('0x41')];_0x35be8c+=0x1){socket[_0x228a('0xae')](_0x228a('0xaf'),{'UserId':_0x50de50[_0x228a('0x5a')]['ids'][_0x35be8c],'OpenchannelAccountId':_0x50de50['params']['id']});}return _0x1f9151;});}})[_0x228a('0x20')](respondWithResult(_0x329e53,null))['catch'](handleError(_0x329e53,null));};exports[_0x228a('0xb0')]=function(_0x1fd679,_0x5c9780,_0x12cb5b){var _0x42ced8;return db['OpenchannelAccount'][_0x228a('0x58')]({'where':{'id':_0x1fd679[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x5c9780,null))[_0x228a('0x20')](function(_0x179c16){if(_0x179c16){return _0x179c16[_0x228a('0xb0')](_0x1fd679['query'][_0x228a('0x6a')])[_0x228a('0x20')](function(_0x259388){if(_['isArray'](_0x1fd679['query']['ids'])){for(var _0x1695d6=0x0;_0x1695d6<_0x1fd679[_0x228a('0x3d')][_0x228a('0x6a')][_0x228a('0x41')];_0x1695d6+=0x1){socket[_0x228a('0xae')](_0x228a('0xb1'),{'UserId':_0x1fd679[_0x228a('0x3d')]['ids'][_0x1695d6],'OpenchannelAccountId':_0x1fd679[_0x228a('0x55')]['id']});}}else{socket[_0x228a('0xae')](_0x228a('0xb1'),{'UserId':_0x1fd679[_0x228a('0x3d')][_0x228a('0x6a')],'OpenchannelAccountId':_0x1fd679[_0x228a('0x55')]['id']});}});}})['then'](respondWithStatusCode(_0x5c9780,null))[_0x228a('0x2a')](handleError(_0x5c9780,null));};exports[_0x228a('0xb2')]=function(_0x37d7b5,_0x377652,_0x26d151){var _0x330adc={};var _0x10ae62={};var _0x47bcf0;var _0x4698b3;return db['OpenchannelAccount'][_0x228a('0x6d')]({'where':{'id':_0x37d7b5['params']['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x377652,null))[_0x228a('0x20')](function(_0x389ea3){if(_0x389ea3){_0x47bcf0=_0x389ea3;_0x10ae62[_0x228a('0x3b')]=_['keys'](db[_0x228a('0x9a')][_0x228a('0x56')]);_0x10ae62[_0x228a('0x3d')]=_['keys'](_0x37d7b5[_0x228a('0x3d')]);_0x10ae62[_0x228a('0x49')]=_[_0x228a('0x3e')](_0x10ae62[_0x228a('0x3b')],_0x10ae62[_0x228a('0x3d')]);_0x330adc[_0x228a('0x40')]=_[_0x228a('0x3e')](_0x10ae62[_0x228a('0x3b')],qs['fields'](_0x37d7b5[_0x228a('0x3d')][_0x228a('0x3f')]));_0x330adc[_0x228a('0x40')]=_0x330adc[_0x228a('0x40')][_0x228a('0x41')]?_0x330adc[_0x228a('0x40')]:_0x10ae62[_0x228a('0x3b')];_0x330adc['order']=qs[_0x228a('0x46')](_0x37d7b5[_0x228a('0x3d')][_0x228a('0x46')]);_0x330adc['where']=qs[_0x228a('0x49')](_[_0x228a('0x48')](_0x37d7b5[_0x228a('0x3d')],_0x10ae62[_0x228a('0x49')]));if(_0x37d7b5[_0x228a('0x3d')][_0x228a('0x6e')]){_0x330adc[_0x228a('0x47')]=_[_0x228a('0x57')](_0x330adc['where'],{'$or':_['map'](_0x330adc[_0x228a('0x40')],function(_0x313791){var _0x15e469={};_0x15e469[_0x313791]={'$like':'%'+_0x37d7b5[_0x228a('0x3d')][_0x228a('0x6e')]+'%'};return _0x15e469;})});}_0x330adc=_[_0x228a('0x57')]({},_0x330adc,_0x37d7b5[_0x228a('0x4f')]);return _0x47bcf0[_0x228a('0xb2')](_0x330adc);}})[_0x228a('0x20')](function(_0x45c2fc){if(_0x45c2fc){_0x4698b3=_0x45c2fc[_0x228a('0x41')];if(!_0x37d7b5[_0x228a('0x3d')][_0x228a('0x42')](_0x228a('0x43'))){_0x330adc[_0x228a('0x44')]=qs[_0x228a('0x44')](_0x37d7b5[_0x228a('0x3d')][_0x228a('0x44')]);_0x330adc['offset']=qs[_0x228a('0x2d')](_0x37d7b5[_0x228a('0x3d')]['offset']);}return _0x47bcf0['getAgents'](_0x330adc);}})[_0x228a('0x20')](function(_0x1821ff){if(_0x1821ff){return _0x1821ff?{'count':_0x4698b3,'rows':_0x1821ff}:null;}})[_0x228a('0x20')](respondWithResult(_0x377652,null))[_0x228a('0x2a')](handleError(_0x377652,null));};exports[_0x228a('0x39')]=function(_0x154268,_0x565c03,_0xf671b){var _0x32d307,_0x9d395c,_0x1d639f;if(_['isNil'](_0x154268[_0x228a('0x5a')][_0x228a('0x5a')])||_0x154268[_0x228a('0x5a')]['body']===''){throw new db['Sequelize'][(_0x228a('0x74'))](_0x228a('0x7e'));}if(_[_0x228a('0x7b')](_0x154268[_0x228a('0x5a')]['to'])){}_0x32d307=_0x154268['body']['to'];return db[_0x228a('0x50')][_0x228a('0x6d')]({'where':{'id':_0x154268[_0x228a('0x55')]['id']}})[_0x228a('0x20')](handleEntityNotFound(_0x565c03,null))[_0x228a('0x20')](function(_0x2cc033){if(_0x2cc033){return db[_0x228a('0x50')][_0x228a('0x58')]({'where':{'id':_0x2cc033['id']},'include':[{'model':db[_0x228a('0x81')],'as':_0x228a('0x85'),'include':[{'model':db[_0x228a('0x72')],'as':_0x228a('0x82'),'where':{[_0x2cc033[_0x228a('0x7f')]]:_0x32d307},'limit':0x1,'order':[[_0x228a('0x78'),_0x228a('0xb3')]]}]}]})[_0x228a('0x20')](handleEntityNotFound(_0x565c03,null))[_0x228a('0x20')](function(_0x33dc8d){if(_0x33dc8d&&_0x33dc8d[_0x228a('0x85')]){_0x9d395c=_0x33dc8d[_0x228a('0x35')]({'plain':!![]});if(_0x9d395c[_0x228a('0x85')]&&_0x9d395c[_0x228a('0x85')][_0x228a('0x82')][_0x228a('0x41')]){return _0x9d395c[_0x228a('0x85')][_0x228a('0x82')][0x0];}return db[_0x228a('0x72')][_0x228a('0x59')](_['defaults'](_0x154268['body'],{'firstName':_0x32d307,[_0x33dc8d[_0x228a('0x7f')]]:_0x32d307,'phone':_0x32d307,'ListId':_0x9d395c[_0x228a('0x7a')]}));}})[_0x228a('0x20')](handleEntityNotFound(_0x565c03,null))[_0x228a('0x20')](function(_0x4e9b88){if(_0x4e9b88){_0x1d639f=_0x4e9b88;return db[_0x228a('0x8e')][_0x228a('0x58')]({'where':{'ContactId':_0x1d639f['id'],'closed':![],'OpenchannelAccountId':_0x9d395c['id']}})[_0x228a('0x20')](function(_0x969812){if(_0x969812){return[_0x969812,![]];}return db[_0x228a('0x8e')]['create']({'UserId':_0x154268[_0x228a('0x5d')]['id'],'ContactId':_0x1d639f['id'],'OpenchannelAccountId':_0x9d395c['id'],'lastMsgDirection':_0x228a('0xb4'),'Messages':[_[_0x228a('0x57')](_0x154268[_0x228a('0x5a')],{'read':![],'body':_0x154268[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0x9d395c['id'],'UserId':_0x154268['user']['id'],'ContactId':_0x1d639f['id']})]},{'include':[{'model':db[_0x228a('0x98')],'as':'Messages'}]})['then'](function(_0x3a8cce){return[_0x3a8cce,!![]];});});}})[_0x228a('0xad')](function(_0x42c881,_0x431d87){if(_0x431d87){return _0x42c881;}return db['OpenchannelMessage'][_0x228a('0x59')](_[_0x228a('0x57')](_0x154268[_0x228a('0x5a')],{'read':![],'body':_0x154268[_0x228a('0x5a')][_0x228a('0x5a')],'OpenchannelAccountId':_0x9d395c['id'],'OpenchannelInteractionId':_0x42c881['id'],'UserId':_0x154268[_0x228a('0x5d')]['id'],'ContactId':_0x1d639f['id']}))[_0x228a('0x20')](function(_0x4438c3){_0x42c881['dataValues']['Messages']=[];_0x42c881['dataValues'][_0x228a('0xb5')][_0x228a('0x95')](_0x4438c3[_0x228a('0xb6')]);return _0x42c881;});});}})[_0x228a('0x20')](respondWithResult(_0x565c03,null))[_0x228a('0x2a')](handleError(_0x565c03,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e830e48..4afa8c1 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 _0x0e28=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x48cf09,_0x3b5f6c){var _0x203b57=function(_0x359da1){while(--_0x359da1){_0x48cf09['push'](_0x48cf09['shift']());}};_0x203b57(++_0x3b5f6c);}(_0x0e28,0x12d));var _0x80e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0e28[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x80e2('0x0'))['db'][_0x80e2('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x80e2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80e2('0x3'),'afterDestroy':_0x80e2('0x4')};function emitEvent(_0x36af5c){return function(_0xcb088f,_0x57e3a,_0x1e9b3c){OpenchannelAccountEvents[_0x80e2('0x5')](_0x36af5c+':'+_0xcb088f['id'],_0xcb088f);OpenchannelAccountEvents[_0x80e2('0x5')](_0x36af5c,_0xcb088f);_0x1e9b3c(null);};}for(var e in events){if(events[_0x80e2('0x6')](e)){var event=events[e];OpenchannelAccount[_0x80e2('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xf92b=['exports','events','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xf92b,0x157));var _0xbf92=function(_0x1b1fbc,_0x308b68){_0x1b1fbc=_0x1b1fbc-0x0;var _0x3f3e6a=_0xf92b[_0x1b1fbc];return _0x3f3e6a;};'use strict';var EventEmitter=require(_0xbf92('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbf92('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbf92('0x2')](0x0);var events={'afterCreate':_0xbf92('0x3'),'afterUpdate':_0xbf92('0x4'),'afterDestroy':_0xbf92('0x5')};function emitEvent(_0x46809e){return function(_0x40a66a,_0x18bc83,_0x57d354){OpenchannelAccountEvents[_0xbf92('0x6')](_0x46809e+':'+_0x40a66a['id'],_0x40a66a);OpenchannelAccountEvents[_0xbf92('0x6')](_0x46809e,_0x40a66a);_0x57d354(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbf92('0x7')](e,emitEvent(event));}}module[_0xbf92('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b1103a8..80045a6 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 _0xb10b=['openchannel_accounts','lodash','../../config/logger','api','moment','request-promise','./openchannelAccount.attributes','exports','define'];(function(_0x1c7187,_0x32311e){var _0x2028dc=function(_0x1127dc){while(--_0x1127dc){_0x1c7187['push'](_0x1c7187['shift']());}};_0x2028dc(++_0x32311e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ed919,_0x48314b){_0x2ed919=_0x2ed919-0x0;var _0x574174=_0xb10b[_0x2ed919];return _0x574174;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var attributes=require(_0xbb10('0x5'));module[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){return _0x22320e[_0xbb10('0x7')]('OpenchannelAccount',attributes,{'tableName':_0xbb10('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['exports','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelAccount.attributes'];(function(_0x142156,_0x5169f8){var _0x5b1ea3=function(_0x26080b){while(--_0x26080b){_0x142156['push'](_0x142156['shift']());}};_0x5b1ea3(++_0x5169f8);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1ee04d,_0x4b9f61){_0x1ee04d=_0x1ee04d-0x0;var _0x46a06e=_0xbdb7[_0x1ee04d];return _0x46a06e;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var attributes=require(_0x7bdb('0x7'));module[_0x7bdb('0x8')]=function(_0x47aec5,_0x28542c){return _0x47aec5['define']('OpenchannelAccount',attributes,{'tableName':_0x7bdb('0x9'),'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 186962f..dbdde14 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 _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x573408,_0x5ee657){_0x573408=_0x573408-0x0;var _0x33afcc=_0x7a54[_0x573408];return _0x33afcc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});} \ No newline at end of file +var _0xc4aa=['redis','defaults','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ecf44,_0x15dfe7){var _0x1bee63=function(_0x3c4b48){while(--_0x3c4b48){_0x5ecf44['push'](_0x5ecf44['shift']());}};_0x1bee63(++_0x15dfe7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'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});config[_0xac4a('0xb')]=_[_0xac4a('0xc')](config[_0xac4a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac4a('0xb')]));require(_0xac4a('0xd'))[_0xac4a('0xe')](socket);function respondWithRpcPromise(_0x4f4146,_0x1d182e,_0x3a82de){return new BPromise(function(_0x3e64f5,_0x4d4acc){return client[_0xac4a('0xf')](_0x4f4146,_0x3a82de)['then'](function(_0x2f062c){logger['info'](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));logger[_0xac4a('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1d182e,_0xac4a('0x11'),JSON[_0xac4a('0x13')](_0x2f062c));if(_0x2f062c[_0xac4a('0x14')]){if(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x15')]===0x1f4){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x4d4acc(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}logger[_0xac4a('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d182e,_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);return _0x3e64f5(_0x2f062c[_0xac4a('0x14')][_0xac4a('0x16')]);}else{logger[_0xac4a('0x17')](_0xac4a('0x10'),_0x1d182e,_0xac4a('0x11'));_0x3e64f5(_0x2f062c[_0xac4a('0x18')]['message']);}})['catch'](function(_0x21a729){logger[_0xac4a('0x14')](_0xac4a('0x10'),_0x1d182e,_0x21a729);_0x4d4acc(_0x21a729);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 06a5af6..0d6cc10 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 _0xe640=['remove','emit','removeListener','register','./openchannelAccount.events','save'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe640,0x82));var _0x0e64=function(_0x44e411,_0x4c6174){_0x44e411=_0x44e411-0x0;var _0x3677f0=_0xe640[_0x44e411];return _0x3677f0;};'use strict';var OpenchannelAccountEvents=require(_0x0e64('0x0'));var events=[_0x0e64('0x1'),_0x0e64('0x2'),'update'];function createListener(_0x3b30ae,_0x491ae5){return function(_0x31ba4d){_0x491ae5[_0x0e64('0x3')](_0x3b30ae,_0x31ba4d);};}function removeListener(_0x157e83,_0x4e740d){return function(){OpenchannelAccountEvents[_0x0e64('0x4')](_0x157e83,_0x4e740d);};}exports[_0x0e64('0x5')]=function(_0xc5d834){for(var _0x430a5b=0x0,_0x4fe332=events['length'];_0x430a5b<_0x4fe332;_0x430a5b++){var _0x1a4124=events[_0x430a5b];var _0xf12f6c=createListener('openchannelAccount:'+_0x1a4124,_0xc5d834);OpenchannelAccountEvents['on'](_0x1a4124,_0xf12f6c);}}; \ No newline at end of file +var _0xa71d=['./openchannelAccount.events','save','remove','update','emit','register','length','openchannelAccount:'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xa71d,0x188));var _0xda71=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xa71d[_0x3740fe];return _0x55492b;};'use strict';var OpenchannelAccountEvents=require(_0xda71('0x0'));var events=[_0xda71('0x1'),_0xda71('0x2'),_0xda71('0x3')];function createListener(_0x46d9cf,_0x3e015b){return function(_0x5533ab){_0x3e015b[_0xda71('0x4')](_0x46d9cf,_0x5533ab);};}function removeListener(_0x1c1f2b,_0x3a0d2f){return function(){OpenchannelAccountEvents['removeListener'](_0x1c1f2b,_0x3a0d2f);};}exports[_0xda71('0x5')]=function(_0x231cf0){for(var _0x83866e=0x0,_0x404043=events[_0xda71('0x6')];_0x83866e<_0x404043;_0x83866e++){var _0x45cc10=events[_0x83866e];var _0x480963=createListener(_0xda71('0x7')+_0x45cc10,_0x231cf0);OpenchannelAccountEvents['on'](_0x45cc10,_0x480963);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index bd43396..07bf6c8 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 _0x05ee=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x79138f,_0x5dd8ab){var _0x333ae=function(_0x387512){while(--_0x387512){_0x79138f['push'](_0x79138f['shift']());}};_0x333ae(++_0x5dd8ab);}(_0x05ee,0x92));var _0xe05e=function(_0xca54f9,_0x1d837b){_0xca54f9=_0xca54f9-0x0;var _0x183c63=_0x05ee[_0xca54f9];return _0x183c63;};'use strict';var multer=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var path=require('path');var timeout=require(_0xe05e('0x2'));var express=require(_0xe05e('0x3'));var router=express[_0xe05e('0x4')]();var auth=require(_0xe05e('0x5'));var interaction=require(_0xe05e('0x6'));var config=require(_0xe05e('0x7'));var controller=require(_0xe05e('0x8'));router[_0xe05e('0x9')]('/',auth[_0xe05e('0xa')](),controller[_0xe05e('0xb')]);router[_0xe05e('0x9')](_0xe05e('0xc'),auth['isAuthenticated'](),controller[_0xe05e('0xd')]);router[_0xe05e('0xe')]('/',auth[_0xe05e('0xa')](),controller[_0xe05e('0xf')]);router[_0xe05e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe05e('0x11')]);router[_0xe05e('0x12')](_0xe05e('0xc'),auth['isAuthenticated'](),controller[_0xe05e('0x13')]);module[_0xe05e('0x14')]=router; \ No newline at end of file +var _0xa2a2=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','post','create','put','destroy','multer','util','path'];(function(_0x5f30e6,_0x44adec){var _0x257c8c=function(_0x133302){while(--_0x133302){_0x5f30e6['push'](_0x5f30e6['shift']());}};_0x257c8c(++_0x44adec);}(_0xa2a2,0x16d));var _0x2a2a=function(_0x128258,_0x1d20b7){_0x128258=_0x128258-0x0;var _0x221db4=_0xa2a2[_0x128258];return _0x221db4;};'use strict';var multer=require(_0x2a2a('0x0'));var util=require(_0x2a2a('0x1'));var path=require(_0x2a2a('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a2a('0x3'));var router=express[_0x2a2a('0x4')]();var auth=require(_0x2a2a('0x5'));var interaction=require(_0x2a2a('0x6'));var config=require(_0x2a2a('0x7'));var controller=require(_0x2a2a('0x8'));router[_0x2a2a('0x9')]('/',auth[_0x2a2a('0xa')](),controller[_0x2a2a('0xb')]);router[_0x2a2a('0x9')]('/:id',auth[_0x2a2a('0xa')](),controller['show']);router[_0x2a2a('0xc')]('/',auth['isAuthenticated'](),controller[_0x2a2a('0xd')]);router[_0x2a2a('0xe')]('/:id',auth[_0x2a2a('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2a2a('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 bc5ab0e..58084f3 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 _0xf777=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x33f376,_0x192bba){var _0x156c73=function(_0x581add){while(--_0x581add){_0x33f376['push'](_0x33f376['shift']());}};_0x156c73(++_0x192bba);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7f77('0x0'));module[_0x7f77('0x1')]={'priority':{'type':Sequelize[_0x7f77('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7f77('0x3')],'allowNull':![],'defaultValue':_0x7f77('0x4')},'appdata':{'type':Sequelize[_0x7f77('0x5')]()},'description':{'type':Sequelize[_0x7f77('0x3')]},'interval':{'type':Sequelize[_0x7f77('0x3')],'defaultValue':_0x7f77('0x6')}}; \ No newline at end of file +var _0xfa75=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5fa7('0x0'));module[_0x5fa7('0x1')]={'priority':{'type':Sequelize[_0x5fa7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5fa7('0x3')},'appdata':{'type':Sequelize[_0x5fa7('0x4')]()},'description':{'type':Sequelize[_0x5fa7('0x5')]},'interval':{'type':Sequelize[_0x5fa7('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index fe40900..a3f0b4f 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 _0xb4a0=['fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','stack','name','index','OpenchannelApplication','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x4431ad,_0x4ec0b2){var _0x95aa6=function(_0x3e3d50){while(--_0x3e3d50){_0x4431ad['push'](_0x4431ad['shift']());}};_0x95aa6(++_0x4ec0b2);}(_0xb4a0,0x1e6));var _0x0b4a=function(_0x4f412e,_0x234440){_0x4f412e=_0x4f412e-0x0;var _0x51cc40=_0xb4a0[_0x4f412e];return _0x51cc40;};'use strict';var pdf=require(_0x0b4a('0x0'));var emlformat=require(_0x0b4a('0x1'));var rimraf=require(_0x0b4a('0x2'));var zipdir=require(_0x0b4a('0x3'));var jsonpatch=require(_0x0b4a('0x4'));var rp=require(_0x0b4a('0x5'));var moment=require(_0x0b4a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0b4a('0x7'));var csv=require(_0x0b4a('0x8'));var ejs=require(_0x0b4a('0x9'));var fs=require('fs');var _=require(_0x0b4a('0xa'));var squel=require('squel');var crypto=require(_0x0b4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0b4a('0xc'));var toCsv=require(_0x0b4a('0x8'));var querystring=require(_0x0b4a('0xd'));var Papa=require(_0x0b4a('0xe'));var authService=require(_0x0b4a('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x0b4a('0x10'));var qs=require(_0x0b4a('0x11'));var logger=require(_0x0b4a('0x12'))(_0x0b4a('0x13'));var utils=require(_0x0b4a('0x14'));var config=require('../../config/environment');var db=require(_0x0b4a('0x15'))['db'];function respondWithStatusCode(_0x216cb8,_0x35df6d){_0x35df6d=_0x35df6d||0xcc;return function(_0x42d9b5){if(_0x42d9b5){return _0x216cb8[_0x0b4a('0x16')](_0x35df6d);}return _0x216cb8[_0x0b4a('0x17')](_0x35df6d)[_0x0b4a('0x18')]();};}function respondWithResult(_0x1b1ef7,_0x2cdd05){_0x2cdd05=_0x2cdd05||0xc8;return function(_0x4f5ea0){if(_0x4f5ea0){return _0x1b1ef7['status'](_0x2cdd05)[_0x0b4a('0x19')](_0x4f5ea0);}};}function respondWithFilteredResult(_0x5b980b,_0x1b0821){return function(_0x22bb17){if(_0x22bb17){var _0x16ecaa=_0x22bb17[_0x0b4a('0x1a')],_0x176fa1=_0x1b0821[_0x0b4a('0x1b')],_0x1f5633=_0x1b0821[_0x0b4a('0x1b')]+_0x1b0821[_0x0b4a('0x1c')],_0xafbc48;if(_0x1f5633>=_0x16ecaa){_0x1f5633=_0x16ecaa;_0xafbc48=0xc8;}else{_0xafbc48=0xce;}_0x5b980b[_0x0b4a('0x17')](_0xafbc48);return _0x5b980b[_0x0b4a('0x1d')]('Content-Range',_0x176fa1+'-'+_0x1f5633+'/'+_0x16ecaa)[_0x0b4a('0x19')](_0x22bb17);}return null;};}function patchUpdates(_0x21c141){return function(_0x1830db){try{jsonpatch[_0x0b4a('0x1e')](_0x1830db,_0x21c141,!![]);}catch(_0x257503){return BPromise[_0x0b4a('0x1f')](_0x257503);}return _0x1830db['save']();};}function saveUpdates(_0x204db2,_0x5706b4){return function(_0x245ca2){if(_0x245ca2){return _0x245ca2[_0x0b4a('0x20')](_0x204db2)['then'](function(_0x33325f){return _0x33325f;});}return null;};}function removeEntity(_0x66e844,_0x344678){return function(_0x12059a){if(_0x12059a){return _0x12059a['destroy']()[_0x0b4a('0x21')](function(){_0x66e844[_0x0b4a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d9c21,_0x44706c){return function(_0x27ddd4){if(!_0x27ddd4){_0x1d9c21['sendStatus'](0x194);}return _0x27ddd4;};}function handleError(_0x1b9c91,_0x2c3b15){_0x2c3b15=_0x2c3b15||0x1f4;return function(_0x18319d){logger['error'](_0x18319d[_0x0b4a('0x22')]);if(_0x18319d[_0x0b4a('0x23')]){delete _0x18319d[_0x0b4a('0x23')];}_0x1b9c91[_0x0b4a('0x17')](_0x2c3b15)['send'](_0x18319d);};}exports[_0x0b4a('0x24')]=function(_0x4c043f,_0x48db5f){var _0x4ce5b7={},_0x592cd1={},_0x57f278={'count':0x0,'rows':[]};var _0xb9c865=db[_0x0b4a('0x25')]['rawAttributes'];_0x592cd1[_0x0b4a('0x26')]=_[_0x0b4a('0x27')](_0xb9c865);_0x592cd1[_0x0b4a('0x28')]=_[_0x0b4a('0x27')](_0x4c043f[_0x0b4a('0x28')]);_0x592cd1['filters']=_[_0x0b4a('0x29')](_0x592cd1[_0x0b4a('0x26')],_0x592cd1[_0x0b4a('0x28')]);_0x4ce5b7[_0x0b4a('0x2a')]=_['intersection'](_0x592cd1['model'],qs['fields'](_0x4c043f['query'][_0x0b4a('0x2b')]));_0x4ce5b7[_0x0b4a('0x2a')]=_0x4ce5b7[_0x0b4a('0x2a')][_0x0b4a('0x2c')]?_0x4ce5b7[_0x0b4a('0x2a')]:_0x592cd1['model'];if(!_0x4c043f['query']['hasOwnProperty'](_0x0b4a('0x2d'))){_0x4ce5b7[_0x0b4a('0x1c')]=qs[_0x0b4a('0x1c')](_0x4c043f[_0x0b4a('0x28')][_0x0b4a('0x1c')]);_0x4ce5b7[_0x0b4a('0x1b')]=qs[_0x0b4a('0x1b')](_0x4c043f[_0x0b4a('0x28')][_0x0b4a('0x1b')]);}_0x4ce5b7[_0x0b4a('0x2e')]=qs['sort'](_0x4c043f[_0x0b4a('0x28')][_0x0b4a('0x2f')]);_0x4ce5b7[_0x0b4a('0x30')]=qs[_0x0b4a('0x31')](_[_0x0b4a('0x32')](_0x4c043f[_0x0b4a('0x28')],_0x592cd1[_0x0b4a('0x31')]));if(_0x4c043f[_0x0b4a('0x28')][_0x0b4a('0x33')]){_0x4ce5b7['where']=_[_0x0b4a('0x34')](_0x4ce5b7['where'],{'$or':_[_0x0b4a('0x35')](_0xb9c865,function(_0x1c8c6e){if(_0x1c8c6e[_0x0b4a('0x36')]['key']!==_0x0b4a('0x37')){var _0x54e2a8={};_0x54e2a8[_0x1c8c6e[_0x0b4a('0x38')]]={'$like':'%'+_0x4c043f[_0x0b4a('0x28')][_0x0b4a('0x33')]+'%'};return _0x54e2a8;}})});}_0x4ce5b7=_['merge']({},_0x4ce5b7,_0x4c043f[_0x0b4a('0x39')]);var _0x43636a={'where':_0x4ce5b7[_0x0b4a('0x30')]};return db[_0x0b4a('0x25')]['count'](_0x43636a)[_0x0b4a('0x21')](function(_0x3f5033){_0x57f278[_0x0b4a('0x1a')]=_0x3f5033;if(_0x4c043f[_0x0b4a('0x28')]['includeAll']){_0x4ce5b7[_0x0b4a('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x0b4a('0x3b')](_0x4ce5b7);})['then'](function(_0x4910a7){_0x57f278[_0x0b4a('0x3c')]=_0x4910a7;return _0x57f278;})[_0x0b4a('0x21')](respondWithFilteredResult(_0x48db5f,_0x4ce5b7))[_0x0b4a('0x3d')](handleError(_0x48db5f,null));};exports[_0x0b4a('0x3e')]=function(_0x292a47,_0x39adda){var _0x17eb8a={'raw':!![],'where':{'id':_0x292a47[_0x0b4a('0x3f')]['id']}},_0x2e75d2={};_0x2e75d2[_0x0b4a('0x26')]=_[_0x0b4a('0x27')](db['OpenchannelApplication'][_0x0b4a('0x40')]);_0x2e75d2[_0x0b4a('0x28')]=_[_0x0b4a('0x27')](_0x292a47[_0x0b4a('0x28')]);_0x2e75d2[_0x0b4a('0x31')]=_[_0x0b4a('0x29')](_0x2e75d2[_0x0b4a('0x26')],_0x2e75d2['query']);_0x17eb8a[_0x0b4a('0x2a')]=_[_0x0b4a('0x29')](_0x2e75d2[_0x0b4a('0x26')],qs[_0x0b4a('0x2b')](_0x292a47[_0x0b4a('0x28')][_0x0b4a('0x2b')]));_0x17eb8a['attributes']=_0x17eb8a[_0x0b4a('0x2a')][_0x0b4a('0x2c')]?_0x17eb8a['attributes']:_0x2e75d2['model'];if(_0x292a47[_0x0b4a('0x28')][_0x0b4a('0x41')]){_0x17eb8a[_0x0b4a('0x3a')]=[{'all':!![]}];}_0x17eb8a=_[_0x0b4a('0x34')]({},_0x17eb8a,_0x292a47[_0x0b4a('0x39')]);return db[_0x0b4a('0x25')][_0x0b4a('0x42')](_0x17eb8a)[_0x0b4a('0x21')](handleEntityNotFound(_0x39adda,null))['then'](respondWithResult(_0x39adda,null))[_0x0b4a('0x3d')](handleError(_0x39adda,null));};exports[_0x0b4a('0x43')]=function(_0x16dec5,_0x2d69ed){return db['OpenchannelApplication'][_0x0b4a('0x43')](_0x16dec5['body'],{})[_0x0b4a('0x21')](respondWithResult(_0x2d69ed,0xc9))['catch'](handleError(_0x2d69ed,null));};exports[_0x0b4a('0x20')]=function(_0x2aadc0,_0x3d6eff){if(_0x2aadc0[_0x0b4a('0x44')]['id']){delete _0x2aadc0[_0x0b4a('0x44')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x2aadc0[_0x0b4a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3d6eff,null))['then'](saveUpdates(_0x2aadc0[_0x0b4a('0x44')],null))[_0x0b4a('0x21')](respondWithResult(_0x3d6eff,null))[_0x0b4a('0x3d')](handleError(_0x3d6eff,null));};exports[_0x0b4a('0x45')]=function(_0x5d0a16,_0x472ce0){return db['OpenchannelApplication'][_0x0b4a('0x42')]({'where':{'id':_0x5d0a16[_0x0b4a('0x3f')]['id']}})[_0x0b4a('0x21')](handleEntityNotFound(_0x472ce0,null))[_0x0b4a('0x21')](removeEntity(_0x472ce0,null))[_0x0b4a('0x3d')](handleError(_0x472ce0,null));}; \ No newline at end of file +var _0xef4c=['ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','OpenchannelApplication','findAll','catch','show','params','include','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef4c,0x108));var _0xcef4=function(_0x1043c7,_0x1302e7){_0x1043c7=_0x1043c7-0x0;var _0x987722=_0xef4c[_0x1043c7];return _0x987722;};'use strict';var pdf=require(_0xcef4('0x0'));var emlformat=require(_0xcef4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcef4('0x2'));var rp=require(_0xcef4('0x3'));var moment=require(_0xcef4('0x4'));var BPromise=require(_0xcef4('0x5'));var Mustache=require(_0xcef4('0x6'));var util=require('util');var path=require(_0xcef4('0x7'));var sox=require('sox');var csv=require(_0xcef4('0x8'));var ejs=require(_0xcef4('0x9'));var fs=require('fs');var _=require(_0xcef4('0xa'));var squel=require(_0xcef4('0xb'));var crypto=require(_0xcef4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcef4('0xd'));var toCsv=require(_0xcef4('0x8'));var querystring=require(_0xcef4('0xe'));var Papa=require(_0xcef4('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xcef4('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xcef4('0x11'))(_0xcef4('0x12'));var utils=require('../../config/utils');var config=require(_0xcef4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10a4ec,_0x5463f8){_0x5463f8=_0x5463f8||0xcc;return function(_0x16b946){if(_0x16b946){return _0x10a4ec[_0xcef4('0x14')](_0x5463f8);}return _0x10a4ec[_0xcef4('0x15')](_0x5463f8)[_0xcef4('0x16')]();};}function respondWithResult(_0x4c7d1a,_0x3e8dab){_0x3e8dab=_0x3e8dab||0xc8;return function(_0x5c61d8){if(_0x5c61d8){return _0x4c7d1a[_0xcef4('0x15')](_0x3e8dab)['json'](_0x5c61d8);}};}function respondWithFilteredResult(_0x27d062,_0x36b700){return function(_0x19f71e){if(_0x19f71e){var _0x2ad520=_0x19f71e[_0xcef4('0x17')],_0xb20355=_0x36b700[_0xcef4('0x18')],_0x383208=_0x36b700[_0xcef4('0x18')]+_0x36b700[_0xcef4('0x19')],_0xd77fdd;if(_0x383208>=_0x2ad520){_0x383208=_0x2ad520;_0xd77fdd=0xc8;}else{_0xd77fdd=0xce;}_0x27d062['status'](_0xd77fdd);return _0x27d062[_0xcef4('0x1a')](_0xcef4('0x1b'),_0xb20355+'-'+_0x383208+'/'+_0x2ad520)[_0xcef4('0x1c')](_0x19f71e);}return null;};}function patchUpdates(_0x599ac0){return function(_0xb921f8){try{jsonpatch[_0xcef4('0x1d')](_0xb921f8,_0x599ac0,!![]);}catch(_0x314604){return BPromise[_0xcef4('0x1e')](_0x314604);}return _0xb921f8[_0xcef4('0x1f')]();};}function saveUpdates(_0x305e59,_0x5a6248){return function(_0x4c0c48){if(_0x4c0c48){return _0x4c0c48[_0xcef4('0x20')](_0x305e59)['then'](function(_0x195f88){return _0x195f88;});}return null;};}function removeEntity(_0x81b577,_0x30a047){return function(_0x141200){if(_0x141200){return _0x141200[_0xcef4('0x21')]()[_0xcef4('0x22')](function(){_0x81b577['status'](0xcc)[_0xcef4('0x16')]();});}};}function handleEntityNotFound(_0x51748d,_0x5d7dbc){return function(_0x410931){if(!_0x410931){_0x51748d[_0xcef4('0x14')](0x194);}return _0x410931;};}function handleError(_0x5105e1,_0x10e5a2){_0x10e5a2=_0x10e5a2||0x1f4;return function(_0x5cebec){logger[_0xcef4('0x23')](_0x5cebec[_0xcef4('0x24')]);if(_0x5cebec[_0xcef4('0x25')]){delete _0x5cebec[_0xcef4('0x25')];}_0x5105e1[_0xcef4('0x15')](_0x10e5a2)[_0xcef4('0x26')](_0x5cebec);};}exports['index']=function(_0x2bb14d,_0x6b5724){var _0x2f094b={},_0x5986db={},_0x726fe3={'count':0x0,'rows':[]};var _0x525bf8=db['OpenchannelApplication'][_0xcef4('0x27')];_0x5986db[_0xcef4('0x28')]=_[_0xcef4('0x29')](_0x525bf8);_0x5986db[_0xcef4('0x2a')]=_[_0xcef4('0x29')](_0x2bb14d[_0xcef4('0x2a')]);_0x5986db[_0xcef4('0x2b')]=_[_0xcef4('0x2c')](_0x5986db[_0xcef4('0x28')],_0x5986db[_0xcef4('0x2a')]);_0x2f094b['attributes']=_[_0xcef4('0x2c')](_0x5986db[_0xcef4('0x28')],qs['fields'](_0x2bb14d[_0xcef4('0x2a')][_0xcef4('0x2d')]));_0x2f094b['attributes']=_0x2f094b[_0xcef4('0x2e')][_0xcef4('0x2f')]?_0x2f094b[_0xcef4('0x2e')]:_0x5986db[_0xcef4('0x28')];if(!_0x2bb14d['query'][_0xcef4('0x30')]('nolimit')){_0x2f094b[_0xcef4('0x19')]=qs['limit'](_0x2bb14d['query'][_0xcef4('0x19')]);_0x2f094b[_0xcef4('0x18')]=qs[_0xcef4('0x18')](_0x2bb14d[_0xcef4('0x2a')][_0xcef4('0x18')]);}_0x2f094b[_0xcef4('0x31')]=qs[_0xcef4('0x32')](_0x2bb14d[_0xcef4('0x2a')]['sort']);_0x2f094b[_0xcef4('0x33')]=qs['filters'](_[_0xcef4('0x34')](_0x2bb14d[_0xcef4('0x2a')],_0x5986db[_0xcef4('0x2b')]));if(_0x2bb14d[_0xcef4('0x2a')][_0xcef4('0x35')]){_0x2f094b[_0xcef4('0x33')]=_[_0xcef4('0x36')](_0x2f094b[_0xcef4('0x33')],{'$or':_[_0xcef4('0x37')](_0x525bf8,function(_0x57f6aa){if(_0x57f6aa[_0xcef4('0x38')][_0xcef4('0x39')]!==_0xcef4('0x3a')){var _0x531561={};_0x531561[_0x57f6aa[_0xcef4('0x3b')]]={'$like':'%'+_0x2bb14d[_0xcef4('0x2a')][_0xcef4('0x35')]+'%'};return _0x531561;}})});}_0x2f094b=_[_0xcef4('0x36')]({},_0x2f094b,_0x2bb14d[_0xcef4('0x3c')]);var _0x433b3a={'where':_0x2f094b[_0xcef4('0x33')]};return db['OpenchannelApplication'][_0xcef4('0x17')](_0x433b3a)[_0xcef4('0x22')](function(_0x486639){_0x726fe3[_0xcef4('0x17')]=_0x486639;if(_0x2bb14d['query'][_0xcef4('0x3d')]){_0x2f094b['include']=[{'all':!![]}];}return db[_0xcef4('0x3e')][_0xcef4('0x3f')](_0x2f094b);})[_0xcef4('0x22')](function(_0x1c4b84){_0x726fe3['rows']=_0x1c4b84;return _0x726fe3;})[_0xcef4('0x22')](respondWithFilteredResult(_0x6b5724,_0x2f094b))[_0xcef4('0x40')](handleError(_0x6b5724,null));};exports[_0xcef4('0x41')]=function(_0x402192,_0x1e2d65){var _0x9e982b={'raw':!![],'where':{'id':_0x402192[_0xcef4('0x42')]['id']}},_0xfa00a3={};_0xfa00a3[_0xcef4('0x28')]=_[_0xcef4('0x29')](db[_0xcef4('0x3e')][_0xcef4('0x27')]);_0xfa00a3[_0xcef4('0x2a')]=_['keys'](_0x402192[_0xcef4('0x2a')]);_0xfa00a3['filters']=_['intersection'](_0xfa00a3[_0xcef4('0x28')],_0xfa00a3[_0xcef4('0x2a')]);_0x9e982b[_0xcef4('0x2e')]=_[_0xcef4('0x2c')](_0xfa00a3[_0xcef4('0x28')],qs['fields'](_0x402192['query'][_0xcef4('0x2d')]));_0x9e982b[_0xcef4('0x2e')]=_0x9e982b['attributes'][_0xcef4('0x2f')]?_0x9e982b[_0xcef4('0x2e')]:_0xfa00a3[_0xcef4('0x28')];if(_0x402192[_0xcef4('0x2a')]['includeAll']){_0x9e982b[_0xcef4('0x43')]=[{'all':!![]}];}_0x9e982b=_[_0xcef4('0x36')]({},_0x9e982b,_0x402192[_0xcef4('0x3c')]);return db['OpenchannelApplication']['find'](_0x9e982b)[_0xcef4('0x22')](handleEntityNotFound(_0x1e2d65,null))[_0xcef4('0x22')](respondWithResult(_0x1e2d65,null))[_0xcef4('0x40')](handleError(_0x1e2d65,null));};exports[_0xcef4('0x44')]=function(_0x1268f3,_0x570144){return db[_0xcef4('0x3e')][_0xcef4('0x44')](_0x1268f3[_0xcef4('0x45')],{})['then'](respondWithResult(_0x570144,0xc9))['catch'](handleError(_0x570144,null));};exports[_0xcef4('0x20')]=function(_0x363f73,_0x5b37ff){if(_0x363f73[_0xcef4('0x45')]['id']){delete _0x363f73[_0xcef4('0x45')]['id'];}return db[_0xcef4('0x3e')]['find']({'where':{'id':_0x363f73['params']['id']}})[_0xcef4('0x22')](handleEntityNotFound(_0x5b37ff,null))['then'](saveUpdates(_0x363f73['body'],null))[_0xcef4('0x22')](respondWithResult(_0x5b37ff,null))[_0xcef4('0x40')](handleError(_0x5b37ff,null));};exports[_0xcef4('0x21')]=function(_0x27e35d,_0xa108e0){return db[_0xcef4('0x3e')]['find']({'where':{'id':_0x27e35d['params']['id']}})[_0xcef4('0x22')](handleEntityNotFound(_0xa108e0,null))['then'](removeEntity(_0xa108e0,null))[_0xcef4('0x40')](handleError(_0xa108e0,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index ba72b67..47736d8 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 _0xe283=['exports','define','openchannel_applications','lodash','util','../../config/logger','moment','bluebird'];(function(_0x505aeb,_0x4e339b){var _0xd5d31f=function(_0x580d78){while(--_0x580d78){_0x505aeb['push'](_0x505aeb['shift']());}};_0xd5d31f(++_0x4e339b);}(_0xe283,0x13b));var _0x3e28=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0xe283[_0x4147ff];return _0x1e71e6;};'use strict';var _=require(_0x3e28('0x0'));var util=require(_0x3e28('0x1'));var logger=require(_0x3e28('0x2'))('api');var moment=require(_0x3e28('0x3'));var BPromise=require(_0x3e28('0x4'));var rp=require('request-promise');var attributes=require('./openchannelApplication.attributes');module[_0x3e28('0x5')]=function(_0x401aee,_0x824036){return _0x401aee[_0x3e28('0x6')]('OpenchannelApplication',attributes,{'tableName':_0x3e28('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2190=['OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','bluebird','request-promise','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2190,0x1ba));var _0x0219=function(_0x2499e1,_0x46cedd){_0x2499e1=_0x2499e1-0x0;var _0x26cf27=_0x2190[_0x2499e1];return _0x26cf27;};'use strict';var _=require(_0x0219('0x0'));var util=require(_0x0219('0x1'));var logger=require(_0x0219('0x2'))(_0x0219('0x3'));var moment=require('moment');var BPromise=require(_0x0219('0x4'));var rp=require(_0x0219('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x0219('0x6')]=function(_0x374e0b,_0x41c631){return _0x374e0b[_0x0219('0x7')](_0x0219('0x8'),attributes,{'tableName':_0x0219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 963be87..62043a2 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 _0x4cfa=['update','body','options','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x1763f2,_0x29f8e9){var _0xcc8175=function(_0x19d8e2){while(--_0x19d8e2){_0x1763f2['push'](_0x1763f2['shift']());}};_0xcc8175(++_0x29f8e9);}(_0x4cfa,0xb9));var _0xa4cf=function(_0x50c50b,_0x3a6fb3){_0x50c50b=_0x50c50b-0x0;var _0x423c29=_0x4cfa[_0x50c50b];return _0x423c29;};'use strict';var _=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var moment=require(_0xa4cf('0x2'));var BPromise=require(_0xa4cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4cf('0x4'));var db=require(_0xa4cf('0x5'))['db'];var utils=require(_0xa4cf('0x6'));var logger=require(_0xa4cf('0x7'))(_0xa4cf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4cf('0x9')][_0xa4cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e5ad2,_0x2982fb,_0x501ff6){return new BPromise(function(_0xd81ac9,_0x1d48c8){return client[_0xa4cf('0xb')](_0x3e5ad2,_0x501ff6)[_0xa4cf('0xc')](function(_0x4968cc){logger[_0xa4cf('0xd')](_0xa4cf('0xe'),_0x2982fb,'request\x20sent');logger[_0xa4cf('0xf')](_0xa4cf('0x10'),_0x2982fb,'request\x20sent',JSON[_0xa4cf('0x11')](_0x4968cc));if(_0x4968cc['error']){if(_0x4968cc[_0xa4cf('0x12')][_0xa4cf('0x13')]===0x1f4){logger[_0xa4cf('0x12')](_0xa4cf('0xe'),_0x2982fb,_0x4968cc[_0xa4cf('0x12')][_0xa4cf('0x14')]);return _0x1d48c8(_0x4968cc[_0xa4cf('0x12')]['message']);}logger[_0xa4cf('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x2982fb,_0x4968cc[_0xa4cf('0x12')][_0xa4cf('0x14')]);return _0xd81ac9(_0x4968cc['error']['message']);}else{logger[_0xa4cf('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x2982fb,'request\x20sent');_0xd81ac9(_0x4968cc[_0xa4cf('0x15')]['message']);}})[_0xa4cf('0x16')](function(_0xce8c8e){logger[_0xa4cf('0x12')](_0xa4cf('0xe'),_0x2982fb,_0xce8c8e);_0x1d48c8(_0xce8c8e);});});}exports[_0xa4cf('0x17')]=function(_0x7ba179){var _0x55f9eb=this;return new Promise(function(_0x134368,_0x1db09f){return db[_0xa4cf('0x18')][_0xa4cf('0x19')](_0x7ba179[_0xa4cf('0x1a')],{'raw':_0x7ba179[_0xa4cf('0x1b')]?_0x7ba179[_0xa4cf('0x1b')][_0xa4cf('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ba179[_0xa4cf('0x1b')]?_0x7ba179['options'][_0xa4cf('0x1d')]||null:null,'attributes':_0x7ba179[_0xa4cf('0x1b')]?_0x7ba179[_0xa4cf('0x1b')]['attributes']||null:null,'limit':_0x7ba179[_0xa4cf('0x1b')]?_0x7ba179[_0xa4cf('0x1b')]['limit']||null:null})['then'](function(_0x543ca1){logger[_0xa4cf('0xd')](_0xa4cf('0x17'),_0x7ba179);logger[_0xa4cf('0xf')]('UpdateOpenchannelApplication',_0x7ba179,JSON[_0xa4cf('0x11')](_0x543ca1));_0x134368(_0x543ca1);})[_0xa4cf('0x16')](function(_0x1a2628){logger[_0xa4cf('0x12')]('UpdateOpenchannelApplication',_0x1a2628['message'],_0x7ba179);_0x1db09f(_0x55f9eb[_0xa4cf('0x12')](0x1f4,_0x1a2628[_0xa4cf('0x14')]));});});}; \ No newline at end of file +var _0x38a1=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','update','body','raw','options','where','attributes','limit','UpdateOpenchannelApplication'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x38a1,0x160));var _0x138a=function(_0x44dd17,_0x3caaf7){_0x44dd17=_0x44dd17-0x0;var _0x372f92=_0x38a1[_0x44dd17];return _0x372f92;};'use strict';var _=require(_0x138a('0x0'));var util=require(_0x138a('0x1'));var moment=require(_0x138a('0x2'));var BPromise=require('bluebird');var rs=require(_0x138a('0x3'));var fs=require('fs');var Redis=require(_0x138a('0x4'));var db=require(_0x138a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x138a('0x6'))(_0x138a('0x7'));var config=require(_0x138a('0x8'));var jayson=require(_0x138a('0x9'));var client=jayson[_0x138a('0xa')][_0x138a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1247b6,_0x3a6386,_0x4a4499){return new BPromise(function(_0x2e5837,_0x1bd255){return client[_0x138a('0xc')](_0x1247b6,_0x4a4499)[_0x138a('0xd')](function(_0x25b93e){logger['info'](_0x138a('0xe'),_0x3a6386,_0x138a('0xf'));logger[_0x138a('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3a6386,_0x138a('0xf'),JSON[_0x138a('0x11')](_0x25b93e));if(_0x25b93e[_0x138a('0x12')]){if(_0x25b93e[_0x138a('0x12')][_0x138a('0x13')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3a6386,_0x25b93e['error'][_0x138a('0x14')]);return _0x1bd255(_0x25b93e[_0x138a('0x12')]['message']);}logger[_0x138a('0x12')](_0x138a('0xe'),_0x3a6386,_0x25b93e[_0x138a('0x12')][_0x138a('0x14')]);return _0x2e5837(_0x25b93e[_0x138a('0x12')][_0x138a('0x14')]);}else{logger[_0x138a('0x15')](_0x138a('0xe'),_0x3a6386,_0x138a('0xf'));_0x2e5837(_0x25b93e[_0x138a('0x16')][_0x138a('0x14')]);}})[_0x138a('0x17')](function(_0x14b8ed){logger[_0x138a('0x12')](_0x138a('0xe'),_0x3a6386,_0x14b8ed);_0x1bd255(_0x14b8ed);});});}exports['UpdateOpenchannelApplication']=function(_0x3f5307){var _0x5001d0=this;return new Promise(function(_0x2244be,_0x4be507){return db['OpenchannelApplication'][_0x138a('0x18')](_0x3f5307[_0x138a('0x19')],{'raw':_0x3f5307['options']?_0x3f5307['options'][_0x138a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5307[_0x138a('0x1b')]?_0x3f5307['options'][_0x138a('0x1c')]||null:null,'attributes':_0x3f5307[_0x138a('0x1b')]?_0x3f5307[_0x138a('0x1b')][_0x138a('0x1d')]||null:null,'limit':_0x3f5307['options']?_0x3f5307[_0x138a('0x1b')][_0x138a('0x1e')]||null:null})['then'](function(_0x141af7){logger[_0x138a('0x15')](_0x138a('0x1f'),_0x3f5307);logger[_0x138a('0x10')]('UpdateOpenchannelApplication',_0x3f5307,JSON[_0x138a('0x11')](_0x141af7));_0x2244be(_0x141af7);})[_0x138a('0x17')](function(_0x51a099){logger[_0x138a('0x12')](_0x138a('0x1f'),_0x51a099[_0x138a('0x14')],_0x3f5307);_0x4be507(_0x5001d0[_0x138a('0x12')](0x1f4,_0x51a099[_0x138a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f0b5727..4294db0 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 _0x3705=['/:id','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe'];(function(_0x3a0683,_0x56ad04){var _0x39c473=function(_0x43e671){while(--_0x43e671){_0x3a0683['push'](_0x3a0683['shift']());}};_0x39c473(++_0x56ad04);}(_0x3705,0x85));var _0x5370=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3705[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x5370('0x0'));var path=require(_0x5370('0x1'));var timeout=require(_0x5370('0x2'));var express=require(_0x5370('0x3'));var router=express[_0x5370('0x4')]();var auth=require(_0x5370('0x5'));var interaction=require(_0x5370('0x6'));var config=require(_0x5370('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x5370('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5370('0x8')](_0x5370('0x9'),auth[_0x5370('0xa')](),controller[_0x5370('0xb')]);router['get'](_0x5370('0xc'),auth[_0x5370('0xa')](),controller['show']);router['get'](_0x5370('0xd'),auth[_0x5370('0xa')](),controller[_0x5370('0xe')]);router[_0x5370('0x8')]('/:id/download',auth[_0x5370('0xa')](),controller[_0x5370('0xf')]);router[_0x5370('0x10')]('/',auth[_0x5370('0xa')](),controller[_0x5370('0x11')]);router[_0x5370('0x10')](_0x5370('0xd'),auth[_0x5370('0xa')](),controller[_0x5370('0x12')]);router[_0x5370('0x10')](_0x5370('0x13'),auth['isAuthenticated'](),interaction[_0x5370('0x14')](_0x5370('0x15'),_0x5370('0x16')),controller['addTags']);router[_0x5370('0x17')](_0x5370('0xc'),auth[_0x5370('0xa')](),interaction[_0x5370('0x14')](_0x5370('0x15'),'openchannelinteraction:update'),controller[_0x5370('0x18')]);router[_0x5370('0x19')](_0x5370('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x5370('0x15'),_0x5370('0x1a')),controller[_0x5370('0x1b')]);router[_0x5370('0x19')](_0x5370('0x13'),auth[_0x5370('0xa')](),controller[_0x5370('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x676c=['put','openchannelinteraction:update','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0x2392ff,_0x3e6cdc){var _0x1eba2e=function(_0x5a9ae2){while(--_0x5a9ae2){_0x2392ff['push'](_0x2392ff['shift']());}};_0x1eba2e(++_0x3e6cdc);}(_0x676c,0x17f));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc676('0x0'));var util=require('util');var path=require(_0xc676('0x1'));var timeout=require(_0xc676('0x2'));var express=require(_0xc676('0x3'));var router=express[_0xc676('0x4')]();var auth=require(_0xc676('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc676('0x6'));var controller=require(_0xc676('0x7'));router[_0xc676('0x8')]('/',auth[_0xc676('0x9')](),controller[_0xc676('0xa')]);router[_0xc676('0x8')](_0xc676('0xb'),auth[_0xc676('0x9')](),controller[_0xc676('0xc')]);router[_0xc676('0x8')](_0xc676('0xd'),auth[_0xc676('0x9')](),controller[_0xc676('0xe')]);router['get']('/:id/messages',auth[_0xc676('0x9')](),controller[_0xc676('0xf')]);router[_0xc676('0x8')]('/:id/download',auth[_0xc676('0x9')](),controller['download']);router[_0xc676('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc676('0x10')](_0xc676('0x11'),auth[_0xc676('0x9')](),controller['addMessage']);router[_0xc676('0x10')](_0xc676('0x12'),auth[_0xc676('0x9')](),interaction[_0xc676('0x13')](_0xc676('0x14'),_0xc676('0x15')),controller[_0xc676('0x16')]);router[_0xc676('0x17')](_0xc676('0xd'),auth[_0xc676('0x9')](),interaction[_0xc676('0x13')](_0xc676('0x14'),_0xc676('0x18')),controller[_0xc676('0x19')]);router[_0xc676('0x1a')]('/:id',auth[_0xc676('0x9')](),interaction[_0xc676('0x13')]('openchannel','openchannelinteraction:destroy'),controller[_0xc676('0x1b')]);router[_0xc676('0x1a')](_0xc676('0x12'),auth[_0xc676('0x9')](),controller['removeTags']);module[_0xc676('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 81ed391..f6ca769 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 _0xde02=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0xb39081,_0x53f065){var _0x503a3f=function(_0x3ea885){while(--_0x3ea885){_0xb39081['push'](_0xb39081['shift']());}};_0x503a3f(++_0x53f065);}(_0xde02,0xd5));var _0x2de0=function(_0x2eaf34,_0x29088c){_0x2eaf34=_0x2eaf34-0x0;var _0x3d08c6=_0xde02[_0x2eaf34];return _0x3d08c6;};'use strict';var Sequelize=require(_0x2de0('0x0'));module[_0x2de0('0x1')]={'closed':{'type':Sequelize[_0x2de0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2de0('0x3')]},'read1stAt':{'type':Sequelize[_0x2de0('0x4')]},'threadId':{'type':Sequelize[_0x2de0('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x2de0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2de0('0x5')]('in',_0x2de0('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2de0('0x3')]}}; \ No newline at end of file +var _0x1de4=['BOOLEAN','DATE','STRING','ENUM','sequelize','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x1de4,0x94));var _0x41de=function(_0x293843,_0x3f0e21){_0x293843=_0x293843-0x0;var _0x5c62c7=_0x1de4[_0x293843];return _0x5c62c7;};'use strict';var Sequelize=require(_0x41de('0x0'));module[_0x41de('0x1')]={'closed':{'type':Sequelize[_0x41de('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x41de('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x41de('0x4')]},'read1stAt':{'type':Sequelize[_0x41de('0x3')]},'threadId':{'type':Sequelize[_0x41de('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x41de('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x41de('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x41de('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9e00b87..21868fd 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 _0x7a2d=['findOne','length','nolimit','pick','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','ids','spread','emit','removeTags','unix','toString','root','files','tmp','join','server','interaction-%s.zip','Messages','CmContact','firstName','Attachment','Letter','1cm','

Openchannel\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','%s:\x20%s

','','basename','existsSync','createReadStream','pipe','createWriteStream','toFile','interaction-','.pdf','download','log','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','index','OpenchannelInteraction','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','field','merge','options','include','push','Tag','Tags','tag','distinct','read','OpenchannelMessage','count','includeAll','User','Users','fullname','Contact','internal','OpenchannelAccount','Account','key','direction','color','ThroughTags','findAll','rows','catch','show','params','find','create','body','addMessage','omit','getMessages'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x7a2d,0x142));var _0xd7a2=function(_0xf6c36e,_0x1731cc){_0xf6c36e=_0xf6c36e-0x0;var _0x573a43=_0x7a2d[_0xf6c36e];return _0x573a43;};'use strict';var pdf=require(_0xd7a2('0x0'));var emlformat=require(_0xd7a2('0x1'));var rimraf=require(_0xd7a2('0x2'));var zipdir=require(_0xd7a2('0x3'));var jsonpatch=require(_0xd7a2('0x4'));var rp=require(_0xd7a2('0x5'));var moment=require(_0xd7a2('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7a2('0x7'));var path=require(_0xd7a2('0x8'));var sox=require(_0xd7a2('0x9'));var csv=require(_0xd7a2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd7a2('0xb'));var squel=require(_0xd7a2('0xc'));var crypto=require(_0xd7a2('0xd'));var jsforce=require(_0xd7a2('0xe'));var deskjs=require(_0xd7a2('0xf'));var toCsv=require(_0xd7a2('0xa'));var querystring=require(_0xd7a2('0x10'));var Papa=require(_0xd7a2('0x11'));var authService=require(_0xd7a2('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd7a2('0x13'));var qs=require(_0xd7a2('0x14'));var logger=require(_0xd7a2('0x15'))(_0xd7a2('0x16'));var utils=require(_0xd7a2('0x17'));var config=require(_0xd7a2('0x18'));var db=require(_0xd7a2('0x19'))['db'];config['redis']=_['defaults'](config[_0xd7a2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7a2('0x1b'))(new Redis(config[_0xd7a2('0x1a')]));require(_0xd7a2('0x1c'))[_0xd7a2('0x1d')](socket);function respondWithStatusCode(_0x3724c5,_0x37f995){_0x37f995=_0x37f995||0xcc;return function(_0x42a6c5){if(_0x42a6c5){return _0x3724c5[_0xd7a2('0x1e')](_0x37f995);}return _0x3724c5[_0xd7a2('0x1f')](_0x37f995)[_0xd7a2('0x20')]();};}function respondWithResult(_0x292f64,_0x47b226){_0x47b226=_0x47b226||0xc8;return function(_0x2dc1b7){if(_0x2dc1b7){return _0x292f64['status'](_0x47b226)['json'](_0x2dc1b7);}};}function respondWithFilteredResult(_0x26763e,_0x3f9472){return function(_0x2e8c80){if(_0x2e8c80){var _0x11d958=_0x2e8c80['count'],_0x296784=_0x3f9472[_0xd7a2('0x21')],_0x47210f=_0x3f9472[_0xd7a2('0x21')]+_0x3f9472[_0xd7a2('0x22')],_0x510caa;if(_0x47210f>=_0x11d958){_0x47210f=_0x11d958;_0x510caa=0xc8;}else{_0x510caa=0xce;}_0x26763e['status'](_0x510caa);return _0x26763e['set'](_0xd7a2('0x23'),_0x296784+'-'+_0x47210f+'/'+_0x11d958)['json'](_0x2e8c80);}return null;};}function patchUpdates(_0x4f885a){return function(_0x217c19){try{jsonpatch['apply'](_0x217c19,_0x4f885a,!![]);}catch(_0x5b50d9){return BPromise[_0xd7a2('0x24')](_0x5b50d9);}return _0x217c19['save']();};}function saveUpdates(_0x5bd05f,_0x4fc69c){return function(_0x21da02){if(_0x21da02){return _0x21da02[_0xd7a2('0x25')](_0x5bd05f)[_0xd7a2('0x26')](function(_0x21be90){return _0x21be90;});}return null;};}function removeEntity(_0x2b17ca,_0x3a2be7){return function(_0x2bfde1){if(_0x2bfde1){return _0x2bfde1[_0xd7a2('0x27')]()[_0xd7a2('0x26')](function(){_0x2b17ca[_0xd7a2('0x1f')](0xcc)[_0xd7a2('0x20')]();});}};}function handleEntityNotFound(_0x2601b3,_0x1c3580){return function(_0x5caa05){if(!_0x5caa05){_0x2601b3['sendStatus'](0x194);}return _0x5caa05;};}function handleError(_0x11a498,_0x52b1b4){_0x52b1b4=_0x52b1b4||0x1f4;return function(_0x41e24b){logger['error'](_0x41e24b[_0xd7a2('0x28')]);if(_0x41e24b[_0xd7a2('0x29')]){delete _0x41e24b[_0xd7a2('0x29')];}_0x11a498[_0xd7a2('0x1f')](_0x52b1b4)[_0xd7a2('0x2a')](_0x41e24b);};}exports[_0xd7a2('0x2b')]=function(_0x1a69e4,_0x303dc5){var _0x43b81c={},_0x410cce={},_0x3c04d9={'count':0x0,'rows':[]};var _0x37a24c=db[_0xd7a2('0x2c')][_0xd7a2('0x2d')];_0x410cce[_0xd7a2('0x2e')]=_['keys'](_0x37a24c);_0x410cce[_0xd7a2('0x2f')]=_[_0xd7a2('0x30')](_0x1a69e4['query']);_0x410cce[_0xd7a2('0x31')]=_[_0xd7a2('0x32')](_0x410cce['model'],_0x410cce[_0xd7a2('0x2f')]);_0x43b81c[_0xd7a2('0x33')]=_[_0xd7a2('0x32')](_0x410cce['model'],qs[_0xd7a2('0x34')](_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x34')]));_0x43b81c['attributes']=_0x43b81c[_0xd7a2('0x33')]['length']?_0x43b81c[_0xd7a2('0x33')]:_0x410cce[_0xd7a2('0x2e')];if(!_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x35')]('nolimit')){_0x43b81c[_0xd7a2('0x22')]=qs[_0xd7a2('0x22')](_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x22')]);_0x43b81c['offset']=qs[_0xd7a2('0x21')](_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x21')]);}_0x43b81c[_0xd7a2('0x36')]=qs[_0xd7a2('0x37')](_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x37')]);_0x43b81c[_0xd7a2('0x38')]=qs[_0xd7a2('0x31')](_['pick'](_0x1a69e4[_0xd7a2('0x2f')],_0x410cce[_0xd7a2('0x31')]));if(_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x39')]){_0x43b81c['where']=_['merge'](_0x43b81c[_0xd7a2('0x38')],{'$or':_['map'](_0x37a24c,function(_0x144634){if(_0x144634[_0xd7a2('0x3a')]['key']!==_0xd7a2('0x3b')){var _0x102896={};_0x102896[_0x144634[_0xd7a2('0x3c')]]={'$like':'%'+_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x39')]+'%'};return _0x102896;}})});}_0x43b81c=_[_0xd7a2('0x3d')]({},_0x43b81c,_0x1a69e4[_0xd7a2('0x3e')]);var _0x5c4a6b={'where':_0x43b81c['where']};_0x5c4a6b[_0xd7a2('0x3f')]=[];if(_0x1a69e4[_0xd7a2('0x2f')]['tag']){_0x5c4a6b[_0xd7a2('0x3f')][_0xd7a2('0x40')]({'model':db[_0xd7a2('0x41')],'as':_0xd7a2('0x42'),'attributes':['id'],'where':{'id':_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x43')]},'required':!![]});_0x5c4a6b[_0xd7a2('0x44')]=!![];}if(_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x45')]){_0x5c4a6b['include'][_0xd7a2('0x40')]({'model':db[_0xd7a2('0x46')],'as':'Messages','attributes':['id','direction','createdAt',_0xd7a2('0x45')],'where':{'direction':'in','read':_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x45')]||![]},'required':!![]});_0x5c4a6b[_0xd7a2('0x44')]=!![];}return db[_0xd7a2('0x2c')]['count'](_0x5c4a6b)['then'](function(_0x3f3bf0){_0x3c04d9[_0xd7a2('0x47')]=_0x3f3bf0;if(_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x48')]){_0x43b81c['include']=[{'model':db[_0xd7a2('0x49')],'as':_0xd7a2('0x4a'),'required':![],'attributes':['id',_0xd7a2('0x29'),_0xd7a2('0x4b')]},{'model':db['CmContact'],'as':_0xd7a2('0x4c'),'required':![]},{'model':db[_0xd7a2('0x49')],'as':'Owner','attributes':['name','fullname',_0xd7a2('0x4d')],'required':![]},{'model':db[_0xd7a2('0x4e')],'as':_0xd7a2('0x4f'),'attributes':[_0xd7a2('0x29'),_0xd7a2('0x50')],'required':![]},{'model':db[_0xd7a2('0x46')],'as':'Messages','attributes':['id',_0xd7a2('0x51'),'createdAt',_0xd7a2('0x45')],'where':{'direction':'in','read':_0x1a69e4[_0xd7a2('0x2f')]['read']||![]},'required':_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x45')]||![]},{'model':db[_0xd7a2('0x41')],'as':'Tags','attributes':['id',_0xd7a2('0x29'),_0xd7a2('0x52')],'required':_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x43')]?!![]:![]},{'model':db[_0xd7a2('0x41')],'as':_0xd7a2('0x53'),'attributes':['id',_0xd7a2('0x29'),_0xd7a2('0x52')],'through':_0x1a69e4['query']['tag']?{'attributes':[],'where':{'TagId':_0x1a69e4[_0xd7a2('0x2f')][_0xd7a2('0x43')]||undefined}}:{},'required':_0x1a69e4['query'][_0xd7a2('0x43')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xd7a2('0x54')](_0x43b81c);})[_0xd7a2('0x26')](function(_0x401dd4){_0x3c04d9[_0xd7a2('0x55')]=_0x401dd4;return _0x3c04d9;})[_0xd7a2('0x26')](respondWithFilteredResult(_0x303dc5,_0x43b81c))[_0xd7a2('0x56')](handleError(_0x303dc5,null));};exports[_0xd7a2('0x57')]=function(_0x4e5450,_0x186412){var _0x36cf8d={'raw':![],'where':{'id':_0x4e5450[_0xd7a2('0x58')]['id']}},_0x5d1921={};_0x5d1921['model']=_[_0xd7a2('0x30')](db['OpenchannelInteraction'][_0xd7a2('0x2d')]);_0x5d1921[_0xd7a2('0x2f')]=_[_0xd7a2('0x30')](_0x4e5450[_0xd7a2('0x2f')]);_0x5d1921[_0xd7a2('0x31')]=_[_0xd7a2('0x32')](_0x5d1921[_0xd7a2('0x2e')],_0x5d1921[_0xd7a2('0x2f')]);_0x36cf8d[_0xd7a2('0x33')]=_[_0xd7a2('0x32')](_0x5d1921[_0xd7a2('0x2e')],qs[_0xd7a2('0x34')](_0x4e5450[_0xd7a2('0x2f')][_0xd7a2('0x34')]));_0x36cf8d[_0xd7a2('0x33')]=_0x36cf8d[_0xd7a2('0x33')]['length']?_0x36cf8d['attributes']:_0x5d1921[_0xd7a2('0x2e')];if(_0x4e5450[_0xd7a2('0x2f')][_0xd7a2('0x48')]){_0x36cf8d[_0xd7a2('0x3f')]=[{'all':!![]}];}_0x36cf8d=_[_0xd7a2('0x3d')]({},_0x36cf8d,_0x4e5450[_0xd7a2('0x3e')]);return db[_0xd7a2('0x2c')][_0xd7a2('0x59')](_0x36cf8d)[_0xd7a2('0x26')](handleEntityNotFound(_0x186412,null))[_0xd7a2('0x26')](respondWithResult(_0x186412,null))[_0xd7a2('0x56')](handleError(_0x186412,null));};exports['create']=function(_0xa7f82b,_0x2ba19c){return db[_0xd7a2('0x2c')][_0xd7a2('0x5a')](_0xa7f82b[_0xd7a2('0x5b')],{})['then'](respondWithResult(_0x2ba19c,0xc9))[_0xd7a2('0x56')](handleError(_0x2ba19c,null));};exports[_0xd7a2('0x25')]=function(_0x4cfdf0,_0x47983d){if(_0x4cfdf0['body']['id']){delete _0x4cfdf0['body']['id'];}return db[_0xd7a2('0x2c')][_0xd7a2('0x59')]({'where':{'id':_0x4cfdf0[_0xd7a2('0x58')]['id']}})['then'](handleEntityNotFound(_0x47983d,null))[_0xd7a2('0x26')](saveUpdates(_0x4cfdf0['body'],null))[_0xd7a2('0x26')](respondWithResult(_0x47983d,null))['catch'](handleError(_0x47983d,null));};exports[_0xd7a2('0x27')]=function(_0x29a7d4,_0x4436b8){return db[_0xd7a2('0x2c')]['find']({'where':{'id':_0x29a7d4[_0xd7a2('0x58')]['id']}})[_0xd7a2('0x26')](handleEntityNotFound(_0x4436b8,null))['then'](removeEntity(_0x4436b8,null))['catch'](handleError(_0x4436b8,null));};exports['describe']=function(_0x4769f6,_0xbeca94){return db[_0xd7a2('0x2c')]['describe']()[_0xd7a2('0x26')](respondWithResult(_0xbeca94,null))[_0xd7a2('0x56')](handleError(_0xbeca94,null));};exports[_0xd7a2('0x5c')]=function(_0x343da7,_0xd2d676,_0xe92b97){return db[_0xd7a2('0x46')][_0xd7a2('0x59')]({'where':{'id':_0x343da7[_0xd7a2('0x58')]['id']}})[_0xd7a2('0x26')](handleEntityNotFound(_0xd2d676,null))[_0xd7a2('0x26')](function(_0x2f6035){if(_0x2f6035){return _0x2f6035[_0xd7a2('0x5c')](_0x343da7[_0xd7a2('0x5b')]['ids'],_[_0xd7a2('0x5d')](_0x343da7[_0xd7a2('0x5b')],['ids','id'])||{});}})[_0xd7a2('0x26')](respondWithResult(_0xd2d676,null))[_0xd7a2('0x56')](handleError(_0xd2d676,null));};exports[_0xd7a2('0x5e')]=function(_0x307814,_0x5ad6e3,_0x161cfc){var _0x39329e={'raw':![],'where':{}};var _0x3e1817={};var _0x3b0a55={'count':0x0,'rows':[]};return db[_0xd7a2('0x2c')][_0xd7a2('0x5f')]({'where':{'id':_0x307814[_0xd7a2('0x58')]['id']}})[_0xd7a2('0x26')](handleEntityNotFound(_0x5ad6e3,null))[_0xd7a2('0x26')](function(_0x3644ee){if(_0x3644ee){_0x3e1817[_0xd7a2('0x2e')]=_[_0xd7a2('0x30')](db[_0xd7a2('0x46')][_0xd7a2('0x2d')]);_0x3e1817['query']=_[_0xd7a2('0x30')](_0x307814[_0xd7a2('0x2f')]);_0x3e1817[_0xd7a2('0x31')]=_[_0xd7a2('0x32')](_0x3e1817['model'],_0x3e1817[_0xd7a2('0x2f')]);_0x39329e[_0xd7a2('0x33')]=_[_0xd7a2('0x32')](_0x3e1817[_0xd7a2('0x2e')],qs['fields'](_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x34')]));_0x39329e[_0xd7a2('0x33')]=_0x39329e['attributes'][_0xd7a2('0x60')]?_0x39329e[_0xd7a2('0x33')]:_0x3e1817[_0xd7a2('0x2e')];if(!_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x35')](_0xd7a2('0x61'))){_0x39329e[_0xd7a2('0x22')]=qs[_0xd7a2('0x22')](_0x307814['query']['limit']);_0x39329e['offset']=qs['offset'](_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x21')]);}_0x39329e[_0xd7a2('0x36')]=qs[_0xd7a2('0x37')](_0x307814[_0xd7a2('0x2f')]['sort']);_0x39329e[_0xd7a2('0x38')]=qs[_0xd7a2('0x31')](_[_0xd7a2('0x62')](_0x307814[_0xd7a2('0x2f')],_0x3e1817[_0xd7a2('0x31')]));_0x39329e[_0xd7a2('0x38')][_0xd7a2('0x63')]=_0x3644ee['id'];if(_0x307814[_0xd7a2('0x2f')]['filter']){_0x39329e[_0xd7a2('0x38')]=_[_0xd7a2('0x3d')](_0x39329e['where'],{'$or':_['map'](_0x39329e['attributes'],function(_0x502d5f){var _0x3d1ed2={};_0x3d1ed2[_0x502d5f]={'$like':'%'+_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x39')]+'%'};return _0x3d1ed2;})});}if(_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x64')]){var _0x4630ea=_0x307814[_0xd7a2('0x2f')][_0xd7a2('0x64')][_0xd7a2('0x65')](',');var _0x3bf0f9={};_0x3bf0f9[_0x4630ea[0x0]]={'$gte':moment(_0x4630ea[0x1])[_0xd7a2('0x66')](_0xd7a2('0x67'))};_0x39329e['where']=_[_0xd7a2('0x3d')](_0x39329e[_0xd7a2('0x38')],_0x3bf0f9);}_0x39329e=_[_0xd7a2('0x3d')]({},_0x39329e,_0x307814[_0xd7a2('0x3e')]);return db[_0xd7a2('0x46')][_0xd7a2('0x47')]({'where':_0x39329e['where']})['then'](function(_0x40e0f9){_0x3b0a55[_0xd7a2('0x47')]=_0x40e0f9;if(_0x307814[_0xd7a2('0x2f')]['includeAll']){_0x39329e[_0xd7a2('0x3f')]=[{'all':!![]}];}return db[_0xd7a2('0x46')]['findAll'](_0x39329e);})[_0xd7a2('0x26')](function(_0x2e9d94){_0x3b0a55[_0xd7a2('0x55')]=_0x2e9d94;return _0x3b0a55;});}})[_0xd7a2('0x26')](respondWithFilteredResult(_0x5ad6e3,_0x39329e))['catch'](handleError(_0x5ad6e3,null));};exports['addTags']=function(_0x5005a0,_0x4ecf25,_0x432607){return db[_0xd7a2('0x2c')][_0xd7a2('0x59')]({'where':{'id':_0x5005a0[_0xd7a2('0x58')]['id']}})[_0xd7a2('0x26')](handleEntityNotFound(_0x4ecf25,null))[_0xd7a2('0x26')](function(_0x208218){if(_0x208218){return _0x208218[_0xd7a2('0x68')](_0x5005a0[_0xd7a2('0x5b')][_0xd7a2('0x69')],_[_0xd7a2('0x5d')](_0x5005a0[_0xd7a2('0x5b')],['ids','id'])||{})[_0xd7a2('0x6a')](function(){return db['Tag'][_0xd7a2('0x54')]({'attributes':['id',_0xd7a2('0x29'),_0xd7a2('0x52')],'where':{'id':_0x5005a0[_0xd7a2('0x5b')][_0xd7a2('0x69')]}});})['then'](function(_0x48f5c3){socket[_0xd7a2('0x6b')]('openchannelInteractionTags:save',{'id':Number(_0x5005a0[_0xd7a2('0x58')]['id']),'tags':_0x48f5c3||[]});return{'id':Number(_0x5005a0[_0xd7a2('0x58')]['id']),'tags':_0x48f5c3||[]};});}})['then'](respondWithResult(_0x4ecf25,null))[_0xd7a2('0x56')](handleError(_0x4ecf25,null));};exports['removeTags']=function(_0x1ef10e,_0x1f331e,_0x436453){var _0x45e182;return db['OpenchannelInteraction'][_0xd7a2('0x59')]({'where':{'id':_0x1ef10e[_0xd7a2('0x58')]['id']}})[_0xd7a2('0x26')](handleEntityNotFound(_0x1f331e,null))[_0xd7a2('0x26')](function(_0x44383f){if(_0x44383f){return _0x44383f[_0xd7a2('0x6c')](_0x1ef10e[_0xd7a2('0x2f')][_0xd7a2('0x69')]);}})[_0xd7a2('0x26')](respondWithStatusCode(_0x1f331e,null))[_0xd7a2('0x56')](handleError(_0x1f331e,null));};exports['download']=function(_0x106005,_0x5bd33d){var _0x221053=moment()[_0xd7a2('0x6d')]()[_0xd7a2('0x6e')]();var _0x141ffa=path['join'](config[_0xd7a2('0x6f')],'server',_0xd7a2('0x70'),_0xd7a2('0x71'));var _0xc356c3=path[_0xd7a2('0x72')](config[_0xd7a2('0x6f')],_0xd7a2('0x73'),_0xd7a2('0x70'),'attachments');var _0x161e71=path[_0xd7a2('0x72')](_0x141ffa,_0x221053);var _0x1dc1c5=util[_0xd7a2('0x66')](_0xd7a2('0x74'),_0x221053);var _0x32d847=path['join'](_0x141ffa,_0x1dc1c5);var _0x2588c1=![];return db[_0xd7a2('0x2c')]['find']({'where':{'id':_0x106005['params']['id']},'include':[{'model':db[_0xd7a2('0x46')],'as':_0xd7a2('0x75'),'attributes':['id','body'],'include':[{'model':db[_0xd7a2('0x49')],'as':_0xd7a2('0x49'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xd7a2('0x76')],'as':_0xd7a2('0x4c'),'attributes':['id',_0xd7a2('0x77')],'raw':!![]},{'model':db[_0xd7a2('0x78')],'as':_0xd7a2('0x78'),'raw':!![]}]}]})[_0xd7a2('0x26')](handleEntityNotFound(_0x5bd33d,null))['then'](function(_0x4e3954){if(_0x4e3954){_0x2588c1=!![];var _0x155df6='';var _0xdd77a2={'format':_0xd7a2('0x79'),'border':_0xd7a2('0x7a')};fs['mkdirSync'](_0x161e71);_0x155df6+=util[_0xd7a2('0x66')](_0xd7a2('0x7b'),_0x4e3954['id']);_0x155df6+=util[_0xd7a2('0x66')](_0xd7a2('0x7c'),moment()['format'](_0xd7a2('0x7d'))[_0xd7a2('0x6e')]());_0x155df6+=_0xd7a2('0x7e');for(var _0x5c9662=0x0;_0x5c9662<_0x4e3954['Messages'][_0xd7a2('0x60')];_0x5c9662++){var _0x37ebb2=_0x4e3954[_0xd7a2('0x75')][_0x5c9662];_0x155df6+='';_0x155df6+=util[_0xd7a2('0x66')](_0xd7a2('0x7f'),_0x37ebb2[_0xd7a2('0x49')]?_0x37ebb2[_0xd7a2('0x49')][_0xd7a2('0x4b')]:_0x37ebb2['Contact'][_0xd7a2('0x77')],_0x37ebb2[_0xd7a2('0x5b')]);_0x155df6+=_0xd7a2('0x80');if(_0x37ebb2[_0xd7a2('0x78')]){var _0xbc1594=_0x37ebb2['Attachment'];var _0x4802d2=path[_0xd7a2('0x72')](_0xc356c3,_0xbc1594[_0xd7a2('0x81')]);if(fs[_0xd7a2('0x82')](_0x4802d2)){fs[_0xd7a2('0x83')](_0x4802d2)[_0xd7a2('0x84')](fs[_0xd7a2('0x85')](path['join'](_0x161e71,_0xbc1594[_0xd7a2('0x81')])));}}}return new BPromise(function(_0x399d93,_0x42eac8){pdf[_0xd7a2('0x5a')](_0x155df6,_0xdd77a2)[_0xd7a2('0x86')](path[_0xd7a2('0x72')](_0x161e71,_0xd7a2('0x87')+_0x221053+_0xd7a2('0x88')),function(_0x31ee75,_0x288faf){if(_0x31ee75)return _0x42eac8(_0x31ee75);_0x399d93(_0x288faf);});});}})['then'](function(){if(_0x2588c1){return new BPromise(function(_0x4e01ea,_0x43258e){zipdir(_0x161e71,{'saveTo':_0x32d847},function(_0x27d28b,_0x360173){if(_0x27d28b)return _0x43258e(_0x27d28b);return _0x4e01ea(_0x360173);});});}})[_0xd7a2('0x26')](function(){if(_0x2588c1){return new BPromise(function(_0xf5e483,_0x251966){rimraf(_0x161e71,function(_0x237777){if(_0x237777)_0x251966(_0x237777);return _0xf5e483();});});}})[_0xd7a2('0x26')](function(){if(_0x2588c1){return _0x5bd33d[_0xd7a2('0x89')](_0x32d847,_0x1dc1c5,function(_0x396a9b){if(_0x396a9b){console[_0xd7a2('0x8a')]('err',_0x396a9b);}else{fs['unlinkSync'](_0x32d847);}});}else{return _0x5bd33d[_0xd7a2('0x1e')](0xc8);}})['catch'](handleError(_0x5bd33d,null));}; \ No newline at end of file +var _0xe131=['body','params','describe','addMessage','ids','findOne','OpenchannelInteractionId','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','interaction-%s.zip','Contact','firstName','Attachment','Letter','1cm','mkdirSync','

Openchannel\x20Interaction:\x20#%d

','toString','%s:\x20%s

','basename','existsSync','createWriteStream','toFile','interaction-','err','unlinkSync','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','OpenchannelInteraction','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','type','key','VIRTUAL','field','include','tag','push','Tag','distinct','read','OpenchannelMessage','Messages','direction','createdAt','includeAll','User','Users','CmContact','Owner','Account','Tags','color','findAll','show','rawAttributes','options','find','catch','create'];(function(_0x2f0879,_0x588a5e){var _0x18ee5d=function(_0x35abb2){while(--_0x35abb2){_0x2f0879['push'](_0x2f0879['shift']());}};_0x18ee5d(++_0x588a5e);}(_0xe131,0x1b5));var _0x1e13=function(_0x585add,_0x6e1922){_0x585add=_0x585add-0x0;var _0x2f1d76=_0xe131[_0x585add];return _0x2f1d76;};'use strict';var pdf=require(_0x1e13('0x0'));var emlformat=require(_0x1e13('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1e13('0x2'));var rp=require('request-promise');var moment=require(_0x1e13('0x3'));var BPromise=require(_0x1e13('0x4'));var Mustache=require(_0x1e13('0x5'));var util=require(_0x1e13('0x6'));var path=require(_0x1e13('0x7'));var sox=require(_0x1e13('0x8'));var csv=require(_0x1e13('0x9'));var ejs=require(_0x1e13('0xa'));var fs=require('fs');var _=require(_0x1e13('0xb'));var squel=require(_0x1e13('0xc'));var crypto=require(_0x1e13('0xd'));var jsforce=require(_0x1e13('0xe'));var deskjs=require(_0x1e13('0xf'));var toCsv=require(_0x1e13('0x9'));var querystring=require(_0x1e13('0x10'));var Papa=require('papaparse');var authService=require(_0x1e13('0x11'));var hardwareService=require(_0x1e13('0x12'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1e13('0x13'))(_0x1e13('0x14'));var utils=require(_0x1e13('0x15'));var config=require('../../config/environment');var db=require(_0x1e13('0x16'))['db'];config['redis']=_[_0x1e13('0x17')](config[_0x1e13('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e13('0x19'))(new Redis(config[_0x1e13('0x18')]));require('./openchannelInteraction.socket')[_0x1e13('0x1a')](socket);function respondWithStatusCode(_0x2cc3d0,_0x2c4145){_0x2c4145=_0x2c4145||0xcc;return function(_0x5bf59b){if(_0x5bf59b){return _0x2cc3d0[_0x1e13('0x1b')](_0x2c4145);}return _0x2cc3d0[_0x1e13('0x1c')](_0x2c4145)[_0x1e13('0x1d')]();};}function respondWithResult(_0x164aa8,_0x2f421d){_0x2f421d=_0x2f421d||0xc8;return function(_0x1ea335){if(_0x1ea335){return _0x164aa8[_0x1e13('0x1c')](_0x2f421d)[_0x1e13('0x1e')](_0x1ea335);}};}function respondWithFilteredResult(_0x3a2e1b,_0x2e7c7e){return function(_0x455162){if(_0x455162){var _0x4658c4=_0x455162[_0x1e13('0x1f')],_0x24e0e6=_0x2e7c7e[_0x1e13('0x20')],_0x1cb124=_0x2e7c7e[_0x1e13('0x20')]+_0x2e7c7e[_0x1e13('0x21')],_0x58cfdd;if(_0x1cb124>=_0x4658c4){_0x1cb124=_0x4658c4;_0x58cfdd=0xc8;}else{_0x58cfdd=0xce;}_0x3a2e1b[_0x1e13('0x1c')](_0x58cfdd);return _0x3a2e1b[_0x1e13('0x22')]('Content-Range',_0x24e0e6+'-'+_0x1cb124+'/'+_0x4658c4)[_0x1e13('0x1e')](_0x455162);}return null;};}function patchUpdates(_0x188ee8){return function(_0x40d16d){try{jsonpatch[_0x1e13('0x23')](_0x40d16d,_0x188ee8,!![]);}catch(_0x50cca9){return BPromise[_0x1e13('0x24')](_0x50cca9);}return _0x40d16d[_0x1e13('0x25')]();};}function saveUpdates(_0x19da8b,_0xa564c9){return function(_0xc68a64){if(_0xc68a64){return _0xc68a64[_0x1e13('0x26')](_0x19da8b)[_0x1e13('0x27')](function(_0xf8c8e5){return _0xf8c8e5;});}return null;};}function removeEntity(_0x2e0fba,_0x58551d){return function(_0x2ea1af){if(_0x2ea1af){return _0x2ea1af[_0x1e13('0x28')]()[_0x1e13('0x27')](function(){_0x2e0fba['status'](0xcc)[_0x1e13('0x1d')]();});}};}function handleEntityNotFound(_0x1116fd,_0x5ac152){return function(_0x174e97){if(!_0x174e97){_0x1116fd[_0x1e13('0x1b')](0x194);}return _0x174e97;};}function handleError(_0xbedfe,_0x3d6db8){_0x3d6db8=_0x3d6db8||0x1f4;return function(_0x1fb702){logger['error'](_0x1fb702[_0x1e13('0x29')]);if(_0x1fb702[_0x1e13('0x2a')]){delete _0x1fb702['name'];}_0xbedfe[_0x1e13('0x1c')](_0x3d6db8)[_0x1e13('0x2b')](_0x1fb702);};}exports[_0x1e13('0x2c')]=function(_0xfe4a17,_0x115ba6){var _0x3b5514={},_0x48c564={},_0x1ae09c={'count':0x0,'rows':[]};var _0x41e392=db[_0x1e13('0x2d')]['rawAttributes'];_0x48c564[_0x1e13('0x2e')]=_[_0x1e13('0x2f')](_0x41e392);_0x48c564[_0x1e13('0x30')]=_['keys'](_0xfe4a17[_0x1e13('0x30')]);_0x48c564['filters']=_[_0x1e13('0x31')](_0x48c564['model'],_0x48c564[_0x1e13('0x30')]);_0x3b5514[_0x1e13('0x32')]=_[_0x1e13('0x31')](_0x48c564[_0x1e13('0x2e')],qs[_0x1e13('0x33')](_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x33')]));_0x3b5514['attributes']=_0x3b5514['attributes'][_0x1e13('0x34')]?_0x3b5514[_0x1e13('0x32')]:_0x48c564[_0x1e13('0x2e')];if(!_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x35')](_0x1e13('0x36'))){_0x3b5514[_0x1e13('0x21')]=qs[_0x1e13('0x21')](_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x21')]);_0x3b5514['offset']=qs['offset'](_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x20')]);}_0x3b5514[_0x1e13('0x37')]=qs[_0x1e13('0x38')](_0xfe4a17[_0x1e13('0x30')]['sort']);_0x3b5514['where']=qs['filters'](_[_0x1e13('0x39')](_0xfe4a17[_0x1e13('0x30')],_0x48c564[_0x1e13('0x3a')]));if(_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x3b')]){_0x3b5514['where']=_[_0x1e13('0x3c')](_0x3b5514[_0x1e13('0x3d')],{'$or':_['map'](_0x41e392,function(_0x393a7e){if(_0x393a7e[_0x1e13('0x3e')][_0x1e13('0x3f')]!==_0x1e13('0x40')){var _0x429f11={};_0x429f11[_0x393a7e[_0x1e13('0x41')]]={'$like':'%'+_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x3b')]+'%'};return _0x429f11;}})});}_0x3b5514=_[_0x1e13('0x3c')]({},_0x3b5514,_0xfe4a17['options']);var _0x39834e={'where':_0x3b5514[_0x1e13('0x3d')]};_0x39834e[_0x1e13('0x42')]=[];if(_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x43')]){_0x39834e['include'][_0x1e13('0x44')]({'model':db[_0x1e13('0x45')],'as':'Tags','attributes':['id'],'where':{'id':_0xfe4a17[_0x1e13('0x30')]['tag']},'required':!![]});_0x39834e[_0x1e13('0x46')]=!![];}if(_0xfe4a17['query'][_0x1e13('0x47')]){_0x39834e[_0x1e13('0x42')][_0x1e13('0x44')]({'model':db[_0x1e13('0x48')],'as':_0x1e13('0x49'),'attributes':['id',_0x1e13('0x4a'),_0x1e13('0x4b'),'read'],'where':{'direction':'in','read':_0xfe4a17[_0x1e13('0x30')]['read']||![]},'required':!![]});_0x39834e[_0x1e13('0x46')]=!![];}return db[_0x1e13('0x2d')]['count'](_0x39834e)[_0x1e13('0x27')](function(_0x3c1825){_0x1ae09c[_0x1e13('0x1f')]=_0x3c1825;if(_0xfe4a17['query'][_0x1e13('0x4c')]){_0x3b5514[_0x1e13('0x42')]=[{'model':db[_0x1e13('0x4d')],'as':_0x1e13('0x4e'),'required':![],'attributes':['id',_0x1e13('0x2a'),'fullname']},{'model':db[_0x1e13('0x4f')],'as':'Contact','required':![]},{'model':db[_0x1e13('0x4d')],'as':_0x1e13('0x50'),'attributes':['name','fullname','internal'],'required':![]},{'model':db['OpenchannelAccount'],'as':_0x1e13('0x51'),'attributes':['name',_0x1e13('0x3f')],'required':![]},{'model':db[_0x1e13('0x48')],'as':'Messages','attributes':['id','direction','createdAt',_0x1e13('0x47')],'where':{'direction':'in','read':_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x47')]||![]},'required':_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x47')]||![]},{'model':db[_0x1e13('0x45')],'as':_0x1e13('0x52'),'attributes':['id',_0x1e13('0x2a'),_0x1e13('0x53')],'required':_0xfe4a17[_0x1e13('0x30')][_0x1e13('0x43')]?!![]:![]},{'model':db[_0x1e13('0x45')],'as':'ThroughTags','attributes':['id',_0x1e13('0x2a'),_0x1e13('0x53')],'through':_0xfe4a17[_0x1e13('0x30')]['tag']?{'attributes':[],'where':{'TagId':_0xfe4a17[_0x1e13('0x30')]['tag']||undefined}}:{},'required':_0xfe4a17['query'][_0x1e13('0x43')]?!![]:![]}];}return db[_0x1e13('0x2d')][_0x1e13('0x54')](_0x3b5514);})[_0x1e13('0x27')](function(_0x51b8e2){_0x1ae09c['rows']=_0x51b8e2;return _0x1ae09c;})['then'](respondWithFilteredResult(_0x115ba6,_0x3b5514))['catch'](handleError(_0x115ba6,null));};exports[_0x1e13('0x55')]=function(_0x3fc5c1,_0x42c8b9){var _0x3230e9={'raw':![],'where':{'id':_0x3fc5c1['params']['id']}},_0x11dd46={};_0x11dd46[_0x1e13('0x2e')]=_[_0x1e13('0x2f')](db[_0x1e13('0x2d')][_0x1e13('0x56')]);_0x11dd46[_0x1e13('0x30')]=_[_0x1e13('0x2f')](_0x3fc5c1[_0x1e13('0x30')]);_0x11dd46[_0x1e13('0x3a')]=_[_0x1e13('0x31')](_0x11dd46[_0x1e13('0x2e')],_0x11dd46[_0x1e13('0x30')]);_0x3230e9['attributes']=_[_0x1e13('0x31')](_0x11dd46[_0x1e13('0x2e')],qs[_0x1e13('0x33')](_0x3fc5c1[_0x1e13('0x30')][_0x1e13('0x33')]));_0x3230e9['attributes']=_0x3230e9[_0x1e13('0x32')][_0x1e13('0x34')]?_0x3230e9['attributes']:_0x11dd46[_0x1e13('0x2e')];if(_0x3fc5c1['query'][_0x1e13('0x4c')]){_0x3230e9[_0x1e13('0x42')]=[{'all':!![]}];}_0x3230e9=_[_0x1e13('0x3c')]({},_0x3230e9,_0x3fc5c1[_0x1e13('0x57')]);return db[_0x1e13('0x2d')][_0x1e13('0x58')](_0x3230e9)[_0x1e13('0x27')](handleEntityNotFound(_0x42c8b9,null))['then'](respondWithResult(_0x42c8b9,null))[_0x1e13('0x59')](handleError(_0x42c8b9,null));};exports[_0x1e13('0x5a')]=function(_0x2b7d60,_0x415440){return db[_0x1e13('0x2d')]['create'](_0x2b7d60[_0x1e13('0x5b')],{})[_0x1e13('0x27')](respondWithResult(_0x415440,0xc9))[_0x1e13('0x59')](handleError(_0x415440,null));};exports[_0x1e13('0x26')]=function(_0x5838ff,_0x43625b){if(_0x5838ff[_0x1e13('0x5b')]['id']){delete _0x5838ff['body']['id'];}return db[_0x1e13('0x2d')]['find']({'where':{'id':_0x5838ff[_0x1e13('0x5c')]['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0x43625b,null))[_0x1e13('0x27')](saveUpdates(_0x5838ff[_0x1e13('0x5b')],null))[_0x1e13('0x27')](respondWithResult(_0x43625b,null))[_0x1e13('0x59')](handleError(_0x43625b,null));};exports[_0x1e13('0x28')]=function(_0x2e9267,_0x47e12f){return db[_0x1e13('0x2d')][_0x1e13('0x58')]({'where':{'id':_0x2e9267[_0x1e13('0x5c')]['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0x47e12f,null))[_0x1e13('0x27')](removeEntity(_0x47e12f,null))[_0x1e13('0x59')](handleError(_0x47e12f,null));};exports[_0x1e13('0x5d')]=function(_0xaf3ef,_0x15611f){return db[_0x1e13('0x2d')]['describe']()[_0x1e13('0x27')](respondWithResult(_0x15611f,null))[_0x1e13('0x59')](handleError(_0x15611f,null));};exports[_0x1e13('0x5e')]=function(_0x24292e,_0x499d8b,_0x5318d3){return db[_0x1e13('0x48')][_0x1e13('0x58')]({'where':{'id':_0x24292e['params']['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0x499d8b,null))[_0x1e13('0x27')](function(_0x396bc6){if(_0x396bc6){return _0x396bc6[_0x1e13('0x5e')](_0x24292e['body']['ids'],_['omit'](_0x24292e[_0x1e13('0x5b')],[_0x1e13('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x499d8b,null))['catch'](handleError(_0x499d8b,null));};exports['getMessages']=function(_0x39e4f7,_0x248954,_0x5cb628){var _0x34e399={'raw':![],'where':{}};var _0x9fa6a8={};var _0x4e2567={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1e13('0x60')]({'where':{'id':_0x39e4f7[_0x1e13('0x5c')]['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0x248954,null))[_0x1e13('0x27')](function(_0x5d6063){if(_0x5d6063){_0x9fa6a8[_0x1e13('0x2e')]=_[_0x1e13('0x2f')](db[_0x1e13('0x48')]['rawAttributes']);_0x9fa6a8[_0x1e13('0x30')]=_[_0x1e13('0x2f')](_0x39e4f7[_0x1e13('0x30')]);_0x9fa6a8[_0x1e13('0x3a')]=_[_0x1e13('0x31')](_0x9fa6a8[_0x1e13('0x2e')],_0x9fa6a8[_0x1e13('0x30')]);_0x34e399['attributes']=_[_0x1e13('0x31')](_0x9fa6a8[_0x1e13('0x2e')],qs['fields'](_0x39e4f7[_0x1e13('0x30')][_0x1e13('0x33')]));_0x34e399['attributes']=_0x34e399[_0x1e13('0x32')][_0x1e13('0x34')]?_0x34e399[_0x1e13('0x32')]:_0x9fa6a8[_0x1e13('0x2e')];if(!_0x39e4f7['query'][_0x1e13('0x35')](_0x1e13('0x36'))){_0x34e399['limit']=qs[_0x1e13('0x21')](_0x39e4f7[_0x1e13('0x30')][_0x1e13('0x21')]);_0x34e399[_0x1e13('0x20')]=qs['offset'](_0x39e4f7['query'][_0x1e13('0x20')]);}_0x34e399[_0x1e13('0x37')]=qs['sort'](_0x39e4f7[_0x1e13('0x30')][_0x1e13('0x38')]);_0x34e399[_0x1e13('0x3d')]=qs['filters'](_[_0x1e13('0x39')](_0x39e4f7[_0x1e13('0x30')],_0x9fa6a8[_0x1e13('0x3a')]));_0x34e399[_0x1e13('0x3d')][_0x1e13('0x61')]=_0x5d6063['id'];if(_0x39e4f7['query'][_0x1e13('0x3b')]){_0x34e399['where']=_[_0x1e13('0x3c')](_0x34e399[_0x1e13('0x3d')],{'$or':_['map'](_0x34e399[_0x1e13('0x32')],function(_0x3694a7){var _0x5a47a4={};_0x5a47a4[_0x3694a7]={'$like':'%'+_0x39e4f7[_0x1e13('0x30')]['filter']+'%'};return _0x5a47a4;})});}if(_0x39e4f7[_0x1e13('0x30')]['$gte']){var _0xa0af7f=_0x39e4f7[_0x1e13('0x30')]['$gte'][_0x1e13('0x62')](',');var _0x2b0be4={};_0x2b0be4[_0xa0af7f[0x0]]={'$gte':moment(_0xa0af7f[0x1])['format'](_0x1e13('0x63'))};_0x34e399[_0x1e13('0x3d')]=_['merge'](_0x34e399[_0x1e13('0x3d')],_0x2b0be4);}_0x34e399=_[_0x1e13('0x3c')]({},_0x34e399,_0x39e4f7['options']);return db[_0x1e13('0x48')][_0x1e13('0x1f')]({'where':_0x34e399[_0x1e13('0x3d')]})[_0x1e13('0x27')](function(_0x268861){_0x4e2567[_0x1e13('0x1f')]=_0x268861;if(_0x39e4f7[_0x1e13('0x30')][_0x1e13('0x4c')]){_0x34e399[_0x1e13('0x42')]=[{'all':!![]}];}return db[_0x1e13('0x48')][_0x1e13('0x54')](_0x34e399);})[_0x1e13('0x27')](function(_0x39150f){_0x4e2567[_0x1e13('0x64')]=_0x39150f;return _0x4e2567;});}})[_0x1e13('0x27')](respondWithFilteredResult(_0x248954,_0x34e399))[_0x1e13('0x59')](handleError(_0x248954,null));};exports['addTags']=function(_0x4d9730,_0xb137df,_0x46bcf7){return db[_0x1e13('0x2d')][_0x1e13('0x58')]({'where':{'id':_0x4d9730[_0x1e13('0x5c')]['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0xb137df,null))['then'](function(_0x58ac1f){if(_0x58ac1f){return _0x58ac1f[_0x1e13('0x65')](_0x4d9730[_0x1e13('0x5b')][_0x1e13('0x5f')],_[_0x1e13('0x66')](_0x4d9730[_0x1e13('0x5b')],[_0x1e13('0x5f'),'id'])||{})[_0x1e13('0x67')](function(){return db[_0x1e13('0x45')][_0x1e13('0x54')]({'attributes':['id','name',_0x1e13('0x53')],'where':{'id':_0x4d9730['body']['ids']}});})[_0x1e13('0x27')](function(_0x309d94){socket[_0x1e13('0x68')](_0x1e13('0x69'),{'id':Number(_0x4d9730[_0x1e13('0x5c')]['id']),'tags':_0x309d94||[]});return{'id':Number(_0x4d9730['params']['id']),'tags':_0x309d94||[]};});}})[_0x1e13('0x27')](respondWithResult(_0xb137df,null))[_0x1e13('0x59')](handleError(_0xb137df,null));};exports[_0x1e13('0x6a')]=function(_0x35aa00,_0xb9ce67,_0x5a0699){var _0x5171cf;return db[_0x1e13('0x2d')][_0x1e13('0x58')]({'where':{'id':_0x35aa00[_0x1e13('0x5c')]['id']}})[_0x1e13('0x27')](handleEntityNotFound(_0xb9ce67,null))[_0x1e13('0x27')](function(_0x50b928){if(_0x50b928){return _0x50b928['removeTags'](_0x35aa00[_0x1e13('0x30')][_0x1e13('0x5f')]);}})[_0x1e13('0x27')](respondWithStatusCode(_0xb9ce67,null))[_0x1e13('0x59')](handleError(_0xb9ce67,null));};exports[_0x1e13('0x6b')]=function(_0x419938,_0x57c289){var _0x153443=moment()[_0x1e13('0x6c')]()['toString']();var _0x1788dd=path[_0x1e13('0x6d')](config[_0x1e13('0x6e')],_0x1e13('0x6f'),'files','tmp');var _0x45167d=path[_0x1e13('0x6d')](config['root'],_0x1e13('0x6f'),_0x1e13('0x70'),_0x1e13('0x71'));var _0x5ec74d=path[_0x1e13('0x6d')](_0x1788dd,_0x153443);var _0x4ab356=util[_0x1e13('0x72')](_0x1e13('0x73'),_0x153443);var _0x1eec4b=path[_0x1e13('0x6d')](_0x1788dd,_0x4ab356);var _0x5e6cac=![];return db[_0x1e13('0x2d')][_0x1e13('0x58')]({'where':{'id':_0x419938[_0x1e13('0x5c')]['id']},'include':[{'model':db[_0x1e13('0x48')],'as':_0x1e13('0x49'),'attributes':['id',_0x1e13('0x5b')],'include':[{'model':db[_0x1e13('0x4d')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x1e13('0x74'),'attributes':['id',_0x1e13('0x75')],'raw':!![]},{'model':db[_0x1e13('0x76')],'as':_0x1e13('0x76'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x57c289,null))[_0x1e13('0x27')](function(_0x405332){if(_0x405332){_0x5e6cac=!![];var _0xc4daf4='';var _0x107f2e={'format':_0x1e13('0x77'),'border':_0x1e13('0x78')};fs[_0x1e13('0x79')](_0x5ec74d);_0xc4daf4+=util[_0x1e13('0x72')](_0x1e13('0x7a'),_0x405332['id']);_0xc4daf4+=util[_0x1e13('0x72')]('

Date:\x20%s

',moment()['format']('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')[_0x1e13('0x7b')]());_0xc4daf4+='
';for(var _0x41c2ee=0x0;_0x41c2ee<_0x405332[_0x1e13('0x49')][_0x1e13('0x34')];_0x41c2ee++){var _0x514a2e=_0x405332[_0x1e13('0x49')][_0x41c2ee];_0xc4daf4+='';_0xc4daf4+=util[_0x1e13('0x72')](_0x1e13('0x7c'),_0x514a2e['User']?_0x514a2e[_0x1e13('0x4d')]['fullname']:_0x514a2e[_0x1e13('0x74')][_0x1e13('0x75')],_0x514a2e['body']);_0xc4daf4+='';if(_0x514a2e['Attachment']){var _0x1aa321=_0x514a2e['Attachment'];var _0x3e532e=path[_0x1e13('0x6d')](_0x45167d,_0x1aa321[_0x1e13('0x7d')]);if(fs[_0x1e13('0x7e')](_0x3e532e)){fs['createReadStream'](_0x3e532e)['pipe'](fs[_0x1e13('0x7f')](path[_0x1e13('0x6d')](_0x5ec74d,_0x1aa321[_0x1e13('0x7d')])));}}}return new BPromise(function(_0x31d27c,_0x22b1b5){pdf[_0x1e13('0x5a')](_0xc4daf4,_0x107f2e)[_0x1e13('0x80')](path['join'](_0x5ec74d,_0x1e13('0x81')+_0x153443+'.pdf'),function(_0x3449b6,_0x59e177){if(_0x3449b6)return _0x22b1b5(_0x3449b6);_0x31d27c(_0x59e177);});});}})['then'](function(){if(_0x5e6cac){return new BPromise(function(_0x7ecae8,_0x248098){zipdir(_0x5ec74d,{'saveTo':_0x1eec4b},function(_0x575d03,_0x1878fd){if(_0x575d03)return _0x248098(_0x575d03);return _0x7ecae8(_0x1878fd);});});}})[_0x1e13('0x27')](function(){if(_0x5e6cac){return new BPromise(function(_0x1c1940,_0xa75492){rimraf(_0x5ec74d,function(_0x4c35ba){if(_0x4c35ba)_0xa75492(_0x4c35ba);return _0x1c1940();});});}})['then'](function(){if(_0x5e6cac){return _0x57c289[_0x1e13('0x6b')](_0x1eec4b,_0x4ab356,function(_0x5974ab){if(_0x5974ab){console['log'](_0x1e13('0x82'),_0x5974ab);}else{fs[_0x1e13('0x83')](_0x1eec4b);}});}else{return _0x57c289[_0x1e13('0x1b')](0xc8);}})[_0x1e13('0x59')](handleError(_0x57c289,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5828fd5..eee6029 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 _0x83d4=['setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x44fb11,_0x521514){var _0x120b83=function(_0x2c7247){while(--_0x2c7247){_0x44fb11['push'](_0x44fb11['shift']());}};_0x120b83(++_0x521514);}(_0x83d4,0x64));var _0x483d=function(_0x197ee9,_0x51164f){_0x197ee9=_0x197ee9-0x0;var _0x5c0f7b=_0x83d4[_0x197ee9];return _0x5c0f7b;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x483d('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x483d('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1cb9c0){return function(_0x4c0d2c,_0xb0b37d,_0x4fc1a3){OpenchannelInteractionEvents['emit'](_0x1cb9c0+':'+_0x4c0d2c['id'],_0x4c0d2c);OpenchannelInteractionEvents[_0x483d('0x2')](_0x1cb9c0,_0x4c0d2c);_0x4fc1a3(null);};}for(var e in events){if(events[_0x483d('0x3')](e)){var event=events[e];OpenchannelInteraction[_0x483d('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xd676=['../../mysqldb','OpenchannelInteraction','save','update','emit','hasOwnProperty','hook'];(function(_0x1acd82,_0x48f1d4){var _0x2e46ed=function(_0x4ce460){while(--_0x4ce460){_0x1acd82['push'](_0x1acd82['shift']());}};_0x2e46ed(++_0x48f1d4);}(_0xd676,0x126));var _0x6d67=function(_0x1e2f72,_0x4ecd3d){_0x1e2f72=_0x1e2f72-0x0;var _0x2f00a8=_0xd676[_0x1e2f72];return _0x2f00a8;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x6d67('0x0'))['db'][_0x6d67('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d67('0x2'),'afterUpdate':_0x6d67('0x3'),'afterDestroy':'remove'};function emitEvent(_0x138919){return function(_0x1b85c2,_0xc655eb,_0x196e58){OpenchannelInteractionEvents['emit'](_0x138919+':'+_0x1b85c2['id'],_0x1b85c2);OpenchannelInteractionEvents[_0x6d67('0x4')](_0x138919,_0x1b85c2);_0x196e58(null);};}for(var e in events){if(events[_0x6d67('0x5')](e)){var event=events[e];OpenchannelInteraction[_0x6d67('0x6')](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 0c8e9d1..8f6e53f 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 _0xf068=['define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x31bdff,_0x21a396){var _0x1600bd=function(_0x3184f1){while(--_0x3184f1){_0x31bdff['push'](_0x31bdff['shift']());}};_0x1600bd(++_0x21a396);}(_0xf068,0x1e3));var _0x8f06=function(_0x979264,_0x453dd8){_0x979264=_0x979264-0x0;var _0x27774e=_0xf068[_0x979264];return _0x27774e;};'use strict';var _=require(_0x8f06('0x0'));var util=require(_0x8f06('0x1'));var logger=require(_0x8f06('0x2'))(_0x8f06('0x3'));var moment=require(_0x8f06('0x4'));var BPromise=require(_0x8f06('0x5'));var rp=require('request-promise');var attributes=require('./openchannelInteraction.attributes');module[_0x8f06('0x6')]=function(_0x30d323,_0x3c55bf){return _0x30d323[_0x8f06('0x7')](_0x8f06('0x8'),attributes,{'tableName':_0x8f06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcce8d7,_0x4bb7b3,_0x3154a6){if(_0xcce8d7[_0x8f06('0xa')](_0x8f06('0xb'))){_0xcce8d7[_0x8f06('0xc')]=moment()['format'](_0x8f06('0xd'));}_0x3154a6(null,_0xcce8d7);}}});}; \ No newline at end of file +var _0x8f85=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','request-promise','exports','define','OpenchannelInteraction','openchannel_interactions'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x8f85,0x1c0));var _0x58f8=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8f85[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x58f8('0x0'));var util=require(_0x58f8('0x1'));var logger=require(_0x58f8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58f8('0x3'));var attributes=require('./openchannelInteraction.attributes');module[_0x58f8('0x4')]=function(_0x1051d7,_0x21e7d5){return _0x1051d7[_0x58f8('0x5')](_0x58f8('0x6'),attributes,{'tableName':_0x58f8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37783a,_0xe3c38c,_0x51accc){if(_0x37783a[_0x58f8('0x8')](_0x58f8('0x9'))){_0x37783a['closedAt']=moment()[_0x58f8('0xa')](_0x58f8('0xb'));}_0x51accc(null,_0x37783a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4ad7cf9..74d8991 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 _0x7278=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','AddTagsToOpenchannelInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7278,0x161));var _0x8727=function(_0xb7c5fd,_0x22dd75){_0xb7c5fd=_0xb7c5fd-0x0;var _0xf13899=_0x7278[_0xb7c5fd];return _0xf13899;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});config[_0x8727('0xc')]=_[_0x8727('0xd')](config[_0x8727('0xc')],{'host':_0x8727('0xe'),'port':0x18eb});var socket=require(_0x8727('0xf'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xb575a3,_0x336193,_0x3a6c9b){return new BPromise(function(_0x280fb3,_0x3ff244){return client[_0x8727('0x10')](_0xb575a3,_0x3a6c9b)[_0x8727('0x11')](function(_0xefa0bf){logger['info'](_0x8727('0x12'),_0x336193,_0x8727('0x13'));logger[_0x8727('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x336193,_0x8727('0x13'),JSON[_0x8727('0x15')](_0xefa0bf));if(_0xefa0bf['error']){if(_0xefa0bf[_0x8727('0x16')][_0x8727('0x17')]===0x1f4){logger[_0x8727('0x16')](_0x8727('0x12'),_0x336193,_0xefa0bf[_0x8727('0x16')][_0x8727('0x18')]);return _0x3ff244(_0xefa0bf[_0x8727('0x16')][_0x8727('0x18')]);}logger[_0x8727('0x16')](_0x8727('0x12'),_0x336193,_0xefa0bf['error'][_0x8727('0x18')]);return _0x280fb3(_0xefa0bf[_0x8727('0x16')][_0x8727('0x18')]);}else{logger[_0x8727('0x19')](_0x8727('0x12'),_0x336193,_0x8727('0x13'));_0x280fb3(_0xefa0bf['result']['message']);}})[_0x8727('0x1a')](function(_0x4a0a7d){logger[_0x8727('0x16')](_0x8727('0x12'),_0x336193,_0x4a0a7d);_0x3ff244(_0x4a0a7d);});});}exports[_0x8727('0x1b')]=function(_0x22e6c9){var _0x2dae91=this;return new Promise(function(_0x537aaf,_0x6e552f){return db[_0x8727('0x1c')][_0x8727('0x1d')](_0x22e6c9[_0x8727('0x1e')],{'raw':_0x22e6c9[_0x8727('0x1f')]?_0x22e6c9[_0x8727('0x1f')][_0x8727('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22e6c9[_0x8727('0x1f')]?_0x22e6c9[_0x8727('0x1f')][_0x8727('0x21')]||null:null,'attributes':_0x22e6c9[_0x8727('0x1f')]?_0x22e6c9[_0x8727('0x1f')]['attributes']||null:null,'limit':_0x22e6c9[_0x8727('0x1f')]?_0x22e6c9[_0x8727('0x1f')]['limit']||null:null})['then'](function(_0x3df7f2){logger[_0x8727('0x19')](_0x8727('0x1b'),_0x22e6c9);logger['debug'](_0x8727('0x1b'),_0x22e6c9,JSON[_0x8727('0x15')](_0x3df7f2));_0x537aaf(_0x3df7f2);})[_0x8727('0x1a')](function(_0x440ff5){logger[_0x8727('0x16')](_0x8727('0x1b'),_0x440ff5[_0x8727('0x18')],_0x22e6c9);_0x6e552f(_0x2dae91[_0x8727('0x16')](0x1f4,_0x440ff5['message']));});});};exports[_0x8727('0x22')]=function(_0x307055){return new Promise(function(_0x54034d,_0x23325f){return db[_0x8727('0x1c')][_0x8727('0x23')]({'where':_0x307055[_0x8727('0x1f')]?_0x307055[_0x8727('0x1f')][_0x8727('0x21')]||null:null})['then'](function(_0x332ebe){if(_0x332ebe){return _0x332ebe['addTags'](_0x307055[_0x8727('0x1e')]['ids'],_[_0x8727('0x24')](_0x307055[_0x8727('0x1e')],[_0x8727('0x25'),'id'])||{});}})[_0x8727('0x26')](function(_0x410240){logger[_0x8727('0x19')](_0x8727('0x27'),_0x307055);logger['debug'](_0x8727('0x27'),_0x307055,JSON[_0x8727('0x15')](_0x410240));_0x54034d(_0x410240);})[_0x8727('0x1a')](function(_0x1b047a){logger[_0x8727('0x16')](_0x8727('0x27'),_0x1b047a[_0x8727('0x18')],_0x307055);_0x23325f(_this[_0x8727('0x16')](0x1f4,_0x1b047a[_0x8727('0x18')]));});});}; \ No newline at end of file +var _0xfdbd=['catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','limit','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x315d60,_0x4b336e){var _0x1d0df8=function(_0x33cefe){while(--_0x33cefe){_0x315d60['push'](_0x315d60['shift']());}};_0x1d0df8(++_0x4b336e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0xfdbd[_0xf33afd];return _0x5f432a;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdfdb('0xc'),'port':0x18eb});var socket=require(_0xdfdb('0xd'))(new Redis(config['redis']));require(_0xdfdb('0xe'))[_0xdfdb('0xf')](socket);function respondWithRpcPromise(_0x24eb73,_0x27ddcd,_0x3a44a9){return new BPromise(function(_0x1ace28,_0x2bb8d4){return client['request'](_0x24eb73,_0x3a44a9)[_0xdfdb('0x10')](function(_0x1972db){logger['info'](_0xdfdb('0x11'),_0x27ddcd,_0xdfdb('0x12'));logger[_0xdfdb('0x13')](_0xdfdb('0x14'),_0x27ddcd,_0xdfdb('0x12'),JSON[_0xdfdb('0x15')](_0x1972db));if(_0x1972db[_0xdfdb('0x16')]){if(_0x1972db[_0xdfdb('0x16')]['code']===0x1f4){logger['error'](_0xdfdb('0x11'),_0x27ddcd,_0x1972db['error'][_0xdfdb('0x17')]);return _0x2bb8d4(_0x1972db[_0xdfdb('0x16')][_0xdfdb('0x17')]);}logger[_0xdfdb('0x16')](_0xdfdb('0x11'),_0x27ddcd,_0x1972db[_0xdfdb('0x16')]['message']);return _0x1ace28(_0x1972db['error'][_0xdfdb('0x17')]);}else{logger[_0xdfdb('0x18')](_0xdfdb('0x11'),_0x27ddcd,'request\x20sent');_0x1ace28(_0x1972db[_0xdfdb('0x19')][_0xdfdb('0x17')]);}})[_0xdfdb('0x1a')](function(_0xd60a30){logger[_0xdfdb('0x16')](_0xdfdb('0x11'),_0x27ddcd,_0xd60a30);_0x2bb8d4(_0xd60a30);});});}exports[_0xdfdb('0x1b')]=function(_0x29a639){var _0x5b8cb5=this;return new Promise(function(_0x14638a,_0xb7417c){return db[_0xdfdb('0x1c')]['update'](_0x29a639[_0xdfdb('0x1d')],{'raw':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')][_0xdfdb('0x1f')]||null:null,'attributes':_0x29a639['options']?_0x29a639[_0xdfdb('0x1e')]['attributes']||null:null,'limit':_0x29a639[_0xdfdb('0x1e')]?_0x29a639[_0xdfdb('0x1e')][_0xdfdb('0x20')]||null:null})[_0xdfdb('0x10')](function(_0x4f69cf){logger[_0xdfdb('0x18')](_0xdfdb('0x1b'),_0x29a639);logger[_0xdfdb('0x13')](_0xdfdb('0x1b'),_0x29a639,JSON[_0xdfdb('0x15')](_0x4f69cf));_0x14638a(_0x4f69cf);})[_0xdfdb('0x1a')](function(_0x57d24f){logger[_0xdfdb('0x16')](_0xdfdb('0x1b'),_0x57d24f[_0xdfdb('0x17')],_0x29a639);_0xb7417c(_0x5b8cb5['error'](0x1f4,_0x57d24f[_0xdfdb('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xd0cef0){return new Promise(function(_0x1aec66,_0x19c36f){return db['OpenchannelInteraction']['find']({'where':_0xd0cef0[_0xdfdb('0x1e')]?_0xd0cef0[_0xdfdb('0x1e')][_0xdfdb('0x1f')]||null:null})[_0xdfdb('0x10')](function(_0x371b69){if(_0x371b69){return _0x371b69[_0xdfdb('0x21')](_0xd0cef0['body'][_0xdfdb('0x22')],_[_0xdfdb('0x23')](_0xd0cef0[_0xdfdb('0x1d')],[_0xdfdb('0x22'),'id'])||{});}})[_0xdfdb('0x24')](function(_0x157de8){logger[_0xdfdb('0x18')](_0xdfdb('0x25'),_0xd0cef0);logger[_0xdfdb('0x13')](_0xdfdb('0x25'),_0xd0cef0,JSON[_0xdfdb('0x15')](_0x157de8));_0x1aec66(_0x157de8);})['catch'](function(_0x4dadad){logger[_0xdfdb('0x16')]('AddTags',_0x4dadad[_0xdfdb('0x17')],_0xd0cef0);_0x19c36f(_this[_0xdfdb('0x16')](0x1f4,_0x4dadad[_0xdfdb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0f44da5..0e060d0 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 _0x41e8=['emit','removeListener','length','save','remove','update'];(function(_0x3b9380,_0x502c0e){var _0x35ef00=function(_0x36e66e){while(--_0x36e66e){_0x3b9380['push'](_0x3b9380['shift']());}};_0x35ef00(++_0x502c0e);}(_0x41e8,0x135));var _0x841e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x41e8[_0x134c2e];return _0x2825db;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x841e('0x0'),_0x841e('0x1'),_0x841e('0x2')];function createListener(_0x35da27,_0x291a57){return function(_0x41e4ce){_0x291a57[_0x841e('0x3')](_0x35da27,_0x41e4ce);};}function removeListener(_0x5158a0,_0x423a11){return function(){OpenchannelInteractionEvents[_0x841e('0x4')](_0x5158a0,_0x423a11);};}exports['register']=function(_0x1a12ea){for(var _0x54b7d8=0x0,_0x389489=events[_0x841e('0x5')];_0x54b7d8<_0x389489;_0x54b7d8++){var _0x13d1f0=events[_0x54b7d8];var _0x535215=createListener('openchannelInteraction:'+_0x13d1f0,_0x1a12ea);OpenchannelInteractionEvents['on'](_0x13d1f0,_0x535215);}}; \ No newline at end of file +var _0x479d=['openchannelInteraction:','save','remove','update','emit','removeListener','register','length'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x479d,0x171));var _0xd479=function(_0x1f254f,_0x484c21){_0x1f254f=_0x1f254f-0x0;var _0x1fe81e=_0x479d[_0x1f254f];return _0x1fe81e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xd479('0x0'),_0xd479('0x1'),_0xd479('0x2')];function createListener(_0xf4949e,_0x159047){return function(_0x470601){_0x159047[_0xd479('0x3')](_0xf4949e,_0x470601);};}function removeListener(_0x47560a,_0x4e8d58){return function(){OpenchannelInteractionEvents[_0xd479('0x4')](_0x47560a,_0x4e8d58);};}exports[_0xd479('0x5')]=function(_0x7c6ce5){for(var _0x13a16e=0x0,_0xa111e0=events[_0xd479('0x6')];_0x13a16e<_0xa111e0;_0x13a16e++){var _0x5bfe6a=events[_0x13a16e];var _0x23bf85=createListener(_0xd479('0x7')+_0x5bfe6a,_0x7c6ce5);OpenchannelInteractionEvents['on'](_0x5bfe6a,_0x23bf85);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 7670975..f4827b4 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 _0xb701=['delete','destroy','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','openchannelmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x2acd6a,_0x104af7){var _0x3f3bab=function(_0x4f9684){while(--_0x4f9684){_0x2acd6a['push'](_0x2acd6a['shift']());}};_0x3f3bab(++_0x104af7);}(_0xb701,0x144));var _0x1b70=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb701[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x1b70('0x0'));var path=require('path');var timeout=require(_0x1b70('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x1b70('0x2'));var interaction=require(_0x1b70('0x3'));var config=require(_0x1b70('0x4'));var controller=require(_0x1b70('0x5'));router[_0x1b70('0x6')]('/',auth[_0x1b70('0x7')](),controller[_0x1b70('0x8')]);router[_0x1b70('0x6')](_0x1b70('0x9'),auth[_0x1b70('0x7')](),controller['describe']);router[_0x1b70('0x6')](_0x1b70('0xa'),auth[_0x1b70('0x7')](),controller[_0x1b70('0xb')]);router[_0x1b70('0xc')]('/',auth[_0x1b70('0x7')](),interaction[_0x1b70('0xd')]('openchannel',_0x1b70('0xe')),controller[_0x1b70('0xf')]);router[_0x1b70('0x10')](_0x1b70('0xa'),auth[_0x1b70('0x7')](),controller[_0x1b70('0x11')]);router[_0x1b70('0x10')](_0x1b70('0x12'),auth[_0x1b70('0x7')](),controller[_0x1b70('0x13')]);router[_0x1b70('0x10')](_0x1b70('0x14'),auth[_0x1b70('0x7')](),controller['reject']);router[_0x1b70('0x15')](_0x1b70('0xa'),auth[_0x1b70('0x7')](),controller[_0x1b70('0x16')]);module['exports']=router; \ No newline at end of file +var _0xa88b=['accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe','show','tracked','openchannel','openchannelmessage:create','create','/:id','update','put'];(function(_0x37d485,_0x5a606d){var _0x3a5904=function(_0x492f2e){while(--_0x492f2e){_0x37d485['push'](_0x37d485['shift']());}};_0x3a5904(++_0x5a606d);}(_0xa88b,0x157));var _0xba88=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0xa88b[_0x511b76];return _0x5424ff;};'use strict';var multer=require(_0xba88('0x0'));var util=require(_0xba88('0x1'));var path=require(_0xba88('0x2'));var timeout=require(_0xba88('0x3'));var express=require(_0xba88('0x4'));var router=express[_0xba88('0x5')]();var auth=require(_0xba88('0x6'));var interaction=require(_0xba88('0x7'));var config=require(_0xba88('0x8'));var controller=require(_0xba88('0x9'));router[_0xba88('0xa')]('/',auth[_0xba88('0xb')](),controller['index']);router['get'](_0xba88('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba88('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xba88('0xd')]);router['post']('/',auth[_0xba88('0xb')](),interaction[_0xba88('0xe')](_0xba88('0xf'),_0xba88('0x10')),controller[_0xba88('0x11')]);router['put'](_0xba88('0x12'),auth[_0xba88('0xb')](),controller[_0xba88('0x13')]);router[_0xba88('0x14')]('/:id/accept',auth[_0xba88('0xb')](),controller[_0xba88('0x15')]);router[_0xba88('0x14')](_0xba88('0x16'),auth[_0xba88('0xb')](),controller[_0xba88('0x17')]);router[_0xba88('0x18')](_0xba88('0x12'),auth[_0xba88('0xb')](),controller['destroy']);module[_0xba88('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 4bdd342..f921b92 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 _0x65eb=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x2c7fa7,_0x3fdaad){var _0x5bbb69=function(_0x30b561){while(--_0x30b561){_0x2c7fa7['push'](_0x2c7fa7['shift']());}};_0x5bbb69(++_0x3fdaad);}(_0x65eb,0x11e));var _0xb65e=function(_0x31e51d,_0x6c6746){_0x31e51d=_0x31e51d-0x0;var _0x2c31b7=_0x65eb[_0x31e51d];return _0x2c31b7;};'use strict';var Sequelize=require(_0xb65e('0x0'));module['exports']={'body':{'type':Sequelize[_0xb65e('0x1')](_0xb65e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb65e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb65e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb65e('0x4')]('in','out'),'defaultValue':_0xb65e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb65e('0x6')]}}; \ No newline at end of file +var _0xc765=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xc765,0x131));var _0x5c76=function(_0x2ff211,_0x4fcaba){_0x2ff211=_0x2ff211-0x0;var _0x558066=_0xc765[_0x2ff211];return _0x558066;};'use strict';var Sequelize=require('sequelize');module[_0x5c76('0x0')]={'body':{'type':Sequelize[_0x5c76('0x1')](_0x5c76('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5c76('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5c76('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c76('0x4')]('in',_0x5c76('0x5')),'defaultValue':_0x5c76('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5c76('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index d988af4..a2660f5 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 _0xaf10=['../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','read1stAt','format','interaction','role','stringify','null','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xaf10,0x153));var _0x0af1=function(_0x481be0,_0x56c560){_0x481be0=_0x481be0-0x0;var _0x17e0f8=_0xaf10[_0x481be0];return _0x17e0f8;};'use strict';var pdf=require(_0x0af1('0x0'));var emlformat=require(_0x0af1('0x1'));var rimraf=require(_0x0af1('0x2'));var zipdir=require(_0x0af1('0x3'));var jsonpatch=require(_0x0af1('0x4'));var rp=require(_0x0af1('0x5'));var moment=require('moment');var BPromise=require(_0x0af1('0x6'));var Mustache=require(_0x0af1('0x7'));var util=require(_0x0af1('0x8'));var path=require(_0x0af1('0x9'));var sox=require(_0x0af1('0xa'));var csv=require(_0x0af1('0xb'));var ejs=require(_0x0af1('0xc'));var fs=require('fs');var _=require(_0x0af1('0xd'));var squel=require(_0x0af1('0xe'));var crypto=require('crypto');var jsforce=require(_0x0af1('0xf'));var deskjs=require(_0x0af1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0af1('0x11'));var Papa=require(_0x0af1('0x12'));var authService=require(_0x0af1('0x13'));var hardwareService=require(_0x0af1('0x14'));var Redis=require(_0x0af1('0x15'));var qs=require(_0x0af1('0x16'));var logger=require(_0x0af1('0x17'))(_0x0af1('0x18'));var utils=require(_0x0af1('0x19'));var config=require(_0x0af1('0x1a'));var db=require(_0x0af1('0x1b'))['db'];config[_0x0af1('0x1c')]=_[_0x0af1('0x1d')](config[_0x0af1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0af1('0x1e'))(new Redis(config[_0x0af1('0x1c')]));require(_0x0af1('0x1f'))[_0x0af1('0x20')](socket);var jayson=require(_0x0af1('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0af1('0x22')][_0x0af1('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x3c1d20,_0x2517b4,_0x3626ee,_0x37b27b){return new BPromise(function(_0x5399ae,_0x260d0d){var _0x4f5c59=_0x37b27b||client;return _0x4f5c59[_0x0af1('0x24')](_0x3c1d20,_0x3626ee)[_0x0af1('0x25')](function(_0x2a705d){logger[_0x0af1('0x26')](_0x0af1('0x27'),_0x2517b4,_0x0af1('0x28'));logger[_0x0af1('0x29')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2517b4,_0x0af1('0x28'),JSON['stringify'](_0x2a705d));if(_0x2a705d[_0x0af1('0x2a')]){if(_0x2a705d[_0x0af1('0x2a')][_0x0af1('0x2b')]===0x1f4){logger[_0x0af1('0x2a')](_0x0af1('0x27'),_0x2517b4,_0x2a705d[_0x0af1('0x2a')][_0x0af1('0x2c')]);return _0x260d0d(_0x2a705d[_0x0af1('0x2a')]['message']);}logger[_0x0af1('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x2517b4,_0x2a705d[_0x0af1('0x2a')]['message']);return _0x5399ae(_0x2a705d[_0x0af1('0x2a')][_0x0af1('0x2c')]);}else{logger[_0x0af1('0x26')](_0x0af1('0x27'),_0x2517b4,_0x0af1('0x28'));_0x5399ae(_0x2a705d[_0x0af1('0x2d')]['message']);}})['catch'](function(_0x48fcf4){logger[_0x0af1('0x2a')](_0x0af1('0x27'),_0x2517b4,_0x48fcf4);_0x260d0d(_0x48fcf4);});});}function respondWithStatusCode(_0x4a5582,_0x3870d2){_0x3870d2=_0x3870d2||0xcc;return function(_0x2c9d21){if(_0x2c9d21){return _0x4a5582['sendStatus'](_0x3870d2);}return _0x4a5582[_0x0af1('0x2e')](_0x3870d2)[_0x0af1('0x2f')]();};}function respondWithResult(_0x4c7cb6,_0x32fd8b){_0x32fd8b=_0x32fd8b||0xc8;return function(_0x20dea1){if(_0x20dea1){return _0x4c7cb6['status'](_0x32fd8b)[_0x0af1('0x30')](_0x20dea1);}};}function respondWithFilteredResult(_0x847673,_0x4fc7f3){return function(_0x52371c){if(_0x52371c){var _0x13eb9=_0x52371c['count'],_0x438100=_0x4fc7f3[_0x0af1('0x31')],_0x12c67a=_0x4fc7f3[_0x0af1('0x31')]+_0x4fc7f3[_0x0af1('0x32')],_0xbb92cd;if(_0x12c67a>=_0x13eb9){_0x12c67a=_0x13eb9;_0xbb92cd=0xc8;}else{_0xbb92cd=0xce;}_0x847673[_0x0af1('0x2e')](_0xbb92cd);return _0x847673[_0x0af1('0x33')](_0x0af1('0x34'),_0x438100+'-'+_0x12c67a+'/'+_0x13eb9)[_0x0af1('0x30')](_0x52371c);}return null;};}function patchUpdates(_0x486c40){return function(_0x448cd8){try{jsonpatch[_0x0af1('0x35')](_0x448cd8,_0x486c40,!![]);}catch(_0x101d3d){return BPromise[_0x0af1('0x36')](_0x101d3d);}return _0x448cd8[_0x0af1('0x37')]();};}function saveUpdates(_0x4ef1e7,_0x5ee13d){return function(_0x2e7073){if(_0x2e7073){return _0x2e7073[_0x0af1('0x38')](_0x4ef1e7)['then'](function(_0x33d9c1){return _0x33d9c1;});}return null;};}function removeEntity(_0x42b21f,_0x13bce0){return function(_0x1ee513){if(_0x1ee513){return _0x1ee513[_0x0af1('0x39')]()[_0x0af1('0x25')](function(){_0x42b21f[_0x0af1('0x2e')](0xcc)[_0x0af1('0x2f')]();});}};}function handleEntityNotFound(_0x597933,_0x44e081){return function(_0x4cdea9){if(!_0x4cdea9){_0x597933[_0x0af1('0x3a')](0x194);}return _0x4cdea9;};}function handleError(_0x15d863,_0x1a237a){_0x1a237a=_0x1a237a||0x1f4;return function(_0x42d609){logger['error'](_0x42d609[_0x0af1('0x3b')]);if(_0x42d609[_0x0af1('0x3c')]){delete _0x42d609[_0x0af1('0x3c')];}_0x15d863[_0x0af1('0x2e')](_0x1a237a)[_0x0af1('0x3d')](_0x42d609);};}exports['index']=function(_0x3d3902,_0x200917){var _0x55bc1a={},_0x5eb621={},_0x272aa9={'count':0x0,'rows':[]};var _0x18465=db[_0x0af1('0x3e')][_0x0af1('0x3f')];_0x5eb621[_0x0af1('0x40')]=_[_0x0af1('0x41')](_0x18465);_0x5eb621[_0x0af1('0x42')]=_[_0x0af1('0x41')](_0x3d3902[_0x0af1('0x42')]);_0x5eb621[_0x0af1('0x43')]=_[_0x0af1('0x44')](_0x5eb621[_0x0af1('0x40')],_0x5eb621[_0x0af1('0x42')]);_0x55bc1a['attributes']=_[_0x0af1('0x44')](_0x5eb621[_0x0af1('0x40')],qs[_0x0af1('0x45')](_0x3d3902[_0x0af1('0x42')][_0x0af1('0x45')]));_0x55bc1a[_0x0af1('0x46')]=_0x55bc1a[_0x0af1('0x46')][_0x0af1('0x47')]?_0x55bc1a[_0x0af1('0x46')]:_0x5eb621[_0x0af1('0x40')];if(!_0x3d3902['query'][_0x0af1('0x48')]('nolimit')){_0x55bc1a[_0x0af1('0x32')]=qs[_0x0af1('0x32')](_0x3d3902[_0x0af1('0x42')]['limit']);_0x55bc1a[_0x0af1('0x31')]=qs[_0x0af1('0x31')](_0x3d3902['query']['offset']);}_0x55bc1a[_0x0af1('0x49')]=qs[_0x0af1('0x4a')](_0x3d3902[_0x0af1('0x42')][_0x0af1('0x4a')]);_0x55bc1a[_0x0af1('0x4b')]=qs[_0x0af1('0x43')](_[_0x0af1('0x4c')](_0x3d3902[_0x0af1('0x42')],_0x5eb621[_0x0af1('0x43')]));if(_0x3d3902[_0x0af1('0x42')][_0x0af1('0x4d')]){_0x55bc1a[_0x0af1('0x4b')]=_[_0x0af1('0x4e')](_0x55bc1a[_0x0af1('0x4b')],{'$or':_[_0x0af1('0x4f')](_0x18465,function(_0x4a8540){if(_0x4a8540[_0x0af1('0x50')]['key']!==_0x0af1('0x51')){var _0x40d245={};_0x40d245[_0x4a8540[_0x0af1('0x52')]]={'$like':'%'+_0x3d3902[_0x0af1('0x42')][_0x0af1('0x4d')]+'%'};return _0x40d245;}})});}_0x55bc1a=_['merge']({},_0x55bc1a,_0x3d3902[_0x0af1('0x53')]);var _0xd916c5={'where':_0x55bc1a[_0x0af1('0x4b')]};return db['OpenchannelMessage']['count'](_0xd916c5)[_0x0af1('0x25')](function(_0x215b11){_0x272aa9['count']=_0x215b11;if(_0x3d3902['query'][_0x0af1('0x54')]){_0x55bc1a[_0x0af1('0x55')]=[{'all':!![]}];}return db[_0x0af1('0x3e')][_0x0af1('0x56')](_0x55bc1a);})[_0x0af1('0x25')](function(_0x2eddaa){_0x272aa9[_0x0af1('0x57')]=_0x2eddaa;return _0x272aa9;})['then'](respondWithFilteredResult(_0x200917,_0x55bc1a))['catch'](handleError(_0x200917,null));};exports[_0x0af1('0x58')]=function(_0x50e517,_0x5e6049){var _0x201ae6={'raw':!![],'where':{'id':_0x50e517[_0x0af1('0x59')]['id']}},_0x132a8f={};_0x132a8f['model']=_[_0x0af1('0x41')](db[_0x0af1('0x3e')][_0x0af1('0x3f')]);_0x132a8f['query']=_[_0x0af1('0x41')](_0x50e517[_0x0af1('0x42')]);_0x132a8f['filters']=_[_0x0af1('0x44')](_0x132a8f[_0x0af1('0x40')],_0x132a8f[_0x0af1('0x42')]);_0x201ae6[_0x0af1('0x46')]=_[_0x0af1('0x44')](_0x132a8f[_0x0af1('0x40')],qs[_0x0af1('0x45')](_0x50e517[_0x0af1('0x42')][_0x0af1('0x45')]));_0x201ae6[_0x0af1('0x46')]=_0x201ae6[_0x0af1('0x46')][_0x0af1('0x47')]?_0x201ae6[_0x0af1('0x46')]:_0x132a8f[_0x0af1('0x40')];if(_0x50e517[_0x0af1('0x42')][_0x0af1('0x54')]){_0x201ae6[_0x0af1('0x55')]=[{'all':!![]}];}_0x201ae6=_['merge']({},_0x201ae6,_0x50e517['options']);return db[_0x0af1('0x3e')]['find'](_0x201ae6)[_0x0af1('0x25')](handleEntityNotFound(_0x5e6049,null))[_0x0af1('0x25')](respondWithResult(_0x5e6049,null))[_0x0af1('0x5a')](handleError(_0x5e6049,null));};exports[_0x0af1('0x5b')]=function(_0x2e3470,_0x35aabc){return db[_0x0af1('0x3e')][_0x0af1('0x5b')](_0x2e3470[_0x0af1('0x5c')],{})[_0x0af1('0x25')](respondWithResult(_0x35aabc,0xc9))['catch'](handleError(_0x35aabc,null));};exports['update']=function(_0x45504b,_0x45d9ce){if(_0x45504b[_0x0af1('0x5c')]['id']){delete _0x45504b[_0x0af1('0x5c')]['id'];}return db[_0x0af1('0x3e')]['find']({'where':{'id':_0x45504b[_0x0af1('0x59')]['id']}})[_0x0af1('0x25')](handleEntityNotFound(_0x45d9ce,null))['then'](saveUpdates(_0x45504b[_0x0af1('0x5c')],null))[_0x0af1('0x25')](respondWithResult(_0x45d9ce,null))[_0x0af1('0x5a')](handleError(_0x45d9ce,null));};exports[_0x0af1('0x39')]=function(_0x20069a,_0x4c0dd3){return db['OpenchannelMessage'][_0x0af1('0x5d')]({'where':{'id':_0x20069a[_0x0af1('0x59')]['id']}})[_0x0af1('0x25')](handleEntityNotFound(_0x4c0dd3,null))[_0x0af1('0x25')](removeEntity(_0x4c0dd3,null))['catch'](handleError(_0x4c0dd3,null));};exports['describe']=function(_0x4f1549,_0x2100d0){return db[_0x0af1('0x3e')][_0x0af1('0x5e')]()[_0x0af1('0x25')](respondWithResult(_0x2100d0,null))[_0x0af1('0x5a')](handleError(_0x2100d0,null));};var interaction_log=require(_0x0af1('0x17'))('openchannel-interactions');exports[_0x0af1('0x5f')]=function(_0x13a617,_0xafec32,_0x41db2a){var _0x562ce4={'channel':'openchannel'};if(_0x13a617[_0x0af1('0x5c')]['id']){delete _0x13a617[_0x0af1('0x5c')]['id'];}_0x13a617[_0x0af1('0x5c')][_0x0af1('0x60')]=!![];_0x13a617[_0x0af1('0x5c')][_0x0af1('0x61')]=moment()['format'](_0x0af1('0x62'));_0x13a617[_0x0af1('0x5c')]['UserId']=_0x13a617['body'][_0x0af1('0x63')]||_0x13a617[_0x0af1('0x64')]['id'];return db[_0x0af1('0x3e')]['find']({'where':{'id':_0x13a617[_0x0af1('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x0af1('0x25')](handleEntityNotFound(_0xafec32,null))[_0x0af1('0x25')](saveUpdates(_0x13a617[_0x0af1('0x5c')],null))[_0x0af1('0x25')](function(_0x10a81c){if(_0x10a81c){_0x562ce4[_0x0af1('0x2c')]=_0x10a81c[_0x0af1('0x65')]({'plain':!![]});return db[_0x0af1('0x66')][_0x0af1('0x5d')]({'where':{'id':_0x10a81c['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xafec32,null))['then'](function(_0x7201b){if(_0x7201b){return _0x7201b[_0x0af1('0x38')]({'UserId':_0x13a617['body'][_0x0af1('0x63')],'read1stAt':_['isNil'](_0x7201b[_0x0af1('0x67')])?moment()[_0x0af1('0x68')](_0x0af1('0x62')):undefined});}return null;})['then'](function(_0x3e3ba3){if(_0x3e3ba3){_0x562ce4[_0x0af1('0x69')]=_0x3e3ba3[_0x0af1('0x65')]({'plain':!![]});interaction_log[_0x0af1('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x13a617[_0x0af1('0x64')]['id'],_0x13a617[_0x0af1('0x64')][_0x0af1('0x3c')],_0x13a617[_0x0af1('0x64')][_0x0af1('0x6a')],_0x562ce4['interaction']['id'],_0x13a617[_0x0af1('0x5c')]?JSON[_0x0af1('0x6b')](_0x13a617[_0x0af1('0x5c')]):_0x0af1('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x0af1('0x6d'),_0x562ce4);}return null;})[_0x0af1('0x25')](function(_0x29a9fd){if(_0x29a9fd){if(_0x13a617[_0x0af1('0x5c')][_0x0af1('0x6e')]){_0x562ce4[_0x0af1('0x2c')][_0x0af1('0x6f')]=util[_0x0af1('0x68')]('SIP/%s',_0x13a617[_0x0af1('0x64')]['name']);_0x562ce4[_0x0af1('0x2c')]['channel']=_0x562ce4[_0x0af1('0x70')];_0x562ce4[_0x0af1('0x2c')][_0x0af1('0x71')]=_0x0af1('0x5f');return respondWithRpcPromise(_0x0af1('0x72'),_0x0af1('0x72'),{'event':_0x0af1('0x73'),'message':_0x562ce4[_0x0af1('0x2c')]},client9002)[_0x0af1('0x25')](function(){return _0x562ce4;});}return _0x562ce4;}return null;})[_0x0af1('0x25')](respondWithResult(_0xafec32,null))['catch'](handleError(_0xafec32,null));};var interaction_log=require(_0x0af1('0x17'))(_0x0af1('0x74'));exports[_0x0af1('0x36')]=function(_0x23fcc5,_0x15846d,_0x6bb9bc){var _0x7336a3={'agent':{},'channel':_0x0af1('0x75')};if(_0x23fcc5[_0x0af1('0x5c')]['id']){delete _0x23fcc5[_0x0af1('0x5c')]['id'];}_0x23fcc5[_0x0af1('0x5c')]['UserId']=_0x23fcc5[_0x0af1('0x5c')][_0x0af1('0x63')]||_0x23fcc5[_0x0af1('0x64')]['id'];_0x7336a3['agent']['id']=_0x23fcc5['body']['UserId'];return db[_0x0af1('0x3e')]['find']({'where':{'id':_0x23fcc5[_0x0af1('0x59')]['id'],'UserId':null}})[_0x0af1('0x25')](handleEntityNotFound(_0x15846d,null))['then'](function(_0x14410f){if(_0x14410f){_0x7336a3[_0x0af1('0x2c')]=_0x14410f[_0x0af1('0x65')]({'plain':!![]});return db[_0x0af1('0x66')][_0x0af1('0x5d')]({'where':{'id':_0x14410f['OpenchannelInteractionId']}});}return null;})[_0x0af1('0x25')](handleEntityNotFound(_0x15846d,null))[_0x0af1('0x25')](function(_0x2a6677){if(_0x2a6677){_0x7336a3[_0x0af1('0x69')]=_0x2a6677['get']({'plain':!![]});interaction_log[_0x0af1('0x26')](_0x0af1('0x76'),_0x23fcc5[_0x0af1('0x64')]['id'],_0x23fcc5['user']['name'],_0x23fcc5[_0x0af1('0x64')][_0x0af1('0x6a')],_0x7336a3[_0x0af1('0x69')]['id'],_0x23fcc5[_0x0af1('0x5c')]?JSON[_0x0af1('0x6b')](_0x23fcc5[_0x0af1('0x5c')]):_0x0af1('0x6c'));return respondWithRpcPromise(_0x0af1('0x77'),_0x0af1('0x78'),_0x7336a3);}return null;})[_0x0af1('0x25')](function(_0x1ee8b5){if(_0x1ee8b5){_0x1ee8b5['message'][_0x0af1('0x6f')]=util[_0x0af1('0x68')](_0x0af1('0x79'),_0x23fcc5['user']['name']);_0x1ee8b5[_0x0af1('0x2c')]['channel']=_0x7336a3['channel'];_0x1ee8b5[_0x0af1('0x2c')][_0x0af1('0x71')]=_0x0af1('0x36');respondWithRpcPromise(_0x0af1('0x72'),'EventManager',{'event':'rejectmessage','message':_0x1ee8b5[_0x0af1('0x2c')]},client9002);return _0x7336a3;}return null;})['then'](respondWithResult(_0x15846d,null))[_0x0af1('0x5a')](handleError(_0x15846d,null));}; \ No newline at end of file +var _0xff85=['info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelMessage,\x20%s,\x20%s','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','OpenchannelMessage','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','field','options','include','findAll','rows','show','includeAll','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','manual','interface','SIP/%s','event','EventManager','acceptmessage','openchannel','agent','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','channel','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xff85,0x1d0));var _0x5ff8=function(_0x2339d5,_0x3abe56){_0x2339d5=_0x2339d5-0x0;var _0x55a421=_0xff85[_0x2339d5];return _0x55a421;};'use strict';var pdf=require(_0x5ff8('0x0'));var emlformat=require(_0x5ff8('0x1'));var rimraf=require(_0x5ff8('0x2'));var zipdir=require(_0x5ff8('0x3'));var jsonpatch=require(_0x5ff8('0x4'));var rp=require(_0x5ff8('0x5'));var moment=require(_0x5ff8('0x6'));var BPromise=require(_0x5ff8('0x7'));var Mustache=require('mustache');var util=require(_0x5ff8('0x8'));var path=require(_0x5ff8('0x9'));var sox=require(_0x5ff8('0xa'));var csv=require(_0x5ff8('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5ff8('0xc'));var crypto=require(_0x5ff8('0xd'));var jsforce=require(_0x5ff8('0xe'));var deskjs=require(_0x5ff8('0xf'));var toCsv=require(_0x5ff8('0xb'));var querystring=require(_0x5ff8('0x10'));var Papa=require(_0x5ff8('0x11'));var authService=require(_0x5ff8('0x12'));var hardwareService=require(_0x5ff8('0x13'));var Redis=require(_0x5ff8('0x14'));var qs=require(_0x5ff8('0x15'));var logger=require(_0x5ff8('0x16'))(_0x5ff8('0x17'));var utils=require(_0x5ff8('0x18'));var config=require('../../config/environment');var db=require(_0x5ff8('0x19'))['db'];config[_0x5ff8('0x1a')]=_[_0x5ff8('0x1b')](config[_0x5ff8('0x1a')],{'host':_0x5ff8('0x1c'),'port':0x18eb});var socket=require(_0x5ff8('0x1d'))(new Redis(config[_0x5ff8('0x1a')]));require(_0x5ff8('0x1e'))[_0x5ff8('0x1f')](socket);var jayson=require(_0x5ff8('0x20'));var client=jayson[_0x5ff8('0x21')][_0x5ff8('0x22')]({'port':0x232c});var client9002=jayson[_0x5ff8('0x21')][_0x5ff8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x469ff3,_0x4d34a4,_0x13e1a9,_0xff62a0){return new BPromise(function(_0x375a21,_0x170888){var _0xc29840=_0xff62a0||client;return _0xc29840['request'](_0x469ff3,_0x13e1a9)[_0x5ff8('0x23')](function(_0x5a5d16){logger[_0x5ff8('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d34a4,_0x5ff8('0x25'));logger[_0x5ff8('0x26')](_0x5ff8('0x27'),_0x4d34a4,_0x5ff8('0x25'),JSON[_0x5ff8('0x28')](_0x5a5d16));if(_0x5a5d16[_0x5ff8('0x29')]){if(_0x5a5d16[_0x5ff8('0x29')][_0x5ff8('0x2a')]===0x1f4){logger[_0x5ff8('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d34a4,_0x5a5d16[_0x5ff8('0x29')]['message']);return _0x170888(_0x5a5d16[_0x5ff8('0x29')][_0x5ff8('0x2b')]);}logger[_0x5ff8('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d34a4,_0x5a5d16[_0x5ff8('0x29')][_0x5ff8('0x2b')]);return _0x375a21(_0x5a5d16[_0x5ff8('0x29')][_0x5ff8('0x2b')]);}else{logger[_0x5ff8('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d34a4,'request\x20sent');_0x375a21(_0x5a5d16['result'][_0x5ff8('0x2b')]);}})[_0x5ff8('0x2c')](function(_0x38f39e){logger[_0x5ff8('0x29')](_0x5ff8('0x2d'),_0x4d34a4,_0x38f39e);_0x170888(_0x38f39e);});});}function respondWithStatusCode(_0xf4808c,_0x3870ab){_0x3870ab=_0x3870ab||0xcc;return function(_0x206baa){if(_0x206baa){return _0xf4808c['sendStatus'](_0x3870ab);}return _0xf4808c[_0x5ff8('0x2e')](_0x3870ab)[_0x5ff8('0x2f')]();};}function respondWithResult(_0x141246,_0x551518){_0x551518=_0x551518||0xc8;return function(_0x2df2e0){if(_0x2df2e0){return _0x141246['status'](_0x551518)[_0x5ff8('0x30')](_0x2df2e0);}};}function respondWithFilteredResult(_0x19e2b0,_0x3c083a){return function(_0x49b3ac){if(_0x49b3ac){var _0x4ce1ca=_0x49b3ac[_0x5ff8('0x31')],_0x4c8c8a=_0x3c083a['offset'],_0x1e18ce=_0x3c083a[_0x5ff8('0x32')]+_0x3c083a[_0x5ff8('0x33')],_0x2e67a2;if(_0x1e18ce>=_0x4ce1ca){_0x1e18ce=_0x4ce1ca;_0x2e67a2=0xc8;}else{_0x2e67a2=0xce;}_0x19e2b0[_0x5ff8('0x2e')](_0x2e67a2);return _0x19e2b0[_0x5ff8('0x34')](_0x5ff8('0x35'),_0x4c8c8a+'-'+_0x1e18ce+'/'+_0x4ce1ca)[_0x5ff8('0x30')](_0x49b3ac);}return null;};}function patchUpdates(_0x429f9c){return function(_0x4e3b2d){try{jsonpatch[_0x5ff8('0x36')](_0x4e3b2d,_0x429f9c,!![]);}catch(_0x4d5feb){return BPromise[_0x5ff8('0x37')](_0x4d5feb);}return _0x4e3b2d[_0x5ff8('0x38')]();};}function saveUpdates(_0x240c05,_0x558391){return function(_0x22ac74){if(_0x22ac74){return _0x22ac74[_0x5ff8('0x39')](_0x240c05)[_0x5ff8('0x23')](function(_0x47a7a1){return _0x47a7a1;});}return null;};}function removeEntity(_0x337eb2,_0x37b408){return function(_0x34c6dd){if(_0x34c6dd){return _0x34c6dd['destroy']()['then'](function(){_0x337eb2[_0x5ff8('0x2e')](0xcc)[_0x5ff8('0x2f')]();});}};}function handleEntityNotFound(_0x29225c,_0xa5aac7){return function(_0x5413e5){if(!_0x5413e5){_0x29225c[_0x5ff8('0x3a')](0x194);}return _0x5413e5;};}function handleError(_0x732f84,_0x1387cd){_0x1387cd=_0x1387cd||0x1f4;return function(_0x8d0440){logger[_0x5ff8('0x29')](_0x8d0440[_0x5ff8('0x3b')]);if(_0x8d0440[_0x5ff8('0x3c')]){delete _0x8d0440['name'];}_0x732f84['status'](_0x1387cd)[_0x5ff8('0x3d')](_0x8d0440);};}exports[_0x5ff8('0x3e')]=function(_0x1ea9c3,_0x2d6d7b){var _0x22938={},_0xec5a59={},_0x39ace5={'count':0x0,'rows':[]};var _0x1f5ec7=db[_0x5ff8('0x3f')][_0x5ff8('0x40')];_0xec5a59[_0x5ff8('0x41')]=_[_0x5ff8('0x42')](_0x1f5ec7);_0xec5a59[_0x5ff8('0x43')]=_[_0x5ff8('0x42')](_0x1ea9c3[_0x5ff8('0x43')]);_0xec5a59['filters']=_['intersection'](_0xec5a59[_0x5ff8('0x41')],_0xec5a59[_0x5ff8('0x43')]);_0x22938[_0x5ff8('0x44')]=_[_0x5ff8('0x45')](_0xec5a59[_0x5ff8('0x41')],qs[_0x5ff8('0x46')](_0x1ea9c3['query']['fields']));_0x22938['attributes']=_0x22938['attributes']['length']?_0x22938[_0x5ff8('0x44')]:_0xec5a59[_0x5ff8('0x41')];if(!_0x1ea9c3['query']['hasOwnProperty'](_0x5ff8('0x47'))){_0x22938[_0x5ff8('0x33')]=qs[_0x5ff8('0x33')](_0x1ea9c3[_0x5ff8('0x43')]['limit']);_0x22938[_0x5ff8('0x32')]=qs[_0x5ff8('0x32')](_0x1ea9c3[_0x5ff8('0x43')][_0x5ff8('0x32')]);}_0x22938[_0x5ff8('0x48')]=qs[_0x5ff8('0x49')](_0x1ea9c3[_0x5ff8('0x43')][_0x5ff8('0x49')]);_0x22938[_0x5ff8('0x4a')]=qs[_0x5ff8('0x4b')](_[_0x5ff8('0x4c')](_0x1ea9c3[_0x5ff8('0x43')],_0xec5a59[_0x5ff8('0x4b')]));if(_0x1ea9c3[_0x5ff8('0x43')][_0x5ff8('0x4d')]){_0x22938[_0x5ff8('0x4a')]=_[_0x5ff8('0x4e')](_0x22938[_0x5ff8('0x4a')],{'$or':_['map'](_0x1f5ec7,function(_0x5d4d69){if(_0x5d4d69[_0x5ff8('0x4f')]['key']!==_0x5ff8('0x50')){var _0x187f48={};_0x187f48[_0x5d4d69[_0x5ff8('0x51')]]={'$like':'%'+_0x1ea9c3[_0x5ff8('0x43')][_0x5ff8('0x4d')]+'%'};return _0x187f48;}})});}_0x22938=_[_0x5ff8('0x4e')]({},_0x22938,_0x1ea9c3[_0x5ff8('0x52')]);var _0x551c91={'where':_0x22938[_0x5ff8('0x4a')]};return db[_0x5ff8('0x3f')][_0x5ff8('0x31')](_0x551c91)[_0x5ff8('0x23')](function(_0x5682ae){_0x39ace5['count']=_0x5682ae;if(_0x1ea9c3[_0x5ff8('0x43')]['includeAll']){_0x22938[_0x5ff8('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5ff8('0x54')](_0x22938);})[_0x5ff8('0x23')](function(_0x2349ca){_0x39ace5[_0x5ff8('0x55')]=_0x2349ca;return _0x39ace5;})[_0x5ff8('0x23')](respondWithFilteredResult(_0x2d6d7b,_0x22938))['catch'](handleError(_0x2d6d7b,null));};exports[_0x5ff8('0x56')]=function(_0xadd6b6,_0x5c41f0){var _0xae272b={'raw':!![],'where':{'id':_0xadd6b6['params']['id']}},_0x34d13c={};_0x34d13c[_0x5ff8('0x41')]=_[_0x5ff8('0x42')](db['OpenchannelMessage']['rawAttributes']);_0x34d13c[_0x5ff8('0x43')]=_[_0x5ff8('0x42')](_0xadd6b6['query']);_0x34d13c[_0x5ff8('0x4b')]=_['intersection'](_0x34d13c[_0x5ff8('0x41')],_0x34d13c[_0x5ff8('0x43')]);_0xae272b['attributes']=_[_0x5ff8('0x45')](_0x34d13c[_0x5ff8('0x41')],qs[_0x5ff8('0x46')](_0xadd6b6[_0x5ff8('0x43')][_0x5ff8('0x46')]));_0xae272b[_0x5ff8('0x44')]=_0xae272b['attributes']['length']?_0xae272b[_0x5ff8('0x44')]:_0x34d13c[_0x5ff8('0x41')];if(_0xadd6b6[_0x5ff8('0x43')][_0x5ff8('0x57')]){_0xae272b[_0x5ff8('0x53')]=[{'all':!![]}];}_0xae272b=_['merge']({},_0xae272b,_0xadd6b6['options']);return db[_0x5ff8('0x3f')][_0x5ff8('0x58')](_0xae272b)[_0x5ff8('0x23')](handleEntityNotFound(_0x5c41f0,null))[_0x5ff8('0x23')](respondWithResult(_0x5c41f0,null))[_0x5ff8('0x2c')](handleError(_0x5c41f0,null));};exports[_0x5ff8('0x59')]=function(_0x18abb1,_0x1e93a9){return db[_0x5ff8('0x3f')][_0x5ff8('0x59')](_0x18abb1[_0x5ff8('0x5a')],{})[_0x5ff8('0x23')](respondWithResult(_0x1e93a9,0xc9))[_0x5ff8('0x2c')](handleError(_0x1e93a9,null));};exports[_0x5ff8('0x39')]=function(_0x21dab1,_0x2c3797){if(_0x21dab1[_0x5ff8('0x5a')]['id']){delete _0x21dab1[_0x5ff8('0x5a')]['id'];}return db[_0x5ff8('0x3f')][_0x5ff8('0x58')]({'where':{'id':_0x21dab1[_0x5ff8('0x5b')]['id']}})[_0x5ff8('0x23')](handleEntityNotFound(_0x2c3797,null))['then'](saveUpdates(_0x21dab1[_0x5ff8('0x5a')],null))[_0x5ff8('0x23')](respondWithResult(_0x2c3797,null))[_0x5ff8('0x2c')](handleError(_0x2c3797,null));};exports['destroy']=function(_0x2784b1,_0x1a2412){return db[_0x5ff8('0x3f')][_0x5ff8('0x58')]({'where':{'id':_0x2784b1['params']['id']}})[_0x5ff8('0x23')](handleEntityNotFound(_0x1a2412,null))['then'](removeEntity(_0x1a2412,null))[_0x5ff8('0x2c')](handleError(_0x1a2412,null));};exports[_0x5ff8('0x5c')]=function(_0x3cc16b,_0x106794){return db[_0x5ff8('0x3f')]['describe']()['then'](respondWithResult(_0x106794,null))[_0x5ff8('0x2c')](handleError(_0x106794,null));};var interaction_log=require(_0x5ff8('0x16'))(_0x5ff8('0x5d'));exports[_0x5ff8('0x5e')]=function(_0x5b75d0,_0x1c14a1,_0x29c2e0){var _0x1d9391={'channel':'openchannel'};if(_0x5b75d0[_0x5ff8('0x5a')]['id']){delete _0x5b75d0[_0x5ff8('0x5a')]['id'];}_0x5b75d0[_0x5ff8('0x5a')][_0x5ff8('0x5f')]=!![];_0x5b75d0[_0x5ff8('0x5a')][_0x5ff8('0x60')]=moment()[_0x5ff8('0x61')](_0x5ff8('0x62'));_0x5b75d0[_0x5ff8('0x5a')][_0x5ff8('0x63')]=_0x5b75d0[_0x5ff8('0x5a')]['UserId']||_0x5b75d0[_0x5ff8('0x64')]['id'];return db[_0x5ff8('0x3f')][_0x5ff8('0x58')]({'where':{'id':_0x5b75d0[_0x5ff8('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x5ff8('0x65')],'as':_0x5ff8('0x66')}]})[_0x5ff8('0x23')](handleEntityNotFound(_0x1c14a1,null))['then'](saveUpdates(_0x5b75d0['body'],null))[_0x5ff8('0x23')](function(_0x362a14){if(_0x362a14){_0x1d9391[_0x5ff8('0x2b')]=_0x362a14['get']({'plain':!![]});return db[_0x5ff8('0x67')][_0x5ff8('0x58')]({'where':{'id':_0x362a14[_0x5ff8('0x68')]}});}return null;})[_0x5ff8('0x23')](handleEntityNotFound(_0x1c14a1,null))[_0x5ff8('0x23')](function(_0x250b19){if(_0x250b19){return _0x250b19['update']({'UserId':_0x5b75d0[_0x5ff8('0x5a')][_0x5ff8('0x63')],'read1stAt':_[_0x5ff8('0x69')](_0x250b19[_0x5ff8('0x6a')])?moment()[_0x5ff8('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3fd98a){if(_0x3fd98a){_0x1d9391['interaction']=_0x3fd98a['get']({'plain':!![]});interaction_log[_0x5ff8('0x24')](_0x5ff8('0x6b'),_0x5b75d0['user']['id'],_0x5b75d0[_0x5ff8('0x64')]['name'],_0x5b75d0['user'][_0x5ff8('0x6c')],_0x1d9391[_0x5ff8('0x6d')]['id'],_0x5b75d0[_0x5ff8('0x5a')]?JSON[_0x5ff8('0x28')](_0x5b75d0['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x5ff8('0x6e'),_0x1d9391);}return null;})[_0x5ff8('0x23')](function(_0x384b95){if(_0x384b95){if(_0x5b75d0[_0x5ff8('0x5a')][_0x5ff8('0x6f')]){_0x1d9391[_0x5ff8('0x2b')][_0x5ff8('0x70')]=util[_0x5ff8('0x61')](_0x5ff8('0x71'),_0x5b75d0[_0x5ff8('0x64')][_0x5ff8('0x3c')]);_0x1d9391['message']['channel']=_0x1d9391['channel'];_0x1d9391['message'][_0x5ff8('0x72')]=_0x5ff8('0x5e');return respondWithRpcPromise(_0x5ff8('0x73'),_0x5ff8('0x73'),{'event':_0x5ff8('0x74'),'message':_0x1d9391['message']},client9002)[_0x5ff8('0x23')](function(){return _0x1d9391;});}return _0x1d9391;}return null;})[_0x5ff8('0x23')](respondWithResult(_0x1c14a1,null))[_0x5ff8('0x2c')](handleError(_0x1c14a1,null));};var interaction_log=require(_0x5ff8('0x16'))('openchannel-interactions');exports[_0x5ff8('0x37')]=function(_0x2baf87,_0x8600de,_0x37b6f6){var _0x491fee={'agent':{},'channel':_0x5ff8('0x75')};if(_0x2baf87[_0x5ff8('0x5a')]['id']){delete _0x2baf87[_0x5ff8('0x5a')]['id'];}_0x2baf87['body'][_0x5ff8('0x63')]=_0x2baf87[_0x5ff8('0x5a')]['UserId']||_0x2baf87[_0x5ff8('0x64')]['id'];_0x491fee[_0x5ff8('0x76')]['id']=_0x2baf87['body']['UserId'];return db[_0x5ff8('0x3f')][_0x5ff8('0x58')]({'where':{'id':_0x2baf87[_0x5ff8('0x5b')]['id'],'UserId':null}})[_0x5ff8('0x23')](handleEntityNotFound(_0x8600de,null))[_0x5ff8('0x23')](function(_0x4248cc){if(_0x4248cc){_0x491fee[_0x5ff8('0x2b')]=_0x4248cc[_0x5ff8('0x77')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5ff8('0x58')]({'where':{'id':_0x4248cc['OpenchannelInteractionId']}});}return null;})[_0x5ff8('0x23')](handleEntityNotFound(_0x8600de,null))['then'](function(_0x16d332){if(_0x16d332){_0x491fee[_0x5ff8('0x6d')]=_0x16d332['get']({'plain':!![]});interaction_log['info'](_0x5ff8('0x78'),_0x2baf87[_0x5ff8('0x64')]['id'],_0x2baf87[_0x5ff8('0x64')]['name'],_0x2baf87[_0x5ff8('0x64')][_0x5ff8('0x6c')],_0x491fee[_0x5ff8('0x6d')]['id'],_0x2baf87[_0x5ff8('0x5a')]?JSON[_0x5ff8('0x28')](_0x2baf87[_0x5ff8('0x5a')]):_0x5ff8('0x79'));return respondWithRpcPromise('RejectMessage',_0x5ff8('0x7a'),_0x491fee);}return null;})[_0x5ff8('0x23')](function(_0x1cda88){if(_0x1cda88){_0x1cda88[_0x5ff8('0x2b')][_0x5ff8('0x70')]=util[_0x5ff8('0x61')](_0x5ff8('0x71'),_0x2baf87[_0x5ff8('0x64')]['name']);_0x1cda88[_0x5ff8('0x2b')]['channel']=_0x491fee[_0x5ff8('0x7b')];_0x1cda88[_0x5ff8('0x2b')][_0x5ff8('0x72')]=_0x5ff8('0x37');respondWithRpcPromise(_0x5ff8('0x73'),_0x5ff8('0x73'),{'event':_0x5ff8('0x7c'),'message':_0x1cda88['message']},client9002);return _0x491fee;}return null;})['then'](respondWithResult(_0x8600de,null))[_0x5ff8('0x2c')](handleError(_0x8600de,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index de9a33f..91bfcd1 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 _0x5859=['events','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x269df6,_0x2dd33a){var _0x187055=function(_0x29f519){while(--_0x29f519){_0x269df6['push'](_0x269df6['shift']());}};_0x187055(++_0x2dd33a);}(_0x5859,0xe8));var _0x9585=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x5859[_0x4c440b];return _0x2d48cf;};'use strict';var EventEmitter=require(_0x9585('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x9585('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9585('0x2')](0x0);var events={'afterCreate':_0x9585('0x3'),'afterUpdate':'update','afterDestroy':_0x9585('0x4')};function emitEvent(_0x328af0){return function(_0x380a1,_0x3b35eb,_0x3b9fa0){OpenchannelMessageEvents[_0x9585('0x5')](_0x328af0+':'+_0x380a1['id'],_0x380a1);OpenchannelMessageEvents[_0x9585('0x5')](_0x328af0,_0x380a1);_0x3b9fa0(null);};}for(var e in events){if(events[_0x9585('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9585('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4259=['setMaxListeners','update','emit','hook','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x4259,0xeb));var _0x9425=function(_0x593ccf,_0x2873b5){_0x593ccf=_0x593ccf-0x0;var _0x2ce4c1=_0x4259[_0x593ccf];return _0x2ce4c1;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9425('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9425('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4daedf){return function(_0x7d842a,_0x4e5363,_0x594ad5){OpenchannelMessageEvents['emit'](_0x4daedf+':'+_0x7d842a['id'],_0x7d842a);OpenchannelMessageEvents[_0x9425('0x2')](_0x4daedf,_0x7d842a);_0x594ad5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x9425('0x3')](e,emitEvent(event));}}module[_0x9425('0x4')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c647774..0b18441 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 _0x9444=['POST','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','error','finally','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','models','get','direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','createdAt','body','secret','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET'];(function(_0x4d98b8,_0x539839){var _0x5e271b=function(_0x280ac6){while(--_0x280ac6){_0x4d98b8['push'](_0x4d98b8['shift']());}};_0x5e271b(++_0x539839);}(_0x9444,0x9c));var _0x4944=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x9444[_0x5ad190];return _0x518ed3;};'use strict';var _=require(_0x4944('0x0'));var util=require(_0x4944('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4944('0x2'));var BPromise=require(_0x4944('0x3'));var rp=require(_0x4944('0x4'));var attributes=require(_0x4944('0x5'));module['exports']=function(_0x3b87ad,_0x121e3c){return _0x3b87ad[_0x4944('0x6')](_0x4944('0x7'),attributes,{'tableName':_0x4944('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x9f88d9,_0x5efcbb,_0x1a7488){var _0x2d9524=_0x3b87ad[_0x4944('0x9')];var _0x2afca9=_0x9f88d9[_0x4944('0xa')]({'plain':!![]});if(_0x2afca9[_0x4944('0xb')][_0x4944('0xc')]()==='in'||_0x2afca9[_0x4944('0xb')]['toLowerCase']()===_0x4944('0xd')&&!_0x2afca9['secret']&&!_[_0x4944('0xe')](_0x2afca9[_0x4944('0xf')])){_0x2d9524['OpenchannelInteraction'][_0x4944('0x10')]({'where':{'id':_0x2afca9[_0x4944('0x11')]}})[_0x4944('0x12')](function(_0x240e93){if(_0x240e93){_0x240e93['update']({'lastMsgAt':_0x2afca9[_0x4944('0x13')],'lastMsgDirection':_0x2afca9[_0x4944('0xb')]['toLowerCase'](),'lastMsgBody':_0x2afca9[_0x4944('0x14')]});}})['catch'](function(_0x1e1492){console['error'](_0x1e1492);});}if(_0x2afca9[_0x4944('0xb')]===_0x4944('0xd')&&!_0x2afca9[_0x4944('0x15')]){var _0x4d3051;_0x2d9524['CmContact'][_0x4944('0x16')]()['then'](function(_0x4034a2){return _0x2d9524[_0x4944('0x17')]['find']({'where':{'id':_0x2afca9[_0x4944('0x18')]},'include':[{'model':_0x2d9524[_0x4944('0x19')],'as':_0x4944('0x1a'),'where':{'id':_0x2afca9[_0x4944('0x11')]},'limit':0x1,'include':[{'model':_0x2d9524[_0x4944('0x1b')],'as':_0x4944('0x1c'),'attributes':_[_0x4944('0x1d')](_0x4034a2)}]}]});})[_0x4944('0x12')](function(_0x57f701){_0x4d3051=_0x57f701['get']({'plain':!![]});if(_0x4d3051&&_0x4d3051[_0x4944('0x1e')]){logger[_0x4944('0x1f')](_0x4944('0x20'),_0x4944('0x21'),util['format'](_0x4944('0x22'),_0x2afca9['id'],_0x4d3051[_0x4944('0x1e')]));if(_0x4d3051[_0x4944('0x1a')]&&_0x4d3051[_0x4944('0x1a')][_0x4944('0x23')]){_0x2afca9[_0x4944('0x24')]=_[_0x4944('0x25')](_0x4d3051[_0x4944('0x1a')][0x0],_0x4944('0x1c'));_0x2afca9[_0x4944('0x1c')]=_0x4d3051[_0x4944('0x1a')][0x0]['Contact'];}var _0x5efcbb={'method':'POST','uri':encodeURI(_0x4d3051[_0x4944('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5efcbb[_0x4944('0x26')]){case _0x4944('0x27'):_0x5efcbb['qs']=_0x2afca9;break;case _0x4944('0x28'):_0x5efcbb[_0x4944('0x14')]=_0x2afca9;break;}return rp(_0x5efcbb)[_0x4944('0x12')](function(_0xaaa43){logger[_0x4944('0x1f')](_0x4944('0x20'),'afterCreate',util[_0x4944('0x29')](_0x4944('0x2a'),_0x2afca9['id'],_0x4d3051[_0x4944('0x1e')]));if(_0xaaa43[_0x4944('0x14')][_0x4944('0x2b')]&&_0xaaa43[_0x4944('0x14')][_0x4944('0x2b')]!=_0x2afca9[_0x4944('0x24')][_0x4944('0x2b')]){return _0x2d9524[_0x4944('0x19')][_0x4944('0x2c')]({'threadId':_0xaaa43['body'][_0x4944('0x2b')]},{'logging':!![],'where':{'id':_0x2afca9['Interaction']['id']}});}else{return;}})[_0x4944('0x12')](function(){return _0x9f88d9[_0x4944('0x2c')]({'read':!![]});})[_0x4944('0x2d')](function(_0x384de7){logger[_0x4944('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x4944('0x21'),util['inspect'](_0x384de7,{'showHidden':![],'depth':null}));_0x1a7488();});}else{_0x1a7488();}})[_0x4944('0x2f')](function(){_0x1a7488();});}else{_0x1a7488();}}},'charset':'utf8mb4','collate':_0x4944('0x30')});}; \ No newline at end of file +var _0xaf1c=['secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','body','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','replyUri','info','afterCreate','format','Interactions','length','Interaction','omit','POST','method','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','lodash','util','api','moment','bluebird','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','models','get','direction','toLowerCase','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf1c,0x10c));var _0xcaf1=function(_0x1c74a8,_0x2c2db8){_0x1c74a8=_0x1c74a8-0x0;var _0x4d9072=_0xaf1c[_0x1c74a8];return _0x4d9072;};'use strict';var _=require(_0xcaf1('0x0'));var util=require(_0xcaf1('0x1'));var logger=require('../../config/logger')(_0xcaf1('0x2'));var moment=require(_0xcaf1('0x3'));var BPromise=require(_0xcaf1('0x4'));var rp=require('request-promise');var attributes=require(_0xcaf1('0x5'));module['exports']=function(_0x3e750c,_0xabea5e){return _0x3e750c[_0xcaf1('0x6')](_0xcaf1('0x7'),attributes,{'tableName':_0xcaf1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e5949,_0xf3f37b,_0x52d726){var _0x51d4d5=_0x3e750c[_0xcaf1('0x9')];var _0x2fcd80=_0x4e5949[_0xcaf1('0xa')]({'plain':!![]});if(_0x2fcd80[_0xcaf1('0xb')][_0xcaf1('0xc')]()==='in'||_0x2fcd80['direction'][_0xcaf1('0xc')]()===_0xcaf1('0xd')&&!_0x2fcd80[_0xcaf1('0xe')]&&!_[_0xcaf1('0xf')](_0x2fcd80[_0xcaf1('0x10')])){_0x51d4d5[_0xcaf1('0x11')][_0xcaf1('0x12')]({'where':{'id':_0x2fcd80['OpenchannelInteractionId']}})[_0xcaf1('0x13')](function(_0x433a06){if(_0x433a06){_0x433a06[_0xcaf1('0x14')]({'lastMsgAt':_0x2fcd80[_0xcaf1('0x15')],'lastMsgDirection':_0x2fcd80[_0xcaf1('0xb')]['toLowerCase'](),'lastMsgBody':_0x2fcd80[_0xcaf1('0x16')]});}})[_0xcaf1('0x17')](function(_0x1e0e48){console[_0xcaf1('0x18')](_0x1e0e48);});}if(_0x2fcd80[_0xcaf1('0xb')]===_0xcaf1('0xd')&&!_0x2fcd80[_0xcaf1('0xe')]){var _0x533058;_0x51d4d5[_0xcaf1('0x19')][_0xcaf1('0x1a')]()['then'](function(_0x10ee7d){return _0x51d4d5[_0xcaf1('0x1b')][_0xcaf1('0x1c')]({'where':{'id':_0x2fcd80[_0xcaf1('0x1d')]},'include':[{'model':_0x51d4d5['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x2fcd80[_0xcaf1('0x1e')]},'limit':0x1,'include':[{'model':_0x51d4d5['CmContact'],'as':_0xcaf1('0x1f'),'attributes':_['keys'](_0x10ee7d)}]}]});})[_0xcaf1('0x13')](function(_0x4a17c1){_0x533058=_0x4a17c1[_0xcaf1('0xa')]({'plain':!![]});if(_0x533058&&_0x533058[_0xcaf1('0x20')]){logger[_0xcaf1('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xcaf1('0x22'),util[_0xcaf1('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x2fcd80['id'],_0x533058['replyUri']));if(_0x533058[_0xcaf1('0x24')]&&_0x533058[_0xcaf1('0x24')][_0xcaf1('0x25')]){_0x2fcd80[_0xcaf1('0x26')]=_[_0xcaf1('0x27')](_0x533058[_0xcaf1('0x24')][0x0],_0xcaf1('0x1f'));_0x2fcd80[_0xcaf1('0x1f')]=_0x533058['Interactions'][0x0]['Contact'];}var _0xf3f37b={'method':_0xcaf1('0x28'),'uri':encodeURI(_0x533058[_0xcaf1('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xf3f37b[_0xcaf1('0x29')]){case'GET':_0xf3f37b['qs']=_0x2fcd80;break;case _0xcaf1('0x28'):_0xf3f37b[_0xcaf1('0x16')]=_0x2fcd80;break;}return rp(_0xf3f37b)['then'](function(_0x4d5e63){logger[_0xcaf1('0x21')](_0xcaf1('0x2a'),'afterCreate',util[_0xcaf1('0x23')](_0xcaf1('0x2b'),_0x2fcd80['id'],_0x533058[_0xcaf1('0x20')]));if(_0x4d5e63[_0xcaf1('0x16')][_0xcaf1('0x2c')]&&_0x4d5e63[_0xcaf1('0x16')][_0xcaf1('0x2c')]!=_0x2fcd80['Interaction'][_0xcaf1('0x2c')]){return _0x51d4d5[_0xcaf1('0x11')]['update']({'threadId':_0x4d5e63['body'][_0xcaf1('0x2c')]},{'logging':!![],'where':{'id':_0x2fcd80['Interaction']['id']}});}else{return;}})['then'](function(){return _0x4e5949[_0xcaf1('0x14')]({'read':!![]});})[_0xcaf1('0x17')](function(_0x57ab14){logger[_0xcaf1('0x18')](_0xcaf1('0x2a'),'afterCreate',util[_0xcaf1('0x2d')](_0x57ab14,{'showHidden':![],'depth':null}));_0x52d726();});}else{_0x52d726();}})['finally'](function(){_0x52d726();});}else{_0x52d726();}}},'charset':_0xcaf1('0x2e'),'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 6bcd240..b8e5358 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 _0x729e=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','body','options','raw','CreateOpenchannelMessage','stringify','util','bluebird','ioredis','rpc','../../config/environment','client','http','redis','localhost','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x729e,0xb4));var _0xe729=function(_0x69d9c9,_0x46db43){_0x69d9c9=_0x69d9c9-0x0;var _0x5999c2=_0x729e[_0x69d9c9];return _0x5999c2;};'use strict';var _=require('lodash');var util=require(_0xe729('0x0'));var moment=require('moment');var BPromise=require(_0xe729('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe729('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe729('0x3'));var config=require(_0xe729('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe729('0x5')][_0xe729('0x6')]({'port':0x232a});config[_0xe729('0x7')]=_['defaults'](config[_0xe729('0x7')],{'host':_0xe729('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe729('0x7')]));require(_0xe729('0x9'))[_0xe729('0xa')](socket);function respondWithRpcPromise(_0x437b57,_0x4b5957,_0xb09b8c){return new BPromise(function(_0x5224db,_0x3fdd97){return client[_0xe729('0xb')](_0x437b57,_0xb09b8c)[_0xe729('0xc')](function(_0x3aa00c){logger[_0xe729('0xd')](_0xe729('0xe'),_0x4b5957,'request\x20sent');logger[_0xe729('0xf')](_0xe729('0x10'),_0x4b5957,'request\x20sent',JSON['stringify'](_0x3aa00c));if(_0x3aa00c[_0xe729('0x11')]){if(_0x3aa00c[_0xe729('0x11')][_0xe729('0x12')]===0x1f4){logger[_0xe729('0x11')](_0xe729('0xe'),_0x4b5957,_0x3aa00c[_0xe729('0x11')][_0xe729('0x13')]);return _0x3fdd97(_0x3aa00c[_0xe729('0x11')][_0xe729('0x13')]);}logger[_0xe729('0x11')](_0xe729('0xe'),_0x4b5957,_0x3aa00c[_0xe729('0x11')]['message']);return _0x5224db(_0x3aa00c[_0xe729('0x11')][_0xe729('0x13')]);}else{logger[_0xe729('0xd')](_0xe729('0xe'),_0x4b5957,_0xe729('0x14'));_0x5224db(_0x3aa00c[_0xe729('0x15')][_0xe729('0x13')]);}})[_0xe729('0x16')](function(_0x7d2e5e){logger[_0xe729('0x11')](_0xe729('0xe'),_0x4b5957,_0x7d2e5e);_0x3fdd97(_0x7d2e5e);});});}exports['CreateOpenchannelMessage']=function(_0x56630c){var _0x520a28=this;return new Promise(function(_0x359926,_0xc4a958){return db['OpenchannelMessage']['create'](_0x56630c[_0xe729('0x17')],{'raw':_0x56630c[_0xe729('0x18')]?_0x56630c['options'][_0xe729('0x19')]===undefined?!![]:![]:!![]})[_0xe729('0xc')](function(_0x22d9f4){logger['info'](_0xe729('0x1a'),_0x56630c);logger[_0xe729('0xf')](_0xe729('0x1a'),_0x56630c,JSON[_0xe729('0x1b')](_0x22d9f4));_0x359926(_0x22d9f4);})[_0xe729('0x16')](function(_0x506fb3){logger['error'](_0xe729('0x1a'),_0x506fb3[_0xe729('0x13')],_0x56630c);_0xc4a958(_0x520a28['error'](0x1f4,_0x506fb3['message']));});});}; \ No newline at end of file +var _0x4071=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x22049c,_0x4834ce){var _0x2c55cb=function(_0x3f42c0){while(--_0x3f42c0){_0x22049c['push'](_0x22049c['shift']());}};_0x2c55cb(++_0x4834ce);}(_0x4071,0x1e6));var _0x1407=function(_0x1e62aa,_0x204b5d){_0x1e62aa=_0x1e62aa-0x0;var _0x244ff1=_0x4071[_0x1e62aa];return _0x244ff1;};'use strict';var _=require(_0x1407('0x0'));var util=require(_0x1407('0x1'));var moment=require(_0x1407('0x2'));var BPromise=require(_0x1407('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1407('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1407('0x5'));var logger=require(_0x1407('0x6'))(_0x1407('0x7'));var config=require('../../config/environment');var jayson=require(_0x1407('0x8'));var client=jayson[_0x1407('0x9')][_0x1407('0xa')]({'port':0x232a});config['redis']=_[_0x1407('0xb')](config[_0x1407('0xc')],{'host':_0x1407('0xd'),'port':0x18eb});var socket=require(_0x1407('0xe'))(new Redis(config['redis']));require(_0x1407('0xf'))[_0x1407('0x10')](socket);function respondWithRpcPromise(_0x24eafc,_0x4536a5,_0x5a47e4){return new BPromise(function(_0x45a449,_0x268a6a){return client[_0x1407('0x11')](_0x24eafc,_0x5a47e4)[_0x1407('0x12')](function(_0x50ed64){logger[_0x1407('0x13')](_0x1407('0x14'),_0x4536a5,_0x1407('0x15'));logger[_0x1407('0x16')](_0x1407('0x17'),_0x4536a5,'request\x20sent',JSON[_0x1407('0x18')](_0x50ed64));if(_0x50ed64[_0x1407('0x19')]){if(_0x50ed64['error'][_0x1407('0x1a')]===0x1f4){logger[_0x1407('0x19')](_0x1407('0x14'),_0x4536a5,_0x50ed64['error'][_0x1407('0x1b')]);return _0x268a6a(_0x50ed64['error'][_0x1407('0x1b')]);}logger[_0x1407('0x19')](_0x1407('0x14'),_0x4536a5,_0x50ed64[_0x1407('0x19')][_0x1407('0x1b')]);return _0x45a449(_0x50ed64[_0x1407('0x19')][_0x1407('0x1b')]);}else{logger[_0x1407('0x13')](_0x1407('0x14'),_0x4536a5,_0x1407('0x15'));_0x45a449(_0x50ed64[_0x1407('0x1c')][_0x1407('0x1b')]);}})['catch'](function(_0x1f6a3e){logger[_0x1407('0x19')](_0x1407('0x14'),_0x4536a5,_0x1f6a3e);_0x268a6a(_0x1f6a3e);});});}exports[_0x1407('0x1d')]=function(_0x1db0ae){var _0x21a947=this;return new Promise(function(_0x1051e4,_0x2277ca){return db[_0x1407('0x1e')][_0x1407('0x1f')](_0x1db0ae[_0x1407('0x20')],{'raw':_0x1db0ae[_0x1407('0x21')]?_0x1db0ae[_0x1407('0x21')][_0x1407('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x537a30){logger[_0x1407('0x13')](_0x1407('0x1d'),_0x1db0ae);logger[_0x1407('0x16')]('CreateOpenchannelMessage',_0x1db0ae,JSON['stringify'](_0x537a30));_0x1051e4(_0x537a30);})['catch'](function(_0x2571d5){logger['error'](_0x1407('0x1d'),_0x2571d5[_0x1407('0x1b')],_0x1db0ae);_0x2277ca(_0x21a947[_0x1407('0x19')](0x1f4,_0x2571d5['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a4f9c3e..6f7c2c5 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 _0x0a9a=['update','register','openchannelMessage:','save'];(function(_0x4f1e56,_0x3a288e){var _0x5e8eab=function(_0x2baaf9){while(--_0x2baaf9){_0x4f1e56['push'](_0x4f1e56['shift']());}};_0x5e8eab(++_0x3a288e);}(_0x0a9a,0x183));var _0xa0a9=function(_0xf9b74a,_0x2eb2b4){_0xf9b74a=_0xf9b74a-0x0;var _0x94e5d4=_0x0a9a[_0xf9b74a];return _0x94e5d4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xa0a9('0x0'),'remove',_0xa0a9('0x1')];function createListener(_0x3cff22,_0x34801b){return function(_0x49162f){_0x34801b['emit'](_0x3cff22,_0x49162f);};}function removeListener(_0x317a94,_0x360be5){return function(){OpenchannelMessageEvents['removeListener'](_0x317a94,_0x360be5);};}exports[_0xa0a9('0x2')]=function(_0xc65bbb){for(var _0x1aa717=0x0,_0x31d689=events['length'];_0x1aa717<_0x31d689;_0x1aa717++){var _0x2b2eb4=events[_0x1aa717];var _0x520f42=createListener(_0xa0a9('0x3')+_0x2b2eb4,_0xc65bbb);OpenchannelMessageEvents['on'](_0x2b2eb4,_0x520f42);}}; \ No newline at end of file +var _0x919e=['save','remove','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x10fa9b,_0x58e7d0){var _0x42e1a3=function(_0x5e3079){while(--_0x5e3079){_0x10fa9b['push'](_0x10fa9b['shift']());}};_0x42e1a3(++_0x58e7d0);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelMessageEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){OpenchannelMessageEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);OpenchannelMessageEvents['on'](_0x2ceb41,_0x57c3fe);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5260c8c..afb698b 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 _0xcc6d=['destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','delete'];(function(_0x28638e,_0x30c330){var _0x20a408=function(_0x5cfe40){while(--_0x5cfe40){_0x28638e['push'](_0x28638e['shift']());}};_0x20a408(++_0x30c330);}(_0xcc6d,0xb1));var _0xdcc6=function(_0x3ba7fc,_0x376a67){_0x3ba7fc=_0x3ba7fc-0x0;var _0x141233=_0xcc6d[_0x3ba7fc];return _0x141233;};'use strict';var multer=require(_0xdcc6('0x0'));var util=require(_0xdcc6('0x1'));var path=require(_0xdcc6('0x2'));var timeout=require(_0xdcc6('0x3'));var express=require(_0xdcc6('0x4'));var router=express[_0xdcc6('0x5')]();var auth=require(_0xdcc6('0x6'));var interaction=require(_0xdcc6('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0xdcc6('0x8')](),controller[_0xdcc6('0x9')]);router['get'](_0xdcc6('0xa'),auth[_0xdcc6('0x8')](),controller[_0xdcc6('0xb')]);router[_0xdcc6('0xc')](_0xdcc6('0xd'),auth[_0xdcc6('0x8')](),controller[_0xdcc6('0xe')]);router[_0xdcc6('0xc')](_0xdcc6('0xf'),auth['isAuthenticated'](),controller[_0xdcc6('0x10')]);router[_0xdcc6('0xc')](_0xdcc6('0x11'),auth[_0xdcc6('0x8')](),controller[_0xdcc6('0x12')]);router[_0xdcc6('0xc')]('/:id/users',auth[_0xdcc6('0x8')](),controller[_0xdcc6('0x13')]);router[_0xdcc6('0x14')]('/',auth[_0xdcc6('0x8')](),controller[_0xdcc6('0x15')]);router[_0xdcc6('0x14')](_0xdcc6('0x11'),auth['isAuthenticated'](),controller[_0xdcc6('0x16')]);router[_0xdcc6('0x14')](_0xdcc6('0x17'),auth[_0xdcc6('0x8')](),controller['addAgents']);router[_0xdcc6('0x18')](_0xdcc6('0xd'),auth[_0xdcc6('0x8')](),controller['update']);router[_0xdcc6('0x19')]('/:id',auth[_0xdcc6('0x8')](),controller[_0xdcc6('0x1a')]);router[_0xdcc6('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xdcc6('0x1b')]);router['delete'](_0xdcc6('0x17'),auth[_0xdcc6('0x8')](),controller['removeAgents']);module[_0xdcc6('0x1c')]=router; \ No newline at end of file +var _0x112d=['isAuthenticated','index','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller'];(function(_0x1b5679,_0xc5b30){var _0x23b5d6=function(_0x123c06){while(--_0x123c06){_0x1b5679['push'](_0x1b5679['shift']());}};_0x23b5d6(++_0xc5b30);}(_0x112d,0x141));var _0xd112=function(_0x3ab91e,_0x485c13){_0x3ab91e=_0x3ab91e-0x0;var _0x32c2dc=_0x112d[_0x3ab91e];return _0x32c2dc;};'use strict';var multer=require(_0xd112('0x0'));var util=require(_0xd112('0x1'));var path=require(_0xd112('0x2'));var timeout=require('connect-timeout');var express=require(_0xd112('0x3'));var router=express[_0xd112('0x4')]();var auth=require(_0xd112('0x5'));var interaction=require(_0xd112('0x6'));var config=require(_0xd112('0x7'));var controller=require(_0xd112('0x8'));router['get']('/',auth[_0xd112('0x9')](),controller[_0xd112('0xa')]);router[_0xd112('0xb')]('/describe',auth[_0xd112('0x9')](),controller['describe']);router[_0xd112('0xb')](_0xd112('0xc'),auth[_0xd112('0x9')](),controller[_0xd112('0xd')]);router[_0xd112('0xb')](_0xd112('0xe'),auth[_0xd112('0x9')](),controller[_0xd112('0xf')]);router[_0xd112('0xb')](_0xd112('0x10'),auth[_0xd112('0x9')](),controller[_0xd112('0x11')]);router[_0xd112('0xb')](_0xd112('0x12'),auth[_0xd112('0x9')](),controller['getAgents']);router[_0xd112('0x13')]('/',auth['isAuthenticated'](),controller[_0xd112('0x14')]);router[_0xd112('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd112('0x15')]);router[_0xd112('0x13')](_0xd112('0x12'),auth[_0xd112('0x9')](),controller[_0xd112('0x16')]);router[_0xd112('0x17')](_0xd112('0xc'),auth[_0xd112('0x9')](),controller[_0xd112('0x18')]);router[_0xd112('0x19')](_0xd112('0xc'),auth['isAuthenticated'](),controller[_0xd112('0x1a')]);router['delete'](_0xd112('0x10'),auth[_0xd112('0x9')](),controller[_0xd112('0x1b')]);router[_0xd112('0x19')](_0xd112('0x12'),auth[_0xd112('0x9')](),controller[_0xd112('0x1c')]);module[_0xd112('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a5df07f..b7e4a3d 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 _0xa7ae=['ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa7ae,0xff));var _0xea7a=function(_0xec7620,_0x8391b9){_0xec7620=_0xec7620-0x0;var _0x1452a4=_0xa7ae[_0xec7620];return _0x1452a4;};'use strict';var Sequelize=require('sequelize');module[_0xea7a('0x0')]={'name':{'type':Sequelize[_0xea7a('0x1')],'unique':_0xea7a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea7a('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea7a('0x3')](_0xea7a('0x4'),_0xea7a('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xde93=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x22185a,_0x2c9c0f){var _0x27e1f1=function(_0x9ed420){while(--_0x9ed420){_0x22185a['push'](_0x22185a['shift']());}};_0x27e1f1(++_0x2c9c0f);}(_0xde93,0x1a8));var _0x3de9=function(_0x87e0dc,_0x577dce){_0x87e0dc=_0x87e0dc-0x0;var _0x2cd2d1=_0xde93[_0x87e0dc];return _0x2cd2d1;};'use strict';var Sequelize=require('sequelize');module[_0x3de9('0x0')]={'name':{'type':Sequelize[_0x3de9('0x1')],'unique':_0x3de9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3de9('0x1')]},'timeout':{'type':Sequelize[_0x3de9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3de9('0x4')](_0x3de9('0x5'),_0x3de9('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 981a56a..56c0544 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 _0xd8b0=['length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','OpenchannelQueue','findAll','rows','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','getMembers','UserOpenchannelQueue','pick','OpenchannelQueueId','map','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','union','addAgents','removeTeams','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','error','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields'];(function(_0x5997e5,_0x25d212){var _0x41c12c=function(_0x42530a){while(--_0x42530a){_0x5997e5['push'](_0x5997e5['shift']());}};_0x41c12c(++_0x25d212);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');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('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var authService=require(_0x0d8b('0xe'));var hardwareService=require(_0x0d8b('0xf'));var Redis=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];config[_0x0d8b('0x15')]=_[_0x0d8b('0x16')](config[_0x0d8b('0x15')],{'host':_0x0d8b('0x17'),'port':0x18eb});var socket=require(_0x0d8b('0x18'))(new Redis(config[_0x0d8b('0x15')]));require(_0x0d8b('0x19'))[_0x0d8b('0x1a')](socket);function respondWithStatusCode(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xcc;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x1b')](_0x5ad086);}return _0x2ce75e[_0x0d8b('0x1c')](_0x5ad086)['end']();};}function respondWithResult(_0x23eb7b,_0xa86349){_0xa86349=_0xa86349||0xc8;return function(_0x17f7df){if(_0x17f7df){return _0x23eb7b[_0x0d8b('0x1c')](_0xa86349)[_0x0d8b('0x1d')](_0x17f7df);}};}function respondWithFilteredResult(_0x5cd485,_0x106a01){return function(_0x4586c2){if(_0x4586c2){var _0x2fd0fc=_0x4586c2[_0x0d8b('0x1e')],_0x5fecbd=_0x106a01[_0x0d8b('0x1f')],_0x333674=_0x106a01['offset']+_0x106a01[_0x0d8b('0x20')],_0x18dd2d;if(_0x333674>=_0x2fd0fc){_0x333674=_0x2fd0fc;_0x18dd2d=0xc8;}else{_0x18dd2d=0xce;}_0x5cd485[_0x0d8b('0x1c')](_0x18dd2d);return _0x5cd485[_0x0d8b('0x21')](_0x0d8b('0x22'),_0x5fecbd+'-'+_0x333674+'/'+_0x2fd0fc)[_0x0d8b('0x1d')](_0x4586c2);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x23')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x24')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x25')](_0x54a9a7)[_0x0d8b('0x26')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x27')]()[_0x0d8b('0x26')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x28');return db['UserProfileResource'][_0x0d8b('0x27')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x26')](function(){_0x38efc8[_0x0d8b('0x1c')](0xcc)[_0x0d8b('0x29')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x1b')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x2a')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x2b')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x1c')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x2c')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=db['OpenchannelQueue'][_0x0d8b('0x2d')];_0x2c058d['model']=_[_0x0d8b('0x2e')](_0x4c80a2);_0x2c058d['query']=_['keys'](_0x544735[_0x0d8b('0x2f')]);_0x2c058d[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],_0x2c058d[_0x0d8b('0x2f')]);_0x106e4c[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],qs['fields'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x106e4c['attributes']=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x106e4c[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x544735['query'][_0x0d8b('0x20')]);_0x106e4c[_0x0d8b('0x1f')]=qs['offset'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2f')]['sort']);_0x106e4c['where']=qs[_0x0d8b('0x30')](_['pick'](_0x544735['query'],_0x2c058d[_0x0d8b('0x30')]));if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x106e4c[_0x0d8b('0x3b')],{'$or':_['map'](_0x4c80a2,function(_0x6e5bab){if(_0x6e5bab[_0x0d8b('0x3d')][_0x0d8b('0x3e')]!==_0x0d8b('0x3f')){var _0x338ed3={};_0x338ed3[_0x6e5bab[_0x0d8b('0x40')]]={'$like':'%'+_0x544735[_0x0d8b('0x2f')]['filter']+'%'};return _0x338ed3;}})});}_0x106e4c=_[_0x0d8b('0x3c')]({},_0x106e4c,_0x544735[_0x0d8b('0x41')]);var _0x3fa955={'where':_0x106e4c[_0x0d8b('0x3b')]};return db['OpenchannelQueue'][_0x0d8b('0x1e')](_0x3fa955)['then'](function(_0x37b26c){_0x56120a[_0x0d8b('0x1e')]=_0x37b26c;if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x106e4c[_0x0d8b('0x43')]=[{'all':!![]}];}return db[_0x0d8b('0x44')][_0x0d8b('0x45')](_0x106e4c);})[_0x0d8b('0x26')](function(_0x89ab0d){_0x56120a[_0x0d8b('0x46')]=_0x89ab0d;return _0x56120a;})['then'](respondWithFilteredResult(_0x3c8887,_0x106e4c))['catch'](handleError(_0x3c8887,null));};exports['show']=function(_0x4d0811,_0x524d79){var _0x1a46f6={'raw':!![],'where':{'id':_0x4d0811[_0x0d8b('0x47')]['id']}},_0x402fe0={};_0x402fe0['model']=_['keys'](db[_0x0d8b('0x44')][_0x0d8b('0x2d')]);_0x402fe0[_0x0d8b('0x2f')]=_['keys'](_0x4d0811[_0x0d8b('0x2f')]);_0x402fe0[_0x0d8b('0x30')]=_['intersection'](_0x402fe0['model'],_0x402fe0[_0x0d8b('0x2f')]);_0x1a46f6['attributes']=_[_0x0d8b('0x31')](_0x402fe0['model'],qs['fields'](_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x1a46f6['attributes']=_0x1a46f6['attributes']['length']?_0x1a46f6['attributes']:_0x402fe0[_0x0d8b('0x32')];if(_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x1a46f6['include']=[{'all':!![]}];}_0x1a46f6=_[_0x0d8b('0x3c')]({},_0x1a46f6,_0x4d0811[_0x0d8b('0x41')]);return db[_0x0d8b('0x44')][_0x0d8b('0x48')](_0x1a46f6)[_0x0d8b('0x26')](handleEntityNotFound(_0x524d79,null))[_0x0d8b('0x26')](respondWithResult(_0x524d79,null))[_0x0d8b('0x49')](handleError(_0x524d79,null));};exports[_0x0d8b('0x4a')]=function(_0x384a5e,_0x1f2077){return db[_0x0d8b('0x44')][_0x0d8b('0x4a')](_0x384a5e[_0x0d8b('0x4b')],{})[_0x0d8b('0x26')](function(_0x570af8){var _0xdfcf32=_0x384a5e[_0x0d8b('0x4c')][_0x0d8b('0x4d')]({'plain':!![]});if(!_0xdfcf32)throw new Error(_0x0d8b('0x4e'));if(_0xdfcf32['role']===_0x0d8b('0x4c')){var _0x4d8850=_0x570af8['get']({'plain':!![]});var _0x39a31d=_0x0d8b('0x28');return db[_0x0d8b('0x4f')][_0x0d8b('0x48')]({'where':{'name':_0x39a31d,'userProfileId':_0xdfcf32['userProfileId']},'raw':!![]})[_0x0d8b('0x26')](function(_0x1106d6){if(_0x1106d6&&_0x1106d6[_0x0d8b('0x50')]===0x0){return db[_0x0d8b('0x51')][_0x0d8b('0x4a')]({'name':_0x4d8850['name'],'resourceId':_0x4d8850['id'],'type':_0x1106d6['name'],'sectionId':_0x1106d6['id']},{})['then'](function(){return _0x570af8;});}else{return _0x570af8;}})['catch'](function(_0x368ede){logger[_0x0d8b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368ede);throw _0x368ede;});}return _0x570af8;})['then'](respondWithResult(_0x1f2077,0xc9))[_0x0d8b('0x49')](handleError(_0x1f2077,null));};exports[_0x0d8b('0x25')]=function(_0x5c5bd7,_0x5ef6c3){if(_0x5c5bd7[_0x0d8b('0x4b')]['id']){delete _0x5c5bd7[_0x0d8b('0x4b')]['id'];}return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x5c5bd7[_0x0d8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ef6c3,null))[_0x0d8b('0x26')](saveUpdates(_0x5c5bd7[_0x0d8b('0x4b')],null))['then'](respondWithResult(_0x5ef6c3,null))['catch'](handleError(_0x5ef6c3,null));};exports[_0x0d8b('0x27')]=function(_0x3f2d95,_0x546fef){return db['OpenchannelQueue'][_0x0d8b('0x48')]({'where':{'id':_0x3f2d95[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x546fef,null))[_0x0d8b('0x26')](removeEntity(_0x546fef,null))['catch'](handleError(_0x546fef,null));};exports[_0x0d8b('0x52')]=function(_0x598e03,_0x5c271c){return db[_0x0d8b('0x44')][_0x0d8b('0x52')]()['then'](respondWithResult(_0x5c271c,null))['catch'](handleError(_0x5c271c,null));};exports[_0x0d8b('0x53')]=function(_0x3d7161,_0xccc2a9,_0x2c1eb0){var _0x3afc3a={'raw':!![],'where':{}},_0xb66e76={},_0x3978e5;return db[_0x0d8b('0x44')]['findOne']({'where':{'id':_0x3d7161[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xccc2a9,null))[_0x0d8b('0x26')](function(_0x3c7efb){if(_0x3c7efb){_0x3978e5=_0x3c7efb[_0x0d8b('0x4d')]({'plain':!![]});_0xb66e76[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x54')][_0x0d8b('0x2d')]);_0xb66e76['query']=_[_0x0d8b('0x2e')](_0x3d7161[_0x0d8b('0x2f')]);_0xb66e76[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],_0xb66e76['query']);_0x3afc3a[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3d7161[_0x0d8b('0x2f')]['fields']));_0x3afc3a['attributes']=_0x3afc3a[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x3afc3a[_0x0d8b('0x33')]:_0xb66e76[_0x0d8b('0x32')];if(!_0x3d7161['query'][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3afc3a[_0x0d8b('0x20')]=qs['limit'](_0x3d7161[_0x0d8b('0x2f')]['limit']);_0x3afc3a[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x3afc3a[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x3d7161['query'][_0x0d8b('0x39')]);_0x3afc3a['where']=qs[_0x0d8b('0x30')](_[_0x0d8b('0x55')](_0x3d7161[_0x0d8b('0x2f')],_0xb66e76[_0x0d8b('0x30')]));_0x3afc3a['where'][_0x0d8b('0x56')]=_0x3c7efb['id'];if(_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3afc3a[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3afc3a[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3afc3a[_0x0d8b('0x33')],function(_0x2ce282){var _0x34affb={};_0x34affb[_0x2ce282]={'$like':'%'+_0x3d7161['query']['filter']+'%'};return _0x34affb;})});}_0x3afc3a=_[_0x0d8b('0x3c')]({},_0x3afc3a,_0x3d7161[_0x0d8b('0x41')]);return db['UserOpenchannelQueue'][_0x0d8b('0x45')](_0x3afc3a);}})['then'](function(_0x5cc960){if(_0x5cc960){return db[_0x0d8b('0x58')][_0x0d8b('0x59')]({'where':{'id':_['map'](_0x5cc960,'UserId'),'role':_0x0d8b('0x5a')},'attributes':['id',_0x0d8b('0x2b'),_0x0d8b('0x5b'),_0x0d8b('0x5c'),_0x0d8b('0x5d')]});}})[_0x0d8b('0x26')](function(_0x40d265){if(_0x40d265){return{'count':_0x40d265['count'],'rows':_[_0x0d8b('0x57')](_0x40d265['rows'],function(_0x1a203e){return{'membername':_0x1a203e[_0x0d8b('0x2b')],'UserId':_0x1a203e['id'],'queue_name':_0x3978e5[_0x0d8b('0x2b')],'OpenchannelQueueId':_0x3978e5['id'],'interface':util[_0x0d8b('0x5e')]('%s/%s',_0x0d8b('0x5f'),_0x1a203e['name']),'penalty':0x0,'paused':_0x1a203e[_0x0d8b('0x5b')],'createdAt':_0x1a203e[_0x0d8b('0x5d')],'updatedAt':_0x1a203e[_0x0d8b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d8b('0x26')](respondWithFilteredResult(_0xccc2a9,_0x3afc3a))[_0x0d8b('0x49')](handleError(_0xccc2a9,null));};exports[_0x0d8b('0x60')]=function(_0x3e927c,_0x91aa89,_0x266a69){var _0x44aa74={};var _0x4eb07e={};var _0x1436b3;var _0x54c28b;return db[_0x0d8b('0x44')][_0x0d8b('0x61')]({'where':{'id':_0x3e927c['params']['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x91aa89,null))['then'](function(_0x10c318){if(_0x10c318){_0x1436b3=_0x10c318;_0x4eb07e[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x62')][_0x0d8b('0x2d')]);_0x4eb07e[_0x0d8b('0x2f')]=_[_0x0d8b('0x2e')](_0x3e927c[_0x0d8b('0x2f')]);_0x4eb07e['filters']=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],_0x4eb07e['query']);_0x44aa74[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x44aa74[_0x0d8b('0x33')]=_0x44aa74[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x44aa74[_0x0d8b('0x33')]:_0x4eb07e[_0x0d8b('0x32')];_0x44aa74[_0x0d8b('0x38')]=qs['sort'](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x44aa74[_0x0d8b('0x3b')]=qs['filters'](_['pick'](_0x3e927c[_0x0d8b('0x2f')],_0x4eb07e[_0x0d8b('0x30')]));if(_0x3e927c[_0x0d8b('0x2f')]['filter']){_0x44aa74['where']=_[_0x0d8b('0x3c')](_0x44aa74[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x44aa74[_0x0d8b('0x33')],function(_0x2a2b58){var _0x3f7895={};_0x3f7895[_0x2a2b58]={'$like':'%'+_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x3f7895;})});}_0x44aa74=_[_0x0d8b('0x3c')]({},_0x44aa74,_0x3e927c[_0x0d8b('0x41')]);return _0x1436b3[_0x0d8b('0x60')](_0x44aa74);}})[_0x0d8b('0x26')](function(_0x3b060e){if(_0x3b060e){_0x54c28b=_0x3b060e['length'];if(!_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x36')]('nolimit')){_0x44aa74['limit']=qs[_0x0d8b('0x20')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x44aa74[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3e927c[_0x0d8b('0x2f')]['offset']);}return _0x1436b3['getTeams'](_0x44aa74);}})['then'](function(_0x1f1eae){if(_0x1f1eae){return _0x1f1eae?{'count':_0x54c28b,'rows':_0x1f1eae}:null;}})[_0x0d8b('0x26')](respondWithResult(_0x91aa89,null))[_0x0d8b('0x49')](handleError(_0x91aa89,null));};exports[_0x0d8b('0x63')]=function(_0x3f1eee,_0x21d620,_0x5ef461){var _0x302426=[];var _0x1d173f;return db['Team'][_0x0d8b('0x45')]({'where':{'id':_0x3f1eee['body'][_0x0d8b('0x64')]},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x10c7ab){if(_0x10c7ab){for(var _0x8fae7f=0x0;_0x8fae7f<_0x10c7ab[_0x0d8b('0x35')];_0x8fae7f+=0x1){for(var _0xb73e32=0x0;_0xb73e32<_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0x0d8b('0x35')];_0xb73e32+=0x1){_0x302426=_[_0x0d8b('0x66')](_0x302426,[_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0xb73e32]['id']]);}}return _0x302426;}})['then'](function(_0x4dd64b){if(_0x4dd64b){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3f1eee[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0xf91ecd){if(_0xf91ecd){_0x1d173f=_0xf91ecd;return _0x1d173f[_0x0d8b('0x67')](_0x302426,{'penalty':_0x3f1eee[_0x0d8b('0x4b')]['penalty']});}})[_0x0d8b('0x26')](function(_0x4c3948){if(_0x4c3948){return _0x1d173f[_0x0d8b('0x63')](_0x3f1eee['body']['ids']);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x21d620,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x21d620,null))[_0x0d8b('0x49')](handleError(_0x21d620,null));};exports[_0x0d8b('0x68')]=function(_0x2cf02c,_0x2eece2,_0x3c7b9b){var _0x180eda=[];var _0x35267a;return db[_0x0d8b('0x62')][_0x0d8b('0x45')]({'where':{'id':_0x2cf02c[_0x0d8b('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x5eba19){if(_0x5eba19){for(var _0x4ce443=0x0;_0x4ce443<_0x5eba19[_0x0d8b('0x35')];_0x4ce443+=0x1){for(var _0x671705=0x0;_0x671705<_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x0d8b('0x35')];_0x671705+=0x1){_0x180eda=_[_0x0d8b('0x66')](_0x180eda,[_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x671705]['id']]);}}return _0x180eda;}})['then'](function(_0x1a96ce){if(_0x1a96ce){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x2cf02c[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0x55ea97){if(_0x55ea97){_0x35267a=_0x55ea97;return _0x35267a['removeAgents'](_0x180eda);}})[_0x0d8b('0x26')](function(_0x41ea29){if(_0x35267a){return _0x35267a[_0x0d8b('0x68')](_0x2cf02c['query'][_0x0d8b('0x64')]);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x2eece2,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x2eece2,null))['catch'](handleError(_0x2eece2,null));};exports[_0x0d8b('0x67')]=function(_0x3bc6d5,_0xeca283,_0x9ec9bc){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3bc6d5[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xeca283,null))[_0x0d8b('0x26')](function(_0x4bb4c7){if(_0x4bb4c7){return _0x4bb4c7[_0x0d8b('0x67')](_0x3bc6d5[_0x0d8b('0x4b')][_0x0d8b('0x64')],_[_0x0d8b('0x69')](_0x3bc6d5[_0x0d8b('0x4b')],[_0x0d8b('0x64'),'id'])||{})[_0x0d8b('0x6a')](function(_0x673201){for(var _0x35ebba=0x0;_0x35ebba<_0x3bc6d5['body']['ids'][_0x0d8b('0x35')];_0x35ebba+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6c'),{'UserId':_0x3bc6d5[_0x0d8b('0x4b')]['ids'][_0x35ebba],'OpenchannelQueueId':_0x3bc6d5[_0x0d8b('0x47')]['id']});}return _0x673201;});}})[_0x0d8b('0x26')](respondWithResult(_0xeca283,null))['catch'](handleError(_0xeca283,null));};exports[_0x0d8b('0x6d')]=function(_0x4e1b5b,_0x4fb226,_0x2e5f7a){var _0x33965a;return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x4e1b5b[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4fb226,null))[_0x0d8b('0x26')](function(_0x4ceb3a){if(_0x4ceb3a){return _0x4ceb3a[_0x0d8b('0x6d')](_0x4e1b5b['query']['ids'])[_0x0d8b('0x26')](function(_0x5c50f2){if(_[_0x0d8b('0x6e')](_0x4e1b5b[_0x0d8b('0x2f')]['ids'])){for(var _0x12f2bb=0x0;_0x12f2bb<_0x4e1b5b['query']['ids'][_0x0d8b('0x35')];_0x12f2bb+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')][_0x12f2bb],'OpenchannelQueueId':_0x4e1b5b['params']['id']});}}else{socket['emit'](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')],'OpenchannelQueueId':_0x4e1b5b[_0x0d8b('0x47')]['id']});}});}})[_0x0d8b('0x26')](respondWithStatusCode(_0x4fb226,null))[_0x0d8b('0x49')](handleError(_0x4fb226,null));};exports[_0x0d8b('0x70')]=function(_0x21bfd1,_0x4e3dd1,_0x5ab046){var _0x3582d3={};var _0x2640a6={};var _0x4a453b;var _0x551995;return db['OpenchannelQueue'][_0x0d8b('0x61')]({'where':{'id':_0x21bfd1[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4e3dd1,null))['then'](function(_0x21643d){if(_0x21643d){_0x4a453b=_0x21643d;_0x2640a6[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db['User'][_0x0d8b('0x2d')]);_0x2640a6['query']=_[_0x0d8b('0x2e')](_0x21bfd1['query']);_0x2640a6[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2640a6[_0x0d8b('0x32')],_0x2640a6[_0x0d8b('0x2f')]);_0x3582d3[_0x0d8b('0x33')]=_['intersection'](_0x2640a6[_0x0d8b('0x32')],qs['fields'](_0x21bfd1[_0x0d8b('0x2f')]['fields']));_0x3582d3[_0x0d8b('0x33')]=_0x3582d3['attributes']['length']?_0x3582d3[_0x0d8b('0x33')]:_0x2640a6[_0x0d8b('0x32')];_0x3582d3['order']=qs[_0x0d8b('0x39')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x3582d3['where']=qs['filters'](_['pick'](_0x21bfd1[_0x0d8b('0x2f')],_0x2640a6[_0x0d8b('0x30')]));if(_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3582d3[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3582d3[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3582d3[_0x0d8b('0x33')],function(_0xba602f){var _0x4dc5bd={};_0x4dc5bd[_0xba602f]={'$like':'%'+_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x4dc5bd;})});}_0x3582d3=_[_0x0d8b('0x3c')]({},_0x3582d3,_0x21bfd1['options']);return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x13bce2){if(_0x13bce2){_0x551995=_0x13bce2[_0x0d8b('0x35')];if(!_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3582d3[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x3582d3[_0x0d8b('0x1f')]=qs['offset'](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x590889){if(_0x590889){return _0x590889?{'count':_0x551995,'rows':_0x590889}:null;}})['then'](respondWithResult(_0x4e3dd1,null))[_0x0d8b('0x49')](handleError(_0x4e3dd1,null));}; \ No newline at end of file +var _0xb10b=['name','send','OpenchannelQueue','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','type','key','field','filter','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','hasOwnProperty','OpenchannelQueueId','map','UserOpenchannelQueue','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','User','Agents','union','addAgents','penalty','addTeams','removeTeams','removeAgents','spread','emit','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','get','error','stack'];(function(_0x3d4768,_0x5a378f){var _0x4984d4=function(_0x586905){while(--_0x586905){_0x3d4768['push'](_0x3d4768['shift']());}};_0x4984d4(++_0x5a378f);}(_0xb10b,0x12a));var _0xbb10=function(_0x31b151,_0x42fc2a){_0x31b151=_0x31b151-0x0;var _0x325470=_0xb10b[_0x31b151];return _0x325470;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var hardwareService=require(_0xbb10('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);function respondWithStatusCode(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xcc;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x1d')](_0x42d7e4);}return _0x26e021[_0xbb10('0x1e')](_0x42d7e4)[_0xbb10('0x1f')]();};}function respondWithResult(_0x24a57b,_0x36b5e8){_0x36b5e8=_0x36b5e8||0xc8;return function(_0x3e26f4){if(_0x3e26f4){return _0x24a57b[_0xbb10('0x1e')](_0x36b5e8)['json'](_0x3e26f4);}};}function respondWithFilteredResult(_0x2eca0f,_0x1145f1){return function(_0x133ac2){if(_0x133ac2){var _0x42db98=_0x133ac2[_0xbb10('0x20')],_0x378da8=_0x1145f1[_0xbb10('0x21')],_0x1682a4=_0x1145f1[_0xbb10('0x21')]+_0x1145f1['limit'],_0x575cca;if(_0x1682a4>=_0x42db98){_0x1682a4=_0x42db98;_0x575cca=0xc8;}else{_0x575cca=0xce;}_0x2eca0f[_0xbb10('0x1e')](_0x575cca);return _0x2eca0f[_0xbb10('0x22')](_0xbb10('0x23'),_0x378da8+'-'+_0x1682a4+'/'+_0x42db98)[_0xbb10('0x24')](_0x133ac2);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x25')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x26')](_0x4c4b0d)[_0xbb10('0x27')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x28')]()[_0xbb10('0x27')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x29')]({'plain':!![]});var _0x537898='OpenchannelQueues';return db['UserProfileResource'][_0xbb10('0x28')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x27')](function(){return _0x436104;});})[_0xbb10('0x27')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x1d')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x2a')](_0x4aabb9[_0xbb10('0x2b')]);if(_0x4aabb9[_0xbb10('0x2c')]){delete _0x4aabb9[_0xbb10('0x2c')];}_0x20d946[_0xbb10('0x1e')](_0x2a0e8b)[_0xbb10('0x2d')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=db[_0xbb10('0x2e')]['rawAttributes'];_0x56f2da['model']=_[_0xbb10('0x2f')](_0x1dcc9c);_0x56f2da[_0xbb10('0x30')]=_['keys'](_0x221624[_0xbb10('0x30')]);_0x56f2da[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x56f2da[_0xbb10('0x33')],_0x56f2da[_0xbb10('0x30')]);_0x448d5c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x56f2da['model'],qs[_0xbb10('0x35')](_0x221624[_0xbb10('0x30')][_0xbb10('0x35')]));_0x448d5c[_0xbb10('0x34')]=_0x448d5c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x448d5c[_0xbb10('0x34')]:_0x56f2da[_0xbb10('0x33')];if(!_0x221624[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x448d5c[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x221624[_0xbb10('0x30')]['limit']);_0x448d5c[_0xbb10('0x21')]=qs['offset'](_0x221624['query'][_0xbb10('0x21')]);}_0x448d5c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x221624[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x448d5c[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x221624[_0xbb10('0x30')],_0x56f2da['filters']));if(_0x221624['query']['filter']){_0x448d5c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x448d5c[_0xbb10('0x3b')],{'$or':_['map'](_0x1dcc9c,function(_0x3c0cd7){if(_0x3c0cd7[_0xbb10('0x3e')][_0xbb10('0x3f')]!=='VIRTUAL'){var _0x17b6c5={};_0x17b6c5[_0x3c0cd7[_0xbb10('0x40')]]={'$like':'%'+_0x221624[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x17b6c5;}})});}_0x448d5c=_['merge']({},_0x448d5c,_0x221624[_0xbb10('0x42')]);var _0x110eb5={'where':_0x448d5c['where']};return db[_0xbb10('0x2e')][_0xbb10('0x20')](_0x110eb5)[_0xbb10('0x27')](function(_0x3a9934){_0x16ad2a[_0xbb10('0x20')]=_0x3a9934;if(_0x221624[_0xbb10('0x30')]['includeAll']){_0x448d5c[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x44')](_0x448d5c);})[_0xbb10('0x27')](function(_0x4943d9){_0x16ad2a[_0xbb10('0x45')]=_0x4943d9;return _0x16ad2a;})[_0xbb10('0x27')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))[_0xbb10('0x46')](handleError(_0x4ee02e,null));};exports[_0xbb10('0x47')]=function(_0x5e2cfa,_0x351484){var _0x202c60={'raw':!![],'where':{'id':_0x5e2cfa['params']['id']}},_0x54ac18={};_0x54ac18[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x48')]);_0x54ac18['query']=_[_0xbb10('0x2f')](_0x5e2cfa[_0xbb10('0x30')]);_0x54ac18[_0xbb10('0x31')]=_['intersection'](_0x54ac18[_0xbb10('0x33')],_0x54ac18[_0xbb10('0x30')]);_0x202c60[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x54ac18[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x35')]));_0x202c60[_0xbb10('0x34')]=_0x202c60[_0xbb10('0x34')][_0xbb10('0x36')]?_0x202c60[_0xbb10('0x34')]:_0x54ac18['model'];if(_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x49')]){_0x202c60['include']=[{'all':!![]}];}_0x202c60=_[_0xbb10('0x3d')]({},_0x202c60,_0x5e2cfa[_0xbb10('0x42')]);return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x202c60)[_0xbb10('0x27')](handleEntityNotFound(_0x351484,null))[_0xbb10('0x27')](respondWithResult(_0x351484,null))[_0xbb10('0x46')](handleError(_0x351484,null));};exports['create']=function(_0x4a9793,_0xcb3354){return db[_0xbb10('0x2e')][_0xbb10('0x4b')](_0x4a9793['body'],{})['then'](function(_0x3cd6f3){var _0x34cf4e=_0x4a9793[_0xbb10('0x4c')][_0xbb10('0x29')]({'plain':!![]});if(!_0x34cf4e)throw new Error(_0xbb10('0x4d'));if(_0x34cf4e[_0xbb10('0x4e')]===_0xbb10('0x4c')){var _0x460788=_0x3cd6f3[_0xbb10('0x29')]({'plain':!![]});var _0x3d7e7e='OpenchannelQueues';return db['UserProfileSection'][_0xbb10('0x4a')]({'where':{'name':_0x3d7e7e,'userProfileId':_0x34cf4e[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x27')](function(_0xb014b0){if(_0xb014b0&&_0xb014b0[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x51')][_0xbb10('0x4b')]({'name':_0x460788[_0xbb10('0x2c')],'resourceId':_0x460788['id'],'type':_0xb014b0[_0xbb10('0x2c')],'sectionId':_0xb014b0['id']},{})[_0xbb10('0x27')](function(){return _0x3cd6f3;});}else{return _0x3cd6f3;}})[_0xbb10('0x46')](function(_0x20e18a){logger[_0xbb10('0x2a')](_0xbb10('0x52'),_0x20e18a);throw _0x20e18a;});}return _0x3cd6f3;})[_0xbb10('0x27')](respondWithResult(_0xcb3354,0xc9))['catch'](handleError(_0xcb3354,null));};exports[_0xbb10('0x26')]=function(_0x5bd44d,_0x33d60a){if(_0x5bd44d[_0xbb10('0x53')]['id']){delete _0x5bd44d[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x5bd44d[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x33d60a,null))[_0xbb10('0x27')](saveUpdates(_0x5bd44d[_0xbb10('0x53')],null))[_0xbb10('0x27')](respondWithResult(_0x33d60a,null))[_0xbb10('0x46')](handleError(_0x33d60a,null));};exports[_0xbb10('0x28')]=function(_0x1d49e1,_0x3d7e17){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x1d49e1[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x3d7e17,null))[_0xbb10('0x27')](removeEntity(_0x3d7e17,null))[_0xbb10('0x46')](handleError(_0x3d7e17,null));};exports[_0xbb10('0x55')]=function(_0x379d8c,_0x4bedd0){return db[_0xbb10('0x2e')][_0xbb10('0x55')]()[_0xbb10('0x27')](respondWithResult(_0x4bedd0,null))[_0xbb10('0x46')](handleError(_0x4bedd0,null));};exports[_0xbb10('0x56')]=function(_0x22de7f,_0x175872,_0x12ec18){var _0x205e01={'raw':!![],'where':{}},_0x40c4fb={},_0x2eb05a;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x22de7f['params']['id']}})['then'](handleEntityNotFound(_0x175872,null))[_0xbb10('0x27')](function(_0x3e6338){if(_0x3e6338){_0x2eb05a=_0x3e6338[_0xbb10('0x29')]({'plain':!![]});_0x40c4fb[_0xbb10('0x33')]=_['keys'](db['UserOpenchannelQueue'][_0xbb10('0x48')]);_0x40c4fb[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x22de7f[_0xbb10('0x30')]);_0x40c4fb[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x40c4fb[_0xbb10('0x33')],_0x40c4fb['query']);_0x205e01[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x40c4fb['model'],qs['fields'](_0x22de7f['query'][_0xbb10('0x35')]));_0x205e01[_0xbb10('0x34')]=_0x205e01[_0xbb10('0x34')]['length']?_0x205e01['attributes']:_0x40c4fb['model'];if(!_0x22de7f[_0xbb10('0x30')][_0xbb10('0x58')](_0xbb10('0x37'))){_0x205e01['limit']=qs[_0xbb10('0x38')](_0x22de7f[_0xbb10('0x30')]['limit']);_0x205e01['offset']=qs[_0xbb10('0x21')](_0x22de7f[_0xbb10('0x30')][_0xbb10('0x21')]);}_0x205e01[_0xbb10('0x39')]=qs['sort'](_0x22de7f[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x205e01[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x22de7f[_0xbb10('0x30')],_0x40c4fb[_0xbb10('0x31')]));_0x205e01['where'][_0xbb10('0x59')]=_0x3e6338['id'];if(_0x22de7f[_0xbb10('0x30')][_0xbb10('0x41')]){_0x205e01[_0xbb10('0x3b')]=_['merge'](_0x205e01[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x205e01[_0xbb10('0x34')],function(_0x2d0f4b){var _0x56b3a3={};_0x56b3a3[_0x2d0f4b]={'$like':'%'+_0x22de7f[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x56b3a3;})});}_0x205e01=_[_0xbb10('0x3d')]({},_0x205e01,_0x22de7f[_0xbb10('0x42')]);return db[_0xbb10('0x5b')][_0xbb10('0x44')](_0x205e01);}})[_0xbb10('0x27')](function(_0x4a30c5){if(_0x4a30c5){return db['User']['findAndCountAll']({'where':{'id':_[_0xbb10('0x5a')](_0x4a30c5,_0xbb10('0x5c')),'role':_0xbb10('0x5d')},'attributes':['id','name','openchannelPause',_0xbb10('0x5e'),_0xbb10('0x5f')]});}})[_0xbb10('0x27')](function(_0x3a9677){if(_0x3a9677){return{'count':_0x3a9677[_0xbb10('0x20')],'rows':_[_0xbb10('0x5a')](_0x3a9677['rows'],function(_0x1a5ca5){return{'membername':_0x1a5ca5[_0xbb10('0x2c')],'UserId':_0x1a5ca5['id'],'queue_name':_0x2eb05a[_0xbb10('0x2c')],'OpenchannelQueueId':_0x2eb05a['id'],'interface':util[_0xbb10('0x60')](_0xbb10('0x61'),'SIP',_0x1a5ca5['name']),'penalty':0x0,'paused':_0x1a5ca5['openchannelPause'],'createdAt':_0x1a5ca5[_0xbb10('0x5f')],'updatedAt':_0x1a5ca5[_0xbb10('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbb10('0x27')](respondWithFilteredResult(_0x175872,_0x205e01))[_0xbb10('0x46')](handleError(_0x175872,null));};exports[_0xbb10('0x62')]=function(_0x1d40b8,_0x5d942d,_0x93f3c4){var _0x4bc316={};var _0x4fe3b5={};var _0x519a54;var _0xdf634f;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x1d40b8[_0xbb10('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d942d,null))[_0xbb10('0x27')](function(_0x5c583b){if(_0x5c583b){_0x519a54=_0x5c583b;_0x4fe3b5['model']=_[_0xbb10('0x2f')](db[_0xbb10('0x63')][_0xbb10('0x48')]);_0x4fe3b5[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x1d40b8['query']);_0x4fe3b5[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x4fe3b5[_0xbb10('0x33')],_0x4fe3b5[_0xbb10('0x30')]);_0x4bc316[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x4fe3b5[_0xbb10('0x33')],qs['fields'](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x35')]));_0x4bc316[_0xbb10('0x34')]=_0x4bc316[_0xbb10('0x34')][_0xbb10('0x36')]?_0x4bc316[_0xbb10('0x34')]:_0x4fe3b5[_0xbb10('0x33')];_0x4bc316[_0xbb10('0x39')]=qs['sort'](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x4bc316[_0xbb10('0x3b')]=qs['filters'](_['pick'](_0x1d40b8['query'],_0x4fe3b5[_0xbb10('0x31')]));if(_0x1d40b8['query']['filter']){_0x4bc316[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x4bc316[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x4bc316[_0xbb10('0x34')],function(_0x24dca6){var _0x33116={};_0x33116[_0x24dca6]={'$like':'%'+_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x33116;})});}_0x4bc316=_['merge']({},_0x4bc316,_0x1d40b8[_0xbb10('0x42')]);return _0x519a54[_0xbb10('0x62')](_0x4bc316);}})[_0xbb10('0x27')](function(_0x35b811){if(_0x35b811){_0xdf634f=_0x35b811['length'];if(!_0x1d40b8['query'][_0xbb10('0x58')](_0xbb10('0x37'))){_0x4bc316[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x1d40b8['query'][_0xbb10('0x38')]);_0x4bc316[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x21')]);}return _0x519a54['getTeams'](_0x4bc316);}})['then'](function(_0x372636){if(_0x372636){return _0x372636?{'count':_0xdf634f,'rows':_0x372636}:null;}})[_0xbb10('0x27')](respondWithResult(_0x5d942d,null))[_0xbb10('0x46')](handleError(_0x5d942d,null));};exports['addTeams']=function(_0x256b35,_0x13e2ab,_0x50bcc9){var _0x5caa06=[];var _0x2f667f;return db[_0xbb10('0x63')][_0xbb10('0x44')]({'where':{'id':_0x256b35['body'][_0xbb10('0x64')]},'attributes':['id'],'include':[{'model':db[_0xbb10('0x65')],'as':_0xbb10('0x66'),'attributes':['id'],'raw':!![]}]})[_0xbb10('0x27')](function(_0x2ef96f){if(_0x2ef96f){for(var _0x5de006=0x0;_0x5de006<_0x2ef96f[_0xbb10('0x36')];_0x5de006+=0x1){for(var _0x226363=0x0;_0x226363<_0x2ef96f[_0x5de006][_0xbb10('0x66')]['length'];_0x226363+=0x1){_0x5caa06=_[_0xbb10('0x67')](_0x5caa06,[_0x2ef96f[_0x5de006][_0xbb10('0x66')][_0x226363]['id']]);}}return _0x5caa06;}})[_0xbb10('0x27')](function(_0xdb7d3e){if(_0xdb7d3e){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x256b35[_0xbb10('0x54')]['id']}});}})[_0xbb10('0x27')](function(_0x17ed20){if(_0x17ed20){_0x2f667f=_0x17ed20;return _0x2f667f[_0xbb10('0x68')](_0x5caa06,{'penalty':_0x256b35[_0xbb10('0x53')][_0xbb10('0x69')]});}})['then'](function(_0x51f106){if(_0x51f106){return _0x2f667f[_0xbb10('0x6a')](_0x256b35[_0xbb10('0x53')][_0xbb10('0x64')]);}})[_0xbb10('0x27')](handleEntityNotFound(_0x13e2ab,null))[_0xbb10('0x27')](respondWithStatusCode(_0x13e2ab,null))['catch'](handleError(_0x13e2ab,null));};exports[_0xbb10('0x6b')]=function(_0x332fbe,_0x3b4d0b,_0x1a51d3){var _0x19694d=[];var _0x379d49;return db['Team'][_0xbb10('0x44')]({'where':{'id':_0x332fbe[_0xbb10('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbb10('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbb10('0x27')](function(_0x28bd76){if(_0x28bd76){for(var _0x2b473c=0x0;_0x2b473c<_0x28bd76[_0xbb10('0x36')];_0x2b473c+=0x1){for(var _0x3a4a6e=0x0;_0x3a4a6e<_0x28bd76[_0x2b473c]['Agents'][_0xbb10('0x36')];_0x3a4a6e+=0x1){_0x19694d=_['union'](_0x19694d,[_0x28bd76[_0x2b473c][_0xbb10('0x66')][_0x3a4a6e]['id']]);}}return _0x19694d;}})[_0xbb10('0x27')](function(_0x5d767f){if(_0x5d767f){return db['OpenchannelQueue'][_0xbb10('0x4a')]({'where':{'id':_0x332fbe[_0xbb10('0x54')]['id']}});}})[_0xbb10('0x27')](function(_0x283bab){if(_0x283bab){_0x379d49=_0x283bab;return _0x379d49[_0xbb10('0x6c')](_0x19694d);}})[_0xbb10('0x27')](function(_0x1b6ebc){if(_0x379d49){return _0x379d49[_0xbb10('0x6b')](_0x332fbe[_0xbb10('0x30')][_0xbb10('0x64')]);}})[_0xbb10('0x27')](handleEntityNotFound(_0x3b4d0b,null))['then'](respondWithStatusCode(_0x3b4d0b,null))[_0xbb10('0x46')](handleError(_0x3b4d0b,null));};exports[_0xbb10('0x68')]=function(_0x1b0a6c,_0xcd5d35,_0xfe02f5){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x1b0a6c[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0xcd5d35,null))[_0xbb10('0x27')](function(_0x1c4235){if(_0x1c4235){return _0x1c4235[_0xbb10('0x68')](_0x1b0a6c['body'][_0xbb10('0x64')],_['omit'](_0x1b0a6c[_0xbb10('0x53')],[_0xbb10('0x64'),'id'])||{})[_0xbb10('0x6d')](function(_0x40236c){for(var _0x38d369=0x0;_0x38d369<_0x1b0a6c['body'][_0xbb10('0x64')][_0xbb10('0x36')];_0x38d369+=0x1){socket[_0xbb10('0x6e')](_0xbb10('0x6f'),{'UserId':_0x1b0a6c[_0xbb10('0x53')][_0xbb10('0x64')][_0x38d369],'OpenchannelQueueId':_0x1b0a6c['params']['id']});}return _0x40236c;});}})['then'](respondWithResult(_0xcd5d35,null))[_0xbb10('0x46')](handleError(_0xcd5d35,null));};exports[_0xbb10('0x6c')]=function(_0x41d4d0,_0x57d5a1,_0x124b32){var _0x3d6a91;return db['OpenchannelQueue'][_0xbb10('0x4a')]({'where':{'id':_0x41d4d0[_0xbb10('0x54')]['id']}})['then'](handleEntityNotFound(_0x57d5a1,null))[_0xbb10('0x27')](function(_0x4d7bca){if(_0x4d7bca){return _0x4d7bca[_0xbb10('0x6c')](_0x41d4d0[_0xbb10('0x30')]['ids'])[_0xbb10('0x27')](function(_0x28cc74){if(_['isArray'](_0x41d4d0['query'][_0xbb10('0x64')])){for(var _0x13ae83=0x0;_0x13ae83<_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')][_0xbb10('0x36')];_0x13ae83+=0x1){socket['emit'](_0xbb10('0x70'),{'UserId':_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')][_0x13ae83],'OpenchannelQueueId':_0x41d4d0['params']['id']});}}else{socket[_0xbb10('0x6e')](_0xbb10('0x70'),{'UserId':_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')],'OpenchannelQueueId':_0x41d4d0[_0xbb10('0x54')]['id']});}});}})[_0xbb10('0x27')](respondWithStatusCode(_0x57d5a1,null))[_0xbb10('0x46')](handleError(_0x57d5a1,null));};exports[_0xbb10('0x71')]=function(_0x2010d4,_0x5f1fcd,_0x4fc544){var _0x37e40c={};var _0xe7238b={};var _0x293f3f;var _0x44f097;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x2010d4[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x5f1fcd,null))[_0xbb10('0x27')](function(_0x471827){if(_0x471827){_0x293f3f=_0x471827;_0xe7238b[_0xbb10('0x33')]=_[_0xbb10('0x2f')](db[_0xbb10('0x65')]['rawAttributes']);_0xe7238b[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x2010d4[_0xbb10('0x30')]);_0xe7238b[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0xe7238b[_0xbb10('0x33')],_0xe7238b[_0xbb10('0x30')]);_0x37e40c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0xe7238b[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x2010d4['query'][_0xbb10('0x35')]));_0x37e40c['attributes']=_0x37e40c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x37e40c[_0xbb10('0x34')]:_0xe7238b[_0xbb10('0x33')];_0x37e40c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x2010d4['query'][_0xbb10('0x3a')]);_0x37e40c['where']=qs[_0xbb10('0x31')](_[_0xbb10('0x3c')](_0x2010d4[_0xbb10('0x30')],_0xe7238b[_0xbb10('0x31')]));if(_0x2010d4[_0xbb10('0x30')][_0xbb10('0x41')]){_0x37e40c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x37e40c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x37e40c[_0xbb10('0x34')],function(_0xa09041){var _0x589565={};_0x589565[_0xa09041]={'$like':'%'+_0x2010d4[_0xbb10('0x30')]['filter']+'%'};return _0x589565;})});}_0x37e40c=_[_0xbb10('0x3d')]({},_0x37e40c,_0x2010d4[_0xbb10('0x42')]);return _0x293f3f[_0xbb10('0x71')](_0x37e40c);}})[_0xbb10('0x27')](function(_0x44c229){if(_0x44c229){_0x44f097=_0x44c229[_0xbb10('0x36')];if(!_0x2010d4[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x37e40c['limit']=qs['limit'](_0x2010d4[_0xbb10('0x30')][_0xbb10('0x38')]);_0x37e40c[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x2010d4[_0xbb10('0x30')][_0xbb10('0x21')]);}return _0x293f3f['getAgents'](_0x37e40c);}})[_0xbb10('0x27')](function(_0x2c25ab){if(_0x2c25ab){return _0x2c25ab?{'count':_0x44f097,'rows':_0x2c25ab}:null;}})[_0xbb10('0x27')](respondWithResult(_0x5f1fcd,null))[_0xbb10('0x46')](handleError(_0x5f1fcd,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d105889..f9e9167 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 _0x729a=['update','remove','emit','hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners'];(function(_0x2c71e1,_0x373724){var _0x426876=function(_0x3f46c5){while(--_0x3f46c5){_0x2c71e1['push'](_0x2c71e1['shift']());}};_0x426876(++_0x373724);}(_0x729a,0xc5));var _0xa729=function(_0x52ce55,_0x4b7ee0){_0x52ce55=_0x52ce55-0x0;var _0x4e2670=_0x729a[_0x52ce55];return _0x4e2670;};'use strict';var EventEmitter=require(_0xa729('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xa729('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa729('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa729('0x3'),'afterDestroy':_0xa729('0x4')};function emitEvent(_0x42adbe){return function(_0x28aec8,_0x1896eb,_0x1182ec){OpenchannelQueueEvents[_0xa729('0x5')](_0x42adbe+':'+_0x28aec8['id'],_0x28aec8);OpenchannelQueueEvents[_0xa729('0x5')](_0x42adbe,_0x28aec8);_0x1182ec(null);};}for(var e in events){if(events[_0xa729('0x6')](e)){var event=events[e];OpenchannelQueue[_0xa729('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x3ea3=['hook','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1a5815,_0x35b6c4){var _0x47a9d5=function(_0x192a80){while(--_0x192a80){_0x1a5815['push'](_0x1a5815['shift']());}};_0x47a9d5(++_0x35b6c4);}(_0x3ea3,0x172));var _0x33ea=function(_0xd22d11,_0x467945){_0xd22d11=_0xd22d11-0x0;var _0x7ac94d=_0x3ea3[_0xd22d11];return _0x7ac94d;};'use strict';var EventEmitter=require(_0x33ea('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x33ea('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x33ea('0x2')](0x0);var events={'afterCreate':_0x33ea('0x3'),'afterUpdate':_0x33ea('0x4'),'afterDestroy':_0x33ea('0x5')};function emitEvent(_0x442ece){return function(_0x46d6eb,_0x32f7fa,_0x509977){OpenchannelQueueEvents[_0x33ea('0x6')](_0x442ece+':'+_0x46d6eb['id'],_0x46d6eb);OpenchannelQueueEvents[_0x33ea('0x6')](_0x442ece,_0x46d6eb);_0x509977(null);};}for(var e in events){if(events[_0x33ea('0x7')](e)){var event=events[e];OpenchannelQueue[_0x33ea('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 92102e6..05e5584 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 _0x9f62=['bluebird','exports','define','openchannel_queues','util','api','moment'];(function(_0x1dbee9,_0x5ce2dc){var _0x296487=function(_0x2c4e0a){while(--_0x2c4e0a){_0x1dbee9['push'](_0x1dbee9['shift']());}};_0x296487(++_0x5ce2dc);}(_0x9f62,0x154));var _0x29f6=function(_0x51ebbb,_0x1c721b){_0x51ebbb=_0x51ebbb-0x0;var _0x1b4e35=_0x9f62[_0x51ebbb];return _0x1b4e35;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var attributes=require('./openchannelQueue.attributes');module[_0x29f6('0x4')]=function(_0x2f0420,_0xefa26c){return _0x2f0420[_0x29f6('0x5')]('OpenchannelQueue',attributes,{'tableName':_0x29f6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['lodash','../../config/logger','api','bluebird','request-promise','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x612ce5,_0x3f9440){var _0x1558e8=function(_0x2cfe1a){while(--_0x2cfe1a){_0x612ce5['push'](_0x612ce5['shift']());}};_0x1558e8(++_0x3f9440);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1c56c8,_0x43dd6d){_0x1c56c8=_0x1c56c8-0x0;var _0x524fb7=_0xee5b[_0x1c56c8];return _0x524fb7;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var attributes=require(_0xbee5('0x5'));module[_0xbee5('0x6')]=function(_0x4bd202,_0x5200b1){return _0x4bd202[_0xbee5('0x7')](_0xbee5('0x8'),attributes,{'tableName':_0xbee5('0x9'),'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 673da07..0b1f04a 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 _0x04d0=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','find','ShowOpenchannelQueue'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x04d0,0x10a));var _0x004d=function(_0x47e5be,_0x1a7933){_0x47e5be=_0x47e5be-0x0;var _0x463e80=_0x04d0[_0x47e5be];return _0x463e80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});config[_0x004d('0x8')]=_[_0x004d('0x9')](config['redis'],{'host':_0x004d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x004d('0x8')]));require(_0x004d('0xb'))[_0x004d('0xc')](socket);function respondWithRpcPromise(_0x4c0b02,_0x230f6c,_0x21949b){return new BPromise(function(_0x582cc0,_0x3062b3){return client['request'](_0x4c0b02,_0x21949b)[_0x004d('0xd')](function(_0xd09c35){logger['info'](_0x004d('0xe'),_0x230f6c,'request\x20sent');logger[_0x004d('0xf')](_0x004d('0x10'),_0x230f6c,_0x004d('0x11'),JSON[_0x004d('0x12')](_0xd09c35));if(_0xd09c35[_0x004d('0x13')]){if(_0xd09c35[_0x004d('0x13')][_0x004d('0x14')]===0x1f4){logger[_0x004d('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x230f6c,_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);return _0x3062b3(_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);}logger[_0x004d('0x13')](_0x004d('0xe'),_0x230f6c,_0xd09c35[_0x004d('0x13')][_0x004d('0x15')]);return _0x582cc0(_0xd09c35['error'][_0x004d('0x15')]);}else{logger[_0x004d('0x16')](_0x004d('0xe'),_0x230f6c,'request\x20sent');_0x582cc0(_0xd09c35[_0x004d('0x17')]['message']);}})[_0x004d('0x18')](function(_0x3739ce){logger[_0x004d('0x13')](_0x004d('0xe'),_0x230f6c,_0x3739ce);_0x3062b3(_0x3739ce);});});}exports['GetOpenchannelQueue']=function(_0x1c184c){var _0x30aae7=this;return new Promise(function(_0x518ee8,_0x31ac5c){return db[_0x004d('0x19')][_0x004d('0x1a')]({'raw':_0x1c184c[_0x004d('0x1b')]?_0x1c184c['options'][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1d')]||null:null,'attributes':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'limit':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')][_0x004d('0x1f')]||null:null,'include':_0x1c184c[_0x004d('0x1b')]?_0x1c184c[_0x004d('0x1b')]['include']?_['map'](_0x1c184c[_0x004d('0x1b')][_0x004d('0x20')],function(_0x4a4fe1){return{'model':db[_0x4a4fe1[_0x004d('0x21')]],'as':_0x4a4fe1['as'],'attributes':_0x4a4fe1[_0x004d('0x1e')],'include':_0x4a4fe1[_0x004d('0x20')]?_[_0x004d('0x22')](_0x4a4fe1[_0x004d('0x20')],function(_0x1ccb0e){return{'model':db[_0x1ccb0e[_0x004d('0x21')]],'as':_0x1ccb0e['as'],'attributes':_0x1ccb0e['attributes'],'include':_0x1ccb0e[_0x004d('0x20')]?_['map'](_0x1ccb0e['include'],function(_0x2e7763){return{'model':db[_0x2e7763[_0x004d('0x21')]],'as':_0x2e7763['as'],'attributes':_0x2e7763[_0x004d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x004d('0xd')](function(_0x58015b){logger[_0x004d('0x16')](_0x004d('0x23'),_0x1c184c);logger[_0x004d('0xf')](_0x004d('0x23'),_0x1c184c,JSON[_0x004d('0x12')](_0x58015b));_0x518ee8(_0x58015b);})[_0x004d('0x18')](function(_0x56fa5b){logger[_0x004d('0x13')](_0x004d('0x23'),_0x56fa5b[_0x004d('0x15')],_0x1c184c);_0x31ac5c(_0x30aae7[_0x004d('0x13')](0x1f4,_0x56fa5b['message']));});});};exports['ShowOpenchannelQueue']=function(_0x457385){var _0x4d06d8=this;return new Promise(function(_0x3aa5f3,_0xdfd119){return db[_0x004d('0x19')][_0x004d('0x24')]({'raw':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')][_0x004d('0x1c')]===undefined?!![]:![]:!![],'where':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')][_0x004d('0x1d')]||null:null,'attributes':_0x457385['options']?_0x457385[_0x004d('0x1b')][_0x004d('0x1e')]||null:null,'include':_0x457385[_0x004d('0x1b')]?_0x457385[_0x004d('0x1b')]['include']?_[_0x004d('0x22')](_0x457385[_0x004d('0x1b')]['include'],function(_0x2a96e6){return{'model':db[_0x2a96e6[_0x004d('0x21')]],'as':_0x2a96e6['as'],'attributes':_0x2a96e6[_0x004d('0x1e')],'include':_0x2a96e6[_0x004d('0x20')]?_[_0x004d('0x22')](_0x2a96e6['include'],function(_0x2ef5cf){return{'model':db[_0x2ef5cf[_0x004d('0x21')]],'as':_0x2ef5cf['as'],'attributes':_0x2ef5cf[_0x004d('0x1e')],'include':_0x2ef5cf[_0x004d('0x20')]?_[_0x004d('0x22')](_0x2ef5cf[_0x004d('0x20')],function(_0x28bb5f){return{'model':db[_0x28bb5f[_0x004d('0x21')]],'as':_0x28bb5f['as'],'attributes':_0x28bb5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x004d('0xd')](function(_0x5b7746){logger[_0x004d('0x16')](_0x004d('0x25'),_0x457385);logger[_0x004d('0xf')]('ShowOpenchannelQueue',_0x457385,JSON[_0x004d('0x12')](_0x5b7746));_0x3aa5f3(_0x5b7746);})[_0x004d('0x18')](function(_0x15782b){logger['error'](_0x004d('0x25'),_0x15782b['message'],_0x457385);_0xdfd119(_0x4d06d8[_0x004d('0x13')](0x1f4,_0x15782b[_0x004d('0x15')]));});});}; \ No newline at end of file +var _0x19da=['debug','ShowOpenchannelQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','info'];(function(_0x585785,_0x287aca){var _0x1403e0=function(_0x4becee){while(--_0x4becee){_0x585785['push'](_0x585785['shift']());}};_0x1403e0(++_0x287aca);}(_0x19da,0x9f));var _0xa19d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x19da[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var moment=require('moment');var BPromise=require(_0xa19d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19d('0x2'));var db=require(_0xa19d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa19d('0x4'))(_0xa19d('0x5'));var config=require('../../config/environment');var jayson=require(_0xa19d('0x6'));var client=jayson[_0xa19d('0x7')][_0xa19d('0x8')]({'port':0x232a});config[_0xa19d('0x9')]=_[_0xa19d('0xa')](config[_0xa19d('0x9')],{'host':_0xa19d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa19d('0x9')]));require(_0xa19d('0xc'))[_0xa19d('0xd')](socket);function respondWithRpcPromise(_0x53260e,_0x2087d1,_0xde2328){return new BPromise(function(_0x447885,_0x1b8a92){return client[_0xa19d('0xe')](_0x53260e,_0xde2328)[_0xa19d('0xf')](function(_0x565bb2){logger['info'](_0xa19d('0x10'),_0x2087d1,_0xa19d('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2087d1,_0xa19d('0x11'),JSON[_0xa19d('0x12')](_0x565bb2));if(_0x565bb2['error']){if(_0x565bb2[_0xa19d('0x13')][_0xa19d('0x14')]===0x1f4){logger[_0xa19d('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x2087d1,_0x565bb2[_0xa19d('0x13')]['message']);return _0x1b8a92(_0x565bb2[_0xa19d('0x13')][_0xa19d('0x15')]);}logger[_0xa19d('0x13')](_0xa19d('0x10'),_0x2087d1,_0x565bb2[_0xa19d('0x13')][_0xa19d('0x15')]);return _0x447885(_0x565bb2[_0xa19d('0x13')][_0xa19d('0x15')]);}else{logger['info'](_0xa19d('0x10'),_0x2087d1,'request\x20sent');_0x447885(_0x565bb2[_0xa19d('0x16')][_0xa19d('0x15')]);}})[_0xa19d('0x17')](function(_0x2825e6){logger[_0xa19d('0x13')](_0xa19d('0x10'),_0x2087d1,_0x2825e6);_0x1b8a92(_0x2825e6);});});}exports[_0xa19d('0x18')]=function(_0x54514e){var _0x2ae6d2=this;return new Promise(function(_0x3d9b03,_0x1d1f5e){return db[_0xa19d('0x19')][_0xa19d('0x1a')]({'raw':_0x54514e[_0xa19d('0x1b')]?_0x54514e[_0xa19d('0x1b')][_0xa19d('0x1c')]===undefined?!![]:![]:!![],'where':_0x54514e[_0xa19d('0x1b')]?_0x54514e['options'][_0xa19d('0x1d')]||null:null,'attributes':_0x54514e['options']?_0x54514e[_0xa19d('0x1b')][_0xa19d('0x1e')]||null:null,'limit':_0x54514e[_0xa19d('0x1b')]?_0x54514e[_0xa19d('0x1b')][_0xa19d('0x1f')]||null:null,'include':_0x54514e[_0xa19d('0x1b')]?_0x54514e[_0xa19d('0x1b')][_0xa19d('0x20')]?_[_0xa19d('0x21')](_0x54514e[_0xa19d('0x1b')][_0xa19d('0x20')],function(_0x16b6d1){return{'model':db[_0x16b6d1[_0xa19d('0x22')]],'as':_0x16b6d1['as'],'attributes':_0x16b6d1[_0xa19d('0x1e')],'include':_0x16b6d1[_0xa19d('0x20')]?_[_0xa19d('0x21')](_0x16b6d1[_0xa19d('0x20')],function(_0x1e1306){return{'model':db[_0x1e1306[_0xa19d('0x22')]],'as':_0x1e1306['as'],'attributes':_0x1e1306[_0xa19d('0x1e')],'include':_0x1e1306[_0xa19d('0x20')]?_['map'](_0x1e1306['include'],function(_0x5c6537){return{'model':db[_0x5c6537[_0xa19d('0x22')]],'as':_0x5c6537['as'],'attributes':_0x5c6537[_0xa19d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa19d('0xf')](function(_0x2dcb39){logger[_0xa19d('0x23')]('GetOpenchannelQueue',_0x54514e);logger[_0xa19d('0x24')](_0xa19d('0x18'),_0x54514e,JSON[_0xa19d('0x12')](_0x2dcb39));_0x3d9b03(_0x2dcb39);})[_0xa19d('0x17')](function(_0x57f03e){logger[_0xa19d('0x13')](_0xa19d('0x18'),_0x57f03e[_0xa19d('0x15')],_0x54514e);_0x1d1f5e(_0x2ae6d2['error'](0x1f4,_0x57f03e['message']));});});};exports[_0xa19d('0x25')]=function(_0x124df6){var _0x49a1e0=this;return new Promise(function(_0x18e02e,_0x30eba5){return db['OpenchannelQueue'][_0xa19d('0x26')]({'raw':_0x124df6[_0xa19d('0x1b')]?_0x124df6[_0xa19d('0x1b')][_0xa19d('0x1c')]===undefined?!![]:![]:!![],'where':_0x124df6[_0xa19d('0x1b')]?_0x124df6['options'][_0xa19d('0x1d')]||null:null,'attributes':_0x124df6[_0xa19d('0x1b')]?_0x124df6[_0xa19d('0x1b')][_0xa19d('0x1e')]||null:null,'include':_0x124df6[_0xa19d('0x1b')]?_0x124df6['options'][_0xa19d('0x20')]?_[_0xa19d('0x21')](_0x124df6[_0xa19d('0x1b')][_0xa19d('0x20')],function(_0x2e9709){return{'model':db[_0x2e9709[_0xa19d('0x22')]],'as':_0x2e9709['as'],'attributes':_0x2e9709[_0xa19d('0x1e')],'include':_0x2e9709[_0xa19d('0x20')]?_['map'](_0x2e9709['include'],function(_0x12318a){return{'model':db[_0x12318a['model']],'as':_0x12318a['as'],'attributes':_0x12318a[_0xa19d('0x1e')],'include':_0x12318a[_0xa19d('0x20')]?_['map'](_0x12318a[_0xa19d('0x20')],function(_0x1094b8){return{'model':db[_0x1094b8[_0xa19d('0x22')]],'as':_0x1094b8['as'],'attributes':_0x1094b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa19d('0xf')](function(_0x198a88){logger[_0xa19d('0x23')]('ShowOpenchannelQueue',_0x124df6);logger[_0xa19d('0x24')](_0xa19d('0x25'),_0x124df6,JSON[_0xa19d('0x12')](_0x198a88));_0x18e02e(_0x198a88);})[_0xa19d('0x17')](function(_0x30d707){logger[_0xa19d('0x13')](_0xa19d('0x25'),_0x30d707[_0xa19d('0x15')],_0x124df6);_0x30eba5(_0x49a1e0[_0xa19d('0x13')](0x1f4,_0x30d707[_0xa19d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 6e6db98..31ae607 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0c731dc..5db75ad 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x56b04e,_0x471ebc){var _0x4149b9=function(_0x591220){while(--_0x591220){_0x56b04e['push'](_0x56b04e['shift']());}};_0x4149b9(++_0x471ebc);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c4ae4,_0x1bfaf3){_0x3c4ae4=_0x3c4ae4-0x0;var _0x3d4c2d=_0xb10b[_0x3c4ae4];return _0x3d4c2d;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3c8b3f6..f5cd9c7 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 _0xbe87=['sequelize','exports','STRING','DATE','moment'];(function(_0x1c996c,_0xc6a7b9){var _0x21966e=function(_0x76e799){while(--_0x76e799){_0x1c996c['push'](_0x1c996c['shift']());}};_0x21966e(++_0xc6a7b9);}(_0xbe87,0x121));var _0x7be8=function(_0x14cb7e,_0x20abae){_0x14cb7e=_0x14cb7e-0x0;var _0x51eba2=_0xbe87[_0x14cb7e];return _0x51eba2;};'use strict';var moment=require(_0x7be8('0x0'));var Sequelize=require(_0x7be8('0x1'));module[_0x7be8('0x2')]={'uniqueid':{'type':Sequelize[_0x7be8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7be8('0x3')]},'joinAt':{'type':Sequelize[_0x7be8('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7be8('0x4')]},'exitAt':{'type':Sequelize[_0x7be8('0x4')]},'reason':{'type':Sequelize[_0x7be8('0x3')]}}; \ No newline at end of file +var _0xa433=['STRING','DATE','moment'];(function(_0x40c25e,_0x2e58b9){var _0x2f66d4=function(_0x3a902e){while(--_0x3a902e){_0x40c25e['push'](_0x40c25e['shift']());}};_0x2f66d4(++_0x2e58b9);}(_0xa433,0x1e2));var _0x3a43=function(_0x498263,_0x2ab64a){_0x498263=_0x498263-0x0;var _0x578232=_0xa433[_0x498263];return _0x578232;};'use strict';var moment=require(_0x3a43('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3a43('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3a43('0x1')]},'joinAt':{'type':Sequelize[_0x3a43('0x2')]},'leaveAt':{'type':Sequelize[_0x3a43('0x2')]},'acceptAt':{'type':Sequelize[_0x3a43('0x2')]},'exitAt':{'type':Sequelize[_0x3a43('0x2')]},'reason':{'type':Sequelize[_0x3a43('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index da3927f..765835d 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 _0xa5c4=['error','stack','name','index','OpenchannelQueueReport','rawAttributes','keys','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','key','field','options','includeAll','include','findAll','rows','catch','show','params','filters','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then'];(function(_0x28382e,_0x4c82ae){var _0xf2998a=function(_0x21f324){while(--_0x21f324){_0x28382e['push'](_0x28382e['shift']());}};_0xf2998a(++_0x4c82ae);}(_0xa5c4,0x197));var _0x4a5c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa5c4[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4a5c('0x0'));var rimraf=require(_0x4a5c('0x1'));var zipdir=require(_0x4a5c('0x2'));var jsonpatch=require(_0x4a5c('0x3'));var rp=require(_0x4a5c('0x4'));var moment=require(_0x4a5c('0x5'));var BPromise=require(_0x4a5c('0x6'));var Mustache=require(_0x4a5c('0x7'));var util=require(_0x4a5c('0x8'));var path=require(_0x4a5c('0x9'));var sox=require(_0x4a5c('0xa'));var csv=require(_0x4a5c('0xb'));var ejs=require(_0x4a5c('0xc'));var fs=require('fs');var _=require(_0x4a5c('0xd'));var squel=require('squel');var crypto=require(_0x4a5c('0xe'));var jsforce=require(_0x4a5c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4a5c('0xb'));var querystring=require(_0x4a5c('0x10'));var Papa=require('papaparse');var authService=require(_0x4a5c('0x11'));var hardwareService=require(_0x4a5c('0x12'));var Redis=require(_0x4a5c('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x4a5c('0x14'))(_0x4a5c('0x15'));var utils=require(_0x4a5c('0x16'));var config=require(_0x4a5c('0x17'));var db=require(_0x4a5c('0x18'))['db'];function respondWithStatusCode(_0xdb4adf,_0x2d9ad2){_0x2d9ad2=_0x2d9ad2||0xcc;return function(_0x89af01){if(_0x89af01){return _0xdb4adf[_0x4a5c('0x19')](_0x2d9ad2);}return _0xdb4adf[_0x4a5c('0x1a')](_0x2d9ad2)[_0x4a5c('0x1b')]();};}function respondWithResult(_0x2f66ea,_0x13aaf4){_0x13aaf4=_0x13aaf4||0xc8;return function(_0x3bf70c){if(_0x3bf70c){return _0x2f66ea[_0x4a5c('0x1a')](_0x13aaf4)[_0x4a5c('0x1c')](_0x3bf70c);}};}function respondWithFilteredResult(_0x1f9bdf,_0x2f4a27){return function(_0x255570){if(_0x255570){var _0x5a1902=_0x255570[_0x4a5c('0x1d')],_0x20ab95=_0x2f4a27[_0x4a5c('0x1e')],_0x3c8dc9=_0x2f4a27[_0x4a5c('0x1e')]+_0x2f4a27['limit'],_0x4d30a6;if(_0x3c8dc9>=_0x5a1902){_0x3c8dc9=_0x5a1902;_0x4d30a6=0xc8;}else{_0x4d30a6=0xce;}_0x1f9bdf[_0x4a5c('0x1a')](_0x4d30a6);return _0x1f9bdf[_0x4a5c('0x1f')](_0x4a5c('0x20'),_0x20ab95+'-'+_0x3c8dc9+'/'+_0x5a1902)['json'](_0x255570);}return null;};}function patchUpdates(_0x5656c5){return function(_0x1f6a5a){try{jsonpatch[_0x4a5c('0x21')](_0x1f6a5a,_0x5656c5,!![]);}catch(_0x33242e){return BPromise[_0x4a5c('0x22')](_0x33242e);}return _0x1f6a5a['save']();};}function saveUpdates(_0x450a49,_0x1ddcc6){return function(_0x1be510){if(_0x1be510){return _0x1be510[_0x4a5c('0x23')](_0x450a49)[_0x4a5c('0x24')](function(_0x1a2277){return _0x1a2277;});}return null;};}function removeEntity(_0x492a2c,_0x3ac945){return function(_0xb22b81){if(_0xb22b81){return _0xb22b81['destroy']()[_0x4a5c('0x24')](function(){_0x492a2c['status'](0xcc)[_0x4a5c('0x1b')]();});}};}function handleEntityNotFound(_0x40d12a,_0x3bbed7){return function(_0x91aff0){if(!_0x91aff0){_0x40d12a['sendStatus'](0x194);}return _0x91aff0;};}function handleError(_0x990d39,_0x57a067){_0x57a067=_0x57a067||0x1f4;return function(_0x428a57){logger[_0x4a5c('0x25')](_0x428a57[_0x4a5c('0x26')]);if(_0x428a57[_0x4a5c('0x27')]){delete _0x428a57[_0x4a5c('0x27')];}_0x990d39[_0x4a5c('0x1a')](_0x57a067)['send'](_0x428a57);};}exports[_0x4a5c('0x28')]=function(_0x32ed33,_0x36fd40){var _0x3a0898={},_0x565157={},_0x40fe95={'count':0x0,'rows':[]};var _0x3e4a03=db[_0x4a5c('0x29')][_0x4a5c('0x2a')];_0x565157['model']=_[_0x4a5c('0x2b')](_0x3e4a03);_0x565157[_0x4a5c('0x2c')]=_['keys'](_0x32ed33[_0x4a5c('0x2c')]);_0x565157['filters']=_['intersection'](_0x565157[_0x4a5c('0x2d')],_0x565157['query']);_0x3a0898['attributes']=_[_0x4a5c('0x2e')](_0x565157[_0x4a5c('0x2d')],qs[_0x4a5c('0x2f')](_0x32ed33[_0x4a5c('0x2c')][_0x4a5c('0x2f')]));_0x3a0898[_0x4a5c('0x30')]=_0x3a0898[_0x4a5c('0x30')]['length']?_0x3a0898['attributes']:_0x565157['model'];if(!_0x32ed33[_0x4a5c('0x2c')][_0x4a5c('0x31')](_0x4a5c('0x32'))){_0x3a0898[_0x4a5c('0x33')]=qs[_0x4a5c('0x33')](_0x32ed33['query'][_0x4a5c('0x33')]);_0x3a0898[_0x4a5c('0x1e')]=qs[_0x4a5c('0x1e')](_0x32ed33['query']['offset']);}_0x3a0898[_0x4a5c('0x34')]=qs[_0x4a5c('0x35')](_0x32ed33[_0x4a5c('0x2c')]['sort']);_0x3a0898[_0x4a5c('0x36')]=qs['filters'](_['pick'](_0x32ed33[_0x4a5c('0x2c')],_0x565157['filters']));if(_0x32ed33['query'][_0x4a5c('0x37')]){_0x3a0898[_0x4a5c('0x36')]=_[_0x4a5c('0x38')](_0x3a0898[_0x4a5c('0x36')],{'$or':_['map'](_0x3e4a03,function(_0x30e10d){if(_0x30e10d['type'][_0x4a5c('0x39')]!=='VIRTUAL'){var _0x1f76b3={};_0x1f76b3[_0x30e10d[_0x4a5c('0x3a')]]={'$like':'%'+_0x32ed33[_0x4a5c('0x2c')]['filter']+'%'};return _0x1f76b3;}})});}_0x3a0898=_[_0x4a5c('0x38')]({},_0x3a0898,_0x32ed33[_0x4a5c('0x3b')]);var _0xf9b0c8={'where':_0x3a0898['where']};return db[_0x4a5c('0x29')][_0x4a5c('0x1d')](_0xf9b0c8)['then'](function(_0x369d7c){_0x40fe95[_0x4a5c('0x1d')]=_0x369d7c;if(_0x32ed33[_0x4a5c('0x2c')][_0x4a5c('0x3c')]){_0x3a0898[_0x4a5c('0x3d')]=[{'all':!![]}];}return db[_0x4a5c('0x29')][_0x4a5c('0x3e')](_0x3a0898);})[_0x4a5c('0x24')](function(_0x4adb49){_0x40fe95[_0x4a5c('0x3f')]=_0x4adb49;return _0x40fe95;})[_0x4a5c('0x24')](respondWithFilteredResult(_0x36fd40,_0x3a0898))[_0x4a5c('0x40')](handleError(_0x36fd40,null));};exports[_0x4a5c('0x41')]=function(_0x327260,_0x1f6287){var _0x218093={'raw':!![],'where':{'id':_0x327260[_0x4a5c('0x42')]['id']}},_0x440356={};_0x440356['model']=_[_0x4a5c('0x2b')](db[_0x4a5c('0x29')][_0x4a5c('0x2a')]);_0x440356[_0x4a5c('0x2c')]=_[_0x4a5c('0x2b')](_0x327260[_0x4a5c('0x2c')]);_0x440356[_0x4a5c('0x43')]=_[_0x4a5c('0x2e')](_0x440356[_0x4a5c('0x2d')],_0x440356[_0x4a5c('0x2c')]);_0x218093[_0x4a5c('0x30')]=_[_0x4a5c('0x2e')](_0x440356[_0x4a5c('0x2d')],qs[_0x4a5c('0x2f')](_0x327260[_0x4a5c('0x2c')][_0x4a5c('0x2f')]));_0x218093[_0x4a5c('0x30')]=_0x218093[_0x4a5c('0x30')][_0x4a5c('0x44')]?_0x218093[_0x4a5c('0x30')]:_0x440356[_0x4a5c('0x2d')];if(_0x327260['query'][_0x4a5c('0x3c')]){_0x218093[_0x4a5c('0x3d')]=[{'all':!![]}];}_0x218093=_[_0x4a5c('0x38')]({},_0x218093,_0x327260[_0x4a5c('0x3b')]);return db[_0x4a5c('0x29')][_0x4a5c('0x45')](_0x218093)[_0x4a5c('0x24')](handleEntityNotFound(_0x1f6287,null))[_0x4a5c('0x24')](respondWithResult(_0x1f6287,null))[_0x4a5c('0x40')](handleError(_0x1f6287,null));};exports['create']=function(_0x3f439e,_0x198d06){return db['OpenchannelQueueReport'][_0x4a5c('0x46')](_0x3f439e[_0x4a5c('0x47')],{})[_0x4a5c('0x24')](respondWithResult(_0x198d06,0xc9))[_0x4a5c('0x40')](handleError(_0x198d06,null));};exports['update']=function(_0x1090d8,_0x398394){if(_0x1090d8[_0x4a5c('0x47')]['id']){delete _0x1090d8[_0x4a5c('0x47')]['id'];}return db['OpenchannelQueueReport'][_0x4a5c('0x45')]({'where':{'id':_0x1090d8[_0x4a5c('0x42')]['id']}})[_0x4a5c('0x24')](handleEntityNotFound(_0x398394,null))[_0x4a5c('0x24')](saveUpdates(_0x1090d8[_0x4a5c('0x47')],null))[_0x4a5c('0x24')](respondWithResult(_0x398394,null))[_0x4a5c('0x40')](handleError(_0x398394,null));};exports[_0x4a5c('0x48')]=function(_0x1381b8,_0x422836){return db[_0x4a5c('0x29')][_0x4a5c('0x45')]({'where':{'id':_0x1381b8[_0x4a5c('0x42')]['id']}})[_0x4a5c('0x24')](handleEntityNotFound(_0x422836,null))[_0x4a5c('0x24')](removeEntity(_0x422836,null))[_0x4a5c('0x40')](handleError(_0x422836,null));};exports[_0x4a5c('0x49')]=function(_0x245d2e,_0x4ed743){return db[_0x4a5c('0x29')][_0x4a5c('0x49')]()[_0x4a5c('0x24')](respondWithResult(_0x4ed743,null))[_0x4a5c('0x40')](handleError(_0x4ed743,null));}; \ No newline at end of file +var _0x80f5=['catch','show','length','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','reject','update','then','stack','name','index','OpenchannelQueueReport','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows'];(function(_0x4329a7,_0x197d30){var _0x425829=function(_0x2854e5){while(--_0x2854e5){_0x4329a7['push'](_0x4329a7['shift']());}};_0x425829(++_0x197d30);}(_0x80f5,0x95));var _0x580f=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x80f5[_0x56fe98];return _0x212f4f;};'use strict';var pdf=require(_0x580f('0x0'));var emlformat=require(_0x580f('0x1'));var rimraf=require(_0x580f('0x2'));var zipdir=require(_0x580f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x580f('0x4'));var moment=require(_0x580f('0x5'));var BPromise=require(_0x580f('0x6'));var Mustache=require(_0x580f('0x7'));var util=require('util');var path=require(_0x580f('0x8'));var sox=require(_0x580f('0x9'));var csv=require(_0x580f('0xa'));var ejs=require(_0x580f('0xb'));var fs=require('fs');var _=require(_0x580f('0xc'));var squel=require(_0x580f('0xd'));var crypto=require('crypto');var jsforce=require(_0x580f('0xe'));var deskjs=require(_0x580f('0xf'));var toCsv=require(_0x580f('0xa'));var querystring=require(_0x580f('0x10'));var Papa=require(_0x580f('0x11'));var authService=require(_0x580f('0x12'));var hardwareService=require(_0x580f('0x13'));var Redis=require(_0x580f('0x14'));var qs=require(_0x580f('0x15'));var logger=require('../../config/logger')(_0x580f('0x16'));var utils=require(_0x580f('0x17'));var config=require(_0x580f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b7811,_0x18c95c){_0x18c95c=_0x18c95c||0xcc;return function(_0x5c51f3){if(_0x5c51f3){return _0x1b7811[_0x580f('0x19')](_0x18c95c);}return _0x1b7811[_0x580f('0x1a')](_0x18c95c)['end']();};}function respondWithResult(_0x1e664a,_0x3977d1){_0x3977d1=_0x3977d1||0xc8;return function(_0xeef296){if(_0xeef296){return _0x1e664a[_0x580f('0x1a')](_0x3977d1)[_0x580f('0x1b')](_0xeef296);}};}function respondWithFilteredResult(_0x51312f,_0x1af93f){return function(_0x3f8773){if(_0x3f8773){var _0x1768ef=_0x3f8773[_0x580f('0x1c')],_0x357096=_0x1af93f[_0x580f('0x1d')],_0xad6b70=_0x1af93f['offset']+_0x1af93f[_0x580f('0x1e')],_0x5920b0;if(_0xad6b70>=_0x1768ef){_0xad6b70=_0x1768ef;_0x5920b0=0xc8;}else{_0x5920b0=0xce;}_0x51312f[_0x580f('0x1a')](_0x5920b0);return _0x51312f['set']('Content-Range',_0x357096+'-'+_0xad6b70+'/'+_0x1768ef)[_0x580f('0x1b')](_0x3f8773);}return null;};}function patchUpdates(_0xf5a076){return function(_0xc410aa){try{jsonpatch['apply'](_0xc410aa,_0xf5a076,!![]);}catch(_0x289c20){return BPromise[_0x580f('0x1f')](_0x289c20);}return _0xc410aa['save']();};}function saveUpdates(_0xca1346,_0x24cf3f){return function(_0x18d90b){if(_0x18d90b){return _0x18d90b[_0x580f('0x20')](_0xca1346)[_0x580f('0x21')](function(_0x207e47){return _0x207e47;});}return null;};}function removeEntity(_0x82010,_0x13c39e){return function(_0x16239d){if(_0x16239d){return _0x16239d['destroy']()[_0x580f('0x21')](function(){_0x82010[_0x580f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d07d7,_0x496a37){return function(_0xf9c174){if(!_0xf9c174){_0x4d07d7[_0x580f('0x19')](0x194);}return _0xf9c174;};}function handleError(_0x316e8d,_0x130416){_0x130416=_0x130416||0x1f4;return function(_0x2cd625){logger['error'](_0x2cd625[_0x580f('0x22')]);if(_0x2cd625[_0x580f('0x23')]){delete _0x2cd625[_0x580f('0x23')];}_0x316e8d[_0x580f('0x1a')](_0x130416)['send'](_0x2cd625);};}exports[_0x580f('0x24')]=function(_0x5df3a1,_0x2a1346){var _0x2faea6={},_0x56b23b={},_0xaba222={'count':0x0,'rows':[]};var _0x2fa92e=db[_0x580f('0x25')]['rawAttributes'];_0x56b23b[_0x580f('0x26')]=_[_0x580f('0x27')](_0x2fa92e);_0x56b23b[_0x580f('0x28')]=_['keys'](_0x5df3a1[_0x580f('0x28')]);_0x56b23b[_0x580f('0x29')]=_[_0x580f('0x2a')](_0x56b23b[_0x580f('0x26')],_0x56b23b['query']);_0x2faea6[_0x580f('0x2b')]=_[_0x580f('0x2a')](_0x56b23b[_0x580f('0x26')],qs[_0x580f('0x2c')](_0x5df3a1[_0x580f('0x28')][_0x580f('0x2c')]));_0x2faea6[_0x580f('0x2b')]=_0x2faea6[_0x580f('0x2b')]['length']?_0x2faea6[_0x580f('0x2b')]:_0x56b23b[_0x580f('0x26')];if(!_0x5df3a1[_0x580f('0x28')][_0x580f('0x2d')](_0x580f('0x2e'))){_0x2faea6['limit']=qs[_0x580f('0x1e')](_0x5df3a1[_0x580f('0x28')][_0x580f('0x1e')]);_0x2faea6[_0x580f('0x1d')]=qs[_0x580f('0x1d')](_0x5df3a1[_0x580f('0x28')][_0x580f('0x1d')]);}_0x2faea6['order']=qs[_0x580f('0x2f')](_0x5df3a1[_0x580f('0x28')][_0x580f('0x2f')]);_0x2faea6[_0x580f('0x30')]=qs['filters'](_[_0x580f('0x31')](_0x5df3a1[_0x580f('0x28')],_0x56b23b[_0x580f('0x29')]));if(_0x5df3a1['query'][_0x580f('0x32')]){_0x2faea6[_0x580f('0x30')]=_[_0x580f('0x33')](_0x2faea6[_0x580f('0x30')],{'$or':_[_0x580f('0x34')](_0x2fa92e,function(_0x418268){if(_0x418268[_0x580f('0x35')][_0x580f('0x36')]!=='VIRTUAL'){var _0x19a8c4={};_0x19a8c4[_0x418268[_0x580f('0x37')]]={'$like':'%'+_0x5df3a1[_0x580f('0x28')][_0x580f('0x32')]+'%'};return _0x19a8c4;}})});}_0x2faea6=_[_0x580f('0x33')]({},_0x2faea6,_0x5df3a1[_0x580f('0x38')]);var _0x470da7={'where':_0x2faea6[_0x580f('0x30')]};return db[_0x580f('0x25')][_0x580f('0x1c')](_0x470da7)[_0x580f('0x21')](function(_0x57157d){_0xaba222[_0x580f('0x1c')]=_0x57157d;if(_0x5df3a1[_0x580f('0x28')][_0x580f('0x39')]){_0x2faea6[_0x580f('0x3a')]=[{'all':!![]}];}return db[_0x580f('0x25')][_0x580f('0x3b')](_0x2faea6);})['then'](function(_0x31930f){_0xaba222[_0x580f('0x3c')]=_0x31930f;return _0xaba222;})[_0x580f('0x21')](respondWithFilteredResult(_0x2a1346,_0x2faea6))[_0x580f('0x3d')](handleError(_0x2a1346,null));};exports[_0x580f('0x3e')]=function(_0xbc0f28,_0x46cb1b){var _0x4fe653={'raw':!![],'where':{'id':_0xbc0f28['params']['id']}},_0x3e388b={};_0x3e388b[_0x580f('0x26')]=_[_0x580f('0x27')](db['OpenchannelQueueReport']['rawAttributes']);_0x3e388b[_0x580f('0x28')]=_[_0x580f('0x27')](_0xbc0f28['query']);_0x3e388b[_0x580f('0x29')]=_[_0x580f('0x2a')](_0x3e388b[_0x580f('0x26')],_0x3e388b['query']);_0x4fe653[_0x580f('0x2b')]=_[_0x580f('0x2a')](_0x3e388b[_0x580f('0x26')],qs['fields'](_0xbc0f28[_0x580f('0x28')]['fields']));_0x4fe653[_0x580f('0x2b')]=_0x4fe653['attributes'][_0x580f('0x3f')]?_0x4fe653[_0x580f('0x2b')]:_0x3e388b['model'];if(_0xbc0f28[_0x580f('0x28')][_0x580f('0x39')]){_0x4fe653[_0x580f('0x3a')]=[{'all':!![]}];}_0x4fe653=_[_0x580f('0x33')]({},_0x4fe653,_0xbc0f28[_0x580f('0x38')]);return db[_0x580f('0x25')][_0x580f('0x40')](_0x4fe653)[_0x580f('0x21')](handleEntityNotFound(_0x46cb1b,null))[_0x580f('0x21')](respondWithResult(_0x46cb1b,null))[_0x580f('0x3d')](handleError(_0x46cb1b,null));};exports[_0x580f('0x41')]=function(_0x38af24,_0x2eaca5){return db[_0x580f('0x25')][_0x580f('0x41')](_0x38af24[_0x580f('0x42')],{})['then'](respondWithResult(_0x2eaca5,0xc9))[_0x580f('0x3d')](handleError(_0x2eaca5,null));};exports[_0x580f('0x20')]=function(_0x37ca10,_0x154222){if(_0x37ca10['body']['id']){delete _0x37ca10[_0x580f('0x42')]['id'];}return db[_0x580f('0x25')][_0x580f('0x40')]({'where':{'id':_0x37ca10[_0x580f('0x43')]['id']}})[_0x580f('0x21')](handleEntityNotFound(_0x154222,null))[_0x580f('0x21')](saveUpdates(_0x37ca10[_0x580f('0x42')],null))['then'](respondWithResult(_0x154222,null))[_0x580f('0x3d')](handleError(_0x154222,null));};exports[_0x580f('0x44')]=function(_0x546acf,_0x1ec402){return db[_0x580f('0x25')]['find']({'where':{'id':_0x546acf['params']['id']}})['then'](handleEntityNotFound(_0x1ec402,null))['then'](removeEntity(_0x1ec402,null))[_0x580f('0x3d')](handleError(_0x1ec402,null));};exports[_0x580f('0x45')]=function(_0x2b26c2,_0x416ac1){return db[_0x580f('0x25')][_0x580f('0x45')]()[_0x580f('0x21')](respondWithResult(_0x416ac1,null))[_0x580f('0x3d')](handleError(_0x416ac1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ae200d9..613aa09 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 _0x2494=['lodash','../../config/logger','api','moment','bluebird','request-promise','./openchannelQueueReport.attributes','OpenchannelQueueReport','report_openchannel_queue','uniqueid'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2494,0x82));var _0x4249=function(_0x4f2d78,_0x4bbc42){_0x4f2d78=_0x4f2d78-0x0;var _0x377ea3=_0x2494[_0x4f2d78];return _0x377ea3;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var attributes=require(_0x4249('0x6'));module['exports']=function(_0x4fdc12,_0x3d42fb){return _0x4fdc12['define'](_0x4249('0x7'),attributes,{'tableName':_0x4249('0x8'),'paranoid':![],'indexes':[{'name':_0x4249('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf37f=['OpenchannelQueueReport','report_openchannel_queue','uniqueid','util','api','moment','request-promise','exports','define'];(function(_0x2b47b0,_0x16a2a6){var _0xf229b4=function(_0x55576a){while(--_0x55576a){_0x2b47b0['push'](_0x2b47b0['shift']());}};_0xf229b4(++_0x16a2a6);}(_0xf37f,0x11a));var _0xff37=function(_0x4711ee,_0x1e22f9){_0x4711ee=_0x4711ee-0x0;var _0x1d4992=_0xf37f[_0x4711ee];return _0x1d4992;};'use strict';var _=require('lodash');var util=require(_0xff37('0x0'));var logger=require('../../config/logger')(_0xff37('0x1'));var moment=require(_0xff37('0x2'));var BPromise=require('bluebird');var rp=require(_0xff37('0x3'));var attributes=require('./openchannelQueueReport.attributes');module[_0xff37('0x4')]=function(_0xa71bca,_0x4db1e6){return _0xa71bca[_0xff37('0x5')](_0xff37('0x6'),attributes,{'tableName':_0xff37('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xff37('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 26dbb5f..7f60d28 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 _0x7b20=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueueReport','body','options','CreateOpenchannelQueueReport','debug','stringify','UpdateOpenchannelQueueReport','update','raw','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x55b6ae,_0x51f1c8){var _0x25447c=function(_0x3c7f25){while(--_0x3c7f25){_0x55b6ae['push'](_0x55b6ae['shift']());}};_0x25447c(++_0x51f1c8);}(_0x7b20,0x6d));var _0x07b2=function(_0x46884c,_0x3940db){_0x46884c=_0x46884c-0x0;var _0x431c8f=_0x7b20[_0x46884c];return _0x431c8f;};'use strict';var _=require(_0x07b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x07b2('0x1'));var rs=require(_0x07b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07b2('0x3'))['db'];var utils=require(_0x07b2('0x4'));var logger=require(_0x07b2('0x5'))(_0x07b2('0x6'));var config=require(_0x07b2('0x7'));var jayson=require(_0x07b2('0x8'));var client=jayson[_0x07b2('0x9')][_0x07b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f2eef,_0xa01429,_0x9dd1c6){return new BPromise(function(_0x3e5ed7,_0x156ca6){return client['request'](_0x3f2eef,_0x9dd1c6)[_0x07b2('0xb')](function(_0x17d60c){logger[_0x07b2('0xc')](_0x07b2('0xd'),_0xa01429,_0x07b2('0xe'));logger['debug'](_0x07b2('0xf'),_0xa01429,_0x07b2('0xe'),JSON['stringify'](_0x17d60c));if(_0x17d60c[_0x07b2('0x10')]){if(_0x17d60c['error'][_0x07b2('0x11')]===0x1f4){logger[_0x07b2('0x10')](_0x07b2('0xd'),_0xa01429,_0x17d60c[_0x07b2('0x10')][_0x07b2('0x12')]);return _0x156ca6(_0x17d60c[_0x07b2('0x10')]['message']);}logger[_0x07b2('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xa01429,_0x17d60c[_0x07b2('0x10')][_0x07b2('0x12')]);return _0x3e5ed7(_0x17d60c[_0x07b2('0x10')][_0x07b2('0x12')]);}else{logger[_0x07b2('0xc')](_0x07b2('0xd'),_0xa01429,_0x07b2('0xe'));_0x3e5ed7(_0x17d60c[_0x07b2('0x13')][_0x07b2('0x12')]);}})[_0x07b2('0x14')](function(_0x5c614f){logger[_0x07b2('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xa01429,_0x5c614f);_0x156ca6(_0x5c614f);});});}exports['CreateOpenchannelQueueReport']=function(_0x264028){var _0x299674=this;return new Promise(function(_0x4df265,_0x2f0183){return db[_0x07b2('0x15')]['create'](_0x264028[_0x07b2('0x16')],{'raw':_0x264028[_0x07b2('0x17')]?_0x264028[_0x07b2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x07b2('0xb')](function(_0xed266b){logger[_0x07b2('0xc')](_0x07b2('0x18'),_0x264028);logger[_0x07b2('0x19')](_0x07b2('0x18'),_0x264028,JSON[_0x07b2('0x1a')](_0xed266b));_0x4df265(_0xed266b);})['catch'](function(_0x41b373){logger[_0x07b2('0x10')](_0x07b2('0x18'),_0x41b373[_0x07b2('0x12')],_0x264028);_0x2f0183(_0x299674[_0x07b2('0x10')](0x1f4,_0x41b373[_0x07b2('0x12')]));});});};exports[_0x07b2('0x1b')]=function(_0x215f26){var _0x1395f7=this;return new Promise(function(_0x3d9a7c,_0x123f05){return db['OpenchannelQueueReport'][_0x07b2('0x1c')](_0x215f26[_0x07b2('0x16')],{'raw':_0x215f26[_0x07b2('0x17')]?_0x215f26[_0x07b2('0x17')][_0x07b2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x215f26[_0x07b2('0x17')]?_0x215f26[_0x07b2('0x17')][_0x07b2('0x1e')]||null:null,'attributes':_0x215f26[_0x07b2('0x17')]?_0x215f26[_0x07b2('0x17')]['attributes']||null:null,'limit':_0x215f26['options']?_0x215f26['options']['limit']||null:null})[_0x07b2('0xb')](function(_0x53ccba){logger[_0x07b2('0xc')](_0x07b2('0x1b'),_0x215f26);logger[_0x07b2('0x19')](_0x07b2('0x1b'),_0x215f26,JSON[_0x07b2('0x1a')](_0x53ccba));_0x3d9a7c(_0x53ccba);})[_0x07b2('0x14')](function(_0x1d1078){logger[_0x07b2('0x10')](_0x07b2('0x1b'),_0x1d1078[_0x07b2('0x12')],_0x215f26);_0x123f05(_0x1395f7[_0x07b2('0x10')](0x1f4,_0x1d1078[_0x07b2('0x12')]));});});}; \ No newline at end of file +var _0xbd70=['http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x4ee45f,_0x407924){var _0x529d4a=function(_0x433f16){while(--_0x433f16){_0x4ee45f['push'](_0x4ee45f['shift']());}};_0x529d4a(++_0x407924);}(_0xbd70,0x96));var _0x0bd7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbd70[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0bd7('0x0'));var util=require(_0x0bd7('0x1'));var moment=require(_0x0bd7('0x2'));var BPromise=require(_0x0bd7('0x3'));var rs=require(_0x0bd7('0x4'));var fs=require('fs');var Redis=require(_0x0bd7('0x5'));var db=require(_0x0bd7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0bd7('0x7'));var config=require(_0x0bd7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bd7('0x9')][_0x0bd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d6022,_0xc893eb,_0x296f52){return new BPromise(function(_0x4ba6c0,_0x26c4ad){return client[_0x0bd7('0xb')](_0x4d6022,_0x296f52)[_0x0bd7('0xc')](function(_0x1f8254){logger[_0x0bd7('0xd')](_0x0bd7('0xe'),_0xc893eb,_0x0bd7('0xf'));logger[_0x0bd7('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xc893eb,_0x0bd7('0xf'),JSON[_0x0bd7('0x11')](_0x1f8254));if(_0x1f8254[_0x0bd7('0x12')]){if(_0x1f8254['error'][_0x0bd7('0x13')]===0x1f4){logger[_0x0bd7('0x12')](_0x0bd7('0xe'),_0xc893eb,_0x1f8254[_0x0bd7('0x12')][_0x0bd7('0x14')]);return _0x26c4ad(_0x1f8254[_0x0bd7('0x12')]['message']);}logger[_0x0bd7('0x12')](_0x0bd7('0xe'),_0xc893eb,_0x1f8254[_0x0bd7('0x12')][_0x0bd7('0x14')]);return _0x4ba6c0(_0x1f8254[_0x0bd7('0x12')][_0x0bd7('0x14')]);}else{logger[_0x0bd7('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xc893eb,_0x0bd7('0xf'));_0x4ba6c0(_0x1f8254['result'][_0x0bd7('0x14')]);}})[_0x0bd7('0x15')](function(_0x22694e){logger[_0x0bd7('0x12')](_0x0bd7('0xe'),_0xc893eb,_0x22694e);_0x26c4ad(_0x22694e);});});}exports[_0x0bd7('0x16')]=function(_0x3a8e62){var _0x5e6d98=this;return new Promise(function(_0x15e913,_0x21a6e7){return db[_0x0bd7('0x17')][_0x0bd7('0x18')](_0x3a8e62[_0x0bd7('0x19')],{'raw':_0x3a8e62[_0x0bd7('0x1a')]?_0x3a8e62['options'][_0x0bd7('0x1b')]===undefined?!![]:![]:!![]})[_0x0bd7('0xc')](function(_0x1a90dd){logger[_0x0bd7('0xd')](_0x0bd7('0x16'),_0x3a8e62);logger[_0x0bd7('0x10')](_0x0bd7('0x16'),_0x3a8e62,JSON[_0x0bd7('0x11')](_0x1a90dd));_0x15e913(_0x1a90dd);})[_0x0bd7('0x15')](function(_0x58b16a){logger['error']('CreateOpenchannelQueueReport',_0x58b16a[_0x0bd7('0x14')],_0x3a8e62);_0x21a6e7(_0x5e6d98[_0x0bd7('0x12')](0x1f4,_0x58b16a['message']));});});};exports[_0x0bd7('0x1c')]=function(_0x11a359){var _0x5858df=this;return new Promise(function(_0x33510f,_0x2ce5f8){return db[_0x0bd7('0x17')][_0x0bd7('0x1d')](_0x11a359[_0x0bd7('0x19')],{'raw':_0x11a359['options']?_0x11a359[_0x0bd7('0x1a')][_0x0bd7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11a359[_0x0bd7('0x1a')]?_0x11a359[_0x0bd7('0x1a')][_0x0bd7('0x1e')]||null:null,'attributes':_0x11a359[_0x0bd7('0x1a')]?_0x11a359[_0x0bd7('0x1a')][_0x0bd7('0x1f')]||null:null,'limit':_0x11a359['options']?_0x11a359[_0x0bd7('0x1a')]['limit']||null:null})[_0x0bd7('0xc')](function(_0x10baf5){logger['info'](_0x0bd7('0x1c'),_0x11a359);logger['debug'](_0x0bd7('0x1c'),_0x11a359,JSON[_0x0bd7('0x11')](_0x10baf5));_0x33510f(_0x10baf5);})[_0x0bd7('0x15')](function(_0x54a0b4){logger[_0x0bd7('0x12')]('UpdateOpenchannelQueueReport',_0x54a0b4[_0x0bd7('0x14')],_0x11a359);_0x2ce5f8(_0x5858df[_0x0bd7('0x12')](0x1f4,_0x54a0b4[_0x0bd7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 9eb535f..dcf7ff5 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 _0x716a=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x716a,0x6e));var _0xa716=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x716a[_0x79cd47];return _0x3b9484;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa716('0x0'));var timeout=require(_0xa716('0x1'));var express=require(_0xa716('0x2'));var router=express['Router']();var auth=require(_0xa716('0x3'));var interaction=require(_0xa716('0x4'));var config=require(_0xa716('0x5'));var controller=require('./openchannelTransferReport.controller');router[_0xa716('0x6')]('/',auth['isAuthenticated'](),controller[_0xa716('0x7')]);router[_0xa716('0x6')](_0xa716('0x8'),auth[_0xa716('0x9')](),controller[_0xa716('0xa')]);router[_0xa716('0x6')](_0xa716('0xb'),auth[_0xa716('0x9')](),controller[_0xa716('0xc')]);router[_0xa716('0xd')]('/',auth[_0xa716('0x9')](),controller[_0xa716('0xe')]);router[_0xa716('0xf')](_0xa716('0xb'),auth[_0xa716('0x9')](),controller[_0xa716('0x10')]);router['delete']('/:id',auth[_0xa716('0x9')](),controller[_0xa716('0x11')]);module[_0xa716('0x12')]=router; \ No newline at end of file +var _0xfc3f=['connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xfc3f,0x193));var _0xffc3=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xfc3f[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0xffc3('0x0'));var util=require(_0xffc3('0x1'));var path=require('path');var timeout=require(_0xffc3('0x2'));var express=require(_0xffc3('0x3'));var router=express[_0xffc3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xffc3('0x5'));var controller=require('./openchannelTransferReport.controller');router[_0xffc3('0x6')]('/',auth[_0xffc3('0x7')](),controller['index']);router[_0xffc3('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xffc3('0x6')](_0xffc3('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xffc3('0x9')]('/',auth[_0xffc3('0x7')](),controller[_0xffc3('0xa')]);router[_0xffc3('0xb')](_0xffc3('0x8'),auth[_0xffc3('0x7')](),controller['update']);router[_0xffc3('0xc')](_0xffc3('0x8'),auth[_0xffc3('0x7')](),controller[_0xffc3('0xd')]);module[_0xffc3('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2379978..36985fc 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 _0x457a=['moment','sequelize','exports','STRING','ENUM','account','queue','DATE','NOW'];(function(_0x346555,_0x68bcf8){var _0x16b2ac=function(_0x2b9187){while(--_0x2b9187){_0x346555['push'](_0x346555['shift']());}};_0x16b2ac(++_0x68bcf8);}(_0x457a,0xe1));var _0xa457=function(_0x59cbe5,_0x3d5fdb){_0x59cbe5=_0x59cbe5-0x0;var _0x3df355=_0x457a[_0x59cbe5];return _0x3df355;};'use strict';var moment=require(_0xa457('0x0'));var Sequelize=require(_0xa457('0x1'));module[_0xa457('0x2')]={'uniqueid':{'type':Sequelize[_0xa457('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa457('0x4')](_0xa457('0x5'),'agent',_0xa457('0x6')),'allowNull':![],'defaultValue':_0xa457('0x6')},'transferredAt':{'type':Sequelize[_0xa457('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xa457('0x8')]}}; \ No newline at end of file +var _0x61b7=['exports','STRING','ENUM','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x17749b,_0x4b4e3e){var _0x37ad41=function(_0x177560){while(--_0x177560){_0x17749b['push'](_0x17749b['shift']());}};_0x37ad41(++_0x4b4e3e);}(_0x61b7,0x139));var _0x761b=function(_0x3cf24c,_0x186171){_0x3cf24c=_0x3cf24c-0x0;var _0x3f8587=_0x61b7[_0x3cf24c];return _0x3f8587;};'use strict';var moment=require(_0x761b('0x0'));var Sequelize=require(_0x761b('0x1'));module[_0x761b('0x2')]={'uniqueid':{'type':Sequelize[_0x761b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x761b('0x4')]('account',_0x761b('0x5'),'queue'),'allowNull':![],'defaultValue':_0x761b('0x6')},'transferredAt':{'type':Sequelize[_0x761b('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x761b('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b761002..ac2f2ff 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 _0x54ef=['../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','map','type','key','field','filter','options','OpenchannelTransferReport','count','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils'];(function(_0x1e79b9,_0x223ef3){var _0x2c2d29=function(_0x4573aa){while(--_0x4573aa){_0x1e79b9['push'](_0x1e79b9['shift']());}};_0x2c2d29(++_0x223ef3);}(_0x54ef,0x112));var _0xf54e=function(_0x57f4d1,_0x5b6023){_0x57f4d1=_0x57f4d1-0x0;var _0x5779b0=_0x54ef[_0x57f4d1];return _0x5779b0;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var authService=require(_0xf54e('0x10'));var hardwareService=require(_0xf54e('0x11'));var Redis=require(_0xf54e('0x12'));var qs=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];function respondWithStatusCode(_0x553759,_0x358c88){_0x358c88=_0x358c88||0xcc;return function(_0x4b0ee1){if(_0x4b0ee1){return _0x553759['sendStatus'](_0x358c88);}return _0x553759[_0xf54e('0x18')](_0x358c88)[_0xf54e('0x19')]();};}function respondWithResult(_0x28f776,_0x380f26){_0x380f26=_0x380f26||0xc8;return function(_0x5644aa){if(_0x5644aa){return _0x28f776[_0xf54e('0x18')](_0x380f26)[_0xf54e('0x1a')](_0x5644aa);}};}function respondWithFilteredResult(_0x1855fe,_0x15f639){return function(_0x56828e){if(_0x56828e){var _0x2366ee=_0x56828e['count'],_0x389abc=_0x15f639[_0xf54e('0x1b')],_0x3eb415=_0x15f639[_0xf54e('0x1b')]+_0x15f639[_0xf54e('0x1c')],_0x5c5d00;if(_0x3eb415>=_0x2366ee){_0x3eb415=_0x2366ee;_0x5c5d00=0xc8;}else{_0x5c5d00=0xce;}_0x1855fe[_0xf54e('0x18')](_0x5c5d00);return _0x1855fe[_0xf54e('0x1d')](_0xf54e('0x1e'),_0x389abc+'-'+_0x3eb415+'/'+_0x2366ee)[_0xf54e('0x1a')](_0x56828e);}return null;};}function patchUpdates(_0x1ef06e){return function(_0x1dcc04){try{jsonpatch[_0xf54e('0x1f')](_0x1dcc04,_0x1ef06e,!![]);}catch(_0x226c96){return BPromise['reject'](_0x226c96);}return _0x1dcc04['save']();};}function saveUpdates(_0x23e14,_0x59f338){return function(_0x3e1556){if(_0x3e1556){return _0x3e1556[_0xf54e('0x20')](_0x23e14)[_0xf54e('0x21')](function(_0x9903fc){return _0x9903fc;});}return null;};}function removeEntity(_0xf64f12,_0x3887b0){return function(_0x388aa0){if(_0x388aa0){return _0x388aa0[_0xf54e('0x22')]()[_0xf54e('0x21')](function(){_0xf64f12[_0xf54e('0x18')](0xcc)[_0xf54e('0x19')]();});}};}function handleEntityNotFound(_0x5b83df,_0x6f6d29){return function(_0x54f914){if(!_0x54f914){_0x5b83df[_0xf54e('0x23')](0x194);}return _0x54f914;};}function handleError(_0x272df6,_0x335492){_0x335492=_0x335492||0x1f4;return function(_0x474b61){logger[_0xf54e('0x24')](_0x474b61[_0xf54e('0x25')]);if(_0x474b61[_0xf54e('0x26')]){delete _0x474b61[_0xf54e('0x26')];}_0x272df6[_0xf54e('0x18')](_0x335492)[_0xf54e('0x27')](_0x474b61);};}exports[_0xf54e('0x28')]=function(_0x39c0ae,_0x2ea001){var _0x5390b8={},_0xb3706e={},_0x4cbf7c={'count':0x0,'rows':[]};var _0x282c63=db['OpenchannelTransferReport'][_0xf54e('0x29')];_0xb3706e[_0xf54e('0x2a')]=_[_0xf54e('0x2b')](_0x282c63);_0xb3706e[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x39c0ae[_0xf54e('0x2c')]);_0xb3706e[_0xf54e('0x2d')]=_['intersection'](_0xb3706e['model'],_0xb3706e[_0xf54e('0x2c')]);_0x5390b8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0xb3706e[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x5390b8[_0xf54e('0x2e')]=_0x5390b8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x5390b8['attributes']:_0xb3706e['model'];if(!_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x32')]('nolimit')){_0x5390b8[_0xf54e('0x1c')]=qs[_0xf54e('0x1c')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x1c')]);_0x5390b8['offset']=qs['offset'](_0x39c0ae['query'][_0xf54e('0x1b')]);}_0x5390b8[_0xf54e('0x33')]=qs[_0xf54e('0x34')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x34')]);_0x5390b8[_0xf54e('0x35')]=qs['filters'](_['pick'](_0x39c0ae['query'],_0xb3706e[_0xf54e('0x2d')]));if(_0x39c0ae[_0xf54e('0x2c')]['filter']){_0x5390b8['where']=_[_0xf54e('0x36')](_0x5390b8[_0xf54e('0x35')],{'$or':_[_0xf54e('0x37')](_0x282c63,function(_0x4a347a){if(_0x4a347a[_0xf54e('0x38')][_0xf54e('0x39')]!=='VIRTUAL'){var _0x38d7a0={};_0x38d7a0[_0x4a347a[_0xf54e('0x3a')]]={'$like':'%'+_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3b')]+'%'};return _0x38d7a0;}})});}_0x5390b8=_[_0xf54e('0x36')]({},_0x5390b8,_0x39c0ae[_0xf54e('0x3c')]);var _0x4e00b7={'where':_0x5390b8['where']};return db[_0xf54e('0x3d')][_0xf54e('0x3e')](_0x4e00b7)[_0xf54e('0x21')](function(_0x4b1f84){_0x4cbf7c[_0xf54e('0x3e')]=_0x4b1f84;if(_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x5390b8[_0xf54e('0x40')]=[{'all':!![]}];}return db[_0xf54e('0x3d')][_0xf54e('0x41')](_0x5390b8);})[_0xf54e('0x21')](function(_0x1345b0){_0x4cbf7c[_0xf54e('0x42')]=_0x1345b0;return _0x4cbf7c;})[_0xf54e('0x21')](respondWithFilteredResult(_0x2ea001,_0x5390b8))[_0xf54e('0x43')](handleError(_0x2ea001,null));};exports[_0xf54e('0x44')]=function(_0x3dfd4e,_0x2625fd){var _0x2043a8={'raw':!![],'where':{'id':_0x3dfd4e['params']['id']}},_0x5085c1={};_0x5085c1['model']=_[_0xf54e('0x2b')](db[_0xf54e('0x3d')]['rawAttributes']);_0x5085c1[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x3dfd4e[_0xf54e('0x2c')]);_0x5085c1['filters']=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],_0x5085c1[_0xf54e('0x2c')]);_0x2043a8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x2043a8['attributes']=_0x2043a8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x2043a8[_0xf54e('0x2e')]:_0x5085c1[_0xf54e('0x2a')];if(_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x2043a8['include']=[{'all':!![]}];}_0x2043a8=_[_0xf54e('0x36')]({},_0x2043a8,_0x3dfd4e['options']);return db[_0xf54e('0x3d')]['find'](_0x2043a8)[_0xf54e('0x21')](handleEntityNotFound(_0x2625fd,null))[_0xf54e('0x21')](respondWithResult(_0x2625fd,null))[_0xf54e('0x43')](handleError(_0x2625fd,null));};exports['create']=function(_0x1af35d,_0x40b21c){return db[_0xf54e('0x3d')][_0xf54e('0x45')](_0x1af35d[_0xf54e('0x46')],{})['then'](respondWithResult(_0x40b21c,0xc9))[_0xf54e('0x43')](handleError(_0x40b21c,null));};exports[_0xf54e('0x20')]=function(_0x346bb4,_0x45592b){if(_0x346bb4['body']['id']){delete _0x346bb4[_0xf54e('0x46')]['id'];}return db[_0xf54e('0x3d')]['find']({'where':{'id':_0x346bb4[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x45592b,null))[_0xf54e('0x21')](saveUpdates(_0x346bb4[_0xf54e('0x46')],null))['then'](respondWithResult(_0x45592b,null))[_0xf54e('0x43')](handleError(_0x45592b,null));};exports[_0xf54e('0x22')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x3d')][_0xf54e('0x48')]({'where':{'id':_0x2527f6[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xb4654f,null))[_0xf54e('0x21')](removeEntity(_0xb4654f,null))[_0xf54e('0x43')](handleError(_0xb4654f,null));};exports[_0xf54e('0x49')]=function(_0x1f4cf8,_0x2deb0c){return db[_0xf54e('0x3d')][_0xf54e('0x49')]()[_0xf54e('0x21')](respondWithResult(_0x2deb0c,null))[_0xf54e('0x43')](handleError(_0x2deb0c,null));}; \ No newline at end of file +var _0x0a9a=['model','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','attributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes'];(function(_0x2b0113,_0x2fcc52){var _0x16c5e4=function(_0x13c00d){while(--_0x13c00d){_0x2b0113['push'](_0x2b0113['shift']());}};_0x16c5e4(++_0x2fcc52);}(_0x0a9a,0x183));var _0xa0a9=function(_0x2acc65,_0x42abce){_0x2acc65=_0x2acc65-0x0;var _0x1c130d=_0x0a9a[_0x2acc65];return _0x1c130d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0a9('0x1'));var jsonpatch=require(_0xa0a9('0x2'));var rp=require(_0xa0a9('0x3'));var moment=require(_0xa0a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa0a9('0x5'));var util=require(_0xa0a9('0x6'));var path=require('path');var sox=require(_0xa0a9('0x7'));var csv=require(_0xa0a9('0x8'));var ejs=require(_0xa0a9('0x9'));var fs=require('fs');var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x8'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa0a9('0xf'));var Redis=require(_0xa0a9('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xa0a9('0x11'));var utils=require(_0xa0a9('0x12'));var config=require('../../config/environment');var db=require(_0xa0a9('0x13'))['db'];function respondWithStatusCode(_0x5cc496,_0x1c39ff){_0x1c39ff=_0x1c39ff||0xcc;return function(_0x4b7913){if(_0x4b7913){return _0x5cc496[_0xa0a9('0x14')](_0x1c39ff);}return _0x5cc496[_0xa0a9('0x15')](_0x1c39ff)[_0xa0a9('0x16')]();};}function respondWithResult(_0x35e7cd,_0x13833c){_0x13833c=_0x13833c||0xc8;return function(_0x4fac40){if(_0x4fac40){return _0x35e7cd[_0xa0a9('0x15')](_0x13833c)[_0xa0a9('0x17')](_0x4fac40);}};}function respondWithFilteredResult(_0x31e716,_0x25ac6d){return function(_0x2f8b3c){if(_0x2f8b3c){var _0x1a7b8a=_0x2f8b3c['count'],_0x5a6693=_0x25ac6d[_0xa0a9('0x18')],_0x176faa=_0x25ac6d[_0xa0a9('0x18')]+_0x25ac6d[_0xa0a9('0x19')],_0x48c315;if(_0x176faa>=_0x1a7b8a){_0x176faa=_0x1a7b8a;_0x48c315=0xc8;}else{_0x48c315=0xce;}_0x31e716[_0xa0a9('0x15')](_0x48c315);return _0x31e716['set'](_0xa0a9('0x1a'),_0x5a6693+'-'+_0x176faa+'/'+_0x1a7b8a)[_0xa0a9('0x17')](_0x2f8b3c);}return null;};}function patchUpdates(_0x33eb8f){return function(_0x27f8d4){try{jsonpatch[_0xa0a9('0x1b')](_0x27f8d4,_0x33eb8f,!![]);}catch(_0x3c1b3a){return BPromise['reject'](_0x3c1b3a);}return _0x27f8d4[_0xa0a9('0x1c')]();};}function saveUpdates(_0x3107ce,_0x4a8e80){return function(_0x53b99d){if(_0x53b99d){return _0x53b99d[_0xa0a9('0x1d')](_0x3107ce)[_0xa0a9('0x1e')](function(_0x3d9905){return _0x3d9905;});}return null;};}function removeEntity(_0x54a9a9,_0x307d7e){return function(_0x4e6f4c){if(_0x4e6f4c){return _0x4e6f4c[_0xa0a9('0x1f')]()['then'](function(){_0x54a9a9[_0xa0a9('0x15')](0xcc)[_0xa0a9('0x16')]();});}};}function handleEntityNotFound(_0x2f0b14,_0x305747){return function(_0x4938da){if(!_0x4938da){_0x2f0b14[_0xa0a9('0x14')](0x194);}return _0x4938da;};}function handleError(_0x4fb909,_0x20b318){_0x20b318=_0x20b318||0x1f4;return function(_0x1f78e1){logger[_0xa0a9('0x20')](_0x1f78e1[_0xa0a9('0x21')]);if(_0x1f78e1['name']){delete _0x1f78e1[_0xa0a9('0x22')];}_0x4fb909[_0xa0a9('0x15')](_0x20b318)[_0xa0a9('0x23')](_0x1f78e1);};}exports[_0xa0a9('0x24')]=function(_0x526dd1,_0x35a915){var _0x38e454={},_0x2eae30={},_0x5c446e={'count':0x0,'rows':[]};var _0x54125d=db[_0xa0a9('0x25')][_0xa0a9('0x26')];_0x2eae30[_0xa0a9('0x27')]=_[_0xa0a9('0x28')](_0x54125d);_0x2eae30[_0xa0a9('0x29')]=_[_0xa0a9('0x28')](_0x526dd1[_0xa0a9('0x29')]);_0x2eae30[_0xa0a9('0x2a')]=_[_0xa0a9('0x2b')](_0x2eae30[_0xa0a9('0x27')],_0x2eae30[_0xa0a9('0x29')]);_0x38e454['attributes']=_[_0xa0a9('0x2b')](_0x2eae30[_0xa0a9('0x27')],qs['fields'](_0x526dd1[_0xa0a9('0x29')][_0xa0a9('0x2c')]));_0x38e454['attributes']=_0x38e454['attributes'][_0xa0a9('0x2d')]?_0x38e454['attributes']:_0x2eae30['model'];if(!_0x526dd1[_0xa0a9('0x29')][_0xa0a9('0x2e')](_0xa0a9('0x2f'))){_0x38e454[_0xa0a9('0x19')]=qs[_0xa0a9('0x19')](_0x526dd1[_0xa0a9('0x29')][_0xa0a9('0x19')]);_0x38e454['offset']=qs[_0xa0a9('0x18')](_0x526dd1[_0xa0a9('0x29')]['offset']);}_0x38e454[_0xa0a9('0x30')]=qs[_0xa0a9('0x31')](_0x526dd1[_0xa0a9('0x29')]['sort']);_0x38e454['where']=qs[_0xa0a9('0x2a')](_[_0xa0a9('0x32')](_0x526dd1[_0xa0a9('0x29')],_0x2eae30[_0xa0a9('0x2a')]));if(_0x526dd1['query'][_0xa0a9('0x33')]){_0x38e454[_0xa0a9('0x34')]=_[_0xa0a9('0x35')](_0x38e454['where'],{'$or':_[_0xa0a9('0x36')](_0x54125d,function(_0x3c74ea){if(_0x3c74ea[_0xa0a9('0x37')]['key']!==_0xa0a9('0x38')){var _0x2ed673={};_0x2ed673[_0x3c74ea[_0xa0a9('0x39')]]={'$like':'%'+_0x526dd1[_0xa0a9('0x29')][_0xa0a9('0x33')]+'%'};return _0x2ed673;}})});}_0x38e454=_[_0xa0a9('0x35')]({},_0x38e454,_0x526dd1[_0xa0a9('0x3a')]);var _0xcf2461={'where':_0x38e454[_0xa0a9('0x34')]};return db[_0xa0a9('0x25')][_0xa0a9('0x3b')](_0xcf2461)[_0xa0a9('0x1e')](function(_0x1f6e2d){_0x5c446e[_0xa0a9('0x3b')]=_0x1f6e2d;if(_0x526dd1[_0xa0a9('0x29')][_0xa0a9('0x3c')]){_0x38e454[_0xa0a9('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa0a9('0x3e')](_0x38e454);})[_0xa0a9('0x1e')](function(_0x3d3769){_0x5c446e['rows']=_0x3d3769;return _0x5c446e;})[_0xa0a9('0x1e')](respondWithFilteredResult(_0x35a915,_0x38e454))[_0xa0a9('0x3f')](handleError(_0x35a915,null));};exports[_0xa0a9('0x40')]=function(_0xbbd377,_0x48993c){var _0x26ffb8={'raw':!![],'where':{'id':_0xbbd377[_0xa0a9('0x41')]['id']}},_0x44791e={};_0x44791e[_0xa0a9('0x27')]=_[_0xa0a9('0x28')](db['OpenchannelTransferReport'][_0xa0a9('0x26')]);_0x44791e[_0xa0a9('0x29')]=_[_0xa0a9('0x28')](_0xbbd377[_0xa0a9('0x29')]);_0x44791e[_0xa0a9('0x2a')]=_['intersection'](_0x44791e[_0xa0a9('0x27')],_0x44791e[_0xa0a9('0x29')]);_0x26ffb8[_0xa0a9('0x42')]=_[_0xa0a9('0x2b')](_0x44791e[_0xa0a9('0x27')],qs['fields'](_0xbbd377[_0xa0a9('0x29')][_0xa0a9('0x2c')]));_0x26ffb8['attributes']=_0x26ffb8['attributes'][_0xa0a9('0x2d')]?_0x26ffb8[_0xa0a9('0x42')]:_0x44791e[_0xa0a9('0x27')];if(_0xbbd377[_0xa0a9('0x29')]['includeAll']){_0x26ffb8[_0xa0a9('0x3d')]=[{'all':!![]}];}_0x26ffb8=_[_0xa0a9('0x35')]({},_0x26ffb8,_0xbbd377[_0xa0a9('0x3a')]);return db[_0xa0a9('0x25')][_0xa0a9('0x43')](_0x26ffb8)[_0xa0a9('0x1e')](handleEntityNotFound(_0x48993c,null))[_0xa0a9('0x1e')](respondWithResult(_0x48993c,null))[_0xa0a9('0x3f')](handleError(_0x48993c,null));};exports[_0xa0a9('0x44')]=function(_0x1a7879,_0xe82093){return db[_0xa0a9('0x25')][_0xa0a9('0x44')](_0x1a7879[_0xa0a9('0x45')],{})[_0xa0a9('0x1e')](respondWithResult(_0xe82093,0xc9))[_0xa0a9('0x3f')](handleError(_0xe82093,null));};exports[_0xa0a9('0x1d')]=function(_0x54e917,_0x1ebbbe){if(_0x54e917['body']['id']){delete _0x54e917[_0xa0a9('0x45')]['id'];}return db[_0xa0a9('0x25')][_0xa0a9('0x43')]({'where':{'id':_0x54e917[_0xa0a9('0x41')]['id']}})[_0xa0a9('0x1e')](handleEntityNotFound(_0x1ebbbe,null))[_0xa0a9('0x1e')](saveUpdates(_0x54e917[_0xa0a9('0x45')],null))[_0xa0a9('0x1e')](respondWithResult(_0x1ebbbe,null))[_0xa0a9('0x3f')](handleError(_0x1ebbbe,null));};exports['destroy']=function(_0x5d4162,_0x46a9ca){return db[_0xa0a9('0x25')]['find']({'where':{'id':_0x5d4162[_0xa0a9('0x41')]['id']}})[_0xa0a9('0x1e')](handleEntityNotFound(_0x46a9ca,null))[_0xa0a9('0x1e')](removeEntity(_0x46a9ca,null))['catch'](handleError(_0x46a9ca,null));};exports[_0xa0a9('0x46')]=function(_0x7e1058,_0x2d0b1c){return db[_0xa0a9('0x25')]['describe']()[_0xa0a9('0x1e')](respondWithResult(_0x2d0b1c,null))[_0xa0a9('0x3f')](handleError(_0x2d0b1c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8fc6b64..567e4c0 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 _0x814b=['lodash','util','../../config/logger','api','moment','bluebird','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0x814b,0x1a2));var _0xb814=function(_0x2383bc,_0x2d5ec9){_0x2383bc=_0x2383bc-0x0;var _0x283573=_0x814b[_0x2383bc];return _0x283573;};'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 attributes=require(_0xb814('0x6'));module[_0xb814('0x7')]=function(_0x258866,_0x4237bc){return _0x258866[_0xb814('0x8')](_0xb814('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xb814('0xa'),'fields':[_0xb814('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','./openchannelTransferReport.attributes','exports','define'];(function(_0x19e1c4,_0x3ec0b5){var _0x29fdd9=function(_0x285acd){while(--_0x285acd){_0x19e1c4['push'](_0x19e1c4['shift']());}};_0x29fdd9(++_0x3ec0b5);}(_0x7a54,0x106));var _0x47a5=function(_0x2a0a1d,_0x499d84){_0x2a0a1d=_0x2a0a1d-0x0;var _0x5e243b=_0x7a54[_0x2a0a1d];return _0x5e243b;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 309aebc..d609d4e 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 _0xdf7b=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xdf7b,0x9a));var _0xbdf7=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xdf7b[_0x202d24];return _0x2b3a8e;};'use strict';var _=require('lodash');var util=require(_0xbdf7('0x0'));var moment=require(_0xbdf7('0x1'));var BPromise=require('bluebird');var rs=require(_0xbdf7('0x2'));var fs=require('fs');var Redis=require(_0xbdf7('0x3'));var db=require(_0xbdf7('0x4'))['db'];var utils=require(_0xbdf7('0x5'));var logger=require(_0xbdf7('0x6'))(_0xbdf7('0x7'));var config=require('../../config/environment');var jayson=require(_0xbdf7('0x8'));var client=jayson[_0xbdf7('0x9')][_0xbdf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11f4f0,_0x1ec70d,_0x3bf7c4){return new BPromise(function(_0x283ea9,_0x3f9835){return client['request'](_0x11f4f0,_0x3bf7c4)['then'](function(_0x33606d){logger[_0xbdf7('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1ec70d,_0xbdf7('0xc'));logger[_0xbdf7('0xd')](_0xbdf7('0xe'),_0x1ec70d,_0xbdf7('0xc'),JSON[_0xbdf7('0xf')](_0x33606d));if(_0x33606d[_0xbdf7('0x10')]){if(_0x33606d[_0xbdf7('0x10')]['code']===0x1f4){logger[_0xbdf7('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1ec70d,_0x33606d[_0xbdf7('0x10')][_0xbdf7('0x11')]);return _0x3f9835(_0x33606d[_0xbdf7('0x10')][_0xbdf7('0x11')]);}logger[_0xbdf7('0x10')](_0xbdf7('0x12'),_0x1ec70d,_0x33606d[_0xbdf7('0x10')][_0xbdf7('0x11')]);return _0x283ea9(_0x33606d[_0xbdf7('0x10')]['message']);}else{logger[_0xbdf7('0xb')](_0xbdf7('0x12'),_0x1ec70d,_0xbdf7('0xc'));_0x283ea9(_0x33606d[_0xbdf7('0x13')][_0xbdf7('0x11')]);}})[_0xbdf7('0x14')](function(_0x46e0df){logger[_0xbdf7('0x10')](_0xbdf7('0x12'),_0x1ec70d,_0x46e0df);_0x3f9835(_0x46e0df);});});} \ No newline at end of file +var _0xee24=['stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x46dd4d,_0x1952e1){var _0x835ae=function(_0x520ea1){while(--_0x520ea1){_0x46dd4d['push'](_0x46dd4d['shift']());}};_0x835ae(++_0x1952e1);}(_0xee24,0x1a6));var _0x4ee2=function(_0x155413,_0x1c89b4){_0x155413=_0x155413-0x0;var _0x434c71=_0xee24[_0x155413];return _0x434c71;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var moment=require(_0x4ee2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ee2('0x2'));var fs=require('fs');var Redis=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];var utils=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var jayson=require(_0x4ee2('0x8'));var client=jayson[_0x4ee2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6e11,_0x319d9d,_0xe966eb){return new BPromise(function(_0x9a963c,_0x8d7266){return client[_0x4ee2('0xa')](_0x2e6e11,_0xe966eb)[_0x4ee2('0xb')](function(_0x3b6028){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x319d9d,_0x4ee2('0xc'));logger[_0x4ee2('0xd')](_0x4ee2('0xe'),_0x319d9d,_0x4ee2('0xc'),JSON[_0x4ee2('0xf')](_0x3b6028));if(_0x3b6028['error']){if(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x11')]===0x1f4){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x8d7266(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x13')]);}logger[_0x4ee2('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x9a963c(_0x3b6028[_0x4ee2('0x10')]['message']);}else{logger[_0x4ee2('0x14')](_0x4ee2('0x12'),_0x319d9d,_0x4ee2('0xc'));_0x9a963c(_0x3b6028[_0x4ee2('0x15')][_0x4ee2('0x13')]);}})[_0x4ee2('0x16')](function(_0x5e19f8){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x5e19f8);_0x8d7266(_0x5e19f8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3c07311..30e1b1d 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 _0xab3a=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post','create'];(function(_0x2168d4,_0x5459e1){var _0x45f24b=function(_0x21f2fd){while(--_0x21f2fd){_0x2168d4['push'](_0x2168d4['shift']());}};_0x45f24b(++_0x5459e1);}(_0xab3a,0x1d3));var _0xaab3=function(_0x39aae5,_0xfd2f27){_0x39aae5=_0x39aae5-0x0;var _0x266f9f=_0xab3a[_0x39aae5];return _0x266f9f;};'use strict';var multer=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var path=require(_0xaab3('0x2'));var timeout=require(_0xaab3('0x3'));var express=require(_0xaab3('0x4'));var router=express[_0xaab3('0x5')]();var auth=require(_0xaab3('0x6'));var interaction=require(_0xaab3('0x7'));var config=require(_0xaab3('0x8'));var controller=require(_0xaab3('0x9'));router[_0xaab3('0xa')]('/',auth[_0xaab3('0xb')](),controller[_0xaab3('0xc')]);router['get']('/:id',auth[_0xaab3('0xb')](),controller[_0xaab3('0xd')]);router[_0xaab3('0xe')]('/',auth[_0xaab3('0xb')](),controller[_0xaab3('0xf')]);router[_0xaab3('0x10')](_0xaab3('0x11'),auth[_0xaab3('0xb')](),controller[_0xaab3('0x12')]);router[_0xaab3('0x13')](_0xaab3('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xaab3('0x14')]=router; \ No newline at end of file +var _0x0c5d=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x4d28c5,_0x1e9aa2){_0x4d28c5=_0x4d28c5-0x0;var _0x4fd0a6=_0x0c5d[_0x4d28c5];return _0x4fd0a6;};'use strict';var multer=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require('path');var timeout=require(_0xd0c5('0x2'));var express=require('express');var router=express[_0xd0c5('0x3')]();var auth=require(_0xd0c5('0x4'));var interaction=require(_0xd0c5('0x5'));var config=require(_0xd0c5('0x6'));var controller=require(_0xd0c5('0x7'));router[_0xd0c5('0x8')]('/',auth[_0xd0c5('0x9')](),controller[_0xd0c5('0xa')]);router['get'](_0xd0c5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd0c5('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0c5('0xd')](_0xd0c5('0xb'),auth['isAuthenticated'](),controller[_0xd0c5('0xe')]);router[_0xd0c5('0xf')]('/:id',auth[_0xd0c5('0x9')](),controller[_0xd0c5('0x10')]);module[_0xd0c5('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d357fe1..bb18e79 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 _0x1645=['name','exports','STRING'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x1645,0x118));var _0x5164=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1645[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x5164('0x0')]={'name':{'type':Sequelize[_0x5164('0x1')],'unique':_0x5164('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5164('0x1')]}}; \ No newline at end of file +var _0x7529=['name','sequelize','STRING'];(function(_0x3298e2,_0x13f0b4){var _0x2558d2=function(_0x42daee){while(--_0x42daee){_0x3298e2['push'](_0x3298e2['shift']());}};_0x2558d2(++_0x13f0b4);}(_0x7529,0x97));var _0x9752=function(_0x146b04,_0x3baff1){_0x146b04=_0x146b04-0x0;var _0x310fc9=_0x7529[_0x146b04];return _0x310fc9;};'use strict';var Sequelize=require(_0x9752('0x0'));module['exports']={'name':{'type':Sequelize[_0x9752('0x1')],'unique':_0x9752('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f44e299..866cf46 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 _0xf45f=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','key','field','merge','options','catch','show','includeAll','include','find','create','body','role','user'];(function(_0x20abea,_0x48795e){var _0x1382f7=function(_0x355e90){while(--_0x355e90){_0x20abea['push'](_0x20abea['shift']());}};_0x1382f7(++_0x48795e);}(_0xf45f,0x190));var _0xff45=function(_0x310a5b,_0x2b3b15){_0x310a5b=_0x310a5b-0x0;var _0x370f51=_0xf45f[_0x310a5b];return _0x370f51;};'use strict';var pdf=require(_0xff45('0x0'));var emlformat=require(_0xff45('0x1'));var rimraf=require(_0xff45('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff45('0x3'));var rp=require('request-promise');var moment=require(_0xff45('0x4'));var BPromise=require(_0xff45('0x5'));var Mustache=require(_0xff45('0x6'));var util=require(_0xff45('0x7'));var path=require(_0xff45('0x8'));var sox=require(_0xff45('0x9'));var csv=require('to-csv');var ejs=require(_0xff45('0xa'));var fs=require('fs');var _=require(_0xff45('0xb'));var squel=require(_0xff45('0xc'));var crypto=require(_0xff45('0xd'));var jsforce=require(_0xff45('0xe'));var deskjs=require(_0xff45('0xf'));var toCsv=require(_0xff45('0x10'));var querystring=require(_0xff45('0x11'));var Papa=require(_0xff45('0x12'));var authService=require(_0xff45('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xff45('0x14'));var qs=require(_0xff45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xff45('0x16'));var config=require(_0xff45('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x571c99,_0x5a8456){_0x5a8456=_0x5a8456||0xcc;return function(_0xb62521){if(_0xb62521){return _0x571c99[_0xff45('0x18')](_0x5a8456);}return _0x571c99[_0xff45('0x19')](_0x5a8456)[_0xff45('0x1a')]();};}function respondWithResult(_0x4ca1b2,_0x1ff3d9){_0x1ff3d9=_0x1ff3d9||0xc8;return function(_0x172a40){if(_0x172a40){return _0x4ca1b2[_0xff45('0x19')](_0x1ff3d9)[_0xff45('0x1b')](_0x172a40);}};}function respondWithFilteredResult(_0x49e691,_0x3be9ec){return function(_0xb1860c){if(_0xb1860c){var _0x2b3881=_0xb1860c[_0xff45('0x1c')],_0x4e2009=_0x3be9ec[_0xff45('0x1d')],_0x4a0972=_0x3be9ec['offset']+_0x3be9ec['limit'],_0x14ef8e;if(_0x4a0972>=_0x2b3881){_0x4a0972=_0x2b3881;_0x14ef8e=0xc8;}else{_0x14ef8e=0xce;}_0x49e691[_0xff45('0x19')](_0x14ef8e);return _0x49e691['set'](_0xff45('0x1e'),_0x4e2009+'-'+_0x4a0972+'/'+_0x2b3881)[_0xff45('0x1b')](_0xb1860c);}return null;};}function patchUpdates(_0x3eb4){return function(_0xdaeca3){try{jsonpatch['apply'](_0xdaeca3,_0x3eb4,!![]);}catch(_0x415daa){return BPromise[_0xff45('0x1f')](_0x415daa);}return _0xdaeca3[_0xff45('0x20')]();};}function saveUpdates(_0x161981,_0x50f184){return function(_0x5e2beb){if(_0x5e2beb){return _0x5e2beb[_0xff45('0x21')](_0x161981)[_0xff45('0x22')](function(_0x5d794b){return _0x5d794b;});}return null;};}function removeEntity(_0x36e67c,_0x3c9ab1){return function(_0x53cd9d){if(_0x53cd9d){return _0x53cd9d[_0xff45('0x23')]()['then'](function(){var _0xcaaf1=_0x53cd9d[_0xff45('0x24')]({'plain':!![]});var _0x16339b=_0xff45('0x25');return db[_0xff45('0x26')][_0xff45('0x23')]({'where':{'type':_0x16339b,'resourceId':_0xcaaf1['id']}})[_0xff45('0x22')](function(){return _0x53cd9d;});})['then'](function(){_0x36e67c[_0xff45('0x19')](0xcc)[_0xff45('0x1a')]();});}};}function handleEntityNotFound(_0x330870,_0x55d102){return function(_0x1e4932){if(!_0x1e4932){_0x330870[_0xff45('0x18')](0x194);}return _0x1e4932;};}function handleError(_0x7ef700,_0x22cb72){_0x22cb72=_0x22cb72||0x1f4;return function(_0x1a7997){logger[_0xff45('0x27')](_0x1a7997[_0xff45('0x28')]);if(_0x1a7997[_0xff45('0x29')]){delete _0x1a7997[_0xff45('0x29')];}_0x7ef700[_0xff45('0x19')](_0x22cb72)[_0xff45('0x2a')](_0x1a7997);};}exports[_0xff45('0x2b')]=function(_0x2cbb2d,_0x261fa2){var _0x2e780c={},_0xb92453={},_0x158df4={'count':0x0,'rows':[]};var _0x3cfe98=db[_0xff45('0x2c')][_0xff45('0x2d')];_0xb92453[_0xff45('0x2e')]=_[_0xff45('0x2f')](_0x3cfe98);_0xb92453['query']=_[_0xff45('0x2f')](_0x2cbb2d['query']);_0xb92453[_0xff45('0x30')]=_[_0xff45('0x31')](_0xb92453[_0xff45('0x2e')],_0xb92453[_0xff45('0x32')]);_0x2e780c[_0xff45('0x33')]=_[_0xff45('0x31')](_0xb92453[_0xff45('0x2e')],qs['fields'](_0x2cbb2d[_0xff45('0x32')]['fields']));_0x2e780c[_0xff45('0x33')]=_0x2e780c[_0xff45('0x33')][_0xff45('0x34')]?_0x2e780c[_0xff45('0x33')]:_0xb92453[_0xff45('0x2e')];if(!_0x2cbb2d[_0xff45('0x32')][_0xff45('0x35')]('nolimit')){_0x2e780c[_0xff45('0x36')]=qs[_0xff45('0x36')](_0x2cbb2d[_0xff45('0x32')][_0xff45('0x36')]);_0x2e780c[_0xff45('0x1d')]=qs[_0xff45('0x1d')](_0x2cbb2d[_0xff45('0x32')]['offset']);}_0x2e780c[_0xff45('0x37')]=qs['sort'](_0x2cbb2d[_0xff45('0x32')][_0xff45('0x38')]);_0x2e780c[_0xff45('0x39')]=qs[_0xff45('0x30')](_[_0xff45('0x3a')](_0x2cbb2d[_0xff45('0x32')],_0xb92453['filters']));if(_0x2cbb2d['query'][_0xff45('0x3b')]){_0x2e780c[_0xff45('0x39')]=_['merge'](_0x2e780c['where'],{'$or':_['map'](_0x3cfe98,function(_0x43184c){if(_0x43184c[_0xff45('0x3c')][_0xff45('0x3d')]!=='VIRTUAL'){var _0x678893={};_0x678893[_0x43184c[_0xff45('0x3e')]]={'$like':'%'+_0x2cbb2d[_0xff45('0x32')][_0xff45('0x3b')]+'%'};return _0x678893;}})});}_0x2e780c=_[_0xff45('0x3f')]({},_0x2e780c,_0x2cbb2d[_0xff45('0x40')]);var _0x3760f6={'where':_0x2e780c['where']};return db[_0xff45('0x2c')][_0xff45('0x1c')](_0x3760f6)[_0xff45('0x22')](function(_0x5aa9f2){_0x158df4['count']=_0x5aa9f2;if(_0x2cbb2d[_0xff45('0x32')]['includeAll']){_0x2e780c['include']=[{'all':!![]}];}return db[_0xff45('0x2c')]['findAll'](_0x2e780c);})[_0xff45('0x22')](function(_0x2172f3){_0x158df4['rows']=_0x2172f3;return _0x158df4;})['then'](respondWithFilteredResult(_0x261fa2,_0x2e780c))[_0xff45('0x41')](handleError(_0x261fa2,null));};exports[_0xff45('0x42')]=function(_0x153035,_0x4d0b55){var _0x5cc62b={'raw':!![],'where':{'id':_0x153035['params']['id']}},_0x1228e4={};_0x1228e4[_0xff45('0x2e')]=_[_0xff45('0x2f')](db[_0xff45('0x2c')][_0xff45('0x2d')]);_0x1228e4[_0xff45('0x32')]=_['keys'](_0x153035[_0xff45('0x32')]);_0x1228e4[_0xff45('0x30')]=_[_0xff45('0x31')](_0x1228e4[_0xff45('0x2e')],_0x1228e4[_0xff45('0x32')]);_0x5cc62b[_0xff45('0x33')]=_['intersection'](_0x1228e4[_0xff45('0x2e')],qs['fields'](_0x153035[_0xff45('0x32')]['fields']));_0x5cc62b[_0xff45('0x33')]=_0x5cc62b[_0xff45('0x33')][_0xff45('0x34')]?_0x5cc62b['attributes']:_0x1228e4[_0xff45('0x2e')];if(_0x153035[_0xff45('0x32')][_0xff45('0x43')]){_0x5cc62b[_0xff45('0x44')]=[{'all':!![]}];}_0x5cc62b=_['merge']({},_0x5cc62b,_0x153035[_0xff45('0x40')]);return db[_0xff45('0x2c')][_0xff45('0x45')](_0x5cc62b)[_0xff45('0x22')](handleEntityNotFound(_0x4d0b55,null))[_0xff45('0x22')](respondWithResult(_0x4d0b55,null))[_0xff45('0x41')](handleError(_0x4d0b55,null));};exports[_0xff45('0x46')]=function(_0xaf087c,_0x418fba){return db[_0xff45('0x2c')][_0xff45('0x46')](_0xaf087c[_0xff45('0x47')],{})['then'](function(_0x4aba0a){var _0x2a1052=_0xaf087c['user']['get']({'plain':!![]});if(!_0x2a1052)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a1052[_0xff45('0x48')]===_0xff45('0x49')){var _0x172557=_0x4aba0a[_0xff45('0x24')]({'plain':!![]});var _0x18820c=_0xff45('0x25');return db[_0xff45('0x4a')][_0xff45('0x45')]({'where':{'name':_0x18820c,'userProfileId':_0x2a1052[_0xff45('0x4b')]},'raw':!![]})['then'](function(_0x552112){if(_0x552112&&_0x552112[_0xff45('0x4c')]===0x0){return db['UserProfileResource'][_0xff45('0x46')]({'name':_0x172557[_0xff45('0x29')],'resourceId':_0x172557['id'],'type':_0x552112[_0xff45('0x29')],'sectionId':_0x552112['id']},{})[_0xff45('0x22')](function(){return _0x4aba0a;});}else{return _0x4aba0a;}})[_0xff45('0x41')](function(_0x3d0bea){logger['error'](_0xff45('0x4d'),_0x3d0bea);throw _0x3d0bea;});}return _0x4aba0a;})[_0xff45('0x22')](respondWithResult(_0x418fba,0xc9))[_0xff45('0x41')](handleError(_0x418fba,null));};exports[_0xff45('0x21')]=function(_0x1badb0,_0x4dcb4f){if(_0x1badb0['body']['id']){delete _0x1badb0[_0xff45('0x47')]['id'];}return db[_0xff45('0x2c')][_0xff45('0x45')]({'where':{'id':_0x1badb0[_0xff45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4dcb4f,null))[_0xff45('0x22')](saveUpdates(_0x1badb0[_0xff45('0x47')],null))['then'](respondWithResult(_0x4dcb4f,null))[_0xff45('0x41')](handleError(_0x4dcb4f,null));};exports[_0xff45('0x23')]=function(_0x4e0567,_0x46b649){return db[_0xff45('0x2c')][_0xff45('0x45')]({'where':{'id':_0x4e0567[_0xff45('0x4e')]['id']}})[_0xff45('0x22')](handleEntityNotFound(_0x46b649,null))[_0xff45('0x22')](removeEntity(_0x46b649,null))[_0xff45('0x41')](handleError(_0x46b649,null));}; \ No newline at end of file +var _0xe242=['model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','map','type','key','field','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','Pause','rawAttributes','keys','query','filters','intersection'];(function(_0x1f1dec,_0x3dbde6){var _0x47d4f8=function(_0x123169){while(--_0x123169){_0x1f1dec['push'](_0x1f1dec['shift']());}};_0x47d4f8(++_0x3dbde6);}(_0xe242,0x1af));var _0x2e24=function(_0xe6b6ac,_0x515938){_0xe6b6ac=_0xe6b6ac-0x0;var _0x36d072=_0xe242[_0xe6b6ac];return _0x36d072;};'use strict';var pdf=require(_0x2e24('0x0'));var emlformat=require(_0x2e24('0x1'));var rimraf=require(_0x2e24('0x2'));var zipdir=require(_0x2e24('0x3'));var jsonpatch=require(_0x2e24('0x4'));var rp=require(_0x2e24('0x5'));var moment=require(_0x2e24('0x6'));var BPromise=require(_0x2e24('0x7'));var Mustache=require(_0x2e24('0x8'));var util=require('util');var path=require(_0x2e24('0x9'));var sox=require(_0x2e24('0xa'));var csv=require(_0x2e24('0xb'));var ejs=require(_0x2e24('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2e24('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e24('0xe'));var toCsv=require(_0x2e24('0xb'));var querystring=require(_0x2e24('0xf'));var Papa=require(_0x2e24('0x10'));var authService=require(_0x2e24('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x2e24('0x12'));var qs=require(_0x2e24('0x13'));var logger=require('../../config/logger')(_0x2e24('0x14'));var utils=require('../../config/utils');var config=require(_0x2e24('0x15'));var db=require(_0x2e24('0x16'))['db'];function respondWithStatusCode(_0x39858e,_0x2fddc2){_0x2fddc2=_0x2fddc2||0xcc;return function(_0x67f194){if(_0x67f194){return _0x39858e[_0x2e24('0x17')](_0x2fddc2);}return _0x39858e[_0x2e24('0x18')](_0x2fddc2)[_0x2e24('0x19')]();};}function respondWithResult(_0x5c20cf,_0x123ae0){_0x123ae0=_0x123ae0||0xc8;return function(_0x2dd324){if(_0x2dd324){return _0x5c20cf[_0x2e24('0x18')](_0x123ae0)[_0x2e24('0x1a')](_0x2dd324);}};}function respondWithFilteredResult(_0x4bc276,_0x41b9b7){return function(_0x4f6b51){if(_0x4f6b51){var _0xb01499=_0x4f6b51[_0x2e24('0x1b')],_0x3aca10=_0x41b9b7[_0x2e24('0x1c')],_0x34d46d=_0x41b9b7['offset']+_0x41b9b7[_0x2e24('0x1d')],_0x48b771;if(_0x34d46d>=_0xb01499){_0x34d46d=_0xb01499;_0x48b771=0xc8;}else{_0x48b771=0xce;}_0x4bc276['status'](_0x48b771);return _0x4bc276[_0x2e24('0x1e')](_0x2e24('0x1f'),_0x3aca10+'-'+_0x34d46d+'/'+_0xb01499)['json'](_0x4f6b51);}return null;};}function patchUpdates(_0x5b6365){return function(_0x485114){try{jsonpatch['apply'](_0x485114,_0x5b6365,!![]);}catch(_0x45ae9f){return BPromise[_0x2e24('0x20')](_0x45ae9f);}return _0x485114['save']();};}function saveUpdates(_0x545dbf,_0x15dd91){return function(_0x5296db){if(_0x5296db){return _0x5296db[_0x2e24('0x21')](_0x545dbf)[_0x2e24('0x22')](function(_0x1a8abc){return _0x1a8abc;});}return null;};}function removeEntity(_0x232394,_0x36502b){return function(_0x5d4306){if(_0x5d4306){return _0x5d4306[_0x2e24('0x23')]()[_0x2e24('0x22')](function(){var _0x4a1d32=_0x5d4306[_0x2e24('0x24')]({'plain':!![]});var _0x57f1b1=_0x2e24('0x25');return db[_0x2e24('0x26')][_0x2e24('0x23')]({'where':{'type':_0x57f1b1,'resourceId':_0x4a1d32['id']}})['then'](function(){return _0x5d4306;});})[_0x2e24('0x22')](function(){_0x232394['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ba96,_0x4f0373){return function(_0x52442a){if(!_0x52442a){_0x46ba96[_0x2e24('0x17')](0x194);}return _0x52442a;};}function handleError(_0x2a6382,_0x562e14){_0x562e14=_0x562e14||0x1f4;return function(_0x63c99a){logger[_0x2e24('0x27')](_0x63c99a[_0x2e24('0x28')]);if(_0x63c99a[_0x2e24('0x29')]){delete _0x63c99a['name'];}_0x2a6382[_0x2e24('0x18')](_0x562e14)['send'](_0x63c99a);};}exports[_0x2e24('0x2a')]=function(_0xaec9d2,_0x49e8bc){var _0x1ddc55={},_0x1538f4={},_0x2bea4f={'count':0x0,'rows':[]};var _0x13b86b=db[_0x2e24('0x2b')][_0x2e24('0x2c')];_0x1538f4['model']=_[_0x2e24('0x2d')](_0x13b86b);_0x1538f4[_0x2e24('0x2e')]=_[_0x2e24('0x2d')](_0xaec9d2['query']);_0x1538f4[_0x2e24('0x2f')]=_[_0x2e24('0x30')](_0x1538f4['model'],_0x1538f4['query']);_0x1ddc55['attributes']=_[_0x2e24('0x30')](_0x1538f4[_0x2e24('0x31')],qs['fields'](_0xaec9d2['query'][_0x2e24('0x32')]));_0x1ddc55[_0x2e24('0x33')]=_0x1ddc55[_0x2e24('0x33')]['length']?_0x1ddc55[_0x2e24('0x33')]:_0x1538f4[_0x2e24('0x31')];if(!_0xaec9d2['query'][_0x2e24('0x34')]('nolimit')){_0x1ddc55[_0x2e24('0x1d')]=qs[_0x2e24('0x1d')](_0xaec9d2[_0x2e24('0x2e')]['limit']);_0x1ddc55['offset']=qs['offset'](_0xaec9d2[_0x2e24('0x2e')]['offset']);}_0x1ddc55[_0x2e24('0x35')]=qs[_0x2e24('0x36')](_0xaec9d2['query'][_0x2e24('0x36')]);_0x1ddc55['where']=qs['filters'](_[_0x2e24('0x37')](_0xaec9d2['query'],_0x1538f4[_0x2e24('0x2f')]));if(_0xaec9d2[_0x2e24('0x2e')][_0x2e24('0x38')]){_0x1ddc55[_0x2e24('0x39')]=_['merge'](_0x1ddc55[_0x2e24('0x39')],{'$or':_[_0x2e24('0x3a')](_0x13b86b,function(_0x1834ec){if(_0x1834ec[_0x2e24('0x3b')][_0x2e24('0x3c')]!=='VIRTUAL'){var _0x34f17e={};_0x34f17e[_0x1834ec[_0x2e24('0x3d')]]={'$like':'%'+_0xaec9d2[_0x2e24('0x2e')][_0x2e24('0x38')]+'%'};return _0x34f17e;}})});}_0x1ddc55=_[_0x2e24('0x3e')]({},_0x1ddc55,_0xaec9d2[_0x2e24('0x3f')]);var _0x26d952={'where':_0x1ddc55['where']};return db['Pause'][_0x2e24('0x1b')](_0x26d952)[_0x2e24('0x22')](function(_0x21c8e5){_0x2bea4f[_0x2e24('0x1b')]=_0x21c8e5;if(_0xaec9d2['query'][_0x2e24('0x40')]){_0x1ddc55[_0x2e24('0x41')]=[{'all':!![]}];}return db[_0x2e24('0x2b')][_0x2e24('0x42')](_0x1ddc55);})[_0x2e24('0x22')](function(_0x3d0cf5){_0x2bea4f['rows']=_0x3d0cf5;return _0x2bea4f;})[_0x2e24('0x22')](respondWithFilteredResult(_0x49e8bc,_0x1ddc55))[_0x2e24('0x43')](handleError(_0x49e8bc,null));};exports[_0x2e24('0x44')]=function(_0x4209c3,_0x234944){var _0x27ad29={'raw':!![],'where':{'id':_0x4209c3[_0x2e24('0x45')]['id']}},_0x1ecc58={};_0x1ecc58[_0x2e24('0x31')]=_[_0x2e24('0x2d')](db[_0x2e24('0x2b')][_0x2e24('0x2c')]);_0x1ecc58['query']=_[_0x2e24('0x2d')](_0x4209c3[_0x2e24('0x2e')]);_0x1ecc58[_0x2e24('0x2f')]=_[_0x2e24('0x30')](_0x1ecc58[_0x2e24('0x31')],_0x1ecc58[_0x2e24('0x2e')]);_0x27ad29['attributes']=_['intersection'](_0x1ecc58['model'],qs[_0x2e24('0x32')](_0x4209c3[_0x2e24('0x2e')][_0x2e24('0x32')]));_0x27ad29[_0x2e24('0x33')]=_0x27ad29['attributes'][_0x2e24('0x46')]?_0x27ad29[_0x2e24('0x33')]:_0x1ecc58['model'];if(_0x4209c3['query'][_0x2e24('0x40')]){_0x27ad29[_0x2e24('0x41')]=[{'all':!![]}];}_0x27ad29=_[_0x2e24('0x3e')]({},_0x27ad29,_0x4209c3[_0x2e24('0x3f')]);return db[_0x2e24('0x2b')][_0x2e24('0x47')](_0x27ad29)['then'](handleEntityNotFound(_0x234944,null))[_0x2e24('0x22')](respondWithResult(_0x234944,null))[_0x2e24('0x43')](handleError(_0x234944,null));};exports[_0x2e24('0x48')]=function(_0x1490fc,_0x23516f){return db['Pause'][_0x2e24('0x48')](_0x1490fc[_0x2e24('0x49')],{})['then'](function(_0xa39e04){var _0x442a22=_0x1490fc['user']['get']({'plain':!![]});if(!_0x442a22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x442a22[_0x2e24('0x4a')]===_0x2e24('0x4b')){var _0x38b042=_0xa39e04[_0x2e24('0x24')]({'plain':!![]});var _0x8bdddc=_0x2e24('0x25');return db[_0x2e24('0x4c')]['find']({'where':{'name':_0x8bdddc,'userProfileId':_0x442a22[_0x2e24('0x4d')]},'raw':!![]})['then'](function(_0x129cf8){if(_0x129cf8&&_0x129cf8[_0x2e24('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x38b042[_0x2e24('0x29')],'resourceId':_0x38b042['id'],'type':_0x129cf8[_0x2e24('0x29')],'sectionId':_0x129cf8['id']},{})[_0x2e24('0x22')](function(){return _0xa39e04;});}else{return _0xa39e04;}})[_0x2e24('0x43')](function(_0x5233a0){logger['error'](_0x2e24('0x4f'),_0x5233a0);throw _0x5233a0;});}return _0xa39e04;})[_0x2e24('0x22')](respondWithResult(_0x23516f,0xc9))[_0x2e24('0x43')](handleError(_0x23516f,null));};exports[_0x2e24('0x21')]=function(_0x2330ac,_0x50b7a5){if(_0x2330ac[_0x2e24('0x49')]['id']){delete _0x2330ac['body']['id'];}return db['Pause'][_0x2e24('0x47')]({'where':{'id':_0x2330ac[_0x2e24('0x45')]['id']}})[_0x2e24('0x22')](handleEntityNotFound(_0x50b7a5,null))[_0x2e24('0x22')](saveUpdates(_0x2330ac[_0x2e24('0x49')],null))['then'](respondWithResult(_0x50b7a5,null))[_0x2e24('0x43')](handleError(_0x50b7a5,null));};exports[_0x2e24('0x23')]=function(_0x2bbc43,_0x132645){return db['Pause'][_0x2e24('0x47')]({'where':{'id':_0x2bbc43['params']['id']}})[_0x2e24('0x22')](handleEntityNotFound(_0x132645,null))[_0x2e24('0x22')](removeEntity(_0x132645,null))[_0x2e24('0x43')](handleError(_0x132645,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d469a4c..b99ffed 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 _0xe9ca=['api','bluebird','request-promise','./pause.attributes','define','Pause','tools_pauses','lodash','../../config/logger'];(function(_0x4ca813,_0x36d1c3){var _0x3d2a83=function(_0x35e8d4){while(--_0x35e8d4){_0x4ca813['push'](_0x4ca813['shift']());}};_0x3d2a83(++_0x36d1c3);}(_0xe9ca,0xdf));var _0xae9c=function(_0x114882,_0x26aab9){_0x114882=_0x114882-0x0;var _0x38a251=_0xe9ca[_0x114882];return _0x38a251;};'use strict';var _=require(_0xae9c('0x0'));var util=require('util');var logger=require(_0xae9c('0x1'))(_0xae9c('0x2'));var moment=require('moment');var BPromise=require(_0xae9c('0x3'));var rp=require(_0xae9c('0x4'));var attributes=require(_0xae9c('0x5'));module['exports']=function(_0x525be4,_0x5c2c94){return _0x525be4[_0xae9c('0x6')](_0xae9c('0x7'),attributes,{'tableName':_0xae9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0188=['Pause','lodash','util','../../config/logger','api','moment','request-promise','define'];(function(_0x17e4d1,_0x5d10cc){var _0x4dba3b=function(_0x3fe2ba){while(--_0x3fe2ba){_0x17e4d1['push'](_0x17e4d1['shift']());}};_0x4dba3b(++_0x5d10cc);}(_0x0188,0xa9));var _0x8018=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x0188[_0x5a26f5];return _0x2e9ef7;};'use strict';var _=require(_0x8018('0x0'));var util=require(_0x8018('0x1'));var logger=require(_0x8018('0x2'))(_0x8018('0x3'));var moment=require(_0x8018('0x4'));var BPromise=require('bluebird');var rp=require(_0x8018('0x5'));var attributes=require('./pause.attributes');module['exports']=function(_0x87ab6f,_0xe2defc){return _0x87ab6f[_0x8018('0x6')](_0x8018('0x7'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 0bfd1e5..70acae4 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 _0xb93f=['../../config/environment','jayson/promise','http','then','Pause,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Pause','find','raw','options','where','attributes','include','map','model','ShowPause','lodash','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb93f,0x67));var _0xfb93=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xb93f[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0xfb93('0x0'));var util=require(_0xfb93('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb93('0x2'));var db=require(_0xfb93('0x3'))['db'];var utils=require(_0xfb93('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb93('0x5'));var jayson=require(_0xfb93('0x6'));var client=jayson['client'][_0xfb93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5118b2,_0x3602d5,_0xd06816){return new BPromise(function(_0x3c23dc,_0x31d7e4){return client['request'](_0x5118b2,_0xd06816)[_0xfb93('0x8')](function(_0x220a4d){logger['info'](_0xfb93('0x9'),_0x3602d5,_0xfb93('0xa'));logger[_0xfb93('0xb')]('Pause,\x20%s,\x20%s,\x20%s',_0x3602d5,_0xfb93('0xa'),JSON[_0xfb93('0xc')](_0x220a4d));if(_0x220a4d[_0xfb93('0xd')]){if(_0x220a4d[_0xfb93('0xd')]['code']===0x1f4){logger[_0xfb93('0xd')](_0xfb93('0x9'),_0x3602d5,_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);return _0x31d7e4(_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);}logger[_0xfb93('0xd')]('Pause,\x20%s,\x20%s',_0x3602d5,_0x220a4d['error']['message']);return _0x3c23dc(_0x220a4d[_0xfb93('0xd')][_0xfb93('0xe')]);}else{logger['info'](_0xfb93('0x9'),_0x3602d5,'request\x20sent');_0x3c23dc(_0x220a4d[_0xfb93('0xf')][_0xfb93('0xe')]);}})[_0xfb93('0x10')](function(_0x4b28a7){logger['error'](_0xfb93('0x9'),_0x3602d5,_0x4b28a7);_0x31d7e4(_0x4b28a7);});});}exports['ShowPause']=function(_0x340737){var _0x29fa43=this;return new Promise(function(_0x463484,_0x55fca9){return db[_0xfb93('0x11')][_0xfb93('0x12')]({'raw':_0x340737['options']?_0x340737['options'][_0xfb93('0x13')]===undefined?!![]:![]:!![],'where':_0x340737[_0xfb93('0x14')]?_0x340737[_0xfb93('0x14')][_0xfb93('0x15')]||null:null,'attributes':_0x340737[_0xfb93('0x14')]?_0x340737[_0xfb93('0x14')][_0xfb93('0x16')]||null:null,'include':_0x340737[_0xfb93('0x14')]?_0x340737[_0xfb93('0x14')][_0xfb93('0x17')]?_[_0xfb93('0x18')](_0x340737['options']['include'],function(_0x3b960c){return{'model':db[_0x3b960c[_0xfb93('0x19')]],'as':_0x3b960c['as'],'attributes':_0x3b960c[_0xfb93('0x16')],'include':_0x3b960c[_0xfb93('0x17')]?_['map'](_0x3b960c[_0xfb93('0x17')],function(_0x31455e){return{'model':db[_0x31455e[_0xfb93('0x19')]],'as':_0x31455e['as'],'attributes':_0x31455e[_0xfb93('0x16')],'include':_0x31455e[_0xfb93('0x17')]?_['map'](_0x31455e['include'],function(_0x59b37e){return{'model':db[_0x59b37e['model']],'as':_0x59b37e['as'],'attributes':_0x59b37e[_0xfb93('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfb93('0x8')](function(_0x59ac7b){logger['info']('ShowPause',_0x340737);logger[_0xfb93('0xb')](_0xfb93('0x1a'),_0x340737,JSON[_0xfb93('0xc')](_0x59ac7b));_0x463484(_0x59ac7b);})[_0xfb93('0x10')](function(_0x36313e){logger[_0xfb93('0xd')](_0xfb93('0x1a'),_0x36313e[_0xfb93('0xe')],_0x340737);_0x55fca9(_0x29fa43['error'](0x1f4,_0x36313e['message']));});});}; \ No newline at end of file +var _0x427f=['Pause','find','options','where','attributes','include','model','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','ShowPause'];(function(_0x18aa35,_0x5293da){var _0x516297=function(_0x4543d4){while(--_0x4543d4){_0x18aa35['push'](_0x18aa35['shift']());}};_0x516297(++_0x5293da);}(_0x427f,0xc4));var _0xf427=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x427f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf427('0x0'));var util=require(_0xf427('0x1'));var moment=require(_0xf427('0x2'));var BPromise=require(_0xf427('0x3'));var rs=require(_0xf427('0x4'));var fs=require('fs');var Redis=require(_0xf427('0x5'));var db=require(_0xf427('0x6'))['db'];var utils=require(_0xf427('0x7'));var logger=require('../../config/logger')(_0xf427('0x8'));var config=require(_0xf427('0x9'));var jayson=require(_0xf427('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35e528,_0x32dd1b,_0x30e4b8){return new BPromise(function(_0x3b11a3,_0x51e837){return client['request'](_0x35e528,_0x30e4b8)[_0xf427('0xb')](function(_0x42b336){logger[_0xf427('0xc')]('Pause,\x20%s,\x20%s',_0x32dd1b,_0xf427('0xd'));logger['debug'](_0xf427('0xe'),_0x32dd1b,_0xf427('0xd'),JSON[_0xf427('0xf')](_0x42b336));if(_0x42b336[_0xf427('0x10')]){if(_0x42b336[_0xf427('0x10')][_0xf427('0x11')]===0x1f4){logger[_0xf427('0x10')](_0xf427('0x12'),_0x32dd1b,_0x42b336[_0xf427('0x10')]['message']);return _0x51e837(_0x42b336[_0xf427('0x10')]['message']);}logger[_0xf427('0x10')](_0xf427('0x12'),_0x32dd1b,_0x42b336[_0xf427('0x10')][_0xf427('0x13')]);return _0x3b11a3(_0x42b336[_0xf427('0x10')][_0xf427('0x13')]);}else{logger[_0xf427('0xc')](_0xf427('0x12'),_0x32dd1b,'request\x20sent');_0x3b11a3(_0x42b336['result'][_0xf427('0x13')]);}})['catch'](function(_0x1ba831){logger[_0xf427('0x10')](_0xf427('0x12'),_0x32dd1b,_0x1ba831);_0x51e837(_0x1ba831);});});}exports[_0xf427('0x14')]=function(_0x241b17){var _0x544c98=this;return new Promise(function(_0x5a4a06,_0x14166a){return db[_0xf427('0x15')][_0xf427('0x16')]({'raw':_0x241b17[_0xf427('0x17')]?_0x241b17[_0xf427('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x241b17[_0xf427('0x17')]?_0x241b17['options'][_0xf427('0x18')]||null:null,'attributes':_0x241b17[_0xf427('0x17')]?_0x241b17['options'][_0xf427('0x19')]||null:null,'include':_0x241b17[_0xf427('0x17')]?_0x241b17[_0xf427('0x17')][_0xf427('0x1a')]?_['map'](_0x241b17[_0xf427('0x17')][_0xf427('0x1a')],function(_0x18c942){return{'model':db[_0x18c942[_0xf427('0x1b')]],'as':_0x18c942['as'],'attributes':_0x18c942[_0xf427('0x19')],'include':_0x18c942[_0xf427('0x1a')]?_[_0xf427('0x1c')](_0x18c942[_0xf427('0x1a')],function(_0x570e1c){return{'model':db[_0x570e1c[_0xf427('0x1b')]],'as':_0x570e1c['as'],'attributes':_0x570e1c[_0xf427('0x19')],'include':_0x570e1c[_0xf427('0x1a')]?_[_0xf427('0x1c')](_0x570e1c[_0xf427('0x1a')],function(_0x66d638){return{'model':db[_0x66d638[_0xf427('0x1b')]],'as':_0x66d638['as'],'attributes':_0x66d638[_0xf427('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf427('0xb')](function(_0x1bc62d){logger[_0xf427('0xc')](_0xf427('0x14'),_0x241b17);logger[_0xf427('0x1d')](_0xf427('0x14'),_0x241b17,JSON[_0xf427('0xf')](_0x1bc62d));_0x5a4a06(_0x1bc62d);})[_0xf427('0x1e')](function(_0x28c012){logger['error'](_0xf427('0x14'),_0x28c012[_0xf427('0x13')],_0x241b17);_0x14166a(_0x544c98[_0xf427('0x10')](0x1f4,_0x28c012['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 29f2604..e7acd77 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 _0xdd25=['download','diskStorage','server/files/plugins','originalname','format','basename','extname','now','post','single','file','upload','/webhook','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show'];(function(_0x47c919,_0x37ff1f){var _0x2e808b=function(_0x50770d){while(--_0x50770d){_0x47c919['push'](_0x47c919['shift']());}};_0x2e808b(++_0x37ff1f);}(_0xdd25,0x16a));var _0x5dd2=function(_0x33bacc,_0x350526){_0x33bacc=_0x33bacc-0x0;var _0x5eb653=_0xdd25[_0x33bacc];return _0x5eb653;};'use strict';var multer=require(_0x5dd2('0x0'));var util=require(_0x5dd2('0x1'));var path=require(_0x5dd2('0x2'));var timeout=require(_0x5dd2('0x3'));var express=require(_0x5dd2('0x4'));var router=express[_0x5dd2('0x5')]();var auth=require(_0x5dd2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5dd2('0x7'));var controller=require(_0x5dd2('0x8'));router[_0x5dd2('0x9')]('/',auth[_0x5dd2('0xa')](),controller[_0x5dd2('0xb')]);router[_0x5dd2('0x9')]('/webhook',controller[_0x5dd2('0xc')]);router[_0x5dd2('0x9')](_0x5dd2('0xd'),auth[_0x5dd2('0xa')](),controller[_0x5dd2('0xe')]);router[_0x5dd2('0x9')]('/:id/download',auth[_0x5dd2('0xa')](),controller[_0x5dd2('0xf')]);var upload=multer({'storage':multer[_0x5dd2('0x10')]({'destination':function(_0x4f1bab,_0x3208fd,_0x369a80){_0x369a80(null,path['join'](config['root'],_0x5dd2('0x11')));},'filename':function(_0x32432e,_0x2cc02b,_0x360b5f){_0x2cc02b[_0x5dd2('0x12')]=_0x2cc02b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x360b5f(null,util[_0x5dd2('0x13')]('%s-%s%s',path[_0x5dd2('0x14')](_0x2cc02b['originalname'],path[_0x5dd2('0x15')](_0x2cc02b[_0x5dd2('0x12')])),Date[_0x5dd2('0x16')](),path[_0x5dd2('0x15')](_0x2cc02b['originalname'])));}})});router[_0x5dd2('0x17')]('/',upload[_0x5dd2('0x18')](_0x5dd2('0x19')),controller[_0x5dd2('0x1a')]);router[_0x5dd2('0x17')](_0x5dd2('0x1b'),controller['webhookPost']);router['put'](_0x5dd2('0xd'),auth[_0x5dd2('0xa')](),controller['update']);router[_0x5dd2('0x1c')](_0x5dd2('0xd'),auth[_0x5dd2('0xa')](),controller[_0x5dd2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x666f=['basename','extname','post','single','file','upload','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/webhook','webhookGet','/:id','download','root','originalname','replace'];(function(_0x2da3ff,_0x534fd4){var _0x482ff2=function(_0x421913){while(--_0x421913){_0x2da3ff['push'](_0x2da3ff['shift']());}};_0x482ff2(++_0x534fd4);}(_0x666f,0x19f));var _0xf666=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x666f[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xf666('0x0'));var util=require(_0xf666('0x1'));var path=require(_0xf666('0x2'));var timeout=require(_0xf666('0x3'));var express=require(_0xf666('0x4'));var router=express[_0xf666('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf666('0x6'));var config=require(_0xf666('0x7'));var controller=require('./plugin.controller');router[_0xf666('0x8')]('/',auth[_0xf666('0x9')](),controller['index']);router[_0xf666('0x8')](_0xf666('0xa'),controller[_0xf666('0xb')]);router['get'](_0xf666('0xc'),auth[_0xf666('0x9')](),controller['show']);router[_0xf666('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf666('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35f1de,_0x52dda7,_0x42a323){_0x42a323(null,path['join'](config[_0xf666('0xe')],'server/files/plugins'));},'filename':function(_0x179d60,_0xe1d086,_0x1bb86f){_0xe1d086['originalname']=_0xe1d086[_0xf666('0xf')][_0xf666('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bb86f(null,util['format']('%s-%s%s',path[_0xf666('0x11')](_0xe1d086[_0xf666('0xf')],path[_0xf666('0x12')](_0xe1d086['originalname'])),Date['now'](),path[_0xf666('0x12')](_0xe1d086[_0xf666('0xf')])));}})});router[_0xf666('0x13')]('/',upload[_0xf666('0x14')](_0xf666('0x15')),controller[_0xf666('0x16')]);router[_0xf666('0x13')](_0xf666('0xa'),controller[_0xf666('0x17')]);router[_0xf666('0x18')](_0xf666('0xc'),auth[_0xf666('0x9')](),controller[_0xf666('0x19')]);router[_0xf666('0x1a')]('/:id',auth[_0xf666('0x9')](),controller[_0xf666('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3811e69..8a7dd88 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 _0x912b=['adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x4e8de1,_0x6fa33a){var _0x4a15c2=function(_0x5ca7c0){while(--_0x5ca7c0){_0x4e8de1['push'](_0x4e8de1['shift']());}};_0x4a15c2(++_0x6fa33a);}(_0x912b,0x190));var _0xb912=function(_0x1c4951,_0x2038ee){_0x1c4951=_0x1c4951-0x0;var _0x345e1b=_0x912b[_0x1c4951];return _0x345e1b;};'use strict';var Sequelize=require(_0xb912('0x0'));module[_0xb912('0x1')]={'name':{'type':Sequelize[_0xb912('0x2')]},'type':{'type':Sequelize[_0xb912('0x3')](_0xb912('0x4'),'script')},'description':{'type':Sequelize[_0xb912('0x5')]},'version':{'type':Sequelize[_0xb912('0x5')]},'path':{'type':Sequelize[_0xb912('0x2')],'comment':_0xb912('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb912('0x7')},'sidebar':{'type':Sequelize[_0xb912('0x3')](_0xb912('0x8'),'agentOnly',_0xb912('0x9'),_0xb912('0xa')),'defaultValue':_0xb912('0x9'),'comment':_0xb912('0xb')},'icon':{'type':Sequelize[_0xb912('0x2')]},'adminUrl':{'type':Sequelize[_0xb912('0x2')]},'agentUrl':{'type':Sequelize[_0xb912('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xb912('0x2')]}}; \ No newline at end of file +var _0xe569=['ENUM','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x473a38,_0x1c0e5e){var _0x569d43=function(_0x4add6d){while(--_0x4add6d){_0x473a38['push'](_0x473a38['shift']());}};_0x569d43(++_0x1c0e5e);}(_0xe569,0x1c8));var _0x9e56=function(_0x360e5c,_0x1d60de){_0x360e5c=_0x360e5c-0x0;var _0x3629ea=_0xe569[_0x360e5c];return _0x3629ea;};'use strict';var Sequelize=require(_0x9e56('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0x9e56('0x1'))},'description':{'type':Sequelize[_0x9e56('0x2')]},'version':{'type':Sequelize[_0x9e56('0x2')]},'path':{'type':Sequelize[_0x9e56('0x3')],'comment':_0x9e56('0x4')},'active':{'type':Sequelize[_0x9e56('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x9e56('0x6')](_0x9e56('0x7'),_0x9e56('0x8'),_0x9e56('0x9'),'never'),'defaultValue':'always','comment':_0x9e56('0xa')},'icon':{'type':Sequelize[_0x9e56('0x3')]},'adminUrl':{'type':Sequelize[_0x9e56('0x3')]},'agentUrl':{'type':Sequelize[_0x9e56('0x3')]},'scriptName':{'type':Sequelize[_0x9e56('0x3')]},'scriptPath':{'type':Sequelize[_0x9e56('0x3')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e498ccb..c9ffcb1 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 _0x8f46=['../../config/license/hardware','ioredis','extract-zip','archiver','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','save','then','Plugins','UserProfileResource','stack','name','index','Plugin','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','catch','show','params','find','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','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','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','%s%s','headers','content-length','set','statusCode','webhookPost','method','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x4d5c64,_0x5db7e7){var _0x41be74=function(_0x2e72f6){while(--_0x2e72f6){_0x4d5c64['push'](_0x4d5c64['shift']());}};_0x41be74(++_0x5db7e7);}(_0x8f46,0x14a));var _0x68f4=function(_0x52d964,_0x1de707){_0x52d964=_0x52d964-0x0;var _0x553f0d=_0x8f46[_0x52d964];return _0x553f0d;};'use strict';var pdf=require(_0x68f4('0x0'));var emlformat=require(_0x68f4('0x1'));var rimraf=require(_0x68f4('0x2'));var zipdir=require(_0x68f4('0x3'));var jsonpatch=require(_0x68f4('0x4'));var rp=require(_0x68f4('0x5'));var moment=require(_0x68f4('0x6'));var BPromise=require(_0x68f4('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x68f4('0x8'));var sox=require(_0x68f4('0x9'));var csv=require(_0x68f4('0xa'));var ejs=require(_0x68f4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x68f4('0xc'));var crypto=require(_0x68f4('0xd'));var jsforce=require(_0x68f4('0xe'));var deskjs=require(_0x68f4('0xf'));var toCsv=require(_0x68f4('0xa'));var querystring=require('querystring');var Papa=require(_0x68f4('0x10'));var authService=require(_0x68f4('0x11'));var hardwareService=require(_0x68f4('0x12'));var Redis=require(_0x68f4('0x13'));var extract=require(_0x68f4('0x14'));var rimraf=require(_0x68f4('0x2'));var archiver=require(_0x68f4('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0x68f4('0x16'))('api');var utils=require(_0x68f4('0x17'));var config=require(_0x68f4('0x18'));var db=require(_0x68f4('0x19'))['db'];config['redis']=_[_0x68f4('0x1a')](config[_0x68f4('0x1b')],{'host':_0x68f4('0x1c'),'port':0x18eb});var socket=require(_0x68f4('0x1d'))(new Redis(config[_0x68f4('0x1b')]));require(_0x68f4('0x1e'))[_0x68f4('0x1f')](socket);function respondWithStatusCode(_0x584710,_0x3f4742){_0x3f4742=_0x3f4742||0xcc;return function(_0x1feb76){if(_0x1feb76){return _0x584710[_0x68f4('0x20')](_0x3f4742);}return _0x584710[_0x68f4('0x21')](_0x3f4742)[_0x68f4('0x22')]();};}function respondWithResult(_0x80b1b2,_0x1c60ce){_0x1c60ce=_0x1c60ce||0xc8;return function(_0x2d20e4){if(_0x2d20e4){return _0x80b1b2[_0x68f4('0x21')](_0x1c60ce)[_0x68f4('0x23')](_0x2d20e4);}};}function respondWithFilteredResult(_0x416a2d,_0x29dc3f){return function(_0x1dac09){if(_0x1dac09){var _0xbad0d5=_0x1dac09['count'],_0xc33a2c=_0x29dc3f[_0x68f4('0x24')],_0x54caf9=_0x29dc3f['offset']+_0x29dc3f[_0x68f4('0x25')],_0x147212;if(_0x54caf9>=_0xbad0d5){_0x54caf9=_0xbad0d5;_0x147212=0xc8;}else{_0x147212=0xce;}_0x416a2d['status'](_0x147212);return _0x416a2d['set'](_0x68f4('0x26'),_0xc33a2c+'-'+_0x54caf9+'/'+_0xbad0d5)[_0x68f4('0x23')](_0x1dac09);}return null;};}function patchUpdates(_0x2018a7){return function(_0x273b0e){try{jsonpatch['apply'](_0x273b0e,_0x2018a7,!![]);}catch(_0x6a2ad0){return BPromise['reject'](_0x6a2ad0);}return _0x273b0e[_0x68f4('0x27')]();};}function saveUpdates(_0x29bab0,_0xf650ac){return function(_0x48804a){if(_0x48804a){return _0x48804a['update'](_0x29bab0)[_0x68f4('0x28')](function(_0x45f570){return _0x45f570;});}return null;};}function removeEntity(_0x35b37e,_0x7f5155){return function(_0x26de8b){if(_0x26de8b){return _0x26de8b['destroy']()['then'](function(){var _0x4e16c1=_0x26de8b['get']({'plain':!![]});var _0x9009e6=_0x68f4('0x29');return db[_0x68f4('0x2a')]['destroy']({'where':{'type':_0x9009e6,'resourceId':_0x4e16c1['id']}})[_0x68f4('0x28')](function(){return _0x26de8b;});})['then'](function(){_0x35b37e[_0x68f4('0x21')](0xcc)[_0x68f4('0x22')]();});}};}function handleEntityNotFound(_0x2b249f,_0x28d88c){return function(_0x103772){if(!_0x103772){_0x2b249f[_0x68f4('0x20')](0x194);}return _0x103772;};}function handleError(_0x1607f5,_0x12e432){_0x12e432=_0x12e432||0x1f4;return function(_0x468794){logger['error'](_0x468794[_0x68f4('0x2b')]);if(_0x468794[_0x68f4('0x2c')]){delete _0x468794[_0x68f4('0x2c')];}_0x1607f5[_0x68f4('0x21')](_0x12e432)['send'](_0x468794);};}exports[_0x68f4('0x2d')]=function(_0x5ecce4,_0x52e4e4){var _0x2d6342={},_0x30bdcd={},_0x76091b={'count':0x0,'rows':[]};var _0x392815=db[_0x68f4('0x2e')][_0x68f4('0x2f')];_0x30bdcd[_0x68f4('0x30')]=_[_0x68f4('0x31')](_0x392815);_0x30bdcd['query']=_[_0x68f4('0x31')](_0x5ecce4[_0x68f4('0x32')]);_0x30bdcd[_0x68f4('0x33')]=_['intersection'](_0x30bdcd[_0x68f4('0x30')],_0x30bdcd[_0x68f4('0x32')]);_0x2d6342[_0x68f4('0x34')]=_[_0x68f4('0x35')](_0x30bdcd[_0x68f4('0x30')],qs[_0x68f4('0x36')](_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x36')]));_0x2d6342[_0x68f4('0x34')]=_0x2d6342[_0x68f4('0x34')][_0x68f4('0x37')]?_0x2d6342['attributes']:_0x30bdcd[_0x68f4('0x30')];if(!_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x38')](_0x68f4('0x39'))){_0x2d6342[_0x68f4('0x25')]=qs['limit'](_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x25')]);_0x2d6342['offset']=qs['offset'](_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x24')]);}_0x2d6342['order']=qs[_0x68f4('0x3a')](_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x3a')]);_0x2d6342[_0x68f4('0x3b')]=qs[_0x68f4('0x33')](_[_0x68f4('0x3c')](_0x5ecce4[_0x68f4('0x32')],_0x30bdcd[_0x68f4('0x33')]));if(_0x5ecce4[_0x68f4('0x32')]['filter']){_0x2d6342[_0x68f4('0x3b')]=_[_0x68f4('0x3d')](_0x2d6342['where'],{'$or':_[_0x68f4('0x3e')](_0x392815,function(_0x21df9f){if(_0x21df9f[_0x68f4('0x3f')][_0x68f4('0x40')]!==_0x68f4('0x41')){var _0x3208fb={};_0x3208fb[_0x21df9f[_0x68f4('0x42')]]={'$like':'%'+_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x43')]+'%'};return _0x3208fb;}})});}_0x2d6342=_['merge']({},_0x2d6342,_0x5ecce4[_0x68f4('0x44')]);var _0x162e95={'where':_0x2d6342['where']};return db[_0x68f4('0x2e')][_0x68f4('0x45')](_0x162e95)[_0x68f4('0x28')](function(_0xc4f36c){_0x76091b[_0x68f4('0x45')]=_0xc4f36c;if(_0x5ecce4[_0x68f4('0x32')][_0x68f4('0x46')]){_0x2d6342[_0x68f4('0x47')]=[{'all':!![]}];}return db[_0x68f4('0x2e')][_0x68f4('0x48')](_0x2d6342);})[_0x68f4('0x28')](function(_0x38bd66){_0x76091b['rows']=_0x38bd66;return _0x76091b;})[_0x68f4('0x28')](respondWithFilteredResult(_0x52e4e4,_0x2d6342))[_0x68f4('0x49')](handleError(_0x52e4e4,null));};exports[_0x68f4('0x4a')]=function(_0x40dd90,_0x227b65){var _0x9ac964={'raw':!![],'where':{'id':_0x40dd90[_0x68f4('0x4b')]['id']}},_0x85846b={};_0x85846b['model']=_[_0x68f4('0x31')](db[_0x68f4('0x2e')]['rawAttributes']);_0x85846b[_0x68f4('0x32')]=_[_0x68f4('0x31')](_0x40dd90[_0x68f4('0x32')]);_0x85846b[_0x68f4('0x33')]=_[_0x68f4('0x35')](_0x85846b[_0x68f4('0x30')],_0x85846b[_0x68f4('0x32')]);_0x9ac964[_0x68f4('0x34')]=_['intersection'](_0x85846b[_0x68f4('0x30')],qs[_0x68f4('0x36')](_0x40dd90['query']['fields']));_0x9ac964[_0x68f4('0x34')]=_0x9ac964[_0x68f4('0x34')][_0x68f4('0x37')]?_0x9ac964[_0x68f4('0x34')]:_0x85846b['model'];if(_0x40dd90[_0x68f4('0x32')][_0x68f4('0x46')]){_0x9ac964[_0x68f4('0x47')]=[{'all':!![]}];}_0x9ac964=_['merge']({},_0x9ac964,_0x40dd90[_0x68f4('0x44')]);return db[_0x68f4('0x2e')][_0x68f4('0x4c')](_0x9ac964)['then'](handleEntityNotFound(_0x227b65,null))['then'](respondWithResult(_0x227b65,null))['catch'](handleError(_0x227b65,null));};exports['download']=function(_0x1b0525,_0x3db235,_0x1c686e){return db[_0x68f4('0x2e')][_0x68f4('0x4c')]({'where':{'id':_0x1b0525[_0x68f4('0x4b')]['id']},'attributes':['name',_0x68f4('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x3db235,null))['then'](function(_0x266b8a){if(_0x266b8a){var _0x20a0ea=path[_0x68f4('0x4d')](config[_0x68f4('0x4e')],_0x68f4('0x4f'),util['format'](_0x68f4('0x50'),path[_0x68f4('0x51')](_0x266b8a[_0x68f4('0x8')])));var _0x15644f=fs[_0x68f4('0x52')](_0x20a0ea);var _0x3f2a3f=archiver(_0x68f4('0x53'),{'zlib':{'level':0x9}});_0x3f2a3f['on'](_0x68f4('0x54'),function(_0x180e1c){if(_0x180e1c[_0x68f4('0x55')]===_0x68f4('0x56')){logger['error'](_0x180e1c);}else{throw new db[(_0x68f4('0x57'))][(_0x68f4('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3f2a3f['on'](_0x68f4('0x59'),function(_0x54fcd5){throw new db[(_0x68f4('0x57'))][(_0x68f4('0x58'))](_0x68f4('0x5a'));});_0x3f2a3f[_0x68f4('0x5b')](_0x15644f);_0x3f2a3f[_0x68f4('0x5c')](_0x68f4('0x5d'),{'cwd':path[_0x68f4('0x4d')](config[_0x68f4('0x4e')],_0x68f4('0x4f'),path[_0x68f4('0x5e')](_0x266b8a[_0x68f4('0x8')])),'ignore':[path[_0x68f4('0x4d')](path[_0x68f4('0x51')](_0x266b8a['path']),_0x68f4('0x5f')),path['join'](path[_0x68f4('0x51')](_0x266b8a[_0x68f4('0x8')]),_0x68f4('0x60'))],'nodir':!![]})[_0x68f4('0x61')]();_0x15644f['on'](_0x68f4('0x62'),function(){if(!fs[_0x68f4('0x63')](_0x20a0ea)){throw new db[(_0x68f4('0x57'))]['Error']('Plugin\x20not\x20found');}return _0x3db235[_0x68f4('0x64')](_0x20a0ea,util[_0x68f4('0x65')](_0x68f4('0x50'),path[_0x68f4('0x51')](_0x266b8a[_0x68f4('0x8')])),function(_0x30ac51){if(_0x30ac51){throw new db[(_0x68f4('0x57'))][(_0x68f4('0x58'))](_0x68f4('0x66'));}fs[_0x68f4('0x67')](_0x20a0ea);logger[_0x68f4('0x68')](_0x68f4('0x69'));logger['info'](_0x68f4('0x6a'));});});}return null;})[_0x68f4('0x49')](handleError(_0x3db235,null));};exports['upload']=function(_0x35c086,_0x269012,_0x98c4d6){var _0x8b9082=path[_0x68f4('0x51')](_0x35c086[_0x68f4('0x6b')][_0x68f4('0x6c')],path[_0x68f4('0x6d')](_0x35c086[_0x68f4('0x6b')]['filename']));var _0x4af1dd=path[_0x68f4('0x4d')](config[_0x68f4('0x4e')],_0x68f4('0x4f'),_0x35c086['file'][_0x68f4('0x6c')]);var _0x4bb2c4=path[_0x68f4('0x4d')](config['root'],'server/files/plugins',_0x8b9082);logger[_0x68f4('0x68')](_0x68f4('0x6e'),_0x4af1dd);logger['info'](_0x68f4('0x6f'),_0x4bb2c4);try{fs[_0x68f4('0x70')](_0x4af1dd,parseInt(_0x68f4('0x71'),0x8));extract(_0x4af1dd,{'dir':_0x4bb2c4},function(_0x8690b0){if(_0x8690b0){logger[_0x68f4('0x59')](_0x8690b0);handleError(_0x8690b0,!![]);};var _0x3cd2b6=fs[_0x68f4('0x72')](_0x4bb2c4);if(_0x3cd2b6[_0x68f4('0x37')]>0x1){removeReferences(_0x4af1dd,_0x4bb2c4);logger[_0x68f4('0x59')](_0x68f4('0x73'));return _0x98c4d6(new Error(_0x68f4('0x73')));}var _0x54d1d1=fs[_0x68f4('0x74')](path[_0x68f4('0x4d')](_0x4bb2c4,_0x3cd2b6[0x0]));if(_0x54d1d1[_0x68f4('0x75')]()){removeReferences(_0x4af1dd,_0x4bb2c4);logger[_0x68f4('0x59')]('Invalid\x20plugin\x20structure');return _0x98c4d6(new Error(_0x68f4('0x73')));}if(_0x54d1d1[_0x68f4('0x76')]()){var _0x1709bb=fs[_0x68f4('0x72')](path[_0x68f4('0x4d')](_0x4bb2c4,_0x3cd2b6[0x0]));if(_0x1709bb[_0x68f4('0x37')]===0x0){removeReferences(_0x4af1dd,_0x4bb2c4);logger[_0x68f4('0x59')]('Invalid\x20plugin\x20structure');return _0x98c4d6(new Error(_0x68f4('0x73')));}var _0x165678=_0x1709bb[_0x68f4('0x77')](function(_0x3ea2fe){return _0x3ea2fe==='manifest.json';});if(!_0x165678){return _0x98c4d6(new Error(_0x68f4('0x78')));}var _0xcf9eea=fs[_0x68f4('0x79')](path[_0x68f4('0x4d')](_0x4bb2c4,_0x3cd2b6[0x0],_0x68f4('0x7a')));var _0x4cf454=JSON[_0x68f4('0x7b')](_0xcf9eea);if(_0x68f4('0x7c')==typeof _0x4cf454[_0x68f4('0x2c')]){return _0x98c4d6(new Error(_0x68f4('0x7d')));}if(_0x68f4('0x7c')==typeof _0x4cf454[_0x68f4('0x3f')]){return _0x98c4d6(new Error(_0x68f4('0x7e')));}if(_0x68f4('0x7c')==typeof _0x4cf454[_0x68f4('0x7f')]){return _0x98c4d6(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x68f4('0x7c')==typeof _0x4cf454[_0x68f4('0x80')]){return _0x98c4d6(new Error(_0x68f4('0x81')));}if(_0x4cf454['type']===_0x68f4('0x82')){if(_0x68f4('0x7c')==typeof _0x4cf454['parameters'][_0x68f4('0x83')]){return _0x98c4d6(new Error(_0x68f4('0x84')));}if(_0x68f4('0x7c')==typeof _0x4cf454['parameters'][_0x68f4('0x83')][_0x68f4('0x85')]&&_0x68f4('0x7c')==typeof _0x4cf454[_0x68f4('0x80')]['views'][_0x68f4('0x86')]){return _0x98c4d6(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4cf454[_0x68f4('0x3f')]===_0x68f4('0x87')){if('undefined'==typeof _0x4cf454[_0x68f4('0x80')]['scriptName']){return _0x98c4d6(new Error(_0x68f4('0x88')));}if('undefined'==typeof _0x4cf454[_0x68f4('0x80')][_0x68f4('0x89')]){return _0x98c4d6(new Error(_0x68f4('0x8a')));}}else{return _0x98c4d6(new Error(_0x68f4('0x8b')));}var _0x5ce4f9=_0x4cf454[_0x68f4('0x2c')];var _0x5a5273=_0x4cf454[_0x68f4('0x8c')];var _0x414406=_0x4cf454['type'];var _0x4dd436=_0x4cf454['sidebar']?_0x4cf454['sidebar']:'always';var _0x37b51a=_0x4cf454[_0x68f4('0x8d')]?_0x4cf454[_0x68f4('0x8d')]:_0x68f4('0x8e');var _0x3db04d='';var _0x4b2279='';var _0x3bb616='';var _0x588e7d='';var _0x2c87c6=_0x4cf454[_0x68f4('0x7f')];if(_0x414406===_0x68f4('0x82')){if(_0x68f4('0x7c')!=typeof _0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')][_0x68f4('0x85')]){var _0x17a918=_0x4cf454[_0x68f4('0x80')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x68f4('0x8f')](_0x17a918)){_0x3db04d=path[_0x68f4('0x4d')](_0x68f4('0x90'),_0x8b9082,_0x3cd2b6[0x0],_0x17a918);}else{_0x3db04d=_0x17a918;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x68f4('0x7c')!=typeof _0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')]['agent']){var _0x3f7535=_0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')][_0x68f4('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x68f4('0x8f')](_0x3f7535)){_0x4b2279=path[_0x68f4('0x4d')]('plugins',_0x8b9082,_0x3cd2b6[0x0],_0x3f7535);}else{_0x4b2279=_0x3f7535;}}else{logger[_0x68f4('0x68')](_0x68f4('0x91'));}}else if(_0x414406===_0x68f4('0x87')){_0x3bb616=_0x4cf454['parameters'][_0x68f4('0x92')];_0x588e7d=_0x4cf454[_0x68f4('0x80')][_0x68f4('0x89')];if(_0x68f4('0x7c')!=typeof _0x4cf454['parameters']['views']){if('undefined'!=typeof _0x4cf454[_0x68f4('0x80')]['views'][_0x68f4('0x85')]){var _0x17a918=_0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x68f4('0x8f')](_0x17a918)){_0x3db04d=path[_0x68f4('0x4d')]('plugins',_0x8b9082,_0x3cd2b6[0x0],_0x17a918);}else{_0x3db04d=_0x17a918;}}if('undefined'!=typeof _0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')][_0x68f4('0x86')]){var _0x3f7535=_0x4cf454[_0x68f4('0x80')][_0x68f4('0x83')][_0x68f4('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x68f4('0x8f')](_0x3f7535)){_0x4b2279=path[_0x68f4('0x4d')](_0x68f4('0x90'),_0x8b9082,_0x3cd2b6[0x0],_0x3f7535);}else{_0x4b2279=_0x3f7535;}}}}var _0x385bc5={'name':_0x5ce4f9,'description':_0x5a5273,'path':path[_0x68f4('0x4d')](_0x8b9082,_0x3cd2b6[0x0]),'type':_0x414406,'sidebar':_0x4dd436,'icon':_0x37b51a,'adminUrl':_0x3db04d,'agentUrl':_0x4b2279,'scriptName':_0x3bb616,'scriptPath':_0x588e7d,'version':_0x2c87c6};removeReferences(_0x4af1dd,null);return db[_0x68f4('0x2e')][_0x68f4('0x93')](_0x385bc5)[_0x68f4('0x28')](function(_0x8be608){var _0x316c9a={'role':_0x35c086[_0x68f4('0x94')][_0x68f4('0x95')],'userProfileId':_0x35c086[_0x68f4('0x94')]['userProfileId']};if(!_0x316c9a)throw new Error(_0x68f4('0x96'));if(_0x316c9a[_0x68f4('0x95')]===_0x68f4('0x97')){var _0x3ee83f=_0x8be608[_0x68f4('0x98')]({'plain':!![]});return db['UserProfileSection'][_0x68f4('0x4c')]({'where':{'name':_0x68f4('0x29'),'userProfileId':_0x316c9a[_0x68f4('0x99')]},'raw':!![]})[_0x68f4('0x28')](function(_0x1bf14b){if(_0x1bf14b&&_0x1bf14b[_0x68f4('0x9a')]===0x0){return db[_0x68f4('0x2a')][_0x68f4('0x93')]({'name':_0x3ee83f[_0x68f4('0x2c')],'resourceId':_0x3ee83f['id'],'type':_0x1bf14b[_0x68f4('0x2c')],'sectionId':_0x1bf14b['id']},{})[_0x68f4('0x28')](function(){return _0x8be608;});}else{return _0x8be608;}})[_0x68f4('0x49')](function(_0x4a5fbe){logger[_0x68f4('0x59')](_0x68f4('0x9b'),_0x4a5fbe);throw _0x4a5fbe;});}return _0x8be608;})[_0x68f4('0x28')](respondWithResult(_0x269012,null))[_0x68f4('0x49')](handleError(_0x269012,null));}});}catch(_0xa65d28){_0x269012[_0x68f4('0x21')](0x1f4)[_0x68f4('0x9c')](_0xa65d28);}};function removeReferences(_0x112a49,_0x281513){try{if(_0x112a49){fs[_0x68f4('0x67')](_0x112a49);logger[_0x68f4('0x68')](_0x68f4('0x9d'));}if(_0x281513){rimraf(_0x281513,function(){});logger[_0x68f4('0x68')](_0x68f4('0x9e'));}}catch(_0x22847d){logger[_0x68f4('0x59')](_0x22847d);}}exports['update']=function(_0x17d99c,_0x1ac663,_0x383dbb){return db[_0x68f4('0x2e')][_0x68f4('0x4c')]({'where':{'id':_0x17d99c[_0x68f4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ac663,null))[_0x68f4('0x28')](saveUpdates(_0x17d99c['body'],null))[_0x68f4('0x28')](respondWithResult(_0x1ac663,null))[_0x68f4('0x49')](handleError(_0x1ac663,null));};exports[_0x68f4('0x9f')]=function(_0x2a778a,_0x4c36e5,_0x4912bc){return db[_0x68f4('0x2e')][_0x68f4('0x4c')]({'where':{'id':_0x2a778a['params']['id']}})[_0x68f4('0x28')](function(_0x475234){if(_0x475234){return _0x475234[_0x68f4('0xa0')]();}})['then'](function(_0x2fd4a1){rimraf(path[_0x68f4('0x4d')](config[_0x68f4('0x4e')],_0x68f4('0x4f'),path[_0x68f4('0x5e')](_0x2fd4a1[_0x68f4('0x8')])),function(){});return _0x2fd4a1;})[_0x68f4('0x28')](handleEntityNotFound(_0x4c36e5,null))[_0x68f4('0x28')](respondWithStatusCode(_0x4c36e5,null))[_0x68f4('0x49')](handleError(_0x4c36e5,null));};exports['webhookGet']=function(_0x149a57,_0x310cfa,_0x1ddb0f){return BPromise[_0x68f4('0xa1')]()[_0x68f4('0x28')](function(){if(!_0x149a57[_0x68f4('0x32')][_0x68f4('0x8')]){throw new Error(_0x68f4('0xa2'));}if(!_0x149a57[_0x68f4('0x32')][_0x68f4('0xa3')]){throw new Error(_0x68f4('0xa4'));}var _0x3bbdc4=_0x149a57[_0x68f4('0x32')][_0x68f4('0xa5')]?_0x149a57[_0x68f4('0x32')][_0x68f4('0xa5')]+':'+_0x149a57[_0x68f4('0x32')][_0x68f4('0xa3')]:'http://localhost:'+_0x149a57['query'][_0x68f4('0xa3')];var _0x16554c=_0x149a57[_0x68f4('0x32')][_0x68f4('0x23')]?_0x149a57['query'][_0x68f4('0x23')]:!![];var _0x87a461=_0x149a57[_0x68f4('0x32')][_0x68f4('0xa6')]?_0x149a57[_0x68f4('0x32')][_0x68f4('0xa6')]:null;var _0x92dddb={'method':_0x149a57['method'],'uri':util[_0x68f4('0x65')](_0x68f4('0xa7'),_0x3bbdc4,_0x149a57[_0x68f4('0x32')]['path']),'json':_0x16554c,'resolveWithFullResponse':!![],'encoding':_0x87a461,'qs':_0x149a57[_0x68f4('0x32')]};if(_0x149a57[_0x68f4('0xa8')]){_0x92dddb[_0x68f4('0xa8')]=_0x149a57[_0x68f4('0xa8')];if(_0x92dddb[_0x68f4('0xa8')][_0x68f4('0xa9')]){delete _0x92dddb['headers'][_0x68f4('0xa9')];}}return rp(_0x92dddb);})['then'](function(_0x4aa37c){if(_0x4aa37c){_0x310cfa[_0x68f4('0xaa')](_0x4aa37c[_0x68f4('0xa8')]);logger[_0x68f4('0x68')](_0x4aa37c[_0x68f4('0x94')]);if(_['endsWith'](_0x149a57[_0x68f4('0x32')][_0x68f4('0x8')],_0x68f4('0x64'))&&_0x4aa37c[_0x68f4('0xab')]==0x1f4){return _0x310cfa['sendStatus'](_0x4aa37c[_0x68f4('0xab')]);}else{return _0x310cfa['status'](_0x4aa37c['statusCode'])[_0x68f4('0x9c')](_0x4aa37c[_0x68f4('0x94')]);}}else{return _0x310cfa[_0x68f4('0x20')](0xc8);}})['catch'](handleError(_0x310cfa,null));};exports[_0x68f4('0xac')]=function(_0x168314,_0x443556,_0x548eba){return BPromise['resolve']()['then'](function(){if(!_0x168314[_0x68f4('0x32')][_0x68f4('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x168314['query']['port']){throw new Error(_0x68f4('0xa4'));}var _0x1cb68b=_0x168314[_0x68f4('0x32')][_0x68f4('0xa5')]?_0x168314['query'][_0x68f4('0xa5')]+':'+_0x168314[_0x68f4('0x32')][_0x68f4('0xa3')]:'http://localhost:'+_0x168314[_0x68f4('0x32')][_0x68f4('0xa3')];var _0x5e5438=_0x168314[_0x68f4('0x32')][_0x68f4('0x23')]?_0x168314[_0x68f4('0x32')][_0x68f4('0x23')]:!![];var _0x3dfbe0=_0x168314['query'][_0x68f4('0xa6')]?_0x168314[_0x68f4('0x32')][_0x68f4('0xa6')]:null;var _0x357b3f={'method':_0x168314[_0x68f4('0xad')],'uri':util[_0x68f4('0x65')]('%s%s',_0x1cb68b,_0x168314[_0x68f4('0x32')][_0x68f4('0x8')]),'json':_0x5e5438,'resolveWithFullResponse':!![],'encoding':_0x3dfbe0,'body':_0x168314[_0x68f4('0x94')]};if(_0x168314[_0x68f4('0xa8')]){_0x357b3f['headers']=_0x168314[_0x68f4('0xa8')];if(_0x357b3f[_0x68f4('0xa8')][_0x68f4('0xa9')]){delete _0x357b3f['headers'][_0x68f4('0xa9')];}}return rp(_0x357b3f);})[_0x68f4('0x28')](function(_0xde5b0f){if(_0xde5b0f){_0x443556['set'](_0xde5b0f['headers']);logger[_0x68f4('0x68')](_0xde5b0f[_0x68f4('0x94')]);return _0x443556[_0x68f4('0x21')](_0xde5b0f[_0x68f4('0xab')])[_0x68f4('0x9c')](_0xde5b0f[_0x68f4('0x94')]);}else{return _0x443556[_0x68f4('0x20')](0xc8);}})['catch'](handleError(_0x443556,null));}; \ No newline at end of file +var _0xbbb7=['hostname','http://localhost:','port','json','encoding','%s%s','headers','content-length','set','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','method','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','archiver','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','reject','get','Plugins','UserProfileResource','destroy','then','stack','name','send','Plugin','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','key','field','merge','include','rows','catch','show','params','includeAll','options','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Sequelize','Error','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','scriptPath','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','body','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified'];(function(_0x3333bd,_0x1d34ec){var _0x4e0b62=function(_0x48d665){while(--_0x48d665){_0x3333bd['push'](_0x3333bd['shift']());}};_0x4e0b62(++_0x1d34ec);}(_0xbbb7,0x165));var _0x7bbb=function(_0x531066,_0x36a42a){_0x531066=_0x531066-0x0;var _0x16dfc8=_0xbbb7[_0x531066];return _0x16dfc8;};'use strict';var pdf=require(_0x7bbb('0x0'));var emlformat=require(_0x7bbb('0x1'));var rimraf=require(_0x7bbb('0x2'));var zipdir=require(_0x7bbb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bbb('0x4'));var moment=require(_0x7bbb('0x5'));var BPromise=require(_0x7bbb('0x6'));var Mustache=require(_0x7bbb('0x7'));var util=require('util');var path=require(_0x7bbb('0x8'));var sox=require(_0x7bbb('0x9'));var csv=require(_0x7bbb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7bbb('0xb'));var squel=require(_0x7bbb('0xc'));var crypto=require(_0x7bbb('0xd'));var jsforce=require(_0x7bbb('0xe'));var deskjs=require(_0x7bbb('0xf'));var toCsv=require(_0x7bbb('0xa'));var querystring=require(_0x7bbb('0x10'));var Papa=require(_0x7bbb('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x7bbb('0x12'));var Redis=require(_0x7bbb('0x13'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x7bbb('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x7bbb('0x15'))(_0x7bbb('0x16'));var utils=require(_0x7bbb('0x17'));var config=require(_0x7bbb('0x18'));var db=require(_0x7bbb('0x19'))['db'];config['redis']=_[_0x7bbb('0x1a')](config[_0x7bbb('0x1b')],{'host':_0x7bbb('0x1c'),'port':0x18eb});var socket=require(_0x7bbb('0x1d'))(new Redis(config[_0x7bbb('0x1b')]));require(_0x7bbb('0x1e'))[_0x7bbb('0x1f')](socket);function respondWithStatusCode(_0x46d794,_0x327fa1){_0x327fa1=_0x327fa1||0xcc;return function(_0x330484){if(_0x330484){return _0x46d794[_0x7bbb('0x20')](_0x327fa1);}return _0x46d794[_0x7bbb('0x21')](_0x327fa1)[_0x7bbb('0x22')]();};}function respondWithResult(_0x501db5,_0x59528b){_0x59528b=_0x59528b||0xc8;return function(_0x1f3421){if(_0x1f3421){return _0x501db5['status'](_0x59528b)['json'](_0x1f3421);}};}function respondWithFilteredResult(_0x33dee8,_0x43838a){return function(_0x5904e4){if(_0x5904e4){var _0x59d8b9=_0x5904e4[_0x7bbb('0x23')],_0x298d3f=_0x43838a[_0x7bbb('0x24')],_0x5480be=_0x43838a[_0x7bbb('0x24')]+_0x43838a[_0x7bbb('0x25')],_0x31f6bf;if(_0x5480be>=_0x59d8b9){_0x5480be=_0x59d8b9;_0x31f6bf=0xc8;}else{_0x31f6bf=0xce;}_0x33dee8[_0x7bbb('0x21')](_0x31f6bf);return _0x33dee8['set'](_0x7bbb('0x26'),_0x298d3f+'-'+_0x5480be+'/'+_0x59d8b9)['json'](_0x5904e4);}return null;};}function patchUpdates(_0xad2bf4){return function(_0x550341){try{jsonpatch['apply'](_0x550341,_0xad2bf4,!![]);}catch(_0x2ebb78){return BPromise[_0x7bbb('0x27')](_0x2ebb78);}return _0x550341['save']();};}function saveUpdates(_0x18cfbd,_0x57cce0){return function(_0x4302f2){if(_0x4302f2){return _0x4302f2['update'](_0x18cfbd)['then'](function(_0x5c524c){return _0x5c524c;});}return null;};}function removeEntity(_0x1fea4f,_0x2815cf){return function(_0x3d8da2){if(_0x3d8da2){return _0x3d8da2['destroy']()['then'](function(){var _0x43b49d=_0x3d8da2[_0x7bbb('0x28')]({'plain':!![]});var _0x441b84=_0x7bbb('0x29');return db[_0x7bbb('0x2a')][_0x7bbb('0x2b')]({'where':{'type':_0x441b84,'resourceId':_0x43b49d['id']}})[_0x7bbb('0x2c')](function(){return _0x3d8da2;});})['then'](function(){_0x1fea4f[_0x7bbb('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1401b0,_0x4674bb){return function(_0x593138){if(!_0x593138){_0x1401b0[_0x7bbb('0x20')](0x194);}return _0x593138;};}function handleError(_0x54c44e,_0x3d6325){_0x3d6325=_0x3d6325||0x1f4;return function(_0x1b833e){logger['error'](_0x1b833e[_0x7bbb('0x2d')]);if(_0x1b833e[_0x7bbb('0x2e')]){delete _0x1b833e[_0x7bbb('0x2e')];}_0x54c44e[_0x7bbb('0x21')](_0x3d6325)[_0x7bbb('0x2f')](_0x1b833e);};}exports['index']=function(_0x18f152,_0x30edb7){var _0x4e811b={},_0x342cd8={},_0x19e4ce={'count':0x0,'rows':[]};var _0x13e055=db[_0x7bbb('0x30')][_0x7bbb('0x31')];_0x342cd8[_0x7bbb('0x32')]=_[_0x7bbb('0x33')](_0x13e055);_0x342cd8['query']=_[_0x7bbb('0x33')](_0x18f152[_0x7bbb('0x34')]);_0x342cd8[_0x7bbb('0x35')]=_[_0x7bbb('0x36')](_0x342cd8[_0x7bbb('0x32')],_0x342cd8[_0x7bbb('0x34')]);_0x4e811b[_0x7bbb('0x37')]=_['intersection'](_0x342cd8[_0x7bbb('0x32')],qs['fields'](_0x18f152['query'][_0x7bbb('0x38')]));_0x4e811b[_0x7bbb('0x37')]=_0x4e811b[_0x7bbb('0x37')][_0x7bbb('0x39')]?_0x4e811b[_0x7bbb('0x37')]:_0x342cd8[_0x7bbb('0x32')];if(!_0x18f152['query'][_0x7bbb('0x3a')](_0x7bbb('0x3b'))){_0x4e811b[_0x7bbb('0x25')]=qs['limit'](_0x18f152[_0x7bbb('0x34')][_0x7bbb('0x25')]);_0x4e811b[_0x7bbb('0x24')]=qs['offset'](_0x18f152[_0x7bbb('0x34')][_0x7bbb('0x24')]);}_0x4e811b['order']=qs[_0x7bbb('0x3c')](_0x18f152['query']['sort']);_0x4e811b[_0x7bbb('0x3d')]=qs[_0x7bbb('0x35')](_[_0x7bbb('0x3e')](_0x18f152[_0x7bbb('0x34')],_0x342cd8[_0x7bbb('0x35')]));if(_0x18f152['query'][_0x7bbb('0x3f')]){_0x4e811b[_0x7bbb('0x3d')]=_['merge'](_0x4e811b[_0x7bbb('0x3d')],{'$or':_['map'](_0x13e055,function(_0x4a4d9d){if(_0x4a4d9d[_0x7bbb('0x40')][_0x7bbb('0x41')]!=='VIRTUAL'){var _0x5ab6ce={};_0x5ab6ce[_0x4a4d9d[_0x7bbb('0x42')]]={'$like':'%'+_0x18f152['query']['filter']+'%'};return _0x5ab6ce;}})});}_0x4e811b=_[_0x7bbb('0x43')]({},_0x4e811b,_0x18f152['options']);var _0x35dd41={'where':_0x4e811b['where']};return db[_0x7bbb('0x30')][_0x7bbb('0x23')](_0x35dd41)[_0x7bbb('0x2c')](function(_0x1c2295){_0x19e4ce['count']=_0x1c2295;if(_0x18f152[_0x7bbb('0x34')]['includeAll']){_0x4e811b[_0x7bbb('0x44')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x4e811b);})[_0x7bbb('0x2c')](function(_0x5235a1){_0x19e4ce[_0x7bbb('0x45')]=_0x5235a1;return _0x19e4ce;})[_0x7bbb('0x2c')](respondWithFilteredResult(_0x30edb7,_0x4e811b))[_0x7bbb('0x46')](handleError(_0x30edb7,null));};exports[_0x7bbb('0x47')]=function(_0x159807,_0x6594f7){var _0x242832={'raw':!![],'where':{'id':_0x159807[_0x7bbb('0x48')]['id']}},_0x347d01={};_0x347d01['model']=_[_0x7bbb('0x33')](db[_0x7bbb('0x30')][_0x7bbb('0x31')]);_0x347d01[_0x7bbb('0x34')]=_['keys'](_0x159807['query']);_0x347d01[_0x7bbb('0x35')]=_[_0x7bbb('0x36')](_0x347d01[_0x7bbb('0x32')],_0x347d01[_0x7bbb('0x34')]);_0x242832['attributes']=_[_0x7bbb('0x36')](_0x347d01['model'],qs['fields'](_0x159807['query'][_0x7bbb('0x38')]));_0x242832[_0x7bbb('0x37')]=_0x242832[_0x7bbb('0x37')]['length']?_0x242832[_0x7bbb('0x37')]:_0x347d01['model'];if(_0x159807[_0x7bbb('0x34')][_0x7bbb('0x49')]){_0x242832[_0x7bbb('0x44')]=[{'all':!![]}];}_0x242832=_[_0x7bbb('0x43')]({},_0x242832,_0x159807[_0x7bbb('0x4a')]);return db[_0x7bbb('0x30')][_0x7bbb('0x4b')](_0x242832)[_0x7bbb('0x2c')](handleEntityNotFound(_0x6594f7,null))[_0x7bbb('0x2c')](respondWithResult(_0x6594f7,null))['catch'](handleError(_0x6594f7,null));};exports[_0x7bbb('0x4c')]=function(_0x5ac567,_0x1bb370,_0x5d4f20){return db[_0x7bbb('0x30')][_0x7bbb('0x4b')]({'where':{'id':_0x5ac567['params']['id']},'attributes':[_0x7bbb('0x2e'),_0x7bbb('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x1bb370,null))[_0x7bbb('0x2c')](function(_0x23479d){if(_0x23479d){var _0x1e26ba=path[_0x7bbb('0x4d')](config[_0x7bbb('0x4e')],_0x7bbb('0x4f'),util[_0x7bbb('0x50')](_0x7bbb('0x51'),path['basename'](_0x23479d[_0x7bbb('0x8')])));var _0x30908d=fs[_0x7bbb('0x52')](_0x1e26ba);var _0x142239=archiver('zip',{'zlib':{'level':0x9}});_0x142239['on'](_0x7bbb('0x53'),function(_0x490b59){if(_0x490b59[_0x7bbb('0x54')]===_0x7bbb('0x55')){logger['error'](_0x490b59);}else{throw new db['Sequelize']['Error'](_0x7bbb('0x56'));}});_0x142239['on'](_0x7bbb('0x57'),function(_0x5197b8){throw new db[(_0x7bbb('0x58'))][(_0x7bbb('0x59'))](_0x7bbb('0x56'));});_0x142239[_0x7bbb('0x5a')](_0x30908d);_0x142239[_0x7bbb('0x5b')](_0x7bbb('0x5c'),{'cwd':path[_0x7bbb('0x4d')](config[_0x7bbb('0x4e')],_0x7bbb('0x4f'),path[_0x7bbb('0x5d')](_0x23479d[_0x7bbb('0x8')])),'ignore':[path[_0x7bbb('0x4d')](path[_0x7bbb('0x5e')](_0x23479d[_0x7bbb('0x8')]),_0x7bbb('0x5f')),path['join'](path[_0x7bbb('0x5e')](_0x23479d[_0x7bbb('0x8')]),_0x7bbb('0x60'))],'nodir':!![]})[_0x7bbb('0x61')]();_0x30908d['on'](_0x7bbb('0x62'),function(){if(!fs['existsSync'](_0x1e26ba)){throw new db[(_0x7bbb('0x58'))][(_0x7bbb('0x59'))](_0x7bbb('0x63'));}return _0x1bb370[_0x7bbb('0x4c')](_0x1e26ba,util[_0x7bbb('0x50')](_0x7bbb('0x51'),path[_0x7bbb('0x5e')](_0x23479d[_0x7bbb('0x8')])),function(_0x3490e4){if(_0x3490e4){throw new db[(_0x7bbb('0x58'))]['Error'](_0x7bbb('0x64'));}fs[_0x7bbb('0x65')](_0x1e26ba);logger[_0x7bbb('0x66')](_0x7bbb('0x67'));logger[_0x7bbb('0x66')](_0x7bbb('0x68'));});});}return null;})[_0x7bbb('0x46')](handleError(_0x1bb370,null));};exports[_0x7bbb('0x69')]=function(_0x1f6cdc,_0x3d5310,_0x113169){var _0x410d82=path['basename'](_0x1f6cdc[_0x7bbb('0x6a')][_0x7bbb('0x6b')],path['extname'](_0x1f6cdc[_0x7bbb('0x6a')][_0x7bbb('0x6b')]));var _0x5d9128=path[_0x7bbb('0x4d')](config[_0x7bbb('0x4e')],_0x7bbb('0x4f'),_0x1f6cdc[_0x7bbb('0x6a')][_0x7bbb('0x6b')]);var _0x5bc408=path[_0x7bbb('0x4d')](config[_0x7bbb('0x4e')],_0x7bbb('0x4f'),_0x410d82);logger['info'](_0x7bbb('0x6c'),_0x5d9128);logger['info'](_0x7bbb('0x6d'),_0x5bc408);try{fs[_0x7bbb('0x6e')](_0x5d9128,parseInt(_0x7bbb('0x6f'),0x8));extract(_0x5d9128,{'dir':_0x5bc408},function(_0x56487c){if(_0x56487c){logger[_0x7bbb('0x57')](_0x56487c);handleError(_0x56487c,!![]);};var _0x53a717=fs['readdirSync'](_0x5bc408);if(_0x53a717[_0x7bbb('0x39')]>0x1){removeReferences(_0x5d9128,_0x5bc408);logger['error'](_0x7bbb('0x70'));return _0x113169(new Error(_0x7bbb('0x70')));}var _0x554361=fs[_0x7bbb('0x71')](path['join'](_0x5bc408,_0x53a717[0x0]));if(_0x554361['isFile']()){removeReferences(_0x5d9128,_0x5bc408);logger['error'](_0x7bbb('0x70'));return _0x113169(new Error('Invalid\x20plugin\x20structure'));}if(_0x554361[_0x7bbb('0x72')]()){var _0x23c3eb=fs[_0x7bbb('0x73')](path[_0x7bbb('0x4d')](_0x5bc408,_0x53a717[0x0]));if(_0x23c3eb[_0x7bbb('0x39')]===0x0){removeReferences(_0x5d9128,_0x5bc408);logger[_0x7bbb('0x57')](_0x7bbb('0x70'));return _0x113169(new Error('Invalid\x20plugin\x20structure'));}var _0x316cb0=_0x23c3eb[_0x7bbb('0x74')](function(_0x3e8ab7){return _0x3e8ab7===_0x7bbb('0x75');});if(!_0x316cb0){return _0x113169(new Error('Plugin\x20manifest\x20missing'));}var _0x5eb68f=fs[_0x7bbb('0x76')](path[_0x7bbb('0x4d')](_0x5bc408,_0x53a717[0x0],_0x7bbb('0x75')));var _0x215f34=JSON[_0x7bbb('0x77')](_0x5eb68f);if('undefined'==typeof _0x215f34[_0x7bbb('0x2e')]){return _0x113169(new Error(_0x7bbb('0x78')));}if(_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x40')]){return _0x113169(new Error(_0x7bbb('0x7a')));}if(_0x7bbb('0x79')==typeof _0x215f34['version']){return _0x113169(new Error(_0x7bbb('0x7b')));}if(_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x7c')]){return _0x113169(new Error(_0x7bbb('0x7d')));}if(_0x215f34[_0x7bbb('0x40')]===_0x7bbb('0x7e')){if(_0x7bbb('0x79')==typeof _0x215f34['parameters'][_0x7bbb('0x7f')]){return _0x113169(new Error(_0x7bbb('0x80')));}if(_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')][_0x7bbb('0x81')]&&_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')][_0x7bbb('0x82')]){return _0x113169(new Error(_0x7bbb('0x83')));}}else if(_0x215f34[_0x7bbb('0x40')]===_0x7bbb('0x84')){if(_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x85')]){return _0x113169(new Error(_0x7bbb('0x86')));}if(_0x7bbb('0x79')==typeof _0x215f34[_0x7bbb('0x7c')]['scriptPath']){return _0x113169(new Error(_0x7bbb('0x87')));}}else{return _0x113169(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3770ea=_0x215f34[_0x7bbb('0x2e')];var _0x1e0e88=_0x215f34['description'];var _0x443053=_0x215f34[_0x7bbb('0x40')];var _0x23fc6d=_0x215f34['sidebar']?_0x215f34[_0x7bbb('0x88')]:_0x7bbb('0x89');var _0x399445=_0x215f34[_0x7bbb('0x8a')]?_0x215f34[_0x7bbb('0x8a')]:_0x7bbb('0x8b');var _0x22607b='';var _0x11cc68='';var _0x329e0f='';var _0x1ed625='';var _0x2efae6=_0x215f34[_0x7bbb('0x8c')];if(_0x443053===_0x7bbb('0x7e')){if('undefined'!=typeof _0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')][_0x7bbb('0x81')]){var _0xd2e399=_0x215f34['parameters'][_0x7bbb('0x7f')][_0x7bbb('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x7bbb('0x8d')](_0xd2e399)){_0x22607b=path[_0x7bbb('0x4d')]('plugins',_0x410d82,_0x53a717[0x0],_0xd2e399);}else{_0x22607b=_0xd2e399;}}else{logger['info'](_0x7bbb('0x8e'));}if(_0x7bbb('0x79')!=typeof _0x215f34['parameters'][_0x7bbb('0x7f')][_0x7bbb('0x82')]){var _0x51c422=_0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')][_0x7bbb('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x51c422)){_0x11cc68=path['join'](_0x7bbb('0x8f'),_0x410d82,_0x53a717[0x0],_0x51c422);}else{_0x11cc68=_0x51c422;}}else{logger[_0x7bbb('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x443053==='script'){_0x329e0f=_0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x85')];_0x1ed625=_0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x90')];if(_0x7bbb('0x79')!=typeof _0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')]){if(_0x7bbb('0x79')!=typeof _0x215f34['parameters']['views'][_0x7bbb('0x81')]){var _0xd2e399=_0x215f34[_0x7bbb('0x7c')][_0x7bbb('0x7f')][_0x7bbb('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0xd2e399)){_0x22607b=path[_0x7bbb('0x4d')](_0x7bbb('0x8f'),_0x410d82,_0x53a717[0x0],_0xd2e399);}else{_0x22607b=_0xd2e399;}}if(_0x7bbb('0x79')!=typeof _0x215f34[_0x7bbb('0x7c')]['views'][_0x7bbb('0x82')]){var _0x51c422=_0x215f34['parameters'][_0x7bbb('0x7f')][_0x7bbb('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x51c422)){_0x11cc68=path[_0x7bbb('0x4d')](_0x7bbb('0x8f'),_0x410d82,_0x53a717[0x0],_0x51c422);}else{_0x11cc68=_0x51c422;}}}}var _0x2bcba1={'name':_0x3770ea,'description':_0x1e0e88,'path':path[_0x7bbb('0x4d')](_0x410d82,_0x53a717[0x0]),'type':_0x443053,'sidebar':_0x23fc6d,'icon':_0x399445,'adminUrl':_0x22607b,'agentUrl':_0x11cc68,'scriptName':_0x329e0f,'scriptPath':_0x1ed625,'version':_0x2efae6};removeReferences(_0x5d9128,null);return db['Plugin'][_0x7bbb('0x91')](_0x2bcba1)[_0x7bbb('0x2c')](function(_0x5b6689){var _0x2aa08b={'role':_0x1f6cdc['body'][_0x7bbb('0x92')],'userProfileId':_0x1f6cdc['body'][_0x7bbb('0x93')]};if(!_0x2aa08b)throw new Error(_0x7bbb('0x94'));if(_0x2aa08b[_0x7bbb('0x92')]===_0x7bbb('0x95')){var _0x4d272=_0x5b6689[_0x7bbb('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x7bbb('0x4b')]({'where':{'name':_0x7bbb('0x29'),'userProfileId':_0x2aa08b[_0x7bbb('0x93')]},'raw':!![]})[_0x7bbb('0x2c')](function(_0x4e8560){if(_0x4e8560&&_0x4e8560[_0x7bbb('0x96')]===0x0){return db[_0x7bbb('0x2a')][_0x7bbb('0x91')]({'name':_0x4d272['name'],'resourceId':_0x4d272['id'],'type':_0x4e8560[_0x7bbb('0x2e')],'sectionId':_0x4e8560['id']},{})[_0x7bbb('0x2c')](function(){return _0x5b6689;});}else{return _0x5b6689;}})['catch'](function(_0x23787f){logger[_0x7bbb('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23787f);throw _0x23787f;});}return _0x5b6689;})[_0x7bbb('0x2c')](respondWithResult(_0x3d5310,null))[_0x7bbb('0x46')](handleError(_0x3d5310,null));}});}catch(_0x3f1ea2){_0x3d5310[_0x7bbb('0x21')](0x1f4)[_0x7bbb('0x2f')](_0x3f1ea2);}};function removeReferences(_0x2d33e3,_0x517989){try{if(_0x2d33e3){fs[_0x7bbb('0x65')](_0x2d33e3);logger['info'](_0x7bbb('0x97'));}if(_0x517989){rimraf(_0x517989,function(){});logger['info'](_0x7bbb('0x98'));}}catch(_0x350a4b){logger[_0x7bbb('0x57')](_0x350a4b);}}exports[_0x7bbb('0x99')]=function(_0x360594,_0xbadebf,_0x394f0d){return db[_0x7bbb('0x30')][_0x7bbb('0x4b')]({'where':{'id':_0x360594[_0x7bbb('0x48')]['id']}})['then'](handleEntityNotFound(_0xbadebf,null))[_0x7bbb('0x2c')](saveUpdates(_0x360594[_0x7bbb('0x9a')],null))['then'](respondWithResult(_0xbadebf,null))['catch'](handleError(_0xbadebf,null));};exports[_0x7bbb('0x9b')]=function(_0x379d15,_0x33da4e,_0x4cd773){return db[_0x7bbb('0x30')]['find']({'where':{'id':_0x379d15['params']['id']}})['then'](function(_0x37b58c){if(_0x37b58c){return _0x37b58c[_0x7bbb('0x2b')]();}})['then'](function(_0x2fda97){rimraf(path[_0x7bbb('0x4d')](config[_0x7bbb('0x4e')],_0x7bbb('0x4f'),path[_0x7bbb('0x5d')](_0x2fda97['path'])),function(){});return _0x2fda97;})[_0x7bbb('0x2c')](handleEntityNotFound(_0x33da4e,null))[_0x7bbb('0x2c')](respondWithStatusCode(_0x33da4e,null))['catch'](handleError(_0x33da4e,null));};exports[_0x7bbb('0x9c')]=function(_0x27117f,_0x327730,_0x2b06e0){return BPromise[_0x7bbb('0x9d')]()[_0x7bbb('0x2c')](function(){if(!_0x27117f[_0x7bbb('0x34')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x27117f[_0x7bbb('0x34')]['port']){throw new Error(_0x7bbb('0x9e'));}var _0x4301ff=_0x27117f[_0x7bbb('0x34')][_0x7bbb('0x9f')]?_0x27117f[_0x7bbb('0x34')][_0x7bbb('0x9f')]+':'+_0x27117f[_0x7bbb('0x34')]['port']:_0x7bbb('0xa0')+_0x27117f['query'][_0x7bbb('0xa1')];var _0xcfc1d6=_0x27117f[_0x7bbb('0x34')][_0x7bbb('0xa2')]?_0x27117f[_0x7bbb('0x34')][_0x7bbb('0xa2')]:!![];var _0x795a8d=_0x27117f[_0x7bbb('0x34')]['encoding']?_0x27117f[_0x7bbb('0x34')][_0x7bbb('0xa3')]:null;var _0x11bb52={'method':_0x27117f['method'],'uri':util['format'](_0x7bbb('0xa4'),_0x4301ff,_0x27117f[_0x7bbb('0x34')][_0x7bbb('0x8')]),'json':_0xcfc1d6,'resolveWithFullResponse':!![],'encoding':_0x795a8d,'qs':_0x27117f['query']};if(_0x27117f['headers']){_0x11bb52[_0x7bbb('0xa5')]=_0x27117f[_0x7bbb('0xa5')];if(_0x11bb52[_0x7bbb('0xa5')][_0x7bbb('0xa6')]){delete _0x11bb52[_0x7bbb('0xa5')][_0x7bbb('0xa6')];}}return rp(_0x11bb52);})[_0x7bbb('0x2c')](function(_0x387192){if(_0x387192){_0x327730[_0x7bbb('0xa7')](_0x387192['headers']);logger[_0x7bbb('0x66')](_0x387192[_0x7bbb('0x9a')]);if(_[_0x7bbb('0xa8')](_0x27117f[_0x7bbb('0x34')][_0x7bbb('0x8')],_0x7bbb('0x4c'))&&_0x387192['statusCode']==0x1f4){return _0x327730['sendStatus'](_0x387192[_0x7bbb('0xa9')]);}else{return _0x327730[_0x7bbb('0x21')](_0x387192[_0x7bbb('0xa9')])[_0x7bbb('0x2f')](_0x387192[_0x7bbb('0x9a')]);}}else{return _0x327730['sendStatus'](0xc8);}})['catch'](handleError(_0x327730,null));};exports['webhookPost']=function(_0x5f4869,_0x2c3c43,_0x2b41e2){return BPromise['resolve']()[_0x7bbb('0x2c')](function(){if(!_0x5f4869['query'][_0x7bbb('0x8')]){throw new Error(_0x7bbb('0xaa'));}if(!_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa1')]){throw new Error(_0x7bbb('0x9e'));}var _0x4e6cfb=_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0x9f')]?_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0x9f')]+':'+_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa1')]:_0x7bbb('0xa0')+_0x5f4869[_0x7bbb('0x34')]['port'];var _0x2b4d1c=_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa2')]?_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa2')]:!![];var _0xe3eaf9=_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa3')]?_0x5f4869[_0x7bbb('0x34')][_0x7bbb('0xa3')]:null;var _0x2f20e2={'method':_0x5f4869[_0x7bbb('0xab')],'uri':util[_0x7bbb('0x50')](_0x7bbb('0xa4'),_0x4e6cfb,_0x5f4869['query'][_0x7bbb('0x8')]),'json':_0x2b4d1c,'resolveWithFullResponse':!![],'encoding':_0xe3eaf9,'body':_0x5f4869[_0x7bbb('0x9a')]};if(_0x5f4869[_0x7bbb('0xa5')]){_0x2f20e2[_0x7bbb('0xa5')]=_0x5f4869[_0x7bbb('0xa5')];if(_0x2f20e2[_0x7bbb('0xa5')][_0x7bbb('0xa6')]){delete _0x2f20e2[_0x7bbb('0xa5')][_0x7bbb('0xa6')];}}return rp(_0x2f20e2);})[_0x7bbb('0x2c')](function(_0x265b60){if(_0x265b60){_0x2c3c43[_0x7bbb('0xa7')](_0x265b60['headers']);logger[_0x7bbb('0x66')](_0x265b60[_0x7bbb('0x9a')]);return _0x2c3c43[_0x7bbb('0x21')](_0x265b60[_0x7bbb('0xa9')])[_0x7bbb('0x2f')](_0x265b60['body']);}else{return _0x2c3c43['sendStatus'](0xc8);}})[_0x7bbb('0x46')](handleError(_0x2c3c43,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c57028c..e74d4c9 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 _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x5b3311,_0x4fa431){var _0x12c9dd=function(_0x3f72a7){while(--_0x3f72a7){_0x5b3311['push'](_0x5b3311['shift']());}};_0x12c9dd(++_0x4fa431);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f530d,_0x18a19e){_0x1f530d=_0x1f530d-0x0;var _0x22103f=_0xb10b[_0x1f530d];return _0x22103f;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x59e045,_0x34d4e4){var _0x48ac61=function(_0x1468ee){while(--_0x1468ee){_0x59e045['push'](_0x59e045['shift']());}};_0x48ac61(++_0x34d4e4);}(_0x7a54,0x106));var _0x47a5=function(_0x47beb6,_0x88fa40){_0x47beb6=_0x47beb6-0x0;var _0x4abe71=_0x7a54[_0x47beb6];return _0x4abe71;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var Plugin=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){PluginEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);PluginEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 2e1b5fe..5a4b81e 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 _0x64d3=['Plugin','plugins','lodash','util','moment','bluebird','request-promise','exports','define'];(function(_0x53e7fe,_0xcc1f5){var _0x51ee13=function(_0x72e675){while(--_0x72e675){_0x53e7fe['push'](_0x53e7fe['shift']());}};_0x51ee13(++_0xcc1f5);}(_0x64d3,0x16a));var _0x364d=function(_0x1c69b3,_0x5abb7f){_0x1c69b3=_0x1c69b3-0x0;var _0x3ebfb0=_0x64d3[_0x1c69b3];return _0x3ebfb0;};'use strict';var _=require(_0x364d('0x0'));var util=require(_0x364d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x364d('0x2'));var BPromise=require(_0x364d('0x3'));var rp=require(_0x364d('0x4'));var attributes=require('./plugin.attributes');module[_0x364d('0x5')]=function(_0x575bec,_0x5ce060){return _0x575bec[_0x364d('0x6')](_0x364d('0x7'),attributes,{'tableName':_0x364d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02ae=['util','../../config/logger','moment','bluebird','request-promise','./plugin.attributes','Plugin','plugins','lodash'];(function(_0x3d3411,_0x258151){var _0x5cba07=function(_0x1b7848){while(--_0x1b7848){_0x3d3411['push'](_0x3d3411['shift']());}};_0x5cba07(++_0x258151);}(_0x02ae,0x10d));var _0xe02a=function(_0x26899f,_0x3f7a00){_0x26899f=_0x26899f-0x0;var _0x29cecb=_0x02ae[_0x26899f];return _0x29cecb;};'use strict';var _=require(_0xe02a('0x0'));var util=require(_0xe02a('0x1'));var logger=require(_0xe02a('0x2'))('api');var moment=require(_0xe02a('0x3'));var BPromise=require(_0xe02a('0x4'));var rp=require(_0xe02a('0x5'));var attributes=require(_0xe02a('0x6'));module['exports']=function(_0x370c23,_0x34664a){return _0x370c23['define'](_0xe02a('0x7'),attributes,{'tableName':_0xe02a('0x8'),'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 8aaa7e9..30c9c7b 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 _0x744e=['redis','defaults','socket.io-emitter','./plugin.socket','register','request','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','info','result','body','options','raw','catch','CreatePlugin','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x744e,0xf5));var _0xe744=function(_0x56a8f1,_0xa987d6){_0x56a8f1=_0x56a8f1-0x0;var _0x34490e=_0x744e[_0x56a8f1];return _0x34490e;};'use strict';var _=require(_0xe744('0x0'));var util=require(_0xe744('0x1'));var moment=require('moment');var BPromise=require(_0xe744('0x2'));var rs=require(_0xe744('0x3'));var fs=require('fs');var Redis=require(_0xe744('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe744('0x5'))(_0xe744('0x6'));var config=require(_0xe744('0x7'));var jayson=require(_0xe744('0x8'));var client=jayson[_0xe744('0x9')][_0xe744('0xa')]({'port':0x232a});config[_0xe744('0xb')]=_[_0xe744('0xc')](config[_0xe744('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe744('0xd'))(new Redis(config[_0xe744('0xb')]));require(_0xe744('0xe'))[_0xe744('0xf')](socket);function respondWithRpcPromise(_0x4b7113,_0x2b083e,_0x3acc47){return new BPromise(function(_0xbdb77b,_0x5dcf71){return client[_0xe744('0x10')](_0x4b7113,_0x3acc47)['then'](function(_0x133a2b){logger['info']('Plugin,\x20%s,\x20%s',_0x2b083e,_0xe744('0x11'));logger[_0xe744('0x12')](_0xe744('0x13'),_0x2b083e,'request\x20sent',JSON[_0xe744('0x14')](_0x133a2b));if(_0x133a2b['error']){if(_0x133a2b[_0xe744('0x15')][_0xe744('0x16')]===0x1f4){logger['error'](_0xe744('0x17'),_0x2b083e,_0x133a2b[_0xe744('0x15')][_0xe744('0x18')]);return _0x5dcf71(_0x133a2b['error'][_0xe744('0x18')]);}logger[_0xe744('0x15')](_0xe744('0x17'),_0x2b083e,_0x133a2b['error'][_0xe744('0x18')]);return _0xbdb77b(_0x133a2b[_0xe744('0x15')]['message']);}else{logger[_0xe744('0x19')](_0xe744('0x17'),_0x2b083e,_0xe744('0x11'));_0xbdb77b(_0x133a2b[_0xe744('0x1a')][_0xe744('0x18')]);}})['catch'](function(_0x42b543){logger['error']('Plugin,\x20%s,\x20%s',_0x2b083e,_0x42b543);_0x5dcf71(_0x42b543);});});}exports['CreatePlugin']=function(_0x3a4dd7){var _0x364cf1=this;return new Promise(function(_0x3184b0,_0x346081){return db['Plugin']['create'](_0x3a4dd7[_0xe744('0x1b')],{'raw':_0x3a4dd7[_0xe744('0x1c')]?_0x3a4dd7['options'][_0xe744('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xb0c806){logger[_0xe744('0x19')]('CreatePlugin',_0x3a4dd7);logger[_0xe744('0x12')]('CreatePlugin',_0x3a4dd7,JSON['stringify'](_0xb0c806));_0x3184b0(_0xb0c806);})[_0xe744('0x1e')](function(_0x391977){logger[_0xe744('0x15')](_0xe744('0x1f'),_0x391977['message'],_0x3a4dd7);_0x346081(_0x364cf1['error'](0x1f4,_0x391977['message']));});});}; \ No newline at end of file +var _0xc064=['debug','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','client','http','redis','defaults','localhost','register','request','then','info','Plugin,\x20%s,\x20%s'];(function(_0xc9b950,_0x8d1861){var _0x26cc49=function(_0x282e1b){while(--_0x282e1b){_0xc9b950['push'](_0xc9b950['shift']());}};_0x26cc49(++_0x8d1861);}(_0xc064,0x82));var _0x4c06=function(_0x462c6f,_0x5df4c5){_0x462c6f=_0x462c6f-0x0;var _0x36a802=_0xc064[_0x462c6f];return _0x36a802;};'use strict';var _=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var moment=require(_0x4c06('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c06('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c06('0x5')][_0x4c06('0x6')]({'port':0x232a});config[_0x4c06('0x7')]=_[_0x4c06('0x8')](config[_0x4c06('0x7')],{'host':_0x4c06('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c06('0x7')]));require('./plugin.socket')[_0x4c06('0xa')](socket);function respondWithRpcPromise(_0x193117,_0x510ba2,_0x50324c){return new BPromise(function(_0x27906a,_0x450236){return client[_0x4c06('0xb')](_0x193117,_0x50324c)[_0x4c06('0xc')](function(_0xa7c300){logger[_0x4c06('0xd')](_0x4c06('0xe'),_0x510ba2,'request\x20sent');logger[_0x4c06('0xf')]('Plugin,\x20%s,\x20%s,\x20%s',_0x510ba2,_0x4c06('0x10'),JSON[_0x4c06('0x11')](_0xa7c300));if(_0xa7c300[_0x4c06('0x12')]){if(_0xa7c300['error'][_0x4c06('0x13')]===0x1f4){logger[_0x4c06('0x12')](_0x4c06('0xe'),_0x510ba2,_0xa7c300['error'][_0x4c06('0x14')]);return _0x450236(_0xa7c300[_0x4c06('0x12')][_0x4c06('0x14')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x510ba2,_0xa7c300[_0x4c06('0x12')][_0x4c06('0x14')]);return _0x27906a(_0xa7c300['error'][_0x4c06('0x14')]);}else{logger[_0x4c06('0xd')](_0x4c06('0xe'),_0x510ba2,_0x4c06('0x10'));_0x27906a(_0xa7c300[_0x4c06('0x15')]['message']);}})[_0x4c06('0x16')](function(_0x4dfc11){logger[_0x4c06('0x12')](_0x4c06('0xe'),_0x510ba2,_0x4dfc11);_0x450236(_0x4dfc11);});});}exports[_0x4c06('0x17')]=function(_0x56946f){var _0x35be50=this;return new Promise(function(_0x2790f2,_0x293f9d){return db[_0x4c06('0x18')][_0x4c06('0x19')](_0x56946f[_0x4c06('0x1a')],{'raw':_0x56946f[_0x4c06('0x1b')]?_0x56946f[_0x4c06('0x1b')][_0x4c06('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x568d37){logger[_0x4c06('0xd')](_0x4c06('0x17'),_0x56946f);logger['debug'](_0x4c06('0x17'),_0x56946f,JSON[_0x4c06('0x11')](_0x568d37));_0x2790f2(_0x568d37);})[_0x4c06('0x16')](function(_0x149fc9){logger[_0x4c06('0x12')](_0x4c06('0x17'),_0x149fc9[_0x4c06('0x14')],_0x56946f);_0x293f9d(_0x35be50[_0x4c06('0x12')](0x1f4,_0x149fc9[_0x4c06('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 8c05092..87383c6 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 _0x568e=['register','length','./plugin.events','save','remove','emit','removeListener'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x568e,0xb1));var _0xe568=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x568e[_0x2d7f0e];return _0x110b07;};'use strict';var PluginEvents=require(_0xe568('0x0'));var events=[_0xe568('0x1'),_0xe568('0x2'),'update'];function createListener(_0x5c4277,_0x5e5e6a){return function(_0x2f1007){_0x5e5e6a[_0xe568('0x3')](_0x5c4277,_0x2f1007);};}function removeListener(_0x5602c7,_0xb34758){return function(){PluginEvents[_0xe568('0x4')](_0x5602c7,_0xb34758);};}exports[_0xe568('0x5')]=function(_0x2c798e){for(var _0x4cbf58=0x0,_0x1bc66e=events[_0xe568('0x6')];_0x4cbf58<_0x1bc66e;_0x4cbf58++){var _0x708bd0=events[_0x4cbf58];var _0x39d6a0=createListener('plugin:'+_0x708bd0,_0x2c798e);PluginEvents['on'](_0x708bd0,_0x39d6a0);}}; \ No newline at end of file +var _0x980d=['./plugin.events','save','remove','update','emit','removeListener','register','plugin:'];(function(_0x5f1fd6,_0x13fca4){var _0x4c48ca=function(_0x4b1de8){while(--_0x4b1de8){_0x5f1fd6['push'](_0x5f1fd6['shift']());}};_0x4c48ca(++_0x13fca4);}(_0x980d,0x148));var _0xd980=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x980d[_0x1a3e23];return _0x5ee0d8;};'use strict';var PluginEvents=require(_0xd980('0x0'));var events=[_0xd980('0x1'),_0xd980('0x2'),_0xd980('0x3')];function createListener(_0x2cbdbf,_0x1eba60){return function(_0x518b19){_0x1eba60[_0xd980('0x4')](_0x2cbdbf,_0x518b19);};}function removeListener(_0x59ae0d,_0x19bad3){return function(){PluginEvents[_0xd980('0x5')](_0x59ae0d,_0x19bad3);};}exports[_0xd980('0x6')]=function(_0x48983f){for(var _0x2d0339=0x0,_0x4bb77c=events['length'];_0x2d0339<_0x4bb77c;_0x2d0339++){var _0x61a470=events[_0x2d0339];var _0x8c061b=createListener(_0xd980('0x7')+_0x61a470,_0x48983f);PluginEvents['on'](_0x61a470,_0x8c061b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7bb2ca9..3c1d70f 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(_0x1fa09d,_0x3fbf3b){var _0x46da3c=function(_0x31bdcb){while(--_0x31bdcb){_0x1fa09d['push'](_0x1fa09d['shift']());}};_0x46da3c(++_0x3fbf3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x27dca4,_0x4605dd){var _0x66fb67=function(_0x5f3f79){while(--_0x5f3f79){_0x27dca4['push'](_0x27dca4['shift']());}};_0x66fb67(++_0x4605dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 4e62edc..7e17edb 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 _0x531f=['api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','list','then','express','motion2','length','show','describe','params','catch','create','join','../../files/plugins','body','script','dirname','chdir','start','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash'];(function(_0x3beba4,_0x2baf54){var _0x1d1668=function(_0x4972a4){while(--_0x4972a4){_0x3beba4['push'](_0x3beba4['shift']());}};_0x1d1668(++_0x2baf54);}(_0x531f,0x137));var _0xf531=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0x531f[_0x134d5e];return _0x1e166a;};'use strict';var _=require(_0xf531('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xf531('0x1'));var path=require(_0xf531('0x2'));var exec=require(_0xf531('0x3'))[_0xf531('0x4')];var BPromise=require(_0xf531('0x5'));function handleEntityNotFound(_0x573d85,_0x159ca1){return function(_0x5aaebb){if(!_0x5aaebb){_0x573d85[_0xf531('0x6')](0x194);;}return _0x5aaebb;};}function respondWithResult(_0x1263fc,_0x1a3dc0){_0x1a3dc0=_0x1a3dc0||0xc8;return function(_0x1f5bdc){if(_0x1f5bdc){return _0x1263fc[_0xf531('0x7')](_0x1a3dc0)[_0xf531('0x8')](_0x1f5bdc);}return null;};}function handleError(_0x49dd80,_0x59a127){_0x59a127=_0x59a127||0x1f4;return function(_0x2dd558){logger[_0xf531('0x9')](_0x2dd558[_0xf531('0xa')]);if(_0x2dd558[_0xf531('0xb')]){delete _0x2dd558[_0xf531('0xb')];}_0x49dd80[_0xf531('0x7')](_0x59a127)[_0xf531('0xc')](_0x2dd558);};}function execChildProcess(){return new BPromise(function(_0xc67839,_0x3c12a9){exec(_0xf531('0xd'),function(_0x58d60e,_0x2f67ea,_0x57ead0){logger[_0xf531('0xe')](_0x2f67ea);logger[_0xf531('0xe')](_0x57ead0);if(_0x58d60e){logger[_0xf531('0x9')](_0x58d60e);return _0x3c12a9(_0x58d60e);}return _0xc67839(_0x2f67ea);});});}exports['index']=function(_0x513e47,_0x4fef2b){return pm2[_0xf531('0xf')]()[_0xf531('0x10')](function(_0xe92fa3){if(_0xe92fa3){var _0x187c57=_['reject'](_0xe92fa3,function(_0x4d2651){return _0x4d2651[_0xf531('0xb')]===_0xf531('0x11')||_0x4d2651[_0xf531('0xb')]===_0xf531('0x12');});return{'rows':_0x187c57,'count':_0x187c57[_0xf531('0x13')]};}return null;})[_0xf531('0x10')](respondWithResult(_0x4fef2b,null))['catch'](handleError(_0x4fef2b,null));};exports[_0xf531('0x14')]=function(_0x257912,_0x193dbb){return pm2[_0xf531('0x15')](_0x257912[_0xf531('0x16')]['id'])[_0xf531('0x10')](respondWithResult(_0x193dbb,null))['then'](handleEntityNotFound(_0x193dbb,null))[_0xf531('0x17')](handleError(_0x193dbb,null));};exports[_0xf531('0x18')]=function(_0x43f97e,_0x339915){if(_0x43f97e['body']['name']&&_0x43f97e['body']['script']){var _0x2035b5=path[_0xf531('0x19')](__dirname,_0xf531('0x1a'),_0x43f97e[_0xf531('0x1b')][_0xf531('0x1c')]);var _0x324395=process['cwd']();process['chdir'](path[_0xf531('0x1d')](_0x2035b5));return execChildProcess()[_0xf531('0x10')](function(_0x9916fe){process[_0xf531('0x1e')](_0x324395);return pm2[_0xf531('0x1f')]({'name':_0x43f97e['body'][_0xf531('0xb')],'script':_0x2035b5});})['then'](function(_0x586b5c){pm2['dump']();return _0x586b5c[0x0];})[_0xf531('0x10')](respondWithResult(_0x339915,0xc9))[_0xf531('0x17')](handleError(_0x339915,null));}else{return _0x339915['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xf531('0x20')]=function(_0x1ea8d8,_0x584536){if(_0x1ea8d8[_0xf531('0x1b')]['id']){delete _0x1ea8d8[_0xf531('0x1b')]['id'];}var _0x5d4943={'online':_0xf531('0x21'),'stopped':_0xf531('0x22')};if(_0x5d4943[_0xf531('0x23')](_0x1ea8d8[_0xf531('0x1b')]['status'])){return pm2[_0x5d4943[_0x1ea8d8[_0xf531('0x1b')][_0xf531('0x7')]]](_0x1ea8d8[_0xf531('0x16')]['id'])['then'](respondWithResult(_0x584536,0xc8))[_0xf531('0x17')](handleError(_0x584536,null));}else{return _0x584536[_0xf531('0x7')](0x1f4)['send']({'message':_0xf531('0x24')});}};exports[_0xf531('0x25')]=function(_0x414360,_0x24feee){if(_0x414360[_0xf531('0x1b')]['id']){delete _0x414360['body']['id'];}if(_0x414360['params']['id']){return pm2['delete'](_0x414360[_0xf531('0x16')]['id'])[_0xf531('0x10')](function(_0x3e0b71){pm2['dump']();return _0x3e0b71[0x0];})['then'](respondWithResult(_0x24feee,null))[_0xf531('0x17')](handleError(_0x24feee,null));}else{return _0x24feee[_0xf531('0x7')](0x1f4)[_0xf531('0xc')]({'message':_0xf531('0x26')});}}; \ No newline at end of file +var _0x1e20=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','params','create','body','script','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x83d05,_0x4df7d3){var _0x3cb482=function(_0x3d17de){while(--_0x3d17de){_0x83d05['push'](_0x83d05['shift']());}};_0x3cb482(++_0x4df7d3);}(_0x1e20,0x1ac));var _0x01e2=function(_0x589b51,_0x55b2ac){_0x589b51=_0x589b51-0x0;var _0x3dbc4a=_0x1e20[_0x589b51];return _0x3dbc4a;};'use strict';var _=require('lodash');var pm2=require(_0x01e2('0x0'));var logger=require('../../config/logger')('api');var path=require(_0x01e2('0x1'));var exec=require(_0x01e2('0x2'))[_0x01e2('0x3')];var BPromise=require(_0x01e2('0x4'));function handleEntityNotFound(_0x47b2e6,_0x7a5157){return function(_0x4f5b5d){if(!_0x4f5b5d){_0x47b2e6[_0x01e2('0x5')](0x194);;}return _0x4f5b5d;};}function respondWithResult(_0x325291,_0x49a7aa){_0x49a7aa=_0x49a7aa||0xc8;return function(_0x4687d7){if(_0x4687d7){return _0x325291['status'](_0x49a7aa)[_0x01e2('0x6')](_0x4687d7);}return null;};}function handleError(_0x9cbf3e,_0x3291f0){_0x3291f0=_0x3291f0||0x1f4;return function(_0x356e07){logger[_0x01e2('0x7')](_0x356e07[_0x01e2('0x8')]);if(_0x356e07['name']){delete _0x356e07[_0x01e2('0x9')];}_0x9cbf3e[_0x01e2('0xa')](_0x3291f0)[_0x01e2('0xb')](_0x356e07);};}function execChildProcess(){return new BPromise(function(_0x13761c,_0x11d1bf){exec(_0x01e2('0xc'),function(_0x1592f8,_0x3f9f63,_0x43bc68){logger[_0x01e2('0xd')](_0x3f9f63);logger[_0x01e2('0xd')](_0x43bc68);if(_0x1592f8){logger[_0x01e2('0x7')](_0x1592f8);return _0x11d1bf(_0x1592f8);}return _0x13761c(_0x3f9f63);});});}exports[_0x01e2('0xe')]=function(_0x33ba92,_0x121387){return pm2[_0x01e2('0xf')]()[_0x01e2('0x10')](function(_0x2cfd14){if(_0x2cfd14){var _0x533084=_[_0x01e2('0x11')](_0x2cfd14,function(_0x5c9f88){return _0x5c9f88[_0x01e2('0x9')]===_0x01e2('0x12')||_0x5c9f88[_0x01e2('0x9')]===_0x01e2('0x13');});return{'rows':_0x533084,'count':_0x533084[_0x01e2('0x14')]};}return null;})[_0x01e2('0x10')](respondWithResult(_0x121387,null))[_0x01e2('0x15')](handleError(_0x121387,null));};exports[_0x01e2('0x16')]=function(_0x1db6fc,_0x43fa9a){return pm2['describe'](_0x1db6fc[_0x01e2('0x17')]['id'])['then'](respondWithResult(_0x43fa9a,null))[_0x01e2('0x10')](handleEntityNotFound(_0x43fa9a,null))[_0x01e2('0x15')](handleError(_0x43fa9a,null));};exports[_0x01e2('0x18')]=function(_0x4517d4,_0x29d844){if(_0x4517d4[_0x01e2('0x19')][_0x01e2('0x9')]&&_0x4517d4[_0x01e2('0x19')][_0x01e2('0x1a')]){var _0x2bc271=path['join'](__dirname,_0x01e2('0x1b'),_0x4517d4[_0x01e2('0x19')]['script']);var _0x56ced6=process[_0x01e2('0x1c')]();process[_0x01e2('0x1d')](path[_0x01e2('0x1e')](_0x2bc271));return execChildProcess()[_0x01e2('0x10')](function(_0x382351){process['chdir'](_0x56ced6);return pm2[_0x01e2('0x1f')]({'name':_0x4517d4['body'][_0x01e2('0x9')],'script':_0x2bc271});})['then'](function(_0x28b048){pm2[_0x01e2('0x20')]();return _0x28b048[0x0];})[_0x01e2('0x10')](respondWithResult(_0x29d844,0xc9))[_0x01e2('0x15')](handleError(_0x29d844,null));}else{return _0x29d844['status'](0x1f4)[_0x01e2('0xb')]({'message':_0x01e2('0x21')});}};exports[_0x01e2('0x22')]=function(_0x549b95,_0x5093d6){if(_0x549b95['body']['id']){delete _0x549b95[_0x01e2('0x19')]['id'];}var _0x11158e={'online':_0x01e2('0x23'),'stopped':_0x01e2('0x24')};if(_0x11158e[_0x01e2('0x25')](_0x549b95[_0x01e2('0x19')][_0x01e2('0xa')])){return pm2[_0x11158e[_0x549b95[_0x01e2('0x19')]['status']]](_0x549b95[_0x01e2('0x17')]['id'])[_0x01e2('0x10')](respondWithResult(_0x5093d6,0xc8))[_0x01e2('0x15')](handleError(_0x5093d6,null));}else{return _0x5093d6['status'](0x1f4)[_0x01e2('0xb')]({'message':_0x01e2('0x26')});}};exports[_0x01e2('0x27')]=function(_0x5359b1,_0x489689){if(_0x5359b1[_0x01e2('0x19')]['id']){delete _0x5359b1[_0x01e2('0x19')]['id'];}if(_0x5359b1[_0x01e2('0x17')]['id']){return pm2[_0x01e2('0x28')](_0x5359b1['params']['id'])[_0x01e2('0x10')](function(_0x46cf32){pm2[_0x01e2('0x20')]();return _0x46cf32[0x0];})[_0x01e2('0x10')](respondWithResult(_0x489689,null))[_0x01e2('0x15')](handleError(_0x489689,null));}else{return _0x489689[_0x01e2('0xa')](0x1f4)['send']({'message':_0x01e2('0x29')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 0e578e2..a1e5faa 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 _0x02a7=['../../components/interaction/service','../../config/environment','exports','util','express','Router','../../components/auth/service'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x02a7,0x7a));var _0x702a=function(_0x148feb,_0x257334){_0x148feb=_0x148feb-0x0;var _0x4e969d=_0x02a7[_0x148feb];return _0x4e969d;};'use strict';var multer=require('multer');var util=require(_0x702a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x702a('0x1'));var router=express[_0x702a('0x2')]();var auth=require(_0x702a('0x3'));var interaction=require(_0x702a('0x4'));var config=require(_0x702a('0x5'));module[_0x702a('0x6')]=router; \ No newline at end of file +var _0xb96d=['../../components/auth/service','../../components/interaction/service','util','path','connect-timeout','Router'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xb96d,0x9e));var _0xdb96=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xb96d[_0x4521e3];return _0x46a272;};'use strict';var multer=require('multer');var util=require(_0xdb96('0x0'));var path=require(_0xdb96('0x1'));var timeout=require(_0xdb96('0x2'));var express=require('express');var router=express[_0xdb96('0x3')]();var auth=require(_0xdb96('0x4'));var interaction=require(_0xdb96('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f27c566..6d5a31f 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 _0x2c76=['DATE','INTEGER','sequelize','STRING'];(function(_0x319d4a,_0x160c50){var _0x1c59bb=function(_0xd3ab60){while(--_0xd3ab60){_0x319d4a['push'](_0x319d4a['shift']());}};_0x1c59bb(++_0x160c50);}(_0x2c76,0x12a));var _0x62c7=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0x2c76[_0x60878f];return _0x1fbefb;};'use strict';var Sequelize=require(_0x62c7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x62c7('0x1')]},'scheduledat':{'type':Sequelize[_0x62c7('0x2')]},'uniqueid':{'type':Sequelize[_0x62c7('0x1')]},'starttime':{'type':Sequelize[_0x62c7('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x62c7('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x62c7('0x1')]},'campaigntype':{'type':Sequelize[_0x62c7('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x39c5=['STRING','sequelize','INTEGER','DATE'];(function(_0xdfb3c3,_0x59788d){var _0x4f9a74=function(_0x2f1544){while(--_0x2f1544){_0xdfb3c3['push'](_0xdfb3c3['shift']());}};_0x4f9a74(++_0x59788d);}(_0x39c5,0x109));var _0x539c=function(_0x9c305d,_0x5618a5){_0x9c305d=_0x9c305d-0x0;var _0x1b8f08=_0x39c5[_0x9c305d];return _0x1b8f08;};'use strict';var Sequelize=require(_0x539c('0x0'));module['exports']={'state':{'type':Sequelize[_0x539c('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x539c('0x2')]},'uniqueid':{'type':Sequelize[_0x539c('0x3')]},'starttime':{'type':Sequelize[_0x539c('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x539c('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x539c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x539c('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e1bdf8d..9e9f608 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 _0x913a=['define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','request-promise','./reportAgentPreview.attributes','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x913a,0x110));var _0xa913=function(_0x2dfa52,_0x57c5f7){_0x2dfa52=_0x2dfa52-0x0;var _0x5e2f13=_0x913a[_0x2dfa52];return _0x5e2f13;};'use strict';var _=require(_0xa913('0x0'));var util=require(_0xa913('0x1'));var logger=require(_0xa913('0x2'))(_0xa913('0x3'));var moment=require(_0xa913('0x4'));var BPromise=require('bluebird');var rp=require(_0xa913('0x5'));var attributes=require(_0xa913('0x6'));module[_0xa913('0x7')]=function(_0x1775a1,_0x1fcf41){return _0x1775a1[_0xa913('0x8')](_0xa913('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x134a=['ReportAgentPreview','lodash','api','bluebird','request-promise','./reportAgentPreview.attributes','define'];(function(_0x4713d9,_0x74d0f7){var _0x1d3520=function(_0x49fe25){while(--_0x49fe25){_0x4713d9['push'](_0x4713d9['shift']());}};_0x1d3520(++_0x74d0f7);}(_0x134a,0xe1));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa134('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa134('0x1'));var moment=require('moment');var BPromise=require(_0xa134('0x2'));var rp=require(_0xa134('0x3'));var attributes=require(_0xa134('0x4'));module['exports']=function(_0x2435ff,_0x2cf8b0){return _0x2435ff[_0xa134('0x5')](_0xa134('0x6'),attributes,{'tableName':'report_agent_preview','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 08ce4fe..881539d 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 _0x0346=['rpc','../../config/environment','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0346,0x7d));var _0x6034=function(_0x1de059,_0x348978){_0x1de059=_0x1de059-0x0;var _0x94ccee=_0x0346[_0x1de059];return _0x94ccee;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6034('0x0'));var rs=require(_0x6034('0x1'));var fs=require('fs');var Redis=require(_0x6034('0x2'));var db=require(_0x6034('0x3'))['db'];var utils=require(_0x6034('0x4'));var logger=require('../../config/logger')(_0x6034('0x5'));var config=require(_0x6034('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6034('0x7')][_0x6034('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56aecd,_0x1099b0,_0x10d534){return new BPromise(function(_0x5a24d9,_0x46988d){return client['request'](_0x56aecd,_0x10d534)[_0x6034('0x9')](function(_0x3c7389){logger['info'](_0x6034('0xa'),_0x1099b0,_0x6034('0xb'));logger[_0x6034('0xc')](_0x6034('0xd'),_0x1099b0,_0x6034('0xb'),JSON['stringify'](_0x3c7389));if(_0x3c7389['error']){if(_0x3c7389['error']['code']===0x1f4){logger[_0x6034('0xe')](_0x6034('0xa'),_0x1099b0,_0x3c7389[_0x6034('0xe')][_0x6034('0xf')]);return _0x46988d(_0x3c7389[_0x6034('0xe')][_0x6034('0xf')]);}logger[_0x6034('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x1099b0,_0x3c7389['error'][_0x6034('0xf')]);return _0x5a24d9(_0x3c7389[_0x6034('0xe')][_0x6034('0xf')]);}else{logger[_0x6034('0x10')](_0x6034('0xa'),_0x1099b0,'request\x20sent');_0x5a24d9(_0x3c7389[_0x6034('0x11')][_0x6034('0xf')]);}})['catch'](function(_0x127718){logger[_0x6034('0xe')](_0x6034('0xa'),_0x1099b0,_0x127718);_0x46988d(_0x127718);});});}exports[_0x6034('0x12')]=function(_0x507d6f){var _0x5d4dc8=this;return new Promise(function(_0x116114,_0x23a288){return db[_0x6034('0x13')][_0x6034('0x14')](_0x507d6f[_0x6034('0x15')],{'raw':_0x507d6f[_0x6034('0x16')]?_0x507d6f[_0x6034('0x16')][_0x6034('0x17')]===undefined?!![]:![]:!![]})[_0x6034('0x9')](function(_0x37ff6c){logger['info']('CreateReportAgentPreview',_0x507d6f);logger[_0x6034('0xc')](_0x6034('0x12'),_0x507d6f,JSON[_0x6034('0x18')](_0x37ff6c));_0x116114(_0x37ff6c);})[_0x6034('0x19')](function(_0x41f7be){logger[_0x6034('0xe')](_0x6034('0x12'),_0x41f7be['message'],_0x507d6f);_0x23a288(_0x5d4dc8['error'](0x1f4,_0x41f7be[_0x6034('0xf')]));});});}; \ No newline at end of file +var _0x1f39=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f39,0x1df));var _0x91f3=function(_0x131892,_0x2fcaf0){_0x131892=_0x131892-0x0;var _0x2cff47=_0x1f39[_0x131892];return _0x2cff47;};'use strict';var _=require(_0x91f3('0x0'));var util=require(_0x91f3('0x1'));var moment=require(_0x91f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x91f3('0x3'));var fs=require('fs');var Redis=require(_0x91f3('0x4'));var db=require(_0x91f3('0x5'))['db'];var utils=require(_0x91f3('0x6'));var logger=require(_0x91f3('0x7'))(_0x91f3('0x8'));var config=require(_0x91f3('0x9'));var jayson=require(_0x91f3('0xa'));var client=jayson[_0x91f3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504838,_0x1d9e28,_0x4521fa){return new BPromise(function(_0x4874aa,_0x5145f0){return client['request'](_0x504838,_0x4521fa)[_0x91f3('0xc')](function(_0x18737e){logger[_0x91f3('0xd')](_0x91f3('0xe'),_0x1d9e28,_0x91f3('0xf'));logger[_0x91f3('0x10')](_0x91f3('0x11'),_0x1d9e28,_0x91f3('0xf'),JSON['stringify'](_0x18737e));if(_0x18737e[_0x91f3('0x12')]){if(_0x18737e[_0x91f3('0x12')][_0x91f3('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1d9e28,_0x18737e['error']['message']);return _0x5145f0(_0x18737e[_0x91f3('0x12')][_0x91f3('0x14')]);}logger[_0x91f3('0x12')](_0x91f3('0xe'),_0x1d9e28,_0x18737e[_0x91f3('0x12')][_0x91f3('0x14')]);return _0x4874aa(_0x18737e[_0x91f3('0x12')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x1d9e28,'request\x20sent');_0x4874aa(_0x18737e[_0x91f3('0x15')][_0x91f3('0x14')]);}})[_0x91f3('0x16')](function(_0x4c2063){logger['error'](_0x91f3('0xe'),_0x1d9e28,_0x4c2063);_0x5145f0(_0x4c2063);});});}exports[_0x91f3('0x17')]=function(_0x2961a8){var _0x2cdfea=this;return new Promise(function(_0x404a3c,_0x194ef7){return db['ReportAgentPreview']['create'](_0x2961a8['body'],{'raw':_0x2961a8[_0x91f3('0x18')]?_0x2961a8[_0x91f3('0x18')][_0x91f3('0x19')]===undefined?!![]:![]:!![]})[_0x91f3('0xc')](function(_0xc146b3){logger[_0x91f3('0xd')](_0x91f3('0x17'),_0x2961a8);logger[_0x91f3('0x10')]('CreateReportAgentPreview',_0x2961a8,JSON[_0x91f3('0x1a')](_0xc146b3));_0x404a3c(_0xc146b3);})[_0x91f3('0x16')](function(_0x32b1ba){logger[_0x91f3('0x12')](_0x91f3('0x17'),_0x32b1ba[_0x91f3('0x14')],_0x2961a8);_0x194ef7(_0x2cdfea['error'](0x1f4,_0x32b1ba[_0x91f3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 90a57c6..bf8fba1 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 _0x9bd7=['./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','/sms/queues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound/channels','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id','post','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1c34dd,_0x1adf60){var _0x3ab7e7=function(_0x3befb9){while(--_0x3befb9){_0x1c34dd['push'](_0x1c34dd['shift']());}};_0x3ab7e7(++_0x1adf60);}(_0x9bd7,0x106));var _0x79bd=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9bd7[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var path=require(_0x79bd('0x2'));var express=require(_0x79bd('0x3'));var router=express[_0x79bd('0x4')]();var auth=require(_0x79bd('0x5'));var controller=require(_0x79bd('0x6'));router['get'](_0x79bd('0x7'),auth[_0x79bd('0x8')](),controller['voiceChannels']);router[_0x79bd('0x9')](_0x79bd('0xa'),auth[_0x79bd('0x8')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x79bd('0x8')](),controller[_0x79bd('0xb')]);router[_0x79bd('0x9')](_0x79bd('0xc'),auth['isAuthenticated'](),controller[_0x79bd('0xd')]);router[_0x79bd('0x9')](_0x79bd('0xe'),auth[_0x79bd('0x8')](),controller[_0x79bd('0xf')]);router[_0x79bd('0x9')]('/mail/queues',auth[_0x79bd('0x8')](),controller[_0x79bd('0x10')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x79bd('0x11')]);router['get']('/openchannel/queues',auth[_0x79bd('0x8')](),controller['openchannelQueues']);router[_0x79bd('0x9')](_0x79bd('0x12'),auth[_0x79bd('0x8')](),controller['smsQueues']);router['get'](_0x79bd('0x13'),auth['isAuthenticated'](),controller[_0x79bd('0x14')]);router[_0x79bd('0x9')]('/voice/queues/preview/:id',auth[_0x79bd('0x8')](),controller[_0x79bd('0x15')]);router[_0x79bd('0x9')](_0x79bd('0x16'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x17')]);router['get'](_0x79bd('0x18'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x79bd('0x9')](_0x79bd('0x19'),auth[_0x79bd('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x79bd('0x9')](_0x79bd('0x1a'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x1b')]);router['get'](_0x79bd('0x1c'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x1d')]);router[_0x79bd('0x9')]('/outbound',auth[_0x79bd('0x8')](),controller['outbound']);router[_0x79bd('0x9')](_0x79bd('0x1e'),auth[_0x79bd('0x8')](),controller['outboundChannels']);router['get']('/agents',auth[_0x79bd('0x8')](),controller['agents']);router[_0x79bd('0x1f')](_0x79bd('0x20'),auth[_0x79bd('0x8')](),controller['agentCapacity']);router[_0x79bd('0x9')](_0x79bd('0x21'),auth['isAuthenticated'](),controller[_0x79bd('0x22')]);router['get'](_0x79bd('0x23'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x24')]);router[_0x79bd('0x9')](_0x79bd('0x25'),auth[_0x79bd('0x8')](),controller['campaigns']);router['get'](_0x79bd('0x26'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x79bd('0x9')](_0x79bd('0x27'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x28')]);router['get'](_0x79bd('0x29'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x2a')]);router[_0x79bd('0x9')](_0x79bd('0x2b'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x2c')]);router[_0x79bd('0x9')]('/sms/queues/waitinginteractions',auth[_0x79bd('0x8')](),controller[_0x79bd('0x2d')]);router['get'](_0x79bd('0x2e'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x2f')]);router['post']('/mail/queues/:id/notify',auth[_0x79bd('0x8')](),controller['queueNotify']('mail'));router[_0x79bd('0x9')](_0x79bd('0x30'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x79bd('0x31')](_0x79bd('0x32'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x33')](_0x79bd('0x34')));router[_0x79bd('0x9')](_0x79bd('0x35'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x36')]);router[_0x79bd('0x31')](_0x79bd('0x37'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x33')](_0x79bd('0x38')));router['get'](_0x79bd('0x39'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x3a')]);router[_0x79bd('0x31')]('/openchannel/queues/:id/notify',auth[_0x79bd('0x8')](),controller[_0x79bd('0x33')](_0x79bd('0x3b')));router['get'](_0x79bd('0x3c'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x3d')]);router[_0x79bd('0x31')]('/sms/queues/:id/notify',auth[_0x79bd('0x8')](),controller[_0x79bd('0x33')](_0x79bd('0x3e')));router[_0x79bd('0x9')](_0x79bd('0x3f'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x40')]);router[_0x79bd('0x31')](_0x79bd('0x41'),auth[_0x79bd('0x8')](),controller[_0x79bd('0x42')]);module['exports']=router; \ No newline at end of file +var _0x001a=['voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/agents/:id/notify','agentNotify','exports','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten'];(function(_0x5496ff,_0x104d17){var _0x36881c=function(_0x395a82){while(--_0x395a82){_0x5496ff['push'](_0x5496ff['shift']());}};_0x36881c(++_0x104d17);}(_0x001a,0x75));var _0xa001=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0x001a[_0x7b5cdd];return _0x3a29ae;};'use strict';var multer=require(_0xa001('0x0'));var util=require('util');var path=require(_0xa001('0x1'));var express=require(_0xa001('0x2'));var router=express['Router']();var auth=require(_0xa001('0x3'));var controller=require(_0xa001('0x4'));router[_0xa001('0x5')](_0xa001('0x6'),auth[_0xa001('0x7')](),controller['voiceChannels']);router[_0xa001('0x5')](_0xa001('0x8'),auth[_0xa001('0x7')](),controller['voiceChannelMixMonitor']);router[_0xa001('0x5')](_0xa001('0x9'),auth['isAuthenticated'](),controller[_0xa001('0xa')]);router[_0xa001('0x5')](_0xa001('0xb'),auth[_0xa001('0x7')](),controller[_0xa001('0xc')]);router[_0xa001('0x5')](_0xa001('0xd'),auth[_0xa001('0x7')](),controller[_0xa001('0xe')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller[_0xa001('0xf')]);router[_0xa001('0x5')](_0xa001('0x10'),auth[_0xa001('0x7')](),controller[_0xa001('0x11')]);router[_0xa001('0x5')](_0xa001('0x12'),auth[_0xa001('0x7')](),controller[_0xa001('0x13')]);router[_0xa001('0x5')](_0xa001('0x14'),auth[_0xa001('0x7')](),controller[_0xa001('0x15')]);router['get'](_0xa001('0x16'),auth[_0xa001('0x7')](),controller[_0xa001('0x17')]);router[_0xa001('0x5')](_0xa001('0x18'),auth['isAuthenticated'](),controller[_0xa001('0x19')]);router['get'](_0xa001('0x1a'),auth['isAuthenticated'](),controller[_0xa001('0x1b')]);router[_0xa001('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xa001('0x7')](),controller[_0xa001('0x1c')]);router[_0xa001('0x5')](_0xa001('0x1d'),auth[_0xa001('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xa001('0x5')](_0xa001('0x1e'),auth[_0xa001('0x7')](),controller[_0xa001('0x1f')]);router[_0xa001('0x5')](_0xa001('0x20'),auth[_0xa001('0x7')](),controller[_0xa001('0x21')]);router['get'](_0xa001('0x22'),auth[_0xa001('0x7')](),controller[_0xa001('0x23')]);router['get'](_0xa001('0x24'),auth[_0xa001('0x7')](),controller[_0xa001('0x25')]);router['get'](_0xa001('0x26'),auth[_0xa001('0x7')](),controller[_0xa001('0x27')]);router[_0xa001('0x28')](_0xa001('0x29'),auth[_0xa001('0x7')](),controller[_0xa001('0x2a')]);router[_0xa001('0x5')]('/telephones',auth['isAuthenticated'](),controller[_0xa001('0x2b')]);router['get'](_0xa001('0x2c'),auth[_0xa001('0x7')](),controller['trunks']);router[_0xa001('0x5')]('/campaigns',auth[_0xa001('0x7')](),controller[_0xa001('0x2d')]);router['get'](_0xa001('0x2e'),auth[_0xa001('0x7')](),controller[_0xa001('0x2f')]);router['get']('/chat/queues/waitinginteractions',auth[_0xa001('0x7')](),controller[_0xa001('0x30')]);router[_0xa001('0x5')](_0xa001('0x31'),auth[_0xa001('0x7')](),controller[_0xa001('0x32')]);router[_0xa001('0x5')](_0xa001('0x33'),auth[_0xa001('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0xa001('0x5')](_0xa001('0x34'),auth[_0xa001('0x7')](),controller[_0xa001('0x35')]);router['get'](_0xa001('0x36'),auth[_0xa001('0x7')](),controller[_0xa001('0x37')]);router[_0xa001('0x38')](_0xa001('0x39'),auth[_0xa001('0x7')](),controller[_0xa001('0x3a')]('mail'));router[_0xa001('0x5')]('/mail/queues/:id',auth[_0xa001('0x7')](),controller[_0xa001('0x3b')]);router[_0xa001('0x38')](_0xa001('0x3c'),auth[_0xa001('0x7')](),controller['queueNotify'](_0xa001('0x3d')));router[_0xa001('0x5')](_0xa001('0x3e'),auth[_0xa001('0x7')](),controller['showChatQueues']);router[_0xa001('0x38')]('/fax/queues/:id/notify',auth[_0xa001('0x7')](),controller[_0xa001('0x3a')](_0xa001('0x3f')));router[_0xa001('0x5')](_0xa001('0x40'),auth[_0xa001('0x7')](),controller[_0xa001('0x41')]);router[_0xa001('0x38')](_0xa001('0x42'),auth[_0xa001('0x7')](),controller[_0xa001('0x3a')](_0xa001('0x43')));router[_0xa001('0x5')](_0xa001('0x44'),auth[_0xa001('0x7')](),controller[_0xa001('0x45')]);router[_0xa001('0x38')]('/sms/queues/:id/notify',auth[_0xa001('0x7')](),controller[_0xa001('0x3a')](_0xa001('0x46')));router['get']('/sms/queues/:id',auth[_0xa001('0x7')](),controller['showSmsQueues']);router[_0xa001('0x38')](_0xa001('0x47'),auth[_0xa001('0x7')](),controller[_0xa001('0x48')]);module[_0xa001('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 38347e3..991c380 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 _0xf311=['body','user','interaction','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','*,*,*,*','agentNotify','channel','Website','findOne','Agent\x20not\x20found','messageId','InteractionId','TransferReport','Start','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','json','sendStatus','name','status','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','then','catch','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity'];(function(_0x250dc0,_0x40acdb){var _0x3da220=function(_0x180f79){while(--_0x180f79){_0x250dc0['push'](_0x250dc0['shift']());}};_0x3da220(++_0x40acdb);}(_0xf311,0xb1));var _0x1f31=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf311[_0x138adb];return _0x1b27f2;};'use strict';var BPromise=require(_0x1f31('0x0'));var moment=require('moment');var _=require(_0x1f31('0x1'));var util=require(_0x1f31('0x2'));var db=require(_0x1f31('0x3'))['db'];var logger=require(_0x1f31('0x4'))(_0x1f31('0x5'));var jayson=require(_0x1f31('0x6'));var amiClient=jayson[_0x1f31('0x7')][_0x1f31('0x8')]({'port':0x232a});var mailClient=jayson[_0x1f31('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x1f31('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x28fe53,_0x504850,_0x438392){return new BPromise(function(_0x3f41fa,_0x33876b){var _0x1811f6=_0x438392?_0x438392:amiClient;return _0x1811f6[_0x1f31('0x9')](_0x28fe53,_0x504850)['then'](function(_0x230355){if(_0x230355[_0x1f31('0xa')]){if(_0x230355['error']['code']===0x1f4){return _0x33876b(_0x230355[_0x1f31('0xa')][_0x1f31('0xb')]);}return _0x3f41fa(_0x230355[_0x1f31('0xa')][_0x1f31('0xb')]);}else{_0x3f41fa(_0x230355[_0x1f31('0xc')]);}})['catch'](function(_0xa0301e){_0x33876b(_0xa0301e);});});}function respondWithResult(_0x5abd0f,_0x2e405d){_0x2e405d=_0x2e405d||0xc8;return function(_0x1f86b){if(_0x1f86b){return _0x5abd0f['status'](_0x2e405d)[_0x1f31('0xd')](_0x1f86b);}return _0x5abd0f[_0x1f31('0xe')](0x194);};}function handleError(_0x57a81a,_0x18534e){_0x18534e=_0x18534e||0x1f4;return function(_0xd51ea7){logger[_0x1f31('0xa')](_0xd51ea7['stack']);if(_0xd51ea7[_0x1f31('0xf')]){delete _0xd51ea7[_0x1f31('0xf')];}_0x57a81a[_0x1f31('0x10')](_0x18534e)['send'](_0xd51ea7);};}function findById(_0x51e5b4){return function(_0x16d236){if(!_[_0x1f31('0x11')](_0x51e5b4)&&!_[_0x1f31('0x11')](_0x16d236)&&!_[_0x1f31('0x11')](_0x16d236[_0x1f31('0x12')])){return _[_0x1f31('0x13')](_0x16d236[_0x1f31('0x12')],function(_0x32710a){return _0x32710a['id']==_0x51e5b4;});}return null;};}exports[_0x1f31('0x14')]=function(_0x267327,_0x21d788){return respondWithRpcPromise(_0x1f31('0x15'),_0x267327[_0x1f31('0x16')])['then'](respondWithResult(_0x21d788,null))['catch'](handleError(_0x21d788,null));};exports[_0x1f31('0x17')]=function(_0x5b7759,_0x19752f){return respondWithRpcPromise(_0x1f31('0x18'),_[_0x1f31('0x19')](_0x5b7759['query'],_0x5b7759[_0x1f31('0x1a')]))[_0x1f31('0x1b')](respondWithResult(_0x19752f,null))[_0x1f31('0x1c')](handleError(_0x19752f,null));};exports['voiceChannelStopMixMonitor']=function(_0x243329,_0x2916b7){return respondWithRpcPromise(_0x1f31('0x1d'),_['merge'](_0x243329[_0x1f31('0x16')],_0x243329['params']))['then'](respondWithResult(_0x2916b7,null))[_0x1f31('0x1c')](handleError(_0x2916b7,null));};exports[_0x1f31('0x1e')]=function(_0x5068a,_0x3605af){return respondWithRpcPromise('VoiceQueues',_0x5068a[_0x1f31('0x16')])['then'](respondWithResult(_0x3605af,null))['catch'](handleError(_0x3605af,null));};exports[_0x1f31('0x1f')]=function(_0x117745,_0x53b9b9){return respondWithRpcPromise('VoiceQueues',_0x117745[_0x1f31('0x16')])[_0x1f31('0x1b')](findById(_0x117745['params']['id']))[_0x1f31('0x1b')](respondWithResult(_0x53b9b9,null))[_0x1f31('0x1c')](handleError(_0x53b9b9,null));};exports[_0x1f31('0x20')]=function(_0x29d5db,_0x299a66){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x1f31('0x19')](_0x29d5db[_0x1f31('0x16')],_0x29d5db[_0x1f31('0x1a')]))[_0x1f31('0x1b')](respondWithResult(_0x299a66,null))[_0x1f31('0x1c')](handleError(_0x299a66,null));};exports[_0x1f31('0x21')]=function(_0x26cf86,_0x560a63){return respondWithRpcPromise(_0x1f31('0x22'),_0x26cf86[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x560a63,null))[_0x1f31('0x1c')](handleError(_0x560a63,null));};exports[_0x1f31('0x23')]=function(_0x39bfc8,_0x1b50a2){return respondWithRpcPromise(_0x1f31('0x24'),_[_0x1f31('0x19')](_0x39bfc8[_0x1f31('0x16')],_0x39bfc8[_0x1f31('0x1a')]))[_0x1f31('0x1b')](respondWithResult(_0x1b50a2,null))[_0x1f31('0x1c')](handleError(_0x1b50a2,null));};exports[_0x1f31('0x25')]=function(_0x2f5eee,_0x3515a0){return respondWithRpcPromise(_0x1f31('0x26'),_[_0x1f31('0x19')](_0x2f5eee[_0x1f31('0x16')],_0x2f5eee[_0x1f31('0x1a')]))[_0x1f31('0x1b')](respondWithResult(_0x3515a0,null))[_0x1f31('0x1c')](handleError(_0x3515a0,null));};exports[_0x1f31('0x27')]=function(_0x273f36,_0x53c7bb){return respondWithRpcPromise(_0x1f31('0x28'),_['merge'](_0x273f36[_0x1f31('0x16')],_0x273f36[_0x1f31('0x1a')]))[_0x1f31('0x1b')](respondWithResult(_0x53c7bb,null))['catch'](handleError(_0x53c7bb,null));};exports[_0x1f31('0x29')]=function(_0x2a6133,_0x4dcdef){return respondWithRpcPromise(_0x1f31('0x2a'),_0x2a6133[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x4dcdef,null))[_0x1f31('0x1c')](handleError(_0x4dcdef,null));};exports[_0x1f31('0x2b')]=function(_0x1fa24f,_0x5bc691){return respondWithRpcPromise('OutboundChannels',_0x1fa24f[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x5bc691,null))['catch'](handleError(_0x5bc691,null));};exports[_0x1f31('0x2c')]=function(_0x95c916,_0x2c6af3){var _0x4a37b2;return respondWithRpcPromise(_0x1f31('0x2d'),_0x95c916[_0x1f31('0x16')])[_0x1f31('0x1b')](function(_0xa1415b){_0x4a37b2=_0xa1415b;return respondWithRpcPromise('Agents',_0x95c916[_0x1f31('0x16')],routingClient);})[_0x1f31('0x1b')](function(_0x4a4d41){return _[_0x1f31('0x19')]({},_0x4a4d41,_0x4a37b2);})[_0x1f31('0x1b')](respondWithResult(_0x2c6af3,null))['catch'](handleError(_0x2c6af3,null));};exports[_0x1f31('0x2e')]=function(_0x52ef9a,_0x3a7b36){if(_0x52ef9a[_0x1f31('0x2f')]&&_0x52ef9a[_0x1f31('0x2f')]['interaction']&&_0x52ef9a[_0x1f31('0x30')]&&_0x52ef9a['user'][_0x1f31('0xf')]){for(var _0x59c360 in _0x52ef9a['body'][_0x1f31('0x31')]){if(_0x52ef9a[_0x1f31('0x2f')][_0x1f31('0x31')]['hasOwnProperty'](_0x59c360)){db['MemberReport'][_0x1f31('0x32')]({'where':{'channel':_0x59c360,'membername':_0x52ef9a['user'][_0x1f31('0xf')],'type':_0x1f31('0x33'),'exitAt':null,'uniqueid':_0x52ef9a[_0x1f31('0x2f')][_0x1f31('0x31')][_0x59c360]&&_0x52ef9a[_0x1f31('0x2f')][_0x1f31('0x31')][_0x59c360]['length']?{'$notIn':_0x52ef9a[_0x1f31('0x2f')]['interaction'][_0x59c360]}:{'$ne':null}}})['then'](function(_0x45b236){var _0xab1629=moment()[_0x1f31('0x34')](_0x1f31('0x35'));for(var _0x3460af=0x0,_0x5d33d7=_0x45b236[_0x1f31('0x36')];_0x3460af<_0x5d33d7;_0x3460af+=0x1){_0x45b236[_0x3460af][_0x1f31('0x37')]({'exitAt':_0xab1629});}});for(var _0x43c875=0x0;_0x43c875<_0x52ef9a[_0x1f31('0x2f')][_0x1f31('0x31')][_0x59c360][_0x1f31('0x36')];_0x43c875+=0x1){db['MemberReport'][_0x1f31('0x38')]({'where':{'channel':_0x59c360,'membername':_0x52ef9a[_0x1f31('0x30')][_0x1f31('0xf')],'type':_0x1f31('0x33'),'uniqueid':_0x52ef9a[_0x1f31('0x2f')]['interaction'][_0x59c360][_0x43c875],'exitAt':null},'defaults':{'channel':_0x59c360,'membername':_0x52ef9a[_0x1f31('0x30')]['name'],'interface':_['isNil'](_0x52ef9a[_0x1f31('0x30')][_0x1f31('0x39')])?util[_0x1f31('0x34')](_0x1f31('0x3a'),_0x52ef9a['user'][_0x1f31('0xf')]):_0x52ef9a[_0x1f31('0x30')][_0x1f31('0x39')],'type':_0x1f31('0x33'),'enterAt':moment()[_0x1f31('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1f31('0x3b'),'internal':_0x52ef9a[_0x1f31('0x30')][_0x1f31('0x3c')],'uniqueid':_0x52ef9a[_0x1f31('0x2f')]['interaction'][_0x59c360][_0x43c875]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x52ef9a[_0x1f31('0x1a')]['id'],'capacity':_0x52ef9a[_0x1f31('0x2f')]['capacity']},routingClient)[_0x1f31('0x1b')](respondWithResult(_0x3a7b36,null))[_0x1f31('0x1c')](handleError(_0x3a7b36,null));};exports[_0x1f31('0x3d')]=function(_0x1b6d5f,_0x4451f7){return respondWithRpcPromise('Telephones',_0x1b6d5f[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x4451f7,null))[_0x1f31('0x1c')](handleError(_0x4451f7,null));};exports[_0x1f31('0x3e')]=function(_0xd88832,_0x46eae4){return respondWithRpcPromise(_0x1f31('0x3f'),_0xd88832[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x46eae4,null))['catch'](handleError(_0x46eae4,null));};exports[_0x1f31('0x40')]=function(_0x57aa26,_0x50779f){return respondWithRpcPromise(_0x1f31('0x41'),_0x57aa26[_0x1f31('0x16')])[_0x1f31('0x1b')](respondWithResult(_0x50779f,null))[_0x1f31('0x1c')](handleError(_0x50779f,null));};exports['chatQueues']=function(_0x47feb9,_0x37e99d){return respondWithRpcPromise(_0x1f31('0x42'),_0x47feb9['query'],routingClient)['then'](respondWithResult(_0x37e99d,null))[_0x1f31('0x1c')](handleError(_0x37e99d,null));};exports[_0x1f31('0x43')]=function(_0x557293,_0x41bdc2){return respondWithRpcPromise(_0x1f31('0x42'),_0x557293['query'],routingClient)['then'](findById(_0x557293[_0x1f31('0x1a')]['id']))['then'](respondWithResult(_0x41bdc2,null))['catch'](handleError(_0x41bdc2,null));};exports['mailQueues']=function(_0x15ea92,_0x591d50){return respondWithRpcPromise(_0x1f31('0x44'),_0x15ea92[_0x1f31('0x16')],routingClient)['then'](respondWithResult(_0x591d50,null))[_0x1f31('0x1c')](handleError(_0x591d50,null));};exports[_0x1f31('0x45')]=function(_0x1a6dfb,_0x39c2de){return respondWithRpcPromise('MailQueues',_0x1a6dfb[_0x1f31('0x16')],routingClient)['then'](findById(_0x1a6dfb['params']['id']))[_0x1f31('0x1b')](respondWithResult(_0x39c2de,null))[_0x1f31('0x1c')](handleError(_0x39c2de,null));};exports['mailAccounts']=function(_0x3e9a03,_0x3fbc58){return respondWithRpcPromise(_0x1f31('0x46'),_0x3e9a03[_0x1f31('0x16')],mailClient)['then'](respondWithResult(_0x3fbc58,null))['catch'](handleError(_0x3fbc58,null));};exports[_0x1f31('0x47')]=function(_0x15e089,_0x35b049){return respondWithRpcPromise(_0x1f31('0x48'),_0x15e089[_0x1f31('0x16')],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x35b049,null))[_0x1f31('0x1c')](handleError(_0x35b049,null));};exports[_0x1f31('0x49')]=function(_0x5405b0,_0x1d051a){return respondWithRpcPromise(_0x1f31('0x48'),_0x5405b0[_0x1f31('0x16')],routingClient)['then'](findById(_0x5405b0[_0x1f31('0x1a')]['id']))[_0x1f31('0x1b')](respondWithResult(_0x1d051a,null))[_0x1f31('0x1c')](handleError(_0x1d051a,null));};exports['smsQueues']=function(_0x4e54d6,_0x23f4ff){return respondWithRpcPromise(_0x1f31('0x4a'),_0x4e54d6['query'],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x23f4ff,null))[_0x1f31('0x1c')](handleError(_0x23f4ff,null));};exports[_0x1f31('0x4b')]=function(_0x11f759,_0x4f611b){return respondWithRpcPromise(_0x1f31('0x4a'),_0x11f759['query'],routingClient)[_0x1f31('0x1b')](findById(_0x11f759[_0x1f31('0x1a')]['id']))[_0x1f31('0x1b')](respondWithResult(_0x4f611b,null))[_0x1f31('0x1c')](handleError(_0x4f611b,null));};exports[_0x1f31('0x4c')]=function(_0x5d53d8,_0x24c8a9){return respondWithRpcPromise('FaxQueues',_0x5d53d8[_0x1f31('0x16')],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x24c8a9,null))[_0x1f31('0x1c')](handleError(_0x24c8a9,null));};exports['showFaxQueues']=function(_0x282105,_0x7fe561){return respondWithRpcPromise(_0x1f31('0x4d'),_0x282105[_0x1f31('0x16')],routingClient)['then'](findById(_0x282105[_0x1f31('0x1a')]['id']))[_0x1f31('0x1b')](respondWithResult(_0x7fe561,null))[_0x1f31('0x1c')](handleError(_0x7fe561,null));};exports[_0x1f31('0x4e')]=function(_0x38e727,_0x206641){return respondWithRpcPromise(_0x1f31('0x4f'),_0x38e727['query'])['then'](respondWithResult(_0x206641,null))[_0x1f31('0x1c')](handleError(_0x206641,null));};exports['chatQueuesWaitingInteractions']=function(_0x488996,_0x3e6e60){return respondWithRpcPromise(_0x1f31('0x50'),_0x488996[_0x1f31('0x16')],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x3e6e60,null))[_0x1f31('0x1c')](handleError(_0x3e6e60,null));};exports[_0x1f31('0x51')]=function(_0x181af6,_0x3561bc){return respondWithRpcPromise(_0x1f31('0x52'),_0x181af6[_0x1f31('0x16')],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x3561bc,null))[_0x1f31('0x1c')](handleError(_0x3561bc,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x259782,_0x234293){return respondWithRpcPromise(_0x1f31('0x53'),_0x259782['query'],routingClient)['then'](respondWithResult(_0x234293,null))[_0x1f31('0x1c')](handleError(_0x234293,null));};exports[_0x1f31('0x54')]=function(_0x319f17,_0x63fb72){return respondWithRpcPromise(_0x1f31('0x55'),_0x319f17[_0x1f31('0x16')],routingClient)[_0x1f31('0x1b')](respondWithResult(_0x63fb72,null))['catch'](handleError(_0x63fb72,null));};exports[_0x1f31('0x56')]=function(_0x16c48f,_0x2f3c72){return respondWithRpcPromise(_0x1f31('0x57'),_0x16c48f['query'],routingClient)['then'](respondWithResult(_0x2f3c72,null))['catch'](handleError(_0x2f3c72,null));};exports[_0x1f31('0x58')]=function(_0x29d6ce){return function(_0x4325e3,_0x586c29){var _0x1e7635,_0x4cd900;var _0x1325ca=_[_0x1f31('0x59')](_0x29d6ce);var _0x88bcf5=_0x29d6ce===_0x1f31('0x5a')?'Website':_0x1f31('0x5b');return db[_0x1325ca+_0x1f31('0x5c')]['findOne']({'raw':!![],'where':{'id':_0x4325e3[_0x1f31('0x1a')]['id']}})[_0x1f31('0x1b')](function(_0x46f18a){if(_[_0x1f31('0x11')](_0x46f18a)){throw new Error(_0x1325ca+'\x20Queue\x20not\x20found');}_0x1e7635=_0x46f18a;return db[_0x1325ca+_0x1f31('0x5d')]['findOne']({'where':{'id':_0x4325e3[_0x1f31('0x2f')]['messageId']},'include':[{'model':db[_0x1325ca+'Interaction'],'as':_0x1f31('0x5e')},{'model':db[_0x1325ca+_0x88bcf5],'as':_0x1f31('0x5b')}]});})[_0x1f31('0x1b')](function(_0x1de5ea){if(_[_0x1f31('0x11')](_0x1de5ea)){throw new Error(_0x1325ca+_0x1f31('0x5f'));}_0x4cd900=_0x1de5ea;return _0x1de5ea[_0x1f31('0x60')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1f31('0x1b')](function(){var _0x45c428={'uniqueid':_0x29d6ce+'.'+_0x4cd900['id']+'.'+_0x4cd900[_0x1f31('0x5e')]['id'],'FromUserId':_0x4325e3['user']['id'],'type':_0x1f31('0x61')};_0x45c428[_0x1325ca+_0x1f31('0x62')]=_0x4cd900['id'];_0x45c428[_0x1325ca+'InteractionId']=_0x4cd900['Interaction']['id'];_0x45c428[_0x1f31('0x63')+_0x1325ca+_0x88bcf5+'Id']=_0x4cd900[_0x1f31('0x5b')]['id'];_0x45c428['To'+_0x1325ca+_0x1f31('0x64')]=_0x1e7635['id'];return db[_0x1325ca+'TransferReport']['create'](_0x45c428);})[_0x1f31('0x1b')](function(){return respondWithRpcPromise('Start',{'channel':_0x29d6ce,'interaction':_0x4cd900[_0x1f31('0x5e')],'message':_0x4cd900,'account':_0x4cd900[_0x1f31('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1f31('0x61'),'appdata':_0x1e7635[_0x1f31('0xf')]+','+(_0x4cd900['Account']['queueTransferTimeout']||0x12c),'interval':_0x1f31('0x65')}]},routingClient);})[_0x1f31('0x1b')](respondWithResult(_0x586c29,null))[_0x1f31('0x1c')](handleError(_0x586c29,null));};};exports[_0x1f31('0x66')]=function(_0x171462,_0x4e3cca){var _0x459748,_0x18a09c;if(_['isNil'](_0x171462[_0x1f31('0x2f')][_0x1f31('0x67')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x41798a=_0x171462[_0x1f31('0x2f')][_0x1f31('0x67')];var _0x53edb7=_[_0x1f31('0x59')](_0x41798a);var _0x2aa1c0=_0x41798a==='chat'?_0x1f31('0x68'):_0x1f31('0x5b');return db['User'][_0x1f31('0x69')]({'raw':!![],'where':{'id':_0x171462[_0x1f31('0x1a')]['id'],'role':_0x1f31('0x3b')}})[_0x1f31('0x1b')](function(_0x523fec){if(_[_0x1f31('0x11')](_0x523fec)){throw new Error(_0x1f31('0x6a'));}_0x459748=_0x523fec;return db[_0x53edb7+_0x1f31('0x5d')][_0x1f31('0x69')]({'where':{'id':_0x171462['body'][_0x1f31('0x6b')]},'include':[{'model':db[_0x53edb7+_0x1f31('0x5e')],'as':'Interaction'},{'model':db[_0x53edb7+_0x2aa1c0],'as':_0x1f31('0x5b')}]});})['then'](function(_0x166bbb){if(_[_0x1f31('0x11')](_0x166bbb)){throw new Error(_0x53edb7+_0x1f31('0x5f'));}_0x18a09c=_0x166bbb;return _0x166bbb[_0x1f31('0x60')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x42c6b9={'uniqueid':_0x41798a+'.'+_0x18a09c['id']+'.'+_0x18a09c[_0x1f31('0x5e')]['id'],'FromUserId':_0x171462[_0x1f31('0x30')]['id'],'type':_0x1f31('0x61'),'ToUserId':_0x459748['id']};_0x42c6b9[_0x53edb7+_0x1f31('0x62')]=_0x18a09c['id'];_0x42c6b9[_0x53edb7+_0x1f31('0x6c')]=_0x18a09c['Interaction']['id'];_0x42c6b9[_0x1f31('0x63')+_0x53edb7+_0x2aa1c0+'Id']=_0x18a09c[_0x1f31('0x5b')]['id'];return db[_0x53edb7+_0x1f31('0x6d')]['create'](_0x42c6b9);})[_0x1f31('0x1b')](function(){return respondWithRpcPromise(_0x1f31('0x6e'),{'channel':_0x41798a,'interaction':_0x18a09c[_0x1f31('0x5e')],'message':_0x18a09c,'account':_0x18a09c[_0x1f31('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x459748[_0x1f31('0xf')]+','+(_0x18a09c[_0x1f31('0x5b')][_0x1f31('0x6f')]||0x12c),'interval':_0x1f31('0x65')}]},routingClient);})[_0x1f31('0x1b')](respondWithResult(_0x4e3cca,null))['catch'](handleError(_0x4e3cca,null));}; \ No newline at end of file +var _0xda75=['moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','merge','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','body','interaction','user','MemberReport','findAll','length','format','findOrCreate','interface','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','internal','AgentCapacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','From','TransferReport','Start','Account','queue','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','agent','Agent\x20not\x20found','MessageId','create','agentTransferTimeout','bluebird'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xda75,0x1c7));var _0x5da7=function(_0x2ae88b,_0x502006){_0x2ae88b=_0x2ae88b-0x0;var _0x3b4288=_0xda75[_0x2ae88b];return _0x3b4288;};'use strict';var BPromise=require(_0x5da7('0x0'));var moment=require(_0x5da7('0x1'));var _=require('lodash');var util=require(_0x5da7('0x2'));var db=require(_0x5da7('0x3'))['db'];var logger=require(_0x5da7('0x4'))(_0x5da7('0x5'));var jayson=require(_0x5da7('0x6'));var amiClient=jayson['client'][_0x5da7('0x7')]({'port':0x232a});var mailClient=jayson[_0x5da7('0x8')][_0x5da7('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x5da7('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a5925,_0x51b376,_0x49abae){return new BPromise(function(_0x2a387b,_0x27bbd1){var _0x4f9993=_0x49abae?_0x49abae:amiClient;return _0x4f9993[_0x5da7('0x9')](_0x1a5925,_0x51b376)['then'](function(_0x29e76d){if(_0x29e76d[_0x5da7('0xa')]){if(_0x29e76d['error'][_0x5da7('0xb')]===0x1f4){return _0x27bbd1(_0x29e76d[_0x5da7('0xa')][_0x5da7('0xc')]);}return _0x2a387b(_0x29e76d[_0x5da7('0xa')][_0x5da7('0xc')]);}else{_0x2a387b(_0x29e76d['result']);}})[_0x5da7('0xd')](function(_0x255641){_0x27bbd1(_0x255641);});});}function respondWithResult(_0x406e94,_0x3eb6c7){_0x3eb6c7=_0x3eb6c7||0xc8;return function(_0x6fb549){if(_0x6fb549){return _0x406e94['status'](_0x3eb6c7)[_0x5da7('0xe')](_0x6fb549);}return _0x406e94[_0x5da7('0xf')](0x194);};}function handleError(_0x54c0a8,_0xedb6ac){_0xedb6ac=_0xedb6ac||0x1f4;return function(_0x2935cf){logger['error'](_0x2935cf[_0x5da7('0x10')]);if(_0x2935cf[_0x5da7('0x11')]){delete _0x2935cf[_0x5da7('0x11')];}_0x54c0a8[_0x5da7('0x12')](_0xedb6ac)['send'](_0x2935cf);};}function findById(_0x13a103){return function(_0x32c236){if(!_['isNil'](_0x13a103)&&!_[_0x5da7('0x13')](_0x32c236)&&!_[_0x5da7('0x13')](_0x32c236[_0x5da7('0x14')])){return _[_0x5da7('0x15')](_0x32c236[_0x5da7('0x14')],function(_0x3eb1ca){return _0x3eb1ca['id']==_0x13a103;});}return null;};}exports['voiceChannels']=function(_0x5465c5,_0x5d36dc){return respondWithRpcPromise(_0x5da7('0x16'),_0x5465c5['query'])[_0x5da7('0x17')](respondWithResult(_0x5d36dc,null))[_0x5da7('0xd')](handleError(_0x5d36dc,null));};exports[_0x5da7('0x18')]=function(_0x37eebe,_0x1e2a9c){return respondWithRpcPromise(_0x5da7('0x19'),_['merge'](_0x37eebe[_0x5da7('0x1a')],_0x37eebe[_0x5da7('0x1b')]))['then'](respondWithResult(_0x1e2a9c,null))[_0x5da7('0xd')](handleError(_0x1e2a9c,null));};exports[_0x5da7('0x1c')]=function(_0x1262cd,_0x182f42){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x1262cd['query'],_0x1262cd[_0x5da7('0x1b')]))[_0x5da7('0x17')](respondWithResult(_0x182f42,null))[_0x5da7('0xd')](handleError(_0x182f42,null));};exports[_0x5da7('0x1d')]=function(_0x2513bb,_0xacffec){return respondWithRpcPromise(_0x5da7('0x1e'),_0x2513bb[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0xacffec,null))[_0x5da7('0xd')](handleError(_0xacffec,null));};exports[_0x5da7('0x1f')]=function(_0x6f93b4,_0x4f3e77){return respondWithRpcPromise('VoiceQueues',_0x6f93b4['query'])['then'](findById(_0x6f93b4[_0x5da7('0x1b')]['id']))['then'](respondWithResult(_0x4f3e77,null))[_0x5da7('0xd')](handleError(_0x4f3e77,null));};exports[_0x5da7('0x20')]=function(_0x3f31e8,_0x5ef722){return respondWithRpcPromise(_0x5da7('0x21'),_['merge'](_0x3f31e8['query'],_0x3f31e8[_0x5da7('0x1b')]))[_0x5da7('0x17')](respondWithResult(_0x5ef722,null))['catch'](handleError(_0x5ef722,null));};exports[_0x5da7('0x22')]=function(_0xad293c,_0x20a424){return respondWithRpcPromise('VoiceQueuesChannels',_0xad293c[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x20a424,null))['catch'](handleError(_0x20a424,null));};exports[_0x5da7('0x23')]=function(_0x314f73,_0x59779e){return respondWithRpcPromise(_0x5da7('0x24'),_[_0x5da7('0x25')](_0x314f73[_0x5da7('0x1a')],_0x314f73['params']))[_0x5da7('0x17')](respondWithResult(_0x59779e,null))[_0x5da7('0xd')](handleError(_0x59779e,null));};exports['voiceQueuesChannelHangup']=function(_0x311301,_0x510f40){return respondWithRpcPromise(_0x5da7('0x26'),_['merge'](_0x311301['query'],_0x311301[_0x5da7('0x1b')]))[_0x5da7('0x17')](respondWithResult(_0x510f40,null))[_0x5da7('0xd')](handleError(_0x510f40,null));};exports[_0x5da7('0x27')]=function(_0x4bb286,_0x51ce6b){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x5da7('0x25')](_0x4bb286[_0x5da7('0x1a')],_0x4bb286['params']))[_0x5da7('0x17')](respondWithResult(_0x51ce6b,null))['catch'](handleError(_0x51ce6b,null));};exports['outbound']=function(_0x2cb17e,_0x1d7ba3){return respondWithRpcPromise(_0x5da7('0x28'),_0x2cb17e[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x1d7ba3,null))[_0x5da7('0xd')](handleError(_0x1d7ba3,null));};exports[_0x5da7('0x29')]=function(_0x2351b8,_0x30195e){return respondWithRpcPromise(_0x5da7('0x2a'),_0x2351b8[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x30195e,null))[_0x5da7('0xd')](handleError(_0x30195e,null));};exports[_0x5da7('0x2b')]=function(_0x2642ef,_0x494f81){var _0x11c183;return respondWithRpcPromise('Agents',_0x2642ef[_0x5da7('0x1a')])[_0x5da7('0x17')](function(_0x14495c){_0x11c183=_0x14495c;return respondWithRpcPromise('Agents',_0x2642ef[_0x5da7('0x1a')],routingClient);})[_0x5da7('0x17')](function(_0x52565d){return _[_0x5da7('0x25')]({},_0x52565d,_0x11c183);})[_0x5da7('0x17')](respondWithResult(_0x494f81,null))[_0x5da7('0xd')](handleError(_0x494f81,null));};exports['agentCapacity']=function(_0x5cf56a,_0x3d67ef){if(_0x5cf56a[_0x5da7('0x2c')]&&_0x5cf56a[_0x5da7('0x2c')][_0x5da7('0x2d')]&&_0x5cf56a[_0x5da7('0x2e')]&&_0x5cf56a[_0x5da7('0x2e')]['name']){for(var _0x115dab in _0x5cf56a['body'][_0x5da7('0x2d')]){if(_0x5cf56a['body']['interaction']['hasOwnProperty'](_0x115dab)){db[_0x5da7('0x2f')][_0x5da7('0x30')]({'where':{'channel':_0x115dab,'membername':_0x5cf56a['user'][_0x5da7('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x5cf56a[_0x5da7('0x2c')][_0x5da7('0x2d')][_0x115dab]&&_0x5cf56a[_0x5da7('0x2c')][_0x5da7('0x2d')][_0x115dab][_0x5da7('0x31')]?{'$notIn':_0x5cf56a[_0x5da7('0x2c')][_0x5da7('0x2d')][_0x115dab]}:{'$ne':null}}})[_0x5da7('0x17')](function(_0x5d9463){var _0x3be876=moment()[_0x5da7('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3117a8=0x0,_0x21841d=_0x5d9463[_0x5da7('0x31')];_0x3117a8<_0x21841d;_0x3117a8+=0x1){_0x5d9463[_0x3117a8]['updateAttributes']({'exitAt':_0x3be876});}});for(var _0x708e06=0x0;_0x708e06<_0x5cf56a['body'][_0x5da7('0x2d')][_0x115dab][_0x5da7('0x31')];_0x708e06+=0x1){db['MemberReport'][_0x5da7('0x33')]({'where':{'channel':_0x115dab,'membername':_0x5cf56a[_0x5da7('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x5cf56a['body'][_0x5da7('0x2d')][_0x115dab][_0x708e06],'exitAt':null},'defaults':{'channel':_0x115dab,'membername':_0x5cf56a[_0x5da7('0x2e')][_0x5da7('0x11')],'interface':_[_0x5da7('0x13')](_0x5cf56a['user'][_0x5da7('0x34')])?util[_0x5da7('0x32')](_0x5da7('0x35'),_0x5cf56a[_0x5da7('0x2e')][_0x5da7('0x11')]):_0x5cf56a[_0x5da7('0x2e')][_0x5da7('0x34')],'type':_0x5da7('0x36'),'enterAt':moment()[_0x5da7('0x32')](_0x5da7('0x37')),'role':'agent','internal':_0x5cf56a[_0x5da7('0x2e')][_0x5da7('0x38')],'uniqueid':_0x5cf56a['body'][_0x5da7('0x2d')][_0x115dab][_0x708e06]}});}}}}return respondWithRpcPromise(_0x5da7('0x39'),{'id':_0x5cf56a[_0x5da7('0x1b')]['id'],'capacity':_0x5cf56a[_0x5da7('0x2c')]['capacity']},routingClient)['then'](respondWithResult(_0x3d67ef,null))['catch'](handleError(_0x3d67ef,null));};exports[_0x5da7('0x3a')]=function(_0x2e108c,_0x5f59d7){return respondWithRpcPromise('Telephones',_0x2e108c[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x5f59d7,null))[_0x5da7('0xd')](handleError(_0x5f59d7,null));};exports[_0x5da7('0x3b')]=function(_0x37db3f,_0x282f3e){return respondWithRpcPromise('Trunks',_0x37db3f[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x282f3e,null))[_0x5da7('0xd')](handleError(_0x282f3e,null));};exports[_0x5da7('0x3c')]=function(_0x4da22e,_0x59f089){return respondWithRpcPromise(_0x5da7('0x3d'),_0x4da22e[_0x5da7('0x1a')])[_0x5da7('0x17')](respondWithResult(_0x59f089,null))[_0x5da7('0xd')](handleError(_0x59f089,null));};exports[_0x5da7('0x3e')]=function(_0x2cb178,_0x34bd80){return respondWithRpcPromise(_0x5da7('0x3f'),_0x2cb178[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](respondWithResult(_0x34bd80,null))[_0x5da7('0xd')](handleError(_0x34bd80,null));};exports[_0x5da7('0x40')]=function(_0x47b2e5,_0x1f0b26){return respondWithRpcPromise(_0x5da7('0x3f'),_0x47b2e5[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](findById(_0x47b2e5[_0x5da7('0x1b')]['id']))[_0x5da7('0x17')](respondWithResult(_0x1f0b26,null))[_0x5da7('0xd')](handleError(_0x1f0b26,null));};exports[_0x5da7('0x41')]=function(_0x55a1e3,_0x1a9a4a){return respondWithRpcPromise(_0x5da7('0x42'),_0x55a1e3[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](respondWithResult(_0x1a9a4a,null))[_0x5da7('0xd')](handleError(_0x1a9a4a,null));};exports[_0x5da7('0x43')]=function(_0x45a92f,_0x4aa853){return respondWithRpcPromise(_0x5da7('0x42'),_0x45a92f['query'],routingClient)[_0x5da7('0x17')](findById(_0x45a92f[_0x5da7('0x1b')]['id']))[_0x5da7('0x17')](respondWithResult(_0x4aa853,null))['catch'](handleError(_0x4aa853,null));};exports[_0x5da7('0x44')]=function(_0x340192,_0x570a9c){return respondWithRpcPromise(_0x5da7('0x45'),_0x340192[_0x5da7('0x1a')],mailClient)[_0x5da7('0x17')](respondWithResult(_0x570a9c,null))[_0x5da7('0xd')](handleError(_0x570a9c,null));};exports['openchannelQueues']=function(_0x169ae3,_0x704b8d){return respondWithRpcPromise(_0x5da7('0x46'),_0x169ae3['query'],routingClient)['then'](respondWithResult(_0x704b8d,null))[_0x5da7('0xd')](handleError(_0x704b8d,null));};exports[_0x5da7('0x47')]=function(_0xd1ae93,_0x158605){return respondWithRpcPromise('OpenchannelQueues',_0xd1ae93[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](findById(_0xd1ae93[_0x5da7('0x1b')]['id']))[_0x5da7('0x17')](respondWithResult(_0x158605,null))[_0x5da7('0xd')](handleError(_0x158605,null));};exports['smsQueues']=function(_0x50adcb,_0x357251){return respondWithRpcPromise(_0x5da7('0x48'),_0x50adcb[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](respondWithResult(_0x357251,null))[_0x5da7('0xd')](handleError(_0x357251,null));};exports[_0x5da7('0x49')]=function(_0x590dc2,_0xf45084){return respondWithRpcPromise(_0x5da7('0x48'),_0x590dc2[_0x5da7('0x1a')],routingClient)['then'](findById(_0x590dc2[_0x5da7('0x1b')]['id']))[_0x5da7('0x17')](respondWithResult(_0xf45084,null))['catch'](handleError(_0xf45084,null));};exports[_0x5da7('0x4a')]=function(_0x5d2bf,_0x746f15){return respondWithRpcPromise(_0x5da7('0x4b'),_0x5d2bf[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](respondWithResult(_0x746f15,null))['catch'](handleError(_0x746f15,null));};exports['showFaxQueues']=function(_0x9867a3,_0x2a86f7){return respondWithRpcPromise(_0x5da7('0x4b'),_0x9867a3['query'],routingClient)[_0x5da7('0x17')](findById(_0x9867a3['params']['id']))['then'](respondWithResult(_0x2a86f7,null))[_0x5da7('0xd')](handleError(_0x2a86f7,null));};exports[_0x5da7('0x4c')]=function(_0x3c2b34,_0x289aa6){return respondWithRpcPromise(_0x5da7('0x4d'),_0x3c2b34['query'])[_0x5da7('0x17')](respondWithResult(_0x289aa6,null))[_0x5da7('0xd')](handleError(_0x289aa6,null));};exports[_0x5da7('0x4e')]=function(_0x55133a,_0x413a44){return respondWithRpcPromise(_0x5da7('0x4f'),_0x55133a['query'],routingClient)[_0x5da7('0x17')](respondWithResult(_0x413a44,null))[_0x5da7('0xd')](handleError(_0x413a44,null));};exports[_0x5da7('0x50')]=function(_0x37df07,_0x154e75){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x37df07['query'],routingClient)['then'](respondWithResult(_0x154e75,null))[_0x5da7('0xd')](handleError(_0x154e75,null));};exports[_0x5da7('0x51')]=function(_0x2fc588,_0x1b0b92){return respondWithRpcPromise(_0x5da7('0x52'),_0x2fc588[_0x5da7('0x1a')],routingClient)['then'](respondWithResult(_0x1b0b92,null))['catch'](handleError(_0x1b0b92,null));};exports[_0x5da7('0x53')]=function(_0x19108a,_0xe14aea){return respondWithRpcPromise(_0x5da7('0x54'),_0x19108a[_0x5da7('0x1a')],routingClient)[_0x5da7('0x17')](respondWithResult(_0xe14aea,null))['catch'](handleError(_0xe14aea,null));};exports[_0x5da7('0x55')]=function(_0x23728d,_0x46e4ea){return respondWithRpcPromise(_0x5da7('0x56'),_0x23728d[_0x5da7('0x1a')],routingClient)['then'](respondWithResult(_0x46e4ea,null))[_0x5da7('0xd')](handleError(_0x46e4ea,null));};exports[_0x5da7('0x57')]=function(_0x1af660){return function(_0x19ee32,_0x3b60f3){var _0x2c0208,_0x40862d;var _0x533051=_[_0x5da7('0x58')](_0x1af660);var _0x46f953=_0x1af660===_0x5da7('0x59')?_0x5da7('0x5a'):'Account';return db[_0x533051+_0x5da7('0x5b')][_0x5da7('0x5c')]({'raw':!![],'where':{'id':_0x19ee32['params']['id']}})['then'](function(_0x303ceb){if(_[_0x5da7('0x13')](_0x303ceb)){throw new Error(_0x533051+_0x5da7('0x5d'));}_0x2c0208=_0x303ceb;return db[_0x533051+_0x5da7('0x5e')][_0x5da7('0x5c')]({'where':{'id':_0x19ee32[_0x5da7('0x2c')][_0x5da7('0x5f')]},'include':[{'model':db[_0x533051+_0x5da7('0x60')],'as':'Interaction'},{'model':db[_0x533051+_0x46f953],'as':'Account'}]});})['then'](function(_0xfef853){if(_[_0x5da7('0x13')](_0xfef853)){throw new Error(_0x533051+_0x5da7('0x61'));}_0x40862d=_0xfef853;return _0xfef853[_0x5da7('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5da7('0x17')](function(){var _0x57b328={'uniqueid':_0x1af660+'.'+_0x40862d['id']+'.'+_0x40862d['Interaction']['id'],'FromUserId':_0x19ee32[_0x5da7('0x2e')]['id'],'type':'queue'};_0x57b328[_0x533051+'MessageId']=_0x40862d['id'];_0x57b328[_0x533051+_0x5da7('0x63')]=_0x40862d[_0x5da7('0x60')]['id'];_0x57b328[_0x5da7('0x64')+_0x533051+_0x46f953+'Id']=_0x40862d['Account']['id'];_0x57b328['To'+_0x533051+'QueueId']=_0x2c0208['id'];return db[_0x533051+_0x5da7('0x65')]['create'](_0x57b328);})[_0x5da7('0x17')](function(){return respondWithRpcPromise(_0x5da7('0x66'),{'channel':_0x1af660,'interaction':_0x40862d[_0x5da7('0x60')],'message':_0x40862d,'account':_0x40862d[_0x5da7('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5da7('0x68'),'appdata':_0x2c0208[_0x5da7('0x11')]+','+(_0x40862d[_0x5da7('0x67')]['queueTransferTimeout']||0x12c),'interval':_0x5da7('0x69')}]},routingClient);})[_0x5da7('0x17')](respondWithResult(_0x3b60f3,null))[_0x5da7('0xd')](handleError(_0x3b60f3,null));};};exports[_0x5da7('0x6a')]=function(_0x12d50b,_0x3662ac){var _0x13df4a,_0x121b84;if(_[_0x5da7('0x13')](_0x12d50b[_0x5da7('0x2c')][_0x5da7('0x6b')])){throw new Error(_0x5da7('0x6c'));}var _0x4c74fa=_0x12d50b[_0x5da7('0x2c')][_0x5da7('0x6b')];var _0x21191e=_[_0x5da7('0x58')](_0x4c74fa);var _0x38cc9c=_0x4c74fa==='chat'?'Website':_0x5da7('0x67');return db['User']['findOne']({'raw':!![],'where':{'id':_0x12d50b['params']['id'],'role':_0x5da7('0x6d')}})['then'](function(_0x46b616){if(_['isNil'](_0x46b616)){throw new Error(_0x5da7('0x6e'));}_0x13df4a=_0x46b616;return db[_0x21191e+_0x5da7('0x5e')][_0x5da7('0x5c')]({'where':{'id':_0x12d50b[_0x5da7('0x2c')][_0x5da7('0x5f')]},'include':[{'model':db[_0x21191e+_0x5da7('0x60')],'as':_0x5da7('0x60')},{'model':db[_0x21191e+_0x38cc9c],'as':_0x5da7('0x67')}]});})[_0x5da7('0x17')](function(_0x5f05ca){if(_[_0x5da7('0x13')](_0x5f05ca)){throw new Error(_0x21191e+'\x20Message\x20not\x20found');}_0x121b84=_0x5f05ca;return _0x5f05ca[_0x5da7('0x62')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x205638={'uniqueid':_0x4c74fa+'.'+_0x121b84['id']+'.'+_0x121b84[_0x5da7('0x60')]['id'],'FromUserId':_0x12d50b[_0x5da7('0x2e')]['id'],'type':_0x5da7('0x68'),'ToUserId':_0x13df4a['id']};_0x205638[_0x21191e+_0x5da7('0x6f')]=_0x121b84['id'];_0x205638[_0x21191e+_0x5da7('0x63')]=_0x121b84[_0x5da7('0x60')]['id'];_0x205638['From'+_0x21191e+_0x38cc9c+'Id']=_0x121b84['Account']['id'];return db[_0x21191e+_0x5da7('0x65')][_0x5da7('0x70')](_0x205638);})[_0x5da7('0x17')](function(){return respondWithRpcPromise(_0x5da7('0x66'),{'channel':_0x4c74fa,'interaction':_0x121b84[_0x5da7('0x60')],'message':_0x121b84,'account':_0x121b84['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x5da7('0x6d'),'appdata':_0x13df4a[_0x5da7('0x11')]+','+(_0x121b84[_0x5da7('0x67')][_0x5da7('0x71')]||0x12c),'interval':_0x5da7('0x69')}]},routingClient);})[_0x5da7('0x17')](respondWithResult(_0x3662ac,null))[_0x5da7('0xd')](handleError(_0x3662ac,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9ad0049..fa59e46 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 _0xc370=['post','create','put','update','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run'];(function(_0x2ca435,_0x18bb46){var _0x56f7a4=function(_0x4be4e1){while(--_0x4be4e1){_0x2ca435['push'](_0x2ca435['shift']());}};_0x56f7a4(++_0x18bb46);}(_0xc370,0x123));var _0x0c37=function(_0xae5724,_0x503b9d){_0xae5724=_0xae5724-0x0;var _0x33051c=_0xc370[_0xae5724];return _0x33051c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c37('0x0'));var router=express[_0x0c37('0x1')]();var auth=require(_0x0c37('0x2'));var interaction=require(_0x0c37('0x3'));var config=require(_0x0c37('0x4'));var controller=require(_0x0c37('0x5'));router[_0x0c37('0x6')]('/',auth[_0x0c37('0x7')](),controller[_0x0c37('0x8')]);router[_0x0c37('0x6')](_0x0c37('0x9'),auth[_0x0c37('0x7')](),controller[_0x0c37('0xa')]);router[_0x0c37('0x6')](_0x0c37('0xb'),auth[_0x0c37('0x7')](),controller[_0x0c37('0xc')]);router[_0x0c37('0xd')]('/',auth['isAuthenticated'](),controller[_0x0c37('0xe')]);router[_0x0c37('0xf')](_0x0c37('0x9'),auth[_0x0c37('0x7')](),controller[_0x0c37('0x10')]);router[_0x0c37('0x11')](_0x0c37('0x9'),auth[_0x0c37('0x7')](),controller['destroy']);module[_0x0c37('0x12')]=router; \ No newline at end of file +var _0x4eac=['../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','destroy','exports','util','connect-timeout'];(function(_0xf9248c,_0x96b359){var _0x3bd1b3=function(_0xa25404){while(--_0xa25404){_0xf9248c['push'](_0xf9248c['shift']());}};_0x3bd1b3(++_0x96b359);}(_0x4eac,0x194));var _0xc4ea=function(_0x1364dd,_0x514994){_0x1364dd=_0x1364dd-0x0;var _0x15795d=_0x4eac[_0x1364dd];return _0x15795d;};'use strict';var multer=require('multer');var util=require(_0xc4ea('0x0'));var path=require('path');var timeout=require(_0xc4ea('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc4ea('0x2'));var controller=require(_0xc4ea('0x3'));router[_0xc4ea('0x4')]('/',auth['isAuthenticated'](),controller[_0xc4ea('0x5')]);router['get'](_0xc4ea('0x6'),auth[_0xc4ea('0x7')](),controller[_0xc4ea('0x8')]);router[_0xc4ea('0x4')](_0xc4ea('0x9'),auth[_0xc4ea('0x7')](),controller[_0xc4ea('0xa')]);router[_0xc4ea('0xb')]('/',auth[_0xc4ea('0x7')](),controller['create']);router['put'](_0xc4ea('0x6'),auth[_0xc4ea('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc4ea('0xc')]);module[_0xc4ea('0xd')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 8c7ad22..716e993 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 _0xa9a2=['sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','weeks','days','minutes','ENUM','csv','pdf','xlsx','default','TEXT'];(function(_0x505522,_0x267f5f){var _0x1e6cab=function(_0x24835a){while(--_0x24835a){_0x505522['push'](_0x505522['shift']());}};_0x1e6cab(++_0x267f5f);}(_0xa9a2,0x1ba));var _0x2a9a=function(_0x1a7706,_0x108c9a){_0x1a7706=_0x1a7706-0x0;var _0x4b89a6=_0xa9a2[_0x1a7706];return _0x4b89a6;};'use strict';var Sequelize=require(_0x2a9a('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a9a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2a9a('0x1')]},'active':{'type':Sequelize[_0x2a9a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2a9a('0x1')],'allowNull':![],'defaultValue':_0x2a9a('0x3')},'startAt':{'type':Sequelize[_0x2a9a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2a9a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2a9a('0x6'),_0x2a9a('0x7'),'months',_0x2a9a('0x8'),_0x2a9a('0x9'),'hours',_0x2a9a('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x2a9a('0xb')](_0x2a9a('0xc'),_0x2a9a('0xd'),_0x2a9a('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2a9a('0xb')]('custom',_0x2a9a('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x2a9a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2a9a('0x1')]},'cc':{'type':Sequelize[_0x2a9a('0x10')]},'bcc':{'type':Sequelize[_0x2a9a('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2456=['INTEGER','quarters','months','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x2456,0x11c));var _0x6245=function(_0x5f3e53,_0x6806d2){_0x5f3e53=_0x5f3e53-0x0;var _0x33f8b1=_0x2456[_0x5f3e53];return _0x33f8b1;};'use strict';var Sequelize=require('sequelize');module[_0x6245('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6245('0x1')]},'active':{'type':Sequelize[_0x6245('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6245('0x1')],'allowNull':![],'defaultValue':_0x6245('0x3')},'startAt':{'type':Sequelize[_0x6245('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6245('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x6245('0x6'),_0x6245('0x7'),'weeks',_0x6245('0x8'),_0x6245('0x9'),_0x6245('0xa')),'allowNull':![],'defaultValue':_0x6245('0x8')},'output':{'type':Sequelize[_0x6245('0xb')](_0x6245('0xc'),_0x6245('0xd'),_0x6245('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x6245('0xb')](_0x6245('0xf'),'default'),'allowNull':![],'defaultValue':_0x6245('0xf')},'sendMail':{'type':Sequelize[_0x6245('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6245('0x1')]},'cc':{'type':Sequelize[_0x6245('0x10')]},'bcc':{'type':Sequelize[_0x6245('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x6245('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 3a2fb24..d221e71 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 _0xa618=['sort','where','pick','filter','merge','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','set','reject','save','update','then','destroy','Scheduler','UserProfileResource','sendStatus','stack','name','send','Schedule','model','keys','query','filters','attributes','length','nolimit','order'];(function(_0x216450,_0x5d25aa){var _0x105a05=function(_0x5fa8e2){while(--_0x5fa8e2){_0x216450['push'](_0x216450['shift']());}};_0x105a05(++_0x5d25aa);}(_0xa618,0xc1));var _0x8a61=function(_0x26b48d,_0x2655da){_0x26b48d=_0x26b48d-0x0;var _0x4e7a2e=_0xa618[_0x26b48d];return _0x4e7a2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8a61('0x0'));var rimraf=require(_0x8a61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a61('0x2'));var rp=require(_0x8a61('0x3'));var moment=require(_0x8a61('0x4'));var BPromise=require(_0x8a61('0x5'));var Mustache=require(_0x8a61('0x6'));var util=require(_0x8a61('0x7'));var path=require(_0x8a61('0x8'));var sox=require(_0x8a61('0x9'));var csv=require(_0x8a61('0xa'));var ejs=require(_0x8a61('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a61('0xc'));var jsforce=require(_0x8a61('0xd'));var deskjs=require(_0x8a61('0xe'));var toCsv=require(_0x8a61('0xa'));var querystring=require(_0x8a61('0xf'));var Papa=require(_0x8a61('0x10'));var authService=require(_0x8a61('0x11'));var hardwareService=require(_0x8a61('0x12'));var Redis=require(_0x8a61('0x13'));var qs=require(_0x8a61('0x14'));var logger=require(_0x8a61('0x15'))(_0x8a61('0x16'));var utils=require(_0x8a61('0x17'));var config=require(_0x8a61('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55aded,_0x3913f3){_0x3913f3=_0x3913f3||0xcc;return function(_0x3c0041){if(_0x3c0041){return _0x55aded['sendStatus'](_0x3913f3);}return _0x55aded[_0x8a61('0x19')](_0x3913f3)[_0x8a61('0x1a')]();};}function respondWithResult(_0x6f2439,_0x463169){_0x463169=_0x463169||0xc8;return function(_0x587601){if(_0x587601){return _0x6f2439[_0x8a61('0x19')](_0x463169)['json'](_0x587601);}};}function respondWithFilteredResult(_0xbd6311,_0x2be15c){return function(_0xbc41fd){if(_0xbc41fd){var _0x354efc=_0xbc41fd['count'],_0x442ec1=_0x2be15c[_0x8a61('0x1b')],_0x4971fa=_0x2be15c['offset']+_0x2be15c[_0x8a61('0x1c')],_0x35bc4a;if(_0x4971fa>=_0x354efc){_0x4971fa=_0x354efc;_0x35bc4a=0xc8;}else{_0x35bc4a=0xce;}_0xbd6311[_0x8a61('0x19')](_0x35bc4a);return _0xbd6311[_0x8a61('0x1d')]('Content-Range',_0x442ec1+'-'+_0x4971fa+'/'+_0x354efc)['json'](_0xbc41fd);}return null;};}function patchUpdates(_0x58f926){return function(_0xd04232){try{jsonpatch['apply'](_0xd04232,_0x58f926,!![]);}catch(_0x2f9992){return BPromise[_0x8a61('0x1e')](_0x2f9992);}return _0xd04232[_0x8a61('0x1f')]();};}function saveUpdates(_0x1ae227,_0x4cc698){return function(_0x2358e1){if(_0x2358e1){return _0x2358e1[_0x8a61('0x20')](_0x1ae227)[_0x8a61('0x21')](function(_0x1e194c){return _0x1e194c;});}return null;};}function removeEntity(_0x34c3f6,_0x17e980){return function(_0x111604){if(_0x111604){return _0x111604[_0x8a61('0x22')]()['then'](function(){var _0x5413f1=_0x111604['get']({'plain':!![]});var _0x38c756=_0x8a61('0x23');return db[_0x8a61('0x24')]['destroy']({'where':{'type':_0x38c756,'resourceId':_0x5413f1['id']}})[_0x8a61('0x21')](function(){return _0x111604;});})[_0x8a61('0x21')](function(){_0x34c3f6[_0x8a61('0x19')](0xcc)[_0x8a61('0x1a')]();});}};}function handleEntityNotFound(_0x40670e,_0x46580f){return function(_0x40bb7d){if(!_0x40bb7d){_0x40670e[_0x8a61('0x25')](0x194);}return _0x40bb7d;};}function handleError(_0x5a3219,_0x3a8aaa){_0x3a8aaa=_0x3a8aaa||0x1f4;return function(_0xc0d234){logger['error'](_0xc0d234[_0x8a61('0x26')]);if(_0xc0d234[_0x8a61('0x27')]){delete _0xc0d234['name'];}_0x5a3219['status'](_0x3a8aaa)[_0x8a61('0x28')](_0xc0d234);};}exports['index']=function(_0x589c7a,_0x191bd1){var _0x609933={},_0x3918cb={},_0x5c1a71={'count':0x0,'rows':[]};var _0x27a918=db[_0x8a61('0x29')]['rawAttributes'];_0x3918cb[_0x8a61('0x2a')]=_[_0x8a61('0x2b')](_0x27a918);_0x3918cb['query']=_[_0x8a61('0x2b')](_0x589c7a[_0x8a61('0x2c')]);_0x3918cb[_0x8a61('0x2d')]=_['intersection'](_0x3918cb[_0x8a61('0x2a')],_0x3918cb[_0x8a61('0x2c')]);_0x609933['attributes']=_['intersection'](_0x3918cb[_0x8a61('0x2a')],qs['fields'](_0x589c7a['query']['fields']));_0x609933['attributes']=_0x609933[_0x8a61('0x2e')][_0x8a61('0x2f')]?_0x609933['attributes']:_0x3918cb[_0x8a61('0x2a')];if(!_0x589c7a['query']['hasOwnProperty'](_0x8a61('0x30'))){_0x609933['limit']=qs['limit'](_0x589c7a[_0x8a61('0x2c')]['limit']);_0x609933[_0x8a61('0x1b')]=qs[_0x8a61('0x1b')](_0x589c7a['query'][_0x8a61('0x1b')]);}_0x609933[_0x8a61('0x31')]=qs[_0x8a61('0x32')](_0x589c7a[_0x8a61('0x2c')]['sort']);_0x609933[_0x8a61('0x33')]=qs[_0x8a61('0x2d')](_[_0x8a61('0x34')](_0x589c7a[_0x8a61('0x2c')],_0x3918cb[_0x8a61('0x2d')]));if(_0x589c7a[_0x8a61('0x2c')][_0x8a61('0x35')]){_0x609933[_0x8a61('0x33')]=_[_0x8a61('0x36')](_0x609933[_0x8a61('0x33')],{'$or':_['map'](_0x27a918,function(_0x477f94){if(_0x477f94[_0x8a61('0x37')][_0x8a61('0x38')]!==_0x8a61('0x39')){var _0x167a94={};_0x167a94[_0x477f94['field']]={'$like':'%'+_0x589c7a[_0x8a61('0x2c')][_0x8a61('0x35')]+'%'};return _0x167a94;}})});}_0x609933=_['merge']({},_0x609933,_0x589c7a[_0x8a61('0x3a')]);var _0x31b6f7={'where':_0x609933[_0x8a61('0x33')]};return db[_0x8a61('0x29')][_0x8a61('0x3b')](_0x31b6f7)['then'](function(_0x832a10){_0x5c1a71[_0x8a61('0x3b')]=_0x832a10;if(_0x589c7a[_0x8a61('0x2c')][_0x8a61('0x3c')]){_0x609933[_0x8a61('0x3d')]=[{'all':!![]}];}return db[_0x8a61('0x29')][_0x8a61('0x3e')](_0x609933);})['then'](function(_0x220bfd){_0x5c1a71[_0x8a61('0x3f')]=_0x220bfd;return _0x5c1a71;})['then'](respondWithFilteredResult(_0x191bd1,_0x609933))[_0x8a61('0x40')](handleError(_0x191bd1,null));};exports['show']=function(_0x362162,_0x3bfa14){var _0x5ea70e={'raw':![],'where':{'id':_0x362162['params']['id']}},_0x666cae={};_0x666cae[_0x8a61('0x2a')]=_[_0x8a61('0x2b')](db[_0x8a61('0x29')][_0x8a61('0x41')]);_0x666cae[_0x8a61('0x2c')]=_[_0x8a61('0x2b')](_0x362162[_0x8a61('0x2c')]);_0x666cae[_0x8a61('0x2d')]=_[_0x8a61('0x42')](_0x666cae['model'],_0x666cae['query']);_0x5ea70e[_0x8a61('0x2e')]=_['intersection'](_0x666cae[_0x8a61('0x2a')],qs['fields'](_0x362162['query']['fields']));_0x5ea70e['attributes']=_0x5ea70e[_0x8a61('0x2e')][_0x8a61('0x2f')]?_0x5ea70e[_0x8a61('0x2e')]:_0x666cae[_0x8a61('0x2a')];if(_0x362162['query'][_0x8a61('0x3c')]){_0x5ea70e[_0x8a61('0x3d')]=[{'all':!![]}];}_0x5ea70e=_[_0x8a61('0x36')]({},_0x5ea70e,_0x362162[_0x8a61('0x3a')]);return db[_0x8a61('0x29')][_0x8a61('0x43')](_0x5ea70e)[_0x8a61('0x21')](handleEntityNotFound(_0x3bfa14,null))[_0x8a61('0x21')](respondWithResult(_0x3bfa14,null))[_0x8a61('0x40')](handleError(_0x3bfa14,null));};exports[_0x8a61('0x44')]=function(_0x4994fc,_0x4bf2c0){return db[_0x8a61('0x29')][_0x8a61('0x44')](_0x4994fc[_0x8a61('0x45')],{})[_0x8a61('0x21')](function(_0x150502){var _0x1d3cd7=_0x4994fc[_0x8a61('0x46')]['get']({'plain':!![]});if(!_0x1d3cd7)throw new Error(_0x8a61('0x47'));if(_0x1d3cd7[_0x8a61('0x48')]===_0x8a61('0x46')){var _0x566b5d=_0x150502[_0x8a61('0x49')]({'plain':!![]});var _0xfcbdf='Scheduler';return db[_0x8a61('0x4a')][_0x8a61('0x43')]({'where':{'name':_0xfcbdf,'userProfileId':_0x1d3cd7[_0x8a61('0x4b')]},'raw':!![]})[_0x8a61('0x21')](function(_0x273dbf){if(_0x273dbf&&_0x273dbf['autoAssociation']===0x0){return db[_0x8a61('0x24')]['create']({'name':_0x566b5d[_0x8a61('0x27')],'resourceId':_0x566b5d['id'],'type':_0x273dbf[_0x8a61('0x27')],'sectionId':_0x273dbf['id']},{})[_0x8a61('0x21')](function(){return _0x150502;});}else{return _0x150502;}})[_0x8a61('0x40')](function(_0x2b966c){logger[_0x8a61('0x4c')](_0x8a61('0x4d'),_0x2b966c);throw _0x2b966c;});}return _0x150502;})[_0x8a61('0x21')](respondWithResult(_0x4bf2c0,0xc9))['catch'](handleError(_0x4bf2c0,null));};exports[_0x8a61('0x20')]=function(_0xff5b3d,_0x3f086b){if(_0xff5b3d[_0x8a61('0x45')]['id']){delete _0xff5b3d['body']['id'];}return db[_0x8a61('0x29')][_0x8a61('0x43')]({'where':{'id':_0xff5b3d[_0x8a61('0x4e')]['id']}})[_0x8a61('0x21')](handleEntityNotFound(_0x3f086b,null))[_0x8a61('0x21')](saveUpdates(_0xff5b3d[_0x8a61('0x45')],null))['then'](respondWithResult(_0x3f086b,null))[_0x8a61('0x40')](handleError(_0x3f086b,null));};exports['destroy']=function(_0x116c33,_0xc8e9c5){return db[_0x8a61('0x29')]['find']({'where':{'id':_0x116c33[_0x8a61('0x4e')]['id']}})[_0x8a61('0x21')](handleEntityNotFound(_0xc8e9c5,null))[_0x8a61('0x21')](removeEntity(_0xc8e9c5,null))['catch'](handleError(_0xc8e9c5,null));};exports[_0x8a61('0x4f')]=function(_0x1946d9,_0x1b5cc3,_0x56c431){var _0x334263=require(_0x8a61('0x50'));return db['Schedule'][_0x8a61('0x43')]({'where':{'id':_0x1946d9[_0x8a61('0x4e')]['id']},'raw':!![]})[_0x8a61('0x21')](handleEntityNotFound(_0x1b5cc3,null))['then'](function(){_0x334263[_0x8a61('0x4f')](_0x1946d9[_0x8a61('0x4e')]['id']);})[_0x8a61('0x21')](respondWithStatusCode(_0x1b5cc3,null))['catch'](handleError(_0x1b5cc3,null));}; \ No newline at end of file +var _0x578d=['papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','field','filter','options','Schedule','includeAll','findAll','rows','catch','show','params','include','create','body','user','get','role','Scheduler','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x578d,0xeb));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd578('0x0'));var emlformat=require(_0xd578('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd578('0x2'));var rp=require(_0xd578('0x3'));var moment=require(_0xd578('0x4'));var BPromise=require(_0xd578('0x5'));var Mustache=require(_0xd578('0x6'));var util=require(_0xd578('0x7'));var path=require(_0xd578('0x8'));var sox=require(_0xd578('0x9'));var csv=require(_0xd578('0xa'));var ejs=require(_0xd578('0xb'));var fs=require('fs');var _=require(_0xd578('0xc'));var squel=require(_0xd578('0xd'));var crypto=require(_0xd578('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd578('0xf'));var toCsv=require(_0xd578('0xa'));var querystring=require(_0xd578('0x10'));var Papa=require(_0xd578('0x11'));var authService=require(_0xd578('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd578('0x13'));var qs=require(_0xd578('0x14'));var logger=require('../../config/logger')(_0xd578('0x15'));var utils=require(_0xd578('0x16'));var config=require(_0xd578('0x17'));var db=require(_0xd578('0x18'))['db'];function respondWithStatusCode(_0x4b0dda,_0x3042f1){_0x3042f1=_0x3042f1||0xcc;return function(_0xd0feeb){if(_0xd0feeb){return _0x4b0dda[_0xd578('0x19')](_0x3042f1);}return _0x4b0dda['status'](_0x3042f1)[_0xd578('0x1a')]();};}function respondWithResult(_0x55c484,_0x659cd4){_0x659cd4=_0x659cd4||0xc8;return function(_0x50d4c8){if(_0x50d4c8){return _0x55c484[_0xd578('0x1b')](_0x659cd4)['json'](_0x50d4c8);}};}function respondWithFilteredResult(_0x30fa5e,_0x40a72b){return function(_0x10a3e1){if(_0x10a3e1){var _0x31409d=_0x10a3e1[_0xd578('0x1c')],_0x4e84c6=_0x40a72b['offset'],_0x1118cc=_0x40a72b[_0xd578('0x1d')]+_0x40a72b[_0xd578('0x1e')],_0x174028;if(_0x1118cc>=_0x31409d){_0x1118cc=_0x31409d;_0x174028=0xc8;}else{_0x174028=0xce;}_0x30fa5e[_0xd578('0x1b')](_0x174028);return _0x30fa5e[_0xd578('0x1f')](_0xd578('0x20'),_0x4e84c6+'-'+_0x1118cc+'/'+_0x31409d)['json'](_0x10a3e1);}return null;};}function patchUpdates(_0x40e10c){return function(_0x415006){try{jsonpatch[_0xd578('0x21')](_0x415006,_0x40e10c,!![]);}catch(_0x34e647){return BPromise[_0xd578('0x22')](_0x34e647);}return _0x415006[_0xd578('0x23')]();};}function saveUpdates(_0x38b5a4,_0x159496){return function(_0x7aa768){if(_0x7aa768){return _0x7aa768[_0xd578('0x24')](_0x38b5a4)[_0xd578('0x25')](function(_0x58a4fe){return _0x58a4fe;});}return null;};}function removeEntity(_0x2132ac,_0x742c4b){return function(_0x3c69ad){if(_0x3c69ad){return _0x3c69ad[_0xd578('0x26')]()['then'](function(){var _0x5c42e3=_0x3c69ad['get']({'plain':!![]});var _0x3e823e='Scheduler';return db[_0xd578('0x27')][_0xd578('0x26')]({'where':{'type':_0x3e823e,'resourceId':_0x5c42e3['id']}})[_0xd578('0x25')](function(){return _0x3c69ad;});})[_0xd578('0x25')](function(){_0x2132ac[_0xd578('0x1b')](0xcc)[_0xd578('0x1a')]();});}};}function handleEntityNotFound(_0x47149b,_0x46b213){return function(_0xc1d825){if(!_0xc1d825){_0x47149b[_0xd578('0x19')](0x194);}return _0xc1d825;};}function handleError(_0x7d9898,_0xa20c5f){_0xa20c5f=_0xa20c5f||0x1f4;return function(_0x3aceff){logger['error'](_0x3aceff['stack']);if(_0x3aceff[_0xd578('0x28')]){delete _0x3aceff[_0xd578('0x28')];}_0x7d9898['status'](_0xa20c5f)['send'](_0x3aceff);};}exports[_0xd578('0x29')]=function(_0x1dcedb,_0x4b59f2){var _0x31da8c={},_0x1a4bb8={},_0x6a43ab={'count':0x0,'rows':[]};var _0x43cce6=db['Schedule'][_0xd578('0x2a')];_0x1a4bb8['model']=_[_0xd578('0x2b')](_0x43cce6);_0x1a4bb8['query']=_[_0xd578('0x2b')](_0x1dcedb[_0xd578('0x2c')]);_0x1a4bb8[_0xd578('0x2d')]=_[_0xd578('0x2e')](_0x1a4bb8[_0xd578('0x2f')],_0x1a4bb8['query']);_0x31da8c[_0xd578('0x30')]=_[_0xd578('0x2e')](_0x1a4bb8[_0xd578('0x2f')],qs[_0xd578('0x31')](_0x1dcedb['query'][_0xd578('0x31')]));_0x31da8c[_0xd578('0x30')]=_0x31da8c['attributes'][_0xd578('0x32')]?_0x31da8c[_0xd578('0x30')]:_0x1a4bb8[_0xd578('0x2f')];if(!_0x1dcedb[_0xd578('0x2c')][_0xd578('0x33')](_0xd578('0x34'))){_0x31da8c[_0xd578('0x1e')]=qs[_0xd578('0x1e')](_0x1dcedb[_0xd578('0x2c')][_0xd578('0x1e')]);_0x31da8c[_0xd578('0x1d')]=qs[_0xd578('0x1d')](_0x1dcedb['query']['offset']);}_0x31da8c[_0xd578('0x35')]=qs[_0xd578('0x36')](_0x1dcedb[_0xd578('0x2c')]['sort']);_0x31da8c[_0xd578('0x37')]=qs[_0xd578('0x2d')](_[_0xd578('0x38')](_0x1dcedb['query'],_0x1a4bb8['filters']));if(_0x1dcedb['query']['filter']){_0x31da8c[_0xd578('0x37')]=_[_0xd578('0x39')](_0x31da8c[_0xd578('0x37')],{'$or':_[_0xd578('0x3a')](_0x43cce6,function(_0xde2c29){if(_0xde2c29[_0xd578('0x3b')][_0xd578('0x3c')]!=='VIRTUAL'){var _0x15da58={};_0x15da58[_0xde2c29[_0xd578('0x3d')]]={'$like':'%'+_0x1dcedb['query'][_0xd578('0x3e')]+'%'};return _0x15da58;}})});}_0x31da8c=_[_0xd578('0x39')]({},_0x31da8c,_0x1dcedb[_0xd578('0x3f')]);var _0x54cf1e={'where':_0x31da8c[_0xd578('0x37')]};return db[_0xd578('0x40')]['count'](_0x54cf1e)['then'](function(_0x337a6e){_0x6a43ab[_0xd578('0x1c')]=_0x337a6e;if(_0x1dcedb['query'][_0xd578('0x41')]){_0x31da8c['include']=[{'all':!![]}];}return db[_0xd578('0x40')][_0xd578('0x42')](_0x31da8c);})[_0xd578('0x25')](function(_0x58f3ab){_0x6a43ab[_0xd578('0x43')]=_0x58f3ab;return _0x6a43ab;})[_0xd578('0x25')](respondWithFilteredResult(_0x4b59f2,_0x31da8c))[_0xd578('0x44')](handleError(_0x4b59f2,null));};exports[_0xd578('0x45')]=function(_0x426bf4,_0x5a02fc){var _0x5bc8b2={'raw':![],'where':{'id':_0x426bf4[_0xd578('0x46')]['id']}},_0x30edc8={};_0x30edc8[_0xd578('0x2f')]=_[_0xd578('0x2b')](db['Schedule'][_0xd578('0x2a')]);_0x30edc8[_0xd578('0x2c')]=_[_0xd578('0x2b')](_0x426bf4['query']);_0x30edc8[_0xd578('0x2d')]=_[_0xd578('0x2e')](_0x30edc8['model'],_0x30edc8['query']);_0x5bc8b2[_0xd578('0x30')]=_[_0xd578('0x2e')](_0x30edc8['model'],qs['fields'](_0x426bf4[_0xd578('0x2c')][_0xd578('0x31')]));_0x5bc8b2[_0xd578('0x30')]=_0x5bc8b2[_0xd578('0x30')][_0xd578('0x32')]?_0x5bc8b2[_0xd578('0x30')]:_0x30edc8['model'];if(_0x426bf4[_0xd578('0x2c')][_0xd578('0x41')]){_0x5bc8b2[_0xd578('0x47')]=[{'all':!![]}];}_0x5bc8b2=_[_0xd578('0x39')]({},_0x5bc8b2,_0x426bf4[_0xd578('0x3f')]);return db[_0xd578('0x40')]['find'](_0x5bc8b2)[_0xd578('0x25')](handleEntityNotFound(_0x5a02fc,null))[_0xd578('0x25')](respondWithResult(_0x5a02fc,null))[_0xd578('0x44')](handleError(_0x5a02fc,null));};exports['create']=function(_0x25fd1b,_0x3db65f){return db[_0xd578('0x40')][_0xd578('0x48')](_0x25fd1b[_0xd578('0x49')],{})['then'](function(_0x1654f8){var _0x33ecbe=_0x25fd1b[_0xd578('0x4a')][_0xd578('0x4b')]({'plain':!![]});if(!_0x33ecbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33ecbe[_0xd578('0x4c')]==='user'){var _0x77389a=_0x1654f8['get']({'plain':!![]});var _0xfec05d=_0xd578('0x4d');return db['UserProfileSection'][_0xd578('0x4e')]({'where':{'name':_0xfec05d,'userProfileId':_0x33ecbe['userProfileId']},'raw':!![]})[_0xd578('0x25')](function(_0x20a4d1){if(_0x20a4d1&&_0x20a4d1[_0xd578('0x4f')]===0x0){return db['UserProfileResource'][_0xd578('0x48')]({'name':_0x77389a[_0xd578('0x28')],'resourceId':_0x77389a['id'],'type':_0x20a4d1[_0xd578('0x28')],'sectionId':_0x20a4d1['id']},{})[_0xd578('0x25')](function(){return _0x1654f8;});}else{return _0x1654f8;}})[_0xd578('0x44')](function(_0x98b895){logger[_0xd578('0x50')](_0xd578('0x51'),_0x98b895);throw _0x98b895;});}return _0x1654f8;})[_0xd578('0x25')](respondWithResult(_0x3db65f,0xc9))['catch'](handleError(_0x3db65f,null));};exports[_0xd578('0x24')]=function(_0x1edb91,_0x6ebe74){if(_0x1edb91[_0xd578('0x49')]['id']){delete _0x1edb91[_0xd578('0x49')]['id'];}return db['Schedule'][_0xd578('0x4e')]({'where':{'id':_0x1edb91['params']['id']}})['then'](handleEntityNotFound(_0x6ebe74,null))[_0xd578('0x25')](saveUpdates(_0x1edb91['body'],null))[_0xd578('0x25')](respondWithResult(_0x6ebe74,null))['catch'](handleError(_0x6ebe74,null));};exports['destroy']=function(_0xf55554,_0x151988){return db[_0xd578('0x40')][_0xd578('0x4e')]({'where':{'id':_0xf55554[_0xd578('0x46')]['id']}})[_0xd578('0x25')](handleEntityNotFound(_0x151988,null))[_0xd578('0x25')](removeEntity(_0x151988,null))[_0xd578('0x44')](handleError(_0x151988,null));};exports['run']=function(_0x275577,_0x3d2b9,_0x8b93a0){var _0x3cf2d6=require(_0xd578('0x52'));return db['Schedule']['find']({'where':{'id':_0x275577[_0xd578('0x46')]['id']},'raw':!![]})[_0xd578('0x25')](handleEntityNotFound(_0x3d2b9,null))[_0xd578('0x25')](function(){_0x3cf2d6[_0xd578('0x53')](_0x275577[_0xd578('0x46')]['id']);})[_0xd578('0x25')](respondWithStatusCode(_0x3d2b9,null))[_0xd578('0x44')](handleError(_0x3d2b9,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 05c35a1..6823510 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 _0xd6ab=['define','Schedule','tools_schedules','lodash','api','bluebird','request-promise','./schedule.attributes','exports'];(function(_0x38c401,_0x3b088e){var _0x12ed59=function(_0x1ef804){while(--_0x1ef804){_0x38c401['push'](_0x38c401['shift']());}};_0x12ed59(++_0x3b088e);}(_0xd6ab,0x9c));var _0xbd6a=function(_0x210e53,_0x46a7b6){_0x210e53=_0x210e53-0x0;var _0x4ff379=_0xd6ab[_0x210e53];return _0x4ff379;};'use strict';var _=require(_0xbd6a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd6a('0x1'));var moment=require('moment');var BPromise=require(_0xbd6a('0x2'));var rp=require(_0xbd6a('0x3'));var attributes=require(_0xbd6a('0x4'));module[_0xbd6a('0x5')]=function(_0x25fda1,_0x368cbd){return _0x25fda1[_0xbd6a('0x6')](_0xbd6a('0x7'),attributes,{'tableName':_0xbd6a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c36=['api','moment','request-promise','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c36,0x1ed));var _0x66c3=function(_0x231b11,_0x367e8a){_0x231b11=_0x231b11-0x0;var _0x2befe5=_0x6c36[_0x231b11];return _0x2befe5;};'use strict';var _=require(_0x66c3('0x0'));var util=require(_0x66c3('0x1'));var logger=require('../../config/logger')(_0x66c3('0x2'));var moment=require(_0x66c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x66c3('0x4'));var attributes=require('./schedule.attributes');module[_0x66c3('0x5')]=function(_0x2a8333,_0x27966d){return _0x2a8333[_0x66c3('0x6')](_0x66c3('0x7'),attributes,{'tableName':_0x66c3('0x8'),'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 3a2a749..662bc1a 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 _0x54f3=['request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s'];(function(_0x4ddef2,_0x17f6c3){var _0x2aa87d=function(_0x2e1215){while(--_0x2e1215){_0x4ddef2['push'](_0x4ddef2['shift']());}};_0x2aa87d(++_0x17f6c3);}(_0x54f3,0x68));var _0x354f=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x54f3[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x354f('0x0'));var util=require(_0x354f('0x1'));var moment=require('moment');var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require(_0x354f('0x5'))['db'];var utils=require(_0x354f('0x6'));var logger=require(_0x354f('0x7'))(_0x354f('0x8'));var config=require(_0x354f('0x9'));var jayson=require(_0x354f('0xa'));var client=jayson[_0x354f('0xb')][_0x354f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f12b8,_0xef7aef,_0x4fe8b7){return new BPromise(function(_0x3e5191,_0x1eaa9f){return client[_0x354f('0xd')](_0x2f12b8,_0x4fe8b7)[_0x354f('0xe')](function(_0x52f324){logger['info'](_0x354f('0xf'),_0xef7aef,_0x354f('0x10'));logger['debug'](_0x354f('0x11'),_0xef7aef,_0x354f('0x10'),JSON[_0x354f('0x12')](_0x52f324));if(_0x52f324[_0x354f('0x13')]){if(_0x52f324['error']['code']===0x1f4){logger[_0x354f('0x13')]('Schedule,\x20%s,\x20%s',_0xef7aef,_0x52f324[_0x354f('0x13')][_0x354f('0x14')]);return _0x1eaa9f(_0x52f324[_0x354f('0x13')]['message']);}logger[_0x354f('0x13')](_0x354f('0xf'),_0xef7aef,_0x52f324['error']['message']);return _0x3e5191(_0x52f324[_0x354f('0x13')][_0x354f('0x14')]);}else{logger[_0x354f('0x15')](_0x354f('0xf'),_0xef7aef,_0x354f('0x10'));_0x3e5191(_0x52f324[_0x354f('0x16')][_0x354f('0x14')]);}})[_0x354f('0x17')](function(_0x1009be){logger[_0x354f('0x13')](_0x354f('0xf'),_0xef7aef,_0x1009be);_0x1eaa9f(_0x1009be);});});} \ No newline at end of file +var _0x2ed0=['http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d085f,_0x3c7393){var _0x1ae582=function(_0x2fffce){while(--_0x2fffce){_0x4d085f['push'](_0x4d085f['shift']());}};_0x1ae582(++_0x3c7393);}(_0x2ed0,0x9c));var _0x02ed=function(_0x3db0b9,_0x23ef61){_0x3db0b9=_0x3db0b9-0x0;var _0x28a9fb=_0x2ed0[_0x3db0b9];return _0x28a9fb;};'use strict';var _=require(_0x02ed('0x0'));var util=require(_0x02ed('0x1'));var moment=require('moment');var BPromise=require(_0x02ed('0x2'));var rs=require(_0x02ed('0x3'));var fs=require('fs');var Redis=require(_0x02ed('0x4'));var db=require(_0x02ed('0x5'))['db'];var utils=require(_0x02ed('0x6'));var logger=require(_0x02ed('0x7'))(_0x02ed('0x8'));var config=require(_0x02ed('0x9'));var jayson=require(_0x02ed('0xa'));var client=jayson[_0x02ed('0xb')][_0x02ed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17936a,_0x47f986,_0x415638){return new BPromise(function(_0x2edb1a,_0x423b49){return client[_0x02ed('0xd')](_0x17936a,_0x415638)['then'](function(_0x1235ba){logger[_0x02ed('0xe')](_0x02ed('0xf'),_0x47f986,_0x02ed('0x10'));logger['debug'](_0x02ed('0x11'),_0x47f986,'request\x20sent',JSON['stringify'](_0x1235ba));if(_0x1235ba['error']){if(_0x1235ba[_0x02ed('0x12')]['code']===0x1f4){logger[_0x02ed('0x12')](_0x02ed('0xf'),_0x47f986,_0x1235ba[_0x02ed('0x12')][_0x02ed('0x13')]);return _0x423b49(_0x1235ba[_0x02ed('0x12')][_0x02ed('0x13')]);}logger[_0x02ed('0x12')](_0x02ed('0xf'),_0x47f986,_0x1235ba[_0x02ed('0x12')][_0x02ed('0x13')]);return _0x2edb1a(_0x1235ba[_0x02ed('0x12')][_0x02ed('0x13')]);}else{logger[_0x02ed('0xe')]('Schedule,\x20%s,\x20%s',_0x47f986,'request\x20sent');_0x2edb1a(_0x1235ba['result']['message']);}})[_0x02ed('0x14')](function(_0x465e4d){logger[_0x02ed('0x12')](_0x02ed('0xf'),_0x47f986,_0x465e4d);_0x423b49(_0x465e4d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d9ec46c..5beb356 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 _0xa111=['put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','file','addLogo','diskStorage','format','addLogoLogin','root','preferred'];(function(_0x550a2e,_0x50cf7e){var _0x4fa6b2=function(_0x5e9609){while(--_0x5e9609){_0x550a2e['push'](_0x550a2e['shift']());}};_0x4fa6b2(++_0x50cf7e);}(_0xa111,0x1b3));var _0x1a11=function(_0x356712,_0x5555f0){_0x356712=_0x356712-0x0;var _0x2f3d29=_0xa111[_0x356712];return _0x2f3d29;};'use strict';var multer=require(_0x1a11('0x0'));var util=require(_0x1a11('0x1'));var path=require(_0x1a11('0x2'));var timeout=require(_0x1a11('0x3'));var express=require('express');var router=express[_0x1a11('0x4')]();var auth=require(_0x1a11('0x5'));var interaction=require(_0x1a11('0x6'));var config=require(_0x1a11('0x7'));var controller=require(_0x1a11('0x8'));router[_0x1a11('0x9')]('/',auth[_0x1a11('0xa')](),controller['index']);router[_0x1a11('0x9')](_0x1a11('0xb'),controller['show']);router[_0x1a11('0x9')](_0x1a11('0xc'),controller['getLogo']);router[_0x1a11('0x9')](_0x1a11('0xd'),controller[_0x1a11('0xe')]);router[_0x1a11('0x9')](_0x1a11('0xf'),controller[_0x1a11('0x10')]);router[_0x1a11('0x9')](_0x1a11('0x11'),controller['getPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11f1ed,_0x16fd32,_0x2c4073){_0x2c4073(null,path[_0x1a11('0x12')](config['root'],_0x1a11('0x13')));},'filename':function(_0x153f18,_0x9cce34,_0x5cbd42){_0x5cbd42(null,util['format'](_0x1a11('0x14'),_0x1a11('0x15'),path[_0x1a11('0x16')](_0x9cce34[_0x1a11('0x17')])));}})});router[_0x1a11('0x18')](_0x1a11('0xc'),upload[_0x1a11('0x19')](_0x1a11('0x1a')),controller[_0x1a11('0x1b')]);var upload=multer({'storage':multer[_0x1a11('0x1c')]({'destination':function(_0x455a90,_0x39d2f1,_0x4f5950){_0x4f5950(null,path[_0x1a11('0x12')](config['root'],_0x1a11('0x13')));},'filename':function(_0x3ea5de,_0xdfe1e9,_0x427d14){_0x427d14(null,util[_0x1a11('0x1d')]('%s%s','logologin',path[_0x1a11('0x16')](_0xdfe1e9[_0x1a11('0x17')])));}})});router['post'](_0x1a11('0xd'),upload['single'](_0x1a11('0x1a')),controller[_0x1a11('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42a596,_0x5bd6bc,_0x3f5f02){_0x3f5f02(null,path['join'](config[_0x1a11('0x1f')],_0x1a11('0x13')));},'filename':function(_0x1281fb,_0x51cbbf,_0x5041ea){_0x5041ea(null,util['format'](_0x1a11('0x14'),_0x1a11('0x20'),path[_0x1a11('0x16')](_0x51cbbf['originalname'])));}})});router[_0x1a11('0x18')](_0x1a11('0x11'),upload[_0x1a11('0x19')]('file'),controller['addPreferred']);router[_0x1a11('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x1a11('0x22')]);module[_0x1a11('0x23')]=router; \ No newline at end of file +var _0x7f88=['diskStorage','root','server/files/images/logos/','format','%s%s','logologin','post','addLogoLogin','preferred','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','join','originalname','single','file','addLogo'];(function(_0x2b38e3,_0x339e80){var _0x4e20fe=function(_0x116117){while(--_0x116117){_0x2b38e3['push'](_0x2b38e3['shift']());}};_0x4e20fe(++_0x339e80);}(_0x7f88,0x169));var _0x87f8=function(_0x24eef6,_0x539d7b){_0x24eef6=_0x24eef6-0x0;var _0x467fcf=_0x7f88[_0x24eef6];return _0x467fcf;};'use strict';var multer=require('multer');var util=require(_0x87f8('0x0'));var path=require(_0x87f8('0x1'));var timeout=require(_0x87f8('0x2'));var express=require(_0x87f8('0x3'));var router=express[_0x87f8('0x4')]();var auth=require(_0x87f8('0x5'));var interaction=require(_0x87f8('0x6'));var config=require(_0x87f8('0x7'));var controller=require(_0x87f8('0x8'));router['get']('/',auth[_0x87f8('0x9')](),controller['index']);router[_0x87f8('0xa')](_0x87f8('0xb'),controller[_0x87f8('0xc')]);router[_0x87f8('0xa')](_0x87f8('0xd'),controller[_0x87f8('0xe')]);router['get'](_0x87f8('0xf'),controller[_0x87f8('0x10')]);router[_0x87f8('0xa')]('/:id/gdpr',controller[_0x87f8('0x11')]);router[_0x87f8('0xa')]('/:id/preferred',controller[_0x87f8('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b0247,_0x36f943,_0x5f10b1){_0x5f10b1(null,path[_0x87f8('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x369249,_0x889c6b,_0x59163d){_0x59163d(null,util['format']('%s%s','logo',path['extname'](_0x889c6b[_0x87f8('0x14')])));}})});router['post'](_0x87f8('0xd'),upload[_0x87f8('0x15')](_0x87f8('0x16')),controller[_0x87f8('0x17')]);var upload=multer({'storage':multer[_0x87f8('0x18')]({'destination':function(_0x1452b9,_0x193a2f,_0x57ef2a){_0x57ef2a(null,path[_0x87f8('0x13')](config[_0x87f8('0x19')],_0x87f8('0x1a')));},'filename':function(_0x7ff543,_0x307d7f,_0x4edd48){_0x4edd48(null,util[_0x87f8('0x1b')](_0x87f8('0x1c'),_0x87f8('0x1d'),path['extname'](_0x307d7f[_0x87f8('0x14')])));}})});router[_0x87f8('0x1e')]('/:id/logo_login',upload['single'](_0x87f8('0x16')),controller[_0x87f8('0x1f')]);var upload=multer({'storage':multer[_0x87f8('0x18')]({'destination':function(_0x142719,_0xe1983f,_0x29f47e){_0x29f47e(null,path[_0x87f8('0x13')](config['root'],_0x87f8('0x1a')));},'filename':function(_0x31a05f,_0x35a5b5,_0xad8cd8){_0xad8cd8(null,util[_0x87f8('0x1b')](_0x87f8('0x1c'),_0x87f8('0x20'),path['extname'](_0x35a5b5[_0x87f8('0x14')])));}})});router[_0x87f8('0x1e')]('/:id/preferred',upload[_0x87f8('0x15')](_0x87f8('0x16')),controller['addPreferred']);router['put'](_0x87f8('0xb'),auth[_0x87f8('0x9')](),controller[_0x87f8('0x21')]);module[_0x87f8('0x22')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4903263..74d9281 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 _0x5a69=['sequelize','exports','min_internal','INTEGER','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5a69,0x1c0));var _0x95a6=function(_0x3b7f4d,_0x4f692e){_0x3b7f4d=_0x3b7f4d-0x0;var _0x27a0e2=_0x5a69[_0x3b7f4d];return _0x27a0e2;};'use strict';var Sequelize=require(_0x95a6('0x0'));module[_0x95a6('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x95a6('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x95a6('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x95a6('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x95a6('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x95a6('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x95a6('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x95a6('0x4')]},'pageTitle':{'type':Sequelize[_0x95a6('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x95a6('0x4')],'defaultValue':_0x95a6('0x6')},'enableEmailPreview':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x95a6('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x95a6('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x95a6('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x95a6('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x95a6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x95a6('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x161c=['INTEGER','exports','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0xd56f58,_0x2e836d){var _0x31e351=function(_0x24906e){while(--_0x24906e){_0xd56f58['push'](_0xd56f58['shift']());}};_0x31e351(++_0x2e836d);}(_0x161c,0xb7));var _0xc161=function(_0xa5feb,_0xdb78c7){_0xa5feb=_0xa5feb-0x0;var _0x31d076=_0x161c[_0xa5feb];return _0x31d076;};'use strict';var Sequelize=require('sequelize');module[_0xc161('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xc161('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xc161('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xc161('0x3')],'defaultValue':_0xc161('0x4')},'logo':{'type':Sequelize[_0xc161('0x3')]},'defaultLogo':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xc161('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xc161('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc161('0x3')]},'turnaddr':{'type':Sequelize[_0xc161('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xc161('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xc161('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xc161('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xc161('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xc161('0x6')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc161('0x6')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xc161('0x6')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc161('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xc161('0x6')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xc161('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xc161('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 84381ac..b0feb7f 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 _0x3914=['../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','Setting','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','find','body','get','join','root','server/files/templates/stun.ejs','utf8','readFileSync','server/files/templates/turn.ejs','render','/etc/asterisk/stun_xcally.conf','writeFileSync','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','existsSync','toLower','default_logo.png','default','custom','Sequelize','Logo\x20not\x20found','download','defaultPreferred','default_loginLogo.png','upperFirst','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x1fdd3f,_0x132d9c){var _0x22a118=function(_0x5890a3){while(--_0x5890a3){_0x1fdd3f['push'](_0x1fdd3f['shift']());}};_0x22a118(++_0x132d9c);}(_0x3914,0xeb));var _0x4391=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x3914[_0x2742db];return _0x18659e;};'use strict';var pdf=require(_0x4391('0x0'));var emlformat=require(_0x4391('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4391('0x2'));var jsonpatch=require(_0x4391('0x3'));var rp=require('request-promise');var moment=require(_0x4391('0x4'));var BPromise=require(_0x4391('0x5'));var Mustache=require(_0x4391('0x6'));var util=require('util');var path=require(_0x4391('0x7'));var sox=require(_0x4391('0x8'));var csv=require('to-csv');var ejs=require(_0x4391('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var authService=require(_0x4391('0xe'));var hardwareService=require(_0x4391('0xf'));var Redis=require('ioredis');var qs=require(_0x4391('0x10'));var logger=require(_0x4391('0x11'))(_0x4391('0x12'));var utils=require(_0x4391('0x13'));var config=require('../../config/environment');var db=require(_0x4391('0x14'))['db'];var jayson=require(_0x4391('0x15'));var client=jayson[_0x4391('0x16')][_0x4391('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x254ffb,_0xdebb72,_0xca9ef5,_0x30a975){return new BPromise(function(_0x5bdd9e,_0x1a49ba){var _0x3bd3a7=_0x30a975||client;return _0x3bd3a7[_0x4391('0x18')](_0x254ffb,_0xca9ef5)[_0x4391('0x19')](function(_0x536e5d){logger[_0x4391('0x1a')]('Setting,\x20%s,\x20%s',_0xdebb72,_0x4391('0x1b'));logger[_0x4391('0x1c')](_0x4391('0x1d'),_0xdebb72,_0x4391('0x1b'),JSON[_0x4391('0x1e')](_0x536e5d));if(_0x536e5d[_0x4391('0x1f')]){if(_0x536e5d[_0x4391('0x1f')][_0x4391('0x20')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xdebb72,_0x536e5d[_0x4391('0x1f')]['message']);return _0x1a49ba(_0x536e5d[_0x4391('0x1f')][_0x4391('0x21')]);}logger[_0x4391('0x1f')](_0x4391('0x22'),_0xdebb72,_0x536e5d[_0x4391('0x1f')]['message']);return _0x5bdd9e(_0x536e5d['error'][_0x4391('0x21')]);}else{logger[_0x4391('0x1a')](_0x4391('0x22'),_0xdebb72,'request\x20sent');_0x5bdd9e(_0x536e5d[_0x4391('0x23')][_0x4391('0x21')]);}})[_0x4391('0x24')](function(_0x3e1e0b){logger['error'](_0x4391('0x22'),_0xdebb72,_0x3e1e0b);_0x1a49ba(_0x3e1e0b);});});}function respondWithStatusCode(_0x2b7a1d,_0x3c4c9b){_0x3c4c9b=_0x3c4c9b||0xcc;return function(_0xfee343){if(_0xfee343){return _0x2b7a1d[_0x4391('0x25')](_0x3c4c9b);}return _0x2b7a1d[_0x4391('0x26')](_0x3c4c9b)['end']();};}function respondWithResult(_0x474666,_0x224e13){_0x224e13=_0x224e13||0xc8;return function(_0x23d8a1){if(_0x23d8a1){return _0x474666[_0x4391('0x26')](_0x224e13)['json'](_0x23d8a1);}};}function respondWithFilteredResult(_0x4b0c28,_0x11c859){return function(_0x3aa79f){if(_0x3aa79f){var _0x3f2554=_0x3aa79f['count'],_0x197408=_0x11c859['offset'],_0x3785a8=_0x11c859['offset']+_0x11c859[_0x4391('0x27')],_0x53363c;if(_0x3785a8>=_0x3f2554){_0x3785a8=_0x3f2554;_0x53363c=0xc8;}else{_0x53363c=0xce;}_0x4b0c28[_0x4391('0x26')](_0x53363c);return _0x4b0c28[_0x4391('0x28')](_0x4391('0x29'),_0x197408+'-'+_0x3785a8+'/'+_0x3f2554)['json'](_0x3aa79f);}return null;};}function patchUpdates(_0x34059f){return function(_0x32ed74){try{jsonpatch[_0x4391('0x2a')](_0x32ed74,_0x34059f,!![]);}catch(_0x1ac51d){return BPromise[_0x4391('0x2b')](_0x1ac51d);}return _0x32ed74['save']();};}function saveUpdates(_0x1a8df0,_0x3edb24){return function(_0x19b5d1){if(_0x19b5d1){return _0x19b5d1[_0x4391('0x2c')](_0x1a8df0)[_0x4391('0x19')](function(_0x237a51){return _0x237a51;});}return null;};}function removeEntity(_0x35eaa3,_0x1b4f0d){return function(_0x1e3f42){if(_0x1e3f42){return _0x1e3f42[_0x4391('0x2d')]()[_0x4391('0x19')](function(){_0x35eaa3['status'](0xcc)[_0x4391('0x2e')]();});}};}function handleEntityNotFound(_0x50bd4c,_0x122405){return function(_0x586940){if(!_0x586940){_0x50bd4c['sendStatus'](0x194);}return _0x586940;};}function handleError(_0x174788,_0xf8313b){_0xf8313b=_0xf8313b||0x1f4;return function(_0x55eb39){logger[_0x4391('0x1f')](_0x55eb39[_0x4391('0x2f')]);if(_0x55eb39[_0x4391('0x30')]){delete _0x55eb39[_0x4391('0x30')];}_0x174788['status'](_0xf8313b)[_0x4391('0x31')](_0x55eb39);};}exports['index']=function(_0x2dd6d2,_0x5c58d0){var _0x95b18a={},_0x11e3ae={},_0x12cea0={'count':0x0,'rows':[]};var _0x3224dc=db[_0x4391('0x32')][_0x4391('0x33')];_0x11e3ae[_0x4391('0x34')]=_[_0x4391('0x35')](_0x3224dc);_0x11e3ae[_0x4391('0x36')]=_[_0x4391('0x35')](_0x2dd6d2[_0x4391('0x36')]);_0x11e3ae[_0x4391('0x37')]=_[_0x4391('0x38')](_0x11e3ae[_0x4391('0x34')],_0x11e3ae[_0x4391('0x36')]);_0x95b18a[_0x4391('0x39')]=_[_0x4391('0x38')](_0x11e3ae[_0x4391('0x34')],qs['fields'](_0x2dd6d2['query'][_0x4391('0x3a')]));_0x95b18a[_0x4391('0x39')]=_0x95b18a[_0x4391('0x39')][_0x4391('0x3b')]?_0x95b18a[_0x4391('0x39')]:_0x11e3ae[_0x4391('0x34')];if(!_0x2dd6d2[_0x4391('0x36')][_0x4391('0x3c')]('nolimit')){_0x95b18a[_0x4391('0x27')]=qs['limit'](_0x2dd6d2['query']['limit']);_0x95b18a['offset']=qs[_0x4391('0x3d')](_0x2dd6d2[_0x4391('0x36')][_0x4391('0x3d')]);}_0x95b18a[_0x4391('0x3e')]=qs['sort'](_0x2dd6d2['query'][_0x4391('0x3f')]);_0x95b18a['where']=qs[_0x4391('0x37')](_[_0x4391('0x40')](_0x2dd6d2[_0x4391('0x36')],_0x11e3ae[_0x4391('0x37')]));if(_0x2dd6d2[_0x4391('0x36')][_0x4391('0x41')]){_0x95b18a['where']=_[_0x4391('0x42')](_0x95b18a[_0x4391('0x43')],{'$or':_[_0x4391('0x44')](_0x3224dc,function(_0x13f5f4){if(_0x13f5f4[_0x4391('0x45')][_0x4391('0x46')]!==_0x4391('0x47')){var _0x5dcdd5={};_0x5dcdd5[_0x13f5f4[_0x4391('0x48')]]={'$like':'%'+_0x2dd6d2[_0x4391('0x36')][_0x4391('0x41')]+'%'};return _0x5dcdd5;}})});}_0x95b18a=_[_0x4391('0x42')]({},_0x95b18a,_0x2dd6d2[_0x4391('0x49')]);var _0x3b979e={'where':_0x95b18a[_0x4391('0x43')]};return db['Setting'][_0x4391('0x4a')](_0x3b979e)['then'](function(_0x308a49){_0x12cea0[_0x4391('0x4a')]=_0x308a49;if(_0x2dd6d2[_0x4391('0x36')][_0x4391('0x4b')]){_0x95b18a[_0x4391('0x4c')]=[{'all':!![]}];}return db[_0x4391('0x32')][_0x4391('0x4d')](_0x95b18a);})[_0x4391('0x19')](function(_0x2cedb6){_0x12cea0[_0x4391('0x4e')]=_0x2cedb6;return _0x12cea0;})[_0x4391('0x19')](respondWithFilteredResult(_0x5c58d0,_0x95b18a))[_0x4391('0x24')](handleError(_0x5c58d0,null));};exports[_0x4391('0x4f')]=function(_0x566cf8,_0x5901cf){var _0x14c559={'raw':![],'where':{'id':_0x566cf8[_0x4391('0x50')]['id']}},_0x33bc3b={};_0x33bc3b[_0x4391('0x34')]=_[_0x4391('0x35')](db[_0x4391('0x32')]['rawAttributes']);_0x33bc3b[_0x4391('0x36')]=_['keys'](_0x566cf8[_0x4391('0x36')]);_0x33bc3b['filters']=_[_0x4391('0x38')](_0x33bc3b[_0x4391('0x34')],_0x33bc3b[_0x4391('0x36')]);_0x14c559[_0x4391('0x39')]=_[_0x4391('0x38')](_0x33bc3b[_0x4391('0x34')],qs['fields'](_0x566cf8[_0x4391('0x36')][_0x4391('0x3a')]));_0x14c559[_0x4391('0x39')]=_0x14c559[_0x4391('0x39')][_0x4391('0x3b')]?_0x14c559[_0x4391('0x39')]:_0x33bc3b[_0x4391('0x34')];if(_0x566cf8[_0x4391('0x36')][_0x4391('0x4b')]){_0x14c559[_0x4391('0x4c')]=[{'all':!![]}];}_0x14c559=_[_0x4391('0x42')]({},_0x14c559,_0x566cf8[_0x4391('0x49')]);return db[_0x4391('0x32')]['find'](_0x14c559)[_0x4391('0x19')](handleEntityNotFound(_0x5901cf,null))[_0x4391('0x19')](respondWithResult(_0x5901cf,null))[_0x4391('0x24')](handleError(_0x5901cf,null));};exports['update']=function(_0x156614,_0x2a81fb,_0x26f3b2){var _0x5d2cb1;return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x156614['params']['id']}})[_0x4391('0x19')](handleEntityNotFound(_0x2a81fb,null))[_0x4391('0x19')](saveUpdates(_0x156614[_0x4391('0x52')],null))[_0x4391('0x19')](function(_0x2a00ba){if(_0x2a00ba){_0x5d2cb1=_0x2a00ba[_0x4391('0x53')]({'plain':!![]});var _0x443ebf=fs['readFileSync'](path[_0x4391('0x54')](config[_0x4391('0x55')],_0x4391('0x56')),_0x4391('0x57'));var _0x46b336=ejs['render'](_0x443ebf,_0x5d2cb1);var _0x4658b0=fs[_0x4391('0x58')](path[_0x4391('0x54')](config[_0x4391('0x55')],_0x4391('0x59')),_0x4391('0x57'));var _0x5b9d46=ejs[_0x4391('0x5a')](_0x4658b0,_0x5d2cb1);fs['writeFileSync'](_0x4391('0x5b'),_0x46b336);fs[_0x4391('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x5b9d46);return respondWithRpcPromise(_0x4391('0x5d'),_0x4391('0x2c'),{'module':_0x4391('0x5e')});}})[_0x4391('0x19')](function(){return respondWithRpcPromise(_0x4391('0x5d'),_0x4391('0x2c'),{'module':_0x4391('0x5f')});})[_0x4391('0x19')](function(){return _0x5d2cb1||null;})['then'](respondWithResult(_0x2a81fb,null))[_0x4391('0x24')](handleError(_0x2a81fb,null));};exports[_0x4391('0x60')]=function(_0x258642,_0x2c9025,_0x2614ac){if(_0x258642[_0x4391('0x61')]&&_0x258642[_0x4391('0x61')]['filename']){_0x258642[_0x4391('0x52')][_0x4391('0x62')]=_0x258642[_0x4391('0x61')][_0x4391('0x63')];}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x258642['params']['id']}})[_0x4391('0x19')](handleEntityNotFound(_0x2c9025,null))[_0x4391('0x19')](saveUpdates(_0x258642[_0x4391('0x52')],null))[_0x4391('0x19')](respondWithResult(_0x2c9025,null))[_0x4391('0x24')](handleError(_0x2c9025,null));};exports[_0x4391('0x64')]=function(_0x2cf09b,_0x5801c2,_0x3f9b7b){if(_0x2cf09b[_0x4391('0x61')]&&_0x2cf09b[_0x4391('0x61')][_0x4391('0x63')]){_0x2cf09b[_0x4391('0x52')][_0x4391('0x65')]=_0x2cf09b[_0x4391('0x61')][_0x4391('0x63')];}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x2cf09b[_0x4391('0x50')]['id']}})[_0x4391('0x19')](handleEntityNotFound(_0x5801c2,null))[_0x4391('0x19')](saveUpdates(_0x2cf09b[_0x4391('0x52')],null))[_0x4391('0x19')](respondWithResult(_0x5801c2,null))['catch'](handleError(_0x5801c2,null));};var utilLicense=require(_0x4391('0x66'));exports[_0x4391('0x67')]=function(_0x217300,_0x24dff6,_0x5084eb){var _0x48b213=_0x4391('0x68');var _0x18f6b3={'custom':![]};return utilLicense[_0x4391('0x69')]()[_0x4391('0x19')](function(_0x5daf95){if(_0x5daf95){_0x18f6b3=_0x5daf95;}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x217300[_0x4391('0x50')]['id']},'attributes':['logo',_0x4391('0x65'),_0x4391('0x6a'),_0x4391('0x6b'),_0x4391('0x6c'),'defaultPreferred'],'raw':!![]});})[_0x4391('0x19')](handleEntityNotFound(_0x24dff6,null))[_0x4391('0x19')](function(_0x134660){if(_0x134660){var _0x2cedcf=_0x134660[_0x4391('0x62')]&&fs[_0x4391('0x6d')](path['join'](config[_0x4391('0x55')],_0x48b213,_[_0x4391('0x6e')](_0x134660['logo'])))?path['join'](config['root'],_0x48b213,_[_0x4391('0x6e')](_0x134660[_0x4391('0x62')])):path[_0x4391('0x54')](config[_0x4391('0x55')],_0x48b213,_['toLower'](_0x4391('0x6f')));var _0x5cdfed=_0x4391('0x70')+_['upperFirst'](_0x4391('0x62'));if(_0x134660[_0x5cdfed]||!_0x18f6b3[_0x4391('0x71')]){_0x2cedcf=path[_0x4391('0x54')](config[_0x4391('0x55')],_0x48b213,_[_0x4391('0x6e')](_0x4391('0x6f')));}if(!fs[_0x4391('0x6d')](_0x2cedcf)){throw new db[(_0x4391('0x72'))]['ValidationError'](_0x4391('0x73'));}return _0x24dff6[_0x4391('0x74')](_0x2cedcf);}})[_0x4391('0x24')](handleError(_0x24dff6,null));};var utilLicense=require(_0x4391('0x66'));exports['getLogoLogin']=function(_0x4b19be,_0x30dda6,_0x453a86){var _0x33c129='server/files/images/logos';var _0x429e44={'custom':![]};return utilLicense[_0x4391('0x69')]()[_0x4391('0x19')](function(_0xcffc22){if(_0xcffc22){_0x429e44=_0xcffc22;}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x4b19be[_0x4391('0x50')]['id']},'attributes':[_0x4391('0x62'),_0x4391('0x65'),_0x4391('0x6a'),_0x4391('0x6b'),'defaultLoginLogo',_0x4391('0x75')],'raw':!![]});})[_0x4391('0x19')](handleEntityNotFound(_0x30dda6,null))[_0x4391('0x19')](function(_0x27b1c6){if(_0x27b1c6){var _0x1e34e5=_0x27b1c6[_0x4391('0x65')]&&fs[_0x4391('0x6d')](path[_0x4391('0x54')](config[_0x4391('0x55')],_0x33c129,_[_0x4391('0x6e')](_0x27b1c6[_0x4391('0x65')])))?path['join'](config['root'],_0x33c129,_[_0x4391('0x6e')](_0x27b1c6[_0x4391('0x65')])):path[_0x4391('0x54')](config[_0x4391('0x55')],_0x33c129,_['toLower'](_0x4391('0x76')));var _0x111584='default'+_[_0x4391('0x77')]('loginLogo');if(_0x27b1c6[_0x111584]||!_0x429e44['custom']){_0x1e34e5=path[_0x4391('0x54')](config[_0x4391('0x55')],_0x33c129,_[_0x4391('0x6e')](_0x4391('0x76')));}if(!fs[_0x4391('0x6d')](_0x1e34e5)){throw new db[(_0x4391('0x72'))]['ValidationError'](_0x4391('0x73'));}return _0x30dda6[_0x4391('0x74')](_0x1e34e5);}})[_0x4391('0x24')](handleError(_0x30dda6,null));};exports[_0x4391('0x78')]=function(_0x1eca50,_0x14f269){return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x1eca50[_0x4391('0x50')]['id']},'attributes':[_0x4391('0x79')]})[_0x4391('0x19')](respondWithResult(_0x14f269,null))[_0x4391('0x24')](handleError(_0x14f269,null));};exports[_0x4391('0x7a')]=function(_0x129d9b,_0x2a78dd,_0x4045f3){if(_0x129d9b[_0x4391('0x61')]&&_0x129d9b[_0x4391('0x61')][_0x4391('0x63')]){_0x129d9b[_0x4391('0x52')]['preferred']=_0x129d9b[_0x4391('0x61')]['filename'];}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x129d9b[_0x4391('0x50')]['id']}})[_0x4391('0x19')](handleEntityNotFound(_0x2a78dd,null))[_0x4391('0x19')](saveUpdates(_0x129d9b[_0x4391('0x52')],null))['then'](respondWithResult(_0x2a78dd,null))[_0x4391('0x24')](handleError(_0x2a78dd,null));};var utilLicense=require(_0x4391('0x66'));exports[_0x4391('0x7b')]=function(_0x38bb4c,_0x4f7efd,_0x12e193){var _0x2a1f24=_0x4391('0x68');var _0x2c90ac={'custom':![]};return utilLicense[_0x4391('0x69')]()[_0x4391('0x19')](function(_0x38eb5d){if(_0x38eb5d){_0x2c90ac=_0x38eb5d;}return db[_0x4391('0x32')][_0x4391('0x51')]({'where':{'id':_0x38bb4c[_0x4391('0x50')]['id']},'attributes':[_0x4391('0x62'),'loginLogo','preferred',_0x4391('0x6b'),'defaultLoginLogo',_0x4391('0x75')],'raw':!![]});})[_0x4391('0x19')](handleEntityNotFound(_0x4f7efd,null))[_0x4391('0x19')](function(_0x57de59){if(_0x57de59){var _0x3aa677=_0x57de59[_0x4391('0x6a')]&&fs[_0x4391('0x6d')](path[_0x4391('0x54')](config[_0x4391('0x55')],_0x2a1f24,_[_0x4391('0x6e')](_0x57de59['preferred'])))?path[_0x4391('0x54')](config[_0x4391('0x55')],_0x2a1f24,_[_0x4391('0x6e')](_0x57de59[_0x4391('0x6a')])):path[_0x4391('0x54')](config['root'],_0x2a1f24,_[_0x4391('0x6e')]('default_preferred.png'));var _0x5502ff='default'+_[_0x4391('0x77')](_0x4391('0x6a'));if(_0x57de59[_0x5502ff]||!_0x2c90ac['custom']||!_0x2c90ac['preferred']){_0x3aa677=path[_0x4391('0x54')](config[_0x4391('0x55')],_0x2a1f24,_[_0x4391('0x6e')](_0x4391('0x7c')));}if(!fs[_0x4391('0x6d')](_0x3aa677)){throw new db[(_0x4391('0x72'))]['ValidationError']('Logo\x20not\x20found');}return _0x4f7efd[_0x4391('0x74')](_0x3aa677);}})[_0x4391('0x24')](handleError(_0x4f7efd,null));}; \ No newline at end of file +var _0xda81=['stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','end','name','index','Setting','rawAttributes','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','find','body','readFileSync','join','server/files/templates/stun.ejs','render','root','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','update','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','defaultLoginLogo','defaultPreferred','logo','toLower','default_logo.png','upperFirst','custom','existsSync','Sequelize','ValidationError','download','getLogoLogin','getLicense','defaultLogo','default_loginLogo.png','default','securePassword','getPreferred','default_preferred.png','Logo\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1026f2,_0x139e83){var _0x5119f6=function(_0x255551){while(--_0x255551){_0x1026f2['push'](_0x1026f2['shift']());}};_0x5119f6(++_0x139e83);}(_0xda81,0x1c3));var _0x1da8=function(_0x3f8255,_0x2be9e3){_0x3f8255=_0x3f8255-0x0;var _0x5e0d36=_0xda81[_0x3f8255];return _0x5e0d36;};'use strict';var pdf=require(_0x1da8('0x0'));var emlformat=require(_0x1da8('0x1'));var rimraf=require(_0x1da8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1da8('0x3'));var rp=require(_0x1da8('0x4'));var moment=require(_0x1da8('0x5'));var BPromise=require(_0x1da8('0x6'));var Mustache=require('mustache');var util=require(_0x1da8('0x7'));var path=require(_0x1da8('0x8'));var sox=require('sox');var csv=require(_0x1da8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1da8('0xa'));var squel=require(_0x1da8('0xb'));var crypto=require(_0x1da8('0xc'));var jsforce=require(_0x1da8('0xd'));var deskjs=require(_0x1da8('0xe'));var toCsv=require(_0x1da8('0x9'));var querystring=require(_0x1da8('0xf'));var Papa=require(_0x1da8('0x10'));var authService=require(_0x1da8('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1da8('0x12'));var qs=require(_0x1da8('0x13'));var logger=require(_0x1da8('0x14'))(_0x1da8('0x15'));var utils=require(_0x1da8('0x16'));var config=require('../../config/environment');var db=require(_0x1da8('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x18')][_0x1da8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2717e6,_0x444ea6,_0x44c1a7,_0x5c722d){return new BPromise(function(_0x9d4cd3,_0x491a3f){var _0x335935=_0x5c722d||client;return _0x335935[_0x1da8('0x1a')](_0x2717e6,_0x44c1a7)[_0x1da8('0x1b')](function(_0x4a3025){logger[_0x1da8('0x1c')](_0x1da8('0x1d'),_0x444ea6,'request\x20sent');logger[_0x1da8('0x1e')](_0x1da8('0x1f'),_0x444ea6,_0x1da8('0x20'),JSON[_0x1da8('0x21')](_0x4a3025));if(_0x4a3025[_0x1da8('0x22')]){if(_0x4a3025[_0x1da8('0x22')][_0x1da8('0x23')]===0x1f4){logger[_0x1da8('0x22')](_0x1da8('0x1d'),_0x444ea6,_0x4a3025['error'][_0x1da8('0x24')]);return _0x491a3f(_0x4a3025[_0x1da8('0x22')][_0x1da8('0x24')]);}logger[_0x1da8('0x22')](_0x1da8('0x1d'),_0x444ea6,_0x4a3025[_0x1da8('0x22')]['message']);return _0x9d4cd3(_0x4a3025[_0x1da8('0x22')][_0x1da8('0x24')]);}else{logger[_0x1da8('0x1c')](_0x1da8('0x1d'),_0x444ea6,_0x1da8('0x20'));_0x9d4cd3(_0x4a3025[_0x1da8('0x25')]['message']);}})[_0x1da8('0x26')](function(_0x503adb){logger[_0x1da8('0x22')](_0x1da8('0x1d'),_0x444ea6,_0x503adb);_0x491a3f(_0x503adb);});});}function respondWithStatusCode(_0x3c9abf,_0x370d2a){_0x370d2a=_0x370d2a||0xcc;return function(_0x2a9002){if(_0x2a9002){return _0x3c9abf[_0x1da8('0x27')](_0x370d2a);}return _0x3c9abf[_0x1da8('0x28')](_0x370d2a)['end']();};}function respondWithResult(_0x4a703d,_0xac4b2a){_0xac4b2a=_0xac4b2a||0xc8;return function(_0x1b3ba3){if(_0x1b3ba3){return _0x4a703d['status'](_0xac4b2a)[_0x1da8('0x29')](_0x1b3ba3);}};}function respondWithFilteredResult(_0x1509a9,_0xa6da1b){return function(_0x138aad){if(_0x138aad){var _0x1e2d3e=_0x138aad[_0x1da8('0x2a')],_0x46af20=_0xa6da1b[_0x1da8('0x2b')],_0x5c3960=_0xa6da1b[_0x1da8('0x2b')]+_0xa6da1b[_0x1da8('0x2c')],_0x1da598;if(_0x5c3960>=_0x1e2d3e){_0x5c3960=_0x1e2d3e;_0x1da598=0xc8;}else{_0x1da598=0xce;}_0x1509a9[_0x1da8('0x28')](_0x1da598);return _0x1509a9[_0x1da8('0x2d')](_0x1da8('0x2e'),_0x46af20+'-'+_0x5c3960+'/'+_0x1e2d3e)[_0x1da8('0x29')](_0x138aad);}return null;};}function patchUpdates(_0x21f3fe){return function(_0x58e3c6){try{jsonpatch[_0x1da8('0x2f')](_0x58e3c6,_0x21f3fe,!![]);}catch(_0x54f3c9){return BPromise['reject'](_0x54f3c9);}return _0x58e3c6['save']();};}function saveUpdates(_0x54d3fd,_0x3e7c00){return function(_0x82c59d){if(_0x82c59d){return _0x82c59d['update'](_0x54d3fd)[_0x1da8('0x1b')](function(_0x59d3c5){return _0x59d3c5;});}return null;};}function removeEntity(_0x1b26dc,_0x202017){return function(_0x14ff1e){if(_0x14ff1e){return _0x14ff1e['destroy']()[_0x1da8('0x1b')](function(){_0x1b26dc[_0x1da8('0x28')](0xcc)[_0x1da8('0x30')]();});}};}function handleEntityNotFound(_0x7678be,_0x5ec22c){return function(_0x311cb7){if(!_0x311cb7){_0x7678be[_0x1da8('0x27')](0x194);}return _0x311cb7;};}function handleError(_0x32b72,_0x21cc4b){_0x21cc4b=_0x21cc4b||0x1f4;return function(_0x3af31e){logger[_0x1da8('0x22')](_0x3af31e['stack']);if(_0x3af31e[_0x1da8('0x31')]){delete _0x3af31e[_0x1da8('0x31')];}_0x32b72[_0x1da8('0x28')](_0x21cc4b)['send'](_0x3af31e);};}exports[_0x1da8('0x32')]=function(_0x12ce12,_0x31995e){var _0x16424c={},_0x4089c6={},_0x504b51={'count':0x0,'rows':[]};var _0x26c689=db[_0x1da8('0x33')][_0x1da8('0x34')];_0x4089c6['model']=_['keys'](_0x26c689);_0x4089c6[_0x1da8('0x35')]=_['keys'](_0x12ce12['query']);_0x4089c6['filters']=_[_0x1da8('0x36')](_0x4089c6[_0x1da8('0x37')],_0x4089c6[_0x1da8('0x35')]);_0x16424c['attributes']=_[_0x1da8('0x36')](_0x4089c6['model'],qs[_0x1da8('0x38')](_0x12ce12[_0x1da8('0x35')][_0x1da8('0x38')]));_0x16424c[_0x1da8('0x39')]=_0x16424c[_0x1da8('0x39')][_0x1da8('0x3a')]?_0x16424c[_0x1da8('0x39')]:_0x4089c6[_0x1da8('0x37')];if(!_0x12ce12[_0x1da8('0x35')][_0x1da8('0x3b')](_0x1da8('0x3c'))){_0x16424c[_0x1da8('0x2c')]=qs['limit'](_0x12ce12[_0x1da8('0x35')][_0x1da8('0x2c')]);_0x16424c['offset']=qs[_0x1da8('0x2b')](_0x12ce12[_0x1da8('0x35')][_0x1da8('0x2b')]);}_0x16424c['order']=qs[_0x1da8('0x3d')](_0x12ce12[_0x1da8('0x35')][_0x1da8('0x3d')]);_0x16424c[_0x1da8('0x3e')]=qs[_0x1da8('0x3f')](_['pick'](_0x12ce12[_0x1da8('0x35')],_0x4089c6[_0x1da8('0x3f')]));if(_0x12ce12[_0x1da8('0x35')]['filter']){_0x16424c[_0x1da8('0x3e')]=_['merge'](_0x16424c[_0x1da8('0x3e')],{'$or':_[_0x1da8('0x40')](_0x26c689,function(_0x1f9871){if(_0x1f9871[_0x1da8('0x41')][_0x1da8('0x42')]!==_0x1da8('0x43')){var _0x3cadb7={};_0x3cadb7[_0x1f9871[_0x1da8('0x44')]]={'$like':'%'+_0x12ce12[_0x1da8('0x35')][_0x1da8('0x45')]+'%'};return _0x3cadb7;}})});}_0x16424c=_['merge']({},_0x16424c,_0x12ce12[_0x1da8('0x46')]);var _0x175143={'where':_0x16424c[_0x1da8('0x3e')]};return db[_0x1da8('0x33')][_0x1da8('0x2a')](_0x175143)['then'](function(_0xf267ae){_0x504b51[_0x1da8('0x2a')]=_0xf267ae;if(_0x12ce12[_0x1da8('0x35')][_0x1da8('0x47')]){_0x16424c[_0x1da8('0x48')]=[{'all':!![]}];}return db[_0x1da8('0x33')][_0x1da8('0x49')](_0x16424c);})[_0x1da8('0x1b')](function(_0x3235ab){_0x504b51[_0x1da8('0x4a')]=_0x3235ab;return _0x504b51;})[_0x1da8('0x1b')](respondWithFilteredResult(_0x31995e,_0x16424c))[_0x1da8('0x26')](handleError(_0x31995e,null));};exports[_0x1da8('0x4b')]=function(_0x2a08bd,_0x4e515f){var _0x5250fc={'raw':![],'where':{'id':_0x2a08bd[_0x1da8('0x4c')]['id']}},_0xa8d17a={};_0xa8d17a[_0x1da8('0x37')]=_[_0x1da8('0x4d')](db[_0x1da8('0x33')][_0x1da8('0x34')]);_0xa8d17a['query']=_[_0x1da8('0x4d')](_0x2a08bd['query']);_0xa8d17a[_0x1da8('0x3f')]=_[_0x1da8('0x36')](_0xa8d17a[_0x1da8('0x37')],_0xa8d17a['query']);_0x5250fc[_0x1da8('0x39')]=_[_0x1da8('0x36')](_0xa8d17a[_0x1da8('0x37')],qs[_0x1da8('0x38')](_0x2a08bd[_0x1da8('0x35')][_0x1da8('0x38')]));_0x5250fc['attributes']=_0x5250fc[_0x1da8('0x39')]['length']?_0x5250fc[_0x1da8('0x39')]:_0xa8d17a['model'];if(_0x2a08bd[_0x1da8('0x35')]['includeAll']){_0x5250fc[_0x1da8('0x48')]=[{'all':!![]}];}_0x5250fc=_[_0x1da8('0x4e')]({},_0x5250fc,_0x2a08bd[_0x1da8('0x46')]);return db['Setting'][_0x1da8('0x4f')](_0x5250fc)[_0x1da8('0x1b')](handleEntityNotFound(_0x4e515f,null))[_0x1da8('0x1b')](respondWithResult(_0x4e515f,null))['catch'](handleError(_0x4e515f,null));};exports['update']=function(_0x33b198,_0x82efde,_0x6a68ea){var _0x1c2a64;return db[_0x1da8('0x33')][_0x1da8('0x4f')]({'where':{'id':_0x33b198[_0x1da8('0x4c')]['id']}})[_0x1da8('0x1b')](handleEntityNotFound(_0x82efde,null))['then'](saveUpdates(_0x33b198[_0x1da8('0x50')],null))[_0x1da8('0x1b')](function(_0x2a8444){if(_0x2a8444){_0x1c2a64=_0x2a8444['get']({'plain':!![]});var _0x918a55=fs[_0x1da8('0x51')](path[_0x1da8('0x52')](config['root'],_0x1da8('0x53')),'utf8');var _0x48c4b7=ejs[_0x1da8('0x54')](_0x918a55,_0x1c2a64);var _0x5637fd=fs['readFileSync'](path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x1da8('0x56')),'utf8');var _0x571fda=ejs['render'](_0x5637fd,_0x1c2a64);fs[_0x1da8('0x57')](_0x1da8('0x58'),_0x48c4b7);fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x571fda);return respondWithRpcPromise(_0x1da8('0x59'),_0x1da8('0x5a'),{'module':'res_stun_monitor.so'});}})[_0x1da8('0x1b')](function(){return respondWithRpcPromise(_0x1da8('0x59'),_0x1da8('0x5a'),{'module':_0x1da8('0x5b')});})['then'](function(){return _0x1c2a64||null;})[_0x1da8('0x1b')](respondWithResult(_0x82efde,null))['catch'](handleError(_0x82efde,null));};exports[_0x1da8('0x5c')]=function(_0x1a5476,_0x4a05ed,_0x1aa53c){if(_0x1a5476[_0x1da8('0x5d')]&&_0x1a5476['file'][_0x1da8('0x5e')]){_0x1a5476[_0x1da8('0x50')]['logo']=_0x1a5476[_0x1da8('0x5d')][_0x1da8('0x5e')];}return db[_0x1da8('0x33')][_0x1da8('0x4f')]({'where':{'id':_0x1a5476[_0x1da8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a05ed,null))[_0x1da8('0x1b')](saveUpdates(_0x1a5476[_0x1da8('0x50')],null))[_0x1da8('0x1b')](respondWithResult(_0x4a05ed,null))[_0x1da8('0x26')](handleError(_0x4a05ed,null));};exports[_0x1da8('0x5f')]=function(_0x15844f,_0x5cdbd4,_0x198a8a){if(_0x15844f[_0x1da8('0x5d')]&&_0x15844f['file'][_0x1da8('0x5e')]){_0x15844f[_0x1da8('0x50')][_0x1da8('0x60')]=_0x15844f['file'][_0x1da8('0x5e')];}return db['Setting'][_0x1da8('0x4f')]({'where':{'id':_0x15844f[_0x1da8('0x4c')]['id']}})[_0x1da8('0x1b')](handleEntityNotFound(_0x5cdbd4,null))[_0x1da8('0x1b')](saveUpdates(_0x15844f[_0x1da8('0x50')],null))[_0x1da8('0x1b')](respondWithResult(_0x5cdbd4,null))[_0x1da8('0x26')](handleError(_0x5cdbd4,null));};var utilLicense=require(_0x1da8('0x61'));exports[_0x1da8('0x62')]=function(_0x50addd,_0x11eb4c,_0x2ef656){var _0x1b0c2d=_0x1da8('0x63');var _0x14156e={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4d3840){if(_0x4d3840){_0x14156e=_0x4d3840;}return db[_0x1da8('0x33')][_0x1da8('0x4f')]({'where':{'id':_0x50addd[_0x1da8('0x4c')]['id']},'attributes':['logo',_0x1da8('0x60'),_0x1da8('0x64'),'defaultLogo',_0x1da8('0x65'),_0x1da8('0x66')],'raw':!![]});})[_0x1da8('0x1b')](handleEntityNotFound(_0x11eb4c,null))[_0x1da8('0x1b')](function(_0x561963){if(_0x561963){var _0x9239f8=_0x561963[_0x1da8('0x67')]&&fs['existsSync'](path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x1b0c2d,_[_0x1da8('0x68')](_0x561963[_0x1da8('0x67')])))?path[_0x1da8('0x52')](config['root'],_0x1b0c2d,_[_0x1da8('0x68')](_0x561963[_0x1da8('0x67')])):path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x1b0c2d,_[_0x1da8('0x68')](_0x1da8('0x69')));var _0xfc0dd4='default'+_[_0x1da8('0x6a')](_0x1da8('0x67'));if(_0x561963[_0xfc0dd4]||!_0x14156e[_0x1da8('0x6b')]){_0x9239f8=path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x1b0c2d,_['toLower'](_0x1da8('0x69')));}if(!fs[_0x1da8('0x6c')](_0x9239f8)){throw new db[(_0x1da8('0x6d'))][(_0x1da8('0x6e'))]('Logo\x20not\x20found');}return _0x11eb4c[_0x1da8('0x6f')](_0x9239f8);}})['catch'](handleError(_0x11eb4c,null));};var utilLicense=require('../../config/license/util');exports[_0x1da8('0x70')]=function(_0xc5a0dd,_0xf38be8,_0x4bf467){var _0x3e51ff=_0x1da8('0x63');var _0x3d4aa3={'custom':![]};return utilLicense[_0x1da8('0x71')]()[_0x1da8('0x1b')](function(_0xd0234e){if(_0xd0234e){_0x3d4aa3=_0xd0234e;}return db[_0x1da8('0x33')][_0x1da8('0x4f')]({'where':{'id':_0xc5a0dd['params']['id']},'attributes':[_0x1da8('0x67'),_0x1da8('0x60'),'preferred',_0x1da8('0x72'),'defaultLoginLogo',_0x1da8('0x66')],'raw':!![]});})[_0x1da8('0x1b')](handleEntityNotFound(_0xf38be8,null))[_0x1da8('0x1b')](function(_0x4302c8){if(_0x4302c8){var _0x4af980=_0x4302c8[_0x1da8('0x60')]&&fs[_0x1da8('0x6c')](path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x3e51ff,_[_0x1da8('0x68')](_0x4302c8[_0x1da8('0x60')])))?path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x3e51ff,_[_0x1da8('0x68')](_0x4302c8['loginLogo'])):path[_0x1da8('0x52')](config['root'],_0x3e51ff,_[_0x1da8('0x68')](_0x1da8('0x73')));var _0x34b217=_0x1da8('0x74')+_[_0x1da8('0x6a')](_0x1da8('0x60'));if(_0x4302c8[_0x34b217]||!_0x3d4aa3[_0x1da8('0x6b')]){_0x4af980=path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x3e51ff,_[_0x1da8('0x68')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x4af980)){throw new db['Sequelize'][(_0x1da8('0x6e'))]('Logo\x20not\x20found');}return _0xf38be8[_0x1da8('0x6f')](_0x4af980);}})[_0x1da8('0x26')](handleError(_0xf38be8,null));};exports['gdpr']=function(_0x13ae2e,_0x5e22bd){return db[_0x1da8('0x33')][_0x1da8('0x4f')]({'where':{'id':_0x13ae2e[_0x1da8('0x4c')]['id']},'attributes':[_0x1da8('0x75')]})[_0x1da8('0x1b')](respondWithResult(_0x5e22bd,null))['catch'](handleError(_0x5e22bd,null));};exports['addPreferred']=function(_0x38a0d2,_0x1277ff,_0x2072cf){if(_0x38a0d2['file']&&_0x38a0d2[_0x1da8('0x5d')][_0x1da8('0x5e')]){_0x38a0d2['body'][_0x1da8('0x64')]=_0x38a0d2['file'][_0x1da8('0x5e')];}return db[_0x1da8('0x33')]['find']({'where':{'id':_0x38a0d2[_0x1da8('0x4c')]['id']}})[_0x1da8('0x1b')](handleEntityNotFound(_0x1277ff,null))[_0x1da8('0x1b')](saveUpdates(_0x38a0d2[_0x1da8('0x50')],null))[_0x1da8('0x1b')](respondWithResult(_0x1277ff,null))[_0x1da8('0x26')](handleError(_0x1277ff,null));};var utilLicense=require(_0x1da8('0x61'));exports[_0x1da8('0x76')]=function(_0x177299,_0x3c8a1b,_0x5dc7b9){var _0x5c9679=_0x1da8('0x63');var _0x9328e1={'custom':![]};return utilLicense[_0x1da8('0x71')]()[_0x1da8('0x1b')](function(_0x5df1fc){if(_0x5df1fc){_0x9328e1=_0x5df1fc;}return db[_0x1da8('0x33')]['find']({'where':{'id':_0x177299[_0x1da8('0x4c')]['id']},'attributes':[_0x1da8('0x67'),'loginLogo',_0x1da8('0x64'),_0x1da8('0x72'),_0x1da8('0x65'),_0x1da8('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c8a1b,null))[_0x1da8('0x1b')](function(_0x44582d){if(_0x44582d){var _0x185f63=_0x44582d['preferred']&&fs['existsSync'](path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x5c9679,_[_0x1da8('0x68')](_0x44582d[_0x1da8('0x64')])))?path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x5c9679,_[_0x1da8('0x68')](_0x44582d[_0x1da8('0x64')])):path[_0x1da8('0x52')](config[_0x1da8('0x55')],_0x5c9679,_['toLower'](_0x1da8('0x77')));var _0x7253bd=_0x1da8('0x74')+_[_0x1da8('0x6a')]('preferred');if(_0x44582d[_0x7253bd]||!_0x9328e1[_0x1da8('0x6b')]||!_0x9328e1[_0x1da8('0x64')]){_0x185f63=path['join'](config[_0x1da8('0x55')],_0x5c9679,_[_0x1da8('0x68')](_0x1da8('0x77')));}if(!fs[_0x1da8('0x6c')](_0x185f63)){throw new db[(_0x1da8('0x6d'))][(_0x1da8('0x6e'))](_0x1da8('0x78'));}return _0x3c8a1b[_0x1da8('0x6f')](_0x185f63);}})[_0x1da8('0x26')](handleError(_0x3c8a1b,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5b52b63..a2067b6 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 _0xf006=['moment','bluebird','define','Setting','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf006,0x9a));var _0x6f00=function(_0x196bef,_0x279a4e){_0x196bef=_0x196bef-0x0;var _0x2f9702=_0xf006[_0x196bef];return _0x2f9702;};'use strict';var _=require(_0x6f00('0x0'));var util=require(_0x6f00('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6f00('0x2'));var BPromise=require(_0x6f00('0x3'));var rp=require('request-promise');var attributes=require('./setting.attributes');module['exports']=function(_0x33134e,_0x47cf1d){return _0x33134e[_0x6f00('0x4')](_0x6f00('0x5'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be9=['request-promise','./setting.attributes','define','Setting','settings','lodash','util','../../config/logger','api'];(function(_0x7a1bb3,_0x546a21){var _0x31ffcd=function(_0x59a8dd){while(--_0x59a8dd){_0x7a1bb3['push'](_0x7a1bb3['shift']());}};_0x31ffcd(++_0x546a21);}(_0x2be9,0x16d));var _0x92be=function(_0x565d34,_0x4176da){_0x565d34=_0x565d34-0x0;var _0x3751e7=_0x2be9[_0x565d34];return _0x3751e7;};'use strict';var _=require(_0x92be('0x0'));var util=require(_0x92be('0x1'));var logger=require(_0x92be('0x2'))(_0x92be('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x92be('0x4'));var attributes=require(_0x92be('0x5'));module['exports']=function(_0x4724ba,_0x3a24c4){return _0x4724ba[_0x92be('0x6')](_0x92be('0x7'),attributes,{'tableName':_0x92be('0x8'),'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 62dde02..93763fe 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 _0x7cdc=['randomstring','../../mysqldb','../../config/logger','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x7cdc,0x12c));var _0xc7cd=function(_0x2ef02a,_0x508b3c){_0x2ef02a=_0x2ef02a-0x0;var _0x92582e=_0x7cdc[_0x2ef02a];return _0x92582e;};'use strict';var _=require(_0xc7cd('0x0'));var util=require(_0xc7cd('0x1'));var moment=require(_0xc7cd('0x2'));var BPromise=require(_0xc7cd('0x3'));var rs=require(_0xc7cd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7cd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc7cd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdb9464,_0x5ddee4,_0x17fbda){return new BPromise(function(_0x18ffb8,_0x5c474d){return client[_0xc7cd('0x8')](_0xdb9464,_0x17fbda)[_0xc7cd('0x9')](function(_0xc6342c){logger[_0xc7cd('0xa')](_0xc7cd('0xb'),_0x5ddee4,'request\x20sent');logger[_0xc7cd('0xc')](_0xc7cd('0xd'),_0x5ddee4,_0xc7cd('0xe'),JSON['stringify'](_0xc6342c));if(_0xc6342c['error']){if(_0xc6342c[_0xc7cd('0xf')][_0xc7cd('0x10')]===0x1f4){logger[_0xc7cd('0xf')]('Setting,\x20%s,\x20%s',_0x5ddee4,_0xc6342c['error'][_0xc7cd('0x11')]);return _0x5c474d(_0xc6342c[_0xc7cd('0xf')][_0xc7cd('0x11')]);}logger['error'](_0xc7cd('0xb'),_0x5ddee4,_0xc6342c[_0xc7cd('0xf')][_0xc7cd('0x11')]);return _0x18ffb8(_0xc6342c['error'][_0xc7cd('0x11')]);}else{logger[_0xc7cd('0xa')](_0xc7cd('0xb'),_0x5ddee4,_0xc7cd('0xe'));_0x18ffb8(_0xc6342c['result']['message']);}})[_0xc7cd('0x12')](function(_0x1b1ac8){logger[_0xc7cd('0xf')](_0xc7cd('0xb'),_0x5ddee4,_0x1b1ac8);_0x5c474d(_0x1b1ac8);});});} \ No newline at end of file +var _0xa933=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1510be,_0x2a10bf){var _0x33f075=function(_0x5144f3){while(--_0x5144f3){_0x1510be['push'](_0x1510be['shift']());}};_0x33f075(++_0x2a10bf);}(_0xa933,0x69));var _0x3a93=function(_0x3b18b2,_0x2f4006){_0x3b18b2=_0x3b18b2-0x0;var _0x2e459e=_0xa933[_0x3b18b2];return _0x2e459e;};'use strict';var _=require(_0x3a93('0x0'));var util=require(_0x3a93('0x1'));var moment=require(_0x3a93('0x2'));var BPromise=require(_0x3a93('0x3'));var rs=require(_0x3a93('0x4'));var fs=require('fs');var Redis=require(_0x3a93('0x5'));var db=require(_0x3a93('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a93('0x7'))(_0x3a93('0x8'));var config=require(_0x3a93('0x9'));var jayson=require(_0x3a93('0xa'));var client=jayson[_0x3a93('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6639,_0x8ef7d1,_0x2c0889){return new BPromise(function(_0x499856,_0x577baa){return client[_0x3a93('0xc')](_0x1f6639,_0x2c0889)[_0x3a93('0xd')](function(_0x36c666){logger['info'](_0x3a93('0xe'),_0x8ef7d1,_0x3a93('0xf'));logger[_0x3a93('0x10')](_0x3a93('0x11'),_0x8ef7d1,_0x3a93('0xf'),JSON[_0x3a93('0x12')](_0x36c666));if(_0x36c666[_0x3a93('0x13')]){if(_0x36c666['error'][_0x3a93('0x14')]===0x1f4){logger['error'](_0x3a93('0xe'),_0x8ef7d1,_0x36c666[_0x3a93('0x13')][_0x3a93('0x15')]);return _0x577baa(_0x36c666[_0x3a93('0x13')][_0x3a93('0x15')]);}logger[_0x3a93('0x13')]('Setting,\x20%s,\x20%s',_0x8ef7d1,_0x36c666[_0x3a93('0x13')][_0x3a93('0x15')]);return _0x499856(_0x36c666[_0x3a93('0x13')]['message']);}else{logger[_0x3a93('0x16')]('Setting,\x20%s,\x20%s',_0x8ef7d1,_0x3a93('0xf'));_0x499856(_0x36c666[_0x3a93('0x17')][_0x3a93('0x15')]);}})[_0x3a93('0x18')](function(_0x6b0950){logger[_0x3a93('0x13')](_0x3a93('0xe'),_0x8ef7d1,_0x6b0950);_0x577baa(_0x6b0950);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 098da2f..e6adb39 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 _0x102c=['destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','express','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addApplications','/:id/send','send','status','put','delete'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x102c,0xf9));var _0xc102=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x102c[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xc102('0x0'));var util=require(_0xc102('0x1'));var path=require(_0xc102('0x2'));var timeout=require('connect-timeout');var express=require(_0xc102('0x3'));var router=express['Router']();var auth=require(_0xc102('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc102('0x5'));var controller=require(_0xc102('0x6'));router['get']('/',auth[_0xc102('0x7')](),controller[_0xc102('0x8')]);router[_0xc102('0x9')](_0xc102('0xa'),auth[_0xc102('0x7')](),controller[_0xc102('0xb')]);router[_0xc102('0x9')](_0xc102('0xc'),auth[_0xc102('0x7')](),controller['show']);router[_0xc102('0x9')](_0xc102('0xd'),auth[_0xc102('0x7')](),controller['getDispositions']);router[_0xc102('0x9')](_0xc102('0xe'),auth[_0xc102('0x7')](),controller['getAnswers']);router[_0xc102('0x9')](_0xc102('0xf'),auth[_0xc102('0x7')](),controller[_0xc102('0x10')]);router['get'](_0xc102('0x11'),auth[_0xc102('0x7')](),controller['getInteractions']);router['get'](_0xc102('0x12'),controller[_0xc102('0x13')]);router[_0xc102('0x9')](_0xc102('0x14'),auth[_0xc102('0x7')](),controller[_0xc102('0x15')]);router[_0xc102('0x16')]('/',auth[_0xc102('0x7')](),controller[_0xc102('0x17')]);router[_0xc102('0x16')](_0xc102('0xd'),auth['isAuthenticated'](),controller[_0xc102('0x18')]);router['post'](_0xc102('0xe'),auth[_0xc102('0x7')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0xc102('0x16')](_0xc102('0xf'),auth['isAuthenticated'](),controller[_0xc102('0x19')]);router['post'](_0xc102('0x1a'),auth[_0xc102('0x7')](),controller[_0xc102('0x1b')]);router[_0xc102('0x16')](_0xc102('0x12'),controller[_0xc102('0x1c')]);router[_0xc102('0x16')](_0xc102('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0xc102('0x1d')](_0xc102('0xc'),auth[_0xc102('0x7')](),controller['update']);router[_0xc102('0x1e')](_0xc102('0xc'),auth[_0xc102('0x7')](),controller[_0xc102('0x1f')]);router[_0xc102('0x1e')](_0xc102('0xd'),auth[_0xc102('0x7')](),controller[_0xc102('0x20')]);router[_0xc102('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc102('0x21')]);router[_0xc102('0x1e')](_0xc102('0x14'),auth[_0xc102('0x7')](),controller[_0xc102('0x22')]);module['exports']=router; \ No newline at end of file +var _0x7c24=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','send','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xaa311d,_0x22d729){var _0x3fc472=function(_0x101941){while(--_0x101941){_0xaa311d['push'](_0xaa311d['shift']());}};_0x3fc472(++_0x22d729);}(_0x7c24,0xf9));var _0x47c2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7c24[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x47c2('0x0'));var util=require(_0x47c2('0x1'));var path=require(_0x47c2('0x2'));var timeout=require(_0x47c2('0x3'));var express=require(_0x47c2('0x4'));var router=express[_0x47c2('0x5')]();var auth=require(_0x47c2('0x6'));var interaction=require(_0x47c2('0x7'));var config=require(_0x47c2('0x8'));var controller=require(_0x47c2('0x9'));router[_0x47c2('0xa')]('/',auth[_0x47c2('0xb')](),controller[_0x47c2('0xc')]);router[_0x47c2('0xa')]('/describe',auth[_0x47c2('0xb')](),controller['describe']);router[_0x47c2('0xa')](_0x47c2('0xd'),auth[_0x47c2('0xb')](),controller[_0x47c2('0xe')]);router[_0x47c2('0xa')](_0x47c2('0xf'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x10')]);router[_0x47c2('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x47c2('0xa')]('/:id/applications',auth[_0x47c2('0xb')](),controller[_0x47c2('0x11')]);router['get'](_0x47c2('0x12'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x13')]);router[_0x47c2('0xa')](_0x47c2('0x14'),controller[_0x47c2('0x15')]);router[_0x47c2('0xa')]('/:id/users',auth[_0x47c2('0xb')](),controller[_0x47c2('0x16')]);router['post']('/',auth[_0x47c2('0xb')](),controller[_0x47c2('0x17')]);router[_0x47c2('0x18')](_0x47c2('0xf'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x19')]);router[_0x47c2('0x18')](_0x47c2('0x1a'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x1b')]);router[_0x47c2('0x18')](_0x47c2('0x1c'),controller[_0x47c2('0x1d')]);router['post'](_0x47c2('0x1e'),auth[_0x47c2('0xb')](),controller['addApplications']);router['post'](_0x47c2('0x1f'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x20')]);router['post'](_0x47c2('0x14'),controller['status']);router['post'](_0x47c2('0x21'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x22')]);router[_0x47c2('0x23')](_0x47c2('0xd'),auth['isAuthenticated'](),controller[_0x47c2('0x24')]);router[_0x47c2('0x25')](_0x47c2('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x47c2('0x25')](_0x47c2('0xf'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x26')]);router[_0x47c2('0x25')](_0x47c2('0x1a'),auth[_0x47c2('0xb')](),controller[_0x47c2('0x27')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x47c2('0x28')]);module[_0x47c2('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 60db856..e25eebf 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 _0xa1d2=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','connectel','clicksend','clickatell','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x5188b7,_0x27ca23){var _0x371b20=function(_0x570e4f){while(--_0x570e4f){_0x5188b7['push'](_0x5188b7['shift']());}};_0x371b20(++_0x27ca23);}(_0xa1d2,0x152));var _0x2a1d=function(_0xf2745d,_0x2a068a){_0xf2745d=_0xf2745d-0x0;var _0x57eeea=_0xa1d2[_0xf2745d];return _0x57eeea;};'use strict';var Sequelize=require(_0x2a1d('0x0'));var rs=require(_0x2a1d('0x1'));module[_0x2a1d('0x2')]={'name':{'type':Sequelize[_0x2a1d('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x2a1d('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2a1d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x2a1d('0x3')]},'type':{'type':Sequelize[_0x2a1d('0x4')](_0x2a1d('0x5'),_0x2a1d('0x6'),_0x2a1d('0x7'),_0x2a1d('0x8'),'plivo',_0x2a1d('0x9'),'csc',_0x2a1d('0xa'),_0x2a1d('0xb'))},'accountSid':{'type':Sequelize[_0x2a1d('0x3')]},'authId':{'type':Sequelize[_0x2a1d('0x3')]},'authToken':{'type':Sequelize[_0x2a1d('0x3')]},'smsMethod':{'type':Sequelize[_0x2a1d('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2a1d('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x2a1d('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x2a1d('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x2a1d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2a1d('0xd')],'defaultValue':function(){return _0x2a1d('0xe');}},'notificationSound':{'type':Sequelize[_0x2a1d('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2a1d('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2a1d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2a1d('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2a1d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2a1d('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2a1d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2a1d('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2a1d('0x11'),'set':function(_0x3a21a2){if(!_0x3a21a2)this['setDataValue'](_0x2a1d('0x12'),null);this[_0x2a1d('0x13')](_0x2a1d('0x14'),_0x3a21a2);}}}; \ No newline at end of file +var _0xf175=['clicksend','plivo','clickatell','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate','ENUM','skebby'];(function(_0x48ac7f,_0xb8ec44){var _0x50a9b6=function(_0x46d1fa){while(--_0x46d1fa){_0x48ac7f['push'](_0x48ac7f['shift']());}};_0x50a9b6(++_0xb8ec44);}(_0xf175,0x150));var _0x5f17=function(_0x9a5e8d,_0x22325c){_0x9a5e8d=_0x9a5e8d-0x0;var _0x40e9f3=_0xf175[_0x9a5e8d];return _0x40e9f3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5f17('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5f17('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x5f17('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5f17('0x2')],'defaultValue':function(){return rs[_0x5f17('0x3')]();}},'phone':{'type':Sequelize[_0x5f17('0x2')]},'type':{'type':Sequelize[_0x5f17('0x4')]('twilio',_0x5f17('0x5'),'connectel',_0x5f17('0x6'),_0x5f17('0x7'),_0x5f17('0x8'),'csc',_0x5f17('0x9'),'intelepeer')},'accountSid':{'type':Sequelize[_0x5f17('0x2')]},'authId':{'type':Sequelize[_0x5f17('0x2')]},'authToken':{'type':Sequelize[_0x5f17('0x2')]},'smsMethod':{'type':Sequelize[_0x5f17('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5f17('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x5f17('0x2')]},'senderString':{'type':Sequelize[_0x5f17('0x2')]},'deliveryReport':{'type':Sequelize[_0x5f17('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5f17('0xb')],'defaultValue':function(){return _0x5f17('0xc');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f17('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f17('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f17('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f17('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f17('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5f17('0xd')],'comment':_0x5f17('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x5f17('0xa')],'defaultValue':![],'comment':_0x5f17('0xf'),'set':function(_0x4094c6){if(!_0x4094c6)this[_0x5f17('0x10')](_0x5f17('0x11'),null);this[_0x5f17('0x10')](_0x5f17('0x12'),_0x4094c6);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b9871ac..81ad4c1 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 _0x383b=['includeAll','findAll','rows','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','pick','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','Start','startRouting','entity\x20found','Content-Type','text/xml','send','\x0a','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','status_code','groupName','clickatell','redif','DELIVERED','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','SmsAccounts','sendStatus','name','index','Pause','SmsAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','type','key','field','filter','options'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x383b,0x89));var _0xb383=function(_0x4b0406,_0x42c4d9){_0x4b0406=_0x4b0406-0x0;var _0x58ccd9=_0x383b[_0x4b0406];return _0x58ccd9;};'use strict';var pdf=require(_0xb383('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb383('0x1'));var zipdir=require(_0xb383('0x2'));var jsonpatch=require(_0xb383('0x3'));var rp=require('request-promise');var moment=require(_0xb383('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb383('0x5'));var util=require(_0xb383('0x6'));var path=require(_0xb383('0x7'));var sox=require(_0xb383('0x8'));var csv=require(_0xb383('0x9'));var ejs=require(_0xb383('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb383('0xb'));var crypto=require(_0xb383('0xc'));var jsforce=require(_0xb383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb383('0xe'));var Papa=require(_0xb383('0xf'));var authService=require(_0xb383('0x10'));var hardwareService=require(_0xb383('0x11'));var Redis=require('ioredis');var qs=require(_0xb383('0x12'));var logger=require(_0xb383('0x13'))(_0xb383('0x14'));var utils=require(_0xb383('0x15'));var config=require(_0xb383('0x16'));var db=require('../../mysqldb')['db'];config[_0xb383('0x17')]=_[_0xb383('0x18')](config['redis'],{'host':_0xb383('0x19'),'port':0x18eb});var socket=require(_0xb383('0x1a'))(new Redis(config[_0xb383('0x17')]));require(_0xb383('0x1b'))[_0xb383('0x1c')](socket);var jayson=require(_0xb383('0x1d'));var client=jayson[_0xb383('0x1e')][_0xb383('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2ab7fb,_0x20bd11,_0x1cdcb7,_0xfbc68f){return new BPromise(function(_0x4b3cb5,_0x41cf3f){var _0x1697e0=_0xfbc68f||client;return _0x1697e0[_0xb383('0x20')](_0x2ab7fb,_0x1cdcb7)['then'](function(_0x39732c){logger[_0xb383('0x21')](_0xb383('0x22'),_0x20bd11,_0xb383('0x23'));logger[_0xb383('0x24')](_0xb383('0x25'),_0x20bd11,'request\x20sent',JSON[_0xb383('0x26')](_0x39732c));if(_0x39732c['error']){if(_0x39732c[_0xb383('0x27')][_0xb383('0x28')]===0x1f4){logger[_0xb383('0x27')](_0xb383('0x22'),_0x20bd11,_0x39732c[_0xb383('0x27')]['message']);return _0x41cf3f(_0x39732c[_0xb383('0x27')][_0xb383('0x29')]);}logger[_0xb383('0x27')]('SmsAccount,\x20%s,\x20%s',_0x20bd11,_0x39732c[_0xb383('0x27')][_0xb383('0x29')]);return _0x4b3cb5(_0x39732c[_0xb383('0x27')]['message']);}else{logger['info'](_0xb383('0x22'),_0x20bd11,_0xb383('0x23'));_0x4b3cb5(_0x39732c[_0xb383('0x2a')][_0xb383('0x29')]);}})[_0xb383('0x2b')](function(_0x2b5af5){logger[_0xb383('0x27')](_0xb383('0x22'),_0x20bd11,_0x2b5af5);_0x41cf3f(_0x2b5af5);});});}function respondWithStatusCode(_0x3fa745,_0x48ceef){_0x48ceef=_0x48ceef||0xcc;return function(_0x30f704){if(_0x30f704){return _0x3fa745['sendStatus'](_0x48ceef);}return _0x3fa745[_0xb383('0x2c')](_0x48ceef)[_0xb383('0x2d')]();};}function respondWithResult(_0xa5c39a,_0x39f1fb){_0x39f1fb=_0x39f1fb||0xc8;return function(_0x1a0928){if(_0x1a0928){return _0xa5c39a[_0xb383('0x2c')](_0x39f1fb)[_0xb383('0x2e')](_0x1a0928);}};}function respondWithFilteredResult(_0x5e9f1c,_0x3a5362){return function(_0x10ad79){if(_0x10ad79){var _0xe7d55d=_0x10ad79[_0xb383('0x2f')],_0x2d304c=_0x3a5362['offset'],_0x4daf45=_0x3a5362[_0xb383('0x30')]+_0x3a5362[_0xb383('0x31')],_0x3797b7;if(_0x4daf45>=_0xe7d55d){_0x4daf45=_0xe7d55d;_0x3797b7=0xc8;}else{_0x3797b7=0xce;}_0x5e9f1c[_0xb383('0x2c')](_0x3797b7);return _0x5e9f1c[_0xb383('0x32')]('Content-Range',_0x2d304c+'-'+_0x4daf45+'/'+_0xe7d55d)[_0xb383('0x2e')](_0x10ad79);}return null;};}function patchUpdates(_0x45a12b){return function(_0x5424b3){try{jsonpatch[_0xb383('0x33')](_0x5424b3,_0x45a12b,!![]);}catch(_0x28d81a){return BPromise[_0xb383('0x34')](_0x28d81a);}return _0x5424b3[_0xb383('0x35')]();};}function saveUpdates(_0x2cfc17,_0x8eb2c5){return function(_0x534949){if(_0x534949){return _0x534949[_0xb383('0x36')](_0x2cfc17)[_0xb383('0x37')](function(_0x2a0dac){return _0x2a0dac;});}return null;};}function removeEntity(_0x107cf5,_0x40fcf7){return function(_0x12f68e){if(_0x12f68e){return _0x12f68e[_0xb383('0x38')]()[_0xb383('0x37')](function(){var _0x5289d3=_0x12f68e[_0xb383('0x39')]({'plain':!![]});var _0x1023c3=_0xb383('0x3a');return db['UserProfileResource'][_0xb383('0x38')]({'where':{'type':_0x1023c3,'resourceId':_0x5289d3['id']}})[_0xb383('0x37')](function(){return _0x12f68e;});})['then'](function(){_0x107cf5[_0xb383('0x2c')](0xcc)[_0xb383('0x2d')]();});}};}function handleEntityNotFound(_0x35d565,_0x56a531){return function(_0x117003){if(!_0x117003){_0x35d565[_0xb383('0x3b')](0x194);}return _0x117003;};}function handleError(_0x2a3fe7,_0x1e3822){_0x1e3822=_0x1e3822||0x1f4;return function(_0x3da717){logger[_0xb383('0x27')](_0x3da717['stack']);if(_0x3da717[_0xb383('0x3c')]){delete _0x3da717[_0xb383('0x3c')];}_0x2a3fe7[_0xb383('0x2c')](_0x1e3822)['send'](_0x3da717);};}exports[_0xb383('0x3d')]=function(_0x2d0371,_0x3a9fb2){var _0x3b2210={'include':[{'model':db[_0xb383('0x3e')],'as':'mandatoryDispositionPause'}]},_0x277a83={},_0x449eaa={'count':0x0,'rows':[]};var _0x487e2f=db[_0xb383('0x3f')][_0xb383('0x40')];_0x277a83[_0xb383('0x41')]=_[_0xb383('0x42')](_0x487e2f);_0x277a83[_0xb383('0x43')]=_[_0xb383('0x42')](_0x2d0371[_0xb383('0x43')]);_0x277a83[_0xb383('0x44')]=_['intersection'](_0x277a83[_0xb383('0x41')],_0x277a83[_0xb383('0x43')]);_0x3b2210[_0xb383('0x45')]=_[_0xb383('0x46')](_0x277a83['model'],qs[_0xb383('0x47')](_0x2d0371[_0xb383('0x43')]['fields']));_0x3b2210[_0xb383('0x45')]=_0x3b2210['attributes'][_0xb383('0x48')]?_0x3b2210[_0xb383('0x45')]:_0x277a83[_0xb383('0x41')];if(!_0x2d0371[_0xb383('0x43')]['hasOwnProperty'](_0xb383('0x49'))){_0x3b2210['limit']=qs[_0xb383('0x31')](_0x2d0371['query'][_0xb383('0x31')]);_0x3b2210[_0xb383('0x30')]=qs[_0xb383('0x30')](_0x2d0371[_0xb383('0x43')][_0xb383('0x30')]);}_0x3b2210[_0xb383('0x4a')]=qs[_0xb383('0x4b')](_0x2d0371[_0xb383('0x43')][_0xb383('0x4b')]);_0x3b2210[_0xb383('0x4c')]=qs[_0xb383('0x44')](_['pick'](_0x2d0371[_0xb383('0x43')],_0x277a83[_0xb383('0x44')]));if(_0x2d0371[_0xb383('0x43')]['filter']){_0x3b2210[_0xb383('0x4c')]=_[_0xb383('0x4d')](_0x3b2210[_0xb383('0x4c')],{'$or':_['map'](_0x487e2f,function(_0x518b14){if(_0x518b14[_0xb383('0x4e')][_0xb383('0x4f')]!=='VIRTUAL'){var _0x446475={};_0x446475[_0x518b14[_0xb383('0x50')]]={'$like':'%'+_0x2d0371[_0xb383('0x43')][_0xb383('0x51')]+'%'};return _0x446475;}})});}_0x3b2210=_[_0xb383('0x4d')]({},_0x3b2210,_0x2d0371[_0xb383('0x52')]);var _0x528bf9={'where':_0x3b2210[_0xb383('0x4c')]};return db[_0xb383('0x3f')]['count'](_0x528bf9)['then'](function(_0x1c29fd){_0x449eaa['count']=_0x1c29fd;if(_0x2d0371[_0xb383('0x43')][_0xb383('0x53')]){_0x3b2210['include']=[{'all':!![]}];}return db[_0xb383('0x3f')][_0xb383('0x54')](_0x3b2210);})[_0xb383('0x37')](function(_0x3c1ab8){_0x449eaa[_0xb383('0x55')]=_0x3c1ab8;return _0x449eaa;})[_0xb383('0x37')](respondWithFilteredResult(_0x3a9fb2,_0x3b2210))['catch'](handleError(_0x3a9fb2,null));};exports['show']=function(_0x14d177,_0x55fb76){var _0x3e28c6={'raw':![],'where':{'id':_0x14d177['params']['id']},'include':[{'model':db[_0xb383('0x3e')],'as':'mandatoryDispositionPause'}]},_0x11d804={};_0x11d804['model']=_['keys'](db[_0xb383('0x3f')]['rawAttributes']);_0x11d804[_0xb383('0x43')]=_['keys'](_0x14d177[_0xb383('0x43')]);_0x11d804[_0xb383('0x44')]=_['intersection'](_0x11d804['model'],_0x11d804[_0xb383('0x43')]);_0x3e28c6['attributes']=_[_0xb383('0x46')](_0x11d804[_0xb383('0x41')],qs['fields'](_0x14d177[_0xb383('0x43')][_0xb383('0x47')]));_0x3e28c6[_0xb383('0x45')]=_0x3e28c6[_0xb383('0x45')]['length']?_0x3e28c6[_0xb383('0x45')]:_0x11d804[_0xb383('0x41')];if(_0x14d177[_0xb383('0x43')]['includeAll']){_0x3e28c6[_0xb383('0x56')]=[{'all':!![]}];}_0x3e28c6=_[_0xb383('0x4d')]({},_0x3e28c6,_0x14d177['options']);return db['SmsAccount'][_0xb383('0x57')](_0x3e28c6)[_0xb383('0x37')](handleEntityNotFound(_0x55fb76,null))['then'](respondWithResult(_0x55fb76,null))[_0xb383('0x2b')](handleError(_0x55fb76,null));};exports[_0xb383('0x58')]=function(_0x17fd52,_0x179d16){return db[_0xb383('0x3f')][_0xb383('0x58')](_0x17fd52[_0xb383('0x59')],{})['then'](function(_0x449672){var _0xa0e72c=_0x17fd52['user']['get']({'plain':!![]});if(!_0xa0e72c)throw new Error(_0xb383('0x5a'));if(_0xa0e72c[_0xb383('0x5b')]===_0xb383('0x5c')){var _0xac57b6=_0x449672[_0xb383('0x39')]({'plain':!![]});var _0x1f9ac7=_0xb383('0x3a');return db[_0xb383('0x5d')][_0xb383('0x57')]({'where':{'name':_0x1f9ac7,'userProfileId':_0xa0e72c[_0xb383('0x5e')]},'raw':!![]})[_0xb383('0x37')](function(_0x5de005){if(_0x5de005&&_0x5de005[_0xb383('0x5f')]===0x0){return db['UserProfileResource'][_0xb383('0x58')]({'name':_0xac57b6[_0xb383('0x3c')],'resourceId':_0xac57b6['id'],'type':_0x5de005[_0xb383('0x3c')],'sectionId':_0x5de005['id']},{})[_0xb383('0x37')](function(){return _0x449672;});}else{return _0x449672;}})[_0xb383('0x2b')](function(_0x4714a1){logger['error'](_0xb383('0x60'),_0x4714a1);throw _0x4714a1;});}return _0x449672;})[_0xb383('0x37')](respondWithResult(_0x179d16,0xc9))[_0xb383('0x2b')](handleError(_0x179d16,null));};exports[_0xb383('0x36')]=function(_0x484a7e,_0x22c083){if(_0x484a7e[_0xb383('0x59')]['id']){delete _0x484a7e[_0xb383('0x59')]['id'];}return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x484a7e[_0xb383('0x61')]['id']},'include':[{'model':db[_0xb383('0x3e')],'as':_0xb383('0x62')}]})[_0xb383('0x37')](handleEntityNotFound(_0x22c083,null))['then'](saveUpdates(_0x484a7e[_0xb383('0x59')],null))[_0xb383('0x37')](respondWithResult(_0x22c083,null))[_0xb383('0x2b')](handleError(_0x22c083,null));};exports[_0xb383('0x38')]=function(_0xa35225,_0x410273){return db[_0xb383('0x3f')]['find']({'where':{'id':_0xa35225[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x410273,null))[_0xb383('0x37')](removeEntity(_0x410273,null))[_0xb383('0x2b')](handleError(_0x410273,null));};exports[_0xb383('0x63')]=function(_0x52c499,_0x418c89){return db[_0xb383('0x3f')][_0xb383('0x63')]()[_0xb383('0x37')](respondWithResult(_0x418c89,null))[_0xb383('0x2b')](handleError(_0x418c89,null));};exports[_0xb383('0x64')]=function(_0x120773,_0x5c806f,_0x1d129e){if(_0x120773[_0xb383('0x59')]['id']){delete _0x120773[_0xb383('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x120773[_0xb383('0x61')]['id']}})['then'](handleEntityNotFound(_0x5c806f,null))[_0xb383('0x37')](function(_0x10c527){if(_0x10c527){_0x120773[_0xb383('0x59')][_0xb383('0x65')]=_0x10c527['id'];return db[_0xb383('0x66')]['create'](_0x120773[_0xb383('0x59')]);}})[_0xb383('0x37')](respondWithResult(_0x5c806f,null))[_0xb383('0x2b')](handleError(_0x5c806f,null));};exports['getDispositions']=function(_0x1bec24,_0x3e81c3,_0x32ae80){var _0x141113={'raw':![],'where':{}};var _0x3af3c0={};var _0xbeb937={'count':0x0,'rows':[]};return db[_0xb383('0x3f')][_0xb383('0x67')]({'where':{'id':_0x1bec24['params']['id']}})['then'](handleEntityNotFound(_0x3e81c3,null))[_0xb383('0x37')](function(_0x5369b3){if(_0x5369b3){_0x3af3c0[_0xb383('0x41')]=_[_0xb383('0x42')](db[_0xb383('0x66')][_0xb383('0x40')]);_0x3af3c0['query']=_[_0xb383('0x42')](_0x1bec24[_0xb383('0x43')]);_0x3af3c0[_0xb383('0x44')]=_['intersection'](_0x3af3c0[_0xb383('0x41')],_0x3af3c0[_0xb383('0x43')]);_0x141113[_0xb383('0x45')]=_[_0xb383('0x46')](_0x3af3c0[_0xb383('0x41')],qs[_0xb383('0x47')](_0x1bec24[_0xb383('0x43')][_0xb383('0x47')]));_0x141113['attributes']=_0x141113[_0xb383('0x45')][_0xb383('0x48')]?_0x141113['attributes']:_0x3af3c0['model'];if(!_0x1bec24[_0xb383('0x43')][_0xb383('0x68')]('nolimit')){_0x141113[_0xb383('0x31')]=qs[_0xb383('0x31')](_0x1bec24[_0xb383('0x43')][_0xb383('0x31')]);_0x141113[_0xb383('0x30')]=qs[_0xb383('0x30')](_0x1bec24['query'][_0xb383('0x30')]);}_0x141113[_0xb383('0x4a')]=qs[_0xb383('0x4b')](_0x1bec24['query'][_0xb383('0x4b')]);_0x141113[_0xb383('0x4c')]=qs['filters'](_[_0xb383('0x69')](_0x1bec24[_0xb383('0x43')],_0x3af3c0[_0xb383('0x44')]));_0x141113['where'][_0xb383('0x65')]=_0x5369b3['id'];if(_0x1bec24[_0xb383('0x43')]['filter']){_0x141113['where']=_[_0xb383('0x4d')](_0x141113[_0xb383('0x4c')],{'$or':_[_0xb383('0x6a')](_0x141113['attributes'],function(_0x1e6ccf){var _0x20792c={};_0x20792c[_0x1e6ccf]={'$like':'%'+_0x1bec24[_0xb383('0x43')]['filter']+'%'};return _0x20792c;})});}_0x141113=_[_0xb383('0x4d')]({},_0x141113,_0x1bec24[_0xb383('0x52')]);return db[_0xb383('0x66')][_0xb383('0x2f')]({'where':_0x141113[_0xb383('0x4c')]})['then'](function(_0xdb62fd){_0xbeb937[_0xb383('0x2f')]=_0xdb62fd;if(_0x1bec24[_0xb383('0x43')][_0xb383('0x53')]){_0x141113['include']=[{'all':!![]}];}return db['Disposition'][_0xb383('0x54')](_0x141113);})[_0xb383('0x37')](function(_0x298f5e){_0xbeb937[_0xb383('0x55')]=_0x298f5e;return _0xbeb937;});}})[_0xb383('0x37')](respondWithFilteredResult(_0x3e81c3,_0x141113))[_0xb383('0x2b')](handleError(_0x3e81c3,null));};exports[_0xb383('0x6b')]=function(_0x5baf3f,_0x1f61ca,_0x4ad0a5){var _0x43b0cb;return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x5baf3f['params']['id']}})['then'](handleEntityNotFound(_0x1f61ca,null))[_0xb383('0x37')](function(_0xd14db3){if(_0xd14db3){return _0xd14db3['removeDispositions'](_0x5baf3f[_0xb383('0x43')][_0xb383('0x6c')]);}})[_0xb383('0x37')](respondWithStatusCode(_0x1f61ca,null))[_0xb383('0x2b')](handleError(_0x1f61ca,null));};exports[_0xb383('0x6d')]=function(_0x51c662,_0x39ab7c,_0x5222b0){if(_0x51c662['body']['id']){delete _0x51c662[_0xb383('0x59')]['id'];}return db['SmsAccount'][_0xb383('0x57')]({'where':{'id':_0x51c662[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x39ab7c,null))[_0xb383('0x37')](function(_0x24c88c){if(_0x24c88c){_0x51c662[_0xb383('0x59')]['SmsAccountId']=_0x24c88c['id'];return db[_0xb383('0x6e')][_0xb383('0x58')](_0x51c662['body']);}})[_0xb383('0x37')](respondWithResult(_0x39ab7c,null))[_0xb383('0x2b')](handleError(_0x39ab7c,null));};exports[_0xb383('0x6f')]=function(_0x3212c4,_0x59d168,_0x59ab6e){var _0x4880b3={'raw':![],'where':{}};var _0xbc1a65={};var _0x127b6d={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x3212c4[_0xb383('0x61')]['id']}})['then'](handleEntityNotFound(_0x59d168,null))[_0xb383('0x37')](function(_0x5515ac){if(_0x5515ac){_0xbc1a65[_0xb383('0x41')]=_[_0xb383('0x42')](db[_0xb383('0x6e')][_0xb383('0x40')]);_0xbc1a65[_0xb383('0x43')]=_[_0xb383('0x42')](_0x3212c4[_0xb383('0x43')]);_0xbc1a65[_0xb383('0x44')]=_[_0xb383('0x46')](_0xbc1a65['model'],_0xbc1a65[_0xb383('0x43')]);_0x4880b3[_0xb383('0x45')]=_[_0xb383('0x46')](_0xbc1a65[_0xb383('0x41')],qs[_0xb383('0x47')](_0x3212c4['query'][_0xb383('0x47')]));_0x4880b3[_0xb383('0x45')]=_0x4880b3['attributes']['length']?_0x4880b3[_0xb383('0x45')]:_0xbc1a65[_0xb383('0x41')];if(!_0x3212c4[_0xb383('0x43')][_0xb383('0x68')](_0xb383('0x49'))){_0x4880b3[_0xb383('0x31')]=qs[_0xb383('0x31')](_0x3212c4[_0xb383('0x43')][_0xb383('0x31')]);_0x4880b3[_0xb383('0x30')]=qs[_0xb383('0x30')](_0x3212c4[_0xb383('0x43')][_0xb383('0x30')]);}_0x4880b3[_0xb383('0x4a')]=qs[_0xb383('0x4b')](_0x3212c4[_0xb383('0x43')][_0xb383('0x4b')]);_0x4880b3['where']=qs[_0xb383('0x44')](_[_0xb383('0x69')](_0x3212c4[_0xb383('0x43')],_0xbc1a65['filters']));_0x4880b3['where'][_0xb383('0x65')]=_0x5515ac['id'];if(_0x3212c4[_0xb383('0x43')][_0xb383('0x51')]){_0x4880b3[_0xb383('0x4c')]=_[_0xb383('0x4d')](_0x4880b3[_0xb383('0x4c')],{'$or':_[_0xb383('0x6a')](_0x4880b3[_0xb383('0x45')],function(_0xe10ab5){var _0x37c879={};_0x37c879[_0xe10ab5]={'$like':'%'+_0x3212c4[_0xb383('0x43')][_0xb383('0x51')]+'%'};return _0x37c879;})});}_0x4880b3=_['merge']({},_0x4880b3,_0x3212c4[_0xb383('0x52')]);return db[_0xb383('0x6e')][_0xb383('0x2f')]({'where':_0x4880b3[_0xb383('0x4c')]})[_0xb383('0x37')](function(_0x213c31){_0x127b6d[_0xb383('0x2f')]=_0x213c31;if(_0x3212c4['query']['includeAll']){_0x4880b3['include']=[{'all':!![]}];}return db[_0xb383('0x6e')][_0xb383('0x54')](_0x4880b3);})[_0xb383('0x37')](function(_0x776873){_0x127b6d[_0xb383('0x55')]=_0x776873;return _0x127b6d;});}})[_0xb383('0x37')](respondWithFilteredResult(_0x59d168,_0x4880b3))[_0xb383('0x2b')](handleError(_0x59d168,null));};exports[_0xb383('0x70')]=function(_0xd45456,_0x517d7b,_0x52a4cf){var _0x244da9;return db[_0xb383('0x3f')]['find']({'where':{'id':_0xd45456[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x517d7b,null))[_0xb383('0x37')](function(_0x1ba19f){if(_0x1ba19f){return _0x1ba19f[_0xb383('0x70')](_0xd45456[_0xb383('0x43')][_0xb383('0x6c')]);}})[_0xb383('0x37')](respondWithStatusCode(_0x517d7b,null))[_0xb383('0x2b')](handleError(_0x517d7b,null));};exports[_0xb383('0x71')]=function(_0x1c2c1b,_0x1b0258,_0x9b434){var _0x4a9bcc={'channel':_0xb383('0x72')};var _0x2088e9=[];var _0x322769=[];var _0x5d3579={};return db['SmsAccount'][_0xb383('0x57')]({'where':{'id':_0x1c2c1b['params']['id']},'include':[{'model':db[_0xb383('0x73')],'as':_0xb383('0x74')}]})['then'](handleEntityNotFound(_0x1b0258,null))[_0xb383('0x37')](function(_0x2937ae){_0x4a9bcc['account']=_0x2937ae;_0x4a9bcc[_0xb383('0x75')]=_['orderBy'](_0x2937ae[_0xb383('0x74')],[_0xb383('0x76')],[_0xb383('0x77')]);if(_0x4a9bcc[_0xb383('0x78')][_0xb383('0x74')]){delete _0x4a9bcc['account']['Applications'];}return db[_0xb383('0x79')][_0xb383('0x63')]();})['then'](function(_0x57bc5b){if(!_0x57bc5b){throw new db[(_0xb383('0x7a'))][(_0xb383('0x7b'))](_0xb383('0x7c'));}_0x2088e9=_[_0xb383('0x7d')](_[_0xb383('0x42')](_0x57bc5b),[_0xb383('0x7e'),_0xb383('0x7f')]);_0x322769=_[_0xb383('0x7d')](_['keys'](_0x57bc5b),[_0xb383('0x7e'),_0xb383('0x7f'),_0xb383('0x80'),_0xb383('0x81')]);_0x4a9bcc[_0xb383('0x59')]={'mapKey':'mobile'};if(_0x4a9bcc['account'][_0xb383('0x4e')]){switch(_0x4a9bcc[_0xb383('0x78')][_0xb383('0x4e')]){case _0xb383('0x82'):_0x4a9bcc[_0xb383('0x59')][_0xb383('0x83')]=_0x1c2c1b[_0xb383('0x59')]['From'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')]['Body'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x84')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x85')];break;case _0xb383('0x86'):_0x4a9bcc[_0xb383('0x59')][_0xb383('0x83')]='+'+_0x1c2c1b[_0xb383('0x59')]['sender'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x87')];break;case _0xb383('0x88'):_0x4a9bcc['body']['from']=_0x1c2c1b['body']['from'];_0x4a9bcc['body'][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')]['message'];break;case _0xb383('0x89'):_0x4a9bcc[_0xb383('0x59')]['from']=_0x1c2c1b[_0xb383('0x59')]['from'];_0x4a9bcc[_0xb383('0x59')]['body']=_0x1c2c1b[_0xb383('0x59')]['body'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x84')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x8a')];break;case _0xb383('0x8b'):_0x4a9bcc[_0xb383('0x59')][_0xb383('0x83')]=_0x1c2c1b['body'][_0xb383('0x8c')];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x8d')];_0x4a9bcc[_0xb383('0x59')]['messageId']=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x8e')];break;case _0xb383('0x8f'):_0x4a9bcc[_0xb383('0x59')]['from']='+'+_0x1c2c1b[_0xb383('0x59')][_0xb383('0x90')][0x0][_0xb383('0x83')];_0x4a9bcc['body']['body']=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x90')][0x0][_0xb383('0x87')];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x84')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x90')][0x0][_0xb383('0x84')];break;case'csc':_0x4a9bcc['body'][_0xb383('0x83')]=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x91')];_0x4a9bcc[_0xb383('0x59')]['body']=_0x1c2c1b['body']['segmentedMessage'][_0xb383('0x29')];break;case'clickatell':_0x4a9bcc['body']['from']=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x92')];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')]['text'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x84')]=_0x1c2c1b['body']['replyMessageId'];break;case _0xb383('0x93'):_0x4a9bcc['body'][_0xb383('0x83')]=_0x1c2c1b[_0xb383('0x59')]['from'];_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]=_0x1c2c1b[_0xb383('0x59')]['message'];_0x4a9bcc['body']['messageId']=_0x1c2c1b[_0xb383('0x59')][_0xb383('0x94')];break;}}if(_0x4a9bcc[_0xb383('0x59')]['id']){delete _0x4a9bcc[_0xb383('0x59')]['id'];}if(_[_0xb383('0x95')](_0x4a9bcc['body'][_0xb383('0x83')])){throw new db['Sequelize'][(_0xb383('0x7b'))](_0xb383('0x96'));}if(_[_0xb383('0x95')](_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')])||_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')]===''){throw new db['Sequelize'][(_0xb383('0x7b'))](_0xb383('0x97'));}if(_[_0xb383('0x95')](_0x4a9bcc[_0xb383('0x59')][_0xb383('0x98')])){throw new db['Sequelize'][(_0xb383('0x7b'))](_0xb383('0x99')+_0x322769);}if(!_[_0xb383('0x9a')](_0x322769,_0x4a9bcc['body'][_0xb383('0x98')])){throw new db[(_0xb383('0x7a'))][(_0xb383('0x7b'))](_0xb383('0x9b')+_0x322769);}_0x5d3579[_0x4a9bcc['body'][_0xb383('0x98')]]=_0x4a9bcc[_0xb383('0x59')][_0xb383('0x83')];return db['CmList']['find']({'where':{'id':_0x4a9bcc[_0xb383('0x78')][_0xb383('0x81')]},'include':[{'model':db[_0xb383('0x79')],'as':_0xb383('0x9c'),'where':_0x5d3579,'limit':0x1,'order':[[_0xb383('0x7f'),_0xb383('0x9d')]]}]});})[_0xb383('0x37')](handleEntityNotFound(_0x1b0258,null))[_0xb383('0x37')](function(_0x475d3c){if(_0x475d3c){_0x4a9bcc[_0xb383('0x9e')]=_['omit'](_0x475d3c,[_0xb383('0x9c')]);if(_0x475d3c[_0xb383('0x9c')][_0xb383('0x48')]){return _0x475d3c[_0xb383('0x9c')][0x0];}var _0x22c13b=_[_0xb383('0x18')](_0x4a9bcc[_0xb383('0x59')],{'firstName':_0x4a9bcc[_0xb383('0x59')]['from'],'ListId':_0x475d3c['id']});_0x22c13b[_0x4a9bcc[_0xb383('0x59')][_0xb383('0x98')]]=_0x4a9bcc[_0xb383('0x59')]['from'];return db[_0xb383('0x79')]['create'](_0x22c13b,{'fields':_0x2088e9,'raw':!![]});}})[_0xb383('0x37')](handleEntityNotFound(_0x1b0258,null))[_0xb383('0x37')](function(_0x56487a){if(_0x56487a){_0x4a9bcc[_0xb383('0x9f')]=_0x56487a;var _0x115598={'ContactId':_0x56487a['id'],'phone':_0x4a9bcc['body'][_0xb383('0x83')],'SmsAccountId':_0x1c2c1b[_0xb383('0x61')]['id']};var _0xf6874d={'ContactId':_0x56487a['id'],'SmsAccountId':_0x1c2c1b[_0xb383('0x61')]['id'],'closed':![]};return db[_0xb383('0xa0')]['find']({'where':_0xf6874d})['then'](function(_0xfcfd42){if(_0xfcfd42){return[_0xfcfd42,![]];}return db[_0xb383('0xa0')][_0xb383('0x58')](_0x115598)['then'](function(_0x8cd81e){return[_0x8cd81e,!![]];});});}})[_0xb383('0xa1')](function(_0x204b08,_0x4bcd51){_0x4a9bcc[_0xb383('0xa2')]=_0x204b08['get']({'plain':!![]});_0x4a9bcc[_0xb383('0xa2')][_0xb383('0xa3')]=![];if(_0x4bcd51){if(_0x4a9bcc[_0xb383('0x78')]['autoclose']){_0x4a9bcc[_0xb383('0x75')]['push']({'id':0x0,'priority':_0x4a9bcc[_0xb383('0x75')]['length']+0x1,'app':'close','appdata':_0xb383('0xa4'),'interval':_0xb383('0xa5')});}_0x4a9bcc[_0xb383('0xa2')]['created']=!![];}return db[_0xb383('0xa6')][_0xb383('0x58')]({'phone':_0x4a9bcc['body'][_0xb383('0x83')],'messageId':_0x4a9bcc[_0xb383('0x59')][_0xb383('0x84')],'body':_0x4a9bcc[_0xb383('0x59')][_0xb383('0x59')],'SmsAccountId':_0x1c2c1b[_0xb383('0x61')]['id'],'SmsInteractionId':_0x204b08['id'],'direction':'in','ContactId':_0x204b08[_0xb383('0xa7')],'AttachmentId':_0x4a9bcc[_0xb383('0x59')][_0xb383('0xa8')]});})[_0xb383('0x37')](function(_0x5a3303){_0x4a9bcc[_0xb383('0x29')]=_0x5a3303;if(_0x4a9bcc[_0xb383('0xa2')]['UserId']){return db[_0xb383('0xa9')]['find']({'attributes':['id',_0xb383('0x3c')],'where':{'id':_0x4a9bcc[_0xb383('0xa2')][_0xb383('0xaa')]}})[_0xb383('0x37')](function(_0xedf71f){if(_0xedf71f){_0x4a9bcc[_0xb383('0x75')][_0xb383('0xab')]({'id':0x0,'priority':0x0,'app':_0xb383('0xac'),'appdata':_0xedf71f[_0xb383('0x3c')]+','+(_0x4a9bcc[_0xb383('0x78')]['waitForTheAssignedAgent']||0xa),'interval':_0xb383('0xa5')});}return respondWithRpcPromise(_0xb383('0xad'),_0xb383('0xae'),_0x4a9bcc);});}return respondWithRpcPromise('Start',_0xb383('0xae'),_0x4a9bcc);})[_0xb383('0x37')](function(_0x5977a2){if(_0x5977a2){var _0x5e5dc4=0xc8;var _0x3d23c='receiveMessage';logger['info'](_0xb383('0x25'),_0x3d23c,_0x5e5dc4,_0xb383('0xaf'));logger[_0xb383('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d23c,_0x5e5dc4,'entity\x20found',JSON['stringify'](_0x5977a2));if(_0x4a9bcc[_0xb383('0x78')][_0xb383('0x4e')]===_0xb383('0x82')){return _0x1b0258[_0xb383('0x2c')](_0x5e5dc4)[_0xb383('0x32')](_0xb383('0xb0'),_0xb383('0xb1'))[_0xb383('0xb2')](_0xb383('0xb3'));}else{return _0x1b0258[_0xb383('0x2c')](_0x5e5dc4)[_0xb383('0x2e')](_0x5977a2);}}})[_0xb383('0x2b')](handleError(_0x1b0258,null));};exports['addApplications']=function(_0x1f179a,_0x1490c8,_0x5e88d5){return db[_0xb383('0x3f')][_0xb383('0x67')]({'where':{'id':_0x1f179a['params']['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x1490c8,null))[_0xb383('0x37')](function(_0x4a02bf){if(_0x4a02bf){return db[_0xb383('0xb4')][_0xb383('0xb5')](function(_0xf4e5a4){return db[_0xb383('0x73')][_0xb383('0x38')]({'where':{'SmsAccountId':_0x1f179a[_0xb383('0x61')]['id']},'transaction':_0xf4e5a4})['then'](function(_0x339175){var _0x361c04=_['map'](_0x1f179a[_0xb383('0x59')],function(_0x4fa187){_0x4fa187[_0xb383('0x65')]=_0x1f179a[_0xb383('0x61')]['id'];return _0x4fa187;});return db[_0xb383('0x73')][_0xb383('0xb6')](_0x361c04,{'transaction':_0xf4e5a4});});})['then'](function(){return db[_0xb383('0x73')][_0xb383('0xb7')]({'where':{'SmsAccountId':_0x1f179a['params']['id']},'order':_0xb383('0x76')});});}})[_0xb383('0x37')](respondWithResult(_0x1490c8,null))[_0xb383('0x2b')](handleError(_0x1490c8,null));};exports[_0xb383('0xb8')]=function(_0x33f372,_0x54a67f,_0x591eaa){var _0x16362c={};var _0x126bdb={};var _0x5f4f1a;var _0x4f8f0e;return db[_0xb383('0x3f')][_0xb383('0x67')]({'where':{'id':_0x33f372[_0xb383('0x61')]['id']}})['then'](handleEntityNotFound(_0x54a67f,null))[_0xb383('0x37')](function(_0x37aeb3){if(_0x37aeb3){_0x5f4f1a=_0x37aeb3;_0x126bdb[_0xb383('0x41')]=_['keys'](db['SmsApplication'][_0xb383('0x40')]);_0x126bdb[_0xb383('0x43')]=_[_0xb383('0x42')](_0x33f372[_0xb383('0x43')]);_0x126bdb[_0xb383('0x44')]=_[_0xb383('0x46')](_0x126bdb['model'],_0x126bdb[_0xb383('0x43')]);_0x16362c['attributes']=_[_0xb383('0x46')](_0x126bdb['model'],qs['fields'](_0x33f372['query'][_0xb383('0x47')]));_0x16362c[_0xb383('0x45')]=_0x16362c[_0xb383('0x45')][_0xb383('0x48')]?_0x16362c[_0xb383('0x45')]:_0x126bdb[_0xb383('0x41')];_0x16362c[_0xb383('0x4a')]=qs[_0xb383('0x4b')](_0x33f372['query'][_0xb383('0x4b')]);_0x16362c['where']=qs[_0xb383('0x44')](_[_0xb383('0x69')](_0x33f372[_0xb383('0x43')],_0x126bdb[_0xb383('0x44')]));if(_0x33f372[_0xb383('0x43')][_0xb383('0x51')]){_0x16362c['where']=_[_0xb383('0x4d')](_0x16362c[_0xb383('0x4c')],{'$or':_[_0xb383('0x6a')](_0x16362c[_0xb383('0x45')],function(_0x1cbb6c){var _0x52b556={};_0x52b556[_0x1cbb6c]={'$like':'%'+_0x33f372['query'][_0xb383('0x51')]+'%'};return _0x52b556;})});}_0x16362c=_['merge']({},_0x16362c,_0x33f372['options']);return _0x5f4f1a[_0xb383('0xb8')](_0x16362c);}})[_0xb383('0x37')](function(_0x5103b8){if(_0x5103b8){_0x4f8f0e=_0x5103b8[_0xb383('0x48')];if(!_0x33f372[_0xb383('0x43')][_0xb383('0x68')](_0xb383('0x49'))){_0x16362c['limit']=qs[_0xb383('0x31')](_0x33f372['query']['limit']);_0x16362c[_0xb383('0x30')]=qs['offset'](_0x33f372[_0xb383('0x43')][_0xb383('0x30')]);}return _0x5f4f1a[_0xb383('0xb8')](_0x16362c);}})['then'](function(_0xb99730){if(_0xb99730){return _0xb99730?{'count':_0x4f8f0e,'rows':_0xb99730}:null;}})[_0xb383('0x37')](respondWithResult(_0x54a67f,null))[_0xb383('0x2b')](handleError(_0x54a67f,null));};exports[_0xb383('0xb9')]=function(_0x3f27a3,_0x432541,_0x4505fb){var _0x1953a7={'raw':![],'where':{}};var _0x4fce46={};var _0x188bdc={'count':0x0,'rows':[]};return db[_0xb383('0x3f')][_0xb383('0x67')]({'where':{'id':_0x3f27a3[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x432541,null))['then'](function(_0x2f8f02){if(_0x2f8f02){_0x4fce46['model']=_[_0xb383('0x42')](db['SmsInteraction'][_0xb383('0x40')]);_0x4fce46[_0xb383('0x43')]=_['keys'](_0x3f27a3[_0xb383('0x43')]);_0x4fce46[_0xb383('0x44')]=_[_0xb383('0x46')](_0x4fce46[_0xb383('0x41')],_0x4fce46['query']);_0x1953a7['attributes']=_[_0xb383('0x46')](_0x4fce46[_0xb383('0x41')],qs['fields'](_0x3f27a3['query']['fields']));_0x1953a7[_0xb383('0x45')]=_0x1953a7[_0xb383('0x45')]['length']?_0x1953a7[_0xb383('0x45')]:_0x4fce46[_0xb383('0x41')];if(!_0x3f27a3[_0xb383('0x43')]['hasOwnProperty']('nolimit')){_0x1953a7[_0xb383('0x31')]=qs['limit'](_0x3f27a3['query'][_0xb383('0x31')]);_0x1953a7[_0xb383('0x30')]=qs[_0xb383('0x30')](_0x3f27a3[_0xb383('0x43')][_0xb383('0x30')]);}_0x1953a7[_0xb383('0x4a')]=qs[_0xb383('0x4b')](_0x3f27a3['query'][_0xb383('0x4b')]);_0x1953a7['where']=qs[_0xb383('0x44')](_['pick'](_0x3f27a3[_0xb383('0x43')],_0x4fce46[_0xb383('0x44')]));_0x1953a7[_0xb383('0x4c')][_0xb383('0x65')]=_0x2f8f02['id'];if(_0x3f27a3['query']['filter']){_0x1953a7[_0xb383('0x4c')]=_[_0xb383('0x4d')](_0x1953a7['where'],{'$or':_[_0xb383('0x6a')](_0x1953a7[_0xb383('0x45')],function(_0x28234a){var _0xb2273a={};_0xb2273a[_0x28234a]={'$like':'%'+_0x3f27a3['query'][_0xb383('0x51')]+'%'};return _0xb2273a;})});}_0x1953a7=_['merge']({},_0x1953a7,_0x3f27a3[_0xb383('0x52')]);return db[_0xb383('0xa0')][_0xb383('0x2f')]({'where':_0x1953a7[_0xb383('0x4c')]})['then'](function(_0x2e485b){_0x188bdc['count']=_0x2e485b;if(_0x3f27a3[_0xb383('0x43')][_0xb383('0x53')]){_0x1953a7['include']=[{'model':db[_0xb383('0x79')],'as':_0xb383('0xba'),'required':![]},{'model':db[_0xb383('0xa9')],'as':'Owner','attributes':[_0xb383('0x3c'),_0xb383('0xbb'),_0xb383('0xbc')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb383('0x3c'),_0xb383('0xbd')],'where':_0x3f27a3['query']['tag']?{'id':_0x3f27a3[_0xb383('0x43')][_0xb383('0xbe')]}:undefined,'required':_0x3f27a3[_0xb383('0x43')]['tag']?!![]:![]}];}return db[_0xb383('0xa0')][_0xb383('0x54')](_0x1953a7);})['then'](function(_0x292326){_0x188bdc[_0xb383('0x55')]=_0x292326;return _0x188bdc;});}})[_0xb383('0x37')](respondWithFilteredResult(_0x432541,_0x1953a7))[_0xb383('0x2b')](handleError(_0x432541,null));};exports[_0xb383('0xb2')]=function(_0x53c0f1,_0x3ea420,_0x370b59){var _0x30096d,_0x3ac65f,_0xbf97cd;if(_['isNil'](_0x53c0f1[_0xb383('0x59')][_0xb383('0x59')])||_0x53c0f1[_0xb383('0x59')][_0xb383('0x59')]===''){throw new db[(_0xb383('0x7a'))][(_0xb383('0x7b'))](_0xb383('0x97'));}if(_['isNil'](_0x53c0f1['body']['to'])){throw new db[(_0xb383('0x7a'))][(_0xb383('0x7b'))](_0xb383('0xbf'));}_0x30096d=_0x53c0f1['body']['to'];return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x53c0f1[_0xb383('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0xb383('0xc0'),'include':[{'model':db[_0xb383('0x79')],'as':_0xb383('0x9c'),'where':{'mobile':_0x30096d},'limit':0x1,'order':[[_0xb383('0x7f'),_0xb383('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x3ea420,null))['then'](function(_0x239f2a){if(_0x239f2a&&_0x239f2a[_0xb383('0xc0')]){_0x3ac65f=_0x239f2a['get']({'plain':!![]});if(_0x3ac65f[_0xb383('0xc0')]&&_0x3ac65f[_0xb383('0xc0')][_0xb383('0x9c')][_0xb383('0x48')]){return _0x3ac65f[_0xb383('0xc0')][_0xb383('0x9c')][0x0];}return db['CmContact'][_0xb383('0x58')](_[_0xb383('0x18')](_0x53c0f1['body'],{'firstName':_0x30096d,'mobile':_0x30096d,'phone':_0x30096d,'ListId':_0x3ac65f[_0xb383('0x81')]}));}})[_0xb383('0x37')](handleEntityNotFound(_0x3ea420,null))[_0xb383('0x37')](function(_0x2b53ff){if(_0x2b53ff){_0xbf97cd=_0x2b53ff;return db[_0xb383('0xa0')]['find']({'where':{'ContactId':_0xbf97cd['id'],'closed':![],'SmsAccountId':_0x3ac65f['id']}})[_0xb383('0x37')](function(_0x5d1b8c){if(_0x5d1b8c){return[_0x5d1b8c,![]];}return db['SmsInteraction'][_0xb383('0x58')]({'UserId':_0x53c0f1['user']['id'],'ContactId':_0xbf97cd['id'],'SmsAccountId':_0x3ac65f['id'],'phone':_0x30096d,'firstMsgDirection':_0xb383('0xc1'),'Messages':[_[_0xb383('0x4d')](_0x53c0f1[_0xb383('0x59')],{'read':![],'body':_0x53c0f1[_0xb383('0x59')]['body'],'phone':_0x30096d,'SmsAccountId':_0x3ac65f['id'],'UserId':_0x53c0f1[_0xb383('0x5c')]['id'],'ContactId':_0xbf97cd['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xb383('0xc2')}]})[_0xb383('0x37')](function(_0x212668){return[_0x212668,!![]];});});}})['spread'](function(_0x409a56,_0x306a8a){if(_0x306a8a){return _0x409a56;}return db['SmsMessage'][_0xb383('0x58')](_['merge'](_0x53c0f1[_0xb383('0x59')],{'read':![],'body':_0x53c0f1[_0xb383('0x59')]['body'],'phone':_0x30096d,'SmsAccountId':_0x3ac65f['id'],'SmsInteractionId':_0x409a56['id'],'UserId':_0x53c0f1['user']['id'],'ContactId':_0xbf97cd['id']}))['then'](function(_0x2afd78){_0x409a56[_0xb383('0xc3')][_0xb383('0xc2')]=[];_0x409a56[_0xb383('0xc3')][_0xb383('0xc2')]['push'](_0x2afd78[_0xb383('0xc3')]);return _0x409a56;});})['then'](respondWithResult(_0x3ea420,null))[_0xb383('0x2b')](handleError(_0x3ea420,null));};exports[_0xb383('0x2c')]=function(_0x579197,_0x342303,_0x12dfd5){if(_0x579197[_0xb383('0x59')]['id']){delete _0x579197[_0xb383('0x59')]['id'];}console['log'](_0xb383('0xc4'),_0x579197[_0xb383('0x59')]);var _0xddf0d3,_0x403543,_0x59a0b2;return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x579197['params']['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x342303,null))[_0xb383('0x37')](function(_0x1d5150){if(_0x1d5150){_0x59a0b2=_0x1d5150;logger[_0xb383('0x24')](_0xb383('0x25'),'status',_0xb383('0xc5'),_0x1d5150[_0xb383('0x4e')],util[_0xb383('0xc6')](_0x579197[_0xb383('0x59')],{'showHidden':![],'depth':null}));switch(_0x1d5150['type']){case _0xb383('0x86'):if(_0x579197['body'][_0xb383('0xc7')]&&_0x579197[_0xb383('0x59')][_0xb383('0x2c')]){_0x403543=_0x579197[_0xb383('0x59')]['status'];return db[_0xb383('0xa6')][_0xb383('0x57')]({'where':{'messageId':_0x579197[_0xb383('0x59')][_0xb383('0xc7')]}});}break;case'connectel':if(_0x579197[_0xb383('0x59')]['requestid']&&_0x579197[_0xb383('0x59')][_0xb383('0xc8')]){_0x403543=_0x579197['body'][_0xb383('0xc8')];return db['SmsMessage'][_0xb383('0x57')]({'where':{'messageId':_0x579197['body']['requestid']}});}break;case _0xb383('0x89'):if(_0x579197[_0xb383('0x59')][_0xb383('0x8a')]&&_0x579197[_0xb383('0x59')][_0xb383('0xc9')]){_0x403543=_0x579197['body'][_0xb383('0xc9')];return db[_0xb383('0xa6')]['find']({'where':{'messageId':_0x579197[_0xb383('0x59')][_0xb383('0x8a')]}});}break;case _0xb383('0x8f'):var _0xea9d56=_0x579197[_0xb383('0x59')][_0xb383('0x90')][0x0];if(_0xea9d56[_0xb383('0x84')]&&_0xea9d56[_0xb383('0x2c')][_0xb383('0xca')]==='DELIVERED'){_0x403543=_0xea9d56['status'][_0xb383('0xca')];return db[_0xb383('0xa6')][_0xb383('0x57')]({'where':{'messageId':_0xea9d56[_0xb383('0x84')]}});}break;case _0xb383('0xcb'):if(_0x579197[_0xb383('0x59')][_0xb383('0x84')]&&_0x579197[_0xb383('0x59')][_0xb383('0x2c')]){_0x403543=_0x579197['body'][_0xb383('0x2c')];return db[_0xb383('0xa6')][_0xb383('0x57')]({'where':{'messageId':_0x579197['body'][_0xb383('0x84')]}});}break;case _0xb383('0x93'):if(_0x579197[_0xb383('0x59')][_0xb383('0xcc')]&&_0x579197[_0xb383('0x59')][_0xb383('0x2c')]){_0x403543=_0x579197[_0xb383('0x59')]['status'];return db[_0xb383('0xa6')][_0xb383('0x57')]({'where':{'messageId':_0x579197['body']['redif']}});}break;}}})[_0xb383('0x37')](handleEntityNotFound(_0x342303,null))[_0xb383('0x37')](function(_0x325e17){if(_0x325e17){_0xddf0d3=_0x325e17;switch(_0x59a0b2['type']){case _0xb383('0x86'):if(_0x403543===_0xb383('0xcd')){return _0xddf0d3['update']({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),_0xb383('0x2c'),_0xb383('0x86'),util[_0xb383('0xc6')](_0x579197[_0xb383('0x59')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x403543==='1'){return _0xddf0d3[_0xb383('0x36')]({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),_0xb383('0x2c'),'skebby',util['inspect'](_0x579197['body'],{'showHidden':![],'depth':null}));}break;case _0xb383('0x89'):if(!_0x579197[_0xb383('0x59')][_0xb383('0xce')]&&_0x403543>=0xc8&&_0x403543<=0xce){return _0xddf0d3[_0xb383('0x36')]({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),'status','clicksend',util[_0xb383('0xc6')](_0x579197[_0xb383('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb383('0x8f'):var _0xd1c64e=_0x579197[_0xb383('0x59')]['results'][0x0];if(_0xd1c64e[_0xb383('0x2c')][_0xb383('0xca')]===_0xb383('0xcd')){return _0xddf0d3['update']({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),_0xb383('0x2c'),'infobip',util['inspect'](_0x579197[_0xb383('0x59')],{'showHidden':![],'depth':null}));}break;case _0xb383('0xcb'):if(_0x403543=='DELIVERED_TO_GATEWAY'||_0x403543==_0xb383('0xcf')){return _0xddf0d3[_0xb383('0x36')]({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),_0xb383('0x2c'),_0xb383('0xcb'),util[_0xb383('0xc6')](_0x579197[_0xb383('0x59')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x403543===_0xb383('0xd0')||_0x403543===_0xb383('0xd1')){return _0xddf0d3[_0xb383('0x36')]({'read':!![]});}else{logger['error'](_0xb383('0x25'),_0xb383('0x2c'),'intelepeer',util[_0xb383('0xc6')](_0x579197['body'],{'showHidden':![],'depth':null}));}break;}return _0xddf0d3;}})[_0xb383('0x37')](respondWithResult(_0x342303,null))[_0xb383('0x2b')](handleError(_0x342303,null));};exports[_0xb383('0xd2')]=function(_0x1bfd9b,_0x44987e,_0x5d0827){var _0x5459b9,_0x424b19,_0x41b79d;return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x1bfd9b['params']['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x44987e,null))[_0xb383('0x37')](function(_0x42dc6c){if(_0x42dc6c){_0x41b79d=_0x42dc6c;logger[_0xb383('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb383('0x2c'),_0xb383('0xc5'),_0x42dc6c[_0xb383('0x4e')],util[_0xb383('0xc6')](_0x1bfd9b[_0xb383('0x43')],{'showHidden':![],'depth':null}));switch(_0x42dc6c[_0xb383('0x4e')]){case _0xb383('0xd3'):if(_0x1bfd9b['query']['message-id']&&_0x1bfd9b[_0xb383('0x43')][_0xb383('0xd4')]){_0x424b19=_0x1bfd9b['query']['state'];return db['SmsMessage']['find']({'where':{'messageId':_0x1bfd9b[_0xb383('0x43')][_0xb383('0xd5')]}});}break;}}})[_0xb383('0x37')](handleEntityNotFound(_0x44987e,null))['then'](function(_0x4fc239){if(_0x4fc239){_0x5459b9=_0x4fc239;switch(_0x41b79d[_0xb383('0x4e')]){case _0xb383('0xd3'):if(_0x424b19==='2'||_0x424b19==='6'){return _0x5459b9[_0xb383('0x36')]({'read':!![]});}else{logger[_0xb383('0x27')](_0xb383('0x25'),_0xb383('0x2c'),_0xb383('0xd3'),util[_0xb383('0xc6')](_0x1bfd9b['query'],{'showHidden':![],'depth':null}));};break;}return _0x5459b9;}})[_0xb383('0x37')](respondWithResult(_0x44987e,null))[_0xb383('0x2b')](handleError(_0x44987e,null));};exports[_0xb383('0xd6')]=function(_0x13c681,_0x3a9c27,_0x10cf24){return db[_0xb383('0x3f')][_0xb383('0x57')]({'where':{'id':_0x13c681[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x3a9c27,null))[_0xb383('0x37')](function(_0x14495c){if(_0x14495c){return _0x14495c[_0xb383('0xd6')](_0x13c681[_0xb383('0x59')]['ids'],_['omit'](_0x13c681[_0xb383('0x59')],[_0xb383('0x6c'),'id'])||{})[_0xb383('0xa1')](function(_0x1eb113){for(var _0x43289c=0x0;_0x43289c<_0x13c681['body']['ids'][_0xb383('0x48')];_0x43289c+=0x1){socket[_0xb383('0xd7')]('userSmsAccount:save',{'UserId':_0x13c681[_0xb383('0x59')][_0xb383('0x6c')][_0x43289c],'SmsAccountId':_0x13c681['params']['id']});}return _0x1eb113;});}})[_0xb383('0x37')](respondWithResult(_0x3a9c27,null))[_0xb383('0x2b')](handleError(_0x3a9c27,null));};exports[_0xb383('0xd8')]=function(_0x5867d2,_0x1cdc36,_0x1f5fd1){var _0x167874;return db['SmsAccount'][_0xb383('0x57')]({'where':{'id':_0x5867d2[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x1cdc36,null))['then'](function(_0x4982db){if(_0x4982db){return _0x4982db['removeAgents'](_0x5867d2[_0xb383('0x43')][_0xb383('0x6c')])[_0xb383('0x37')](function(_0x39b819){if(_[_0xb383('0xd9')](_0x5867d2[_0xb383('0x43')]['ids'])){for(var _0x34fe60=0x0;_0x34fe60<_0x5867d2[_0xb383('0x43')][_0xb383('0x6c')][_0xb383('0x48')];_0x34fe60+=0x1){socket['emit'](_0xb383('0xda'),{'UserId':_0x5867d2[_0xb383('0x43')]['ids'][_0x34fe60],'SmsAccountId':_0x5867d2[_0xb383('0x61')]['id']});}}else{socket['emit'](_0xb383('0xda'),{'UserId':_0x5867d2[_0xb383('0x43')]['ids'],'SmsAccountId':_0x5867d2[_0xb383('0x61')]['id']});}});}})[_0xb383('0x37')](respondWithStatusCode(_0x1cdc36,null))[_0xb383('0x2b')](handleError(_0x1cdc36,null));};exports['getAgents']=function(_0x1f59be,_0x308310,_0x3ec5bb){var _0x4d29af={};var _0x28185a={};var _0x3b83d0;var _0x1f0cbd;return db[_0xb383('0x3f')][_0xb383('0x67')]({'where':{'id':_0x1f59be[_0xb383('0x61')]['id']}})[_0xb383('0x37')](handleEntityNotFound(_0x308310,null))[_0xb383('0x37')](function(_0x5464da){if(_0x5464da){_0x3b83d0=_0x5464da;_0x28185a[_0xb383('0x41')]=_['keys'](db[_0xb383('0xa9')][_0xb383('0x40')]);_0x28185a[_0xb383('0x43')]=_[_0xb383('0x42')](_0x1f59be[_0xb383('0x43')]);_0x28185a['filters']=_[_0xb383('0x46')](_0x28185a['model'],_0x28185a[_0xb383('0x43')]);_0x4d29af[_0xb383('0x45')]=_[_0xb383('0x46')](_0x28185a['model'],qs[_0xb383('0x47')](_0x1f59be[_0xb383('0x43')][_0xb383('0x47')]));_0x4d29af[_0xb383('0x45')]=_0x4d29af[_0xb383('0x45')]['length']?_0x4d29af[_0xb383('0x45')]:_0x28185a[_0xb383('0x41')];_0x4d29af['order']=qs[_0xb383('0x4b')](_0x1f59be[_0xb383('0x43')][_0xb383('0x4b')]);_0x4d29af[_0xb383('0x4c')]=qs[_0xb383('0x44')](_[_0xb383('0x69')](_0x1f59be['query'],_0x28185a['filters']));if(_0x1f59be['query'][_0xb383('0x51')]){_0x4d29af[_0xb383('0x4c')]=_[_0xb383('0x4d')](_0x4d29af[_0xb383('0x4c')],{'$or':_[_0xb383('0x6a')](_0x4d29af[_0xb383('0x45')],function(_0x1e40ad){var _0x612f93={};_0x612f93[_0x1e40ad]={'$like':'%'+_0x1f59be['query']['filter']+'%'};return _0x612f93;})});}_0x4d29af=_[_0xb383('0x4d')]({},_0x4d29af,_0x1f59be['options']);return _0x3b83d0['getAgents'](_0x4d29af);}})[_0xb383('0x37')](function(_0x319e2b){if(_0x319e2b){_0x1f0cbd=_0x319e2b[_0xb383('0x48')];if(!_0x1f59be['query']['hasOwnProperty']('nolimit')){_0x4d29af[_0xb383('0x31')]=qs[_0xb383('0x31')](_0x1f59be[_0xb383('0x43')][_0xb383('0x31')]);_0x4d29af[_0xb383('0x30')]=qs[_0xb383('0x30')](_0x1f59be[_0xb383('0x43')]['offset']);}return _0x3b83d0[_0xb383('0xdb')](_0x4d29af);}})['then'](function(_0x4ab445){if(_0x4ab445){return _0x4ab445?{'count':_0x1f0cbd,'rows':_0x4ab445}:null;}})[_0xb383('0x37')](respondWithResult(_0x308310,null))[_0xb383('0x2b')](handleError(_0x308310,null));}; \ No newline at end of file +var _0x4049=['filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','rows','removeDispositions','ids','addAnswer','getAnswers','findOne','nolimit','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','asc','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','From','Body','skebby','sender','connectel','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','Contacts','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','applications','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','addApplications','sequelize','transaction','bulkCreate','priority','getApplications','getInteractions','User','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','omit','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick'];(function(_0x23c679,_0x146416){var _0x370759=function(_0x1fb38d){while(--_0x1fb38d){_0x23c679['push'](_0x23c679['shift']());}};_0x370759(++_0x146416);}(_0x4049,0x177));var _0x9404=function(_0x28894c,_0x5a428c){_0x28894c=_0x28894c-0x0;var _0x3e108c=_0x4049[_0x28894c];return _0x3e108c;};'use strict';var pdf=require(_0x9404('0x0'));var emlformat=require(_0x9404('0x1'));var rimraf=require(_0x9404('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9404('0x3'));var moment=require(_0x9404('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9404('0x5'));var path=require('path');var sox=require(_0x9404('0x6'));var csv=require(_0x9404('0x7'));var ejs=require(_0x9404('0x8'));var fs=require('fs');var _=require(_0x9404('0x9'));var squel=require(_0x9404('0xa'));var crypto=require(_0x9404('0xb'));var jsforce=require(_0x9404('0xc'));var deskjs=require(_0x9404('0xd'));var toCsv=require(_0x9404('0x7'));var querystring=require(_0x9404('0xe'));var Papa=require(_0x9404('0xf'));var authService=require(_0x9404('0x10'));var hardwareService=require(_0x9404('0x11'));var Redis=require(_0x9404('0x12'));var qs=require(_0x9404('0x13'));var logger=require(_0x9404('0x14'))(_0x9404('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9404('0x16'))['db'];config[_0x9404('0x17')]=_[_0x9404('0x18')](config[_0x9404('0x17')],{'host':_0x9404('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9404('0x1a'))[_0x9404('0x1b')](socket);var jayson=require(_0x9404('0x1c'));var client=jayson[_0x9404('0x1d')][_0x9404('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x30ea71,_0x52ff03,_0x75e18f,_0x4db206){return new BPromise(function(_0x42c863,_0x5e42c0){var _0x5574c2=_0x4db206||client;return _0x5574c2[_0x9404('0x1f')](_0x30ea71,_0x75e18f)['then'](function(_0x585504){logger[_0x9404('0x20')](_0x9404('0x21'),_0x52ff03,_0x9404('0x22'));logger[_0x9404('0x23')](_0x9404('0x24'),_0x52ff03,_0x9404('0x22'),JSON[_0x9404('0x25')](_0x585504));if(_0x585504[_0x9404('0x26')]){if(_0x585504[_0x9404('0x26')]['code']===0x1f4){logger[_0x9404('0x26')](_0x9404('0x21'),_0x52ff03,_0x585504[_0x9404('0x26')][_0x9404('0x27')]);return _0x5e42c0(_0x585504[_0x9404('0x26')][_0x9404('0x27')]);}logger[_0x9404('0x26')](_0x9404('0x21'),_0x52ff03,_0x585504['error'][_0x9404('0x27')]);return _0x42c863(_0x585504[_0x9404('0x26')]['message']);}else{logger['info'](_0x9404('0x21'),_0x52ff03,'request\x20sent');_0x42c863(_0x585504['result'][_0x9404('0x27')]);}})['catch'](function(_0x4742db){logger['error'](_0x9404('0x21'),_0x52ff03,_0x4742db);_0x5e42c0(_0x4742db);});});}function respondWithStatusCode(_0x16d4fd,_0x4eca2d){_0x4eca2d=_0x4eca2d||0xcc;return function(_0x3d41c5){if(_0x3d41c5){return _0x16d4fd[_0x9404('0x28')](_0x4eca2d);}return _0x16d4fd[_0x9404('0x29')](_0x4eca2d)[_0x9404('0x2a')]();};}function respondWithResult(_0x4173bb,_0x419221){_0x419221=_0x419221||0xc8;return function(_0x411bab){if(_0x411bab){return _0x4173bb['status'](_0x419221)[_0x9404('0x2b')](_0x411bab);}};}function respondWithFilteredResult(_0x1e8373,_0x173257){return function(_0x2c13c0){if(_0x2c13c0){var _0x5595f2=_0x2c13c0[_0x9404('0x2c')],_0xddb0f9=_0x173257[_0x9404('0x2d')],_0x4a600a=_0x173257[_0x9404('0x2d')]+_0x173257['limit'],_0x4a3af7;if(_0x4a600a>=_0x5595f2){_0x4a600a=_0x5595f2;_0x4a3af7=0xc8;}else{_0x4a3af7=0xce;}_0x1e8373['status'](_0x4a3af7);return _0x1e8373['set'](_0x9404('0x2e'),_0xddb0f9+'-'+_0x4a600a+'/'+_0x5595f2)[_0x9404('0x2b')](_0x2c13c0);}return null;};}function patchUpdates(_0x3b17f2){return function(_0x55d72e){try{jsonpatch[_0x9404('0x2f')](_0x55d72e,_0x3b17f2,!![]);}catch(_0x497b44){return BPromise[_0x9404('0x30')](_0x497b44);}return _0x55d72e[_0x9404('0x31')]();};}function saveUpdates(_0x41edc1,_0x440526){return function(_0x25aecf){if(_0x25aecf){return _0x25aecf['update'](_0x41edc1)[_0x9404('0x32')](function(_0x569c4f){return _0x569c4f;});}return null;};}function removeEntity(_0x26db4d,_0x394b29){return function(_0x30c0fa){if(_0x30c0fa){return _0x30c0fa[_0x9404('0x33')]()[_0x9404('0x32')](function(){var _0x10fdd6=_0x30c0fa[_0x9404('0x34')]({'plain':!![]});var _0x440d2c=_0x9404('0x35');return db[_0x9404('0x36')]['destroy']({'where':{'type':_0x440d2c,'resourceId':_0x10fdd6['id']}})[_0x9404('0x32')](function(){return _0x30c0fa;});})[_0x9404('0x32')](function(){_0x26db4d[_0x9404('0x29')](0xcc)[_0x9404('0x2a')]();});}};}function handleEntityNotFound(_0x5e224c,_0x39a107){return function(_0x2e2fc7){if(!_0x2e2fc7){_0x5e224c['sendStatus'](0x194);}return _0x2e2fc7;};}function handleError(_0x1825a0,_0x11b6ef){_0x11b6ef=_0x11b6ef||0x1f4;return function(_0xd8dbb2){logger[_0x9404('0x26')](_0xd8dbb2[_0x9404('0x37')]);if(_0xd8dbb2['name']){delete _0xd8dbb2[_0x9404('0x38')];}_0x1825a0[_0x9404('0x29')](_0x11b6ef)[_0x9404('0x39')](_0xd8dbb2);};}exports[_0x9404('0x3a')]=function(_0x6aab28,_0x509247){var _0x30cb79={'include':[{'model':db[_0x9404('0x3b')],'as':_0x9404('0x3c')}]},_0xf6179f={},_0x17f0fb={'count':0x0,'rows':[]};var _0x1e53cb=db[_0x9404('0x3d')][_0x9404('0x3e')];_0xf6179f[_0x9404('0x3f')]=_[_0x9404('0x40')](_0x1e53cb);_0xf6179f[_0x9404('0x41')]=_['keys'](_0x6aab28[_0x9404('0x41')]);_0xf6179f[_0x9404('0x42')]=_[_0x9404('0x43')](_0xf6179f[_0x9404('0x3f')],_0xf6179f[_0x9404('0x41')]);_0x30cb79['attributes']=_[_0x9404('0x43')](_0xf6179f[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x6aab28[_0x9404('0x41')][_0x9404('0x44')]));_0x30cb79[_0x9404('0x45')]=_0x30cb79[_0x9404('0x45')][_0x9404('0x46')]?_0x30cb79[_0x9404('0x45')]:_0xf6179f['model'];if(!_0x6aab28[_0x9404('0x41')][_0x9404('0x47')]('nolimit')){_0x30cb79[_0x9404('0x48')]=qs[_0x9404('0x48')](_0x6aab28['query'][_0x9404('0x48')]);_0x30cb79[_0x9404('0x2d')]=qs[_0x9404('0x2d')](_0x6aab28[_0x9404('0x41')][_0x9404('0x2d')]);}_0x30cb79[_0x9404('0x49')]=qs['sort'](_0x6aab28[_0x9404('0x41')][_0x9404('0x4a')]);_0x30cb79[_0x9404('0x4b')]=qs[_0x9404('0x42')](_[_0x9404('0x4c')](_0x6aab28['query'],_0xf6179f[_0x9404('0x42')]));if(_0x6aab28[_0x9404('0x41')][_0x9404('0x4d')]){_0x30cb79['where']=_['merge'](_0x30cb79[_0x9404('0x4b')],{'$or':_[_0x9404('0x4e')](_0x1e53cb,function(_0x428f1d){if(_0x428f1d[_0x9404('0x4f')]['key']!==_0x9404('0x50')){var _0x1dda84={};_0x1dda84[_0x428f1d['field']]={'$like':'%'+_0x6aab28[_0x9404('0x41')][_0x9404('0x4d')]+'%'};return _0x1dda84;}})});}_0x30cb79=_[_0x9404('0x51')]({},_0x30cb79,_0x6aab28[_0x9404('0x52')]);var _0x178610={'where':_0x30cb79[_0x9404('0x4b')]};return db[_0x9404('0x3d')]['count'](_0x178610)['then'](function(_0x328409){_0x17f0fb['count']=_0x328409;if(_0x6aab28['query'][_0x9404('0x53')]){_0x30cb79[_0x9404('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x9404('0x55')](_0x30cb79);})['then'](function(_0x1c49e3){_0x17f0fb['rows']=_0x1c49e3;return _0x17f0fb;})[_0x9404('0x32')](respondWithFilteredResult(_0x509247,_0x30cb79))[_0x9404('0x56')](handleError(_0x509247,null));};exports['show']=function(_0x38737a,_0x13cdd9){var _0x3929e9={'raw':![],'where':{'id':_0x38737a[_0x9404('0x57')]['id']},'include':[{'model':db[_0x9404('0x3b')],'as':'mandatoryDispositionPause'}]},_0x324ab0={};_0x324ab0[_0x9404('0x3f')]=_[_0x9404('0x40')](db[_0x9404('0x3d')][_0x9404('0x3e')]);_0x324ab0[_0x9404('0x41')]=_[_0x9404('0x40')](_0x38737a[_0x9404('0x41')]);_0x324ab0[_0x9404('0x42')]=_[_0x9404('0x43')](_0x324ab0['model'],_0x324ab0[_0x9404('0x41')]);_0x3929e9[_0x9404('0x45')]=_[_0x9404('0x43')](_0x324ab0[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x38737a[_0x9404('0x41')]['fields']));_0x3929e9[_0x9404('0x45')]=_0x3929e9[_0x9404('0x45')][_0x9404('0x46')]?_0x3929e9[_0x9404('0x45')]:_0x324ab0['model'];if(_0x38737a[_0x9404('0x41')][_0x9404('0x53')]){_0x3929e9[_0x9404('0x54')]=[{'all':!![]}];}_0x3929e9=_['merge']({},_0x3929e9,_0x38737a[_0x9404('0x52')]);return db['SmsAccount'][_0x9404('0x58')](_0x3929e9)['then'](handleEntityNotFound(_0x13cdd9,null))[_0x9404('0x32')](respondWithResult(_0x13cdd9,null))[_0x9404('0x56')](handleError(_0x13cdd9,null));};exports[_0x9404('0x59')]=function(_0x1f1e84,_0x302c3c){return db[_0x9404('0x3d')][_0x9404('0x59')](_0x1f1e84[_0x9404('0x5a')],{})[_0x9404('0x32')](function(_0x33c35b){var _0x11437b=_0x1f1e84['user'][_0x9404('0x34')]({'plain':!![]});if(!_0x11437b)throw new Error(_0x9404('0x5b'));if(_0x11437b[_0x9404('0x5c')]===_0x9404('0x5d')){var _0x11ff20=_0x33c35b[_0x9404('0x34')]({'plain':!![]});var _0x22bfff=_0x9404('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x22bfff,'userProfileId':_0x11437b['userProfileId']},'raw':!![]})[_0x9404('0x32')](function(_0x13d9c3){if(_0x13d9c3&&_0x13d9c3['autoAssociation']===0x0){return db[_0x9404('0x36')][_0x9404('0x59')]({'name':_0x11ff20[_0x9404('0x38')],'resourceId':_0x11ff20['id'],'type':_0x13d9c3[_0x9404('0x38')],'sectionId':_0x13d9c3['id']},{})[_0x9404('0x32')](function(){return _0x33c35b;});}else{return _0x33c35b;}})[_0x9404('0x56')](function(_0x13b61a){logger[_0x9404('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13b61a);throw _0x13b61a;});}return _0x33c35b;})[_0x9404('0x32')](respondWithResult(_0x302c3c,0xc9))[_0x9404('0x56')](handleError(_0x302c3c,null));};exports[_0x9404('0x5e')]=function(_0x22f16e,_0x3b4c07){if(_0x22f16e[_0x9404('0x5a')]['id']){delete _0x22f16e['body']['id'];}return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x22f16e[_0x9404('0x57')]['id']},'include':[{'model':db[_0x9404('0x3b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3b4c07,null))[_0x9404('0x32')](saveUpdates(_0x22f16e['body'],null))[_0x9404('0x32')](respondWithResult(_0x3b4c07,null))[_0x9404('0x56')](handleError(_0x3b4c07,null));};exports['destroy']=function(_0x1cd3c3,_0x5c27e5){return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x1cd3c3[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x5c27e5,null))[_0x9404('0x32')](removeEntity(_0x5c27e5,null))[_0x9404('0x56')](handleError(_0x5c27e5,null));};exports[_0x9404('0x5f')]=function(_0x1817f0,_0x76af17){return db[_0x9404('0x3d')][_0x9404('0x5f')]()['then'](respondWithResult(_0x76af17,null))['catch'](handleError(_0x76af17,null));};exports[_0x9404('0x60')]=function(_0x4b4e7e,_0x3bd128,_0x5de153){if(_0x4b4e7e[_0x9404('0x5a')]['id']){delete _0x4b4e7e[_0x9404('0x5a')]['id'];}return db[_0x9404('0x3d')]['find']({'where':{'id':_0x4b4e7e[_0x9404('0x57')]['id']}})['then'](handleEntityNotFound(_0x3bd128,null))[_0x9404('0x32')](function(_0x14a5c2){if(_0x14a5c2){_0x4b4e7e[_0x9404('0x5a')][_0x9404('0x61')]=_0x14a5c2['id'];return db[_0x9404('0x62')]['create'](_0x4b4e7e['body']);}})[_0x9404('0x32')](respondWithResult(_0x3bd128,null))[_0x9404('0x56')](handleError(_0x3bd128,null));};exports[_0x9404('0x63')]=function(_0x336abb,_0x346822,_0x4a89ae){var _0xc52d8d={'raw':![],'where':{}};var _0x3085da={};var _0x1ae06b={'count':0x0,'rows':[]};return db[_0x9404('0x3d')]['findOne']({'where':{'id':_0x336abb['params']['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x346822,null))[_0x9404('0x32')](function(_0x50d547){if(_0x50d547){_0x3085da[_0x9404('0x3f')]=_[_0x9404('0x40')](db[_0x9404('0x62')][_0x9404('0x3e')]);_0x3085da[_0x9404('0x41')]=_[_0x9404('0x40')](_0x336abb[_0x9404('0x41')]);_0x3085da[_0x9404('0x42')]=_[_0x9404('0x43')](_0x3085da[_0x9404('0x3f')],_0x3085da[_0x9404('0x41')]);_0xc52d8d[_0x9404('0x45')]=_[_0x9404('0x43')](_0x3085da[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x336abb[_0x9404('0x41')][_0x9404('0x44')]));_0xc52d8d[_0x9404('0x45')]=_0xc52d8d[_0x9404('0x45')][_0x9404('0x46')]?_0xc52d8d[_0x9404('0x45')]:_0x3085da[_0x9404('0x3f')];if(!_0x336abb[_0x9404('0x41')][_0x9404('0x47')]('nolimit')){_0xc52d8d['limit']=qs[_0x9404('0x48')](_0x336abb[_0x9404('0x41')][_0x9404('0x48')]);_0xc52d8d['offset']=qs[_0x9404('0x2d')](_0x336abb[_0x9404('0x41')][_0x9404('0x2d')]);}_0xc52d8d['order']=qs[_0x9404('0x4a')](_0x336abb[_0x9404('0x41')][_0x9404('0x4a')]);_0xc52d8d[_0x9404('0x4b')]=qs[_0x9404('0x42')](_['pick'](_0x336abb[_0x9404('0x41')],_0x3085da[_0x9404('0x42')]));_0xc52d8d[_0x9404('0x4b')]['SmsAccountId']=_0x50d547['id'];if(_0x336abb[_0x9404('0x41')][_0x9404('0x4d')]){_0xc52d8d['where']=_[_0x9404('0x51')](_0xc52d8d[_0x9404('0x4b')],{'$or':_['map'](_0xc52d8d[_0x9404('0x45')],function(_0x472c66){var _0x5f4ca6={};_0x5f4ca6[_0x472c66]={'$like':'%'+_0x336abb[_0x9404('0x41')][_0x9404('0x4d')]+'%'};return _0x5f4ca6;})});}_0xc52d8d=_['merge']({},_0xc52d8d,_0x336abb[_0x9404('0x52')]);return db[_0x9404('0x62')][_0x9404('0x2c')]({'where':_0xc52d8d[_0x9404('0x4b')]})[_0x9404('0x32')](function(_0x5a0f74){_0x1ae06b[_0x9404('0x2c')]=_0x5a0f74;if(_0x336abb[_0x9404('0x41')][_0x9404('0x53')]){_0xc52d8d[_0x9404('0x54')]=[{'all':!![]}];}return db[_0x9404('0x62')][_0x9404('0x55')](_0xc52d8d);})[_0x9404('0x32')](function(_0x543df5){_0x1ae06b[_0x9404('0x64')]=_0x543df5;return _0x1ae06b;});}})[_0x9404('0x32')](respondWithFilteredResult(_0x346822,_0xc52d8d))[_0x9404('0x56')](handleError(_0x346822,null));};exports[_0x9404('0x65')]=function(_0x235434,_0x3e4ebc,_0x192de9){var _0x362bf4;return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x235434['params']['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x3e4ebc,null))[_0x9404('0x32')](function(_0x126b8b){if(_0x126b8b){return _0x126b8b[_0x9404('0x65')](_0x235434[_0x9404('0x41')][_0x9404('0x66')]);}})[_0x9404('0x32')](respondWithStatusCode(_0x3e4ebc,null))[_0x9404('0x56')](handleError(_0x3e4ebc,null));};exports[_0x9404('0x67')]=function(_0x44c539,_0x2f306f,_0x4727fd){if(_0x44c539['body']['id']){delete _0x44c539['body']['id'];}return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x44c539[_0x9404('0x57')]['id']}})['then'](handleEntityNotFound(_0x2f306f,null))['then'](function(_0x47f675){if(_0x47f675){_0x44c539[_0x9404('0x5a')][_0x9404('0x61')]=_0x47f675['id'];return db['CannedAnswer'][_0x9404('0x59')](_0x44c539['body']);}})[_0x9404('0x32')](respondWithResult(_0x2f306f,null))[_0x9404('0x56')](handleError(_0x2f306f,null));};exports[_0x9404('0x68')]=function(_0x5c1f21,_0x383cf5,_0x5b4f14){var _0x51cf9e={'raw':![],'where':{}};var _0x5bb7e9={};var _0x59f6fb={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9404('0x69')]({'where':{'id':_0x5c1f21['params']['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x383cf5,null))[_0x9404('0x32')](function(_0x34e1ca){if(_0x34e1ca){_0x5bb7e9[_0x9404('0x3f')]=_['keys'](db['CannedAnswer'][_0x9404('0x3e')]);_0x5bb7e9[_0x9404('0x41')]=_[_0x9404('0x40')](_0x5c1f21[_0x9404('0x41')]);_0x5bb7e9['filters']=_[_0x9404('0x43')](_0x5bb7e9[_0x9404('0x3f')],_0x5bb7e9['query']);_0x51cf9e[_0x9404('0x45')]=_['intersection'](_0x5bb7e9[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x5c1f21[_0x9404('0x41')]['fields']));_0x51cf9e[_0x9404('0x45')]=_0x51cf9e[_0x9404('0x45')]['length']?_0x51cf9e[_0x9404('0x45')]:_0x5bb7e9[_0x9404('0x3f')];if(!_0x5c1f21['query']['hasOwnProperty'](_0x9404('0x6a'))){_0x51cf9e[_0x9404('0x48')]=qs['limit'](_0x5c1f21[_0x9404('0x41')][_0x9404('0x48')]);_0x51cf9e['offset']=qs[_0x9404('0x2d')](_0x5c1f21['query'][_0x9404('0x2d')]);}_0x51cf9e['order']=qs['sort'](_0x5c1f21[_0x9404('0x41')]['sort']);_0x51cf9e[_0x9404('0x4b')]=qs[_0x9404('0x42')](_[_0x9404('0x4c')](_0x5c1f21[_0x9404('0x41')],_0x5bb7e9[_0x9404('0x42')]));_0x51cf9e[_0x9404('0x4b')]['SmsAccountId']=_0x34e1ca['id'];if(_0x5c1f21['query'][_0x9404('0x4d')]){_0x51cf9e['where']=_[_0x9404('0x51')](_0x51cf9e[_0x9404('0x4b')],{'$or':_[_0x9404('0x4e')](_0x51cf9e[_0x9404('0x45')],function(_0x1d0d52){var _0x1fbfdf={};_0x1fbfdf[_0x1d0d52]={'$like':'%'+_0x5c1f21['query'][_0x9404('0x4d')]+'%'};return _0x1fbfdf;})});}_0x51cf9e=_[_0x9404('0x51')]({},_0x51cf9e,_0x5c1f21[_0x9404('0x52')]);return db[_0x9404('0x6b')][_0x9404('0x2c')]({'where':_0x51cf9e[_0x9404('0x4b')]})[_0x9404('0x32')](function(_0x29bca9){_0x59f6fb[_0x9404('0x2c')]=_0x29bca9;if(_0x5c1f21[_0x9404('0x41')][_0x9404('0x53')]){_0x51cf9e['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x51cf9e);})[_0x9404('0x32')](function(_0x33872d){_0x59f6fb[_0x9404('0x64')]=_0x33872d;return _0x59f6fb;});}})[_0x9404('0x32')](respondWithFilteredResult(_0x383cf5,_0x51cf9e))['catch'](handleError(_0x383cf5,null));};exports['removeAnswers']=function(_0xe46282,_0x3dddc4,_0x1d7aaa){var _0x595f75;return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0xe46282[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x3dddc4,null))[_0x9404('0x32')](function(_0x59530b){if(_0x59530b){return _0x59530b[_0x9404('0x6c')](_0xe46282[_0x9404('0x41')][_0x9404('0x66')]);}})[_0x9404('0x32')](respondWithStatusCode(_0x3dddc4,null))[_0x9404('0x56')](handleError(_0x3dddc4,null));};exports[_0x9404('0x6d')]=function(_0x3fd5b3,_0x576533,_0x2434bc){var _0x37bdca={'channel':_0x9404('0x6e')};var _0x4b7b72=[];var _0x30c585=[];var _0x2fe623={};return db['SmsAccount'][_0x9404('0x58')]({'where':{'id':_0x3fd5b3['params']['id']},'include':[{'model':db[_0x9404('0x6f')],'as':_0x9404('0x70')}]})['then'](handleEntityNotFound(_0x576533,null))[_0x9404('0x32')](function(_0x394252){_0x37bdca[_0x9404('0x71')]=_0x394252;_0x37bdca['applications']=_[_0x9404('0x72')](_0x394252['Applications'],['priority'],[_0x9404('0x73')]);if(_0x37bdca[_0x9404('0x71')][_0x9404('0x70')]){delete _0x37bdca['account'][_0x9404('0x70')];}return db['CmContact'][_0x9404('0x5f')]();})[_0x9404('0x32')](function(_0x378e2d){if(!_0x378e2d){throw new db['Sequelize'][(_0x9404('0x74'))]('no\x20available\x20attributes');}_0x4b7b72=_['difference'](_[_0x9404('0x40')](_0x378e2d),[_0x9404('0x75'),_0x9404('0x76')]);_0x30c585=_[_0x9404('0x77')](_[_0x9404('0x40')](_0x378e2d),[_0x9404('0x75'),'updatedAt',_0x9404('0x78'),_0x9404('0x79')]);_0x37bdca['body']={'mapKey':_0x9404('0x7a')};if(_0x37bdca[_0x9404('0x71')][_0x9404('0x4f')]){switch(_0x37bdca[_0x9404('0x71')][_0x9404('0x4f')]){case'twilio':_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x7c')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x7d')];_0x37bdca['body']['messageId']=_0x3fd5b3[_0x9404('0x5a')]['MessageSid'];break;case _0x9404('0x7e'):_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')]='+'+_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x7f')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')]=_0x3fd5b3['body']['text'];break;case _0x9404('0x80'):_0x37bdca['body'][_0x9404('0x7b')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x7b')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')]=_0x3fd5b3[_0x9404('0x5a')]['message'];break;case'clicksend':_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')]=_0x3fd5b3['body'][_0x9404('0x7b')];_0x37bdca['body'][_0x9404('0x5a')]=_0x3fd5b3['body'][_0x9404('0x5a')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x81')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x82')];break;case _0x9404('0x83'):_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')]=_0x3fd5b3['body']['From'];_0x37bdca[_0x9404('0x5a')]['body']=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x84')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x81')]=_0x3fd5b3['body'][_0x9404('0x85')];break;case _0x9404('0x86'):_0x37bdca['body'][_0x9404('0x7b')]='+'+_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x87')][0x0][_0x9404('0x7b')];_0x37bdca[_0x9404('0x5a')]['body']=_0x3fd5b3[_0x9404('0x5a')]['results'][0x0]['text'];_0x37bdca['body'][_0x9404('0x81')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x87')][0x0]['messageId'];break;case _0x9404('0x88'):_0x37bdca[_0x9404('0x5a')]['from']=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x89')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')]=_0x3fd5b3['body'][_0x9404('0x8a')][_0x9404('0x27')];break;case _0x9404('0x8b'):_0x37bdca['body'][_0x9404('0x7b')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x8c')];_0x37bdca['body'][_0x9404('0x5a')]=_0x3fd5b3[_0x9404('0x5a')]['text'];_0x37bdca[_0x9404('0x5a')][_0x9404('0x81')]=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x8d')];break;case _0x9404('0x8e'):_0x37bdca[_0x9404('0x5a')]['from']=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x7b')];_0x37bdca[_0x9404('0x5a')]['body']=_0x3fd5b3[_0x9404('0x5a')][_0x9404('0x27')];_0x37bdca[_0x9404('0x5a')][_0x9404('0x81')]=_0x3fd5b3['body'][_0x9404('0x8f')];break;}}if(_0x37bdca[_0x9404('0x5a')]['id']){delete _0x37bdca[_0x9404('0x5a')]['id'];}if(_[_0x9404('0x90')](_0x37bdca[_0x9404('0x5a')]['from'])){throw new db['Sequelize'][(_0x9404('0x74'))](_0x9404('0x91'));}if(_[_0x9404('0x90')](_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')])||_0x37bdca[_0x9404('0x5a')]['body']===''){throw new db['Sequelize'][(_0x9404('0x74'))](_0x9404('0x92'));}if(_[_0x9404('0x90')](_0x37bdca['body'][_0x9404('0x93')])){throw new db['Sequelize'][(_0x9404('0x74'))](_0x9404('0x94')+_0x30c585);}if(!_[_0x9404('0x95')](_0x30c585,_0x37bdca['body'][_0x9404('0x93')])){throw new db[(_0x9404('0x96'))][(_0x9404('0x74'))](_0x9404('0x97')+_0x30c585);}_0x2fe623[_0x37bdca[_0x9404('0x5a')][_0x9404('0x93')]]=_0x37bdca[_0x9404('0x5a')]['from'];return db[_0x9404('0x98')]['find']({'where':{'id':_0x37bdca[_0x9404('0x71')][_0x9404('0x79')]},'include':[{'model':db[_0x9404('0x99')],'as':'Contacts','where':_0x2fe623,'limit':0x1,'order':[['updatedAt',_0x9404('0x9a')]]}]});})['then'](handleEntityNotFound(_0x576533,null))[_0x9404('0x32')](function(_0x4316a7){if(_0x4316a7){_0x37bdca[_0x9404('0x9b')]=_['omit'](_0x4316a7,[_0x9404('0x9c')]);if(_0x4316a7[_0x9404('0x9c')]['length']){return _0x4316a7[_0x9404('0x9c')][0x0];}var _0x2b2a58=_[_0x9404('0x18')](_0x37bdca[_0x9404('0x5a')],{'firstName':_0x37bdca[_0x9404('0x5a')]['from'],'ListId':_0x4316a7['id']});_0x2b2a58[_0x37bdca[_0x9404('0x5a')]['mapKey']]=_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')];return db[_0x9404('0x99')][_0x9404('0x59')](_0x2b2a58,{'fields':_0x4b7b72,'raw':!![]});}})[_0x9404('0x32')](handleEntityNotFound(_0x576533,null))['then'](function(_0x392ea0){if(_0x392ea0){_0x37bdca[_0x9404('0x9d')]=_0x392ea0;var _0x3d67f9={'ContactId':_0x392ea0['id'],'phone':_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')],'SmsAccountId':_0x3fd5b3[_0x9404('0x57')]['id']};var _0x2ddf8c={'ContactId':_0x392ea0['id'],'SmsAccountId':_0x3fd5b3[_0x9404('0x57')]['id'],'closed':![]};return db['SmsInteraction'][_0x9404('0x58')]({'where':_0x2ddf8c})['then'](function(_0x17a05e){if(_0x17a05e){return[_0x17a05e,![]];}return db[_0x9404('0x9e')][_0x9404('0x59')](_0x3d67f9)['then'](function(_0x439c47){return[_0x439c47,!![]];});});}})[_0x9404('0x9f')](function(_0x7f52b2,_0x26054a){_0x37bdca['interaction']=_0x7f52b2[_0x9404('0x34')]({'plain':!![]});_0x37bdca[_0x9404('0xa0')]['created']=![];if(_0x26054a){if(_0x37bdca[_0x9404('0x71')][_0x9404('0xa1')]){_0x37bdca['applications']['push']({'id':0x0,'priority':_0x37bdca['applications'][_0x9404('0x46')]+0x1,'app':_0x9404('0xa2'),'appdata':_0x9404('0xa3'),'interval':_0x9404('0xa4')});}_0x37bdca[_0x9404('0xa0')][_0x9404('0xa5')]=!![];}return db[_0x9404('0xa6')]['create']({'phone':_0x37bdca[_0x9404('0x5a')][_0x9404('0x7b')],'messageId':_0x37bdca['body'][_0x9404('0x81')],'body':_0x37bdca[_0x9404('0x5a')][_0x9404('0x5a')],'SmsAccountId':_0x3fd5b3[_0x9404('0x57')]['id'],'SmsInteractionId':_0x7f52b2['id'],'direction':'in','ContactId':_0x7f52b2[_0x9404('0xa7')],'AttachmentId':_0x37bdca[_0x9404('0x5a')][_0x9404('0xa8')]});})[_0x9404('0x32')](function(_0x1ee7d6){_0x37bdca['message']=_0x1ee7d6;if(_0x37bdca[_0x9404('0xa0')][_0x9404('0xa9')]){return db['User'][_0x9404('0x58')]({'attributes':['id',_0x9404('0x38')],'where':{'id':_0x37bdca[_0x9404('0xa0')][_0x9404('0xa9')]}})['then'](function(_0x32b5b8){if(_0x32b5b8){_0x37bdca[_0x9404('0xaa')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9404('0xab'),'appdata':_0x32b5b8[_0x9404('0x38')]+','+(_0x37bdca['account'][_0x9404('0xac')]||0xa),'interval':_0x9404('0xa4')});}return respondWithRpcPromise('Start',_0x9404('0xad'),_0x37bdca);});}return respondWithRpcPromise(_0x9404('0xae'),'startRouting',_0x37bdca);})[_0x9404('0x32')](function(_0x1e3b54){if(_0x1e3b54){var _0x325e41=0xc8;var _0x21d7f6=_0x9404('0xaf');logger['info'](_0x9404('0x24'),_0x21d7f6,_0x325e41,_0x9404('0xb0'));logger[_0x9404('0x23')](_0x9404('0xb1'),_0x21d7f6,_0x325e41,'entity\x20found',JSON[_0x9404('0x25')](_0x1e3b54));if(_0x37bdca['account'][_0x9404('0x4f')]===_0x9404('0xb2')){return _0x576533[_0x9404('0x29')](_0x325e41)[_0x9404('0xb3')](_0x9404('0xb4'),'text/xml')[_0x9404('0x39')]('\x0a');}else{return _0x576533[_0x9404('0x29')](_0x325e41)[_0x9404('0x2b')](_0x1e3b54);}}})[_0x9404('0x56')](handleError(_0x576533,null));};exports[_0x9404('0xb5')]=function(_0x24cda9,_0xc6bcc2,_0x46e6e8){return db[_0x9404('0x3d')]['findOne']({'where':{'id':_0x24cda9[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0xc6bcc2,null))['then'](function(_0x194b0d){if(_0x194b0d){return db[_0x9404('0xb6')][_0x9404('0xb7')](function(_0x283d48){return db['SmsApplication'][_0x9404('0x33')]({'where':{'SmsAccountId':_0x24cda9[_0x9404('0x57')]['id']},'transaction':_0x283d48})[_0x9404('0x32')](function(_0x4694f5){var _0x4dd756=_['map'](_0x24cda9[_0x9404('0x5a')],function(_0x2a9c4){_0x2a9c4[_0x9404('0x61')]=_0x24cda9['params']['id'];return _0x2a9c4;});return db[_0x9404('0x6f')][_0x9404('0xb8')](_0x4dd756,{'transaction':_0x283d48});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x24cda9[_0x9404('0x57')]['id']},'order':_0x9404('0xb9')});});}})[_0x9404('0x32')](respondWithResult(_0xc6bcc2,null))[_0x9404('0x56')](handleError(_0xc6bcc2,null));};exports[_0x9404('0xba')]=function(_0x4f96bc,_0x44b586,_0x256777){var _0x2d7798={};var _0x36d38c={};var _0x55f638;var _0x3fdb88;return db['SmsAccount'][_0x9404('0x69')]({'where':{'id':_0x4f96bc[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x44b586,null))['then'](function(_0x24ee3f){if(_0x24ee3f){_0x55f638=_0x24ee3f;_0x36d38c[_0x9404('0x3f')]=_['keys'](db[_0x9404('0x6f')][_0x9404('0x3e')]);_0x36d38c[_0x9404('0x41')]=_[_0x9404('0x40')](_0x4f96bc[_0x9404('0x41')]);_0x36d38c[_0x9404('0x42')]=_[_0x9404('0x43')](_0x36d38c[_0x9404('0x3f')],_0x36d38c[_0x9404('0x41')]);_0x2d7798[_0x9404('0x45')]=_['intersection'](_0x36d38c[_0x9404('0x3f')],qs['fields'](_0x4f96bc[_0x9404('0x41')][_0x9404('0x44')]));_0x2d7798['attributes']=_0x2d7798[_0x9404('0x45')][_0x9404('0x46')]?_0x2d7798[_0x9404('0x45')]:_0x36d38c[_0x9404('0x3f')];_0x2d7798[_0x9404('0x49')]=qs[_0x9404('0x4a')](_0x4f96bc[_0x9404('0x41')][_0x9404('0x4a')]);_0x2d7798['where']=qs[_0x9404('0x42')](_[_0x9404('0x4c')](_0x4f96bc['query'],_0x36d38c[_0x9404('0x42')]));if(_0x4f96bc[_0x9404('0x41')]['filter']){_0x2d7798['where']=_['merge'](_0x2d7798[_0x9404('0x4b')],{'$or':_['map'](_0x2d7798[_0x9404('0x45')],function(_0x52ba56){var _0x2afabe={};_0x2afabe[_0x52ba56]={'$like':'%'+_0x4f96bc[_0x9404('0x41')][_0x9404('0x4d')]+'%'};return _0x2afabe;})});}_0x2d7798=_[_0x9404('0x51')]({},_0x2d7798,_0x4f96bc[_0x9404('0x52')]);return _0x55f638['getApplications'](_0x2d7798);}})[_0x9404('0x32')](function(_0x398f25){if(_0x398f25){_0x3fdb88=_0x398f25['length'];if(!_0x4f96bc[_0x9404('0x41')][_0x9404('0x47')](_0x9404('0x6a'))){_0x2d7798[_0x9404('0x48')]=qs[_0x9404('0x48')](_0x4f96bc[_0x9404('0x41')][_0x9404('0x48')]);_0x2d7798[_0x9404('0x2d')]=qs[_0x9404('0x2d')](_0x4f96bc[_0x9404('0x41')][_0x9404('0x2d')]);}return _0x55f638[_0x9404('0xba')](_0x2d7798);}})[_0x9404('0x32')](function(_0x1f79c5){if(_0x1f79c5){return _0x1f79c5?{'count':_0x3fdb88,'rows':_0x1f79c5}:null;}})[_0x9404('0x32')](respondWithResult(_0x44b586,null))[_0x9404('0x56')](handleError(_0x44b586,null));};exports[_0x9404('0xbb')]=function(_0x1978bc,_0x199f74,_0x478a59){var _0x51252c={'raw':![],'where':{}};var _0x389549={};var _0x22158f={'count':0x0,'rows':[]};return db[_0x9404('0x3d')][_0x9404('0x69')]({'where':{'id':_0x1978bc[_0x9404('0x57')]['id']}})['then'](handleEntityNotFound(_0x199f74,null))['then'](function(_0x21ab11){if(_0x21ab11){_0x389549[_0x9404('0x3f')]=_[_0x9404('0x40')](db['SmsInteraction'][_0x9404('0x3e')]);_0x389549['query']=_[_0x9404('0x40')](_0x1978bc['query']);_0x389549[_0x9404('0x42')]=_[_0x9404('0x43')](_0x389549[_0x9404('0x3f')],_0x389549[_0x9404('0x41')]);_0x51252c[_0x9404('0x45')]=_[_0x9404('0x43')](_0x389549[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x1978bc[_0x9404('0x41')][_0x9404('0x44')]));_0x51252c[_0x9404('0x45')]=_0x51252c['attributes'][_0x9404('0x46')]?_0x51252c[_0x9404('0x45')]:_0x389549['model'];if(!_0x1978bc[_0x9404('0x41')][_0x9404('0x47')]('nolimit')){_0x51252c['limit']=qs[_0x9404('0x48')](_0x1978bc[_0x9404('0x41')][_0x9404('0x48')]);_0x51252c[_0x9404('0x2d')]=qs[_0x9404('0x2d')](_0x1978bc[_0x9404('0x41')][_0x9404('0x2d')]);}_0x51252c[_0x9404('0x49')]=qs[_0x9404('0x4a')](_0x1978bc[_0x9404('0x41')]['sort']);_0x51252c[_0x9404('0x4b')]=qs['filters'](_['pick'](_0x1978bc['query'],_0x389549['filters']));_0x51252c[_0x9404('0x4b')][_0x9404('0x61')]=_0x21ab11['id'];if(_0x1978bc[_0x9404('0x41')]['filter']){_0x51252c[_0x9404('0x4b')]=_[_0x9404('0x51')](_0x51252c[_0x9404('0x4b')],{'$or':_[_0x9404('0x4e')](_0x51252c[_0x9404('0x45')],function(_0x1b2313){var _0x58b6bf={};_0x58b6bf[_0x1b2313]={'$like':'%'+_0x1978bc[_0x9404('0x41')]['filter']+'%'};return _0x58b6bf;})});}_0x51252c=_[_0x9404('0x51')]({},_0x51252c,_0x1978bc[_0x9404('0x52')]);return db[_0x9404('0x9e')][_0x9404('0x2c')]({'where':_0x51252c[_0x9404('0x4b')]})['then'](function(_0x110892){_0x22158f['count']=_0x110892;if(_0x1978bc['query'][_0x9404('0x53')]){_0x51252c[_0x9404('0x54')]=[{'model':db[_0x9404('0x99')],'as':'Contact','required':![]},{'model':db[_0x9404('0xbc')],'as':_0x9404('0xbd'),'attributes':['name',_0x9404('0xbe'),_0x9404('0xbf')],'required':![]},{'model':db[_0x9404('0xc0')],'as':_0x9404('0xc1'),'attributes':['id','name','color'],'where':_0x1978bc[_0x9404('0x41')][_0x9404('0xc2')]?{'id':_0x1978bc[_0x9404('0x41')][_0x9404('0xc2')]}:undefined,'required':_0x1978bc['query']['tag']?!![]:![]}];}return db[_0x9404('0x9e')]['findAll'](_0x51252c);})[_0x9404('0x32')](function(_0x1d443f){_0x22158f[_0x9404('0x64')]=_0x1d443f;return _0x22158f;});}})[_0x9404('0x32')](respondWithFilteredResult(_0x199f74,_0x51252c))['catch'](handleError(_0x199f74,null));};exports[_0x9404('0x39')]=function(_0x5e37b7,_0x1492b7,_0x24cf00){var _0x33010a,_0x1fb99f,_0x18a6c5;if(_[_0x9404('0x90')](_0x5e37b7[_0x9404('0x5a')]['body'])||_0x5e37b7[_0x9404('0x5a')]['body']===''){throw new db[(_0x9404('0x96'))][(_0x9404('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5e37b7['body']['to'])){throw new db[(_0x9404('0x96'))]['ValidationError'](_0x9404('0xc3'));}_0x33010a=_0x5e37b7[_0x9404('0x5a')]['to'];return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x5e37b7['params']['id']},'include':[{'model':db[_0x9404('0x98')],'as':_0x9404('0xc4'),'include':[{'model':db[_0x9404('0x99')],'as':_0x9404('0x9c'),'where':{'mobile':_0x33010a},'limit':0x1,'order':[[_0x9404('0x76'),_0x9404('0x9a')]]}]}]})[_0x9404('0x32')](handleEntityNotFound(_0x1492b7,null))['then'](function(_0x4aae75){if(_0x4aae75&&_0x4aae75[_0x9404('0xc4')]){_0x1fb99f=_0x4aae75[_0x9404('0x34')]({'plain':!![]});if(_0x1fb99f[_0x9404('0xc4')]&&_0x1fb99f[_0x9404('0xc4')][_0x9404('0x9c')][_0x9404('0x46')]){return _0x1fb99f[_0x9404('0xc4')][_0x9404('0x9c')][0x0];}return db[_0x9404('0x99')]['create'](_[_0x9404('0x18')](_0x5e37b7[_0x9404('0x5a')],{'firstName':_0x33010a,'mobile':_0x33010a,'phone':_0x33010a,'ListId':_0x1fb99f[_0x9404('0x79')]}));}})[_0x9404('0x32')](handleEntityNotFound(_0x1492b7,null))[_0x9404('0x32')](function(_0x449088){if(_0x449088){_0x18a6c5=_0x449088;return db[_0x9404('0x9e')][_0x9404('0x58')]({'where':{'ContactId':_0x18a6c5['id'],'closed':![],'SmsAccountId':_0x1fb99f['id']}})[_0x9404('0x32')](function(_0x697074){if(_0x697074){return[_0x697074,![]];}return db[_0x9404('0x9e')][_0x9404('0x59')]({'UserId':_0x5e37b7[_0x9404('0x5d')]['id'],'ContactId':_0x18a6c5['id'],'SmsAccountId':_0x1fb99f['id'],'phone':_0x33010a,'firstMsgDirection':_0x9404('0xc5'),'Messages':[_[_0x9404('0x51')](_0x5e37b7[_0x9404('0x5a')],{'read':![],'body':_0x5e37b7['body'][_0x9404('0x5a')],'phone':_0x33010a,'SmsAccountId':_0x1fb99f['id'],'UserId':_0x5e37b7['user']['id'],'ContactId':_0x18a6c5['id']})]},{'include':[{'model':db[_0x9404('0xa6')],'as':_0x9404('0xc6')}]})[_0x9404('0x32')](function(_0x2d3b42){return[_0x2d3b42,!![]];});});}})[_0x9404('0x9f')](function(_0x287749,_0x36b5c6){if(_0x36b5c6){return _0x287749;}return db[_0x9404('0xa6')][_0x9404('0x59')](_[_0x9404('0x51')](_0x5e37b7[_0x9404('0x5a')],{'read':![],'body':_0x5e37b7[_0x9404('0x5a')]['body'],'phone':_0x33010a,'SmsAccountId':_0x1fb99f['id'],'SmsInteractionId':_0x287749['id'],'UserId':_0x5e37b7['user']['id'],'ContactId':_0x18a6c5['id']}))[_0x9404('0x32')](function(_0x58802c){_0x287749[_0x9404('0xc7')][_0x9404('0xc6')]=[];_0x287749[_0x9404('0xc7')][_0x9404('0xc6')]['push'](_0x58802c[_0x9404('0xc7')]);return _0x287749;});})[_0x9404('0x32')](respondWithResult(_0x1492b7,null))['catch'](handleError(_0x1492b7,null));};exports[_0x9404('0x29')]=function(_0x16902d,_0x2b4091,_0x11d691){if(_0x16902d[_0x9404('0x5a')]['id']){delete _0x16902d[_0x9404('0x5a')]['id'];}console[_0x9404('0xc8')](_0x9404('0xc9'),_0x16902d[_0x9404('0x5a')]);var _0x9aff9f,_0x572ebf,_0x4528b6;return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x16902d[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x2b4091,null))['then'](function(_0x1af812){if(_0x1af812){_0x4528b6=_0x1af812;logger[_0x9404('0x23')](_0x9404('0x24'),'status',_0x9404('0xca'),_0x1af812['type'],util[_0x9404('0xcb')](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1af812[_0x9404('0x4f')]){case'skebby':if(_0x16902d[_0x9404('0x5a')][_0x9404('0xcc')]&&_0x16902d[_0x9404('0x5a')][_0x9404('0x29')]){_0x572ebf=_0x16902d[_0x9404('0x5a')][_0x9404('0x29')];return db['SmsMessage'][_0x9404('0x58')]({'where':{'messageId':_0x16902d[_0x9404('0x5a')][_0x9404('0xcc')]}});}break;case _0x9404('0x80'):if(_0x16902d['body']['requestid']&&_0x16902d[_0x9404('0x5a')][_0x9404('0xcd')]){_0x572ebf=_0x16902d[_0x9404('0x5a')][_0x9404('0xcd')];return db['SmsMessage'][_0x9404('0x58')]({'where':{'messageId':_0x16902d[_0x9404('0x5a')][_0x9404('0xce')]}});}break;case _0x9404('0xcf'):if(_0x16902d[_0x9404('0x5a')][_0x9404('0x82')]&&_0x16902d[_0x9404('0x5a')][_0x9404('0xd0')]){_0x572ebf=_0x16902d[_0x9404('0x5a')][_0x9404('0xd0')];return db['SmsMessage'][_0x9404('0x58')]({'where':{'messageId':_0x16902d[_0x9404('0x5a')][_0x9404('0x82')]}});}break;case _0x9404('0x86'):var _0xc4f82a=_0x16902d['body'][_0x9404('0x87')][0x0];if(_0xc4f82a[_0x9404('0x81')]&&_0xc4f82a[_0x9404('0x29')][_0x9404('0xd1')]===_0x9404('0xd2')){_0x572ebf=_0xc4f82a[_0x9404('0x29')][_0x9404('0xd1')];return db[_0x9404('0xa6')]['find']({'where':{'messageId':_0xc4f82a[_0x9404('0x81')]}});}break;case _0x9404('0x8b'):if(_0x16902d[_0x9404('0x5a')][_0x9404('0x81')]&&_0x16902d['body'][_0x9404('0x29')]){_0x572ebf=_0x16902d[_0x9404('0x5a')][_0x9404('0x29')];return db['SmsMessage'][_0x9404('0x58')]({'where':{'messageId':_0x16902d[_0x9404('0x5a')]['messageId']}});}break;case _0x9404('0x8e'):if(_0x16902d[_0x9404('0x5a')][_0x9404('0xd3')]&&_0x16902d[_0x9404('0x5a')][_0x9404('0x29')]){_0x572ebf=_0x16902d[_0x9404('0x5a')][_0x9404('0x29')];return db[_0x9404('0xa6')][_0x9404('0x58')]({'where':{'messageId':_0x16902d[_0x9404('0x5a')][_0x9404('0xd3')]}});}break;}}})[_0x9404('0x32')](handleEntityNotFound(_0x2b4091,null))[_0x9404('0x32')](function(_0x1d3b21){if(_0x1d3b21){_0x9aff9f=_0x1d3b21;switch(_0x4528b6['type']){case _0x9404('0x7e'):if(_0x572ebf===_0x9404('0xd2')){return _0x9aff9f[_0x9404('0x5e')]({'read':!![]});}else{logger[_0x9404('0x26')](_0x9404('0x24'),_0x9404('0x29'),'skebby',util[_0x9404('0xcb')](_0x16902d['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x572ebf==='1'){return _0x9aff9f[_0x9404('0x5e')]({'read':!![]});}else{logger[_0x9404('0x26')](_0x9404('0x24'),'status',_0x9404('0x7e'),util['inspect'](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x16902d[_0x9404('0x5a')]['error_code']&&_0x572ebf>=0xc8&&_0x572ebf<=0xce){return _0x9aff9f[_0x9404('0x5e')]({'read':!![]});}else{logger[_0x9404('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9404('0xcf'),util[_0x9404('0xcb')](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x9404('0x86'):var _0x3f90d3=_0x16902d['body'][_0x9404('0x87')][0x0];if(_0x3f90d3[_0x9404('0x29')]['groupName']===_0x9404('0xd2')){return _0x9aff9f[_0x9404('0x5e')]({'read':!![]});}else{logger['error'](_0x9404('0x24'),_0x9404('0x29'),_0x9404('0x86'),util[_0x9404('0xcb')](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x9404('0x8b'):if(_0x572ebf==_0x9404('0xd4')||_0x572ebf==_0x9404('0xd5')){return _0x9aff9f['update']({'read':!![]});}else{logger[_0x9404('0x26')](_0x9404('0x24'),_0x9404('0x29'),_0x9404('0x8b'),util[_0x9404('0xcb')](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x572ebf===_0x9404('0xd6')||_0x572ebf===_0x9404('0xd7')){return _0x9aff9f['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9404('0x8e'),util[_0x9404('0xcb')](_0x16902d[_0x9404('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x9aff9f;}})[_0x9404('0x32')](respondWithResult(_0x2b4091,null))[_0x9404('0x56')](handleError(_0x2b4091,null));};exports[_0x9404('0xd8')]=function(_0x22a98a,_0x3596a0,_0x5a4035){var _0x5f26f3,_0x4d63da,_0x58fb49;return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x22a98a[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x3596a0,null))['then'](function(_0x34d647){if(_0x34d647){_0x58fb49=_0x34d647;logger['debug'](_0x9404('0x24'),_0x9404('0x29'),_0x9404('0xca'),_0x34d647[_0x9404('0x4f')],util[_0x9404('0xcb')](_0x22a98a['query'],{'showHidden':![],'depth':null}));switch(_0x34d647['type']){case _0x9404('0x88'):if(_0x22a98a[_0x9404('0x41')]['message-id']&&_0x22a98a[_0x9404('0x41')][_0x9404('0xd9')]){_0x4d63da=_0x22a98a[_0x9404('0x41')][_0x9404('0xd9')];return db[_0x9404('0xa6')][_0x9404('0x58')]({'where':{'messageId':_0x22a98a[_0x9404('0x41')][_0x9404('0xda')]}});}break;}}})[_0x9404('0x32')](handleEntityNotFound(_0x3596a0,null))[_0x9404('0x32')](function(_0x282c4a){if(_0x282c4a){_0x5f26f3=_0x282c4a;switch(_0x58fb49[_0x9404('0x4f')]){case'csc':if(_0x4d63da==='2'||_0x4d63da==='6'){return _0x5f26f3[_0x9404('0x5e')]({'read':!![]});}else{logger[_0x9404('0x26')](_0x9404('0x24'),_0x9404('0x29'),'csc',util[_0x9404('0xcb')](_0x22a98a[_0x9404('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x5f26f3;}})['then'](respondWithResult(_0x3596a0,null))[_0x9404('0x56')](handleError(_0x3596a0,null));};exports[_0x9404('0xdb')]=function(_0x47b0a0,_0x30faf0,_0x1b317f){return db['SmsAccount'][_0x9404('0x58')]({'where':{'id':_0x47b0a0[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x30faf0,null))[_0x9404('0x32')](function(_0x546360){if(_0x546360){return _0x546360[_0x9404('0xdb')](_0x47b0a0[_0x9404('0x5a')]['ids'],_[_0x9404('0xdc')](_0x47b0a0['body'],[_0x9404('0x66'),'id'])||{})['spread'](function(_0x115d41){for(var _0x21b696=0x0;_0x21b696<_0x47b0a0[_0x9404('0x5a')][_0x9404('0x66')][_0x9404('0x46')];_0x21b696+=0x1){socket[_0x9404('0xdd')]('userSmsAccount:save',{'UserId':_0x47b0a0['body']['ids'][_0x21b696],'SmsAccountId':_0x47b0a0['params']['id']});}return _0x115d41;});}})[_0x9404('0x32')](respondWithResult(_0x30faf0,null))[_0x9404('0x56')](handleError(_0x30faf0,null));};exports[_0x9404('0xde')]=function(_0x33a67d,_0x760da7,_0x5a0a3f){var _0x111986;return db[_0x9404('0x3d')][_0x9404('0x58')]({'where':{'id':_0x33a67d[_0x9404('0x57')]['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x760da7,null))[_0x9404('0x32')](function(_0x30f16f){if(_0x30f16f){return _0x30f16f['removeAgents'](_0x33a67d[_0x9404('0x41')][_0x9404('0x66')])['then'](function(_0x53641d){if(_[_0x9404('0xdf')](_0x33a67d['query'][_0x9404('0x66')])){for(var _0x30c5a1=0x0;_0x30c5a1<_0x33a67d['query']['ids'][_0x9404('0x46')];_0x30c5a1+=0x1){socket['emit'](_0x9404('0xe0'),{'UserId':_0x33a67d[_0x9404('0x41')][_0x9404('0x66')][_0x30c5a1],'SmsAccountId':_0x33a67d[_0x9404('0x57')]['id']});}}else{socket[_0x9404('0xdd')](_0x9404('0xe0'),{'UserId':_0x33a67d['query'][_0x9404('0x66')],'SmsAccountId':_0x33a67d[_0x9404('0x57')]['id']});}});}})[_0x9404('0x32')](respondWithStatusCode(_0x760da7,null))[_0x9404('0x56')](handleError(_0x760da7,null));};exports[_0x9404('0xe1')]=function(_0x4f2391,_0x2d58da,_0x353d59){var _0x175d0d={};var _0x3a91c5={};var _0x1a5dc2;var _0x549b44;return db[_0x9404('0x3d')][_0x9404('0x69')]({'where':{'id':_0x4f2391['params']['id']}})[_0x9404('0x32')](handleEntityNotFound(_0x2d58da,null))[_0x9404('0x32')](function(_0x48fb25){if(_0x48fb25){_0x1a5dc2=_0x48fb25;_0x3a91c5[_0x9404('0x3f')]=_[_0x9404('0x40')](db[_0x9404('0xbc')]['rawAttributes']);_0x3a91c5[_0x9404('0x41')]=_[_0x9404('0x40')](_0x4f2391[_0x9404('0x41')]);_0x3a91c5[_0x9404('0x42')]=_[_0x9404('0x43')](_0x3a91c5['model'],_0x3a91c5[_0x9404('0x41')]);_0x175d0d[_0x9404('0x45')]=_[_0x9404('0x43')](_0x3a91c5[_0x9404('0x3f')],qs[_0x9404('0x44')](_0x4f2391['query'][_0x9404('0x44')]));_0x175d0d[_0x9404('0x45')]=_0x175d0d['attributes'][_0x9404('0x46')]?_0x175d0d[_0x9404('0x45')]:_0x3a91c5[_0x9404('0x3f')];_0x175d0d[_0x9404('0x49')]=qs['sort'](_0x4f2391[_0x9404('0x41')][_0x9404('0x4a')]);_0x175d0d['where']=qs[_0x9404('0x42')](_[_0x9404('0x4c')](_0x4f2391['query'],_0x3a91c5['filters']));if(_0x4f2391[_0x9404('0x41')]['filter']){_0x175d0d['where']=_['merge'](_0x175d0d['where'],{'$or':_[_0x9404('0x4e')](_0x175d0d[_0x9404('0x45')],function(_0x3d2ae5){var _0x43c653={};_0x43c653[_0x3d2ae5]={'$like':'%'+_0x4f2391[_0x9404('0x41')][_0x9404('0x4d')]+'%'};return _0x43c653;})});}_0x175d0d=_[_0x9404('0x51')]({},_0x175d0d,_0x4f2391[_0x9404('0x52')]);return _0x1a5dc2[_0x9404('0xe1')](_0x175d0d);}})[_0x9404('0x32')](function(_0xa596df){if(_0xa596df){_0x549b44=_0xa596df[_0x9404('0x46')];if(!_0x4f2391[_0x9404('0x41')][_0x9404('0x47')]('nolimit')){_0x175d0d[_0x9404('0x48')]=qs[_0x9404('0x48')](_0x4f2391['query'][_0x9404('0x48')]);_0x175d0d[_0x9404('0x2d')]=qs[_0x9404('0x2d')](_0x4f2391[_0x9404('0x41')][_0x9404('0x2d')]);}return _0x1a5dc2[_0x9404('0xe1')](_0x175d0d);}})['then'](function(_0xd9fe2c){if(_0xd9fe2c){return _0xd9fe2c?{'count':_0x549b44,'rows':_0xd9fe2c}:null;}})['then'](respondWithResult(_0x2d58da,null))[_0x9404('0x56')](handleError(_0x2d58da,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index cfa5876..d3d3bff 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 _0x5926=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5926,0x1d3));var _0x6592=function(_0x5b6550,_0x549c5a){_0x5b6550=_0x5b6550-0x0;var _0x1cdfbc=_0x5926[_0x5b6550];return _0x1cdfbc;};'use strict';var EventEmitter=require(_0x6592('0x0'));var SmsAccount=require(_0x6592('0x1'))['db'][_0x6592('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6592('0x3')](0x0);var events={'afterCreate':_0x6592('0x4'),'afterUpdate':'update','afterDestroy':_0x6592('0x5')};function emitEvent(_0x3df326){return function(_0x27aca9,_0x1824c7,_0x22fa33){SmsAccountEvents[_0x6592('0x6')](_0x3df326+':'+_0x27aca9['id'],_0x27aca9);SmsAccountEvents[_0x6592('0x6')](_0x3df326,_0x27aca9);_0x22fa33(null);};}for(var e in events){if(events[_0x6592('0x7')](e)){var event=events[e];SmsAccount[_0x6592('0x8')](e,emitEvent(event));}}module[_0x6592('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xde0e=['SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x360640,_0x58a9bc){var _0xe1451=function(_0x653842){while(--_0x653842){_0x360640['push'](_0x360640['shift']());}};_0xe1451(++_0x58a9bc);}(_0xde0e,0xdf));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xede0('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xede0('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xede0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xede0('0x3'),'afterDestroy':_0xede0('0x4')};function emitEvent(_0x5e4cf3){return function(_0x38218b,_0x3d78fe,_0x16fca0){SmsAccountEvents[_0xede0('0x5')](_0x5e4cf3+':'+_0x38218b['id'],_0x38218b);SmsAccountEvents[_0xede0('0x5')](_0x5e4cf3,_0x38218b);_0x16fca0(null);};}for(var e in events){if(events[_0xede0('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xede0('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 567fa9f..58c802d 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 _0xf1a7=['define','SmsAccount','sms_accounts','util','api','moment','bluebird','request-promise','./smsAccount.attributes','exports'];(function(_0x170698,_0x5aff45){var _0x3cfbdb=function(_0x9262f2){while(--_0x9262f2){_0x170698['push'](_0x170698['shift']());}};_0x3cfbdb(++_0x5aff45);}(_0xf1a7,0x8f));var _0x7f1a=function(_0x55db83,_0x5d4e64){_0x55db83=_0x55db83-0x0;var _0x3802d5=_0xf1a7[_0x55db83];return _0x3802d5;};'use strict';var _=require('lodash');var util=require(_0x7f1a('0x0'));var logger=require('../../config/logger')(_0x7f1a('0x1'));var moment=require(_0x7f1a('0x2'));var BPromise=require(_0x7f1a('0x3'));var rp=require(_0x7f1a('0x4'));var attributes=require(_0x7f1a('0x5'));module[_0x7f1a('0x6')]=function(_0x2eb5d7,_0x1be1da){return _0x2eb5d7[_0x7f1a('0x7')](_0x7f1a('0x8'),attributes,{'tableName':_0x7f1a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x927e=['bluebird','request-promise','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','moment'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x927e,0x1ab));var _0xe927=function(_0x5d3394,_0x5e5dce){_0x5d3394=_0x5d3394-0x0;var _0x102ca5=_0x927e[_0x5d3394];return _0x102ca5;};'use strict';var _=require(_0xe927('0x0'));var util=require(_0xe927('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe927('0x2'));var BPromise=require(_0xe927('0x3'));var rp=require(_0xe927('0x4'));var attributes=require(_0xe927('0x5'));module[_0xe927('0x6')]=function(_0x3c67e6,_0x1052e8){return _0x3c67e6[_0xe927('0x7')](_0xe927('0x8'),attributes,{'tableName':_0xe927('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 538cdb5..3516bb7 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 _0x44c8=['options','raw','where','attributes','include','map','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','then','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','ShowSmsAccount','find'];(function(_0x4c8aed,_0x57a438){var _0x615f4d=function(_0x58e2fe){while(--_0x58e2fe){_0x4c8aed['push'](_0x4c8aed['shift']());}};_0x615f4d(++_0x57a438);}(_0x44c8,0xfd));var _0x844c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x44c8[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x844c('0x0'));var util=require(_0x844c('0x1'));var moment=require(_0x844c('0x2'));var BPromise=require('bluebird');var rs=require(_0x844c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x844c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x844c('0x5'))(_0x844c('0x6'));var config=require(_0x844c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x844c('0x8')]({'port':0x232a});config['redis']=_[_0x844c('0x9')](config[_0x844c('0xa')],{'host':_0x844c('0xb'),'port':0x18eb});var socket=require(_0x844c('0xc'))(new Redis(config[_0x844c('0xa')]));require(_0x844c('0xd'))[_0x844c('0xe')](socket);function respondWithRpcPromise(_0x37bf6d,_0x42506c,_0x31e335){return new BPromise(function(_0x199bfc,_0x5caa2c){return client['request'](_0x37bf6d,_0x31e335)[_0x844c('0xf')](function(_0x16dd52){logger['info']('SmsAccount,\x20%s,\x20%s',_0x42506c,_0x844c('0x10'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x42506c,_0x844c('0x10'),JSON[_0x844c('0x11')](_0x16dd52));if(_0x16dd52[_0x844c('0x12')]){if(_0x16dd52[_0x844c('0x12')][_0x844c('0x13')]===0x1f4){logger['error'](_0x844c('0x14'),_0x42506c,_0x16dd52[_0x844c('0x12')]['message']);return _0x5caa2c(_0x16dd52[_0x844c('0x12')][_0x844c('0x15')]);}logger[_0x844c('0x12')]('SmsAccount,\x20%s,\x20%s',_0x42506c,_0x16dd52['error']['message']);return _0x199bfc(_0x16dd52[_0x844c('0x12')][_0x844c('0x15')]);}else{logger[_0x844c('0x16')](_0x844c('0x14'),_0x42506c,'request\x20sent');_0x199bfc(_0x16dd52[_0x844c('0x17')][_0x844c('0x15')]);}})[_0x844c('0x18')](function(_0x939554){logger[_0x844c('0x12')](_0x844c('0x14'),_0x42506c,_0x939554);_0x5caa2c(_0x939554);});});}exports[_0x844c('0x19')]=function(_0x44f8f1){var _0x2b8f3a=this;return new Promise(function(_0x495f3b,_0x1105a3){return db['SmsAccount'][_0x844c('0x1a')]({'raw':_0x44f8f1[_0x844c('0x1b')]?_0x44f8f1[_0x844c('0x1b')][_0x844c('0x1c')]===undefined?!![]:![]:!![],'where':_0x44f8f1['options']?_0x44f8f1[_0x844c('0x1b')][_0x844c('0x1d')]||null:null,'attributes':_0x44f8f1[_0x844c('0x1b')]?_0x44f8f1['options'][_0x844c('0x1e')]||null:null,'include':_0x44f8f1[_0x844c('0x1b')]?_0x44f8f1[_0x844c('0x1b')][_0x844c('0x1f')]?_['map'](_0x44f8f1[_0x844c('0x1b')][_0x844c('0x1f')],function(_0x3d9264){return{'model':db[_0x3d9264['model']],'as':_0x3d9264['as'],'attributes':_0x3d9264[_0x844c('0x1e')],'include':_0x3d9264[_0x844c('0x1f')]?_[_0x844c('0x20')](_0x3d9264[_0x844c('0x1f')],function(_0x2126e8){return{'model':db[_0x2126e8[_0x844c('0x21')]],'as':_0x2126e8['as'],'attributes':_0x2126e8[_0x844c('0x1e')],'include':_0x2126e8[_0x844c('0x1f')]?_[_0x844c('0x20')](_0x2126e8['include'],function(_0x5d993c){return{'model':db[_0x5d993c['model']],'as':_0x5d993c['as'],'attributes':_0x5d993c[_0x844c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2faa78){logger[_0x844c('0x16')](_0x844c('0x19'),_0x44f8f1);logger[_0x844c('0x22')](_0x844c('0x19'),_0x44f8f1,JSON[_0x844c('0x11')](_0x2faa78));_0x495f3b(_0x2faa78);})[_0x844c('0x18')](function(_0x245e35){logger['error']('ShowSmsAccount',_0x245e35[_0x844c('0x15')],_0x44f8f1);_0x1105a3(_0x2b8f3a['error'](0x1f4,_0x245e35[_0x844c('0x15')]));});});}; \ No newline at end of file +var _0x4129=['error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4cdd4d,_0x3cce1e){var _0x1bbd06=function(_0x4578cf){while(--_0x4578cf){_0x4cdd4d['push'](_0x4cdd4d['shift']());}};_0x1bbd06(++_0x3cce1e);}(_0x4129,0x93));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9412('0x0'));var util=require('util');var moment=require(_0x9412('0x1'));var BPromise=require(_0x9412('0x2'));var rs=require(_0x9412('0x3'));var fs=require('fs');var Redis=require(_0x9412('0x4'));var db=require(_0x9412('0x5'))['db'];var utils=require(_0x9412('0x6'));var logger=require('../../config/logger')(_0x9412('0x7'));var config=require(_0x9412('0x8'));var jayson=require(_0x9412('0x9'));var client=jayson[_0x9412('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9412('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x9412('0xc')](socket);function respondWithRpcPromise(_0x6843af,_0x15cfbf,_0x319ed3){return new BPromise(function(_0x249178,_0x5cf4a4){return client['request'](_0x6843af,_0x319ed3)[_0x9412('0xd')](function(_0x1c5ed2){logger['info'](_0x9412('0xe'),_0x15cfbf,_0x9412('0xf'));logger[_0x9412('0x10')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x15cfbf,_0x9412('0xf'),JSON[_0x9412('0x11')](_0x1c5ed2));if(_0x1c5ed2[_0x9412('0x12')]){if(_0x1c5ed2[_0x9412('0x12')][_0x9412('0x13')]===0x1f4){logger[_0x9412('0x12')](_0x9412('0xe'),_0x15cfbf,_0x1c5ed2['error'][_0x9412('0x14')]);return _0x5cf4a4(_0x1c5ed2[_0x9412('0x12')][_0x9412('0x14')]);}logger[_0x9412('0x12')](_0x9412('0xe'),_0x15cfbf,_0x1c5ed2[_0x9412('0x12')][_0x9412('0x14')]);return _0x249178(_0x1c5ed2[_0x9412('0x12')][_0x9412('0x14')]);}else{logger[_0x9412('0x15')](_0x9412('0xe'),_0x15cfbf,_0x9412('0xf'));_0x249178(_0x1c5ed2[_0x9412('0x16')][_0x9412('0x14')]);}})[_0x9412('0x17')](function(_0x4a69b6){logger[_0x9412('0x12')](_0x9412('0xe'),_0x15cfbf,_0x4a69b6);_0x5cf4a4(_0x4a69b6);});});}exports[_0x9412('0x18')]=function(_0x4ce849){var _0x56a275=this;return new Promise(function(_0x25accd,_0x1bbbcc){return db[_0x9412('0x19')]['find']({'raw':_0x4ce849[_0x9412('0x1a')]?_0x4ce849[_0x9412('0x1a')][_0x9412('0x1b')]===undefined?!![]:![]:!![],'where':_0x4ce849[_0x9412('0x1a')]?_0x4ce849['options'][_0x9412('0x1c')]||null:null,'attributes':_0x4ce849[_0x9412('0x1a')]?_0x4ce849['options'][_0x9412('0x1d')]||null:null,'include':_0x4ce849[_0x9412('0x1a')]?_0x4ce849['options'][_0x9412('0x1e')]?_[_0x9412('0x1f')](_0x4ce849[_0x9412('0x1a')][_0x9412('0x1e')],function(_0x435c89){return{'model':db[_0x435c89[_0x9412('0x20')]],'as':_0x435c89['as'],'attributes':_0x435c89[_0x9412('0x1d')],'include':_0x435c89[_0x9412('0x1e')]?_[_0x9412('0x1f')](_0x435c89[_0x9412('0x1e')],function(_0x3398d5){return{'model':db[_0x3398d5[_0x9412('0x20')]],'as':_0x3398d5['as'],'attributes':_0x3398d5[_0x9412('0x1d')],'include':_0x3398d5[_0x9412('0x1e')]?_['map'](_0x3398d5[_0x9412('0x1e')],function(_0x48f54d){return{'model':db[_0x48f54d[_0x9412('0x20')]],'as':_0x48f54d['as'],'attributes':_0x48f54d[_0x9412('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9412('0xd')](function(_0x1eb82d){logger['info'](_0x9412('0x18'),_0x4ce849);logger[_0x9412('0x10')](_0x9412('0x18'),_0x4ce849,JSON[_0x9412('0x11')](_0x1eb82d));_0x25accd(_0x1eb82d);})[_0x9412('0x17')](function(_0x5b6cce){logger['error']('ShowSmsAccount',_0x5b6cce[_0x9412('0x14')],_0x4ce849);_0x1bbbcc(_0x56a275[_0x9412('0x12')](0x1f4,_0x5b6cce[_0x9412('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e89e5fa..9d7ebe9 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 _0xd58b=['removeListener','register','./smsAccount.events','update','emit'];(function(_0x1ab0c0,_0x496f5a){var _0x1bedcf=function(_0x153a25){while(--_0x153a25){_0x1ab0c0['push'](_0x1ab0c0['shift']());}};_0x1bedcf(++_0x496f5a);}(_0xd58b,0x19c));var _0xbd58=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xd58b[_0x819464];return _0x49dcc0;};'use strict';var SmsAccountEvents=require(_0xbd58('0x0'));var events=['save','remove',_0xbd58('0x1')];function createListener(_0x16866b,_0x47f8a6){return function(_0x2c801c){_0x47f8a6[_0xbd58('0x2')](_0x16866b,_0x2c801c);};}function removeListener(_0x4dc40c,_0x178a02){return function(){SmsAccountEvents[_0xbd58('0x3')](_0x4dc40c,_0x178a02);};}exports[_0xbd58('0x4')]=function(_0x3bef17){for(var _0x45812c=0x0,_0x3a3919=events['length'];_0x45812c<_0x3a3919;_0x45812c++){var _0x1bbfea=events[_0x45812c];var _0xf3a62c=createListener('smsAccount:'+_0x1bbfea,_0x3bef17);SmsAccountEvents['on'](_0x1bbfea,_0xf3a62c);}}; \ No newline at end of file +var _0xab74=['removeListener','register','length','smsAccount:','./smsAccount.events','save','remove','update','emit'];(function(_0x38ddeb,_0x2e59d9){var _0x463c83=function(_0x9b3da2){while(--_0x9b3da2){_0x38ddeb['push'](_0x38ddeb['shift']());}};_0x463c83(++_0x2e59d9);}(_0xab74,0xaf));var _0x4ab7=function(_0x3a978e,_0x1130c2){_0x3a978e=_0x3a978e-0x0;var _0x9e2345=_0xab74[_0x3a978e];return _0x9e2345;};'use strict';var SmsAccountEvents=require(_0x4ab7('0x0'));var events=[_0x4ab7('0x1'),_0x4ab7('0x2'),_0x4ab7('0x3')];function createListener(_0x2b8d9e,_0x1b8648){return function(_0x5ef5cb){_0x1b8648[_0x4ab7('0x4')](_0x2b8d9e,_0x5ef5cb);};}function removeListener(_0x3c2bd8,_0x207f2d){return function(){SmsAccountEvents[_0x4ab7('0x5')](_0x3c2bd8,_0x207f2d);};}exports[_0x4ab7('0x6')]=function(_0x1fcf2d){for(var _0x25d295=0x0,_0x305568=events[_0x4ab7('0x7')];_0x25d295<_0x305568;_0x25d295++){var _0x347806=events[_0x25d295];var _0x3d8517=createListener(_0x4ab7('0x8')+_0x347806,_0x1fcf2d);SmsAccountEvents['on'](_0x347806,_0x3d8517);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index d4b2789..151cde8 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 _0xefa6=['../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0xefa6,0x125));var _0x6efa=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xefa6[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x6efa('0x0'));var util=require(_0x6efa('0x1'));var path=require(_0x6efa('0x2'));var timeout=require(_0x6efa('0x3'));var express=require(_0x6efa('0x4'));var router=express[_0x6efa('0x5')]();var auth=require(_0x6efa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6efa('0x7'));var controller=require(_0x6efa('0x8'));router[_0x6efa('0x9')]('/',auth[_0x6efa('0xa')](),controller[_0x6efa('0xb')]);router[_0x6efa('0x9')](_0x6efa('0xc'),auth['isAuthenticated'](),controller[_0x6efa('0xd')]);router[_0x6efa('0xe')]('/',auth[_0x6efa('0xa')](),controller[_0x6efa('0xf')]);router[_0x6efa('0x10')](_0x6efa('0xc'),auth[_0x6efa('0xa')](),controller[_0x6efa('0x11')]);router[_0x6efa('0x12')](_0x6efa('0xc'),auth[_0x6efa('0xa')](),controller['destroy']);module[_0x6efa('0x13')]=router; \ No newline at end of file +var _0x49fe=['show','post','create','update','delete','/:id','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x37eb10,_0x28082b){var _0x19e1e4=function(_0x4e7163){while(--_0x4e7163){_0x37eb10['push'](_0x37eb10['shift']());}};_0x19e1e4(++_0x28082b);}(_0x49fe,0x106));var _0xe49f=function(_0x5ca902,_0x38fac1){_0x5ca902=_0x5ca902-0x0;var _0x2ee296=_0x49fe[_0x5ca902];return _0x2ee296;};'use strict';var multer=require(_0xe49f('0x0'));var util=require('util');var path=require(_0xe49f('0x1'));var timeout=require(_0xe49f('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe49f('0x3'));var interaction=require(_0xe49f('0x4'));var config=require('../../config/environment');var controller=require('./smsApplication.controller');router[_0xe49f('0x5')]('/',auth[_0xe49f('0x6')](),controller[_0xe49f('0x7')]);router[_0xe49f('0x5')]('/:id',auth[_0xe49f('0x6')](),controller[_0xe49f('0x8')]);router[_0xe49f('0x9')]('/',auth[_0xe49f('0x6')](),controller[_0xe49f('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe49f('0xb')]);router[_0xe49f('0xc')](_0xe49f('0xd'),auth['isAuthenticated'](),controller[_0xe49f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d2e7faa..48afab7 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 _0xb749=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0xb749,0xac));var _0x9b74=function(_0x41e507,_0x694b79){_0x41e507=_0x41e507-0x0;var _0x3bbe37=_0xb749[_0x41e507];return _0x3bbe37;};'use strict';var Sequelize=require(_0x9b74('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9b74('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9b74('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9b74('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9b74('0x2')],'defaultValue':_0x9b74('0x4')}}; \ No newline at end of file +var _0x7e27=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x26a7f6,_0x40202f){var _0x3fce83=function(_0x2f73a7){while(--_0x2f73a7){_0x26a7f6['push'](_0x26a7f6['shift']());}};_0x3fce83(++_0x40202f);}(_0x7e27,0xdd));var _0x77e2=function(_0x49b3e7,_0x9b0521){_0x49b3e7=_0x49b3e7-0x0;var _0x48908b=_0x7e27[_0x49b3e7];return _0x48908b;};'use strict';var Sequelize=require(_0x77e2('0x0'));module[_0x77e2('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x77e2('0x2')],'allowNull':![],'defaultValue':_0x77e2('0x3')},'appdata':{'type':Sequelize[_0x77e2('0x4')]()},'description':{'type':Sequelize[_0x77e2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x77e2('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a2901e6..9fb48ff 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 _0x8f2c=['api','../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SmsApplication','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x8f2c,0x1b0));var _0xc8f2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8f2c[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xc8f2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc8f2('0x1'));var zipdir=require(_0xc8f2('0x2'));var jsonpatch=require(_0xc8f2('0x3'));var rp=require(_0xc8f2('0x4'));var moment=require(_0xc8f2('0x5'));var BPromise=require(_0xc8f2('0x6'));var Mustache=require(_0xc8f2('0x7'));var util=require(_0xc8f2('0x8'));var path=require('path');var sox=require(_0xc8f2('0x9'));var csv=require(_0xc8f2('0xa'));var ejs=require(_0xc8f2('0xb'));var fs=require('fs');var _=require(_0xc8f2('0xc'));var squel=require(_0xc8f2('0xd'));var crypto=require(_0xc8f2('0xe'));var jsforce=require(_0xc8f2('0xf'));var deskjs=require(_0xc8f2('0x10'));var toCsv=require(_0xc8f2('0xa'));var querystring=require(_0xc8f2('0x11'));var Papa=require(_0xc8f2('0x12'));var authService=require(_0xc8f2('0x13'));var hardwareService=require(_0xc8f2('0x14'));var Redis=require(_0xc8f2('0x15'));var qs=require(_0xc8f2('0x16'));var logger=require(_0xc8f2('0x17'))(_0xc8f2('0x18'));var utils=require('../../config/utils');var config=require(_0xc8f2('0x19'));var db=require(_0xc8f2('0x1a'))['db'];function respondWithStatusCode(_0x12e559,_0x3816f0){_0x3816f0=_0x3816f0||0xcc;return function(_0x4e1f5c){if(_0x4e1f5c){return _0x12e559['sendStatus'](_0x3816f0);}return _0x12e559[_0xc8f2('0x1b')](_0x3816f0)[_0xc8f2('0x1c')]();};}function respondWithResult(_0x435123,_0x111a38){_0x111a38=_0x111a38||0xc8;return function(_0x12bcc2){if(_0x12bcc2){return _0x435123[_0xc8f2('0x1b')](_0x111a38)[_0xc8f2('0x1d')](_0x12bcc2);}};}function respondWithFilteredResult(_0x3946c0,_0x98db99){return function(_0x503f14){if(_0x503f14){var _0x2b0d93=_0x503f14[_0xc8f2('0x1e')],_0x56d12d=_0x98db99['offset'],_0x1035e4=_0x98db99[_0xc8f2('0x1f')]+_0x98db99['limit'],_0x2127e0;if(_0x1035e4>=_0x2b0d93){_0x1035e4=_0x2b0d93;_0x2127e0=0xc8;}else{_0x2127e0=0xce;}_0x3946c0[_0xc8f2('0x1b')](_0x2127e0);return _0x3946c0['set'](_0xc8f2('0x20'),_0x56d12d+'-'+_0x1035e4+'/'+_0x2b0d93)[_0xc8f2('0x1d')](_0x503f14);}return null;};}function patchUpdates(_0x105957){return function(_0x352447){try{jsonpatch['apply'](_0x352447,_0x105957,!![]);}catch(_0x52bfd7){return BPromise[_0xc8f2('0x21')](_0x52bfd7);}return _0x352447[_0xc8f2('0x22')]();};}function saveUpdates(_0x5e44f1,_0x410846){return function(_0x5f3c2f){if(_0x5f3c2f){return _0x5f3c2f[_0xc8f2('0x23')](_0x5e44f1)[_0xc8f2('0x24')](function(_0x3d3616){return _0x3d3616;});}return null;};}function removeEntity(_0x3d518a,_0x4581c9){return function(_0x5c2039){if(_0x5c2039){return _0x5c2039[_0xc8f2('0x25')]()[_0xc8f2('0x24')](function(){_0x3d518a['status'](0xcc)[_0xc8f2('0x1c')]();});}};}function handleEntityNotFound(_0x4bcf64,_0x50c0af){return function(_0xee9779){if(!_0xee9779){_0x4bcf64[_0xc8f2('0x26')](0x194);}return _0xee9779;};}function handleError(_0x432147,_0xa789d4){_0xa789d4=_0xa789d4||0x1f4;return function(_0x243d45){logger[_0xc8f2('0x27')](_0x243d45[_0xc8f2('0x28')]);if(_0x243d45['name']){delete _0x243d45[_0xc8f2('0x29')];}_0x432147['status'](_0xa789d4)[_0xc8f2('0x2a')](_0x243d45);};}exports[_0xc8f2('0x2b')]=function(_0x404d21,_0x286af9){var _0xff2ba6={},_0x3d9941={},_0x4e8eb7={'count':0x0,'rows':[]};var _0x986183=db[_0xc8f2('0x2c')]['rawAttributes'];_0x3d9941[_0xc8f2('0x2d')]=_['keys'](_0x986183);_0x3d9941['query']=_['keys'](_0x404d21[_0xc8f2('0x2e')]);_0x3d9941[_0xc8f2('0x2f')]=_[_0xc8f2('0x30')](_0x3d9941[_0xc8f2('0x2d')],_0x3d9941[_0xc8f2('0x2e')]);_0xff2ba6[_0xc8f2('0x31')]=_[_0xc8f2('0x30')](_0x3d9941[_0xc8f2('0x2d')],qs[_0xc8f2('0x32')](_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x32')]));_0xff2ba6[_0xc8f2('0x31')]=_0xff2ba6[_0xc8f2('0x31')][_0xc8f2('0x33')]?_0xff2ba6[_0xc8f2('0x31')]:_0x3d9941[_0xc8f2('0x2d')];if(!_0x404d21[_0xc8f2('0x2e')]['hasOwnProperty'](_0xc8f2('0x34'))){_0xff2ba6['limit']=qs[_0xc8f2('0x35')](_0x404d21[_0xc8f2('0x2e')]['limit']);_0xff2ba6[_0xc8f2('0x1f')]=qs[_0xc8f2('0x1f')](_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x1f')]);}_0xff2ba6['order']=qs[_0xc8f2('0x36')](_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x36')]);_0xff2ba6[_0xc8f2('0x37')]=qs['filters'](_[_0xc8f2('0x38')](_0x404d21[_0xc8f2('0x2e')],_0x3d9941[_0xc8f2('0x2f')]));if(_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x39')]){_0xff2ba6[_0xc8f2('0x37')]=_[_0xc8f2('0x3a')](_0xff2ba6['where'],{'$or':_[_0xc8f2('0x3b')](_0x986183,function(_0x57aa2c){if(_0x57aa2c[_0xc8f2('0x3c')][_0xc8f2('0x3d')]!==_0xc8f2('0x3e')){var _0x18e407={};_0x18e407[_0x57aa2c[_0xc8f2('0x3f')]]={'$like':'%'+_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x39')]+'%'};return _0x18e407;}})});}_0xff2ba6=_[_0xc8f2('0x3a')]({},_0xff2ba6,_0x404d21[_0xc8f2('0x40')]);var _0x52af9d={'where':_0xff2ba6['where']};return db['SmsApplication'][_0xc8f2('0x1e')](_0x52af9d)[_0xc8f2('0x24')](function(_0x35bd41){_0x4e8eb7['count']=_0x35bd41;if(_0x404d21[_0xc8f2('0x2e')][_0xc8f2('0x41')]){_0xff2ba6[_0xc8f2('0x42')]=[{'all':!![]}];}return db[_0xc8f2('0x2c')][_0xc8f2('0x43')](_0xff2ba6);})[_0xc8f2('0x24')](function(_0x283ae9){_0x4e8eb7[_0xc8f2('0x44')]=_0x283ae9;return _0x4e8eb7;})['then'](respondWithFilteredResult(_0x286af9,_0xff2ba6))[_0xc8f2('0x45')](handleError(_0x286af9,null));};exports[_0xc8f2('0x46')]=function(_0x556ba0,_0x319aaf){var _0x10a189={'raw':!![],'where':{'id':_0x556ba0[_0xc8f2('0x47')]['id']}},_0x5e4676={};_0x5e4676['model']=_[_0xc8f2('0x48')](db['SmsApplication']['rawAttributes']);_0x5e4676['query']=_[_0xc8f2('0x48')](_0x556ba0['query']);_0x5e4676['filters']=_[_0xc8f2('0x30')](_0x5e4676[_0xc8f2('0x2d')],_0x5e4676[_0xc8f2('0x2e')]);_0x10a189['attributes']=_[_0xc8f2('0x30')](_0x5e4676['model'],qs[_0xc8f2('0x32')](_0x556ba0[_0xc8f2('0x2e')][_0xc8f2('0x32')]));_0x10a189[_0xc8f2('0x31')]=_0x10a189[_0xc8f2('0x31')]['length']?_0x10a189[_0xc8f2('0x31')]:_0x5e4676[_0xc8f2('0x2d')];if(_0x556ba0[_0xc8f2('0x2e')][_0xc8f2('0x41')]){_0x10a189[_0xc8f2('0x42')]=[{'all':!![]}];}_0x10a189=_[_0xc8f2('0x3a')]({},_0x10a189,_0x556ba0[_0xc8f2('0x40')]);return db[_0xc8f2('0x2c')][_0xc8f2('0x49')](_0x10a189)['then'](handleEntityNotFound(_0x319aaf,null))[_0xc8f2('0x24')](respondWithResult(_0x319aaf,null))['catch'](handleError(_0x319aaf,null));};exports[_0xc8f2('0x4a')]=function(_0x2c746b,_0x913001){return db[_0xc8f2('0x2c')][_0xc8f2('0x4a')](_0x2c746b[_0xc8f2('0x4b')],{})[_0xc8f2('0x24')](respondWithResult(_0x913001,0xc9))[_0xc8f2('0x45')](handleError(_0x913001,null));};exports[_0xc8f2('0x23')]=function(_0x30402b,_0x1b0966){if(_0x30402b[_0xc8f2('0x4b')]['id']){delete _0x30402b[_0xc8f2('0x4b')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x30402b[_0xc8f2('0x47')]['id']}})[_0xc8f2('0x24')](handleEntityNotFound(_0x1b0966,null))[_0xc8f2('0x24')](saveUpdates(_0x30402b[_0xc8f2('0x4b')],null))['then'](respondWithResult(_0x1b0966,null))[_0xc8f2('0x45')](handleError(_0x1b0966,null));};exports[_0xc8f2('0x25')]=function(_0x171376,_0x2b0657){return db['SmsApplication'][_0xc8f2('0x49')]({'where':{'id':_0x171376[_0xc8f2('0x47')]['id']}})[_0xc8f2('0x24')](handleEntityNotFound(_0x2b0657,null))[_0xc8f2('0x24')](removeEntity(_0x2b0657,null))['catch'](handleError(_0x2b0657,null));}; \ No newline at end of file +var _0x9f08=['nolimit','offset','order','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','SmsApplication','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','Content-Range','reject','save','then','destroy','end','error','name','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x9f08,0x17d));var _0x89f0=function(_0x5c16f7,_0x5e4785){_0x5c16f7=_0x5c16f7-0x0;var _0x3d8922=_0x9f08[_0x5c16f7];return _0x3d8922;};'use strict';var pdf=require(_0x89f0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x89f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89f0('0x2'));var rp=require('request-promise');var moment=require(_0x89f0('0x3'));var BPromise=require(_0x89f0('0x4'));var Mustache=require(_0x89f0('0x5'));var util=require('util');var path=require(_0x89f0('0x6'));var sox=require(_0x89f0('0x7'));var csv=require(_0x89f0('0x8'));var ejs=require(_0x89f0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x89f0('0xa'));var crypto=require(_0x89f0('0xb'));var jsforce=require(_0x89f0('0xc'));var deskjs=require(_0x89f0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x89f0('0xe'));var Papa=require(_0x89f0('0xf'));var authService=require(_0x89f0('0x10'));var hardwareService=require(_0x89f0('0x11'));var Redis=require(_0x89f0('0x12'));var qs=require(_0x89f0('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x89f0('0x14'));var db=require(_0x89f0('0x15'))['db'];function respondWithStatusCode(_0x5a2eb8,_0x1bcc3b){_0x1bcc3b=_0x1bcc3b||0xcc;return function(_0x248e16){if(_0x248e16){return _0x5a2eb8[_0x89f0('0x16')](_0x1bcc3b);}return _0x5a2eb8[_0x89f0('0x17')](_0x1bcc3b)['end']();};}function respondWithResult(_0x447766,_0xfc701f){_0xfc701f=_0xfc701f||0xc8;return function(_0x168a96){if(_0x168a96){return _0x447766['status'](_0xfc701f)[_0x89f0('0x18')](_0x168a96);}};}function respondWithFilteredResult(_0x3b8046,_0x2d7ebd){return function(_0x3253a2){if(_0x3253a2){var _0x534f91=_0x3253a2['count'],_0xd436d2=_0x2d7ebd['offset'],_0x7589f5=_0x2d7ebd['offset']+_0x2d7ebd[_0x89f0('0x19')],_0x5e19f0;if(_0x7589f5>=_0x534f91){_0x7589f5=_0x534f91;_0x5e19f0=0xc8;}else{_0x5e19f0=0xce;}_0x3b8046['status'](_0x5e19f0);return _0x3b8046[_0x89f0('0x1a')](_0x89f0('0x1b'),_0xd436d2+'-'+_0x7589f5+'/'+_0x534f91)[_0x89f0('0x18')](_0x3253a2);}return null;};}function patchUpdates(_0x47ba3d){return function(_0x5495a5){try{jsonpatch['apply'](_0x5495a5,_0x47ba3d,!![]);}catch(_0x2ad0fc){return BPromise[_0x89f0('0x1c')](_0x2ad0fc);}return _0x5495a5[_0x89f0('0x1d')]();};}function saveUpdates(_0x477e85,_0x2bc9c0){return function(_0x21c696){if(_0x21c696){return _0x21c696['update'](_0x477e85)[_0x89f0('0x1e')](function(_0x586607){return _0x586607;});}return null;};}function removeEntity(_0x586c7c,_0xd5d291){return function(_0x4be1fb){if(_0x4be1fb){return _0x4be1fb[_0x89f0('0x1f')]()['then'](function(){_0x586c7c['status'](0xcc)[_0x89f0('0x20')]();});}};}function handleEntityNotFound(_0x12448c,_0x476f47){return function(_0x1bf0d1){if(!_0x1bf0d1){_0x12448c[_0x89f0('0x16')](0x194);}return _0x1bf0d1;};}function handleError(_0x4a683f,_0x48a69d){_0x48a69d=_0x48a69d||0x1f4;return function(_0x199784){logger[_0x89f0('0x21')](_0x199784['stack']);if(_0x199784['name']){delete _0x199784[_0x89f0('0x22')];}_0x4a683f[_0x89f0('0x17')](_0x48a69d)[_0x89f0('0x23')](_0x199784);};}exports[_0x89f0('0x24')]=function(_0x497214,_0xffa266){var _0x3908aa={},_0x2b005f={},_0x75b667={'count':0x0,'rows':[]};var _0x4cb10c=db['SmsApplication'][_0x89f0('0x25')];_0x2b005f[_0x89f0('0x26')]=_[_0x89f0('0x27')](_0x4cb10c);_0x2b005f[_0x89f0('0x28')]=_[_0x89f0('0x27')](_0x497214[_0x89f0('0x28')]);_0x2b005f['filters']=_['intersection'](_0x2b005f[_0x89f0('0x26')],_0x2b005f['query']);_0x3908aa[_0x89f0('0x29')]=_[_0x89f0('0x2a')](_0x2b005f[_0x89f0('0x26')],qs[_0x89f0('0x2b')](_0x497214[_0x89f0('0x28')][_0x89f0('0x2b')]));_0x3908aa['attributes']=_0x3908aa[_0x89f0('0x29')]['length']?_0x3908aa['attributes']:_0x2b005f[_0x89f0('0x26')];if(!_0x497214[_0x89f0('0x28')][_0x89f0('0x2c')](_0x89f0('0x2d'))){_0x3908aa[_0x89f0('0x19')]=qs[_0x89f0('0x19')](_0x497214[_0x89f0('0x28')][_0x89f0('0x19')]);_0x3908aa[_0x89f0('0x2e')]=qs['offset'](_0x497214['query']['offset']);}_0x3908aa[_0x89f0('0x2f')]=qs['sort'](_0x497214['query']['sort']);_0x3908aa[_0x89f0('0x30')]=qs[_0x89f0('0x31')](_[_0x89f0('0x32')](_0x497214['query'],_0x2b005f[_0x89f0('0x31')]));if(_0x497214[_0x89f0('0x28')]['filter']){_0x3908aa[_0x89f0('0x30')]=_[_0x89f0('0x33')](_0x3908aa['where'],{'$or':_['map'](_0x4cb10c,function(_0x55ab44){if(_0x55ab44[_0x89f0('0x34')][_0x89f0('0x35')]!==_0x89f0('0x36')){var _0x4e7c48={};_0x4e7c48[_0x55ab44[_0x89f0('0x37')]]={'$like':'%'+_0x497214[_0x89f0('0x28')][_0x89f0('0x38')]+'%'};return _0x4e7c48;}})});}_0x3908aa=_[_0x89f0('0x33')]({},_0x3908aa,_0x497214[_0x89f0('0x39')]);var _0x31a611={'where':_0x3908aa[_0x89f0('0x30')]};return db[_0x89f0('0x3a')][_0x89f0('0x3b')](_0x31a611)[_0x89f0('0x1e')](function(_0x545dc7){_0x75b667[_0x89f0('0x3b')]=_0x545dc7;if(_0x497214[_0x89f0('0x28')][_0x89f0('0x3c')]){_0x3908aa[_0x89f0('0x3d')]=[{'all':!![]}];}return db[_0x89f0('0x3a')][_0x89f0('0x3e')](_0x3908aa);})[_0x89f0('0x1e')](function(_0x4c8e15){_0x75b667[_0x89f0('0x3f')]=_0x4c8e15;return _0x75b667;})[_0x89f0('0x1e')](respondWithFilteredResult(_0xffa266,_0x3908aa))['catch'](handleError(_0xffa266,null));};exports[_0x89f0('0x40')]=function(_0x4b49ea,_0x4033e4){var _0x4e7eb2={'raw':!![],'where':{'id':_0x4b49ea[_0x89f0('0x41')]['id']}},_0x42dd53={};_0x42dd53[_0x89f0('0x26')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x42dd53['query']=_[_0x89f0('0x27')](_0x4b49ea['query']);_0x42dd53[_0x89f0('0x31')]=_[_0x89f0('0x2a')](_0x42dd53[_0x89f0('0x26')],_0x42dd53[_0x89f0('0x28')]);_0x4e7eb2[_0x89f0('0x29')]=_[_0x89f0('0x2a')](_0x42dd53[_0x89f0('0x26')],qs[_0x89f0('0x2b')](_0x4b49ea['query'][_0x89f0('0x2b')]));_0x4e7eb2[_0x89f0('0x29')]=_0x4e7eb2[_0x89f0('0x29')][_0x89f0('0x42')]?_0x4e7eb2['attributes']:_0x42dd53[_0x89f0('0x26')];if(_0x4b49ea['query']['includeAll']){_0x4e7eb2['include']=[{'all':!![]}];}_0x4e7eb2=_[_0x89f0('0x33')]({},_0x4e7eb2,_0x4b49ea[_0x89f0('0x39')]);return db[_0x89f0('0x3a')][_0x89f0('0x43')](_0x4e7eb2)[_0x89f0('0x1e')](handleEntityNotFound(_0x4033e4,null))[_0x89f0('0x1e')](respondWithResult(_0x4033e4,null))[_0x89f0('0x44')](handleError(_0x4033e4,null));};exports['create']=function(_0x526dc9,_0x110e8d){return db[_0x89f0('0x3a')][_0x89f0('0x45')](_0x526dc9[_0x89f0('0x46')],{})['then'](respondWithResult(_0x110e8d,0xc9))[_0x89f0('0x44')](handleError(_0x110e8d,null));};exports['update']=function(_0x705219,_0x487c75){if(_0x705219[_0x89f0('0x46')]['id']){delete _0x705219['body']['id'];}return db[_0x89f0('0x3a')][_0x89f0('0x43')]({'where':{'id':_0x705219['params']['id']}})['then'](handleEntityNotFound(_0x487c75,null))[_0x89f0('0x1e')](saveUpdates(_0x705219[_0x89f0('0x46')],null))[_0x89f0('0x1e')](respondWithResult(_0x487c75,null))[_0x89f0('0x44')](handleError(_0x487c75,null));};exports['destroy']=function(_0x209df3,_0x251b1b){return db['SmsApplication']['find']({'where':{'id':_0x209df3['params']['id']}})[_0x89f0('0x1e')](handleEntityNotFound(_0x251b1b,null))[_0x89f0('0x1e')](removeEntity(_0x251b1b,null))['catch'](handleError(_0x251b1b,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ea52300..7bf6efb 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 _0xda81=['../../config/logger','api','moment','bluebird','./smsApplication.attributes','exports','SmsApplication','lodash','util'];(function(_0x1f7764,_0x5415a7){var _0x1e6e58=function(_0x5959af){while(--_0x5959af){_0x1f7764['push'](_0x1f7764['shift']());}};_0x1e6e58(++_0x5415a7);}(_0xda81,0xa0));var _0x1da8=function(_0x3683e6,_0x26cbdb){_0x3683e6=_0x3683e6-0x0;var _0x1a9c3b=_0xda81[_0x3683e6];return _0x1a9c3b;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var logger=require(_0x1da8('0x2'))(_0x1da8('0x3'));var moment=require(_0x1da8('0x4'));var BPromise=require(_0x1da8('0x5'));var rp=require('request-promise');var attributes=require(_0x1da8('0x6'));module[_0x1da8('0x7')]=function(_0x133733,_0x47f409){return _0x133733['define'](_0x1da8('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e5a=['request-promise','./smsApplication.attributes','exports','sms_applications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dea58,_0x59d6f0){var _0x2b23c2=function(_0x3e5c44){while(--_0x3e5c44){_0x2dea58['push'](_0x2dea58['shift']());}};_0x2b23c2(++_0x59d6f0);}(_0x9e5a,0xcc));var _0xa9e5=function(_0x4e2576,_0x1afef5){_0x4e2576=_0x4e2576-0x0;var _0xa88626=_0x9e5a[_0x4e2576];return _0xa88626;};'use strict';var _=require(_0xa9e5('0x0'));var util=require(_0xa9e5('0x1'));var logger=require(_0xa9e5('0x2'))(_0xa9e5('0x3'));var moment=require(_0xa9e5('0x4'));var BPromise=require(_0xa9e5('0x5'));var rp=require(_0xa9e5('0x6'));var attributes=require(_0xa9e5('0x7'));module[_0xa9e5('0x8')]=function(_0x248715,_0x1872ab){return _0x248715['define']('SmsApplication',attributes,{'tableName':_0xa9e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2b555b7..af11ed7 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 _0x2397=['request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x490f9d,_0x255f0f){var _0x5c88cb=function(_0x306c57){while(--_0x306c57){_0x490f9d['push'](_0x490f9d['shift']());}};_0x5c88cb(++_0x255f0f);}(_0x2397,0x15e));var _0x7239=function(_0x360197,_0x1419c1){_0x360197=_0x360197-0x0;var _0x373e37=_0x2397[_0x360197];return _0x373e37;};'use strict';var _=require(_0x7239('0x0'));var util=require('util');var moment=require(_0x7239('0x1'));var BPromise=require(_0x7239('0x2'));var rs=require(_0x7239('0x3'));var fs=require('fs');var Redis=require(_0x7239('0x4'));var db=require(_0x7239('0x5'))['db'];var utils=require(_0x7239('0x6'));var logger=require('../../config/logger')(_0x7239('0x7'));var config=require('../../config/environment');var jayson=require(_0x7239('0x8'));var client=jayson[_0x7239('0x9')][_0x7239('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x205d49,_0x5c3325,_0x4bf1f3){return new BPromise(function(_0x462174,_0x21b5f1){return client[_0x7239('0xb')](_0x205d49,_0x4bf1f3)[_0x7239('0xc')](function(_0x2f7ade){logger[_0x7239('0xd')](_0x7239('0xe'),_0x5c3325,'request\x20sent');logger['debug'](_0x7239('0xf'),_0x5c3325,_0x7239('0x10'),JSON['stringify'](_0x2f7ade));if(_0x2f7ade['error']){if(_0x2f7ade['error']['code']===0x1f4){logger[_0x7239('0x11')](_0x7239('0xe'),_0x5c3325,_0x2f7ade[_0x7239('0x11')][_0x7239('0x12')]);return _0x21b5f1(_0x2f7ade[_0x7239('0x11')]['message']);}logger[_0x7239('0x11')](_0x7239('0xe'),_0x5c3325,_0x2f7ade[_0x7239('0x11')]['message']);return _0x462174(_0x2f7ade['error'][_0x7239('0x12')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5c3325,_0x7239('0x10'));_0x462174(_0x2f7ade['result']['message']);}})['catch'](function(_0x4734a3){logger[_0x7239('0x11')](_0x7239('0xe'),_0x5c3325,_0x4734a3);_0x21b5f1(_0x4734a3);});});} \ No newline at end of file +var _0x6476=['SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6476,0x1d6));var _0x6647=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x6476[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x6647('0x0'));var util=require(_0x6647('0x1'));var moment=require('moment');var BPromise=require(_0x6647('0x2'));var rs=require(_0x6647('0x3'));var fs=require('fs');var Redis=require(_0x6647('0x4'));var db=require(_0x6647('0x5'))['db'];var utils=require(_0x6647('0x6'));var logger=require(_0x6647('0x7'))('rpc');var config=require(_0x6647('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6647('0x9')][_0x6647('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbb5cad,_0x5c566b,_0x1cdd29){return new BPromise(function(_0x287edf,_0x2ed759){return client[_0x6647('0xb')](_0xbb5cad,_0x1cdd29)[_0x6647('0xc')](function(_0x2b25e9){logger[_0x6647('0xd')](_0x6647('0xe'),_0x5c566b,_0x6647('0xf'));logger['debug'](_0x6647('0x10'),_0x5c566b,_0x6647('0xf'),JSON[_0x6647('0x11')](_0x2b25e9));if(_0x2b25e9[_0x6647('0x12')]){if(_0x2b25e9[_0x6647('0x12')][_0x6647('0x13')]===0x1f4){logger[_0x6647('0x12')](_0x6647('0xe'),_0x5c566b,_0x2b25e9[_0x6647('0x12')][_0x6647('0x14')]);return _0x2ed759(_0x2b25e9['error'][_0x6647('0x14')]);}logger[_0x6647('0x12')](_0x6647('0xe'),_0x5c566b,_0x2b25e9[_0x6647('0x12')][_0x6647('0x14')]);return _0x287edf(_0x2b25e9[_0x6647('0x12')][_0x6647('0x14')]);}else{logger[_0x6647('0xd')]('SmsApplication,\x20%s,\x20%s',_0x5c566b,_0x6647('0xf'));_0x287edf(_0x2b25e9['result'][_0x6647('0x14')]);}})[_0x6647('0x15')](function(_0x540253){logger['error'](_0x6647('0xe'),_0x5c566b,_0x540253);_0x2ed759(_0x540253);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b7da798..7e33fcb 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 _0x1cd3=['download','post','create','addMessage','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x4a8287,_0x188fc4){var _0x57069c=function(_0x538a91){while(--_0x538a91){_0x4a8287['push'](_0x4a8287['shift']());}};_0x57069c(++_0x188fc4);}(_0x1cd3,0x1ee));var _0x31cd=function(_0x95d85f,_0x49e6eb){_0x95d85f=_0x95d85f-0x0;var _0x3340bb=_0x1cd3[_0x95d85f];return _0x3340bb;};'use strict';var multer=require(_0x31cd('0x0'));var util=require(_0x31cd('0x1'));var path=require('path');var timeout=require(_0x31cd('0x2'));var express=require(_0x31cd('0x3'));var router=express[_0x31cd('0x4')]();var auth=require(_0x31cd('0x5'));var interaction=require(_0x31cd('0x6'));var config=require('../../config/environment');var controller=require(_0x31cd('0x7'));router[_0x31cd('0x8')]('/',auth[_0x31cd('0x9')](),controller[_0x31cd('0xa')]);router['get'](_0x31cd('0xb'),auth['isAuthenticated'](),controller[_0x31cd('0xc')]);router[_0x31cd('0x8')](_0x31cd('0xd'),auth[_0x31cd('0x9')](),controller[_0x31cd('0xe')]);router[_0x31cd('0x8')](_0x31cd('0xf'),auth[_0x31cd('0x9')](),controller[_0x31cd('0x10')]);router[_0x31cd('0x8')](_0x31cd('0x11'),auth[_0x31cd('0x9')](),controller[_0x31cd('0x12')]);router[_0x31cd('0x13')]('/',auth[_0x31cd('0x9')](),controller[_0x31cd('0x14')]);router[_0x31cd('0x13')](_0x31cd('0xf'),auth[_0x31cd('0x9')](),controller[_0x31cd('0x15')]);router[_0x31cd('0x13')]('/:id/tags',auth[_0x31cd('0x9')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x31cd('0x16')]);router[_0x31cd('0x17')]('/:id',auth[_0x31cd('0x9')](),interaction[_0x31cd('0x18')](_0x31cd('0x19'),_0x31cd('0x1a')),controller[_0x31cd('0x1b')]);router[_0x31cd('0x1c')](_0x31cd('0xd'),auth[_0x31cd('0x9')](),interaction[_0x31cd('0x18')]('sms',_0x31cd('0x1d')),controller[_0x31cd('0x1e')]);router[_0x31cd('0x1c')]('/:id/tags',auth[_0x31cd('0x9')](),controller[_0x31cd('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x004a=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1e8352,_0x2eea37){var _0x276929=function(_0x594bba){while(--_0x594bba){_0x1e8352['push'](_0x1e8352['shift']());}};_0x276929(++_0x2eea37);}(_0x004a,0x7e));var _0xa004=function(_0x163838,_0x58a700){_0x163838=_0x163838-0x0;var _0xe51f37=_0x004a[_0x163838];return _0xe51f37;};'use strict';var multer=require(_0xa004('0x0'));var util=require(_0xa004('0x1'));var path=require('path');var timeout=require(_0xa004('0x2'));var express=require(_0xa004('0x3'));var router=express[_0xa004('0x4')]();var auth=require(_0xa004('0x5'));var interaction=require(_0xa004('0x6'));var config=require(_0xa004('0x7'));var controller=require('./smsInteraction.controller');router[_0xa004('0x8')]('/',auth[_0xa004('0x9')](),controller[_0xa004('0xa')]);router['get'](_0xa004('0xb'),auth[_0xa004('0x9')](),controller[_0xa004('0xc')]);router[_0xa004('0x8')](_0xa004('0xd'),auth[_0xa004('0x9')](),controller[_0xa004('0xe')]);router[_0xa004('0x8')](_0xa004('0xf'),auth[_0xa004('0x9')](),controller[_0xa004('0x10')]);router[_0xa004('0x8')](_0xa004('0x11'),auth[_0xa004('0x9')](),controller[_0xa004('0x12')]);router[_0xa004('0x13')]('/',auth[_0xa004('0x9')](),controller['create']);router[_0xa004('0x13')](_0xa004('0xf'),auth[_0xa004('0x9')](),controller[_0xa004('0x14')]);router[_0xa004('0x13')]('/:id/tags',auth[_0xa004('0x9')](),interaction[_0xa004('0x15')](_0xa004('0x16'),_0xa004('0x17')),controller[_0xa004('0x18')]);router[_0xa004('0x19')]('/:id',auth[_0xa004('0x9')](),interaction[_0xa004('0x15')]('sms',_0xa004('0x1a')),controller[_0xa004('0x1b')]);router['delete'](_0xa004('0xd'),auth[_0xa004('0x9')](),interaction['tracked'](_0xa004('0x16'),_0xa004('0x1c')),controller[_0xa004('0x1d')]);router[_0xa004('0x1e')](_0xa004('0x1f'),auth[_0xa004('0x9')](),controller[_0xa004('0x20')]);module[_0xa004('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ac2c618..9ef197b 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 _0x51b4=['sequelize','exports','BOOLEAN','DATE','STRING','out','ENUM'];(function(_0x19544b,_0x2ba758){var _0x1453c0=function(_0x281cb6){while(--_0x281cb6){_0x19544b['push'](_0x19544b['shift']());}};_0x1453c0(++_0x2ba758);}(_0x51b4,0x103));var _0x451b=function(_0xb51174,_0x54c5cf){_0xb51174=_0xb51174-0x0;var _0x3da729=_0x51b4[_0xb51174];return _0x3da729;};'use strict';var Sequelize=require(_0x451b('0x0'));var moment=require('moment');module[_0x451b('0x1')]={'closed':{'type':Sequelize[_0x451b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x451b('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x451b('0x4')]},'read1stAt':{'type':Sequelize[_0x451b('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x451b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x451b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x451b('0x6')]('in',_0x451b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6d00=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6d00,0x1a7));var _0x06d0=function(_0x277563,_0x566184){_0x277563=_0x277563-0x0;var _0xc114d5=_0x6d00[_0x277563];return _0xc114d5;};'use strict';var Sequelize=require(_0x06d0('0x0'));var moment=require('moment');module[_0x06d0('0x1')]={'closed':{'type':Sequelize[_0x06d0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06d0('0x3')]},'disposition':{'type':Sequelize[_0x06d0('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x06d0('0x4')]},'read1stAt':{'type':Sequelize[_0x06d0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x06d0('0x5')]('in',_0x06d0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x06d0('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06d0('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 680d0fb..14c66fe 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 _0x8cce=['reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','field','include','tag','push','Tags','distinct','read','SmsMessage','direction','createdAt','SmsInteraction','count','includeAll','User','fullname','CmContact','Contact','Owner','internal','SmsAccount','Account','color','Tag','rows','catch','params','attributes','length','options','create','body','find','describe','addMessage','omit','getMessages','findOne','pick','SmsInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','ids','spread','findAll','emit','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','interaction-%s.zip','Messages','1cm','mkdirSync','

Sms\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','%s:\x20%s

','firstName','toFile','interaction-','log','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','status','offset','limit','set','Content-Range','json'];(function(_0x3d2b2a,_0x185d34){var _0xc586dd=function(_0x42b31a){while(--_0x42b31a){_0x3d2b2a['push'](_0x3d2b2a['shift']());}};_0xc586dd(++_0x185d34);}(_0x8cce,0xee));var _0xe8cc=function(_0x5b4dff,_0x4ba8ec){_0x5b4dff=_0x5b4dff-0x0;var _0xeff671=_0x8cce[_0x5b4dff];return _0xeff671;};'use strict';var pdf=require(_0xe8cc('0x0'));var emlformat=require(_0xe8cc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe8cc('0x2'));var rp=require(_0xe8cc('0x3'));var moment=require(_0xe8cc('0x4'));var BPromise=require(_0xe8cc('0x5'));var Mustache=require(_0xe8cc('0x6'));var util=require(_0xe8cc('0x7'));var path=require(_0xe8cc('0x8'));var sox=require(_0xe8cc('0x9'));var csv=require(_0xe8cc('0xa'));var ejs=require(_0xe8cc('0xb'));var fs=require('fs');var _=require(_0xe8cc('0xc'));var squel=require(_0xe8cc('0xd'));var crypto=require(_0xe8cc('0xe'));var jsforce=require(_0xe8cc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8cc('0x10'));var Papa=require(_0xe8cc('0x11'));var authService=require(_0xe8cc('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe8cc('0x13'));var qs=require(_0xe8cc('0x14'));var logger=require('../../config/logger')(_0xe8cc('0x15'));var utils=require(_0xe8cc('0x16'));var config=require(_0xe8cc('0x17'));var db=require(_0xe8cc('0x18'))['db'];config[_0xe8cc('0x19')]=_['defaults'](config[_0xe8cc('0x19')],{'host':_0xe8cc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8cc('0x19')]));require('./smsInteraction.socket')[_0xe8cc('0x1b')](socket);function respondWithStatusCode(_0x2498af,_0x24e1dd){_0x24e1dd=_0x24e1dd||0xcc;return function(_0x5a03dc){if(_0x5a03dc){return _0x2498af[_0xe8cc('0x1c')](_0x24e1dd);}return _0x2498af['status'](_0x24e1dd)[_0xe8cc('0x1d')]();};}function respondWithResult(_0x56b81a,_0x3fd8ff){_0x3fd8ff=_0x3fd8ff||0xc8;return function(_0x2891df){if(_0x2891df){return _0x56b81a[_0xe8cc('0x1e')](_0x3fd8ff)['json'](_0x2891df);}};}function respondWithFilteredResult(_0x52714c,_0x11f63e){return function(_0x525af8){if(_0x525af8){var _0x6da460=_0x525af8['count'],_0x241b9e=_0x11f63e[_0xe8cc('0x1f')],_0x3c00d7=_0x11f63e[_0xe8cc('0x1f')]+_0x11f63e[_0xe8cc('0x20')],_0x2a035b;if(_0x3c00d7>=_0x6da460){_0x3c00d7=_0x6da460;_0x2a035b=0xc8;}else{_0x2a035b=0xce;}_0x52714c['status'](_0x2a035b);return _0x52714c[_0xe8cc('0x21')](_0xe8cc('0x22'),_0x241b9e+'-'+_0x3c00d7+'/'+_0x6da460)[_0xe8cc('0x23')](_0x525af8);}return null;};}function patchUpdates(_0x2141c6){return function(_0x372f9a){try{jsonpatch['apply'](_0x372f9a,_0x2141c6,!![]);}catch(_0x293f08){return BPromise[_0xe8cc('0x24')](_0x293f08);}return _0x372f9a[_0xe8cc('0x25')]();};}function saveUpdates(_0xf3d012,_0x4d9984){return function(_0x172f6c){if(_0x172f6c){return _0x172f6c[_0xe8cc('0x26')](_0xf3d012)[_0xe8cc('0x27')](function(_0xa10444){return _0xa10444;});}return null;};}function removeEntity(_0x47eeb7,_0x28e454){return function(_0x1e47d1){if(_0x1e47d1){return _0x1e47d1[_0xe8cc('0x28')]()[_0xe8cc('0x27')](function(){_0x47eeb7[_0xe8cc('0x1e')](0xcc)[_0xe8cc('0x1d')]();});}};}function handleEntityNotFound(_0x42e8e3,_0x51aae7){return function(_0x37bac5){if(!_0x37bac5){_0x42e8e3[_0xe8cc('0x1c')](0x194);}return _0x37bac5;};}function handleError(_0x46dce9,_0x501db1){_0x501db1=_0x501db1||0x1f4;return function(_0x389a9d){logger[_0xe8cc('0x29')](_0x389a9d[_0xe8cc('0x2a')]);if(_0x389a9d[_0xe8cc('0x2b')]){delete _0x389a9d[_0xe8cc('0x2b')];}_0x46dce9[_0xe8cc('0x1e')](_0x501db1)[_0xe8cc('0x2c')](_0x389a9d);};}exports[_0xe8cc('0x2d')]=function(_0x168f44,_0x25ec44){var _0x456bd0={},_0x4532df={},_0x5318d1={'count':0x0,'rows':[]};var _0x25fa77=db['SmsInteraction'][_0xe8cc('0x2e')];_0x4532df[_0xe8cc('0x2f')]=_[_0xe8cc('0x30')](_0x25fa77);_0x4532df['query']=_[_0xe8cc('0x30')](_0x168f44[_0xe8cc('0x31')]);_0x4532df['filters']=_[_0xe8cc('0x32')](_0x4532df[_0xe8cc('0x2f')],_0x4532df[_0xe8cc('0x31')]);_0x456bd0['attributes']=_[_0xe8cc('0x32')](_0x4532df[_0xe8cc('0x2f')],qs[_0xe8cc('0x33')](_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x33')]));_0x456bd0['attributes']=_0x456bd0['attributes']['length']?_0x456bd0['attributes']:_0x4532df[_0xe8cc('0x2f')];if(!_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x34')](_0xe8cc('0x35'))){_0x456bd0['limit']=qs[_0xe8cc('0x20')](_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x20')]);_0x456bd0[_0xe8cc('0x1f')]=qs[_0xe8cc('0x1f')](_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x1f')]);}_0x456bd0[_0xe8cc('0x36')]=qs[_0xe8cc('0x37')](_0x168f44['query'][_0xe8cc('0x37')]);_0x456bd0[_0xe8cc('0x38')]=qs[_0xe8cc('0x39')](_['pick'](_0x168f44[_0xe8cc('0x31')],_0x4532df['filters']));if(_0x168f44['query'][_0xe8cc('0x3a')]){_0x456bd0['where']=_[_0xe8cc('0x3b')](_0x456bd0[_0xe8cc('0x38')],{'$or':_[_0xe8cc('0x3c')](_0x25fa77,function(_0x281ef6){if(_0x281ef6[_0xe8cc('0x3d')][_0xe8cc('0x3e')]!=='VIRTUAL'){var _0x5f5736={};_0x5f5736[_0x281ef6[_0xe8cc('0x3f')]]={'$like':'%'+_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x3a')]+'%'};return _0x5f5736;}})});}_0x456bd0=_['merge']({},_0x456bd0,_0x168f44['options']);var _0x231be7={'where':_0x456bd0[_0xe8cc('0x38')]};_0x231be7[_0xe8cc('0x40')]=[];if(_0x168f44['query'][_0xe8cc('0x41')]){_0x231be7['include'][_0xe8cc('0x42')]({'model':db['Tag'],'as':_0xe8cc('0x43'),'attributes':['id'],'where':{'id':_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x41')]},'required':!![]});_0x231be7[_0xe8cc('0x44')]=!![];}if(_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x45')]){_0x231be7[_0xe8cc('0x40')][_0xe8cc('0x42')]({'model':db[_0xe8cc('0x46')],'as':'Messages','attributes':['id',_0xe8cc('0x47'),_0xe8cc('0x48'),_0xe8cc('0x45')],'where':{'direction':'in','read':_0x168f44['query']['read']||![]},'required':!![]});_0x231be7[_0xe8cc('0x44')]=!![];}return db[_0xe8cc('0x49')]['count'](_0x231be7)['then'](function(_0x185975){_0x5318d1[_0xe8cc('0x4a')]=_0x185975;if(_0x168f44['query'][_0xe8cc('0x4b')]){_0x456bd0[_0xe8cc('0x40')]=[{'model':db[_0xe8cc('0x4c')],'as':'Users','required':![],'attributes':['id',_0xe8cc('0x2b'),_0xe8cc('0x4d')]},{'model':db[_0xe8cc('0x4e')],'as':_0xe8cc('0x4f'),'required':![]},{'model':db[_0xe8cc('0x4c')],'as':_0xe8cc('0x50'),'attributes':[_0xe8cc('0x2b'),'fullname',_0xe8cc('0x51')],'required':![]},{'model':db[_0xe8cc('0x52')],'as':_0xe8cc('0x53'),'attributes':['name',_0xe8cc('0x3e')],'required':![]},{'model':db[_0xe8cc('0x46')],'as':'Messages','attributes':['id',_0xe8cc('0x47'),_0xe8cc('0x48'),_0xe8cc('0x45')],'where':{'direction':'in','read':_0x168f44[_0xe8cc('0x31')]['read']||![]},'required':_0x168f44['query'][_0xe8cc('0x45')]||![]},{'model':db['Tag'],'as':_0xe8cc('0x43'),'attributes':['id',_0xe8cc('0x2b'),_0xe8cc('0x54')],'required':_0x168f44[_0xe8cc('0x31')]['tag']?!![]:![]},{'model':db[_0xe8cc('0x55')],'as':'ThroughTags','attributes':['id',_0xe8cc('0x2b'),_0xe8cc('0x54')],'through':_0x168f44[_0xe8cc('0x31')][_0xe8cc('0x41')]?{'attributes':[],'where':{'TagId':_0x168f44[_0xe8cc('0x31')]['tag']||undefined}}:{},'required':_0x168f44['query'][_0xe8cc('0x41')]?!![]:![]}];}return db[_0xe8cc('0x49')]['findAll'](_0x456bd0);})['then'](function(_0xdc9cb){_0x5318d1[_0xe8cc('0x56')]=_0xdc9cb;return _0x5318d1;})[_0xe8cc('0x27')](respondWithFilteredResult(_0x25ec44,_0x456bd0))[_0xe8cc('0x57')](handleError(_0x25ec44,null));};exports['show']=function(_0x6d653e,_0x3a6180){var _0x3e8598={'raw':![],'where':{'id':_0x6d653e[_0xe8cc('0x58')]['id']}},_0x250241={};_0x250241[_0xe8cc('0x2f')]=_[_0xe8cc('0x30')](db[_0xe8cc('0x49')][_0xe8cc('0x2e')]);_0x250241[_0xe8cc('0x31')]=_[_0xe8cc('0x30')](_0x6d653e[_0xe8cc('0x31')]);_0x250241['filters']=_['intersection'](_0x250241[_0xe8cc('0x2f')],_0x250241[_0xe8cc('0x31')]);_0x3e8598[_0xe8cc('0x59')]=_['intersection'](_0x250241[_0xe8cc('0x2f')],qs['fields'](_0x6d653e[_0xe8cc('0x31')]['fields']));_0x3e8598[_0xe8cc('0x59')]=_0x3e8598[_0xe8cc('0x59')][_0xe8cc('0x5a')]?_0x3e8598[_0xe8cc('0x59')]:_0x250241[_0xe8cc('0x2f')];if(_0x6d653e['query']['includeAll']){_0x3e8598[_0xe8cc('0x40')]=[{'all':!![]}];}_0x3e8598=_[_0xe8cc('0x3b')]({},_0x3e8598,_0x6d653e[_0xe8cc('0x5b')]);return db['SmsInteraction']['find'](_0x3e8598)[_0xe8cc('0x27')](handleEntityNotFound(_0x3a6180,null))[_0xe8cc('0x27')](respondWithResult(_0x3a6180,null))['catch'](handleError(_0x3a6180,null));};exports[_0xe8cc('0x5c')]=function(_0x860740,_0x14211f){return db[_0xe8cc('0x49')][_0xe8cc('0x5c')](_0x860740[_0xe8cc('0x5d')],{})['then'](respondWithResult(_0x14211f,0xc9))[_0xe8cc('0x57')](handleError(_0x14211f,null));};exports[_0xe8cc('0x26')]=function(_0xe86cbc,_0x482118){if(_0xe86cbc[_0xe8cc('0x5d')]['id']){delete _0xe86cbc[_0xe8cc('0x5d')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0xe86cbc[_0xe8cc('0x58')]['id']}})['then'](handleEntityNotFound(_0x482118,null))['then'](saveUpdates(_0xe86cbc['body'],null))[_0xe8cc('0x27')](respondWithResult(_0x482118,null))[_0xe8cc('0x57')](handleError(_0x482118,null));};exports[_0xe8cc('0x28')]=function(_0x549669,_0x25afb6){return db['SmsInteraction'][_0xe8cc('0x5e')]({'where':{'id':_0x549669[_0xe8cc('0x58')]['id']}})[_0xe8cc('0x27')](handleEntityNotFound(_0x25afb6,null))['then'](removeEntity(_0x25afb6,null))['catch'](handleError(_0x25afb6,null));};exports[_0xe8cc('0x5f')]=function(_0x532f45,_0x495172){return db[_0xe8cc('0x49')]['describe']()[_0xe8cc('0x27')](respondWithResult(_0x495172,null))[_0xe8cc('0x57')](handleError(_0x495172,null));};exports[_0xe8cc('0x60')]=function(_0x25ab97,_0x29afa0,_0x21f85e){return db[_0xe8cc('0x46')][_0xe8cc('0x5e')]({'where':{'id':_0x25ab97['params']['id']}})[_0xe8cc('0x27')](handleEntityNotFound(_0x29afa0,null))[_0xe8cc('0x27')](function(_0x47da50){if(_0x47da50){return _0x47da50[_0xe8cc('0x60')](_0x25ab97[_0xe8cc('0x5d')]['ids'],_[_0xe8cc('0x61')](_0x25ab97['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x29afa0,null))['catch'](handleError(_0x29afa0,null));};exports[_0xe8cc('0x62')]=function(_0x565ad9,_0x12f874,_0x39e7fb){var _0x387e5f={'raw':![],'where':{}};var _0x1a7094={};var _0x4bec30={'count':0x0,'rows':[]};return db[_0xe8cc('0x49')][_0xe8cc('0x63')]({'where':{'id':_0x565ad9[_0xe8cc('0x58')]['id']}})[_0xe8cc('0x27')](handleEntityNotFound(_0x12f874,null))[_0xe8cc('0x27')](function(_0x4bdaf9){if(_0x4bdaf9){_0x1a7094[_0xe8cc('0x2f')]=_[_0xe8cc('0x30')](db[_0xe8cc('0x46')][_0xe8cc('0x2e')]);_0x1a7094['query']=_[_0xe8cc('0x30')](_0x565ad9[_0xe8cc('0x31')]);_0x1a7094[_0xe8cc('0x39')]=_[_0xe8cc('0x32')](_0x1a7094[_0xe8cc('0x2f')],_0x1a7094[_0xe8cc('0x31')]);_0x387e5f[_0xe8cc('0x59')]=_[_0xe8cc('0x32')](_0x1a7094[_0xe8cc('0x2f')],qs['fields'](_0x565ad9['query'][_0xe8cc('0x33')]));_0x387e5f[_0xe8cc('0x59')]=_0x387e5f['attributes'][_0xe8cc('0x5a')]?_0x387e5f[_0xe8cc('0x59')]:_0x1a7094[_0xe8cc('0x2f')];if(!_0x565ad9['query'][_0xe8cc('0x34')](_0xe8cc('0x35'))){_0x387e5f[_0xe8cc('0x20')]=qs[_0xe8cc('0x20')](_0x565ad9['query'][_0xe8cc('0x20')]);_0x387e5f[_0xe8cc('0x1f')]=qs[_0xe8cc('0x1f')](_0x565ad9['query'][_0xe8cc('0x1f')]);}_0x387e5f[_0xe8cc('0x36')]=qs['sort'](_0x565ad9['query'][_0xe8cc('0x37')]);_0x387e5f[_0xe8cc('0x38')]=qs[_0xe8cc('0x39')](_[_0xe8cc('0x64')](_0x565ad9[_0xe8cc('0x31')],_0x1a7094['filters']));_0x387e5f[_0xe8cc('0x38')][_0xe8cc('0x65')]=_0x4bdaf9['id'];if(_0x565ad9[_0xe8cc('0x31')][_0xe8cc('0x3a')]){_0x387e5f[_0xe8cc('0x38')]=_['merge'](_0x387e5f[_0xe8cc('0x38')],{'$or':_['map'](_0x387e5f[_0xe8cc('0x59')],function(_0x43664a){var _0x57ff2c={};_0x57ff2c[_0x43664a]={'$like':'%'+_0x565ad9[_0xe8cc('0x31')]['filter']+'%'};return _0x57ff2c;})});}if(_0x565ad9[_0xe8cc('0x31')][_0xe8cc('0x66')]){var _0x3b3f72=_0x565ad9[_0xe8cc('0x31')]['$gte'][_0xe8cc('0x67')](',');var _0x24353e={};_0x24353e[_0x3b3f72[0x0]]={'$gte':moment(_0x3b3f72[0x1])[_0xe8cc('0x68')](_0xe8cc('0x69'))};_0x387e5f[_0xe8cc('0x38')]=_['merge'](_0x387e5f[_0xe8cc('0x38')],_0x24353e);}_0x387e5f=_['merge']({},_0x387e5f,_0x565ad9[_0xe8cc('0x5b')]);return db[_0xe8cc('0x46')][_0xe8cc('0x4a')]({'where':_0x387e5f[_0xe8cc('0x38')]})['then'](function(_0x383c9d){_0x4bec30[_0xe8cc('0x4a')]=_0x383c9d;if(_0x565ad9[_0xe8cc('0x31')][_0xe8cc('0x4b')]){_0x387e5f[_0xe8cc('0x40')]=[{'all':!![]}];}return db[_0xe8cc('0x46')]['findAll'](_0x387e5f);})[_0xe8cc('0x27')](function(_0x463cd7){_0x4bec30[_0xe8cc('0x56')]=_0x463cd7;return _0x4bec30;});}})[_0xe8cc('0x27')](respondWithFilteredResult(_0x12f874,_0x387e5f))[_0xe8cc('0x57')](handleError(_0x12f874,null));};exports[_0xe8cc('0x6a')]=function(_0x4e4f56,_0x45680b,_0x446275){return db[_0xe8cc('0x49')]['find']({'where':{'id':_0x4e4f56['params']['id']}})[_0xe8cc('0x27')](handleEntityNotFound(_0x45680b,null))[_0xe8cc('0x27')](function(_0x59baf4){if(_0x59baf4){return _0x59baf4[_0xe8cc('0x6b')](_0x4e4f56[_0xe8cc('0x5d')][_0xe8cc('0x6c')],_[_0xe8cc('0x61')](_0x4e4f56['body'],['ids','id'])||{})[_0xe8cc('0x6d')](function(){return db[_0xe8cc('0x55')][_0xe8cc('0x6e')]({'attributes':['id','name',_0xe8cc('0x54')],'where':{'id':_0x4e4f56['body'][_0xe8cc('0x6c')]}});})['then'](function(_0x521ea4){socket[_0xe8cc('0x6f')]('smsInteractionTags:save',{'id':Number(_0x4e4f56['params']['id']),'tags':_0x521ea4||[]});return{'id':Number(_0x4e4f56['params']['id']),'tags':_0x521ea4||[]};});}})[_0xe8cc('0x27')](respondWithResult(_0x45680b,null))[_0xe8cc('0x57')](handleError(_0x45680b,null));};exports[_0xe8cc('0x70')]=function(_0x2e4c97,_0x4ebba2,_0x2dabed){var _0x42d29d;return db[_0xe8cc('0x49')][_0xe8cc('0x5e')]({'where':{'id':_0x2e4c97[_0xe8cc('0x58')]['id']}})[_0xe8cc('0x27')](handleEntityNotFound(_0x4ebba2,null))[_0xe8cc('0x27')](function(_0x3274e3){if(_0x3274e3){return _0x3274e3[_0xe8cc('0x70')](_0x2e4c97['query'][_0xe8cc('0x6c')]);}})[_0xe8cc('0x27')](respondWithStatusCode(_0x4ebba2,null))[_0xe8cc('0x57')](handleError(_0x4ebba2,null));};exports[_0xe8cc('0x71')]=function(_0x5c3235,_0x3f4df7){var _0x3ca75b=moment()[_0xe8cc('0x72')]()[_0xe8cc('0x73')]();var _0x299954=path[_0xe8cc('0x74')](config[_0xe8cc('0x75')],_0xe8cc('0x76'),'files',_0xe8cc('0x77'));var _0x4192e1=path['join'](config[_0xe8cc('0x75')],_0xe8cc('0x76'),_0xe8cc('0x78'),_0xe8cc('0x79'));var _0xffb0ee=path['join'](_0x299954,_0x3ca75b);var _0x37bbb0=util[_0xe8cc('0x68')](_0xe8cc('0x7a'),_0x3ca75b);var _0x5d8876=path[_0xe8cc('0x74')](_0x299954,_0x37bbb0);var _0x1035fd=![];return db[_0xe8cc('0x49')][_0xe8cc('0x5e')]({'where':{'id':_0x5c3235[_0xe8cc('0x58')]['id']},'include':[{'model':db[_0xe8cc('0x46')],'as':_0xe8cc('0x7b'),'attributes':['id','body'],'include':[{'model':db[_0xe8cc('0x4c')],'as':_0xe8cc('0x4c'),'attributes':['id',_0xe8cc('0x4d')],'raw':!![]},{'model':db[_0xe8cc('0x4e')],'as':'Contact','attributes':['id','firstName'],'raw':!![]}]}]})[_0xe8cc('0x27')](handleEntityNotFound(_0x3f4df7,null))[_0xe8cc('0x27')](function(_0x241324){if(_0x241324){_0x1035fd=!![];var _0x27e9d5='';var _0x50e953={'format':'Letter','border':_0xe8cc('0x7c')};fs[_0xe8cc('0x7d')](_0xffb0ee);_0x27e9d5+=util[_0xe8cc('0x68')](_0xe8cc('0x7e'),_0x241324['id']);_0x27e9d5+=util[_0xe8cc('0x68')](_0xe8cc('0x7f'),moment()[_0xe8cc('0x68')](_0xe8cc('0x80'))[_0xe8cc('0x73')]());_0x27e9d5+=_0xe8cc('0x81');for(var _0x3d1941=0x0;_0x3d1941<_0x241324[_0xe8cc('0x7b')][_0xe8cc('0x5a')];_0x3d1941++){var _0x81d6bf=_0x241324[_0xe8cc('0x7b')][_0x3d1941];_0x27e9d5+=_0xe8cc('0x82');_0x27e9d5+=util['format'](_0xe8cc('0x83'),_0x81d6bf[_0xe8cc('0x4c')]?_0x81d6bf['User'][_0xe8cc('0x4d')]:_0x81d6bf[_0xe8cc('0x4f')][_0xe8cc('0x84')],_0x81d6bf[_0xe8cc('0x5d')]);_0x27e9d5+='';}return new BPromise(function(_0x29388a,_0x586b02){pdf[_0xe8cc('0x5c')](_0x27e9d5,_0x50e953)[_0xe8cc('0x85')](path[_0xe8cc('0x74')](_0xffb0ee,_0xe8cc('0x86')+_0x3ca75b+'.pdf'),function(_0x44cf19,_0x3959cd){if(_0x44cf19)return _0x586b02(_0x44cf19);_0x29388a(_0x3959cd);});});}})[_0xe8cc('0x27')](function(){if(_0x1035fd){return new BPromise(function(_0x3c4c50,_0x1f3fe2){zipdir(_0xffb0ee,{'saveTo':_0x5d8876},function(_0x3a79e4,_0x2e93ea){if(_0x3a79e4)return _0x1f3fe2(_0x3a79e4);return _0x3c4c50(_0x2e93ea);});});}})[_0xe8cc('0x27')](function(){if(_0x1035fd){return new BPromise(function(_0x2c21a3,_0xd94c10){rimraf(_0xffb0ee,function(_0x5bdb6a){if(_0x5bdb6a)_0xd94c10(_0x5bdb6a);return _0x2c21a3();});});}})[_0xe8cc('0x27')](function(){if(_0x1035fd){return _0x3f4df7['download'](_0x5d8876,_0x37bbb0,function(_0x773d10){if(_0x773d10){console[_0xe8cc('0x87')]('err',_0x773d10);}else{fs[_0xe8cc('0x88')](_0x5d8876);}});}else{return _0x3f4df7[_0xe8cc('0x1c')](0xc8);}})[_0xe8cc('0x57')](handleError(_0x3f4df7,null));}; \ No newline at end of file +var _0x7025=['YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','interaction-%s.zip','firstName','Letter','1cm','

Sms\x20Interaction:\x20#%d

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','%s:\x20%s

','','toFile','interaction-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','include','tag','push','Tag','Tags','distinct','read','direction','SmsInteraction','User','CmContact','Contact','Owner','fullname','internal','SmsAccount','Account','SmsMessage','Messages','createdAt','color','ThroughTags','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','pick','SmsInteractionId','$gte','split','format'];(function(_0x58ea5e,_0x42eed1){var _0x2a43f8=function(_0x5ba3f5){while(--_0x5ba3f5){_0x58ea5e['push'](_0x58ea5e['shift']());}};_0x2a43f8(++_0x42eed1);}(_0x7025,0x132));var _0x5702=function(_0x32980d,_0x406d38){_0x32980d=_0x32980d-0x0;var _0x2642e5=_0x7025[_0x32980d];return _0x2642e5;};'use strict';var pdf=require(_0x5702('0x0'));var emlformat=require(_0x5702('0x1'));var rimraf=require(_0x5702('0x2'));var zipdir=require(_0x5702('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5702('0x4'));var moment=require('moment');var BPromise=require(_0x5702('0x5'));var Mustache=require(_0x5702('0x6'));var util=require(_0x5702('0x7'));var path=require(_0x5702('0x8'));var sox=require(_0x5702('0x9'));var csv=require(_0x5702('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5702('0xb'));var crypto=require(_0x5702('0xc'));var jsforce=require(_0x5702('0xd'));var deskjs=require(_0x5702('0xe'));var toCsv=require(_0x5702('0xa'));var querystring=require(_0x5702('0xf'));var Papa=require(_0x5702('0x10'));var authService=require(_0x5702('0x11'));var hardwareService=require(_0x5702('0x12'));var Redis=require(_0x5702('0x13'));var qs=require(_0x5702('0x14'));var logger=require(_0x5702('0x15'))(_0x5702('0x16'));var utils=require(_0x5702('0x17'));var config=require(_0x5702('0x18'));var db=require(_0x5702('0x19'))['db'];config['redis']=_['defaults'](config[_0x5702('0x1a')],{'host':_0x5702('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5702('0x1a')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1df071,_0x57454b){_0x57454b=_0x57454b||0xcc;return function(_0x2ed57d){if(_0x2ed57d){return _0x1df071[_0x5702('0x1c')](_0x57454b);}return _0x1df071[_0x5702('0x1d')](_0x57454b)[_0x5702('0x1e')]();};}function respondWithResult(_0x19e0b4,_0x2a683d){_0x2a683d=_0x2a683d||0xc8;return function(_0xd48561){if(_0xd48561){return _0x19e0b4[_0x5702('0x1d')](_0x2a683d)['json'](_0xd48561);}};}function respondWithFilteredResult(_0x3b76d4,_0xd35e9){return function(_0x549922){if(_0x549922){var _0x488699=_0x549922[_0x5702('0x1f')],_0xbd9442=_0xd35e9[_0x5702('0x20')],_0x3c1865=_0xd35e9['offset']+_0xd35e9['limit'],_0xfc6e6;if(_0x3c1865>=_0x488699){_0x3c1865=_0x488699;_0xfc6e6=0xc8;}else{_0xfc6e6=0xce;}_0x3b76d4[_0x5702('0x1d')](_0xfc6e6);return _0x3b76d4[_0x5702('0x21')](_0x5702('0x22'),_0xbd9442+'-'+_0x3c1865+'/'+_0x488699)['json'](_0x549922);}return null;};}function patchUpdates(_0x42e532){return function(_0x2193b5){try{jsonpatch[_0x5702('0x23')](_0x2193b5,_0x42e532,!![]);}catch(_0x2c2de7){return BPromise[_0x5702('0x24')](_0x2c2de7);}return _0x2193b5['save']();};}function saveUpdates(_0x2c6c1e,_0x216cd9){return function(_0x44839e){if(_0x44839e){return _0x44839e[_0x5702('0x25')](_0x2c6c1e)[_0x5702('0x26')](function(_0x12dbfd){return _0x12dbfd;});}return null;};}function removeEntity(_0x1eb37d,_0x395424){return function(_0x7c6770){if(_0x7c6770){return _0x7c6770[_0x5702('0x27')]()[_0x5702('0x26')](function(){_0x1eb37d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6eaf9,_0x26c5c6){return function(_0x75044e){if(!_0x75044e){_0xc6eaf9[_0x5702('0x1c')](0x194);}return _0x75044e;};}function handleError(_0x6091ce,_0xc4a251){_0xc4a251=_0xc4a251||0x1f4;return function(_0x29a973){logger[_0x5702('0x28')](_0x29a973['stack']);if(_0x29a973[_0x5702('0x29')]){delete _0x29a973[_0x5702('0x29')];}_0x6091ce[_0x5702('0x1d')](_0xc4a251)['send'](_0x29a973);};}exports[_0x5702('0x2a')]=function(_0x1b3b14,_0x3b7a8b){var _0x54319c={},_0x2dac4a={},_0x317a3f={'count':0x0,'rows':[]};var _0x324357=db['SmsInteraction'][_0x5702('0x2b')];_0x2dac4a['model']=_[_0x5702('0x2c')](_0x324357);_0x2dac4a[_0x5702('0x2d')]=_[_0x5702('0x2c')](_0x1b3b14['query']);_0x2dac4a[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x2dac4a[_0x5702('0x30')],_0x2dac4a[_0x5702('0x2d')]);_0x54319c[_0x5702('0x31')]=_[_0x5702('0x2f')](_0x2dac4a[_0x5702('0x30')],qs['fields'](_0x1b3b14[_0x5702('0x2d')][_0x5702('0x32')]));_0x54319c[_0x5702('0x31')]=_0x54319c[_0x5702('0x31')][_0x5702('0x33')]?_0x54319c[_0x5702('0x31')]:_0x2dac4a['model'];if(!_0x1b3b14[_0x5702('0x2d')][_0x5702('0x34')](_0x5702('0x35'))){_0x54319c[_0x5702('0x36')]=qs[_0x5702('0x36')](_0x1b3b14['query'][_0x5702('0x36')]);_0x54319c[_0x5702('0x20')]=qs[_0x5702('0x20')](_0x1b3b14['query'][_0x5702('0x20')]);}_0x54319c[_0x5702('0x37')]=qs[_0x5702('0x38')](_0x1b3b14[_0x5702('0x2d')][_0x5702('0x38')]);_0x54319c[_0x5702('0x39')]=qs['filters'](_['pick'](_0x1b3b14[_0x5702('0x2d')],_0x2dac4a['filters']));if(_0x1b3b14[_0x5702('0x2d')][_0x5702('0x3a')]){_0x54319c[_0x5702('0x39')]=_[_0x5702('0x3b')](_0x54319c[_0x5702('0x39')],{'$or':_[_0x5702('0x3c')](_0x324357,function(_0x381411){if(_0x381411[_0x5702('0x3d')][_0x5702('0x3e')]!==_0x5702('0x3f')){var _0x2bf9ba={};_0x2bf9ba[_0x381411[_0x5702('0x40')]]={'$like':'%'+_0x1b3b14[_0x5702('0x2d')][_0x5702('0x3a')]+'%'};return _0x2bf9ba;}})});}_0x54319c=_[_0x5702('0x3b')]({},_0x54319c,_0x1b3b14['options']);var _0x52b9e9={'where':_0x54319c[_0x5702('0x39')]};_0x52b9e9[_0x5702('0x41')]=[];if(_0x1b3b14[_0x5702('0x2d')][_0x5702('0x42')]){_0x52b9e9[_0x5702('0x41')][_0x5702('0x43')]({'model':db[_0x5702('0x44')],'as':_0x5702('0x45'),'attributes':['id'],'where':{'id':_0x1b3b14['query'][_0x5702('0x42')]},'required':!![]});_0x52b9e9[_0x5702('0x46')]=!![];}if(_0x1b3b14[_0x5702('0x2d')][_0x5702('0x47')]){_0x52b9e9[_0x5702('0x41')]['push']({'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x5702('0x48'),'createdAt',_0x5702('0x47')],'where':{'direction':'in','read':_0x1b3b14['query'][_0x5702('0x47')]||![]},'required':!![]});_0x52b9e9[_0x5702('0x46')]=!![];}return db[_0x5702('0x49')][_0x5702('0x1f')](_0x52b9e9)[_0x5702('0x26')](function(_0x185dc5){_0x317a3f['count']=_0x185dc5;if(_0x1b3b14[_0x5702('0x2d')]['includeAll']){_0x54319c[_0x5702('0x41')]=[{'model':db[_0x5702('0x4a')],'as':'Users','required':![],'attributes':['id','name','fullname']},{'model':db[_0x5702('0x4b')],'as':_0x5702('0x4c'),'required':![]},{'model':db[_0x5702('0x4a')],'as':_0x5702('0x4d'),'attributes':[_0x5702('0x29'),_0x5702('0x4e'),_0x5702('0x4f')],'required':![]},{'model':db[_0x5702('0x50')],'as':_0x5702('0x51'),'attributes':[_0x5702('0x29'),_0x5702('0x3e')],'required':![]},{'model':db[_0x5702('0x52')],'as':_0x5702('0x53'),'attributes':['id',_0x5702('0x48'),_0x5702('0x54'),_0x5702('0x47')],'where':{'direction':'in','read':_0x1b3b14[_0x5702('0x2d')][_0x5702('0x47')]||![]},'required':_0x1b3b14[_0x5702('0x2d')][_0x5702('0x47')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x5702('0x55')],'required':_0x1b3b14['query'][_0x5702('0x42')]?!![]:![]},{'model':db[_0x5702('0x44')],'as':_0x5702('0x56'),'attributes':['id',_0x5702('0x29'),_0x5702('0x55')],'through':_0x1b3b14[_0x5702('0x2d')][_0x5702('0x42')]?{'attributes':[],'where':{'TagId':_0x1b3b14[_0x5702('0x2d')]['tag']||undefined}}:{},'required':_0x1b3b14[_0x5702('0x2d')][_0x5702('0x42')]?!![]:![]}];}return db[_0x5702('0x49')][_0x5702('0x57')](_0x54319c);})[_0x5702('0x26')](function(_0x3cf6cd){_0x317a3f[_0x5702('0x58')]=_0x3cf6cd;return _0x317a3f;})[_0x5702('0x26')](respondWithFilteredResult(_0x3b7a8b,_0x54319c))[_0x5702('0x59')](handleError(_0x3b7a8b,null));};exports[_0x5702('0x5a')]=function(_0x26f63f,_0x34293d){var _0xaacb90={'raw':![],'where':{'id':_0x26f63f[_0x5702('0x5b')]['id']}},_0x2efaee={};_0x2efaee[_0x5702('0x30')]=_[_0x5702('0x2c')](db[_0x5702('0x49')][_0x5702('0x2b')]);_0x2efaee[_0x5702('0x2d')]=_[_0x5702('0x2c')](_0x26f63f[_0x5702('0x2d')]);_0x2efaee[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x2efaee[_0x5702('0x30')],_0x2efaee[_0x5702('0x2d')]);_0xaacb90[_0x5702('0x31')]=_[_0x5702('0x2f')](_0x2efaee[_0x5702('0x30')],qs[_0x5702('0x32')](_0x26f63f['query'][_0x5702('0x32')]));_0xaacb90[_0x5702('0x31')]=_0xaacb90['attributes'][_0x5702('0x33')]?_0xaacb90[_0x5702('0x31')]:_0x2efaee[_0x5702('0x30')];if(_0x26f63f[_0x5702('0x2d')][_0x5702('0x5c')]){_0xaacb90[_0x5702('0x41')]=[{'all':!![]}];}_0xaacb90=_[_0x5702('0x3b')]({},_0xaacb90,_0x26f63f[_0x5702('0x5d')]);return db['SmsInteraction'][_0x5702('0x5e')](_0xaacb90)[_0x5702('0x26')](handleEntityNotFound(_0x34293d,null))[_0x5702('0x26')](respondWithResult(_0x34293d,null))['catch'](handleError(_0x34293d,null));};exports[_0x5702('0x5f')]=function(_0x3500ab,_0x42d2d7){return db[_0x5702('0x49')][_0x5702('0x5f')](_0x3500ab[_0x5702('0x60')],{})[_0x5702('0x26')](respondWithResult(_0x42d2d7,0xc9))['catch'](handleError(_0x42d2d7,null));};exports['update']=function(_0x133526,_0x4e7f33){if(_0x133526[_0x5702('0x60')]['id']){delete _0x133526['body']['id'];}return db[_0x5702('0x49')][_0x5702('0x5e')]({'where':{'id':_0x133526['params']['id']}})['then'](handleEntityNotFound(_0x4e7f33,null))[_0x5702('0x26')](saveUpdates(_0x133526[_0x5702('0x60')],null))[_0x5702('0x26')](respondWithResult(_0x4e7f33,null))['catch'](handleError(_0x4e7f33,null));};exports[_0x5702('0x27')]=function(_0x23712a,_0x29bda9){return db['SmsInteraction'][_0x5702('0x5e')]({'where':{'id':_0x23712a[_0x5702('0x5b')]['id']}})[_0x5702('0x26')](handleEntityNotFound(_0x29bda9,null))[_0x5702('0x26')](removeEntity(_0x29bda9,null))[_0x5702('0x59')](handleError(_0x29bda9,null));};exports[_0x5702('0x61')]=function(_0x5692ab,_0x123633){return db[_0x5702('0x49')]['describe']()[_0x5702('0x26')](respondWithResult(_0x123633,null))[_0x5702('0x59')](handleError(_0x123633,null));};exports[_0x5702('0x62')]=function(_0x5f0471,_0x289d34,_0x44d1e2){return db[_0x5702('0x52')][_0x5702('0x5e')]({'where':{'id':_0x5f0471[_0x5702('0x5b')]['id']}})[_0x5702('0x26')](handleEntityNotFound(_0x289d34,null))['then'](function(_0x2f892b){if(_0x2f892b){return _0x2f892b[_0x5702('0x62')](_0x5f0471['body'][_0x5702('0x63')],_[_0x5702('0x64')](_0x5f0471[_0x5702('0x60')],[_0x5702('0x63'),'id'])||{});}})['then'](respondWithResult(_0x289d34,null))[_0x5702('0x59')](handleError(_0x289d34,null));};exports[_0x5702('0x65')]=function(_0x593938,_0x3d1a2d,_0x567cc7){var _0x28e691={'raw':![],'where':{}};var _0x543d7a={};var _0x21b162={'count':0x0,'rows':[]};return db[_0x5702('0x49')][_0x5702('0x66')]({'where':{'id':_0x593938['params']['id']}})['then'](handleEntityNotFound(_0x3d1a2d,null))[_0x5702('0x26')](function(_0x4fe8c2){if(_0x4fe8c2){_0x543d7a[_0x5702('0x30')]=_['keys'](db[_0x5702('0x52')][_0x5702('0x2b')]);_0x543d7a[_0x5702('0x2d')]=_[_0x5702('0x2c')](_0x593938[_0x5702('0x2d')]);_0x543d7a[_0x5702('0x2e')]=_[_0x5702('0x2f')](_0x543d7a[_0x5702('0x30')],_0x543d7a[_0x5702('0x2d')]);_0x28e691[_0x5702('0x31')]=_[_0x5702('0x2f')](_0x543d7a['model'],qs[_0x5702('0x32')](_0x593938['query'][_0x5702('0x32')]));_0x28e691['attributes']=_0x28e691[_0x5702('0x31')][_0x5702('0x33')]?_0x28e691[_0x5702('0x31')]:_0x543d7a[_0x5702('0x30')];if(!_0x593938['query'][_0x5702('0x34')](_0x5702('0x35'))){_0x28e691[_0x5702('0x36')]=qs['limit'](_0x593938[_0x5702('0x2d')][_0x5702('0x36')]);_0x28e691[_0x5702('0x20')]=qs[_0x5702('0x20')](_0x593938[_0x5702('0x2d')][_0x5702('0x20')]);}_0x28e691[_0x5702('0x37')]=qs['sort'](_0x593938[_0x5702('0x2d')][_0x5702('0x38')]);_0x28e691[_0x5702('0x39')]=qs[_0x5702('0x2e')](_[_0x5702('0x67')](_0x593938[_0x5702('0x2d')],_0x543d7a[_0x5702('0x2e')]));_0x28e691[_0x5702('0x39')][_0x5702('0x68')]=_0x4fe8c2['id'];if(_0x593938[_0x5702('0x2d')]['filter']){_0x28e691['where']=_[_0x5702('0x3b')](_0x28e691['where'],{'$or':_['map'](_0x28e691[_0x5702('0x31')],function(_0x152446){var _0x1f2dfe={};_0x1f2dfe[_0x152446]={'$like':'%'+_0x593938[_0x5702('0x2d')]['filter']+'%'};return _0x1f2dfe;})});}if(_0x593938[_0x5702('0x2d')][_0x5702('0x69')]){var _0x990ae9=_0x593938[_0x5702('0x2d')][_0x5702('0x69')][_0x5702('0x6a')](',');var _0x49b5ce={};_0x49b5ce[_0x990ae9[0x0]]={'$gte':moment(_0x990ae9[0x1])[_0x5702('0x6b')](_0x5702('0x6c'))};_0x28e691['where']=_['merge'](_0x28e691[_0x5702('0x39')],_0x49b5ce);}_0x28e691=_[_0x5702('0x3b')]({},_0x28e691,_0x593938[_0x5702('0x5d')]);return db[_0x5702('0x52')][_0x5702('0x1f')]({'where':_0x28e691['where']})[_0x5702('0x26')](function(_0x1f9cd6){_0x21b162[_0x5702('0x1f')]=_0x1f9cd6;if(_0x593938[_0x5702('0x2d')]['includeAll']){_0x28e691[_0x5702('0x41')]=[{'all':!![]}];}return db[_0x5702('0x52')][_0x5702('0x57')](_0x28e691);})['then'](function(_0x1dae44){_0x21b162[_0x5702('0x58')]=_0x1dae44;return _0x21b162;});}})['then'](respondWithFilteredResult(_0x3d1a2d,_0x28e691))[_0x5702('0x59')](handleError(_0x3d1a2d,null));};exports[_0x5702('0x6d')]=function(_0x583f91,_0x3f2b49,_0x3073b6){return db[_0x5702('0x49')][_0x5702('0x5e')]({'where':{'id':_0x583f91[_0x5702('0x5b')]['id']}})[_0x5702('0x26')](handleEntityNotFound(_0x3f2b49,null))[_0x5702('0x26')](function(_0x3f4c6b){if(_0x3f4c6b){return _0x3f4c6b[_0x5702('0x6e')](_0x583f91['body'][_0x5702('0x63')],_['omit'](_0x583f91[_0x5702('0x60')],[_0x5702('0x63'),'id'])||{})[_0x5702('0x6f')](function(){return db[_0x5702('0x44')][_0x5702('0x57')]({'attributes':['id',_0x5702('0x29'),'color'],'where':{'id':_0x583f91['body'][_0x5702('0x63')]}});})['then'](function(_0x17566d){socket['emit'](_0x5702('0x70'),{'id':Number(_0x583f91[_0x5702('0x5b')]['id']),'tags':_0x17566d||[]});return{'id':Number(_0x583f91[_0x5702('0x5b')]['id']),'tags':_0x17566d||[]};});}})['then'](respondWithResult(_0x3f2b49,null))[_0x5702('0x59')](handleError(_0x3f2b49,null));};exports['removeTags']=function(_0x4bd7eb,_0x4105de,_0x2c0213){var _0x44d143;return db[_0x5702('0x49')][_0x5702('0x5e')]({'where':{'id':_0x4bd7eb['params']['id']}})[_0x5702('0x26')](handleEntityNotFound(_0x4105de,null))[_0x5702('0x26')](function(_0x34ebb9){if(_0x34ebb9){return _0x34ebb9[_0x5702('0x71')](_0x4bd7eb[_0x5702('0x2d')]['ids']);}})[_0x5702('0x26')](respondWithStatusCode(_0x4105de,null))[_0x5702('0x59')](handleError(_0x4105de,null));};exports[_0x5702('0x72')]=function(_0x30803f,_0xcc15d9){var _0x59e989=moment()['unix']()[_0x5702('0x73')]();var _0x4fb81b=path[_0x5702('0x74')](config[_0x5702('0x75')],_0x5702('0x76'),_0x5702('0x77'),_0x5702('0x78'));var _0x43b9c9=path[_0x5702('0x74')](config[_0x5702('0x75')],_0x5702('0x76'),'files',_0x5702('0x79'));var _0x2e1719=path[_0x5702('0x74')](_0x4fb81b,_0x59e989);var _0x2ba416=util[_0x5702('0x6b')](_0x5702('0x7a'),_0x59e989);var _0x286ba4=path[_0x5702('0x74')](_0x4fb81b,_0x2ba416);var _0x2c2492=![];return db['SmsInteraction'][_0x5702('0x5e')]({'where':{'id':_0x30803f[_0x5702('0x5b')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x5702('0x53'),'attributes':['id',_0x5702('0x60')],'include':[{'model':db[_0x5702('0x4a')],'as':_0x5702('0x4a'),'attributes':['id',_0x5702('0x4e')],'raw':!![]},{'model':db[_0x5702('0x4b')],'as':_0x5702('0x4c'),'attributes':['id',_0x5702('0x7b')],'raw':!![]}]}]})[_0x5702('0x26')](handleEntityNotFound(_0xcc15d9,null))['then'](function(_0x27dd4a){if(_0x27dd4a){_0x2c2492=!![];var _0xa6e188='';var _0x5653cf={'format':_0x5702('0x7c'),'border':_0x5702('0x7d')};fs['mkdirSync'](_0x2e1719);_0xa6e188+=util[_0x5702('0x6b')](_0x5702('0x7e'),_0x27dd4a['id']);_0xa6e188+=util[_0x5702('0x6b')]('

Date:\x20%s

',moment()[_0x5702('0x6b')](_0x5702('0x7f'))[_0x5702('0x73')]());_0xa6e188+=_0x5702('0x80');for(var _0x2621b9=0x0;_0x2621b9<_0x27dd4a['Messages']['length'];_0x2621b9++){var _0x5002d2=_0x27dd4a[_0x5702('0x53')][_0x2621b9];_0xa6e188+=_0x5702('0x81');_0xa6e188+=util[_0x5702('0x6b')](_0x5702('0x82'),_0x5002d2[_0x5702('0x4a')]?_0x5002d2[_0x5702('0x4a')][_0x5702('0x4e')]:_0x5002d2[_0x5702('0x4c')][_0x5702('0x7b')],_0x5002d2[_0x5702('0x60')]);_0xa6e188+=_0x5702('0x83');}return new BPromise(function(_0x9abac8,_0x4b9ae5){pdf['create'](_0xa6e188,_0x5653cf)[_0x5702('0x84')](path[_0x5702('0x74')](_0x2e1719,_0x5702('0x85')+_0x59e989+_0x5702('0x86')),function(_0x25103c,_0x312a7c){if(_0x25103c)return _0x4b9ae5(_0x25103c);_0x9abac8(_0x312a7c);});});}})['then'](function(){if(_0x2c2492){return new BPromise(function(_0x28957d,_0x4dd40c){zipdir(_0x2e1719,{'saveTo':_0x286ba4},function(_0x403733,_0x51bea5){if(_0x403733)return _0x4dd40c(_0x403733);return _0x28957d(_0x51bea5);});});}})[_0x5702('0x26')](function(){if(_0x2c2492){return new BPromise(function(_0x4c9bc0,_0x79a2d7){rimraf(_0x2e1719,function(_0x530560){if(_0x530560)_0x79a2d7(_0x530560);return _0x4c9bc0();});});}})[_0x5702('0x26')](function(){if(_0x2c2492){return _0xcc15d9[_0x5702('0x72')](_0x286ba4,_0x2ba416,function(_0x5ee7c3){if(_0x5ee7c3){console[_0x5702('0x87')](_0x5702('0x88'),_0x5ee7c3);}else{fs[_0x5702('0x89')](_0x286ba4);}});}else{return _0xcc15d9['sendStatus'](0xc8);}})[_0x5702('0x59')](handleError(_0xcc15d9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c053288..8c72221 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 _0xd826=['setMaxListeners','update','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0x1a179c,_0x3faa8){var _0x593657=function(_0x333575){while(--_0x333575){_0x1a179c['push'](_0x1a179c['shift']());}};_0x593657(++_0x3faa8);}(_0xd826,0x1e8));var _0x6d82=function(_0x10a7f2,_0x24d4b8){_0x10a7f2=_0x10a7f2-0x0;var _0x25b668=_0xd826[_0x10a7f2];return _0x25b668;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x6d82('0x0'))['db'][_0x6d82('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6d82('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d82('0x3'),'afterDestroy':'remove'};function emitEvent(_0x645b8c){return function(_0x471c38,_0x9e4880,_0x569755){SmsInteractionEvents['emit'](_0x645b8c+':'+_0x471c38['id'],_0x471c38);SmsInteractionEvents['emit'](_0x645b8c,_0x471c38);_0x569755(null);};}for(var e in events){if(events[_0x6d82('0x4')](e)){var event=events[e];SmsInteraction[_0x6d82('0x5')](e,emitEvent(event));}}module[_0x6d82('0x6')]=SmsInteractionEvents; \ No newline at end of file +var _0x46c7=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x5d4721,_0x22e533){var _0x58ab7f=function(_0x4df8f3){while(--_0x4df8f3){_0x5d4721['push'](_0x5d4721['shift']());}};_0x58ab7f(++_0x22e533);}(_0x46c7,0x17f));var _0x746c=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x46c7[_0x255d5b];return _0x3e141a;};'use strict';var EventEmitter=require(_0x746c('0x0'));var SmsInteraction=require(_0x746c('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x746c('0x2')](0x0);var events={'afterCreate':_0x746c('0x3'),'afterUpdate':_0x746c('0x4'),'afterDestroy':_0x746c('0x5')};function emitEvent(_0xec0589){return function(_0x566d77,_0x5c2f92,_0x2ea69){SmsInteractionEvents['emit'](_0xec0589+':'+_0x566d77['id'],_0x566d77);SmsInteractionEvents[_0x746c('0x6')](_0xec0589,_0x566d77);_0x2ea69(null);};}for(var e in events){if(events[_0x746c('0x7')](e)){var event=events[e];SmsInteraction[_0x746c('0x8')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4428d63..9f9090d 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 _0x00c6=['../../config/logger','api','moment','bluebird','request-promise','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x00c6,0x104));var _0x600c=function(_0x2636b6,_0x5178c7){_0x2636b6=_0x2636b6-0x0;var _0x2d4316=_0x00c6[_0x2636b6];return _0x2d4316;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x600c('0x0'))(_0x600c('0x1'));var moment=require(_0x600c('0x2'));var BPromise=require(_0x600c('0x3'));var rp=require(_0x600c('0x4'));var attributes=require(_0x600c('0x5'));module[_0x600c('0x6')]=function(_0x4dae9f,_0x1c375b){return _0x4dae9f[_0x600c('0x7')](_0x600c('0x8'),attributes,{'tableName':_0x600c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58b4de,_0x380677,_0x1279cc){if(_0x58b4de['changed'](_0x600c('0xa'))){_0x58b4de['closedAt']=moment()[_0x600c('0xb')](_0x600c('0xc'));}_0x1279cc(null,_0x58b4de);}}});}; \ No newline at end of file +var _0xdee9=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','./smsInteraction.attributes','exports','SmsInteraction','closed'];(function(_0x4d9ca2,_0x44f632){var _0x3aea53=function(_0x25a281){while(--_0x25a281){_0x4d9ca2['push'](_0x4d9ca2['shift']());}};_0x3aea53(++_0x44f632);}(_0xdee9,0x13a));var _0x9dee=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xdee9[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x9dee('0x0'));var util=require(_0x9dee('0x1'));var logger=require(_0x9dee('0x2'))('api');var moment=require(_0x9dee('0x3'));var BPromise=require(_0x9dee('0x4'));var rp=require(_0x9dee('0x5'));var attributes=require(_0x9dee('0x6'));module[_0x9dee('0x7')]=function(_0x31a9cc,_0x1487fd){return _0x31a9cc['define'](_0x9dee('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xdf0a2d,_0x3a62a8,_0x126656){if(_0xdf0a2d['changed'](_0x9dee('0x9'))){_0xdf0a2d[_0x9dee('0xa')]=moment()['format'](_0x9dee('0xb'));}_0x126656(null,_0xdf0a2d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 55b49c9..976e83a 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 _0x121c=['request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','info','catch','UpdateSmsInteraction','SmsInteraction','update','raw','options','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register'];(function(_0x1f6e1a,_0x59c39e){var _0x59e842=function(_0x92a0d7){while(--_0x92a0d7){_0x1f6e1a['push'](_0x1f6e1a['shift']());}};_0x59e842(++_0x59c39e);}(_0x121c,0x193));var _0xc121=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x121c[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xc121('0x0'));var util=require('util');var moment=require(_0xc121('0x1'));var BPromise=require(_0xc121('0x2'));var rs=require(_0xc121('0x3'));var fs=require('fs');var Redis=require(_0xc121('0x4'));var db=require(_0xc121('0x5'))['db'];var utils=require(_0xc121('0x6'));var logger=require(_0xc121('0x7'))(_0xc121('0x8'));var config=require(_0xc121('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc121('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc121('0xb')](config[_0xc121('0xc')],{'host':_0xc121('0xd'),'port':0x18eb});var socket=require(_0xc121('0xe'))(new Redis(config['redis']));require(_0xc121('0xf'))[_0xc121('0x10')](socket);function respondWithRpcPromise(_0x456919,_0xc85b7,_0xf5acdf){return new BPromise(function(_0x477c1a,_0xce5570){return client[_0xc121('0x11')](_0x456919,_0xf5acdf)[_0xc121('0x12')](function(_0xab940){logger['info']('SmsInteraction,\x20%s,\x20%s',_0xc85b7,_0xc121('0x13'));logger[_0xc121('0x14')](_0xc121('0x15'),_0xc85b7,_0xc121('0x13'),JSON['stringify'](_0xab940));if(_0xab940[_0xc121('0x16')]){if(_0xab940[_0xc121('0x16')]['code']===0x1f4){logger[_0xc121('0x16')](_0xc121('0x17'),_0xc85b7,_0xab940[_0xc121('0x16')]['message']);return _0xce5570(_0xab940[_0xc121('0x16')][_0xc121('0x18')]);}logger['error'](_0xc121('0x17'),_0xc85b7,_0xab940[_0xc121('0x16')]['message']);return _0x477c1a(_0xab940[_0xc121('0x16')][_0xc121('0x18')]);}else{logger[_0xc121('0x19')](_0xc121('0x17'),_0xc85b7,_0xc121('0x13'));_0x477c1a(_0xab940['result'][_0xc121('0x18')]);}})[_0xc121('0x1a')](function(_0x2e50b6){logger[_0xc121('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xc85b7,_0x2e50b6);_0xce5570(_0x2e50b6);});});}exports[_0xc121('0x1b')]=function(_0x265b67){var _0x5d5462=this;return new Promise(function(_0x2b34d9,_0x2a12d4){return db[_0xc121('0x1c')][_0xc121('0x1d')](_0x265b67['body'],{'raw':_0x265b67['options']?_0x265b67['options'][_0xc121('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265b67[_0xc121('0x1f')]?_0x265b67[_0xc121('0x1f')][_0xc121('0x20')]||null:null,'attributes':_0x265b67['options']?_0x265b67[_0xc121('0x1f')][_0xc121('0x21')]||null:null,'limit':_0x265b67['options']?_0x265b67['options']['limit']||null:null})[_0xc121('0x12')](function(_0x5b424f){logger[_0xc121('0x19')](_0xc121('0x1b'),_0x265b67);logger[_0xc121('0x14')](_0xc121('0x1b'),_0x265b67,JSON[_0xc121('0x22')](_0x5b424f));_0x2b34d9(_0x5b424f);})[_0xc121('0x1a')](function(_0x4e050c){logger['error'](_0xc121('0x1b'),_0x4e050c['message'],_0x265b67);_0x2a12d4(_0x5d5462[_0xc121('0x16')](0x1f4,_0x4e050c[_0xc121('0x18')]));});});};exports[_0xc121('0x23')]=function(_0xc7446e){return new Promise(function(_0xcfb5f,_0x321021){return db[_0xc121('0x1c')][_0xc121('0x24')]({'where':_0xc7446e[_0xc121('0x1f')]?_0xc7446e[_0xc121('0x1f')][_0xc121('0x20')]||null:null})[_0xc121('0x12')](function(_0x10a946){if(_0x10a946){return _0x10a946[_0xc121('0x25')](_0xc7446e[_0xc121('0x26')][_0xc121('0x27')],_[_0xc121('0x28')](_0xc7446e[_0xc121('0x26')],['ids','id'])||{});}})[_0xc121('0x29')](function(_0x5ec114){logger[_0xc121('0x19')]('AddTags',_0xc7446e);logger['debug']('AddTags',_0xc7446e,JSON['stringify'](_0x5ec114));_0xcfb5f(_0x5ec114);})[_0xc121('0x1a')](function(_0x29d714){logger['error']('AddTags',_0x29d714[_0xc121('0x18')],_0xc7446e);_0x321021(_this[_0xc121('0x16')](0x1f4,_0x29d714['message']));});});}; \ No newline at end of file +var _0xdce9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','where','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment'];(function(_0x4ce05a,_0x54b99a){var _0x334515=function(_0x2011a3){while(--_0x2011a3){_0x4ce05a['push'](_0x4ce05a['shift']());}};_0x334515(++_0x54b99a);}(_0xdce9,0x193));var _0x9dce=function(_0xab2f5f,_0x2d4e87){_0xab2f5f=_0xab2f5f-0x0;var _0xca4050=_0xdce9[_0xab2f5f];return _0xca4050;};'use strict';var _=require(_0x9dce('0x0'));var util=require('util');var moment=require(_0x9dce('0x1'));var BPromise=require(_0x9dce('0x2'));var rs=require(_0x9dce('0x3'));var fs=require('fs');var Redis=require(_0x9dce('0x4'));var db=require(_0x9dce('0x5'))['db'];var utils=require(_0x9dce('0x6'));var logger=require(_0x9dce('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9dce('0x8'));var client=jayson[_0x9dce('0x9')][_0x9dce('0xa')]({'port':0x232a});config[_0x9dce('0xb')]=_[_0x9dce('0xc')](config['redis'],{'host':_0x9dce('0xd'),'port':0x18eb});var socket=require(_0x9dce('0xe'))(new Redis(config[_0x9dce('0xb')]));require(_0x9dce('0xf'))[_0x9dce('0x10')](socket);function respondWithRpcPromise(_0x58e4d4,_0x3948c4,_0x5d0451){return new BPromise(function(_0x2f0ca7,_0xa978b8){return client[_0x9dce('0x11')](_0x58e4d4,_0x5d0451)['then'](function(_0x8d3e45){logger[_0x9dce('0x12')](_0x9dce('0x13'),_0x3948c4,'request\x20sent');logger[_0x9dce('0x14')](_0x9dce('0x15'),_0x3948c4,'request\x20sent',JSON[_0x9dce('0x16')](_0x8d3e45));if(_0x8d3e45[_0x9dce('0x17')]){if(_0x8d3e45[_0x9dce('0x17')][_0x9dce('0x18')]===0x1f4){logger['error'](_0x9dce('0x13'),_0x3948c4,_0x8d3e45[_0x9dce('0x17')]['message']);return _0xa978b8(_0x8d3e45[_0x9dce('0x17')][_0x9dce('0x19')]);}logger[_0x9dce('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x3948c4,_0x8d3e45[_0x9dce('0x17')]['message']);return _0x2f0ca7(_0x8d3e45[_0x9dce('0x17')][_0x9dce('0x19')]);}else{logger[_0x9dce('0x12')](_0x9dce('0x13'),_0x3948c4,_0x9dce('0x1a'));_0x2f0ca7(_0x8d3e45[_0x9dce('0x1b')][_0x9dce('0x19')]);}})[_0x9dce('0x1c')](function(_0xae7499){logger[_0x9dce('0x17')](_0x9dce('0x13'),_0x3948c4,_0xae7499);_0xa978b8(_0xae7499);});});}exports[_0x9dce('0x1d')]=function(_0x46f3a4){var _0x3b121a=this;return new Promise(function(_0x15cc11,_0x1484a5){return db[_0x9dce('0x1e')][_0x9dce('0x1f')](_0x46f3a4[_0x9dce('0x20')],{'raw':_0x46f3a4['options']?_0x46f3a4['options'][_0x9dce('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46f3a4[_0x9dce('0x22')]?_0x46f3a4[_0x9dce('0x22')][_0x9dce('0x23')]||null:null,'attributes':_0x46f3a4[_0x9dce('0x22')]?_0x46f3a4[_0x9dce('0x22')]['attributes']||null:null,'limit':_0x46f3a4[_0x9dce('0x22')]?_0x46f3a4['options'][_0x9dce('0x24')]||null:null})[_0x9dce('0x25')](function(_0x387e94){logger[_0x9dce('0x12')](_0x9dce('0x1d'),_0x46f3a4);logger[_0x9dce('0x14')](_0x9dce('0x1d'),_0x46f3a4,JSON[_0x9dce('0x16')](_0x387e94));_0x15cc11(_0x387e94);})[_0x9dce('0x1c')](function(_0xd5ebd6){logger['error'](_0x9dce('0x1d'),_0xd5ebd6[_0x9dce('0x19')],_0x46f3a4);_0x1484a5(_0x3b121a[_0x9dce('0x17')](0x1f4,_0xd5ebd6['message']));});});};exports[_0x9dce('0x26')]=function(_0x7a75b0){return new Promise(function(_0x62a266,_0x233284){return db[_0x9dce('0x1e')][_0x9dce('0x27')]({'where':_0x7a75b0['options']?_0x7a75b0['options']['where']||null:null})[_0x9dce('0x25')](function(_0x48e063){if(_0x48e063){return _0x48e063[_0x9dce('0x28')](_0x7a75b0[_0x9dce('0x20')][_0x9dce('0x29')],_[_0x9dce('0x2a')](_0x7a75b0['body'],['ids','id'])||{});}})[_0x9dce('0x2b')](function(_0xb4ea99){logger[_0x9dce('0x12')](_0x9dce('0x2c'),_0x7a75b0);logger['debug'](_0x9dce('0x2c'),_0x7a75b0,JSON['stringify'](_0xb4ea99));_0x62a266(_0xb4ea99);})[_0x9dce('0x1c')](function(_0x5c02e9){logger[_0x9dce('0x17')](_0x9dce('0x2c'),_0x5c02e9[_0x9dce('0x19')],_0x7a75b0);_0x233284(_this['error'](0x1f4,_0x5c02e9[_0x9dce('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 30cb461..e1cb700 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 _0x568d=['smsInteraction:','./smsInteraction.events','save','emit','register'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x568d,0x191));var _0xd568=function(_0x55e492,_0x398035){_0x55e492=_0x55e492-0x0;var _0x27b6a7=_0x568d[_0x55e492];return _0x27b6a7;};'use strict';var SmsInteractionEvents=require(_0xd568('0x0'));var events=[_0xd568('0x1'),'remove','update'];function createListener(_0x481179,_0x1c0b69){return function(_0x798a1c){_0x1c0b69[_0xd568('0x2')](_0x481179,_0x798a1c);};}function removeListener(_0xd9703e,_0x356bff){return function(){SmsInteractionEvents['removeListener'](_0xd9703e,_0x356bff);};}exports[_0xd568('0x3')]=function(_0x3bd80e){for(var _0x312f5d=0x0,_0x67c408=events['length'];_0x312f5d<_0x67c408;_0x312f5d++){var _0x29212c=events[_0x312f5d];var _0x48842e=createListener(_0xd568('0x4')+_0x29212c,_0x3bd80e);SmsInteractionEvents['on'](_0x29212c,_0x48842e);}}; \ No newline at end of file +var _0x73a9=['register','length','./smsInteraction.events','save','remove','update','emit','removeListener'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x73a9,0x112));var _0x973a=function(_0x38dca6,_0x471cb7){_0x38dca6=_0x38dca6-0x0;var _0x29bcd7=_0x73a9[_0x38dca6];return _0x29bcd7;};'use strict';var SmsInteractionEvents=require(_0x973a('0x0'));var events=[_0x973a('0x1'),_0x973a('0x2'),_0x973a('0x3')];function createListener(_0x56f0f2,_0x400ed5){return function(_0x9e38ab){_0x400ed5[_0x973a('0x4')](_0x56f0f2,_0x9e38ab);};}function removeListener(_0x51f2b4,_0x1e79f4){return function(){SmsInteractionEvents[_0x973a('0x5')](_0x51f2b4,_0x1e79f4);};}exports[_0x973a('0x6')]=function(_0x3e6b7a){for(var _0x4d44e4=0x0,_0x467010=events[_0x973a('0x7')];_0x4d44e4<_0x467010;_0x4d44e4++){var _0x2ed391=events[_0x4d44e4];var _0x13ba7c=createListener('smsInteraction:'+_0x2ed391,_0x3e6b7a);SmsInteractionEvents['on'](_0x2ed391,_0x13ba7c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 690dc17..783423a 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 _0xec87=['/:id','show','post','sms','smsmessage:create','create','/:id/status','status','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','express','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0xcfcb89,_0x48f209){var _0x36d097=function(_0xda131a){while(--_0xda131a){_0xcfcb89['push'](_0xcfcb89['shift']());}};_0x36d097(++_0x48f209);}(_0xec87,0x1b0));var _0x7ec8=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xec87[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require('multer');var util=require(_0x7ec8('0x0'));var path=require(_0x7ec8('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ec8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7ec8('0x3'));var config=require(_0x7ec8('0x4'));var controller=require(_0x7ec8('0x5'));router[_0x7ec8('0x6')]('/',auth[_0x7ec8('0x7')](),controller['index']);router['get'](_0x7ec8('0x8'),auth[_0x7ec8('0x7')](),controller[_0x7ec8('0x9')]);router[_0x7ec8('0x6')](_0x7ec8('0xa'),auth[_0x7ec8('0x7')](),controller[_0x7ec8('0xb')]);router[_0x7ec8('0xc')]('/',auth[_0x7ec8('0x7')](),interaction['tracked'](_0x7ec8('0xd'),_0x7ec8('0xe')),controller[_0x7ec8('0xf')]);router[_0x7ec8('0xc')](_0x7ec8('0x10'),controller[_0x7ec8('0x11')]);router['put'](_0x7ec8('0xa'),auth['isAuthenticated'](),controller[_0x7ec8('0x12')]);router[_0x7ec8('0x13')](_0x7ec8('0x14'),auth[_0x7ec8('0x7')](),controller['accept']);router['put'](_0x7ec8('0x15'),auth[_0x7ec8('0x7')](),controller[_0x7ec8('0x16')]);router[_0x7ec8('0x17')](_0x7ec8('0xa'),auth[_0x7ec8('0x7')](),controller[_0x7ec8('0x18')]);module[_0x7ec8('0x19')]=router; \ No newline at end of file +var _0xcf71=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','smsmessage:create','create','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x108c7c,_0x443f37){var _0x148fbf=function(_0x232879){while(--_0x232879){_0x108c7c['push'](_0x108c7c['shift']());}};_0x148fbf(++_0x443f37);}(_0xcf71,0x13e));var _0x1cf7=function(_0x2865c9,_0x575948){_0x2865c9=_0x2865c9-0x0;var _0x585985=_0xcf71[_0x2865c9];return _0x585985;};'use strict';var multer=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var path=require(_0x1cf7('0x2'));var timeout=require(_0x1cf7('0x3'));var express=require(_0x1cf7('0x4'));var router=express['Router']();var auth=require(_0x1cf7('0x5'));var interaction=require(_0x1cf7('0x6'));var config=require(_0x1cf7('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x1cf7('0x8')](),controller[_0x1cf7('0x9')]);router[_0x1cf7('0xa')](_0x1cf7('0xb'),auth['isAuthenticated'](),controller[_0x1cf7('0xc')]);router[_0x1cf7('0xa')](_0x1cf7('0xd'),auth['isAuthenticated'](),controller[_0x1cf7('0xe')]);router['post']('/',auth[_0x1cf7('0x8')](),interaction[_0x1cf7('0xf')]('sms',_0x1cf7('0x10')),controller[_0x1cf7('0x11')]);router['post']('/:id/status',controller[_0x1cf7('0x12')]);router[_0x1cf7('0x13')](_0x1cf7('0xd'),auth[_0x1cf7('0x8')](),controller[_0x1cf7('0x14')]);router[_0x1cf7('0x13')](_0x1cf7('0x15'),auth[_0x1cf7('0x8')](),controller[_0x1cf7('0x16')]);router[_0x1cf7('0x13')]('/:id/reject',auth[_0x1cf7('0x8')](),controller[_0x1cf7('0x17')]);router[_0x1cf7('0x18')]('/:id',auth[_0x1cf7('0x8')](),controller[_0x1cf7('0x19')]);module[_0x1cf7('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 ee0ee0d..1bc2a7c 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 _0xa63f=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x71c2ac,_0x32eb1f){var _0x47582e=function(_0x2365f8){while(--_0x2365f8){_0x71c2ac['push'](_0x71c2ac['shift']());}};_0x47582e(++_0x32eb1f);}(_0xa63f,0x1b6));var _0xfa63=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xa63f[_0x529296];return _0x1796bf;};'use strict';var Sequelize=require(_0xfa63('0x0'));module[_0xfa63('0x1')]={'body':{'type':Sequelize[_0xfa63('0x2')](_0xfa63('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfa63('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfa63('0x5')]('in',_0xfa63('0x6')),'defaultValue':_0xfa63('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfa63('0x7')](0xbe)},'phone':{'type':Sequelize[_0xfa63('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9ca0=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0xeb6df8,_0x4e4333){var _0x31b979=function(_0x455f52){while(--_0x455f52){_0xeb6df8['push'](_0xeb6df8['shift']());}};_0x31b979(++_0x4e4333);}(_0x9ca0,0x65));var _0x09ca=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x9ca0[_0x2a55f8];return _0x245efd;};'use strict';var Sequelize=require(_0x09ca('0x0'));module[_0x09ca('0x1')]={'body':{'type':Sequelize[_0x09ca('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x09ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x09ca('0x4')]('in','out'),'defaultValue':_0x09ca('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x09ca('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x09ca('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1963b31..17017a1 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 _0x7a54=['delivered','Status','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','destroy','sendStatus','name','index','SmsMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','sort','where','pick','map','key','VIRTUAL','merge','options','includeAll','include','findAll','params','length','find','create','body','update','describe','../../config/logger','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteraction','isNil','read1stAt','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','sms-interactions','reject','sms','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','type','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent'];(function(_0x2bd204,_0x1568ef){var _0x260a1d=function(_0x3d6715){while(--_0x3d6715){_0x2bd204['push'](_0x2bd204['shift']());}};_0x260a1d(++_0x1568ef);}(_0x7a54,0x106));var _0x47a5=function(_0x3cbcd8,_0x531541){_0x3cbcd8=_0x3cbcd8-0x0;var _0x374fb8=_0x7a54[_0x3cbcd8];return _0x374fb8;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);var jayson=require(_0x47a5('0x19'));var client=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232c});var client9002=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return new BPromise(function(_0x2a2cbb,_0x1ef44c){var _0x574af6=_0x3b001e||client;return _0x574af6['request'](_0x4e99a8,_0x11faf5)[_0x47a5('0x1c')](function(_0x4b966e){logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x362359,_0x47a5('0x1e'),JSON[_0x47a5('0x21')](_0x4b966e));if(_0x4b966e[_0x47a5('0x22')]){if(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x23')]===0x1f4){logger['error'](_0x47a5('0x1d'),_0x362359,_0x4b966e[_0x47a5('0x22')]['message']);return _0x1ef44c(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}logger[_0x47a5('0x22')]('SmsMessage,\x20%s,\x20%s',_0x362359,_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);return _0x2a2cbb(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}else{logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));_0x2a2cbb(_0x4b966e['result'][_0x47a5('0x24')]);}})[_0x47a5('0x25')](function(_0x4437f1){logger[_0x47a5('0x22')](_0x47a5('0x1d'),_0x362359,_0x4437f1);_0x1ef44c(_0x4437f1);});});}function respondWithStatusCode(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xcc;return function(_0x136745){if(_0x136745){return _0x50bf17['sendStatus'](_0x53078a);}return _0x50bf17[_0x47a5('0x26')](_0x53078a)['end']();};}function respondWithResult(_0x23cb77,_0x378208){_0x378208=_0x378208||0xc8;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x26')](_0x378208)[_0x47a5('0x27')](_0x36ad34);}};}function respondWithFilteredResult(_0x3ba0b7,_0x24b162){return function(_0x136b14){if(_0x136b14){var _0x16631f=_0x136b14[_0x47a5('0x28')],_0x361bfa=_0x24b162['offset'],_0x1127f8=_0x24b162[_0x47a5('0x29')]+_0x24b162['limit'],_0x11a4fa;if(_0x1127f8>=_0x16631f){_0x1127f8=_0x16631f;_0x11a4fa=0xc8;}else{_0x11a4fa=0xce;}_0x3ba0b7[_0x47a5('0x26')](_0x11a4fa);return _0x3ba0b7[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x361bfa+'-'+_0x1127f8+'/'+_0x16631f)['json'](_0x136b14);}return null;};}function patchUpdates(_0x256650){return function(_0x625952){try{jsonpatch[_0x47a5('0x2c')](_0x625952,_0x256650,!![]);}catch(_0x1f1c68){return BPromise['reject'](_0x1f1c68);}return _0x625952['save']();};}function saveUpdates(_0x6f9a12,_0xfb5ddb){return function(_0x5bd7eb){if(_0x5bd7eb){return _0x5bd7eb['update'](_0x6f9a12)[_0x47a5('0x1c')](function(_0x51544e){return _0x51544e;});}return null;};}function removeEntity(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x2d')]()[_0x47a5('0x1c')](function(){_0x57bff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34,_0x5910bb){return function(_0x403028){if(!_0x403028){_0x274e34[_0x47a5('0x2e')](0x194);}return _0x403028;};}function handleError(_0xf269a8,_0x52749b){_0x52749b=_0x52749b||0x1f4;return function(_0x18f7e9){logger['error'](_0x18f7e9['stack']);if(_0x18f7e9[_0x47a5('0x2f')]){delete _0x18f7e9['name'];}_0xf269a8[_0x47a5('0x26')](_0x52749b)['send'](_0x18f7e9);};}exports[_0x47a5('0x30')]=function(_0x3534cb,_0x38c8d4){var _0x199698={},_0x36add5={},_0xed6320={'count':0x0,'rows':[]};var _0xee582c=db[_0x47a5('0x31')][_0x47a5('0x32')];_0x36add5['model']=_[_0x47a5('0x33')](_0xee582c);_0x36add5[_0x47a5('0x34')]=_['keys'](_0x3534cb[_0x47a5('0x34')]);_0x36add5[_0x47a5('0x35')]=_[_0x47a5('0x36')](_0x36add5['model'],_0x36add5[_0x47a5('0x34')]);_0x199698[_0x47a5('0x37')]=_['intersection'](_0x36add5[_0x47a5('0x38')],qs[_0x47a5('0x39')](_0x3534cb['query']['fields']));_0x199698['attributes']=_0x199698[_0x47a5('0x37')]['length']?_0x199698[_0x47a5('0x37')]:_0x36add5[_0x47a5('0x38')];if(!_0x3534cb[_0x47a5('0x34')][_0x47a5('0x3a')](_0x47a5('0x3b'))){_0x199698[_0x47a5('0x3c')]=qs[_0x47a5('0x3c')](_0x3534cb[_0x47a5('0x34')][_0x47a5('0x3c')]);_0x199698[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x3534cb[_0x47a5('0x34')][_0x47a5('0x29')]);}_0x199698['order']=qs[_0x47a5('0x3d')](_0x3534cb[_0x47a5('0x34')][_0x47a5('0x3d')]);_0x199698[_0x47a5('0x3e')]=qs['filters'](_[_0x47a5('0x3f')](_0x3534cb['query'],_0x36add5['filters']));if(_0x3534cb['query']['filter']){_0x199698[_0x47a5('0x3e')]=_['merge'](_0x199698[_0x47a5('0x3e')],{'$or':_[_0x47a5('0x40')](_0xee582c,function(_0x448610){if(_0x448610['type'][_0x47a5('0x41')]!==_0x47a5('0x42')){var _0x586747={};_0x586747[_0x448610['field']]={'$like':'%'+_0x3534cb[_0x47a5('0x34')]['filter']+'%'};return _0x586747;}})});}_0x199698=_[_0x47a5('0x43')]({},_0x199698,_0x3534cb[_0x47a5('0x44')]);var _0x188614={'where':_0x199698[_0x47a5('0x3e')]};return db[_0x47a5('0x31')][_0x47a5('0x28')](_0x188614)[_0x47a5('0x1c')](function(_0x17cc42){_0xed6320[_0x47a5('0x28')]=_0x17cc42;if(_0x3534cb[_0x47a5('0x34')][_0x47a5('0x45')]){_0x199698[_0x47a5('0x46')]=[{'all':!![]}];}return db[_0x47a5('0x31')][_0x47a5('0x47')](_0x199698);})[_0x47a5('0x1c')](function(_0x3a2b38){_0xed6320['rows']=_0x3a2b38;return _0xed6320;})[_0x47a5('0x1c')](respondWithFilteredResult(_0x38c8d4,_0x199698))[_0x47a5('0x25')](handleError(_0x38c8d4,null));};exports['show']=function(_0x52b3a8,_0x3d0a88){var _0x560e4e={'raw':!![],'where':{'id':_0x52b3a8[_0x47a5('0x48')]['id']}},_0x13750d={};_0x13750d['model']=_['keys'](db[_0x47a5('0x31')]['rawAttributes']);_0x13750d[_0x47a5('0x34')]=_[_0x47a5('0x33')](_0x52b3a8[_0x47a5('0x34')]);_0x13750d[_0x47a5('0x35')]=_[_0x47a5('0x36')](_0x13750d[_0x47a5('0x38')],_0x13750d[_0x47a5('0x34')]);_0x560e4e['attributes']=_['intersection'](_0x13750d[_0x47a5('0x38')],qs[_0x47a5('0x39')](_0x52b3a8[_0x47a5('0x34')][_0x47a5('0x39')]));_0x560e4e[_0x47a5('0x37')]=_0x560e4e[_0x47a5('0x37')][_0x47a5('0x49')]?_0x560e4e['attributes']:_0x13750d[_0x47a5('0x38')];if(_0x52b3a8[_0x47a5('0x34')][_0x47a5('0x45')]){_0x560e4e['include']=[{'all':!![]}];}_0x560e4e=_[_0x47a5('0x43')]({},_0x560e4e,_0x52b3a8['options']);return db[_0x47a5('0x31')][_0x47a5('0x4a')](_0x560e4e)[_0x47a5('0x1c')](handleEntityNotFound(_0x3d0a88,null))[_0x47a5('0x1c')](respondWithResult(_0x3d0a88,null))['catch'](handleError(_0x3d0a88,null));};exports[_0x47a5('0x4b')]=function(_0x1e6de3,_0x2f66e9){return db[_0x47a5('0x31')][_0x47a5('0x4b')](_0x1e6de3[_0x47a5('0x4c')],{})[_0x47a5('0x1c')](respondWithResult(_0x2f66e9,0xc9))['catch'](handleError(_0x2f66e9,null));};exports[_0x47a5('0x4d')]=function(_0x43721b,_0x187d7e){if(_0x43721b[_0x47a5('0x4c')]['id']){delete _0x43721b[_0x47a5('0x4c')]['id'];}return db[_0x47a5('0x31')]['find']({'where':{'id':_0x43721b[_0x47a5('0x48')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x187d7e,null))[_0x47a5('0x1c')](saveUpdates(_0x43721b['body'],null))[_0x47a5('0x1c')](respondWithResult(_0x187d7e,null))[_0x47a5('0x25')](handleError(_0x187d7e,null));};exports[_0x47a5('0x2d')]=function(_0x5d8d4a,_0x57641e){return db[_0x47a5('0x31')][_0x47a5('0x4a')]({'where':{'id':_0x5d8d4a['params']['id']}})['then'](handleEntityNotFound(_0x57641e,null))[_0x47a5('0x1c')](removeEntity(_0x57641e,null))['catch'](handleError(_0x57641e,null));};exports[_0x47a5('0x4e')]=function(_0x5d383d,_0x482de6){return db[_0x47a5('0x31')][_0x47a5('0x4e')]()['then'](respondWithResult(_0x482de6,null))[_0x47a5('0x25')](handleError(_0x482de6,null));};var interaction_log=require(_0x47a5('0x4f'))('sms-interactions');exports['accept']=function(_0x16b4fd,_0x30d482,_0x867da0){var _0x2931e4={'channel':'sms'};if(_0x16b4fd[_0x47a5('0x4c')]['id']){delete _0x16b4fd[_0x47a5('0x4c')]['id'];}_0x16b4fd[_0x47a5('0x4c')]['read']=!![];_0x16b4fd[_0x47a5('0x4c')]['readAt']=moment()[_0x47a5('0x50')](_0x47a5('0x51'));_0x16b4fd[_0x47a5('0x4c')][_0x47a5('0x52')]=_0x16b4fd[_0x47a5('0x4c')]['UserId']||_0x16b4fd[_0x47a5('0x53')]['id'];return db['SmsMessage']['find']({'where':{'id':_0x16b4fd['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x47a5('0x54')}]})[_0x47a5('0x1c')](handleEntityNotFound(_0x30d482,null))[_0x47a5('0x1c')](saveUpdates(_0x16b4fd['body'],null))['then'](function(_0x139229){if(_0x139229){_0x2931e4[_0x47a5('0x24')]=_0x139229[_0x47a5('0x55')]({'plain':!![]});return db[_0x47a5('0x56')][_0x47a5('0x4a')]({'where':{'id':_0x139229['SmsInteractionId']}});}return null;})[_0x47a5('0x1c')](handleEntityNotFound(_0x30d482,null))['then'](function(_0x22c886){if(_0x22c886){return _0x22c886[_0x47a5('0x4d')]({'UserId':_0x16b4fd['body'][_0x47a5('0x52')],'read1stAt':_[_0x47a5('0x57')](_0x22c886[_0x47a5('0x58')])?moment()[_0x47a5('0x50')](_0x47a5('0x51')):undefined});}return null;})[_0x47a5('0x1c')](function(_0x35cca8){if(_0x35cca8){_0x2931e4[_0x47a5('0x59')]=_0x35cca8['get']({'plain':!![]});interaction_log[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x16b4fd[_0x47a5('0x53')]['id'],_0x16b4fd[_0x47a5('0x53')][_0x47a5('0x2f')],_0x16b4fd['user'][_0x47a5('0x5c')],_0x2931e4[_0x47a5('0x59')]['id'],_0x16b4fd[_0x47a5('0x4c')]?JSON[_0x47a5('0x21')](_0x16b4fd[_0x47a5('0x4c')]):_0x47a5('0x5d'));return respondWithRpcPromise(_0x47a5('0x5e'),_0x47a5('0x5f'),_0x2931e4);}return null;})[_0x47a5('0x1c')](function(_0x44cb90){if(_0x44cb90){if(_0x16b4fd[_0x47a5('0x4c')][_0x47a5('0x60')]){_0x2931e4[_0x47a5('0x24')][_0x47a5('0x61')]=util[_0x47a5('0x50')]('SIP/%s',_0x16b4fd[_0x47a5('0x53')][_0x47a5('0x2f')]);_0x2931e4[_0x47a5('0x24')]['channel']=_0x2931e4[_0x47a5('0x62')];_0x2931e4[_0x47a5('0x24')][_0x47a5('0x63')]=_0x47a5('0x64');return respondWithRpcPromise('EventManager',_0x47a5('0x65'),{'event':'acceptmessage','message':_0x2931e4[_0x47a5('0x24')]},client9002)['then'](function(){return _0x2931e4;});}return _0x2931e4;}return null;})[_0x47a5('0x1c')](respondWithResult(_0x30d482,null))['catch'](handleError(_0x30d482,null));};var interaction_log=require(_0x47a5('0x4f'))(_0x47a5('0x66'));exports[_0x47a5('0x67')]=function(_0x58473b,_0x4af557,_0x4b8084){var _0x4164a3={'agent':{},'channel':_0x47a5('0x68')};if(_0x58473b[_0x47a5('0x4c')]['id']){delete _0x58473b[_0x47a5('0x4c')]['id'];}_0x58473b['body'][_0x47a5('0x52')]=_0x58473b[_0x47a5('0x4c')][_0x47a5('0x52')]||_0x58473b[_0x47a5('0x53')]['id'];_0x4164a3[_0x47a5('0x69')]['id']=_0x58473b[_0x47a5('0x4c')][_0x47a5('0x52')];return db[_0x47a5('0x31')][_0x47a5('0x4a')]({'where':{'id':_0x58473b[_0x47a5('0x48')]['id'],'UserId':null}})[_0x47a5('0x1c')](handleEntityNotFound(_0x4af557,null))[_0x47a5('0x1c')](function(_0x49d3dc){if(_0x49d3dc){_0x4164a3[_0x47a5('0x24')]=_0x49d3dc['get']({'plain':!![]});return db[_0x47a5('0x56')][_0x47a5('0x4a')]({'where':{'id':_0x49d3dc[_0x47a5('0x6a')]}});}return null;})[_0x47a5('0x1c')](handleEntityNotFound(_0x4af557,null))[_0x47a5('0x1c')](function(_0xa9c853){if(_0xa9c853){_0x4164a3[_0x47a5('0x59')]=_0xa9c853[_0x47a5('0x55')]({'plain':!![]});interaction_log[_0x47a5('0x5a')](_0x47a5('0x6b'),_0x58473b[_0x47a5('0x53')]['id'],_0x58473b[_0x47a5('0x53')][_0x47a5('0x2f')],_0x58473b[_0x47a5('0x53')][_0x47a5('0x5c')],_0x4164a3['interaction']['id'],_0x58473b['body']?JSON['stringify'](_0x58473b['body']):_0x47a5('0x5d'));return respondWithRpcPromise(_0x47a5('0x6c'),'rejectMessage',_0x4164a3);}return null;})[_0x47a5('0x1c')](function(_0x44dda2){if(_0x44dda2){_0x44dda2[_0x47a5('0x24')][_0x47a5('0x61')]=util[_0x47a5('0x50')](_0x47a5('0x6d'),_0x58473b[_0x47a5('0x53')][_0x47a5('0x2f')]);_0x44dda2[_0x47a5('0x24')][_0x47a5('0x62')]=_0x4164a3[_0x47a5('0x62')];_0x44dda2['message'][_0x47a5('0x63')]=_0x47a5('0x67');respondWithRpcPromise(_0x47a5('0x65'),'EventManager',{'event':_0x47a5('0x6e'),'message':_0x44dda2[_0x47a5('0x24')]},client9002);return _0x4164a3;}return null;})[_0x47a5('0x1c')](respondWithResult(_0x4af557,null))['catch'](handleError(_0x4af557,null));};exports[_0x47a5('0x26')]=function(_0x5205ba,_0x49d93d,_0x356e16){if(_0x5205ba[_0x47a5('0x4c')]['id']){delete _0x5205ba[_0x47a5('0x4c')]['id'];}var _0x27333e;return db[_0x47a5('0x31')][_0x47a5('0x4a')]({'where':{'id':_0x5205ba['params']['id']}})['then'](handleEntityNotFound(_0x49d93d,null))[_0x47a5('0x1c')](function(_0x4f2361){if(_0x4f2361){_0x27333e=_0x4f2361;return db[_0x47a5('0x6f')][_0x47a5('0x4a')]({'where':{'id':_0x4f2361[_0x47a5('0x70')]}});}})[_0x47a5('0x1c')](handleEntityNotFound(_0x49d93d,null))['then'](function(_0x3c66e3){if(_0x3c66e3){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x47a5('0x26'),_0x47a5('0x71'),_0x3c66e3['type'],util[_0x47a5('0x72')](_0x5205ba[_0x47a5('0x4c')],{'showHidden':![],'depth':null}));switch(_0x3c66e3[_0x47a5('0x73')]){case'twilio':if(_0x5205ba[_0x47a5('0x4c')]['MessageSid']&&_0x5205ba[_0x47a5('0x4c')][_0x47a5('0x74')]===_0x27333e[_0x47a5('0x75')]){return _0x27333e['update']({'read':!![]});}else{logger[_0x47a5('0x22')](_0x47a5('0x76'),_0x47a5('0x26'),'twilio',util[_0x47a5('0x72')](_0x5205ba['body'],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x77'):if(_0x5205ba['body'][_0x47a5('0x78')]&&_0x5205ba[_0x47a5('0x4c')][_0x47a5('0x78')]===_0x27333e[_0x47a5('0x75')]&&_['indexOf']([_0x47a5('0x79'),_0x47a5('0x7a')],_0x5205ba[_0x47a5('0x4c')][_0x47a5('0x7b')])>=0x0){return _0x27333e[_0x47a5('0x4d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x26'),'plivio',util[_0x47a5('0x72')](_0x5205ba[_0x47a5('0x4c')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7c'):var _0x5018e9=_0x5205ba[_0x47a5('0x4c')][_0x47a5('0x7d')][0x0];if(_0x5018e9['status'][_0x47a5('0x7e')]===_0x47a5('0x7f')){return _0x27333e[_0x47a5('0x4d')]({'read':!![]});}else{logger[_0x47a5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7c'),util[_0x47a5('0x72')](_0x5205ba['body'],{'showHidden':![],'depth':null}));}break;}return _0x27333e;}})[_0x47a5('0x1c')](respondWithResult(_0x49d93d,null))[_0x47a5('0x25')](handleError(_0x49d93d,null));}; \ No newline at end of file +var _0x90b1=['rejectmessage','SmsAccount','SmsAccountId','debug','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','where','filters','merge','map','type','key','VIRTUAL','field','filter','options','SmsMessage','include','findAll','show','includeAll','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x90b1,0x1bb));var _0x190b=function(_0x209b06,_0x2be741){_0x209b06=_0x209b06-0x0;var _0xacc50f=_0x90b1[_0x209b06];return _0xacc50f;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var authService=require(_0x190b('0xf'));var hardwareService=require(_0x190b('0x10'));var Redis=require(_0x190b('0x11'));var qs=require(_0x190b('0x12'));var logger=require(_0x190b('0x13'))(_0x190b('0x14'));var utils=require(_0x190b('0x15'));var config=require('../../config/environment');var db=require(_0x190b('0x16'))['db'];config[_0x190b('0x17')]=_['defaults'](config[_0x190b('0x17')],{'host':_0x190b('0x18'),'port':0x18eb});var socket=require(_0x190b('0x19'))(new Redis(config[_0x190b('0x17')]));require(_0x190b('0x1a'))[_0x190b('0x1b')](socket);var jayson=require(_0x190b('0x1c'));var client=jayson[_0x190b('0x1d')][_0x190b('0x1e')]({'port':0x232c});var client9002=jayson[_0x190b('0x1d')][_0x190b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1a046f,_0xab346,_0x3e8781,_0x3fbfc3){return new BPromise(function(_0x121867,_0x1b4f4c){var _0x5c63d9=_0x3fbfc3||client;return _0x5c63d9[_0x190b('0x1f')](_0x1a046f,_0x3e8781)['then'](function(_0x2a9323){logger[_0x190b('0x20')](_0x190b('0x21'),_0xab346,_0x190b('0x22'));logger['debug'](_0x190b('0x23'),_0xab346,_0x190b('0x22'),JSON[_0x190b('0x24')](_0x2a9323));if(_0x2a9323[_0x190b('0x25')]){if(_0x2a9323[_0x190b('0x25')][_0x190b('0x26')]===0x1f4){logger['error'](_0x190b('0x21'),_0xab346,_0x2a9323[_0x190b('0x25')]['message']);return _0x1b4f4c(_0x2a9323[_0x190b('0x25')]['message']);}logger['error'](_0x190b('0x21'),_0xab346,_0x2a9323[_0x190b('0x25')][_0x190b('0x27')]);return _0x121867(_0x2a9323['error'][_0x190b('0x27')]);}else{logger[_0x190b('0x20')](_0x190b('0x21'),_0xab346,_0x190b('0x22'));_0x121867(_0x2a9323[_0x190b('0x28')][_0x190b('0x27')]);}})[_0x190b('0x29')](function(_0x519a76){logger['error'](_0x190b('0x21'),_0xab346,_0x519a76);_0x1b4f4c(_0x519a76);});});}function respondWithStatusCode(_0x1a5f86,_0x50605b){_0x50605b=_0x50605b||0xcc;return function(_0x526822){if(_0x526822){return _0x1a5f86[_0x190b('0x2a')](_0x50605b);}return _0x1a5f86['status'](_0x50605b)[_0x190b('0x2b')]();};}function respondWithResult(_0x3b6aaf,_0x51f8b4){_0x51f8b4=_0x51f8b4||0xc8;return function(_0x3e7a10){if(_0x3e7a10){return _0x3b6aaf[_0x190b('0x2c')](_0x51f8b4)['json'](_0x3e7a10);}};}function respondWithFilteredResult(_0xa9d6f7,_0x2c47ae){return function(_0x359b4a){if(_0x359b4a){var _0x494f3f=_0x359b4a[_0x190b('0x2d')],_0x536d7b=_0x2c47ae[_0x190b('0x2e')],_0x3730cc=_0x2c47ae['offset']+_0x2c47ae[_0x190b('0x2f')],_0x4d5f3f;if(_0x3730cc>=_0x494f3f){_0x3730cc=_0x494f3f;_0x4d5f3f=0xc8;}else{_0x4d5f3f=0xce;}_0xa9d6f7['status'](_0x4d5f3f);return _0xa9d6f7[_0x190b('0x30')]('Content-Range',_0x536d7b+'-'+_0x3730cc+'/'+_0x494f3f)[_0x190b('0x31')](_0x359b4a);}return null;};}function patchUpdates(_0x5650e1){return function(_0xc789e5){try{jsonpatch[_0x190b('0x32')](_0xc789e5,_0x5650e1,!![]);}catch(_0x5cf164){return BPromise[_0x190b('0x33')](_0x5cf164);}return _0xc789e5[_0x190b('0x34')]();};}function saveUpdates(_0x107b6f,_0x1dcb8b){return function(_0x3c7488){if(_0x3c7488){return _0x3c7488[_0x190b('0x35')](_0x107b6f)[_0x190b('0x36')](function(_0x248919){return _0x248919;});}return null;};}function removeEntity(_0x599da4,_0x5d6031){return function(_0x2cce05){if(_0x2cce05){return _0x2cce05[_0x190b('0x37')]()['then'](function(){_0x599da4[_0x190b('0x2c')](0xcc)[_0x190b('0x2b')]();});}};}function handleEntityNotFound(_0x3e4dd8,_0x3fbba1){return function(_0x3b6f3f){if(!_0x3b6f3f){_0x3e4dd8[_0x190b('0x2a')](0x194);}return _0x3b6f3f;};}function handleError(_0x5bda80,_0x5492b0){_0x5492b0=_0x5492b0||0x1f4;return function(_0x5f3b45){logger[_0x190b('0x25')](_0x5f3b45[_0x190b('0x38')]);if(_0x5f3b45[_0x190b('0x39')]){delete _0x5f3b45['name'];}_0x5bda80[_0x190b('0x2c')](_0x5492b0)[_0x190b('0x3a')](_0x5f3b45);};}exports[_0x190b('0x3b')]=function(_0x5a9669,_0x2a8260){var _0x540966={},_0x4f12db={},_0x1368b2={'count':0x0,'rows':[]};var _0x1a84f3=db['SmsMessage'][_0x190b('0x3c')];_0x4f12db[_0x190b('0x3d')]=_[_0x190b('0x3e')](_0x1a84f3);_0x4f12db['query']=_[_0x190b('0x3e')](_0x5a9669[_0x190b('0x3f')]);_0x4f12db['filters']=_['intersection'](_0x4f12db[_0x190b('0x3d')],_0x4f12db['query']);_0x540966[_0x190b('0x40')]=_[_0x190b('0x41')](_0x4f12db[_0x190b('0x3d')],qs[_0x190b('0x42')](_0x5a9669['query'][_0x190b('0x42')]));_0x540966['attributes']=_0x540966[_0x190b('0x40')][_0x190b('0x43')]?_0x540966['attributes']:_0x4f12db[_0x190b('0x3d')];if(!_0x5a9669[_0x190b('0x3f')][_0x190b('0x44')]('nolimit')){_0x540966[_0x190b('0x2f')]=qs['limit'](_0x5a9669['query']['limit']);_0x540966[_0x190b('0x2e')]=qs[_0x190b('0x2e')](_0x5a9669[_0x190b('0x3f')][_0x190b('0x2e')]);}_0x540966['order']=qs['sort'](_0x5a9669[_0x190b('0x3f')]['sort']);_0x540966[_0x190b('0x45')]=qs[_0x190b('0x46')](_['pick'](_0x5a9669[_0x190b('0x3f')],_0x4f12db[_0x190b('0x46')]));if(_0x5a9669[_0x190b('0x3f')]['filter']){_0x540966[_0x190b('0x45')]=_[_0x190b('0x47')](_0x540966['where'],{'$or':_[_0x190b('0x48')](_0x1a84f3,function(_0x596956){if(_0x596956[_0x190b('0x49')][_0x190b('0x4a')]!==_0x190b('0x4b')){var _0x48d399={};_0x48d399[_0x596956[_0x190b('0x4c')]]={'$like':'%'+_0x5a9669['query'][_0x190b('0x4d')]+'%'};return _0x48d399;}})});}_0x540966=_[_0x190b('0x47')]({},_0x540966,_0x5a9669[_0x190b('0x4e')]);var _0x287356={'where':_0x540966[_0x190b('0x45')]};return db[_0x190b('0x4f')][_0x190b('0x2d')](_0x287356)['then'](function(_0x38d765){_0x1368b2[_0x190b('0x2d')]=_0x38d765;if(_0x5a9669[_0x190b('0x3f')]['includeAll']){_0x540966[_0x190b('0x50')]=[{'all':!![]}];}return db[_0x190b('0x4f')][_0x190b('0x51')](_0x540966);})[_0x190b('0x36')](function(_0x37d130){_0x1368b2['rows']=_0x37d130;return _0x1368b2;})[_0x190b('0x36')](respondWithFilteredResult(_0x2a8260,_0x540966))[_0x190b('0x29')](handleError(_0x2a8260,null));};exports[_0x190b('0x52')]=function(_0x50db2b,_0x129a53){var _0x27591f={'raw':!![],'where':{'id':_0x50db2b['params']['id']}},_0x2b0a3a={};_0x2b0a3a['model']=_[_0x190b('0x3e')](db[_0x190b('0x4f')][_0x190b('0x3c')]);_0x2b0a3a[_0x190b('0x3f')]=_[_0x190b('0x3e')](_0x50db2b[_0x190b('0x3f')]);_0x2b0a3a['filters']=_[_0x190b('0x41')](_0x2b0a3a[_0x190b('0x3d')],_0x2b0a3a[_0x190b('0x3f')]);_0x27591f['attributes']=_[_0x190b('0x41')](_0x2b0a3a[_0x190b('0x3d')],qs[_0x190b('0x42')](_0x50db2b['query'][_0x190b('0x42')]));_0x27591f[_0x190b('0x40')]=_0x27591f[_0x190b('0x40')][_0x190b('0x43')]?_0x27591f[_0x190b('0x40')]:_0x2b0a3a[_0x190b('0x3d')];if(_0x50db2b[_0x190b('0x3f')][_0x190b('0x53')]){_0x27591f[_0x190b('0x50')]=[{'all':!![]}];}_0x27591f=_[_0x190b('0x47')]({},_0x27591f,_0x50db2b[_0x190b('0x4e')]);return db['SmsMessage'][_0x190b('0x54')](_0x27591f)['then'](handleEntityNotFound(_0x129a53,null))[_0x190b('0x36')](respondWithResult(_0x129a53,null))[_0x190b('0x29')](handleError(_0x129a53,null));};exports['create']=function(_0x2a5045,_0x31e595){return db[_0x190b('0x4f')][_0x190b('0x55')](_0x2a5045[_0x190b('0x56')],{})[_0x190b('0x36')](respondWithResult(_0x31e595,0xc9))[_0x190b('0x29')](handleError(_0x31e595,null));};exports[_0x190b('0x35')]=function(_0x50ac22,_0x2f034e){if(_0x50ac22[_0x190b('0x56')]['id']){delete _0x50ac22[_0x190b('0x56')]['id'];}return db['SmsMessage'][_0x190b('0x54')]({'where':{'id':_0x50ac22['params']['id']}})['then'](handleEntityNotFound(_0x2f034e,null))[_0x190b('0x36')](saveUpdates(_0x50ac22[_0x190b('0x56')],null))[_0x190b('0x36')](respondWithResult(_0x2f034e,null))[_0x190b('0x29')](handleError(_0x2f034e,null));};exports[_0x190b('0x37')]=function(_0x20314b,_0x1383e5){return db[_0x190b('0x4f')][_0x190b('0x54')]({'where':{'id':_0x20314b[_0x190b('0x57')]['id']}})[_0x190b('0x36')](handleEntityNotFound(_0x1383e5,null))[_0x190b('0x36')](removeEntity(_0x1383e5,null))[_0x190b('0x29')](handleError(_0x1383e5,null));};exports[_0x190b('0x58')]=function(_0x5a42b1,_0x3f80ce){return db[_0x190b('0x4f')][_0x190b('0x58')]()[_0x190b('0x36')](respondWithResult(_0x3f80ce,null))['catch'](handleError(_0x3f80ce,null));};var interaction_log=require('../../config/logger')(_0x190b('0x59'));exports[_0x190b('0x5a')]=function(_0x49fa17,_0x1195f9,_0x53cb6f){var _0x313f29={'channel':_0x190b('0x5b')};if(_0x49fa17[_0x190b('0x56')]['id']){delete _0x49fa17['body']['id'];}_0x49fa17[_0x190b('0x56')][_0x190b('0x5c')]=!![];_0x49fa17[_0x190b('0x56')][_0x190b('0x5d')]=moment()[_0x190b('0x5e')](_0x190b('0x5f'));_0x49fa17[_0x190b('0x56')][_0x190b('0x60')]=_0x49fa17[_0x190b('0x56')]['UserId']||_0x49fa17['user']['id'];return db[_0x190b('0x4f')][_0x190b('0x54')]({'where':{'id':_0x49fa17[_0x190b('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x190b('0x61')],'as':'Contact'}]})[_0x190b('0x36')](handleEntityNotFound(_0x1195f9,null))[_0x190b('0x36')](saveUpdates(_0x49fa17['body'],null))[_0x190b('0x36')](function(_0x3d5d38){if(_0x3d5d38){_0x313f29[_0x190b('0x27')]=_0x3d5d38[_0x190b('0x62')]({'plain':!![]});return db[_0x190b('0x63')][_0x190b('0x54')]({'where':{'id':_0x3d5d38[_0x190b('0x64')]}});}return null;})[_0x190b('0x36')](handleEntityNotFound(_0x1195f9,null))['then'](function(_0x14d1b8){if(_0x14d1b8){return _0x14d1b8['update']({'UserId':_0x49fa17['body'][_0x190b('0x60')],'read1stAt':_[_0x190b('0x65')](_0x14d1b8[_0x190b('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x190b('0x36')](function(_0xdc7579){if(_0xdc7579){_0x313f29[_0x190b('0x67')]=_0xdc7579[_0x190b('0x62')]({'plain':!![]});interaction_log[_0x190b('0x20')](_0x190b('0x68'),_0x49fa17[_0x190b('0x69')]['id'],_0x49fa17[_0x190b('0x69')]['name'],_0x49fa17[_0x190b('0x69')][_0x190b('0x6a')],_0x313f29[_0x190b('0x67')]['id'],_0x49fa17[_0x190b('0x56')]?JSON[_0x190b('0x24')](_0x49fa17['body']):_0x190b('0x6b'));return respondWithRpcPromise(_0x190b('0x6c'),_0x190b('0x6d'),_0x313f29);}return null;})['then'](function(_0x5a0493){if(_0x5a0493){if(_0x49fa17[_0x190b('0x56')][_0x190b('0x6e')]){_0x313f29[_0x190b('0x27')]['interface']=util[_0x190b('0x5e')](_0x190b('0x6f'),_0x49fa17[_0x190b('0x69')][_0x190b('0x39')]);_0x313f29['message'][_0x190b('0x70')]=_0x313f29['channel'];_0x313f29[_0x190b('0x27')][_0x190b('0x71')]=_0x190b('0x5a');return respondWithRpcPromise(_0x190b('0x72'),'EventManager',{'event':_0x190b('0x73'),'message':_0x313f29['message']},client9002)[_0x190b('0x36')](function(){return _0x313f29;});}return _0x313f29;}return null;})['then'](respondWithResult(_0x1195f9,null))['catch'](handleError(_0x1195f9,null));};var interaction_log=require(_0x190b('0x13'))('sms-interactions');exports[_0x190b('0x33')]=function(_0x76f768,_0x24ff6a,_0x3b6803){var _0x425641={'agent':{},'channel':'sms'};if(_0x76f768[_0x190b('0x56')]['id']){delete _0x76f768[_0x190b('0x56')]['id'];}_0x76f768[_0x190b('0x56')]['UserId']=_0x76f768[_0x190b('0x56')][_0x190b('0x60')]||_0x76f768['user']['id'];_0x425641[_0x190b('0x74')]['id']=_0x76f768[_0x190b('0x56')][_0x190b('0x60')];return db['SmsMessage'][_0x190b('0x54')]({'where':{'id':_0x76f768[_0x190b('0x57')]['id'],'UserId':null}})[_0x190b('0x36')](handleEntityNotFound(_0x24ff6a,null))[_0x190b('0x36')](function(_0x5e8c28){if(_0x5e8c28){_0x425641[_0x190b('0x27')]=_0x5e8c28[_0x190b('0x62')]({'plain':!![]});return db[_0x190b('0x63')]['find']({'where':{'id':_0x5e8c28[_0x190b('0x64')]}});}return null;})[_0x190b('0x36')](handleEntityNotFound(_0x24ff6a,null))[_0x190b('0x36')](function(_0x49bd3b){if(_0x49bd3b){_0x425641[_0x190b('0x67')]=_0x49bd3b[_0x190b('0x62')]({'plain':!![]});interaction_log[_0x190b('0x20')](_0x190b('0x75'),_0x76f768[_0x190b('0x69')]['id'],_0x76f768['user']['name'],_0x76f768[_0x190b('0x69')][_0x190b('0x6a')],_0x425641['interaction']['id'],_0x76f768[_0x190b('0x56')]?JSON[_0x190b('0x24')](_0x76f768['body']):'null');return respondWithRpcPromise(_0x190b('0x76'),_0x190b('0x77'),_0x425641);}return null;})['then'](function(_0x5a7c9d){if(_0x5a7c9d){_0x5a7c9d[_0x190b('0x27')][_0x190b('0x78')]=util[_0x190b('0x5e')](_0x190b('0x6f'),_0x76f768[_0x190b('0x69')]['name']);_0x5a7c9d['message'][_0x190b('0x70')]=_0x425641['channel'];_0x5a7c9d[_0x190b('0x27')][_0x190b('0x71')]=_0x190b('0x33');respondWithRpcPromise(_0x190b('0x72'),_0x190b('0x72'),{'event':_0x190b('0x79'),'message':_0x5a7c9d[_0x190b('0x27')]},client9002);return _0x425641;}return null;})[_0x190b('0x36')](respondWithResult(_0x24ff6a,null))[_0x190b('0x29')](handleError(_0x24ff6a,null));};exports[_0x190b('0x2c')]=function(_0x19d3f4,_0x59b9a9,_0xaee442){if(_0x19d3f4[_0x190b('0x56')]['id']){delete _0x19d3f4[_0x190b('0x56')]['id'];}var _0x517e9c;return db['SmsMessage'][_0x190b('0x54')]({'where':{'id':_0x19d3f4[_0x190b('0x57')]['id']}})['then'](handleEntityNotFound(_0x59b9a9,null))[_0x190b('0x36')](function(_0x18c5f4){if(_0x18c5f4){_0x517e9c=_0x18c5f4;return db[_0x190b('0x7a')]['find']({'where':{'id':_0x18c5f4[_0x190b('0x7b')]}});}})[_0x190b('0x36')](handleEntityNotFound(_0x59b9a9,null))['then'](function(_0x23298e){if(_0x23298e){logger[_0x190b('0x7c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x190b('0x2c'),'received\x20delivery\x20report\x20from',_0x23298e['type'],util['inspect'](_0x19d3f4['body'],{'showHidden':![],'depth':null}));switch(_0x23298e[_0x190b('0x49')]){case _0x190b('0x7d'):if(_0x19d3f4['body'][_0x190b('0x7e')]&&_0x19d3f4[_0x190b('0x56')]['MessageSid']===_0x517e9c[_0x190b('0x7f')]){return _0x517e9c[_0x190b('0x35')]({'read':!![]});}else{logger[_0x190b('0x25')](_0x190b('0x80'),_0x190b('0x2c'),_0x190b('0x7d'),util[_0x190b('0x81')](_0x19d3f4[_0x190b('0x56')],{'showHidden':![],'depth':null}));}break;case _0x190b('0x82'):if(_0x19d3f4['body'][_0x190b('0x83')]&&_0x19d3f4['body']['MessageUUID']===_0x517e9c[_0x190b('0x7f')]&&_[_0x190b('0x84')]([_0x190b('0x85'),_0x190b('0x86')],_0x19d3f4[_0x190b('0x56')][_0x190b('0x87')])>=0x0){return _0x517e9c[_0x190b('0x35')]({'read':!![]});}else{logger[_0x190b('0x25')](_0x190b('0x80'),_0x190b('0x2c'),_0x190b('0x88'),util[_0x190b('0x81')](_0x19d3f4['body'],{'showHidden':![],'depth':null}));}break;case _0x190b('0x89'):var _0x18ddf9=_0x19d3f4[_0x190b('0x56')][_0x190b('0x8a')][0x0];if(_0x18ddf9[_0x190b('0x2c')][_0x190b('0x8b')]===_0x190b('0x8c')){return _0x517e9c[_0x190b('0x35')]({'read':!![]});}else{logger[_0x190b('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x190b('0x2c'),_0x190b('0x89'),util[_0x190b('0x81')](_0x19d3f4['body'],{'showHidden':![],'depth':null}));}break;}return _0x517e9c;}})[_0x190b('0x36')](respondWithResult(_0x59b9a9,null))[_0x190b('0x29')](handleError(_0x59b9a9,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 89b41f5..500c2ab 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 _0xf2e1=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x4422af,_0x4f0f87){var _0x4388f8=function(_0x4e79e3){while(--_0x4e79e3){_0x4422af['push'](_0x4422af['shift']());}};_0x4388f8(++_0x4f0f87);}(_0xf2e1,0x123));var _0x1f2e=function(_0x2cea6d,_0x355ab5){_0x2cea6d=_0x2cea6d-0x0;var _0x270aef=_0xf2e1[_0x2cea6d];return _0x270aef;};'use strict';var EventEmitter=require(_0x1f2e('0x0'));var SmsMessage=require(_0x1f2e('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1f2e('0x2')](0x0);var events={'afterCreate':_0x1f2e('0x3'),'afterUpdate':_0x1f2e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x356210){return function(_0x2ec7e8,_0x2011b8,_0x3bbada){SmsMessageEvents['emit'](_0x356210+':'+_0x2ec7e8['id'],_0x2ec7e8);SmsMessageEvents[_0x1f2e('0x5')](_0x356210,_0x2ec7e8);_0x3bbada(null);};}for(var e in events){if(events[_0x1f2e('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x1f2e('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x2ff5=['SmsMessage','remove','emit','hasOwnProperty','hook','events'];(function(_0x3247be,_0x1bc97c){var _0x249ac9=function(_0xbfdd1d){while(--_0xbfdd1d){_0x3247be['push'](_0x3247be['shift']());}};_0x249ac9(++_0x1bc97c);}(_0x2ff5,0x19d));var _0x52ff=function(_0x4e59fa,_0x304ffc){_0x4e59fa=_0x4e59fa-0x0;var _0x5ae012=_0x2ff5[_0x4e59fa];return _0x5ae012;};'use strict';var EventEmitter=require(_0x52ff('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x52ff('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x52ff('0x2')};function emitEvent(_0x579e22){return function(_0x5de96c,_0x3c3e7b,_0x1d0cd1){SmsMessageEvents['emit'](_0x579e22+':'+_0x5de96c['id'],_0x5de96c);SmsMessageEvents[_0x52ff('0x3')](_0x579e22,_0x5de96c);_0x1d0cd1(null);};}for(var e in events){if(events[_0x52ff('0x4')](e)){var event=events[e];SmsMessage[_0x52ff('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 93eb4a4..17cca51 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 _0x2008=['messages','create','phone','remote','/api/sms/messages/','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','sender','text','timestamp','keys','sort','createHash','md5','digest','hex','signature=','id_sms','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','exports','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','secret','isNil','SmsInteraction','update','body','catch','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken'];(function(_0x38e8d5,_0x3d9bf5){var _0x657f2b=function(_0x4e8c93){while(--_0x4e8c93){_0x38e8d5['push'](_0x38e8d5['shift']());}};_0x657f2b(++_0x3d9bf5);}(_0x2008,0xbf));var _0x8200=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x2008[_0x4f431d];return _0x4f31e1;};'use strict';var _=require(_0x8200('0x0'));var util=require(_0x8200('0x1'));var logger=require(_0x8200('0x2'))('api');var moment=require(_0x8200('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./smsMessage.attributes');module[_0x8200('0x4')]=function(_0x3a1ed7,_0x5df7b7){return _0x3a1ed7[_0x8200('0x5')](_0x8200('0x6'),attributes,{'tableName':_0x8200('0x7'),'paranoid':![],'indexes':[{'name':_0x8200('0x8'),'fields':[_0x8200('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x479977,_0x17d5b5,_0x3c0791){var _0x264d48=_0x3a1ed7[_0x8200('0x9')];var _0xfe0d24=_0x479977[_0x8200('0xa')]({'plain':!![]});if(_0xfe0d24[_0x8200('0xb')]['toLowerCase']()==='in'||_0xfe0d24['direction'][_0x8200('0xc')]()==='out'&&!_0xfe0d24[_0x8200('0xd')]&&!_[_0x8200('0xe')](_0xfe0d24['UserId'])){_0x264d48[_0x8200('0xf')]['findOne']({'where':{'id':_0xfe0d24['SmsInteractionId']}})['then'](function(_0x540c3d){if(_0x540c3d){_0x540c3d[_0x8200('0x10')]({'lastMsgAt':_0xfe0d24['createdAt'],'lastMsgDirection':_0xfe0d24[_0x8200('0xb')][_0x8200('0xc')](),'lastMsgBody':_0xfe0d24[_0x8200('0x11')]});}})[_0x8200('0x12')](function(_0x4f3c9a){console[_0x8200('0x13')](_0x4f3c9a);});}if(_0xfe0d24[_0x8200('0xb')]==='out'&&!_0xfe0d24[_0x8200('0xd')]){var _0x66095a;_0x264d48[_0x8200('0x14')]['find']({'where':{'id':_0xfe0d24[_0x8200('0x15')]},'raw':!![]})[_0x8200('0x16')](function(_0x2ba87a){_0x66095a=_0x2ba87a;if(_0x66095a&&_0x66095a['type']){switch(_0x66095a[_0x8200('0x17')]){case _0x8200('0x18'):var _0x2483c1=require(_0x8200('0x18'));if(_0x66095a[_0x8200('0x19')]&&_0x66095a['authToken']&&_0x66095a['phone']){var _0x1d24ea=new _0x2483c1(_0x66095a[_0x8200('0x19')],_0x66095a[_0x8200('0x1a')]);_0x1d24ea[_0x8200('0x1b')][_0x8200('0x1c')]({'body':_0xfe0d24[_0x8200('0x11')],'to':_0xfe0d24[_0x8200('0x1d')],'from':_0x66095a['phone'],'statusCallback':_0x66095a[_0x8200('0x1e')]+_0x8200('0x1f')+_0xfe0d24['id']+_0x8200('0x20')+_0x66095a[_0x8200('0x21')]})['then'](function(_0x5e05b2){if(_0x5e05b2['sid']){return _0x479977[_0x8200('0x10')]({'messageId':_0x5e05b2['sid']});}})['catch'](function(_0x3a4203){logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x18'),util[_0x8200('0x24')](_0x3a4203,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),'twilio',_0x8200('0x25'));}break;case _0x8200('0x26'):var _0x2886f6=_0x8200('0x27');if(_0x66095a[_0x8200('0x28')]&&_0x66095a[_0x8200('0x29')]){var _0x499d11={'recipient':[_0xfe0d24[_0x8200('0x1d')]],'message':_0xfe0d24['body'],'message_type':_0x66095a[_0x8200('0x2a')]};var _0x36c08a={'url':_0x2886f6+_0x8200('0x2b')+_0x66095a[_0x8200('0x28')]+_0x8200('0x2c')+_0x66095a['password'],'method':'GET'};rp(_0x36c08a)[_0x8200('0x16')](function(_0x2d9a10){var _0x22ce46=_0x2d9a10[_0x8200('0x2d')](';');var _0x22c6a3={'user_key':_0x22ce46[0x0],'session_key':_0x22ce46[0x1]};_0x36c08a={'url':_0x2886f6+_0x8200('0x2e'),'method':_0x8200('0x2f'),'headers':{'user_key':_0x22c6a3['user_key'],'Session_key':_0x22c6a3[_0x8200('0x30')]},'json':!![],'body':_0x499d11};return rp(_0x36c08a);})[_0x8200('0x16')](function(_0x12dc29){if(_0x12dc29[_0x8200('0x31')]>=0x1){var _0x2a5813={'messageId':_0x12dc29[_0x8200('0x32')]};if(_0x66095a['smsMethod']!=='GP'||!_0x66095a[_0x8200('0x33')]){_0x2a5813[_0x8200('0x34')]=!![];}return _0x479977[_0x8200('0x10')](_0x2a5813);}else{return logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x26'),util[_0x8200('0x24')](_0x12dc29,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e93a2){return logger['error'](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x26'),util[_0x8200('0x24')](_0x1e93a2,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8200('0x23'),'skebby',_0x8200('0x35'));}break;case _0x8200('0x36'):if(_0x66095a['authToken']){var _0x32df2e={'recipient':_0xfe0d24[_0x8200('0x1d')],'message':_0xfe0d24[_0x8200('0x11')],'sender':_0x66095a[_0x8200('0x37')]||_0x66095a['phone'],'authorization':_0x66095a['authToken']};var _0x17d5b5={'method':_0x8200('0x2f'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x32df2e,'json':!![]};rp(_0x17d5b5)[_0x8200('0x16')](function(_0x44e72c){var _0x3bcc85={'messageId':_0x44e72c['requestid']};if(!_0x66095a[_0x8200('0x33')]){_0x3bcc85[_0x8200('0x34')]=!![];}return _0x479977['update'](_0x3bcc85);})[_0x8200('0x12')](function(_0x455356){logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8200('0x36'),util[_0x8200('0x24')](_0x455356,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x36'),_0x8200('0x38'));}break;case _0x8200('0x39'):if(_0x66095a[_0x8200('0x28')]&&_0x66095a['password']){var _0x32df2e={'messages':[{'source':_0x8200('0x3a'),'to':_0xfe0d24[_0x8200('0x1d')],'body':_0xfe0d24[_0x8200('0x11')],'from':_0x66095a[_0x8200('0x37')]||_0x66095a[_0x8200('0x1d')]}]};var _0x506fd6=util[_0x8200('0x3b')](_0x8200('0x3c'),_0x66095a[_0x8200('0x28')],_0x66095a['password']);var _0x17d5b5={'method':_0x8200('0x2f'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x32df2e,'headers':{'Authorization':util[_0x8200('0x3b')](_0x8200('0x3d'),new Buffer(_0x506fd6)[_0x8200('0x3e')](_0x8200('0x3f')))},'json':!![]};rp(_0x17d5b5)[_0x8200('0x16')](function(_0xe8b4c){if(_0xe8b4c[_0x8200('0x40')]>=0xc8&&_0xe8b4c[_0x8200('0x40')]<=0xce){if(_0xe8b4c[_0x8200('0x41')]&&_0xe8b4c['data'][_0x8200('0x42')]>0x0){var _0x19ea62=_[_0x8200('0x43')](_0xe8b4c[_0x8200('0x41')][_0x8200('0x1b')]);var _0x4d3a48={'messageId':_0x19ea62[_0x8200('0x44')]};if(!_0x66095a[_0x8200('0x33')]){_0x4d3a48[_0x8200('0x34')]=!![];}return _0x479977[_0x8200('0x10')](_0x4d3a48);}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x45'),util[_0x8200('0x24')](_0xe8b4c,{'showHidden':![],'depth':null}));}}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x45'),util[_0x8200('0x24')](_0xe8b4c,{'showHidden':![],'depth':null}));}})[_0x8200('0x12')](function(_0x330b80){logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),'clickSend',util[_0x8200('0x24')](_0x330b80,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x45'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8200('0x46'):if(_0x66095a[_0x8200('0x47')]&&_0x66095a[_0x8200('0x1a')]){var _0x32df2e={'dst':_0xfe0d24['phone'],'text':_0xfe0d24['body'],'src':_0x66095a[_0x8200('0x37')]||_0x66095a['phone'],'url':_0x66095a[_0x8200('0x1e')]+_0x8200('0x1f')+_0xfe0d24['id']+_0x8200('0x20')+_0x66095a[_0x8200('0x21')]};var _0x506fd6=util[_0x8200('0x3b')]('%s:%s',_0x66095a[_0x8200('0x47')],_0x66095a['authToken']);var _0x17d5b5={'method':_0x8200('0x2f'),'uri':util['format'](_0x8200('0x48'),_0x66095a[_0x8200('0x47')]),'body':_0x32df2e,'headers':{'Authorization':util['format'](_0x8200('0x3d'),new Buffer(_0x506fd6)[_0x8200('0x3e')](_0x8200('0x3f')))},'json':!![]};rp(_0x17d5b5)[_0x8200('0x16')](function(_0x637867){var _0x276e69={'messageId':_0x637867[_0x8200('0x49')][0x0]};return _0x479977[_0x8200('0x10')](_0x276e69);})['catch'](function(_0x4ca4d2){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8200('0x46'),util[_0x8200('0x24')](_0x4ca4d2,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x46'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x66095a[_0x8200('0x28')]&&_0x66095a[_0x8200('0x29')]){if(_0x66095a[_0x8200('0x4a')]){var _0x24f4ab={'method':_0x8200('0x2f'),'uri':_0x66095a[_0x8200('0x4a')]+_0x8200('0x4b'),'body':{'username':_0x66095a['username'],'password':_0x66095a['password']},'json':!![]};return rp(_0x24f4ab)[_0x8200('0x16')](function(_0x34c0ba){var _0x5d7ab3={'method':_0x8200('0x2f'),'uri':_0x66095a[_0x8200('0x4a')]+_0x8200('0x4c'),'body':{'messages':[{'from':_0x66095a['phone'],'destinations':[{'to':_0xfe0d24[_0x8200('0x1d')]}],'text':_0xfe0d24[_0x8200('0x11')],'notifyUrl':_0x66095a[_0x8200('0x1e')]+_0x8200('0x1f')+_0xfe0d24['id']+_0x8200('0x20')+_0x66095a['token'],'notifyContentType':_0x8200('0x4d'),'callbackData':_0x66095a[_0x8200('0x1d')]+';'+_0xfe0d24[_0x8200('0x11')]}]},'headers':{'Authorization':_0x8200('0x4e')+_0x34c0ba[_0x8200('0x21')]},'json':!![]};return rp(_0x5d7ab3)['then'](function(_0xb2ba68){if(_0xb2ba68[_0x8200('0x1b')]){var _0x4e9d16={'messageId':_0xb2ba68['messages'][0x0]['messageId']};if(!_0x66095a[_0x8200('0x33')]){_0x4e9d16[_0x8200('0x34')]=!![];}return _0x479977[_0x8200('0x10')](_0x4e9d16);}else{return logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x4f'),util[_0x8200('0x24')](_0xb2ba68,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x314c09){return logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x4f'),util[_0x8200('0x24')](_0x314c09,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x4f'),_0x8200('0x50'));}}else{logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x4f'),_0x8200('0x35'));}break;case _0x8200('0x51'):var _0x37a783=require('crypto');if(_0x66095a[_0x8200('0x52')]){var _0x3813c4={};_0x3813c4[_0x8200('0x53')]=_0x66095a[_0x8200('0x28')];_0x3813c4[_0x8200('0x1d')]=_0xfe0d24[_0x8200('0x1d')];_0x3813c4[_0x8200('0x54')]=_0x66095a['phone'];_0x3813c4[_0x8200('0x55')]=_0xfe0d24[_0x8200('0x11')];_0x3813c4[_0x8200('0x56')]=+new Date();var _0x9e23e6='';var _0x31bf25='';var _0x5e727c=Object[_0x8200('0x57')](_0x3813c4);_0x5e727c[_0x8200('0x58')]();for(var _0x250933=0x0;_0x250933<_0x5e727c['length'];_0x250933++){if(_0x9e23e6!=''){_0x9e23e6+='&';}_0x9e23e6+=_0x5e727c[_0x250933]+'='+encodeURIComponent(_0x3813c4[_0x5e727c[_0x250933]]);_0x31bf25+=_0x3813c4[_0x5e727c[_0x250933]];}_0x31bf25+=_0x66095a[_0x8200('0x52')];_0x31bf25=_0x37a783[_0x8200('0x59')](_0x8200('0x5a'))[_0x8200('0x10')](_0x31bf25)[_0x8200('0x5b')](_0x8200('0x5c'));if(_0x9e23e6!==''){_0x9e23e6+='&';}_0x9e23e6+=_0x8200('0x5d')+_0x31bf25;var _0x36c08a={'method':'GET','uri':'https://sms.csc.lv/external/get/send.php?'+_0x9e23e6,'json':!![]};return rp(_0x36c08a)[_0x8200('0x16')](function(_0x372334){var _0x21037c=Object['keys'](_0x372334);if(_0x372334[_0x21037c[0x0]]['error']&&parseInt(_0x372334[_0x21037c[0x0]][_0x8200('0x13')])===0x0){var _0xf83354={'messageId':_0x372334[_0x21037c[0x0]][_0x8200('0x5e')]};if(!_0x66095a[_0x8200('0x33')]){_0xf83354['read']=!![];}return _0x479977['update'](_0xf83354);}else{return logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8200('0x51'),util[_0x8200('0x24')](_0x372334[_0x8200('0x13')],{'showHidden':![],'depth':null}));}})[_0x8200('0x12')](function(_0x3d63e7){return logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x51'),util[_0x8200('0x24')](_0x3d63e7,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')](_0x8200('0x22'),'afterCreate','csc','Missing\x20parameters:\x20apiKey');}break;case _0x8200('0x5f'):if(_0x66095a[_0x8200('0x52')]){var _0x54faf0={'method':_0x8200('0x2f'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x66095a[_0x8200('0x52')]},'body':{'content':_0xfe0d24['body'],'to':[_0xfe0d24[_0x8200('0x1d')]],'from':_0x66095a[_0x8200('0x1d')],'binary':![],'clientMessageId':_0x8200('0x60'),'charset':_0x8200('0x61')},'json':!![]};rp(_0x54faf0)['then'](function(_0x228e7e){if(!_0x228e7e[_0x8200('0x13')]){var _0x51cd9f={'messageId':_0x228e7e['messages'][0x0]['apiMessageId']};if(!_0x66095a['deliveryReport']){_0x51cd9f[_0x8200('0x34')]=!![];}return _0x479977[_0x8200('0x10')](_0x51cd9f);}else{return logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8200('0x23'),_0x8200('0x5f'),util['inspect'](_0x228e7e[_0x8200('0x13')],{'showHidden':![],'depth':null}));}})[_0x8200('0x12')](function(_0x3fdda8){return logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8200('0x5f'),util[_0x8200('0x24')](_0x3fdda8,{'showHidden':![],'depth':null}));});}else{logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8200('0x23'),_0x8200('0x5f'),_0x8200('0x62'));}break;case _0x8200('0x63'):if(_0x66095a['apiKey']){var _0x3aefd1={};var _0x36c08a={'method':'POST','uri':_0x8200('0x64'),'headers':{'Authorization':'Bearer\x20'+_0x66095a[_0x8200('0x52')],'Content-Type':_0x8200('0x4d')},'body':{'from':_0x66095a[_0x8200('0x1d')],'to':_0xfe0d24['phone'],'text':_0xfe0d24[_0x8200('0x11')]},'json':!![]};return rp(_0x36c08a)[_0x8200('0x16')](function(_0x59bafd){if(_0x59bafd['code']==0xca){_0x3aefd1[_0x8200('0x65')]=_0x59bafd;var _0x4275ef={'method':_0x8200('0x2f'),'uri':_0x8200('0x66'),'headers':{'Authorization':_0x8200('0x67')+_0x66095a[_0x8200('0x52')],'Content-Type':'application/json'},'body':{'refid':_0x3aefd1[_0x8200('0x65')][_0x8200('0x68')]},'json':!![]};return rp(_0x4275ef)[_0x8200('0x16')](function(_0x4becc5){_0x3aefd1[_0x8200('0x69')]=_0x4becc5;var _0xa10e90={'messageId':_0x3aefd1[_0x8200('0x65')]['refid'],'read':!![]};return _0x479977['update'](_0xa10e90);});}else{return logger[_0x8200('0x13')](_0x8200('0x22'),_0x8200('0x23'),_0x8200('0x63'),util[_0x8200('0x24')](_0x59bafd,{'showHidden':![],'depth':null}));}})[_0x8200('0x12')](function(_0x18b68d){return logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8200('0x23'),_0x8200('0x63'),util[_0x8200('0x24')](_0x18b68d,{'showHidden':![],'depth':null}));});}else{return logger[_0x8200('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8200('0x23'),_0x8200('0x63'),'Token\x20not\x20received');}break;}}})[_0x8200('0x6a')](function(){_0x3c0791();});}else{_0x3c0791();}}},'charset':_0x8200('0x6b'),'collate':_0x8200('0x6c')});}; \ No newline at end of file +var _0xe1e5=['out','secret','isNil','UserId','update','body','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','createHash','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','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_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','exports','define','SmsMessage','sms_messages','messageId','models','direction','toLowerCase'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xe1e5,0x148));var _0x5e1e=function(_0x1298ed,_0x39ba63){_0x1298ed=_0x1298ed-0x0;var _0x56b532=_0xe1e5[_0x1298ed];return _0x56b532;};'use strict';var _=require(_0x5e1e('0x0'));var util=require(_0x5e1e('0x1'));var logger=require(_0x5e1e('0x2'))(_0x5e1e('0x3'));var moment=require(_0x5e1e('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e1e('0x5'));var attributes=require('./smsMessage.attributes');module[_0x5e1e('0x6')]=function(_0x52554e,_0xd16b56){return _0x52554e[_0x5e1e('0x7')](_0x5e1e('0x8'),attributes,{'tableName':_0x5e1e('0x9'),'paranoid':![],'indexes':[{'name':_0x5e1e('0xa'),'fields':[_0x5e1e('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x999ae5,_0x3799ff,_0x546ff7){var _0x31bf20=_0x52554e[_0x5e1e('0xb')];var _0xd48c5f=_0x999ae5['get']({'plain':!![]});if(_0xd48c5f[_0x5e1e('0xc')][_0x5e1e('0xd')]()==='in'||_0xd48c5f[_0x5e1e('0xc')][_0x5e1e('0xd')]()===_0x5e1e('0xe')&&!_0xd48c5f[_0x5e1e('0xf')]&&!_[_0x5e1e('0x10')](_0xd48c5f[_0x5e1e('0x11')])){_0x31bf20['SmsInteraction']['findOne']({'where':{'id':_0xd48c5f['SmsInteractionId']}})['then'](function(_0x21dcc7){if(_0x21dcc7){_0x21dcc7[_0x5e1e('0x12')]({'lastMsgAt':_0xd48c5f['createdAt'],'lastMsgDirection':_0xd48c5f[_0x5e1e('0xc')]['toLowerCase'](),'lastMsgBody':_0xd48c5f[_0x5e1e('0x13')]});}})['catch'](function(_0x333442){console[_0x5e1e('0x14')](_0x333442);});}if(_0xd48c5f[_0x5e1e('0xc')]==='out'&&!_0xd48c5f[_0x5e1e('0xf')]){var _0x560c84;_0x31bf20[_0x5e1e('0x15')]['find']({'where':{'id':_0xd48c5f[_0x5e1e('0x16')]},'raw':!![]})[_0x5e1e('0x17')](function(_0x25b368){_0x560c84=_0x25b368;if(_0x560c84&&_0x560c84[_0x5e1e('0x18')]){switch(_0x560c84['type']){case _0x5e1e('0x19'):var _0x55d4c6=require(_0x5e1e('0x19'));if(_0x560c84['accountSid']&&_0x560c84['authToken']&&_0x560c84['phone']){var _0x3ffd69=new _0x55d4c6(_0x560c84[_0x5e1e('0x1a')],_0x560c84[_0x5e1e('0x1b')]);_0x3ffd69[_0x5e1e('0x1c')][_0x5e1e('0x1d')]({'body':_0xd48c5f[_0x5e1e('0x13')],'to':_0xd48c5f[_0x5e1e('0x1e')],'from':_0x560c84['phone'],'statusCallback':_0x560c84[_0x5e1e('0x1f')]+'/api/sms/messages/'+_0xd48c5f['id']+'/status?token='+_0x560c84['token']})['then'](function(_0x69e194){if(_0x69e194[_0x5e1e('0x20')]){return _0x999ae5['update']({'messageId':_0x69e194[_0x5e1e('0x20')]});}})[_0x5e1e('0x21')](function(_0xe6253c){logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e1e('0x22'),_0x5e1e('0x19'),util[_0x5e1e('0x23')](_0xe6253c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e1e('0x24'),'afterCreate',_0x5e1e('0x19'),_0x5e1e('0x25'));}break;case _0x5e1e('0x26'):var _0x2e2fa5=_0x5e1e('0x27');if(_0x560c84[_0x5e1e('0x28')]&&_0x560c84[_0x5e1e('0x29')]){var _0x825f20={'recipient':[_0xd48c5f[_0x5e1e('0x1e')]],'message':_0xd48c5f['body'],'message_type':_0x560c84[_0x5e1e('0x2a')]};var _0x260812={'url':_0x2e2fa5+_0x5e1e('0x2b')+_0x560c84['username']+'&password='+_0x560c84[_0x5e1e('0x29')],'method':_0x5e1e('0x2c')};rp(_0x260812)[_0x5e1e('0x17')](function(_0x3737cd){var _0x54bad3=_0x3737cd['split'](';');var _0xb15350={'user_key':_0x54bad3[0x0],'session_key':_0x54bad3[0x1]};_0x260812={'url':_0x2e2fa5+_0x5e1e('0x2d'),'method':_0x5e1e('0x2e'),'headers':{'user_key':_0xb15350[_0x5e1e('0x2f')],'Session_key':_0xb15350[_0x5e1e('0x30')]},'json':!![],'body':_0x825f20};return rp(_0x260812);})[_0x5e1e('0x17')](function(_0xbbc234){if(_0xbbc234[_0x5e1e('0x31')]>=0x1){var _0x356b8c={'messageId':_0xbbc234[_0x5e1e('0x32')]};if(_0x560c84['smsMethod']!=='GP'||!_0x560c84['deliveryReport']){_0x356b8c[_0x5e1e('0x33')]=!![];}return _0x999ae5[_0x5e1e('0x12')](_0x356b8c);}else{return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x26'),util[_0x5e1e('0x23')](_0xbbc234,{'showHidden':![],'depth':null}));}})[_0x5e1e('0x21')](function(_0x1c4d1a){return logger['error'](_0x5e1e('0x24'),'afterCreate','skebby',util[_0x5e1e('0x23')](_0x1c4d1a,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e1e('0x22'),'skebby',_0x5e1e('0x34'));}break;case _0x5e1e('0x35'):if(_0x560c84[_0x5e1e('0x1b')]){var _0xb33899={'recipient':_0xd48c5f[_0x5e1e('0x1e')],'message':_0xd48c5f[_0x5e1e('0x13')],'sender':_0x560c84[_0x5e1e('0x36')]||_0x560c84[_0x5e1e('0x1e')],'authorization':_0x560c84[_0x5e1e('0x1b')]};var _0x3799ff={'method':'POST','uri':'https://smsapi.connectel.se/api/send/','body':_0xb33899,'json':!![]};rp(_0x3799ff)[_0x5e1e('0x17')](function(_0x20670a){var _0x4cfde2={'messageId':_0x20670a[_0x5e1e('0x37')]};if(!_0x560c84[_0x5e1e('0x38')]){_0x4cfde2[_0x5e1e('0x33')]=!![];}return _0x999ae5[_0x5e1e('0x12')](_0x4cfde2);})[_0x5e1e('0x21')](function(_0x3dd09f){logger['error'](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x35'),util['inspect'](_0x3dd09f,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),'afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case _0x5e1e('0x39'):if(_0x560c84[_0x5e1e('0x28')]&&_0x560c84['password']){var _0xb33899={'messages':[{'source':'xCALLY\x20Motion','to':_0xd48c5f['phone'],'body':_0xd48c5f[_0x5e1e('0x13')],'from':_0x560c84[_0x5e1e('0x36')]||_0x560c84['phone']}]};var _0x11dbe1=util[_0x5e1e('0x3a')]('%s:%s',_0x560c84[_0x5e1e('0x28')],_0x560c84[_0x5e1e('0x29')]);var _0x3799ff={'method':_0x5e1e('0x2e'),'uri':_0x5e1e('0x3b'),'body':_0xb33899,'headers':{'Authorization':util[_0x5e1e('0x3a')](_0x5e1e('0x3c'),new Buffer(_0x11dbe1)['toString'](_0x5e1e('0x3d')))},'json':!![]};rp(_0x3799ff)[_0x5e1e('0x17')](function(_0x3e34e4){if(_0x3e34e4[_0x5e1e('0x3e')]>=0xc8&&_0x3e34e4[_0x5e1e('0x3e')]<=0xce){if(_0x3e34e4[_0x5e1e('0x3f')]&&_0x3e34e4['data'][_0x5e1e('0x40')]>0x0){var _0x56e880=_[_0x5e1e('0x41')](_0x3e34e4[_0x5e1e('0x3f')][_0x5e1e('0x1c')]);var _0x5f353b={'messageId':_0x56e880[_0x5e1e('0x42')]};if(!_0x560c84[_0x5e1e('0x38')]){_0x5f353b['read']=!![];}return _0x999ae5[_0x5e1e('0x12')](_0x5f353b);}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x43'),util[_0x5e1e('0x23')](_0x3e34e4,{'showHidden':![],'depth':null}));}}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x43'),util[_0x5e1e('0x23')](_0x3e34e4,{'showHidden':![],'depth':null}));}})[_0x5e1e('0x21')](function(_0x59dd6b){logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x43'),util[_0x5e1e('0x23')](_0x59dd6b,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),'afterCreate','clickSend',_0x5e1e('0x34'));}break;case _0x5e1e('0x44'):if(_0x560c84[_0x5e1e('0x45')]&&_0x560c84['authToken']){var _0xb33899={'dst':_0xd48c5f[_0x5e1e('0x1e')],'text':_0xd48c5f[_0x5e1e('0x13')],'src':_0x560c84[_0x5e1e('0x36')]||_0x560c84[_0x5e1e('0x1e')],'url':_0x560c84['remote']+_0x5e1e('0x46')+_0xd48c5f['id']+'/status?token='+_0x560c84['token']};var _0x11dbe1=util['format'](_0x5e1e('0x47'),_0x560c84[_0x5e1e('0x45')],_0x560c84[_0x5e1e('0x1b')]);var _0x3799ff={'method':_0x5e1e('0x2e'),'uri':util[_0x5e1e('0x3a')](_0x5e1e('0x48'),_0x560c84[_0x5e1e('0x45')]),'body':_0xb33899,'headers':{'Authorization':util[_0x5e1e('0x3a')]('Basic\x20%s',new Buffer(_0x11dbe1)['toString'](_0x5e1e('0x3d')))},'json':!![]};rp(_0x3799ff)[_0x5e1e('0x17')](function(_0x1f42fc){var _0x53eb83={'messageId':_0x1f42fc[_0x5e1e('0x49')][0x0]};return _0x999ae5['update'](_0x53eb83);})[_0x5e1e('0x21')](function(_0x803328){logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util['inspect'](_0x803328,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),'plivo',_0x5e1e('0x4a'));}break;case _0x5e1e('0x4b'):if(_0x560c84[_0x5e1e('0x28')]&&_0x560c84[_0x5e1e('0x29')]){if(_0x560c84[_0x5e1e('0x4c')]){var _0x5afe90={'method':_0x5e1e('0x2e'),'uri':_0x560c84[_0x5e1e('0x4c')]+_0x5e1e('0x4d'),'body':{'username':_0x560c84['username'],'password':_0x560c84[_0x5e1e('0x29')]},'json':!![]};return rp(_0x5afe90)[_0x5e1e('0x17')](function(_0xd01011){var _0x20f6f3={'method':_0x5e1e('0x2e'),'uri':_0x560c84[_0x5e1e('0x4c')]+_0x5e1e('0x4e'),'body':{'messages':[{'from':_0x560c84[_0x5e1e('0x1e')],'destinations':[{'to':_0xd48c5f[_0x5e1e('0x1e')]}],'text':_0xd48c5f[_0x5e1e('0x13')],'notifyUrl':_0x560c84[_0x5e1e('0x1f')]+_0x5e1e('0x46')+_0xd48c5f['id']+_0x5e1e('0x4f')+_0x560c84[_0x5e1e('0x50')],'notifyContentType':_0x5e1e('0x51'),'callbackData':_0x560c84['phone']+';'+_0xd48c5f[_0x5e1e('0x13')]}]},'headers':{'Authorization':_0x5e1e('0x52')+_0xd01011[_0x5e1e('0x50')]},'json':!![]};return rp(_0x20f6f3)[_0x5e1e('0x17')](function(_0x11db33){if(_0x11db33[_0x5e1e('0x1c')]){var _0x5b523b={'messageId':_0x11db33[_0x5e1e('0x1c')][0x0][_0x5e1e('0xa')]};if(!_0x560c84[_0x5e1e('0x38')]){_0x5b523b[_0x5e1e('0x33')]=!![];}return _0x999ae5['update'](_0x5b523b);}else{return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x4b'),util['inspect'](_0x11db33,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x3db91f){return logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e1e('0x22'),'infobip',util[_0x5e1e('0x23')](_0x3db91f,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e1e('0x22'),_0x5e1e('0x4b'),_0x5e1e('0x53'));}}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x4b'),_0x5e1e('0x34'));}break;case _0x5e1e('0x54'):var _0x1a78b6=require(_0x5e1e('0x55'));if(_0x560c84[_0x5e1e('0x56')]){var _0x224925={};_0x224925[_0x5e1e('0x57')]=_0x560c84[_0x5e1e('0x28')];_0x224925['phone']=_0xd48c5f[_0x5e1e('0x1e')];_0x224925[_0x5e1e('0x58')]=_0x560c84['phone'];_0x224925[_0x5e1e('0x59')]=_0xd48c5f[_0x5e1e('0x13')];_0x224925[_0x5e1e('0x5a')]=+new Date();var _0x228033='';var _0x44c27a='';var _0x47cc5e=Object[_0x5e1e('0x5b')](_0x224925);_0x47cc5e['sort']();for(var _0x26912c=0x0;_0x26912c<_0x47cc5e['length'];_0x26912c++){if(_0x228033!=''){_0x228033+='&';}_0x228033+=_0x47cc5e[_0x26912c]+'='+encodeURIComponent(_0x224925[_0x47cc5e[_0x26912c]]);_0x44c27a+=_0x224925[_0x47cc5e[_0x26912c]];}_0x44c27a+=_0x560c84[_0x5e1e('0x56')];_0x44c27a=_0x1a78b6[_0x5e1e('0x5c')]('md5')[_0x5e1e('0x12')](_0x44c27a)[_0x5e1e('0x5d')](_0x5e1e('0x5e'));if(_0x228033!==''){_0x228033+='&';}_0x228033+=_0x5e1e('0x5f')+_0x44c27a;var _0x260812={'method':_0x5e1e('0x2c'),'uri':_0x5e1e('0x60')+_0x228033,'json':!![]};return rp(_0x260812)['then'](function(_0x414db8){var _0x2f5675=Object[_0x5e1e('0x5b')](_0x414db8);if(_0x414db8[_0x2f5675[0x0]][_0x5e1e('0x14')]&&parseInt(_0x414db8[_0x2f5675[0x0]][_0x5e1e('0x14')])===0x0){var _0x36eb27={'messageId':_0x414db8[_0x2f5675[0x0]][_0x5e1e('0x61')]};if(!_0x560c84[_0x5e1e('0x38')]){_0x36eb27['read']=!![];}return _0x999ae5[_0x5e1e('0x12')](_0x36eb27);}else{return logger[_0x5e1e('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e1e('0x22'),'csc',util[_0x5e1e('0x23')](_0x414db8['error'],{'showHidden':![],'depth':null}));}})[_0x5e1e('0x21')](function(_0x5cb4a8){return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x54'),util['inspect'](_0x5cb4a8,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x54'),_0x5e1e('0x62'));}break;case'clickatell':if(_0x560c84['apiKey']){var _0x2176a5={'method':_0x5e1e('0x2e'),'uri':_0x5e1e('0x63'),'headers':{'Authorization':_0x560c84['apiKey']},'body':{'content':_0xd48c5f[_0x5e1e('0x13')],'to':[_0xd48c5f[_0x5e1e('0x1e')]],'from':_0x560c84[_0x5e1e('0x1e')],'binary':![],'clientMessageId':_0x5e1e('0x64'),'charset':_0x5e1e('0x65')},'json':!![]};rp(_0x2176a5)[_0x5e1e('0x17')](function(_0x22ba8e){if(!_0x22ba8e[_0x5e1e('0x14')]){var _0x4fa8cb={'messageId':_0x22ba8e['messages'][0x0]['apiMessageId']};if(!_0x560c84[_0x5e1e('0x38')]){_0x4fa8cb[_0x5e1e('0x33')]=!![];}return _0x999ae5[_0x5e1e('0x12')](_0x4fa8cb);}else{return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x66'),util[_0x5e1e('0x23')](_0x22ba8e[_0x5e1e('0x14')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x33c2e9){return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),'clickatell',util['inspect'](_0x33c2e9,{'showHidden':![],'depth':null}));});}else{logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x5e1e('0x67'):if(_0x560c84[_0x5e1e('0x56')]){var _0x4984d3={};var _0x260812={'method':_0x5e1e('0x2e'),'uri':_0x5e1e('0x68'),'headers':{'Authorization':_0x5e1e('0x69')+_0x560c84[_0x5e1e('0x56')],'Content-Type':_0x5e1e('0x51')},'body':{'from':_0x560c84[_0x5e1e('0x1e')],'to':_0xd48c5f[_0x5e1e('0x1e')],'text':_0xd48c5f['body']},'json':!![]};return rp(_0x260812)[_0x5e1e('0x17')](function(_0x38596b){if(_0x38596b[_0x5e1e('0x6a')]==0xca){_0x4984d3[_0x5e1e('0x6b')]=_0x38596b;var _0xa4a089={'method':_0x5e1e('0x2e'),'uri':_0x5e1e('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x560c84['apiKey'],'Content-Type':_0x5e1e('0x51')},'body':{'refid':_0x4984d3['message']['refid']},'json':!![]};return rp(_0xa4a089)[_0x5e1e('0x17')](function(_0x386ee9){_0x4984d3[_0x5e1e('0x6d')]=_0x386ee9;var _0x16d916={'messageId':_0x4984d3[_0x5e1e('0x6b')][_0x5e1e('0x6e')],'read':!![]};return _0x999ae5['update'](_0x16d916);});}else{return logger['error'](_0x5e1e('0x24'),_0x5e1e('0x22'),_0x5e1e('0x67'),util['inspect'](_0x38596b,{'showHidden':![],'depth':null}));}})[_0x5e1e('0x21')](function(_0x30bd08){return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),'intelepeer',util[_0x5e1e('0x23')](_0x30bd08,{'showHidden':![],'depth':null}));});}else{return logger[_0x5e1e('0x14')](_0x5e1e('0x24'),_0x5e1e('0x22'),'intelepeer',_0x5e1e('0x6f'));}break;}}})[_0x5e1e('0x70')](function(){_0x546ff7();});}else{_0x546ff7();}}},'charset':'utf8mb4','collate':_0x5e1e('0x71')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ca317a0..a2789bc 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 _0xc0a6=['stringify','error','code','message','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x48e690,_0x5e0b47){var _0x4eb7b0=function(_0x4c5182){while(--_0x4c5182){_0x48e690['push'](_0x48e690['shift']());}};_0x4eb7b0(++_0x5e0b47);}(_0xc0a6,0x1db));var _0x6c0a=function(_0x2f4ac4,_0x1a14e3){_0x2f4ac4=_0x2f4ac4-0x0;var _0x26cf81=_0xc0a6[_0x2f4ac4];return _0x26cf81;};'use strict';var _=require(_0x6c0a('0x0'));var util=require(_0x6c0a('0x1'));var moment=require(_0x6c0a('0x2'));var BPromise=require(_0x6c0a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c0a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c0a('0x5'));var logger=require('../../config/logger')(_0x6c0a('0x6'));var config=require(_0x6c0a('0x7'));var jayson=require(_0x6c0a('0x8'));var client=jayson[_0x6c0a('0x9')][_0x6c0a('0xa')]({'port':0x232a});config[_0x6c0a('0xb')]=_[_0x6c0a('0xc')](config[_0x6c0a('0xb')],{'host':_0x6c0a('0xd'),'port':0x18eb});var socket=require(_0x6c0a('0xe'))(new Redis(config[_0x6c0a('0xb')]));require(_0x6c0a('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ab038,_0xe13221,_0x65e094){return new BPromise(function(_0x30ee8e,_0x592f1c){return client['request'](_0x2ab038,_0x65e094)['then'](function(_0x4b081a){logger['info'](_0x6c0a('0x10'),_0xe13221,_0x6c0a('0x11'));logger[_0x6c0a('0x12')](_0x6c0a('0x13'),_0xe13221,'request\x20sent',JSON[_0x6c0a('0x14')](_0x4b081a));if(_0x4b081a[_0x6c0a('0x15')]){if(_0x4b081a['error'][_0x6c0a('0x16')]===0x1f4){logger['error'](_0x6c0a('0x10'),_0xe13221,_0x4b081a[_0x6c0a('0x15')][_0x6c0a('0x17')]);return _0x592f1c(_0x4b081a[_0x6c0a('0x15')][_0x6c0a('0x17')]);}logger[_0x6c0a('0x15')](_0x6c0a('0x10'),_0xe13221,_0x4b081a[_0x6c0a('0x15')][_0x6c0a('0x17')]);return _0x30ee8e(_0x4b081a['error'][_0x6c0a('0x17')]);}else{logger[_0x6c0a('0x18')](_0x6c0a('0x10'),_0xe13221,'request\x20sent');_0x30ee8e(_0x4b081a['result'][_0x6c0a('0x17')]);}})[_0x6c0a('0x19')](function(_0x44f667){logger['error'](_0x6c0a('0x10'),_0xe13221,_0x44f667);_0x592f1c(_0x44f667);});});}exports[_0x6c0a('0x1a')]=function(_0xecab5f){var _0x49b418=this;return new Promise(function(_0x59cd3c,_0x4791f2){return db[_0x6c0a('0x1b')][_0x6c0a('0x1c')](_0xecab5f[_0x6c0a('0x1d')],{'raw':_0xecab5f['options']?_0xecab5f[_0x6c0a('0x1e')][_0x6c0a('0x1f')]===undefined?!![]:![]:!![]})[_0x6c0a('0x20')](function(_0x2906c9){logger[_0x6c0a('0x18')](_0x6c0a('0x1a'),_0xecab5f);logger[_0x6c0a('0x12')](_0x6c0a('0x1a'),_0xecab5f,JSON['stringify'](_0x2906c9));_0x59cd3c(_0x2906c9);})[_0x6c0a('0x19')](function(_0x1925fe){logger[_0x6c0a('0x15')](_0x6c0a('0x1a'),_0x1925fe[_0x6c0a('0x17')],_0xecab5f);_0x4791f2(_0x49b418['error'](0x1f4,_0x1925fe['message']));});});}; \ No newline at end of file +var _0x08e9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','info','result','message','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment'];(function(_0x11f01d,_0x98f0a3){var _0xbb6c48=function(_0x528ab4){while(--_0x528ab4){_0x11f01d['push'](_0x11f01d['shift']());}};_0xbb6c48(++_0x98f0a3);}(_0x08e9,0x1b7));var _0x908e=function(_0x2e5179,_0x150b7b){_0x2e5179=_0x2e5179-0x0;var _0x41fbb7=_0x08e9[_0x2e5179];return _0x41fbb7;};'use strict';var _=require(_0x908e('0x0'));var util=require(_0x908e('0x1'));var moment=require(_0x908e('0x2'));var BPromise=require('bluebird');var rs=require(_0x908e('0x3'));var fs=require('fs');var Redis=require(_0x908e('0x4'));var db=require(_0x908e('0x5'))['db'];var utils=require(_0x908e('0x6'));var logger=require(_0x908e('0x7'))('rpc');var config=require(_0x908e('0x8'));var jayson=require(_0x908e('0x9'));var client=jayson['client'][_0x908e('0xa')]({'port':0x232a});config[_0x908e('0xb')]=_[_0x908e('0xc')](config[_0x908e('0xb')],{'host':_0x908e('0xd'),'port':0x18eb});var socket=require(_0x908e('0xe'))(new Redis(config['redis']));require(_0x908e('0xf'))[_0x908e('0x10')](socket);function respondWithRpcPromise(_0x2267c8,_0x46c563,_0x3536c0){return new BPromise(function(_0x4f3fd0,_0x115661){return client[_0x908e('0x11')](_0x2267c8,_0x3536c0)[_0x908e('0x12')](function(_0x20f106){logger['info']('SmsMessage,\x20%s,\x20%s',_0x46c563,_0x908e('0x13'));logger[_0x908e('0x14')](_0x908e('0x15'),_0x46c563,_0x908e('0x13'),JSON[_0x908e('0x16')](_0x20f106));if(_0x20f106[_0x908e('0x17')]){if(_0x20f106[_0x908e('0x17')]['code']===0x1f4){logger['error'](_0x908e('0x18'),_0x46c563,_0x20f106[_0x908e('0x17')]['message']);return _0x115661(_0x20f106['error']['message']);}logger[_0x908e('0x17')]('SmsMessage,\x20%s,\x20%s',_0x46c563,_0x20f106[_0x908e('0x17')]['message']);return _0x4f3fd0(_0x20f106[_0x908e('0x17')]['message']);}else{logger[_0x908e('0x19')](_0x908e('0x18'),_0x46c563,_0x908e('0x13'));_0x4f3fd0(_0x20f106[_0x908e('0x1a')][_0x908e('0x1b')]);}})['catch'](function(_0x53ad6f){logger[_0x908e('0x17')]('SmsMessage,\x20%s,\x20%s',_0x46c563,_0x53ad6f);_0x115661(_0x53ad6f);});});}exports[_0x908e('0x1c')]=function(_0x52e9d9){var _0x21e205=this;return new Promise(function(_0x31c094,_0x4dba70){return db[_0x908e('0x1d')][_0x908e('0x1e')](_0x52e9d9[_0x908e('0x1f')],{'raw':_0x52e9d9[_0x908e('0x20')]?_0x52e9d9[_0x908e('0x20')][_0x908e('0x21')]===undefined?!![]:![]:!![]})[_0x908e('0x12')](function(_0x317eb4){logger[_0x908e('0x19')](_0x908e('0x1c'),_0x52e9d9);logger[_0x908e('0x14')]('CreateSmsMessage',_0x52e9d9,JSON['stringify'](_0x317eb4));_0x31c094(_0x317eb4);})['catch'](function(_0x16ddd9){logger[_0x908e('0x17')](_0x908e('0x1c'),_0x16ddd9['message'],_0x52e9d9);_0x4dba70(_0x21e205[_0x908e('0x17')](0x1f4,_0x16ddd9[_0x908e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 7a8fa8c..416c3ec 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 _0x4729=['removeListener','length','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x4729,0xeb));var _0x9472=function(_0x5d9cd3,_0x118a54){_0x5d9cd3=_0x5d9cd3-0x0;var _0x5e6b0c=_0x4729[_0x5d9cd3];return _0x5e6b0c;};'use strict';var SmsMessageEvents=require(_0x9472('0x0'));var events=[_0x9472('0x1'),_0x9472('0x2'),_0x9472('0x3')];function createListener(_0x44188e,_0x254363){return function(_0x550b8d){_0x254363[_0x9472('0x4')](_0x44188e,_0x550b8d);};}function removeListener(_0x2211dd,_0x2aac6a){return function(){SmsMessageEvents[_0x9472('0x5')](_0x2211dd,_0x2aac6a);};}exports['register']=function(_0x28d0f3){for(var _0x4355d2=0x0,_0xcce5a7=events[_0x9472('0x6')];_0x4355d2<_0xcce5a7;_0x4355d2++){var _0x157639=events[_0x4355d2];var _0x219fd6=createListener(_0x9472('0x7')+_0x157639,_0x28d0f3);SmsMessageEvents['on'](_0x157639,_0x219fd6);}}; \ No newline at end of file +var _0xccb3=['update','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x21d831,_0x3dcdea){var _0x154c3f=function(_0x56eb77){while(--_0x56eb77){_0x21d831['push'](_0x21d831['shift']());}};_0x154c3f(++_0x3dcdea);}(_0xccb3,0x1ef));var _0x3ccb=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xccb3[_0x1fdb40];return _0x281f93;};'use strict';var SmsMessageEvents=require(_0x3ccb('0x0'));var events=['save',_0x3ccb('0x1'),_0x3ccb('0x2')];function createListener(_0x199624,_0x25443e){return function(_0x231467){_0x25443e['emit'](_0x199624,_0x231467);};}function removeListener(_0x421d42,_0x16d23d){return function(){SmsMessageEvents[_0x3ccb('0x3')](_0x421d42,_0x16d23d);};}exports[_0x3ccb('0x4')]=function(_0x4fe9fb){for(var _0x4630e4=0x0,_0x5ae21c=events[_0x3ccb('0x5')];_0x4630e4<_0x5ae21c;_0x4630e4++){var _0x30b277=events[_0x4630e4];var _0x5e25a2=createListener(_0x3ccb('0x6')+_0x30b277,_0x4fe9fb);SmsMessageEvents['on'](_0x30b277,_0x5e25a2);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 401ed54..32a1243 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 _0x34f8=['isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x34f8,0x121));var _0x834f=function(_0x2cd58b,_0x59bcfd){_0x2cd58b=_0x2cd58b-0x0;var _0x2b7715=_0x34f8[_0x2cd58b];return _0x2b7715;};'use strict';var multer=require('multer');var util=require(_0x834f('0x0'));var path=require(_0x834f('0x1'));var timeout=require(_0x834f('0x2'));var express=require('express');var router=express[_0x834f('0x3')]();var auth=require(_0x834f('0x4'));var interaction=require(_0x834f('0x5'));var config=require('../../config/environment');var controller=require(_0x834f('0x6'));router[_0x834f('0x7')]('/',auth[_0x834f('0x8')](),controller[_0x834f('0x9')]);router[_0x834f('0x7')]('/describe',auth[_0x834f('0x8')](),controller[_0x834f('0xa')]);router[_0x834f('0x7')](_0x834f('0xb'),auth[_0x834f('0x8')](),controller[_0x834f('0xc')]);router[_0x834f('0x7')](_0x834f('0xd'),auth[_0x834f('0x8')](),controller[_0x834f('0xe')]);router['get'](_0x834f('0xf'),auth['isAuthenticated'](),controller[_0x834f('0x10')]);router[_0x834f('0x7')](_0x834f('0x11'),auth[_0x834f('0x8')](),controller[_0x834f('0x12')]);router[_0x834f('0x13')]('/',auth[_0x834f('0x8')](),controller['create']);router[_0x834f('0x13')](_0x834f('0xf'),auth['isAuthenticated'](),controller[_0x834f('0x14')]);router[_0x834f('0x13')](_0x834f('0x11'),auth[_0x834f('0x8')](),controller[_0x834f('0x15')]);router[_0x834f('0x16')](_0x834f('0xb'),auth[_0x834f('0x8')](),controller[_0x834f('0x17')]);router[_0x834f('0x18')](_0x834f('0xb'),auth[_0x834f('0x8')](),controller['destroy']);router[_0x834f('0x18')](_0x834f('0xf'),auth[_0x834f('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x834f('0x8')](),controller[_0x834f('0x19')]);module[_0x834f('0x1a')]=router; \ No newline at end of file +var _0x6e1a=['get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller'];(function(_0x12ceba,_0x59ba15){var _0x36c243=function(_0x4f44c9){while(--_0x4f44c9){_0x12ceba['push'](_0x12ceba['shift']());}};_0x36c243(++_0x59ba15);}(_0x6e1a,0x12b));var _0xa6e1=function(_0x3601be,_0x2ed4b2){_0x3601be=_0x3601be-0x0;var _0x3dd521=_0x6e1a[_0x3601be];return _0x3dd521;};'use strict';var multer=require(_0xa6e1('0x0'));var util=require(_0xa6e1('0x1'));var path=require(_0xa6e1('0x2'));var timeout=require(_0xa6e1('0x3'));var express=require(_0xa6e1('0x4'));var router=express[_0xa6e1('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa6e1('0x6'));var config=require(_0xa6e1('0x7'));var controller=require(_0xa6e1('0x8'));router[_0xa6e1('0x9')]('/',auth[_0xa6e1('0xa')](),controller[_0xa6e1('0xb')]);router['get'](_0xa6e1('0xc'),auth[_0xa6e1('0xa')](),controller['describe']);router[_0xa6e1('0x9')](_0xa6e1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa6e1('0x9')](_0xa6e1('0xe'),auth['isAuthenticated'](),controller[_0xa6e1('0xf')]);router[_0xa6e1('0x9')](_0xa6e1('0x10'),auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x11')]);router[_0xa6e1('0x9')]('/:id/users',auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x12')]);router[_0xa6e1('0x13')]('/',auth[_0xa6e1('0xa')](),controller['create']);router[_0xa6e1('0x13')](_0xa6e1('0x10'),auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x14')]);router[_0xa6e1('0x13')](_0xa6e1('0x15'),auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x16')]);router[_0xa6e1('0x17')](_0xa6e1('0xd'),auth['isAuthenticated'](),controller[_0xa6e1('0x18')]);router[_0xa6e1('0x19')](_0xa6e1('0xd'),auth[_0xa6e1('0xa')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x1a')]);router[_0xa6e1('0x19')](_0xa6e1('0x15'),auth[_0xa6e1('0xa')](),controller[_0xa6e1('0x1b')]);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 ac54e10..984560e 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 _0x153b=['name','INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x153b,0x107));var _0xb153=function(_0x2d0883,_0x3912f3){_0x2d0883=_0x2d0883-0x0;var _0x29562c=_0x153b[_0x2d0883];return _0x29562c;};'use strict';var Sequelize=require(_0xb153('0x0'));module[_0xb153('0x1')]={'name':{'type':Sequelize[_0xb153('0x2')],'unique':_0xb153('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb153('0x2')]},'timeout':{'type':Sequelize[_0xb153('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb153('0x5'),_0xb153('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x9b69=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x563d77,_0x305794){var _0x24cfdf=function(_0x2ed7bc){while(--_0x2ed7bc){_0x563d77['push'](_0x563d77['shift']());}};_0x24cfdf(++_0x305794);}(_0x9b69,0x183));var _0x99b6=function(_0x285bbb,_0x398d20){_0x285bbb=_0x285bbb-0x0;var _0x5dab24=_0x9b69[_0x285bbb];return _0x5dab24;};'use strict';var Sequelize=require(_0x99b6('0x0'));module[_0x99b6('0x1')]={'name':{'type':Sequelize[_0x99b6('0x2')],'unique':_0x99b6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x99b6('0x2')]},'timeout':{'type':Sequelize[_0x99b6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x99b6('0x5')](_0x99b6('0x6'),'beepall',_0x99b6('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 635178a..4d8c190 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 _0x92bf=['sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','SmsQueues','UserProfileResource','end','error','stack','send','SmsQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','union','addAgents','penalty','removeTeams','removeAgents','omit','spread','emit','isArray','userSmsQueue:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','register'];(function(_0x584386,_0x47bab7){var _0x1061d5=function(_0xf17420){while(--_0xf17420){_0x584386['push'](_0x584386['shift']());}};_0x1061d5(++_0x47bab7);}(_0x92bf,0xca));var _0xf92b=function(_0x2514e0,_0x5a8f08){_0x2514e0=_0x2514e0-0x0;var _0x2abb72=_0x92bf[_0x2514e0];return _0x2abb72;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf92b('0x0'));var rimraf=require(_0xf92b('0x1'));var zipdir=require(_0xf92b('0x2'));var jsonpatch=require(_0xf92b('0x3'));var rp=require(_0xf92b('0x4'));var moment=require(_0xf92b('0x5'));var BPromise=require(_0xf92b('0x6'));var Mustache=require(_0xf92b('0x7'));var util=require(_0xf92b('0x8'));var path=require(_0xf92b('0x9'));var sox=require(_0xf92b('0xa'));var csv=require(_0xf92b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf92b('0xc'));var jsforce=require(_0xf92b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf92b('0xb'));var querystring=require(_0xf92b('0xe'));var Papa=require(_0xf92b('0xf'));var authService=require(_0xf92b('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xf92b('0x11'));var logger=require(_0xf92b('0x12'))(_0xf92b('0x13'));var utils=require(_0xf92b('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf92b('0x15')]=_['defaults'](config[_0xf92b('0x15')],{'host':_0xf92b('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0xf92b('0x17')](socket);function respondWithStatusCode(_0xd56fb0,_0x1add6a){_0x1add6a=_0x1add6a||0xcc;return function(_0x411b02){if(_0x411b02){return _0xd56fb0[_0xf92b('0x18')](_0x1add6a);}return _0xd56fb0['status'](_0x1add6a)['end']();};}function respondWithResult(_0x294b0c,_0x1bca09){_0x1bca09=_0x1bca09||0xc8;return function(_0x1a479a){if(_0x1a479a){return _0x294b0c[_0xf92b('0x19')](_0x1bca09)[_0xf92b('0x1a')](_0x1a479a);}};}function respondWithFilteredResult(_0x2890c0,_0x4ff86c){return function(_0x94ab51){if(_0x94ab51){var _0x5a61a5=_0x94ab51[_0xf92b('0x1b')],_0x25bfea=_0x4ff86c['offset'],_0x2cc28d=_0x4ff86c[_0xf92b('0x1c')]+_0x4ff86c[_0xf92b('0x1d')],_0x16c08d;if(_0x2cc28d>=_0x5a61a5){_0x2cc28d=_0x5a61a5;_0x16c08d=0xc8;}else{_0x16c08d=0xce;}_0x2890c0[_0xf92b('0x19')](_0x16c08d);return _0x2890c0['set'](_0xf92b('0x1e'),_0x25bfea+'-'+_0x2cc28d+'/'+_0x5a61a5)['json'](_0x94ab51);}return null;};}function patchUpdates(_0x311938){return function(_0x5da030){try{jsonpatch[_0xf92b('0x1f')](_0x5da030,_0x311938,!![]);}catch(_0x20ed6c){return BPromise[_0xf92b('0x20')](_0x20ed6c);}return _0x5da030[_0xf92b('0x21')]();};}function saveUpdates(_0x3b01d1,_0x4abb88){return function(_0x3f450d){if(_0x3f450d){return _0x3f450d['update'](_0x3b01d1)['then'](function(_0x4de97a){return _0x4de97a;});}return null;};}function removeEntity(_0x24cc52,_0x4f0f09){return function(_0x5cb1f6){if(_0x5cb1f6){return _0x5cb1f6[_0xf92b('0x22')]()[_0xf92b('0x23')](function(){var _0x5333d3=_0x5cb1f6['get']({'plain':!![]});var _0x1772cf=_0xf92b('0x24');return db[_0xf92b('0x25')][_0xf92b('0x22')]({'where':{'type':_0x1772cf,'resourceId':_0x5333d3['id']}})[_0xf92b('0x23')](function(){return _0x5cb1f6;});})['then'](function(){_0x24cc52['status'](0xcc)[_0xf92b('0x26')]();});}};}function handleEntityNotFound(_0xbcbd11,_0x51c758){return function(_0x32971e){if(!_0x32971e){_0xbcbd11['sendStatus'](0x194);}return _0x32971e;};}function handleError(_0x22d3e0,_0x59b41f){_0x59b41f=_0x59b41f||0x1f4;return function(_0x40f0fc){logger[_0xf92b('0x27')](_0x40f0fc[_0xf92b('0x28')]);if(_0x40f0fc['name']){delete _0x40f0fc['name'];}_0x22d3e0[_0xf92b('0x19')](_0x59b41f)[_0xf92b('0x29')](_0x40f0fc);};}exports['index']=function(_0x4314e2,_0x4050ff){var _0x50b8ad={},_0x1d8685={},_0x536dc7={'count':0x0,'rows':[]};var _0x37a0c5=db[_0xf92b('0x2a')][_0xf92b('0x2b')];_0x1d8685[_0xf92b('0x2c')]=_[_0xf92b('0x2d')](_0x37a0c5);_0x1d8685[_0xf92b('0x2e')]=_[_0xf92b('0x2d')](_0x4314e2['query']);_0x1d8685[_0xf92b('0x2f')]=_['intersection'](_0x1d8685['model'],_0x1d8685[_0xf92b('0x2e')]);_0x50b8ad[_0xf92b('0x30')]=_[_0xf92b('0x31')](_0x1d8685[_0xf92b('0x2c')],qs[_0xf92b('0x32')](_0x4314e2[_0xf92b('0x2e')][_0xf92b('0x32')]));_0x50b8ad[_0xf92b('0x30')]=_0x50b8ad[_0xf92b('0x30')][_0xf92b('0x33')]?_0x50b8ad[_0xf92b('0x30')]:_0x1d8685['model'];if(!_0x4314e2[_0xf92b('0x2e')][_0xf92b('0x34')]('nolimit')){_0x50b8ad[_0xf92b('0x1d')]=qs[_0xf92b('0x1d')](_0x4314e2[_0xf92b('0x2e')]['limit']);_0x50b8ad[_0xf92b('0x1c')]=qs['offset'](_0x4314e2[_0xf92b('0x2e')][_0xf92b('0x1c')]);}_0x50b8ad[_0xf92b('0x35')]=qs[_0xf92b('0x36')](_0x4314e2[_0xf92b('0x2e')][_0xf92b('0x36')]);_0x50b8ad[_0xf92b('0x37')]=qs[_0xf92b('0x2f')](_[_0xf92b('0x38')](_0x4314e2[_0xf92b('0x2e')],_0x1d8685[_0xf92b('0x2f')]));if(_0x4314e2['query'][_0xf92b('0x39')]){_0x50b8ad[_0xf92b('0x37')]=_[_0xf92b('0x3a')](_0x50b8ad[_0xf92b('0x37')],{'$or':_[_0xf92b('0x3b')](_0x37a0c5,function(_0x39ac33){if(_0x39ac33['type'][_0xf92b('0x3c')]!=='VIRTUAL'){var _0x49fb1f={};_0x49fb1f[_0x39ac33[_0xf92b('0x3d')]]={'$like':'%'+_0x4314e2[_0xf92b('0x2e')][_0xf92b('0x39')]+'%'};return _0x49fb1f;}})});}_0x50b8ad=_['merge']({},_0x50b8ad,_0x4314e2['options']);var _0x286c52={'where':_0x50b8ad['where']};return db[_0xf92b('0x2a')][_0xf92b('0x1b')](_0x286c52)[_0xf92b('0x23')](function(_0x1db844){_0x536dc7[_0xf92b('0x1b')]=_0x1db844;if(_0x4314e2['query'][_0xf92b('0x3e')]){_0x50b8ad[_0xf92b('0x3f')]=[{'all':!![]}];}return db[_0xf92b('0x2a')][_0xf92b('0x40')](_0x50b8ad);})['then'](function(_0x33ae39){_0x536dc7[_0xf92b('0x41')]=_0x33ae39;return _0x536dc7;})['then'](respondWithFilteredResult(_0x4050ff,_0x50b8ad))[_0xf92b('0x42')](handleError(_0x4050ff,null));};exports[_0xf92b('0x43')]=function(_0x24be4e,_0x59870a){var _0x21812a={'raw':!![],'where':{'id':_0x24be4e[_0xf92b('0x44')]['id']}},_0x512d12={};_0x512d12[_0xf92b('0x2c')]=_['keys'](db[_0xf92b('0x2a')][_0xf92b('0x2b')]);_0x512d12[_0xf92b('0x2e')]=_['keys'](_0x24be4e[_0xf92b('0x2e')]);_0x512d12[_0xf92b('0x2f')]=_[_0xf92b('0x31')](_0x512d12[_0xf92b('0x2c')],_0x512d12['query']);_0x21812a[_0xf92b('0x30')]=_['intersection'](_0x512d12[_0xf92b('0x2c')],qs[_0xf92b('0x32')](_0x24be4e['query'][_0xf92b('0x32')]));_0x21812a[_0xf92b('0x30')]=_0x21812a[_0xf92b('0x30')][_0xf92b('0x33')]?_0x21812a[_0xf92b('0x30')]:_0x512d12['model'];if(_0x24be4e[_0xf92b('0x2e')][_0xf92b('0x3e')]){_0x21812a[_0xf92b('0x3f')]=[{'all':!![]}];}_0x21812a=_[_0xf92b('0x3a')]({},_0x21812a,_0x24be4e[_0xf92b('0x45')]);return db[_0xf92b('0x2a')][_0xf92b('0x46')](_0x21812a)['then'](handleEntityNotFound(_0x59870a,null))[_0xf92b('0x23')](respondWithResult(_0x59870a,null))['catch'](handleError(_0x59870a,null));};exports[_0xf92b('0x47')]=function(_0x3ea176,_0x1120f2){return db['SmsQueue'][_0xf92b('0x47')](_0x3ea176[_0xf92b('0x48')],{})['then'](function(_0x1d3b89){var _0x178a28=_0x3ea176[_0xf92b('0x49')]['get']({'plain':!![]});if(!_0x178a28)throw new Error(_0xf92b('0x4a'));if(_0x178a28[_0xf92b('0x4b')]===_0xf92b('0x49')){var _0x2868e3=_0x1d3b89[_0xf92b('0x4c')]({'plain':!![]});var _0x355cfe=_0xf92b('0x24');return db[_0xf92b('0x4d')]['find']({'where':{'name':_0x355cfe,'userProfileId':_0x178a28[_0xf92b('0x4e')]},'raw':!![]})['then'](function(_0x36a5b6){if(_0x36a5b6&&_0x36a5b6['autoAssociation']===0x0){return db[_0xf92b('0x25')]['create']({'name':_0x2868e3[_0xf92b('0x4f')],'resourceId':_0x2868e3['id'],'type':_0x36a5b6['name'],'sectionId':_0x36a5b6['id']},{})[_0xf92b('0x23')](function(){return _0x1d3b89;});}else{return _0x1d3b89;}})['catch'](function(_0x1e21d6){logger[_0xf92b('0x27')](_0xf92b('0x50'),_0x1e21d6);throw _0x1e21d6;});}return _0x1d3b89;})[_0xf92b('0x23')](respondWithResult(_0x1120f2,0xc9))[_0xf92b('0x42')](handleError(_0x1120f2,null));};exports[_0xf92b('0x51')]=function(_0xd1f745,_0x147604){if(_0xd1f745[_0xf92b('0x48')]['id']){delete _0xd1f745[_0xf92b('0x48')]['id'];}return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0xd1f745[_0xf92b('0x44')]['id']}})['then'](handleEntityNotFound(_0x147604,null))[_0xf92b('0x23')](saveUpdates(_0xd1f745[_0xf92b('0x48')],null))[_0xf92b('0x23')](respondWithResult(_0x147604,null))[_0xf92b('0x42')](handleError(_0x147604,null));};exports[_0xf92b('0x22')]=function(_0x3ecc07,_0x597ef4){return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0x3ecc07['params']['id']}})[_0xf92b('0x23')](handleEntityNotFound(_0x597ef4,null))[_0xf92b('0x23')](removeEntity(_0x597ef4,null))[_0xf92b('0x42')](handleError(_0x597ef4,null));};exports[_0xf92b('0x52')]=function(_0x4278a3,_0x36da95){return db[_0xf92b('0x2a')][_0xf92b('0x52')]()[_0xf92b('0x23')](respondWithResult(_0x36da95,null))[_0xf92b('0x42')](handleError(_0x36da95,null));};exports[_0xf92b('0x53')]=function(_0x29b901,_0x5e5950,_0x1e3b89){var _0x460cf2={'raw':!![],'where':{}},_0x29de01={},_0x165741;return db['SmsQueue'][_0xf92b('0x54')]({'where':{'id':_0x29b901[_0xf92b('0x44')]['id']}})[_0xf92b('0x23')](handleEntityNotFound(_0x5e5950,null))[_0xf92b('0x23')](function(_0x3132b0){if(_0x3132b0){_0x165741=_0x3132b0[_0xf92b('0x4c')]({'plain':!![]});_0x29de01[_0xf92b('0x2c')]=_['keys'](db[_0xf92b('0x55')][_0xf92b('0x2b')]);_0x29de01[_0xf92b('0x2e')]=_['keys'](_0x29b901['query']);_0x29de01['filters']=_[_0xf92b('0x31')](_0x29de01[_0xf92b('0x2c')],_0x29de01[_0xf92b('0x2e')]);_0x460cf2[_0xf92b('0x30')]=_['intersection'](_0x29de01[_0xf92b('0x2c')],qs[_0xf92b('0x32')](_0x29b901['query']['fields']));_0x460cf2[_0xf92b('0x30')]=_0x460cf2[_0xf92b('0x30')][_0xf92b('0x33')]?_0x460cf2[_0xf92b('0x30')]:_0x29de01[_0xf92b('0x2c')];if(!_0x29b901[_0xf92b('0x2e')][_0xf92b('0x34')](_0xf92b('0x56'))){_0x460cf2['limit']=qs[_0xf92b('0x1d')](_0x29b901[_0xf92b('0x2e')][_0xf92b('0x1d')]);_0x460cf2[_0xf92b('0x1c')]=qs[_0xf92b('0x1c')](_0x29b901['query'][_0xf92b('0x1c')]);}_0x460cf2['order']=qs[_0xf92b('0x36')](_0x29b901[_0xf92b('0x2e')][_0xf92b('0x36')]);_0x460cf2[_0xf92b('0x37')]=qs['filters'](_[_0xf92b('0x38')](_0x29b901['query'],_0x29de01[_0xf92b('0x2f')]));_0x460cf2[_0xf92b('0x37')][_0xf92b('0x57')]=_0x3132b0['id'];if(_0x29b901[_0xf92b('0x2e')][_0xf92b('0x39')]){_0x460cf2[_0xf92b('0x37')]=_[_0xf92b('0x3a')](_0x460cf2[_0xf92b('0x37')],{'$or':_['map'](_0x460cf2[_0xf92b('0x30')],function(_0x3b2274){var _0xee9734={};_0xee9734[_0x3b2274]={'$like':'%'+_0x29b901['query'][_0xf92b('0x39')]+'%'};return _0xee9734;})});}_0x460cf2=_[_0xf92b('0x3a')]({},_0x460cf2,_0x29b901[_0xf92b('0x45')]);return db[_0xf92b('0x55')][_0xf92b('0x40')](_0x460cf2);}})[_0xf92b('0x23')](function(_0x4ecbff){if(_0x4ecbff){return db['User'][_0xf92b('0x58')]({'where':{'id':_[_0xf92b('0x3b')](_0x4ecbff,_0xf92b('0x59')),'role':_0xf92b('0x5a')},'attributes':['id',_0xf92b('0x4f'),_0xf92b('0x5b'),_0xf92b('0x5c'),_0xf92b('0x5d')]});}})[_0xf92b('0x23')](function(_0xc3dd26){if(_0xc3dd26){return{'count':_0xc3dd26[_0xf92b('0x1b')],'rows':_[_0xf92b('0x3b')](_0xc3dd26['rows'],function(_0x230327){return{'membername':_0x230327['name'],'UserId':_0x230327['id'],'queue_name':_0x165741[_0xf92b('0x4f')],'SmsQueueId':_0x165741['id'],'interface':util[_0xf92b('0x5e')](_0xf92b('0x5f'),'SIP',_0x230327[_0xf92b('0x4f')]),'penalty':0x0,'paused':_0x230327['smsPause'],'createdAt':_0x230327[_0xf92b('0x5d')],'updatedAt':_0x230327[_0xf92b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf92b('0x23')](respondWithFilteredResult(_0x5e5950,_0x460cf2))[_0xf92b('0x42')](handleError(_0x5e5950,null));};exports['getTeams']=function(_0x4a88de,_0x103485,_0x3525a2){var _0x41a581={};var _0x110d04={};var _0xc69563;var _0x4f8148;return db[_0xf92b('0x2a')][_0xf92b('0x54')]({'where':{'id':_0x4a88de[_0xf92b('0x44')]['id']}})['then'](handleEntityNotFound(_0x103485,null))[_0xf92b('0x23')](function(_0x3a7095){if(_0x3a7095){_0xc69563=_0x3a7095;_0x110d04[_0xf92b('0x2c')]=_['keys'](db[_0xf92b('0x60')]['rawAttributes']);_0x110d04[_0xf92b('0x2e')]=_[_0xf92b('0x2d')](_0x4a88de[_0xf92b('0x2e')]);_0x110d04[_0xf92b('0x2f')]=_[_0xf92b('0x31')](_0x110d04['model'],_0x110d04[_0xf92b('0x2e')]);_0x41a581[_0xf92b('0x30')]=_[_0xf92b('0x31')](_0x110d04[_0xf92b('0x2c')],qs[_0xf92b('0x32')](_0x4a88de[_0xf92b('0x2e')]['fields']));_0x41a581[_0xf92b('0x30')]=_0x41a581[_0xf92b('0x30')]['length']?_0x41a581[_0xf92b('0x30')]:_0x110d04['model'];_0x41a581[_0xf92b('0x35')]=qs['sort'](_0x4a88de[_0xf92b('0x2e')][_0xf92b('0x36')]);_0x41a581[_0xf92b('0x37')]=qs[_0xf92b('0x2f')](_['pick'](_0x4a88de[_0xf92b('0x2e')],_0x110d04['filters']));if(_0x4a88de['query'][_0xf92b('0x39')]){_0x41a581[_0xf92b('0x37')]=_[_0xf92b('0x3a')](_0x41a581['where'],{'$or':_[_0xf92b('0x3b')](_0x41a581[_0xf92b('0x30')],function(_0x65b712){var _0x4838e7={};_0x4838e7[_0x65b712]={'$like':'%'+_0x4a88de[_0xf92b('0x2e')][_0xf92b('0x39')]+'%'};return _0x4838e7;})});}_0x41a581=_[_0xf92b('0x3a')]({},_0x41a581,_0x4a88de[_0xf92b('0x45')]);return _0xc69563[_0xf92b('0x61')](_0x41a581);}})[_0xf92b('0x23')](function(_0x32bf86){if(_0x32bf86){_0x4f8148=_0x32bf86['length'];if(!_0x4a88de['query'][_0xf92b('0x34')]('nolimit')){_0x41a581[_0xf92b('0x1d')]=qs[_0xf92b('0x1d')](_0x4a88de[_0xf92b('0x2e')]['limit']);_0x41a581[_0xf92b('0x1c')]=qs['offset'](_0x4a88de[_0xf92b('0x2e')][_0xf92b('0x1c')]);}return _0xc69563[_0xf92b('0x61')](_0x41a581);}})[_0xf92b('0x23')](function(_0x563583){if(_0x563583){return _0x563583?{'count':_0x4f8148,'rows':_0x563583}:null;}})[_0xf92b('0x23')](respondWithResult(_0x103485,null))[_0xf92b('0x42')](handleError(_0x103485,null));};exports[_0xf92b('0x62')]=function(_0x1e3453,_0x1b8529,_0x555bad){var _0x353c91=[];var _0xfae22d;return db[_0xf92b('0x60')][_0xf92b('0x40')]({'where':{'id':_0x1e3453['body'][_0xf92b('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf92b('0x64'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2d4b5d){if(_0x2d4b5d){for(var _0x2c114e=0x0;_0x2c114e<_0x2d4b5d[_0xf92b('0x33')];_0x2c114e+=0x1){for(var _0x3def26=0x0;_0x3def26<_0x2d4b5d[_0x2c114e][_0xf92b('0x64')]['length'];_0x3def26+=0x1){_0x353c91=_[_0xf92b('0x65')](_0x353c91,[_0x2d4b5d[_0x2c114e][_0xf92b('0x64')][_0x3def26]['id']]);}}return _0x353c91;}})['then'](function(_0x3f23ce){if(_0x3f23ce){return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0x1e3453[_0xf92b('0x44')]['id']}});}})['then'](function(_0x3d2e91){if(_0x3d2e91){_0xfae22d=_0x3d2e91;return _0xfae22d[_0xf92b('0x66')](_0x353c91,{'penalty':_0x1e3453[_0xf92b('0x48')][_0xf92b('0x67')]});}})[_0xf92b('0x23')](function(_0x4d360d){if(_0x4d360d){return _0xfae22d[_0xf92b('0x62')](_0x1e3453['body']['ids']);}})[_0xf92b('0x23')](handleEntityNotFound(_0x1b8529,null))[_0xf92b('0x23')](respondWithStatusCode(_0x1b8529,null))[_0xf92b('0x42')](handleError(_0x1b8529,null));};exports[_0xf92b('0x68')]=function(_0x3b6fc8,_0x4cf605,_0x1478c1){var _0x16eb24=[];var _0x4cbbc7;return db[_0xf92b('0x60')]['findAll']({'where':{'id':_0x3b6fc8[_0xf92b('0x2e')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf92b('0x23')](function(_0x42bf86){if(_0x42bf86){for(var _0x14831e=0x0;_0x14831e<_0x42bf86[_0xf92b('0x33')];_0x14831e+=0x1){for(var _0x258417=0x0;_0x258417<_0x42bf86[_0x14831e][_0xf92b('0x64')][_0xf92b('0x33')];_0x258417+=0x1){_0x16eb24=_[_0xf92b('0x65')](_0x16eb24,[_0x42bf86[_0x14831e][_0xf92b('0x64')][_0x258417]['id']]);}}return _0x16eb24;}})[_0xf92b('0x23')](function(_0x1eb9bb){if(_0x1eb9bb){return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0x3b6fc8['params']['id']}});}})[_0xf92b('0x23')](function(_0x498650){if(_0x498650){_0x4cbbc7=_0x498650;return _0x4cbbc7[_0xf92b('0x69')](_0x16eb24);}})['then'](function(_0x33d652){if(_0x4cbbc7){return _0x4cbbc7[_0xf92b('0x68')](_0x3b6fc8[_0xf92b('0x2e')]['ids']);}})[_0xf92b('0x23')](handleEntityNotFound(_0x4cf605,null))[_0xf92b('0x23')](respondWithStatusCode(_0x4cf605,null))[_0xf92b('0x42')](handleError(_0x4cf605,null));};exports[_0xf92b('0x66')]=function(_0x38817b,_0x4b4729,_0x68b971){return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0x38817b[_0xf92b('0x44')]['id']}})[_0xf92b('0x23')](handleEntityNotFound(_0x4b4729,null))[_0xf92b('0x23')](function(_0x576296){if(_0x576296){return _0x576296[_0xf92b('0x66')](_0x38817b[_0xf92b('0x48')][_0xf92b('0x63')],_[_0xf92b('0x6a')](_0x38817b[_0xf92b('0x48')],[_0xf92b('0x63'),'id'])||{})[_0xf92b('0x6b')](function(_0x3b6311){for(var _0x10adcf=0x0;_0x10adcf<_0x38817b[_0xf92b('0x48')]['ids'][_0xf92b('0x33')];_0x10adcf+=0x1){socket[_0xf92b('0x6c')]('userSmsQueue:save',{'UserId':_0x38817b[_0xf92b('0x48')][_0xf92b('0x63')][_0x10adcf],'SmsQueueId':_0x38817b['params']['id']});}return _0x3b6311;});}})[_0xf92b('0x23')](respondWithResult(_0x4b4729,null))['catch'](handleError(_0x4b4729,null));};exports[_0xf92b('0x69')]=function(_0x8c6bc,_0x4d323c,_0x52181e){var _0x22e9f3;return db[_0xf92b('0x2a')][_0xf92b('0x46')]({'where':{'id':_0x8c6bc[_0xf92b('0x44')]['id']}})[_0xf92b('0x23')](handleEntityNotFound(_0x4d323c,null))[_0xf92b('0x23')](function(_0x164c73){if(_0x164c73){return _0x164c73['removeAgents'](_0x8c6bc[_0xf92b('0x2e')][_0xf92b('0x63')])[_0xf92b('0x23')](function(_0x15219a){if(_[_0xf92b('0x6d')](_0x8c6bc[_0xf92b('0x2e')][_0xf92b('0x63')])){for(var _0x2d05d9=0x0;_0x2d05d9<_0x8c6bc[_0xf92b('0x2e')]['ids'][_0xf92b('0x33')];_0x2d05d9+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':_0x8c6bc[_0xf92b('0x2e')][_0xf92b('0x63')][_0x2d05d9],'SmsQueueId':_0x8c6bc[_0xf92b('0x44')]['id']});}}else{socket[_0xf92b('0x6c')](_0xf92b('0x6e'),{'UserId':_0x8c6bc[_0xf92b('0x2e')][_0xf92b('0x63')],'SmsQueueId':_0x8c6bc[_0xf92b('0x44')]['id']});}});}})[_0xf92b('0x23')](respondWithStatusCode(_0x4d323c,null))['catch'](handleError(_0x4d323c,null));};exports['getAgents']=function(_0x279e3a,_0x479c82,_0x565c18){var _0x21d23d={};var _0x5e7f2b={};var _0x2ea2d3;var _0x5722f8;return db[_0xf92b('0x2a')][_0xf92b('0x54')]({'where':{'id':_0x279e3a['params']['id']}})[_0xf92b('0x23')](handleEntityNotFound(_0x479c82,null))['then'](function(_0xaa9616){if(_0xaa9616){_0x2ea2d3=_0xaa9616;_0x5e7f2b[_0xf92b('0x2c')]=_['keys'](db[_0xf92b('0x6f')][_0xf92b('0x2b')]);_0x5e7f2b[_0xf92b('0x2e')]=_[_0xf92b('0x2d')](_0x279e3a[_0xf92b('0x2e')]);_0x5e7f2b[_0xf92b('0x2f')]=_[_0xf92b('0x31')](_0x5e7f2b[_0xf92b('0x2c')],_0x5e7f2b[_0xf92b('0x2e')]);_0x21d23d[_0xf92b('0x30')]=_[_0xf92b('0x31')](_0x5e7f2b[_0xf92b('0x2c')],qs['fields'](_0x279e3a[_0xf92b('0x2e')][_0xf92b('0x32')]));_0x21d23d[_0xf92b('0x30')]=_0x21d23d[_0xf92b('0x30')][_0xf92b('0x33')]?_0x21d23d[_0xf92b('0x30')]:_0x5e7f2b[_0xf92b('0x2c')];_0x21d23d[_0xf92b('0x35')]=qs[_0xf92b('0x36')](_0x279e3a[_0xf92b('0x2e')][_0xf92b('0x36')]);_0x21d23d[_0xf92b('0x37')]=qs['filters'](_[_0xf92b('0x38')](_0x279e3a[_0xf92b('0x2e')],_0x5e7f2b[_0xf92b('0x2f')]));if(_0x279e3a['query'][_0xf92b('0x39')]){_0x21d23d[_0xf92b('0x37')]=_[_0xf92b('0x3a')](_0x21d23d[_0xf92b('0x37')],{'$or':_[_0xf92b('0x3b')](_0x21d23d[_0xf92b('0x30')],function(_0x31eb3e){var _0x2e1350={};_0x2e1350[_0x31eb3e]={'$like':'%'+_0x279e3a['query'][_0xf92b('0x39')]+'%'};return _0x2e1350;})});}_0x21d23d=_[_0xf92b('0x3a')]({},_0x21d23d,_0x279e3a[_0xf92b('0x45')]);return _0x2ea2d3[_0xf92b('0x70')](_0x21d23d);}})['then'](function(_0xd9f0bf){if(_0xd9f0bf){_0x5722f8=_0xd9f0bf[_0xf92b('0x33')];if(!_0x279e3a[_0xf92b('0x2e')][_0xf92b('0x34')](_0xf92b('0x56'))){_0x21d23d[_0xf92b('0x1d')]=qs[_0xf92b('0x1d')](_0x279e3a[_0xf92b('0x2e')]['limit']);_0x21d23d[_0xf92b('0x1c')]=qs[_0xf92b('0x1c')](_0x279e3a[_0xf92b('0x2e')][_0xf92b('0x1c')]);}return _0x2ea2d3[_0xf92b('0x70')](_0x21d23d);}})[_0xf92b('0x23')](function(_0x42f942){if(_0x42f942){return _0x42f942?{'count':_0x5722f8,'rows':_0x42f942}:null;}})['then'](respondWithResult(_0x479c82,null))['catch'](handleError(_0x479c82,null));}; \ No newline at end of file +var _0xcf06=['../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','SmsQueues','UserProfileResource','then','stack','name','send','index','SmsQueue','rawAttributes','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','key','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','map','User','UserId','agent','smsPause','updatedAt','format','SIP','getTeams','Team','ids','Agents','union','addAgents','penalty','addTeams','removeTeams','removeAgents','omit','spread','emit','userSmsQueue:save','userSmsQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils'];(function(_0x53b39e,_0x66b412){var _0x39fcf7=function(_0x2e51d9){while(--_0x2e51d9){_0x53b39e['push'](_0x53b39e['shift']());}};_0x39fcf7(++_0x66b412);}(_0xcf06,0x1aa));var _0x6cf0=function(_0x40fb9e,_0x36c8fb){_0x40fb9e=_0x40fb9e-0x0;var _0x42fc8f=_0xcf06[_0x40fb9e];return _0x42fc8f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6cf0('0x0'));var jsonpatch=require(_0x6cf0('0x1'));var rp=require(_0x6cf0('0x2'));var moment=require(_0x6cf0('0x3'));var BPromise=require(_0x6cf0('0x4'));var Mustache=require(_0x6cf0('0x5'));var util=require(_0x6cf0('0x6'));var path=require(_0x6cf0('0x7'));var sox=require('sox');var csv=require(_0x6cf0('0x8'));var ejs=require(_0x6cf0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cf0('0xa'));var crypto=require('crypto');var jsforce=require(_0x6cf0('0xb'));var deskjs=require(_0x6cf0('0xc'));var toCsv=require(_0x6cf0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x6cf0('0xd'));var hardwareService=require(_0x6cf0('0xe'));var Redis=require(_0x6cf0('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6cf0('0x10'));var utils=require(_0x6cf0('0x11'));var config=require(_0x6cf0('0x12'));var db=require('../../mysqldb')['db'];config[_0x6cf0('0x13')]=_[_0x6cf0('0x14')](config['redis'],{'host':_0x6cf0('0x15'),'port':0x18eb});var socket=require(_0x6cf0('0x16'))(new Redis(config[_0x6cf0('0x13')]));require(_0x6cf0('0x17'))['register'](socket);function respondWithStatusCode(_0x23c3bf,_0x3f1ffe){_0x3f1ffe=_0x3f1ffe||0xcc;return function(_0x2b11b3){if(_0x2b11b3){return _0x23c3bf[_0x6cf0('0x18')](_0x3f1ffe);}return _0x23c3bf[_0x6cf0('0x19')](_0x3f1ffe)[_0x6cf0('0x1a')]();};}function respondWithResult(_0x3849d0,_0x159e87){_0x159e87=_0x159e87||0xc8;return function(_0x4e6a24){if(_0x4e6a24){return _0x3849d0[_0x6cf0('0x19')](_0x159e87)[_0x6cf0('0x1b')](_0x4e6a24);}};}function respondWithFilteredResult(_0xc08cb4,_0x28deab){return function(_0x10b45e){if(_0x10b45e){var _0x3e637c=_0x10b45e[_0x6cf0('0x1c')],_0xf65f23=_0x28deab[_0x6cf0('0x1d')],_0x41a21a=_0x28deab[_0x6cf0('0x1d')]+_0x28deab[_0x6cf0('0x1e')],_0x51e467;if(_0x41a21a>=_0x3e637c){_0x41a21a=_0x3e637c;_0x51e467=0xc8;}else{_0x51e467=0xce;}_0xc08cb4[_0x6cf0('0x19')](_0x51e467);return _0xc08cb4[_0x6cf0('0x1f')](_0x6cf0('0x20'),_0xf65f23+'-'+_0x41a21a+'/'+_0x3e637c)[_0x6cf0('0x1b')](_0x10b45e);}return null;};}function patchUpdates(_0x4ecef1){return function(_0x5d90f8){try{jsonpatch[_0x6cf0('0x21')](_0x5d90f8,_0x4ecef1,!![]);}catch(_0x2fdce3){return BPromise[_0x6cf0('0x22')](_0x2fdce3);}return _0x5d90f8[_0x6cf0('0x23')]();};}function saveUpdates(_0x557364,_0x3dccdf){return function(_0x545996){if(_0x545996){return _0x545996[_0x6cf0('0x24')](_0x557364)['then'](function(_0x2d78fa){return _0x2d78fa;});}return null;};}function removeEntity(_0x5d8570,_0x1d25c8){return function(_0x573bf1){if(_0x573bf1){return _0x573bf1[_0x6cf0('0x25')]()['then'](function(){var _0x223a9b=_0x573bf1[_0x6cf0('0x26')]({'plain':!![]});var _0x2ae3e4=_0x6cf0('0x27');return db[_0x6cf0('0x28')][_0x6cf0('0x25')]({'where':{'type':_0x2ae3e4,'resourceId':_0x223a9b['id']}})[_0x6cf0('0x29')](function(){return _0x573bf1;});})['then'](function(){_0x5d8570['status'](0xcc)[_0x6cf0('0x1a')]();});}};}function handleEntityNotFound(_0x40a804,_0x3f05e7){return function(_0x1cb014){if(!_0x1cb014){_0x40a804[_0x6cf0('0x18')](0x194);}return _0x1cb014;};}function handleError(_0x2f54fb,_0x50a226){_0x50a226=_0x50a226||0x1f4;return function(_0x417e26){logger['error'](_0x417e26[_0x6cf0('0x2a')]);if(_0x417e26[_0x6cf0('0x2b')]){delete _0x417e26[_0x6cf0('0x2b')];}_0x2f54fb['status'](_0x50a226)[_0x6cf0('0x2c')](_0x417e26);};}exports[_0x6cf0('0x2d')]=function(_0x359428,_0x3d603a){var _0x305d5a={},_0x1db742={},_0x3bb54f={'count':0x0,'rows':[]};var _0xf49799=db[_0x6cf0('0x2e')][_0x6cf0('0x2f')];_0x1db742[_0x6cf0('0x30')]=_['keys'](_0xf49799);_0x1db742[_0x6cf0('0x31')]=_[_0x6cf0('0x32')](_0x359428[_0x6cf0('0x31')]);_0x1db742[_0x6cf0('0x33')]=_['intersection'](_0x1db742[_0x6cf0('0x30')],_0x1db742[_0x6cf0('0x31')]);_0x305d5a['attributes']=_['intersection'](_0x1db742[_0x6cf0('0x30')],qs[_0x6cf0('0x34')](_0x359428['query']['fields']));_0x305d5a[_0x6cf0('0x35')]=_0x305d5a[_0x6cf0('0x35')][_0x6cf0('0x36')]?_0x305d5a[_0x6cf0('0x35')]:_0x1db742[_0x6cf0('0x30')];if(!_0x359428[_0x6cf0('0x31')][_0x6cf0('0x37')](_0x6cf0('0x38'))){_0x305d5a['limit']=qs['limit'](_0x359428[_0x6cf0('0x31')]['limit']);_0x305d5a['offset']=qs[_0x6cf0('0x1d')](_0x359428[_0x6cf0('0x31')][_0x6cf0('0x1d')]);}_0x305d5a[_0x6cf0('0x39')]=qs['sort'](_0x359428['query'][_0x6cf0('0x3a')]);_0x305d5a[_0x6cf0('0x3b')]=qs['filters'](_['pick'](_0x359428[_0x6cf0('0x31')],_0x1db742[_0x6cf0('0x33')]));if(_0x359428[_0x6cf0('0x31')][_0x6cf0('0x3c')]){_0x305d5a[_0x6cf0('0x3b')]=_[_0x6cf0('0x3d')](_0x305d5a[_0x6cf0('0x3b')],{'$or':_['map'](_0xf49799,function(_0x246e9c){if(_0x246e9c['type'][_0x6cf0('0x3e')]!=='VIRTUAL'){var _0x405fd0={};_0x405fd0[_0x246e9c['field']]={'$like':'%'+_0x359428[_0x6cf0('0x31')][_0x6cf0('0x3c')]+'%'};return _0x405fd0;}})});}_0x305d5a=_[_0x6cf0('0x3d')]({},_0x305d5a,_0x359428[_0x6cf0('0x3f')]);var _0x41c909={'where':_0x305d5a['where']};return db[_0x6cf0('0x2e')][_0x6cf0('0x1c')](_0x41c909)[_0x6cf0('0x29')](function(_0x53659d){_0x3bb54f['count']=_0x53659d;if(_0x359428[_0x6cf0('0x31')][_0x6cf0('0x40')]){_0x305d5a[_0x6cf0('0x41')]=[{'all':!![]}];}return db[_0x6cf0('0x2e')][_0x6cf0('0x42')](_0x305d5a);})[_0x6cf0('0x29')](function(_0xa58400){_0x3bb54f[_0x6cf0('0x43')]=_0xa58400;return _0x3bb54f;})[_0x6cf0('0x29')](respondWithFilteredResult(_0x3d603a,_0x305d5a))[_0x6cf0('0x44')](handleError(_0x3d603a,null));};exports[_0x6cf0('0x45')]=function(_0x2007d8,_0x31efec){var _0x219a26={'raw':!![],'where':{'id':_0x2007d8[_0x6cf0('0x46')]['id']}},_0x2b178c={};_0x2b178c[_0x6cf0('0x30')]=_[_0x6cf0('0x32')](db['SmsQueue']['rawAttributes']);_0x2b178c['query']=_[_0x6cf0('0x32')](_0x2007d8[_0x6cf0('0x31')]);_0x2b178c['filters']=_[_0x6cf0('0x47')](_0x2b178c[_0x6cf0('0x30')],_0x2b178c[_0x6cf0('0x31')]);_0x219a26['attributes']=_[_0x6cf0('0x47')](_0x2b178c[_0x6cf0('0x30')],qs['fields'](_0x2007d8[_0x6cf0('0x31')][_0x6cf0('0x34')]));_0x219a26[_0x6cf0('0x35')]=_0x219a26[_0x6cf0('0x35')]['length']?_0x219a26[_0x6cf0('0x35')]:_0x2b178c[_0x6cf0('0x30')];if(_0x2007d8['query'][_0x6cf0('0x40')]){_0x219a26['include']=[{'all':!![]}];}_0x219a26=_['merge']({},_0x219a26,_0x2007d8['options']);return db['SmsQueue'][_0x6cf0('0x48')](_0x219a26)['then'](handleEntityNotFound(_0x31efec,null))[_0x6cf0('0x29')](respondWithResult(_0x31efec,null))[_0x6cf0('0x44')](handleError(_0x31efec,null));};exports['create']=function(_0x228a63,_0x44fc30){return db[_0x6cf0('0x2e')][_0x6cf0('0x49')](_0x228a63[_0x6cf0('0x4a')],{})[_0x6cf0('0x29')](function(_0x59ef10){var _0x2197af=_0x228a63[_0x6cf0('0x4b')][_0x6cf0('0x26')]({'plain':!![]});if(!_0x2197af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2197af[_0x6cf0('0x4c')]===_0x6cf0('0x4b')){var _0x201a87=_0x59ef10[_0x6cf0('0x26')]({'plain':!![]});var _0x30e757=_0x6cf0('0x27');return db[_0x6cf0('0x4d')][_0x6cf0('0x48')]({'where':{'name':_0x30e757,'userProfileId':_0x2197af[_0x6cf0('0x4e')]},'raw':!![]})[_0x6cf0('0x29')](function(_0x40e34e){if(_0x40e34e&&_0x40e34e[_0x6cf0('0x4f')]===0x0){return db[_0x6cf0('0x28')]['create']({'name':_0x201a87[_0x6cf0('0x2b')],'resourceId':_0x201a87['id'],'type':_0x40e34e['name'],'sectionId':_0x40e34e['id']},{})[_0x6cf0('0x29')](function(){return _0x59ef10;});}else{return _0x59ef10;}})[_0x6cf0('0x44')](function(_0xc0b9a4){logger['error'](_0x6cf0('0x50'),_0xc0b9a4);throw _0xc0b9a4;});}return _0x59ef10;})['then'](respondWithResult(_0x44fc30,0xc9))['catch'](handleError(_0x44fc30,null));};exports[_0x6cf0('0x24')]=function(_0x216bfa,_0xf78055){if(_0x216bfa[_0x6cf0('0x4a')]['id']){delete _0x216bfa[_0x6cf0('0x4a')]['id'];}return db['SmsQueue'][_0x6cf0('0x48')]({'where':{'id':_0x216bfa['params']['id']}})[_0x6cf0('0x29')](handleEntityNotFound(_0xf78055,null))[_0x6cf0('0x29')](saveUpdates(_0x216bfa[_0x6cf0('0x4a')],null))[_0x6cf0('0x29')](respondWithResult(_0xf78055,null))[_0x6cf0('0x44')](handleError(_0xf78055,null));};exports[_0x6cf0('0x25')]=function(_0x5c9d87,_0x4106a0){return db['SmsQueue'][_0x6cf0('0x48')]({'where':{'id':_0x5c9d87[_0x6cf0('0x46')]['id']}})[_0x6cf0('0x29')](handleEntityNotFound(_0x4106a0,null))[_0x6cf0('0x29')](removeEntity(_0x4106a0,null))[_0x6cf0('0x44')](handleError(_0x4106a0,null));};exports[_0x6cf0('0x51')]=function(_0x4d810d,_0x2d16ca){return db[_0x6cf0('0x2e')][_0x6cf0('0x51')]()['then'](respondWithResult(_0x2d16ca,null))[_0x6cf0('0x44')](handleError(_0x2d16ca,null));};exports[_0x6cf0('0x52')]=function(_0x5ee125,_0xe5303d,_0x430830){var _0x343a47={'raw':!![],'where':{}},_0x584a2d={},_0x32f93a;return db[_0x6cf0('0x2e')][_0x6cf0('0x53')]({'where':{'id':_0x5ee125['params']['id']}})[_0x6cf0('0x29')](handleEntityNotFound(_0xe5303d,null))['then'](function(_0x1631ac){if(_0x1631ac){_0x32f93a=_0x1631ac[_0x6cf0('0x26')]({'plain':!![]});_0x584a2d[_0x6cf0('0x30')]=_[_0x6cf0('0x32')](db[_0x6cf0('0x54')][_0x6cf0('0x2f')]);_0x584a2d[_0x6cf0('0x31')]=_[_0x6cf0('0x32')](_0x5ee125[_0x6cf0('0x31')]);_0x584a2d[_0x6cf0('0x33')]=_[_0x6cf0('0x47')](_0x584a2d['model'],_0x584a2d[_0x6cf0('0x31')]);_0x343a47[_0x6cf0('0x35')]=_[_0x6cf0('0x47')](_0x584a2d[_0x6cf0('0x30')],qs[_0x6cf0('0x34')](_0x5ee125[_0x6cf0('0x31')][_0x6cf0('0x34')]));_0x343a47[_0x6cf0('0x35')]=_0x343a47[_0x6cf0('0x35')][_0x6cf0('0x36')]?_0x343a47[_0x6cf0('0x35')]:_0x584a2d[_0x6cf0('0x30')];if(!_0x5ee125['query'][_0x6cf0('0x37')](_0x6cf0('0x38'))){_0x343a47[_0x6cf0('0x1e')]=qs[_0x6cf0('0x1e')](_0x5ee125[_0x6cf0('0x31')]['limit']);_0x343a47[_0x6cf0('0x1d')]=qs['offset'](_0x5ee125['query'][_0x6cf0('0x1d')]);}_0x343a47['order']=qs[_0x6cf0('0x3a')](_0x5ee125['query']['sort']);_0x343a47[_0x6cf0('0x3b')]=qs[_0x6cf0('0x33')](_[_0x6cf0('0x55')](_0x5ee125[_0x6cf0('0x31')],_0x584a2d[_0x6cf0('0x33')]));_0x343a47[_0x6cf0('0x3b')][_0x6cf0('0x56')]=_0x1631ac['id'];if(_0x5ee125[_0x6cf0('0x31')][_0x6cf0('0x3c')]){_0x343a47[_0x6cf0('0x3b')]=_[_0x6cf0('0x3d')](_0x343a47[_0x6cf0('0x3b')],{'$or':_[_0x6cf0('0x57')](_0x343a47['attributes'],function(_0x42cc43){var _0x120e9a={};_0x120e9a[_0x42cc43]={'$like':'%'+_0x5ee125[_0x6cf0('0x31')][_0x6cf0('0x3c')]+'%'};return _0x120e9a;})});}_0x343a47=_['merge']({},_0x343a47,_0x5ee125['options']);return db[_0x6cf0('0x54')][_0x6cf0('0x42')](_0x343a47);}})[_0x6cf0('0x29')](function(_0x3be1b5){if(_0x3be1b5){return db[_0x6cf0('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0x3be1b5,_0x6cf0('0x59')),'role':_0x6cf0('0x5a')},'attributes':['id',_0x6cf0('0x2b'),_0x6cf0('0x5b'),_0x6cf0('0x5c'),'createdAt']});}})[_0x6cf0('0x29')](function(_0xd7d995){if(_0xd7d995){return{'count':_0xd7d995[_0x6cf0('0x1c')],'rows':_[_0x6cf0('0x57')](_0xd7d995[_0x6cf0('0x43')],function(_0x56c7aa){return{'membername':_0x56c7aa['name'],'UserId':_0x56c7aa['id'],'queue_name':_0x32f93a['name'],'SmsQueueId':_0x32f93a['id'],'interface':util[_0x6cf0('0x5d')]('%s/%s',_0x6cf0('0x5e'),_0x56c7aa[_0x6cf0('0x2b')]),'penalty':0x0,'paused':_0x56c7aa['smsPause'],'createdAt':_0x56c7aa['createdAt'],'updatedAt':_0x56c7aa['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cf0('0x29')](respondWithFilteredResult(_0xe5303d,_0x343a47))[_0x6cf0('0x44')](handleError(_0xe5303d,null));};exports[_0x6cf0('0x5f')]=function(_0x3bd2c7,_0x46119f,_0x236edc){var _0x4bbfe7={};var _0x1ae4f5={};var _0x2426c7;var _0x1e1e4f;return db['SmsQueue'][_0x6cf0('0x53')]({'where':{'id':_0x3bd2c7['params']['id']}})[_0x6cf0('0x29')](handleEntityNotFound(_0x46119f,null))[_0x6cf0('0x29')](function(_0x97c244){if(_0x97c244){_0x2426c7=_0x97c244;_0x1ae4f5[_0x6cf0('0x30')]=_['keys'](db[_0x6cf0('0x60')][_0x6cf0('0x2f')]);_0x1ae4f5['query']=_[_0x6cf0('0x32')](_0x3bd2c7[_0x6cf0('0x31')]);_0x1ae4f5[_0x6cf0('0x33')]=_[_0x6cf0('0x47')](_0x1ae4f5[_0x6cf0('0x30')],_0x1ae4f5[_0x6cf0('0x31')]);_0x4bbfe7[_0x6cf0('0x35')]=_[_0x6cf0('0x47')](_0x1ae4f5[_0x6cf0('0x30')],qs['fields'](_0x3bd2c7[_0x6cf0('0x31')][_0x6cf0('0x34')]));_0x4bbfe7['attributes']=_0x4bbfe7[_0x6cf0('0x35')][_0x6cf0('0x36')]?_0x4bbfe7[_0x6cf0('0x35')]:_0x1ae4f5['model'];_0x4bbfe7[_0x6cf0('0x39')]=qs['sort'](_0x3bd2c7['query'][_0x6cf0('0x3a')]);_0x4bbfe7[_0x6cf0('0x3b')]=qs[_0x6cf0('0x33')](_[_0x6cf0('0x55')](_0x3bd2c7[_0x6cf0('0x31')],_0x1ae4f5[_0x6cf0('0x33')]));if(_0x3bd2c7[_0x6cf0('0x31')][_0x6cf0('0x3c')]){_0x4bbfe7[_0x6cf0('0x3b')]=_[_0x6cf0('0x3d')](_0x4bbfe7['where'],{'$or':_[_0x6cf0('0x57')](_0x4bbfe7[_0x6cf0('0x35')],function(_0xe5fad8){var _0x8b21a3={};_0x8b21a3[_0xe5fad8]={'$like':'%'+_0x3bd2c7[_0x6cf0('0x31')]['filter']+'%'};return _0x8b21a3;})});}_0x4bbfe7=_[_0x6cf0('0x3d')]({},_0x4bbfe7,_0x3bd2c7[_0x6cf0('0x3f')]);return _0x2426c7['getTeams'](_0x4bbfe7);}})[_0x6cf0('0x29')](function(_0x279a6d){if(_0x279a6d){_0x1e1e4f=_0x279a6d['length'];if(!_0x3bd2c7[_0x6cf0('0x31')][_0x6cf0('0x37')](_0x6cf0('0x38'))){_0x4bbfe7[_0x6cf0('0x1e')]=qs[_0x6cf0('0x1e')](_0x3bd2c7[_0x6cf0('0x31')][_0x6cf0('0x1e')]);_0x4bbfe7['offset']=qs['offset'](_0x3bd2c7['query'][_0x6cf0('0x1d')]);}return _0x2426c7[_0x6cf0('0x5f')](_0x4bbfe7);}})[_0x6cf0('0x29')](function(_0x4fbf49){if(_0x4fbf49){return _0x4fbf49?{'count':_0x1e1e4f,'rows':_0x4fbf49}:null;}})[_0x6cf0('0x29')](respondWithResult(_0x46119f,null))[_0x6cf0('0x44')](handleError(_0x46119f,null));};exports['addTeams']=function(_0x172641,_0x40b94f,_0xfb2a25){var _0x212aac=[];var _0x3f4ace;return db[_0x6cf0('0x60')]['findAll']({'where':{'id':_0x172641[_0x6cf0('0x4a')][_0x6cf0('0x61')]},'attributes':['id'],'include':[{'model':db[_0x6cf0('0x58')],'as':_0x6cf0('0x62'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4e4e05){if(_0x4e4e05){for(var _0x3d0791=0x0;_0x3d0791<_0x4e4e05[_0x6cf0('0x36')];_0x3d0791+=0x1){for(var _0x4fc67b=0x0;_0x4fc67b<_0x4e4e05[_0x3d0791]['Agents'][_0x6cf0('0x36')];_0x4fc67b+=0x1){_0x212aac=_[_0x6cf0('0x63')](_0x212aac,[_0x4e4e05[_0x3d0791][_0x6cf0('0x62')][_0x4fc67b]['id']]);}}return _0x212aac;}})[_0x6cf0('0x29')](function(_0x2687f1){if(_0x2687f1){return db[_0x6cf0('0x2e')]['find']({'where':{'id':_0x172641['params']['id']}});}})[_0x6cf0('0x29')](function(_0x444f1a){if(_0x444f1a){_0x3f4ace=_0x444f1a;return _0x3f4ace[_0x6cf0('0x64')](_0x212aac,{'penalty':_0x172641[_0x6cf0('0x4a')][_0x6cf0('0x65')]});}})[_0x6cf0('0x29')](function(_0x6175ae){if(_0x6175ae){return _0x3f4ace[_0x6cf0('0x66')](_0x172641[_0x6cf0('0x4a')][_0x6cf0('0x61')]);}})[_0x6cf0('0x29')](handleEntityNotFound(_0x40b94f,null))[_0x6cf0('0x29')](respondWithStatusCode(_0x40b94f,null))[_0x6cf0('0x44')](handleError(_0x40b94f,null));};exports[_0x6cf0('0x67')]=function(_0xad6a77,_0x122917,_0x167086){var _0x2b9bd6=[];var _0x55f6d0;return db[_0x6cf0('0x60')]['findAll']({'where':{'id':_0xad6a77['query'][_0x6cf0('0x61')]},'attributes':['id'],'include':[{'model':db[_0x6cf0('0x58')],'as':_0x6cf0('0x62'),'attributes':['id'],'raw':!![]}]})[_0x6cf0('0x29')](function(_0x24680b){if(_0x24680b){for(var _0x7460c4=0x0;_0x7460c4<_0x24680b['length'];_0x7460c4+=0x1){for(var _0xa67e5c=0x0;_0xa67e5c<_0x24680b[_0x7460c4][_0x6cf0('0x62')][_0x6cf0('0x36')];_0xa67e5c+=0x1){_0x2b9bd6=_['union'](_0x2b9bd6,[_0x24680b[_0x7460c4][_0x6cf0('0x62')][_0xa67e5c]['id']]);}}return _0x2b9bd6;}})[_0x6cf0('0x29')](function(_0x3830bd){if(_0x3830bd){return db[_0x6cf0('0x2e')][_0x6cf0('0x48')]({'where':{'id':_0xad6a77['params']['id']}});}})['then'](function(_0x2ffb21){if(_0x2ffb21){_0x55f6d0=_0x2ffb21;return _0x55f6d0[_0x6cf0('0x68')](_0x2b9bd6);}})[_0x6cf0('0x29')](function(_0x3bac47){if(_0x55f6d0){return _0x55f6d0[_0x6cf0('0x67')](_0xad6a77[_0x6cf0('0x31')][_0x6cf0('0x61')]);}})[_0x6cf0('0x29')](handleEntityNotFound(_0x122917,null))[_0x6cf0('0x29')](respondWithStatusCode(_0x122917,null))[_0x6cf0('0x44')](handleError(_0x122917,null));};exports['addAgents']=function(_0x121685,_0x5dfe9e,_0x2aee5f){return db[_0x6cf0('0x2e')][_0x6cf0('0x48')]({'where':{'id':_0x121685[_0x6cf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dfe9e,null))[_0x6cf0('0x29')](function(_0x2ce432){if(_0x2ce432){return _0x2ce432[_0x6cf0('0x64')](_0x121685[_0x6cf0('0x4a')][_0x6cf0('0x61')],_[_0x6cf0('0x69')](_0x121685[_0x6cf0('0x4a')],[_0x6cf0('0x61'),'id'])||{})[_0x6cf0('0x6a')](function(_0x2dfd97){for(var _0x52f6b2=0x0;_0x52f6b2<_0x121685[_0x6cf0('0x4a')][_0x6cf0('0x61')]['length'];_0x52f6b2+=0x1){socket[_0x6cf0('0x6b')](_0x6cf0('0x6c'),{'UserId':_0x121685[_0x6cf0('0x4a')][_0x6cf0('0x61')][_0x52f6b2],'SmsQueueId':_0x121685[_0x6cf0('0x46')]['id']});}return _0x2dfd97;});}})['then'](respondWithResult(_0x5dfe9e,null))[_0x6cf0('0x44')](handleError(_0x5dfe9e,null));};exports[_0x6cf0('0x68')]=function(_0x1457ea,_0x17058c,_0x5a3c1c){var _0x45c875;return db[_0x6cf0('0x2e')][_0x6cf0('0x48')]({'where':{'id':_0x1457ea[_0x6cf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x17058c,null))[_0x6cf0('0x29')](function(_0x1102c0){if(_0x1102c0){return _0x1102c0[_0x6cf0('0x68')](_0x1457ea[_0x6cf0('0x31')][_0x6cf0('0x61')])['then'](function(_0x22c28c){if(_['isArray'](_0x1457ea['query']['ids'])){for(var _0x32450c=0x0;_0x32450c<_0x1457ea[_0x6cf0('0x31')]['ids'][_0x6cf0('0x36')];_0x32450c+=0x1){socket['emit'](_0x6cf0('0x6d'),{'UserId':_0x1457ea[_0x6cf0('0x31')][_0x6cf0('0x61')][_0x32450c],'SmsQueueId':_0x1457ea[_0x6cf0('0x46')]['id']});}}else{socket[_0x6cf0('0x6b')](_0x6cf0('0x6d'),{'UserId':_0x1457ea[_0x6cf0('0x31')]['ids'],'SmsQueueId':_0x1457ea[_0x6cf0('0x46')]['id']});}});}})[_0x6cf0('0x29')](respondWithStatusCode(_0x17058c,null))[_0x6cf0('0x44')](handleError(_0x17058c,null));};exports[_0x6cf0('0x6e')]=function(_0x4544f2,_0x3328a0,_0x4c252e){var _0x48c8e7={};var _0x3b9701={};var _0x16a773;var _0x5977d7;return db[_0x6cf0('0x2e')][_0x6cf0('0x53')]({'where':{'id':_0x4544f2['params']['id']}})['then'](handleEntityNotFound(_0x3328a0,null))[_0x6cf0('0x29')](function(_0x3f5180){if(_0x3f5180){_0x16a773=_0x3f5180;_0x3b9701['model']=_[_0x6cf0('0x32')](db[_0x6cf0('0x58')][_0x6cf0('0x2f')]);_0x3b9701['query']=_['keys'](_0x4544f2[_0x6cf0('0x31')]);_0x3b9701[_0x6cf0('0x33')]=_[_0x6cf0('0x47')](_0x3b9701[_0x6cf0('0x30')],_0x3b9701[_0x6cf0('0x31')]);_0x48c8e7['attributes']=_['intersection'](_0x3b9701['model'],qs[_0x6cf0('0x34')](_0x4544f2[_0x6cf0('0x31')]['fields']));_0x48c8e7[_0x6cf0('0x35')]=_0x48c8e7[_0x6cf0('0x35')][_0x6cf0('0x36')]?_0x48c8e7[_0x6cf0('0x35')]:_0x3b9701['model'];_0x48c8e7['order']=qs[_0x6cf0('0x3a')](_0x4544f2[_0x6cf0('0x31')][_0x6cf0('0x3a')]);_0x48c8e7[_0x6cf0('0x3b')]=qs[_0x6cf0('0x33')](_[_0x6cf0('0x55')](_0x4544f2[_0x6cf0('0x31')],_0x3b9701['filters']));if(_0x4544f2[_0x6cf0('0x31')]['filter']){_0x48c8e7['where']=_[_0x6cf0('0x3d')](_0x48c8e7[_0x6cf0('0x3b')],{'$or':_[_0x6cf0('0x57')](_0x48c8e7[_0x6cf0('0x35')],function(_0x30dfcf){var _0x2225ab={};_0x2225ab[_0x30dfcf]={'$like':'%'+_0x4544f2[_0x6cf0('0x31')][_0x6cf0('0x3c')]+'%'};return _0x2225ab;})});}_0x48c8e7=_[_0x6cf0('0x3d')]({},_0x48c8e7,_0x4544f2[_0x6cf0('0x3f')]);return _0x16a773[_0x6cf0('0x6e')](_0x48c8e7);}})['then'](function(_0x24993e){if(_0x24993e){_0x5977d7=_0x24993e[_0x6cf0('0x36')];if(!_0x4544f2[_0x6cf0('0x31')][_0x6cf0('0x37')](_0x6cf0('0x38'))){_0x48c8e7[_0x6cf0('0x1e')]=qs[_0x6cf0('0x1e')](_0x4544f2[_0x6cf0('0x31')][_0x6cf0('0x1e')]);_0x48c8e7[_0x6cf0('0x1d')]=qs[_0x6cf0('0x1d')](_0x4544f2[_0x6cf0('0x31')]['offset']);}return _0x16a773[_0x6cf0('0x6e')](_0x48c8e7);}})[_0x6cf0('0x29')](function(_0x43383e){if(_0x43383e){return _0x43383e?{'count':_0x5977d7,'rows':_0x43383e}:null;}})[_0x6cf0('0x29')](respondWithResult(_0x3328a0,null))['catch'](handleError(_0x3328a0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 06c47e4..86c7d4f 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 _0x8afd=['SmsQueue','setMaxListeners','save','update','remove','emit','exports'];(function(_0x873f5c,_0x342db){var _0x49dc88=function(_0x1b64b7){while(--_0x1b64b7){_0x873f5c['push'](_0x873f5c['shift']());}};_0x49dc88(++_0x342db);}(_0x8afd,0x11f));var _0xd8af=function(_0x1a2fec,_0x170337){_0x1a2fec=_0x1a2fec-0x0;var _0x750ec2=_0x8afd[_0x1a2fec];return _0x750ec2;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0xd8af('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd8af('0x1')](0x0);var events={'afterCreate':_0xd8af('0x2'),'afterUpdate':_0xd8af('0x3'),'afterDestroy':_0xd8af('0x4')};function emitEvent(_0x4fbda7){return function(_0x464d80,_0x379ba1,_0x5e5b69){SmsQueueEvents[_0xd8af('0x5')](_0x4fbda7+':'+_0x464d80['id'],_0x464d80);SmsQueueEvents['emit'](_0x4fbda7,_0x464d80);_0x5e5b69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd8af('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x4b42=['hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x9b6c1e,_0xfca0a1){var _0x7bf94b=function(_0x12077c){while(--_0x12077c){_0x9b6c1e['push'](_0x9b6c1e['shift']());}};_0x7bf94b(++_0xfca0a1);}(_0x4b42,0x11a));var _0x24b4=function(_0x5c46c0,_0x56e2be){_0x5c46c0=_0x5c46c0-0x0;var _0x11e66f=_0x4b42[_0x5c46c0];return _0x11e66f;};'use strict';var EventEmitter=require(_0x24b4('0x0'));var SmsQueue=require(_0x24b4('0x1'))['db'][_0x24b4('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x24b4('0x3')](0x0);var events={'afterCreate':_0x24b4('0x4'),'afterUpdate':_0x24b4('0x5'),'afterDestroy':_0x24b4('0x6')};function emitEvent(_0x2179d1){return function(_0x1af96b,_0x1d4150,_0x594011){SmsQueueEvents['emit'](_0x2179d1+':'+_0x1af96b['id'],_0x1af96b);SmsQueueEvents[_0x24b4('0x7')](_0x2179d1,_0x1af96b);_0x594011(null);};}for(var e in events){if(events[_0x24b4('0x8')](e)){var event=events[e];SmsQueue[_0x24b4('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b7334ad..e44abc7 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 _0x644d=['bluebird','request-promise','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','api','moment'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x644d,0x150));var _0xd644=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x644d[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0xd644('0x0'));var util=require(_0xd644('0x1'));var logger=require('../../config/logger')(_0xd644('0x2'));var moment=require(_0xd644('0x3'));var BPromise=require(_0xd644('0x4'));var rp=require(_0xd644('0x5'));var attributes=require(_0xd644('0x6'));module['exports']=function(_0x87699,_0x2dd9b6){return _0x87699[_0xd644('0x7')](_0xd644('0x8'),attributes,{'tableName':_0xd644('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3079=['define','sms_queues','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x3079,0x6a));var _0x9307=function(_0x578cbe,_0x5b6e49){_0x578cbe=_0x578cbe-0x0;var _0x1a088e=_0x3079[_0x578cbe];return _0x1a088e;};'use strict';var _=require('lodash');var util=require(_0x9307('0x0'));var logger=require(_0x9307('0x1'))(_0x9307('0x2'));var moment=require(_0x9307('0x3'));var BPromise=require(_0x9307('0x4'));var rp=require('request-promise');var attributes=require('./smsQueue.attributes');module[_0x9307('0x5')]=function(_0x1e849b,_0x84816b){return _0x1e849b[_0x9307('0x6')]('SmsQueue',attributes,{'tableName':_0x9307('0x7'),'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 cd3bdde..ae29d09 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 _0x573a=['attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','SmsQueue','findAll','options','raw','where'];(function(_0x3f8246,_0x206dad){var _0x13c59c=function(_0x3ae9e7){while(--_0x3ae9e7){_0x3f8246['push'](_0x3f8246['shift']());}};_0x13c59c(++_0x206dad);}(_0x573a,0x82));var _0xa573=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x573a[_0x26efac];return _0x8482e4;};'use strict';var _=require(_0xa573('0x0'));var util=require('util');var moment=require(_0xa573('0x1'));var BPromise=require(_0xa573('0x2'));var rs=require(_0xa573('0x3'));var fs=require('fs');var Redis=require(_0xa573('0x4'));var db=require(_0xa573('0x5'))['db'];var utils=require(_0xa573('0x6'));var logger=require(_0xa573('0x7'))('rpc');var config=require(_0xa573('0x8'));var jayson=require(_0xa573('0x9'));var client=jayson[_0xa573('0xa')][_0xa573('0xb')]({'port':0x232a});config[_0xa573('0xc')]=_['defaults'](config[_0xa573('0xc')],{'host':_0xa573('0xd'),'port':0x18eb});var socket=require(_0xa573('0xe'))(new Redis(config['redis']));require(_0xa573('0xf'))[_0xa573('0x10')](socket);function respondWithRpcPromise(_0x30ed52,_0x1f27b8,_0x324fe2){return new BPromise(function(_0x4a48da,_0x1a2fd5){return client[_0xa573('0x11')](_0x30ed52,_0x324fe2)['then'](function(_0xede328){logger[_0xa573('0x12')](_0xa573('0x13'),_0x1f27b8,'request\x20sent');logger[_0xa573('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1f27b8,_0xa573('0x15'),JSON[_0xa573('0x16')](_0xede328));if(_0xede328['error']){if(_0xede328[_0xa573('0x17')]['code']===0x1f4){logger['error'](_0xa573('0x13'),_0x1f27b8,_0xede328['error'][_0xa573('0x18')]);return _0x1a2fd5(_0xede328[_0xa573('0x17')][_0xa573('0x18')]);}logger[_0xa573('0x17')](_0xa573('0x13'),_0x1f27b8,_0xede328[_0xa573('0x17')][_0xa573('0x18')]);return _0x4a48da(_0xede328[_0xa573('0x17')][_0xa573('0x18')]);}else{logger[_0xa573('0x12')](_0xa573('0x13'),_0x1f27b8,'request\x20sent');_0x4a48da(_0xede328['result'][_0xa573('0x18')]);}})['catch'](function(_0x94d39e){logger[_0xa573('0x17')](_0xa573('0x13'),_0x1f27b8,_0x94d39e);_0x1a2fd5(_0x94d39e);});});}exports['GetSmsQueue']=function(_0x5eb516){var _0x2bbbad=this;return new Promise(function(_0x1a3350,_0x335de3){return db[_0xa573('0x19')][_0xa573('0x1a')]({'raw':_0x5eb516[_0xa573('0x1b')]?_0x5eb516[_0xa573('0x1b')][_0xa573('0x1c')]===undefined?!![]:![]:!![],'where':_0x5eb516[_0xa573('0x1b')]?_0x5eb516['options'][_0xa573('0x1d')]||null:null,'attributes':_0x5eb516[_0xa573('0x1b')]?_0x5eb516['options'][_0xa573('0x1e')]||null:null,'limit':_0x5eb516[_0xa573('0x1b')]?_0x5eb516['options'][_0xa573('0x1f')]||null:null,'include':_0x5eb516[_0xa573('0x1b')]?_0x5eb516[_0xa573('0x1b')][_0xa573('0x20')]?_['map'](_0x5eb516[_0xa573('0x1b')][_0xa573('0x20')],function(_0x615796){return{'model':db[_0x615796['model']],'as':_0x615796['as'],'attributes':_0x615796['attributes'],'include':_0x615796[_0xa573('0x20')]?_[_0xa573('0x21')](_0x615796[_0xa573('0x20')],function(_0x288252){return{'model':db[_0x288252[_0xa573('0x22')]],'as':_0x288252['as'],'attributes':_0x288252[_0xa573('0x1e')],'include':_0x288252[_0xa573('0x20')]?_[_0xa573('0x21')](_0x288252[_0xa573('0x20')],function(_0x252bed){return{'model':db[_0x252bed[_0xa573('0x22')]],'as':_0x252bed['as'],'attributes':_0x252bed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x525268){logger[_0xa573('0x12')](_0xa573('0x23'),_0x5eb516);logger['debug'](_0xa573('0x23'),_0x5eb516,JSON[_0xa573('0x16')](_0x525268));_0x1a3350(_0x525268);})['catch'](function(_0xe4696a){logger['error']('GetSmsQueue',_0xe4696a[_0xa573('0x18')],_0x5eb516);_0x335de3(_0x2bbbad['error'](0x1f4,_0xe4696a[_0xa573('0x18')]));});});};exports[_0xa573('0x24')]=function(_0x2704ed){var _0x14e4cd=this;return new Promise(function(_0x4a6382,_0x5d7eee){return db[_0xa573('0x19')][_0xa573('0x25')]({'raw':_0x2704ed[_0xa573('0x1b')]?_0x2704ed['options'][_0xa573('0x1c')]===undefined?!![]:![]:!![],'where':_0x2704ed[_0xa573('0x1b')]?_0x2704ed[_0xa573('0x1b')][_0xa573('0x1d')]||null:null,'attributes':_0x2704ed[_0xa573('0x1b')]?_0x2704ed[_0xa573('0x1b')][_0xa573('0x1e')]||null:null,'include':_0x2704ed[_0xa573('0x1b')]?_0x2704ed[_0xa573('0x1b')][_0xa573('0x20')]?_[_0xa573('0x21')](_0x2704ed[_0xa573('0x1b')][_0xa573('0x20')],function(_0x116594){return{'model':db[_0x116594[_0xa573('0x22')]],'as':_0x116594['as'],'attributes':_0x116594['attributes'],'include':_0x116594[_0xa573('0x20')]?_[_0xa573('0x21')](_0x116594[_0xa573('0x20')],function(_0x3fec0c){return{'model':db[_0x3fec0c['model']],'as':_0x3fec0c['as'],'attributes':_0x3fec0c[_0xa573('0x1e')],'include':_0x3fec0c[_0xa573('0x20')]?_['map'](_0x3fec0c['include'],function(_0x515ebd){return{'model':db[_0x515ebd[_0xa573('0x22')]],'as':_0x515ebd['as'],'attributes':_0x515ebd[_0xa573('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa573('0x26')](function(_0x92a26e){logger['info']('ShowSmsQueue',_0x2704ed);logger[_0xa573('0x14')](_0xa573('0x24'),_0x2704ed,JSON[_0xa573('0x16')](_0x92a26e));_0x4a6382(_0x92a26e);})[_0xa573('0x27')](function(_0x13a935){logger['error'](_0xa573('0x24'),_0x13a935[_0xa573('0x18')],_0x2704ed);_0x5d7eee(_0x14e4cd[_0xa573('0x17')](0x1f4,_0x13a935[_0xa573('0x18')]));});});}; \ No newline at end of file +var _0xaeff=['defaults','socket.io-emitter','redis','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','SmsQueue','options','raw','attributes','limit','include','map','model','GetSmsQueue','stringify','catch','ShowSmsQueue','find','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0xaeff,0xea));var _0xfaef=function(_0x2622d3,_0x1bfdcc){_0x2622d3=_0x2622d3-0x0;var _0x40c58c=_0xaeff[_0x2622d3];return _0x40c58c;};'use strict';var _=require(_0xfaef('0x0'));var util=require(_0xfaef('0x1'));var moment=require(_0xfaef('0x2'));var BPromise=require(_0xfaef('0x3'));var rs=require(_0xfaef('0x4'));var fs=require('fs');var Redis=require(_0xfaef('0x5'));var db=require(_0xfaef('0x6'))['db'];var utils=require(_0xfaef('0x7'));var logger=require('../../config/logger')(_0xfaef('0x8'));var config=require('../../config/environment');var jayson=require(_0xfaef('0x9'));var client=jayson[_0xfaef('0xa')][_0xfaef('0xb')]({'port':0x232a});config['redis']=_[_0xfaef('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfaef('0xd'))(new Redis(config[_0xfaef('0xe')]));require(_0xfaef('0xf'))[_0xfaef('0x10')](socket);function respondWithRpcPromise(_0x177344,_0x10a7ad,_0x4cce39){return new BPromise(function(_0x5e6cbc,_0x202113){return client[_0xfaef('0x11')](_0x177344,_0x4cce39)[_0xfaef('0x12')](function(_0x5db95f){logger['info'](_0xfaef('0x13'),_0x10a7ad,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x10a7ad,_0xfaef('0x14'),JSON['stringify'](_0x5db95f));if(_0x5db95f[_0xfaef('0x15')]){if(_0x5db95f[_0xfaef('0x15')][_0xfaef('0x16')]===0x1f4){logger[_0xfaef('0x15')]('SmsQueue,\x20%s,\x20%s',_0x10a7ad,_0x5db95f['error'][_0xfaef('0x17')]);return _0x202113(_0x5db95f['error'][_0xfaef('0x17')]);}logger[_0xfaef('0x15')]('SmsQueue,\x20%s,\x20%s',_0x10a7ad,_0x5db95f[_0xfaef('0x15')][_0xfaef('0x17')]);return _0x5e6cbc(_0x5db95f['error']['message']);}else{logger[_0xfaef('0x18')](_0xfaef('0x13'),_0x10a7ad,_0xfaef('0x14'));_0x5e6cbc(_0x5db95f[_0xfaef('0x19')][_0xfaef('0x17')]);}})['catch'](function(_0x86b7a9){logger['error'](_0xfaef('0x13'),_0x10a7ad,_0x86b7a9);_0x202113(_0x86b7a9);});});}exports['GetSmsQueue']=function(_0x5b9ceb){var _0x3c9a21=this;return new Promise(function(_0x5d296c,_0x5a4dc9){return db[_0xfaef('0x1a')]['findAll']({'raw':_0x5b9ceb[_0xfaef('0x1b')]?_0x5b9ceb[_0xfaef('0x1b')][_0xfaef('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b9ceb[_0xfaef('0x1b')]?_0x5b9ceb[_0xfaef('0x1b')]['where']||null:null,'attributes':_0x5b9ceb[_0xfaef('0x1b')]?_0x5b9ceb[_0xfaef('0x1b')][_0xfaef('0x1d')]||null:null,'limit':_0x5b9ceb['options']?_0x5b9ceb[_0xfaef('0x1b')][_0xfaef('0x1e')]||null:null,'include':_0x5b9ceb[_0xfaef('0x1b')]?_0x5b9ceb[_0xfaef('0x1b')][_0xfaef('0x1f')]?_[_0xfaef('0x20')](_0x5b9ceb[_0xfaef('0x1b')][_0xfaef('0x1f')],function(_0x2dd891){return{'model':db[_0x2dd891['model']],'as':_0x2dd891['as'],'attributes':_0x2dd891['attributes'],'include':_0x2dd891[_0xfaef('0x1f')]?_[_0xfaef('0x20')](_0x2dd891[_0xfaef('0x1f')],function(_0x2c3b7b){return{'model':db[_0x2c3b7b[_0xfaef('0x21')]],'as':_0x2c3b7b['as'],'attributes':_0x2c3b7b[_0xfaef('0x1d')],'include':_0x2c3b7b[_0xfaef('0x1f')]?_[_0xfaef('0x20')](_0x2c3b7b[_0xfaef('0x1f')],function(_0x89e18){return{'model':db[_0x89e18[_0xfaef('0x21')]],'as':_0x89e18['as'],'attributes':_0x89e18[_0xfaef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfaef('0x12')](function(_0x47a758){logger[_0xfaef('0x18')](_0xfaef('0x22'),_0x5b9ceb);logger['debug'](_0xfaef('0x22'),_0x5b9ceb,JSON[_0xfaef('0x23')](_0x47a758));_0x5d296c(_0x47a758);})[_0xfaef('0x24')](function(_0x1244d2){logger[_0xfaef('0x15')]('GetSmsQueue',_0x1244d2[_0xfaef('0x17')],_0x5b9ceb);_0x5a4dc9(_0x3c9a21[_0xfaef('0x15')](0x1f4,_0x1244d2[_0xfaef('0x17')]));});});};exports[_0xfaef('0x25')]=function(_0x3b7c37){var _0x58ce45=this;return new Promise(function(_0x292881,_0x5e7d38){return db[_0xfaef('0x1a')][_0xfaef('0x26')]({'raw':_0x3b7c37[_0xfaef('0x1b')]?_0x3b7c37[_0xfaef('0x1b')][_0xfaef('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b7c37[_0xfaef('0x1b')]?_0x3b7c37[_0xfaef('0x1b')][_0xfaef('0x27')]||null:null,'attributes':_0x3b7c37[_0xfaef('0x1b')]?_0x3b7c37['options'][_0xfaef('0x1d')]||null:null,'include':_0x3b7c37[_0xfaef('0x1b')]?_0x3b7c37[_0xfaef('0x1b')][_0xfaef('0x1f')]?_['map'](_0x3b7c37[_0xfaef('0x1b')][_0xfaef('0x1f')],function(_0x2b38ee){return{'model':db[_0x2b38ee[_0xfaef('0x21')]],'as':_0x2b38ee['as'],'attributes':_0x2b38ee[_0xfaef('0x1d')],'include':_0x2b38ee[_0xfaef('0x1f')]?_[_0xfaef('0x20')](_0x2b38ee[_0xfaef('0x1f')],function(_0x14d9e3){return{'model':db[_0x14d9e3[_0xfaef('0x21')]],'as':_0x14d9e3['as'],'attributes':_0x14d9e3[_0xfaef('0x1d')],'include':_0x14d9e3['include']?_[_0xfaef('0x20')](_0x14d9e3[_0xfaef('0x1f')],function(_0x10478e){return{'model':db[_0x10478e[_0xfaef('0x21')]],'as':_0x10478e['as'],'attributes':_0x10478e['attributes']};}):[]};}):[]};}):[]:[]})[_0xfaef('0x12')](function(_0x204555){logger[_0xfaef('0x18')](_0xfaef('0x25'),_0x3b7c37);logger[_0xfaef('0x28')]('ShowSmsQueue',_0x3b7c37,JSON[_0xfaef('0x23')](_0x204555));_0x292881(_0x204555);})['catch'](function(_0x598a97){logger['error']('ShowSmsQueue',_0x598a97[_0xfaef('0x17')],_0x3b7c37);_0x5e7d38(_0x58ce45[_0xfaef('0x15')](0x1f4,_0x598a97[_0xfaef('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index eed8258..3784abc 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 _0xd61c=['register','length','./smsQueue.events','save','remove','emit','removeListener'];(function(_0x20468a,_0x34eeea){var _0x3bb0cc=function(_0x11901e){while(--_0x11901e){_0x20468a['push'](_0x20468a['shift']());}};_0x3bb0cc(++_0x34eeea);}(_0xd61c,0xb1));var _0xcd61=function(_0x284f5b,_0x3958e3){_0x284f5b=_0x284f5b-0x0;var _0x267477=_0xd61c[_0x284f5b];return _0x267477;};'use strict';var SmsQueueEvents=require(_0xcd61('0x0'));var events=[_0xcd61('0x1'),_0xcd61('0x2'),'update'];function createListener(_0x444368,_0x5490a8){return function(_0x18973c){_0x5490a8[_0xcd61('0x3')](_0x444368,_0x18973c);};}function removeListener(_0x26b81a,_0x3be823){return function(){SmsQueueEvents[_0xcd61('0x4')](_0x26b81a,_0x3be823);};}exports[_0xcd61('0x5')]=function(_0x2da939){for(var _0x3f1299=0x0,_0x1bf94f=events[_0xcd61('0x6')];_0x3f1299<_0x1bf94f;_0x3f1299++){var _0x47dddf=events[_0x3f1299];var _0x42bff7=createListener('smsQueue:'+_0x47dddf,_0x2da939);SmsQueueEvents['on'](_0x47dddf,_0x42bff7);}}; \ No newline at end of file +var _0x4e83=['update','register','length','smsQueue:','./smsQueue.events','remove'];(function(_0x24001a,_0x35aa7a){var _0x3bc5a8=function(_0x28b80b){while(--_0x28b80b){_0x24001a['push'](_0x24001a['shift']());}};_0x3bc5a8(++_0x35aa7a);}(_0x4e83,0x1ae));var _0x34e8=function(_0x55b460,_0x497077){_0x55b460=_0x55b460-0x0;var _0x3ac537=_0x4e83[_0x55b460];return _0x3ac537;};'use strict';var SmsQueueEvents=require(_0x34e8('0x0'));var events=['save',_0x34e8('0x1'),_0x34e8('0x2')];function createListener(_0x1752b7,_0x585137){return function(_0xfe2697){_0x585137['emit'](_0x1752b7,_0xfe2697);};}function removeListener(_0x5dc841,_0x506eb2){return function(){SmsQueueEvents['removeListener'](_0x5dc841,_0x506eb2);};}exports[_0x34e8('0x3')]=function(_0x3ec7cb){for(var _0x559726=0x0,_0x30a3c4=events[_0x34e8('0x4')];_0x559726<_0x30a3c4;_0x559726++){var _0x28677c=events[_0x559726];var _0x5b5ddc=createListener(_0x34e8('0x5')+_0x28677c,_0x3ec7cb);SmsQueueEvents['on'](_0x28677c,_0x5b5ddc);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ed923ac..ded4fc8 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 _0x979e=['post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x1f5027,_0x10d23c){var _0xcddccd=function(_0x41baab){while(--_0x41baab){_0x1f5027['push'](_0x1f5027['shift']());}};_0xcddccd(++_0x10d23c);}(_0x979e,0x195));var _0xe979=function(_0x4ed5b4,_0x9254a){_0x4ed5b4=_0x4ed5b4-0x0;var _0x220d9e=_0x979e[_0x4ed5b4];return _0x220d9e;};'use strict';var multer=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var path=require(_0xe979('0x2'));var timeout=require(_0xe979('0x3'));var express=require('express');var router=express[_0xe979('0x4')]();var auth=require(_0xe979('0x5'));var interaction=require(_0xe979('0x6'));var config=require(_0xe979('0x7'));var controller=require(_0xe979('0x8'));router['get']('/',auth[_0xe979('0x9')](),controller['index']);router[_0xe979('0xa')](_0xe979('0xb'),auth[_0xe979('0x9')](),controller[_0xe979('0xc')]);router[_0xe979('0xa')](_0xe979('0xd'),auth[_0xe979('0x9')](),controller[_0xe979('0xe')]);router[_0xe979('0xf')]('/',auth[_0xe979('0x9')](),controller[_0xe979('0x10')]);router['put'](_0xe979('0xd'),auth[_0xe979('0x9')](),controller[_0xe979('0x11')]);router['delete'](_0xe979('0xd'),auth[_0xe979('0x9')](),controller[_0xe979('0x12')]);module[_0xe979('0x13')]=router; \ No newline at end of file +var _0x37c5=['/:id','isAuthenticated','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','describe'];(function(_0x220f3b,_0x34332d){var _0x752fb7=function(_0x1d235e){while(--_0x1d235e){_0x220f3b['push'](_0x220f3b['shift']());}};_0x752fb7(++_0x34332d);}(_0x37c5,0xa7));var _0x537c=function(_0x490585,_0x21a95d){_0x490585=_0x490585-0x0;var _0x8751ea=_0x37c5[_0x490585];return _0x8751ea;};'use strict';var multer=require('multer');var util=require(_0x537c('0x0'));var path=require(_0x537c('0x1'));var timeout=require(_0x537c('0x2'));var express=require(_0x537c('0x3'));var router=express[_0x537c('0x4')]();var auth=require(_0x537c('0x5'));var interaction=require(_0x537c('0x6'));var config=require(_0x537c('0x7'));var controller=require(_0x537c('0x8'));router[_0x537c('0x9')]('/',auth['isAuthenticated'](),controller[_0x537c('0xa')]);router[_0x537c('0x9')](_0x537c('0xb'),auth['isAuthenticated'](),controller[_0x537c('0xc')]);router[_0x537c('0x9')](_0x537c('0xd'),auth[_0x537c('0xe')](),controller['show']);router[_0x537c('0xf')]('/',auth[_0x537c('0xe')](),controller[_0x537c('0x10')]);router['put'](_0x537c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x537c('0x11')]('/:id',auth[_0x537c('0xe')](),controller[_0x537c('0x12')]);module[_0x537c('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index bc8c06f..56c7567 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 _0xd9f4=['DATE','STRING','sequelize'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xd9f4,0x1d9));var _0x4d9f=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xd9f4[_0x5471ec];return _0x121d4c;};'use strict';var moment=require('moment');var Sequelize=require(_0x4d9f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4d9f('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4d9f('0x1')]},'exitAt':{'type':Sequelize[_0x4d9f('0x1')]},'reason':{'type':Sequelize[_0x4d9f('0x2')]}}; \ No newline at end of file +var _0x3420=['DATE','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3420,0x181));var _0x0342=function(_0x3a678a,_0x61219){_0x3a678a=_0x3a678a-0x0;var _0x3141a6=_0x3420[_0x3a678a];return _0x3141a6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0342('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0342('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0342('0x2')]},'exitAt':{'type':Sequelize[_0x0342('0x2')]},'reason':{'type':Sequelize[_0x0342('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0ab958c..b7c6615 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 _0x1e0d=['rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','key','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','keys','length','include','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','SmsQueueReport'];(function(_0x39fe33,_0x3eaf6a){var _0xf509a3=function(_0x22f157){while(--_0x22f157){_0x39fe33['push'](_0x39fe33['shift']());}};_0xf509a3(++_0x3eaf6a);}(_0x1e0d,0x1ca));var _0xd1e0=function(_0x500f80,_0x3947be){_0x500f80=_0x500f80-0x0;var _0xaf10b3=_0x1e0d[_0x500f80];return _0xaf10b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd1e0('0x0'));var rimraf=require(_0xd1e0('0x1'));var zipdir=require(_0xd1e0('0x2'));var jsonpatch=require(_0xd1e0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd1e0('0x4'));var Mustache=require(_0xd1e0('0x5'));var util=require('util');var path=require(_0xd1e0('0x6'));var sox=require(_0xd1e0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd1e0('0x8'));var squel=require(_0xd1e0('0x9'));var crypto=require('crypto');var jsforce=require(_0xd1e0('0xa'));var deskjs=require(_0xd1e0('0xb'));var toCsv=require(_0xd1e0('0xc'));var querystring=require(_0xd1e0('0xd'));var Papa=require(_0xd1e0('0xe'));var authService=require(_0xd1e0('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd1e0('0x10'));var qs=require(_0xd1e0('0x11'));var logger=require(_0xd1e0('0x12'))(_0xd1e0('0x13'));var utils=require('../../config/utils');var config=require(_0xd1e0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc1a4,_0x114270){_0x114270=_0x114270||0xcc;return function(_0x1ae1aa){if(_0x1ae1aa){return _0x3dc1a4[_0xd1e0('0x15')](_0x114270);}return _0x3dc1a4[_0xd1e0('0x16')](_0x114270)[_0xd1e0('0x17')]();};}function respondWithResult(_0x38a2bc,_0xa2a671){_0xa2a671=_0xa2a671||0xc8;return function(_0x14feb5){if(_0x14feb5){return _0x38a2bc[_0xd1e0('0x16')](_0xa2a671)[_0xd1e0('0x18')](_0x14feb5);}};}function respondWithFilteredResult(_0x4ee938,_0x1c235f){return function(_0x2d63a5){if(_0x2d63a5){var _0x537460=_0x2d63a5['count'],_0x1e6803=_0x1c235f['offset'],_0x545c3e=_0x1c235f[_0xd1e0('0x19')]+_0x1c235f[_0xd1e0('0x1a')],_0x4c5fed;if(_0x545c3e>=_0x537460){_0x545c3e=_0x537460;_0x4c5fed=0xc8;}else{_0x4c5fed=0xce;}_0x4ee938[_0xd1e0('0x16')](_0x4c5fed);return _0x4ee938[_0xd1e0('0x1b')]('Content-Range',_0x1e6803+'-'+_0x545c3e+'/'+_0x537460)[_0xd1e0('0x18')](_0x2d63a5);}return null;};}function patchUpdates(_0x4ba1f2){return function(_0x37520a){try{jsonpatch[_0xd1e0('0x1c')](_0x37520a,_0x4ba1f2,!![]);}catch(_0xdb798e){return BPromise[_0xd1e0('0x1d')](_0xdb798e);}return _0x37520a[_0xd1e0('0x1e')]();};}function saveUpdates(_0x2e886f,_0x29c933){return function(_0x25de0e){if(_0x25de0e){return _0x25de0e[_0xd1e0('0x1f')](_0x2e886f)[_0xd1e0('0x20')](function(_0x288f06){return _0x288f06;});}return null;};}function removeEntity(_0x5c4a7c,_0x36fd6c){return function(_0x29aa9e){if(_0x29aa9e){return _0x29aa9e[_0xd1e0('0x21')]()[_0xd1e0('0x20')](function(){_0x5c4a7c[_0xd1e0('0x16')](0xcc)[_0xd1e0('0x17')]();});}};}function handleEntityNotFound(_0x33fee6,_0x10dd71){return function(_0x5b33af){if(!_0x5b33af){_0x33fee6[_0xd1e0('0x15')](0x194);}return _0x5b33af;};}function handleError(_0x585201,_0x5926b6){_0x5926b6=_0x5926b6||0x1f4;return function(_0x4a2983){logger[_0xd1e0('0x22')](_0x4a2983[_0xd1e0('0x23')]);if(_0x4a2983['name']){delete _0x4a2983[_0xd1e0('0x24')];}_0x585201['status'](_0x5926b6)['send'](_0x4a2983);};}exports[_0xd1e0('0x25')]=function(_0x48e859,_0x571345){var _0x4c78f4={},_0x4c0990={},_0x589c5c={'count':0x0,'rows':[]};var _0xf7a1f2=db[_0xd1e0('0x26')][_0xd1e0('0x27')];_0x4c0990['model']=_['keys'](_0xf7a1f2);_0x4c0990[_0xd1e0('0x28')]=_['keys'](_0x48e859[_0xd1e0('0x28')]);_0x4c0990[_0xd1e0('0x29')]=_[_0xd1e0('0x2a')](_0x4c0990[_0xd1e0('0x2b')],_0x4c0990[_0xd1e0('0x28')]);_0x4c78f4[_0xd1e0('0x2c')]=_[_0xd1e0('0x2a')](_0x4c0990[_0xd1e0('0x2b')],qs['fields'](_0x48e859[_0xd1e0('0x28')][_0xd1e0('0x2d')]));_0x4c78f4[_0xd1e0('0x2c')]=_0x4c78f4[_0xd1e0('0x2c')]['length']?_0x4c78f4[_0xd1e0('0x2c')]:_0x4c0990['model'];if(!_0x48e859['query'][_0xd1e0('0x2e')]('nolimit')){_0x4c78f4[_0xd1e0('0x1a')]=qs[_0xd1e0('0x1a')](_0x48e859[_0xd1e0('0x28')][_0xd1e0('0x1a')]);_0x4c78f4[_0xd1e0('0x19')]=qs[_0xd1e0('0x19')](_0x48e859['query'][_0xd1e0('0x19')]);}_0x4c78f4[_0xd1e0('0x2f')]=qs[_0xd1e0('0x30')](_0x48e859[_0xd1e0('0x28')][_0xd1e0('0x30')]);_0x4c78f4[_0xd1e0('0x31')]=qs[_0xd1e0('0x29')](_[_0xd1e0('0x32')](_0x48e859[_0xd1e0('0x28')],_0x4c0990['filters']));if(_0x48e859[_0xd1e0('0x28')][_0xd1e0('0x33')]){_0x4c78f4[_0xd1e0('0x31')]=_['merge'](_0x4c78f4[_0xd1e0('0x31')],{'$or':_['map'](_0xf7a1f2,function(_0x544488){if(_0x544488[_0xd1e0('0x34')][_0xd1e0('0x35')]!==_0xd1e0('0x36')){var _0x20065d={};_0x20065d[_0x544488['field']]={'$like':'%'+_0x48e859[_0xd1e0('0x28')]['filter']+'%'};return _0x20065d;}})});}_0x4c78f4=_['merge']({},_0x4c78f4,_0x48e859[_0xd1e0('0x37')]);var _0x371b16={'where':_0x4c78f4['where']};return db[_0xd1e0('0x26')][_0xd1e0('0x38')](_0x371b16)[_0xd1e0('0x20')](function(_0x5422eb){_0x589c5c['count']=_0x5422eb;if(_0x48e859[_0xd1e0('0x28')][_0xd1e0('0x39')]){_0x4c78f4['include']=[{'all':!![]}];}return db[_0xd1e0('0x26')][_0xd1e0('0x3a')](_0x4c78f4);})['then'](function(_0x315f2c){_0x589c5c[_0xd1e0('0x3b')]=_0x315f2c;return _0x589c5c;})[_0xd1e0('0x20')](respondWithFilteredResult(_0x571345,_0x4c78f4))[_0xd1e0('0x3c')](handleError(_0x571345,null));};exports[_0xd1e0('0x3d')]=function(_0x21b143,_0x2bb187){var _0x3d19fe={'raw':!![],'where':{'id':_0x21b143[_0xd1e0('0x3e')]['id']}},_0x10f6ae={};_0x10f6ae['model']=_[_0xd1e0('0x3f')](db[_0xd1e0('0x26')]['rawAttributes']);_0x10f6ae[_0xd1e0('0x28')]=_[_0xd1e0('0x3f')](_0x21b143[_0xd1e0('0x28')]);_0x10f6ae['filters']=_[_0xd1e0('0x2a')](_0x10f6ae[_0xd1e0('0x2b')],_0x10f6ae[_0xd1e0('0x28')]);_0x3d19fe[_0xd1e0('0x2c')]=_[_0xd1e0('0x2a')](_0x10f6ae[_0xd1e0('0x2b')],qs['fields'](_0x21b143[_0xd1e0('0x28')][_0xd1e0('0x2d')]));_0x3d19fe[_0xd1e0('0x2c')]=_0x3d19fe[_0xd1e0('0x2c')][_0xd1e0('0x40')]?_0x3d19fe[_0xd1e0('0x2c')]:_0x10f6ae[_0xd1e0('0x2b')];if(_0x21b143['query'][_0xd1e0('0x39')]){_0x3d19fe[_0xd1e0('0x41')]=[{'all':!![]}];}_0x3d19fe=_[_0xd1e0('0x42')]({},_0x3d19fe,_0x21b143[_0xd1e0('0x37')]);return db[_0xd1e0('0x26')][_0xd1e0('0x43')](_0x3d19fe)[_0xd1e0('0x20')](handleEntityNotFound(_0x2bb187,null))['then'](respondWithResult(_0x2bb187,null))[_0xd1e0('0x3c')](handleError(_0x2bb187,null));};exports[_0xd1e0('0x44')]=function(_0x438be5,_0x162a11){return db['SmsQueueReport'][_0xd1e0('0x44')](_0x438be5[_0xd1e0('0x45')],{})[_0xd1e0('0x20')](respondWithResult(_0x162a11,0xc9))[_0xd1e0('0x3c')](handleError(_0x162a11,null));};exports[_0xd1e0('0x1f')]=function(_0x30666d,_0x4d13fd){if(_0x30666d['body']['id']){delete _0x30666d[_0xd1e0('0x45')]['id'];}return db[_0xd1e0('0x26')][_0xd1e0('0x43')]({'where':{'id':_0x30666d[_0xd1e0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4d13fd,null))[_0xd1e0('0x20')](saveUpdates(_0x30666d[_0xd1e0('0x45')],null))[_0xd1e0('0x20')](respondWithResult(_0x4d13fd,null))[_0xd1e0('0x3c')](handleError(_0x4d13fd,null));};exports[_0xd1e0('0x21')]=function(_0x295bed,_0x7fc093){return db[_0xd1e0('0x26')][_0xd1e0('0x43')]({'where':{'id':_0x295bed[_0xd1e0('0x3e')]['id']}})[_0xd1e0('0x20')](handleEntityNotFound(_0x7fc093,null))[_0xd1e0('0x20')](removeEntity(_0x7fc093,null))[_0xd1e0('0x3c')](handleError(_0x7fc093,null));};exports[_0xd1e0('0x46')]=function(_0x2140fe,_0x42c7d7){return db[_0xd1e0('0x26')][_0xd1e0('0x46')]()[_0xd1e0('0x20')](respondWithResult(_0x42c7d7,null))['catch'](handleError(_0x42c7d7,null));}; \ No newline at end of file +var _0x15e8=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','fields','length','find','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x15e8,0x111));var _0x815e=function(_0x34fbf9,_0x4b0a7b){_0x34fbf9=_0x34fbf9-0x0;var _0x17bb6a=_0x15e8[_0x34fbf9];return _0x17bb6a;};'use strict';var pdf=require(_0x815e('0x0'));var emlformat=require(_0x815e('0x1'));var rimraf=require(_0x815e('0x2'));var zipdir=require(_0x815e('0x3'));var jsonpatch=require(_0x815e('0x4'));var rp=require(_0x815e('0x5'));var moment=require(_0x815e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x815e('0x7'));var util=require(_0x815e('0x8'));var path=require(_0x815e('0x9'));var sox=require(_0x815e('0xa'));var csv=require(_0x815e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x815e('0xc'));var crypto=require('crypto');var jsforce=require(_0x815e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x815e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x815e('0xe'));var hardwareService=require(_0x815e('0xf'));var Redis=require(_0x815e('0x10'));var qs=require(_0x815e('0x11'));var logger=require('../../config/logger')(_0x815e('0x12'));var utils=require(_0x815e('0x13'));var config=require(_0x815e('0x14'));var db=require(_0x815e('0x15'))['db'];function respondWithStatusCode(_0xa0a89f,_0x5eba76){_0x5eba76=_0x5eba76||0xcc;return function(_0x253585){if(_0x253585){return _0xa0a89f['sendStatus'](_0x5eba76);}return _0xa0a89f[_0x815e('0x16')](_0x5eba76)['end']();};}function respondWithResult(_0x4ea082,_0x621f40){_0x621f40=_0x621f40||0xc8;return function(_0x48bb7e){if(_0x48bb7e){return _0x4ea082[_0x815e('0x16')](_0x621f40)[_0x815e('0x17')](_0x48bb7e);}};}function respondWithFilteredResult(_0x5dffb2,_0x4f0cfb){return function(_0x2dbc66){if(_0x2dbc66){var _0x500064=_0x2dbc66[_0x815e('0x18')],_0x438f6b=_0x4f0cfb[_0x815e('0x19')],_0x580934=_0x4f0cfb['offset']+_0x4f0cfb[_0x815e('0x1a')],_0x32b308;if(_0x580934>=_0x500064){_0x580934=_0x500064;_0x32b308=0xc8;}else{_0x32b308=0xce;}_0x5dffb2[_0x815e('0x16')](_0x32b308);return _0x5dffb2[_0x815e('0x1b')](_0x815e('0x1c'),_0x438f6b+'-'+_0x580934+'/'+_0x500064)['json'](_0x2dbc66);}return null;};}function patchUpdates(_0x4df3c8){return function(_0x20700e){try{jsonpatch['apply'](_0x20700e,_0x4df3c8,!![]);}catch(_0x410dbc){return BPromise['reject'](_0x410dbc);}return _0x20700e[_0x815e('0x1d')]();};}function saveUpdates(_0x5a90ff,_0x5e927b){return function(_0x1bcfea){if(_0x1bcfea){return _0x1bcfea[_0x815e('0x1e')](_0x5a90ff)[_0x815e('0x1f')](function(_0x23e61d){return _0x23e61d;});}return null;};}function removeEntity(_0x494375,_0x5d6c96){return function(_0x3e7789){if(_0x3e7789){return _0x3e7789[_0x815e('0x20')]()['then'](function(){_0x494375['status'](0xcc)[_0x815e('0x21')]();});}};}function handleEntityNotFound(_0x23d7e0,_0x9da84e){return function(_0x51bf46){if(!_0x51bf46){_0x23d7e0[_0x815e('0x22')](0x194);}return _0x51bf46;};}function handleError(_0x450a0a,_0x29b144){_0x29b144=_0x29b144||0x1f4;return function(_0x265b7b){logger[_0x815e('0x23')](_0x265b7b[_0x815e('0x24')]);if(_0x265b7b[_0x815e('0x25')]){delete _0x265b7b[_0x815e('0x25')];}_0x450a0a['status'](_0x29b144)[_0x815e('0x26')](_0x265b7b);};}exports[_0x815e('0x27')]=function(_0x4d0bc2,_0x46028a){var _0x278f5d={},_0x1b1835={},_0x128a82={'count':0x0,'rows':[]};var _0xa29a17=db[_0x815e('0x28')][_0x815e('0x29')];_0x1b1835[_0x815e('0x2a')]=_[_0x815e('0x2b')](_0xa29a17);_0x1b1835[_0x815e('0x2c')]=_['keys'](_0x4d0bc2['query']);_0x1b1835[_0x815e('0x2d')]=_[_0x815e('0x2e')](_0x1b1835['model'],_0x1b1835[_0x815e('0x2c')]);_0x278f5d['attributes']=_[_0x815e('0x2e')](_0x1b1835[_0x815e('0x2a')],qs['fields'](_0x4d0bc2[_0x815e('0x2c')]['fields']));_0x278f5d[_0x815e('0x2f')]=_0x278f5d['attributes']['length']?_0x278f5d[_0x815e('0x2f')]:_0x1b1835[_0x815e('0x2a')];if(!_0x4d0bc2['query'][_0x815e('0x30')](_0x815e('0x31'))){_0x278f5d[_0x815e('0x1a')]=qs[_0x815e('0x1a')](_0x4d0bc2[_0x815e('0x2c')]['limit']);_0x278f5d[_0x815e('0x19')]=qs[_0x815e('0x19')](_0x4d0bc2[_0x815e('0x2c')][_0x815e('0x19')]);}_0x278f5d[_0x815e('0x32')]=qs[_0x815e('0x33')](_0x4d0bc2[_0x815e('0x2c')]['sort']);_0x278f5d[_0x815e('0x34')]=qs[_0x815e('0x2d')](_[_0x815e('0x35')](_0x4d0bc2['query'],_0x1b1835[_0x815e('0x2d')]));if(_0x4d0bc2[_0x815e('0x2c')]['filter']){_0x278f5d[_0x815e('0x34')]=_[_0x815e('0x36')](_0x278f5d[_0x815e('0x34')],{'$or':_['map'](_0xa29a17,function(_0x224add){if(_0x224add['type']['key']!==_0x815e('0x37')){var _0x13b093={};_0x13b093[_0x224add['field']]={'$like':'%'+_0x4d0bc2['query'][_0x815e('0x38')]+'%'};return _0x13b093;}})});}_0x278f5d=_[_0x815e('0x36')]({},_0x278f5d,_0x4d0bc2[_0x815e('0x39')]);var _0x142451={'where':_0x278f5d[_0x815e('0x34')]};return db[_0x815e('0x28')][_0x815e('0x18')](_0x142451)['then'](function(_0x90d36e){_0x128a82[_0x815e('0x18')]=_0x90d36e;if(_0x4d0bc2[_0x815e('0x2c')][_0x815e('0x3a')]){_0x278f5d[_0x815e('0x3b')]=[{'all':!![]}];}return db[_0x815e('0x28')]['findAll'](_0x278f5d);})[_0x815e('0x1f')](function(_0x51f424){_0x128a82['rows']=_0x51f424;return _0x128a82;})[_0x815e('0x1f')](respondWithFilteredResult(_0x46028a,_0x278f5d))[_0x815e('0x3c')](handleError(_0x46028a,null));};exports[_0x815e('0x3d')]=function(_0x4436e9,_0x538d5d){var _0x44e88f={'raw':!![],'where':{'id':_0x4436e9[_0x815e('0x3e')]['id']}},_0x3a978e={};_0x3a978e[_0x815e('0x2a')]=_[_0x815e('0x2b')](db[_0x815e('0x28')][_0x815e('0x29')]);_0x3a978e[_0x815e('0x2c')]=_[_0x815e('0x2b')](_0x4436e9[_0x815e('0x2c')]);_0x3a978e['filters']=_[_0x815e('0x2e')](_0x3a978e['model'],_0x3a978e['query']);_0x44e88f[_0x815e('0x2f')]=_[_0x815e('0x2e')](_0x3a978e[_0x815e('0x2a')],qs['fields'](_0x4436e9[_0x815e('0x2c')][_0x815e('0x3f')]));_0x44e88f[_0x815e('0x2f')]=_0x44e88f['attributes'][_0x815e('0x40')]?_0x44e88f[_0x815e('0x2f')]:_0x3a978e[_0x815e('0x2a')];if(_0x4436e9['query'][_0x815e('0x3a')]){_0x44e88f[_0x815e('0x3b')]=[{'all':!![]}];}_0x44e88f=_['merge']({},_0x44e88f,_0x4436e9[_0x815e('0x39')]);return db[_0x815e('0x28')][_0x815e('0x41')](_0x44e88f)[_0x815e('0x1f')](handleEntityNotFound(_0x538d5d,null))[_0x815e('0x1f')](respondWithResult(_0x538d5d,null))[_0x815e('0x3c')](handleError(_0x538d5d,null));};exports[_0x815e('0x42')]=function(_0x53235c,_0x3cfcd2){return db[_0x815e('0x28')][_0x815e('0x42')](_0x53235c[_0x815e('0x43')],{})['then'](respondWithResult(_0x3cfcd2,0xc9))[_0x815e('0x3c')](handleError(_0x3cfcd2,null));};exports[_0x815e('0x1e')]=function(_0x2a2b1d,_0x5b2ee3){if(_0x2a2b1d[_0x815e('0x43')]['id']){delete _0x2a2b1d[_0x815e('0x43')]['id'];}return db[_0x815e('0x28')]['find']({'where':{'id':_0x2a2b1d['params']['id']}})[_0x815e('0x1f')](handleEntityNotFound(_0x5b2ee3,null))[_0x815e('0x1f')](saveUpdates(_0x2a2b1d[_0x815e('0x43')],null))[_0x815e('0x1f')](respondWithResult(_0x5b2ee3,null))[_0x815e('0x3c')](handleError(_0x5b2ee3,null));};exports[_0x815e('0x20')]=function(_0xb0212e,_0x5b1c7f){return db[_0x815e('0x28')]['find']({'where':{'id':_0xb0212e[_0x815e('0x3e')]['id']}})[_0x815e('0x1f')](handleEntityNotFound(_0x5b1c7f,null))['then'](removeEntity(_0x5b1c7f,null))[_0x815e('0x3c')](handleError(_0x5b1c7f,null));};exports[_0x815e('0x44')]=function(_0x11996c,_0x4dbc21){return db['SmsQueueReport'][_0x815e('0x44')]()[_0x815e('0x1f')](respondWithResult(_0x4dbc21,null))[_0x815e('0x3c')](handleError(_0x4dbc21,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 838799c..c421690 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 _0x0dec=['define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','exports'];(function(_0x5bd6ce,_0x5da1c9){var _0x1b64a2=function(_0x517bbb){while(--_0x517bbb){_0x5bd6ce['push'](_0x5bd6ce['shift']());}};_0x1b64a2(++_0x5da1c9);}(_0x0dec,0x11c));var _0xc0de=function(_0xe131bd,_0x4e096a){_0xe131bd=_0xe131bd-0x0;var _0x51d71a=_0x0dec[_0xe131bd];return _0x51d71a;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var logger=require(_0xc0de('0x2'))(_0xc0de('0x3'));var moment=require('moment');var BPromise=require(_0xc0de('0x4'));var rp=require('request-promise');var attributes=require('./smsQueueReport.attributes');module[_0xc0de('0x5')]=function(_0x1a263e,_0x9ae6b){return _0x1a263e[_0xc0de('0x6')](_0xc0de('0x7'),attributes,{'tableName':_0xc0de('0x8'),'paranoid':![],'indexes':[{'name':_0xc0de('0x9'),'fields':[_0xc0de('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31dd=['util','../../config/logger','api','moment','bluebird','request-promise','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash'];(function(_0xf285c1,_0x420382){var _0x1598a0=function(_0x3e96df){while(--_0x3e96df){_0xf285c1['push'](_0xf285c1['shift']());}};_0x1598a0(++_0x420382);}(_0x31dd,0x14f));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd31d('0x0'));var util=require(_0xd31d('0x1'));var logger=require(_0xd31d('0x2'))(_0xd31d('0x3'));var moment=require(_0xd31d('0x4'));var BPromise=require(_0xd31d('0x5'));var rp=require(_0xd31d('0x6'));var attributes=require(_0xd31d('0x7'));module[_0xd31d('0x8')]=function(_0x25d3bc,_0x25d266){return _0x25d3bc[_0xd31d('0x9')](_0xd31d('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0xd31d('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 5e568a3..3ad8c1c 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 _0x2f95=['body','options','CreateSmsQueueReport','stringify','catch','SmsQueueReport','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','create'];(function(_0x1072fc,_0x2accb2){var _0x52db7f=function(_0x5c999c){while(--_0x5c999c){_0x1072fc['push'](_0x1072fc['shift']());}};_0x52db7f(++_0x2accb2);}(_0x2f95,0x94));var _0x52f9=function(_0x382355,_0x4d333f){_0x382355=_0x382355-0x0;var _0x39f018=_0x2f95[_0x382355];return _0x39f018;};'use strict';var _=require(_0x52f9('0x0'));var util=require(_0x52f9('0x1'));var moment=require('moment');var BPromise=require(_0x52f9('0x2'));var rs=require(_0x52f9('0x3'));var fs=require('fs');var Redis=require(_0x52f9('0x4'));var db=require(_0x52f9('0x5'))['db'];var utils=require(_0x52f9('0x6'));var logger=require(_0x52f9('0x7'))(_0x52f9('0x8'));var config=require('../../config/environment');var jayson=require(_0x52f9('0x9'));var client=jayson[_0x52f9('0xa')][_0x52f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c6594,_0x248042,_0x2d56ef){return new BPromise(function(_0x4400df,_0x4e232e){return client[_0x52f9('0xc')](_0x5c6594,_0x2d56ef)[_0x52f9('0xd')](function(_0x5c6b5f){logger[_0x52f9('0xe')](_0x52f9('0xf'),_0x248042,_0x52f9('0x10'));logger[_0x52f9('0x11')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x248042,_0x52f9('0x10'),JSON['stringify'](_0x5c6b5f));if(_0x5c6b5f['error']){if(_0x5c6b5f[_0x52f9('0x12')]['code']===0x1f4){logger[_0x52f9('0x12')](_0x52f9('0xf'),_0x248042,_0x5c6b5f[_0x52f9('0x12')][_0x52f9('0x13')]);return _0x4e232e(_0x5c6b5f['error'][_0x52f9('0x13')]);}logger['error'](_0x52f9('0xf'),_0x248042,_0x5c6b5f['error']['message']);return _0x4400df(_0x5c6b5f['error'][_0x52f9('0x13')]);}else{logger[_0x52f9('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x248042,_0x52f9('0x10'));_0x4400df(_0x5c6b5f[_0x52f9('0x14')][_0x52f9('0x13')]);}})['catch'](function(_0x5b12cf){logger[_0x52f9('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x248042,_0x5b12cf);_0x4e232e(_0x5b12cf);});});}exports['CreateSmsQueueReport']=function(_0x569232){var _0x374888=this;return new Promise(function(_0x3bb064,_0x490d25){return db['SmsQueueReport'][_0x52f9('0x15')](_0x569232[_0x52f9('0x16')],{'raw':_0x569232[_0x52f9('0x17')]?_0x569232[_0x52f9('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x52f9('0xd')](function(_0x51495e){logger[_0x52f9('0xe')](_0x52f9('0x18'),_0x569232);logger['debug'](_0x52f9('0x18'),_0x569232,JSON[_0x52f9('0x19')](_0x51495e));_0x3bb064(_0x51495e);})[_0x52f9('0x1a')](function(_0x5d0a6f){logger[_0x52f9('0x12')](_0x52f9('0x18'),_0x5d0a6f[_0x52f9('0x13')],_0x569232);_0x490d25(_0x374888[_0x52f9('0x12')](0x1f4,_0x5d0a6f['message']));});});};exports['UpdateSmsQueueReport']=function(_0x37d17c){var _0x5c83ce=this;return new Promise(function(_0x50ca04,_0x56b413){return db[_0x52f9('0x1b')][_0x52f9('0x1c')](_0x37d17c[_0x52f9('0x16')],{'raw':_0x37d17c['options']?_0x37d17c['options'][_0x52f9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37d17c[_0x52f9('0x17')]?_0x37d17c[_0x52f9('0x17')][_0x52f9('0x1e')]||null:null,'attributes':_0x37d17c[_0x52f9('0x17')]?_0x37d17c[_0x52f9('0x17')][_0x52f9('0x1f')]||null:null,'limit':_0x37d17c[_0x52f9('0x17')]?_0x37d17c['options'][_0x52f9('0x20')]||null:null})[_0x52f9('0xd')](function(_0x1b4324){logger['info'](_0x52f9('0x21'),_0x37d17c);logger[_0x52f9('0x11')]('UpdateSmsQueueReport',_0x37d17c,JSON[_0x52f9('0x19')](_0x1b4324));_0x50ca04(_0x1b4324);})['catch'](function(_0x3a9415){logger[_0x52f9('0x12')](_0x52f9('0x21'),_0x3a9415[_0x52f9('0x13')],_0x37d17c);_0x56b413(_0x5c83ce['error'](0x1f4,_0x3a9415[_0x52f9('0x13')]));});});}; \ No newline at end of file +var _0x2b77=['update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','body','options','raw','UpdateSmsQueueReport'];(function(_0x47df48,_0xeaef52){var _0x3f6cc8=function(_0x4e5d69){while(--_0x4e5d69){_0x47df48['push'](_0x47df48['shift']());}};_0x3f6cc8(++_0xeaef52);}(_0x2b77,0x66));var _0x72b7=function(_0x187873,_0x19caaa){_0x187873=_0x187873-0x0;var _0xad9d53=_0x2b77[_0x187873];return _0xad9d53;};'use strict';var _=require(_0x72b7('0x0'));var util=require(_0x72b7('0x1'));var moment=require(_0x72b7('0x2'));var BPromise=require(_0x72b7('0x3'));var rs=require(_0x72b7('0x4'));var fs=require('fs');var Redis=require(_0x72b7('0x5'));var db=require(_0x72b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x72b7('0x7'))('rpc');var config=require(_0x72b7('0x8'));var jayson=require(_0x72b7('0x9'));var client=jayson[_0x72b7('0xa')][_0x72b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x531bed,_0x4570ef,_0x8b8d83){return new BPromise(function(_0x46298a,_0x1c35a3){return client[_0x72b7('0xc')](_0x531bed,_0x8b8d83)[_0x72b7('0xd')](function(_0x490009){logger[_0x72b7('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x4570ef,'request\x20sent');logger[_0x72b7('0xf')](_0x72b7('0x10'),_0x4570ef,_0x72b7('0x11'),JSON[_0x72b7('0x12')](_0x490009));if(_0x490009['error']){if(_0x490009[_0x72b7('0x13')][_0x72b7('0x14')]===0x1f4){logger[_0x72b7('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x4570ef,_0x490009['error']['message']);return _0x1c35a3(_0x490009[_0x72b7('0x13')][_0x72b7('0x15')]);}logger[_0x72b7('0x13')](_0x72b7('0x16'),_0x4570ef,_0x490009[_0x72b7('0x13')]['message']);return _0x46298a(_0x490009[_0x72b7('0x13')]['message']);}else{logger[_0x72b7('0xe')](_0x72b7('0x16'),_0x4570ef,'request\x20sent');_0x46298a(_0x490009[_0x72b7('0x17')][_0x72b7('0x15')]);}})[_0x72b7('0x18')](function(_0x32bf50){logger[_0x72b7('0x13')](_0x72b7('0x16'),_0x4570ef,_0x32bf50);_0x1c35a3(_0x32bf50);});});}exports[_0x72b7('0x19')]=function(_0x5ccedc){var _0x473fd8=this;return new Promise(function(_0x40cef4,_0x44ffe4){return db['SmsQueueReport']['create'](_0x5ccedc[_0x72b7('0x1a')],{'raw':_0x5ccedc['options']?_0x5ccedc[_0x72b7('0x1b')][_0x72b7('0x1c')]===undefined?!![]:![]:!![]})[_0x72b7('0xd')](function(_0x316123){logger[_0x72b7('0xe')]('CreateSmsQueueReport',_0x5ccedc);logger[_0x72b7('0xf')](_0x72b7('0x19'),_0x5ccedc,JSON[_0x72b7('0x12')](_0x316123));_0x40cef4(_0x316123);})[_0x72b7('0x18')](function(_0x3c4b90){logger[_0x72b7('0x13')](_0x72b7('0x19'),_0x3c4b90[_0x72b7('0x15')],_0x5ccedc);_0x44ffe4(_0x473fd8[_0x72b7('0x13')](0x1f4,_0x3c4b90[_0x72b7('0x15')]));});});};exports[_0x72b7('0x1d')]=function(_0x358757){var _0x138677=this;return new Promise(function(_0x42df89,_0xd3f614){return db['SmsQueueReport'][_0x72b7('0x1e')](_0x358757[_0x72b7('0x1a')],{'raw':_0x358757[_0x72b7('0x1b')]?_0x358757[_0x72b7('0x1b')][_0x72b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x358757[_0x72b7('0x1b')]?_0x358757[_0x72b7('0x1b')][_0x72b7('0x1f')]||null:null,'attributes':_0x358757['options']?_0x358757[_0x72b7('0x1b')]['attributes']||null:null,'limit':_0x358757['options']?_0x358757[_0x72b7('0x1b')][_0x72b7('0x20')]||null:null})[_0x72b7('0xd')](function(_0x210c21){logger[_0x72b7('0xe')]('UpdateSmsQueueReport',_0x358757);logger[_0x72b7('0xf')](_0x72b7('0x1d'),_0x358757,JSON[_0x72b7('0x12')](_0x210c21));_0x42df89(_0x210c21);})['catch'](function(_0x447683){logger[_0x72b7('0x13')](_0x72b7('0x1d'),_0x447683[_0x72b7('0x15')],_0x358757);_0xd3f614(_0x138677[_0x72b7('0x13')](0x1f4,_0x447683['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 24db058..71addf0 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 _0x182b=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x270cf3,_0x1a6ad6){var _0x9bc8f7=function(_0x5c2113){while(--_0x5c2113){_0x270cf3['push'](_0x270cf3['shift']());}};_0x9bc8f7(++_0x1a6ad6);}(_0x182b,0x65));var _0xb182=function(_0x5d0740,_0x51e052){_0x5d0740=_0x5d0740-0x0;var _0x27154e=_0x182b[_0x5d0740];return _0x27154e;};'use strict';var multer=require('multer');var util=require(_0xb182('0x0'));var path=require('path');var timeout=require(_0xb182('0x1'));var express=require(_0xb182('0x2'));var router=express[_0xb182('0x3')]();var auth=require(_0xb182('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb182('0x5'));var controller=require(_0xb182('0x6'));router[_0xb182('0x7')]('/',auth[_0xb182('0x8')](),controller['index']);router[_0xb182('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xb182('0x9')]);router[_0xb182('0x7')](_0xb182('0xa'),auth[_0xb182('0x8')](),controller[_0xb182('0xb')]);router['post']('/',auth[_0xb182('0x8')](),controller[_0xb182('0xc')]);router[_0xb182('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb182('0xe')]);router[_0xb182('0xf')](_0xb182('0xa'),auth[_0xb182('0x8')](),controller[_0xb182('0x10')]);module[_0xb182('0x11')]=router; \ No newline at end of file +var _0x0fdc=['destroy','util','path','connect-timeout','express','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete'];(function(_0x26d609,_0x389f39){var _0x2bc678=function(_0x530618){while(--_0x530618){_0x26d609['push'](_0x26d609['shift']());}};_0x2bc678(++_0x389f39);}(_0x0fdc,0x78));var _0xc0fd=function(_0x271ce3,_0x4611f2){_0x271ce3=_0x271ce3-0x0;var _0x148427=_0x0fdc[_0x271ce3];return _0x148427;};'use strict';var multer=require('multer');var util=require(_0xc0fd('0x0'));var path=require(_0xc0fd('0x1'));var timeout=require(_0xc0fd('0x2'));var express=require(_0xc0fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc0fd('0x4'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xc0fd('0x5')](),controller[_0xc0fd('0x6')]);router[_0xc0fd('0x7')](_0xc0fd('0x8'),auth[_0xc0fd('0x5')](),controller[_0xc0fd('0x9')]);router['get']('/:id',auth[_0xc0fd('0x5')](),controller[_0xc0fd('0xa')]);router[_0xc0fd('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc0fd('0xc')](_0xc0fd('0xd'),auth[_0xc0fd('0x5')](),controller[_0xc0fd('0xe')]);router[_0xc0fd('0xf')](_0xc0fd('0xd'),auth[_0xc0fd('0x5')](),controller[_0xc0fd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 524265b..937fe89 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 _0x3345=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x279176,_0x3d0902){var _0x42418b=function(_0x2f44f5){while(--_0x2f44f5){_0x279176['push'](_0x279176['shift']());}};_0x42418b(++_0x3d0902);}(_0x3345,0xc0));var _0x5334=function(_0x2ad54f,_0x58209a){_0x2ad54f=_0x2ad54f-0x0;var _0x305016=_0x3345[_0x2ad54f];return _0x305016;};'use strict';var moment=require(_0x5334('0x0'));var Sequelize=require(_0x5334('0x1'));module[_0x5334('0x2')]={'uniqueid':{'type':Sequelize[_0x5334('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5334('0x4'),_0x5334('0x5'),_0x5334('0x6')),'allowNull':![],'defaultValue':_0x5334('0x6')},'transferredAt':{'type':Sequelize[_0x5334('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x5334('0x8')]}}; \ No newline at end of file +var _0xbfac=['queue','NOW','moment','sequelize','account'];(function(_0x45ae0d,_0x1ea3b9){var _0x371826=function(_0x20e757){while(--_0x20e757){_0x45ae0d['push'](_0x45ae0d['shift']());}};_0x371826(++_0x1ea3b9);}(_0xbfac,0x70));var _0xcbfa=function(_0x1cc46d,_0x12e0ea){_0x1cc46d=_0x1cc46d-0x0;var _0x15a242=_0xbfac[_0x1cc46d];return _0x15a242;};'use strict';var moment=require(_0xcbfa('0x0'));var Sequelize=require(_0xcbfa('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcbfa('0x2'),'agent','queue'),'allowNull':![],'defaultValue':_0xcbfa('0x3')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xcbfa('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b6465fd..50c1ab1 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 _0xc972=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','SmsTransferReport','findAll','then','catch','show','params','includeAll','include','create','update','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','Content-Range','save','destroy','sendStatus','stack','name','send','rawAttributes','model'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xc972,0xaf));var _0x2c97=function(_0x5d62ad,_0x4d08f5){_0x5d62ad=_0x5d62ad-0x0;var _0x50b5d1=_0xc972[_0x5d62ad];return _0x50b5d1;};'use strict';var pdf=require(_0x2c97('0x0'));var emlformat=require(_0x2c97('0x1'));var rimraf=require(_0x2c97('0x2'));var zipdir=require(_0x2c97('0x3'));var jsonpatch=require(_0x2c97('0x4'));var rp=require(_0x2c97('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c97('0x6'));var util=require(_0x2c97('0x7'));var path=require(_0x2c97('0x8'));var sox=require(_0x2c97('0x9'));var csv=require(_0x2c97('0xa'));var ejs=require(_0x2c97('0xb'));var fs=require('fs');var _=require(_0x2c97('0xc'));var squel=require(_0x2c97('0xd'));var crypto=require(_0x2c97('0xe'));var jsforce=require(_0x2c97('0xf'));var deskjs=require(_0x2c97('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c97('0x11'));var authService=require(_0x2c97('0x12'));var hardwareService=require(_0x2c97('0x13'));var Redis=require(_0x2c97('0x14'));var qs=require(_0x2c97('0x15'));var logger=require(_0x2c97('0x16'))(_0x2c97('0x17'));var utils=require(_0x2c97('0x18'));var config=require('../../config/environment');var db=require(_0x2c97('0x19'))['db'];function respondWithStatusCode(_0xbb3886,_0x3a87f2){_0x3a87f2=_0x3a87f2||0xcc;return function(_0x11b3bf){if(_0x11b3bf){return _0xbb3886['sendStatus'](_0x3a87f2);}return _0xbb3886['status'](_0x3a87f2)[_0x2c97('0x1a')]();};}function respondWithResult(_0x255602,_0x331c2e){_0x331c2e=_0x331c2e||0xc8;return function(_0x44b965){if(_0x44b965){return _0x255602[_0x2c97('0x1b')](_0x331c2e)[_0x2c97('0x1c')](_0x44b965);}};}function respondWithFilteredResult(_0x45bc04,_0x3bd7b5){return function(_0x389c98){if(_0x389c98){var _0x3c5b28=_0x389c98[_0x2c97('0x1d')],_0x2f0b88=_0x3bd7b5[_0x2c97('0x1e')],_0x3f9709=_0x3bd7b5[_0x2c97('0x1e')]+_0x3bd7b5[_0x2c97('0x1f')],_0x13c8ff;if(_0x3f9709>=_0x3c5b28){_0x3f9709=_0x3c5b28;_0x13c8ff=0xc8;}else{_0x13c8ff=0xce;}_0x45bc04['status'](_0x13c8ff);return _0x45bc04['set'](_0x2c97('0x20'),_0x2f0b88+'-'+_0x3f9709+'/'+_0x3c5b28)[_0x2c97('0x1c')](_0x389c98);}return null;};}function patchUpdates(_0xcd7763){return function(_0x20ff88){try{jsonpatch['apply'](_0x20ff88,_0xcd7763,!![]);}catch(_0xe3ad68){return BPromise['reject'](_0xe3ad68);}return _0x20ff88[_0x2c97('0x21')]();};}function saveUpdates(_0x2dd5d8,_0x2c70d3){return function(_0xe95b7){if(_0xe95b7){return _0xe95b7['update'](_0x2dd5d8)['then'](function(_0x265c48){return _0x265c48;});}return null;};}function removeEntity(_0xd2ded1,_0x42493f){return function(_0x194307){if(_0x194307){return _0x194307[_0x2c97('0x22')]()['then'](function(){_0xd2ded1['status'](0xcc)[_0x2c97('0x1a')]();});}};}function handleEntityNotFound(_0x542b79,_0x19bdf4){return function(_0x4b5810){if(!_0x4b5810){_0x542b79[_0x2c97('0x23')](0x194);}return _0x4b5810;};}function handleError(_0x4f46e1,_0x11bae1){_0x11bae1=_0x11bae1||0x1f4;return function(_0x14cd28){logger['error'](_0x14cd28[_0x2c97('0x24')]);if(_0x14cd28[_0x2c97('0x25')]){delete _0x14cd28['name'];}_0x4f46e1[_0x2c97('0x1b')](_0x11bae1)[_0x2c97('0x26')](_0x14cd28);};}exports['index']=function(_0x387a9d,_0x3c0d99){var _0x3bcd5={},_0x19799b={},_0x351f44={'count':0x0,'rows':[]};var _0x240b47=db['SmsTransferReport'][_0x2c97('0x27')];_0x19799b[_0x2c97('0x28')]=_[_0x2c97('0x29')](_0x240b47);_0x19799b[_0x2c97('0x2a')]=_[_0x2c97('0x29')](_0x387a9d[_0x2c97('0x2a')]);_0x19799b[_0x2c97('0x2b')]=_[_0x2c97('0x2c')](_0x19799b[_0x2c97('0x28')],_0x19799b['query']);_0x3bcd5[_0x2c97('0x2d')]=_[_0x2c97('0x2c')](_0x19799b['model'],qs[_0x2c97('0x2e')](_0x387a9d[_0x2c97('0x2a')][_0x2c97('0x2e')]));_0x3bcd5[_0x2c97('0x2d')]=_0x3bcd5[_0x2c97('0x2d')][_0x2c97('0x2f')]?_0x3bcd5[_0x2c97('0x2d')]:_0x19799b[_0x2c97('0x28')];if(!_0x387a9d['query'][_0x2c97('0x30')](_0x2c97('0x31'))){_0x3bcd5[_0x2c97('0x1f')]=qs[_0x2c97('0x1f')](_0x387a9d['query']['limit']);_0x3bcd5[_0x2c97('0x1e')]=qs['offset'](_0x387a9d[_0x2c97('0x2a')][_0x2c97('0x1e')]);}_0x3bcd5[_0x2c97('0x32')]=qs[_0x2c97('0x33')](_0x387a9d['query']['sort']);_0x3bcd5[_0x2c97('0x34')]=qs[_0x2c97('0x2b')](_['pick'](_0x387a9d[_0x2c97('0x2a')],_0x19799b['filters']));if(_0x387a9d[_0x2c97('0x2a')][_0x2c97('0x35')]){_0x3bcd5['where']=_[_0x2c97('0x36')](_0x3bcd5['where'],{'$or':_['map'](_0x240b47,function(_0xf99b2b){if(_0xf99b2b[_0x2c97('0x37')][_0x2c97('0x38')]!==_0x2c97('0x39')){var _0x150655={};_0x150655[_0xf99b2b['field']]={'$like':'%'+_0x387a9d[_0x2c97('0x2a')][_0x2c97('0x35')]+'%'};return _0x150655;}})});}_0x3bcd5=_[_0x2c97('0x36')]({},_0x3bcd5,_0x387a9d[_0x2c97('0x3a')]);var _0x24bce4={'where':_0x3bcd5['where']};return db[_0x2c97('0x3b')][_0x2c97('0x1d')](_0x24bce4)['then'](function(_0xae294a){_0x351f44['count']=_0xae294a;if(_0x387a9d[_0x2c97('0x2a')]['includeAll']){_0x3bcd5['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x2c97('0x3c')](_0x3bcd5);})[_0x2c97('0x3d')](function(_0x502b60){_0x351f44['rows']=_0x502b60;return _0x351f44;})[_0x2c97('0x3d')](respondWithFilteredResult(_0x3c0d99,_0x3bcd5))[_0x2c97('0x3e')](handleError(_0x3c0d99,null));};exports[_0x2c97('0x3f')]=function(_0x57c1cd,_0x3e5b31){var _0x1cb1e7={'raw':!![],'where':{'id':_0x57c1cd[_0x2c97('0x40')]['id']}},_0x16abab={};_0x16abab['model']=_['keys'](db[_0x2c97('0x3b')][_0x2c97('0x27')]);_0x16abab['query']=_[_0x2c97('0x29')](_0x57c1cd[_0x2c97('0x2a')]);_0x16abab[_0x2c97('0x2b')]=_[_0x2c97('0x2c')](_0x16abab[_0x2c97('0x28')],_0x16abab[_0x2c97('0x2a')]);_0x1cb1e7[_0x2c97('0x2d')]=_[_0x2c97('0x2c')](_0x16abab[_0x2c97('0x28')],qs['fields'](_0x57c1cd['query'][_0x2c97('0x2e')]));_0x1cb1e7[_0x2c97('0x2d')]=_0x1cb1e7[_0x2c97('0x2d')][_0x2c97('0x2f')]?_0x1cb1e7['attributes']:_0x16abab[_0x2c97('0x28')];if(_0x57c1cd[_0x2c97('0x2a')][_0x2c97('0x41')]){_0x1cb1e7[_0x2c97('0x42')]=[{'all':!![]}];}_0x1cb1e7=_['merge']({},_0x1cb1e7,_0x57c1cd['options']);return db['SmsTransferReport']['find'](_0x1cb1e7)[_0x2c97('0x3d')](handleEntityNotFound(_0x3e5b31,null))[_0x2c97('0x3d')](respondWithResult(_0x3e5b31,null))['catch'](handleError(_0x3e5b31,null));};exports[_0x2c97('0x43')]=function(_0x4eb288,_0x9e7dea){return db[_0x2c97('0x3b')][_0x2c97('0x43')](_0x4eb288['body'],{})['then'](respondWithResult(_0x9e7dea,0xc9))[_0x2c97('0x3e')](handleError(_0x9e7dea,null));};exports[_0x2c97('0x44')]=function(_0x2faaa7,_0x583a57){if(_0x2faaa7[_0x2c97('0x45')]['id']){delete _0x2faaa7[_0x2c97('0x45')]['id'];}return db[_0x2c97('0x3b')][_0x2c97('0x46')]({'where':{'id':_0x2faaa7[_0x2c97('0x40')]['id']}})[_0x2c97('0x3d')](handleEntityNotFound(_0x583a57,null))[_0x2c97('0x3d')](saveUpdates(_0x2faaa7['body'],null))[_0x2c97('0x3d')](respondWithResult(_0x583a57,null))[_0x2c97('0x3e')](handleError(_0x583a57,null));};exports[_0x2c97('0x22')]=function(_0x40ab12,_0x5b3c8f){return db[_0x2c97('0x3b')]['find']({'where':{'id':_0x40ab12[_0x2c97('0x40')]['id']}})[_0x2c97('0x3d')](handleEntityNotFound(_0x5b3c8f,null))[_0x2c97('0x3d')](removeEntity(_0x5b3c8f,null))['catch'](handleError(_0x5b3c8f,null));};exports['describe']=function(_0xc1ae58,_0x31026b){return db['SmsTransferReport'][_0x2c97('0x47')]()[_0x2c97('0x3d')](respondWithResult(_0x31026b,null))['catch'](handleError(_0x31026b,null));}; \ No newline at end of file +var _0x358e=['update','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject'];(function(_0x20e6bd,_0x3be896){var _0x3a0a94=function(_0x495f81){while(--_0x495f81){_0x20e6bd['push'](_0x20e6bd['shift']());}};_0x3a0a94(++_0x3be896);}(_0x358e,0xa7));var _0xe358=function(_0x453536,_0x46622b){_0x453536=_0x453536-0x0;var _0x252fb0=_0x358e[_0x453536];return _0x252fb0;};'use strict';var pdf=require(_0xe358('0x0'));var emlformat=require(_0xe358('0x1'));var rimraf=require(_0xe358('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe358('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe358('0x4'));var util=require('util');var path=require(_0xe358('0x5'));var sox=require(_0xe358('0x6'));var csv=require('to-csv');var ejs=require(_0xe358('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe358('0x8'));var jsforce=require(_0xe358('0x9'));var deskjs=require(_0xe358('0xa'));var toCsv=require(_0xe358('0xb'));var querystring=require('querystring');var Papa=require(_0xe358('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xe358('0xd'));var logger=require(_0xe358('0xe'))(_0xe358('0xf'));var utils=require(_0xe358('0x10'));var config=require(_0xe358('0x11'));var db=require(_0xe358('0x12'))['db'];function respondWithStatusCode(_0xe646db,_0x5b2121){_0x5b2121=_0x5b2121||0xcc;return function(_0x315f3c){if(_0x315f3c){return _0xe646db[_0xe358('0x13')](_0x5b2121);}return _0xe646db[_0xe358('0x14')](_0x5b2121)[_0xe358('0x15')]();};}function respondWithResult(_0x273ac3,_0x383818){_0x383818=_0x383818||0xc8;return function(_0x443097){if(_0x443097){return _0x273ac3[_0xe358('0x14')](_0x383818)['json'](_0x443097);}};}function respondWithFilteredResult(_0x121e93,_0x460d61){return function(_0xb80c7a){if(_0xb80c7a){var _0x51d0a0=_0xb80c7a[_0xe358('0x16')],_0x3397c5=_0x460d61[_0xe358('0x17')],_0x3d7537=_0x460d61[_0xe358('0x17')]+_0x460d61['limit'],_0x553e99;if(_0x3d7537>=_0x51d0a0){_0x3d7537=_0x51d0a0;_0x553e99=0xc8;}else{_0x553e99=0xce;}_0x121e93[_0xe358('0x14')](_0x553e99);return _0x121e93[_0xe358('0x18')](_0xe358('0x19'),_0x3397c5+'-'+_0x3d7537+'/'+_0x51d0a0)[_0xe358('0x1a')](_0xb80c7a);}return null;};}function patchUpdates(_0x497f64){return function(_0x1a01e2){try{jsonpatch['apply'](_0x1a01e2,_0x497f64,!![]);}catch(_0x481558){return BPromise[_0xe358('0x1b')](_0x481558);}return _0x1a01e2['save']();};}function saveUpdates(_0x543d42,_0x1fdaf9){return function(_0x2492f6){if(_0x2492f6){return _0x2492f6[_0xe358('0x1c')](_0x543d42)['then'](function(_0xcde2c7){return _0xcde2c7;});}return null;};}function removeEntity(_0x34a273,_0x3b1719){return function(_0x1f283f){if(_0x1f283f){return _0x1f283f['destroy']()['then'](function(){_0x34a273['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e057a,_0x1c6472){return function(_0x587950){if(!_0x587950){_0x1e057a[_0xe358('0x13')](0x194);}return _0x587950;};}function handleError(_0x2ae9c0,_0x1709e4){_0x1709e4=_0x1709e4||0x1f4;return function(_0x341a3d){logger['error'](_0x341a3d['stack']);if(_0x341a3d['name']){delete _0x341a3d[_0xe358('0x1d')];}_0x2ae9c0[_0xe358('0x14')](_0x1709e4)[_0xe358('0x1e')](_0x341a3d);};}exports[_0xe358('0x1f')]=function(_0x26fd26,_0x4dcc1f){var _0x4a471b={},_0x4a2828={},_0x3c9523={'count':0x0,'rows':[]};var _0x4a740e=db[_0xe358('0x20')][_0xe358('0x21')];_0x4a2828[_0xe358('0x22')]=_[_0xe358('0x23')](_0x4a740e);_0x4a2828[_0xe358('0x24')]=_[_0xe358('0x23')](_0x26fd26['query']);_0x4a2828[_0xe358('0x25')]=_[_0xe358('0x26')](_0x4a2828[_0xe358('0x22')],_0x4a2828[_0xe358('0x24')]);_0x4a471b[_0xe358('0x27')]=_[_0xe358('0x26')](_0x4a2828[_0xe358('0x22')],qs[_0xe358('0x28')](_0x26fd26[_0xe358('0x24')][_0xe358('0x28')]));_0x4a471b[_0xe358('0x27')]=_0x4a471b[_0xe358('0x27')][_0xe358('0x29')]?_0x4a471b[_0xe358('0x27')]:_0x4a2828[_0xe358('0x22')];if(!_0x26fd26['query'][_0xe358('0x2a')](_0xe358('0x2b'))){_0x4a471b[_0xe358('0x2c')]=qs[_0xe358('0x2c')](_0x26fd26[_0xe358('0x24')][_0xe358('0x2c')]);_0x4a471b[_0xe358('0x17')]=qs[_0xe358('0x17')](_0x26fd26[_0xe358('0x24')]['offset']);}_0x4a471b[_0xe358('0x2d')]=qs[_0xe358('0x2e')](_0x26fd26[_0xe358('0x24')]['sort']);_0x4a471b[_0xe358('0x2f')]=qs[_0xe358('0x25')](_['pick'](_0x26fd26[_0xe358('0x24')],_0x4a2828[_0xe358('0x25')]));if(_0x26fd26['query'][_0xe358('0x30')]){_0x4a471b[_0xe358('0x2f')]=_['merge'](_0x4a471b[_0xe358('0x2f')],{'$or':_[_0xe358('0x31')](_0x4a740e,function(_0x52f8af){if(_0x52f8af['type']['key']!==_0xe358('0x32')){var _0x3f842f={};_0x3f842f[_0x52f8af['field']]={'$like':'%'+_0x26fd26[_0xe358('0x24')][_0xe358('0x30')]+'%'};return _0x3f842f;}})});}_0x4a471b=_[_0xe358('0x33')]({},_0x4a471b,_0x26fd26[_0xe358('0x34')]);var _0x87de26={'where':_0x4a471b[_0xe358('0x2f')]};return db[_0xe358('0x20')][_0xe358('0x16')](_0x87de26)[_0xe358('0x35')](function(_0x415af8){_0x3c9523[_0xe358('0x16')]=_0x415af8;if(_0x26fd26[_0xe358('0x24')][_0xe358('0x36')]){_0x4a471b[_0xe358('0x37')]=[{'all':!![]}];}return db[_0xe358('0x20')][_0xe358('0x38')](_0x4a471b);})[_0xe358('0x35')](function(_0x5791c3){_0x3c9523[_0xe358('0x39')]=_0x5791c3;return _0x3c9523;})['then'](respondWithFilteredResult(_0x4dcc1f,_0x4a471b))['catch'](handleError(_0x4dcc1f,null));};exports[_0xe358('0x3a')]=function(_0x39aed9,_0x1ec6a3){var _0x52fd6d={'raw':!![],'where':{'id':_0x39aed9[_0xe358('0x3b')]['id']}},_0x2a6caf={};_0x2a6caf['model']=_[_0xe358('0x23')](db['SmsTransferReport'][_0xe358('0x21')]);_0x2a6caf[_0xe358('0x24')]=_['keys'](_0x39aed9[_0xe358('0x24')]);_0x2a6caf['filters']=_[_0xe358('0x26')](_0x2a6caf['model'],_0x2a6caf['query']);_0x52fd6d[_0xe358('0x27')]=_['intersection'](_0x2a6caf[_0xe358('0x22')],qs[_0xe358('0x28')](_0x39aed9[_0xe358('0x24')][_0xe358('0x28')]));_0x52fd6d[_0xe358('0x27')]=_0x52fd6d['attributes'][_0xe358('0x29')]?_0x52fd6d[_0xe358('0x27')]:_0x2a6caf[_0xe358('0x22')];if(_0x39aed9[_0xe358('0x24')][_0xe358('0x36')]){_0x52fd6d[_0xe358('0x37')]=[{'all':!![]}];}_0x52fd6d=_[_0xe358('0x33')]({},_0x52fd6d,_0x39aed9[_0xe358('0x34')]);return db[_0xe358('0x20')][_0xe358('0x3c')](_0x52fd6d)[_0xe358('0x35')](handleEntityNotFound(_0x1ec6a3,null))[_0xe358('0x35')](respondWithResult(_0x1ec6a3,null))[_0xe358('0x3d')](handleError(_0x1ec6a3,null));};exports['create']=function(_0x3a4f65,_0x1297fe){return db['SmsTransferReport'][_0xe358('0x3e')](_0x3a4f65[_0xe358('0x3f')],{})[_0xe358('0x35')](respondWithResult(_0x1297fe,0xc9))['catch'](handleError(_0x1297fe,null));};exports[_0xe358('0x1c')]=function(_0x5a2966,_0x462ea7){if(_0x5a2966[_0xe358('0x3f')]['id']){delete _0x5a2966[_0xe358('0x3f')]['id'];}return db[_0xe358('0x20')][_0xe358('0x3c')]({'where':{'id':_0x5a2966[_0xe358('0x3b')]['id']}})[_0xe358('0x35')](handleEntityNotFound(_0x462ea7,null))[_0xe358('0x35')](saveUpdates(_0x5a2966[_0xe358('0x3f')],null))[_0xe358('0x35')](respondWithResult(_0x462ea7,null))[_0xe358('0x3d')](handleError(_0x462ea7,null));};exports['destroy']=function(_0x5efa54,_0x16f649){return db[_0xe358('0x20')][_0xe358('0x3c')]({'where':{'id':_0x5efa54['params']['id']}})[_0xe358('0x35')](handleEntityNotFound(_0x16f649,null))['then'](removeEntity(_0x16f649,null))[_0xe358('0x3d')](handleError(_0x16f649,null));};exports[_0xe358('0x40')]=function(_0x542866,_0xa78902){return db[_0xe358('0x20')][_0xe358('0x40')]()[_0xe358('0x35')](respondWithResult(_0xa78902,null))[_0xe358('0x3d')](handleError(_0xa78902,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7f05cb7..33c27b9 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 _0x6f0d=['./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','util','../../config/logger','api','moment','request-promise'];(function(_0x7db7cd,_0x37a1b6){var _0x110116=function(_0x4eac33){while(--_0x4eac33){_0x7db7cd['push'](_0x7db7cd['shift']());}};_0x110116(++_0x37a1b6);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xbedcd2,_0x430535){_0xbedcd2=_0xbedcd2-0x0;var _0x2b4386=_0x6f0d[_0xbedcd2];return _0x2b4386;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var attributes=require(_0xd6f0('0x5'));module[_0xd6f0('0x6')]=function(_0x25344b,_0x3a757f){return _0x25344b['define'](_0xd6f0('0x7'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xd6f0('0x8'),'fields':[_0xd6f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbec5=['util','api','moment','bluebird','request-promise','./smsTransferReport.attributes','define','report_sms_transfer','uniqueid','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbec5,0xe5));var _0x5bec=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xbec5[_0x277721];return _0x286051;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var attributes=require(_0x5bec('0x6'));module['exports']=function(_0x1f8933,_0x376cdb){return _0x1f8933[_0x5bec('0x7')]('SmsTransferReport',attributes,{'tableName':_0x5bec('0x8'),'paranoid':![],'indexes':[{'name':_0x5bec('0x9'),'fields':[_0x5bec('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 1743d46..3ef9341 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 _0xf643=['client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33dede,_0x3d625e){var _0x516e3f=function(_0x4b0f0e){while(--_0x4b0f0e){_0x33dede['push'](_0x33dede['shift']());}};_0x516e3f(++_0x3d625e);}(_0xf643,0x122));var _0x3f64=function(_0xa3d1a6,_0x5040cb){_0xa3d1a6=_0xa3d1a6-0x0;var _0x1682ad=_0xf643[_0xa3d1a6];return _0x1682ad;};'use strict';var _=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var moment=require(_0x3f64('0x2'));var BPromise=require(_0x3f64('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f64('0x4'));var db=require(_0x3f64('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f64('0x6'))(_0x3f64('0x7'));var config=require(_0x3f64('0x8'));var jayson=require(_0x3f64('0x9'));var client=jayson[_0x3f64('0xa')][_0x3f64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dfeeb,_0x269d28,_0x40b245){return new BPromise(function(_0x2a7c90,_0x219dcb){return client[_0x3f64('0xc')](_0x2dfeeb,_0x40b245)[_0x3f64('0xd')](function(_0x268ef2){logger[_0x3f64('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x269d28,_0x3f64('0xf'));logger[_0x3f64('0x10')](_0x3f64('0x11'),_0x269d28,'request\x20sent',JSON[_0x3f64('0x12')](_0x268ef2));if(_0x268ef2[_0x3f64('0x13')]){if(_0x268ef2[_0x3f64('0x13')][_0x3f64('0x14')]===0x1f4){logger[_0x3f64('0x13')](_0x3f64('0x15'),_0x269d28,_0x268ef2[_0x3f64('0x13')][_0x3f64('0x16')]);return _0x219dcb(_0x268ef2[_0x3f64('0x13')][_0x3f64('0x16')]);}logger[_0x3f64('0x13')](_0x3f64('0x15'),_0x269d28,_0x268ef2['error'][_0x3f64('0x16')]);return _0x2a7c90(_0x268ef2[_0x3f64('0x13')][_0x3f64('0x16')]);}else{logger[_0x3f64('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x269d28,_0x3f64('0xf'));_0x2a7c90(_0x268ef2[_0x3f64('0x17')][_0x3f64('0x16')]);}})[_0x3f64('0x18')](function(_0x391c64){logger[_0x3f64('0x13')](_0x3f64('0x15'),_0x269d28,_0x391c64);_0x219dcb(_0x391c64);});});} \ No newline at end of file +var _0xc7da=['request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7da,0xf2));var _0xac7d=function(_0x5add86,_0x454fa6){_0x5add86=_0x5add86-0x0;var _0x2bdbc8=_0xc7da[_0x5add86];return _0x2bdbc8;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 75caf60..46c8972 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 _0x5f1f=['index','get','/:id','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','basename','single','file','create','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f1f,0xab));var _0xf5f1=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x5f1f[_0x31e584];return _0x5686d0;};'use strict';var multer=require('multer');var util=require(_0xf5f1('0x0'));var path=require('path');var timeout=require(_0xf5f1('0x1'));var express=require('express');var router=express[_0xf5f1('0x2')]();var auth=require(_0xf5f1('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0xf5f1('0x4')](),controller[_0xf5f1('0x5')]);router[_0xf5f1('0x6')](_0xf5f1('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xf5f1('0x6')](_0xf5f1('0x8'),auth[_0xf5f1('0x4')](),controller[_0xf5f1('0x9')]);var upload=multer({'storage':multer[_0xf5f1('0xa')]({'destination':function(_0x137749,_0x42bb51,_0x3993c2){_0x3993c2(null,path['join'](config[_0xf5f1('0xb')],_0xf5f1('0xc')));},'filename':function(_0x2e1155,_0x54c32e,_0x4c7701){_0x54c32e['originalname']=_0x54c32e[_0xf5f1('0xd')][_0xf5f1('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c7701(null,util['format']('%s-%s%s',path[_0xf5f1('0xf')](_0x54c32e[_0xf5f1('0xd')],path['extname'](_0x54c32e[_0xf5f1('0xd')])),Date['now'](),path['extname'](_0x54c32e[_0xf5f1('0xd')])));}})});router['post']('/',upload[_0xf5f1('0x10')](_0xf5f1('0x11')),controller[_0xf5f1('0x12')]);router[_0xf5f1('0x13')](_0xf5f1('0x7'),auth[_0xf5f1('0x4')](),controller['update']);router[_0xf5f1('0x14')](_0xf5f1('0x7'),auth['isAuthenticated'](),controller[_0xf5f1('0x14')]);module[_0xf5f1('0x15')]=router; \ No newline at end of file +var _0x03e9=['delete','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','root','originalname','replace','format','%s-%s%s','now','extname','post','single','file','put','update'];(function(_0x353dcd,_0x1eb15d){var _0x137122=function(_0x4900b4){while(--_0x4900b4){_0x353dcd['push'](_0x353dcd['shift']());}};_0x137122(++_0x1eb15d);}(_0x03e9,0x6e));var _0x903e=function(_0x2063cf,_0x493b78){_0x2063cf=_0x2063cf-0x0;var _0x658a42=_0x03e9[_0x2063cf];return _0x658a42;};'use strict';var multer=require('multer');var util=require(_0x903e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x903e('0x1')]();var auth=require(_0x903e('0x2'));var interaction=require(_0x903e('0x3'));var config=require(_0x903e('0x4'));var controller=require(_0x903e('0x5'));router[_0x903e('0x6')]('/',auth['isAuthenticated'](),controller[_0x903e('0x7')]);router[_0x903e('0x6')](_0x903e('0x8'),auth[_0x903e('0x9')](),controller[_0x903e('0xa')]);router[_0x903e('0x6')](_0x903e('0xb'),auth[_0x903e('0x9')](),controller['download']);var upload=multer({'storage':multer[_0x903e('0xc')]({'destination':function(_0x493399,_0x5b39e2,_0xc16995){_0xc16995(null,path['join'](config[_0x903e('0xd')],'server/files/sounds/original/'));},'filename':function(_0x1d84d9,_0x3e15ee,_0x2433f5){_0x3e15ee[_0x903e('0xe')]=_0x3e15ee[_0x903e('0xe')][_0x903e('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2433f5(null,util[_0x903e('0x10')](_0x903e('0x11'),path['basename'](_0x3e15ee[_0x903e('0xe')],path['extname'](_0x3e15ee[_0x903e('0xe')])),Date[_0x903e('0x12')](),path[_0x903e('0x13')](_0x3e15ee['originalname'])));}})});router[_0x903e('0x14')]('/',upload[_0x903e('0x15')](_0x903e('0x16')),controller['create']);router[_0x903e('0x17')](_0x903e('0x8'),auth[_0x903e('0x9')](),controller[_0x903e('0x18')]);router[_0x903e('0x19')](_0x903e('0x8'),auth[_0x903e('0x9')](),controller[_0x903e('0x19')]);module[_0x903e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c92bc79..dd932b7 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 _0x2941=['FLOAT','exports','STRING','name','INTEGER','BIGINT'];(function(_0x34ebde,_0x3c3000){var _0x5669df=function(_0x291b24){while(--_0x291b24){_0x34ebde['push'](_0x34ebde['shift']());}};_0x5669df(++_0x3c3000);}(_0x2941,0xc1));var _0x1294=function(_0x27fa65,_0x4e02ee){_0x27fa65=_0x27fa65-0x0;var _0x456594=_0x2941[_0x27fa65];return _0x456594;};'use strict';var Sequelize=require('sequelize');module[_0x1294('0x0')]={'name':{'type':Sequelize[_0x1294('0x1')],'unique':_0x1294('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1294('0x1')]},'display_name':{'type':Sequelize[_0x1294('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x1294('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x1294('0x3')]},'original_bitRate':{'type':Sequelize[_0x1294('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x1294('0x1')]},'converted_duration':{'type':Sequelize[_0x1294('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x1294('0x3')]},'converted_bitRate':{'type':Sequelize[_0x1294('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1294('0x3')]}}; \ No newline at end of file +var _0xe671=['FLOAT','BIGINT','INTEGER','STRING','name'];(function(_0x5e980d,_0x252e21){var _0x44f4d0=function(_0xb223d1){while(--_0xb223d1){_0x5e980d['push'](_0x5e980d['shift']());}};_0x44f4d0(++_0x252e21);}(_0xe671,0x184));var _0x1e67=function(_0x3d8b8b,_0x174ed2){_0x3d8b8b=_0x3d8b8b-0x0;var _0x397384=_0xe671[_0x3d8b8b];return _0x397384;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1e67('0x0')],'unique':_0x1e67('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1e67('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0x1e67('0x0')]},'original_format':{'type':Sequelize[_0x1e67('0x0')]},'original_duration':{'type':Sequelize[_0x1e67('0x2')]},'original_sampleCount':{'type':Sequelize[_0x1e67('0x3')]},'original_channelCount':{'type':Sequelize[_0x1e67('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x1e67('0x4')]},'converted_format':{'type':Sequelize[_0x1e67('0x0')]},'converted_duration':{'type':Sequelize[_0x1e67('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x1e67('0x4')]},'converted_bitRate':{'type':Sequelize[_0x1e67('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x1e67('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0d9a46a..c060321 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 _0x90b1=['get','Sounds','UserProfileResource','error','name','send','index','Sound','model','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','merge','map','type','VIRTUAL','filter','options','include','findAll','show','rawAttributes','keys','includeAll','find','download','params','save_name','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','format','%s.%s','catch','create','basename','originalname','file','filename','extname','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x203ed6,_0x4d9750){var _0x35c6e9=function(_0x1024d3){while(--_0x1024d3){_0x203ed6['push'](_0x203ed6['shift']());}};_0x35c6e9(++_0x4d9750);}(_0x90b1,0x1bb));var _0x190b=function(_0x5dff0c,_0x2bdeb4){_0x5dff0c=_0x5dff0c-0x0;var _0x15615f=_0x90b1[_0x5dff0c];return _0x15615f;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var authService=require(_0x190b('0xf'));var hardwareService=require(_0x190b('0x10'));var Redis=require(_0x190b('0x11'));var qs=require(_0x190b('0x12'));var logger=require(_0x190b('0x13'))(_0x190b('0x14'));var utils=require(_0x190b('0x15'));var config=require('../../config/environment');var db=require(_0x190b('0x16'))['db'];function respondWithStatusCode(_0x5cf995,_0x5701ad){_0x5701ad=_0x5701ad||0xcc;return function(_0x4d63ac){if(_0x4d63ac){return _0x5cf995[_0x190b('0x17')](_0x5701ad);}return _0x5cf995[_0x190b('0x18')](_0x5701ad)[_0x190b('0x19')]();};}function respondWithResult(_0x3cd4cd,_0x1e1fd5){_0x1e1fd5=_0x1e1fd5||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x3cd4cd[_0x190b('0x18')](_0x1e1fd5)[_0x190b('0x1a')](_0x2e12d4);}};}function respondWithFilteredResult(_0x441e58,_0x186941){return function(_0x1a046f){if(_0x1a046f){var _0xab346=_0x1a046f[_0x190b('0x1b')],_0x3e8781=_0x186941['offset'],_0x3fbfc3=_0x186941[_0x190b('0x1c')]+_0x186941['limit'],_0x121867;if(_0x3fbfc3>=_0xab346){_0x3fbfc3=_0xab346;_0x121867=0xc8;}else{_0x121867=0xce;}_0x441e58[_0x190b('0x18')](_0x121867);return _0x441e58[_0x190b('0x1d')](_0x190b('0x1e'),_0x3e8781+'-'+_0x3fbfc3+'/'+_0xab346)[_0x190b('0x1a')](_0x1a046f);}return null;};}function patchUpdates(_0x50a3c4){return function(_0x298343){try{jsonpatch[_0x190b('0x1f')](_0x298343,_0x50a3c4,!![]);}catch(_0x441a2b){return BPromise[_0x190b('0x20')](_0x441a2b);}return _0x298343[_0x190b('0x21')]();};}function saveUpdates(_0x177170,_0x47d704){return function(_0x3ed24c){if(_0x3ed24c){return _0x3ed24c[_0x190b('0x22')](_0x177170)['then'](function(_0xb4c32b){return _0xb4c32b;});}return null;};}function removeEntity(_0x5740af,_0x55de01){return function(_0xcd15e5){if(_0xcd15e5){return _0xcd15e5[_0x190b('0x23')]()[_0x190b('0x24')](function(){var _0x4c0b6e=_0xcd15e5[_0x190b('0x25')]({'plain':!![]});var _0x2e633e=_0x190b('0x26');return db[_0x190b('0x27')][_0x190b('0x23')]({'where':{'type':_0x2e633e,'resourceId':_0x4c0b6e['id']}})[_0x190b('0x24')](function(){return _0xcd15e5;});})[_0x190b('0x24')](function(){_0x5740af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x28')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x29')]){delete _0x328e5e[_0x190b('0x29')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x2a')](_0x328e5e);};}exports[_0x190b('0x2b')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=db[_0x190b('0x2c')]['rawAttributes'];_0x3730cc[_0x190b('0x2d')]=_['keys'](_0x14be2c);_0x3730cc[_0x190b('0x2e')]=_['keys'](_0x359b4a[_0x190b('0x2e')]);_0x3730cc['filters']=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x2d')],_0x3730cc['query']);_0x536d7b[_0x190b('0x30')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x2d')],qs[_0x190b('0x31')](_0x359b4a[_0x190b('0x2e')][_0x190b('0x31')]));_0x536d7b[_0x190b('0x30')]=_0x536d7b[_0x190b('0x30')]['length']?_0x536d7b['attributes']:_0x3730cc[_0x190b('0x2d')];if(!_0x359b4a[_0x190b('0x2e')]['hasOwnProperty'](_0x190b('0x32'))){_0x536d7b[_0x190b('0x33')]=qs[_0x190b('0x33')](_0x359b4a[_0x190b('0x2e')][_0x190b('0x33')]);_0x536d7b[_0x190b('0x1c')]=qs[_0x190b('0x1c')](_0x359b4a['query']['offset']);}_0x536d7b[_0x190b('0x34')]=qs[_0x190b('0x35')](_0x359b4a[_0x190b('0x2e')]['sort']);_0x536d7b[_0x190b('0x36')]=qs[_0x190b('0x37')](_[_0x190b('0x38')](_0x359b4a['query'],_0x3730cc[_0x190b('0x37')]));if(_0x359b4a['query']['filter']){_0x536d7b[_0x190b('0x36')]=_[_0x190b('0x39')](_0x536d7b['where'],{'$or':_[_0x190b('0x3a')](_0x14be2c,function(_0xfd0d62){if(_0xfd0d62[_0x190b('0x3b')]['key']!==_0x190b('0x3c')){var _0x39036d={};_0x39036d[_0xfd0d62['field']]={'$like':'%'+_0x359b4a['query'][_0x190b('0x3d')]+'%'};return _0x39036d;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3e')]);var _0x741e94={'where':_0x536d7b[_0x190b('0x36')]};return db[_0x190b('0x2c')]['count'](_0x741e94)[_0x190b('0x24')](function(_0x5f118c){_0x4d5f3f[_0x190b('0x1b')]=_0x5f118c;if(_0x359b4a[_0x190b('0x2e')]['includeAll']){_0x536d7b[_0x190b('0x3f')]=[{'all':!![]}];}return db[_0x190b('0x2c')][_0x190b('0x40')](_0x536d7b);})['then'](function(_0x2c7c0e){_0x4d5f3f['rows']=_0x2c7c0e;return _0x4d5f3f;})['then'](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports[_0x190b('0x41')]=function(_0x3aef1d,_0x411cb5){var _0x2b4e34={'raw':!![],'where':{'id':_0x3aef1d['params']['id']}},_0x48b2fa={};_0x48b2fa[_0x190b('0x2d')]=_['keys'](db[_0x190b('0x2c')][_0x190b('0x42')]);_0x48b2fa['query']=_[_0x190b('0x43')](_0x3aef1d[_0x190b('0x2e')]);_0x48b2fa[_0x190b('0x37')]=_['intersection'](_0x48b2fa[_0x190b('0x2d')],_0x48b2fa[_0x190b('0x2e')]);_0x2b4e34['attributes']=_[_0x190b('0x2f')](_0x48b2fa['model'],qs[_0x190b('0x31')](_0x3aef1d[_0x190b('0x2e')][_0x190b('0x31')]));_0x2b4e34['attributes']=_0x2b4e34[_0x190b('0x30')]['length']?_0x2b4e34[_0x190b('0x30')]:_0x48b2fa[_0x190b('0x2d')];if(_0x3aef1d[_0x190b('0x2e')][_0x190b('0x44')]){_0x2b4e34[_0x190b('0x3f')]=[{'all':!![]}];}_0x2b4e34=_[_0x190b('0x39')]({},_0x2b4e34,_0x3aef1d[_0x190b('0x3e')]);return db['Sound'][_0x190b('0x45')](_0x2b4e34)[_0x190b('0x24')](handleEntityNotFound(_0x411cb5,null))[_0x190b('0x24')](respondWithResult(_0x411cb5,null))['catch'](handleError(_0x411cb5,null));};exports[_0x190b('0x46')]=function(_0x27314f,_0x51af04,_0x576660){return db[_0x190b('0x2c')]['find']({'where':{'id':_0x27314f[_0x190b('0x47')]['id']},'attributes':[_0x190b('0x29'),_0x190b('0x48'),'converted_format'],'raw':!![]})[_0x190b('0x24')](handleEntityNotFound(_0x51af04,null))[_0x190b('0x24')](function(_0x2b0a3a){if(_0x2b0a3a){if(!fs['existsSync'](path['join'](config[_0x190b('0x49')],_0x190b('0x4a'),_0x2b0a3a[_0x190b('0x48')]+'.'+_0x2b0a3a[_0x190b('0x4b')]))){throw new db[(_0x190b('0x4c'))][(_0x190b('0x4d'))]('Sound\x20not\x20found');}return _0x51af04[_0x190b('0x46')](path[_0x190b('0x4e')](config[_0x190b('0x49')],'server/files/sounds/converted',util[_0x190b('0x4f')](_0x190b('0x50'),_0x2b0a3a[_0x190b('0x48')],_0x2b0a3a['converted_format'])),util[_0x190b('0x4f')](_0x190b('0x50'),_0x2b0a3a[_0x190b('0x29')],_0x2b0a3a[_0x190b('0x4b')]));}return null;})[_0x190b('0x51')](handleError(_0x51af04,null));};exports[_0x190b('0x52')]=function(_0x33cc78,_0x2ea1c8,_0x3a9087){var _0x1f7ec2={'name':path[_0x190b('0x53')](_0x33cc78['file'][_0x190b('0x54')],path['extname'](_0x33cc78[_0x190b('0x55')][_0x190b('0x54')])),'save_name':path['basename'](_0x33cc78[_0x190b('0x55')][_0x190b('0x56')],path[_0x190b('0x57')](_0x33cc78[_0x190b('0x55')][_0x190b('0x56')])),'original_format':path[_0x190b('0x57')](_0x33cc78[_0x190b('0x55')][_0x190b('0x54')])['substring'](0x1),'converted_format':_0x190b('0x58')};var _0x260adb=path[_0x190b('0x4e')](config['root'],_0x190b('0x59'),_0x33cc78['file']['filename']);var _0x41b16=path[_0x190b('0x4e')](config[_0x190b('0x49')],_0x190b('0x4a'),util[_0x190b('0x4f')](_0x190b('0x50'),path[_0x190b('0x53')](_0x33cc78[_0x190b('0x55')][_0x190b('0x56')],path[_0x190b('0x57')](_0x33cc78[_0x190b('0x55')][_0x190b('0x56')])),_0x1f7ec2[_0x190b('0x4b')]));logger[_0x190b('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x260adb);logger[_0x190b('0x5a')](_0x190b('0x5b'),_0x41b16);try{fs[_0x190b('0x5c')](_0x260adb,parseInt(_0x190b('0x5d'),0x8));var _0x53d740=sox['transcode'](_0x260adb,_0x41b16,{'sampleRate':0x1f40,'format':_0x190b('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53d740['on'](_0x190b('0x28'),function(_0x49fa17){fs[_0x190b('0x5e')](_0x260adb);_0x2ea1c8['status'](0x1f4)[_0x190b('0x2a')](_0x49fa17);});_0x53d740['on'](_0x190b('0x5f'),function(_0xf7b6b9){_0x1f7ec2['original_duration']=isNaN(_0xf7b6b9[_0x190b('0x60')])?null:_0xf7b6b9[_0x190b('0x60')]*0x3e8;_0x1f7ec2[_0x190b('0x61')]=isNaN(_0xf7b6b9[_0x190b('0x62')])?null:_0xf7b6b9[_0x190b('0x62')];_0x1f7ec2[_0x190b('0x63')]=isNaN(_0xf7b6b9[_0x190b('0x64')])?null:_0xf7b6b9[_0x190b('0x64')];_0x1f7ec2[_0x190b('0x65')]=isNaN(_0xf7b6b9['bitRate'])?null:_0xf7b6b9['bitRate'];_0x1f7ec2[_0x190b('0x66')]=isNaN(_0xf7b6b9[_0x190b('0x67')])?null:_0xf7b6b9[_0x190b('0x67')];});_0x53d740['on'](_0x190b('0x68'),function(_0x4af037){_0x1f7ec2[_0x190b('0x69')]=isNaN(_0x4af037[_0x190b('0x60')])?null:_0x4af037['duration']*0x3e8;_0x1f7ec2[_0x190b('0x6a')]=isNaN(_0x4af037[_0x190b('0x62')])?null:_0x4af037[_0x190b('0x62')];_0x1f7ec2[_0x190b('0x6b')]=isNaN(_0x4af037[_0x190b('0x64')])?null:_0x4af037[_0x190b('0x64')];_0x1f7ec2[_0x190b('0x6c')]=isNaN(_0x4af037[_0x190b('0x6d')])?null:_0x4af037['bitRate'];_0x1f7ec2[_0x190b('0x6e')]=isNaN(_0x4af037['sampleRate'])?null:_0x4af037['sampleRate'];});_0x53d740['on'](_0x190b('0x19'),function(){fs[_0x190b('0x5c')](_0x41b16,parseInt(_0x190b('0x5d'),0x8));return db['Sound']['create'](_0x1f7ec2)[_0x190b('0x24')](function(_0xdc7579){var _0x24c00d={'role':_0x33cc78[_0x190b('0x6f')][_0x190b('0x70')],'userProfileId':_0x33cc78[_0x190b('0x6f')][_0x190b('0x71')]};if(!_0x24c00d)throw new Error(_0x190b('0x72'));if(_0x24c00d['role']===_0x190b('0x73')){var _0x419547=_0xdc7579[_0x190b('0x25')]({'plain':!![]});return db[_0x190b('0x74')][_0x190b('0x45')]({'where':{'name':'Sounds','userProfileId':_0x24c00d[_0x190b('0x71')]},'raw':!![]})[_0x190b('0x24')](function(_0x6fe403){if(_0x6fe403&&_0x6fe403['autoAssociation']===0x0){return db[_0x190b('0x27')][_0x190b('0x52')]({'name':_0x419547[_0x190b('0x29')],'resourceId':_0x419547['id'],'type':_0x6fe403[_0x190b('0x29')],'sectionId':_0x6fe403['id']},{})['then'](function(){return _0xdc7579;});}else{return _0xdc7579;}})[_0x190b('0x51')](function(_0xea5876){logger[_0x190b('0x28')](_0x190b('0x75'),_0xea5876);throw _0xea5876;});}return _0xdc7579;})['then'](respondWithResult(_0x2ea1c8,null))[_0x190b('0x51')](handleError(_0x2ea1c8,null));});_0x53d740['start']();}catch(_0x2495c9){_0x2ea1c8[_0x190b('0x18')](0x1f4)[_0x190b('0x2a')](_0x2495c9);}};exports[_0x190b('0x22')]=function(_0x52ba56,_0x2a36b3,_0x52fa63){return db[_0x190b('0x2c')]['find']({'where':{'id':_0x52ba56['params']['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x2a36b3,null))['then'](saveUpdates(_[_0x190b('0x38')](_0x52ba56[_0x190b('0x6f')],[_0x190b('0x29'),_0x190b('0x76')]),null))[_0x190b('0x24')](respondWithResult(_0x2a36b3,null))['catch'](handleError(_0x2a36b3,null));};exports[_0x190b('0x77')]=function(_0xa26f18,_0xdafef7,_0x519a92){return db[_0x190b('0x2c')][_0x190b('0x45')]({'where':{'id':_0xa26f18['params']['id']}})[_0x190b('0x24')](function(_0x164820){if(_0x164820){return _0x164820[_0x190b('0x23')]();}})['then'](function(_0x1446a4){var _0x26be58=path[_0x190b('0x4e')](config[_0x190b('0x49')],'server/files/sounds/original',util[_0x190b('0x4f')](_0x190b('0x50'),_0x1446a4[_0x190b('0x48')],_0x1446a4['original_format']));var _0x1bc4f0=path[_0x190b('0x4e')](config[_0x190b('0x49')],'server/files/sounds/converted',util[_0x190b('0x4f')](_0x190b('0x50'),_0x1446a4[_0x190b('0x48')],_0x1446a4[_0x190b('0x4b')]));fs[_0x190b('0x5e')](_0x26be58);fs['unlinkSync'](_0x1bc4f0);return _0x1446a4;})['then'](function(_0x10b7ae){if(_0x10b7ae){return _0xdafef7[_0x190b('0x18')](0xcc)['end']();}})[_0x190b('0x24')](handleEntityNotFound(_0xdafef7,null))[_0x190b('0x51')](handleError(_0xdafef7,null));}; \ No newline at end of file +var _0x7a54=['chmodSync','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','converted_duration','converted_channelCount','converted_sampleRate','sampleRate','0777','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','offset','where','pick','filter','merge','map','type','key','field','options','Sound','includeAll','include','findAll','rows','catch','show','params','length','find','download','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join','root','%s.%s','save_name','format','create','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s'];(function(_0x174716,_0x4f2708){var _0x13f224=function(_0xbc2f2f){while(--_0xbc2f2f){_0x174716['push'](_0x174716['shift']());}};_0x13f224(++_0x4f2708);}(_0x7a54,0x106));var _0x47a5=function(_0x35e2cf,_0x2feed1){_0x35e2cf=_0x35e2cf-0x0;var _0x58cbd2=_0x7a54[_0x35e2cf];return _0x58cbd2;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){var _0x23db32=_0x4c5910[_0x47a5('0x21')]({'plain':!![]});var _0x5ef1b1=_0x47a5('0x22');return db[_0x47a5('0x23')]['destroy']({'where':{'type':_0x5ef1b1,'resourceId':_0x23db32['id']}})[_0x47a5('0x20')](function(){return _0x4c5910;});})[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x14')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x24')](_0x5b6c4e[_0x47a5('0x25')]);if(_0x5b6c4e[_0x47a5('0x26')]){delete _0x5b6c4e[_0x47a5('0x26')];}_0x5686db[_0x47a5('0x16')](_0x1ea9c8)[_0x47a5('0x27')](_0x5b6c4e);};}exports[_0x47a5('0x28')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=db['Sound'][_0x47a5('0x29')];_0x1127f8['model']=_[_0x47a5('0x2a')](_0x3ad507);_0x1127f8[_0x47a5('0x2b')]=_[_0x47a5('0x2a')](_0x136b14['query']);_0x1127f8[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x1127f8[_0x47a5('0x2e')],_0x1127f8[_0x47a5('0x2b')]);_0x361bfa['attributes']=_['intersection'](_0x1127f8[_0x47a5('0x2e')],qs[_0x47a5('0x2f')](_0x136b14['query']['fields']));_0x361bfa[_0x47a5('0x30')]=_0x361bfa[_0x47a5('0x30')]['length']?_0x361bfa[_0x47a5('0x30')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2b')][_0x47a5('0x31')]('nolimit')){_0x361bfa['limit']=qs[_0x47a5('0x19')](_0x136b14['query'][_0x47a5('0x19')]);_0x361bfa[_0x47a5('0x32')]=qs[_0x47a5('0x32')](_0x136b14['query'][_0x47a5('0x32')]);}_0x361bfa['order']=qs['sort'](_0x136b14[_0x47a5('0x2b')]['sort']);_0x361bfa[_0x47a5('0x33')]=qs['filters'](_[_0x47a5('0x34')](_0x136b14[_0x47a5('0x2b')],_0x1127f8[_0x47a5('0x2c')]));if(_0x136b14[_0x47a5('0x2b')][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x33')]=_[_0x47a5('0x36')](_0x361bfa[_0x47a5('0x33')],{'$or':_[_0x47a5('0x37')](_0x3ad507,function(_0x4caed5){if(_0x4caed5[_0x47a5('0x38')][_0x47a5('0x39')]!=='VIRTUAL'){var _0x2c50d6={};_0x2c50d6[_0x4caed5[_0x47a5('0x3a')]]={'$like':'%'+_0x136b14[_0x47a5('0x2b')]['filter']+'%'};return _0x2c50d6;}})});}_0x361bfa=_[_0x47a5('0x36')]({},_0x361bfa,_0x136b14[_0x47a5('0x3b')]);var _0x596097={'where':_0x361bfa[_0x47a5('0x33')]};return db[_0x47a5('0x3c')]['count'](_0x596097)['then'](function(_0x5ebd8c){_0x11a4fa[_0x47a5('0x18')]=_0x5ebd8c;if(_0x136b14['query'][_0x47a5('0x3d')]){_0x361bfa[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x3c')][_0x47a5('0x3f')](_0x361bfa);})[_0x47a5('0x20')](function(_0xcb5243){_0x11a4fa[_0x47a5('0x40')]=_0xcb5243;return _0x11a4fa;})[_0x47a5('0x20')](respondWithFilteredResult(_0x16631f,_0x361bfa))[_0x47a5('0x41')](handleError(_0x16631f,null));};exports[_0x47a5('0x42')]=function(_0x280500,_0x1658e8){var _0x23d6d8={'raw':!![],'where':{'id':_0x280500[_0x47a5('0x43')]['id']}},_0x56dbbd={};_0x56dbbd[_0x47a5('0x2e')]=_[_0x47a5('0x2a')](db[_0x47a5('0x3c')]['rawAttributes']);_0x56dbbd[_0x47a5('0x2b')]=_['keys'](_0x280500['query']);_0x56dbbd['filters']=_['intersection'](_0x56dbbd[_0x47a5('0x2e')],_0x56dbbd['query']);_0x23d6d8[_0x47a5('0x30')]=_[_0x47a5('0x2d')](_0x56dbbd[_0x47a5('0x2e')],qs['fields'](_0x280500[_0x47a5('0x2b')][_0x47a5('0x2f')]));_0x23d6d8['attributes']=_0x23d6d8['attributes'][_0x47a5('0x44')]?_0x23d6d8['attributes']:_0x56dbbd[_0x47a5('0x2e')];if(_0x280500[_0x47a5('0x2b')][_0x47a5('0x3d')]){_0x23d6d8[_0x47a5('0x3e')]=[{'all':!![]}];}_0x23d6d8=_[_0x47a5('0x36')]({},_0x23d6d8,_0x280500[_0x47a5('0x3b')]);return db[_0x47a5('0x3c')][_0x47a5('0x45')](_0x23d6d8)[_0x47a5('0x20')](handleEntityNotFound(_0x1658e8,null))[_0x47a5('0x20')](respondWithResult(_0x1658e8,null))[_0x47a5('0x41')](handleError(_0x1658e8,null));};exports[_0x47a5('0x46')]=function(_0xe28d76,_0x3574d4,_0x4e5e7){return db[_0x47a5('0x3c')]['find']({'where':{'id':_0xe28d76[_0x47a5('0x43')]['id']},'attributes':[_0x47a5('0x26'),'save_name','converted_format'],'raw':!![]})[_0x47a5('0x20')](handleEntityNotFound(_0x3574d4,null))['then'](function(_0x13750d){if(_0x13750d){if(!fs[_0x47a5('0x47')](path['join'](config['root'],_0x47a5('0x48'),_0x13750d['save_name']+'.'+_0x13750d[_0x47a5('0x49')]))){throw new db[(_0x47a5('0x4a'))][(_0x47a5('0x4b'))](_0x47a5('0x4c'));}return _0x3574d4[_0x47a5('0x46')](path[_0x47a5('0x4d')](config[_0x47a5('0x4e')],'server/files/sounds/converted',util['format'](_0x47a5('0x4f'),_0x13750d[_0x47a5('0x50')],_0x13750d[_0x47a5('0x49')])),util[_0x47a5('0x51')](_0x47a5('0x4f'),_0x13750d[_0x47a5('0x26')],_0x13750d[_0x47a5('0x49')]));}return null;})['catch'](handleError(_0x3574d4,null));};exports[_0x47a5('0x52')]=function(_0x1c9a62,_0x5f6a,_0x5c3c75){var _0x12ca40={'name':path['basename'](_0x1c9a62[_0x47a5('0x53')][_0x47a5('0x54')],path[_0x47a5('0x55')](_0x1c9a62[_0x47a5('0x53')]['originalname'])),'save_name':path[_0x47a5('0x56')](_0x1c9a62[_0x47a5('0x53')][_0x47a5('0x57')],path[_0x47a5('0x55')](_0x1c9a62[_0x47a5('0x53')][_0x47a5('0x57')])),'original_format':path[_0x47a5('0x55')](_0x1c9a62['file'][_0x47a5('0x54')])[_0x47a5('0x58')](0x1),'converted_format':_0x47a5('0x59')};var _0x8da9fb=path[_0x47a5('0x4d')](config[_0x47a5('0x4e')],'server/files/sounds/original',_0x1c9a62[_0x47a5('0x53')][_0x47a5('0x57')]);var _0x1aa581=path['join'](config[_0x47a5('0x4e')],_0x47a5('0x48'),util[_0x47a5('0x51')]('%s.%s',path['basename'](_0x1c9a62[_0x47a5('0x53')][_0x47a5('0x57')],path['extname'](_0x1c9a62['file'][_0x47a5('0x57')])),_0x12ca40['converted_format']));logger[_0x47a5('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x8da9fb);logger['info'](_0x47a5('0x5b'),_0x1aa581);try{fs[_0x47a5('0x5c')](_0x8da9fb,parseInt('0777',0x8));var _0x1b958b=sox[_0x47a5('0x5d')](_0x8da9fb,_0x1aa581,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b958b['on']('error',function(_0x16b4fd){fs[_0x47a5('0x5e')](_0x8da9fb);_0x5f6a[_0x47a5('0x16')](0x1f4)[_0x47a5('0x27')](_0x16b4fd);});_0x1b958b['on']('src',function(_0x199621){_0x12ca40[_0x47a5('0x5f')]=isNaN(_0x199621[_0x47a5('0x60')])?null:_0x199621['duration']*0x3e8;_0x12ca40[_0x47a5('0x61')]=isNaN(_0x199621['sampleCount'])?null:_0x199621[_0x47a5('0x62')];_0x12ca40[_0x47a5('0x63')]=isNaN(_0x199621[_0x47a5('0x64')])?null:_0x199621[_0x47a5('0x64')];_0x12ca40[_0x47a5('0x65')]=isNaN(_0x199621['bitRate'])?null:_0x199621[_0x47a5('0x66')];_0x12ca40['original_sampleRate']=isNaN(_0x199621['sampleRate'])?null:_0x199621['sampleRate'];});_0x1b958b['on']('dest',function(_0x212d92){_0x12ca40[_0x47a5('0x67')]=isNaN(_0x212d92[_0x47a5('0x60')])?null:_0x212d92['duration']*0x3e8;_0x12ca40['converted_sampleCount']=isNaN(_0x212d92[_0x47a5('0x62')])?null:_0x212d92[_0x47a5('0x62')];_0x12ca40[_0x47a5('0x68')]=isNaN(_0x212d92[_0x47a5('0x64')])?null:_0x212d92[_0x47a5('0x64')];_0x12ca40['converted_bitRate']=isNaN(_0x212d92[_0x47a5('0x66')])?null:_0x212d92['bitRate'];_0x12ca40[_0x47a5('0x69')]=isNaN(_0x212d92[_0x47a5('0x6a')])?null:_0x212d92['sampleRate'];});_0x1b958b['on'](_0x47a5('0x15'),function(){fs[_0x47a5('0x5c')](_0x1aa581,parseInt(_0x47a5('0x6b'),0x8));return db[_0x47a5('0x3c')][_0x47a5('0x52')](_0x12ca40)[_0x47a5('0x20')](function(_0x35cca8){var _0x3ac38c={'role':_0x1c9a62['body'][_0x47a5('0x6c')],'userProfileId':_0x1c9a62[_0x47a5('0x6d')][_0x47a5('0x6e')]};if(!_0x3ac38c)throw new Error(_0x47a5('0x6f'));if(_0x3ac38c[_0x47a5('0x6c')]==='user'){var _0xbec033=_0x35cca8[_0x47a5('0x21')]({'plain':!![]});return db[_0x47a5('0x70')][_0x47a5('0x45')]({'where':{'name':_0x47a5('0x22'),'userProfileId':_0x3ac38c[_0x47a5('0x6e')]},'raw':!![]})[_0x47a5('0x20')](function(_0x149d34){if(_0x149d34&&_0x149d34[_0x47a5('0x71')]===0x0){return db[_0x47a5('0x23')][_0x47a5('0x52')]({'name':_0xbec033[_0x47a5('0x26')],'resourceId':_0xbec033['id'],'type':_0x149d34[_0x47a5('0x26')],'sectionId':_0x149d34['id']},{})[_0x47a5('0x20')](function(){return _0x35cca8;});}else{return _0x35cca8;}})[_0x47a5('0x41')](function(_0x5a6161){logger[_0x47a5('0x24')](_0x47a5('0x72'),_0x5a6161);throw _0x5a6161;});}return _0x35cca8;})[_0x47a5('0x20')](respondWithResult(_0x5f6a,null))['catch'](handleError(_0x5f6a,null));});_0x1b958b[_0x47a5('0x73')]();}catch(_0x2e46af){_0x5f6a[_0x47a5('0x16')](0x1f4)[_0x47a5('0x27')](_0x2e46af);}};exports['update']=function(_0x3ac402,_0x522ccf,_0x2d5ee6){return db['Sound'][_0x47a5('0x45')]({'where':{'id':_0x3ac402['params']['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x522ccf,null))[_0x47a5('0x20')](saveUpdates(_[_0x47a5('0x34')](_0x3ac402['body'],['name','description']),null))[_0x47a5('0x20')](respondWithResult(_0x522ccf,null))[_0x47a5('0x41')](handleError(_0x522ccf,null));};exports[_0x47a5('0x74')]=function(_0x117510,_0x525055,_0x6c0f0){return db[_0x47a5('0x3c')][_0x47a5('0x45')]({'where':{'id':_0x117510[_0x47a5('0x43')]['id']}})[_0x47a5('0x20')](function(_0xb9f589){if(_0xb9f589){return _0xb9f589[_0x47a5('0x1f')]();}})[_0x47a5('0x20')](function(_0x4618a0){var _0xc69a68=path[_0x47a5('0x4d')](config[_0x47a5('0x4e')],'server/files/sounds/original',util[_0x47a5('0x51')]('%s.%s',_0x4618a0[_0x47a5('0x50')],_0x4618a0[_0x47a5('0x75')]));var _0x281e5f=path[_0x47a5('0x4d')](config[_0x47a5('0x4e')],_0x47a5('0x48'),util[_0x47a5('0x51')](_0x47a5('0x4f'),_0x4618a0[_0x47a5('0x50')],_0x4618a0[_0x47a5('0x49')]));fs[_0x47a5('0x5e')](_0xc69a68);fs[_0x47a5('0x5e')](_0x281e5f);return _0x4618a0;})[_0x47a5('0x20')](function(_0x2d434c){if(_0x2d434c){return _0x525055[_0x47a5('0x16')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x525055,null))['catch'](handleError(_0x525055,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a33e866..17c96a5 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 _0xd374=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','Sound'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd374,0xdd));var _0x4d37=function(_0x2a0f10,_0x505475){_0x2a0f10=_0x2a0f10-0x0;var _0x20befe=_0xd374[_0x2a0f10];return _0x20befe;};'use strict';var _=require(_0x4d37('0x0'));var util=require(_0x4d37('0x1'));var logger=require(_0x4d37('0x2'))(_0x4d37('0x3'));var moment=require(_0x4d37('0x4'));var BPromise=require(_0x4d37('0x5'));var rp=require(_0x4d37('0x6'));var attributes=require('./sound.attributes');module[_0x4d37('0x7')]=function(_0x3497a2,_0x87aedc){return _0x3497a2[_0x4d37('0x8')](_0x4d37('0x9'),attributes,{'tableName':_0x4d37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fd1=['Sound','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','./sound.attributes','exports'];(function(_0x577035,_0x442532){var _0x53e0d2=function(_0x14c607){while(--_0x14c607){_0x577035['push'](_0x577035['shift']());}};_0x53e0d2(++_0x442532);}(_0x5fd1,0xac));var _0x15fd=function(_0xc1f8cc,_0x5d9f25){_0xc1f8cc=_0xc1f8cc-0x0;var _0x358909=_0x5fd1[_0xc1f8cc];return _0x358909;};'use strict';var _=require(_0x15fd('0x0'));var util=require(_0x15fd('0x1'));var logger=require(_0x15fd('0x2'))(_0x15fd('0x3'));var moment=require(_0x15fd('0x4'));var BPromise=require('bluebird');var rp=require(_0x15fd('0x5'));var attributes=require(_0x15fd('0x6'));module[_0x15fd('0x7')]=function(_0x44ab1d,_0x191a49){return _0x44ab1d['define'](_0x15fd('0x8'),attributes,{'tableName':_0x15fd('0x9'),'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 145cce8..289ba8d 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 _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['ShowSound']=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,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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['ShowSound']=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,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 7e85404..832a6ac 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 _0x980c=['show','post','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x980c,0x100));var _0xc980=function(_0x2cac5a,_0x27ddf5){_0x2cac5a=_0x2cac5a-0x0;var _0xa2641e=_0x980c[_0x2cac5a];return _0xa2641e;};'use strict';var multer=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var path=require(_0xc980('0x2'));var timeout=require(_0xc980('0x3'));var express=require(_0xc980('0x4'));var router=express[_0xc980('0x5')]();var auth=require(_0xc980('0x6'));var interaction=require(_0xc980('0x7'));var config=require(_0xc980('0x8'));var controller=require(_0xc980('0x9'));router[_0xc980('0xa')]('/',auth['isAuthenticated'](),controller[_0xc980('0xb')]);router[_0xc980('0xa')](_0xc980('0xc'),auth[_0xc980('0xd')](),controller[_0xc980('0xe')]);router[_0xc980('0xf')]('/',auth[_0xc980('0xd')](),controller['create']);router['put']('/:id',auth[_0xc980('0xd')](),controller['update']);router[_0xc980('0x10')](_0xc980('0xc'),auth[_0xc980('0xd')](),controller['destroy']);module[_0xc980('0x11')]=router; \ No newline at end of file +var _0x3946=['isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','/:id'];(function(_0x22b6b4,_0x1f8e49){var _0x2ee634=function(_0x5c7f61){while(--_0x5c7f61){_0x22b6b4['push'](_0x22b6b4['shift']());}};_0x2ee634(++_0x1f8e49);}(_0x3946,0x1d0));var _0x6394=function(_0x26e606,_0xf6d86e){_0x26e606=_0x26e606-0x0;var _0x4b346e=_0x3946[_0x26e606];return _0x4b346e;};'use strict';var multer=require('multer');var util=require(_0x6394('0x0'));var path=require(_0x6394('0x1'));var timeout=require(_0x6394('0x2'));var express=require(_0x6394('0x3'));var router=express[_0x6394('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6394('0x5'));var config=require(_0x6394('0x6'));var controller=require(_0x6394('0x7'));router[_0x6394('0x8')]('/',auth['isAuthenticated'](),controller[_0x6394('0x9')]);router[_0x6394('0x8')](_0x6394('0xa'),auth[_0x6394('0xb')](),controller[_0x6394('0xc')]);router[_0x6394('0xd')]('/',auth[_0x6394('0xb')](),controller[_0x6394('0xe')]);router['put'](_0x6394('0xa'),auth[_0x6394('0xb')](),controller[_0x6394('0xf')]);router[_0x6394('0x10')](_0x6394('0xa'),auth[_0x6394('0xb')](),controller[_0x6394('0x11')]);module[_0x6394('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ad41b7c..0dab230 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 _0x0538=['TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0538,0x1d8));var _0x8053=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x0538[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require(_0x8053('0x0'));module[_0x8053('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x8053('0x2')](_0x8053('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x8053('0x4')]('in',_0x8053('0x5')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file +var _0x759d=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x759d,0xad));var _0xd759=function(_0x4e699f,_0x47e87d){_0x4e699f=_0x4e699f-0x0;var _0x820050=_0x759d[_0x4e699f];return _0x820050;};'use strict';var Sequelize=require(_0xd759('0x0'));module[_0xd759('0x1')]={'uniqueid':{'type':Sequelize[_0xd759('0x2')]},'body':{'type':Sequelize[_0xd759('0x3')](_0xd759('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd759('0x5')),'defaultValue':_0xd759('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index df77b72..1f1756d 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 _0x2acf=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','save','update','then','error','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','field','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv'];(function(_0x175eaf,_0x25e4d5){var _0x1b67e9=function(_0xaed19a){while(--_0xaed19a){_0x175eaf['push'](_0x175eaf['shift']());}};_0x1b67e9(++_0x25e4d5);}(_0x2acf,0x15a));var _0xf2ac=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x2acf[_0xd8aad0];return _0x570860;};'use strict';var pdf=require(_0xf2ac('0x0'));var emlformat=require(_0xf2ac('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf2ac('0x2'));var jsonpatch=require(_0xf2ac('0x3'));var rp=require(_0xf2ac('0x4'));var moment=require('moment');var BPromise=require(_0xf2ac('0x5'));var Mustache=require(_0xf2ac('0x6'));var util=require(_0xf2ac('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf2ac('0x8'));var ejs=require(_0xf2ac('0x9'));var fs=require('fs');var _=require(_0xf2ac('0xa'));var squel=require(_0xf2ac('0xb'));var crypto=require(_0xf2ac('0xc'));var jsforce=require(_0xf2ac('0xd'));var deskjs=require(_0xf2ac('0xe'));var toCsv=require(_0xf2ac('0x8'));var querystring=require(_0xf2ac('0xf'));var Papa=require(_0xf2ac('0x10'));var authService=require(_0xf2ac('0x11'));var hardwareService=require(_0xf2ac('0x12'));var Redis=require(_0xf2ac('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf2ac('0x14'));var utils=require(_0xf2ac('0x15'));var config=require(_0xf2ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x479925,_0x1bd318){_0x1bd318=_0x1bd318||0xcc;return function(_0x204354){if(_0x204354){return _0x479925[_0xf2ac('0x17')](_0x1bd318);}return _0x479925[_0xf2ac('0x18')](_0x1bd318)[_0xf2ac('0x19')]();};}function respondWithResult(_0xaf7956,_0x581be6){_0x581be6=_0x581be6||0xc8;return function(_0x1644b7){if(_0x1644b7){return _0xaf7956['status'](_0x581be6)[_0xf2ac('0x1a')](_0x1644b7);}};}function respondWithFilteredResult(_0x17a939,_0x3ca59c){return function(_0xe6393c){if(_0xe6393c){var _0x2b6328=_0xe6393c[_0xf2ac('0x1b')],_0x282570=_0x3ca59c[_0xf2ac('0x1c')],_0x507f80=_0x3ca59c[_0xf2ac('0x1c')]+_0x3ca59c['limit'],_0x3792f4;if(_0x507f80>=_0x2b6328){_0x507f80=_0x2b6328;_0x3792f4=0xc8;}else{_0x3792f4=0xce;}_0x17a939[_0xf2ac('0x18')](_0x3792f4);return _0x17a939[_0xf2ac('0x1d')]('Content-Range',_0x282570+'-'+_0x507f80+'/'+_0x2b6328)[_0xf2ac('0x1a')](_0xe6393c);}return null;};}function patchUpdates(_0x5d87ef){return function(_0xe08066){try{jsonpatch[_0xf2ac('0x1e')](_0xe08066,_0x5d87ef,!![]);}catch(_0x2c54ed){return BPromise['reject'](_0x2c54ed);}return _0xe08066[_0xf2ac('0x1f')]();};}function saveUpdates(_0x46421f,_0x368575){return function(_0x4d5ed9){if(_0x4d5ed9){return _0x4d5ed9[_0xf2ac('0x20')](_0x46421f)[_0xf2ac('0x21')](function(_0x562668){return _0x562668;});}return null;};}function removeEntity(_0x26fe15,_0x51eacc){return function(_0x421a4a){if(_0x421a4a){return _0x421a4a['destroy']()[_0xf2ac('0x21')](function(){_0x26fe15[_0xf2ac('0x18')](0xcc)[_0xf2ac('0x19')]();});}};}function handleEntityNotFound(_0x4d3389,_0x6f8a66){return function(_0x5e4363){if(!_0x5e4363){_0x4d3389[_0xf2ac('0x17')](0x194);}return _0x5e4363;};}function handleError(_0x415f94,_0xe4d252){_0xe4d252=_0xe4d252||0x1f4;return function(_0x40aa85){logger[_0xf2ac('0x22')](_0x40aa85[_0xf2ac('0x23')]);if(_0x40aa85[_0xf2ac('0x24')]){delete _0x40aa85['name'];}_0x415f94['status'](_0xe4d252)[_0xf2ac('0x25')](_0x40aa85);};}exports[_0xf2ac('0x26')]=function(_0x24e640,_0x566cd0){var _0x529901={},_0x453ac0={},_0x131fb8={'count':0x0,'rows':[]};var _0x32321a=db[_0xf2ac('0x27')][_0xf2ac('0x28')];_0x453ac0[_0xf2ac('0x29')]=_['keys'](_0x32321a);_0x453ac0['query']=_[_0xf2ac('0x2a')](_0x24e640[_0xf2ac('0x2b')]);_0x453ac0[_0xf2ac('0x2c')]=_['intersection'](_0x453ac0[_0xf2ac('0x29')],_0x453ac0[_0xf2ac('0x2b')]);_0x529901[_0xf2ac('0x2d')]=_[_0xf2ac('0x2e')](_0x453ac0[_0xf2ac('0x29')],qs['fields'](_0x24e640[_0xf2ac('0x2b')][_0xf2ac('0x2f')]));_0x529901[_0xf2ac('0x2d')]=_0x529901[_0xf2ac('0x2d')][_0xf2ac('0x30')]?_0x529901[_0xf2ac('0x2d')]:_0x453ac0[_0xf2ac('0x29')];if(!_0x24e640[_0xf2ac('0x2b')][_0xf2ac('0x31')](_0xf2ac('0x32'))){_0x529901['limit']=qs[_0xf2ac('0x33')](_0x24e640[_0xf2ac('0x2b')][_0xf2ac('0x33')]);_0x529901[_0xf2ac('0x1c')]=qs[_0xf2ac('0x1c')](_0x24e640['query'][_0xf2ac('0x1c')]);}_0x529901['order']=qs['sort'](_0x24e640['query'][_0xf2ac('0x34')]);_0x529901[_0xf2ac('0x35')]=qs[_0xf2ac('0x2c')](_['pick'](_0x24e640['query'],_0x453ac0[_0xf2ac('0x2c')]));if(_0x24e640['query'][_0xf2ac('0x36')]){_0x529901[_0xf2ac('0x35')]=_['merge'](_0x529901[_0xf2ac('0x35')],{'$or':_[_0xf2ac('0x37')](_0x32321a,function(_0x4954b0){if(_0x4954b0[_0xf2ac('0x38')][_0xf2ac('0x39')]!=='VIRTUAL'){var _0x205cb1={};_0x205cb1[_0x4954b0[_0xf2ac('0x3a')]]={'$like':'%'+_0x24e640[_0xf2ac('0x2b')][_0xf2ac('0x36')]+'%'};return _0x205cb1;}})});}_0x529901=_[_0xf2ac('0x3b')]({},_0x529901,_0x24e640[_0xf2ac('0x3c')]);var _0x33fa87={'where':_0x529901[_0xf2ac('0x35')]};return db[_0xf2ac('0x27')][_0xf2ac('0x1b')](_0x33fa87)[_0xf2ac('0x21')](function(_0x4ec81e){_0x131fb8[_0xf2ac('0x1b')]=_0x4ec81e;if(_0x24e640[_0xf2ac('0x2b')][_0xf2ac('0x3d')]){_0x529901['include']=[{'all':!![]}];}return db['SquareMessage'][_0xf2ac('0x3e')](_0x529901);})['then'](function(_0x339d2b){_0x131fb8[_0xf2ac('0x3f')]=_0x339d2b;return _0x131fb8;})['then'](respondWithFilteredResult(_0x566cd0,_0x529901))[_0xf2ac('0x40')](handleError(_0x566cd0,null));};exports[_0xf2ac('0x41')]=function(_0x5b3c53,_0x3fbc76){var _0x571158={'raw':!![],'where':{'id':_0x5b3c53[_0xf2ac('0x42')]['id']}},_0x35d915={};_0x35d915[_0xf2ac('0x29')]=_[_0xf2ac('0x2a')](db[_0xf2ac('0x27')][_0xf2ac('0x28')]);_0x35d915[_0xf2ac('0x2b')]=_[_0xf2ac('0x2a')](_0x5b3c53[_0xf2ac('0x2b')]);_0x35d915['filters']=_['intersection'](_0x35d915['model'],_0x35d915[_0xf2ac('0x2b')]);_0x571158[_0xf2ac('0x2d')]=_[_0xf2ac('0x2e')](_0x35d915[_0xf2ac('0x29')],qs[_0xf2ac('0x2f')](_0x5b3c53[_0xf2ac('0x2b')][_0xf2ac('0x2f')]));_0x571158['attributes']=_0x571158['attributes'][_0xf2ac('0x30')]?_0x571158[_0xf2ac('0x2d')]:_0x35d915[_0xf2ac('0x29')];if(_0x5b3c53[_0xf2ac('0x2b')][_0xf2ac('0x3d')]){_0x571158[_0xf2ac('0x43')]=[{'all':!![]}];}_0x571158=_[_0xf2ac('0x3b')]({},_0x571158,_0x5b3c53[_0xf2ac('0x3c')]);return db[_0xf2ac('0x27')][_0xf2ac('0x44')](_0x571158)[_0xf2ac('0x21')](handleEntityNotFound(_0x3fbc76,null))[_0xf2ac('0x21')](respondWithResult(_0x3fbc76,null))[_0xf2ac('0x40')](handleError(_0x3fbc76,null));};exports[_0xf2ac('0x45')]=function(_0x2403da,_0x4b3f61){return db[_0xf2ac('0x27')][_0xf2ac('0x45')](_0x2403da[_0xf2ac('0x46')],{})[_0xf2ac('0x21')](respondWithResult(_0x4b3f61,0xc9))['catch'](handleError(_0x4b3f61,null));};exports[_0xf2ac('0x20')]=function(_0x20c728,_0x241727){if(_0x20c728[_0xf2ac('0x46')]['id']){delete _0x20c728[_0xf2ac('0x46')]['id'];}return db[_0xf2ac('0x27')][_0xf2ac('0x44')]({'where':{'id':_0x20c728[_0xf2ac('0x42')]['id']}})[_0xf2ac('0x21')](handleEntityNotFound(_0x241727,null))['then'](saveUpdates(_0x20c728['body'],null))[_0xf2ac('0x21')](respondWithResult(_0x241727,null))[_0xf2ac('0x40')](handleError(_0x241727,null));};exports['destroy']=function(_0x5214e1,_0x1a7c24){return db['SquareMessage']['find']({'where':{'id':_0x5214e1[_0xf2ac('0x42')]['id']}})[_0xf2ac('0x21')](handleEntityNotFound(_0x1a7c24,null))[_0xf2ac('0x21')](removeEntity(_0x1a7c24,null))[_0xf2ac('0x40')](handleError(_0x1a7c24,null));}; \ No newline at end of file +var _0xfae3=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','SquareMessage','includeAll','include','rows','catch','rawAttributes','merge','find','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','Content-Range','json','apply','reject','update','then','error','stack','name','index','model','query','keys'];(function(_0x5e1cae,_0x295231){var _0x247fd2=function(_0x3ab6ed){while(--_0x3ab6ed){_0x5e1cae['push'](_0x5e1cae['shift']());}};_0x247fd2(++_0x295231);}(_0xfae3,0x9d));var _0x3fae=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xfae3[_0x4aa4e6];return _0x322588;};'use strict';var pdf=require(_0x3fae('0x0'));var emlformat=require(_0x3fae('0x1'));var rimraf=require(_0x3fae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fae('0x3'));var rp=require(_0x3fae('0x4'));var moment=require(_0x3fae('0x5'));var BPromise=require(_0x3fae('0x6'));var Mustache=require(_0x3fae('0x7'));var util=require(_0x3fae('0x8'));var path=require(_0x3fae('0x9'));var sox=require('sox');var csv=require(_0x3fae('0xa'));var ejs=require(_0x3fae('0xb'));var fs=require('fs');var _=require(_0x3fae('0xc'));var squel=require('squel');var crypto=require(_0x3fae('0xd'));var jsforce=require(_0x3fae('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3fae('0xa'));var querystring=require(_0x3fae('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x3fae('0x10'));var Redis=require(_0x3fae('0x11'));var qs=require(_0x3fae('0x12'));var logger=require(_0x3fae('0x13'))(_0x3fae('0x14'));var utils=require(_0x3fae('0x15'));var config=require(_0x3fae('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58a012,_0x336788){_0x336788=_0x336788||0xcc;return function(_0x20a519){if(_0x20a519){return _0x58a012[_0x3fae('0x17')](_0x336788);}return _0x58a012['status'](_0x336788)[_0x3fae('0x18')]();};}function respondWithResult(_0x295b01,_0x4ec851){_0x4ec851=_0x4ec851||0xc8;return function(_0x1db627){if(_0x1db627){return _0x295b01[_0x3fae('0x19')](_0x4ec851)['json'](_0x1db627);}};}function respondWithFilteredResult(_0x267a12,_0x5f5d37){return function(_0x9ae7b3){if(_0x9ae7b3){var _0x2bb91e=_0x9ae7b3[_0x3fae('0x1a')],_0x4d06e1=_0x5f5d37[_0x3fae('0x1b')],_0x281018=_0x5f5d37['offset']+_0x5f5d37['limit'],_0x4c5251;if(_0x281018>=_0x2bb91e){_0x281018=_0x2bb91e;_0x4c5251=0xc8;}else{_0x4c5251=0xce;}_0x267a12[_0x3fae('0x19')](_0x4c5251);return _0x267a12['set'](_0x3fae('0x1c'),_0x4d06e1+'-'+_0x281018+'/'+_0x2bb91e)[_0x3fae('0x1d')](_0x9ae7b3);}return null;};}function patchUpdates(_0x314190){return function(_0x97da89){try{jsonpatch[_0x3fae('0x1e')](_0x97da89,_0x314190,!![]);}catch(_0x164e53){return BPromise[_0x3fae('0x1f')](_0x164e53);}return _0x97da89['save']();};}function saveUpdates(_0x4cc7dc,_0x15f4e7){return function(_0x5d66cb){if(_0x5d66cb){return _0x5d66cb[_0x3fae('0x20')](_0x4cc7dc)[_0x3fae('0x21')](function(_0xba7920){return _0xba7920;});}return null;};}function removeEntity(_0x3885ca,_0x489486){return function(_0x59d9a6){if(_0x59d9a6){return _0x59d9a6['destroy']()['then'](function(){_0x3885ca[_0x3fae('0x19')](0xcc)[_0x3fae('0x18')]();});}};}function handleEntityNotFound(_0x41739d,_0x112209){return function(_0x1f4ce3){if(!_0x1f4ce3){_0x41739d[_0x3fae('0x17')](0x194);}return _0x1f4ce3;};}function handleError(_0x5a0e6c,_0x5369a0){_0x5369a0=_0x5369a0||0x1f4;return function(_0x2c0c67){logger[_0x3fae('0x22')](_0x2c0c67[_0x3fae('0x23')]);if(_0x2c0c67[_0x3fae('0x24')]){delete _0x2c0c67[_0x3fae('0x24')];}_0x5a0e6c[_0x3fae('0x19')](_0x5369a0)['send'](_0x2c0c67);};}exports[_0x3fae('0x25')]=function(_0x1e86e6,_0x2b89a2){var _0x3cab0c={},_0x36524c={},_0x468010={'count':0x0,'rows':[]};var _0x489611=db['SquareMessage']['rawAttributes'];_0x36524c[_0x3fae('0x26')]=_['keys'](_0x489611);_0x36524c[_0x3fae('0x27')]=_[_0x3fae('0x28')](_0x1e86e6[_0x3fae('0x27')]);_0x36524c[_0x3fae('0x29')]=_[_0x3fae('0x2a')](_0x36524c[_0x3fae('0x26')],_0x36524c[_0x3fae('0x27')]);_0x3cab0c[_0x3fae('0x2b')]=_[_0x3fae('0x2a')](_0x36524c[_0x3fae('0x26')],qs[_0x3fae('0x2c')](_0x1e86e6['query'][_0x3fae('0x2c')]));_0x3cab0c[_0x3fae('0x2b')]=_0x3cab0c[_0x3fae('0x2b')]['length']?_0x3cab0c[_0x3fae('0x2b')]:_0x36524c[_0x3fae('0x26')];if(!_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x2d')](_0x3fae('0x2e'))){_0x3cab0c[_0x3fae('0x2f')]=qs[_0x3fae('0x2f')](_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x2f')]);_0x3cab0c['offset']=qs[_0x3fae('0x1b')](_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x1b')]);}_0x3cab0c['order']=qs['sort'](_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x30')]);_0x3cab0c[_0x3fae('0x31')]=qs[_0x3fae('0x29')](_[_0x3fae('0x32')](_0x1e86e6[_0x3fae('0x27')],_0x36524c[_0x3fae('0x29')]));if(_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x33')]){_0x3cab0c[_0x3fae('0x31')]=_['merge'](_0x3cab0c[_0x3fae('0x31')],{'$or':_['map'](_0x489611,function(_0x5acbda){if(_0x5acbda['type']['key']!==_0x3fae('0x34')){var _0x92e5ca={};_0x92e5ca[_0x5acbda['field']]={'$like':'%'+_0x1e86e6[_0x3fae('0x27')]['filter']+'%'};return _0x92e5ca;}})});}_0x3cab0c=_['merge']({},_0x3cab0c,_0x1e86e6[_0x3fae('0x35')]);var _0x419e3d={'where':_0x3cab0c[_0x3fae('0x31')]};return db[_0x3fae('0x36')][_0x3fae('0x1a')](_0x419e3d)[_0x3fae('0x21')](function(_0x494b4c){_0x468010[_0x3fae('0x1a')]=_0x494b4c;if(_0x1e86e6[_0x3fae('0x27')][_0x3fae('0x37')]){_0x3cab0c[_0x3fae('0x38')]=[{'all':!![]}];}return db[_0x3fae('0x36')]['findAll'](_0x3cab0c);})['then'](function(_0x27d50a){_0x468010[_0x3fae('0x39')]=_0x27d50a;return _0x468010;})[_0x3fae('0x21')](respondWithFilteredResult(_0x2b89a2,_0x3cab0c))[_0x3fae('0x3a')](handleError(_0x2b89a2,null));};exports['show']=function(_0x457877,_0x48a1f5){var _0x2c4781={'raw':!![],'where':{'id':_0x457877['params']['id']}},_0x1a5c59={};_0x1a5c59[_0x3fae('0x26')]=_['keys'](db[_0x3fae('0x36')][_0x3fae('0x3b')]);_0x1a5c59[_0x3fae('0x27')]=_[_0x3fae('0x28')](_0x457877[_0x3fae('0x27')]);_0x1a5c59['filters']=_[_0x3fae('0x2a')](_0x1a5c59[_0x3fae('0x26')],_0x1a5c59[_0x3fae('0x27')]);_0x2c4781[_0x3fae('0x2b')]=_['intersection'](_0x1a5c59[_0x3fae('0x26')],qs[_0x3fae('0x2c')](_0x457877[_0x3fae('0x27')][_0x3fae('0x2c')]));_0x2c4781[_0x3fae('0x2b')]=_0x2c4781[_0x3fae('0x2b')]['length']?_0x2c4781[_0x3fae('0x2b')]:_0x1a5c59['model'];if(_0x457877[_0x3fae('0x27')]['includeAll']){_0x2c4781[_0x3fae('0x38')]=[{'all':!![]}];}_0x2c4781=_[_0x3fae('0x3c')]({},_0x2c4781,_0x457877[_0x3fae('0x35')]);return db[_0x3fae('0x36')][_0x3fae('0x3d')](_0x2c4781)['then'](handleEntityNotFound(_0x48a1f5,null))[_0x3fae('0x21')](respondWithResult(_0x48a1f5,null))['catch'](handleError(_0x48a1f5,null));};exports[_0x3fae('0x3e')]=function(_0xff76bc,_0x37d341){return db[_0x3fae('0x36')][_0x3fae('0x3e')](_0xff76bc[_0x3fae('0x3f')],{})[_0x3fae('0x21')](respondWithResult(_0x37d341,0xc9))[_0x3fae('0x3a')](handleError(_0x37d341,null));};exports[_0x3fae('0x20')]=function(_0x47e05a,_0x2e5c30){if(_0x47e05a[_0x3fae('0x3f')]['id']){delete _0x47e05a['body']['id'];}return db[_0x3fae('0x36')][_0x3fae('0x3d')]({'where':{'id':_0x47e05a[_0x3fae('0x40')]['id']}})[_0x3fae('0x21')](handleEntityNotFound(_0x2e5c30,null))[_0x3fae('0x21')](saveUpdates(_0x47e05a[_0x3fae('0x3f')],null))[_0x3fae('0x21')](respondWithResult(_0x2e5c30,null))[_0x3fae('0x3a')](handleError(_0x2e5c30,null));};exports[_0x3fae('0x41')]=function(_0x509607,_0x38cb6c){return db['SquareMessage'][_0x3fae('0x3d')]({'where':{'id':_0x509607[_0x3fae('0x40')]['id']}})[_0x3fae('0x21')](handleEntityNotFound(_0x38cb6c,null))[_0x3fae('0x21')](removeEntity(_0x38cb6c,null))[_0x3fae('0x3a')](handleError(_0x38cb6c,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index e114031..482800f 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 _0x339a=['request-promise','./squareMessage.attributes','exports','define','lodash','../../config/logger','moment','bluebird'];(function(_0x2b18e9,_0x18e52f){var _0x9d0c32=function(_0x3ba0ba){while(--_0x3ba0ba){_0x2b18e9['push'](_0x2b18e9['shift']());}};_0x9d0c32(++_0x18e52f);}(_0x339a,0x1dc));var _0xa339=function(_0x37eb2b,_0x21f3cc){_0x37eb2b=_0x37eb2b-0x0;var _0x10832a=_0x339a[_0x37eb2b];return _0x10832a;};'use strict';var _=require(_0xa339('0x0'));var util=require('util');var logger=require(_0xa339('0x1'))('api');var moment=require(_0xa339('0x2'));var BPromise=require(_0xa339('0x3'));var rp=require(_0xa339('0x4'));var attributes=require(_0xa339('0x5'));module[_0xa339('0x6')]=function(_0x120ce9,_0xc9bda9){return _0x120ce9[_0xa339('0x7')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c27=['exports','define','SquareMessage','../../config/logger','moment','bluebird'];(function(_0x38e9e4,_0x462835){var _0x2ae044=function(_0x168893){while(--_0x168893){_0x38e9e4['push'](_0x38e9e4['shift']());}};_0x2ae044(++_0x462835);}(_0x6c27,0xb1));var _0x76c2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6c27[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x76c2('0x0'))('api');var moment=require(_0x76c2('0x1'));var BPromise=require(_0x76c2('0x2'));var rp=require('request-promise');var attributes=require('./squareMessage.attributes');module[_0x76c2('0x3')]=function(_0x36afc0,_0x47b0bc){return _0x36afc0[_0x76c2('0x4')](_0x76c2('0x5'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 4609f57..4f84405 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 _0xf494=['then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x58eb93,_0x3b8263){var _0xc0d5c0=function(_0x339a73){while(--_0x339a73){_0x58eb93['push'](_0x58eb93['shift']());}};_0xc0d5c0(++_0x3b8263);}(_0xf494,0xa2));var _0x4f49=function(_0x148aed,_0x2b6d80){_0x148aed=_0x148aed-0x0;var _0x131799=_0xf494[_0x148aed];return _0x131799;};'use strict';var _=require(_0x4f49('0x0'));var util=require('util');var moment=require(_0x4f49('0x1'));var BPromise=require(_0x4f49('0x2'));var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var jayson=require(_0x4f49('0x8'));var client=jayson[_0x4f49('0x9')][_0x4f49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4abd11,_0x12d6b2,_0x2d6734){return new BPromise(function(_0x3876c7,_0x3e8b47){return client[_0x4f49('0xb')](_0x4abd11,_0x2d6734)[_0x4f49('0xc')](function(_0xbc6fab){logger[_0x4f49('0xd')](_0x4f49('0xe'),_0x12d6b2,'request\x20sent');logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x12d6b2,_0x4f49('0x11'),JSON[_0x4f49('0x12')](_0xbc6fab));if(_0xbc6fab['error']){if(_0xbc6fab[_0x4f49('0x13')][_0x4f49('0x14')]===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0xe'),_0x12d6b2,_0xbc6fab['error'][_0x4f49('0x15')]);return _0x3e8b47(_0xbc6fab[_0x4f49('0x13')]['message']);}logger[_0x4f49('0x13')](_0x4f49('0xe'),_0x12d6b2,_0xbc6fab['error'][_0x4f49('0x15')]);return _0x3876c7(_0xbc6fab[_0x4f49('0x13')][_0x4f49('0x15')]);}else{logger[_0x4f49('0xd')](_0x4f49('0xe'),_0x12d6b2,_0x4f49('0x11'));_0x3876c7(_0xbc6fab[_0x4f49('0x16')]['message']);}})[_0x4f49('0x17')](function(_0x148403){logger[_0x4f49('0x13')]('SquareMessage,\x20%s,\x20%s',_0x12d6b2,_0x148403);_0x3e8b47(_0x148403);});});}exports[_0x4f49('0x18')]=function(_0x1fd0ac){var _0x112764=this;return new Promise(function(_0x3d9ed1,_0x4256c0){return db['SquareMessage'][_0x4f49('0x19')](_0x1fd0ac[_0x4f49('0x1a')],{'raw':_0x1fd0ac['options']?_0x1fd0ac[_0x4f49('0x1b')][_0x4f49('0x1c')]===undefined?!![]:![]:!![]})[_0x4f49('0xc')](function(_0x173f85){logger[_0x4f49('0xd')](_0x4f49('0x18'),_0x1fd0ac);logger['debug'](_0x4f49('0x18'),_0x1fd0ac,JSON['stringify'](_0x173f85));_0x3d9ed1(_0x173f85);})[_0x4f49('0x17')](function(_0x37ad37){logger[_0x4f49('0x13')](_0x4f49('0x18'),_0x37ad37[_0x4f49('0x15')],_0x1fd0ac);_0x4256c0(_0x112764[_0x4f49('0x13')](0x1f4,_0x37ad37[_0x4f49('0x15')]));});});}; \ No newline at end of file +var _0x4a6f=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x4a6f,0x1ee));var _0xf4a6=function(_0x27d443,_0x4ee5ec){_0x27d443=_0x27d443-0x0;var _0x21b822=_0x4a6f[_0x27d443];return _0x21b822;};'use strict';var _=require(_0xf4a6('0x0'));var util=require('util');var moment=require(_0xf4a6('0x1'));var BPromise=require(_0xf4a6('0x2'));var rs=require(_0xf4a6('0x3'));var fs=require('fs');var Redis=require(_0xf4a6('0x4'));var db=require(_0xf4a6('0x5'))['db'];var utils=require(_0xf4a6('0x6'));var logger=require('../../config/logger')(_0xf4a6('0x7'));var config=require(_0xf4a6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf4a6('0x9')][_0xf4a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c6d7c,_0x566052,_0x3b7383){return new BPromise(function(_0x2b75d0,_0x235528){return client[_0xf4a6('0xb')](_0x5c6d7c,_0x3b7383)[_0xf4a6('0xc')](function(_0x4dbddf){logger['info'](_0xf4a6('0xd'),_0x566052,_0xf4a6('0xe'));logger[_0xf4a6('0xf')](_0xf4a6('0x10'),_0x566052,_0xf4a6('0xe'),JSON[_0xf4a6('0x11')](_0x4dbddf));if(_0x4dbddf[_0xf4a6('0x12')]){if(_0x4dbddf[_0xf4a6('0x12')][_0xf4a6('0x13')]===0x1f4){logger[_0xf4a6('0x12')](_0xf4a6('0xd'),_0x566052,_0x4dbddf[_0xf4a6('0x12')][_0xf4a6('0x14')]);return _0x235528(_0x4dbddf[_0xf4a6('0x12')][_0xf4a6('0x14')]);}logger[_0xf4a6('0x12')]('SquareMessage,\x20%s,\x20%s',_0x566052,_0x4dbddf[_0xf4a6('0x12')][_0xf4a6('0x14')]);return _0x2b75d0(_0x4dbddf['error'][_0xf4a6('0x14')]);}else{logger[_0xf4a6('0x15')](_0xf4a6('0xd'),_0x566052,_0xf4a6('0xe'));_0x2b75d0(_0x4dbddf[_0xf4a6('0x16')][_0xf4a6('0x14')]);}})[_0xf4a6('0x17')](function(_0x5b1d40){logger[_0xf4a6('0x12')]('SquareMessage,\x20%s,\x20%s',_0x566052,_0x5b1d40);_0x235528(_0x5b1d40);});});}exports[_0xf4a6('0x18')]=function(_0x49cc9a){var _0x5130c1=this;return new Promise(function(_0x4e9252,_0x2208a0){return db[_0xf4a6('0x19')][_0xf4a6('0x1a')](_0x49cc9a[_0xf4a6('0x1b')],{'raw':_0x49cc9a[_0xf4a6('0x1c')]?_0x49cc9a[_0xf4a6('0x1c')][_0xf4a6('0x1d')]===undefined?!![]:![]:!![]})[_0xf4a6('0xc')](function(_0x4a24e7){logger['info'](_0xf4a6('0x18'),_0x49cc9a);logger[_0xf4a6('0xf')]('CreateSquareMessage',_0x49cc9a,JSON['stringify'](_0x4a24e7));_0x4e9252(_0x4a24e7);})[_0xf4a6('0x17')](function(_0x40e6c0){logger[_0xf4a6('0x12')](_0xf4a6('0x18'),_0x40e6c0[_0xf4a6('0x14')],_0x49cc9a);_0x2208a0(_0x5130c1[_0xf4a6('0x12')](0x1f4,_0x40e6c0[_0xf4a6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e242e90..6b5bc36 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 _0x843b=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','delete','destroy','exports','multer'];(function(_0x46465c,_0x37ea15){var _0x33e39b=function(_0x6f7b7d){while(--_0x6f7b7d){_0x46465c['push'](_0x46465c['shift']());}};_0x33e39b(++_0x37ea15);}(_0x843b,0xc5));var _0xb843=function(_0x1baba2,_0x466183){_0x1baba2=_0x1baba2-0x0;var _0x2d63bb=_0x843b[_0x1baba2];return _0x2d63bb;};'use strict';var multer=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var path=require(_0xb843('0x2'));var timeout=require('connect-timeout');var express=require(_0xb843('0x3'));var router=express[_0xb843('0x4')]();var auth=require(_0xb843('0x5'));var interaction=require(_0xb843('0x6'));var config=require(_0xb843('0x7'));var controller=require(_0xb843('0x8'));router[_0xb843('0x9')]('/',auth[_0xb843('0xa')](),controller[_0xb843('0xb')]);router[_0xb843('0x9')](_0xb843('0xc'),auth[_0xb843('0xa')](),controller[_0xb843('0xd')]);router[_0xb843('0x9')](_0xb843('0xe'),auth[_0xb843('0xa')](),timeout('15s'),controller[_0xb843('0xf')]);router[_0xb843('0x10')]('/',auth[_0xb843('0xa')](),controller[_0xb843('0x11')]);router[_0xb843('0x12')](_0xb843('0xc'),auth[_0xb843('0xa')](),controller['update']);router[_0xb843('0x13')]('/:id',auth[_0xb843('0xa')](),controller[_0xb843('0x14')]);module[_0xb843('0x15')]=router; \ No newline at end of file +var _0xbde2=['../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','create','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x291d3d,_0x744ad5){var _0x36e564=function(_0x26916a){while(--_0x26916a){_0x291d3d['push'](_0x291d3d['shift']());}};_0x36e564(++_0x744ad5);}(_0xbde2,0x7a));var _0x2bde=function(_0x50c55f,_0x49c98e){_0x50c55f=_0x50c55f-0x0;var _0x25c3c0=_0xbde2[_0x50c55f];return _0x25c3c0;};'use strict';var multer=require('multer');var util=require(_0x2bde('0x0'));var path=require(_0x2bde('0x1'));var timeout=require(_0x2bde('0x2'));var express=require('express');var router=express[_0x2bde('0x3')]();var auth=require(_0x2bde('0x4'));var interaction=require(_0x2bde('0x5'));var config=require('../../config/environment');var controller=require(_0x2bde('0x6'));router[_0x2bde('0x7')]('/',auth[_0x2bde('0x8')](),controller[_0x2bde('0x9')]);router['get'](_0x2bde('0xa'),auth[_0x2bde('0x8')](),controller[_0x2bde('0xb')]);router[_0x2bde('0x7')](_0x2bde('0xc'),auth[_0x2bde('0x8')](),timeout('15s'),controller['test']);router['post']('/',auth[_0x2bde('0x8')](),controller[_0x2bde('0xd')]);router[_0x2bde('0xe')]('/:id',auth[_0x2bde('0x8')](),controller[_0x2bde('0xf')]);router[_0x2bde('0x10')](_0x2bde('0xa'),auth[_0x2bde('0x8')](),controller[_0x2bde('0x11')]);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 86b304a..ad7674c 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 _0x88ef=['sequelize','exports','name','STRING'];(function(_0x65f9a9,_0x476219){var _0x3afb57=function(_0x50cf82){while(--_0x50cf82){_0x65f9a9['push'](_0x65f9a9['shift']());}};_0x3afb57(++_0x476219);}(_0x88ef,0x16c));var _0xf88e=function(_0x3beb69,_0x1e12a3){_0x3beb69=_0x3beb69-0x0;var _0x3da21e=_0x88ef[_0x3beb69];return _0x3da21e;};'use strict';var Sequelize=require(_0xf88e('0x0'));module[_0xf88e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf88e('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf88e('0x3')]},'description':{'type':Sequelize[_0xf88e('0x3')]}}; \ No newline at end of file +var _0x8876=['exports','name','STRING','sequelize'];(function(_0x18172e,_0x512f30){var _0x48e63f=function(_0x4edd4d){while(--_0x4edd4d){_0x18172e['push'](_0x18172e['shift']());}};_0x48e63f(++_0x512f30);}(_0x8876,0xeb));var _0x6887=function(_0x4e4c3,_0x1b7e79){_0x4e4c3=_0x4e4c3-0x0;var _0x143426=_0x8876[_0x4e4c3];return _0x143426;};'use strict';var Sequelize=require(_0x6887('0x0'));module[_0x6887('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6887('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x6887('0x3')]},'description':{'type':Sequelize[_0x6887('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index eb5e290..3464179 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 _0x4830=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','sendStatus','error','name','send','index','SquareOdbc','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','autoAssociation','UserProfileResource','catch','update','test','dsn','odbc','openSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../config/license/hardware'];(function(_0x3df539,_0x319636){var _0x2e3f77=function(_0x5bb26f){while(--_0x5bb26f){_0x3df539['push'](_0x3df539['shift']());}};_0x2e3f77(++_0x319636);}(_0x4830,0x8d));var _0x0483=function(_0x2f52a0,_0xd5437c){_0x2f52a0=_0x2f52a0-0x0;var _0x10734c=_0x4830[_0x2f52a0];return _0x10734c;};'use strict';var pdf=require(_0x0483('0x0'));var emlformat=require(_0x0483('0x1'));var rimraf=require(_0x0483('0x2'));var zipdir=require(_0x0483('0x3'));var jsonpatch=require(_0x0483('0x4'));var rp=require(_0x0483('0x5'));var moment=require(_0x0483('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0483('0x7'));var sox=require(_0x0483('0x8'));var csv=require(_0x0483('0x9'));var ejs=require(_0x0483('0xa'));var fs=require('fs');var _=require(_0x0483('0xb'));var squel=require(_0x0483('0xc'));var crypto=require(_0x0483('0xd'));var jsforce=require(_0x0483('0xe'));var deskjs=require(_0x0483('0xf'));var toCsv=require(_0x0483('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x0483('0x10'));var Redis=require('ioredis');var qs=require(_0x0483('0x11'));var logger=require(_0x0483('0x12'))(_0x0483('0x13'));var utils=require(_0x0483('0x14'));var config=require(_0x0483('0x15'));var db=require(_0x0483('0x16'))['db'];function respondWithStatusCode(_0x2fc394,_0x405b3c){_0x405b3c=_0x405b3c||0xcc;return function(_0x3f28de){if(_0x3f28de){return _0x2fc394['sendStatus'](_0x405b3c);}return _0x2fc394[_0x0483('0x17')](_0x405b3c)['end']();};}function respondWithResult(_0x5477d1,_0xb92d62){_0xb92d62=_0xb92d62||0xc8;return function(_0x44af19){if(_0x44af19){return _0x5477d1[_0x0483('0x17')](_0xb92d62)[_0x0483('0x18')](_0x44af19);}};}function respondWithFilteredResult(_0x395cfd,_0x34dd9f){return function(_0x3b8e53){if(_0x3b8e53){var _0x354037=_0x3b8e53[_0x0483('0x19')],_0x3731a8=_0x34dd9f[_0x0483('0x1a')],_0x4f2125=_0x34dd9f[_0x0483('0x1a')]+_0x34dd9f[_0x0483('0x1b')],_0x4167e6;if(_0x4f2125>=_0x354037){_0x4f2125=_0x354037;_0x4167e6=0xc8;}else{_0x4167e6=0xce;}_0x395cfd['status'](_0x4167e6);return _0x395cfd[_0x0483('0x1c')](_0x0483('0x1d'),_0x3731a8+'-'+_0x4f2125+'/'+_0x354037)[_0x0483('0x18')](_0x3b8e53);}return null;};}function patchUpdates(_0xb4d5ca){return function(_0x2ef564){try{jsonpatch[_0x0483('0x1e')](_0x2ef564,_0xb4d5ca,!![]);}catch(_0x38e795){return BPromise[_0x0483('0x1f')](_0x38e795);}return _0x2ef564['save']();};}function saveUpdates(_0xbabc41,_0x255cb5){return function(_0x223800){if(_0x223800){return _0x223800['update'](_0xbabc41)[_0x0483('0x20')](function(_0x276e37){return _0x276e37;});}return null;};}function removeEntity(_0x4a0fcc,_0x69bd40){return function(_0x2b4ad9){if(_0x2b4ad9){return _0x2b4ad9[_0x0483('0x21')]()[_0x0483('0x20')](function(){var _0x4f2574=_0x2b4ad9[_0x0483('0x22')]({'plain':!![]});var _0x9cc288='ODBC';return db['UserProfileResource'][_0x0483('0x21')]({'where':{'type':_0x9cc288,'resourceId':_0x4f2574['id']}})['then'](function(){return _0x2b4ad9;});})['then'](function(){_0x4a0fcc[_0x0483('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x66b668,_0x47afe0){return function(_0x5a7fa7){if(!_0x5a7fa7){_0x66b668[_0x0483('0x23')](0x194);}return _0x5a7fa7;};}function handleError(_0x35acfa,_0x475555){_0x475555=_0x475555||0x1f4;return function(_0x4ef991){logger[_0x0483('0x24')](_0x4ef991['stack']);if(_0x4ef991[_0x0483('0x25')]){delete _0x4ef991[_0x0483('0x25')];}_0x35acfa[_0x0483('0x17')](_0x475555)[_0x0483('0x26')](_0x4ef991);};}exports[_0x0483('0x27')]=function(_0x5edc76,_0x4dd824){var _0x10e9e8={},_0x4efffc={},_0x1eb896={'count':0x0,'rows':[]};var _0x5e9711=db[_0x0483('0x28')][_0x0483('0x29')];_0x4efffc[_0x0483('0x2a')]=_[_0x0483('0x2b')](_0x5e9711);_0x4efffc[_0x0483('0x2c')]=_['keys'](_0x5edc76[_0x0483('0x2c')]);_0x4efffc[_0x0483('0x2d')]=_['intersection'](_0x4efffc[_0x0483('0x2a')],_0x4efffc['query']);_0x10e9e8['attributes']=_[_0x0483('0x2e')](_0x4efffc['model'],qs[_0x0483('0x2f')](_0x5edc76[_0x0483('0x2c')][_0x0483('0x2f')]));_0x10e9e8[_0x0483('0x30')]=_0x10e9e8[_0x0483('0x30')][_0x0483('0x31')]?_0x10e9e8[_0x0483('0x30')]:_0x4efffc['model'];if(!_0x5edc76[_0x0483('0x2c')][_0x0483('0x32')]('nolimit')){_0x10e9e8[_0x0483('0x1b')]=qs[_0x0483('0x1b')](_0x5edc76['query'][_0x0483('0x1b')]);_0x10e9e8['offset']=qs['offset'](_0x5edc76[_0x0483('0x2c')]['offset']);}_0x10e9e8[_0x0483('0x33')]=qs['sort'](_0x5edc76[_0x0483('0x2c')]['sort']);_0x10e9e8[_0x0483('0x34')]=qs['filters'](_['pick'](_0x5edc76[_0x0483('0x2c')],_0x4efffc[_0x0483('0x2d')]));if(_0x5edc76[_0x0483('0x2c')][_0x0483('0x35')]){_0x10e9e8[_0x0483('0x34')]=_[_0x0483('0x36')](_0x10e9e8[_0x0483('0x34')],{'$or':_['map'](_0x5e9711,function(_0x1ce078){if(_0x1ce078['type']['key']!==_0x0483('0x37')){var _0x21e915={};_0x21e915[_0x1ce078[_0x0483('0x38')]]={'$like':'%'+_0x5edc76[_0x0483('0x2c')]['filter']+'%'};return _0x21e915;}})});}_0x10e9e8=_['merge']({},_0x10e9e8,_0x5edc76[_0x0483('0x39')]);var _0x3a89d2={'where':_0x10e9e8[_0x0483('0x34')]};return db['SquareOdbc'][_0x0483('0x19')](_0x3a89d2)[_0x0483('0x20')](function(_0x8c3281){_0x1eb896[_0x0483('0x19')]=_0x8c3281;if(_0x5edc76[_0x0483('0x2c')]['includeAll']){_0x10e9e8[_0x0483('0x3a')]=[{'all':!![]}];}return db[_0x0483('0x28')][_0x0483('0x3b')](_0x10e9e8);})[_0x0483('0x20')](function(_0xb5f77b){_0x1eb896['rows']=_0xb5f77b;return _0x1eb896;})[_0x0483('0x20')](respondWithFilteredResult(_0x4dd824,_0x10e9e8))['catch'](handleError(_0x4dd824,null));};exports[_0x0483('0x3c')]=function(_0x5b31d6,_0x5229be){var _0x3fe88e={'raw':!![],'where':{'id':_0x5b31d6[_0x0483('0x3d')]['id']}},_0x11b7c6={};_0x11b7c6['model']=_[_0x0483('0x2b')](db['SquareOdbc'][_0x0483('0x29')]);_0x11b7c6['query']=_[_0x0483('0x2b')](_0x5b31d6['query']);_0x11b7c6[_0x0483('0x2d')]=_['intersection'](_0x11b7c6['model'],_0x11b7c6[_0x0483('0x2c')]);_0x3fe88e[_0x0483('0x30')]=_[_0x0483('0x2e')](_0x11b7c6[_0x0483('0x2a')],qs['fields'](_0x5b31d6[_0x0483('0x2c')][_0x0483('0x2f')]));_0x3fe88e[_0x0483('0x30')]=_0x3fe88e['attributes'][_0x0483('0x31')]?_0x3fe88e[_0x0483('0x30')]:_0x11b7c6[_0x0483('0x2a')];if(_0x5b31d6['query'][_0x0483('0x3e')]){_0x3fe88e[_0x0483('0x3a')]=[{'all':!![]}];}_0x3fe88e=_[_0x0483('0x36')]({},_0x3fe88e,_0x5b31d6[_0x0483('0x39')]);return db[_0x0483('0x28')][_0x0483('0x3f')](_0x3fe88e)['then'](handleEntityNotFound(_0x5229be,null))[_0x0483('0x20')](respondWithResult(_0x5229be,null))['catch'](handleError(_0x5229be,null));};exports[_0x0483('0x40')]=function(_0x9e645e,_0x4b8082){return db[_0x0483('0x28')][_0x0483('0x40')](_0x9e645e[_0x0483('0x41')],{})[_0x0483('0x20')](function(_0x21962f){var _0x4682e9=_0x9e645e[_0x0483('0x42')][_0x0483('0x22')]({'plain':!![]});if(!_0x4682e9)throw new Error(_0x0483('0x43'));if(_0x4682e9[_0x0483('0x44')]===_0x0483('0x42')){var _0x274bd5=_0x21962f[_0x0483('0x22')]({'plain':!![]});var _0x248789=_0x0483('0x45');return db[_0x0483('0x46')][_0x0483('0x3f')]({'where':{'name':_0x248789,'userProfileId':_0x4682e9['userProfileId']},'raw':!![]})[_0x0483('0x20')](function(_0x397735){if(_0x397735&&_0x397735[_0x0483('0x47')]===0x0){return db[_0x0483('0x48')][_0x0483('0x40')]({'name':_0x274bd5[_0x0483('0x25')],'resourceId':_0x274bd5['id'],'type':_0x397735[_0x0483('0x25')],'sectionId':_0x397735['id']},{})[_0x0483('0x20')](function(){return _0x21962f;});}else{return _0x21962f;}})[_0x0483('0x49')](function(_0x2658f8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2658f8);throw _0x2658f8;});}return _0x21962f;})['then'](respondWithResult(_0x4b8082,0xc9))['catch'](handleError(_0x4b8082,null));};exports[_0x0483('0x4a')]=function(_0x198966,_0x1cf20c){if(_0x198966[_0x0483('0x41')]['id']){delete _0x198966[_0x0483('0x41')]['id'];}return db[_0x0483('0x28')][_0x0483('0x3f')]({'where':{'id':_0x198966[_0x0483('0x3d')]['id']}})[_0x0483('0x20')](handleEntityNotFound(_0x1cf20c,null))[_0x0483('0x20')](saveUpdates(_0x198966['body'],null))[_0x0483('0x20')](respondWithResult(_0x1cf20c,null))[_0x0483('0x49')](handleError(_0x1cf20c,null));};exports[_0x0483('0x21')]=function(_0x115968,_0x11f08f){return db[_0x0483('0x28')][_0x0483('0x3f')]({'where':{'id':_0x115968[_0x0483('0x3d')]['id']}})[_0x0483('0x20')](handleEntityNotFound(_0x11f08f,null))[_0x0483('0x20')](removeEntity(_0x11f08f,null))[_0x0483('0x49')](handleError(_0x11f08f,null));};exports[_0x0483('0x4b')]=function(_0x154b09,_0x59e6fe,_0x463c6e){var _0x2c2c9a;return db[_0x0483('0x28')][_0x0483('0x3f')]({'where':{'id':_0x154b09[_0x0483('0x3d')]['id']},'attributes':['id',_0x0483('0x4c')]})[_0x0483('0x20')](handleEntityNotFound(_0x59e6fe,null))[_0x0483('0x20')](function(_0x1cfd3f){if(_0x1cfd3f){var _0x2661bd=require(_0x0483('0x4d'))();_0x2661bd[_0x0483('0x4e')](_0x1cfd3f[_0x0483('0x4c')]);_0x2661bd['closeSync']();return _0x1cfd3f;}})[_0x0483('0x20')](respondWithResult(_0x59e6fe,null))[_0x0483('0x49')](handleError(_0x59e6fe,null));}; \ No newline at end of file +var _0x03ab=['query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','sort','where','filters','filter','merge','key','VIRTUAL','count','includeAll','findAll','rows','params','SquareOdbc','include','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','find','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','save','then','ODBC','UserProfileResource','error','stack','name','send','index','rawAttributes'];(function(_0x5e0d5b,_0x49b219){var _0x4bb613=function(_0xa5a771){while(--_0xa5a771){_0x5e0d5b['push'](_0x5e0d5b['shift']());}};_0x4bb613(++_0x49b219);}(_0x03ab,0x1d3));var _0xb03a=function(_0x16a793,_0x131a8d){_0x16a793=_0x16a793-0x0;var _0x3f3102=_0x03ab[_0x16a793];return _0x3f3102;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb03a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb03a('0x1'));var jsonpatch=require(_0xb03a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb03a('0x3'));var Mustache=require(_0xb03a('0x4'));var util=require(_0xb03a('0x5'));var path=require(_0xb03a('0x6'));var sox=require(_0xb03a('0x7'));var csv=require(_0xb03a('0x8'));var ejs=require(_0xb03a('0x9'));var fs=require('fs');var _=require(_0xb03a('0xa'));var squel=require(_0xb03a('0xb'));var crypto=require(_0xb03a('0xc'));var jsforce=require(_0xb03a('0xd'));var deskjs=require(_0xb03a('0xe'));var toCsv=require(_0xb03a('0x8'));var querystring=require(_0xb03a('0xf'));var Papa=require(_0xb03a('0x10'));var authService=require(_0xb03a('0x11'));var hardwareService=require(_0xb03a('0x12'));var Redis=require(_0xb03a('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0xb03a('0x14'))(_0xb03a('0x15'));var utils=require('../../config/utils');var config=require(_0xb03a('0x16'));var db=require(_0xb03a('0x17'))['db'];function respondWithStatusCode(_0x97de2c,_0x511963){_0x511963=_0x511963||0xcc;return function(_0x22d550){if(_0x22d550){return _0x97de2c[_0xb03a('0x18')](_0x511963);}return _0x97de2c[_0xb03a('0x19')](_0x511963)[_0xb03a('0x1a')]();};}function respondWithResult(_0x44c1bd,_0x24e74c){_0x24e74c=_0x24e74c||0xc8;return function(_0x47c296){if(_0x47c296){return _0x44c1bd[_0xb03a('0x19')](_0x24e74c)['json'](_0x47c296);}};}function respondWithFilteredResult(_0x4fc9bf,_0x7ca1f5){return function(_0x13c8ed){if(_0x13c8ed){var _0x5cd47f=_0x13c8ed['count'],_0x1d9fa7=_0x7ca1f5['offset'],_0x4ba3b5=_0x7ca1f5['offset']+_0x7ca1f5[_0xb03a('0x1b')],_0x264325;if(_0x4ba3b5>=_0x5cd47f){_0x4ba3b5=_0x5cd47f;_0x264325=0xc8;}else{_0x264325=0xce;}_0x4fc9bf['status'](_0x264325);return _0x4fc9bf[_0xb03a('0x1c')](_0xb03a('0x1d'),_0x1d9fa7+'-'+_0x4ba3b5+'/'+_0x5cd47f)[_0xb03a('0x1e')](_0x13c8ed);}return null;};}function patchUpdates(_0x4df32f){return function(_0x1dfba9){try{jsonpatch[_0xb03a('0x1f')](_0x1dfba9,_0x4df32f,!![]);}catch(_0x3ae892){return BPromise[_0xb03a('0x20')](_0x3ae892);}return _0x1dfba9[_0xb03a('0x21')]();};}function saveUpdates(_0x54baaf,_0x57f061){return function(_0x4d89f7){if(_0x4d89f7){return _0x4d89f7['update'](_0x54baaf)[_0xb03a('0x22')](function(_0x10e6df){return _0x10e6df;});}return null;};}function removeEntity(_0x802676,_0x38c4d8){return function(_0x12d714){if(_0x12d714){return _0x12d714['destroy']()[_0xb03a('0x22')](function(){var _0x6719db=_0x12d714['get']({'plain':!![]});var _0x519348=_0xb03a('0x23');return db[_0xb03a('0x24')]['destroy']({'where':{'type':_0x519348,'resourceId':_0x6719db['id']}})[_0xb03a('0x22')](function(){return _0x12d714;});})[_0xb03a('0x22')](function(){_0x802676[_0xb03a('0x19')](0xcc)[_0xb03a('0x1a')]();});}};}function handleEntityNotFound(_0x4212ec,_0x1fda08){return function(_0x32dcf3){if(!_0x32dcf3){_0x4212ec[_0xb03a('0x18')](0x194);}return _0x32dcf3;};}function handleError(_0x380c9c,_0x540b25){_0x540b25=_0x540b25||0x1f4;return function(_0x1521b2){logger[_0xb03a('0x25')](_0x1521b2[_0xb03a('0x26')]);if(_0x1521b2[_0xb03a('0x27')]){delete _0x1521b2[_0xb03a('0x27')];}_0x380c9c[_0xb03a('0x19')](_0x540b25)[_0xb03a('0x28')](_0x1521b2);};}exports[_0xb03a('0x29')]=function(_0x4ebcba,_0x48c7e7){var _0x3c9d5d={},_0x5b81df={},_0x2ffce0={'count':0x0,'rows':[]};var _0x44cedd=db['SquareOdbc'][_0xb03a('0x2a')];_0x5b81df['model']=_['keys'](_0x44cedd);_0x5b81df[_0xb03a('0x2b')]=_['keys'](_0x4ebcba['query']);_0x5b81df['filters']=_[_0xb03a('0x2c')](_0x5b81df['model'],_0x5b81df[_0xb03a('0x2b')]);_0x3c9d5d[_0xb03a('0x2d')]=_[_0xb03a('0x2c')](_0x5b81df[_0xb03a('0x2e')],qs[_0xb03a('0x2f')](_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x2f')]));_0x3c9d5d[_0xb03a('0x2d')]=_0x3c9d5d[_0xb03a('0x2d')][_0xb03a('0x30')]?_0x3c9d5d[_0xb03a('0x2d')]:_0x5b81df[_0xb03a('0x2e')];if(!_0x4ebcba['query'][_0xb03a('0x31')](_0xb03a('0x32'))){_0x3c9d5d[_0xb03a('0x1b')]=qs[_0xb03a('0x1b')](_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x1b')]);_0x3c9d5d[_0xb03a('0x33')]=qs['offset'](_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x33')]);}_0x3c9d5d['order']=qs[_0xb03a('0x34')](_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x34')]);_0x3c9d5d[_0xb03a('0x35')]=qs['filters'](_['pick'](_0x4ebcba[_0xb03a('0x2b')],_0x5b81df[_0xb03a('0x36')]));if(_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x37')]){_0x3c9d5d[_0xb03a('0x35')]=_[_0xb03a('0x38')](_0x3c9d5d[_0xb03a('0x35')],{'$or':_['map'](_0x44cedd,function(_0x5d1716){if(_0x5d1716['type'][_0xb03a('0x39')]!==_0xb03a('0x3a')){var _0x58f0c9={};_0x58f0c9[_0x5d1716['field']]={'$like':'%'+_0x4ebcba['query'][_0xb03a('0x37')]+'%'};return _0x58f0c9;}})});}_0x3c9d5d=_[_0xb03a('0x38')]({},_0x3c9d5d,_0x4ebcba['options']);var _0xc560da={'where':_0x3c9d5d[_0xb03a('0x35')]};return db['SquareOdbc'][_0xb03a('0x3b')](_0xc560da)[_0xb03a('0x22')](function(_0x5b4886){_0x2ffce0[_0xb03a('0x3b')]=_0x5b4886;if(_0x4ebcba[_0xb03a('0x2b')][_0xb03a('0x3c')]){_0x3c9d5d['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xb03a('0x3d')](_0x3c9d5d);})[_0xb03a('0x22')](function(_0xf797dd){_0x2ffce0[_0xb03a('0x3e')]=_0xf797dd;return _0x2ffce0;})[_0xb03a('0x22')](respondWithFilteredResult(_0x48c7e7,_0x3c9d5d))['catch'](handleError(_0x48c7e7,null));};exports['show']=function(_0x91df43,_0xecd7da){var _0x3736ea={'raw':!![],'where':{'id':_0x91df43[_0xb03a('0x3f')]['id']}},_0x1f940c={};_0x1f940c[_0xb03a('0x2e')]=_['keys'](db[_0xb03a('0x40')][_0xb03a('0x2a')]);_0x1f940c[_0xb03a('0x2b')]=_['keys'](_0x91df43['query']);_0x1f940c[_0xb03a('0x36')]=_['intersection'](_0x1f940c['model'],_0x1f940c[_0xb03a('0x2b')]);_0x3736ea[_0xb03a('0x2d')]=_['intersection'](_0x1f940c['model'],qs[_0xb03a('0x2f')](_0x91df43[_0xb03a('0x2b')][_0xb03a('0x2f')]));_0x3736ea[_0xb03a('0x2d')]=_0x3736ea[_0xb03a('0x2d')][_0xb03a('0x30')]?_0x3736ea[_0xb03a('0x2d')]:_0x1f940c['model'];if(_0x91df43[_0xb03a('0x2b')]['includeAll']){_0x3736ea[_0xb03a('0x41')]=[{'all':!![]}];}_0x3736ea=_['merge']({},_0x3736ea,_0x91df43[_0xb03a('0x42')]);return db['SquareOdbc']['find'](_0x3736ea)[_0xb03a('0x22')](handleEntityNotFound(_0xecd7da,null))['then'](respondWithResult(_0xecd7da,null))[_0xb03a('0x43')](handleError(_0xecd7da,null));};exports[_0xb03a('0x44')]=function(_0x38c037,_0x173dc6){return db[_0xb03a('0x40')][_0xb03a('0x44')](_0x38c037[_0xb03a('0x45')],{})['then'](function(_0x31280a){var _0x548f72=_0x38c037[_0xb03a('0x46')][_0xb03a('0x47')]({'plain':!![]});if(!_0x548f72)throw new Error(_0xb03a('0x48'));if(_0x548f72[_0xb03a('0x49')]===_0xb03a('0x46')){var _0x380e3d=_0x31280a[_0xb03a('0x47')]({'plain':!![]});var _0x5cbf8e=_0xb03a('0x23');return db[_0xb03a('0x4a')]['find']({'where':{'name':_0x5cbf8e,'userProfileId':_0x548f72[_0xb03a('0x4b')]},'raw':!![]})['then'](function(_0x1808d4){if(_0x1808d4&&_0x1808d4[_0xb03a('0x4c')]===0x0){return db[_0xb03a('0x24')][_0xb03a('0x44')]({'name':_0x380e3d['name'],'resourceId':_0x380e3d['id'],'type':_0x1808d4[_0xb03a('0x27')],'sectionId':_0x1808d4['id']},{})[_0xb03a('0x22')](function(){return _0x31280a;});}else{return _0x31280a;}})[_0xb03a('0x43')](function(_0x5cce8c){logger[_0xb03a('0x25')](_0xb03a('0x4d'),_0x5cce8c);throw _0x5cce8c;});}return _0x31280a;})[_0xb03a('0x22')](respondWithResult(_0x173dc6,0xc9))['catch'](handleError(_0x173dc6,null));};exports['update']=function(_0x4256ed,_0x3e7930){if(_0x4256ed[_0xb03a('0x45')]['id']){delete _0x4256ed[_0xb03a('0x45')]['id'];}return db[_0xb03a('0x40')]['find']({'where':{'id':_0x4256ed[_0xb03a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3e7930,null))[_0xb03a('0x22')](saveUpdates(_0x4256ed[_0xb03a('0x45')],null))[_0xb03a('0x22')](respondWithResult(_0x3e7930,null))[_0xb03a('0x43')](handleError(_0x3e7930,null));};exports[_0xb03a('0x4e')]=function(_0x48f459,_0x7e268f){return db[_0xb03a('0x40')][_0xb03a('0x4f')]({'where':{'id':_0x48f459[_0xb03a('0x3f')]['id']}})[_0xb03a('0x22')](handleEntityNotFound(_0x7e268f,null))[_0xb03a('0x22')](removeEntity(_0x7e268f,null))[_0xb03a('0x43')](handleError(_0x7e268f,null));};exports[_0xb03a('0x50')]=function(_0x50d672,_0x46772c,_0x2604b7){var _0x43d829;return db[_0xb03a('0x40')][_0xb03a('0x4f')]({'where':{'id':_0x50d672[_0xb03a('0x3f')]['id']},'attributes':['id',_0xb03a('0x51')]})[_0xb03a('0x22')](handleEntityNotFound(_0x46772c,null))[_0xb03a('0x22')](function(_0x1beb15){if(_0x1beb15){var _0x2e8c19=require(_0xb03a('0x52'))();_0x2e8c19[_0xb03a('0x53')](_0x1beb15[_0xb03a('0x51')]);_0x2e8c19[_0xb03a('0x54')]();return _0x1beb15;}})[_0xb03a('0x22')](respondWithResult(_0x46772c,null))[_0xb03a('0x43')](handleError(_0x46772c,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index ddf250c..9e6e987 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 _0x3c81=['util','api','moment','define','SquareOdbc','square_odbc','lodash'];(function(_0x439b57,_0x4a6729){var _0x1e96c6=function(_0x511ac7){while(--_0x511ac7){_0x439b57['push'](_0x439b57['shift']());}};_0x1e96c6(++_0x4a6729);}(_0x3c81,0x102));var _0x13c8=function(_0x437e9d,_0x10e30d){_0x437e9d=_0x437e9d-0x0;var _0x3b3b31=_0x3c81[_0x437e9d];return _0x3b3b31;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x101d4f,_0x3ec886){return _0x101d4f[_0x13c8('0x4')](_0x13c8('0x5'),attributes,{'tableName':_0x13c8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb688=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','square_odbc'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xb688,0xcf));var _0x8b68=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xb688[_0x10c51f];return _0x56a0cd;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var attributes=require('./squareOdbc.attributes');module[_0x8b68('0x6')]=function(_0x27925d,_0x30f33d){return _0x27925d[_0x8b68('0x7')]('SquareOdbc',attributes,{'tableName':_0x8b68('0x8'),'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 2c337a0..33d6445 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 _0x6035=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x6035,0x11c));var _0x5603=function(_0x27815d,_0x10ac7d){_0x27815d=_0x27815d-0x0;var _0x4d4f59=_0x6035[_0x27815d];return _0x4d4f59;};'use strict';var _=require(_0x5603('0x0'));var util=require(_0x5603('0x1'));var moment=require(_0x5603('0x2'));var BPromise=require(_0x5603('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5603('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5603('0x5'));var jayson=require(_0x5603('0x6'));var client=jayson[_0x5603('0x7')][_0x5603('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b850b,_0x220e6d,_0x1bcc74){return new BPromise(function(_0x1eb7f1,_0x3ae059){return client[_0x5603('0x9')](_0x4b850b,_0x1bcc74)[_0x5603('0xa')](function(_0xe7c4da){logger[_0x5603('0xb')](_0x5603('0xc'),_0x220e6d,'request\x20sent');logger[_0x5603('0xd')](_0x5603('0xe'),_0x220e6d,'request\x20sent',JSON['stringify'](_0xe7c4da));if(_0xe7c4da[_0x5603('0xf')]){if(_0xe7c4da[_0x5603('0xf')][_0x5603('0x10')]===0x1f4){logger['error'](_0x5603('0xc'),_0x220e6d,_0xe7c4da['error']['message']);return _0x3ae059(_0xe7c4da[_0x5603('0xf')]['message']);}logger[_0x5603('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x220e6d,_0xe7c4da[_0x5603('0xf')][_0x5603('0x11')]);return _0x1eb7f1(_0xe7c4da[_0x5603('0xf')][_0x5603('0x11')]);}else{logger[_0x5603('0xb')](_0x5603('0xc'),_0x220e6d,_0x5603('0x12'));_0x1eb7f1(_0xe7c4da[_0x5603('0x13')][_0x5603('0x11')]);}})[_0x5603('0x14')](function(_0x18eed6){logger[_0x5603('0xf')](_0x5603('0xc'),_0x220e6d,_0x18eed6);_0x3ae059(_0x18eed6);});});}exports[_0x5603('0x15')]=function(_0x227eb3){var _0x3cb79e=this;return new Promise(function(_0x3fec4b,_0x2d0073){return db[_0x5603('0x16')][_0x5603('0x17')]({'raw':_0x227eb3[_0x5603('0x18')]?_0x227eb3[_0x5603('0x18')][_0x5603('0x19')]===undefined?!![]:![]:!![],'where':_0x227eb3[_0x5603('0x18')]?_0x227eb3['options'][_0x5603('0x1a')]||null:null,'attributes':_0x227eb3[_0x5603('0x18')]?_0x227eb3[_0x5603('0x18')][_0x5603('0x1b')]||null:null,'include':_0x227eb3['options']?_0x227eb3[_0x5603('0x18')][_0x5603('0x1c')]?_[_0x5603('0x1d')](_0x227eb3[_0x5603('0x18')]['include'],function(_0x47ba93){return{'model':db[_0x47ba93['model']],'as':_0x47ba93['as'],'attributes':_0x47ba93[_0x5603('0x1b')],'include':_0x47ba93['include']?_[_0x5603('0x1d')](_0x47ba93[_0x5603('0x1c')],function(_0x1105c6){return{'model':db[_0x1105c6[_0x5603('0x1e')]],'as':_0x1105c6['as'],'attributes':_0x1105c6[_0x5603('0x1b')],'include':_0x1105c6[_0x5603('0x1c')]?_['map'](_0x1105c6['include'],function(_0x2f17e6){return{'model':db[_0x2f17e6[_0x5603('0x1e')]],'as':_0x2f17e6['as'],'attributes':_0x2f17e6[_0x5603('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5603('0xa')](function(_0x4cdbf0){logger[_0x5603('0xb')](_0x5603('0x15'),_0x227eb3);logger['debug'](_0x5603('0x15'),_0x227eb3,JSON[_0x5603('0x1f')](_0x4cdbf0));_0x3fec4b(_0x4cdbf0);})[_0x5603('0x14')](function(_0x28a970){logger[_0x5603('0xf')](_0x5603('0x15'),_0x28a970[_0x5603('0x11')],_0x227eb3);_0x2d0073(_0x3cb79e[_0x5603('0xf')](0x1f4,_0x28a970[_0x5603('0x11')]));});});}; \ No newline at end of file +var _0x6e9e=['raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSquareOdbc','find','options'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0x6e9e,0x64));var _0xe6e9=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x6e9e[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0xe6e9('0x0'));var util=require('util');var moment=require(_0xe6e9('0x1'));var BPromise=require(_0xe6e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6e9('0x3'))['db'];var utils=require(_0xe6e9('0x4'));var logger=require(_0xe6e9('0x5'))(_0xe6e9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe6e9('0x7'));var client=jayson[_0xe6e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c17a0,_0x5c56e4,_0x5cc5ec){return new BPromise(function(_0x414f5c,_0x324527){return client[_0xe6e9('0x9')](_0x2c17a0,_0x5cc5ec)[_0xe6e9('0xa')](function(_0x22bacd){logger['info'](_0xe6e9('0xb'),_0x5c56e4,_0xe6e9('0xc'));logger[_0xe6e9('0xd')](_0xe6e9('0xe'),_0x5c56e4,'request\x20sent',JSON[_0xe6e9('0xf')](_0x22bacd));if(_0x22bacd[_0xe6e9('0x10')]){if(_0x22bacd[_0xe6e9('0x10')][_0xe6e9('0x11')]===0x1f4){logger[_0xe6e9('0x10')](_0xe6e9('0xb'),_0x5c56e4,_0x22bacd[_0xe6e9('0x10')]['message']);return _0x324527(_0x22bacd[_0xe6e9('0x10')][_0xe6e9('0x12')]);}logger[_0xe6e9('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x5c56e4,_0x22bacd[_0xe6e9('0x10')][_0xe6e9('0x12')]);return _0x414f5c(_0x22bacd[_0xe6e9('0x10')][_0xe6e9('0x12')]);}else{logger[_0xe6e9('0x13')](_0xe6e9('0xb'),_0x5c56e4,_0xe6e9('0xc'));_0x414f5c(_0x22bacd[_0xe6e9('0x14')]['message']);}})['catch'](function(_0x1d0b06){logger[_0xe6e9('0x10')](_0xe6e9('0xb'),_0x5c56e4,_0x1d0b06);_0x324527(_0x1d0b06);});});}exports[_0xe6e9('0x15')]=function(_0x20f3db){var _0x47d54b=this;return new Promise(function(_0x4229dd,_0x8c5de){return db['SquareOdbc'][_0xe6e9('0x16')]({'raw':_0x20f3db['options']?_0x20f3db[_0xe6e9('0x17')][_0xe6e9('0x18')]===undefined?!![]:![]:!![],'where':_0x20f3db[_0xe6e9('0x17')]?_0x20f3db[_0xe6e9('0x17')][_0xe6e9('0x19')]||null:null,'attributes':_0x20f3db[_0xe6e9('0x17')]?_0x20f3db[_0xe6e9('0x17')][_0xe6e9('0x1a')]||null:null,'include':_0x20f3db[_0xe6e9('0x17')]?_0x20f3db['options'][_0xe6e9('0x1b')]?_[_0xe6e9('0x1c')](_0x20f3db[_0xe6e9('0x17')][_0xe6e9('0x1b')],function(_0x2680ba){return{'model':db[_0x2680ba['model']],'as':_0x2680ba['as'],'attributes':_0x2680ba[_0xe6e9('0x1a')],'include':_0x2680ba[_0xe6e9('0x1b')]?_[_0xe6e9('0x1c')](_0x2680ba['include'],function(_0x251143){return{'model':db[_0x251143[_0xe6e9('0x1d')]],'as':_0x251143['as'],'attributes':_0x251143[_0xe6e9('0x1a')],'include':_0x251143['include']?_[_0xe6e9('0x1c')](_0x251143['include'],function(_0x34f111){return{'model':db[_0x34f111[_0xe6e9('0x1d')]],'as':_0x34f111['as'],'attributes':_0x34f111[_0xe6e9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe6e9('0xa')](function(_0xbae16a){logger['info']('ShowSquareOdbc',_0x20f3db);logger[_0xe6e9('0xd')]('ShowSquareOdbc',_0x20f3db,JSON[_0xe6e9('0xf')](_0xbae16a));_0x4229dd(_0xbae16a);})[_0xe6e9('0x1e')](function(_0x1e4577){logger[_0xe6e9('0x10')](_0xe6e9('0x15'),_0x1e4577[_0xe6e9('0x12')],_0x20f3db);_0x8c5de(_0x47d54b[_0xe6e9('0x10')](0x1f4,_0x1e4577[_0xe6e9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3fe9e6f..5bb1b8d 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 _0xc1a3=['/:id','show','getUsers','post','/:id/users','addUsers','put','update','delete','removeUsers','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc1a3,0x1eb));var _0x3c1a=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xc1a3[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require(_0x3c1a('0x0'));var util=require('util');var path=require(_0x3c1a('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c1a('0x2'));var router=express[_0x3c1a('0x3')]();var auth=require(_0x3c1a('0x4'));var interaction=require(_0x3c1a('0x5'));var config=require(_0x3c1a('0x6'));var controller=require('./squareProject.controller');router[_0x3c1a('0x7')]('/',auth[_0x3c1a('0x8')](),controller['index']);router['get'](_0x3c1a('0x9'),auth[_0x3c1a('0x8')](),controller[_0x3c1a('0xa')]);router[_0x3c1a('0x7')]('/:id/users',auth[_0x3c1a('0x8')](),controller[_0x3c1a('0xb')]);router[_0x3c1a('0xc')]('/',auth[_0x3c1a('0x8')](),controller['create']);router[_0x3c1a('0xc')](_0x3c1a('0xd'),auth[_0x3c1a('0x8')](),controller[_0x3c1a('0xe')]);router[_0x3c1a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3c1a('0x10')]);router[_0x3c1a('0x11')](_0x3c1a('0x9'),auth[_0x3c1a('0x8')](),controller['destroy']);router[_0x3c1a('0x11')](_0x3c1a('0xd'),auth['isAuthenticated'](),controller[_0x3c1a('0x12')]);module[_0x3c1a('0x13')]=router; \ No newline at end of file +var _0x8897=['../../components/interaction/service','get','index','/:id','isAuthenticated','show','getUsers','post','create','/:id/users','put','update','delete','destroy','removeUsers','exports','multer','util','express','../../components/auth/service'];(function(_0x257da6,_0x5a37da){var _0x578e44=function(_0x58a33a){while(--_0x58a33a){_0x257da6['push'](_0x257da6['shift']());}};_0x578e44(++_0x5a37da);}(_0x8897,0x128));var _0x7889=function(_0x3e29cd,_0x28110e){_0x3e29cd=_0x3e29cd-0x0;var _0x386c2f=_0x8897[_0x3e29cd];return _0x386c2f;};'use strict';var multer=require(_0x7889('0x0'));var util=require(_0x7889('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7889('0x2'));var router=express['Router']();var auth=require(_0x7889('0x3'));var interaction=require(_0x7889('0x4'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x7889('0x5')]('/',auth['isAuthenticated'](),controller[_0x7889('0x6')]);router[_0x7889('0x5')](_0x7889('0x7'),auth[_0x7889('0x8')](),controller[_0x7889('0x9')]);router[_0x7889('0x5')]('/:id/users',auth[_0x7889('0x8')](),controller[_0x7889('0xa')]);router[_0x7889('0xb')]('/',auth['isAuthenticated'](),controller[_0x7889('0xc')]);router['post'](_0x7889('0xd'),auth[_0x7889('0x8')](),controller['addUsers']);router[_0x7889('0xe')](_0x7889('0x7'),auth[_0x7889('0x8')](),controller[_0x7889('0xf')]);router[_0x7889('0x10')](_0x7889('0x7'),auth[_0x7889('0x8')](),controller[_0x7889('0x11')]);router['delete'](_0x7889('0xd'),auth[_0x7889('0x8')](),controller[_0x7889('0x12')]);module[_0x7889('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 843e730..0f80b31 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 _0xc962=['STRING','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString','sequelize'];(function(_0x1d5ae,_0x1c758f){var _0x488aea=function(_0x2ae243){while(--_0x2ae243){_0x1d5ae['push'](_0x1d5ae['shift']());}};_0x488aea(++_0x1c758f);}(_0xc962,0x6d));var _0x2c96=function(_0x14afe0,_0x46ffc8){_0x14afe0=_0x14afe0-0x0;var _0x1d8c59=_0xc962[_0x14afe0];return _0x1d8c59;};'use strict';var Sequelize=require(_0x2c96('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2c96('0x1')]},'notes':{'type':Sequelize[_0x2c96('0x2')]},'preproduction':{'type':Sequelize[_0x2c96('0x3')](_0x2c96('0x4')),'get':function(){if(this[_0x2c96('0x5')](_0x2c96('0x6'))){return this[_0x2c96('0x5')](_0x2c96('0x6'))['toString'](_0x2c96('0x7'));}}},'production':{'type':Sequelize[_0x2c96('0x3')](_0x2c96('0x4')),'get':function(){if(this[_0x2c96('0x5')](_0x2c96('0x8'))){return this[_0x2c96('0x5')](_0x2c96('0x8'))[_0x2c96('0x9')](_0x2c96('0x7'));}}}}; \ No newline at end of file +var _0x6455=['TEXT','BLOB','long','preproduction','getDataValue','toString','utf8','production','sequelize','STRING','name'];(function(_0x44ce3d,_0x2e5dce){var _0x2c2a01=function(_0x2f2298){while(--_0x2f2298){_0x44ce3d['push'](_0x44ce3d['shift']());}};_0x2c2a01(++_0x2e5dce);}(_0x6455,0x97));var _0x5645=function(_0x31d40f,_0x676a53){_0x31d40f=_0x31d40f-0x0;var _0x1edecb=_0x6455[_0x31d40f];return _0x1edecb;};'use strict';var Sequelize=require(_0x5645('0x0'));module['exports']={'name':{'type':Sequelize[_0x5645('0x1')],'unique':_0x5645('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5645('0x1')]},'notes':{'type':Sequelize[_0x5645('0x3')]},'preproduction':{'type':Sequelize[_0x5645('0x4')](_0x5645('0x5')),'get':function(){if(this['getDataValue'](_0x5645('0x6'))){return this[_0x5645('0x7')](_0x5645('0x6'))[_0x5645('0x8')](_0x5645('0x9'));}}},'production':{'type':Sequelize[_0x5645('0x4')](_0x5645('0x5')),'get':function(){if(this[_0x5645('0x7')]('production')){return this['getDataValue'](_0x5645('0xa'))[_0x5645('0x8')](_0x5645('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 30b4932..2931e04 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 _0xdb28=['status','end','json','offset','limit','set','apply','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','index','SquareProject','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xdb28,0x106));var _0x8db2=function(_0x34c240,_0x4f3efb){_0x34c240=_0x34c240-0x0;var _0x6028e9=_0xdb28[_0x34c240];return _0x6028e9;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8db2('0x11'));var Redis=require(_0x8db2('0x12'));var qs=require(_0x8db2('0x13'));var logger=require('../../config/logger')(_0x8db2('0x14'));var utils=require(_0x8db2('0x15'));var config=require('../../config/environment');var db=require(_0x8db2('0x16'))['db'];config[_0x8db2('0x17')]=_[_0x8db2('0x18')](config[_0x8db2('0x17')],{'host':_0x8db2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xcc;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x1c')](_0x1d6a15);}return _0x350d61[_0x8db2('0x1d')](_0x1d6a15)[_0x8db2('0x1e')]();};}function respondWithResult(_0x131252,_0x16c8c2){_0x16c8c2=_0x16c8c2||0xc8;return function(_0x5489a9){if(_0x5489a9){return _0x131252[_0x8db2('0x1d')](_0x16c8c2)[_0x8db2('0x1f')](_0x5489a9);}};}function respondWithFilteredResult(_0x48101e,_0x2b3f73){return function(_0x44957d){if(_0x44957d){var _0x21db8c=_0x44957d['count'],_0x3fddc2=_0x2b3f73['offset'],_0x2efd06=_0x2b3f73[_0x8db2('0x20')]+_0x2b3f73[_0x8db2('0x21')],_0x46ce14;if(_0x2efd06>=_0x21db8c){_0x2efd06=_0x21db8c;_0x46ce14=0xc8;}else{_0x46ce14=0xce;}_0x48101e[_0x8db2('0x1d')](_0x46ce14);return _0x48101e[_0x8db2('0x22')]('Content-Range',_0x3fddc2+'-'+_0x2efd06+'/'+_0x21db8c)[_0x8db2('0x1f')](_0x44957d);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x23')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x24')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x25')](_0x3e30e6)[_0x8db2('0x26')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){var _0x4d923c=_0x4f6516[_0x8db2('0x27')]({'plain':!![]});var _0x29b5cd=_0x8db2('0x28');return db[_0x8db2('0x29')][_0x8db2('0x2a')]({'where':{'type':_0x29b5cd,'resourceId':_0x4d923c['id']}})[_0x8db2('0x26')](function(){return _0x4f6516;});})['then'](function(){_0x5c6614[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x430dd5,_0x8b7cec){return function(_0x483aee){if(!_0x483aee){_0x430dd5[_0x8db2('0x1c')](0x194);}return _0x483aee;};}function handleError(_0x11f398,_0x241baf){_0x241baf=_0x241baf||0x1f4;return function(_0x1687ed){logger[_0x8db2('0x2b')](_0x1687ed[_0x8db2('0x2c')]);if(_0x1687ed[_0x8db2('0x2d')]){delete _0x1687ed[_0x8db2('0x2d')];}_0x11f398[_0x8db2('0x1d')](_0x241baf)['send'](_0x1687ed);};}exports[_0x8db2('0x2e')]=function(_0x50b28d,_0x59cb77){var _0x302188={},_0x25ed2c={},_0xcc8a66={'count':0x0,'rows':[]};var _0x49b2b3=db[_0x8db2('0x2f')]['rawAttributes'];_0x25ed2c[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x49b2b3);_0x25ed2c[_0x8db2('0x32')]=_['keys'](_0x50b28d['query']);_0x25ed2c[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x25ed2c['model'],_0x25ed2c['query']);_0x302188[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x25ed2c[_0x8db2('0x30')],qs[_0x8db2('0x36')](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x36')]));_0x302188[_0x8db2('0x35')]=_0x302188[_0x8db2('0x35')][_0x8db2('0x37')]?_0x302188[_0x8db2('0x35')]:_0x25ed2c['model'];if(!_0x50b28d[_0x8db2('0x32')][_0x8db2('0x38')]('nolimit')){_0x302188[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x50b28d['query']['limit']);_0x302188[_0x8db2('0x20')]=qs['offset'](_0x50b28d[_0x8db2('0x32')][_0x8db2('0x20')]);}_0x302188[_0x8db2('0x39')]=qs[_0x8db2('0x3a')](_0x50b28d['query'][_0x8db2('0x3a')]);_0x302188['where']=qs[_0x8db2('0x33')](_[_0x8db2('0x3b')](_0x50b28d[_0x8db2('0x32')],_0x25ed2c[_0x8db2('0x33')]));if(_0x50b28d['query']['filter']){_0x302188[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x302188['where'],{'$or':_[_0x8db2('0x3e')](_0x49b2b3,function(_0x24bcfe){if(_0x24bcfe[_0x8db2('0x3f')]['key']!==_0x8db2('0x40')){var _0x149186={};_0x149186[_0x24bcfe[_0x8db2('0x41')]]={'$like':'%'+_0x50b28d[_0x8db2('0x32')][_0x8db2('0x42')]+'%'};return _0x149186;}})});}_0x302188=_[_0x8db2('0x3d')]({},_0x302188,_0x50b28d[_0x8db2('0x43')]);var _0x1575ea={'where':_0x302188[_0x8db2('0x3c')]};return db[_0x8db2('0x2f')][_0x8db2('0x44')](_0x1575ea)[_0x8db2('0x26')](function(_0x1d9025){_0xcc8a66['count']=_0x1d9025;if(_0x50b28d[_0x8db2('0x32')][_0x8db2('0x45')]){_0x302188['include']=[{'all':!![]}];}return db['SquareProject'][_0x8db2('0x46')](_0x302188);})['then'](function(_0x130eb9){_0xcc8a66[_0x8db2('0x47')]=_0x130eb9;return _0xcc8a66;})[_0x8db2('0x26')](respondWithFilteredResult(_0x59cb77,_0x302188))[_0x8db2('0x48')](handleError(_0x59cb77,null));};exports[_0x8db2('0x49')]=function(_0x30d606,_0xa53fba){var _0x5c97ef={'raw':![],'where':{'id':_0x30d606[_0x8db2('0x4a')]['id']}},_0x2f86b1={};_0x2f86b1[_0x8db2('0x30')]=_[_0x8db2('0x31')](db['SquareProject'][_0x8db2('0x4b')]);_0x2f86b1[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x30d606[_0x8db2('0x32')]);_0x2f86b1['filters']=_[_0x8db2('0x34')](_0x2f86b1['model'],_0x2f86b1[_0x8db2('0x32')]);_0x5c97ef[_0x8db2('0x35')]=_[_0x8db2('0x34')](_0x2f86b1['model'],qs['fields'](_0x30d606[_0x8db2('0x32')]['fields']));_0x5c97ef[_0x8db2('0x35')]=_0x5c97ef[_0x8db2('0x35')][_0x8db2('0x37')]?_0x5c97ef[_0x8db2('0x35')]:_0x2f86b1[_0x8db2('0x30')];if(_0x30d606[_0x8db2('0x32')][_0x8db2('0x45')]){_0x5c97ef[_0x8db2('0x4c')]=[{'all':!![]}];}_0x5c97ef=_[_0x8db2('0x3d')]({},_0x5c97ef,_0x30d606[_0x8db2('0x43')]);return db[_0x8db2('0x2f')][_0x8db2('0x4d')](_0x5c97ef)['then'](handleEntityNotFound(_0xa53fba,null))[_0x8db2('0x26')](respondWithResult(_0xa53fba,null))[_0x8db2('0x48')](handleError(_0xa53fba,null));};exports[_0x8db2('0x4e')]=function(_0x3244db,_0x4f5018){return db['SquareProject'][_0x8db2('0x4e')](_0x3244db[_0x8db2('0x4f')],{})[_0x8db2('0x26')](function(_0x4c66e5){var _0x540d90=_0x3244db['user'][_0x8db2('0x27')]({'plain':!![]});if(!_0x540d90)throw new Error(_0x8db2('0x50'));if(_0x540d90[_0x8db2('0x51')]===_0x8db2('0x52')){var _0xaab731=_0x4c66e5[_0x8db2('0x27')]({'plain':!![]});var _0x2fa118='SquareProjects';return db['UserProfileSection'][_0x8db2('0x4d')]({'where':{'name':_0x2fa118,'userProfileId':_0x540d90[_0x8db2('0x53')]},'raw':!![]})[_0x8db2('0x26')](function(_0x2f0bd0){if(_0x2f0bd0&&_0x2f0bd0[_0x8db2('0x54')]===0x0){return db[_0x8db2('0x29')][_0x8db2('0x4e')]({'name':_0xaab731[_0x8db2('0x2d')],'resourceId':_0xaab731['id'],'type':_0x2f0bd0[_0x8db2('0x2d')],'sectionId':_0x2f0bd0['id']},{})[_0x8db2('0x26')](function(){return _0x4c66e5;});}else{return _0x4c66e5;}})[_0x8db2('0x48')](function(_0x319273){logger[_0x8db2('0x2b')](_0x8db2('0x55'),_0x319273);throw _0x319273;});}return _0x4c66e5;})[_0x8db2('0x26')](respondWithResult(_0x4f5018,0xc9))['catch'](handleError(_0x4f5018,null));};exports[_0x8db2('0x25')]=function(_0xb4b0a,_0x579317){if(_0xb4b0a[_0x8db2('0x4f')]['id']){delete _0xb4b0a[_0x8db2('0x4f')]['id'];}return db[_0x8db2('0x2f')]['find']({'where':{'id':_0xb4b0a[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x579317,null))[_0x8db2('0x26')](saveUpdates(_0xb4b0a[_0x8db2('0x4f')],null))[_0x8db2('0x26')](respondWithResult(_0x579317,null))['catch'](handleError(_0x579317,null));};exports[_0x8db2('0x2a')]=function(_0x159dcb,_0x469bc2){return db['SquareProject'][_0x8db2('0x4d')]({'where':{'id':_0x159dcb[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x469bc2,null))[_0x8db2('0x26')](removeEntity(_0x469bc2,null))[_0x8db2('0x48')](handleError(_0x469bc2,null));};exports[_0x8db2('0x56')]=function(_0x12a81a,_0x5ca295,_0x39ff90){return db[_0x8db2('0x2f')]['find']({'where':{'id':_0x12a81a[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x5ca295,null))['then'](function(_0x107bbe){if(_0x107bbe){return _0x107bbe[_0x8db2('0x56')](_0x12a81a[_0x8db2('0x4f')][_0x8db2('0x57')],_[_0x8db2('0x58')](_0x12a81a[_0x8db2('0x4f')],[_0x8db2('0x57'),'id'])||{});}})[_0x8db2('0x26')](respondWithResult(_0x5ca295,null))[_0x8db2('0x48')](handleError(_0x5ca295,null));};exports[_0x8db2('0x59')]=function(_0x12fd12,_0x447a47,_0x3272c6){var _0x1ce89f;return db[_0x8db2('0x2f')][_0x8db2('0x4d')]({'where':{'id':_0x12fd12['params']['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x447a47,null))[_0x8db2('0x26')](function(_0x44118a){if(_0x44118a){return _0x44118a[_0x8db2('0x59')](_0x12fd12[_0x8db2('0x32')]['ids'])[_0x8db2('0x26')](function(_0x2c3087){if(_[_0x8db2('0x5a')](_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')])){for(var _0x348da8=0x0;_0x348da8<_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')][_0x8db2('0x37')];_0x348da8+=0x1){socket[_0x8db2('0x5b')](_0x8db2('0x5c'),{'UserId':_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')][_0x348da8],'SquareProjectId':_0x12fd12[_0x8db2('0x4a')]['id']});}}else{socket[_0x8db2('0x5b')](_0x8db2('0x5c'),{'UserId':_0x12fd12[_0x8db2('0x32')][_0x8db2('0x57')],'SquareProjectId':_0x12fd12['params']['id']});}});}})[_0x8db2('0x26')](respondWithStatusCode(_0x447a47,null))['catch'](handleError(_0x447a47,null));};exports[_0x8db2('0x5d')]=function(_0x570c53,_0x3de11e,_0x39330c){var _0xe4fd6a={};var _0x1e2ccd={};var _0x1e812e;var _0x59a32e;return db['SquareProject'][_0x8db2('0x5e')]({'where':{'id':_0x570c53[_0x8db2('0x4a')]['id']}})[_0x8db2('0x26')](handleEntityNotFound(_0x3de11e,null))[_0x8db2('0x26')](function(_0x20b49c){if(_0x20b49c){_0x1e812e=_0x20b49c;_0x1e2ccd[_0x8db2('0x30')]=_[_0x8db2('0x31')](db[_0x8db2('0x5f')]['rawAttributes']);_0x1e2ccd[_0x8db2('0x32')]=_[_0x8db2('0x31')](_0x570c53[_0x8db2('0x32')]);_0x1e2ccd[_0x8db2('0x33')]=_[_0x8db2('0x34')](_0x1e2ccd[_0x8db2('0x30')],_0x1e2ccd[_0x8db2('0x32')]);_0xe4fd6a[_0x8db2('0x35')]=_['intersection'](_0x1e2ccd['model'],qs[_0x8db2('0x36')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x36')]));_0xe4fd6a[_0x8db2('0x35')]=_0xe4fd6a[_0x8db2('0x35')]['length']?_0xe4fd6a['attributes']:_0x1e2ccd[_0x8db2('0x30')];_0xe4fd6a[_0x8db2('0x39')]=qs['sort'](_0x570c53[_0x8db2('0x32')][_0x8db2('0x3a')]);_0xe4fd6a[_0x8db2('0x3c')]=qs['filters'](_[_0x8db2('0x3b')](_0x570c53[_0x8db2('0x32')],_0x1e2ccd[_0x8db2('0x33')]));if(_0x570c53['query'][_0x8db2('0x42')]){_0xe4fd6a[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0xe4fd6a[_0x8db2('0x3c')],{'$or':_[_0x8db2('0x3e')](_0xe4fd6a['attributes'],function(_0x3c9af4){var _0x3023fe={};_0x3023fe[_0x3c9af4]={'$like':'%'+_0x570c53[_0x8db2('0x32')]['filter']+'%'};return _0x3023fe;})});}_0xe4fd6a=_['merge']({},_0xe4fd6a,_0x570c53[_0x8db2('0x43')]);return _0x1e812e[_0x8db2('0x5d')](_0xe4fd6a);}})['then'](function(_0x1eecf1){if(_0x1eecf1){_0x59a32e=_0x1eecf1[_0x8db2('0x37')];if(!_0x570c53[_0x8db2('0x32')][_0x8db2('0x38')](_0x8db2('0x60'))){_0xe4fd6a[_0x8db2('0x21')]=qs[_0x8db2('0x21')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x21')]);_0xe4fd6a[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x570c53[_0x8db2('0x32')][_0x8db2('0x20')]);}return _0x1e812e['getUsers'](_0xe4fd6a);}})[_0x8db2('0x26')](function(_0x4f29f1){if(_0x4f29f1){return _0x4f29f1?{'count':_0x59a32e,'rows':_0x4f29f1}:null;}})[_0x8db2('0x26')](respondWithResult(_0x3de11e,null))[_0x8db2('0x48')](handleError(_0x3de11e,null));}; \ No newline at end of file +var _0x1261=['reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','name','index','SquareProject','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','catch','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range'];(function(_0x2ad2e0,_0x40e043){var _0x573bec=function(_0x49ba98){while(--_0x49ba98){_0x2ad2e0['push'](_0x2ad2e0['shift']());}};_0x573bec(++_0x40e043);}(_0x1261,0x144));var _0x1126=function(_0x51f2c0,_0xb7c46e){_0x51f2c0=_0x51f2c0-0x0;var _0x34ffd5=_0x1261[_0x51f2c0];return _0x34ffd5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var authService=require(_0x1126('0x11'));var hardwareService=require(_0x1126('0x12'));var Redis=require(_0x1126('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x1126('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1126('0x15'));var db=require('../../mysqldb')['db'];config[_0x1126('0x16')]=_[_0x1126('0x17')](config[_0x1126('0x16')],{'host':_0x1126('0x18'),'port':0x18eb});var socket=require(_0x1126('0x19'))(new Redis(config[_0x1126('0x16')]));require(_0x1126('0x1a'))[_0x1126('0x1b')](socket);function respondWithStatusCode(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xcc;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x1c')](_0x53a8f0);}return _0x43850b[_0x1126('0x1d')](_0x53a8f0)[_0x1126('0x1e')]();};}function respondWithResult(_0x4be0c6,_0x45149c){_0x45149c=_0x45149c||0xc8;return function(_0x4794a7){if(_0x4794a7){return _0x4be0c6[_0x1126('0x1d')](_0x45149c)[_0x1126('0x1f')](_0x4794a7);}};}function respondWithFilteredResult(_0x257b5f,_0x4e1c97){return function(_0x245cd7){if(_0x245cd7){var _0x1695f6=_0x245cd7[_0x1126('0x20')],_0x4a7b49=_0x4e1c97['offset'],_0x4d2b38=_0x4e1c97['offset']+_0x4e1c97[_0x1126('0x21')],_0x22ae0b;if(_0x4d2b38>=_0x1695f6){_0x4d2b38=_0x1695f6;_0x22ae0b=0xc8;}else{_0x22ae0b=0xce;}_0x257b5f['status'](_0x22ae0b);return _0x257b5f[_0x1126('0x22')](_0x1126('0x23'),_0x4a7b49+'-'+_0x4d2b38+'/'+_0x1695f6)[_0x1126('0x1f')](_0x245cd7);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x24')](_0x56efeb);}return _0x2a08ba[_0x1126('0x25')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x26')](_0x25b24b)[_0x1126('0x27')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x27')](function(){var _0x15bcc3=_0x529dd9[_0x1126('0x28')]({'plain':!![]});var _0x34bcf1=_0x1126('0x29');return db[_0x1126('0x2a')][_0x1126('0x2b')]({'where':{'type':_0x34bcf1,'resourceId':_0x15bcc3['id']}})[_0x1126('0x27')](function(){return _0x529dd9;});})['then'](function(){_0x2175fa[_0x1126('0x1d')](0xcc)[_0x1126('0x1e')]();});}};}function handleEntityNotFound(_0xa293f4,_0x5ddf63){return function(_0x541bc9){if(!_0x541bc9){_0xa293f4[_0x1126('0x1c')](0x194);}return _0x541bc9;};}function handleError(_0x39bf0e,_0x55e195){_0x55e195=_0x55e195||0x1f4;return function(_0x2fb797){logger[_0x1126('0x2c')](_0x2fb797['stack']);if(_0x2fb797[_0x1126('0x2d')]){delete _0x2fb797['name'];}_0x39bf0e[_0x1126('0x1d')](_0x55e195)['send'](_0x2fb797);};}exports[_0x1126('0x2e')]=function(_0x583ce6,_0x378f4d){var _0x5f2611={},_0x5252e0={},_0x4a53ab={'count':0x0,'rows':[]};var _0x17646e=db[_0x1126('0x2f')][_0x1126('0x30')];_0x5252e0['model']=_[_0x1126('0x31')](_0x17646e);_0x5252e0[_0x1126('0x32')]=_['keys'](_0x583ce6[_0x1126('0x32')]);_0x5252e0[_0x1126('0x33')]=_[_0x1126('0x34')](_0x5252e0[_0x1126('0x35')],_0x5252e0['query']);_0x5f2611['attributes']=_[_0x1126('0x34')](_0x5252e0[_0x1126('0x35')],qs[_0x1126('0x36')](_0x583ce6[_0x1126('0x32')]['fields']));_0x5f2611[_0x1126('0x37')]=_0x5f2611[_0x1126('0x37')][_0x1126('0x38')]?_0x5f2611[_0x1126('0x37')]:_0x5252e0[_0x1126('0x35')];if(!_0x583ce6['query'][_0x1126('0x39')](_0x1126('0x3a'))){_0x5f2611[_0x1126('0x21')]=qs[_0x1126('0x21')](_0x583ce6['query']['limit']);_0x5f2611[_0x1126('0x3b')]=qs[_0x1126('0x3b')](_0x583ce6['query'][_0x1126('0x3b')]);}_0x5f2611[_0x1126('0x3c')]=qs[_0x1126('0x3d')](_0x583ce6['query']['sort']);_0x5f2611[_0x1126('0x3e')]=qs[_0x1126('0x33')](_[_0x1126('0x3f')](_0x583ce6[_0x1126('0x32')],_0x5252e0['filters']));if(_0x583ce6[_0x1126('0x32')]['filter']){_0x5f2611[_0x1126('0x3e')]=_[_0x1126('0x40')](_0x5f2611[_0x1126('0x3e')],{'$or':_[_0x1126('0x41')](_0x17646e,function(_0x57e5d2){if(_0x57e5d2['type'][_0x1126('0x42')]!==_0x1126('0x43')){var _0x2939a9={};_0x2939a9[_0x57e5d2[_0x1126('0x44')]]={'$like':'%'+_0x583ce6[_0x1126('0x32')][_0x1126('0x45')]+'%'};return _0x2939a9;}})});}_0x5f2611=_[_0x1126('0x40')]({},_0x5f2611,_0x583ce6['options']);var _0x1c8d8a={'where':_0x5f2611[_0x1126('0x3e')]};return db[_0x1126('0x2f')][_0x1126('0x20')](_0x1c8d8a)[_0x1126('0x27')](function(_0x518de1){_0x4a53ab['count']=_0x518de1;if(_0x583ce6[_0x1126('0x32')][_0x1126('0x46')]){_0x5f2611[_0x1126('0x47')]=[{'all':!![]}];}return db[_0x1126('0x2f')][_0x1126('0x48')](_0x5f2611);})[_0x1126('0x27')](function(_0x5489c0){_0x4a53ab['rows']=_0x5489c0;return _0x4a53ab;})['then'](respondWithFilteredResult(_0x378f4d,_0x5f2611))[_0x1126('0x49')](handleError(_0x378f4d,null));};exports['show']=function(_0xf84005,_0x462da8){var _0x3584a3={'raw':![],'where':{'id':_0xf84005['params']['id']}},_0x1a3584={};_0x1a3584['model']=_[_0x1126('0x31')](db[_0x1126('0x2f')][_0x1126('0x30')]);_0x1a3584['query']=_[_0x1126('0x31')](_0xf84005['query']);_0x1a3584[_0x1126('0x33')]=_['intersection'](_0x1a3584[_0x1126('0x35')],_0x1a3584[_0x1126('0x32')]);_0x3584a3[_0x1126('0x37')]=_['intersection'](_0x1a3584[_0x1126('0x35')],qs[_0x1126('0x36')](_0xf84005[_0x1126('0x32')]['fields']));_0x3584a3['attributes']=_0x3584a3['attributes'][_0x1126('0x38')]?_0x3584a3['attributes']:_0x1a3584[_0x1126('0x35')];if(_0xf84005['query'][_0x1126('0x46')]){_0x3584a3[_0x1126('0x47')]=[{'all':!![]}];}_0x3584a3=_[_0x1126('0x40')]({},_0x3584a3,_0xf84005[_0x1126('0x4a')]);return db[_0x1126('0x2f')]['find'](_0x3584a3)[_0x1126('0x27')](handleEntityNotFound(_0x462da8,null))[_0x1126('0x27')](respondWithResult(_0x462da8,null))['catch'](handleError(_0x462da8,null));};exports[_0x1126('0x4b')]=function(_0x13dc39,_0x575f79){return db[_0x1126('0x2f')][_0x1126('0x4b')](_0x13dc39['body'],{})[_0x1126('0x27')](function(_0xbdde58){var _0x213a76=_0x13dc39['user'][_0x1126('0x28')]({'plain':!![]});if(!_0x213a76)throw new Error(_0x1126('0x4c'));if(_0x213a76[_0x1126('0x4d')]===_0x1126('0x4e')){var _0x224456=_0xbdde58[_0x1126('0x28')]({'plain':!![]});var _0x28f5ee=_0x1126('0x29');return db['UserProfileSection'][_0x1126('0x4f')]({'where':{'name':_0x28f5ee,'userProfileId':_0x213a76['userProfileId']},'raw':!![]})[_0x1126('0x27')](function(_0x2ad118){if(_0x2ad118&&_0x2ad118['autoAssociation']===0x0){return db['UserProfileResource'][_0x1126('0x4b')]({'name':_0x224456[_0x1126('0x2d')],'resourceId':_0x224456['id'],'type':_0x2ad118[_0x1126('0x2d')],'sectionId':_0x2ad118['id']},{})['then'](function(){return _0xbdde58;});}else{return _0xbdde58;}})[_0x1126('0x49')](function(_0x3506d7){logger[_0x1126('0x2c')](_0x1126('0x50'),_0x3506d7);throw _0x3506d7;});}return _0xbdde58;})['then'](respondWithResult(_0x575f79,0xc9))[_0x1126('0x49')](handleError(_0x575f79,null));};exports[_0x1126('0x26')]=function(_0x5c36b9,_0x4bcc08){if(_0x5c36b9['body']['id']){delete _0x5c36b9['body']['id'];}return db[_0x1126('0x2f')][_0x1126('0x4f')]({'where':{'id':_0x5c36b9['params']['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x4bcc08,null))[_0x1126('0x27')](saveUpdates(_0x5c36b9[_0x1126('0x51')],null))[_0x1126('0x27')](respondWithResult(_0x4bcc08,null))[_0x1126('0x49')](handleError(_0x4bcc08,null));};exports['destroy']=function(_0x41cbb6,_0x267592){return db['SquareProject'][_0x1126('0x4f')]({'where':{'id':_0x41cbb6[_0x1126('0x52')]['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x267592,null))[_0x1126('0x27')](removeEntity(_0x267592,null))[_0x1126('0x49')](handleError(_0x267592,null));};exports['addUsers']=function(_0x673c09,_0x49aeaa,_0x868b2c){return db[_0x1126('0x2f')][_0x1126('0x4f')]({'where':{'id':_0x673c09['params']['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x49aeaa,null))[_0x1126('0x27')](function(_0x5763b4){if(_0x5763b4){return _0x5763b4[_0x1126('0x53')](_0x673c09[_0x1126('0x51')][_0x1126('0x54')],_['omit'](_0x673c09[_0x1126('0x51')],[_0x1126('0x54'),'id'])||{});}})[_0x1126('0x27')](respondWithResult(_0x49aeaa,null))[_0x1126('0x49')](handleError(_0x49aeaa,null));};exports[_0x1126('0x55')]=function(_0x26949c,_0x30c848,_0x114be2){var _0x47e53d;return db[_0x1126('0x2f')][_0x1126('0x4f')]({'where':{'id':_0x26949c[_0x1126('0x52')]['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x30c848,null))[_0x1126('0x27')](function(_0x4f5772){if(_0x4f5772){return _0x4f5772[_0x1126('0x55')](_0x26949c[_0x1126('0x32')]['ids'])[_0x1126('0x27')](function(_0x5246aa){if(_[_0x1126('0x56')](_0x26949c[_0x1126('0x32')]['ids'])){for(var _0x3062d6=0x0;_0x3062d6<_0x26949c[_0x1126('0x32')][_0x1126('0x54')]['length'];_0x3062d6+=0x1){socket[_0x1126('0x57')]('userSquareProject:remove',{'UserId':_0x26949c['query'][_0x1126('0x54')][_0x3062d6],'SquareProjectId':_0x26949c[_0x1126('0x52')]['id']});}}else{socket[_0x1126('0x57')](_0x1126('0x58'),{'UserId':_0x26949c[_0x1126('0x32')][_0x1126('0x54')],'SquareProjectId':_0x26949c[_0x1126('0x52')]['id']});}});}})['then'](respondWithStatusCode(_0x30c848,null))[_0x1126('0x49')](handleError(_0x30c848,null));};exports[_0x1126('0x59')]=function(_0x116867,_0xc39c36,_0x3f87aa){var _0x3cd788={};var _0x5a0804={};var _0x5b17d6;var _0x16a343;return db[_0x1126('0x2f')]['findOne']({'where':{'id':_0x116867['params']['id']}})['then'](handleEntityNotFound(_0xc39c36,null))['then'](function(_0x964a2){if(_0x964a2){_0x5b17d6=_0x964a2;_0x5a0804[_0x1126('0x35')]=_[_0x1126('0x31')](db['User'][_0x1126('0x30')]);_0x5a0804[_0x1126('0x32')]=_[_0x1126('0x31')](_0x116867[_0x1126('0x32')]);_0x5a0804[_0x1126('0x33')]=_[_0x1126('0x34')](_0x5a0804[_0x1126('0x35')],_0x5a0804['query']);_0x3cd788[_0x1126('0x37')]=_[_0x1126('0x34')](_0x5a0804[_0x1126('0x35')],qs[_0x1126('0x36')](_0x116867[_0x1126('0x32')]['fields']));_0x3cd788['attributes']=_0x3cd788[_0x1126('0x37')][_0x1126('0x38')]?_0x3cd788['attributes']:_0x5a0804[_0x1126('0x35')];_0x3cd788[_0x1126('0x3c')]=qs[_0x1126('0x3d')](_0x116867[_0x1126('0x32')][_0x1126('0x3d')]);_0x3cd788[_0x1126('0x3e')]=qs[_0x1126('0x33')](_[_0x1126('0x3f')](_0x116867[_0x1126('0x32')],_0x5a0804[_0x1126('0x33')]));if(_0x116867[_0x1126('0x32')][_0x1126('0x45')]){_0x3cd788[_0x1126('0x3e')]=_['merge'](_0x3cd788[_0x1126('0x3e')],{'$or':_[_0x1126('0x41')](_0x3cd788[_0x1126('0x37')],function(_0x53ea9a){var _0x484881={};_0x484881[_0x53ea9a]={'$like':'%'+_0x116867[_0x1126('0x32')][_0x1126('0x45')]+'%'};return _0x484881;})});}_0x3cd788=_[_0x1126('0x40')]({},_0x3cd788,_0x116867[_0x1126('0x4a')]);return _0x5b17d6['getUsers'](_0x3cd788);}})['then'](function(_0x48621e){if(_0x48621e){_0x16a343=_0x48621e[_0x1126('0x38')];if(!_0x116867[_0x1126('0x32')][_0x1126('0x39')](_0x1126('0x3a'))){_0x3cd788['limit']=qs[_0x1126('0x21')](_0x116867['query'][_0x1126('0x21')]);_0x3cd788[_0x1126('0x3b')]=qs[_0x1126('0x3b')](_0x116867[_0x1126('0x32')][_0x1126('0x3b')]);}return _0x5b17d6[_0x1126('0x59')](_0x3cd788);}})[_0x1126('0x27')](function(_0x5f5a36){if(_0x5f5a36){return _0x5f5a36?{'count':_0x16a343,'rows':_0x5f5a36}:null;}})[_0x1126('0x27')](respondWithResult(_0xc39c36,null))['catch'](handleError(_0xc39c36,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0a85c03..ad89bff 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 _0x9aa2=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x141b83,_0x21d6c6){var _0x46ea49=function(_0x37a8d8){while(--_0x37a8d8){_0x141b83['push'](_0x141b83['shift']());}};_0x46ea49(++_0x21d6c6);}(_0x9aa2,0x176));var _0x29aa=function(_0xbd780a,_0x3bc342){_0xbd780a=_0xbd780a-0x0;var _0x4867b6=_0x9aa2[_0xbd780a];return _0x4867b6;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x29aa('0x0'))['db'][_0x29aa('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x29aa('0x2')](0x0);var events={'afterCreate':_0x29aa('0x3'),'afterUpdate':_0x29aa('0x4'),'afterDestroy':_0x29aa('0x5')};function emitEvent(_0x2bc279){return function(_0xa31431,_0x2cd86a,_0x2b1f68){SquareProjectEvents[_0x29aa('0x6')](_0x2bc279+':'+_0xa31431['id'],_0xa31431);SquareProjectEvents[_0x29aa('0x6')](_0x2bc279,_0xa31431);_0x2b1f68(null);};}for(var e in events){if(events[_0x29aa('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x29aa('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x5e49=['hook','exports','events','../../mysqldb','SquareProject','update'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x5e49,0x152));var _0x95e4=function(_0x16d4b6,_0x527555){_0x16d4b6=_0x16d4b6-0x0;var _0xeeaf29=_0x5e49[_0x16d4b6];return _0xeeaf29;};'use strict';var EventEmitter=require(_0x95e4('0x0'));var SquareProject=require(_0x95e4('0x1'))['db'][_0x95e4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x95e4('0x3'),'afterDestroy':'remove'};function emitEvent(_0xe8db9e){return function(_0x8261c3,_0x5a9876,_0x33f4d9){SquareProjectEvents['emit'](_0xe8db9e+':'+_0x8261c3['id'],_0x8261c3);SquareProjectEvents['emit'](_0xe8db9e,_0x8261c3);_0x33f4d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x95e4('0x4')](e,emitEvent(event));}}module[_0x95e4('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6995b00..50cbac3 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 _0x5fdd=['bluebird','request-promise','define','square_projects','lodash','util','api'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x5fdd,0x11c));var _0xd5fd=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x5fdd[_0x290fa6];return _0x47f1f3;};'use strict';var _=require(_0xd5fd('0x0'));var util=require(_0xd5fd('0x1'));var logger=require('../../config/logger')(_0xd5fd('0x2'));var moment=require('moment');var BPromise=require(_0xd5fd('0x3'));var rp=require(_0xd5fd('0x4'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x1f5e69,_0x15bf10){return _0x1f5e69[_0xd5fd('0x5')]('SquareProject',attributes,{'tableName':_0xd5fd('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42d6=['../../config/logger','api','moment','bluebird','request-promise','exports','define','SquareProject','square_projects'];(function(_0x6abf2f,_0x127add){var _0x5043c3=function(_0x148969){while(--_0x148969){_0x6abf2f['push'](_0x6abf2f['shift']());}};_0x5043c3(++_0x127add);}(_0x42d6,0xcf));var _0x642d=function(_0x2a10c1,_0x43617a){_0x2a10c1=_0x2a10c1-0x0;var _0x1e60f8=_0x42d6[_0x2a10c1];return _0x1e60f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x642d('0x0'))(_0x642d('0x1'));var moment=require(_0x642d('0x2'));var BPromise=require(_0x642d('0x3'));var rp=require(_0x642d('0x4'));var attributes=require('./squareProject.attributes');module[_0x642d('0x5')]=function(_0x5cc319,_0x5e57a6){return _0x5cc319[_0x642d('0x6')](_0x642d('0x7'),attributes,{'tableName':_0x642d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index bfbf9be..2defca1 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4e7396,_0x4c3d43){var _0x3fb7e2=function(_0x4fa6ef){while(--_0x4fa6ef){_0x4e7396['push'](_0x4e7396['shift']());}};_0x3fb7e2(++_0x4c3d43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x55da5d,_0x1a9611){var _0x26d68e=function(_0x2a629d){while(--_0x2a629d){_0x55da5d['push'](_0x55da5d['shift']());}};_0x26d68e(++_0x1a9611);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 54e931e..379dbe4 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 _0x279d=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x19fe21,_0x50eb03){var _0x5caea2=function(_0xd42c90){while(--_0xd42c90){_0x19fe21['push'](_0x19fe21['shift']());}};_0x5caea2(++_0x50eb03);}(_0x279d,0x1d8));var _0xd279=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x279d[_0x368fb9];return _0x4892fb;};'use strict';var SquareProjectEvents=require(_0xd279('0x0'));var events=[_0xd279('0x1'),_0xd279('0x2'),_0xd279('0x3')];function createListener(_0x59afe5,_0x4901ec){return function(_0x3e9699){_0x4901ec[_0xd279('0x4')](_0x59afe5,_0x3e9699);};}function removeListener(_0x47cfee,_0x15d034){return function(){SquareProjectEvents[_0xd279('0x5')](_0x47cfee,_0x15d034);};}exports[_0xd279('0x6')]=function(_0x87b2a5){for(var _0x1d340c=0x0,_0x1faab4=events[_0xd279('0x7')];_0x1d340c<_0x1faab4;_0x1d340c++){var _0x5f164e=events[_0x1d340c];var _0x3cd28e=createListener(_0xd279('0x8')+_0x5f164e,_0x87b2a5);SquareProjectEvents['on'](_0x5f164e,_0x3cd28e);}}; \ No newline at end of file +var _0x3a32=['squareProject:','./squareProject.events','save','remove','update','removeListener','length'];(function(_0x408c71,_0x11781b){var _0x52ff57=function(_0x24bb20){while(--_0x24bb20){_0x408c71['push'](_0x408c71['shift']());}};_0x52ff57(++_0x11781b);}(_0x3a32,0x9b));var _0x23a3=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x3a32[_0x53cf8e];return _0x459197;};'use strict';var SquareProjectEvents=require(_0x23a3('0x0'));var events=[_0x23a3('0x1'),_0x23a3('0x2'),_0x23a3('0x3')];function createListener(_0x2f3b12,_0xf5328b){return function(_0x2e484c){_0xf5328b['emit'](_0x2f3b12,_0x2e484c);};}function removeListener(_0x480d99,_0xc06a55){return function(){SquareProjectEvents[_0x23a3('0x4')](_0x480d99,_0xc06a55);};}exports['register']=function(_0x3b1735){for(var _0x529b70=0x0,_0x103499=events[_0x23a3('0x5')];_0x529b70<_0x103499;_0x529b70++){var _0xd4e907=events[_0x529b70];var _0x2562bc=createListener(_0x23a3('0x6')+_0xd4e907,_0x3b1735);SquareProjectEvents['on'](_0xd4e907,_0x2562bc);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 491a5f8..d55b32c 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 _0xa633=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','delete','exports','multer','connect-timeout','../../components/auth/service'];(function(_0x4ea6af,_0x4aa32e){var _0x4cb1e6=function(_0xc9edd0){while(--_0xc9edd0){_0x4ea6af['push'](_0x4ea6af['shift']());}};_0x4cb1e6(++_0x4aa32e);}(_0xa633,0x15d));var _0x3a63=function(_0x5c8f44,_0x538fb9){_0x5c8f44=_0x5c8f44-0x0;var _0x12ae8d=_0xa633[_0x5c8f44];return _0x12ae8d;};'use strict';var multer=require(_0x3a63('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a63('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x3a63('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x3a63('0x3'));var controller=require(_0x3a63('0x4'));router[_0x3a63('0x5')]('/',auth[_0x3a63('0x6')](),controller[_0x3a63('0x7')]);router[_0x3a63('0x5')](_0x3a63('0x8'),auth[_0x3a63('0x6')](),controller['show']);router['get'](_0x3a63('0x9'),auth[_0x3a63('0x6')](),controller[_0x3a63('0xa')]);router[_0x3a63('0xb')]('/',auth['isAuthenticated'](),controller[_0x3a63('0xc')]);router[_0x3a63('0xd')]('/:id',auth[_0x3a63('0x6')](),controller['update']);router[_0x3a63('0xe')](_0x3a63('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x3a63('0xf')]=router; \ No newline at end of file +var _0x8d01=['show','/:id/download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8d01,0x16d));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x18d0('0x0'));var util=require(_0x18d0('0x1'));var path=require(_0x18d0('0x2'));var timeout=require(_0x18d0('0x3'));var express=require(_0x18d0('0x4'));var router=express[_0x18d0('0x5')]();var auth=require(_0x18d0('0x6'));var interaction=require(_0x18d0('0x7'));var config=require('../../config/environment');var controller=require(_0x18d0('0x8'));router[_0x18d0('0x9')]('/',auth[_0x18d0('0xa')](),controller[_0x18d0('0xb')]);router['get'](_0x18d0('0xc'),auth[_0x18d0('0xa')](),controller[_0x18d0('0xd')]);router['get'](_0x18d0('0xe'),auth[_0x18d0('0xa')](),controller['download']);router[_0x18d0('0xf')]('/',auth[_0x18d0('0xa')](),controller[_0x18d0('0x10')]);router['put']('/:id',auth[_0x18d0('0xa')](),controller[_0x18d0('0x11')]);router[_0x18d0('0x12')](_0x18d0('0xc'),auth[_0x18d0('0xa')](),controller[_0x18d0('0x13')]);module[_0x18d0('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 1b188d9..d5a9aa5 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 _0x2069=['STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2069,0x11d));var _0x9206=function(_0x436f00,_0x2a810c){_0x436f00=_0x436f00-0x0;var _0x195199=_0x2069[_0x436f00];return _0x195199;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9206('0x0')]},'callerid':{'type':Sequelize[_0x9206('0x0')]},'calleridname':{'type':Sequelize[_0x9206('0x0')]},'context':{'type':Sequelize[_0x9206('0x0')]},'extension':{'type':Sequelize[_0x9206('0x0')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x9206('0x0')]},'filename':{'type':Sequelize[_0x9206('0x0')]},'savePath':{'type':Sequelize[_0x9206('0x0')]}}; \ No newline at end of file +var _0x0a6b=['STRING','sequelize','exports'];(function(_0x1ed2e4,_0x537514){var _0x555e33=function(_0x34ac6c){while(--_0x34ac6c){_0x1ed2e4['push'](_0x1ed2e4['shift']());}};_0x555e33(++_0x537514);}(_0x0a6b,0xa6));var _0xb0a6=function(_0x1b2e63,_0x1d7683){_0x1b2e63=_0x1b2e63-0x0;var _0x3d69e5=_0x0a6b[_0x1b2e63];return _0x3d69e5;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module[_0xb0a6('0x1')]={'uniqueid':{'type':Sequelize[_0xb0a6('0x2')]},'callerid':{'type':Sequelize[_0xb0a6('0x2')]},'calleridname':{'type':Sequelize[_0xb0a6('0x2')]},'context':{'type':Sequelize[_0xb0a6('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb0a6('0x2')]},'dnid':{'type':Sequelize[_0xb0a6('0x2')]},'projectName':{'type':Sequelize[_0xb0a6('0x2')]},'saveName':{'type':Sequelize[_0xb0a6('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xb0a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f237ddc..52dd77c 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 _0x547e=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','download','extname','unlink','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','SquareRecording','model','keys','query'];(function(_0x51ea9f,_0x2de34a){var _0x5e398a=function(_0x38f02a){while(--_0x38f02a){_0x51ea9f['push'](_0x51ea9f['shift']());}};_0x5e398a(++_0x2de34a);}(_0x547e,0x1c8));var _0xe547=function(_0x1cc16e,_0x447184){_0x1cc16e=_0x1cc16e-0x0;var _0x18cbe4=_0x547e[_0x1cc16e];return _0x18cbe4;};'use strict';var pdf=require(_0xe547('0x0'));var emlformat=require(_0xe547('0x1'));var rimraf=require(_0xe547('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe547('0x3'));var moment=require(_0xe547('0x4'));var BPromise=require(_0xe547('0x5'));var Mustache=require('mustache');var util=require(_0xe547('0x6'));var path=require(_0xe547('0x7'));var sox=require(_0xe547('0x8'));var csv=require('to-csv');var ejs=require(_0xe547('0x9'));var fs=require('fs');var _=require(_0xe547('0xa'));var squel=require('squel');var crypto=require(_0xe547('0xb'));var jsforce=require(_0xe547('0xc'));var deskjs=require(_0xe547('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe547('0xe'));var Papa=require(_0xe547('0xf'));var authService=require(_0xe547('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xe547('0x11'));var logger=require(_0xe547('0x12'))('api');var utils=require(_0xe547('0x13'));var config=require(_0xe547('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2993,_0x16932a){_0x16932a=_0x16932a||0xcc;return function(_0x3b1a9d){if(_0x3b1a9d){return _0x5e2993[_0xe547('0x15')](_0x16932a);}return _0x5e2993[_0xe547('0x16')](_0x16932a)[_0xe547('0x17')]();};}function respondWithResult(_0x86aac9,_0x2acfa7){_0x2acfa7=_0x2acfa7||0xc8;return function(_0x453cc6){if(_0x453cc6){return _0x86aac9['status'](_0x2acfa7)[_0xe547('0x18')](_0x453cc6);}};}function respondWithFilteredResult(_0x2b1a42,_0x22fa48){return function(_0xf3da24){if(_0xf3da24){var _0x1c7fb9=_0xf3da24[_0xe547('0x19')],_0x229ef0=_0x22fa48['offset'],_0x5ef48a=_0x22fa48[_0xe547('0x1a')]+_0x22fa48[_0xe547('0x1b')],_0x3dd25a;if(_0x5ef48a>=_0x1c7fb9){_0x5ef48a=_0x1c7fb9;_0x3dd25a=0xc8;}else{_0x3dd25a=0xce;}_0x2b1a42[_0xe547('0x16')](_0x3dd25a);return _0x2b1a42[_0xe547('0x1c')](_0xe547('0x1d'),_0x229ef0+'-'+_0x5ef48a+'/'+_0x1c7fb9)[_0xe547('0x18')](_0xf3da24);}return null;};}function patchUpdates(_0x53edcd){return function(_0x5ae2e0){try{jsonpatch['apply'](_0x5ae2e0,_0x53edcd,!![]);}catch(_0x4ae1de){return BPromise[_0xe547('0x1e')](_0x4ae1de);}return _0x5ae2e0['save']();};}function saveUpdates(_0x36d59a,_0x44a73f){return function(_0x26f22e){if(_0x26f22e){return _0x26f22e[_0xe547('0x1f')](_0x36d59a)[_0xe547('0x20')](function(_0x3a1008){return _0x3a1008;});}return null;};}function removeEntity(_0xde9b95,_0xfb8a0e){return function(_0x171e76){if(_0x171e76){return _0x171e76[_0xe547('0x21')]()[_0xe547('0x20')](function(){_0xde9b95[_0xe547('0x16')](0xcc)[_0xe547('0x17')]();});}};}function handleEntityNotFound(_0xfcc4ef,_0x119845){return function(_0x574432){if(!_0x574432){_0xfcc4ef[_0xe547('0x15')](0x194);}return _0x574432;};}function handleError(_0x4446fc,_0x5110ba){_0x5110ba=_0x5110ba||0x1f4;return function(_0x2edc91){logger['error'](_0x2edc91[_0xe547('0x22')]);if(_0x2edc91[_0xe547('0x23')]){delete _0x2edc91[_0xe547('0x23')];}_0x4446fc[_0xe547('0x16')](_0x5110ba)[_0xe547('0x24')](_0x2edc91);};}exports[_0xe547('0x25')]=function(_0x26cc04,_0x3e5614){var _0x372c64={},_0x4f66b0={},_0x3b9dc9={'count':0x0,'rows':[]};var _0x48f96e=db[_0xe547('0x26')]['rawAttributes'];_0x4f66b0[_0xe547('0x27')]=_[_0xe547('0x28')](_0x48f96e);_0x4f66b0[_0xe547('0x29')]=_[_0xe547('0x28')](_0x26cc04[_0xe547('0x29')]);_0x4f66b0[_0xe547('0x2a')]=_[_0xe547('0x2b')](_0x4f66b0[_0xe547('0x27')],_0x4f66b0['query']);_0x372c64['attributes']=_[_0xe547('0x2b')](_0x4f66b0['model'],qs[_0xe547('0x2c')](_0x26cc04[_0xe547('0x29')][_0xe547('0x2c')]));_0x372c64[_0xe547('0x2d')]=_0x372c64[_0xe547('0x2d')][_0xe547('0x2e')]?_0x372c64[_0xe547('0x2d')]:_0x4f66b0[_0xe547('0x27')];if(!_0x26cc04[_0xe547('0x29')][_0xe547('0x2f')]('nolimit')){_0x372c64['limit']=qs['limit'](_0x26cc04[_0xe547('0x29')]['limit']);_0x372c64[_0xe547('0x1a')]=qs[_0xe547('0x1a')](_0x26cc04[_0xe547('0x29')][_0xe547('0x1a')]);}_0x372c64[_0xe547('0x30')]=qs[_0xe547('0x31')](_0x26cc04['query'][_0xe547('0x31')]);_0x372c64[_0xe547('0x32')]=qs['filters'](_['pick'](_0x26cc04[_0xe547('0x29')],_0x4f66b0[_0xe547('0x2a')]));if(_0x26cc04[_0xe547('0x29')][_0xe547('0x33')]){_0x372c64[_0xe547('0x32')]=_[_0xe547('0x34')](_0x372c64[_0xe547('0x32')],{'$or':_[_0xe547('0x35')](_0x48f96e,function(_0x411a53){if(_0x411a53[_0xe547('0x36')][_0xe547('0x37')]!==_0xe547('0x38')){var _0xa39ef4={};_0xa39ef4[_0x411a53[_0xe547('0x39')]]={'$like':'%'+_0x26cc04['query']['filter']+'%'};return _0xa39ef4;}})});}_0x372c64=_[_0xe547('0x34')]({},_0x372c64,_0x26cc04['options']);var _0x573aed={'where':_0x372c64[_0xe547('0x32')]};return db['SquareRecording'][_0xe547('0x19')](_0x573aed)[_0xe547('0x20')](function(_0x504171){_0x3b9dc9[_0xe547('0x19')]=_0x504171;if(_0x26cc04['query'][_0xe547('0x3a')]){_0x372c64[_0xe547('0x3b')]=[{'all':!![]}];}return db[_0xe547('0x26')][_0xe547('0x3c')](_0x372c64);})['then'](function(_0x9e9e74){_0x3b9dc9[_0xe547('0x3d')]=_0x9e9e74;return _0x3b9dc9;})[_0xe547('0x20')](respondWithFilteredResult(_0x3e5614,_0x372c64))[_0xe547('0x3e')](handleError(_0x3e5614,null));};exports[_0xe547('0x3f')]=function(_0x4f9b44,_0x5e006f){var _0x3cc141={'raw':!![],'where':{'id':_0x4f9b44[_0xe547('0x40')]['id']}},_0x37db52={};_0x37db52[_0xe547('0x27')]=_['keys'](db[_0xe547('0x26')][_0xe547('0x41')]);_0x37db52['query']=_[_0xe547('0x28')](_0x4f9b44['query']);_0x37db52[_0xe547('0x2a')]=_[_0xe547('0x2b')](_0x37db52['model'],_0x37db52[_0xe547('0x29')]);_0x3cc141[_0xe547('0x2d')]=_[_0xe547('0x2b')](_0x37db52[_0xe547('0x27')],qs[_0xe547('0x2c')](_0x4f9b44[_0xe547('0x29')][_0xe547('0x2c')]));_0x3cc141['attributes']=_0x3cc141['attributes'][_0xe547('0x2e')]?_0x3cc141[_0xe547('0x2d')]:_0x37db52['model'];if(_0x4f9b44[_0xe547('0x29')][_0xe547('0x3a')]){_0x3cc141[_0xe547('0x3b')]=[{'all':!![]}];}_0x3cc141=_[_0xe547('0x34')]({},_0x3cc141,_0x4f9b44[_0xe547('0x42')]);return db['SquareRecording'][_0xe547('0x43')](_0x3cc141)['then'](handleEntityNotFound(_0x5e006f,null))[_0xe547('0x20')](respondWithResult(_0x5e006f,null))[_0xe547('0x3e')](handleError(_0x5e006f,null));};exports[_0xe547('0x44')]=function(_0x2405ed,_0x378e5e){return db[_0xe547('0x26')][_0xe547('0x44')](_0x2405ed[_0xe547('0x45')],{})[_0xe547('0x20')](respondWithResult(_0x378e5e,0xc9))['catch'](handleError(_0x378e5e,null));};exports[_0xe547('0x1f')]=function(_0x3dfceb,_0x1555b3){if(_0x3dfceb['body']['id']){delete _0x3dfceb[_0xe547('0x45')]['id'];}return db[_0xe547('0x26')][_0xe547('0x43')]({'where':{'id':_0x3dfceb['params']['id']}})[_0xe547('0x20')](handleEntityNotFound(_0x1555b3,null))['then'](saveUpdates(_0x3dfceb[_0xe547('0x45')],null))[_0xe547('0x20')](respondWithResult(_0x1555b3,null))['catch'](handleError(_0x1555b3,null));};exports[_0xe547('0x21')]=function(_0x21a950,_0x1ce3fe){return db[_0xe547('0x26')][_0xe547('0x43')]({'where':{'id':_0x21a950[_0xe547('0x40')]['id']}})[_0xe547('0x20')](handleEntityNotFound(_0x1ce3fe,null))['then'](removeEntity(_0x1ce3fe,null))[_0xe547('0x3e')](handleError(_0x1ce3fe,null));};exports['download']=function(_0x1b5bc8,_0x736dc3,_0x3eb44a){var _0x4aa816=require(_0xe547('0x46'));var _0xfd44fc=![];var _0x30aff9={};if(_0x1b5bc8[_0xe547('0x29')][_0xe547('0x36')]&&_0x1b5bc8[_0xe547('0x29')][_0xe547('0x36')]===_0xe547('0x47')){_0x30aff9['uniqueid']=_0x1b5bc8['params']['id'];}else{_0x30aff9['id']=_0x1b5bc8[_0xe547('0x40')]['id'];}return db['SquareRecording'][_0xe547('0x43')]({'where':_0x30aff9,'attributes':['id',_0xe547('0x48'),_0xe547('0x49')],'raw':!![]})[_0xe547('0x20')](handleEntityNotFound(_0x736dc3,null))[_0xe547('0x20')](function(_0x5365a3){if(_0x5365a3){var _0x39443a=util[_0xe547('0x4a')]('%s.cypher',_0x5365a3['value']);if(fs[_0xe547('0x4b')](_0x39443a)){_0xfd44fc=!![];return _0x4aa816[_0xe547('0x4c')](_0x39443a,_0x5365a3[_0xe547('0x48')],config[_0xe547('0x4d')][_0xe547('0x4e')])[_0xe547('0x20')](function(){return _0x5365a3;});}return _0x5365a3;}})[_0xe547('0x20')](function(_0x41fd8b){if(_0x41fd8b){if(!fs[_0xe547('0x4b')](_0x41fd8b[_0xe547('0x48')])){throw new db[(_0xe547('0x4f'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x41fd8b[_0xe547('0x49')]){return _0x736dc3[_0xe547('0x50')](_0x41fd8b['savePath'],_0x41fd8b['filename']+path[_0xe547('0x51')](_0x41fd8b[_0xe547('0x48')]),function(){if(_0xfd44fc){fs[_0xe547('0x52')](_0x41fd8b['savePath']);}});}else{return _0x736dc3[_0xe547('0x50')](_0x41fd8b[_0xe547('0x48')],function(_0x1d2dce){if(_0xfd44fc){fs[_0xe547('0x52')](_0x41fd8b['savePath']);}});}}})['catch'](handleError(_0x736dc3,null));}; \ No newline at end of file +var _0x495b=['papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','rows','params','length','find','catch','create','body','update','download','uniqueid','filename','%s.cypher','value','existsSync','decryptFile','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce'];(function(_0x527325,_0x3c2cab){var _0xc76221=function(_0x1af895){while(--_0x1af895){_0x527325['push'](_0x527325['shift']());}};_0xc76221(++_0x3c2cab);}(_0x495b,0x18a));var _0xb495=function(_0x55f119,_0x3801d6){_0x55f119=_0x55f119-0x0;var _0xf6a462=_0x495b[_0x55f119];return _0xf6a462;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb495('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb495('0x1'));var rp=require('request-promise');var moment=require(_0xb495('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb495('0x3'));var util=require(_0xb495('0x4'));var path=require(_0xb495('0x5'));var sox=require('sox');var csv=require(_0xb495('0x6'));var ejs=require(_0xb495('0x7'));var fs=require('fs');var _=require(_0xb495('0x8'));var squel=require(_0xb495('0x9'));var crypto=require('crypto');var jsforce=require(_0xb495('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb495('0x6'));var querystring=require('querystring');var Papa=require(_0xb495('0xb'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb495('0xc'));var Redis=require(_0xb495('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0xb495('0xe'))(_0xb495('0xf'));var utils=require(_0xb495('0x10'));var config=require('../../config/environment');var db=require(_0xb495('0x11'))['db'];function respondWithStatusCode(_0x4b698a,_0x4c0d4a){_0x4c0d4a=_0x4c0d4a||0xcc;return function(_0x327e83){if(_0x327e83){return _0x4b698a[_0xb495('0x12')](_0x4c0d4a);}return _0x4b698a[_0xb495('0x13')](_0x4c0d4a)[_0xb495('0x14')]();};}function respondWithResult(_0x53a618,_0x55f534){_0x55f534=_0x55f534||0xc8;return function(_0x18b029){if(_0x18b029){return _0x53a618['status'](_0x55f534)[_0xb495('0x15')](_0x18b029);}};}function respondWithFilteredResult(_0x1caf1c,_0x4ea2b7){return function(_0xedb196){if(_0xedb196){var _0x5c4849=_0xedb196[_0xb495('0x16')],_0x479a5b=_0x4ea2b7[_0xb495('0x17')],_0x39eb77=_0x4ea2b7[_0xb495('0x17')]+_0x4ea2b7[_0xb495('0x18')],_0x169044;if(_0x39eb77>=_0x5c4849){_0x39eb77=_0x5c4849;_0x169044=0xc8;}else{_0x169044=0xce;}_0x1caf1c[_0xb495('0x13')](_0x169044);return _0x1caf1c['set'](_0xb495('0x19'),_0x479a5b+'-'+_0x39eb77+'/'+_0x5c4849)[_0xb495('0x15')](_0xedb196);}return null;};}function patchUpdates(_0xd1a1b2){return function(_0x447cd2){try{jsonpatch[_0xb495('0x1a')](_0x447cd2,_0xd1a1b2,!![]);}catch(_0x14fdae){return BPromise[_0xb495('0x1b')](_0x14fdae);}return _0x447cd2[_0xb495('0x1c')]();};}function saveUpdates(_0x31f428,_0x4ed710){return function(_0x50bb50){if(_0x50bb50){return _0x50bb50['update'](_0x31f428)[_0xb495('0x1d')](function(_0xb203b6){return _0xb203b6;});}return null;};}function removeEntity(_0x3ad191,_0x58aa01){return function(_0x38b3b2){if(_0x38b3b2){return _0x38b3b2[_0xb495('0x1e')]()[_0xb495('0x1d')](function(){_0x3ad191['status'](0xcc)[_0xb495('0x14')]();});}};}function handleEntityNotFound(_0x4531e5,_0x446a77){return function(_0x4c431a){if(!_0x4c431a){_0x4531e5['sendStatus'](0x194);}return _0x4c431a;};}function handleError(_0x1c3af1,_0x39c969){_0x39c969=_0x39c969||0x1f4;return function(_0x1d3b02){logger[_0xb495('0x1f')](_0x1d3b02[_0xb495('0x20')]);if(_0x1d3b02['name']){delete _0x1d3b02[_0xb495('0x21')];}_0x1c3af1[_0xb495('0x13')](_0x39c969)[_0xb495('0x22')](_0x1d3b02);};}exports[_0xb495('0x23')]=function(_0x3a4159,_0x717c60){var _0x26b5e6={},_0x13f6f0={},_0x230156={'count':0x0,'rows':[]};var _0xad9d20=db[_0xb495('0x24')][_0xb495('0x25')];_0x13f6f0[_0xb495('0x26')]=_[_0xb495('0x27')](_0xad9d20);_0x13f6f0[_0xb495('0x28')]=_[_0xb495('0x27')](_0x3a4159[_0xb495('0x28')]);_0x13f6f0[_0xb495('0x29')]=_['intersection'](_0x13f6f0[_0xb495('0x26')],_0x13f6f0[_0xb495('0x28')]);_0x26b5e6[_0xb495('0x2a')]=_[_0xb495('0x2b')](_0x13f6f0['model'],qs['fields'](_0x3a4159[_0xb495('0x28')][_0xb495('0x2c')]));_0x26b5e6[_0xb495('0x2a')]=_0x26b5e6[_0xb495('0x2a')]['length']?_0x26b5e6[_0xb495('0x2a')]:_0x13f6f0[_0xb495('0x26')];if(!_0x3a4159['query'][_0xb495('0x2d')](_0xb495('0x2e'))){_0x26b5e6[_0xb495('0x18')]=qs['limit'](_0x3a4159['query'][_0xb495('0x18')]);_0x26b5e6[_0xb495('0x17')]=qs[_0xb495('0x17')](_0x3a4159[_0xb495('0x28')][_0xb495('0x17')]);}_0x26b5e6[_0xb495('0x2f')]=qs['sort'](_0x3a4159['query'][_0xb495('0x30')]);_0x26b5e6[_0xb495('0x31')]=qs['filters'](_['pick'](_0x3a4159[_0xb495('0x28')],_0x13f6f0[_0xb495('0x29')]));if(_0x3a4159['query'][_0xb495('0x32')]){_0x26b5e6[_0xb495('0x31')]=_['merge'](_0x26b5e6[_0xb495('0x31')],{'$or':_[_0xb495('0x33')](_0xad9d20,function(_0x5c05b4){if(_0x5c05b4[_0xb495('0x34')][_0xb495('0x35')]!==_0xb495('0x36')){var _0x2feb6a={};_0x2feb6a[_0x5c05b4[_0xb495('0x37')]]={'$like':'%'+_0x3a4159[_0xb495('0x28')][_0xb495('0x32')]+'%'};return _0x2feb6a;}})});}_0x26b5e6=_[_0xb495('0x38')]({},_0x26b5e6,_0x3a4159['options']);var _0x2c3473={'where':_0x26b5e6['where']};return db[_0xb495('0x24')]['count'](_0x2c3473)[_0xb495('0x1d')](function(_0x11fe76){_0x230156[_0xb495('0x16')]=_0x11fe76;if(_0x3a4159[_0xb495('0x28')][_0xb495('0x39')]){_0x26b5e6[_0xb495('0x3a')]=[{'all':!![]}];}return db[_0xb495('0x24')]['findAll'](_0x26b5e6);})[_0xb495('0x1d')](function(_0x254471){_0x230156[_0xb495('0x3b')]=_0x254471;return _0x230156;})['then'](respondWithFilteredResult(_0x717c60,_0x26b5e6))['catch'](handleError(_0x717c60,null));};exports['show']=function(_0x1fcec0,_0x35ee32){var _0x39ce67={'raw':!![],'where':{'id':_0x1fcec0[_0xb495('0x3c')]['id']}},_0x322f46={};_0x322f46['model']=_['keys'](db[_0xb495('0x24')][_0xb495('0x25')]);_0x322f46[_0xb495('0x28')]=_[_0xb495('0x27')](_0x1fcec0[_0xb495('0x28')]);_0x322f46[_0xb495('0x29')]=_[_0xb495('0x2b')](_0x322f46[_0xb495('0x26')],_0x322f46[_0xb495('0x28')]);_0x39ce67[_0xb495('0x2a')]=_[_0xb495('0x2b')](_0x322f46[_0xb495('0x26')],qs[_0xb495('0x2c')](_0x1fcec0[_0xb495('0x28')][_0xb495('0x2c')]));_0x39ce67[_0xb495('0x2a')]=_0x39ce67[_0xb495('0x2a')][_0xb495('0x3d')]?_0x39ce67['attributes']:_0x322f46['model'];if(_0x1fcec0[_0xb495('0x28')][_0xb495('0x39')]){_0x39ce67[_0xb495('0x3a')]=[{'all':!![]}];}_0x39ce67=_[_0xb495('0x38')]({},_0x39ce67,_0x1fcec0['options']);return db[_0xb495('0x24')][_0xb495('0x3e')](_0x39ce67)['then'](handleEntityNotFound(_0x35ee32,null))[_0xb495('0x1d')](respondWithResult(_0x35ee32,null))[_0xb495('0x3f')](handleError(_0x35ee32,null));};exports[_0xb495('0x40')]=function(_0x4f83c0,_0x8d71de){return db[_0xb495('0x24')]['create'](_0x4f83c0[_0xb495('0x41')],{})[_0xb495('0x1d')](respondWithResult(_0x8d71de,0xc9))['catch'](handleError(_0x8d71de,null));};exports[_0xb495('0x42')]=function(_0x2beb39,_0xfdd4df){if(_0x2beb39[_0xb495('0x41')]['id']){delete _0x2beb39[_0xb495('0x41')]['id'];}return db[_0xb495('0x24')][_0xb495('0x3e')]({'where':{'id':_0x2beb39[_0xb495('0x3c')]['id']}})['then'](handleEntityNotFound(_0xfdd4df,null))[_0xb495('0x1d')](saveUpdates(_0x2beb39[_0xb495('0x41')],null))[_0xb495('0x1d')](respondWithResult(_0xfdd4df,null))[_0xb495('0x3f')](handleError(_0xfdd4df,null));};exports[_0xb495('0x1e')]=function(_0x42cee7,_0x31e424){return db[_0xb495('0x24')][_0xb495('0x3e')]({'where':{'id':_0x42cee7['params']['id']}})[_0xb495('0x1d')](handleEntityNotFound(_0x31e424,null))[_0xb495('0x1d')](removeEntity(_0x31e424,null))[_0xb495('0x3f')](handleError(_0x31e424,null));};exports[_0xb495('0x43')]=function(_0x205526,_0x5b571b,_0x15c98d){var _0x28da69=require('../../components/encryptor');var _0x321dea=![];var _0x34b9e4={};if(_0x205526['query'][_0xb495('0x34')]&&_0x205526[_0xb495('0x28')][_0xb495('0x34')]==='uniqueid'){_0x34b9e4[_0xb495('0x44')]=_0x205526['params']['id'];}else{_0x34b9e4['id']=_0x205526['params']['id'];}return db[_0xb495('0x24')][_0xb495('0x3e')]({'where':_0x34b9e4,'attributes':['id','savePath',_0xb495('0x45')],'raw':!![]})[_0xb495('0x1d')](handleEntityNotFound(_0x5b571b,null))[_0xb495('0x1d')](function(_0x31f298){if(_0x31f298){var _0x464271=util['format'](_0xb495('0x46'),_0x31f298[_0xb495('0x47')]);if(fs[_0xb495('0x48')](_0x464271)){_0x321dea=!![];return _0x28da69[_0xb495('0x49')](_0x464271,_0x31f298['savePath'],config['secrets'][_0xb495('0x4a')])['then'](function(){return _0x31f298;});}return _0x31f298;}})[_0xb495('0x1d')](function(_0x2b26fa){if(_0x2b26fa){if(!fs[_0xb495('0x48')](_0x2b26fa[_0xb495('0x4b')])){throw new db[(_0xb495('0x4c'))][(_0xb495('0x4d'))](_0xb495('0x4e'));}if(_0x2b26fa[_0xb495('0x45')]){return _0x5b571b[_0xb495('0x43')](_0x2b26fa[_0xb495('0x4b')],_0x2b26fa[_0xb495('0x45')]+path[_0xb495('0x4f')](_0x2b26fa['savePath']),function(){if(_0x321dea){fs['unlink'](_0x2b26fa['savePath']);}});}else{return _0x5b571b[_0xb495('0x43')](_0x2b26fa[_0xb495('0x4b')],function(_0x24c6cc){if(_0x321dea){fs[_0xb495('0x50')](_0x2b26fa[_0xb495('0x4b')]);}});}}})['catch'](handleError(_0x5b571b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 514d5f7..50d96fa 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 _0x8784=['lodash','util','api','moment','bluebird','request-promise','./squareRecording.attributes','define','SquareRecording','square_recordings'];(function(_0x158f38,_0x57d7a5){var _0x212336=function(_0x292a46){while(--_0x292a46){_0x158f38['push'](_0x158f38['shift']());}};_0x212336(++_0x57d7a5);}(_0x8784,0x172));var _0x4878=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x8784[_0xf4666e];return _0x1853f1;};'use strict';var _=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var logger=require('../../config/logger')(_0x4878('0x2'));var moment=require(_0x4878('0x3'));var BPromise=require(_0x4878('0x4'));var rp=require(_0x4878('0x5'));var attributes=require(_0x4878('0x6'));module['exports']=function(_0x509521,_0x101d58){return _0x509521[_0x4878('0x7')](_0x4878('0x8'),attributes,{'tableName':_0x4878('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf4e=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','./squareRecording.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf4e,0x172));var _0xebf4=function(_0x3a0d56,_0x1082b5){_0x3a0d56=_0x3a0d56-0x0;var _0x17ffb7=_0xbf4e[_0x3a0d56];return _0x17ffb7;};'use strict';var _=require(_0xebf4('0x0'));var util=require(_0xebf4('0x1'));var logger=require(_0xebf4('0x2'))(_0xebf4('0x3'));var moment=require(_0xebf4('0x4'));var BPromise=require(_0xebf4('0x5'));var rp=require('request-promise');var attributes=require(_0xebf4('0x6'));module['exports']=function(_0x59cc54,_0x15328a){return _0x59cc54[_0xebf4('0x7')]('SquareRecording',attributes,{'tableName':_0xebf4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6c0691b..cab0a03 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 _0x4963=['request','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','create','body','raw','then','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1eea70,_0x10c98b){var _0x46720f=function(_0x2de6c9){while(--_0x2de6c9){_0x1eea70['push'](_0x1eea70['shift']());}};_0x46720f(++_0x10c98b);}(_0x4963,0x82));var _0x3496=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4963[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3496('0x0'));var moment=require('moment');var BPromise=require(_0x3496('0x1'));var rs=require(_0x3496('0x2'));var fs=require('fs');var Redis=require(_0x3496('0x3'));var db=require(_0x3496('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3496('0x5'));var config=require(_0x3496('0x6'));var jayson=require(_0x3496('0x7'));var client=jayson[_0x3496('0x8')][_0x3496('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cde24,_0x2a446b,_0x21b6e0){return new BPromise(function(_0x2923a2,_0x2ce27c){return client[_0x3496('0xa')](_0x5cde24,_0x21b6e0)['then'](function(_0xb95a3e){logger['info']('SquareRecording,\x20%s,\x20%s',_0x2a446b,_0x3496('0xb'));logger[_0x3496('0xc')](_0x3496('0xd'),_0x2a446b,_0x3496('0xb'),JSON[_0x3496('0xe')](_0xb95a3e));if(_0xb95a3e[_0x3496('0xf')]){if(_0xb95a3e[_0x3496('0xf')][_0x3496('0x10')]===0x1f4){logger['error'](_0x3496('0x11'),_0x2a446b,_0xb95a3e[_0x3496('0xf')][_0x3496('0x12')]);return _0x2ce27c(_0xb95a3e[_0x3496('0xf')][_0x3496('0x12')]);}logger[_0x3496('0xf')](_0x3496('0x11'),_0x2a446b,_0xb95a3e[_0x3496('0xf')]['message']);return _0x2923a2(_0xb95a3e[_0x3496('0xf')]['message']);}else{logger['info'](_0x3496('0x11'),_0x2a446b,_0x3496('0xb'));_0x2923a2(_0xb95a3e[_0x3496('0x13')]['message']);}})['catch'](function(_0x884b7c){logger[_0x3496('0xf')](_0x3496('0x11'),_0x2a446b,_0x884b7c);_0x2ce27c(_0x884b7c);});});}exports[_0x3496('0x14')]=function(_0x382f43){var _0x3b5109=this;return new Promise(function(_0x127acf,_0x4e3260){return db[_0x3496('0x15')][_0x3496('0x16')](_0x382f43[_0x3496('0x17')],{'raw':_0x382f43['options']?_0x382f43['options'][_0x3496('0x18')]===undefined?!![]:![]:!![]})[_0x3496('0x19')](function(_0x982a8f){logger[_0x3496('0x1a')]('CreateSquareRecording',_0x382f43);logger[_0x3496('0xc')]('CreateSquareRecording',_0x382f43,JSON['stringify'](_0x982a8f));_0x127acf(_0x982a8f);})[_0x3496('0x1b')](function(_0x1de483){logger[_0x3496('0xf')](_0x3496('0x14'),_0x1de483['message'],_0x382f43);_0x4e3260(_0x3b5109[_0x3496('0xf')](0x1f4,_0x1de483[_0x3496('0x12')]));});});}; \ No newline at end of file +var _0x6609=['SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','debug','CreateSquareRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','request','then','info','stringify','error'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x6609,0x1d8));var _0x9660=function(_0x28bbcc,_0x38d870){_0x28bbcc=_0x28bbcc-0x0;var _0x5bfd8a=_0x6609[_0x28bbcc];return _0x5bfd8a;};'use strict';var _=require('lodash');var util=require(_0x9660('0x0'));var moment=require(_0x9660('0x1'));var BPromise=require(_0x9660('0x2'));var rs=require(_0x9660('0x3'));var fs=require('fs');var Redis=require(_0x9660('0x4'));var db=require(_0x9660('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9660('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44e74c,_0x58f9c0,_0x24c17d){return new BPromise(function(_0x3a48e4,_0x3702cd){return client[_0x9660('0x7')](_0x44e74c,_0x24c17d)[_0x9660('0x8')](function(_0x480a10){logger[_0x9660('0x9')]('SquareRecording,\x20%s,\x20%s',_0x58f9c0,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x58f9c0,'request\x20sent',JSON[_0x9660('0xa')](_0x480a10));if(_0x480a10[_0x9660('0xb')]){if(_0x480a10[_0x9660('0xb')]['code']===0x1f4){logger['error'](_0x9660('0xc'),_0x58f9c0,_0x480a10[_0x9660('0xb')]['message']);return _0x3702cd(_0x480a10[_0x9660('0xb')][_0x9660('0xd')]);}logger[_0x9660('0xb')](_0x9660('0xc'),_0x58f9c0,_0x480a10[_0x9660('0xb')][_0x9660('0xd')]);return _0x3a48e4(_0x480a10[_0x9660('0xb')][_0x9660('0xd')]);}else{logger['info'](_0x9660('0xc'),_0x58f9c0,'request\x20sent');_0x3a48e4(_0x480a10[_0x9660('0xe')]['message']);}})[_0x9660('0xf')](function(_0x1a5771){logger[_0x9660('0xb')](_0x9660('0xc'),_0x58f9c0,_0x1a5771);_0x3702cd(_0x1a5771);});});}exports['CreateSquareRecording']=function(_0x1c84ae){var _0x45386c=this;return new Promise(function(_0x13e505,_0x4ee4cc){return db[_0x9660('0x10')][_0x9660('0x11')](_0x1c84ae[_0x9660('0x12')],{'raw':_0x1c84ae[_0x9660('0x13')]?_0x1c84ae[_0x9660('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x9660('0x8')](function(_0x34568c){logger[_0x9660('0x9')]('CreateSquareRecording',_0x1c84ae);logger[_0x9660('0x14')](_0x9660('0x15'),_0x1c84ae,JSON['stringify'](_0x34568c));_0x13e505(_0x34568c);})[_0x9660('0xf')](function(_0xe46d98){logger[_0x9660('0xb')](_0x9660('0x15'),_0xe46d98[_0x9660('0xd')],_0x1c84ae);_0x4ee4cc(_0x45386c['error'](0x1f4,_0xe46d98[_0x9660('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0038add..a4684e9 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 _0xbd88=['/:id','show','create','update','destroy','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xbd88,0x65));var _0x8bd8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xbd88[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8bd8('0x0'));var timeout=require('connect-timeout');var express=require(_0x8bd8('0x1'));var router=express['Router']();var auth=require(_0x8bd8('0x2'));var interaction=require(_0x8bd8('0x3'));var config=require(_0x8bd8('0x4'));var controller=require(_0x8bd8('0x5'));router[_0x8bd8('0x6')]('/',auth[_0x8bd8('0x7')](),controller[_0x8bd8('0x8')]);router[_0x8bd8('0x6')](_0x8bd8('0x9'),auth[_0x8bd8('0x7')](),controller[_0x8bd8('0xa')]);router['get'](_0x8bd8('0xb'),auth[_0x8bd8('0x7')](),controller[_0x8bd8('0xc')]);router['post']('/',auth[_0x8bd8('0x7')](),controller[_0x8bd8('0xd')]);router['put'](_0x8bd8('0xb'),auth[_0x8bd8('0x7')](),controller[_0x8bd8('0xe')]);router['delete'](_0x8bd8('0xb'),auth[_0x8bd8('0x7')](),controller[_0x8bd8('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb91b=['express','Router','../../components/auth/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','multer','util','path'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb91b,0x107));var _0xbb91=function(_0x4ef53b,_0x5851ae){_0x4ef53b=_0x4ef53b-0x0;var _0x4360f0=_0xb91b[_0x4ef53b];return _0x4360f0;};'use strict';var multer=require(_0xbb91('0x0'));var util=require(_0xbb91('0x1'));var path=require(_0xbb91('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb91('0x3'));var router=express[_0xbb91('0x4')]();var auth=require(_0xbb91('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb91('0x6'));var controller=require(_0xbb91('0x7'));router[_0xbb91('0x8')]('/',auth[_0xbb91('0x9')](),controller[_0xbb91('0xa')]);router[_0xbb91('0x8')](_0xbb91('0xb'),auth[_0xbb91('0x9')](),controller['describe']);router[_0xbb91('0x8')](_0xbb91('0xc'),auth['isAuthenticated'](),controller[_0xbb91('0xd')]);router[_0xbb91('0xe')]('/',auth[_0xbb91('0x9')](),controller['create']);router[_0xbb91('0xf')](_0xbb91('0xc'),auth['isAuthenticated'](),controller[_0xbb91('0x10')]);router[_0xbb91('0x11')]('/:id',auth[_0xbb91('0x9')](),controller[_0xbb91('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 475bfc8..d9aaaff 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 _0x47d6=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x58753b,_0x758801){var _0x5d97a4=function(_0x5da0e3){while(--_0x5da0e3){_0x58753b['push'](_0x58753b['shift']());}};_0x5d97a4(++_0x758801);}(_0x47d6,0x1de));var _0x647d=function(_0x1808d1,_0x2be484){_0x1808d1=_0x1808d1-0x0;var _0xc31d64=_0x47d6[_0x1808d1];return _0xc31d64;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'network':{'type':Sequelize[_0x647d('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x647d('0x2')]},'language':{'type':Sequelize[_0x647d('0x2')]},'type':{'type':Sequelize[_0x647d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x647d('0x2')]},'callerid':{'type':Sequelize[_0x647d('0x2')]},'calleridname':{'type':Sequelize[_0x647d('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x647d('0x2')]},'callington':{'type':Sequelize[_0x647d('0x2')]},'callingtns':{'type':Sequelize[_0x647d('0x2')]},'dnid':{'type':Sequelize[_0x647d('0x2')]},'rdnis':{'type':Sequelize[_0x647d('0x2')]},'context':{'type':Sequelize[_0x647d('0x2')]},'extension':{'type':Sequelize[_0x647d('0x2')]},'priority':{'type':Sequelize[_0x647d('0x2')]},'enhanced':{'type':Sequelize[_0x647d('0x2')]},'accountcode':{'type':Sequelize[_0x647d('0x2')]},'threadid':{'type':Sequelize[_0x647d('0x2')]},'project_name':{'type':Sequelize[_0x647d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x647d('0x3')]},'bot':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xd1d4=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2c755b,_0x68c77e){var _0xa6ef5c=function(_0x31c1a4){while(--_0x31c1a4){_0x2c755b['push'](_0x2c755b['shift']());}};_0xa6ef5c(++_0x68c77e);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xd1d4[_0x1abb09];return _0xea1c07;};'use strict';var Sequelize=require(_0x4d1d('0x0'));module[_0x4d1d('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x4d1d('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4d1d('0x2')]},'type':{'type':Sequelize[_0x4d1d('0x2')]},'uniqueid':{'type':Sequelize[_0x4d1d('0x2')]},'version':{'type':Sequelize[_0x4d1d('0x2')]},'callerid':{'type':Sequelize[_0x4d1d('0x2')]},'calleridname':{'type':Sequelize[_0x4d1d('0x2')]},'callingpres':{'type':Sequelize[_0x4d1d('0x2')]},'callingani2':{'type':Sequelize[_0x4d1d('0x2')]},'callington':{'type':Sequelize[_0x4d1d('0x2')]},'callingtns':{'type':Sequelize[_0x4d1d('0x2')]},'dnid':{'type':Sequelize[_0x4d1d('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4d1d('0x2')]},'priority':{'type':Sequelize[_0x4d1d('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4d1d('0x2')]},'threadid':{'type':Sequelize[_0x4d1d('0x2')]},'project_name':{'type':Sequelize[_0x4d1d('0x2')]},'joinAt':{'type':Sequelize[_0x4d1d('0x3')]},'leaveAt':{'type':Sequelize[_0x4d1d('0x3')]},'bot':{'type':Sequelize[_0x4d1d('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 18d0cab..1022e8b 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 _0x77e0=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','querystring','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4ef032,_0x717c95){var _0x5a6ac8=function(_0x5b8ba2){while(--_0x5b8ba2){_0x4ef032['push'](_0x4ef032['shift']());}};_0x5a6ac8(++_0x717c95);}(_0x77e0,0xcd));var _0x077e=function(_0xd589b1,_0x2b560a){_0xd589b1=_0xd589b1-0x0;var _0x43a424=_0x77e0[_0xd589b1];return _0x43a424;};'use strict';var pdf=require(_0x077e('0x0'));var emlformat=require(_0x077e('0x1'));var rimraf=require(_0x077e('0x2'));var zipdir=require(_0x077e('0x3'));var jsonpatch=require(_0x077e('0x4'));var rp=require(_0x077e('0x5'));var moment=require(_0x077e('0x6'));var BPromise=require(_0x077e('0x7'));var Mustache=require(_0x077e('0x8'));var util=require(_0x077e('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x077e('0xa'));var ejs=require(_0x077e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x077e('0xc'));var crypto=require(_0x077e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x077e('0xa'));var querystring=require(_0x077e('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x077e('0xf'));var Redis=require('ioredis');var qs=require(_0x077e('0x10'));var logger=require('../../config/logger')(_0x077e('0x11'));var utils=require(_0x077e('0x12'));var config=require('../../config/environment');var db=require(_0x077e('0x13'))['db'];function respondWithStatusCode(_0x1c834c,_0x452ddb){_0x452ddb=_0x452ddb||0xcc;return function(_0x5349b5){if(_0x5349b5){return _0x1c834c[_0x077e('0x14')](_0x452ddb);}return _0x1c834c[_0x077e('0x15')](_0x452ddb)[_0x077e('0x16')]();};}function respondWithResult(_0x265631,_0x5007b0){_0x5007b0=_0x5007b0||0xc8;return function(_0x3c8385){if(_0x3c8385){return _0x265631[_0x077e('0x15')](_0x5007b0)[_0x077e('0x17')](_0x3c8385);}};}function respondWithFilteredResult(_0x564780,_0x275758){return function(_0x24a0ca){if(_0x24a0ca){var _0x2724c1=_0x24a0ca[_0x077e('0x18')],_0x2dd196=_0x275758[_0x077e('0x19')],_0x49f3e7=_0x275758['offset']+_0x275758[_0x077e('0x1a')],_0x5d7e7f;if(_0x49f3e7>=_0x2724c1){_0x49f3e7=_0x2724c1;_0x5d7e7f=0xc8;}else{_0x5d7e7f=0xce;}_0x564780['status'](_0x5d7e7f);return _0x564780[_0x077e('0x1b')]('Content-Range',_0x2dd196+'-'+_0x49f3e7+'/'+_0x2724c1)[_0x077e('0x17')](_0x24a0ca);}return null;};}function patchUpdates(_0x498f36){return function(_0x29ed18){try{jsonpatch[_0x077e('0x1c')](_0x29ed18,_0x498f36,!![]);}catch(_0x117d0d){return BPromise[_0x077e('0x1d')](_0x117d0d);}return _0x29ed18['save']();};}function saveUpdates(_0x47510c,_0x4ff4f4){return function(_0x209254){if(_0x209254){return _0x209254[_0x077e('0x1e')](_0x47510c)[_0x077e('0x1f')](function(_0x4ab07b){return _0x4ab07b;});}return null;};}function removeEntity(_0x2d5bbf,_0x477683){return function(_0x5ec9ab){if(_0x5ec9ab){return _0x5ec9ab[_0x077e('0x20')]()[_0x077e('0x1f')](function(){_0x2d5bbf[_0x077e('0x15')](0xcc)[_0x077e('0x16')]();});}};}function handleEntityNotFound(_0x4d4072,_0x18cfec){return function(_0x131e34){if(!_0x131e34){_0x4d4072[_0x077e('0x14')](0x194);}return _0x131e34;};}function handleError(_0xd1d2f5,_0x12aa74){_0x12aa74=_0x12aa74||0x1f4;return function(_0x449702){logger[_0x077e('0x21')](_0x449702[_0x077e('0x22')]);if(_0x449702['name']){delete _0x449702[_0x077e('0x23')];}_0xd1d2f5[_0x077e('0x15')](_0x12aa74)[_0x077e('0x24')](_0x449702);};}exports[_0x077e('0x25')]=function(_0x18c902,_0x57e261){var _0x44a13b={},_0x577136={},_0x303c7f={'count':0x0,'rows':[]};var _0x5e71e3=db[_0x077e('0x26')][_0x077e('0x27')];_0x577136['model']=_[_0x077e('0x28')](_0x5e71e3);_0x577136[_0x077e('0x29')]=_['keys'](_0x18c902[_0x077e('0x29')]);_0x577136[_0x077e('0x2a')]=_[_0x077e('0x2b')](_0x577136[_0x077e('0x2c')],_0x577136['query']);_0x44a13b[_0x077e('0x2d')]=_[_0x077e('0x2b')](_0x577136[_0x077e('0x2c')],qs[_0x077e('0x2e')](_0x18c902['query'][_0x077e('0x2e')]));_0x44a13b[_0x077e('0x2d')]=_0x44a13b[_0x077e('0x2d')][_0x077e('0x2f')]?_0x44a13b['attributes']:_0x577136[_0x077e('0x2c')];if(!_0x18c902[_0x077e('0x29')]['hasOwnProperty'](_0x077e('0x30'))){_0x44a13b['limit']=qs[_0x077e('0x1a')](_0x18c902[_0x077e('0x29')][_0x077e('0x1a')]);_0x44a13b[_0x077e('0x19')]=qs[_0x077e('0x19')](_0x18c902['query']['offset']);}_0x44a13b[_0x077e('0x31')]=qs[_0x077e('0x32')](_0x18c902[_0x077e('0x29')]['sort']);_0x44a13b[_0x077e('0x33')]=qs['filters'](_[_0x077e('0x34')](_0x18c902[_0x077e('0x29')],_0x577136[_0x077e('0x2a')]));if(_0x18c902[_0x077e('0x29')][_0x077e('0x35')]){_0x44a13b['where']=_[_0x077e('0x36')](_0x44a13b[_0x077e('0x33')],{'$or':_[_0x077e('0x37')](_0x5e71e3,function(_0x5cfd91){if(_0x5cfd91['type'][_0x077e('0x38')]!==_0x077e('0x39')){var _0x1194b2={};_0x1194b2[_0x5cfd91[_0x077e('0x3a')]]={'$like':'%'+_0x18c902[_0x077e('0x29')]['filter']+'%'};return _0x1194b2;}})});}_0x44a13b=_[_0x077e('0x36')]({},_0x44a13b,_0x18c902[_0x077e('0x3b')]);var _0x56bfe1={'where':_0x44a13b[_0x077e('0x33')]};return db[_0x077e('0x26')][_0x077e('0x18')](_0x56bfe1)[_0x077e('0x1f')](function(_0x3aeb5f){_0x303c7f[_0x077e('0x18')]=_0x3aeb5f;if(_0x18c902['query'][_0x077e('0x3c')]){_0x44a13b[_0x077e('0x3d')]=[{'all':!![]}];}return db['SquareReport'][_0x077e('0x3e')](_0x44a13b);})[_0x077e('0x1f')](function(_0x3b1077){_0x303c7f[_0x077e('0x3f')]=_0x3b1077;return _0x303c7f;})[_0x077e('0x1f')](respondWithFilteredResult(_0x57e261,_0x44a13b))[_0x077e('0x40')](handleError(_0x57e261,null));};exports[_0x077e('0x41')]=function(_0x588b9f,_0x51f7ea){var _0x2c2d9b={'raw':!![],'where':{'id':_0x588b9f[_0x077e('0x42')]['id']}},_0x3914e3={};_0x3914e3[_0x077e('0x2c')]=_[_0x077e('0x28')](db[_0x077e('0x26')][_0x077e('0x27')]);_0x3914e3['query']=_['keys'](_0x588b9f['query']);_0x3914e3[_0x077e('0x2a')]=_['intersection'](_0x3914e3[_0x077e('0x2c')],_0x3914e3['query']);_0x2c2d9b[_0x077e('0x2d')]=_[_0x077e('0x2b')](_0x3914e3[_0x077e('0x2c')],qs[_0x077e('0x2e')](_0x588b9f[_0x077e('0x29')][_0x077e('0x2e')]));_0x2c2d9b[_0x077e('0x2d')]=_0x2c2d9b[_0x077e('0x2d')][_0x077e('0x2f')]?_0x2c2d9b['attributes']:_0x3914e3[_0x077e('0x2c')];if(_0x588b9f['query'][_0x077e('0x3c')]){_0x2c2d9b['include']=[{'all':!![]}];}_0x2c2d9b=_['merge']({},_0x2c2d9b,_0x588b9f[_0x077e('0x3b')]);return db[_0x077e('0x26')][_0x077e('0x43')](_0x2c2d9b)[_0x077e('0x1f')](handleEntityNotFound(_0x51f7ea,null))[_0x077e('0x1f')](respondWithResult(_0x51f7ea,null))[_0x077e('0x40')](handleError(_0x51f7ea,null));};exports['create']=function(_0x240b56,_0x53dc9c){return db['SquareReport'][_0x077e('0x44')](_0x240b56[_0x077e('0x45')],{})[_0x077e('0x1f')](respondWithResult(_0x53dc9c,0xc9))[_0x077e('0x40')](handleError(_0x53dc9c,null));};exports[_0x077e('0x1e')]=function(_0x1e9b94,_0x5e8905){if(_0x1e9b94['body']['id']){delete _0x1e9b94['body']['id'];}return db[_0x077e('0x26')][_0x077e('0x43')]({'where':{'id':_0x1e9b94[_0x077e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e8905,null))['then'](saveUpdates(_0x1e9b94[_0x077e('0x45')],null))['then'](respondWithResult(_0x5e8905,null))['catch'](handleError(_0x5e8905,null));};exports[_0x077e('0x20')]=function(_0x24cde1,_0x41aa72){return db[_0x077e('0x26')][_0x077e('0x43')]({'where':{'id':_0x24cde1[_0x077e('0x42')]['id']}})[_0x077e('0x1f')](handleEntityNotFound(_0x41aa72,null))['then'](removeEntity(_0x41aa72,null))[_0x077e('0x40')](handleError(_0x41aa72,null));};exports['describe']=function(_0x2cd3be,_0x25be01){return db[_0x077e('0x26')]['describe']()[_0x077e('0x1f')](respondWithResult(_0x25be01,null))[_0x077e('0x40')](handleError(_0x25be01,null));}; \ No newline at end of file +var _0xfde6=['reject','update','then','destroy','end','stack','name','index','SquareReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','rows','show','params','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply'];(function(_0x281168,_0x2b8acd){var _0x1edac9=function(_0x48f468){while(--_0x48f468){_0x281168['push'](_0x281168['shift']());}};_0x1edac9(++_0x2b8acd);}(_0xfde6,0xaf));var _0x6fde=function(_0xde6990,_0x562051){_0xde6990=_0xde6990-0x0;var _0x4582bf=_0xfde6[_0xde6990];return _0x4582bf;};'use strict';var pdf=require(_0x6fde('0x0'));var emlformat=require(_0x6fde('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6fde('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fde('0x3'));var moment=require('moment');var BPromise=require(_0x6fde('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6fde('0x5'));var sox=require(_0x6fde('0x6'));var csv=require(_0x6fde('0x7'));var ejs=require(_0x6fde('0x8'));var fs=require('fs');var _=require(_0x6fde('0x9'));var squel=require('squel');var crypto=require(_0x6fde('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6fde('0x7'));var querystring=require(_0x6fde('0xb'));var Papa=require(_0x6fde('0xc'));var authService=require(_0x6fde('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x6fde('0xe'));var qs=require(_0x6fde('0xf'));var logger=require(_0x6fde('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6fde('0x11'))['db'];function respondWithStatusCode(_0x9f12b2,_0x4a6818){_0x4a6818=_0x4a6818||0xcc;return function(_0xca0a68){if(_0xca0a68){return _0x9f12b2[_0x6fde('0x12')](_0x4a6818);}return _0x9f12b2[_0x6fde('0x13')](_0x4a6818)['end']();};}function respondWithResult(_0x5cd334,_0x76f72e){_0x76f72e=_0x76f72e||0xc8;return function(_0xffd2a7){if(_0xffd2a7){return _0x5cd334['status'](_0x76f72e)[_0x6fde('0x14')](_0xffd2a7);}};}function respondWithFilteredResult(_0x3f99ce,_0x3b1ffa){return function(_0x57e469){if(_0x57e469){var _0x518c97=_0x57e469[_0x6fde('0x15')],_0x1955b0=_0x3b1ffa[_0x6fde('0x16')],_0x391690=_0x3b1ffa[_0x6fde('0x16')]+_0x3b1ffa['limit'],_0x5d7897;if(_0x391690>=_0x518c97){_0x391690=_0x518c97;_0x5d7897=0xc8;}else{_0x5d7897=0xce;}_0x3f99ce[_0x6fde('0x13')](_0x5d7897);return _0x3f99ce[_0x6fde('0x17')](_0x6fde('0x18'),_0x1955b0+'-'+_0x391690+'/'+_0x518c97)[_0x6fde('0x14')](_0x57e469);}return null;};}function patchUpdates(_0x48fe28){return function(_0x5af3d4){try{jsonpatch[_0x6fde('0x19')](_0x5af3d4,_0x48fe28,!![]);}catch(_0x431429){return BPromise[_0x6fde('0x1a')](_0x431429);}return _0x5af3d4['save']();};}function saveUpdates(_0x6fd89d,_0x4110a0){return function(_0x129eff){if(_0x129eff){return _0x129eff[_0x6fde('0x1b')](_0x6fd89d)[_0x6fde('0x1c')](function(_0x59080e){return _0x59080e;});}return null;};}function removeEntity(_0x34d968,_0x158765){return function(_0x50e524){if(_0x50e524){return _0x50e524[_0x6fde('0x1d')]()['then'](function(){_0x34d968[_0x6fde('0x13')](0xcc)[_0x6fde('0x1e')]();});}};}function handleEntityNotFound(_0x54155d,_0x3c1226){return function(_0x3e059d){if(!_0x3e059d){_0x54155d[_0x6fde('0x12')](0x194);}return _0x3e059d;};}function handleError(_0xac859b,_0x4e88ef){_0x4e88ef=_0x4e88ef||0x1f4;return function(_0x218a17){logger['error'](_0x218a17[_0x6fde('0x1f')]);if(_0x218a17['name']){delete _0x218a17[_0x6fde('0x20')];}_0xac859b[_0x6fde('0x13')](_0x4e88ef)['send'](_0x218a17);};}exports[_0x6fde('0x21')]=function(_0x1adf12,_0x3ef3a1){var _0x1ce7fa={},_0x521e5d={},_0x21b223={'count':0x0,'rows':[]};var _0x25599c=db[_0x6fde('0x22')][_0x6fde('0x23')];_0x521e5d[_0x6fde('0x24')]=_[_0x6fde('0x25')](_0x25599c);_0x521e5d[_0x6fde('0x26')]=_[_0x6fde('0x25')](_0x1adf12[_0x6fde('0x26')]);_0x521e5d['filters']=_[_0x6fde('0x27')](_0x521e5d[_0x6fde('0x24')],_0x521e5d[_0x6fde('0x26')]);_0x1ce7fa['attributes']=_[_0x6fde('0x27')](_0x521e5d[_0x6fde('0x24')],qs['fields'](_0x1adf12[_0x6fde('0x26')][_0x6fde('0x28')]));_0x1ce7fa['attributes']=_0x1ce7fa[_0x6fde('0x29')][_0x6fde('0x2a')]?_0x1ce7fa[_0x6fde('0x29')]:_0x521e5d[_0x6fde('0x24')];if(!_0x1adf12[_0x6fde('0x26')][_0x6fde('0x2b')]('nolimit')){_0x1ce7fa['limit']=qs[_0x6fde('0x2c')](_0x1adf12['query']['limit']);_0x1ce7fa[_0x6fde('0x16')]=qs[_0x6fde('0x16')](_0x1adf12[_0x6fde('0x26')]['offset']);}_0x1ce7fa[_0x6fde('0x2d')]=qs[_0x6fde('0x2e')](_0x1adf12[_0x6fde('0x26')]['sort']);_0x1ce7fa[_0x6fde('0x2f')]=qs[_0x6fde('0x30')](_[_0x6fde('0x31')](_0x1adf12['query'],_0x521e5d[_0x6fde('0x30')]));if(_0x1adf12[_0x6fde('0x26')][_0x6fde('0x32')]){_0x1ce7fa[_0x6fde('0x2f')]=_[_0x6fde('0x33')](_0x1ce7fa[_0x6fde('0x2f')],{'$or':_[_0x6fde('0x34')](_0x25599c,function(_0x2b7c26){if(_0x2b7c26[_0x6fde('0x35')][_0x6fde('0x36')]!=='VIRTUAL'){var _0x156bd7={};_0x156bd7[_0x2b7c26[_0x6fde('0x37')]]={'$like':'%'+_0x1adf12[_0x6fde('0x26')]['filter']+'%'};return _0x156bd7;}})});}_0x1ce7fa=_['merge']({},_0x1ce7fa,_0x1adf12[_0x6fde('0x38')]);var _0x4fe73f={'where':_0x1ce7fa[_0x6fde('0x2f')]};return db[_0x6fde('0x22')]['count'](_0x4fe73f)[_0x6fde('0x1c')](function(_0x416b17){_0x21b223[_0x6fde('0x15')]=_0x416b17;if(_0x1adf12['query'][_0x6fde('0x39')]){_0x1ce7fa[_0x6fde('0x3a')]=[{'all':!![]}];}return db[_0x6fde('0x22')]['findAll'](_0x1ce7fa);})[_0x6fde('0x1c')](function(_0x4d02a6){_0x21b223[_0x6fde('0x3b')]=_0x4d02a6;return _0x21b223;})['then'](respondWithFilteredResult(_0x3ef3a1,_0x1ce7fa))['catch'](handleError(_0x3ef3a1,null));};exports[_0x6fde('0x3c')]=function(_0x1b35bc,_0x2108b9){var _0xf7d96e={'raw':!![],'where':{'id':_0x1b35bc[_0x6fde('0x3d')]['id']}},_0x19e82a={};_0x19e82a['model']=_[_0x6fde('0x25')](db[_0x6fde('0x22')][_0x6fde('0x23')]);_0x19e82a[_0x6fde('0x26')]=_['keys'](_0x1b35bc[_0x6fde('0x26')]);_0x19e82a['filters']=_[_0x6fde('0x27')](_0x19e82a['model'],_0x19e82a[_0x6fde('0x26')]);_0xf7d96e[_0x6fde('0x29')]=_[_0x6fde('0x27')](_0x19e82a[_0x6fde('0x24')],qs[_0x6fde('0x28')](_0x1b35bc[_0x6fde('0x26')][_0x6fde('0x28')]));_0xf7d96e[_0x6fde('0x29')]=_0xf7d96e['attributes'][_0x6fde('0x2a')]?_0xf7d96e[_0x6fde('0x29')]:_0x19e82a['model'];if(_0x1b35bc[_0x6fde('0x26')][_0x6fde('0x39')]){_0xf7d96e[_0x6fde('0x3a')]=[{'all':!![]}];}_0xf7d96e=_[_0x6fde('0x33')]({},_0xf7d96e,_0x1b35bc[_0x6fde('0x38')]);return db[_0x6fde('0x22')][_0x6fde('0x3e')](_0xf7d96e)[_0x6fde('0x1c')](handleEntityNotFound(_0x2108b9,null))[_0x6fde('0x1c')](respondWithResult(_0x2108b9,null))[_0x6fde('0x3f')](handleError(_0x2108b9,null));};exports['create']=function(_0x56308d,_0x348bc8){return db[_0x6fde('0x22')][_0x6fde('0x40')](_0x56308d[_0x6fde('0x41')],{})[_0x6fde('0x1c')](respondWithResult(_0x348bc8,0xc9))[_0x6fde('0x3f')](handleError(_0x348bc8,null));};exports[_0x6fde('0x1b')]=function(_0x4ff10a,_0x407eab){if(_0x4ff10a[_0x6fde('0x41')]['id']){delete _0x4ff10a['body']['id'];}return db[_0x6fde('0x22')]['find']({'where':{'id':_0x4ff10a[_0x6fde('0x3d')]['id']}})['then'](handleEntityNotFound(_0x407eab,null))[_0x6fde('0x1c')](saveUpdates(_0x4ff10a['body'],null))[_0x6fde('0x1c')](respondWithResult(_0x407eab,null))['catch'](handleError(_0x407eab,null));};exports[_0x6fde('0x1d')]=function(_0x136a4b,_0x214c5f){return db[_0x6fde('0x22')][_0x6fde('0x3e')]({'where':{'id':_0x136a4b[_0x6fde('0x3d')]['id']}})['then'](handleEntityNotFound(_0x214c5f,null))[_0x6fde('0x1c')](removeEntity(_0x214c5f,null))[_0x6fde('0x3f')](handleError(_0x214c5f,null));};exports['describe']=function(_0x26386c,_0x4acde7){return db['SquareReport'][_0x6fde('0x42')]()['then'](respondWithResult(_0x4acde7,null))[_0x6fde('0x3f')](handleError(_0x4acde7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ae36100..514349d 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 _0xc046=['exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','request-promise','./squareReport.attributes'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xc046,0x1bf));var _0x6c04=function(_0x477ef3,_0x4fd20a){_0x477ef3=_0x477ef3-0x0;var _0x3f8e00=_0xc046[_0x477ef3];return _0x3f8e00;};'use strict';var _=require(_0x6c04('0x0'));var util=require('util');var logger=require(_0x6c04('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c04('0x2'));var attributes=require(_0x6c04('0x3'));module[_0x6c04('0x4')]=function(_0x215722,_0xae16f2){return _0x215722['define'](_0x6c04('0x5'),attributes,{'tableName':_0x6c04('0x6'),'paranoid':![],'indexes':[{'name':_0x6c04('0x7'),'fields':[_0x6c04('0x8'),_0x6c04('0x9')]},{'name':_0x6c04('0xa'),'fields':[_0x6c04('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14e4=['leaveAt','lodash','util','bluebird','request-promise','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name'];(function(_0x2a1cb5,_0xbb55a9){var _0x4b61cf=function(_0x575871){while(--_0x575871){_0x2a1cb5['push'](_0x2a1cb5['shift']());}};_0x4b61cf(++_0xbb55a9);}(_0x14e4,0x15d));var _0x414e=function(_0x45e56c,_0x1c4df4){_0x45e56c=_0x45e56c-0x0;var _0x4dab0e=_0x14e4[_0x45e56c];return _0x4dab0e;};'use strict';var _=require(_0x414e('0x0'));var util=require(_0x414e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x414e('0x2'));var rp=require(_0x414e('0x3'));var attributes=require(_0x414e('0x4'));module[_0x414e('0x5')]=function(_0xdcdbb5,_0x7cce4e){return _0xdcdbb5[_0x414e('0x6')]('SquareReport',attributes,{'tableName':_0x414e('0x7'),'paranoid':![],'indexes':[{'name':_0x414e('0x8'),'fields':[_0x414e('0x9'),_0x414e('0xa')]},{'name':_0x414e('0xb'),'fields':[_0x414e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ace13b6..f509ed4 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 _0x4cfa=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareReport','create','body','options','UpdateSquareReport','SquareReport','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x399a68,_0x32b703){var _0x283d8c=function(_0x22a206){while(--_0x22a206){_0x399a68['push'](_0x399a68['shift']());}};_0x283d8c(++_0x32b703);}(_0x4cfa,0x7c));var _0xa4cf=function(_0x4a9bdd,_0x5098f5){_0x4a9bdd=_0x4a9bdd-0x0;var _0x1ba3a4=_0x4cfa[_0x4a9bdd];return _0x1ba3a4;};'use strict';var _=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var moment=require(_0xa4cf('0x2'));var BPromise=require(_0xa4cf('0x3'));var rs=require(_0xa4cf('0x4'));var fs=require('fs');var Redis=require(_0xa4cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4cf('0x6'));var logger=require(_0xa4cf('0x7'))(_0xa4cf('0x8'));var config=require('../../config/environment');var jayson=require(_0xa4cf('0x9'));var client=jayson[_0xa4cf('0xa')][_0xa4cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x279f5b,_0x174ab7,_0x4c9c37){return new BPromise(function(_0x38eae3,_0xeb3767){return client[_0xa4cf('0xc')](_0x279f5b,_0x4c9c37)[_0xa4cf('0xd')](function(_0xb1b938){logger[_0xa4cf('0xe')](_0xa4cf('0xf'),_0x174ab7,_0xa4cf('0x10'));logger[_0xa4cf('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x174ab7,'request\x20sent',JSON[_0xa4cf('0x12')](_0xb1b938));if(_0xb1b938[_0xa4cf('0x13')]){if(_0xb1b938[_0xa4cf('0x13')]['code']===0x1f4){logger[_0xa4cf('0x13')](_0xa4cf('0xf'),_0x174ab7,_0xb1b938[_0xa4cf('0x13')]['message']);return _0xeb3767(_0xb1b938[_0xa4cf('0x13')][_0xa4cf('0x14')]);}logger['error'](_0xa4cf('0xf'),_0x174ab7,_0xb1b938[_0xa4cf('0x13')][_0xa4cf('0x14')]);return _0x38eae3(_0xb1b938[_0xa4cf('0x13')]['message']);}else{logger[_0xa4cf('0xe')](_0xa4cf('0xf'),_0x174ab7,_0xa4cf('0x10'));_0x38eae3(_0xb1b938[_0xa4cf('0x15')][_0xa4cf('0x14')]);}})[_0xa4cf('0x16')](function(_0x8aeb88){logger[_0xa4cf('0x13')](_0xa4cf('0xf'),_0x174ab7,_0x8aeb88);_0xeb3767(_0x8aeb88);});});}exports[_0xa4cf('0x17')]=function(_0x581c1f){var _0x2581a3=this;return new Promise(function(_0x1c3042,_0xb12da1){return db['SquareReport'][_0xa4cf('0x18')](_0x581c1f[_0xa4cf('0x19')],{'raw':_0x581c1f['options']?_0x581c1f[_0xa4cf('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5c3e5f){logger[_0xa4cf('0xe')](_0xa4cf('0x17'),_0x581c1f);logger[_0xa4cf('0x11')](_0xa4cf('0x17'),_0x581c1f,JSON[_0xa4cf('0x12')](_0x5c3e5f));_0x1c3042(_0x5c3e5f);})['catch'](function(_0x404f9b){logger['error'](_0xa4cf('0x17'),_0x404f9b[_0xa4cf('0x14')],_0x581c1f);_0xb12da1(_0x2581a3[_0xa4cf('0x13')](0x1f4,_0x404f9b['message']));});});};exports[_0xa4cf('0x1b')]=function(_0x16851d){var _0x503dc7=this;return new Promise(function(_0x58bdd6,_0xad656){return db[_0xa4cf('0x1c')]['update'](_0x16851d[_0xa4cf('0x19')],{'raw':_0x16851d[_0xa4cf('0x1a')]?_0x16851d[_0xa4cf('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16851d['options']?_0x16851d['options'][_0xa4cf('0x1d')]||null:null,'attributes':_0x16851d[_0xa4cf('0x1a')]?_0x16851d[_0xa4cf('0x1a')][_0xa4cf('0x1e')]||null:null,'limit':_0x16851d['options']?_0x16851d[_0xa4cf('0x1a')][_0xa4cf('0x1f')]||null:null})[_0xa4cf('0xd')](function(_0x262865){logger[_0xa4cf('0xe')](_0xa4cf('0x1b'),_0x16851d);logger[_0xa4cf('0x11')](_0xa4cf('0x1b'),_0x16851d,JSON[_0xa4cf('0x12')](_0x262865));_0x58bdd6(_0x262865);})[_0xa4cf('0x16')](function(_0x35c830){logger[_0xa4cf('0x13')](_0xa4cf('0x1b'),_0x35c830[_0xa4cf('0x14')],_0x16851d);_0xad656(_0x503dc7[_0xa4cf('0x13')](0x1f4,_0x35c830[_0xa4cf('0x14')]));});});}; \ No newline at end of file +var _0xeb7e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareReport,\x20%s,\x20%s','info','result','catch','CreateSquareReport','SquareReport','create','options','raw','then','UpdateSquareReport','update','body','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35994e,_0x3968be){var _0x1dc2e=function(_0x5443ed){while(--_0x5443ed){_0x35994e['push'](_0x35994e['shift']());}};_0x1dc2e(++_0x3968be);}(_0xeb7e,0x1f2));var _0xeeb7=function(_0x1177f3,_0xd22df2){_0x1177f3=_0x1177f3-0x0;var _0x2805de=_0xeb7e[_0x1177f3];return _0x2805de;};'use strict';var _=require(_0xeeb7('0x0'));var util=require(_0xeeb7('0x1'));var moment=require(_0xeeb7('0x2'));var BPromise=require(_0xeeb7('0x3'));var rs=require(_0xeeb7('0x4'));var fs=require('fs');var Redis=require(_0xeeb7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeeb7('0x6'));var logger=require(_0xeeb7('0x7'))(_0xeeb7('0x8'));var config=require(_0xeeb7('0x9'));var jayson=require(_0xeeb7('0xa'));var client=jayson[_0xeeb7('0xb')][_0xeeb7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25372f,_0x508ebf,_0x19de00){return new BPromise(function(_0xa90e90,_0x4f6290){return client[_0xeeb7('0xd')](_0x25372f,_0x19de00)['then'](function(_0x2709dc){logger['info']('SquareReport,\x20%s,\x20%s',_0x508ebf,'request\x20sent');logger[_0xeeb7('0xe')](_0xeeb7('0xf'),_0x508ebf,_0xeeb7('0x10'),JSON[_0xeeb7('0x11')](_0x2709dc));if(_0x2709dc[_0xeeb7('0x12')]){if(_0x2709dc['error'][_0xeeb7('0x13')]===0x1f4){logger[_0xeeb7('0x12')]('SquareReport,\x20%s,\x20%s',_0x508ebf,_0x2709dc['error'][_0xeeb7('0x14')]);return _0x4f6290(_0x2709dc[_0xeeb7('0x12')][_0xeeb7('0x14')]);}logger[_0xeeb7('0x12')](_0xeeb7('0x15'),_0x508ebf,_0x2709dc[_0xeeb7('0x12')][_0xeeb7('0x14')]);return _0xa90e90(_0x2709dc['error'][_0xeeb7('0x14')]);}else{logger[_0xeeb7('0x16')]('SquareReport,\x20%s,\x20%s',_0x508ebf,_0xeeb7('0x10'));_0xa90e90(_0x2709dc[_0xeeb7('0x17')][_0xeeb7('0x14')]);}})[_0xeeb7('0x18')](function(_0x2c1e23){logger[_0xeeb7('0x12')](_0xeeb7('0x15'),_0x508ebf,_0x2c1e23);_0x4f6290(_0x2c1e23);});});}exports[_0xeeb7('0x19')]=function(_0x39c0dd){var _0x3b1ce2=this;return new Promise(function(_0x1e6d93,_0x12309b){return db[_0xeeb7('0x1a')][_0xeeb7('0x1b')](_0x39c0dd['body'],{'raw':_0x39c0dd[_0xeeb7('0x1c')]?_0x39c0dd[_0xeeb7('0x1c')][_0xeeb7('0x1d')]===undefined?!![]:![]:!![]})[_0xeeb7('0x1e')](function(_0x443d36){logger['info']('CreateSquareReport',_0x39c0dd);logger[_0xeeb7('0xe')]('CreateSquareReport',_0x39c0dd,JSON[_0xeeb7('0x11')](_0x443d36));_0x1e6d93(_0x443d36);})[_0xeeb7('0x18')](function(_0x435408){logger[_0xeeb7('0x12')](_0xeeb7('0x19'),_0x435408[_0xeeb7('0x14')],_0x39c0dd);_0x12309b(_0x3b1ce2[_0xeeb7('0x12')](0x1f4,_0x435408[_0xeeb7('0x14')]));});});};exports[_0xeeb7('0x1f')]=function(_0x53fe29){var _0x80db94=this;return new Promise(function(_0x19c3ab,_0x10ca33){return db['SquareReport'][_0xeeb7('0x20')](_0x53fe29[_0xeeb7('0x21')],{'raw':_0x53fe29[_0xeeb7('0x1c')]?_0x53fe29[_0xeeb7('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53fe29[_0xeeb7('0x1c')]?_0x53fe29[_0xeeb7('0x1c')][_0xeeb7('0x22')]||null:null,'attributes':_0x53fe29[_0xeeb7('0x1c')]?_0x53fe29[_0xeeb7('0x1c')][_0xeeb7('0x23')]||null:null,'limit':_0x53fe29[_0xeeb7('0x1c')]?_0x53fe29['options']['limit']||null:null})['then'](function(_0x5ef864){logger['info'](_0xeeb7('0x1f'),_0x53fe29);logger['debug'](_0xeeb7('0x1f'),_0x53fe29,JSON[_0xeeb7('0x11')](_0x5ef864));_0x19c3ab(_0x5ef864);})[_0xeeb7('0x18')](function(_0x581e0b){logger[_0xeeb7('0x12')](_0xeeb7('0x1f'),_0x581e0b[_0xeeb7('0x14')],_0x53fe29);_0x10ca33(_0x80db94[_0xeeb7('0x12')](0x1f4,_0x581e0b[_0xeeb7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 618f832..91e0a45 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 _0xf425=['get','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x4ec1a0,_0x4a88ed){var _0xa51344=function(_0x325f37){while(--_0x325f37){_0x4ec1a0['push'](_0x4ec1a0['shift']());}};_0xa51344(++_0x4a88ed);}(_0xf425,0x1de));var _0x5f42=function(_0x56a616,_0x5a3c7c){_0x56a616=_0x56a616-0x0;var _0xe94844=_0xf425[_0x56a616];return _0xe94844;};'use strict';var multer=require(_0x5f42('0x0'));var util=require(_0x5f42('0x1'));var path=require(_0x5f42('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f42('0x3'));var router=express[_0x5f42('0x4')]();var auth=require(_0x5f42('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5f42('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0x5f42('0x7')](),controller['index']);router[_0x5f42('0x8')]('/describe',auth[_0x5f42('0x7')](),controller[_0x5f42('0x9')]);router[_0x5f42('0x8')]('/:id',auth[_0x5f42('0x7')](),controller[_0x5f42('0xa')]);router[_0x5f42('0xb')]('/',auth['isAuthenticated'](),controller[_0x5f42('0xc')]);router[_0x5f42('0xd')](_0x5f42('0xe'),auth[_0x5f42('0x7')](),controller[_0x5f42('0xf')]);router[_0x5f42('0x10')](_0x5f42('0xe'),auth[_0x5f42('0x7')](),controller['destroy']);module[_0x5f42('0x11')]=router; \ No newline at end of file +var _0x24f6=['connect-timeout','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x12c59b,_0x4219ca){var _0x2a3339=function(_0xb46b85){while(--_0xb46b85){_0x12c59b['push'](_0x12c59b['shift']());}};_0x2a3339(++_0x4219ca);}(_0x24f6,0x1da));var _0x624f=function(_0x2e2104,_0x11287d){_0x2e2104=_0x2e2104-0x0;var _0x1280c5=_0x24f6[_0x2e2104];return _0x1280c5;};'use strict';var multer=require(_0x624f('0x0'));var util=require('util');var path=require(_0x624f('0x1'));var timeout=require(_0x624f('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x624f('0x3'));var controller=require('./squareReportDetail.controller');router[_0x624f('0x4')]('/',auth[_0x624f('0x5')](),controller[_0x624f('0x6')]);router[_0x624f('0x4')]('/describe',auth[_0x624f('0x5')](),controller[_0x624f('0x7')]);router['get'](_0x624f('0x8'),auth['isAuthenticated'](),controller[_0x624f('0x9')]);router[_0x624f('0xa')]('/',auth[_0x624f('0x5')](),controller[_0x624f('0xb')]);router[_0x624f('0xc')](_0x624f('0x8'),auth[_0x624f('0x5')](),controller[_0x624f('0xd')]);router[_0x624f('0xe')](_0x624f('0x8'),auth['isAuthenticated'](),controller[_0x624f('0xf')]);module[_0x624f('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 589e7de..9bf94f8 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 _0x23ba=['TEXT','sequelize','exports','STRING'];(function(_0x1f7903,_0x2886e7){var _0x45e8ac=function(_0x525dc6){while(--_0x525dc6){_0x1f7903['push'](_0x1f7903['shift']());}};_0x45e8ac(++_0x2886e7);}(_0x23ba,0x1b1));var _0xa23b=function(_0x3c6c82,_0x2e7a0a){_0x3c6c82=_0x3c6c82-0x0;var _0x30873f=_0x23ba[_0x3c6c82];return _0x30873f;};'use strict';var Sequelize=require(_0xa23b('0x0'));module[_0xa23b('0x1')]={'uniqueid':{'type':Sequelize[_0xa23b('0x2')]},'node':{'type':Sequelize[_0xa23b('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa23b('0x3')]},'project_name':{'type':Sequelize[_0xa23b('0x2')]},'callerid':{'type':Sequelize[_0xa23b('0x2')]}}; \ No newline at end of file +var _0xa849=['exports','STRING','TEXT','sequelize'];(function(_0x385101,_0x396ad1){var _0x5b836f=function(_0x56def3){while(--_0x56def3){_0x385101['push'](_0x385101['shift']());}};_0x5b836f(++_0x396ad1);}(_0xa849,0xcb));var _0x9a84=function(_0x4bb306,_0x3b396d){_0x4bb306=_0x4bb306-0x0;var _0xb21ad1=_0xa849[_0x4bb306];return _0xb21ad1;};'use strict';var Sequelize=require(_0x9a84('0x0'));module[_0x9a84('0x1')]={'uniqueid':{'type':Sequelize[_0x9a84('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x9a84('0x2')]},'data':{'type':Sequelize[_0x9a84('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9a84('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3c1152c..2231b69 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 _0xe165=['then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','index','SquareDetailsReport','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge'];(function(_0x146598,_0x197b29){var _0x477034=function(_0xeb55e){while(--_0xeb55e){_0x146598['push'](_0x146598['shift']());}};_0x477034(++_0x197b29);}(_0xe165,0x190));var _0x5e16=function(_0x1475d8,_0x56c85a){_0x1475d8=_0x1475d8-0x0;var _0x229128=_0xe165[_0x1475d8];return _0x229128;};'use strict';var pdf=require(_0x5e16('0x0'));var emlformat=require(_0x5e16('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5e16('0x2'));var jsonpatch=require(_0x5e16('0x3'));var rp=require(_0x5e16('0x4'));var moment=require(_0x5e16('0x5'));var BPromise=require(_0x5e16('0x6'));var Mustache=require(_0x5e16('0x7'));var util=require(_0x5e16('0x8'));var path=require(_0x5e16('0x9'));var sox=require(_0x5e16('0xa'));var csv=require(_0x5e16('0xb'));var ejs=require(_0x5e16('0xc'));var fs=require('fs');var _=require(_0x5e16('0xd'));var squel=require('squel');var crypto=require(_0x5e16('0xe'));var jsforce=require(_0x5e16('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e16('0x10'));var Papa=require(_0x5e16('0x11'));var authService=require(_0x5e16('0x12'));var hardwareService=require(_0x5e16('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x5e16('0x14'))('api');var utils=require(_0x5e16('0x15'));var config=require(_0x5e16('0x16'));var db=require(_0x5e16('0x17'))['db'];function respondWithStatusCode(_0x4b2432,_0x441a41){_0x441a41=_0x441a41||0xcc;return function(_0x23016a){if(_0x23016a){return _0x4b2432['sendStatus'](_0x441a41);}return _0x4b2432[_0x5e16('0x18')](_0x441a41)[_0x5e16('0x19')]();};}function respondWithResult(_0x2a8c6f,_0x32a114){_0x32a114=_0x32a114||0xc8;return function(_0x120562){if(_0x120562){return _0x2a8c6f[_0x5e16('0x18')](_0x32a114)[_0x5e16('0x1a')](_0x120562);}};}function respondWithFilteredResult(_0x3b989a,_0x597913){return function(_0x5aab76){if(_0x5aab76){var _0x32b445=_0x5aab76[_0x5e16('0x1b')],_0x8fd5f4=_0x597913[_0x5e16('0x1c')],_0xaa1327=_0x597913[_0x5e16('0x1c')]+_0x597913[_0x5e16('0x1d')],_0x539846;if(_0xaa1327>=_0x32b445){_0xaa1327=_0x32b445;_0x539846=0xc8;}else{_0x539846=0xce;}_0x3b989a['status'](_0x539846);return _0x3b989a[_0x5e16('0x1e')](_0x5e16('0x1f'),_0x8fd5f4+'-'+_0xaa1327+'/'+_0x32b445)['json'](_0x5aab76);}return null;};}function patchUpdates(_0x28acee){return function(_0x40d4ce){try{jsonpatch[_0x5e16('0x20')](_0x40d4ce,_0x28acee,!![]);}catch(_0x12b8b2){return BPromise[_0x5e16('0x21')](_0x12b8b2);}return _0x40d4ce[_0x5e16('0x22')]();};}function saveUpdates(_0x49bfae,_0x5779b1){return function(_0x5b6541){if(_0x5b6541){return _0x5b6541[_0x5e16('0x23')](_0x49bfae)['then'](function(_0x840047){return _0x840047;});}return null;};}function removeEntity(_0x55bb16,_0x20f6bb){return function(_0x28c3c2){if(_0x28c3c2){return _0x28c3c2['destroy']()['then'](function(){_0x55bb16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e039b,_0x451c40){return function(_0x455d61){if(!_0x455d61){_0x5e039b[_0x5e16('0x24')](0x194);}return _0x455d61;};}function handleError(_0x3c8151,_0xea6b0e){_0xea6b0e=_0xea6b0e||0x1f4;return function(_0x4b77e7){logger[_0x5e16('0x25')](_0x4b77e7[_0x5e16('0x26')]);if(_0x4b77e7[_0x5e16('0x27')]){delete _0x4b77e7[_0x5e16('0x27')];}_0x3c8151[_0x5e16('0x18')](_0xea6b0e)[_0x5e16('0x28')](_0x4b77e7);};}exports[_0x5e16('0x29')]=function(_0x40f962,_0x337b85){var _0x591cab={},_0x13e5dd={},_0x2c9273={'count':0x0,'rows':[]};var _0x3f10d3=db[_0x5e16('0x2a')]['rawAttributes'];_0x13e5dd[_0x5e16('0x2b')]=_[_0x5e16('0x2c')](_0x3f10d3);_0x13e5dd[_0x5e16('0x2d')]=_[_0x5e16('0x2c')](_0x40f962[_0x5e16('0x2d')]);_0x13e5dd[_0x5e16('0x2e')]=_[_0x5e16('0x2f')](_0x13e5dd[_0x5e16('0x2b')],_0x13e5dd[_0x5e16('0x2d')]);_0x591cab['attributes']=_[_0x5e16('0x2f')](_0x13e5dd[_0x5e16('0x2b')],qs['fields'](_0x40f962[_0x5e16('0x2d')][_0x5e16('0x30')]));_0x591cab['attributes']=_0x591cab[_0x5e16('0x31')][_0x5e16('0x32')]?_0x591cab[_0x5e16('0x31')]:_0x13e5dd[_0x5e16('0x2b')];if(!_0x40f962['query']['hasOwnProperty']('nolimit')){_0x591cab[_0x5e16('0x1d')]=qs['limit'](_0x40f962['query'][_0x5e16('0x1d')]);_0x591cab[_0x5e16('0x1c')]=qs[_0x5e16('0x1c')](_0x40f962[_0x5e16('0x2d')]['offset']);}_0x591cab[_0x5e16('0x33')]=qs['sort'](_0x40f962['query'][_0x5e16('0x34')]);_0x591cab['where']=qs[_0x5e16('0x2e')](_[_0x5e16('0x35')](_0x40f962['query'],_0x13e5dd[_0x5e16('0x2e')]));if(_0x40f962[_0x5e16('0x2d')][_0x5e16('0x36')]){_0x591cab[_0x5e16('0x37')]=_['merge'](_0x591cab['where'],{'$or':_[_0x5e16('0x38')](_0x3f10d3,function(_0x59e6ef){if(_0x59e6ef[_0x5e16('0x39')][_0x5e16('0x3a')]!==_0x5e16('0x3b')){var _0x6a40d2={};_0x6a40d2[_0x59e6ef[_0x5e16('0x3c')]]={'$like':'%'+_0x40f962[_0x5e16('0x2d')]['filter']+'%'};return _0x6a40d2;}})});}_0x591cab=_[_0x5e16('0x3d')]({},_0x591cab,_0x40f962['options']);var _0x1bdb0d={'where':_0x591cab[_0x5e16('0x37')]};return db[_0x5e16('0x2a')][_0x5e16('0x1b')](_0x1bdb0d)[_0x5e16('0x3e')](function(_0x4d5d7d){_0x2c9273[_0x5e16('0x1b')]=_0x4d5d7d;if(_0x40f962['query'][_0x5e16('0x3f')]){_0x591cab[_0x5e16('0x40')]=[{'all':!![]}];}return db[_0x5e16('0x2a')][_0x5e16('0x41')](_0x591cab);})[_0x5e16('0x3e')](function(_0x438968){_0x2c9273[_0x5e16('0x42')]=_0x438968;return _0x2c9273;})['then'](respondWithFilteredResult(_0x337b85,_0x591cab))[_0x5e16('0x43')](handleError(_0x337b85,null));};exports[_0x5e16('0x44')]=function(_0x6f46b2,_0x52eadc){var _0x3f3aaa={'raw':!![],'where':{'id':_0x6f46b2[_0x5e16('0x45')]['id']}},_0x5019f9={};_0x5019f9[_0x5e16('0x2b')]=_['keys'](db[_0x5e16('0x2a')][_0x5e16('0x46')]);_0x5019f9[_0x5e16('0x2d')]=_[_0x5e16('0x2c')](_0x6f46b2['query']);_0x5019f9[_0x5e16('0x2e')]=_[_0x5e16('0x2f')](_0x5019f9[_0x5e16('0x2b')],_0x5019f9['query']);_0x3f3aaa['attributes']=_[_0x5e16('0x2f')](_0x5019f9['model'],qs[_0x5e16('0x30')](_0x6f46b2[_0x5e16('0x2d')][_0x5e16('0x30')]));_0x3f3aaa[_0x5e16('0x31')]=_0x3f3aaa[_0x5e16('0x31')][_0x5e16('0x32')]?_0x3f3aaa['attributes']:_0x5019f9[_0x5e16('0x2b')];if(_0x6f46b2['query'][_0x5e16('0x3f')]){_0x3f3aaa[_0x5e16('0x40')]=[{'all':!![]}];}_0x3f3aaa=_[_0x5e16('0x3d')]({},_0x3f3aaa,_0x6f46b2[_0x5e16('0x47')]);return db[_0x5e16('0x2a')][_0x5e16('0x48')](_0x3f3aaa)['then'](handleEntityNotFound(_0x52eadc,null))['then'](respondWithResult(_0x52eadc,null))['catch'](handleError(_0x52eadc,null));};exports[_0x5e16('0x49')]=function(_0x32fd8d,_0x2084dd){return db[_0x5e16('0x2a')][_0x5e16('0x49')](_0x32fd8d[_0x5e16('0x4a')],{})['then'](respondWithResult(_0x2084dd,0xc9))['catch'](handleError(_0x2084dd,null));};exports[_0x5e16('0x23')]=function(_0x49717f,_0x3948a1){if(_0x49717f[_0x5e16('0x4a')]['id']){delete _0x49717f[_0x5e16('0x4a')]['id'];}return db[_0x5e16('0x2a')][_0x5e16('0x48')]({'where':{'id':_0x49717f[_0x5e16('0x45')]['id']}})[_0x5e16('0x3e')](handleEntityNotFound(_0x3948a1,null))[_0x5e16('0x3e')](saveUpdates(_0x49717f[_0x5e16('0x4a')],null))[_0x5e16('0x3e')](respondWithResult(_0x3948a1,null))[_0x5e16('0x43')](handleError(_0x3948a1,null));};exports[_0x5e16('0x4b')]=function(_0x129e3a,_0x591bd2){return db['SquareDetailsReport'][_0x5e16('0x48')]({'where':{'id':_0x129e3a[_0x5e16('0x45')]['id']}})[_0x5e16('0x3e')](handleEntityNotFound(_0x591bd2,null))[_0x5e16('0x3e')](removeEntity(_0x591bd2,null))[_0x5e16('0x43')](handleError(_0x591bd2,null));};exports[_0x5e16('0x4c')]=function(_0x407f19,_0x53858a){return db[_0x5e16('0x2a')][_0x5e16('0x4c')]()[_0x5e16('0x3e')](respondWithResult(_0x53858a,null))[_0x5e16('0x43')](handleError(_0x53858a,null));}; \ No newline at end of file +var _0xb63f=['order','sort','where','pick','filter','map','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','then','destroy','end','error','stack','name','index','SquareDetailsReport','rawAttributes','keys','query','filters','intersection','model','attributes','length','limit'];(function(_0x58b542,_0x368cd1){var _0x4ad771=function(_0x11d23d){while(--_0x11d23d){_0x58b542['push'](_0x58b542['shift']());}};_0x4ad771(++_0x368cd1);}(_0xb63f,0xa3));var _0xfb63=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0xb63f[_0x9e0cb3];return _0x5926b7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfb63('0x0'));var zipdir=require(_0xfb63('0x1'));var jsonpatch=require(_0xfb63('0x2'));var rp=require(_0xfb63('0x3'));var moment=require(_0xfb63('0x4'));var BPromise=require(_0xfb63('0x5'));var Mustache=require(_0xfb63('0x6'));var util=require(_0xfb63('0x7'));var path=require(_0xfb63('0x8'));var sox=require('sox');var csv=require(_0xfb63('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfb63('0xa'));var squel=require(_0xfb63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb63('0x9'));var querystring=require(_0xfb63('0xc'));var Papa=require(_0xfb63('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xfb63('0xe'));var Redis=require(_0xfb63('0xf'));var qs=require(_0xfb63('0x10'));var logger=require(_0xfb63('0x11'))(_0xfb63('0x12'));var utils=require(_0xfb63('0x13'));var config=require(_0xfb63('0x14'));var db=require(_0xfb63('0x15'))['db'];function respondWithStatusCode(_0x4946b0,_0x52bb98){_0x52bb98=_0x52bb98||0xcc;return function(_0xee69d){if(_0xee69d){return _0x4946b0[_0xfb63('0x16')](_0x52bb98);}return _0x4946b0[_0xfb63('0x17')](_0x52bb98)['end']();};}function respondWithResult(_0x2e0b54,_0x3b425f){_0x3b425f=_0x3b425f||0xc8;return function(_0x48a22c){if(_0x48a22c){return _0x2e0b54[_0xfb63('0x17')](_0x3b425f)[_0xfb63('0x18')](_0x48a22c);}};}function respondWithFilteredResult(_0x3a4fb8,_0x1b3d4d){return function(_0x51e7ef){if(_0x51e7ef){var _0x44619e=_0x51e7ef[_0xfb63('0x19')],_0x48e2c0=_0x1b3d4d[_0xfb63('0x1a')],_0x19f196=_0x1b3d4d[_0xfb63('0x1a')]+_0x1b3d4d['limit'],_0x24cd53;if(_0x19f196>=_0x44619e){_0x19f196=_0x44619e;_0x24cd53=0xc8;}else{_0x24cd53=0xce;}_0x3a4fb8[_0xfb63('0x17')](_0x24cd53);return _0x3a4fb8['set'](_0xfb63('0x1b'),_0x48e2c0+'-'+_0x19f196+'/'+_0x44619e)['json'](_0x51e7ef);}return null;};}function patchUpdates(_0x31f41c){return function(_0x3dc969){try{jsonpatch[_0xfb63('0x1c')](_0x3dc969,_0x31f41c,!![]);}catch(_0x452f1e){return BPromise['reject'](_0x452f1e);}return _0x3dc969[_0xfb63('0x1d')]();};}function saveUpdates(_0x57e2a8,_0x26d109){return function(_0x3ef0cf){if(_0x3ef0cf){return _0x3ef0cf['update'](_0x57e2a8)[_0xfb63('0x1e')](function(_0x23c4fb){return _0x23c4fb;});}return null;};}function removeEntity(_0x52ef91,_0x1a5943){return function(_0x43bf68){if(_0x43bf68){return _0x43bf68[_0xfb63('0x1f')]()[_0xfb63('0x1e')](function(){_0x52ef91[_0xfb63('0x17')](0xcc)[_0xfb63('0x20')]();});}};}function handleEntityNotFound(_0x17f81e,_0x1bbedc){return function(_0x43c245){if(!_0x43c245){_0x17f81e[_0xfb63('0x16')](0x194);}return _0x43c245;};}function handleError(_0x3d21b5,_0x1e5bd7){_0x1e5bd7=_0x1e5bd7||0x1f4;return function(_0x2d453a){logger[_0xfb63('0x21')](_0x2d453a[_0xfb63('0x22')]);if(_0x2d453a[_0xfb63('0x23')]){delete _0x2d453a[_0xfb63('0x23')];}_0x3d21b5[_0xfb63('0x17')](_0x1e5bd7)['send'](_0x2d453a);};}exports[_0xfb63('0x24')]=function(_0x4c80c1,_0x4d728c){var _0x2035d2={},_0x44c0a5={},_0xaad3a4={'count':0x0,'rows':[]};var _0x15588f=db[_0xfb63('0x25')][_0xfb63('0x26')];_0x44c0a5['model']=_[_0xfb63('0x27')](_0x15588f);_0x44c0a5[_0xfb63('0x28')]=_[_0xfb63('0x27')](_0x4c80c1[_0xfb63('0x28')]);_0x44c0a5[_0xfb63('0x29')]=_[_0xfb63('0x2a')](_0x44c0a5[_0xfb63('0x2b')],_0x44c0a5[_0xfb63('0x28')]);_0x2035d2[_0xfb63('0x2c')]=_[_0xfb63('0x2a')](_0x44c0a5[_0xfb63('0x2b')],qs['fields'](_0x4c80c1[_0xfb63('0x28')]['fields']));_0x2035d2[_0xfb63('0x2c')]=_0x2035d2[_0xfb63('0x2c')][_0xfb63('0x2d')]?_0x2035d2['attributes']:_0x44c0a5['model'];if(!_0x4c80c1[_0xfb63('0x28')]['hasOwnProperty']('nolimit')){_0x2035d2[_0xfb63('0x2e')]=qs['limit'](_0x4c80c1[_0xfb63('0x28')][_0xfb63('0x2e')]);_0x2035d2[_0xfb63('0x1a')]=qs[_0xfb63('0x1a')](_0x4c80c1[_0xfb63('0x28')][_0xfb63('0x1a')]);}_0x2035d2[_0xfb63('0x2f')]=qs[_0xfb63('0x30')](_0x4c80c1['query']['sort']);_0x2035d2[_0xfb63('0x31')]=qs['filters'](_[_0xfb63('0x32')](_0x4c80c1[_0xfb63('0x28')],_0x44c0a5[_0xfb63('0x29')]));if(_0x4c80c1[_0xfb63('0x28')][_0xfb63('0x33')]){_0x2035d2['where']=_['merge'](_0x2035d2[_0xfb63('0x31')],{'$or':_[_0xfb63('0x34')](_0x15588f,function(_0x4d972d){if(_0x4d972d['type']['key']!==_0xfb63('0x35')){var _0x370ce2={};_0x370ce2[_0x4d972d[_0xfb63('0x36')]]={'$like':'%'+_0x4c80c1['query'][_0xfb63('0x33')]+'%'};return _0x370ce2;}})});}_0x2035d2=_[_0xfb63('0x37')]({},_0x2035d2,_0x4c80c1[_0xfb63('0x38')]);var _0xf438d3={'where':_0x2035d2[_0xfb63('0x31')]};return db[_0xfb63('0x25')][_0xfb63('0x19')](_0xf438d3)['then'](function(_0x4bbf1b){_0xaad3a4[_0xfb63('0x19')]=_0x4bbf1b;if(_0x4c80c1['query'][_0xfb63('0x39')]){_0x2035d2[_0xfb63('0x3a')]=[{'all':!![]}];}return db[_0xfb63('0x25')][_0xfb63('0x3b')](_0x2035d2);})[_0xfb63('0x1e')](function(_0x38ecc3){_0xaad3a4[_0xfb63('0x3c')]=_0x38ecc3;return _0xaad3a4;})[_0xfb63('0x1e')](respondWithFilteredResult(_0x4d728c,_0x2035d2))[_0xfb63('0x3d')](handleError(_0x4d728c,null));};exports[_0xfb63('0x3e')]=function(_0x3d745a,_0x3aff25){var _0x1417a4={'raw':!![],'where':{'id':_0x3d745a[_0xfb63('0x3f')]['id']}},_0x32b25c={};_0x32b25c[_0xfb63('0x2b')]=_[_0xfb63('0x27')](db[_0xfb63('0x25')][_0xfb63('0x26')]);_0x32b25c[_0xfb63('0x28')]=_[_0xfb63('0x27')](_0x3d745a['query']);_0x32b25c['filters']=_[_0xfb63('0x2a')](_0x32b25c['model'],_0x32b25c[_0xfb63('0x28')]);_0x1417a4[_0xfb63('0x2c')]=_[_0xfb63('0x2a')](_0x32b25c[_0xfb63('0x2b')],qs[_0xfb63('0x40')](_0x3d745a[_0xfb63('0x28')][_0xfb63('0x40')]));_0x1417a4[_0xfb63('0x2c')]=_0x1417a4[_0xfb63('0x2c')][_0xfb63('0x2d')]?_0x1417a4[_0xfb63('0x2c')]:_0x32b25c[_0xfb63('0x2b')];if(_0x3d745a['query'][_0xfb63('0x39')]){_0x1417a4[_0xfb63('0x3a')]=[{'all':!![]}];}_0x1417a4=_[_0xfb63('0x37')]({},_0x1417a4,_0x3d745a[_0xfb63('0x38')]);return db[_0xfb63('0x25')][_0xfb63('0x41')](_0x1417a4)[_0xfb63('0x1e')](handleEntityNotFound(_0x3aff25,null))[_0xfb63('0x1e')](respondWithResult(_0x3aff25,null))[_0xfb63('0x3d')](handleError(_0x3aff25,null));};exports['create']=function(_0xa39bf3,_0x393f63){return db[_0xfb63('0x25')][_0xfb63('0x42')](_0xa39bf3[_0xfb63('0x43')],{})[_0xfb63('0x1e')](respondWithResult(_0x393f63,0xc9))['catch'](handleError(_0x393f63,null));};exports[_0xfb63('0x44')]=function(_0x376396,_0x1eb65c){if(_0x376396[_0xfb63('0x43')]['id']){delete _0x376396[_0xfb63('0x43')]['id'];}return db[_0xfb63('0x25')][_0xfb63('0x41')]({'where':{'id':_0x376396[_0xfb63('0x3f')]['id']}})[_0xfb63('0x1e')](handleEntityNotFound(_0x1eb65c,null))['then'](saveUpdates(_0x376396[_0xfb63('0x43')],null))[_0xfb63('0x1e')](respondWithResult(_0x1eb65c,null))[_0xfb63('0x3d')](handleError(_0x1eb65c,null));};exports[_0xfb63('0x1f')]=function(_0x27a179,_0x1f0478){return db[_0xfb63('0x25')][_0xfb63('0x41')]({'where':{'id':_0x27a179[_0xfb63('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1f0478,null))[_0xfb63('0x1e')](removeEntity(_0x1f0478,null))[_0xfb63('0x3d')](handleError(_0x1f0478,null));};exports[_0xfb63('0x45')]=function(_0x2365ed,_0x1cd24a){return db[_0xfb63('0x25')]['describe']()[_0xfb63('0x1e')](respondWithResult(_0x1cd24a,null))[_0xfb63('0x3d')](handleError(_0x1cd24a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 99032a5..21cc4fd 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 _0xf804=['bluebird','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','util','../../config/logger','api'];(function(_0x47746e,_0x5e6ee3){var _0x5d0860=function(_0x5bbd83){while(--_0x5bbd83){_0x47746e['push'](_0x47746e['shift']());}};_0x5d0860(++_0x5e6ee3);}(_0xf804,0xe5));var _0x4f80=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf804[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4f80('0x0'));var logger=require(_0x4f80('0x1'))(_0x4f80('0x2'));var moment=require('moment');var BPromise=require(_0x4f80('0x3'));var rp=require('request-promise');var attributes=require(_0x4f80('0x4'));module['exports']=function(_0x4f4e74,_0x77fe70){return _0x4f4e74[_0x4f80('0x5')](_0x4f80('0x6'),attributes,{'tableName':_0x4f80('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7f2=['bluebird','request-promise','SquareDetailsReport','lodash','../../config/logger','api','moment'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xe7f2,0x1b5));var _0x2e7f=function(_0x28889e,_0xf6a96d){_0x28889e=_0x28889e-0x0;var _0x5159ed=_0xe7f2[_0x28889e];return _0x5159ed;};'use strict';var _=require(_0x2e7f('0x0'));var util=require('util');var logger=require(_0x2e7f('0x1'))(_0x2e7f('0x2'));var moment=require(_0x2e7f('0x3'));var BPromise=require(_0x2e7f('0x4'));var rp=require(_0x2e7f('0x5'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x45d8cd,_0x5dc906){return _0x45d8cd['define'](_0x2e7f('0x6'),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 7e71124..aadee0d 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 _0x280b=['options','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body'];(function(_0x3c933c,_0x2da386){var _0x20c284=function(_0xb0938d){while(--_0xb0938d){_0x3c933c['push'](_0x3c933c['shift']());}};_0x20c284(++_0x2da386);}(_0x280b,0xce));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var moment=require('moment');var BPromise=require(_0xb280('0x2'));var rs=require(_0xb280('0x3'));var fs=require('fs');var Redis=require(_0xb280('0x4'));var db=require(_0xb280('0x5'))['db'];var utils=require(_0xb280('0x6'));var logger=require(_0xb280('0x7'))(_0xb280('0x8'));var config=require(_0xb280('0x9'));var jayson=require(_0xb280('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43e0ee,_0x27474c,_0x5c98b9){return new BPromise(function(_0x12433f,_0xab1fa7){return client[_0xb280('0xb')](_0x43e0ee,_0x5c98b9)[_0xb280('0xc')](function(_0x2322ff){logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');logger['debug'](_0xb280('0xf'),_0x27474c,_0xb280('0x10'),JSON['stringify'](_0x2322ff));if(_0x2322ff[_0xb280('0x11')]){if(_0x2322ff[_0xb280('0x11')][_0xb280('0x12')]===0x1f4){logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0xab1fa7(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}logger[_0xb280('0x11')](_0xb280('0xe'),_0x27474c,_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);return _0x12433f(_0x2322ff[_0xb280('0x11')][_0xb280('0x13')]);}else{logger[_0xb280('0xd')](_0xb280('0xe'),_0x27474c,'request\x20sent');_0x12433f(_0x2322ff[_0xb280('0x14')]['message']);}})[_0xb280('0x15')](function(_0x17be3b){logger['error'](_0xb280('0xe'),_0x27474c,_0x17be3b);_0xab1fa7(_0x17be3b);});});}exports[_0xb280('0x16')]=function(_0x110bcb){var _0x38d5d8=this;return new Promise(function(_0x2c5273,_0x43abc7){return db[_0xb280('0x17')][_0xb280('0x18')](_0x110bcb[_0xb280('0x19')],{'raw':_0x110bcb[_0xb280('0x1a')]?_0x110bcb[_0xb280('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xb280('0xc')](function(_0x507222){logger[_0xb280('0xd')](_0xb280('0x16'),_0x110bcb);logger[_0xb280('0x1b')](_0xb280('0x16'),_0x110bcb,JSON[_0xb280('0x1c')](_0x507222));_0x2c5273(_0x507222);})[_0xb280('0x15')](function(_0xb9a158){logger[_0xb280('0x11')]('CreateSquareDetailsReport',_0xb9a158[_0xb280('0x13')],_0x110bcb);_0x43abc7(_0x38d5d8[_0xb280('0x11')](0x1f4,_0xb9a158[_0xb280('0x13')]));});});}; \ No newline at end of file +var _0xea31=['then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xea31,0x6b));var _0x1ea3=function(_0x45b303,_0x7dfa32){_0x45b303=_0x45b303-0x0;var _0x5f140b=_0xea31[_0x45b303];return _0x5f140b;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var moment=require(_0x1ea3('0x1'));var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))('rpc');var config=require(_0x1ea3('0x8'));var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e6fb,_0x4c8f83,_0x1fa3a8){return new BPromise(function(_0x1b578e,_0x30a6db){return client[_0x1ea3('0xc')](_0x13e6fb,_0x1fa3a8)[_0x1ea3('0xd')](function(_0x2ff19a){logger['info'](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));logger[_0x1ea3('0x10')](_0x1ea3('0x11'),_0x4c8f83,_0x1ea3('0xf'),JSON[_0x1ea3('0x12')](_0x2ff19a));if(_0x2ff19a[_0x1ea3('0x13')]){if(_0x2ff19a['error'][_0x1ea3('0x14')]===0x1f4){logger['error'](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);return _0x30a6db(_0x2ff19a['error'][_0x1ea3('0x15')]);}logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x2ff19a['error'][_0x1ea3('0x15')]);return _0x1b578e(_0x2ff19a[_0x1ea3('0x13')][_0x1ea3('0x15')]);}else{logger[_0x1ea3('0x16')](_0x1ea3('0xe'),_0x4c8f83,_0x1ea3('0xf'));_0x1b578e(_0x2ff19a[_0x1ea3('0x17')]['message']);}})[_0x1ea3('0x18')](function(_0x199728){logger[_0x1ea3('0x13')](_0x1ea3('0xe'),_0x4c8f83,_0x199728);_0x30a6db(_0x199728);});});}exports[_0x1ea3('0x19')]=function(_0x541e18){var _0x1c7530=this;return new Promise(function(_0x2a8b47,_0x990a86){return db['SquareDetailsReport'][_0x1ea3('0x1a')](_0x541e18[_0x1ea3('0x1b')],{'raw':_0x541e18[_0x1ea3('0x1c')]?_0x541e18['options'][_0x1ea3('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x276e4d){logger[_0x1ea3('0x16')](_0x1ea3('0x19'),_0x541e18);logger[_0x1ea3('0x10')](_0x1ea3('0x19'),_0x541e18,JSON['stringify'](_0x276e4d));_0x2a8b47(_0x276e4d);})[_0x1ea3('0x18')](function(_0x498455){logger[_0x1ea3('0x13')]('CreateSquareDetailsReport',_0x498455[_0x1ea3('0x15')],_0x541e18);_0x990a86(_0x1c7530[_0x1ea3('0x13')](0x1f4,_0x498455[_0x1ea3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b12a2d0..f556e40 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 _0xfab7=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express','Router','../../components/auth/service'];(function(_0x2640cc,_0x4291b8){var _0x10d889=function(_0x105085){while(--_0x105085){_0x2640cc['push'](_0x2640cc['shift']());}};_0x10d889(++_0x4291b8);}(_0xfab7,0xd5));var _0x7fab=function(_0x44b0a1,_0x52c401){_0x44b0a1=_0x44b0a1-0x0;var _0x32be5b=_0xfab7[_0x44b0a1];return _0x32be5b;};'use strict';var express=require(_0x7fab('0x0'));var router=express[_0x7fab('0x1')]();var auth=require(_0x7fab('0x2'));var controller=require(_0x7fab('0x3'));router[_0x7fab('0x4')]('/',auth[_0x7fab('0x5')](),controller[_0x7fab('0x6')]);router['get'](_0x7fab('0x7'),auth['isAuthenticated'](),controller['killProcess']);module[_0x7fab('0x8')]=router; \ No newline at end of file +var _0x4ed3=['get','/process/:pid/kill','killProcess','express','Router','isAuthenticated','index'];(function(_0x5cfaa5,_0x50b15e){var _0x5357fd=function(_0x25e338){while(--_0x25e338){_0x5cfaa5['push'](_0x5cfaa5['shift']());}};_0x5357fd(++_0x50b15e);}(_0x4ed3,0x130));var _0x34ed=function(_0x164ae0,_0x3c7ad4){_0x164ae0=_0x164ae0-0x0;var _0x45860e=_0x4ed3[_0x164ae0];return _0x45860e;};'use strict';var express=require(_0x34ed('0x0'));var router=express[_0x34ed('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0x34ed('0x2')](),controller[_0x34ed('0x3')]);router[_0x34ed('0x4')](_0x34ed('0x5'),auth[_0x34ed('0x2')](),controller[_0x34ed('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 e02b2fc..bd2db85 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 _0x135a=['getAllData','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','catch','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index'];(function(_0x447ea3,_0x5bca88){var _0x513439=function(_0x98776f){while(--_0x98776f){_0x447ea3['push'](_0x447ea3['shift']());}};_0x513439(++_0x5bca88);}(_0x135a,0x187));var _0xa135=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x135a[_0x4565bf];return _0x5610ba;};'use strict';var info=require(_0xa135('0x0'));var exec=require(_0xa135('0x1'))[_0xa135('0x2')];var logger=require(_0xa135('0x3'))('api');var util=require(_0xa135('0x4'));var BPromise=require(_0xa135('0x5'));var _=require(_0xa135('0x6'));function handleError(_0x8bd31c,_0x3cdd76,_0x2aac17){_0x3cdd76=_0x3cdd76||0x1f4;return function(_0x1c4731){logger[_0xa135('0x7')](_0xa135('0x8'),_0x2aac17,_0x3cdd76,util[_0xa135('0x9')](_0x1c4731,{'showHidden':![],'depth':null}));delete _0x1c4731[_0xa135('0xa')];_0x8bd31c[_0xa135('0xb')](_0x3cdd76)[_0xa135('0xc')](_0x1c4731);};}exports[_0xa135('0xd')]=function(_0x4df0d3,_0x353d73){return info[_0xa135('0xe')]()[_0xa135('0xf')](function(_0x4af3f3){return _0x353d73[_0xa135('0xb')](0xc8)['json'](_0x4af3f3);})['catch'](function(_0x1384d4){return _0x353d73[_0xa135('0xb')](0x1f4)[_0xa135('0x10')](_0x1384d4);});};exports[_0xa135('0x11')]=function(_0x46841a,_0x3bb40b){var _0x4bb6a2=['components/import/cm'];return new BPromise(function(_0x57a1ba,_0x479286){return exec(util[_0xa135('0x12')](_0xa135('0x13'),_0x46841a[_0xa135('0x14')][_0xa135('0x15')]),function(_0x478a0e,_0x43f5ab,_0x1c44f5){if(_0x478a0e){return _0x479286(_0x478a0e);}return _0x57a1ba(_0x43f5ab);});})[_0xa135('0xf')](function(_0x32294e){var _0x4b6633=![];var _0x40c979=_0x32294e['split'](/\n/);for(var _0x4d8778=0x0,_0x4bc9f7=_0x4bb6a2[_0xa135('0x16')];_0x4d8778<_0x4bc9f7,_0x4b6633===![];_0x4d8778+=0x1){if(_0x32294e[_0xa135('0x17')](_0x4bb6a2[_0x4d8778])>=0x0){_0x4b6633=!![];}}if(!_0x4b6633){throw new Error(util[_0xa135('0x12')](_0xa135('0x18'),_0x46841a['params'][_0xa135('0x15')]));}process[_0xa135('0x19')](_0x46841a[_0xa135('0x14')]['pid'],'SIGINT');return _0x3bb40b['status'](0xc8)[_0xa135('0x10')]({'message':util[_0xa135('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x46841a[_0xa135('0x14')]['pid'])});})[_0xa135('0x1a')](handleError(_0x3bb40b,null,_0xa135('0x11')));}; \ No newline at end of file +var _0xd544=['pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','send','getAllData','then','status','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x37f7ed,_0xcd626e){var _0x561733=function(_0x27091e){while(--_0x27091e){_0x37f7ed['push'](_0x37f7ed['shift']());}};_0x561733(++_0xcd626e);}(_0xd544,0x156));var _0x4d54=function(_0x699a2,_0x579657){_0x699a2=_0x699a2-0x0;var _0x661f7b=_0xd544[_0x699a2];return _0x661f7b;};'use strict';var info=require(_0x4d54('0x0'));var exec=require(_0x4d54('0x1'))[_0x4d54('0x2')];var logger=require(_0x4d54('0x3'))(_0x4d54('0x4'));var util=require('util');var BPromise=require(_0x4d54('0x5'));var _=require(_0x4d54('0x6'));function handleError(_0x510796,_0x4f4e66,_0x37b9fa){_0x4f4e66=_0x4f4e66||0x1f4;return function(_0x38d9a4){logger[_0x4d54('0x7')](_0x4d54('0x8'),_0x37b9fa,_0x4f4e66,util['inspect'](_0x38d9a4,{'showHidden':![],'depth':null}));delete _0x38d9a4['name'];_0x510796['status'](_0x4f4e66)[_0x4d54('0x9')](_0x38d9a4);};}exports['index']=function(_0x1a5c94,_0xbdb13d){return info[_0x4d54('0xa')]()[_0x4d54('0xb')](function(_0x222a1d){return _0xbdb13d[_0x4d54('0xc')](0xc8)[_0x4d54('0xd')](_0x222a1d);})[_0x4d54('0xe')](function(_0x1796fd){return _0xbdb13d[_0x4d54('0xc')](0x1f4)[_0x4d54('0xd')](_0x1796fd);});};exports['killProcess']=function(_0x147c28,_0x3758d1){var _0x130544=[_0x4d54('0xf')];return new BPromise(function(_0x5dbbbe,_0x47366a){return exec(util[_0x4d54('0x10')](_0x4d54('0x11'),_0x147c28['params'][_0x4d54('0x12')]),function(_0x350d5e,_0x225280,_0x2cf3a9){if(_0x350d5e){return _0x47366a(_0x350d5e);}return _0x5dbbbe(_0x225280);});})[_0x4d54('0xb')](function(_0x21331c){var _0x464336=![];var _0x36be8c=_0x21331c[_0x4d54('0x13')](/\n/);for(var _0x1dc3b5=0x0,_0x29f994=_0x130544[_0x4d54('0x14')];_0x1dc3b5<_0x29f994,_0x464336===![];_0x1dc3b5+=0x1){if(_0x21331c['indexOf'](_0x130544[_0x1dc3b5])>=0x0){_0x464336=!![];}}if(!_0x464336){throw new Error(util[_0x4d54('0x10')](_0x4d54('0x15'),_0x147c28['params'][_0x4d54('0x12')]));}process['kill'](_0x147c28[_0x4d54('0x16')]['pid'],_0x4d54('0x17'));return _0x3758d1['status'](0xc8)['json']({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x147c28[_0x4d54('0x16')][_0x4d54('0x12')])});})[_0x4d54('0xe')](handleError(_0x3758d1,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index ed72097..34c7c99 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 _0x8603=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x8603,0x190));var _0x3860=function(_0x42db0b,_0x2b7c94){_0x42db0b=_0x42db0b-0x0;var _0x5928ca=_0x8603[_0x42db0b];return _0x5928ca;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./tag.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3860('0xb')](_0x3860('0x8'),auth['isAuthenticated'](),controller[_0x3860('0xc')]);router[_0x3860('0xd')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1a85=['express','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','get','show','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x6e4933,_0x49a335){var _0x47920b=function(_0x2a07f2){while(--_0x2a07f2){_0x6e4933['push'](_0x6e4933['shift']());}};_0x47920b(++_0x49a335);}(_0x1a85,0x178));var _0x51a8=function(_0x5e7e92,_0xdb0f1){_0x5e7e92=_0x5e7e92-0x0;var _0x412746=_0x1a85[_0x5e7e92];return _0x412746;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));var controller=require(_0x51a8('0x5'));router['get']('/',auth[_0x51a8('0x6')](),controller['index']);router[_0x51a8('0x7')]('/:id',auth[_0x51a8('0x6')](),controller[_0x51a8('0x8')]);router['post']('/',auth[_0x51a8('0x6')](),controller['create']);router['put'](_0x51a8('0x9'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')](_0x51a8('0x9'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xc')]);module[_0x51a8('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 53a082d..94ec73d 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 _0x1cb5=['exports','STRING','name','#0091EA'];(function(_0x1b580,_0x4ec22c){var _0x321429=function(_0x4004d9){while(--_0x4004d9){_0x1b580['push'](_0x1b580['shift']());}};_0x321429(++_0x4ec22c);}(_0x1cb5,0xe8));var _0x51cb=function(_0x1569f3,_0x10ef65){_0x1569f3=_0x1569f3-0x0;var _0x328b01=_0x1cb5[_0x1569f3];return _0x328b01;};'use strict';var Sequelize=require('sequelize');module[_0x51cb('0x0')]={'name':{'type':Sequelize[_0x51cb('0x1')],'unique':_0x51cb('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x51cb('0x1')],'defaultValue':_0x51cb('0x3')},'description':{'type':Sequelize[_0x51cb('0x1')]}}; \ No newline at end of file +var _0xfc39=['STRING','name','exports'];(function(_0x11b446,_0xf71a9a){var _0x1e856f=function(_0x339424){while(--_0x339424){_0x11b446['push'](_0x11b446['shift']());}};_0x1e856f(++_0xf71a9a);}(_0xfc39,0x1a6));var _0x9fc3=function(_0x57afe5,_0x5a1648){_0x57afe5=_0x57afe5-0x0;var _0x2af6c3=_0xfc39[_0x57afe5];return _0x2af6c3;};'use strict';var Sequelize=require('sequelize');module[_0x9fc3('0x0')]={'name':{'type':Sequelize[_0x9fc3('0x1')],'unique':_0x9fc3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x9fc3('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f6853a6..5ab8b4a 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 _0xfb11=['get','Tags','destroy','end','error','stack','name','send','index','Tag','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','merge','find','catch','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0x2b5f1c,_0x3c9ba8){var _0x1000b9=function(_0x44d0cc){while(--_0x44d0cc){_0x2b5f1c['push'](_0x2b5f1c['shift']());}};_0x1000b9(++_0x3c9ba8);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xfb11[_0x4bfac3];return _0x15f0f2;};'use strict';var pdf=require(_0x1fb1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1fb1('0x1'));var zipdir=require(_0x1fb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fb1('0x3'));var moment=require('moment');var BPromise=require(_0x1fb1('0x4'));var Mustache=require('mustache');var util=require(_0x1fb1('0x5'));var path=require(_0x1fb1('0x6'));var sox=require('sox');var csv=require(_0x1fb1('0x7'));var ejs=require(_0x1fb1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0x7'));var querystring=require(_0x1fb1('0xd'));var Papa=require(_0x1fb1('0xe'));var authService=require(_0x1fb1('0xf'));var hardwareService=require(_0x1fb1('0x10'));var Redis=require(_0x1fb1('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x1fb1('0x12'))('api');var utils=require(_0x1fb1('0x13'));var config=require('../../config/environment');var db=require(_0x1fb1('0x14'))['db'];function respondWithStatusCode(_0x11c3a9,_0xd39b52){_0xd39b52=_0xd39b52||0xcc;return function(_0x10bcac){if(_0x10bcac){return _0x11c3a9[_0x1fb1('0x15')](_0xd39b52);}return _0x11c3a9[_0x1fb1('0x16')](_0xd39b52)['end']();};}function respondWithResult(_0x18d255,_0xf371e8){_0xf371e8=_0xf371e8||0xc8;return function(_0x2c5be1){if(_0x2c5be1){return _0x18d255[_0x1fb1('0x16')](_0xf371e8)[_0x1fb1('0x17')](_0x2c5be1);}};}function respondWithFilteredResult(_0x46cf8e,_0x151152){return function(_0x316fe5){if(_0x316fe5){var _0x358b58=_0x316fe5[_0x1fb1('0x18')],_0x4cbe42=_0x151152[_0x1fb1('0x19')],_0x5c8d23=_0x151152['offset']+_0x151152[_0x1fb1('0x1a')],_0x34045e;if(_0x5c8d23>=_0x358b58){_0x5c8d23=_0x358b58;_0x34045e=0xc8;}else{_0x34045e=0xce;}_0x46cf8e[_0x1fb1('0x16')](_0x34045e);return _0x46cf8e[_0x1fb1('0x1b')](_0x1fb1('0x1c'),_0x4cbe42+'-'+_0x5c8d23+'/'+_0x358b58)[_0x1fb1('0x17')](_0x316fe5);}return null;};}function patchUpdates(_0x27d71f){return function(_0x10df7b){try{jsonpatch[_0x1fb1('0x1d')](_0x10df7b,_0x27d71f,!![]);}catch(_0x4041ea){return BPromise['reject'](_0x4041ea);}return _0x10df7b[_0x1fb1('0x1e')]();};}function saveUpdates(_0x55ba5b,_0x55e75e){return function(_0xdf9c1b){if(_0xdf9c1b){return _0xdf9c1b[_0x1fb1('0x1f')](_0x55ba5b)[_0x1fb1('0x20')](function(_0x54ad97){return _0x54ad97;});}return null;};}function removeEntity(_0x12df9f,_0x4ed51a){return function(_0x5c76f5){if(_0x5c76f5){return _0x5c76f5['destroy']()[_0x1fb1('0x20')](function(){var _0x1f8e5a=_0x5c76f5[_0x1fb1('0x21')]({'plain':!![]});var _0x10924f=_0x1fb1('0x22');return db['UserProfileResource'][_0x1fb1('0x23')]({'where':{'type':_0x10924f,'resourceId':_0x1f8e5a['id']}})[_0x1fb1('0x20')](function(){return _0x5c76f5;});})[_0x1fb1('0x20')](function(){_0x12df9f[_0x1fb1('0x16')](0xcc)[_0x1fb1('0x24')]();});}};}function handleEntityNotFound(_0x1353a4,_0x3680b5){return function(_0x2de1d4){if(!_0x2de1d4){_0x1353a4['sendStatus'](0x194);}return _0x2de1d4;};}function handleError(_0x1b25b3,_0x1aac7d){_0x1aac7d=_0x1aac7d||0x1f4;return function(_0x46ff60){logger[_0x1fb1('0x25')](_0x46ff60[_0x1fb1('0x26')]);if(_0x46ff60[_0x1fb1('0x27')]){delete _0x46ff60[_0x1fb1('0x27')];}_0x1b25b3[_0x1fb1('0x16')](_0x1aac7d)[_0x1fb1('0x28')](_0x46ff60);};}exports[_0x1fb1('0x29')]=function(_0x5e99e7,_0x497017){var _0x39fc43={},_0xe8ec0a={},_0x2f6c88={'count':0x0,'rows':[]};var _0x520ee2=db[_0x1fb1('0x2a')][_0x1fb1('0x2b')];_0xe8ec0a[_0x1fb1('0x2c')]=_[_0x1fb1('0x2d')](_0x520ee2);_0xe8ec0a['query']=_[_0x1fb1('0x2d')](_0x5e99e7[_0x1fb1('0x2e')]);_0xe8ec0a['filters']=_[_0x1fb1('0x2f')](_0xe8ec0a['model'],_0xe8ec0a['query']);_0x39fc43[_0x1fb1('0x30')]=_[_0x1fb1('0x2f')](_0xe8ec0a['model'],qs[_0x1fb1('0x31')](_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x31')]));_0x39fc43[_0x1fb1('0x30')]=_0x39fc43[_0x1fb1('0x30')]['length']?_0x39fc43[_0x1fb1('0x30')]:_0xe8ec0a[_0x1fb1('0x2c')];if(!_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x32')](_0x1fb1('0x33'))){_0x39fc43[_0x1fb1('0x1a')]=qs[_0x1fb1('0x1a')](_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x1a')]);_0x39fc43['offset']=qs[_0x1fb1('0x19')](_0x5e99e7['query'][_0x1fb1('0x19')]);}_0x39fc43['order']=qs[_0x1fb1('0x34')](_0x5e99e7['query']['sort']);_0x39fc43[_0x1fb1('0x35')]=qs[_0x1fb1('0x36')](_[_0x1fb1('0x37')](_0x5e99e7[_0x1fb1('0x2e')],_0xe8ec0a['filters']));if(_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x38')]){_0x39fc43[_0x1fb1('0x35')]=_['merge'](_0x39fc43[_0x1fb1('0x35')],{'$or':_[_0x1fb1('0x39')](_0x520ee2,function(_0x228235){if(_0x228235[_0x1fb1('0x3a')][_0x1fb1('0x3b')]!==_0x1fb1('0x3c')){var _0xcfb507={};_0xcfb507[_0x228235['field']]={'$like':'%'+_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x38')]+'%'};return _0xcfb507;}})});}_0x39fc43=_['merge']({},_0x39fc43,_0x5e99e7[_0x1fb1('0x3d')]);var _0x51c83f={'where':_0x39fc43[_0x1fb1('0x35')]};return db[_0x1fb1('0x2a')][_0x1fb1('0x18')](_0x51c83f)[_0x1fb1('0x20')](function(_0x1a0b32){_0x2f6c88[_0x1fb1('0x18')]=_0x1a0b32;if(_0x5e99e7[_0x1fb1('0x2e')][_0x1fb1('0x3e')]){_0x39fc43[_0x1fb1('0x3f')]=[{'all':!![]}];}return db[_0x1fb1('0x2a')][_0x1fb1('0x40')](_0x39fc43);})[_0x1fb1('0x20')](function(_0xafc9a7){_0x2f6c88[_0x1fb1('0x41')]=_0xafc9a7;return _0x2f6c88;})[_0x1fb1('0x20')](respondWithFilteredResult(_0x497017,_0x39fc43))['catch'](handleError(_0x497017,null));};exports[_0x1fb1('0x42')]=function(_0xca1fd3,_0x2ff635){var _0x19211f={'raw':!![],'where':{'id':_0xca1fd3['params']['id']}},_0x5a4bfd={};_0x5a4bfd[_0x1fb1('0x2c')]=_[_0x1fb1('0x2d')](db[_0x1fb1('0x2a')][_0x1fb1('0x2b')]);_0x5a4bfd[_0x1fb1('0x2e')]=_[_0x1fb1('0x2d')](_0xca1fd3[_0x1fb1('0x2e')]);_0x5a4bfd[_0x1fb1('0x36')]=_[_0x1fb1('0x2f')](_0x5a4bfd[_0x1fb1('0x2c')],_0x5a4bfd['query']);_0x19211f[_0x1fb1('0x30')]=_['intersection'](_0x5a4bfd['model'],qs[_0x1fb1('0x31')](_0xca1fd3[_0x1fb1('0x2e')][_0x1fb1('0x31')]));_0x19211f[_0x1fb1('0x30')]=_0x19211f['attributes']['length']?_0x19211f[_0x1fb1('0x30')]:_0x5a4bfd[_0x1fb1('0x2c')];if(_0xca1fd3[_0x1fb1('0x2e')][_0x1fb1('0x3e')]){_0x19211f[_0x1fb1('0x3f')]=[{'all':!![]}];}_0x19211f=_[_0x1fb1('0x43')]({},_0x19211f,_0xca1fd3[_0x1fb1('0x3d')]);return db[_0x1fb1('0x2a')][_0x1fb1('0x44')](_0x19211f)['then'](handleEntityNotFound(_0x2ff635,null))['then'](respondWithResult(_0x2ff635,null))[_0x1fb1('0x45')](handleError(_0x2ff635,null));};exports['create']=function(_0x475e71,_0x220eda){return db[_0x1fb1('0x2a')][_0x1fb1('0x46')](_0x475e71[_0x1fb1('0x47')],{})[_0x1fb1('0x20')](function(_0x5af135){var _0x360a4e=_0x475e71[_0x1fb1('0x48')][_0x1fb1('0x21')]({'plain':!![]});if(!_0x360a4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x360a4e[_0x1fb1('0x49')]==='user'){var _0x6e105b=_0x5af135[_0x1fb1('0x21')]({'plain':!![]});var _0x3ea540='Tags';return db[_0x1fb1('0x4a')][_0x1fb1('0x44')]({'where':{'name':_0x3ea540,'userProfileId':_0x360a4e['userProfileId']},'raw':!![]})[_0x1fb1('0x20')](function(_0x263161){if(_0x263161&&_0x263161[_0x1fb1('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x6e105b['name'],'resourceId':_0x6e105b['id'],'type':_0x263161[_0x1fb1('0x27')],'sectionId':_0x263161['id']},{})[_0x1fb1('0x20')](function(){return _0x5af135;});}else{return _0x5af135;}})[_0x1fb1('0x45')](function(_0x271f82){logger[_0x1fb1('0x25')](_0x1fb1('0x4c'),_0x271f82);throw _0x271f82;});}return _0x5af135;})['then'](respondWithResult(_0x220eda,0xc9))['catch'](handleError(_0x220eda,null));};exports[_0x1fb1('0x1f')]=function(_0x2a6898,_0x2d03d2){if(_0x2a6898[_0x1fb1('0x47')]['id']){delete _0x2a6898['body']['id'];}return db['Tag'][_0x1fb1('0x44')]({'where':{'id':_0x2a6898['params']['id']}})[_0x1fb1('0x20')](handleEntityNotFound(_0x2d03d2,null))['then'](saveUpdates(_0x2a6898[_0x1fb1('0x47')],null))['then'](respondWithResult(_0x2d03d2,null))[_0x1fb1('0x45')](handleError(_0x2d03d2,null));};exports[_0x1fb1('0x23')]=function(_0x1475ee,_0xca9395){return db[_0x1fb1('0x2a')]['find']({'where':{'id':_0x1475ee['params']['id']}})[_0x1fb1('0x20')](handleEntityNotFound(_0xca9395,null))[_0x1fb1('0x20')](removeEntity(_0xca9395,null))['catch'](handleError(_0xca9395,null));}; \ No newline at end of file +var _0x5fdc=['set','Content-Range','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','Tag','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit'];(function(_0x182f56,_0x943993){var _0x346430=function(_0x45e7dd){while(--_0x45e7dd){_0x182f56['push'](_0x182f56['shift']());}};_0x346430(++_0x943993);}(_0x5fdc,0x127));var _0xc5fd=function(_0x59a793,_0xa8ed1){_0x59a793=_0x59a793-0x0;var _0x5aacec=_0x5fdc[_0x59a793];return _0x5aacec;};'use strict';var pdf=require(_0xc5fd('0x0'));var emlformat=require(_0xc5fd('0x1'));var rimraf=require(_0xc5fd('0x2'));var zipdir=require(_0xc5fd('0x3'));var jsonpatch=require(_0xc5fd('0x4'));var rp=require(_0xc5fd('0x5'));var moment=require(_0xc5fd('0x6'));var BPromise=require(_0xc5fd('0x7'));var Mustache=require(_0xc5fd('0x8'));var util=require(_0xc5fd('0x9'));var path=require(_0xc5fd('0xa'));var sox=require(_0xc5fd('0xb'));var csv=require(_0xc5fd('0xc'));var ejs=require(_0xc5fd('0xd'));var fs=require('fs');var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xc'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xc5fd('0x12'));var qs=require(_0xc5fd('0x13'));var logger=require(_0xc5fd('0x14'))(_0xc5fd('0x15'));var utils=require(_0xc5fd('0x16'));var config=require(_0xc5fd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x143464,_0x5c3577){_0x5c3577=_0x5c3577||0xcc;return function(_0x558939){if(_0x558939){return _0x143464[_0xc5fd('0x18')](_0x5c3577);}return _0x143464[_0xc5fd('0x19')](_0x5c3577)[_0xc5fd('0x1a')]();};}function respondWithResult(_0x23ac5d,_0x2e77a8){_0x2e77a8=_0x2e77a8||0xc8;return function(_0x40b0f8){if(_0x40b0f8){return _0x23ac5d[_0xc5fd('0x19')](_0x2e77a8)[_0xc5fd('0x1b')](_0x40b0f8);}};}function respondWithFilteredResult(_0x51233a,_0x124651){return function(_0x103c3d){if(_0x103c3d){var _0x2221da=_0x103c3d['count'],_0x3404e0=_0x124651['offset'],_0x4d3636=_0x124651['offset']+_0x124651[_0xc5fd('0x1c')],_0x4fd364;if(_0x4d3636>=_0x2221da){_0x4d3636=_0x2221da;_0x4fd364=0xc8;}else{_0x4fd364=0xce;}_0x51233a[_0xc5fd('0x19')](_0x4fd364);return _0x51233a[_0xc5fd('0x1d')](_0xc5fd('0x1e'),_0x3404e0+'-'+_0x4d3636+'/'+_0x2221da)[_0xc5fd('0x1b')](_0x103c3d);}return null;};}function patchUpdates(_0x3f981f){return function(_0xfd14c7){try{jsonpatch['apply'](_0xfd14c7,_0x3f981f,!![]);}catch(_0xb7bab1){return BPromise[_0xc5fd('0x1f')](_0xb7bab1);}return _0xfd14c7[_0xc5fd('0x20')]();};}function saveUpdates(_0x9c12e4,_0x3b3093){return function(_0x48024e){if(_0x48024e){return _0x48024e[_0xc5fd('0x21')](_0x9c12e4)[_0xc5fd('0x22')](function(_0x18048e){return _0x18048e;});}return null;};}function removeEntity(_0x216512,_0x5a7bdc){return function(_0x4c85d5){if(_0x4c85d5){return _0x4c85d5[_0xc5fd('0x23')]()[_0xc5fd('0x22')](function(){var _0x3d7211=_0x4c85d5[_0xc5fd('0x24')]({'plain':!![]});var _0x334401=_0xc5fd('0x25');return db['UserProfileResource'][_0xc5fd('0x23')]({'where':{'type':_0x334401,'resourceId':_0x3d7211['id']}})[_0xc5fd('0x22')](function(){return _0x4c85d5;});})[_0xc5fd('0x22')](function(){_0x216512[_0xc5fd('0x19')](0xcc)[_0xc5fd('0x1a')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x18')](0x194);}return _0x527018;};}function handleError(_0x48cd1d,_0x2ee700){_0x2ee700=_0x2ee700||0x1f4;return function(_0x231368){logger[_0xc5fd('0x26')](_0x231368[_0xc5fd('0x27')]);if(_0x231368['name']){delete _0x231368[_0xc5fd('0x28')];}_0x48cd1d[_0xc5fd('0x19')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=db[_0xc5fd('0x2b')][_0xc5fd('0x2c')];_0x412ef7[_0xc5fd('0x2d')]=_[_0xc5fd('0x2e')](_0x4859f7);_0x412ef7[_0xc5fd('0x2f')]=_[_0xc5fd('0x2e')](_0x19df33[_0xc5fd('0x2f')]);_0x412ef7[_0xc5fd('0x30')]=_['intersection'](_0x412ef7[_0xc5fd('0x2d')],_0x412ef7[_0xc5fd('0x2f')]);_0x541c12[_0xc5fd('0x31')]=_[_0xc5fd('0x32')](_0x412ef7[_0xc5fd('0x2d')],qs[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x2f')][_0xc5fd('0x33')]));_0x541c12[_0xc5fd('0x31')]=_0x541c12[_0xc5fd('0x31')][_0xc5fd('0x34')]?_0x541c12[_0xc5fd('0x31')]:_0x412ef7['model'];if(!_0x19df33[_0xc5fd('0x2f')][_0xc5fd('0x35')](_0xc5fd('0x36'))){_0x541c12[_0xc5fd('0x1c')]=qs[_0xc5fd('0x1c')](_0x19df33[_0xc5fd('0x2f')][_0xc5fd('0x1c')]);_0x541c12[_0xc5fd('0x37')]=qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]);}_0x541c12[_0xc5fd('0x38')]=qs[_0xc5fd('0x39')](_0x19df33[_0xc5fd('0x2f')][_0xc5fd('0x39')]);_0x541c12[_0xc5fd('0x3a')]=qs[_0xc5fd('0x30')](_['pick'](_0x19df33[_0xc5fd('0x2f')],_0x412ef7[_0xc5fd('0x30')]));if(_0x19df33['query'][_0xc5fd('0x3b')]){_0x541c12['where']=_[_0xc5fd('0x3c')](_0x541c12[_0xc5fd('0x3a')],{'$or':_[_0xc5fd('0x3d')](_0x4859f7,function(_0x4cafb1){if(_0x4cafb1[_0xc5fd('0x3e')][_0xc5fd('0x3f')]!=='VIRTUAL'){var _0x2e20e0={};_0x2e20e0[_0x4cafb1[_0xc5fd('0x40')]]={'$like':'%'+_0x19df33[_0xc5fd('0x2f')][_0xc5fd('0x3b')]+'%'};return _0x2e20e0;}})});}_0x541c12=_[_0xc5fd('0x3c')]({},_0x541c12,_0x19df33[_0xc5fd('0x41')]);var _0x509bbc={'where':_0x541c12[_0xc5fd('0x3a')]};return db[_0xc5fd('0x2b')][_0xc5fd('0x42')](_0x509bbc)[_0xc5fd('0x22')](function(_0x5d3fce){_0x5d4f70['count']=_0x5d3fce;if(_0x19df33['query'][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2b')][_0xc5fd('0x45')](_0x541c12);})[_0xc5fd('0x22')](function(_0x33514d){_0x5d4f70[_0xc5fd('0x46')]=_0x33514d;return _0x5d4f70;})[_0xc5fd('0x22')](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports['show']=function(_0x5a2199,_0x21f7b2){var _0x53a547={'raw':!![],'where':{'id':_0x5a2199[_0xc5fd('0x48')]['id']}},_0x970623={};_0x970623[_0xc5fd('0x2d')]=_['keys'](db[_0xc5fd('0x2b')][_0xc5fd('0x2c')]);_0x970623['query']=_[_0xc5fd('0x2e')](_0x5a2199[_0xc5fd('0x2f')]);_0x970623['filters']=_[_0xc5fd('0x32')](_0x970623['model'],_0x970623[_0xc5fd('0x2f')]);_0x53a547[_0xc5fd('0x31')]=_['intersection'](_0x970623[_0xc5fd('0x2d')],qs[_0xc5fd('0x33')](_0x5a2199[_0xc5fd('0x2f')]['fields']));_0x53a547[_0xc5fd('0x31')]=_0x53a547[_0xc5fd('0x31')]['length']?_0x53a547['attributes']:_0x970623[_0xc5fd('0x2d')];if(_0x5a2199['query']['includeAll']){_0x53a547['include']=[{'all':!![]}];}_0x53a547=_[_0xc5fd('0x3c')]({},_0x53a547,_0x5a2199[_0xc5fd('0x41')]);return db[_0xc5fd('0x2b')][_0xc5fd('0x49')](_0x53a547)[_0xc5fd('0x22')](handleEntityNotFound(_0x21f7b2,null))[_0xc5fd('0x22')](respondWithResult(_0x21f7b2,null))['catch'](handleError(_0x21f7b2,null));};exports['create']=function(_0x4ce654,_0x1d550c){return db[_0xc5fd('0x2b')][_0xc5fd('0x4a')](_0x4ce654['body'],{})[_0xc5fd('0x22')](function(_0x51641b){var _0x884680=_0x4ce654[_0xc5fd('0x4b')][_0xc5fd('0x24')]({'plain':!![]});if(!_0x884680)throw new Error(_0xc5fd('0x4c'));if(_0x884680[_0xc5fd('0x4d')]===_0xc5fd('0x4b')){var _0x54d86c=_0x51641b[_0xc5fd('0x24')]({'plain':!![]});var _0x44e8cc='Tags';return db['UserProfileSection'][_0xc5fd('0x49')]({'where':{'name':_0x44e8cc,'userProfileId':_0x884680['userProfileId']},'raw':!![]})['then'](function(_0x6e5626){if(_0x6e5626&&_0x6e5626[_0xc5fd('0x4e')]===0x0){return db['UserProfileResource'][_0xc5fd('0x4a')]({'name':_0x54d86c[_0xc5fd('0x28')],'resourceId':_0x54d86c['id'],'type':_0x6e5626['name'],'sectionId':_0x6e5626['id']},{})[_0xc5fd('0x22')](function(){return _0x51641b;});}else{return _0x51641b;}})[_0xc5fd('0x47')](function(_0x46ce33){logger[_0xc5fd('0x26')](_0xc5fd('0x4f'),_0x46ce33);throw _0x46ce33;});}return _0x51641b;})[_0xc5fd('0x22')](respondWithResult(_0x1d550c,0xc9))[_0xc5fd('0x47')](handleError(_0x1d550c,null));};exports[_0xc5fd('0x21')]=function(_0x4217f7,_0x32721e){if(_0x4217f7[_0xc5fd('0x50')]['id']){delete _0x4217f7['body']['id'];}return db[_0xc5fd('0x2b')][_0xc5fd('0x49')]({'where':{'id':_0x4217f7[_0xc5fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x32721e,null))[_0xc5fd('0x22')](saveUpdates(_0x4217f7[_0xc5fd('0x50')],null))[_0xc5fd('0x22')](respondWithResult(_0x32721e,null))[_0xc5fd('0x47')](handleError(_0x32721e,null));};exports['destroy']=function(_0xcbd63b,_0x5b5ecd){return db['Tag'][_0xc5fd('0x49')]({'where':{'id':_0xcbd63b[_0xc5fd('0x48')]['id']}})[_0xc5fd('0x22')](handleEntityNotFound(_0x5b5ecd,null))[_0xc5fd('0x22')](removeEntity(_0x5b5ecd,null))[_0xc5fd('0x47')](handleError(_0x5b5ecd,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6697bb8..2a86774 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 _0xe995=['request-promise','./tag.attributes','Tag','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x434c8c,_0x570af4){var _0x231fd6=function(_0x136f05){while(--_0x136f05){_0x434c8c['push'](_0x434c8c['shift']());}};_0x231fd6(++_0x570af4);}(_0xe995,0xae));var _0x5e99=function(_0x423042,_0x279fac){_0x423042=_0x423042-0x0;var _0x4686e4=_0xe995[_0x423042];return _0x4686e4;};'use strict';var _=require(_0x5e99('0x0'));var util=require(_0x5e99('0x1'));var logger=require(_0x5e99('0x2'))(_0x5e99('0x3'));var moment=require(_0x5e99('0x4'));var BPromise=require(_0x5e99('0x5'));var rp=require(_0x5e99('0x6'));var attributes=require(_0x5e99('0x7'));module['exports']=function(_0x4ba862,_0x456849){return _0x4ba862['define'](_0x5e99('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82d2=['bluebird','./tag.attributes','define','Tag','tools_tags','lodash','util','moment'];(function(_0x20f6a6,_0x392f1c){var _0xde7469=function(_0x20b72d){while(--_0x20b72d){_0x20f6a6['push'](_0x20f6a6['shift']());}};_0xde7469(++_0x392f1c);}(_0x82d2,0xdd));var _0x282d=function(_0x4dfe7d,_0x168dab){_0x4dfe7d=_0x4dfe7d-0x0;var _0x57e382=_0x82d2[_0x4dfe7d];return _0x57e382;};'use strict';var _=require(_0x282d('0x0'));var util=require(_0x282d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x282d('0x2'));var BPromise=require(_0x282d('0x3'));var rp=require('request-promise');var attributes=require(_0x282d('0x4'));module['exports']=function(_0x373192,_0x24e941){return _0x373192[_0x282d('0x5')](_0x282d('0x6'),attributes,{'tableName':_0x282d('0x7'),'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 5a57de4..75b4427 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 _0x2d85=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x24f86c,_0x1a04cc){var _0x114d4d=function(_0x31bf02){while(--_0x31bf02){_0x24f86c['push'](_0x24f86c['shift']());}};_0x114d4d(++_0x1a04cc);}(_0x2d85,0x18d));var _0x52d8=function(_0x5bfa2b,_0x53b976){_0x5bfa2b=_0x5bfa2b-0x0;var _0x2f6c31=_0x2d85[_0x5bfa2b];return _0x2f6c31;};'use strict';var _=require(_0x52d8('0x0'));var util=require(_0x52d8('0x1'));var moment=require(_0x52d8('0x2'));var BPromise=require(_0x52d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52d8('0x4'));var db=require(_0x52d8('0x5'))['db'];var utils=require(_0x52d8('0x6'));var logger=require(_0x52d8('0x7'))(_0x52d8('0x8'));var config=require('../../config/environment');var jayson=require(_0x52d8('0x9'));var client=jayson[_0x52d8('0xa')][_0x52d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x146801,_0x371352,_0x573c09){return new BPromise(function(_0x5affa3,_0x16840a){return client[_0x52d8('0xc')](_0x146801,_0x573c09)[_0x52d8('0xd')](function(_0x5bc341){logger[_0x52d8('0xe')](_0x52d8('0xf'),_0x371352,_0x52d8('0x10'));logger[_0x52d8('0x11')](_0x52d8('0x12'),_0x371352,_0x52d8('0x10'),JSON[_0x52d8('0x13')](_0x5bc341));if(_0x5bc341[_0x52d8('0x14')]){if(_0x5bc341[_0x52d8('0x14')]['code']===0x1f4){logger[_0x52d8('0x14')](_0x52d8('0xf'),_0x371352,_0x5bc341['error'][_0x52d8('0x15')]);return _0x16840a(_0x5bc341[_0x52d8('0x14')][_0x52d8('0x15')]);}logger[_0x52d8('0x14')](_0x52d8('0xf'),_0x371352,_0x5bc341[_0x52d8('0x14')][_0x52d8('0x15')]);return _0x5affa3(_0x5bc341[_0x52d8('0x14')][_0x52d8('0x15')]);}else{logger[_0x52d8('0xe')]('Tag,\x20%s,\x20%s',_0x371352,'request\x20sent');_0x5affa3(_0x5bc341['result'][_0x52d8('0x15')]);}})[_0x52d8('0x16')](function(_0x1c4824){logger[_0x52d8('0x14')](_0x52d8('0xf'),_0x371352,_0x1c4824);_0x16840a(_0x1c4824);});});} \ No newline at end of file +var _0xd280=['jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0xd280,0x1e9));var _0x0d28=function(_0x296bcd,_0x115fbd){_0x296bcd=_0x296bcd-0x0;var _0x13523e=_0xd280[_0x296bcd];return _0x13523e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d28('0x0'));var fs=require('fs');var Redis=require(_0x0d28('0x1'));var db=require(_0x0d28('0x2'))['db'];var utils=require(_0x0d28('0x3'));var logger=require('../../config/logger')(_0x0d28('0x4'));var config=require('../../config/environment');var jayson=require(_0x0d28('0x5'));var client=jayson[_0x0d28('0x6')][_0x0d28('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e37b3,_0x366cd5,_0x5ad156){return new BPromise(function(_0x565c37,_0x21b8b6){return client[_0x0d28('0x8')](_0x4e37b3,_0x5ad156)['then'](function(_0x1117bd){logger[_0x0d28('0x9')](_0x0d28('0xa'),_0x366cd5,_0x0d28('0xb'));logger[_0x0d28('0xc')](_0x0d28('0xd'),_0x366cd5,'request\x20sent',JSON[_0x0d28('0xe')](_0x1117bd));if(_0x1117bd[_0x0d28('0xf')]){if(_0x1117bd[_0x0d28('0xf')]['code']===0x1f4){logger[_0x0d28('0xf')]('Tag,\x20%s,\x20%s',_0x366cd5,_0x1117bd['error'][_0x0d28('0x10')]);return _0x21b8b6(_0x1117bd[_0x0d28('0xf')][_0x0d28('0x10')]);}logger['error'](_0x0d28('0xa'),_0x366cd5,_0x1117bd[_0x0d28('0xf')]['message']);return _0x565c37(_0x1117bd[_0x0d28('0xf')][_0x0d28('0x10')]);}else{logger['info'](_0x0d28('0xa'),_0x366cd5,_0x0d28('0xb'));_0x565c37(_0x1117bd[_0x0d28('0x11')][_0x0d28('0x10')]);}})[_0x0d28('0x12')](function(_0x3134ae){logger['error'](_0x0d28('0xa'),_0x366cd5,_0x3134ae);_0x21b8b6(_0x3134ae);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 5bb9b2a..2315dd9 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 _0xb84a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./team.controller','get','isAuthenticated','/:id','show','/:id/queues','/:id/users','getAgents','post','create','addQueues','addAgents','delete','removeQueues','exports','multer','util'];(function(_0x43836d,_0x199cf7){var _0x327e65=function(_0x5c3e37){while(--_0x5c3e37){_0x43836d['push'](_0x43836d['shift']());}};_0x327e65(++_0x199cf7);}(_0xb84a,0x6c));var _0xab84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb84a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xab84('0x0'));var util=require(_0xab84('0x1'));var path=require('path');var timeout=require(_0xab84('0x2'));var express=require(_0xab84('0x3'));var router=express[_0xab84('0x4')]();var auth=require(_0xab84('0x5'));var interaction=require(_0xab84('0x6'));var config=require('../../config/environment');var controller=require(_0xab84('0x7'));router[_0xab84('0x8')]('/',auth[_0xab84('0x9')](),controller['index']);router[_0xab84('0x8')](_0xab84('0xa'),auth['isAuthenticated'](),controller[_0xab84('0xb')]);router[_0xab84('0x8')](_0xab84('0xc'),auth['isAuthenticated'](),controller['getQueues']);router[_0xab84('0x8')](_0xab84('0xd'),auth[_0xab84('0x9')](),controller[_0xab84('0xe')]);router[_0xab84('0xf')]('/',auth['isAuthenticated'](),controller[_0xab84('0x10')]);router[_0xab84('0xf')](_0xab84('0xc'),auth[_0xab84('0x9')](),controller[_0xab84('0x11')]);router[_0xab84('0xf')](_0xab84('0xd'),auth['isAuthenticated'](),controller[_0xab84('0x12')]);router['put'](_0xab84('0xa'),auth[_0xab84('0x9')](),controller['update']);router[_0xab84('0x13')](_0xab84('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xab84('0x13')](_0xab84('0xc'),auth[_0xab84('0x9')](),controller[_0xab84('0x14')]);router['delete'](_0xab84('0xd'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xab84('0x15')]=router; \ No newline at end of file +var _0x9ea8=['/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put','update','destroy','delete','removeQueues','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./team.controller','index','get','/:id','isAuthenticated'];(function(_0x41befd,_0x48775d){var _0x4559d8=function(_0x2b3f3f){while(--_0x2b3f3f){_0x41befd['push'](_0x41befd['shift']());}};_0x4559d8(++_0x48775d);}(_0x9ea8,0x147));var _0x89ea=function(_0x1ffd62,_0x29a335){_0x1ffd62=_0x1ffd62-0x0;var _0x21ee6c=_0x9ea8[_0x1ffd62];return _0x21ee6c;};'use strict';var multer=require('multer');var util=require(_0x89ea('0x0'));var path=require(_0x89ea('0x1'));var timeout=require(_0x89ea('0x2'));var express=require(_0x89ea('0x3'));var router=express[_0x89ea('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x89ea('0x5'));var config=require('../../config/environment');var controller=require(_0x89ea('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x89ea('0x7')]);router[_0x89ea('0x8')](_0x89ea('0x9'),auth[_0x89ea('0xa')](),controller['show']);router['get'](_0x89ea('0xb'),auth[_0x89ea('0xa')](),controller[_0x89ea('0xc')]);router[_0x89ea('0x8')](_0x89ea('0xd'),auth[_0x89ea('0xa')](),controller[_0x89ea('0xe')]);router[_0x89ea('0xf')]('/',auth[_0x89ea('0xa')](),controller[_0x89ea('0x10')]);router[_0x89ea('0xf')](_0x89ea('0xb'),auth[_0x89ea('0xa')](),controller[_0x89ea('0x11')]);router[_0x89ea('0xf')]('/:id/users',auth[_0x89ea('0xa')](),controller[_0x89ea('0x12')]);router[_0x89ea('0x13')]('/:id',auth[_0x89ea('0xa')](),controller[_0x89ea('0x14')]);router['delete']('/:id',auth[_0x89ea('0xa')](),controller[_0x89ea('0x15')]);router[_0x89ea('0x16')](_0x89ea('0xb'),auth[_0x89ea('0xa')](),controller[_0x89ea('0x17')]);router['delete'](_0x89ea('0xd'),auth[_0x89ea('0xa')](),controller[_0x89ea('0x18')]);module[_0x89ea('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e389ea1..6d28e21 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 _0xd17a=['STRING','name','sequelize','exports'];(function(_0x1fcf2e,_0x2a5de9){var _0x5a0ac7=function(_0x186c44){while(--_0x186c44){_0x1fcf2e['push'](_0x1fcf2e['shift']());}};_0x5a0ac7(++_0x2a5de9);}(_0xd17a,0x16e));var _0xad17=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0xd17a[_0x345a17];return _0xd0f947;};'use strict';var Sequelize=require(_0xad17('0x0'));module[_0xad17('0x1')]={'name':{'type':Sequelize[_0xad17('0x2')],'allowNull':![],'unique':_0xad17('0x3')},'description':{'type':Sequelize[_0xad17('0x2')]}}; \ No newline at end of file +var _0x5160=['exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5160,0x106));var _0x0516=function(_0x27bb95,_0x812ec3){_0x27bb95=_0x27bb95-0x0;var _0x25d5fc=_0x5160[_0x27bb95];return _0x25d5fc;};'use strict';var Sequelize=require('sequelize');module[_0x0516('0x0')]={'name':{'type':Sequelize[_0x0516('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b1644a7..fe4420a 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 _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file +var _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8428012..71c6b23 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 _0x2573=['exports','../../mysqldb','Team','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3a45ec,_0x5e5772){var _0x984c5b=function(_0x3855d7){while(--_0x3855d7){_0x3a45ec['push'](_0x3a45ec['shift']());}};_0x984c5b(++_0x5e5772);}(_0x2573,0x17b));var _0x3257=function(_0x394276,_0x91d3d6){_0x394276=_0x394276-0x0;var _0x3c13a2=_0x2573[_0x394276];return _0x3c13a2;};'use strict';var EventEmitter=require('events');var Team=require(_0x3257('0x0'))['db'][_0x3257('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x3257('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3257('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4a8383){return function(_0x1fcec8,_0x16a25a,_0x518d8b){TeamEvents[_0x3257('0x4')](_0x4a8383+':'+_0x1fcec8['id'],_0x1fcec8);TeamEvents[_0x3257('0x4')](_0x4a8383,_0x1fcec8);_0x518d8b(null);};}for(var e in events){if(events[_0x3257('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x3257('0x6')]=TeamEvents; \ No newline at end of file +var _0xbe71=['hook','events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x430220,_0x4196dd){var _0x3b6da7=function(_0x552838){while(--_0x552838){_0x430220['push'](_0x430220['shift']());}};_0x3b6da7(++_0x4196dd);}(_0xbe71,0x172));var _0x1be7=function(_0x56c445,_0x3b5b87){_0x56c445=_0x56c445-0x0;var _0x5d729a=_0xbe71[_0x56c445];return _0x5d729a;};'use strict';var EventEmitter=require(_0x1be7('0x0'));var Team=require(_0x1be7('0x1'))['db'][_0x1be7('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x1be7('0x3')](0x0);var events={'afterCreate':_0x1be7('0x4'),'afterUpdate':'update','afterDestroy':_0x1be7('0x5')};function emitEvent(_0x38d2ac){return function(_0x19c6ad,_0x1c6fae,_0x7d88bc){TeamEvents[_0x1be7('0x6')](_0x38d2ac+':'+_0x19c6ad['id'],_0x19c6ad);TeamEvents[_0x1be7('0x6')](_0x38d2ac,_0x19c6ad);_0x7d88bc(null);};}for(var e in events){if(events[_0x1be7('0x7')](e)){var event=events[e];Team[_0x1be7('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6c6baf9..8af2389 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 _0x008c=['moment','request-promise','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','api'];(function(_0x39033b,_0x2c038c){var _0x5767f5=function(_0x289587){while(--_0x289587){_0x39033b['push'](_0x39033b['shift']());}};_0x5767f5(++_0x2c038c);}(_0x008c,0x188));var _0xc008=function(_0x3c1312,_0x45bfdb){_0x3c1312=_0x3c1312-0x0;var _0x5b4831=_0x008c[_0x3c1312];return _0x5b4831;};'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 attributes=require(_0xc008('0x6'));module[_0xc008('0x7')]=function(_0x163bd9,_0x1cbe76){return _0x163bd9[_0xc008('0x8')](_0xc008('0x9'),attributes,{'tableName':_0xc008('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['../../config/logger','api','moment','bluebird','request-promise','./team.attributes','Team','teams'];(function(_0x3512cc,_0x46be68){var _0x5b5b5f=function(_0x448dd3){while(--_0x448dd3){_0x3512cc['push'](_0x3512cc['shift']());}};_0x5b5b5f(++_0x46be68);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'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 6e7518a..d851374 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 _0x6212=['info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then'];(function(_0x20c290,_0x47e736){var _0x3d7b3b=function(_0x5d837f){while(--_0x5d837f){_0x20c290['push'](_0x20c290['shift']());}};_0x3d7b3b(++_0x47e736);}(_0x6212,0x199));var _0x2621=function(_0x3c6b7b,_0x228036){_0x3c6b7b=_0x3c6b7b-0x0;var _0x33ff7b=_0x6212[_0x3c6b7b];return _0x33ff7b;};'use strict';var _=require(_0x2621('0x0'));var util=require(_0x2621('0x1'));var moment=require(_0x2621('0x2'));var BPromise=require(_0x2621('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2621('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2621('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2621('0x6'));var client=jayson['client'][_0x2621('0x7')]({'port':0x232a});config['redis']=_[_0x2621('0x8')](config[_0x2621('0x9')],{'host':_0x2621('0xa'),'port':0x18eb});var socket=require(_0x2621('0xb'))(new Redis(config[_0x2621('0x9')]));require(_0x2621('0xc'))[_0x2621('0xd')](socket);function respondWithRpcPromise(_0x5e681b,_0x4c89a6,_0x1c1721){return new BPromise(function(_0x3002ad,_0x11c328){return client[_0x2621('0xe')](_0x5e681b,_0x1c1721)[_0x2621('0xf')](function(_0x25e6af){logger[_0x2621('0x10')](_0x2621('0x11'),_0x4c89a6,'request\x20sent');logger[_0x2621('0x12')](_0x2621('0x13'),_0x4c89a6,_0x2621('0x14'),JSON[_0x2621('0x15')](_0x25e6af));if(_0x25e6af[_0x2621('0x16')]){if(_0x25e6af['error'][_0x2621('0x17')]===0x1f4){logger[_0x2621('0x16')](_0x2621('0x11'),_0x4c89a6,_0x25e6af[_0x2621('0x16')]['message']);return _0x11c328(_0x25e6af['error'][_0x2621('0x18')]);}logger[_0x2621('0x16')]('Team,\x20%s,\x20%s',_0x4c89a6,_0x25e6af[_0x2621('0x16')]['message']);return _0x3002ad(_0x25e6af[_0x2621('0x16')][_0x2621('0x18')]);}else{logger['info'](_0x2621('0x11'),_0x4c89a6,_0x2621('0x14'));_0x3002ad(_0x25e6af['result'][_0x2621('0x18')]);}})['catch'](function(_0x59e13c){logger[_0x2621('0x16')](_0x2621('0x11'),_0x4c89a6,_0x59e13c);_0x11c328(_0x59e13c);});});} \ No newline at end of file +var _0xe70e=['rpc','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','Team,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3a5cb5,_0x272497){var _0xfd5c22=function(_0x430459){while(--_0x430459){_0x3a5cb5['push'](_0x3a5cb5['shift']());}};_0xfd5c22(++_0x272497);}(_0xe70e,0xc9));var _0xee70=function(_0x40c7b5,_0x50720d){_0x40c7b5=_0x40c7b5-0x0;var _0x2fa6bd=_0xe70e[_0x40c7b5];return _0x2fa6bd;};'use strict';var _=require('lodash');var util=require(_0xee70('0x0'));var moment=require(_0xee70('0x1'));var BPromise=require(_0xee70('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee70('0x3'));var db=require(_0xee70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee70('0x5'))(_0xee70('0x6'));var config=require('../../config/environment');var jayson=require(_0xee70('0x7'));var client=jayson['client'][_0xee70('0x8')]({'port':0x232a});config[_0xee70('0x9')]=_['defaults'](config[_0xee70('0x9')],{'host':_0xee70('0xa'),'port':0x18eb});var socket=require(_0xee70('0xb'))(new Redis(config[_0xee70('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x4e5ec8,_0x393b80,_0x457590){return new BPromise(function(_0x2e5fe5,_0x3ebf27){return client[_0xee70('0xc')](_0x4e5ec8,_0x457590)['then'](function(_0x2961a0){logger[_0xee70('0xd')](_0xee70('0xe'),_0x393b80,'request\x20sent');logger[_0xee70('0xf')]('Team,\x20%s,\x20%s,\x20%s',_0x393b80,_0xee70('0x10'),JSON[_0xee70('0x11')](_0x2961a0));if(_0x2961a0[_0xee70('0x12')]){if(_0x2961a0[_0xee70('0x12')][_0xee70('0x13')]===0x1f4){logger[_0xee70('0x12')](_0xee70('0xe'),_0x393b80,_0x2961a0[_0xee70('0x12')][_0xee70('0x14')]);return _0x3ebf27(_0x2961a0['error']['message']);}logger[_0xee70('0x12')](_0xee70('0xe'),_0x393b80,_0x2961a0[_0xee70('0x12')][_0xee70('0x14')]);return _0x2e5fe5(_0x2961a0[_0xee70('0x12')][_0xee70('0x14')]);}else{logger[_0xee70('0xd')]('Team,\x20%s,\x20%s',_0x393b80,_0xee70('0x10'));_0x2e5fe5(_0x2961a0[_0xee70('0x15')][_0xee70('0x14')]);}})[_0xee70('0x16')](function(_0x16bf5b){logger[_0xee70('0x12')]('Team,\x20%s,\x20%s',_0x393b80,_0x16bf5b);_0x3ebf27(_0x16bf5b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 103336f..ccb22c7 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 _0x7fa5=['team:','./team.events','remove','update','emit','removeListener','register','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fa5,0x1d9));var _0x57fa=function(_0x595978,_0x2caf9d){_0x595978=_0x595978-0x0;var _0x451457=_0x7fa5[_0x595978];return _0x451457;};'use strict';var TeamEvents=require(_0x57fa('0x0'));var events=['save',_0x57fa('0x1'),_0x57fa('0x2')];function createListener(_0x578f7c,_0x3261d6){return function(_0x2bd852){_0x3261d6[_0x57fa('0x3')](_0x578f7c,_0x2bd852);};}function removeListener(_0x55de4b,_0x4670da){return function(){TeamEvents[_0x57fa('0x4')](_0x55de4b,_0x4670da);};}exports[_0x57fa('0x5')]=function(_0xc54762){for(var _0x5d8a28=0x0,_0x32457c=events[_0x57fa('0x6')];_0x5d8a28<_0x32457c;_0x5d8a28++){var _0x1287dc=events[_0x5d8a28];var _0x13bcf5=createListener(_0x57fa('0x7')+_0x1287dc,_0xc54762);TeamEvents['on'](_0x1287dc,_0x13bcf5);}}; \ No newline at end of file +var _0xa5fc=['save','remove','update','emit','removeListener','register','team:','./team.events'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xa5fc,0x147));var _0xca5f=function(_0x4ff965,_0x2b1fdf){_0x4ff965=_0x4ff965-0x0;var _0x4abc37=_0xa5fc[_0x4ff965];return _0x4abc37;};'use strict';var TeamEvents=require(_0xca5f('0x0'));var events=[_0xca5f('0x1'),_0xca5f('0x2'),_0xca5f('0x3')];function createListener(_0x289765,_0x151185){return function(_0x4106a2){_0x151185[_0xca5f('0x4')](_0x289765,_0x4106a2);};}function removeListener(_0x5d92b1,_0x85511b){return function(){TeamEvents[_0xca5f('0x5')](_0x5d92b1,_0x85511b);};}exports[_0xca5f('0x6')]=function(_0x297d10){for(var _0x21c80a=0x0,_0x186004=events['length'];_0x21c80a<_0x186004;_0x21c80a++){var _0x526d31=events[_0x21c80a];var _0x580a66=createListener(_0xca5f('0x7')+_0x526d31,_0x297d10);TeamEvents['on'](_0x526d31,_0x580a66);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 20f15f6..9cb0681 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 _0xb333=['./template.controller','get','isAuthenticated','show','post','put','/:id','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4afdbd,_0x219daa){var _0x3a376d=function(_0x2baf86){while(--_0x2baf86){_0x4afdbd['push'](_0x4afdbd['shift']());}};_0x3a376d(++_0x219daa);}(_0xb333,0x12f));var _0x3b33=function(_0x203dc9,_0x3bdfa0){_0x203dc9=_0x203dc9-0x0;var _0x56a901=_0xb333[_0x203dc9];return _0x56a901;};'use strict';var multer=require(_0x3b33('0x0'));var util=require('util');var path=require(_0x3b33('0x1'));var timeout=require('connect-timeout');var express=require(_0x3b33('0x2'));var router=express['Router']();var auth=require(_0x3b33('0x3'));var interaction=require(_0x3b33('0x4'));var config=require('../../config/environment');var controller=require(_0x3b33('0x5'));router[_0x3b33('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3b33('0x6')]('/:id',auth[_0x3b33('0x7')](),controller[_0x3b33('0x8')]);router[_0x3b33('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b33('0xa')](_0x3b33('0xb'),auth[_0x3b33('0x7')](),controller['update']);router['delete'](_0x3b33('0xb'),auth[_0x3b33('0x7')](),controller[_0x3b33('0xc')]);module[_0x3b33('0xd')]=router; \ No newline at end of file +var _0x5337=['isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x5a9b15,_0x252aa6){var _0x1b3e10=function(_0x391cd1){while(--_0x391cd1){_0x5a9b15['push'](_0x5a9b15['shift']());}};_0x1b3e10(++_0x252aa6);}(_0x5337,0x104));var _0x7533=function(_0x501c00,_0x1dc98b){_0x501c00=_0x501c00-0x0;var _0x5ad836=_0x5337[_0x501c00];return _0x5ad836;};'use strict';var multer=require(_0x7533('0x0'));var util=require(_0x7533('0x1'));var path=require('path');var timeout=require(_0x7533('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7533('0x3'));var config=require(_0x7533('0x4'));var controller=require(_0x7533('0x5'));router['get']('/',auth[_0x7533('0x6')](),controller[_0x7533('0x7')]);router['get'](_0x7533('0x8'),auth[_0x7533('0x6')](),controller[_0x7533('0x9')]);router['post']('/',auth[_0x7533('0x6')](),controller[_0x7533('0xa')]);router['put'](_0x7533('0x8'),auth[_0x7533('0x6')](),controller[_0x7533('0xb')]);router[_0x7533('0xc')](_0x7533('0x8'),auth[_0x7533('0x6')](),controller[_0x7533('0xd')]);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 df4d6e2..63e309e 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 _0x49b0=['TEXT','sequelize'];(function(_0x342bff,_0x2b1c75){var _0x46c972=function(_0x583637){while(--_0x583637){_0x342bff['push'](_0x342bff['shift']());}};_0x46c972(++_0x2b1c75);}(_0x49b0,0x93));var _0x049b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x49b0[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x049b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x049b('0x1')]}}; \ No newline at end of file +var _0x5d44=['TEXT','sequelize','STRING'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0x5d44,0x190));var _0x45d4=function(_0x4bd419,_0x476291){_0x4bd419=_0x4bd419-0x0;var _0x3cbe13=_0x5d44[_0x4bd419];return _0x3cbe13;};'use strict';var Sequelize=require(_0x45d4('0x0'));module['exports']={'name':{'type':Sequelize[_0x45d4('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x45d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9227bfa..6fd93e0 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 _0xfab7=['where','pick','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','create','body','user','get','role','UserProfileSection','find','autoAssociation','UserProfileResource','name','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','Templates','error','stack','index','Template','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfab7,0xbc));var _0x7fab=function(_0x2ab127,_0x2b23e2){_0x2ab127=_0x2ab127-0x0;var _0x5d4b82=_0xfab7[_0x2ab127];return _0x5d4b82;};'use strict';var pdf=require(_0x7fab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7fab('0x1'));var zipdir=require(_0x7fab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fab('0x3'));var moment=require(_0x7fab('0x4'));var BPromise=require(_0x7fab('0x5'));var Mustache=require('mustache');var util=require(_0x7fab('0x6'));var path=require(_0x7fab('0x7'));var sox=require('sox');var csv=require(_0x7fab('0x8'));var ejs=require(_0x7fab('0x9'));var fs=require('fs');var _=require(_0x7fab('0xa'));var squel=require(_0x7fab('0xb'));var crypto=require(_0x7fab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fab('0xd'));var toCsv=require(_0x7fab('0x8'));var querystring=require(_0x7fab('0xe'));var Papa=require(_0x7fab('0xf'));var authService=require(_0x7fab('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7fab('0x11'));var qs=require(_0x7fab('0x12'));var logger=require(_0x7fab('0x13'))(_0x7fab('0x14'));var utils=require(_0x7fab('0x15'));var config=require(_0x7fab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cc2cb,_0x33d17f){_0x33d17f=_0x33d17f||0xcc;return function(_0x1de9c1){if(_0x1de9c1){return _0x3cc2cb['sendStatus'](_0x33d17f);}return _0x3cc2cb[_0x7fab('0x17')](_0x33d17f)[_0x7fab('0x18')]();};}function respondWithResult(_0x2feb66,_0x42af7f){_0x42af7f=_0x42af7f||0xc8;return function(_0x20f465){if(_0x20f465){return _0x2feb66[_0x7fab('0x17')](_0x42af7f)[_0x7fab('0x19')](_0x20f465);}};}function respondWithFilteredResult(_0xcaa78d,_0x3a9c0c){return function(_0x430c5c){if(_0x430c5c){var _0x5f5892=_0x430c5c[_0x7fab('0x1a')],_0x7e016d=_0x3a9c0c[_0x7fab('0x1b')],_0x241b9a=_0x3a9c0c[_0x7fab('0x1b')]+_0x3a9c0c[_0x7fab('0x1c')],_0x4b5fe4;if(_0x241b9a>=_0x5f5892){_0x241b9a=_0x5f5892;_0x4b5fe4=0xc8;}else{_0x4b5fe4=0xce;}_0xcaa78d['status'](_0x4b5fe4);return _0xcaa78d[_0x7fab('0x1d')](_0x7fab('0x1e'),_0x7e016d+'-'+_0x241b9a+'/'+_0x5f5892)[_0x7fab('0x19')](_0x430c5c);}return null;};}function patchUpdates(_0x23f308){return function(_0x2444ba){try{jsonpatch['apply'](_0x2444ba,_0x23f308,!![]);}catch(_0x1bbe9a){return BPromise['reject'](_0x1bbe9a);}return _0x2444ba[_0x7fab('0x1f')]();};}function saveUpdates(_0x563c24,_0x283b4a){return function(_0x59f197){if(_0x59f197){return _0x59f197[_0x7fab('0x20')](_0x563c24)[_0x7fab('0x21')](function(_0x2b9d85){return _0x2b9d85;});}return null;};}function removeEntity(_0x43a132,_0x3a85e4){return function(_0x474389){if(_0x474389){return _0x474389[_0x7fab('0x22')]()[_0x7fab('0x21')](function(){var _0x289290=_0x474389['get']({'plain':!![]});var _0x528b83=_0x7fab('0x23');return db['UserProfileResource'][_0x7fab('0x22')]({'where':{'type':_0x528b83,'resourceId':_0x289290['id']}})[_0x7fab('0x21')](function(){return _0x474389;});})[_0x7fab('0x21')](function(){_0x43a132[_0x7fab('0x17')](0xcc)[_0x7fab('0x18')]();});}};}function handleEntityNotFound(_0x3ccc2e,_0x32298b){return function(_0x369692){if(!_0x369692){_0x3ccc2e['sendStatus'](0x194);}return _0x369692;};}function handleError(_0x22d4e4,_0x483db4){_0x483db4=_0x483db4||0x1f4;return function(_0x3727be){logger[_0x7fab('0x24')](_0x3727be[_0x7fab('0x25')]);if(_0x3727be['name']){delete _0x3727be['name'];}_0x22d4e4[_0x7fab('0x17')](_0x483db4)['send'](_0x3727be);};}exports[_0x7fab('0x26')]=function(_0x1b0563,_0x49cae2){var _0x4dff26={},_0x4f801a={},_0x4899bd={'count':0x0,'rows':[]};var _0x462d71=db[_0x7fab('0x27')][_0x7fab('0x28')];_0x4f801a[_0x7fab('0x29')]=_['keys'](_0x462d71);_0x4f801a['query']=_['keys'](_0x1b0563[_0x7fab('0x2a')]);_0x4f801a[_0x7fab('0x2b')]=_[_0x7fab('0x2c')](_0x4f801a[_0x7fab('0x29')],_0x4f801a[_0x7fab('0x2a')]);_0x4dff26[_0x7fab('0x2d')]=_[_0x7fab('0x2c')](_0x4f801a[_0x7fab('0x29')],qs[_0x7fab('0x2e')](_0x1b0563[_0x7fab('0x2a')][_0x7fab('0x2e')]));_0x4dff26[_0x7fab('0x2d')]=_0x4dff26[_0x7fab('0x2d')][_0x7fab('0x2f')]?_0x4dff26['attributes']:_0x4f801a[_0x7fab('0x29')];if(!_0x1b0563[_0x7fab('0x2a')][_0x7fab('0x30')](_0x7fab('0x31'))){_0x4dff26[_0x7fab('0x1c')]=qs[_0x7fab('0x1c')](_0x1b0563[_0x7fab('0x2a')]['limit']);_0x4dff26[_0x7fab('0x1b')]=qs['offset'](_0x1b0563[_0x7fab('0x2a')][_0x7fab('0x1b')]);}_0x4dff26[_0x7fab('0x32')]=qs[_0x7fab('0x33')](_0x1b0563[_0x7fab('0x2a')]['sort']);_0x4dff26[_0x7fab('0x34')]=qs[_0x7fab('0x2b')](_[_0x7fab('0x35')](_0x1b0563[_0x7fab('0x2a')],_0x4f801a[_0x7fab('0x2b')]));if(_0x1b0563[_0x7fab('0x2a')]['filter']){_0x4dff26[_0x7fab('0x34')]=_['merge'](_0x4dff26[_0x7fab('0x34')],{'$or':_[_0x7fab('0x36')](_0x462d71,function(_0x160e88){if(_0x160e88[_0x7fab('0x37')][_0x7fab('0x38')]!==_0x7fab('0x39')){var _0x42f9e6={};_0x42f9e6[_0x160e88[_0x7fab('0x3a')]]={'$like':'%'+_0x1b0563[_0x7fab('0x2a')][_0x7fab('0x3b')]+'%'};return _0x42f9e6;}})});}_0x4dff26=_[_0x7fab('0x3c')]({},_0x4dff26,_0x1b0563[_0x7fab('0x3d')]);var _0x249361={'where':_0x4dff26['where']};return db[_0x7fab('0x27')]['count'](_0x249361)[_0x7fab('0x21')](function(_0x32cc1f){_0x4899bd[_0x7fab('0x1a')]=_0x32cc1f;if(_0x1b0563[_0x7fab('0x2a')][_0x7fab('0x3e')]){_0x4dff26[_0x7fab('0x3f')]=[{'all':!![]}];}return db[_0x7fab('0x27')][_0x7fab('0x40')](_0x4dff26);})[_0x7fab('0x21')](function(_0x542e63){_0x4899bd[_0x7fab('0x41')]=_0x542e63;return _0x4899bd;})[_0x7fab('0x21')](respondWithFilteredResult(_0x49cae2,_0x4dff26))[_0x7fab('0x42')](handleError(_0x49cae2,null));};exports[_0x7fab('0x43')]=function(_0x2d5695,_0x23737c){var _0x4b7d05={'raw':!![],'where':{'id':_0x2d5695['params']['id']}},_0x207094={};_0x207094[_0x7fab('0x29')]=_[_0x7fab('0x44')](db[_0x7fab('0x27')]['rawAttributes']);_0x207094[_0x7fab('0x2a')]=_[_0x7fab('0x44')](_0x2d5695[_0x7fab('0x2a')]);_0x207094['filters']=_[_0x7fab('0x2c')](_0x207094[_0x7fab('0x29')],_0x207094[_0x7fab('0x2a')]);_0x4b7d05[_0x7fab('0x2d')]=_[_0x7fab('0x2c')](_0x207094['model'],qs[_0x7fab('0x2e')](_0x2d5695[_0x7fab('0x2a')][_0x7fab('0x2e')]));_0x4b7d05[_0x7fab('0x2d')]=_0x4b7d05[_0x7fab('0x2d')][_0x7fab('0x2f')]?_0x4b7d05[_0x7fab('0x2d')]:_0x207094['model'];if(_0x2d5695[_0x7fab('0x2a')][_0x7fab('0x3e')]){_0x4b7d05[_0x7fab('0x3f')]=[{'all':!![]}];}_0x4b7d05=_[_0x7fab('0x3c')]({},_0x4b7d05,_0x2d5695['options']);return db[_0x7fab('0x27')]['find'](_0x4b7d05)['then'](handleEntityNotFound(_0x23737c,null))[_0x7fab('0x21')](respondWithResult(_0x23737c,null))['catch'](handleError(_0x23737c,null));};exports[_0x7fab('0x45')]=function(_0x27a55c,_0x1e530e){return db['Template'][_0x7fab('0x45')](_0x27a55c[_0x7fab('0x46')],{})[_0x7fab('0x21')](function(_0x3ab479){var _0x13f259=_0x27a55c[_0x7fab('0x47')][_0x7fab('0x48')]({'plain':!![]});if(!_0x13f259)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13f259[_0x7fab('0x49')]==='user'){var _0x2a55e1=_0x3ab479[_0x7fab('0x48')]({'plain':!![]});var _0x442211=_0x7fab('0x23');return db[_0x7fab('0x4a')][_0x7fab('0x4b')]({'where':{'name':_0x442211,'userProfileId':_0x13f259['userProfileId']},'raw':!![]})[_0x7fab('0x21')](function(_0xea0053){if(_0xea0053&&_0xea0053[_0x7fab('0x4c')]===0x0){return db[_0x7fab('0x4d')][_0x7fab('0x45')]({'name':_0x2a55e1[_0x7fab('0x4e')],'resourceId':_0x2a55e1['id'],'type':_0xea0053[_0x7fab('0x4e')],'sectionId':_0xea0053['id']},{})['then'](function(){return _0x3ab479;});}else{return _0x3ab479;}})['catch'](function(_0x59e4c7){logger[_0x7fab('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59e4c7);throw _0x59e4c7;});}return _0x3ab479;})[_0x7fab('0x21')](respondWithResult(_0x1e530e,0xc9))['catch'](handleError(_0x1e530e,null));};exports['update']=function(_0x4adfe9,_0x36022e){if(_0x4adfe9['body']['id']){delete _0x4adfe9[_0x7fab('0x46')]['id'];}return db[_0x7fab('0x27')][_0x7fab('0x4b')]({'where':{'id':_0x4adfe9['params']['id']}})[_0x7fab('0x21')](handleEntityNotFound(_0x36022e,null))[_0x7fab('0x21')](saveUpdates(_0x4adfe9[_0x7fab('0x46')],null))[_0x7fab('0x21')](respondWithResult(_0x36022e,null))['catch'](handleError(_0x36022e,null));};exports[_0x7fab('0x22')]=function(_0x32852a,_0x162489){return db['Template'][_0x7fab('0x4b')]({'where':{'id':_0x32852a[_0x7fab('0x4f')]['id']}})[_0x7fab('0x21')](handleEntityNotFound(_0x162489,null))[_0x7fab('0x21')](removeEntity(_0x162489,null))['catch'](handleError(_0x162489,null));}; \ No newline at end of file +var _0x4ee0=['end','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','map','type','field','options','Template','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','get','UserProfileResource','destroy'];(function(_0x1a58b3,_0x2e191e){var _0xc153b3=function(_0x2fd92e){while(--_0x2fd92e){_0x1a58b3['push'](_0x1a58b3['shift']());}};_0xc153b3(++_0x2e191e);}(_0x4ee0,0x78));var _0x04ee=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4ee0[_0x209941];return _0x1e8729;};'use strict';var pdf=require(_0x04ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x04ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x04ee('0x2'));var moment=require(_0x04ee('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x04ee('0x4'));var util=require(_0x04ee('0x5'));var path=require(_0x04ee('0x6'));var sox=require(_0x04ee('0x7'));var csv=require('to-csv');var ejs=require(_0x04ee('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x04ee('0x9'));var jsforce=require(_0x04ee('0xa'));var deskjs=require(_0x04ee('0xb'));var toCsv=require(_0x04ee('0xc'));var querystring=require(_0x04ee('0xd'));var Papa=require('papaparse');var authService=require(_0x04ee('0xe'));var hardwareService=require(_0x04ee('0xf'));var Redis=require('ioredis');var qs=require(_0x04ee('0x10'));var logger=require(_0x04ee('0x11'))(_0x04ee('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x04ee('0x13'))['db'];function respondWithStatusCode(_0x289487,_0x330915){_0x330915=_0x330915||0xcc;return function(_0x4b3ef4){if(_0x4b3ef4){return _0x289487[_0x04ee('0x14')](_0x330915);}return _0x289487[_0x04ee('0x15')](_0x330915)['end']();};}function respondWithResult(_0x14def1,_0x1ab8e2){_0x1ab8e2=_0x1ab8e2||0xc8;return function(_0x1ce85f){if(_0x1ce85f){return _0x14def1[_0x04ee('0x15')](_0x1ab8e2)['json'](_0x1ce85f);}};}function respondWithFilteredResult(_0x40a8d1,_0x386d8a){return function(_0x3c1fef){if(_0x3c1fef){var _0x55a02a=_0x3c1fef[_0x04ee('0x16')],_0x12fe91=_0x386d8a[_0x04ee('0x17')],_0x342dd2=_0x386d8a[_0x04ee('0x17')]+_0x386d8a[_0x04ee('0x18')],_0x4ce126;if(_0x342dd2>=_0x55a02a){_0x342dd2=_0x55a02a;_0x4ce126=0xc8;}else{_0x4ce126=0xce;}_0x40a8d1['status'](_0x4ce126);return _0x40a8d1['set'](_0x04ee('0x19'),_0x12fe91+'-'+_0x342dd2+'/'+_0x55a02a)[_0x04ee('0x1a')](_0x3c1fef);}return null;};}function patchUpdates(_0x56f063){return function(_0x856b4e){try{jsonpatch['apply'](_0x856b4e,_0x56f063,!![]);}catch(_0x4d08fa){return BPromise[_0x04ee('0x1b')](_0x4d08fa);}return _0x856b4e[_0x04ee('0x1c')]();};}function saveUpdates(_0x461372,_0x2a4f20){return function(_0x41ce9a){if(_0x41ce9a){return _0x41ce9a[_0x04ee('0x1d')](_0x461372)[_0x04ee('0x1e')](function(_0x567b32){return _0x567b32;});}return null;};}function removeEntity(_0x115d4a,_0x236d1b){return function(_0x1299b2){if(_0x1299b2){return _0x1299b2['destroy']()[_0x04ee('0x1e')](function(){var _0x41bd74=_0x1299b2[_0x04ee('0x1f')]({'plain':!![]});var _0x4d6b3f='Templates';return db[_0x04ee('0x20')][_0x04ee('0x21')]({'where':{'type':_0x4d6b3f,'resourceId':_0x41bd74['id']}})['then'](function(){return _0x1299b2;});})['then'](function(){_0x115d4a[_0x04ee('0x15')](0xcc)[_0x04ee('0x22')]();});}};}function handleEntityNotFound(_0x204a19,_0x5dd404){return function(_0x1d11c6){if(!_0x1d11c6){_0x204a19[_0x04ee('0x14')](0x194);}return _0x1d11c6;};}function handleError(_0x2dc668,_0x185dc4){_0x185dc4=_0x185dc4||0x1f4;return function(_0xd3d824){logger['error'](_0xd3d824['stack']);if(_0xd3d824['name']){delete _0xd3d824[_0x04ee('0x23')];}_0x2dc668[_0x04ee('0x15')](_0x185dc4)[_0x04ee('0x24')](_0xd3d824);};}exports[_0x04ee('0x25')]=function(_0x3bb3ef,_0x54bdf5){var _0xe31591={},_0x2d70d7={},_0x225e60={'count':0x0,'rows':[]};var _0x14db8e=db['Template']['rawAttributes'];_0x2d70d7[_0x04ee('0x26')]=_[_0x04ee('0x27')](_0x14db8e);_0x2d70d7[_0x04ee('0x28')]=_[_0x04ee('0x27')](_0x3bb3ef[_0x04ee('0x28')]);_0x2d70d7[_0x04ee('0x29')]=_[_0x04ee('0x2a')](_0x2d70d7['model'],_0x2d70d7['query']);_0xe31591[_0x04ee('0x2b')]=_[_0x04ee('0x2a')](_0x2d70d7[_0x04ee('0x26')],qs[_0x04ee('0x2c')](_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x2c')]));_0xe31591[_0x04ee('0x2b')]=_0xe31591[_0x04ee('0x2b')][_0x04ee('0x2d')]?_0xe31591[_0x04ee('0x2b')]:_0x2d70d7['model'];if(!_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x2e')](_0x04ee('0x2f'))){_0xe31591[_0x04ee('0x18')]=qs[_0x04ee('0x18')](_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x18')]);_0xe31591[_0x04ee('0x17')]=qs['offset'](_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x17')]);}_0xe31591[_0x04ee('0x30')]=qs[_0x04ee('0x31')](_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x31')]);_0xe31591['where']=qs[_0x04ee('0x29')](_['pick'](_0x3bb3ef[_0x04ee('0x28')],_0x2d70d7['filters']));if(_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x32')]){_0xe31591['where']=_[_0x04ee('0x33')](_0xe31591[_0x04ee('0x34')],{'$or':_[_0x04ee('0x35')](_0x14db8e,function(_0x177fe3){if(_0x177fe3[_0x04ee('0x36')]['key']!=='VIRTUAL'){var _0x4b1aeb={};_0x4b1aeb[_0x177fe3[_0x04ee('0x37')]]={'$like':'%'+_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x32')]+'%'};return _0x4b1aeb;}})});}_0xe31591=_['merge']({},_0xe31591,_0x3bb3ef[_0x04ee('0x38')]);var _0x2f5d35={'where':_0xe31591[_0x04ee('0x34')]};return db[_0x04ee('0x39')][_0x04ee('0x16')](_0x2f5d35)[_0x04ee('0x1e')](function(_0x59de73){_0x225e60['count']=_0x59de73;if(_0x3bb3ef[_0x04ee('0x28')][_0x04ee('0x3a')]){_0xe31591[_0x04ee('0x3b')]=[{'all':!![]}];}return db[_0x04ee('0x39')][_0x04ee('0x3c')](_0xe31591);})['then'](function(_0x1c6d4e){_0x225e60[_0x04ee('0x3d')]=_0x1c6d4e;return _0x225e60;})[_0x04ee('0x1e')](respondWithFilteredResult(_0x54bdf5,_0xe31591))[_0x04ee('0x3e')](handleError(_0x54bdf5,null));};exports[_0x04ee('0x3f')]=function(_0x38deb5,_0x19bd61){var _0x466844={'raw':!![],'where':{'id':_0x38deb5[_0x04ee('0x40')]['id']}},_0x525f72={};_0x525f72['model']=_[_0x04ee('0x27')](db[_0x04ee('0x39')][_0x04ee('0x41')]);_0x525f72['query']=_[_0x04ee('0x27')](_0x38deb5['query']);_0x525f72[_0x04ee('0x29')]=_[_0x04ee('0x2a')](_0x525f72[_0x04ee('0x26')],_0x525f72[_0x04ee('0x28')]);_0x466844[_0x04ee('0x2b')]=_[_0x04ee('0x2a')](_0x525f72['model'],qs[_0x04ee('0x2c')](_0x38deb5[_0x04ee('0x28')][_0x04ee('0x2c')]));_0x466844['attributes']=_0x466844[_0x04ee('0x2b')][_0x04ee('0x2d')]?_0x466844[_0x04ee('0x2b')]:_0x525f72[_0x04ee('0x26')];if(_0x38deb5[_0x04ee('0x28')][_0x04ee('0x3a')]){_0x466844['include']=[{'all':!![]}];}_0x466844=_[_0x04ee('0x33')]({},_0x466844,_0x38deb5[_0x04ee('0x38')]);return db[_0x04ee('0x39')][_0x04ee('0x42')](_0x466844)[_0x04ee('0x1e')](handleEntityNotFound(_0x19bd61,null))[_0x04ee('0x1e')](respondWithResult(_0x19bd61,null))[_0x04ee('0x3e')](handleError(_0x19bd61,null));};exports[_0x04ee('0x43')]=function(_0x1378cc,_0x2da029){return db[_0x04ee('0x39')][_0x04ee('0x43')](_0x1378cc[_0x04ee('0x44')],{})[_0x04ee('0x1e')](function(_0x4cf43d){var _0x33992e=_0x1378cc['user'][_0x04ee('0x1f')]({'plain':!![]});if(!_0x33992e)throw new Error(_0x04ee('0x45'));if(_0x33992e[_0x04ee('0x46')]===_0x04ee('0x47')){var _0x35fe65=_0x4cf43d[_0x04ee('0x1f')]({'plain':!![]});var _0x3f73b5=_0x04ee('0x48');return db['UserProfileSection'][_0x04ee('0x42')]({'where':{'name':_0x3f73b5,'userProfileId':_0x33992e[_0x04ee('0x49')]},'raw':!![]})[_0x04ee('0x1e')](function(_0x58bd68){if(_0x58bd68&&_0x58bd68[_0x04ee('0x4a')]===0x0){return db[_0x04ee('0x20')]['create']({'name':_0x35fe65[_0x04ee('0x23')],'resourceId':_0x35fe65['id'],'type':_0x58bd68['name'],'sectionId':_0x58bd68['id']},{})[_0x04ee('0x1e')](function(){return _0x4cf43d;});}else{return _0x4cf43d;}})[_0x04ee('0x3e')](function(_0x53c810){logger[_0x04ee('0x4b')](_0x04ee('0x4c'),_0x53c810);throw _0x53c810;});}return _0x4cf43d;})[_0x04ee('0x1e')](respondWithResult(_0x2da029,0xc9))['catch'](handleError(_0x2da029,null));};exports['update']=function(_0x4fc416,_0x401c81){if(_0x4fc416['body']['id']){delete _0x4fc416[_0x04ee('0x44')]['id'];}return db['Template'][_0x04ee('0x42')]({'where':{'id':_0x4fc416[_0x04ee('0x40')]['id']}})[_0x04ee('0x1e')](handleEntityNotFound(_0x401c81,null))['then'](saveUpdates(_0x4fc416[_0x04ee('0x44')],null))[_0x04ee('0x1e')](respondWithResult(_0x401c81,null))[_0x04ee('0x3e')](handleError(_0x401c81,null));};exports[_0x04ee('0x21')]=function(_0x11f2ce,_0x2ae12f){return db[_0x04ee('0x39')]['find']({'where':{'id':_0x11f2ce[_0x04ee('0x40')]['id']}})['then'](handleEntityNotFound(_0x2ae12f,null))[_0x04ee('0x1e')](removeEntity(_0x2ae12f,null))[_0x04ee('0x3e')](handleError(_0x2ae12f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 9af626a..cc13198 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 _0x6724=['moment','bluebird','request-promise','./template.attributes','exports','define','tools_templates','lodash','../../config/logger','api'];(function(_0xc0754,_0x37f107){var _0x195498=function(_0x23dba7){while(--_0x23dba7){_0xc0754['push'](_0xc0754['shift']());}};_0x195498(++_0x37f107);}(_0x6724,0x7f));var _0x4672=function(_0x2e5e4c,_0xf51944){_0x2e5e4c=_0x2e5e4c-0x0;var _0x527308=_0x6724[_0x2e5e4c];return _0x527308;};'use strict';var _=require(_0x4672('0x0'));var util=require('util');var logger=require(_0x4672('0x1'))(_0x4672('0x2'));var moment=require(_0x4672('0x3'));var BPromise=require(_0x4672('0x4'));var rp=require(_0x4672('0x5'));var attributes=require(_0x4672('0x6'));module[_0x4672('0x7')]=function(_0x248b85,_0x27e168){return _0x248b85[_0x4672('0x8')]('Template',attributes,{'tableName':_0x4672('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c22=['./template.attributes','exports','define','../../config/logger','api','moment','request-promise'];(function(_0x584f66,_0x39a037){var _0x3908b4=function(_0x452df3){while(--_0x452df3){_0x584f66['push'](_0x584f66['shift']());}};_0x3908b4(++_0x39a037);}(_0x8c22,0xa4));var _0x28c2=function(_0xf273f9,_0x486198){_0xf273f9=_0xf273f9-0x0;var _0xb4abcc=_0x8c22[_0xf273f9];return _0xb4abcc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28c2('0x0'))(_0x28c2('0x1'));var moment=require(_0x28c2('0x2'));var BPromise=require('bluebird');var rp=require(_0x28c2('0x3'));var attributes=require(_0x28c2('0x4'));module[_0x28c2('0x5')]=function(_0x4a4f1c,_0x937f5d){return _0x4a4f1c[_0x28c2('0x6')]('Template',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 94a61e3..8981185 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 _0xea64=['jayson/promise','http','then','info','request\x20sent','debug','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','options','raw','limit','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x405ff2,_0x1d189a){var _0x181adc=function(_0x1cb7a9){while(--_0x1cb7a9){_0x405ff2['push'](_0x405ff2['shift']());}};_0x181adc(++_0x1d189a);}(_0xea64,0xdf));var _0x4ea6=function(_0x46d21a,_0x593a51){_0x46d21a=_0x46d21a-0x0;var _0x2464d0=_0xea64[_0x46d21a];return _0x2464d0;};'use strict';var _=require('lodash');var util=require(_0x4ea6('0x0'));var moment=require(_0x4ea6('0x1'));var BPromise=require(_0x4ea6('0x2'));var rs=require(_0x4ea6('0x3'));var fs=require('fs');var Redis=require(_0x4ea6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ea6('0x5'));var logger=require(_0x4ea6('0x6'))(_0x4ea6('0x7'));var config=require(_0x4ea6('0x8'));var jayson=require(_0x4ea6('0x9'));var client=jayson['client'][_0x4ea6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dc440,_0x237e0e,_0x323d86){return new BPromise(function(_0x26cdca,_0x2a37c5){return client['request'](_0x2dc440,_0x323d86)[_0x4ea6('0xb')](function(_0x40ff3e){logger[_0x4ea6('0xc')]('Template,\x20%s,\x20%s',_0x237e0e,_0x4ea6('0xd'));logger[_0x4ea6('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x237e0e,_0x4ea6('0xd'),JSON['stringify'](_0x40ff3e));if(_0x40ff3e[_0x4ea6('0xf')]){if(_0x40ff3e['error']['code']===0x1f4){logger[_0x4ea6('0xf')](_0x4ea6('0x10'),_0x237e0e,_0x40ff3e[_0x4ea6('0xf')][_0x4ea6('0x11')]);return _0x2a37c5(_0x40ff3e[_0x4ea6('0xf')]['message']);}logger[_0x4ea6('0xf')]('Template,\x20%s,\x20%s',_0x237e0e,_0x40ff3e['error'][_0x4ea6('0x11')]);return _0x26cdca(_0x40ff3e['error'][_0x4ea6('0x11')]);}else{logger[_0x4ea6('0xc')]('Template,\x20%s,\x20%s',_0x237e0e,_0x4ea6('0xd'));_0x26cdca(_0x40ff3e[_0x4ea6('0x12')][_0x4ea6('0x11')]);}})[_0x4ea6('0x13')](function(_0x4ae56b){logger[_0x4ea6('0xf')](_0x4ea6('0x10'),_0x237e0e,_0x4ae56b);_0x2a37c5(_0x4ae56b);});});}exports[_0x4ea6('0x14')]=function(_0x5015c7){var _0x99c198=this;return new Promise(function(_0x199ff3,_0x2754f3){return db[_0x4ea6('0x15')]['findAll']({'raw':_0x5015c7['options']?_0x5015c7[_0x4ea6('0x16')][_0x4ea6('0x17')]===undefined?!![]:![]:!![],'where':_0x5015c7['options']?_0x5015c7[_0x4ea6('0x16')]['where']||null:null,'attributes':_0x5015c7['options']?_0x5015c7[_0x4ea6('0x16')]['attributes']||null:null,'limit':_0x5015c7[_0x4ea6('0x16')]?_0x5015c7[_0x4ea6('0x16')][_0x4ea6('0x18')]||null:null,'include':_0x5015c7[_0x4ea6('0x16')]?_0x5015c7[_0x4ea6('0x16')][_0x4ea6('0x19')]?_[_0x4ea6('0x1a')](_0x5015c7['options'][_0x4ea6('0x19')],function(_0x48f9c0){return{'model':db[_0x48f9c0[_0x4ea6('0x1b')]],'as':_0x48f9c0['as'],'attributes':_0x48f9c0['attributes'],'include':_0x48f9c0[_0x4ea6('0x19')]?_[_0x4ea6('0x1a')](_0x48f9c0[_0x4ea6('0x19')],function(_0x27afdb){return{'model':db[_0x27afdb['model']],'as':_0x27afdb['as'],'attributes':_0x27afdb['attributes'],'include':_0x27afdb[_0x4ea6('0x19')]?_['map'](_0x27afdb[_0x4ea6('0x19')],function(_0x5a0e7f){return{'model':db[_0x5a0e7f[_0x4ea6('0x1b')]],'as':_0x5a0e7f['as'],'attributes':_0x5a0e7f[_0x4ea6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4ea6('0xb')](function(_0x145b2d){logger[_0x4ea6('0xc')]('GetTemplate',_0x5015c7);logger[_0x4ea6('0xe')](_0x4ea6('0x14'),_0x5015c7,JSON['stringify'](_0x145b2d));_0x199ff3(_0x145b2d);})[_0x4ea6('0x13')](function(_0x49c873){logger[_0x4ea6('0xf')](_0x4ea6('0x14'),_0x49c873[_0x4ea6('0x11')],_0x5015c7);_0x2754f3(_0x99c198[_0x4ea6('0xf')](0x1f4,_0x49c873[_0x4ea6('0x11')]));});});}; \ No newline at end of file +var _0x36b9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','Template','findAll','options','raw','where','attributes','include','map','model','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x47f334,_0x3c36d9){var _0x2ee229=function(_0x41dd38){while(--_0x41dd38){_0x47f334['push'](_0x47f334['shift']());}};_0x2ee229(++_0x3c36d9);}(_0x36b9,0xba));var _0x936b=function(_0xee37ff,_0x524a2e){_0xee37ff=_0xee37ff-0x0;var _0x36ae25=_0x36b9[_0xee37ff];return _0x36ae25;};'use strict';var _=require(_0x936b('0x0'));var util=require(_0x936b('0x1'));var moment=require(_0x936b('0x2'));var BPromise=require(_0x936b('0x3'));var rs=require(_0x936b('0x4'));var fs=require('fs');var Redis=require(_0x936b('0x5'));var db=require(_0x936b('0x6'))['db'];var utils=require(_0x936b('0x7'));var logger=require('../../config/logger')(_0x936b('0x8'));var config=require(_0x936b('0x9'));var jayson=require(_0x936b('0xa'));var client=jayson[_0x936b('0xb')][_0x936b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2411b4,_0x172176,_0x284387){return new BPromise(function(_0x4c80a0,_0x3ae565){return client['request'](_0x2411b4,_0x284387)[_0x936b('0xd')](function(_0x472845){logger['info'](_0x936b('0xe'),_0x172176,_0x936b('0xf'));logger[_0x936b('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x172176,_0x936b('0xf'),JSON['stringify'](_0x472845));if(_0x472845[_0x936b('0x11')]){if(_0x472845['error'][_0x936b('0x12')]===0x1f4){logger['error'](_0x936b('0xe'),_0x172176,_0x472845[_0x936b('0x11')]['message']);return _0x3ae565(_0x472845[_0x936b('0x11')][_0x936b('0x13')]);}logger[_0x936b('0x11')](_0x936b('0xe'),_0x172176,_0x472845['error']['message']);return _0x4c80a0(_0x472845[_0x936b('0x11')]['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0x172176,_0x936b('0xf'));_0x4c80a0(_0x472845['result'][_0x936b('0x13')]);}})[_0x936b('0x14')](function(_0x4e19ea){logger[_0x936b('0x11')](_0x936b('0xe'),_0x172176,_0x4e19ea);_0x3ae565(_0x4e19ea);});});}exports['GetTemplate']=function(_0x43a29c){var _0x507c40=this;return new Promise(function(_0x4d83c1,_0x3d6f15){return db[_0x936b('0x15')][_0x936b('0x16')]({'raw':_0x43a29c[_0x936b('0x17')]?_0x43a29c[_0x936b('0x17')][_0x936b('0x18')]===undefined?!![]:![]:!![],'where':_0x43a29c[_0x936b('0x17')]?_0x43a29c['options'][_0x936b('0x19')]||null:null,'attributes':_0x43a29c['options']?_0x43a29c[_0x936b('0x17')][_0x936b('0x1a')]||null:null,'limit':_0x43a29c[_0x936b('0x17')]?_0x43a29c[_0x936b('0x17')]['limit']||null:null,'include':_0x43a29c[_0x936b('0x17')]?_0x43a29c[_0x936b('0x17')][_0x936b('0x1b')]?_[_0x936b('0x1c')](_0x43a29c[_0x936b('0x17')][_0x936b('0x1b')],function(_0x37d4e8){return{'model':db[_0x37d4e8['model']],'as':_0x37d4e8['as'],'attributes':_0x37d4e8[_0x936b('0x1a')],'include':_0x37d4e8[_0x936b('0x1b')]?_[_0x936b('0x1c')](_0x37d4e8['include'],function(_0x4441d6){return{'model':db[_0x4441d6['model']],'as':_0x4441d6['as'],'attributes':_0x4441d6[_0x936b('0x1a')],'include':_0x4441d6[_0x936b('0x1b')]?_['map'](_0x4441d6[_0x936b('0x1b')],function(_0x29f70c){return{'model':db[_0x29f70c[_0x936b('0x1d')]],'as':_0x29f70c['as'],'attributes':_0x29f70c[_0x936b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x936b('0xd')](function(_0x3f2d51){logger[_0x936b('0x1e')]('GetTemplate',_0x43a29c);logger[_0x936b('0x10')]('GetTemplate',_0x43a29c,JSON[_0x936b('0x1f')](_0x3f2d51));_0x4d83c1(_0x3f2d51);})[_0x936b('0x14')](function(_0xbee44b){logger[_0x936b('0x11')]('GetTemplate',_0xbee44b[_0x936b('0x13')],_0x43a29c);_0x3d6f15(_0x507c40['error'](0x1f4,_0xbee44b['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8d1ed61..a87ea29 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 _0x1a92=['getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','/:id','update','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions'];(function(_0x308720,_0x182e54){var _0x2dfb8b=function(_0x289bb0){while(--_0x289bb0){_0x308720['push'](_0x308720['shift']());}};_0x2dfb8b(++_0x182e54);}(_0x1a92,0xe3));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x21a9('0x0'));var util=require(_0x21a9('0x1'));var path=require('path');var timeout=require(_0x21a9('0x2'));var express=require(_0x21a9('0x3'));var router=express['Router']();var auth=require(_0x21a9('0x4'));var interaction=require(_0x21a9('0x5'));var config=require('../../config/environment');var controller=require(_0x21a9('0x6'));router[_0x21a9('0x7')]('/',auth[_0x21a9('0x8')](),controller[_0x21a9('0x9')]);router[_0x21a9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x21a9('0xa')]);router[_0x21a9('0x7')](_0x21a9('0xb'),auth['isAuthenticated'](),controller[_0x21a9('0xc')]);router['get']('/:id/any_conditions',auth[_0x21a9('0x8')](),controller['getAnyConditions']);router[_0x21a9('0x7')]('/:id/actions',auth[_0x21a9('0x8')](),controller[_0x21a9('0xd')]);router[_0x21a9('0xe')]('/',auth[_0x21a9('0x8')](),controller[_0x21a9('0xf')]);router[_0x21a9('0xe')](_0x21a9('0xb'),auth['isAuthenticated'](),controller[_0x21a9('0x10')]);router[_0x21a9('0xe')](_0x21a9('0x11'),auth[_0x21a9('0x8')](),controller[_0x21a9('0x12')]);router[_0x21a9('0xe')]('/:id/actions',auth[_0x21a9('0x8')](),controller[_0x21a9('0x13')]);router[_0x21a9('0x14')](_0x21a9('0x15'),auth[_0x21a9('0x8')](),controller[_0x21a9('0x16')]);router['delete']('/:id',auth[_0x21a9('0x8')](),controller[_0x21a9('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd7a2=['addAllCondition','addAnyCondition','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/actions','post','create'];(function(_0x4fed0e,_0x484b93){var _0x35deec=function(_0x5f0872){while(--_0x5f0872){_0x4fed0e['push'](_0x4fed0e['shift']());}};_0x35deec(++_0x484b93);}(_0xd7a2,0x138));var _0x2d7a=function(_0x408946,_0x7ab99b){_0x408946=_0x408946-0x0;var _0xc2eb7c=_0xd7a2[_0x408946];return _0xc2eb7c;};'use strict';var multer=require(_0x2d7a('0x0'));var util=require(_0x2d7a('0x1'));var path=require(_0x2d7a('0x2'));var timeout=require(_0x2d7a('0x3'));var express=require('express');var router=express[_0x2d7a('0x4')]();var auth=require(_0x2d7a('0x5'));var interaction=require(_0x2d7a('0x6'));var config=require(_0x2d7a('0x7'));var controller=require(_0x2d7a('0x8'));router[_0x2d7a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2d7a('0x9')](_0x2d7a('0xa'),auth[_0x2d7a('0xb')](),controller[_0x2d7a('0xc')]);router[_0x2d7a('0x9')](_0x2d7a('0xd'),auth[_0x2d7a('0xb')](),controller[_0x2d7a('0xe')]);router['get']('/:id/any_conditions',auth[_0x2d7a('0xb')](),controller['getAnyConditions']);router[_0x2d7a('0x9')](_0x2d7a('0xf'),auth[_0x2d7a('0xb')](),controller['getActions']);router[_0x2d7a('0x10')]('/',auth['isAuthenticated'](),controller[_0x2d7a('0x11')]);router['post'](_0x2d7a('0xd'),auth[_0x2d7a('0xb')](),controller[_0x2d7a('0x12')]);router[_0x2d7a('0x10')]('/:id/any_conditions',auth[_0x2d7a('0xb')](),controller[_0x2d7a('0x13')]);router[_0x2d7a('0x10')](_0x2d7a('0xf'),auth[_0x2d7a('0xb')](),controller['addAction']);router['put'](_0x2d7a('0xa'),auth[_0x2d7a('0xb')](),controller[_0x2d7a('0x14')]);router[_0x2d7a('0x15')](_0x2d7a('0xa'),auth['isAuthenticated'](),controller['destroy']);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 84bc1a1..b93669f 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 _0x25a9=['sequelize','exports','STRING','BOOLEAN'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x25a9,0x1a0));var _0x925a=function(_0x29311d,_0x3f9e23){_0x29311d=_0x29311d-0x0;var _0xa29b8f=_0x25a9[_0x29311d];return _0xa29b8f;};'use strict';var Sequelize=require(_0x925a('0x0'));module[_0x925a('0x1')]={'name':{'type':Sequelize[_0x925a('0x2')]},'channel':{'type':Sequelize[_0x925a('0x2')]},'description':{'type':Sequelize[_0x925a('0x2')]},'status':{'type':Sequelize[_0x925a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0c0b=['STRING','BOOLEAN','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0c0b,0x71));var _0xb0c0=function(_0x95df8a,_0x2fddda){_0x95df8a=_0x95df8a-0x0;var _0x53763a=_0x0c0b[_0x95df8a];return _0x53763a;};'use strict';var Sequelize=require(_0xb0c0('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0c0('0x1')]},'channel':{'type':Sequelize[_0xb0c0('0x1')]},'description':{'type':Sequelize[_0xb0c0('0x1')]},'status':{'type':Sequelize[_0xb0c0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ae7cacc..5714a7c 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 _0x8493=['path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','Trigger','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','user','role','UserProfileSection','autoAssociation','body','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','order','getAnyConditions','addAction','Action','getActions','html-pdf','fast-json-patch','request-promise','mustache'];(function(_0x47495b,_0x16735b){var _0x50166a=function(_0x3785f5){while(--_0x3785f5){_0x47495b['push'](_0x47495b['shift']());}};_0x50166a(++_0x16735b);}(_0x8493,0x158));var _0x3849=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x8493[_0x210718];return _0x541bfc;};'use strict';var pdf=require(_0x3849('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3849('0x1'));var rp=require(_0x3849('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3849('0x3'));var util=require('util');var path=require(_0x3849('0x4'));var sox=require(_0x3849('0x5'));var csv=require(_0x3849('0x6'));var ejs=require(_0x3849('0x7'));var fs=require('fs');var _=require(_0x3849('0x8'));var squel=require(_0x3849('0x9'));var crypto=require('crypto');var jsforce=require(_0x3849('0xa'));var deskjs=require(_0x3849('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3849('0xc'));var Papa=require(_0x3849('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3849('0xe'));var Redis=require(_0x3849('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x3849('0x10'))(_0x3849('0x11'));var utils=require(_0x3849('0x12'));var config=require('../../config/environment');var db=require(_0x3849('0x13'))['db'];function respondWithStatusCode(_0x579360,_0x1db22c){_0x1db22c=_0x1db22c||0xcc;return function(_0x1c1ab0){if(_0x1c1ab0){return _0x579360['sendStatus'](_0x1db22c);}return _0x579360['status'](_0x1db22c)[_0x3849('0x14')]();};}function respondWithResult(_0x4572fe,_0x4d026c){_0x4d026c=_0x4d026c||0xc8;return function(_0x226421){if(_0x226421){return _0x4572fe[_0x3849('0x15')](_0x4d026c)[_0x3849('0x16')](_0x226421);}};}function respondWithFilteredResult(_0x330d68,_0x2dc29c){return function(_0x8a8254){if(_0x8a8254){var _0x680b74=_0x8a8254['count'],_0x8ff393=_0x2dc29c[_0x3849('0x17')],_0x3681f7=_0x2dc29c[_0x3849('0x17')]+_0x2dc29c[_0x3849('0x18')],_0x54379a;if(_0x3681f7>=_0x680b74){_0x3681f7=_0x680b74;_0x54379a=0xc8;}else{_0x54379a=0xce;}_0x330d68['status'](_0x54379a);return _0x330d68[_0x3849('0x19')]('Content-Range',_0x8ff393+'-'+_0x3681f7+'/'+_0x680b74)[_0x3849('0x16')](_0x8a8254);}return null;};}function patchUpdates(_0x89bb1a){return function(_0x3c83a8){try{jsonpatch[_0x3849('0x1a')](_0x3c83a8,_0x89bb1a,!![]);}catch(_0x3fc5cf){return BPromise[_0x3849('0x1b')](_0x3fc5cf);}return _0x3c83a8[_0x3849('0x1c')]();};}function saveUpdates(_0x573822,_0x157cff){return function(_0x459143){if(_0x459143){return _0x459143[_0x3849('0x1d')](_0x573822)[_0x3849('0x1e')](function(_0x54fb09){return _0x54fb09;});}return null;};}function removeEntity(_0x408343,_0x720118){return function(_0x5a8eef){if(_0x5a8eef){return _0x5a8eef[_0x3849('0x1f')]()[_0x3849('0x1e')](function(){var _0x487420=_0x5a8eef[_0x3849('0x20')]({'plain':!![]});var _0x1061a1=_0x3849('0x21');return db[_0x3849('0x22')][_0x3849('0x1f')]({'where':{'type':_0x1061a1,'resourceId':_0x487420['id']}})[_0x3849('0x1e')](function(){return _0x5a8eef;});})[_0x3849('0x1e')](function(){_0x408343['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afc4d,_0x135f92){return function(_0xabb80c){if(!_0xabb80c){_0x4afc4d['sendStatus'](0x194);}return _0xabb80c;};}function handleError(_0x2b26b2,_0x2b5d5c){_0x2b5d5c=_0x2b5d5c||0x1f4;return function(_0x37e140){logger[_0x3849('0x23')](_0x37e140[_0x3849('0x24')]);if(_0x37e140[_0x3849('0x25')]){delete _0x37e140[_0x3849('0x25')];}_0x2b26b2[_0x3849('0x15')](_0x2b5d5c)[_0x3849('0x26')](_0x37e140);};}exports['index']=function(_0x407fe5,_0x13b5fd){var _0x12e8f6={},_0x3b3f43={},_0x558a61={'count':0x0,'rows':[]};var _0x4613e9=db[_0x3849('0x27')]['rawAttributes'];_0x3b3f43[_0x3849('0x28')]=_[_0x3849('0x29')](_0x4613e9);_0x3b3f43[_0x3849('0x2a')]=_[_0x3849('0x29')](_0x407fe5[_0x3849('0x2a')]);_0x3b3f43[_0x3849('0x2b')]=_[_0x3849('0x2c')](_0x3b3f43[_0x3849('0x28')],_0x3b3f43[_0x3849('0x2a')]);_0x12e8f6['attributes']=_['intersection'](_0x3b3f43[_0x3849('0x28')],qs[_0x3849('0x2d')](_0x407fe5[_0x3849('0x2a')]['fields']));_0x12e8f6[_0x3849('0x2e')]=_0x12e8f6['attributes']['length']?_0x12e8f6['attributes']:_0x3b3f43[_0x3849('0x28')];if(!_0x407fe5[_0x3849('0x2a')][_0x3849('0x2f')](_0x3849('0x30'))){_0x12e8f6[_0x3849('0x18')]=qs[_0x3849('0x18')](_0x407fe5[_0x3849('0x2a')][_0x3849('0x18')]);_0x12e8f6[_0x3849('0x17')]=qs[_0x3849('0x17')](_0x407fe5[_0x3849('0x2a')][_0x3849('0x17')]);}_0x12e8f6['order']=qs['sort'](_0x407fe5[_0x3849('0x2a')][_0x3849('0x31')]);_0x12e8f6[_0x3849('0x32')]=qs[_0x3849('0x2b')](_[_0x3849('0x33')](_0x407fe5['query'],_0x3b3f43[_0x3849('0x2b')]));if(_0x407fe5[_0x3849('0x2a')][_0x3849('0x34')]){_0x12e8f6[_0x3849('0x32')]=_[_0x3849('0x35')](_0x12e8f6[_0x3849('0x32')],{'$or':_[_0x3849('0x36')](_0x4613e9,function(_0x4eb86b){if(_0x4eb86b['type'][_0x3849('0x37')]!==_0x3849('0x38')){var _0x1c5052={};_0x1c5052[_0x4eb86b[_0x3849('0x39')]]={'$like':'%'+_0x407fe5['query'][_0x3849('0x34')]+'%'};return _0x1c5052;}})});}_0x12e8f6=_[_0x3849('0x35')]({},_0x12e8f6,_0x407fe5[_0x3849('0x3a')]);var _0x386813={'where':_0x12e8f6['where']};return db['Trigger']['count'](_0x386813)['then'](function(_0x2676bb){_0x558a61['count']=_0x2676bb;if(_0x407fe5[_0x3849('0x2a')][_0x3849('0x3b')]){_0x12e8f6[_0x3849('0x3c')]=[{'all':!![]}];}return db[_0x3849('0x27')][_0x3849('0x3d')](_0x12e8f6);})[_0x3849('0x1e')](function(_0xbdb7f3){_0x558a61[_0x3849('0x3e')]=_0xbdb7f3;return _0x558a61;})[_0x3849('0x1e')](respondWithFilteredResult(_0x13b5fd,_0x12e8f6))[_0x3849('0x3f')](handleError(_0x13b5fd,null));};exports[_0x3849('0x40')]=function(_0x134d37,_0x1a0ae3){var _0x412d1e={'raw':![],'where':{'id':_0x134d37['params']['id']}},_0x176321={};_0x176321[_0x3849('0x28')]=_[_0x3849('0x29')](db[_0x3849('0x27')][_0x3849('0x41')]);_0x176321[_0x3849('0x2a')]=_[_0x3849('0x29')](_0x134d37[_0x3849('0x2a')]);_0x176321[_0x3849('0x2b')]=_['intersection'](_0x176321['model'],_0x176321[_0x3849('0x2a')]);_0x412d1e['attributes']=_[_0x3849('0x2c')](_0x176321[_0x3849('0x28')],qs[_0x3849('0x2d')](_0x134d37[_0x3849('0x2a')][_0x3849('0x2d')]));_0x412d1e[_0x3849('0x2e')]=_0x412d1e[_0x3849('0x2e')][_0x3849('0x42')]?_0x412d1e['attributes']:_0x176321[_0x3849('0x28')];if(_0x134d37[_0x3849('0x2a')][_0x3849('0x3b')]){_0x412d1e[_0x3849('0x3c')]=[{'all':!![]}];}_0x412d1e=_['merge']({},_0x412d1e,_0x134d37[_0x3849('0x3a')]);return db[_0x3849('0x27')][_0x3849('0x43')](_0x412d1e)[_0x3849('0x1e')](handleEntityNotFound(_0x1a0ae3,null))[_0x3849('0x1e')](respondWithResult(_0x1a0ae3,null))['catch'](handleError(_0x1a0ae3,null));};exports['create']=function(_0x4313c3,_0xf4d197){return db[_0x3849('0x27')][_0x3849('0x44')](_0x4313c3['body'],{})[_0x3849('0x1e')](function(_0x2bb4d7){var _0x5bdce3=_0x4313c3[_0x3849('0x45')][_0x3849('0x20')]({'plain':!![]});if(!_0x5bdce3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bdce3[_0x3849('0x46')]==='user'){var _0x3ea659=_0x2bb4d7[_0x3849('0x20')]({'plain':!![]});var _0x16078f=_0x3849('0x21');return db[_0x3849('0x47')][_0x3849('0x43')]({'where':{'name':_0x16078f,'userProfileId':_0x5bdce3['userProfileId']},'raw':!![]})[_0x3849('0x1e')](function(_0x324253){if(_0x324253&&_0x324253[_0x3849('0x48')]===0x0){return db['UserProfileResource'][_0x3849('0x44')]({'name':_0x3ea659[_0x3849('0x25')],'resourceId':_0x3ea659['id'],'type':_0x324253[_0x3849('0x25')],'sectionId':_0x324253['id']},{})[_0x3849('0x1e')](function(){return _0x2bb4d7;});}else{return _0x2bb4d7;}})['catch'](function(_0x227549){logger[_0x3849('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x227549);throw _0x227549;});}return _0x2bb4d7;})[_0x3849('0x1e')](respondWithResult(_0xf4d197,0xc9))['catch'](handleError(_0xf4d197,null));};exports[_0x3849('0x1d')]=function(_0x5da8d2,_0x11937f){if(_0x5da8d2[_0x3849('0x49')]['id']){delete _0x5da8d2['body']['id'];}return db['Trigger'][_0x3849('0x43')]({'where':{'id':_0x5da8d2[_0x3849('0x4a')]['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x11937f,null))[_0x3849('0x1e')](saveUpdates(_0x5da8d2[_0x3849('0x49')],null))[_0x3849('0x1e')](respondWithResult(_0x11937f,null))['catch'](handleError(_0x11937f,null));};exports[_0x3849('0x1f')]=function(_0x4e876a,_0x47e18a){return db[_0x3849('0x27')][_0x3849('0x43')]({'where':{'id':_0x4e876a[_0x3849('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47e18a,null))['then'](removeEntity(_0x47e18a,null))[_0x3849('0x3f')](handleError(_0x47e18a,null));};exports[_0x3849('0x4b')]=function(_0x549dbd,_0xd3a916,_0x5ec35e){if(_0x549dbd[_0x3849('0x49')]['id']){delete _0x549dbd[_0x3849('0x49')]['id'];}return db[_0x3849('0x27')][_0x3849('0x43')]({'where':{'id':_0x549dbd['params']['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0xd3a916,null))[_0x3849('0x1e')](function(_0x22f082){if(_0x22f082){_0x549dbd[_0x3849('0x49')][_0x3849('0x4c')]=_0x22f082['id'];return db['Condition'][_0x3849('0x44')](_0x549dbd[_0x3849('0x49')]);}})['then'](respondWithResult(_0xd3a916,null))[_0x3849('0x3f')](handleError(_0xd3a916,null));};exports[_0x3849('0x4d')]=function(_0x544bf6,_0x5930fd,_0x43c65b){if(_0x544bf6[_0x3849('0x49')]['id']){delete _0x544bf6['body']['id'];}return db[_0x3849('0x27')][_0x3849('0x43')]({'where':{'id':_0x544bf6[_0x3849('0x4a')]['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x5930fd,null))['then'](function(_0x184327){if(_0x184327){_0x544bf6[_0x3849('0x49')][_0x3849('0x4e')]=_0x184327['id'];return db[_0x3849('0x4f')][_0x3849('0x44')](_0x544bf6[_0x3849('0x49')]);}})[_0x3849('0x1e')](respondWithResult(_0x5930fd,null))[_0x3849('0x3f')](handleError(_0x5930fd,null));};exports[_0x3849('0x50')]=function(_0x41b98d,_0x1bb48e,_0x51cf56){var _0xf2e0f9={};var _0x327d03={};var _0x55edcb;var _0x2d3903;return db[_0x3849('0x27')][_0x3849('0x51')]({'where':{'id':_0x41b98d[_0x3849('0x4a')]['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x1bb48e,null))[_0x3849('0x1e')](function(_0x5d0f95){if(_0x5d0f95){_0x55edcb=_0x5d0f95;_0x327d03['model']=_[_0x3849('0x29')](db[_0x3849('0x4f')]['rawAttributes']);_0x327d03[_0x3849('0x2a')]=_[_0x3849('0x29')](_0x41b98d['query']);_0x327d03[_0x3849('0x2b')]=_['intersection'](_0x327d03['model'],_0x327d03[_0x3849('0x2a')]);_0xf2e0f9['attributes']=_['intersection'](_0x327d03['model'],qs[_0x3849('0x2d')](_0x41b98d[_0x3849('0x2a')]['fields']));_0xf2e0f9['attributes']=_0xf2e0f9[_0x3849('0x2e')][_0x3849('0x42')]?_0xf2e0f9[_0x3849('0x2e')]:_0x327d03[_0x3849('0x28')];_0xf2e0f9[_0x3849('0x52')]=qs[_0x3849('0x31')](_0x41b98d[_0x3849('0x2a')][_0x3849('0x31')]);_0xf2e0f9[_0x3849('0x32')]=qs[_0x3849('0x2b')](_['pick'](_0x41b98d[_0x3849('0x2a')],_0x327d03[_0x3849('0x2b')]));if(_0x41b98d[_0x3849('0x2a')][_0x3849('0x34')]){_0xf2e0f9[_0x3849('0x32')]=_[_0x3849('0x35')](_0xf2e0f9[_0x3849('0x32')],{'$or':_[_0x3849('0x36')](_0xf2e0f9[_0x3849('0x2e')],function(_0x2a2d8c){var _0x4df877={};_0x4df877[_0x2a2d8c]={'$like':'%'+_0x41b98d['query'][_0x3849('0x34')]+'%'};return _0x4df877;})});}_0xf2e0f9=_['merge']({},_0xf2e0f9,_0x41b98d['options']);return _0x55edcb['getAllConditions'](_0xf2e0f9);}})['then'](function(_0x22e5fc){if(_0x22e5fc){_0x2d3903=_0x22e5fc[_0x3849('0x42')];if(!_0x41b98d[_0x3849('0x2a')][_0x3849('0x2f')](_0x3849('0x30'))){_0xf2e0f9[_0x3849('0x18')]=qs['limit'](_0x41b98d['query'][_0x3849('0x18')]);_0xf2e0f9['offset']=qs[_0x3849('0x17')](_0x41b98d[_0x3849('0x2a')][_0x3849('0x17')]);}return _0x55edcb[_0x3849('0x50')](_0xf2e0f9);}})[_0x3849('0x1e')](function(_0x2eaffb){if(_0x2eaffb){return _0x2eaffb?{'count':_0x2d3903,'rows':_0x2eaffb}:null;}})[_0x3849('0x1e')](respondWithResult(_0x1bb48e,null))[_0x3849('0x3f')](handleError(_0x1bb48e,null));};exports[_0x3849('0x53')]=function(_0x4f143a,_0x433195,_0x1911a4){var _0x4d27a7={};var _0x21fb88={};var _0x4dc231;var _0x5a36d8;return db[_0x3849('0x27')][_0x3849('0x51')]({'where':{'id':_0x4f143a['params']['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x433195,null))['then'](function(_0x4776de){if(_0x4776de){_0x4dc231=_0x4776de;_0x21fb88[_0x3849('0x28')]=_['keys'](db[_0x3849('0x4f')][_0x3849('0x41')]);_0x21fb88[_0x3849('0x2a')]=_[_0x3849('0x29')](_0x4f143a[_0x3849('0x2a')]);_0x21fb88[_0x3849('0x2b')]=_[_0x3849('0x2c')](_0x21fb88['model'],_0x21fb88[_0x3849('0x2a')]);_0x4d27a7[_0x3849('0x2e')]=_[_0x3849('0x2c')](_0x21fb88[_0x3849('0x28')],qs[_0x3849('0x2d')](_0x4f143a[_0x3849('0x2a')][_0x3849('0x2d')]));_0x4d27a7[_0x3849('0x2e')]=_0x4d27a7[_0x3849('0x2e')][_0x3849('0x42')]?_0x4d27a7[_0x3849('0x2e')]:_0x21fb88[_0x3849('0x28')];_0x4d27a7[_0x3849('0x52')]=qs[_0x3849('0x31')](_0x4f143a[_0x3849('0x2a')]['sort']);_0x4d27a7['where']=qs['filters'](_['pick'](_0x4f143a[_0x3849('0x2a')],_0x21fb88[_0x3849('0x2b')]));if(_0x4f143a[_0x3849('0x2a')][_0x3849('0x34')]){_0x4d27a7[_0x3849('0x32')]=_[_0x3849('0x35')](_0x4d27a7['where'],{'$or':_[_0x3849('0x36')](_0x4d27a7[_0x3849('0x2e')],function(_0xd137a2){var _0x554bed={};_0x554bed[_0xd137a2]={'$like':'%'+_0x4f143a[_0x3849('0x2a')]['filter']+'%'};return _0x554bed;})});}_0x4d27a7=_[_0x3849('0x35')]({},_0x4d27a7,_0x4f143a['options']);return _0x4dc231[_0x3849('0x53')](_0x4d27a7);}})[_0x3849('0x1e')](function(_0x21e1ad){if(_0x21e1ad){_0x5a36d8=_0x21e1ad[_0x3849('0x42')];if(!_0x4f143a['query']['hasOwnProperty'](_0x3849('0x30'))){_0x4d27a7[_0x3849('0x18')]=qs['limit'](_0x4f143a[_0x3849('0x2a')][_0x3849('0x18')]);_0x4d27a7['offset']=qs[_0x3849('0x17')](_0x4f143a['query']['offset']);}return _0x4dc231[_0x3849('0x53')](_0x4d27a7);}})[_0x3849('0x1e')](function(_0x4b2f51){if(_0x4b2f51){return _0x4b2f51?{'count':_0x5a36d8,'rows':_0x4b2f51}:null;}})[_0x3849('0x1e')](respondWithResult(_0x433195,null))[_0x3849('0x3f')](handleError(_0x433195,null));};exports[_0x3849('0x54')]=function(_0x275243,_0x2a860b,_0x14c48c){if(_0x275243[_0x3849('0x49')]['id']){delete _0x275243['body']['id'];}return db[_0x3849('0x27')][_0x3849('0x43')]({'where':{'id':_0x275243[_0x3849('0x4a')]['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x2a860b,null))['then'](function(_0x41f4b2){if(_0x41f4b2){_0x275243['body']['TriggerId']=_0x41f4b2['id'];return db[_0x3849('0x55')][_0x3849('0x44')](_0x275243[_0x3849('0x49')]);}})['then'](respondWithResult(_0x2a860b,null))[_0x3849('0x3f')](handleError(_0x2a860b,null));};exports['getActions']=function(_0x3c906c,_0x3a550b,_0x3f8d5a){var _0x41bbe3={};var _0x44ce82={};var _0x416885;var _0x51adf3;return db[_0x3849('0x27')][_0x3849('0x51')]({'where':{'id':_0x3c906c[_0x3849('0x4a')]['id']}})[_0x3849('0x1e')](handleEntityNotFound(_0x3a550b,null))['then'](function(_0x56e5b7){if(_0x56e5b7){_0x416885=_0x56e5b7;_0x44ce82[_0x3849('0x28')]=_['keys'](db[_0x3849('0x55')][_0x3849('0x41')]);_0x44ce82['query']=_[_0x3849('0x29')](_0x3c906c[_0x3849('0x2a')]);_0x44ce82[_0x3849('0x2b')]=_[_0x3849('0x2c')](_0x44ce82['model'],_0x44ce82['query']);_0x41bbe3[_0x3849('0x2e')]=_[_0x3849('0x2c')](_0x44ce82[_0x3849('0x28')],qs['fields'](_0x3c906c['query'][_0x3849('0x2d')]));_0x41bbe3['attributes']=_0x41bbe3[_0x3849('0x2e')][_0x3849('0x42')]?_0x41bbe3[_0x3849('0x2e')]:_0x44ce82['model'];_0x41bbe3[_0x3849('0x52')]=qs[_0x3849('0x31')](_0x3c906c['query'][_0x3849('0x31')]);_0x41bbe3[_0x3849('0x32')]=qs[_0x3849('0x2b')](_[_0x3849('0x33')](_0x3c906c['query'],_0x44ce82[_0x3849('0x2b')]));if(_0x3c906c['query']['filter']){_0x41bbe3[_0x3849('0x32')]=_[_0x3849('0x35')](_0x41bbe3[_0x3849('0x32')],{'$or':_[_0x3849('0x36')](_0x41bbe3[_0x3849('0x2e')],function(_0x203606){var _0x9bca6b={};_0x9bca6b[_0x203606]={'$like':'%'+_0x3c906c['query'][_0x3849('0x34')]+'%'};return _0x9bca6b;})});}_0x41bbe3=_['merge']({},_0x41bbe3,_0x3c906c[_0x3849('0x3a')]);return _0x416885[_0x3849('0x56')](_0x41bbe3);}})[_0x3849('0x1e')](function(_0x282940){if(_0x282940){_0x51adf3=_0x282940[_0x3849('0x42')];if(!_0x3c906c[_0x3849('0x2a')]['hasOwnProperty']('nolimit')){_0x41bbe3[_0x3849('0x18')]=qs['limit'](_0x3c906c['query'][_0x3849('0x18')]);_0x41bbe3['offset']=qs[_0x3849('0x17')](_0x3c906c['query'][_0x3849('0x17')]);}return _0x416885[_0x3849('0x56')](_0x41bbe3);}})['then'](function(_0x331e32){if(_0x331e32){return _0x331e32?{'count':_0x51adf3,'rows':_0x331e32}:null;}})[_0x3849('0x1e')](respondWithResult(_0x3a550b,null))[_0x3849('0x3f')](handleError(_0x3a550b,null));}; \ No newline at end of file +var _0x56a3=['findAll','rows','catch','show','params','intersection','include','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','Trigger','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','options','includeAll'];(function(_0x155bbf,_0x1bca34){var _0x1cb0ac=function(_0x101c7c){while(--_0x101c7c){_0x155bbf['push'](_0x155bbf['shift']());}};_0x1cb0ac(++_0x1bca34);}(_0x56a3,0x196));var _0x356a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56a3[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x356a('0x0'));var rimraf=require(_0x356a('0x1'));var zipdir=require(_0x356a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x356a('0x3'));var moment=require(_0x356a('0x4'));var BPromise=require(_0x356a('0x5'));var Mustache=require('mustache');var util=require(_0x356a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x356a('0x7'));var fs=require('fs');var _=require(_0x356a('0x8'));var squel=require(_0x356a('0x9'));var crypto=require('crypto');var jsforce=require(_0x356a('0xa'));var deskjs=require(_0x356a('0xb'));var toCsv=require(_0x356a('0xc'));var querystring=require(_0x356a('0xd'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x356a('0xe'));var Redis=require('ioredis');var qs=require(_0x356a('0xf'));var logger=require(_0x356a('0x10'))(_0x356a('0x11'));var utils=require(_0x356a('0x12'));var config=require(_0x356a('0x13'));var db=require(_0x356a('0x14'))['db'];function respondWithStatusCode(_0x20daee,_0x2d89a3){_0x2d89a3=_0x2d89a3||0xcc;return function(_0x3fdcdf){if(_0x3fdcdf){return _0x20daee['sendStatus'](_0x2d89a3);}return _0x20daee[_0x356a('0x15')](_0x2d89a3)['end']();};}function respondWithResult(_0x26de67,_0x23b058){_0x23b058=_0x23b058||0xc8;return function(_0x5e07b9){if(_0x5e07b9){return _0x26de67[_0x356a('0x15')](_0x23b058)[_0x356a('0x16')](_0x5e07b9);}};}function respondWithFilteredResult(_0x28ddb2,_0x115dda){return function(_0x8b866c){if(_0x8b866c){var _0x2809fd=_0x8b866c[_0x356a('0x17')],_0x29118a=_0x115dda[_0x356a('0x18')],_0x51a268=_0x115dda[_0x356a('0x18')]+_0x115dda[_0x356a('0x19')],_0x1d3fac;if(_0x51a268>=_0x2809fd){_0x51a268=_0x2809fd;_0x1d3fac=0xc8;}else{_0x1d3fac=0xce;}_0x28ddb2['status'](_0x1d3fac);return _0x28ddb2[_0x356a('0x1a')]('Content-Range',_0x29118a+'-'+_0x51a268+'/'+_0x2809fd)['json'](_0x8b866c);}return null;};}function patchUpdates(_0x2d8dde){return function(_0x153dcc){try{jsonpatch['apply'](_0x153dcc,_0x2d8dde,!![]);}catch(_0x5e1fdb){return BPromise[_0x356a('0x1b')](_0x5e1fdb);}return _0x153dcc[_0x356a('0x1c')]();};}function saveUpdates(_0x4e1c9b,_0x5d0ee9){return function(_0x516c30){if(_0x516c30){return _0x516c30[_0x356a('0x1d')](_0x4e1c9b)[_0x356a('0x1e')](function(_0x6c8814){return _0x6c8814;});}return null;};}function removeEntity(_0x206d8f,_0x41eb43){return function(_0xd2c9b5){if(_0xd2c9b5){return _0xd2c9b5[_0x356a('0x1f')]()[_0x356a('0x1e')](function(){var _0x2ec8eb=_0xd2c9b5[_0x356a('0x20')]({'plain':!![]});var _0x474579='Triggers';return db[_0x356a('0x21')][_0x356a('0x1f')]({'where':{'type':_0x474579,'resourceId':_0x2ec8eb['id']}})[_0x356a('0x1e')](function(){return _0xd2c9b5;});})[_0x356a('0x1e')](function(){_0x206d8f[_0x356a('0x15')](0xcc)[_0x356a('0x22')]();});}};}function handleEntityNotFound(_0x424c24,_0x316e4e){return function(_0x571fcc){if(!_0x571fcc){_0x424c24[_0x356a('0x23')](0x194);}return _0x571fcc;};}function handleError(_0x4ce0a4,_0x44ea73){_0x44ea73=_0x44ea73||0x1f4;return function(_0x5f3875){logger[_0x356a('0x24')](_0x5f3875[_0x356a('0x25')]);if(_0x5f3875[_0x356a('0x26')]){delete _0x5f3875['name'];}_0x4ce0a4[_0x356a('0x15')](_0x44ea73)[_0x356a('0x27')](_0x5f3875);};}exports[_0x356a('0x28')]=function(_0x4da6bd,_0x265f6a){var _0x31eba5={},_0xda006={},_0x168339={'count':0x0,'rows':[]};var _0x1d4a96=db[_0x356a('0x29')][_0x356a('0x2a')];_0xda006[_0x356a('0x2b')]=_[_0x356a('0x2c')](_0x1d4a96);_0xda006[_0x356a('0x2d')]=_['keys'](_0x4da6bd['query']);_0xda006['filters']=_['intersection'](_0xda006[_0x356a('0x2b')],_0xda006[_0x356a('0x2d')]);_0x31eba5['attributes']=_['intersection'](_0xda006[_0x356a('0x2b')],qs[_0x356a('0x2e')](_0x4da6bd[_0x356a('0x2d')][_0x356a('0x2e')]));_0x31eba5['attributes']=_0x31eba5[_0x356a('0x2f')][_0x356a('0x30')]?_0x31eba5[_0x356a('0x2f')]:_0xda006['model'];if(!_0x4da6bd[_0x356a('0x2d')][_0x356a('0x31')](_0x356a('0x32'))){_0x31eba5[_0x356a('0x19')]=qs[_0x356a('0x19')](_0x4da6bd[_0x356a('0x2d')][_0x356a('0x19')]);_0x31eba5[_0x356a('0x18')]=qs[_0x356a('0x18')](_0x4da6bd[_0x356a('0x2d')]['offset']);}_0x31eba5[_0x356a('0x33')]=qs[_0x356a('0x34')](_0x4da6bd[_0x356a('0x2d')][_0x356a('0x34')]);_0x31eba5['where']=qs[_0x356a('0x35')](_[_0x356a('0x36')](_0x4da6bd[_0x356a('0x2d')],_0xda006[_0x356a('0x35')]));if(_0x4da6bd['query'][_0x356a('0x37')]){_0x31eba5[_0x356a('0x38')]=_['merge'](_0x31eba5['where'],{'$or':_[_0x356a('0x39')](_0x1d4a96,function(_0x1d8356){if(_0x1d8356[_0x356a('0x3a')][_0x356a('0x3b')]!==_0x356a('0x3c')){var _0x2aeba3={};_0x2aeba3[_0x1d8356[_0x356a('0x3d')]]={'$like':'%'+_0x4da6bd['query'][_0x356a('0x37')]+'%'};return _0x2aeba3;}})});}_0x31eba5=_['merge']({},_0x31eba5,_0x4da6bd[_0x356a('0x3e')]);var _0x291387={'where':_0x31eba5['where']};return db[_0x356a('0x29')][_0x356a('0x17')](_0x291387)['then'](function(_0x514068){_0x168339['count']=_0x514068;if(_0x4da6bd['query'][_0x356a('0x3f')]){_0x31eba5['include']=[{'all':!![]}];}return db[_0x356a('0x29')][_0x356a('0x40')](_0x31eba5);})[_0x356a('0x1e')](function(_0x563b9c){_0x168339[_0x356a('0x41')]=_0x563b9c;return _0x168339;})[_0x356a('0x1e')](respondWithFilteredResult(_0x265f6a,_0x31eba5))[_0x356a('0x42')](handleError(_0x265f6a,null));};exports[_0x356a('0x43')]=function(_0x396f0a,_0x44253a){var _0x4b8d4a={'raw':![],'where':{'id':_0x396f0a[_0x356a('0x44')]['id']}},_0x2fed4b={};_0x2fed4b[_0x356a('0x2b')]=_[_0x356a('0x2c')](db[_0x356a('0x29')]['rawAttributes']);_0x2fed4b[_0x356a('0x2d')]=_[_0x356a('0x2c')](_0x396f0a[_0x356a('0x2d')]);_0x2fed4b[_0x356a('0x35')]=_['intersection'](_0x2fed4b[_0x356a('0x2b')],_0x2fed4b[_0x356a('0x2d')]);_0x4b8d4a['attributes']=_[_0x356a('0x45')](_0x2fed4b[_0x356a('0x2b')],qs[_0x356a('0x2e')](_0x396f0a[_0x356a('0x2d')]['fields']));_0x4b8d4a[_0x356a('0x2f')]=_0x4b8d4a[_0x356a('0x2f')]['length']?_0x4b8d4a[_0x356a('0x2f')]:_0x2fed4b[_0x356a('0x2b')];if(_0x396f0a[_0x356a('0x2d')][_0x356a('0x3f')]){_0x4b8d4a[_0x356a('0x46')]=[{'all':!![]}];}_0x4b8d4a=_[_0x356a('0x47')]({},_0x4b8d4a,_0x396f0a[_0x356a('0x3e')]);return db[_0x356a('0x29')]['find'](_0x4b8d4a)[_0x356a('0x1e')](handleEntityNotFound(_0x44253a,null))[_0x356a('0x1e')](respondWithResult(_0x44253a,null))[_0x356a('0x42')](handleError(_0x44253a,null));};exports['create']=function(_0x46ad52,_0x9d0d){return db[_0x356a('0x29')][_0x356a('0x48')](_0x46ad52[_0x356a('0x49')],{})[_0x356a('0x1e')](function(_0x4b6fd8){var _0x440bb6=_0x46ad52['user']['get']({'plain':!![]});if(!_0x440bb6)throw new Error(_0x356a('0x4a'));if(_0x440bb6[_0x356a('0x4b')]===_0x356a('0x4c')){var _0x192b81=_0x4b6fd8[_0x356a('0x20')]({'plain':!![]});var _0x196ebb=_0x356a('0x4d');return db['UserProfileSection'][_0x356a('0x4e')]({'where':{'name':_0x196ebb,'userProfileId':_0x440bb6[_0x356a('0x4f')]},'raw':!![]})[_0x356a('0x1e')](function(_0x1774a0){if(_0x1774a0&&_0x1774a0[_0x356a('0x50')]===0x0){return db[_0x356a('0x21')][_0x356a('0x48')]({'name':_0x192b81[_0x356a('0x26')],'resourceId':_0x192b81['id'],'type':_0x1774a0[_0x356a('0x26')],'sectionId':_0x1774a0['id']},{})[_0x356a('0x1e')](function(){return _0x4b6fd8;});}else{return _0x4b6fd8;}})['catch'](function(_0x1f0663){logger[_0x356a('0x24')](_0x356a('0x51'),_0x1f0663);throw _0x1f0663;});}return _0x4b6fd8;})[_0x356a('0x1e')](respondWithResult(_0x9d0d,0xc9))[_0x356a('0x42')](handleError(_0x9d0d,null));};exports[_0x356a('0x1d')]=function(_0x417533,_0x3a9faf){if(_0x417533[_0x356a('0x49')]['id']){delete _0x417533[_0x356a('0x49')]['id'];}return db[_0x356a('0x29')][_0x356a('0x4e')]({'where':{'id':_0x417533[_0x356a('0x44')]['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x3a9faf,null))[_0x356a('0x1e')](saveUpdates(_0x417533[_0x356a('0x49')],null))['then'](respondWithResult(_0x3a9faf,null))[_0x356a('0x42')](handleError(_0x3a9faf,null));};exports[_0x356a('0x1f')]=function(_0x16dd3b,_0x23622f){return db[_0x356a('0x29')][_0x356a('0x4e')]({'where':{'id':_0x16dd3b['params']['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x23622f,null))[_0x356a('0x1e')](removeEntity(_0x23622f,null))['catch'](handleError(_0x23622f,null));};exports[_0x356a('0x52')]=function(_0x1c90d8,_0x1a6a5f,_0x5e056d){if(_0x1c90d8[_0x356a('0x49')]['id']){delete _0x1c90d8[_0x356a('0x49')]['id'];}return db['Trigger'][_0x356a('0x4e')]({'where':{'id':_0x1c90d8['params']['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x1a6a5f,null))['then'](function(_0x43b98f){if(_0x43b98f){_0x1c90d8[_0x356a('0x49')][_0x356a('0x53')]=_0x43b98f['id'];return db['Condition']['create'](_0x1c90d8['body']);}})['then'](respondWithResult(_0x1a6a5f,null))['catch'](handleError(_0x1a6a5f,null));};exports[_0x356a('0x54')]=function(_0x1c13a3,_0x2e4cec,_0x591593){if(_0x1c13a3[_0x356a('0x49')]['id']){delete _0x1c13a3[_0x356a('0x49')]['id'];}return db[_0x356a('0x29')]['find']({'where':{'id':_0x1c13a3['params']['id']}})['then'](handleEntityNotFound(_0x2e4cec,null))[_0x356a('0x1e')](function(_0x5b4ba7){if(_0x5b4ba7){_0x1c13a3['body'][_0x356a('0x55')]=_0x5b4ba7['id'];return db['Condition']['create'](_0x1c13a3[_0x356a('0x49')]);}})[_0x356a('0x1e')](respondWithResult(_0x2e4cec,null))[_0x356a('0x42')](handleError(_0x2e4cec,null));};exports[_0x356a('0x56')]=function(_0x12a116,_0x1eda67,_0x5822d9){var _0x1fdff0={};var _0x55423d={};var _0xab3bb7;var _0x42d209;return db['Trigger'][_0x356a('0x57')]({'where':{'id':_0x12a116[_0x356a('0x44')]['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x1eda67,null))[_0x356a('0x1e')](function(_0x441c8c){if(_0x441c8c){_0xab3bb7=_0x441c8c;_0x55423d['model']=_['keys'](db[_0x356a('0x58')]['rawAttributes']);_0x55423d['query']=_[_0x356a('0x2c')](_0x12a116[_0x356a('0x2d')]);_0x55423d[_0x356a('0x35')]=_['intersection'](_0x55423d[_0x356a('0x2b')],_0x55423d[_0x356a('0x2d')]);_0x1fdff0[_0x356a('0x2f')]=_[_0x356a('0x45')](_0x55423d[_0x356a('0x2b')],qs[_0x356a('0x2e')](_0x12a116[_0x356a('0x2d')][_0x356a('0x2e')]));_0x1fdff0[_0x356a('0x2f')]=_0x1fdff0[_0x356a('0x2f')][_0x356a('0x30')]?_0x1fdff0[_0x356a('0x2f')]:_0x55423d[_0x356a('0x2b')];_0x1fdff0[_0x356a('0x33')]=qs[_0x356a('0x34')](_0x12a116[_0x356a('0x2d')]['sort']);_0x1fdff0[_0x356a('0x38')]=qs[_0x356a('0x35')](_[_0x356a('0x36')](_0x12a116[_0x356a('0x2d')],_0x55423d[_0x356a('0x35')]));if(_0x12a116[_0x356a('0x2d')][_0x356a('0x37')]){_0x1fdff0[_0x356a('0x38')]=_[_0x356a('0x47')](_0x1fdff0['where'],{'$or':_['map'](_0x1fdff0[_0x356a('0x2f')],function(_0x3535b6){var _0x13b2f2={};_0x13b2f2[_0x3535b6]={'$like':'%'+_0x12a116[_0x356a('0x2d')]['filter']+'%'};return _0x13b2f2;})});}_0x1fdff0=_['merge']({},_0x1fdff0,_0x12a116[_0x356a('0x3e')]);return _0xab3bb7[_0x356a('0x56')](_0x1fdff0);}})[_0x356a('0x1e')](function(_0x46f4ea){if(_0x46f4ea){_0x42d209=_0x46f4ea[_0x356a('0x30')];if(!_0x12a116[_0x356a('0x2d')][_0x356a('0x31')](_0x356a('0x32'))){_0x1fdff0['limit']=qs[_0x356a('0x19')](_0x12a116[_0x356a('0x2d')][_0x356a('0x19')]);_0x1fdff0['offset']=qs[_0x356a('0x18')](_0x12a116[_0x356a('0x2d')][_0x356a('0x18')]);}return _0xab3bb7[_0x356a('0x56')](_0x1fdff0);}})[_0x356a('0x1e')](function(_0x526e29){if(_0x526e29){return _0x526e29?{'count':_0x42d209,'rows':_0x526e29}:null;}})[_0x356a('0x1e')](respondWithResult(_0x1eda67,null))[_0x356a('0x42')](handleError(_0x1eda67,null));};exports[_0x356a('0x59')]=function(_0x5ebaa8,_0x546296,_0x499263){var _0x3ed6c3={};var _0x462605={};var _0x35a9aa;var _0x4dd0bd;return db[_0x356a('0x29')]['findOne']({'where':{'id':_0x5ebaa8[_0x356a('0x44')]['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x546296,null))[_0x356a('0x1e')](function(_0x2ba4d3){if(_0x2ba4d3){_0x35a9aa=_0x2ba4d3;_0x462605[_0x356a('0x2b')]=_[_0x356a('0x2c')](db[_0x356a('0x58')]['rawAttributes']);_0x462605[_0x356a('0x2d')]=_['keys'](_0x5ebaa8['query']);_0x462605[_0x356a('0x35')]=_[_0x356a('0x45')](_0x462605['model'],_0x462605[_0x356a('0x2d')]);_0x3ed6c3['attributes']=_[_0x356a('0x45')](_0x462605[_0x356a('0x2b')],qs['fields'](_0x5ebaa8[_0x356a('0x2d')][_0x356a('0x2e')]));_0x3ed6c3[_0x356a('0x2f')]=_0x3ed6c3[_0x356a('0x2f')][_0x356a('0x30')]?_0x3ed6c3[_0x356a('0x2f')]:_0x462605[_0x356a('0x2b')];_0x3ed6c3[_0x356a('0x33')]=qs[_0x356a('0x34')](_0x5ebaa8['query']['sort']);_0x3ed6c3['where']=qs[_0x356a('0x35')](_[_0x356a('0x36')](_0x5ebaa8[_0x356a('0x2d')],_0x462605[_0x356a('0x35')]));if(_0x5ebaa8[_0x356a('0x2d')][_0x356a('0x37')]){_0x3ed6c3[_0x356a('0x38')]=_['merge'](_0x3ed6c3[_0x356a('0x38')],{'$or':_[_0x356a('0x39')](_0x3ed6c3[_0x356a('0x2f')],function(_0x25430f){var _0x404659={};_0x404659[_0x25430f]={'$like':'%'+_0x5ebaa8[_0x356a('0x2d')]['filter']+'%'};return _0x404659;})});}_0x3ed6c3=_[_0x356a('0x47')]({},_0x3ed6c3,_0x5ebaa8['options']);return _0x35a9aa[_0x356a('0x59')](_0x3ed6c3);}})[_0x356a('0x1e')](function(_0x2b30c9){if(_0x2b30c9){_0x4dd0bd=_0x2b30c9[_0x356a('0x30')];if(!_0x5ebaa8['query'][_0x356a('0x31')]('nolimit')){_0x3ed6c3[_0x356a('0x19')]=qs['limit'](_0x5ebaa8[_0x356a('0x2d')][_0x356a('0x19')]);_0x3ed6c3[_0x356a('0x18')]=qs[_0x356a('0x18')](_0x5ebaa8[_0x356a('0x2d')]['offset']);}return _0x35a9aa[_0x356a('0x59')](_0x3ed6c3);}})['then'](function(_0x4cbca8){if(_0x4cbca8){return _0x4cbca8?{'count':_0x4dd0bd,'rows':_0x4cbca8}:null;}})[_0x356a('0x1e')](respondWithResult(_0x546296,null))[_0x356a('0x42')](handleError(_0x546296,null));};exports[_0x356a('0x5a')]=function(_0x40a751,_0x5742cf,_0x847218){if(_0x40a751[_0x356a('0x49')]['id']){delete _0x40a751[_0x356a('0x49')]['id'];}return db[_0x356a('0x29')][_0x356a('0x4e')]({'where':{'id':_0x40a751['params']['id']}})[_0x356a('0x1e')](handleEntityNotFound(_0x5742cf,null))[_0x356a('0x1e')](function(_0x2d9a61){if(_0x2d9a61){_0x40a751[_0x356a('0x49')][_0x356a('0x5b')]=_0x2d9a61['id'];return db[_0x356a('0x5c')]['create'](_0x40a751['body']);}})[_0x356a('0x1e')](respondWithResult(_0x5742cf,null))[_0x356a('0x42')](handleError(_0x5742cf,null));};exports[_0x356a('0x5d')]=function(_0x4458c4,_0x55914a,_0x2f6db5){var _0x2ff679={};var _0x2c5753={};var _0x4e5507;var _0x4b166e;return db[_0x356a('0x29')][_0x356a('0x57')]({'where':{'id':_0x4458c4[_0x356a('0x44')]['id']}})['then'](handleEntityNotFound(_0x55914a,null))[_0x356a('0x1e')](function(_0x4fb3b2){if(_0x4fb3b2){_0x4e5507=_0x4fb3b2;_0x2c5753['model']=_[_0x356a('0x2c')](db[_0x356a('0x5c')]['rawAttributes']);_0x2c5753[_0x356a('0x2d')]=_[_0x356a('0x2c')](_0x4458c4[_0x356a('0x2d')]);_0x2c5753['filters']=_[_0x356a('0x45')](_0x2c5753[_0x356a('0x2b')],_0x2c5753[_0x356a('0x2d')]);_0x2ff679[_0x356a('0x2f')]=_['intersection'](_0x2c5753['model'],qs[_0x356a('0x2e')](_0x4458c4[_0x356a('0x2d')][_0x356a('0x2e')]));_0x2ff679[_0x356a('0x2f')]=_0x2ff679[_0x356a('0x2f')]['length']?_0x2ff679[_0x356a('0x2f')]:_0x2c5753[_0x356a('0x2b')];_0x2ff679[_0x356a('0x33')]=qs[_0x356a('0x34')](_0x4458c4[_0x356a('0x2d')]['sort']);_0x2ff679[_0x356a('0x38')]=qs['filters'](_[_0x356a('0x36')](_0x4458c4[_0x356a('0x2d')],_0x2c5753[_0x356a('0x35')]));if(_0x4458c4[_0x356a('0x2d')][_0x356a('0x37')]){_0x2ff679[_0x356a('0x38')]=_[_0x356a('0x47')](_0x2ff679[_0x356a('0x38')],{'$or':_[_0x356a('0x39')](_0x2ff679[_0x356a('0x2f')],function(_0x45ea6c){var _0x1e8871={};_0x1e8871[_0x45ea6c]={'$like':'%'+_0x4458c4[_0x356a('0x2d')][_0x356a('0x37')]+'%'};return _0x1e8871;})});}_0x2ff679=_[_0x356a('0x47')]({},_0x2ff679,_0x4458c4[_0x356a('0x3e')]);return _0x4e5507['getActions'](_0x2ff679);}})[_0x356a('0x1e')](function(_0x330c63){if(_0x330c63){_0x4b166e=_0x330c63[_0x356a('0x30')];if(!_0x4458c4[_0x356a('0x2d')][_0x356a('0x31')](_0x356a('0x32'))){_0x2ff679[_0x356a('0x19')]=qs[_0x356a('0x19')](_0x4458c4[_0x356a('0x2d')][_0x356a('0x19')]);_0x2ff679[_0x356a('0x18')]=qs[_0x356a('0x18')](_0x4458c4[_0x356a('0x2d')][_0x356a('0x18')]);}return _0x4e5507[_0x356a('0x5d')](_0x2ff679);}})[_0x356a('0x1e')](function(_0x491e4c){if(_0x491e4c){return _0x491e4c?{'count':_0x4b166e,'rows':_0x491e4c}:null;}})['then'](respondWithResult(_0x55914a,null))[_0x356a('0x42')](handleError(_0x55914a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 8f60ff7..6cf9e45 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 _0x95e3=['define','tools_triggers','lodash','../../config/logger','api','moment','request-promise'];(function(_0x433fc0,_0x3e3711){var _0x3956bb=function(_0x232b9d){while(--_0x232b9d){_0x433fc0['push'](_0x433fc0['shift']());}};_0x3956bb(++_0x3e3711);}(_0x95e3,0xf7));var _0x395e=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x95e3[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x395e('0x0'));var util=require('util');var logger=require(_0x395e('0x1'))(_0x395e('0x2'));var moment=require(_0x395e('0x3'));var BPromise=require('bluebird');var rp=require(_0x395e('0x4'));var attributes=require('./trigger.attributes');module['exports']=function(_0x3055ea,_0x9e5460){return _0x3055ea[_0x395e('0x5')]('Trigger',attributes,{'tableName':_0x395e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd057=['moment','./trigger.attributes','Trigger','tools_triggers','lodash','util','api'];(function(_0x1f9bff,_0x1cb9fb){var _0x239bef=function(_0x54965f){while(--_0x54965f){_0x1f9bff['push'](_0x1f9bff['shift']());}};_0x239bef(++_0x1cb9fb);}(_0xd057,0x123));var _0x7d05=function(_0x57dbbe,_0x70f5bb){_0x57dbbe=_0x57dbbe-0x0;var _0x4b82ab=_0xd057[_0x57dbbe];return _0x4b82ab;};'use strict';var _=require(_0x7d05('0x0'));var util=require(_0x7d05('0x1'));var logger=require('../../config/logger')(_0x7d05('0x2'));var moment=require(_0x7d05('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x7d05('0x4'));module['exports']=function(_0xe7d30c,_0x4b92f6){return _0xe7d30c['define'](_0x7d05('0x5'),attributes,{'tableName':_0x7d05('0x6'),'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 9b0c4c3..5309eae 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 _0xd2f6=['../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa92559,_0x1d2e45){var _0x502df8=function(_0x3321db){while(--_0x3321db){_0xa92559['push'](_0xa92559['shift']());}};_0x502df8(++_0x1d2e45);}(_0xd2f6,0x14e));var _0x6d2f=function(_0x1d1397,_0x3a2694){_0x1d1397=_0x1d1397-0x0;var _0x3aea2c=_0xd2f6[_0x1d1397];return _0x3aea2c;};'use strict';var _=require(_0x6d2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6d2f('0x1'));var rs=require(_0x6d2f('0x2'));var fs=require('fs');var Redis=require(_0x6d2f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d2f('0x4'));var logger=require(_0x6d2f('0x5'))('rpc');var config=require(_0x6d2f('0x6'));var jayson=require(_0x6d2f('0x7'));var client=jayson[_0x6d2f('0x8')][_0x6d2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x398151,_0x2f3e12,_0x5d90cd){return new BPromise(function(_0x15e213,_0x329353){return client[_0x6d2f('0xa')](_0x398151,_0x5d90cd)[_0x6d2f('0xb')](function(_0x3f41e1){logger['info'](_0x6d2f('0xc'),_0x2f3e12,'request\x20sent');logger[_0x6d2f('0xd')](_0x6d2f('0xe'),_0x2f3e12,_0x6d2f('0xf'),JSON[_0x6d2f('0x10')](_0x3f41e1));if(_0x3f41e1[_0x6d2f('0x11')]){if(_0x3f41e1['error']['code']===0x1f4){logger[_0x6d2f('0x11')](_0x6d2f('0xc'),_0x2f3e12,_0x3f41e1[_0x6d2f('0x11')][_0x6d2f('0x12')]);return _0x329353(_0x3f41e1[_0x6d2f('0x11')][_0x6d2f('0x12')]);}logger[_0x6d2f('0x11')](_0x6d2f('0xc'),_0x2f3e12,_0x3f41e1[_0x6d2f('0x11')]['message']);return _0x15e213(_0x3f41e1['error'][_0x6d2f('0x12')]);}else{logger[_0x6d2f('0x13')](_0x6d2f('0xc'),_0x2f3e12,'request\x20sent');_0x15e213(_0x3f41e1[_0x6d2f('0x14')][_0x6d2f('0x12')]);}})[_0x6d2f('0x15')](function(_0x465333){logger[_0x6d2f('0x11')]('Trigger,\x20%s,\x20%s',_0x2f3e12,_0x465333);_0x329353(_0x465333);});});}exports[_0x6d2f('0x16')]=function(_0x4e7c90){var _0x415021=this;return new Promise(function(_0x2ee630,_0x5b13c0){return db[_0x6d2f('0x17')][_0x6d2f('0x18')]({'raw':_0x4e7c90[_0x6d2f('0x19')]?_0x4e7c90['options'][_0x6d2f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e7c90[_0x6d2f('0x19')]?_0x4e7c90[_0x6d2f('0x19')][_0x6d2f('0x1b')]||null:null,'attributes':_0x4e7c90[_0x6d2f('0x19')]?_0x4e7c90[_0x6d2f('0x19')][_0x6d2f('0x1c')]||null:null,'limit':_0x4e7c90[_0x6d2f('0x19')]?_0x4e7c90[_0x6d2f('0x19')][_0x6d2f('0x1d')]||null:null,'include':_0x4e7c90[_0x6d2f('0x19')]?_0x4e7c90['options'][_0x6d2f('0x1e')]?_['map'](_0x4e7c90[_0x6d2f('0x19')]['include'],function(_0x5c552e){return{'model':db[_0x5c552e['model']],'as':_0x5c552e['as'],'attributes':_0x5c552e[_0x6d2f('0x1c')],'include':_0x5c552e[_0x6d2f('0x1e')]?_[_0x6d2f('0x1f')](_0x5c552e[_0x6d2f('0x1e')],function(_0x5ca39d){return{'model':db[_0x5ca39d['model']],'as':_0x5ca39d['as'],'attributes':_0x5ca39d[_0x6d2f('0x1c')],'include':_0x5ca39d['include']?_[_0x6d2f('0x1f')](_0x5ca39d[_0x6d2f('0x1e')],function(_0x2dde0b){return{'model':db[_0x2dde0b['model']],'as':_0x2dde0b['as'],'attributes':_0x2dde0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d2f('0xb')](function(_0x6a86c5){logger[_0x6d2f('0x13')](_0x6d2f('0x16'),_0x4e7c90);logger[_0x6d2f('0xd')](_0x6d2f('0x16'),_0x4e7c90,JSON[_0x6d2f('0x10')](_0x6a86c5));_0x2ee630(_0x6a86c5);})[_0x6d2f('0x15')](function(_0x2e8da8){logger[_0x6d2f('0x11')](_0x6d2f('0x16'),_0x2e8da8[_0x6d2f('0x12')],_0x4e7c90);_0x5b13c0(_0x415021[_0x6d2f('0x11')](0x1f4,_0x2e8da8[_0x6d2f('0x12')]));});});};exports['ShowTrigger']=function(_0xee878c){var _0x11928c=this;return new Promise(function(_0x173e52,_0xf0e2f4){return db[_0x6d2f('0x17')]['find']({'raw':_0xee878c[_0x6d2f('0x19')]?_0xee878c[_0x6d2f('0x19')][_0x6d2f('0x1a')]===undefined?!![]:![]:!![],'where':_0xee878c[_0x6d2f('0x19')]?_0xee878c['options'][_0x6d2f('0x1b')]||null:null,'attributes':_0xee878c[_0x6d2f('0x19')]?_0xee878c['options'][_0x6d2f('0x1c')]||null:null,'include':_0xee878c[_0x6d2f('0x19')]?_0xee878c[_0x6d2f('0x19')][_0x6d2f('0x1e')]?_[_0x6d2f('0x1f')](_0xee878c[_0x6d2f('0x19')][_0x6d2f('0x1e')],function(_0x1f19fe){return{'model':db[_0x1f19fe['model']],'as':_0x1f19fe['as'],'attributes':_0x1f19fe['attributes'],'include':_0x1f19fe['include']?_[_0x6d2f('0x1f')](_0x1f19fe['include'],function(_0x405a78){return{'model':db[_0x405a78['model']],'as':_0x405a78['as'],'attributes':_0x405a78[_0x6d2f('0x1c')],'include':_0x405a78['include']?_[_0x6d2f('0x1f')](_0x405a78[_0x6d2f('0x1e')],function(_0x276fa8){return{'model':db[_0x276fa8[_0x6d2f('0x20')]],'as':_0x276fa8['as'],'attributes':_0x276fa8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d2f('0xb')](function(_0x2d557a){logger[_0x6d2f('0x13')](_0x6d2f('0x21'),_0xee878c);logger[_0x6d2f('0xd')](_0x6d2f('0x21'),_0xee878c,JSON[_0x6d2f('0x10')](_0x2d557a));_0x173e52(_0x2d557a);})[_0x6d2f('0x15')](function(_0x2cd75b){logger[_0x6d2f('0x11')](_0x6d2f('0x21'),_0x2cd75b[_0x6d2f('0x12')],_0xee878c);_0xf0e2f4(_0x11928c[_0x6d2f('0x11')](0x1f4,_0x2cd75b[_0x6d2f('0x12')]));});});}; \ No newline at end of file +var _0x84af=['rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','where','include','map','model','attributes','catch','find','raw','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x49f6ae,_0x2f75b6){var _0x3e4d37=function(_0x372c54){while(--_0x372c54){_0x49f6ae['push'](_0x49f6ae['shift']());}};_0x3e4d37(++_0x2f75b6);}(_0x84af,0x17d));var _0xf84a=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x84af[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xf84a('0x0'));var util=require(_0xf84a('0x1'));var moment=require(_0xf84a('0x2'));var BPromise=require(_0xf84a('0x3'));var rs=require(_0xf84a('0x4'));var fs=require('fs');var Redis=require(_0xf84a('0x5'));var db=require(_0xf84a('0x6'))['db'];var utils=require(_0xf84a('0x7'));var logger=require(_0xf84a('0x8'))(_0xf84a('0x9'));var config=require(_0xf84a('0xa'));var jayson=require(_0xf84a('0xb'));var client=jayson[_0xf84a('0xc')][_0xf84a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1911a0,_0x48b114,_0x41d3a9){return new BPromise(function(_0x2c6191,_0x277f48){return client[_0xf84a('0xe')](_0x1911a0,_0x41d3a9)[_0xf84a('0xf')](function(_0xb02e1c){logger['info'](_0xf84a('0x10'),_0x48b114,_0xf84a('0x11'));logger[_0xf84a('0x12')](_0xf84a('0x13'),_0x48b114,_0xf84a('0x11'),JSON[_0xf84a('0x14')](_0xb02e1c));if(_0xb02e1c[_0xf84a('0x15')]){if(_0xb02e1c[_0xf84a('0x15')][_0xf84a('0x16')]===0x1f4){logger['error'](_0xf84a('0x10'),_0x48b114,_0xb02e1c[_0xf84a('0x15')][_0xf84a('0x17')]);return _0x277f48(_0xb02e1c[_0xf84a('0x15')]['message']);}logger[_0xf84a('0x15')](_0xf84a('0x10'),_0x48b114,_0xb02e1c['error'][_0xf84a('0x17')]);return _0x2c6191(_0xb02e1c[_0xf84a('0x15')][_0xf84a('0x17')]);}else{logger[_0xf84a('0x18')]('Trigger,\x20%s,\x20%s',_0x48b114,_0xf84a('0x11'));_0x2c6191(_0xb02e1c[_0xf84a('0x19')]['message']);}})['catch'](function(_0x6d9145){logger[_0xf84a('0x15')](_0xf84a('0x10'),_0x48b114,_0x6d9145);_0x277f48(_0x6d9145);});});}exports[_0xf84a('0x1a')]=function(_0x220cac){var _0x4edbf6=this;return new Promise(function(_0x338bdf,_0xbcbd3b){return db[_0xf84a('0x1b')][_0xf84a('0x1c')]({'raw':_0x220cac[_0xf84a('0x1d')]?_0x220cac[_0xf84a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x220cac['options']?_0x220cac[_0xf84a('0x1d')][_0xf84a('0x1e')]||null:null,'attributes':_0x220cac[_0xf84a('0x1d')]?_0x220cac['options']['attributes']||null:null,'limit':_0x220cac[_0xf84a('0x1d')]?_0x220cac[_0xf84a('0x1d')]['limit']||null:null,'include':_0x220cac[_0xf84a('0x1d')]?_0x220cac[_0xf84a('0x1d')][_0xf84a('0x1f')]?_[_0xf84a('0x20')](_0x220cac[_0xf84a('0x1d')]['include'],function(_0x18d9d8){return{'model':db[_0x18d9d8[_0xf84a('0x21')]],'as':_0x18d9d8['as'],'attributes':_0x18d9d8['attributes'],'include':_0x18d9d8[_0xf84a('0x1f')]?_[_0xf84a('0x20')](_0x18d9d8[_0xf84a('0x1f')],function(_0x464450){return{'model':db[_0x464450[_0xf84a('0x21')]],'as':_0x464450['as'],'attributes':_0x464450[_0xf84a('0x22')],'include':_0x464450[_0xf84a('0x1f')]?_[_0xf84a('0x20')](_0x464450['include'],function(_0x442d38){return{'model':db[_0x442d38[_0xf84a('0x21')]],'as':_0x442d38['as'],'attributes':_0x442d38['attributes']};}):[]};}):[]};}):[]:[]})[_0xf84a('0xf')](function(_0x40b65a){logger[_0xf84a('0x18')]('GetTrigger',_0x220cac);logger[_0xf84a('0x12')]('GetTrigger',_0x220cac,JSON[_0xf84a('0x14')](_0x40b65a));_0x338bdf(_0x40b65a);})[_0xf84a('0x23')](function(_0x10d7f4){logger[_0xf84a('0x15')](_0xf84a('0x1a'),_0x10d7f4['message'],_0x220cac);_0xbcbd3b(_0x4edbf6['error'](0x1f4,_0x10d7f4[_0xf84a('0x17')]));});});};exports['ShowTrigger']=function(_0x404102){var _0x121b07=this;return new Promise(function(_0x10200d,_0x364808){return db[_0xf84a('0x1b')][_0xf84a('0x24')]({'raw':_0x404102[_0xf84a('0x1d')]?_0x404102[_0xf84a('0x1d')][_0xf84a('0x25')]===undefined?!![]:![]:!![],'where':_0x404102[_0xf84a('0x1d')]?_0x404102[_0xf84a('0x1d')][_0xf84a('0x1e')]||null:null,'attributes':_0x404102[_0xf84a('0x1d')]?_0x404102[_0xf84a('0x1d')][_0xf84a('0x22')]||null:null,'include':_0x404102[_0xf84a('0x1d')]?_0x404102['options'][_0xf84a('0x1f')]?_[_0xf84a('0x20')](_0x404102['options'][_0xf84a('0x1f')],function(_0x58051e){return{'model':db[_0x58051e['model']],'as':_0x58051e['as'],'attributes':_0x58051e[_0xf84a('0x22')],'include':_0x58051e[_0xf84a('0x1f')]?_['map'](_0x58051e[_0xf84a('0x1f')],function(_0x4d05b4){return{'model':db[_0x4d05b4[_0xf84a('0x21')]],'as':_0x4d05b4['as'],'attributes':_0x4d05b4[_0xf84a('0x22')],'include':_0x4d05b4[_0xf84a('0x1f')]?_[_0xf84a('0x20')](_0x4d05b4[_0xf84a('0x1f')],function(_0x7a3bb7){return{'model':db[_0x7a3bb7['model']],'as':_0x7a3bb7['as'],'attributes':_0x7a3bb7[_0xf84a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf84a('0xf')](function(_0x5dec4c){logger['info'](_0xf84a('0x26'),_0x404102);logger[_0xf84a('0x12')](_0xf84a('0x26'),_0x404102,JSON['stringify'](_0x5dec4c));_0x10200d(_0x5dec4c);})[_0xf84a('0x23')](function(_0x2097bc){logger[_0xf84a('0x15')](_0xf84a('0x26'),_0x2097bc[_0xf84a('0x17')],_0x404102);_0x364808(_0x121b07[_0xf84a('0x15')](0x1f4,_0x2097bc['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f905cc0..bdc4ad6 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 _0x6d69=['post','/:id/clone','clone','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6d69,0x148));var _0x96d6=function(_0x539242,_0x4ed323){_0x539242=_0x539242-0x0;var _0x2cf203=_0x6d69[_0x539242];return _0x2cf203;};'use strict';var multer=require(_0x96d6('0x0'));var util=require(_0x96d6('0x1'));var path=require(_0x96d6('0x2'));var timeout=require(_0x96d6('0x3'));var express=require('express');var router=express[_0x96d6('0x4')]();var auth=require(_0x96d6('0x5'));var interaction=require(_0x96d6('0x6'));var config=require(_0x96d6('0x7'));var controller=require('./trunk.controller');router[_0x96d6('0x8')]('/',auth[_0x96d6('0x9')](),controller[_0x96d6('0xa')]);router['get'](_0x96d6('0xb'),auth[_0x96d6('0x9')](),controller['show']);router[_0x96d6('0xc')](_0x96d6('0xd'),auth[_0x96d6('0x9')](),controller[_0x96d6('0xe')]);router[_0x96d6('0xc')]('/',auth[_0x96d6('0x9')](),controller[_0x96d6('0xf')]);router[_0x96d6('0x10')](_0x96d6('0xb'),auth[_0x96d6('0x9')](),controller[_0x96d6('0x11')]);router['delete'](_0x96d6('0xb'),auth[_0x96d6('0x9')](),controller[_0x96d6('0x12')]);module[_0x96d6('0x13')]=router; \ No newline at end of file +var _0x4af9=['path','connect-timeout','Router','../../components/auth/service','/:id','isAuthenticated','show','post','/:id/clone','clone','put','delete','destroy','exports','multer','util'];(function(_0xbf6f32,_0x3d793a){var _0x1d3ecc=function(_0x2f236e){while(--_0x2f236e){_0xbf6f32['push'](_0xbf6f32['shift']());}};_0x1d3ecc(++_0x3d793a);}(_0x4af9,0xce));var _0x94af=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4af9[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x94af('0x0'));var util=require(_0x94af('0x1'));var path=require(_0x94af('0x2'));var timeout=require(_0x94af('0x3'));var express=require('express');var router=express[_0x94af('0x4')]();var auth=require(_0x94af('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x94af('0x6'),auth[_0x94af('0x7')](),controller[_0x94af('0x8')]);router[_0x94af('0x9')](_0x94af('0xa'),auth[_0x94af('0x7')](),controller[_0x94af('0xb')]);router[_0x94af('0x9')]('/',auth[_0x94af('0x7')](),controller['create']);router[_0x94af('0xc')](_0x94af('0x6'),auth[_0x94af('0x7')](),controller['update']);router[_0x94af('0xd')](_0x94af('0x6'),auth[_0x94af('0x7')](),controller[_0x94af('0xe')]);module[_0x94af('0xf')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index fba52c7..fd181c4 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 _0xb7e7=['always','accept','refuse','originate','uac','uas','fingerprint','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7b7e('0x2')]('friend',_0x7b7e('0x3'),'peer'),'allowNull':![],'defaultValue':_0x7b7e('0x4')},'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8'),'PROHIB_NOT_SCREENED',_0x7b7e('0x9'),_0x7b7e('0xa'),_0x7b7e('0xb'))},'deny':{'type':Sequelize[_0x7b7e('0x1')]},'permit':{'type':Sequelize[_0x7b7e('0x1')]},'secret':{'type':Sequelize[_0x7b7e('0x1')]},'md5secret':{'type':Sequelize[_0x7b7e('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc'),'set':function(_0x10a666){this[_0x7b7e('0xd')](_0x7b7e('0xe'),_0x10a666?_0x10a666[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0xe'))?this[_0x7b7e('0x10')]('transport')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x7b7e('0x13'),'info','shortinfo',_0x7b7e('0x14'),_0x7b7e('0x15')),'defaultValue':_0x7b7e('0x13')},'directmedia':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','nonat','update',_0x7b7e('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7b7e('0x1')]},'directmediadeny':{'type':Sequelize[_0x7b7e('0x1')]},'nat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x18'),'set':function(_0x200ef7){this[_0x7b7e('0xd')](_0x7b7e('0x19'),_0x200ef7?_0x200ef7[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0x19'))?this[_0x7b7e('0x10')](_0x7b7e('0x19'))[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x7b7e('0x1')]},'pickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1b')},'allow':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x1c'),'set':function(_0x303d8c){this[_0x7b7e('0xd')](_0x7b7e('0x1d'),_0x303d8c?_0x303d8c['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x7b7e('0x1d'))?this[_0x7b7e('0x10')](_0x7b7e('0x1d'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'insecure':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1e'),'set':function(_0x7aa71){this[_0x7b7e('0xd')]('insecure',_0x7aa71?_0x7aa71[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')]('insecure')?this['getDataValue']('insecure')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1f')},'trustrpid':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'accountcode':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7b7e('0x1')]},'callcounter':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'busylevel':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x7b7e('0x1')]},'template':{'type':Sequelize[_0x7b7e('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no',_0x7b7e('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'session_timers':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x22'),_0x7b7e('0x23'),_0x7b7e('0x24'))},'session_expires':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x25'),_0x7b7e('0x26')),'defaultValue':_0x7b7e('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x7b7e('0x1')]},'fromdomain':{'type':Sequelize[_0x7b7e('0x1')]},'fromuser':{'type':Sequelize[_0x7b7e('0x1')]},'port':{'type':Sequelize[_0x7b7e('0x20')](0x5)},'qualify':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'keepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x7b7e('0x1')]},'defaultuser':{'type':Sequelize[_0x7b7e('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7b7e('0x1')]},'callbackextension':{'type':Sequelize[_0x7b7e('0x1')]},'timert1':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x7b7e('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x7b7e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'encryption':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'force_avp':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'icesupport':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x7b7e('0x2')]('yes','no',_0x7b7e('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7b7e('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x7b7e('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7b7e('0x1')]},'dtlssetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x28'),_0x7b7e('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7b7e('0x1')]},'usereqphone':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7b7e('0x1')]},'recordofffeature':{'type':Sequelize[_0x7b7e('0x1')]},'call_limit':{'type':Sequelize[_0x7b7e('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x7b7e('0x1')]},'mohinterpret':{'type':Sequelize[_0x7b7e('0x1')]},'mohsuggest':{'type':Sequelize[_0x7b7e('0x1')]},'parkinglot':{'type':Sequelize[_0x7b7e('0x1')]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x7b7e('0x2a')},'canreinvite':{'type':Sequelize[_0x7b7e('0x2')]('yes','no','nonat',_0x7b7e('0x2b'),_0x7b7e('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7b7e('0x1')]},'otherFields':{'type':Sequelize[_0x7b7e('0x1')]},'active':{'type':Sequelize[_0x7b7e('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x1447be,_0x234ad8){var _0x4894ea=function(_0x437479){while(--_0x437479){_0x1447be['push'](_0x1447be['shift']());}};_0x4894ea(++_0x234ad8);}(_0xb10b,0x12a));var _0xbb10=function(_0x20f08b,_0x646ea0){_0x20f08b=_0x20f08b-0x0;var _0x675062=_0xb10b[_0x20f08b];return _0x675062;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('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 d954c84..e8225e7 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 _0x0cc3=['create','user','role','userProfileId','autoAssociation','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trunk,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','sendStatus','name','send','index','Trunk','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','length','find','clone','rawAttributes','omit','updatedAt','createdAt'];(function(_0x41f6bb,_0x833389){var _0x4ddcd=function(_0x2b2540){while(--_0x2b2540){_0x41f6bb['push'](_0x41f6bb['shift']());}};_0x4ddcd(++_0x833389);}(_0x0cc3,0x86));var _0x30cc=function(_0x4f8bd5,_0x336c76){_0x4f8bd5=_0x4f8bd5-0x0;var _0x3fd0b7=_0x0cc3[_0x4f8bd5];return _0x3fd0b7;};'use strict';var pdf=require(_0x30cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x30cc('0x1'));var zipdir=require(_0x30cc('0x2'));var jsonpatch=require(_0x30cc('0x3'));var rp=require(_0x30cc('0x4'));var moment=require(_0x30cc('0x5'));var BPromise=require(_0x30cc('0x6'));var Mustache=require('mustache');var util=require(_0x30cc('0x7'));var path=require(_0x30cc('0x8'));var sox=require(_0x30cc('0x9'));var csv=require(_0x30cc('0xa'));var ejs=require(_0x30cc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x30cc('0xc'));var crypto=require(_0x30cc('0xd'));var jsforce=require(_0x30cc('0xe'));var deskjs=require(_0x30cc('0xf'));var toCsv=require(_0x30cc('0xa'));var querystring=require('querystring');var Papa=require(_0x30cc('0x10'));var authService=require(_0x30cc('0x11'));var hardwareService=require(_0x30cc('0x12'));var Redis=require(_0x30cc('0x13'));var qs=require(_0x30cc('0x14'));var logger=require(_0x30cc('0x15'))(_0x30cc('0x16'));var utils=require(_0x30cc('0x17'));var config=require(_0x30cc('0x18'));var db=require(_0x30cc('0x19'))['db'];var jayson=require(_0x30cc('0x1a'));var client=jayson[_0x30cc('0x1b')][_0x30cc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x11b57c,_0x5c2a7b,_0x4c3797,_0x351d6d){return new BPromise(function(_0x3c128c,_0x1ffcfa){var _0x318736=_0x351d6d||client;return _0x318736[_0x30cc('0x1d')](_0x11b57c,_0x4c3797)[_0x30cc('0x1e')](function(_0x2fdc47){logger[_0x30cc('0x1f')]('Trunk,\x20%s,\x20%s',_0x5c2a7b,'request\x20sent');logger[_0x30cc('0x20')](_0x30cc('0x21'),_0x5c2a7b,_0x30cc('0x22'),JSON[_0x30cc('0x23')](_0x2fdc47));if(_0x2fdc47[_0x30cc('0x24')]){if(_0x2fdc47[_0x30cc('0x24')]['code']===0x1f4){logger[_0x30cc('0x24')](_0x30cc('0x25'),_0x5c2a7b,_0x2fdc47[_0x30cc('0x24')][_0x30cc('0x26')]);return _0x1ffcfa(_0x2fdc47['error']['message']);}logger[_0x30cc('0x24')](_0x30cc('0x25'),_0x5c2a7b,_0x2fdc47['error'][_0x30cc('0x26')]);return _0x3c128c(_0x2fdc47[_0x30cc('0x24')][_0x30cc('0x26')]);}else{logger[_0x30cc('0x1f')](_0x30cc('0x25'),_0x5c2a7b,_0x30cc('0x22'));_0x3c128c(_0x2fdc47['result'][_0x30cc('0x26')]);}})[_0x30cc('0x27')](function(_0x148934){logger['error']('Trunk,\x20%s,\x20%s',_0x5c2a7b,_0x148934);_0x1ffcfa(_0x148934);});});}function respondWithStatusCode(_0x44af71,_0x141d90){_0x141d90=_0x141d90||0xcc;return function(_0x3733fd){if(_0x3733fd){return _0x44af71['sendStatus'](_0x141d90);}return _0x44af71[_0x30cc('0x28')](_0x141d90)[_0x30cc('0x29')]();};}function respondWithResult(_0x430734,_0x2da595){_0x2da595=_0x2da595||0xc8;return function(_0x3500d2){if(_0x3500d2){return _0x430734['status'](_0x2da595)[_0x30cc('0x2a')](_0x3500d2);}};}function respondWithFilteredResult(_0x480ebf,_0x4394f3){return function(_0x1c2fc2){if(_0x1c2fc2){var _0x2c8962=_0x1c2fc2[_0x30cc('0x2b')],_0x1444b5=_0x4394f3['offset'],_0x154db5=_0x4394f3[_0x30cc('0x2c')]+_0x4394f3[_0x30cc('0x2d')],_0x873c15;if(_0x154db5>=_0x2c8962){_0x154db5=_0x2c8962;_0x873c15=0xc8;}else{_0x873c15=0xce;}_0x480ebf['status'](_0x873c15);return _0x480ebf[_0x30cc('0x2e')]('Content-Range',_0x1444b5+'-'+_0x154db5+'/'+_0x2c8962)[_0x30cc('0x2a')](_0x1c2fc2);}return null;};}function patchUpdates(_0x4657b5){return function(_0x13ae07){try{jsonpatch[_0x30cc('0x2f')](_0x13ae07,_0x4657b5,!![]);}catch(_0x4167b1){return BPromise[_0x30cc('0x30')](_0x4167b1);}return _0x13ae07[_0x30cc('0x31')]();};}function saveUpdates(_0x5e0b74,_0x36bb10){return function(_0x114bf5){if(_0x114bf5){return _0x114bf5[_0x30cc('0x32')](_0x5e0b74)[_0x30cc('0x1e')](function(_0x293e74){return _0x293e74;});}return null;};}function removeEntity(_0x15ff95,_0x568d8c){return function(_0x1907fc){if(_0x1907fc){return _0x1907fc['destroy']()[_0x30cc('0x1e')](function(){var _0x56835f=_0x1907fc[_0x30cc('0x33')]({'plain':!![]});var _0x10710d=_0x30cc('0x34');return db[_0x30cc('0x35')][_0x30cc('0x36')]({'where':{'type':_0x10710d,'resourceId':_0x56835f['id']}})['then'](function(){return _0x1907fc;});})['then'](function(){_0x15ff95[_0x30cc('0x28')](0xcc)[_0x30cc('0x29')]();});}};}function handleEntityNotFound(_0x298d29,_0x1fcf96){return function(_0x36a0b7){if(!_0x36a0b7){_0x298d29[_0x30cc('0x37')](0x194);}return _0x36a0b7;};}function handleError(_0x7fad67,_0x3fe577){_0x3fe577=_0x3fe577||0x1f4;return function(_0x3f34af){logger[_0x30cc('0x24')](_0x3f34af['stack']);if(_0x3f34af[_0x30cc('0x38')]){delete _0x3f34af[_0x30cc('0x38')];}_0x7fad67[_0x30cc('0x28')](_0x3fe577)[_0x30cc('0x39')](_0x3f34af);};}exports[_0x30cc('0x3a')]=function(_0x193b71,_0x165d67){var _0x2d7b83={},_0x229bf6={},_0x459e9e={'count':0x0,'rows':[]};var _0x44791b=db[_0x30cc('0x3b')]['rawAttributes'];_0x229bf6[_0x30cc('0x3c')]=_[_0x30cc('0x3d')](_0x44791b);_0x229bf6['query']=_[_0x30cc('0x3d')](_0x193b71[_0x30cc('0x3e')]);_0x229bf6[_0x30cc('0x3f')]=_['intersection'](_0x229bf6['model'],_0x229bf6[_0x30cc('0x3e')]);_0x2d7b83[_0x30cc('0x40')]=_[_0x30cc('0x41')](_0x229bf6[_0x30cc('0x3c')],qs[_0x30cc('0x42')](_0x193b71[_0x30cc('0x3e')][_0x30cc('0x42')]));_0x2d7b83[_0x30cc('0x40')]=_0x2d7b83[_0x30cc('0x40')]['length']?_0x2d7b83[_0x30cc('0x40')]:_0x229bf6[_0x30cc('0x3c')];if(!_0x193b71[_0x30cc('0x3e')][_0x30cc('0x43')](_0x30cc('0x44'))){_0x2d7b83[_0x30cc('0x2d')]=qs['limit'](_0x193b71[_0x30cc('0x3e')][_0x30cc('0x2d')]);_0x2d7b83[_0x30cc('0x2c')]=qs[_0x30cc('0x2c')](_0x193b71[_0x30cc('0x3e')][_0x30cc('0x2c')]);}_0x2d7b83[_0x30cc('0x45')]=qs[_0x30cc('0x46')](_0x193b71[_0x30cc('0x3e')][_0x30cc('0x46')]);_0x2d7b83[_0x30cc('0x47')]=qs[_0x30cc('0x3f')](_['pick'](_0x193b71[_0x30cc('0x3e')],_0x229bf6[_0x30cc('0x3f')]));if(_0x193b71[_0x30cc('0x3e')][_0x30cc('0x48')]){_0x2d7b83['where']=_[_0x30cc('0x49')](_0x2d7b83[_0x30cc('0x47')],{'$or':_[_0x30cc('0x4a')](_0x44791b,function(_0x27521a){if(_0x27521a[_0x30cc('0x4b')][_0x30cc('0x4c')]!=='VIRTUAL'){var _0x4af2ec={};_0x4af2ec[_0x27521a[_0x30cc('0x4d')]]={'$like':'%'+_0x193b71['query'][_0x30cc('0x48')]+'%'};return _0x4af2ec;}})});}_0x2d7b83=_['merge']({},_0x2d7b83,_0x193b71[_0x30cc('0x4e')]);var _0x440a9c={'where':_0x2d7b83['where']};return db['Trunk'][_0x30cc('0x2b')](_0x440a9c)[_0x30cc('0x1e')](function(_0x1cb85f){_0x459e9e[_0x30cc('0x2b')]=_0x1cb85f;if(_0x193b71[_0x30cc('0x3e')][_0x30cc('0x4f')]){_0x2d7b83[_0x30cc('0x50')]=[{'all':!![]}];}return db[_0x30cc('0x3b')][_0x30cc('0x51')](_0x2d7b83);})[_0x30cc('0x1e')](function(_0x32eb20){_0x459e9e[_0x30cc('0x52')]=_0x32eb20;return _0x459e9e;})[_0x30cc('0x1e')](respondWithFilteredResult(_0x165d67,_0x2d7b83))[_0x30cc('0x27')](handleError(_0x165d67,null));};exports[_0x30cc('0x53')]=function(_0x441b3c,_0x287046){var _0x55b5d4={'raw':![],'where':{'id':_0x441b3c[_0x30cc('0x54')]['id']}},_0x1e9f06={};_0x1e9f06[_0x30cc('0x3c')]=_[_0x30cc('0x3d')](db[_0x30cc('0x3b')]['rawAttributes']);_0x1e9f06[_0x30cc('0x3e')]=_[_0x30cc('0x3d')](_0x441b3c[_0x30cc('0x3e')]);_0x1e9f06[_0x30cc('0x3f')]=_[_0x30cc('0x41')](_0x1e9f06['model'],_0x1e9f06[_0x30cc('0x3e')]);_0x55b5d4[_0x30cc('0x40')]=_[_0x30cc('0x41')](_0x1e9f06[_0x30cc('0x3c')],qs[_0x30cc('0x42')](_0x441b3c[_0x30cc('0x3e')]['fields']));_0x55b5d4[_0x30cc('0x40')]=_0x55b5d4[_0x30cc('0x40')][_0x30cc('0x55')]?_0x55b5d4['attributes']:_0x1e9f06[_0x30cc('0x3c')];if(_0x441b3c[_0x30cc('0x3e')]['includeAll']){_0x55b5d4[_0x30cc('0x50')]=[{'all':!![]}];}_0x55b5d4=_[_0x30cc('0x49')]({},_0x55b5d4,_0x441b3c[_0x30cc('0x4e')]);return db['Trunk'][_0x30cc('0x56')](_0x55b5d4)[_0x30cc('0x1e')](handleEntityNotFound(_0x287046,null))['then'](respondWithResult(_0x287046,null))['catch'](handleError(_0x287046,null));};exports[_0x30cc('0x57')]=function(_0x17ef8f,_0x80ecd1){var _0x3ba1d5={'raw':![],'where':{'id':_0x17ef8f['params']['id']}},_0x17c938={};_0x17c938[_0x30cc('0x3c')]=_[_0x30cc('0x3d')](db[_0x30cc('0x3b')][_0x30cc('0x58')]);_0x3ba1d5['attributes']=_['intersection'](_0x17c938['model'],qs[_0x30cc('0x42')](_0x17ef8f[_0x30cc('0x3e')][_0x30cc('0x42')]));_0x3ba1d5['attributes']=_0x3ba1d5[_0x30cc('0x40')][_0x30cc('0x55')]?_0x3ba1d5[_0x30cc('0x40')]:_0x17c938[_0x30cc('0x3c')];if(_0x17ef8f[_0x30cc('0x3e')][_0x30cc('0x4f')]){_0x3ba1d5['include']=[{'all':!![]}];}_0x3ba1d5=_[_0x30cc('0x49')]({},_0x3ba1d5,_0x17ef8f[_0x30cc('0x4e')]);return db[_0x30cc('0x3b')][_0x30cc('0x56')](_0x3ba1d5)[_0x30cc('0x1e')](handleEntityNotFound(_0x80ecd1,null))[_0x30cc('0x1e')](function(_0x11cf16){if(_0x11cf16){var _0x54a49a=_0x11cf16['get']({'plain':!![]});_0x54a49a=qs[_0x30cc('0x59')](_0x54a49a,['id','createdAt',_0x30cc('0x5a')]);_0x17ef8f['body']=_[_0x30cc('0x59')](_0x17ef8f['body'],['id',_0x30cc('0x5b'),'updatedAt']);return db[_0x30cc('0x3b')][_0x30cc('0x5c')](_[_0x30cc('0x49')](_0x54a49a,_0x17ef8f['body']),{'include':_0x17ef8f['query']['includeAll']?[{'all':!![]}]:undefined})[_0x30cc('0x1e')](function(_0x20fcdc){var _0x1ca841=_0x17ef8f[_0x30cc('0x5d')]['get']({'plain':!![]});if(!_0x1ca841)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ca841[_0x30cc('0x5e')]==='user'){var _0x164054=_0x20fcdc[_0x30cc('0x33')]({'plain':!![]});var _0x38e2bd=_0x30cc('0x34');return db['UserProfileSection'][_0x30cc('0x56')]({'where':{'name':_0x38e2bd,'userProfileId':_0x1ca841[_0x30cc('0x5f')]},'raw':!![]})[_0x30cc('0x1e')](function(_0x1de73d){if(_0x1de73d&&_0x1de73d[_0x30cc('0x60')]===0x0){return db['UserProfileResource'][_0x30cc('0x5c')]({'name':_0x164054['name'],'resourceId':_0x164054['id'],'type':_0x1de73d[_0x30cc('0x38')],'sectionId':_0x1de73d['id']},{})[_0x30cc('0x1e')](function(){return _0x20fcdc;});}else{return _0x20fcdc;}})[_0x30cc('0x27')](function(_0x4b05c4){logger[_0x30cc('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b05c4);throw _0x4b05c4;});}return _0x20fcdc;});}})[_0x30cc('0x1e')](respondWithResult(_0x80ecd1,0xc9))['catch'](handleError(_0x80ecd1,null));};exports[_0x30cc('0x5c')]=function(_0x5ba602,_0x4002ee,_0x4de2c4){var _0x225260;return db[_0x30cc('0x3b')][_0x30cc('0x5c')](_0x5ba602[_0x30cc('0x61')],{'raw':!![]})['then'](function(_0x286977){_0x225260=_0x286977;return db[_0x30cc('0x3b')]['findAll']({'raw':!![]});})[_0x30cc('0x1e')](function(_0x1ca60c){var _0x1da5d0=fs[_0x30cc('0x62')](path[_0x30cc('0x63')](config[_0x30cc('0x64')],'server/files/templates/trunk.ejs'),'utf8');var _0x27702b=fs[_0x30cc('0x62')](path['join'](config[_0x30cc('0x64')],'server/files/templates/registry.ejs'),'utf8');var _0x4e99c0=ejs[_0x30cc('0x65')](_0x1da5d0,{'trunks':_0x1ca60c||[]});fs[_0x30cc('0x66')](_0x30cc('0x67'),_0x4e99c0);if(_0x225260[_0x30cc('0x68')]){var _0x33a8e4=ejs[_0x30cc('0x65')](_0x27702b,{'trunks':_0x1ca60c||[]});fs['writeFileSync'](_0x30cc('0x69'),_0x33a8e4);}})[_0x30cc('0x1e')](function(){return respondWithRpcPromise(_0x30cc('0x6a'),_0x30cc('0x5c'),{'module':_0x30cc('0x6b')});})['then'](function(){var _0x1d6bd3=_0x5ba602[_0x30cc('0x5d')][_0x30cc('0x33')]({'plain':!![]});if(!_0x1d6bd3)throw new Error(_0x30cc('0x6c'));if(_0x1d6bd3[_0x30cc('0x5e')]===_0x30cc('0x5d')){var _0x5a03ba=_0x225260[_0x30cc('0x33')]({'plain':!![]});return db[_0x30cc('0x6d')][_0x30cc('0x56')]({'where':{'name':'Trunks','userProfileId':_0x1d6bd3[_0x30cc('0x5f')]},'raw':!![]})[_0x30cc('0x1e')](function(_0x58ab9b){if(_0x58ab9b&&_0x58ab9b[_0x30cc('0x60')]===0x0){return db['UserProfileResource'][_0x30cc('0x5c')]({'name':_0x5a03ba[_0x30cc('0x38')],'resourceId':_0x5a03ba['id'],'type':_0x58ab9b[_0x30cc('0x38')],'sectionId':_0x58ab9b['id']},{})[_0x30cc('0x1e')](function(){return _0x225260;});}else{return _0x225260;}})[_0x30cc('0x27')](function(_0x41f0bf){logger[_0x30cc('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41f0bf);throw _0x41f0bf;});}return _0x225260;})[_0x30cc('0x1e')](respondWithResult(_0x4002ee,0xc9))[_0x30cc('0x27')](handleError(_0x4002ee,null));};exports[_0x30cc('0x32')]=function(_0x53bc1e,_0x297742,_0x3048b0){var _0x176a70;return db[_0x30cc('0x3b')]['find']({'where':{'id':_0x53bc1e['params']['id']}})[_0x30cc('0x1e')](handleEntityNotFound(_0x297742,null))[_0x30cc('0x1e')](saveUpdates(_0x53bc1e[_0x30cc('0x61')],null))[_0x30cc('0x1e')](function(_0x158b66){if(_0x158b66){_0x176a70=_0x158b66;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x397a61){if(_0x397a61){var _0x3cb689=fs['readFileSync'](path['join'](config[_0x30cc('0x64')],_0x30cc('0x6e')),_0x30cc('0x6f'));var _0x21a452=fs['readFileSync'](path['join'](config[_0x30cc('0x64')],_0x30cc('0x70')),_0x30cc('0x6f'));var _0x107c87=ejs[_0x30cc('0x65')](_0x3cb689,{'trunks':_0x397a61||[]});fs[_0x30cc('0x66')](_0x30cc('0x67'),_0x107c87);var _0xdc6a34=ejs[_0x30cc('0x65')](_0x21a452,{'trunks':_0x397a61||[]});fs['writeFileSync'](_0x30cc('0x69'),_0xdc6a34);return respondWithRpcPromise(_0x30cc('0x6a'),_0x30cc('0x32'),{'module':_0x30cc('0x6b')});}return null;})[_0x30cc('0x1e')](function(_0x166ac9){if(_0x166ac9){return _0x176a70;}})[_0x30cc('0x1e')](respondWithResult(_0x297742,null))[_0x30cc('0x27')](handleError(_0x297742,null));};exports['destroy']=function(_0x7cacae,_0x57b556,_0x4f54d6){var _0x394987;return db[_0x30cc('0x3b')]['find']({'where':{'id':_0x7cacae[_0x30cc('0x54')]['id']}})[_0x30cc('0x1e')](handleEntityNotFound(_0x57b556,null))[_0x30cc('0x1e')](removeEntity(_0x57b556,null))[_0x30cc('0x1e')](function(){return db[_0x30cc('0x3b')][_0x30cc('0x51')]({'raw':!![]});})[_0x30cc('0x1e')](function(_0x107cd1){var _0x2fb968=fs[_0x30cc('0x62')](path[_0x30cc('0x63')](config[_0x30cc('0x64')],'server/files/templates/trunk.ejs'),_0x30cc('0x6f'));var _0x50c581=fs[_0x30cc('0x62')](path['join'](config[_0x30cc('0x64')],'server/files/templates/registry.ejs'),_0x30cc('0x6f'));var _0x23891f=ejs[_0x30cc('0x65')](_0x2fb968,{'trunks':_0x107cd1});var _0x60d1cb=ejs[_0x30cc('0x65')](_0x50c581,{'trunks':_0x107cd1});fs[_0x30cc('0x66')](_0x30cc('0x67'),_0x23891f);fs[_0x30cc('0x66')](_0x30cc('0x69'),_0x60d1cb);return respondWithRpcPromise(_0x30cc('0x6a'),_0x30cc('0x36'),{'module':_0x30cc('0x6b')});})[_0x30cc('0x27')](handleError(_0x57b556,null));}; \ No newline at end of file +var _0xfb13=['error','message','result','catch','sendStatus','end','count','offset','reject','save','update','then','destroy','get','Trunks','UserProfileResource','status','name','send','index','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Trunk','includeAll','findAll','rows','show','rawAttributes','include','find','clone','params','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','join','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x46d9c9,_0x39a084){var _0x46b104=function(_0x453ee){while(--_0x453ee){_0x46d9c9['push'](_0x46d9c9['shift']());}};_0x46b104(++_0x39a084);}(_0xfb13,0xb8));var _0x3fb1=function(_0x4ad451,_0x58139f){_0x4ad451=_0x4ad451-0x0;var _0xd31fef=_0xfb13[_0x4ad451];return _0xd31fef;};'use strict';var pdf=require(_0x3fb1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3fb1('0x1'));var jsonpatch=require(_0x3fb1('0x2'));var rp=require(_0x3fb1('0x3'));var moment=require(_0x3fb1('0x4'));var BPromise=require(_0x3fb1('0x5'));var Mustache=require('mustache');var util=require(_0x3fb1('0x6'));var path=require(_0x3fb1('0x7'));var sox=require(_0x3fb1('0x8'));var csv=require(_0x3fb1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3fb1('0xa'));var squel=require(_0x3fb1('0xb'));var crypto=require(_0x3fb1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fb1('0xd'));var toCsv=require(_0x3fb1('0x9'));var querystring=require('querystring');var Papa=require(_0x3fb1('0xe'));var authService=require(_0x3fb1('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x3fb1('0x10'));var logger=require('../../config/logger')(_0x3fb1('0x11'));var utils=require(_0x3fb1('0x12'));var config=require(_0x3fb1('0x13'));var db=require(_0x3fb1('0x14'))['db'];var jayson=require(_0x3fb1('0x15'));var client=jayson[_0x3fb1('0x16')][_0x3fb1('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3fde5d,_0x4328a0,_0x4d3a9e,_0x70b17d){return new BPromise(function(_0x18c243,_0x30ba31){var _0x27732b=_0x70b17d||client;return _0x27732b[_0x3fb1('0x18')](_0x3fde5d,_0x4d3a9e)['then'](function(_0x2edd6d){logger[_0x3fb1('0x19')](_0x3fb1('0x1a'),_0x4328a0,_0x3fb1('0x1b'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x4328a0,_0x3fb1('0x1b'),JSON['stringify'](_0x2edd6d));if(_0x2edd6d['error']){if(_0x2edd6d[_0x3fb1('0x1c')]['code']===0x1f4){logger[_0x3fb1('0x1c')](_0x3fb1('0x1a'),_0x4328a0,_0x2edd6d[_0x3fb1('0x1c')][_0x3fb1('0x1d')]);return _0x30ba31(_0x2edd6d['error']['message']);}logger[_0x3fb1('0x1c')]('Trunk,\x20%s,\x20%s',_0x4328a0,_0x2edd6d[_0x3fb1('0x1c')][_0x3fb1('0x1d')]);return _0x18c243(_0x2edd6d[_0x3fb1('0x1c')][_0x3fb1('0x1d')]);}else{logger[_0x3fb1('0x19')](_0x3fb1('0x1a'),_0x4328a0,'request\x20sent');_0x18c243(_0x2edd6d[_0x3fb1('0x1e')]['message']);}})[_0x3fb1('0x1f')](function(_0x784af){logger[_0x3fb1('0x1c')](_0x3fb1('0x1a'),_0x4328a0,_0x784af);_0x30ba31(_0x784af);});});}function respondWithStatusCode(_0x2b5445,_0x370f0c){_0x370f0c=_0x370f0c||0xcc;return function(_0x3e5fc5){if(_0x3e5fc5){return _0x2b5445[_0x3fb1('0x20')](_0x370f0c);}return _0x2b5445['status'](_0x370f0c)[_0x3fb1('0x21')]();};}function respondWithResult(_0x12fec8,_0x294b3d){_0x294b3d=_0x294b3d||0xc8;return function(_0x5973f8){if(_0x5973f8){return _0x12fec8['status'](_0x294b3d)['json'](_0x5973f8);}};}function respondWithFilteredResult(_0x240d61,_0x1330d1){return function(_0x385321){if(_0x385321){var _0x292fbe=_0x385321[_0x3fb1('0x22')],_0x59690f=_0x1330d1['offset'],_0x346ba2=_0x1330d1[_0x3fb1('0x23')]+_0x1330d1['limit'],_0x43a23d;if(_0x346ba2>=_0x292fbe){_0x346ba2=_0x292fbe;_0x43a23d=0xc8;}else{_0x43a23d=0xce;}_0x240d61['status'](_0x43a23d);return _0x240d61['set']('Content-Range',_0x59690f+'-'+_0x346ba2+'/'+_0x292fbe)['json'](_0x385321);}return null;};}function patchUpdates(_0x2ad89a){return function(_0xbca2cf){try{jsonpatch['apply'](_0xbca2cf,_0x2ad89a,!![]);}catch(_0x5e82f1){return BPromise[_0x3fb1('0x24')](_0x5e82f1);}return _0xbca2cf[_0x3fb1('0x25')]();};}function saveUpdates(_0x506805,_0x26fb67){return function(_0x2ef729){if(_0x2ef729){return _0x2ef729[_0x3fb1('0x26')](_0x506805)[_0x3fb1('0x27')](function(_0x5b16a5){return _0x5b16a5;});}return null;};}function removeEntity(_0x448515,_0x13305d){return function(_0x14c90d){if(_0x14c90d){return _0x14c90d[_0x3fb1('0x28')]()[_0x3fb1('0x27')](function(){var _0x1a6c22=_0x14c90d[_0x3fb1('0x29')]({'plain':!![]});var _0x17dbbf=_0x3fb1('0x2a');return db[_0x3fb1('0x2b')][_0x3fb1('0x28')]({'where':{'type':_0x17dbbf,'resourceId':_0x1a6c22['id']}})[_0x3fb1('0x27')](function(){return _0x14c90d;});})[_0x3fb1('0x27')](function(){_0x448515[_0x3fb1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18e3b9,_0x15a8ee){return function(_0x46b308){if(!_0x46b308){_0x18e3b9[_0x3fb1('0x20')](0x194);}return _0x46b308;};}function handleError(_0x39ce64,_0xb5af20){_0xb5af20=_0xb5af20||0x1f4;return function(_0x5c6396){logger[_0x3fb1('0x1c')](_0x5c6396['stack']);if(_0x5c6396[_0x3fb1('0x2d')]){delete _0x5c6396[_0x3fb1('0x2d')];}_0x39ce64['status'](_0xb5af20)[_0x3fb1('0x2e')](_0x5c6396);};}exports[_0x3fb1('0x2f')]=function(_0x25ef08,_0x565993){var _0x1b3f5b={},_0x35ef3f={},_0x3b10d0={'count':0x0,'rows':[]};var _0x2dfb96=db['Trunk']['rawAttributes'];_0x35ef3f['model']=_[_0x3fb1('0x30')](_0x2dfb96);_0x35ef3f['query']=_[_0x3fb1('0x30')](_0x25ef08[_0x3fb1('0x31')]);_0x35ef3f[_0x3fb1('0x32')]=_[_0x3fb1('0x33')](_0x35ef3f[_0x3fb1('0x34')],_0x35ef3f['query']);_0x1b3f5b['attributes']=_[_0x3fb1('0x33')](_0x35ef3f['model'],qs[_0x3fb1('0x35')](_0x25ef08[_0x3fb1('0x31')][_0x3fb1('0x35')]));_0x1b3f5b[_0x3fb1('0x36')]=_0x1b3f5b[_0x3fb1('0x36')][_0x3fb1('0x37')]?_0x1b3f5b[_0x3fb1('0x36')]:_0x35ef3f[_0x3fb1('0x34')];if(!_0x25ef08['query'][_0x3fb1('0x38')](_0x3fb1('0x39'))){_0x1b3f5b[_0x3fb1('0x3a')]=qs[_0x3fb1('0x3a')](_0x25ef08['query'][_0x3fb1('0x3a')]);_0x1b3f5b['offset']=qs[_0x3fb1('0x23')](_0x25ef08[_0x3fb1('0x31')][_0x3fb1('0x23')]);}_0x1b3f5b[_0x3fb1('0x3b')]=qs[_0x3fb1('0x3c')](_0x25ef08['query'][_0x3fb1('0x3c')]);_0x1b3f5b[_0x3fb1('0x3d')]=qs[_0x3fb1('0x32')](_[_0x3fb1('0x3e')](_0x25ef08[_0x3fb1('0x31')],_0x35ef3f['filters']));if(_0x25ef08[_0x3fb1('0x31')][_0x3fb1('0x3f')]){_0x1b3f5b[_0x3fb1('0x3d')]=_[_0x3fb1('0x40')](_0x1b3f5b['where'],{'$or':_[_0x3fb1('0x41')](_0x2dfb96,function(_0x41dbba){if(_0x41dbba[_0x3fb1('0x42')][_0x3fb1('0x43')]!==_0x3fb1('0x44')){var _0x5254dd={};_0x5254dd[_0x41dbba[_0x3fb1('0x45')]]={'$like':'%'+_0x25ef08[_0x3fb1('0x31')]['filter']+'%'};return _0x5254dd;}})});}_0x1b3f5b=_['merge']({},_0x1b3f5b,_0x25ef08[_0x3fb1('0x46')]);var _0x2d2f57={'where':_0x1b3f5b[_0x3fb1('0x3d')]};return db[_0x3fb1('0x47')]['count'](_0x2d2f57)[_0x3fb1('0x27')](function(_0x569d14){_0x3b10d0[_0x3fb1('0x22')]=_0x569d14;if(_0x25ef08[_0x3fb1('0x31')][_0x3fb1('0x48')]){_0x1b3f5b['include']=[{'all':!![]}];}return db[_0x3fb1('0x47')][_0x3fb1('0x49')](_0x1b3f5b);})['then'](function(_0x26eb42){_0x3b10d0[_0x3fb1('0x4a')]=_0x26eb42;return _0x3b10d0;})[_0x3fb1('0x27')](respondWithFilteredResult(_0x565993,_0x1b3f5b))[_0x3fb1('0x1f')](handleError(_0x565993,null));};exports[_0x3fb1('0x4b')]=function(_0x19dee1,_0x579bfb){var _0x972833={'raw':![],'where':{'id':_0x19dee1['params']['id']}},_0x13c867={};_0x13c867['model']=_[_0x3fb1('0x30')](db[_0x3fb1('0x47')][_0x3fb1('0x4c')]);_0x13c867[_0x3fb1('0x31')]=_[_0x3fb1('0x30')](_0x19dee1[_0x3fb1('0x31')]);_0x13c867[_0x3fb1('0x32')]=_[_0x3fb1('0x33')](_0x13c867[_0x3fb1('0x34')],_0x13c867[_0x3fb1('0x31')]);_0x972833[_0x3fb1('0x36')]=_['intersection'](_0x13c867['model'],qs['fields'](_0x19dee1[_0x3fb1('0x31')][_0x3fb1('0x35')]));_0x972833[_0x3fb1('0x36')]=_0x972833[_0x3fb1('0x36')][_0x3fb1('0x37')]?_0x972833[_0x3fb1('0x36')]:_0x13c867[_0x3fb1('0x34')];if(_0x19dee1[_0x3fb1('0x31')][_0x3fb1('0x48')]){_0x972833[_0x3fb1('0x4d')]=[{'all':!![]}];}_0x972833=_[_0x3fb1('0x40')]({},_0x972833,_0x19dee1[_0x3fb1('0x46')]);return db[_0x3fb1('0x47')][_0x3fb1('0x4e')](_0x972833)['then'](handleEntityNotFound(_0x579bfb,null))[_0x3fb1('0x27')](respondWithResult(_0x579bfb,null))[_0x3fb1('0x1f')](handleError(_0x579bfb,null));};exports[_0x3fb1('0x4f')]=function(_0x4e8a77,_0x4fc8ce){var _0x32b505={'raw':![],'where':{'id':_0x4e8a77[_0x3fb1('0x50')]['id']}},_0x483d99={};_0x483d99[_0x3fb1('0x34')]=_['keys'](db[_0x3fb1('0x47')][_0x3fb1('0x4c')]);_0x32b505[_0x3fb1('0x36')]=_[_0x3fb1('0x33')](_0x483d99[_0x3fb1('0x34')],qs[_0x3fb1('0x35')](_0x4e8a77['query']['fields']));_0x32b505[_0x3fb1('0x36')]=_0x32b505[_0x3fb1('0x36')][_0x3fb1('0x37')]?_0x32b505[_0x3fb1('0x36')]:_0x483d99[_0x3fb1('0x34')];if(_0x4e8a77[_0x3fb1('0x31')][_0x3fb1('0x48')]){_0x32b505[_0x3fb1('0x4d')]=[{'all':!![]}];}_0x32b505=_[_0x3fb1('0x40')]({},_0x32b505,_0x4e8a77[_0x3fb1('0x46')]);return db[_0x3fb1('0x47')]['find'](_0x32b505)[_0x3fb1('0x27')](handleEntityNotFound(_0x4fc8ce,null))[_0x3fb1('0x27')](function(_0x2413ba){if(_0x2413ba){var _0x5ccf5c=_0x2413ba[_0x3fb1('0x29')]({'plain':!![]});_0x5ccf5c=qs[_0x3fb1('0x51')](_0x5ccf5c,['id',_0x3fb1('0x52'),_0x3fb1('0x53')]);_0x4e8a77[_0x3fb1('0x54')]=_[_0x3fb1('0x51')](_0x4e8a77[_0x3fb1('0x54')],['id',_0x3fb1('0x52'),_0x3fb1('0x53')]);return db[_0x3fb1('0x47')][_0x3fb1('0x55')](_[_0x3fb1('0x40')](_0x5ccf5c,_0x4e8a77[_0x3fb1('0x54')]),{'include':_0x4e8a77[_0x3fb1('0x31')][_0x3fb1('0x48')]?[{'all':!![]}]:undefined})[_0x3fb1('0x27')](function(_0xa41370){var _0x546ba3=_0x4e8a77['user'][_0x3fb1('0x29')]({'plain':!![]});if(!_0x546ba3)throw new Error(_0x3fb1('0x56'));if(_0x546ba3[_0x3fb1('0x57')]===_0x3fb1('0x58')){var _0x303496=_0xa41370[_0x3fb1('0x29')]({'plain':!![]});var _0x4f8ce2='Trunks';return db[_0x3fb1('0x59')][_0x3fb1('0x4e')]({'where':{'name':_0x4f8ce2,'userProfileId':_0x546ba3[_0x3fb1('0x5a')]},'raw':!![]})[_0x3fb1('0x27')](function(_0x24aad9){if(_0x24aad9&&_0x24aad9[_0x3fb1('0x5b')]===0x0){return db[_0x3fb1('0x2b')][_0x3fb1('0x55')]({'name':_0x303496['name'],'resourceId':_0x303496['id'],'type':_0x24aad9[_0x3fb1('0x2d')],'sectionId':_0x24aad9['id']},{})['then'](function(){return _0xa41370;});}else{return _0xa41370;}})[_0x3fb1('0x1f')](function(_0x4c749c){logger[_0x3fb1('0x1c')](_0x3fb1('0x5c'),_0x4c749c);throw _0x4c749c;});}return _0xa41370;});}})[_0x3fb1('0x27')](respondWithResult(_0x4fc8ce,0xc9))[_0x3fb1('0x1f')](handleError(_0x4fc8ce,null));};exports['create']=function(_0x3d2019,_0x41a0a9,_0x19af8a){var _0x1cb8c5;return db[_0x3fb1('0x47')][_0x3fb1('0x55')](_0x3d2019['body'],{'raw':!![]})[_0x3fb1('0x27')](function(_0x5948b0){_0x1cb8c5=_0x5948b0;return db[_0x3fb1('0x47')]['findAll']({'raw':!![]});})[_0x3fb1('0x27')](function(_0x58db8c){var _0x5b77b9=fs['readFileSync'](path['join'](config[_0x3fb1('0x5d')],_0x3fb1('0x5e')),_0x3fb1('0x5f'));var _0x584ffe=fs[_0x3fb1('0x60')](path['join'](config[_0x3fb1('0x5d')],_0x3fb1('0x61')),_0x3fb1('0x5f'));var _0x3ada5a=ejs[_0x3fb1('0x62')](_0x5b77b9,{'trunks':_0x58db8c||[]});fs[_0x3fb1('0x63')](_0x3fb1('0x64'),_0x3ada5a);if(_0x1cb8c5[_0x3fb1('0x65')]){var _0x13946a=ejs[_0x3fb1('0x62')](_0x584ffe,{'trunks':_0x58db8c||[]});fs[_0x3fb1('0x63')](_0x3fb1('0x66'),_0x13946a);}})['then'](function(){return respondWithRpcPromise(_0x3fb1('0x67'),_0x3fb1('0x55'),{'module':_0x3fb1('0x68')});})[_0x3fb1('0x27')](function(){var _0x2bc57c=_0x3d2019[_0x3fb1('0x58')][_0x3fb1('0x29')]({'plain':!![]});if(!_0x2bc57c)throw new Error(_0x3fb1('0x56'));if(_0x2bc57c[_0x3fb1('0x57')]===_0x3fb1('0x58')){var _0x3fb35b=_0x1cb8c5[_0x3fb1('0x29')]({'plain':!![]});return db[_0x3fb1('0x59')]['find']({'where':{'name':_0x3fb1('0x2a'),'userProfileId':_0x2bc57c[_0x3fb1('0x5a')]},'raw':!![]})[_0x3fb1('0x27')](function(_0x567795){if(_0x567795&&_0x567795[_0x3fb1('0x5b')]===0x0){return db[_0x3fb1('0x2b')]['create']({'name':_0x3fb35b[_0x3fb1('0x2d')],'resourceId':_0x3fb35b['id'],'type':_0x567795['name'],'sectionId':_0x567795['id']},{})['then'](function(){return _0x1cb8c5;});}else{return _0x1cb8c5;}})[_0x3fb1('0x1f')](function(_0x152223){logger[_0x3fb1('0x1c')](_0x3fb1('0x5c'),_0x152223);throw _0x152223;});}return _0x1cb8c5;})[_0x3fb1('0x27')](respondWithResult(_0x41a0a9,0xc9))[_0x3fb1('0x1f')](handleError(_0x41a0a9,null));};exports[_0x3fb1('0x26')]=function(_0x496e31,_0x42a568,_0x1af9b9){var _0x5b26fa;return db[_0x3fb1('0x47')][_0x3fb1('0x4e')]({'where':{'id':_0x496e31[_0x3fb1('0x50')]['id']}})[_0x3fb1('0x27')](handleEntityNotFound(_0x42a568,null))[_0x3fb1('0x27')](saveUpdates(_0x496e31[_0x3fb1('0x54')],null))[_0x3fb1('0x27')](function(_0x4908c1){if(_0x4908c1){_0x5b26fa=_0x4908c1;return db[_0x3fb1('0x47')][_0x3fb1('0x49')]({'raw':!![]});}})[_0x3fb1('0x27')](function(_0x3df752){if(_0x3df752){var _0x2d72d9=fs[_0x3fb1('0x60')](path['join'](config[_0x3fb1('0x5d')],'server/files/templates/trunk.ejs'),_0x3fb1('0x5f'));var _0x5e5f0d=fs[_0x3fb1('0x60')](path[_0x3fb1('0x69')](config[_0x3fb1('0x5d')],_0x3fb1('0x61')),'utf8');var _0x4c8853=ejs[_0x3fb1('0x62')](_0x2d72d9,{'trunks':_0x3df752||[]});fs[_0x3fb1('0x63')](_0x3fb1('0x64'),_0x4c8853);var _0x320545=ejs[_0x3fb1('0x62')](_0x5e5f0d,{'trunks':_0x3df752||[]});fs[_0x3fb1('0x63')](_0x3fb1('0x66'),_0x320545);return respondWithRpcPromise(_0x3fb1('0x67'),_0x3fb1('0x26'),{'module':_0x3fb1('0x68')});}return null;})['then'](function(_0x183457){if(_0x183457){return _0x5b26fa;}})[_0x3fb1('0x27')](respondWithResult(_0x42a568,null))[_0x3fb1('0x1f')](handleError(_0x42a568,null));};exports['destroy']=function(_0x4273f8,_0x49453e,_0x47fe11){var _0x3ca183;return db[_0x3fb1('0x47')][_0x3fb1('0x4e')]({'where':{'id':_0x4273f8[_0x3fb1('0x50')]['id']}})[_0x3fb1('0x27')](handleEntityNotFound(_0x49453e,null))['then'](removeEntity(_0x49453e,null))[_0x3fb1('0x27')](function(){return db[_0x3fb1('0x47')]['findAll']({'raw':!![]});})['then'](function(_0x236603){var _0x579c65=fs[_0x3fb1('0x60')](path[_0x3fb1('0x69')](config['root'],_0x3fb1('0x5e')),_0x3fb1('0x5f'));var _0x77e6c9=fs[_0x3fb1('0x60')](path[_0x3fb1('0x69')](config[_0x3fb1('0x5d')],'server/files/templates/registry.ejs'),_0x3fb1('0x5f'));var _0x2372ab=ejs[_0x3fb1('0x62')](_0x579c65,{'trunks':_0x236603});var _0x281949=ejs[_0x3fb1('0x62')](_0x77e6c9,{'trunks':_0x236603});fs[_0x3fb1('0x63')](_0x3fb1('0x64'),_0x2372ab);fs['writeFileSync'](_0x3fb1('0x66'),_0x281949);return respondWithRpcPromise(_0x3fb1('0x67'),_0x3fb1('0x28'),{'module':_0x3fb1('0x68')});})[_0x3fb1('0x1f')](handleError(_0x49453e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 23c3094..c4ca959 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 _0xa7d3=['api','request-promise','exports','define','tools_trunks','lodash','../../config/logger'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0xa7d3,0x1e1));var _0x3a7d=function(_0x1b2b02,_0x3e3c49){_0x1b2b02=_0x1b2b02-0x0;var _0x173b44=_0xa7d3[_0x1b2b02];return _0x173b44;};'use strict';var _=require(_0x3a7d('0x0'));var util=require('util');var logger=require(_0x3a7d('0x1'))(_0x3a7d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a7d('0x3'));var attributes=require('./trunk.attributes');module[_0x3a7d('0x4')]=function(_0x18b637,_0x48a5d2){return _0x18b637[_0x3a7d('0x5')]('Trunk',attributes,{'tableName':_0x3a7d('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e73=['moment','bluebird','request-promise','./trunk.attributes','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x1c1561,_0xdba12f){var _0x1f4460=function(_0x500347){while(--_0x500347){_0x1c1561['push'](_0x1c1561['shift']());}};_0x1f4460(++_0xdba12f);}(_0x4e73,0x15c));var _0x34e7=function(_0xaca591,_0x5f31b5){_0xaca591=_0xaca591-0x0;var _0x51916f=_0x4e73[_0xaca591];return _0x51916f;};'use strict';var _=require(_0x34e7('0x0'));var util=require(_0x34e7('0x1'));var logger=require(_0x34e7('0x2'))(_0x34e7('0x3'));var moment=require(_0x34e7('0x4'));var BPromise=require(_0x34e7('0x5'));var rp=require(_0x34e7('0x6'));var attributes=require(_0x34e7('0x7'));module['exports']=function(_0x54931d,_0x1091fa){return _0x54931d[_0x34e7('0x8')](_0x34e7('0x9'),attributes,{'tableName':_0x34e7('0xa'),'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 a70c251..5d88ee8 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 _0x8733=['catch','Trunk','options','raw','attributes','limit','include','map','model','GetTrunk','ShowTrunk','find','where','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8733,0xb8));var _0x3873=function(_0x5b136c,_0xa358f5){_0x5b136c=_0x5b136c-0x0;var _0x329e1f=_0x8733[_0x5b136c];return _0x329e1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3873('0x0'));var BPromise=require(_0x3873('0x1'));var rs=require(_0x3873('0x2'));var fs=require('fs');var Redis=require(_0x3873('0x3'));var db=require(_0x3873('0x4'))['db'];var utils=require(_0x3873('0x5'));var logger=require('../../config/logger')(_0x3873('0x6'));var config=require('../../config/environment');var jayson=require(_0x3873('0x7'));var client=jayson[_0x3873('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d18b4,_0x383a54,_0x3f0433){return new BPromise(function(_0x42327d,_0xa38fad){return client[_0x3873('0x9')](_0x2d18b4,_0x3f0433)['then'](function(_0x578a02){logger[_0x3873('0xa')]('Trunk,\x20%s,\x20%s',_0x383a54,'request\x20sent');logger[_0x3873('0xb')](_0x3873('0xc'),_0x383a54,_0x3873('0xd'),JSON[_0x3873('0xe')](_0x578a02));if(_0x578a02[_0x3873('0xf')]){if(_0x578a02[_0x3873('0xf')][_0x3873('0x10')]===0x1f4){logger[_0x3873('0xf')](_0x3873('0x11'),_0x383a54,_0x578a02[_0x3873('0xf')][_0x3873('0x12')]);return _0xa38fad(_0x578a02[_0x3873('0xf')][_0x3873('0x12')]);}logger[_0x3873('0xf')]('Trunk,\x20%s,\x20%s',_0x383a54,_0x578a02[_0x3873('0xf')]['message']);return _0x42327d(_0x578a02[_0x3873('0xf')][_0x3873('0x12')]);}else{logger[_0x3873('0xa')]('Trunk,\x20%s,\x20%s',_0x383a54,_0x3873('0xd'));_0x42327d(_0x578a02[_0x3873('0x13')][_0x3873('0x12')]);}})[_0x3873('0x14')](function(_0x3a04e4){logger[_0x3873('0xf')](_0x3873('0x11'),_0x383a54,_0x3a04e4);_0xa38fad(_0x3a04e4);});});}exports['GetTrunk']=function(_0x2488a1){var _0x599e1e=this;return new Promise(function(_0x1b939e,_0x51b031){return db[_0x3873('0x15')]['findAll']({'raw':_0x2488a1[_0x3873('0x16')]?_0x2488a1['options'][_0x3873('0x17')]===undefined?!![]:![]:!![],'where':_0x2488a1['options']?_0x2488a1[_0x3873('0x16')]['where']||null:null,'attributes':_0x2488a1['options']?_0x2488a1[_0x3873('0x16')][_0x3873('0x18')]||null:null,'limit':_0x2488a1['options']?_0x2488a1[_0x3873('0x16')][_0x3873('0x19')]||null:null,'include':_0x2488a1['options']?_0x2488a1[_0x3873('0x16')][_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x2488a1[_0x3873('0x16')][_0x3873('0x1a')],function(_0x1a92cd){return{'model':db[_0x1a92cd[_0x3873('0x1c')]],'as':_0x1a92cd['as'],'attributes':_0x1a92cd[_0x3873('0x18')],'include':_0x1a92cd[_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x1a92cd[_0x3873('0x1a')],function(_0x2e6446){return{'model':db[_0x2e6446[_0x3873('0x1c')]],'as':_0x2e6446['as'],'attributes':_0x2e6446[_0x3873('0x18')],'include':_0x2e6446[_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x2e6446[_0x3873('0x1a')],function(_0x5a473b){return{'model':db[_0x5a473b[_0x3873('0x1c')]],'as':_0x5a473b['as'],'attributes':_0x5a473b[_0x3873('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdbca1f){logger['info'](_0x3873('0x1d'),_0x2488a1);logger[_0x3873('0xb')](_0x3873('0x1d'),_0x2488a1,JSON[_0x3873('0xe')](_0xdbca1f));_0x1b939e(_0xdbca1f);})[_0x3873('0x14')](function(_0x24f3bb){logger[_0x3873('0xf')](_0x3873('0x1d'),_0x24f3bb['message'],_0x2488a1);_0x51b031(_0x599e1e['error'](0x1f4,_0x24f3bb[_0x3873('0x12')]));});});};exports[_0x3873('0x1e')]=function(_0x52f0ca){var _0x4a0b58=this;return new Promise(function(_0x589592,_0x9078f9){return db[_0x3873('0x15')][_0x3873('0x1f')]({'raw':_0x52f0ca[_0x3873('0x16')]?_0x52f0ca[_0x3873('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x52f0ca[_0x3873('0x16')]?_0x52f0ca[_0x3873('0x16')][_0x3873('0x20')]||null:null,'attributes':_0x52f0ca[_0x3873('0x16')]?_0x52f0ca['options']['attributes']||null:null,'include':_0x52f0ca[_0x3873('0x16')]?_0x52f0ca[_0x3873('0x16')][_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x52f0ca[_0x3873('0x16')][_0x3873('0x1a')],function(_0x23f1a9){return{'model':db[_0x23f1a9[_0x3873('0x1c')]],'as':_0x23f1a9['as'],'attributes':_0x23f1a9[_0x3873('0x18')],'include':_0x23f1a9[_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x23f1a9[_0x3873('0x1a')],function(_0x5857fd){return{'model':db[_0x5857fd[_0x3873('0x1c')]],'as':_0x5857fd['as'],'attributes':_0x5857fd['attributes'],'include':_0x5857fd[_0x3873('0x1a')]?_[_0x3873('0x1b')](_0x5857fd[_0x3873('0x1a')],function(_0x1fa428){return{'model':db[_0x1fa428[_0x3873('0x1c')]],'as':_0x1fa428['as'],'attributes':_0x1fa428['attributes']};}):[]};}):[]};}):[]:[]})[_0x3873('0x21')](function(_0x49d834){logger[_0x3873('0xa')](_0x3873('0x1e'),_0x52f0ca);logger[_0x3873('0xb')](_0x3873('0x1e'),_0x52f0ca,JSON[_0x3873('0xe')](_0x49d834));_0x589592(_0x49d834);})[_0x3873('0x14')](function(_0x1fb8ed){logger['error'](_0x3873('0x1e'),_0x1fb8ed['message'],_0x52f0ca);_0x9078f9(_0x4a0b58[_0x3873('0xf')](0x1f4,_0x1fb8ed[_0x3873('0x12')]));});});}; \ No newline at end of file +var _0x2342=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetTrunk','Trunk','options','raw','where','attributes','include','map','model','ShowTrunk','find','lodash','util','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2342,0xe3));var _0x2234=function(_0x51e724,_0x11a2da){_0x51e724=_0x51e724-0x0;var _0x49d576=_0x2342[_0x51e724];return _0x49d576;};'use strict';var _=require(_0x2234('0x0'));var util=require(_0x2234('0x1'));var moment=require('moment');var BPromise=require(_0x2234('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2234('0x3'));var db=require(_0x2234('0x4'))['db'];var utils=require(_0x2234('0x5'));var logger=require(_0x2234('0x6'))(_0x2234('0x7'));var config=require(_0x2234('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2234('0x9')][_0x2234('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f4ef2,_0x2ef68b,_0x59911f){return new BPromise(function(_0x3d562a,_0x17c4bb){return client[_0x2234('0xb')](_0x3f4ef2,_0x59911f)[_0x2234('0xc')](function(_0x3d5f8b){logger[_0x2234('0xd')](_0x2234('0xe'),_0x2ef68b,'request\x20sent');logger[_0x2234('0xf')](_0x2234('0x10'),_0x2ef68b,_0x2234('0x11'),JSON[_0x2234('0x12')](_0x3d5f8b));if(_0x3d5f8b[_0x2234('0x13')]){if(_0x3d5f8b[_0x2234('0x13')]['code']===0x1f4){logger[_0x2234('0x13')](_0x2234('0xe'),_0x2ef68b,_0x3d5f8b[_0x2234('0x13')][_0x2234('0x14')]);return _0x17c4bb(_0x3d5f8b[_0x2234('0x13')][_0x2234('0x14')]);}logger[_0x2234('0x13')](_0x2234('0xe'),_0x2ef68b,_0x3d5f8b[_0x2234('0x13')][_0x2234('0x14')]);return _0x3d562a(_0x3d5f8b[_0x2234('0x13')][_0x2234('0x14')]);}else{logger[_0x2234('0xd')]('Trunk,\x20%s,\x20%s',_0x2ef68b,_0x2234('0x11'));_0x3d562a(_0x3d5f8b['result'][_0x2234('0x14')]);}})[_0x2234('0x15')](function(_0x310eae){logger[_0x2234('0x13')](_0x2234('0xe'),_0x2ef68b,_0x310eae);_0x17c4bb(_0x310eae);});});}exports[_0x2234('0x16')]=function(_0x3d610d){var _0x3d9cb9=this;return new Promise(function(_0x2f0234,_0xa1ea29){return db[_0x2234('0x17')]['findAll']({'raw':_0x3d610d[_0x2234('0x18')]?_0x3d610d[_0x2234('0x18')][_0x2234('0x19')]===undefined?!![]:![]:!![],'where':_0x3d610d['options']?_0x3d610d[_0x2234('0x18')][_0x2234('0x1a')]||null:null,'attributes':_0x3d610d[_0x2234('0x18')]?_0x3d610d['options'][_0x2234('0x1b')]||null:null,'limit':_0x3d610d['options']?_0x3d610d[_0x2234('0x18')]['limit']||null:null,'include':_0x3d610d[_0x2234('0x18')]?_0x3d610d[_0x2234('0x18')][_0x2234('0x1c')]?_[_0x2234('0x1d')](_0x3d610d[_0x2234('0x18')]['include'],function(_0x508e66){return{'model':db[_0x508e66['model']],'as':_0x508e66['as'],'attributes':_0x508e66[_0x2234('0x1b')],'include':_0x508e66[_0x2234('0x1c')]?_[_0x2234('0x1d')](_0x508e66[_0x2234('0x1c')],function(_0x17933f){return{'model':db[_0x17933f[_0x2234('0x1e')]],'as':_0x17933f['as'],'attributes':_0x17933f[_0x2234('0x1b')],'include':_0x17933f[_0x2234('0x1c')]?_[_0x2234('0x1d')](_0x17933f[_0x2234('0x1c')],function(_0x36f607){return{'model':db[_0x36f607[_0x2234('0x1e')]],'as':_0x36f607['as'],'attributes':_0x36f607[_0x2234('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2234('0xc')](function(_0x4f0ed6){logger[_0x2234('0xd')](_0x2234('0x16'),_0x3d610d);logger[_0x2234('0xf')](_0x2234('0x16'),_0x3d610d,JSON['stringify'](_0x4f0ed6));_0x2f0234(_0x4f0ed6);})[_0x2234('0x15')](function(_0x1dc0d6){logger['error'](_0x2234('0x16'),_0x1dc0d6[_0x2234('0x14')],_0x3d610d);_0xa1ea29(_0x3d9cb9[_0x2234('0x13')](0x1f4,_0x1dc0d6[_0x2234('0x14')]));});});};exports[_0x2234('0x1f')]=function(_0x34bb74){var _0x1880d1=this;return new Promise(function(_0x377e3a,_0x21830c){return db['Trunk'][_0x2234('0x20')]({'raw':_0x34bb74[_0x2234('0x18')]?_0x34bb74[_0x2234('0x18')][_0x2234('0x19')]===undefined?!![]:![]:!![],'where':_0x34bb74[_0x2234('0x18')]?_0x34bb74['options'][_0x2234('0x1a')]||null:null,'attributes':_0x34bb74['options']?_0x34bb74[_0x2234('0x18')]['attributes']||null:null,'include':_0x34bb74['options']?_0x34bb74['options'][_0x2234('0x1c')]?_[_0x2234('0x1d')](_0x34bb74[_0x2234('0x18')][_0x2234('0x1c')],function(_0x35ba07){return{'model':db[_0x35ba07[_0x2234('0x1e')]],'as':_0x35ba07['as'],'attributes':_0x35ba07[_0x2234('0x1b')],'include':_0x35ba07[_0x2234('0x1c')]?_[_0x2234('0x1d')](_0x35ba07[_0x2234('0x1c')],function(_0x255092){return{'model':db[_0x255092['model']],'as':_0x255092['as'],'attributes':_0x255092[_0x2234('0x1b')],'include':_0x255092[_0x2234('0x1c')]?_['map'](_0x255092[_0x2234('0x1c')],function(_0x3956c3){return{'model':db[_0x3956c3[_0x2234('0x1e')]],'as':_0x3956c3['as'],'attributes':_0x3956c3[_0x2234('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2234('0xc')](function(_0x57dcc1){logger['info'](_0x2234('0x1f'),_0x34bb74);logger[_0x2234('0xf')](_0x2234('0x1f'),_0x34bb74,JSON[_0x2234('0x12')](_0x57dcc1));_0x377e3a(_0x57dcc1);})[_0x2234('0x15')](function(_0x4ea32f){logger['error'](_0x2234('0x1f'),_0x4ea32f[_0x2234('0x14')],_0x34bb74);_0x21830c(_0x1880d1['error'](0x1f4,_0x4ea32f[_0x2234('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 7cba2cd..90b4189 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 _0xd98b=['getLists','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','/create_many','/:id/contacts','addContacts','post','create','/:id/queues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','put','/:id','update','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','describe','show','/:id/avatar','getAvatar','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists'];(function(_0x281849,_0x158a84){var _0x2bb083=function(_0x24fc82){while(--_0x24fc82){_0x281849['push'](_0x281849['shift']());}};_0x2bb083(++_0x158a84);}(_0xd98b,0xfe));var _0xbd98=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xd98b[_0x4f5108];return _0x2d56ca;};'use strict';var multer=require(_0xbd98('0x0'));var util=require(_0xbd98('0x1'));var path=require('path');var timeout=require(_0xbd98('0x2'));var express=require(_0xbd98('0x3'));var router=express[_0xbd98('0x4')]();var auth=require(_0xbd98('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd98('0x6'));var controller=require('./user.controller');router['get']('/',auth[_0xbd98('0x7')](),controller['index']);router[_0xbd98('0x8')]('/describe',auth[_0xbd98('0x7')](),controller[_0xbd98('0x9')]);router[_0xbd98('0x8')]('/:id',auth[_0xbd98('0x7')](),controller[_0xbd98('0xa')]);router['get'](_0xbd98('0xb'),controller[_0xbd98('0xc')]);router['get']('/:id/contacts',auth[_0xbd98('0x7')](),controller['getContacts']);router[_0xbd98('0x8')]('/:id/queues',auth[_0xbd98('0x7')](),controller[_0xbd98('0xd')]);router[_0xbd98('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0xbd98('0xe')]);router[_0xbd98('0x8')](_0xbd98('0xf'),auth['isAuthenticated'](),controller[_0xbd98('0x10')]);router['get'](_0xbd98('0x11'),auth['isAuthenticated'](),controller['getRecordings']);router[_0xbd98('0x8')]('/:id/chat/interactions',auth[_0xbd98('0x7')](),controller[_0xbd98('0x12')]);router[_0xbd98('0x8')]('/:id/openchannel/interactions',auth[_0xbd98('0x7')](),controller[_0xbd98('0x13')]);router['get'](_0xbd98('0x14'),auth[_0xbd98('0x7')](),controller['getMailInteractions']);router['get'](_0xbd98('0x15'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x16')]);router[_0xbd98('0x8')](_0xbd98('0x17'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x18')]);router[_0xbd98('0x8')](_0xbd98('0x19'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x1a')]);router[_0xbd98('0x8')](_0xbd98('0x1b'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x1c')]);router['get']('/:id/agents',auth[_0xbd98('0x7')](),controller['getAgents']);router['get'](_0xbd98('0x1d'),auth[_0xbd98('0x7')](),controller['getVoicePrefixes']);router[_0xbd98('0x8')](_0xbd98('0x1e'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x1f')]);router[_0xbd98('0x8')](_0xbd98('0x20'),auth[_0xbd98('0x7')](),controller['getMailAccounts']);router[_0xbd98('0x8')](_0xbd98('0x21'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x22')]);router['get'](_0xbd98('0x23'),auth['isAuthenticated'](),controller[_0xbd98('0x24')]);router[_0xbd98('0x8')](_0xbd98('0x25'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x26')]);router[_0xbd98('0x8')](_0xbd98('0x27'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x28')]);router[_0xbd98('0x8')]('/:id/scheduled_calls',auth[_0xbd98('0x7')](),controller[_0xbd98('0x29')]);router[_0xbd98('0x8')](_0xbd98('0x2a'),auth[_0xbd98('0x7')](),controller['getApiKey']);router['post'](_0xbd98('0x2b'),auth[_0xbd98('0x7')](),controller['bulkCreate']);router['post'](_0xbd98('0x2c'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x2d')]);router[_0xbd98('0x2e')]('/',auth['isAuthenticated'](),controller[_0xbd98('0x2f')]);router[_0xbd98('0x2e')](_0xbd98('0x30'),auth[_0xbd98('0x7')](),controller['addQueues']);var upload=multer({'storage':multer[_0xbd98('0x31')]({'destination':function(_0x4cbbfe,_0x3ecfe9,_0x51a4f8){_0x51a4f8(null,path[_0xbd98('0x32')](config[_0xbd98('0x33')],_0xbd98('0x34')));},'filename':function(_0x38feda,_0x53a6f0,_0x8b5531){_0x8b5531(null,util[_0xbd98('0x35')](_0xbd98('0x36'),Date[_0xbd98('0x37')](),_0x53a6f0[_0xbd98('0x38')]));}})});router[_0xbd98('0x2e')](_0xbd98('0xb'),upload['single'](_0xbd98('0x39')),controller[_0xbd98('0x3a')]);router[_0xbd98('0x2e')]('/:id/login',auth[_0xbd98('0x7')](),controller[_0xbd98('0x3b')]);router[_0xbd98('0x2e')](_0xbd98('0x3c'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x3d')]);router[_0xbd98('0x2e')](_0xbd98('0x3e'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x3f')]);router[_0xbd98('0x2e')](_0xbd98('0x40'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x41')]);router[_0xbd98('0x2e')](_0xbd98('0x19'),auth[_0xbd98('0x7')](),controller['addTeams']);router[_0xbd98('0x2e')]('/:id/chat_interactions',auth[_0xbd98('0x7')](),controller['addChatInteractions']);router['post'](_0xbd98('0x42'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x43')]);router[_0xbd98('0x2e')](_0xbd98('0x44'),auth[_0xbd98('0x7')](),controller['addFaxInteractions']);router[_0xbd98('0x2e')](_0xbd98('0x45'),auth[_0xbd98('0x7')](),controller['addSmsInteractions']);router[_0xbd98('0x2e')](_0xbd98('0x46'),auth[_0xbd98('0x7')](),controller['addOpenchannelInteractions']);router[_0xbd98('0x2e')]('/:id/fax_accounts',auth[_0xbd98('0x7')](),controller[_0xbd98('0x47')]);router['post']('/:id/mail_accounts',auth[_0xbd98('0x7')](),controller[_0xbd98('0x48')]);router[_0xbd98('0x2e')](_0xbd98('0x21'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x49')]);router['post'](_0xbd98('0x23'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x4a')]);router[_0xbd98('0x2e')](_0xbd98('0x25'),auth[_0xbd98('0x7')](),controller['addChatWebsites']);router[_0xbd98('0x2e')](_0xbd98('0x27'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x4b')]);router['post']('/:id/api_key',auth[_0xbd98('0x7')](),controller['createApiKey']);router[_0xbd98('0x4c')](_0xbd98('0x4d'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x4e')]);router[_0xbd98('0x4c')](_0xbd98('0x4f'),auth['isAuthenticated'](),controller[_0xbd98('0x50')]);router[_0xbd98('0x51')](_0xbd98('0x30'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xbd98('0x51')]('/:id/teams',auth['isAuthenticated'](),controller[_0xbd98('0x52')]);router[_0xbd98('0x51')]('/:id',auth[_0xbd98('0x7')](),controller[_0xbd98('0x53')]);router[_0xbd98('0x51')](_0xbd98('0x54'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x55')]);router[_0xbd98('0x51')](_0xbd98('0x42'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x56')]);router[_0xbd98('0x51')](_0xbd98('0x44'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x57')]);router['delete'](_0xbd98('0x45'),auth[_0xbd98('0x7')](),controller['removeSmsInteractions']);router[_0xbd98('0x51')](_0xbd98('0x46'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x58')]);router[_0xbd98('0x51')](_0xbd98('0x1e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xbd98('0x51')]('/:id/mail_accounts',auth[_0xbd98('0x7')](),controller[_0xbd98('0x59')]);router[_0xbd98('0x51')]('/:id/openchannel_accounts',auth[_0xbd98('0x7')](),controller['removeOpenchannelAccounts']);router['delete'](_0xbd98('0x23'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x5a')]);router[_0xbd98('0x51')](_0xbd98('0x25'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x5b')]);router[_0xbd98('0x51')](_0xbd98('0x27'),auth[_0xbd98('0x7')](),controller['removeSquareProjects']);router[_0xbd98('0x51')](_0xbd98('0x2a'),auth[_0xbd98('0x7')](),controller[_0xbd98('0x5c')]);module[_0xbd98('0x5d')]=router; \ No newline at end of file +var _0x8875=['create','addQueues','diskStorage','root','server/files/images/','now','single','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/square_projects','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','/:id/queues_rt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getSquareProjects','getScheduledCalls','getApiKey','/create_many','post'];(function(_0x348091,_0x5839db){var _0x290934=function(_0x38b875){while(--_0x38b875){_0x348091['push'](_0x348091['shift']());}};_0x290934(++_0x5839db);}(_0x8875,0x9a));var _0x5887=function(_0x422e50,_0x225a37){_0x422e50=_0x422e50-0x0;var _0x1fcd12=_0x8875[_0x422e50];return _0x1fcd12;};'use strict';var multer=require('multer');var util=require(_0x5887('0x0'));var path=require('path');var timeout=require(_0x5887('0x1'));var express=require(_0x5887('0x2'));var router=express[_0x5887('0x3')]();var auth=require(_0x5887('0x4'));var interaction=require(_0x5887('0x5'));var config=require(_0x5887('0x6'));var controller=require('./user.controller');router[_0x5887('0x7')]('/',auth[_0x5887('0x8')](),controller[_0x5887('0x9')]);router[_0x5887('0x7')](_0x5887('0xa'),auth[_0x5887('0x8')](),controller[_0x5887('0xb')]);router['get']('/:id',auth[_0x5887('0x8')](),controller[_0x5887('0xc')]);router[_0x5887('0x7')](_0x5887('0xd'),controller[_0x5887('0xe')]);router['get'](_0x5887('0xf'),auth[_0x5887('0x8')](),controller['getContacts']);router[_0x5887('0x7')](_0x5887('0x10'),auth[_0x5887('0x8')](),controller['getQueues']);router[_0x5887('0x7')](_0x5887('0x11'),auth[_0x5887('0x8')](),controller['getVoiceQueuesRt']);router[_0x5887('0x7')]('/:id/groups',auth[_0x5887('0x8')](),controller[_0x5887('0x12')]);router[_0x5887('0x7')](_0x5887('0x13'),auth[_0x5887('0x8')](),controller[_0x5887('0x14')]);router[_0x5887('0x7')](_0x5887('0x15'),auth[_0x5887('0x8')](),controller[_0x5887('0x16')]);router[_0x5887('0x7')](_0x5887('0x17'),auth['isAuthenticated'](),controller[_0x5887('0x18')]);router['get']('/:id/mail/interactions',auth[_0x5887('0x8')](),controller[_0x5887('0x19')]);router[_0x5887('0x7')](_0x5887('0x1a'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x5887('0x7')](_0x5887('0x1b'),auth[_0x5887('0x8')](),controller[_0x5887('0x1c')]);router[_0x5887('0x7')](_0x5887('0x1d'),auth['isAuthenticated'](),controller[_0x5887('0x1e')]);router[_0x5887('0x7')](_0x5887('0x1f'),auth[_0x5887('0x8')](),controller[_0x5887('0x20')]);router[_0x5887('0x7')](_0x5887('0x21'),auth[_0x5887('0x8')](),controller[_0x5887('0x22')]);router[_0x5887('0x7')](_0x5887('0x23'),auth[_0x5887('0x8')](),controller['getVoicePrefixes']);router['get'](_0x5887('0x24'),auth[_0x5887('0x8')](),controller[_0x5887('0x25')]);router[_0x5887('0x7')](_0x5887('0x26'),auth['isAuthenticated'](),controller[_0x5887('0x27')]);router[_0x5887('0x7')](_0x5887('0x28'),auth[_0x5887('0x8')](),controller['getOpenchannelAccounts']);router[_0x5887('0x7')]('/:id/sms_accounts',auth[_0x5887('0x8')](),controller[_0x5887('0x29')]);router[_0x5887('0x7')](_0x5887('0x2a'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x5887('0x7')]('/:id/square_projects',auth[_0x5887('0x8')](),controller[_0x5887('0x2b')]);router[_0x5887('0x7')]('/:id/scheduled_calls',auth[_0x5887('0x8')](),controller[_0x5887('0x2c')]);router['get']('/:id/api_key',auth[_0x5887('0x8')](),controller[_0x5887('0x2d')]);router['post'](_0x5887('0x2e'),auth[_0x5887('0x8')](),controller['bulkCreate']);router[_0x5887('0x2f')](_0x5887('0xf'),auth[_0x5887('0x8')](),controller['addContacts']);router[_0x5887('0x2f')]('/',auth[_0x5887('0x8')](),controller[_0x5887('0x30')]);router[_0x5887('0x2f')](_0x5887('0x10'),auth['isAuthenticated'](),controller[_0x5887('0x31')]);var upload=multer({'storage':multer[_0x5887('0x32')]({'destination':function(_0x1aaced,_0x4d4ca8,_0x1e073d){_0x1e073d(null,path['join'](config[_0x5887('0x33')],_0x5887('0x34')));},'filename':function(_0x3b8228,_0x2d75ce,_0x350e6b){_0x350e6b(null,util['format']('%s-%s',Date[_0x5887('0x35')](),_0x2d75ce['originalname']));}})});router['post'](_0x5887('0xd'),upload[_0x5887('0x36')](_0x5887('0x37')),controller[_0x5887('0x38')]);router[_0x5887('0x2f')]('/:id/login',auth[_0x5887('0x8')](),controller[_0x5887('0x39')]);router[_0x5887('0x2f')](_0x5887('0x3a'),auth[_0x5887('0x8')](),controller[_0x5887('0x3b')]);router[_0x5887('0x2f')]('/:id/pause',auth[_0x5887('0x8')](),controller[_0x5887('0x3c')]);router['post'](_0x5887('0x3d'),auth[_0x5887('0x8')](),controller[_0x5887('0x3e')]);router[_0x5887('0x2f')](_0x5887('0x1d'),auth[_0x5887('0x8')](),controller['addTeams']);router[_0x5887('0x2f')]('/:id/chat_interactions',auth[_0x5887('0x8')](),controller[_0x5887('0x3f')]);router['post'](_0x5887('0x40'),auth[_0x5887('0x8')](),controller[_0x5887('0x41')]);router[_0x5887('0x2f')](_0x5887('0x42'),auth['isAuthenticated'](),controller[_0x5887('0x43')]);router[_0x5887('0x2f')]('/:id/sms_interactions',auth[_0x5887('0x8')](),controller[_0x5887('0x44')]);router['post']('/:id/openchannel_interactions',auth[_0x5887('0x8')](),controller[_0x5887('0x45')]);router[_0x5887('0x2f')](_0x5887('0x24'),auth[_0x5887('0x8')](),controller['addFaxAccounts']);router[_0x5887('0x2f')](_0x5887('0x26'),auth[_0x5887('0x8')](),controller[_0x5887('0x46')]);router['post'](_0x5887('0x28'),auth[_0x5887('0x8')](),controller[_0x5887('0x47')]);router[_0x5887('0x2f')](_0x5887('0x48'),auth['isAuthenticated'](),controller[_0x5887('0x49')]);router[_0x5887('0x2f')]('/:id/chat_websites',auth[_0x5887('0x8')](),controller[_0x5887('0x4a')]);router[_0x5887('0x2f')](_0x5887('0x4b'),auth[_0x5887('0x8')](),controller[_0x5887('0x4c')]);router[_0x5887('0x2f')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x5887('0x4d')]);router[_0x5887('0x4e')]('/:id',auth['isAuthenticated'](),controller[_0x5887('0x4f')]);router[_0x5887('0x4e')](_0x5887('0x50'),auth[_0x5887('0x8')](),controller[_0x5887('0x51')]);router[_0x5887('0x52')](_0x5887('0x10'),auth['isAuthenticated'](),controller[_0x5887('0x53')]);router[_0x5887('0x52')](_0x5887('0x1d'),auth[_0x5887('0x8')](),controller[_0x5887('0x54')]);router[_0x5887('0x52')](_0x5887('0x55'),auth[_0x5887('0x8')](),controller[_0x5887('0x56')]);router[_0x5887('0x52')](_0x5887('0x57'),auth['isAuthenticated'](),controller[_0x5887('0x58')]);router[_0x5887('0x52')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5887('0x59')]);router[_0x5887('0x52')](_0x5887('0x42'),auth[_0x5887('0x8')](),controller[_0x5887('0x5a')]);router['delete'](_0x5887('0x5b'),auth[_0x5887('0x8')](),controller[_0x5887('0x5c')]);router[_0x5887('0x52')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x5887('0x5d')]);router[_0x5887('0x52')](_0x5887('0x24'),auth[_0x5887('0x8')](),controller[_0x5887('0x5e')]);router['delete'](_0x5887('0x26'),auth[_0x5887('0x8')](),controller[_0x5887('0x5f')]);router[_0x5887('0x52')](_0x5887('0x28'),auth[_0x5887('0x8')](),controller[_0x5887('0x60')]);router[_0x5887('0x52')]('/:id/sms_accounts',auth[_0x5887('0x8')](),controller['removeSmsAccounts']);router[_0x5887('0x52')]('/:id/chat_websites',auth[_0x5887('0x8')](),controller[_0x5887('0x61')]);router['delete'](_0x5887('0x4b'),auth[_0x5887('0x8')](),controller[_0x5887('0x62')]);router[_0x5887('0x52')]('/:id/api_key',auth[_0x5887('0x8')](),controller[_0x5887('0x63')]);module[_0x5887('0x64')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2fcaca9..64bd9b4 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 _0x073c=['sequelize','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','admin','agent','telephone','local','INTEGER','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','update,nonat','showWebBar','get','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','wss','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map'];(function(_0x34fee6,_0x78f516){var _0x4a2097=function(_0xb743fa){while(--_0xb743fa){_0x34fee6['push'](_0x34fee6['shift']());}};_0x4a2097(++_0x78f516);}(_0x073c,0x190));var _0xc073=function(_0x5efb24,_0x51238b){_0x5efb24=_0x5efb24-0x0;var _0x49a546=_0x073c[_0x5efb24];return _0x49a546;};'use strict';var Sequelize=require(_0xc073('0x0'));var moment=require('moment');var util=require('util');var _=require(_0xc073('0x1'));module['exports']={'name':{'type':Sequelize[_0xc073('0x2')],'allowNull':![],'unique':_0xc073('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x41f86b){this['setDataValue'](_0xc073('0x3'),_0x41f86b);this[_0xc073('0x4')](_0xc073('0x5'),_0x41f86b);},'comment':_0xc073('0x6')},'fullname':{'type':Sequelize[_0xc073('0x2')],'allowNull':![],'set':function(_0x35986e){this[_0xc073('0x4')](_0xc073('0x7'),_0x35986e);this['setDataValue'](_0xc073('0x8'),util[_0xc073('0x9')]('\x22%s\x22\x20<%s>',_0x35986e,this[_0xc073('0xa')](_0xc073('0xb'))));}},'alias':{'type':Sequelize[_0xc073('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc073('0xc'),'validate':{'isEmail':!![]},'set':function(_0x489550){if(_0x489550){this[_0xc073('0x4')](_0xc073('0xc'),_0x489550[_0xc073('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0xc073('0xe'),'user',_0xc073('0xf'),_0xc073('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xc073('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xc073('0x11')},'internal':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':![],'unique':_0xc073('0xb'),'set':function(_0xcd9ca3){this['setDataValue'](_0xc073('0xb'),_0xcd9ca3);this[_0xc073('0x4')]('accountcode',_0xcd9ca3);this['setDataValue'](_0xc073('0x8'),util[_0xc073('0x9')]('\x22%s\x22\x20<%s>',this[_0xc073('0xa')](_0xc073('0x7')),_0xcd9ca3));}},'salt':{'type':Sequelize[_0xc073('0x2')]},'phone':{'type':Sequelize[_0xc073('0x2')]},'mobile':{'type':Sequelize[_0xc073('0x2')]},'address':{'type':Sequelize[_0xc073('0x2')]},'zipcode':{'type':Sequelize[_0xc073('0x2')]},'userpic':{'type':Sequelize[_0xc073('0x2')]},'city':{'type':Sequelize[_0xc073('0x2')]},'country':{'type':Sequelize[_0xc073('0x2')]},'online':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc073('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc073('0x2')],'defaultValue':_0xc073('0x15')},'lastPauseAt':{'type':Sequelize[_0xc073('0x14')]},'chatCapacity':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc073('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xc073('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![],'defaultValue':_0xc073('0x16')},'ipaddr':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0xc073('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x18'),'user',_0xc073('0x19')),'allowNull':!![],'defaultValue':_0xc073('0x18')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x1a'),'ALLOWED_PASSED_SCREEN',_0xc073('0x1b'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc073('0x1c'),_0xc073('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![],'defaultValue':_0xc073('0x1e'),'set':function(_0x453936){this[_0xc073('0x4')](_0xc073('0x1f'),_0x453936?_0x453936[_0xc073('0x20')](','):null);},'get':function(){return this[_0xc073('0xa')](_0xc073('0x1f'))?this[_0xc073('0xa')](_0xc073('0x1f'))['split'](','):null;},'comment':_0xc073('0x21')},'dtmfmode':{'type':Sequelize[_0xc073('0x17')]('rfc2833',_0xc073('0x22'),'shortinfo',_0xc073('0x23'),_0xc073('0x24')),'allowNull':!![],'defaultValue':_0xc073('0x25')},'directmedia':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no',_0xc073('0x27'),_0xc073('0x28'),_0xc073('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x5e7f2b){this[_0xc073('0x4')](_0xc073('0x2a'),_0x5e7f2b?_0x5e7f2b[_0xc073('0x20')](','):null);},'get':function(){return this['getDataValue'](_0xc073('0x2a'))?this[_0xc073('0xa')](_0xc073('0x2a'))[_0xc073('0x2b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc073('0x2')]},'pickupgroup':{'type':Sequelize[_0xc073('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xc073('0x2')],'allowNull':![],'defaultValue':_0xc073('0x2c')},'allow':{'type':Sequelize[_0xc073('0x2')],'allowNull':![],'defaultValue':_0xc073('0x2d'),'set':function(_0x29941f){this[_0xc073('0x4')](_0xc073('0x2e'),_0x29941f?_0x29941f[_0xc073('0x20')](';'):_0xc073('0x2d'));},'get':function(){return this[_0xc073('0xa')](_0xc073('0x2e'))?this[_0xc073('0xa')](_0xc073('0x2e'))['split'](';'):null;},'comment':_0xc073('0x2f')},'autoframing':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![],'set':function(_0x585277){this[_0xc073('0x4')](_0xc073('0x30'),_0x585277?_0x585277['join'](','):null);},'get':function(){return this[_0xc073('0xa')]('insecure')?this[_0xc073('0xa')]('insecure')[_0xc073('0x2b')](','):null;},'comment':_0xc073('0x31')},'trustrpid':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no',_0xc073('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc073('0x33')},'amaflags':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc073('0x17')]('yes','no'),'allowNull':!![],'defaultValue':_0xc073('0x26')},'busylevel':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc073('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc073('0x17')]('yes','no',_0xc073('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x35'),_0xc073('0x36'),_0xc073('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc073('0x17')]('uac','uas'),'allowNull':!![],'defaultValue':_0xc073('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':_0xc073('0x26')},'keepalive':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0xc073('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x3a'),_0xc073('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc073('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc073('0x17')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc073('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xc073('0x26'),'no',_0xc073('0x27'),_0xc073('0x28'),_0xc073('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc073('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0xc073('0x14')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x248308){this[_0xc073('0x4')](_0xc073('0x3d'),_0x248308);var _0x181d61=this[_0xc073('0x3e')]({'plain':!![]});switch(_0x248308){case 0x0:case 0x1:var _0x1fd79b=_0x181d61[_0xc073('0x1f')]?_['isArray'](_0x181d61[_0xc073('0x1f')])?_0x181d61[_0xc073('0x1f')]['join']():_0x181d61['transport']:_0xc073('0x1e');if(_0x1fd79b==='wss'){_0x1fd79b=_0xc073('0x1e');}this[_0xc073('0x4')]('transport',_0x1fd79b);this[_0xc073('0x4')](_0xc073('0x3f'),'no');this[_0xc073('0x4')](_0xc073('0x40'),null);this['setDataValue'](_0xc073('0x41'),null);this[_0xc073('0x4')](_0xc073('0x42'),null);this[_0xc073('0x4')](_0xc073('0x43'),null);this[_0xc073('0x4')](_0xc073('0x44'),null);this[_0xc073('0x4')](_0xc073('0x45'),null);this[_0xc073('0x4')](_0xc073('0x46'),null);this['setDataValue']('dtlsprivatekey',null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue']('transport',_0xc073('0x47'));this[_0xc073('0x4')](_0xc073('0x3f'),_0xc073('0x26'));this[_0xc073('0x4')](_0xc073('0x40'),_0xc073('0x26'));this[_0xc073('0x4')](_0xc073('0x41'),_0xc073('0x26'));this[_0xc073('0x4')]('icesupport',_0xc073('0x26'));this[_0xc073('0x4')](_0xc073('0x43'),_0xc073('0x26'));this[_0xc073('0x4')](_0xc073('0x44'),'no');this[_0xc073('0x4')](_0xc073('0x45'),_0xc073('0x48'));this[_0xc073('0x4')]('dtlscertfile',_0x181d61[_0xc073('0x46')]||_0xc073('0x49'));this[_0xc073('0x4')](_0xc073('0x4a'),_0x181d61['dtlsprivatekey']||_0xc073('0x4b'));this[_0xc073('0x4')](_0xc073('0x4c'),_0xc073('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xc073('0x4d')],'set':function(_0x3060ec){this[_0xc073('0x4')](_0xc073('0x4e'),_0x3060ec?_0x3060ec[_0xc073('0x20')](','):[]);},'get':function(){return this[_0xc073('0xa')](_0xc073('0x4e'))?_[_0xc073('0x4f')](this[_0xc073('0xa')](_0xc073('0x4e'))['split'](','),function(_0x1ec89a){return parseInt(_0x1ec89a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc073('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc073('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0xc073('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc073('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc073('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc073('0x17')](_0xc073('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc073('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc073('0x2')]},'passwordResetAt':{'type':Sequelize[_0xc073('0x14')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0xc073('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc073('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xaf85=['rfc2833','info','inband','auto','yes','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','update,nonat','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','encryption','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0xca3a64,_0x28a36c){var _0x26e663=function(_0x255a41){while(--_0x255a41){_0xca3a64['push'](_0xca3a64['shift']());}};_0x26e663(++_0x28a36c);}(_0xaf85,0x1c9));var _0x5af8=function(_0x312931,_0x22e92b){_0x312931=_0x312931-0x0;var _0xdf26e5=_0xaf85[_0x312931];return _0xdf26e5;};'use strict';var Sequelize=require(_0x5af8('0x0'));var moment=require(_0x5af8('0x1'));var util=require(_0x5af8('0x2'));var _=require(_0x5af8('0x3'));module[_0x5af8('0x4')]={'name':{'type':Sequelize[_0x5af8('0x5')],'allowNull':![],'unique':_0x5af8('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5269c0){this['setDataValue'](_0x5af8('0x6'),_0x5269c0);this[_0x5af8('0x7')]('defaultuser',_0x5269c0);},'comment':_0x5af8('0x8')},'fullname':{'type':Sequelize[_0x5af8('0x5')],'allowNull':![],'set':function(_0x5348a4){this['setDataValue']('fullname',_0x5348a4);this[_0x5af8('0x7')](_0x5af8('0x9'),util[_0x5af8('0xa')]('\x22%s\x22\x20<%s>',_0x5348a4,this[_0x5af8('0xb')](_0x5af8('0xc'))));}},'alias':{'type':Sequelize[_0x5af8('0x5')]},'email':{'type':Sequelize[_0x5af8('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3d56db){if(_0x3d56db){this['setDataValue'](_0x5af8('0xd'),_0x3d56db[_0x5af8('0xe')]());}}},'role':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x10'),_0x5af8('0x11'),_0x5af8('0x12'),_0x5af8('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x5af8('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x5af8('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x2f8565){this[_0x5af8('0x7')]('internal',_0x2f8565);this['setDataValue'](_0x5af8('0x14'),_0x2f8565);this[_0x5af8('0x7')](_0x5af8('0x9'),util[_0x5af8('0xa')](_0x5af8('0x15'),this[_0x5af8('0xb')](_0x5af8('0x16')),_0x2f8565));}},'salt':{'type':Sequelize[_0x5af8('0x5')]},'phone':{'type':Sequelize[_0x5af8('0x5')]},'mobile':{'type':Sequelize[_0x5af8('0x5')]},'address':{'type':Sequelize[_0x5af8('0x5')]},'zipcode':{'type':Sequelize[_0x5af8('0x5')]},'userpic':{'type':Sequelize[_0x5af8('0x5')]},'city':{'type':Sequelize[_0x5af8('0x5')]},'country':{'type':Sequelize[_0x5af8('0x5')]},'online':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x5af8('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x5af8('0x5')],'defaultValue':_0x5af8('0x19')},'lastPauseAt':{'type':Sequelize[_0x5af8('0x18')]},'chatCapacity':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x5af8('0x1a')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x5af8('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'defaultValue':_0x5af8('0x1b')},'ipaddr':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x5af8('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x1c'),_0x5af8('0x11'),_0x5af8('0x1d')),'allowNull':!![],'defaultValue':_0x5af8('0x1c')},'context':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'defaultValue':_0x5af8('0x1e')},'callingpres':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x1f'),_0x5af8('0x20'),_0x5af8('0x21'),_0x5af8('0x22'),'PROHIB_NOT_SCREENED',_0x5af8('0x23'),'PROHIB_FAILED_SCREEN',_0x5af8('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'defaultValue':_0x5af8('0x25'),'set':function(_0x569f51){this[_0x5af8('0x7')](_0x5af8('0x26'),_0x569f51?_0x569f51[_0x5af8('0x27')](','):null);},'get':function(){return this[_0x5af8('0xb')](_0x5af8('0x26'))?this[_0x5af8('0xb')]('transport')['split'](','):null;},'comment':_0x5af8('0x28')},'dtmfmode':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x29'),_0x5af8('0x2a'),'shortinfo',_0x5af8('0x2b'),_0x5af8('0x2c')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no','nonat',_0x5af8('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5af8('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'defaultValue':_0x5af8('0x2f'),'set':function(_0x38003){this[_0x5af8('0x7')](_0x5af8('0x30'),_0x38003?_0x38003[_0x5af8('0x27')](','):null);},'get':function(){return this[_0x5af8('0xb')](_0x5af8('0x30'))?this[_0x5af8('0xb')](_0x5af8('0x30'))[_0x5af8('0x31')](','):null;},'comment':_0x5af8('0x32')},'callgroup':{'type':Sequelize[_0x5af8('0x5')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x5af8('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x5af8('0x5')]},'language':{'type':Sequelize[_0x5af8('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3d92ee){this['setDataValue']('allow',_0x3d92ee?_0x3d92ee[_0x5af8('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x5af8('0xb')](_0x5af8('0x33'))[_0x5af8('0x31')](';'):null;},'comment':_0x5af8('0x34')},'autoframing':{'type':Sequelize[_0x5af8('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'set':function(_0x4ad75e){this[_0x5af8('0x7')](_0x5af8('0x35'),_0x4ad75e?_0x4ad75e['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x5af8('0xb')]('insecure')[_0x5af8('0x31')](','):null;},'comment':_0x5af8('0x36')},'trustrpid':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no',_0x5af8('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![],'defaultValue':_0x5af8('0x38')},'amaflags':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x5af8('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x5af8('0x2d')},'busylevel':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x5af8('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no',_0x5af8('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x3a'),_0x5af8('0x3b'),_0x5af8('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x3d'),'uas'),'allowNull':!![],'defaultValue':_0x5af8('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x5af8('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no',_0x5af8('0x3f'),_0x5af8('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x41'),_0x5af8('0x42'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x5af8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x5af8('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x5af8('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no','nonat',_0x5af8('0x2e'),_0x5af8('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x5af8('0x18')]},'showWebBar':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0,'set':function(_0x51d1f2){this[_0x5af8('0x7')]('showWebBar',_0x51d1f2);var _0x5f1910=this[_0x5af8('0x44')]({'plain':!![]});switch(_0x51d1f2){case 0x0:case 0x1:var _0x5b29a4=_0x5f1910[_0x5af8('0x26')]?_[_0x5af8('0x45')](_0x5f1910['transport'])?_0x5f1910[_0x5af8('0x26')]['join']():_0x5f1910['transport']:_0x5af8('0x25');if(_0x5b29a4===_0x5af8('0x46')){_0x5b29a4='udp';}this[_0x5af8('0x7')](_0x5af8('0x26'),_0x5b29a4);this[_0x5af8('0x7')]('encryption','no');this[_0x5af8('0x7')](_0x5af8('0x47'),null);this['setDataValue'](_0x5af8('0x48'),null);this[_0x5af8('0x7')](_0x5af8('0x49'),null);this['setDataValue'](_0x5af8('0x4a'),null);this[_0x5af8('0x7')](_0x5af8('0x4b'),null);this[_0x5af8('0x7')](_0x5af8('0x4c'),null);this[_0x5af8('0x7')](_0x5af8('0x4d'),null);this[_0x5af8('0x7')]('dtlsprivatekey',null);this[_0x5af8('0x7')](_0x5af8('0x4e'),'no');break;case 0x2:this['setDataValue']('transport','wss');this[_0x5af8('0x7')](_0x5af8('0x4f'),_0x5af8('0x2d'));this[_0x5af8('0x7')]('avpf','yes');this['setDataValue']('force_avp','yes');this['setDataValue']('icesupport',_0x5af8('0x2d'));this[_0x5af8('0x7')](_0x5af8('0x4a'),_0x5af8('0x2d'));this[_0x5af8('0x7')](_0x5af8('0x4b'),'no');this[_0x5af8('0x7')](_0x5af8('0x4c'),'actpass');this[_0x5af8('0x7')](_0x5af8('0x4d'),_0x5f1910[_0x5af8('0x4d')]||'/etc/pki/tls/certs/motion.crt');this[_0x5af8('0x7')](_0x5af8('0x50'),_0x5f1910['dtlsprivatekey']||_0x5af8('0x51'));this['setDataValue'](_0x5af8('0x4e'),_0x5af8('0x2d'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1b18d5){this[_0x5af8('0x7')](_0x5af8('0x52'),_0x1b18d5?_0x1b18d5[_0x5af8('0x27')](','):[]);},'get':function(){return this[_0x5af8('0xb')]('permissions')?_['map'](this[_0x5af8('0xb')](_0x5af8('0x52'))[_0x5af8('0x31')](','),function(_0x589372){return parseInt(_0x589372,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x5af8('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x5af8('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x5af8('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x5af8('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5af8('0x1a')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5af8('0xf')](_0x5af8('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x5af8('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x5af8('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x5af8('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x5af8('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b32b506..52b7cf9 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 _0xb234=['$or','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','defaults','redis','socket.io-emitter','register','client','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','count','offset','limit','Content-Range','json','reject','save','destroy','get','Users','user','Telephones','telephone','map','value','role','find','name','stack','index','User','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','lower','sequelize','col','field','includeAll','include','findAll','rows','params','salt','options','body','update','describe','addContacts','ids','omit','agent','agent\x20role','admin','getLicense','users','isNil','License\x20limit\x20reached','format','internal','findById','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','password','fullname','email','permissions','101','103','105','106','107','108','109','111','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','channel','Queue:save','voice','VoiceQueue','push','SIP/%s','each','upsert','removeQueues','remove','emit','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getContacts','findOne','CmContact','pick','merge','CmList','Tag','Tags','tag','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','connection','remoteAddress','socket','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','logout','MemberReport','forEach','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','mailPause','faxPause','smsPause','pauseType','lastPauseAt','unpause','manual','chat','sms','openchannel','set','%s%s','Pause','getTeams','Team','addTeams','removeTeams','getLists','Agents','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb234,0x15b));var _0x4b23=function(_0x40eb6e,_0x5f00af){_0x40eb6e=_0x40eb6e-0x0;var _0x1b3dc4=_0xb234[_0x40eb6e];return _0x1b3dc4;};'use strict';var pdf=require(_0x4b23('0x0'));var emlformat=require(_0x4b23('0x1'));var rimraf=require(_0x4b23('0x2'));var zipdir=require(_0x4b23('0x3'));var jsonpatch=require(_0x4b23('0x4'));var rp=require(_0x4b23('0x5'));var moment=require(_0x4b23('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4b23('0x7'));var util=require(_0x4b23('0x8'));var path=require(_0x4b23('0x9'));var sox=require(_0x4b23('0xa'));var csv=require(_0x4b23('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4b23('0xc'));var squel=require(_0x4b23('0xd'));var crypto=require(_0x4b23('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4b23('0xf'));var toCsv=require(_0x4b23('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x4b23('0x10'));var hardwareService=require(_0x4b23('0x11'));var Redis=require(_0x4b23('0x12'));var qs=require(_0x4b23('0x13'));var logger=require(_0x4b23('0x14'))(_0x4b23('0x15'));var utils=require(_0x4b23('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4b23('0x17')](config[_0x4b23('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b23('0x19'))(new Redis(config[_0x4b23('0x18')]));require('./user.socket')[_0x4b23('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4b23('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x264127,_0x51d165,_0x2d1991,_0x53ddc8){return new BPromise(function(_0x454588,_0x25705f){var _0x3cd7ea=_0x53ddc8||client;return _0x3cd7ea['request'](_0x264127,_0x2d1991)[_0x4b23('0x1c')](function(_0xd37434){logger[_0x4b23('0x1d')](_0x4b23('0x1e'),_0x51d165,_0x4b23('0x1f'));logger['debug'](_0x4b23('0x20'),_0x51d165,_0x4b23('0x1f'),JSON[_0x4b23('0x21')](_0xd37434));if(_0xd37434[_0x4b23('0x22')]){if(_0xd37434['error'][_0x4b23('0x23')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x51d165,_0xd37434['error']['message']);return _0x25705f(_0xd37434[_0x4b23('0x22')][_0x4b23('0x24')]);}logger[_0x4b23('0x22')](_0x4b23('0x1e'),_0x51d165,_0xd37434[_0x4b23('0x22')][_0x4b23('0x24')]);return _0x454588(_0xd37434[_0x4b23('0x22')][_0x4b23('0x24')]);}else{logger[_0x4b23('0x1d')]('User,\x20%s,\x20%s',_0x51d165,_0x4b23('0x1f'));_0x454588(_0xd37434['result'][_0x4b23('0x24')]);}})[_0x4b23('0x25')](function(_0x4e541a){logger[_0x4b23('0x22')](_0x4b23('0x1e'),_0x51d165,_0x4e541a);_0x25705f(_0x4e541a);});});}function respondWithStatusCode(_0x29b131,_0x338d0b){_0x338d0b=_0x338d0b||0xcc;return function(_0x2b6c42){if(_0x2b6c42){return _0x29b131['sendStatus'](_0x338d0b);}return _0x29b131[_0x4b23('0x26')](_0x338d0b)[_0x4b23('0x27')]();};}function respondWithResult(_0xddb5b,_0x10b753){_0x10b753=_0x10b753||0xc8;return function(_0x2c3bba){if(_0x2c3bba){return _0xddb5b['status'](_0x10b753)['json'](_0x2c3bba);}};}function respondWithFilteredResult(_0x23a4c5,_0x183f46){return function(_0x4a4fb9){if(_0x4a4fb9){var _0x474060=_0x4a4fb9[_0x4b23('0x28')],_0x27ee2f=_0x183f46[_0x4b23('0x29')],_0x5213d5=_0x183f46['offset']+_0x183f46[_0x4b23('0x2a')],_0x15751e;if(_0x5213d5>=_0x474060){_0x5213d5=_0x474060;_0x15751e=0xc8;}else{_0x15751e=0xce;}_0x23a4c5[_0x4b23('0x26')](_0x15751e);return _0x23a4c5['set'](_0x4b23('0x2b'),_0x27ee2f+'-'+_0x5213d5+'/'+_0x474060)[_0x4b23('0x2c')](_0x4a4fb9);}return null;};}function patchUpdates(_0x196e1b){return function(_0x50886c){try{jsonpatch['apply'](_0x50886c,_0x196e1b,!![]);}catch(_0x558475){return BPromise[_0x4b23('0x2d')](_0x558475);}return _0x50886c[_0x4b23('0x2e')]();};}function saveUpdates(_0x381691,_0x474642){return function(_0x435d70){if(_0x435d70){return _0x435d70['update'](_0x381691)['then'](function(_0x537b76){return _0x537b76;});}return null;};}function removeEntity(_0x320bcc,_0x36a4c4){return function(_0x4b9efc){if(_0x4b9efc){return _0x4b9efc[_0x4b23('0x2f')]()[_0x4b23('0x1c')](function(){var _0x304981=_0x4b9efc[_0x4b23('0x30')]({'plain':!![]});var _0x50fa17=[{'name':_0x4b23('0x31'),'value':_0x4b23('0x32'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x4b23('0x33'),'value':_0x4b23('0x34'),'ignore':![]}];var _0x2010cb=_(_0x50fa17)['filter']('ignore')[_0x4b23('0x35')](_0x4b23('0x36'))['value']();if(_['includes'](_0x2010cb,_0x304981[_0x4b23('0x37')])){return;}var _0x538f86=_[_0x4b23('0x38')](_0x50fa17,[_0x4b23('0x36'),_0x304981['role']])[_0x4b23('0x39')];return db['UserProfileResource'][_0x4b23('0x2f')]({'where':{'type':_0x538f86,'resourceId':_0x304981['id']}})[_0x4b23('0x1c')](function(){return _0x4b9efc;});})[_0x4b23('0x1c')](function(){_0x320bcc['status'](0xcc)[_0x4b23('0x27')]();});}};}function handleEntityNotFound(_0xd2102,_0x7f4de3){return function(_0x2cc040){if(!_0x2cc040){_0xd2102['sendStatus'](0x194);}return _0x2cc040;};}function handleError(_0x3a83db,_0x4473cf){_0x4473cf=_0x4473cf||0x1f4;return function(_0x356c13){logger[_0x4b23('0x22')](_0x356c13[_0x4b23('0x3a')]);if(_0x356c13[_0x4b23('0x39')]){delete _0x356c13[_0x4b23('0x39')];}_0x3a83db['status'](_0x4473cf)['send'](_0x356c13);};}exports[_0x4b23('0x3b')]=function(_0x1c4e80,_0x4c5107){var _0x56546c={},_0x304828={},_0x1cd48f={'count':0x0,'rows':[]};var _0x45a571=db[_0x4b23('0x3c')][_0x4b23('0x3d')];_0x304828[_0x4b23('0x3e')]=_[_0x4b23('0x3f')](_[_0x4b23('0x40')](_0x45a571),['password','salt']);_0x304828[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x1c4e80['query']);_0x304828[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x304828['model'],_0x304828[_0x4b23('0x41')]);_0x56546c['attributes']=_[_0x4b23('0x43')](_0x304828['model'],qs[_0x4b23('0x44')](_0x1c4e80[_0x4b23('0x41')][_0x4b23('0x44')]));_0x56546c['attributes']=_0x56546c[_0x4b23('0x45')][_0x4b23('0x46')]?_0x56546c['attributes']:_0x304828[_0x4b23('0x3e')];if(!_0x1c4e80[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x56546c[_0x4b23('0x2a')]=qs['limit'](_0x1c4e80['query']['limit']);_0x56546c[_0x4b23('0x29')]=qs['offset'](_0x1c4e80[_0x4b23('0x41')][_0x4b23('0x29')]);}_0x56546c[_0x4b23('0x49')]=qs['sort'](_0x1c4e80[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x56546c[_0x4b23('0x4b')]=qs['filters'](_['pick'](_0x1c4e80[_0x4b23('0x41')],_0x304828[_0x4b23('0x42')]));if(_0x1c4e80['query'][_0x4b23('0x4c')]){_0x56546c['where']=_['merge'](_0x56546c[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x45a571,function(_0x32eb2b){return db['sequelize'][_0x4b23('0x4b')](db['sequelize']['fn'](_0x4b23('0x4d'),db[_0x4b23('0x4e')][_0x4b23('0x4f')](_0x32eb2b[_0x4b23('0x50')])),{'$like':db['sequelize']['fn'](_0x4b23('0x4d'),'%'+_0x1c4e80['query'][_0x4b23('0x4c')]+'%')});})});}_0x56546c=_['merge']({},_0x56546c,_0x1c4e80['options']);var _0x1f677a={'where':_0x56546c['where']};return db[_0x4b23('0x3c')]['count'](_0x1f677a)[_0x4b23('0x1c')](function(_0x224582){_0x1cd48f[_0x4b23('0x28')]=_0x224582;if(_0x1c4e80[_0x4b23('0x41')][_0x4b23('0x51')]){_0x56546c[_0x4b23('0x52')]=[{'all':!![]}];}return db[_0x4b23('0x3c')][_0x4b23('0x53')](_0x56546c);})[_0x4b23('0x1c')](function(_0x2f39d8){_0x1cd48f[_0x4b23('0x54')]=_0x2f39d8;return _0x1cd48f;})[_0x4b23('0x1c')](respondWithFilteredResult(_0x4c5107,_0x56546c))[_0x4b23('0x25')](handleError(_0x4c5107,null));};exports['show']=function(_0x9027fe,_0x3873af){var _0x1242dd={'raw':![],'where':{'id':_0x9027fe[_0x4b23('0x55')]['id']}},_0x1d0807={};_0x1d0807['model']=_[_0x4b23('0x3f')](_['keys'](db['User'][_0x4b23('0x3d')]),['password',_0x4b23('0x56')]);_0x1d0807[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x9027fe[_0x4b23('0x41')]);_0x1d0807[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x1d0807[_0x4b23('0x3e')],_0x1d0807[_0x4b23('0x41')]);_0x1242dd['attributes']=_[_0x4b23('0x43')](_0x1d0807['model'],qs['fields'](_0x9027fe['query'][_0x4b23('0x44')]));_0x1242dd['attributes']=_0x1242dd[_0x4b23('0x45')]['length']?_0x1242dd['attributes']:_0x1d0807[_0x4b23('0x3e')];if(_0x9027fe[_0x4b23('0x41')][_0x4b23('0x51')]){_0x1242dd[_0x4b23('0x52')]=[{'all':!![]}];}_0x1242dd=_['merge']({},_0x1242dd,_0x9027fe[_0x4b23('0x57')]);return db[_0x4b23('0x3c')][_0x4b23('0x38')](_0x1242dd)[_0x4b23('0x1c')](handleEntityNotFound(_0x3873af,null))[_0x4b23('0x1c')](respondWithResult(_0x3873af,null))[_0x4b23('0x25')](handleError(_0x3873af,null));};exports['bulkCreate']=function(_0x97ecb7,_0x16a4b3){return db[_0x4b23('0x3c')]['bulkCreate'](_0x97ecb7[_0x4b23('0x58')],{'raw':![],'individualHooks':!![]})[_0x4b23('0x1c')](respondWithResult(_0x16a4b3,0xc9))[_0x4b23('0x25')](handleError(_0x16a4b3,null));};exports[_0x4b23('0x59')]=function(_0x4e9c1e,_0xcbec94){if(_0x4e9c1e[_0x4b23('0x58')]['id']){delete _0x4e9c1e[_0x4b23('0x58')]['id'];}delete _0x4e9c1e[_0x4b23('0x58')]['role'];return db['User']['find']({'where':{'id':_0x4e9c1e[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0xcbec94,null))['then'](saveUpdates(_0x4e9c1e[_0x4b23('0x58')],null))[_0x4b23('0x1c')](respondWithResult(_0xcbec94,null))[_0x4b23('0x25')](handleError(_0xcbec94,null));};exports[_0x4b23('0x5a')]=function(_0x5ca98a,_0x3834da){return db[_0x4b23('0x3c')][_0x4b23('0x5a')]()[_0x4b23('0x1c')](respondWithResult(_0x3834da,null))[_0x4b23('0x25')](handleError(_0x3834da,null));};exports[_0x4b23('0x5b')]=function(_0x566c9c,_0x532851,_0xbb4240){return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x566c9c[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x532851,null))['then'](function(_0x31c315){if(_0x31c315){return _0x31c315[_0x4b23('0x5b')](_0x566c9c[_0x4b23('0x58')][_0x4b23('0x5c')],_[_0x4b23('0x5d')](_0x566c9c['body'],[_0x4b23('0x5c'),'id'])||{});}})[_0x4b23('0x1c')](respondWithResult(_0x532851,null))[_0x4b23('0x25')](handleError(_0x532851,null));};var getLicense=function(_0x115b92){return new BPromise(function(_0x2f21b2,_0x315367){var _0xccf586=0x0;_0x115b92[_0x4b23('0x58')][_0x4b23('0x37')]===_0x4b23('0x5e')&&_0x2f21b2(_0x4b23('0x5f'));return db[_0x4b23('0x3c')][_0x4b23('0x28')]({'where':{'$or':[{'role':_0x115b92[_0x4b23('0x58')]['role']===_0x4b23('0x34')?_0x4b23('0x34'):[_0x4b23('0x60'),_0x4b23('0x32')]}]}})[_0x4b23('0x1c')](function(_0x1d322d){_0xccf586=_0x1d322d;return require('../../config/license/util')[_0x4b23('0x61')]();})['then'](function(_0x5e8fe9){var _0x4b703a=_0x115b92[_0x4b23('0x58')][_0x4b23('0x37')]===_0x4b23('0x34')?'telephones':_0x4b23('0x62');if(!_[_0x4b23('0x63')](_0x5e8fe9[_0x4b703a])&&_0xccf586>=_0x5e8fe9[_0x4b703a]){return _0x315367({'message':_0x4b23('0x64')});}return _0x2f21b2(util[_0x4b23('0x65')]('count\x20%s:\x20%s',_0x4b703a,_0xccf586));})['catch'](function(_0x3cf4c0){return _0x315367(_0x3cf4c0);});});};exports['create']=function(_0x2ba391,_0x530dd1){return getLicense(_0x2ba391)[_0x4b23('0x1c')](function(_0x3ca0fd){if(!_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]){var _0x58e265;return db['Setting'][_0x4b23('0x67')](0x1)[_0x4b23('0x1c')](function(_0x2bef97){_0x58e265=_0x2bef97['min_internal'];return db[_0x4b23('0x3c')][_0x4b23('0x68')](_0x4b23('0x66'));})[_0x4b23('0x1c')](function(_0x213144){if(_[_0x4b23('0x63')](_0x213144)){if(_0x58e265){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=_0x58e265;}else{_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=0x1;}}else{if(_[_0x4b23('0x63')](_0x58e265)||_0x58e265==_0x213144){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=_0x213144+0x1;}else if(_0x58e265>_0x213144){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=_0x58e265;}else{return db[_0x4b23('0x4e')]['query'](_0x4b23('0x69'),{'type':db[_0x4b23('0x4e')][_0x4b23('0x6a')]['SELECT']})[_0x4b23('0x1c')](function(_0x1a683e){if(_0x1a683e&&_0x1a683e['length']){for(var _0x169bed=0x0,_0x1bfb4d=_0x1a683e['length'];_0x169bed<_0x1bfb4d&&_['isNil'](_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]);_0x169bed++){if(_0x58e265<=_0x1a683e[_0x169bed][_0x4b23('0x6b')]){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=_0x1a683e[_0x169bed]['from'];}else if(_0x58e265>_0x1a683e[_0x169bed][_0x4b23('0x6b')]&&_0x58e265<=_0x1a683e[_0x169bed]['to']){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')]=_0x58e265;}}}if(_[_0x4b23('0x63')](_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')])){_0x2ba391['body']['internal']=_0x213144+0x1;}});}}});}})['then'](function(){if(_0x2ba391[_0x4b23('0x58')][_0x4b23('0x6c')]){_0x2ba391[_0x4b23('0x58')][_0x4b23('0x6d')]=_0x2ba391[_0x4b23('0x58')]['internal'];_0x2ba391[_0x4b23('0x58')][_0x4b23('0x6e')]={'mailbox':_0x2ba391[_0x4b23('0x58')][_0x4b23('0x66')],'password':_0x2ba391['body'][_0x4b23('0x6f')],'fullname':_0x2ba391['body'][_0x4b23('0x70')],'email':_0x2ba391[_0x4b23('0x58')][_0x4b23('0x71')]};}if(_0x2ba391[_0x4b23('0x58')]&&_0x2ba391[_0x4b23('0x58')][_0x4b23('0x37')]===_0x4b23('0x5e')){_0x2ba391['body'][_0x4b23('0x72')]=[_0x4b23('0x73'),'102',_0x4b23('0x74'),'110','104',_0x4b23('0x75'),_0x4b23('0x76'),_0x4b23('0x77'),_0x4b23('0x78'),_0x4b23('0x79'),'100',_0x4b23('0x7a')];}return db[_0x4b23('0x3c')][_0x4b23('0x7b')](_0x2ba391[_0x4b23('0x58')],{'include':[{'model':db[_0x4b23('0x6e')],'as':_0x4b23('0x6e')}]});})[_0x4b23('0x1c')](function(_0x190d6c){if(_0x2ba391[_0x4b23('0x58')]['role']===_0x4b23('0x32'))return _0x190d6c;var _0x56c5c2=_0x2ba391['user']['get']({'plain':!![]});if(!_0x56c5c2)throw new Error(_0x4b23('0x7c'));if(_0x56c5c2[_0x4b23('0x37')]===_0x4b23('0x32')){var _0x26b98d=_0x190d6c['get']({'plain':!![]});var _0x13404a=[{'name':'Agents','value':_0x4b23('0x5e')},{'name':'Telephones','value':_0x4b23('0x34')}];var _0x16072d=_[_0x4b23('0x38')](_0x13404a,['value',_0x26b98d[_0x4b23('0x37')]])['name'];return db[_0x4b23('0x7d')][_0x4b23('0x38')]({'where':{'name':_0x16072d,'userProfileId':_0x56c5c2[_0x4b23('0x7e')]},'raw':!![]})['then'](function(_0x156389){if(_0x156389&&_0x156389['autoAssociation']===0x0){return db[_0x4b23('0x7f')]['create']({'name':_0x26b98d['name'],'resourceId':_0x26b98d['id'],'type':_0x156389[_0x4b23('0x39')],'sectionId':_0x156389['id']},{})[_0x4b23('0x1c')](function(){return _0x190d6c;});}else{return _0x190d6c;}})[_0x4b23('0x25')](function(_0x4ff1fa){logger[_0x4b23('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ff1fa);throw _0x4ff1fa;});}return _0x190d6c;})['then'](respondWithResult(_0x530dd1,0xc9))[_0x4b23('0x25')](handleError(_0x530dd1,null));};exports[_0x4b23('0x80')]=function(_0x94a19c,_0x347976,_0x52b662){if(_0x94a19c[_0x4b23('0x58')]['id']){delete _0x94a19c[_0x4b23('0x58')]['id'];}return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x94a19c[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](function(_0x3cbd13){if(_0x3cbd13){if(_0x3cbd13['id']==_0x94a19c['user']['id']){if(!_0x94a19c['body'][_0x4b23('0x81')]||!_0x94a19c['body'][_0x4b23('0x82')]){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x85'));}if(!_0x3cbd13[_0x4b23('0x86')](_0x94a19c[_0x4b23('0x58')][_0x4b23('0x81')])){throw new db['Sequelize'][(_0x4b23('0x84'))](_0x4b23('0x87'));}if(_0x94a19c[_0x4b23('0x58')][_0x4b23('0x81')]==_0x94a19c[_0x4b23('0x58')][_0x4b23('0x82')]){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x88'));}return _0x3cbd13;}else if(_0x94a19c[_0x4b23('0x32')][_0x4b23('0x37')]==_0x4b23('0x60')){if(!_0x94a19c['body'][_0x4b23('0x82')]){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x89'));}return _0x3cbd13;}else if(_0x94a19c[_0x4b23('0x32')][_0x4b23('0x37')]=='user'){if(!_0x94a19c['body']['newPassword']){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x89'));}if(_0x3cbd13[_0x4b23('0x37')]!='agent'){throw new db[(_0x4b23('0x83'))]['ValidationError']('Unauthorized');}return _0x3cbd13;}else{throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x8a'));}}return null;})[_0x4b23('0x1c')](handleEntityNotFound(_0x347976,null))[_0x4b23('0x1c')](saveUpdates({'password':_0x94a19c[_0x4b23('0x58')]['newPassword'],'passwordResetAt':_0x94a19c[_0x4b23('0x32')]['id']==_0x94a19c[_0x4b23('0x55')]['id']?moment():null},null))['then'](respondWithResult(_0x347976,null))[_0x4b23('0x25')](handleError(_0x347976,null));};exports[_0x4b23('0x8b')]=function(_0x5be577,_0x53952b,_0x303634){var _0x2848eb;return db[_0x4b23('0x3c')]['find']({'where':{'id':_0x5be577[_0x4b23('0x55')]['id']},'attributes':['id',_0x4b23('0x39'),_0x4b23('0x37'),'loginInPause',_0x4b23('0x8c'),_0x4b23('0x8d')]})[_0x4b23('0x1c')](handleEntityNotFound(_0x53952b,null))[_0x4b23('0x1c')](function(_0x50c477){if(_0x50c477){_0x2848eb=_0x50c477;if(!utils[_0x4b23('0x8e')](_0x5be577[_0x4b23('0x58')]['channel'])){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x8f'));}return _0x50c477[_0x4b23('0x90')+_['capitalize'](_0x5be577[_0x4b23('0x58')]['channel'][_0x4b23('0x91')]())+_0x4b23('0x92')](_0x5be577[_0x4b23('0x58')][_0x4b23('0x5c')],{'penalty':_0x5be577[_0x4b23('0x58')][_0x4b23('0x93')]||0x0});}})[_0x4b23('0x94')](function(_0x5cacb3){for(var _0x39d93=0x0;_0x39d93<_0x5be577[_0x4b23('0x58')]['ids']['length'];_0x39d93+=0x1){var _0x4d309d={'UserId':_0x5be577['params']['id']};_0x4d309d[_[_0x4b23('0x95')](_0x5be577['body'][_0x4b23('0x96')]['toLowerCase']())+'QueueId']=_0x5be577[_0x4b23('0x58')]['ids'][_0x39d93];socket['emit'](_0x4b23('0x32')+_[_0x4b23('0x95')](_0x5be577[_0x4b23('0x58')][_0x4b23('0x96')]['toLowerCase']())+_0x4b23('0x97'),_0x4d309d);}return _0x5cacb3;})[_0x4b23('0x1c')](function(){if(_0x5be577[_0x4b23('0x58')][_0x4b23('0x96')]===_0x4b23('0x98')){return db[_0x4b23('0x99')][_0x4b23('0x53')]({'where':{'id':_0x5be577['body'][_0x4b23('0x5c')]||[]},'raw':!![],'attributes':['id',_0x4b23('0x39')]});}})['then'](function(_0x3a3e3f){var _0x255d9d=[];if(_0x5be577['body'][_0x4b23('0x96')]===_0x4b23('0x98')&&_0x2848eb[_0x4b23('0x37')]==='agent'){for(var _0x56a970=0x0;_0x56a970<_0x3a3e3f[_0x4b23('0x46')];_0x56a970+=0x1){_0x255d9d[_0x4b23('0x9a')]({'membername':_0x2848eb[_0x4b23('0x39')],'UserId':_0x2848eb['id'],'queue_name':_0x3a3e3f[_0x56a970][_0x4b23('0x39')],'VoiceQueueId':_0x3a3e3f[_0x56a970]['id'],'interface':_['isNil'](_0x2848eb[_0x4b23('0x8d')])?util[_0x4b23('0x65')](_0x4b23('0x9b'),_0x2848eb['name']):_0x2848eb[_0x4b23('0x8d')],'paused':_0x2848eb[_0x4b23('0x8c')]||![],'penalty':_0x5be577['body'][_0x4b23('0x93')]||0x0});}return BPromise[_0x4b23('0x9c')](_0x255d9d,function(_0x3d8f0b){return db['UserVoiceQueueRt'][_0x4b23('0x9d')](_0x3d8f0b);});}return _0x2848eb;})['then'](respondWithStatusCode(_0x53952b,null))[_0x4b23('0x25')](handleError(_0x53952b,null));};exports[_0x4b23('0x9e')]=function(_0x3ccb4f,_0x3fb9b1,_0x5a3b5e){var _0x481593;return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x3ccb4f[_0x4b23('0x55')]['id']},'attributes':['id','name','role']})[_0x4b23('0x1c')](handleEntityNotFound(_0x3fb9b1,null))[_0x4b23('0x1c')](function(_0x5c2278){if(_0x5c2278){_0x481593=_0x5c2278;if(!_0x3ccb4f['query'][_0x4b23('0x96')]||!utils[_0x4b23('0x8e')](_0x3ccb4f[_0x4b23('0x41')][_0x4b23('0x96')])){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))]('Unknown\x20channel');}return _0x5c2278[_0x4b23('0x9f')+_[_0x4b23('0x95')](_0x3ccb4f[_0x4b23('0x41')][_0x4b23('0x96')][_0x4b23('0x91')]())+_0x4b23('0x92')](_0x3ccb4f['query']['ids']);}})[_0x4b23('0x1c')](function(_0xd2892e){for(var _0x3b1c44=0x0;_0x3b1c44<_0x3ccb4f[_0x4b23('0x41')][_0x4b23('0x5c')][_0x4b23('0x46')];_0x3b1c44+=0x1){var _0x1ac1da={'UserId':_0x3ccb4f['params']['id']};_0x1ac1da[_['capitalize'](_0x3ccb4f[_0x4b23('0x41')]['channel']['toLowerCase']())+'QueueId']=_0x3ccb4f[_0x4b23('0x41')]['ids'][_0x3b1c44];socket[_0x4b23('0xa0')]('user'+_[_0x4b23('0x95')](_0x3ccb4f[_0x4b23('0x41')]['channel'][_0x4b23('0x91')]())+_0x4b23('0xa1'),_0x1ac1da);}return _0xd2892e;})[_0x4b23('0x1c')](function(){if(_0x3ccb4f[_0x4b23('0x41')][_0x4b23('0x96')]===_0x4b23('0x98')){return db[_0x4b23('0xa2')][_0x4b23('0x2f')]({'where':{'UserId':_0x3ccb4f[_0x4b23('0x55')]['id'],'VoiceQueueId':_0x3ccb4f[_0x4b23('0x41')][_0x4b23('0x5c')]},'individualHooks':!![]})[_0x4b23('0x1c')](function(){return _0x481593;});}return _0x481593;})[_0x4b23('0x1c')](respondWithStatusCode(_0x3fb9b1,null))['catch'](handleError(_0x3fb9b1,null));};exports[_0x4b23('0xa3')]=function(_0x1965e1,_0x28147b,_0x3bd7e2){_0x1965e1['body'][_0x4b23('0xa4')]=_0x1965e1[_0x4b23('0xa5')]['filename'];return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x1965e1[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x28147b,null))[_0x4b23('0x1c')](saveUpdates(_0x1965e1[_0x4b23('0x58')],null))[_0x4b23('0x1c')](respondWithResult(_0x28147b,null))[_0x4b23('0x25')](handleError(_0x28147b,null));};exports[_0x4b23('0xa6')]=function(_0x2beeda,_0x418aec,_0x10c08e){var _0x576de9=path[_0x4b23('0xa7')](config[_0x4b23('0xa8')],_0x4b23('0xa9'));return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x2beeda[_0x4b23('0x55')]['id']},'attributes':['id',_0x4b23('0xa4')],'raw':!![]})[_0x4b23('0x1c')](handleEntityNotFound(_0x418aec,null))[_0x4b23('0x1c')](function(_0x218d34){if(_0x218d34){if(_[_0x4b23('0x63')](_0x218d34[_0x4b23('0xa4')])){return _0x418aec['download'](_0x576de9);}else{if(!fs[_0x4b23('0xaa')](path['join'](config[_0x4b23('0xa8')],_0x4b23('0xab'),_0x218d34[_0x4b23('0xa4')]))){return _0x418aec['download'](_0x576de9);}return _0x418aec[_0x4b23('0xac')](path[_0x4b23('0xa7')](config[_0x4b23('0xa8')],_0x4b23('0xab'),_0x218d34['userpic']));}}})['catch'](handleError(_0x418aec,null));};exports[_0x4b23('0xad')]=function(_0x58e6ea,_0x3ed94a,_0x58ab46){var _0x3eee73={};var _0x212b0c={};var _0x2355fb;var _0x544b2d;return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x58e6ea[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x3ed94a,null))['then'](function(_0x2c4dfb){if(_0x2c4dfb){_0x2355fb=_0x2c4dfb;_0x212b0c['model']=_[_0x4b23('0x40')](db[_0x4b23('0xaf')]['rawAttributes']);_0x212b0c['query']=_['keys'](_0x58e6ea[_0x4b23('0x41')]);_0x212b0c['filters']=_['intersection'](_0x212b0c['model'],_0x212b0c[_0x4b23('0x41')]);_0x3eee73[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x212b0c[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x58e6ea['query']['fields']));_0x3eee73[_0x4b23('0x45')]=_0x3eee73[_0x4b23('0x45')][_0x4b23('0x46')]?_0x3eee73[_0x4b23('0x45')]:_0x212b0c[_0x4b23('0x3e')];_0x3eee73[_0x4b23('0x49')]=qs['sort'](_0x58e6ea[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x3eee73[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_[_0x4b23('0xb0')](_0x58e6ea[_0x4b23('0x41')],_0x212b0c[_0x4b23('0x42')]));if(_0x58e6ea[_0x4b23('0x41')]['filter']){_0x3eee73[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x3eee73['where'],{'$or':_[_0x4b23('0x35')](_0x3eee73[_0x4b23('0x45')],function(_0x31980c){var _0xc4720d={};_0xc4720d[_0x31980c]={'$like':'%'+_0x58e6ea[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0xc4720d;})});}_0x3eee73=_[_0x4b23('0xb1')]({},_0x3eee73,_0x58e6ea['options']);return _0x2355fb['getContacts'](_0x3eee73);}})[_0x4b23('0x1c')](function(_0x39c249){if(_0x39c249){_0x544b2d=_0x39c249[_0x4b23('0x46')];if(_0x58e6ea[_0x4b23('0x41')]['hasOwnProperty'](_0x4b23('0x51'))){_0x3eee73[_0x4b23('0x52')]=[{'model':db[_0x4b23('0xb2')],'as':'List','required':![]},{'model':db[_0x4b23('0xb3')],'as':_0x4b23('0xb4'),'attributes':['id',_0x4b23('0x39'),'color'],'where':_0x58e6ea[_0x4b23('0x41')][_0x4b23('0xb5')]?{'id':_0x58e6ea[_0x4b23('0x41')][_0x4b23('0xb5')]}:undefined,'required':_0x58e6ea[_0x4b23('0x41')]['tag']?!![]:![]}];}if(!_0x58e6ea[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x3eee73[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x58e6ea[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x3eee73['offset']=qs[_0x4b23('0x29')](_0x58e6ea[_0x4b23('0x41')]['offset']);}return _0x2355fb[_0x4b23('0xad')](_0x3eee73);}})[_0x4b23('0x1c')](function(_0x26def6){if(_0x26def6){return _0x26def6?{'count':_0x544b2d,'rows':_0x26def6}:null;}})['then'](respondWithResult(_0x3ed94a,null))[_0x4b23('0x25')](handleError(_0x3ed94a,null));};exports['getQueues']=function(_0x4d51f2,_0x2793b5,_0x3bc9f6){var _0x1ac3e8;var _0x2c7587;var _0x248ad1={};var _0x1c6a26;return db['User'][_0x4b23('0xae')]({'where':{'id':_0x4d51f2[_0x4b23('0x55')]['id']},'attributes':['id',_0x4b23('0x39'),'role']})['then'](handleEntityNotFound(_0x2793b5,null))[_0x4b23('0x1c')](function(_0x519d32){if(!utils[_0x4b23('0x8e')](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x96')])){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0x8f'));}_0x1ac3e8=_0x519d32;var _0x3edfa5={};_0x3edfa5[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_[_0x4b23('0x95')](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x96')])+_0x4b23('0xb6')][_0x4b23('0x3d')]);_0x3edfa5['query']=_[_0x4b23('0x40')](_0x4d51f2[_0x4b23('0x41')]);_0x3edfa5['filters']=_['intersection'](_0x3edfa5[_0x4b23('0x3e')],_0x3edfa5[_0x4b23('0x41')]);_0x248ad1[_0x4b23('0x45')]=_['intersection'](_0x3edfa5[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x44')]));_0x248ad1[_0x4b23('0x45')]=_0x248ad1[_0x4b23('0x45')][_0x4b23('0x46')]?_0x248ad1[_0x4b23('0x45')]:_0x3edfa5['model'];_0x248ad1[_0x4b23('0x49')]=qs['sort'](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x248ad1[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_[_0x4b23('0xb0')](_0x4d51f2[_0x4b23('0x41')],_0x3edfa5[_0x4b23('0x42')]));if(_0x4d51f2[_0x4b23('0x41')]['filter']){_0x248ad1[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x248ad1[_0x4b23('0x4b')],{'$or':_['map'](_0x248ad1[_0x4b23('0x45')],function(_0x3d5453){var _0x51ae7e={};_0x51ae7e[_0x3d5453]={'$like':'%'+_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0x51ae7e;})});}_0x248ad1=_[_0x4b23('0xb1')]({},_0x248ad1,_0x4d51f2['options']);switch(_0x1ac3e8[_0x4b23('0x37')]){case'admin':return db[_[_0x4b23('0x95')](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x96')])+_0x4b23('0xb6')][_0x4b23('0x53')](_0x248ad1);case _0x4b23('0x32'):case _0x4b23('0x5e'):return _0x1ac3e8['get'+_[_0x4b23('0x95')](_0x4d51f2['query']['channel'])+'Queues'](_0x248ad1);default:throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))](_0x4b23('0xb7'));}})[_0x4b23('0x1c')](function(_0x2d7afc){_0x1c6a26=_0x2d7afc[_0x4b23('0x46')];if(!_0x4d51f2['query'][_0x4b23('0x47')](_0x4b23('0x48'))){_0x248ad1[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x4d51f2[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x248ad1[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x4d51f2[_0x4b23('0x41')]['offset']);}switch(_0x1ac3e8['role']){case _0x4b23('0x60'):return db[_['capitalize'](_0x4d51f2[_0x4b23('0x41')]['channel'])+_0x4b23('0xb6')][_0x4b23('0x53')](_0x248ad1);case'user':case _0x4b23('0x5e'):return _0x1ac3e8['get'+_[_0x4b23('0x95')](_0x4d51f2['query']['channel'])+_0x4b23('0x92')](_0x248ad1);}})['then'](function(_0x17bcc1){return{'count':_0x1c6a26,'rows':_0x17bcc1};})[_0x4b23('0x1c')](respondWithResult(_0x2793b5,null))['catch'](handleError(_0x2793b5,null));};exports[_0x4b23('0xb8')]=function(_0x7db5a8,_0x1a767b,_0x1822c){var _0x160502={};var _0x580f8e={};var _0xfd431;var _0x551051;return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x7db5a8[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x1a767b,null))[_0x4b23('0x1c')](function(_0x351e02){if(_0x351e02){_0xfd431=_0x351e02;_0x580f8e[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_0x4b23('0xa2')]['rawAttributes']);_0x580f8e[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x7db5a8[_0x4b23('0x41')]);_0x580f8e[_0x4b23('0x42')]=_['intersection'](_0x580f8e['model'],_0x580f8e[_0x4b23('0x41')]);_0x160502[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x580f8e[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x7db5a8[_0x4b23('0x41')][_0x4b23('0x44')]));_0x160502[_0x4b23('0x45')]=_0x160502[_0x4b23('0x45')][_0x4b23('0x46')]?_0x160502[_0x4b23('0x45')]:_0x580f8e['model'];_0x160502[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x7db5a8[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x160502[_0x4b23('0x4b')]=qs['filters'](_['pick'](_0x7db5a8[_0x4b23('0x41')],_0x580f8e[_0x4b23('0x42')]));if(_0x7db5a8[_0x4b23('0x41')][_0x4b23('0x4c')]){_0x160502[_0x4b23('0x4b')]=_['merge'](_0x160502[_0x4b23('0x4b')],{'$or':_['map'](_0x160502[_0x4b23('0x45')],function(_0x3c669b){var _0x106355={};_0x106355[_0x3c669b]={'$like':'%'+_0x7db5a8[_0x4b23('0x41')]['filter']+'%'};return _0x106355;})});}_0x160502=_[_0x4b23('0xb1')]({},_0x160502,_0x7db5a8['options']);return _0xfd431['getVoiceQueuesRt'](_0x160502);}})[_0x4b23('0x1c')](function(_0x2fd397){if(_0x2fd397){_0x551051=_0x2fd397[_0x4b23('0x46')];if(!_0x7db5a8[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x160502[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x7db5a8['query'][_0x4b23('0x2a')]);_0x160502[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x7db5a8[_0x4b23('0x41')][_0x4b23('0x29')]);}return _0xfd431[_0x4b23('0xb8')](_0x160502);}})[_0x4b23('0x1c')](function(_0x287e74){if(_0x287e74){return _0x287e74?{'count':_0x551051,'rows':_0x287e74}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x1a767b,null))[_0x4b23('0x25')](handleError(_0x1a767b,null));};exports[_0x4b23('0xb9')]=function(_0x39ccf9,_0x3de7e5,_0x30248b){var _0xcd0463={};var _0x361b19={};var _0x5e4da7;var _0x50453b;return db['User'][_0x4b23('0xae')]({'where':{'id':_0x39ccf9[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x3de7e5,null))['then'](function(_0x370160){if(_0x370160){_0x5e4da7=_0x370160;_0x361b19[_0x4b23('0x3e')]=_['keys'](db['ChatGroup'][_0x4b23('0x3d')]);_0x361b19[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x39ccf9[_0x4b23('0x41')]);_0x361b19['filters']=_[_0x4b23('0x43')](_0x361b19['model'],_0x361b19[_0x4b23('0x41')]);_0xcd0463[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x361b19['model'],qs[_0x4b23('0x44')](_0x39ccf9[_0x4b23('0x41')][_0x4b23('0x44')]));_0xcd0463[_0x4b23('0x45')]=_0xcd0463['attributes'][_0x4b23('0x46')]?_0xcd0463['attributes']:_0x361b19[_0x4b23('0x3e')];_0xcd0463['order']=qs['sort'](_0x39ccf9['query'][_0x4b23('0x4a')]);_0xcd0463[_0x4b23('0x4b')]=qs['filters'](_[_0x4b23('0xb0')](_0x39ccf9[_0x4b23('0x41')],_0x361b19[_0x4b23('0x42')]));if(_0x39ccf9['query'][_0x4b23('0x4c')]){_0xcd0463[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0xcd0463[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0xcd0463[_0x4b23('0x45')],function(_0x97503e){var _0x174d08={};_0x174d08[_0x97503e]={'$like':'%'+_0x39ccf9[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0x174d08;})});}_0xcd0463=_[_0x4b23('0xb1')]({},_0xcd0463,_0x39ccf9['options']);return _0x5e4da7[_0x4b23('0xb9')](_0xcd0463);}})['then'](function(_0x5a9440){if(_0x5a9440){_0x50453b=_0x5a9440[_0x4b23('0x46')];if(!_0x39ccf9[_0x4b23('0x41')]['hasOwnProperty'](_0x4b23('0x48'))){_0xcd0463['limit']=qs[_0x4b23('0x2a')](_0x39ccf9[_0x4b23('0x41')][_0x4b23('0x2a')]);_0xcd0463[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x39ccf9['query'][_0x4b23('0x29')]);}return _0x5e4da7[_0x4b23('0xb9')](_0xcd0463);}})[_0x4b23('0x1c')](function(_0x36b791){if(_0x36b791){return _0x36b791?{'count':_0x50453b,'rows':_0x36b791}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x3de7e5,null))[_0x4b23('0x25')](handleError(_0x3de7e5,null));};exports[_0x4b23('0xba')]=function(_0x3e9b52,_0x213230,_0x4598d0){var _0x42eb78={'raw':!![],'where':{}};var _0x4ee2e0={};var _0xf025d1={'count':0x0,'rows':[]};return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x3e9b52[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x213230,null))[_0x4b23('0x1c')](function(_0x30d315){if(_0x30d315){_0x4ee2e0['model']=_[_0x4b23('0x40')](db[_0x4b23('0xbb')][_0x4b23('0x3d')]);_0x4ee2e0[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x3e9b52[_0x4b23('0x41')]);_0x4ee2e0[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x4ee2e0['model'],_0x4ee2e0[_0x4b23('0x41')]);_0x42eb78['attributes']=_['intersection'](_0x4ee2e0['model'],qs[_0x4b23('0x44')](_0x3e9b52[_0x4b23('0x41')][_0x4b23('0x44')]));_0x42eb78[_0x4b23('0x45')]=_0x42eb78[_0x4b23('0x45')][_0x4b23('0x46')]?_0x42eb78[_0x4b23('0x45')]:_0x4ee2e0[_0x4b23('0x3e')];if(!_0x3e9b52['query'][_0x4b23('0x47')]('nolimit')){_0x42eb78[_0x4b23('0x2a')]=qs['limit'](_0x3e9b52[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x42eb78[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x3e9b52[_0x4b23('0x41')][_0x4b23('0x29')]);}_0x42eb78[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x3e9b52[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x42eb78[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_['pick'](_0x3e9b52[_0x4b23('0x41')],_0x4ee2e0[_0x4b23('0x42')]));_0x42eb78['where'][_0x4b23('0xbc')]=_0x30d315['id'];if(_0x3e9b52[_0x4b23('0x41')]['filter']){_0x42eb78[_0x4b23('0x4b')]=_['merge'](_0x42eb78[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x42eb78[_0x4b23('0x45')],function(_0x2ea0ec){var _0x32bbec={};_0x32bbec[_0x2ea0ec]={'$like':'%'+_0x3e9b52[_0x4b23('0x41')]['filter']+'%'};return _0x32bbec;})});}_0x42eb78=_[_0x4b23('0xb1')]({},_0x42eb78,_0x3e9b52[_0x4b23('0x57')]);return db[_0x4b23('0xbb')][_0x4b23('0x28')]({'where':_0x42eb78[_0x4b23('0x4b')]})[_0x4b23('0x1c')](function(_0x4b125c){_0xf025d1[_0x4b23('0x28')]=_0x4b125c;if(_0x3e9b52[_0x4b23('0x41')]['includeAll']){_0x42eb78[_0x4b23('0x52')]=[{'all':!![]}];}return db[_0x4b23('0xbb')][_0x4b23('0x53')](_0x42eb78);})[_0x4b23('0x1c')](function(_0x2671e1){_0xf025d1[_0x4b23('0x54')]=_0x2671e1;return _0xf025d1;});}})[_0x4b23('0x1c')](respondWithFilteredResult(_0x213230,_0x42eb78))[_0x4b23('0x25')](handleError(_0x213230,null));};exports[_0x4b23('0xbd')]=function(_0x244e9a,_0x994bdc,_0x451139){var _0x115889={};var _0x855ccd={};var _0x2d9b8f;var _0x337599;return db['User']['findOne']({'where':{'id':_0x244e9a[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x994bdc,null))[_0x4b23('0x1c')](function(_0x4262fe){if(_0x4262fe){_0x2d9b8f=_0x4262fe;_0x855ccd[_0x4b23('0x3e')]=_['keys'](db[_0x4b23('0xbe')]['rawAttributes']);_0x855ccd[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x244e9a[_0x4b23('0x41')]);_0x855ccd[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x855ccd[_0x4b23('0x3e')],_0x855ccd[_0x4b23('0x41')]);_0x115889[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x855ccd[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x244e9a[_0x4b23('0x41')][_0x4b23('0x44')]));_0x115889[_0x4b23('0x45')]=_0x115889[_0x4b23('0x45')][_0x4b23('0x46')]?_0x115889['attributes']:_0x855ccd[_0x4b23('0x3e')];_0x115889[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x244e9a['query'][_0x4b23('0x4a')]);_0x115889[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_['pick'](_0x244e9a[_0x4b23('0x41')],_0x855ccd['filters']));if(_0x244e9a['query']['filter']){_0x115889[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x115889[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x115889[_0x4b23('0x45')],function(_0x24e47c){var _0x10a82c={};_0x10a82c[_0x24e47c]={'$like':'%'+_0x244e9a['query']['filter']+'%'};return _0x10a82c;})});}_0x115889=_[_0x4b23('0xb1')]({},_0x115889,_0x244e9a['options']);return _0x2d9b8f[_0x4b23('0xbd')](_0x115889);}})['then'](function(_0x5d23e9){if(_0x5d23e9){_0x337599=_0x5d23e9[_0x4b23('0x46')];if(!_0x244e9a['query'][_0x4b23('0x47')]('nolimit')){_0x115889[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x244e9a['query']['limit']);_0x115889['offset']=qs[_0x4b23('0x29')](_0x244e9a['query'][_0x4b23('0x29')]);}return _0x2d9b8f[_0x4b23('0xbd')](_0x115889);}})[_0x4b23('0x1c')](function(_0x3a207d){if(_0x3a207d){return _0x3a207d?{'count':_0x337599,'rows':_0x3a207d}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x994bdc,null))[_0x4b23('0x25')](handleError(_0x994bdc,null));};exports[_0x4b23('0xbf')]=function(_0x49edbf,_0x4ed101,_0x57343f){var _0x1fe3b3={};var _0x1b477c={};var _0x93d4e6;var _0x4d7067;return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x49edbf[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ed101,null))[_0x4b23('0x1c')](function(_0x32272e){if(_0x32272e){_0x93d4e6=_0x32272e;_0x1b477c[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_0x4b23('0xc0')][_0x4b23('0x3d')]);_0x1b477c[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x49edbf[_0x4b23('0x41')]);_0x1b477c['filters']=_[_0x4b23('0x43')](_0x1b477c['model'],_0x1b477c['query']);_0x1fe3b3[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x1b477c[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x49edbf[_0x4b23('0x41')][_0x4b23('0x44')]));_0x1fe3b3[_0x4b23('0x45')]=_0x1fe3b3[_0x4b23('0x45')][_0x4b23('0x46')]?_0x1fe3b3[_0x4b23('0x45')]:_0x1b477c[_0x4b23('0x3e')];_0x1fe3b3[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x49edbf['query']['sort']);_0x1fe3b3[_0x4b23('0x4b')]=qs['filters'](_['pick'](_0x49edbf[_0x4b23('0x41')],_0x1b477c['filters']));if(_0x49edbf['query'][_0x4b23('0x4c')]){_0x1fe3b3[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x1fe3b3[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x1fe3b3[_0x4b23('0x45')],function(_0x1c8e93){var _0x31e155={};_0x31e155[_0x1c8e93]={'$like':'%'+_0x49edbf[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0x31e155;})});}_0x1fe3b3=_['merge']({},_0x1fe3b3,_0x49edbf[_0x4b23('0x57')]);return _0x93d4e6['getOpenchannelInteractions'](_0x1fe3b3);}})['then'](function(_0x591ae6){if(_0x591ae6){_0x4d7067=_0x591ae6['length'];if(!_0x49edbf[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x1fe3b3['limit']=qs[_0x4b23('0x2a')](_0x49edbf['query'][_0x4b23('0x2a')]);_0x1fe3b3[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x49edbf[_0x4b23('0x41')]['offset']);}return _0x93d4e6[_0x4b23('0xbf')](_0x1fe3b3);}})[_0x4b23('0x1c')](function(_0x4a6db7){if(_0x4a6db7){return _0x4a6db7?{'count':_0x4d7067,'rows':_0x4a6db7}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x4ed101,null))['catch'](handleError(_0x4ed101,null));};exports['getMailInteractions']=function(_0x314d67,_0x2b7e1d,_0x265847){var _0x593ec0={'raw':!![],'where':{}};var _0x58df4d={};var _0x3a8339={'count':0x0,'rows':[]};return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x314d67[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x2b7e1d,null))['then'](function(_0x428c59){if(_0x428c59){_0x58df4d[_0x4b23('0x3e')]=_['keys'](db[_0x4b23('0xc1')][_0x4b23('0x3d')]);_0x58df4d['query']=_[_0x4b23('0x40')](_0x314d67[_0x4b23('0x41')]);_0x58df4d[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x58df4d[_0x4b23('0x3e')],_0x58df4d[_0x4b23('0x41')]);_0x593ec0[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x58df4d['model'],qs[_0x4b23('0x44')](_0x314d67[_0x4b23('0x41')]['fields']));_0x593ec0['attributes']=_0x593ec0[_0x4b23('0x45')][_0x4b23('0x46')]?_0x593ec0['attributes']:_0x58df4d[_0x4b23('0x3e')];if(!_0x314d67[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x593ec0[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x314d67[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x593ec0[_0x4b23('0x29')]=qs['offset'](_0x314d67[_0x4b23('0x41')][_0x4b23('0x29')]);}_0x593ec0[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x314d67['query']['sort']);_0x593ec0[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_['pick'](_0x314d67[_0x4b23('0x41')],_0x58df4d['filters']));_0x593ec0['where'][_0x4b23('0xbc')]=_0x428c59['id'];if(_0x314d67[_0x4b23('0x41')][_0x4b23('0x4c')]){_0x593ec0[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x593ec0[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x593ec0[_0x4b23('0x45')],function(_0x1b2c6a){var _0x540368={};_0x540368[_0x1b2c6a]={'$like':'%'+_0x314d67['query']['filter']+'%'};return _0x540368;})});}_0x593ec0=_[_0x4b23('0xb1')]({},_0x593ec0,_0x314d67[_0x4b23('0x57')]);return db[_0x4b23('0xc1')][_0x4b23('0x28')]({'where':_0x593ec0[_0x4b23('0x4b')]})['then'](function(_0x12790d){_0x3a8339[_0x4b23('0x28')]=_0x12790d;if(_0x314d67['query'][_0x4b23('0x51')]){_0x593ec0[_0x4b23('0x52')]=[{'all':!![]}];}return db[_0x4b23('0xc1')][_0x4b23('0x53')](_0x593ec0);})[_0x4b23('0x1c')](function(_0x50f563){_0x3a8339['rows']=_0x50f563;return _0x3a8339;});}})[_0x4b23('0x1c')](respondWithFilteredResult(_0x2b7e1d,_0x593ec0))[_0x4b23('0x25')](handleError(_0x2b7e1d,null));};exports['getSmsInteractions']=function(_0xb9e4d4,_0x582a71,_0x5552e3){var _0x30f3c3={};var _0x3fc460={};var _0x1bb589;var _0x317c50;return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0xb9e4d4['params']['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x582a71,null))[_0x4b23('0x1c')](function(_0x494003){if(_0x494003){_0x1bb589=_0x494003;_0x3fc460['model']=_[_0x4b23('0x40')](db[_0x4b23('0xc2')][_0x4b23('0x3d')]);_0x3fc460[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0xb9e4d4['query']);_0x3fc460[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x3fc460[_0x4b23('0x3e')],_0x3fc460[_0x4b23('0x41')]);_0x30f3c3[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x3fc460[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0xb9e4d4[_0x4b23('0x41')]['fields']));_0x30f3c3[_0x4b23('0x45')]=_0x30f3c3[_0x4b23('0x45')][_0x4b23('0x46')]?_0x30f3c3[_0x4b23('0x45')]:_0x3fc460[_0x4b23('0x3e')];_0x30f3c3['order']=qs[_0x4b23('0x4a')](_0xb9e4d4['query'][_0x4b23('0x4a')]);_0x30f3c3['where']=qs[_0x4b23('0x42')](_[_0x4b23('0xb0')](_0xb9e4d4['query'],_0x3fc460[_0x4b23('0x42')]));if(_0xb9e4d4['query']['filter']){_0x30f3c3[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x30f3c3[_0x4b23('0x4b')],{'$or':_['map'](_0x30f3c3[_0x4b23('0x45')],function(_0x5d2fde){var _0x174996={};_0x174996[_0x5d2fde]={'$like':'%'+_0xb9e4d4[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0x174996;})});}_0x30f3c3=_[_0x4b23('0xb1')]({},_0x30f3c3,_0xb9e4d4[_0x4b23('0x57')]);return _0x1bb589['getSmsInteractions'](_0x30f3c3);}})[_0x4b23('0x1c')](function(_0x332d82){if(_0x332d82){_0x317c50=_0x332d82[_0x4b23('0x46')];if(!_0xb9e4d4[_0x4b23('0x41')][_0x4b23('0x47')]('nolimit')){_0x30f3c3[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0xb9e4d4[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x30f3c3[_0x4b23('0x29')]=qs['offset'](_0xb9e4d4['query'][_0x4b23('0x29')]);}return _0x1bb589[_0x4b23('0xc3')](_0x30f3c3);}})[_0x4b23('0x1c')](function(_0x512b09){if(_0x512b09){return _0x512b09?{'count':_0x317c50,'rows':_0x512b09}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x582a71,null))[_0x4b23('0x25')](handleError(_0x582a71,null));};exports[_0x4b23('0xc4')]=function(_0x1ca507,_0x329fce,_0x4187ce){var _0x59521f={};var _0x2b9004={};var _0x232637;var _0x13685b;return db[_0x4b23('0x3c')]['findOne']({'where':{'id':_0x1ca507[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x329fce,null))[_0x4b23('0x1c')](function(_0x47e6bf){if(_0x47e6bf){_0x232637=_0x47e6bf;_0x2b9004['model']=_['keys'](db['FaxInteraction'][_0x4b23('0x3d')]);_0x2b9004[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x1ca507['query']);_0x2b9004[_0x4b23('0x42')]=_['intersection'](_0x2b9004['model'],_0x2b9004['query']);_0x59521f['attributes']=_['intersection'](_0x2b9004[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0x1ca507[_0x4b23('0x41')][_0x4b23('0x44')]));_0x59521f[_0x4b23('0x45')]=_0x59521f[_0x4b23('0x45')][_0x4b23('0x46')]?_0x59521f[_0x4b23('0x45')]:_0x2b9004[_0x4b23('0x3e')];_0x59521f[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x1ca507[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x59521f[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_[_0x4b23('0xb0')](_0x1ca507[_0x4b23('0x41')],_0x2b9004[_0x4b23('0x42')]));if(_0x1ca507[_0x4b23('0x41')]['filter']){_0x59521f[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x59521f[_0x4b23('0x4b')],{'$or':_['map'](_0x59521f['attributes'],function(_0x3b388f){var _0xc30e5c={};_0xc30e5c[_0x3b388f]={'$like':'%'+_0x1ca507[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0xc30e5c;})});}_0x59521f=_[_0x4b23('0xb1')]({},_0x59521f,_0x1ca507[_0x4b23('0x57')]);return _0x232637[_0x4b23('0xc4')](_0x59521f);}})['then'](function(_0x2e01ef){if(_0x2e01ef){_0x13685b=_0x2e01ef[_0x4b23('0x46')];if(!_0x1ca507[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x59521f[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x1ca507['query']['limit']);_0x59521f[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x1ca507[_0x4b23('0x41')][_0x4b23('0x29')]);}return _0x232637[_0x4b23('0xc4')](_0x59521f);}})[_0x4b23('0x1c')](function(_0x5a9060){if(_0x5a9060){return _0x5a9060?{'count':_0x13685b,'rows':_0x5a9060}:null;}})['then'](respondWithResult(_0x329fce,null))['catch'](handleError(_0x329fce,null));};exports[_0x4b23('0xc5')]=function(_0xd93df8,_0x4833c5,_0x36f614){var _0x158e1d;var _0x796bc9;var _0x3fb608;return db['User'][_0x4b23('0x38')]({'where':{'id':_0xd93df8[_0x4b23('0x55')]['id'],'role':'agent'},'attributes':['id',_0x4b23('0x39'),_0x4b23('0xc6'),_0x4b23('0xc7'),'role','internal','loginInPause']})[_0x4b23('0x1c')](handleEntityNotFound(_0x4833c5,null))[_0x4b23('0x1c')](function(_0x2f70da){if(_0x2f70da){_0x158e1d=_0x2f70da;if(_0xd93df8[_0x4b23('0x58')]['interface']){_0x3fb608=util[_0x4b23('0x65')](_0x4b23('0xc8'),_0x158e1d[_0xd93df8[_0x4b23('0x58')][_0x4b23('0x8d')]]);}else if(_0xd93df8[_0x4b23('0x58')][_0x4b23('0xc9')]){_0x3fb608=util[_0x4b23('0x65')](_0x4b23('0x9b'),_0xd93df8[_0x4b23('0x58')][_0x4b23('0xc9')]);}else{_0x3fb608=util[_0x4b23('0x65')](_0x4b23('0x9b'),_0x158e1d[_0x4b23('0x39')]);}socket['to'](util[_0x4b23('0x65')](_0x4b23('0xca'),_0x158e1d['name']))[_0x4b23('0xa0')]('user:forcelogout',{'ip':_0xd93df8[_0x4b23('0xcb')]['x-forwarded-for']||_0xd93df8[_0x4b23('0xcc')][_0x4b23('0xcd')]||_0xd93df8[_0x4b23('0xce')][_0x4b23('0xcd')]||_0xd93df8[_0x4b23('0xcc')][_0x4b23('0xce')][_0x4b23('0xcd')]});return db[_0x4b23('0xa2')][_0x4b23('0x2f')]({'where':{'membername':_0x158e1d[_0x4b23('0x39')]},'individualHooks':!![]});}})[_0x4b23('0x1c')](function(_0x4850bd){if(_0x158e1d){return _0x158e1d[_0x4b23('0xcf')]({'raw':!![]});}})[_0x4b23('0x1c')](function(_0x35ec7d){var _0xdaaa23=[];if(_0x35ec7d){_0x796bc9=_0x35ec7d;if(_0x796bc9[_0x4b23('0x46')]){for(var _0x294025=0x0;_0x294025<_0x796bc9[_0x4b23('0x46')];_0x294025++){_0xdaaa23['push']({'membername':_0x158e1d[_0x4b23('0x39')],'UserId':_0x158e1d['id'],'queue_name':_0x796bc9[_0x294025]['name'],'VoiceQueueId':_0x796bc9[_0x294025]['id'],'interface':_0x3fb608,'paused':_0x158e1d[_0x4b23('0xd0')]||![],'penalty':_0x796bc9[_0x294025][_0x4b23('0xd1')]||0x0});}return BPromise[_0x4b23('0x9c')](_0xdaaa23,function(_0x19fb25){return db['UserVoiceQueueRt'][_0x4b23('0x9d')](_0x19fb25);});}}})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x158e1d[_0x4b23('0x39')],'exitAt':null}});})[_0x4b23('0x1c')](function(_0x42d171){var _0xc50892=[];_0x42d171['forEach'](function(_0x3c19c3){_0xc50892[_0x4b23('0x9a')](_0x3c19c3[_0x4b23('0x59')]({'exitAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2'))}));});return BPromise[_0x4b23('0xd3')](_0xc50892);})[_0x4b23('0x1c')](function(){var _0x44ced7=[];var _0x574f1b=[];var _0x368d55=utils[_0x4b23('0xd4')]();var _0x33bafb={'membername':_0x158e1d[_0x4b23('0x39')],'interface':_0x3fb608,'enterAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2')),'role':_0x158e1d[_0x4b23('0x37')],'internal':_0x158e1d['internal']};_0x368d55['forEach'](function(_0x546695){_0x44ced7['push'](_['merge']({'channel':_0x546695,'type':_0x4b23('0xd5'),'data1':_0xd93df8[_0x4b23('0x58')][_0x4b23('0xd6')],'data2':_0x3fb608},_0x33bafb));if(_0x158e1d[_0x4b23('0xd0')]){_0x574f1b['push'](_[_0x4b23('0xb1')]({'channel':_0x546695,'type':_0x4b23('0xd7'),'data1':_0x4b23('0xd8')},_0x33bafb));}});return db['MemberReport'][_0x4b23('0xd9')](_0x44ced7[_0x4b23('0xda')](_0x574f1b),{'individualHooks':!![]});})[_0x4b23('0x1c')](function(){return _0x158e1d['update']({'online':!![],'lastLoginAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2')),'voicePause':_0x158e1d[_0x4b23('0xd0')]||![],'mailPause':_0x158e1d[_0x4b23('0xd0')]||![],'chatPause':_0x158e1d[_0x4b23('0xd0')]||![],'faxPause':_0x158e1d[_0x4b23('0xd0')]||![],'smsPause':_0x158e1d[_0x4b23('0xd0')]||![],'openchannelPause':_0x158e1d['loginInPause']||![],'pauseType':_0x158e1d[_0x4b23('0xd0')]?_0x4b23('0xd8'):null,'interface':_0x3fb608,'lastPauseAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2'))});})[_0x4b23('0x1c')](respondWithResult(_0x4833c5,null))[_0x4b23('0x25')](handleError(_0x4833c5,null));};exports[_0x4b23('0xdb')]=function(_0x55f173,_0x3832fd,_0x37c667){var _0x464a24;return db[_0x4b23('0x3c')]['find']({'where':{'id':_0x55f173[_0x4b23('0x55')]['id'],'role':_0x4b23('0x5e')},'attributes':['id',_0x4b23('0x39'),'role']})[_0x4b23('0x1c')](handleEntityNotFound(_0x3832fd,null))[_0x4b23('0x1c')](function(_0x41f6ad){if(_0x41f6ad){_0x464a24=_0x41f6ad;return db['UserVoiceQueueRt'][_0x4b23('0x2f')]({'where':{'membername':_0x464a24['name']},'individualHooks':!![]});}})[_0x4b23('0x1c')](function(){return db[_0x4b23('0xdc')]['findAll']({'where':{'membername':_0x464a24[_0x4b23('0x39')],'exitAt':null}});})[_0x4b23('0x1c')](function(_0x345a2a){var _0xcaae56=[];_0x345a2a[_0x4b23('0xdd')](function(_0x4dfe74){_0xcaae56[_0x4b23('0x9a')](_0x4dfe74[_0x4b23('0x59')]({'exitAt':moment()[_0x4b23('0x65')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4b23('0xd3')](_0xcaae56);})['then'](function(){return _0x464a24[_0x4b23('0x59')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x4b23('0x1c')](respondWithResult(_0x3832fd,null))[_0x4b23('0x25')](handleError(_0x3832fd,null));};exports['pause']=function(_0xd2acb6,_0x52c459,_0x1d6a72){var _0x521918;return db[_0x4b23('0xa2')][_0x4b23('0x59')]({'paused':0x1},{'where':{'UserId':_0xd2acb6[_0x4b23('0x55')]['id']},'individualHooks':!![]})[_0x4b23('0x1c')](function(){return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0xd2acb6[_0x4b23('0x55')]['id'],'role':_0x4b23('0x5e')},'attributes':['id','name','role',_0x4b23('0x66'),_0x4b23('0x8d')]});})[_0x4b23('0x1c')](handleEntityNotFound(_0x52c459,null))[_0x4b23('0x1c')](function(_0x41720a){if(_0x41720a){_0x521918=_0x41720a;return respondWithRpcPromise(_0x4b23('0xde'),_0x4b23('0xdf'),{'id':_0x521918['id'],'name':_0x521918[_0x4b23('0x39')],'pause':!![]});}})[_0x4b23('0x1c')](function(){if(_0x521918){return db[_0x4b23('0xdc')][_0x4b23('0x53')]({'where':{'membername':_0x521918[_0x4b23('0x39')],'type':_0x4b23('0xd7'),'exitAt':null}});}})[_0x4b23('0x1c')](function(_0x3bff05){if(_0x3bff05['length']){var _0x30c23d=moment()['format'](_0x4b23('0xd2'));for(var _0x26b8e1=0x0,_0x242fda=_0x3bff05[_0x4b23('0x46')];_0x26b8e1<_0x242fda;_0x26b8e1++){_0x3bff05[_0x26b8e1][_0x4b23('0xe0')]({'exitAt':_0x30c23d});}}})['then'](function(){var _0x11c83a=[];var _0x14eb97=utils[_0x4b23('0xd4')]();_0x14eb97['forEach'](function(_0x2a09b6){_0x11c83a[_0x4b23('0x9a')]({'channel':_0x2a09b6,'membername':_0x521918[_0x4b23('0x39')],'interface':_[_0x4b23('0x63')](_0x521918[_0x4b23('0x8d')])?util[_0x4b23('0x65')](_0x4b23('0x9b'),_0x521918[_0x4b23('0x39')]):_0x521918[_0x4b23('0x8d')],'type':_0x4b23('0xd7'),'enterAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2')),'data1':_0xd2acb6[_0x4b23('0x58')][_0x4b23('0xe1')]||_0x4b23('0xe2'),'role':_0x521918[_0x4b23('0x37')],'internal':_0x521918['internal']});});return db[_0x4b23('0xdc')][_0x4b23('0xd9')](_0x11c83a,{'individualHooks':!![]});})[_0x4b23('0x1c')](function(){return _0x521918[_0x4b23('0x59')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xd2acb6[_0x4b23('0x58')][_0x4b23('0xe1')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2'))});})[_0x4b23('0x1c')](respondWithResult(_0x52c459,null))[_0x4b23('0x25')](handleError(_0x52c459,null));};exports['unpause']=function(_0x2bb703,_0x5d412f,_0x1cc1c7){var _0x3271aa;return db[_0x4b23('0x3c')][_0x4b23('0x38')]({'where':{'id':_0x2bb703[_0x4b23('0x55')]['id']},'attributes':['id','name',_0x4b23('0x37'),_0x4b23('0x8c'),_0x4b23('0xe3'),'chatPause',_0x4b23('0xe4'),'openchannelPause',_0x4b23('0xe5'),_0x4b23('0xe6'),_0x4b23('0xe7')]})['then'](handleEntityNotFound(_0x5d412f,null))[_0x4b23('0x1c')](function(_0x568afb){if(_0x568afb){_0x3271aa=_0x568afb;if(_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')]&&!utils['isValidChannel'](_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')])){throw new db[(_0x4b23('0x83'))][(_0x4b23('0x84'))]('Unknown\x20channel');}switch(_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')]){case'voice':return respondWithRpcPromise('QueuePause',_0x4b23('0xe8'),{'id':_0x3271aa['id'],'name':_0x3271aa[_0x4b23('0x39')],'pause':![]})[_0x4b23('0x1c')](function(){return db['UserVoiceQueueRt'][_0x4b23('0x59')]({'paused':0x0},{'where':{'UserId':_0x3271aa['id']},'individualHooks':!![]});})[_0x4b23('0x1c')](function(){return db[_0x4b23('0xdc')]['find']({'where':{'channel':_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')],'membername':_0x3271aa[_0x4b23('0x39')],'type':_0x4b23('0xd7'),'exitAt':null}});})[_0x4b23('0x1c')](function(_0x2bbfb6){if(_0x2bbfb6){return _0x2bbfb6[_0x4b23('0x59')]({'exitAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2')),'data2':_0x4b23('0xe9')},{'individualHooks':!![]});}return null;})[_0x4b23('0x1c')](function(){return _0x3271aa[_0x4b23('0x59')]({'voicePause':![]});});case'mail':case _0x4b23('0xea'):case'fax':case _0x4b23('0xeb'):case _0x4b23('0xec'):return db['MemberReport'][_0x4b23('0x38')]({'where':{'channel':_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')],'membername':_0x3271aa['name'],'type':'PAUSE','exitAt':null}})[_0x4b23('0x1c')](function(_0x2a7e11){if(_0x2a7e11){return _0x2a7e11[_0x4b23('0x59')]({'exitAt':moment()[_0x4b23('0x65')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4b23('0xe9')},{'individualHooks':!![]});}return null;})[_0x4b23('0x1c')](function(){var _0x23f0b2={};_[_0x4b23('0xed')](_0x23f0b2,util[_0x4b23('0x65')](_0x4b23('0xee'),_0x2bb703[_0x4b23('0x58')][_0x4b23('0x96')],_0x4b23('0xef')),![]);return _0x3271aa[_0x4b23('0x59')](_0x23f0b2);});default:return respondWithRpcPromise(_0x4b23('0xde'),'unpause',{'id':_0x3271aa['id'],'name':_0x3271aa[_0x4b23('0x39')],'pause':![]})[_0x4b23('0x1c')](function(){return db[_0x4b23('0xa2')][_0x4b23('0x59')]({'paused':0x0},{'where':{'UserId':_0x3271aa['id']}});})[_0x4b23('0x1c')](function(){return db[_0x4b23('0xdc')][_0x4b23('0x53')]({'where':{'membername':_0x3271aa[_0x4b23('0x39')],'type':_0x4b23('0xd7'),'exitAt':null}});})['then'](function(_0x3a1337){var _0x4354cf=[];_0x3a1337[_0x4b23('0xdd')](function(_0x8b450d){_0x4354cf[_0x4b23('0x9a')](_0x8b450d[_0x4b23('0x59')]({'exitAt':moment()[_0x4b23('0x65')](_0x4b23('0xd2')),'data2':'manual'}));});return BPromise[_0x4b23('0xd3')](_0x4354cf);})[_0x4b23('0x1c')](function(){return _0x3271aa[_0x4b23('0x59')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x4b23('0x1c')](respondWithResult(_0x5d412f,null))[_0x4b23('0x25')](handleError(_0x5d412f,null));};exports[_0x4b23('0xf0')]=function(_0x3061a0,_0x262019,_0x102e1f){var _0x189913={};var _0x17f9b0={};var _0xdc6891;var _0x262b55;return db[_0x4b23('0x3c')][_0x4b23('0xae')]({'where':{'id':_0x3061a0[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x262019,null))[_0x4b23('0x1c')](function(_0x39d308){if(_0x39d308){_0xdc6891=_0x39d308;_0x17f9b0[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_0x4b23('0xf1')][_0x4b23('0x3d')]);_0x17f9b0[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x3061a0[_0x4b23('0x41')]);_0x17f9b0[_0x4b23('0x42')]=_[_0x4b23('0x43')](_0x17f9b0[_0x4b23('0x3e')],_0x17f9b0['query']);_0x189913[_0x4b23('0x45')]=_['intersection'](_0x17f9b0[_0x4b23('0x3e')],qs['fields'](_0x3061a0[_0x4b23('0x41')]['fields']));_0x189913[_0x4b23('0x45')]=_0x189913[_0x4b23('0x45')][_0x4b23('0x46')]?_0x189913[_0x4b23('0x45')]:_0x17f9b0[_0x4b23('0x3e')];_0x189913[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x3061a0[_0x4b23('0x41')][_0x4b23('0x4a')]);_0x189913[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_[_0x4b23('0xb0')](_0x3061a0['query'],_0x17f9b0[_0x4b23('0x42')]));if(_0x3061a0[_0x4b23('0x41')]['filter']){_0x189913[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x189913[_0x4b23('0x4b')],{'$or':_['map'](_0x189913[_0x4b23('0x45')],function(_0x253ac8){var _0x2ee5aa={};_0x2ee5aa[_0x253ac8]={'$like':'%'+_0x3061a0['query']['filter']+'%'};return _0x2ee5aa;})});}_0x189913=_[_0x4b23('0xb1')]({},_0x189913,_0x3061a0[_0x4b23('0x57')]);return _0xdc6891[_0x4b23('0xf0')](_0x189913);}})[_0x4b23('0x1c')](function(_0x3c2409){if(_0x3c2409){_0x262b55=_0x3c2409[_0x4b23('0x46')];if(!_0x3061a0[_0x4b23('0x41')][_0x4b23('0x47')](_0x4b23('0x48'))){_0x189913[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0x3061a0[_0x4b23('0x41')][_0x4b23('0x2a')]);_0x189913[_0x4b23('0x29')]=qs[_0x4b23('0x29')](_0x3061a0['query'][_0x4b23('0x29')]);}return _0xdc6891[_0x4b23('0xf0')](_0x189913);}})['then'](function(_0x10ccf3){if(_0x10ccf3){return _0x10ccf3?{'count':_0x262b55,'rows':_0x10ccf3}:null;}})['then'](respondWithResult(_0x262019,null))[_0x4b23('0x25')](handleError(_0x262019,null));};exports[_0x4b23('0xf2')]=function(_0x4647cd,_0x42fd23,_0x30136d){return db[_0x4b23('0x3c')]['find']({'where':{'id':_0x4647cd[_0x4b23('0x55')]['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x42fd23,null))[_0x4b23('0x1c')](function(_0x2c3e91){if(_0x2c3e91){return _0x2c3e91['addTeams'](_0x4647cd['body'][_0x4b23('0x5c')],_[_0x4b23('0x5d')](_0x4647cd['body'],['ids','id'])||{});}})[_0x4b23('0x1c')](respondWithResult(_0x42fd23,null))[_0x4b23('0x25')](handleError(_0x42fd23,null));};exports[_0x4b23('0xf3')]=function(_0x322c10,_0x45e830,_0x213557){var _0xb01770;return db['User']['find']({'where':{'id':_0x322c10[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x45e830,null))['then'](function(_0x58de68){if(_0x58de68){return _0x58de68['removeTeams'](_0x322c10[_0x4b23('0x41')][_0x4b23('0x5c')]);}})[_0x4b23('0x1c')](respondWithStatusCode(_0x45e830,null))[_0x4b23('0x25')](handleError(_0x45e830,null));};exports['getLists']=function(_0xb4929e,_0x4d14fa,_0x577be3){var _0x5c3224={};var _0x329533={};var _0x1523a1;var _0x50cf43;return db['User'][_0x4b23('0xae')]({'where':{'id':_0xb4929e['params']['id']}})[_0x4b23('0x1c')](handleEntityNotFound(_0x4d14fa,null))[_0x4b23('0x1c')](function(_0x28a67e){if(_0x28a67e){_0x1523a1=_0x28a67e;_0x329533[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_0x4b23('0xb2')][_0x4b23('0x3d')]);_0x329533['query']=_[_0x4b23('0x40')](_0xb4929e['query']);_0x329533[_0x4b23('0x42')]=_['intersection'](_0x329533['model'],_0x329533[_0x4b23('0x41')]);_0x5c3224[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x329533[_0x4b23('0x3e')],qs[_0x4b23('0x44')](_0xb4929e['query'][_0x4b23('0x44')]));_0x5c3224[_0x4b23('0x45')]=_0x5c3224[_0x4b23('0x45')][_0x4b23('0x46')]?_0x5c3224[_0x4b23('0x45')]:_0x329533[_0x4b23('0x3e')];_0x5c3224[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0xb4929e['query'][_0x4b23('0x4a')]);_0x5c3224[_0x4b23('0x4b')]=qs[_0x4b23('0x42')](_['pick'](_0xb4929e[_0x4b23('0x41')],_0x329533[_0x4b23('0x42')]));if(_0xb4929e[_0x4b23('0x41')][_0x4b23('0x4c')]){_0x5c3224[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x5c3224[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x5c3224[_0x4b23('0x45')],function(_0x25907d){var _0x382b68={};_0x382b68[_0x25907d]={'$like':'%'+_0xb4929e[_0x4b23('0x41')][_0x4b23('0x4c')]+'%'};return _0x382b68;})});}_0x5c3224=_[_0x4b23('0xb1')]({},_0x5c3224,_0xb4929e['options']);return _0x1523a1[_0x4b23('0xf4')](_0x5c3224);}})[_0x4b23('0x1c')](function(_0xcbb7a5){if(_0xcbb7a5){_0x50cf43=_0xcbb7a5[_0x4b23('0x46')];if(!_0xb4929e[_0x4b23('0x41')][_0x4b23('0x47')]('nolimit')){_0x5c3224[_0x4b23('0x2a')]=qs[_0x4b23('0x2a')](_0xb4929e['query']['limit']);_0x5c3224['offset']=qs[_0x4b23('0x29')](_0xb4929e[_0x4b23('0x41')][_0x4b23('0x29')]);}return _0x1523a1['getLists'](_0x5c3224);}})[_0x4b23('0x1c')](function(_0x1d397c){if(_0x1d397c){return _0x1d397c?{'count':_0x50cf43,'rows':_0x1d397c}:null;}})[_0x4b23('0x1c')](respondWithResult(_0x4d14fa,null))[_0x4b23('0x25')](handleError(_0x4d14fa,null));};exports['getAgents']=function(_0x4799fe,_0x2aa23f,_0x208c91){var _0x143acd={};var _0x94f0fe={};var _0x58f9bc;var _0x25dd99;return db[_0x4b23('0x3c')]['findOne']({'where':{'id':_0x4799fe[_0x4b23('0x55')]['id']}})['then'](handleEntityNotFound(_0x2aa23f,null))[_0x4b23('0x1c')](function(_0x3692b4){if(_0x3692b4){_0x58f9bc=_0x3692b4;_0x94f0fe[_0x4b23('0x3e')]=_[_0x4b23('0x40')](db[_0x4b23('0x3c')][_0x4b23('0x3d')]);_0x94f0fe[_0x4b23('0x41')]=_[_0x4b23('0x40')](_0x4799fe[_0x4b23('0x41')]);_0x94f0fe[_0x4b23('0x42')]=_['intersection'](_0x94f0fe['model'],_0x94f0fe[_0x4b23('0x41')]);_0x143acd[_0x4b23('0x45')]=_[_0x4b23('0x43')](_0x94f0fe[_0x4b23('0x3e')],qs['fields'](_0x4799fe['query']['fields']));_0x143acd['attributes']=_0x143acd[_0x4b23('0x45')][_0x4b23('0x46')]?_0x143acd[_0x4b23('0x45')]:_0x94f0fe['model'];_0x143acd[_0x4b23('0x49')]=qs[_0x4b23('0x4a')](_0x4799fe['query'][_0x4b23('0x4a')]);_0x143acd[_0x4b23('0x4b')]=qs['filters'](_[_0x4b23('0xb0')](_0x4799fe[_0x4b23('0x41')],_0x94f0fe[_0x4b23('0x42')]));if(_0x4799fe[_0x4b23('0x41')][_0x4b23('0x4c')]){_0x143acd[_0x4b23('0x4b')]=_[_0x4b23('0xb1')](_0x143acd[_0x4b23('0x4b')],{'$or':_[_0x4b23('0x35')](_0x143acd['attributes'],function(_0xd97d01){var _0xfd6961={};_0xfd6961[_0xd97d01]={'$like':'%'+_0x4799fe['query'][_0x4b23('0x4c')]+'%'};return _0xfd6961;})});}_0x143acd[_0x4b23('0x3e')]=db[_0x4b23('0x3c')];_0x143acd['as']=_0x4b23('0xf5');_0x143acd=_[_0x4b23('0xb1')]({},_0x143acd,_0x4799fe[_0x4b23('0x57')]);return _0x58f9bc[_0x4b23('0xcf')]({'include':[_0x143acd]});}})[_0x4b23('0x1c')](function(_0x96da87){if(_0x96da87){var _0x20bfd5={},_0x53ee08=[],_0x95754e=0x0;for(var _0x297bb6=0x0;_0x297bb6<_0x96da87[_0x4b23('0x46')];_0x297bb6+=0x1){for(var _0x70f0b5=0x0,_0x5824c6;_0x70f0b5<_0x96da87[_0x297bb6][_0x4b23('0xf5')]['length'];_0x70f0b5+=0x1){_0x5824c6=_0x96da87[_0x297bb6][_0x4b23('0xf5')][_0x70f0b5][_0x4b23('0x30')]({'plain':!![]});_0x20bfd5[_0x5824c6['id']]=_0x5824c6;}}_0x20bfd5=_['values'](_0x20bfd5);for(var _0x1e17af=qs[_0x4b23('0x29')](_0x4799fe[_0x4b23('0x41')][_0x4b23('0x29')]);_0x1e17af<_0x20bfd5[_0x4b23('0x46')]&&_0x53ee08[_0x4b23('0x46')]=_0x5a1b02){_0x579607=_0x5a1b02;_0x21c0b9=0xc8;}else{_0x21c0b9=0xce;}_0x29411f[_0x0047('0x2c')](_0x21c0b9);return _0x29411f['set'](_0x0047('0x30'),_0x5a046a+'-'+_0x579607+'/'+_0x5a1b02)[_0x0047('0x2e')](_0x42d2d4);}return null;};}function patchUpdates(_0x1deab4){return function(_0x4a65bc){try{jsonpatch[_0x0047('0x31')](_0x4a65bc,_0x1deab4,!![]);}catch(_0x52df4c){return BPromise[_0x0047('0x32')](_0x52df4c);}return _0x4a65bc[_0x0047('0x33')]();};}function saveUpdates(_0x2b0e35,_0x42448f){return function(_0x213915){if(_0x213915){return _0x213915[_0x0047('0x34')](_0x2b0e35)[_0x0047('0x35')](function(_0x410c62){return _0x410c62;});}return null;};}function removeEntity(_0x588a0c,_0x5db28b){return function(_0x46b9a9){if(_0x46b9a9){return _0x46b9a9[_0x0047('0x36')]()[_0x0047('0x35')](function(){var _0x2d2e96=_0x46b9a9['get']({'plain':!![]});var _0x5a5686=[{'name':'Users','value':_0x0047('0x37'),'ignore':!![]},{'name':_0x0047('0x38'),'value':_0x0047('0x39'),'ignore':![]},{'name':'Telephones','value':_0x0047('0x3a'),'ignore':![]}];var _0x49e9d=_(_0x5a5686)[_0x0047('0x3b')](_0x0047('0x3c'))[_0x0047('0x3d')](_0x0047('0x3e'))['value']();if(_['includes'](_0x49e9d,_0x2d2e96['role'])){return;}var _0x16a1bd=_[_0x0047('0x3f')](_0x5a5686,[_0x0047('0x3e'),_0x2d2e96[_0x0047('0x40')]])['name'];return db[_0x0047('0x41')][_0x0047('0x36')]({'where':{'type':_0x16a1bd,'resourceId':_0x2d2e96['id']}})[_0x0047('0x35')](function(){return _0x46b9a9;});})[_0x0047('0x35')](function(){_0x588a0c[_0x0047('0x2c')](0xcc)[_0x0047('0x2d')]();});}};}function handleEntityNotFound(_0x27e015,_0x2da0fb){return function(_0x28ee6d){if(!_0x28ee6d){_0x27e015['sendStatus'](0x194);}return _0x28ee6d;};}function handleError(_0x3fe264,_0x23d0ec){_0x23d0ec=_0x23d0ec||0x1f4;return function(_0x16c6cd){logger[_0x0047('0x28')](_0x16c6cd[_0x0047('0x42')]);if(_0x16c6cd[_0x0047('0x43')]){delete _0x16c6cd['name'];}_0x3fe264[_0x0047('0x2c')](_0x23d0ec)[_0x0047('0x44')](_0x16c6cd);};}exports[_0x0047('0x45')]=function(_0x13bf6f,_0x27f9e6){var _0x579693={},_0x151b2f={},_0x272d91={'count':0x0,'rows':[]};var _0x4ef40b=db[_0x0047('0x46')][_0x0047('0x47')];_0x151b2f[_0x0047('0x48')]=_['differenceBy'](_[_0x0047('0x49')](_0x4ef40b),[_0x0047('0x4a'),_0x0047('0x4b')]);_0x151b2f[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x13bf6f['query']);_0x151b2f[_0x0047('0x4d')]=_['intersection'](_0x151b2f['model'],_0x151b2f[_0x0047('0x4c')]);_0x579693['attributes']=_['intersection'](_0x151b2f[_0x0047('0x48')],qs['fields'](_0x13bf6f[_0x0047('0x4c')][_0x0047('0x4e')]));_0x579693[_0x0047('0x4f')]=_0x579693[_0x0047('0x4f')][_0x0047('0x50')]?_0x579693[_0x0047('0x4f')]:_0x151b2f[_0x0047('0x48')];if(!_0x13bf6f[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x579693[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x13bf6f['query']['limit']);_0x579693[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x13bf6f['query']['offset']);}_0x579693[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x13bf6f['query'][_0x0047('0x55')]);_0x579693[_0x0047('0x56')]=qs[_0x0047('0x4d')](_[_0x0047('0x57')](_0x13bf6f[_0x0047('0x4c')],_0x151b2f[_0x0047('0x4d')]));if(_0x13bf6f['query'][_0x0047('0x3b')]){_0x579693[_0x0047('0x56')]=_[_0x0047('0x58')](_0x579693['where'],{'$or':_['map'](_0x4ef40b,function(_0x70706b){return db[_0x0047('0x59')]['where'](db[_0x0047('0x59')]['fn'](_0x0047('0x5a'),db[_0x0047('0x59')]['col'](_0x70706b[_0x0047('0x5b')])),{'$like':db['sequelize']['fn'](_0x0047('0x5a'),'%'+_0x13bf6f['query'][_0x0047('0x3b')]+'%')});})});}_0x579693=_[_0x0047('0x58')]({},_0x579693,_0x13bf6f[_0x0047('0x5c')]);var _0x28d224={'where':_0x579693[_0x0047('0x56')]};return db[_0x0047('0x46')][_0x0047('0x5d')](_0x28d224)[_0x0047('0x35')](function(_0x5641e0){_0x272d91[_0x0047('0x5d')]=_0x5641e0;if(_0x13bf6f['query']['includeAll']){_0x579693[_0x0047('0x5e')]=[{'all':!![]}];}return db['User'][_0x0047('0x5f')](_0x579693);})[_0x0047('0x35')](function(_0x2a3012){_0x272d91['rows']=_0x2a3012;return _0x272d91;})[_0x0047('0x35')](respondWithFilteredResult(_0x27f9e6,_0x579693))[_0x0047('0x60')](handleError(_0x27f9e6,null));};exports[_0x0047('0x61')]=function(_0xf89e22,_0x2615c8){var _0x292837={'raw':![],'where':{'id':_0xf89e22[_0x0047('0x62')]['id']}},_0x4f1b33={};_0x4f1b33['model']=_['differenceBy'](_[_0x0047('0x49')](db['User'][_0x0047('0x47')]),[_0x0047('0x4a'),'salt']);_0x4f1b33['query']=_[_0x0047('0x49')](_0xf89e22[_0x0047('0x4c')]);_0x4f1b33['filters']=_[_0x0047('0x63')](_0x4f1b33['model'],_0x4f1b33[_0x0047('0x4c')]);_0x292837[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x4f1b33['model'],qs[_0x0047('0x4e')](_0xf89e22[_0x0047('0x4c')][_0x0047('0x4e')]));_0x292837[_0x0047('0x4f')]=_0x292837[_0x0047('0x4f')][_0x0047('0x50')]?_0x292837[_0x0047('0x4f')]:_0x4f1b33['model'];if(_0xf89e22[_0x0047('0x4c')][_0x0047('0x64')]){_0x292837[_0x0047('0x5e')]=[{'all':!![]}];}_0x292837=_[_0x0047('0x58')]({},_0x292837,_0xf89e22['options']);return db['User'][_0x0047('0x3f')](_0x292837)[_0x0047('0x35')](handleEntityNotFound(_0x2615c8,null))[_0x0047('0x35')](respondWithResult(_0x2615c8,null))[_0x0047('0x60')](handleError(_0x2615c8,null));};exports['bulkCreate']=function(_0x554e67,_0x1b6a01){return db[_0x0047('0x46')][_0x0047('0x65')](_0x554e67[_0x0047('0x66')],{'raw':![],'individualHooks':!![]})[_0x0047('0x35')](respondWithResult(_0x1b6a01,0xc9))[_0x0047('0x60')](handleError(_0x1b6a01,null));};exports[_0x0047('0x34')]=function(_0x5d547e,_0x4c4d21){if(_0x5d547e[_0x0047('0x66')]['id']){delete _0x5d547e[_0x0047('0x66')]['id'];}delete _0x5d547e['body']['role'];return db[_0x0047('0x46')]['find']({'where':{'id':_0x5d547e['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x4c4d21,null))[_0x0047('0x35')](saveUpdates(_0x5d547e['body'],null))['then'](respondWithResult(_0x4c4d21,null))['catch'](handleError(_0x4c4d21,null));};exports[_0x0047('0x67')]=function(_0x381de7,_0x307fe8){return db[_0x0047('0x46')][_0x0047('0x67')]()[_0x0047('0x35')](respondWithResult(_0x307fe8,null))['catch'](handleError(_0x307fe8,null));};exports[_0x0047('0x68')]=function(_0x26e7c5,_0x240f51,_0x2e1e12){return db[_0x0047('0x46')]['find']({'where':{'id':_0x26e7c5['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x240f51,null))['then'](function(_0x176bc6){if(_0x176bc6){return _0x176bc6['addContacts'](_0x26e7c5[_0x0047('0x66')][_0x0047('0x69')],_[_0x0047('0x6a')](_0x26e7c5['body'],[_0x0047('0x69'),'id'])||{});}})[_0x0047('0x35')](respondWithResult(_0x240f51,null))[_0x0047('0x60')](handleError(_0x240f51,null));};var getLicense=function(_0x1706f4){return new BPromise(function(_0x160e50,_0x27e821){var _0x834edc=0x0;_0x1706f4[_0x0047('0x66')][_0x0047('0x40')]===_0x0047('0x39')&&_0x160e50(_0x0047('0x6b'));return db['User'][_0x0047('0x5d')]({'where':{'$or':[{'role':_0x1706f4[_0x0047('0x66')]['role']===_0x0047('0x3a')?'telephone':[_0x0047('0x6c'),_0x0047('0x37')]}]}})[_0x0047('0x35')](function(_0x25865e){_0x834edc=_0x25865e;return require(_0x0047('0x6d'))[_0x0047('0x6e')]();})['then'](function(_0x1d7c9e){var _0x1b9380=_0x1706f4[_0x0047('0x66')][_0x0047('0x40')]===_0x0047('0x3a')?'telephones':_0x0047('0x6f');if(!_[_0x0047('0x70')](_0x1d7c9e[_0x1b9380])&&_0x834edc>=_0x1d7c9e[_0x1b9380]){return _0x27e821({'message':_0x0047('0x71')});}return _0x160e50(util[_0x0047('0x72')](_0x0047('0x73'),_0x1b9380,_0x834edc));})['catch'](function(_0x3a4c5d){return _0x27e821(_0x3a4c5d);});});};exports['create']=function(_0x4449b3,_0x168483){return getLicense(_0x4449b3)['then'](function(_0x11f9a8){if(!_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]){var _0x340f9e;return db[_0x0047('0x75')]['findById'](0x1)[_0x0047('0x35')](function(_0x319b7f){_0x340f9e=_0x319b7f[_0x0047('0x76')];return db[_0x0047('0x46')][_0x0047('0x77')](_0x0047('0x74'));})[_0x0047('0x35')](function(_0x1fbf05){if(_[_0x0047('0x70')](_0x1fbf05)){if(_0x340f9e){_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]=_0x340f9e;}else{_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]=0x1;}}else{if(_[_0x0047('0x70')](_0x340f9e)||_0x340f9e==_0x1fbf05){_0x4449b3['body'][_0x0047('0x74')]=_0x1fbf05+0x1;}else if(_0x340f9e>_0x1fbf05){_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]=_0x340f9e;}else{return db[_0x0047('0x59')]['query'](_0x0047('0x78'),{'type':db[_0x0047('0x59')][_0x0047('0x79')][_0x0047('0x7a')]})[_0x0047('0x35')](function(_0x37e13c){if(_0x37e13c&&_0x37e13c[_0x0047('0x50')]){for(var _0x16aa8c=0x0,_0x48fe6d=_0x37e13c[_0x0047('0x50')];_0x16aa8c<_0x48fe6d&&_[_0x0047('0x70')](_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]);_0x16aa8c++){if(_0x340f9e<=_0x37e13c[_0x16aa8c][_0x0047('0x7b')]){_0x4449b3[_0x0047('0x66')]['internal']=_0x37e13c[_0x16aa8c][_0x0047('0x7b')];}else if(_0x340f9e>_0x37e13c[_0x16aa8c]['from']&&_0x340f9e<=_0x37e13c[_0x16aa8c]['to']){_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]=_0x340f9e;}}}if(_[_0x0047('0x70')](_0x4449b3[_0x0047('0x66')][_0x0047('0x74')])){_0x4449b3[_0x0047('0x66')][_0x0047('0x74')]=_0x1fbf05+0x1;}});}}});}})[_0x0047('0x35')](function(){if(_0x4449b3[_0x0047('0x66')]['voicemail']){_0x4449b3[_0x0047('0x66')][_0x0047('0x7c')]=_0x4449b3[_0x0047('0x66')]['internal'];_0x4449b3[_0x0047('0x66')][_0x0047('0x7d')]={'mailbox':_0x4449b3[_0x0047('0x66')][_0x0047('0x74')],'password':_0x4449b3['body'][_0x0047('0x4a')],'fullname':_0x4449b3[_0x0047('0x66')][_0x0047('0x7e')],'email':_0x4449b3[_0x0047('0x66')][_0x0047('0x7f')]};}if(_0x4449b3['body']&&_0x4449b3[_0x0047('0x66')]['role']==='agent'){_0x4449b3[_0x0047('0x66')][_0x0047('0x80')]=[_0x0047('0x81'),'102',_0x0047('0x82'),_0x0047('0x83'),_0x0047('0x84'),_0x0047('0x85'),_0x0047('0x86'),'107',_0x0047('0x87'),_0x0047('0x88'),'100',_0x0047('0x89')];}return db[_0x0047('0x46')]['create'](_0x4449b3[_0x0047('0x66')],{'include':[{'model':db[_0x0047('0x7d')],'as':_0x0047('0x7d')}]});})['then'](function(_0x215b5d){if(_0x4449b3['body']['role']===_0x0047('0x37'))return _0x215b5d;var _0x342ff7=_0x4449b3[_0x0047('0x37')]['get']({'plain':!![]});if(!_0x342ff7)throw new Error(_0x0047('0x8a'));if(_0x342ff7[_0x0047('0x40')]==='user'){var _0x52561b=_0x215b5d[_0x0047('0x8b')]({'plain':!![]});var _0x3783de=[{'name':_0x0047('0x38'),'value':_0x0047('0x39')},{'name':_0x0047('0x8c'),'value':'telephone'}];var _0x2f2242=_['find'](_0x3783de,['value',_0x52561b[_0x0047('0x40')]])['name'];return db['UserProfileSection'][_0x0047('0x3f')]({'where':{'name':_0x2f2242,'userProfileId':_0x342ff7[_0x0047('0x8d')]},'raw':!![]})[_0x0047('0x35')](function(_0x2cf42b){if(_0x2cf42b&&_0x2cf42b['autoAssociation']===0x0){return db[_0x0047('0x41')][_0x0047('0x8e')]({'name':_0x52561b['name'],'resourceId':_0x52561b['id'],'type':_0x2cf42b[_0x0047('0x43')],'sectionId':_0x2cf42b['id']},{})[_0x0047('0x35')](function(){return _0x215b5d;});}else{return _0x215b5d;}})[_0x0047('0x60')](function(_0x12d60d){logger[_0x0047('0x28')](_0x0047('0x8f'),_0x12d60d);throw _0x12d60d;});}return _0x215b5d;})['then'](respondWithResult(_0x168483,0xc9))[_0x0047('0x60')](handleError(_0x168483,null));};exports[_0x0047('0x90')]=function(_0x5b2e15,_0x24332b,_0x5c5418){if(_0x5b2e15[_0x0047('0x66')]['id']){delete _0x5b2e15[_0x0047('0x66')]['id'];}return db[_0x0047('0x46')]['find']({'where':{'id':_0x5b2e15[_0x0047('0x62')]['id']}})['then'](function(_0x15e98e){if(_0x15e98e){if(_0x15e98e['id']==_0x5b2e15[_0x0047('0x37')]['id']){if(!_0x5b2e15[_0x0047('0x66')][_0x0047('0x91')]||!_0x5b2e15['body'][_0x0047('0x92')]){throw new db['Sequelize'][(_0x0047('0x93'))](_0x0047('0x94'));}if(!_0x15e98e['authenticate'](_0x5b2e15[_0x0047('0x66')][_0x0047('0x91')])){throw new db[(_0x0047('0x95'))][(_0x0047('0x93'))](_0x0047('0x96'));}if(_0x5b2e15['body'][_0x0047('0x91')]==_0x5b2e15[_0x0047('0x66')][_0x0047('0x92')]){throw new db[(_0x0047('0x95'))][(_0x0047('0x93'))](_0x0047('0x97'));}return _0x15e98e;}else if(_0x5b2e15[_0x0047('0x37')]['role']==_0x0047('0x6c')){if(!_0x5b2e15['body'][_0x0047('0x92')]){throw new db[(_0x0047('0x95'))][(_0x0047('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x15e98e;}else if(_0x5b2e15[_0x0047('0x37')]['role']==_0x0047('0x37')){if(!_0x5b2e15[_0x0047('0x66')][_0x0047('0x92')]){throw new db[(_0x0047('0x95'))][(_0x0047('0x93'))](_0x0047('0x98'));}if(_0x15e98e['role']!=_0x0047('0x39')){throw new db['Sequelize'][(_0x0047('0x93'))](_0x0047('0x99'));}return _0x15e98e;}else{throw new db['Sequelize']['ValidationError'](_0x0047('0x99'));}}return null;})[_0x0047('0x35')](handleEntityNotFound(_0x24332b,null))['then'](saveUpdates({'password':_0x5b2e15[_0x0047('0x66')][_0x0047('0x92')],'passwordResetAt':_0x5b2e15[_0x0047('0x37')]['id']==_0x5b2e15['params']['id']?moment():null},null))[_0x0047('0x35')](respondWithResult(_0x24332b,null))['catch'](handleError(_0x24332b,null));};exports[_0x0047('0x9a')]=function(_0x4d3d67,_0x27cb95,_0x598905){var _0x56ccc0;return db[_0x0047('0x46')][_0x0047('0x3f')]({'where':{'id':_0x4d3d67[_0x0047('0x62')]['id']},'attributes':['id',_0x0047('0x43'),'role',_0x0047('0x9b'),_0x0047('0x9c'),_0x0047('0x9d')]})[_0x0047('0x35')](handleEntityNotFound(_0x27cb95,null))['then'](function(_0x367bc2){if(_0x367bc2){_0x56ccc0=_0x367bc2;if(!utils[_0x0047('0x9e')](_0x4d3d67[_0x0047('0x66')][_0x0047('0x9f')])){throw new db[(_0x0047('0x95'))]['ValidationError'](_0x0047('0xa0'));}return _0x367bc2[_0x0047('0xa1')+_[_0x0047('0xa2')](_0x4d3d67[_0x0047('0x66')][_0x0047('0x9f')][_0x0047('0xa3')]())+'Queues'](_0x4d3d67[_0x0047('0x66')][_0x0047('0x69')],{'penalty':_0x4d3d67['body'][_0x0047('0xa4')]||0x0});}})[_0x0047('0xa5')](function(_0x2a9732){for(var _0x3c99af=0x0;_0x3c99af<_0x4d3d67[_0x0047('0x66')][_0x0047('0x69')]['length'];_0x3c99af+=0x1){var _0x7fcf66={'UserId':_0x4d3d67[_0x0047('0x62')]['id']};_0x7fcf66[_[_0x0047('0xa2')](_0x4d3d67['body'][_0x0047('0x9f')][_0x0047('0xa3')]())+'QueueId']=_0x4d3d67[_0x0047('0x66')][_0x0047('0x69')][_0x3c99af];socket[_0x0047('0xa6')](_0x0047('0x37')+_[_0x0047('0xa2')](_0x4d3d67['body'][_0x0047('0x9f')][_0x0047('0xa3')]())+_0x0047('0xa7'),_0x7fcf66);}return _0x2a9732;})['then'](function(){if(_0x4d3d67[_0x0047('0x66')]['channel']===_0x0047('0xa8')){return db[_0x0047('0xa9')][_0x0047('0x5f')]({'where':{'id':_0x4d3d67[_0x0047('0x66')][_0x0047('0x69')]||[]},'raw':!![],'attributes':['id',_0x0047('0x43')]});}})[_0x0047('0x35')](function(_0xde40fc){var _0x33b1be=[];if(_0x4d3d67[_0x0047('0x66')]['channel']===_0x0047('0xa8')&&_0x56ccc0[_0x0047('0x40')]===_0x0047('0x39')){for(var _0x5dd282=0x0;_0x5dd282<_0xde40fc[_0x0047('0x50')];_0x5dd282+=0x1){_0x33b1be[_0x0047('0xaa')]({'membername':_0x56ccc0[_0x0047('0x43')],'UserId':_0x56ccc0['id'],'queue_name':_0xde40fc[_0x5dd282][_0x0047('0x43')],'VoiceQueueId':_0xde40fc[_0x5dd282]['id'],'interface':_['isNil'](_0x56ccc0[_0x0047('0x9d')])?util['format']('SIP/%s',_0x56ccc0[_0x0047('0x43')]):_0x56ccc0[_0x0047('0x9d')],'paused':_0x56ccc0[_0x0047('0x9c')]||![],'penalty':_0x4d3d67['body'][_0x0047('0xa4')]||0x0});}return BPromise[_0x0047('0xab')](_0x33b1be,function(_0x378e34){return db['UserVoiceQueueRt'][_0x0047('0xac')](_0x378e34);});}return _0x56ccc0;})[_0x0047('0x35')](respondWithStatusCode(_0x27cb95,null))[_0x0047('0x60')](handleError(_0x27cb95,null));};exports[_0x0047('0xad')]=function(_0x333478,_0xc91066,_0x4d7cb9){var _0x3e9e3e;return db['User']['find']({'where':{'id':_0x333478[_0x0047('0x62')]['id']},'attributes':['id',_0x0047('0x43'),_0x0047('0x40')]})[_0x0047('0x35')](handleEntityNotFound(_0xc91066,null))[_0x0047('0x35')](function(_0x5e3bdc){if(_0x5e3bdc){_0x3e9e3e=_0x5e3bdc;if(!_0x333478[_0x0047('0x4c')][_0x0047('0x9f')]||!utils[_0x0047('0x9e')](_0x333478['query']['channel'])){throw new db['Sequelize'][(_0x0047('0x93'))]('Unknown\x20channel');}return _0x5e3bdc[_0x0047('0xae')+_[_0x0047('0xa2')](_0x333478[_0x0047('0x4c')][_0x0047('0x9f')]['toLowerCase']())+'Queues'](_0x333478['query'][_0x0047('0x69')]);}})[_0x0047('0x35')](function(_0x5af369){for(var _0x48b4c3=0x0;_0x48b4c3<_0x333478[_0x0047('0x4c')][_0x0047('0x69')][_0x0047('0x50')];_0x48b4c3+=0x1){var _0x5ed769={'UserId':_0x333478['params']['id']};_0x5ed769[_[_0x0047('0xa2')](_0x333478['query']['channel']['toLowerCase']())+_0x0047('0xaf')]=_0x333478[_0x0047('0x4c')]['ids'][_0x48b4c3];socket['emit'](_0x0047('0x37')+_['capitalize'](_0x333478['query'][_0x0047('0x9f')][_0x0047('0xa3')]())+_0x0047('0xb0'),_0x5ed769);}return _0x5af369;})[_0x0047('0x35')](function(){if(_0x333478['query'][_0x0047('0x9f')]===_0x0047('0xa8')){return db['UserVoiceQueueRt'][_0x0047('0x36')]({'where':{'UserId':_0x333478[_0x0047('0x62')]['id'],'VoiceQueueId':_0x333478[_0x0047('0x4c')]['ids']},'individualHooks':!![]})['then'](function(){return _0x3e9e3e;});}return _0x3e9e3e;})['then'](respondWithStatusCode(_0xc91066,null))[_0x0047('0x60')](handleError(_0xc91066,null));};exports[_0x0047('0xb1')]=function(_0x3e503a,_0x50ab2a,_0x220fc6){_0x3e503a[_0x0047('0x66')][_0x0047('0xb2')]=_0x3e503a[_0x0047('0xb3')]['filename'];return db['User'][_0x0047('0x3f')]({'where':{'id':_0x3e503a[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x50ab2a,null))['then'](saveUpdates(_0x3e503a[_0x0047('0x66')],null))[_0x0047('0x35')](respondWithResult(_0x50ab2a,null))[_0x0047('0x60')](handleError(_0x50ab2a,null));};exports[_0x0047('0xb4')]=function(_0x4538e0,_0xcaab6a,_0x2d0cd2){var _0xc3ebe3=path[_0x0047('0xb5')](config[_0x0047('0xb6')],_0x0047('0xb7'));return db[_0x0047('0x46')][_0x0047('0x3f')]({'where':{'id':_0x4538e0[_0x0047('0x62')]['id']},'attributes':['id',_0x0047('0xb2')],'raw':!![]})[_0x0047('0x35')](handleEntityNotFound(_0xcaab6a,null))['then'](function(_0x2eb290){if(_0x2eb290){if(_[_0x0047('0x70')](_0x2eb290[_0x0047('0xb2')])){return _0xcaab6a[_0x0047('0xb8')](_0xc3ebe3);}else{if(!fs[_0x0047('0xb9')](path[_0x0047('0xb5')](config[_0x0047('0xb6')],_0x0047('0xba'),_0x2eb290[_0x0047('0xb2')]))){return _0xcaab6a[_0x0047('0xb8')](_0xc3ebe3);}return _0xcaab6a[_0x0047('0xb8')](path['join'](config['root'],_0x0047('0xba'),_0x2eb290[_0x0047('0xb2')]));}}})[_0x0047('0x60')](handleError(_0xcaab6a,null));};exports[_0x0047('0xbb')]=function(_0x512423,_0x4a3829,_0x5e4dd2){var _0x6ac346={};var _0x35fa5c={};var _0x50ffd6;var _0x233691;return db[_0x0047('0x46')]['findOne']({'where':{'id':_0x512423[_0x0047('0x62')]['id']}})['then'](handleEntityNotFound(_0x4a3829,null))[_0x0047('0x35')](function(_0xa342c3){if(_0xa342c3){_0x50ffd6=_0xa342c3;_0x35fa5c['model']=_['keys'](db[_0x0047('0xbc')][_0x0047('0x47')]);_0x35fa5c[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x512423[_0x0047('0x4c')]);_0x35fa5c['filters']=_[_0x0047('0x63')](_0x35fa5c[_0x0047('0x48')],_0x35fa5c[_0x0047('0x4c')]);_0x6ac346['attributes']=_['intersection'](_0x35fa5c['model'],qs['fields'](_0x512423[_0x0047('0x4c')]['fields']));_0x6ac346[_0x0047('0x4f')]=_0x6ac346[_0x0047('0x4f')]['length']?_0x6ac346[_0x0047('0x4f')]:_0x35fa5c['model'];_0x6ac346['order']=qs[_0x0047('0x55')](_0x512423[_0x0047('0x4c')]['sort']);_0x6ac346[_0x0047('0x56')]=qs['filters'](_[_0x0047('0x57')](_0x512423['query'],_0x35fa5c['filters']));if(_0x512423[_0x0047('0x4c')][_0x0047('0x3b')]){_0x6ac346[_0x0047('0x56')]=_['merge'](_0x6ac346['where'],{'$or':_[_0x0047('0x3d')](_0x6ac346[_0x0047('0x4f')],function(_0x122c1c){var _0x14aa53={};_0x14aa53[_0x122c1c]={'$like':'%'+_0x512423['query'][_0x0047('0x3b')]+'%'};return _0x14aa53;})});}_0x6ac346=_[_0x0047('0x58')]({},_0x6ac346,_0x512423[_0x0047('0x5c')]);return _0x50ffd6[_0x0047('0xbb')](_0x6ac346);}})[_0x0047('0x35')](function(_0x11ab63){if(_0x11ab63){_0x233691=_0x11ab63[_0x0047('0x50')];if(_0x512423[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x64'))){_0x6ac346['include']=[{'model':db[_0x0047('0xbd')],'as':_0x0047('0xbe'),'required':![]},{'model':db[_0x0047('0xbf')],'as':_0x0047('0xc0'),'attributes':['id','name',_0x0047('0xc1')],'where':_0x512423[_0x0047('0x4c')][_0x0047('0xc2')]?{'id':_0x512423[_0x0047('0x4c')][_0x0047('0xc2')]}:undefined,'required':_0x512423['query'][_0x0047('0xc2')]?!![]:![]}];}if(!_0x512423['query'][_0x0047('0x51')](_0x0047('0x52'))){_0x6ac346['limit']=qs[_0x0047('0x53')](_0x512423[_0x0047('0x4c')][_0x0047('0x53')]);_0x6ac346['offset']=qs['offset'](_0x512423[_0x0047('0x4c')]['offset']);}return _0x50ffd6['getContacts'](_0x6ac346);}})['then'](function(_0x5e0976){if(_0x5e0976){return _0x5e0976?{'count':_0x233691,'rows':_0x5e0976}:null;}})[_0x0047('0x35')](respondWithResult(_0x4a3829,null))[_0x0047('0x60')](handleError(_0x4a3829,null));};exports[_0x0047('0xc3')]=function(_0x35bb21,_0x4e85e6,_0x134dde){var _0x3d40f4;var _0x45a68b;var _0x425638={};var _0xba2e5f;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x35bb21[_0x0047('0x62')]['id']},'attributes':['id','name',_0x0047('0x40')]})[_0x0047('0x35')](handleEntityNotFound(_0x4e85e6,null))['then'](function(_0x273a86){if(!utils[_0x0047('0x9e')](_0x35bb21['query']['channel'])){throw new db[(_0x0047('0x95'))]['ValidationError']('Unknown\x20channel');}_0x3d40f4=_0x273a86;var _0x58cded={};_0x58cded[_0x0047('0x48')]=_['keys'](db[_['capitalize'](_0x35bb21[_0x0047('0x4c')]['channel'])+_0x0047('0xc5')][_0x0047('0x47')]);_0x58cded['query']=_['keys'](_0x35bb21[_0x0047('0x4c')]);_0x58cded[_0x0047('0x4d')]=_[_0x0047('0x63')](_0x58cded['model'],_0x58cded['query']);_0x425638['attributes']=_[_0x0047('0x63')](_0x58cded[_0x0047('0x48')],qs['fields'](_0x35bb21[_0x0047('0x4c')][_0x0047('0x4e')]));_0x425638[_0x0047('0x4f')]=_0x425638[_0x0047('0x4f')]['length']?_0x425638[_0x0047('0x4f')]:_0x58cded[_0x0047('0x48')];_0x425638[_0x0047('0x54')]=qs['sort'](_0x35bb21[_0x0047('0x4c')][_0x0047('0x55')]);_0x425638['where']=qs[_0x0047('0x4d')](_['pick'](_0x35bb21[_0x0047('0x4c')],_0x58cded[_0x0047('0x4d')]));if(_0x35bb21[_0x0047('0x4c')][_0x0047('0x3b')]){_0x425638['where']=_['merge'](_0x425638[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x425638['attributes'],function(_0x5eca0a){var _0x21713e={};_0x21713e[_0x5eca0a]={'$like':'%'+_0x35bb21[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x21713e;})});}_0x425638=_[_0x0047('0x58')]({},_0x425638,_0x35bb21[_0x0047('0x5c')]);switch(_0x3d40f4['role']){case _0x0047('0x6c'):return db[_[_0x0047('0xa2')](_0x35bb21[_0x0047('0x4c')][_0x0047('0x9f')])+_0x0047('0xc5')][_0x0047('0x5f')](_0x425638);case _0x0047('0x37'):case _0x0047('0x39'):return _0x3d40f4[_0x0047('0x8b')+_[_0x0047('0xa2')](_0x35bb21[_0x0047('0x4c')][_0x0047('0x9f')])+'Queues'](_0x425638);default:throw new db[(_0x0047('0x95'))]['ValidationError'](_0x0047('0xc6'));}})[_0x0047('0x35')](function(_0x2fdc09){_0xba2e5f=_0x2fdc09[_0x0047('0x50')];if(!_0x35bb21[_0x0047('0x4c')][_0x0047('0x51')]('nolimit')){_0x425638[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x35bb21['query']['limit']);_0x425638[_0x0047('0x2f')]=qs['offset'](_0x35bb21[_0x0047('0x4c')][_0x0047('0x2f')]);}switch(_0x3d40f4[_0x0047('0x40')]){case _0x0047('0x6c'):return db[_[_0x0047('0xa2')](_0x35bb21[_0x0047('0x4c')][_0x0047('0x9f')])+_0x0047('0xc5')]['findAll'](_0x425638);case'user':case _0x0047('0x39'):return _0x3d40f4[_0x0047('0x8b')+_['capitalize'](_0x35bb21[_0x0047('0x4c')][_0x0047('0x9f')])+_0x0047('0xc7')](_0x425638);}})[_0x0047('0x35')](function(_0x32a49d){return{'count':_0xba2e5f,'rows':_0x32a49d};})[_0x0047('0x35')](respondWithResult(_0x4e85e6,null))[_0x0047('0x60')](handleError(_0x4e85e6,null));};exports['getVoiceQueuesRt']=function(_0x368cec,_0x5cbd91,_0x2064fb){var _0x2c4a4f={};var _0x693342={};var _0x1fa1a6;var _0x14f1e2;return db['User'][_0x0047('0xc4')]({'where':{'id':_0x368cec[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5cbd91,null))[_0x0047('0x35')](function(_0x2f5fa5){if(_0x2f5fa5){_0x1fa1a6=_0x2f5fa5;_0x693342[_0x0047('0x48')]=_[_0x0047('0x49')](db[_0x0047('0xc8')][_0x0047('0x47')]);_0x693342[_0x0047('0x4c')]=_['keys'](_0x368cec['query']);_0x693342[_0x0047('0x4d')]=_[_0x0047('0x63')](_0x693342['model'],_0x693342[_0x0047('0x4c')]);_0x2c4a4f['attributes']=_[_0x0047('0x63')](_0x693342[_0x0047('0x48')],qs[_0x0047('0x4e')](_0x368cec['query'][_0x0047('0x4e')]));_0x2c4a4f[_0x0047('0x4f')]=_0x2c4a4f['attributes']['length']?_0x2c4a4f[_0x0047('0x4f')]:_0x693342[_0x0047('0x48')];_0x2c4a4f[_0x0047('0x54')]=qs['sort'](_0x368cec['query'][_0x0047('0x55')]);_0x2c4a4f['where']=qs['filters'](_[_0x0047('0x57')](_0x368cec[_0x0047('0x4c')],_0x693342[_0x0047('0x4d')]));if(_0x368cec[_0x0047('0x4c')][_0x0047('0x3b')]){_0x2c4a4f['where']=_[_0x0047('0x58')](_0x2c4a4f[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x2c4a4f[_0x0047('0x4f')],function(_0x390f46){var _0x226f37={};_0x226f37[_0x390f46]={'$like':'%'+_0x368cec['query'][_0x0047('0x3b')]+'%'};return _0x226f37;})});}_0x2c4a4f=_[_0x0047('0x58')]({},_0x2c4a4f,_0x368cec[_0x0047('0x5c')]);return _0x1fa1a6['getVoiceQueuesRt'](_0x2c4a4f);}})[_0x0047('0x35')](function(_0x52dca2){if(_0x52dca2){_0x14f1e2=_0x52dca2[_0x0047('0x50')];if(!_0x368cec[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x2c4a4f[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x368cec['query'][_0x0047('0x53')]);_0x2c4a4f[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x368cec[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x1fa1a6[_0x0047('0xc9')](_0x2c4a4f);}})[_0x0047('0x35')](function(_0x487cb9){if(_0x487cb9){return _0x487cb9?{'count':_0x14f1e2,'rows':_0x487cb9}:null;}})[_0x0047('0x35')](respondWithResult(_0x5cbd91,null))[_0x0047('0x60')](handleError(_0x5cbd91,null));};exports['getGroups']=function(_0x56e89c,_0x83519e,_0x105ef4){var _0x19c2cd={};var _0x1257fe={};var _0x9ba2ce;var _0x4a8deb;return db[_0x0047('0x46')]['findOne']({'where':{'id':_0x56e89c[_0x0047('0x62')]['id']}})['then'](handleEntityNotFound(_0x83519e,null))['then'](function(_0x2464b3){if(_0x2464b3){_0x9ba2ce=_0x2464b3;_0x1257fe[_0x0047('0x48')]=_[_0x0047('0x49')](db['ChatGroup'][_0x0047('0x47')]);_0x1257fe['query']=_[_0x0047('0x49')](_0x56e89c[_0x0047('0x4c')]);_0x1257fe[_0x0047('0x4d')]=_[_0x0047('0x63')](_0x1257fe['model'],_0x1257fe[_0x0047('0x4c')]);_0x19c2cd[_0x0047('0x4f')]=_['intersection'](_0x1257fe['model'],qs[_0x0047('0x4e')](_0x56e89c[_0x0047('0x4c')][_0x0047('0x4e')]));_0x19c2cd[_0x0047('0x4f')]=_0x19c2cd[_0x0047('0x4f')][_0x0047('0x50')]?_0x19c2cd['attributes']:_0x1257fe['model'];_0x19c2cd[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x56e89c['query'][_0x0047('0x55')]);_0x19c2cd[_0x0047('0x56')]=qs[_0x0047('0x4d')](_[_0x0047('0x57')](_0x56e89c['query'],_0x1257fe[_0x0047('0x4d')]));if(_0x56e89c[_0x0047('0x4c')]['filter']){_0x19c2cd[_0x0047('0x56')]=_['merge'](_0x19c2cd['where'],{'$or':_[_0x0047('0x3d')](_0x19c2cd[_0x0047('0x4f')],function(_0x332f9d){var _0x36cae0={};_0x36cae0[_0x332f9d]={'$like':'%'+_0x56e89c[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x36cae0;})});}_0x19c2cd=_[_0x0047('0x58')]({},_0x19c2cd,_0x56e89c[_0x0047('0x5c')]);return _0x9ba2ce[_0x0047('0xca')](_0x19c2cd);}})[_0x0047('0x35')](function(_0x552acb){if(_0x552acb){_0x4a8deb=_0x552acb[_0x0047('0x50')];if(!_0x56e89c[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x19c2cd[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x56e89c[_0x0047('0x4c')][_0x0047('0x53')]);_0x19c2cd[_0x0047('0x2f')]=qs['offset'](_0x56e89c['query'][_0x0047('0x2f')]);}return _0x9ba2ce[_0x0047('0xca')](_0x19c2cd);}})[_0x0047('0x35')](function(_0xe6d3a0){if(_0xe6d3a0){return _0xe6d3a0?{'count':_0x4a8deb,'rows':_0xe6d3a0}:null;}})[_0x0047('0x35')](respondWithResult(_0x83519e,null))[_0x0047('0x60')](handleError(_0x83519e,null));};exports['getRecordings']=function(_0x40cae5,_0x32fa6a,_0x53d6e7){var _0x497ed0={'raw':!![],'where':{}};var _0x587232={};var _0x5c81ca={'count':0x0,'rows':[]};return db['User'][_0x0047('0xc4')]({'where':{'id':_0x40cae5['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x32fa6a,null))['then'](function(_0x7063d){if(_0x7063d){_0x587232[_0x0047('0x48')]=_['keys'](db[_0x0047('0xcb')][_0x0047('0x47')]);_0x587232[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x40cae5[_0x0047('0x4c')]);_0x587232[_0x0047('0x4d')]=_[_0x0047('0x63')](_0x587232['model'],_0x587232[_0x0047('0x4c')]);_0x497ed0[_0x0047('0x4f')]=_['intersection'](_0x587232[_0x0047('0x48')],qs['fields'](_0x40cae5[_0x0047('0x4c')][_0x0047('0x4e')]));_0x497ed0[_0x0047('0x4f')]=_0x497ed0['attributes'][_0x0047('0x50')]?_0x497ed0['attributes']:_0x587232[_0x0047('0x48')];if(!_0x40cae5[_0x0047('0x4c')]['hasOwnProperty'](_0x0047('0x52'))){_0x497ed0[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x40cae5[_0x0047('0x4c')][_0x0047('0x53')]);_0x497ed0[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x40cae5['query'][_0x0047('0x2f')]);}_0x497ed0[_0x0047('0x54')]=qs['sort'](_0x40cae5['query'][_0x0047('0x55')]);_0x497ed0[_0x0047('0x56')]=qs[_0x0047('0x4d')](_['pick'](_0x40cae5['query'],_0x587232[_0x0047('0x4d')]));_0x497ed0[_0x0047('0x56')]['UserId']=_0x7063d['id'];if(_0x40cae5[_0x0047('0x4c')][_0x0047('0x3b')]){_0x497ed0[_0x0047('0x56')]=_[_0x0047('0x58')](_0x497ed0[_0x0047('0x56')],{'$or':_['map'](_0x497ed0[_0x0047('0x4f')],function(_0x3bfb41){var _0x306444={};_0x306444[_0x3bfb41]={'$like':'%'+_0x40cae5[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x306444;})});}_0x497ed0=_[_0x0047('0x58')]({},_0x497ed0,_0x40cae5[_0x0047('0x5c')]);return db['VoiceRecording'][_0x0047('0x5d')]({'where':_0x497ed0[_0x0047('0x56')]})[_0x0047('0x35')](function(_0x4ae23c){_0x5c81ca[_0x0047('0x5d')]=_0x4ae23c;if(_0x40cae5[_0x0047('0x4c')][_0x0047('0x64')]){_0x497ed0[_0x0047('0x5e')]=[{'all':!![]}];}return db[_0x0047('0xcb')][_0x0047('0x5f')](_0x497ed0);})[_0x0047('0x35')](function(_0x307ccd){_0x5c81ca['rows']=_0x307ccd;return _0x5c81ca;});}})[_0x0047('0x35')](respondWithFilteredResult(_0x32fa6a,_0x497ed0))['catch'](handleError(_0x32fa6a,null));};exports[_0x0047('0xcc')]=function(_0x29bbf8,_0x5178e5,_0x23b53b){var _0x8425fd={};var _0x152a24={};var _0x324530;var _0x2656ed;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x29bbf8[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5178e5,null))['then'](function(_0x3aa512){if(_0x3aa512){_0x324530=_0x3aa512;_0x152a24[_0x0047('0x48')]=_[_0x0047('0x49')](db[_0x0047('0xcd')][_0x0047('0x47')]);_0x152a24['query']=_[_0x0047('0x49')](_0x29bbf8[_0x0047('0x4c')]);_0x152a24[_0x0047('0x4d')]=_['intersection'](_0x152a24['model'],_0x152a24[_0x0047('0x4c')]);_0x8425fd['attributes']=_['intersection'](_0x152a24['model'],qs[_0x0047('0x4e')](_0x29bbf8[_0x0047('0x4c')][_0x0047('0x4e')]));_0x8425fd[_0x0047('0x4f')]=_0x8425fd[_0x0047('0x4f')][_0x0047('0x50')]?_0x8425fd[_0x0047('0x4f')]:_0x152a24['model'];_0x8425fd[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x29bbf8[_0x0047('0x4c')][_0x0047('0x55')]);_0x8425fd[_0x0047('0x56')]=qs[_0x0047('0x4d')](_[_0x0047('0x57')](_0x29bbf8['query'],_0x152a24[_0x0047('0x4d')]));if(_0x29bbf8[_0x0047('0x4c')][_0x0047('0x3b')]){_0x8425fd[_0x0047('0x56')]=_[_0x0047('0x58')](_0x8425fd[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x8425fd['attributes'],function(_0x2a4ca8){var _0x5939e0={};_0x5939e0[_0x2a4ca8]={'$like':'%'+_0x29bbf8[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x5939e0;})});}_0x8425fd=_[_0x0047('0x58')]({},_0x8425fd,_0x29bbf8[_0x0047('0x5c')]);return _0x324530[_0x0047('0xcc')](_0x8425fd);}})[_0x0047('0x35')](function(_0x42ca75){if(_0x42ca75){_0x2656ed=_0x42ca75[_0x0047('0x50')];if(!_0x29bbf8[_0x0047('0x4c')]['hasOwnProperty']('nolimit')){_0x8425fd[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x29bbf8[_0x0047('0x4c')]['limit']);_0x8425fd[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x29bbf8[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x324530[_0x0047('0xcc')](_0x8425fd);}})[_0x0047('0x35')](function(_0xd84fa7){if(_0xd84fa7){return _0xd84fa7?{'count':_0x2656ed,'rows':_0xd84fa7}:null;}})[_0x0047('0x35')](respondWithResult(_0x5178e5,null))['catch'](handleError(_0x5178e5,null));};exports['getOpenchannelInteractions']=function(_0x44a070,_0x5207df,_0x363bfc){var _0x241d70={};var _0x494190={};var _0x41a59e;var _0x53934e;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x44a070[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5207df,null))[_0x0047('0x35')](function(_0x1b410c){if(_0x1b410c){_0x41a59e=_0x1b410c;_0x494190[_0x0047('0x48')]=_[_0x0047('0x49')](db['OpenchannelInteraction'][_0x0047('0x47')]);_0x494190[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x44a070[_0x0047('0x4c')]);_0x494190[_0x0047('0x4d')]=_['intersection'](_0x494190[_0x0047('0x48')],_0x494190[_0x0047('0x4c')]);_0x241d70[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x494190[_0x0047('0x48')],qs[_0x0047('0x4e')](_0x44a070[_0x0047('0x4c')][_0x0047('0x4e')]));_0x241d70['attributes']=_0x241d70[_0x0047('0x4f')][_0x0047('0x50')]?_0x241d70['attributes']:_0x494190['model'];_0x241d70[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x44a070['query']['sort']);_0x241d70[_0x0047('0x56')]=qs['filters'](_[_0x0047('0x57')](_0x44a070[_0x0047('0x4c')],_0x494190['filters']));if(_0x44a070[_0x0047('0x4c')][_0x0047('0x3b')]){_0x241d70[_0x0047('0x56')]=_[_0x0047('0x58')](_0x241d70[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x241d70[_0x0047('0x4f')],function(_0x4015e1){var _0x1157ac={};_0x1157ac[_0x4015e1]={'$like':'%'+_0x44a070[_0x0047('0x4c')]['filter']+'%'};return _0x1157ac;})});}_0x241d70=_[_0x0047('0x58')]({},_0x241d70,_0x44a070['options']);return _0x41a59e[_0x0047('0xce')](_0x241d70);}})[_0x0047('0x35')](function(_0xc5f733){if(_0xc5f733){_0x53934e=_0xc5f733['length'];if(!_0x44a070[_0x0047('0x4c')][_0x0047('0x51')]('nolimit')){_0x241d70[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x44a070[_0x0047('0x4c')][_0x0047('0x53')]);_0x241d70[_0x0047('0x2f')]=qs['offset'](_0x44a070[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x41a59e[_0x0047('0xce')](_0x241d70);}})['then'](function(_0x408a1e){if(_0x408a1e){return _0x408a1e?{'count':_0x53934e,'rows':_0x408a1e}:null;}})[_0x0047('0x35')](respondWithResult(_0x5207df,null))[_0x0047('0x60')](handleError(_0x5207df,null));};exports[_0x0047('0xcf')]=function(_0x4acad8,_0x5b112e,_0x22bd62){var _0x5131e2={'raw':!![],'where':{}};var _0x2479c8={};var _0x293886={'count':0x0,'rows':[]};return db['User'][_0x0047('0xc4')]({'where':{'id':_0x4acad8['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5b112e,null))[_0x0047('0x35')](function(_0x58b561){if(_0x58b561){_0x2479c8[_0x0047('0x48')]=_[_0x0047('0x49')](db['MailInteraction'][_0x0047('0x47')]);_0x2479c8[_0x0047('0x4c')]=_['keys'](_0x4acad8[_0x0047('0x4c')]);_0x2479c8['filters']=_[_0x0047('0x63')](_0x2479c8[_0x0047('0x48')],_0x2479c8[_0x0047('0x4c')]);_0x5131e2[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x2479c8[_0x0047('0x48')],qs['fields'](_0x4acad8[_0x0047('0x4c')][_0x0047('0x4e')]));_0x5131e2['attributes']=_0x5131e2['attributes'][_0x0047('0x50')]?_0x5131e2['attributes']:_0x2479c8[_0x0047('0x48')];if(!_0x4acad8[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x5131e2['limit']=qs[_0x0047('0x53')](_0x4acad8[_0x0047('0x4c')][_0x0047('0x53')]);_0x5131e2['offset']=qs[_0x0047('0x2f')](_0x4acad8['query'][_0x0047('0x2f')]);}_0x5131e2[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x4acad8[_0x0047('0x4c')][_0x0047('0x55')]);_0x5131e2['where']=qs[_0x0047('0x4d')](_['pick'](_0x4acad8['query'],_0x2479c8[_0x0047('0x4d')]));_0x5131e2[_0x0047('0x56')][_0x0047('0xd0')]=_0x58b561['id'];if(_0x4acad8[_0x0047('0x4c')][_0x0047('0x3b')]){_0x5131e2[_0x0047('0x56')]=_[_0x0047('0x58')](_0x5131e2[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x5131e2[_0x0047('0x4f')],function(_0x30cab8){var _0x2607c1={};_0x2607c1[_0x30cab8]={'$like':'%'+_0x4acad8[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x2607c1;})});}_0x5131e2=_['merge']({},_0x5131e2,_0x4acad8[_0x0047('0x5c')]);return db['MailInteraction'][_0x0047('0x5d')]({'where':_0x5131e2[_0x0047('0x56')]})[_0x0047('0x35')](function(_0x445c75){_0x293886['count']=_0x445c75;if(_0x4acad8['query'][_0x0047('0x64')]){_0x5131e2[_0x0047('0x5e')]=[{'all':!![]}];}return db['MailInteraction'][_0x0047('0x5f')](_0x5131e2);})[_0x0047('0x35')](function(_0x2ddba2){_0x293886['rows']=_0x2ddba2;return _0x293886;});}})['then'](respondWithFilteredResult(_0x5b112e,_0x5131e2))[_0x0047('0x60')](handleError(_0x5b112e,null));};exports[_0x0047('0xd1')]=function(_0x3b063f,_0x1d5557,_0x5a65cc){var _0x3448ee={};var _0x3da97a={};var _0x3fe403;var _0x1f9427;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x3b063f[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x1d5557,null))[_0x0047('0x35')](function(_0x58d617){if(_0x58d617){_0x3fe403=_0x58d617;_0x3da97a['model']=_[_0x0047('0x49')](db[_0x0047('0xd2')][_0x0047('0x47')]);_0x3da97a['query']=_[_0x0047('0x49')](_0x3b063f[_0x0047('0x4c')]);_0x3da97a['filters']=_[_0x0047('0x63')](_0x3da97a[_0x0047('0x48')],_0x3da97a[_0x0047('0x4c')]);_0x3448ee[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x3da97a[_0x0047('0x48')],qs[_0x0047('0x4e')](_0x3b063f['query'][_0x0047('0x4e')]));_0x3448ee[_0x0047('0x4f')]=_0x3448ee[_0x0047('0x4f')][_0x0047('0x50')]?_0x3448ee['attributes']:_0x3da97a[_0x0047('0x48')];_0x3448ee[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x3b063f[_0x0047('0x4c')][_0x0047('0x55')]);_0x3448ee[_0x0047('0x56')]=qs[_0x0047('0x4d')](_[_0x0047('0x57')](_0x3b063f[_0x0047('0x4c')],_0x3da97a[_0x0047('0x4d')]));if(_0x3b063f['query'][_0x0047('0x3b')]){_0x3448ee[_0x0047('0x56')]=_[_0x0047('0x58')](_0x3448ee[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x3448ee['attributes'],function(_0x2d280d){var _0xe089b5={};_0xe089b5[_0x2d280d]={'$like':'%'+_0x3b063f[_0x0047('0x4c')]['filter']+'%'};return _0xe089b5;})});}_0x3448ee=_[_0x0047('0x58')]({},_0x3448ee,_0x3b063f[_0x0047('0x5c')]);return _0x3fe403[_0x0047('0xd1')](_0x3448ee);}})[_0x0047('0x35')](function(_0x1e7ef8){if(_0x1e7ef8){_0x1f9427=_0x1e7ef8[_0x0047('0x50')];if(!_0x3b063f[_0x0047('0x4c')][_0x0047('0x51')]('nolimit')){_0x3448ee[_0x0047('0x53')]=qs['limit'](_0x3b063f[_0x0047('0x4c')][_0x0047('0x53')]);_0x3448ee[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x3b063f[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x3fe403[_0x0047('0xd1')](_0x3448ee);}})[_0x0047('0x35')](function(_0x35a756){if(_0x35a756){return _0x35a756?{'count':_0x1f9427,'rows':_0x35a756}:null;}})['then'](respondWithResult(_0x1d5557,null))[_0x0047('0x60')](handleError(_0x1d5557,null));};exports[_0x0047('0xd3')]=function(_0x514039,_0x5b3052,_0x44e117){var _0x476868={};var _0x5af551={};var _0x4d15cc;var _0x585f06;return db['User'][_0x0047('0xc4')]({'where':{'id':_0x514039[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5b3052,null))[_0x0047('0x35')](function(_0x1d0396){if(_0x1d0396){_0x4d15cc=_0x1d0396;_0x5af551['model']=_[_0x0047('0x49')](db[_0x0047('0xd4')][_0x0047('0x47')]);_0x5af551[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x514039[_0x0047('0x4c')]);_0x5af551[_0x0047('0x4d')]=_['intersection'](_0x5af551[_0x0047('0x48')],_0x5af551[_0x0047('0x4c')]);_0x476868[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x5af551[_0x0047('0x48')],qs[_0x0047('0x4e')](_0x514039['query'][_0x0047('0x4e')]));_0x476868['attributes']=_0x476868[_0x0047('0x4f')]['length']?_0x476868['attributes']:_0x5af551['model'];_0x476868['order']=qs[_0x0047('0x55')](_0x514039['query']['sort']);_0x476868[_0x0047('0x56')]=qs[_0x0047('0x4d')](_[_0x0047('0x57')](_0x514039[_0x0047('0x4c')],_0x5af551[_0x0047('0x4d')]));if(_0x514039['query'][_0x0047('0x3b')]){_0x476868['where']=_[_0x0047('0x58')](_0x476868[_0x0047('0x56')],{'$or':_['map'](_0x476868[_0x0047('0x4f')],function(_0x29856f){var _0x2f6991={};_0x2f6991[_0x29856f]={'$like':'%'+_0x514039[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x2f6991;})});}_0x476868=_[_0x0047('0x58')]({},_0x476868,_0x514039[_0x0047('0x5c')]);return _0x4d15cc[_0x0047('0xd3')](_0x476868);}})[_0x0047('0x35')](function(_0x5d707a){if(_0x5d707a){_0x585f06=_0x5d707a['length'];if(!_0x514039[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x476868['limit']=qs[_0x0047('0x53')](_0x514039[_0x0047('0x4c')][_0x0047('0x53')]);_0x476868[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x514039[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x4d15cc['getFaxInteractions'](_0x476868);}})['then'](function(_0x2a5eb7){if(_0x2a5eb7){return _0x2a5eb7?{'count':_0x585f06,'rows':_0x2a5eb7}:null;}})['then'](respondWithResult(_0x5b3052,null))[_0x0047('0x60')](handleError(_0x5b3052,null));};exports['login']=function(_0x3da4da,_0x4ee077,_0x2033b4){var _0x471076;var _0x4ac1dd;var _0xb8feeb;return db[_0x0047('0x46')][_0x0047('0x3f')]({'where':{'id':_0x3da4da[_0x0047('0x62')]['id'],'role':'agent'},'attributes':['id',_0x0047('0x43'),'phone',_0x0047('0xd5'),_0x0047('0x40'),_0x0047('0x74'),_0x0047('0x9b')]})['then'](handleEntityNotFound(_0x4ee077,null))[_0x0047('0x35')](function(_0x4f37c1){if(_0x4f37c1){_0x471076=_0x4f37c1;if(_0x3da4da[_0x0047('0x66')][_0x0047('0x9d')]){_0xb8feeb=util[_0x0047('0x72')](_0x0047('0xd6'),_0x471076[_0x3da4da[_0x0047('0x66')][_0x0047('0x9d')]]);}else if(_0x3da4da['body']['intrf']){_0xb8feeb=util['format'](_0x0047('0xd7'),_0x3da4da[_0x0047('0x66')][_0x0047('0xd8')]);}else{_0xb8feeb=util[_0x0047('0x72')](_0x0047('0xd7'),_0x471076['name']);}socket['to'](util[_0x0047('0x72')](_0x0047('0xd9'),_0x471076['name']))[_0x0047('0xa6')]('user:forcelogout',{'ip':_0x3da4da[_0x0047('0xda')][_0x0047('0xdb')]||_0x3da4da[_0x0047('0xdc')][_0x0047('0xdd')]||_0x3da4da['socket'][_0x0047('0xdd')]||_0x3da4da[_0x0047('0xdc')][_0x0047('0xde')][_0x0047('0xdd')]});return db[_0x0047('0xc8')][_0x0047('0x36')]({'where':{'membername':_0x471076[_0x0047('0x43')]},'individualHooks':!![]});}})[_0x0047('0x35')](function(_0xb00959){if(_0x471076){return _0x471076[_0x0047('0xdf')]({'raw':!![]});}})[_0x0047('0x35')](function(_0x4019da){var _0x453e4d=[];if(_0x4019da){_0x4ac1dd=_0x4019da;if(_0x4ac1dd[_0x0047('0x50')]){for(var _0x37e034=0x0;_0x37e034<_0x4ac1dd['length'];_0x37e034++){_0x453e4d[_0x0047('0xaa')]({'membername':_0x471076['name'],'UserId':_0x471076['id'],'queue_name':_0x4ac1dd[_0x37e034][_0x0047('0x43')],'VoiceQueueId':_0x4ac1dd[_0x37e034]['id'],'interface':_0xb8feeb,'paused':_0x471076[_0x0047('0x9b')]||![],'penalty':_0x4ac1dd[_0x37e034]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x453e4d,function(_0x5c47d8){return db['UserVoiceQueueRt'][_0x0047('0xac')](_0x5c47d8);});}}})[_0x0047('0x35')](function(){return db[_0x0047('0xe0')]['findAll']({'where':{'membername':_0x471076[_0x0047('0x43')],'exitAt':null}});})[_0x0047('0x35')](function(_0x32de21){var _0x10c00d=[];_0x32de21[_0x0047('0xe1')](function(_0x57ed2d){_0x10c00d[_0x0047('0xaa')](_0x57ed2d[_0x0047('0x34')]({'exitAt':moment()['format'](_0x0047('0xe2'))}));});return BPromise['all'](_0x10c00d);})[_0x0047('0x35')](function(){var _0x35ecb6=[];var _0x4656ab=[];var _0x106397=utils[_0x0047('0xe3')]();var _0x524859={'membername':_0x471076[_0x0047('0x43')],'interface':_0xb8feeb,'enterAt':moment()[_0x0047('0x72')](_0x0047('0xe2')),'role':_0x471076['role'],'internal':_0x471076[_0x0047('0x74')]};_0x106397[_0x0047('0xe1')](function(_0x571637){_0x35ecb6[_0x0047('0xaa')](_[_0x0047('0x58')]({'channel':_0x571637,'type':_0x0047('0xe4'),'data1':_0x3da4da[_0x0047('0x66')][_0x0047('0xe5')],'data2':_0xb8feeb},_0x524859));if(_0x471076[_0x0047('0x9b')]){_0x4656ab['push'](_[_0x0047('0x58')]({'channel':_0x571637,'type':_0x0047('0xe6'),'data1':_0x0047('0xe7')},_0x524859));}});return db[_0x0047('0xe0')][_0x0047('0x65')](_0x35ecb6['concat'](_0x4656ab),{'individualHooks':!![]});})[_0x0047('0x35')](function(){return _0x471076[_0x0047('0x34')]({'online':!![],'lastLoginAt':moment()['format'](_0x0047('0xe2')),'voicePause':_0x471076['loginInPause']||![],'mailPause':_0x471076[_0x0047('0x9b')]||![],'chatPause':_0x471076['loginInPause']||![],'faxPause':_0x471076['loginInPause']||![],'smsPause':_0x471076[_0x0047('0x9b')]||![],'openchannelPause':_0x471076[_0x0047('0x9b')]||![],'pauseType':_0x471076[_0x0047('0x9b')]?_0x0047('0xe7'):null,'interface':_0xb8feeb,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x4ee077,null))['catch'](handleError(_0x4ee077,null));};exports['logout']=function(_0x109760,_0x163e5d,_0x29e97c){var _0x3de1f5;return db[_0x0047('0x46')][_0x0047('0x3f')]({'where':{'id':_0x109760[_0x0047('0x62')]['id'],'role':_0x0047('0x39')},'attributes':['id',_0x0047('0x43'),_0x0047('0x40')]})[_0x0047('0x35')](handleEntityNotFound(_0x163e5d,null))[_0x0047('0x35')](function(_0x4cca4d){if(_0x4cca4d){_0x3de1f5=_0x4cca4d;return db[_0x0047('0xc8')]['destroy']({'where':{'membername':_0x3de1f5[_0x0047('0x43')]},'individualHooks':!![]});}})['then'](function(){return db[_0x0047('0xe0')][_0x0047('0x5f')]({'where':{'membername':_0x3de1f5[_0x0047('0x43')],'exitAt':null}});})[_0x0047('0x35')](function(_0x2fc78b){var _0x17cb1b=[];_0x2fc78b[_0x0047('0xe1')](function(_0x48f8f5){_0x17cb1b[_0x0047('0xaa')](_0x48f8f5['update']({'exitAt':moment()[_0x0047('0x72')](_0x0047('0xe2'))}));});return BPromise['all'](_0x17cb1b);})[_0x0047('0x35')](function(){return _0x3de1f5[_0x0047('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x0047('0x35')](respondWithResult(_0x163e5d,null))[_0x0047('0x60')](handleError(_0x163e5d,null));};exports['pause']=function(_0x48cd6c,_0x486e50,_0x2ba9c9){var _0x13d5eb;return db[_0x0047('0xc8')]['update']({'paused':0x1},{'where':{'UserId':_0x48cd6c[_0x0047('0x62')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x0047('0x3f')]({'where':{'id':_0x48cd6c[_0x0047('0x62')]['id'],'role':'agent'},'attributes':['id','name',_0x0047('0x40'),_0x0047('0x74'),_0x0047('0x9d')]});})[_0x0047('0x35')](handleEntityNotFound(_0x486e50,null))['then'](function(_0x364f7a){if(_0x364f7a){_0x13d5eb=_0x364f7a;return respondWithRpcPromise('QueuePause',_0x0047('0xe8'),{'id':_0x13d5eb['id'],'name':_0x13d5eb[_0x0047('0x43')],'pause':!![]});}})[_0x0047('0x35')](function(){if(_0x13d5eb){return db['MemberReport'][_0x0047('0x5f')]({'where':{'membername':_0x13d5eb['name'],'type':_0x0047('0xe6'),'exitAt':null}});}})[_0x0047('0x35')](function(_0x3ec06d){if(_0x3ec06d[_0x0047('0x50')]){var _0x4c7b9a=moment()['format'](_0x0047('0xe2'));for(var _0x5d31ab=0x0,_0x37fe54=_0x3ec06d[_0x0047('0x50')];_0x5d31ab<_0x37fe54;_0x5d31ab++){_0x3ec06d[_0x5d31ab][_0x0047('0xe9')]({'exitAt':_0x4c7b9a});}}})[_0x0047('0x35')](function(){var _0x3306f8=[];var _0x425560=utils['getChannels']();_0x425560['forEach'](function(_0x3b70ec){_0x3306f8['push']({'channel':_0x3b70ec,'membername':_0x13d5eb[_0x0047('0x43')],'interface':_[_0x0047('0x70')](_0x13d5eb[_0x0047('0x9d')])?util['format'](_0x0047('0xd7'),_0x13d5eb[_0x0047('0x43')]):_0x13d5eb[_0x0047('0x9d')],'type':_0x0047('0xe6'),'enterAt':moment()[_0x0047('0x72')](_0x0047('0xe2')),'data1':_0x48cd6c[_0x0047('0x66')]['type']||_0x0047('0xea'),'role':_0x13d5eb[_0x0047('0x40')],'internal':_0x13d5eb['internal']});});return db[_0x0047('0xe0')]['bulkCreate'](_0x3306f8,{'individualHooks':!![]});})[_0x0047('0x35')](function(){return _0x13d5eb['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x48cd6c[_0x0047('0x66')][_0x0047('0xeb')]||_0x0047('0xea'),'lastPauseAt':moment()[_0x0047('0x72')](_0x0047('0xe2'))});})[_0x0047('0x35')](respondWithResult(_0x486e50,null))[_0x0047('0x60')](handleError(_0x486e50,null));};exports[_0x0047('0xec')]=function(_0x249098,_0x1c3893,_0x52fe7c){var _0x237471;return db['User']['find']({'where':{'id':_0x249098[_0x0047('0x62')]['id']},'attributes':['id',_0x0047('0x43'),'role',_0x0047('0x9c'),_0x0047('0xed'),_0x0047('0xee'),_0x0047('0xef'),_0x0047('0xf0'),'smsPause',_0x0047('0xf1'),_0x0047('0xf2')]})['then'](handleEntityNotFound(_0x1c3893,null))['then'](function(_0x270c7f){if(_0x270c7f){_0x237471=_0x270c7f;if(_0x249098[_0x0047('0x66')][_0x0047('0x9f')]&&!utils[_0x0047('0x9e')](_0x249098[_0x0047('0x66')]['channel'])){throw new db[(_0x0047('0x95'))][(_0x0047('0x93'))](_0x0047('0xa0'));}switch(_0x249098[_0x0047('0x66')][_0x0047('0x9f')]){case _0x0047('0xa8'):return respondWithRpcPromise(_0x0047('0xf3'),'unpause',{'id':_0x237471['id'],'name':_0x237471[_0x0047('0x43')],'pause':![]})[_0x0047('0x35')](function(){return db[_0x0047('0xc8')]['update']({'paused':0x0},{'where':{'UserId':_0x237471['id']},'individualHooks':!![]});})[_0x0047('0x35')](function(){return db['MemberReport'][_0x0047('0x3f')]({'where':{'channel':_0x249098['body'][_0x0047('0x9f')],'membername':_0x237471['name'],'type':_0x0047('0xe6'),'exitAt':null}});})[_0x0047('0x35')](function(_0x48715d){if(_0x48715d){return _0x48715d[_0x0047('0x34')]({'exitAt':moment()['format'](_0x0047('0xe2')),'data2':_0x0047('0xf4')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x237471[_0x0047('0x34')]({'voicePause':![]});});case _0x0047('0xf5'):case _0x0047('0xf6'):case'fax':case _0x0047('0xf7'):case'openchannel':return db[_0x0047('0xe0')][_0x0047('0x3f')]({'where':{'channel':_0x249098[_0x0047('0x66')][_0x0047('0x9f')],'membername':_0x237471[_0x0047('0x43')],'type':_0x0047('0xe6'),'exitAt':null}})[_0x0047('0x35')](function(_0x48ae2a){if(_0x48ae2a){return _0x48ae2a[_0x0047('0x34')]({'exitAt':moment()['format'](_0x0047('0xe2')),'data2':_0x0047('0xf4')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x321006={};_[_0x0047('0xf8')](_0x321006,util[_0x0047('0x72')](_0x0047('0xf9'),_0x249098['body'][_0x0047('0x9f')],_0x0047('0xfa')),![]);return _0x237471[_0x0047('0x34')](_0x321006);});default:return respondWithRpcPromise(_0x0047('0xf3'),_0x0047('0xec'),{'id':_0x237471['id'],'name':_0x237471[_0x0047('0x43')],'pause':![]})[_0x0047('0x35')](function(){return db[_0x0047('0xc8')]['update']({'paused':0x0},{'where':{'UserId':_0x237471['id']}});})['then'](function(){return db['MemberReport'][_0x0047('0x5f')]({'where':{'membername':_0x237471[_0x0047('0x43')],'type':_0x0047('0xe6'),'exitAt':null}});})[_0x0047('0x35')](function(_0xdf2dac){var _0x3dc5a2=[];_0xdf2dac[_0x0047('0xe1')](function(_0x41aedd){_0x3dc5a2[_0x0047('0xaa')](_0x41aedd['update']({'exitAt':moment()[_0x0047('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0x0047('0xfb')](_0x3dc5a2);})[_0x0047('0x35')](function(){return _0x237471['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0047('0x35')](respondWithResult(_0x1c3893,null))[_0x0047('0x60')](handleError(_0x1c3893,null));};exports[_0x0047('0xfc')]=function(_0x13fa84,_0x380185,_0x38fdef){var _0x42d9eb={};var _0x40c862={};var _0x56af5b;var _0x1d4a77;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x13fa84['params']['id']}})['then'](handleEntityNotFound(_0x380185,null))[_0x0047('0x35')](function(_0x5b5cfd){if(_0x5b5cfd){_0x56af5b=_0x5b5cfd;_0x40c862[_0x0047('0x48')]=_[_0x0047('0x49')](db[_0x0047('0xfd')][_0x0047('0x47')]);_0x40c862[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x13fa84[_0x0047('0x4c')]);_0x40c862[_0x0047('0x4d')]=_[_0x0047('0x63')](_0x40c862[_0x0047('0x48')],_0x40c862[_0x0047('0x4c')]);_0x42d9eb[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x40c862['model'],qs['fields'](_0x13fa84['query']['fields']));_0x42d9eb[_0x0047('0x4f')]=_0x42d9eb['attributes'][_0x0047('0x50')]?_0x42d9eb['attributes']:_0x40c862[_0x0047('0x48')];_0x42d9eb[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x13fa84[_0x0047('0x4c')]['sort']);_0x42d9eb[_0x0047('0x56')]=qs['filters'](_[_0x0047('0x57')](_0x13fa84[_0x0047('0x4c')],_0x40c862['filters']));if(_0x13fa84['query'][_0x0047('0x3b')]){_0x42d9eb[_0x0047('0x56')]=_[_0x0047('0x58')](_0x42d9eb[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x42d9eb[_0x0047('0x4f')],function(_0x29c0d1){var _0x2a634d={};_0x2a634d[_0x29c0d1]={'$like':'%'+_0x13fa84[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x2a634d;})});}_0x42d9eb=_[_0x0047('0x58')]({},_0x42d9eb,_0x13fa84[_0x0047('0x5c')]);return _0x56af5b[_0x0047('0xfc')](_0x42d9eb);}})['then'](function(_0x61cb08){if(_0x61cb08){_0x1d4a77=_0x61cb08[_0x0047('0x50')];if(!_0x13fa84[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x42d9eb['limit']=qs['limit'](_0x13fa84[_0x0047('0x4c')][_0x0047('0x53')]);_0x42d9eb[_0x0047('0x2f')]=qs['offset'](_0x13fa84[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x56af5b['getTeams'](_0x42d9eb);}})[_0x0047('0x35')](function(_0x26425b){if(_0x26425b){return _0x26425b?{'count':_0x1d4a77,'rows':_0x26425b}:null;}})[_0x0047('0x35')](respondWithResult(_0x380185,null))[_0x0047('0x60')](handleError(_0x380185,null));};exports[_0x0047('0xfe')]=function(_0x22c93b,_0x2ad86b,_0xdd7617){return db['User'][_0x0047('0x3f')]({'where':{'id':_0x22c93b['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x2ad86b,null))[_0x0047('0x35')](function(_0x4b24d7){if(_0x4b24d7){return _0x4b24d7[_0x0047('0xfe')](_0x22c93b['body']['ids'],_[_0x0047('0x6a')](_0x22c93b['body'],[_0x0047('0x69'),'id'])||{});}})[_0x0047('0x35')](respondWithResult(_0x2ad86b,null))[_0x0047('0x60')](handleError(_0x2ad86b,null));};exports[_0x0047('0xff')]=function(_0x468271,_0x3fa607,_0x4c31cb){var _0x16905b;return db[_0x0047('0x46')][_0x0047('0x3f')]({'where':{'id':_0x468271['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x3fa607,null))[_0x0047('0x35')](function(_0x3a94b3){if(_0x3a94b3){return _0x3a94b3[_0x0047('0xff')](_0x468271[_0x0047('0x4c')][_0x0047('0x69')]);}})[_0x0047('0x35')](respondWithStatusCode(_0x3fa607,null))[_0x0047('0x60')](handleError(_0x3fa607,null));};exports[_0x0047('0x100')]=function(_0x270883,_0x5c5b87,_0x2dc10b){var _0x533b12={};var _0x3d9659={};var _0x152253;var _0xa72b80;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x270883[_0x0047('0x62')]['id']}})[_0x0047('0x35')](handleEntityNotFound(_0x5c5b87,null))[_0x0047('0x35')](function(_0x4985cd){if(_0x4985cd){_0x152253=_0x4985cd;_0x3d9659[_0x0047('0x48')]=_[_0x0047('0x49')](db[_0x0047('0xbd')][_0x0047('0x47')]);_0x3d9659[_0x0047('0x4c')]=_[_0x0047('0x49')](_0x270883['query']);_0x3d9659[_0x0047('0x4d')]=_['intersection'](_0x3d9659[_0x0047('0x48')],_0x3d9659[_0x0047('0x4c')]);_0x533b12[_0x0047('0x4f')]=_['intersection'](_0x3d9659['model'],qs[_0x0047('0x4e')](_0x270883['query'][_0x0047('0x4e')]));_0x533b12[_0x0047('0x4f')]=_0x533b12[_0x0047('0x4f')][_0x0047('0x50')]?_0x533b12[_0x0047('0x4f')]:_0x3d9659[_0x0047('0x48')];_0x533b12[_0x0047('0x54')]=qs[_0x0047('0x55')](_0x270883[_0x0047('0x4c')][_0x0047('0x55')]);_0x533b12['where']=qs['filters'](_['pick'](_0x270883[_0x0047('0x4c')],_0x3d9659[_0x0047('0x4d')]));if(_0x270883[_0x0047('0x4c')][_0x0047('0x3b')]){_0x533b12[_0x0047('0x56')]=_[_0x0047('0x58')](_0x533b12[_0x0047('0x56')],{'$or':_[_0x0047('0x3d')](_0x533b12[_0x0047('0x4f')],function(_0x1cd1b0){var _0x56c3a0={};_0x56c3a0[_0x1cd1b0]={'$like':'%'+_0x270883[_0x0047('0x4c')][_0x0047('0x3b')]+'%'};return _0x56c3a0;})});}_0x533b12=_[_0x0047('0x58')]({},_0x533b12,_0x270883[_0x0047('0x5c')]);return _0x152253[_0x0047('0x100')](_0x533b12);}})['then'](function(_0x33820d){if(_0x33820d){_0xa72b80=_0x33820d[_0x0047('0x50')];if(!_0x270883[_0x0047('0x4c')][_0x0047('0x51')](_0x0047('0x52'))){_0x533b12[_0x0047('0x53')]=qs[_0x0047('0x53')](_0x270883[_0x0047('0x4c')][_0x0047('0x53')]);_0x533b12[_0x0047('0x2f')]=qs[_0x0047('0x2f')](_0x270883[_0x0047('0x4c')][_0x0047('0x2f')]);}return _0x152253[_0x0047('0x100')](_0x533b12);}})['then'](function(_0x39ebef){if(_0x39ebef){return _0x39ebef?{'count':_0xa72b80,'rows':_0x39ebef}:null;}})[_0x0047('0x35')](respondWithResult(_0x5c5b87,null))[_0x0047('0x60')](handleError(_0x5c5b87,null));};exports['getAgents']=function(_0x962971,_0xeeb901,_0x11255c){var _0x3eef84={};var _0x89e55={};var _0x212209;var _0xe4d54a;return db[_0x0047('0x46')][_0x0047('0xc4')]({'where':{'id':_0x962971['params']['id']}})[_0x0047('0x35')](handleEntityNotFound(_0xeeb901,null))[_0x0047('0x35')](function(_0x58479b){if(_0x58479b){_0x212209=_0x58479b;_0x89e55[_0x0047('0x48')]=_[_0x0047('0x49')](db['User'][_0x0047('0x47')]);_0x89e55['query']=_[_0x0047('0x49')](_0x962971[_0x0047('0x4c')]);_0x89e55[_0x0047('0x4d')]=_['intersection'](_0x89e55[_0x0047('0x48')],_0x89e55[_0x0047('0x4c')]);_0x3eef84[_0x0047('0x4f')]=_[_0x0047('0x63')](_0x89e55[_0x0047('0x48')],qs[_0x0047('0x4e')](_0x962971[_0x0047('0x4c')]['fields']));_0x3eef84['attributes']=_0x3eef84[_0x0047('0x4f')][_0x0047('0x50')]?_0x3eef84[_0x0047('0x4f')]:_0x89e55[_0x0047('0x48')];_0x3eef84[_0x0047('0x54')]=qs['sort'](_0x962971[_0x0047('0x4c')]['sort']);_0x3eef84[_0x0047('0x56')]=qs['filters'](_[_0x0047('0x57')](_0x962971[_0x0047('0x4c')],_0x89e55['filters']));if(_0x962971[_0x0047('0x4c')][_0x0047('0x3b')]){_0x3eef84[_0x0047('0x56')]=_[_0x0047('0x58')](_0x3eef84['where'],{'$or':_[_0x0047('0x3d')](_0x3eef84['attributes'],function(_0x30af19){var _0xdffb5e={};_0xdffb5e[_0x30af19]={'$like':'%'+_0x962971['query'][_0x0047('0x3b')]+'%'};return _0xdffb5e;})});}_0x3eef84[_0x0047('0x48')]=db[_0x0047('0x46')];_0x3eef84['as']='Agents';_0x3eef84=_['merge']({},_0x3eef84,_0x962971[_0x0047('0x5c')]);return _0x212209['getVoiceQueues']({'include':[_0x3eef84]});}})['then'](function(_0x37eeba){if(_0x37eeba){var _0x3247f4={},_0x54c37c=[],_0x528175=0x0;for(var _0x41d2f2=0x0;_0x41d2f2<_0x37eeba['length'];_0x41d2f2+=0x1){for(var _0x15681a=0x0,_0x2397d3;_0x15681a<_0x37eeba[_0x41d2f2][_0x0047('0x38')]['length'];_0x15681a+=0x1){_0x2397d3=_0x37eeba[_0x41d2f2][_0x0047('0x38')][_0x15681a][_0x0047('0x8b')]({'plain':!![]});_0x3247f4[_0x2397d3['id']]=_0x2397d3;}}_0x3247f4=_[_0x0047('0x101')](_0x3247f4);for(var _0x357538=qs[_0x0047('0x2f')](_0x962971['query'][_0x0047('0x2f')]);_0x357538<_0x3247f4['length']&&_0x54c37c[_0x0047('0x50')]=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file +var _0xd8b0=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','raw','options','attributes','limit','include','model','map','ShowUser','find','where','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','length','forEach','push','format','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','set','%s%s','Pause','PAUSE','findOne','destroy','all','LoginUser','mobile','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash'];(function(_0x250b4c,_0x28b9db){var _0x387c07=function(_0x2d07ad){while(--_0x2d07ad){_0x250b4c['push'](_0x250b4c['shift']());}};_0x387c07(++_0x28b9db);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});config[_0x0d8b('0x9')]=_['defaults'](config[_0x0d8b('0x9')],{'host':_0x0d8b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8b('0x9')]));require(_0x0d8b('0xb'))[_0x0d8b('0xc')](socket);function respondWithRpcPromise(_0x1f4800,_0x28ff7f,_0x1cac62){return new BPromise(function(_0x2c5e9e,_0x28f87c){return client['request'](_0x1f4800,_0x1cac62)[_0x0d8b('0xd')](function(_0x4e0269){logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));logger[_0x0d8b('0x11')](_0x0d8b('0x12'),_0x28ff7f,_0x0d8b('0x10'),JSON[_0x0d8b('0x13')](_0x4e0269));if(_0x4e0269[_0x0d8b('0x14')]){if(_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x15')]===0x1f4){logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x28f87c(_0x4e0269['error'][_0x0d8b('0x16')]);}logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x2c5e9e(_0x4e0269['error'][_0x0d8b('0x16')]);}else{logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));_0x2c5e9e(_0x4e0269[_0x0d8b('0x17')][_0x0d8b('0x16')]);}})[_0x0d8b('0x18')](function(_0xa3612a){logger['error'](_0x0d8b('0xf'),_0x28ff7f,_0xa3612a);_0x28f87c(_0xa3612a);});});}exports[_0x0d8b('0x19')]=function(_0x196c0a){var _0x143372=this;return new Promise(function(_0x24e8ed,_0x5b709c){return db[_0x0d8b('0x1a')][_0x0d8b('0x1b')]({'raw':_0x196c0a['options']?_0x196c0a['options'][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x196c0a['options']?_0x196c0a['options']['where']||null:null,'attributes':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1e')]||null:null,'limit':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1f')]||null:null,'include':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')]?_['map'](_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x5363e3){return{'model':db[_0x5363e3[_0x0d8b('0x21')]],'as':_0x5363e3['as'],'attributes':_0x5363e3['attributes'],'include':_0x5363e3[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x5363e3[_0x0d8b('0x20')],function(_0x4fe6f9){return{'model':db[_0x4fe6f9['model']],'as':_0x4fe6f9['as'],'attributes':_0x4fe6f9[_0x0d8b('0x1e')],'include':_0x4fe6f9[_0x0d8b('0x20')]?_['map'](_0x4fe6f9[_0x0d8b('0x20')],function(_0x59aa83){return{'model':db[_0x59aa83[_0x0d8b('0x21')]],'as':_0x59aa83['as'],'attributes':_0x59aa83['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xd')](function(_0x48f24f){logger[_0x0d8b('0xe')]('GetUser',_0x196c0a);logger[_0x0d8b('0x11')]('GetUser',_0x196c0a,JSON[_0x0d8b('0x13')](_0x48f24f));_0x24e8ed(_0x48f24f);})[_0x0d8b('0x18')](function(_0x2c058d){logger['error']('GetUser',_0x2c058d['message'],_0x196c0a);_0x5b709c(_0x143372[_0x0d8b('0x14')](0x1f4,_0x2c058d['message']));});});};exports[_0x0d8b('0x23')]=function(_0x54f6f3){var _0x5d05fc=this;return new Promise(function(_0x36017a,_0x1b6920){return db[_0x0d8b('0x1a')][_0x0d8b('0x24')]({'raw':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x25')]||null:null,'attributes':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x1e')]||null:null,'include':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')]['include']?_[_0x0d8b('0x22')](_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x31ceba){return{'model':db[_0x31ceba[_0x0d8b('0x21')]],'as':_0x31ceba['as'],'attributes':_0x31ceba['attributes'],'include':_0x31ceba[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x31ceba['include'],function(_0x1180ac){return{'model':db[_0x1180ac[_0x0d8b('0x21')]],'as':_0x1180ac['as'],'attributes':_0x1180ac[_0x0d8b('0x1e')],'include':_0x1180ac[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x1180ac['include'],function(_0x497a71){return{'model':db[_0x497a71[_0x0d8b('0x21')]],'as':_0x497a71['as'],'attributes':_0x497a71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc179bd){logger[_0x0d8b('0xe')](_0x0d8b('0x23'),_0x54f6f3);logger[_0x0d8b('0x11')](_0x0d8b('0x23'),_0x54f6f3,JSON[_0x0d8b('0x13')](_0xc179bd));_0x36017a(_0xc179bd);})['catch'](function(_0x6e5bab){logger[_0x0d8b('0x14')](_0x0d8b('0x23'),_0x6e5bab[_0x0d8b('0x16')],_0x54f6f3);_0x1b6920(_0x5d05fc[_0x0d8b('0x14')](0x1f4,_0x6e5bab[_0x0d8b('0x16')]));});});};exports[_0x0d8b('0x26')]=function(_0x5c980b){var _0x1d06b6=this;return new Promise(function(_0x34acb5,_0x3fa955){var _0x1f196d;return db['User'][_0x0d8b('0x24')]({'where':_0x5c980b['options'][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),_0x0d8b('0x28'),_0x0d8b('0x29'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0x1ff17d){if(_0x1ff17d){_0x1f196d=_0x1ff17d;return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1f196d['id']},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return db['MemberReport']['findAll']({'where':{'membername':_0x1f196d['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x1a46f6){if(_0x1f196d){if(_0x1a46f6&&_0x1a46f6[_0x0d8b('0x2d')]){var _0x1e2433=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1b216d=0x0,_0x192de1=_0x1a46f6[_0x0d8b('0x2d')];_0x1b216d<_0x192de1;_0x1b216d++){_0x1a46f6[_0x1b216d]['updateAttributes']({'exitAt':_0x1e2433});}}}})[_0x0d8b('0xd')](function(){if(_0x1f196d){var _0x26941a=[];var _0x5059ad=utils['getChannels']();_0x5059ad[_0x0d8b('0x2e')](function(_0x495870){_0x26941a[_0x0d8b('0x2f')]({'channel':_0x495870,'membername':_0x1f196d['name'],'interface':_['isNil'](_0x1f196d[_0x0d8b('0x2a')])?util[_0x0d8b('0x30')]('SIP/%s',_0x1f196d['name']):_0x1f196d['interface'],'type':'PAUSE','enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data1':_0x5c980b[_0x0d8b('0x32')]['type']||_0x0d8b('0x33'),'role':_0x1f196d[_0x0d8b('0x28')],'internal':_0x1f196d[_0x0d8b('0x29')],'uniqueid':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x34')]||null});});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x26941a,{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return _0x1f196d[_0x0d8b('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x37')]||_0x0d8b('0x33'),'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))});}})[_0x0d8b('0xd')](function(_0xdfcf32){_0x34acb5(_0xdfcf32);})[_0x0d8b('0x18')](function(_0x1e162c){_0x3fa955(_0x1d06b6[_0x0d8b('0x14')](0x1f4,_0x1e162c['message']));});});};exports[_0x0d8b('0x38')]=function(_0x4d8850){var _0x5d29ab=this;return new Promise(function(_0x39a31d,_0x113fb7){var _0x3f943a;return db[_0x0d8b('0x1a')]['findOne']({'where':_0x4d8850[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27')]})[_0x0d8b('0xd')](function(_0x45cd22){if(_0x45cd22){_0x3f943a=_0x45cd22;if(_0x4d8850['body']['channel']&&!utils['isValidChannel'](_0x4d8850['body'][_0x0d8b('0x39')])){throw new Error(_0x0d8b('0x3a'));}switch(_0x4d8850['body']['channel']){case _0x0d8b('0x3b'):return db[_0x0d8b('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})['then'](function(){return db[_0x0d8b('0x35')][_0x0d8b('0x24')]({'where':{'channel':_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}});})[_0x0d8b('0xd')](function(_0x2afe34){if(_0x2afe34){return _0x2afe34['update']({'exitAt':moment()['format'](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3f943a['update']({'voicePause':![]});});case _0x0d8b('0x3d'):case _0x0d8b('0x3e'):case _0x0d8b('0x3f'):case _0x0d8b('0x40'):case'openchannel':return db[_0x0d8b('0x35')]['find']({'where':{'channel':_0x4d8850['body'][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}})['then'](function(_0x44ed23){return _0x44ed23[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});})[_0x0d8b('0xd')](function(){var _0x3978e5={};_[_0x0d8b('0x41')](_0x3978e5,util['format'](_0x0d8b('0x42'),_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],_0x0d8b('0x43')),![]);return _0x3f943a[_0x0d8b('0x2c')](_0x3978e5);});default:return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})[_0x0d8b('0xd')](function(){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x3f943a[_0x0d8b('0x27')],'type':_0x0d8b('0x44'),'exitAt':null}});})[_0x0d8b('0xd')](function(_0x23de9e){var _0x43ad22=[];_0x23de9e['forEach'](function(_0x1e1dce){_0x43ad22[_0x0d8b('0x2f')](_0x1e1dce[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':'system'}));});return BPromise['all'](_0x43ad22);})[_0x0d8b('0xd')](function(){return _0x3f943a[_0x0d8b('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0d8b('0xd')](function(_0xbbb520){_0x39a31d(_0xbbb520);})['catch'](function(_0x199122){_0x113fb7(_0x5d29ab[_0x0d8b('0x14')](0x1f4,_0x199122[_0x0d8b('0x16')]));});});};exports['LogoutUser']=function(_0x2f19f4){var _0x532a85=this;return new Promise(function(_0x2fce07,_0x3ed63e){var _0x1efce6;return db[_0x0d8b('0x1a')][_0x0d8b('0x45')]({'where':_0x2f19f4[_0x0d8b('0x1d')]['where']||{},'attributes':['id',_0x0d8b('0x27')]})['then'](function(_0x71e8d8){if(_0x71e8d8){_0x1efce6=_0x71e8d8;return db[_0x0d8b('0x2b')][_0x0d8b('0x46')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x1efce6){return db[_0x0d8b('0x35')][_0x0d8b('0x1b')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x2ccdae){if(_0x1efce6){if(_0x2ccdae&&_0x2ccdae[_0x0d8b('0x2d')]){var _0x223fd8=[];_0x2ccdae[_0x0d8b('0x2e')](function(_0x2ce282){_0x223fd8[_0x0d8b('0x2f')](_0x2ce282['update']({'exitAt':moment()['format'](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x223fd8);}}})['then'](function(){if(_0x1efce6){return _0x1efce6[_0x0d8b('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x5cc960){_0x2fce07(_0x5cc960);})[_0x0d8b('0x18')](function(_0x1c4e96){_0x3ed63e(_0x532a85['error'](0x1f4,_0x1c4e96['message']));});});};exports[_0x0d8b('0x48')]=function(_0x1c007b){var _0x70e4b2=this;return new Promise(function(_0x435090,_0x2ab72b){var _0x156859;var _0x40d265;var _0x5b4402;var _0x1ca60c;return db['User'][_0x0d8b('0x45')]({'where':_0x1c007b[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),'role',_0x0d8b('0x49'),'phone',_0x0d8b('0x29'),_0x0d8b('0x4a'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0xc5c35f){if(_0xc5c35f){_0x156859=_0xc5c35f;_0x1ca60c=_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]?_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]:util[_0x0d8b('0x30')]('SIP/%s',_0x156859[_0x0d8b('0x27')]);return db['User'][_0x0d8b('0x4b')]({'where':{'role':_0x0d8b('0x4c'),'online':!![],'id':{'$ne':_0x156859['id']}}});}})['then'](function(_0x1a62b9){if(_0x1a62b9){_0x5b4402=_0x1a62b9;return require('../../config/license/util')[_0x0d8b('0x4d')]();}})[_0x0d8b('0xd')](function(_0x24f75){if(_0x24f75&&_0x24f75[_0x0d8b('0x4e')]&&_0x5b4402>=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index bb62d55..ac348bf 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 _0x55d9=['removeListener','register','user:','./user.events','save','emit'];(function(_0x223dde,_0x2d06a4){var _0x564f87=function(_0x39d6ad){while(--_0x39d6ad){_0x223dde['push'](_0x223dde['shift']());}};_0x564f87(++_0x2d06a4);}(_0x55d9,0x87));var _0x955d=function(_0x3b1502,_0xa23e9d){_0x3b1502=_0x3b1502-0x0;var _0x1c8537=_0x55d9[_0x3b1502];return _0x1c8537;};'use strict';var UserEvents=require(_0x955d('0x0'));var events=[_0x955d('0x1'),'remove','update'];function createListener(_0x3b82df,_0x979597){return function(_0x2ee842){_0x979597[_0x955d('0x2')](_0x3b82df,_0x2ee842);};}function removeListener(_0x29f1f5,_0x28df94){return function(){UserEvents[_0x955d('0x3')](_0x29f1f5,_0x28df94);};}exports[_0x955d('0x4')]=function(_0xc55dd1){for(var _0x280cd6=0x0,_0x39d48b=events['length'];_0x280cd6<_0x39d48b;_0x280cd6++){var _0x5f38eb=events[_0x280cd6];var _0x52253e=createListener(_0x955d('0x5')+_0x5f38eb,_0xc55dd1);UserEvents['on'](_0x5f38eb,_0x52253e);}}; \ No newline at end of file +var _0x91e8=['register','length','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x5e5c07,_0x45e047){var _0x2aad0b=function(_0x630dfb){while(--_0x630dfb){_0x5e5c07['push'](_0x5e5c07['shift']());}};_0x2aad0b(++_0x45e047);}(_0x91e8,0x11a));var _0x891e=function(_0x59ae63,_0x236df1){_0x59ae63=_0x59ae63-0x0;var _0x1c486b=_0x91e8[_0x59ae63];return _0x1c486b;};'use strict';var UserEvents=require(_0x891e('0x0'));var events=[_0x891e('0x1'),_0x891e('0x2'),_0x891e('0x3')];function createListener(_0x5b5213,_0xf6c333){return function(_0x5e9e9e){_0xf6c333[_0x891e('0x4')](_0x5b5213,_0x5e9e9e);};}function removeListener(_0x3782fd,_0xce7d5b){return function(){UserEvents[_0x891e('0x5')](_0x3782fd,_0xce7d5b);};}exports[_0x891e('0x6')]=function(_0x3f52cd){for(var _0xe36afb=0x0,_0x1c055a=events[_0x891e('0x7')];_0xe36afb<_0x1c055a;_0xe36afb++){var _0x3064c6=events[_0xe36afb];var _0x26ba17=createListener(_0x891e('0x8')+_0x3064c6,_0x3f52cd);UserEvents['on'](_0x3064c6,_0x26ba17);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 888bcea..3f4a098 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 _0x1a61=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x1a61,0x1e6));var _0x11a6=function(_0x347163,_0x4365c9){_0x347163=_0x347163-0x0;var _0x3bf771=_0x1a61[_0x347163];return _0x3bf771;};'use strict';var multer=require(_0x11a6('0x0'));var util=require('util');var path=require(_0x11a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x11a6('0x2'));var router=express[_0x11a6('0x3')]();var auth=require(_0x11a6('0x4'));var interaction=require(_0x11a6('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x323f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','connect-timeout'];(function(_0x3e9592,_0x38374e){var _0x4ca6d4=function(_0x21d5f5){while(--_0x21d5f5){_0x3e9592['push'](_0x3e9592['shift']());}};_0x4ca6d4(++_0x38374e);}(_0x323f,0x1ee));var _0xf323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x323f[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var auth=require(_0xf323('0x4'));var interaction=require(_0xf323('0x5'));var config=require(_0xf323('0x6'));module[_0xf323('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 6140292..9d8c5be 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 _0x791a=['INTEGER'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x791a,0xd5));var _0xa791=function(_0x36b758,_0x472148){_0x36b758=_0x36b758-0x0;var _0x17e57d=_0x791a[_0x36b758];return _0x17e57d;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa791('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfe0f=['exports','INTEGER','sequelize'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xfe0f,0x1f1));var _0xffe0=function(_0x23debc,_0x300d47){_0x23debc=_0x23debc-0x0;var _0x3a227b=_0xfe0f[_0x23debc];return _0x3a227b;};'use strict';var Sequelize=require(_0xffe0('0x0'));module[_0xffe0('0x1')]={'penalty':{'type':Sequelize[_0xffe0('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 4846586..4e14bc9 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 _0x9354=['bluebird','request-promise','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','moment'];(function(_0x11adbd,_0x5055f5){var _0x270029=function(_0x25feb6){while(--_0x25feb6){_0x11adbd['push'](_0x11adbd['shift']());}};_0x270029(++_0x5055f5);}(_0x9354,0x96));var _0x4935=function(_0x56aa66,_0x1ddf52){_0x56aa66=_0x56aa66-0x0;var _0xeba9ff=_0x9354[_0x56aa66];return _0xeba9ff;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var attributes=require(_0x4935('0x5'));module['exports']=function(_0x46c7f9,_0x2d509b){return _0x46c7f9[_0x4935('0x6')](_0x4935('0x7'),attributes,{'tableName':_0x4935('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['moment','bluebird','./userChatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x47a0f9,_0x4a0b93){var _0xd82849=function(_0x5ed043){while(--_0x5ed043){_0x47a0f9['push'](_0x47a0f9['shift']());}};_0xd82849(++_0x4a0b93);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5be527,_0x47a3f2){_0x5be527=_0x5be527-0x0;var _0x3f0f16=_0x8f4c[_0x5be527];return _0x3f0f16;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var attributes=require(_0xc8f4('0x6'));module[_0xc8f4('0x7')]=function(_0x133764,_0x56c9b1){return _0x133764[_0xc8f4('0x8')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','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 bcbbd37..eadb67c 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 _0x7573=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1e2047,_0x3123a9){var _0x25768b=function(_0x5119da){while(--_0x5119da){_0x1e2047['push'](_0x1e2047['shift']());}};_0x25768b(++_0x3123a9);}(_0x7573,0x72));var _0x3757=function(_0x40e5ae,_0xa5f77e){_0x40e5ae=_0x40e5ae-0x0;var _0x48838f=_0x7573[_0x40e5ae];return _0x48838f;};'use strict';var _=require(_0x3757('0x0'));var util=require(_0x3757('0x1'));var moment=require(_0x3757('0x2'));var BPromise=require(_0x3757('0x3'));var rs=require(_0x3757('0x4'));var fs=require('fs');var Redis=require(_0x3757('0x5'));var db=require(_0x3757('0x6'))['db'];var utils=require(_0x3757('0x7'));var logger=require(_0x3757('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3757('0x9'));var client=jayson['client'][_0x3757('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b1212,_0x1dd3c8,_0x1d20a9){return new BPromise(function(_0xdd275a,_0x2ce77b){return client[_0x3757('0xb')](_0x5b1212,_0x1d20a9)[_0x3757('0xc')](function(_0xdc3e0a){logger[_0x3757('0xd')](_0x3757('0xe'),_0x1dd3c8,_0x3757('0xf'));logger[_0x3757('0x10')](_0x3757('0x11'),_0x1dd3c8,_0x3757('0xf'),JSON[_0x3757('0x12')](_0xdc3e0a));if(_0xdc3e0a[_0x3757('0x13')]){if(_0xdc3e0a[_0x3757('0x13')][_0x3757('0x14')]===0x1f4){logger['error'](_0x3757('0xe'),_0x1dd3c8,_0xdc3e0a['error'][_0x3757('0x15')]);return _0x2ce77b(_0xdc3e0a[_0x3757('0x13')][_0x3757('0x15')]);}logger[_0x3757('0x13')](_0x3757('0xe'),_0x1dd3c8,_0xdc3e0a['error']['message']);return _0xdd275a(_0xdc3e0a[_0x3757('0x13')][_0x3757('0x15')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1dd3c8,'request\x20sent');_0xdd275a(_0xdc3e0a[_0x3757('0x16')]['message']);}})[_0x3757('0x17')](function(_0x56053a){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1dd3c8,_0x56053a);_0x2ce77b(_0x56053a);});});} \ No newline at end of file +var _0x9230=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request'];(function(_0x26fb6e,_0xcf3b82){var _0x1597fa=function(_0x3e85ec){while(--_0x3e85ec){_0x26fb6e['push'](_0x26fb6e['shift']());}};_0x1597fa(++_0xcf3b82);}(_0x9230,0x193));var _0x0923=function(_0x225ff7,_0x16f2bd){_0x225ff7=_0x225ff7-0x0;var _0x525b33=_0x9230[_0x225ff7];return _0x525b33;};'use strict';var _=require(_0x0923('0x0'));var util=require(_0x0923('0x1'));var moment=require(_0x0923('0x2'));var BPromise=require(_0x0923('0x3'));var rs=require(_0x0923('0x4'));var fs=require('fs');var Redis=require(_0x0923('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0923('0x6'));var logger=require('../../config/logger')(_0x0923('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0923('0x8')][_0x0923('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb1be,_0x1f9e2a,_0x5937f8){return new BPromise(function(_0x2e79f8,_0x146630){return client[_0x0923('0xa')](_0x2bb1be,_0x5937f8)[_0x0923('0xb')](function(_0x35f684){logger[_0x0923('0xc')](_0x0923('0xd'),_0x1f9e2a,_0x0923('0xe'));logger[_0x0923('0xf')](_0x0923('0x10'),_0x1f9e2a,_0x0923('0xe'),JSON[_0x0923('0x11')](_0x35f684));if(_0x35f684[_0x0923('0x12')]){if(_0x35f684[_0x0923('0x12')][_0x0923('0x13')]===0x1f4){logger[_0x0923('0x12')](_0x0923('0xd'),_0x1f9e2a,_0x35f684[_0x0923('0x12')]['message']);return _0x146630(_0x35f684[_0x0923('0x12')]['message']);}logger[_0x0923('0x12')](_0x0923('0xd'),_0x1f9e2a,_0x35f684[_0x0923('0x12')]['message']);return _0x2e79f8(_0x35f684[_0x0923('0x12')][_0x0923('0x14')]);}else{logger[_0x0923('0xc')](_0x0923('0xd'),_0x1f9e2a,'request\x20sent');_0x2e79f8(_0x35f684[_0x0923('0x15')][_0x0923('0x14')]);}})[_0x0923('0x16')](function(_0x23abba){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1f9e2a,_0x23abba);_0x146630(_0x23abba);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 01f3db3..29e46b5 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 _0xea1c=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','path'];(function(_0xa72f73,_0x8058d1){var _0x190264=function(_0x547589){while(--_0x547589){_0xa72f73['push'](_0xa72f73['shift']());}};_0x190264(++_0x8058d1);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcea1('0x0'));var timeout=require(_0xcea1('0x1'));var express=require(_0xcea1('0x2'));var router=express[_0xcea1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcea1('0x4'));var config=require(_0xcea1('0x5'));module[_0xcea1('0x6')]=router; \ No newline at end of file +var _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x2542,0x169));var _0x2254=function(_0x1b77ff,_0x406516){_0x1b77ff=_0x1b77ff-0x0;var _0x3f5758=_0x2542[_0x1b77ff];return _0x3f5758;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2254('0x5'));var config=require(_0x2254('0x6'));module[_0x2254('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 691c8ab..9802e1c 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 _0x94fd=['INTEGER','STRING','sequelize'];(function(_0x1ad473,_0xd58408){var _0x2f3bd4=function(_0x32f5c8){while(--_0x32f5c8){_0x1ad473['push'](_0x1ad473['shift']());}};_0x2f3bd4(++_0xd58408);}(_0x94fd,0x14c));var _0xd94f=function(_0x6620b6,_0x190064){_0x6620b6=_0x6620b6-0x0;var _0xb2a25f=_0x94fd[_0x6620b6];return _0xb2a25f;};'use strict';var Sequelize=require(_0xd94f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd94f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd94f('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd94f('0x2')]}}; \ No newline at end of file +var _0xcaff=['STRING','sequelize','INTEGER'];(function(_0x93989d,_0xf3692b){var _0x2747f2=function(_0x599aa9){while(--_0x599aa9){_0x93989d['push'](_0x93989d['shift']());}};_0x2747f2(++_0xf3692b);}(_0xcaff,0x73));var _0xfcaf=function(_0x44ebc3,_0x4a724a){_0x44ebc3=_0x44ebc3-0x0;var _0x4abf8e=_0xcaff[_0x44ebc3];return _0x4abf8e;};'use strict';var Sequelize=require(_0xfcaf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfcaf('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfcaf('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfcaf('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e0d52a9..eff1648 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 _0x6aa7=['lodash','../../config/logger','api','moment','bluebird','./userFaxQueue.attributes','exports','UserFaxQueue'];(function(_0x5de0e3,_0xd4d12e){var _0x366689=function(_0x31ccaa){while(--_0x31ccaa){_0x5de0e3['push'](_0x5de0e3['shift']());}};_0x366689(++_0xd4d12e);}(_0x6aa7,0x178));var _0x76aa=function(_0x5bbfdf,_0x37e11c){_0x5bbfdf=_0x5bbfdf-0x0;var _0x46e6af=_0x6aa7[_0x5bbfdf];return _0x46e6af;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var attributes=require(_0x76aa('0x5'));module[_0x76aa('0x6')]=function(_0x1d6e04,_0x511588){return _0x1d6e04['define'](_0x76aa('0x7'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d9e=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','api','bluebird','./userFaxQueue.attributes'];(function(_0x5e6cae,_0x368c71){var _0x31e2d8=function(_0x462462){while(--_0x462462){_0x5e6cae['push'](_0x5e6cae['shift']());}};_0x31e2d8(++_0x368c71);}(_0x4d9e,0x18c));var _0xe4d9=function(_0xf1649d,_0x45322f){_0xf1649d=_0xf1649d-0x0;var _0x311bba=_0x4d9e[_0xf1649d];return _0x311bba;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var attributes=require(_0xe4d9('0x3'));module[_0xe4d9('0x4')]=function(_0x47a09f,_0x36b9bb){return _0x47a09f[_0xe4d9('0x5')](_0xe4d9('0x6'),attributes,{'tableName':_0xe4d9('0x7'),'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 a3d2fa7..3131fc5 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 _0x5d75=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5d75,0xfa));var _0x55d7=function(_0x43dde2,_0x45a07a){_0x43dde2=_0x43dde2-0x0;var _0x227e56=_0x5d75[_0x43dde2];return _0x227e56;};'use strict';var _=require(_0x55d7('0x0'));var util=require('util');var moment=require(_0x55d7('0x1'));var BPromise=require(_0x55d7('0x2'));var rs=require(_0x55d7('0x3'));var fs=require('fs');var Redis=require(_0x55d7('0x4'));var db=require(_0x55d7('0x5'))['db'];var utils=require(_0x55d7('0x6'));var logger=require(_0x55d7('0x7'))('rpc');var config=require(_0x55d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55d7('0x9')][_0x55d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55a659,_0x1a822e,_0x5cf505){return new BPromise(function(_0x19f876,_0x190f90){return client['request'](_0x55a659,_0x5cf505)[_0x55d7('0xb')](function(_0x194606){logger[_0x55d7('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x1a822e,_0x55d7('0xd'));logger[_0x55d7('0xe')](_0x55d7('0xf'),_0x1a822e,_0x55d7('0xd'),JSON[_0x55d7('0x10')](_0x194606));if(_0x194606[_0x55d7('0x11')]){if(_0x194606[_0x55d7('0x11')][_0x55d7('0x12')]===0x1f4){logger[_0x55d7('0x11')](_0x55d7('0x13'),_0x1a822e,_0x194606[_0x55d7('0x11')][_0x55d7('0x14')]);return _0x190f90(_0x194606[_0x55d7('0x11')]['message']);}logger[_0x55d7('0x11')](_0x55d7('0x13'),_0x1a822e,_0x194606[_0x55d7('0x11')]['message']);return _0x19f876(_0x194606[_0x55d7('0x11')][_0x55d7('0x14')]);}else{logger['info'](_0x55d7('0x13'),_0x1a822e,'request\x20sent');_0x19f876(_0x194606[_0x55d7('0x15')][_0x55d7('0x14')]);}})[_0x55d7('0x16')](function(_0x52b959){logger[_0x55d7('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x1a822e,_0x52b959);_0x190f90(_0x52b959);});});} \ No newline at end of file +var _0xa1be=['../../config/utils','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4dafe4,_0x954c4){var _0x46c2bc=function(_0x251df9){while(--_0x251df9){_0x4dafe4['push'](_0x4dafe4['shift']());}};_0x46c2bc(++_0x954c4);}(_0xa1be,0xff));var _0xea1b=function(_0x5becf5,_0x1f97c8){_0x5becf5=_0x5becf5-0x0;var _0x15edfa=_0xa1be[_0x5becf5];return _0x15edfa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea1b('0x0'));var BPromise=require(_0xea1b('0x1'));var rs=require(_0xea1b('0x2'));var fs=require('fs');var Redis=require(_0xea1b('0x3'));var db=require(_0xea1b('0x4'))['db'];var utils=require(_0xea1b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xea1b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xea1b('0x7')][_0xea1b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x385e85,_0x143771,_0x2c7ad2){return new BPromise(function(_0x23af26,_0xe612e0){return client[_0xea1b('0x9')](_0x385e85,_0x2c7ad2)[_0xea1b('0xa')](function(_0x5cd233){logger[_0xea1b('0xb')](_0xea1b('0xc'),_0x143771,'request\x20sent');logger['debug'](_0xea1b('0xd'),_0x143771,_0xea1b('0xe'),JSON[_0xea1b('0xf')](_0x5cd233));if(_0x5cd233[_0xea1b('0x10')]){if(_0x5cd233[_0xea1b('0x10')]['code']===0x1f4){logger['error'](_0xea1b('0xc'),_0x143771,_0x5cd233[_0xea1b('0x10')][_0xea1b('0x11')]);return _0xe612e0(_0x5cd233[_0xea1b('0x10')]['message']);}logger[_0xea1b('0x10')](_0xea1b('0xc'),_0x143771,_0x5cd233[_0xea1b('0x10')][_0xea1b('0x11')]);return _0x23af26(_0x5cd233[_0xea1b('0x10')]['message']);}else{logger[_0xea1b('0xb')](_0xea1b('0xc'),_0x143771,_0xea1b('0xe'));_0x23af26(_0x5cd233[_0xea1b('0x12')]['message']);}})[_0xea1b('0x13')](function(_0xb99751){logger['error'](_0xea1b('0xc'),_0x143771,_0xb99751);_0xe612e0(_0xb99751);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 79f3a9e..8217f2e 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 _0xf95f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf95f,0x142));var _0xff95=function(_0x3a32e0,_0x69a2f1){_0x3a32e0=_0x3a32e0-0x0;var _0x43ae59=_0xf95f[_0x3a32e0];return _0x43ae59;};'use strict';var multer=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var path=require(_0xff95('0x2'));var timeout=require(_0xff95('0x3'));var express=require(_0xff95('0x4'));var router=express[_0xff95('0x5')]();var auth=require(_0xff95('0x6'));var interaction=require(_0xff95('0x7'));var config=require(_0xff95('0x8'));module['exports']=router; \ No newline at end of file +var _0x1115=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1115,0x1b6));var _0x5111=function(_0x38b50e,_0x4b4cb9){_0x38b50e=_0x38b50e-0x0;var _0x5e232b=_0x1115[_0x38b50e];return _0x5e232b;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var auth=require(_0x5111('0x5'));var interaction=require(_0x5111('0x6'));var config=require(_0x5111('0x7'));module[_0x5111('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index f61b5d9..9738732 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 _0x7114=['exports','INTEGER','sequelize'];(function(_0x5d2848,_0x489dce){var _0x11467d=function(_0x1d8b4a){while(--_0x1d8b4a){_0x5d2848['push'](_0x5d2848['shift']());}};_0x11467d(++_0x489dce);}(_0x7114,0x6e));var _0x4711=function(_0x1d1e28,_0x39c1c5){_0x1d1e28=_0x1d1e28-0x0;var _0x512f15=_0x7114[_0x1d1e28];return _0x512f15;};'use strict';var Sequelize=require(_0x4711('0x0'));module[_0x4711('0x1')]={'penalty':{'type':Sequelize[_0x4711('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e42=['exports','INTEGER','sequelize'];(function(_0x1448ef,_0xf1f1d5){var _0x3eb5b4=function(_0x3811cd){while(--_0x3811cd){_0x1448ef['push'](_0x1448ef['shift']());}};_0x3eb5b4(++_0xf1f1d5);}(_0x8e42,0x134));var _0x28e4=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x8e42[_0x16eb11];return _0x3ae7ef;};'use strict';var Sequelize=require(_0x28e4('0x0'));module[_0x28e4('0x1')]={'penalty':{'type':Sequelize[_0x28e4('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 c13c46d..ead49c2 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 _0xa2cb=['moment','bluebird','request-promise','./userMailQueue.attributes','user_has_mail_queues','lodash','util','api'];(function(_0x1e6e95,_0x54261a){var _0x559183=function(_0x365471){while(--_0x365471){_0x1e6e95['push'](_0x1e6e95['shift']());}};_0x559183(++_0x54261a);}(_0xa2cb,0x7d));var _0xba2c=function(_0x47dcb4,_0x2c395a){_0x47dcb4=_0x47dcb4-0x0;var _0x356abb=_0xa2cb[_0x47dcb4];return _0x356abb;};'use strict';var _=require(_0xba2c('0x0'));var util=require(_0xba2c('0x1'));var logger=require('../../config/logger')(_0xba2c('0x2'));var moment=require(_0xba2c('0x3'));var BPromise=require(_0xba2c('0x4'));var rp=require(_0xba2c('0x5'));var attributes=require(_0xba2c('0x6'));module['exports']=function(_0x4c11ef,_0x5740b4){return _0x4c11ef['define']('UserMailQueue',attributes,{'tableName':_0xba2c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4f4=['api','moment','bluebird','request-promise','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0xb4f4,0xda));var _0x4b4f=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xb4f4[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var logger=require('../../config/logger')(_0x4b4f('0x2'));var moment=require(_0x4b4f('0x3'));var BPromise=require(_0x4b4f('0x4'));var rp=require(_0x4b4f('0x5'));var attributes=require('./userMailQueue.attributes');module[_0x4b4f('0x6')]=function(_0x40e54b,_0x2de488){return _0x40e54b[_0x4b4f('0x7')](_0x4b4f('0x8'),attributes,{'tableName':_0x4b4f('0x9'),'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 b6b2d9c..a5dfa14 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 _0x3165=['http','request','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x3165,0x13f));var _0x5316=function(_0x49f355,_0x5e1670){_0x49f355=_0x49f355-0x0;var _0x17f9fa=_0x3165[_0x49f355];return _0x17f9fa;};'use strict';var _=require(_0x5316('0x0'));var util=require(_0x5316('0x1'));var moment=require(_0x5316('0x2'));var BPromise=require(_0x5316('0x3'));var rs=require(_0x5316('0x4'));var fs=require('fs');var Redis=require(_0x5316('0x5'));var db=require(_0x5316('0x6'))['db'];var utils=require(_0x5316('0x7'));var logger=require(_0x5316('0x8'))(_0x5316('0x9'));var config=require('../../config/environment');var jayson=require(_0x5316('0xa'));var client=jayson['client'][_0x5316('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21065d,_0x53ed22,_0x109209){return new BPromise(function(_0x5257c2,_0x598a88){return client[_0x5316('0xc')](_0x21065d,_0x109209)[_0x5316('0xd')](function(_0x20c019){logger[_0x5316('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x53ed22,_0x5316('0xf'));logger[_0x5316('0x10')](_0x5316('0x11'),_0x53ed22,_0x5316('0xf'),JSON['stringify'](_0x20c019));if(_0x20c019[_0x5316('0x12')]){if(_0x20c019[_0x5316('0x12')]['code']===0x1f4){logger['error'](_0x5316('0x13'),_0x53ed22,_0x20c019[_0x5316('0x12')][_0x5316('0x14')]);return _0x598a88(_0x20c019['error'][_0x5316('0x14')]);}logger[_0x5316('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x53ed22,_0x20c019[_0x5316('0x12')][_0x5316('0x14')]);return _0x5257c2(_0x20c019['error']['message']);}else{logger[_0x5316('0xe')](_0x5316('0x13'),_0x53ed22,_0x5316('0xf'));_0x5257c2(_0x20c019['result'][_0x5316('0x14')]);}})[_0x5316('0x15')](function(_0x5e92a6){logger[_0x5316('0x12')](_0x5316('0x13'),_0x53ed22,_0x5e92a6);_0x598a88(_0x5e92a6);});});} \ No newline at end of file +var _0xe54d=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x174d77,_0x50fd92){var _0x195113=function(_0x1ce714){while(--_0x1ce714){_0x174d77['push'](_0x174d77['shift']());}};_0x195113(++_0x50fd92);}(_0xe54d,0xbe));var _0xde54=function(_0xcd32e1,_0x20fbed){_0xcd32e1=_0xcd32e1-0x0;var _0x5821d8=_0xe54d[_0xcd32e1];return _0x5821d8;};'use strict';var _=require(_0xde54('0x0'));var util=require(_0xde54('0x1'));var moment=require('moment');var BPromise=require(_0xde54('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde54('0x3'));var db=require(_0xde54('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xde54('0x5'))(_0xde54('0x6'));var config=require(_0xde54('0x7'));var jayson=require(_0xde54('0x8'));var client=jayson[_0xde54('0x9')][_0xde54('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e37f8,_0x1c3e07,_0x353c26){return new BPromise(function(_0x2c0414,_0x21bb11){return client[_0xde54('0xb')](_0x2e37f8,_0x353c26)['then'](function(_0x8e2891){logger[_0xde54('0xc')](_0xde54('0xd'),_0x1c3e07,_0xde54('0xe'));logger[_0xde54('0xf')](_0xde54('0x10'),_0x1c3e07,'request\x20sent',JSON[_0xde54('0x11')](_0x8e2891));if(_0x8e2891[_0xde54('0x12')]){if(_0x8e2891[_0xde54('0x12')][_0xde54('0x13')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x1c3e07,_0x8e2891[_0xde54('0x12')][_0xde54('0x14')]);return _0x21bb11(_0x8e2891[_0xde54('0x12')][_0xde54('0x14')]);}logger['error'](_0xde54('0xd'),_0x1c3e07,_0x8e2891[_0xde54('0x12')]['message']);return _0x2c0414(_0x8e2891[_0xde54('0x12')]['message']);}else{logger['info'](_0xde54('0xd'),_0x1c3e07,_0xde54('0xe'));_0x2c0414(_0x8e2891[_0xde54('0x15')][_0xde54('0x14')]);}})[_0xde54('0x16')](function(_0x13b48b){logger['error'](_0xde54('0xd'),_0x1c3e07,_0x13b48b);_0x21bb11(_0x13b48b);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0739cb7..520f6cb 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 _0x4813=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x38190c,_0x286b1f){var _0x5d0660=function(_0x3860c1){while(--_0x3860c1){_0x38190c['push'](_0x38190c['shift']());}};_0x5d0660(++_0x286b1f);}(_0x4813,0x14e));var _0x3481=function(_0x2ca362,_0x415395){_0x2ca362=_0x2ca362-0x0;var _0x589006=_0x4813[_0x2ca362];return _0x589006;};'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(_0x3481('0x4'));var router=express[_0x3481('0x5')]();var auth=require(_0x3481('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3481('0x7'));module[_0x3481('0x8')]=router; \ No newline at end of file +var _0x9134=['../../config/environment','exports','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9134,0x87));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x4913('0x0'));var path=require(_0x4913('0x1'));var timeout=require(_0x4913('0x2'));var express=require(_0x4913('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4913('0x4'));var config=require(_0x4913('0x5'));module[_0x4913('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 59c09cb..a7d7362 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 _0x6065=['exports','INTEGER','sequelize'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x6065,0x1d6));var _0x5606=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x6065[_0x13ce0c];return _0x4388fb;};'use strict';var Sequelize=require(_0x5606('0x0'));module[_0x5606('0x1')]={'penalty':{'type':Sequelize[_0x5606('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79f3=['INTEGER','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x79f3,0x9d));var _0x379f=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x79f3[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x379f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x379f('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 f79c061..88c8701 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 _0x6041=['../../config/logger','api','moment','bluebird','request-promise','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x5293a1,_0x351c64){var _0x5085aa=function(_0x3c3bd8){while(--_0x3c3bd8){_0x5293a1['push'](_0x5293a1['shift']());}};_0x5085aa(++_0x351c64);}(_0x6041,0xd0));var _0x1604=function(_0x5a687a,_0x5935ac){_0x5a687a=_0x5a687a-0x0;var _0x54589f=_0x6041[_0x5a687a];return _0x54589f;};'use strict';var _=require(_0x1604('0x0'));var util=require('util');var logger=require(_0x1604('0x1'))(_0x1604('0x2'));var moment=require(_0x1604('0x3'));var BPromise=require(_0x1604('0x4'));var rp=require(_0x1604('0x5'));var attributes=require(_0x1604('0x6'));module[_0x1604('0x7')]=function(_0x115d8,_0x4b44ee){return _0x115d8[_0x1604('0x8')](_0x1604('0x9'),attributes,{'tableName':_0x1604('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf15=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','exports','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdf15,0x185));var _0x5df1=function(_0x1193fe,_0x24cb91){_0x1193fe=_0x1193fe-0x0;var _0xa1f384=_0xdf15[_0x1193fe];return _0xa1f384;};'use strict';var _=require(_0x5df1('0x0'));var util=require(_0x5df1('0x1'));var logger=require(_0x5df1('0x2'))(_0x5df1('0x3'));var moment=require('moment');var BPromise=require(_0x5df1('0x4'));var rp=require('request-promise');var attributes=require('./userOpenchannelQueue.attributes');module[_0x5df1('0x5')]=function(_0x489e93,_0x16fdf4){return _0x489e93[_0x5df1('0x6')](_0x5df1('0x7'),attributes,{'tableName':_0x5df1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index cdab6ce..73f100a 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 _0x5283=['request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x305684,_0x56d40d){var _0x307f67=function(_0x35d2a9){while(--_0x35d2a9){_0x305684['push'](_0x305684['shift']());}};_0x307f67(++_0x56d40d);}(_0x5283,0xbb));var _0x3528=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x5283[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0x3528('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3528('0x1'));var rs=require(_0x3528('0x2'));var fs=require('fs');var Redis=require(_0x3528('0x3'));var db=require(_0x3528('0x4'))['db'];var utils=require(_0x3528('0x5'));var logger=require(_0x3528('0x6'))(_0x3528('0x7'));var config=require('../../config/environment');var jayson=require(_0x3528('0x8'));var client=jayson[_0x3528('0x9')][_0x3528('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1778dd,_0x4324cb,_0x333441){return new BPromise(function(_0x442c92,_0x5798cb){return client[_0x3528('0xb')](_0x1778dd,_0x333441)[_0x3528('0xc')](function(_0x2c6515){logger[_0x3528('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4324cb,_0x3528('0xe'));logger[_0x3528('0xf')](_0x3528('0x10'),_0x4324cb,_0x3528('0xe'),JSON[_0x3528('0x11')](_0x2c6515));if(_0x2c6515[_0x3528('0x12')]){if(_0x2c6515['error']['code']===0x1f4){logger[_0x3528('0x12')](_0x3528('0x13'),_0x4324cb,_0x2c6515[_0x3528('0x12')][_0x3528('0x14')]);return _0x5798cb(_0x2c6515[_0x3528('0x12')][_0x3528('0x14')]);}logger[_0x3528('0x12')](_0x3528('0x13'),_0x4324cb,_0x2c6515[_0x3528('0x12')][_0x3528('0x14')]);return _0x442c92(_0x2c6515[_0x3528('0x12')][_0x3528('0x14')]);}else{logger[_0x3528('0xd')](_0x3528('0x13'),_0x4324cb,_0x3528('0xe'));_0x442c92(_0x2c6515['result']['message']);}})[_0x3528('0x15')](function(_0x5d8fef){logger[_0x3528('0x12')](_0x3528('0x13'),_0x4324cb,_0x5d8fef);_0x5798cb(_0x5d8fef);});});} \ No newline at end of file +var _0xd5f9=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd5f9,0x1a1));var _0x9d5f=function(_0xbb6fb5,_0x4db9fb){_0xbb6fb5=_0xbb6fb5-0x0;var _0x2f9501=_0xd5f9[_0xbb6fb5];return _0x2f9501;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var moment=require('moment');var BPromise=require(_0x9d5f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5f('0x3'));var db=require(_0x9d5f('0x4'))['db'];var utils=require(_0x9d5f('0x5'));var logger=require(_0x9d5f('0x6'))(_0x9d5f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d5f('0x8')][_0x9d5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57b653,_0x33b7c8,_0x47738){return new BPromise(function(_0x1fb1d3,_0x1e0986){return client[_0x9d5f('0xa')](_0x57b653,_0x47738)[_0x9d5f('0xb')](function(_0x5290f4){logger[_0x9d5f('0xc')](_0x9d5f('0xd'),_0x33b7c8,_0x9d5f('0xe'));logger[_0x9d5f('0xf')](_0x9d5f('0x10'),_0x33b7c8,_0x9d5f('0xe'),JSON['stringify'](_0x5290f4));if(_0x5290f4[_0x9d5f('0x11')]){if(_0x5290f4[_0x9d5f('0x11')][_0x9d5f('0x12')]===0x1f4){logger[_0x9d5f('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33b7c8,_0x5290f4[_0x9d5f('0x11')][_0x9d5f('0x13')]);return _0x1e0986(_0x5290f4[_0x9d5f('0x11')][_0x9d5f('0x13')]);}logger[_0x9d5f('0x11')](_0x9d5f('0xd'),_0x33b7c8,_0x5290f4[_0x9d5f('0x11')]['message']);return _0x1fb1d3(_0x5290f4[_0x9d5f('0x11')][_0x9d5f('0x13')]);}else{logger[_0x9d5f('0xc')](_0x9d5f('0xd'),_0x33b7c8,_0x9d5f('0xe'));_0x1fb1d3(_0x5290f4[_0x9d5f('0x14')][_0x9d5f('0x13')]);}})[_0x9d5f('0x15')](function(_0x3bb23){logger[_0x9d5f('0x11')](_0x9d5f('0xd'),_0x33b7c8,_0x3bb23);_0x1e0986(_0x3bb23);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 045cb24..488fcc6 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 _0x0af9=['describe','isAuthenticated','show','getResources','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','/:id','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','Router','../../components/auth/service','./userProfile.controller','get','index','/describe'];(function(_0x2877e6,_0x501acf){var _0x59b78b=function(_0x4fcaf0){while(--_0x4fcaf0){_0x2877e6['push'](_0x2877e6['shift']());}};_0x59b78b(++_0x501acf);}(_0x0af9,0xe9));var _0x90af=function(_0x35cbbd,_0x3e62ac){_0x35cbbd=_0x35cbbd-0x0;var _0x44f18a=_0x0af9[_0x35cbbd];return _0x44f18a;};'use strict';var multer=require(_0x90af('0x0'));var util=require(_0x90af('0x1'));var path=require(_0x90af('0x2'));var timeout=require('connect-timeout');var express=require(_0x90af('0x3'));var router=express[_0x90af('0x4')]();var auth=require(_0x90af('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90af('0x6'));router[_0x90af('0x7')]('/',auth['isAuthenticated'](),controller[_0x90af('0x8')]);router[_0x90af('0x7')](_0x90af('0x9'),auth['isAuthenticated'](),controller[_0x90af('0xa')]);router[_0x90af('0x7')]('/:id',auth[_0x90af('0xb')](),controller[_0x90af('0xc')]);router[_0x90af('0x7')]('/:id/resources',auth[_0x90af('0xb')](),controller[_0x90af('0xd')]);router['post']('/',auth[_0x90af('0xb')](),controller['create']);router[_0x90af('0xe')](_0x90af('0xf'),auth[_0x90af('0xb')](),controller[_0x90af('0x10')]);router[_0x90af('0xe')](_0x90af('0x11'),auth[_0x90af('0xb')](),controller[_0x90af('0x12')]);router[_0x90af('0xe')](_0x90af('0x13'),auth[_0x90af('0xb')](),controller[_0x90af('0x14')]);router['put'](_0x90af('0x15'),auth[_0x90af('0xb')](),controller['update']);router[_0x90af('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x90af('0x17')]);router[_0x90af('0x16')](_0x90af('0x11'),auth[_0x90af('0xb')](),controller[_0x90af('0x18')]);router[_0x90af('0x16')](_0x90af('0x13'),auth[_0x90af('0xb')](),controller[_0x90af('0x19')]);module[_0x90af('0x1a')]=router; \ No newline at end of file +var _0xffb3=['describe','/:id','getResources','post','clone','addSections','/:id/resources','put','update','delete','destroy','removeResources','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x433901,_0x24c5e9){var _0xf0bbc3=function(_0x269fd1){while(--_0x269fd1){_0x433901['push'](_0x433901['shift']());}};_0xf0bbc3(++_0x24c5e9);}(_0xffb3,0x71));var _0x3ffb=function(_0x4f0a7d,_0x1a2052){_0x4f0a7d=_0x4f0a7d-0x0;var _0x55d9f1=_0xffb3[_0x4f0a7d];return _0x55d9f1;};'use strict';var multer=require(_0x3ffb('0x0'));var util=require(_0x3ffb('0x1'));var path=require('path');var timeout=require(_0x3ffb('0x2'));var express=require(_0x3ffb('0x3'));var router=express[_0x3ffb('0x4')]();var auth=require(_0x3ffb('0x5'));var interaction=require(_0x3ffb('0x6'));var config=require('../../config/environment');var controller=require(_0x3ffb('0x7'));router[_0x3ffb('0x8')]('/',auth[_0x3ffb('0x9')](),controller[_0x3ffb('0xa')]);router[_0x3ffb('0x8')](_0x3ffb('0xb'),auth[_0x3ffb('0x9')](),controller[_0x3ffb('0xc')]);router[_0x3ffb('0x8')](_0x3ffb('0xd'),auth[_0x3ffb('0x9')](),controller['show']);router['get']('/:id/resources',auth[_0x3ffb('0x9')](),controller[_0x3ffb('0xe')]);router[_0x3ffb('0xf')]('/',auth[_0x3ffb('0x9')](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x3ffb('0x10')]);router['post']('/:id/sections',auth[_0x3ffb('0x9')](),controller[_0x3ffb('0x11')]);router[_0x3ffb('0xf')](_0x3ffb('0x12'),auth[_0x3ffb('0x9')](),controller['addResources']);router[_0x3ffb('0x13')](_0x3ffb('0xd'),auth[_0x3ffb('0x9')](),controller[_0x3ffb('0x14')]);router[_0x3ffb('0x15')](_0x3ffb('0xd'),auth['isAuthenticated'](),controller[_0x3ffb('0x16')]);router[_0x3ffb('0x15')]('/:id/sections',auth[_0x3ffb('0x9')](),controller['removeSections']);router['delete'](_0x3ffb('0x12'),auth['isAuthenticated'](),controller[_0x3ffb('0x17')]);module[_0x3ffb('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f366379..ac38363 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 _0x0e9a=['name','setDataValue','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x0e9a,0x11d));var _0xa0e9=function(_0x2a5030,_0x5416a5){_0x2a5030=_0x2a5030-0x0;var _0xe7ee51=_0x0e9a[_0x2a5030];return _0xe7ee51;};'use strict';var Sequelize=require('sequelize');module[_0xa0e9('0x0')]={'name':{'type':Sequelize[_0xa0e9('0x1')],'allowNull':![],'unique':_0xa0e9('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x11b344){this[_0xa0e9('0x3')]('crudPermissions',_0x11b344?_0x11b344['join'](''):[]);},'get':function(){return this[_0xa0e9('0x4')]('crudPermissions')?this[_0xa0e9('0x4')](_0xa0e9('0x5'))[_0xa0e9('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa0e9('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xef0b=['getDataValue','sequelize','STRING','name','crudPermissions','join'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0xef0b,0x1db));var _0xbef0=function(_0x273fce,_0xa44c89){_0x273fce=_0x273fce-0x0;var _0x2cbeca=_0xef0b[_0x273fce];return _0x2cbeca;};'use strict';var Sequelize=require(_0xbef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xbef0('0x1')],'allowNull':![],'unique':_0xbef0('0x2')},'crudPermissions':{'type':Sequelize[_0xbef0('0x1')],'set':function(_0x30e445){this['setDataValue'](_0xbef0('0x3'),_0x30e445?_0x30e445[_0xbef0('0x4')](''):[]);},'get':function(){return this[_0xbef0('0x5')](_0xbef0('0x3'))?this['getDataValue'](_0xbef0('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbef0('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a92e56c..d7e3764 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 _0x1e20=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','name','send','index','UserProfile','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','params','rawAttributes','merge','create','body','clone','find','get','omit','createdAt','updatedAt','sequelize','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','transaction','UserProfileSection','sectionId','push','removeSections','ids','addResources','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','isEmpty','ignore','foreignKey','resourceFields','resourceIds','forEach','AnalyticExtractedReport','reportType','default','reportId','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','toLowerCase','odbc','SquareOdbc','SquareProjects','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','User','Users','role','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x53047b,_0x39781e){var _0x1d8002=function(_0x3e8555){while(--_0x3e8555){_0x53047b['push'](_0x53047b['shift']());}};_0x1d8002(++_0x39781e);}(_0x1e20,0x1ac));var _0x01e2=function(_0x478ea4,_0x25f823){_0x478ea4=_0x478ea4-0x0;var _0x2ce58c=_0x1e20[_0x478ea4];return _0x2ce58c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x01e2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x01e2('0x1'));var rp=require(_0x01e2('0x2'));var moment=require(_0x01e2('0x3'));var BPromise=require(_0x01e2('0x4'));var Mustache=require('mustache');var util=require(_0x01e2('0x5'));var path=require('path');var sox=require(_0x01e2('0x6'));var csv=require(_0x01e2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x01e2('0x8'));var squel=require('squel');var crypto=require(_0x01e2('0x9'));var jsforce=require(_0x01e2('0xa'));var deskjs=require(_0x01e2('0xb'));var toCsv=require(_0x01e2('0x7'));var querystring=require(_0x01e2('0xc'));var Papa=require(_0x01e2('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x01e2('0xe'));var Redis=require(_0x01e2('0xf'));var qs=require(_0x01e2('0x10'));var logger=require(_0x01e2('0x11'))(_0x01e2('0x12'));var utils=require(_0x01e2('0x13'));var config=require(_0x01e2('0x14'));var db=require(_0x01e2('0x15'))['db'];config[_0x01e2('0x16')]=_[_0x01e2('0x17')](config[_0x01e2('0x16')],{'host':_0x01e2('0x18'),'port':0x18eb});var socket=require(_0x01e2('0x19'))(new Redis(config[_0x01e2('0x16')]));require(_0x01e2('0x1a'))[_0x01e2('0x1b')](socket);function respondWithStatusCode(_0x68981c,_0x2cfd14){_0x2cfd14=_0x2cfd14||0xcc;return function(_0x533084){if(_0x533084){return _0x68981c[_0x01e2('0x1c')](_0x2cfd14);}return _0x68981c['status'](_0x2cfd14)[_0x01e2('0x1d')]();};}function respondWithResult(_0xdcc044,_0xd3ad65){_0xd3ad65=_0xd3ad65||0xc8;return function(_0x5669e7){if(_0x5669e7){return _0xdcc044[_0x01e2('0x1e')](_0xd3ad65)[_0x01e2('0x1f')](_0x5669e7);}};}function respondWithFilteredResult(_0x30d1ad,_0x2af5db){return function(_0x1db6fc){if(_0x1db6fc){var _0x43fa9a=_0x1db6fc[_0x01e2('0x20')],_0x57f294=_0x2af5db[_0x01e2('0x21')],_0x406f73=_0x2af5db[_0x01e2('0x21')]+_0x2af5db[_0x01e2('0x22')],_0x4bf8a9;if(_0x406f73>=_0x43fa9a){_0x406f73=_0x43fa9a;_0x4bf8a9=0xc8;}else{_0x4bf8a9=0xce;}_0x30d1ad[_0x01e2('0x1e')](_0x4bf8a9);return _0x30d1ad[_0x01e2('0x23')](_0x01e2('0x24'),_0x57f294+'-'+_0x406f73+'/'+_0x43fa9a)[_0x01e2('0x1f')](_0x1db6fc);}return null;};}function patchUpdates(_0x428c0b){return function(_0x2bc271){try{jsonpatch['apply'](_0x2bc271,_0x428c0b,!![]);}catch(_0x2863df){return BPromise[_0x01e2('0x25')](_0x2863df);}return _0x2bc271['save']();};}function saveUpdates(_0x56ced6,_0x2eec9c){return function(_0x13baa9){if(_0x13baa9){return _0x13baa9[_0x01e2('0x26')](_0x56ced6)[_0x01e2('0x27')](function(_0x382351){return _0x382351;});}return null;};}function removeEntity(_0x526421,_0x17053a){return function(_0x5259db){if(_0x5259db){return _0x5259db[_0x01e2('0x28')]()['then'](function(){_0x526421[_0x01e2('0x1e')](0xcc)[_0x01e2('0x1d')]();});}};}function handleEntityNotFound(_0xf85178,_0x3d00d7){return function(_0x4e1200){if(!_0x4e1200){_0xf85178[_0x01e2('0x1c')](0x194);}return _0x4e1200;};}function handleError(_0x1f287b,_0x468d3f){_0x468d3f=_0x468d3f||0x1f4;return function(_0x549b95){logger['error'](_0x549b95['stack']);if(_0x549b95[_0x01e2('0x29')]){delete _0x549b95[_0x01e2('0x29')];}_0x1f287b[_0x01e2('0x1e')](_0x468d3f)[_0x01e2('0x2a')](_0x549b95);};}exports[_0x01e2('0x2b')]=function(_0x2a04f4,_0x39b1f5){var _0x852ef9={},_0x49e972={},_0x348e29={'count':0x0,'rows':[]};var _0xc13e7=db[_0x01e2('0x2c')]['rawAttributes'];_0x49e972[_0x01e2('0x2d')]=_[_0x01e2('0x2e')](_0xc13e7);_0x49e972[_0x01e2('0x2f')]=_['keys'](_0x2a04f4['query']);_0x49e972[_0x01e2('0x30')]=_[_0x01e2('0x31')](_0x49e972[_0x01e2('0x2d')],_0x49e972[_0x01e2('0x2f')]);_0x852ef9['attributes']=_[_0x01e2('0x31')](_0x49e972[_0x01e2('0x2d')],qs[_0x01e2('0x32')](_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x32')]));_0x852ef9[_0x01e2('0x33')]=_0x852ef9['attributes'][_0x01e2('0x34')]?_0x852ef9[_0x01e2('0x33')]:_0x49e972[_0x01e2('0x2d')];if(!_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x35')](_0x01e2('0x36'))){_0x852ef9[_0x01e2('0x22')]=qs['limit'](_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x22')]);_0x852ef9[_0x01e2('0x21')]=qs[_0x01e2('0x21')](_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x21')]);}_0x852ef9[_0x01e2('0x37')]=qs[_0x01e2('0x38')](_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x38')]);_0x852ef9[_0x01e2('0x39')]=qs[_0x01e2('0x30')](_[_0x01e2('0x3a')](_0x2a04f4['query'],_0x49e972['filters']));if(_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x3b')]){_0x852ef9[_0x01e2('0x39')]=_['merge'](_0x852ef9[_0x01e2('0x39')],{'$or':_[_0x01e2('0x3c')](_0xc13e7,function(_0x1f1a98){if(_0x1f1a98[_0x01e2('0x3d')]['key']!==_0x01e2('0x3e')){var _0x52ae93={};_0x52ae93[_0x1f1a98[_0x01e2('0x3f')]]={'$like':'%'+_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x3b')]+'%'};return _0x52ae93;}})});}_0x852ef9=_['merge']({},_0x852ef9,_0x2a04f4[_0x01e2('0x40')]);var _0x3b30e7={'where':_0x852ef9[_0x01e2('0x39')]};return db[_0x01e2('0x2c')]['count'](_0x3b30e7)['then'](function(_0x28f243){_0x348e29[_0x01e2('0x20')]=_0x28f243;if(_0x2a04f4[_0x01e2('0x2f')][_0x01e2('0x41')]){_0x852ef9[_0x01e2('0x42')]=[{'all':!![]}];}return db[_0x01e2('0x2c')]['findAll'](_0x852ef9);})[_0x01e2('0x27')](function(_0x211305){_0x348e29[_0x01e2('0x43')]=_0x211305;return _0x348e29;})[_0x01e2('0x27')](respondWithFilteredResult(_0x39b1f5,_0x852ef9))[_0x01e2('0x44')](handleError(_0x39b1f5,null));};exports['show']=function(_0x115fe8,_0x5bb5ef){var _0x299ffd={'raw':![],'where':{'id':_0x115fe8[_0x01e2('0x45')]['id']}},_0x1917c2={};_0x1917c2[_0x01e2('0x2d')]=_[_0x01e2('0x2e')](db[_0x01e2('0x2c')][_0x01e2('0x46')]);_0x1917c2[_0x01e2('0x2f')]=_[_0x01e2('0x2e')](_0x115fe8[_0x01e2('0x2f')]);_0x1917c2['filters']=_['intersection'](_0x1917c2['model'],_0x1917c2[_0x01e2('0x2f')]);_0x299ffd[_0x01e2('0x33')]=_[_0x01e2('0x31')](_0x1917c2[_0x01e2('0x2d')],qs[_0x01e2('0x32')](_0x115fe8[_0x01e2('0x2f')][_0x01e2('0x32')]));_0x299ffd[_0x01e2('0x33')]=_0x299ffd[_0x01e2('0x33')][_0x01e2('0x34')]?_0x299ffd['attributes']:_0x1917c2['model'];if(_0x115fe8['query'][_0x01e2('0x41')]){_0x299ffd[_0x01e2('0x42')]=[{'all':!![]}];}_0x299ffd=_[_0x01e2('0x47')]({},_0x299ffd,_0x115fe8[_0x01e2('0x40')]);return db[_0x01e2('0x2c')]['find'](_0x299ffd)[_0x01e2('0x27')](handleEntityNotFound(_0x5bb5ef,null))[_0x01e2('0x27')](respondWithResult(_0x5bb5ef,null))[_0x01e2('0x44')](handleError(_0x5bb5ef,null));};exports['create']=function(_0x178814,_0x3b11eb){return db[_0x01e2('0x2c')][_0x01e2('0x48')](_0x178814[_0x01e2('0x49')],{})['then'](respondWithResult(_0x3b11eb,0xc9))[_0x01e2('0x44')](handleError(_0x3b11eb,null));};exports[_0x01e2('0x4a')]=function(_0x483015,_0x15ca70){var _0x3f239e={'raw':![],'where':{'id':_0x483015['params']['id']}},_0x5ba37d={};_0x5ba37d[_0x01e2('0x2d')]=_[_0x01e2('0x2e')](db[_0x01e2('0x2c')][_0x01e2('0x46')]);_0x3f239e[_0x01e2('0x33')]=_[_0x01e2('0x31')](_0x5ba37d['model'],qs[_0x01e2('0x32')](_0x483015[_0x01e2('0x2f')][_0x01e2('0x32')]));_0x3f239e[_0x01e2('0x33')]=_0x3f239e['attributes']['length']?_0x3f239e[_0x01e2('0x33')]:_0x5ba37d[_0x01e2('0x2d')];if(_0x483015[_0x01e2('0x2f')][_0x01e2('0x41')]){_0x3f239e[_0x01e2('0x42')]=[{'all':!![]}];}_0x3f239e=_['merge']({},_0x3f239e,_0x483015['options']);return db[_0x01e2('0x2c')][_0x01e2('0x4b')](_0x3f239e)[_0x01e2('0x27')](handleEntityNotFound(_0x15ca70,null))[_0x01e2('0x27')](function(_0x139e1f){if(_0x139e1f){var _0x437a30=_0x139e1f[_0x01e2('0x4c')]({'plain':!![]});_0x437a30=qs[_0x01e2('0x4d')](_0x437a30,['id','createdAt','updatedAt','crudPermissions']);_0x483015[_0x01e2('0x49')]=_[_0x01e2('0x4d')](_0x483015[_0x01e2('0x49')],['id',_0x01e2('0x4e'),_0x01e2('0x4f')]);return db[_0x01e2('0x50')]['transaction'](function(_0x4166ab){return db[_0x01e2('0x2c')][_0x01e2('0x48')](_[_0x01e2('0x47')](_0x437a30,_0x483015[_0x01e2('0x49')]),{'include':_0x483015['query'][_0x01e2('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x4166ab})[_0x01e2('0x27')](function(_0x5b1ca2){var _0x472063=_0x5b1ca2['get']({'plain':!![]});return db['UserProfileSection'][_0x01e2('0x51')]({'where':{'userProfileId':_0x483015['params']['id']},'raw':!![]})['then'](function(_0x4fea5b){if(_0x4fea5b){return BPromise[_0x01e2('0x52')](_0x4fea5b,function(_0x31119c){return new BPromise(function(_0x43ce5e,_0x2f8700){if(_0x31119c['autoAssociation']===null||_0x31119c[_0x01e2('0x53')]===0x1)_0x43ce5e(null);return db[_0x01e2('0x54')][_0x01e2('0x51')]({'where':{'sectionId':_0x31119c['id']},'raw':!![]})['then'](function(_0x43d580){var _0x354d97=_['map'](_0x43d580,function(_0x5a87f9){return qs[_0x01e2('0x4d')](_0x5a87f9,['id',_0x01e2('0x4e'),'updatedAt','sectionId']);});_0x43ce5e(_0x354d97);})[_0x01e2('0x44')](function(_0x19d8b0){_0x2f8700(_0x19d8b0);});})[_0x01e2('0x27')](function(_0x5e2644){var _0x4d82ad=qs['omit'](_0x31119c,['id',_0x01e2('0x4e'),_0x01e2('0x4f')]);_0x4d82ad[_0x01e2('0x55')]=_0x472063['id'];if(_0x5e2644)_0x4d82ad[_0x01e2('0x56')]=_0x5e2644;return _0x4d82ad;})[_0x01e2('0x27')](function(_0xe7fbdb){return db['UserProfileSection'][_0x01e2('0x48')](_0xe7fbdb,{'include':[{'model':db[_0x01e2('0x54')],'as':_0x01e2('0x56')}],'raw':!![],'transaction':_0x4166ab});});})['then'](function(){return _0x472063;});}});});});}})[_0x01e2('0x27')](respondWithResult(_0x15ca70,0xc9))[_0x01e2('0x44')](handleError(_0x15ca70,null));};exports[_0x01e2('0x26')]=function(_0x48ebbb,_0x1e9d59){if(_0x48ebbb['body']['id']){delete _0x48ebbb['body']['id'];}return db['UserProfile'][_0x01e2('0x4b')]({'where':{'id':_0x48ebbb[_0x01e2('0x45')]['id']}})[_0x01e2('0x27')](handleEntityNotFound(_0x1e9d59,null))[_0x01e2('0x27')](saveUpdates(_0x48ebbb[_0x01e2('0x49')],null))['then'](respondWithResult(_0x1e9d59,null))[_0x01e2('0x44')](handleError(_0x1e9d59,null));};exports[_0x01e2('0x28')]=function(_0x59af06,_0x2dea5f){return db[_0x01e2('0x2c')][_0x01e2('0x4b')]({'where':{'id':_0x59af06[_0x01e2('0x45')]['id']}})[_0x01e2('0x27')](handleEntityNotFound(_0x2dea5f,null))[_0x01e2('0x27')](removeEntity(_0x2dea5f,null))[_0x01e2('0x44')](handleError(_0x2dea5f,null));};exports[_0x01e2('0x57')]=function(_0x34d634,_0x3adc04){return db[_0x01e2('0x2c')]['describe']()[_0x01e2('0x27')](respondWithResult(_0x3adc04,null))[_0x01e2('0x44')](handleError(_0x3adc04,null));};exports[_0x01e2('0x58')]=function(_0x59a10e,_0x2ea213){var _0x5081d0=_0x59a10e[_0x01e2('0x49')];return db['UserProfile'][_0x01e2('0x4b')]({'where':{'id':_0x59a10e[_0x01e2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ea213,null))[_0x01e2('0x27')](function(_0x15d72){if(_0x15d72){return db[_0x01e2('0x50')][_0x01e2('0x59')](function(_0x52e730){return db[_0x01e2('0x5a')][_0x01e2('0x28')]({'where':{'userProfileId':_0x59a10e[_0x01e2('0x45')]['id'],'sectionId':_[_0x01e2('0x3c')](_0x5081d0,function(_0x4c16b8){return _0x4c16b8[_0x01e2('0x5b')];})},'transaction':_0x52e730})[_0x01e2('0x27')](function(){var _0x545cd2=_[_0x01e2('0x3c')](_0x5081d0,function(_0x12f0f9){_0x12f0f9[_0x01e2('0x55')]=_0x59a10e[_0x01e2('0x45')]['id'];return _0x12f0f9;});var _0x1e7d4c=[];return BPromise[_0x01e2('0x52')](_0x545cd2,function(_0x545f4b){return db['UserProfileSection'][_0x01e2('0x48')](_0x545f4b,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x52e730})[_0x01e2('0x27')](function(_0x2d052f){_0x1e7d4c[_0x01e2('0x5c')](_0x2d052f['get']({'plain':!![]}));});})[_0x01e2('0x27')](function(){return _0x1e7d4c;});});});}})[_0x01e2('0x27')](function(_0x3e64f6){return _0x3e64f6;})[_0x01e2('0x27')](respondWithResult(_0x2ea213,null))[_0x01e2('0x44')](handleError(_0x2ea213,null));};exports[_0x01e2('0x5d')]=function(_0x206f25,_0x42c1d2){var _0x109850;return db[_0x01e2('0x2c')]['find']({'where':{'id':_0x206f25[_0x01e2('0x45')]['id']},'attributes':['id',_0x01e2('0x29')]})[_0x01e2('0x27')](handleEntityNotFound(_0x42c1d2,null))[_0x01e2('0x27')](function(_0x366d7b){if(_0x366d7b){_0x109850=_0x366d7b;return db[_0x01e2('0x5a')][_0x01e2('0x28')]({'where':{'userProfileId':_0x206f25[_0x01e2('0x45')]['id'],'sectionId':_0x206f25[_0x01e2('0x2f')][_0x01e2('0x5e')]}});}})[_0x01e2('0x27')](function(){return _0x109850;})['then'](respondWithStatusCode(_0x42c1d2,null))['catch'](handleError(_0x42c1d2,null));};exports[_0x01e2('0x5f')]=function(_0x5b61ba,_0x51448f){return db[_0x01e2('0x2c')][_0x01e2('0x4b')]({'where':{'id':_0x5b61ba[_0x01e2('0x45')]['id']}})[_0x01e2('0x27')](handleEntityNotFound(_0x51448f,null))[_0x01e2('0x27')](function(_0x1cd907){if(_0x1cd907){return db[_0x01e2('0x50')][_0x01e2('0x59')](function(_0x3b5f11){return db[_0x01e2('0x5a')][_0x01e2('0x51')]({'where':{'userProfileId':_0x5b61ba[_0x01e2('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x01e2('0x27')](function(_0x3e849b){if(_0x3e849b){return db[_0x01e2('0x5a')][_0x01e2('0x28')]({'where':{'userProfileId':_0x5b61ba[_0x01e2('0x45')]['id'],'id':_[_0x01e2('0x3c')](_0x3e849b,function(_0x3eb835){return _0x3eb835['id'];})},'transaction':_0x3b5f11});}})[_0x01e2('0x27')](function(_0x518f09){var _0x519a3f=_[_0x01e2('0x3c')](_0x5b61ba['body'],function(_0x3cb56d){_0x3cb56d[_0x01e2('0x55')]=_0x5b61ba['params']['id'];return _0x3cb56d;});return db[_0x01e2('0x5a')]['bulkCreate'](_0x519a3f,{'raw':!![],'transaction':_0x3b5f11});})[_0x01e2('0x27')](function(_0x54f764){var _0x20a154=_['filter'](_[_0x01e2('0x3c')](_0x54f764,function(_0x4c0857){return _0x4c0857[_0x01e2('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x20a154){return db[_0x01e2('0x5a')][_0x01e2('0x51')]({'where':{'userProfileId':_0x5b61ba['params']['id'],'sectionId':_['map'](_0x20a154,function(_0x524a64){return _0x524a64[_0x01e2('0x5b')];})},'attributes':['id',_0x01e2('0x5b')],'raw':!![]})[_0x01e2('0x27')](function(_0x40b937){var _0x11339b=_['map'](_0x5b61ba[_0x01e2('0x49')],function(_0x5e80a3){_0x5e80a3['userProfileId']=_0x5b61ba[_0x01e2('0x45')]['id'];return _0x5e80a3;});return db[_0x01e2('0x54')]['bulkCreate'](_0x11339b,{'raw':!![],'transaction':_0x3b5f11});});}})[_0x01e2('0x44')](handleError(_0x51448f,null));});}})[_0x01e2('0x27')](function(_0x986440){var _0xa8bdfb=_[_0x01e2('0x3c')](_0x986440,function(_0x2445fe){return _0x2445fe[_0x01e2('0x4c')]({'plain':!![]});});})[_0x01e2('0x27')](respondWithResult(_0x51448f,null))[_0x01e2('0x44')](handleError(_0x51448f,null));};exports[_0x01e2('0x60')]=function(_0xf6f07b,_0x497c32,_0x98edbf){var _0x314769;return db[_0x01e2('0x2c')][_0x01e2('0x4b')]({'where':{'id':_0xf6f07b[_0x01e2('0x45')]['id']}})[_0x01e2('0x27')](handleEntityNotFound(_0x497c32,null))[_0x01e2('0x27')](function(_0x248ff8){if(_0x248ff8){return _0x248ff8[_0x01e2('0x60')](_0xf6f07b[_0x01e2('0x2f')][_0x01e2('0x5e')]);}})[_0x01e2('0x27')](respondWithStatusCode(_0x497c32,null))[_0x01e2('0x44')](handleError(_0x497c32,null));};exports[_0x01e2('0x61')]=function(_0x34880b,_0x608b73){var _0x3bff07={'raw':![],'where':{}};var _0x4e5568={};var _0x487510={'count':0x0,'rows':[]};var _0xd1aa84=_0x34880b[_0x01e2('0x2f')][_0x01e2('0x62')];if(typeof _0xd1aa84===_0x01e2('0x63')){throw new db[(_0x01e2('0x64'))][(_0x01e2('0x65'))](_0x01e2('0x66'));}var _0x3cb897=_0x34880b['query'][_0x01e2('0x67')]||![];var _0x1b6a2b=getQueryModels(_0xd1aa84,_0x3cb897);if(typeof _0x1b6a2b[_0x01e2('0x68')]===_0x01e2('0x63')){throw new db[(_0x01e2('0x64'))][(_0x01e2('0x65'))](_0x01e2('0x69')+_0xd1aa84+'\x27');}var _0x296136=[];if(!_['isEmpty'](_0x1b6a2b[_0x01e2('0x6a')])){_0x296136=_0x1b6a2b[_0x01e2('0x6a')];}else{_0x296136=[{'name':_0xd1aa84}];}return db[_0x01e2('0x2c')][_0x01e2('0x6b')]({'where':{'id':_0x34880b['params']['id']}})[_0x01e2('0x27')](handleEntityNotFound(_0x608b73,null))[_0x01e2('0x27')](function(_0x5799e4){if(_0x5799e4){var _0x29eb65=[];for(var _0x12ff10=0x0;_0x12ff10<_0x296136[_0x01e2('0x34')];_0x12ff10++){_0x29eb65[_0x01e2('0x5c')](db[_0x01e2('0x5a')][_0x01e2('0x6b')]({'where':{'userProfileId':_0x5799e4['id'],'name':_0x296136[_0x12ff10][_0x01e2('0x29')]},'raw':!![]}));}return BPromise[_0x01e2('0x6c')](_0x29eb65);}})[_0x01e2('0x27')](function(_0x1ecdac){var _0x440d92=_['filter'](_0x1ecdac,function(_0x14dc12){return _0x14dc12?_0x14dc12:undefined;});var _0x1310aa=_[_0x01e2('0x3b')](_0x296136,['ignore',!![]]);var _0x2d2817=_[_0x01e2('0x6d')](_0x440d92)&&_[_0x01e2('0x6d')](_0x1310aa)?null:_['union'](_0x1310aa,_0x440d92);if(_0x2d2817){var _0x31a3c3=[];for(var _0x55d49f=0x0;_0x55d49f<_0x2d2817[_0x01e2('0x34')];_0x55d49f++){var _0x26e88f=_[_0x01e2('0x4b')](_0x296136,function(_0x13c9f9){return _0x2d2817[_0x55d49f]?_0x13c9f9[_0x01e2('0x29')]===_0x2d2817[_0x55d49f][_0x01e2('0x29')]:null;});if(_0x26e88f){if(_0x2d2817[_0x55d49f][_0x01e2('0x6e')]){_0x31a3c3['push'](getAllResources(_0x1b6a2b[_0x01e2('0x68')],_0x2d2817[_0x55d49f]));}else{if(!_0x2d2817[_0x55d49f][_0x01e2('0x53')]){_0x31a3c3[_0x01e2('0x5c')](getAllowedResources(_0x26e88f,_0x2d2817[_0x55d49f]));}else{if(_0x26e88f[_0x01e2('0x2d')]){_0x31a3c3[_0x01e2('0x5c')](getAllFilteredResources(_0x26e88f,_0x2d2817[_0x55d49f]));}}}}}return BPromise[_0x01e2('0x6c')](_0x31a3c3);}else{return null;}})[_0x01e2('0x27')](function(_0x476de0){var _0x54fa6a=_0x476de0;var _0x718833=null;if(_0x54fa6a){_0x718833=_0x54fa6a['length']===0x1?_0x54fa6a[0x0]:null;}if(_0x718833||_0x54fa6a){var _0xdea34a=db[_0x1b6a2b['childModel']]['rawAttributes'];_0x4e5568[_0x01e2('0x2d')]=_['keys'](_0xdea34a);_0x4e5568[_0x01e2('0x2f')]=_[_0x01e2('0x2e')](_0x34880b['query']);_0x4e5568[_0x01e2('0x30')]=_[_0x01e2('0x31')](_0x4e5568[_0x01e2('0x2d')],_0x4e5568[_0x01e2('0x2f')]);_0x3bff07[_0x01e2('0x33')]=_[_0x01e2('0x31')](_0x4e5568[_0x01e2('0x2d')],qs[_0x01e2('0x32')](_0x34880b[_0x01e2('0x2f')][_0x01e2('0x32')]));_0x3bff07[_0x01e2('0x33')]=_0x3bff07['attributes']['length']?_0x3bff07[_0x01e2('0x33')]:_0x4e5568[_0x01e2('0x2d')];if(!_0x34880b[_0x01e2('0x2f')][_0x01e2('0x35')](_0x01e2('0x36'))){_0x3bff07[_0x01e2('0x22')]=qs['limit'](_0x34880b['query'][_0x01e2('0x22')]);_0x3bff07[_0x01e2('0x21')]=qs['offset'](_0x34880b[_0x01e2('0x2f')][_0x01e2('0x21')]);}_0x3bff07[_0x01e2('0x37')]=qs[_0x01e2('0x38')](_0x34880b[_0x01e2('0x2f')][_0x01e2('0x38')]);_0x3bff07[_0x01e2('0x39')]=qs['filters'](_[_0x01e2('0x3a')](_0x34880b[_0x01e2('0x2f')],_0x4e5568['filters']));var _0x1c1e50=[];if(_0x718833){var _0x4f17ca=_[_0x01e2('0x4b')](_0x296136,['name',_0x718833['name']]);if(_0x4f17ca[_0x01e2('0x3f')]){var _0xe343d1={};_0xe343d1[_0x4f17ca[_0x01e2('0x6f')]]=_0x718833[_0x01e2('0x70')];_0x1c1e50[_0x01e2('0x5c')](_0xe343d1);}else{_0x3bff07['where']['id']=_0x718833[_0x01e2('0x71')];}}else{var _0x1c1e50=[];for(var _0x594d0c=0x0;_0x594d0c<_0x54fa6a[_0x01e2('0x34')];_0x594d0c++){var _0x4f17ca=_[_0x01e2('0x4b')](_0x296136,[_0x01e2('0x29'),_0x54fa6a[_0x594d0c][_0x01e2('0x29')]]);if(_0x4f17ca[_0x01e2('0x3f')]){var _0xe343d1={};if(_0x4f17ca[_0x01e2('0x3f')]==='id'){_0xe343d1[_0x4f17ca[_0x01e2('0x6f')]]=_0x54fa6a[_0x594d0c]['resourceIds'];}else{_0xe343d1[_0x4f17ca['foreignKey']]=_0x54fa6a[_0x594d0c][_0x01e2('0x70')];}_0x1c1e50['push'](_0xe343d1);}else{if(!_0x3bff07['where']['id'])_0x3bff07[_0x01e2('0x39')]['id']=[];_0x54fa6a[_0x594d0c]['resourceIds'][_0x01e2('0x72')](function(_0x465be1){_0x3bff07[_0x01e2('0x39')]['id'][_0x01e2('0x5c')](_0x465be1);});}}}if(!_[_0x01e2('0x6d')](_0x1c1e50)){_0x3bff07[_0x01e2('0x39')]=_[_0x01e2('0x47')](_0x3bff07[_0x01e2('0x39')],{'$or':_0x1c1e50});}if(_0x34880b[_0x01e2('0x2f')][_0x01e2('0x3b')]){_0x3bff07[_0x01e2('0x39')]=_['merge'](_0x3bff07['where'],{'$or':_[_0x01e2('0x3c')](_0xdea34a,function(_0x204d8c){if(_0x204d8c[_0x01e2('0x3d')]['key']!=='VIRTUAL'){var _0x420b34={};_0x420b34[_0x204d8c['field']]={'$like':'%'+_0x34880b[_0x01e2('0x2f')]['filter']+'%'};return _0x420b34;}})});}_0x3bff07=_['merge']({},_0x3bff07,_0x34880b[_0x01e2('0x40')]);if(_0x718833&&!_0x718833[_0x01e2('0x53')]&&_0x1b6a2b[_0x01e2('0x68')]===_0x01e2('0x73')){if(_0x34880b[_0x01e2('0x2f')]['includeAll']){_0x3bff07[_0x01e2('0x42')]=[{'all':!![]}];}return db[_0x1b6a2b[_0x01e2('0x68')]]['findAll'](_0x3bff07)['then'](function(_0x3ac3ac){var _0x5602c0=[];_0x3ac3ac[_0x01e2('0x72')](function(_0x219391){var _0x38e82d;switch(_0x219391[_0x01e2('0x74')]){case _0x01e2('0x75'):_0x38e82d=_['find'](_0x718833[_0x01e2('0x71')],function(_0x1e5a39){return _0x1e5a39['id']===_0x219391[_0x01e2('0x76')]&&_0x1e5a39['type']==='DefaultReports';});break;case _0x01e2('0x77'):_0x38e82d=_[_0x01e2('0x4b')](_0x718833[_0x01e2('0x71')],function(_0x3a9344){return _0x3a9344['id']===_0x219391[_0x01e2('0x76')]&&_0x3a9344[_0x01e2('0x3d')]===_0x01e2('0x78');});break;}if(_0x38e82d)_0x5602c0['push'](_0x219391);});_0x487510[_0x01e2('0x20')]=_0x5602c0[_0x01e2('0x34')];_0x487510['rows']=_0x5602c0;return _0x487510;});}else{return db[_0x1b6a2b[_0x01e2('0x68')]][_0x01e2('0x20')]({'where':_0x3bff07[_0x01e2('0x39')]})[_0x01e2('0x27')](function(_0x498bfe){_0x487510[_0x01e2('0x20')]=_0x498bfe;if(_0x34880b['query'][_0x01e2('0x41')]){if(_0x1b6a2b[_0x01e2('0x68')]===_0x01e2('0x79')){_0x3bff07[_0x01e2('0x42')]=[{'model':db[_0x01e2('0x7a')],'as':_0x01e2('0x7b'),'attributes':['id','name',_0x01e2('0x7c')],'required':_0x34880b['query'][_0x01e2('0x7d')]?!![]:![]},{'model':db['Tag'],'as':_0x01e2('0x7e'),'attributes':['id',_0x01e2('0x29'),_0x01e2('0x7c')],'through':_0x34880b[_0x01e2('0x2f')][_0x01e2('0x7d')]?{'attributes':[],'where':{'TagId':_0x34880b[_0x01e2('0x2f')][_0x01e2('0x7d')]||undefined}}:{},'required':_0x34880b[_0x01e2('0x2f')][_0x01e2('0x7d')]?!![]:![]}];}else{_0x3bff07[_0x01e2('0x42')]=[{'all':!![]}];}}return db[_0x1b6a2b['childModel']][_0x01e2('0x51')](_0x3bff07);})[_0x01e2('0x27')](function(_0x5ee37a){_0x487510[_0x01e2('0x43')]=_0x5ee37a;return _0x487510;});}}else{return _0x487510;}})[_0x01e2('0x27')](respondWithFilteredResult(_0x608b73,_0x3bff07))['catch'](handleError(_0x608b73,null));};function getAllResources(_0x51aa0a,_0x2a2b3d){return new BPromise(function(_0x470f71,_0x4a684c){if(_0x2a2b3d){var _0x11ed5f=_0x2a2b3d[_0x01e2('0x3b')]?{[_0x2a2b3d[_0x01e2('0x3b')][_0x01e2('0x3f')]]:_0x2a2b3d[_0x01e2('0x3b')][_0x01e2('0x7f')]}:undefined;return db[_0x51aa0a][_0x01e2('0x51')]({'where':_0x11ed5f,'raw':!![]})['then'](function(_0x143ac3){_0x2a2b3d[_0x01e2('0x71')]=_[_0x01e2('0x3c')](_0x143ac3,'id');_0x470f71(_0x2a2b3d);})['catch'](function(_0x2ecb65){_0x4a684c(_0x2ecb65);});}else{_0x470f71(null);}});}function getAllFilteredResources(_0x4f6cdd,_0x2422c5){return new BPromise(function(_0x307481,_0x48b371){var _0x5b843f=_0x4f6cdd[_0x01e2('0x3b')]?{[_0x4f6cdd[_0x01e2('0x3b')][_0x01e2('0x3f')]]:_0x4f6cdd[_0x01e2('0x3b')][_0x01e2('0x7f')]}:undefined;return db[_0x4f6cdd[_0x01e2('0x2d')]][_0x01e2('0x51')]({'where':_0x5b843f,'raw':!![]})[_0x01e2('0x27')](function(_0x600664){_0x2422c5[_0x01e2('0x70')]=_['map'](_0x600664,function(_0x366b01){return _0x366b01['name'];});_0x307481(_0x2422c5);})[_0x01e2('0x44')](function(_0x35f32a){_0x48b371(_0x35f32a);});});}function getAllowedResources(_0x363e6f,_0x44eaa1){return new BPromise(function(_0x32e6fc,_0x2658a4){if(_0x44eaa1){return db[_0x01e2('0x54')][_0x01e2('0x51')]({'where':{'sectionId':_0x44eaa1['id']},'raw':!![]})[_0x01e2('0x27')](function(_0x25b869){if(_0x363e6f[_0x01e2('0x3f')]&&_0x363e6f[_0x01e2('0x3f')]!=='id'){_0x44eaa1['resourceFields']=_['map'](_0x25b869,function(_0x296cba){return _0x296cba[_0x363e6f['field']];});}else{if(_0x363e6f['childModel']===_0x01e2('0x73')){_0x44eaa1[_0x01e2('0x71')]=_[_0x01e2('0x3c')](_0x25b869,function(_0x36303a){return{'id':_0x36303a[_0x01e2('0x80')],'type':_0x36303a[_0x01e2('0x3d')]};});}else{_0x44eaa1[_0x01e2('0x71')]=_['map'](_0x25b869,function(_0x2a24b0){return _0x2a24b0[_0x01e2('0x80')];});}}_0x32e6fc(_0x44eaa1);})[_0x01e2('0x44')](function(_0x4341d9){_0x2658a4(_0x4341d9);});}else{_0x32e6fc(null);}});}function getQueryModels(_0x3e75a9,_0x37a854){var _0x24d378=_0x3e75a9[_0x01e2('0x81')]();var _0x57d9b9={'childModel':undefined,'parentSections':[]};switch(_0x24d378){case'squareprojects':_0x57d9b9['childModel']='SquareProject';break;case _0x01e2('0x82'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x83');break;case'squarerecordings':_0x57d9b9[_0x01e2('0x68')]='SquareRecording';_0x57d9b9[_0x01e2('0x6a')]=[{'name':_0x01e2('0x84'),'field':_0x01e2('0x29'),'foreignKey':'projectName'}];break;case'projects':_0x57d9b9[_0x01e2('0x68')]='JscriptyProject';break;case'contacts':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x79');_0x57d9b9['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x01e2('0x85')}];break;case _0x01e2('0x86'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x87');break;case _0x01e2('0x88'):_0x57d9b9['childModel']='CmCompany';break;case _0x01e2('0x89'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x8a');break;case _0x01e2('0x8b'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x8c');break;case _0x01e2('0x8d'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x8e');break;case'faxqueues':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x8f');break;case _0x01e2('0x90'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x91');break;case'inboundroutes':case _0x01e2('0x92'):case _0x01e2('0x93'):_0x57d9b9[_0x01e2('0x68')]='VoiceExtension';break;case'contexts':_0x57d9b9[_0x01e2('0x68')]='VoiceContext';break;case'voicemails':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x94');break;case _0x01e2('0x95'):_0x57d9b9['childModel']=_0x01e2('0x96');_0x57d9b9[_0x01e2('0x6a')]=[{'name':_0x01e2('0x97'),'field':_0x01e2('0x29'),'foreignKey':_0x01e2('0x98'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0x01e2('0x99'),'field':_0x01e2('0x29'),'foreignKey':_0x01e2('0x98'),'model':'User','filter':{'field':'role','value':[_0x01e2('0x9a')]}},{'name':_0x01e2('0x9b'),'field':_0x01e2('0x29'),'foreignKey':'queue','model':_0x01e2('0x9c'),'filter':{'field':_0x01e2('0x3d'),'value':[_0x01e2('0x9d')]}},{'name':_0x01e2('0x9e'),'field':_0x01e2('0x29'),'foreignKey':_0x01e2('0x9f'),'model':'VoiceQueue','filter':{'field':_0x01e2('0x3d'),'value':[_0x01e2('0xa0')]}}];break;case _0x01e2('0xa1'):_0x57d9b9['childModel']=_0x01e2('0xa2');break;case'chanspies':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xa3');break;case _0x01e2('0xa4'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xa5');break;case _0x01e2('0xa6'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xa7');break;case _0x01e2('0xa8'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xa9');break;case _0x01e2('0xaa'):_0x57d9b9[_0x01e2('0x68')]='MailAccount';break;case _0x01e2('0xab'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xac');break;case'openchannelqueues':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xad');break;case'openchannelaccounts':_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xae');break;case _0x01e2('0xaf'):_0x57d9b9['childModel']=_0x01e2('0xb0');break;case _0x01e2('0xb1'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xb2');break;case _0x01e2('0xb3'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xb4');break;case _0x01e2('0xb5'):case _0x01e2('0xb6'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0x9c');if(_0x37a854){_0x57d9b9[_0x01e2('0x6a')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x01e2('0xb7'):case _0x01e2('0xb8'):case _0x01e2('0xb9'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xba');if(_0x37a854){_0x57d9b9[_0x01e2('0x6a')]=[{'name':_0x01e2('0xbb'),'filter':{'field':_0x01e2('0xbc'),'value':['admin',_0x01e2('0xbd')]},'ignore':!![]},{'name':'Agents'},{'name':_0x01e2('0x99')}];}break;case _0x01e2('0xbe'):_0x57d9b9['childModel']='ZendeskAccount';break;case _0x01e2('0xbf'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xc0');break;case _0x01e2('0xc1'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xc2');break;case _0x01e2('0xc3'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xc4');break;case _0x01e2('0xc5'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xc6');break;case _0x01e2('0xc7'):_0x57d9b9['childModel']=_0x01e2('0xc8');break;case _0x01e2('0xc9'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xba');break;case _0x01e2('0xca'):_0x57d9b9['childModel']=_0x01e2('0xcb');break;case'dispositions':_0x57d9b9[_0x01e2('0x68')]='Disposition';break;case _0x01e2('0xcc'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xcd');break;case _0x01e2('0xce'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xcf');break;case _0x01e2('0xd0'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xd1');break;case _0x01e2('0xd2'):_0x57d9b9['childModel']=_0x01e2('0xd3');break;case _0x01e2('0xd4'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xd5');break;case'tags':_0x57d9b9['childModel']=_0x01e2('0x7a');break;case _0x01e2('0xd6'):_0x57d9b9[_0x01e2('0x68')]='Template';break;case _0x01e2('0xd7'):_0x57d9b9['childModel']=_0x01e2('0xd8');break;case _0x01e2('0xd9'):_0x57d9b9[_0x01e2('0x68')]=_0x01e2('0xda');break;case _0x01e2('0xdb'):_0x57d9b9[_0x01e2('0x68')]='Variable';break;case _0x01e2('0xdc'):_0x57d9b9['childModel']=_0x01e2('0xdd');break;case _0x01e2('0xde'):_0x57d9b9[_0x01e2('0x68')]='AnalyticExtractedReport';_0x57d9b9[_0x01e2('0x6a')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x57d9b9[_0x01e2('0x68')]='AnalyticMetric';break;default:return _0x57d9b9;}return _0x57d9b9;} \ No newline at end of file +var _0x075b=['attributes','fields','length','nolimit','where','pick','filter','merge','map','key','VIRTUAL','field','UserProfile','includeAll','findAll','catch','params','include','options','find','create','body','omit','crudPermissions','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','updatedAt','Resources','describe','addSections','UserProfileSection','sectionId','userProfileId','push','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','undefined','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','childModel','order','sort','type','foreignKey','resourceFields','resourceIds','forEach','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','Tags','color','Tag','ThroughTags','tag','value','resourceId','toLowerCase','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','lists','companies','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','Sound','tags','templates','Template','triggers','variables','Variable','plugins','extractedreports','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection'];(function(_0x19e2aa,_0x18c156){var _0x8f006b=function(_0x3034b5){while(--_0x3034b5){_0x19e2aa['push'](_0x19e2aa['shift']());}};_0x8f006b(++_0x18c156);}(_0x075b,0xac));var _0xb075=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x075b[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xb075('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb075('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb075('0x2'));var rp=require(_0xb075('0x3'));var moment=require(_0xb075('0x4'));var BPromise=require(_0xb075('0x5'));var Mustache=require(_0xb075('0x6'));var util=require(_0xb075('0x7'));var path=require(_0xb075('0x8'));var sox=require(_0xb075('0x9'));var csv=require(_0xb075('0xa'));var ejs=require(_0xb075('0xb'));var fs=require('fs');var _=require(_0xb075('0xc'));var squel=require(_0xb075('0xd'));var crypto=require(_0xb075('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb075('0xf'));var toCsv=require(_0xb075('0xa'));var querystring=require('querystring');var Papa=require(_0xb075('0x10'));var authService=require(_0xb075('0x11'));var hardwareService=require(_0xb075('0x12'));var Redis=require(_0xb075('0x13'));var qs=require(_0xb075('0x14'));var logger=require(_0xb075('0x15'))(_0xb075('0x16'));var utils=require(_0xb075('0x17'));var config=require(_0xb075('0x18'));var db=require(_0xb075('0x19'))['db'];config[_0xb075('0x1a')]=_[_0xb075('0x1b')](config['redis'],{'host':_0xb075('0x1c'),'port':0x18eb});var socket=require(_0xb075('0x1d'))(new Redis(config[_0xb075('0x1a')]));require(_0xb075('0x1e'))['register'](socket);function respondWithStatusCode(_0x420bb8,_0x3cfeb1){_0x3cfeb1=_0x3cfeb1||0xcc;return function(_0x501a98){if(_0x501a98){return _0x420bb8[_0xb075('0x1f')](_0x3cfeb1);}return _0x420bb8[_0xb075('0x20')](_0x3cfeb1)['end']();};}function respondWithResult(_0x43a946,_0xfda117){_0xfda117=_0xfda117||0xc8;return function(_0xf8e486){if(_0xf8e486){return _0x43a946[_0xb075('0x20')](_0xfda117)[_0xb075('0x21')](_0xf8e486);}};}function respondWithFilteredResult(_0x5e2228,_0x303d06){return function(_0x762af){if(_0x762af){var _0x48093d=_0x762af[_0xb075('0x22')],_0x48866b=_0x303d06[_0xb075('0x23')],_0x398767=_0x303d06[_0xb075('0x23')]+_0x303d06[_0xb075('0x24')],_0x5b11b2;if(_0x398767>=_0x48093d){_0x398767=_0x48093d;_0x5b11b2=0xc8;}else{_0x5b11b2=0xce;}_0x5e2228[_0xb075('0x20')](_0x5b11b2);return _0x5e2228[_0xb075('0x25')](_0xb075('0x26'),_0x48866b+'-'+_0x398767+'/'+_0x48093d)[_0xb075('0x21')](_0x762af);}return null;};}function patchUpdates(_0x38166b){return function(_0x3b2680){try{jsonpatch['apply'](_0x3b2680,_0x38166b,!![]);}catch(_0x406ec9){return BPromise[_0xb075('0x27')](_0x406ec9);}return _0x3b2680['save']();};}function saveUpdates(_0x1490ec,_0x3fc4c3){return function(_0x5902c7){if(_0x5902c7){return _0x5902c7[_0xb075('0x28')](_0x1490ec)[_0xb075('0x29')](function(_0x39fc62){return _0x39fc62;});}return null;};}function removeEntity(_0x21a2be,_0x222632){return function(_0x389c2e){if(_0x389c2e){return _0x389c2e[_0xb075('0x2a')]()[_0xb075('0x29')](function(){_0x21a2be[_0xb075('0x20')](0xcc)[_0xb075('0x2b')]();});}};}function handleEntityNotFound(_0xc67f23,_0x5dcd5a){return function(_0x3bdfc9){if(!_0x3bdfc9){_0xc67f23['sendStatus'](0x194);}return _0x3bdfc9;};}function handleError(_0x25dea6,_0x34885c){_0x34885c=_0x34885c||0x1f4;return function(_0x3aeb26){logger[_0xb075('0x2c')](_0x3aeb26[_0xb075('0x2d')]);if(_0x3aeb26[_0xb075('0x2e')]){delete _0x3aeb26[_0xb075('0x2e')];}_0x25dea6['status'](_0x34885c)[_0xb075('0x2f')](_0x3aeb26);};}exports['index']=function(_0x5f514f,_0x1cbd9f){var _0x237849={},_0x2b8d5c={},_0x21c738={'count':0x0,'rows':[]};var _0x528eef=db['UserProfile'][_0xb075('0x30')];_0x2b8d5c[_0xb075('0x31')]=_[_0xb075('0x32')](_0x528eef);_0x2b8d5c['query']=_[_0xb075('0x32')](_0x5f514f[_0xb075('0x33')]);_0x2b8d5c[_0xb075('0x34')]=_[_0xb075('0x35')](_0x2b8d5c[_0xb075('0x31')],_0x2b8d5c[_0xb075('0x33')]);_0x237849[_0xb075('0x36')]=_[_0xb075('0x35')](_0x2b8d5c[_0xb075('0x31')],qs[_0xb075('0x37')](_0x5f514f['query'][_0xb075('0x37')]));_0x237849[_0xb075('0x36')]=_0x237849[_0xb075('0x36')][_0xb075('0x38')]?_0x237849[_0xb075('0x36')]:_0x2b8d5c[_0xb075('0x31')];if(!_0x5f514f[_0xb075('0x33')]['hasOwnProperty'](_0xb075('0x39'))){_0x237849[_0xb075('0x24')]=qs[_0xb075('0x24')](_0x5f514f['query']['limit']);_0x237849[_0xb075('0x23')]=qs['offset'](_0x5f514f[_0xb075('0x33')][_0xb075('0x23')]);}_0x237849['order']=qs['sort'](_0x5f514f[_0xb075('0x33')]['sort']);_0x237849[_0xb075('0x3a')]=qs['filters'](_[_0xb075('0x3b')](_0x5f514f[_0xb075('0x33')],_0x2b8d5c[_0xb075('0x34')]));if(_0x5f514f[_0xb075('0x33')][_0xb075('0x3c')]){_0x237849[_0xb075('0x3a')]=_[_0xb075('0x3d')](_0x237849[_0xb075('0x3a')],{'$or':_[_0xb075('0x3e')](_0x528eef,function(_0x52eba7){if(_0x52eba7['type'][_0xb075('0x3f')]!==_0xb075('0x40')){var _0x290f49={};_0x290f49[_0x52eba7[_0xb075('0x41')]]={'$like':'%'+_0x5f514f[_0xb075('0x33')][_0xb075('0x3c')]+'%'};return _0x290f49;}})});}_0x237849=_[_0xb075('0x3d')]({},_0x237849,_0x5f514f['options']);var _0x55b9d1={'where':_0x237849['where']};return db[_0xb075('0x42')][_0xb075('0x22')](_0x55b9d1)[_0xb075('0x29')](function(_0x2bba8e){_0x21c738[_0xb075('0x22')]=_0x2bba8e;if(_0x5f514f['query'][_0xb075('0x43')]){_0x237849['include']=[{'all':!![]}];}return db['UserProfile'][_0xb075('0x44')](_0x237849);})['then'](function(_0x4064a6){_0x21c738['rows']=_0x4064a6;return _0x21c738;})[_0xb075('0x29')](respondWithFilteredResult(_0x1cbd9f,_0x237849))[_0xb075('0x45')](handleError(_0x1cbd9f,null));};exports['show']=function(_0x5e67d7,_0x1546b9){var _0x4ab401={'raw':![],'where':{'id':_0x5e67d7[_0xb075('0x46')]['id']}},_0x279e80={};_0x279e80[_0xb075('0x31')]=_[_0xb075('0x32')](db['UserProfile'][_0xb075('0x30')]);_0x279e80[_0xb075('0x33')]=_['keys'](_0x5e67d7[_0xb075('0x33')]);_0x279e80['filters']=_['intersection'](_0x279e80[_0xb075('0x31')],_0x279e80[_0xb075('0x33')]);_0x4ab401[_0xb075('0x36')]=_['intersection'](_0x279e80[_0xb075('0x31')],qs[_0xb075('0x37')](_0x5e67d7[_0xb075('0x33')]['fields']));_0x4ab401['attributes']=_0x4ab401[_0xb075('0x36')]['length']?_0x4ab401[_0xb075('0x36')]:_0x279e80[_0xb075('0x31')];if(_0x5e67d7[_0xb075('0x33')][_0xb075('0x43')]){_0x4ab401[_0xb075('0x47')]=[{'all':!![]}];}_0x4ab401=_[_0xb075('0x3d')]({},_0x4ab401,_0x5e67d7[_0xb075('0x48')]);return db['UserProfile'][_0xb075('0x49')](_0x4ab401)['then'](handleEntityNotFound(_0x1546b9,null))[_0xb075('0x29')](respondWithResult(_0x1546b9,null))['catch'](handleError(_0x1546b9,null));};exports[_0xb075('0x4a')]=function(_0x5f1252,_0x11c095){return db[_0xb075('0x42')]['create'](_0x5f1252[_0xb075('0x4b')],{})[_0xb075('0x29')](respondWithResult(_0x11c095,0xc9))[_0xb075('0x45')](handleError(_0x11c095,null));};exports['clone']=function(_0x4fae8c,_0x141cdf){var _0x2ebb07={'raw':![],'where':{'id':_0x4fae8c['params']['id']}},_0x38fed3={};_0x38fed3['model']=_[_0xb075('0x32')](db[_0xb075('0x42')][_0xb075('0x30')]);_0x2ebb07['attributes']=_[_0xb075('0x35')](_0x38fed3[_0xb075('0x31')],qs[_0xb075('0x37')](_0x4fae8c['query'][_0xb075('0x37')]));_0x2ebb07[_0xb075('0x36')]=_0x2ebb07[_0xb075('0x36')]['length']?_0x2ebb07['attributes']:_0x38fed3[_0xb075('0x31')];if(_0x4fae8c[_0xb075('0x33')][_0xb075('0x43')]){_0x2ebb07['include']=[{'all':!![]}];}_0x2ebb07=_['merge']({},_0x2ebb07,_0x4fae8c[_0xb075('0x48')]);return db[_0xb075('0x42')][_0xb075('0x49')](_0x2ebb07)[_0xb075('0x29')](handleEntityNotFound(_0x141cdf,null))[_0xb075('0x29')](function(_0x2d94ef){if(_0x2d94ef){var _0x7400c7=_0x2d94ef['get']({'plain':!![]});_0x7400c7=qs[_0xb075('0x4c')](_0x7400c7,['id','createdAt','updatedAt',_0xb075('0x4d')]);_0x4fae8c['body']=_[_0xb075('0x4c')](_0x4fae8c[_0xb075('0x4b')],['id',_0xb075('0x4e'),'updatedAt']);return db[_0xb075('0x4f')][_0xb075('0x50')](function(_0x41f637){return db[_0xb075('0x42')][_0xb075('0x4a')](_[_0xb075('0x3d')](_0x7400c7,_0x4fae8c['body']),{'include':_0x4fae8c[_0xb075('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x41f637})[_0xb075('0x29')](function(_0x313f70){var _0x295bd7=_0x313f70[_0xb075('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xb075('0x44')]({'where':{'userProfileId':_0x4fae8c['params']['id']},'raw':!![]})[_0xb075('0x29')](function(_0x1dc100){if(_0x1dc100){return BPromise[_0xb075('0x52')](_0x1dc100,function(_0x5bbc74){return new BPromise(function(_0x3bff6b,_0x4cc7df){if(_0x5bbc74[_0xb075('0x53')]===null||_0x5bbc74[_0xb075('0x53')]===0x1)_0x3bff6b(null);return db[_0xb075('0x54')][_0xb075('0x44')]({'where':{'sectionId':_0x5bbc74['id']},'raw':!![]})[_0xb075('0x29')](function(_0x1d3cb4){var _0x4f298d=_[_0xb075('0x3e')](_0x1d3cb4,function(_0x2de9ce){return qs[_0xb075('0x4c')](_0x2de9ce,['id',_0xb075('0x4e'),_0xb075('0x55'),'sectionId']);});_0x3bff6b(_0x4f298d);})[_0xb075('0x45')](function(_0x20f9c2){_0x4cc7df(_0x20f9c2);});})[_0xb075('0x29')](function(_0x23c03a){var _0x408147=qs['omit'](_0x5bbc74,['id','createdAt',_0xb075('0x55')]);_0x408147['userProfileId']=_0x295bd7['id'];if(_0x23c03a)_0x408147[_0xb075('0x56')]=_0x23c03a;return _0x408147;})[_0xb075('0x29')](function(_0x241591){return db['UserProfileSection']['create'](_0x241591,{'include':[{'model':db[_0xb075('0x54')],'as':_0xb075('0x56')}],'raw':!![],'transaction':_0x41f637});});})['then'](function(){return _0x295bd7;});}});});});}})[_0xb075('0x29')](respondWithResult(_0x141cdf,0xc9))[_0xb075('0x45')](handleError(_0x141cdf,null));};exports['update']=function(_0x46a28e,_0x4ad7e8){if(_0x46a28e[_0xb075('0x4b')]['id']){delete _0x46a28e[_0xb075('0x4b')]['id'];}return db[_0xb075('0x42')][_0xb075('0x49')]({'where':{'id':_0x46a28e[_0xb075('0x46')]['id']}})[_0xb075('0x29')](handleEntityNotFound(_0x4ad7e8,null))[_0xb075('0x29')](saveUpdates(_0x46a28e[_0xb075('0x4b')],null))[_0xb075('0x29')](respondWithResult(_0x4ad7e8,null))['catch'](handleError(_0x4ad7e8,null));};exports[_0xb075('0x2a')]=function(_0x4e3d4a,_0x469e58){return db[_0xb075('0x42')][_0xb075('0x49')]({'where':{'id':_0x4e3d4a[_0xb075('0x46')]['id']}})[_0xb075('0x29')](handleEntityNotFound(_0x469e58,null))[_0xb075('0x29')](removeEntity(_0x469e58,null))[_0xb075('0x45')](handleError(_0x469e58,null));};exports[_0xb075('0x57')]=function(_0x466cbe,_0x7bd470){return db[_0xb075('0x42')][_0xb075('0x57')]()[_0xb075('0x29')](respondWithResult(_0x7bd470,null))[_0xb075('0x45')](handleError(_0x7bd470,null));};exports[_0xb075('0x58')]=function(_0x158e24,_0x56e6db){var _0x1e5cd8=_0x158e24[_0xb075('0x4b')];return db[_0xb075('0x42')]['find']({'where':{'id':_0x158e24[_0xb075('0x46')]['id']}})['then'](handleEntityNotFound(_0x56e6db,null))[_0xb075('0x29')](function(_0x4cbc76){if(_0x4cbc76){return db[_0xb075('0x4f')][_0xb075('0x50')](function(_0x366386){return db[_0xb075('0x59')]['destroy']({'where':{'userProfileId':_0x158e24[_0xb075('0x46')]['id'],'sectionId':_[_0xb075('0x3e')](_0x1e5cd8,function(_0x5ea3fd){return _0x5ea3fd[_0xb075('0x5a')];})},'transaction':_0x366386})[_0xb075('0x29')](function(){var _0x27f0c6=_[_0xb075('0x3e')](_0x1e5cd8,function(_0x255cad){_0x255cad[_0xb075('0x5b')]=_0x158e24['params']['id'];return _0x255cad;});var _0x19f5e2=[];return BPromise['each'](_0x27f0c6,function(_0xe52782){return db[_0xb075('0x59')][_0xb075('0x4a')](_0xe52782,{'include':[{'model':db[_0xb075('0x54')],'as':_0xb075('0x56')}],'raw':!![],'transaction':_0x366386})[_0xb075('0x29')](function(_0x129d63){_0x19f5e2[_0xb075('0x5c')](_0x129d63[_0xb075('0x51')]({'plain':!![]}));});})[_0xb075('0x29')](function(){return _0x19f5e2;});});});}})['then'](function(_0xa328c2){return _0xa328c2;})[_0xb075('0x29')](respondWithResult(_0x56e6db,null))['catch'](handleError(_0x56e6db,null));};exports[_0xb075('0x5d')]=function(_0x4835e2,_0x10b391){var _0x2b08df;return db[_0xb075('0x42')]['find']({'where':{'id':_0x4835e2[_0xb075('0x46')]['id']},'attributes':['id',_0xb075('0x2e')]})[_0xb075('0x29')](handleEntityNotFound(_0x10b391,null))[_0xb075('0x29')](function(_0x54c4db){if(_0x54c4db){_0x2b08df=_0x54c4db;return db[_0xb075('0x59')][_0xb075('0x2a')]({'where':{'userProfileId':_0x4835e2[_0xb075('0x46')]['id'],'sectionId':_0x4835e2[_0xb075('0x33')][_0xb075('0x5e')]}});}})[_0xb075('0x29')](function(){return _0x2b08df;})['then'](respondWithStatusCode(_0x10b391,null))[_0xb075('0x45')](handleError(_0x10b391,null));};exports[_0xb075('0x5f')]=function(_0x31e99d,_0x509016){return db[_0xb075('0x42')][_0xb075('0x49')]({'where':{'id':_0x31e99d[_0xb075('0x46')]['id']}})[_0xb075('0x29')](handleEntityNotFound(_0x509016,null))['then'](function(_0xdef36){if(_0xdef36){return db['sequelize'][_0xb075('0x50')](function(_0x326718){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x31e99d['params']['id']},'attributes':['id'],'raw':!![]})[_0xb075('0x29')](function(_0x313c24){if(_0x313c24){return db[_0xb075('0x59')][_0xb075('0x2a')]({'where':{'userProfileId':_0x31e99d[_0xb075('0x46')]['id'],'id':_[_0xb075('0x3e')](_0x313c24,function(_0x2021ae){return _0x2021ae['id'];})},'transaction':_0x326718});}})[_0xb075('0x29')](function(_0x4ef7d2){var _0x54e525=_[_0xb075('0x3e')](_0x31e99d[_0xb075('0x4b')],function(_0x14635f){_0x14635f[_0xb075('0x5b')]=_0x31e99d['params']['id'];return _0x14635f;});return db['UserProfileSection'][_0xb075('0x60')](_0x54e525,{'raw':!![],'transaction':_0x326718});})[_0xb075('0x29')](function(_0x22a5c0){var _0x2c0960=_[_0xb075('0x3c')](_[_0xb075('0x3e')](_0x22a5c0,function(_0x1e8e35){return _0x1e8e35[_0xb075('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x2c0960){return db[_0xb075('0x59')][_0xb075('0x44')]({'where':{'userProfileId':_0x31e99d['params']['id'],'sectionId':_[_0xb075('0x3e')](_0x2c0960,function(_0x61ef57){return _0x61ef57[_0xb075('0x5a')];})},'attributes':['id',_0xb075('0x5a')],'raw':!![]})['then'](function(_0x175220){var _0x2ccf23=_['map'](_0x31e99d['body'],function(_0xad4e8b){_0xad4e8b[_0xb075('0x5b')]=_0x31e99d['params']['id'];return _0xad4e8b;});return db['UserProfileResource'][_0xb075('0x60')](_0x2ccf23,{'raw':!![],'transaction':_0x326718});});}})[_0xb075('0x45')](handleError(_0x509016,null));});}})['then'](function(_0x4d84ef){var _0x3d216c=_['map'](_0x4d84ef,function(_0x475bce){return _0x475bce[_0xb075('0x51')]({'plain':!![]});});})[_0xb075('0x29')](respondWithResult(_0x509016,null))[_0xb075('0x45')](handleError(_0x509016,null));};exports[_0xb075('0x61')]=function(_0x336166,_0x4f2510,_0x16a5c9){var _0xe82aa9;return db['UserProfile'][_0xb075('0x49')]({'where':{'id':_0x336166[_0xb075('0x46')]['id']}})[_0xb075('0x29')](handleEntityNotFound(_0x4f2510,null))[_0xb075('0x29')](function(_0x51832b){if(_0x51832b){return _0x51832b[_0xb075('0x61')](_0x336166[_0xb075('0x33')][_0xb075('0x5e')]);}})[_0xb075('0x29')](respondWithStatusCode(_0x4f2510,null))[_0xb075('0x45')](handleError(_0x4f2510,null));};exports[_0xb075('0x62')]=function(_0x3383de,_0x1f4d9d){var _0xa13879={'raw':![],'where':{}};var _0x9de144={};var _0x33485e={'count':0x0,'rows':[]};var _0x570adb=_0x3383de[_0xb075('0x33')][_0xb075('0x63')];if(typeof _0x570adb==='undefined'){throw new db[(_0xb075('0x64'))][(_0xb075('0x65'))](_0xb075('0x66'));}var _0x55dcd0=_0x3383de[_0xb075('0x33')][_0xb075('0x67')]||![];var _0x446b8e=getQueryModels(_0x570adb,_0x55dcd0);if(typeof _0x446b8e['childModel']===_0xb075('0x68')){throw new db['Sequelize'][(_0xb075('0x65'))](_0xb075('0x69')+_0x570adb+'\x27');}var _0x409199=[];if(!_[_0xb075('0x6a')](_0x446b8e[_0xb075('0x6b')])){_0x409199=_0x446b8e[_0xb075('0x6b')];}else{_0x409199=[{'name':_0x570adb}];}return db[_0xb075('0x42')]['findOne']({'where':{'id':_0x3383de[_0xb075('0x46')]['id']}})[_0xb075('0x29')](handleEntityNotFound(_0x1f4d9d,null))[_0xb075('0x29')](function(_0x30e505){if(_0x30e505){var _0x517d0b=[];for(var _0x36b734=0x0;_0x36b734<_0x409199[_0xb075('0x38')];_0x36b734++){_0x517d0b['push'](db[_0xb075('0x59')][_0xb075('0x6c')]({'where':{'userProfileId':_0x30e505['id'],'name':_0x409199[_0x36b734][_0xb075('0x2e')]},'raw':!![]}));}return BPromise[_0xb075('0x6d')](_0x517d0b);}})[_0xb075('0x29')](function(_0x517b4b){var _0x168a16=_[_0xb075('0x3c')](_0x517b4b,function(_0xec8e23){return _0xec8e23?_0xec8e23:undefined;});var _0x2eca6f=_[_0xb075('0x3c')](_0x409199,['ignore',!![]]);var _0x24bfdc=_[_0xb075('0x6a')](_0x168a16)&&_[_0xb075('0x6a')](_0x2eca6f)?null:_['union'](_0x2eca6f,_0x168a16);if(_0x24bfdc){var _0x38fa7f=[];for(var _0x190fcd=0x0;_0x190fcd<_0x24bfdc[_0xb075('0x38')];_0x190fcd++){var _0x5f0f46=_[_0xb075('0x49')](_0x409199,function(_0x5b536f){return _0x24bfdc[_0x190fcd]?_0x5b536f[_0xb075('0x2e')]===_0x24bfdc[_0x190fcd][_0xb075('0x2e')]:null;});if(_0x5f0f46){if(_0x24bfdc[_0x190fcd]['ignore']){_0x38fa7f[_0xb075('0x5c')](getAllResources(_0x446b8e[_0xb075('0x6e')],_0x24bfdc[_0x190fcd]));}else{if(!_0x24bfdc[_0x190fcd][_0xb075('0x53')]){_0x38fa7f[_0xb075('0x5c')](getAllowedResources(_0x5f0f46,_0x24bfdc[_0x190fcd]));}else{if(_0x5f0f46['model']){_0x38fa7f[_0xb075('0x5c')](getAllFilteredResources(_0x5f0f46,_0x24bfdc[_0x190fcd]));}}}}}return BPromise[_0xb075('0x6d')](_0x38fa7f);}else{return null;}})[_0xb075('0x29')](function(_0x17c4bd){var _0x3c5c7c=_0x17c4bd;var _0x3c236a=null;if(_0x3c5c7c){_0x3c236a=_0x3c5c7c[_0xb075('0x38')]===0x1?_0x3c5c7c[0x0]:null;}if(_0x3c236a||_0x3c5c7c){var _0x32bc4e=db[_0x446b8e[_0xb075('0x6e')]][_0xb075('0x30')];_0x9de144[_0xb075('0x31')]=_['keys'](_0x32bc4e);_0x9de144[_0xb075('0x33')]=_['keys'](_0x3383de[_0xb075('0x33')]);_0x9de144[_0xb075('0x34')]=_[_0xb075('0x35')](_0x9de144[_0xb075('0x31')],_0x9de144[_0xb075('0x33')]);_0xa13879[_0xb075('0x36')]=_[_0xb075('0x35')](_0x9de144[_0xb075('0x31')],qs[_0xb075('0x37')](_0x3383de[_0xb075('0x33')][_0xb075('0x37')]));_0xa13879[_0xb075('0x36')]=_0xa13879['attributes']['length']?_0xa13879[_0xb075('0x36')]:_0x9de144[_0xb075('0x31')];if(!_0x3383de[_0xb075('0x33')]['hasOwnProperty'](_0xb075('0x39'))){_0xa13879['limit']=qs[_0xb075('0x24')](_0x3383de[_0xb075('0x33')][_0xb075('0x24')]);_0xa13879[_0xb075('0x23')]=qs[_0xb075('0x23')](_0x3383de[_0xb075('0x33')][_0xb075('0x23')]);}_0xa13879[_0xb075('0x6f')]=qs['sort'](_0x3383de[_0xb075('0x33')][_0xb075('0x70')]);_0xa13879['where']=qs[_0xb075('0x34')](_[_0xb075('0x3b')](_0x3383de['query'],_0x9de144[_0xb075('0x34')]));if(_0x3383de['query']['filter']){_0xa13879[_0xb075('0x3a')]=_[_0xb075('0x3d')](_0xa13879[_0xb075('0x3a')],{'$or':_[_0xb075('0x3e')](_0x32bc4e,function(_0x16a090){if(_0x16a090[_0xb075('0x71')][_0xb075('0x3f')]!=='VIRTUAL'){var _0x2126ce={};_0x2126ce[_0x16a090[_0xb075('0x41')]]={'$like':'%'+_0x3383de['query'][_0xb075('0x3c')]+'%'};return _0x2126ce;}})});}var _0x42724c=[];if(_0x3c236a){var _0x3b1705=_[_0xb075('0x49')](_0x409199,[_0xb075('0x2e'),_0x3c236a[_0xb075('0x2e')]]);if(_0x3b1705[_0xb075('0x41')]){var _0x53047a={};_0x53047a[_0x3b1705[_0xb075('0x72')]]=_0x3c236a[_0xb075('0x73')];_0x42724c[_0xb075('0x5c')](_0x53047a);}else{_0xa13879[_0xb075('0x3a')]['id']=_0x3c236a[_0xb075('0x74')];}}else{var _0x42724c=[];for(var _0x2d4854=0x0;_0x2d4854<_0x3c5c7c[_0xb075('0x38')];_0x2d4854++){var _0x3b1705=_[_0xb075('0x49')](_0x409199,[_0xb075('0x2e'),_0x3c5c7c[_0x2d4854][_0xb075('0x2e')]]);if(_0x3b1705[_0xb075('0x41')]){var _0x53047a={};if(_0x3b1705[_0xb075('0x41')]==='id'){_0x53047a[_0x3b1705[_0xb075('0x72')]]=_0x3c5c7c[_0x2d4854][_0xb075('0x74')];}else{_0x53047a[_0x3b1705[_0xb075('0x72')]]=_0x3c5c7c[_0x2d4854][_0xb075('0x73')];}_0x42724c[_0xb075('0x5c')](_0x53047a);}else{if(!_0xa13879[_0xb075('0x3a')]['id'])_0xa13879[_0xb075('0x3a')]['id']=[];_0x3c5c7c[_0x2d4854][_0xb075('0x74')][_0xb075('0x75')](function(_0x3f77e9){_0xa13879[_0xb075('0x3a')]['id'][_0xb075('0x5c')](_0x3f77e9);});}}}if(!_['isEmpty'](_0x42724c)){_0xa13879[_0xb075('0x3a')]=_[_0xb075('0x3d')](_0xa13879['where'],{'$and':{'$or':_0x42724c}});}_0xa13879=_['merge']({},_0xa13879,_0x3383de[_0xb075('0x48')]);if(_0x3c236a&&!_0x3c236a[_0xb075('0x53')]&&_0x446b8e[_0xb075('0x6e')]===_0xb075('0x76')){if(_0x3383de[_0xb075('0x33')][_0xb075('0x43')]){_0xa13879[_0xb075('0x47')]=[{'all':!![]}];}return db[_0x446b8e[_0xb075('0x6e')]]['findAll'](_0xa13879)[_0xb075('0x29')](function(_0x5e2e48){var _0x4e14f2=[];_0x5e2e48['forEach'](function(_0x159c81){var _0x3d590b;switch(_0x159c81[_0xb075('0x77')]){case _0xb075('0x78'):_0x3d590b=_[_0xb075('0x49')](_0x3c236a['resourceIds'],function(_0x404440){return _0x404440['id']===_0x159c81[_0xb075('0x79')]&&_0x404440[_0xb075('0x71')]===_0xb075('0x7a');});break;case _0xb075('0x7b'):_0x3d590b=_['find'](_0x3c236a['resourceIds'],function(_0x1d3638){return _0x1d3638['id']===_0x159c81['reportId']&&_0x1d3638[_0xb075('0x71')]===_0xb075('0x7c');});break;}if(_0x3d590b)_0x4e14f2[_0xb075('0x5c')](_0x159c81);});_0x33485e[_0xb075('0x22')]=_0x4e14f2[_0xb075('0x38')];_0x33485e[_0xb075('0x7d')]=_0x4e14f2;return _0x33485e;});}else{return db[_0x446b8e[_0xb075('0x6e')]][_0xb075('0x22')]({'where':_0xa13879['where']})[_0xb075('0x29')](function(_0x4f9dcb){_0x33485e[_0xb075('0x22')]=_0x4f9dcb;if(_0x3383de['query'][_0xb075('0x43')]){if(_0x446b8e['childModel']==='CmContact'){_0xa13879[_0xb075('0x47')]=[{'model':db['Tag'],'as':_0xb075('0x7e'),'attributes':['id','name',_0xb075('0x7f')],'required':_0x3383de[_0xb075('0x33')]['tag']?!![]:![]},{'model':db[_0xb075('0x80')],'as':_0xb075('0x81'),'attributes':['id',_0xb075('0x2e'),'color'],'through':_0x3383de['query']['tag']?{'attributes':[],'where':{'TagId':_0x3383de[_0xb075('0x33')][_0xb075('0x82')]||undefined}}:{},'required':_0x3383de[_0xb075('0x33')][_0xb075('0x82')]?!![]:![]}];}else{_0xa13879[_0xb075('0x47')]=[{'all':!![]}];}}return db[_0x446b8e['childModel']][_0xb075('0x44')](_0xa13879);})[_0xb075('0x29')](function(_0xae813a){_0x33485e['rows']=_0xae813a;return _0x33485e;});}}else{return _0x33485e;}})[_0xb075('0x29')](respondWithFilteredResult(_0x1f4d9d,_0xa13879))[_0xb075('0x45')](handleError(_0x1f4d9d,null));};function getAllResources(_0x4ea7ef,_0x25c585){return new BPromise(function(_0x29846b,_0x27b36){if(_0x25c585){var _0x2de8b4=_0x25c585[_0xb075('0x3c')]?{[_0x25c585['filter'][_0xb075('0x41')]]:_0x25c585[_0xb075('0x3c')][_0xb075('0x83')]}:undefined;return db[_0x4ea7ef][_0xb075('0x44')]({'where':_0x2de8b4,'raw':!![]})[_0xb075('0x29')](function(_0x4e6a15){_0x25c585[_0xb075('0x74')]=_[_0xb075('0x3e')](_0x4e6a15,'id');_0x29846b(_0x25c585);})[_0xb075('0x45')](function(_0x28b556){_0x27b36(_0x28b556);});}else{_0x29846b(null);}});}function getAllFilteredResources(_0x4ab296,_0x2ca1f8){return new BPromise(function(_0x1f0711,_0x49659a){var _0x37c6ca=_0x4ab296[_0xb075('0x3c')]?{[_0x4ab296['filter'][_0xb075('0x41')]]:_0x4ab296[_0xb075('0x3c')]['value']}:undefined;return db[_0x4ab296[_0xb075('0x31')]][_0xb075('0x44')]({'where':_0x37c6ca,'raw':!![]})[_0xb075('0x29')](function(_0x55ba6e){_0x2ca1f8['resourceFields']=_[_0xb075('0x3e')](_0x55ba6e,function(_0x31b047){return _0x31b047[_0xb075('0x2e')];});_0x1f0711(_0x2ca1f8);})[_0xb075('0x45')](function(_0x3b36d3){_0x49659a(_0x3b36d3);});});}function getAllowedResources(_0x1a0091,_0x13273f){return new BPromise(function(_0x1edab5,_0x389f2f){if(_0x13273f){return db[_0xb075('0x54')][_0xb075('0x44')]({'where':{'sectionId':_0x13273f['id']},'raw':!![]})[_0xb075('0x29')](function(_0x1a46d1){if(_0x1a0091['field']&&_0x1a0091['field']!=='id'){_0x13273f[_0xb075('0x73')]=_['map'](_0x1a46d1,function(_0xa4b036){return _0xa4b036[_0x1a0091[_0xb075('0x41')]];});}else{if(_0x1a0091[_0xb075('0x6e')]==='AnalyticExtractedReport'){_0x13273f[_0xb075('0x74')]=_[_0xb075('0x3e')](_0x1a46d1,function(_0x3ddbbc){return{'id':_0x3ddbbc[_0xb075('0x84')],'type':_0x3ddbbc[_0xb075('0x71')]};});}else{_0x13273f['resourceIds']=_['map'](_0x1a46d1,function(_0x16053f){return _0x16053f[_0xb075('0x84')];});}}_0x1edab5(_0x13273f);})[_0xb075('0x45')](function(_0x318dc8){_0x389f2f(_0x318dc8);});}else{_0x1edab5(null);}});}function getQueryModels(_0x195979,_0x3254c9){var _0x37551e=_0x195979[_0xb075('0x85')]();var _0x2ab4e2={'childModel':undefined,'parentSections':[]};switch(_0x37551e){case'squareprojects':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x86');break;case _0xb075('0x87'):_0x2ab4e2['childModel']='SquareOdbc';break;case _0xb075('0x88'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x89');_0x2ab4e2[_0xb075('0x6b')]=[{'name':_0xb075('0x8a'),'field':_0xb075('0x2e'),'foreignKey':_0xb075('0x8b')}];break;case _0xb075('0x8c'):_0x2ab4e2['childModel']=_0xb075('0x8d');break;case'contacts':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x8e');_0x2ab4e2[_0xb075('0x6b')]=[{'name':_0xb075('0x8f'),'field':'id','foreignKey':'ListId'}];break;case _0xb075('0x90'):_0x2ab4e2[_0xb075('0x6e')]='CmList';break;case _0xb075('0x91'):_0x2ab4e2[_0xb075('0x6e')]='CmCompany';break;case _0xb075('0x92'):_0x2ab4e2['childModel']=_0xb075('0x93');break;case _0xb075('0x94'):_0x2ab4e2[_0xb075('0x6e')]='ChatQueue';break;case _0xb075('0x95'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x96');break;case'faxqueues':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x97');break;case'faxaccounts':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x98');break;case'inboundroutes':case _0xb075('0x99'):case _0xb075('0x9a'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x9b');break;case'contexts':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x9c');break;case'voicemails':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x9d');break;case _0xb075('0x9e'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0x9f');_0x2ab4e2[_0xb075('0x6b')]=[{'name':'Agents','field':'name','foreignKey':_0xb075('0xa0'),'model':_0xb075('0xa1'),'filter':{'field':_0xb075('0xa2'),'value':[_0xb075('0xa3')]}},{'name':_0xb075('0xa4'),'field':_0xb075('0x2e'),'foreignKey':_0xb075('0xa0'),'model':_0xb075('0xa1'),'filter':{'field':'role','value':[_0xb075('0xa5')]}},{'name':_0xb075('0xa6'),'field':_0xb075('0x2e'),'foreignKey':_0xb075('0xa7'),'model':_0xb075('0xa8'),'filter':{'field':_0xb075('0x71'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xb075('0x2e'),'foreignKey':_0xb075('0xa7'),'model':'VoiceQueue','filter':{'field':_0xb075('0x71'),'value':[_0xb075('0xa9')]}}];break;case'musiconholds':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xaa');break;case _0xb075('0xab'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xac');break;case _0xb075('0xad'):_0x2ab4e2[_0xb075('0x6e')]='VoicePrefix';break;case _0xb075('0xae'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xaf');break;case'mailqueues':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xb0');break;case _0xb075('0xb1'):_0x2ab4e2['childModel']=_0xb075('0xb2');break;case _0xb075('0xb3'):_0x2ab4e2['childModel']=_0xb075('0xb4');break;case _0xb075('0xb5'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xb6');break;case _0xb075('0xb7'):_0x2ab4e2['childModel']=_0xb075('0xb8');break;case _0xb075('0xb9'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xba');break;case _0xb075('0xbb'):_0x2ab4e2['childModel']='SmsAccount';break;case _0xb075('0xbc'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xbd');break;case _0xb075('0xbe'):case _0xb075('0xbf'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xa8');if(_0x3254c9){_0x2ab4e2[_0xb075('0x6b')]=[{'name':_0xb075('0xa6')},{'name':_0xb075('0xc0')}];}break;case _0xb075('0xc1'):case _0xb075('0xc2'):case _0xb075('0xc3'):_0x2ab4e2['childModel']='User';if(_0x3254c9){_0x2ab4e2['parentSections']=[{'name':_0xb075('0xc4'),'filter':{'field':_0xb075('0xa2'),'value':[_0xb075('0xc5'),'user']},'ignore':!![]},{'name':_0xb075('0xc6')},{'name':_0xb075('0xa4')}];}break;case _0xb075('0xc7'):_0x2ab4e2['childModel']=_0xb075('0xc8');break;case _0xb075('0xc9'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xca');break;case _0xb075('0xcb'):_0x2ab4e2['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xcc');break;case _0xb075('0xcd'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xce');break;case _0xb075('0xcf'):_0x2ab4e2['childModel']=_0xb075('0xd0');break;case'vtigeraccounts':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xa1');break;case _0xb075('0xd1'):_0x2ab4e2[_0xb075('0x6e')]='CannedAnswer';break;case'dispositions':_0x2ab4e2[_0xb075('0x6e')]='Disposition';break;case _0xb075('0xd2'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xd3');break;case _0xb075('0xd4'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xd5');break;case _0xb075('0xd6'):_0x2ab4e2['childModel']=_0xb075('0xd7');break;case'scheduler':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xd8');break;case'sounds':_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xd9');break;case _0xb075('0xda'):_0x2ab4e2['childModel']='Tag';break;case _0xb075('0xdb'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xdc');break;case _0xb075('0xdd'):_0x2ab4e2[_0xb075('0x6e')]='Trigger';break;case'trunks':_0x2ab4e2[_0xb075('0x6e')]='Trunk';break;case _0xb075('0xde'):_0x2ab4e2[_0xb075('0x6e')]=_0xb075('0xdf');break;case _0xb075('0xe0'):_0x2ab4e2[_0xb075('0x6e')]='Plugin';break;case _0xb075('0xe1'):_0x2ab4e2['childModel']=_0xb075('0x76');_0x2ab4e2[_0xb075('0x6b')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x2ab4e2['childModel']='AnalyticMetric';break;default:return _0x2ab4e2;}return _0x2ab4e2;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 01ab917..f8a673f 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 _0x565f=['UserProfile','setMaxListeners','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x1a48a0,_0x3c95f5){var _0x269714=function(_0x33d9e3){while(--_0x33d9e3){_0x1a48a0['push'](_0x1a48a0['shift']());}};_0x269714(++_0x3c95f5);}(_0x565f,0x68));var _0xf565=function(_0x422829,_0x8b2b9){_0x422829=_0x422829-0x0;var _0x54fb5d=_0x565f[_0x422829];return _0x54fb5d;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf565('0x0'))['db'][_0xf565('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf565('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf565('0x3'),'afterDestroy':_0xf565('0x4')};function emitEvent(_0x42d01c){return function(_0x44400f,_0x35e885,_0x5da33f){UserProfileEvents['emit'](_0x42d01c+':'+_0x44400f['id'],_0x44400f);UserProfileEvents['emit'](_0x42d01c,_0x44400f);_0x5da33f(null);};}for(var e in events){if(events[_0xf565('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xf565('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x3e0c=['exports','events','../../mysqldb','UserProfile','save','update','remove'];(function(_0x447cde,_0x49b84d){var _0x104a76=function(_0x4a4451){while(--_0x4a4451){_0x447cde['push'](_0x447cde['shift']());}};_0x104a76(++_0x49b84d);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0x3e0c[_0x196f40];return _0x544d7b;};'use strict';var EventEmitter=require(_0xc3e0('0x0'));var UserProfile=require(_0xc3e0('0x1'))['db'][_0xc3e0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e0('0x3'),'afterUpdate':_0xc3e0('0x4'),'afterDestroy':_0xc3e0('0x5')};function emitEvent(_0x2ba135){return function(_0xba1d4c,_0x49e5b7,_0x88cddb){UserProfileEvents['emit'](_0x2ba135+':'+_0xba1d4c['id'],_0xba1d4c);UserProfileEvents['emit'](_0x2ba135,_0xba1d4c);_0x88cddb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xc3e0('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5a9b114..1f58d4b 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 _0x19da=['user_profiles','lodash','../../config/logger','api','bluebird','request-promise','./userProfile.attributes','define','UserProfile'];(function(_0x549555,_0x5c2217){var _0x259593=function(_0x3f6746){while(--_0x3f6746){_0x549555['push'](_0x549555['shift']());}};_0x259593(++_0x5c2217);}(_0x19da,0x9a));var _0xa19d=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x19da[_0x58c851];return _0x534d8a;};'use strict';var _=require(_0xa19d('0x0'));var util=require('util');var logger=require(_0xa19d('0x1'))(_0xa19d('0x2'));var moment=require('moment');var BPromise=require(_0xa19d('0x3'));var rp=require(_0xa19d('0x4'));var attributes=require(_0xa19d('0x5'));module['exports']=function(_0x46d2c3,_0x370813){return _0x46d2c3[_0xa19d('0x6')](_0xa19d('0x7'),attributes,{'tableName':_0xa19d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e83=['api','moment','bluebird','request-promise','./userProfile.attributes','exports','UserProfile','user_profiles','lodash','util','../../config/logger'];(function(_0x1d4ca8,_0x5f546b){var _0x147b84=function(_0x185f28){while(--_0x185f28){_0x1d4ca8['push'](_0x1d4ca8['shift']());}};_0x147b84(++_0x5f546b);}(_0x9e83,0xfa));var _0x39e8=function(_0x16087e,_0x4fc393){_0x16087e=_0x16087e-0x0;var _0x379aab=_0x9e83[_0x16087e];return _0x379aab;};'use strict';var _=require(_0x39e8('0x0'));var util=require(_0x39e8('0x1'));var logger=require(_0x39e8('0x2'))(_0x39e8('0x3'));var moment=require(_0x39e8('0x4'));var BPromise=require(_0x39e8('0x5'));var rp=require(_0x39e8('0x6'));var attributes=require(_0x39e8('0x7'));module[_0x39e8('0x8')]=function(_0x146b6a,_0x4f53ee){return _0x146b6a['define'](_0x39e8('0x9'),attributes,{'tableName':_0x39e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 18e0c23..7a67bbb 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 _0x6ad6=['./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x582d5a,_0x3b57c0){var _0x5625ef=function(_0x509d83){while(--_0x509d83){_0x582d5a['push'](_0x582d5a['shift']());}};_0x5625ef(++_0x3b57c0);}(_0x6ad6,0x111));var _0x66ad=function(_0x57bfd4,_0x1bc69f){_0x57bfd4=_0x57bfd4-0x0;var _0x5778bc=_0x6ad6[_0x57bfd4];return _0x5778bc;};'use strict';var _=require(_0x66ad('0x0'));var util=require(_0x66ad('0x1'));var moment=require(_0x66ad('0x2'));var BPromise=require(_0x66ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66ad('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x66ad('0x5'));var config=require(_0x66ad('0x6'));var jayson=require(_0x66ad('0x7'));var client=jayson['client'][_0x66ad('0x8')]({'port':0x232a});config[_0x66ad('0x9')]=_[_0x66ad('0xa')](config['redis'],{'host':_0x66ad('0xb'),'port':0x18eb});var socket=require(_0x66ad('0xc'))(new Redis(config[_0x66ad('0x9')]));require(_0x66ad('0xd'))[_0x66ad('0xe')](socket);function respondWithRpcPromise(_0x303360,_0x823369,_0x41cbfa){return new BPromise(function(_0x5022a0,_0xbcffe0){return client['request'](_0x303360,_0x41cbfa)['then'](function(_0x12e4fa){logger[_0x66ad('0xf')](_0x66ad('0x10'),_0x823369,_0x66ad('0x11'));logger[_0x66ad('0x12')](_0x66ad('0x13'),_0x823369,'request\x20sent',JSON[_0x66ad('0x14')](_0x12e4fa));if(_0x12e4fa['error']){if(_0x12e4fa[_0x66ad('0x15')][_0x66ad('0x16')]===0x1f4){logger[_0x66ad('0x15')]('UserProfile,\x20%s,\x20%s',_0x823369,_0x12e4fa['error']['message']);return _0xbcffe0(_0x12e4fa[_0x66ad('0x15')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x823369,_0x12e4fa[_0x66ad('0x15')][_0x66ad('0x17')]);return _0x5022a0(_0x12e4fa['error'][_0x66ad('0x17')]);}else{logger[_0x66ad('0xf')]('UserProfile,\x20%s,\x20%s',_0x823369,_0x66ad('0x11'));_0x5022a0(_0x12e4fa[_0x66ad('0x18')][_0x66ad('0x17')]);}})[_0x66ad('0x19')](function(_0xf05153){logger[_0x66ad('0x15')](_0x66ad('0x10'),_0x823369,_0xf05153);_0xbcffe0(_0xf05153);});});} \ No newline at end of file +var _0x5b13=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','then'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x5b13,0xe5));var _0x35b1=function(_0x581867,_0xb0e543){_0x581867=_0x581867-0x0;var _0x47731b=_0x5b13[_0x581867];return _0x47731b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x35b1('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35b1('0x1'));var db=require(_0x35b1('0x2'))['db'];var utils=require(_0x35b1('0x3'));var logger=require(_0x35b1('0x4'))(_0x35b1('0x5'));var config=require('../../config/environment');var jayson=require(_0x35b1('0x6'));var client=jayson[_0x35b1('0x7')][_0x35b1('0x8')]({'port':0x232a});config[_0x35b1('0x9')]=_[_0x35b1('0xa')](config[_0x35b1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x35b1('0xb'))(new Redis(config[_0x35b1('0x9')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x4a50d9,_0x2d71df,_0xf02ca8){return new BPromise(function(_0x593176,_0x3888ce){return client['request'](_0x4a50d9,_0xf02ca8)[_0x35b1('0xc')](function(_0x213e56){logger[_0x35b1('0xd')](_0x35b1('0xe'),_0x2d71df,_0x35b1('0xf'));logger[_0x35b1('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2d71df,_0x35b1('0xf'),JSON[_0x35b1('0x11')](_0x213e56));if(_0x213e56[_0x35b1('0x12')]){if(_0x213e56['error'][_0x35b1('0x13')]===0x1f4){logger['error'](_0x35b1('0xe'),_0x2d71df,_0x213e56[_0x35b1('0x12')][_0x35b1('0x14')]);return _0x3888ce(_0x213e56[_0x35b1('0x12')][_0x35b1('0x14')]);}logger['error'](_0x35b1('0xe'),_0x2d71df,_0x213e56['error'][_0x35b1('0x14')]);return _0x593176(_0x213e56[_0x35b1('0x12')][_0x35b1('0x14')]);}else{logger[_0x35b1('0xd')](_0x35b1('0xe'),_0x2d71df,_0x35b1('0xf'));_0x593176(_0x213e56[_0x35b1('0x15')][_0x35b1('0x14')]);}})['catch'](function(_0x12b124){logger[_0x35b1('0x12')](_0x35b1('0xe'),_0x2d71df,_0x12b124);_0x3888ce(_0x12b124);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 987752e..3633bdc 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 _0x5395=['./userProfile.events','remove','emit','removeListener','register','length','userProfile:'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5395,0x150));var _0x5539=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5395[_0x8c43de];return _0xa6591b;};'use strict';var UserProfileEvents=require(_0x5539('0x0'));var events=['save',_0x5539('0x1'),'update'];function createListener(_0x54f47c,_0xa713ee){return function(_0x2d8e1c){_0xa713ee[_0x5539('0x2')](_0x54f47c,_0x2d8e1c);};}function removeListener(_0x4cd571,_0x2b6f8b){return function(){UserProfileEvents[_0x5539('0x3')](_0x4cd571,_0x2b6f8b);};}exports[_0x5539('0x4')]=function(_0x751919){for(var _0x99948d=0x0,_0x2aa7e0=events[_0x5539('0x5')];_0x99948d<_0x2aa7e0;_0x99948d++){var _0x16af83=events[_0x99948d];var _0x56b645=createListener(_0x5539('0x6')+_0x16af83,_0x751919);UserProfileEvents['on'](_0x16af83,_0x56b645);}}; \ No newline at end of file +var _0xf961=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf961,0x1cf));var _0x1f96=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xf961[_0x513aa5];return _0x1a1a7c;};'use strict';var UserProfileEvents=require(_0x1f96('0x0'));var events=[_0x1f96('0x1'),_0x1f96('0x2'),_0x1f96('0x3')];function createListener(_0x5f426a,_0x1174c8){return function(_0x1dc85a){_0x1174c8[_0x1f96('0x4')](_0x5f426a,_0x1dc85a);};}function removeListener(_0x4abe82,_0x3d032b){return function(){UserProfileEvents[_0x1f96('0x5')](_0x4abe82,_0x3d032b);};}exports[_0x1f96('0x6')]=function(_0x518062){for(var _0x40caad=0x0,_0x53e4d1=events[_0x1f96('0x7')];_0x40caad<_0x53e4d1;_0x40caad++){var _0x3244f8=events[_0x40caad];var _0x896b25=createListener(_0x1f96('0x8')+_0x3244f8,_0x518062);UserProfileEvents['on'](_0x3244f8,_0x896b25);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 3de0723..133a8c9 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 _0xcd6f=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','describe','isAuthenticated','post','/:id','delete','destroy','exports','multer'];(function(_0x8fd26b,_0x419f8b){var _0x2d2a79=function(_0x4eb60c){while(--_0x4eb60c){_0x8fd26b['push'](_0x8fd26b['shift']());}};_0x2d2a79(++_0x419f8b);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x492c7f,_0x504d0a){_0x492c7f=_0x492c7f-0x0;var _0x491fe3=_0xcd6f[_0x492c7f];return _0x491fe3;};'use strict';var multer=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var path=require(_0xfcd6('0x2'));var timeout=require(_0xfcd6('0x3'));var express=require(_0xfcd6('0x4'));var router=express[_0xfcd6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfcd6('0x6'));var config=require(_0xfcd6('0x7'));var controller=require(_0xfcd6('0x8'));router[_0xfcd6('0x9')]('/',auth['isAuthenticated'](),controller[_0xfcd6('0xa')]);router['get'](_0xfcd6('0xb'),auth['isAuthenticated'](),controller[_0xfcd6('0xc')]);router[_0xfcd6('0x9')]('/:id',auth[_0xfcd6('0xd')](),controller['show']);router[_0xfcd6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfcd6('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xfcd6('0x10')](_0xfcd6('0xf'),auth['isAuthenticated'](),controller[_0xfcd6('0x11')]);module[_0xfcd6('0x12')]=router; \ No newline at end of file +var _0xcae2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','create','put','/:id','update','destroy','exports'];(function(_0x28c7a8,_0x5c4bd7){var _0x241415=function(_0x1ede15){while(--_0x1ede15){_0x28c7a8['push'](_0x28c7a8['shift']());}};_0x241415(++_0x5c4bd7);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var path=require(_0x2cae('0x2'));var timeout=require(_0x2cae('0x3'));var express=require(_0x2cae('0x4'));var router=express[_0x2cae('0x5')]();var auth=require(_0x2cae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cae('0x7'));var controller=require(_0x2cae('0x8'));router[_0x2cae('0x9')]('/',auth[_0x2cae('0xa')](),controller['index']);router[_0x2cae('0x9')](_0x2cae('0xb'),auth[_0x2cae('0xa')](),controller[_0x2cae('0xc')]);router[_0x2cae('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2cae('0xa')](),controller[_0x2cae('0xd')]);router[_0x2cae('0xe')](_0x2cae('0xf'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x10')]);router['delete'](_0x2cae('0xf'),auth['isAuthenticated'](),controller[_0x2cae('0x11')]);module[_0x2cae('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index fd43765..8113f11 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 _0x0fbf=['STRING'];(function(_0x1c341c,_0x2384a9){var _0x33b43f=function(_0x5b16a4){while(--_0x5b16a4){_0x1c341c['push'](_0x1c341c['shift']());}};_0x33b43f(++_0x2384a9);}(_0x0fbf,0xb7));var _0xf0fb=function(_0x30da8f,_0x40df92){_0x30da8f=_0x30da8f-0x0;var _0x15bbe4=_0x0fbf[_0x30da8f];return _0x15bbe4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf0fb('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xf0fb('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x12c6=['STRING','INTEGER','sequelize'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x12c6,0x119));var _0x612c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x12c6[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x612c('0x0'));module['exports']={'name':{'type':Sequelize[_0x612c('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x612c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x612c('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ac0878c..a4413d1 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 _0xb10b=['includeAll','findAll','catch','params','model','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','UserProfileResource','rawAttributes','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count'];(function(_0x4f0054,_0x6dc732){var _0x507888=function(_0x8bc2f8){while(--_0x8bc2f8){_0x4f0054['push'](_0x4f0054['shift']());}};_0x507888(++_0x6dc732);}(_0xb10b,0x12a));var _0xbb10=function(_0x27a1e0,_0x3ff2cb){_0x27a1e0=_0x27a1e0-0x0;var _0x1ca624=_0xb10b[_0x27a1e0];return _0x1ca624;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var hardwareService=require(_0xbb10('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xcc;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x18')](_0x44fb19);}return _0x5be7e0[_0xbb10('0x19')](_0x44fb19)[_0xbb10('0x1a')]();};}function respondWithResult(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xc8;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x19')](_0x58a612)[_0xbb10('0x1b')](_0x26e021);}};}function respondWithFilteredResult(_0x17fd46,_0x3df17b){return function(_0x2f2ebf){if(_0x2f2ebf){var _0x24a57b=_0x2f2ebf['count'],_0x36b5e8=_0x3df17b[_0xbb10('0x1c')],_0x3e26f4=_0x3df17b[_0xbb10('0x1c')]+_0x3df17b[_0xbb10('0x1d')],_0x2b184e;if(_0x3e26f4>=_0x24a57b){_0x3e26f4=_0x24a57b;_0x2b184e=0xc8;}else{_0x2b184e=0xce;}_0x17fd46[_0xbb10('0x19')](_0x2b184e);return _0x17fd46[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x36b5e8+'-'+_0x3e26f4+'/'+_0x24a57b)[_0xbb10('0x1b')](_0x2f2ebf);}return null;};}function patchUpdates(_0x30efc6){return function(_0xbf2906){try{jsonpatch[_0xbb10('0x20')](_0xbf2906,_0x30efc6,!![]);}catch(_0x48b6e9){return BPromise[_0xbb10('0x21')](_0x48b6e9);}return _0xbf2906[_0xbb10('0x22')]();};}function saveUpdates(_0x388fab,_0x109908){return function(_0xdf237d){if(_0xdf237d){return _0xdf237d[_0xbb10('0x23')](_0x388fab)['then'](function(_0x12f888){return _0x12f888;});}return null;};}function removeEntity(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x24')]()[_0xbb10('0x25')](function(){_0x12ef77[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x445761,_0x1824b7){return function(_0x407cb4){if(!_0x407cb4){_0x445761[_0xbb10('0x18')](0x194);}return _0x407cb4;};}function handleError(_0x7f2377,_0x395404){_0x395404=_0x395404||0x1f4;return function(_0x3ba6cd){logger[_0xbb10('0x26')](_0x3ba6cd['stack']);if(_0x3ba6cd['name']){delete _0x3ba6cd['name'];}_0x7f2377[_0xbb10('0x19')](_0x395404)[_0xbb10('0x27')](_0x3ba6cd);};}exports[_0xbb10('0x28')]=function(_0x4e25ff,_0x2fdde9){var _0x24d586={},_0x6ed43b={},_0x1d5e95={'count':0x0,'rows':[]};var _0x1acce9=db[_0xbb10('0x29')][_0xbb10('0x2a')];_0x6ed43b['model']=_[_0xbb10('0x2b')](_0x1acce9);_0x6ed43b[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0x4e25ff[_0xbb10('0x2c')]);_0x6ed43b[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x6ed43b['model'],_0x6ed43b[_0xbb10('0x2c')]);_0x24d586['attributes']=_[_0xbb10('0x2e')](_0x6ed43b['model'],qs[_0xbb10('0x2f')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x2f')]));_0x24d586['attributes']=_0x24d586['attributes'][_0xbb10('0x30')]?_0x24d586[_0xbb10('0x31')]:_0x6ed43b['model'];if(!_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x32')](_0xbb10('0x33'))){_0x24d586[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1d')]);_0x24d586['offset']=qs[_0xbb10('0x1c')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x1c')]);}_0x24d586[_0xbb10('0x34')]=qs[_0xbb10('0x35')](_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x35')]);_0x24d586[_0xbb10('0x36')]=qs[_0xbb10('0x2d')](_['pick'](_0x4e25ff[_0xbb10('0x2c')],_0x6ed43b[_0xbb10('0x2d')]));if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x37')]){_0x24d586['where']=_[_0xbb10('0x38')](_0x24d586['where'],{'$or':_['map'](_0x1acce9,function(_0x3eb3cc){if(_0x3eb3cc[_0xbb10('0x39')][_0xbb10('0x3a')]!==_0xbb10('0x3b')){var _0x15d895={};_0x15d895[_0x3eb3cc[_0xbb10('0x3c')]]={'$like':'%'+_0x4e25ff['query'][_0xbb10('0x37')]+'%'};return _0x15d895;}})});}_0x24d586=_[_0xbb10('0x38')]({},_0x24d586,_0x4e25ff['options']);var _0x5e3fbd={'where':_0x24d586['where']};return db[_0xbb10('0x29')][_0xbb10('0x3d')](_0x5e3fbd)[_0xbb10('0x25')](function(_0x4d5a9b){_0x1d5e95[_0xbb10('0x3d')]=_0x4d5a9b;if(_0x4e25ff[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x24d586['include']=[{'all':!![]}];}return db[_0xbb10('0x29')][_0xbb10('0x3f')](_0x24d586);})[_0xbb10('0x25')](function(_0x446f49){_0x1d5e95['rows']=_0x446f49;return _0x1d5e95;})[_0xbb10('0x25')](respondWithFilteredResult(_0x2fdde9,_0x24d586))[_0xbb10('0x40')](handleError(_0x2fdde9,null));};exports['show']=function(_0xe2040f,_0x2e3214){var _0x44d6ae={'raw':![],'where':{'id':_0xe2040f[_0xbb10('0x41')]['id']}},_0x3a9934={};_0x3a9934[_0xbb10('0x42')]=_['keys'](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3a9934[_0xbb10('0x2c')]=_[_0xbb10('0x2b')](_0xe2040f['query']);_0x3a9934[_0xbb10('0x2d')]=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],_0x3a9934[_0xbb10('0x2c')]);_0x44d6ae['attributes']=_[_0xbb10('0x2e')](_0x3a9934[_0xbb10('0x42')],qs['fields'](_0xe2040f['query'][_0xbb10('0x2f')]));_0x44d6ae['attributes']=_0x44d6ae[_0xbb10('0x31')][_0xbb10('0x30')]?_0x44d6ae['attributes']:_0x3a9934[_0xbb10('0x42')];if(_0xe2040f[_0xbb10('0x2c')][_0xbb10('0x3e')]){_0x44d6ae['include']=[{'all':!![]}];}_0x44d6ae=_[_0xbb10('0x38')]({},_0x44d6ae,_0xe2040f[_0xbb10('0x43')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x44d6ae)[_0xbb10('0x25')](handleEntityNotFound(_0x2e3214,null))[_0xbb10('0x25')](respondWithResult(_0x2e3214,null))[_0xbb10('0x40')](handleError(_0x2e3214,null));};exports[_0xbb10('0x45')]=function(_0x205bb4,_0x43b948){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x205bb4['body'],{})[_0xbb10('0x25')](respondWithResult(_0x43b948,0xc9))[_0xbb10('0x40')](handleError(_0x43b948,null));};exports['update']=function(_0x14e1cb,_0x2f5027){if(_0x14e1cb[_0xbb10('0x46')]['id']){delete _0x14e1cb[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x14e1cb[_0xbb10('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f5027,null))['then'](saveUpdates(_0x14e1cb[_0xbb10('0x46')],null))[_0xbb10('0x25')](respondWithResult(_0x2f5027,null))[_0xbb10('0x40')](handleError(_0x2f5027,null));};exports['destroy']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x5f0c12[_0xbb10('0x41')]['id']}})[_0xbb10('0x25')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x25')](removeEntity(_0x3cd6f3,null))[_0xbb10('0x40')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x47')]=function(_0x2626d8,_0x3d7e7e){return db['UserProfileResource']['describe']()[_0xbb10('0x25')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x40')](handleError(_0x3d7e7e,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0xc31127,_0x3f2f88){var _0x1ee99f=function(_0x516292){while(--_0x516292){_0xc31127['push'](_0xc31127['shift']());}};_0x1ee99f(++_0x3f2f88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['UserProfileResource'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['UserProfileResource'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6a0b344..945b715 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 _0xbca1=['resourceId','sectionId','lodash','util','request-promise','exports','UserProfileResource','compositeIndex'];(function(_0x3566ea,_0x50e87d){var _0x24c0b9=function(_0x1f22a5){while(--_0x1f22a5){_0x3566ea['push'](_0x3566ea['shift']());}};_0x24c0b9(++_0x50e87d);}(_0xbca1,0x14a));var _0x1bca=function(_0x1ccfd2,_0x4d5c3e){_0x1ccfd2=_0x1ccfd2-0x0;var _0x3cbe30=_0xbca1[_0x1ccfd2];return _0x3cbe30;};'use strict';var _=require(_0x1bca('0x0'));var util=require(_0x1bca('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1bca('0x2'));var attributes=require('./userProfileResource.attributes');module[_0x1bca('0x3')]=function(_0x27ad93,_0x31fa56){return _0x27ad93['define'](_0x1bca('0x4'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x1bca('0x5'),'fields':[_0x1bca('0x6'),_0x1bca('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec4=['moment','request-promise','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api'];(function(_0x562b08,_0x37309b){var _0x1b94da=function(_0x385266){while(--_0x385266){_0x562b08['push'](_0x562b08['shift']());}};_0x1b94da(++_0x37309b);}(_0x9ec4,0x127));var _0x49ec=function(_0x50d2e5,_0x3c3d84){_0x50d2e5=_0x50d2e5-0x0;var _0x52b73b=_0x9ec4[_0x50d2e5];return _0x52b73b;};'use strict';var _=require(_0x49ec('0x0'));var util=require(_0x49ec('0x1'));var logger=require(_0x49ec('0x2'))(_0x49ec('0x3'));var moment=require(_0x49ec('0x4'));var BPromise=require('bluebird');var rp=require(_0x49ec('0x5'));var attributes=require(_0x49ec('0x6'));module['exports']=function(_0x24eb38,_0x4e4f3e){return _0x24eb38[_0x49ec('0x7')](_0x49ec('0x8'),attributes,{'tableName':_0x49ec('0x9'),'paranoid':![],'indexes':[{'name':_0x49ec('0xa'),'fields':[_0x49ec('0xb'),_0x49ec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 20a9cfb..d9aacc1 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 _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x139ca7,_0x54efa3){var _0x1b73c8=function(_0xf075c5){while(--_0xf075c5){_0x139ca7['push'](_0x139ca7['shift']());}};_0x1b73c8(++_0x54efa3);}(_0x1883,0xab));var _0x3188=function(_0x37beed,_0x219b32){_0x37beed=_0x37beed-0x0;var _0x143a70=_0x1883[_0x37beed];return _0x143a70;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file +var _0x4745=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x2e923b,_0xec3ca7){var _0x446916=function(_0x36ab6a){while(--_0x36ab6a){_0x2e923b['push'](_0x2e923b['shift']());}};_0x446916(++_0xec3ca7);}(_0x4745,0x1e7));var _0x5474=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x4745[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 125013d..7468148 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 _0x80fe=['put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x2c04d9,_0x59ec65){var _0x5ad09a=function(_0x5e2ce3){while(--_0x5e2ce3){_0x2c04d9['push'](_0x2c04d9['shift']());}};_0x5ad09a(++_0x59ec65);}(_0x80fe,0x17e));var _0xe80f=function(_0x10cc53,_0x150343){_0x10cc53=_0x10cc53-0x0;var _0x460639=_0x80fe[_0x10cc53];return _0x460639;};'use strict';var multer=require(_0xe80f('0x0'));var util=require('util');var path=require(_0xe80f('0x1'));var timeout=require(_0xe80f('0x2'));var express=require('express');var router=express[_0xe80f('0x3')]();var auth=require(_0xe80f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe80f('0x5'));var controller=require(_0xe80f('0x6'));router[_0xe80f('0x7')]('/',auth[_0xe80f('0x8')](),controller[_0xe80f('0x9')]);router[_0xe80f('0x7')](_0xe80f('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe80f('0x7')](_0xe80f('0xb'),auth['isAuthenticated'](),controller[_0xe80f('0xc')]);router[_0xe80f('0xd')]('/',auth[_0xe80f('0x8')](),controller['create']);router[_0xe80f('0xe')](_0xe80f('0xb'),auth[_0xe80f('0x8')](),controller[_0xe80f('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe80f('0x10')]);module[_0xe80f('0x11')]=router; \ No newline at end of file +var _0x0019=['show','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x17eb11,_0x25d8c6){var _0x559093=function(_0x1bf619){while(--_0x1bf619){_0x17eb11['push'](_0x17eb11['shift']());}};_0x559093(++_0x25d8c6);}(_0x0019,0x1a9));var _0x9001=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x0019[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require(_0x9001('0x0'));var util=require(_0x9001('0x1'));var path=require(_0x9001('0x2'));var timeout=require(_0x9001('0x3'));var express=require(_0x9001('0x4'));var router=express[_0x9001('0x5')]();var auth=require(_0x9001('0x6'));var interaction=require(_0x9001('0x7'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x9001('0x8')]('/',auth[_0x9001('0x9')](),controller[_0x9001('0xa')]);router[_0x9001('0x8')](_0x9001('0xb'),auth[_0x9001('0x9')](),controller['describe']);router['get']('/:id',auth[_0x9001('0x9')](),controller[_0x9001('0xc')]);router['post']('/',auth[_0x9001('0x9')](),controller[_0x9001('0xd')]);router[_0x9001('0xe')](_0x9001('0xf'),auth[_0x9001('0x9')](),controller[_0x9001('0x10')]);router[_0x9001('0x11')](_0x9001('0xf'),auth[_0x9001('0x9')](),controller['destroy']);module[_0x9001('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4f04944..de77cf1 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 _0x9c44=['BOOLEAN','crudPermissions','getDataValue','split','STRING','INTEGER'];(function(_0x4df3a5,_0x120bed){var _0x49d87e=function(_0x4b918a){while(--_0x4b918a){_0x4df3a5['push'](_0x4df3a5['shift']());}};_0x49d87e(++_0x120bed);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x49c4('0x0')],'set':function(_0x4e0313){this['setDataValue'](_0x49c4('0x3'),_0x4e0313?_0x4e0313['join'](''):[]);},'get':function(){return this[_0x49c4('0x4')](_0x49c4('0x3'))?this[_0x49c4('0x4')](_0x49c4('0x3'))[_0x49c4('0x5')](''):[];}}}; \ No newline at end of file +var _0xa9e0=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x420590,_0x47951d){var _0xbee64c=function(_0xe113f){while(--_0xe113f){_0x420590['push'](_0x420590['shift']());}};_0xbee64c(++_0x47951d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0a9e('0x2')],'set':function(_0x432180){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x432180?_0x432180[_0x0a9e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x0a9e('0x5'))?this[_0x0a9e('0x7')](_0x0a9e('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 76952f3..43aaec2 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 _0x06a0=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys','query'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0x06a0,0x151));var _0x006a=function(_0x27a45e,_0x556bb4){_0x27a45e=_0x27a45e-0x0;var _0x1fca64=_0x06a0[_0x27a45e];return _0x1fca64;};'use strict';var pdf=require(_0x006a('0x0'));var emlformat=require(_0x006a('0x1'));var rimraf=require(_0x006a('0x2'));var zipdir=require(_0x006a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x006a('0x4'));var moment=require('moment');var BPromise=require(_0x006a('0x5'));var Mustache=require(_0x006a('0x6'));var util=require(_0x006a('0x7'));var path=require(_0x006a('0x8'));var sox=require(_0x006a('0x9'));var csv=require(_0x006a('0xa'));var ejs=require(_0x006a('0xb'));var fs=require('fs');var _=require(_0x006a('0xc'));var squel=require(_0x006a('0xd'));var crypto=require(_0x006a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x006a('0xf'));var toCsv=require(_0x006a('0xa'));var querystring=require(_0x006a('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x006a('0x11'));var Redis=require(_0x006a('0x12'));var qs=require(_0x006a('0x13'));var logger=require('../../config/logger')(_0x006a('0x14'));var utils=require(_0x006a('0x15'));var config=require(_0x006a('0x16'));var db=require(_0x006a('0x17'))['db'];function respondWithStatusCode(_0x5246ea,_0x2d8304){_0x2d8304=_0x2d8304||0xcc;return function(_0x2b9891){if(_0x2b9891){return _0x5246ea[_0x006a('0x18')](_0x2d8304);}return _0x5246ea[_0x006a('0x19')](_0x2d8304)[_0x006a('0x1a')]();};}function respondWithResult(_0x2f9f2d,_0x2e6145){_0x2e6145=_0x2e6145||0xc8;return function(_0x3e02ba){if(_0x3e02ba){return _0x2f9f2d[_0x006a('0x19')](_0x2e6145)[_0x006a('0x1b')](_0x3e02ba);}};}function respondWithFilteredResult(_0x36b877,_0x2ac104){return function(_0x1704cc){if(_0x1704cc){var _0x5ec8e1=_0x1704cc[_0x006a('0x1c')],_0x2bbc41=_0x2ac104['offset'],_0x3bc179=_0x2ac104[_0x006a('0x1d')]+_0x2ac104[_0x006a('0x1e')],_0x7fac9f;if(_0x3bc179>=_0x5ec8e1){_0x3bc179=_0x5ec8e1;_0x7fac9f=0xc8;}else{_0x7fac9f=0xce;}_0x36b877[_0x006a('0x19')](_0x7fac9f);return _0x36b877[_0x006a('0x1f')](_0x006a('0x20'),_0x2bbc41+'-'+_0x3bc179+'/'+_0x5ec8e1)[_0x006a('0x1b')](_0x1704cc);}return null;};}function patchUpdates(_0x488a20){return function(_0x521b66){try{jsonpatch[_0x006a('0x21')](_0x521b66,_0x488a20,!![]);}catch(_0x1b9051){return BPromise[_0x006a('0x22')](_0x1b9051);}return _0x521b66[_0x006a('0x23')]();};}function saveUpdates(_0x4b4323,_0x77f28e){return function(_0x2ab5f2){if(_0x2ab5f2){return _0x2ab5f2['update'](_0x4b4323)['then'](function(_0x562d08){return _0x562d08;});}return null;};}function removeEntity(_0x4559d2,_0x4e997a){return function(_0x18bfd0){if(_0x18bfd0){return _0x18bfd0[_0x006a('0x24')]()[_0x006a('0x25')](function(){_0x4559d2[_0x006a('0x19')](0xcc)[_0x006a('0x1a')]();});}};}function handleEntityNotFound(_0x11c269,_0x6bbe70){return function(_0xd4f4d2){if(!_0xd4f4d2){_0x11c269[_0x006a('0x18')](0x194);}return _0xd4f4d2;};}function handleError(_0x48b224,_0x4a2139){_0x4a2139=_0x4a2139||0x1f4;return function(_0x178cd4){logger[_0x006a('0x26')](_0x178cd4[_0x006a('0x27')]);if(_0x178cd4[_0x006a('0x28')]){delete _0x178cd4[_0x006a('0x28')];}_0x48b224[_0x006a('0x19')](_0x4a2139)[_0x006a('0x29')](_0x178cd4);};}exports[_0x006a('0x2a')]=function(_0x910171,_0x5b260f){var _0x110259={},_0xa05515={},_0x17cc47={'count':0x0,'rows':[]};var _0x426bb9=db[_0x006a('0x2b')][_0x006a('0x2c')];_0xa05515[_0x006a('0x2d')]=_[_0x006a('0x2e')](_0x426bb9);_0xa05515[_0x006a('0x2f')]=_['keys'](_0x910171[_0x006a('0x2f')]);_0xa05515[_0x006a('0x30')]=_[_0x006a('0x31')](_0xa05515[_0x006a('0x2d')],_0xa05515[_0x006a('0x2f')]);_0x110259[_0x006a('0x32')]=_['intersection'](_0xa05515[_0x006a('0x2d')],qs[_0x006a('0x33')](_0x910171[_0x006a('0x2f')][_0x006a('0x33')]));_0x110259[_0x006a('0x32')]=_0x110259[_0x006a('0x32')][_0x006a('0x34')]?_0x110259[_0x006a('0x32')]:_0xa05515['model'];if(!_0x910171[_0x006a('0x2f')][_0x006a('0x35')](_0x006a('0x36'))){_0x110259[_0x006a('0x1e')]=qs[_0x006a('0x1e')](_0x910171[_0x006a('0x2f')][_0x006a('0x1e')]);_0x110259['offset']=qs[_0x006a('0x1d')](_0x910171[_0x006a('0x2f')][_0x006a('0x1d')]);}_0x110259[_0x006a('0x37')]=qs['sort'](_0x910171[_0x006a('0x2f')][_0x006a('0x38')]);_0x110259[_0x006a('0x39')]=qs[_0x006a('0x30')](_[_0x006a('0x3a')](_0x910171[_0x006a('0x2f')],_0xa05515['filters']));if(_0x910171[_0x006a('0x2f')][_0x006a('0x3b')]){_0x110259[_0x006a('0x39')]=_[_0x006a('0x3c')](_0x110259[_0x006a('0x39')],{'$or':_[_0x006a('0x3d')](_0x426bb9,function(_0x47321a){if(_0x47321a['type'][_0x006a('0x3e')]!==_0x006a('0x3f')){var _0x59b9ec={};_0x59b9ec[_0x47321a['field']]={'$like':'%'+_0x910171[_0x006a('0x2f')][_0x006a('0x3b')]+'%'};return _0x59b9ec;}})});}_0x110259=_[_0x006a('0x3c')]({},_0x110259,_0x910171[_0x006a('0x40')]);var _0x400b9a={'where':_0x110259[_0x006a('0x39')]};return db[_0x006a('0x2b')][_0x006a('0x1c')](_0x400b9a)[_0x006a('0x25')](function(_0x50dfca){_0x17cc47[_0x006a('0x1c')]=_0x50dfca;if(_0x910171[_0x006a('0x2f')][_0x006a('0x41')]){_0x110259['include']=[{'all':!![]}];}return db[_0x006a('0x2b')][_0x006a('0x42')](_0x110259);})[_0x006a('0x25')](function(_0x135680){_0x17cc47[_0x006a('0x43')]=_0x135680;return _0x17cc47;})[_0x006a('0x25')](respondWithFilteredResult(_0x5b260f,_0x110259))[_0x006a('0x44')](handleError(_0x5b260f,null));};exports[_0x006a('0x45')]=function(_0x3a21da,_0x2a1021){var _0x37a04e={'raw':![],'where':{'id':_0x3a21da[_0x006a('0x46')]['id']}},_0x57c94b={};_0x57c94b[_0x006a('0x2d')]=_[_0x006a('0x2e')](db['UserProfileSection']['rawAttributes']);_0x57c94b[_0x006a('0x2f')]=_[_0x006a('0x2e')](_0x3a21da['query']);_0x57c94b[_0x006a('0x30')]=_[_0x006a('0x31')](_0x57c94b[_0x006a('0x2d')],_0x57c94b['query']);_0x37a04e[_0x006a('0x32')]=_[_0x006a('0x31')](_0x57c94b[_0x006a('0x2d')],qs[_0x006a('0x33')](_0x3a21da['query'][_0x006a('0x33')]));_0x37a04e[_0x006a('0x32')]=_0x37a04e[_0x006a('0x32')][_0x006a('0x34')]?_0x37a04e[_0x006a('0x32')]:_0x57c94b[_0x006a('0x2d')];if(_0x3a21da['query'][_0x006a('0x41')]){_0x37a04e[_0x006a('0x47')]=[{'all':!![]}];}_0x37a04e=_[_0x006a('0x3c')]({},_0x37a04e,_0x3a21da[_0x006a('0x40')]);return db[_0x006a('0x2b')]['find'](_0x37a04e)[_0x006a('0x25')](handleEntityNotFound(_0x2a1021,null))[_0x006a('0x25')](respondWithResult(_0x2a1021,null))[_0x006a('0x44')](handleError(_0x2a1021,null));};exports[_0x006a('0x48')]=function(_0x1836bd,_0x463626){return db[_0x006a('0x2b')][_0x006a('0x48')](_0x1836bd[_0x006a('0x49')],{})[_0x006a('0x25')](respondWithResult(_0x463626,0xc9))[_0x006a('0x44')](handleError(_0x463626,null));};exports[_0x006a('0x4a')]=function(_0x266453,_0x37a342){if(_0x266453[_0x006a('0x49')]['id']){delete _0x266453[_0x006a('0x49')]['id'];}return db[_0x006a('0x2b')]['find']({'where':{'id':_0x266453[_0x006a('0x46')]['id']}})[_0x006a('0x25')](handleEntityNotFound(_0x37a342,null))[_0x006a('0x25')](saveUpdates(_0x266453[_0x006a('0x49')],null))['then'](respondWithResult(_0x37a342,null))['catch'](handleError(_0x37a342,null));};exports['destroy']=function(_0x27cd27,_0x381ad5){return db[_0x006a('0x2b')][_0x006a('0x4b')]({'where':{'id':_0x27cd27[_0x006a('0x46')]['id']}})[_0x006a('0x25')](handleEntityNotFound(_0x381ad5,null))[_0x006a('0x25')](removeEntity(_0x381ad5,null))[_0x006a('0x44')](handleError(_0x381ad5,null));};exports[_0x006a('0x4c')]=function(_0x1e9983,_0xb19e5a){return db['UserProfileSection'][_0x006a('0x4c')]()[_0x006a('0x25')](respondWithResult(_0xb19e5a,null))[_0x006a('0x44')](handleError(_0xb19e5a,null));}; \ No newline at end of file +var _0x76ba=['describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','UserProfileSection','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','key','field','filter','merge','options','then','includeAll','include','findAll','rows','catch','params','length','find','create','body'];(function(_0x17e3eb,_0x247074){var _0x51885d=function(_0x214fd0){while(--_0x214fd0){_0x17e3eb['push'](_0x17e3eb['shift']());}};_0x51885d(++_0x247074);}(_0x76ba,0x1ab));var _0xa76b=function(_0x2f777a,_0x1cbcc7){_0x2f777a=_0x2f777a-0x0;var _0x3529a0=_0x76ba[_0x2f777a];return _0x3529a0;};'use strict';var pdf=require(_0xa76b('0x0'));var emlformat=require(_0xa76b('0x1'));var rimraf=require(_0xa76b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa76b('0x3'));var rp=require('request-promise');var moment=require(_0xa76b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa76b('0x5'));var path=require(_0xa76b('0x6'));var sox=require(_0xa76b('0x7'));var csv=require(_0xa76b('0x8'));var ejs=require(_0xa76b('0x9'));var fs=require('fs');var _=require(_0xa76b('0xa'));var squel=require('squel');var crypto=require(_0xa76b('0xb'));var jsforce=require(_0xa76b('0xc'));var deskjs=require(_0xa76b('0xd'));var toCsv=require(_0xa76b('0x8'));var querystring=require('querystring');var Papa=require(_0xa76b('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa76b('0xf'));var Redis=require(_0xa76b('0x10'));var qs=require(_0xa76b('0x11'));var logger=require('../../config/logger')(_0xa76b('0x12'));var utils=require(_0xa76b('0x13'));var config=require(_0xa76b('0x14'));var db=require(_0xa76b('0x15'))['db'];function respondWithStatusCode(_0x562e03,_0x415230){_0x415230=_0x415230||0xcc;return function(_0x1ac071){if(_0x1ac071){return _0x562e03['sendStatus'](_0x415230);}return _0x562e03[_0xa76b('0x16')](_0x415230)[_0xa76b('0x17')]();};}function respondWithResult(_0x3ff822,_0x3266c1){_0x3266c1=_0x3266c1||0xc8;return function(_0x55d9f9){if(_0x55d9f9){return _0x3ff822['status'](_0x3266c1)[_0xa76b('0x18')](_0x55d9f9);}};}function respondWithFilteredResult(_0x10a1aa,_0x32f797){return function(_0x36c3ee){if(_0x36c3ee){var _0x426596=_0x36c3ee[_0xa76b('0x19')],_0x256c5c=_0x32f797['offset'],_0x2eb7a5=_0x32f797[_0xa76b('0x1a')]+_0x32f797['limit'],_0x5d836c;if(_0x2eb7a5>=_0x426596){_0x2eb7a5=_0x426596;_0x5d836c=0xc8;}else{_0x5d836c=0xce;}_0x10a1aa[_0xa76b('0x16')](_0x5d836c);return _0x10a1aa[_0xa76b('0x1b')](_0xa76b('0x1c'),_0x256c5c+'-'+_0x2eb7a5+'/'+_0x426596)[_0xa76b('0x18')](_0x36c3ee);}return null;};}function patchUpdates(_0x490663){return function(_0x14df15){try{jsonpatch[_0xa76b('0x1d')](_0x14df15,_0x490663,!![]);}catch(_0x13f5d5){return BPromise[_0xa76b('0x1e')](_0x13f5d5);}return _0x14df15[_0xa76b('0x1f')]();};}function saveUpdates(_0x28a64a,_0x27ccf7){return function(_0x4819e0){if(_0x4819e0){return _0x4819e0[_0xa76b('0x20')](_0x28a64a)['then'](function(_0x322922){return _0x322922;});}return null;};}function removeEntity(_0x17105a,_0x3b4101){return function(_0x16433f){if(_0x16433f){return _0x16433f[_0xa76b('0x21')]()['then'](function(){_0x17105a['status'](0xcc)[_0xa76b('0x17')]();});}};}function handleEntityNotFound(_0x2a9eaf,_0x749b8d){return function(_0x4683bc){if(!_0x4683bc){_0x2a9eaf[_0xa76b('0x22')](0x194);}return _0x4683bc;};}function handleError(_0x15e7ff,_0x45cad8){_0x45cad8=_0x45cad8||0x1f4;return function(_0x23d278){logger['error'](_0x23d278[_0xa76b('0x23')]);if(_0x23d278[_0xa76b('0x24')]){delete _0x23d278[_0xa76b('0x24')];}_0x15e7ff[_0xa76b('0x16')](_0x45cad8)[_0xa76b('0x25')](_0x23d278);};}exports[_0xa76b('0x26')]=function(_0x1e1535,_0x5923bb){var _0x57777e={},_0x506149={},_0x80066a={'count':0x0,'rows':[]};var _0x18822b=db[_0xa76b('0x27')][_0xa76b('0x28')];_0x506149[_0xa76b('0x29')]=_[_0xa76b('0x2a')](_0x18822b);_0x506149['query']=_[_0xa76b('0x2a')](_0x1e1535[_0xa76b('0x2b')]);_0x506149['filters']=_[_0xa76b('0x2c')](_0x506149[_0xa76b('0x29')],_0x506149['query']);_0x57777e[_0xa76b('0x2d')]=_['intersection'](_0x506149[_0xa76b('0x29')],qs[_0xa76b('0x2e')](_0x1e1535['query']['fields']));_0x57777e[_0xa76b('0x2d')]=_0x57777e[_0xa76b('0x2d')]['length']?_0x57777e[_0xa76b('0x2d')]:_0x506149[_0xa76b('0x29')];if(!_0x1e1535['query'][_0xa76b('0x2f')](_0xa76b('0x30'))){_0x57777e[_0xa76b('0x31')]=qs[_0xa76b('0x31')](_0x1e1535[_0xa76b('0x2b')][_0xa76b('0x31')]);_0x57777e[_0xa76b('0x1a')]=qs[_0xa76b('0x1a')](_0x1e1535['query'][_0xa76b('0x1a')]);}_0x57777e['order']=qs[_0xa76b('0x32')](_0x1e1535[_0xa76b('0x2b')]['sort']);_0x57777e[_0xa76b('0x33')]=qs[_0xa76b('0x34')](_[_0xa76b('0x35')](_0x1e1535[_0xa76b('0x2b')],_0x506149[_0xa76b('0x34')]));if(_0x1e1535['query']['filter']){_0x57777e[_0xa76b('0x33')]=_['merge'](_0x57777e['where'],{'$or':_['map'](_0x18822b,function(_0x2c45d6){if(_0x2c45d6['type'][_0xa76b('0x36')]!=='VIRTUAL'){var _0x5fcb50={};_0x5fcb50[_0x2c45d6[_0xa76b('0x37')]]={'$like':'%'+_0x1e1535[_0xa76b('0x2b')][_0xa76b('0x38')]+'%'};return _0x5fcb50;}})});}_0x57777e=_[_0xa76b('0x39')]({},_0x57777e,_0x1e1535[_0xa76b('0x3a')]);var _0x29062a={'where':_0x57777e[_0xa76b('0x33')]};return db[_0xa76b('0x27')][_0xa76b('0x19')](_0x29062a)[_0xa76b('0x3b')](function(_0x1a5ca0){_0x80066a[_0xa76b('0x19')]=_0x1a5ca0;if(_0x1e1535[_0xa76b('0x2b')][_0xa76b('0x3c')]){_0x57777e[_0xa76b('0x3d')]=[{'all':!![]}];}return db[_0xa76b('0x27')][_0xa76b('0x3e')](_0x57777e);})[_0xa76b('0x3b')](function(_0x2d121e){_0x80066a[_0xa76b('0x3f')]=_0x2d121e;return _0x80066a;})['then'](respondWithFilteredResult(_0x5923bb,_0x57777e))[_0xa76b('0x40')](handleError(_0x5923bb,null));};exports['show']=function(_0x2ad048,_0x4ebc1e){var _0x32fd3e={'raw':![],'where':{'id':_0x2ad048[_0xa76b('0x41')]['id']}},_0x1aa2ef={};_0x1aa2ef[_0xa76b('0x29')]=_[_0xa76b('0x2a')](db[_0xa76b('0x27')]['rawAttributes']);_0x1aa2ef[_0xa76b('0x2b')]=_[_0xa76b('0x2a')](_0x2ad048[_0xa76b('0x2b')]);_0x1aa2ef['filters']=_[_0xa76b('0x2c')](_0x1aa2ef[_0xa76b('0x29')],_0x1aa2ef[_0xa76b('0x2b')]);_0x32fd3e[_0xa76b('0x2d')]=_[_0xa76b('0x2c')](_0x1aa2ef['model'],qs[_0xa76b('0x2e')](_0x2ad048['query'][_0xa76b('0x2e')]));_0x32fd3e[_0xa76b('0x2d')]=_0x32fd3e[_0xa76b('0x2d')][_0xa76b('0x42')]?_0x32fd3e['attributes']:_0x1aa2ef[_0xa76b('0x29')];if(_0x2ad048[_0xa76b('0x2b')][_0xa76b('0x3c')]){_0x32fd3e[_0xa76b('0x3d')]=[{'all':!![]}];}_0x32fd3e=_[_0xa76b('0x39')]({},_0x32fd3e,_0x2ad048['options']);return db[_0xa76b('0x27')][_0xa76b('0x43')](_0x32fd3e)['then'](handleEntityNotFound(_0x4ebc1e,null))[_0xa76b('0x3b')](respondWithResult(_0x4ebc1e,null))[_0xa76b('0x40')](handleError(_0x4ebc1e,null));};exports[_0xa76b('0x44')]=function(_0x4ed5f3,_0x542430){return db[_0xa76b('0x27')]['create'](_0x4ed5f3[_0xa76b('0x45')],{})[_0xa76b('0x3b')](respondWithResult(_0x542430,0xc9))[_0xa76b('0x40')](handleError(_0x542430,null));};exports['update']=function(_0x4d0c78,_0x122567){if(_0x4d0c78[_0xa76b('0x45')]['id']){delete _0x4d0c78['body']['id'];}return db[_0xa76b('0x27')]['find']({'where':{'id':_0x4d0c78[_0xa76b('0x41')]['id']}})[_0xa76b('0x3b')](handleEntityNotFound(_0x122567,null))[_0xa76b('0x3b')](saveUpdates(_0x4d0c78[_0xa76b('0x45')],null))[_0xa76b('0x3b')](respondWithResult(_0x122567,null))[_0xa76b('0x40')](handleError(_0x122567,null));};exports[_0xa76b('0x21')]=function(_0x120348,_0x7f01a){return db['UserProfileSection']['find']({'where':{'id':_0x120348['params']['id']}})['then'](handleEntityNotFound(_0x7f01a,null))['then'](removeEntity(_0x7f01a,null))['catch'](handleError(_0x7f01a,null));};exports[_0xa76b('0x46')]=function(_0x5e360d,_0x3ff812){return db[_0xa76b('0x27')][_0xa76b('0x46')]()[_0xa76b('0x3b')](respondWithResult(_0x3ff812,null))[_0xa76b('0x40')](handleError(_0x3ff812,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 1d9ad9e..9464aab 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 _0x95bb=['request-promise','./userProfileSection.attributes','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x37669b,_0x413a7f){var _0x39544e=function(_0x3ba9c7){while(--_0x3ba9c7){_0x37669b['push'](_0x37669b['shift']());}};_0x39544e(++_0x413a7f);}(_0x95bb,0xed));var _0xb95b=function(_0x1bdedd,_0x43248f){_0x1bdedd=_0x1bdedd-0x0;var _0x2f5578=_0x95bb[_0x1bdedd];return _0x2f5578;};'use strict';var _=require(_0xb95b('0x0'));var util=require(_0xb95b('0x1'));var logger=require(_0xb95b('0x2'))('api');var moment=require(_0xb95b('0x3'));var BPromise=require(_0xb95b('0x4'));var rp=require(_0xb95b('0x5'));var attributes=require(_0xb95b('0x6'));module['exports']=function(_0x2a57e5,_0x3157d9){return _0x2a57e5['define']('UserProfileSection',attributes,{'tableName':_0xb95b('0x7'),'paranoid':![],'indexes':[{'name':_0xb95b('0x8'),'fields':[_0xb95b('0x9'),_0xb95b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91d9=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','moment','request-promise','UserProfileSection'];(function(_0x26e5d4,_0x5801ce){var _0x117226=function(_0x227f22){while(--_0x227f22){_0x26e5d4['push'](_0x26e5d4['shift']());}};_0x117226(++_0x5801ce);}(_0x91d9,0x1ec));var _0x991d=function(_0x409624,_0x246066){_0x409624=_0x409624-0x0;var _0x998b8c=_0x91d9[_0x409624];return _0x998b8c;};'use strict';var _=require('lodash');var util=require(_0x991d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x991d('0x1'));var BPromise=require('bluebird');var rp=require(_0x991d('0x2'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x3aadaa,_0x4aa1a4){return _0x3aadaa['define'](_0x991d('0x3'),attributes,{'tableName':_0x991d('0x4'),'paranoid':![],'indexes':[{'name':_0x991d('0x5'),'fields':[_0x991d('0x6'),_0x991d('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e9432ad..15f8291 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 _0x9c4e=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0x9c4e,0x11d));var _0xe9c4=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x9c4e[_0x1ee5be];return _0x177140;};'use strict';var _=require(_0xe9c4('0x0'));var util=require(_0xe9c4('0x1'));var moment=require(_0xe9c4('0x2'));var BPromise=require(_0xe9c4('0x3'));var rs=require(_0xe9c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9c4('0x5'))['db'];var utils=require(_0xe9c4('0x6'));var logger=require(_0xe9c4('0x7'))(_0xe9c4('0x8'));var config=require(_0xe9c4('0x9'));var jayson=require(_0xe9c4('0xa'));var client=jayson[_0xe9c4('0xb')][_0xe9c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a9550,_0x50dab2,_0x66e873){return new BPromise(function(_0x450c78,_0x2889aa){return client[_0xe9c4('0xd')](_0x4a9550,_0x66e873)['then'](function(_0x274d12){logger[_0xe9c4('0xe')](_0xe9c4('0xf'),_0x50dab2,_0xe9c4('0x10'));logger[_0xe9c4('0x11')](_0xe9c4('0x12'),_0x50dab2,_0xe9c4('0x10'),JSON[_0xe9c4('0x13')](_0x274d12));if(_0x274d12[_0xe9c4('0x14')]){if(_0x274d12[_0xe9c4('0x14')][_0xe9c4('0x15')]===0x1f4){logger['error'](_0xe9c4('0xf'),_0x50dab2,_0x274d12['error'][_0xe9c4('0x16')]);return _0x2889aa(_0x274d12[_0xe9c4('0x14')][_0xe9c4('0x16')]);}logger[_0xe9c4('0x14')](_0xe9c4('0xf'),_0x50dab2,_0x274d12['error'][_0xe9c4('0x16')]);return _0x450c78(_0x274d12[_0xe9c4('0x14')][_0xe9c4('0x16')]);}else{logger[_0xe9c4('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x50dab2,'request\x20sent');_0x450c78(_0x274d12['result'][_0xe9c4('0x16')]);}})[_0xe9c4('0x17')](function(_0x22a2cb){logger['error'](_0xe9c4('0xf'),_0x50dab2,_0x22a2cb);_0x2889aa(_0x22a2cb);});});} \ No newline at end of file +var _0x41b2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','bluebird'];(function(_0x20be58,_0x3e3536){var _0x99f43a=function(_0x229634){while(--_0x229634){_0x20be58['push'](_0x20be58['shift']());}};_0x99f43a(++_0x3e3536);}(_0x41b2,0xa7));var _0x241b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x241b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241b('0x1'));var db=require(_0x241b('0x2'))['db'];var utils=require(_0x241b('0x3'));var logger=require(_0x241b('0x4'))(_0x241b('0x5'));var config=require(_0x241b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x241b('0x7')][_0x241b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57acd0,_0x38d838,_0x8b146f){return new BPromise(function(_0x1e0a39,_0x5aa96a){return client[_0x241b('0x9')](_0x57acd0,_0x8b146f)[_0x241b('0xa')](function(_0x3cb936){logger[_0x241b('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x38d838,_0x241b('0xc'));logger[_0x241b('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x38d838,_0x241b('0xc'),JSON[_0x241b('0xe')](_0x3cb936));if(_0x3cb936[_0x241b('0xf')]){if(_0x3cb936[_0x241b('0xf')][_0x241b('0x10')]===0x1f4){logger['error'](_0x241b('0x11'),_0x38d838,_0x3cb936['error'][_0x241b('0x12')]);return _0x5aa96a(_0x3cb936[_0x241b('0xf')][_0x241b('0x12')]);}logger[_0x241b('0xf')](_0x241b('0x11'),_0x38d838,_0x3cb936['error'][_0x241b('0x12')]);return _0x1e0a39(_0x3cb936['error'][_0x241b('0x12')]);}else{logger[_0x241b('0xb')](_0x241b('0x11'),_0x38d838,'request\x20sent');_0x1e0a39(_0x3cb936[_0x241b('0x13')][_0x241b('0x12')]);}})[_0x241b('0x14')](function(_0x5e16c2){logger[_0x241b('0xf')](_0x241b('0x11'),_0x38d838,_0x5e16c2);_0x5aa96a(_0x5e16c2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 31a7786..b5b271e 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 _0x2bd8=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x241767,_0x149775){var _0xd80f6d=function(_0x111576){while(--_0x111576){_0x241767['push'](_0x241767['shift']());}};_0xd80f6d(++_0x149775);}(_0x2bd8,0x130));var _0x82bd=function(_0x38593f,_0x5aeee2){_0x38593f=_0x38593f-0x0;var _0x110b91=_0x2bd8[_0x38593f];return _0x110b91;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var auth=require(_0x82bd('0x5'));var interaction=require(_0x82bd('0x6'));var config=require(_0x82bd('0x7'));module['exports']=router; \ No newline at end of file +var _0xdf55=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e4802,_0x2d1958){var _0x50c3b5=function(_0x5d447e){while(--_0x5d447e){_0x5e4802['push'](_0x5e4802['shift']());}};_0x50c3b5(++_0x2d1958);}(_0xdf55,0x83));var _0x5df5=function(_0x59684c,_0x4f23bd){_0x59684c=_0x59684c-0x0;var _0x6e9beb=_0xdf55[_0x59684c];return _0x6e9beb;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var auth=require(_0x5df5('0x4'));var interaction=require(_0x5df5('0x5'));var config=require(_0x5df5('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index bfaa364..0334b44 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 _0xa985=['sequelize','exports','INTEGER'];(function(_0x4c42bc,_0x27a34b){var _0x290701=function(_0x4456ab){while(--_0x4456ab){_0x4c42bc['push'](_0x4c42bc['shift']());}};_0x290701(++_0x27a34b);}(_0xa985,0x1b9));var _0x5a98=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xa985[_0x456fb1];return _0x4083d6;};'use strict';var Sequelize=require(_0x5a98('0x0'));module[_0x5a98('0x1')]={'penalty':{'type':Sequelize[_0x5a98('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x485d=['INTEGER','sequelize'];(function(_0x2a5cd4,_0x39e088){var _0x4900e7=function(_0x14cb93){while(--_0x14cb93){_0x2a5cd4['push'](_0x2a5cd4['shift']());}};_0x4900e7(++_0x39e088);}(_0x485d,0x155));var _0xd485=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x485d[_0x3cea78];return _0x33b66b;};'use strict';var Sequelize=require(_0xd485('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd485('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 2de2e5c..d20217b 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 _0x701b=['./userSmsQueue.attributes','exports','define','user_has_sms_queues','util','../../config/logger','moment','request-promise'];(function(_0x16f774,_0x37bc4f){var _0xb9d024=function(_0x167958){while(--_0x167958){_0x16f774['push'](_0x16f774['shift']());}};_0xb9d024(++_0x37bc4f);}(_0x701b,0x1e4));var _0xb701=function(_0x52db82,_0x3716fa){_0x52db82=_0x52db82-0x0;var _0x38e0ec=_0x701b[_0x52db82];return _0x38e0ec;};'use strict';var _=require('lodash');var util=require(_0xb701('0x0'));var logger=require(_0xb701('0x1'))('api');var moment=require(_0xb701('0x2'));var BPromise=require('bluebird');var rp=require(_0xb701('0x3'));var attributes=require(_0xb701('0x4'));module[_0xb701('0x5')]=function(_0x49c039,_0x4f0098){return _0x49c039[_0xb701('0x6')]('UserSmsQueue',attributes,{'tableName':_0xb701('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ff3=['util','../../config/logger','api','moment','request-promise','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x550d2a,_0x3b1087){var _0x2009b4=function(_0x182f6d){while(--_0x182f6d){_0x550d2a['push'](_0x550d2a['shift']());}};_0x2009b4(++_0x3b1087);}(_0x3ff3,0x14c));var _0x33ff=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3ff3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x33ff('0x0'));var util=require(_0x33ff('0x1'));var logger=require(_0x33ff('0x2'))(_0x33ff('0x3'));var moment=require(_0x33ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x33ff('0x5'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x56be7b,_0x276232){return _0x56be7b[_0x33ff('0x6')](_0x33ff('0x7'),attributes,{'tableName':_0x33ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 0f1e52e..c137f63 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 _0x7afd=['code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5f1826,_0x5ee51d){var _0x47a78c=function(_0x3ee28e){while(--_0x3ee28e){_0x5f1826['push'](_0x5f1826['shift']());}};_0x47a78c(++_0x5ee51d);}(_0x7afd,0x19d));var _0xd7af=function(_0xa04235,_0x41ada4){_0xa04235=_0xa04235-0x0;var _0x16caff=_0x7afd[_0xa04235];return _0x16caff;};'use strict';var _=require('lodash');var util=require(_0xd7af('0x0'));var moment=require(_0xd7af('0x1'));var BPromise=require(_0xd7af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7af('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7af('0x4'))(_0xd7af('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1375c0,_0x4de79a,_0x52a26e){return new BPromise(function(_0x2637d2,_0x323193){return client['request'](_0x1375c0,_0x52a26e)[_0xd7af('0x6')](function(_0x32fd7a){logger['info'](_0xd7af('0x7'),_0x4de79a,_0xd7af('0x8'));logger[_0xd7af('0x9')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4de79a,_0xd7af('0x8'),JSON[_0xd7af('0xa')](_0x32fd7a));if(_0x32fd7a[_0xd7af('0xb')]){if(_0x32fd7a[_0xd7af('0xb')][_0xd7af('0xc')]===0x1f4){logger[_0xd7af('0xb')](_0xd7af('0x7'),_0x4de79a,_0x32fd7a[_0xd7af('0xb')][_0xd7af('0xd')]);return _0x323193(_0x32fd7a[_0xd7af('0xb')][_0xd7af('0xd')]);}logger[_0xd7af('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x4de79a,_0x32fd7a[_0xd7af('0xb')]['message']);return _0x2637d2(_0x32fd7a[_0xd7af('0xb')][_0xd7af('0xd')]);}else{logger[_0xd7af('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x4de79a,_0xd7af('0x8'));_0x2637d2(_0x32fd7a[_0xd7af('0xf')][_0xd7af('0xd')]);}})[_0xd7af('0x10')](function(_0x151a61){logger[_0xd7af('0xb')](_0xd7af('0x7'),_0x4de79a,_0x151a61);_0x323193(_0x151a61);});});} \ No newline at end of file +var _0xeeea=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x437c82,_0x55ab30){var _0x181b37=function(_0x479325){while(--_0x479325){_0x437c82['push'](_0x437c82['shift']());}};_0x181b37(++_0x55ab30);}(_0xeeea,0xaf));var _0xaeee=function(_0x1ffa3e,_0x40b0f8){_0x1ffa3e=_0x1ffa3e-0x0;var _0x57ae54=_0xeeea[_0x1ffa3e];return _0x57ae54;};'use strict';var _=require(_0xaeee('0x0'));var util=require(_0xaeee('0x1'));var moment=require(_0xaeee('0x2'));var BPromise=require(_0xaeee('0x3'));var rs=require(_0xaeee('0x4'));var fs=require('fs');var Redis=require(_0xaeee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaeee('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xaeee('0x7'));var jayson=require(_0xaeee('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4632db,_0x450079,_0x26884d){return new BPromise(function(_0xc37a4,_0x3332fd){return client[_0xaeee('0x9')](_0x4632db,_0x26884d)['then'](function(_0x2ae7d8){logger[_0xaeee('0xa')](_0xaeee('0xb'),_0x450079,'request\x20sent');logger[_0xaeee('0xc')](_0xaeee('0xd'),_0x450079,_0xaeee('0xe'),JSON[_0xaeee('0xf')](_0x2ae7d8));if(_0x2ae7d8['error']){if(_0x2ae7d8[_0xaeee('0x10')][_0xaeee('0x11')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x450079,_0x2ae7d8['error'][_0xaeee('0x12')]);return _0x3332fd(_0x2ae7d8['error'][_0xaeee('0x12')]);}logger[_0xaeee('0x10')](_0xaeee('0xb'),_0x450079,_0x2ae7d8[_0xaeee('0x10')]['message']);return _0xc37a4(_0x2ae7d8[_0xaeee('0x10')][_0xaeee('0x12')]);}else{logger[_0xaeee('0xa')](_0xaeee('0xb'),_0x450079,_0xaeee('0xe'));_0xc37a4(_0x2ae7d8[_0xaeee('0x13')][_0xaeee('0x12')]);}})[_0xaeee('0x14')](function(_0x48f3a9){logger[_0xaeee('0x10')](_0xaeee('0xb'),_0x450079,_0x48f3a9);_0x3332fd(_0x48f3a9);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 68420e9..85378a7 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 _0xa24d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0xc266d6,_0x15fc8c){var _0x2ab82c=function(_0x1990bb){while(--_0x1990bb){_0xc266d6['push'](_0xc266d6['shift']());}};_0x2ab82c(++_0x15fc8c);}(_0xa24d,0x1c1));var _0xda24=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0xa24d[_0x55c485];return _0x6bb521;};'use strict';var multer=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var path=require(_0xda24('0x2'));var timeout=require(_0xda24('0x3'));var express=require(_0xda24('0x4'));var router=express[_0xda24('0x5')]();var auth=require(_0xda24('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda24('0x7'));module[_0xda24('0x8')]=router; \ No newline at end of file +var _0xf69c=['exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x490f15,_0x48647b){var _0x248747=function(_0x397688){while(--_0x397688){_0x490f15['push'](_0x490f15['shift']());}};_0x248747(++_0x48647b);}(_0xf69c,0x151));var _0xcf69=function(_0x25e7ee,_0x4d8966){_0x25e7ee=_0x25e7ee-0x0;var _0x1251f2=_0xf69c[_0x25e7ee];return _0x1251f2;};'use strict';var multer=require(_0xcf69('0x0'));var util=require('util');var path=require(_0xcf69('0x1'));var timeout=require(_0xcf69('0x2'));var express=require('express');var router=express[_0xcf69('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcf69('0x4'));var config=require('../../config/environment');module[_0xcf69('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 8b3a6d5..5a329de 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 _0xd93a=['INTEGER'];(function(_0x2040f3,_0x4dcd04){var _0x202f95=function(_0x429cd2){while(--_0x429cd2){_0x2040f3['push'](_0x2040f3['shift']());}};_0x202f95(++_0x4dcd04);}(_0xd93a,0xc5));var _0xad93=function(_0x17c516,_0xfdf451){_0x17c516=_0x17c516-0x0;var _0xe64315=_0xd93a[_0x17c516];return _0xe64315;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xad93('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb934=['exports','sequelize'];(function(_0x4e1f84,_0x37098d){var _0x49f3f2=function(_0x65c877){while(--_0x65c877){_0x4e1f84['push'](_0x4e1f84['shift']());}};_0x49f3f2(++_0x37098d);}(_0xb934,0xe9));var _0x4b93=function(_0x2b1b0b,_0x19c4b6){_0x2b1b0b=_0x2b1b0b-0x0;var _0x8586f3=_0xb934[_0x2b1b0b];return _0x8586f3;};'use strict';var Sequelize=require(_0x4b93('0x0'));module[_0x4b93('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 64fe389..b8e84c7 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 _0xf169=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','exports','define'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xf169,0x142));var _0x9f16=function(_0x59dfbb,_0x55174d){_0x59dfbb=_0x59dfbb-0x0;var _0x2ea4c6=_0xf169[_0x59dfbb];return _0x2ea4c6;};'use strict';var _=require(_0x9f16('0x0'));var util=require(_0x9f16('0x1'));var logger=require(_0x9f16('0x2'))('api');var moment=require(_0x9f16('0x3'));var BPromise=require(_0x9f16('0x4'));var rp=require(_0x9f16('0x5'));var attributes=require('./userVoiceQueue.attributes');module[_0x9f16('0x6')]=function(_0x3fad61,_0x1db1e4){return _0x3fad61[_0x9f16('0x7')](_0x9f16('0x8'),attributes,{'tableName':_0x9f16('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba19=['moment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api'];(function(_0x23e03c,_0x52c5b4){var _0x2bf612=function(_0x151708){while(--_0x151708){_0x23e03c['push'](_0x23e03c['shift']());}};_0x2bf612(++_0x52c5b4);}(_0xba19,0x106));var _0x9ba1=function(_0x295b91,_0x37455b){_0x295b91=_0x295b91-0x0;var _0x1a91f0=_0xba19[_0x295b91];return _0x1a91f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ba1('0x0'))(_0x9ba1('0x1'));var moment=require(_0x9ba1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x9ba1('0x3'));module[_0x9ba1('0x4')]=function(_0x552a1d,_0x99d7dc){return _0x552a1d[_0x9ba1('0x5')](_0x9ba1('0x6'),attributes,{'tableName':_0x9ba1('0x7'),'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 96d5e9d..9e81465 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 _0xfe39=['request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1ed326,_0xc9da72){var _0x155a55=function(_0x1f620a){while(--_0x1f620a){_0x1ed326['push'](_0x1ed326['shift']());}};_0x155a55(++_0xc9da72);}(_0xfe39,0x1c9));var _0x9fe3=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xfe39[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require(_0x9fe3('0x2'));var BPromise=require('bluebird');var rs=require(_0x9fe3('0x3'));var fs=require('fs');var Redis=require(_0x9fe3('0x4'));var db=require(_0x9fe3('0x5'))['db'];var utils=require(_0x9fe3('0x6'));var logger=require(_0x9fe3('0x7'))(_0x9fe3('0x8'));var config=require(_0x9fe3('0x9'));var jayson=require(_0x9fe3('0xa'));var client=jayson[_0x9fe3('0xb')][_0x9fe3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25f1a2,_0x5eddef,_0xdb4aa4){return new BPromise(function(_0x4994f7,_0x4942e2){return client[_0x9fe3('0xd')](_0x25f1a2,_0xdb4aa4)[_0x9fe3('0xe')](function(_0x774aa0){logger[_0x9fe3('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x5eddef,'request\x20sent');logger[_0x9fe3('0x10')](_0x9fe3('0x11'),_0x5eddef,_0x9fe3('0x12'),JSON[_0x9fe3('0x13')](_0x774aa0));if(_0x774aa0[_0x9fe3('0x14')]){if(_0x774aa0[_0x9fe3('0x14')][_0x9fe3('0x15')]===0x1f4){logger[_0x9fe3('0x14')](_0x9fe3('0x16'),_0x5eddef,_0x774aa0[_0x9fe3('0x14')][_0x9fe3('0x17')]);return _0x4942e2(_0x774aa0[_0x9fe3('0x14')][_0x9fe3('0x17')]);}logger[_0x9fe3('0x14')](_0x9fe3('0x16'),_0x5eddef,_0x774aa0[_0x9fe3('0x14')]['message']);return _0x4994f7(_0x774aa0[_0x9fe3('0x14')][_0x9fe3('0x17')]);}else{logger[_0x9fe3('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x5eddef,_0x9fe3('0x12'));_0x4994f7(_0x774aa0['result']['message']);}})[_0x9fe3('0x18')](function(_0x2c9e0d){logger['error'](_0x9fe3('0x16'),_0x5eddef,_0x2c9e0d);_0x4942e2(_0x2c9e0d);});});} \ No newline at end of file +var _0xf058=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2fe1b9,_0x4956bb){var _0x49d3a7=function(_0x8f2951){while(--_0x8f2951){_0x2fe1b9['push'](_0x2fe1b9['shift']());}};_0x49d3a7(++_0x4956bb);}(_0xf058,0x105));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8f05('0x0'));var util=require(_0x8f05('0x1'));var moment=require(_0x8f05('0x2'));var BPromise=require(_0x8f05('0x3'));var rs=require(_0x8f05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f05('0x5'))['db'];var utils=require(_0x8f05('0x6'));var logger=require('../../config/logger')(_0x8f05('0x7'));var config=require(_0x8f05('0x8'));var jayson=require(_0x8f05('0x9'));var client=jayson[_0x8f05('0xa')][_0x8f05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a7d9b,_0x34248d,_0x5dd219){return new BPromise(function(_0x1eb3e9,_0x36b9c7){return client['request'](_0x4a7d9b,_0x5dd219)[_0x8f05('0xc')](function(_0x2d9d5d){logger[_0x8f05('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x34248d,_0x8f05('0xe'));logger['debug'](_0x8f05('0xf'),_0x34248d,_0x8f05('0xe'),JSON[_0x8f05('0x10')](_0x2d9d5d));if(_0x2d9d5d[_0x8f05('0x11')]){if(_0x2d9d5d[_0x8f05('0x11')]['code']===0x1f4){logger[_0x8f05('0x11')](_0x8f05('0x12'),_0x34248d,_0x2d9d5d['error'][_0x8f05('0x13')]);return _0x36b9c7(_0x2d9d5d[_0x8f05('0x11')][_0x8f05('0x13')]);}logger[_0x8f05('0x11')](_0x8f05('0x12'),_0x34248d,_0x2d9d5d[_0x8f05('0x11')][_0x8f05('0x13')]);return _0x1eb3e9(_0x2d9d5d[_0x8f05('0x11')][_0x8f05('0x13')]);}else{logger[_0x8f05('0xd')](_0x8f05('0x12'),_0x34248d,'request\x20sent');_0x1eb3e9(_0x2d9d5d[_0x8f05('0x14')]['message']);}})[_0x8f05('0x15')](function(_0x1e8b16){logger[_0x8f05('0x11')](_0x8f05('0x12'),_0x34248d,_0x1e8b16);_0x36b9c7(_0x1e8b16);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b74a542..d0135e7 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 _0xdc59=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','Router'];(function(_0x3d80ae,_0x115102){var _0x5be6cc=function(_0x548937){while(--_0x548937){_0x3d80ae['push'](_0x3d80ae['shift']());}};_0x5be6cc(++_0x115102);}(_0xdc59,0x12c));var _0x9dc5=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xdc59[_0x58c20f];return _0x3b0318;};'use strict';var multer=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var path=require(_0x9dc5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dc5('0x3')]();var auth=require(_0x9dc5('0x4'));var interaction=require(_0x9dc5('0x5'));var config=require(_0x9dc5('0x6'));module[_0x9dc5('0x7')]=router; \ No newline at end of file +var _0xce22=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3bca12,_0x526d3e){var _0x5b2d82=function(_0x31a3c9){while(--_0x31a3c9){_0x3bca12['push'](_0x3bca12['shift']());}};_0x5b2d82(++_0x526d3e);}(_0xce22,0xea));var _0x2ce2=function(_0x3c4401,_0x1552a9){_0x3c4401=_0x3c4401-0x0;var _0x57aabc=_0xce22[_0x3c4401];return _0x57aabc;};'use strict';var multer=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var path=require(_0x2ce2('0x2'));var timeout=require(_0x2ce2('0x3'));var express=require(_0x2ce2('0x4'));var router=express['Router']();var auth=require(_0x2ce2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2ce2('0x6'));module[_0x2ce2('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5ccc4f8..e4a5303 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 _0x8b7f=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8b7f,0x19a));var _0xf8b7=function(_0x5acc43,_0x2e4b36){_0x5acc43=_0x5acc43-0x0;var _0x324cba=_0x8b7f[_0x5acc43];return _0x324cba;};'use strict';var Sequelize=require(_0xf8b7('0x0'));module[_0xf8b7('0x1')]={'uniqueid':{'type':Sequelize[_0xf8b7('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf8b7('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf8b7('0x4')],'allowNull':![],'unique':_0xf8b7('0x5'),'comment':_0xf8b7('0x3')},'VoiceQueueId':{'type':Sequelize[_0xf8b7('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xf8b7('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xf8b7('0x3')},'paused':{'type':Sequelize[_0xf8b7('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x654c=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x32960c,_0x491736){var _0x10d449=function(_0x161849){while(--_0x161849){_0x32960c['push'](_0x32960c['shift']());}};_0x10d449(++_0x491736);}(_0x654c,0x1a4));var _0xc654=function(_0x55f5ec,_0x248699){_0x55f5ec=_0x55f5ec-0x0;var _0x485c00=_0x654c[_0x55f5ec];return _0x485c00;};'use strict';var Sequelize=require(_0xc654('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc654('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc654('0x2')},'membername':{'type':Sequelize[_0xc654('0x3')],'allowNull':![],'comment':_0xc654('0x2')},'UserId':{'type':Sequelize[_0xc654('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc654('0x4'),'comment':_0xc654('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xc654('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xc654('0x1')](0xb),'defaultValue':0x0,'comment':_0xc654('0x2')},'paused':{'type':Sequelize[_0xc654('0x1')](0xb),'defaultValue':0x0,'comment':_0xc654('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 20358ef..1b3baa9 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 _0xdde0=['../../mysqldb','UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2d4524,_0x88ac2d){var _0x9a660d=function(_0x1d045f){while(--_0x1d045f){_0x2d4524['push'](_0x2d4524['shift']());}};_0x9a660d(++_0x88ac2d);}(_0xdde0,0x149));var _0x0dde=function(_0x3b26b3,_0x3c0e3f){_0x3b26b3=_0x3b26b3-0x0;var _0x3961a5=_0xdde0[_0x3b26b3];return _0x3961a5;};'use strict';var EventEmitter=require(_0x0dde('0x0'));var UserVoiceQueueRt=require(_0x0dde('0x1'))['db'][_0x0dde('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0dde('0x3'),'afterUpdate':_0x0dde('0x4'),'afterDestroy':_0x0dde('0x5')};function emitEvent(_0x4b1f8c){return function(_0x3c6ce4,_0x247c3f,_0x3a207d){UserVoiceQueueRtEvents[_0x0dde('0x6')](_0x4b1f8c+':'+_0x3c6ce4['id'],_0x3c6ce4);UserVoiceQueueRtEvents[_0x0dde('0x6')](_0x4b1f8c,_0x3c6ce4);_0x3a207d(null);};}for(var e in events){if(events[_0x0dde('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x0dde('0x8')](e,emitEvent(event));}}module[_0x0dde('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x13df=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x2e2621,_0x166ad3){var _0x4be6fd=function(_0x2f2a0f){while(--_0x2f2a0f){_0x2e2621['push'](_0x2e2621['shift']());}};_0x4be6fd(++_0x166ad3);}(_0x13df,0x7d));var _0xf13d=function(_0x1a4eee,_0x672ec){_0x1a4eee=_0x1a4eee-0x0;var _0x2a84c2=_0x13df[_0x1a4eee];return _0x2a84c2;};'use strict';var EventEmitter=require(_0xf13d('0x0'));var UserVoiceQueueRt=require(_0xf13d('0x1'))['db'][_0xf13d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf13d('0x3')](0x0);var events={'afterCreate':_0xf13d('0x4'),'afterUpdate':_0xf13d('0x5'),'afterDestroy':_0xf13d('0x6')};function emitEvent(_0x2e56c2){return function(_0x20fe20,_0x334574,_0xd5d57){UserVoiceQueueRtEvents['emit'](_0x2e56c2+':'+_0x20fe20['id'],_0x20fe20);UserVoiceQueueRtEvents['emit'](_0x2e56c2,_0x20fe20);_0xd5d57(null);};}for(var e in events){if(events[_0xf13d('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xf13d('0x8')](e,emitEvent(event));}}module[_0xf13d('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c30f0d3..5eb2b2c 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 _0x2932=['util','../../config/logger','api','request-promise','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x4a237c,_0x1e6f76){var _0x2aedb2=function(_0x201334){while(--_0x201334){_0x4a237c['push'](_0x4a237c['shift']());}};_0x2aedb2(++_0x1e6f76);}(_0x2932,0x10d));var _0x2293=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x2932[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x2293('0x0'));var util=require(_0x2293('0x1'));var logger=require(_0x2293('0x2'))(_0x2293('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2293('0x4'));var attributes=require(_0x2293('0x5'));module[_0x2293('0x6')]=function(_0x26c4e3,_0x3b5efb){return _0x26c4e3[_0x2293('0x7')](_0x2293('0x8'),attributes,{'tableName':_0x2293('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x876a=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','exports','UserVoiceQueueRt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x876a,0x1f0));var _0xa876=function(_0x56d88a,_0x3d5b10){_0x56d88a=_0x56d88a-0x0;var _0x27b7f5=_0x876a[_0x56d88a];return _0x27b7f5;};'use strict';var _=require(_0xa876('0x0'));var util=require(_0xa876('0x1'));var logger=require(_0xa876('0x2'))(_0xa876('0x3'));var moment=require(_0xa876('0x4'));var BPromise=require('bluebird');var rp=require(_0xa876('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xa876('0x6')]=function(_0x51ac4a,_0x26a983){return _0x51ac4a['define'](_0xa876('0x7'),attributes,{'tableName':_0xa876('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 eeb6cc9..c61b89e 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 _0xdfc3=['./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x8e6770,_0x9d5f2f){var _0x4578a9=function(_0x59bf69){while(--_0x59bf69){_0x8e6770['push'](_0x8e6770['shift']());}};_0x4578a9(++_0x9d5f2f);}(_0xdfc3,0x1a0));var _0x3dfc=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xdfc3[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x3dfc('0x0'));var util=require(_0x3dfc('0x1'));var moment=require(_0x3dfc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3dfc('0x3'));var fs=require('fs');var Redis=require(_0x3dfc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3dfc('0x5'))('rpc');var config=require(_0x3dfc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3dfc('0x7')][_0x3dfc('0x8')]({'port':0x232a});config['redis']=_[_0x3dfc('0x9')](config[_0x3dfc('0xa')],{'host':_0x3dfc('0xb'),'port':0x18eb});var socket=require(_0x3dfc('0xc'))(new Redis(config['redis']));require(_0x3dfc('0xd'))['register'](socket);function respondWithRpcPromise(_0x195d50,_0x152a0a,_0x4861aa){return new BPromise(function(_0x461b0b,_0x39fb59){return client[_0x3dfc('0xe')](_0x195d50,_0x4861aa)[_0x3dfc('0xf')](function(_0x36c609){logger[_0x3dfc('0x10')](_0x3dfc('0x11'),_0x152a0a,_0x3dfc('0x12'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x152a0a,'request\x20sent',JSON['stringify'](_0x36c609));if(_0x36c609[_0x3dfc('0x13')]){if(_0x36c609[_0x3dfc('0x13')][_0x3dfc('0x14')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x152a0a,_0x36c609[_0x3dfc('0x13')][_0x3dfc('0x15')]);return _0x39fb59(_0x36c609[_0x3dfc('0x13')][_0x3dfc('0x15')]);}logger[_0x3dfc('0x13')](_0x3dfc('0x11'),_0x152a0a,_0x36c609[_0x3dfc('0x13')][_0x3dfc('0x15')]);return _0x461b0b(_0x36c609[_0x3dfc('0x13')][_0x3dfc('0x15')]);}else{logger[_0x3dfc('0x10')](_0x3dfc('0x11'),_0x152a0a,_0x3dfc('0x12'));_0x461b0b(_0x36c609[_0x3dfc('0x16')][_0x3dfc('0x15')]);}})[_0x3dfc('0x17')](function(_0x49883c){logger['error'](_0x3dfc('0x11'),_0x152a0a,_0x49883c);_0x39fb59(_0x49883c);});});}exports[_0x3dfc('0x18')]=function(_0x2e624d){var _0x27a829=this;return new Promise(function(_0x308a25,_0x1280fd){return db['UserVoiceQueueRt'][_0x3dfc('0x19')]({'raw':_0x2e624d[_0x3dfc('0x1a')]?_0x2e624d['options'][_0x3dfc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e624d[_0x3dfc('0x1a')]?_0x2e624d[_0x3dfc('0x1a')][_0x3dfc('0x1c')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x3dfc('0x1d')]['fn']('IF',db[_0x3dfc('0x1d')]['literal'](_0x3dfc('0x1e')))),_0x3dfc('0x1f')]]})[_0x3dfc('0xf')](function(_0x1309ba){logger['info'](_0x3dfc('0x18'),_0x2e624d);logger['debug'](_0x3dfc('0x18'),_0x2e624d,JSON[_0x3dfc('0x20')](_0x1309ba));_0x308a25(_0x1309ba);})['catch'](function(_0x5af2d7){logger[_0x3dfc('0x13')](_0x3dfc('0x18'),_0x5af2d7[_0x3dfc('0x15')],_0x2e624d);_0x1280fd(_0x27a829[_0x3dfc('0x13')](0x1f4,_0x5af2d7[_0x3dfc('0x15')]));});});}; \ No newline at end of file +var _0xc684=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UserVoiceQueueRt','options','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','util','bluebird','randomstring','ioredis'];(function(_0x5ce056,_0x4a0db9){var _0x2149b5=function(_0x4d0017){while(--_0x4d0017){_0x5ce056['push'](_0x5ce056['shift']());}};_0x2149b5(++_0x4a0db9);}(_0xc684,0x1c3));var _0x4c68=function(_0x35abe7,_0x17c163){_0x35abe7=_0x35abe7-0x0;var _0x37ebe1=_0xc684[_0x35abe7];return _0x37ebe1;};'use strict';var _=require('lodash');var util=require(_0x4c68('0x0'));var moment=require('moment');var BPromise=require(_0x4c68('0x1'));var rs=require(_0x4c68('0x2'));var fs=require('fs');var Redis=require(_0x4c68('0x3'));var db=require(_0x4c68('0x4'))['db'];var utils=require(_0x4c68('0x5'));var logger=require('../../config/logger')(_0x4c68('0x6'));var config=require(_0x4c68('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c68('0x8')][_0x4c68('0x9')]({'port':0x232a});config['redis']=_[_0x4c68('0xa')](config[_0x4c68('0xb')],{'host':_0x4c68('0xc'),'port':0x18eb});var socket=require(_0x4c68('0xd'))(new Redis(config['redis']));require(_0x4c68('0xe'))['register'](socket);function respondWithRpcPromise(_0xea20c2,_0x3adc4c,_0x4160b6){return new BPromise(function(_0x4d9ccf,_0x2ef92f){return client[_0x4c68('0xf')](_0xea20c2,_0x4160b6)[_0x4c68('0x10')](function(_0x1da7d3){logger[_0x4c68('0x11')](_0x4c68('0x12'),_0x3adc4c,'request\x20sent');logger[_0x4c68('0x13')](_0x4c68('0x14'),_0x3adc4c,_0x4c68('0x15'),JSON[_0x4c68('0x16')](_0x1da7d3));if(_0x1da7d3[_0x4c68('0x17')]){if(_0x1da7d3[_0x4c68('0x17')][_0x4c68('0x18')]===0x1f4){logger[_0x4c68('0x17')](_0x4c68('0x12'),_0x3adc4c,_0x1da7d3[_0x4c68('0x17')][_0x4c68('0x19')]);return _0x2ef92f(_0x1da7d3[_0x4c68('0x17')]['message']);}logger[_0x4c68('0x17')](_0x4c68('0x12'),_0x3adc4c,_0x1da7d3['error'][_0x4c68('0x19')]);return _0x4d9ccf(_0x1da7d3[_0x4c68('0x17')][_0x4c68('0x19')]);}else{logger['info'](_0x4c68('0x12'),_0x3adc4c,_0x4c68('0x15'));_0x4d9ccf(_0x1da7d3['result'][_0x4c68('0x19')]);}})[_0x4c68('0x1a')](function(_0x13f8e3){logger[_0x4c68('0x17')](_0x4c68('0x12'),_0x3adc4c,_0x13f8e3);_0x2ef92f(_0x13f8e3);});});}exports['GetVoiceQueueRtPauses']=function(_0x4cc05c){var _0x50d844=this;return new Promise(function(_0x5b8d08,_0x492ace){return db[_0x4c68('0x1b')]['findAll']({'raw':_0x4cc05c['options']?_0x4cc05c[_0x4c68('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4cc05c['options']?_0x4cc05c[_0x4c68('0x1c')][_0x4c68('0x1d')]||null:null,'attributes':[[db[_0x4c68('0x1e')]['fn'](_0x4c68('0x1f'),db[_0x4c68('0x1e')]['fn']('IF',db[_0x4c68('0x1e')][_0x4c68('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x4c68('0x21')]]})['then'](function(_0x4db5b0){logger['info'](_0x4c68('0x22'),_0x4cc05c);logger[_0x4c68('0x13')](_0x4c68('0x22'),_0x4cc05c,JSON[_0x4c68('0x16')](_0x4db5b0));_0x5b8d08(_0x4db5b0);})[_0x4c68('0x1a')](function(_0x417090){logger[_0x4c68('0x17')](_0x4c68('0x22'),_0x417090['message'],_0x4cc05c);_0x492ace(_0x50d844['error'](0x1f4,_0x417090[_0x4c68('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4387514..cba3e7b 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 _0x3831=['removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x5c4c79,_0x481485){var _0x45f704=function(_0x4daa44){while(--_0x4daa44){_0x5c4c79['push'](_0x5c4c79['shift']());}};_0x45f704(++_0x481485);}(_0x3831,0x14c));var _0x1383=function(_0x4fbb3e,_0x55785f){_0x4fbb3e=_0x4fbb3e-0x0;var _0x1eb197=_0x3831[_0x4fbb3e];return _0x1eb197;};'use strict';var UserVoiceQueueRtEvents=require(_0x1383('0x0'));var events=['save',_0x1383('0x1'),_0x1383('0x2')];function createListener(_0x3a25fd,_0x15e6b5){return function(_0x391bef){_0x15e6b5['emit'](_0x3a25fd,_0x391bef);};}function removeListener(_0x2fdf72,_0x573874){return function(){UserVoiceQueueRtEvents[_0x1383('0x3')](_0x2fdf72,_0x573874);};}exports['register']=function(_0x5b64b1){for(var _0x5eb4d8=0x0,_0x45a030=events['length'];_0x5eb4d8<_0x45a030;_0x5eb4d8++){var _0x187027=events[_0x5eb4d8];var _0x1ddd4c=createListener(_0x1383('0x4')+_0x187027,_0x5b64b1);UserVoiceQueueRtEvents['on'](_0x187027,_0x1ddd4c);}}; \ No newline at end of file +var _0x7fbe=['length','userVoiceQueueRt:','remove','update','emit','removeListener','register'];(function(_0x1e238a,_0x2d87d5){var _0x474b5d=function(_0x510873){while(--_0x510873){_0x1e238a['push'](_0x1e238a['shift']());}};_0x474b5d(++_0x2d87d5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x31c978,_0x9ec435){_0x31c978=_0x31c978-0x0;var _0x384c44=_0x7fbe[_0x31c978];return _0x384c44;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.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(){UserVoiceQueueRtEvents[_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);UserVoiceQueueRtEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 62b470b..51a85bb 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 _0x1be1=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x531d04,_0x5646c3){var _0x326a11=function(_0x2e73dc){while(--_0x2e73dc){_0x531d04['push'](_0x531d04['shift']());}};_0x326a11(++_0x5646c3);}(_0x1be1,0x192));var _0x11be=function(_0x113c38,_0x4f5000){_0x113c38=_0x113c38-0x0;var _0xee722b=_0x1be1[_0x113c38];return _0xee722b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var auth=require(_0x11be('0x3'));var interaction=require(_0x11be('0x4'));var config=require(_0x11be('0x5'));var controller=require('./variable.controller');router[_0x11be('0x6')]('/',auth[_0x11be('0x7')](),controller[_0x11be('0x8')]);router['get'](_0x11be('0x9'),auth['isAuthenticated'](),controller[_0x11be('0xa')]);router[_0x11be('0xb')]('/',auth[_0x11be('0x7')](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/:id',auth[_0x11be('0x7')](),controller[_0x11be('0xe')]);router['delete'](_0x11be('0x9'),auth[_0x11be('0x7')](),controller[_0x11be('0xf')]);module[_0x11be('0x10')]=router; \ No newline at end of file +var _0x750a=['/:id','show','create','delete','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index'];(function(_0x26fe15,_0x2d2320){var _0x269fa9=function(_0x8413ec){while(--_0x8413ec){_0x26fe15['push'](_0x26fe15['shift']());}};_0x269fa9(++_0x2d2320);}(_0x750a,0x140));var _0xa750=function(_0x76755c,_0x37443d){_0x76755c=_0x76755c-0x0;var _0x417835=_0x750a[_0x76755c];return _0x417835;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var auth=require(_0xa750('0x3'));var interaction=require(_0xa750('0x4'));var config=require(_0xa750('0x5'));var controller=require(_0xa750('0x6'));router[_0xa750('0x7')]('/',auth[_0xa750('0x8')](),controller[_0xa750('0x9')]);router[_0xa750('0x7')](_0xa750('0xa'),auth[_0xa750('0x8')](),controller[_0xa750('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xc')]);router['put'](_0xa750('0xa'),auth[_0xa750('0x8')](),controller['update']);router[_0xa750('0xd')](_0xa750('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xa750('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index a5f6855..9a6de7e 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 _0xaae7=['sequelize','exports','STRING','name'];(function(_0x298072,_0x399f9b){var _0x37cb5f=function(_0x18cca2){while(--_0x18cca2){_0x298072['push'](_0x298072['shift']());}};_0x37cb5f(++_0x399f9b);}(_0xaae7,0xa8));var _0x7aae=function(_0x56169d,_0x4bdde9){_0x56169d=_0x56169d-0x0;var _0x304a51=_0xaae7[_0x56169d];return _0x304a51;};'use strict';var Sequelize=require(_0x7aae('0x0'));module[_0x7aae('0x1')]={'name':{'type':Sequelize[_0x7aae('0x2')],'unique':_0x7aae('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7aae('0x2')]}}; \ No newline at end of file +var _0x2378=['STRING','sequelize','exports'];(function(_0x3d5d3f,_0x4fd0ec){var _0x1760a7=function(_0x3b57e9){while(--_0x3b57e9){_0x3d5d3f['push'](_0x3d5d3f['shift']());}};_0x1760a7(++_0x4fd0ec);}(_0x2378,0x64));var _0x8237=function(_0x4fd168,_0x5722ff){_0x4fd168=_0x4fd168-0x0;var _0x41792d=_0x2378[_0x4fd168];return _0x41792d;};'use strict';var Sequelize=require(_0x8237('0x0'));module[_0x8237('0x1')]={'name':{'type':Sequelize[_0x8237('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8237('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 91b33e7..9c614da 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 _0x5205=['filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','type','VIRTUAL','field','filter','Variable','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','send','index','rawAttributes','keys','query'];(function(_0x49ef86,_0x23dfd2){var _0xcc1a30=function(_0x55fa28){while(--_0x55fa28){_0x49ef86['push'](_0x49ef86['shift']());}};_0xcc1a30(++_0x23dfd2);}(_0x5205,0xcd));var _0x5520=function(_0x191c4b,_0x43ffa){_0x191c4b=_0x191c4b-0x0;var _0x484bfc=_0x5205[_0x191c4b];return _0x484bfc;};'use strict';var pdf=require(_0x5520('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5520('0x1'));var zipdir=require(_0x5520('0x2'));var jsonpatch=require(_0x5520('0x3'));var rp=require(_0x5520('0x4'));var moment=require(_0x5520('0x5'));var BPromise=require(_0x5520('0x6'));var Mustache=require(_0x5520('0x7'));var util=require(_0x5520('0x8'));var path=require(_0x5520('0x9'));var sox=require(_0x5520('0xa'));var csv=require('to-csv');var ejs=require(_0x5520('0xb'));var fs=require('fs');var _=require(_0x5520('0xc'));var squel=require(_0x5520('0xd'));var crypto=require(_0x5520('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5520('0xf'));var toCsv=require(_0x5520('0x10'));var querystring=require(_0x5520('0x11'));var Papa=require(_0x5520('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x5520('0x13'));var Redis=require('ioredis');var qs=require(_0x5520('0x14'));var logger=require(_0x5520('0x15'))(_0x5520('0x16'));var utils=require(_0x5520('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48199a,_0xdef662){_0xdef662=_0xdef662||0xcc;return function(_0x37e21d){if(_0x37e21d){return _0x48199a[_0x5520('0x18')](_0xdef662);}return _0x48199a[_0x5520('0x19')](_0xdef662)['end']();};}function respondWithResult(_0x332574,_0x41ccd5){_0x41ccd5=_0x41ccd5||0xc8;return function(_0x112648){if(_0x112648){return _0x332574[_0x5520('0x19')](_0x41ccd5)['json'](_0x112648);}};}function respondWithFilteredResult(_0x118405,_0x5e7a70){return function(_0x33a099){if(_0x33a099){var _0x2e53d8=_0x33a099[_0x5520('0x1a')],_0x22b87f=_0x5e7a70[_0x5520('0x1b')],_0x252de2=_0x5e7a70['offset']+_0x5e7a70['limit'],_0x1e600e;if(_0x252de2>=_0x2e53d8){_0x252de2=_0x2e53d8;_0x1e600e=0xc8;}else{_0x1e600e=0xce;}_0x118405['status'](_0x1e600e);return _0x118405[_0x5520('0x1c')](_0x5520('0x1d'),_0x22b87f+'-'+_0x252de2+'/'+_0x2e53d8)[_0x5520('0x1e')](_0x33a099);}return null;};}function patchUpdates(_0x3d883c){return function(_0x3ce075){try{jsonpatch[_0x5520('0x1f')](_0x3ce075,_0x3d883c,!![]);}catch(_0x19d58f){return BPromise[_0x5520('0x20')](_0x19d58f);}return _0x3ce075[_0x5520('0x21')]();};}function saveUpdates(_0x2fc447,_0x56e093){return function(_0x39d045){if(_0x39d045){return _0x39d045[_0x5520('0x22')](_0x2fc447)[_0x5520('0x23')](function(_0x3281e6){return _0x3281e6;});}return null;};}function removeEntity(_0xbb5d13,_0x1a8a21){return function(_0x31c517){if(_0x31c517){return _0x31c517[_0x5520('0x24')]()['then'](function(){var _0x483be9=_0x31c517[_0x5520('0x25')]({'plain':!![]});var _0x1e261c=_0x5520('0x26');return db[_0x5520('0x27')][_0x5520('0x24')]({'where':{'type':_0x1e261c,'resourceId':_0x483be9['id']}})[_0x5520('0x23')](function(){return _0x31c517;});})[_0x5520('0x23')](function(){_0xbb5d13[_0x5520('0x19')](0xcc)[_0x5520('0x28')]();});}};}function handleEntityNotFound(_0x1232c1,_0x5d1bc3){return function(_0x2c4850){if(!_0x2c4850){_0x1232c1[_0x5520('0x18')](0x194);}return _0x2c4850;};}function handleError(_0x4cebed,_0x4900eb){_0x4900eb=_0x4900eb||0x1f4;return function(_0x5356a8){logger[_0x5520('0x29')](_0x5356a8['stack']);if(_0x5356a8['name']){delete _0x5356a8['name'];}_0x4cebed[_0x5520('0x19')](_0x4900eb)[_0x5520('0x2a')](_0x5356a8);};}exports[_0x5520('0x2b')]=function(_0x34ae41,_0x1df9b1){var _0x8fc8db={},_0x4e1242={},_0x3a547b={'count':0x0,'rows':[]};var _0x2819d4=db['Variable'][_0x5520('0x2c')];_0x4e1242['model']=_[_0x5520('0x2d')](_0x2819d4);_0x4e1242[_0x5520('0x2e')]=_[_0x5520('0x2d')](_0x34ae41['query']);_0x4e1242[_0x5520('0x2f')]=_[_0x5520('0x30')](_0x4e1242[_0x5520('0x31')],_0x4e1242[_0x5520('0x2e')]);_0x8fc8db['attributes']=_[_0x5520('0x30')](_0x4e1242['model'],qs['fields'](_0x34ae41[_0x5520('0x2e')][_0x5520('0x32')]));_0x8fc8db[_0x5520('0x33')]=_0x8fc8db[_0x5520('0x33')][_0x5520('0x34')]?_0x8fc8db['attributes']:_0x4e1242[_0x5520('0x31')];if(!_0x34ae41[_0x5520('0x2e')][_0x5520('0x35')]('nolimit')){_0x8fc8db['limit']=qs[_0x5520('0x36')](_0x34ae41[_0x5520('0x2e')][_0x5520('0x36')]);_0x8fc8db[_0x5520('0x1b')]=qs[_0x5520('0x1b')](_0x34ae41[_0x5520('0x2e')][_0x5520('0x1b')]);}_0x8fc8db[_0x5520('0x37')]=qs['sort'](_0x34ae41[_0x5520('0x2e')][_0x5520('0x38')]);_0x8fc8db[_0x5520('0x39')]=qs[_0x5520('0x2f')](_[_0x5520('0x3a')](_0x34ae41[_0x5520('0x2e')],_0x4e1242[_0x5520('0x2f')]));if(_0x34ae41[_0x5520('0x2e')]['filter']){_0x8fc8db[_0x5520('0x39')]=_[_0x5520('0x3b')](_0x8fc8db['where'],{'$or':_['map'](_0x2819d4,function(_0x1e115a){if(_0x1e115a[_0x5520('0x3c')]['key']!==_0x5520('0x3d')){var _0x49c810={};_0x49c810[_0x1e115a[_0x5520('0x3e')]]={'$like':'%'+_0x34ae41[_0x5520('0x2e')][_0x5520('0x3f')]+'%'};return _0x49c810;}})});}_0x8fc8db=_[_0x5520('0x3b')]({},_0x8fc8db,_0x34ae41['options']);var _0x205293={'where':_0x8fc8db[_0x5520('0x39')]};return db[_0x5520('0x40')][_0x5520('0x1a')](_0x205293)[_0x5520('0x23')](function(_0x506d3d){_0x3a547b['count']=_0x506d3d;if(_0x34ae41[_0x5520('0x2e')][_0x5520('0x41')]){_0x8fc8db['include']=[{'all':!![]}];}return db[_0x5520('0x40')][_0x5520('0x42')](_0x8fc8db);})[_0x5520('0x23')](function(_0x51951e){_0x3a547b[_0x5520('0x43')]=_0x51951e;return _0x3a547b;})[_0x5520('0x23')](respondWithFilteredResult(_0x1df9b1,_0x8fc8db))[_0x5520('0x44')](handleError(_0x1df9b1,null));};exports[_0x5520('0x45')]=function(_0x12c730,_0x390690){var _0x52b8ed={'raw':!![],'where':{'id':_0x12c730[_0x5520('0x46')]['id']}},_0x1a4ed2={};_0x1a4ed2[_0x5520('0x31')]=_[_0x5520('0x2d')](db[_0x5520('0x40')][_0x5520('0x2c')]);_0x1a4ed2['query']=_[_0x5520('0x2d')](_0x12c730[_0x5520('0x2e')]);_0x1a4ed2[_0x5520('0x2f')]=_[_0x5520('0x30')](_0x1a4ed2[_0x5520('0x31')],_0x1a4ed2[_0x5520('0x2e')]);_0x52b8ed[_0x5520('0x33')]=_[_0x5520('0x30')](_0x1a4ed2[_0x5520('0x31')],qs['fields'](_0x12c730[_0x5520('0x2e')]['fields']));_0x52b8ed[_0x5520('0x33')]=_0x52b8ed['attributes'][_0x5520('0x34')]?_0x52b8ed[_0x5520('0x33')]:_0x1a4ed2[_0x5520('0x31')];if(_0x12c730[_0x5520('0x2e')][_0x5520('0x41')]){_0x52b8ed[_0x5520('0x47')]=[{'all':!![]}];}_0x52b8ed=_['merge']({},_0x52b8ed,_0x12c730[_0x5520('0x48')]);return db[_0x5520('0x40')][_0x5520('0x49')](_0x52b8ed)[_0x5520('0x23')](handleEntityNotFound(_0x390690,null))[_0x5520('0x23')](respondWithResult(_0x390690,null))['catch'](handleError(_0x390690,null));};exports['create']=function(_0x159563,_0xe28069){return db[_0x5520('0x40')][_0x5520('0x4a')](_0x159563['body'],{})['then'](function(_0x4e4cb1){var _0x118af7=_0x159563[_0x5520('0x4b')][_0x5520('0x25')]({'plain':!![]});if(!_0x118af7)throw new Error(_0x5520('0x4c'));if(_0x118af7[_0x5520('0x4d')]===_0x5520('0x4b')){var _0x568bd8=_0x4e4cb1['get']({'plain':!![]});var _0x85355a='Variables';return db[_0x5520('0x4e')][_0x5520('0x49')]({'where':{'name':_0x85355a,'userProfileId':_0x118af7[_0x5520('0x4f')]},'raw':!![]})[_0x5520('0x23')](function(_0x4bb724){if(_0x4bb724&&_0x4bb724[_0x5520('0x50')]===0x0){return db[_0x5520('0x27')][_0x5520('0x4a')]({'name':_0x568bd8[_0x5520('0x51')],'resourceId':_0x568bd8['id'],'type':_0x4bb724['name'],'sectionId':_0x4bb724['id']},{})[_0x5520('0x23')](function(){return _0x4e4cb1;});}else{return _0x4e4cb1;}})['catch'](function(_0x2c2bed){logger[_0x5520('0x29')](_0x5520('0x52'),_0x2c2bed);throw _0x2c2bed;});}return _0x4e4cb1;})[_0x5520('0x23')](respondWithResult(_0xe28069,0xc9))[_0x5520('0x44')](handleError(_0xe28069,null));};exports[_0x5520('0x22')]=function(_0x48036e,_0x2467a5){if(_0x48036e['body']['id']){delete _0x48036e[_0x5520('0x53')]['id'];}return db[_0x5520('0x40')]['find']({'where':{'id':_0x48036e['params']['id']}})[_0x5520('0x23')](handleEntityNotFound(_0x2467a5,null))[_0x5520('0x23')](saveUpdates(_0x48036e['body'],null))['then'](respondWithResult(_0x2467a5,null))[_0x5520('0x44')](handleError(_0x2467a5,null));};exports[_0x5520('0x24')]=function(_0x404c73,_0x14835d){return db[_0x5520('0x40')][_0x5520('0x49')]({'where':{'id':_0x404c73[_0x5520('0x46')]['id']}})[_0x5520('0x23')](handleEntityNotFound(_0x14835d,null))[_0x5520('0x23')](removeEntity(_0x14835d,null))[_0x5520('0x44')](handleError(_0x14835d,null));}; \ No newline at end of file +var _0xa11e=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','stack','name','send','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','merge','type','key','VIRTUAL','field','Variable','count','includeAll','findAll','rawAttributes','fields','include','find','catch','create','body','user','role','Variables','userProfileId','autoAssociation','UserProfileResource'];(function(_0x234baf,_0x7e6f45){var _0x55d8c7=function(_0x34dbfd){while(--_0x34dbfd){_0x234baf['push'](_0x234baf['shift']());}};_0x55d8c7(++_0x7e6f45);}(_0xa11e,0x137));var _0xea11=function(_0x80648c,_0x34d82c){_0x80648c=_0x80648c-0x0;var _0x3db203=_0xa11e[_0x80648c];return _0x3db203;};'use strict';var pdf=require(_0xea11('0x0'));var emlformat=require(_0xea11('0x1'));var rimraf=require(_0xea11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea11('0x3'));var rp=require(_0xea11('0x4'));var moment=require(_0xea11('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea11('0x6'));var util=require(_0xea11('0x7'));var path=require(_0xea11('0x8'));var sox=require(_0xea11('0x9'));var csv=require(_0xea11('0xa'));var ejs=require(_0xea11('0xb'));var fs=require('fs');var _=require(_0xea11('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea11('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xea11('0xa'));var querystring=require('querystring');var Papa=require(_0xea11('0xe'));var authService=require(_0xea11('0xf'));var hardwareService=require(_0xea11('0x10'));var Redis=require('ioredis');var qs=require(_0xea11('0x11'));var logger=require(_0xea11('0x12'))(_0xea11('0x13'));var utils=require('../../config/utils');var config=require(_0xea11('0x14'));var db=require(_0xea11('0x15'))['db'];function respondWithStatusCode(_0x50351d,_0x55f5a9){_0x55f5a9=_0x55f5a9||0xcc;return function(_0x53141d){if(_0x53141d){return _0x50351d[_0xea11('0x16')](_0x55f5a9);}return _0x50351d[_0xea11('0x17')](_0x55f5a9)[_0xea11('0x18')]();};}function respondWithResult(_0x4c57ab,_0x3e2ce1){_0x3e2ce1=_0x3e2ce1||0xc8;return function(_0x440455){if(_0x440455){return _0x4c57ab[_0xea11('0x17')](_0x3e2ce1)[_0xea11('0x19')](_0x440455);}};}function respondWithFilteredResult(_0x5df78d,_0x35cb05){return function(_0x4a6b15){if(_0x4a6b15){var _0x55f2ca=_0x4a6b15['count'],_0xf4f75=_0x35cb05[_0xea11('0x1a')],_0x1143e7=_0x35cb05[_0xea11('0x1a')]+_0x35cb05[_0xea11('0x1b')],_0x1c8543;if(_0x1143e7>=_0x55f2ca){_0x1143e7=_0x55f2ca;_0x1c8543=0xc8;}else{_0x1c8543=0xce;}_0x5df78d[_0xea11('0x17')](_0x1c8543);return _0x5df78d[_0xea11('0x1c')](_0xea11('0x1d'),_0xf4f75+'-'+_0x1143e7+'/'+_0x55f2ca)[_0xea11('0x19')](_0x4a6b15);}return null;};}function patchUpdates(_0x4067c7){return function(_0x10aa2b){try{jsonpatch[_0xea11('0x1e')](_0x10aa2b,_0x4067c7,!![]);}catch(_0x2822df){return BPromise[_0xea11('0x1f')](_0x2822df);}return _0x10aa2b[_0xea11('0x20')]();};}function saveUpdates(_0x377d6f,_0x3fbb97){return function(_0x3431bb){if(_0x3431bb){return _0x3431bb[_0xea11('0x21')](_0x377d6f)[_0xea11('0x22')](function(_0x45853c){return _0x45853c;});}return null;};}function removeEntity(_0x379144,_0x37abc3){return function(_0x4d645e){if(_0x4d645e){return _0x4d645e['destroy']()['then'](function(){var _0x3e89f4=_0x4d645e[_0xea11('0x23')]({'plain':!![]});var _0x5acda5='Variables';return db['UserProfileResource'][_0xea11('0x24')]({'where':{'type':_0x5acda5,'resourceId':_0x3e89f4['id']}})['then'](function(){return _0x4d645e;});})[_0xea11('0x22')](function(){_0x379144[_0xea11('0x17')](0xcc)[_0xea11('0x18')]();});}};}function handleEntityNotFound(_0x55ec62,_0x4b2cea){return function(_0x33dd0f){if(!_0x33dd0f){_0x55ec62['sendStatus'](0x194);}return _0x33dd0f;};}function handleError(_0x3fefb0,_0x383f63){_0x383f63=_0x383f63||0x1f4;return function(_0x48eacb){logger['error'](_0x48eacb[_0xea11('0x25')]);if(_0x48eacb[_0xea11('0x26')]){delete _0x48eacb['name'];}_0x3fefb0[_0xea11('0x17')](_0x383f63)[_0xea11('0x27')](_0x48eacb);};}exports['index']=function(_0x4c2517,_0x2ce1f8){var _0x20ee48={},_0x49c4b2={},_0xc4afa4={'count':0x0,'rows':[]};var _0x388def=db['Variable']['rawAttributes'];_0x49c4b2[_0xea11('0x28')]=_[_0xea11('0x29')](_0x388def);_0x49c4b2[_0xea11('0x2a')]=_[_0xea11('0x29')](_0x4c2517[_0xea11('0x2a')]);_0x49c4b2[_0xea11('0x2b')]=_['intersection'](_0x49c4b2[_0xea11('0x28')],_0x49c4b2[_0xea11('0x2a')]);_0x20ee48[_0xea11('0x2c')]=_[_0xea11('0x2d')](_0x49c4b2[_0xea11('0x28')],qs['fields'](_0x4c2517['query']['fields']));_0x20ee48[_0xea11('0x2c')]=_0x20ee48[_0xea11('0x2c')][_0xea11('0x2e')]?_0x20ee48[_0xea11('0x2c')]:_0x49c4b2[_0xea11('0x28')];if(!_0x4c2517[_0xea11('0x2a')][_0xea11('0x2f')]('nolimit')){_0x20ee48[_0xea11('0x1b')]=qs[_0xea11('0x1b')](_0x4c2517[_0xea11('0x2a')][_0xea11('0x1b')]);_0x20ee48[_0xea11('0x1a')]=qs[_0xea11('0x1a')](_0x4c2517[_0xea11('0x2a')][_0xea11('0x1a')]);}_0x20ee48[_0xea11('0x30')]=qs[_0xea11('0x31')](_0x4c2517[_0xea11('0x2a')][_0xea11('0x31')]);_0x20ee48[_0xea11('0x32')]=qs[_0xea11('0x2b')](_[_0xea11('0x33')](_0x4c2517['query'],_0x49c4b2[_0xea11('0x2b')]));if(_0x4c2517[_0xea11('0x2a')]['filter']){_0x20ee48[_0xea11('0x32')]=_[_0xea11('0x34')](_0x20ee48[_0xea11('0x32')],{'$or':_['map'](_0x388def,function(_0x3eddf8){if(_0x3eddf8[_0xea11('0x35')][_0xea11('0x36')]!==_0xea11('0x37')){var _0x59c11b={};_0x59c11b[_0x3eddf8[_0xea11('0x38')]]={'$like':'%'+_0x4c2517[_0xea11('0x2a')]['filter']+'%'};return _0x59c11b;}})});}_0x20ee48=_['merge']({},_0x20ee48,_0x4c2517['options']);var _0x40b42b={'where':_0x20ee48['where']};return db[_0xea11('0x39')]['count'](_0x40b42b)['then'](function(_0x33f08c){_0xc4afa4[_0xea11('0x3a')]=_0x33f08c;if(_0x4c2517['query'][_0xea11('0x3b')]){_0x20ee48['include']=[{'all':!![]}];}return db['Variable'][_0xea11('0x3c')](_0x20ee48);})[_0xea11('0x22')](function(_0x59c048){_0xc4afa4['rows']=_0x59c048;return _0xc4afa4;})['then'](respondWithFilteredResult(_0x2ce1f8,_0x20ee48))['catch'](handleError(_0x2ce1f8,null));};exports['show']=function(_0x1acaf4,_0x7a62c4){var _0x42fac3={'raw':!![],'where':{'id':_0x1acaf4['params']['id']}},_0x32cb44={};_0x32cb44[_0xea11('0x28')]=_[_0xea11('0x29')](db[_0xea11('0x39')][_0xea11('0x3d')]);_0x32cb44[_0xea11('0x2a')]=_[_0xea11('0x29')](_0x1acaf4[_0xea11('0x2a')]);_0x32cb44[_0xea11('0x2b')]=_[_0xea11('0x2d')](_0x32cb44[_0xea11('0x28')],_0x32cb44[_0xea11('0x2a')]);_0x42fac3['attributes']=_[_0xea11('0x2d')](_0x32cb44[_0xea11('0x28')],qs['fields'](_0x1acaf4['query'][_0xea11('0x3e')]));_0x42fac3[_0xea11('0x2c')]=_0x42fac3[_0xea11('0x2c')]['length']?_0x42fac3[_0xea11('0x2c')]:_0x32cb44[_0xea11('0x28')];if(_0x1acaf4[_0xea11('0x2a')][_0xea11('0x3b')]){_0x42fac3[_0xea11('0x3f')]=[{'all':!![]}];}_0x42fac3=_[_0xea11('0x34')]({},_0x42fac3,_0x1acaf4['options']);return db[_0xea11('0x39')][_0xea11('0x40')](_0x42fac3)[_0xea11('0x22')](handleEntityNotFound(_0x7a62c4,null))['then'](respondWithResult(_0x7a62c4,null))[_0xea11('0x41')](handleError(_0x7a62c4,null));};exports['create']=function(_0x14a331,_0x4f9352){return db[_0xea11('0x39')][_0xea11('0x42')](_0x14a331[_0xea11('0x43')],{})[_0xea11('0x22')](function(_0x3726cd){var _0x12faad=_0x14a331[_0xea11('0x44')][_0xea11('0x23')]({'plain':!![]});if(!_0x12faad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12faad[_0xea11('0x45')]===_0xea11('0x44')){var _0x42647b=_0x3726cd[_0xea11('0x23')]({'plain':!![]});var _0x5f0c50=_0xea11('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x5f0c50,'userProfileId':_0x12faad[_0xea11('0x47')]},'raw':!![]})['then'](function(_0x374bc2){if(_0x374bc2&&_0x374bc2[_0xea11('0x48')]===0x0){return db[_0xea11('0x49')][_0xea11('0x42')]({'name':_0x42647b[_0xea11('0x26')],'resourceId':_0x42647b['id'],'type':_0x374bc2[_0xea11('0x26')],'sectionId':_0x374bc2['id']},{})[_0xea11('0x22')](function(){return _0x3726cd;});}else{return _0x3726cd;}})['catch'](function(_0x468118){logger[_0xea11('0x4a')](_0xea11('0x4b'),_0x468118);throw _0x468118;});}return _0x3726cd;})[_0xea11('0x22')](respondWithResult(_0x4f9352,0xc9))['catch'](handleError(_0x4f9352,null));};exports[_0xea11('0x21')]=function(_0x16b3df,_0x3416f6){if(_0x16b3df[_0xea11('0x43')]['id']){delete _0x16b3df[_0xea11('0x43')]['id'];}return db[_0xea11('0x39')][_0xea11('0x40')]({'where':{'id':_0x16b3df[_0xea11('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3416f6,null))['then'](saveUpdates(_0x16b3df[_0xea11('0x43')],null))[_0xea11('0x22')](respondWithResult(_0x3416f6,null))[_0xea11('0x41')](handleError(_0x3416f6,null));};exports[_0xea11('0x24')]=function(_0x20c07,_0x4bede8){return db[_0xea11('0x39')][_0xea11('0x40')]({'where':{'id':_0x20c07[_0xea11('0x4c')]['id']}})[_0xea11('0x22')](handleEntityNotFound(_0x4bede8,null))['then'](removeEntity(_0x4bede8,null))[_0xea11('0x41')](handleError(_0x4bede8,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a08d4d3..ab6818f 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 _0xabce=['./variable.attributes','exports','Variable','lodash','util','../../config/logger','api','moment'];(function(_0x1414fe,_0x3d07fc){var _0x3f71c8=function(_0x278afe){while(--_0x278afe){_0x1414fe['push'](_0x1414fe['shift']());}};_0x3f71c8(++_0x3d07fc);}(_0xabce,0x103));var _0xeabc=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xabce[_0x4c7fb5];return _0x2e10ac;};'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 attributes=require(_0xeabc('0x5'));module[_0xeabc('0x6')]=function(_0x1a88a7,_0x5e9e2d){return _0x1a88a7['define'](_0xeabc('0x7'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['define','Variable','lodash','api','moment','bluebird','request-promise','./variable.attributes','exports'];(function(_0x4e87c2,_0x5aae58){var _0x58a8ed=function(_0x149989){while(--_0x149989){_0x4e87c2['push'](_0x4e87c2['shift']());}};_0x58a8ed(++_0x5aae58);}(_0x326f,0xd1));var _0xf326=function(_0x396952,_0xb152e9){_0x396952=_0x396952-0x0;var _0x11dfe4=_0x326f[_0x396952];return _0x11dfe4;};'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 attributes=require(_0xf326('0x5'));module[_0xf326('0x6')]=function(_0x9445c6,_0xf1c243){return _0x9445c6[_0xf326('0x7')](_0xf326('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index edfaefc..43250ea 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 _0xf98d=['Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Variable','options','where','attributes','include','map','model','ShowVariable','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0xc1ecef,_0x2a4037){var _0x36b871=function(_0xaa3e17){while(--_0xaa3e17){_0xc1ecef['push'](_0xc1ecef['shift']());}};_0x36b871(++_0x2a4037);}(_0xf98d,0x89));var _0xdf98=function(_0x4c8a97,_0x4ab502){_0x4c8a97=_0x4c8a97-0x0;var _0x24ef16=_0xf98d[_0x4c8a97];return _0x24ef16;};'use strict';var _=require(_0xdf98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf98('0x1'));var rs=require(_0xdf98('0x2'));var fs=require('fs');var Redis=require(_0xdf98('0x3'));var db=require(_0xdf98('0x4'))['db'];var utils=require(_0xdf98('0x5'));var logger=require(_0xdf98('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdf98('0x7'));var client=jayson[_0xdf98('0x8')][_0xdf98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x593670,_0x350aa3,_0x4ddab4){return new BPromise(function(_0x3fa219,_0x4a5502){return client[_0xdf98('0xa')](_0x593670,_0x4ddab4)[_0xdf98('0xb')](function(_0x13ecb0){logger[_0xdf98('0xc')](_0xdf98('0xd'),_0x350aa3,_0xdf98('0xe'));logger[_0xdf98('0xf')](_0xdf98('0x10'),_0x350aa3,_0xdf98('0xe'),JSON[_0xdf98('0x11')](_0x13ecb0));if(_0x13ecb0[_0xdf98('0x12')]){if(_0x13ecb0[_0xdf98('0x12')][_0xdf98('0x13')]===0x1f4){logger[_0xdf98('0x12')](_0xdf98('0xd'),_0x350aa3,_0x13ecb0[_0xdf98('0x12')][_0xdf98('0x14')]);return _0x4a5502(_0x13ecb0[_0xdf98('0x12')][_0xdf98('0x14')]);}logger[_0xdf98('0x12')](_0xdf98('0xd'),_0x350aa3,_0x13ecb0[_0xdf98('0x12')]['message']);return _0x3fa219(_0x13ecb0['error'][_0xdf98('0x14')]);}else{logger[_0xdf98('0xc')](_0xdf98('0xd'),_0x350aa3,_0xdf98('0xe'));_0x3fa219(_0x13ecb0['result'][_0xdf98('0x14')]);}})[_0xdf98('0x15')](function(_0x2fc7bf){logger[_0xdf98('0x12')](_0xdf98('0xd'),_0x350aa3,_0x2fc7bf);_0x4a5502(_0x2fc7bf);});});}exports['ShowVariable']=function(_0x37400e){var _0x2058aa=this;return new Promise(function(_0x5274a6,_0x38134c){return db[_0xdf98('0x16')]['find']({'raw':_0x37400e[_0xdf98('0x17')]?_0x37400e[_0xdf98('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37400e[_0xdf98('0x17')]?_0x37400e[_0xdf98('0x17')][_0xdf98('0x18')]||null:null,'attributes':_0x37400e['options']?_0x37400e[_0xdf98('0x17')][_0xdf98('0x19')]||null:null,'include':_0x37400e[_0xdf98('0x17')]?_0x37400e['options'][_0xdf98('0x1a')]?_[_0xdf98('0x1b')](_0x37400e[_0xdf98('0x17')]['include'],function(_0x5166ee){return{'model':db[_0x5166ee[_0xdf98('0x1c')]],'as':_0x5166ee['as'],'attributes':_0x5166ee[_0xdf98('0x19')],'include':_0x5166ee[_0xdf98('0x1a')]?_[_0xdf98('0x1b')](_0x5166ee[_0xdf98('0x1a')],function(_0x2d29a7){return{'model':db[_0x2d29a7[_0xdf98('0x1c')]],'as':_0x2d29a7['as'],'attributes':_0x2d29a7[_0xdf98('0x19')],'include':_0x2d29a7[_0xdf98('0x1a')]?_[_0xdf98('0x1b')](_0x2d29a7['include'],function(_0x10bc6f){return{'model':db[_0x10bc6f[_0xdf98('0x1c')]],'as':_0x10bc6f['as'],'attributes':_0x10bc6f[_0xdf98('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdf98('0xb')](function(_0x569d51){logger['info'](_0xdf98('0x1d'),_0x37400e);logger[_0xdf98('0xf')](_0xdf98('0x1d'),_0x37400e,JSON[_0xdf98('0x11')](_0x569d51));_0x5274a6(_0x569d51);})[_0xdf98('0x15')](function(_0x424263){logger[_0xdf98('0x12')](_0xdf98('0x1d'),_0x424263[_0xdf98('0x14')],_0x37400e);_0x38134c(_0x2058aa[_0xdf98('0x12')](0x1f4,_0x424263[_0xdf98('0x14')]));});});}; \ No newline at end of file +var _0x1f50=['error','code','message','result','catch','ShowVariable','Variable','find','options','raw','include','map','attributes','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x726fcb,_0x3bec04){var _0x2f26c7=function(_0x44a74e){while(--_0x44a74e){_0x726fcb['push'](_0x726fcb['shift']());}};_0x2f26c7(++_0x3bec04);}(_0x1f50,0xf5));var _0x01f5=function(_0x2a591f,_0x2a0b52){_0x2a591f=_0x2a591f-0x0;var _0x3db8ff=_0x1f50[_0x2a591f];return _0x3db8ff;};'use strict';var _=require(_0x01f5('0x0'));var util=require(_0x01f5('0x1'));var moment=require(_0x01f5('0x2'));var BPromise=require(_0x01f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01f5('0x4'));var db=require(_0x01f5('0x5'))['db'];var utils=require(_0x01f5('0x6'));var logger=require(_0x01f5('0x7'))(_0x01f5('0x8'));var config=require(_0x01f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x01f5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e88b,_0x3466ab,_0x1fdf65){return new BPromise(function(_0x5475fa,_0x1a6dd7){return client[_0x01f5('0xb')](_0x31e88b,_0x1fdf65)[_0x01f5('0xc')](function(_0x27b727){logger[_0x01f5('0xd')](_0x01f5('0xe'),_0x3466ab,_0x01f5('0xf'));logger[_0x01f5('0x10')](_0x01f5('0x11'),_0x3466ab,_0x01f5('0xf'),JSON[_0x01f5('0x12')](_0x27b727));if(_0x27b727[_0x01f5('0x13')]){if(_0x27b727['error'][_0x01f5('0x14')]===0x1f4){logger[_0x01f5('0x13')]('Variable,\x20%s,\x20%s',_0x3466ab,_0x27b727[_0x01f5('0x13')]['message']);return _0x1a6dd7(_0x27b727['error'][_0x01f5('0x15')]);}logger['error'](_0x01f5('0xe'),_0x3466ab,_0x27b727[_0x01f5('0x13')][_0x01f5('0x15')]);return _0x5475fa(_0x27b727[_0x01f5('0x13')][_0x01f5('0x15')]);}else{logger[_0x01f5('0xd')]('Variable,\x20%s,\x20%s',_0x3466ab,_0x01f5('0xf'));_0x5475fa(_0x27b727[_0x01f5('0x16')][_0x01f5('0x15')]);}})[_0x01f5('0x17')](function(_0x3678f8){logger['error'](_0x01f5('0xe'),_0x3466ab,_0x3678f8);_0x1a6dd7(_0x3678f8);});});}exports[_0x01f5('0x18')]=function(_0x3e5ded){var _0x405570=this;return new Promise(function(_0x1145c3,_0x531eec){return db[_0x01f5('0x19')][_0x01f5('0x1a')]({'raw':_0x3e5ded[_0x01f5('0x1b')]?_0x3e5ded[_0x01f5('0x1b')][_0x01f5('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e5ded[_0x01f5('0x1b')]?_0x3e5ded[_0x01f5('0x1b')]['where']||null:null,'attributes':_0x3e5ded[_0x01f5('0x1b')]?_0x3e5ded['options']['attributes']||null:null,'include':_0x3e5ded['options']?_0x3e5ded[_0x01f5('0x1b')][_0x01f5('0x1d')]?_[_0x01f5('0x1e')](_0x3e5ded[_0x01f5('0x1b')][_0x01f5('0x1d')],function(_0x31eda9){return{'model':db[_0x31eda9['model']],'as':_0x31eda9['as'],'attributes':_0x31eda9['attributes'],'include':_0x31eda9['include']?_['map'](_0x31eda9[_0x01f5('0x1d')],function(_0x3cda4e){return{'model':db[_0x3cda4e['model']],'as':_0x3cda4e['as'],'attributes':_0x3cda4e[_0x01f5('0x1f')],'include':_0x3cda4e['include']?_[_0x01f5('0x1e')](_0x3cda4e['include'],function(_0x187093){return{'model':db[_0x187093[_0x01f5('0x20')]],'as':_0x187093['as'],'attributes':_0x187093[_0x01f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x01f5('0xc')](function(_0x19ba28){logger['info'](_0x01f5('0x18'),_0x3e5ded);logger[_0x01f5('0x10')]('ShowVariable',_0x3e5ded,JSON['stringify'](_0x19ba28));_0x1145c3(_0x19ba28);})[_0x01f5('0x17')](function(_0x1378c6){logger[_0x01f5('0x13')](_0x01f5('0x18'),_0x1378c6[_0x01f5('0x15')],_0x3e5ded);_0x531eec(_0x405570[_0x01f5('0x13')](0x1f4,_0x1378c6[_0x01f5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index eaa8bd3..946f737 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 _0xd2a2=['pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd2a2,0x191));var _0x2d2a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd2a2[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require(_0x2d2a('0x0'));var router=express[_0x2d2a('0x1')]();var auth=require(_0x2d2a('0x2'));var controller=require(_0x2d2a('0x3'));router[_0x2d2a('0x4')]('/',controller[_0x2d2a('0x5')]);router[_0x2d2a('0x4')](_0x2d2a('0x6'),auth['isAuthenticated'](),auth[_0x2d2a('0x7')](),controller[_0x2d2a('0x8')]);router[_0x2d2a('0x4')](_0x2d2a('0x9'),auth[_0x2d2a('0xa')](),auth['canUpdate'](),controller[_0x2d2a('0xb')]);router[_0x2d2a('0x4')](_0x2d2a('0xc'),auth[_0x2d2a('0xa')](),auth['canUpdate'](),controller[_0x2d2a('0xd')]);router['get']('/restart',auth[_0x2d2a('0xa')](),controller[_0x2d2a('0xe')]);router[_0x2d2a('0x4')](_0x2d2a('0xf'),controller[_0x2d2a('0x10')]);module[_0x2d2a('0x11')]=router; \ No newline at end of file +var _0xb1a5=['reset','pull','/migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','/reset'];(function(_0xc40fee,_0x482a72){var _0x55b988=function(_0x406ce3){while(--_0x406ce3){_0xc40fee['push'](_0xc40fee['shift']());}};_0x55b988(++_0x482a72);}(_0xb1a5,0xdb));var _0x5b1a=function(_0x27a0f8,_0x548f0c){_0x27a0f8=_0x27a0f8-0x0;var _0x3cf656=_0xb1a5[_0x27a0f8];return _0x3cf656;};'use strict';var express=require(_0x5b1a('0x0'));var router=express[_0x5b1a('0x1')]();var auth=require(_0x5b1a('0x2'));var controller=require(_0x5b1a('0x3'));router['get']('/',controller['index']);router[_0x5b1a('0x4')](_0x5b1a('0x5'),auth[_0x5b1a('0x6')](),auth[_0x5b1a('0x7')](),controller['fetch']);router[_0x5b1a('0x4')](_0x5b1a('0x8'),auth['isAuthenticated'](),auth[_0x5b1a('0x7')](),controller[_0x5b1a('0x9')]);router[_0x5b1a('0x4')]('/pull',auth[_0x5b1a('0x6')](),auth[_0x5b1a('0x7')](),controller[_0x5b1a('0xa')]);router['get']('/restart',auth[_0x5b1a('0x6')](),controller['restart']);router['get'](_0x5b1a('0xb'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 49b5a57..c3693c6 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 _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x34ff52,_0x3fbcce){var _0x4fe35f=function(_0x58ee9d){while(--_0x58ee9d){_0x34ff52['push'](_0x34ff52['shift']());}};_0x4fe35f(++_0x3fbcce);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});}; \ No newline at end of file +var _0xa9e0=['master','error','info','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','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','root','server','exports','.js','catch','umzug','path','pkginfo','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','version','latest','fetch','tags','status','json','origin'];(function(_0x10e020,_0x287a04){var _0x14e767=function(_0x44841a){while(--_0x44841a){_0x10e020['push'](_0x10e020['shift']());}};_0x14e767(++_0x287a04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Umzug=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var pkginfo=require(_0x0a9e('0x2'))(module,'version');var exec=require('child_process')[_0x0a9e('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var pm2=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var git=require(_0x0a9e('0x8'))(config['root']);exports[_0x0a9e('0x9')]=function(_0x441e3a,_0x2cc193){var _0x5f41ea={'current':module['exports'][_0x0a9e('0xa')],'phonebar':0x2};if(_0x441e3a['query']&&_0x441e3a['query'][_0x0a9e('0xb')]){return git[_0x0a9e('0xc')]()[_0x0a9e('0xd')](function(_0x3ab53f,_0xfeb75b){_0x5f41ea[_0x0a9e('0xb')]=(_0x3ab53f?module['exports']['version']:_0xfeb75b['latest'])||'2.0.0';return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);});}else{return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);}};exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return git[_0x0a9e('0xc')]([_0x0a9e('0x10'),_0x0a9e('0x11')],function(_0x281129){if(_0x281129){logger[_0x0a9e('0x12')](_0x281129);return _0x5db4b0[_0x0a9e('0xe')](0x1f4)['json'](_0x281129);}logger[_0x0a9e('0x13')]('git\x20fetch');return _0x5db4b0[_0x0a9e('0xe')](0xc8)['json']({'output':_0x0a9e('0x14')});});};exports[_0x0a9e('0x15')]=function(_0x48f32d,_0x225616){return git['reset']([_0x0a9e('0x16'),_0x0a9e('0x17')],function(_0x106033){if(_0x106033){logger[_0x0a9e('0x12')](_0x106033);return _0x225616[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x106033);}logger[_0x0a9e('0x13')](_0x0a9e('0x18'));return _0x225616[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x19')});});};exports[_0x0a9e('0x1a')]=function(_0x4bb1e3,_0x2c3407){exec(_0x0a9e('0x1b'),function(_0x53682f,_0x20f109,_0x5a09ef){logger['info'](_0x20f109);logger[_0x0a9e('0x13')](_0x5a09ef);if(_0x53682f){logger[_0x0a9e('0x12')](_0x53682f);return _0x2c3407[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x53682f);}return _0x2c3407['status'](0xc8)[_0x0a9e('0xf')]({'output':_0x20f109});});};exports[_0x0a9e('0x1c')]=function(_0x3b45bc,_0x4d00e6){return pm2[_0x0a9e('0x1c')](_0x0a9e('0x1d'))[_0x0a9e('0x1e')](function(_0x5ea472){logger['info'](_0x0a9e('0x1f'),_0x5ea472);return _0x4d00e6[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x20')});})['catch'](function(_0x384319){logger['error'](_0x384319);return _0x4d00e6[_0x0a9e('0xe')](0x1f4)['json'](_0x384319);});};exports[_0x0a9e('0x21')]=function(_0x34dc65,_0x25fba9){var _0x14433c=new Umzug({'storage':_0x0a9e('0x22'),'storageOptions':{'model':db[_0x0a9e('0x23')],'modelName':_0x0a9e('0x23'),'columnName':_0x0a9e('0xa')},'migrations':{'params':[db['sequelize'][_0x0a9e('0x24')](),db[_0x0a9e('0x22')][_0x0a9e('0x25')],function(){throw new Error(_0x0a9e('0x26'));}],'path':path['join'](config[_0x0a9e('0x27')],_0x0a9e('0x28'),_0x0a9e('0x21')),'pattern':/\.js$/}});_0x14433c['up']({'from':module[_0x0a9e('0x29')][_0x0a9e('0xa')]+_0x0a9e('0x2a')})[_0x0a9e('0x1e')](function(){return _0x25fba9[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':'Database\x20Migration\x20Completed!'});})[_0x0a9e('0x2b')](function(_0x5d1e0e){return _0x25fba9[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x5d1e0e);});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 86f57c7..e431e51 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 _0xc4aa=['util','path','connect-timeout','express','Router','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['get']('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')]('/',auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['delete'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x12')]);module[_0xac4a('0x13')]=router; \ No newline at end of file +var _0xeda8=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x192d91,_0x33b7ae){var _0x24ce08=function(_0x4d727e){while(--_0x4d727e){_0x192d91['push'](_0x192d91['shift']());}};_0x24ce08(++_0x33b7ae);}(_0xeda8,0x104));var _0x8eda=function(_0x424239,_0x4ad7db){_0x424239=_0x424239-0x0;var _0x1899a2=_0xeda8[_0x424239];return _0x1899a2;};'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 auth=require(_0x8eda('0x5'));var interaction=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var controller=require(_0x8eda('0x8'));router[_0x8eda('0x9')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xb')]);router[_0x8eda('0x9')](_0x8eda('0xc'),auth['isAuthenticated'](),controller[_0x8eda('0xd')]);router[_0x8eda('0x9')](_0x8eda('0xe'),auth[_0x8eda('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8eda('0xf')](_0x8eda('0xe'),auth[_0x8eda('0xa')](),controller['update']);router[_0x8eda('0x10')]('/:id',auth[_0x8eda('0xa')](),controller[_0x8eda('0x11')]);module[_0x8eda('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 99953bf..7412f1d 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 _0xa060=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4238ed,_0x14c0ee){var _0xb59c08=function(_0x502992){while(--_0x502992){_0x4238ed['push'](_0x4238ed['shift']());}};_0xb59c08(++_0x14c0ee);}(_0xa060,0x7f));var _0x0a06=function(_0x20fcd0,_0x2854f4){_0x20fcd0=_0x20fcd0-0x0;var _0x446940=_0xa060[_0x20fcd0];return _0x446940;};'use strict';var Sequelize=require(_0x0a06('0x0'));module[_0x0a06('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0a06('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0a06('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0a06('0x2')]},'membername':{'type':Sequelize[_0x0a06('0x2')]},'agentcalledAt':{'type':Sequelize[_0x0a06('0x3')]},'agentconnectAt':{'type':Sequelize[_0x0a06('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x0a06('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x0a06('0x3')]},'agentdumpAt':{'type':Sequelize[_0x0a06('0x3')]},'holdtime':{'type':Sequelize[_0x0a06('0x4')]},'agentcomplete':{'type':Sequelize[_0x0a06('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0a06('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0a06('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0a06('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x0a06('0x2')]},'channel':{'type':Sequelize[_0x0a06('0x2')]},'channelstate':{'type':Sequelize[_0x0a06('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0a06('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0a06('0x2')]},'connectedlinename':{'type':Sequelize[_0x0a06('0x2')]},'language':{'type':Sequelize[_0x0a06('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0a06('0x2')]},'exten':{'type':Sequelize[_0x0a06('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x0a06('0x2')]},'destchannelstate':{'type':Sequelize[_0x0a06('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x0a06('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x0a06('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x0a06('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x0a06('0x2')]},'destlanguage':{'type':Sequelize[_0x0a06('0x2')]},'destaccountcode':{'type':Sequelize[_0x0a06('0x2')]},'destcontext':{'type':Sequelize[_0x0a06('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x0a06('0x2')]},'destuniqueid':{'type':Sequelize[_0x0a06('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0a06('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x0a06('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0a06('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdb5b=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdb5b,0x146));var _0xbdb5=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xdb5b[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0xbdb5('0x0'));module[_0xbdb5('0x1')]={'type':{'type':Sequelize[_0xbdb5('0x2')]},'uniqueid':{'type':Sequelize[_0xbdb5('0x2')]},'calleridnum':{'type':Sequelize[_0xbdb5('0x2')]},'calleridname':{'type':Sequelize[_0xbdb5('0x2')]},'queue':{'type':Sequelize[_0xbdb5('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xbdb5('0x2')]},'agentcalledAt':{'type':Sequelize[_0xbdb5('0x3')]},'agentconnectAt':{'type':Sequelize[_0xbdb5('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xbdb5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xbdb5('0x3')]},'agentdumpAt':{'type':Sequelize[_0xbdb5('0x3')]},'holdtime':{'type':Sequelize[_0xbdb5('0x4')]},'agentcomplete':{'type':Sequelize[_0xbdb5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbdb5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbdb5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbdb5('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xbdb5('0x2')]},'channel':{'type':Sequelize[_0xbdb5('0x2')]},'channelstate':{'type':Sequelize[_0xbdb5('0x4')]},'channelstatedesc':{'type':Sequelize[_0xbdb5('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbdb5('0x2')]},'connectedlinename':{'type':Sequelize[_0xbdb5('0x2')]},'language':{'type':Sequelize[_0xbdb5('0x2')]},'accountcode':{'type':Sequelize[_0xbdb5('0x2')]},'context':{'type':Sequelize[_0xbdb5('0x2')]},'exten':{'type':Sequelize[_0xbdb5('0x2')]},'priority':{'type':Sequelize[_0xbdb5('0x2')]},'destchannel':{'type':Sequelize[_0xbdb5('0x2')]},'destchannelstate':{'type':Sequelize[_0xbdb5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xbdb5('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbdb5('0x2')]},'destcalleridname':{'type':Sequelize[_0xbdb5('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xbdb5('0x2')]},'destlanguage':{'type':Sequelize[_0xbdb5('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbdb5('0x2')]},'destexten':{'type':Sequelize[_0xbdb5('0x2')]},'destpriority':{'type':Sequelize[_0xbdb5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbdb5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xbdb5('0x2')]},'transfer':{'type':Sequelize[_0xbdb5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbdb5('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xbdb5('0x2')]},'transferuniqueid':{'type':Sequelize[_0xbdb5('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index a13d980..a18ba86 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 _0x6b61=['rawAttributes','length','include','find','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','set','Content-Range','json','apply','reject','destroy','then','error','stack','name','index','VoiceAgentReport','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','field','options','includeAll','findAll','catch','show'];(function(_0x490a99,_0x385d34){var _0x5b6a4e=function(_0x1c68da){while(--_0x1c68da){_0x490a99['push'](_0x490a99['shift']());}};_0x5b6a4e(++_0x385d34);}(_0x6b61,0x16a));var _0x16b6=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x6b61[_0x11e30d];return _0x2d4e29;};'use strict';var pdf=require(_0x16b6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x16b6('0x1'));var zipdir=require(_0x16b6('0x2'));var jsonpatch=require(_0x16b6('0x3'));var rp=require(_0x16b6('0x4'));var moment=require(_0x16b6('0x5'));var BPromise=require(_0x16b6('0x6'));var Mustache=require(_0x16b6('0x7'));var util=require(_0x16b6('0x8'));var path=require('path');var sox=require(_0x16b6('0x9'));var csv=require(_0x16b6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x16b6('0xb'));var squel=require(_0x16b6('0xc'));var crypto=require('crypto');var jsforce=require(_0x16b6('0xd'));var deskjs=require(_0x16b6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x16b6('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x16b6('0x10'));var qs=require(_0x16b6('0x11'));var logger=require(_0x16b6('0x12'))(_0x16b6('0x13'));var utils=require(_0x16b6('0x14'));var config=require(_0x16b6('0x15'));var db=require(_0x16b6('0x16'))['db'];function respondWithStatusCode(_0x598a27,_0x4c918c){_0x4c918c=_0x4c918c||0xcc;return function(_0x4ce093){if(_0x4ce093){return _0x598a27[_0x16b6('0x17')](_0x4c918c);}return _0x598a27[_0x16b6('0x18')](_0x4c918c)[_0x16b6('0x19')]();};}function respondWithResult(_0x250b7b,_0x132d71){_0x132d71=_0x132d71||0xc8;return function(_0x13158a){if(_0x13158a){return _0x250b7b[_0x16b6('0x18')](_0x132d71)['json'](_0x13158a);}};}function respondWithFilteredResult(_0x43600e,_0x581b5a){return function(_0x5ae7c4){if(_0x5ae7c4){var _0x4f8a1e=_0x5ae7c4[_0x16b6('0x1a')],_0x4e8514=_0x581b5a['offset'],_0x5f42bc=_0x581b5a['offset']+_0x581b5a['limit'],_0x4833a0;if(_0x5f42bc>=_0x4f8a1e){_0x5f42bc=_0x4f8a1e;_0x4833a0=0xc8;}else{_0x4833a0=0xce;}_0x43600e[_0x16b6('0x18')](_0x4833a0);return _0x43600e[_0x16b6('0x1b')](_0x16b6('0x1c'),_0x4e8514+'-'+_0x5f42bc+'/'+_0x4f8a1e)[_0x16b6('0x1d')](_0x5ae7c4);}return null;};}function patchUpdates(_0x27836a){return function(_0x1302f3){try{jsonpatch[_0x16b6('0x1e')](_0x1302f3,_0x27836a,!![]);}catch(_0x47508b){return BPromise[_0x16b6('0x1f')](_0x47508b);}return _0x1302f3['save']();};}function saveUpdates(_0x3ccdfa,_0x4a8c64){return function(_0x5307d1){if(_0x5307d1){return _0x5307d1['update'](_0x3ccdfa)['then'](function(_0x35fc32){return _0x35fc32;});}return null;};}function removeEntity(_0x375f2c,_0x1b5424){return function(_0x360d4a){if(_0x360d4a){return _0x360d4a[_0x16b6('0x20')]()[_0x16b6('0x21')](function(){_0x375f2c[_0x16b6('0x18')](0xcc)[_0x16b6('0x19')]();});}};}function handleEntityNotFound(_0x4a3dc4,_0x20a807){return function(_0xb56485){if(!_0xb56485){_0x4a3dc4['sendStatus'](0x194);}return _0xb56485;};}function handleError(_0x182bcc,_0x3b19d9){_0x3b19d9=_0x3b19d9||0x1f4;return function(_0x59a461){logger[_0x16b6('0x22')](_0x59a461[_0x16b6('0x23')]);if(_0x59a461['name']){delete _0x59a461[_0x16b6('0x24')];}_0x182bcc[_0x16b6('0x18')](_0x3b19d9)['send'](_0x59a461);};}exports[_0x16b6('0x25')]=function(_0x2c12aa,_0x4451a1){var _0x35b127={},_0x599aa0={},_0x44fa79={'count':0x0,'rows':[]};var _0x499618=db[_0x16b6('0x26')]['rawAttributes'];_0x599aa0[_0x16b6('0x27')]=_['keys'](_0x499618);_0x599aa0[_0x16b6('0x28')]=_[_0x16b6('0x29')](_0x2c12aa[_0x16b6('0x28')]);_0x599aa0[_0x16b6('0x2a')]=_['intersection'](_0x599aa0['model'],_0x599aa0[_0x16b6('0x28')]);_0x35b127[_0x16b6('0x2b')]=_[_0x16b6('0x2c')](_0x599aa0[_0x16b6('0x27')],qs[_0x16b6('0x2d')](_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x2d')]));_0x35b127[_0x16b6('0x2b')]=_0x35b127[_0x16b6('0x2b')]['length']?_0x35b127[_0x16b6('0x2b')]:_0x599aa0[_0x16b6('0x27')];if(!_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x2e')](_0x16b6('0x2f'))){_0x35b127[_0x16b6('0x30')]=qs['limit'](_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x30')]);_0x35b127['offset']=qs[_0x16b6('0x31')](_0x2c12aa['query'][_0x16b6('0x31')]);}_0x35b127[_0x16b6('0x32')]=qs[_0x16b6('0x33')](_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x33')]);_0x35b127[_0x16b6('0x34')]=qs[_0x16b6('0x2a')](_[_0x16b6('0x35')](_0x2c12aa[_0x16b6('0x28')],_0x599aa0[_0x16b6('0x2a')]));if(_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x36')]){_0x35b127[_0x16b6('0x34')]=_[_0x16b6('0x37')](_0x35b127[_0x16b6('0x34')],{'$or':_[_0x16b6('0x38')](_0x499618,function(_0x2460fb){if(_0x2460fb[_0x16b6('0x39')]['key']!=='VIRTUAL'){var _0x71e904={};_0x71e904[_0x2460fb[_0x16b6('0x3a')]]={'$like':'%'+_0x2c12aa[_0x16b6('0x28')][_0x16b6('0x36')]+'%'};return _0x71e904;}})});}_0x35b127=_['merge']({},_0x35b127,_0x2c12aa[_0x16b6('0x3b')]);var _0x3b99e7={'where':_0x35b127['where']};return db[_0x16b6('0x26')][_0x16b6('0x1a')](_0x3b99e7)[_0x16b6('0x21')](function(_0x51de3f){_0x44fa79[_0x16b6('0x1a')]=_0x51de3f;if(_0x2c12aa['query'][_0x16b6('0x3c')]){_0x35b127['include']=[{'all':!![]}];}return db[_0x16b6('0x26')][_0x16b6('0x3d')](_0x35b127);})[_0x16b6('0x21')](function(_0x26a675){_0x44fa79['rows']=_0x26a675;return _0x44fa79;})['then'](respondWithFilteredResult(_0x4451a1,_0x35b127))[_0x16b6('0x3e')](handleError(_0x4451a1,null));};exports[_0x16b6('0x3f')]=function(_0x5988ae,_0x44531d){var _0x4e41ca={'raw':![],'where':{'id':_0x5988ae['params']['id']}},_0x208621={};_0x208621['model']=_[_0x16b6('0x29')](db['VoiceAgentReport'][_0x16b6('0x40')]);_0x208621[_0x16b6('0x28')]=_[_0x16b6('0x29')](_0x5988ae[_0x16b6('0x28')]);_0x208621[_0x16b6('0x2a')]=_[_0x16b6('0x2c')](_0x208621[_0x16b6('0x27')],_0x208621[_0x16b6('0x28')]);_0x4e41ca[_0x16b6('0x2b')]=_[_0x16b6('0x2c')](_0x208621[_0x16b6('0x27')],qs[_0x16b6('0x2d')](_0x5988ae[_0x16b6('0x28')][_0x16b6('0x2d')]));_0x4e41ca[_0x16b6('0x2b')]=_0x4e41ca[_0x16b6('0x2b')][_0x16b6('0x41')]?_0x4e41ca[_0x16b6('0x2b')]:_0x208621['model'];if(_0x5988ae['query']['includeAll']){_0x4e41ca[_0x16b6('0x42')]=[{'all':!![]}];}_0x4e41ca=_['merge']({},_0x4e41ca,_0x5988ae['options']);return db[_0x16b6('0x26')][_0x16b6('0x43')](_0x4e41ca)['then'](handleEntityNotFound(_0x44531d,null))[_0x16b6('0x21')](respondWithResult(_0x44531d,null))[_0x16b6('0x3e')](handleError(_0x44531d,null));};exports['create']=function(_0x3c8f9c,_0x2cf5a9){return db[_0x16b6('0x26')]['create'](_0x3c8f9c[_0x16b6('0x44')],{})[_0x16b6('0x21')](respondWithResult(_0x2cf5a9,0xc9))[_0x16b6('0x3e')](handleError(_0x2cf5a9,null));};exports['update']=function(_0x269f94,_0x4a6a2e){if(_0x269f94[_0x16b6('0x44')]['id']){delete _0x269f94[_0x16b6('0x44')]['id'];}return db[_0x16b6('0x26')][_0x16b6('0x43')]({'where':{'id':_0x269f94[_0x16b6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a6a2e,null))[_0x16b6('0x21')](saveUpdates(_0x269f94[_0x16b6('0x44')],null))[_0x16b6('0x21')](respondWithResult(_0x4a6a2e,null))['catch'](handleError(_0x4a6a2e,null));};exports[_0x16b6('0x20')]=function(_0x24b9f3,_0x53d2ca){return db[_0x16b6('0x26')][_0x16b6('0x43')]({'where':{'id':_0x24b9f3['params']['id']}})['then'](handleEntityNotFound(_0x53d2ca,null))[_0x16b6('0x21')](removeEntity(_0x53d2ca,null))[_0x16b6('0x3e')](handleError(_0x53d2ca,null));};exports[_0x16b6('0x46')]=function(_0x12e72b,_0x39beca){return db[_0x16b6('0x26')][_0x16b6('0x46')]()['then'](respondWithResult(_0x39beca,null))[_0x16b6('0x3e')](handleError(_0x39beca,null));}; \ No newline at end of file +var _0xca74=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','catch','create','body','update','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','name','index','VoiceAgentReport','model','keys'];(function(_0x58c599,_0x410605){var _0x3048bf=function(_0x3715ac){while(--_0x3715ac){_0x58c599['push'](_0x58c599['shift']());}};_0x3048bf(++_0x410605);}(_0xca74,0x170));var _0x4ca7=function(_0x3e2b4e,_0x5cba62){_0x3e2b4e=_0x3e2b4e-0x0;var _0xa545e9=_0xca74[_0x3e2b4e];return _0xa545e9;};'use strict';var pdf=require(_0x4ca7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4ca7('0x1'));var zipdir=require(_0x4ca7('0x2'));var jsonpatch=require(_0x4ca7('0x3'));var rp=require(_0x4ca7('0x4'));var moment=require(_0x4ca7('0x5'));var BPromise=require(_0x4ca7('0x6'));var Mustache=require(_0x4ca7('0x7'));var util=require(_0x4ca7('0x8'));var path=require(_0x4ca7('0x9'));var sox=require(_0x4ca7('0xa'));var csv=require(_0x4ca7('0xb'));var ejs=require(_0x4ca7('0xc'));var fs=require('fs');var _=require(_0x4ca7('0xd'));var squel=require(_0x4ca7('0xe'));var crypto=require(_0x4ca7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4ca7('0xb'));var querystring=require(_0x4ca7('0x10'));var Papa=require(_0x4ca7('0x11'));var authService=require(_0x4ca7('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4ca7('0x13'));var qs=require(_0x4ca7('0x14'));var logger=require('../../config/logger')(_0x4ca7('0x15'));var utils=require(_0x4ca7('0x16'));var config=require('../../config/environment');var db=require(_0x4ca7('0x17'))['db'];function respondWithStatusCode(_0x14842a,_0x558f79){_0x558f79=_0x558f79||0xcc;return function(_0x219b66){if(_0x219b66){return _0x14842a[_0x4ca7('0x18')](_0x558f79);}return _0x14842a[_0x4ca7('0x19')](_0x558f79)['end']();};}function respondWithResult(_0x16f72f,_0x82a668){_0x82a668=_0x82a668||0xc8;return function(_0x1526d8){if(_0x1526d8){return _0x16f72f[_0x4ca7('0x19')](_0x82a668)[_0x4ca7('0x1a')](_0x1526d8);}};}function respondWithFilteredResult(_0x4b21aa,_0x13ebd7){return function(_0xcf446a){if(_0xcf446a){var _0x5564ab=_0xcf446a[_0x4ca7('0x1b')],_0x3ccd26=_0x13ebd7[_0x4ca7('0x1c')],_0x48ee1f=_0x13ebd7['offset']+_0x13ebd7[_0x4ca7('0x1d')],_0x1e163b;if(_0x48ee1f>=_0x5564ab){_0x48ee1f=_0x5564ab;_0x1e163b=0xc8;}else{_0x1e163b=0xce;}_0x4b21aa[_0x4ca7('0x19')](_0x1e163b);return _0x4b21aa[_0x4ca7('0x1e')](_0x4ca7('0x1f'),_0x3ccd26+'-'+_0x48ee1f+'/'+_0x5564ab)['json'](_0xcf446a);}return null;};}function patchUpdates(_0x4aee31){return function(_0x200dcd){try{jsonpatch[_0x4ca7('0x20')](_0x200dcd,_0x4aee31,!![]);}catch(_0x2de6ad){return BPromise['reject'](_0x2de6ad);}return _0x200dcd['save']();};}function saveUpdates(_0x1e4450,_0x5cf6dd){return function(_0x51efcd){if(_0x51efcd){return _0x51efcd['update'](_0x1e4450)[_0x4ca7('0x21')](function(_0x265eef){return _0x265eef;});}return null;};}function removeEntity(_0x1167ea,_0x791357){return function(_0x116882){if(_0x116882){return _0x116882[_0x4ca7('0x22')]()[_0x4ca7('0x21')](function(){_0x1167ea[_0x4ca7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172b82,_0xf67e2b){return function(_0x5d0b48){if(!_0x5d0b48){_0x172b82['sendStatus'](0x194);}return _0x5d0b48;};}function handleError(_0x159cd4,_0x41421b){_0x41421b=_0x41421b||0x1f4;return function(_0x5bbed0){logger['error'](_0x5bbed0['stack']);if(_0x5bbed0[_0x4ca7('0x23')]){delete _0x5bbed0[_0x4ca7('0x23')];}_0x159cd4[_0x4ca7('0x19')](_0x41421b)['send'](_0x5bbed0);};}exports[_0x4ca7('0x24')]=function(_0x1d6354,_0x390a26){var _0xf3a50a={},_0x2b83ea={},_0x7fb56f={'count':0x0,'rows':[]};var _0x4b41b1=db[_0x4ca7('0x25')]['rawAttributes'];_0x2b83ea[_0x4ca7('0x26')]=_[_0x4ca7('0x27')](_0x4b41b1);_0x2b83ea[_0x4ca7('0x28')]=_[_0x4ca7('0x27')](_0x1d6354[_0x4ca7('0x28')]);_0x2b83ea[_0x4ca7('0x29')]=_[_0x4ca7('0x2a')](_0x2b83ea[_0x4ca7('0x26')],_0x2b83ea[_0x4ca7('0x28')]);_0xf3a50a[_0x4ca7('0x2b')]=_[_0x4ca7('0x2a')](_0x2b83ea[_0x4ca7('0x26')],qs[_0x4ca7('0x2c')](_0x1d6354[_0x4ca7('0x28')][_0x4ca7('0x2c')]));_0xf3a50a[_0x4ca7('0x2b')]=_0xf3a50a[_0x4ca7('0x2b')][_0x4ca7('0x2d')]?_0xf3a50a[_0x4ca7('0x2b')]:_0x2b83ea['model'];if(!_0x1d6354[_0x4ca7('0x28')][_0x4ca7('0x2e')](_0x4ca7('0x2f'))){_0xf3a50a[_0x4ca7('0x1d')]=qs[_0x4ca7('0x1d')](_0x1d6354[_0x4ca7('0x28')]['limit']);_0xf3a50a[_0x4ca7('0x1c')]=qs[_0x4ca7('0x1c')](_0x1d6354[_0x4ca7('0x28')]['offset']);}_0xf3a50a[_0x4ca7('0x30')]=qs['sort'](_0x1d6354['query']['sort']);_0xf3a50a[_0x4ca7('0x31')]=qs[_0x4ca7('0x29')](_['pick'](_0x1d6354['query'],_0x2b83ea[_0x4ca7('0x29')]));if(_0x1d6354[_0x4ca7('0x28')][_0x4ca7('0x32')]){_0xf3a50a[_0x4ca7('0x31')]=_['merge'](_0xf3a50a[_0x4ca7('0x31')],{'$or':_[_0x4ca7('0x33')](_0x4b41b1,function(_0x5a58f0){if(_0x5a58f0[_0x4ca7('0x34')]['key']!==_0x4ca7('0x35')){var _0x124590={};_0x124590[_0x5a58f0[_0x4ca7('0x36')]]={'$like':'%'+_0x1d6354[_0x4ca7('0x28')]['filter']+'%'};return _0x124590;}})});}_0xf3a50a=_[_0x4ca7('0x37')]({},_0xf3a50a,_0x1d6354[_0x4ca7('0x38')]);var _0x1c602a={'where':_0xf3a50a['where']};return db['VoiceAgentReport'][_0x4ca7('0x1b')](_0x1c602a)[_0x4ca7('0x21')](function(_0x1a0957){_0x7fb56f[_0x4ca7('0x1b')]=_0x1a0957;if(_0x1d6354[_0x4ca7('0x28')][_0x4ca7('0x39')]){_0xf3a50a[_0x4ca7('0x3a')]=[{'all':!![]}];}return db[_0x4ca7('0x25')][_0x4ca7('0x3b')](_0xf3a50a);})[_0x4ca7('0x21')](function(_0x5ddf24){_0x7fb56f['rows']=_0x5ddf24;return _0x7fb56f;})[_0x4ca7('0x21')](respondWithFilteredResult(_0x390a26,_0xf3a50a))['catch'](handleError(_0x390a26,null));};exports[_0x4ca7('0x3c')]=function(_0x5da1ab,_0x17b23e){var _0x4d3b0d={'raw':![],'where':{'id':_0x5da1ab[_0x4ca7('0x3d')]['id']}},_0x21b88d={};_0x21b88d[_0x4ca7('0x26')]=_[_0x4ca7('0x27')](db['VoiceAgentReport']['rawAttributes']);_0x21b88d[_0x4ca7('0x28')]=_[_0x4ca7('0x27')](_0x5da1ab[_0x4ca7('0x28')]);_0x21b88d[_0x4ca7('0x29')]=_[_0x4ca7('0x2a')](_0x21b88d[_0x4ca7('0x26')],_0x21b88d['query']);_0x4d3b0d['attributes']=_[_0x4ca7('0x2a')](_0x21b88d[_0x4ca7('0x26')],qs['fields'](_0x5da1ab[_0x4ca7('0x28')]['fields']));_0x4d3b0d[_0x4ca7('0x2b')]=_0x4d3b0d[_0x4ca7('0x2b')][_0x4ca7('0x2d')]?_0x4d3b0d[_0x4ca7('0x2b')]:_0x21b88d[_0x4ca7('0x26')];if(_0x5da1ab['query'][_0x4ca7('0x39')]){_0x4d3b0d[_0x4ca7('0x3a')]=[{'all':!![]}];}_0x4d3b0d=_[_0x4ca7('0x37')]({},_0x4d3b0d,_0x5da1ab[_0x4ca7('0x38')]);return db['VoiceAgentReport']['find'](_0x4d3b0d)[_0x4ca7('0x21')](handleEntityNotFound(_0x17b23e,null))[_0x4ca7('0x21')](respondWithResult(_0x17b23e,null))[_0x4ca7('0x3e')](handleError(_0x17b23e,null));};exports['create']=function(_0x48cb02,_0x556612){return db['VoiceAgentReport'][_0x4ca7('0x3f')](_0x48cb02[_0x4ca7('0x40')],{})[_0x4ca7('0x21')](respondWithResult(_0x556612,0xc9))[_0x4ca7('0x3e')](handleError(_0x556612,null));};exports[_0x4ca7('0x41')]=function(_0x40bc1e,_0x5cd9ee){if(_0x40bc1e[_0x4ca7('0x40')]['id']){delete _0x40bc1e[_0x4ca7('0x40')]['id'];}return db['VoiceAgentReport'][_0x4ca7('0x42')]({'where':{'id':_0x40bc1e[_0x4ca7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5cd9ee,null))[_0x4ca7('0x21')](saveUpdates(_0x40bc1e['body'],null))[_0x4ca7('0x21')](respondWithResult(_0x5cd9ee,null))[_0x4ca7('0x3e')](handleError(_0x5cd9ee,null));};exports[_0x4ca7('0x22')]=function(_0x169336,_0x5ac1ff){return db[_0x4ca7('0x25')][_0x4ca7('0x42')]({'where':{'id':_0x169336[_0x4ca7('0x3d')]['id']}})[_0x4ca7('0x21')](handleEntityNotFound(_0x5ac1ff,null))[_0x4ca7('0x21')](removeEntity(_0x5ac1ff,null))[_0x4ca7('0x3e')](handleError(_0x5ac1ff,null));};exports[_0x4ca7('0x43')]=function(_0x86dffe,_0x34bf06){return db['VoiceAgentReport'][_0x4ca7('0x43')]()[_0x4ca7('0x21')](respondWithResult(_0x34bf06,null))[_0x4ca7('0x3e')](handleError(_0x34bf06,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b859852..f766327 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 _0xc783=['../../config/logger','moment','request-promise','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','lodash','util'];(function(_0x85fe6,_0x46c16a){var _0x1aabf3=function(_0x25aecd){while(--_0x25aecd){_0x85fe6['push'](_0x85fe6['shift']());}};_0x1aabf3(++_0x46c16a);}(_0xc783,0x9e));var _0x3c78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc783[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3c78('0x0'));var util=require(_0x3c78('0x1'));var logger=require(_0x3c78('0x2'))('api');var moment=require(_0x3c78('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c78('0x4'));var attributes=require(_0x3c78('0x5'));module['exports']=function(_0x5a9d68,_0x386e0f){return _0x5a9d68[_0x3c78('0x6')](_0x3c78('0x7'),attributes,{'tableName':_0x3c78('0x8'),'paranoid':![],'indexes':[{'fields':[_0x3c78('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f0c=['../../config/logger','bluebird','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x0f0c,0x1d8));var _0xc0f0=function(_0x9ce749,_0x38b8cf){_0x9ce749=_0x9ce749-0x0;var _0x3d2c62=_0x0f0c[_0x9ce749];return _0x3d2c62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc0f0('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc0f0('0x1'));var rp=require('request-promise');var attributes=require(_0xc0f0('0x2'));module[_0xc0f0('0x3')]=function(_0xc61a01,_0x1b9956){return _0xc61a01[_0xc0f0('0x4')]('VoiceAgentReport',attributes,{'tableName':_0xc0f0('0x5'),'paranoid':![],'indexes':[{'fields':[_0xc0f0('0x6'),_0xc0f0('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index ccc4846..df623c6 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x3add10,_0x457d16){var _0x2da348=function(_0x1fcaa9){while(--_0x1fcaa9){_0x3add10['push'](_0x3add10['shift']());}};_0x2da348(++_0x457d16);}(_0x814b,0x1a2));var _0xb814=function(_0x11ec6c,_0x1a8169){_0x11ec6c=_0x11ec6c-0x0;var _0xb59506=_0x814b[_0x11ec6c];return _0xb59506;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x814b,0x1a2));var _0xb814=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x814b[_0x43de22];return _0x4b15ee;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 879745d..d3b11a2 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 _0x8f18=['describe','/:id','post','update','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x8f18,0x156));var _0x88f1=function(_0x138309,_0x39b5eb){_0x138309=_0x138309-0x0;var _0x596767=_0x8f18[_0x138309];return _0x596767;};'use strict';var multer=require('multer');var util=require(_0x88f1('0x0'));var path=require(_0x88f1('0x1'));var timeout=require(_0x88f1('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x88f1('0x3'));var interaction=require(_0x88f1('0x4'));var config=require(_0x88f1('0x5'));var controller=require(_0x88f1('0x6'));router[_0x88f1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x88f1('0x7')](_0x88f1('0x8'),auth[_0x88f1('0x9')](),controller[_0x88f1('0xa')]);router[_0x88f1('0x7')](_0x88f1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x88f1('0xc')]('/',auth[_0x88f1('0x9')](),controller['create']);router['put']('/:id',auth[_0x88f1('0x9')](),controller[_0x88f1('0xd')]);router[_0x88f1('0xe')](_0x88f1('0xb'),auth[_0x88f1('0x9')](),controller['destroy']);module[_0x88f1('0xf')]=router; \ No newline at end of file +var _0xb9de=['post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','describe'];(function(_0x5316d3,_0x5cba98){var _0x27d9fa=function(_0x4c6d92){while(--_0x4c6d92){_0x5316d3['push'](_0x5316d3['shift']());}};_0x27d9fa(++_0x5cba98);}(_0xb9de,0x184));var _0xeb9d=function(_0x1f0d17,_0x3dc38f){_0x1f0d17=_0x1f0d17-0x0;var _0x361729=_0xb9de[_0x1f0d17];return _0x361729;};'use strict';var multer=require(_0xeb9d('0x0'));var util=require(_0xeb9d('0x1'));var path=require(_0xeb9d('0x2'));var timeout=require(_0xeb9d('0x3'));var express=require(_0xeb9d('0x4'));var router=express['Router']();var auth=require(_0xeb9d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb9d('0x6'));router[_0xeb9d('0x7')]('/',auth[_0xeb9d('0x8')](),controller[_0xeb9d('0x9')]);router['get']('/describe',auth[_0xeb9d('0x8')](),controller[_0xeb9d('0xa')]);router[_0xeb9d('0x7')]('/:id',auth[_0xeb9d('0x8')](),controller['show']);router[_0xeb9d('0xb')]('/',auth[_0xeb9d('0x8')](),controller[_0xeb9d('0xc')]);router[_0xeb9d('0xd')]('/:id',auth[_0xeb9d('0x8')](),controller[_0xeb9d('0xe')]);router[_0xeb9d('0xf')](_0xeb9d('0x10'),auth[_0xeb9d('0x8')](),controller[_0xeb9d('0x11')]);module[_0xeb9d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 661f5b1..94b42f8 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 _0xf097=['inbound','internal','outbound','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xf097,0x159));var _0x7f09=function(_0x282c41,_0x106967){_0x282c41=_0x282c41-0x0;var _0x5f546c=_0xf097[_0x282c41];return _0x5f546c;};'use strict';var Sequelize=require(_0x7f09('0x0'));module[_0x7f09('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7f09('0x2')](_0x7f09('0x3'),_0x7f09('0x4'),_0x7f09('0x5'),_0x7f09('0x6'),_0x7f09('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7f09('0x8')]},'accountcode':{'type':Sequelize[_0x7f09('0x8')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x7f09('0x8')]},'destinationcontext':{'type':Sequelize[_0x7f09('0x8')]},'callerid':{'type':Sequelize[_0x7f09('0x8')]},'channel':{'type':Sequelize[_0x7f09('0x8')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7f09('0x8')]},'lastdata':{'type':Sequelize[_0x7f09('0x9')]},'starttime':{'type':Sequelize[_0x7f09('0xa')]},'systemanswertime':{'type':Sequelize[_0x7f09('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7f09('0xb')]},'mohtime':{'type':Sequelize[_0x7f09('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7f09('0x8')]},'userfield':{'type':Sequelize[_0x7f09('0x8')]},'userDisposition':{'type':Sequelize[_0x7f09('0x8')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7f09('0x8')]},'routeid':{'type':Sequelize[_0x7f09('0xb')]},'sipcallid':{'type':Sequelize[_0x7f09('0x8')]}}; \ No newline at end of file +var _0x45dc=['STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x3af53d,_0x5650ac){var _0x35a7ef=function(_0x2d8432){while(--_0x2d8432){_0x3af53d['push'](_0x3af53d['shift']());}};_0x35a7ef(++_0x5650ac);}(_0x45dc,0x12a));var _0xc45d=function(_0x294bd1,_0x24e0cb){_0x294bd1=_0x294bd1-0x0;var _0x55603d=_0x45dc[_0x294bd1];return _0x55603d;};'use strict';var Sequelize=require(_0xc45d('0x0'));module[_0xc45d('0x1')]={'uniqueid':{'type':Sequelize[_0xc45d('0x2')]},'type':{'type':Sequelize[_0xc45d('0x3')](_0xc45d('0x4'),_0xc45d('0x5'),_0xc45d('0x6'),_0xc45d('0x7'),'outbound-fax',_0xc45d('0x8'))},'tag':{'type':Sequelize[_0xc45d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc45d('0x2')]},'destinationcontext':{'type':Sequelize[_0xc45d('0x2')]},'callerid':{'type':Sequelize[_0xc45d('0x2')]},'channel':{'type':Sequelize[_0xc45d('0x2')]},'destinationchannel':{'type':Sequelize[_0xc45d('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc45d('0x9')]},'starttime':{'type':Sequelize[_0xc45d('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc45d('0xa')]},'duration':{'type':Sequelize[_0xc45d('0xb')]},'billableseconds':{'type':Sequelize[_0xc45d('0xb')]},'mohtime':{'type':Sequelize[_0xc45d('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc45d('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc45d('0x2')]},'note':{'type':Sequelize[_0xc45d('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xc45d('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6e08646..ce440cc 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 _0x3561=['ejs','lodash','desk.js','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','VoiceCallReport','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','field','filter','options','count','includeAll','fullname','alias','User','rows','catch','show','params','rawAttributes','include','find','create','describe','uniqueid','user','body','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv'];(function(_0x53bfbe,_0x97158){var _0x4cf80e=function(_0x449a72){while(--_0x449a72){_0x53bfbe['push'](_0x53bfbe['shift']());}};_0x4cf80e(++_0x97158);}(_0x3561,0x15f));var _0x1356=function(_0x2146b7,_0x457d38){_0x2146b7=_0x2146b7-0x0;var _0x23c4e6=_0x3561[_0x2146b7];return _0x23c4e6;};'use strict';var pdf=require(_0x1356('0x0'));var emlformat=require(_0x1356('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1356('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1356('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1356('0x4'));var util=require(_0x1356('0x5'));var path=require(_0x1356('0x6'));var sox=require(_0x1356('0x7'));var csv=require(_0x1356('0x8'));var ejs=require(_0x1356('0x9'));var fs=require('fs');var _=require(_0x1356('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1356('0xb'));var toCsv=require(_0x1356('0x8'));var querystring=require('querystring');var Papa=require(_0x1356('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x1356('0xd'));var Redis=require(_0x1356('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x1356('0xf'))(_0x1356('0x10'));var utils=require('../../config/utils');var config=require(_0x1356('0x11'));var db=require(_0x1356('0x12'))['db'];function respondWithStatusCode(_0x5d3473,_0x1d50c3){_0x1d50c3=_0x1d50c3||0xcc;return function(_0x5f3b10){if(_0x5f3b10){return _0x5d3473[_0x1356('0x13')](_0x1d50c3);}return _0x5d3473[_0x1356('0x14')](_0x1d50c3)['end']();};}function respondWithResult(_0x477a54,_0x5a4405){_0x5a4405=_0x5a4405||0xc8;return function(_0x48976a){if(_0x48976a){return _0x477a54[_0x1356('0x14')](_0x5a4405)['json'](_0x48976a);}};}function respondWithFilteredResult(_0x357c9b,_0x34093a){return function(_0xc81a7d){if(_0xc81a7d){var _0x3d1c9b=_0xc81a7d['count'],_0x105d27=_0x34093a['offset'],_0x26308a=_0x34093a[_0x1356('0x15')]+_0x34093a['limit'],_0x427dd1;if(_0x26308a>=_0x3d1c9b){_0x26308a=_0x3d1c9b;_0x427dd1=0xc8;}else{_0x427dd1=0xce;}_0x357c9b[_0x1356('0x14')](_0x427dd1);return _0x357c9b['set'](_0x1356('0x16'),_0x105d27+'-'+_0x26308a+'/'+_0x3d1c9b)['json'](_0xc81a7d);}return null;};}function patchUpdates(_0x5acb9b){return function(_0x32de13){try{jsonpatch[_0x1356('0x17')](_0x32de13,_0x5acb9b,!![]);}catch(_0x445a0a){return BPromise[_0x1356('0x18')](_0x445a0a);}return _0x32de13[_0x1356('0x19')]();};}function saveUpdates(_0x78170,_0x45318c){return function(_0x22c098){if(_0x22c098){return _0x22c098[_0x1356('0x1a')](_0x78170)[_0x1356('0x1b')](function(_0x39fb14){return _0x39fb14;});}return null;};}function removeEntity(_0x1ecd9b,_0x5e0eb4){return function(_0x10fec5){if(_0x10fec5){return _0x10fec5[_0x1356('0x1c')]()[_0x1356('0x1b')](function(){_0x1ecd9b[_0x1356('0x14')](0xcc)[_0x1356('0x1d')]();});}};}function handleEntityNotFound(_0x24590f,_0x5d72d9){return function(_0x5845c9){if(!_0x5845c9){_0x24590f['sendStatus'](0x194);}return _0x5845c9;};}function handleError(_0x641400,_0x4d2b68){_0x4d2b68=_0x4d2b68||0x1f4;return function(_0x437044){logger['error'](_0x437044[_0x1356('0x1e')]);if(_0x437044['name']){delete _0x437044[_0x1356('0x1f')];}_0x641400[_0x1356('0x14')](_0x4d2b68)[_0x1356('0x20')](_0x437044);};}exports[_0x1356('0x21')]=function(_0x397159,_0x2df0ae){var _0x407da2={},_0x28b4e6={},_0x43e1a2={'count':0x0,'rows':[]};var _0x1bcc60=db[_0x1356('0x22')]['rawAttributes'];_0x28b4e6[_0x1356('0x23')]=_[_0x1356('0x24')](_0x1bcc60);_0x28b4e6['query']=_['keys'](_0x397159['query']);_0x28b4e6[_0x1356('0x25')]=_[_0x1356('0x26')](_0x28b4e6[_0x1356('0x23')],_0x28b4e6[_0x1356('0x27')]);_0x407da2[_0x1356('0x28')]=_[_0x1356('0x26')](_0x28b4e6[_0x1356('0x23')],qs['fields'](_0x397159[_0x1356('0x27')][_0x1356('0x29')]));_0x407da2[_0x1356('0x28')]=_0x407da2[_0x1356('0x28')][_0x1356('0x2a')]?_0x407da2['attributes']:_0x28b4e6[_0x1356('0x23')];if(!_0x397159['query'][_0x1356('0x2b')]('nolimit')){_0x407da2['limit']=qs[_0x1356('0x2c')](_0x397159[_0x1356('0x27')]['limit']);_0x407da2[_0x1356('0x15')]=qs[_0x1356('0x15')](_0x397159[_0x1356('0x27')][_0x1356('0x15')]);}_0x407da2[_0x1356('0x2d')]=qs[_0x1356('0x2e')](_0x397159[_0x1356('0x27')][_0x1356('0x2e')]);_0x407da2[_0x1356('0x2f')]=qs[_0x1356('0x25')](_[_0x1356('0x30')](_0x397159[_0x1356('0x27')],_0x28b4e6[_0x1356('0x25')]));if(_0x397159['query']['filter']){_0x407da2['where']=_[_0x1356('0x31')](_0x407da2['where'],{'$or':_[_0x1356('0x32')](_0x1bcc60,function(_0x2ba42d){if(_0x2ba42d[_0x1356('0x33')]['key']!=='VIRTUAL'){var _0x5f5a1e={};_0x5f5a1e[_0x2ba42d[_0x1356('0x34')]]={'$like':'%'+_0x397159[_0x1356('0x27')][_0x1356('0x35')]+'%'};return _0x5f5a1e;}})});}_0x407da2=_[_0x1356('0x31')]({},_0x407da2,_0x397159[_0x1356('0x36')]);var _0x5ad848={'where':_0x407da2[_0x1356('0x2f')]};return db['VoiceCallReport']['count'](_0x5ad848)[_0x1356('0x1b')](function(_0x1a3919){_0x43e1a2[_0x1356('0x37')]=_0x1a3919;if(_0x397159[_0x1356('0x27')][_0x1356('0x38')]){_0x407da2['include']=[{'attributes':['id','name',_0x1356('0x39'),_0x1356('0x3a')],'model':db[_0x1356('0x3b')],'as':_0x1356('0x3b')}];}return db[_0x1356('0x22')]['findAll'](_0x407da2);})['then'](function(_0x581547){_0x43e1a2[_0x1356('0x3c')]=_0x581547;return _0x43e1a2;})['then'](respondWithFilteredResult(_0x2df0ae,_0x407da2))[_0x1356('0x3d')](handleError(_0x2df0ae,null));};exports[_0x1356('0x3e')]=function(_0x297a0e,_0x279513){var _0x4c33fb={'raw':!![],'where':{'id':_0x297a0e[_0x1356('0x3f')]['id']}},_0x20d85b={};_0x20d85b[_0x1356('0x23')]=_[_0x1356('0x24')](db[_0x1356('0x22')][_0x1356('0x40')]);_0x20d85b['query']=_['keys'](_0x297a0e[_0x1356('0x27')]);_0x20d85b[_0x1356('0x25')]=_[_0x1356('0x26')](_0x20d85b[_0x1356('0x23')],_0x20d85b['query']);_0x4c33fb['attributes']=_[_0x1356('0x26')](_0x20d85b[_0x1356('0x23')],qs[_0x1356('0x29')](_0x297a0e[_0x1356('0x27')][_0x1356('0x29')]));_0x4c33fb['attributes']=_0x4c33fb[_0x1356('0x28')]['length']?_0x4c33fb[_0x1356('0x28')]:_0x20d85b['model'];if(_0x297a0e['query'][_0x1356('0x38')]){_0x4c33fb[_0x1356('0x41')]=[{'all':!![]}];}_0x4c33fb=_[_0x1356('0x31')]({},_0x4c33fb,_0x297a0e[_0x1356('0x36')]);return db['VoiceCallReport'][_0x1356('0x42')](_0x4c33fb)[_0x1356('0x1b')](handleEntityNotFound(_0x279513,null))[_0x1356('0x1b')](respondWithResult(_0x279513,null))[_0x1356('0x3d')](handleError(_0x279513,null));};exports[_0x1356('0x43')]=function(_0x1d5be8,_0x587f86){return db[_0x1356('0x22')][_0x1356('0x43')](_0x1d5be8['body'],{})[_0x1356('0x1b')](respondWithResult(_0x587f86,0xc9))[_0x1356('0x3d')](handleError(_0x587f86,null));};exports[_0x1356('0x1c')]=function(_0x3f21bb,_0x2f3002){return db[_0x1356('0x22')][_0x1356('0x42')]({'where':{'id':_0x3f21bb[_0x1356('0x3f')]['id']}})[_0x1356('0x1b')](handleEntityNotFound(_0x2f3002,null))['then'](removeEntity(_0x2f3002,null))[_0x1356('0x3d')](handleError(_0x2f3002,null));};exports[_0x1356('0x44')]=function(_0x5d71be,_0x3ee13f){return db[_0x1356('0x22')][_0x1356('0x44')]()['then'](respondWithResult(_0x3ee13f,null))['catch'](handleError(_0x3ee13f,null));};exports[_0x1356('0x1a')]=function(_0x19da46,_0x2b8b1c){if(_0x19da46['body'][_0x1356('0x45')]){delete _0x19da46['body'][_0x1356('0x45')];}return db[_0x1356('0x22')][_0x1356('0x42')]({'where':{'uniqueid':_0x19da46[_0x1356('0x3f')]['id'],'UserId':{'$or':[null,_0x19da46[_0x1356('0x46')]['id']]}}})[_0x1356('0x1b')](handleEntityNotFound(_0x2b8b1c,null))[_0x1356('0x1b')](saveUpdates(_0x19da46[_0x1356('0x47')],null))[_0x1356('0x1b')](respondWithResult(_0x2b8b1c,null))[_0x1356('0x3d')](handleError(_0x2b8b1c,null));}; \ No newline at end of file +var _0x14e8=['hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','field','options','VoiceCallReport','then','includeAll','alias','User','findAll','rows','catch','show','length','include','find','create','body','destroy','params','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','end','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields'];(function(_0x5151db,_0x39d99f){var _0xcac7cf=function(_0x28676d){while(--_0x28676d){_0x5151db['push'](_0x5151db['shift']());}};_0xcac7cf(++_0x39d99f);}(_0x14e8,0x153));var _0x814e=function(_0xb4ade3,_0x35278c){_0xb4ade3=_0xb4ade3-0x0;var _0x2d82d1=_0x14e8[_0xb4ade3];return _0x2d82d1;};'use strict';var pdf=require(_0x814e('0x0'));var emlformat=require(_0x814e('0x1'));var rimraf=require(_0x814e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x814e('0x3'));var rp=require(_0x814e('0x4'));var moment=require(_0x814e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x814e('0x6'));var util=require(_0x814e('0x7'));var path=require(_0x814e('0x8'));var sox=require(_0x814e('0x9'));var csv=require(_0x814e('0xa'));var ejs=require(_0x814e('0xb'));var fs=require('fs');var _=require(_0x814e('0xc'));var squel=require('squel');var crypto=require(_0x814e('0xd'));var jsforce=require(_0x814e('0xe'));var deskjs=require(_0x814e('0xf'));var toCsv=require(_0x814e('0xa'));var querystring=require(_0x814e('0x10'));var Papa=require(_0x814e('0x11'));var authService=require(_0x814e('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x814e('0x13'));var qs=require(_0x814e('0x14'));var logger=require('../../config/logger')(_0x814e('0x15'));var utils=require(_0x814e('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26a269,_0x223a64){_0x223a64=_0x223a64||0xcc;return function(_0x322bfe){if(_0x322bfe){return _0x26a269[_0x814e('0x17')](_0x223a64);}return _0x26a269['status'](_0x223a64)['end']();};}function respondWithResult(_0x5db869,_0x4afdd8){_0x4afdd8=_0x4afdd8||0xc8;return function(_0x5c8471){if(_0x5c8471){return _0x5db869[_0x814e('0x18')](_0x4afdd8)['json'](_0x5c8471);}};}function respondWithFilteredResult(_0x26f52d,_0x1c2fa5){return function(_0x555bd7){if(_0x555bd7){var _0x26c3e3=_0x555bd7[_0x814e('0x19')],_0x16c293=_0x1c2fa5['offset'],_0x3c7857=_0x1c2fa5[_0x814e('0x1a')]+_0x1c2fa5['limit'],_0x12f3fa;if(_0x3c7857>=_0x26c3e3){_0x3c7857=_0x26c3e3;_0x12f3fa=0xc8;}else{_0x12f3fa=0xce;}_0x26f52d[_0x814e('0x18')](_0x12f3fa);return _0x26f52d[_0x814e('0x1b')](_0x814e('0x1c'),_0x16c293+'-'+_0x3c7857+'/'+_0x26c3e3)[_0x814e('0x1d')](_0x555bd7);}return null;};}function patchUpdates(_0x6f7f37){return function(_0x47156b){try{jsonpatch[_0x814e('0x1e')](_0x47156b,_0x6f7f37,!![]);}catch(_0xf7c4f7){return BPromise[_0x814e('0x1f')](_0xf7c4f7);}return _0x47156b[_0x814e('0x20')]();};}function saveUpdates(_0x112e6c,_0x157ebb){return function(_0xea3042){if(_0xea3042){return _0xea3042[_0x814e('0x21')](_0x112e6c)['then'](function(_0x3e12ea){return _0x3e12ea;});}return null;};}function removeEntity(_0x3e25c6,_0x3034a5){return function(_0x2dd405){if(_0x2dd405){return _0x2dd405['destroy']()['then'](function(){_0x3e25c6[_0x814e('0x18')](0xcc)[_0x814e('0x22')]();});}};}function handleEntityNotFound(_0x2944dd,_0x5a0525){return function(_0x108fcc){if(!_0x108fcc){_0x2944dd[_0x814e('0x17')](0x194);}return _0x108fcc;};}function handleError(_0x6ac4c8,_0x42fe59){_0x42fe59=_0x42fe59||0x1f4;return function(_0x53fb34){logger['error'](_0x53fb34[_0x814e('0x23')]);if(_0x53fb34[_0x814e('0x24')]){delete _0x53fb34[_0x814e('0x24')];}_0x6ac4c8['status'](_0x42fe59)[_0x814e('0x25')](_0x53fb34);};}exports[_0x814e('0x26')]=function(_0x22ee20,_0x41f537){var _0x1dbcef={},_0x5a455c={},_0x192edd={'count':0x0,'rows':[]};var _0x4691be=db['VoiceCallReport'][_0x814e('0x27')];_0x5a455c['model']=_[_0x814e('0x28')](_0x4691be);_0x5a455c[_0x814e('0x29')]=_[_0x814e('0x28')](_0x22ee20['query']);_0x5a455c['filters']=_[_0x814e('0x2a')](_0x5a455c[_0x814e('0x2b')],_0x5a455c[_0x814e('0x29')]);_0x1dbcef[_0x814e('0x2c')]=_['intersection'](_0x5a455c[_0x814e('0x2b')],qs[_0x814e('0x2d')](_0x22ee20[_0x814e('0x29')][_0x814e('0x2d')]));_0x1dbcef[_0x814e('0x2c')]=_0x1dbcef['attributes']['length']?_0x1dbcef[_0x814e('0x2c')]:_0x5a455c[_0x814e('0x2b')];if(!_0x22ee20[_0x814e('0x29')][_0x814e('0x2e')](_0x814e('0x2f'))){_0x1dbcef[_0x814e('0x30')]=qs[_0x814e('0x30')](_0x22ee20[_0x814e('0x29')][_0x814e('0x30')]);_0x1dbcef['offset']=qs[_0x814e('0x1a')](_0x22ee20[_0x814e('0x29')][_0x814e('0x1a')]);}_0x1dbcef[_0x814e('0x31')]=qs[_0x814e('0x32')](_0x22ee20[_0x814e('0x29')][_0x814e('0x32')]);_0x1dbcef[_0x814e('0x33')]=qs[_0x814e('0x34')](_['pick'](_0x22ee20['query'],_0x5a455c[_0x814e('0x34')]));if(_0x22ee20[_0x814e('0x29')][_0x814e('0x35')]){_0x1dbcef[_0x814e('0x33')]=_[_0x814e('0x36')](_0x1dbcef[_0x814e('0x33')],{'$or':_['map'](_0x4691be,function(_0x5cc27d){if(_0x5cc27d[_0x814e('0x37')]['key']!=='VIRTUAL'){var _0x1eb364={};_0x1eb364[_0x5cc27d[_0x814e('0x38')]]={'$like':'%'+_0x22ee20[_0x814e('0x29')][_0x814e('0x35')]+'%'};return _0x1eb364;}})});}_0x1dbcef=_[_0x814e('0x36')]({},_0x1dbcef,_0x22ee20[_0x814e('0x39')]);var _0x1808be={'where':_0x1dbcef[_0x814e('0x33')]};return db[_0x814e('0x3a')]['count'](_0x1808be)[_0x814e('0x3b')](function(_0x4e8fc3){_0x192edd[_0x814e('0x19')]=_0x4e8fc3;if(_0x22ee20[_0x814e('0x29')][_0x814e('0x3c')]){_0x1dbcef['include']=[{'attributes':['id',_0x814e('0x24'),'fullname',_0x814e('0x3d')],'model':db[_0x814e('0x3e')],'as':_0x814e('0x3e')}];}return db[_0x814e('0x3a')][_0x814e('0x3f')](_0x1dbcef);})[_0x814e('0x3b')](function(_0xc6474d){_0x192edd[_0x814e('0x40')]=_0xc6474d;return _0x192edd;})[_0x814e('0x3b')](respondWithFilteredResult(_0x41f537,_0x1dbcef))[_0x814e('0x41')](handleError(_0x41f537,null));};exports[_0x814e('0x42')]=function(_0x4751d9,_0xa20bca){var _0x24147a={'raw':!![],'where':{'id':_0x4751d9['params']['id']}},_0x12d824={};_0x12d824[_0x814e('0x2b')]=_['keys'](db['VoiceCallReport'][_0x814e('0x27')]);_0x12d824[_0x814e('0x29')]=_[_0x814e('0x28')](_0x4751d9[_0x814e('0x29')]);_0x12d824[_0x814e('0x34')]=_[_0x814e('0x2a')](_0x12d824['model'],_0x12d824['query']);_0x24147a['attributes']=_[_0x814e('0x2a')](_0x12d824[_0x814e('0x2b')],qs[_0x814e('0x2d')](_0x4751d9['query']['fields']));_0x24147a['attributes']=_0x24147a['attributes'][_0x814e('0x43')]?_0x24147a[_0x814e('0x2c')]:_0x12d824[_0x814e('0x2b')];if(_0x4751d9[_0x814e('0x29')]['includeAll']){_0x24147a[_0x814e('0x44')]=[{'all':!![]}];}_0x24147a=_[_0x814e('0x36')]({},_0x24147a,_0x4751d9[_0x814e('0x39')]);return db[_0x814e('0x3a')][_0x814e('0x45')](_0x24147a)[_0x814e('0x3b')](handleEntityNotFound(_0xa20bca,null))[_0x814e('0x3b')](respondWithResult(_0xa20bca,null))[_0x814e('0x41')](handleError(_0xa20bca,null));};exports[_0x814e('0x46')]=function(_0x536f72,_0x3f0cfa){return db['VoiceCallReport']['create'](_0x536f72[_0x814e('0x47')],{})[_0x814e('0x3b')](respondWithResult(_0x3f0cfa,0xc9))['catch'](handleError(_0x3f0cfa,null));};exports[_0x814e('0x48')]=function(_0x1a40eb,_0x2c83a9){return db[_0x814e('0x3a')][_0x814e('0x45')]({'where':{'id':_0x1a40eb[_0x814e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c83a9,null))[_0x814e('0x3b')](removeEntity(_0x2c83a9,null))[_0x814e('0x41')](handleError(_0x2c83a9,null));};exports['describe']=function(_0x4dc98f,_0x277745){return db[_0x814e('0x3a')][_0x814e('0x4a')]()[_0x814e('0x3b')](respondWithResult(_0x277745,null))[_0x814e('0x41')](handleError(_0x277745,null));};exports[_0x814e('0x21')]=function(_0x10a5be,_0x4654f0){if(_0x10a5be[_0x814e('0x47')][_0x814e('0x4b')]){delete _0x10a5be[_0x814e('0x47')][_0x814e('0x4b')];}return db['VoiceCallReport'][_0x814e('0x45')]({'where':{'uniqueid':_0x10a5be[_0x814e('0x49')]['id'],'UserId':{'$or':[null,_0x10a5be[_0x814e('0x4c')]['id']]}}})['then'](handleEntityNotFound(_0x4654f0,null))[_0x814e('0x3b')](saveUpdates(_0x10a5be[_0x814e('0x47')],null))['then'](respondWithResult(_0x4654f0,null))[_0x814e('0x41')](handleError(_0x4654f0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 1a97f16..bc0f031 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 _0x9c11=['api','moment','bluebird','./voiceCallReport.attributes','define','uniqueid','util','../../config/logger'];(function(_0x31edbe,_0x34d231){var _0x37fcee=function(_0x17ecba){while(--_0x17ecba){_0x31edbe['push'](_0x31edbe['shift']());}};_0x37fcee(++_0x34d231);}(_0x9c11,0x96));var _0x19c1=function(_0x4018a2,_0xea5239){_0x4018a2=_0x4018a2-0x0;var _0x21fe8d=_0x9c11[_0x4018a2];return _0x21fe8d;};'use strict';var _=require('lodash');var util=require(_0x19c1('0x0'));var logger=require(_0x19c1('0x1'))(_0x19c1('0x2'));var moment=require(_0x19c1('0x3'));var BPromise=require(_0x19c1('0x4'));var rp=require('request-promise');var attributes=require(_0x19c1('0x5'));module['exports']=function(_0xb20008,_0x420f0b){return _0xb20008[_0x19c1('0x6')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x19c1('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9743=['api','moment','bluebird','exports','define','report_call','uniqueid','lodash','../../config/logger'];(function(_0x5e9e03,_0x4e8f86){var _0x8ab185=function(_0x344026){while(--_0x344026){_0x5e9e03['push'](_0x5e9e03['shift']());}};_0x8ab185(++_0x4e8f86);}(_0x9743,0x18a));var _0x3974=function(_0x406c07,_0x1ff7e8){_0x406c07=_0x406c07-0x0;var _0x5ee9ad=_0x9743[_0x406c07];return _0x5ee9ad;};'use strict';var _=require(_0x3974('0x0'));var util=require('util');var logger=require(_0x3974('0x1'))(_0x3974('0x2'));var moment=require(_0x3974('0x3'));var BPromise=require(_0x3974('0x4'));var rp=require('request-promise');var attributes=require('./voiceCallReport.attributes');module[_0x3974('0x5')]=function(_0x13fe23,_0x44be91){return _0x13fe23[_0x3974('0x6')]('VoiceCallReport',attributes,{'tableName':_0x3974('0x7'),'paranoid':![],'indexes':[{'fields':[_0x3974('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 67bf0e7..59f86f1 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 _0x3ee3=['UpdateVoiceCallReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','options','raw','where','attributes','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','body','update','limit'];(function(_0x434814,_0x4c1e4c){var _0x3bb860=function(_0x478bc9){while(--_0x478bc9){_0x434814['push'](_0x434814['shift']());}};_0x3bb860(++_0x4c1e4c);}(_0x3ee3,0x160));var _0x33ee=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x3ee3[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x33ee('0x0'));var BPromise=require(_0x33ee('0x1'));var rs=require(_0x33ee('0x2'));var fs=require('fs');var Redis=require(_0x33ee('0x3'));var db=require(_0x33ee('0x4'))['db'];var utils=require(_0x33ee('0x5'));var logger=require('../../config/logger')(_0x33ee('0x6'));var config=require(_0x33ee('0x7'));var jayson=require(_0x33ee('0x8'));var client=jayson[_0x33ee('0x9')][_0x33ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15a715,_0x2e4dbb,_0x2b8b0c){return new BPromise(function(_0x1852d0,_0x36037c){return client[_0x33ee('0xb')](_0x15a715,_0x2b8b0c)[_0x33ee('0xc')](function(_0x5b517f){logger[_0x33ee('0xd')](_0x33ee('0xe'),_0x2e4dbb,_0x33ee('0xf'));logger[_0x33ee('0x10')](_0x33ee('0x11'),_0x2e4dbb,_0x33ee('0xf'),JSON[_0x33ee('0x12')](_0x5b517f));if(_0x5b517f[_0x33ee('0x13')]){if(_0x5b517f[_0x33ee('0x13')][_0x33ee('0x14')]===0x1f4){logger[_0x33ee('0x13')](_0x33ee('0xe'),_0x2e4dbb,_0x5b517f[_0x33ee('0x13')][_0x33ee('0x15')]);return _0x36037c(_0x5b517f[_0x33ee('0x13')][_0x33ee('0x15')]);}logger[_0x33ee('0x13')](_0x33ee('0xe'),_0x2e4dbb,_0x5b517f['error']['message']);return _0x1852d0(_0x5b517f[_0x33ee('0x13')]['message']);}else{logger[_0x33ee('0xd')](_0x33ee('0xe'),_0x2e4dbb,'request\x20sent');_0x1852d0(_0x5b517f[_0x33ee('0x16')][_0x33ee('0x15')]);}})[_0x33ee('0x17')](function(_0x3f6e70){logger[_0x33ee('0x13')](_0x33ee('0xe'),_0x2e4dbb,_0x3f6e70);_0x36037c(_0x3f6e70);});});}exports[_0x33ee('0x18')]=function(_0x5d1e2e){var _0x3fd006=this;return new Promise(function(_0x294c1a,_0x24122d){return db['VoiceCallReport']['findAll']({'raw':_0x5d1e2e[_0x33ee('0x19')]?_0x5d1e2e['options'][_0x33ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d1e2e[_0x33ee('0x19')]?_0x5d1e2e[_0x33ee('0x19')][_0x33ee('0x1b')]||null:null,'attributes':_0x5d1e2e[_0x33ee('0x19')]?_0x5d1e2e['options'][_0x33ee('0x1c')]||null:null,'limit':_0x5d1e2e['options']?_0x5d1e2e['options']['limit']||null:null,'include':_0x5d1e2e[_0x33ee('0x19')]?_0x5d1e2e[_0x33ee('0x19')]['include']?_['map'](_0x5d1e2e[_0x33ee('0x19')]['include'],function(_0x411223){return{'model':db[_0x411223['model']],'as':_0x411223['as'],'attributes':_0x411223[_0x33ee('0x1c')],'include':_0x411223[_0x33ee('0x1d')]?_[_0x33ee('0x1e')](_0x411223['include'],function(_0x43dab1){return{'model':db[_0x43dab1[_0x33ee('0x1f')]],'as':_0x43dab1['as'],'attributes':_0x43dab1['attributes'],'include':_0x43dab1[_0x33ee('0x1d')]?_[_0x33ee('0x1e')](_0x43dab1[_0x33ee('0x1d')],function(_0x44b6bf){return{'model':db[_0x44b6bf[_0x33ee('0x1f')]],'as':_0x44b6bf['as'],'attributes':_0x44b6bf[_0x33ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x33ee('0xc')](function(_0x3387c0){logger[_0x33ee('0xd')](_0x33ee('0x18'),_0x5d1e2e);logger[_0x33ee('0x10')](_0x33ee('0x18'),_0x5d1e2e,JSON[_0x33ee('0x12')](_0x3387c0));_0x294c1a(_0x3387c0);})[_0x33ee('0x17')](function(_0x5c52d2){logger[_0x33ee('0x13')]('GetVoiceCallReport',_0x5c52d2[_0x33ee('0x15')],_0x5d1e2e);_0x24122d(_0x3fd006[_0x33ee('0x13')](0x1f4,_0x5c52d2['message']));});});};exports[_0x33ee('0x20')]=function(_0x5a44){var _0x28e579=this;return new Promise(function(_0x4400a8,_0x6146da){return db[_0x33ee('0x21')][_0x33ee('0x22')](_0x5a44[_0x33ee('0x23')],{'raw':_0x5a44[_0x33ee('0x19')]?_0x5a44[_0x33ee('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x374366){logger[_0x33ee('0xd')]('CreateVoiceCallReport',_0x5a44);logger['debug'](_0x33ee('0x20'),_0x5a44,JSON[_0x33ee('0x12')](_0x374366));_0x4400a8(_0x374366);})[_0x33ee('0x17')](function(_0x52bb3a){logger[_0x33ee('0x13')](_0x33ee('0x20'),_0x52bb3a['message'],_0x5a44);_0x6146da(_0x28e579[_0x33ee('0x13')](0x1f4,_0x52bb3a[_0x33ee('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x10bb68){var _0x1b5592=this;return new Promise(function(_0x24b855,_0x30e1cf){return db[_0x33ee('0x21')][_0x33ee('0x24')](_0x10bb68[_0x33ee('0x23')],{'raw':_0x10bb68[_0x33ee('0x19')]?_0x10bb68['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10bb68[_0x33ee('0x19')]?_0x10bb68[_0x33ee('0x19')][_0x33ee('0x1b')]||null:null,'attributes':_0x10bb68[_0x33ee('0x19')]?_0x10bb68['options'][_0x33ee('0x1c')]||null:null,'limit':_0x10bb68[_0x33ee('0x19')]?_0x10bb68[_0x33ee('0x19')][_0x33ee('0x25')]||null:null})[_0x33ee('0xc')](function(_0x3a2b99){logger['info'](_0x33ee('0x26'),_0x10bb68);logger[_0x33ee('0x10')]('UpdateVoiceCallReport',_0x10bb68,JSON[_0x33ee('0x12')](_0x3a2b99));_0x24b855(_0x3a2b99);})['catch'](function(_0x18c403){logger[_0x33ee('0x13')](_0x33ee('0x26'),_0x18c403[_0x33ee('0x15')],_0x10bb68);_0x30e1cf(_0x1b5592[_0x33ee('0x13')](0x1f4,_0x18c403[_0x33ee('0x15')]));});});}; \ No newline at end of file +var _0x1b53=['VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','body','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x4fc3ba,_0x4f61c8){var _0x54cc48=function(_0x2a7c9d){while(--_0x2a7c9d){_0x4fc3ba['push'](_0x4fc3ba['shift']());}};_0x54cc48(++_0x4f61c8);}(_0x1b53,0xe9));var _0x31b5=function(_0x37f662,_0x546e21){_0x37f662=_0x37f662-0x0;var _0x42bc60=_0x1b53[_0x37f662];return _0x42bc60;};'use strict';var _=require(_0x31b5('0x0'));var util=require('util');var moment=require(_0x31b5('0x1'));var BPromise=require(_0x31b5('0x2'));var rs=require(_0x31b5('0x3'));var fs=require('fs');var Redis=require(_0x31b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x31b5('0x5'))(_0x31b5('0x6'));var config=require(_0x31b5('0x7'));var jayson=require(_0x31b5('0x8'));var client=jayson[_0x31b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec1fc,_0x4e7d0b,_0x20d654){return new BPromise(function(_0x2d94a2,_0xb7f5d8){return client['request'](_0x1ec1fc,_0x20d654)[_0x31b5('0xa')](function(_0x285b89){logger[_0x31b5('0xb')](_0x31b5('0xc'),_0x4e7d0b,_0x31b5('0xd'));logger[_0x31b5('0xe')](_0x31b5('0xf'),_0x4e7d0b,_0x31b5('0xd'),JSON[_0x31b5('0x10')](_0x285b89));if(_0x285b89['error']){if(_0x285b89['error'][_0x31b5('0x11')]===0x1f4){logger['error'](_0x31b5('0xc'),_0x4e7d0b,_0x285b89['error'][_0x31b5('0x12')]);return _0xb7f5d8(_0x285b89[_0x31b5('0x13')][_0x31b5('0x12')]);}logger['error'](_0x31b5('0xc'),_0x4e7d0b,_0x285b89[_0x31b5('0x13')]['message']);return _0x2d94a2(_0x285b89[_0x31b5('0x13')]['message']);}else{logger[_0x31b5('0xb')](_0x31b5('0xc'),_0x4e7d0b,_0x31b5('0xd'));_0x2d94a2(_0x285b89[_0x31b5('0x14')][_0x31b5('0x12')]);}})[_0x31b5('0x15')](function(_0xdd8d84){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4e7d0b,_0xdd8d84);_0xb7f5d8(_0xdd8d84);});});}exports['GetVoiceCallReport']=function(_0xcd2890){var _0x481879=this;return new Promise(function(_0x49c66d,_0x4b7eb5){return db[_0x31b5('0x16')][_0x31b5('0x17')]({'raw':_0xcd2890[_0x31b5('0x18')]?_0xcd2890[_0x31b5('0x18')][_0x31b5('0x19')]===undefined?!![]:![]:!![],'where':_0xcd2890[_0x31b5('0x18')]?_0xcd2890[_0x31b5('0x18')][_0x31b5('0x1a')]||null:null,'attributes':_0xcd2890[_0x31b5('0x18')]?_0xcd2890[_0x31b5('0x18')][_0x31b5('0x1b')]||null:null,'limit':_0xcd2890['options']?_0xcd2890[_0x31b5('0x18')]['limit']||null:null,'include':_0xcd2890[_0x31b5('0x18')]?_0xcd2890['options'][_0x31b5('0x1c')]?_[_0x31b5('0x1d')](_0xcd2890[_0x31b5('0x18')]['include'],function(_0x321b04){return{'model':db[_0x321b04[_0x31b5('0x1e')]],'as':_0x321b04['as'],'attributes':_0x321b04[_0x31b5('0x1b')],'include':_0x321b04['include']?_[_0x31b5('0x1d')](_0x321b04[_0x31b5('0x1c')],function(_0x39ea82){return{'model':db[_0x39ea82[_0x31b5('0x1e')]],'as':_0x39ea82['as'],'attributes':_0x39ea82[_0x31b5('0x1b')],'include':_0x39ea82[_0x31b5('0x1c')]?_[_0x31b5('0x1d')](_0x39ea82[_0x31b5('0x1c')],function(_0xf2b2fb){return{'model':db[_0xf2b2fb[_0x31b5('0x1e')]],'as':_0xf2b2fb['as'],'attributes':_0xf2b2fb[_0x31b5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd113bd){logger[_0x31b5('0xb')](_0x31b5('0x1f'),_0xcd2890);logger[_0x31b5('0xe')](_0x31b5('0x1f'),_0xcd2890,JSON[_0x31b5('0x10')](_0xd113bd));_0x49c66d(_0xd113bd);})[_0x31b5('0x15')](function(_0x37c4c7){logger[_0x31b5('0x13')]('GetVoiceCallReport',_0x37c4c7[_0x31b5('0x12')],_0xcd2890);_0x4b7eb5(_0x481879['error'](0x1f4,_0x37c4c7[_0x31b5('0x12')]));});});};exports[_0x31b5('0x20')]=function(_0x3e0d0f){var _0x5c1a45=this;return new Promise(function(_0x5b3364,_0x329fcb){return db[_0x31b5('0x16')]['create'](_0x3e0d0f[_0x31b5('0x21')],{'raw':_0x3e0d0f[_0x31b5('0x18')]?_0x3e0d0f['options'][_0x31b5('0x19')]===undefined?!![]:![]:!![]})[_0x31b5('0xa')](function(_0x335165){logger[_0x31b5('0xb')](_0x31b5('0x20'),_0x3e0d0f);logger[_0x31b5('0xe')](_0x31b5('0x20'),_0x3e0d0f,JSON[_0x31b5('0x10')](_0x335165));_0x5b3364(_0x335165);})[_0x31b5('0x15')](function(_0x22c4aa){logger[_0x31b5('0x13')]('CreateVoiceCallReport',_0x22c4aa[_0x31b5('0x12')],_0x3e0d0f);_0x329fcb(_0x5c1a45[_0x31b5('0x13')](0x1f4,_0x22c4aa['message']));});});};exports[_0x31b5('0x22')]=function(_0x1c8354){var _0x5c4ca7=this;return new Promise(function(_0x1a2ec8,_0x5d9875){return db[_0x31b5('0x16')]['update'](_0x1c8354[_0x31b5('0x21')],{'raw':_0x1c8354[_0x31b5('0x18')]?_0x1c8354[_0x31b5('0x18')][_0x31b5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c8354[_0x31b5('0x18')]?_0x1c8354[_0x31b5('0x18')]['where']||null:null,'attributes':_0x1c8354['options']?_0x1c8354[_0x31b5('0x18')]['attributes']||null:null,'limit':_0x1c8354[_0x31b5('0x18')]?_0x1c8354[_0x31b5('0x18')]['limit']||null:null})[_0x31b5('0xa')](function(_0x5ae324){logger[_0x31b5('0xb')](_0x31b5('0x22'),_0x1c8354);logger['debug'](_0x31b5('0x22'),_0x1c8354,JSON['stringify'](_0x5ae324));_0x1a2ec8(_0x5ae324);})[_0x31b5('0x15')](function(_0x495666){logger[_0x31b5('0x13')](_0x31b5('0x22'),_0x495666[_0x31b5('0x12')],_0x1c8354);_0x5d9875(_0x5c4ca7[_0x31b5('0x13')](0x1f4,_0x495666['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9196952..3c3cedf 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 _0x502d=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./voiceChanSpy.controller','isAuthenticated','index','/:id','show'];(function(_0x25d060,_0x418736){var _0x106892=function(_0x4aa250){while(--_0x4aa250){_0x25d060['push'](_0x25d060['shift']());}};_0x106892(++_0x418736);}(_0x502d,0x139));var _0xd502=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x502d[_0x5f0501];return _0x3c2c45;};'use strict';var multer=require('multer');var util=require(_0xd502('0x0'));var path=require(_0xd502('0x1'));var timeout=require(_0xd502('0x2'));var express=require('express');var router=express[_0xd502('0x3')]();var auth=require(_0xd502('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd502('0x5'));router['get']('/',auth[_0xd502('0x6')](),controller[_0xd502('0x7')]);router['get'](_0xd502('0x8'),auth[_0xd502('0x6')](),controller[_0xd502('0x9')]);router[_0xd502('0xa')]('/',auth[_0xd502('0x6')](),controller[_0xd502('0xb')]);router[_0xd502('0xc')](_0xd502('0x8'),auth[_0xd502('0x6')](),controller[_0xd502('0xd')]);router[_0xd502('0xe')](_0xd502('0x8'),auth[_0xd502('0x6')](),controller[_0xd502('0xf')]);module[_0xd502('0x10')]=router; \ No newline at end of file +var _0x926f=['update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1ffb37,_0x325932){var _0x5bca6f=function(_0x453777){while(--_0x453777){_0x1ffb37['push'](_0x1ffb37['shift']());}};_0x5bca6f(++_0x325932);}(_0x926f,0x80));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf926('0x0'));var util=require(_0xf926('0x1'));var path=require(_0xf926('0x2'));var timeout=require(_0xf926('0x3'));var express=require(_0xf926('0x4'));var router=express[_0xf926('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf926('0x6'));var config=require('../../config/environment');var controller=require(_0xf926('0x7'));router[_0xf926('0x8')]('/',auth[_0xf926('0x9')](),controller[_0xf926('0xa')]);router[_0xf926('0x8')](_0xf926('0xb'),auth[_0xf926('0x9')](),controller[_0xf926('0xc')]);router[_0xf926('0xd')]('/',auth[_0xf926('0x9')](),controller[_0xf926('0xe')]);router[_0xf926('0xf')](_0xf926('0xb'),auth['isAuthenticated'](),controller[_0xf926('0x10')]);router['delete'](_0xf926('0xb'),auth['isAuthenticated'](),controller[_0xf926('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 360c4fc..c86ea4a 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 _0xa40b=['exports','STRING','name','options','join','split','sequelize'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa40b,0xca));var _0xba40=function(_0x322a00,_0x3d38e4){_0x322a00=_0x322a00-0x0;var _0x5b4e80=_0xa40b[_0x322a00];return _0x5b4e80;};'use strict';var Sequelize=require(_0xba40('0x0'));module[_0xba40('0x1')]={'name':{'type':Sequelize[_0xba40('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xba40('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x231604){this['setDataValue'](_0xba40('0x4'),_0x231604?_0x231604[_0xba40('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xba40('0x4'))?this['getDataValue'](_0xba40('0x4'))[_0xba40('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xba40('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xba40('0x2')]},'description':{'type':Sequelize[_0xba40('0x2')]}}; \ No newline at end of file +var _0x651f=['name','setDataValue','options','join','split','BOOLEAN','exports','STRING'];(function(_0x5ed049,_0x31e5e1){var _0x291702=function(_0x2549a7){while(--_0x2549a7){_0x5ed049['push'](_0x5ed049['shift']());}};_0x291702(++_0x31e5e1);}(_0x651f,0x1b6));var _0xf651=function(_0x1dacff,_0x3f55af){_0x1dacff=_0x1dacff-0x0;var _0x35ad42=_0x651f[_0x1dacff];return _0x35ad42;};'use strict';var Sequelize=require('sequelize');module[_0xf651('0x0')]={'name':{'type':Sequelize[_0xf651('0x1')]},'prefix':{'type':Sequelize[_0xf651('0x1')],'unique':_0xf651('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xf651('0x1')],'set':function(_0x48ff72){this[_0xf651('0x3')](_0xf651('0x4'),_0x48ff72?_0x48ff72[_0xf651('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xf651('0x4'))?this['getDataValue'](_0xf651('0x4'))[_0xf651('0x6')](''):[];}},'auth':{'type':Sequelize[_0xf651('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xf651('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf651('0x1')]},'description':{'type':Sequelize[_0xf651('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 731d2db..c485e74 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 _0x170d=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','destroy','get','ChanSpies','UserProfileResource','then','error','stack','name','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','key','VIRTUAL','field','count','include','findAll','rows','catch','params','includeAll','options','create','body','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x170d,0x13b));var _0xd170=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x170d[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0xd170('0x0'));var emlformat=require(_0xd170('0x1'));var rimraf=require(_0xd170('0x2'));var zipdir=require(_0xd170('0x3'));var jsonpatch=require(_0xd170('0x4'));var rp=require(_0xd170('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd170('0x6'));var util=require('util');var path=require(_0xd170('0x7'));var sox=require(_0xd170('0x8'));var csv=require(_0xd170('0x9'));var ejs=require(_0xd170('0xa'));var fs=require('fs');var _=require(_0xd170('0xb'));var squel=require(_0xd170('0xc'));var crypto=require('crypto');var jsforce=require(_0xd170('0xd'));var deskjs=require(_0xd170('0xe'));var toCsv=require(_0xd170('0x9'));var querystring=require(_0xd170('0xf'));var Papa=require(_0xd170('0x10'));var authService=require(_0xd170('0x11'));var hardwareService=require(_0xd170('0x12'));var Redis=require(_0xd170('0x13'));var qs=require(_0xd170('0x14'));var logger=require(_0xd170('0x15'))(_0xd170('0x16'));var utils=require(_0xd170('0x17'));var config=require(_0xd170('0x18'));var db=require(_0xd170('0x19'))['db'];function respondWithStatusCode(_0x3b3ddc,_0x1ca2d0){_0x1ca2d0=_0x1ca2d0||0xcc;return function(_0x2e30f8){if(_0x2e30f8){return _0x3b3ddc[_0xd170('0x1a')](_0x1ca2d0);}return _0x3b3ddc[_0xd170('0x1b')](_0x1ca2d0)[_0xd170('0x1c')]();};}function respondWithResult(_0x204562,_0x15ae4b){_0x15ae4b=_0x15ae4b||0xc8;return function(_0x30c717){if(_0x30c717){return _0x204562[_0xd170('0x1b')](_0x15ae4b)[_0xd170('0x1d')](_0x30c717);}};}function respondWithFilteredResult(_0xc805e4,_0xac1947){return function(_0x24235d){if(_0x24235d){var _0xbebe0f=_0x24235d['count'],_0x2b50e6=_0xac1947[_0xd170('0x1e')],_0x4a7e0f=_0xac1947['offset']+_0xac1947[_0xd170('0x1f')],_0x59a4ca;if(_0x4a7e0f>=_0xbebe0f){_0x4a7e0f=_0xbebe0f;_0x59a4ca=0xc8;}else{_0x59a4ca=0xce;}_0xc805e4[_0xd170('0x1b')](_0x59a4ca);return _0xc805e4['set'](_0xd170('0x20'),_0x2b50e6+'-'+_0x4a7e0f+'/'+_0xbebe0f)[_0xd170('0x1d')](_0x24235d);}return null;};}function patchUpdates(_0x2536c0){return function(_0x3e82f3){try{jsonpatch['apply'](_0x3e82f3,_0x2536c0,!![]);}catch(_0x527291){return BPromise[_0xd170('0x21')](_0x527291);}return _0x3e82f3[_0xd170('0x22')]();};}function saveUpdates(_0x2cec59,_0x49f881){return function(_0x182091){if(_0x182091){return _0x182091['update'](_0x2cec59)['then'](function(_0x306d73){return _0x306d73;});}return null;};}function removeEntity(_0x3a2859,_0xcdc010){return function(_0x1a35b3){if(_0x1a35b3){return _0x1a35b3[_0xd170('0x23')]()['then'](function(){var _0x388ec2=_0x1a35b3[_0xd170('0x24')]({'plain':!![]});var _0x4d9e68=_0xd170('0x25');return db[_0xd170('0x26')][_0xd170('0x23')]({'where':{'type':_0x4d9e68,'resourceId':_0x388ec2['id']}})[_0xd170('0x27')](function(){return _0x1a35b3;});})[_0xd170('0x27')](function(){_0x3a2859['status'](0xcc)[_0xd170('0x1c')]();});}};}function handleEntityNotFound(_0x235b7a,_0x4ab092){return function(_0x221598){if(!_0x221598){_0x235b7a[_0xd170('0x1a')](0x194);}return _0x221598;};}function handleError(_0x5d8651,_0x5b9e5c){_0x5b9e5c=_0x5b9e5c||0x1f4;return function(_0x26be2a){logger[_0xd170('0x28')](_0x26be2a[_0xd170('0x29')]);if(_0x26be2a[_0xd170('0x2a')]){delete _0x26be2a['name'];}_0x5d8651[_0xd170('0x1b')](_0x5b9e5c)['send'](_0x26be2a);};}exports[_0xd170('0x2b')]=function(_0x133790,_0x447303){var _0x3cdc0f={},_0x4069aa={},_0xa756df={'count':0x0,'rows':[]};var _0x2a6583=db[_0xd170('0x2c')][_0xd170('0x2d')];_0x4069aa[_0xd170('0x2e')]=_[_0xd170('0x2f')](_0x2a6583);_0x4069aa['query']=_[_0xd170('0x2f')](_0x133790[_0xd170('0x30')]);_0x4069aa[_0xd170('0x31')]=_[_0xd170('0x32')](_0x4069aa[_0xd170('0x2e')],_0x4069aa[_0xd170('0x30')]);_0x3cdc0f[_0xd170('0x33')]=_['intersection'](_0x4069aa[_0xd170('0x2e')],qs[_0xd170('0x34')](_0x133790[_0xd170('0x30')][_0xd170('0x34')]));_0x3cdc0f['attributes']=_0x3cdc0f['attributes'][_0xd170('0x35')]?_0x3cdc0f[_0xd170('0x33')]:_0x4069aa[_0xd170('0x2e')];if(!_0x133790[_0xd170('0x30')][_0xd170('0x36')](_0xd170('0x37'))){_0x3cdc0f[_0xd170('0x1f')]=qs[_0xd170('0x1f')](_0x133790[_0xd170('0x30')][_0xd170('0x1f')]);_0x3cdc0f[_0xd170('0x1e')]=qs[_0xd170('0x1e')](_0x133790[_0xd170('0x30')][_0xd170('0x1e')]);}_0x3cdc0f[_0xd170('0x38')]=qs[_0xd170('0x39')](_0x133790['query'][_0xd170('0x39')]);_0x3cdc0f['where']=qs['filters'](_['pick'](_0x133790[_0xd170('0x30')],_0x4069aa['filters']));if(_0x133790[_0xd170('0x30')][_0xd170('0x3a')]){_0x3cdc0f[_0xd170('0x3b')]=_[_0xd170('0x3c')](_0x3cdc0f[_0xd170('0x3b')],{'$or':_['map'](_0x2a6583,function(_0xee8dac){if(_0xee8dac['type'][_0xd170('0x3d')]!==_0xd170('0x3e')){var _0x2ef266={};_0x2ef266[_0xee8dac[_0xd170('0x3f')]]={'$like':'%'+_0x133790[_0xd170('0x30')]['filter']+'%'};return _0x2ef266;}})});}_0x3cdc0f=_[_0xd170('0x3c')]({},_0x3cdc0f,_0x133790['options']);var _0x20772d={'where':_0x3cdc0f['where']};return db[_0xd170('0x2c')][_0xd170('0x40')](_0x20772d)['then'](function(_0x457017){_0xa756df[_0xd170('0x40')]=_0x457017;if(_0x133790[_0xd170('0x30')]['includeAll']){_0x3cdc0f[_0xd170('0x41')]=[{'all':!![]}];}return db[_0xd170('0x2c')][_0xd170('0x42')](_0x3cdc0f);})[_0xd170('0x27')](function(_0x4d9bb6){_0xa756df[_0xd170('0x43')]=_0x4d9bb6;return _0xa756df;})[_0xd170('0x27')](respondWithFilteredResult(_0x447303,_0x3cdc0f))[_0xd170('0x44')](handleError(_0x447303,null));};exports['show']=function(_0x1e0642,_0x955aae){var _0x56d157={'raw':![],'where':{'id':_0x1e0642[_0xd170('0x45')]['id']}},_0x24a8ed={};_0x24a8ed[_0xd170('0x2e')]=_[_0xd170('0x2f')](db[_0xd170('0x2c')]['rawAttributes']);_0x24a8ed['query']=_[_0xd170('0x2f')](_0x1e0642[_0xd170('0x30')]);_0x24a8ed['filters']=_[_0xd170('0x32')](_0x24a8ed[_0xd170('0x2e')],_0x24a8ed[_0xd170('0x30')]);_0x56d157[_0xd170('0x33')]=_[_0xd170('0x32')](_0x24a8ed[_0xd170('0x2e')],qs['fields'](_0x1e0642[_0xd170('0x30')][_0xd170('0x34')]));_0x56d157[_0xd170('0x33')]=_0x56d157[_0xd170('0x33')]['length']?_0x56d157[_0xd170('0x33')]:_0x24a8ed[_0xd170('0x2e')];if(_0x1e0642[_0xd170('0x30')][_0xd170('0x46')]){_0x56d157[_0xd170('0x41')]=[{'all':!![]}];}_0x56d157=_['merge']({},_0x56d157,_0x1e0642[_0xd170('0x47')]);return db[_0xd170('0x2c')]['find'](_0x56d157)['then'](handleEntityNotFound(_0x955aae,null))['then'](respondWithResult(_0x955aae,null))[_0xd170('0x44')](handleError(_0x955aae,null));};exports[_0xd170('0x48')]=function(_0x20c3e2,_0x38ecd6){return db[_0xd170('0x2c')][_0xd170('0x48')](_0x20c3e2[_0xd170('0x49')],{})['then'](function(_0x298085){var _0x1f1772=_0x20c3e2['user'][_0xd170('0x24')]({'plain':!![]});if(!_0x1f1772)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f1772[_0xd170('0x4a')]==='user'){var _0x441380=_0x298085[_0xd170('0x24')]({'plain':!![]});var _0x8b9dad='ChanSpies';return db['UserProfileSection'][_0xd170('0x4b')]({'where':{'name':_0x8b9dad,'userProfileId':_0x1f1772[_0xd170('0x4c')]},'raw':!![]})[_0xd170('0x27')](function(_0x16bd5b){if(_0x16bd5b&&_0x16bd5b['autoAssociation']===0x0){return db[_0xd170('0x26')]['create']({'name':_0x441380[_0xd170('0x2a')],'resourceId':_0x441380['id'],'type':_0x16bd5b[_0xd170('0x2a')],'sectionId':_0x16bd5b['id']},{})[_0xd170('0x27')](function(){return _0x298085;});}else{return _0x298085;}})['catch'](function(_0x154b2b){logger[_0xd170('0x28')](_0xd170('0x4d'),_0x154b2b);throw _0x154b2b;});}return _0x298085;})['then'](respondWithResult(_0x38ecd6,0xc9))[_0xd170('0x44')](handleError(_0x38ecd6,null));};exports[_0xd170('0x4e')]=function(_0x184908,_0x4b26c7){if(_0x184908[_0xd170('0x49')]['id']){delete _0x184908[_0xd170('0x49')]['id'];}return db['VoiceChanSpy'][_0xd170('0x4b')]({'where':{'id':_0x184908[_0xd170('0x45')]['id']}})[_0xd170('0x27')](handleEntityNotFound(_0x4b26c7,null))['then'](saveUpdates(_0x184908[_0xd170('0x49')],null))[_0xd170('0x27')](respondWithResult(_0x4b26c7,null))[_0xd170('0x44')](handleError(_0x4b26c7,null));};exports['destroy']=function(_0x12cf53,_0x396e15){return db['VoiceChanSpy']['find']({'where':{'id':_0x12cf53[_0xd170('0x45')]['id']}})[_0xd170('0x27')](handleEntityNotFound(_0x396e15,null))[_0xd170('0x27')](removeEntity(_0x396e15,null))[_0xd170('0x44')](handleError(_0x396e15,null));}; \ No newline at end of file +var _0x1902=['VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key'];(function(_0x564540,_0x2c66a4){var _0x40539a=function(_0x3fa774){while(--_0x3fa774){_0x564540['push'](_0x564540['shift']());}};_0x40539a(++_0x2c66a4);}(_0x1902,0x148));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2190('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2190('0x1'));var zipdir=require(_0x2190('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2190('0x3'));var Mustache=require('mustache');var util=require(_0x2190('0x4'));var path=require(_0x2190('0x5'));var sox=require(_0x2190('0x6'));var csv=require(_0x2190('0x7'));var ejs=require(_0x2190('0x8'));var fs=require('fs');var _=require(_0x2190('0x9'));var squel=require(_0x2190('0xa'));var crypto=require(_0x2190('0xb'));var jsforce=require(_0x2190('0xc'));var deskjs=require(_0x2190('0xd'));var toCsv=require(_0x2190('0x7'));var querystring=require(_0x2190('0xe'));var Papa=require('papaparse');var authService=require(_0x2190('0xf'));var hardwareService=require(_0x2190('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2190('0x11'))(_0x2190('0x12'));var utils=require(_0x2190('0x13'));var config=require('../../config/environment');var db=require(_0x2190('0x14'))['db'];function respondWithStatusCode(_0x481828,_0x31c245){_0x31c245=_0x31c245||0xcc;return function(_0x449a72){if(_0x449a72){return _0x481828[_0x2190('0x15')](_0x31c245);}return _0x481828[_0x2190('0x16')](_0x31c245)[_0x2190('0x17')]();};}function respondWithResult(_0x15cdd4,_0x1cd96b){_0x1cd96b=_0x1cd96b||0xc8;return function(_0xfb0468){if(_0xfb0468){return _0x15cdd4[_0x2190('0x16')](_0x1cd96b)[_0x2190('0x18')](_0xfb0468);}};}function respondWithFilteredResult(_0x3528dc,_0x2d1fbe){return function(_0x4af08a){if(_0x4af08a){var _0x43fe5e=_0x4af08a[_0x2190('0x19')],_0x1ee907=_0x2d1fbe[_0x2190('0x1a')],_0x5dae3b=_0x2d1fbe[_0x2190('0x1a')]+_0x2d1fbe[_0x2190('0x1b')],_0x4cdbd9;if(_0x5dae3b>=_0x43fe5e){_0x5dae3b=_0x43fe5e;_0x4cdbd9=0xc8;}else{_0x4cdbd9=0xce;}_0x3528dc[_0x2190('0x16')](_0x4cdbd9);return _0x3528dc['set'](_0x2190('0x1c'),_0x1ee907+'-'+_0x5dae3b+'/'+_0x43fe5e)[_0x2190('0x18')](_0x4af08a);}return null;};}function patchUpdates(_0x413fab){return function(_0x7c7d00){try{jsonpatch[_0x2190('0x1d')](_0x7c7d00,_0x413fab,!![]);}catch(_0x59d59a){return BPromise[_0x2190('0x1e')](_0x59d59a);}return _0x7c7d00[_0x2190('0x1f')]();};}function saveUpdates(_0x5d3d7b,_0x264b58){return function(_0x55e815){if(_0x55e815){return _0x55e815['update'](_0x5d3d7b)[_0x2190('0x20')](function(_0x53e7b4){return _0x53e7b4;});}return null;};}function removeEntity(_0x54594d,_0x5a708a){return function(_0x29a15a){if(_0x29a15a){return _0x29a15a['destroy']()[_0x2190('0x20')](function(){var _0x34ea31=_0x29a15a[_0x2190('0x21')]({'plain':!![]});var _0x1f5f0b=_0x2190('0x22');return db[_0x2190('0x23')][_0x2190('0x24')]({'where':{'type':_0x1f5f0b,'resourceId':_0x34ea31['id']}})['then'](function(){return _0x29a15a;});})[_0x2190('0x20')](function(){_0x54594d[_0x2190('0x16')](0xcc)[_0x2190('0x17')]();});}};}function handleEntityNotFound(_0x41ab53,_0x17b442){return function(_0x5959f1){if(!_0x5959f1){_0x41ab53[_0x2190('0x15')](0x194);}return _0x5959f1;};}function handleError(_0x340c68,_0x4d8034){_0x4d8034=_0x4d8034||0x1f4;return function(_0x2d517d){logger[_0x2190('0x25')](_0x2d517d[_0x2190('0x26')]);if(_0x2d517d[_0x2190('0x27')]){delete _0x2d517d[_0x2190('0x27')];}_0x340c68['status'](_0x4d8034)[_0x2190('0x28')](_0x2d517d);};}exports[_0x2190('0x29')]=function(_0x284070,_0x1f8aa3){var _0x4db80f={},_0x3b38c4={},_0x2ccad5={'count':0x0,'rows':[]};var _0x15da78=db[_0x2190('0x2a')][_0x2190('0x2b')];_0x3b38c4[_0x2190('0x2c')]=_[_0x2190('0x2d')](_0x15da78);_0x3b38c4[_0x2190('0x2e')]=_[_0x2190('0x2d')](_0x284070[_0x2190('0x2e')]);_0x3b38c4['filters']=_[_0x2190('0x2f')](_0x3b38c4[_0x2190('0x2c')],_0x3b38c4['query']);_0x4db80f['attributes']=_[_0x2190('0x2f')](_0x3b38c4[_0x2190('0x2c')],qs['fields'](_0x284070['query'][_0x2190('0x30')]));_0x4db80f[_0x2190('0x31')]=_0x4db80f[_0x2190('0x31')]['length']?_0x4db80f[_0x2190('0x31')]:_0x3b38c4[_0x2190('0x2c')];if(!_0x284070[_0x2190('0x2e')][_0x2190('0x32')](_0x2190('0x33'))){_0x4db80f['limit']=qs[_0x2190('0x1b')](_0x284070['query'][_0x2190('0x1b')]);_0x4db80f[_0x2190('0x1a')]=qs[_0x2190('0x1a')](_0x284070[_0x2190('0x2e')][_0x2190('0x1a')]);}_0x4db80f[_0x2190('0x34')]=qs[_0x2190('0x35')](_0x284070[_0x2190('0x2e')][_0x2190('0x35')]);_0x4db80f[_0x2190('0x36')]=qs[_0x2190('0x37')](_[_0x2190('0x38')](_0x284070[_0x2190('0x2e')],_0x3b38c4[_0x2190('0x37')]));if(_0x284070[_0x2190('0x2e')][_0x2190('0x39')]){_0x4db80f[_0x2190('0x36')]=_[_0x2190('0x3a')](_0x4db80f['where'],{'$or':_[_0x2190('0x3b')](_0x15da78,function(_0x4ba106){if(_0x4ba106[_0x2190('0x3c')][_0x2190('0x3d')]!==_0x2190('0x3e')){var _0x588f86={};_0x588f86[_0x4ba106['field']]={'$like':'%'+_0x284070['query'][_0x2190('0x39')]+'%'};return _0x588f86;}})});}_0x4db80f=_[_0x2190('0x3a')]({},_0x4db80f,_0x284070[_0x2190('0x3f')]);var _0xca0b72={'where':_0x4db80f[_0x2190('0x36')]};return db[_0x2190('0x2a')]['count'](_0xca0b72)['then'](function(_0x584379){_0x2ccad5[_0x2190('0x19')]=_0x584379;if(_0x284070[_0x2190('0x2e')][_0x2190('0x40')]){_0x4db80f[_0x2190('0x41')]=[{'all':!![]}];}return db[_0x2190('0x2a')]['findAll'](_0x4db80f);})[_0x2190('0x20')](function(_0x2bf922){_0x2ccad5[_0x2190('0x42')]=_0x2bf922;return _0x2ccad5;})[_0x2190('0x20')](respondWithFilteredResult(_0x1f8aa3,_0x4db80f))[_0x2190('0x43')](handleError(_0x1f8aa3,null));};exports[_0x2190('0x44')]=function(_0x59a372,_0x67d7f4){var _0x5b1400={'raw':![],'where':{'id':_0x59a372[_0x2190('0x45')]['id']}},_0x5b290b={};_0x5b290b[_0x2190('0x2c')]=_[_0x2190('0x2d')](db[_0x2190('0x2a')]['rawAttributes']);_0x5b290b[_0x2190('0x2e')]=_[_0x2190('0x2d')](_0x59a372[_0x2190('0x2e')]);_0x5b290b['filters']=_[_0x2190('0x2f')](_0x5b290b[_0x2190('0x2c')],_0x5b290b[_0x2190('0x2e')]);_0x5b1400['attributes']=_[_0x2190('0x2f')](_0x5b290b[_0x2190('0x2c')],qs[_0x2190('0x30')](_0x59a372['query'][_0x2190('0x30')]));_0x5b1400[_0x2190('0x31')]=_0x5b1400[_0x2190('0x31')]['length']?_0x5b1400[_0x2190('0x31')]:_0x5b290b['model'];if(_0x59a372[_0x2190('0x2e')][_0x2190('0x40')]){_0x5b1400[_0x2190('0x41')]=[{'all':!![]}];}_0x5b1400=_[_0x2190('0x3a')]({},_0x5b1400,_0x59a372[_0x2190('0x3f')]);return db['VoiceChanSpy'][_0x2190('0x46')](_0x5b1400)[_0x2190('0x20')](handleEntityNotFound(_0x67d7f4,null))[_0x2190('0x20')](respondWithResult(_0x67d7f4,null))[_0x2190('0x43')](handleError(_0x67d7f4,null));};exports[_0x2190('0x47')]=function(_0x2a9abe,_0x12f4ce){return db['VoiceChanSpy']['create'](_0x2a9abe[_0x2190('0x48')],{})[_0x2190('0x20')](function(_0x6422d7){var _0x5c5593=_0x2a9abe[_0x2190('0x49')][_0x2190('0x21')]({'plain':!![]});if(!_0x5c5593)throw new Error(_0x2190('0x4a'));if(_0x5c5593[_0x2190('0x4b')]==='user'){var _0x7b4bda=_0x6422d7[_0x2190('0x21')]({'plain':!![]});var _0x3932e9=_0x2190('0x22');return db['UserProfileSection'][_0x2190('0x46')]({'where':{'name':_0x3932e9,'userProfileId':_0x5c5593[_0x2190('0x4c')]},'raw':!![]})[_0x2190('0x20')](function(_0x1e7dde){if(_0x1e7dde&&_0x1e7dde['autoAssociation']===0x0){return db[_0x2190('0x23')]['create']({'name':_0x7b4bda[_0x2190('0x27')],'resourceId':_0x7b4bda['id'],'type':_0x1e7dde[_0x2190('0x27')],'sectionId':_0x1e7dde['id']},{})[_0x2190('0x20')](function(){return _0x6422d7;});}else{return _0x6422d7;}})[_0x2190('0x43')](function(_0x8720){logger[_0x2190('0x25')](_0x2190('0x4d'),_0x8720);throw _0x8720;});}return _0x6422d7;})[_0x2190('0x20')](respondWithResult(_0x12f4ce,0xc9))['catch'](handleError(_0x12f4ce,null));};exports['update']=function(_0x5ac4b0,_0x218513){if(_0x5ac4b0[_0x2190('0x48')]['id']){delete _0x5ac4b0[_0x2190('0x48')]['id'];}return db[_0x2190('0x2a')]['find']({'where':{'id':_0x5ac4b0['params']['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x218513,null))[_0x2190('0x20')](saveUpdates(_0x5ac4b0[_0x2190('0x48')],null))[_0x2190('0x20')](respondWithResult(_0x218513,null))[_0x2190('0x43')](handleError(_0x218513,null));};exports[_0x2190('0x24')]=function(_0x5e9418,_0x4fac73){return db[_0x2190('0x2a')][_0x2190('0x46')]({'where':{'id':_0x5e9418['params']['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x4fac73,null))[_0x2190('0x20')](removeEntity(_0x4fac73,null))[_0x2190('0x43')](handleError(_0x4fac73,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 47a9e30..2962b41 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 _0x2742=['api','./voiceChanSpy.attributes','system','format','%s%s','prefix','push','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','auth','ChanSpy','SIP/%s,%s','name','options','join','length','internal','concat','User','findAll','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','bulkCreate','destroy','VoiceExtension','util','bluebird','../../config/logger'];(function(_0xb1e417,_0x39c84b){var _0x12b010=function(_0x369996){while(--_0x369996){_0xb1e417['push'](_0xb1e417['shift']());}};_0x12b010(++_0x39c84b);}(_0x2742,0x17e));var _0x2274=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2742[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2274('0x0'));var BPromise=require(_0x2274('0x1'));var logger=require(_0x2274('0x2'))(_0x2274('0x3'));var attributes=require(_0x2274('0x4'));var getUserApplications=function(_0x57cb49,_0x192748,_0x3f13bd){var _0xd4d859=0x1;var _0x68ce33=[];var _0x4dcfe1={'context':'from-sip','type':_0x2274('0x5'),'isApp':![]};var _0x4e045b={'exten':util[_0x2274('0x6')](_0x2274('0x7'),_0x57cb49[_0x2274('0x8')],_0x3f13bd),'ChanSpyId':_0x57cb49['id'],'UserId':_0x192748['id']};_0x68ce33[_0x2274('0x9')](_['merge']({'app':'Set','appdata':util[_0x2274('0x6')]('CDR(type)=%s',_0x2274('0xa')),'priority':_0xd4d859++},_0x4dcfe1,_0x4e045b));if(_0x57cb49[_0x2274('0xb')]){_0x68ce33['push'](_['merge']({'app':_0x2274('0xc'),'appdata':util['format'](_0x2274('0xd'),_0x57cb49['recordingFormat']),'priority':_0xd4d859++},_0x4dcfe1,_0x4e045b));}if(_0x57cb49[_0x2274('0xe')]){_0x68ce33[_0x2274('0x9')](_['merge']({'app':'Authenticate','appdata':_0x57cb49['password'],'priority':_0xd4d859++},_0x4dcfe1,_0x4e045b));}_0x68ce33[_0x2274('0x9')](_['merge']({'app':_0x2274('0xf'),'appdata':util['format'](_0x2274('0x10'),_0x192748[_0x2274('0x11')],_0x57cb49[_0x2274('0x12')]?_0x57cb49[_0x2274('0x12')][_0x2274('0x13')](''):''),'priority':_0xd4d859++},_0x4dcfe1,_0x4e045b));if(_0x57cb49[_0x2274('0xb')]){_0x68ce33['push'](_['merge']({'app':'StopMixMonitor','priority':_0xd4d859++},_0x4dcfe1,_0x4e045b));}return _0x68ce33;};var getChanSpyApplications=function(_0x55bfc3,_0x416c2c){var _0x333c80=[];for(var _0x43d661=0x0,_0x319d5e=0x1;_0x43d661<_0x416c2c[_0x2274('0x14')];_0x43d661++,_0x319d5e=0x1){var _0x281a42=getUserApplications(_0x55bfc3,_0x416c2c[_0x43d661],_0x416c2c[_0x43d661][_0x2274('0x15')]);var _0x2fd744=getUserApplications(_0x55bfc3,_0x416c2c[_0x43d661],_0x416c2c[_0x43d661][_0x2274('0x11')]);_0x333c80=_0x333c80[_0x2274('0x16')](_0x281a42,_0x2fd744);}return _0x333c80;};var getChanSpyPromise=function(_0x24cdb0,_0x57ebe0){return new BPromise(function(_0x2fbea2,_0x2c1eed){return _0x24cdb0[_0x2274('0x17')][_0x2274('0x18')]({'attributes':['id','name',_0x2274('0x15')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x2a7533){if(_0x2a7533){return _0x2fbea2(getChanSpyApplications(_0x57ebe0,_0x2a7533));}return _0x2fbea2([]);})[_0x2274('0x19')](function(_0x1594d0){_0x2c1eed(_0x1594d0);});});};module[_0x2274('0x1a')]=function(_0x4ee640,_0x51178b){var _0x3cacb8=_0x4ee640[_0x2274('0x1b')];return _0x4ee640[_0x2274('0x1c')](_0x2274('0x1d'),attributes,{'tableName':_0x2274('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xf10796,_0x43da0d,_0x514f89){return getChanSpyPromise(_0x3cacb8,_0xf10796)[_0x2274('0x1f')](function(_0x374c0d){if(_0x374c0d&&_0x374c0d[_0x2274('0x14')]){return _0x3cacb8['VoiceExtension'][_0x2274('0x20')](_0x374c0d);}})['then'](function(){_0x514f89();})[_0x2274('0x19')](function(_0x2a1eb7){_0x514f89(_0x2a1eb7);});},'afterUpdate':function(_0x144873,_0x408b5b,_0x48eedc){return _0x3cacb8['VoiceExtension'][_0x2274('0x21')]({'where':{'ChanSpyId':_0x144873['id']}})['then'](function(){return getChanSpyPromise(_0x3cacb8,_0x144873);})[_0x2274('0x1f')](function(_0x194c36){if(_0x194c36&&_0x194c36[_0x2274('0x14')]){return _0x3cacb8[_0x2274('0x22')]['bulkCreate'](_0x194c36);}})[_0x2274('0x1f')](function(){_0x48eedc();})[_0x2274('0x19')](function(_0x14c731){_0x48eedc(_0x14c731);});},'afterDestroy':function(_0x4940fd,_0x119223,_0x148ae5){return _0x3cacb8[_0x2274('0x22')][_0x2274('0x21')]({'where':{'ChanSpyId':_0x4940fd['id']}})['then'](function(){_0x148ae5();})[_0x2274('0x19')](function(_0x3d9c21){_0x148ae5(_0x3d9c21);});}}});}; \ No newline at end of file +var _0xce92=['password','ChanSpy','name','options','join','StopMixMonitor','length','concat','User','findAll','internal','agent','catch','models','define','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','record','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate'];(function(_0x56b50d,_0x2f4d83){var _0x1a732d=function(_0x19b500){while(--_0x19b500){_0x56b50d['push'](_0x56b50d['shift']());}};_0x1a732d(++_0x2f4d83);}(_0xce92,0x186));var _0x2ce9=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xce92[_0x2eac4f];return _0x58f73b;};'use strict';var _=require(_0x2ce9('0x0'));var util=require('util');var BPromise=require(_0x2ce9('0x1'));var attributes=require(_0x2ce9('0x2'));var getUserApplications=function(_0x1a2ebe,_0x203ff1,_0x14f545){var _0xbc8e5c=0x1;var _0x4845fa=[];var _0x53923a={'context':_0x203ff1['context']||_0x2ce9('0x3'),'exten':util['format'](_0x2ce9('0x4'),_0x1a2ebe[_0x2ce9('0x5')],_0x14f545),'type':_0x2ce9('0x6'),'isApp':![],'ChanSpyId':_0x1a2ebe['id'],'UserId':_0x203ff1['id']};_0x4845fa[_0x2ce9('0x7')](_[_0x2ce9('0x8')]({'app':_0x2ce9('0x9'),'appdata':util[_0x2ce9('0xa')](_0x2ce9('0xb'),'chanspy'),'priority':_0xbc8e5c++},_0x53923a));if(_0x1a2ebe[_0x2ce9('0xc')]){_0x4845fa[_0x2ce9('0x7')](_['merge']({'app':'MixMonitor','appdata':util[_0x2ce9('0xa')](_0x2ce9('0xd'),_0x1a2ebe[_0x2ce9('0xe')]),'priority':_0xbc8e5c++},_0x53923a));}if(_0x1a2ebe[_0x2ce9('0xf')]){_0x4845fa['push'](_[_0x2ce9('0x8')]({'app':_0x2ce9('0x10'),'appdata':_0x1a2ebe[_0x2ce9('0x11')],'priority':_0xbc8e5c++},_0x53923a));}_0x4845fa[_0x2ce9('0x7')](_[_0x2ce9('0x8')]({'app':_0x2ce9('0x12'),'appdata':util[_0x2ce9('0xa')]('SIP/%s,%s',_0x203ff1[_0x2ce9('0x13')],_0x1a2ebe[_0x2ce9('0x14')]?_0x1a2ebe[_0x2ce9('0x14')][_0x2ce9('0x15')](''):''),'priority':_0xbc8e5c++},_0x53923a));if(_0x1a2ebe[_0x2ce9('0xc')]){_0x4845fa[_0x2ce9('0x7')](_['merge']({'app':_0x2ce9('0x16'),'priority':_0xbc8e5c++},_0x53923a));}return _0x4845fa;};var getChanSpyApplications=function(_0x270828,_0x589f0e){var _0x1c001d=[];for(var _0x528818=0x0,_0x41caee=0x1;_0x528818<_0x589f0e[_0x2ce9('0x17')];_0x528818++,_0x41caee=0x1){_0x1c001d=_0x1c001d[_0x2ce9('0x18')](getUserApplications(_0x270828,_0x589f0e[_0x528818],_0x589f0e[_0x528818]['internal']));if(_0x589f0e[_0x528818]['internal']!=_0x589f0e[_0x528818]['name']){_0x1c001d=_0x1c001d[_0x2ce9('0x18')](getUserApplications(_0x270828,_0x589f0e[_0x528818],_0x589f0e[_0x528818]['name']));}}return _0x1c001d;};var getChanSpyPromise=function(_0x5353b0,_0x3abff4){return new BPromise(function(_0x490eb4,_0x6b0c4d){return _0x5353b0[_0x2ce9('0x19')][_0x2ce9('0x1a')]({'attributes':['id',_0x2ce9('0x13'),_0x2ce9('0x1b')],'where':{'role':_0x2ce9('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x41cc15){if(_0x41cc15){return _0x490eb4(getChanSpyApplications(_0x3abff4,_0x41cc15));}return _0x490eb4([]);})[_0x2ce9('0x1d')](function(_0x547c92){_0x6b0c4d(_0x547c92);});});};module['exports']=function(_0x446579,_0x96b66c){var _0x383e52=_0x446579[_0x2ce9('0x1e')];return _0x446579[_0x2ce9('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x2ce9('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x523f76,_0x3308ac,_0x543d30){return getChanSpyPromise(_0x383e52,_0x523f76)[_0x2ce9('0x21')](function(_0x5654b3){if(_0x5654b3&&_0x5654b3['length']){return _0x383e52[_0x2ce9('0x22')][_0x2ce9('0x23')](_0x5654b3);}})[_0x2ce9('0x21')](function(){_0x543d30();})[_0x2ce9('0x1d')](function(_0x58e5e0){_0x543d30(_0x58e5e0);});},'afterUpdate':function(_0x24aa0f,_0x15a710,_0x4bc703){return _0x383e52[_0x2ce9('0x22')][_0x2ce9('0x24')]({'where':{'ChanSpyId':_0x24aa0f['id']}})[_0x2ce9('0x21')](function(){return getChanSpyPromise(_0x383e52,_0x24aa0f);})[_0x2ce9('0x21')](function(_0x47a211){if(_0x47a211&&_0x47a211[_0x2ce9('0x17')]){return _0x383e52['VoiceExtension'][_0x2ce9('0x23')](_0x47a211);}})[_0x2ce9('0x21')](function(){_0x4bc703();})[_0x2ce9('0x1d')](function(_0x4b6396){_0x4bc703(_0x4b6396);});},'afterDestroy':function(_0x247b66,_0x49f1f4,_0x7b67f5){return _0x383e52[_0x2ce9('0x22')]['destroy']({'where':{'ChanSpyId':_0x247b66['id']}})[_0x2ce9('0x21')](function(){_0x7b67f5();})['catch'](function(_0x48762d){_0x7b67f5(_0x48762d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ac6a5f6..4bbfb2e 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5e4219,_0x2342a0){var _0x395815=function(_0x10b90e){while(--_0x10b90e){_0x5e4219['push'](_0x5e4219['shift']());}};_0x395815(++_0x2342a0);}(_0xaa88,0x137));var _0x8aa8=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xaa88[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x98a7=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x98a7,0x116));var _0x798a=function(_0x836a08,_0x1762d8){_0x836a08=_0x836a08-0x0;var _0x1722a2=_0x98a7[_0x836a08];return _0x1722a2;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var moment=require(_0x798a('0x2'));var BPromise=require(_0x798a('0x3'));var rs=require(_0x798a('0x4'));var fs=require('fs');var Redis=require(_0x798a('0x5'));var db=require(_0x798a('0x6'))['db'];var utils=require(_0x798a('0x7'));var logger=require(_0x798a('0x8'))('rpc');var config=require(_0x798a('0x9'));var jayson=require(_0x798a('0xa'));var client=jayson[_0x798a('0xb')][_0x798a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c616f,_0x299c6d,_0x1d0dbd){return new BPromise(function(_0x1ba7c0,_0x220797){return client[_0x798a('0xd')](_0x1c616f,_0x1d0dbd)[_0x798a('0xe')](function(_0x342f2e){logger[_0x798a('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x299c6d,'request\x20sent');logger[_0x798a('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x299c6d,_0x798a('0x11'),JSON[_0x798a('0x12')](_0x342f2e));if(_0x342f2e[_0x798a('0x13')]){if(_0x342f2e[_0x798a('0x13')][_0x798a('0x14')]===0x1f4){logger[_0x798a('0x13')](_0x798a('0x15'),_0x299c6d,_0x342f2e[_0x798a('0x13')][_0x798a('0x16')]);return _0x220797(_0x342f2e[_0x798a('0x13')][_0x798a('0x16')]);}logger['error'](_0x798a('0x15'),_0x299c6d,_0x342f2e['error'][_0x798a('0x16')]);return _0x1ba7c0(_0x342f2e[_0x798a('0x13')][_0x798a('0x16')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x299c6d,'request\x20sent');_0x1ba7c0(_0x342f2e[_0x798a('0x17')][_0x798a('0x16')]);}})[_0x798a('0x18')](function(_0x3b8ae4){logger[_0x798a('0x13')](_0x798a('0x15'),_0x299c6d,_0x3b8ae4);_0x220797(_0x3b8ae4);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9ae1b55..79b4357 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 _0x253d=['multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','post','create','put','destroy','exports'];(function(_0x34f204,_0x5e5431){var _0x2abd04=function(_0x436814){while(--_0x436814){_0x34f204['push'](_0x34f204['shift']());}};_0x2abd04(++_0x5e5431);}(_0x253d,0x1b3));var _0xd253=function(_0x3df6d9,_0x48a43b){_0x3df6d9=_0x3df6d9-0x0;var _0x408303=_0x253d[_0x3df6d9];return _0x408303;};'use strict';var multer=require(_0xd253('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd253('0x1')]();var auth=require(_0xd253('0x2'));var interaction=require(_0xd253('0x3'));var config=require(_0xd253('0x4'));var controller=require(_0xd253('0x5'));router['get']('/',auth[_0xd253('0x6')](),controller[_0xd253('0x7')]);router[_0xd253('0x8')](_0xd253('0x9'),auth[_0xd253('0x6')](),controller['show']);router[_0xd253('0xa')]('/',auth[_0xd253('0x6')](),controller[_0xd253('0xb')]);router[_0xd253('0xc')](_0xd253('0x9'),auth[_0xd253('0x6')](),controller['update']);router['delete'](_0xd253('0x9'),auth['isAuthenticated'](),controller[_0xd253('0xd')]);module[_0xd253('0xe')]=router; \ No newline at end of file +var _0x583c=['../../components/auth/service','./voiceContext.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x382253,_0x1598fb){var _0x40dbb8=function(_0x408d24){while(--_0x408d24){_0x382253['push'](_0x382253['shift']());}};_0x40dbb8(++_0x1598fb);}(_0x583c,0x12b));var _0xc583=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x583c[_0x20118a];return _0x538b5f;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var auth=require(_0xc583('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc583('0x6'));router[_0xc583('0x7')]('/',auth['isAuthenticated'](),controller[_0xc583('0x8')]);router[_0xc583('0x7')](_0xc583('0x9'),auth[_0xc583('0xa')](),controller['show']);router[_0xc583('0xb')]('/',auth[_0xc583('0xa')](),controller['create']);router[_0xc583('0xc')](_0xc583('0x9'),auth[_0xc583('0xa')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/:id',auth[_0xc583('0xa')](),controller[_0xc583('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e620f29..ffa68c7 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 _0x66bd=['STRING','BOOLEAN','exports','name'];(function(_0x2c56a0,_0x143a31){var _0x3ff7d5=function(_0x17d580){while(--_0x17d580){_0x2c56a0['push'](_0x2c56a0['shift']());}};_0x3ff7d5(++_0x143a31);}(_0x66bd,0x11a));var _0xd66b=function(_0x332597,_0x33648e){_0x332597=_0x332597-0x0;var _0x70870e=_0x66bd[_0x332597];return _0x70870e;};'use strict';var Sequelize=require('sequelize');module[_0xd66b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd66b('0x1')},'description':{'type':Sequelize[_0xd66b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd66b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x75d6=['sequelize','exports','name','BOOLEAN'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x75d6,0x64));var _0x675d=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x75d6[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require(_0x675d('0x0'));module[_0x675d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x675d('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x675d('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 94661dc..1ad7ee5 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 _0x967c=['filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','merge','map','key','VIRTUAL','field','filter','options','VoiceContext','count','includeAll','findAll','rows','show','params','keys','include','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Reload','chan_sip.so','/etc/asterisk/extensions_xcally_contexts.conf','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','request','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','rawAttributes','query'];(function(_0x3eec87,_0x4edfc4){var _0x3fcaf8=function(_0x30eed1){while(--_0x30eed1){_0x3eec87['push'](_0x3eec87['shift']());}};_0x3fcaf8(++_0x4edfc4);}(_0x967c,0xfd));var _0xc967=function(_0x18da2a,_0x5919ff){_0x18da2a=_0x18da2a-0x0;var _0x35dbc4=_0x967c[_0x18da2a];return _0x35dbc4;};'use strict';var pdf=require(_0xc967('0x0'));var emlformat=require(_0xc967('0x1'));var rimraf=require(_0xc967('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc967('0x3'));var rp=require(_0xc967('0x4'));var moment=require('moment');var BPromise=require(_0xc967('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc967('0x6'));var sox=require(_0xc967('0x7'));var csv=require(_0xc967('0x8'));var ejs=require(_0xc967('0x9'));var fs=require('fs');var _=require(_0xc967('0xa'));var squel=require(_0xc967('0xb'));var crypto=require('crypto');var jsforce=require(_0xc967('0xc'));var deskjs=require(_0xc967('0xd'));var toCsv=require(_0xc967('0x8'));var querystring=require(_0xc967('0xe'));var Papa=require(_0xc967('0xf'));var authService=require(_0xc967('0x10'));var hardwareService=require(_0xc967('0x11'));var Redis=require(_0xc967('0x12'));var qs=require(_0xc967('0x13'));var logger=require(_0xc967('0x14'))(_0xc967('0x15'));var utils=require(_0xc967('0x16'));var config=require(_0xc967('0x17'));var db=require(_0xc967('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc967('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212bba,_0x12fe2e,_0x3e0dbb,_0x7e6b3){return new BPromise(function(_0x10798d,_0x16cfbd){var _0x4d18b3=_0x7e6b3||client;return _0x4d18b3[_0xc967('0x1a')](_0x212bba,_0x3e0dbb)['then'](function(_0x22600d){logger[_0xc967('0x1b')](_0xc967('0x1c'),_0x12fe2e,'request\x20sent');logger['debug'](_0xc967('0x1d'),_0x12fe2e,_0xc967('0x1e'),JSON[_0xc967('0x1f')](_0x22600d));if(_0x22600d['error']){if(_0x22600d[_0xc967('0x20')][_0xc967('0x21')]===0x1f4){logger[_0xc967('0x20')]('VoiceContext,\x20%s,\x20%s',_0x12fe2e,_0x22600d['error']['message']);return _0x16cfbd(_0x22600d['error'][_0xc967('0x22')]);}logger[_0xc967('0x20')](_0xc967('0x1c'),_0x12fe2e,_0x22600d[_0xc967('0x20')][_0xc967('0x22')]);return _0x10798d(_0x22600d[_0xc967('0x20')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x12fe2e,_0xc967('0x1e'));_0x10798d(_0x22600d[_0xc967('0x23')][_0xc967('0x22')]);}})[_0xc967('0x24')](function(_0x327fce){logger[_0xc967('0x20')](_0xc967('0x1c'),_0x12fe2e,_0x327fce);_0x16cfbd(_0x327fce);});});}function respondWithStatusCode(_0x153d66,_0x3db8e1){_0x3db8e1=_0x3db8e1||0xcc;return function(_0x111994){if(_0x111994){return _0x153d66['sendStatus'](_0x3db8e1);}return _0x153d66[_0xc967('0x25')](_0x3db8e1)['end']();};}function respondWithResult(_0x26957a,_0x3b1fac){_0x3b1fac=_0x3b1fac||0xc8;return function(_0x30c46b){if(_0x30c46b){return _0x26957a[_0xc967('0x25')](_0x3b1fac)['json'](_0x30c46b);}};}function respondWithFilteredResult(_0x4e3a04,_0x16afee){return function(_0x6ade5){if(_0x6ade5){var _0x30a1c4=_0x6ade5['count'],_0x58d619=_0x16afee[_0xc967('0x26')],_0x41def3=_0x16afee[_0xc967('0x26')]+_0x16afee[_0xc967('0x27')],_0xa65898;if(_0x41def3>=_0x30a1c4){_0x41def3=_0x30a1c4;_0xa65898=0xc8;}else{_0xa65898=0xce;}_0x4e3a04[_0xc967('0x25')](_0xa65898);return _0x4e3a04[_0xc967('0x28')](_0xc967('0x29'),_0x58d619+'-'+_0x41def3+'/'+_0x30a1c4)[_0xc967('0x2a')](_0x6ade5);}return null;};}function patchUpdates(_0x3a94cf){return function(_0x2c85d9){try{jsonpatch[_0xc967('0x2b')](_0x2c85d9,_0x3a94cf,!![]);}catch(_0x38c9d1){return BPromise[_0xc967('0x2c')](_0x38c9d1);}return _0x2c85d9[_0xc967('0x2d')]();};}function saveUpdates(_0x4e3747,_0x3384d9){return function(_0x653244){if(_0x653244){return _0x653244[_0xc967('0x2e')](_0x4e3747)[_0xc967('0x2f')](function(_0x3e6d03){return _0x3e6d03;});}return null;};}function removeEntity(_0x118dbe,_0x243f76){return function(_0x20ec02){if(_0x20ec02){return _0x20ec02[_0xc967('0x30')]()[_0xc967('0x2f')](function(){var _0x4175f8=_0x20ec02[_0xc967('0x31')]({'plain':!![]});var _0x315233='Contexts';return db[_0xc967('0x32')][_0xc967('0x30')]({'where':{'type':_0x315233,'resourceId':_0x4175f8['id']}})['then'](function(){return _0x20ec02;});})[_0xc967('0x2f')](function(){_0x118dbe[_0xc967('0x25')](0xcc)[_0xc967('0x33')]();});}};}function handleEntityNotFound(_0x181342,_0x587571){return function(_0x455f6c){if(!_0x455f6c){_0x181342[_0xc967('0x34')](0x194);}return _0x455f6c;};}function handleError(_0x17b4b1,_0x5297b9){_0x5297b9=_0x5297b9||0x1f4;return function(_0x4abc1b){logger[_0xc967('0x20')](_0x4abc1b[_0xc967('0x35')]);if(_0x4abc1b[_0xc967('0x36')]){delete _0x4abc1b[_0xc967('0x36')];}_0x17b4b1['status'](_0x5297b9)[_0xc967('0x37')](_0x4abc1b);};}exports[_0xc967('0x38')]=function(_0x32788e,_0x58b5c3){var _0x5bd1d3={},_0x1263ce={},_0x4e0c41={'count':0x0,'rows':[]};var _0x208f84=db['VoiceContext'][_0xc967('0x39')];_0x1263ce['model']=_['keys'](_0x208f84);_0x1263ce[_0xc967('0x3a')]=_['keys'](_0x32788e['query']);_0x1263ce[_0xc967('0x3b')]=_[_0xc967('0x3c')](_0x1263ce['model'],_0x1263ce[_0xc967('0x3a')]);_0x5bd1d3[_0xc967('0x3d')]=_[_0xc967('0x3c')](_0x1263ce['model'],qs[_0xc967('0x3e')](_0x32788e[_0xc967('0x3a')][_0xc967('0x3e')]));_0x5bd1d3[_0xc967('0x3d')]=_0x5bd1d3[_0xc967('0x3d')][_0xc967('0x3f')]?_0x5bd1d3[_0xc967('0x3d')]:_0x1263ce[_0xc967('0x40')];if(!_0x32788e[_0xc967('0x3a')]['hasOwnProperty'](_0xc967('0x41'))){_0x5bd1d3['limit']=qs[_0xc967('0x27')](_0x32788e['query'][_0xc967('0x27')]);_0x5bd1d3[_0xc967('0x26')]=qs[_0xc967('0x26')](_0x32788e['query'][_0xc967('0x26')]);}_0x5bd1d3[_0xc967('0x42')]=qs[_0xc967('0x43')](_0x32788e[_0xc967('0x3a')][_0xc967('0x43')]);_0x5bd1d3[_0xc967('0x44')]=qs['filters'](_['pick'](_0x32788e[_0xc967('0x3a')],_0x1263ce[_0xc967('0x3b')]));if(_0x32788e[_0xc967('0x3a')]['filter']){_0x5bd1d3['where']=_[_0xc967('0x45')](_0x5bd1d3[_0xc967('0x44')],{'$or':_[_0xc967('0x46')](_0x208f84,function(_0x244f0c){if(_0x244f0c['type'][_0xc967('0x47')]!==_0xc967('0x48')){var _0xc81803={};_0xc81803[_0x244f0c[_0xc967('0x49')]]={'$like':'%'+_0x32788e[_0xc967('0x3a')][_0xc967('0x4a')]+'%'};return _0xc81803;}})});}_0x5bd1d3=_[_0xc967('0x45')]({},_0x5bd1d3,_0x32788e[_0xc967('0x4b')]);var _0x1222fd={'where':_0x5bd1d3['where']};return db[_0xc967('0x4c')][_0xc967('0x4d')](_0x1222fd)[_0xc967('0x2f')](function(_0x28a6c9){_0x4e0c41['count']=_0x28a6c9;if(_0x32788e[_0xc967('0x3a')][_0xc967('0x4e')]){_0x5bd1d3['include']=[{'all':!![]}];}return db[_0xc967('0x4c')][_0xc967('0x4f')](_0x5bd1d3);})[_0xc967('0x2f')](function(_0x4369db){_0x4e0c41[_0xc967('0x50')]=_0x4369db;return _0x4e0c41;})[_0xc967('0x2f')](respondWithFilteredResult(_0x58b5c3,_0x5bd1d3))[_0xc967('0x24')](handleError(_0x58b5c3,null));};exports[_0xc967('0x51')]=function(_0x1cd833,_0x4c71fa){var _0x4b0c2f={'raw':![],'where':{'id':_0x1cd833[_0xc967('0x52')]['id']}},_0x4d32e9={};_0x4d32e9['model']=_['keys'](db[_0xc967('0x4c')]['rawAttributes']);_0x4d32e9[_0xc967('0x3a')]=_[_0xc967('0x53')](_0x1cd833['query']);_0x4d32e9['filters']=_['intersection'](_0x4d32e9[_0xc967('0x40')],_0x4d32e9[_0xc967('0x3a')]);_0x4b0c2f['attributes']=_[_0xc967('0x3c')](_0x4d32e9[_0xc967('0x40')],qs[_0xc967('0x3e')](_0x1cd833[_0xc967('0x3a')][_0xc967('0x3e')]));_0x4b0c2f[_0xc967('0x3d')]=_0x4b0c2f[_0xc967('0x3d')]['length']?_0x4b0c2f[_0xc967('0x3d')]:_0x4d32e9[_0xc967('0x40')];if(_0x1cd833[_0xc967('0x3a')][_0xc967('0x4e')]){_0x4b0c2f[_0xc967('0x54')]=[{'all':!![]}];}_0x4b0c2f=_['merge']({},_0x4b0c2f,_0x1cd833[_0xc967('0x4b')]);return db[_0xc967('0x4c')][_0xc967('0x55')](_0x4b0c2f)['then'](handleEntityNotFound(_0x4c71fa,null))[_0xc967('0x2f')](respondWithResult(_0x4c71fa,null))[_0xc967('0x24')](handleError(_0x4c71fa,null));};exports[_0xc967('0x56')]=function(_0x34fe6a,_0x3b6503,_0x5361b7){var _0x21c876;return db[_0xc967('0x4c')][_0xc967('0x56')](_0x34fe6a['body'],{'raw':!![]})[_0xc967('0x2f')](function(_0x327321){_0x21c876=_0x327321;return db['VoiceContext'][_0xc967('0x4f')]({'raw':!![]});})[_0xc967('0x2f')](function(_0x293bd7){var _0x55c976=fs[_0xc967('0x57')](path[_0xc967('0x58')](config[_0xc967('0x59')],_0xc967('0x5a')),_0xc967('0x5b'));var _0x4b3704=ejs[_0xc967('0x5c')](_0x55c976,{'contexts':_0x293bd7||[]});fs[_0xc967('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4b3704);})['then'](function(){return respondWithRpcPromise('Reload',_0xc967('0x56'),{'module':'chan_sip.so'});})[_0xc967('0x2f')](function(){var _0x2ae01a=_0x34fe6a[_0xc967('0x5e')][_0xc967('0x31')]({'plain':!![]});if(!_0x2ae01a)throw new Error(_0xc967('0x5f'));if(_0x2ae01a[_0xc967('0x60')]===_0xc967('0x5e')){var _0x2ba00e=_0x21c876[_0xc967('0x31')]({'plain':!![]});return db['UserProfileSection'][_0xc967('0x55')]({'where':{'name':_0xc967('0x61'),'userProfileId':_0x2ae01a[_0xc967('0x62')]},'raw':!![]})[_0xc967('0x2f')](function(_0x43dbc8){if(_0x43dbc8&&_0x43dbc8['autoAssociation']===0x0){return db[_0xc967('0x32')][_0xc967('0x56')]({'name':_0x2ba00e[_0xc967('0x36')],'resourceId':_0x2ba00e['id'],'type':_0x43dbc8[_0xc967('0x36')],'sectionId':_0x43dbc8['id']},{})[_0xc967('0x2f')](function(){return _0x21c876;});}else{return _0x21c876;}})[_0xc967('0x24')](function(_0x241d18){logger[_0xc967('0x20')](_0xc967('0x63'),_0x241d18);throw _0x241d18;});}return _0x21c876;})['then'](respondWithResult(_0x3b6503,0xc9))[_0xc967('0x24')](handleError(_0x3b6503,null));};exports[_0xc967('0x2e')]=function(_0xa80ccc,_0x2a6cdb,_0x219604){var _0x4e0e0;return db['VoiceContext'][_0xc967('0x55')]({'where':{'id':_0xa80ccc[_0xc967('0x52')]['id']}})[_0xc967('0x2f')](handleEntityNotFound(_0x2a6cdb,null))[_0xc967('0x2f')](saveUpdates(_0xa80ccc[_0xc967('0x64')],null))[_0xc967('0x2f')](function(_0x12bd63){if(_0x12bd63){_0x4e0e0=_0x12bd63;return db['VoiceContext'][_0xc967('0x4f')]({'raw':!![]});}})['then'](function(_0x204794){var _0x4a1b16=fs['readFileSync'](path[_0xc967('0x58')](config[_0xc967('0x59')],_0xc967('0x5a')),'utf8');var _0x7cf83a=ejs[_0xc967('0x5c')](_0x4a1b16,{'contexts':_0x204794||[]});fs[_0xc967('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x7cf83a);})[_0xc967('0x2f')](function(){return respondWithRpcPromise(_0xc967('0x65'),'update',{'module':_0xc967('0x66')});})[_0xc967('0x2f')](function(){return _0x4e0e0;})['then'](respondWithResult(_0x2a6cdb,null))[_0xc967('0x24')](handleError(_0x2a6cdb,null));};exports[_0xc967('0x30')]=function(_0x306e90,_0x5847cf,_0xec4414){var _0x4b46e2;return db[_0xc967('0x4c')][_0xc967('0x55')]({'where':{'id':_0x306e90[_0xc967('0x52')]['id']}})['then'](handleEntityNotFound(_0x5847cf,null))['then'](removeEntity(_0x5847cf,null))[_0xc967('0x2f')](function(){return db['VoiceContext'][_0xc967('0x4f')]({'raw':!![]});})[_0xc967('0x2f')](function(_0x3acacf){var _0x54c766=fs[_0xc967('0x57')](path[_0xc967('0x58')](config[_0xc967('0x59')],_0xc967('0x5a')),_0xc967('0x5b'));var _0x4791dc=ejs[_0xc967('0x5c')](_0x54c766,{'contexts':_0x3acacf});fs[_0xc967('0x5d')](_0xc967('0x67'),_0x4791dc);return respondWithRpcPromise(_0xc967('0x65'),_0xc967('0x30'),{'module':'chan_sip.so'});})['catch'](handleError(_0x5847cf,null));}; \ No newline at end of file +var _0x27e9=['../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','count','offset','limit','Content-Range','reject','update','then','destroy','UserProfileResource','end','sendStatus','stack','name','index','VoiceContext','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','findAll','show','params','options','create','body','readFileSync','root','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','utf8','writeFileSync','Reload','server/files/templates/context.ejs','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x2ad5d3,_0x26aca4){var _0x159004=function(_0x47d411){while(--_0x47d411){_0x2ad5d3['push'](_0x2ad5d3['shift']());}};_0x159004(++_0x26aca4);}(_0x27e9,0x116));var _0x927e=function(_0x462a67,_0x54d67e){_0x462a67=_0x462a67-0x0;var _0x450629=_0x27e9[_0x462a67];return _0x450629;};'use strict';var pdf=require(_0x927e('0x0'));var emlformat=require(_0x927e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x927e('0x2'));var jsonpatch=require(_0x927e('0x3'));var rp=require(_0x927e('0x4'));var moment=require(_0x927e('0x5'));var BPromise=require(_0x927e('0x6'));var Mustache=require(_0x927e('0x7'));var util=require('util');var path=require(_0x927e('0x8'));var sox=require(_0x927e('0x9'));var csv=require(_0x927e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x927e('0xb'));var squel=require(_0x927e('0xc'));var crypto=require(_0x927e('0xd'));var jsforce=require(_0x927e('0xe'));var deskjs=require(_0x927e('0xf'));var toCsv=require(_0x927e('0xa'));var querystring=require('querystring');var Papa=require(_0x927e('0x10'));var authService=require(_0x927e('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x927e('0x12'));var qs=require(_0x927e('0x13'));var logger=require(_0x927e('0x14'))(_0x927e('0x15'));var utils=require(_0x927e('0x16'));var config=require(_0x927e('0x17'));var db=require(_0x927e('0x18'))['db'];var jayson=require(_0x927e('0x19'));var client=jayson[_0x927e('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b21d7,_0x13e931,_0x3cd431,_0x3618be){return new BPromise(function(_0x4d0462,_0x2b71bd){var _0x56d7f4=_0x3618be||client;return _0x56d7f4[_0x927e('0x1b')](_0x2b21d7,_0x3cd431)['then'](function(_0x61e94d){logger['info'](_0x927e('0x1c'),_0x13e931,_0x927e('0x1d'));logger[_0x927e('0x1e')](_0x927e('0x1f'),_0x13e931,'request\x20sent',JSON[_0x927e('0x20')](_0x61e94d));if(_0x61e94d[_0x927e('0x21')]){if(_0x61e94d['error'][_0x927e('0x22')]===0x1f4){logger[_0x927e('0x21')](_0x927e('0x1c'),_0x13e931,_0x61e94d[_0x927e('0x21')][_0x927e('0x23')]);return _0x2b71bd(_0x61e94d[_0x927e('0x21')][_0x927e('0x23')]);}logger[_0x927e('0x21')](_0x927e('0x1c'),_0x13e931,_0x61e94d[_0x927e('0x21')][_0x927e('0x23')]);return _0x4d0462(_0x61e94d['error'][_0x927e('0x23')]);}else{logger[_0x927e('0x24')](_0x927e('0x1c'),_0x13e931,_0x927e('0x1d'));_0x4d0462(_0x61e94d[_0x927e('0x25')][_0x927e('0x23')]);}})[_0x927e('0x26')](function(_0x549940){logger[_0x927e('0x21')](_0x927e('0x1c'),_0x13e931,_0x549940);_0x2b71bd(_0x549940);});});}function respondWithStatusCode(_0x57b2ba,_0x4f1697){_0x4f1697=_0x4f1697||0xcc;return function(_0x693d09){if(_0x693d09){return _0x57b2ba['sendStatus'](_0x4f1697);}return _0x57b2ba[_0x927e('0x27')](_0x4f1697)['end']();};}function respondWithResult(_0x10d73c,_0x304894){_0x304894=_0x304894||0xc8;return function(_0x42fc8a){if(_0x42fc8a){return _0x10d73c[_0x927e('0x27')](_0x304894)[_0x927e('0x28')](_0x42fc8a);}};}function respondWithFilteredResult(_0x4eb597,_0x480f4d){return function(_0x40620a){if(_0x40620a){var _0x52c5de=_0x40620a[_0x927e('0x29')],_0x36d1e2=_0x480f4d[_0x927e('0x2a')],_0x4c592f=_0x480f4d['offset']+_0x480f4d[_0x927e('0x2b')],_0x2e3ace;if(_0x4c592f>=_0x52c5de){_0x4c592f=_0x52c5de;_0x2e3ace=0xc8;}else{_0x2e3ace=0xce;}_0x4eb597[_0x927e('0x27')](_0x2e3ace);return _0x4eb597['set'](_0x927e('0x2c'),_0x36d1e2+'-'+_0x4c592f+'/'+_0x52c5de)[_0x927e('0x28')](_0x40620a);}return null;};}function patchUpdates(_0x59031f){return function(_0x3a65f0){try{jsonpatch['apply'](_0x3a65f0,_0x59031f,!![]);}catch(_0x2b1e64){return BPromise[_0x927e('0x2d')](_0x2b1e64);}return _0x3a65f0['save']();};}function saveUpdates(_0x5b20f1,_0x4c1181){return function(_0x414785){if(_0x414785){return _0x414785[_0x927e('0x2e')](_0x5b20f1)[_0x927e('0x2f')](function(_0x25043b){return _0x25043b;});}return null;};}function removeEntity(_0x549018,_0x34051b){return function(_0x38bb22){if(_0x38bb22){return _0x38bb22[_0x927e('0x30')]()['then'](function(){var _0x421b06=_0x38bb22['get']({'plain':!![]});var _0x144c85='Contexts';return db[_0x927e('0x31')][_0x927e('0x30')]({'where':{'type':_0x144c85,'resourceId':_0x421b06['id']}})[_0x927e('0x2f')](function(){return _0x38bb22;});})[_0x927e('0x2f')](function(){_0x549018[_0x927e('0x27')](0xcc)[_0x927e('0x32')]();});}};}function handleEntityNotFound(_0x3e4894,_0x258fe8){return function(_0x2da595){if(!_0x2da595){_0x3e4894[_0x927e('0x33')](0x194);}return _0x2da595;};}function handleError(_0x242b4a,_0x5d67ee){_0x5d67ee=_0x5d67ee||0x1f4;return function(_0x3d99d4){logger[_0x927e('0x21')](_0x3d99d4[_0x927e('0x34')]);if(_0x3d99d4[_0x927e('0x35')]){delete _0x3d99d4['name'];}_0x242b4a[_0x927e('0x27')](_0x5d67ee)['send'](_0x3d99d4);};}exports[_0x927e('0x36')]=function(_0x108284,_0x40b7f1){var _0x398715={},_0x59eede={},_0x1d3bd2={'count':0x0,'rows':[]};var _0x50a3cf=db[_0x927e('0x37')][_0x927e('0x38')];_0x59eede[_0x927e('0x39')]=_['keys'](_0x50a3cf);_0x59eede[_0x927e('0x3a')]=_[_0x927e('0x3b')](_0x108284[_0x927e('0x3a')]);_0x59eede[_0x927e('0x3c')]=_[_0x927e('0x3d')](_0x59eede[_0x927e('0x39')],_0x59eede[_0x927e('0x3a')]);_0x398715['attributes']=_[_0x927e('0x3d')](_0x59eede[_0x927e('0x39')],qs['fields'](_0x108284[_0x927e('0x3a')][_0x927e('0x3e')]));_0x398715['attributes']=_0x398715[_0x927e('0x3f')][_0x927e('0x40')]?_0x398715[_0x927e('0x3f')]:_0x59eede[_0x927e('0x39')];if(!_0x108284[_0x927e('0x3a')][_0x927e('0x41')]('nolimit')){_0x398715[_0x927e('0x2b')]=qs[_0x927e('0x2b')](_0x108284['query'][_0x927e('0x2b')]);_0x398715[_0x927e('0x2a')]=qs[_0x927e('0x2a')](_0x108284[_0x927e('0x3a')]['offset']);}_0x398715['order']=qs['sort'](_0x108284[_0x927e('0x3a')]['sort']);_0x398715[_0x927e('0x42')]=qs[_0x927e('0x3c')](_[_0x927e('0x43')](_0x108284[_0x927e('0x3a')],_0x59eede[_0x927e('0x3c')]));if(_0x108284[_0x927e('0x3a')][_0x927e('0x44')]){_0x398715[_0x927e('0x42')]=_['merge'](_0x398715[_0x927e('0x42')],{'$or':_[_0x927e('0x45')](_0x50a3cf,function(_0x2f24b4){if(_0x2f24b4[_0x927e('0x46')][_0x927e('0x47')]!==_0x927e('0x48')){var _0x4a3b15={};_0x4a3b15[_0x2f24b4[_0x927e('0x49')]]={'$like':'%'+_0x108284[_0x927e('0x3a')]['filter']+'%'};return _0x4a3b15;}})});}_0x398715=_[_0x927e('0x4a')]({},_0x398715,_0x108284['options']);var _0x4b8cb8={'where':_0x398715[_0x927e('0x42')]};return db['VoiceContext'][_0x927e('0x29')](_0x4b8cb8)[_0x927e('0x2f')](function(_0x2ca5a4){_0x1d3bd2[_0x927e('0x29')]=_0x2ca5a4;if(_0x108284[_0x927e('0x3a')][_0x927e('0x4b')]){_0x398715[_0x927e('0x4c')]=[{'all':!![]}];}return db['VoiceContext'][_0x927e('0x4d')](_0x398715);})['then'](function(_0x18e438){_0x1d3bd2['rows']=_0x18e438;return _0x1d3bd2;})['then'](respondWithFilteredResult(_0x40b7f1,_0x398715))['catch'](handleError(_0x40b7f1,null));};exports[_0x927e('0x4e')]=function(_0x180b32,_0x10c59c){var _0x260b9c={'raw':![],'where':{'id':_0x180b32[_0x927e('0x4f')]['id']}},_0x1f7303={};_0x1f7303['model']=_[_0x927e('0x3b')](db[_0x927e('0x37')][_0x927e('0x38')]);_0x1f7303[_0x927e('0x3a')]=_[_0x927e('0x3b')](_0x180b32[_0x927e('0x3a')]);_0x1f7303[_0x927e('0x3c')]=_[_0x927e('0x3d')](_0x1f7303[_0x927e('0x39')],_0x1f7303[_0x927e('0x3a')]);_0x260b9c[_0x927e('0x3f')]=_[_0x927e('0x3d')](_0x1f7303[_0x927e('0x39')],qs[_0x927e('0x3e')](_0x180b32[_0x927e('0x3a')][_0x927e('0x3e')]));_0x260b9c[_0x927e('0x3f')]=_0x260b9c[_0x927e('0x3f')]['length']?_0x260b9c[_0x927e('0x3f')]:_0x1f7303[_0x927e('0x39')];if(_0x180b32[_0x927e('0x3a')]['includeAll']){_0x260b9c[_0x927e('0x4c')]=[{'all':!![]}];}_0x260b9c=_[_0x927e('0x4a')]({},_0x260b9c,_0x180b32[_0x927e('0x50')]);return db[_0x927e('0x37')]['find'](_0x260b9c)[_0x927e('0x2f')](handleEntityNotFound(_0x10c59c,null))['then'](respondWithResult(_0x10c59c,null))['catch'](handleError(_0x10c59c,null));};exports['create']=function(_0x5b415d,_0xf238bd,_0x4c1cec){var _0xad2cc0;return db[_0x927e('0x37')][_0x927e('0x51')](_0x5b415d[_0x927e('0x52')],{'raw':!![]})[_0x927e('0x2f')](function(_0x493324){_0xad2cc0=_0x493324;return db[_0x927e('0x37')][_0x927e('0x4d')]({'raw':!![]});})[_0x927e('0x2f')](function(_0x50ad9b){var _0x345988=fs[_0x927e('0x53')](path['join'](config[_0x927e('0x54')],'server/files/templates/context.ejs'),'utf8');var _0x3a7e4c=ejs[_0x927e('0x55')](_0x345988,{'contexts':_0x50ad9b||[]});fs['writeFileSync'](_0x927e('0x56'),_0x3a7e4c);})[_0x927e('0x2f')](function(){return respondWithRpcPromise('Reload',_0x927e('0x51'),{'module':_0x927e('0x57')});})[_0x927e('0x2f')](function(){var _0x13988e=_0x5b415d[_0x927e('0x58')][_0x927e('0x59')]({'plain':!![]});if(!_0x13988e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13988e['role']==='user'){var _0x5d25e3=_0xad2cc0[_0x927e('0x59')]({'plain':!![]});return db[_0x927e('0x5a')]['find']({'where':{'name':_0x927e('0x5b'),'userProfileId':_0x13988e[_0x927e('0x5c')]},'raw':!![]})['then'](function(_0xebbc5c){if(_0xebbc5c&&_0xebbc5c[_0x927e('0x5d')]===0x0){return db[_0x927e('0x31')][_0x927e('0x51')]({'name':_0x5d25e3[_0x927e('0x35')],'resourceId':_0x5d25e3['id'],'type':_0xebbc5c[_0x927e('0x35')],'sectionId':_0xebbc5c['id']},{})[_0x927e('0x2f')](function(){return _0xad2cc0;});}else{return _0xad2cc0;}})[_0x927e('0x26')](function(_0x43a517){logger[_0x927e('0x21')](_0x927e('0x5e'),_0x43a517);throw _0x43a517;});}return _0xad2cc0;})['then'](respondWithResult(_0xf238bd,0xc9))[_0x927e('0x26')](handleError(_0xf238bd,null));};exports[_0x927e('0x2e')]=function(_0x5dd1f6,_0x199946,_0x514b29){var _0x5262dd;return db[_0x927e('0x37')]['find']({'where':{'id':_0x5dd1f6[_0x927e('0x4f')]['id']}})[_0x927e('0x2f')](handleEntityNotFound(_0x199946,null))[_0x927e('0x2f')](saveUpdates(_0x5dd1f6[_0x927e('0x52')],null))[_0x927e('0x2f')](function(_0x6859e8){if(_0x6859e8){_0x5262dd=_0x6859e8;return db[_0x927e('0x37')][_0x927e('0x4d')]({'raw':!![]});}})[_0x927e('0x2f')](function(_0x10fc61){var _0x1a5694=fs['readFileSync'](path[_0x927e('0x5f')](config[_0x927e('0x54')],'server/files/templates/context.ejs'),_0x927e('0x60'));var _0x555289=ejs[_0x927e('0x55')](_0x1a5694,{'contexts':_0x10fc61||[]});fs[_0x927e('0x61')](_0x927e('0x56'),_0x555289);})[_0x927e('0x2f')](function(){return respondWithRpcPromise(_0x927e('0x62'),'update',{'module':_0x927e('0x57')});})[_0x927e('0x2f')](function(){return _0x5262dd;})['then'](respondWithResult(_0x199946,null))['catch'](handleError(_0x199946,null));};exports['destroy']=function(_0x2f7523,_0x253e5e,_0x15fe18){var _0x444e4f;return db['VoiceContext']['find']({'where':{'id':_0x2f7523[_0x927e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x253e5e,null))[_0x927e('0x2f')](removeEntity(_0x253e5e,null))[_0x927e('0x2f')](function(){return db[_0x927e('0x37')][_0x927e('0x4d')]({'raw':!![]});})[_0x927e('0x2f')](function(_0x4db4d6){var _0x199102=fs[_0x927e('0x53')](path[_0x927e('0x5f')](config[_0x927e('0x54')],_0x927e('0x63')),_0x927e('0x60'));var _0x2d5074=ejs['render'](_0x199102,{'contexts':_0x4db4d6});fs[_0x927e('0x61')](_0x927e('0x56'),_0x2d5074);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x927e('0x26')](handleError(_0x253e5e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7d59518..c702171 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 _0x6377=['../../config/logger','api','moment','bluebird','request-promise','./voiceContext.attributes','lodash','util'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x6377,0xf6));var _0x7637=function(_0x47f670,_0x43e9f6){_0x47f670=_0x47f670-0x0;var _0x66e790=_0x6377[_0x47f670];return _0x66e790;};'use strict';var _=require(_0x7637('0x0'));var util=require(_0x7637('0x1'));var logger=require(_0x7637('0x2'))(_0x7637('0x3'));var moment=require(_0x7637('0x4'));var BPromise=require(_0x7637('0x5'));var rp=require(_0x7637('0x6'));var attributes=require(_0x7637('0x7'));module['exports']=function(_0xea1a68,_0x252a19){return _0xea1a68['define']('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df9=['./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','moment','bluebird'];(function(_0xde43c2,_0x4f6a35){var _0x37a763=function(_0x87d988){while(--_0x87d988){_0xde43c2['push'](_0xde43c2['shift']());}};_0x37a763(++_0x4f6a35);}(_0x6df9,0x13f));var _0x96df=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6df9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x96df('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x96df('0x1'));var BPromise=require(_0x96df('0x2'));var rp=require('request-promise');var attributes=require(_0x96df('0x3'));module['exports']=function(_0x5ccf80,_0x6d5c4a){return _0x5ccf80[_0x96df('0x4')](_0x96df('0x5'),attributes,{'tableName':_0x96df('0x6'),'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 46af98f..72c4c21 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 _0x5ff2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5ff2,0x130));var _0x25ff=function(_0x451539,_0x4ddef2){_0x451539=_0x451539-0x0;var _0x290fd9=_0x5ff2[_0x451539];return _0x290fd9;};'use strict';var _=require('lodash');var util=require(_0x25ff('0x0'));var moment=require(_0x25ff('0x1'));var BPromise=require(_0x25ff('0x2'));var rs=require(_0x25ff('0x3'));var fs=require('fs');var Redis=require(_0x25ff('0x4'));var db=require(_0x25ff('0x5'))['db'];var utils=require(_0x25ff('0x6'));var logger=require(_0x25ff('0x7'))('rpc');var config=require(_0x25ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25ff('0x9')][_0x25ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f6e83,_0x190f99,_0x34f3ce){return new BPromise(function(_0x38d919,_0x406dfb){return client[_0x25ff('0xb')](_0x2f6e83,_0x34f3ce)[_0x25ff('0xc')](function(_0x4adfa3){logger[_0x25ff('0xd')]('VoiceContext,\x20%s,\x20%s',_0x190f99,_0x25ff('0xe'));logger[_0x25ff('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x190f99,_0x25ff('0xe'),JSON[_0x25ff('0x10')](_0x4adfa3));if(_0x4adfa3[_0x25ff('0x11')]){if(_0x4adfa3[_0x25ff('0x11')][_0x25ff('0x12')]===0x1f4){logger['error'](_0x25ff('0x13'),_0x190f99,_0x4adfa3[_0x25ff('0x11')][_0x25ff('0x14')]);return _0x406dfb(_0x4adfa3[_0x25ff('0x11')][_0x25ff('0x14')]);}logger[_0x25ff('0x11')]('VoiceContext,\x20%s,\x20%s',_0x190f99,_0x4adfa3[_0x25ff('0x11')][_0x25ff('0x14')]);return _0x38d919(_0x4adfa3[_0x25ff('0x11')][_0x25ff('0x14')]);}else{logger[_0x25ff('0xd')](_0x25ff('0x13'),_0x190f99,_0x25ff('0xe'));_0x38d919(_0x4adfa3['result']['message']);}})[_0x25ff('0x15')](function(_0x9f69b9){logger[_0x25ff('0x11')]('VoiceContext,\x20%s,\x20%s',_0x190f99,_0x9f69b9);_0x406dfb(_0x9f69b9);});});} \ No newline at end of file +var _0xc47a=['result','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x4abd5d,_0x16c6ca){var _0x3d690f=function(_0x373c47){while(--_0x373c47){_0x4abd5d['push'](_0x4abd5d['shift']());}};_0x3d690f(++_0x16c6ca);}(_0xc47a,0xde));var _0xac47=function(_0x164edf,_0x49303a){_0x164edf=_0x164edf-0x0;var _0x5a34bf=_0xc47a[_0x164edf];return _0x5a34bf;};'use strict';var _=require(_0xac47('0x0'));var util=require('util');var moment=require(_0xac47('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac47('0x2'));var db=require(_0xac47('0x3'))['db'];var utils=require(_0xac47('0x4'));var logger=require('../../config/logger')(_0xac47('0x5'));var config=require('../../config/environment');var jayson=require(_0xac47('0x6'));var client=jayson['client'][_0xac47('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57ce70,_0x121936,_0x4b5213){return new BPromise(function(_0x126a70,_0x4db5f5){return client[_0xac47('0x8')](_0x57ce70,_0x4b5213)['then'](function(_0x96dbae){logger[_0xac47('0x9')](_0xac47('0xa'),_0x121936,'request\x20sent');logger['debug'](_0xac47('0xb'),_0x121936,_0xac47('0xc'),JSON[_0xac47('0xd')](_0x96dbae));if(_0x96dbae[_0xac47('0xe')]){if(_0x96dbae[_0xac47('0xe')]['code']===0x1f4){logger['error'](_0xac47('0xa'),_0x121936,_0x96dbae[_0xac47('0xe')]['message']);return _0x4db5f5(_0x96dbae['error'][_0xac47('0xf')]);}logger['error'](_0xac47('0xa'),_0x121936,_0x96dbae['error']['message']);return _0x126a70(_0x96dbae[_0xac47('0xe')][_0xac47('0xf')]);}else{logger[_0xac47('0x9')](_0xac47('0xa'),_0x121936,_0xac47('0xc'));_0x126a70(_0x96dbae[_0xac47('0x10')][_0xac47('0xf')]);}})['catch'](function(_0x124236){logger[_0xac47('0xe')](_0xac47('0xa'),_0x121936,_0x124236);_0x4db5f5(_0x124236);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c0ebd9b..b4484e9 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 _0x12cf=['update','destroy','exports','multer','util','express','Router','./voiceDialReport.controller','isAuthenticated','describe','get','/:id','show','post','create'];(function(_0x3b0c33,_0xe9aeb1){var _0x51f2ec=function(_0x10db13){while(--_0x10db13){_0x3b0c33['push'](_0x3b0c33['shift']());}};_0x51f2ec(++_0xe9aeb1);}(_0x12cf,0x1a7));var _0xf12c=function(_0x3285e3,_0x31b525){_0x3285e3=_0x3285e3-0x0;var _0x4d1162=_0x12cf[_0x3285e3];return _0x4d1162;};'use strict';var multer=require(_0xf12c('0x0'));var util=require(_0xf12c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf12c('0x2'));var router=express[_0xf12c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf12c('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xf12c('0x5')](),controller[_0xf12c('0x6')]);router[_0xf12c('0x7')](_0xf12c('0x8'),auth[_0xf12c('0x5')](),controller[_0xf12c('0x9')]);router[_0xf12c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf12c('0xb')]);router['put']('/:id',auth[_0xf12c('0x5')](),controller[_0xf12c('0xc')]);router['delete'](_0xf12c('0x8'),auth[_0xf12c('0x5')](),controller[_0xf12c('0xd')]);module[_0xf12c('0xe')]=router; \ No newline at end of file +var _0x7d8c=['index','describe','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated'];(function(_0x27d74e,_0x46f312){var _0x13ddf9=function(_0x4005a2){while(--_0x4005a2){_0x27d74e['push'](_0x27d74e['shift']());}};_0x13ddf9(++_0x46f312);}(_0x7d8c,0x14b));var _0xc7d8=function(_0x3069e6,_0x2de482){_0x3069e6=_0x3069e6-0x0;var _0x225b32=_0x7d8c[_0x3069e6];return _0x225b32;};'use strict';var multer=require(_0xc7d8('0x0'));var util=require(_0xc7d8('0x1'));var path=require(_0xc7d8('0x2'));var timeout=require(_0xc7d8('0x3'));var express=require('express');var router=express[_0xc7d8('0x4')]();var auth=require(_0xc7d8('0x5'));var interaction=require(_0xc7d8('0x6'));var config=require(_0xc7d8('0x7'));var controller=require(_0xc7d8('0x8'));router[_0xc7d8('0x9')]('/',auth[_0xc7d8('0xa')](),controller[_0xc7d8('0xb')]);router[_0xc7d8('0x9')]('/describe',auth[_0xc7d8('0xa')](),controller[_0xc7d8('0xc')]);router['get'](_0xc7d8('0xd'),auth[_0xc7d8('0xa')](),controller['show']);router['post']('/',auth[_0xc7d8('0xa')](),controller[_0xc7d8('0xe')]);router[_0xc7d8('0xf')](_0xc7d8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc7d8('0x10')](_0xc7d8('0xd'),auth[_0xc7d8('0xa')](),controller[_0xc7d8('0x11')]);module[_0xc7d8('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 71ba094..08ff09e 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 _0x069c=['INTEGER','DATE','sequelize','STRING'];(function(_0x54d4a1,_0x27bd5f){var _0x4d1ad7=function(_0x4a5e25){while(--_0x4a5e25){_0x54d4a1['push'](_0x54d4a1['shift']());}};_0x4d1ad7(++_0x27bd5f);}(_0x069c,0x86));var _0xc069=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x069c[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0xc069('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xc069('0x1')]},'channel':{'type':Sequelize[_0xc069('0x1')]},'channelstate':{'type':Sequelize[_0xc069('0x2')]},'channelstatedesc':{'type':Sequelize[_0xc069('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc069('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc069('0x1')]},'connectedlinename':{'type':Sequelize[_0xc069('0x1')]},'language':{'type':Sequelize[_0xc069('0x1')]},'accountcode':{'type':Sequelize[_0xc069('0x1')]},'context':{'type':Sequelize[_0xc069('0x1')]},'exten':{'type':Sequelize[_0xc069('0x1')]},'priority':{'type':Sequelize[_0xc069('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc069('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xc069('0x1')]},'destcalleridnum':{'type':Sequelize[_0xc069('0x1')]},'destcalleridname':{'type':Sequelize[_0xc069('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xc069('0x1')]},'destaccountcode':{'type':Sequelize[_0xc069('0x1')]},'destcontext':{'type':Sequelize[_0xc069('0x1')]},'destexten':{'type':Sequelize[_0xc069('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0xc069('0x1')]},'dialstring':{'type':Sequelize[_0xc069('0x1')]},'dialstatus':{'type':Sequelize[_0xc069('0x1')]},'starttime':{'type':Sequelize[_0xc069('0x3')]},'answertime':{'type':Sequelize[_0xc069('0x3')]},'endtime':{'type':Sequelize[_0xc069('0x3')]},'lastevent':{'type':Sequelize[_0xc069('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc069('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc069('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbf57=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x5a84d7,_0x2c4a68){var _0x40f065=function(_0x2e2513){while(--_0x2e2513){_0x5a84d7['push'](_0x5a84d7['shift']());}};_0x40f065(++_0x2c4a68);}(_0xbf57,0x1bf));var _0x7bf5=function(_0xbcb4bf,_0x5296ed){_0xbcb4bf=_0xbcb4bf-0x0;var _0x3932b3=_0xbf57[_0xbcb4bf];return _0x3932b3;};'use strict';var Sequelize=require('sequelize');module[_0x7bf5('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7bf5('0x1')]},'channelstate':{'type':Sequelize[_0x7bf5('0x2')]},'channelstatedesc':{'type':Sequelize[_0x7bf5('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7bf5('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7bf5('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7bf5('0x1')]},'context':{'type':Sequelize[_0x7bf5('0x1')]},'exten':{'type':Sequelize[_0x7bf5('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x7bf5('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7bf5('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x7bf5('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7bf5('0x1')]},'destcalleridname':{'type':Sequelize[_0x7bf5('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7bf5('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7bf5('0x1')]},'destlanguage':{'type':Sequelize[_0x7bf5('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x7bf5('0x1')]},'destexten':{'type':Sequelize[_0x7bf5('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x7bf5('0x1')]},'dialstring':{'type':Sequelize[_0x7bf5('0x1')]},'dialstatus':{'type':Sequelize[_0x7bf5('0x1')]},'starttime':{'type':Sequelize[_0x7bf5('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x7bf5('0x4')},'routeId':{'type':Sequelize[_0x7bf5('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7bf5('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 7363c9b..9c40c18 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 _0x3b97=['sort','where','filter','merge','map','type','key','VIRTUAL','field','options','VoiceDialReport','include','findAll','show','params','includeAll','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','order'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0x3b97,0xa9));var _0x73b9=function(_0x4468fd,_0x2b0be1){_0x4468fd=_0x4468fd-0x0;var _0x30c435=_0x3b97[_0x4468fd];return _0x30c435;};'use strict';var pdf=require(_0x73b9('0x0'));var emlformat=require(_0x73b9('0x1'));var rimraf=require(_0x73b9('0x2'));var zipdir=require(_0x73b9('0x3'));var jsonpatch=require(_0x73b9('0x4'));var rp=require(_0x73b9('0x5'));var moment=require(_0x73b9('0x6'));var BPromise=require(_0x73b9('0x7'));var Mustache=require(_0x73b9('0x8'));var util=require(_0x73b9('0x9'));var path=require(_0x73b9('0xa'));var sox=require(_0x73b9('0xb'));var csv=require(_0x73b9('0xc'));var ejs=require(_0x73b9('0xd'));var fs=require('fs');var _=require(_0x73b9('0xe'));var squel=require(_0x73b9('0xf'));var crypto=require('crypto');var jsforce=require(_0x73b9('0x10'));var deskjs=require(_0x73b9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x73b9('0x12'));var Papa=require(_0x73b9('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0x73b9('0x14'));var Redis=require('ioredis');var qs=require(_0x73b9('0x15'));var logger=require(_0x73b9('0x16'))(_0x73b9('0x17'));var utils=require('../../config/utils');var config=require(_0x73b9('0x18'));var db=require(_0x73b9('0x19'))['db'];function respondWithStatusCode(_0x112bf4,_0x3f9787){_0x3f9787=_0x3f9787||0xcc;return function(_0x40bbb6){if(_0x40bbb6){return _0x112bf4[_0x73b9('0x1a')](_0x3f9787);}return _0x112bf4[_0x73b9('0x1b')](_0x3f9787)[_0x73b9('0x1c')]();};}function respondWithResult(_0x18eb1f,_0x34ec77){_0x34ec77=_0x34ec77||0xc8;return function(_0x359cbf){if(_0x359cbf){return _0x18eb1f[_0x73b9('0x1b')](_0x34ec77)['json'](_0x359cbf);}};}function respondWithFilteredResult(_0x5a7f27,_0x1dc0b2){return function(_0x559541){if(_0x559541){var _0x4714d3=_0x559541[_0x73b9('0x1d')],_0x160995=_0x1dc0b2[_0x73b9('0x1e')],_0x3a1270=_0x1dc0b2[_0x73b9('0x1e')]+_0x1dc0b2[_0x73b9('0x1f')],_0x2bf974;if(_0x3a1270>=_0x4714d3){_0x3a1270=_0x4714d3;_0x2bf974=0xc8;}else{_0x2bf974=0xce;}_0x5a7f27[_0x73b9('0x1b')](_0x2bf974);return _0x5a7f27[_0x73b9('0x20')]('Content-Range',_0x160995+'-'+_0x3a1270+'/'+_0x4714d3)[_0x73b9('0x21')](_0x559541);}return null;};}function patchUpdates(_0x1b7337){return function(_0x835b06){try{jsonpatch[_0x73b9('0x22')](_0x835b06,_0x1b7337,!![]);}catch(_0x33935c){return BPromise[_0x73b9('0x23')](_0x33935c);}return _0x835b06[_0x73b9('0x24')]();};}function saveUpdates(_0x1b9151,_0xe00943){return function(_0x42a3cb){if(_0x42a3cb){return _0x42a3cb[_0x73b9('0x25')](_0x1b9151)[_0x73b9('0x26')](function(_0x176a7b){return _0x176a7b;});}return null;};}function removeEntity(_0x1d7007,_0x20d87a){return function(_0x1f19fb){if(_0x1f19fb){return _0x1f19fb[_0x73b9('0x27')]()[_0x73b9('0x26')](function(){_0x1d7007[_0x73b9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a68be,_0x4334c1){return function(_0x1337dc){if(!_0x1337dc){_0x3a68be[_0x73b9('0x1a')](0x194);}return _0x1337dc;};}function handleError(_0x258cf8,_0x4707db){_0x4707db=_0x4707db||0x1f4;return function(_0x257da1){logger['error'](_0x257da1[_0x73b9('0x28')]);if(_0x257da1[_0x73b9('0x29')]){delete _0x257da1[_0x73b9('0x29')];}_0x258cf8[_0x73b9('0x1b')](_0x4707db)[_0x73b9('0x2a')](_0x257da1);};}exports[_0x73b9('0x2b')]=function(_0x480165,_0xcc86fe){var _0x564473={},_0xb9a1f2={},_0x4f3d1e={'count':0x0,'rows':[]};var _0x1bf9f9=db['VoiceDialReport'][_0x73b9('0x2c')];_0xb9a1f2[_0x73b9('0x2d')]=_[_0x73b9('0x2e')](_0x1bf9f9);_0xb9a1f2[_0x73b9('0x2f')]=_[_0x73b9('0x2e')](_0x480165[_0x73b9('0x2f')]);_0xb9a1f2[_0x73b9('0x30')]=_[_0x73b9('0x31')](_0xb9a1f2[_0x73b9('0x2d')],_0xb9a1f2['query']);_0x564473[_0x73b9('0x32')]=_['intersection'](_0xb9a1f2[_0x73b9('0x2d')],qs['fields'](_0x480165[_0x73b9('0x2f')][_0x73b9('0x33')]));_0x564473[_0x73b9('0x32')]=_0x564473['attributes']['length']?_0x564473[_0x73b9('0x32')]:_0xb9a1f2['model'];if(!_0x480165[_0x73b9('0x2f')]['hasOwnProperty']('nolimit')){_0x564473[_0x73b9('0x1f')]=qs[_0x73b9('0x1f')](_0x480165[_0x73b9('0x2f')][_0x73b9('0x1f')]);_0x564473[_0x73b9('0x1e')]=qs[_0x73b9('0x1e')](_0x480165[_0x73b9('0x2f')][_0x73b9('0x1e')]);}_0x564473[_0x73b9('0x34')]=qs[_0x73b9('0x35')](_0x480165['query']['sort']);_0x564473[_0x73b9('0x36')]=qs[_0x73b9('0x30')](_['pick'](_0x480165[_0x73b9('0x2f')],_0xb9a1f2[_0x73b9('0x30')]));if(_0x480165[_0x73b9('0x2f')][_0x73b9('0x37')]){_0x564473['where']=_[_0x73b9('0x38')](_0x564473['where'],{'$or':_[_0x73b9('0x39')](_0x1bf9f9,function(_0x508e57){if(_0x508e57[_0x73b9('0x3a')][_0x73b9('0x3b')]!==_0x73b9('0x3c')){var _0x3decb4={};_0x3decb4[_0x508e57[_0x73b9('0x3d')]]={'$like':'%'+_0x480165[_0x73b9('0x2f')][_0x73b9('0x37')]+'%'};return _0x3decb4;}})});}_0x564473=_[_0x73b9('0x38')]({},_0x564473,_0x480165[_0x73b9('0x3e')]);var _0xb6ae89={'where':_0x564473[_0x73b9('0x36')]};return db[_0x73b9('0x3f')][_0x73b9('0x1d')](_0xb6ae89)['then'](function(_0x594b3d){_0x4f3d1e[_0x73b9('0x1d')]=_0x594b3d;if(_0x480165[_0x73b9('0x2f')]['includeAll']){_0x564473[_0x73b9('0x40')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x73b9('0x41')](_0x564473);})[_0x73b9('0x26')](function(_0x16a5dd){_0x4f3d1e['rows']=_0x16a5dd;return _0x4f3d1e;})[_0x73b9('0x26')](respondWithFilteredResult(_0xcc86fe,_0x564473))['catch'](handleError(_0xcc86fe,null));};exports[_0x73b9('0x42')]=function(_0x52af06,_0x1ac7a7){var _0x209252={'raw':!![],'where':{'id':_0x52af06[_0x73b9('0x43')]['id']}},_0xb5179b={};_0xb5179b['model']=_['keys'](db[_0x73b9('0x3f')]['rawAttributes']);_0xb5179b[_0x73b9('0x2f')]=_[_0x73b9('0x2e')](_0x52af06[_0x73b9('0x2f')]);_0xb5179b[_0x73b9('0x30')]=_[_0x73b9('0x31')](_0xb5179b[_0x73b9('0x2d')],_0xb5179b['query']);_0x209252[_0x73b9('0x32')]=_[_0x73b9('0x31')](_0xb5179b[_0x73b9('0x2d')],qs['fields'](_0x52af06[_0x73b9('0x2f')][_0x73b9('0x33')]));_0x209252[_0x73b9('0x32')]=_0x209252[_0x73b9('0x32')]['length']?_0x209252[_0x73b9('0x32')]:_0xb5179b[_0x73b9('0x2d')];if(_0x52af06[_0x73b9('0x2f')][_0x73b9('0x44')]){_0x209252[_0x73b9('0x40')]=[{'all':!![]}];}_0x209252=_[_0x73b9('0x38')]({},_0x209252,_0x52af06[_0x73b9('0x3e')]);return db[_0x73b9('0x3f')][_0x73b9('0x45')](_0x209252)[_0x73b9('0x26')](handleEntityNotFound(_0x1ac7a7,null))[_0x73b9('0x26')](respondWithResult(_0x1ac7a7,null))[_0x73b9('0x46')](handleError(_0x1ac7a7,null));};exports[_0x73b9('0x47')]=function(_0x1d0170,_0x4ad894){return db[_0x73b9('0x3f')][_0x73b9('0x47')](_0x1d0170['body'],{})[_0x73b9('0x26')](respondWithResult(_0x4ad894,0xc9))['catch'](handleError(_0x4ad894,null));};exports[_0x73b9('0x25')]=function(_0x3b950b,_0x441850){if(_0x3b950b[_0x73b9('0x48')]['id']){delete _0x3b950b['body']['id'];}return db[_0x73b9('0x3f')]['find']({'where':{'id':_0x3b950b[_0x73b9('0x43')]['id']}})[_0x73b9('0x26')](handleEntityNotFound(_0x441850,null))[_0x73b9('0x26')](saveUpdates(_0x3b950b['body'],null))['then'](respondWithResult(_0x441850,null))[_0x73b9('0x46')](handleError(_0x441850,null));};exports[_0x73b9('0x27')]=function(_0x172d1f,_0x1517a7){return db[_0x73b9('0x3f')][_0x73b9('0x45')]({'where':{'id':_0x172d1f[_0x73b9('0x43')]['id']}})[_0x73b9('0x26')](handleEntityNotFound(_0x1517a7,null))[_0x73b9('0x26')](removeEntity(_0x1517a7,null))[_0x73b9('0x46')](handleError(_0x1517a7,null));};exports['describe']=function(_0x584f43,_0x4b45ef){return db[_0x73b9('0x3f')][_0x73b9('0x49')]()['then'](respondWithResult(_0x4b45ef,null))[_0x73b9('0x46')](handleError(_0x4b45ef,null));}; \ No newline at end of file +var _0xc8b4=['sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xc8b4,0xa9));var _0x4c8b=function(_0x51704a,_0x2df191){_0x51704a=_0x51704a-0x0;var _0x54a9bc=_0xc8b4[_0x51704a];return _0x54a9bc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4c8b('0x0'));var rimraf=require(_0x4c8b('0x1'));var zipdir=require(_0x4c8b('0x2'));var jsonpatch=require(_0x4c8b('0x3'));var rp=require(_0x4c8b('0x4'));var moment=require('moment');var BPromise=require(_0x4c8b('0x5'));var Mustache=require(_0x4c8b('0x6'));var util=require(_0x4c8b('0x7'));var path=require(_0x4c8b('0x8'));var sox=require(_0x4c8b('0x9'));var csv=require(_0x4c8b('0xa'));var ejs=require(_0x4c8b('0xb'));var fs=require('fs');var _=require(_0x4c8b('0xc'));var squel=require(_0x4c8b('0xd'));var crypto=require(_0x4c8b('0xe'));var jsforce=require(_0x4c8b('0xf'));var deskjs=require(_0x4c8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4c8b('0x11'));var Papa=require(_0x4c8b('0x12'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4c8b('0x13'));var qs=require(_0x4c8b('0x14'));var logger=require('../../config/logger')(_0x4c8b('0x15'));var utils=require(_0x4c8b('0x16'));var config=require(_0x4c8b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x555f28,_0x4aeec8){_0x4aeec8=_0x4aeec8||0xcc;return function(_0x3e60f1){if(_0x3e60f1){return _0x555f28['sendStatus'](_0x4aeec8);}return _0x555f28[_0x4c8b('0x18')](_0x4aeec8)[_0x4c8b('0x19')]();};}function respondWithResult(_0x4f92b5,_0x199bb8){_0x199bb8=_0x199bb8||0xc8;return function(_0x52fe1a){if(_0x52fe1a){return _0x4f92b5[_0x4c8b('0x18')](_0x199bb8)[_0x4c8b('0x1a')](_0x52fe1a);}};}function respondWithFilteredResult(_0x2d976,_0x59aeb3){return function(_0x574ec4){if(_0x574ec4){var _0x278392=_0x574ec4[_0x4c8b('0x1b')],_0x3fa1fd=_0x59aeb3[_0x4c8b('0x1c')],_0x4a3f23=_0x59aeb3[_0x4c8b('0x1c')]+_0x59aeb3[_0x4c8b('0x1d')],_0x3fdcd3;if(_0x4a3f23>=_0x278392){_0x4a3f23=_0x278392;_0x3fdcd3=0xc8;}else{_0x3fdcd3=0xce;}_0x2d976[_0x4c8b('0x18')](_0x3fdcd3);return _0x2d976[_0x4c8b('0x1e')](_0x4c8b('0x1f'),_0x3fa1fd+'-'+_0x4a3f23+'/'+_0x278392)[_0x4c8b('0x1a')](_0x574ec4);}return null;};}function patchUpdates(_0x2addd4){return function(_0x4c4760){try{jsonpatch[_0x4c8b('0x20')](_0x4c4760,_0x2addd4,!![]);}catch(_0x37042f){return BPromise[_0x4c8b('0x21')](_0x37042f);}return _0x4c4760['save']();};}function saveUpdates(_0xaa353b,_0x42c752){return function(_0x56a52b){if(_0x56a52b){return _0x56a52b[_0x4c8b('0x22')](_0xaa353b)[_0x4c8b('0x23')](function(_0x379d4c){return _0x379d4c;});}return null;};}function removeEntity(_0x565f50,_0x160b5c){return function(_0x547c7b){if(_0x547c7b){return _0x547c7b[_0x4c8b('0x24')]()[_0x4c8b('0x23')](function(){_0x565f50[_0x4c8b('0x18')](0xcc)[_0x4c8b('0x19')]();});}};}function handleEntityNotFound(_0x4150ea,_0xcfd54){return function(_0x6bd2cb){if(!_0x6bd2cb){_0x4150ea['sendStatus'](0x194);}return _0x6bd2cb;};}function handleError(_0x51fd3c,_0x355b30){_0x355b30=_0x355b30||0x1f4;return function(_0x22478c){logger[_0x4c8b('0x25')](_0x22478c[_0x4c8b('0x26')]);if(_0x22478c[_0x4c8b('0x27')]){delete _0x22478c[_0x4c8b('0x27')];}_0x51fd3c['status'](_0x355b30)[_0x4c8b('0x28')](_0x22478c);};}exports['index']=function(_0x50b2a0,_0x1c3053){var _0x378e56={},_0x2be48b={},_0x526bd3={'count':0x0,'rows':[]};var _0x2c62f0=db[_0x4c8b('0x29')][_0x4c8b('0x2a')];_0x2be48b[_0x4c8b('0x2b')]=_['keys'](_0x2c62f0);_0x2be48b[_0x4c8b('0x2c')]=_[_0x4c8b('0x2d')](_0x50b2a0['query']);_0x2be48b[_0x4c8b('0x2e')]=_[_0x4c8b('0x2f')](_0x2be48b['model'],_0x2be48b[_0x4c8b('0x2c')]);_0x378e56['attributes']=_[_0x4c8b('0x2f')](_0x2be48b[_0x4c8b('0x2b')],qs[_0x4c8b('0x30')](_0x50b2a0[_0x4c8b('0x2c')][_0x4c8b('0x30')]));_0x378e56[_0x4c8b('0x31')]=_0x378e56['attributes'][_0x4c8b('0x32')]?_0x378e56[_0x4c8b('0x31')]:_0x2be48b[_0x4c8b('0x2b')];if(!_0x50b2a0['query'][_0x4c8b('0x33')](_0x4c8b('0x34'))){_0x378e56[_0x4c8b('0x1d')]=qs[_0x4c8b('0x1d')](_0x50b2a0['query'][_0x4c8b('0x1d')]);_0x378e56[_0x4c8b('0x1c')]=qs['offset'](_0x50b2a0[_0x4c8b('0x2c')][_0x4c8b('0x1c')]);}_0x378e56['order']=qs[_0x4c8b('0x35')](_0x50b2a0[_0x4c8b('0x2c')][_0x4c8b('0x35')]);_0x378e56[_0x4c8b('0x36')]=qs['filters'](_[_0x4c8b('0x37')](_0x50b2a0[_0x4c8b('0x2c')],_0x2be48b[_0x4c8b('0x2e')]));if(_0x50b2a0['query']['filter']){_0x378e56[_0x4c8b('0x36')]=_[_0x4c8b('0x38')](_0x378e56[_0x4c8b('0x36')],{'$or':_[_0x4c8b('0x39')](_0x2c62f0,function(_0x4a0d8c){if(_0x4a0d8c[_0x4c8b('0x3a')][_0x4c8b('0x3b')]!==_0x4c8b('0x3c')){var _0x1840df={};_0x1840df[_0x4a0d8c[_0x4c8b('0x3d')]]={'$like':'%'+_0x50b2a0[_0x4c8b('0x2c')][_0x4c8b('0x3e')]+'%'};return _0x1840df;}})});}_0x378e56=_['merge']({},_0x378e56,_0x50b2a0[_0x4c8b('0x3f')]);var _0x34e6ef={'where':_0x378e56['where']};return db['VoiceDialReport'][_0x4c8b('0x1b')](_0x34e6ef)[_0x4c8b('0x23')](function(_0x514d4e){_0x526bd3[_0x4c8b('0x1b')]=_0x514d4e;if(_0x50b2a0[_0x4c8b('0x2c')]['includeAll']){_0x378e56[_0x4c8b('0x40')]=[{'all':!![]}];}return db[_0x4c8b('0x29')][_0x4c8b('0x41')](_0x378e56);})[_0x4c8b('0x23')](function(_0x39b64a){_0x526bd3[_0x4c8b('0x42')]=_0x39b64a;return _0x526bd3;})[_0x4c8b('0x23')](respondWithFilteredResult(_0x1c3053,_0x378e56))[_0x4c8b('0x43')](handleError(_0x1c3053,null));};exports['show']=function(_0xa6e456,_0x3c98e8){var _0x414540={'raw':!![],'where':{'id':_0xa6e456[_0x4c8b('0x44')]['id']}},_0x477123={};_0x477123[_0x4c8b('0x2b')]=_[_0x4c8b('0x2d')](db[_0x4c8b('0x29')]['rawAttributes']);_0x477123['query']=_[_0x4c8b('0x2d')](_0xa6e456[_0x4c8b('0x2c')]);_0x477123[_0x4c8b('0x2e')]=_[_0x4c8b('0x2f')](_0x477123[_0x4c8b('0x2b')],_0x477123[_0x4c8b('0x2c')]);_0x414540[_0x4c8b('0x31')]=_['intersection'](_0x477123[_0x4c8b('0x2b')],qs[_0x4c8b('0x30')](_0xa6e456[_0x4c8b('0x2c')][_0x4c8b('0x30')]));_0x414540[_0x4c8b('0x31')]=_0x414540[_0x4c8b('0x31')][_0x4c8b('0x32')]?_0x414540[_0x4c8b('0x31')]:_0x477123[_0x4c8b('0x2b')];if(_0xa6e456['query'][_0x4c8b('0x45')]){_0x414540[_0x4c8b('0x40')]=[{'all':!![]}];}_0x414540=_['merge']({},_0x414540,_0xa6e456[_0x4c8b('0x3f')]);return db['VoiceDialReport']['find'](_0x414540)[_0x4c8b('0x23')](handleEntityNotFound(_0x3c98e8,null))['then'](respondWithResult(_0x3c98e8,null))[_0x4c8b('0x43')](handleError(_0x3c98e8,null));};exports[_0x4c8b('0x46')]=function(_0x5f748b,_0x242d9c){return db[_0x4c8b('0x29')][_0x4c8b('0x46')](_0x5f748b['body'],{})['then'](respondWithResult(_0x242d9c,0xc9))[_0x4c8b('0x43')](handleError(_0x242d9c,null));};exports[_0x4c8b('0x22')]=function(_0x25db24,_0x2bcbc1){if(_0x25db24[_0x4c8b('0x47')]['id']){delete _0x25db24['body']['id'];}return db['VoiceDialReport'][_0x4c8b('0x48')]({'where':{'id':_0x25db24[_0x4c8b('0x44')]['id']}})[_0x4c8b('0x23')](handleEntityNotFound(_0x2bcbc1,null))['then'](saveUpdates(_0x25db24[_0x4c8b('0x47')],null))[_0x4c8b('0x23')](respondWithResult(_0x2bcbc1,null))[_0x4c8b('0x43')](handleError(_0x2bcbc1,null));};exports[_0x4c8b('0x24')]=function(_0x1309ba,_0x37b939){return db[_0x4c8b('0x29')][_0x4c8b('0x48')]({'where':{'id':_0x1309ba[_0x4c8b('0x44')]['id']}})[_0x4c8b('0x23')](handleEntityNotFound(_0x37b939,null))[_0x4c8b('0x23')](removeEntity(_0x37b939,null))['catch'](handleError(_0x37b939,null));};exports['describe']=function(_0xe2a3a8,_0x584660){return db[_0x4c8b('0x29')][_0x4c8b('0x49')]()[_0x4c8b('0x23')](respondWithResult(_0x584660,null))[_0x4c8b('0x43')](handleError(_0x584660,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index eabbd0a..ed45401 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 _0x35f8=['util','../../config/logger','moment','bluebird','define','report_dial','uniqueid'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x35f8,0x69));var _0x835f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x35f8[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x835f('0x0'));var logger=require(_0x835f('0x1'))('api');var moment=require(_0x835f('0x2'));var BPromise=require(_0x835f('0x3'));var rp=require('request-promise');var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x375488,_0x30aaf1){return _0x375488[_0x835f('0x4')]('VoiceDialReport',attributes,{'tableName':_0x835f('0x5'),'paranoid':![],'indexes':[{'fields':[_0x835f('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98cc=['util','../../config/logger','api','bluebird','request-promise','define','VoiceDialReport','lodash'];(function(_0x1cabbf,_0x3c8dcf){var _0x976d93=function(_0x5bd447){while(--_0x5bd447){_0x1cabbf['push'](_0x1cabbf['shift']());}};_0x976d93(++_0x3c8dcf);}(_0x98cc,0x12f));var _0xc98c=function(_0x4dd063,_0x386d0c){_0x4dd063=_0x4dd063-0x0;var _0x2b8747=_0x98cc[_0x4dd063];return _0x2b8747;};'use strict';var _=require(_0xc98c('0x0'));var util=require(_0xc98c('0x1'));var logger=require(_0xc98c('0x2'))(_0xc98c('0x3'));var moment=require('moment');var BPromise=require(_0xc98c('0x4'));var rp=require(_0xc98c('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x350cc1,_0x36b72b){return _0x350cc1[_0xc98c('0x6')](_0xc98c('0x7'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 033dd62..1dcad6a 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 _0xe41f=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','where','attributes','limit','UpdateVoiceDialReport','lodash','util'];(function(_0x465480,_0x44fef1){var _0x502949=function(_0x4c5d97){while(--_0x4c5d97){_0x465480['push'](_0x465480['shift']());}};_0x502949(++_0x44fef1);}(_0xe41f,0x13e));var _0xfe41=function(_0x5a4927,_0x538d55){_0x5a4927=_0x5a4927-0x0;var _0x128da8=_0xe41f[_0x5a4927];return _0x128da8;};'use strict';var _=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var moment=require(_0xfe41('0x2'));var BPromise=require(_0xfe41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe41('0x4'));var logger=require(_0xfe41('0x5'))(_0xfe41('0x6'));var config=require(_0xfe41('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x519fb6,_0xf28c37,_0x224ed7){return new BPromise(function(_0x4f92d3,_0x224a23){return client[_0xfe41('0x9')](_0x519fb6,_0x224ed7)[_0xfe41('0xa')](function(_0x4c39e9){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0xf28c37,'request\x20sent');logger[_0xfe41('0xb')](_0xfe41('0xc'),_0xf28c37,_0xfe41('0xd'),JSON['stringify'](_0x4c39e9));if(_0x4c39e9[_0xfe41('0xe')]){if(_0x4c39e9[_0xfe41('0xe')][_0xfe41('0xf')]===0x1f4){logger['error'](_0xfe41('0x10'),_0xf28c37,_0x4c39e9[_0xfe41('0xe')]['message']);return _0x224a23(_0x4c39e9[_0xfe41('0xe')][_0xfe41('0x11')]);}logger[_0xfe41('0xe')](_0xfe41('0x10'),_0xf28c37,_0x4c39e9[_0xfe41('0xe')]['message']);return _0x4f92d3(_0x4c39e9[_0xfe41('0xe')][_0xfe41('0x11')]);}else{logger[_0xfe41('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0xf28c37,'request\x20sent');_0x4f92d3(_0x4c39e9[_0xfe41('0x13')][_0xfe41('0x11')]);}})[_0xfe41('0x14')](function(_0x199644){logger['error'](_0xfe41('0x10'),_0xf28c37,_0x199644);_0x224a23(_0x199644);});});}exports[_0xfe41('0x15')]=function(_0x119a8d){var _0x1d810e=this;return new Promise(function(_0x27de87,_0x1fee43){return db[_0xfe41('0x16')][_0xfe41('0x17')](_0x119a8d[_0xfe41('0x18')],{'raw':_0x119a8d[_0xfe41('0x19')]?_0x119a8d[_0xfe41('0x19')][_0xfe41('0x1a')]===undefined?!![]:![]:!![]})[_0xfe41('0xa')](function(_0x4d5538){logger[_0xfe41('0x12')](_0xfe41('0x15'),_0x119a8d);logger[_0xfe41('0xb')](_0xfe41('0x15'),_0x119a8d,JSON[_0xfe41('0x1b')](_0x4d5538));_0x27de87(_0x4d5538);})[_0xfe41('0x14')](function(_0x3cfccc){logger[_0xfe41('0xe')](_0xfe41('0x15'),_0x3cfccc[_0xfe41('0x11')],_0x119a8d);_0x1fee43(_0x1d810e[_0xfe41('0xe')](0x1f4,_0x3cfccc[_0xfe41('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x33d1b7){var _0x30f703=this;return new Promise(function(_0x344bea,_0x450e0a){return db[_0xfe41('0x16')]['update'](_0x33d1b7[_0xfe41('0x18')],{'raw':_0x33d1b7[_0xfe41('0x19')]?_0x33d1b7[_0xfe41('0x19')][_0xfe41('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d1b7[_0xfe41('0x19')]?_0x33d1b7['options'][_0xfe41('0x1c')]||null:null,'attributes':_0x33d1b7[_0xfe41('0x19')]?_0x33d1b7[_0xfe41('0x19')][_0xfe41('0x1d')]||null:null,'limit':_0x33d1b7[_0xfe41('0x19')]?_0x33d1b7[_0xfe41('0x19')][_0xfe41('0x1e')]||null:null})['then'](function(_0x36a406){logger[_0xfe41('0x12')]('UpdateVoiceDialReport',_0x33d1b7);logger[_0xfe41('0xb')]('UpdateVoiceDialReport',_0x33d1b7,JSON[_0xfe41('0x1b')](_0x36a406));_0x344bea(_0x36a406);})['catch'](function(_0x2ac84b){logger[_0xfe41('0xe')](_0xfe41('0x1f'),_0x2ac84b[_0xfe41('0x11')],_0x33d1b7);_0x450e0a(_0x30f703[_0xfe41('0xe')](0x1f4,_0x2ac84b[_0xfe41('0x11')]));});});}; \ No newline at end of file +var _0xc79f=['jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17767b,_0x433ae3){var _0x5bbe91=function(_0x16a630){while(--_0x16a630){_0x17767b['push'](_0x17767b['shift']());}};_0x5bbe91(++_0x433ae3);}(_0xc79f,0x82));var _0xfc79=function(_0x55cf11,_0x294992){_0x55cf11=_0x55cf11-0x0;var _0x149e48=_0xc79f[_0x55cf11];return _0x149e48;};'use strict';var _=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var moment=require(_0xfc79('0x2'));var BPromise=require(_0xfc79('0x3'));var rs=require(_0xfc79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc79('0x5'))['db'];var utils=require(_0xfc79('0x6'));var logger=require(_0xfc79('0x7'))(_0xfc79('0x8'));var config=require(_0xfc79('0x9'));var jayson=require(_0xfc79('0xa'));var client=jayson[_0xfc79('0xb')][_0xfc79('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3df358,_0x47f36c,_0x8c8b37){return new BPromise(function(_0x59bf11,_0x18a07e){return client[_0xfc79('0xd')](_0x3df358,_0x8c8b37)[_0xfc79('0xe')](function(_0x4eb2f6){logger[_0xfc79('0xf')](_0xfc79('0x10'),_0x47f36c,_0xfc79('0x11'));logger[_0xfc79('0x12')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x47f36c,_0xfc79('0x11'),JSON[_0xfc79('0x13')](_0x4eb2f6));if(_0x4eb2f6[_0xfc79('0x14')]){if(_0x4eb2f6['error'][_0xfc79('0x15')]===0x1f4){logger[_0xfc79('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x47f36c,_0x4eb2f6[_0xfc79('0x14')]['message']);return _0x18a07e(_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);}logger[_0xfc79('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x47f36c,_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);return _0x59bf11(_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);}else{logger[_0xfc79('0xf')](_0xfc79('0x10'),_0x47f36c,'request\x20sent');_0x59bf11(_0x4eb2f6[_0xfc79('0x17')][_0xfc79('0x16')]);}})[_0xfc79('0x18')](function(_0x322972){logger['error'](_0xfc79('0x10'),_0x47f36c,_0x322972);_0x18a07e(_0x322972);});});}exports[_0xfc79('0x19')]=function(_0x216501){var _0x22dde3=this;return new Promise(function(_0x489e9a,_0x5f2d67){return db[_0xfc79('0x1a')]['create'](_0x216501[_0xfc79('0x1b')],{'raw':_0x216501[_0xfc79('0x1c')]?_0x216501[_0xfc79('0x1c')][_0xfc79('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x8187e2){logger[_0xfc79('0xf')](_0xfc79('0x19'),_0x216501);logger[_0xfc79('0x12')](_0xfc79('0x19'),_0x216501,JSON[_0xfc79('0x13')](_0x8187e2));_0x489e9a(_0x8187e2);})[_0xfc79('0x18')](function(_0x5009d5){logger[_0xfc79('0x14')](_0xfc79('0x19'),_0x5009d5[_0xfc79('0x16')],_0x216501);_0x5f2d67(_0x22dde3[_0xfc79('0x14')](0x1f4,_0x5009d5[_0xfc79('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x4d8636){var _0x49c97e=this;return new Promise(function(_0xaee069,_0x3dc4e4){return db[_0xfc79('0x1a')][_0xfc79('0x1e')](_0x4d8636['body'],{'raw':_0x4d8636[_0xfc79('0x1c')]?_0x4d8636['options'][_0xfc79('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d8636['options']?_0x4d8636[_0xfc79('0x1c')][_0xfc79('0x1f')]||null:null,'attributes':_0x4d8636[_0xfc79('0x1c')]?_0x4d8636['options'][_0xfc79('0x20')]||null:null,'limit':_0x4d8636[_0xfc79('0x1c')]?_0x4d8636[_0xfc79('0x1c')][_0xfc79('0x21')]||null:null})[_0xfc79('0xe')](function(_0x158b2f){logger[_0xfc79('0xf')]('UpdateVoiceDialReport',_0x4d8636);logger[_0xfc79('0x12')](_0xfc79('0x22'),_0x4d8636,JSON[_0xfc79('0x13')](_0x158b2f));_0xaee069(_0x158b2f);})[_0xfc79('0x18')](function(_0x52212b){logger[_0xfc79('0x14')](_0xfc79('0x22'),_0x52212b[_0xfc79('0x16')],_0x4d8636);_0x3dc4e4(_0x49c97e[_0xfc79('0x14')](0x1f4,_0x52212b[_0xfc79('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 13d93ce..6124d9e 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 _0x7894=['show','create','/:id/applications','addApplications','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x123fc1,_0x41eda7){var _0x266ed1=function(_0x2e5a13){while(--_0x2e5a13){_0x123fc1['push'](_0x123fc1['shift']());}};_0x266ed1(++_0x41eda7);}(_0x7894,0x170));var _0x4789=function(_0x4071a6,_0x304154){_0x4071a6=_0x4071a6-0x0;var _0x338959=_0x7894[_0x4071a6];return _0x338959;};'use strict';var multer=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var path=require(_0x4789('0x2'));var timeout=require(_0x4789('0x3'));var express=require(_0x4789('0x4'));var router=express[_0x4789('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4789('0x6'));var config=require(_0x4789('0x7'));var controller=require('./voiceExtension.controller');router[_0x4789('0x8')]('/',auth[_0x4789('0x9')](),controller[_0x4789('0xa')]);router[_0x4789('0x8')](_0x4789('0xb'),auth[_0x4789('0x9')](),controller[_0x4789('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4789('0xd')]);router['post'](_0x4789('0xe'),auth[_0x4789('0x9')](),controller[_0x4789('0xf')]);router['put'](_0x4789('0xb'),auth['isAuthenticated'](),controller[_0x4789('0x10')]);router[_0x4789('0x11')](_0x4789('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4789('0x12')]=router; \ No newline at end of file +var _0x4c4d=['index','/:id','show','post','/:id/applications','addApplications','put','update','delete','exports','multer','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x2f5a2c,_0xf04b16){var _0x3bd524=function(_0x1a8134){while(--_0x1a8134){_0x2f5a2c['push'](_0x2f5a2c['shift']());}};_0x3bd524(++_0xf04b16);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x183f09,_0x123db9){_0x183f09=_0x183f09-0x0;var _0x272fef=_0x4c4d[_0x183f09];return _0x272fef;};'use strict';var multer=require(_0xd4c4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd4c4('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4c4('0x2'));var config=require(_0xd4c4('0x3'));var controller=require(_0xd4c4('0x4'));router[_0xd4c4('0x5')]('/',auth[_0xd4c4('0x6')](),controller[_0xd4c4('0x7')]);router['get'](_0xd4c4('0x8'),auth[_0xd4c4('0x6')](),controller[_0xd4c4('0x9')]);router[_0xd4c4('0xa')]('/',auth[_0xd4c4('0x6')](),controller['create']);router[_0xd4c4('0xa')](_0xd4c4('0xb'),auth[_0xd4c4('0x6')](),controller[_0xd4c4('0xc')]);router[_0xd4c4('0xd')](_0xd4c4('0x8'),auth[_0xd4c4('0x6')](),controller[_0xd4c4('0xe')]);router[_0xd4c4('0xf')]('/:id',auth[_0xd4c4('0x6')](),controller['destroy']);module[_0xd4c4('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 31ca030..274afe4 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 _0x9c00=['system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','internal','inbound-fax','outbound-fax'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5d31ee,_0x183e43){_0x5d31ee=_0x5d31ee-0x0;var _0x21c2e6=_0x9c00[_0x5d31ee];return _0x21c2e6;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'unique':_0x09c0('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x09c0('0x3')},'tag':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':_0x09c0('0x4')},'appdata':{'type':Sequelize[_0x09c0('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x09c0('0x5'),_0x09c0('0x6'),_0x09c0('0x7'),_0x09c0('0x8'),_0x09c0('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x09c0('0x2')]},'interval':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':_0x09c0('0xa')},'IntervalId':{'type':Sequelize[_0x09c0('0xb')]},'isApp':{'type':Sequelize[_0x09c0('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x09c0('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x09c0('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x09c0('0xb')]},'recordingFormat':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':_0x09c0('0xd')},'answer':{'type':Sequelize[_0x09c0('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x09c0('0xe')],'get':function(_0x144271){return this[_0x09c0('0xf')](_0x09c0('0x10'));}}}; \ No newline at end of file +var _0xf72b=['inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','outbound','internal'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf72b,0x1d9));var _0xbf72=function(_0xd812bf,_0x2c0b88){_0xd812bf=_0xd812bf-0x0;var _0x4bfd9d=_0xf72b[_0xd812bf];return _0x4bfd9d;};'use strict';var Sequelize=require(_0xbf72('0x0'));module['exports']={'context':{'type':Sequelize[_0xbf72('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbf72('0x1')],'allowNull':![],'unique':_0xbf72('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xbf72('0x2')},'tag':{'type':Sequelize[_0xbf72('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbf72('0x1')],'allowNull':![],'defaultValue':_0xbf72('0x3')},'appdata':{'type':Sequelize[_0xbf72('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbf72('0x4')]('inbound',_0xbf72('0x5'),_0xbf72('0x6'),_0xbf72('0x7'),_0xbf72('0x8'),_0xbf72('0x9'),_0xbf72('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbf72('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xbf72('0xb')]},'isApp':{'type':Sequelize[_0xbf72('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xbf72('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xbf72('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbf72('0xb')]},'recordingFormat':{'type':Sequelize[_0xbf72('0x1')],'defaultValue':_0xbf72('0xd')},'answer':{'type':Sequelize[_0xbf72('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbf72('0xe')],'get':function(_0x5eb4cc){return this['getDataValue'](_0xbf72('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 5eefaa8..78e4373 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 _0xf842=['order','sort','pick','merge','where','map','key','VIRTUAL','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','body','startsWith','concat','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','value','includes','find','type','name','UserProfileResource','sendStatus','stack','send','VoiceExtension','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x465ad0,_0x1ec380){var _0x21203e=function(_0xa081c1){while(--_0xa081c1){_0x465ad0['push'](_0x465ad0['shift']());}};_0x21203e(++_0x1ec380);}(_0xf842,0x172));var _0x2f84=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xf842[_0x209ec9];return _0x129b1b;};'use strict';var pdf=require(_0x2f84('0x0'));var emlformat=require(_0x2f84('0x1'));var rimraf=require(_0x2f84('0x2'));var zipdir=require(_0x2f84('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f84('0x4'));var moment=require(_0x2f84('0x5'));var BPromise=require(_0x2f84('0x6'));var Mustache=require(_0x2f84('0x7'));var util=require(_0x2f84('0x8'));var path=require('path');var sox=require(_0x2f84('0x9'));var csv=require(_0x2f84('0xa'));var ejs=require(_0x2f84('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2f84('0xc'));var crypto=require(_0x2f84('0xd'));var jsforce=require(_0x2f84('0xe'));var deskjs=require(_0x2f84('0xf'));var toCsv=require(_0x2f84('0xa'));var querystring=require(_0x2f84('0x10'));var Papa=require(_0x2f84('0x11'));var authService=require(_0x2f84('0x12'));var hardwareService=require(_0x2f84('0x13'));var Redis=require(_0x2f84('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x2f84('0x15'))('api');var utils=require(_0x2f84('0x16'));var config=require(_0x2f84('0x17'));var db=require(_0x2f84('0x18'))['db'];config[_0x2f84('0x19')]=_[_0x2f84('0x1a')](config[_0x2f84('0x19')],{'host':_0x2f84('0x1b'),'port':0x18eb});var socket=require(_0x2f84('0x1c'))(new Redis(config[_0x2f84('0x19')]));require(_0x2f84('0x1d'))[_0x2f84('0x1e')](socket);function respondWithStatusCode(_0x3c7728,_0x4a07a5){_0x4a07a5=_0x4a07a5||0xcc;return function(_0x489f51){if(_0x489f51){return _0x3c7728['sendStatus'](_0x4a07a5);}return _0x3c7728[_0x2f84('0x1f')](_0x4a07a5)[_0x2f84('0x20')]();};}function respondWithResult(_0x27cce2,_0x51e4af){_0x51e4af=_0x51e4af||0xc8;return function(_0x41848c){if(_0x41848c){return _0x27cce2[_0x2f84('0x1f')](_0x51e4af)[_0x2f84('0x21')](_0x41848c);}};}function respondWithFilteredResult(_0x54e1f2,_0x3f0b36){return function(_0xbe3e4f){if(_0xbe3e4f){var _0xed58cb=_0xbe3e4f['count'],_0x1e363b=_0x3f0b36[_0x2f84('0x22')],_0x59b952=_0x3f0b36['offset']+_0x3f0b36['limit'],_0x11a8fd;if(_0x59b952>=_0xed58cb){_0x59b952=_0xed58cb;_0x11a8fd=0xc8;}else{_0x11a8fd=0xce;}_0x54e1f2[_0x2f84('0x1f')](_0x11a8fd);return _0x54e1f2[_0x2f84('0x23')](_0x2f84('0x24'),_0x1e363b+'-'+_0x59b952+'/'+_0xed58cb)[_0x2f84('0x21')](_0xbe3e4f);}return null;};}function patchUpdates(_0x1efc9b){return function(_0x4600af){try{jsonpatch['apply'](_0x4600af,_0x1efc9b,!![]);}catch(_0x5a1dc1){return BPromise[_0x2f84('0x25')](_0x5a1dc1);}return _0x4600af[_0x2f84('0x26')]();};}function saveUpdates(_0x329e39,_0xc31d0a){return function(_0x39ee8b){if(_0x39ee8b){return _0x39ee8b[_0x2f84('0x27')](_0x329e39)['then'](function(_0x3f4fc0){return _0x3f4fc0;});}return null;};}function removeEntity(_0x5f4740,_0x289efc){return function(_0x50e8ff){if(_0x50e8ff){return _0x50e8ff[_0x2f84('0x28')]()[_0x2f84('0x29')](function(){var _0x2b747f=_0x50e8ff['get']({'plain':!![]});var _0x16ec4a=[{'name':_0x2f84('0x2a'),'value':_0x2f84('0x2b'),'ignore':![]},{'name':_0x2f84('0x2c'),'value':_0x2f84('0x2d'),'ignore':![]},{'name':_0x2f84('0x2e'),'value':'internal','ignore':![]}];var _0x3f6e2d=_(_0x16ec4a)[_0x2f84('0x2f')](_0x2f84('0x30'))['map']('value')[_0x2f84('0x31')]();if(_[_0x2f84('0x32')](_0x3f6e2d,_0x2b747f['type'])){return;}var _0x3cadc2=_[_0x2f84('0x33')](_0x16ec4a,['value',_0x2b747f[_0x2f84('0x34')]])[_0x2f84('0x35')];return db[_0x2f84('0x36')][_0x2f84('0x28')]({'where':{'type':_0x3cadc2,'resourceId':_0x2b747f['id']}})[_0x2f84('0x29')](function(){return _0x50e8ff;});})[_0x2f84('0x29')](function(){_0x5f4740[_0x2f84('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2adfe0,_0x371110){return function(_0x198905){if(!_0x198905){_0x2adfe0[_0x2f84('0x37')](0x194);}return _0x198905;};}function handleError(_0x3162c6,_0x588963){_0x588963=_0x588963||0x1f4;return function(_0x326698){logger['error'](_0x326698[_0x2f84('0x38')]);if(_0x326698['name']){delete _0x326698['name'];}_0x3162c6['status'](_0x588963)[_0x2f84('0x39')](_0x326698);};}exports['index']=function(_0x44ded4,_0x2b7f9b){var _0x3aeb16={},_0x519187={},_0x5a89f2={'count':0x0,'rows':[]};var _0x14bc47=db[_0x2f84('0x3a')]['rawAttributes'];_0x519187[_0x2f84('0x3b')]=_[_0x2f84('0x3c')](_0x14bc47);_0x519187[_0x2f84('0x3d')]=_[_0x2f84('0x3c')](_0x44ded4[_0x2f84('0x3d')]);_0x519187[_0x2f84('0x3e')]=_[_0x2f84('0x3f')](_0x519187['model'],_0x519187[_0x2f84('0x3d')]);_0x3aeb16[_0x2f84('0x40')]=_['intersection'](_0x519187[_0x2f84('0x3b')],qs['fields'](_0x44ded4['query'][_0x2f84('0x41')]));_0x3aeb16['attributes']=_0x3aeb16[_0x2f84('0x40')][_0x2f84('0x42')]?_0x3aeb16[_0x2f84('0x40')]:_0x519187['model'];if(!_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x43')](_0x2f84('0x44'))){_0x3aeb16[_0x2f84('0x45')]=qs[_0x2f84('0x45')](_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x45')]);_0x3aeb16[_0x2f84('0x22')]=qs[_0x2f84('0x22')](_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x22')]);}_0x3aeb16[_0x2f84('0x46')]=qs['sort'](_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x47')]);_0x3aeb16['where']=qs['filters'](_[_0x2f84('0x48')](_0x44ded4[_0x2f84('0x3d')],_0x519187[_0x2f84('0x3e')]));if(_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x2f')]){_0x3aeb16['where']=_[_0x2f84('0x49')](_0x3aeb16[_0x2f84('0x4a')],{'$or':_[_0x2f84('0x4b')](_0x14bc47,function(_0x4ff5aa){if(_0x4ff5aa[_0x2f84('0x34')][_0x2f84('0x4c')]!==_0x2f84('0x4d')){var _0x24eb53={};_0x24eb53[_0x4ff5aa['field']]={'$like':'%'+_0x44ded4['query'][_0x2f84('0x2f')]+'%'};return _0x24eb53;}})});}_0x3aeb16=_[_0x2f84('0x49')]({},_0x3aeb16,_0x44ded4['options']);var _0x2ea1e7={'where':_0x3aeb16[_0x2f84('0x4a')]};return db['VoiceExtension']['count'](_0x2ea1e7)[_0x2f84('0x29')](function(_0x4e4b24){_0x5a89f2[_0x2f84('0x4e')]=_0x4e4b24;if(_0x44ded4[_0x2f84('0x3d')][_0x2f84('0x4f')]){_0x3aeb16[_0x2f84('0x50')]=[{'all':!![]}];}return db[_0x2f84('0x3a')][_0x2f84('0x51')](_0x3aeb16);})[_0x2f84('0x29')](function(_0x2eadd7){_0x5a89f2['rows']=_0x2eadd7;return _0x5a89f2;})['then'](respondWithFilteredResult(_0x2b7f9b,_0x3aeb16))[_0x2f84('0x52')](handleError(_0x2b7f9b,null));};exports[_0x2f84('0x53')]=function(_0x1cd5af,_0x1d8c36){var _0x203d3e={'raw':![],'where':{'id':_0x1cd5af[_0x2f84('0x54')]['id']}},_0x42b67c={};_0x42b67c[_0x2f84('0x3b')]=_[_0x2f84('0x3c')](db['VoiceExtension'][_0x2f84('0x55')]);_0x42b67c[_0x2f84('0x3d')]=_[_0x2f84('0x3c')](_0x1cd5af[_0x2f84('0x3d')]);_0x42b67c[_0x2f84('0x3e')]=_['intersection'](_0x42b67c[_0x2f84('0x3b')],_0x42b67c[_0x2f84('0x3d')]);_0x203d3e[_0x2f84('0x40')]=_[_0x2f84('0x3f')](_0x42b67c['model'],qs[_0x2f84('0x41')](_0x1cd5af[_0x2f84('0x3d')]['fields']));_0x203d3e[_0x2f84('0x40')]=_0x203d3e[_0x2f84('0x40')][_0x2f84('0x42')]?_0x203d3e['attributes']:_0x42b67c[_0x2f84('0x3b')];if(_0x1cd5af[_0x2f84('0x3d')][_0x2f84('0x4f')]){_0x203d3e[_0x2f84('0x50')]=[{'all':!![]}];}_0x203d3e=_[_0x2f84('0x49')]({},_0x203d3e,_0x1cd5af[_0x2f84('0x56')]);return db[_0x2f84('0x3a')]['find'](_0x203d3e)[_0x2f84('0x29')](handleEntityNotFound(_0x1d8c36,null))[_0x2f84('0x29')](respondWithResult(_0x1d8c36,null))[_0x2f84('0x52')](handleError(_0x1d8c36,null));};exports[_0x2f84('0x28')]=function(_0x2cda71,_0x1ce832){return db[_0x2f84('0x3a')][_0x2f84('0x33')]({'where':{'id':_0x2cda71[_0x2f84('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ce832,null))[_0x2f84('0x29')](removeEntity(_0x1ce832,null))[_0x2f84('0x52')](handleError(_0x1ce832,null));};exports['create']=function(_0x249bf2,_0x3ec302){if(_0x249bf2[_0x2f84('0x57')][_0x2f84('0x34')]===_0x2f84('0x2d')&&!_[_0x2f84('0x58')](_0x249bf2[_0x2f84('0x57')]['exten'],'_')){_0x249bf2['body']['exten']='_'[_0x2f84('0x59')](_0x249bf2[_0x2f84('0x57')][_0x2f84('0x5a')]);}return db[_0x2f84('0x3a')]['create'](_0x249bf2[_0x2f84('0x57')],{'raw':![]})[_0x2f84('0x29')](function(_0x219285){var _0x3fe861=_0x249bf2[_0x2f84('0x5b')][_0x2f84('0x5c')]({'plain':!![]});if(!_0x3fe861)throw new Error(_0x2f84('0x5d'));if(_0x3fe861[_0x2f84('0x5e')]===_0x2f84('0x5b')){var _0x2fcd2d=_0x219285[_0x2f84('0x5c')]({'plain':!![]});var _0x494240=[{'name':_0x2f84('0x2a'),'value':_0x2f84('0x2b')},{'name':_0x2f84('0x2c'),'value':_0x2f84('0x2d')},{'name':_0x2f84('0x2e'),'value':_0x2f84('0x5f')}];var _0x886285=_[_0x2f84('0x33')](_0x494240,['value',_0x2fcd2d['type']])['name'];return db[_0x2f84('0x60')][_0x2f84('0x33')]({'where':{'name':_0x886285,'userProfileId':_0x3fe861['userProfileId']},'raw':!![]})[_0x2f84('0x29')](function(_0x5a8bdf){if(_0x5a8bdf&&_0x5a8bdf[_0x2f84('0x61')]===0x0){return db[_0x2f84('0x36')]['create']({'name':_0x2fcd2d[_0x2f84('0x35')],'resourceId':_0x2fcd2d['id'],'type':_0x5a8bdf[_0x2f84('0x35')],'sectionId':_0x5a8bdf['id']},{})[_0x2f84('0x29')](function(){return _0x219285;});}else{return _0x219285;}})['catch'](function(_0x4ba61e){logger['error'](_0x2f84('0x62'),_0x4ba61e);throw _0x4ba61e;});}return _0x219285;})['then'](respondWithResult(_0x3ec302,0xc9))[_0x2f84('0x52')](handleError(_0x3ec302,null));};exports[_0x2f84('0x27')]=function(_0x5c96bc,_0x275f4f){if(_0x5c96bc[_0x2f84('0x57')]['id']){delete _0x5c96bc['body']['id'];}return db[_0x2f84('0x3a')][_0x2f84('0x33')]({'where':{'id':_0x5c96bc[_0x2f84('0x54')]['id']}})[_0x2f84('0x29')](handleEntityNotFound(_0x275f4f,null))['then'](function(_0x461eaf){if(_0x461eaf){return db[_0x2f84('0x3a')][_0x2f84('0x27')](_[_0x2f84('0x48')](_0x5c96bc['body'],[_0x2f84('0x5a'),_0x2f84('0x63'),'description',_0x2f84('0x64'),_0x2f84('0x65'),_0x2f84('0x66')]),{'where':{'context':_0x461eaf[_0x2f84('0x63')],'exten':_0x461eaf[_0x2f84('0x5a')]},'individualHooks':!![]})[_0x2f84('0x29')](function(_0x19ec0a){return _0x19ec0a;});}return null;})[_0x2f84('0x29')](respondWithStatusCode(_0x275f4f,null))[_0x2f84('0x52')](handleError(_0x275f4f,null));};exports[_0x2f84('0x67')]=function(_0x38b624,_0x27a211,_0x225469){return db[_0x2f84('0x3a')][_0x2f84('0x68')]({'where':{'id':_0x38b624[_0x2f84('0x54')]['id']}})[_0x2f84('0x29')](handleEntityNotFound(_0x27a211,null))['then'](function(_0x1cc90c){if(_0x1cc90c){return db[_0x2f84('0x69')][_0x2f84('0x6a')](function(_0x4c680e){return db[_0x2f84('0x3a')][_0x2f84('0x28')]({'where':{'VoiceExtensionId':_0x38b624['params']['id']},'transaction':_0x4c680e})[_0x2f84('0x29')](function(_0x1a5714){var _0x112090=_[_0x2f84('0x4b')](_0x38b624[_0x2f84('0x57')],function(_0x24b7a3){_0x24b7a3[_0x2f84('0x6b')]=_0x38b624[_0x2f84('0x54')]['id'];return _0x24b7a3;});return db[_0x2f84('0x3a')][_0x2f84('0x6c')](_0x112090,{'transaction':_0x4c680e});});})['then'](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x38b624['params']['id']},'order':_0x2f84('0x6d')});});}})[_0x2f84('0x29')](respondWithResult(_0x27a211,null))['catch'](handleError(_0x27a211,null));}; \ No newline at end of file +var _0x4491=['body','startsWith','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','mandatoryDisposition','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','inbound','OutboundRoutes','outbound','internal','filter','value','type','find','UserProfileResource','error','stack','name','send','VoiceExtension','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','destroy'];(function(_0x47d193,_0x3d630b){var _0x442d26=function(_0x492730){while(--_0x492730){_0x47d193['push'](_0x47d193['shift']());}};_0x442d26(++_0x3d630b);}(_0x4491,0x1bb));var _0x1449=function(_0x31e6b3,_0x1a4a36){_0x31e6b3=_0x31e6b3-0x0;var _0x42b4e7=_0x4491[_0x31e6b3];return _0x42b4e7;};'use strict';var pdf=require(_0x1449('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1449('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1449('0x2'));var rp=require(_0x1449('0x3'));var moment=require(_0x1449('0x4'));var BPromise=require(_0x1449('0x5'));var Mustache=require(_0x1449('0x6'));var util=require(_0x1449('0x7'));var path=require('path');var sox=require(_0x1449('0x8'));var csv=require('to-csv');var ejs=require(_0x1449('0x9'));var fs=require('fs');var _=require(_0x1449('0xa'));var squel=require(_0x1449('0xb'));var crypto=require(_0x1449('0xc'));var jsforce=require(_0x1449('0xd'));var deskjs=require(_0x1449('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1449('0xf'));var Papa=require(_0x1449('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x1449('0x11'));var Redis=require(_0x1449('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x1449('0x13'))(_0x1449('0x14'));var utils=require('../../config/utils');var config=require(_0x1449('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1449('0x16')](config[_0x1449('0x17')],{'host':_0x1449('0x18'),'port':0x18eb});var socket=require(_0x1449('0x19'))(new Redis(config[_0x1449('0x17')]));require(_0x1449('0x1a'))[_0x1449('0x1b')](socket);function respondWithStatusCode(_0x377c96,_0x267d9a){_0x267d9a=_0x267d9a||0xcc;return function(_0x41b34d){if(_0x41b34d){return _0x377c96[_0x1449('0x1c')](_0x267d9a);}return _0x377c96[_0x1449('0x1d')](_0x267d9a)[_0x1449('0x1e')]();};}function respondWithResult(_0x2cf76c,_0x1ec7e8){_0x1ec7e8=_0x1ec7e8||0xc8;return function(_0x59b128){if(_0x59b128){return _0x2cf76c[_0x1449('0x1d')](_0x1ec7e8)[_0x1449('0x1f')](_0x59b128);}};}function respondWithFilteredResult(_0x4a3508,_0x12ac67){return function(_0x290b72){if(_0x290b72){var _0x5bcc9=_0x290b72[_0x1449('0x20')],_0x364878=_0x12ac67[_0x1449('0x21')],_0x34a43f=_0x12ac67[_0x1449('0x21')]+_0x12ac67[_0x1449('0x22')],_0x30a65f;if(_0x34a43f>=_0x5bcc9){_0x34a43f=_0x5bcc9;_0x30a65f=0xc8;}else{_0x30a65f=0xce;}_0x4a3508[_0x1449('0x1d')](_0x30a65f);return _0x4a3508[_0x1449('0x23')](_0x1449('0x24'),_0x364878+'-'+_0x34a43f+'/'+_0x5bcc9)['json'](_0x290b72);}return null;};}function patchUpdates(_0x108f41){return function(_0x49c4d6){try{jsonpatch[_0x1449('0x25')](_0x49c4d6,_0x108f41,!![]);}catch(_0xaaea1d){return BPromise[_0x1449('0x26')](_0xaaea1d);}return _0x49c4d6[_0x1449('0x27')]();};}function saveUpdates(_0x3a2c85,_0x4dcc1b){return function(_0x4c86b9){if(_0x4c86b9){return _0x4c86b9[_0x1449('0x28')](_0x3a2c85)[_0x1449('0x29')](function(_0x100ac6){return _0x100ac6;});}return null;};}function removeEntity(_0x356d6b,_0x545cee){return function(_0x29e254){if(_0x29e254){return _0x29e254['destroy']()[_0x1449('0x29')](function(){var _0x315d3b=_0x29e254['get']({'plain':!![]});var _0x5a8cf0=[{'name':'InboundRoutes','value':_0x1449('0x2a'),'ignore':![]},{'name':_0x1449('0x2b'),'value':_0x1449('0x2c'),'ignore':![]},{'name':'InternalRoutes','value':_0x1449('0x2d'),'ignore':![]}];var _0x5529a5=_(_0x5a8cf0)[_0x1449('0x2e')]('ignore')['map'](_0x1449('0x2f'))[_0x1449('0x2f')]();if(_['includes'](_0x5529a5,_0x315d3b[_0x1449('0x30')])){return;}var _0x5c3fdf=_[_0x1449('0x31')](_0x5a8cf0,[_0x1449('0x2f'),_0x315d3b['type']])['name'];return db[_0x1449('0x32')]['destroy']({'where':{'type':_0x5c3fdf,'resourceId':_0x315d3b['id']}})[_0x1449('0x29')](function(){return _0x29e254;});})[_0x1449('0x29')](function(){_0x356d6b[_0x1449('0x1d')](0xcc)[_0x1449('0x1e')]();});}};}function handleEntityNotFound(_0x147130,_0x16eee7){return function(_0x318c4a){if(!_0x318c4a){_0x147130[_0x1449('0x1c')](0x194);}return _0x318c4a;};}function handleError(_0xe8e3da,_0x1807a5){_0x1807a5=_0x1807a5||0x1f4;return function(_0x32a08e){logger[_0x1449('0x33')](_0x32a08e[_0x1449('0x34')]);if(_0x32a08e[_0x1449('0x35')]){delete _0x32a08e[_0x1449('0x35')];}_0xe8e3da[_0x1449('0x1d')](_0x1807a5)[_0x1449('0x36')](_0x32a08e);};}exports['index']=function(_0x2f1b75,_0x5963a9){var _0x1c8c58={},_0x229f19={},_0x2a592f={'count':0x0,'rows':[]};var _0x3b64a2=db[_0x1449('0x37')][_0x1449('0x38')];_0x229f19[_0x1449('0x39')]=_[_0x1449('0x3a')](_0x3b64a2);_0x229f19['query']=_['keys'](_0x2f1b75['query']);_0x229f19[_0x1449('0x3b')]=_[_0x1449('0x3c')](_0x229f19[_0x1449('0x39')],_0x229f19[_0x1449('0x3d')]);_0x1c8c58[_0x1449('0x3e')]=_[_0x1449('0x3c')](_0x229f19[_0x1449('0x39')],qs[_0x1449('0x3f')](_0x2f1b75['query'][_0x1449('0x3f')]));_0x1c8c58[_0x1449('0x3e')]=_0x1c8c58[_0x1449('0x3e')][_0x1449('0x40')]?_0x1c8c58[_0x1449('0x3e')]:_0x229f19[_0x1449('0x39')];if(!_0x2f1b75['query'][_0x1449('0x41')](_0x1449('0x42'))){_0x1c8c58['limit']=qs[_0x1449('0x22')](_0x2f1b75['query'][_0x1449('0x22')]);_0x1c8c58[_0x1449('0x21')]=qs[_0x1449('0x21')](_0x2f1b75[_0x1449('0x3d')]['offset']);}_0x1c8c58[_0x1449('0x43')]=qs[_0x1449('0x44')](_0x2f1b75[_0x1449('0x3d')][_0x1449('0x44')]);_0x1c8c58[_0x1449('0x45')]=qs[_0x1449('0x3b')](_[_0x1449('0x46')](_0x2f1b75[_0x1449('0x3d')],_0x229f19[_0x1449('0x3b')]));if(_0x2f1b75[_0x1449('0x3d')]['filter']){_0x1c8c58[_0x1449('0x45')]=_[_0x1449('0x47')](_0x1c8c58[_0x1449('0x45')],{'$or':_[_0x1449('0x48')](_0x3b64a2,function(_0x20cba2){if(_0x20cba2[_0x1449('0x30')]['key']!==_0x1449('0x49')){var _0x3bf512={};_0x3bf512[_0x20cba2['field']]={'$like':'%'+_0x2f1b75[_0x1449('0x3d')][_0x1449('0x2e')]+'%'};return _0x3bf512;}})});}_0x1c8c58=_[_0x1449('0x47')]({},_0x1c8c58,_0x2f1b75[_0x1449('0x4a')]);var _0xc542dd={'where':_0x1c8c58[_0x1449('0x45')]};return db[_0x1449('0x37')][_0x1449('0x20')](_0xc542dd)['then'](function(_0x54098b){_0x2a592f['count']=_0x54098b;if(_0x2f1b75[_0x1449('0x3d')][_0x1449('0x4b')]){_0x1c8c58['include']=[{'all':!![]}];}return db[_0x1449('0x37')][_0x1449('0x4c')](_0x1c8c58);})[_0x1449('0x29')](function(_0xcddb03){_0x2a592f[_0x1449('0x4d')]=_0xcddb03;return _0x2a592f;})[_0x1449('0x29')](respondWithFilteredResult(_0x5963a9,_0x1c8c58))[_0x1449('0x4e')](handleError(_0x5963a9,null));};exports['show']=function(_0x5041a9,_0x35bb7a){var _0x9838c2={'raw':![],'where':{'id':_0x5041a9[_0x1449('0x4f')]['id']}},_0xc3a74a={};_0xc3a74a[_0x1449('0x39')]=_[_0x1449('0x3a')](db[_0x1449('0x37')]['rawAttributes']);_0xc3a74a['query']=_['keys'](_0x5041a9[_0x1449('0x3d')]);_0xc3a74a[_0x1449('0x3b')]=_[_0x1449('0x3c')](_0xc3a74a['model'],_0xc3a74a['query']);_0x9838c2['attributes']=_[_0x1449('0x3c')](_0xc3a74a[_0x1449('0x39')],qs[_0x1449('0x3f')](_0x5041a9[_0x1449('0x3d')][_0x1449('0x3f')]));_0x9838c2[_0x1449('0x3e')]=_0x9838c2[_0x1449('0x3e')][_0x1449('0x40')]?_0x9838c2['attributes']:_0xc3a74a['model'];if(_0x5041a9['query'][_0x1449('0x4b')]){_0x9838c2[_0x1449('0x50')]=[{'all':!![]}];}_0x9838c2=_[_0x1449('0x47')]({},_0x9838c2,_0x5041a9[_0x1449('0x4a')]);return db['VoiceExtension'][_0x1449('0x31')](_0x9838c2)[_0x1449('0x29')](handleEntityNotFound(_0x35bb7a,null))['then'](respondWithResult(_0x35bb7a,null))[_0x1449('0x4e')](handleError(_0x35bb7a,null));};exports[_0x1449('0x51')]=function(_0x113165,_0x2125df){return db[_0x1449('0x37')][_0x1449('0x31')]({'where':{'id':_0x113165[_0x1449('0x4f')]['id']}})[_0x1449('0x29')](handleEntityNotFound(_0x2125df,null))[_0x1449('0x29')](removeEntity(_0x2125df,null))[_0x1449('0x4e')](handleError(_0x2125df,null));};exports['create']=function(_0x941737,_0x54e529){if(_0x941737[_0x1449('0x52')]['type']===_0x1449('0x2c')&&!_[_0x1449('0x53')](_0x941737[_0x1449('0x52')][_0x1449('0x54')],'_')){_0x941737[_0x1449('0x52')]['exten']='_'[_0x1449('0x55')](_0x941737[_0x1449('0x52')]['exten']);}return db[_0x1449('0x37')][_0x1449('0x56')](_0x941737[_0x1449('0x52')],{'raw':![]})[_0x1449('0x29')](function(_0x582329){var _0x3db67c=_0x941737[_0x1449('0x57')][_0x1449('0x58')]({'plain':!![]});if(!_0x3db67c)throw new Error(_0x1449('0x59'));if(_0x3db67c[_0x1449('0x5a')]==='user'){var _0x236550=_0x582329['get']({'plain':!![]});var _0x23ed8d=[{'name':'InboundRoutes','value':_0x1449('0x2a')},{'name':_0x1449('0x2b'),'value':_0x1449('0x2c')},{'name':_0x1449('0x5b'),'value':_0x1449('0x2d')}];var _0x5413b3=_[_0x1449('0x31')](_0x23ed8d,[_0x1449('0x2f'),_0x236550[_0x1449('0x30')]])[_0x1449('0x35')];return db['UserProfileSection'][_0x1449('0x31')]({'where':{'name':_0x5413b3,'userProfileId':_0x3db67c[_0x1449('0x5c')]},'raw':!![]})[_0x1449('0x29')](function(_0x59ffa3){if(_0x59ffa3&&_0x59ffa3[_0x1449('0x5d')]===0x0){return db[_0x1449('0x32')][_0x1449('0x56')]({'name':_0x236550['name'],'resourceId':_0x236550['id'],'type':_0x59ffa3['name'],'sectionId':_0x59ffa3['id']},{})['then'](function(){return _0x582329;});}else{return _0x582329;}})[_0x1449('0x4e')](function(_0x3e17fb){logger[_0x1449('0x33')](_0x1449('0x5e'),_0x3e17fb);throw _0x3e17fb;});}return _0x582329;})[_0x1449('0x29')](respondWithResult(_0x54e529,0xc9))['catch'](handleError(_0x54e529,null));};exports[_0x1449('0x28')]=function(_0x43eebc,_0x3b745d){if(_0x43eebc[_0x1449('0x52')]['id']){delete _0x43eebc[_0x1449('0x52')]['id'];}return db['VoiceExtension'][_0x1449('0x31')]({'where':{'id':_0x43eebc[_0x1449('0x4f')]['id']}})[_0x1449('0x29')](handleEntityNotFound(_0x3b745d,null))['then'](function(_0x5ef877){if(_0x5ef877){return db[_0x1449('0x37')][_0x1449('0x28')](_['pick'](_0x43eebc[_0x1449('0x52')],[_0x1449('0x54'),'context',_0x1449('0x5f'),_0x1449('0x60'),'cutdigits',_0x1449('0x61')]),{'where':{'context':_0x5ef877['context'],'exten':_0x5ef877[_0x1449('0x54')]},'individualHooks':!![]})[_0x1449('0x29')](function(_0x22dd69){return _0x22dd69;});}return null;})[_0x1449('0x29')](respondWithStatusCode(_0x3b745d,null))['catch'](handleError(_0x3b745d,null));};exports['addApplications']=function(_0x1270d1,_0x40ae04,_0xfc4ecb){return db['VoiceExtension'][_0x1449('0x62')]({'where':{'id':_0x1270d1[_0x1449('0x4f')]['id']}})['then'](handleEntityNotFound(_0x40ae04,null))['then'](function(_0x24820b){if(_0x24820b){return db[_0x1449('0x63')][_0x1449('0x64')](function(_0x1e8e8c){return db[_0x1449('0x37')][_0x1449('0x51')]({'where':{'VoiceExtensionId':_0x1270d1['params']['id']},'transaction':_0x1e8e8c})[_0x1449('0x29')](function(_0x2a161a){var _0x4abaf2=_[_0x1449('0x48')](_0x1270d1['body'],function(_0x3e23fe){_0x3e23fe[_0x1449('0x65')]=_0x1270d1[_0x1449('0x4f')]['id'];return _0x3e23fe;});return db['VoiceExtension'][_0x1449('0x66')](_0x4abaf2,{'transaction':_0x1e8e8c});});})['then'](function(){return db[_0x1449('0x37')][_0x1449('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1270d1[_0x1449('0x4f')]['id']},'order':_0x1449('0x68')});});}})[_0x1449('0x29')](respondWithResult(_0x40ae04,null))['catch'](handleError(_0x40ae04,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 276e99c..03de535 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 _0x32ea=['emit','exports','../../mysqldb','VoiceExtension','update'];(function(_0x157bc9,_0x5ea9d9){var _0x2cc62a=function(_0x5ccdc9){while(--_0x5ccdc9){_0x157bc9['push'](_0x157bc9['shift']());}};_0x2cc62a(++_0x5ea9d9);}(_0x32ea,0x1b0));var _0xa32e=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0x32ea[_0x3e6b2f];return _0x323215;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xa32e('0x0'))['db'][_0xa32e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa32e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x19712c){return function(_0x46f66d,_0x2718a1,_0x31a334){VoiceExtensionEvents[_0xa32e('0x3')](_0x19712c+':'+_0x46f66d['id'],_0x46f66d);VoiceExtensionEvents[_0xa32e('0x3')](_0x19712c,_0x46f66d);_0x31a334(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xa32e('0x4')]=VoiceExtensionEvents; \ No newline at end of file +var _0xf108=['setMaxListeners','update','emit','exports','../../mysqldb','VoiceExtension'];(function(_0x7cf666,_0xa42930){var _0x293258=function(_0x3f87c0){while(--_0x3f87c0){_0x7cf666['push'](_0x7cf666['shift']());}};_0x293258(++_0xa42930);}(_0xf108,0x166));var _0x8f10=function(_0x4a10d1,_0x219b03){_0x4a10d1=_0x4a10d1-0x0;var _0x26ee6b=_0xf108[_0x4a10d1];return _0x26ee6b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x8f10('0x0'))['db'][_0x8f10('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8f10('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f10('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f14ae){return function(_0x536566,_0x18696a,_0x14ad9d){VoiceExtensionEvents[_0x8f10('0x4')](_0x2f14ae+':'+_0x536566['id'],_0x536566);VoiceExtensionEvents['emit'](_0x2f14ae,_0x536566);_0x14ad9d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x8f10('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index df1f673..72365a0 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 _0xfdac=['VoiceExtension','voice_extensions','lodash','../../config/logger','api','bluebird','./voiceExtension.attributes','exports','define'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xfdac,0x9b));var _0xcfda=function(_0x23d84e,_0x4af60d){_0x23d84e=_0x23d84e-0x0;var _0x4f92ef=_0xfdac[_0x23d84e];return _0x4f92ef;};'use strict';var _=require(_0xcfda('0x0'));var util=require('util');var logger=require(_0xcfda('0x1'))(_0xcfda('0x2'));var moment=require('moment');var BPromise=require(_0xcfda('0x3'));var rp=require('request-promise');var attributes=require(_0xcfda('0x4'));module[_0xcfda('0x5')]=function(_0x596625,_0x53b42b){return _0x596625[_0xcfda('0x6')](_0xcfda('0x7'),attributes,{'tableName':_0xcfda('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe93=['exports','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','./voiceExtension.attributes'];(function(_0x23d507,_0x201d80){var _0x2f59cc=function(_0x4436f9){while(--_0x4436f9){_0x23d507['push'](_0x23d507['shift']());}};_0x2f59cc(++_0x201d80);}(_0xfe93,0x13e));var _0x3fe9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfe93[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3fe9('0x0'));var util=require(_0x3fe9('0x1'));var logger=require(_0x3fe9('0x2'))(_0x3fe9('0x3'));var moment=require(_0x3fe9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x3fe9('0x5'));module[_0x3fe9('0x6')]=function(_0x220424,_0x4f9f86){return _0x220424['define'](_0x3fe9('0x7'),attributes,{'tableName':_0x3fe9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index aa1187e..7d48382 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 _0xb688=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','map','include','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb688,0xcf));var _0x8b68=function(_0x2fa21e,_0x49f072){_0x2fa21e=_0x2fa21e-0x0;var _0x19173a=_0xb688[_0x2fa21e];return _0x19173a;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});config['redis']=_[_0x8b68('0xb')](config[_0x8b68('0xc')],{'host':_0x8b68('0xd'),'port':0x18eb});var socket=require(_0x8b68('0xe'))(new Redis(config[_0x8b68('0xc')]));require(_0x8b68('0xf'))[_0x8b68('0x10')](socket);function respondWithRpcPromise(_0x21d944,_0x24e0b0,_0x2f2e3c){return new BPromise(function(_0x418775,_0x317d01){return client[_0x8b68('0x11')](_0x21d944,_0x2f2e3c)['then'](function(_0x2c0f3b){logger[_0x8b68('0x12')](_0x8b68('0x13'),_0x24e0b0,_0x8b68('0x14'));logger[_0x8b68('0x15')](_0x8b68('0x16'),_0x24e0b0,_0x8b68('0x14'),JSON[_0x8b68('0x17')](_0x2c0f3b));if(_0x2c0f3b[_0x8b68('0x18')]){if(_0x2c0f3b['error'][_0x8b68('0x19')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x24e0b0,_0x2c0f3b[_0x8b68('0x18')][_0x8b68('0x1a')]);return _0x317d01(_0x2c0f3b[_0x8b68('0x18')]['message']);}logger['error'](_0x8b68('0x13'),_0x24e0b0,_0x2c0f3b['error'][_0x8b68('0x1a')]);return _0x418775(_0x2c0f3b[_0x8b68('0x18')][_0x8b68('0x1a')]);}else{logger[_0x8b68('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x24e0b0,_0x8b68('0x14'));_0x418775(_0x2c0f3b[_0x8b68('0x1b')]['message']);}})[_0x8b68('0x1c')](function(_0x3c7e5a){logger[_0x8b68('0x18')](_0x8b68('0x13'),_0x24e0b0,_0x3c7e5a);_0x317d01(_0x3c7e5a);});});}exports[_0x8b68('0x1d')]=function(_0x5649a5){var _0x7b0b70=this;return new Promise(function(_0x4b4b0f,_0x59e9b1){return db[_0x8b68('0x1e')][_0x8b68('0x1f')]({'raw':_0x5649a5[_0x8b68('0x20')]?_0x5649a5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5649a5[_0x8b68('0x20')]?_0x5649a5['options'][_0x8b68('0x21')]||null:null,'attributes':_0x5649a5[_0x8b68('0x20')]?_0x5649a5[_0x8b68('0x20')][_0x8b68('0x22')]||null:null,'limit':_0x5649a5[_0x8b68('0x20')]?_0x5649a5[_0x8b68('0x20')]['limit']||null:null,'include':_0x5649a5[_0x8b68('0x20')]?_0x5649a5[_0x8b68('0x20')]['include']?_[_0x8b68('0x23')](_0x5649a5[_0x8b68('0x20')][_0x8b68('0x24')],function(_0x5590ec){return{'model':db[_0x5590ec['model']],'as':_0x5590ec['as'],'attributes':_0x5590ec['attributes'],'include':_0x5590ec[_0x8b68('0x24')]?_[_0x8b68('0x23')](_0x5590ec[_0x8b68('0x24')],function(_0x583476){return{'model':db[_0x583476[_0x8b68('0x25')]],'as':_0x583476['as'],'attributes':_0x583476['attributes'],'include':_0x583476['include']?_[_0x8b68('0x23')](_0x583476['include'],function(_0x26cad7){return{'model':db[_0x26cad7[_0x8b68('0x25')]],'as':_0x26cad7['as'],'attributes':_0x26cad7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x357635){logger[_0x8b68('0x12')](_0x8b68('0x1d'),_0x5649a5);logger[_0x8b68('0x15')](_0x8b68('0x1d'),_0x5649a5,JSON[_0x8b68('0x17')](_0x357635));_0x4b4b0f(_0x357635);})[_0x8b68('0x1c')](function(_0x5b7ed1){logger[_0x8b68('0x18')]('GetVoiceExtension',_0x5b7ed1[_0x8b68('0x1a')],_0x5649a5);_0x59e9b1(_0x7b0b70[_0x8b68('0x18')](0x1f4,_0x5b7ed1['message']));});});}; \ No newline at end of file +var _0x0bb5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bb5,0x148));var _0x50bb=function(_0x508523,_0x2708fe){_0x508523=_0x508523-0x0;var _0x406b7b=_0x0bb5[_0x508523];return _0x406b7b;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x50bb('0xa')]=_[_0x50bb('0xb')](config[_0x50bb('0xa')],{'host':_0x50bb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50bb('0xd'))[_0x50bb('0xe')](socket);function respondWithRpcPromise(_0x3ae598,_0x239a89,_0x5512e1){return new BPromise(function(_0x36f7a1,_0x2edeeb){return client[_0x50bb('0xf')](_0x3ae598,_0x5512e1)[_0x50bb('0x10')](function(_0x346422){logger[_0x50bb('0x11')](_0x50bb('0x12'),_0x239a89,'request\x20sent');logger[_0x50bb('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'),JSON[_0x50bb('0x15')](_0x346422));if(_0x346422[_0x50bb('0x16')]){if(_0x346422['error'][_0x50bb('0x17')]===0x1f4){logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422['error'][_0x50bb('0x18')]);return _0x2edeeb(_0x346422['error'][_0x50bb('0x18')]);}logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422[_0x50bb('0x16')][_0x50bb('0x18')]);return _0x36f7a1(_0x346422['error'][_0x50bb('0x18')]);}else{logger[_0x50bb('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'));_0x36f7a1(_0x346422['result'][_0x50bb('0x18')]);}})[_0x50bb('0x19')](function(_0x4b06f5){logger['error'](_0x50bb('0x12'),_0x239a89,_0x4b06f5);_0x2edeeb(_0x4b06f5);});});}exports[_0x50bb('0x1a')]=function(_0x2408db){var _0x26abe7=this;return new Promise(function(_0x56b25a,_0x19dc5d){return db[_0x50bb('0x1b')][_0x50bb('0x1c')]({'raw':_0x2408db['options']?_0x2408db[_0x50bb('0x1d')][_0x50bb('0x1e')]===undefined?!![]:![]:!![],'where':_0x2408db[_0x50bb('0x1d')]?_0x2408db['options'][_0x50bb('0x1f')]||null:null,'attributes':_0x2408db['options']?_0x2408db[_0x50bb('0x1d')][_0x50bb('0x20')]||null:null,'limit':_0x2408db[_0x50bb('0x1d')]?_0x2408db[_0x50bb('0x1d')][_0x50bb('0x21')]||null:null,'include':_0x2408db[_0x50bb('0x1d')]?_0x2408db['options'][_0x50bb('0x22')]?_[_0x50bb('0x23')](_0x2408db[_0x50bb('0x1d')][_0x50bb('0x22')],function(_0x5234d7){return{'model':db[_0x5234d7[_0x50bb('0x24')]],'as':_0x5234d7['as'],'attributes':_0x5234d7['attributes'],'include':_0x5234d7['include']?_[_0x50bb('0x23')](_0x5234d7['include'],function(_0x5cfe4b){return{'model':db[_0x5cfe4b[_0x50bb('0x24')]],'as':_0x5cfe4b['as'],'attributes':_0x5cfe4b[_0x50bb('0x20')],'include':_0x5cfe4b[_0x50bb('0x22')]?_[_0x50bb('0x23')](_0x5cfe4b[_0x50bb('0x22')],function(_0x269479){return{'model':db[_0x269479[_0x50bb('0x24')]],'as':_0x269479['as'],'attributes':_0x269479[_0x50bb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ce86){logger[_0x50bb('0x11')](_0x50bb('0x1a'),_0x2408db);logger[_0x50bb('0x13')]('GetVoiceExtension',_0x2408db,JSON[_0x50bb('0x15')](_0x44ce86));_0x56b25a(_0x44ce86);})[_0x50bb('0x19')](function(_0xc38da5){logger[_0x50bb('0x16')](_0x50bb('0x1a'),_0xc38da5[_0x50bb('0x18')],_0x2408db);_0x19dc5d(_0x26abe7[_0x50bb('0x16')](0x1f4,_0xc38da5[_0x50bb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 681cc08..2b6575d 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 _0x8ce3=['length','./voiceExtension.events','save','emit','removeListener','register'];(function(_0x515b55,_0x3ff097){var _0x1b3881=function(_0x4f27b5){while(--_0x4f27b5){_0x515b55['push'](_0x515b55['shift']());}};_0x1b3881(++_0x3ff097);}(_0x8ce3,0x9d));var _0x38ce=function(_0x24717a,_0x26f6dc){_0x24717a=_0x24717a-0x0;var _0x32cf54=_0x8ce3[_0x24717a];return _0x32cf54;};'use strict';var VoiceExtensionEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove','update'];function createListener(_0x16fcc3,_0x37b739){return function(_0x45dd25){_0x37b739[_0x38ce('0x2')](_0x16fcc3,_0x45dd25);};}function removeListener(_0x708fbf,_0x51a1b5){return function(){VoiceExtensionEvents[_0x38ce('0x3')](_0x708fbf,_0x51a1b5);};}exports[_0x38ce('0x4')]=function(_0x588d53){for(var _0x149fb9=0x0,_0x41bb2e=events[_0x38ce('0x5')];_0x149fb9<_0x41bb2e;_0x149fb9++){var _0x1c34e9=events[_0x149fb9];var _0x330343=createListener('voiceExtension:'+_0x1c34e9,_0x588d53);VoiceExtensionEvents['on'](_0x1c34e9,_0x330343);}}; \ No newline at end of file +var _0xf3d2=['register','voiceExtension:','emit','removeListener'];(function(_0x373c18,_0x5c5b68){var _0x3f91f0=function(_0x508a21){while(--_0x508a21){_0x373c18['push'](_0x373c18['shift']());}};_0x3f91f0(++_0x5c5b68);}(_0xf3d2,0x76));var _0x2f3d=function(_0x40e60f,_0x5365e1){_0x40e60f=_0x40e60f-0x0;var _0x35511f=_0xf3d2[_0x40e60f];return _0x35511f;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save','remove','update'];function createListener(_0x27668b,_0x518af7){return function(_0x431561){_0x518af7[_0x2f3d('0x0')](_0x27668b,_0x431561);};}function removeListener(_0x1cef7b,_0x464a64){return function(){VoiceExtensionEvents[_0x2f3d('0x1')](_0x1cef7b,_0x464a64);};}exports[_0x2f3d('0x2')]=function(_0x509ac3){for(var _0x356050=0x0,_0x81bb0e=events['length'];_0x356050<_0x81bb0e;_0x356050++){var _0x579936=events[_0x356050];var _0x312963=createListener(_0x2f3d('0x3')+_0x579936,_0x509ac3);VoiceExtensionEvents['on'](_0x579936,_0x312963);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2c8a94f..e0bcfb4 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 _0xa965=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','post','create','put','delete'];(function(_0x2155c0,_0x9ecb29){var _0x40e5d6=function(_0x4a9bf2){while(--_0x4a9bf2){_0x2155c0['push'](_0x2155c0['shift']());}};_0x40e5d6(++_0x9ecb29);}(_0xa965,0x1e7));var _0x5a96=function(_0x44a101,_0x3729bc){_0x44a101=_0x44a101-0x0;var _0x351900=_0xa965[_0x44a101];return _0x351900;};'use strict';var multer=require('multer');var util=require(_0x5a96('0x0'));var path=require(_0x5a96('0x1'));var timeout=require(_0x5a96('0x2'));var express=require('express');var router=express[_0x5a96('0x3')]();var auth=require(_0x5a96('0x4'));var interaction=require(_0x5a96('0x5'));var config=require(_0x5a96('0x6'));var controller=require(_0x5a96('0x7'));router[_0x5a96('0x8')]('/',auth[_0x5a96('0x9')](),controller[_0x5a96('0xa')]);router['get'](_0x5a96('0xb'),auth[_0x5a96('0x9')](),controller['show']);router[_0x5a96('0x8')](_0x5a96('0xc'),auth[_0x5a96('0x9')](),controller['getMessages']);router[_0x5a96('0xd')]('/',auth[_0x5a96('0x9')](),controller[_0x5a96('0xe')]);router[_0x5a96('0xf')](_0x5a96('0xb'),auth[_0x5a96('0x9')](),controller['update']);router[_0x5a96('0x10')](_0x5a96('0xb'),auth[_0x5a96('0x9')](),controller['destroy']);module[_0x5a96('0x11')]=router; \ No newline at end of file +var _0xdcab=['update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0x267c95,_0x5f3e92){var _0x510cf5=function(_0x5b43d9){while(--_0x5b43d9){_0x267c95['push'](_0x267c95['shift']());}};_0x510cf5(++_0x5f3e92);}(_0xdcab,0xae));var _0xbdca=function(_0x5a2e18,_0x2416a3){_0x5a2e18=_0x5a2e18-0x0;var _0x39e403=_0xdcab[_0x5a2e18];return _0x39e403;};'use strict';var multer=require('multer');var util=require(_0xbdca('0x0'));var path=require('path');var timeout=require(_0xbdca('0x1'));var express=require(_0xbdca('0x2'));var router=express[_0xbdca('0x3')]();var auth=require(_0xbdca('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbdca('0x5'));var controller=require(_0xbdca('0x6'));router[_0xbdca('0x7')]('/',auth[_0xbdca('0x8')](),controller['index']);router['get'](_0xbdca('0x9'),auth['isAuthenticated'](),controller[_0xbdca('0xa')]);router[_0xbdca('0x7')](_0xbdca('0xb'),auth[_0xbdca('0x8')](),controller[_0xbdca('0xc')]);router[_0xbdca('0xd')]('/',auth['isAuthenticated'](),controller[_0xbdca('0xe')]);router[_0xbdca('0xf')](_0xbdca('0x9'),auth[_0xbdca('0x8')](),controller[_0xbdca('0x10')]);router['delete']('/:id',auth[_0xbdca('0x8')](),controller[_0xbdca('0x11')]);module[_0xbdca('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d1874bd..f8cd309 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 _0x8598=['exports','STRING','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize'];(function(_0x5cab29,_0xbc3153){var _0x381ec3=function(_0x479d6f){while(--_0x479d6f){_0x5cab29['push'](_0x5cab29['shift']());}};_0x381ec3(++_0xbc3153);}(_0x8598,0xff));var _0x8859=function(_0x51aee0,_0x253ba6){_0x51aee0=_0x51aee0-0x0;var _0x483ac7=_0x8598[_0x51aee0];return _0x483ac7;};'use strict';var Sequelize=require(_0x8859('0x0'));module[_0x8859('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8859('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x8859('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x8859('0x2')]},'fullname':{'type':Sequelize[_0x8859('0x2')]},'email':{'type':Sequelize[_0x8859('0x2')],'validate':{'isEmail':!![]},'set':function(_0x56a06e){this[_0x8859('0x3')](_0x8859('0x4'),typeof _0x56a06e===_0x8859('0x5')&&_0x56a06e['trim']()?_0x56a06e[_0x8859('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x8859('0x2')],'defaultValue':_0x8859('0x7')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8859('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8859('0x9')](_0x8859('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x8859('0x2')]},'callback':{'type':Sequelize[_0x8859('0x2')]},'review':{'type':Sequelize[_0x8859('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8859('0x9')](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8859('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8859('0x9')](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x8859('0x8'),'no'),'defaultValue':_0x8859('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8859('0x9')](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8859('0x9')](_0x8859('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8859('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x8859('0x2')]},'emailbody':{'type':Sequelize[_0x8859('0x2')]},'maxsecs':{'type':Sequelize[_0x8859('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8859('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8859('0xc')],'get':function(){return this[_0x8859('0xd')](_0x8859('0xe'))+_0x8859('0xf')+this[_0x8859('0xd')]('mailbox');}}}; \ No newline at end of file +var _0xb2c3=['ENUM','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb2c3,0xa0));var _0x3b2c=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xb2c3[_0x57da0a];return _0x3145d5;};'use strict';var Sequelize=require(_0x3b2c('0x0'));module[_0x3b2c('0x1')]={'customer_id':{'type':Sequelize[_0x3b2c('0x2')]},'context':{'type':Sequelize[_0x3b2c('0x2')],'defaultValue':_0x3b2c('0x3'),'unique':_0x3b2c('0x4')},'mailbox':{'type':Sequelize[_0x3b2c('0x2')],'defaultValue':'','allowNull':![],'unique':_0x3b2c('0x4')},'password':{'type':Sequelize[_0x3b2c('0x2')]},'fullname':{'type':Sequelize[_0x3b2c('0x2')]},'email':{'type':Sequelize[_0x3b2c('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2713c4){this[_0x3b2c('0x5')](_0x3b2c('0x6'),typeof _0x2713c4===_0x3b2c('0x7')&&_0x2713c4['trim']()?_0x2713c4[_0x3b2c('0x8')]():null);}},'pager':{'type':Sequelize[_0x3b2c('0x2')]},'tz':{'type':Sequelize[_0x3b2c('0x2')],'defaultValue':_0x3b2c('0x9')},'attach':{'type':Sequelize['ENUM'](_0x3b2c('0xa'),'no'),'defaultValue':_0x3b2c('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x3b2c('0x2')]},'review':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3b2c('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3b2c('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3b2c('0xb')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3b2c('0xb')](_0x3b2c('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3b2c('0xd')},'emailsubject':{'type':Sequelize[_0x3b2c('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x3b2c('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3b2c('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3b2c('0xf')](_0x3b2c('0x10'))+_0x3b2c('0x11')+this[_0x3b2c('0xf')](_0x3b2c('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6367b0a..f081dbc 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 _0x6154=['where','merge','key','VIRTUAL','field','options','count','includeAll','include','findAll','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','getMessages','VoiceMailMessage','order','map','mailbox','findAndCountAll','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','VoiceMail','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','filter'];(function(_0x440b99,_0x4216ce){var _0x898489=function(_0xacd375){while(--_0xacd375){_0x440b99['push'](_0x440b99['shift']());}};_0x898489(++_0x4216ce);}(_0x6154,0x1bf));var _0x4615=function(_0x2be50c,_0xe22e9f){_0x2be50c=_0x2be50c-0x0;var _0xfd4ce0=_0x6154[_0x2be50c];return _0xfd4ce0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4615('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4615('0x1'));var rp=require(_0x4615('0x2'));var moment=require(_0x4615('0x3'));var BPromise=require(_0x4615('0x4'));var Mustache=require(_0x4615('0x5'));var util=require(_0x4615('0x6'));var path=require('path');var sox=require(_0x4615('0x7'));var csv=require(_0x4615('0x8'));var ejs=require(_0x4615('0x9'));var fs=require('fs');var _=require(_0x4615('0xa'));var squel=require(_0x4615('0xb'));var crypto=require('crypto');var jsforce=require(_0x4615('0xc'));var deskjs=require(_0x4615('0xd'));var toCsv=require(_0x4615('0x8'));var querystring=require(_0x4615('0xe'));var Papa=require(_0x4615('0xf'));var authService=require(_0x4615('0x10'));var hardwareService=require(_0x4615('0x11'));var Redis=require(_0x4615('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x4615('0x13'))('api');var utils=require(_0x4615('0x14'));var config=require(_0x4615('0x15'));var db=require(_0x4615('0x16'))['db'];function respondWithStatusCode(_0x44e16,_0x122b4a){_0x122b4a=_0x122b4a||0xcc;return function(_0xf8b41d){if(_0xf8b41d){return _0x44e16[_0x4615('0x17')](_0x122b4a);}return _0x44e16[_0x4615('0x18')](_0x122b4a)[_0x4615('0x19')]();};}function respondWithResult(_0xd3760c,_0x147b3a){_0x147b3a=_0x147b3a||0xc8;return function(_0x2a6cad){if(_0x2a6cad){return _0xd3760c[_0x4615('0x18')](_0x147b3a)[_0x4615('0x1a')](_0x2a6cad);}};}function respondWithFilteredResult(_0x351b6a,_0x8e2e39){return function(_0x2cdad4){if(_0x2cdad4){var _0xd0e21d=_0x2cdad4['count'],_0xd6eff0=_0x8e2e39[_0x4615('0x1b')],_0x5f2ab9=_0x8e2e39[_0x4615('0x1b')]+_0x8e2e39['limit'],_0x35cdae;if(_0x5f2ab9>=_0xd0e21d){_0x5f2ab9=_0xd0e21d;_0x35cdae=0xc8;}else{_0x35cdae=0xce;}_0x351b6a['status'](_0x35cdae);return _0x351b6a[_0x4615('0x1c')](_0x4615('0x1d'),_0xd6eff0+'-'+_0x5f2ab9+'/'+_0xd0e21d)[_0x4615('0x1a')](_0x2cdad4);}return null;};}function patchUpdates(_0x59388d){return function(_0xdc5f4a){try{jsonpatch['apply'](_0xdc5f4a,_0x59388d,!![]);}catch(_0x27c447){return BPromise[_0x4615('0x1e')](_0x27c447);}return _0xdc5f4a['save']();};}function saveUpdates(_0x5ef757,_0x2c40d7){return function(_0x5ce59){if(_0x5ce59){return _0x5ce59[_0x4615('0x1f')](_0x5ef757)[_0x4615('0x20')](function(_0x512528){return _0x512528;});}return null;};}function removeEntity(_0x301a8c,_0x2a9c32){return function(_0xce6c45){if(_0xce6c45){return _0xce6c45[_0x4615('0x21')]()['then'](function(){var _0x3288ac=_0xce6c45['get']({'plain':!![]});var _0x38adf1=_0x4615('0x22');return db[_0x4615('0x23')]['destroy']({'where':{'type':_0x38adf1,'resourceId':_0x3288ac['id']}})[_0x4615('0x20')](function(){return _0xce6c45;});})[_0x4615('0x20')](function(){_0x301a8c[_0x4615('0x18')](0xcc)[_0x4615('0x19')]();});}};}function handleEntityNotFound(_0x241331,_0x153874){return function(_0x228c11){if(!_0x228c11){_0x241331[_0x4615('0x17')](0x194);}return _0x228c11;};}function handleError(_0x1ab8ea,_0xe2e2bc){_0xe2e2bc=_0xe2e2bc||0x1f4;return function(_0x19b4f4){logger[_0x4615('0x24')](_0x19b4f4[_0x4615('0x25')]);if(_0x19b4f4[_0x4615('0x26')]){delete _0x19b4f4[_0x4615('0x26')];}_0x1ab8ea[_0x4615('0x18')](_0xe2e2bc)[_0x4615('0x27')](_0x19b4f4);};}exports[_0x4615('0x28')]=function(_0x353760,_0x24555b){var _0x129fa9={},_0x194ffe={},_0xc84e2c={'count':0x0,'rows':[]};var _0x591772=db[_0x4615('0x29')][_0x4615('0x2a')];_0x194ffe[_0x4615('0x2b')]=_[_0x4615('0x2c')](_0x591772);_0x194ffe[_0x4615('0x2d')]=_['keys'](_0x353760[_0x4615('0x2d')]);_0x194ffe['filters']=_[_0x4615('0x2e')](_0x194ffe[_0x4615('0x2b')],_0x194ffe[_0x4615('0x2d')]);_0x129fa9[_0x4615('0x2f')]=_['intersection'](_0x194ffe[_0x4615('0x2b')],qs[_0x4615('0x30')](_0x353760[_0x4615('0x2d')][_0x4615('0x30')]));_0x129fa9[_0x4615('0x2f')]=_0x129fa9[_0x4615('0x2f')][_0x4615('0x31')]?_0x129fa9[_0x4615('0x2f')]:_0x194ffe['model'];if(!_0x353760[_0x4615('0x2d')][_0x4615('0x32')](_0x4615('0x33'))){_0x129fa9[_0x4615('0x34')]=qs[_0x4615('0x34')](_0x353760[_0x4615('0x2d')][_0x4615('0x34')]);_0x129fa9[_0x4615('0x1b')]=qs[_0x4615('0x1b')](_0x353760[_0x4615('0x2d')]['offset']);}_0x129fa9['order']=qs[_0x4615('0x35')](_0x353760[_0x4615('0x2d')][_0x4615('0x35')]);_0x129fa9['where']=qs['filters'](_[_0x4615('0x36')](_0x353760[_0x4615('0x2d')],_0x194ffe[_0x4615('0x37')]));if(_0x353760[_0x4615('0x2d')][_0x4615('0x38')]){_0x129fa9[_0x4615('0x39')]=_[_0x4615('0x3a')](_0x129fa9['where'],{'$or':_['map'](_0x591772,function(_0x41b35d){if(_0x41b35d['type'][_0x4615('0x3b')]!==_0x4615('0x3c')){var _0x37ecda={};_0x37ecda[_0x41b35d[_0x4615('0x3d')]]={'$like':'%'+_0x353760[_0x4615('0x2d')][_0x4615('0x38')]+'%'};return _0x37ecda;}})});}_0x129fa9=_[_0x4615('0x3a')]({},_0x129fa9,_0x353760[_0x4615('0x3e')]);var _0x1bfbcb={'where':_0x129fa9['where']};return db[_0x4615('0x29')]['count'](_0x1bfbcb)[_0x4615('0x20')](function(_0x5f423c){_0xc84e2c[_0x4615('0x3f')]=_0x5f423c;if(_0x353760[_0x4615('0x2d')][_0x4615('0x40')]){_0x129fa9[_0x4615('0x41')]=[{'all':!![]}];}return db[_0x4615('0x29')][_0x4615('0x42')](_0x129fa9);})[_0x4615('0x20')](function(_0x3ff953){_0xc84e2c['rows']=_0x3ff953;return _0xc84e2c;})[_0x4615('0x20')](respondWithFilteredResult(_0x24555b,_0x129fa9))['catch'](handleError(_0x24555b,null));};exports[_0x4615('0x43')]=function(_0x1e6295,_0x1ddc7f){var _0x183611={'raw':!![],'where':{'id':_0x1e6295[_0x4615('0x44')]['id']}},_0x48bda9={};_0x48bda9['model']=_[_0x4615('0x2c')](db[_0x4615('0x29')][_0x4615('0x2a')]);_0x48bda9['query']=_[_0x4615('0x2c')](_0x1e6295[_0x4615('0x2d')]);_0x48bda9[_0x4615('0x37')]=_[_0x4615('0x2e')](_0x48bda9[_0x4615('0x2b')],_0x48bda9['query']);_0x183611[_0x4615('0x2f')]=_[_0x4615('0x2e')](_0x48bda9[_0x4615('0x2b')],qs['fields'](_0x1e6295[_0x4615('0x2d')]['fields']));_0x183611[_0x4615('0x2f')]=_0x183611[_0x4615('0x2f')]['length']?_0x183611[_0x4615('0x2f')]:_0x48bda9[_0x4615('0x2b')];if(_0x1e6295[_0x4615('0x2d')]['includeAll']){_0x183611[_0x4615('0x41')]=[{'all':!![]}];}_0x183611=_[_0x4615('0x3a')]({},_0x183611,_0x1e6295[_0x4615('0x3e')]);return db['VoiceMail'][_0x4615('0x45')](_0x183611)[_0x4615('0x20')](handleEntityNotFound(_0x1ddc7f,null))[_0x4615('0x20')](respondWithResult(_0x1ddc7f,null))['catch'](handleError(_0x1ddc7f,null));};exports[_0x4615('0x46')]=function(_0x52435f,_0x540476){return db[_0x4615('0x29')][_0x4615('0x46')](_0x52435f[_0x4615('0x47')],{})['then'](function(_0x381d52){var _0x14de16=_0x52435f['user'][_0x4615('0x48')]({'plain':!![]});if(!_0x14de16)throw new Error(_0x4615('0x49'));if(_0x14de16[_0x4615('0x4a')]==='user'){var _0x155739=_0x381d52[_0x4615('0x48')]({'plain':!![]});var _0xfc1ff8=_0x4615('0x22');return db[_0x4615('0x4b')][_0x4615('0x45')]({'where':{'name':_0xfc1ff8,'userProfileId':_0x14de16[_0x4615('0x4c')]},'raw':!![]})[_0x4615('0x20')](function(_0x222d7d){if(_0x222d7d&&_0x222d7d['autoAssociation']===0x0){return db[_0x4615('0x23')]['create']({'name':_0x155739['name'],'resourceId':_0x155739['id'],'type':_0x222d7d[_0x4615('0x26')],'sectionId':_0x222d7d['id']},{})[_0x4615('0x20')](function(){return _0x381d52;});}else{return _0x381d52;}})[_0x4615('0x4d')](function(_0x390a15){logger[_0x4615('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x390a15);throw _0x390a15;});}return _0x381d52;})[_0x4615('0x20')](respondWithResult(_0x540476,0xc9))[_0x4615('0x4d')](handleError(_0x540476,null));};exports[_0x4615('0x1f')]=function(_0xbcc6b3,_0x13d2e7){if(_0xbcc6b3[_0x4615('0x47')]['id']){delete _0xbcc6b3[_0x4615('0x47')]['id'];}return db[_0x4615('0x29')][_0x4615('0x45')]({'where':{'id':_0xbcc6b3['params']['id']}})[_0x4615('0x20')](handleEntityNotFound(_0x13d2e7,null))[_0x4615('0x20')](saveUpdates(_0xbcc6b3[_0x4615('0x47')],null))[_0x4615('0x20')](respondWithResult(_0x13d2e7,null))[_0x4615('0x4d')](handleError(_0x13d2e7,null));};exports[_0x4615('0x21')]=function(_0x23686c,_0x5c7c3d){return db['VoiceMail']['find']({'where':{'id':_0x23686c[_0x4615('0x44')]['id']}})[_0x4615('0x20')](handleEntityNotFound(_0x5c7c3d,null))[_0x4615('0x20')](removeEntity(_0x5c7c3d,null))[_0x4615('0x4d')](handleError(_0x5c7c3d,null));};exports[_0x4615('0x4e')]=function(_0x382b15,_0x32d6cc,_0x1b2cee){return db['VoiceMail']['findOne']({'where':{'id':_0x382b15[_0x4615('0x44')]['id']}})[_0x4615('0x20')](handleEntityNotFound(_0x32d6cc,null))['then'](function(_0x11d017){var _0x242759;var _0x1609f1={},_0x548ac1={};_0x548ac1[_0x4615('0x2b')]=_[_0x4615('0x2c')](db[_0x4615('0x4f')][_0x4615('0x2a')]);_0x548ac1['query']=_[_0x4615('0x2c')](_0x382b15[_0x4615('0x2d')]);_0x548ac1[_0x4615('0x37')]=_['intersection'](_0x548ac1['model'],_0x548ac1[_0x4615('0x2d')]);_0x1609f1[_0x4615('0x2f')]=_[_0x4615('0x2e')](_0x548ac1[_0x4615('0x2b')],qs['fields'](_0x382b15['query'][_0x4615('0x30')]));_0x1609f1[_0x4615('0x2f')]=_0x1609f1[_0x4615('0x2f')][_0x4615('0x31')]?_0x1609f1[_0x4615('0x2f')]:_0x548ac1[_0x4615('0x2b')];if(!_0x382b15['query'][_0x4615('0x32')](_0x4615('0x33'))){_0x1609f1[_0x4615('0x34')]=qs['limit'](_0x382b15['query'][_0x4615('0x34')]);_0x1609f1['offset']=qs['offset'](_0x382b15[_0x4615('0x2d')]['offset']);}_0x1609f1[_0x4615('0x50')]=qs[_0x4615('0x35')](_0x382b15[_0x4615('0x2d')]['sort']);_0x1609f1[_0x4615('0x39')]=qs['filters'](_[_0x4615('0x36')](_0x382b15[_0x4615('0x2d')],_0x548ac1[_0x4615('0x37')]));if(_0x382b15[_0x4615('0x2d')][_0x4615('0x38')]){_0x1609f1[_0x4615('0x39')]=_[_0x4615('0x3a')](_0x1609f1[_0x4615('0x39')],{'$or':_[_0x4615('0x51')](_0x1609f1[_0x4615('0x2f')],function(_0x237278){var _0x4b1be4={};_0x4b1be4[_0x237278]={'$like':'%'+_0x382b15['query'][_0x4615('0x38')]+'%'};return _0x4b1be4;})});}_0x1609f1[_0x4615('0x39')]=_[_0x4615('0x3a')](_0x1609f1[_0x4615('0x39')],{'mailboxuser':_0x11d017[_0x4615('0x52')]});_0x1609f1=_[_0x4615('0x3a')]({},_0x1609f1,_0x382b15[_0x4615('0x3e')]);return db[_0x4615('0x4f')][_0x4615('0x53')](_0x1609f1)[_0x4615('0x20')](respondWithFilteredResult(_0x32d6cc,_0x1609f1));})[_0x4615('0x4d')](handleError(_0x32d6cc,null));}; \ No newline at end of file +var _0xf94b=['../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','map','key','VIRTUAL','field','options','findAll','rows','show','params','includeAll','include','find','catch','create','user','role','autoAssociation','body','getMessages','findOne','VoiceMailMessage','hasOwnProperty','findAndCountAll','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0xf94b,0x8a));var _0xbf94=function(_0x558bba,_0x56b1ed){_0x558bba=_0x558bba-0x0;var _0x2797c2=_0xf94b[_0x558bba];return _0x2797c2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf94('0x0'));var jsonpatch=require(_0xbf94('0x1'));var rp=require('request-promise');var moment=require(_0xbf94('0x2'));var BPromise=require(_0xbf94('0x3'));var Mustache=require(_0xbf94('0x4'));var util=require(_0xbf94('0x5'));var path=require(_0xbf94('0x6'));var sox=require(_0xbf94('0x7'));var csv=require(_0xbf94('0x8'));var ejs=require(_0xbf94('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf94('0xa'));var jsforce=require(_0xbf94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbf94('0x8'));var querystring=require('querystring');var Papa=require(_0xbf94('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xbf94('0xd'));var qs=require(_0xbf94('0xe'));var logger=require(_0xbf94('0xf'))(_0xbf94('0x10'));var utils=require(_0xbf94('0x11'));var config=require(_0xbf94('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1040c2,_0xc2a64a){_0xc2a64a=_0xc2a64a||0xcc;return function(_0x2cadc5){if(_0x2cadc5){return _0x1040c2[_0xbf94('0x13')](_0xc2a64a);}return _0x1040c2[_0xbf94('0x14')](_0xc2a64a)[_0xbf94('0x15')]();};}function respondWithResult(_0x1031cf,_0x3830a4){_0x3830a4=_0x3830a4||0xc8;return function(_0xa79808){if(_0xa79808){return _0x1031cf['status'](_0x3830a4)[_0xbf94('0x16')](_0xa79808);}};}function respondWithFilteredResult(_0x52896e,_0xec9e9){return function(_0x1ca5b8){if(_0x1ca5b8){var _0x12fcd3=_0x1ca5b8[_0xbf94('0x17')],_0x348784=_0xec9e9[_0xbf94('0x18')],_0x4b9cbc=_0xec9e9[_0xbf94('0x18')]+_0xec9e9[_0xbf94('0x19')],_0x56f2fb;if(_0x4b9cbc>=_0x12fcd3){_0x4b9cbc=_0x12fcd3;_0x56f2fb=0xc8;}else{_0x56f2fb=0xce;}_0x52896e[_0xbf94('0x14')](_0x56f2fb);return _0x52896e[_0xbf94('0x1a')](_0xbf94('0x1b'),_0x348784+'-'+_0x4b9cbc+'/'+_0x12fcd3)[_0xbf94('0x16')](_0x1ca5b8);}return null;};}function patchUpdates(_0x25304d){return function(_0x2be1e6){try{jsonpatch[_0xbf94('0x1c')](_0x2be1e6,_0x25304d,!![]);}catch(_0x4417bf){return BPromise[_0xbf94('0x1d')](_0x4417bf);}return _0x2be1e6['save']();};}function saveUpdates(_0x115302,_0x42af7d){return function(_0x17d00d){if(_0x17d00d){return _0x17d00d['update'](_0x115302)[_0xbf94('0x1e')](function(_0x230a0c){return _0x230a0c;});}return null;};}function removeEntity(_0x112366,_0x59adf4){return function(_0x107ee1){if(_0x107ee1){return _0x107ee1[_0xbf94('0x1f')]()[_0xbf94('0x1e')](function(){var _0xc7b39c=_0x107ee1[_0xbf94('0x20')]({'plain':!![]});var _0x302c72=_0xbf94('0x21');return db[_0xbf94('0x22')][_0xbf94('0x1f')]({'where':{'type':_0x302c72,'resourceId':_0xc7b39c['id']}})[_0xbf94('0x1e')](function(){return _0x107ee1;});})[_0xbf94('0x1e')](function(){_0x112366[_0xbf94('0x14')](0xcc)[_0xbf94('0x15')]();});}};}function handleEntityNotFound(_0x571c32,_0x463a09){return function(_0x128bb0){if(!_0x128bb0){_0x571c32[_0xbf94('0x13')](0x194);}return _0x128bb0;};}function handleError(_0x4890ed,_0x44342b){_0x44342b=_0x44342b||0x1f4;return function(_0xc8353a){logger[_0xbf94('0x23')](_0xc8353a[_0xbf94('0x24')]);if(_0xc8353a[_0xbf94('0x25')]){delete _0xc8353a[_0xbf94('0x25')];}_0x4890ed[_0xbf94('0x14')](_0x44342b)['send'](_0xc8353a);};}exports['index']=function(_0x2ae963,_0x3ceb45){var _0x2bfcf5={},_0x54d4f1={},_0x12ff7e={'count':0x0,'rows':[]};var _0x4c4c30=db[_0xbf94('0x26')][_0xbf94('0x27')];_0x54d4f1[_0xbf94('0x28')]=_[_0xbf94('0x29')](_0x4c4c30);_0x54d4f1['query']=_[_0xbf94('0x29')](_0x2ae963[_0xbf94('0x2a')]);_0x54d4f1['filters']=_[_0xbf94('0x2b')](_0x54d4f1[_0xbf94('0x28')],_0x54d4f1['query']);_0x2bfcf5['attributes']=_['intersection'](_0x54d4f1['model'],qs[_0xbf94('0x2c')](_0x2ae963[_0xbf94('0x2a')][_0xbf94('0x2c')]));_0x2bfcf5['attributes']=_0x2bfcf5[_0xbf94('0x2d')][_0xbf94('0x2e')]?_0x2bfcf5[_0xbf94('0x2d')]:_0x54d4f1['model'];if(!_0x2ae963[_0xbf94('0x2a')]['hasOwnProperty'](_0xbf94('0x2f'))){_0x2bfcf5['limit']=qs[_0xbf94('0x19')](_0x2ae963['query'][_0xbf94('0x19')]);_0x2bfcf5[_0xbf94('0x18')]=qs[_0xbf94('0x18')](_0x2ae963[_0xbf94('0x2a')][_0xbf94('0x18')]);}_0x2bfcf5[_0xbf94('0x30')]=qs[_0xbf94('0x31')](_0x2ae963[_0xbf94('0x2a')][_0xbf94('0x31')]);_0x2bfcf5['where']=qs['filters'](_[_0xbf94('0x32')](_0x2ae963[_0xbf94('0x2a')],_0x54d4f1[_0xbf94('0x33')]));if(_0x2ae963[_0xbf94('0x2a')][_0xbf94('0x34')]){_0x2bfcf5[_0xbf94('0x35')]=_[_0xbf94('0x36')](_0x2bfcf5[_0xbf94('0x35')],{'$or':_[_0xbf94('0x37')](_0x4c4c30,function(_0x1bc162){if(_0x1bc162['type'][_0xbf94('0x38')]!==_0xbf94('0x39')){var _0xb3c44c={};_0xb3c44c[_0x1bc162[_0xbf94('0x3a')]]={'$like':'%'+_0x2ae963['query'][_0xbf94('0x34')]+'%'};return _0xb3c44c;}})});}_0x2bfcf5=_[_0xbf94('0x36')]({},_0x2bfcf5,_0x2ae963[_0xbf94('0x3b')]);var _0x2e86df={'where':_0x2bfcf5[_0xbf94('0x35')]};return db[_0xbf94('0x26')]['count'](_0x2e86df)[_0xbf94('0x1e')](function(_0x3ef541){_0x12ff7e[_0xbf94('0x17')]=_0x3ef541;if(_0x2ae963[_0xbf94('0x2a')]['includeAll']){_0x2bfcf5['include']=[{'all':!![]}];}return db[_0xbf94('0x26')][_0xbf94('0x3c')](_0x2bfcf5);})[_0xbf94('0x1e')](function(_0x953244){_0x12ff7e[_0xbf94('0x3d')]=_0x953244;return _0x12ff7e;})['then'](respondWithFilteredResult(_0x3ceb45,_0x2bfcf5))['catch'](handleError(_0x3ceb45,null));};exports[_0xbf94('0x3e')]=function(_0x5e4f00,_0x30913f){var _0x594d91={'raw':!![],'where':{'id':_0x5e4f00[_0xbf94('0x3f')]['id']}},_0x4bcd6e={};_0x4bcd6e[_0xbf94('0x28')]=_['keys'](db['VoiceMail'][_0xbf94('0x27')]);_0x4bcd6e[_0xbf94('0x2a')]=_[_0xbf94('0x29')](_0x5e4f00[_0xbf94('0x2a')]);_0x4bcd6e[_0xbf94('0x33')]=_[_0xbf94('0x2b')](_0x4bcd6e[_0xbf94('0x28')],_0x4bcd6e[_0xbf94('0x2a')]);_0x594d91[_0xbf94('0x2d')]=_[_0xbf94('0x2b')](_0x4bcd6e[_0xbf94('0x28')],qs['fields'](_0x5e4f00[_0xbf94('0x2a')][_0xbf94('0x2c')]));_0x594d91[_0xbf94('0x2d')]=_0x594d91['attributes'][_0xbf94('0x2e')]?_0x594d91[_0xbf94('0x2d')]:_0x4bcd6e['model'];if(_0x5e4f00[_0xbf94('0x2a')][_0xbf94('0x40')]){_0x594d91[_0xbf94('0x41')]=[{'all':!![]}];}_0x594d91=_[_0xbf94('0x36')]({},_0x594d91,_0x5e4f00[_0xbf94('0x3b')]);return db[_0xbf94('0x26')][_0xbf94('0x42')](_0x594d91)[_0xbf94('0x1e')](handleEntityNotFound(_0x30913f,null))[_0xbf94('0x1e')](respondWithResult(_0x30913f,null))[_0xbf94('0x43')](handleError(_0x30913f,null));};exports[_0xbf94('0x44')]=function(_0x12da25,_0x39f3ec){return db[_0xbf94('0x26')][_0xbf94('0x44')](_0x12da25['body'],{})[_0xbf94('0x1e')](function(_0x35b25c){var _0x2b3900=_0x12da25[_0xbf94('0x45')][_0xbf94('0x20')]({'plain':!![]});if(!_0x2b3900)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b3900[_0xbf94('0x46')]===_0xbf94('0x45')){var _0x479252=_0x35b25c[_0xbf94('0x20')]({'plain':!![]});var _0x1d2f6b='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x1d2f6b,'userProfileId':_0x2b3900['userProfileId']},'raw':!![]})[_0xbf94('0x1e')](function(_0x27f6b4){if(_0x27f6b4&&_0x27f6b4[_0xbf94('0x47')]===0x0){return db['UserProfileResource'][_0xbf94('0x44')]({'name':_0x479252['name'],'resourceId':_0x479252['id'],'type':_0x27f6b4[_0xbf94('0x25')],'sectionId':_0x27f6b4['id']},{})['then'](function(){return _0x35b25c;});}else{return _0x35b25c;}})[_0xbf94('0x43')](function(_0x4bb82b){logger[_0xbf94('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bb82b);throw _0x4bb82b;});}return _0x35b25c;})[_0xbf94('0x1e')](respondWithResult(_0x39f3ec,0xc9))['catch'](handleError(_0x39f3ec,null));};exports['update']=function(_0x32c72a,_0x887da7){if(_0x32c72a[_0xbf94('0x48')]['id']){delete _0x32c72a[_0xbf94('0x48')]['id'];}return db[_0xbf94('0x26')]['find']({'where':{'id':_0x32c72a[_0xbf94('0x3f')]['id']}})['then'](handleEntityNotFound(_0x887da7,null))[_0xbf94('0x1e')](saveUpdates(_0x32c72a['body'],null))[_0xbf94('0x1e')](respondWithResult(_0x887da7,null))[_0xbf94('0x43')](handleError(_0x887da7,null));};exports[_0xbf94('0x1f')]=function(_0x1ef743,_0x5a992f){return db[_0xbf94('0x26')]['find']({'where':{'id':_0x1ef743[_0xbf94('0x3f')]['id']}})[_0xbf94('0x1e')](handleEntityNotFound(_0x5a992f,null))[_0xbf94('0x1e')](removeEntity(_0x5a992f,null))[_0xbf94('0x43')](handleError(_0x5a992f,null));};exports[_0xbf94('0x49')]=function(_0x1e3c82,_0x43dec5,_0x2823ee){return db[_0xbf94('0x26')][_0xbf94('0x4a')]({'where':{'id':_0x1e3c82[_0xbf94('0x3f')]['id']}})[_0xbf94('0x1e')](handleEntityNotFound(_0x43dec5,null))[_0xbf94('0x1e')](function(_0x1174e6){var _0x13ddfe;var _0x12e3cc={},_0x3dbfa8={};_0x3dbfa8[_0xbf94('0x28')]=_[_0xbf94('0x29')](db[_0xbf94('0x4b')][_0xbf94('0x27')]);_0x3dbfa8[_0xbf94('0x2a')]=_[_0xbf94('0x29')](_0x1e3c82[_0xbf94('0x2a')]);_0x3dbfa8['filters']=_['intersection'](_0x3dbfa8['model'],_0x3dbfa8['query']);_0x12e3cc[_0xbf94('0x2d')]=_[_0xbf94('0x2b')](_0x3dbfa8[_0xbf94('0x28')],qs['fields'](_0x1e3c82[_0xbf94('0x2a')][_0xbf94('0x2c')]));_0x12e3cc[_0xbf94('0x2d')]=_0x12e3cc[_0xbf94('0x2d')][_0xbf94('0x2e')]?_0x12e3cc[_0xbf94('0x2d')]:_0x3dbfa8[_0xbf94('0x28')];if(!_0x1e3c82[_0xbf94('0x2a')][_0xbf94('0x4c')](_0xbf94('0x2f'))){_0x12e3cc['limit']=qs[_0xbf94('0x19')](_0x1e3c82['query'][_0xbf94('0x19')]);_0x12e3cc[_0xbf94('0x18')]=qs[_0xbf94('0x18')](_0x1e3c82[_0xbf94('0x2a')]['offset']);}_0x12e3cc[_0xbf94('0x30')]=qs[_0xbf94('0x31')](_0x1e3c82[_0xbf94('0x2a')][_0xbf94('0x31')]);_0x12e3cc[_0xbf94('0x35')]=qs[_0xbf94('0x33')](_[_0xbf94('0x32')](_0x1e3c82['query'],_0x3dbfa8[_0xbf94('0x33')]));if(_0x1e3c82[_0xbf94('0x2a')][_0xbf94('0x34')]){_0x12e3cc[_0xbf94('0x35')]=_[_0xbf94('0x36')](_0x12e3cc[_0xbf94('0x35')],{'$or':_['map'](_0x12e3cc[_0xbf94('0x2d')],function(_0xfe7edd){var _0x30b755={};_0x30b755[_0xfe7edd]={'$like':'%'+_0x1e3c82[_0xbf94('0x2a')][_0xbf94('0x34')]+'%'};return _0x30b755;})});}_0x12e3cc['where']=_['merge'](_0x12e3cc[_0xbf94('0x35')],{'mailboxuser':_0x1174e6['mailbox']});_0x12e3cc=_[_0xbf94('0x36')]({},_0x12e3cc,_0x1e3c82[_0xbf94('0x3b')]);return db[_0xbf94('0x4b')][_0xbf94('0x4d')](_0x12e3cc)['then'](respondWithFilteredResult(_0x43dec5,_0x12e3cc));})[_0xbf94('0x43')](handleError(_0x43dec5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8a307c4..53d45d4 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 _0xbf28=['request-promise','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','bluebird'];(function(_0x562c83,_0x153164){var _0x2b91ae=function(_0x439d6a){while(--_0x439d6a){_0x562c83['push'](_0x562c83['shift']());}};_0x2b91ae(++_0x153164);}(_0xbf28,0x1ec));var _0x8bf2=function(_0x2dd864,_0x3d1787){_0x2dd864=_0x2dd864-0x0;var _0x14ac6e=_0xbf28[_0x2dd864];return _0x14ac6e;};'use strict';var _=require(_0x8bf2('0x0'));var util=require(_0x8bf2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8bf2('0x2'));var rp=require(_0x8bf2('0x3'));var attributes=require(_0x8bf2('0x4'));module[_0x8bf2('0x5')]=function(_0x1e8c10,_0x256b14){return _0x1e8c10[_0x8bf2('0x6')](_0x8bf2('0x7'),attributes,{'tableName':_0x8bf2('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8bf2('0x9'),_0x8bf2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5458=['bluebird','request-promise','./voiceMail.attributes','exports','define','voice_voicemail','mailbox','context','lodash','util','moment'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x5458,0x1b5));var _0x8545=function(_0x501ab8,_0x4cfecd){_0x501ab8=_0x501ab8-0x0;var _0x3527c5=_0x5458[_0x501ab8];return _0x3527c5;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8545('0x2'));var BPromise=require(_0x8545('0x3'));var rp=require(_0x8545('0x4'));var attributes=require(_0x8545('0x5'));module[_0x8545('0x6')]=function(_0xd207ef,_0x59d076){return _0xd207ef[_0x8545('0x7')]('VoiceMail',attributes,{'tableName':_0x8545('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8545('0x9'),_0x8545('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index f6e3420..d7983cc 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 _0xf1b3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xa8da91,_0x131577){var _0x49f5ea=function(_0xb9e53d){while(--_0xb9e53d){_0xa8da91['push'](_0xa8da91['shift']());}};_0x49f5ea(++_0x131577);}(_0xf1b3,0x159));var _0x3f1b=function(_0x324ecb,_0x59ef4f){_0x324ecb=_0x324ecb-0x0;var _0x915ed=_0xf1b3[_0x324ecb];return _0x915ed;};'use strict';var _=require(_0x3f1b('0x0'));var util=require(_0x3f1b('0x1'));var moment=require(_0x3f1b('0x2'));var BPromise=require(_0x3f1b('0x3'));var rs=require(_0x3f1b('0x4'));var fs=require('fs');var Redis=require(_0x3f1b('0x5'));var db=require(_0x3f1b('0x6'))['db'];var utils=require(_0x3f1b('0x7'));var logger=require('../../config/logger')(_0x3f1b('0x8'));var config=require(_0x3f1b('0x9'));var jayson=require(_0x3f1b('0xa'));var client=jayson[_0x3f1b('0xb')][_0x3f1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x476de7,_0x4bac6b,_0x494c5b){return new BPromise(function(_0x4ad80b,_0x2ee569){return client[_0x3f1b('0xd')](_0x476de7,_0x494c5b)[_0x3f1b('0xe')](function(_0xf7efdd){logger['info'](_0x3f1b('0xf'),_0x4bac6b,_0x3f1b('0x10'));logger[_0x3f1b('0x11')](_0x3f1b('0x12'),_0x4bac6b,_0x3f1b('0x10'),JSON['stringify'](_0xf7efdd));if(_0xf7efdd[_0x3f1b('0x13')]){if(_0xf7efdd['error'][_0x3f1b('0x14')]===0x1f4){logger[_0x3f1b('0x13')]('VoiceMail,\x20%s,\x20%s',_0x4bac6b,_0xf7efdd[_0x3f1b('0x13')]['message']);return _0x2ee569(_0xf7efdd['error']['message']);}logger['error'](_0x3f1b('0xf'),_0x4bac6b,_0xf7efdd['error'][_0x3f1b('0x15')]);return _0x4ad80b(_0xf7efdd[_0x3f1b('0x13')][_0x3f1b('0x15')]);}else{logger[_0x3f1b('0x16')]('VoiceMail,\x20%s,\x20%s',_0x4bac6b,_0x3f1b('0x10'));_0x4ad80b(_0xf7efdd[_0x3f1b('0x17')][_0x3f1b('0x15')]);}})[_0x3f1b('0x18')](function(_0x389a15){logger[_0x3f1b('0x13')]('VoiceMail,\x20%s,\x20%s',_0x4bac6b,_0x389a15);_0x2ee569(_0x389a15);});});} \ No newline at end of file +var _0xc514=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x4970fc,_0x1fe9b5){var _0x20ff8e=function(_0x4437ae){while(--_0x4437ae){_0x4970fc['push'](_0x4970fc['shift']());}};_0x20ff8e(++_0x1fe9b5);}(_0xc514,0x1bd));var _0x4c51=function(_0x231f6f,_0xf231e0){_0x231f6f=_0x231f6f-0x0;var _0xc621c4=_0xc514[_0x231f6f];return _0xc621c4;};'use strict';var _=require('lodash');var util=require(_0x4c51('0x0'));var moment=require('moment');var BPromise=require(_0x4c51('0x1'));var rs=require(_0x4c51('0x2'));var fs=require('fs');var Redis=require(_0x4c51('0x3'));var db=require(_0x4c51('0x4'))['db'];var utils=require(_0x4c51('0x5'));var logger=require(_0x4c51('0x6'))(_0x4c51('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c51('0x8'));var client=jayson[_0x4c51('0x9')][_0x4c51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f7d9f,_0x267a5f,_0x200591){return new BPromise(function(_0x4753f3,_0xd4d4c1){return client[_0x4c51('0xb')](_0x1f7d9f,_0x200591)[_0x4c51('0xc')](function(_0x38ed35){logger['info']('VoiceMail,\x20%s,\x20%s',_0x267a5f,_0x4c51('0xd'));logger[_0x4c51('0xe')](_0x4c51('0xf'),_0x267a5f,_0x4c51('0xd'),JSON[_0x4c51('0x10')](_0x38ed35));if(_0x38ed35[_0x4c51('0x11')]){if(_0x38ed35['error'][_0x4c51('0x12')]===0x1f4){logger['error'](_0x4c51('0x13'),_0x267a5f,_0x38ed35[_0x4c51('0x11')][_0x4c51('0x14')]);return _0xd4d4c1(_0x38ed35[_0x4c51('0x11')][_0x4c51('0x14')]);}logger[_0x4c51('0x11')](_0x4c51('0x13'),_0x267a5f,_0x38ed35[_0x4c51('0x11')][_0x4c51('0x14')]);return _0x4753f3(_0x38ed35[_0x4c51('0x11')][_0x4c51('0x14')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x267a5f,_0x4c51('0xd'));_0x4753f3(_0x38ed35[_0x4c51('0x15')][_0x4c51('0x14')]);}})[_0x4c51('0x16')](function(_0x5a0619){logger['error'](_0x4c51('0x13'),_0x267a5f,_0x5a0619);_0xd4d4c1(_0x5a0619);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 51178d0..8870d8a 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 _0x7108=['delete','exports','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update'];(function(_0x251c9f,_0x38ecfa){var _0x166705=function(_0x4aa692){while(--_0x4aa692){_0x251c9f['push'](_0x251c9f['shift']());}};_0x166705(++_0x38ecfa);}(_0x7108,0xa2));var _0x8710=function(_0x56d04e,_0x252f1e){_0x56d04e=_0x56d04e-0x0;var _0x2a244c=_0x7108[_0x56d04e];return _0x2a244c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8710('0x0'));var express=require(_0x8710('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8710('0x2'));var config=require(_0x8710('0x3'));var controller=require(_0x8710('0x4'));router[_0x8710('0x5')]('/',auth[_0x8710('0x6')](),controller[_0x8710('0x7')]);router['get'](_0x8710('0x8'),auth[_0x8710('0x6')](),controller[_0x8710('0x9')]);router['get'](_0x8710('0xa'),auth[_0x8710('0x6')](),controller[_0x8710('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8710('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8710('0xd')]);router[_0x8710('0xe')](_0x8710('0x8'),auth[_0x8710('0x6')](),controller['destroy']);module[_0x8710('0xf')]=router; \ No newline at end of file +var _0xed58=['post','create','put','delete','exports','multer','util','path','Router','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','get','/:id','/:id/download','download'];(function(_0x354b70,_0x2ee366){var _0x56a7e8=function(_0x2f6cb3){while(--_0x2f6cb3){_0x354b70['push'](_0x354b70['shift']());}};_0x56a7e8(++_0x2ee366);}(_0xed58,0x125));var _0x8ed5=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xed58[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x8ed5('0x0'));var util=require(_0x8ed5('0x1'));var path=require(_0x8ed5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8ed5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8ed5('0x4'));var config=require('../../config/environment');var controller=require(_0x8ed5('0x5'));router['get']('/',auth[_0x8ed5('0x6')](),controller['index']);router[_0x8ed5('0x7')](_0x8ed5('0x8'),auth[_0x8ed5('0x6')](),controller['show']);router[_0x8ed5('0x7')](_0x8ed5('0x9'),auth[_0x8ed5('0x6')](),controller[_0x8ed5('0xa')]);router[_0x8ed5('0xb')]('/',auth[_0x8ed5('0x6')](),controller[_0x8ed5('0xc')]);router[_0x8ed5('0xd')](_0x8ed5('0x8'),auth[_0x8ed5('0x6')](),controller['update']);router[_0x8ed5('0xe')](_0x8ed5('0x8'),auth[_0x8ed5('0x6')](),controller['destroy']);module[_0x8ed5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2fa799d..a6c268a 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 _0x8592=['TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','long'];(function(_0x500946,_0x2c8b40){var _0x11f902=function(_0x4a6ff8){while(--_0x4a6ff8){_0x500946['push'](_0x500946['shift']());}};_0x11f902(++_0x2c8b40);}(_0x8592,0x94));var _0x2859=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x8592[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0x2859('0x0'));module['exports']={'name':{'type':Sequelize[_0x2859('0x1')],'get':function(_0x154279){return this[_0x2859('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x2859('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x2859('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2859('0x4')],'defaultValue':''},'stamp':{'type':_0x2859('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xd5df=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','sequelize'];(function(_0x59d17d,_0x2deaca){var _0x301d3f=function(_0xde30c8){while(--_0xde30c8){_0x59d17d['push'](_0x59d17d['shift']());}};_0x301d3f(++_0x2deaca);}(_0xd5df,0x14f));var _0xfd5d=function(_0x2974ee,_0x242245){_0x2974ee=_0x2974ee-0x0;var _0x207020=_0xd5df[_0x2974ee];return _0x207020;};'use strict';var Sequelize=require(_0xfd5d('0x0'));module[_0xfd5d('0x1')]={'name':{'type':Sequelize[_0xfd5d('0x2')],'get':function(_0x308ea8){return this[_0xfd5d('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xfd5d('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xfd5d('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfd5d('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5830f0d..04a2f82 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 _0x8e3f=['where','filters','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','create','body','catch','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','intersection','attributes','fields','nolimit','order','sort'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xf8e3('0x0'));var emlformat=require(_0xf8e3('0x1'));var rimraf=require(_0xf8e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8e3('0x3'));var rp=require(_0xf8e3('0x4'));var moment=require(_0xf8e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf8e3('0x6'));var util=require(_0xf8e3('0x7'));var path=require('path');var sox=require(_0xf8e3('0x8'));var csv=require(_0xf8e3('0x9'));var ejs=require(_0xf8e3('0xa'));var fs=require('fs');var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x9'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var authService=require(_0xf8e3('0x11'));var hardwareService=require(_0xf8e3('0x12'));var Redis=require(_0xf8e3('0x13'));var qs=require(_0xf8e3('0x14'));var logger=require(_0xf8e3('0x15'))(_0xf8e3('0x16'));var utils=require('../../config/utils');var config=require(_0xf8e3('0x17'));var db=require(_0xf8e3('0x18'))['db'];function respondWithStatusCode(_0x3b6ac6,_0x4888eb){_0x4888eb=_0x4888eb||0xcc;return function(_0x40ae02){if(_0x40ae02){return _0x3b6ac6[_0xf8e3('0x19')](_0x4888eb);}return _0x3b6ac6[_0xf8e3('0x1a')](_0x4888eb)[_0xf8e3('0x1b')]();};}function respondWithResult(_0x565c04,_0x164c4d){_0x164c4d=_0x164c4d||0xc8;return function(_0xa856f5){if(_0xa856f5){return _0x565c04[_0xf8e3('0x1a')](_0x164c4d)['json'](_0xa856f5);}};}function respondWithFilteredResult(_0x44f631,_0x5136c6){return function(_0x1ec773){if(_0x1ec773){var _0x40c196=_0x1ec773[_0xf8e3('0x1c')],_0x460629=_0x5136c6[_0xf8e3('0x1d')],_0x570ee3=_0x5136c6[_0xf8e3('0x1d')]+_0x5136c6[_0xf8e3('0x1e')],_0x529c92;if(_0x570ee3>=_0x40c196){_0x570ee3=_0x40c196;_0x529c92=0xc8;}else{_0x529c92=0xce;}_0x44f631[_0xf8e3('0x1a')](_0x529c92);return _0x44f631[_0xf8e3('0x1f')](_0xf8e3('0x20'),_0x460629+'-'+_0x570ee3+'/'+_0x40c196)[_0xf8e3('0x21')](_0x1ec773);}return null;};}function patchUpdates(_0x1337ae){return function(_0x13fb31){try{jsonpatch['apply'](_0x13fb31,_0x1337ae,!![]);}catch(_0x20cc64){return BPromise[_0xf8e3('0x22')](_0x20cc64);}return _0x13fb31[_0xf8e3('0x23')]();};}function saveUpdates(_0x31f55d,_0x3128ad){return function(_0x11c58e){if(_0x11c58e){return _0x11c58e[_0xf8e3('0x24')](_0x31f55d)[_0xf8e3('0x25')](function(_0x5b99b1){return _0x5b99b1;});}return null;};}function removeEntity(_0xe5102b,_0x1351ca){return function(_0x3c636d){if(_0x3c636d){return _0x3c636d[_0xf8e3('0x26')]()['then'](function(){_0xe5102b[_0xf8e3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x286059,_0x225a1b){return function(_0x33d526){if(!_0x33d526){_0x286059[_0xf8e3('0x19')](0x194);}return _0x33d526;};}function handleError(_0x1f4b68,_0x3ac384){_0x3ac384=_0x3ac384||0x1f4;return function(_0x512a83){logger[_0xf8e3('0x27')](_0x512a83[_0xf8e3('0x28')]);if(_0x512a83[_0xf8e3('0x29')]){delete _0x512a83[_0xf8e3('0x29')];}_0x1f4b68[_0xf8e3('0x1a')](_0x3ac384)[_0xf8e3('0x2a')](_0x512a83);};}exports[_0xf8e3('0x2b')]=function(_0x157a2d,_0x56fa8e){var _0x356e0a={},_0x3d5a27={},_0x12ebd2={'count':0x0,'rows':[]};var _0xc4f21a=db[_0xf8e3('0x2c')][_0xf8e3('0x2d')];_0x3d5a27[_0xf8e3('0x2e')]=_[_0xf8e3('0x2f')](_['keys'](_0xc4f21a),[_0xf8e3('0x29')]);_0x3d5a27[_0xf8e3('0x30')]=_[_0xf8e3('0x31')](_0x157a2d[_0xf8e3('0x30')]);_0x3d5a27['filters']=_[_0xf8e3('0x32')](_0x3d5a27[_0xf8e3('0x2e')],_0x3d5a27[_0xf8e3('0x30')]);_0x356e0a[_0xf8e3('0x33')]=_[_0xf8e3('0x32')](_0x3d5a27[_0xf8e3('0x2e')],qs[_0xf8e3('0x34')](_0x157a2d[_0xf8e3('0x30')]['fields']));_0x356e0a[_0xf8e3('0x33')]=_0x356e0a[_0xf8e3('0x33')]['length']?_0x356e0a['attributes']:_0x3d5a27['model'];if(!_0x157a2d[_0xf8e3('0x30')]['hasOwnProperty'](_0xf8e3('0x35'))){_0x356e0a[_0xf8e3('0x1e')]=qs[_0xf8e3('0x1e')](_0x157a2d[_0xf8e3('0x30')]['limit']);_0x356e0a['offset']=qs[_0xf8e3('0x1d')](_0x157a2d[_0xf8e3('0x30')][_0xf8e3('0x1d')]);}_0x356e0a[_0xf8e3('0x36')]=qs[_0xf8e3('0x37')](_0x157a2d[_0xf8e3('0x30')]['sort']);_0x356e0a[_0xf8e3('0x38')]=qs['filters'](_['pick'](_0x157a2d[_0xf8e3('0x30')],_0x3d5a27[_0xf8e3('0x39')]));if(_0x157a2d[_0xf8e3('0x30')][_0xf8e3('0x3a')]){_0x356e0a['where']=_['merge'](_0x356e0a[_0xf8e3('0x38')],{'$or':_[_0xf8e3('0x3b')](_0xc4f21a,function(_0x5d3f14){if(_0x5d3f14[_0xf8e3('0x3c')][_0xf8e3('0x3d')]!==_0xf8e3('0x3e')){var _0x18303e={};_0x18303e[_0x5d3f14['field']]={'$like':'%'+_0x157a2d['query']['filter']+'%'};return _0x18303e;}})});}_0x356e0a=_[_0xf8e3('0x3f')]({},_0x356e0a,_0x157a2d[_0xf8e3('0x40')]);var _0x2b9ce6={'where':_0x356e0a[_0xf8e3('0x38')]};return db['VoiceMailMessage'][_0xf8e3('0x1c')](_0x2b9ce6)['then'](function(_0x20909b){_0x12ebd2[_0xf8e3('0x1c')]=_0x20909b;if(_0x157a2d[_0xf8e3('0x30')][_0xf8e3('0x41')]){_0x356e0a[_0xf8e3('0x42')]=[{'all':!![]}];}return db[_0xf8e3('0x2c')][_0xf8e3('0x43')](_0x356e0a);})[_0xf8e3('0x25')](function(_0x17c9b1){_0x12ebd2['rows']=_0x17c9b1;return _0x12ebd2;})[_0xf8e3('0x25')](respondWithFilteredResult(_0x56fa8e,_0x356e0a))['catch'](handleError(_0x56fa8e,null));};exports[_0xf8e3('0x44')]=function(_0x1e8917,_0x322128){var _0x9a6b37={'raw':!![],'where':{'id':_0x1e8917[_0xf8e3('0x45')]['id']}},_0x64bfc6={};_0x64bfc6[_0xf8e3('0x2e')]=_[_0xf8e3('0x31')](db['VoiceMailMessage'][_0xf8e3('0x2d')]);_0x64bfc6[_0xf8e3('0x30')]=_[_0xf8e3('0x31')](_0x1e8917[_0xf8e3('0x30')]);_0x64bfc6[_0xf8e3('0x39')]=_[_0xf8e3('0x32')](_0x64bfc6[_0xf8e3('0x2e')],_0x64bfc6[_0xf8e3('0x30')]);_0x9a6b37['attributes']=_['intersection'](_0x64bfc6['model'],qs[_0xf8e3('0x34')](_0x1e8917[_0xf8e3('0x30')]['fields']));_0x9a6b37[_0xf8e3('0x33')]=_0x9a6b37['attributes'][_0xf8e3('0x46')]?_0x9a6b37[_0xf8e3('0x33')]:_0x64bfc6['model'];if(_0x1e8917[_0xf8e3('0x30')]['includeAll']){_0x9a6b37[_0xf8e3('0x42')]=[{'all':!![]}];}_0x9a6b37=_[_0xf8e3('0x3f')]({},_0x9a6b37,_0x1e8917['options']);return db[_0xf8e3('0x2c')][_0xf8e3('0x47')](_0x9a6b37)[_0xf8e3('0x25')](handleEntityNotFound(_0x322128,null))[_0xf8e3('0x25')](respondWithResult(_0x322128,null))['catch'](handleError(_0x322128,null));};exports['create']=function(_0x59d51e,_0x299406){return db[_0xf8e3('0x2c')][_0xf8e3('0x48')](_0x59d51e['body'],{})[_0xf8e3('0x25')](respondWithResult(_0x299406,0xc9))['catch'](handleError(_0x299406,null));};exports[_0xf8e3('0x24')]=function(_0x1c60a5,_0x5adc90){if(_0x1c60a5['body']['id']){delete _0x1c60a5[_0xf8e3('0x49')]['id'];}return db[_0xf8e3('0x2c')][_0xf8e3('0x47')]({'where':{'id':_0x1c60a5[_0xf8e3('0x45')]['id']}})[_0xf8e3('0x25')](handleEntityNotFound(_0x5adc90,null))[_0xf8e3('0x25')](saveUpdates(_0x1c60a5[_0xf8e3('0x49')],null))[_0xf8e3('0x25')](respondWithResult(_0x5adc90,null))[_0xf8e3('0x4a')](handleError(_0x5adc90,null));};exports[_0xf8e3('0x26')]=function(_0x3200a0,_0x4c1c31){return db[_0xf8e3('0x2c')][_0xf8e3('0x47')]({'where':{'id':_0x3200a0[_0xf8e3('0x45')]['id']}})[_0xf8e3('0x25')](handleEntityNotFound(_0x4c1c31,null))[_0xf8e3('0x25')](removeEntity(_0x4c1c31,null))[_0xf8e3('0x4a')](handleError(_0x4c1c31,null));};exports['download']=function(_0x2eb2c5,_0x3534f0,_0x39caae){return db[_0xf8e3('0x2c')][_0xf8e3('0x47')]({'where':{'id':_0x2eb2c5[_0xf8e3('0x45')]['id']},'attributes':['id','recording',_0xf8e3('0x4b')]})[_0xf8e3('0x25')](handleEntityNotFound(_0x3534f0,null))[_0xf8e3('0x25')](function(_0x252c4d){if(_0x252c4d){if(!_0x252c4d[_0xf8e3('0x4c')]){throw new db[(_0xf8e3('0x4d'))]['ValidationError'](_0xf8e3('0x4e'));}var _0x1f425f={'Content-Type':_0xf8e3('0x4f'),'Content-Disposition':_0xf8e3('0x50')};if(_0x252c4d[_0xf8e3('0x4b')]){_0x1f425f['Content-Disposition']=_0xf8e3('0x51')+_0x252c4d[_0xf8e3('0x4b')]+_0xf8e3('0x52');}_0x3534f0['set'](_0x1f425f);return _0x3534f0['send'](new Buffer(_0x252c4d[_0xf8e3('0x4c')]));}})[_0xf8e3('0x4a')](handleError(_0x3534f0,null));}; \ No newline at end of file +var _0xf4f4=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceMailMessage','rawAttributes','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json'];(function(_0xd73be6,_0x15e94d){var _0x155ad0=function(_0x5f28ec){while(--_0x5f28ec){_0xd73be6['push'](_0xd73be6['shift']());}};_0x155ad0(++_0x15e94d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x224ca8,_0x303a9e){_0x224ca8=_0x224ca8-0x0;var _0x28fc95=_0xf4f4[_0x224ca8];return _0x28fc95;};'use strict';var pdf=require(_0x4f4f('0x0'));var emlformat=require(_0x4f4f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4f4f('0x2'));var jsonpatch=require(_0x4f4f('0x3'));var rp=require(_0x4f4f('0x4'));var moment=require(_0x4f4f('0x5'));var BPromise=require(_0x4f4f('0x6'));var Mustache=require('mustache');var util=require(_0x4f4f('0x7'));var path=require('path');var sox=require(_0x4f4f('0x8'));var csv=require(_0x4f4f('0x9'));var ejs=require(_0x4f4f('0xa'));var fs=require('fs');var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var authService=require(_0x4f4f('0x12'));var hardwareService=require(_0x4f4f('0x13'));var Redis=require(_0x4f4f('0x14'));var qs=require(_0x4f4f('0x15'));var logger=require(_0x4f4f('0x16'))(_0x4f4f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4f4f('0x18'))['db'];function respondWithStatusCode(_0x78c1c4,_0x35ee87){_0x35ee87=_0x35ee87||0xcc;return function(_0x1b54b0){if(_0x1b54b0){return _0x78c1c4[_0x4f4f('0x19')](_0x35ee87);}return _0x78c1c4[_0x4f4f('0x1a')](_0x35ee87)['end']();};}function respondWithResult(_0xe3d8ec,_0x5e476d){_0x5e476d=_0x5e476d||0xc8;return function(_0x216ba8){if(_0x216ba8){return _0xe3d8ec[_0x4f4f('0x1a')](_0x5e476d)[_0x4f4f('0x1b')](_0x216ba8);}};}function respondWithFilteredResult(_0x38535d,_0x4c849f){return function(_0x19f2fd){if(_0x19f2fd){var _0x4c68f4=_0x19f2fd[_0x4f4f('0x1c')],_0x47ab66=_0x4c849f[_0x4f4f('0x1d')],_0x58de77=_0x4c849f[_0x4f4f('0x1d')]+_0x4c849f[_0x4f4f('0x1e')],_0x422894;if(_0x58de77>=_0x4c68f4){_0x58de77=_0x4c68f4;_0x422894=0xc8;}else{_0x422894=0xce;}_0x38535d[_0x4f4f('0x1a')](_0x422894);return _0x38535d[_0x4f4f('0x1f')](_0x4f4f('0x20'),_0x47ab66+'-'+_0x58de77+'/'+_0x4c68f4)[_0x4f4f('0x1b')](_0x19f2fd);}return null;};}function patchUpdates(_0x2f9397){return function(_0x32b549){try{jsonpatch[_0x4f4f('0x21')](_0x32b549,_0x2f9397,!![]);}catch(_0x499277){return BPromise[_0x4f4f('0x22')](_0x499277);}return _0x32b549[_0x4f4f('0x23')]();};}function saveUpdates(_0x2f84e5,_0x201c60){return function(_0x302a79){if(_0x302a79){return _0x302a79[_0x4f4f('0x24')](_0x2f84e5)[_0x4f4f('0x25')](function(_0x3e33d5){return _0x3e33d5;});}return null;};}function removeEntity(_0x28f8ef,_0x2509a8){return function(_0x469a1d){if(_0x469a1d){return _0x469a1d[_0x4f4f('0x26')]()[_0x4f4f('0x25')](function(){_0x28f8ef[_0x4f4f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7261,_0x525529){return function(_0x272125){if(!_0x272125){_0x4f7261[_0x4f4f('0x19')](0x194);}return _0x272125;};}function handleError(_0x5186ac,_0x3960ae){_0x3960ae=_0x3960ae||0x1f4;return function(_0x15859c){logger[_0x4f4f('0x27')](_0x15859c[_0x4f4f('0x28')]);if(_0x15859c[_0x4f4f('0x29')]){delete _0x15859c[_0x4f4f('0x29')];}_0x5186ac[_0x4f4f('0x1a')](_0x3960ae)['send'](_0x15859c);};}exports[_0x4f4f('0x2a')]=function(_0x237cf9,_0x18e718){var _0x15c79c={},_0x18e864={},_0x4ad33d={'count':0x0,'rows':[]};var _0x23df57=db[_0x4f4f('0x2b')][_0x4f4f('0x2c')];_0x18e864['model']=_['differenceBy'](_['keys'](_0x23df57),[_0x4f4f('0x29')]);_0x18e864['query']=_[_0x4f4f('0x2d')](_0x237cf9[_0x4f4f('0x2e')]);_0x18e864[_0x4f4f('0x2f')]=_['intersection'](_0x18e864[_0x4f4f('0x30')],_0x18e864[_0x4f4f('0x2e')]);_0x15c79c['attributes']=_[_0x4f4f('0x31')](_0x18e864[_0x4f4f('0x30')],qs[_0x4f4f('0x32')](_0x237cf9['query'][_0x4f4f('0x32')]));_0x15c79c[_0x4f4f('0x33')]=_0x15c79c['attributes']['length']?_0x15c79c[_0x4f4f('0x33')]:_0x18e864[_0x4f4f('0x30')];if(!_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x34')](_0x4f4f('0x35'))){_0x15c79c[_0x4f4f('0x1e')]=qs[_0x4f4f('0x1e')](_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x1e')]);_0x15c79c[_0x4f4f('0x1d')]=qs['offset'](_0x237cf9['query'][_0x4f4f('0x1d')]);}_0x15c79c['order']=qs[_0x4f4f('0x36')](_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x36')]);_0x15c79c[_0x4f4f('0x37')]=qs[_0x4f4f('0x2f')](_[_0x4f4f('0x38')](_0x237cf9[_0x4f4f('0x2e')],_0x18e864[_0x4f4f('0x2f')]));if(_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x39')]){_0x15c79c[_0x4f4f('0x37')]=_[_0x4f4f('0x3a')](_0x15c79c['where'],{'$or':_[_0x4f4f('0x3b')](_0x23df57,function(_0x502017){if(_0x502017[_0x4f4f('0x3c')][_0x4f4f('0x3d')]!==_0x4f4f('0x3e')){var _0x34fe84={};_0x34fe84[_0x502017[_0x4f4f('0x3f')]]={'$like':'%'+_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x39')]+'%'};return _0x34fe84;}})});}_0x15c79c=_['merge']({},_0x15c79c,_0x237cf9[_0x4f4f('0x40')]);var _0x17dceb={'where':_0x15c79c[_0x4f4f('0x37')]};return db['VoiceMailMessage']['count'](_0x17dceb)[_0x4f4f('0x25')](function(_0x95a296){_0x4ad33d[_0x4f4f('0x1c')]=_0x95a296;if(_0x237cf9[_0x4f4f('0x2e')][_0x4f4f('0x41')]){_0x15c79c[_0x4f4f('0x42')]=[{'all':!![]}];}return db[_0x4f4f('0x2b')][_0x4f4f('0x43')](_0x15c79c);})[_0x4f4f('0x25')](function(_0x455aa0){_0x4ad33d[_0x4f4f('0x44')]=_0x455aa0;return _0x4ad33d;})[_0x4f4f('0x25')](respondWithFilteredResult(_0x18e718,_0x15c79c))['catch'](handleError(_0x18e718,null));};exports[_0x4f4f('0x45')]=function(_0x1b031e,_0x306ee7){var _0x178dec={'raw':!![],'where':{'id':_0x1b031e['params']['id']}},_0x18e805={};_0x18e805['model']=_[_0x4f4f('0x2d')](db[_0x4f4f('0x2b')][_0x4f4f('0x2c')]);_0x18e805[_0x4f4f('0x2e')]=_['keys'](_0x1b031e[_0x4f4f('0x2e')]);_0x18e805['filters']=_[_0x4f4f('0x31')](_0x18e805['model'],_0x18e805['query']);_0x178dec[_0x4f4f('0x33')]=_['intersection'](_0x18e805[_0x4f4f('0x30')],qs[_0x4f4f('0x32')](_0x1b031e['query'][_0x4f4f('0x32')]));_0x178dec[_0x4f4f('0x33')]=_0x178dec['attributes'][_0x4f4f('0x46')]?_0x178dec[_0x4f4f('0x33')]:_0x18e805[_0x4f4f('0x30')];if(_0x1b031e[_0x4f4f('0x2e')][_0x4f4f('0x41')]){_0x178dec[_0x4f4f('0x42')]=[{'all':!![]}];}_0x178dec=_[_0x4f4f('0x3a')]({},_0x178dec,_0x1b031e[_0x4f4f('0x40')]);return db[_0x4f4f('0x2b')][_0x4f4f('0x47')](_0x178dec)[_0x4f4f('0x25')](handleEntityNotFound(_0x306ee7,null))[_0x4f4f('0x25')](respondWithResult(_0x306ee7,null))[_0x4f4f('0x48')](handleError(_0x306ee7,null));};exports[_0x4f4f('0x49')]=function(_0x299994,_0x5701e6){return db[_0x4f4f('0x2b')]['create'](_0x299994['body'],{})[_0x4f4f('0x25')](respondWithResult(_0x5701e6,0xc9))[_0x4f4f('0x48')](handleError(_0x5701e6,null));};exports['update']=function(_0x12fb0d,_0x3a5b96){if(_0x12fb0d[_0x4f4f('0x4a')]['id']){delete _0x12fb0d[_0x4f4f('0x4a')]['id'];}return db[_0x4f4f('0x2b')]['find']({'where':{'id':_0x12fb0d[_0x4f4f('0x4b')]['id']}})[_0x4f4f('0x25')](handleEntityNotFound(_0x3a5b96,null))[_0x4f4f('0x25')](saveUpdates(_0x12fb0d[_0x4f4f('0x4a')],null))[_0x4f4f('0x25')](respondWithResult(_0x3a5b96,null))[_0x4f4f('0x48')](handleError(_0x3a5b96,null));};exports[_0x4f4f('0x26')]=function(_0x182c82,_0x1d93e2){return db['VoiceMailMessage'][_0x4f4f('0x47')]({'where':{'id':_0x182c82[_0x4f4f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d93e2,null))['then'](removeEntity(_0x1d93e2,null))['catch'](handleError(_0x1d93e2,null));};exports[_0x4f4f('0x4c')]=function(_0x13f453,_0x3a2ae3,_0x5c5077){return db[_0x4f4f('0x2b')]['find']({'where':{'id':_0x13f453[_0x4f4f('0x4b')]['id']},'attributes':['id',_0x4f4f('0x4d'),_0x4f4f('0x4e')]})[_0x4f4f('0x25')](handleEntityNotFound(_0x3a2ae3,null))[_0x4f4f('0x25')](function(_0x1d0867){if(_0x1d0867){if(!_0x1d0867[_0x4f4f('0x4d')]){throw new db[(_0x4f4f('0x4f'))][(_0x4f4f('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x59e207={'Content-Type':_0x4f4f('0x51'),'Content-Disposition':_0x4f4f('0x52')};if(_0x1d0867['msg_id']){_0x59e207['Content-Disposition']=_0x4f4f('0x53')+_0x1d0867[_0x4f4f('0x4e')]+_0x4f4f('0x54');}_0x3a2ae3['set'](_0x59e207);return _0x3a2ae3['send'](new Buffer(_0x1d0867[_0x4f4f('0x4d')]));}})[_0x4f4f('0x48')](handleError(_0x3a2ae3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2d3d6cd..d17f0e1 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 _0xb754=['bluebird','request-promise','exports','define','VoiceMailMessage','dir','util','../../config/logger','moment'];(function(_0x5911fc,_0x19327f){var _0x138ed6=function(_0x529462){while(--_0x529462){_0x5911fc['push'](_0x5911fc['shift']());}};_0x138ed6(++_0x19327f);}(_0xb754,0x84));var _0x4b75=function(_0x3b9859,_0x52b534){_0x3b9859=_0x3b9859-0x0;var _0x3bc080=_0xb754[_0x3b9859];return _0x3bc080;};'use strict';var _=require('lodash');var util=require(_0x4b75('0x0'));var logger=require(_0x4b75('0x1'))('api');var moment=require(_0x4b75('0x2'));var BPromise=require(_0x4b75('0x3'));var rp=require(_0x4b75('0x4'));var attributes=require('./voiceMailMessage.attributes');module[_0x4b75('0x5')]=function(_0xa3b196,_0x4f30af){return _0xa3b196[_0x4b75('0x6')](_0x4b75('0x7'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x4b75('0x8'),'fields':[_0x4b75('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3d46=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','request-promise','./voiceMailMessage.attributes','exports','define'];(function(_0x18b520,_0x1a78f9){var _0x4ec946=function(_0x21ee84){while(--_0x21ee84){_0x18b520['push'](_0x18b520['shift']());}};_0x4ec946(++_0x1a78f9);}(_0x3d46,0x1a4));var _0x63d4=function(_0x501467,_0x26294d){_0x501467=_0x501467-0x0;var _0x4ce106=_0x3d46[_0x501467];return _0x4ce106;};'use strict';var _=require(_0x63d4('0x0'));var util=require(_0x63d4('0x1'));var logger=require(_0x63d4('0x2'))(_0x63d4('0x3'));var moment=require('moment');var BPromise=require(_0x63d4('0x4'));var rp=require(_0x63d4('0x5'));var attributes=require(_0x63d4('0x6'));module[_0x63d4('0x7')]=function(_0x559360,_0xc450b4){return _0x559360[_0x63d4('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x63d4('0x9'),'paranoid':![],'indexes':[{'name':_0x63d4('0xa'),'fields':[_0x63d4('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c30975c..cdbfdb4 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 _0x4213=['../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2ecea2,_0x239eee){var _0x324928=function(_0x58da0f){while(--_0x58da0f){_0x2ecea2['push'](_0x2ecea2['shift']());}};_0x324928(++_0x239eee);}(_0x4213,0xa2));var _0x3421=function(_0x4bd9b2,_0x176627){_0x4bd9b2=_0x4bd9b2-0x0;var _0x18e56a=_0x4213[_0x4bd9b2];return _0x18e56a;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3421('0x4'));var db=require(_0x3421('0x5'))['db'];var utils=require(_0x3421('0x6'));var logger=require(_0x3421('0x7'))(_0x3421('0x8'));var config=require(_0x3421('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3421('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ca52a,_0x152b63,_0x4f7b6f){return new BPromise(function(_0xcc7199,_0x531625){return client['request'](_0x2ca52a,_0x4f7b6f)[_0x3421('0xb')](function(_0x48a03a){logger[_0x3421('0xc')](_0x3421('0xd'),_0x152b63,_0x3421('0xe'));logger['debug'](_0x3421('0xf'),_0x152b63,_0x3421('0xe'),JSON[_0x3421('0x10')](_0x48a03a));if(_0x48a03a[_0x3421('0x11')]){if(_0x48a03a['error'][_0x3421('0x12')]===0x1f4){logger[_0x3421('0x11')](_0x3421('0xd'),_0x152b63,_0x48a03a[_0x3421('0x11')][_0x3421('0x13')]);return _0x531625(_0x48a03a[_0x3421('0x11')][_0x3421('0x13')]);}logger[_0x3421('0x11')](_0x3421('0xd'),_0x152b63,_0x48a03a[_0x3421('0x11')][_0x3421('0x13')]);return _0xcc7199(_0x48a03a[_0x3421('0x11')][_0x3421('0x13')]);}else{logger[_0x3421('0xc')](_0x3421('0xd'),_0x152b63,'request\x20sent');_0xcc7199(_0x48a03a[_0x3421('0x14')]['message']);}})['catch'](function(_0xc0246f){logger['error'](_0x3421('0xd'),_0x152b63,_0xc0246f);_0x531625(_0xc0246f);});});} \ No newline at end of file +var _0x35ae=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x35ae,0x7d));var _0xe35a=function(_0x42646d,_0x22b7cc){_0x42646d=_0x42646d-0x0;var _0x128a8d=_0x35ae[_0x42646d];return _0x128a8d;};'use strict';var _=require(_0xe35a('0x0'));var util=require(_0xe35a('0x1'));var moment=require(_0xe35a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe35a('0x3'));var fs=require('fs');var Redis=require(_0xe35a('0x4'));var db=require(_0xe35a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe35a('0x6'))(_0xe35a('0x7'));var config=require(_0xe35a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe35a('0x9')][_0xe35a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4009,_0x5da541,_0x30c264){return new BPromise(function(_0x309da9,_0x5d7800){return client[_0xe35a('0xb')](_0x5e4009,_0x30c264)[_0xe35a('0xc')](function(_0x4793b1){logger[_0xe35a('0xd')](_0xe35a('0xe'),_0x5da541,_0xe35a('0xf'));logger['debug'](_0xe35a('0x10'),_0x5da541,_0xe35a('0xf'),JSON[_0xe35a('0x11')](_0x4793b1));if(_0x4793b1[_0xe35a('0x12')]){if(_0x4793b1[_0xe35a('0x12')][_0xe35a('0x13')]===0x1f4){logger[_0xe35a('0x12')](_0xe35a('0xe'),_0x5da541,_0x4793b1[_0xe35a('0x12')][_0xe35a('0x14')]);return _0x5d7800(_0x4793b1['error'][_0xe35a('0x14')]);}logger[_0xe35a('0x12')](_0xe35a('0xe'),_0x5da541,_0x4793b1[_0xe35a('0x12')][_0xe35a('0x14')]);return _0x309da9(_0x4793b1[_0xe35a('0x12')][_0xe35a('0x14')]);}else{logger[_0xe35a('0xd')](_0xe35a('0xe'),_0x5da541,_0xe35a('0xf'));_0x309da9(_0x4793b1['result'][_0xe35a('0x14')]);}})['catch'](function(_0x58c5a5){logger['error'](_0xe35a('0xe'),_0x5da541,_0x58c5a5);_0x5d7800(_0x58c5a5);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index fb54afa..105ac6d 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 _0xd64b=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/sounds','create','post','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xd64b,0xc1));var _0xbd64=function(_0x2739ac,_0x45a29d){_0x2739ac=_0x2739ac-0x0;var _0xa610df=_0xd64b[_0x2739ac];return _0xa610df;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var auth=require(_0xbd64('0x4'));var interaction=require(_0xbd64('0x5'));var config=require(_0xbd64('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbd64('0x7')](_0xbd64('0x8'),auth[_0xbd64('0x9')](),controller[_0xbd64('0xa')]);router[_0xbd64('0x7')](_0xbd64('0xb'),auth[_0xbd64('0x9')](),controller['getSounds']);router['post']('/',auth[_0xbd64('0x9')](),controller[_0xbd64('0xc')]);router[_0xbd64('0xd')]('/:id/sounds',auth[_0xbd64('0x9')](),controller[_0xbd64('0xe')]);router[_0xbd64('0xf')](_0xbd64('0x8'),auth['isAuthenticated'](),controller[_0xbd64('0x10')]);router['delete'](_0xbd64('0x8'),auth[_0xbd64('0x9')](),controller[_0xbd64('0x11')]);router[_0xbd64('0x12')](_0xbd64('0x13'),auth[_0xbd64('0x9')](),controller[_0xbd64('0x14')]);module[_0xbd64('0x15')]=router; \ No newline at end of file +var _0x9aea=['exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create','addSound','update','delete','destroy','removeSound'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0x9aea,0xdd));var _0xa9ae=function(_0x255924,_0x156178){_0x255924=_0x255924-0x0;var _0x5871c8=_0x9aea[_0x255924];return _0x5871c8;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa9ae('0x4'));var config=require(_0xa9ae('0x5'));var controller=require(_0xa9ae('0x6'));router[_0xa9ae('0x7')]('/',auth[_0xa9ae('0x8')](),controller['index']);router[_0xa9ae('0x7')](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller['show']);router[_0xa9ae('0x7')](_0xa9ae('0xa'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0xc')]('/',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xd')]);router[_0xa9ae('0xc')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xe')]);router['put'](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xf')]);router[_0xa9ae('0x10')](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x11')]);router[_0xa9ae('0x10')]('/:id/sounds/:id2',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x12')]);module[_0xa9ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 80dfd65..7299938 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 _0xfe51=['BOOLEAN','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x41fed8,_0x168adf){var _0x5d6c66=function(_0x2d3fce){while(--_0x2d3fce){_0x41fed8['push'](_0x41fed8['shift']());}};_0x5d6c66(++_0x168adf);}(_0xfe51,0x1ba));var _0x1fe5=function(_0x40d625,_0xb12951){_0x40d625=_0x40d625-0x0;var _0x18819c=_0xfe51[_0x40d625];return _0x18819c;};'use strict';var Sequelize=require('sequelize');module[_0x1fe5('0x0')]={'name':{'type':Sequelize[_0x1fe5('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1fe5('0x2')](_0x1fe5('0x3'),_0x1fe5('0x4'),_0x1fe5('0x5'),_0x1fe5('0x6'),_0x1fe5('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x1fe5('0x4')},'directory':{'type':Sequelize[_0x1fe5('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1fe5('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x1fe5('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x1fe5('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbdbc=['sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN'];(function(_0x16424e,_0x790888){var _0x47fba=function(_0x352d5a){while(--_0x352d5a){_0x16424e['push'](_0x16424e['shift']());}};_0x47fba(++_0x790888);}(_0xbdbc,0xb4));var _0xcbdb=function(_0x2c03ca,_0xad92ca){_0x2c03ca=_0x2c03ca-0x0;var _0xe670b=_0xbdbc[_0x2c03ca];return _0xe670b;};'use strict';var Sequelize=require(_0xcbdb('0x0'));module[_0xcbdb('0x1')]={'name':{'type':Sequelize[_0xcbdb('0x2')],'allowNull':![],'unique':_0xcbdb('0x3')},'mode':{'type':Sequelize[_0xcbdb('0x4')](_0xcbdb('0x5'),_0xcbdb('0x6'),'mp3nb',_0xcbdb('0x7'),_0xcbdb('0x8'),_0xcbdb('0x9')),'allowNull':!![],'defaultValue':_0xcbdb('0x6')},'directory':{'type':Sequelize[_0xcbdb('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xcbdb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xcbdb('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xcbdb('0x2')],'allowNull':!![]},'stamp':{'type':_0xcbdb('0xa')},'defaultEntry':{'type':Sequelize[_0xcbdb('0xb')],'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 36c1a55..9e815c9 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 _0xc76c=['index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','keys','VoiceMusicOnHold','find','body','params','create','transaction','mode','files','directory','join','root','mkdirSync','user','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','basename','save_name','extname','server/files/moh','symlinkSync','removeSound','id2','format','%s.%s','getSounds','options','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send'];(function(_0x5eb656,_0x4059bc){var _0x4bd9a4=function(_0x2308c2){while(--_0x2308c2){_0x5eb656['push'](_0x5eb656['shift']());}};_0x4bd9a4(++_0x4059bc);}(_0xc76c,0x18b));var _0xcc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcc76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc76('0x1'));var jsonpatch=require(_0xcc76('0x2'));var rp=require(_0xcc76('0x3'));var moment=require(_0xcc76('0x4'));var BPromise=require(_0xcc76('0x5'));var Mustache=require(_0xcc76('0x6'));var util=require(_0xcc76('0x7'));var path=require('path');var sox=require(_0xcc76('0x8'));var csv=require(_0xcc76('0x9'));var ejs=require(_0xcc76('0xa'));var fs=require('fs');var _=require(_0xcc76('0xb'));var squel=require(_0xcc76('0xc'));var crypto=require(_0xcc76('0xd'));var jsforce=require(_0xcc76('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc76('0x9'));var querystring=require(_0xcc76('0xf'));var Papa=require(_0xcc76('0x10'));var authService=require(_0xcc76('0x11'));var hardwareService=require(_0xcc76('0x12'));var Redis=require(_0xcc76('0x13'));var qs=require(_0xcc76('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xcc76('0x15'));var config=require('../../config/environment');var db=require(_0xcc76('0x16'))['db'];function respondWithStatusCode(_0x542366,_0x4b9e1d){_0x4b9e1d=_0x4b9e1d||0xcc;return function(_0x2a9642){if(_0x2a9642){return _0x542366['sendStatus'](_0x4b9e1d);}return _0x542366[_0xcc76('0x17')](_0x4b9e1d)[_0xcc76('0x18')]();};}function respondWithResult(_0x4afe90,_0x13aedd){_0x13aedd=_0x13aedd||0xc8;return function(_0x5e3690){if(_0x5e3690){return _0x4afe90[_0xcc76('0x17')](_0x13aedd)['json'](_0x5e3690);}};}function respondWithFilteredResult(_0x91ad23,_0x175332){return function(_0x463ef1){if(_0x463ef1){var _0x360d44=_0x463ef1[_0xcc76('0x19')],_0x1ebcc5=_0x175332[_0xcc76('0x1a')],_0x52e1a7=_0x175332[_0xcc76('0x1a')]+_0x175332[_0xcc76('0x1b')],_0x3d2e88;if(_0x52e1a7>=_0x360d44){_0x52e1a7=_0x360d44;_0x3d2e88=0xc8;}else{_0x3d2e88=0xce;}_0x91ad23[_0xcc76('0x17')](_0x3d2e88);return _0x91ad23['set'](_0xcc76('0x1c'),_0x1ebcc5+'-'+_0x52e1a7+'/'+_0x360d44)['json'](_0x463ef1);}return null;};}function patchUpdates(_0x18a8be){return function(_0x423f4e){try{jsonpatch[_0xcc76('0x1d')](_0x423f4e,_0x18a8be,!![]);}catch(_0x12f2ba){return BPromise[_0xcc76('0x1e')](_0x12f2ba);}return _0x423f4e['save']();};}function saveUpdates(_0x566ade,_0x5af1f8){return function(_0x4dc6c6){if(_0x4dc6c6){return _0x4dc6c6[_0xcc76('0x1f')](_0x566ade)[_0xcc76('0x20')](function(_0x5db353){return _0x5db353;});}return null;};}function removeEntity(_0x5bfc3e,_0x4f259b){return function(_0x1c4e16){if(_0x1c4e16){return _0x1c4e16[_0xcc76('0x21')]()[_0xcc76('0x20')](function(){var _0x111313=_0x1c4e16[_0xcc76('0x22')]({'plain':!![]});var _0xbb566e='MusicOnHolds';return db[_0xcc76('0x23')]['destroy']({'where':{'type':_0xbb566e,'resourceId':_0x111313['id']}})['then'](function(){return _0x1c4e16;});})[_0xcc76('0x20')](function(){_0x5bfc3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bde57,_0x241474){return function(_0x17ce5d){if(!_0x17ce5d){_0x4bde57[_0xcc76('0x24')](0x194);}return _0x17ce5d;};}function handleError(_0xc3dcc4,_0x39d995){_0x39d995=_0x39d995||0x1f4;return function(_0x21106d){logger[_0xcc76('0x25')](_0x21106d[_0xcc76('0x26')]);if(_0x21106d[_0xcc76('0x27')]){delete _0x21106d[_0xcc76('0x27')];}_0xc3dcc4[_0xcc76('0x17')](_0x39d995)[_0xcc76('0x28')](_0x21106d);};}exports[_0xcc76('0x29')]=function(_0x58b679,_0x54f7ec){var _0x3b2be5={},_0x11e4e5={},_0x4d2ddb={'count':0x0,'rows':[]};var _0x8ee25=db['VoiceMusicOnHold'][_0xcc76('0x2a')];_0x11e4e5[_0xcc76('0x2b')]=_['keys'](_0x8ee25);_0x11e4e5['query']=_['keys'](_0x58b679[_0xcc76('0x2c')]);_0x11e4e5[_0xcc76('0x2d')]=_[_0xcc76('0x2e')](_0x11e4e5[_0xcc76('0x2b')],_0x11e4e5[_0xcc76('0x2c')]);_0x3b2be5[_0xcc76('0x2f')]=_['intersection'](_0x11e4e5[_0xcc76('0x2b')],qs[_0xcc76('0x30')](_0x58b679[_0xcc76('0x2c')][_0xcc76('0x30')]));_0x3b2be5['attributes']=_0x3b2be5[_0xcc76('0x2f')][_0xcc76('0x31')]?_0x3b2be5[_0xcc76('0x2f')]:_0x11e4e5[_0xcc76('0x2b')];if(!_0x58b679['query'][_0xcc76('0x32')](_0xcc76('0x33'))){_0x3b2be5['limit']=qs[_0xcc76('0x1b')](_0x58b679['query'][_0xcc76('0x1b')]);_0x3b2be5[_0xcc76('0x1a')]=qs['offset'](_0x58b679[_0xcc76('0x2c')][_0xcc76('0x1a')]);}_0x3b2be5[_0xcc76('0x34')]=qs[_0xcc76('0x35')](_0x58b679[_0xcc76('0x2c')][_0xcc76('0x35')]);_0x3b2be5[_0xcc76('0x36')]=qs[_0xcc76('0x2d')](_[_0xcc76('0x37')](_0x58b679[_0xcc76('0x2c')],_0x11e4e5['filters']));if(_0x58b679[_0xcc76('0x2c')][_0xcc76('0x38')]){_0x3b2be5[_0xcc76('0x36')]=_[_0xcc76('0x39')](_0x3b2be5[_0xcc76('0x36')],{'$or':_[_0xcc76('0x3a')](_0x8ee25,function(_0x562439){if(_0x562439['type'][_0xcc76('0x3b')]!==_0xcc76('0x3c')){var _0x480fe8={};_0x480fe8[_0x562439[_0xcc76('0x3d')]]={'$like':'%'+_0x58b679['query'][_0xcc76('0x38')]+'%'};return _0x480fe8;}})});}_0x3b2be5=_[_0xcc76('0x39')]({},_0x3b2be5,_0x58b679['options']);var _0x129179={'where':_0x3b2be5[_0xcc76('0x36')]};return db['VoiceMusicOnHold']['count'](_0x129179)['then'](function(_0x341e03){_0x4d2ddb['count']=_0x341e03;if(_0x58b679['query'][_0xcc76('0x3e')]){_0x3b2be5[_0xcc76('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xcc76('0x40')](_0x3b2be5);})[_0xcc76('0x20')](function(_0x552653){_0x4d2ddb[_0xcc76('0x41')]=_0x552653;return _0x4d2ddb;})[_0xcc76('0x20')](respondWithFilteredResult(_0x54f7ec,_0x3b2be5))[_0xcc76('0x42')](handleError(_0x54f7ec,null));};exports[_0xcc76('0x43')]=function(_0x1b7ba2,_0x433590){var _0x24f14f={'raw':![],'where':{'id':_0x1b7ba2['params']['id']}},_0x182f0a={};_0x182f0a[_0xcc76('0x2b')]=_[_0xcc76('0x44')](db[_0xcc76('0x45')][_0xcc76('0x2a')]);_0x182f0a[_0xcc76('0x2c')]=_['keys'](_0x1b7ba2['query']);_0x182f0a[_0xcc76('0x2d')]=_[_0xcc76('0x2e')](_0x182f0a[_0xcc76('0x2b')],_0x182f0a[_0xcc76('0x2c')]);_0x24f14f['attributes']=_[_0xcc76('0x2e')](_0x182f0a[_0xcc76('0x2b')],qs[_0xcc76('0x30')](_0x1b7ba2['query'][_0xcc76('0x30')]));_0x24f14f[_0xcc76('0x2f')]=_0x24f14f[_0xcc76('0x2f')]['length']?_0x24f14f[_0xcc76('0x2f')]:_0x182f0a[_0xcc76('0x2b')];if(_0x1b7ba2[_0xcc76('0x2c')][_0xcc76('0x3e')]){_0x24f14f[_0xcc76('0x3f')]=[{'all':!![]}];}_0x24f14f=_[_0xcc76('0x39')]({},_0x24f14f,_0x1b7ba2['options']);return db[_0xcc76('0x45')][_0xcc76('0x46')](_0x24f14f)[_0xcc76('0x20')](handleEntityNotFound(_0x433590,null))[_0xcc76('0x20')](respondWithResult(_0x433590,null))['catch'](handleError(_0x433590,null));};exports[_0xcc76('0x1f')]=function(_0x5916fd,_0x5068bd){if(_0x5916fd[_0xcc76('0x47')]['id']){delete _0x5916fd[_0xcc76('0x47')]['id'];}return db[_0xcc76('0x45')][_0xcc76('0x46')]({'where':{'id':_0x5916fd[_0xcc76('0x48')]['id']}})[_0xcc76('0x20')](handleEntityNotFound(_0x5068bd,null))[_0xcc76('0x20')](saveUpdates(_0x5916fd[_0xcc76('0x47')],null))[_0xcc76('0x20')](respondWithResult(_0x5068bd,null))['catch'](handleError(_0x5068bd,null));};exports[_0xcc76('0x49')]=function(_0x22ab36,_0x41aded,_0x33bdfb){return db['sequelize'][_0xcc76('0x4a')](function(_0x30520a){if(_0x22ab36['body'][_0xcc76('0x4b')]===_0xcc76('0x4c')){_0x22ab36[_0xcc76('0x47')][_0xcc76('0x4d')]=path[_0xcc76('0x4e')](config[_0xcc76('0x4f')],'server/files/moh',_0x22ab36[_0xcc76('0x47')][_0xcc76('0x27')]);}return db[_0xcc76('0x45')]['create'](_0x22ab36[_0xcc76('0x47')],{'transaction':_0x30520a})['then'](function(_0x76a67d){if(_0x22ab36[_0xcc76('0x47')]['mode']==='files'){fs[_0xcc76('0x50')](_0x76a67d[_0xcc76('0x4d')],parseInt('0777',0x8));}var _0x4f0701=_0x22ab36[_0xcc76('0x51')][_0xcc76('0x22')]({'plain':!![]});if(!_0x4f0701)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f0701['role']==='user'){var _0x5b14e7=_0x76a67d[_0xcc76('0x22')]({'plain':!![]});return db['UserProfileSection'][_0xcc76('0x46')]({'where':{'name':_0xcc76('0x52'),'userProfileId':_0x4f0701[_0xcc76('0x53')]},'raw':!![]})[_0xcc76('0x20')](function(_0x15c688){if(_0x15c688&&_0x15c688[_0xcc76('0x54')]===0x0){return db['UserProfileResource'][_0xcc76('0x49')]({'name':_0x5b14e7[_0xcc76('0x27')],'resourceId':_0x5b14e7['id'],'type':_0x15c688['name'],'sectionId':_0x15c688['id']},{})['then'](function(){return _0x76a67d;});}else{return _0x76a67d;}})[_0xcc76('0x42')](function(_0x4e36d1){logger['error'](_0xcc76('0x55'),_0x4e36d1);});}return _0x76a67d;});})[_0xcc76('0x20')](respondWithResult(_0x41aded,0xc9))[_0xcc76('0x42')](handleError(_0x41aded,null));};exports['destroy']=function(_0x15d5f7,_0x82bd56,_0x37d591){var _0x13b821;return db[_0xcc76('0x45')][_0xcc76('0x46')]({'where':{'id':_0x15d5f7['params']['id']}})[_0xcc76('0x20')](function(_0xeaf98c){if(_0xeaf98c){return db[_0xcc76('0x56')][_0xcc76('0x4a')](function(_0x23cb1a){return _0xeaf98c[_0xcc76('0x21')]({'transaction':_0x23cb1a,'raw':!![]})[_0xcc76('0x20')](function(_0x5459ef){if(_0x5459ef[_0xcc76('0x4d')]){fs[_0xcc76('0x57')](_0x5459ef[_0xcc76('0x4d')])[_0xcc76('0x58')](function(_0x31b723){fs[_0xcc76('0x59')](path[_0xcc76('0x4e')](_0x5459ef[_0xcc76('0x4d')],_0x31b723));});fs['rmdirSync'](_0x5459ef[_0xcc76('0x4d')]);}return _0x5459ef;});})['catch'](function(_0x58b676){throw new db[(_0xcc76('0x5a'))][(_0xcc76('0x5b'))](_0x58b676[_0xcc76('0x5c')]);});}})['then'](handleEntityNotFound(_0x82bd56,null))['then'](removeEntity(_0x82bd56,null))[_0xcc76('0x42')](handleError(_0x82bd56,null));};exports[_0xcc76('0x5d')]=function(_0x5ea1e0,_0x2dad5c,_0x5593e3){return db[_0xcc76('0x56')][_0xcc76('0x4a')](function(_0xf04018){var _0x40b46d;return db[_0xcc76('0x45')][_0xcc76('0x46')]({'where':{'id':_0x5ea1e0['params']['id']}})[_0xcc76('0x20')](function(_0x353154){if(_0x353154){_0x40b46d=_0x353154;return _0x353154[_0xcc76('0x5d')](_0x5ea1e0[_0xcc76('0x47')]['id'],{'transaction':_0xf04018});}})[_0xcc76('0x20')](function(_0x37626d){if(_0x37626d){return db[_0xcc76('0x5e')][_0xcc76('0x5f')]({'where':{'id':_0x5ea1e0['body']['id']},'attributes':['id',_0xcc76('0x27'),'save_name',_0xcc76('0x60'),_0xcc76('0x61')],'raw':!![]});}})[_0xcc76('0x20')](function(_0x46e931){if(_0x46e931){var _0x190bbd=path[_0xcc76('0x4e')](config[_0xcc76('0x4f')],'server/files/sounds/converted',util['format']('%s.%s',path[_0xcc76('0x62')](_0x46e931[_0xcc76('0x63')],path[_0xcc76('0x64')](_0x46e931['save_name'])),_0x46e931[_0xcc76('0x60')]));var _0x36b7f4=path[_0xcc76('0x4e')](config['root'],_0xcc76('0x65'),_0x40b46d['name'],util['format']('%s.%s',_0x46e931['name'],_0x46e931[_0xcc76('0x60')]));fs[_0xcc76('0x66')](_0x190bbd,_0x36b7f4);return _0x46e931;}})[_0xcc76('0x42')](function(_0x3bf2ab){throw new db[(_0xcc76('0x5a'))][(_0xcc76('0x5b'))](_0x3bf2ab[_0xcc76('0x5c')]);});})[_0xcc76('0x20')](handleEntityNotFound(_0x2dad5c,null))[_0xcc76('0x20')](respondWithResult(_0x2dad5c,0xc9))[_0xcc76('0x42')](handleError(_0x2dad5c,null));};exports[_0xcc76('0x67')]=function(_0x2fb32e,_0x31fce2,_0x292023){return db['sequelize'][_0xcc76('0x4a')](function(_0x41bdd6){var _0x14a2a0;return db[_0xcc76('0x45')][_0xcc76('0x5f')]({'where':{'id':_0x2fb32e[_0xcc76('0x48')]['id']}})[_0xcc76('0x20')](handleEntityNotFound(_0x31fce2,null))['then'](function(_0x3fdf8b){if(_0x3fdf8b){_0x14a2a0=_0x3fdf8b;return _0x3fdf8b[_0xcc76('0x67')](_0x2fb32e['params'][_0xcc76('0x68')]);}})['then'](function(_0x3806fd){if(_0x3806fd){return db[_0xcc76('0x5e')][_0xcc76('0x5f')]({'where':{'id':_0x2fb32e[_0xcc76('0x48')][_0xcc76('0x68')]},'attributes':['id','name',_0xcc76('0x63'),_0xcc76('0x60'),_0xcc76('0x61')],'raw':!![]});}})[_0xcc76('0x20')](function(_0x3a42dd){if(_0x3a42dd){fs[_0xcc76('0x59')](path['join'](_0x14a2a0[_0xcc76('0x4d')],util[_0xcc76('0x69')](_0xcc76('0x6a'),_0x3a42dd[_0xcc76('0x27')],_0x3a42dd[_0xcc76('0x60')])));return _0x3a42dd;}})['catch'](function(_0x5da3a0){throw new db[(_0xcc76('0x5a'))][(_0xcc76('0x5b'))](_0x5da3a0['message']);});})[_0xcc76('0x20')](handleEntityNotFound(_0x31fce2,null))[_0xcc76('0x20')](respondWithStatusCode(_0x31fce2,0xcc))[_0xcc76('0x42')](handleError(_0x31fce2,null));};exports[_0xcc76('0x6b')]=function(_0x4fa10a,_0x419cb1,_0x5aadbf){var _0x391ae6={};var _0x258ad9={};var _0x9477b1;var _0x1f329d;return db[_0xcc76('0x45')][_0xcc76('0x5f')]({'where':{'id':_0x4fa10a[_0xcc76('0x48')]['id']}})[_0xcc76('0x20')](handleEntityNotFound(_0x419cb1,null))['then'](function(_0x20adbd){if(_0x20adbd){_0x9477b1=_0x20adbd;_0x258ad9[_0xcc76('0x2b')]=_[_0xcc76('0x44')](db[_0xcc76('0x5e')][_0xcc76('0x2a')]);_0x258ad9['query']=_[_0xcc76('0x44')](_0x4fa10a[_0xcc76('0x2c')]);_0x258ad9[_0xcc76('0x2d')]=_['intersection'](_0x258ad9[_0xcc76('0x2b')],_0x258ad9[_0xcc76('0x2c')]);_0x391ae6[_0xcc76('0x2f')]=_['intersection'](_0x258ad9[_0xcc76('0x2b')],qs['fields'](_0x4fa10a[_0xcc76('0x2c')][_0xcc76('0x30')]));_0x391ae6[_0xcc76('0x2f')]=_0x391ae6[_0xcc76('0x2f')][_0xcc76('0x31')]?_0x391ae6['attributes']:_0x258ad9['model'];_0x391ae6[_0xcc76('0x34')]=qs[_0xcc76('0x35')](_0x4fa10a[_0xcc76('0x2c')]['sort']);_0x391ae6['where']=qs[_0xcc76('0x2d')](_['pick'](_0x4fa10a[_0xcc76('0x2c')],_0x258ad9[_0xcc76('0x2d')]));if(_0x4fa10a[_0xcc76('0x2c')][_0xcc76('0x38')]){_0x391ae6[_0xcc76('0x36')]=_[_0xcc76('0x39')](_0x391ae6[_0xcc76('0x36')],{'$or':_[_0xcc76('0x3a')](_0x391ae6[_0xcc76('0x2f')],function(_0x3f2878){var _0x4a13aa={};_0x4a13aa[_0x3f2878]={'$like':'%'+_0x4fa10a[_0xcc76('0x2c')]['filter']+'%'};return _0x4a13aa;})});}_0x391ae6=_[_0xcc76('0x39')]({},_0x391ae6,_0x4fa10a[_0xcc76('0x6c')]);return _0x9477b1[_0xcc76('0x6b')](_0x391ae6);}})['then'](function(_0x48143d){if(_0x48143d){_0x1f329d=_0x48143d[_0xcc76('0x31')];if(!_0x4fa10a[_0xcc76('0x2c')][_0xcc76('0x32')]('nolimit')){_0x391ae6[_0xcc76('0x1b')]=qs[_0xcc76('0x1b')](_0x4fa10a['query'][_0xcc76('0x1b')]);_0x391ae6['offset']=qs[_0xcc76('0x1a')](_0x4fa10a['query'][_0xcc76('0x1a')]);}return _0x9477b1[_0xcc76('0x6b')](_0x391ae6);}})[_0xcc76('0x20')](function(_0x2e8ab0){if(_0x2e8ab0){return _0x2e8ab0?{'count':_0x1f329d,'rows':_0x2e8ab0}:null;}})[_0xcc76('0x20')](respondWithResult(_0x419cb1,null))[_0xcc76('0x42')](handleError(_0x419cb1,null));}; \ No newline at end of file +var _0x4e9d=['send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','count','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','name','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','join','server/files/sounds/converted','%s.%s','basename','format','symlinkSync','removeSound','id2','message','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack'];(function(_0x15ae3b,_0x17178b){var _0x109ca8=function(_0x1468d5){while(--_0x1468d5){_0x15ae3b['push'](_0x15ae3b['shift']());}};_0x109ca8(++_0x17178b);}(_0x4e9d,0xb7));var _0xd4e9=function(_0x4e33c0,_0x555fda){_0x4e33c0=_0x4e33c0-0x0;var _0x1f7aa3=_0x4e9d[_0x4e33c0];return _0x1f7aa3;};'use strict';var pdf=require(_0xd4e9('0x0'));var emlformat=require(_0xd4e9('0x1'));var rimraf=require(_0xd4e9('0x2'));var zipdir=require(_0xd4e9('0x3'));var jsonpatch=require(_0xd4e9('0x4'));var rp=require(_0xd4e9('0x5'));var moment=require(_0xd4e9('0x6'));var BPromise=require(_0xd4e9('0x7'));var Mustache=require(_0xd4e9('0x8'));var util=require('util');var path=require(_0xd4e9('0x9'));var sox=require(_0xd4e9('0xa'));var csv=require(_0xd4e9('0xb'));var ejs=require(_0xd4e9('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd4e9('0xd'));var crypto=require(_0xd4e9('0xe'));var jsforce=require(_0xd4e9('0xf'));var deskjs=require(_0xd4e9('0x10'));var toCsv=require(_0xd4e9('0xb'));var querystring=require(_0xd4e9('0x11'));var Papa=require(_0xd4e9('0x12'));var authService=require(_0xd4e9('0x13'));var hardwareService=require(_0xd4e9('0x14'));var Redis=require(_0xd4e9('0x15'));var qs=require(_0xd4e9('0x16'));var logger=require(_0xd4e9('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xd4e9('0x18'));var db=require(_0xd4e9('0x19'))['db'];function respondWithStatusCode(_0xed85de,_0x392f76){_0x392f76=_0x392f76||0xcc;return function(_0x37d898){if(_0x37d898){return _0xed85de[_0xd4e9('0x1a')](_0x392f76);}return _0xed85de[_0xd4e9('0x1b')](_0x392f76)[_0xd4e9('0x1c')]();};}function respondWithResult(_0x26fcd6,_0x4100a8){_0x4100a8=_0x4100a8||0xc8;return function(_0x2c799b){if(_0x2c799b){return _0x26fcd6['status'](_0x4100a8)[_0xd4e9('0x1d')](_0x2c799b);}};}function respondWithFilteredResult(_0x1f2ece,_0x3c344d){return function(_0x4bafc7){if(_0x4bafc7){var _0x405ccb=_0x4bafc7['count'],_0x5de468=_0x3c344d[_0xd4e9('0x1e')],_0x534d9a=_0x3c344d[_0xd4e9('0x1e')]+_0x3c344d[_0xd4e9('0x1f')],_0x3eeabf;if(_0x534d9a>=_0x405ccb){_0x534d9a=_0x405ccb;_0x3eeabf=0xc8;}else{_0x3eeabf=0xce;}_0x1f2ece[_0xd4e9('0x1b')](_0x3eeabf);return _0x1f2ece[_0xd4e9('0x20')](_0xd4e9('0x21'),_0x5de468+'-'+_0x534d9a+'/'+_0x405ccb)[_0xd4e9('0x1d')](_0x4bafc7);}return null;};}function patchUpdates(_0x3d839c){return function(_0xac0cde){try{jsonpatch[_0xd4e9('0x22')](_0xac0cde,_0x3d839c,!![]);}catch(_0x26bf42){return BPromise[_0xd4e9('0x23')](_0x26bf42);}return _0xac0cde['save']();};}function saveUpdates(_0x3c92cc,_0x36036a){return function(_0xd5a8d8){if(_0xd5a8d8){return _0xd5a8d8['update'](_0x3c92cc)[_0xd4e9('0x24')](function(_0x2fd24e){return _0x2fd24e;});}return null;};}function removeEntity(_0x4ea593,_0x20b88a){return function(_0x1f598f){if(_0x1f598f){return _0x1f598f[_0xd4e9('0x25')]()[_0xd4e9('0x24')](function(){var _0x232f0a=_0x1f598f[_0xd4e9('0x26')]({'plain':!![]});var _0x4d6e61=_0xd4e9('0x27');return db[_0xd4e9('0x28')]['destroy']({'where':{'type':_0x4d6e61,'resourceId':_0x232f0a['id']}})[_0xd4e9('0x24')](function(){return _0x1f598f;});})[_0xd4e9('0x24')](function(){_0x4ea593['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e89fa,_0x55d86a){return function(_0x1809d8){if(!_0x1809d8){_0x4e89fa[_0xd4e9('0x1a')](0x194);}return _0x1809d8;};}function handleError(_0xb6e066,_0x21abc8){_0x21abc8=_0x21abc8||0x1f4;return function(_0x284297){logger[_0xd4e9('0x29')](_0x284297[_0xd4e9('0x2a')]);if(_0x284297['name']){delete _0x284297['name'];}_0xb6e066[_0xd4e9('0x1b')](_0x21abc8)[_0xd4e9('0x2b')](_0x284297);};}exports[_0xd4e9('0x2c')]=function(_0x3a73d7,_0x289698){var _0x2ee545={},_0x5b174d={},_0x83a778={'count':0x0,'rows':[]};var _0x3e7b8b=db[_0xd4e9('0x2d')][_0xd4e9('0x2e')];_0x5b174d[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](_0x3e7b8b);_0x5b174d[_0xd4e9('0x31')]=_[_0xd4e9('0x30')](_0x3a73d7[_0xd4e9('0x31')]);_0x5b174d[_0xd4e9('0x32')]=_[_0xd4e9('0x33')](_0x5b174d[_0xd4e9('0x2f')],_0x5b174d[_0xd4e9('0x31')]);_0x2ee545[_0xd4e9('0x34')]=_[_0xd4e9('0x33')](_0x5b174d[_0xd4e9('0x2f')],qs[_0xd4e9('0x35')](_0x3a73d7['query'][_0xd4e9('0x35')]));_0x2ee545[_0xd4e9('0x34')]=_0x2ee545[_0xd4e9('0x34')][_0xd4e9('0x36')]?_0x2ee545[_0xd4e9('0x34')]:_0x5b174d[_0xd4e9('0x2f')];if(!_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x37')](_0xd4e9('0x38'))){_0x2ee545[_0xd4e9('0x1f')]=qs[_0xd4e9('0x1f')](_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x1f')]);_0x2ee545[_0xd4e9('0x1e')]=qs['offset'](_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x1e')]);}_0x2ee545[_0xd4e9('0x39')]=qs['sort'](_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x3a')]);_0x2ee545[_0xd4e9('0x3b')]=qs[_0xd4e9('0x32')](_[_0xd4e9('0x3c')](_0x3a73d7[_0xd4e9('0x31')],_0x5b174d['filters']));if(_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x3d')]){_0x2ee545[_0xd4e9('0x3b')]=_[_0xd4e9('0x3e')](_0x2ee545['where'],{'$or':_[_0xd4e9('0x3f')](_0x3e7b8b,function(_0x538037){if(_0x538037[_0xd4e9('0x40')][_0xd4e9('0x41')]!=='VIRTUAL'){var _0x2557a0={};_0x2557a0[_0x538037['field']]={'$like':'%'+_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x3d')]+'%'};return _0x2557a0;}})});}_0x2ee545=_['merge']({},_0x2ee545,_0x3a73d7[_0xd4e9('0x42')]);var _0x4ef9e5={'where':_0x2ee545['where']};return db[_0xd4e9('0x2d')][_0xd4e9('0x43')](_0x4ef9e5)['then'](function(_0x2f177e){_0x83a778[_0xd4e9('0x43')]=_0x2f177e;if(_0x3a73d7[_0xd4e9('0x31')][_0xd4e9('0x44')]){_0x2ee545[_0xd4e9('0x45')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xd4e9('0x46')](_0x2ee545);})['then'](function(_0x4302a4){_0x83a778[_0xd4e9('0x47')]=_0x4302a4;return _0x83a778;})[_0xd4e9('0x24')](respondWithFilteredResult(_0x289698,_0x2ee545))[_0xd4e9('0x48')](handleError(_0x289698,null));};exports[_0xd4e9('0x49')]=function(_0xd6a5df,_0xaf0ddc){var _0x351038={'raw':![],'where':{'id':_0xd6a5df[_0xd4e9('0x4a')]['id']}},_0x288325={};_0x288325[_0xd4e9('0x2f')]=_[_0xd4e9('0x30')](db[_0xd4e9('0x2d')]['rawAttributes']);_0x288325[_0xd4e9('0x31')]=_[_0xd4e9('0x30')](_0xd6a5df['query']);_0x288325[_0xd4e9('0x32')]=_[_0xd4e9('0x33')](_0x288325['model'],_0x288325[_0xd4e9('0x31')]);_0x351038['attributes']=_[_0xd4e9('0x33')](_0x288325[_0xd4e9('0x2f')],qs[_0xd4e9('0x35')](_0xd6a5df[_0xd4e9('0x31')][_0xd4e9('0x35')]));_0x351038[_0xd4e9('0x34')]=_0x351038[_0xd4e9('0x34')][_0xd4e9('0x36')]?_0x351038['attributes']:_0x288325[_0xd4e9('0x2f')];if(_0xd6a5df[_0xd4e9('0x31')][_0xd4e9('0x44')]){_0x351038[_0xd4e9('0x45')]=[{'all':!![]}];}_0x351038=_[_0xd4e9('0x3e')]({},_0x351038,_0xd6a5df[_0xd4e9('0x42')]);return db[_0xd4e9('0x2d')][_0xd4e9('0x4b')](_0x351038)['then'](handleEntityNotFound(_0xaf0ddc,null))['then'](respondWithResult(_0xaf0ddc,null))[_0xd4e9('0x48')](handleError(_0xaf0ddc,null));};exports['update']=function(_0x46b3b1,_0x56f056){if(_0x46b3b1['body']['id']){delete _0x46b3b1['body']['id'];}return db['VoiceMusicOnHold'][_0xd4e9('0x4b')]({'where':{'id':_0x46b3b1['params']['id']}})['then'](handleEntityNotFound(_0x56f056,null))['then'](saveUpdates(_0x46b3b1[_0xd4e9('0x4c')],null))[_0xd4e9('0x24')](respondWithResult(_0x56f056,null))[_0xd4e9('0x48')](handleError(_0x56f056,null));};exports[_0xd4e9('0x4d')]=function(_0x12557f,_0x12dd8a,_0x57be83){return db[_0xd4e9('0x4e')][_0xd4e9('0x4f')](function(_0x412005){if(_0x12557f[_0xd4e9('0x4c')][_0xd4e9('0x50')]===_0xd4e9('0x51')){_0x12557f[_0xd4e9('0x4c')][_0xd4e9('0x52')]=path['join'](config[_0xd4e9('0x53')],_0xd4e9('0x54'),_0x12557f[_0xd4e9('0x4c')][_0xd4e9('0x55')]);}return db[_0xd4e9('0x2d')]['create'](_0x12557f['body'],{'transaction':_0x412005})[_0xd4e9('0x24')](function(_0x58a50d){if(_0x12557f[_0xd4e9('0x4c')][_0xd4e9('0x50')]===_0xd4e9('0x51')){fs[_0xd4e9('0x56')](_0x58a50d['directory'],parseInt('0777',0x8));}var _0x1f4c85=_0x12557f[_0xd4e9('0x57')][_0xd4e9('0x26')]({'plain':!![]});if(!_0x1f4c85)throw new Error(_0xd4e9('0x58'));if(_0x1f4c85[_0xd4e9('0x59')]===_0xd4e9('0x57')){var _0x5e0e4a=_0x58a50d[_0xd4e9('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1f4c85[_0xd4e9('0x5a')]},'raw':!![]})[_0xd4e9('0x24')](function(_0x1f43b2){if(_0x1f43b2&&_0x1f43b2[_0xd4e9('0x5b')]===0x0){return db[_0xd4e9('0x28')][_0xd4e9('0x4d')]({'name':_0x5e0e4a[_0xd4e9('0x55')],'resourceId':_0x5e0e4a['id'],'type':_0x1f43b2[_0xd4e9('0x55')],'sectionId':_0x1f43b2['id']},{})[_0xd4e9('0x24')](function(){return _0x58a50d;});}else{return _0x58a50d;}})['catch'](function(_0x2375c0){logger[_0xd4e9('0x29')](_0xd4e9('0x5c'),_0x2375c0);});}return _0x58a50d;});})[_0xd4e9('0x24')](respondWithResult(_0x12dd8a,0xc9))[_0xd4e9('0x48')](handleError(_0x12dd8a,null));};exports[_0xd4e9('0x25')]=function(_0x270e2c,_0x54a337,_0x39a645){var _0x80e805;return db[_0xd4e9('0x2d')]['find']({'where':{'id':_0x270e2c[_0xd4e9('0x4a')]['id']}})[_0xd4e9('0x24')](function(_0x2ba766){if(_0x2ba766){return db[_0xd4e9('0x4e')]['transaction'](function(_0x481f18){return _0x2ba766[_0xd4e9('0x25')]({'transaction':_0x481f18,'raw':!![]})['then'](function(_0x102e5d){if(_0x102e5d[_0xd4e9('0x52')]){fs['readdirSync'](_0x102e5d[_0xd4e9('0x52')])[_0xd4e9('0x5d')](function(_0x467c4c){fs[_0xd4e9('0x5e')](path['join'](_0x102e5d[_0xd4e9('0x52')],_0x467c4c));});fs['rmdirSync'](_0x102e5d['directory']);}return _0x102e5d;});})[_0xd4e9('0x48')](function(_0x3abf8b){throw new db[(_0xd4e9('0x5f'))][(_0xd4e9('0x60'))](_0x3abf8b['message']);});}})[_0xd4e9('0x24')](handleEntityNotFound(_0x54a337,null))[_0xd4e9('0x24')](removeEntity(_0x54a337,null))[_0xd4e9('0x48')](handleError(_0x54a337,null));};exports[_0xd4e9('0x61')]=function(_0x562e68,_0xba235f,_0x19082d){return db[_0xd4e9('0x4e')][_0xd4e9('0x4f')](function(_0x13e371){var _0x3004da;return db[_0xd4e9('0x2d')][_0xd4e9('0x4b')]({'where':{'id':_0x562e68['params']['id']}})[_0xd4e9('0x24')](function(_0x782c0c){if(_0x782c0c){_0x3004da=_0x782c0c;return _0x782c0c[_0xd4e9('0x61')](_0x562e68[_0xd4e9('0x4c')]['id'],{'transaction':_0x13e371});}})['then'](function(_0x21c346){if(_0x21c346){return db[_0xd4e9('0x62')][_0xd4e9('0x63')]({'where':{'id':_0x562e68[_0xd4e9('0x4c')]['id']},'attributes':['id',_0xd4e9('0x55'),_0xd4e9('0x64'),_0xd4e9('0x65'),_0xd4e9('0x66')],'raw':!![]});}})[_0xd4e9('0x24')](function(_0x3ab446){if(_0x3ab446){var _0x189e6e=path[_0xd4e9('0x67')](config[_0xd4e9('0x53')],_0xd4e9('0x68'),util['format'](_0xd4e9('0x69'),path[_0xd4e9('0x6a')](_0x3ab446[_0xd4e9('0x64')],path['extname'](_0x3ab446[_0xd4e9('0x64')])),_0x3ab446[_0xd4e9('0x65')]));var _0xd27784=path['join'](config[_0xd4e9('0x53')],'server/files/moh',_0x3004da[_0xd4e9('0x55')],util[_0xd4e9('0x6b')](_0xd4e9('0x69'),_0x3ab446[_0xd4e9('0x55')],_0x3ab446[_0xd4e9('0x65')]));fs[_0xd4e9('0x6c')](_0x189e6e,_0xd27784);return _0x3ab446;}})['catch'](function(_0x616759){throw new db[(_0xd4e9('0x5f'))][(_0xd4e9('0x60'))](_0x616759['message']);});})[_0xd4e9('0x24')](handleEntityNotFound(_0xba235f,null))['then'](respondWithResult(_0xba235f,0xc9))[_0xd4e9('0x48')](handleError(_0xba235f,null));};exports[_0xd4e9('0x6d')]=function(_0x1a138d,_0x4c83dd,_0x31942e){return db[_0xd4e9('0x4e')]['transaction'](function(_0x1ac323){var _0xe77e4c;return db[_0xd4e9('0x2d')][_0xd4e9('0x63')]({'where':{'id':_0x1a138d[_0xd4e9('0x4a')]['id']}})[_0xd4e9('0x24')](handleEntityNotFound(_0x4c83dd,null))[_0xd4e9('0x24')](function(_0x3c9d57){if(_0x3c9d57){_0xe77e4c=_0x3c9d57;return _0x3c9d57['removeSound'](_0x1a138d[_0xd4e9('0x4a')][_0xd4e9('0x6e')]);}})[_0xd4e9('0x24')](function(_0x32c89e){if(_0x32c89e){return db[_0xd4e9('0x62')][_0xd4e9('0x63')]({'where':{'id':_0x1a138d[_0xd4e9('0x4a')][_0xd4e9('0x6e')]},'attributes':['id',_0xd4e9('0x55'),_0xd4e9('0x64'),'converted_format','createdAt'],'raw':!![]});}})[_0xd4e9('0x24')](function(_0x8df78){if(_0x8df78){fs[_0xd4e9('0x5e')](path['join'](_0xe77e4c[_0xd4e9('0x52')],util['format']('%s.%s',_0x8df78[_0xd4e9('0x55')],_0x8df78[_0xd4e9('0x65')])));return _0x8df78;}})['catch'](function(_0x43cc59){throw new db['Sequelize']['ValidationError'](_0x43cc59[_0xd4e9('0x6f')]);});})[_0xd4e9('0x24')](handleEntityNotFound(_0x4c83dd,null))['then'](respondWithStatusCode(_0x4c83dd,0xcc))[_0xd4e9('0x48')](handleError(_0x4c83dd,null));};exports[_0xd4e9('0x70')]=function(_0x26343d,_0x2f46a3,_0x520a11){var _0x495e04={};var _0x591804={};var _0x2df465;var _0x56f965;return db[_0xd4e9('0x2d')][_0xd4e9('0x63')]({'where':{'id':_0x26343d['params']['id']}})[_0xd4e9('0x24')](handleEntityNotFound(_0x2f46a3,null))[_0xd4e9('0x24')](function(_0x3cf04f){if(_0x3cf04f){_0x2df465=_0x3cf04f;_0x591804[_0xd4e9('0x2f')]=_['keys'](db['Sound'][_0xd4e9('0x2e')]);_0x591804[_0xd4e9('0x31')]=_[_0xd4e9('0x30')](_0x26343d[_0xd4e9('0x31')]);_0x591804[_0xd4e9('0x32')]=_['intersection'](_0x591804['model'],_0x591804[_0xd4e9('0x31')]);_0x495e04[_0xd4e9('0x34')]=_['intersection'](_0x591804[_0xd4e9('0x2f')],qs['fields'](_0x26343d[_0xd4e9('0x31')][_0xd4e9('0x35')]));_0x495e04[_0xd4e9('0x34')]=_0x495e04[_0xd4e9('0x34')][_0xd4e9('0x36')]?_0x495e04[_0xd4e9('0x34')]:_0x591804['model'];_0x495e04['order']=qs[_0xd4e9('0x3a')](_0x26343d['query']['sort']);_0x495e04['where']=qs[_0xd4e9('0x32')](_['pick'](_0x26343d[_0xd4e9('0x31')],_0x591804[_0xd4e9('0x32')]));if(_0x26343d['query']['filter']){_0x495e04[_0xd4e9('0x3b')]=_['merge'](_0x495e04[_0xd4e9('0x3b')],{'$or':_[_0xd4e9('0x3f')](_0x495e04[_0xd4e9('0x34')],function(_0x40c0bb){var _0x51f558={};_0x51f558[_0x40c0bb]={'$like':'%'+_0x26343d['query'][_0xd4e9('0x3d')]+'%'};return _0x51f558;})});}_0x495e04=_[_0xd4e9('0x3e')]({},_0x495e04,_0x26343d[_0xd4e9('0x42')]);return _0x2df465[_0xd4e9('0x70')](_0x495e04);}})[_0xd4e9('0x24')](function(_0x4bacf0){if(_0x4bacf0){_0x56f965=_0x4bacf0[_0xd4e9('0x36')];if(!_0x26343d['query']['hasOwnProperty'](_0xd4e9('0x38'))){_0x495e04[_0xd4e9('0x1f')]=qs[_0xd4e9('0x1f')](_0x26343d['query'][_0xd4e9('0x1f')]);_0x495e04['offset']=qs[_0xd4e9('0x1e')](_0x26343d[_0xd4e9('0x31')]['offset']);}return _0x2df465[_0xd4e9('0x70')](_0x495e04);}})[_0xd4e9('0x24')](function(_0x1759a6){if(_0x1759a6){return _0x1759a6?{'count':_0x56f965,'rows':_0x1759a6}:null;}})['then'](respondWithResult(_0x2f46a3,null))['catch'](handleError(_0x2f46a3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e987101..a312455 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 _0xa3d4=['./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40a12d,_0x4221b7){var _0x3e34d5=function(_0x50ccf1){while(--_0x50ccf1){_0x40a12d['push'](_0x40a12d['shift']());}};_0x3e34d5(++_0x4221b7);}(_0xa3d4,0x12d));var _0x4a3d=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa3d4[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x4a3d('0x0'));var util=require(_0x4a3d('0x1'));var logger=require(_0x4a3d('0x2'))(_0x4a3d('0x3'));var moment=require(_0x4a3d('0x4'));var BPromise=require(_0x4a3d('0x5'));var rp=require(_0x4a3d('0x6'));var attributes=require(_0x4a3d('0x7'));module[_0x4a3d('0x8')]=function(_0x355747,_0x3a7462){return _0x355747[_0x4a3d('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x4a3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a59=['lodash','util','../../config/logger','moment','./voiceMusicOnHold.attributes','define','voice_musiconhold'];(function(_0x487702,_0x49f5d4){var _0x5e7150=function(_0x2b2b29){while(--_0x2b2b29){_0x487702['push'](_0x487702['shift']());}};_0x5e7150(++_0x49f5d4);}(_0x7a59,0x12d));var _0x97a5=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x7a59[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x97a5('0x0'));var util=require(_0x97a5('0x1'));var logger=require(_0x97a5('0x2'))('api');var moment=require(_0x97a5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x97a5('0x4'));module['exports']=function(_0x3ee9c7,_0x633649){return _0x3ee9c7[_0x97a5('0x5')]('VoiceMusicOnHold',attributes,{'tableName':_0x97a5('0x6'),'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 7a38aaa..1ae724b 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 _0x807b=['../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x35e0d4,_0x4cc3b2){var _0x481513=function(_0x1b9d9d){while(--_0x1b9d9d){_0x35e0d4['push'](_0x35e0d4['shift']());}};_0x481513(++_0x4cc3b2);}(_0x807b,0x13f));var _0xb807=function(_0x974bc4,_0x39fc2c){_0x974bc4=_0x974bc4-0x0;var _0x4e38ee=_0x807b[_0x974bc4];return _0x4e38ee;};'use strict';var _=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var moment=require(_0xb807('0x2'));var BPromise=require(_0xb807('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb807('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb807('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb807('0x6'));var jayson=require(_0xb807('0x7'));var client=jayson[_0xb807('0x8')][_0xb807('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x689131,_0x4dbf7c,_0x19b355){return new BPromise(function(_0xf6982a,_0x2ff3ac){return client['request'](_0x689131,_0x19b355)[_0xb807('0xa')](function(_0x21a961){logger[_0xb807('0xb')](_0xb807('0xc'),_0x4dbf7c,'request\x20sent');logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x4dbf7c,_0xb807('0xd'),JSON[_0xb807('0xe')](_0x21a961));if(_0x21a961[_0xb807('0xf')]){if(_0x21a961[_0xb807('0xf')]['code']===0x1f4){logger[_0xb807('0xf')](_0xb807('0xc'),_0x4dbf7c,_0x21a961[_0xb807('0xf')][_0xb807('0x10')]);return _0x2ff3ac(_0x21a961['error'][_0xb807('0x10')]);}logger[_0xb807('0xf')](_0xb807('0xc'),_0x4dbf7c,_0x21a961['error'][_0xb807('0x10')]);return _0xf6982a(_0x21a961[_0xb807('0xf')][_0xb807('0x10')]);}else{logger[_0xb807('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4dbf7c,_0xb807('0xd'));_0xf6982a(_0x21a961[_0xb807('0x11')][_0xb807('0x10')]);}})['catch'](function(_0x4cd86b){logger[_0xb807('0xf')](_0xb807('0xc'),_0x4dbf7c,_0x4cd86b);_0x2ff3ac(_0x4cd86b);});});} \ No newline at end of file +var _0x1966=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash'];(function(_0x3b09d6,_0x46bd4a){var _0x4f5ffe=function(_0x34624a){while(--_0x34624a){_0x3b09d6['push'](_0x3b09d6['shift']());}};_0x4f5ffe(++_0x46bd4a);}(_0x1966,0x9f));var _0x6196=function(_0x1c73c6,_0x52f5c4){_0x1c73c6=_0x1c73c6-0x0;var _0x2347ac=_0x1966[_0x1c73c6];return _0x2347ac;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var moment=require(_0x6196('0x2'));var BPromise=require(_0x6196('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6196('0x4'));var db=require(_0x6196('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6196('0x6'));var config=require(_0x6196('0x7'));var jayson=require(_0x6196('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b56ef,_0xaa3b29,_0x36e781){return new BPromise(function(_0xb30977,_0x5101f9){return client[_0x6196('0x9')](_0x1b56ef,_0x36e781)['then'](function(_0x2f9ead){logger['info'](_0x6196('0xa'),_0xaa3b29,'request\x20sent');logger[_0x6196('0xb')](_0x6196('0xc'),_0xaa3b29,'request\x20sent',JSON[_0x6196('0xd')](_0x2f9ead));if(_0x2f9ead[_0x6196('0xe')]){if(_0x2f9ead[_0x6196('0xe')][_0x6196('0xf')]===0x1f4){logger['error'](_0x6196('0xa'),_0xaa3b29,_0x2f9ead[_0x6196('0xe')][_0x6196('0x10')]);return _0x5101f9(_0x2f9ead[_0x6196('0xe')][_0x6196('0x10')]);}logger['error'](_0x6196('0xa'),_0xaa3b29,_0x2f9ead[_0x6196('0xe')][_0x6196('0x10')]);return _0xb30977(_0x2f9ead[_0x6196('0xe')]['message']);}else{logger[_0x6196('0x11')](_0x6196('0xa'),_0xaa3b29,_0x6196('0x12'));_0xb30977(_0x2f9ead[_0x6196('0x13')][_0x6196('0x10')]);}})['catch'](function(_0x872c9f){logger['error'](_0x6196('0xa'),_0xaa3b29,_0x872c9f);_0x5101f9(_0x872c9f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 020f16a..14b3293 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 _0x3327=['describe','/:id','show','/:id/users','post','create','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','isAuthenticated'];(function(_0x3500f2,_0x142fb1){var _0x7ad03f=function(_0x2a1a07){while(--_0x2a1a07){_0x3500f2['push'](_0x3500f2['shift']());}};_0x7ad03f(++_0x142fb1);}(_0x3327,0xc8));var _0x7332=function(_0x34054f,_0x724082){_0x34054f=_0x34054f-0x0;var _0x2e4453=_0x3327[_0x34054f];return _0x2e4453;};'use strict';var multer=require(_0x7332('0x0'));var util=require('util');var path=require(_0x7332('0x1'));var timeout=require(_0x7332('0x2'));var express=require('express');var router=express[_0x7332('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7332('0x4'));var config=require('../../config/environment');var controller=require(_0x7332('0x5'));router[_0x7332('0x6')]('/',auth['isAuthenticated'](),controller[_0x7332('0x7')]);router['get'](_0x7332('0x8'),auth[_0x7332('0x9')](),controller[_0x7332('0xa')]);router[_0x7332('0x6')](_0x7332('0xb'),auth[_0x7332('0x9')](),controller[_0x7332('0xc')]);router[_0x7332('0x6')](_0x7332('0xd'),auth[_0x7332('0x9')](),controller['getAgents']);router[_0x7332('0xe')]('/',auth[_0x7332('0x9')](),controller[_0x7332('0xf')]);router[_0x7332('0xe')](_0x7332('0xd'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7332('0x10')](_0x7332('0xb'),auth[_0x7332('0x9')](),controller['update']);router[_0x7332('0x11')](_0x7332('0xb'),auth[_0x7332('0x9')](),controller[_0x7332('0x12')]);router[_0x7332('0x11')](_0x7332('0xd'),auth['isAuthenticated'](),controller[_0x7332('0x13')]);module[_0x7332('0x14')]=router; \ No newline at end of file +var _0x8039=['update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/users','post','put'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8039,0x14a));var _0x9803=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x8039[_0x4cd21c];return _0x5d8e5e;};'use strict';var multer=require(_0x9803('0x0'));var util=require(_0x9803('0x1'));var path=require(_0x9803('0x2'));var timeout=require(_0x9803('0x3'));var express=require(_0x9803('0x4'));var router=express[_0x9803('0x5')]();var auth=require(_0x9803('0x6'));var interaction=require(_0x9803('0x7'));var config=require(_0x9803('0x8'));var controller=require(_0x9803('0x9'));router['get']('/',auth[_0x9803('0xa')](),controller[_0x9803('0xb')]);router[_0x9803('0xc')](_0x9803('0xd'),auth[_0x9803('0xa')](),controller[_0x9803('0xe')]);router[_0x9803('0xc')](_0x9803('0xf'),auth[_0x9803('0xa')](),controller[_0x9803('0x10')]);router[_0x9803('0xc')](_0x9803('0x11'),auth[_0x9803('0xa')](),controller['getAgents']);router[_0x9803('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9803('0x12')](_0x9803('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9803('0x13')](_0x9803('0xf'),auth[_0x9803('0xa')](),controller[_0x9803('0x14')]);router[_0x9803('0x15')]('/:id',auth[_0x9803('0xa')](),controller[_0x9803('0x16')]);router[_0x9803('0x15')]('/:id/users',auth[_0x9803('0xa')](),controller[_0x9803('0x17')]);module[_0x9803('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 fa4b9bf..802bbb2 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 _0x8433=['STRING','sequelize','exports','name','VIRTUAL'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x8433,0x14b));var _0x3843=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x8433[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0x3843('0x0'));module[_0x3843('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3843('0x2')},'prefix':{'type':Sequelize[_0x3843('0x3')],'get':function(_0x512d18){return'system-'+this['getDataValue'](_0x3843('0x2'))+'-';}},'description':{'type':Sequelize[_0x3843('0x4')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5974=['exports','name','VIRTUAL','STRING'];(function(_0x183243,_0x7e456c){var _0x34c80f=function(_0x1772c6){while(--_0x1772c6){_0x183243['push'](_0x183243['shift']());}};_0x34c80f(++_0x7e456c);}(_0x5974,0x150));var _0x4597=function(_0x515a41,_0x4c631c){_0x515a41=_0x515a41-0x0;var _0x5a435b=_0x5974[_0x515a41];return _0x5a435b;};'use strict';var Sequelize=require('sequelize');module[_0x4597('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4597('0x1')},'prefix':{'type':Sequelize[_0x4597('0x2')],'get':function(_0x295b36){return'system-'+this['getDataValue'](_0x4597('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4597('0x3')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d93cbba..a0ce36c 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 _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x2821db,_0x363ba5){var _0x50e129=function(_0x19b021){while(--_0x19b021){_0x2821db['push'](_0x2821db['shift']());}};_0x50e129(++_0x363ba5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x248e88,_0x435c56){var _0x591021=function(_0x248992){while(--_0x248992){_0x248e88['push'](_0x248e88['shift']());}};_0x591021(++_0x435c56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 67d9240..1fb6854 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 _0x3eea=['emit','exports','events','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x23af7a,_0x12ccf6){var _0x19d89d=function(_0x4b6365){while(--_0x4b6365){_0x23af7a['push'](_0x23af7a['shift']());}};_0x19d89d(++_0x12ccf6);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x191b43,_0x36f5d2){_0x191b43=_0x191b43-0x0;var _0x45e1df=_0x3eea[_0x191b43];return _0x45e1df;};'use strict';var EventEmitter=require(_0xa3ee('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xa3ee('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa3ee('0x2')](0x0);var events={'afterCreate':_0xa3ee('0x3'),'afterUpdate':_0xa3ee('0x4'),'afterDestroy':_0xa3ee('0x5')};function emitEvent(_0x269141){return function(_0x104913,_0x35ed7d,_0x23c42d){VoicePrefixEvents[_0xa3ee('0x6')](_0x269141+':'+_0x104913['id'],_0x104913);VoicePrefixEvents[_0xa3ee('0x6')](_0x269141,_0x104913);_0x23c42d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xa3ee('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x5c12=['../../mysqldb','VoicePrefix','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1487e1,_0x373c69){var _0x278e9d=function(_0x255ef7){while(--_0x255ef7){_0x1487e1['push'](_0x1487e1['shift']());}};_0x278e9d(++_0x373c69);}(_0x5c12,0x188));var _0x25c1=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0x5c12[_0x1635fe];return _0x3c512a;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x25c1('0x0'))['db'][_0x25c1('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25c1('0x2'),'afterUpdate':_0x25c1('0x3'),'afterDestroy':_0x25c1('0x4')};function emitEvent(_0x10f10c){return function(_0x2c5df0,_0x21ec20,_0x3f0f35){VoicePrefixEvents['emit'](_0x10f10c+':'+_0x2c5df0['id'],_0x2c5df0);VoicePrefixEvents[_0x25c1('0x5')](_0x10f10c,_0x2c5df0);_0x3f0f35(null);};}for(var e in events){if(events[_0x25c1('0x6')](e)){var event=events[e];VoicePrefix[_0x25c1('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index fb83b21..1a9096b 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 _0x9576=['util','../../config/logger','api','request-promise','./voicePrefix.attributes','exports','define','VoicePrefix','lodash'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x9576,0x182));var _0x6957=function(_0x31bf78,_0x12fdc1){_0x31bf78=_0x31bf78-0x0;var _0x123f11=_0x9576[_0x31bf78];return _0x123f11;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6957('0x4'));var attributes=require(_0x6957('0x5'));module[_0x6957('0x6')]=function(_0x10ed80,_0x413fde){return _0x10ed80[_0x6957('0x7')](_0x6957('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3d8=['exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','./voicePrefix.attributes'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x8b5467,_0x4c370d){_0x8b5467=_0x8b5467-0x0;var _0x2abe1c=_0xb3d8[_0x8b5467];return _0x2abe1c;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var logger=require(_0x8b3d('0x1'))(_0x8b3d('0x2'));var moment=require(_0x8b3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x8b3d('0x4'));module[_0x8b3d('0x5')]=function(_0x3d51ca,_0x29d5f6){return _0x3d51ca[_0x8b3d('0x6')](_0x8b3d('0x7'),attributes,{'tableName':_0x8b3d('0x8'),'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 2afffc2..144cfe5 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 _0x79fa=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x56f7e2,_0x4e2a88){var _0x3cb214=function(_0x2c2f14){while(--_0x2c2f14){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x3cb214(++_0x4e2a88);}(_0x79fa,0xcc));var _0xa79f=function(_0x1d0325,_0x4a31a0){_0x1d0325=_0x1d0325-0x0;var _0x47ccf9=_0x79fa[_0x1d0325];return _0x47ccf9;};'use strict';var _=require(_0xa79f('0x0'));var util=require(_0xa79f('0x1'));var moment=require(_0xa79f('0x2'));var BPromise=require(_0xa79f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa79f('0x4'));var db=require(_0xa79f('0x5'))['db'];var utils=require(_0xa79f('0x6'));var logger=require(_0xa79f('0x7'))('rpc');var config=require(_0xa79f('0x8'));var jayson=require(_0xa79f('0x9'));var client=jayson[_0xa79f('0xa')][_0xa79f('0xb')]({'port':0x232a});config[_0xa79f('0xc')]=_[_0xa79f('0xd')](config[_0xa79f('0xc')],{'host':_0xa79f('0xe'),'port':0x18eb});var socket=require(_0xa79f('0xf'))(new Redis(config[_0xa79f('0xc')]));require(_0xa79f('0x10'))[_0xa79f('0x11')](socket);function respondWithRpcPromise(_0xe51362,_0x79d1b5,_0x21a485){return new BPromise(function(_0x1eaa48,_0x1da16e){return client[_0xa79f('0x12')](_0xe51362,_0x21a485)[_0xa79f('0x13')](function(_0x23c4f8){logger['info'](_0xa79f('0x14'),_0x79d1b5,_0xa79f('0x15'));logger['debug'](_0xa79f('0x16'),_0x79d1b5,'request\x20sent',JSON['stringify'](_0x23c4f8));if(_0x23c4f8[_0xa79f('0x17')]){if(_0x23c4f8[_0xa79f('0x17')][_0xa79f('0x18')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x79d1b5,_0x23c4f8[_0xa79f('0x17')][_0xa79f('0x19')]);return _0x1da16e(_0x23c4f8[_0xa79f('0x17')][_0xa79f('0x19')]);}logger[_0xa79f('0x17')](_0xa79f('0x14'),_0x79d1b5,_0x23c4f8['error'][_0xa79f('0x19')]);return _0x1eaa48(_0x23c4f8[_0xa79f('0x17')][_0xa79f('0x19')]);}else{logger['info'](_0xa79f('0x14'),_0x79d1b5,'request\x20sent');_0x1eaa48(_0x23c4f8[_0xa79f('0x1a')][_0xa79f('0x19')]);}})['catch'](function(_0x517fa8){logger[_0xa79f('0x17')](_0xa79f('0x14'),_0x79d1b5,_0x517fa8);_0x1da16e(_0x517fa8);});});} \ No newline at end of file +var _0x12c1=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3478fb,_0x4bea5e){var _0x2d776f=function(_0x259d09){while(--_0x259d09){_0x3478fb['push'](_0x3478fb['shift']());}};_0x2d776f(++_0x4bea5e);}(_0x12c1,0x7a));var _0x112c=function(_0xddaf81,_0x389419){_0xddaf81=_0xddaf81-0x0;var _0x5aa867=_0x12c1[_0xddaf81];return _0x5aa867;};'use strict';var _=require(_0x112c('0x0'));var util=require(_0x112c('0x1'));var moment=require(_0x112c('0x2'));var BPromise=require(_0x112c('0x3'));var rs=require(_0x112c('0x4'));var fs=require('fs');var Redis=require(_0x112c('0x5'));var db=require(_0x112c('0x6'))['db'];var utils=require(_0x112c('0x7'));var logger=require(_0x112c('0x8'))('rpc');var config=require(_0x112c('0x9'));var jayson=require(_0x112c('0xa'));var client=jayson[_0x112c('0xb')][_0x112c('0xc')]({'port':0x232a});config['redis']=_[_0x112c('0xd')](config[_0x112c('0xe')],{'host':_0x112c('0xf'),'port':0x18eb});var socket=require(_0x112c('0x10'))(new Redis(config[_0x112c('0xe')]));require(_0x112c('0x11'))[_0x112c('0x12')](socket);function respondWithRpcPromise(_0x44b3bf,_0x150e71,_0x1a9dd3){return new BPromise(function(_0x20d6ca,_0x575c12){return client[_0x112c('0x13')](_0x44b3bf,_0x1a9dd3)['then'](function(_0x21c963){logger[_0x112c('0x14')](_0x112c('0x15'),_0x150e71,'request\x20sent');logger[_0x112c('0x16')](_0x112c('0x17'),_0x150e71,'request\x20sent',JSON[_0x112c('0x18')](_0x21c963));if(_0x21c963[_0x112c('0x19')]){if(_0x21c963[_0x112c('0x19')][_0x112c('0x1a')]===0x1f4){logger['error'](_0x112c('0x15'),_0x150e71,_0x21c963[_0x112c('0x19')]['message']);return _0x575c12(_0x21c963[_0x112c('0x19')]['message']);}logger[_0x112c('0x19')](_0x112c('0x15'),_0x150e71,_0x21c963[_0x112c('0x19')][_0x112c('0x1b')]);return _0x20d6ca(_0x21c963[_0x112c('0x19')][_0x112c('0x1b')]);}else{logger[_0x112c('0x14')](_0x112c('0x15'),_0x150e71,_0x112c('0x1c'));_0x20d6ca(_0x21c963['result']['message']);}})[_0x112c('0x1d')](function(_0x9503cd){logger[_0x112c('0x19')]('VoicePrefix,\x20%s,\x20%s',_0x150e71,_0x9503cd);_0x575c12(_0x9503cd);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c5f4719..a385fbb 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 _0x3f43=['remove','update','emit','register','voicePrefix:','./voicePrefix.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f43,0xc9));var _0x33f4=function(_0x5e3fc7,_0x26fdd7){_0x5e3fc7=_0x5e3fc7-0x0;var _0x1db423=_0x3f43[_0x5e3fc7];return _0x1db423;};'use strict';var VoicePrefixEvents=require(_0x33f4('0x0'));var events=[_0x33f4('0x1'),_0x33f4('0x2'),_0x33f4('0x3')];function createListener(_0x1548bd,_0x195ec9){return function(_0x2e5da8){_0x195ec9[_0x33f4('0x4')](_0x1548bd,_0x2e5da8);};}function removeListener(_0x576d82,_0x3bd17f){return function(){VoicePrefixEvents['removeListener'](_0x576d82,_0x3bd17f);};}exports[_0x33f4('0x5')]=function(_0x2c6229){for(var _0x5b556b=0x0,_0x520f17=events['length'];_0x5b556b<_0x520f17;_0x5b556b++){var _0x358a62=events[_0x5b556b];var _0x11bc7e=createListener(_0x33f4('0x6')+_0x358a62,_0x2c6229);VoicePrefixEvents['on'](_0x358a62,_0x11bc7e);}}; \ No newline at end of file +var _0x5de0=['remove','update','emit','register','length','voicePrefix:','save'];(function(_0x4e82ff,_0x3cbf4b){var _0x495205=function(_0x21bc88){while(--_0x21bc88){_0x4e82ff['push'](_0x4e82ff['shift']());}};_0x495205(++_0x3cbf4b);}(_0x5de0,0x19c));var _0x05de=function(_0xd1d172,_0x300e48){_0xd1d172=_0xd1d172-0x0;var _0x38d753=_0x5de0[_0xd1d172];return _0x38d753;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x05de('0x0'),_0x05de('0x1'),_0x05de('0x2')];function createListener(_0x113c14,_0x545ea7){return function(_0x1b6391){_0x545ea7[_0x05de('0x3')](_0x113c14,_0x1b6391);};}function removeListener(_0x51160c,_0x6f1dfe){return function(){VoicePrefixEvents['removeListener'](_0x51160c,_0x6f1dfe);};}exports[_0x05de('0x4')]=function(_0x1a2575){for(var _0x1c6dcd=0x0,_0x16e4e1=events[_0x05de('0x5')];_0x1c6dcd<_0x16e4e1;_0x1c6dcd++){var _0x2b3a64=events[_0x1c6dcd];var _0x30f66e=createListener(_0x05de('0x6')+_0x2b3a64,_0x1a2575);VoicePrefixEvents['on'](_0x2b3a64,_0x30f66e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 526551e..dd9a53f 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 _0xa8a8=['getBlackLists','create','post','/:id/clone','clone','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8a8,0xec));var _0x8a8a=function(_0xcf36ea,_0x451d18){_0xcf36ea=_0xcf36ea-0x0;var _0x1c2c1d=_0xa8a8[_0xcf36ea];return _0x1c2c1d;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var auth=require(_0x8a8a('0x5'));var interaction=require(_0x8a8a('0x6'));var config=require(_0x8a8a('0x7'));var controller=require(_0x8a8a('0x8'));router[_0x8a8a('0x9')]('/',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xb')]);router[_0x8a8a('0x9')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xd')]);router[_0x8a8a('0x9')](_0x8a8a('0xe'),auth[_0x8a8a('0xa')](),controller['getHoppers']);router['get'](_0x8a8a('0xf'),auth['isAuthenticated'](),controller[_0x8a8a('0x10')]);router[_0x8a8a('0x9')]('/:id/hopper_finals',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x9')]('/:id/hopper_black',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x12')]);router[_0x8a8a('0x9')](_0x8a8a('0x13'),auth['isAuthenticated'](),controller[_0x8a8a('0x14')]);router['get'](_0x8a8a('0x15'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x16')]);router[_0x8a8a('0x9')](_0x8a8a('0x17'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x18')]);router['get'](_0x8a8a('0x19'),auth['isAuthenticated'](),controller[_0x8a8a('0x1a')]);router[_0x8a8a('0x9')](_0x8a8a('0x1b'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x1c')]);router['post']('/',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x1d')]);router[_0x8a8a('0x1e')](_0x8a8a('0x1f'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x20')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x8a8a('0x15'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x21')]);router[_0x8a8a('0x1e')](_0x8a8a('0x19'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x22')]);router[_0x8a8a('0x1e')](_0x8a8a('0x1b'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x23')]);router[_0x8a8a('0x24')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x25')]);router['delete'](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x26')]);router[_0x8a8a('0x27')](_0x8a8a('0x13'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x28')]);router['delete'](_0x8a8a('0x15'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x29')]);router['delete']('/:id/lists',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x2a')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8a8a('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x54ef=['getAgents','/:id/members','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','update','delete','destroy','/:id/teams','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54ef,0x112));var _0xf54e=function(_0x1c5791,_0x5a1e30){_0x1c5791=_0x1c5791-0x0;var _0x525bb6=_0x54ef[_0x1c5791];return _0x525bb6;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['show']);router[_0xf54e('0x9')]('/:id/hoppers',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['get'](_0xf54e('0xd'),auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x9')]('/:id/hopper_finals',auth[_0xf54e('0xb')](),controller[_0xf54e('0xf')]);router[_0xf54e('0x9')](_0xf54e('0x10'),auth['isAuthenticated'](),controller[_0xf54e('0x11')]);router['get']('/:id/teams',auth[_0xf54e('0xb')](),controller[_0xf54e('0x12')]);router[_0xf54e('0x9')](_0xf54e('0x13'),auth['isAuthenticated'](),controller[_0xf54e('0x14')]);router[_0xf54e('0x9')](_0xf54e('0x15'),auth[_0xf54e('0xb')](),controller['getMembers']);router[_0xf54e('0x9')](_0xf54e('0x16'),auth[_0xf54e('0xb')](),controller['getLists']);router['get'](_0xf54e('0x17'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x18')]);router[_0xf54e('0x19')]('/',auth[_0xf54e('0xb')](),controller[_0xf54e('0x1a')]);router[_0xf54e('0x19')](_0xf54e('0x1b'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x1c')]);router[_0xf54e('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf54e('0x1d')]);router['post'](_0xf54e('0x13'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x1e')]);router[_0xf54e('0x19')](_0xf54e('0x16'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x1f')]);router[_0xf54e('0x19')](_0xf54e('0x17'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x20')]);router['put'](_0xf54e('0xa'),auth['isAuthenticated'](),controller[_0xf54e('0x21')]);router[_0xf54e('0x22')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x23')]);router[_0xf54e('0x22')](_0xf54e('0x24'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x25')]);router[_0xf54e('0x22')](_0xf54e('0x13'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x26')]);router['delete'](_0xf54e('0x16'),auth['isAuthenticated'](),controller[_0xf54e('0x27')]);router['delete'](_0xf54e('0x17'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x28')]);module[_0xf54e('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d595afa..13a936a 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 _0xa6f2=['booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','leavewhenempty','join','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','outbound','inbound','default','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','dialMethod','strategy'];(function(_0x27aebb,_0x2a32a5){var _0x374e35=function(_0x26c7f6){while(--_0x26c7f6){_0x27aebb['push'](_0x27aebb['shift']());}};_0x374e35(++_0x2a32a5);}(_0xa6f2,0x115));var _0x2a6f=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa6f2[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x2a6f('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a6f('0x1')],'allowNull':![],'unique':_0x2a6f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x2a6f('0x3')),'allowNull':![],'defaultValue':_0x2a6f('0x4')},'musiconhold':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':_0x2a6f('0x5')},'announce':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x2a6f('0x6')]('rr',_0x2a6f('0x7'),_0x2a6f('0x8'),_0x2a6f('0x9'),_0x2a6f('0xa'),_0x2a6f('0xb'),_0x2a6f('0xc'),_0x2a6f('0xd'),_0x2a6f('0xe')),'allowNull':![],'defaultValue':_0x2a6f('0x7'),'set':function(_0x3689bf){this[_0x2a6f('0xf')]('strategy',_0x3689bf?_0x3689bf:_0x2a6f('0xb'));},'get':function(){var _0x4e6bb9=this[_0x2a6f('0x10')]('type');var _0x1f1831=this[_0x2a6f('0x10')](_0x2a6f('0x11'));var _0x5426e4=this[_0x2a6f('0x10')](_0x2a6f('0x12'));if(_0x4e6bb9==='inbound'){return _0x5426e4;}if(_0x1f1831===_0x2a6f('0x13')&&_0x5426e4===_0x2a6f('0xb')||_0x1f1831===_0x2a6f('0x13')&&_0x5426e4===_0x2a6f('0x14')){return _0x5426e4;}if(_0x1f1831===_0x2a6f('0x15')||_0x1f1831==='predictive'||_0x1f1831===_0x2a6f('0x16')){return _0x5426e4;}return null;}},'servicelevel':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2a6f('0x17')](0xb)},'timeout':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2a6f('0x6')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x2a6f('0x6')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2a6f('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2a6f('0x6')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2a6f('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no',_0x2a6f('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x2a6f('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2a6f('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2a6f('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2a6f('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2a6f('0x1')]},'queue_quantity1':{'type':Sequelize[_0x2a6f('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x2a6f('0x1')]},'queue_less_than':{'type':Sequelize[_0x2a6f('0x1')]},'periodic_announce':{'type':Sequelize[_0x2a6f('0x1a')],'set':function(_0x2b0f9a){this[_0x2a6f('0xf')](_0x2a6f('0x1b'),_0x2b0f9a?_0x2b0f9a['join'](','):[]);},'get':function(){return this['getDataValue'](_0x2a6f('0x1b'))?this[_0x2a6f('0x10')](_0x2a6f('0x1b'))[_0x2a6f('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':_0x2a6f('0x18'),'set':function(_0x2884a4){this[_0x2a6f('0xf')](_0x2a6f('0x1d'),_0x2884a4?_0x2884a4['join'](','):[]);},'get':function(){return this[_0x2a6f('0x10')]('joinempty')?this['getDataValue'](_0x2a6f('0x1d'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':'no','set':function(_0x15aa66){this[_0x2a6f('0xf')](_0x2a6f('0x1e'),_0x15aa66?_0x15aa66[_0x2a6f('0x1f')](','):[]);},'get':function(){return this[_0x2a6f('0x10')](_0x2a6f('0x1e'))?this[_0x2a6f('0x10')]('leavewhenempty')['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':0x0,'set':function(_0x18c8df){this[_0x2a6f('0xf')](_0x2a6f('0x21'),_0x18c8df);if(_0x18c8df){if(this[_0x2a6f('0x10')](_0x2a6f('0x22'))<0x2){this[_0x2a6f('0xf')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2a6f('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':0x0,'comment':_0x2a6f('0x23')},'dialMethod':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x24'),_0x2a6f('0x15'),'power',_0x2a6f('0x25'),'booked'),'defaultValue':_0x2a6f('0x15'),'comment':_0x2a6f('0x26')},'dialLimitChannel':{'type':Sequelize[_0x2a6f('0x17')](0x4)[_0x2a6f('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a6f('0x28')},'dialLimitQueue':{'type':Sequelize[_0x2a6f('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a6f('0x29')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x2a6f('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2a6f('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x2b'),_0x2a6f('0x2c')),'defaultValue':_0x2a6f('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2a6f('0x2d')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2a6f('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a6f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2a6f('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2a6f('0x17')](0x3)[_0x2a6f('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a6f('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2a6f('0x30'),'comment':_0x2a6f('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x2a6f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x2a6f('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2a6f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a6f('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a6f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a6f('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x2a6f('0x17')](0x3)[_0x2a6f('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a6f('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a6f('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a6f('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2a6f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x2a6f('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a6f('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a6f('0x17')](0x3)[_0x2a6f('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2a6f('0x39')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2a6f('0x1')],'defaultValue':_0x2a6f('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x3b'),_0x2a6f('0x3c'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2a6f('0x17')](0x9)[_0x2a6f('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x2a6f('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a6f('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a6f('0x17')](0x9)[_0x2a6f('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2a6f('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a6f('0x17')](0x9)[_0x2a6f('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a6f('0x3f')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2a6f('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a6f('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a6f('0x17')](0x9)[_0x2a6f('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2a6f('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a6f('0x17')](0x9)[_0x2a6f('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a6f('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a6f('0x17')](0x5)[_0x2a6f('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a6f('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x2a6f('0x17')](0x5)[_0x2a6f('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':0x0,'comment':_0x2a6f('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a6f('0x6')](_0x2a6f('0x45'),_0x2a6f('0x46')),'defaultValue':_0x2a6f('0x45')},'dialQueueProject2':{'type':Sequelize[_0x2a6f('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2a6f('0x17')](0x3)[_0x2a6f('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2a6f('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a6f('0x17')],'allowNull':!![],'comment':_0x2a6f('0x47')},'mandatoryDisposition':{'type':Sequelize[_0x2a6f('0x20')],'defaultValue':![],'comment':_0x2a6f('0x48'),'set':function(_0x282321){if(!_0x282321)this[_0x2a6f('0xf')](_0x2a6f('0x49'),null);this[_0x2a6f('0xf')]('mandatoryDisposition',_0x282321);}}}; \ No newline at end of file +var _0xab2d=['linear','wrandom','setDataValue','rrmemory','getDataValue','dialMethod','strategy','booked','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xab2d,0x85));var _0xdab2=function(_0x556ece,_0x355aa1){_0x556ece=_0x556ece-0x0;var _0x59aa72=_0xab2d[_0x556ece];return _0x59aa72;};'use strict';var Sequelize=require(_0xdab2('0x0'));module[_0xdab2('0x1')]={'name':{'type':Sequelize[_0xdab2('0x2')],'allowNull':![],'unique':_0xdab2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x5'),_0xdab2('0x6')),'allowNull':![],'defaultValue':_0xdab2('0x5')},'musiconhold':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':_0xdab2('0x7')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xdab2('0x4')]('rr',_0xdab2('0x8'),_0xdab2('0x9'),'fewestcalls',_0xdab2('0xa'),'rrmemory',_0xdab2('0xb'),_0xdab2('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0xdab2('0x8'),'set':function(_0x585d60){this[_0xdab2('0xd')]('strategy',_0x585d60?_0x585d60:_0xdab2('0xe'));},'get':function(){var _0x4f7e64=this[_0xdab2('0xf')]('type');var _0x4df88a=this[_0xdab2('0xf')](_0xdab2('0x10'));var _0x19105f=this[_0xdab2('0xf')](_0xdab2('0x11'));if(_0x4f7e64===_0xdab2('0x5')){return _0x19105f;}if(_0x4df88a===_0xdab2('0x12')&&_0x19105f===_0xdab2('0xe')||_0x4df88a===_0xdab2('0x12')&&_0x19105f==='roundrobin'){return _0x19105f;}if(_0x4df88a==='progressive'||_0x4df88a===_0xdab2('0x13')||_0x4df88a===_0xdab2('0x14')){return _0x19105f;}return null;}},'servicelevel':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdab2('0x15')](0xb)},'timeout':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdab2('0x2')]},'weight':{'type':Sequelize[_0xdab2('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xdab2('0x16'),'no'),'defaultValue':_0xdab2('0x16')},'autopause':{'type':Sequelize['ENUM'](_0xdab2('0x16'),'no',_0xdab2('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdab2('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xdab2('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdab2('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdab2('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xdab2('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xdab2('0x16'),'no'),'defaultValue':_0xdab2('0x16')},'announce_holdtime':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no',_0xdab2('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xdab2('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdab2('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdab2('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdab2('0x2')]},'queue_quantity1':{'type':Sequelize[_0xdab2('0x2')]},'queue_quantity2':{'type':Sequelize[_0xdab2('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xdab2('0x2')]},'queue_less_than':{'type':Sequelize[_0xdab2('0x2')]},'periodic_announce':{'type':Sequelize[_0xdab2('0x19')],'set':function(_0x4002fe){this[_0xdab2('0xd')](_0xdab2('0x1a'),_0x4002fe?_0x4002fe[_0xdab2('0x1b')](','):[]);},'get':function(){return this[_0xdab2('0xf')]('periodic_announce')?this[_0xdab2('0xf')](_0xdab2('0x1a'))[_0xdab2('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xdab2('0x16'),'set':function(_0x2bd705){this['setDataValue'](_0xdab2('0x1d'),_0x2bd705?_0x2bd705['join'](','):[]);},'get':function(){return this[_0xdab2('0xf')](_0xdab2('0x1d'))?this['getDataValue'](_0xdab2('0x1d'))[_0xdab2('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':'no','set':function(_0x5c725b){this['setDataValue'](_0xdab2('0x1e'),_0x5c725b?_0x5c725b[_0xdab2('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0xdab2('0x1e'))?this[_0xdab2('0xf')]('leavewhenempty')[_0xdab2('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdab2('0x2')]},'description':{'type':Sequelize[_0xdab2('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x14579b){this['setDataValue'](_0xdab2('0x1f'),_0x14579b);if(_0x14579b){if(this['getDataValue'](_0xdab2('0x20'))<0x2){this['setDataValue'](_0xdab2('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdab2('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xdab2('0x4')]('preview',_0xdab2('0x22'),_0xdab2('0x14'),_0xdab2('0x13'),_0xdab2('0x12')),'defaultValue':_0xdab2('0x22'),'comment':_0xdab2('0x23')},'dialLimitChannel':{'type':Sequelize[_0xdab2('0x15')](0x4)[_0xdab2('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdab2('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xdab2('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdab2('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xdab2('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xdab2('0x27'),'dropRate'),'defaultValue':_0xdab2('0x28'),'comment':_0xdab2('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdab2('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xdab2('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdab2('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdab2('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdab2('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdab2('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':_0xdab2('0x2d'),'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':_0xdab2('0x2e')},'dialQueueProject':{'type':Sequelize[_0xdab2('0x2')],'comment':_0xdab2('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdab2('0x15')](0x5)[_0xdab2('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdab2('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdab2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdab2('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'defaultValue':0x3,'comment':_0xdab2('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdab2('0x15')](0x5)[_0xdab2('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdab2('0x33')},'dialTimezone':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdab2('0x2')],'defaultValue':_0xdab2('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdab2('0x4')]('always',_0xdab2('0x35'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xdab2('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdab2('0x36')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdab2('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdab2('0x15')](0x9)[_0xdab2('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdab2('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdab2('0x15')](0x9)[_0xdab2('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdab2('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xdab2('0x15')](0x9)[_0xdab2('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdab2('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdab2('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdab2('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdab2('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdab2('0x15')](0x5)[_0xdab2('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdab2('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdab2('0x15')](0x9)[_0xdab2('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdab2('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xdab2('0x15')](0x5)[_0xdab2('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdab2('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':0x0,'comment':_0xdab2('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdab2('0x4')](_0xdab2('0x41'),_0xdab2('0x42')),'defaultValue':_0xdab2('0x41')},'dialQueueProject2':{'type':Sequelize[_0xdab2('0x2')],'comment':_0xdab2('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xdab2('0x15')](0x3)[_0xdab2('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdab2('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdab2('0x15')],'allowNull':!![],'comment':_0xdab2('0x44')},'mandatoryDisposition':{'type':Sequelize[_0xdab2('0x21')],'defaultValue':![],'comment':_0xdab2('0x45'),'set':function(_0x4cc0fb){if(!_0x4cc0fb)this[_0xdab2('0xd')](_0xdab2('0x46'),null);this[_0xdab2('0xd')](_0xdab2('0x47'),_0x4cc0fb);}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1f3bcc8..7f7f405 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 _0x3c40=['onlyIfOpen','cm_contacts','ListId\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','sendStatus','status','count','offset','limit','set','json','apply','reject','destroy','then','get','inbound','QueueCampaigns','outbound','filter','value','includes','type','name','UserProfileResource','error','stack','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','includeAll','include','VoiceQueue','findAll','rows','catch','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','getHopperHistories','findOne','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','union','penalty','ids','removeTeams','removeAgents','spread','userVoiceQueue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','emit','userVoiceQueue:remove','realtime','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','field','NOW()','scheduledAt','ContactId','toString','from','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','select'];(function(_0x59fde9,_0x281814){var _0x5c27df=function(_0x1386a4){while(--_0x1386a4){_0x59fde9['push'](_0x59fde9['shift']());}};_0x5c27df(++_0x281814);}(_0x3c40,0x13c));var _0x03c4=function(_0x5714e0,_0xbf4ccd){_0x5714e0=_0x5714e0-0x0;var _0x348053=_0x3c40[_0x5714e0];return _0x348053;};'use strict';var pdf=require(_0x03c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x03c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03c4('0x2'));var rp=require(_0x03c4('0x3'));var moment=require(_0x03c4('0x4'));var BPromise=require(_0x03c4('0x5'));var Mustache=require(_0x03c4('0x6'));var util=require('util');var path=require(_0x03c4('0x7'));var sox=require(_0x03c4('0x8'));var csv=require(_0x03c4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x03c4('0xa'));var jsforce=require(_0x03c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x03c4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x03c4('0xc'));var hardwareService=require(_0x03c4('0xd'));var Redis=require(_0x03c4('0xe'));var qs=require(_0x03c4('0xf'));var logger=require(_0x03c4('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x03c4('0x11'))['db'];config[_0x03c4('0x12')]=_['defaults'](config['redis'],{'host':_0x03c4('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x24ef6e,_0x282580){_0x282580=_0x282580||0xcc;return function(_0x56de83){if(_0x56de83){return _0x24ef6e[_0x03c4('0x14')](_0x282580);}return _0x24ef6e['status'](_0x282580)['end']();};}function respondWithResult(_0x487fe1,_0x5ea02f){_0x5ea02f=_0x5ea02f||0xc8;return function(_0x424c57){if(_0x424c57){return _0x487fe1[_0x03c4('0x15')](_0x5ea02f)['json'](_0x424c57);}};}function respondWithFilteredResult(_0x3148e6,_0x5003b3){return function(_0x158503){if(_0x158503){var _0x198a69=_0x158503[_0x03c4('0x16')],_0x15cbe5=_0x5003b3[_0x03c4('0x17')],_0x58624b=_0x5003b3['offset']+_0x5003b3[_0x03c4('0x18')],_0x305d6c;if(_0x58624b>=_0x198a69){_0x58624b=_0x198a69;_0x305d6c=0xc8;}else{_0x305d6c=0xce;}_0x3148e6[_0x03c4('0x15')](_0x305d6c);return _0x3148e6[_0x03c4('0x19')]('Content-Range',_0x15cbe5+'-'+_0x58624b+'/'+_0x198a69)[_0x03c4('0x1a')](_0x158503);}return null;};}function patchUpdates(_0x35233c){return function(_0x4be7b7){try{jsonpatch[_0x03c4('0x1b')](_0x4be7b7,_0x35233c,!![]);}catch(_0x1ee871){return BPromise[_0x03c4('0x1c')](_0x1ee871);}return _0x4be7b7['save']();};}function saveUpdates(_0x525319,_0x14845b){return function(_0x230c02){if(_0x230c02){return _0x230c02['update'](_0x525319)['then'](function(_0x54f4b7){return _0x54f4b7;});}return null;};}function removeEntity(_0xd9138,_0x44884e){return function(_0x353f95){if(_0x353f95){return _0x353f95[_0x03c4('0x1d')]()[_0x03c4('0x1e')](function(){var _0x3d40ed=_0x353f95[_0x03c4('0x1f')]({'plain':!![]});var _0x4c62d8=[{'name':'VoiceQueues','value':_0x03c4('0x20'),'ignore':![]},{'name':_0x03c4('0x21'),'value':_0x03c4('0x22'),'ignore':![]}];var _0x4e1c86=_(_0x4c62d8)[_0x03c4('0x23')]('ignore')['map'](_0x03c4('0x24'))[_0x03c4('0x24')]();if(_[_0x03c4('0x25')](_0x4e1c86,_0x3d40ed[_0x03c4('0x26')])){return;}var _0x3e2d28=_['find'](_0x4c62d8,[_0x03c4('0x24'),_0x3d40ed['type']])[_0x03c4('0x27')];return db[_0x03c4('0x28')][_0x03c4('0x1d')]({'where':{'type':_0x3e2d28,'resourceId':_0x3d40ed['id']}})[_0x03c4('0x1e')](function(){return _0x353f95;});})[_0x03c4('0x1e')](function(){_0xd9138['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c35c,_0x38642c){return function(_0x3e1e9e){if(!_0x3e1e9e){_0x21c35c['sendStatus'](0x194);}return _0x3e1e9e;};}function handleError(_0x8f9553,_0x42c7ab){_0x42c7ab=_0x42c7ab||0x1f4;return function(_0x58c2e9){logger[_0x03c4('0x29')](_0x58c2e9[_0x03c4('0x2a')]);if(_0x58c2e9[_0x03c4('0x27')]){delete _0x58c2e9['name'];}_0x8f9553[_0x03c4('0x15')](_0x42c7ab)['send'](_0x58c2e9);};}exports[_0x03c4('0x2b')]=function(_0x17e83f,_0x147e62){var _0x55c7db={},_0xc40966={},_0x4fb98c={'count':0x0,'rows':[]};var _0xcdec4f=db['VoiceQueue'][_0x03c4('0x2c')];_0xc40966[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](_0xcdec4f);_0xc40966[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x17e83f['query']);_0xc40966['filters']=_[_0x03c4('0x30')](_0xc40966[_0x03c4('0x2d')],_0xc40966['query']);_0x55c7db[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0xc40966['model'],qs[_0x03c4('0x32')](_0x17e83f[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x55c7db['attributes']=_0x55c7db[_0x03c4('0x31')][_0x03c4('0x33')]?_0x55c7db[_0x03c4('0x31')]:_0xc40966[_0x03c4('0x2d')];if(!_0x17e83f[_0x03c4('0x2f')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x55c7db[_0x03c4('0x18')]=qs[_0x03c4('0x18')](_0x17e83f[_0x03c4('0x2f')]['limit']);_0x55c7db[_0x03c4('0x17')]=qs['offset'](_0x17e83f['query'][_0x03c4('0x17')]);}_0x55c7db[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x17e83f[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x55c7db[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_[_0x03c4('0x3a')](_0x17e83f['query'],_0xc40966[_0x03c4('0x39')]));if(_0x17e83f['query'][_0x03c4('0x23')]){_0x55c7db[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0x55c7db[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0xcdec4f,function(_0x519c9c){if(_0x519c9c[_0x03c4('0x26')][_0x03c4('0x3d')]!=='VIRTUAL'){var _0x375457={};_0x375457[_0x519c9c['field']]={'$like':'%'+_0x17e83f['query'][_0x03c4('0x23')]+'%'};return _0x375457;}})});}_0x55c7db=_[_0x03c4('0x3b')]({},_0x55c7db,_0x17e83f['options']);var _0x37bc48={'where':_0x55c7db[_0x03c4('0x38')]};return db['VoiceQueue'][_0x03c4('0x16')](_0x37bc48)[_0x03c4('0x1e')](function(_0x17a9ac){_0x4fb98c[_0x03c4('0x16')]=_0x17a9ac;if(_0x17e83f['query'][_0x03c4('0x3e')]){_0x55c7db[_0x03c4('0x3f')]=[{'all':!![]}];}return db[_0x03c4('0x40')][_0x03c4('0x41')](_0x55c7db);})[_0x03c4('0x1e')](function(_0x174fea){_0x4fb98c[_0x03c4('0x42')]=_0x174fea;return _0x4fb98c;})[_0x03c4('0x1e')](respondWithFilteredResult(_0x147e62,_0x55c7db))[_0x03c4('0x43')](handleError(_0x147e62,null));};exports['show']=function(_0x29ce4a,_0xb9226b){var _0x30da9e={'raw':![],'where':{'id':_0x29ce4a[_0x03c4('0x44')]['id']}},_0x446a65={};_0x446a65[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db[_0x03c4('0x40')][_0x03c4('0x2c')]);_0x446a65[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x29ce4a[_0x03c4('0x2f')]);_0x446a65[_0x03c4('0x39')]=_['intersection'](_0x446a65[_0x03c4('0x2d')],_0x446a65[_0x03c4('0x2f')]);_0x30da9e[_0x03c4('0x31')]=_['intersection'](_0x446a65[_0x03c4('0x2d')],qs['fields'](_0x29ce4a[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x30da9e[_0x03c4('0x31')]=_0x30da9e[_0x03c4('0x31')]['length']?_0x30da9e['attributes']:_0x446a65['model'];if(_0x29ce4a[_0x03c4('0x2f')]['includeAll']){_0x30da9e['include']=[{'all':!![]}];}_0x30da9e=_[_0x03c4('0x3b')]({},_0x30da9e,_0x29ce4a[_0x03c4('0x45')]);return db[_0x03c4('0x40')][_0x03c4('0x46')](_0x30da9e)[_0x03c4('0x1e')](handleEntityNotFound(_0xb9226b,null))[_0x03c4('0x1e')](respondWithResult(_0xb9226b,null))['catch'](handleError(_0xb9226b,null));};exports['create']=function(_0xdf7dd,_0x54db88){return db[_0x03c4('0x40')][_0x03c4('0x47')](_0xdf7dd[_0x03c4('0x48')],{})['then'](function(_0x59bd5a){var _0x288299=_0xdf7dd['user'][_0x03c4('0x1f')]({'plain':!![]});if(!_0x288299)throw new Error(_0x03c4('0x49'));if(_0x288299[_0x03c4('0x4a')]==='user'){var _0x47f18b=_0x59bd5a[_0x03c4('0x1f')]({'plain':!![]});var _0x5824bb=[{'name':_0x03c4('0x4b'),'value':_0x03c4('0x20')},{'name':_0x03c4('0x21'),'value':_0x03c4('0x22')}];var _0x4c5d99=_[_0x03c4('0x46')](_0x5824bb,['value',_0x47f18b[_0x03c4('0x26')]])[_0x03c4('0x27')];return db[_0x03c4('0x4c')][_0x03c4('0x46')]({'where':{'name':_0x4c5d99,'userProfileId':_0x288299[_0x03c4('0x4d')]},'raw':!![]})[_0x03c4('0x1e')](function(_0x3c5e66){if(_0x3c5e66&&_0x3c5e66[_0x03c4('0x4e')]===0x0){return db[_0x03c4('0x28')]['create']({'name':_0x47f18b[_0x03c4('0x27')],'resourceId':_0x47f18b['id'],'type':_0x3c5e66[_0x03c4('0x27')],'sectionId':_0x3c5e66['id']},{})[_0x03c4('0x1e')](function(){return _0x59bd5a;});}else{return _0x59bd5a;}})['catch'](function(_0x3a34fb){logger[_0x03c4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a34fb);throw _0x3a34fb;});}return _0x59bd5a;})['then'](respondWithResult(_0x54db88,0xc9))[_0x03c4('0x43')](handleError(_0x54db88,null));};exports['clone']=function(_0x1bbf6f,_0x144b32){var _0x56cd0c={'raw':![],'where':{'id':_0x1bbf6f[_0x03c4('0x44')]['id']}},_0x4003d5={};_0x4003d5[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db['VoiceQueue'][_0x03c4('0x2c')]);_0x56cd0c[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x4003d5[_0x03c4('0x2d')],qs['fields'](_0x1bbf6f[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x56cd0c[_0x03c4('0x31')]=_0x56cd0c[_0x03c4('0x31')][_0x03c4('0x33')]?_0x56cd0c['attributes']:_0x4003d5[_0x03c4('0x2d')];if(_0x1bbf6f[_0x03c4('0x2f')][_0x03c4('0x3e')]){_0x56cd0c[_0x03c4('0x3f')]=[{'all':!![]}];}_0x56cd0c=_[_0x03c4('0x3b')]({},_0x56cd0c,_0x1bbf6f['options']);return db['VoiceQueue']['find'](_0x56cd0c)[_0x03c4('0x1e')](handleEntityNotFound(_0x144b32,null))[_0x03c4('0x1e')](function(_0x5908ce){if(_0x5908ce){var _0x4a7b47=_0x5908ce[_0x03c4('0x1f')]({'plain':!![]});_0x4a7b47=qs[_0x03c4('0x4f')](_0x4a7b47,['id',_0x03c4('0x50'),'updatedAt']);_0x1bbf6f[_0x03c4('0x48')]=_[_0x03c4('0x4f')](_0x1bbf6f[_0x03c4('0x48')],['id',_0x03c4('0x50'),_0x03c4('0x51')]);return db[_0x03c4('0x40')]['create'](_[_0x03c4('0x3b')](_0x4a7b47,_0x1bbf6f[_0x03c4('0x48')]),{'include':_0x1bbf6f[_0x03c4('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x03c4('0x1e')](function(_0x4334b0){var _0xf93060=_0x1bbf6f['user']['get']({'plain':!![]});if(!_0xf93060)throw new Error(_0x03c4('0x49'));if(_0xf93060[_0x03c4('0x4a')]===_0x03c4('0x52')){var _0x5c3a1f=_0x4334b0[_0x03c4('0x1f')]({'plain':!![]});var _0x529343=[{'name':_0x03c4('0x4b'),'value':_0x03c4('0x20')},{'name':_0x03c4('0x21'),'value':_0x03c4('0x22')}];var _0x591865=_[_0x03c4('0x46')](_0x529343,[_0x03c4('0x24'),_0x5c3a1f[_0x03c4('0x26')]])[_0x03c4('0x27')];return db[_0x03c4('0x4c')][_0x03c4('0x46')]({'where':{'name':_0x591865,'userProfileId':_0xf93060[_0x03c4('0x4d')]},'raw':!![]})[_0x03c4('0x1e')](function(_0x546de7){if(_0x546de7&&_0x546de7[_0x03c4('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c3a1f['name'],'resourceId':_0x5c3a1f['id'],'type':_0x546de7[_0x03c4('0x27')],'sectionId':_0x546de7['id']},{})[_0x03c4('0x1e')](function(){return _0x4334b0;});}else{return _0x4334b0;}})['catch'](function(_0x42decf){logger[_0x03c4('0x29')](_0x03c4('0x53'),_0x42decf);throw _0x42decf;});}return _0x4334b0;});}})[_0x03c4('0x1e')](respondWithResult(_0x144b32,0xc9))[_0x03c4('0x43')](handleError(_0x144b32,null));};exports[_0x03c4('0x54')]=function(_0x59d0b7,_0x5c0d88){if(_0x59d0b7[_0x03c4('0x48')]['id']){delete _0x59d0b7[_0x03c4('0x48')]['id'];}return db[_0x03c4('0x40')][_0x03c4('0x46')]({'where':{'id':_0x59d0b7['params']['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x5c0d88,null))[_0x03c4('0x1e')](saveUpdates(_0x59d0b7[_0x03c4('0x48')],null))[_0x03c4('0x1e')](respondWithResult(_0x5c0d88,null))[_0x03c4('0x43')](handleError(_0x5c0d88,null));};exports[_0x03c4('0x1d')]=function(_0xd0fefd,_0x237536){return db[_0x03c4('0x40')][_0x03c4('0x46')]({'where':{'id':_0xd0fefd[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x237536,null))[_0x03c4('0x1e')](removeEntity(_0x237536,null))['catch'](handleError(_0x237536,null));};exports[_0x03c4('0x55')]=function(_0x39d4d3,_0x1d3aec,_0x52725a){var _0x38f5ed={'raw':![],'where':{}};var _0x4a079d={};var _0x17eb12={'count':0x0,'rows':[]};return db[_0x03c4('0x40')]['findOne']({'where':{'id':_0x39d4d3[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x1d3aec,null))[_0x03c4('0x1e')](function(_0x4e483f){if(_0x4e483f){_0x4a079d[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db[_0x03c4('0x56')][_0x03c4('0x2c')]);_0x4a079d[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x39d4d3['query']);_0x4a079d[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x4a079d[_0x03c4('0x2d')],_0x4a079d[_0x03c4('0x2f')]);_0x38f5ed[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x4a079d[_0x03c4('0x2d')],qs['fields'](_0x39d4d3[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x38f5ed[_0x03c4('0x31')]=_0x38f5ed['attributes'][_0x03c4('0x33')]?_0x38f5ed[_0x03c4('0x31')]:_0x4a079d[_0x03c4('0x2d')];if(!_0x39d4d3['query']['hasOwnProperty'](_0x03c4('0x35'))){_0x38f5ed['limit']=qs[_0x03c4('0x18')](_0x39d4d3[_0x03c4('0x2f')][_0x03c4('0x18')]);_0x38f5ed[_0x03c4('0x17')]=qs[_0x03c4('0x17')](_0x39d4d3[_0x03c4('0x2f')][_0x03c4('0x17')]);}_0x38f5ed[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x39d4d3['query']['sort']);_0x38f5ed[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_['pick'](_0x39d4d3[_0x03c4('0x2f')],_0x4a079d[_0x03c4('0x39')]));_0x38f5ed[_0x03c4('0x38')]['VoiceQueueId']=_0x4e483f['id'];if(_0x39d4d3[_0x03c4('0x2f')][_0x03c4('0x23')]){_0x38f5ed[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0x38f5ed['where'],{'$or':_[_0x03c4('0x3c')](_0x38f5ed[_0x03c4('0x31')],function(_0x43deea){var _0x2cd583={};_0x2cd583[_0x43deea]={'$like':'%'+_0x39d4d3[_0x03c4('0x2f')][_0x03c4('0x23')]+'%'};return _0x2cd583;})});}_0x38f5ed=_[_0x03c4('0x3b')]({},_0x38f5ed,_0x39d4d3[_0x03c4('0x45')]);return db[_0x03c4('0x56')][_0x03c4('0x16')]({'where':_0x38f5ed[_0x03c4('0x38')]})[_0x03c4('0x1e')](function(_0x59c823){_0x17eb12['count']=_0x59c823;if(_0x39d4d3[_0x03c4('0x2f')]['includeAll']){_0x38f5ed[_0x03c4('0x3f')]=[{'all':!![]}];}return db[_0x03c4('0x56')]['findAll'](_0x38f5ed);})['then'](function(_0x5a1ed0){_0x17eb12[_0x03c4('0x42')]=_0x5a1ed0;return _0x17eb12;});}})[_0x03c4('0x1e')](respondWithFilteredResult(_0x1d3aec,_0x38f5ed))[_0x03c4('0x43')](handleError(_0x1d3aec,null));};exports[_0x03c4('0x57')]=function(_0x20ef31,_0xe1ee8b,_0x1db1c9){var _0x8c4dbd={'raw':!![],'where':{}};var _0x41512f={};var _0x499ae6={'count':0x0,'rows':[]};return db[_0x03c4('0x40')][_0x03c4('0x58')]({'where':{'id':_0x20ef31[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0xe1ee8b,null))[_0x03c4('0x1e')](function(_0x392122){if(_0x392122){_0x41512f[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db['CmHopperHistory'][_0x03c4('0x2c')]);_0x41512f[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x20ef31[_0x03c4('0x2f')]);_0x41512f[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x41512f['model'],_0x41512f['query']);_0x8c4dbd[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x41512f[_0x03c4('0x2d')],qs['fields'](_0x20ef31['query'][_0x03c4('0x32')]));_0x8c4dbd['attributes']=_0x8c4dbd[_0x03c4('0x31')][_0x03c4('0x33')]?_0x8c4dbd[_0x03c4('0x31')]:_0x41512f[_0x03c4('0x2d')];if(!_0x20ef31[_0x03c4('0x2f')][_0x03c4('0x34')]('nolimit')){_0x8c4dbd[_0x03c4('0x18')]=qs[_0x03c4('0x18')](_0x20ef31[_0x03c4('0x2f')][_0x03c4('0x18')]);_0x8c4dbd['offset']=qs[_0x03c4('0x17')](_0x20ef31[_0x03c4('0x2f')][_0x03c4('0x17')]);}_0x8c4dbd['order']=qs[_0x03c4('0x37')](_0x20ef31[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x8c4dbd[_0x03c4('0x38')]=qs['filters'](_[_0x03c4('0x3a')](_0x20ef31[_0x03c4('0x2f')],_0x41512f['filters']));_0x8c4dbd[_0x03c4('0x38')][_0x03c4('0x59')]=_0x392122['id'];if(_0x20ef31['query']['filter']){_0x8c4dbd[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0x8c4dbd[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0x8c4dbd[_0x03c4('0x31')],function(_0x5eb38d){var _0xa84a62={};_0xa84a62[_0x5eb38d]={'$like':'%'+_0x20ef31[_0x03c4('0x2f')][_0x03c4('0x23')]+'%'};return _0xa84a62;})});}_0x8c4dbd=_[_0x03c4('0x3b')]({},_0x8c4dbd,_0x20ef31['options']);return db[_0x03c4('0x5a')][_0x03c4('0x16')]({'where':_0x8c4dbd[_0x03c4('0x38')]})[_0x03c4('0x1e')](function(_0x383ec5){_0x499ae6[_0x03c4('0x16')]=_0x383ec5;if(_0x20ef31['query'][_0x03c4('0x3e')]){_0x8c4dbd[_0x03c4('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x03c4('0x41')](_0x8c4dbd);})[_0x03c4('0x1e')](function(_0xf0bb2d){_0x499ae6[_0x03c4('0x42')]=_0xf0bb2d;return _0x499ae6;});}})[_0x03c4('0x1e')](respondWithFilteredResult(_0xe1ee8b,_0x8c4dbd))[_0x03c4('0x43')](handleError(_0xe1ee8b,null));};exports['getHopperFinals']=function(_0x182dcb,_0x21d4fc,_0x2e9763){var _0x331d98={'raw':!![],'where':{}};var _0x542587={};var _0x441508={'count':0x0,'rows':[]};return db[_0x03c4('0x40')][_0x03c4('0x58')]({'where':{'id':_0x182dcb[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x21d4fc,null))[_0x03c4('0x1e')](function(_0x53cabb){if(_0x53cabb){_0x542587['model']=_[_0x03c4('0x2e')](db[_0x03c4('0x5b')][_0x03c4('0x2c')]);_0x542587[_0x03c4('0x2f')]=_['keys'](_0x182dcb[_0x03c4('0x2f')]);_0x542587[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x542587[_0x03c4('0x2d')],_0x542587[_0x03c4('0x2f')]);_0x331d98[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x542587[_0x03c4('0x2d')],qs[_0x03c4('0x32')](_0x182dcb[_0x03c4('0x2f')]['fields']));_0x331d98[_0x03c4('0x31')]=_0x331d98[_0x03c4('0x31')][_0x03c4('0x33')]?_0x331d98[_0x03c4('0x31')]:_0x542587[_0x03c4('0x2d')];if(!_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x331d98[_0x03c4('0x18')]=qs['limit'](_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x18')]);_0x331d98[_0x03c4('0x17')]=qs['offset'](_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x17')]);}_0x331d98[_0x03c4('0x36')]=qs['sort'](_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x331d98[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_[_0x03c4('0x3a')](_0x182dcb[_0x03c4('0x2f')],_0x542587['filters']));_0x331d98[_0x03c4('0x38')][_0x03c4('0x59')]=_0x53cabb['id'];if(_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x23')]){_0x331d98['where']=_[_0x03c4('0x3b')](_0x331d98[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0x331d98[_0x03c4('0x31')],function(_0x43ac48){var _0xfbd2ea={};_0xfbd2ea[_0x43ac48]={'$like':'%'+_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x23')]+'%'};return _0xfbd2ea;})});}_0x331d98=_[_0x03c4('0x3b')]({},_0x331d98,_0x182dcb[_0x03c4('0x45')]);return db['CmHopperFinal'][_0x03c4('0x16')]({'where':_0x331d98['where']})[_0x03c4('0x1e')](function(_0x43dbef){_0x441508[_0x03c4('0x16')]=_0x43dbef;if(_0x182dcb[_0x03c4('0x2f')][_0x03c4('0x3e')]){_0x331d98[_0x03c4('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x03c4('0x41')](_0x331d98);})[_0x03c4('0x1e')](function(_0x5ea92e){_0x441508[_0x03c4('0x42')]=_0x5ea92e;return _0x441508;});}})[_0x03c4('0x1e')](respondWithFilteredResult(_0x21d4fc,_0x331d98))['catch'](handleError(_0x21d4fc,null));};exports[_0x03c4('0x5c')]=function(_0x3d1332,_0x13d65d,_0xd15e38){var _0x10ac5c={'raw':!![],'where':{}};var _0x3ba2d5={};var _0x533705={'count':0x0,'rows':[]};return db[_0x03c4('0x40')]['findOne']({'where':{'id':_0x3d1332[_0x03c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x13d65d,null))[_0x03c4('0x1e')](function(_0x2fecba){if(_0x2fecba){_0x3ba2d5[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db[_0x03c4('0x5d')][_0x03c4('0x2c')]);_0x3ba2d5[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x3d1332[_0x03c4('0x2f')]);_0x3ba2d5['filters']=_[_0x03c4('0x30')](_0x3ba2d5['model'],_0x3ba2d5[_0x03c4('0x2f')]);_0x10ac5c[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x3ba2d5[_0x03c4('0x2d')],qs[_0x03c4('0x32')](_0x3d1332['query'][_0x03c4('0x32')]));_0x10ac5c[_0x03c4('0x31')]=_0x10ac5c[_0x03c4('0x31')][_0x03c4('0x33')]?_0x10ac5c[_0x03c4('0x31')]:_0x3ba2d5[_0x03c4('0x2d')];if(!_0x3d1332[_0x03c4('0x2f')]['hasOwnProperty'](_0x03c4('0x35'))){_0x10ac5c[_0x03c4('0x18')]=qs[_0x03c4('0x18')](_0x3d1332[_0x03c4('0x2f')]['limit']);_0x10ac5c[_0x03c4('0x17')]=qs['offset'](_0x3d1332[_0x03c4('0x2f')][_0x03c4('0x17')]);}_0x10ac5c[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x3d1332[_0x03c4('0x2f')]['sort']);_0x10ac5c[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_[_0x03c4('0x3a')](_0x3d1332['query'],_0x3ba2d5[_0x03c4('0x39')]));_0x10ac5c[_0x03c4('0x38')]['VoiceQueueId']=_0x2fecba['id'];if(_0x3d1332[_0x03c4('0x2f')][_0x03c4('0x23')]){_0x10ac5c[_0x03c4('0x38')]=_['merge'](_0x10ac5c[_0x03c4('0x38')],{'$or':_['map'](_0x10ac5c[_0x03c4('0x31')],function(_0x29f7e1){var _0x45da45={};_0x45da45[_0x29f7e1]={'$like':'%'+_0x3d1332['query'][_0x03c4('0x23')]+'%'};return _0x45da45;})});}_0x10ac5c=_[_0x03c4('0x3b')]({},_0x10ac5c,_0x3d1332[_0x03c4('0x45')]);return db[_0x03c4('0x5d')][_0x03c4('0x16')]({'where':_0x10ac5c['where']})[_0x03c4('0x1e')](function(_0x1e479a){_0x533705['count']=_0x1e479a;if(_0x3d1332['query']['includeAll']){_0x10ac5c[_0x03c4('0x3f')]=[{'all':!![]}];}return db[_0x03c4('0x5d')][_0x03c4('0x41')](_0x10ac5c);})['then'](function(_0x1afc87){_0x533705[_0x03c4('0x42')]=_0x1afc87;return _0x533705;});}})[_0x03c4('0x1e')](respondWithFilteredResult(_0x13d65d,_0x10ac5c))[_0x03c4('0x43')](handleError(_0x13d65d,null));};exports[_0x03c4('0x5e')]=function(_0x28a8d1,_0x3da6cd,_0x9d9745){var _0x3660eb={};var _0x2625c0={};var _0x3e45da;var _0x1e04f7;return db[_0x03c4('0x40')]['findOne']({'where':{'id':_0x28a8d1[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x3da6cd,null))[_0x03c4('0x1e')](function(_0x5e9ea1){if(_0x5e9ea1){_0x3e45da=_0x5e9ea1;_0x2625c0[_0x03c4('0x2d')]=_['keys'](db['Team']['rawAttributes']);_0x2625c0[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x28a8d1[_0x03c4('0x2f')]);_0x2625c0[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x2625c0[_0x03c4('0x2d')],_0x2625c0[_0x03c4('0x2f')]);_0x3660eb[_0x03c4('0x31')]=_['intersection'](_0x2625c0[_0x03c4('0x2d')],qs['fields'](_0x28a8d1[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x3660eb[_0x03c4('0x31')]=_0x3660eb[_0x03c4('0x31')][_0x03c4('0x33')]?_0x3660eb['attributes']:_0x2625c0[_0x03c4('0x2d')];_0x3660eb[_0x03c4('0x36')]=qs['sort'](_0x28a8d1['query']['sort']);_0x3660eb[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_['pick'](_0x28a8d1[_0x03c4('0x2f')],_0x2625c0[_0x03c4('0x39')]));if(_0x28a8d1['query'][_0x03c4('0x23')]){_0x3660eb['where']=_[_0x03c4('0x3b')](_0x3660eb[_0x03c4('0x38')],{'$or':_['map'](_0x3660eb[_0x03c4('0x31')],function(_0x476027){var _0x302a26={};_0x302a26[_0x476027]={'$like':'%'+_0x28a8d1[_0x03c4('0x2f')][_0x03c4('0x23')]+'%'};return _0x302a26;})});}_0x3660eb=_[_0x03c4('0x3b')]({},_0x3660eb,_0x28a8d1['options']);return _0x3e45da[_0x03c4('0x5e')](_0x3660eb);}})[_0x03c4('0x1e')](function(_0x549667){if(_0x549667){_0x1e04f7=_0x549667[_0x03c4('0x33')];if(!_0x28a8d1[_0x03c4('0x2f')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x3660eb[_0x03c4('0x18')]=qs['limit'](_0x28a8d1['query']['limit']);_0x3660eb[_0x03c4('0x17')]=qs['offset'](_0x28a8d1[_0x03c4('0x2f')][_0x03c4('0x17')]);}return _0x3e45da['getTeams'](_0x3660eb);}})['then'](function(_0x243197){if(_0x243197){return _0x243197?{'count':_0x1e04f7,'rows':_0x243197}:null;}})[_0x03c4('0x1e')](respondWithResult(_0x3da6cd,null))[_0x03c4('0x43')](handleError(_0x3da6cd,null));};exports[_0x03c4('0x5f')]=function(_0x38ecd2,_0x212ea8,_0x49f1e2){var _0x1fa256=[];var _0x40efec;return db[_0x03c4('0x60')][_0x03c4('0x41')]({'where':{'id':_0x38ecd2[_0x03c4('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x03c4('0x61')],'as':_0x03c4('0x62'),'attributes':['id'],'raw':!![]}]})[_0x03c4('0x1e')](function(_0x25d7ad){if(_0x25d7ad){for(var _0x640847=0x0;_0x640847<_0x25d7ad[_0x03c4('0x33')];_0x640847+=0x1){for(var _0x1bdfc2=0x0;_0x1bdfc2<_0x25d7ad[_0x640847][_0x03c4('0x62')][_0x03c4('0x33')];_0x1bdfc2+=0x1){_0x1fa256=_[_0x03c4('0x63')](_0x1fa256,[_0x25d7ad[_0x640847]['Agents'][_0x1bdfc2]['id']]);}}return _0x1fa256;}})['then'](function(_0x470588){if(_0x470588){return db['VoiceQueue'][_0x03c4('0x46')]({'where':{'id':_0x38ecd2[_0x03c4('0x44')]['id']}});}})[_0x03c4('0x1e')](function(_0x2fa0aa){if(_0x2fa0aa){_0x40efec=_0x2fa0aa;return _0x40efec['addAgents'](_0x1fa256,{'penalty':_0x38ecd2[_0x03c4('0x48')][_0x03c4('0x64')]});}})[_0x03c4('0x1e')](function(_0x466801){if(_0x466801){return _0x40efec[_0x03c4('0x5f')](_0x38ecd2[_0x03c4('0x48')][_0x03c4('0x65')]);}})[_0x03c4('0x1e')](handleEntityNotFound(_0x212ea8,null))[_0x03c4('0x1e')](respondWithStatusCode(_0x212ea8,null))['catch'](handleError(_0x212ea8,null));};exports[_0x03c4('0x66')]=function(_0x58ed5c,_0x288ca3,_0x4cda5b){var _0x25c1f0=[];var _0x59d093;return db[_0x03c4('0x60')][_0x03c4('0x41')]({'where':{'id':_0x58ed5c[_0x03c4('0x2f')][_0x03c4('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x03c4('0x1e')](function(_0x441500){if(_0x441500){for(var _0x402eb9=0x0;_0x402eb9<_0x441500['length'];_0x402eb9+=0x1){for(var _0x208031=0x0;_0x208031<_0x441500[_0x402eb9][_0x03c4('0x62')][_0x03c4('0x33')];_0x208031+=0x1){_0x25c1f0=_[_0x03c4('0x63')](_0x25c1f0,[_0x441500[_0x402eb9][_0x03c4('0x62')][_0x208031]['id']]);}}return _0x25c1f0;}})['then'](function(_0x28cbda){if(_0x28cbda){return db[_0x03c4('0x40')][_0x03c4('0x46')]({'where':{'id':_0x58ed5c[_0x03c4('0x44')]['id']}});}})[_0x03c4('0x1e')](function(_0x17dcae){if(_0x17dcae){_0x59d093=_0x17dcae;return _0x59d093[_0x03c4('0x67')](_0x25c1f0);}})['then'](function(_0x5f232c){if(_0x59d093){return _0x59d093[_0x03c4('0x66')](_0x58ed5c['query'][_0x03c4('0x65')]);}})[_0x03c4('0x1e')](handleEntityNotFound(_0x288ca3,null))[_0x03c4('0x1e')](respondWithStatusCode(_0x288ca3,null))[_0x03c4('0x43')](handleError(_0x288ca3,null));};exports['addAgents']=function(_0x4ba9e1,_0x5cc137,_0x3bac02){var _0x4c4838,_0x4e2962;return db[_0x03c4('0x40')][_0x03c4('0x46')]({'where':{'id':_0x4ba9e1[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x5cc137,null))[_0x03c4('0x1e')](function(_0x304afd){if(_0x304afd){_0x4e2962=_0x304afd;return _0x304afd['addAgents'](_0x4ba9e1['body']['ids'],_[_0x03c4('0x4f')](_0x4ba9e1[_0x03c4('0x48')],[_0x03c4('0x65'),'id'])||{})[_0x03c4('0x68')](function(_0x44a96e){for(var _0xc73a7d=0x0;_0xc73a7d<_0x4ba9e1[_0x03c4('0x48')]['ids'][_0x03c4('0x33')];_0xc73a7d+=0x1){socket['emit'](_0x03c4('0x69'),{'UserId':_0x4ba9e1[_0x03c4('0x48')][_0x03c4('0x65')][_0xc73a7d],'VoiceQueueId':_0x4ba9e1[_0x03c4('0x44')]['id']});}return _0x44a96e;});}})[_0x03c4('0x1e')](function(_0x3541f8){_0x4c4838=_0x3541f8||[];if(_0x4e2962){return db[_0x03c4('0x61')][_0x03c4('0x41')]({'where':{'id':_0x4ba9e1[_0x03c4('0x48')][_0x03c4('0x65')]},'attributes':['id',_0x03c4('0x27'),'loginInPause',_0x03c4('0x6a'),_0x03c4('0x6b')],'raw':!![]});}})[_0x03c4('0x1e')](function(_0x7e1730){if(_0x7e1730&&_0x7e1730['length']){var _0x370493=[];for(var _0x1bd5c8=0x0;_0x1bd5c8<_0x7e1730[_0x03c4('0x33')];_0x1bd5c8++){_0x370493['push'](db[_0x03c4('0x6c')][_0x03c4('0x6d')]({'membername':_0x7e1730[_0x1bd5c8]['name'],'UserId':_0x7e1730[_0x1bd5c8]['id'],'queue_name':_0x4e2962[_0x03c4('0x27')],'VoiceQueueId':_0x4e2962['id'],'interface':_[_0x03c4('0x6e')](_0x7e1730[_0x1bd5c8]['interface'])?util[_0x03c4('0x6f')]('SIP/%s',_0x7e1730[_0x1bd5c8]['name']):_0x7e1730[_0x1bd5c8][_0x03c4('0x6b')],'paused':_0x7e1730[_0x1bd5c8]['voicePause']||![],'penalty':_0x4ba9e1['body'][_0x03c4('0x64')]||0x0}));}return BPromise[_0x03c4('0x70')](_0x370493);}})[_0x03c4('0x1e')](function(_0x416f5b){return _0x4c4838;})[_0x03c4('0x1e')](respondWithResult(_0x5cc137,null))[_0x03c4('0x43')](handleError(_0x5cc137,null));};exports['removeAgents']=function(_0x5871ef,_0x3297e2,_0x4804d2){var _0x4250a8;return db[_0x03c4('0x40')][_0x03c4('0x46')]({'where':{'id':_0x5871ef[_0x03c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x3297e2,null))[_0x03c4('0x1e')](function(_0x18b421){if(_0x18b421){return _0x18b421[_0x03c4('0x67')](_0x5871ef[_0x03c4('0x2f')][_0x03c4('0x65')])['then'](function(_0x38df19){if(_['isArray'](_0x5871ef['query'][_0x03c4('0x65')])){for(var _0x275f80=0x0;_0x275f80<_0x5871ef[_0x03c4('0x2f')][_0x03c4('0x65')]['length'];_0x275f80+=0x1){socket[_0x03c4('0x71')](_0x03c4('0x72'),{'UserId':_0x5871ef[_0x03c4('0x2f')]['ids'][_0x275f80],'VoiceQueueId':_0x5871ef[_0x03c4('0x44')]['id']});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':_0x5871ef['query'][_0x03c4('0x65')],'VoiceQueueId':_0x5871ef[_0x03c4('0x44')]['id']});}});}})[_0x03c4('0x1e')](function(_0x119c76){if(_0x5871ef['query'][_0x03c4('0x73')]){_0x4250a8=_0x119c76;return db[_0x03c4('0x6c')]['destroy']({'where':{'VoiceQueueId':_0x5871ef[_0x03c4('0x44')]['id'],'UserId':_0x5871ef[_0x03c4('0x2f')][_0x03c4('0x65')]}})[_0x03c4('0x1e')](function(){return _0x4250a8;});}})['then'](respondWithStatusCode(_0x3297e2,null))[_0x03c4('0x43')](handleError(_0x3297e2,null));};exports[_0x03c4('0x74')]=function(_0x5ca70a,_0x495b28,_0x3524f6){var _0x45d1bf={};var _0x3f3498={};var _0x298735;var _0x4804fe;return db[_0x03c4('0x40')][_0x03c4('0x58')]({'where':{'id':_0x5ca70a[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x495b28,null))[_0x03c4('0x1e')](function(_0x3121aa){if(_0x3121aa){_0x298735=_0x3121aa;_0x3f3498[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](db[_0x03c4('0x61')][_0x03c4('0x2c')]);_0x3f3498['query']=_[_0x03c4('0x2e')](_0x5ca70a[_0x03c4('0x2f')]);_0x3f3498[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x3f3498['model'],_0x3f3498[_0x03c4('0x2f')]);_0x45d1bf[_0x03c4('0x31')]=_['intersection'](_0x3f3498[_0x03c4('0x2d')],qs['fields'](_0x5ca70a[_0x03c4('0x2f')][_0x03c4('0x32')]));_0x45d1bf['attributes']=_0x45d1bf['attributes'][_0x03c4('0x33')]?_0x45d1bf['attributes']:_0x3f3498['model'];_0x45d1bf['order']=qs[_0x03c4('0x37')](_0x5ca70a[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x45d1bf[_0x03c4('0x38')]=qs['filters'](_['pick'](_0x5ca70a[_0x03c4('0x2f')],_0x3f3498[_0x03c4('0x39')]));if(_0x5ca70a['query'][_0x03c4('0x23')]){_0x45d1bf[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0x45d1bf[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0x45d1bf[_0x03c4('0x31')],function(_0x54fa95){var _0x2b6908={};_0x2b6908[_0x54fa95]={'$like':'%'+_0x5ca70a['query']['filter']+'%'};return _0x2b6908;})});}_0x45d1bf=_['merge']({},_0x45d1bf,_0x5ca70a['options']);return _0x298735[_0x03c4('0x74')](_0x45d1bf);}})[_0x03c4('0x1e')](function(_0x3cc6d6){if(_0x3cc6d6){_0x4804fe=_0x3cc6d6[_0x03c4('0x33')];if(!_0x5ca70a[_0x03c4('0x2f')][_0x03c4('0x34')]('nolimit')){_0x45d1bf['limit']=qs['limit'](_0x5ca70a[_0x03c4('0x2f')][_0x03c4('0x18')]);_0x45d1bf['offset']=qs['offset'](_0x5ca70a['query']['offset']);}return _0x298735['getAgents'](_0x45d1bf);}})['then'](function(_0x594512){if(_0x594512){return _0x594512?{'count':_0x4804fe,'rows':_0x594512}:null;}})[_0x03c4('0x1e')](respondWithResult(_0x495b28,null))['catch'](handleError(_0x495b28,null));};exports[_0x03c4('0x75')]=function(_0x295a0f,_0x529c68,_0x19315e){var _0x51cdfc={};var _0x5bf836={};var _0x2b1587;var _0x48580b;return db[_0x03c4('0x40')][_0x03c4('0x58')]({'where':{'id':_0x295a0f[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x529c68,null))['then'](function(_0x2e8a52){if(_0x2e8a52){_0x2b1587=_0x2e8a52;_0x5bf836['model']=_['keys'](db['UserVoiceQueueRt'][_0x03c4('0x2c')]);_0x5bf836[_0x03c4('0x2f')]=_['keys'](_0x295a0f[_0x03c4('0x2f')]);_0x5bf836[_0x03c4('0x39')]=_['intersection'](_0x5bf836[_0x03c4('0x2d')],_0x5bf836['query']);_0x51cdfc[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x5bf836[_0x03c4('0x2d')],qs[_0x03c4('0x32')](_0x295a0f['query']['fields']));_0x51cdfc[_0x03c4('0x31')]=_0x51cdfc[_0x03c4('0x31')][_0x03c4('0x33')]?_0x51cdfc[_0x03c4('0x31')]:_0x5bf836[_0x03c4('0x2d')];_0x51cdfc[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x295a0f[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x51cdfc[_0x03c4('0x38')]=qs[_0x03c4('0x39')](_[_0x03c4('0x3a')](_0x295a0f[_0x03c4('0x2f')],_0x5bf836['filters']));if(_0x295a0f[_0x03c4('0x2f')]['filter']){_0x51cdfc[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0x51cdfc[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0x51cdfc[_0x03c4('0x31')],function(_0x59f494){var _0x3848af={};_0x3848af[_0x59f494]={'$like':'%'+_0x295a0f[_0x03c4('0x2f')][_0x03c4('0x23')]+'%'};return _0x3848af;})});}_0x51cdfc=_['merge']({},_0x51cdfc,_0x295a0f[_0x03c4('0x45')]);return _0x2b1587['getMembers'](_0x51cdfc);}})[_0x03c4('0x1e')](function(_0x2ab823){if(_0x2ab823){_0x48580b=_0x2ab823[_0x03c4('0x33')];if(!_0x295a0f[_0x03c4('0x2f')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x51cdfc['limit']=qs[_0x03c4('0x18')](_0x295a0f['query'][_0x03c4('0x18')]);_0x51cdfc[_0x03c4('0x17')]=qs[_0x03c4('0x17')](_0x295a0f[_0x03c4('0x2f')][_0x03c4('0x17')]);}return _0x2b1587[_0x03c4('0x75')](_0x51cdfc);}})[_0x03c4('0x1e')](function(_0x31175f){return _0x31175f?{'count':_0x48580b,'rows':_0x31175f}:null;})[_0x03c4('0x1e')](respondWithResult(_0x529c68,null))[_0x03c4('0x43')](handleError(_0x529c68,null));};exports['getLists']=function(_0x966088,_0x4d6ec8,_0x1456fa){var _0xc2de14={};var _0x4eb67f={};var _0x46cc3b;var _0x158d36;return db[_0x03c4('0x40')]['findOne']({'where':{'id':_0x966088[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x4d6ec8,null))[_0x03c4('0x1e')](function(_0x1f888b){if(_0x1f888b){_0x46cc3b=_0x1f888b;_0x4eb67f[_0x03c4('0x2d')]=_['keys'](db[_0x03c4('0x76')][_0x03c4('0x2c')]);_0x4eb67f[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x966088['query']);_0x4eb67f[_0x03c4('0x39')]=_[_0x03c4('0x30')](_0x4eb67f['model'],_0x4eb67f[_0x03c4('0x2f')]);_0xc2de14[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x4eb67f[_0x03c4('0x2d')],qs[_0x03c4('0x32')](_0x966088['query'][_0x03c4('0x32')]));_0xc2de14[_0x03c4('0x31')]=_0xc2de14[_0x03c4('0x31')][_0x03c4('0x33')]?_0xc2de14[_0x03c4('0x31')]:_0x4eb67f[_0x03c4('0x2d')];_0xc2de14[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x966088[_0x03c4('0x2f')][_0x03c4('0x37')]);_0xc2de14[_0x03c4('0x38')]=qs['filters'](_[_0x03c4('0x3a')](_0x966088[_0x03c4('0x2f')],_0x4eb67f[_0x03c4('0x39')]));if(_0x966088[_0x03c4('0x2f')][_0x03c4('0x23')]){_0xc2de14[_0x03c4('0x38')]=_[_0x03c4('0x3b')](_0xc2de14[_0x03c4('0x38')],{'$or':_[_0x03c4('0x3c')](_0xc2de14[_0x03c4('0x31')],function(_0x3dc2af){var _0x41e10f={};_0x41e10f[_0x3dc2af]={'$like':'%'+_0x966088['query'][_0x03c4('0x23')]+'%'};return _0x41e10f;})});}_0xc2de14=_[_0x03c4('0x3b')]({},_0xc2de14,_0x966088[_0x03c4('0x45')]);return _0x46cc3b[_0x03c4('0x77')](_0xc2de14);}})[_0x03c4('0x1e')](function(_0x5cd233){if(_0x5cd233){_0x158d36=_0x5cd233[_0x03c4('0x33')];if(!_0x966088[_0x03c4('0x2f')][_0x03c4('0x34')](_0x03c4('0x35'))){_0xc2de14[_0x03c4('0x18')]=qs[_0x03c4('0x18')](_0x966088[_0x03c4('0x2f')][_0x03c4('0x18')]);_0xc2de14[_0x03c4('0x17')]=qs[_0x03c4('0x17')](_0x966088[_0x03c4('0x2f')][_0x03c4('0x17')]);}return _0x46cc3b[_0x03c4('0x77')](_0xc2de14);}})[_0x03c4('0x1e')](function(_0x3cf78c){if(_0x3cf78c){return _0x3cf78c?{'count':_0x158d36,'rows':_0x3cf78c}:null;}})[_0x03c4('0x1e')](respondWithResult(_0x4d6ec8,null))[_0x03c4('0x43')](handleError(_0x4d6ec8,null));};exports[_0x03c4('0x78')]=function(_0x372099,_0xde8915,_0x5896dc){var _0x3a49bd,_0x57c5f7;return db[_0x03c4('0x40')]['find']({'where':{'id':_0x372099[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0xde8915,null))[_0x03c4('0x1e')](function(_0x40dfe0){if(_0x40dfe0){_0x57c5f7=_0x40dfe0;return _0x40dfe0[_0x03c4('0x78')](_0x372099[_0x03c4('0x48')][_0x03c4('0x65')],_[_0x03c4('0x4f')](_0x372099[_0x03c4('0x48')],[_0x03c4('0x65'),'id'])||{});}return null;})['spread'](function(_0x4b0e61){var _0x4958b8;_0x3a49bd=_0x4b0e61||[];var _0x30bfc7=[];if(_0x4b0e61){for(var _0x17480f=0x0;_0x17480f<_0x4b0e61[_0x03c4('0x33')];_0x17480f+=0x1){var _0x8d742f=_0x4b0e61[_0x17480f][_0x03c4('0x1f')]({'plain':!![]});_0x57c5f7['dialCheckDuplicateType']=_0x372099[_0x03c4('0x48')][_0x03c4('0x79')]?_0x372099[_0x03c4('0x48')][_0x03c4('0x79')]:_0x57c5f7[_0x03c4('0x79')];switch(_0x57c5f7[_0x03c4('0x79')]){case _0x03c4('0x7a'):_0x4958b8=squel[_0x03c4('0x7b')]()[_0x03c4('0x7c')](_0x03c4('0x7d'))[_0x03c4('0x7e')]([_0x03c4('0x7f'),'scheduledAt','ContactId',_0x03c4('0x80'),_0x03c4('0x59'),_0x03c4('0x50'),_0x03c4('0x51')],squel['select']()[_0x03c4('0x81')](_0x03c4('0x7f'),_0x03c4('0x7f'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x83'))[_0x03c4('0x81')]('id',_0x03c4('0x84'))['field'](_0x8d742f['CmListId'][_0x03c4('0x85')](),_0x03c4('0x80'))['field'](_0x372099[_0x03c4('0x44')]['id'][_0x03c4('0x85')](),'VoiceQueueId')['field'](_0x03c4('0x82'),_0x03c4('0x50'))['field'](_0x03c4('0x82'),_0x03c4('0x51'))[_0x03c4('0x86')]('cm_contacts')['where'](_0x03c4('0x87'))[_0x03c4('0x38')]('ListId\x20=\x20?',_0x8d742f[_0x03c4('0x88')][_0x03c4('0x85')]())[_0x03c4('0x38')](_0x03c4('0x89'))[_0x03c4('0x38')](_0x03c4('0x8a'),squel['select']()[_0x03c4('0x81')](_0x03c4('0x8b'))[_0x03c4('0x86')](_0x03c4('0x8c'))['where'](_0x03c4('0x8d'),_0x372099[_0x03c4('0x44')]['id'][_0x03c4('0x85')]()))[_0x03c4('0x38')](_0x03c4('0x8a'),squel[_0x03c4('0x8e')]()[_0x03c4('0x81')]('COALESCE(phone,\x27\x27)')[_0x03c4('0x86')](_0x03c4('0x7d'))[_0x03c4('0x38')](_0x03c4('0x8d'),_0x372099[_0x03c4('0x44')]['id'][_0x03c4('0x85')]())))[_0x03c4('0x85')]();break;case _0x03c4('0x8f'):_0x4958b8=squel[_0x03c4('0x7b')]()[_0x03c4('0x7c')](_0x03c4('0x7d'))[_0x03c4('0x7e')]([_0x03c4('0x7f'),_0x03c4('0x83'),'ContactId','ListId',_0x03c4('0x59'),'createdAt',_0x03c4('0x51')],squel[_0x03c4('0x8e')]()[_0x03c4('0x81')]('phone','phone')[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x83'))['field']('id',_0x03c4('0x84'))[_0x03c4('0x81')](_0x8d742f[_0x03c4('0x88')][_0x03c4('0x85')](),_0x03c4('0x80'))[_0x03c4('0x81')](_0x372099[_0x03c4('0x44')]['id'][_0x03c4('0x85')](),_0x03c4('0x59'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x50'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x51'))['from'](_0x03c4('0x90'))['where'](_0x03c4('0x87'))['where'](_0x03c4('0x91'),_0x8d742f[_0x03c4('0x88')]['toString']())[_0x03c4('0x38')](_0x03c4('0x89'))[_0x03c4('0x38')](_0x03c4('0x8a'),squel[_0x03c4('0x8e')]()[_0x03c4('0x81')]('COALESCE(phone,\x27\x27)')[_0x03c4('0x86')](_0x03c4('0x7d'))[_0x03c4('0x38')](_0x03c4('0x8d'),_0x372099[_0x03c4('0x44')]['id']['toString']())))[_0x03c4('0x85')]();break;default:_0x4958b8=squel[_0x03c4('0x7b')]()[_0x03c4('0x7c')]('cm_hopper')['fromQuery']([_0x03c4('0x7f'),'scheduledAt',_0x03c4('0x84'),_0x03c4('0x80'),'VoiceQueueId',_0x03c4('0x50'),_0x03c4('0x51')],squel['select']()[_0x03c4('0x81')]('phone',_0x03c4('0x7f'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x83'))[_0x03c4('0x81')]('id','ContactId')[_0x03c4('0x81')](_0x8d742f['CmListId'][_0x03c4('0x85')](),_0x03c4('0x80'))[_0x03c4('0x81')](_0x372099['params']['id']['toString'](),_0x03c4('0x59'))[_0x03c4('0x81')]('NOW()',_0x03c4('0x50'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x51'))[_0x03c4('0x86')](_0x03c4('0x90'))[_0x03c4('0x38')](_0x03c4('0x87'))['where'](_0x03c4('0x91'),_0x8d742f[_0x03c4('0x88')][_0x03c4('0x85')]())[_0x03c4('0x38')](_0x03c4('0x89')))['toString']();}_0x30bfc7[_0x03c4('0x92')](db['sequelize'][_0x03c4('0x2f')](_0x4958b8));}return BPromise['all'](_0x30bfc7);}})[_0x03c4('0x1e')](function(){return _0x3a49bd;})[_0x03c4('0x1e')](respondWithResult(_0xde8915,null))['catch'](handleError(_0xde8915,null));};exports[_0x03c4('0x93')]=function(_0x4aa072,_0x5e52af,_0x5001d4){var _0x3691eb;return db[_0x03c4('0x40')]['find']({'where':{'id':_0x4aa072[_0x03c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e52af,null))['then'](function(_0x39764b){if(_0x39764b){return _0x39764b['removeLists'](_0x4aa072[_0x03c4('0x2f')][_0x03c4('0x65')]);}})['then'](function(_0x440243){if(_0x440243){_0x3691eb=_0x440243;return db[_0x03c4('0x56')][_0x03c4('0x1d')]({'where':{'ListId':_0x4aa072[_0x03c4('0x2f')][_0x03c4('0x65')],'VoiceQueueId':_0x4aa072[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](function(){return _0x3691eb;});}})[_0x03c4('0x1e')](respondWithStatusCode(_0x5e52af,null))[_0x03c4('0x43')](handleError(_0x5e52af,null));};exports[_0x03c4('0x94')]=function(_0x31c26a,_0xd1a976,_0x38780d){var _0x541e57={};var _0x545574={};var _0xf58ed1;var _0x5cb76c;return db[_0x03c4('0x40')][_0x03c4('0x58')]({'where':{'id':_0x31c26a[_0x03c4('0x44')]['id']}})['then'](handleEntityNotFound(_0xd1a976,null))[_0x03c4('0x1e')](function(_0x5a885c){if(_0x5a885c){_0xf58ed1=_0x5a885c;_0x545574['model']=_[_0x03c4('0x2e')](db['CmList']['rawAttributes']);_0x545574[_0x03c4('0x2f')]=_[_0x03c4('0x2e')](_0x31c26a[_0x03c4('0x2f')]);_0x545574['filters']=_[_0x03c4('0x30')](_0x545574[_0x03c4('0x2d')],_0x545574[_0x03c4('0x2f')]);_0x541e57[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x545574['model'],qs[_0x03c4('0x32')](_0x31c26a[_0x03c4('0x2f')]['fields']));_0x541e57['attributes']=_0x541e57[_0x03c4('0x31')][_0x03c4('0x33')]?_0x541e57[_0x03c4('0x31')]:_0x545574['model'];_0x541e57[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x31c26a[_0x03c4('0x2f')][_0x03c4('0x37')]);_0x541e57['where']=qs[_0x03c4('0x39')](_['pick'](_0x31c26a[_0x03c4('0x2f')],_0x545574[_0x03c4('0x39')]));if(_0x31c26a[_0x03c4('0x2f')][_0x03c4('0x23')]){_0x541e57[_0x03c4('0x38')]=_['merge'](_0x541e57['where'],{'$or':_[_0x03c4('0x3c')](_0x541e57[_0x03c4('0x31')],function(_0x506281){var _0x62a746={};_0x62a746[_0x506281]={'$like':'%'+_0x31c26a[_0x03c4('0x2f')]['filter']+'%'};return _0x62a746;})});}_0x541e57=_[_0x03c4('0x3b')]({},_0x541e57,_0x31c26a[_0x03c4('0x45')]);return _0xf58ed1['getBlackLists'](_0x541e57);}})[_0x03c4('0x1e')](function(_0x1d81d4){if(_0x1d81d4){_0x5cb76c=_0x1d81d4['length'];if(!_0x31c26a[_0x03c4('0x2f')][_0x03c4('0x34')]('nolimit')){_0x541e57[_0x03c4('0x18')]=qs['limit'](_0x31c26a[_0x03c4('0x2f')][_0x03c4('0x18')]);_0x541e57[_0x03c4('0x17')]=qs[_0x03c4('0x17')](_0x31c26a['query'][_0x03c4('0x17')]);}return _0xf58ed1['getBlackLists'](_0x541e57);}})[_0x03c4('0x1e')](function(_0x21fcd5){if(_0x21fcd5){return _0x21fcd5?{'count':_0x5cb76c,'rows':_0x21fcd5}:null;}})['then'](respondWithResult(_0xd1a976,null))[_0x03c4('0x43')](handleError(_0xd1a976,null));};exports[_0x03c4('0x95')]=function(_0x168543,_0x875a0e,_0x39e6ed){var _0x251a0e,_0x73dcd;return db['VoiceQueue'][_0x03c4('0x46')]({'where':{'id':_0x168543[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x875a0e,null))[_0x03c4('0x1e')](function(_0x38c8ee){if(_0x38c8ee){_0x73dcd=_0x38c8ee;return _0x38c8ee['addBlackLists'](_0x168543['body'][_0x03c4('0x65')],_['omit'](_0x168543[_0x03c4('0x48')],[_0x03c4('0x65'),'id'])||{});}return null;})[_0x03c4('0x68')](function(_0x1fe49c){var _0x5d96f5;_0x251a0e=_0x1fe49c||[];var _0x15d6f8=[];if(_0x1fe49c){for(var _0x11bfd5=0x0;_0x11bfd5<_0x1fe49c[_0x03c4('0x33')];_0x11bfd5+=0x1){var _0x3902ad=_0x1fe49c[_0x11bfd5][_0x03c4('0x1f')]({'plain':!![]});_0x5d96f5=squel[_0x03c4('0x7b')]()['into'](_0x03c4('0x96'))[_0x03c4('0x7e')](['phone',_0x03c4('0x84'),_0x03c4('0x80'),_0x03c4('0x59'),_0x03c4('0x50'),'updatedAt'],squel['select']()[_0x03c4('0x81')](_0x03c4('0x7f'),_0x03c4('0x7f'))[_0x03c4('0x81')]('id',_0x03c4('0x84'))[_0x03c4('0x81')](_0x3902ad[_0x03c4('0x88')][_0x03c4('0x85')](),_0x03c4('0x80'))[_0x03c4('0x81')](_0x168543[_0x03c4('0x44')]['id']['toString'](),_0x03c4('0x59'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x50'))[_0x03c4('0x81')](_0x03c4('0x82'),_0x03c4('0x51'))[_0x03c4('0x86')](_0x03c4('0x90'))[_0x03c4('0x38')]('deletedAt\x20IS\x20NULL')[_0x03c4('0x38')](_0x03c4('0x91'),_0x3902ad[_0x03c4('0x88')][_0x03c4('0x85')]())['where'](_0x03c4('0x89')))[_0x03c4('0x85')]();_0x15d6f8[_0x03c4('0x92')](db[_0x03c4('0x97')][_0x03c4('0x2f')](_0x5d96f5));}return BPromise[_0x03c4('0x70')](_0x15d6f8);}})[_0x03c4('0x1e')](function(){return _0x251a0e;})[_0x03c4('0x1e')](respondWithResult(_0x875a0e,null))['catch'](handleError(_0x875a0e,null));};exports[_0x03c4('0x98')]=function(_0x35f437,_0x140199,_0x18345c){var _0x508554;return db['VoiceQueue'][_0x03c4('0x46')]({'where':{'id':_0x35f437[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](handleEntityNotFound(_0x140199,null))['then'](function(_0x4c2506){if(_0x4c2506){return _0x4c2506[_0x03c4('0x98')](_0x35f437['query']['ids']);}})[_0x03c4('0x1e')](function(_0x2eea63){if(_0x2eea63){_0x508554=_0x2eea63;return db[_0x03c4('0x5d')]['destroy']({'where':{'ListId':_0x35f437[_0x03c4('0x2f')]['ids'],'VoiceQueueId':_0x35f437[_0x03c4('0x44')]['id']}})[_0x03c4('0x1e')](function(){return _0x508554;});}})[_0x03c4('0x1e')](respondWithStatusCode(_0x140199,null))[_0x03c4('0x43')](handleError(_0x140199,null));}; \ No newline at end of file +var _0x3e38=['nolimit','order','sort','where','pick','merge','map','key','field','options','includeAll','include','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','value','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','clone','omit','body','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','union','penalty','ids','removeTeams','removeAgents','addAgents','spread','emit','userVoiceQueue:save','voicePause','interface','push','isNil','format','SIP/%s','all','isArray','userVoiceQueue:remove','realtime','UserVoiceQueueRt','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','updatedAt','phone','CmListId','toString','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','sequelize','getBlackLists','addBlackLists','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./voiceQueue.socket','register','end','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','includes','type','find','sendStatus','error','stack','name','send','index','VoiceQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e38,0x65));var _0x83e3=function(_0x2e751b,_0x482f00){_0x2e751b=_0x2e751b-0x0;var _0x48be5d=_0x3e38[_0x2e751b];return _0x48be5d;};'use strict';var pdf=require(_0x83e3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x83e3('0x1'));var zipdir=require(_0x83e3('0x2'));var jsonpatch=require(_0x83e3('0x3'));var rp=require(_0x83e3('0x4'));var moment=require(_0x83e3('0x5'));var BPromise=require(_0x83e3('0x6'));var Mustache=require(_0x83e3('0x7'));var util=require(_0x83e3('0x8'));var path=require(_0x83e3('0x9'));var sox=require(_0x83e3('0xa'));var csv=require(_0x83e3('0xb'));var ejs=require(_0x83e3('0xc'));var fs=require('fs');var _=require(_0x83e3('0xd'));var squel=require(_0x83e3('0xe'));var crypto=require(_0x83e3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x83e3('0x10'));var toCsv=require(_0x83e3('0xb'));var querystring=require(_0x83e3('0x11'));var Papa=require(_0x83e3('0x12'));var authService=require('../../components/auth/service');var hardwareService=require(_0x83e3('0x13'));var Redis=require(_0x83e3('0x14'));var qs=require(_0x83e3('0x15'));var logger=require(_0x83e3('0x16'))(_0x83e3('0x17'));var utils=require(_0x83e3('0x18'));var config=require(_0x83e3('0x19'));var db=require('../../mysqldb')['db'];config[_0x83e3('0x1a')]=_[_0x83e3('0x1b')](config[_0x83e3('0x1a')],{'host':_0x83e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83e3('0x1a')]));require(_0x83e3('0x1d'))[_0x83e3('0x1e')](socket);function respondWithStatusCode(_0x24c8f7,_0x3b7275){_0x3b7275=_0x3b7275||0xcc;return function(_0x2e70f5){if(_0x2e70f5){return _0x24c8f7['sendStatus'](_0x3b7275);}return _0x24c8f7['status'](_0x3b7275)[_0x83e3('0x1f')]();};}function respondWithResult(_0x206e14,_0x18c346){_0x18c346=_0x18c346||0xc8;return function(_0x313cb3){if(_0x313cb3){return _0x206e14[_0x83e3('0x20')](_0x18c346)['json'](_0x313cb3);}};}function respondWithFilteredResult(_0x2a9a2b,_0x2fb342){return function(_0x4ff4a5){if(_0x4ff4a5){var _0x3e45e3=_0x4ff4a5[_0x83e3('0x21')],_0x2b7fc7=_0x2fb342[_0x83e3('0x22')],_0x27dfa3=_0x2fb342[_0x83e3('0x22')]+_0x2fb342[_0x83e3('0x23')],_0x36893e;if(_0x27dfa3>=_0x3e45e3){_0x27dfa3=_0x3e45e3;_0x36893e=0xc8;}else{_0x36893e=0xce;}_0x2a9a2b['status'](_0x36893e);return _0x2a9a2b[_0x83e3('0x24')](_0x83e3('0x25'),_0x2b7fc7+'-'+_0x27dfa3+'/'+_0x3e45e3)['json'](_0x4ff4a5);}return null;};}function patchUpdates(_0xfd2974){return function(_0x537112){try{jsonpatch['apply'](_0x537112,_0xfd2974,!![]);}catch(_0x5409c1){return BPromise[_0x83e3('0x26')](_0x5409c1);}return _0x537112[_0x83e3('0x27')]();};}function saveUpdates(_0x41610c,_0x2b620b){return function(_0x4a95c7){if(_0x4a95c7){return _0x4a95c7[_0x83e3('0x28')](_0x41610c)[_0x83e3('0x29')](function(_0x1b082f){return _0x1b082f;});}return null;};}function removeEntity(_0xe71df6,_0x3608de){return function(_0x344f05){if(_0x344f05){return _0x344f05[_0x83e3('0x2a')]()[_0x83e3('0x29')](function(){var _0x198eee=_0x344f05[_0x83e3('0x2b')]({'plain':!![]});var _0x10cc57=[{'name':'VoiceQueues','value':_0x83e3('0x2c'),'ignore':![]},{'name':_0x83e3('0x2d'),'value':_0x83e3('0x2e'),'ignore':![]}];var _0x5ec443=_(_0x10cc57)[_0x83e3('0x2f')](_0x83e3('0x30'))['map']('value')['value']();if(_[_0x83e3('0x31')](_0x5ec443,_0x198eee[_0x83e3('0x32')])){return;}var _0xf41c61=_[_0x83e3('0x33')](_0x10cc57,['value',_0x198eee[_0x83e3('0x32')]])['name'];return db['UserProfileResource'][_0x83e3('0x2a')]({'where':{'type':_0xf41c61,'resourceId':_0x198eee['id']}})['then'](function(){return _0x344f05;});})['then'](function(){_0xe71df6[_0x83e3('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x184917,_0x2843f6){return function(_0x38d6de){if(!_0x38d6de){_0x184917[_0x83e3('0x34')](0x194);}return _0x38d6de;};}function handleError(_0x5dc59b,_0x224626){_0x224626=_0x224626||0x1f4;return function(_0xaedcef){logger[_0x83e3('0x35')](_0xaedcef[_0x83e3('0x36')]);if(_0xaedcef['name']){delete _0xaedcef[_0x83e3('0x37')];}_0x5dc59b[_0x83e3('0x20')](_0x224626)[_0x83e3('0x38')](_0xaedcef);};}exports[_0x83e3('0x39')]=function(_0x306062,_0x419b59){var _0x8bfb0f={},_0x5918c5={},_0x59c8db={'count':0x0,'rows':[]};var _0x5c6d68=db[_0x83e3('0x3a')][_0x83e3('0x3b')];_0x5918c5[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](_0x5c6d68);_0x5918c5[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x306062['query']);_0x5918c5[_0x83e3('0x3f')]=_['intersection'](_0x5918c5['model'],_0x5918c5['query']);_0x8bfb0f[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x5918c5[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x306062['query'][_0x83e3('0x42')]));_0x8bfb0f[_0x83e3('0x40')]=_0x8bfb0f[_0x83e3('0x40')][_0x83e3('0x43')]?_0x8bfb0f[_0x83e3('0x40')]:_0x5918c5[_0x83e3('0x3c')];if(!_0x306062[_0x83e3('0x3e')]['hasOwnProperty'](_0x83e3('0x44'))){_0x8bfb0f[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x306062[_0x83e3('0x3e')][_0x83e3('0x23')]);_0x8bfb0f['offset']=qs['offset'](_0x306062[_0x83e3('0x3e')][_0x83e3('0x22')]);}_0x8bfb0f[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x306062[_0x83e3('0x3e')][_0x83e3('0x46')]);_0x8bfb0f[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_[_0x83e3('0x48')](_0x306062[_0x83e3('0x3e')],_0x5918c5['filters']));if(_0x306062[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x8bfb0f['where']=_[_0x83e3('0x49')](_0x8bfb0f[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0x5c6d68,function(_0xa92e01){if(_0xa92e01[_0x83e3('0x32')][_0x83e3('0x4b')]!=='VIRTUAL'){var _0x306b3d={};_0x306b3d[_0xa92e01[_0x83e3('0x4c')]]={'$like':'%'+_0x306062['query'][_0x83e3('0x2f')]+'%'};return _0x306b3d;}})});}_0x8bfb0f=_[_0x83e3('0x49')]({},_0x8bfb0f,_0x306062[_0x83e3('0x4d')]);var _0x44e511={'where':_0x8bfb0f['where']};return db[_0x83e3('0x3a')]['count'](_0x44e511)['then'](function(_0xb2cce9){_0x59c8db[_0x83e3('0x21')]=_0xb2cce9;if(_0x306062[_0x83e3('0x3e')][_0x83e3('0x4e')]){_0x8bfb0f[_0x83e3('0x4f')]=[{'all':!![]}];}return db[_0x83e3('0x3a')]['findAll'](_0x8bfb0f);})[_0x83e3('0x29')](function(_0x3cf132){_0x59c8db[_0x83e3('0x50')]=_0x3cf132;return _0x59c8db;})[_0x83e3('0x29')](respondWithFilteredResult(_0x419b59,_0x8bfb0f))['catch'](handleError(_0x419b59,null));};exports[_0x83e3('0x51')]=function(_0x400a9a,_0x768fb6){var _0x508ad8={'raw':![],'where':{'id':_0x400a9a[_0x83e3('0x52')]['id']}},_0x3e0557={};_0x3e0557['model']=_['keys'](db[_0x83e3('0x3a')]['rawAttributes']);_0x3e0557['query']=_[_0x83e3('0x3d')](_0x400a9a[_0x83e3('0x3e')]);_0x3e0557[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x3e0557['model'],_0x3e0557[_0x83e3('0x3e')]);_0x508ad8[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x3e0557[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x400a9a[_0x83e3('0x3e')][_0x83e3('0x42')]));_0x508ad8[_0x83e3('0x40')]=_0x508ad8['attributes'][_0x83e3('0x43')]?_0x508ad8[_0x83e3('0x40')]:_0x3e0557[_0x83e3('0x3c')];if(_0x400a9a[_0x83e3('0x3e')][_0x83e3('0x4e')]){_0x508ad8[_0x83e3('0x4f')]=[{'all':!![]}];}_0x508ad8=_[_0x83e3('0x49')]({},_0x508ad8,_0x400a9a[_0x83e3('0x4d')]);return db[_0x83e3('0x3a')][_0x83e3('0x33')](_0x508ad8)[_0x83e3('0x29')](handleEntityNotFound(_0x768fb6,null))['then'](respondWithResult(_0x768fb6,null))['catch'](handleError(_0x768fb6,null));};exports[_0x83e3('0x53')]=function(_0x2c4799,_0x4919cf){return db['VoiceQueue'][_0x83e3('0x53')](_0x2c4799['body'],{})['then'](function(_0x36197e){var _0x40208c=_0x2c4799[_0x83e3('0x54')][_0x83e3('0x2b')]({'plain':!![]});if(!_0x40208c)throw new Error(_0x83e3('0x55'));if(_0x40208c[_0x83e3('0x56')]===_0x83e3('0x54')){var _0x33400c=_0x36197e['get']({'plain':!![]});var _0x4108f5=[{'name':_0x83e3('0x57'),'value':'inbound'},{'name':_0x83e3('0x2d'),'value':_0x83e3('0x2e')}];var _0x292986=_[_0x83e3('0x33')](_0x4108f5,[_0x83e3('0x58'),_0x33400c[_0x83e3('0x32')]])['name'];return db[_0x83e3('0x59')]['find']({'where':{'name':_0x292986,'userProfileId':_0x40208c[_0x83e3('0x5a')]},'raw':!![]})[_0x83e3('0x29')](function(_0xb8faee){if(_0xb8faee&&_0xb8faee[_0x83e3('0x5b')]===0x0){return db[_0x83e3('0x5c')][_0x83e3('0x53')]({'name':_0x33400c[_0x83e3('0x37')],'resourceId':_0x33400c['id'],'type':_0xb8faee[_0x83e3('0x37')],'sectionId':_0xb8faee['id']},{})['then'](function(){return _0x36197e;});}else{return _0x36197e;}})[_0x83e3('0x5d')](function(_0x529936){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x529936);throw _0x529936;});}return _0x36197e;})['then'](respondWithResult(_0x4919cf,0xc9))['catch'](handleError(_0x4919cf,null));};exports[_0x83e3('0x5e')]=function(_0x2e8c0d,_0x3cee58){var _0x35355b={'raw':![],'where':{'id':_0x2e8c0d[_0x83e3('0x52')]['id']}},_0x1fb1d0={};_0x1fb1d0[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db[_0x83e3('0x3a')]['rawAttributes']);_0x35355b[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x1fb1d0[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x2e8c0d[_0x83e3('0x3e')][_0x83e3('0x42')]));_0x35355b[_0x83e3('0x40')]=_0x35355b[_0x83e3('0x40')][_0x83e3('0x43')]?_0x35355b['attributes']:_0x1fb1d0['model'];if(_0x2e8c0d[_0x83e3('0x3e')][_0x83e3('0x4e')]){_0x35355b[_0x83e3('0x4f')]=[{'all':!![]}];}_0x35355b=_['merge']({},_0x35355b,_0x2e8c0d[_0x83e3('0x4d')]);return db[_0x83e3('0x3a')][_0x83e3('0x33')](_0x35355b)['then'](handleEntityNotFound(_0x3cee58,null))['then'](function(_0x32b51f){if(_0x32b51f){var _0x444ae2=_0x32b51f['get']({'plain':!![]});_0x444ae2=qs[_0x83e3('0x5f')](_0x444ae2,['id','createdAt','updatedAt']);_0x2e8c0d['body']=_[_0x83e3('0x5f')](_0x2e8c0d[_0x83e3('0x60')],['id',_0x83e3('0x61'),'updatedAt']);return db[_0x83e3('0x3a')][_0x83e3('0x53')](_['merge'](_0x444ae2,_0x2e8c0d[_0x83e3('0x60')]),{'include':_0x2e8c0d['query'][_0x83e3('0x4e')]?[{'all':!![]}]:undefined})[_0x83e3('0x29')](function(_0x33485d){var _0x2abba3=_0x2e8c0d[_0x83e3('0x54')]['get']({'plain':!![]});if(!_0x2abba3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2abba3[_0x83e3('0x56')]===_0x83e3('0x54')){var _0x563d66=_0x33485d[_0x83e3('0x2b')]({'plain':!![]});var _0x44d747=[{'name':_0x83e3('0x57'),'value':_0x83e3('0x2c')},{'name':_0x83e3('0x2d'),'value':_0x83e3('0x2e')}];var _0x10233d=_[_0x83e3('0x33')](_0x44d747,[_0x83e3('0x58'),_0x563d66[_0x83e3('0x32')]])[_0x83e3('0x37')];return db[_0x83e3('0x59')]['find']({'where':{'name':_0x10233d,'userProfileId':_0x2abba3[_0x83e3('0x5a')]},'raw':!![]})['then'](function(_0x52b1b4){if(_0x52b1b4&&_0x52b1b4['autoAssociation']===0x0){return db[_0x83e3('0x5c')]['create']({'name':_0x563d66[_0x83e3('0x37')],'resourceId':_0x563d66['id'],'type':_0x52b1b4[_0x83e3('0x37')],'sectionId':_0x52b1b4['id']},{})[_0x83e3('0x29')](function(){return _0x33485d;});}else{return _0x33485d;}})[_0x83e3('0x5d')](function(_0x34943b){logger[_0x83e3('0x35')](_0x83e3('0x62'),_0x34943b);throw _0x34943b;});}return _0x33485d;});}})['then'](respondWithResult(_0x3cee58,0xc9))[_0x83e3('0x5d')](handleError(_0x3cee58,null));};exports[_0x83e3('0x28')]=function(_0x4fd296,_0x507fc9){if(_0x4fd296[_0x83e3('0x60')]['id']){delete _0x4fd296[_0x83e3('0x60')]['id'];}return db[_0x83e3('0x3a')]['find']({'where':{'id':_0x4fd296[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x507fc9,null))[_0x83e3('0x29')](saveUpdates(_0x4fd296[_0x83e3('0x60')],null))['then'](respondWithResult(_0x507fc9,null))['catch'](handleError(_0x507fc9,null));};exports[_0x83e3('0x2a')]=function(_0x484fbe,_0x517cbf){return db[_0x83e3('0x3a')][_0x83e3('0x33')]({'where':{'id':_0x484fbe[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x517cbf,null))[_0x83e3('0x29')](removeEntity(_0x517cbf,null))[_0x83e3('0x5d')](handleError(_0x517cbf,null));};exports[_0x83e3('0x63')]=function(_0x28c36f,_0x5996bb,_0x2db13f){var _0x2b8697={'raw':![],'where':{}};var _0x32d69f={};var _0x5e937a={'count':0x0,'rows':[]};return db[_0x83e3('0x3a')][_0x83e3('0x64')]({'where':{'id':_0x28c36f[_0x83e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x5996bb,null))[_0x83e3('0x29')](function(_0x4c6537){if(_0x4c6537){_0x32d69f[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db[_0x83e3('0x65')][_0x83e3('0x3b')]);_0x32d69f[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x28c36f[_0x83e3('0x3e')]);_0x32d69f[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x32d69f[_0x83e3('0x3c')],_0x32d69f['query']);_0x2b8697[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x32d69f['model'],qs[_0x83e3('0x42')](_0x28c36f['query'][_0x83e3('0x42')]));_0x2b8697[_0x83e3('0x40')]=_0x2b8697[_0x83e3('0x40')][_0x83e3('0x43')]?_0x2b8697[_0x83e3('0x40')]:_0x32d69f[_0x83e3('0x3c')];if(!_0x28c36f[_0x83e3('0x3e')][_0x83e3('0x66')](_0x83e3('0x44'))){_0x2b8697[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x28c36f[_0x83e3('0x3e')][_0x83e3('0x23')]);_0x2b8697[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x28c36f[_0x83e3('0x3e')][_0x83e3('0x22')]);}_0x2b8697['order']=qs[_0x83e3('0x46')](_0x28c36f['query'][_0x83e3('0x46')]);_0x2b8697[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_['pick'](_0x28c36f[_0x83e3('0x3e')],_0x32d69f[_0x83e3('0x3f')]));_0x2b8697[_0x83e3('0x47')][_0x83e3('0x67')]=_0x4c6537['id'];if(_0x28c36f[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x2b8697[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x2b8697[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0x2b8697[_0x83e3('0x40')],function(_0x10e925){var _0x5adda3={};_0x5adda3[_0x10e925]={'$like':'%'+_0x28c36f['query'][_0x83e3('0x2f')]+'%'};return _0x5adda3;})});}_0x2b8697=_[_0x83e3('0x49')]({},_0x2b8697,_0x28c36f[_0x83e3('0x4d')]);return db[_0x83e3('0x65')][_0x83e3('0x21')]({'where':_0x2b8697[_0x83e3('0x47')]})['then'](function(_0x4af0e4){_0x5e937a[_0x83e3('0x21')]=_0x4af0e4;if(_0x28c36f[_0x83e3('0x3e')][_0x83e3('0x4e')]){_0x2b8697[_0x83e3('0x4f')]=[{'all':!![]}];}return db[_0x83e3('0x65')][_0x83e3('0x68')](_0x2b8697);})['then'](function(_0x3d7354){_0x5e937a['rows']=_0x3d7354;return _0x5e937a;});}})[_0x83e3('0x29')](respondWithFilteredResult(_0x5996bb,_0x2b8697))[_0x83e3('0x5d')](handleError(_0x5996bb,null));};exports['getHopperHistories']=function(_0x54b5f0,_0x4284f5,_0x341e41){var _0x21298f={'raw':!![],'where':{}};var _0x35bade={};var _0x54340a={'count':0x0,'rows':[]};return db[_0x83e3('0x3a')][_0x83e3('0x64')]({'where':{'id':_0x54b5f0[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x4284f5,null))['then'](function(_0x318e4a){if(_0x318e4a){_0x35bade[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db[_0x83e3('0x69')][_0x83e3('0x3b')]);_0x35bade[_0x83e3('0x3e')]=_['keys'](_0x54b5f0[_0x83e3('0x3e')]);_0x35bade['filters']=_[_0x83e3('0x41')](_0x35bade[_0x83e3('0x3c')],_0x35bade[_0x83e3('0x3e')]);_0x21298f[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x35bade[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x54b5f0[_0x83e3('0x3e')]['fields']));_0x21298f[_0x83e3('0x40')]=_0x21298f[_0x83e3('0x40')]['length']?_0x21298f[_0x83e3('0x40')]:_0x35bade[_0x83e3('0x3c')];if(!_0x54b5f0['query'][_0x83e3('0x66')](_0x83e3('0x44'))){_0x21298f[_0x83e3('0x23')]=qs['limit'](_0x54b5f0['query'][_0x83e3('0x23')]);_0x21298f[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x54b5f0[_0x83e3('0x3e')][_0x83e3('0x22')]);}_0x21298f[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x54b5f0[_0x83e3('0x3e')]['sort']);_0x21298f[_0x83e3('0x47')]=qs['filters'](_[_0x83e3('0x48')](_0x54b5f0[_0x83e3('0x3e')],_0x35bade[_0x83e3('0x3f')]));_0x21298f[_0x83e3('0x47')][_0x83e3('0x67')]=_0x318e4a['id'];if(_0x54b5f0[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x21298f[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x21298f[_0x83e3('0x47')],{'$or':_['map'](_0x21298f['attributes'],function(_0x161789){var _0x7eed16={};_0x7eed16[_0x161789]={'$like':'%'+_0x54b5f0[_0x83e3('0x3e')][_0x83e3('0x2f')]+'%'};return _0x7eed16;})});}_0x21298f=_[_0x83e3('0x49')]({},_0x21298f,_0x54b5f0[_0x83e3('0x4d')]);return db['CmHopperHistory'][_0x83e3('0x21')]({'where':_0x21298f[_0x83e3('0x47')]})[_0x83e3('0x29')](function(_0x493a1b){_0x54340a[_0x83e3('0x21')]=_0x493a1b;if(_0x54b5f0['query'][_0x83e3('0x4e')]){_0x21298f[_0x83e3('0x4f')]=[{'all':!![]}];}return db[_0x83e3('0x69')][_0x83e3('0x68')](_0x21298f);})[_0x83e3('0x29')](function(_0x574475){_0x54340a[_0x83e3('0x50')]=_0x574475;return _0x54340a;});}})[_0x83e3('0x29')](respondWithFilteredResult(_0x4284f5,_0x21298f))['catch'](handleError(_0x4284f5,null));};exports[_0x83e3('0x6a')]=function(_0x4f1ac8,_0x23e19d,_0x2da769){var _0xb69cfc={'raw':!![],'where':{}};var _0x203fc7={};var _0x4919e4={'count':0x0,'rows':[]};return db[_0x83e3('0x3a')]['findOne']({'where':{'id':_0x4f1ac8[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x23e19d,null))['then'](function(_0x577b2a){if(_0x577b2a){_0x203fc7['model']=_['keys'](db['CmHopperFinal'][_0x83e3('0x3b')]);_0x203fc7['query']=_[_0x83e3('0x3d')](_0x4f1ac8[_0x83e3('0x3e')]);_0x203fc7[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x203fc7[_0x83e3('0x3c')],_0x203fc7[_0x83e3('0x3e')]);_0xb69cfc[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x203fc7[_0x83e3('0x3c')],qs['fields'](_0x4f1ac8['query'][_0x83e3('0x42')]));_0xb69cfc[_0x83e3('0x40')]=_0xb69cfc['attributes'][_0x83e3('0x43')]?_0xb69cfc[_0x83e3('0x40')]:_0x203fc7[_0x83e3('0x3c')];if(!_0x4f1ac8[_0x83e3('0x3e')]['hasOwnProperty'](_0x83e3('0x44'))){_0xb69cfc[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x4f1ac8[_0x83e3('0x3e')][_0x83e3('0x23')]);_0xb69cfc[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x4f1ac8[_0x83e3('0x3e')][_0x83e3('0x22')]);}_0xb69cfc[_0x83e3('0x45')]=qs['sort'](_0x4f1ac8[_0x83e3('0x3e')]['sort']);_0xb69cfc[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_[_0x83e3('0x48')](_0x4f1ac8[_0x83e3('0x3e')],_0x203fc7[_0x83e3('0x3f')]));_0xb69cfc[_0x83e3('0x47')]['VoiceQueueId']=_0x577b2a['id'];if(_0x4f1ac8[_0x83e3('0x3e')]['filter']){_0xb69cfc[_0x83e3('0x47')]=_['merge'](_0xb69cfc[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0xb69cfc['attributes'],function(_0x4eadc3){var _0x5fbd1={};_0x5fbd1[_0x4eadc3]={'$like':'%'+_0x4f1ac8[_0x83e3('0x3e')][_0x83e3('0x2f')]+'%'};return _0x5fbd1;})});}_0xb69cfc=_[_0x83e3('0x49')]({},_0xb69cfc,_0x4f1ac8['options']);return db['CmHopperFinal'][_0x83e3('0x21')]({'where':_0xb69cfc['where']})[_0x83e3('0x29')](function(_0x40b896){_0x4919e4[_0x83e3('0x21')]=_0x40b896;if(_0x4f1ac8[_0x83e3('0x3e')][_0x83e3('0x4e')]){_0xb69cfc[_0x83e3('0x4f')]=[{'all':!![]}];}return db[_0x83e3('0x6b')][_0x83e3('0x68')](_0xb69cfc);})[_0x83e3('0x29')](function(_0x420a90){_0x4919e4[_0x83e3('0x50')]=_0x420a90;return _0x4919e4;});}})[_0x83e3('0x29')](respondWithFilteredResult(_0x23e19d,_0xb69cfc))[_0x83e3('0x5d')](handleError(_0x23e19d,null));};exports[_0x83e3('0x6c')]=function(_0x5901d2,_0x2df094,_0x12ab5c){var _0x3f124a={'raw':!![],'where':{}};var _0x3c6334={};var _0x3993b1={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5901d2[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x2df094,null))[_0x83e3('0x29')](function(_0x4176fe){if(_0x4176fe){_0x3c6334[_0x83e3('0x3c')]=_['keys'](db['CmHopperBlack'][_0x83e3('0x3b')]);_0x3c6334['query']=_[_0x83e3('0x3d')](_0x5901d2['query']);_0x3c6334[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x3c6334[_0x83e3('0x3c')],_0x3c6334[_0x83e3('0x3e')]);_0x3f124a[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x3c6334[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x5901d2[_0x83e3('0x3e')][_0x83e3('0x42')]));_0x3f124a[_0x83e3('0x40')]=_0x3f124a[_0x83e3('0x40')]['length']?_0x3f124a[_0x83e3('0x40')]:_0x3c6334['model'];if(!_0x5901d2['query'][_0x83e3('0x66')]('nolimit')){_0x3f124a[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x5901d2[_0x83e3('0x3e')][_0x83e3('0x23')]);_0x3f124a[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x5901d2[_0x83e3('0x3e')][_0x83e3('0x22')]);}_0x3f124a[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x5901d2[_0x83e3('0x3e')]['sort']);_0x3f124a['where']=qs['filters'](_['pick'](_0x5901d2[_0x83e3('0x3e')],_0x3c6334[_0x83e3('0x3f')]));_0x3f124a[_0x83e3('0x47')][_0x83e3('0x67')]=_0x4176fe['id'];if(_0x5901d2['query'][_0x83e3('0x2f')]){_0x3f124a[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x3f124a['where'],{'$or':_[_0x83e3('0x4a')](_0x3f124a[_0x83e3('0x40')],function(_0x4a47d8){var _0x4fedf1={};_0x4fedf1[_0x4a47d8]={'$like':'%'+_0x5901d2[_0x83e3('0x3e')][_0x83e3('0x2f')]+'%'};return _0x4fedf1;})});}_0x3f124a=_[_0x83e3('0x49')]({},_0x3f124a,_0x5901d2['options']);return db['CmHopperBlack'][_0x83e3('0x21')]({'where':_0x3f124a[_0x83e3('0x47')]})[_0x83e3('0x29')](function(_0x22713c){_0x3993b1[_0x83e3('0x21')]=_0x22713c;if(_0x5901d2['query']['includeAll']){_0x3f124a['include']=[{'all':!![]}];}return db[_0x83e3('0x6d')][_0x83e3('0x68')](_0x3f124a);})[_0x83e3('0x29')](function(_0x40a23e){_0x3993b1[_0x83e3('0x50')]=_0x40a23e;return _0x3993b1;});}})[_0x83e3('0x29')](respondWithFilteredResult(_0x2df094,_0x3f124a))[_0x83e3('0x5d')](handleError(_0x2df094,null));};exports[_0x83e3('0x6e')]=function(_0x132c02,_0xd49e92,_0x49dc3a){var _0x4793b0={};var _0x42466d={};var _0x8d85db;var _0x29fe2d;return db[_0x83e3('0x3a')][_0x83e3('0x64')]({'where':{'id':_0x132c02['params']['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0xd49e92,null))[_0x83e3('0x29')](function(_0x5f1181){if(_0x5f1181){_0x8d85db=_0x5f1181;_0x42466d[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db['Team'][_0x83e3('0x3b')]);_0x42466d[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x132c02[_0x83e3('0x3e')]);_0x42466d[_0x83e3('0x3f')]=_['intersection'](_0x42466d['model'],_0x42466d['query']);_0x4793b0[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x42466d[_0x83e3('0x3c')],qs['fields'](_0x132c02[_0x83e3('0x3e')][_0x83e3('0x42')]));_0x4793b0[_0x83e3('0x40')]=_0x4793b0[_0x83e3('0x40')][_0x83e3('0x43')]?_0x4793b0[_0x83e3('0x40')]:_0x42466d[_0x83e3('0x3c')];_0x4793b0['order']=qs[_0x83e3('0x46')](_0x132c02[_0x83e3('0x3e')][_0x83e3('0x46')]);_0x4793b0['where']=qs['filters'](_['pick'](_0x132c02[_0x83e3('0x3e')],_0x42466d[_0x83e3('0x3f')]));if(_0x132c02[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x4793b0[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x4793b0[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0x4793b0[_0x83e3('0x40')],function(_0x4fb6ab){var _0x18213e={};_0x18213e[_0x4fb6ab]={'$like':'%'+_0x132c02[_0x83e3('0x3e')][_0x83e3('0x2f')]+'%'};return _0x18213e;})});}_0x4793b0=_[_0x83e3('0x49')]({},_0x4793b0,_0x132c02[_0x83e3('0x4d')]);return _0x8d85db[_0x83e3('0x6e')](_0x4793b0);}})['then'](function(_0x31108e){if(_0x31108e){_0x29fe2d=_0x31108e[_0x83e3('0x43')];if(!_0x132c02['query'][_0x83e3('0x66')](_0x83e3('0x44'))){_0x4793b0['limit']=qs['limit'](_0x132c02[_0x83e3('0x3e')][_0x83e3('0x23')]);_0x4793b0[_0x83e3('0x22')]=qs['offset'](_0x132c02['query']['offset']);}return _0x8d85db[_0x83e3('0x6e')](_0x4793b0);}})[_0x83e3('0x29')](function(_0x197540){if(_0x197540){return _0x197540?{'count':_0x29fe2d,'rows':_0x197540}:null;}})[_0x83e3('0x29')](respondWithResult(_0xd49e92,null))[_0x83e3('0x5d')](handleError(_0xd49e92,null));};exports[_0x83e3('0x6f')]=function(_0x497270,_0x4e376a,_0x28f080){var _0x281b95=[];var _0x3f613c;return db[_0x83e3('0x70')][_0x83e3('0x68')]({'where':{'id':_0x497270[_0x83e3('0x60')]['ids']},'attributes':['id'],'include':[{'model':db[_0x83e3('0x71')],'as':_0x83e3('0x72'),'attributes':['id'],'raw':!![]}]})[_0x83e3('0x29')](function(_0x2d378b){if(_0x2d378b){for(var _0x49c9da=0x0;_0x49c9da<_0x2d378b[_0x83e3('0x43')];_0x49c9da+=0x1){for(var _0x34a749=0x0;_0x34a749<_0x2d378b[_0x49c9da][_0x83e3('0x72')]['length'];_0x34a749+=0x1){_0x281b95=_[_0x83e3('0x73')](_0x281b95,[_0x2d378b[_0x49c9da][_0x83e3('0x72')][_0x34a749]['id']]);}}return _0x281b95;}})[_0x83e3('0x29')](function(_0x183039){if(_0x183039){return db['VoiceQueue'][_0x83e3('0x33')]({'where':{'id':_0x497270['params']['id']}});}})[_0x83e3('0x29')](function(_0x5b5357){if(_0x5b5357){_0x3f613c=_0x5b5357;return _0x3f613c['addAgents'](_0x281b95,{'penalty':_0x497270[_0x83e3('0x60')][_0x83e3('0x74')]});}})['then'](function(_0x42071e){if(_0x42071e){return _0x3f613c['addTeams'](_0x497270['body'][_0x83e3('0x75')]);}})[_0x83e3('0x29')](handleEntityNotFound(_0x4e376a,null))[_0x83e3('0x29')](respondWithStatusCode(_0x4e376a,null))[_0x83e3('0x5d')](handleError(_0x4e376a,null));};exports[_0x83e3('0x76')]=function(_0xa7140b,_0x1a16d1,_0x387a88){var _0xe7b263=[];var _0x252f9b;return db[_0x83e3('0x70')][_0x83e3('0x68')]({'where':{'id':_0xa7140b['query'][_0x83e3('0x75')]},'attributes':['id'],'include':[{'model':db[_0x83e3('0x71')],'as':_0x83e3('0x72'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x697327){if(_0x697327){for(var _0x32de87=0x0;_0x32de87<_0x697327[_0x83e3('0x43')];_0x32de87+=0x1){for(var _0x560a12=0x0;_0x560a12<_0x697327[_0x32de87][_0x83e3('0x72')][_0x83e3('0x43')];_0x560a12+=0x1){_0xe7b263=_['union'](_0xe7b263,[_0x697327[_0x32de87][_0x83e3('0x72')][_0x560a12]['id']]);}}return _0xe7b263;}})['then'](function(_0x3682bc){if(_0x3682bc){return db[_0x83e3('0x3a')]['find']({'where':{'id':_0xa7140b[_0x83e3('0x52')]['id']}});}})[_0x83e3('0x29')](function(_0x11c9b3){if(_0x11c9b3){_0x252f9b=_0x11c9b3;return _0x252f9b[_0x83e3('0x77')](_0xe7b263);}})['then'](function(_0x346aa4){if(_0x252f9b){return _0x252f9b[_0x83e3('0x76')](_0xa7140b[_0x83e3('0x3e')][_0x83e3('0x75')]);}})[_0x83e3('0x29')](handleEntityNotFound(_0x1a16d1,null))[_0x83e3('0x29')](respondWithStatusCode(_0x1a16d1,null))['catch'](handleError(_0x1a16d1,null));};exports[_0x83e3('0x78')]=function(_0x1a3de0,_0x473d1c,_0x8c4216){var _0x588de6,_0x4d8d39;return db[_0x83e3('0x3a')][_0x83e3('0x33')]({'where':{'id':_0x1a3de0[_0x83e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x473d1c,null))[_0x83e3('0x29')](function(_0x361aac){if(_0x361aac){_0x4d8d39=_0x361aac;return _0x361aac[_0x83e3('0x78')](_0x1a3de0[_0x83e3('0x60')][_0x83e3('0x75')],_[_0x83e3('0x5f')](_0x1a3de0[_0x83e3('0x60')],[_0x83e3('0x75'),'id'])||{})[_0x83e3('0x79')](function(_0x560681){for(var _0x5ce42c=0x0;_0x5ce42c<_0x1a3de0['body']['ids'][_0x83e3('0x43')];_0x5ce42c+=0x1){socket[_0x83e3('0x7a')](_0x83e3('0x7b'),{'UserId':_0x1a3de0[_0x83e3('0x60')][_0x83e3('0x75')][_0x5ce42c],'VoiceQueueId':_0x1a3de0['params']['id']});}return _0x560681;});}})[_0x83e3('0x29')](function(_0x375de6){_0x588de6=_0x375de6||[];if(_0x4d8d39){return db[_0x83e3('0x71')]['findAll']({'where':{'id':_0x1a3de0[_0x83e3('0x60')][_0x83e3('0x75')]},'attributes':['id',_0x83e3('0x37'),'loginInPause',_0x83e3('0x7c'),_0x83e3('0x7d')],'raw':!![]});}})['then'](function(_0x51141e){if(_0x51141e&&_0x51141e[_0x83e3('0x43')]){var _0x56c014=[];for(var _0x9c80c7=0x0;_0x9c80c7<_0x51141e[_0x83e3('0x43')];_0x9c80c7++){_0x56c014[_0x83e3('0x7e')](db['UserVoiceQueueRt']['upsert']({'membername':_0x51141e[_0x9c80c7][_0x83e3('0x37')],'UserId':_0x51141e[_0x9c80c7]['id'],'queue_name':_0x4d8d39[_0x83e3('0x37')],'VoiceQueueId':_0x4d8d39['id'],'interface':_[_0x83e3('0x7f')](_0x51141e[_0x9c80c7][_0x83e3('0x7d')])?util[_0x83e3('0x80')](_0x83e3('0x81'),_0x51141e[_0x9c80c7]['name']):_0x51141e[_0x9c80c7][_0x83e3('0x7d')],'paused':_0x51141e[_0x9c80c7][_0x83e3('0x7c')]||![],'penalty':_0x1a3de0[_0x83e3('0x60')][_0x83e3('0x74')]||0x0}));}return BPromise[_0x83e3('0x82')](_0x56c014);}})[_0x83e3('0x29')](function(_0x343bac){return _0x588de6;})['then'](respondWithResult(_0x473d1c,null))[_0x83e3('0x5d')](handleError(_0x473d1c,null));};exports[_0x83e3('0x77')]=function(_0x542f5f,_0x5b11ee,_0x48f12d){var _0x331d90;return db[_0x83e3('0x3a')][_0x83e3('0x33')]({'where':{'id':_0x542f5f['params']['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x5b11ee,null))[_0x83e3('0x29')](function(_0x2d9229){if(_0x2d9229){return _0x2d9229[_0x83e3('0x77')](_0x542f5f['query'][_0x83e3('0x75')])[_0x83e3('0x29')](function(_0x1517b9){if(_[_0x83e3('0x83')](_0x542f5f[_0x83e3('0x3e')]['ids'])){for(var _0x5429e7=0x0;_0x5429e7<_0x542f5f['query']['ids']['length'];_0x5429e7+=0x1){socket['emit'](_0x83e3('0x84'),{'UserId':_0x542f5f[_0x83e3('0x3e')][_0x83e3('0x75')][_0x5429e7],'VoiceQueueId':_0x542f5f[_0x83e3('0x52')]['id']});}}else{socket[_0x83e3('0x7a')]('userVoiceQueue:remove',{'UserId':_0x542f5f[_0x83e3('0x3e')][_0x83e3('0x75')],'VoiceQueueId':_0x542f5f[_0x83e3('0x52')]['id']});}});}})[_0x83e3('0x29')](function(_0x5e6d09){if(_0x542f5f[_0x83e3('0x3e')][_0x83e3('0x85')]){_0x331d90=_0x5e6d09;return db[_0x83e3('0x86')][_0x83e3('0x2a')]({'where':{'VoiceQueueId':_0x542f5f['params']['id'],'UserId':_0x542f5f[_0x83e3('0x3e')][_0x83e3('0x75')]}})[_0x83e3('0x29')](function(){return _0x331d90;});}})['then'](respondWithStatusCode(_0x5b11ee,null))[_0x83e3('0x5d')](handleError(_0x5b11ee,null));};exports['getAgents']=function(_0x55a67d,_0x31af74,_0x5bcaae){var _0x3419ef={};var _0x507e60={};var _0x294995;var _0x24e068;return db[_0x83e3('0x3a')]['findOne']({'where':{'id':_0x55a67d[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x31af74,null))[_0x83e3('0x29')](function(_0x499a9a){if(_0x499a9a){_0x294995=_0x499a9a;_0x507e60['model']=_[_0x83e3('0x3d')](db[_0x83e3('0x71')][_0x83e3('0x3b')]);_0x507e60['query']=_['keys'](_0x55a67d[_0x83e3('0x3e')]);_0x507e60[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x507e60[_0x83e3('0x3c')],_0x507e60[_0x83e3('0x3e')]);_0x3419ef[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x507e60[_0x83e3('0x3c')],qs['fields'](_0x55a67d[_0x83e3('0x3e')][_0x83e3('0x42')]));_0x3419ef['attributes']=_0x3419ef[_0x83e3('0x40')][_0x83e3('0x43')]?_0x3419ef[_0x83e3('0x40')]:_0x507e60['model'];_0x3419ef[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x55a67d[_0x83e3('0x3e')]['sort']);_0x3419ef[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_[_0x83e3('0x48')](_0x55a67d[_0x83e3('0x3e')],_0x507e60['filters']));if(_0x55a67d['query']['filter']){_0x3419ef[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x3419ef[_0x83e3('0x47')],{'$or':_['map'](_0x3419ef[_0x83e3('0x40')],function(_0x31e903){var _0x1c307a={};_0x1c307a[_0x31e903]={'$like':'%'+_0x55a67d[_0x83e3('0x3e')]['filter']+'%'};return _0x1c307a;})});}_0x3419ef=_[_0x83e3('0x49')]({},_0x3419ef,_0x55a67d[_0x83e3('0x4d')]);return _0x294995['getAgents'](_0x3419ef);}})[_0x83e3('0x29')](function(_0x51d091){if(_0x51d091){_0x24e068=_0x51d091[_0x83e3('0x43')];if(!_0x55a67d[_0x83e3('0x3e')]['hasOwnProperty'](_0x83e3('0x44'))){_0x3419ef['limit']=qs[_0x83e3('0x23')](_0x55a67d['query'][_0x83e3('0x23')]);_0x3419ef['offset']=qs['offset'](_0x55a67d[_0x83e3('0x3e')][_0x83e3('0x22')]);}return _0x294995[_0x83e3('0x87')](_0x3419ef);}})[_0x83e3('0x29')](function(_0x1313fe){if(_0x1313fe){return _0x1313fe?{'count':_0x24e068,'rows':_0x1313fe}:null;}})[_0x83e3('0x29')](respondWithResult(_0x31af74,null))[_0x83e3('0x5d')](handleError(_0x31af74,null));};exports[_0x83e3('0x88')]=function(_0x45aa57,_0x14a764,_0x2e83ce){var _0x4f7cb3={};var _0x5757b1={};var _0x16db9e;var _0x1e91d4;return db['VoiceQueue'][_0x83e3('0x64')]({'where':{'id':_0x45aa57[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x14a764,null))['then'](function(_0x47630f){if(_0x47630f){_0x16db9e=_0x47630f;_0x5757b1[_0x83e3('0x3c')]=_['keys'](db['UserVoiceQueueRt'][_0x83e3('0x3b')]);_0x5757b1[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x45aa57[_0x83e3('0x3e')]);_0x5757b1[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x5757b1[_0x83e3('0x3c')],_0x5757b1[_0x83e3('0x3e')]);_0x4f7cb3[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x5757b1[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x45aa57['query'][_0x83e3('0x42')]));_0x4f7cb3[_0x83e3('0x40')]=_0x4f7cb3['attributes']['length']?_0x4f7cb3[_0x83e3('0x40')]:_0x5757b1[_0x83e3('0x3c')];_0x4f7cb3[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x45aa57[_0x83e3('0x3e')]['sort']);_0x4f7cb3[_0x83e3('0x47')]=qs['filters'](_[_0x83e3('0x48')](_0x45aa57[_0x83e3('0x3e')],_0x5757b1['filters']));if(_0x45aa57[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x4f7cb3[_0x83e3('0x47')]=_['merge'](_0x4f7cb3[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0x4f7cb3[_0x83e3('0x40')],function(_0x2ab618){var _0x4dbd2d={};_0x4dbd2d[_0x2ab618]={'$like':'%'+_0x45aa57['query'][_0x83e3('0x2f')]+'%'};return _0x4dbd2d;})});}_0x4f7cb3=_[_0x83e3('0x49')]({},_0x4f7cb3,_0x45aa57[_0x83e3('0x4d')]);return _0x16db9e[_0x83e3('0x88')](_0x4f7cb3);}})[_0x83e3('0x29')](function(_0x4f37ee){if(_0x4f37ee){_0x1e91d4=_0x4f37ee['length'];if(!_0x45aa57[_0x83e3('0x3e')][_0x83e3('0x66')](_0x83e3('0x44'))){_0x4f7cb3[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x45aa57['query']['limit']);_0x4f7cb3[_0x83e3('0x22')]=qs['offset'](_0x45aa57[_0x83e3('0x3e')]['offset']);}return _0x16db9e[_0x83e3('0x88')](_0x4f7cb3);}})[_0x83e3('0x29')](function(_0xf83626){return _0xf83626?{'count':_0x1e91d4,'rows':_0xf83626}:null;})[_0x83e3('0x29')](respondWithResult(_0x14a764,null))[_0x83e3('0x5d')](handleError(_0x14a764,null));};exports[_0x83e3('0x89')]=function(_0x57fa05,_0x4b31eb,_0x318d05){var _0x230cc8={};var _0x36e7eb={};var _0x34f06f;var _0x40d7ce;return db[_0x83e3('0x3a')][_0x83e3('0x64')]({'where':{'id':_0x57fa05[_0x83e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b31eb,null))[_0x83e3('0x29')](function(_0x3c9058){if(_0x3c9058){_0x34f06f=_0x3c9058;_0x36e7eb[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db[_0x83e3('0x8a')]['rawAttributes']);_0x36e7eb[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x57fa05[_0x83e3('0x3e')]);_0x36e7eb[_0x83e3('0x3f')]=_['intersection'](_0x36e7eb[_0x83e3('0x3c')],_0x36e7eb['query']);_0x230cc8[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x36e7eb['model'],qs[_0x83e3('0x42')](_0x57fa05['query'][_0x83e3('0x42')]));_0x230cc8[_0x83e3('0x40')]=_0x230cc8['attributes'][_0x83e3('0x43')]?_0x230cc8[_0x83e3('0x40')]:_0x36e7eb[_0x83e3('0x3c')];_0x230cc8[_0x83e3('0x45')]=qs[_0x83e3('0x46')](_0x57fa05['query'][_0x83e3('0x46')]);_0x230cc8[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_[_0x83e3('0x48')](_0x57fa05['query'],_0x36e7eb['filters']));if(_0x57fa05[_0x83e3('0x3e')][_0x83e3('0x2f')]){_0x230cc8[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x230cc8[_0x83e3('0x47')],{'$or':_['map'](_0x230cc8[_0x83e3('0x40')],function(_0x4a5785){var _0x14caf0={};_0x14caf0[_0x4a5785]={'$like':'%'+_0x57fa05[_0x83e3('0x3e')][_0x83e3('0x2f')]+'%'};return _0x14caf0;})});}_0x230cc8=_['merge']({},_0x230cc8,_0x57fa05[_0x83e3('0x4d')]);return _0x34f06f[_0x83e3('0x89')](_0x230cc8);}})['then'](function(_0x5bd724){if(_0x5bd724){_0x40d7ce=_0x5bd724[_0x83e3('0x43')];if(!_0x57fa05['query'][_0x83e3('0x66')](_0x83e3('0x44'))){_0x230cc8[_0x83e3('0x23')]=qs[_0x83e3('0x23')](_0x57fa05[_0x83e3('0x3e')][_0x83e3('0x23')]);_0x230cc8[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x57fa05['query'][_0x83e3('0x22')]);}return _0x34f06f[_0x83e3('0x89')](_0x230cc8);}})[_0x83e3('0x29')](function(_0x522c41){if(_0x522c41){return _0x522c41?{'count':_0x40d7ce,'rows':_0x522c41}:null;}})[_0x83e3('0x29')](respondWithResult(_0x4b31eb,null))[_0x83e3('0x5d')](handleError(_0x4b31eb,null));};exports[_0x83e3('0x8b')]=function(_0x38f4c9,_0x1d8fcf,_0x1cb5ec){var _0x5d3476,_0x40d823;return db[_0x83e3('0x3a')]['find']({'where':{'id':_0x38f4c9[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x1d8fcf,null))[_0x83e3('0x29')](function(_0xb45724){if(_0xb45724){_0x40d823=_0xb45724;return _0xb45724[_0x83e3('0x8b')](_0x38f4c9['body'][_0x83e3('0x75')],_[_0x83e3('0x5f')](_0x38f4c9[_0x83e3('0x60')],['ids','id'])||{});}return null;})[_0x83e3('0x79')](function(_0x6c724a){var _0x1f6a78;_0x5d3476=_0x6c724a||[];var _0x10617f=[];if(_0x6c724a){for(var _0x48498a=0x0;_0x48498a<_0x6c724a['length'];_0x48498a+=0x1){var _0x36cfdc=_0x6c724a[_0x48498a][_0x83e3('0x2b')]({'plain':!![]});_0x40d823[_0x83e3('0x8c')]=_0x38f4c9['body'][_0x83e3('0x8c')]?_0x38f4c9[_0x83e3('0x60')]['dialCheckDuplicateType']:_0x40d823['dialCheckDuplicateType'];switch(_0x40d823[_0x83e3('0x8c')]){case'always':_0x1f6a78=squel[_0x83e3('0x8d')]()[_0x83e3('0x8e')](_0x83e3('0x8f'))[_0x83e3('0x90')](['phone',_0x83e3('0x91'),'ContactId','ListId',_0x83e3('0x67'),_0x83e3('0x61'),_0x83e3('0x92')],squel['select']()[_0x83e3('0x4c')](_0x83e3('0x93'),_0x83e3('0x93'))[_0x83e3('0x4c')]('NOW()',_0x83e3('0x91'))[_0x83e3('0x4c')]('id','ContactId')[_0x83e3('0x4c')](_0x36cfdc[_0x83e3('0x94')][_0x83e3('0x95')](),_0x83e3('0x96'))['field'](_0x38f4c9[_0x83e3('0x52')]['id']['toString'](),_0x83e3('0x67'))['field']('NOW()',_0x83e3('0x61'))['field'](_0x83e3('0x97'),_0x83e3('0x92'))[_0x83e3('0x98')](_0x83e3('0x99'))[_0x83e3('0x47')](_0x83e3('0x9a'))[_0x83e3('0x47')](_0x83e3('0x9b'),_0x36cfdc[_0x83e3('0x94')][_0x83e3('0x95')]())[_0x83e3('0x47')](_0x83e3('0x9c'))[_0x83e3('0x47')](_0x83e3('0x9d'),squel[_0x83e3('0x9e')]()[_0x83e3('0x4c')](_0x83e3('0x9f'))[_0x83e3('0x98')](_0x83e3('0xa0'))[_0x83e3('0x47')](_0x83e3('0xa1'),_0x38f4c9[_0x83e3('0x52')]['id'][_0x83e3('0x95')]()))[_0x83e3('0x47')](_0x83e3('0x9d'),squel[_0x83e3('0x9e')]()['field'](_0x83e3('0xa2'))[_0x83e3('0x98')](_0x83e3('0x8f'))[_0x83e3('0x47')](_0x83e3('0xa1'),_0x38f4c9['params']['id'][_0x83e3('0x95')]())))[_0x83e3('0x95')]();break;case _0x83e3('0xa3'):_0x1f6a78=squel[_0x83e3('0x8d')]()[_0x83e3('0x8e')](_0x83e3('0x8f'))['fromQuery'](['phone','scheduledAt',_0x83e3('0xa4'),_0x83e3('0x96'),_0x83e3('0x67'),_0x83e3('0x61'),_0x83e3('0x92')],squel[_0x83e3('0x9e')]()['field'](_0x83e3('0x93'),'phone')[_0x83e3('0x4c')](_0x83e3('0x97'),_0x83e3('0x91'))[_0x83e3('0x4c')]('id',_0x83e3('0xa4'))[_0x83e3('0x4c')](_0x36cfdc[_0x83e3('0x94')][_0x83e3('0x95')](),'ListId')[_0x83e3('0x4c')](_0x38f4c9[_0x83e3('0x52')]['id'][_0x83e3('0x95')](),_0x83e3('0x67'))['field'](_0x83e3('0x97'),'createdAt')['field'](_0x83e3('0x97'),'updatedAt')['from'](_0x83e3('0x99'))['where'](_0x83e3('0x9a'))[_0x83e3('0x47')](_0x83e3('0x9b'),_0x36cfdc[_0x83e3('0x94')][_0x83e3('0x95')]())[_0x83e3('0x47')](_0x83e3('0x9c'))[_0x83e3('0x47')](_0x83e3('0x9d'),squel[_0x83e3('0x9e')]()[_0x83e3('0x4c')](_0x83e3('0xa2'))[_0x83e3('0x98')](_0x83e3('0x8f'))[_0x83e3('0x47')](_0x83e3('0xa1'),_0x38f4c9[_0x83e3('0x52')]['id'][_0x83e3('0x95')]())))[_0x83e3('0x95')]();break;default:_0x1f6a78=squel[_0x83e3('0x8d')]()['into']('cm_hopper')[_0x83e3('0x90')]([_0x83e3('0x93'),_0x83e3('0x91'),_0x83e3('0xa4'),_0x83e3('0x96'),'VoiceQueueId','createdAt',_0x83e3('0x92')],squel[_0x83e3('0x9e')]()['field'](_0x83e3('0x93'),_0x83e3('0x93'))[_0x83e3('0x4c')](_0x83e3('0x97'),_0x83e3('0x91'))[_0x83e3('0x4c')]('id','ContactId')['field'](_0x36cfdc[_0x83e3('0x94')]['toString'](),_0x83e3('0x96'))[_0x83e3('0x4c')](_0x38f4c9[_0x83e3('0x52')]['id'][_0x83e3('0x95')](),'VoiceQueueId')[_0x83e3('0x4c')]('NOW()','createdAt')[_0x83e3('0x4c')](_0x83e3('0x97'),_0x83e3('0x92'))[_0x83e3('0x98')](_0x83e3('0x99'))[_0x83e3('0x47')](_0x83e3('0x9a'))[_0x83e3('0x47')](_0x83e3('0x9b'),_0x36cfdc[_0x83e3('0x94')][_0x83e3('0x95')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x83e3('0x95')]();}_0x10617f[_0x83e3('0x7e')](db[_0x83e3('0xa5')]['query'](_0x1f6a78));}return BPromise[_0x83e3('0x82')](_0x10617f);}})[_0x83e3('0x29')](function(){return _0x5d3476;})[_0x83e3('0x29')](respondWithResult(_0x1d8fcf,null))['catch'](handleError(_0x1d8fcf,null));};exports['removeLists']=function(_0x1a1ec0,_0x3b3cbd,_0x1936bb){var _0x29aa8b;return db['VoiceQueue'][_0x83e3('0x33')]({'where':{'id':_0x1a1ec0[_0x83e3('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b3cbd,null))['then'](function(_0x2312b8){if(_0x2312b8){return _0x2312b8['removeLists'](_0x1a1ec0[_0x83e3('0x3e')][_0x83e3('0x75')]);}})[_0x83e3('0x29')](function(_0x1585a9){if(_0x1585a9){_0x29aa8b=_0x1585a9;return db[_0x83e3('0x65')][_0x83e3('0x2a')]({'where':{'ListId':_0x1a1ec0[_0x83e3('0x3e')][_0x83e3('0x75')],'VoiceQueueId':_0x1a1ec0[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](function(){return _0x29aa8b;});}})[_0x83e3('0x29')](respondWithStatusCode(_0x3b3cbd,null))[_0x83e3('0x5d')](handleError(_0x3b3cbd,null));};exports['getBlackLists']=function(_0x52b1ec,_0x38cb26,_0x5c7b73){var _0x10036a={};var _0x57a337={};var _0x4fbfbc;var _0x52798e;return db[_0x83e3('0x3a')][_0x83e3('0x64')]({'where':{'id':_0x52b1ec[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x38cb26,null))[_0x83e3('0x29')](function(_0x9a6a94){if(_0x9a6a94){_0x4fbfbc=_0x9a6a94;_0x57a337[_0x83e3('0x3c')]=_[_0x83e3('0x3d')](db[_0x83e3('0x8a')][_0x83e3('0x3b')]);_0x57a337[_0x83e3('0x3e')]=_[_0x83e3('0x3d')](_0x52b1ec['query']);_0x57a337[_0x83e3('0x3f')]=_[_0x83e3('0x41')](_0x57a337[_0x83e3('0x3c')],_0x57a337[_0x83e3('0x3e')]);_0x10036a[_0x83e3('0x40')]=_[_0x83e3('0x41')](_0x57a337[_0x83e3('0x3c')],qs[_0x83e3('0x42')](_0x52b1ec['query']['fields']));_0x10036a[_0x83e3('0x40')]=_0x10036a['attributes'][_0x83e3('0x43')]?_0x10036a[_0x83e3('0x40')]:_0x57a337[_0x83e3('0x3c')];_0x10036a['order']=qs[_0x83e3('0x46')](_0x52b1ec[_0x83e3('0x3e')][_0x83e3('0x46')]);_0x10036a[_0x83e3('0x47')]=qs[_0x83e3('0x3f')](_[_0x83e3('0x48')](_0x52b1ec[_0x83e3('0x3e')],_0x57a337[_0x83e3('0x3f')]));if(_0x52b1ec[_0x83e3('0x3e')]['filter']){_0x10036a[_0x83e3('0x47')]=_[_0x83e3('0x49')](_0x10036a[_0x83e3('0x47')],{'$or':_[_0x83e3('0x4a')](_0x10036a[_0x83e3('0x40')],function(_0x1ff981){var _0x2e1db2={};_0x2e1db2[_0x1ff981]={'$like':'%'+_0x52b1ec['query'][_0x83e3('0x2f')]+'%'};return _0x2e1db2;})});}_0x10036a=_[_0x83e3('0x49')]({},_0x10036a,_0x52b1ec['options']);return _0x4fbfbc['getBlackLists'](_0x10036a);}})[_0x83e3('0x29')](function(_0x143df3){if(_0x143df3){_0x52798e=_0x143df3[_0x83e3('0x43')];if(!_0x52b1ec[_0x83e3('0x3e')][_0x83e3('0x66')]('nolimit')){_0x10036a['limit']=qs[_0x83e3('0x23')](_0x52b1ec['query'][_0x83e3('0x23')]);_0x10036a[_0x83e3('0x22')]=qs[_0x83e3('0x22')](_0x52b1ec[_0x83e3('0x3e')][_0x83e3('0x22')]);}return _0x4fbfbc[_0x83e3('0xa6')](_0x10036a);}})[_0x83e3('0x29')](function(_0x23b7e1){if(_0x23b7e1){return _0x23b7e1?{'count':_0x52798e,'rows':_0x23b7e1}:null;}})[_0x83e3('0x29')](respondWithResult(_0x38cb26,null))[_0x83e3('0x5d')](handleError(_0x38cb26,null));};exports[_0x83e3('0xa7')]=function(_0xd79a6d,_0x2c8c5a,_0x2650a6){var _0x2462c1,_0x3f78d0;return db[_0x83e3('0x3a')][_0x83e3('0x33')]({'where':{'id':_0xd79a6d[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x2c8c5a,null))['then'](function(_0x487916){if(_0x487916){_0x3f78d0=_0x487916;return _0x487916['addBlackLists'](_0xd79a6d[_0x83e3('0x60')][_0x83e3('0x75')],_['omit'](_0xd79a6d[_0x83e3('0x60')],[_0x83e3('0x75'),'id'])||{});}return null;})[_0x83e3('0x79')](function(_0x12acdf){var _0x440d64;_0x2462c1=_0x12acdf||[];var _0x44b27a=[];if(_0x12acdf){for(var _0x25a9e3=0x0;_0x25a9e3<_0x12acdf[_0x83e3('0x43')];_0x25a9e3+=0x1){var _0x245383=_0x12acdf[_0x25a9e3]['get']({'plain':!![]});_0x440d64=squel[_0x83e3('0x8d')]()['into']('cm_hopper_black')[_0x83e3('0x90')]([_0x83e3('0x93'),_0x83e3('0xa4'),_0x83e3('0x96'),_0x83e3('0x67'),_0x83e3('0x61'),_0x83e3('0x92')],squel[_0x83e3('0x9e')]()[_0x83e3('0x4c')](_0x83e3('0x93'),_0x83e3('0x93'))['field']('id',_0x83e3('0xa4'))[_0x83e3('0x4c')](_0x245383[_0x83e3('0x94')]['toString'](),'ListId')['field'](_0xd79a6d[_0x83e3('0x52')]['id'][_0x83e3('0x95')](),_0x83e3('0x67'))[_0x83e3('0x4c')](_0x83e3('0x97'),_0x83e3('0x61'))['field'](_0x83e3('0x97'),_0x83e3('0x92'))[_0x83e3('0x98')](_0x83e3('0x99'))[_0x83e3('0x47')](_0x83e3('0x9a'))['where']('ListId\x20=\x20?',_0x245383['CmListId'][_0x83e3('0x95')]())[_0x83e3('0x47')](_0x83e3('0x9c')))['toString']();_0x44b27a[_0x83e3('0x7e')](db['sequelize']['query'](_0x440d64));}return BPromise[_0x83e3('0x82')](_0x44b27a);}})[_0x83e3('0x29')](function(){return _0x2462c1;})[_0x83e3('0x29')](respondWithResult(_0x2c8c5a,null))[_0x83e3('0x5d')](handleError(_0x2c8c5a,null));};exports[_0x83e3('0xa8')]=function(_0x249612,_0x574e98,_0x396fe4){var _0x4649ac;return db[_0x83e3('0x3a')][_0x83e3('0x33')]({'where':{'id':_0x249612['params']['id']}})[_0x83e3('0x29')](handleEntityNotFound(_0x574e98,null))[_0x83e3('0x29')](function(_0x3f41f0){if(_0x3f41f0){return _0x3f41f0['removeBlackLists'](_0x249612[_0x83e3('0x3e')][_0x83e3('0x75')]);}})[_0x83e3('0x29')](function(_0x9c94ea){if(_0x9c94ea){_0x4649ac=_0x9c94ea;return db['CmHopperBlack'][_0x83e3('0x2a')]({'where':{'ListId':_0x249612[_0x83e3('0x3e')]['ids'],'VoiceQueueId':_0x249612[_0x83e3('0x52')]['id']}})[_0x83e3('0x29')](function(){return _0x4649ac;});}})[_0x83e3('0x29')](respondWithStatusCode(_0x574e98,null))['catch'](handleError(_0x574e98,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 440557a..f72ed8e 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 _0x4f83=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x40a601,_0x3bd7ab){var _0x5b636d=function(_0x3cf912){while(--_0x3cf912){_0x40a601['push'](_0x40a601['shift']());}};_0x5b636d(++_0x3bd7ab);}(_0x4f83,0x6d));var _0x34f8=function(_0x233e46,_0x349cab){_0x233e46=_0x233e46-0x0;var _0x10973a=_0x4f83[_0x233e46];return _0x10973a;};'use strict';var EventEmitter=require(_0x34f8('0x0'));var VoiceQueue=require(_0x34f8('0x1'))['db'][_0x34f8('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x34f8('0x3')](0x0);var events={'afterCreate':_0x34f8('0x4'),'afterUpdate':_0x34f8('0x5'),'afterDestroy':_0x34f8('0x6')};function emitEvent(_0x281d66){return function(_0x44e13b,_0x22f7fa,_0x3c6c73){VoiceQueueEvents[_0x34f8('0x7')](_0x281d66+':'+_0x44e13b['id'],_0x44e13b);VoiceQueueEvents['emit'](_0x281d66,_0x44e13b);_0x3c6c73(null);};}for(var e in events){if(events[_0x34f8('0x8')](e)){var event=events[e];VoiceQueue[_0x34f8('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xf26a=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xc49513,_0x18ed11){var _0x1194bc=function(_0x59b707){while(--_0x59b707){_0xc49513['push'](_0xc49513['shift']());}};_0x1194bc(++_0x18ed11);}(_0xf26a,0x158));var _0xaf26=function(_0x324c83,_0x2eaa98){_0x324c83=_0x324c83-0x0;var _0x15eb3c=_0xf26a[_0x324c83];return _0x15eb3c;};'use strict';var EventEmitter=require(_0xaf26('0x0'));var VoiceQueue=require(_0xaf26('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf26('0x2'),'afterUpdate':'update','afterDestroy':_0xaf26('0x3')};function emitEvent(_0x1b935b){return function(_0x3471b2,_0x5d3bc,_0x1cb812){VoiceQueueEvents[_0xaf26('0x4')](_0x1b935b+':'+_0x3471b2['id'],_0x3471b2);VoiceQueueEvents[_0xaf26('0x4')](_0x1b935b,_0x3471b2);_0x1cb812(null);};}for(var e in events){if(events[_0xaf26('0x5')](e)){var event=events[e];VoiceQueue[_0xaf26('0x6')](e,emitEvent(event));}}module[_0xaf26('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2b7324e..5711748 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 _0x990f=['define','VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./voiceQueue.attributes'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x990f,0x1bb));var _0xf990=function(_0x12c5d5,_0x26cca5){_0x12c5d5=_0x12c5d5-0x0;var _0x5c97f2=_0x990f[_0x12c5d5];return _0x5c97f2;};'use strict';var _=require(_0xf990('0x0'));var util=require(_0xf990('0x1'));var logger=require(_0xf990('0x2'))(_0xf990('0x3'));var moment=require(_0xf990('0x4'));var BPromise=require(_0xf990('0x5'));var rp=require(_0xf990('0x6'));var attributes=require(_0xf990('0x7'));module['exports']=function(_0x1e1d88,_0x1d63f9){return _0x1e1d88[_0xf990('0x8')](_0xf990('0x9'),attributes,{'tableName':_0xf990('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d74=['VoiceQueue','voice_queues','lodash','util','api','moment','request-promise'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x6d74,0x152));var _0x46d7=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x6d74[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x46d7('0x0'));var util=require(_0x46d7('0x1'));var logger=require('../../config/logger')(_0x46d7('0x2'));var moment=require(_0x46d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x46d7('0x4'));var attributes=require('./voiceQueue.attributes');module['exports']=function(_0xf0ec4b,_0x2fc649){return _0xf0ec4b['define'](_0x46d7('0x5'),attributes,{'tableName':_0x46d7('0x6'),'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 5a72aa5..d86017f 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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x5c00c8,_0xa71130){var _0x396ba4=function(_0x51e93b){while(--_0x51e93b){_0x5c00c8['push'](_0x5c00c8['shift']());}};_0x396ba4(++_0xa71130);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x362b47,_0x297c08){var _0x12bb2f=function(_0x426e11){while(--_0x426e11){_0x362b47['push'](_0x362b47['shift']());}};_0x12bb2f(++_0x297c08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 150ef13..f9c32ec 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 _0xbf6b=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x72342a,_0x2d82fc){var _0x1da5bb=function(_0x44241f){while(--_0x44241f){_0x72342a['push'](_0x72342a['shift']());}};_0x1da5bb(++_0x2d82fc);}(_0xbf6b,0x185));var _0xbbf6=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xbf6b[_0x2d2c16];return _0x53f2fb;};'use strict';var VoiceQueueEvents=require(_0xbbf6('0x0'));var events=[_0xbbf6('0x1'),_0xbbf6('0x2'),'update'];function createListener(_0x1188f5,_0x39d72d){return function(_0x4f4e2c){_0x39d72d[_0xbbf6('0x3')](_0x1188f5,_0x4f4e2c);};}function removeListener(_0x5b6a79,_0x37b6aa){return function(){VoiceQueueEvents[_0xbbf6('0x4')](_0x5b6a79,_0x37b6aa);};}exports[_0xbbf6('0x5')]=function(_0x5a8f26){for(var _0xcb9641=0x0,_0x10badc=events[_0xbbf6('0x6')];_0xcb9641<_0x10badc;_0xcb9641++){var _0x42ccd2=events[_0xcb9641];var _0x159c1e=createListener(_0xbbf6('0x7')+_0x42ccd2,_0x5a8f26);VoiceQueueEvents['on'](_0x42ccd2,_0x159c1e);}}; \ No newline at end of file +var _0xc04b=['save','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x167936,_0x2bfe83){var _0x570166=function(_0x24ef41){while(--_0x24ef41){_0x167936['push'](_0x167936['shift']());}};_0x570166(++_0x2bfe83);}(_0xc04b,0xa8));var _0xbc04=function(_0x547645,_0x41245b){_0x547645=_0x547645-0x0;var _0x1c0a13=_0xc04b[_0x547645];return _0x1c0a13;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xbc04('0x0'),_0xbc04('0x1'),'update'];function createListener(_0x12fcb6,_0x3425ed){return function(_0x56d9db){_0x3425ed[_0xbc04('0x2')](_0x12fcb6,_0x56d9db);};}function removeListener(_0x2dff5c,_0xbb2724){return function(){VoiceQueueEvents[_0xbc04('0x3')](_0x2dff5c,_0xbb2724);};}exports[_0xbc04('0x4')]=function(_0x11ee96){for(var _0x4ca5f6=0x0,_0x3ed0c7=events[_0xbc04('0x5')];_0x4ca5f6<_0x3ed0c7;_0x4ca5f6++){var _0x3eb2b5=events[_0x4ca5f6];var _0x2c1f0f=createListener(_0xbc04('0x6')+_0x3eb2b5,_0x11ee96);VoiceQueueEvents['on'](_0x3eb2b5,_0x2c1f0f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index a6b69d4..8fedea5 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 _0x33ca=['delete','destroy','exports','multer','util','path','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','/:id','show','create','put','update'];(function(_0x2f8b79,_0x18e8ec){var _0x522af5=function(_0x30b6d7){while(--_0x30b6d7){_0x2f8b79['push'](_0x2f8b79['shift']());}};_0x522af5(++_0x18e8ec);}(_0x33ca,0x75));var _0xa33c=function(_0x509af5,_0x4a21a1){_0x509af5=_0x509af5-0x0;var _0x14a141=_0x33ca[_0x509af5];return _0x14a141;};'use strict';var multer=require(_0xa33c('0x0'));var util=require(_0xa33c('0x1'));var path=require(_0xa33c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa33c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa33c('0x4'));var controller=require(_0xa33c('0x5'));router[_0xa33c('0x6')]('/',auth[_0xa33c('0x7')](),controller[_0xa33c('0x8')]);router[_0xa33c('0x6')](_0xa33c('0x9'),auth[_0xa33c('0x7')](),controller['describe']);router[_0xa33c('0x6')]('/index',auth[_0xa33c('0x7')](),controller[_0xa33c('0xa')]);router[_0xa33c('0x6')](_0xa33c('0xb'),auth['isAuthenticated'](),controller[_0xa33c('0xc')]);router['post']('/',auth[_0xa33c('0x7')](),controller[_0xa33c('0xd')]);router[_0xa33c('0xe')](_0xa33c('0xb'),auth[_0xa33c('0x7')](),controller[_0xa33c('0xf')]);router[_0xa33c('0x10')](_0xa33c('0xb'),auth[_0xa33c('0x7')](),controller[_0xa33c('0x11')]);module[_0xa33c('0x12')]=router; \ No newline at end of file +var _0xaff3=['index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x253b65,_0xff90dc){var _0x50f104=function(_0x2da025){while(--_0x2da025){_0x253b65['push'](_0x253b65['shift']());}};_0x50f104(++_0xff90dc);}(_0xaff3,0xff));var _0x3aff=function(_0x3c6801,_0x3ab931){_0x3c6801=_0x3c6801-0x0;var _0x1dd046=_0xaff3[_0x3c6801];return _0x1dd046;};'use strict';var multer=require(_0x3aff('0x0'));var util=require(_0x3aff('0x1'));var path=require(_0x3aff('0x2'));var timeout=require(_0x3aff('0x3'));var express=require(_0x3aff('0x4'));var router=express[_0x3aff('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3aff('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x3aff('0x7')]('/',auth[_0x3aff('0x8')](),controller[_0x3aff('0x9')]);router[_0x3aff('0x7')](_0x3aff('0xa'),auth[_0x3aff('0x8')](),controller[_0x3aff('0xb')]);router[_0x3aff('0x7')](_0x3aff('0xc'),auth['isAuthenticated'](),controller[_0x3aff('0xd')]);router['get'](_0x3aff('0xe'),auth['isAuthenticated'](),controller[_0x3aff('0xf')]);router[_0x3aff('0x10')]('/',auth[_0x3aff('0x8')](),controller[_0x3aff('0x11')]);router[_0x3aff('0x12')]('/:id',auth[_0x3aff('0x8')](),controller[_0x3aff('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3aff('0x14')]);module[_0x3aff('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 0bde19e..9907e52 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 _0x6598=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue'];(function(_0x3c4b1a,_0x14a83e){var _0x19ad0c=function(_0x25e6fb){while(--_0x25e6fb){_0x3c4b1a['push'](_0x3c4b1a['shift']());}};_0x19ad0c(++_0x14a83e);}(_0x6598,0x18c));var _0x8659=function(_0x52be73,_0x1b4cbd){_0x52be73=_0x52be73-0x0;var _0x26f66a=_0x6598[_0x52be73];return _0x26f66a;};'use strict';var Sequelize=require(_0x8659('0x0'));var moment=require(_0x8659('0x1'));module[_0x8659('0x2')]={'type':{'type':Sequelize[_0x8659('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8659('0x3')]},'calleridname':{'type':Sequelize[_0x8659('0x3')]},'queue':{'type':Sequelize[_0x8659('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x8659('0x4')],'set':function(_0x187cc4){var _0x1aa957=moment(_0x187cc4);var _0x1734f9=moment(this[_0x8659('0x5')]('queuecallerjoinAt'))['format'](_0x8659('0x6'));var _0x1b41c8=_0x1aa957['diff'](_0x1734f9,_0x8659('0x7'));this[_0x8659('0x8')](_0x8659('0x9'),_0x187cc4);this[_0x8659('0x8')](_0x8659('0xa'),_0x1b41c8||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8659('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x8659('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8659('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8659('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8659('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8659('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x8659('0x3')],'comment':_0x8659('0xd')},'originalposition':{'type':Sequelize[_0x8659('0xb')]},'channel':{'type':Sequelize[_0x8659('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8659('0x3')]},'connectedlinename':{'type':Sequelize[_0x8659('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8659('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8659('0x3')]},'holdtime':{'type':Sequelize[_0x8659('0xb')]},'mohtime':{'type':Sequelize[_0x8659('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8659('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8659('0x3')],'comment':_0x8659('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x8659('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xda87=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER'];(function(_0x93d86c,_0x54e7ee){var _0x58e497=function(_0x31ad13){while(--_0x31ad13){_0x93d86c['push'](_0x93d86c['shift']());}};_0x58e497(++_0x54e7ee);}(_0xda87,0x1bb));var _0x7da8=function(_0x2496da,_0x3fe1fc){_0x2496da=_0x2496da-0x0;var _0x4caae0=_0xda87[_0x2496da];return _0x4caae0;};'use strict';var Sequelize=require(_0x7da8('0x0'));var moment=require(_0x7da8('0x1'));module[_0x7da8('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7da8('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7da8('0x3')]},'queue':{'type':Sequelize[_0x7da8('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x7da8('0x4')],'set':function(_0x1d13d7){var _0x5646f2=moment(_0x1d13d7);var _0x3b3f2a=moment(this[_0x7da8('0x5')](_0x7da8('0x6')))[_0x7da8('0x7')](_0x7da8('0x8'));var _0x2459ca=_0x5646f2[_0x7da8('0x9')](_0x3b3f2a,_0x7da8('0xa'));this[_0x7da8('0xb')](_0x7da8('0xc'),_0x1d13d7);this[_0x7da8('0xb')]('holdtime',_0x2459ca||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x7da8('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7da8('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x7da8('0x3')],'comment':_0x7da8('0xe')},'originalposition':{'type':Sequelize[_0x7da8('0xf')]},'channel':{'type':Sequelize[_0x7da8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x7da8('0x3')]},'connectedlinename':{'type':Sequelize[_0x7da8('0x3')]},'accountcode':{'type':Sequelize[_0x7da8('0x3')]},'context':{'type':Sequelize[_0x7da8('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7da8('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7da8('0xf')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7da8('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7da8('0x3')],'comment':_0x7da8('0x10')},'transferexten':{'type':Sequelize[_0x7da8('0x3')]},'transferuniqueid':{'type':Sequelize[_0x7da8('0x3')]},'disposition':{'type':Sequelize[_0x7da8('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7da8('0xf')],'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 abbb48f..200b404 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 _0x5451=['reject','save','update','then','destroy','error','name','send','index','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','rows','show','params','fields','includeAll','include','find','create','catch','body','describe','getVoiceQueuesReport','order','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','count','offset','set','Content-Range','apply'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5451,0x169));var _0x1545=function(_0x136014,_0x7ee981){_0x136014=_0x136014-0x0;var _0x2b2680=_0x5451[_0x136014];return _0x2b2680;};'use strict';var pdf=require(_0x1545('0x0'));var emlformat=require(_0x1545('0x1'));var rimraf=require(_0x1545('0x2'));var zipdir=require(_0x1545('0x3'));var jsonpatch=require(_0x1545('0x4'));var rp=require(_0x1545('0x5'));var moment=require(_0x1545('0x6'));var BPromise=require(_0x1545('0x7'));var Mustache=require(_0x1545('0x8'));var util=require(_0x1545('0x9'));var path=require('path');var sox=require(_0x1545('0xa'));var csv=require('to-csv');var ejs=require(_0x1545('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1545('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1545('0xd'));var toCsv=require(_0x1545('0xe'));var querystring=require(_0x1545('0xf'));var Papa=require(_0x1545('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1545('0x11'));var qs=require(_0x1545('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1545('0x13'));var config=require(_0x1545('0x14'));var db=require(_0x1545('0x15'))['db'];config[_0x1545('0x16')]=_['defaults'](config[_0x1545('0x16')],{'host':_0x1545('0x17'),'port':0x18eb});var socket=require(_0x1545('0x18'))(new Redis(config[_0x1545('0x16')]));require(_0x1545('0x19'))['register'](socket);function respondWithStatusCode(_0x104d5e,_0x1809fa){_0x1809fa=_0x1809fa||0xcc;return function(_0x15fe44){if(_0x15fe44){return _0x104d5e[_0x1545('0x1a')](_0x1809fa);}return _0x104d5e[_0x1545('0x1b')](_0x1809fa)[_0x1545('0x1c')]();};}function respondWithResult(_0x3930c6,_0x4a54fe){_0x4a54fe=_0x4a54fe||0xc8;return function(_0x46851c){if(_0x46851c){return _0x3930c6[_0x1545('0x1b')](_0x4a54fe)['json'](_0x46851c);}};}function respondWithFilteredResult(_0x21120d,_0x9f3236){return function(_0x38352a){if(_0x38352a){var _0x3f2617=_0x38352a[_0x1545('0x1d')],_0x2b8578=_0x9f3236[_0x1545('0x1e')],_0x21b17d=_0x9f3236[_0x1545('0x1e')]+_0x9f3236['limit'],_0x59805f;if(_0x21b17d>=_0x3f2617){_0x21b17d=_0x3f2617;_0x59805f=0xc8;}else{_0x59805f=0xce;}_0x21120d[_0x1545('0x1b')](_0x59805f);return _0x21120d[_0x1545('0x1f')](_0x1545('0x20'),_0x2b8578+'-'+_0x21b17d+'/'+_0x3f2617)['json'](_0x38352a);}return null;};}function patchUpdates(_0x317aaa){return function(_0x5c449e){try{jsonpatch[_0x1545('0x21')](_0x5c449e,_0x317aaa,!![]);}catch(_0x21e707){return BPromise[_0x1545('0x22')](_0x21e707);}return _0x5c449e[_0x1545('0x23')]();};}function saveUpdates(_0x4c0b09,_0x4e47ef){return function(_0x51fbed){if(_0x51fbed){return _0x51fbed[_0x1545('0x24')](_0x4c0b09)[_0x1545('0x25')](function(_0x4057ea){return _0x4057ea;});}return null;};}function removeEntity(_0x401402,_0x15b5e2){return function(_0x339998){if(_0x339998){return _0x339998[_0x1545('0x26')]()[_0x1545('0x25')](function(){_0x401402[_0x1545('0x1b')](0xcc)[_0x1545('0x1c')]();});}};}function handleEntityNotFound(_0x5a2fbe,_0x1b9e6){return function(_0xfe1bff){if(!_0xfe1bff){_0x5a2fbe[_0x1545('0x1a')](0x194);}return _0xfe1bff;};}function handleError(_0x1cdd59,_0x5c9479){_0x5c9479=_0x5c9479||0x1f4;return function(_0x1a4b3a){logger[_0x1545('0x27')](_0x1a4b3a['stack']);if(_0x1a4b3a[_0x1545('0x28')]){delete _0x1a4b3a['name'];}_0x1cdd59[_0x1545('0x1b')](_0x5c9479)[_0x1545('0x29')](_0x1a4b3a);};}exports[_0x1545('0x2a')]=function(_0x8b0b57,_0x49ead8){var _0x245d9b={},_0x57f52e={},_0x249e3a={'count':0x0,'rows':[]};var _0x2ed796=db[_0x1545('0x2b')][_0x1545('0x2c')];_0x57f52e[_0x1545('0x2d')]=_[_0x1545('0x2e')](_0x2ed796);_0x57f52e['query']=_[_0x1545('0x2e')](_0x8b0b57[_0x1545('0x2f')]);_0x57f52e[_0x1545('0x30')]=_[_0x1545('0x31')](_0x57f52e[_0x1545('0x2d')],_0x57f52e['query']);_0x245d9b['attributes']=_['intersection'](_0x57f52e[_0x1545('0x2d')],qs['fields'](_0x8b0b57[_0x1545('0x2f')]['fields']));_0x245d9b[_0x1545('0x32')]=_0x245d9b[_0x1545('0x32')][_0x1545('0x33')]?_0x245d9b[_0x1545('0x32')]:_0x57f52e[_0x1545('0x2d')];if(!_0x8b0b57[_0x1545('0x2f')][_0x1545('0x34')](_0x1545('0x35'))){_0x245d9b[_0x1545('0x36')]=qs[_0x1545('0x36')](_0x8b0b57['query'][_0x1545('0x36')]);_0x245d9b[_0x1545('0x1e')]=qs[_0x1545('0x1e')](_0x8b0b57[_0x1545('0x2f')][_0x1545('0x1e')]);}_0x245d9b['order']=qs[_0x1545('0x37')](_0x8b0b57['query']['sort']);_0x245d9b[_0x1545('0x38')]=qs['filters'](_[_0x1545('0x39')](_0x8b0b57[_0x1545('0x2f')],_0x57f52e['filters']));if(_0x8b0b57['query'][_0x1545('0x3a')]){_0x245d9b[_0x1545('0x38')]=_[_0x1545('0x3b')](_0x245d9b[_0x1545('0x38')],{'$or':_['map'](_0x2ed796,function(_0x228b7a){if(_0x228b7a[_0x1545('0x3c')][_0x1545('0x3d')]!==_0x1545('0x3e')){var _0x56cbf3={};_0x56cbf3[_0x228b7a[_0x1545('0x3f')]]={'$like':'%'+_0x8b0b57['query'][_0x1545('0x3a')]+'%'};return _0x56cbf3;}})});}_0x245d9b=_[_0x1545('0x3b')]({},_0x245d9b,_0x8b0b57[_0x1545('0x40')]);var _0x444825={'where':_0x245d9b[_0x1545('0x38')]};return db[_0x1545('0x2b')][_0x1545('0x1d')](_0x444825)[_0x1545('0x25')](function(_0x1fe9b3){_0x249e3a[_0x1545('0x1d')]=_0x1fe9b3;if(_0x8b0b57['query']['includeAll']){_0x245d9b['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x245d9b);})['then'](function(_0xe64f28){_0x249e3a[_0x1545('0x41')]=_0xe64f28;return _0x249e3a;})[_0x1545('0x25')](respondWithFilteredResult(_0x49ead8,_0x245d9b))['catch'](handleError(_0x49ead8,null));};exports[_0x1545('0x42')]=function(_0x1b66c3,_0x50bfb4){var _0x14a951={'raw':![],'where':{'id':_0x1b66c3[_0x1545('0x43')]['id']}},_0x392db6={};_0x392db6[_0x1545('0x2d')]=_[_0x1545('0x2e')](db[_0x1545('0x2b')][_0x1545('0x2c')]);_0x392db6[_0x1545('0x2f')]=_['keys'](_0x1b66c3[_0x1545('0x2f')]);_0x392db6['filters']=_[_0x1545('0x31')](_0x392db6[_0x1545('0x2d')],_0x392db6[_0x1545('0x2f')]);_0x14a951[_0x1545('0x32')]=_[_0x1545('0x31')](_0x392db6[_0x1545('0x2d')],qs['fields'](_0x1b66c3[_0x1545('0x2f')][_0x1545('0x44')]));_0x14a951[_0x1545('0x32')]=_0x14a951[_0x1545('0x32')][_0x1545('0x33')]?_0x14a951[_0x1545('0x32')]:_0x392db6[_0x1545('0x2d')];if(_0x1b66c3[_0x1545('0x2f')][_0x1545('0x45')]){_0x14a951[_0x1545('0x46')]=[{'all':!![]}];}_0x14a951=_[_0x1545('0x3b')]({},_0x14a951,_0x1b66c3['options']);return db[_0x1545('0x2b')][_0x1545('0x47')](_0x14a951)[_0x1545('0x25')](handleEntityNotFound(_0x50bfb4,null))[_0x1545('0x25')](respondWithResult(_0x50bfb4,null))['catch'](handleError(_0x50bfb4,null));};exports[_0x1545('0x48')]=function(_0x34d02e,_0x206bca){return db['VoiceQueueReport'][_0x1545('0x48')](_0x34d02e['body'],{})[_0x1545('0x25')](respondWithResult(_0x206bca,0xc9))[_0x1545('0x49')](handleError(_0x206bca,null));};exports[_0x1545('0x24')]=function(_0x301a1f,_0x3e03a1){if(_0x301a1f['body']['id']){delete _0x301a1f[_0x1545('0x4a')]['id'];}return db[_0x1545('0x2b')][_0x1545('0x47')]({'where':{'id':_0x301a1f[_0x1545('0x43')]['id']}})[_0x1545('0x25')](handleEntityNotFound(_0x3e03a1,null))[_0x1545('0x25')](saveUpdates(_0x301a1f[_0x1545('0x4a')],null))['then'](respondWithResult(_0x3e03a1,null))[_0x1545('0x49')](handleError(_0x3e03a1,null));};exports[_0x1545('0x26')]=function(_0x41d34c,_0x5bfa7e){return db['VoiceQueueReport']['find']({'where':{'id':_0x41d34c[_0x1545('0x43')]['id']}})[_0x1545('0x25')](handleEntityNotFound(_0x5bfa7e,null))[_0x1545('0x25')](removeEntity(_0x5bfa7e,null))[_0x1545('0x49')](handleError(_0x5bfa7e,null));};exports['describe']=function(_0x51145e,_0x58944e){return db['VoiceQueueReport'][_0x1545('0x4b')]()[_0x1545('0x25')](respondWithResult(_0x58944e,null))['catch'](handleError(_0x58944e,null));};exports[_0x1545('0x4c')]=function(_0x2c46e3,_0x172d62){var _0x55a36a={},_0x4bfefe={},_0x4dbeb3={'count':0x0,'rows':[]};_0x4bfefe['model']=_[_0x1545('0x2e')](db[_0x1545('0x2b')][_0x1545('0x2c')]);_0x4bfefe['query']=_[_0x1545('0x2e')](_0x2c46e3[_0x1545('0x2f')]);_0x4bfefe[_0x1545('0x30')]=_[_0x1545('0x31')](_0x4bfefe[_0x1545('0x2d')],_0x4bfefe[_0x1545('0x2f')]);_0x55a36a[_0x1545('0x32')]=_['intersection'](_0x4bfefe[_0x1545('0x2d')],qs[_0x1545('0x44')](_0x2c46e3[_0x1545('0x2f')][_0x1545('0x44')]));_0x55a36a[_0x1545('0x32')]=_0x55a36a['attributes']['length']?_0x55a36a[_0x1545('0x32')]:_0x4bfefe[_0x1545('0x2d')];if(!_0x2c46e3['query'][_0x1545('0x34')](_0x1545('0x35'))){_0x55a36a[_0x1545('0x36')]=qs['limit'](_0x2c46e3[_0x1545('0x2f')]['limit']);_0x55a36a[_0x1545('0x1e')]=qs[_0x1545('0x1e')](_0x2c46e3[_0x1545('0x2f')][_0x1545('0x1e')]);}_0x55a36a[_0x1545('0x4d')]=qs[_0x1545('0x37')](_0x2c46e3[_0x1545('0x2f')]['sort']);_0x55a36a['where']=qs[_0x1545('0x30')](_[_0x1545('0x39')](_0x2c46e3[_0x1545('0x2f')],_0x4bfefe[_0x1545('0x30')]));if(_0x2c46e3[_0x1545('0x2f')][_0x1545('0x3a')]){_0x55a36a[_0x1545('0x38')]=_[_0x1545('0x3b')](_0x55a36a[_0x1545('0x38')],{'$or':_['map'](_0x55a36a[_0x1545('0x32')],function(_0x250ef0){var _0x1207fc={};_0x1207fc[_0x250ef0]={'$like':'%'+_0x2c46e3[_0x1545('0x2f')]['filter']+'%'};return _0x1207fc;})});}_0x55a36a=_[_0x1545('0x3b')]({},_0x55a36a,_0x2c46e3['options']);var _0x2084b6={'where':_0x55a36a[_0x1545('0x38')]};return db['VoiceQueueReport'][_0x1545('0x1d')](_0x2084b6)[_0x1545('0x25')](function(_0x1766c5){_0x4dbeb3[_0x1545('0x1d')]=_0x1766c5;if(_0x2c46e3[_0x1545('0x2f')][_0x1545('0x45')]){_0x55a36a['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1545('0x4e')](_0x55a36a);})[_0x1545('0x25')](function(_0x3ac18f){_0x4dbeb3[_0x1545('0x41')]=_0x3ac18f;return _0x4dbeb3;})[_0x1545('0x25')](respondWithFilteredResult(_0x172d62,_0x55a36a,_0x1545('0x4c')))[_0x1545('0x49')](handleError(_0x172d62,null,_0x1545('0x4c')));}; \ No newline at end of file +var _0x8dae=['VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getVoiceQueuesReport','hasOwnProperty','rimraf','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x4d125b,_0x5ddf36){var _0x1fef6c=function(_0x1a58c1){while(--_0x1a58c1){_0x4d125b['push'](_0x4d125b['shift']());}};_0x1fef6c(++_0x5ddf36);}(_0x8dae,0x153));var _0xe8da=function(_0x5116e6,_0x44b075){_0x5116e6=_0x5116e6-0x0;var _0x319f34=_0x8dae[_0x5116e6];return _0x319f34;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe8da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe8da('0x1'));var BPromise=require(_0xe8da('0x2'));var Mustache=require(_0xe8da('0x3'));var util=require(_0xe8da('0x4'));var path=require(_0xe8da('0x5'));var sox=require('sox');var csv=require(_0xe8da('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe8da('0x7'));var crypto=require(_0xe8da('0x8'));var jsforce=require(_0xe8da('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8da('0xa'));var Papa=require(_0xe8da('0xb'));var authService=require(_0xe8da('0xc'));var hardwareService=require(_0xe8da('0xd'));var Redis=require('ioredis');var qs=require(_0xe8da('0xe'));var logger=require(_0xe8da('0xf'))('api');var utils=require(_0xe8da('0x10'));var config=require(_0xe8da('0x11'));var db=require(_0xe8da('0x12'))['db'];config[_0xe8da('0x13')]=_[_0xe8da('0x14')](config[_0xe8da('0x13')],{'host':_0xe8da('0x15'),'port':0x18eb});var socket=require(_0xe8da('0x16'))(new Redis(config['redis']));require(_0xe8da('0x17'))[_0xe8da('0x18')](socket);function respondWithStatusCode(_0x3ee694,_0x6a9549){_0x6a9549=_0x6a9549||0xcc;return function(_0x2c2062){if(_0x2c2062){return _0x3ee694[_0xe8da('0x19')](_0x6a9549);}return _0x3ee694[_0xe8da('0x1a')](_0x6a9549)[_0xe8da('0x1b')]();};}function respondWithResult(_0x410547,_0x18c4c5){_0x18c4c5=_0x18c4c5||0xc8;return function(_0x1ce14c){if(_0x1ce14c){return _0x410547[_0xe8da('0x1a')](_0x18c4c5)['json'](_0x1ce14c);}};}function respondWithFilteredResult(_0x23e295,_0x45b76b){return function(_0xe740eb){if(_0xe740eb){var _0x57a265=_0xe740eb[_0xe8da('0x1c')],_0x5a62f7=_0x45b76b['offset'],_0x311711=_0x45b76b[_0xe8da('0x1d')]+_0x45b76b[_0xe8da('0x1e')],_0x47e188;if(_0x311711>=_0x57a265){_0x311711=_0x57a265;_0x47e188=0xc8;}else{_0x47e188=0xce;}_0x23e295[_0xe8da('0x1a')](_0x47e188);return _0x23e295[_0xe8da('0x1f')](_0xe8da('0x20'),_0x5a62f7+'-'+_0x311711+'/'+_0x57a265)['json'](_0xe740eb);}return null;};}function patchUpdates(_0x2dd1c8){return function(_0x1039b2){try{jsonpatch['apply'](_0x1039b2,_0x2dd1c8,!![]);}catch(_0x531520){return BPromise[_0xe8da('0x21')](_0x531520);}return _0x1039b2[_0xe8da('0x22')]();};}function saveUpdates(_0x50b6c7,_0x391b5c){return function(_0x2fffd0){if(_0x2fffd0){return _0x2fffd0[_0xe8da('0x23')](_0x50b6c7)[_0xe8da('0x24')](function(_0xbf8288){return _0xbf8288;});}return null;};}function removeEntity(_0x34e195,_0x1baa29){return function(_0x41bebf){if(_0x41bebf){return _0x41bebf[_0xe8da('0x25')]()[_0xe8da('0x24')](function(){_0x34e195[_0xe8da('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eb627,_0x869e47){return function(_0xa2b6c7){if(!_0xa2b6c7){_0x5eb627[_0xe8da('0x19')](0x194);}return _0xa2b6c7;};}function handleError(_0x166311,_0x43e0b2){_0x43e0b2=_0x43e0b2||0x1f4;return function(_0x58cc90){logger[_0xe8da('0x26')](_0x58cc90[_0xe8da('0x27')]);if(_0x58cc90['name']){delete _0x58cc90[_0xe8da('0x28')];}_0x166311[_0xe8da('0x1a')](_0x43e0b2)['send'](_0x58cc90);};}exports['index']=function(_0x16ec61,_0x15143a){var _0x21ac03={},_0x23948a={},_0x2afac6={'count':0x0,'rows':[]};var _0x13556e=db[_0xe8da('0x29')][_0xe8da('0x2a')];_0x23948a[_0xe8da('0x2b')]=_['keys'](_0x13556e);_0x23948a['query']=_[_0xe8da('0x2c')](_0x16ec61[_0xe8da('0x2d')]);_0x23948a[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x23948a['model'],_0x23948a[_0xe8da('0x2d')]);_0x21ac03[_0xe8da('0x30')]=_[_0xe8da('0x2f')](_0x23948a[_0xe8da('0x2b')],qs[_0xe8da('0x31')](_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x31')]));_0x21ac03['attributes']=_0x21ac03[_0xe8da('0x30')][_0xe8da('0x32')]?_0x21ac03[_0xe8da('0x30')]:_0x23948a['model'];if(!_0x16ec61[_0xe8da('0x2d')]['hasOwnProperty'](_0xe8da('0x33'))){_0x21ac03[_0xe8da('0x1e')]=qs[_0xe8da('0x1e')](_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x1e')]);_0x21ac03[_0xe8da('0x1d')]=qs[_0xe8da('0x1d')](_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x1d')]);}_0x21ac03[_0xe8da('0x34')]=qs[_0xe8da('0x35')](_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x35')]);_0x21ac03[_0xe8da('0x36')]=qs[_0xe8da('0x2e')](_[_0xe8da('0x37')](_0x16ec61[_0xe8da('0x2d')],_0x23948a[_0xe8da('0x2e')]));if(_0x16ec61['query'][_0xe8da('0x38')]){_0x21ac03[_0xe8da('0x36')]=_[_0xe8da('0x39')](_0x21ac03[_0xe8da('0x36')],{'$or':_[_0xe8da('0x3a')](_0x13556e,function(_0x43e415){if(_0x43e415[_0xe8da('0x3b')][_0xe8da('0x3c')]!==_0xe8da('0x3d')){var _0x4dc4b9={};_0x4dc4b9[_0x43e415['field']]={'$like':'%'+_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x38')]+'%'};return _0x4dc4b9;}})});}_0x21ac03=_['merge']({},_0x21ac03,_0x16ec61[_0xe8da('0x3e')]);var _0x544c87={'where':_0x21ac03[_0xe8da('0x36')]};return db[_0xe8da('0x29')][_0xe8da('0x1c')](_0x544c87)['then'](function(_0x6e82a5){_0x2afac6[_0xe8da('0x1c')]=_0x6e82a5;if(_0x16ec61[_0xe8da('0x2d')][_0xe8da('0x3f')]){_0x21ac03[_0xe8da('0x40')]=[{'all':!![]}];}return db[_0xe8da('0x29')][_0xe8da('0x41')](_0x21ac03);})[_0xe8da('0x24')](function(_0x18708b){_0x2afac6[_0xe8da('0x42')]=_0x18708b;return _0x2afac6;})[_0xe8da('0x24')](respondWithFilteredResult(_0x15143a,_0x21ac03))[_0xe8da('0x43')](handleError(_0x15143a,null));};exports[_0xe8da('0x44')]=function(_0x56b92f,_0x3f70d8){var _0x5e5247={'raw':![],'where':{'id':_0x56b92f['params']['id']}},_0x5aa727={};_0x5aa727[_0xe8da('0x2b')]=_[_0xe8da('0x2c')](db[_0xe8da('0x29')][_0xe8da('0x2a')]);_0x5aa727[_0xe8da('0x2d')]=_[_0xe8da('0x2c')](_0x56b92f['query']);_0x5aa727[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x5aa727['model'],_0x5aa727[_0xe8da('0x2d')]);_0x5e5247['attributes']=_[_0xe8da('0x2f')](_0x5aa727[_0xe8da('0x2b')],qs[_0xe8da('0x31')](_0x56b92f[_0xe8da('0x2d')][_0xe8da('0x31')]));_0x5e5247[_0xe8da('0x30')]=_0x5e5247['attributes'][_0xe8da('0x32')]?_0x5e5247[_0xe8da('0x30')]:_0x5aa727[_0xe8da('0x2b')];if(_0x56b92f[_0xe8da('0x2d')][_0xe8da('0x3f')]){_0x5e5247[_0xe8da('0x40')]=[{'all':!![]}];}_0x5e5247=_[_0xe8da('0x39')]({},_0x5e5247,_0x56b92f[_0xe8da('0x3e')]);return db[_0xe8da('0x29')][_0xe8da('0x45')](_0x5e5247)[_0xe8da('0x24')](handleEntityNotFound(_0x3f70d8,null))[_0xe8da('0x24')](respondWithResult(_0x3f70d8,null))[_0xe8da('0x43')](handleError(_0x3f70d8,null));};exports[_0xe8da('0x46')]=function(_0x9fcc82,_0x23544d){return db['VoiceQueueReport'][_0xe8da('0x46')](_0x9fcc82[_0xe8da('0x47')],{})[_0xe8da('0x24')](respondWithResult(_0x23544d,0xc9))[_0xe8da('0x43')](handleError(_0x23544d,null));};exports[_0xe8da('0x23')]=function(_0x1ba24a,_0x4035cc){if(_0x1ba24a[_0xe8da('0x47')]['id']){delete _0x1ba24a[_0xe8da('0x47')]['id'];}return db[_0xe8da('0x29')]['find']({'where':{'id':_0x1ba24a[_0xe8da('0x48')]['id']}})[_0xe8da('0x24')](handleEntityNotFound(_0x4035cc,null))[_0xe8da('0x24')](saveUpdates(_0x1ba24a[_0xe8da('0x47')],null))[_0xe8da('0x24')](respondWithResult(_0x4035cc,null))['catch'](handleError(_0x4035cc,null));};exports[_0xe8da('0x25')]=function(_0x2d056b,_0x400d63){return db['VoiceQueueReport']['find']({'where':{'id':_0x2d056b[_0xe8da('0x48')]['id']}})[_0xe8da('0x24')](handleEntityNotFound(_0x400d63,null))[_0xe8da('0x24')](removeEntity(_0x400d63,null))[_0xe8da('0x43')](handleError(_0x400d63,null));};exports['describe']=function(_0x5a26a5,_0x26184f){return db[_0xe8da('0x29')][_0xe8da('0x49')]()['then'](respondWithResult(_0x26184f,null))['catch'](handleError(_0x26184f,null));};exports[_0xe8da('0x4a')]=function(_0x3f6f19,_0x2324a8){var _0x517c9c={},_0x2b45a5={},_0x5b0c1f={'count':0x0,'rows':[]};_0x2b45a5[_0xe8da('0x2b')]=_[_0xe8da('0x2c')](db[_0xe8da('0x29')]['rawAttributes']);_0x2b45a5[_0xe8da('0x2d')]=_['keys'](_0x3f6f19['query']);_0x2b45a5[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x2b45a5[_0xe8da('0x2b')],_0x2b45a5['query']);_0x517c9c['attributes']=_[_0xe8da('0x2f')](_0x2b45a5[_0xe8da('0x2b')],qs[_0xe8da('0x31')](_0x3f6f19[_0xe8da('0x2d')]['fields']));_0x517c9c['attributes']=_0x517c9c[_0xe8da('0x30')][_0xe8da('0x32')]?_0x517c9c[_0xe8da('0x30')]:_0x2b45a5[_0xe8da('0x2b')];if(!_0x3f6f19[_0xe8da('0x2d')][_0xe8da('0x4b')](_0xe8da('0x33'))){_0x517c9c[_0xe8da('0x1e')]=qs[_0xe8da('0x1e')](_0x3f6f19[_0xe8da('0x2d')]['limit']);_0x517c9c[_0xe8da('0x1d')]=qs[_0xe8da('0x1d')](_0x3f6f19[_0xe8da('0x2d')][_0xe8da('0x1d')]);}_0x517c9c[_0xe8da('0x34')]=qs[_0xe8da('0x35')](_0x3f6f19[_0xe8da('0x2d')][_0xe8da('0x35')]);_0x517c9c[_0xe8da('0x36')]=qs[_0xe8da('0x2e')](_['pick'](_0x3f6f19['query'],_0x2b45a5[_0xe8da('0x2e')]));if(_0x3f6f19[_0xe8da('0x2d')][_0xe8da('0x38')]){_0x517c9c['where']=_[_0xe8da('0x39')](_0x517c9c[_0xe8da('0x36')],{'$or':_[_0xe8da('0x3a')](_0x517c9c['attributes'],function(_0x38e9be){var _0x18e4f={};_0x18e4f[_0x38e9be]={'$like':'%'+_0x3f6f19[_0xe8da('0x2d')][_0xe8da('0x38')]+'%'};return _0x18e4f;})});}_0x517c9c=_[_0xe8da('0x39')]({},_0x517c9c,_0x3f6f19[_0xe8da('0x3e')]);var _0x2c985a={'where':_0x517c9c[_0xe8da('0x36')]};return db[_0xe8da('0x29')][_0xe8da('0x1c')](_0x2c985a)['then'](function(_0x552858){_0x5b0c1f[_0xe8da('0x1c')]=_0x552858;if(_0x3f6f19[_0xe8da('0x2d')]['includeAll']){_0x517c9c[_0xe8da('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe8da('0x41')](_0x517c9c);})[_0xe8da('0x24')](function(_0x4e4a96){_0x5b0c1f[_0xe8da('0x42')]=_0x4e4a96;return _0x5b0c1f;})[_0xe8da('0x24')](respondWithFilteredResult(_0x2324a8,_0x517c9c,_0xe8da('0x4a')))[_0xe8da('0x43')](handleError(_0x2324a8,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1c79b74..0eea0bd 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 _0x8be3=['hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','emit'];(function(_0x5c7731,_0x4e355f){var _0x491a08=function(_0x3a90df){while(--_0x3a90df){_0x5c7731['push'](_0x5c7731['shift']());}};_0x491a08(++_0x4e355f);}(_0x8be3,0x1e5));var _0x38be=function(_0x2f8fe8,_0x45e040){_0x2f8fe8=_0x2f8fe8-0x0;var _0x572e2e=_0x8be3[_0x2f8fe8];return _0x572e2e;};'use strict';var EventEmitter=require(_0x38be('0x0'));var VoiceQueueReport=require(_0x38be('0x1'))['db'][_0x38be('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x38be('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x437738){return function(_0x8e2939,_0x35484b,_0x2aa219){VoiceQueueReportEvents[_0x38be('0x4')](_0x437738+':'+_0x8e2939['id'],_0x8e2939);VoiceQueueReportEvents['emit'](_0x437738,_0x8e2939);_0x2aa219(null);};}for(var e in events){if(events[_0x38be('0x5')](e)){var event=events[e];VoiceQueueReport[_0x38be('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x499f=['../../mysqldb','setMaxListeners','save','update','emit','exports','events'];(function(_0x10677c,_0x57bd1d){var _0x3e6748=function(_0xb4a6e5){while(--_0xb4a6e5){_0x10677c['push'](_0x10677c['shift']());}};_0x3e6748(++_0x57bd1d);}(_0x499f,0x102));var _0xf499=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x499f[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0xf499('0x0'));var VoiceQueueReport=require(_0xf499('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf499('0x2')](0x0);var events={'afterCreate':_0xf499('0x3'),'afterUpdate':_0xf499('0x4'),'afterDestroy':'remove'};function emitEvent(_0x28bd4c){return function(_0x4d17f5,_0x290d90,_0x40342f){VoiceQueueReportEvents['emit'](_0x28bd4c+':'+_0x4d17f5['id'],_0x4d17f5);VoiceQueueReportEvents[_0xf499('0x5')](_0x28bd4c,_0x4d17f5);_0x40342f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xf499('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index dc0fd8e..84957a0 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 _0x7525=['report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','./voiceQueueReport.attributes','exports','define'];(function(_0x2ad803,_0x201db6){var _0xc8c4e4=function(_0xa70d0b){while(--_0xa70d0b){_0x2ad803['push'](_0x2ad803['shift']());}};_0xc8c4e4(++_0x201db6);}(_0x7525,0x184));var _0x5752=function(_0x4b25a9,_0x42bff1){_0x4b25a9=_0x4b25a9-0x0;var _0x1a720e=_0x7525[_0x4b25a9];return _0x1a720e;};'use strict';var _=require('lodash');var util=require(_0x5752('0x0'));var logger=require(_0x5752('0x1'))(_0x5752('0x2'));var moment=require('moment');var BPromise=require(_0x5752('0x3'));var rp=require(_0x5752('0x4'));var attributes=require(_0x5752('0x5'));module[_0x5752('0x6')]=function(_0x112d0f,_0x49baa8){return _0x112d0f[_0x5752('0x7')]('VoiceQueueReport',attributes,{'tableName':_0x5752('0x8'),'paranoid':![],'indexes':[{'fields':[_0x5752('0x9')]},{'fields':[_0x5752('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde18=['bluebird','request-promise','exports','define','report_queue','uniqueid','calleridnum','util','api','moment'];(function(_0x3739fe,_0xabff48){var _0x2ae03c=function(_0x5e256b){while(--_0x5e256b){_0x3739fe['push'](_0x3739fe['shift']());}};_0x2ae03c(++_0xabff48);}(_0xde18,0x147));var _0x8de1=function(_0x3fd61f,_0x17a531){_0x3fd61f=_0x3fd61f-0x0;var _0xc63c8f=_0xde18[_0x3fd61f];return _0xc63c8f;};'use strict';var _=require('lodash');var util=require(_0x8de1('0x0'));var logger=require('../../config/logger')(_0x8de1('0x1'));var moment=require(_0x8de1('0x2'));var BPromise=require(_0x8de1('0x3'));var rp=require(_0x8de1('0x4'));var attributes=require('./voiceQueueReport.attributes');module[_0x8de1('0x5')]=function(_0x2fe6d1,_0x547ae5){return _0x2fe6d1[_0x8de1('0x6')]('VoiceQueueReport',attributes,{'tableName':_0x8de1('0x7'),'paranoid':![],'indexes':[{'fields':[_0x8de1('0x8')]},{'fields':[_0x8de1('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6f74669..b0a54f5 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 _0xf877=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','util','moment','bluebird','randomstring'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf877,0x182));var _0x7f87=function(_0x4b9e8b,_0x308251){_0x4b9e8b=_0x4b9e8b-0x0;var _0x92e4ab=_0xf877[_0x4b9e8b];return _0x92e4ab;};'use strict';var _=require('lodash');var util=require(_0x7f87('0x0'));var moment=require(_0x7f87('0x1'));var BPromise=require(_0x7f87('0x2'));var rs=require(_0x7f87('0x3'));var fs=require('fs');var Redis=require(_0x7f87('0x4'));var db=require(_0x7f87('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f87('0x6'))('rpc');var config=require(_0x7f87('0x7'));var jayson=require(_0x7f87('0x8'));var client=jayson[_0x7f87('0x9')][_0x7f87('0xa')]({'port':0x232a});config[_0x7f87('0xb')]=_[_0x7f87('0xc')](config[_0x7f87('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f87('0xd'))(new Redis(config[_0x7f87('0xb')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x4b8e10,_0x9c444f,_0x278de5){return new BPromise(function(_0x303f54,_0x58d473){return client['request'](_0x4b8e10,_0x278de5)[_0x7f87('0xe')](function(_0x320644){logger[_0x7f87('0xf')](_0x7f87('0x10'),_0x9c444f,_0x7f87('0x11'));logger[_0x7f87('0x12')](_0x7f87('0x13'),_0x9c444f,_0x7f87('0x11'),JSON[_0x7f87('0x14')](_0x320644));if(_0x320644[_0x7f87('0x15')]){if(_0x320644[_0x7f87('0x15')]['code']===0x1f4){logger['error'](_0x7f87('0x10'),_0x9c444f,_0x320644[_0x7f87('0x15')]['message']);return _0x58d473(_0x320644[_0x7f87('0x15')]['message']);}logger[_0x7f87('0x15')](_0x7f87('0x10'),_0x9c444f,_0x320644[_0x7f87('0x15')][_0x7f87('0x16')]);return _0x303f54(_0x320644['error'][_0x7f87('0x16')]);}else{logger[_0x7f87('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x9c444f,'request\x20sent');_0x303f54(_0x320644[_0x7f87('0x17')][_0x7f87('0x16')]);}})[_0x7f87('0x18')](function(_0x2f09ee){logger['error'](_0x7f87('0x10'),_0x9c444f,_0x2f09ee);_0x58d473(_0x2f09ee);});});}exports[_0x7f87('0x19')]=function(_0x233df2){var _0x589011=this;return new Promise(function(_0xf3cdf8,_0x334172){return db[_0x7f87('0x1a')][_0x7f87('0x1b')]({'raw':_0x233df2['options']?_0x233df2[_0x7f87('0x1c')][_0x7f87('0x1d')]===undefined?!![]:![]:!![],'where':_0x233df2[_0x7f87('0x1c')]?_0x233df2[_0x7f87('0x1c')][_0x7f87('0x1e')]||null:null,'attributes':_0x233df2[_0x7f87('0x1c')]?_0x233df2['options']['attributes']||null:null,'limit':_0x233df2[_0x7f87('0x1c')]?_0x233df2[_0x7f87('0x1c')][_0x7f87('0x1f')]||null:null,'include':_0x233df2[_0x7f87('0x1c')]?_0x233df2[_0x7f87('0x1c')][_0x7f87('0x20')]?_[_0x7f87('0x21')](_0x233df2[_0x7f87('0x1c')][_0x7f87('0x20')],function(_0x5c71f5){return{'model':db[_0x5c71f5[_0x7f87('0x22')]],'as':_0x5c71f5['as'],'attributes':_0x5c71f5[_0x7f87('0x23')],'include':_0x5c71f5['include']?_[_0x7f87('0x21')](_0x5c71f5['include'],function(_0x3bb0d3){return{'model':db[_0x3bb0d3[_0x7f87('0x22')]],'as':_0x3bb0d3['as'],'attributes':_0x3bb0d3[_0x7f87('0x23')],'include':_0x3bb0d3[_0x7f87('0x20')]?_[_0x7f87('0x21')](_0x3bb0d3['include'],function(_0x5605f2){return{'model':db[_0x5605f2[_0x7f87('0x22')]],'as':_0x5605f2['as'],'attributes':_0x5605f2[_0x7f87('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7f87('0xe')](function(_0xe942f9){logger['info'](_0x7f87('0x19'),_0x233df2);logger[_0x7f87('0x12')]('GetVoiceQueueReport',_0x233df2,JSON[_0x7f87('0x14')](_0xe942f9));_0xf3cdf8(_0xe942f9);})['catch'](function(_0x17a258){logger[_0x7f87('0x15')](_0x7f87('0x19'),_0x17a258[_0x7f87('0x16')],_0x233df2);_0x334172(_0x589011[_0x7f87('0x15')](0x1f4,_0x17a258[_0x7f87('0x16')]));});});};exports[_0x7f87('0x24')]=function(_0x809b13){var _0x5b0dbe=this;return new Promise(function(_0x2c3cd9,_0x3e6eb3){return db[_0x7f87('0x1a')]['create'](_0x809b13[_0x7f87('0x25')],{'raw':_0x809b13[_0x7f87('0x1c')]?_0x809b13[_0x7f87('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c6cad){logger[_0x7f87('0xf')](_0x7f87('0x24'),_0x809b13);logger[_0x7f87('0x12')]('CreateVoiceQueueReport',_0x809b13,JSON[_0x7f87('0x14')](_0x1c6cad));_0x2c3cd9(_0x1c6cad);})['catch'](function(_0x105012){logger[_0x7f87('0x15')](_0x7f87('0x24'),_0x105012[_0x7f87('0x16')],_0x809b13);_0x3e6eb3(_0x5b0dbe['error'](0x1f4,_0x105012[_0x7f87('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0xa64f5a){var _0x6b6f8e=this;return new Promise(function(_0x1fe65b,_0x5dde82){return db[_0x7f87('0x1a')]['update'](_0xa64f5a[_0x7f87('0x25')],{'raw':_0xa64f5a['options']?_0xa64f5a[_0x7f87('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa64f5a[_0x7f87('0x1c')]?_0xa64f5a[_0x7f87('0x1c')][_0x7f87('0x1e')]||null:null,'attributes':_0xa64f5a[_0x7f87('0x1c')]?_0xa64f5a[_0x7f87('0x1c')][_0x7f87('0x23')]||null:null,'limit':_0xa64f5a[_0x7f87('0x1c')]?_0xa64f5a[_0x7f87('0x1c')][_0x7f87('0x1f')]||null:null})[_0x7f87('0xe')](function(_0x5d714){logger[_0x7f87('0xf')](_0x7f87('0x26'),_0xa64f5a);logger[_0x7f87('0x12')](_0x7f87('0x26'),_0xa64f5a,JSON[_0x7f87('0x14')](_0x5d714));_0x1fe65b(_0x5d714);})[_0x7f87('0x18')](function(_0x17c426){logger[_0x7f87('0x15')](_0x7f87('0x26'),_0x17c426['message'],_0xa64f5a);_0x5dde82(_0x6b6f8e['error'](0x1f4,_0x17c426['message']));});});}; \ No newline at end of file +var _0x6cbc=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceQueueReport','options','where','attributes','model','include','map','then','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','raw','debug','update','limit','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x815899,_0x4b8acc){var _0x203f9f=function(_0x1013b9){while(--_0x1013b9){_0x815899['push'](_0x815899['shift']());}};_0x203f9f(++_0x4b8acc);}(_0x6cbc,0x14e));var _0xc6cb=function(_0x59b0af,_0x25942d){_0x59b0af=_0x59b0af-0x0;var _0x26f45b=_0x6cbc[_0x59b0af];return _0x26f45b;};'use strict';var _=require(_0xc6cb('0x0'));var util=require('util');var moment=require(_0xc6cb('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6cb('0x2'));var fs=require('fs');var Redis=require(_0xc6cb('0x3'));var db=require(_0xc6cb('0x4'))['db'];var utils=require(_0xc6cb('0x5'));var logger=require(_0xc6cb('0x6'))(_0xc6cb('0x7'));var config=require(_0xc6cb('0x8'));var jayson=require(_0xc6cb('0x9'));var client=jayson['client'][_0xc6cb('0xa')]({'port':0x232a});config[_0xc6cb('0xb')]=_[_0xc6cb('0xc')](config[_0xc6cb('0xb')],{'host':_0xc6cb('0xd'),'port':0x18eb});var socket=require(_0xc6cb('0xe'))(new Redis(config['redis']));require(_0xc6cb('0xf'))['register'](socket);function respondWithRpcPromise(_0xfa993a,_0x58ce05,_0x31d717){return new BPromise(function(_0x42ef7c,_0x8d5b24){return client[_0xc6cb('0x10')](_0xfa993a,_0x31d717)['then'](function(_0x2d21b1){logger[_0xc6cb('0x11')](_0xc6cb('0x12'),_0x58ce05,_0xc6cb('0x13'));logger['debug'](_0xc6cb('0x14'),_0x58ce05,_0xc6cb('0x13'),JSON[_0xc6cb('0x15')](_0x2d21b1));if(_0x2d21b1[_0xc6cb('0x16')]){if(_0x2d21b1[_0xc6cb('0x16')]['code']===0x1f4){logger[_0xc6cb('0x16')](_0xc6cb('0x12'),_0x58ce05,_0x2d21b1['error'][_0xc6cb('0x17')]);return _0x8d5b24(_0x2d21b1[_0xc6cb('0x16')][_0xc6cb('0x17')]);}logger[_0xc6cb('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x58ce05,_0x2d21b1['error'][_0xc6cb('0x17')]);return _0x42ef7c(_0x2d21b1[_0xc6cb('0x16')][_0xc6cb('0x17')]);}else{logger[_0xc6cb('0x11')](_0xc6cb('0x12'),_0x58ce05,_0xc6cb('0x13'));_0x42ef7c(_0x2d21b1[_0xc6cb('0x18')][_0xc6cb('0x17')]);}})[_0xc6cb('0x19')](function(_0x44b23e){logger[_0xc6cb('0x16')](_0xc6cb('0x12'),_0x58ce05,_0x44b23e);_0x8d5b24(_0x44b23e);});});}exports['GetVoiceQueueReport']=function(_0x3e07a5){var _0x30048b=this;return new Promise(function(_0x2b536a,_0x2ba0fb){return db[_0xc6cb('0x1a')]['findAll']({'raw':_0x3e07a5[_0xc6cb('0x1b')]?_0x3e07a5[_0xc6cb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3e07a5[_0xc6cb('0x1b')]?_0x3e07a5[_0xc6cb('0x1b')][_0xc6cb('0x1c')]||null:null,'attributes':_0x3e07a5[_0xc6cb('0x1b')]?_0x3e07a5['options'][_0xc6cb('0x1d')]||null:null,'limit':_0x3e07a5['options']?_0x3e07a5[_0xc6cb('0x1b')]['limit']||null:null,'include':_0x3e07a5[_0xc6cb('0x1b')]?_0x3e07a5[_0xc6cb('0x1b')]['include']?_['map'](_0x3e07a5[_0xc6cb('0x1b')]['include'],function(_0x261705){return{'model':db[_0x261705[_0xc6cb('0x1e')]],'as':_0x261705['as'],'attributes':_0x261705[_0xc6cb('0x1d')],'include':_0x261705[_0xc6cb('0x1f')]?_[_0xc6cb('0x20')](_0x261705['include'],function(_0x585b31){return{'model':db[_0x585b31['model']],'as':_0x585b31['as'],'attributes':_0x585b31[_0xc6cb('0x1d')],'include':_0x585b31[_0xc6cb('0x1f')]?_[_0xc6cb('0x20')](_0x585b31[_0xc6cb('0x1f')],function(_0x412393){return{'model':db[_0x412393['model']],'as':_0x412393['as'],'attributes':_0x412393[_0xc6cb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc6cb('0x21')](function(_0x4d1dd4){logger[_0xc6cb('0x11')](_0xc6cb('0x22'),_0x3e07a5);logger['debug']('GetVoiceQueueReport',_0x3e07a5,JSON['stringify'](_0x4d1dd4));_0x2b536a(_0x4d1dd4);})[_0xc6cb('0x19')](function(_0xbea7e2){logger['error']('GetVoiceQueueReport',_0xbea7e2[_0xc6cb('0x17')],_0x3e07a5);_0x2ba0fb(_0x30048b['error'](0x1f4,_0xbea7e2[_0xc6cb('0x17')]));});});};exports[_0xc6cb('0x23')]=function(_0x1c5d16){var _0x308d85=this;return new Promise(function(_0x13002b,_0x11842c){return db['VoiceQueueReport'][_0xc6cb('0x24')](_0x1c5d16[_0xc6cb('0x25')],{'raw':_0x1c5d16['options']?_0x1c5d16[_0xc6cb('0x1b')][_0xc6cb('0x26')]===undefined?!![]:![]:!![]})[_0xc6cb('0x21')](function(_0x1cb00b){logger['info']('CreateVoiceQueueReport',_0x1c5d16);logger[_0xc6cb('0x27')](_0xc6cb('0x23'),_0x1c5d16,JSON[_0xc6cb('0x15')](_0x1cb00b));_0x13002b(_0x1cb00b);})[_0xc6cb('0x19')](function(_0x8234ef){logger[_0xc6cb('0x16')](_0xc6cb('0x23'),_0x8234ef[_0xc6cb('0x17')],_0x1c5d16);_0x11842c(_0x308d85['error'](0x1f4,_0x8234ef[_0xc6cb('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x3e1e4f){var _0x1ad09b=this;return new Promise(function(_0x9c1403,_0x248878){return db[_0xc6cb('0x1a')][_0xc6cb('0x28')](_0x3e1e4f[_0xc6cb('0x25')],{'raw':_0x3e1e4f['options']?_0x3e1e4f['options'][_0xc6cb('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e1e4f['options']?_0x3e1e4f[_0xc6cb('0x1b')][_0xc6cb('0x1c')]||null:null,'attributes':_0x3e1e4f[_0xc6cb('0x1b')]?_0x3e1e4f[_0xc6cb('0x1b')][_0xc6cb('0x1d')]||null:null,'limit':_0x3e1e4f['options']?_0x3e1e4f[_0xc6cb('0x1b')][_0xc6cb('0x29')]||null:null})[_0xc6cb('0x21')](function(_0x774483){logger[_0xc6cb('0x11')](_0xc6cb('0x2a'),_0x3e1e4f);logger[_0xc6cb('0x27')]('UpdateVoiceQueueReport',_0x3e1e4f,JSON[_0xc6cb('0x15')](_0x774483));_0x9c1403(_0x774483);})['catch'](function(_0x4fadef){logger[_0xc6cb('0x16')](_0xc6cb('0x2a'),_0x4fadef[_0xc6cb('0x17')],_0x3e1e4f);_0x248878(_0x1ad09b[_0xc6cb('0x16')](0x1f4,_0x4fadef['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 550a515..ad71514 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 _0xf17a=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener'];(function(_0x3e52f2,_0x5d7d0d){var _0x5ebaef=function(_0x38d6bf){while(--_0x38d6bf){_0x3e52f2['push'](_0x3e52f2['shift']());}};_0x5ebaef(++_0x5d7d0d);}(_0xf17a,0x136));var _0xaf17=function(_0x857f6,_0x2b2aae){_0x857f6=_0x857f6-0x0;var _0x4d1c58=_0xf17a[_0x857f6];return _0x4d1c58;};'use strict';var VoiceQueueReportEvents=require(_0xaf17('0x0'));var events=[_0xaf17('0x1'),_0xaf17('0x2'),_0xaf17('0x3')];function createListener(_0x463279,_0xdc6bf4){return function(_0x55c227){_0xdc6bf4['emit'](_0x463279,_0x55c227);};}function removeListener(_0x4ed2f2,_0x112b7f){return function(){VoiceQueueReportEvents[_0xaf17('0x4')](_0x4ed2f2,_0x112b7f);};}exports[_0xaf17('0x5')]=function(_0x1074de){for(var _0x55cf8b=0x0,_0xbbe5ee=events['length'];_0x55cf8b<_0xbbe5ee;_0x55cf8b++){var _0x1dc7e3=events[_0x55cf8b];var _0x5d45e7=createListener(_0xaf17('0x6')+_0x1dc7e3,_0x1074de);VoiceQueueReportEvents['on'](_0x1dc7e3,_0x5d45e7);}}; \ No newline at end of file +var _0x35e7=['emit','register','length','./voiceQueueReport.events','save','remove','update'];(function(_0x46e072,_0x13e36f){var _0x15d7ea=function(_0x436ca0){while(--_0x436ca0){_0x46e072['push'](_0x46e072['shift']());}};_0x15d7ea(++_0x13e36f);}(_0x35e7,0x1a0));var _0x735e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x35e7[_0xe66cf2];return _0x2d84e7;};'use strict';var VoiceQueueReportEvents=require(_0x735e('0x0'));var events=[_0x735e('0x1'),_0x735e('0x2'),_0x735e('0x3')];function createListener(_0x1f61c6,_0x8eb094){return function(_0x34203b){_0x8eb094[_0x735e('0x4')](_0x1f61c6,_0x34203b);};}function removeListener(_0x551fce,_0x492cae){return function(){VoiceQueueReportEvents['removeListener'](_0x551fce,_0x492cae);};}exports[_0x735e('0x5')]=function(_0x30139f){for(var _0x3f0e17=0x0,_0x466c82=events[_0x735e('0x6')];_0x3f0e17<_0x466c82;_0x3f0e17++){var _0x90a8b3=events[_0x3f0e17];var _0x2dfb9f=createListener('voiceQueueReport:'+_0x90a8b3,_0x30139f);VoiceQueueReportEvents['on'](_0x90a8b3,_0x2dfb9f);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 97f0b1f..3378166 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 _0xfaf2=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','/:id','isAuthenticated','show','post'];(function(_0x2012e6,_0x16c315){var _0x41554a=function(_0x13ca24){while(--_0x13ca24){_0x2012e6['push'](_0x2012e6['shift']());}};_0x41554a(++_0x16c315);}(_0xfaf2,0x169));var _0x2faf=function(_0x5051f8,_0x4ec0bf){_0x5051f8=_0x5051f8-0x0;var _0x4b78fa=_0xfaf2[_0x5051f8];return _0x4b78fa;};'use strict';var multer=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var path=require(_0x2faf('0x2'));var timeout=require(_0x2faf('0x3'));var express=require(_0x2faf('0x4'));var router=express['Router']();var auth=require(_0x2faf('0x5'));var interaction=require(_0x2faf('0x6'));var config=require(_0x2faf('0x7'));var controller=require(_0x2faf('0x8'));router[_0x2faf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2faf('0xa'),auth[_0x2faf('0xb')](),controller[_0x2faf('0xc')]);router[_0x2faf('0xd')]('/',auth[_0x2faf('0xb')](),controller['create']);router['put'](_0x2faf('0xa'),auth[_0x2faf('0xb')](),controller['update']);router['delete'](_0x2faf('0xa'),auth[_0x2faf('0xb')](),controller[_0x2faf('0xe')]);module['exports']=router; \ No newline at end of file +var _0x855f=['destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x855f,0x145));var _0xf855=function(_0x48a2fd,_0x46cdf2){_0x48a2fd=_0x48a2fd-0x0;var _0x52bdde=_0x855f[_0x48a2fd];return _0x52bdde;};'use strict';var multer=require(_0xf855('0x0'));var util=require('util');var path=require(_0xf855('0x1'));var timeout=require(_0xf855('0x2'));var express=require(_0xf855('0x3'));var router=express[_0xf855('0x4')]();var auth=require(_0xf855('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf855('0x6'));var controller=require(_0xf855('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf855('0x8')]);router[_0xf855('0x9')](_0xf855('0xa'),auth[_0xf855('0xb')](),controller[_0xf855('0xc')]);router[_0xf855('0xd')]('/',auth[_0xf855('0xb')](),controller['create']);router[_0xf855('0xe')](_0xf855('0xa'),auth[_0xf855('0xb')](),controller[_0xf855('0xf')]);router[_0xf855('0x10')](_0xf855('0xa'),auth[_0xf855('0xb')](),controller[_0xf855('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 65ea27d..53f2c52 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 _0x00bb=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x59571f,_0x4c5457){var _0x18cfd3=function(_0x4af7ae){while(--_0x4af7ae){_0x59571f['push'](_0x59571f['shift']());}};_0x18cfd3(++_0x4c5457);}(_0x00bb,0x1d8));var _0xb00b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x00bb[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb00b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb00b('0x4')],'allowNull':![],'defaultValue':moment()[_0xb00b('0x5')](_0xb00b('0x6'))}}; \ No newline at end of file +var _0x33c5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x33c5,0xe6));var _0x533c=function(_0x2b365f,_0x17aa37){_0x2b365f=_0x2b365f-0x0;var _0x26b060=_0x33c5[_0x2b365f];return _0x26b060;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x533c('0x0'));module[_0x533c('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x533c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x533c('0x3')],'allowNull':![],'defaultValue':moment()[_0x533c('0x4')](_0x533c('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index bbe9f25..249647c 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 _0xd76b=['html-pdf','eml-format','rimraf','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','VoiceQueuesLog','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','body','params'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd76b,0xcc));var _0xbd76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd76b[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xbd76('0x0'));var emlformat=require(_0xbd76('0x1'));var rimraf=require(_0xbd76('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd76('0x3'));var Mustache=require(_0xbd76('0x4'));var util=require('util');var path=require(_0xbd76('0x5'));var sox=require(_0xbd76('0x6'));var csv=require('to-csv');var ejs=require(_0xbd76('0x7'));var fs=require('fs');var _=require(_0xbd76('0x8'));var squel=require('squel');var crypto=require(_0xbd76('0x9'));var jsforce=require(_0xbd76('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbd76('0xb'));var querystring=require(_0xbd76('0xc'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xbd76('0xd'));var Redis=require(_0xbd76('0xe'));var qs=require(_0xbd76('0xf'));var logger=require(_0xbd76('0x10'))(_0xbd76('0x11'));var utils=require(_0xbd76('0x12'));var config=require(_0xbd76('0x13'));var db=require(_0xbd76('0x14'))['db'];function respondWithStatusCode(_0x1da4a2,_0x274d1d){_0x274d1d=_0x274d1d||0xcc;return function(_0x58f310){if(_0x58f310){return _0x1da4a2[_0xbd76('0x15')](_0x274d1d);}return _0x1da4a2['status'](_0x274d1d)[_0xbd76('0x16')]();};}function respondWithResult(_0x565d60,_0x47977e){_0x47977e=_0x47977e||0xc8;return function(_0x38062a){if(_0x38062a){return _0x565d60[_0xbd76('0x17')](_0x47977e)[_0xbd76('0x18')](_0x38062a);}};}function respondWithFilteredResult(_0x123237,_0x2f6270){return function(_0x12e069){if(_0x12e069){var _0x4e35de=_0x12e069[_0xbd76('0x19')],_0x382b5f=_0x2f6270['offset'],_0x434cf6=_0x2f6270[_0xbd76('0x1a')]+_0x2f6270[_0xbd76('0x1b')],_0x47a489;if(_0x434cf6>=_0x4e35de){_0x434cf6=_0x4e35de;_0x47a489=0xc8;}else{_0x47a489=0xce;}_0x123237[_0xbd76('0x17')](_0x47a489);return _0x123237[_0xbd76('0x1c')](_0xbd76('0x1d'),_0x382b5f+'-'+_0x434cf6+'/'+_0x4e35de)[_0xbd76('0x18')](_0x12e069);}return null;};}function patchUpdates(_0x1dc6f6){return function(_0x16555e){try{jsonpatch[_0xbd76('0x1e')](_0x16555e,_0x1dc6f6,!![]);}catch(_0x4f82ed){return BPromise['reject'](_0x4f82ed);}return _0x16555e['save']();};}function saveUpdates(_0x14a076,_0x2b7ed6){return function(_0x1b7a9b){if(_0x1b7a9b){return _0x1b7a9b[_0xbd76('0x1f')](_0x14a076)[_0xbd76('0x20')](function(_0x4c45a3){return _0x4c45a3;});}return null;};}function removeEntity(_0x214b35,_0x258da4){return function(_0x57622d){if(_0x57622d){return _0x57622d[_0xbd76('0x21')]()[_0xbd76('0x20')](function(){_0x214b35[_0xbd76('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f614,_0x2318b6){return function(_0x406208){if(!_0x406208){_0x30f614[_0xbd76('0x15')](0x194);}return _0x406208;};}function handleError(_0x3be893,_0x3887a3){_0x3887a3=_0x3887a3||0x1f4;return function(_0x566648){logger[_0xbd76('0x22')](_0x566648[_0xbd76('0x23')]);if(_0x566648[_0xbd76('0x24')]){delete _0x566648['name'];}_0x3be893[_0xbd76('0x17')](_0x3887a3)[_0xbd76('0x25')](_0x566648);};}exports['index']=function(_0x4d20bb,_0x4776ad){var _0x1465fc={},_0x26e9ff={},_0x423ae8={'count':0x0,'rows':[]};var _0x2595ac=db[_0xbd76('0x26')]['rawAttributes'];_0x26e9ff[_0xbd76('0x27')]=_[_0xbd76('0x28')](_0x2595ac);_0x26e9ff[_0xbd76('0x29')]=_[_0xbd76('0x28')](_0x4d20bb[_0xbd76('0x29')]);_0x26e9ff[_0xbd76('0x2a')]=_['intersection'](_0x26e9ff[_0xbd76('0x27')],_0x26e9ff['query']);_0x1465fc[_0xbd76('0x2b')]=_[_0xbd76('0x2c')](_0x26e9ff[_0xbd76('0x27')],qs[_0xbd76('0x2d')](_0x4d20bb['query'][_0xbd76('0x2d')]));_0x1465fc[_0xbd76('0x2b')]=_0x1465fc['attributes']['length']?_0x1465fc[_0xbd76('0x2b')]:_0x26e9ff[_0xbd76('0x27')];if(!_0x4d20bb[_0xbd76('0x29')]['hasOwnProperty'](_0xbd76('0x2e'))){_0x1465fc['limit']=qs[_0xbd76('0x1b')](_0x4d20bb[_0xbd76('0x29')]['limit']);_0x1465fc[_0xbd76('0x1a')]=qs['offset'](_0x4d20bb['query'][_0xbd76('0x1a')]);}_0x1465fc['order']=qs[_0xbd76('0x2f')](_0x4d20bb[_0xbd76('0x29')][_0xbd76('0x2f')]);_0x1465fc[_0xbd76('0x30')]=qs[_0xbd76('0x2a')](_[_0xbd76('0x31')](_0x4d20bb[_0xbd76('0x29')],_0x26e9ff[_0xbd76('0x2a')]));if(_0x4d20bb[_0xbd76('0x29')][_0xbd76('0x32')]){_0x1465fc[_0xbd76('0x30')]=_[_0xbd76('0x33')](_0x1465fc['where'],{'$or':_[_0xbd76('0x34')](_0x2595ac,function(_0xa4c947){if(_0xa4c947[_0xbd76('0x35')][_0xbd76('0x36')]!==_0xbd76('0x37')){var _0x56b189={};_0x56b189[_0xa4c947[_0xbd76('0x38')]]={'$like':'%'+_0x4d20bb[_0xbd76('0x29')]['filter']+'%'};return _0x56b189;}})});}_0x1465fc=_[_0xbd76('0x33')]({},_0x1465fc,_0x4d20bb[_0xbd76('0x39')]);var _0x13d3f7={'where':_0x1465fc['where']};return db['VoiceQueuesLog'][_0xbd76('0x19')](_0x13d3f7)['then'](function(_0x972659){_0x423ae8[_0xbd76('0x19')]=_0x972659;if(_0x4d20bb[_0xbd76('0x29')][_0xbd76('0x3a')]){_0x1465fc[_0xbd76('0x3b')]=[{'all':!![]}];}return db[_0xbd76('0x26')][_0xbd76('0x3c')](_0x1465fc);})[_0xbd76('0x20')](function(_0x1ffa7f){_0x423ae8[_0xbd76('0x3d')]=_0x1ffa7f;return _0x423ae8;})[_0xbd76('0x20')](respondWithFilteredResult(_0x4776ad,_0x1465fc))[_0xbd76('0x3e')](handleError(_0x4776ad,null));};exports['show']=function(_0x5df15f,_0x869b59){var _0x4e052e={'raw':!![],'where':{'id':_0x5df15f['params']['id']}},_0x2b0bf2={};_0x2b0bf2[_0xbd76('0x27')]=_[_0xbd76('0x28')](db[_0xbd76('0x26')][_0xbd76('0x3f')]);_0x2b0bf2[_0xbd76('0x29')]=_[_0xbd76('0x28')](_0x5df15f[_0xbd76('0x29')]);_0x2b0bf2['filters']=_['intersection'](_0x2b0bf2[_0xbd76('0x27')],_0x2b0bf2['query']);_0x4e052e[_0xbd76('0x2b')]=_['intersection'](_0x2b0bf2[_0xbd76('0x27')],qs['fields'](_0x5df15f[_0xbd76('0x29')][_0xbd76('0x2d')]));_0x4e052e['attributes']=_0x4e052e[_0xbd76('0x2b')][_0xbd76('0x40')]?_0x4e052e[_0xbd76('0x2b')]:_0x2b0bf2[_0xbd76('0x27')];if(_0x5df15f[_0xbd76('0x29')][_0xbd76('0x3a')]){_0x4e052e[_0xbd76('0x3b')]=[{'all':!![]}];}_0x4e052e=_[_0xbd76('0x33')]({},_0x4e052e,_0x5df15f[_0xbd76('0x39')]);return db[_0xbd76('0x26')][_0xbd76('0x41')](_0x4e052e)[_0xbd76('0x20')](handleEntityNotFound(_0x869b59,null))[_0xbd76('0x20')](respondWithResult(_0x869b59,null))[_0xbd76('0x3e')](handleError(_0x869b59,null));};exports['create']=function(_0x243157,_0x43ea77){return db['VoiceQueuesLog']['create'](_0x243157['body'],{})[_0xbd76('0x20')](respondWithResult(_0x43ea77,0xc9))[_0xbd76('0x3e')](handleError(_0x43ea77,null));};exports[_0xbd76('0x1f')]=function(_0x44c25e,_0x2b691a){if(_0x44c25e[_0xbd76('0x42')]['id']){delete _0x44c25e[_0xbd76('0x42')]['id'];}return db[_0xbd76('0x26')]['find']({'where':{'id':_0x44c25e['params']['id']}})[_0xbd76('0x20')](handleEntityNotFound(_0x2b691a,null))['then'](saveUpdates(_0x44c25e['body'],null))[_0xbd76('0x20')](respondWithResult(_0x2b691a,null))[_0xbd76('0x3e')](handleError(_0x2b691a,null));};exports[_0xbd76('0x21')]=function(_0x3194ce,_0x3b3aa9){return db['VoiceQueuesLog'][_0xbd76('0x41')]({'where':{'id':_0x3194ce[_0xbd76('0x43')]['id']}})[_0xbd76('0x20')](handleEntityNotFound(_0x3b3aa9,null))[_0xbd76('0x20')](removeEntity(_0x3b3aa9,null))[_0xbd76('0x3e')](handleError(_0x3b3aa9,null));}; \ No newline at end of file +var _0x20b1=['reject','save','update','destroy','stack','name','send','VoiceQueuesLog','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','then','includeAll','include','findAll','rows','catch','show','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply'];(function(_0x250071,_0x301941){var _0x34e574=function(_0x567186){while(--_0x567186){_0x250071['push'](_0x250071['shift']());}};_0x34e574(++_0x301941);}(_0x20b1,0x197));var _0x120b=function(_0xc02d2c,_0x315be4){_0xc02d2c=_0xc02d2c-0x0;var _0x4b6557=_0x20b1[_0xc02d2c];return _0x4b6557;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x120b('0x0'));var rimraf=require(_0x120b('0x1'));var zipdir=require(_0x120b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x120b('0x3'));var moment=require(_0x120b('0x4'));var BPromise=require(_0x120b('0x5'));var Mustache=require('mustache');var util=require(_0x120b('0x6'));var path=require('path');var sox=require(_0x120b('0x7'));var csv=require(_0x120b('0x8'));var ejs=require(_0x120b('0x9'));var fs=require('fs');var _=require(_0x120b('0xa'));var squel=require(_0x120b('0xb'));var crypto=require(_0x120b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x120b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x120b('0xe'));var authService=require(_0x120b('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x120b('0x10'));var qs=require(_0x120b('0x11'));var logger=require(_0x120b('0x12'))(_0x120b('0x13'));var utils=require(_0x120b('0x14'));var config=require(_0x120b('0x15'));var db=require(_0x120b('0x16'))['db'];function respondWithStatusCode(_0x19f268,_0x14ae8e){_0x14ae8e=_0x14ae8e||0xcc;return function(_0x477120){if(_0x477120){return _0x19f268[_0x120b('0x17')](_0x14ae8e);}return _0x19f268[_0x120b('0x18')](_0x14ae8e)[_0x120b('0x19')]();};}function respondWithResult(_0x2d8509,_0x45a08c){_0x45a08c=_0x45a08c||0xc8;return function(_0x21b897){if(_0x21b897){return _0x2d8509[_0x120b('0x18')](_0x45a08c)[_0x120b('0x1a')](_0x21b897);}};}function respondWithFilteredResult(_0x57c317,_0x36cc22){return function(_0x3e0e6c){if(_0x3e0e6c){var _0xca4be5=_0x3e0e6c['count'],_0x3b5da7=_0x36cc22[_0x120b('0x1b')],_0x4e574a=_0x36cc22[_0x120b('0x1b')]+_0x36cc22['limit'],_0x2ea4ba;if(_0x4e574a>=_0xca4be5){_0x4e574a=_0xca4be5;_0x2ea4ba=0xc8;}else{_0x2ea4ba=0xce;}_0x57c317['status'](_0x2ea4ba);return _0x57c317[_0x120b('0x1c')](_0x120b('0x1d'),_0x3b5da7+'-'+_0x4e574a+'/'+_0xca4be5)[_0x120b('0x1a')](_0x3e0e6c);}return null;};}function patchUpdates(_0xae20b0){return function(_0x745484){try{jsonpatch[_0x120b('0x1e')](_0x745484,_0xae20b0,!![]);}catch(_0x25a597){return BPromise[_0x120b('0x1f')](_0x25a597);}return _0x745484[_0x120b('0x20')]();};}function saveUpdates(_0x83cf87,_0x17f5c0){return function(_0x595e78){if(_0x595e78){return _0x595e78[_0x120b('0x21')](_0x83cf87)['then'](function(_0xb82cc9){return _0xb82cc9;});}return null;};}function removeEntity(_0x4a0447,_0x160ee4){return function(_0x12fc85){if(_0x12fc85){return _0x12fc85[_0x120b('0x22')]()['then'](function(){_0x4a0447['status'](0xcc)[_0x120b('0x19')]();});}};}function handleEntityNotFound(_0x3a93b3,_0xfed6c9){return function(_0x4ca45b){if(!_0x4ca45b){_0x3a93b3[_0x120b('0x17')](0x194);}return _0x4ca45b;};}function handleError(_0x29a2e1,_0x20048c){_0x20048c=_0x20048c||0x1f4;return function(_0x25bb91){logger['error'](_0x25bb91[_0x120b('0x23')]);if(_0x25bb91[_0x120b('0x24')]){delete _0x25bb91[_0x120b('0x24')];}_0x29a2e1[_0x120b('0x18')](_0x20048c)[_0x120b('0x25')](_0x25bb91);};}exports['index']=function(_0x3d12c4,_0x3cbe90){var _0x4df986={},_0x59a042={},_0x1266a7={'count':0x0,'rows':[]};var _0x3c8d37=db[_0x120b('0x26')][_0x120b('0x27')];_0x59a042['model']=_[_0x120b('0x28')](_0x3c8d37);_0x59a042[_0x120b('0x29')]=_[_0x120b('0x28')](_0x3d12c4['query']);_0x59a042[_0x120b('0x2a')]=_[_0x120b('0x2b')](_0x59a042[_0x120b('0x2c')],_0x59a042[_0x120b('0x29')]);_0x4df986['attributes']=_['intersection'](_0x59a042[_0x120b('0x2c')],qs['fields'](_0x3d12c4[_0x120b('0x29')]['fields']));_0x4df986[_0x120b('0x2d')]=_0x4df986[_0x120b('0x2d')][_0x120b('0x2e')]?_0x4df986[_0x120b('0x2d')]:_0x59a042['model'];if(!_0x3d12c4[_0x120b('0x29')][_0x120b('0x2f')]('nolimit')){_0x4df986[_0x120b('0x30')]=qs[_0x120b('0x30')](_0x3d12c4[_0x120b('0x29')][_0x120b('0x30')]);_0x4df986[_0x120b('0x1b')]=qs['offset'](_0x3d12c4[_0x120b('0x29')][_0x120b('0x1b')]);}_0x4df986[_0x120b('0x31')]=qs[_0x120b('0x32')](_0x3d12c4[_0x120b('0x29')][_0x120b('0x32')]);_0x4df986['where']=qs[_0x120b('0x2a')](_[_0x120b('0x33')](_0x3d12c4[_0x120b('0x29')],_0x59a042[_0x120b('0x2a')]));if(_0x3d12c4['query'][_0x120b('0x34')]){_0x4df986[_0x120b('0x35')]=_[_0x120b('0x36')](_0x4df986[_0x120b('0x35')],{'$or':_[_0x120b('0x37')](_0x3c8d37,function(_0x16c2f1){if(_0x16c2f1[_0x120b('0x38')][_0x120b('0x39')]!==_0x120b('0x3a')){var _0x324796={};_0x324796[_0x16c2f1[_0x120b('0x3b')]]={'$like':'%'+_0x3d12c4[_0x120b('0x29')][_0x120b('0x34')]+'%'};return _0x324796;}})});}_0x4df986=_[_0x120b('0x36')]({},_0x4df986,_0x3d12c4[_0x120b('0x3c')]);var _0x347361={'where':_0x4df986[_0x120b('0x35')]};return db[_0x120b('0x26')][_0x120b('0x3d')](_0x347361)[_0x120b('0x3e')](function(_0xe8ab64){_0x1266a7[_0x120b('0x3d')]=_0xe8ab64;if(_0x3d12c4['query'][_0x120b('0x3f')]){_0x4df986[_0x120b('0x40')]=[{'all':!![]}];}return db[_0x120b('0x26')][_0x120b('0x41')](_0x4df986);})[_0x120b('0x3e')](function(_0xf62a37){_0x1266a7[_0x120b('0x42')]=_0xf62a37;return _0x1266a7;})['then'](respondWithFilteredResult(_0x3cbe90,_0x4df986))[_0x120b('0x43')](handleError(_0x3cbe90,null));};exports[_0x120b('0x44')]=function(_0x5da08b,_0x371b4f){var _0x3f69f2={'raw':!![],'where':{'id':_0x5da08b['params']['id']}},_0x2c137c={};_0x2c137c[_0x120b('0x2c')]=_[_0x120b('0x28')](db[_0x120b('0x26')][_0x120b('0x27')]);_0x2c137c['query']=_[_0x120b('0x28')](_0x5da08b[_0x120b('0x29')]);_0x2c137c[_0x120b('0x2a')]=_[_0x120b('0x2b')](_0x2c137c['model'],_0x2c137c[_0x120b('0x29')]);_0x3f69f2[_0x120b('0x2d')]=_[_0x120b('0x2b')](_0x2c137c[_0x120b('0x2c')],qs[_0x120b('0x45')](_0x5da08b[_0x120b('0x29')][_0x120b('0x45')]));_0x3f69f2[_0x120b('0x2d')]=_0x3f69f2['attributes'][_0x120b('0x2e')]?_0x3f69f2['attributes']:_0x2c137c[_0x120b('0x2c')];if(_0x5da08b[_0x120b('0x29')][_0x120b('0x3f')]){_0x3f69f2[_0x120b('0x40')]=[{'all':!![]}];}_0x3f69f2=_[_0x120b('0x36')]({},_0x3f69f2,_0x5da08b[_0x120b('0x3c')]);return db[_0x120b('0x26')][_0x120b('0x46')](_0x3f69f2)[_0x120b('0x3e')](handleEntityNotFound(_0x371b4f,null))['then'](respondWithResult(_0x371b4f,null))[_0x120b('0x43')](handleError(_0x371b4f,null));};exports[_0x120b('0x47')]=function(_0x4f7687,_0x439b8e){return db[_0x120b('0x26')][_0x120b('0x47')](_0x4f7687[_0x120b('0x48')],{})[_0x120b('0x3e')](respondWithResult(_0x439b8e,0xc9))[_0x120b('0x43')](handleError(_0x439b8e,null));};exports['update']=function(_0x41b801,_0x3118e0){if(_0x41b801[_0x120b('0x48')]['id']){delete _0x41b801[_0x120b('0x48')]['id'];}return db['VoiceQueuesLog'][_0x120b('0x46')]({'where':{'id':_0x41b801['params']['id']}})[_0x120b('0x3e')](handleEntityNotFound(_0x3118e0,null))[_0x120b('0x3e')](saveUpdates(_0x41b801[_0x120b('0x48')],null))[_0x120b('0x3e')](respondWithResult(_0x3118e0,null))[_0x120b('0x43')](handleError(_0x3118e0,null));};exports['destroy']=function(_0x4729dc,_0x170d94){return db[_0x120b('0x26')][_0x120b('0x46')]({'where':{'id':_0x4729dc['params']['id']}})[_0x120b('0x3e')](handleEntityNotFound(_0x170d94,null))[_0x120b('0x3e')](removeEntity(_0x170d94,null))[_0x120b('0x43')](handleError(_0x170d94,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fa82ebf..b3823fa 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 _0x0a63=['bluebird','request-promise','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment'];(function(_0x2e84f6,_0x5354c8){var _0x59d210=function(_0x494b6e){while(--_0x494b6e){_0x2e84f6['push'](_0x2e84f6['shift']());}};_0x59d210(++_0x5354c8);}(_0x0a63,0x1e5));var _0x30a6=function(_0xb012e3,_0x33b165){_0xb012e3=_0xb012e3-0x0;var _0x195c7e=_0x0a63[_0xb012e3];return _0x195c7e;};'use strict';var _=require(_0x30a6('0x0'));var util=require(_0x30a6('0x1'));var logger=require(_0x30a6('0x2'))(_0x30a6('0x3'));var moment=require(_0x30a6('0x4'));var BPromise=require(_0x30a6('0x5'));var rp=require(_0x30a6('0x6'));var attributes=require(_0x30a6('0x7'));module[_0x30a6('0x8')]=function(_0x23debe,_0x4d75a7){return _0x23debe[_0x30a6('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x30a6('0xa'),'paranoid':![],'indexes':[{'name':_0x30a6('0xb'),'fields':[_0x30a6('0xc'),_0x30a6('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf66b=['event_dtm','event','dtm','util','../../config/logger','api','bluebird','request-promise','define','VoiceQueuesLog'];(function(_0xb77e3a,_0x5773c3){var _0xfd57c0=function(_0x57786b){while(--_0x57786b){_0xb77e3a['push'](_0xb77e3a['shift']());}};_0xfd57c0(++_0x5773c3);}(_0xf66b,0x1c5));var _0xbf66=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xf66b[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0xbf66('0x0'));var logger=require(_0xbf66('0x1'))(_0xbf66('0x2'));var moment=require('moment');var BPromise=require(_0xbf66('0x3'));var rp=require(_0xbf66('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x325c5c,_0x54fb02){return _0x325c5c[_0xbf66('0x5')](_0xbf66('0x6'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xbf66('0x7'),'fields':[_0xbf66('0x8'),_0xbf66('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 3add8c7..c889b6d 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 _0xb4e2=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45ca8f,_0x3e058b){var _0x447045=function(_0x1133f5){while(--_0x1133f5){_0x45ca8f['push'](_0x45ca8f['shift']());}};_0x447045(++_0x3e058b);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x6f8dc7,_0x1d6ec4){_0x6f8dc7=_0x6f8dc7-0x0;var _0x15bafc=_0xb4e2[_0x6f8dc7];return _0x15bafc;};'use strict';var _=require(_0x2b4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2b4e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b4e('0x2'));var logger=require(_0x2b4e('0x3'))(_0x2b4e('0x4'));var config=require(_0x2b4e('0x5'));var jayson=require(_0x2b4e('0x6'));var client=jayson[_0x2b4e('0x7')][_0x2b4e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a84a9,_0xc18f62,_0x11a6ee){return new BPromise(function(_0x36f83e,_0x36a811){return client[_0x2b4e('0x9')](_0x4a84a9,_0x11a6ee)[_0x2b4e('0xa')](function(_0x3fd14e){logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));logger[_0x2b4e('0xe')](_0x2b4e('0xf'),_0xc18f62,_0x2b4e('0xd'),JSON[_0x2b4e('0x10')](_0x3fd14e));if(_0x3fd14e['error']){if(_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x12')]===0x1f4){logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e['error'][_0x2b4e('0x13')]);return _0x36a811(_0x3fd14e['error'][_0x2b4e('0x13')]);}logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x13')]);return _0x36f83e(_0x3fd14e[_0x2b4e('0x11')]['message']);}else{logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));_0x36f83e(_0x3fd14e['result'][_0x2b4e('0x13')]);}})[_0x2b4e('0x14')](function(_0x4b87ec){logger[_0x2b4e('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0xc18f62,_0x4b87ec);_0x36a811(_0x4b87ec);});});} \ No newline at end of file +var _0xe3af=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x33f345,_0x168379){var _0x4b30c0=function(_0x32e073){while(--_0x32e073){_0x33f345['push'](_0x33f345['shift']());}};_0x4b30c0(++_0x168379);}(_0xe3af,0x18f));var _0xfe3a=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0xe3af[_0x469a2d];return _0x148147;};'use strict';var _=require(_0xfe3a('0x0'));var util=require(_0xfe3a('0x1'));var moment=require(_0xfe3a('0x2'));var BPromise=require(_0xfe3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe3a('0x4'));var db=require(_0xfe3a('0x5'))['db'];var utils=require(_0xfe3a('0x6'));var logger=require(_0xfe3a('0x7'))(_0xfe3a('0x8'));var config=require(_0xfe3a('0x9'));var jayson=require(_0xfe3a('0xa'));var client=jayson[_0xfe3a('0xb')][_0xfe3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21d1c8,_0x70040a,_0x2fa6ee){return new BPromise(function(_0x1ba5d4,_0x2b0e91){return client['request'](_0x21d1c8,_0x2fa6ee)['then'](function(_0x5f066a){logger[_0xfe3a('0xd')](_0xfe3a('0xe'),_0x70040a,'request\x20sent');logger[_0xfe3a('0xf')](_0xfe3a('0x10'),_0x70040a,_0xfe3a('0x11'),JSON[_0xfe3a('0x12')](_0x5f066a));if(_0x5f066a[_0xfe3a('0x13')]){if(_0x5f066a['error']['code']===0x1f4){logger['error'](_0xfe3a('0xe'),_0x70040a,_0x5f066a['error']['message']);return _0x2b0e91(_0x5f066a[_0xfe3a('0x13')][_0xfe3a('0x14')]);}logger[_0xfe3a('0x13')](_0xfe3a('0xe'),_0x70040a,_0x5f066a[_0xfe3a('0x13')][_0xfe3a('0x14')]);return _0x1ba5d4(_0x5f066a[_0xfe3a('0x13')][_0xfe3a('0x14')]);}else{logger[_0xfe3a('0xd')](_0xfe3a('0xe'),_0x70040a,_0xfe3a('0x11'));_0x1ba5d4(_0x5f066a[_0xfe3a('0x15')]['message']);}})[_0xfe3a('0x16')](function(_0x5a0e84){logger[_0xfe3a('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x70040a,_0x5a0e84);_0x2b0e91(_0x5a0e84);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ee7b1d3..1948cd5 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 _0x54f3=['update','delete','destroy','util','path','connect-timeout','express','Router','../../config/environment','./voiceRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','/:id/downloads','downloads','create'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x54f3,0x120));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x354f('0x0'));var path=require(_0x354f('0x1'));var timeout=require(_0x354f('0x2'));var express=require(_0x354f('0x3'));var router=express[_0x354f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x354f('0x5'));var controller=require(_0x354f('0x6'));router[_0x354f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x354f('0x7')]('/describe',auth[_0x354f('0x8')](),controller[_0x354f('0x9')]);router[_0x354f('0x7')](_0x354f('0xa'),auth['isAuthenticated'](),controller[_0x354f('0xb')]);router['get'](_0x354f('0xc'),auth[_0x354f('0x8')](),controller['download']);router['get'](_0x354f('0xd'),controller[_0x354f('0xe')]);router['post']('/',auth[_0x354f('0x8')](),controller[_0x354f('0xf')]);router['put'](_0x354f('0xa'),auth[_0x354f('0x8')](),controller[_0x354f('0x10')]);router[_0x354f('0x11')](_0x354f('0xa'),auth[_0x354f('0x8')](),controller[_0x354f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0a9a=['/:id','show','download','downloads','post','create','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x44fa55,_0x56ebcd){var _0x261afd=function(_0x2d2993){while(--_0x2d2993){_0x44fa55['push'](_0x44fa55['shift']());}};_0x261afd(++_0x56ebcd);}(_0x0a9a,0x183));var _0xa0a9=function(_0x5314f8,_0x2c3eed){_0x5314f8=_0x5314f8-0x0;var _0x21ce6f=_0x0a9a[_0x5314f8];return _0x21ce6f;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var auth=require(_0xa0a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a9('0x5'));var controller=require(_0xa0a9('0x6'));router['get']('/',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x8')]);router[_0xa0a9('0x9')](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xb')]);router['get'](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xd')]);router[_0xa0a9('0x9')]('/:id/download',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xe')]);router['get']('/:id/downloads',controller[_0xa0a9('0xf')]);router[_0xa0a9('0x10')]('/',auth['isAuthenticated'](),controller[_0xa0a9('0x11')]);router['put'](_0xa0a9('0xc'),auth['isAuthenticated'](),controller[_0xa0a9('0x12')]);router[_0xa0a9('0x13')](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8828d2e..f3bf29f 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 _0x03a6=['extname','STRING','setDataValue','channel','membername','INTEGER','DATE','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','path','exports','VIRTUAL','getDataValue','value'];(function(_0x4c97c5,_0x4d9989){var _0x48abd8=function(_0x5d39da){while(--_0x5d39da){_0x4c97c5['push'](_0x4c97c5['shift']());}};_0x48abd8(++_0x4d9989);}(_0x03a6,0xa3));var _0x603a=function(_0x177660,_0xaa92d1){_0x177660=_0x177660-0x0;var _0x432450=_0x03a6[_0x177660];return _0x432450;};'use strict';var Sequelize=require(_0x603a('0x0'));var moment=require(_0x603a('0x1'));var path=require(_0x603a('0x2'));module[_0x603a('0x3')]={'format':{'type':Sequelize[_0x603a('0x4')],'get':function(){return this[_0x603a('0x5')](_0x603a('0x6'))?path[_0x603a('0x7')](this[_0x603a('0x5')](_0x603a('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x603a('0x8')]},'channel':{'type':Sequelize[_0x603a('0x8')],'set':function(_0x3232ae){if(_0x3232ae){this[_0x603a('0x9')](_0x603a('0xa'),_0x3232ae);this[_0x603a('0x9')](_0x603a('0xb'),_0x3232ae['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x603a('0x8')]},'calleridnum':{'type':Sequelize[_0x603a('0x8')]},'calleridname':{'type':Sequelize[_0x603a('0x8')]},'connectedlinenum':{'type':Sequelize[_0x603a('0x8')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x603a('0x8')]},'exten':{'type':Sequelize[_0x603a('0x8')]},'value':{'type':Sequelize[_0x603a('0x8')]},'type':{'type':Sequelize[_0x603a('0x8')]},'rating':{'type':Sequelize[_0x603a('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x603a('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0x603a('0xd')],'get':function(){return moment(this[_0x603a('0x5')]('createdAt'))[_0x603a('0xe')](_0x603a('0xf'))[_0x603a('0x10')]();}},'updatedAt':{'type':Sequelize[_0x603a('0xd')],'get':function(){return moment(this[_0x603a('0x5')]('updatedAt'))[_0x603a('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xdd03=['toString','format','moment','path','exports','VIRTUAL','value','STRING','setDataValue','membername','split','INTEGER','DATE','getDataValue','MM-DD-YYYY\x20HH:mm'];(function(_0x4051ff,_0x50ce71){var _0x53b31c=function(_0x5098b0){while(--_0x5098b0){_0x4051ff['push'](_0x4051ff['shift']());}};_0x53b31c(++_0x50ce71);}(_0xdd03,0x1a6));var _0x3dd0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd03[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3dd0('0x0'));var path=require(_0x3dd0('0x1'));module[_0x3dd0('0x2')]={'format':{'type':Sequelize[_0x3dd0('0x3')],'get':function(){return this['getDataValue'](_0x3dd0('0x4'))?path['extname'](this['getDataValue'](_0x3dd0('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3dd0('0x5')],'set':function(_0x141193){if(_0x141193){this[_0x3dd0('0x6')]('channel',_0x141193);this[_0x3dd0('0x6')](_0x3dd0('0x7'),_0x141193[_0x3dd0('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x3dd0('0x5')]},'calleridnum':{'type':Sequelize[_0x3dd0('0x5')]},'calleridname':{'type':Sequelize[_0x3dd0('0x5')]},'connectedlinenum':{'type':Sequelize[_0x3dd0('0x5')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3dd0('0x5')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3dd0('0x5')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x3dd0('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x3dd0('0x5')]},'userDisposition':{'type':Sequelize[_0x3dd0('0x5')]},'createdAt':{'type':Sequelize[_0x3dd0('0xa')],'get':function(){return moment(this[_0x3dd0('0xb')]('createdAt'))['format'](_0x3dd0('0xc'))[_0x3dd0('0xd')]();}},'updatedAt':{'type':Sequelize[_0x3dd0('0xa')],'get':function(){return moment(this[_0x3dd0('0xb')]('updatedAt'))[_0x3dd0('0xe')](_0x3dd0('0xc'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6b91cfe..0d68078 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 _0xb352=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','save','update','destroy','then','error','stack','name','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','count','includeAll','include','rows','catch','show','params','length','options','create','body','find','describe','../../components/encryptor','uniqueid','value','decryptFile','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','download','extname','unlink','downloads','sequelize','MD5','col','push','$and','%s.cypher','ValidationError','filename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5d4818,_0x3ccae2){var _0x578a9c=function(_0x530284){while(--_0x530284){_0x5d4818['push'](_0x5d4818['shift']());}};_0x578a9c(++_0x3ccae2);}(_0xb352,0x173));var _0x2b35=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xb352[_0x2b7764];return _0x848dcb;};'use strict';var pdf=require(_0x2b35('0x0'));var emlformat=require(_0x2b35('0x1'));var rimraf=require(_0x2b35('0x2'));var zipdir=require(_0x2b35('0x3'));var jsonpatch=require(_0x2b35('0x4'));var rp=require(_0x2b35('0x5'));var moment=require(_0x2b35('0x6'));var BPromise=require(_0x2b35('0x7'));var Mustache=require(_0x2b35('0x8'));var util=require(_0x2b35('0x9'));var path=require('path');var sox=require(_0x2b35('0xa'));var csv=require(_0x2b35('0xb'));var ejs=require(_0x2b35('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2b35('0xd'));var crypto=require('crypto');var jsforce=require(_0x2b35('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2b35('0xb'));var querystring=require(_0x2b35('0xf'));var Papa=require(_0x2b35('0x10'));var authService=require(_0x2b35('0x11'));var hardwareService=require(_0x2b35('0x12'));var Redis=require('ioredis');var qs=require(_0x2b35('0x13'));var logger=require(_0x2b35('0x14'))(_0x2b35('0x15'));var utils=require(_0x2b35('0x16'));var config=require('../../config/environment');var db=require(_0x2b35('0x17'))['db'];function respondWithStatusCode(_0x385dd0,_0x548359){_0x548359=_0x548359||0xcc;return function(_0xe3cb28){if(_0xe3cb28){return _0x385dd0[_0x2b35('0x18')](_0x548359);}return _0x385dd0['status'](_0x548359)[_0x2b35('0x19')]();};}function respondWithResult(_0x5d75de,_0x329255){_0x329255=_0x329255||0xc8;return function(_0x12548f){if(_0x12548f){return _0x5d75de[_0x2b35('0x1a')](_0x329255)[_0x2b35('0x1b')](_0x12548f);}};}function respondWithFilteredResult(_0x8d468e,_0x433b44){return function(_0x268176){if(_0x268176){var _0x41c83a=_0x268176['count'],_0x54741f=_0x433b44[_0x2b35('0x1c')],_0x58845a=_0x433b44['offset']+_0x433b44[_0x2b35('0x1d')],_0x155050;if(_0x58845a>=_0x41c83a){_0x58845a=_0x41c83a;_0x155050=0xc8;}else{_0x155050=0xce;}_0x8d468e['status'](_0x155050);return _0x8d468e[_0x2b35('0x1e')]('Content-Range',_0x54741f+'-'+_0x58845a+'/'+_0x41c83a)['json'](_0x268176);}return null;};}function patchUpdates(_0x2466bc){return function(_0x3639ae){try{jsonpatch[_0x2b35('0x1f')](_0x3639ae,_0x2466bc,!![]);}catch(_0x461639){return BPromise['reject'](_0x461639);}return _0x3639ae[_0x2b35('0x20')]();};}function saveUpdates(_0x2667e8,_0x16d51e){return function(_0xa88d8f){if(_0xa88d8f){return _0xa88d8f[_0x2b35('0x21')](_0x2667e8)['then'](function(_0x7879e){return _0x7879e;});}return null;};}function removeEntity(_0x1254bb,_0x6a2c1d){return function(_0x5c93e3){if(_0x5c93e3){return _0x5c93e3[_0x2b35('0x22')]()[_0x2b35('0x23')](function(){_0x1254bb[_0x2b35('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f69f5,_0x433e84){return function(_0x59de29){if(!_0x59de29){_0x1f69f5['sendStatus'](0x194);}return _0x59de29;};}function handleError(_0x43349f,_0x534ca5){_0x534ca5=_0x534ca5||0x1f4;return function(_0x4bc5a6){logger[_0x2b35('0x24')](_0x4bc5a6[_0x2b35('0x25')]);if(_0x4bc5a6[_0x2b35('0x26')]){delete _0x4bc5a6[_0x2b35('0x26')];}_0x43349f[_0x2b35('0x1a')](_0x534ca5)['send'](_0x4bc5a6);};}exports['index']=function(_0x29f5fa,_0x31ecd9){var _0x19324b={},_0x1c16e9={},_0xf0eeb4={'count':0x0,'rows':[]};var _0x393f43=db[_0x2b35('0x27')][_0x2b35('0x28')];_0x1c16e9[_0x2b35('0x29')]=_[_0x2b35('0x2a')](_[_0x2b35('0x2b')](_0x393f43),[_0x2b35('0x2c')]);_0x1c16e9[_0x2b35('0x2d')]=_[_0x2b35('0x2b')](_0x29f5fa[_0x2b35('0x2d')]);_0x1c16e9['filters']=_[_0x2b35('0x2e')](_0x1c16e9['model'],_0x1c16e9[_0x2b35('0x2d')]);_0x19324b[_0x2b35('0x2f')]=_[_0x2b35('0x2e')](_0x1c16e9[_0x2b35('0x29')],qs[_0x2b35('0x30')](_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x30')]));_0x19324b[_0x2b35('0x2f')]=_0x19324b[_0x2b35('0x2f')]['length']?_0x19324b[_0x2b35('0x2f')]:_0x1c16e9['model'];if(!_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x31')]('nolimit')){_0x19324b[_0x2b35('0x1d')]=qs[_0x2b35('0x1d')](_0x29f5fa['query']['limit']);_0x19324b[_0x2b35('0x1c')]=qs['offset'](_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x1c')]);}_0x19324b[_0x2b35('0x32')]=qs[_0x2b35('0x33')](_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x33')]);_0x19324b[_0x2b35('0x34')]=qs['filters'](_[_0x2b35('0x35')](_0x29f5fa[_0x2b35('0x2d')],_0x1c16e9[_0x2b35('0x36')]));if(_0x29f5fa['query'][_0x2b35('0x37')]){_0x19324b[_0x2b35('0x34')]=_[_0x2b35('0x38')](_0x19324b['where'],{'$or':_[_0x2b35('0x39')](_0x393f43,function(_0x558975){if(_0x558975[_0x2b35('0x3a')]['key']!==_0x2b35('0x3b')){var _0x570760={};_0x570760[_0x558975[_0x2b35('0x3c')]]={'$like':'%'+_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x37')]+'%'};return _0x570760;}})});}_0x19324b=_[_0x2b35('0x38')]({},_0x19324b,_0x29f5fa['options']);var _0xa83d73={'where':_0x19324b[_0x2b35('0x34')]};return db['VoiceRecording'][_0x2b35('0x3d')](_0xa83d73)[_0x2b35('0x23')](function(_0x50854a){_0xf0eeb4[_0x2b35('0x3d')]=_0x50854a;if(_0x29f5fa[_0x2b35('0x2d')][_0x2b35('0x3e')]){_0x19324b[_0x2b35('0x3f')]=[{'all':!![]}];}return db[_0x2b35('0x27')]['findAll'](_0x19324b);})[_0x2b35('0x23')](function(_0x52a2f4){_0xf0eeb4[_0x2b35('0x40')]=_0x52a2f4;return _0xf0eeb4;})[_0x2b35('0x23')](respondWithFilteredResult(_0x31ecd9,_0x19324b))[_0x2b35('0x41')](handleError(_0x31ecd9,null));};exports[_0x2b35('0x42')]=function(_0x102975,_0x169329){var _0x2efbbc={'raw':![],'where':{'id':_0x102975[_0x2b35('0x43')]['id']}},_0x14b5f7={};_0x14b5f7[_0x2b35('0x29')]=_[_0x2b35('0x2b')](db[_0x2b35('0x27')][_0x2b35('0x28')]);_0x14b5f7[_0x2b35('0x2d')]=_[_0x2b35('0x2b')](_0x102975[_0x2b35('0x2d')]);_0x14b5f7[_0x2b35('0x36')]=_[_0x2b35('0x2e')](_0x14b5f7['model'],_0x14b5f7[_0x2b35('0x2d')]);_0x2efbbc[_0x2b35('0x2f')]=_['intersection'](_0x14b5f7[_0x2b35('0x29')],qs[_0x2b35('0x30')](_0x102975['query'][_0x2b35('0x30')]));_0x2efbbc[_0x2b35('0x2f')]=_0x2efbbc[_0x2b35('0x2f')][_0x2b35('0x44')]?_0x2efbbc[_0x2b35('0x2f')]:_0x14b5f7[_0x2b35('0x29')];if(_0x102975['query'][_0x2b35('0x3e')]){_0x2efbbc[_0x2b35('0x3f')]=[{'all':!![]}];}_0x2efbbc=_[_0x2b35('0x38')]({},_0x2efbbc,_0x102975[_0x2b35('0x45')]);return db[_0x2b35('0x27')]['find'](_0x2efbbc)[_0x2b35('0x23')](handleEntityNotFound(_0x169329,null))[_0x2b35('0x23')](respondWithResult(_0x169329,null))['catch'](handleError(_0x169329,null));};exports[_0x2b35('0x46')]=function(_0x25a2eb,_0x4e447c){return db['VoiceRecording']['create'](_0x25a2eb[_0x2b35('0x47')],{})['then'](respondWithResult(_0x4e447c,0xc9))[_0x2b35('0x41')](handleError(_0x4e447c,null));};exports['update']=function(_0x457872,_0x2dfa2b){if(_0x457872['body']['id']){delete _0x457872[_0x2b35('0x47')]['id'];}return db['VoiceRecording'][_0x2b35('0x48')]({'where':{'id':_0x457872[_0x2b35('0x43')]['id']}})[_0x2b35('0x23')](handleEntityNotFound(_0x2dfa2b,null))['then'](saveUpdates(_0x457872['body'],null))['then'](respondWithResult(_0x2dfa2b,null))[_0x2b35('0x41')](handleError(_0x2dfa2b,null));};exports['destroy']=function(_0x321b2f,_0x12bb90){return db['VoiceRecording'][_0x2b35('0x48')]({'where':{'id':_0x321b2f[_0x2b35('0x43')]['id']}})['then'](handleEntityNotFound(_0x12bb90,null))['then'](removeEntity(_0x12bb90,null))[_0x2b35('0x41')](handleError(_0x12bb90,null));};exports['describe']=function(_0x3324eb,_0x338b03){return db[_0x2b35('0x27')][_0x2b35('0x49')]()[_0x2b35('0x23')](respondWithResult(_0x338b03,null))[_0x2b35('0x41')](handleError(_0x338b03,null));};exports['download']=function(_0x27ff26,_0x1f0d10,_0x5011cf){var _0x1f3631=require(_0x2b35('0x4a'));var _0x434916=![];var _0x1e2f9c={};if(_0x27ff26[_0x2b35('0x2d')][_0x2b35('0x3a')]&&_0x27ff26[_0x2b35('0x2d')]['type']===_0x2b35('0x4b')){_0x1e2f9c[_0x2b35('0x4b')]=_0x27ff26[_0x2b35('0x43')]['id'];}else{_0x1e2f9c['id']=_0x27ff26[_0x2b35('0x43')]['id'];}return db[_0x2b35('0x27')][_0x2b35('0x48')]({'where':_0x1e2f9c,'attributes':['id',_0x2b35('0x4c')],'raw':!![]})[_0x2b35('0x23')](handleEntityNotFound(_0x1f0d10,null))[_0x2b35('0x23')](function(_0x2eba3e){if(_0x2eba3e){var _0x6191cf=util['format']('%s.cypher',_0x2eba3e[_0x2b35('0x4c')]);if(fs['existsSync'](_0x6191cf)){_0x434916=!![];return _0x1f3631[_0x2b35('0x4d')](_0x6191cf,_0x2eba3e[_0x2b35('0x4c')],config['secrets'][_0x2b35('0x4e')])[_0x2b35('0x23')](function(){return _0x2eba3e;});}return _0x2eba3e;}})[_0x2b35('0x23')](function(_0x5a1451){if(_0x5a1451){if(!fs[_0x2b35('0x4f')](_0x5a1451[_0x2b35('0x4c')])){throw new db[(_0x2b35('0x50'))]['ValidationError'](_0x2b35('0x51'));}if(_0x5a1451['filename']){return _0x1f0d10[_0x2b35('0x52')](_0x5a1451[_0x2b35('0x4c')],_0x5a1451['filename']+path[_0x2b35('0x53')](_0x5a1451[_0x2b35('0x4c')]),function(){if(_0x434916){fs[_0x2b35('0x54')](_0x5a1451[_0x2b35('0x4c')]);}});}else{return _0x1f0d10[_0x2b35('0x52')](_0x5a1451[_0x2b35('0x4c')],function(_0x1c4dfe){if(_0x434916){fs[_0x2b35('0x54')](_0x5a1451[_0x2b35('0x4c')]);}});}}})['catch'](handleError(_0x1f0d10,null));};exports[_0x2b35('0x55')]=function(_0x4dea22,_0x110a17,_0x16d26e){var _0x4972c1=require(_0x2b35('0x4a'));var _0x11db30=![];var _0x18112c={'$and':[db[_0x2b35('0x56')][_0x2b35('0x34')](db[_0x2b35('0x56')]['fn'](_0x2b35('0x57'),db[_0x2b35('0x56')][_0x2b35('0x58')](_0x2b35('0x4b'))),_0x4dea22[_0x2b35('0x2d')]['token'])]};if(_0x4dea22[_0x2b35('0x2d')][_0x2b35('0x3a')]&&_0x4dea22['query']['type']===_0x2b35('0x4b')){_0x18112c['$and'][_0x2b35('0x59')]({'uniqueid':_0x4dea22['params']['id']});}else{_0x18112c[_0x2b35('0x5a')][_0x2b35('0x59')]({'id':_0x4dea22['params']['id']});}return db[_0x2b35('0x27')]['find']({'where':_0x18112c,'attributes':['id','value'],'raw':!![]})[_0x2b35('0x23')](handleEntityNotFound(_0x110a17,null))[_0x2b35('0x23')](function(_0x11c6f5){if(_0x11c6f5){var _0xe83e1d=util['format'](_0x2b35('0x5b'),_0x11c6f5[_0x2b35('0x4c')]);if(fs[_0x2b35('0x4f')](_0xe83e1d)){_0x11db30=!![];return _0x4972c1[_0x2b35('0x4d')](_0xe83e1d,_0x11c6f5[_0x2b35('0x4c')],config['secrets'][_0x2b35('0x4e')])['then'](function(){return _0x11c6f5;});}return _0x11c6f5;}})[_0x2b35('0x23')](function(_0x3d6d4a){if(_0x3d6d4a){if(!fs[_0x2b35('0x4f')](_0x3d6d4a[_0x2b35('0x4c')])){throw new db['Sequelize'][(_0x2b35('0x5c'))]('VoiceRecording\x20not\x20found');}if(_0x3d6d4a[_0x2b35('0x5d')]){return _0x110a17['download'](_0x3d6d4a['value'],_0x3d6d4a[_0x2b35('0x5d')]+path['extname'](_0x3d6d4a[_0x2b35('0x4c')]),function(){if(_0x11db30){fs[_0x2b35('0x54')](_0x3d6d4a[_0x2b35('0x4c')]);}});}else{return _0x110a17[_0x2b35('0x52')](_0x3d6d4a['value'],function(_0x576131){if(_0x11db30){fs[_0x2b35('0x54')](_0x3d6d4a[_0x2b35('0x4c')]);}});}}})[_0x2b35('0x41')](handleError(_0x110a17,null));}; \ No newline at end of file +var _0x79b3=['where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','MD5','col','token','$and','push','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','error','stack','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','filters','intersection','attributes','fields','length','order','sort'];(function(_0x191eb6,_0x5c4a6c){var _0x2fe105=function(_0x52609f){while(--_0x52609f){_0x191eb6['push'](_0x191eb6['shift']());}};_0x2fe105(++_0x5c4a6c);}(_0x79b3,0xea));var _0x379b=function(_0x1c4551,_0x1d3c27){_0x1c4551=_0x1c4551-0x0;var _0x12f2a0=_0x79b3[_0x1c4551];return _0x12f2a0;};'use strict';var pdf=require(_0x379b('0x0'));var emlformat=require(_0x379b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x379b('0x2'));var jsonpatch=require(_0x379b('0x3'));var rp=require('request-promise');var moment=require(_0x379b('0x4'));var BPromise=require(_0x379b('0x5'));var Mustache=require('mustache');var util=require(_0x379b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x379b('0x7'));var ejs=require(_0x379b('0x8'));var fs=require('fs');var _=require(_0x379b('0x9'));var squel=require(_0x379b('0xa'));var crypto=require(_0x379b('0xb'));var jsforce=require(_0x379b('0xc'));var deskjs=require(_0x379b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x379b('0xe'));var Papa=require(_0x379b('0xf'));var authService=require(_0x379b('0x10'));var hardwareService=require(_0x379b('0x11'));var Redis=require(_0x379b('0x12'));var qs=require(_0x379b('0x13'));var logger=require(_0x379b('0x14'))('api');var utils=require(_0x379b('0x15'));var config=require(_0x379b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x173d99,_0x59bd6e){_0x59bd6e=_0x59bd6e||0xcc;return function(_0xf2d5a2){if(_0xf2d5a2){return _0x173d99[_0x379b('0x17')](_0x59bd6e);}return _0x173d99[_0x379b('0x18')](_0x59bd6e)[_0x379b('0x19')]();};}function respondWithResult(_0x2fd551,_0x895e50){_0x895e50=_0x895e50||0xc8;return function(_0xea2955){if(_0xea2955){return _0x2fd551['status'](_0x895e50)['json'](_0xea2955);}};}function respondWithFilteredResult(_0x5dfc7d,_0x14b1a9){return function(_0x5aca43){if(_0x5aca43){var _0x5cb42b=_0x5aca43[_0x379b('0x1a')],_0x238830=_0x14b1a9[_0x379b('0x1b')],_0x36a0b1=_0x14b1a9[_0x379b('0x1b')]+_0x14b1a9[_0x379b('0x1c')],_0x5b1f42;if(_0x36a0b1>=_0x5cb42b){_0x36a0b1=_0x5cb42b;_0x5b1f42=0xc8;}else{_0x5b1f42=0xce;}_0x5dfc7d[_0x379b('0x18')](_0x5b1f42);return _0x5dfc7d[_0x379b('0x1d')]('Content-Range',_0x238830+'-'+_0x36a0b1+'/'+_0x5cb42b)[_0x379b('0x1e')](_0x5aca43);}return null;};}function patchUpdates(_0x35260d){return function(_0x18228d){try{jsonpatch['apply'](_0x18228d,_0x35260d,!![]);}catch(_0x1655f3){return BPromise[_0x379b('0x1f')](_0x1655f3);}return _0x18228d[_0x379b('0x20')]();};}function saveUpdates(_0x5ae705,_0x1c2d0b){return function(_0x491925){if(_0x491925){return _0x491925['update'](_0x5ae705)[_0x379b('0x21')](function(_0x10b66f){return _0x10b66f;});}return null;};}function removeEntity(_0x36bbe6,_0x4355c5){return function(_0x3a66f6){if(_0x3a66f6){return _0x3a66f6[_0x379b('0x22')]()[_0x379b('0x21')](function(){_0x36bbe6[_0x379b('0x18')](0xcc)[_0x379b('0x19')]();});}};}function handleEntityNotFound(_0x3acfa8,_0x585d89){return function(_0x30edaf){if(!_0x30edaf){_0x3acfa8['sendStatus'](0x194);}return _0x30edaf;};}function handleError(_0x5b5f64,_0x2061fd){_0x2061fd=_0x2061fd||0x1f4;return function(_0x51f431){logger[_0x379b('0x23')](_0x51f431[_0x379b('0x24')]);if(_0x51f431[_0x379b('0x25')]){delete _0x51f431[_0x379b('0x25')];}_0x5b5f64[_0x379b('0x18')](_0x2061fd)[_0x379b('0x26')](_0x51f431);};}exports[_0x379b('0x27')]=function(_0x2053be,_0x5de0eb){var _0x2f3946={},_0x46caa5={},_0x2de0be={'count':0x0,'rows':[]};var _0x2581ef=db[_0x379b('0x28')][_0x379b('0x29')];_0x46caa5[_0x379b('0x2a')]=_[_0x379b('0x2b')](_[_0x379b('0x2c')](_0x2581ef),[_0x379b('0x2d')]);_0x46caa5[_0x379b('0x2e')]=_[_0x379b('0x2c')](_0x2053be['query']);_0x46caa5[_0x379b('0x2f')]=_[_0x379b('0x30')](_0x46caa5['model'],_0x46caa5[_0x379b('0x2e')]);_0x2f3946[_0x379b('0x31')]=_['intersection'](_0x46caa5[_0x379b('0x2a')],qs[_0x379b('0x32')](_0x2053be[_0x379b('0x2e')]['fields']));_0x2f3946['attributes']=_0x2f3946[_0x379b('0x31')][_0x379b('0x33')]?_0x2f3946[_0x379b('0x31')]:_0x46caa5[_0x379b('0x2a')];if(!_0x2053be['query']['hasOwnProperty']('nolimit')){_0x2f3946[_0x379b('0x1c')]=qs[_0x379b('0x1c')](_0x2053be['query'][_0x379b('0x1c')]);_0x2f3946[_0x379b('0x1b')]=qs['offset'](_0x2053be[_0x379b('0x2e')][_0x379b('0x1b')]);}_0x2f3946[_0x379b('0x34')]=qs[_0x379b('0x35')](_0x2053be['query'][_0x379b('0x35')]);_0x2f3946[_0x379b('0x36')]=qs[_0x379b('0x2f')](_[_0x379b('0x37')](_0x2053be['query'],_0x46caa5['filters']));if(_0x2053be[_0x379b('0x2e')]['filter']){_0x2f3946[_0x379b('0x36')]=_[_0x379b('0x38')](_0x2f3946[_0x379b('0x36')],{'$or':_['map'](_0x2581ef,function(_0x42f17e){if(_0x42f17e[_0x379b('0x39')][_0x379b('0x3a')]!==_0x379b('0x3b')){var _0x444401={};_0x444401[_0x42f17e[_0x379b('0x3c')]]={'$like':'%'+_0x2053be[_0x379b('0x2e')][_0x379b('0x3d')]+'%'};return _0x444401;}})});}_0x2f3946=_['merge']({},_0x2f3946,_0x2053be[_0x379b('0x3e')]);var _0x28183e={'where':_0x2f3946['where']};return db[_0x379b('0x28')][_0x379b('0x1a')](_0x28183e)['then'](function(_0x573970){_0x2de0be[_0x379b('0x1a')]=_0x573970;if(_0x2053be[_0x379b('0x2e')][_0x379b('0x3f')]){_0x2f3946[_0x379b('0x40')]=[{'all':!![]}];}return db[_0x379b('0x28')][_0x379b('0x41')](_0x2f3946);})[_0x379b('0x21')](function(_0x2a1b81){_0x2de0be[_0x379b('0x42')]=_0x2a1b81;return _0x2de0be;})[_0x379b('0x21')](respondWithFilteredResult(_0x5de0eb,_0x2f3946))[_0x379b('0x43')](handleError(_0x5de0eb,null));};exports[_0x379b('0x44')]=function(_0x4f88d3,_0x21872e){var _0x4025aa={'raw':![],'where':{'id':_0x4f88d3[_0x379b('0x45')]['id']}},_0x3d1aa4={};_0x3d1aa4[_0x379b('0x2a')]=_['keys'](db[_0x379b('0x28')][_0x379b('0x29')]);_0x3d1aa4[_0x379b('0x2e')]=_[_0x379b('0x2c')](_0x4f88d3['query']);_0x3d1aa4[_0x379b('0x2f')]=_[_0x379b('0x30')](_0x3d1aa4['model'],_0x3d1aa4[_0x379b('0x2e')]);_0x4025aa['attributes']=_[_0x379b('0x30')](_0x3d1aa4[_0x379b('0x2a')],qs['fields'](_0x4f88d3[_0x379b('0x2e')][_0x379b('0x32')]));_0x4025aa[_0x379b('0x31')]=_0x4025aa[_0x379b('0x31')][_0x379b('0x33')]?_0x4025aa['attributes']:_0x3d1aa4[_0x379b('0x2a')];if(_0x4f88d3['query']['includeAll']){_0x4025aa[_0x379b('0x40')]=[{'all':!![]}];}_0x4025aa=_[_0x379b('0x38')]({},_0x4025aa,_0x4f88d3[_0x379b('0x3e')]);return db[_0x379b('0x28')]['find'](_0x4025aa)['then'](handleEntityNotFound(_0x21872e,null))[_0x379b('0x21')](respondWithResult(_0x21872e,null))[_0x379b('0x43')](handleError(_0x21872e,null));};exports[_0x379b('0x46')]=function(_0x1de5e7,_0x4483fd){return db['VoiceRecording'][_0x379b('0x46')](_0x1de5e7['body'],{})[_0x379b('0x21')](respondWithResult(_0x4483fd,0xc9))['catch'](handleError(_0x4483fd,null));};exports['update']=function(_0x32dd00,_0x348569){if(_0x32dd00[_0x379b('0x47')]['id']){delete _0x32dd00[_0x379b('0x47')]['id'];}return db[_0x379b('0x28')][_0x379b('0x48')]({'where':{'id':_0x32dd00[_0x379b('0x45')]['id']}})[_0x379b('0x21')](handleEntityNotFound(_0x348569,null))[_0x379b('0x21')](saveUpdates(_0x32dd00['body'],null))['then'](respondWithResult(_0x348569,null))['catch'](handleError(_0x348569,null));};exports[_0x379b('0x22')]=function(_0x5a2ec3,_0x49f4f3){return db[_0x379b('0x28')][_0x379b('0x48')]({'where':{'id':_0x5a2ec3[_0x379b('0x45')]['id']}})['then'](handleEntityNotFound(_0x49f4f3,null))['then'](removeEntity(_0x49f4f3,null))[_0x379b('0x43')](handleError(_0x49f4f3,null));};exports[_0x379b('0x49')]=function(_0xa4143b,_0x5e13c6){return db[_0x379b('0x28')][_0x379b('0x49')]()[_0x379b('0x21')](respondWithResult(_0x5e13c6,null))[_0x379b('0x43')](handleError(_0x5e13c6,null));};exports[_0x379b('0x4a')]=function(_0x1e0a2a,_0x1acd8f,_0x258c8e){var _0x4c1569=require(_0x379b('0x4b'));var _0x245264=![];var _0xf5b4e1={};if(_0x1e0a2a[_0x379b('0x2e')][_0x379b('0x39')]&&_0x1e0a2a['query']['type']===_0x379b('0x4c')){_0xf5b4e1[_0x379b('0x4c')]=_0x1e0a2a['params']['id'];}else{_0xf5b4e1['id']=_0x1e0a2a['params']['id'];}return db['VoiceRecording']['find']({'where':_0xf5b4e1,'attributes':['id',_0x379b('0x4d')],'raw':!![]})[_0x379b('0x21')](handleEntityNotFound(_0x1acd8f,null))[_0x379b('0x21')](function(_0x139917){if(_0x139917){var _0x31c33b=util[_0x379b('0x2d')](_0x379b('0x4e'),_0x139917[_0x379b('0x4d')]);if(fs[_0x379b('0x4f')](_0x31c33b)){_0x245264=!![];return _0x4c1569[_0x379b('0x50')](_0x31c33b,_0x139917['value'],config[_0x379b('0x51')][_0x379b('0x52')])['then'](function(){return _0x139917;});}return _0x139917;}})[_0x379b('0x21')](function(_0xe27eee){if(_0xe27eee){if(!fs['existsSync'](_0xe27eee['value'])){throw new db[(_0x379b('0x53'))][(_0x379b('0x54'))](_0x379b('0x55'));}if(_0xe27eee['filename']){return _0x1acd8f[_0x379b('0x4a')](_0xe27eee[_0x379b('0x4d')],_0xe27eee[_0x379b('0x56')]+path[_0x379b('0x57')](_0xe27eee[_0x379b('0x4d')]),function(){if(_0x245264){fs[_0x379b('0x58')](_0xe27eee[_0x379b('0x4d')]);}});}else{return _0x1acd8f['download'](_0xe27eee[_0x379b('0x4d')],function(_0x576a28){if(_0x245264){fs[_0x379b('0x58')](_0xe27eee['value']);}});}}})[_0x379b('0x43')](handleError(_0x1acd8f,null));};exports[_0x379b('0x59')]=function(_0x3c2c6f,_0x278691,_0x532efb){var _0x34c4b0=require(_0x379b('0x4b'));var _0x3ab51f=![];var _0x4b3ee1={'$and':[db[_0x379b('0x5a')][_0x379b('0x36')](db[_0x379b('0x5a')]['fn'](_0x379b('0x5b'),db[_0x379b('0x5a')][_0x379b('0x5c')](_0x379b('0x4c'))),_0x3c2c6f[_0x379b('0x2e')][_0x379b('0x5d')])]};if(_0x3c2c6f['query']['type']&&_0x3c2c6f[_0x379b('0x2e')][_0x379b('0x39')]===_0x379b('0x4c')){_0x4b3ee1[_0x379b('0x5e')][_0x379b('0x5f')]({'uniqueid':_0x3c2c6f['params']['id']});}else{_0x4b3ee1[_0x379b('0x5e')]['push']({'id':_0x3c2c6f[_0x379b('0x45')]['id']});}return db[_0x379b('0x28')][_0x379b('0x48')]({'where':_0x4b3ee1,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x278691,null))[_0x379b('0x21')](function(_0x396852){if(_0x396852){var _0x4eb1a0=util[_0x379b('0x2d')]('%s.cypher',_0x396852[_0x379b('0x4d')]);if(fs[_0x379b('0x4f')](_0x4eb1a0)){_0x3ab51f=!![];return _0x34c4b0[_0x379b('0x50')](_0x4eb1a0,_0x396852[_0x379b('0x4d')],config[_0x379b('0x51')][_0x379b('0x52')])[_0x379b('0x21')](function(){return _0x396852;});}return _0x396852;}})[_0x379b('0x21')](function(_0x49741c){if(_0x49741c){if(!fs['existsSync'](_0x49741c[_0x379b('0x4d')])){throw new db[(_0x379b('0x53'))][(_0x379b('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x49741c[_0x379b('0x56')]){return _0x278691[_0x379b('0x4a')](_0x49741c[_0x379b('0x4d')],_0x49741c[_0x379b('0x56')]+path['extname'](_0x49741c[_0x379b('0x4d')]),function(){if(_0x3ab51f){fs[_0x379b('0x58')](_0x49741c[_0x379b('0x4d')]);}});}else{return _0x278691[_0x379b('0x4a')](_0x49741c[_0x379b('0x4d')],function(_0x22ee7c){if(_0x3ab51f){fs[_0x379b('0x58')](_0x49741c[_0x379b('0x4d')]);}});}}})[_0x379b('0x43')](handleError(_0x278691,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0a1df95..471d9ae 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 _0xd91c=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x502f08,_0x3603ce){var _0x2e9353=function(_0x36a8e2){while(--_0x36a8e2){_0x502f08['push'](_0x502f08['shift']());}};_0x2e9353(++_0x3603ce);}(_0xd91c,0x170));var _0xcd91=function(_0x52d760,_0x5c2701){_0x52d760=_0x52d760-0x0;var _0x44ebc0=_0xd91c[_0x52d760];return _0x44ebc0;};'use strict';var _=require(_0xcd91('0x0'));var util=require(_0xcd91('0x1'));var logger=require(_0xcd91('0x2'))(_0xcd91('0x3'));var moment=require(_0xcd91('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd91('0x5'));var attributes=require(_0xcd91('0x6'));module[_0xcd91('0x7')]=function(_0x23fbc2,_0xce2d28){return _0x23fbc2['define'](_0xcd91('0x8'),attributes,{'tableName':_0xcd91('0x9'),'paranoid':![],'indexes':[{'name':_0xcd91('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a07=['exports','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b8fc4,_0x215c68){var _0x3ac8b8=function(_0x333aed){while(--_0x333aed){_0x2b8fc4['push'](_0x2b8fc4['shift']());}};_0x3ac8b8(++_0x215c68);}(_0x5a07,0xcc));var _0x75a0=function(_0x21c954,_0x3d68f2){_0x21c954=_0x21c954-0x0;var _0x320a0b=_0x5a07[_0x21c954];return _0x320a0b;};'use strict';var _=require('lodash');var util=require(_0x75a0('0x0'));var logger=require(_0x75a0('0x1'))(_0x75a0('0x2'));var moment=require(_0x75a0('0x3'));var BPromise=require(_0x75a0('0x4'));var rp=require(_0x75a0('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x75a0('0x6')]=function(_0xd9ec1c,_0x47e12b){return _0xd9ec1c['define'](_0x75a0('0x7'),attributes,{'tableName':_0x75a0('0x8'),'paranoid':![],'indexes':[{'name':_0x75a0('0x9'),'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 ba01112..5d97c4a 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 _0x086f=['error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x373e44,_0xa660c){var _0x45fdf3=function(_0x21f603){while(--_0x21f603){_0x373e44['push'](_0x373e44['shift']());}};_0x45fdf3(++_0xa660c);}(_0x086f,0xfc));var _0xf086=function(_0x355766,_0x2ad307){_0x355766=_0x355766-0x0;var _0x522527=_0x086f[_0x355766];return _0x522527;};'use strict';var _=require(_0xf086('0x0'));var util=require('util');var moment=require(_0xf086('0x1'));var BPromise=require(_0xf086('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf086('0x3'));var db=require(_0xf086('0x4'))['db'];var utils=require(_0xf086('0x5'));var logger=require(_0xf086('0x6'))(_0xf086('0x7'));var config=require(_0xf086('0x8'));var jayson=require(_0xf086('0x9'));var client=jayson[_0xf086('0xa')][_0xf086('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x595c11,_0x54a12a,_0x8a70cc){return new BPromise(function(_0x4e2f81,_0x1a5979){return client[_0xf086('0xc')](_0x595c11,_0x8a70cc)[_0xf086('0xd')](function(_0x5dfce1){logger['info'](_0xf086('0xe'),_0x54a12a,_0xf086('0xf'));logger['debug'](_0xf086('0x10'),_0x54a12a,_0xf086('0xf'),JSON[_0xf086('0x11')](_0x5dfce1));if(_0x5dfce1[_0xf086('0x12')]){if(_0x5dfce1[_0xf086('0x12')][_0xf086('0x13')]===0x1f4){logger[_0xf086('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x54a12a,_0x5dfce1['error'][_0xf086('0x14')]);return _0x1a5979(_0x5dfce1[_0xf086('0x12')][_0xf086('0x14')]);}logger['error'](_0xf086('0xe'),_0x54a12a,_0x5dfce1[_0xf086('0x12')][_0xf086('0x14')]);return _0x4e2f81(_0x5dfce1[_0xf086('0x12')][_0xf086('0x14')]);}else{logger[_0xf086('0x15')](_0xf086('0xe'),_0x54a12a,_0xf086('0xf'));_0x4e2f81(_0x5dfce1[_0xf086('0x16')][_0xf086('0x14')]);}})[_0xf086('0x17')](function(_0x5cc37b){logger[_0xf086('0x12')](_0xf086('0xe'),_0x54a12a,_0x5cc37b);_0x1a5979(_0x5cc37b);});});}exports[_0xf086('0x18')]=function(_0x1ca959){var _0x1895a3=this;return new Promise(function(_0x159399,_0x2564f7){return db[_0xf086('0x19')]['update'](_0x1ca959[_0xf086('0x1a')],{'raw':_0x1ca959[_0xf086('0x1b')]?_0x1ca959[_0xf086('0x1b')][_0xf086('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca959[_0xf086('0x1b')]?_0x1ca959[_0xf086('0x1b')][_0xf086('0x1d')]||null:null,'attributes':_0x1ca959[_0xf086('0x1b')]?_0x1ca959[_0xf086('0x1b')][_0xf086('0x1e')]||null:null,'limit':_0x1ca959[_0xf086('0x1b')]?_0x1ca959[_0xf086('0x1b')]['limit']||null:null})[_0xf086('0xd')](function(_0x33f620){logger['info']('UpdateVoiceRecording',_0x1ca959);logger[_0xf086('0x1f')](_0xf086('0x18'),_0x1ca959,JSON[_0xf086('0x11')](_0x33f620));_0x159399(_0x33f620);})['catch'](function(_0x4284a3){logger['error'](_0xf086('0x18'),_0x4284a3[_0xf086('0x14')],_0x1ca959);_0x2564f7(_0x1895a3['error'](0x1f4,_0x4284a3[_0xf086('0x14')]));});});};exports[_0xf086('0x20')]=function(_0x5413c2){var _0x17a164=this;return new Promise(function(_0x33e23f,_0xffb069){var _0x58cfdd=require('../../components/encryptor');var _0x1a6aaa;return db[_0xf086('0x21')][_0xf086('0x22')]({'attributes':['id',_0xf086('0x23')],'where':{'id':0x1},'raw':!![]})[_0xf086('0xd')](function(_0x3f62d9){_0x1a6aaa=_0x3f62d9;return db[_0xf086('0x19')][_0xf086('0x24')](_0x5413c2[_0xf086('0x1a')]);})[_0xf086('0xd')](function(_0x57b145){if(_0x1a6aaa[_0xf086('0x23')]&&fs[_0xf086('0x25')](_0x57b145[_0xf086('0x26')])){var _0x489a74=util[_0xf086('0x27')](_0xf086('0x28'),_0x57b145[_0xf086('0x26')]);return _0x58cfdd[_0xf086('0x29')](_0x57b145['value'],_0x489a74,config[_0xf086('0x2a')][_0xf086('0x2b')])[_0xf086('0xd')](function(){fs[_0xf086('0x2c')](_0x57b145['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x57b145;});}return _0x57b145;})[_0xf086('0xd')](function(_0x519ef4){logger[_0xf086('0x15')](_0xf086('0x20'),_0x5413c2);logger['debug'](_0xf086('0x20'),_0x5413c2,JSON['stringify'](_0x519ef4));_0x33e23f(_0x519ef4);})[_0xf086('0x17')](function(_0x3d3a58){logger['error'](_0xf086('0x20'),_0x3d3a58['message'],_0x5413c2);_0xffb069(_0x17a164[_0xf086('0x12')](0x1f4,_0x3d3a58[_0xf086('0x14')]));});});}; \ No newline at end of file +var _0xf21e=['stringify','error','code','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','value','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x4e8f82,_0x2dd37b){var _0x4bfa00=function(_0x21818a){while(--_0x21818a){_0x4e8f82['push'](_0x4e8f82['shift']());}};_0x4bfa00(++_0x2dd37b);}(_0xf21e,0xb8));var _0xef21=function(_0x171457,_0x116663){_0x171457=_0x171457-0x0;var _0x387ed8=_0xf21e[_0x171457];return _0x387ed8;};'use strict';var _=require(_0xef21('0x0'));var util=require(_0xef21('0x1'));var moment=require('moment');var BPromise=require(_0xef21('0x2'));var rs=require(_0xef21('0x3'));var fs=require('fs');var Redis=require(_0xef21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef21('0x5'));var logger=require('../../config/logger')(_0xef21('0x6'));var config=require(_0xef21('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xef21('0x8')][_0xef21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bec8c,_0x55eccf,_0x5a67e4){return new BPromise(function(_0x7d3d51,_0x271662){return client[_0xef21('0xa')](_0x3bec8c,_0x5a67e4)[_0xef21('0xb')](function(_0x27c30c){logger[_0xef21('0xc')](_0xef21('0xd'),_0x55eccf,_0xef21('0xe'));logger['debug'](_0xef21('0xf'),_0x55eccf,_0xef21('0xe'),JSON[_0xef21('0x10')](_0x27c30c));if(_0x27c30c[_0xef21('0x11')]){if(_0x27c30c[_0xef21('0x11')][_0xef21('0x12')]===0x1f4){logger[_0xef21('0x11')](_0xef21('0xd'),_0x55eccf,_0x27c30c[_0xef21('0x11')][_0xef21('0x13')]);return _0x271662(_0x27c30c[_0xef21('0x11')][_0xef21('0x13')]);}logger[_0xef21('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x55eccf,_0x27c30c[_0xef21('0x11')][_0xef21('0x13')]);return _0x7d3d51(_0x27c30c[_0xef21('0x11')][_0xef21('0x13')]);}else{logger['info'](_0xef21('0xd'),_0x55eccf,_0xef21('0xe'));_0x7d3d51(_0x27c30c[_0xef21('0x14')][_0xef21('0x13')]);}})['catch'](function(_0xc05c96){logger[_0xef21('0x11')](_0xef21('0xd'),_0x55eccf,_0xc05c96);_0x271662(_0xc05c96);});});}exports[_0xef21('0x15')]=function(_0x368c1a){var _0x50033d=this;return new Promise(function(_0x3835a5,_0x54767c){return db[_0xef21('0x16')][_0xef21('0x17')](_0x368c1a[_0xef21('0x18')],{'raw':_0x368c1a[_0xef21('0x19')]?_0x368c1a[_0xef21('0x19')][_0xef21('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x368c1a[_0xef21('0x19')]?_0x368c1a[_0xef21('0x19')][_0xef21('0x1b')]||null:null,'attributes':_0x368c1a[_0xef21('0x19')]?_0x368c1a['options'][_0xef21('0x1c')]||null:null,'limit':_0x368c1a[_0xef21('0x19')]?_0x368c1a[_0xef21('0x19')]['limit']||null:null})[_0xef21('0xb')](function(_0x475c59){logger[_0xef21('0xc')]('UpdateVoiceRecording',_0x368c1a);logger[_0xef21('0x1d')](_0xef21('0x15'),_0x368c1a,JSON[_0xef21('0x10')](_0x475c59));_0x3835a5(_0x475c59);})[_0xef21('0x1e')](function(_0xb2c091){logger[_0xef21('0x11')](_0xef21('0x15'),_0xb2c091[_0xef21('0x13')],_0x368c1a);_0x54767c(_0x50033d[_0xef21('0x11')](0x1f4,_0xb2c091[_0xef21('0x13')]));});});};exports[_0xef21('0x1f')]=function(_0x12e5e6){var _0x2f7270=this;return new Promise(function(_0x517b86,_0x36849f){var _0x59556b=require('../../components/encryptor');var _0x1f9ecd;return db[_0xef21('0x20')][_0xef21('0x21')]({'attributes':['id',_0xef21('0x22')],'where':{'id':0x1},'raw':!![]})[_0xef21('0xb')](function(_0x2f91db){_0x1f9ecd=_0x2f91db;return db[_0xef21('0x16')]['create'](_0x12e5e6['body']);})['then'](function(_0x268f60){if(_0x1f9ecd[_0xef21('0x22')]&&fs['existsSync'](_0x268f60[_0xef21('0x23')])){var _0x35934e=util['format'](_0xef21('0x24'),_0x268f60[_0xef21('0x23')]);return _0x59556b[_0xef21('0x25')](_0x268f60['value'],_0x35934e,config['secrets']['recording'])[_0xef21('0xb')](function(){fs[_0xef21('0x26')](_0x268f60['value']);logger[_0xef21('0xc')](_0xef21('0x27'));return _0x268f60;});}return _0x268f60;})[_0xef21('0xb')](function(_0x3cc02d){logger[_0xef21('0xc')]('CreateVoiceRecording',_0x12e5e6);logger[_0xef21('0x1d')](_0xef21('0x1f'),_0x12e5e6,JSON[_0xef21('0x10')](_0x3cc02d));_0x517b86(_0x3cc02d);})[_0xef21('0x1e')](function(_0x40f5d5){logger[_0xef21('0x11')]('CreateVoiceRecording',_0x40f5d5[_0xef21('0x13')],_0x12e5e6);_0x36849f(_0x2f7270[_0xef21('0x11')](0x1f4,_0x40f5d5['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c632c54..7b4c596 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 _0xf3d6=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x30a6f7,_0x3fe8b9){var _0x56798f=function(_0x15d7df){while(--_0x15d7df){_0x30a6f7['push'](_0x30a6f7['shift']());}};_0x56798f(++_0x3fe8b9);}(_0xf3d6,0x1c9));var _0x6f3d=function(_0x385359,_0x325c57){_0x385359=_0x385359-0x0;var _0x2ea4dd=_0xf3d6[_0x385359];return _0x2ea4dd;};'use strict';var multer=require(_0x6f3d('0x0'));var util=require(_0x6f3d('0x1'));var path=require(_0x6f3d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f3d('0x3')]();var auth=require(_0x6f3d('0x4'));var interaction=require(_0x6f3d('0x5'));var config=require(_0x6f3d('0x6'));var controller=require(_0x6f3d('0x7'));router[_0x6f3d('0x8')]('/',auth[_0x6f3d('0x9')](),controller[_0x6f3d('0xa')]);router['get'](_0x6f3d('0xb'),auth['isAuthenticated'](),controller[_0x6f3d('0xc')]);router[_0x6f3d('0xd')]('/',auth[_0x6f3d('0x9')](),controller[_0x6f3d('0xe')]);router['put'](_0x6f3d('0xb'),auth['isAuthenticated'](),controller[_0x6f3d('0xf')]);router[_0x6f3d('0x10')](_0x6f3d('0xb'),auth[_0x6f3d('0x9')](),controller[_0x6f3d('0x11')]);module[_0x6f3d('0x12')]=router; \ No newline at end of file +var _0x8022=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','/:id','isAuthenticated','show','put','destroy','exports','multer','path','connect-timeout','express'];(function(_0x117ab1,_0x539834){var _0x3de653=function(_0x498a4f){while(--_0x498a4f){_0x117ab1['push'](_0x117ab1['shift']());}};_0x3de653(++_0x539834);}(_0x8022,0x15a));var _0x2802=function(_0x56c74e,_0x30f97f){_0x56c74e=_0x56c74e-0x0;var _0x4e4e35=_0x8022[_0x56c74e];return _0x4e4e35;};'use strict';var multer=require(_0x2802('0x0'));var util=require('util');var path=require(_0x2802('0x1'));var timeout=require(_0x2802('0x2'));var express=require(_0x2802('0x3'));var router=express['Router']();var auth=require(_0x2802('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2802('0x5'));var controller=require(_0x2802('0x6'));router[_0x2802('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2802('0x7')](_0x2802('0x8'),auth[_0x2802('0x9')](),controller[_0x2802('0xa')]);router['post']('/',auth[_0x2802('0x9')](),controller['create']);router[_0x2802('0xb')]('/:id',auth[_0x2802('0x9')](),controller['update']);router['delete'](_0x2802('0x8'),auth[_0x2802('0x9')](),controller[_0x2802('0xc')]);module[_0x2802('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0e27a72..1ea7f79 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 _0x3934=['moment','exports','ENUM','blind','attended','STRING'];(function(_0x2b972e,_0x5bd4ce){var _0x218e50=function(_0x1cae1a){while(--_0x1cae1a){_0x2b972e['push'](_0x2b972e['shift']());}};_0x218e50(++_0x5bd4ce);}(_0x3934,0x78));var _0x4393=function(_0x13fc7c,_0x10ae32){_0x13fc7c=_0x13fc7c-0x0;var _0x5bec3b=_0x3934[_0x13fc7c];return _0x5bec3b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4393('0x0'));module[_0x4393('0x1')]={'type':{'type':Sequelize[_0x4393('0x2')](_0x4393('0x3'),_0x4393('0x4'))},'result':{'type':Sequelize[_0x4393('0x5')]},'transfererchannel':{'type':Sequelize[_0x4393('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x4393('0x5')]},'transferercalleridname':{'type':Sequelize[_0x4393('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x4393('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4393('0x5')]},'transferercontext':{'type':Sequelize[_0x4393('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x4393('0x5')]},'transfereechannel':{'type':Sequelize[_0x4393('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x4393('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4393('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x4393('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x4393('0x5')]},'isexternal':{'type':Sequelize[_0x4393('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x4393('0x5')]},'extension':{'type':Sequelize[_0x4393('0x5')]}}; \ No newline at end of file +var _0x4281=['ENUM','blind','STRING','Yes','sequelize','moment'];(function(_0x3ff33a,_0x42e16e){var _0x57532c=function(_0x5197ac){while(--_0x5197ac){_0x3ff33a['push'](_0x3ff33a['shift']());}};_0x57532c(++_0x42e16e);}(_0x4281,0x1ea));var _0x1428=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x4281[_0x538c70];return _0x42ae01;};'use strict';var Sequelize=require(_0x1428('0x0'));var moment=require(_0x1428('0x1'));module['exports']={'type':{'type':Sequelize[_0x1428('0x2')](_0x1428('0x3'),'attended')},'result':{'type':Sequelize[_0x1428('0x4')]},'transfererchannel':{'type':Sequelize[_0x1428('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1428('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x1428('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1428('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x1428('0x4')]},'transferercontext':{'type':Sequelize[_0x1428('0x4')]},'transfererexten':{'type':Sequelize[_0x1428('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1428('0x4')]},'transfereechannel':{'type':Sequelize[_0x1428('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1428('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x1428('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x1428('0x4')]},'transfereeexten':{'type':Sequelize[_0x1428('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1428('0x4')]},'isexternal':{'type':Sequelize[_0x1428('0x2')](_0x1428('0x5'),'No')},'context':{'type':Sequelize[_0x1428('0x4')]},'extension':{'type':Sequelize[_0x1428('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 22fd63b..5c394b9 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 _0x41e5=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','VoiceTransferReport','then','rows','show','params','rawAttributes','intersection','includeAll','include','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','error','stack','send','index','model','keys','query','filters','fields','attributes'];(function(_0x2e375c,_0x5409fc){var _0x4ba738=function(_0x2a3bcc){while(--_0x2a3bcc){_0x2e375c['push'](_0x2e375c['shift']());}};_0x4ba738(++_0x5409fc);}(_0x41e5,0xe6));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x541e('0x0'));var jsonpatch=require(_0x541e('0x1'));var rp=require(_0x541e('0x2'));var moment=require('moment');var BPromise=require(_0x541e('0x3'));var Mustache=require(_0x541e('0x4'));var util=require('util');var path=require(_0x541e('0x5'));var sox=require(_0x541e('0x6'));var csv=require(_0x541e('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x541e('0x8'));var squel=require(_0x541e('0x9'));var crypto=require('crypto');var jsforce=require(_0x541e('0xa'));var deskjs=require(_0x541e('0xb'));var toCsv=require(_0x541e('0x7'));var querystring=require(_0x541e('0xc'));var Papa=require('papaparse');var authService=require(_0x541e('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x541e('0xe'));var qs=require(_0x541e('0xf'));var logger=require(_0x541e('0x10'))(_0x541e('0x11'));var utils=require(_0x541e('0x12'));var config=require(_0x541e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4871dc,_0xe0dde8){_0xe0dde8=_0xe0dde8||0xcc;return function(_0x8dc2e1){if(_0x8dc2e1){return _0x4871dc['sendStatus'](_0xe0dde8);}return _0x4871dc[_0x541e('0x14')](_0xe0dde8)[_0x541e('0x15')]();};}function respondWithResult(_0x3b66da,_0x2d1b59){_0x2d1b59=_0x2d1b59||0xc8;return function(_0x5f0b9b){if(_0x5f0b9b){return _0x3b66da[_0x541e('0x14')](_0x2d1b59)[_0x541e('0x16')](_0x5f0b9b);}};}function respondWithFilteredResult(_0x4c7feb,_0x102444){return function(_0x5ca327){if(_0x5ca327){var _0x1b5e95=_0x5ca327[_0x541e('0x17')],_0x22d7a6=_0x102444[_0x541e('0x18')],_0x3acf64=_0x102444[_0x541e('0x18')]+_0x102444[_0x541e('0x19')],_0x5298c7;if(_0x3acf64>=_0x1b5e95){_0x3acf64=_0x1b5e95;_0x5298c7=0xc8;}else{_0x5298c7=0xce;}_0x4c7feb['status'](_0x5298c7);return _0x4c7feb[_0x541e('0x1a')](_0x541e('0x1b'),_0x22d7a6+'-'+_0x3acf64+'/'+_0x1b5e95)['json'](_0x5ca327);}return null;};}function patchUpdates(_0x32db34){return function(_0x493c74){try{jsonpatch[_0x541e('0x1c')](_0x493c74,_0x32db34,!![]);}catch(_0x106245){return BPromise[_0x541e('0x1d')](_0x106245);}return _0x493c74[_0x541e('0x1e')]();};}function saveUpdates(_0x535ae9,_0xbe0862){return function(_0x5f263b){if(_0x5f263b){return _0x5f263b[_0x541e('0x1f')](_0x535ae9)['then'](function(_0x53059f){return _0x53059f;});}return null;};}function removeEntity(_0x3a2bc8,_0x140d18){return function(_0x5eb0a2){if(_0x5eb0a2){return _0x5eb0a2['destroy']()['then'](function(){_0x3a2bc8['status'](0xcc)[_0x541e('0x15')]();});}};}function handleEntityNotFound(_0x17ebb1,_0x5df07a){return function(_0x5ef514){if(!_0x5ef514){_0x17ebb1['sendStatus'](0x194);}return _0x5ef514;};}function handleError(_0x2e87a3,_0x5d8d9e){_0x5d8d9e=_0x5d8d9e||0x1f4;return function(_0x224d3e){logger[_0x541e('0x20')](_0x224d3e[_0x541e('0x21')]);if(_0x224d3e['name']){delete _0x224d3e['name'];}_0x2e87a3[_0x541e('0x14')](_0x5d8d9e)[_0x541e('0x22')](_0x224d3e);};}exports[_0x541e('0x23')]=function(_0xa6e4c2,_0x4f67c4){var _0x2d03e6={},_0x4c8322={},_0x434fd9={'count':0x0,'rows':[]};var _0x7506b9=db['VoiceTransferReport']['rawAttributes'];_0x4c8322[_0x541e('0x24')]=_[_0x541e('0x25')](_0x7506b9);_0x4c8322[_0x541e('0x26')]=_['keys'](_0xa6e4c2[_0x541e('0x26')]);_0x4c8322[_0x541e('0x27')]=_['intersection'](_0x4c8322[_0x541e('0x24')],_0x4c8322[_0x541e('0x26')]);_0x2d03e6['attributes']=_['intersection'](_0x4c8322[_0x541e('0x24')],qs[_0x541e('0x28')](_0xa6e4c2[_0x541e('0x26')]['fields']));_0x2d03e6[_0x541e('0x29')]=_0x2d03e6[_0x541e('0x29')][_0x541e('0x2a')]?_0x2d03e6[_0x541e('0x29')]:_0x4c8322[_0x541e('0x24')];if(!_0xa6e4c2[_0x541e('0x26')][_0x541e('0x2b')](_0x541e('0x2c'))){_0x2d03e6[_0x541e('0x19')]=qs[_0x541e('0x19')](_0xa6e4c2[_0x541e('0x26')][_0x541e('0x19')]);_0x2d03e6[_0x541e('0x18')]=qs[_0x541e('0x18')](_0xa6e4c2[_0x541e('0x26')][_0x541e('0x18')]);}_0x2d03e6[_0x541e('0x2d')]=qs[_0x541e('0x2e')](_0xa6e4c2[_0x541e('0x26')][_0x541e('0x2e')]);_0x2d03e6[_0x541e('0x2f')]=qs['filters'](_[_0x541e('0x30')](_0xa6e4c2[_0x541e('0x26')],_0x4c8322[_0x541e('0x27')]));if(_0xa6e4c2[_0x541e('0x26')][_0x541e('0x31')]){_0x2d03e6['where']=_[_0x541e('0x32')](_0x2d03e6[_0x541e('0x2f')],{'$or':_['map'](_0x7506b9,function(_0xe7617a){if(_0xe7617a['type'][_0x541e('0x33')]!==_0x541e('0x34')){var _0x40f517={};_0x40f517[_0xe7617a[_0x541e('0x35')]]={'$like':'%'+_0xa6e4c2[_0x541e('0x26')][_0x541e('0x31')]+'%'};return _0x40f517;}})});}_0x2d03e6=_[_0x541e('0x32')]({},_0x2d03e6,_0xa6e4c2[_0x541e('0x36')]);var _0x50162f={'where':_0x2d03e6[_0x541e('0x2f')]};return db[_0x541e('0x37')][_0x541e('0x17')](_0x50162f)[_0x541e('0x38')](function(_0x1ce578){_0x434fd9[_0x541e('0x17')]=_0x1ce578;if(_0xa6e4c2[_0x541e('0x26')]['includeAll']){_0x2d03e6['include']=[{'all':!![]}];}return db[_0x541e('0x37')]['findAll'](_0x2d03e6);})[_0x541e('0x38')](function(_0x38f96e){_0x434fd9[_0x541e('0x39')]=_0x38f96e;return _0x434fd9;})[_0x541e('0x38')](respondWithFilteredResult(_0x4f67c4,_0x2d03e6))['catch'](handleError(_0x4f67c4,null));};exports[_0x541e('0x3a')]=function(_0x2b3212,_0x26f23f){var _0xca84c4={'raw':!![],'where':{'id':_0x2b3212[_0x541e('0x3b')]['id']}},_0x45407a={};_0x45407a[_0x541e('0x24')]=_[_0x541e('0x25')](db[_0x541e('0x37')][_0x541e('0x3c')]);_0x45407a[_0x541e('0x26')]=_[_0x541e('0x25')](_0x2b3212[_0x541e('0x26')]);_0x45407a[_0x541e('0x27')]=_['intersection'](_0x45407a[_0x541e('0x24')],_0x45407a['query']);_0xca84c4[_0x541e('0x29')]=_[_0x541e('0x3d')](_0x45407a['model'],qs['fields'](_0x2b3212[_0x541e('0x26')][_0x541e('0x28')]));_0xca84c4['attributes']=_0xca84c4[_0x541e('0x29')][_0x541e('0x2a')]?_0xca84c4[_0x541e('0x29')]:_0x45407a['model'];if(_0x2b3212[_0x541e('0x26')][_0x541e('0x3e')]){_0xca84c4[_0x541e('0x3f')]=[{'all':!![]}];}_0xca84c4=_[_0x541e('0x32')]({},_0xca84c4,_0x2b3212['options']);return db['VoiceTransferReport']['find'](_0xca84c4)[_0x541e('0x38')](handleEntityNotFound(_0x26f23f,null))['then'](respondWithResult(_0x26f23f,null))[_0x541e('0x40')](handleError(_0x26f23f,null));};exports[_0x541e('0x41')]=function(_0x3049dd,_0x4e753b){return db[_0x541e('0x37')][_0x541e('0x41')](_0x3049dd[_0x541e('0x42')],{})[_0x541e('0x38')](respondWithResult(_0x4e753b,0xc9))['catch'](handleError(_0x4e753b,null));};exports[_0x541e('0x1f')]=function(_0x2c976e,_0x2ceb66){if(_0x2c976e[_0x541e('0x42')]['id']){delete _0x2c976e['body']['id'];}return db[_0x541e('0x37')]['find']({'where':{'id':_0x2c976e[_0x541e('0x3b')]['id']}})[_0x541e('0x38')](handleEntityNotFound(_0x2ceb66,null))[_0x541e('0x38')](saveUpdates(_0x2c976e[_0x541e('0x42')],null))[_0x541e('0x38')](respondWithResult(_0x2ceb66,null))[_0x541e('0x40')](handleError(_0x2ceb66,null));};exports[_0x541e('0x43')]=function(_0x53a3ff,_0x25ed66){return db['VoiceTransferReport']['find']({'where':{'id':_0x53a3ff[_0x541e('0x3b')]['id']}})[_0x541e('0x38')](handleEntityNotFound(_0x25ed66,null))[_0x541e('0x38')](removeEntity(_0x25ed66,null))[_0x541e('0x40')](handleError(_0x25ed66,null));}; \ No newline at end of file +var _0x4020=['path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceTransferReport','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1d5806,_0x378220){var _0x428dcc=function(_0x2b79b0){while(--_0x2b79b0){_0x1d5806['push'](_0x1d5806['shift']());}};_0x428dcc(++_0x378220);}(_0x4020,0x1f0));var _0x0402=function(_0x53f324,_0x350664){_0x53f324=_0x53f324-0x0;var _0x31d5eb=_0x4020[_0x53f324];return _0x31d5eb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0402('0x0'));var rimraf=require(_0x0402('0x1'));var zipdir=require(_0x0402('0x2'));var jsonpatch=require(_0x0402('0x3'));var rp=require(_0x0402('0x4'));var moment=require(_0x0402('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0402('0x6'));var util=require(_0x0402('0x7'));var path=require(_0x0402('0x8'));var sox=require(_0x0402('0x9'));var csv=require('to-csv');var ejs=require(_0x0402('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0402('0xb'));var crypto=require(_0x0402('0xc'));var jsforce=require(_0x0402('0xd'));var deskjs=require(_0x0402('0xe'));var toCsv=require(_0x0402('0xf'));var querystring=require(_0x0402('0x10'));var Papa=require(_0x0402('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0402('0x12'))(_0x0402('0x13'));var utils=require(_0x0402('0x14'));var config=require('../../config/environment');var db=require(_0x0402('0x15'))['db'];function respondWithStatusCode(_0x1bd95f,_0x4fdb0a){_0x4fdb0a=_0x4fdb0a||0xcc;return function(_0x18c306){if(_0x18c306){return _0x1bd95f['sendStatus'](_0x4fdb0a);}return _0x1bd95f[_0x0402('0x16')](_0x4fdb0a)[_0x0402('0x17')]();};}function respondWithResult(_0x5574b3,_0xc2e5bf){_0xc2e5bf=_0xc2e5bf||0xc8;return function(_0x907f68){if(_0x907f68){return _0x5574b3['status'](_0xc2e5bf)[_0x0402('0x18')](_0x907f68);}};}function respondWithFilteredResult(_0x36b2eb,_0x5c3433){return function(_0x5dcc83){if(_0x5dcc83){var _0x59000d=_0x5dcc83[_0x0402('0x19')],_0x35a529=_0x5c3433['offset'],_0x587f9c=_0x5c3433[_0x0402('0x1a')]+_0x5c3433[_0x0402('0x1b')],_0x1cb21b;if(_0x587f9c>=_0x59000d){_0x587f9c=_0x59000d;_0x1cb21b=0xc8;}else{_0x1cb21b=0xce;}_0x36b2eb[_0x0402('0x16')](_0x1cb21b);return _0x36b2eb[_0x0402('0x1c')](_0x0402('0x1d'),_0x35a529+'-'+_0x587f9c+'/'+_0x59000d)[_0x0402('0x18')](_0x5dcc83);}return null;};}function patchUpdates(_0x3a9b78){return function(_0x5ca6dc){try{jsonpatch[_0x0402('0x1e')](_0x5ca6dc,_0x3a9b78,!![]);}catch(_0x5f200d){return BPromise['reject'](_0x5f200d);}return _0x5ca6dc[_0x0402('0x1f')]();};}function saveUpdates(_0xfe79fb,_0x61babe){return function(_0x27c48f){if(_0x27c48f){return _0x27c48f[_0x0402('0x20')](_0xfe79fb)[_0x0402('0x21')](function(_0x5caae1){return _0x5caae1;});}return null;};}function removeEntity(_0x2baf0d,_0xc2cbd7){return function(_0x183a9f){if(_0x183a9f){return _0x183a9f[_0x0402('0x22')]()['then'](function(){_0x2baf0d[_0x0402('0x16')](0xcc)[_0x0402('0x17')]();});}};}function handleEntityNotFound(_0x48525f,_0x4f1b4d){return function(_0x49411b){if(!_0x49411b){_0x48525f[_0x0402('0x23')](0x194);}return _0x49411b;};}function handleError(_0x23d953,_0x429fb4){_0x429fb4=_0x429fb4||0x1f4;return function(_0x3d02bb){logger[_0x0402('0x24')](_0x3d02bb[_0x0402('0x25')]);if(_0x3d02bb[_0x0402('0x26')]){delete _0x3d02bb[_0x0402('0x26')];}_0x23d953[_0x0402('0x16')](_0x429fb4)[_0x0402('0x27')](_0x3d02bb);};}exports[_0x0402('0x28')]=function(_0x4b3751,_0x95f5e1){var _0x33c9fb={},_0x5e10b9={},_0x894862={'count':0x0,'rows':[]};var _0x341231=db[_0x0402('0x29')]['rawAttributes'];_0x5e10b9[_0x0402('0x2a')]=_['keys'](_0x341231);_0x5e10b9['query']=_[_0x0402('0x2b')](_0x4b3751[_0x0402('0x2c')]);_0x5e10b9['filters']=_[_0x0402('0x2d')](_0x5e10b9[_0x0402('0x2a')],_0x5e10b9[_0x0402('0x2c')]);_0x33c9fb[_0x0402('0x2e')]=_[_0x0402('0x2d')](_0x5e10b9['model'],qs[_0x0402('0x2f')](_0x4b3751[_0x0402('0x2c')]['fields']));_0x33c9fb[_0x0402('0x2e')]=_0x33c9fb[_0x0402('0x2e')][_0x0402('0x30')]?_0x33c9fb[_0x0402('0x2e')]:_0x5e10b9[_0x0402('0x2a')];if(!_0x4b3751[_0x0402('0x2c')][_0x0402('0x31')](_0x0402('0x32'))){_0x33c9fb[_0x0402('0x1b')]=qs[_0x0402('0x1b')](_0x4b3751['query'][_0x0402('0x1b')]);_0x33c9fb[_0x0402('0x1a')]=qs[_0x0402('0x1a')](_0x4b3751[_0x0402('0x2c')]['offset']);}_0x33c9fb[_0x0402('0x33')]=qs[_0x0402('0x34')](_0x4b3751['query']['sort']);_0x33c9fb['where']=qs[_0x0402('0x35')](_[_0x0402('0x36')](_0x4b3751['query'],_0x5e10b9['filters']));if(_0x4b3751[_0x0402('0x2c')][_0x0402('0x37')]){_0x33c9fb[_0x0402('0x38')]=_[_0x0402('0x39')](_0x33c9fb[_0x0402('0x38')],{'$or':_[_0x0402('0x3a')](_0x341231,function(_0x35093d){if(_0x35093d['type'][_0x0402('0x3b')]!==_0x0402('0x3c')){var _0xa1ec53={};_0xa1ec53[_0x35093d['field']]={'$like':'%'+_0x4b3751[_0x0402('0x2c')][_0x0402('0x37')]+'%'};return _0xa1ec53;}})});}_0x33c9fb=_['merge']({},_0x33c9fb,_0x4b3751[_0x0402('0x3d')]);var _0x4c04b4={'where':_0x33c9fb[_0x0402('0x38')]};return db['VoiceTransferReport'][_0x0402('0x19')](_0x4c04b4)['then'](function(_0x23ee24){_0x894862[_0x0402('0x19')]=_0x23ee24;if(_0x4b3751[_0x0402('0x2c')][_0x0402('0x3e')]){_0x33c9fb[_0x0402('0x3f')]=[{'all':!![]}];}return db[_0x0402('0x29')][_0x0402('0x40')](_0x33c9fb);})['then'](function(_0x58a954){_0x894862[_0x0402('0x41')]=_0x58a954;return _0x894862;})[_0x0402('0x21')](respondWithFilteredResult(_0x95f5e1,_0x33c9fb))[_0x0402('0x42')](handleError(_0x95f5e1,null));};exports[_0x0402('0x43')]=function(_0x48b8ac,_0x5c4b79){var _0x51e3a0={'raw':!![],'where':{'id':_0x48b8ac[_0x0402('0x44')]['id']}},_0x710918={};_0x710918[_0x0402('0x2a')]=_['keys'](db[_0x0402('0x29')]['rawAttributes']);_0x710918[_0x0402('0x2c')]=_[_0x0402('0x2b')](_0x48b8ac[_0x0402('0x2c')]);_0x710918[_0x0402('0x35')]=_['intersection'](_0x710918[_0x0402('0x2a')],_0x710918[_0x0402('0x2c')]);_0x51e3a0['attributes']=_[_0x0402('0x2d')](_0x710918[_0x0402('0x2a')],qs[_0x0402('0x2f')](_0x48b8ac[_0x0402('0x2c')][_0x0402('0x2f')]));_0x51e3a0[_0x0402('0x2e')]=_0x51e3a0[_0x0402('0x2e')][_0x0402('0x30')]?_0x51e3a0[_0x0402('0x2e')]:_0x710918[_0x0402('0x2a')];if(_0x48b8ac[_0x0402('0x2c')]['includeAll']){_0x51e3a0[_0x0402('0x3f')]=[{'all':!![]}];}_0x51e3a0=_[_0x0402('0x39')]({},_0x51e3a0,_0x48b8ac['options']);return db[_0x0402('0x29')][_0x0402('0x45')](_0x51e3a0)[_0x0402('0x21')](handleEntityNotFound(_0x5c4b79,null))[_0x0402('0x21')](respondWithResult(_0x5c4b79,null))[_0x0402('0x42')](handleError(_0x5c4b79,null));};exports[_0x0402('0x46')]=function(_0x1f2a67,_0x153588){return db[_0x0402('0x29')][_0x0402('0x46')](_0x1f2a67[_0x0402('0x47')],{})[_0x0402('0x21')](respondWithResult(_0x153588,0xc9))[_0x0402('0x42')](handleError(_0x153588,null));};exports[_0x0402('0x20')]=function(_0x6005ba,_0x2a241e){if(_0x6005ba['body']['id']){delete _0x6005ba[_0x0402('0x47')]['id'];}return db[_0x0402('0x29')][_0x0402('0x45')]({'where':{'id':_0x6005ba['params']['id']}})[_0x0402('0x21')](handleEntityNotFound(_0x2a241e,null))['then'](saveUpdates(_0x6005ba['body'],null))[_0x0402('0x21')](respondWithResult(_0x2a241e,null))[_0x0402('0x42')](handleError(_0x2a241e,null));};exports[_0x0402('0x22')]=function(_0xb0e03f,_0x2b3d31){return db['VoiceTransferReport'][_0x0402('0x45')]({'where':{'id':_0xb0e03f[_0x0402('0x44')]['id']}})[_0x0402('0x21')](handleEntityNotFound(_0x2b3d31,null))[_0x0402('0x21')](removeEntity(_0x2b3d31,null))[_0x0402('0x42')](handleError(_0x2b3d31,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 5c3d2e8..c165e13 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 _0x82d0=['bluebird','request-promise','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment'];(function(_0x526e7a,_0x7d1318){var _0x267756=function(_0x5470f4){while(--_0x5470f4){_0x526e7a['push'](_0x526e7a['shift']());}};_0x267756(++_0x7d1318);}(_0x82d0,0x74));var _0x082d=function(_0x4b2069,_0x46d675){_0x4b2069=_0x4b2069-0x0;var _0x2a2ae5=_0x82d0[_0x4b2069];return _0x2a2ae5;};'use strict';var _=require(_0x082d('0x0'));var util=require(_0x082d('0x1'));var logger=require(_0x082d('0x2'))('api');var moment=require(_0x082d('0x3'));var BPromise=require(_0x082d('0x4'));var rp=require(_0x082d('0x5'));var attributes=require(_0x082d('0x6'));module['exports']=function(_0x52aa0b,_0x24d125){return _0x52aa0b[_0x082d('0x7')](_0x082d('0x8'),attributes,{'tableName':_0x082d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb3c=['moment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeb3c,0x155));var _0xceb3=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xeb3c[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xceb3('0x0'));var util=require('util');var logger=require(_0xceb3('0x1'))('api');var moment=require(_0xceb3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xceb3('0x3'));module[_0xceb3('0x4')]=function(_0x424a89,_0x534c7c){return _0x424a89[_0xceb3('0x5')](_0xceb3('0x6'),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 bd106fe..35405fa 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 _0xfbe7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x518b3e,_0x571e0f){var _0x5296b0=function(_0x4a7d2e){while(--_0x4a7d2e){_0x518b3e['push'](_0x518b3e['shift']());}};_0x5296b0(++_0x571e0f);}(_0xfbe7,0x1ab));var _0x7fbe=function(_0x7ba1c3,_0x3dd545){_0x7ba1c3=_0x7ba1c3-0x0;var _0x82b393=_0xfbe7[_0x7ba1c3];return _0x82b393;};'use strict';var _=require(_0x7fbe('0x0'));var util=require(_0x7fbe('0x1'));var moment=require(_0x7fbe('0x2'));var BPromise=require(_0x7fbe('0x3'));var rs=require(_0x7fbe('0x4'));var fs=require('fs');var Redis=require(_0x7fbe('0x5'));var db=require(_0x7fbe('0x6'))['db'];var utils=require(_0x7fbe('0x7'));var logger=require(_0x7fbe('0x8'))(_0x7fbe('0x9'));var config=require(_0x7fbe('0xa'));var jayson=require(_0x7fbe('0xb'));var client=jayson[_0x7fbe('0xc')][_0x7fbe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xb130fc,_0x5937f3,_0x43a608){return new BPromise(function(_0x5ea769,_0x20f359){return client[_0x7fbe('0xe')](_0xb130fc,_0x43a608)[_0x7fbe('0xf')](function(_0x4dec49){logger[_0x7fbe('0x10')](_0x7fbe('0x11'),_0x5937f3,'request\x20sent');logger['debug'](_0x7fbe('0x12'),_0x5937f3,_0x7fbe('0x13'),JSON[_0x7fbe('0x14')](_0x4dec49));if(_0x4dec49['error']){if(_0x4dec49[_0x7fbe('0x15')][_0x7fbe('0x16')]===0x1f4){logger[_0x7fbe('0x15')](_0x7fbe('0x11'),_0x5937f3,_0x4dec49['error']['message']);return _0x20f359(_0x4dec49['error']['message']);}logger[_0x7fbe('0x15')](_0x7fbe('0x11'),_0x5937f3,_0x4dec49[_0x7fbe('0x15')][_0x7fbe('0x17')]);return _0x5ea769(_0x4dec49[_0x7fbe('0x15')][_0x7fbe('0x17')]);}else{logger[_0x7fbe('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x5937f3,'request\x20sent');_0x5ea769(_0x4dec49[_0x7fbe('0x18')][_0x7fbe('0x17')]);}})[_0x7fbe('0x19')](function(_0x4ac0d7){logger[_0x7fbe('0x15')](_0x7fbe('0x11'),_0x5937f3,_0x4ac0d7);_0x20f359(_0x4ac0d7);});});}exports['CreateVoiceTransferReport']=function(_0x10d16c){var _0x296f72=this;return new Promise(function(_0x3a1526,_0x30c1ee){return db[_0x7fbe('0x1a')]['create'](_0x10d16c[_0x7fbe('0x1b')],{'raw':_0x10d16c[_0x7fbe('0x1c')]?_0x10d16c[_0x7fbe('0x1c')][_0x7fbe('0x1d')]===undefined?!![]:![]:!![]})[_0x7fbe('0xf')](function(_0x4f4217){logger[_0x7fbe('0x10')](_0x7fbe('0x1e'),_0x10d16c);logger['debug'](_0x7fbe('0x1e'),_0x10d16c,JSON[_0x7fbe('0x14')](_0x4f4217));_0x3a1526(_0x4f4217);})[_0x7fbe('0x19')](function(_0x5a7c88){logger[_0x7fbe('0x15')](_0x7fbe('0x1e'),_0x5a7c88['message'],_0x10d16c);_0x30c1ee(_0x296f72[_0x7fbe('0x15')](0x1f4,_0x5a7c88['message']));});});}; \ No newline at end of file +var _0xb852=['stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb852,0x75));var _0x2b85=function(_0x17c354,_0x34d416){_0x17c354=_0x17c354-0x0;var _0x302277=_0xb852[_0x17c354];return _0x302277;};'use strict';var _=require('lodash');var util=require(_0x2b85('0x0'));var moment=require('moment');var BPromise=require(_0x2b85('0x1'));var rs=require(_0x2b85('0x2'));var fs=require('fs');var Redis=require(_0x2b85('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b85('0x4'));var logger=require(_0x2b85('0x5'))(_0x2b85('0x6'));var config=require(_0x2b85('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b85('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x231ea2,_0x40de2d,_0x1b2c49){return new BPromise(function(_0x46f3b6,_0xe41f31){return client['request'](_0x231ea2,_0x1b2c49)[_0x2b85('0x9')](function(_0x42b734){logger[_0x2b85('0xa')](_0x2b85('0xb'),_0x40de2d,_0x2b85('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x40de2d,'request\x20sent',JSON[_0x2b85('0xd')](_0x42b734));if(_0x42b734[_0x2b85('0xe')]){if(_0x42b734['error'][_0x2b85('0xf')]===0x1f4){logger[_0x2b85('0xe')](_0x2b85('0xb'),_0x40de2d,_0x42b734[_0x2b85('0xe')][_0x2b85('0x10')]);return _0xe41f31(_0x42b734['error']['message']);}logger[_0x2b85('0xe')](_0x2b85('0xb'),_0x40de2d,_0x42b734[_0x2b85('0xe')][_0x2b85('0x10')]);return _0x46f3b6(_0x42b734['error'][_0x2b85('0x10')]);}else{logger[_0x2b85('0xa')](_0x2b85('0xb'),_0x40de2d,'request\x20sent');_0x46f3b6(_0x42b734[_0x2b85('0x11')][_0x2b85('0x10')]);}})['catch'](function(_0x3fdbe2){logger[_0x2b85('0xe')](_0x2b85('0xb'),_0x40de2d,_0x3fdbe2);_0xe41f31(_0x3fdbe2);});});}exports[_0x2b85('0x12')]=function(_0x3a06a0){var _0x2810d7=this;return new Promise(function(_0xb764,_0x21c5cf){return db[_0x2b85('0x13')][_0x2b85('0x14')](_0x3a06a0[_0x2b85('0x15')],{'raw':_0x3a06a0[_0x2b85('0x16')]?_0x3a06a0['options'][_0x2b85('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x568e48){logger[_0x2b85('0xa')](_0x2b85('0x12'),_0x3a06a0);logger[_0x2b85('0x18')]('CreateVoiceTransferReport',_0x3a06a0,JSON[_0x2b85('0xd')](_0x568e48));_0xb764(_0x568e48);})[_0x2b85('0x19')](function(_0x8eb3c2){logger[_0x2b85('0xe')]('CreateVoiceTransferReport',_0x8eb3c2['message'],_0x3a06a0);_0x21c5cf(_0x2810d7[_0x2b85('0xe')](0x1f4,_0x8eb3c2[_0x2b85('0x10')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index b12a684..f2bf089 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5b0=['join','None','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize','sync','then','info','start','Online\x20apps:','filter','online','name'];(function(_0x45f5df,_0x3b4325){var _0x81465d=function(_0x3ee6e4){while(--_0x3ee6e4){_0x45f5df['push'](_0x45f5df['shift']());}};_0x81465d(++_0x3b4325);}(_0xd5b0,0x1cf));var _0x0d5b=function(_0x52cbfe,_0x117f0e){_0x52cbfe=_0x52cbfe-0x0;var _0x431a22=_0xd5b0[_0x52cbfe];return _0x431a22;};'use strict';var _=require(_0x0d5b('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x0d5b('0x1'));var config=require(_0x0d5b('0x2'));var logger=require(_0x0d5b('0x3'))(_0x0d5b('0x4'));var pm2=require(_0x0d5b('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x0d5b('0x6'));var chat=require(_0x0d5b('0x7'));function main(){return mysqldb['db'][_0x0d5b('0x8')][_0x0d5b('0x9')]()[_0x0d5b('0xa')](function(){return rpc['listen']();})['then'](function(_0x5dd007){logger[_0x0d5b('0xb')](_0x5dd007);return chat['start']();})[_0x0d5b('0xa')](function(){return schedule[_0x0d5b('0xc')]();})[_0x0d5b('0xa')](function(_0x4f1e3e){logger[_0x0d5b('0xb')](_0x4f1e3e);return pm2[_0x0d5b('0xc')](pm2Config);})[_0x0d5b('0xa')](function(_0x5232db){logger[_0x0d5b('0xb')](_0x0d5b('0xd'),_['map'](_[_0x0d5b('0xe')](_0x5232db,{'status':_0x0d5b('0xf')}),_0x0d5b('0x10'))[_0x0d5b('0x11')]());logger[_0x0d5b('0xb')]('Offline\x20apps:',_['map'](_[_0x0d5b('0xe')](_0x5232db,function(_0x3eae87){return _0x3eae87['status']!=='online';}),_0x0d5b('0x10'))[_0x0d5b('0x11')]()||_0x0d5b('0x12'));config['seedDB']&&require(_0x0d5b('0x13'))[_0x0d5b('0x14')]();require('./config/license')['default']();})['catch'](function(_0x5cdcd4){logger[_0x0d5b('0x15')](_0x0d5b('0x16'),_0x5cdcd4);process[_0x0d5b('0x17')](0x1);});}main(); \ No newline at end of file +var _0xc2c7=['./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sync','then','listen','start','info','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','default','./config/license','catch','error','exit'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1f9f33,_0xb8f70f){_0x1f9f33=_0x1f9f33-0x0;var _0x5ea17d=_0xc2c7[_0x1f9f33];return _0x5ea17d;};'use strict';var _=require('lodash');var mysqldb=require(_0x7c2c('0x0'));var rpc=require(_0x7c2c('0x1'));var config=require(_0x7c2c('0x2'));var logger=require(_0x7c2c('0x3'))(_0x7c2c('0x4'));var pm2=require(_0x7c2c('0x5'));var pm2Config=require(_0x7c2c('0x6'));var schedule=require(_0x7c2c('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0x7c2c('0x8')]()[_0x7c2c('0x9')](function(){return rpc[_0x7c2c('0xa')]();})['then'](function(_0x4abe93){logger['info'](_0x4abe93);return chat[_0x7c2c('0xb')]();})[_0x7c2c('0x9')](function(){return schedule[_0x7c2c('0xb')]();})[_0x7c2c('0x9')](function(_0x279cff){logger['info'](_0x279cff);return pm2[_0x7c2c('0xb')](pm2Config);})[_0x7c2c('0x9')](function(_0x285ff6){logger[_0x7c2c('0xc')](_0x7c2c('0xd'),_[_0x7c2c('0xe')](_[_0x7c2c('0xf')](_0x285ff6,{'status':_0x7c2c('0x10')}),_0x7c2c('0x11'))[_0x7c2c('0x12')]());logger[_0x7c2c('0xc')](_0x7c2c('0x13'),_[_0x7c2c('0xe')](_[_0x7c2c('0xf')](_0x285ff6,function(_0x177f14){return _0x177f14[_0x7c2c('0x14')]!=='online';}),'name')[_0x7c2c('0x12')]()||_0x7c2c('0x15'));config[_0x7c2c('0x16')]&&require('./config/seedDB')[_0x7c2c('0x17')]();require(_0x7c2c('0x18'))['default']();})[_0x7c2c('0x19')](function(_0x5a5fe2){logger[_0x7c2c('0x1a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5a5fe2);process[_0x7c2c('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index b34892a..4ec4450 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 _0x614a=['session','role','fullname','name','internal','userpic','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','isChatInteractionAuthorized','use','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','startsWith','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','user','Bearer','query','apikey','verify','secrets','getUuid','sub','apiKeyNonce','nonce','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','update','Forbidden','canUpdate','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.user','pick','redirect','/dashboards/general','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','ipaddr.js'];(function(_0x5c4ca2,_0x295fee){var _0x47c971=function(_0x12c38e){while(--_0x12c38e){_0x5c4ca2['push'](_0x5c4ca2['shift']());}};_0x47c971(++_0x295fee);}(_0x614a,0x197));var _0xa614=function(_0x344afe,_0x1f48e9){_0x344afe=_0x344afe-0x0;var _0x3b0e32=_0x614a[_0x344afe];return _0x3b0e32;};'use strict';var db=require(_0xa614('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xa614('0x1'));var _=require(_0xa614('0x2'));var jwt=require(_0xa614('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa614('0x4'));var basicAuth=require(_0xa614('0x5'));var crypto=require(_0xa614('0x6'));var ipaddr=require(_0xa614('0x7'));var validateJwt=expressJwt({'secret':config['secrets'][_0xa614('0x8')]});var userAttributes=['id',_0xa614('0x9'),_0xa614('0xa'),_0xa614('0xb'),_0xa614('0xc'),'email',_0xa614('0xd'),'permissions','voicePause',_0xa614('0xe'),'mailPause',_0xa614('0xf'),_0xa614('0x10'),_0xa614('0x11'),_0xa614('0x12'),_0xa614('0x13'),_0xa614('0x14'),_0xa614('0x15'),'interface','userProfileId'];exports[_0xa614('0x16')]=function(){return isAuthenticated(!![])[_0xa614('0x17')](function(_0x3b7aed,_0x3ae560,_0x3702f5){if(_0x3b7aed['user']){_0x3702f5();}else{return db[_0xa614('0x18')][_0xa614('0x19')]({'where':{'id':_0x3b7aed['params']['id']},'attributes':['id',_0xa614('0x1a'),_0xa614('0x1b')],'raw':!![]})[_0xa614('0x1c')](function(_0x27a33){if(_0x27a33&&_0x27a33[_0xa614('0x1a')]){return _0x3ae560['status'](_0x27a33[_0xa614('0x1b')]===_0xa614('0x1d')?0x195:0x193)[_0xa614('0x1e')]({'message':_0x27a33['disposition']==='unmanaged'?_0xa614('0x1f'):_0xa614('0x20')});}else{_0x3702f5();}})[_0xa614('0x21')](function(_0x52d624){_0x3702f5(_0x52d624);});}});};function isAuthenticated(_0x156b34){return compose()['use'](function(_0x13f346,_0x4303d4,_0x8a28b1){if(_0x13f346['headers']['authorization']){if(_[_0xa614('0x22')](_0x13f346[_0xa614('0x23')][_0xa614('0x24')],_0xa614('0x25'))){var _0x271d97=basicAuth(_0x13f346);db[_0xa614('0x26')][_0xa614('0x27')]({'where':{'name':_0x271d97['name']}})['then'](function(_0x585890){if(!_0x585890||!_0x585890['authenticate'](_0x271d97[_0xa614('0x28')])){return _0x4303d4[_0xa614('0x29')](0x191)[_0xa614('0x1e')]({'message':_0xa614('0x2a')});}_0x13f346[_0xa614('0x2b')]={'id':_0x585890['id']};_0x8a28b1();})[_0xa614('0x21')](function(_0x1506e2){_0x8a28b1(_0x1506e2);});}else if(_[_0xa614('0x22')](_0x13f346[_0xa614('0x23')][_0xa614('0x24')],_0xa614('0x2c'))){validateJwt(_0x13f346,_0x4303d4,_0x8a28b1);}else{if(_0x156b34){_0x8a28b1();}else{return _0x4303d4[_0xa614('0x29')](0x193)[_0xa614('0x1e')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x13f346[_0xa614('0x2d')][_0xa614('0x2e')]){try{var _0x2fcbe1=jwt[_0xa614('0x2f')](_0x13f346['query']['apikey'],config[_0xa614('0x30')]['session'],{'audience':hardwareConf[_0xa614('0x31')](),'issuer':hardwareConf['getUuid']()});db[_0xa614('0x26')][_0xa614('0x27')]({'where':{'id':_0x2fcbe1[_0xa614('0x32')]}})[_0xa614('0x1c')](function(_0x594921){if(!_0x594921||!_['isEqual'](_0x594921[_0xa614('0x33')],_0x2fcbe1[_0xa614('0x34')])){return _0x4303d4[_0xa614('0x29')](0x193)[_0xa614('0x1e')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x13f346[_0xa614('0x2b')]={'id':_0x594921['id']};_0x8a28b1();})['catch'](function(_0x46c29f){_0x8a28b1(_0x46c29f);});}catch(_0x13f10d){console[_0xa614('0x35')](_0x13f10d);return _0x4303d4['status'](0x193)[_0xa614('0x1e')]({'message':_0xa614('0x36')});}}else if(_0x156b34){_0x8a28b1();}else{return _0x4303d4[_0xa614('0x29')](0x193)[_0xa614('0x1e')]({'message':'Unknown\x20authorization\x20format'});}})[_0xa614('0x17')](function(_0x2ece29,_0x1bd669,_0x3b73b4){if(_0x2ece29[_0xa614('0x2b')]){db['User'][_0xa614('0x27')]({'where':{'id':_0x2ece29[_0xa614('0x2b')]['id']},'attributes':userAttributes})[_0xa614('0x1c')](function(_0x1aeaa1){if(!_0x1aeaa1){return _0x1bd669[_0xa614('0x29')](0x194)[_0xa614('0x1e')]({'message':_0xa614('0x37')});}_0x2ece29['user']=_0x1aeaa1;_0x3b73b4();})[_0xa614('0x21')](function(_0x2795ea){_0x3b73b4(_0x2795ea);});}else if(_0x156b34){_0x3b73b4();}else{return _0x1bd669[_0xa614('0x29')](0x194)['json']({'message':_0xa614('0x38')});}});}exports[_0xa614('0x39')]=isAuthenticated;function canUpdate(){return compose()[_0xa614('0x17')](function(_0x246b9a,_0x21b72d,_0xe502f){return require(_0xa614('0x3a'))['getLicense']()['then'](function(_0x6a3050){if(_0x6a3050[_0xa614('0x3b')]){_0xe502f();}else{return _0x21b72d[_0xa614('0x29')](0x193)[_0xa614('0x1e')]({'message':_0xa614('0x3c')});}})[_0xa614('0x21')](function(_0x297519){_0xe502f(_0x297519);});});}exports[_0xa614('0x3d')]=canUpdate;function signToken(_0x71f399,_0x5d2f6f){return jwt['sign']({'id':_0x71f399,'role':_0x5d2f6f},config[_0xa614('0x30')][_0xa614('0x8')],{'expiresIn':0x15180});}exports['signToken']=signToken;exports[_0xa614('0x3e')]=function(_0x2c0327){if(!_0x2c0327){throw new Error(_0xa614('0x3f'));}return compose()[_0xa614('0x17')](isAuthenticated())[_0xa614('0x17')](function meetsRequirements(_0x499aa6,_0x3a9e3a,_0x44395b){if(config[_0xa614('0x40')]['indexOf'](_0x499aa6[_0xa614('0x2b')][_0xa614('0x9')])>=config[_0xa614('0x40')][_0xa614('0x41')](_0x2c0327)){return _0x44395b();}else{return _0x3a9e3a[_0xa614('0x29')](0x193)['json']({'message':_0xa614('0x3c')});}});};exports[_0xa614('0x42')]=function(_0x48edc3,_0x4d9884){if(!_0x48edc3[_0xa614('0x2b')]){return _0x4d9884[_0xa614('0x29')](0x194)[_0xa614('0x1e')]({'message':_0xa614('0x43')});}var _0x2dad18=signToken(_0x48edc3[_0xa614('0x2b')]['id'],_0x48edc3['user']['role']);_0x4d9884[_0xa614('0x44')]('motion.token',_0x2dad18);_0x4d9884[_0xa614('0x44')](_0xa614('0x45'),JSON['stringify'](_[_0xa614('0x46')](_0x48edc3[_0xa614('0x2b')],userAttributes)));_0x4d9884[_0xa614('0x47')](_0xa614('0x48'));};exports['retrieveApiKey']=function(_0x40812d){if(_['isNil'](_0x40812d[_0xa614('0x33')])||_[_0xa614('0x49')](_0x40812d[_0xa614('0x4a')]))return null;else return createJwt(_0x40812d);};exports[_0xa614('0x4b')]=function(_0x4a8d5d){_0x4a8d5d[_0xa614('0x33')]=crypto[_0xa614('0x4c')](0x10)[_0xa614('0x4d')](_0xa614('0x4e'));_0x4a8d5d['apiKeyIat']=Math[_0xa614('0x4f')](Date['now']()/0x3e8)[_0xa614('0x4d')]();return createJwt(_0x4a8d5d);};exports[_0xa614('0x50')]=function(_0x36230e,_0x2dd818){if(_0x36230e[_0xa614('0x2d')][_0xa614('0x2e')]){jwt[_0xa614('0x2f')](_0x36230e[_0xa614('0x2d')][_0xa614('0x2e')],config[_0xa614('0x30')][_0xa614('0x8')],{'nonce':_0x2dd818[_0xa614('0x33')],'iat':_0x2dd818[_0xa614('0x4a')],'audience':hardwareConf[_0xa614('0x31')](),'issuer':hardwareConf[_0xa614('0x31')]()});return generateApiKey(_0x2dd818);}else{throw{'message':_0xa614('0x51')};}};function createJwt(_0x38cdde){return jwt['sign']({'iat':_0x38cdde[_0xa614('0x4a')],'nonce':_0x38cdde['apiKeyNonce']},config[_0xa614('0x30')][_0xa614('0x8')],{'algorithm':_0xa614('0x52'),'subject':_0x38cdde['id'][_0xa614('0x4d')](),'issuer':hardwareConf[_0xa614('0x31')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0xb0ca=['motion.token','cookie','motion.user','stringify','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','crypto','ipaddr.js','secrets','fullname','name','internal','permissions','chatPause','mailPause','faxPause','smsPause','pauseType','phoneBarRemoteControlPort','phoneBarRemoteControl','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','authenticate','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','user','then','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','session','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','role','setTokenCookie'];(function(_0x7193e5,_0x5d398b){var _0x54b63c=function(_0x571e6d){while(--_0x571e6d){_0x7193e5['push'](_0x7193e5['shift']());}};_0x54b63c(++_0x5d398b);}(_0xb0ca,0xc0));var _0xab0c=function(_0x49f7e0,_0x15a064){_0x49f7e0=_0x49f7e0-0x0;var _0x556090=_0xb0ca[_0x49f7e0];return _0x556090;};'use strict';var db=require(_0xab0c('0x0'))['db'];var config=require(_0xab0c('0x1'));var hardwareConf=require(_0xab0c('0x2'));var _=require('lodash');var jwt=require(_0xab0c('0x3'));var expressJwt=require(_0xab0c('0x4'));var compose=require(_0xab0c('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xab0c('0x6'));var ipaddr=require(_0xab0c('0x7'));var validateJwt=expressJwt({'secret':config[_0xab0c('0x8')]['session']});var userAttributes=['id','role',_0xab0c('0x9'),_0xab0c('0xa'),_0xab0c('0xb'),'email','userpic',_0xab0c('0xc'),'voicePause',_0xab0c('0xd'),_0xab0c('0xe'),_0xab0c('0xf'),_0xab0c('0x10'),'openchannelPause',_0xab0c('0x11'),'showWebBar',_0xab0c('0x12'),_0xab0c('0x13'),'interface','userProfileId'];exports[_0xab0c('0x14')]=function(){return isAuthenticated(!![])[_0xab0c('0x15')](function(_0x300970,_0xb9438a,_0x950323){if(_0x300970['user']){_0x950323();}else{return db[_0xab0c('0x16')][_0xab0c('0x17')]({'where':{'id':_0x300970[_0xab0c('0x18')]['id']},'attributes':['id',_0xab0c('0x19'),_0xab0c('0x1a')],'raw':!![]})['then'](function(_0x1b034b){if(_0x1b034b&&_0x1b034b[_0xab0c('0x19')]){return _0xb9438a['status'](_0x1b034b[_0xab0c('0x1a')]===_0xab0c('0x1b')?0x195:0x193)[_0xab0c('0x1c')]({'message':_0x1b034b[_0xab0c('0x1a')]===_0xab0c('0x1b')?_0xab0c('0x1d'):_0xab0c('0x1e')});}else{_0x950323();}})[_0xab0c('0x1f')](function(_0x3cc615){_0x950323(_0x3cc615);});}});};function isAuthenticated(_0x2890ef){return compose()['use'](function(_0x2c02a4,_0x11d58a,_0x28c3f4){if(_0x2c02a4['headers'][_0xab0c('0x20')]){if(_[_0xab0c('0x21')](_0x2c02a4[_0xab0c('0x22')][_0xab0c('0x20')],_0xab0c('0x23'))){var _0x380123=basicAuth(_0x2c02a4);db[_0xab0c('0x24')][_0xab0c('0x25')]({'where':{'name':_0x380123[_0xab0c('0xa')]}})['then'](function(_0x511439){if(!_0x511439||!_0x511439[_0xab0c('0x26')](_0x380123['pass'])){return _0x11d58a[_0xab0c('0x27')](0x191)[_0xab0c('0x1c')]({'message':_0xab0c('0x28')});}_0x2c02a4['user']={'id':_0x511439['id']};_0x28c3f4();})['catch'](function(_0x4424be){_0x28c3f4(_0x4424be);});}else if(_[_0xab0c('0x21')](_0x2c02a4['headers'][_0xab0c('0x20')],_0xab0c('0x29'))){validateJwt(_0x2c02a4,_0x11d58a,_0x28c3f4);}else{if(_0x2890ef){_0x28c3f4();}else{return _0x11d58a['status'](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x2a')});}}}else if(_0x2c02a4[_0xab0c('0x2b')][_0xab0c('0x2c')]){try{var _0xcab183=jwt[_0xab0c('0x2d')](_0x2c02a4[_0xab0c('0x2b')]['apikey'],config[_0xab0c('0x8')]['session'],{'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xab0c('0x2e')]()});db[_0xab0c('0x24')][_0xab0c('0x25')]({'where':{'id':_0xcab183['sub']}})['then'](function(_0x34b59e){if(!_0x34b59e||!_[_0xab0c('0x2f')](_0x34b59e['apiKeyNonce'],_0xcab183['nonce'])){return _0x11d58a[_0xab0c('0x27')](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x30')});}_0x2c02a4['user']={'id':_0x34b59e['id']};_0x28c3f4();})[_0xab0c('0x1f')](function(_0x62ebe8){_0x28c3f4(_0x62ebe8);});}catch(_0x369c01){console[_0xab0c('0x31')](_0x369c01);return _0x11d58a[_0xab0c('0x27')](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x32')});}}else if(_0x2890ef){_0x28c3f4();}else{return _0x11d58a[_0xab0c('0x27')](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x2a')});}})[_0xab0c('0x15')](function(_0x25f771,_0x56ccb9,_0x366769){if(_0x25f771[_0xab0c('0x33')]){db['User'][_0xab0c('0x25')]({'where':{'id':_0x25f771[_0xab0c('0x33')]['id']},'attributes':userAttributes})[_0xab0c('0x34')](function(_0xa02b83){if(!_0xa02b83){return _0x56ccb9[_0xab0c('0x27')](0x194)[_0xab0c('0x1c')]({'message':_0xab0c('0x35')});}_0x25f771['user']=_0xa02b83;_0x366769();})[_0xab0c('0x1f')](function(_0x3828fa){_0x366769(_0x3828fa);});}else if(_0x2890ef){_0x366769();}else{return _0x56ccb9[_0xab0c('0x27')](0x194)[_0xab0c('0x1c')]({'message':_0xab0c('0x36')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0xab0c('0x15')](function(_0x4e97aa,_0x8d3130,_0x58aaad){return require(_0xab0c('0x37'))[_0xab0c('0x38')]()[_0xab0c('0x34')](function(_0x3e0851){if(_0x3e0851[_0xab0c('0x39')]){_0x58aaad();}else{return _0x8d3130[_0xab0c('0x27')](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x3a')});}})[_0xab0c('0x1f')](function(_0x1629dc){_0x58aaad(_0x1629dc);});});}exports[_0xab0c('0x3b')]=canUpdate;function signToken(_0x4fd1a5,_0x2ec21a){return jwt[_0xab0c('0x3c')]({'id':_0x4fd1a5,'role':_0x2ec21a},config[_0xab0c('0x8')][_0xab0c('0x3d')],{'expiresIn':0x15180});}exports[_0xab0c('0x3e')]=signToken;exports[_0xab0c('0x3f')]=function(_0x481f2d){if(!_0x481f2d){throw new Error(_0xab0c('0x40'));}return compose()['use'](isAuthenticated())['use'](function meetsRequirements(_0x28366b,_0x6959a5,_0x42cea1){if(config[_0xab0c('0x41')][_0xab0c('0x42')](_0x28366b['user'][_0xab0c('0x43')])>=config[_0xab0c('0x41')][_0xab0c('0x42')](_0x481f2d)){return _0x42cea1();}else{return _0x6959a5['status'](0x193)[_0xab0c('0x1c')]({'message':_0xab0c('0x3a')});}});};exports[_0xab0c('0x44')]=function(_0x1656eb,_0x1d7917){if(!_0x1656eb[_0xab0c('0x33')]){return _0x1d7917[_0xab0c('0x27')](0x194)[_0xab0c('0x1c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4c135e=signToken(_0x1656eb[_0xab0c('0x33')]['id'],_0x1656eb[_0xab0c('0x33')]['role']);_0x1d7917['cookie'](_0xab0c('0x45'),_0x4c135e);_0x1d7917[_0xab0c('0x46')](_0xab0c('0x47'),JSON[_0xab0c('0x48')](_[_0xab0c('0x49')](_0x1656eb[_0xab0c('0x33')],userAttributes)));_0x1d7917['redirect'](_0xab0c('0x4a'));};exports[_0xab0c('0x4b')]=function(_0xa89937){if(_[_0xab0c('0x4c')](_0xa89937[_0xab0c('0x4d')])||_[_0xab0c('0x4c')](_0xa89937[_0xab0c('0x4e')]))return null;else return createJwt(_0xa89937);};exports[_0xab0c('0x4f')]=function(_0x505805){_0x505805['apiKeyNonce']=crypto[_0xab0c('0x50')](0x10)[_0xab0c('0x51')](_0xab0c('0x52'));_0x505805[_0xab0c('0x4e')]=Math[_0xab0c('0x53')](Date['now']()/0x3e8)[_0xab0c('0x51')]();return createJwt(_0x505805);};exports[_0xab0c('0x54')]=function(_0x2b09a3,_0x37d524){if(_0x2b09a3[_0xab0c('0x2b')][_0xab0c('0x2c')]){jwt[_0xab0c('0x2d')](_0x2b09a3[_0xab0c('0x2b')][_0xab0c('0x2c')],config['secrets'][_0xab0c('0x3d')],{'nonce':_0x37d524[_0xab0c('0x4d')],'iat':_0x37d524[_0xab0c('0x4e')],'audience':hardwareConf[_0xab0c('0x2e')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x37d524);}else{throw{'message':_0xab0c('0x55')};}};function createJwt(_0x5172fd){return jwt[_0xab0c('0x3c')]({'iat':_0x5172fd[_0xab0c('0x4e')],'nonce':_0x5172fd[_0xab0c('0x4d')]},config[_0xab0c('0x8')][_0xab0c('0x3d')],{'algorithm':_0xab0c('0x56'),'subject':_0x5172fd['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xab0c('0x2e')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 6b0abe5..13b3d50 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 _0x6489=['end','final','binary','close','createReadStream','createDecipher','unlink','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm','data','update','write'];(function(_0x4327fc,_0xf3ae57){var _0x12ab7e=function(_0x1b5da7){while(--_0x1b5da7){_0x4327fc['push'](_0x4327fc['shift']());}};_0x12ab7e(++_0xf3ae57);}(_0x6489,0x19f));var _0x9648=function(_0x5d1d61,_0xea9fea){_0x5d1d61=_0x5d1d61-0x0;var _0x4c7914=_0x6489[_0x5d1d61];return _0x4c7914;};'use strict';var crypto=require(_0x9648('0x0'));var fs=require('fs');var BPromise=require(_0x9648('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x1fdf8){var _0x131258={};for(var _0x1e1660 in defaultOptions){if(defaultOptions[_0x9648('0x2')](_0x1e1660)){_0x131258[_0x1e1660]=defaultOptions[_0x1e1660];}}if(_0x1fdf8){for(var _0x193ebf in _0x1fdf8){if(_0x1fdf8[_0x9648('0x2')](_0x193ebf)){_0x131258[_0x193ebf]=_0x1fdf8[_0x193ebf];}}}return _0x131258;}exports[_0x9648('0x3')]=function(_0x1f796a,_0x3cc36a,_0x182b78,_0x8673fc){return new BPromise(function(_0xc86792,_0x72d661){_0x8673fc=combineOptions(_0x8673fc);var _0x4681af=new Buffer(_0x182b78);var _0x56e7cb=fs['createReadStream'](_0x1f796a);var _0x12baeb=fs[_0x9648('0x4')](_0x3cc36a);var _0x5ec8c8=crypto[_0x9648('0x5')](_0x8673fc[_0x9648('0x6')],_0x4681af);_0x56e7cb['on'](_0x9648('0x7'),function(_0x4bab28){var _0xbc3444=new Buffer(_0x5ec8c8[_0x9648('0x8')](_0x4bab28),'binary');_0x12baeb[_0x9648('0x9')](_0xbc3444);});_0x56e7cb['on'](_0x9648('0xa'),function(){try{var _0x149551=new Buffer(_0x5ec8c8[_0x9648('0xb')](_0x9648('0xc')),_0x9648('0xc'));_0x12baeb[_0x9648('0x9')](_0x149551);_0x12baeb[_0x9648('0xa')]();_0x12baeb['on'](_0x9648('0xd'),function(){return _0xc86792(_0x3cc36a);});}catch(_0x3757bd){fs['unlink'](_0x3cc36a);return _0x72d661(_0x3757bd);}});});};exports['decryptFile']=function(_0x5b09f9,_0x1adc49,_0x2ef9e3,_0x1178b0){return new BPromise(function(_0x2850d6,_0x3db00c){_0x1178b0=combineOptions(_0x1178b0);var _0x16732b=new Buffer(_0x2ef9e3);var _0x519711=fs[_0x9648('0xe')](_0x5b09f9);var _0x469ce4=fs[_0x9648('0x4')](_0x1adc49);var _0x258cf2=crypto[_0x9648('0xf')](_0x1178b0[_0x9648('0x6')],_0x16732b);_0x519711['on'](_0x9648('0x7'),function(_0x4f7dc3){var _0x1f570c=new Buffer(_0x258cf2[_0x9648('0x8')](_0x4f7dc3),'binary');_0x469ce4[_0x9648('0x9')](_0x1f570c);});_0x519711['on'](_0x9648('0xa'),function(){try{var _0x10df23=new Buffer(_0x258cf2['final'](_0x9648('0xc')),_0x9648('0xc'));_0x469ce4['write'](_0x10df23);_0x469ce4['end']();_0x469ce4['on'](_0x9648('0xd'),function(){return _0x2850d6(_0x1adc49);});}catch(_0x47b9d2){fs[_0x9648('0x10')](_0x1adc49);return _0x3db00c(_0x47b9d2);}});});}; \ No newline at end of file +var _0x48d7=['crypto','bluebird','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher'];(function(_0x299f55,_0x1a114a){var _0x1913fd=function(_0xc1c4f3){while(--_0xc1c4f3){_0x299f55['push'](_0x299f55['shift']());}};_0x1913fd(++_0x1a114a);}(_0x48d7,0x120));var _0x748d=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x48d7[_0x29d915];return _0x160f86;};'use strict';var crypto=require(_0x748d('0x0'));var fs=require('fs');var BPromise=require(_0x748d('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x53e71b){var _0x1014a6={};for(var _0x5834b2 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x5834b2)){_0x1014a6[_0x5834b2]=defaultOptions[_0x5834b2];}}if(_0x53e71b){for(var _0x441f67 in _0x53e71b){if(_0x53e71b[_0x748d('0x2')](_0x441f67)){_0x1014a6[_0x441f67]=_0x53e71b[_0x441f67];}}}return _0x1014a6;}exports[_0x748d('0x3')]=function(_0x41a680,_0xd7c661,_0x466250,_0x22c73d){return new BPromise(function(_0x460780,_0x2b2ebb){_0x22c73d=combineOptions(_0x22c73d);var _0x12c7f0=new Buffer(_0x466250);var _0xf1b474=fs[_0x748d('0x4')](_0x41a680);var _0x3fa3ee=fs[_0x748d('0x5')](_0xd7c661);var _0x45f79b=crypto[_0x748d('0x6')](_0x22c73d[_0x748d('0x7')],_0x12c7f0);_0xf1b474['on'](_0x748d('0x8'),function(_0x235077){var _0x411b8c=new Buffer(_0x45f79b[_0x748d('0x9')](_0x235077),_0x748d('0xa'));_0x3fa3ee[_0x748d('0xb')](_0x411b8c);});_0xf1b474['on']('end',function(){try{var _0x4dfb3d=new Buffer(_0x45f79b[_0x748d('0xc')]('binary'),_0x748d('0xa'));_0x3fa3ee[_0x748d('0xb')](_0x4dfb3d);_0x3fa3ee[_0x748d('0xd')]();_0x3fa3ee['on'](_0x748d('0xe'),function(){return _0x460780(_0xd7c661);});}catch(_0x46c517){fs[_0x748d('0xf')](_0xd7c661);return _0x2b2ebb(_0x46c517);}});});};exports[_0x748d('0x10')]=function(_0x53775c,_0x6a52b9,_0x537ed2,_0x5c6ccb){return new BPromise(function(_0x23f0ea,_0x1d8d2f){_0x5c6ccb=combineOptions(_0x5c6ccb);var _0x4b5035=new Buffer(_0x537ed2);var _0x38c044=fs[_0x748d('0x4')](_0x53775c);var _0x21c295=fs[_0x748d('0x5')](_0x6a52b9);var _0x450b69=crypto[_0x748d('0x11')](_0x5c6ccb['algorithm'],_0x4b5035);_0x38c044['on'](_0x748d('0x8'),function(_0x127bb2){var _0x311846=new Buffer(_0x450b69['update'](_0x127bb2),_0x748d('0xa'));_0x21c295['write'](_0x311846);});_0x38c044['on'](_0x748d('0xd'),function(){try{var _0xde37a4=new Buffer(_0x450b69[_0x748d('0xc')](_0x748d('0xa')),_0x748d('0xa'));_0x21c295['write'](_0xde37a4);_0x21c295['end']();_0x21c295['on'](_0x748d('0xe'),function(){return _0x23f0ea(_0x6a52b9);});}catch(_0x15b366){fs[_0x748d('0xf')](_0x6a52b9);return _0x1d8d2f(_0x15b366);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c5768ef..01efd07 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 _0xd121=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','length','existsSync','mkdirSync','join','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num'];(function(_0x1bc9ae,_0x32642f){var _0x996575=function(_0x3b97f0){while(--_0x3b97f0){_0x1bc9ae['push'](_0x1bc9ae['shift']());}};_0x996575(++_0x32642f);}(_0xd121,0x120));var _0x1d12=function(_0x358bf9,_0x4c57a8){_0x358bf9=_0x358bf9-0x0;var _0x5010cc=_0xd121[_0x358bf9];return _0x5010cc;};'use strict';var util=require(_0x1d12('0x0'));var path=require(_0x1d12('0x1'));var _=require(_0x1d12('0x2'));var csv=require(_0x1d12('0x3'));var fs=require('fs');var BPromise=require(_0x1d12('0x4'));var zipdir=require(_0x1d12('0x5'));var rimraf=require(_0x1d12('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1d12('0x7'))[_0x1d12('0x8')];var logger=require('../../config/logger')(_0x1d12('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1d12('0xa')][0x2]);var QUERY=process[_0x1d12('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x2545c2,_0x3c9c2e){var _0x41a922={'status':_0x2545c2};var _0x53375a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c9c2e){_0x41a922[_0x1d12('0xb')]=_0x3c9c2e;}return db[_0x1d12('0xc')][_0x1d12('0xd')](_0x41a922,_0x53375a);}function main(){var _0x46b019=0x1388;var _0x5ac87d;logger[_0x1d12('0xe')](util['format'](_0x1d12('0xf'),EXTRACTED_REPORT_ID,_0x1d12('0x10')));return db[_0x1d12('0x11')][_0x1d12('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1d12('0x13'),'splitSizeCsv']})['then'](function(_0x291422){if(_0x291422){_0x5ac87d=_0x291422;_0x46b019=_0x5ac87d[_0x1d12('0x14')]||0x1388;}})[_0x1d12('0x15')](function(){return dbH[_0x1d12('0x16')][_0x1d12('0x17')](util['format'](_0x1d12('0x18'),QUERY),{'type':dbH[_0x1d12('0x16')][_0x1d12('0x19')]['SELECT']});})[_0x1d12('0x15')](function(_0x4474ee){if(!_0x4474ee[0x0]['num']){return analyticExtractedReport('Empty');}var _0x166640=[];var _0x2891ea=0x0;var _0x5a7a16=!![];if(_0x4474ee&&_0x4474ee['length']){var _0x3451f3=_0x4474ee[0x0][_0x1d12('0x1a')]%(_0x2891ea+_0x46b019);if(_0x5ac87d['split']){for(;_0x5a7a16;_0x2891ea+=_0x46b019,_0x3451f3=_0x4474ee[0x0]['num']%(_0x2891ea+_0x46b019)){if(_0x3451f3==0x0||_0x3451f3==_0x4474ee[0x0][_0x1d12('0x1a')]){_0x5a7a16=![];}_0x166640['push'](dbH[_0x1d12('0x16')]['query'](util[_0x1d12('0x1b')](_0x1d12('0x1c'),QUERY,_0x46b019,_0x2891ea),{'type':dbH[_0x1d12('0x16')][_0x1d12('0x19')][_0x1d12('0x1d')]}));}}else{_0x166640['push'](dbH[_0x1d12('0x16')][_0x1d12('0x17')](QUERY,{'type':dbH['sequelize'][_0x1d12('0x19')]['SELECT']}));}}var _0x5f1d22=path[_0x1d12('0x1e')](PATH);var _0x5c6c3d=path[_0x1d12('0x1f')](PATH,_0x1d12('0x20'));var _0x3513a5=_0x5ac87d[_0x1d12('0x13')]&&_0x166640[_0x1d12('0x21')]>0x1;var _0x3cbf7b=[];if(!fs[_0x1d12('0x22')](path['join'](_0x5f1d22,_0x5c6c3d))&&_0x3513a5){fs[_0x1d12('0x23')](path[_0x1d12('0x24')](_0x5f1d22,_0x5c6c3d));}return BPromise['each'](_0x166640,function(_0x53fcf7){_0x3cbf7b['push'](_0x53fcf7);})[_0x1d12('0x15')](function(){for(var _0x3ab15e=0x0;_0x3ab15e<_0x3cbf7b[_0x1d12('0x21')];_0x3ab15e+=0x1){var _0x5b6af9;var _0x1f9a55=_0x3cbf7b[_0x3ab15e];if(_0x3513a5){_0x5b6af9=path[_0x1d12('0x24')](_0x5f1d22,_0x5c6c3d,util['format'](_0x1d12('0x25'),_0x5c6c3d,_0x3ab15e,_0x1d12('0x26')));}else{_0x5b6af9=path['join'](_0x5f1d22,util[_0x1d12('0x1b')]('%s.%s',_0x5c6c3d,_0x1d12('0x26')));}fs['writeFileSync'](_0x5b6af9,csv(_0x1f9a55));}})[_0x1d12('0x15')](function(){if(_0x3513a5){zipdir(path[_0x1d12('0x24')](_0x5f1d22,_0x5c6c3d),{'saveTo':path[_0x1d12('0x24')](_0x5f1d22,util[_0x1d12('0x1b')](_0x1d12('0x27'),_0x5c6c3d,'zip'))},function(_0x4e6ad3,_0x18ba71){});rimraf(path[_0x1d12('0x24')](_0x5f1d22,_0x5c6c3d),function(){});}})[_0x1d12('0x15')](function(){logger[_0x1d12('0xe')](util['format'](_0x1d12('0x28'),EXTRACTED_REPORT_ID,_0x1d12('0x10')));return analyticExtractedReport('Completed',_0x3513a5?util[_0x1d12('0x1b')]('%s.%s',_0x5c6c3d,_0x3513a5?_0x1d12('0x29'):_0x1d12('0x26')):null);});})[_0x1d12('0x2a')](function(_0x2288df){logger[_0x1d12('0xe')](util[_0x1d12('0x1b')](_0x1d12('0x2b'),EXTRACTED_REPORT_ID,_0x1d12('0x10')),util['inspect'](_0x2288df,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1d12('0x2c'));});}main(); \ No newline at end of file +var _0x66bb=['length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','lodash','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','split','splitSizeCsv','then','sequelize','query','format','QueryTypes','SELECT','num','Empty'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x66bb,0x8d));var _0xb66b=function(_0x1a6a25,_0x2394f6){_0x1a6a25=_0x1a6a25-0x0;var _0x592ccb=_0x66bb[_0x1a6a25];return _0x592ccb;};'use strict';var util=require(_0xb66b('0x0'));var path=require('path');var _=require(_0xb66b('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xb66b('0x2'));var rimraf=require('rimraf');var db=require(_0xb66b('0x3'))['db'];var dbH=require(_0xb66b('0x3'))[_0xb66b('0x4')];var logger=require(_0xb66b('0x5'))(_0xb66b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xb66b('0x7')][0x2]);var QUERY=process[_0xb66b('0x7')][0x3];var PATH=process[_0xb66b('0x7')][0x4];function analyticExtractedReport(_0x3de2f9,_0x3efa04){var _0x3d7ec3={'status':_0x3de2f9};var _0x3a5cfa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3efa04){_0x3d7ec3[_0xb66b('0x8')]=_0x3efa04;}return db['AnalyticExtractedReport'][_0xb66b('0x9')](_0x3d7ec3,_0x3a5cfa);}function main(){var _0xdc3f61=0x1388;var _0x1e7bc1;logger[_0xb66b('0xa')](util['format'](_0xb66b('0xb'),EXTRACTED_REPORT_ID,_0xb66b('0xc')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb66b('0xd'),_0xb66b('0xe')]})[_0xb66b('0xf')](function(_0x4f79e8){if(_0x4f79e8){_0x1e7bc1=_0x4f79e8;_0xdc3f61=_0x1e7bc1['splitSizeCsv']||0x1388;}})[_0xb66b('0xf')](function(){return dbH[_0xb66b('0x10')][_0xb66b('0x11')](util[_0xb66b('0x12')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb66b('0x10')][_0xb66b('0x13')][_0xb66b('0x14')]});})[_0xb66b('0xf')](function(_0x4d1aaf){if(!_0x4d1aaf[0x0][_0xb66b('0x15')]){return analyticExtractedReport(_0xb66b('0x16'));}var _0x66394=[];var _0x4e65fc=0x0;var _0x2c6f74=!![];if(_0x4d1aaf&&_0x4d1aaf[_0xb66b('0x17')]){var _0x514850=_0x4d1aaf[0x0]['num']%(_0x4e65fc+_0xdc3f61);if(_0x1e7bc1[_0xb66b('0xd')]){for(;_0x2c6f74;_0x4e65fc+=_0xdc3f61,_0x514850=_0x4d1aaf[0x0][_0xb66b('0x15')]%(_0x4e65fc+_0xdc3f61)){if(_0x514850==0x0||_0x514850==_0x4d1aaf[0x0][_0xb66b('0x15')]){_0x2c6f74=![];}_0x66394[_0xb66b('0x18')](dbH[_0xb66b('0x10')]['query'](util[_0xb66b('0x12')](_0xb66b('0x19'),QUERY,_0xdc3f61,_0x4e65fc),{'type':dbH[_0xb66b('0x10')][_0xb66b('0x13')][_0xb66b('0x14')]}));}}else{_0x66394[_0xb66b('0x18')](dbH[_0xb66b('0x10')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xb66b('0x14')]}));}}var _0x12bf1f=path[_0xb66b('0x1a')](PATH);var _0x42db75=path[_0xb66b('0x1b')](PATH,_0xb66b('0x1c'));var _0x434579=_0x1e7bc1[_0xb66b('0xd')]&&_0x66394['length']>0x1;var _0x18c03a=[];if(!fs[_0xb66b('0x1d')](path['join'](_0x12bf1f,_0x42db75))&&_0x434579){fs['mkdirSync'](path[_0xb66b('0x1e')](_0x12bf1f,_0x42db75));}return BPromise['each'](_0x66394,function(_0x197fc9){_0x18c03a[_0xb66b('0x18')](_0x197fc9);})[_0xb66b('0xf')](function(){for(var _0x3b9892=0x0;_0x3b9892<_0x18c03a[_0xb66b('0x17')];_0x3b9892+=0x1){var _0x3e2bf4;var _0x51036d=_0x18c03a[_0x3b9892];if(_0x434579){_0x3e2bf4=path['join'](_0x12bf1f,_0x42db75,util[_0xb66b('0x12')](_0xb66b('0x1f'),_0x42db75,_0x3b9892,_0xb66b('0x20')));}else{_0x3e2bf4=path[_0xb66b('0x1e')](_0x12bf1f,util[_0xb66b('0x12')](_0xb66b('0x21'),_0x42db75,'csv'));}fs[_0xb66b('0x22')](_0x3e2bf4,csv(_0x51036d));}})['then'](function(){if(_0x434579){zipdir(path['join'](_0x12bf1f,_0x42db75),{'saveTo':path[_0xb66b('0x1e')](_0x12bf1f,util[_0xb66b('0x12')](_0xb66b('0x21'),_0x42db75,'zip'))},function(_0x206cde,_0x38a8b8){});rimraf(path[_0xb66b('0x1e')](_0x12bf1f,_0x42db75),function(){});}})[_0xb66b('0xf')](function(){logger[_0xb66b('0xa')](util[_0xb66b('0x12')](_0xb66b('0x23'),EXTRACTED_REPORT_ID,_0xb66b('0xc')));return analyticExtractedReport(_0xb66b('0x24'),_0x434579?util['format'](_0xb66b('0x21'),_0x42db75,_0x434579?_0xb66b('0x25'):'csv'):null);});})[_0xb66b('0x26')](function(_0x45cead){logger['info'](util[_0xb66b('0x12')](_0xb66b('0x27'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x45cead,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb66b('0x28'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 3bc6fad..17c2a7f 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 _0x6cb8=['savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','Setting','find','splitSizePdf','then','length','split','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','header','black','body','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','error','log','err','end','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a'];(function(_0x324dc5,_0x139bf1){var _0x3737f4=function(_0x35610b){while(--_0x35610b){_0x324dc5['push'](_0x324dc5['shift']());}};_0x3737f4(++_0x139bf1);}(_0x6cb8,0x1d7));var _0x86cb=function(_0x5b9611,_0x45dccb){_0x5b9611=_0x5b9611-0x0;var _0x1aedc9=_0x6cb8[_0x5b9611];return _0x1aedc9;};'use strict';var _=require(_0x86cb('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0x86cb('0x1'));var path=require(_0x86cb('0x2'));var moment=require(_0x86cb('0x3'));var PdfPrinter=require(_0x86cb('0x4'));var zipdir=require(_0x86cb('0x5'));var rimraf=require(_0x86cb('0x6'));var db=require(_0x86cb('0x7'))['db'];var dbH=require('../../mysqldb')[_0x86cb('0x8')];var logger=require('../../config/logger')(_0x86cb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x86cb('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x86cb('0xa')][0x4];var NAME=process[_0x86cb('0xa')][0x5];var FORMAT=_0x86cb('0xb');var _extractedReport;function analyticExtractedReport(_0x102973,_0x405992){var _0x305227={'status':_0x102973};var _0x20efc6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x405992){_0x305227[_0x86cb('0xc')]=_0x405992;}return db[_0x86cb('0xd')][_0x86cb('0xe')](_0x305227,_0x20efc6);}function getHeader(_0x616b43){var _0x37045a=[];for(var _0x348004 in _0x616b43){if(_0x616b43[_0x86cb('0xf')](_0x348004)){_0x37045a['push']({'text':_0x348004,'style':_0x86cb('0x10')});}}return _0x37045a;}function extractReport(_0x74981f){var _0x492430=0x1388;var _0x2f0f83;if(!_0x74981f[0x0][_0x86cb('0x11')]){return analyticExtractedReport(_0x86cb('0x12'));}var _0x52d452=[];var _0x2f3cbe=0x0;var _0x1063ae=!![];var _0x562719=path[_0x86cb('0x13')](PATH);var _0x34bbd8=path[_0x86cb('0x14')](PATH,'.pdf');var _0x53d9a6=![];var _0x1b782f=[];return db[_0x86cb('0x15')][_0x86cb('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x86cb('0x17')]})[_0x86cb('0x18')](function(_0x373e29){if(_0x373e29){_0x2f0f83=_0x373e29;_0x492430=_0x2f0f83[_0x86cb('0x17')]||0x3e8;}})['then'](function(){if(_0x74981f&&_0x74981f[_0x86cb('0x19')]){var _0x1a6b24=_0x74981f[0x0][_0x86cb('0x11')]%(_0x2f3cbe+_0x492430);if(_0x2f0f83[_0x86cb('0x1a')]){for(;_0x1063ae;_0x2f3cbe+=_0x492430,_0x1a6b24=_0x74981f[0x0][_0x86cb('0x11')]%(_0x2f3cbe+_0x492430)){if(_0x1a6b24==0x0||_0x1a6b24==_0x74981f[0x0][_0x86cb('0x11')]){_0x1063ae=![];}_0x52d452[_0x86cb('0x1b')](dbH[_0x86cb('0x1c')][_0x86cb('0x1d')](util[_0x86cb('0x1e')](_0x86cb('0x1f'),QUERY,_0x492430,_0x2f3cbe),{'type':dbH[_0x86cb('0x1c')][_0x86cb('0x20')]['SELECT']}));}}else{_0x52d452['push'](dbH[_0x86cb('0x1c')]['query'](QUERY,{'type':dbH['sequelize'][_0x86cb('0x20')][_0x86cb('0x21')]}));}}_0x53d9a6=_0x2f0f83[_0x86cb('0x1a')]&&_0x52d452['length']>0x1;if(!fs['existsSync'](path[_0x86cb('0x22')](_0x562719,_0x34bbd8))&&_0x53d9a6){fs[_0x86cb('0x23')](path['join'](_0x562719,_0x34bbd8));}return BPromise[_0x86cb('0x24')](_0x52d452,function(_0x4e93de){_0x1b782f[_0x86cb('0x1b')](_0x4e93de);});})[_0x86cb('0x18')](function(){return BPromise['each'](_0x52d452,function(_0x4ddb88,_0x4f53d0){var _0x21496f;var _0x29fa6b=util[_0x86cb('0x1e')](_0x86cb('0x25'),NAME,_extractedReport['name'],moment(_extractedReport[_0x86cb('0x26')])['format'](FORMAT),moment(_extractedReport[_0x86cb('0x27')])[_0x86cb('0x1e')](FORMAT));var _0x318527={'pageSize':'A4','pageOrientation':_0x86cb('0x28'),'content':[{'text':_0x29fa6b,'style':_0x86cb('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x86cb('0x2a')}}};var _0x42b7f2={'headerRows':0x1,'body':[]};_0x42b7f2[_0x86cb('0x2b')][_0x86cb('0x1b')](getHeader(_0x4ddb88[0x0]));var _0x3bd56c;for(var _0x643ad1=0x0;_0x643ad1<_0x4ddb88[_0x86cb('0x19')];_0x643ad1+=0x1){_0x3bd56c=[];for(var _0x2c5a32 in _0x4ddb88[_0x643ad1]){if(_0x4ddb88[_0x643ad1][_0x86cb('0xf')](_0x2c5a32)){_0x3bd56c[_0x86cb('0x1b')](_0x4ddb88[_0x643ad1][_0x2c5a32]?_['toString'](_0x4ddb88[_0x643ad1][_0x2c5a32]):'');}}_0x42b7f2['body'][_0x86cb('0x1b')](_0x3bd56c);}_0x318527[_0x86cb('0x2c')][_0x86cb('0x1b')]({'table':_0x42b7f2});return new BPromise(function(_0x264e1f,_0x107cb5){var _0x469275=new PdfPrinter({'Roboto':{'normal':__dirname+_0x86cb('0x2d'),'bold':__dirname+_0x86cb('0x2e'),'italics':__dirname+_0x86cb('0x2f'),'bolditalics':__dirname+_0x86cb('0x30')}});var _0x1fe957=_0x469275[_0x86cb('0x31')](_0x318527);if(_0x53d9a6){_0x21496f=path['join'](_0x562719,_0x34bbd8,util[_0x86cb('0x1e')](_0x86cb('0x32'),_0x34bbd8,_0x4f53d0,_0x86cb('0x33')));}else{_0x21496f=path[_0x86cb('0x22')](_0x562719,util['format'](_0x86cb('0x34'),_0x34bbd8,_0x86cb('0x33')));}var _0x393df8=_0x1fe957[_0x86cb('0x35')](fs[_0x86cb('0x36')](_0x21496f));_0x393df8['on']('finish',function(){_0x264e1f();});_0x393df8['on'](_0x86cb('0x37'),function(_0x100c13){console[_0x86cb('0x38')](_0x86cb('0x39'),_0x100c13);_0x107cb5(_0x100c13);});_0x1fe957[_0x86cb('0x3a')]();});});})[_0x86cb('0x18')](function(){if(_0x53d9a6){return new BPromise(function(_0x4e7841,_0x1ef1ee){zipdir(path[_0x86cb('0x22')](_0x562719,_0x34bbd8),{'saveTo':path[_0x86cb('0x22')](_0x562719,util[_0x86cb('0x1e')](_0x86cb('0x34'),_0x34bbd8,_0x86cb('0x3b')))},function(_0x59fa01){if(_0x59fa01){_0x1ef1ee(_0x59fa01);}else{_0x4e7841();}});});}})[_0x86cb('0x18')](function(){if(_0x53d9a6){rimraf(path['join'](_0x562719,_0x34bbd8),function(){});}})[_0x86cb('0x18')](function(){logger['info'](util['format'](_0x86cb('0x3c'),EXTRACTED_REPORT_ID,_0x86cb('0x3d')));return analyticExtractedReport(_0x86cb('0x3e'),_0x53d9a6?util[_0x86cb('0x1e')]('%s.%s',_0x34bbd8,_0x53d9a6?_0x86cb('0x3b'):_0x86cb('0x33')):null);});}function main(){logger['info'](util[_0x86cb('0x1e')](_0x86cb('0x3f'),EXTRACTED_REPORT_ID,_0x86cb('0x40')));return db[_0x86cb('0xd')][_0x86cb('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x86cb('0x18')](function(_0x3b7cf3){_extractedReport=_0x3b7cf3;return dbH[_0x86cb('0x1c')][_0x86cb('0x1d')](util[_0x86cb('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x86cb('0x1c')]['QueryTypes'][_0x86cb('0x21')]});})['then'](extractReport)[_0x86cb('0x42')](function(_0x192998){logger['info'](util['format'](_0x86cb('0x43'),EXTRACTED_REPORT_ID,_0x86cb('0x40')),util['inspect'](_0x192998,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x86cb('0x44'));});}main(); \ No newline at end of file +var _0x246d=['lodash','bluebird','util','path','moment','pdfmake/src/printer','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','basename','split','then','splitSizePdf','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','header','body','toString','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','%s.%s','pdf','finish','error','log','err','end','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed'];(function(_0x586fd6,_0x57a7ca){var _0x9ab521=function(_0x352fe6){while(--_0x352fe6){_0x586fd6['push'](_0x586fd6['shift']());}};_0x9ab521(++_0x57a7ca);}(_0x246d,0x145));var _0xd246=function(_0x4239a8,_0x2d055b){_0x4239a8=_0x4239a8-0x0;var _0x2c19be=_0x246d[_0x4239a8];return _0x2c19be;};'use strict';var _=require(_0xd246('0x0'));var fs=require('fs');var BPromise=require(_0xd246('0x1'));var util=require(_0xd246('0x2'));var path=require(_0xd246('0x3'));var moment=require(_0xd246('0x4'));var PdfPrinter=require(_0xd246('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0xd246('0x6'));var db=require(_0xd246('0x7'))['db'];var dbH=require('../../mysqldb')[_0xd246('0x8')];var logger=require(_0xd246('0x9'))(_0xd246('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd246('0xb')][0x3];var PATH=process[_0xd246('0xb')][0x4];var NAME=process[_0xd246('0xb')][0x5];var FORMAT=_0xd246('0xc');var _extractedReport;function analyticExtractedReport(_0x5c4835,_0x2c9cf7){var _0x3dea29={'status':_0x5c4835};var _0x223966={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c9cf7){_0x3dea29['savename']=_0x2c9cf7;}return db[_0xd246('0xd')][_0xd246('0xe')](_0x3dea29,_0x223966);}function getHeader(_0x17724c){var _0xd550ed=[];for(var _0x99717d in _0x17724c){if(_0x17724c[_0xd246('0xf')](_0x99717d)){_0xd550ed[_0xd246('0x10')]({'text':_0x99717d,'style':_0xd246('0x11')});}}return _0xd550ed;}function extractReport(_0x5a5a4e){var _0x2ecb22=0x1388;var _0x5ee21e;if(!_0x5a5a4e[0x0][_0xd246('0x12')]){return analyticExtractedReport(_0xd246('0x13'));}var _0x135be0=[];var _0x474d46=0x0;var _0x13d902=!![];var _0x449178=path[_0xd246('0x14')](PATH);var _0x2c2a30=path[_0xd246('0x15')](PATH,'.pdf');var _0x37f139=![];var _0x95c9b9=[];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd246('0x16'),'splitSizePdf']})[_0xd246('0x17')](function(_0x486c58){if(_0x486c58){_0x5ee21e=_0x486c58;_0x2ecb22=_0x5ee21e[_0xd246('0x18')]||0x3e8;}})[_0xd246('0x17')](function(){if(_0x5a5a4e&&_0x5a5a4e[_0xd246('0x19')]){var _0x21b427=_0x5a5a4e[0x0]['num']%(_0x474d46+_0x2ecb22);if(_0x5ee21e[_0xd246('0x16')]){for(;_0x13d902;_0x474d46+=_0x2ecb22,_0x21b427=_0x5a5a4e[0x0]['num']%(_0x474d46+_0x2ecb22)){if(_0x21b427==0x0||_0x21b427==_0x5a5a4e[0x0][_0xd246('0x12')]){_0x13d902=![];}_0x135be0[_0xd246('0x10')](dbH[_0xd246('0x1a')][_0xd246('0x1b')](util[_0xd246('0x1c')](_0xd246('0x1d'),QUERY,_0x2ecb22,_0x474d46),{'type':dbH[_0xd246('0x1a')]['QueryTypes'][_0xd246('0x1e')]}));}}else{_0x135be0[_0xd246('0x10')](dbH[_0xd246('0x1a')][_0xd246('0x1b')](QUERY,{'type':dbH[_0xd246('0x1a')][_0xd246('0x1f')]['SELECT']}));}}_0x37f139=_0x5ee21e[_0xd246('0x16')]&&_0x135be0['length']>0x1;if(!fs['existsSync'](path[_0xd246('0x20')](_0x449178,_0x2c2a30))&&_0x37f139){fs[_0xd246('0x21')](path['join'](_0x449178,_0x2c2a30));}return BPromise[_0xd246('0x22')](_0x135be0,function(_0x22ebc5){_0x95c9b9[_0xd246('0x10')](_0x22ebc5);});})[_0xd246('0x17')](function(){return BPromise['each'](_0x135be0,function(_0x323feb,_0x2036dd){var _0x364ea8;var _0x39497a=util['format'](_0xd246('0x23'),NAME,_extractedReport[_0xd246('0x24')],moment(_extractedReport['startDate'])[_0xd246('0x1c')](FORMAT),moment(_extractedReport[_0xd246('0x25')])[_0xd246('0x1c')](FORMAT));var _0x43c805={'pageSize':'A4','pageOrientation':_0xd246('0x26'),'content':[{'text':_0x39497a,'style':_0xd246('0x27')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0xc058c5={'headerRows':0x1,'body':[]};_0xc058c5[_0xd246('0x28')][_0xd246('0x10')](getHeader(_0x323feb[0x0]));var _0x2f59ac;for(var _0x16b1b1=0x0;_0x16b1b1<_0x323feb[_0xd246('0x19')];_0x16b1b1+=0x1){_0x2f59ac=[];for(var _0x1864f4 in _0x323feb[_0x16b1b1]){if(_0x323feb[_0x16b1b1][_0xd246('0xf')](_0x1864f4)){_0x2f59ac['push'](_0x323feb[_0x16b1b1][_0x1864f4]?_[_0xd246('0x29')](_0x323feb[_0x16b1b1][_0x1864f4]):'');}}_0xc058c5['body'][_0xd246('0x10')](_0x2f59ac);}_0x43c805[_0xd246('0x2a')][_0xd246('0x10')]({'table':_0xc058c5});return new BPromise(function(_0x58beac,_0x5adb77){var _0x23af59=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xd246('0x2b'),'italics':__dirname+_0xd246('0x2c'),'bolditalics':__dirname+_0xd246('0x2d')}});var _0x15bd63=_0x23af59[_0xd246('0x2e')](_0x43c805);if(_0x37f139){_0x364ea8=path[_0xd246('0x20')](_0x449178,_0x2c2a30,util[_0xd246('0x1c')](_0xd246('0x2f'),_0x2c2a30,_0x2036dd,'pdf'));}else{_0x364ea8=path['join'](_0x449178,util[_0xd246('0x1c')](_0xd246('0x30'),_0x2c2a30,_0xd246('0x31')));}var _0x1e1092=_0x15bd63['pipe'](fs['createWriteStream'](_0x364ea8));_0x1e1092['on'](_0xd246('0x32'),function(){_0x58beac();});_0x1e1092['on'](_0xd246('0x33'),function(_0x5e2444){console[_0xd246('0x34')](_0xd246('0x35'),_0x5e2444);_0x5adb77(_0x5e2444);});_0x15bd63[_0xd246('0x36')]();});});})[_0xd246('0x17')](function(){if(_0x37f139){return new BPromise(function(_0x42f2c6,_0x273cf4){zipdir(path[_0xd246('0x20')](_0x449178,_0x2c2a30),{'saveTo':path[_0xd246('0x20')](_0x449178,util[_0xd246('0x1c')](_0xd246('0x30'),_0x2c2a30,_0xd246('0x37')))},function(_0x5b62f4){if(_0x5b62f4){_0x273cf4(_0x5b62f4);}else{_0x42f2c6();}});});}})[_0xd246('0x17')](function(){if(_0x37f139){rimraf(path[_0xd246('0x20')](_0x449178,_0x2c2a30),function(){});}})['then'](function(){logger[_0xd246('0x38')](util[_0xd246('0x1c')](_0xd246('0x39'),EXTRACTED_REPORT_ID,_0xd246('0x3a')));return analyticExtractedReport(_0xd246('0x3b'),_0x37f139?util['format']('%s.%s',_0x2c2a30,_0x37f139?_0xd246('0x37'):'pdf'):null);});}function main(){logger[_0xd246('0x38')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd246('0x3c')));return db[_0xd246('0xd')][_0xd246('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd246('0x17')](function(_0x408315){_extractedReport=_0x408315;return dbH[_0xd246('0x1a')]['query'](util[_0xd246('0x1c')](_0xd246('0x3e'),QUERY),{'type':dbH['sequelize'][_0xd246('0x1f')][_0xd246('0x1e')]});})['then'](extractReport)['catch'](function(_0x38b35d){logger['info'](util[_0xd246('0x1c')](_0xd246('0x3f'),EXTRACTED_REPORT_ID,_0xd246('0x3c')),util['inspect'](_0x38b35d,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd246('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ab78b68..6ca1c4d 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 _0x0b89=['Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','XLSX','find','split','splitSizeXlsx','then','query','SELECT','num','Empty','length','push','sequelize','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect'];(function(_0x215e5f,_0x321e4f){var _0x4ba505=function(_0x3a36d6){while(--_0x3a36d6){_0x215e5f['push'](_0x215e5f['shift']());}};_0x4ba505(++_0x321e4f);}(_0x0b89,0x143));var _0x90b8=function(_0x4f434b,_0x1bc550){_0x4f434b=_0x4f434b-0x0;var _0x41b058=_0x0b89[_0x4f434b];return _0x41b058;};'use strict';var util=require(_0x90b8('0x0'));var path=require(_0x90b8('0x1'));var _=require(_0x90b8('0x2'));var fs=require('fs');var json2xls=require(_0x90b8('0x3'));var BPromise=require(_0x90b8('0x4'));var zipdir=require(_0x90b8('0x5'));var rimraf=require(_0x90b8('0x6'));var db=require(_0x90b8('0x7'))['db'];var dbH=require('../../mysqldb')[_0x90b8('0x8')];var logger=require(_0x90b8('0x9'))(_0x90b8('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x90b8('0xb')][0x2]);var QUERY=process[_0x90b8('0xb')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x132fd4,_0x486925){var _0x2290cd={'status':_0x132fd4};var _0x5ce319={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x486925){_0x2290cd[_0x90b8('0xc')]=_0x486925;}return db[_0x90b8('0xd')][_0x90b8('0xe')](_0x2290cd,_0x5ce319);}function main(){var _0x1b598e=0x1388;var _0x33b369;logger['info'](util[_0x90b8('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x90b8('0x10')));return db['Setting'][_0x90b8('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x90b8('0x12'),_0x90b8('0x13')]})[_0x90b8('0x14')](function(_0x591cba){if(_0x591cba){_0x33b369=_0x591cba;_0x1b598e=_0x33b369[_0x90b8('0x13')]||0x1388;}})[_0x90b8('0x14')](function(){return dbH['sequelize'][_0x90b8('0x15')](util[_0x90b8('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x90b8('0x16')]});})['then'](function(_0x1da9c1){if(!_0x1da9c1[0x0][_0x90b8('0x17')]){return analyticExtractedReport(_0x90b8('0x18'));}var _0x111cea=[];var _0xe2e50a=0x0;var _0x23002c=!![];if(_0x33b369[_0x90b8('0x12')]){if(_0x1da9c1&&_0x1da9c1[_0x90b8('0x19')]){var _0x3a13a1=_0x1da9c1[0x0][_0x90b8('0x17')]%(_0xe2e50a+_0x1b598e);for(;_0x23002c;_0xe2e50a+=_0x1b598e,_0x3a13a1=_0x1da9c1[0x0][_0x90b8('0x17')]%(_0xe2e50a+_0x1b598e)){if(_0x3a13a1==0x0||_0x3a13a1==_0x1da9c1[0x0][_0x90b8('0x17')]){_0x23002c=![];}_0x111cea[_0x90b8('0x1a')](dbH[_0x90b8('0x1b')][_0x90b8('0x15')](util[_0x90b8('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1b598e,_0xe2e50a),{'type':dbH[_0x90b8('0x1b')][_0x90b8('0x1c')][_0x90b8('0x16')]}));}}}else{_0x111cea[_0x90b8('0x1a')](dbH[_0x90b8('0x1b')][_0x90b8('0x15')](QUERY,{'type':dbH[_0x90b8('0x1b')][_0x90b8('0x1c')][_0x90b8('0x16')]}));}var _0x27544d=path[_0x90b8('0x1d')](PATH);var _0x2c619e=path[_0x90b8('0x1e')](PATH,_0x90b8('0x1f'));var _0xd0f6a9=_0x33b369[_0x90b8('0x12')]&&_0x111cea[_0x90b8('0x19')]>0x1;var _0x3b6d1d=[];if(!fs[_0x90b8('0x20')](path[_0x90b8('0x21')](_0x27544d,_0x2c619e))&&_0xd0f6a9){fs[_0x90b8('0x22')](path[_0x90b8('0x21')](_0x27544d,_0x2c619e));}return BPromise[_0x90b8('0x23')](_0x111cea,function(_0x1500e6){_0x3b6d1d['push'](_0x1500e6);})['then'](function(){for(var _0x40672e=0x0;_0x40672e<_0x3b6d1d[_0x90b8('0x19')];_0x40672e+=0x1){var _0x6a80fa;var _0x1b67db=_0x3b6d1d[_0x40672e];if(_0xd0f6a9){_0x6a80fa=path[_0x90b8('0x21')](_0x27544d,_0x2c619e,util[_0x90b8('0xf')](_0x90b8('0x24'),_0x2c619e,_0x40672e,_0x90b8('0x25')));}else{_0x6a80fa=path['join'](_0x27544d,util['format'](_0x90b8('0x26'),_0x2c619e,_0x90b8('0x25')));}fs['writeFileSync'](_0x6a80fa,json2xls(_0x1b67db),_0x90b8('0x27'));}})[_0x90b8('0x14')](function(){if(_0xd0f6a9){zipdir(path[_0x90b8('0x21')](_0x27544d,_0x2c619e),{'saveTo':path['join'](_0x27544d,util[_0x90b8('0xf')](_0x90b8('0x26'),_0x2c619e,_0x90b8('0x28')))},function(_0x475aba,_0x3f5232){});rimraf(path[_0x90b8('0x21')](_0x27544d,_0x2c619e),function(){});}})[_0x90b8('0x14')](function(){logger[_0x90b8('0x29')](util['format'](_0x90b8('0x2a'),EXTRACTED_REPORT_ID,_0x90b8('0x10')));return analyticExtractedReport('Completed',_0xd0f6a9?util[_0x90b8('0xf')]('%s.%s',_0x2c619e,_0xd0f6a9?_0x90b8('0x28'):_0x90b8('0x25')):null);});})[_0x90b8('0x2b')](function(_0x185b19){logger[_0x90b8('0x29')](util[_0x90b8('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x90b8('0x10')),util[_0x90b8('0x2c')](_0x185b19,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x90b8('0x2d'));});}main(); \ No newline at end of file +var _0x9ab6=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','push'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x9ab6,0x6d));var _0x69ab=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x9ab6[_0xe66cf2];return _0x2d84e7;};'use strict';var util=require(_0x69ab('0x0'));var path=require(_0x69ab('0x1'));var _=require(_0x69ab('0x2'));var fs=require('fs');var json2xls=require(_0x69ab('0x3'));var BPromise=require(_0x69ab('0x4'));var zipdir=require(_0x69ab('0x5'));var rimraf=require(_0x69ab('0x6'));var db=require(_0x69ab('0x7'))['db'];var dbH=require('../../mysqldb')[_0x69ab('0x8')];var logger=require(_0x69ab('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x69ab('0xa')][0x3];var PATH=process[_0x69ab('0xa')][0x4];function analyticExtractedReport(_0x451607,_0x5646a1){var _0x41365e={'status':_0x451607};var _0x3fd553={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5646a1){_0x41365e[_0x69ab('0xb')]=_0x5646a1;}return db[_0x69ab('0xc')][_0x69ab('0xd')](_0x41365e,_0x3fd553);}function main(){var _0xdbda2e=0x1388;var _0xc88f2e;logger[_0x69ab('0xe')](util[_0x69ab('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x69ab('0x10')));return db['Setting'][_0x69ab('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x69ab('0x12')]})['then'](function(_0x4f3ee2){if(_0x4f3ee2){_0xc88f2e=_0x4f3ee2;_0xdbda2e=_0xc88f2e[_0x69ab('0x12')]||0x1388;}})[_0x69ab('0x13')](function(){return dbH[_0x69ab('0x14')][_0x69ab('0x15')](util[_0x69ab('0xf')](_0x69ab('0x16'),QUERY),{'type':dbH[_0x69ab('0x14')]['QueryTypes'][_0x69ab('0x17')]});})[_0x69ab('0x13')](function(_0x2caba9){if(!_0x2caba9[0x0][_0x69ab('0x18')]){return analyticExtractedReport(_0x69ab('0x19'));}var _0x37d945=[];var _0x51085c=0x0;var _0x208bbc=!![];if(_0xc88f2e[_0x69ab('0x1a')]){if(_0x2caba9&&_0x2caba9[_0x69ab('0x1b')]){var _0x327a20=_0x2caba9[0x0]['num']%(_0x51085c+_0xdbda2e);for(;_0x208bbc;_0x51085c+=_0xdbda2e,_0x327a20=_0x2caba9[0x0]['num']%(_0x51085c+_0xdbda2e)){if(_0x327a20==0x0||_0x327a20==_0x2caba9[0x0][_0x69ab('0x18')]){_0x208bbc=![];}_0x37d945[_0x69ab('0x1c')](dbH[_0x69ab('0x14')][_0x69ab('0x15')](util[_0x69ab('0xf')](_0x69ab('0x1d'),QUERY,_0xdbda2e,_0x51085c),{'type':dbH[_0x69ab('0x14')][_0x69ab('0x1e')]['SELECT']}));}}}else{_0x37d945[_0x69ab('0x1c')](dbH['sequelize'][_0x69ab('0x15')](QUERY,{'type':dbH[_0x69ab('0x14')][_0x69ab('0x1e')][_0x69ab('0x17')]}));}var _0x4746c0=path['dirname'](PATH);var _0x168a89=path[_0x69ab('0x1f')](PATH,_0x69ab('0x20'));var _0x47eb8d=_0xc88f2e['split']&&_0x37d945[_0x69ab('0x1b')]>0x1;var _0x5399f8=[];if(!fs[_0x69ab('0x21')](path[_0x69ab('0x22')](_0x4746c0,_0x168a89))&&_0x47eb8d){fs[_0x69ab('0x23')](path[_0x69ab('0x22')](_0x4746c0,_0x168a89));}return BPromise[_0x69ab('0x24')](_0x37d945,function(_0x603b9){_0x5399f8['push'](_0x603b9);})[_0x69ab('0x13')](function(){for(var _0x530b7e=0x0;_0x530b7e<_0x5399f8[_0x69ab('0x1b')];_0x530b7e+=0x1){var _0x456677;var _0x5eb547=_0x5399f8[_0x530b7e];if(_0x47eb8d){_0x456677=path['join'](_0x4746c0,_0x168a89,util[_0x69ab('0xf')](_0x69ab('0x25'),_0x168a89,_0x530b7e,_0x69ab('0x26')));}else{_0x456677=path[_0x69ab('0x22')](_0x4746c0,util[_0x69ab('0xf')]('%s.%s',_0x168a89,_0x69ab('0x26')));}fs[_0x69ab('0x27')](_0x456677,json2xls(_0x5eb547),_0x69ab('0x28'));}})[_0x69ab('0x13')](function(){if(_0x47eb8d){zipdir(path[_0x69ab('0x22')](_0x4746c0,_0x168a89),{'saveTo':path['join'](_0x4746c0,util[_0x69ab('0xf')]('%s.%s',_0x168a89,_0x69ab('0x29')))},function(_0x9ef6b9,_0x26e77e){});rimraf(path[_0x69ab('0x22')](_0x4746c0,_0x168a89),function(){});}})[_0x69ab('0x13')](function(){logger['info'](util['format'](_0x69ab('0x2a'),EXTRACTED_REPORT_ID,_0x69ab('0x10')));return analyticExtractedReport('Completed',_0x47eb8d?util['format']('%s.%s',_0x168a89,_0x47eb8d?_0x69ab('0x29'):_0x69ab('0x26')):null);});})[_0x69ab('0x2b')](function(_0x4f1923){logger[_0x69ab('0xe')](util[_0x69ab('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x69ab('0x10')),util[_0x69ab('0x2c')](_0x4f1923,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x69ab('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 7cc2c01..0cbed42 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 _0xa488=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','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','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','exten','push','type','Set','format','CDR(type)=%s','CDR(destination)=','cutdigits','${EXTEN:','context','VoiceExtensionId','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat'];(function(_0x37b0ef,_0x1009e5){var _0x26d742=function(_0x10d4a2){while(--_0x10d4a2){_0x37b0ef['push'](_0x37b0ef['shift']());}};_0x26d742(++_0x1009e5);}(_0xa488,0x6d));var _0x8a48=function(_0x53522b,_0x29c9e9){_0x53522b=_0x53522b-0x0;var _0x2abc7a=_0xa488[_0x53522b];return _0x2abc7a;};'use strict';var _=require(_0x8a48('0x0'));var util=require(_0x8a48('0x1'));function rewrite(_0x26dfc7,_0x190424){var _0x2951b2=this;return _0x26dfc7[_0x8a48('0x2')][_0x8a48('0x3')][_0x8a48('0x4')]({'raw':!![]})[_0x8a48('0x5')](function(_0xb0ab87){_0x2951b2[_0x8a48('0x6')]=_0xb0ab87;return _0x26dfc7[_0x8a48('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x190424[_0x8a48('0x7')]},'raw':!![]});})[_0x8a48('0x5')](function(_0x39ee94){return _0x26dfc7[_0x8a48('0x2')][_0x8a48('0x8')][_0x8a48('0x4')]({'where':{'exten':{'$in':_[_0x8a48('0x9')](_[_0x8a48('0xa')](_0x39ee94,'exten'))}},'order':[{'raw':_0x8a48('0xb')}],'raw':!![]});})['then'](function(_0x28d128){var _0x52dcad=_[_0x8a48('0xc')](_0x28d128,{'priority':'1'});var _0x1ef4e0=_[_0x8a48('0xc')](_0x28d128,{'isApp':0x1});var _0x2456b7=_[_0x8a48('0xd')](_0x1ef4e0,'exten');var _0x1c583c=[_0x8a48('0xe'),_0x8a48('0xf')];var _0x3e2cca=[];var _0x151456=[];for(var _0x442500 in _0x2456b7){if(_0x2456b7['hasOwnProperty'](_0x442500)){_0x2951b2[_0x8a48('0x10')]=0x2;_0x2951b2[_0x8a48('0x11')]=[];_0x2951b2[_0x8a48('0x12')]=_[_0x8a48('0x13')](_0x52dcad,{'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')]});_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':util[_0x8a48('0x18')](_0x8a48('0x19'),_0x2456b7[_0x442500][0x0][_0x8a48('0x16')]),'context':_0x2456b7[_0x442500][0x0]['context'],'exten':_0x2456b7[_0x442500][0x0]['exten'],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});if(_0x2456b7[_0x442500][0x0][_0x8a48('0x16')]==='outbound'){if(_0x2951b2[_0x8a48('0x12')]){_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':'Set','appdata':_0x8a48('0x1a')+(_0x2951b2[_0x8a48('0x12')][_0x8a48('0x1b')]?_0x8a48('0x1c')+_0x2951b2['extension'][_0x8a48('0x1b')]+'}':'${EXTEN}'),'context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2['priority']++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});}_0x2951b2[_0x8a48('0x11')]['push']({'type':_0x2456b7[_0x442500][0x0]['type'],'app':'Set','appdata':_0x8a48('0x1f')+_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')],'context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0]['exten'],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});var _0x77aca8=_0x2951b2[_0x8a48('0x10')]++;_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':'ExecIf','appdata':_0x8a48('0x20')+(_0x77aca8+0x2)+_0x8a48('0x21')+(_0x77aca8+0x1)+')','context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x77aca8,'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});if(_0x2951b2[_0x8a48('0x12')]){_0x2951b2['extensions'][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x2951b2[_0x8a48('0x12')][_0x8a48('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x2951b2[_0x8a48('0x12')][_0x8a48('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});}_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x8a48('0x22')+_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')],'context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2['priority']++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});if(_0x2951b2[_0x8a48('0x12')]&&_0x2951b2[_0x8a48('0x12')][_0x8a48('0x23')](_0x8a48('0x24'))&&_0x2951b2[_0x8a48('0x12')]['recordingFormat']!==_0x8a48('0x25')){_0x2951b2[_0x8a48('0x11')]['push']({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x8a48('0x26'),'context':_0x2456b7[_0x442500][0x0]['context'],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':'Set','appdata':_0x8a48('0x27')+_0x2951b2[_0x8a48('0x12')][_0x8a48('0x24')]||_0x8a48('0x28'),'context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});}}_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x8a48('0x29'),'context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2['priority']++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2456b7[_0x442500][0x0][_0x8a48('0x1d')],'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2456b7[_0x442500][0x0]['context'],'exten':_0x2456b7[_0x442500][0x0]['exten'],'priority':_0x2951b2[_0x8a48('0x10')]++,'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});for(var _0xddf9c=0x0,_0xef2e7e=0x0;_0xddf9c<_0x2456b7[_0x442500][_0x8a48('0x2a')];_0xddf9c+=0x1,_0xef2e7e=0x0){var _0x46fc2b=_0x2456b7[_0x442500][_0xddf9c];if(_0x46fc2b[_0x8a48('0x16')]){_0x46fc2b[_0x8a48('0x16')]=_0x46fc2b[_0x8a48('0x16')][_0x8a48('0x2b')]();}var _0x5defc6=[];var _0x33d78c=[];delete _0x46fc2b['id'];delete _0x46fc2b[_0x8a48('0x2c')];delete _0x46fc2b['updatedAt'];var _0x2106fd=_0x46fc2b[_0x8a48('0x2d')]!==_0x8a48('0x2e')?[_0x46fc2b[_0x8a48('0x2d')]]:_0x46fc2b[_0x8a48('0x7')]?_[_0x8a48('0xa')](_[_0x8a48('0xc')](_0x2951b2['intervals'],{'IntervalId':_0x46fc2b[_0x8a48('0x7')]}),_0x8a48('0x2d')):[];if(_0x46fc2b[_0x8a48('0x23')](_0x8a48('0x2f'))){if(_0x46fc2b[_0x8a48('0x2f')]&&_0x46fc2b[_0x8a48('0x2f')]!=='--'){_0x5defc6[_0x8a48('0x15')]({'type':_0x46fc2b[_0x8a48('0x16')],'app':'Set','appdata':_0x8a48('0x30')+_0x46fc2b['tag'],'context':_0x46fc2b['context'],'exten':_0x46fc2b[_0x8a48('0x14')],'priority':_0x2106fd[_0x8a48('0x2a')]+_0x2951b2['priority']+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});}}if(_0x46fc2b['type']==='outbound'&&_0x46fc2b['hasOwnProperty']('callerID')){if(_0x46fc2b[_0x8a48('0x31')]){_0x5defc6['push']({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x32'),'appdata':_0x8a48('0x33')+_0x46fc2b[_0x8a48('0x31')]+')','context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b[_0x8a48('0x14')],'priority':_0x2106fd[_0x8a48('0x2a')]+_0x2951b2[_0x8a48('0x10')]+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});}else{_0x5defc6[_0x8a48('0x15')]({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x32'),'appdata':_0x8a48('0x34'),'context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b['exten'],'priority':_0x2106fd[_0x8a48('0x2a')]+_0x2951b2[_0x8a48('0x10')]+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});}}if(_0x46fc2b[_0x8a48('0x23')](_0x8a48('0x35'))){if(_0x1c583c[_0x8a48('0x36')](_0x46fc2b[_0x8a48('0x37')][_0x8a48('0x2b')]())>=0x0&&_0x46fc2b[_0x8a48('0x38')]!==_0x8a48('0x39')){if(_0x46fc2b[_0x8a48('0x35')]){_0x5defc6['push']({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x32'),'appdata':_0x8a48('0x3a'),'context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b[_0x8a48('0x14')],'priority':_0x2106fd['length']+_0x2951b2['priority']+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});_0x5defc6['push']({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x8a48('0x3b'),'context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b[_0x8a48('0x14')],'priority':_0x2106fd[_0x8a48('0x2a')]+_0x2951b2[_0x8a48('0x10')]+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b['VoiceExtensionId']});}else{_0x5defc6[_0x8a48('0x15')]({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x32'),'appdata':_0x8a48('0x3c'),'context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b['exten'],'priority':_0x2106fd['length']+_0x2951b2['priority']+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});_0x5defc6[_0x8a48('0x15')]({'type':_0x46fc2b[_0x8a48('0x16')],'app':_0x8a48('0x17'),'appdata':_0x8a48('0x3d'),'context':_0x46fc2b[_0x8a48('0x1d')],'exten':_0x46fc2b[_0x8a48('0x14')],'priority':_0x2106fd[_0x8a48('0x2a')]+_0x2951b2[_0x8a48('0x10')]+_0xef2e7e++,'VoiceExtensionId':_0x46fc2b[_0x8a48('0x1e')]});}}}for(var _0x4d9d4f=0x0;_0x4d9d4f<_0x2106fd[_0x8a48('0x2a')];_0x4d9d4f+=0x1){var _0x53e4cd=_0x2951b2[_0x8a48('0x10')]+_0x2106fd[_0x8a48('0x2a')];var _0x3ff958=_0x4d9d4f===_0x2106fd['length']-0x1?_0x2951b2[_0x8a48('0x10')]+_0x5defc6[_0x8a48('0x2a')]+_0x33d78c['length']+0x2:_0x2951b2['priority']+_0x4d9d4f+0x1;_0x5defc6[_0x8a48('0x3e')](_0x4d9d4f,0x0,{'type':_0x46fc2b[_0x8a48('0x16')],'app':'GotoIfTime','appdata':_0x2106fd[_0x4d9d4f]+'?'+_0x46fc2b[_0x8a48('0x1d')]+_0x8a48('0x3f')+_0x53e4cd+':'+_0x46fc2b[_0x8a48('0x1d')]+_0x8a48('0x3f')+_0x3ff958,'exten':_0x46fc2b[_0x8a48('0x14')],'context':_0x46fc2b[_0x8a48('0x1d')],'priority':_0x2951b2[_0x8a48('0x10')]+_0x4d9d4f,'VoiceExtensionId':_0x2456b7[_0x442500][0x0][_0x8a48('0x1e')]});}_0x46fc2b[_0x8a48('0x10')]=_0x5defc6[_0x8a48('0x2a')]?_[_0x8a48('0x40')](_0x5defc6)['priority']+0x1:_0x2951b2[_0x8a48('0x10')];_0x2951b2[_0x8a48('0x10')]=(_0x33d78c[_0x8a48('0x2a')]?_[_0x8a48('0x40')](_0x33d78c)[_0x8a48('0x10')]:_0x46fc2b[_0x8a48('0x10')])+0x1;_0x2951b2[_0x8a48('0x11')]=_[_0x8a48('0x41')](_0x2951b2[_0x8a48('0x11')],_0x5defc6,[_0x46fc2b],_0x33d78c);}_0x2951b2[_0x8a48('0x11')][_0x8a48('0x15')]({'type':_0x2456b7[_0x442500][0x0][_0x8a48('0x16')],'app':_0x8a48('0x42'),'exten':_0x2456b7[_0x442500][0x0][_0x8a48('0x14')],'context':_0x2456b7[_0x442500][0x0]['context'],'priority':_0x2951b2[_0x8a48('0x10')],'VoiceExtensionId':_0x2456b7[_0x442500][0x0]['VoiceExtensionId']});_0x3e2cca[_0x8a48('0x15')](_0x2456b7[_0x442500][0x0]['VoiceExtensionId']);_0x151456=_['concat'](_0x151456,_0x2951b2[_0x8a48('0x11')]);}}return _0x26dfc7[_0x8a48('0x43')](function(_0x2a7ef1){return _0x26dfc7[_0x8a48('0x2')][_0x8a48('0x8')][_0x8a48('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x3e2cca}},'transaction':_0x2a7ef1})[_0x8a48('0x5')](function(_0xea0f39){return _0x26dfc7[_0x8a48('0x2')][_0x8a48('0x8')]['bulkCreate'](_[_0x8a48('0x45')](_0x151456,_0x8a48('0x10')),{'transaction':_0x2a7ef1});});});})[_0x8a48('0x46')](function(_0x1d6b53){console[_0x8a48('0x47')](_0x1d6b53);});}exports[_0x8a48('0x48')]=rewrite; \ No newline at end of file +var _0xa5fb=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none'];(function(_0xeb66a8,_0x2caffb){var _0x298162=function(_0x2549eb){while(--_0x2549eb){_0xeb66a8['push'](_0xeb66a8['shift']());}};_0x298162(++_0x2caffb);}(_0xa5fb,0xb3));var _0xba5f=function(_0x51f97d,_0x133219){_0x51f97d=_0x51f97d-0x0;var _0x33c9aa=_0xa5fb[_0x51f97d];return _0x33c9aa;};'use strict';var _=require(_0xba5f('0x0'));var util=require(_0xba5f('0x1'));function rewrite(_0x18529c,_0x2f2d12){var _0x3d72ab=this;return _0x18529c[_0xba5f('0x2')][_0xba5f('0x3')][_0xba5f('0x4')]({'raw':!![]})['then'](function(_0x12f5e2){_0x3d72ab[_0xba5f('0x5')]=_0x12f5e2;return _0x18529c[_0xba5f('0x2')][_0xba5f('0x6')][_0xba5f('0x4')]({'where':{'IntervalId':_0x2f2d12[_0xba5f('0x7')]},'raw':!![]});})[_0xba5f('0x8')](function(_0x5d2ddc){return _0x18529c[_0xba5f('0x2')][_0xba5f('0x6')][_0xba5f('0x4')]({'where':{'exten':{'$in':_[_0xba5f('0x9')](_[_0xba5f('0xa')](_0x5d2ddc,_0xba5f('0xb')))}},'order':[{'raw':_0xba5f('0xc')}],'raw':!![]});})['then'](function(_0x26b1de){var _0x53522b=_[_0xba5f('0xd')](_0x26b1de,{'priority':'1'});var _0x200eb3=_[_0xba5f('0xd')](_0x26b1de,{'isApp':0x1});var _0x3737ac=_['groupBy'](_0x200eb3,_0xba5f('0xb'));var _0x1e883b=['queue',_0xba5f('0xe')];var _0x19e35f=[];var _0x5cbb0a=[];for(var _0x245699 in _0x3737ac){if(_0x3737ac['hasOwnProperty'](_0x245699)){_0x3d72ab[_0xba5f('0xf')]=0x2;_0x3d72ab[_0xba5f('0x10')]=[];_0x3d72ab[_0xba5f('0x11')]=_[_0xba5f('0x12')](_0x53522b,{'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')]});_0x3d72ab['extensions'][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0]['type'],'app':_0xba5f('0x14'),'appdata':util[_0xba5f('0x15')](_0xba5f('0x16'),_0x3737ac[_0x245699][0x0][_0xba5f('0x17')]),'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab['priority']++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});if(_0x3737ac[_0x245699][0x0]['type']==='outbound'){if(_0x3d72ab[_0xba5f('0x11')]){_0x3d72ab[_0xba5f('0x10')]['push']({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':'Set','appdata':_0xba5f('0x1a')+(_0x3d72ab[_0xba5f('0x11')]['cutdigits']?_0xba5f('0x1b')+_0x3d72ab[_0xba5f('0x11')][_0xba5f('0x1c')]+'}':_0xba5f('0x1d')),'context':_0x3737ac[_0x245699][0x0]['context'],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});}_0x3d72ab['extensions'][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x1e')+_0x3737ac[_0x245699][0x0][_0xba5f('0x19')],'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab['priority']++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0]['VoiceExtensionId']});var _0x2044aa=_0x3d72ab[_0xba5f('0xf')]++;_0x3d72ab['extensions'][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x1f'),'appdata':_0xba5f('0x20')+(_0x2044aa+0x2)+_0xba5f('0x21')+(_0x2044aa+0x1)+')','context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x2044aa,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});if(_0x3d72ab[_0xba5f('0x11')]){_0x3d72ab['extensions'][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0x3d72ab[_0xba5f('0x11')][_0xba5f('0x1c')]?_0xba5f('0x22')+_0x3d72ab['extension']['cutdigits']+'}':_0xba5f('0x23'),'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0]['exten'],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});}_0x3d72ab[_0xba5f('0x10')]['push']({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x24')+_0x3737ac[_0x245699][0x0][_0xba5f('0x19')],'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0]['exten'],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});if(_0x3d72ab[_0xba5f('0x11')]&&_0x3d72ab['extension'][_0xba5f('0x25')](_0xba5f('0x26'))&&_0x3d72ab[_0xba5f('0x11')]['recordingFormat']!==_0xba5f('0x27')){_0x3d72ab['extensions'][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x28'),'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});_0x3d72ab[_0xba5f('0x10')]['push']({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x29')+_0x3d72ab[_0xba5f('0x11')]['recordingFormat']||_0xba5f('0x2a'),'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});}}_0x3d72ab[_0xba5f('0x10')][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0]['type'],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x2b'),'context':_0x3737ac[_0x245699][0x0]['context'],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});_0x3d72ab[_0xba5f('0x10')][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0]['VoiceExtensionId']});_0x3d72ab[_0xba5f('0x10')][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':_0xba5f('0x2c'),'context':_0x3737ac[_0x245699][0x0][_0xba5f('0x18')],'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'priority':_0x3d72ab[_0xba5f('0xf')]++,'VoiceExtensionId':_0x3737ac[_0x245699][0x0]['VoiceExtensionId']});for(var _0x5dd82f=0x0,_0x2ecf1a=0x0;_0x5dd82f<_0x3737ac[_0x245699]['length'];_0x5dd82f+=0x1,_0x2ecf1a=0x0){var _0x3c1021=_0x3737ac[_0x245699][_0x5dd82f];if(_0x3c1021['type']){_0x3c1021[_0xba5f('0x17')]=_0x3c1021['type'][_0xba5f('0x2d')]();}var _0x342c2c=[];var _0x20d815=[];delete _0x3c1021['id'];delete _0x3c1021[_0xba5f('0x2e')];delete _0x3c1021['updatedAt'];var _0x494d13=_0x3c1021[_0xba5f('0x2f')]!==_0xba5f('0x30')?[_0x3c1021[_0xba5f('0x2f')]]:_0x3c1021[_0xba5f('0x7')]?_['map'](_['filter'](_0x3d72ab[_0xba5f('0x5')],{'IntervalId':_0x3c1021['IntervalId']}),_0xba5f('0x2f')):[];if(_0x3c1021[_0xba5f('0x25')](_0xba5f('0x31'))){if(_0x3c1021[_0xba5f('0x31')]&&_0x3c1021[_0xba5f('0x31')]!=='--'){_0x342c2c['push']({'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':'CDR(tag)='+_0x3c1021[_0xba5f('0x31')],'context':_0x3c1021['context'],'exten':_0x3c1021['exten'],'priority':_0x494d13[_0xba5f('0x32')]+_0x3d72ab[_0xba5f('0xf')]+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});}}if(_0x3c1021['type']==='outbound'&&_0x3c1021[_0xba5f('0x25')](_0xba5f('0x33'))){if(_0x3c1021['callerID']){_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x1f'),'appdata':_0xba5f('0x34')+_0x3c1021[_0xba5f('0x33')]+')','context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021['exten'],'priority':_0x494d13['length']+_0x3d72ab[_0xba5f('0xf')]+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});}else{_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x1f'),'appdata':_0xba5f('0x35'),'context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021[_0xba5f('0xb')],'priority':_0x494d13[_0xba5f('0x32')]+_0x3d72ab['priority']+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021['VoiceExtensionId']});}}if(_0x3c1021[_0xba5f('0x25')](_0xba5f('0x36'))){if(_0x1e883b[_0xba5f('0x37')](_0x3c1021[_0xba5f('0x38')]['toLowerCase']())>=0x0&&_0x3c1021[_0xba5f('0x39')]!==_0xba5f('0x3a')){if(_0x3c1021['answer']){_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x1f'),'appdata':_0xba5f('0x3b'),'context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021[_0xba5f('0xb')],'priority':_0x494d13[_0xba5f('0x32')]+_0x3d72ab[_0xba5f('0xf')]+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021[_0xba5f('0x17')],'app':'Set','appdata':_0xba5f('0x3c'),'context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021[_0xba5f('0xb')],'priority':_0x494d13['length']+_0x3d72ab[_0xba5f('0xf')]+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});}else{_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021['type'],'app':_0xba5f('0x1f'),'appdata':_0xba5f('0x3d'),'context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021[_0xba5f('0xb')],'priority':_0x494d13[_0xba5f('0x32')]+_0x3d72ab['priority']+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});_0x342c2c[_0xba5f('0x13')]({'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3c1021[_0xba5f('0x18')],'exten':_0x3c1021[_0xba5f('0xb')],'priority':_0x494d13[_0xba5f('0x32')]+_0x3d72ab[_0xba5f('0xf')]+_0x2ecf1a++,'VoiceExtensionId':_0x3c1021[_0xba5f('0x19')]});}}}for(var _0x4004e1=0x0;_0x4004e1<_0x494d13['length'];_0x4004e1+=0x1){var _0x3cee3e=_0x3d72ab[_0xba5f('0xf')]+_0x494d13[_0xba5f('0x32')];var _0x4ca99f=_0x4004e1===_0x494d13[_0xba5f('0x32')]-0x1?_0x3d72ab[_0xba5f('0xf')]+_0x342c2c['length']+_0x20d815[_0xba5f('0x32')]+0x2:_0x3d72ab['priority']+_0x4004e1+0x1;_0x342c2c[_0xba5f('0x3e')](_0x4004e1,0x0,{'type':_0x3c1021[_0xba5f('0x17')],'app':_0xba5f('0x3f'),'appdata':_0x494d13[_0x4004e1]+'?'+_0x3c1021['context']+_0xba5f('0x40')+_0x3cee3e+':'+_0x3c1021[_0xba5f('0x18')]+_0xba5f('0x40')+_0x4ca99f,'exten':_0x3c1021[_0xba5f('0xb')],'context':_0x3c1021[_0xba5f('0x18')],'priority':_0x3d72ab[_0xba5f('0xf')]+_0x4004e1,'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});}_0x3c1021[_0xba5f('0xf')]=_0x342c2c[_0xba5f('0x32')]?_['last'](_0x342c2c)['priority']+0x1:_0x3d72ab['priority'];_0x3d72ab[_0xba5f('0xf')]=(_0x20d815[_0xba5f('0x32')]?_[_0xba5f('0x41')](_0x20d815)[_0xba5f('0xf')]:_0x3c1021['priority'])+0x1;_0x3d72ab[_0xba5f('0x10')]=_['concat'](_0x3d72ab[_0xba5f('0x10')],_0x342c2c,[_0x3c1021],_0x20d815);}_0x3d72ab[_0xba5f('0x10')][_0xba5f('0x13')]({'type':_0x3737ac[_0x245699][0x0][_0xba5f('0x17')],'app':_0xba5f('0x42'),'exten':_0x3737ac[_0x245699][0x0][_0xba5f('0xb')],'context':_0x3737ac[_0x245699][0x0]['context'],'priority':_0x3d72ab['priority'],'VoiceExtensionId':_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]});_0x19e35f[_0xba5f('0x13')](_0x3737ac[_0x245699][0x0][_0xba5f('0x19')]);_0x5cbb0a=_['concat'](_0x5cbb0a,_0x3d72ab[_0xba5f('0x10')]);}}return _0x18529c[_0xba5f('0x43')](function(_0x2b1453){return _0x18529c['models'][_0xba5f('0x6')][_0xba5f('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x19e35f}},'transaction':_0x2b1453})['then'](function(_0x4bccda){return _0x18529c['models'][_0xba5f('0x6')][_0xba5f('0x45')](_[_0xba5f('0x46')](_0x5cbb0a,_0xba5f('0xf')),{'transaction':_0x2b1453});});});})[_0xba5f('0x47')](function(_0x4df1e7){console[_0xba5f('0x48')](_0x4df1e7);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index a697589..4e0ac85 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 _0x3bbe=['where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_contacts','str','cm_hopper_final','id\x20IN\x20?','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','error','errors','length','map','message','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x3bbe,0xfe));var _0xe3bb=function(_0x5f0225,_0x52631a){_0x5f0225=_0x5f0225-0x0;var _0x2cef4b=_0x3bbe[_0x5f0225];return _0x2cef4b;};'use strict';var BPromise=require(_0xe3bb('0x0'));var util=require(_0xe3bb('0x1'));var _=require(_0xe3bb('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xe3bb('0x3'));var Redis=require('ioredis');var db=require(_0xe3bb('0x4'))['db'];var config=require(_0xe3bb('0x5'));var logger=require(_0xe3bb('0x6'))(_0xe3bb('0x7'));config[_0xe3bb('0x8')]=_[_0xe3bb('0x9')](config[_0xe3bb('0x8')],{'host':_0xe3bb('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3bb('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0xe3bb('0xb')](socket);try{if(!process[_0xe3bb('0xc')][0x2]||process[_0xe3bb('0xc')][0x2]===_0xe3bb('0xd')||process['argv'][0x2]===_0xe3bb('0xe')){throw new Error(_0xe3bb('0xf'));}var FILEPATH=process[_0xe3bb('0xc')][0x2];if(!process[_0xe3bb('0xc')][0x3]||process[_0xe3bb('0xc')][0x3]===_0xe3bb('0xd')||process['argv'][0x3]===_0xe3bb('0xe')||!process[_0xe3bb('0xc')][0x4]||process['argv'][0x4]==='undefined'||process[_0xe3bb('0xc')][0x4]===_0xe3bb('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xe3bb('0x10')](process[_0xe3bb('0xc')][0x3][_0xe3bb('0x11')](','),process[_0xe3bb('0xc')][0x4][_0xe3bb('0x11')](','));if(!process[_0xe3bb('0xc')][0x5]||process['argv'][0x5]==='undefined'||process[_0xe3bb('0xc')][0x5]===_0xe3bb('0xe')){throw new Error(_0xe3bb('0x12'));}var LISTID=process[_0xe3bb('0xc')][0x5];var COMPANYID=process[_0xe3bb('0xc')][0x6]&&process['argv'][0x6]!==_0xe3bb('0xd')&&process[_0xe3bb('0xc')][0x6]!==_0xe3bb('0xe')?process[_0xe3bb('0xc')][0x6]:null;var DUPLICATES=process[_0xe3bb('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process['argv'][0x7]!=='null'?process[_0xe3bb('0xc')][0x7]:null;if(!process[_0xe3bb('0xc')][0x8]||process['argv'][0x8]===_0xe3bb('0xd')||process[_0xe3bb('0xc')][0x8]==='null'){throw new Error(_0xe3bb('0x13'));}var SOCKET_TIMESTAMP=process[_0xe3bb('0xc')][0x8];}catch(_0x4de1ce){logger['error'](_0x4de1ce);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(_0x901025,_0x585990,_0x537bfa,_0x5a8acb){var _0x2e32a4={'message':_0x585990};_0x2e32a4[_0x901025]=!![];if(_0x537bfa){_0x2e32a4[_0xe3bb('0x14')]=_0x537bfa;}if(_0x5a8acb){_0x2e32a4['index']=_0x5a8acb;}return _0x2e32a4;}function isEmail(_0x1f5a63){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))*$/[_0xe3bb('0x15')](_0x1f5a63);}function checkRow(_0x142a7a,_0xb131f9,_0xba679a){return new BPromise(function(_0x338b30,_0x2a8408){if(_[_0xe3bb('0x16')](_0x142a7a)){return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0xba679a));}if(_0x142a7a[_0xe3bb('0x18')]&&_0x142a7a[_0xe3bb('0x18')][_0xe3bb('0x19')]){var _0xcca03b=_[_0xe3bb('0x1a')](_0x142a7a[_0xe3bb('0x18')],_0xe3bb('0x1b'))['join'](';');return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),_0xcca03b,null,_0xba679a));}var _0x5349de={};for(var _0x5a5f73 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5a5f73)&&FIELDS[_0x5a5f73]){_0x5349de[_0x5a5f73]=_0x142a7a['data'][0x0][FIELDS[_0x5a5f73]]||_0x142a7a[_0xe3bb('0x1c')][0x0]['\ufeff'+FIELDS[_0x5a5f73]];}}if(!_0x5349de[_0xe3bb('0x1d')]){return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),_0xe3bb('0x1e'),null,_0xba679a));}if(!_0x5349de[_0xe3bb('0x1f')]){return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),_0xe3bb('0x20'),null,_0xba679a));}if(_0x5349de[_0xe3bb('0x21')]){var _0x2896ce=moment(_0x5349de['birthDate'],'YYYY-MM-DD');if(!_0x2896ce[_0xe3bb('0x22')]()){return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),_0xe3bb('0x23'),null,_0xba679a));}}if(_0x5349de[_0xe3bb('0x24')]){if(!isEmail(_0x5349de['email'])){return _0x2a8408(handleCheckRowError(_0xe3bb('0x17'),_0xe3bb('0x25'),null,_0xba679a));}}_0x5349de[_0xe3bb('0x26')]=LISTID;_0x5349de['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0xb131f9){var _0x383a81={};for(var _0x5cb399=0x0,_0x431eba=DUPLICATES[_0xe3bb('0x19')];_0x5cb399<_0x431eba;_0x5cb399+=0x1){_0x383a81[DUPLICATES[_0x5cb399]]=_0x5349de[DUPLICATES[_0x5cb399]];}var _0xb4f8a6=_[_0xe3bb('0x27')](_0xb131f9,_0x383a81);if(_0xb4f8a6){return _0x2a8408(handleCheckRowError(_0xe3bb('0x28'),_0xe3bb('0x29'),_0xb4f8a6,_0xba679a));}}return db['CmContact']['create'](_0x5349de,{'raw':!![],'hooks':![],'fields':_['keys'](_0x5349de)})[_0xe3bb('0x2a')](function(_0x57f1c8){if(DUPLICATES&&DUPLICATES['length']&&_0xb131f9){_0xb131f9[_0xe3bb('0x2b')](_[_0xe3bb('0x2c')](_0x5349de,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x57f1c8['id'];return _0x338b30();})[_0xe3bb('0x2d')](function(_0x41b1db){return _0x2a8408(handleCheckRowError('error',_0xe3bb('0x2e')+(_0x41b1db[_0xe3bb('0x1b')]||JSON[_0xe3bb('0x2f')](_0x41b1db)),null,_0xba679a));});});}function checkHopper(){function _0x4b95c5(){return function(_0xf945ff){logger[_0xe3bb('0x17')]('cmContact',_0xe3bb('0x30'),util[_0xe3bb('0x31')](_0xf945ff,{'showHidden':![],'depth':null}));};}var _0x3d52bf=function(_0x1bc4dc,_0x5939ec){var _0x1aada2=squel[_0xe3bb('0x32')]()[_0xe3bb('0x33')](_0xe3bb('0x34'))[_0xe3bb('0x35')]([_0xe3bb('0x1f'),_0xe3bb('0x36'),_0xe3bb('0x37'),_0xe3bb('0x26'),_0x5939ec,_0xe3bb('0x38'),_0xe3bb('0x39')],squel[_0xe3bb('0x3a')]()[_0xe3bb('0x3b')](_0xe3bb('0x1f'),_0xe3bb('0x1f'))['field'](_0xe3bb('0x3c'),_0xe3bb('0x36'))[_0xe3bb('0x3b')]('id',_0xe3bb('0x37'))[_0xe3bb('0x3b')](LISTID[_0xe3bb('0x3d')](),_0xe3bb('0x26'))[_0xe3bb('0x3b')](_0x1bc4dc['id'][_0xe3bb('0x3d')](),_0x5939ec)['field'](_0xe3bb('0x3c'),_0xe3bb('0x38'))[_0xe3bb('0x3b')](_0xe3bb('0x3c'),_0xe3bb('0x39'))[_0xe3bb('0x3e')]('cm_contacts')['where'](_0xe3bb('0x3f'))[_0xe3bb('0x40')](_0xe3bb('0x41'),LISTID[_0xe3bb('0x3d')]())[_0xe3bb('0x40')](_0xe3bb('0x42'))['where'](_0xe3bb('0x43'),squel[_0xe3bb('0x3a')]()[_0xe3bb('0x3b')](_0xe3bb('0x1f'))[_0xe3bb('0x3e')](_0xe3bb('0x34'))[_0xe3bb('0x40')](_0x5939ec+_0xe3bb('0x44'),_0x1bc4dc['id'][_0xe3bb('0x3d')]())))['toString']();return _0x1aada2;};var _0x4b9345=function(_0x27f8f0,_0x5d84d9){var _0x5a639f=squel['insert']()[_0xe3bb('0x33')](_0xe3bb('0x34'))['fromQuery'](['phone',_0xe3bb('0x36'),_0xe3bb('0x37'),_0xe3bb('0x26'),_0x5d84d9,_0xe3bb('0x38'),_0xe3bb('0x39')],squel['select']()[_0xe3bb('0x3b')](_0xe3bb('0x1f'),_0xe3bb('0x1f'))[_0xe3bb('0x3b')](_0xe3bb('0x3c'),_0xe3bb('0x36'))['field']('id',_0xe3bb('0x37'))[_0xe3bb('0x3b')](LISTID['toString'](),_0xe3bb('0x26'))[_0xe3bb('0x3b')](_0x27f8f0['id'][_0xe3bb('0x3d')](),_0x5d84d9)['field'](_0xe3bb('0x3c'),_0xe3bb('0x38'))[_0xe3bb('0x3b')](_0xe3bb('0x3c'),'updatedAt')[_0xe3bb('0x3e')](_0xe3bb('0x45'))[_0xe3bb('0x40')](_0xe3bb('0x3f'))[_0xe3bb('0x40')]('ListId\x20=\x20?',LISTID[_0xe3bb('0x3d')]())[_0xe3bb('0x40')]('id\x20IN\x20?',squel[_0xe3bb('0x46')](hopperContacts))[_0xe3bb('0x40')](_0xe3bb('0x42'))[_0xe3bb('0x40')](_0xe3bb('0x43'),squel[_0xe3bb('0x3a')]()['field']('calleridnum')[_0xe3bb('0x3e')](_0xe3bb('0x47'))['where'](_0x5d84d9+_0xe3bb('0x44'),_0x27f8f0['id'][_0xe3bb('0x3d')]()))[_0xe3bb('0x40')](_0xe3bb('0x43'),squel[_0xe3bb('0x3a')]()[_0xe3bb('0x3b')](_0xe3bb('0x1f'))[_0xe3bb('0x3e')](_0xe3bb('0x34'))[_0xe3bb('0x40')](_0x5d84d9+_0xe3bb('0x44'),_0x27f8f0['id']['toString']())))[_0xe3bb('0x3d')]();return _0x5a639f;};function _0x2990e6(_0x5edede,_0x481e26){var _0x25b0f7=squel[_0xe3bb('0x32')]()[_0xe3bb('0x33')]('cm_hopper')[_0xe3bb('0x35')]([_0xe3bb('0x1f'),_0xe3bb('0x36'),_0xe3bb('0x37'),_0xe3bb('0x26'),_0x481e26,_0xe3bb('0x38'),_0xe3bb('0x39')],squel[_0xe3bb('0x3a')]()[_0xe3bb('0x3b')](_0xe3bb('0x1f'),_0xe3bb('0x1f'))[_0xe3bb('0x3b')](_0xe3bb('0x3c'),_0xe3bb('0x36'))[_0xe3bb('0x3b')]('id',_0xe3bb('0x37'))['field'](LISTID['toString'](),'ListId')[_0xe3bb('0x3b')](_0x5edede['id'][_0xe3bb('0x3d')](),_0x481e26)[_0xe3bb('0x3b')](_0xe3bb('0x3c'),'createdAt')['field']('NOW()','updatedAt')[_0xe3bb('0x3e')](_0xe3bb('0x45'))['where'](_0xe3bb('0x3f'))['where'](_0xe3bb('0x41'),LISTID[_0xe3bb('0x3d')]())[_0xe3bb('0x40')](_0xe3bb('0x48'),squel['str'](hopperContacts))[_0xe3bb('0x40')](_0xe3bb('0x42')))['toString']();return _0x25b0f7;}function _0x2cf99d(_0x400abd,_0x95becd){var _0x30d9c6=squel[_0xe3bb('0x32')]()[_0xe3bb('0x33')]('cm_hopper_black')[_0xe3bb('0x35')]([_0xe3bb('0x1f'),_0xe3bb('0x37'),_0xe3bb('0x26'),_0x95becd,_0xe3bb('0x38'),_0xe3bb('0x39')],squel[_0xe3bb('0x3a')]()[_0xe3bb('0x3b')](_0xe3bb('0x1f'),_0xe3bb('0x1f'))[_0xe3bb('0x3b')]('id',_0xe3bb('0x37'))['field'](LISTID[_0xe3bb('0x3d')](),'ListId')[_0xe3bb('0x3b')](_0x400abd['id']['toString'](),_0x95becd)['field'](_0xe3bb('0x3c'),_0xe3bb('0x38'))[_0xe3bb('0x3b')](_0xe3bb('0x3c'),_0xe3bb('0x39'))['from'](_0xe3bb('0x45'))[_0xe3bb('0x40')](_0xe3bb('0x3f'))[_0xe3bb('0x40')]('ListId\x20=\x20?',LISTID[_0xe3bb('0x3d')]())[_0xe3bb('0x40')]('id\x20IN\x20?',squel[_0xe3bb('0x46')](hopperContacts))[_0xe3bb('0x40')](_0xe3bb('0x42')))[_0xe3bb('0x3d')]();return _0x30d9c6;}return db[_0xe3bb('0x49')]['findAll']({'where':{'type':_0xe3bb('0x4a')},'attributes':['id',_0xe3bb('0x4b')],'include':[{'model':db[_0xe3bb('0x4c')],'as':_0xe3bb('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0x1fe621){var _0x1f6896=[];if(_0x1fe621){var _0x5e2254;for(var _0xca00db=0x0,_0x5c1059;_0xca00db<_0x1fe621['length'];_0xca00db+=0x1){_0x5c1059=_0x1fe621[_0xca00db][_0xe3bb('0x4e')]({'plain':!![]});switch(_0x5c1059[_0xe3bb('0x4b')]){case _0xe3bb('0x4f'):_0x1f6896[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x4b9345(_0x5c1059,_0xe3bb('0x52')))['then'](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));break;case _0xe3bb('0x53'):_0x1f6896[_0xe3bb('0x2b')](db[_0xe3bb('0x50')]['query'](_0x3d52bf(_0x5c1059,_0xe3bb('0x52')))[_0xe3bb('0x2a')](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));break;default:_0x1f6896[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x2990e6(_0x5c1059,_0xe3bb('0x52')))['then'](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));}}}return _0x1f6896;})[_0xe3bb('0x54')]()[_0xe3bb('0x2a')](function(){return db[_0xe3bb('0x49')][_0xe3bb('0x55')]({'where':{'type':_0xe3bb('0x4a')},'attributes':['id'],'include':[{'model':db[_0xe3bb('0x4c')],'as':_0xe3bb('0x56'),'where':{'id':LISTID}}]})[_0xe3bb('0x2a')](function(_0x5b1c4f){var _0x3246b2=[];if(_0x5b1c4f){var _0x3aa3e2;for(var _0x3b68b7=0x0,_0x443d82;_0x3b68b7<_0x5b1c4f[_0xe3bb('0x19')];_0x3b68b7+=0x1){_0x443d82=_0x5b1c4f[_0x3b68b7][_0xe3bb('0x4e')]({'plain':!![]});_0x3246b2[_0xe3bb('0x2b')](db[_0xe3bb('0x50')]['query'](_0x2cf99d(_0x443d82,'VoiceQueueId'))[_0xe3bb('0x2a')](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));}}return _0x3246b2;})[_0xe3bb('0x54')]();})['then'](function(){return db[_0xe3bb('0x57')][_0xe3bb('0x55')]({'attributes':['id',_0xe3bb('0x4b')],'include':[{'model':db[_0xe3bb('0x4c')],'as':_0xe3bb('0x4d'),'where':{'id':LISTID}}]})[_0xe3bb('0x2a')](function(_0x420adc){var _0x2294a6=[];if(_0x420adc){for(var _0x4bcbfe=0x0,_0x2a5577;_0x4bcbfe<_0x420adc[_0xe3bb('0x19')];_0x4bcbfe+=0x1){_0x2a5577=_0x420adc[_0x4bcbfe][_0xe3bb('0x4e')]({'plain':!![]});switch(_0x2a5577[_0xe3bb('0x4b')]){case'always':_0x2294a6[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x4b9345(_0x2a5577,_0xe3bb('0x58')))[_0xe3bb('0x2a')](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));break;case'onlyIfOpen':_0x2294a6[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x3d52bf(_0x2a5577,_0xe3bb('0x58')))[_0xe3bb('0x2a')](function(){})['catch'](_0x4b95c5()));break;default:_0x2294a6[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x2990e6(_0x2a5577,_0xe3bb('0x58')))[_0xe3bb('0x2a')](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));}}}return _0x2294a6;})[_0xe3bb('0x54')]();})[_0xe3bb('0x2a')](function(){return db['Campaign'][_0xe3bb('0x55')]({'attributes':['id'],'include':[{'model':db[_0xe3bb('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xe3bb('0x2a')](function(_0x5d7573){var _0x52ae19=[];if(_0x5d7573){for(var _0x37577e=0x0,_0x119a90;_0x37577e<_0x5d7573[_0xe3bb('0x19')];_0x37577e+=0x1){_0x119a90=_0x5d7573[_0x37577e][_0xe3bb('0x4e')]({'plain':!![]});_0x52ae19[_0xe3bb('0x2b')](db[_0xe3bb('0x50')][_0xe3bb('0x51')](_0x2cf99d(_0x119a90,_0xe3bb('0x58')))[_0xe3bb('0x2a')](function(){})[_0xe3bb('0x2d')](_0x4b95c5()));}}return _0x52ae19;})[_0xe3bb('0x54')]();})['catch'](function(_0x24cacf){logger['error']('cmContact,\x20%s,\x20%s',_0xe3bb('0x59'),_0x24cacf[_0xe3bb('0x1b')]);});}var processPromises=function(_0x33e600){return BPromise['all'](promises)[_0xe3bb('0x2a')](function(_0xf57363){})[_0xe3bb('0x2d')](function(_0x5a7ce7){logger[_0xe3bb('0x17')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x5a7ce7));})[_0xe3bb('0x5a')](function(){socket[_0xe3bb('0x5b')](_0xe3bb('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x33e600){return _0x33e600[_0xe3bb('0x5d')]();}});};var endCsv=function(){return BPromise[_0xe3bb('0x5e')]()[_0xe3bb('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xe3bb('0x2a')](function(){socket[_0xe3bb('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x360890){logger['error'](_0xe3bb('0x5f'),JSON['stringify'](_0x360890));}finally{process[_0xe3bb('0x60')](0x0);}});};process['on'](_0xe3bb('0x61'),function(){logger[_0xe3bb('0x62')](_0xe3bb('0x63'));endCsv();});function main(){return BPromise[_0xe3bb('0x5e')]()[_0xe3bb('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe3bb('0x11')](',');return db[_0xe3bb('0x64')][_0xe3bb('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe3bb('0x2a')](function(_0x50c0ce){var _0x15d7a2=fs[_0xe3bb('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe3bb('0x66')](_0x15d7a2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5aa17f,_0x532e65){total+=0x1;var _0x4edf63=total;promises[_0xe3bb('0x2b')](checkRow(_0x5aa17f,_0x50c0ce,_0x4edf63)[_0xe3bb('0x2a')](function(){success+=0x1;})[_0xe3bb('0x2d')](function(_0x267b04){if(_0x267b04[_0xe3bb('0x17')]){errors+=0x1;delete _0x267b04[_0xe3bb('0x17')];}else if(_0x267b04[_0xe3bb('0x28')]){duplicates+=0x1;delete _0x267b04['duplicate'];}rows[_0xe3bb('0x2b')](_0x267b04);}));if(total%0xc8===0x0){_0x532e65[_0xe3bb('0x67')]();return processPromises(_0x532e65);}},'complete':function(){return processPromises()[_0xe3bb('0x2a')](function(){logger[_0xe3bb('0x62')](_0xe3bb('0x68'));endCsv();});},'error':function(_0x305481,_0xfac482){logger[_0xe3bb('0x62')]('CSV\x20parse\x20error',JSON[_0xe3bb('0x2f')](_0x305481));endCsv();}});})['catch'](function(_0x3c00e7){logger[_0xe3bb('0x17')](_0xe3bb('0x69'),JSON['stringify'](_0x3c00e7));});}main(); \ No newline at end of file +var _0x482a=['from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','cm_contacts','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','BlackLists','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x482a,0x1ef));var _0xa482=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x482a[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require('bluebird');var util=require(_0xa482('0x0'));var _=require(_0xa482('0x1'));var fs=require('fs');var squel=require(_0xa482('0x2'));var Papa=require('papaparse');var Redis=require(_0xa482('0x3'));var db=require(_0xa482('0x4'))['db'];var config=require(_0xa482('0x5'));var logger=require(_0xa482('0x6'))(_0xa482('0x7'));config[_0xa482('0x8')]=_[_0xa482('0x9')](config[_0xa482('0x8')],{'host':_0xa482('0xa'),'port':0x18eb});var socket=require(_0xa482('0xb'))(new Redis(config[_0xa482('0x8')]));require(_0xa482('0xc'))['register'](socket);try{if(!process[_0xa482('0xd')][0x2]||process['argv'][0x2]===_0xa482('0xe')||process[_0xa482('0xd')][0x2]===_0xa482('0xf')){throw new Error(_0xa482('0x10'));}var FILEPATH=process[_0xa482('0xd')][0x2];if(!process[_0xa482('0xd')][0x3]||process[_0xa482('0xd')][0x3]==='undefined'||process['argv'][0x3]===_0xa482('0xf')||!process['argv'][0x4]||process['argv'][0x4]===_0xa482('0xe')||process[_0xa482('0xd')][0x4]===_0xa482('0xf')){throw new Error(_0xa482('0x11'));}var FIELDS=_[_0xa482('0x12')](process[_0xa482('0xd')][0x3]['split'](','),process[_0xa482('0xd')][0x4][_0xa482('0x13')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xa482('0xe')||process['argv'][0x5]==='null'){throw new Error(_0xa482('0x14'));}var LISTID=process[_0xa482('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xa482('0xd')][0x6]!==_0xa482('0xe')&&process[_0xa482('0xd')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xa482('0xd')][0x7]&&process[_0xa482('0xd')][0x7]!==_0xa482('0xe')&&process['argv'][0x7]!==_0xa482('0xf')?process['argv'][0x7]:null;if(!process[_0xa482('0xd')][0x8]||process['argv'][0x8]===_0xa482('0xe')||process[_0xa482('0xd')][0x8]==='null'){throw new Error(_0xa482('0x15'));}var SOCKET_TIMESTAMP=process[_0xa482('0xd')][0x8];}catch(_0xa138aa){logger[_0xa482('0x16')](_0xa138aa);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(_0x12ff2d,_0x508c54,_0x46e58d,_0x156091){var _0xd72d76={'message':_0x508c54};_0xd72d76[_0x12ff2d]=!![];if(_0x46e58d){_0xd72d76['contact']=_0x46e58d;}if(_0x156091){_0xd72d76['index']=_0x156091;}return _0xd72d76;}function isEmail(_0x410f36){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))*$/[_0xa482('0x17')](_0x410f36);}function checkRow(_0x16b1be,_0x27f133,_0x3a32bc){return new BPromise(function(_0x24e4a3,_0x1e39a3){if(_['isNil'](_0x16b1be)){return _0x1e39a3(handleCheckRowError('error',_0xa482('0x18'),null,_0x3a32bc));}if(_0x16b1be[_0xa482('0x19')]&&_0x16b1be['errors'][_0xa482('0x1a')]){var _0x296e6c=_[_0xa482('0x1b')](_0x16b1be[_0xa482('0x19')],'message')[_0xa482('0x1c')](';');return _0x1e39a3(handleCheckRowError(_0xa482('0x16'),_0x296e6c,null,_0x3a32bc));}var _0x228692={};for(var _0x15613c in FIELDS){if(FIELDS[_0xa482('0x1d')](_0x15613c)&&FIELDS[_0x15613c]){_0x228692[_0x15613c]=_0x16b1be[_0xa482('0x1e')][0x0][FIELDS[_0x15613c]]||_0x16b1be[_0xa482('0x1e')][0x0]['\ufeff'+FIELDS[_0x15613c]];}}if(!_0x228692[_0xa482('0x1f')]){return _0x1e39a3(handleCheckRowError(_0xa482('0x16'),_0xa482('0x20'),null,_0x3a32bc));}if(!_0x228692['phone']){return _0x1e39a3(handleCheckRowError(_0xa482('0x16'),_0xa482('0x21'),null,_0x3a32bc));}if(_0x228692[_0xa482('0x22')]){var _0x379764=moment(_0x228692[_0xa482('0x22')],'YYYY-MM-DD');if(!_0x379764['isValid']()){return _0x1e39a3(handleCheckRowError(_0xa482('0x16'),_0xa482('0x23'),null,_0x3a32bc));}}if(_0x228692['email']){if(!isEmail(_0x228692[_0xa482('0x24')])){return _0x1e39a3(handleCheckRowError(_0xa482('0x16'),_0xa482('0x25'),null,_0x3a32bc));}}_0x228692[_0xa482('0x26')]=LISTID;_0x228692[_0xa482('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x27f133){var _0x3e66e4={};for(var _0x14927a=0x0,_0x46ab53=DUPLICATES[_0xa482('0x1a')];_0x14927a<_0x46ab53;_0x14927a+=0x1){_0x3e66e4[DUPLICATES[_0x14927a]]=_0x228692[DUPLICATES[_0x14927a]];}var _0x44af96=_[_0xa482('0x28')](_0x27f133,_0x3e66e4);if(_0x44af96){return _0x1e39a3(handleCheckRowError(_0xa482('0x29'),_0xa482('0x2a'),_0x44af96,_0x3a32bc));}}return db['CmContact'][_0xa482('0x2b')](_0x228692,{'raw':!![],'hooks':![],'fields':_[_0xa482('0x2c')](_0x228692)})[_0xa482('0x2d')](function(_0x4aee41){if(DUPLICATES&&DUPLICATES[_0xa482('0x1a')]&&_0x27f133){_0x27f133[_0xa482('0x2e')](_['pick'](_0x228692,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4aee41['id'];return _0x24e4a3();})['catch'](function(_0x2d121d){return _0x1e39a3(handleCheckRowError('error',_0xa482('0x2f')+(_0x2d121d[_0xa482('0x30')]||JSON[_0xa482('0x31')](_0x2d121d)),null,_0x3a32bc));});});}function checkHopper(){function _0x4df959(){return function(_0x15ca54){logger[_0xa482('0x16')](_0xa482('0x32'),'checkHopper',util[_0xa482('0x33')](_0x15ca54,{'showHidden':![],'depth':null}));};}var _0xc9b35c=function(_0x5d9676,_0x14944a){var _0x39b55c=squel[_0xa482('0x34')]()[_0xa482('0x35')](_0xa482('0x36'))[_0xa482('0x37')]([_0xa482('0x38'),_0xa482('0x39'),_0xa482('0x3a'),_0xa482('0x26'),_0x14944a,_0xa482('0x3b'),_0xa482('0x3c')],squel[_0xa482('0x3d')]()[_0xa482('0x3e')](_0xa482('0x38'),_0xa482('0x38'))[_0xa482('0x3e')](_0xa482('0x3f'),_0xa482('0x39'))[_0xa482('0x3e')]('id','ContactId')[_0xa482('0x3e')](LISTID['toString'](),_0xa482('0x26'))[_0xa482('0x3e')](_0x5d9676['id'][_0xa482('0x40')](),_0x14944a)[_0xa482('0x3e')](_0xa482('0x3f'),_0xa482('0x3b'))[_0xa482('0x3e')]('NOW()',_0xa482('0x3c'))[_0xa482('0x41')]('cm_contacts')[_0xa482('0x42')](_0xa482('0x43'))[_0xa482('0x42')]('ListId\x20=\x20?',LISTID[_0xa482('0x40')]())[_0xa482('0x42')](_0xa482('0x44'))['where'](_0xa482('0x45'),squel['select']()[_0xa482('0x3e')]('phone')['from'](_0xa482('0x36'))[_0xa482('0x42')](_0x14944a+_0xa482('0x46'),_0x5d9676['id'][_0xa482('0x40')]())))[_0xa482('0x40')]();return _0x39b55c;};var _0x447cd7=function(_0x1e96ed,_0x2b8818){var _0xfd25c6=squel[_0xa482('0x34')]()[_0xa482('0x35')](_0xa482('0x36'))[_0xa482('0x37')]([_0xa482('0x38'),_0xa482('0x39'),'ContactId',_0xa482('0x26'),_0x2b8818,_0xa482('0x3b'),_0xa482('0x3c')],squel['select']()[_0xa482('0x3e')](_0xa482('0x38'),'phone')[_0xa482('0x3e')](_0xa482('0x3f'),'scheduledAt')[_0xa482('0x3e')]('id',_0xa482('0x3a'))[_0xa482('0x3e')](LISTID['toString'](),_0xa482('0x26'))['field'](_0x1e96ed['id'][_0xa482('0x40')](),_0x2b8818)[_0xa482('0x3e')](_0xa482('0x3f'),'createdAt')[_0xa482('0x3e')](_0xa482('0x3f'),_0xa482('0x3c'))['from']('cm_contacts')['where'](_0xa482('0x43'))[_0xa482('0x42')](_0xa482('0x47'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xa482('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xa482('0x45'),squel[_0xa482('0x3d')]()['field'](_0xa482('0x49'))['from'](_0xa482('0x4a'))['where'](_0x2b8818+'\x20=\x20?',_0x1e96ed['id'][_0xa482('0x40')]()))[_0xa482('0x42')](_0xa482('0x45'),squel['select']()[_0xa482('0x3e')](_0xa482('0x38'))[_0xa482('0x41')]('cm_hopper')['where'](_0x2b8818+'\x20=\x20?',_0x1e96ed['id'][_0xa482('0x40')]())))[_0xa482('0x40')]();return _0xfd25c6;};function _0x155415(_0x1de747,_0x315d03){var _0x4e1cd2=squel['insert']()['into'](_0xa482('0x36'))['fromQuery']([_0xa482('0x38'),_0xa482('0x39'),_0xa482('0x3a'),_0xa482('0x26'),_0x315d03,_0xa482('0x3b'),_0xa482('0x3c')],squel[_0xa482('0x3d')]()[_0xa482('0x3e')]('phone','phone')[_0xa482('0x3e')](_0xa482('0x3f'),'scheduledAt')['field']('id',_0xa482('0x3a'))[_0xa482('0x3e')](LISTID[_0xa482('0x40')](),_0xa482('0x26'))['field'](_0x1de747['id']['toString'](),_0x315d03)['field'](_0xa482('0x3f'),_0xa482('0x3b'))['field']('NOW()',_0xa482('0x3c'))[_0xa482('0x41')](_0xa482('0x4b'))['where'](_0xa482('0x43'))[_0xa482('0x42')](_0xa482('0x47'),LISTID[_0xa482('0x40')]())[_0xa482('0x42')]('id\x20IN\x20?',squel[_0xa482('0x48')](hopperContacts))[_0xa482('0x42')](_0xa482('0x44')))[_0xa482('0x40')]();return _0x4e1cd2;}function _0x30164a(_0x4d1685,_0x88e166){var _0x45c53d=squel[_0xa482('0x34')]()[_0xa482('0x35')](_0xa482('0x4c'))[_0xa482('0x37')]([_0xa482('0x38'),_0xa482('0x3a'),_0xa482('0x26'),_0x88e166,_0xa482('0x3b'),_0xa482('0x3c')],squel[_0xa482('0x3d')]()[_0xa482('0x3e')](_0xa482('0x38'),_0xa482('0x38'))[_0xa482('0x3e')]('id','ContactId')[_0xa482('0x3e')](LISTID[_0xa482('0x40')](),'ListId')['field'](_0x4d1685['id'][_0xa482('0x40')](),_0x88e166)[_0xa482('0x3e')](_0xa482('0x3f'),'createdAt')['field']('NOW()',_0xa482('0x3c'))[_0xa482('0x41')]('cm_contacts')['where'](_0xa482('0x43'))['where']('ListId\x20=\x20?',LISTID[_0xa482('0x40')]())['where']('id\x20IN\x20?',squel[_0xa482('0x48')](hopperContacts))[_0xa482('0x42')](_0xa482('0x44')))[_0xa482('0x40')]();return _0x45c53d;}return db[_0xa482('0x4d')][_0xa482('0x4e')]({'where':{'type':_0xa482('0x4f')},'attributes':['id',_0xa482('0x50')],'include':[{'model':db[_0xa482('0x51')],'as':_0xa482('0x52'),'where':{'id':LISTID}}]})[_0xa482('0x2d')](function(_0x2c1377){var _0x1945b2=[];if(_0x2c1377){var _0x21ef4f;for(var _0x3935fc=0x0,_0x46bd27;_0x3935fc<_0x2c1377[_0xa482('0x1a')];_0x3935fc+=0x1){_0x46bd27=_0x2c1377[_0x3935fc][_0xa482('0x53')]({'plain':!![]});switch(_0x46bd27['dialCheckDuplicateType']){case _0xa482('0x54'):_0x1945b2[_0xa482('0x2e')](db[_0xa482('0x55')]['query'](_0x447cd7(_0x46bd27,_0xa482('0x56')))[_0xa482('0x2d')](function(){})[_0xa482('0x57')](_0x4df959()));break;case _0xa482('0x58'):_0x1945b2[_0xa482('0x2e')](db[_0xa482('0x55')][_0xa482('0x59')](_0xc9b35c(_0x46bd27,'VoiceQueueId'))[_0xa482('0x2d')](function(){})[_0xa482('0x57')](_0x4df959()));break;default:_0x1945b2[_0xa482('0x2e')](db[_0xa482('0x55')][_0xa482('0x59')](_0x155415(_0x46bd27,_0xa482('0x56')))['then'](function(){})[_0xa482('0x57')](_0x4df959()));}}}return _0x1945b2;})[_0xa482('0x5a')]()[_0xa482('0x2d')](function(){return db[_0xa482('0x4d')]['findAll']({'where':{'type':_0xa482('0x4f')},'attributes':['id'],'include':[{'model':db[_0xa482('0x51')],'as':_0xa482('0x5b'),'where':{'id':LISTID}}]})[_0xa482('0x2d')](function(_0x11e407){var _0x13e06c=[];if(_0x11e407){var _0x20ea2e;for(var _0xc9de65=0x0,_0x44de93;_0xc9de65<_0x11e407[_0xa482('0x1a')];_0xc9de65+=0x1){_0x44de93=_0x11e407[_0xc9de65][_0xa482('0x53')]({'plain':!![]});_0x13e06c[_0xa482('0x2e')](db[_0xa482('0x55')]['query'](_0x30164a(_0x44de93,_0xa482('0x56')))['then'](function(){})[_0xa482('0x57')](_0x4df959()));}}return _0x13e06c;})[_0xa482('0x5a')]();})['then'](function(){return db[_0xa482('0x5c')]['findAll']({'attributes':['id',_0xa482('0x50')],'include':[{'model':db[_0xa482('0x51')],'as':_0xa482('0x52'),'where':{'id':LISTID}}]})[_0xa482('0x2d')](function(_0x2a4521){var _0x4e4cb0=[];if(_0x2a4521){for(var _0x48fffe=0x0,_0x3c2c22;_0x48fffe<_0x2a4521[_0xa482('0x1a')];_0x48fffe+=0x1){_0x3c2c22=_0x2a4521[_0x48fffe]['get']({'plain':!![]});switch(_0x3c2c22[_0xa482('0x50')]){case _0xa482('0x54'):_0x4e4cb0[_0xa482('0x2e')](db[_0xa482('0x55')]['query'](_0x447cd7(_0x3c2c22,'CampaignId'))['then'](function(){})[_0xa482('0x57')](_0x4df959()));break;case'onlyIfOpen':_0x4e4cb0[_0xa482('0x2e')](db[_0xa482('0x55')][_0xa482('0x59')](_0xc9b35c(_0x3c2c22,_0xa482('0x5d')))['then'](function(){})[_0xa482('0x57')](_0x4df959()));break;default:_0x4e4cb0[_0xa482('0x2e')](db['sequelize']['query'](_0x155415(_0x3c2c22,_0xa482('0x5d')))[_0xa482('0x2d')](function(){})[_0xa482('0x57')](_0x4df959()));}}}return _0x4e4cb0;})[_0xa482('0x5a')]();})[_0xa482('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xa482('0x51')],'as':_0xa482('0x5b'),'where':{'id':LISTID}}]})[_0xa482('0x2d')](function(_0x42f7ca){var _0x137a2f=[];if(_0x42f7ca){for(var _0x213fb8=0x0,_0x725630;_0x213fb8<_0x42f7ca[_0xa482('0x1a')];_0x213fb8+=0x1){_0x725630=_0x42f7ca[_0x213fb8][_0xa482('0x53')]({'plain':!![]});_0x137a2f[_0xa482('0x2e')](db[_0xa482('0x55')][_0xa482('0x59')](_0x30164a(_0x725630,'CampaignId'))[_0xa482('0x2d')](function(){})[_0xa482('0x57')](_0x4df959()));}}return _0x137a2f;})[_0xa482('0x5a')]();})[_0xa482('0x57')](function(_0x7903dc){logger['error']('cmContact,\x20%s,\x20%s',_0xa482('0x5e'),_0x7903dc[_0xa482('0x30')]);});}var processPromises=function(_0x4cebd4){return BPromise[_0xa482('0x5a')](promises)[_0xa482('0x2d')](function(_0x50b6a8){})[_0xa482('0x57')](function(_0x81fafc){logger[_0xa482('0x16')](_0xa482('0x5f'),JSON['stringify'](_0x81fafc));})[_0xa482('0x60')](function(){socket[_0xa482('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4cebd4){return _0x4cebd4['resume']();}});};var endCsv=function(){return BPromise[_0xa482('0x62')]()[_0xa482('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xa482('0x2d')](function(){socket['emit'](_0xa482('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa482('0x64')](FILEPATH);}catch(_0x1744ec){logger[_0xa482('0x16')](_0xa482('0x65'),JSON[_0xa482('0x31')](_0x1744ec));}finally{process[_0xa482('0x66')](0x0);}});};process['on'](_0xa482('0x67'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa482('0x62')]()[_0xa482('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa482('0x13')](',');return db[_0xa482('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa482('0x2d')](function(_0x3d6768){var _0x50bcc2=fs[_0xa482('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa482('0x6a')](_0x50bcc2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x40b9f0,_0xac9d46){total+=0x1;var _0x29884b=total;promises[_0xa482('0x2e')](checkRow(_0x40b9f0,_0x3d6768,_0x29884b)[_0xa482('0x2d')](function(){success+=0x1;})[_0xa482('0x57')](function(_0x44c27d){if(_0x44c27d[_0xa482('0x16')]){errors+=0x1;delete _0x44c27d['error'];}else if(_0x44c27d[_0xa482('0x29')]){duplicates+=0x1;delete _0x44c27d['duplicate'];}rows[_0xa482('0x2e')](_0x44c27d);}));if(total%0xc8===0x0){_0xac9d46[_0xa482('0x6b')]();return processPromises(_0xac9d46);}},'complete':function(){return processPromises()[_0xa482('0x2d')](function(){logger['info'](_0xa482('0x6c'));endCsv();});},'error':function(_0x4fa7a4,_0xf151bd){logger[_0xa482('0x6d')](_0xa482('0x6e'),JSON[_0xa482('0x31')](_0x4fa7a4));endCsv();}});})[_0xa482('0x57')](function(_0x3c0e4a){logger['error'](_0xa482('0x6f'),JSON[_0xa482('0x31')](_0x3c0e4a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4e9980e..ece8c47 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 _0x533d=['hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','SystemError','error','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','exit','push','sequelize','query','spread','catch','main','send','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','length','rows','errors','data'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0x533d,0x13e));var _0xd533=function(_0x4ce4a8,_0x532a16){_0x4ce4a8=_0x4ce4a8-0x0;var _0x55f6ca=_0x533d[_0x4ce4a8];return _0x55f6ca;};'use strict';var fs=require('fs');var path=require(_0xd533('0x0'));var _=require(_0xd533('0x1'));var Papa=require('papaparse');var util=require(_0xd533('0x2'));var BPromise=require(_0xd533('0x3'));var moment=require(_0xd533('0x4'));var squel=require(_0xd533('0x5'));var Redis=require(_0xd533('0x6'));var db=require(_0xd533('0x7'))['db'];var config=require(_0xd533('0x8'));var logger=require(_0xd533('0x9'))(_0xd533('0xa'));config[_0xd533('0xb')]=_[_0xd533('0xc')](config[_0xd533('0xb')],{'host':_0xd533('0xd'),'port':0x18eb});var socket=require(_0xd533('0xe'))(new Redis(config[_0xd533('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xd533('0xf')](_0xd533('0x10'));function isEmail(_0x484d35){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))*$/[_0xd533('0x11')](_0x484d35);}function selectNotIn(_0x47d123,_0x29787b,_0xd0b5f1,_0x41c221,_0x37882a){return squel['select']()[_0xd533('0x12')](_0xd533('0x13'))[_0xd533('0x14')](_0x41c221)[_0xd533('0x15')](_0x29787b,null,_0x29787b+_0xd533('0x16')+_0x41c221+'.'+_0xd0b5f1)[_0xd533('0x17')](_0x41c221+'.'+_0xd0b5f1+_0xd533('0x18')+_0x47d123+'.'+_0xd0b5f1)[_0xd533('0x17')](_0x29787b+'.dialCheckDuplicateType\x20IN\x20('+_0x37882a[_0xd533('0x15')]()+')');}function insertCmHopper(_0xdd45da,_0x2ce960,_0xe90dc9,_0x12b5b,_0x46c87b){var _0x22a2f4=[_0xd533('0x19'),_0xd533('0x1a'),_0xd533('0x1b'),'cm_contacts.ListId',_0x2ce960+'.'+_0x12b5b,_0xd533('0x1c'),_0xd533('0x1d'),'cm_contacts.priority',_0xd533('0x1e'),'\x22'+_0x46c87b+'\x22'];return squel[_0xd533('0x1f')]()[_0xd533('0x20')](_0xd533('0x21'))[_0xd533('0x22')](['phone',_0xd533('0x23'),'ContactId','ListId',_0x12b5b,_0xd533('0x24'),_0xd533('0x25'),_0xd533('0x26'),_0xd533('0x27'),'recallme'],squel[_0xd533('0x28')]()[_0xd533('0x29')](_0x22a2f4)[_0xd533('0x14')](_0x2ce960)['join'](_0xd533('0x2a'),null,_0xd533('0x2b')+_0x2ce960+_0xd533('0x2c'))[_0xd533('0x15')](_0xe90dc9,null,_0xe90dc9+_0xd533('0x16')+_0x2ce960+'.'+_0x12b5b)[_0xd533('0x17')](_0x2ce960+_0xd533('0x2d'),_0xdd45da)[_0xd533('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd533('0x17')](_0xd533('0x2e'),selectNotIn(_0x2ce960,_0xe90dc9,_0x12b5b,_0xd533('0x21'),[_0xd533('0x2f'),_0xd533('0x30')]))['where'](_0xd533('0x2e'),selectNotIn(_0x2ce960,_0xe90dc9,_0x12b5b,_0xd533('0x21'),[_0xd533('0x2f')])))[_0xd533('0x31')]();}function insertCmHopperBlack(_0x24ff75,_0x539df7,_0x1140db,_0x384197){var _0x302354=[_0xd533('0x19'),_0xd533('0x1b'),'cm_contacts.ListId',_0x539df7+'.'+_0x384197,_0xd533('0x1c'),_0xd533('0x1d')];return squel['insert']()['into'](_0xd533('0x32'))['fromQuery']([_0xd533('0x13'),'ContactId',_0xd533('0x33'),_0x384197,_0xd533('0x24'),_0xd533('0x25')],squel[_0xd533('0x28')]()['fields'](_0x302354)[_0xd533('0x14')](_0x539df7)[_0xd533('0x15')](_0xd533('0x2a'),null,_0xd533('0x2b')+_0x539df7+_0xd533('0x2c'))[_0xd533('0x15')](_0x1140db,null,_0x1140db+_0xd533('0x16')+_0x539df7+'.'+_0x384197)[_0xd533('0x17')](_0x539df7+_0xd533('0x2d'),_0x24ff75)[_0xd533('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xd533('0x2e'),squel['select']()['field']('phone')[_0xd533('0x14')](_0xd533('0x32'))[_0xd533('0x17')](_0xd533('0x34'),_0x24ff75)[_0xd533('0x17')](_0x384197+_0xd533('0x35'),_0x539df7+'.'+_0x384197)))['toString']();}function insertCmContact(_0x32eb34,_0x3af022,_0xf0a423,_0x5cc632){var _0x161b04=_[_0xd533('0x36')](_[_0xd533('0x37')](_0x5cc632),[_0xd533('0x33'),_0xd533('0x38'),_0xd533('0x24'),_0xd533('0x25')]);return squel[_0xd533('0x1f')]()[_0xd533('0x20')](_0xd533('0x2a'))[_0xd533('0x22')](_0x161b04,squel['select']()[_0xd533('0x29')](_0x161b04)[_0xd533('0x14')](_0x3af022)['where']('('+_0xf0a423[_0xd533('0x15')](',')+_0xd533('0x39'),squel[_0xd533('0x28')]()[_0xd533('0x29')](_0xf0a423)[_0xd533('0x14')](_0xd533('0x2a'))[_0xd533('0x17')]('ListId\x20=\x20?',_0x32eb34))[_0xd533('0x17')](_0xd533('0x3a'),squel[_0xd533('0x28')]()[_0xd533('0x12')]('MIN(id)',_0xd533('0x3b'))[_0xd533('0x14')](_0x3af022)[_0xd533('0x3c')](_0xf0a423['join'](','))))[_0xd533('0x31')]();}function handleStop(){logger[_0xd533('0x3d')](_0xd533('0x3e'));stopped=!![];}function handleUncaughtException(_0x1cf8c8){logger['error'](_0x1cf8c8[_0xd533('0x3f')]);process[_0xd533('0x40')](0x1);}function handleError(_0x16d52a,_0x80eda3){stats['errors'][_0xd533('0x41')]({'name':_0x80eda3['code'],'message':_0x80eda3[_0xd533('0x3f')],'row':_0x16d52a});}function handleQuery(_0x4f4c77){logger['info'](_0x4f4c77);return db[_0xd533('0x42')][_0xd533('0x43')](_0x4f4c77)[_0xd533('0x44')](function(_0x4407e0){results[_0xd533('0x41')](_0x4407e0);})[_0xd533('0x45')](function(_0x46c6bf){logger['error'](_0x46c6bf[_0xd533('0x3f')]);});}function main(_0x484ccd,_0x55f01d,_0x375e8e,_0x2486c8){logger[_0xd533('0x3d')](_0xd533('0x46'),_0x484ccd,JSON['stringify'](_0x55f01d));process[_0xd533('0x47')]('start');var _0x5b5690=_0x55f01d[_0xd533('0x48')];var _0x2043f2=_0x55f01d[_0xd533('0x49')];var _0x2045d8=path[_0xd533('0x15')](config[_0xd533('0x4a')],_0xd533('0x4b'),_0x2043f2+'.csv');var _0xaf4c59=_[_0xd533('0x37')](_0x5b5690)[_0xd533('0x15')]();logger[_0xd533('0x3d')](_0xd533('0x4c'),_0xaf4c59);fs[_0xd533('0x4d')](_0x2045d8,_0xaf4c59+'\x0a');Papa[_0xd533('0x4e')](fs[_0xd533('0x4f')](_0x484ccd),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4f71ac,_0x434e4f){try{for(var _0x18d836=0x0,_0x6846f3=[];_0x18d836<_0x4f71ac['data'][_0xd533('0x50')];_0x18d836++){stats[_0xd533('0x51')]+=0x1;if(_0x4f71ac[_0xd533('0x52')][_0x18d836]){handleError(_0x4f71ac[_0xd533('0x53')][_0x18d836],_0x4f71ac['errors'][_0x18d836]);}else{var _0x50c30e=[];for(var _0x1012a0 in _0x5b5690){if(_0x5b5690[_0xd533('0x54')](_0x1012a0)){if(_0x4f71ac[_0xd533('0x53')][_0x18d836][_0x5b5690[_0x1012a0]]){var _0x59fd66=_[_0xd533('0x55')](_0x4f71ac['data'][_0x18d836][_0x5b5690[_0x1012a0]][_0xd533('0x56')](/"/g,'\x27'));switch(_0x1012a0){case _0xd533('0x23'):var _0xfd611a=moment(_0x59fd66,_0xd533('0x10'),!![]);if(_0xfd611a[_0xd533('0x57')]()){_0x6846f3[_0xd533('0x41')]('\x22'+_0x59fd66+'\x22');}else{_0x50c30e['push'](_0xd533('0x58'));}break;case _0xd533('0x26'):var _0x3c7466=parseInt(_0x59fd66);_0x59fd66=_[_0xd533('0x59')](_0x3c7466)||_0x3c7466<0x0||_0x3c7466>0x4?_0x2486c8?0x3:0x2:_0x3c7466;_0x6846f3[_0xd533('0x41')]('\x22'+_0x59fd66+'\x22');break;case _0xd533('0x27'):var _0x41d761=parseInt(_0x59fd66);if(_[_0xd533('0x5a')](_0x41d761)&&_[_0xd533('0x5b')](_0x375e8e,_0x41d761)){_0x6846f3[_0xd533('0x41')]('\x22'+_0x41d761+'\x22');}else{_0x50c30e[_0xd533('0x41')]('agent\x20not\x20exists');}break;case _0xd533('0x5c'):if(isEmail(_0x59fd66)){_0x6846f3['push']('\x22'+_0x59fd66+'\x22');}else{_0x50c30e['push'](_0xd533('0x5d'));}break;case _0xd533('0x5e'):var _0x1d581f=moment(_0x59fd66,_0xd533('0x5f'),!![]);if(_0x1d581f[_0xd533('0x57')]()){_0x6846f3[_0xd533('0x41')]('\x22'+_0x59fd66+'\x22');}else{_0x50c30e['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x6846f3[_0xd533('0x41')]('\x22'+_0x59fd66+'\x22');}}else{switch(_0x1012a0){case'firstName':case _0xd533('0x13'):_0x50c30e[_0xd533('0x41')](_0x1012a0+_0xd533('0x60'));break;default:_0x6846f3[_0xd533('0x41')]('\x22\x22');}}}}if(_0x50c30e['length']){handleError(_0x4f71ac['data'][_0x18d836],{'code':_0xd533('0x61'),'message':_0x50c30e[_0xd533('0x15')]()});}else{fs[_0xd533('0x62')](_0x2045d8,_0x6846f3[_0xd533('0x15')]()+'\x0a');}_0x6846f3=[];}if(!(stats[_0xd533('0x51')]%0xc8)){socket['emit'](_0xd533('0x63')+_0x2043f2,stats);stats[_0xd533('0x52')]=[];}}if(stopped){logger['info'](_0xd533('0x64'));_0x434e4f['abort']();}}catch(_0x2564ba){handleError(_0x4f71ac[_0xd533('0x53')][_0x18d836],{'code':_0xd533('0x65'),'message':_0x2564ba['message']});logger[_0xd533('0x66')](_0xd533('0x67'),_0x2564ba['message']);}},'complete':function(){try{var _0xdf1e1b=[];var _0xeaf6cb=_0xd533('0x2a');if(_0x55f01d['duplicates']&&_0x55f01d[_0xd533('0x68')][_0xd533('0x50')]){_0xeaf6cb='cm_contacts_'+_0x2043f2;_0xdf1e1b['push'](_0xd533('0x69')+_0xeaf6cb+_0xd533('0x6a'));}var _0x5dd187=util[_0xd533('0xf')](_0xd533('0x6b'),_0x2045d8,_0xeaf6cb,_0xaf4c59,_0x55f01d[_0xd533('0x33')],_0x55f01d[_0xd533('0x38')]||null,NOW,NOW);if(_[_0xd533('0x6c')](_0x5b5690[_0xd533('0x23')])){_0x5dd187+=_0xd533('0x6d');}_0xdf1e1b['push'](_0x5dd187);if(_0x55f01d[_0xd533('0x68')]&&_0x55f01d[_0xd533('0x68')][_0xd533('0x50')]){_0xdf1e1b[_0xd533('0x41')](insertCmContact(_0x55f01d['ListId'],_0xeaf6cb,_0x55f01d[_0xd533('0x68')],_0x5b5690));_0xdf1e1b[_0xd533('0x41')]('DROP\x20TABLE\x20'+_0xeaf6cb+';');}_0xdf1e1b['push'](insertCmHopper(_0x55f01d['ListId'],_0xd533('0x6e'),_0xd533('0x6f'),_0xd533('0x70'),_0x2486c8));_0xdf1e1b[_0xd533('0x41')](insertCmHopperBlack(_0x55f01d[_0xd533('0x33')],'voice_queues_has_cm_blacklists',_0xd533('0x6f'),_0xd533('0x70')));_0xdf1e1b[_0xd533('0x41')](insertCmHopper(_0x55f01d['ListId'],'campaigns_has_cm_lists',_0xd533('0x71'),_0xd533('0x72'),_0x2486c8));_0xdf1e1b[_0xd533('0x41')](insertCmHopperBlack(_0x55f01d[_0xd533('0x33')],_0xd533('0x73'),'campaigns',_0xd533('0x72')));BPromise[_0xd533('0x74')](_0xdf1e1b,handleQuery)[_0xd533('0x75')](function(_0x1315fa){stats[_0xd533('0x76')]=!![];stats[_0xd533('0x77')]=_0x55f01d[_0xd533('0x68')]&&_0x55f01d[_0xd533('0x68')]['length']?results[0x2][_0xd533('0x77')]:results[0x0][_0xd533('0x77')];socket[_0xd533('0x78')](_0xd533('0x63')+_0x2043f2,stats);fs[_0xd533('0x79')](_0x484ccd);fs[_0xd533('0x79')](_0x2045d8);process['exit'](0x0);})[_0xd533('0x45')](function(_0x47ccb5){logger['error'](_0x47ccb5[_0xd533('0x3f')]);process[_0xd533('0x40')](0x1);});}catch(_0x45b79a){logger[_0xd533('0x66')](_0xd533('0x7a'),_0x45b79a[_0xd533('0x3f')]);process[_0xd533('0x40')](0x1);}},'error':function(_0x56c3b9,_0x34f457,_0x3f46c3,_0x408444){throw new Error(_0x408444);}});}function validate(){if(process['argv']&&process[_0xd533('0x7b')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x140488=path[_0xd533('0x15')](config['root'],'server/files/tmp',process[_0xd533('0x7b')][0x2]);if(!fs[_0xd533('0x7c')](_0x140488)){throw new Error(_0xd533('0x7d'));}var _0x1555fb={};try{_0x1555fb=JSON[_0xd533('0x4e')](process[_0xd533('0x7b')][0x3]);if(!_0x1555fb['binding']){throw new Error(_0xd533('0x7e'));}if(!_0x1555fb[_0xd533('0x48')]['phone']){throw new Error(_0xd533('0x7f'));}if(!_0x1555fb[_0xd533('0x48')][_0xd533('0x80')]){throw new Error(_0xd533('0x81'));}var _0x4032c0=0x0;if(_0x1555fb['binding'][_0xd533('0x27')]){_0x4032c0=0x1;}if(!_0x1555fb[_0xd533('0x33')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x57ef9a){throw new Error(_0xd533('0x82'));}var _0x3efeb5=[];try{_0x3efeb5=_[_0xd533('0x83')](JSON['parse'](process[_0xd533('0x7b')][0x4]),'id');}catch(_0x3b4aa3){logger[_0xd533('0x3d')]('No\x20agent\x20available');}main(_0x140488,_0x1555fb,_0x3efeb5,_0x4032c0);}validate();process['on'](_0xd533('0x84'),handleStop);process['on'](_0xd533('0x85'),handleUncaughtException); \ No newline at end of file +var _0xd82b=['abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','CompanyId','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','finish','affectedRows','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_hopper_black','.CmListId','ListId\x20=\x20?',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','error','message','exit','errors','push','sequelize','query','spread','main','stringify','send','start','binding','socket_timestamp','root','keys','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0xd82b,0xa7));var _0xbd82=function(_0x9906a3,_0x3b0104){_0x9906a3=_0x9906a3-0x0;var _0x3529e9=_0xd82b[_0x9906a3];return _0x3529e9;};'use strict';var fs=require('fs');var path=require(_0xbd82('0x0'));var _=require(_0xbd82('0x1'));var Papa=require('papaparse');var util=require(_0xbd82('0x2'));var BPromise=require(_0xbd82('0x3'));var moment=require(_0xbd82('0x4'));var squel=require(_0xbd82('0x5'));var Redis=require(_0xbd82('0x6'));var db=require(_0xbd82('0x7'))['db'];var config=require(_0xbd82('0x8'));var logger=require(_0xbd82('0x9'))(_0xbd82('0xa'));config['redis']=_[_0xbd82('0xb')](config[_0xbd82('0xc')],{'host':_0xbd82('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd82('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x12a06c){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))*$/[_0xbd82('0xe')](_0x12a06c);}function selectNotIn(_0x408280,_0xa17f3f,_0x4ed937,_0x155df5,_0xa7e189){return squel[_0xbd82('0xf')]()[_0xbd82('0x10')](_0xbd82('0x11'))[_0xbd82('0x12')](_0x155df5)[_0xbd82('0x13')](_0xa17f3f,null,_0xa17f3f+_0xbd82('0x14')+_0x155df5+'.'+_0x4ed937)['where'](_0x155df5+'.'+_0x4ed937+_0xbd82('0x15')+_0x408280+'.'+_0x4ed937)['where'](_0xa17f3f+_0xbd82('0x16')+_0xa7e189['join']()+')');}function insertCmHopper(_0x1b3daf,_0x942dfc,_0x40d808,_0x1e38fd,_0x5e7ce0){var _0x3e931c=[_0xbd82('0x17'),_0xbd82('0x18'),_0xbd82('0x19'),'cm_contacts.ListId',_0x942dfc+'.'+_0x1e38fd,_0xbd82('0x1a'),_0xbd82('0x1b'),_0xbd82('0x1c'),_0xbd82('0x1d'),'\x22'+_0x5e7ce0+'\x22'];return squel[_0xbd82('0x1e')]()[_0xbd82('0x1f')](_0xbd82('0x20'))[_0xbd82('0x21')]([_0xbd82('0x11'),'scheduledat','ContactId',_0xbd82('0x22'),_0x1e38fd,_0xbd82('0x23'),_0xbd82('0x24'),_0xbd82('0x25'),_0xbd82('0x26'),_0xbd82('0x27')],squel[_0xbd82('0xf')]()[_0xbd82('0x28')](_0x3e931c)['from'](_0x942dfc)['join'](_0xbd82('0x29'),null,_0xbd82('0x2a')+_0x942dfc+'.CmListId')[_0xbd82('0x13')](_0x40d808,null,_0x40d808+_0xbd82('0x14')+_0x942dfc+'.'+_0x1e38fd)[_0xbd82('0x2b')](_0x942dfc+_0xbd82('0x2c'),_0x1b3daf)[_0xbd82('0x2b')](_0xbd82('0x2d'),NOW)['where'](_0xbd82('0x2e'),selectNotIn(_0x942dfc,_0x40d808,_0x1e38fd,_0xbd82('0x20'),[_0xbd82('0x2f'),_0xbd82('0x30')]))[_0xbd82('0x2b')](_0xbd82('0x2e'),selectNotIn(_0x942dfc,_0x40d808,_0x1e38fd,_0xbd82('0x20'),[_0xbd82('0x2f')])))['toString']();}function insertCmHopperBlack(_0x17eb3e,_0x4eaed2,_0x4044c1,_0x39b701){var _0x8c7a01=['cm_contacts.phone',_0xbd82('0x19'),_0xbd82('0x31'),_0x4eaed2+'.'+_0x39b701,_0xbd82('0x1a'),_0xbd82('0x1b')];return squel[_0xbd82('0x1e')]()['into'](_0xbd82('0x32'))[_0xbd82('0x21')](['phone','ContactId',_0xbd82('0x22'),_0x39b701,'createdAt',_0xbd82('0x24')],squel[_0xbd82('0xf')]()[_0xbd82('0x28')](_0x8c7a01)[_0xbd82('0x12')](_0x4eaed2)['join'](_0xbd82('0x29'),null,_0xbd82('0x2a')+_0x4eaed2+_0xbd82('0x33'))[_0xbd82('0x13')](_0x4044c1,null,_0x4044c1+_0xbd82('0x14')+_0x4eaed2+'.'+_0x39b701)['where'](_0x4eaed2+_0xbd82('0x2c'),_0x17eb3e)[_0xbd82('0x2b')](_0xbd82('0x2d'),NOW)[_0xbd82('0x2b')](_0xbd82('0x2e'),squel[_0xbd82('0xf')]()[_0xbd82('0x10')](_0xbd82('0x11'))[_0xbd82('0x12')](_0xbd82('0x32'))['where'](_0xbd82('0x34'),_0x17eb3e)[_0xbd82('0x2b')](_0x39b701+'\x20=\x20?',_0x4eaed2+'.'+_0x39b701)))['toString']();}function insertCmContact(_0x55eca0,_0x1433d6,_0x300730,_0x41ad66){var _0x2286c0=_['concat'](_['keys'](_0x41ad66),[_0xbd82('0x22'),'CompanyId',_0xbd82('0x23'),_0xbd82('0x24')]);return squel[_0xbd82('0x1e')]()[_0xbd82('0x1f')](_0xbd82('0x29'))[_0xbd82('0x21')](_0x2286c0,squel['select']()[_0xbd82('0x28')](_0x2286c0)[_0xbd82('0x12')](_0x1433d6)['where']('('+_0x300730[_0xbd82('0x13')](',')+_0xbd82('0x35'),squel[_0xbd82('0xf')]()[_0xbd82('0x28')](_0x300730)[_0xbd82('0x12')](_0xbd82('0x29'))[_0xbd82('0x2b')](_0xbd82('0x34'),_0x55eca0))[_0xbd82('0x2b')](_0xbd82('0x36'),squel[_0xbd82('0xf')]()[_0xbd82('0x10')]('MIN(id)',_0xbd82('0x37'))[_0xbd82('0x12')](_0x1433d6)[_0xbd82('0x38')](_0x300730['join'](','))))['toString']();}function handleStop(){logger[_0xbd82('0x39')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x8f88e1){logger[_0xbd82('0x3a')](_0x8f88e1[_0xbd82('0x3b')]);process[_0xbd82('0x3c')](0x1);}function handleError(_0x1636f8,_0x2a8137){stats[_0xbd82('0x3d')][_0xbd82('0x3e')]({'name':_0x2a8137['code'],'message':_0x2a8137[_0xbd82('0x3b')],'row':_0x1636f8});}function handleQuery(_0x48b09d){logger[_0xbd82('0x39')](_0x48b09d);return db[_0xbd82('0x3f')][_0xbd82('0x40')](_0x48b09d)[_0xbd82('0x41')](function(_0x3101e1){results[_0xbd82('0x3e')](_0x3101e1);})['catch'](function(_0x1c5bf4){logger[_0xbd82('0x3a')](_0x1c5bf4[_0xbd82('0x3b')]);});}function main(_0x35e697,_0x16911f,_0x29db4b,_0x12e976){logger[_0xbd82('0x39')](_0xbd82('0x42'),_0x35e697,JSON[_0xbd82('0x43')](_0x16911f));process[_0xbd82('0x44')](_0xbd82('0x45'));var _0xefc117=_0x16911f[_0xbd82('0x46')];var _0x2efad7=_0x16911f[_0xbd82('0x47')];var _0x418c65=path[_0xbd82('0x13')](config[_0xbd82('0x48')],'server/files/tmp',_0x2efad7+'.csv');var _0x8f8391=_[_0xbd82('0x49')](_0xefc117)[_0xbd82('0x13')]();logger[_0xbd82('0x39')](_0xbd82('0x4a'),_0x8f8391);fs[_0xbd82('0x4b')](_0x418c65,_0x8f8391+'\x0a');Papa[_0xbd82('0x4c')](fs[_0xbd82('0x4d')](_0x35e697),{'header':!![],'skipEmptyLines':!![],'step':function(_0x24a370,_0xcfc759){try{for(var _0x2f7b95=0x0,_0x52c930=[];_0x2f7b95<_0x24a370[_0xbd82('0x4e')][_0xbd82('0x4f')];_0x2f7b95++){stats[_0xbd82('0x50')]+=0x1;if(_0x24a370[_0xbd82('0x3d')][_0x2f7b95]){handleError(_0x24a370[_0xbd82('0x4e')][_0x2f7b95],_0x24a370['errors'][_0x2f7b95]);}else{var _0x35ae22=[];for(var _0x448c9e in _0xefc117){if(_0xefc117[_0xbd82('0x51')](_0x448c9e)){if(_0x24a370[_0xbd82('0x4e')][_0x2f7b95][_0xefc117[_0x448c9e]]){var _0x3ef7ca=_[_0xbd82('0x52')](_0x24a370[_0xbd82('0x4e')][_0x2f7b95][_0xefc117[_0x448c9e]]['replace'](/"/g,'\x27'));switch(_0x448c9e){case _0xbd82('0x53'):var _0x149dbf=moment(_0x3ef7ca,_0xbd82('0x54'),!![]);if(_0x149dbf[_0xbd82('0x55')]()){_0x52c930['push']('\x22'+_0x3ef7ca+'\x22');}else{_0x35ae22[_0xbd82('0x3e')](_0xbd82('0x56'));}break;case _0xbd82('0x25'):var _0x2eb6b0=parseInt(_0x3ef7ca);_0x3ef7ca=_[_0xbd82('0x57')](_0x2eb6b0)||_0x2eb6b0<0x0||_0x2eb6b0>0x4?_0x12e976?0x3:0x2:_0x2eb6b0;_0x52c930[_0xbd82('0x3e')]('\x22'+_0x3ef7ca+'\x22');break;case _0xbd82('0x26'):var _0x41d1bd=parseInt(_0x3ef7ca);if(_[_0xbd82('0x58')](_0x41d1bd)&&_[_0xbd82('0x59')](_0x29db4b,_0x41d1bd)){_0x52c930[_0xbd82('0x3e')]('\x22'+_0x41d1bd+'\x22');}else{_0x35ae22[_0xbd82('0x3e')](_0xbd82('0x5a'));}break;case'email':if(isEmail(_0x3ef7ca)){_0x52c930[_0xbd82('0x3e')]('\x22'+_0x3ef7ca+'\x22');}else{_0x35ae22['push']('email\x20wrong\x20format');}break;case _0xbd82('0x5b'):var _0x3d4be4=moment(_0x3ef7ca,_0xbd82('0x5c'),!![]);if(_0x3d4be4['isValid']()){_0x52c930[_0xbd82('0x3e')]('\x22'+_0x3ef7ca+'\x22');}else{_0x35ae22[_0xbd82('0x3e')](_0xbd82('0x5d'));}break;default:_0x52c930[_0xbd82('0x3e')]('\x22'+_0x3ef7ca+'\x22');}}else{switch(_0x448c9e){case _0xbd82('0x5e'):case _0xbd82('0x11'):_0x35ae22['push'](_0x448c9e+_0xbd82('0x5f'));break;default:_0x52c930['push']('\x22\x22');}}}}if(_0x35ae22[_0xbd82('0x4f')]){handleError(_0x24a370[_0xbd82('0x4e')][_0x2f7b95],{'code':_0xbd82('0x60'),'message':_0x35ae22['join']()});}else{fs[_0xbd82('0x61')](_0x418c65,_0x52c930[_0xbd82('0x13')]()+'\x0a');}_0x52c930=[];}if(!(stats[_0xbd82('0x50')]%0xc8)){socket[_0xbd82('0x62')](_0xbd82('0x63')+_0x2efad7,stats);stats['errors']=[];}}if(stopped){logger[_0xbd82('0x39')](_0xbd82('0x64'));_0xcfc759[_0xbd82('0x65')]();}}catch(_0x3a4aab){handleError(_0x24a370[_0xbd82('0x4e')][_0x2f7b95],{'code':_0xbd82('0x66'),'message':_0x3a4aab[_0xbd82('0x3b')]});logger[_0xbd82('0x3a')](_0xbd82('0x67'),_0x3a4aab[_0xbd82('0x3b')]);}},'complete':function(){try{var _0x412c60=[];var _0x423547='cm_contacts';if(_0x16911f[_0xbd82('0x68')]&&_0x16911f[_0xbd82('0x68')][_0xbd82('0x4f')]){_0x423547=_0xbd82('0x69')+_0x2efad7;_0x412c60['push'](_0xbd82('0x6a')+_0x423547+_0xbd82('0x6b'));}var _0x1513bf=util[_0xbd82('0x6c')](_0xbd82('0x6d'),_0x418c65,_0x423547,_0x8f8391,_0x16911f['ListId'],_0x16911f[_0xbd82('0x6e')]||null,NOW,NOW);if(_['isNil'](_0xefc117[_0xbd82('0x53')])){_0x1513bf+=',\x20scheduledAt\x20=\x20NOW()';}_0x412c60[_0xbd82('0x3e')](_0x1513bf);if(_0x16911f[_0xbd82('0x68')]&&_0x16911f[_0xbd82('0x68')][_0xbd82('0x4f')]){_0x412c60[_0xbd82('0x3e')](insertCmContact(_0x16911f['ListId'],_0x423547,_0x16911f[_0xbd82('0x68')],_0xefc117));_0x412c60[_0xbd82('0x3e')](_0xbd82('0x6f')+_0x423547+';');}_0x412c60[_0xbd82('0x3e')](insertCmHopper(_0x16911f['ListId'],_0xbd82('0x70'),'voice_queues','VoiceQueueId',_0x12e976));_0x412c60[_0xbd82('0x3e')](insertCmHopperBlack(_0x16911f[_0xbd82('0x22')],_0xbd82('0x71'),_0xbd82('0x72'),_0xbd82('0x73')));_0x412c60[_0xbd82('0x3e')](insertCmHopper(_0x16911f['ListId'],_0xbd82('0x74'),'campaigns',_0xbd82('0x75'),_0x12e976));_0x412c60[_0xbd82('0x3e')](insertCmHopperBlack(_0x16911f[_0xbd82('0x22')],_0xbd82('0x76'),_0xbd82('0x77'),'CampaignId'));BPromise['each'](_0x412c60,handleQuery)['then'](function(_0x30b4ce){stats[_0xbd82('0x78')]=!![];stats[_0xbd82('0x79')]=_0x16911f[_0xbd82('0x68')]&&_0x16911f[_0xbd82('0x68')][_0xbd82('0x4f')]?results[0x2][_0xbd82('0x79')]:results[0x0][_0xbd82('0x79')];socket[_0xbd82('0x62')](_0xbd82('0x63')+_0x2efad7,stats);fs['unlink'](_0x35e697);fs['unlink'](_0x418c65);process['exit'](0x0);})['catch'](function(_0x2ce98a){logger[_0xbd82('0x3a')](_0x2ce98a[_0xbd82('0x3b')]);process[_0xbd82('0x3c')](0x1);});}catch(_0x21add3){logger[_0xbd82('0x3a')](_0xbd82('0x7a'),_0x21add3[_0xbd82('0x3b')]);process[_0xbd82('0x3c')](0x1);}},'error':function(_0x373c56,_0x71c13d,_0x44f6ae,_0x4f9530){throw new Error(_0x4f9530);}});}function validate(){if(process[_0xbd82('0x7b')]&&process[_0xbd82('0x7b')][_0xbd82('0x4f')]<0x4){throw new Error(_0xbd82('0x7c'));}var _0x46b743=path[_0xbd82('0x13')](config[_0xbd82('0x48')],_0xbd82('0x7d'),process[_0xbd82('0x7b')][0x2]);if(!fs[_0xbd82('0x7e')](_0x46b743)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x1bf731={};try{_0x1bf731=JSON['parse'](process[_0xbd82('0x7b')][0x3]);if(!_0x1bf731[_0xbd82('0x46')]){throw new Error(_0xbd82('0x7f'));}if(!_0x1bf731[_0xbd82('0x46')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x1bf731[_0xbd82('0x46')]['firstName']){throw new Error(_0xbd82('0x80'));}var _0x125030=0x0;if(_0x1bf731['binding']['UserId']){_0x125030=0x1;}if(!_0x1bf731[_0xbd82('0x22')]){throw new Error(_0xbd82('0x81'));}}catch(_0x35cc51){throw new Error('body\x20id\x20mandatory');}var _0x58f265=[];try{_0x58f265=_[_0xbd82('0x82')](JSON[_0xbd82('0x4c')](process[_0xbd82('0x7b')][0x4]),'id');}catch(_0xe61638){logger[_0xbd82('0x39')](_0xbd82('0x83'));}main(_0x46b743,_0x1bf731,_0x58f265,_0x125030);}validate();process['on'](_0xbd82('0x84'),handleStop);process['on'](_0xbd82('0x85'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 0d516e0..559e847 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 _0x5f66=['***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','destcalleridnum'];(function(_0x43f593,_0x16b2e4){var _0x34ec09=function(_0x4ff9c6){while(--_0x4ff9c6){_0x43f593['push'](_0x43f593['shift']());}};_0x34ec09(++_0x16b2e4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';exports['getSubjects']=function(_0x61c60c,_0x4a3887){var _0x2d5fd9=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1'),'variableName':null}];switch(_0x61c60c[_0x65f6('0x2')]()){case _0x65f6('0x3'):switch(_0x4a3887['toLowerCase']()){case _0x65f6('0x4'):_0x2d5fd9['push']({'type':_0x65f6('0x5'),'content':'','variableName':_0x65f6('0x6')});_0x2d5fd9['push']({'type':'variable','content':'','variableName':_0x65f6('0x7')});break;case _0x65f6('0x8'):_0x2d5fd9[_0x65f6('0x9')]({'type':_0x65f6('0x0'),'content':_0x65f6('0xa'),'variableName':null});_0x2d5fd9[_0x65f6('0x9')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x2d5fd9;};exports[_0x65f6('0xb')]=function(_0x2f6d5b,_0x264647){var _0x25c416=[];switch(_0x2f6d5b['toLowerCase']()){case _0x65f6('0x3'):switch(_0x264647['toLowerCase']()){case'inbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x7')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xd'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0xe')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xf'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x10')},{'type':'keyValue','content':'','key':_0x65f6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x12'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x16'),'keyType':'variable','variableName':_0x65f6('0x17')},{'type':_0x65f6('0x0'),'content':_0x65f6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x19'),'keyType':_0x65f6('0x5'),'variableName':'agentcalledAt'},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x65f6('0x1a')},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x1b')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1c'),'keyType':'variable','variableName':_0x65f6('0x1d')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x65f6('0x20'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x21'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x22')},{'type':_0x65f6('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x65f6('0x23'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x65f6('0x24'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x25')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x26'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x27'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x25c416;}; \ No newline at end of file +var _0x0b0e=['Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','Date','answertime','Complete\x20Time','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt'];(function(_0x580d0e,_0x1e5f43){var _0xb51111=function(_0x4718e7){while(--_0x4718e7){_0x580d0e['push'](_0x580d0e['shift']());}};_0xb51111(++_0x1e5f43);}(_0x0b0e,0x187));var _0xe0b0=function(_0x256cc1,_0x568424){_0x256cc1=_0x256cc1-0x0;var _0x330d0a=_0x0b0e[_0x256cc1];return _0x330d0a;};'use strict';exports[_0xe0b0('0x0')]=function(_0x503596,_0xc416e3){var _0x536e9b=[{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x2'),'variableName':null}];switch(_0x503596[_0xe0b0('0x3')]()){case _0xe0b0('0x4'):switch(_0xc416e3[_0xe0b0('0x3')]()){case _0xe0b0('0x5'):_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x7'),'content':'','variableName':_0xe0b0('0x8')});_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x7'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x1'),'content':_0xe0b0('0x9'),'variableName':null});_0x536e9b[_0xe0b0('0x6')]({'type':'variable','content':'','variableName':_0xe0b0('0xa')});break;}}return _0x536e9b;};exports[_0xe0b0('0xb')]=function(_0x553d4f,_0x1fef28){var _0x2f32b6=[];switch(_0x553d4f['toLowerCase']()){case _0xe0b0('0x4'):switch(_0x1fef28[_0xe0b0('0x3')]()){case _0xe0b0('0x5'):_0x2f32b6=[{'type':'string','content':_0xe0b0('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0xe'),'keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0xf')},{'type':'keyValue','content':'','key':_0xe0b0('0x10'),'keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x11')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x12'),'keyType':'variable','variableName':_0xe0b0('0x13')},{'type':'keyValue','content':'','key':_0xe0b0('0x14'),'keyType':_0xe0b0('0x7'),'variableName':'queue'},{'type':_0xe0b0('0xd'),'content':'','key':'UniqueId','keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x15')},{'type':'keyValue','content':'','key':'Date','keyType':_0xe0b0('0x7'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xe0b0('0x16')},{'type':'keyValue','content':'','key':_0xe0b0('0x17'),'keyType':'variable','variableName':_0xe0b0('0xa')},{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x19'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xe0b0('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x1a')},{'type':'keyValue','content':'','key':_0xe0b0('0x1b'),'keyType':'variable','variableName':_0xe0b0('0x1c')},{'type':'keyValue','content':'','key':_0xe0b0('0x1d'),'keyType':'variable','variableName':_0xe0b0('0x1e')},{'type':'keyValue','content':'','key':_0xe0b0('0x1f'),'keyType':'variable','variableName':_0xe0b0('0x20')}];break;case'outbound':_0x2f32b6=[{'type':_0xe0b0('0x1'),'content':_0xe0b0('0xc'),'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x21'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0xa')},{'type':'keyValue','content':'','key':_0xe0b0('0x22'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'membername'},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x23'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x15')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x24'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x18')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x25')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x26'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x27'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x28')},{'type':_0xe0b0('0xd'),'content':'','key':'Billable\x20Time','keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x29')}];break;}}return _0x2f32b6;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 90c1d13..0e0cac6 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 _0xa7d3=['html','phone','fax','mobile','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','stringify','Interaction','findOne','then','update','info','error','tracked','user','query','clone','body','omit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x21c622,_0x124272){_0x21c622=_0x21c622-0x0;var _0x4fed92=_0xa7d3[_0x21c622];return _0x4fed92;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x3a7d('0x0')),'mail':require(_0x3a7d('0x1'))(_0x3a7d('0x2')),'fax':require(_0x3a7d('0x1'))(_0x3a7d('0x3')),'sms':require(_0x3a7d('0x1'))(_0x3a7d('0x4')),'chat':require(_0x3a7d('0x1'))(_0x3a7d('0x5'))};function getInteractionId(_0xb58ee7,_0x3566ce,_0x36e91c){if(_0xb58ee7&&_0xb58ee7[_['upperFirst'](_0x36e91c)+_0x3a7d('0x6')]){return _0xb58ee7[_[_0x3a7d('0x7')](_0x36e91c)+'InteractionId'];}else if(_0xb58ee7&&_0xb58ee7['id']){return _0xb58ee7['id'];}else if(_0x3566ce&&_0x3566ce['id']){return _0x3566ce['id'];}else{return _0x3a7d('0x8');}}function log(_0x3fbb95,_0x27cf67,_0x5d530d,_0x46b37a,_0x36bf35,_0x3be8cc){loggers[_0x36bf35[_0x3a7d('0x9')]()][_0x3fbb95]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3be8cc['toUpperCase'](),_0x27cf67?_0x27cf67['id']:null,_0x27cf67?_0x27cf67['name']:null,_0x27cf67?_0x27cf67['role']:null,getInteractionId(_0x5d530d,_0x46b37a,_0x36bf35),_0x5d530d?JSON[_0x3a7d('0xa')](_0x5d530d):'null');}function updateUser(_0x562235,_0x275b3f,_0x1aea43,_0x1fbcaa,_0x785dbd){db[_[_0x3a7d('0x7')](_0x1fbcaa)+_0x3a7d('0xb')][_0x3a7d('0xc')]({'where':{'id':getInteractionId(_0x275b3f,_0x1aea43,_0x1fbcaa)}})[_0x3a7d('0xd')](function(_0x1e1bbb){if(_0x1e1bbb){return _0x1e1bbb[_0x3a7d('0xe')]({'UserId':_0x562235?_0x562235['id']:null});}})[_0x3a7d('0xd')](function(_0x4f5d1a){if(_0x4f5d1a){log(_0x3a7d('0xf'),_0x562235,_0x275b3f,_0x1aea43,_0x1fbcaa,_0x785dbd);}})['catch'](function(){log(_0x3a7d('0x10'),_0x562235,_0x275b3f,_0x1aea43,_0x1fbcaa,_0x785dbd);});}exports[_0x3a7d('0x11')]=function(_0x2dc645,_0x368817){return function(_0x34dfa1,_0x1be67d,_0x3d3caa){var _0x32e521=_0x34dfa1[_0x3a7d('0x12')];var _0x25ab84={};var _0x47e0a4=_0x34dfa1[_0x3a7d('0x13')];if(_0x25ab84){_0x25ab84=_[_0x3a7d('0x14')](_0x34dfa1[_0x3a7d('0x15')]);_0x25ab84=_[_0x3a7d('0x16')](_0x25ab84,[_0x3a7d('0x15'),_0x3a7d('0x17'),_0x3a7d('0x18'),_0x3a7d('0x19'),_0x3a7d('0x1a')]);}updateUser(_0x32e521,_0x25ab84,_0x47e0a4,_0x2dc645,_0x368817);_0x3d3caa(null);};}; \ No newline at end of file +var _0xb904=['upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','update','then','info','catch','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x111613,_0x43d3bb){var _0x22cc41=function(_0x15b887){while(--_0x15b887){_0x111613['push'](_0x111613['shift']());}};_0x22cc41(++_0x43d3bb);}(_0xb904,0x1cd));var _0x4b90=function(_0x31114f,_0x5f0d1b){_0x31114f=_0x31114f-0x0;var _0x19bbbe=_0xb904[_0x31114f];return _0x19bbbe;};'use strict';var _=require(_0x4b90('0x0'));var db=require(_0x4b90('0x1'))['db'];var loggers={'openchannel':require(_0x4b90('0x2'))('openchannel-interactions'),'mail':require(_0x4b90('0x2'))(_0x4b90('0x3')),'fax':require(_0x4b90('0x2'))(_0x4b90('0x4')),'sms':require('../../config/logger')(_0x4b90('0x5')),'chat':require(_0x4b90('0x2'))(_0x4b90('0x6'))};function getInteractionId(_0x34d302,_0x19783d,_0x28e8cc){if(_0x34d302&&_0x34d302[_[_0x4b90('0x7')](_0x28e8cc)+_0x4b90('0x8')]){return _0x34d302[_[_0x4b90('0x7')](_0x28e8cc)+_0x4b90('0x8')];}else if(_0x34d302&&_0x34d302['id']){return _0x34d302['id'];}else if(_0x19783d&&_0x19783d['id']){return _0x19783d['id'];}else{return'unknown';}}function log(_0x51714a,_0x166cce,_0x1109ef,_0x5d788d,_0x327077,_0x3894be){loggers[_0x327077['toLowerCase']()][_0x51714a](_0x4b90('0x9'),_0x3894be[_0x4b90('0xa')](),_0x166cce?_0x166cce['id']:null,_0x166cce?_0x166cce[_0x4b90('0xb')]:null,_0x166cce?_0x166cce[_0x4b90('0xc')]:null,getInteractionId(_0x1109ef,_0x5d788d,_0x327077),_0x1109ef?JSON[_0x4b90('0xd')](_0x1109ef):'null');}function updateUser(_0x4f81d3,_0x1662b8,_0x50d966,_0x5a049f,_0x515d4c){db[_[_0x4b90('0x7')](_0x5a049f)+'Interaction'][_0x4b90('0xe')]({'where':{'id':getInteractionId(_0x1662b8,_0x50d966,_0x5a049f)}})['then'](function(_0x84959b){if(_0x84959b){return _0x84959b[_0x4b90('0xf')]({'UserId':_0x4f81d3?_0x4f81d3['id']:null});}})[_0x4b90('0x10')](function(_0x5b9e26){if(_0x5b9e26){log(_0x4b90('0x11'),_0x4f81d3,_0x1662b8,_0x50d966,_0x5a049f,_0x515d4c);}})[_0x4b90('0x12')](function(){log('error',_0x4f81d3,_0x1662b8,_0x50d966,_0x5a049f,_0x515d4c);});}exports['tracked']=function(_0xf3731d,_0x499182){return function(_0x9d6001,_0x2ed82d,_0x113b9a){var _0x7d0c3b=_0x9d6001[_0x4b90('0x13')];var _0x5412db={};var _0x2839f8=_0x9d6001['query'];if(_0x5412db){_0x5412db=_[_0x4b90('0x14')](_0x9d6001[_0x4b90('0x15')]);_0x5412db=_[_0x4b90('0x16')](_0x5412db,['body',_0x4b90('0x17'),_0x4b90('0x18'),_0x4b90('0x19'),'mobile']);}updateUser(_0x7d0c3b,_0x5412db,_0x2839f8,_0xf3731d,_0x499182);_0x113b9a(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index af46f58..8d76cb1 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 _0xe0b7=['findOne','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','user','crypto','util','data1','license','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','use','License'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0xe0b7,0xc4));var _0x7e0b=function(_0xd40e8d,_0x3de3da){_0xd40e8d=_0xd40e8d-0x0;var _0x2ec583=_0xe0b7[_0xd40e8d];return _0x2ec583;};'use strict';var crypto=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3e2934,_0x3fc4aa){if(_0x3e2934&&_0x3fc4aa){if(_0x3fc4aa[_0x7e0b('0x2')]&&_0x3fc4aa[_0x7e0b('0x3')]){var _0x3f8879=_0x3fc4aa[_0x7e0b('0x2')];var _0x2667a3=_0x3fc4aa[_0x7e0b('0x3')];var _0x195d45=_0x3f8879[_0x7e0b('0x4')]('-')[0x4];var _0x932d74=_0x3f8879['split']('-')[0x0];var _0x4eb43b=crypto[_0x7e0b('0x5')]('aes-256-ctr',util[_0x7e0b('0x6')](_0x7e0b('0x7'),_0x195d45,_0x3f8879,_0x932d74));var _0x4526d7=_0x4eb43b[_0x7e0b('0x8')](_0x2667a3,'base64',_0x7e0b('0x9'));_0x4526d7+=_0x4eb43b[_0x7e0b('0xa')](_0x7e0b('0x9'));var _0x362bf9=JSON[_0x7e0b('0xb')](_0x4526d7);return _0x362bf9['hasOwnProperty'](_0x3e2934)?_0x362bf9[_0x3e2934]:null;}}return null;}function isLimit(_0x71c0b2,_0x253d1a,_0x5b9c4b,_0x5852da){var _0x151aa4=_0x253d1a;return compose()[_0x7e0b('0xc')](function(_0x5016e6,_0x27dd3c,_0x411dc5){return db[_0x7e0b('0xd')][_0x7e0b('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x7e0b('0xf')](function(_0x4ec3d8){var _0x3f63b5=getValueFromLicense(_0x71c0b2,_0x4ec3d8);return _0x3f63b5?_0x3f63b5:_0x151aa4;})['then'](function(_0x19a45f){_0x151aa4=_0x19a45f;return _0x5b9c4b[_0x7e0b('0x10')](_0x5852da);})[_0x7e0b('0xf')](function(_0x46bc8d){if(_0x46bc8d>=_0x151aa4){return _0x27dd3c['status'](0x193)['json']({'message':util['format'](_0x7e0b('0x11'),_0x71c0b2)});}_0x411dc5();})['catch'](function(_0x26b0f4){_0x411dc5(_0x26b0f4);});});}function isUserLimit(){return isLimit(_0x7e0b('0x12'),0x1,db[_0x7e0b('0x13')],{'where':{'$or':[{'role':'admin'},{'role':_0x7e0b('0x14')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x51db=['use','findOne','then','count','status','json','format','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty'];(function(_0xf61eb0,_0x5926d0){var _0x2c5894=function(_0x30150a){while(--_0x30150a){_0xf61eb0['push'](_0xf61eb0['shift']());}};_0x2c5894(++_0x5926d0);}(_0x51db,0xb5));var _0xb51d=function(_0x12da50,_0x4eab81){_0x12da50=_0x12da50-0x0;var _0x4159b0=_0x51db[_0x12da50];return _0x4159b0;};'use strict';var crypto=require(_0xb51d('0x0'));var util=require(_0xb51d('0x1'));var compose=require(_0xb51d('0x2'));var db=require(_0xb51d('0x3'))['db'];var config=require(_0xb51d('0x4'));function getValueFromLicense(_0x2db6cc,_0x5e87bb){if(_0x2db6cc&&_0x5e87bb){if(_0x5e87bb['data1']&&_0x5e87bb[_0xb51d('0x5')]){var _0x1e541a=_0x5e87bb[_0xb51d('0x6')];var _0x1fe1ab=_0x5e87bb[_0xb51d('0x5')];var _0x3af7f7=_0x1e541a[_0xb51d('0x7')]('-')[0x4];var _0x518cab=_0x1e541a[_0xb51d('0x7')]('-')[0x0];var _0x1e1e03=crypto[_0xb51d('0x8')]('aes-256-ctr',util['format'](_0xb51d('0x9'),_0x3af7f7,_0x1e541a,_0x518cab));var _0x52d49a=_0x1e1e03[_0xb51d('0xa')](_0x1fe1ab,_0xb51d('0xb'),_0xb51d('0xc'));_0x52d49a+=_0x1e1e03['final']('utf8');var _0x2e0297=JSON[_0xb51d('0xd')](_0x52d49a);return _0x2e0297[_0xb51d('0xe')](_0x2db6cc)?_0x2e0297[_0x2db6cc]:null;}}return null;}function isLimit(_0x517fc0,_0x2541e6,_0x174704,_0x4adda7){var _0x5cac33=_0x2541e6;return compose()[_0xb51d('0xf')](function(_0x2e5e7a,_0x4fc197,_0x21aa63){return db['License'][_0xb51d('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xb51d('0x11')](function(_0x5f3bf5){var _0x4ae594=getValueFromLicense(_0x517fc0,_0x5f3bf5);return _0x4ae594?_0x4ae594:_0x5cac33;})[_0xb51d('0x11')](function(_0xe79b4c){_0x5cac33=_0xe79b4c;return _0x174704[_0xb51d('0x12')](_0x4adda7);})[_0xb51d('0x11')](function(_0x53eea6){if(_0x53eea6>=_0x5cac33){return _0x4fc197[_0xb51d('0x13')](0x193)[_0xb51d('0x14')]({'message':util[_0xb51d('0x15')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x517fc0)});}_0x21aa63();})[_0xb51d('0x16')](function(_0x3e9a5b){_0x21aa63(_0x3e9a5b);});});}function isUserLimit(){return isLimit(_0xb51d('0x17'),0x1,db[_0xb51d('0x18')],{'where':{'$or':[{'role':_0xb51d('0x19')},{'role':_0xb51d('0x1a')}]}});}exports[_0xb51d('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 76e26cd..dc13754 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 _0xf097=['sequelize','fields','split','filters','forOwn','parse','limit','sort','map','priority','cast','col','unsigned','DESC','ASC','omit','isEmpty','isArray','length','isObject','isString','hasOwnProperty','lodash'];(function(_0x48431f,_0x23a62d){var _0x49c558=function(_0xff7a49){while(--_0xff7a49){_0x48431f['push'](_0x48431f['shift']());}};_0x49c558(++_0x23a62d);}(_0xf097,0x19d));var _0x7f09=function(_0xa63dbd,_0xe6a925){_0xa63dbd=_0xa63dbd-0x0;var _0x41e559=_0xf097[_0xa63dbd];return _0x41e559;};'use strict';var _=require(_0x7f09('0x0'));var sequelize=require(_0x7f09('0x1'));var LIMIT_VALUE=0xfa;exports[_0x7f09('0x2')]=function(_0x48a982){var _0x5a54d4=null;if(_0x48a982){_0x5a54d4=_0x48a982[_0x7f09('0x3')](',');}return _0x5a54d4;};exports[_0x7f09('0x4')]=function(_0x27470c){var _0x44b7cd={};if(!_['isEmpty'](_0x27470c)){_0x44b7cd={};_[_0x7f09('0x5')](_0x27470c,function(_0x432fd0,_0x4e38c4){try{_0x44b7cd[_0x4e38c4]=JSON[_0x7f09('0x6')](_0x432fd0);}catch(_0x5f5145){_0x44b7cd[_0x4e38c4]=_0x432fd0[_0x7f09('0x3')](',');}});}return _0x44b7cd;};exports[_0x7f09('0x7')]=function(_0x3eda60){_0x3eda60=parseInt(_0x3eda60,0xa);if(!_0x3eda60||_0x3eda60<0x0){_0x3eda60=LIMIT_VALUE;}return _0x3eda60;};exports['offset']=function(_0x2f7b87){_0x2f7b87=parseInt(_0x2f7b87,0xa);if(!_0x2f7b87||_0x2f7b87<0x0){_0x2f7b87=0x0;}return _0x2f7b87;};exports[_0x7f09('0x8')]=function(_0x1ac06f){var _0x2ee80b,_0x35fc5c=null;if(_0x1ac06f){_0x2ee80b=_0x1ac06f[_0x7f09('0x3')](',');_0x35fc5c=_[_0x7f09('0x9')](_0x2ee80b,function(_0x1b2aa6){if(_0x1b2aa6['indexOf']('-')===0x0){return[_0x1b2aa6===_0x7f09('0xa')?sequelize[_0x7f09('0xb')](sequelize[_0x7f09('0xc')](_0x7f09('0xa')),_0x7f09('0xd')):_0x1b2aa6['substr'](0x1),_0x7f09('0xe')];}else{return[_0x1b2aa6===_0x7f09('0xa')?sequelize['cast'](sequelize[_0x7f09('0xc')](_0x7f09('0xa')),_0x7f09('0xd')):_0x1b2aa6,_0x7f09('0xf')];}});}return _0x35fc5c;};exports[_0x7f09('0x10')]=function(_0x303a42,_0x5bc131){if(_[_0x7f09('0x11')](_0x303a42)){return _0x303a42;}if(_[_0x7f09('0x12')](_0x303a42)){for(var _0x4a55e9=0x0;_0x4a55e9<_0x303a42[_0x7f09('0x13')];_0x4a55e9+=0x1){_0x303a42[_0x4a55e9]=this['omit'](_0x303a42[_0x4a55e9],_0x5bc131);}return _0x303a42;}if(!_[_0x7f09('0x14')](_0x303a42)){return _0x303a42;}if(_[_0x7f09('0x15')](_0x5bc131)){_0x5bc131=[_0x5bc131];}if(!_[_0x7f09('0x12')](_0x5bc131)){return _0x303a42;}for(var _0x1c70f7=0x0;_0x1c70f7<_0x5bc131['length'];_0x1c70f7+=0x1){_['unset'](_0x303a42,_0x5bc131[_0x1c70f7]);}for(var _0x351a91 in _0x303a42){if(_0x303a42[_0x7f09('0x16')](_0x351a91)){_0x303a42[_0x351a91]=this[_0x7f09('0x10')](_0x303a42[_0x351a91],_0x5bc131);}}return _0x303a42;}; \ No newline at end of file +var _0xc82b=['lodash','fields','split','filters','forOwn','parse','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isArray','isObject','length','hasOwnProperty'];(function(_0x2abd8a,_0x340a68){var _0x12d388=function(_0x27896f){while(--_0x27896f){_0x2abd8a['push'](_0x2abd8a['shift']());}};_0x12d388(++_0x340a68);}(_0xc82b,0x1cc));var _0xbc82=function(_0x57f20b,_0x1a1f56){_0x57f20b=_0x57f20b-0x0;var _0x43383e=_0xc82b[_0x57f20b];return _0x43383e;};'use strict';var _=require(_0xbc82('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xbc82('0x1')]=function(_0x148105){var _0x1793f3=null;if(_0x148105){_0x1793f3=_0x148105[_0xbc82('0x2')](',');}return _0x1793f3;};exports[_0xbc82('0x3')]=function(_0x3f0a7d){var _0x3cfe4b={};if(!_['isEmpty'](_0x3f0a7d)){_0x3cfe4b={};_[_0xbc82('0x4')](_0x3f0a7d,function(_0x30f658,_0x59ade3){try{_0x3cfe4b[_0x59ade3]=JSON[_0xbc82('0x5')](_0x30f658);}catch(_0x52b0c5){_0x3cfe4b[_0x59ade3]=_0x30f658[_0xbc82('0x2')](',');}});}return _0x3cfe4b;};exports[_0xbc82('0x6')]=function(_0x1ca57b){_0x1ca57b=parseInt(_0x1ca57b,0xa);if(!_0x1ca57b||_0x1ca57b<0x0){_0x1ca57b=LIMIT_VALUE;}return _0x1ca57b;};exports[_0xbc82('0x7')]=function(_0x400c9f){_0x400c9f=parseInt(_0x400c9f,0xa);if(!_0x400c9f||_0x400c9f<0x0){_0x400c9f=0x0;}return _0x400c9f;};exports[_0xbc82('0x8')]=function(_0x195ed4){var _0x495a2a,_0x372db5=null;if(_0x195ed4){_0x495a2a=_0x195ed4[_0xbc82('0x2')](',');_0x372db5=_[_0xbc82('0x9')](_0x495a2a,function(_0x14860e){if(_0x14860e[_0xbc82('0xa')]('-')===0x0){return[_0x14860e===_0xbc82('0xb')?sequelize[_0xbc82('0xc')](sequelize[_0xbc82('0xd')]('priority'),_0xbc82('0xe')):_0x14860e[_0xbc82('0xf')](0x1),_0xbc82('0x10')];}else{return[_0x14860e===_0xbc82('0xb')?sequelize['cast'](sequelize[_0xbc82('0xd')]('priority'),_0xbc82('0xe')):_0x14860e,_0xbc82('0x11')];}});}return _0x372db5;};exports[_0xbc82('0x12')]=function(_0x2370d4,_0xfa5be1){if(_['isEmpty'](_0x2370d4)){return _0x2370d4;}if(_[_0xbc82('0x13')](_0x2370d4)){for(var _0x2855eb=0x0;_0x2855eb<_0x2370d4['length'];_0x2855eb+=0x1){_0x2370d4[_0x2855eb]=this['omit'](_0x2370d4[_0x2855eb],_0xfa5be1);}return _0x2370d4;}if(!_[_0xbc82('0x14')](_0x2370d4)){return _0x2370d4;}if(_['isString'](_0xfa5be1)){_0xfa5be1=[_0xfa5be1];}if(!_[_0xbc82('0x13')](_0xfa5be1)){return _0x2370d4;}for(var _0x2daebc=0x0;_0x2daebc<_0xfa5be1[_0xbc82('0x15')];_0x2daebc+=0x1){_['unset'](_0x2370d4,_0xfa5be1[_0x2daebc]);}for(var _0x28f5c6 in _0x2370d4){if(_0x2370d4[_0xbc82('0x16')](_0x28f5c6)){_0x2370d4[_0x28f5c6]=this[_0xbc82('0x12')](_0x2370d4[_0x28f5c6],_0xfa5be1);}}return _0x2370d4;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a2aa00d..5802bb5 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['views','/server/views','ejs','renderFile','view\x20engine','html','urlencoded','json','initialize','body-parser','method-override','cookie-parser','errorhandler','passport','cors','./environment','../mysqldb','env','production','join','favicon.ico','set','appPath','root','development','test','use','client','json\x20replacer','toISOString','static','get'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xcb91[_0x4b91c4];return _0x25cb80;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x1cb9('0x0'));var methodOverride=require(_0x1cb9('0x1'));var cookieParser=require(_0x1cb9('0x2'));var errorHandler=require(_0x1cb9('0x3'));var path=require('path');var passport=require(_0x1cb9('0x4'));var cors=require(_0x1cb9('0x5'));var moment=require('moment');var config=require(_0x1cb9('0x6'));var db=require(_0x1cb9('0x7'))['db'];exports['default']=function(_0x226b69){var _0x3f7deb=_0x226b69['get'](_0x1cb9('0x8'));if(_0x3f7deb===_0x1cb9('0x9')){_0x226b69['use'](favicon(path[_0x1cb9('0xa')](config['root'],'public',_0x1cb9('0xb'))));_0x226b69[_0x1cb9('0xc')](_0x1cb9('0xd'),path[_0x1cb9('0xa')](config[_0x1cb9('0xe')],'public'));}if(_0x3f7deb===_0x1cb9('0xf')||_0x3f7deb===_0x1cb9('0x10')){_0x226b69[_0x1cb9('0x11')](favicon(path[_0x1cb9('0xa')](config[_0x1cb9('0xe')],'client','favicon.ico')));_0x226b69['set'](_0x1cb9('0xd'),path[_0x1cb9('0xa')](config[_0x1cb9('0xe')],_0x1cb9('0x12')));_0x226b69['use'](errorHandler());}_0x226b69[_0x1cb9('0xc')](_0x1cb9('0x13'),function(_0x1b3cd7,_0x8dfa55){if(this[_0x1b3cd7]instanceof Date){_0x8dfa55=this[_0x1b3cd7][_0x1cb9('0x14')]()['split']('.')[0x0]+'Z';}return _0x8dfa55;});_0x226b69['use'](express[_0x1cb9('0x15')](_0x226b69[_0x1cb9('0x16')](_0x1cb9('0xd'))));_0x226b69[_0x1cb9('0xc')](_0x1cb9('0x17'),config[_0x1cb9('0xe')]+_0x1cb9('0x18'));_0x226b69['engine']('html',require(_0x1cb9('0x19'))[_0x1cb9('0x1a')]);_0x226b69[_0x1cb9('0xc')](_0x1cb9('0x1b'),_0x1cb9('0x1c'));_0x226b69[_0x1cb9('0x11')](bodyParser[_0x1cb9('0x1d')]({'limit':'50mb','extended':!![]}));_0x226b69['use'](bodyParser[_0x1cb9('0x1e')]({'limit':'50mb'}));_0x226b69[_0x1cb9('0x11')](cors());_0x226b69[_0x1cb9('0x11')](methodOverride());_0x226b69['use'](cookieParser());_0x226b69['use'](passport[_0x1cb9('0x1f')]());}; \ No newline at end of file +var _0x34e8=['passport','cors','moment','./environment','../mysqldb','get','env','production','use','join','root','public','favicon.ico','set','appPath','development','test','client','json\x20replacer','split','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override','errorhandler','path'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x34e8,0x12c));var _0x834e=function(_0xc50589,_0x3e0114){_0xc50589=_0xc50589-0x0;var _0x69bc66=_0x34e8[_0xc50589];return _0x69bc66;};'use strict';var express=require(_0x834e('0x0'));var favicon=require(_0x834e('0x1'));var bodyParser=require(_0x834e('0x2'));var methodOverride=require(_0x834e('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x834e('0x4'));var path=require(_0x834e('0x5'));var passport=require(_0x834e('0x6'));var cors=require(_0x834e('0x7'));var moment=require(_0x834e('0x8'));var config=require(_0x834e('0x9'));var db=require(_0x834e('0xa'))['db'];exports['default']=function(_0x858aa1){var _0x52056d=_0x858aa1[_0x834e('0xb')](_0x834e('0xc'));if(_0x52056d===_0x834e('0xd')){_0x858aa1[_0x834e('0xe')](favicon(path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x11'),_0x834e('0x12'))));_0x858aa1[_0x834e('0x13')](_0x834e('0x14'),path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x11')));}if(_0x52056d===_0x834e('0x15')||_0x52056d===_0x834e('0x16')){_0x858aa1[_0x834e('0xe')](favicon(path[_0x834e('0xf')](config['root'],_0x834e('0x17'),_0x834e('0x12'))));_0x858aa1['set'](_0x834e('0x14'),path[_0x834e('0xf')](config[_0x834e('0x10')],_0x834e('0x17')));_0x858aa1['use'](errorHandler());}_0x858aa1[_0x834e('0x13')](_0x834e('0x18'),function(_0x57274a,_0x316205){if(this[_0x57274a]instanceof Date){_0x316205=this[_0x57274a]['toISOString']()[_0x834e('0x19')]('.')[0x0]+'Z';}return _0x316205;});_0x858aa1[_0x834e('0xe')](express['static'](_0x858aa1[_0x834e('0xb')](_0x834e('0x14'))));_0x858aa1[_0x834e('0x13')]('views',config[_0x834e('0x10')]+_0x834e('0x1a'));_0x858aa1[_0x834e('0x1b')](_0x834e('0x1c'),require(_0x834e('0x1d'))[_0x834e('0x1e')]);_0x858aa1[_0x834e('0x13')]('view\x20engine',_0x834e('0x1c'));_0x858aa1[_0x834e('0xe')](bodyParser[_0x834e('0x1f')]({'limit':_0x834e('0x20'),'extended':!![]}));_0x858aa1['use'](bodyParser[_0x834e('0x21')]({'limit':_0x834e('0x20')}));_0x858aa1['use'](cors());_0x858aa1[_0x834e('0xe')](methodOverride());_0x858aa1[_0x834e('0xe')](cookieParser());_0x858aa1[_0x834e('0xe')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e89f024..b272a81 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 _0xa6c8=['internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','createHash','md5','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','filter','family','IPv4'];(function(_0x5b47d9,_0x1327ce){var _0x4151f0=function(_0x24bda2){while(--_0x24bda2){_0x5b47d9['push'](_0x5b47d9['shift']());}};_0x4151f0(++_0x1327ce);}(_0xa6c8,0x1d7));var _0x8a6c=function(_0x108d93,_0x3bb6a7){_0x108d93=_0x108d93-0x0;var _0x4e2334=_0xa6c8[_0x108d93];return _0x4e2334;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x8a6c('0x0'));var machine=require(_0x8a6c('0x1'));var exec=require(_0x8a6c('0x2'))['execSync'];function getInterfaces(){var _0x2f1f6f=[];var _0x1b2e74=os[_0x8a6c('0x3')]();var _0x32871b=_[_0x8a6c('0x4')](_[_0x8a6c('0x5')](_0x1b2e74));for(var _0x4f2d3b=0x0;_0x4f2d3b<_0x32871b['length'];_0x4f2d3b++){var _0x1c5adb=_0x1b2e74[_0x32871b[_0x4f2d3b]][_0x8a6c('0x6')](function(_0x2ec263){return _0x2ec263[_0x8a6c('0x7')]===_0x8a6c('0x8')&&_0x2ec263[_0x8a6c('0x9')]===![];});_0x2f1f6f=_0x2f1f6f['concat'](_0x1c5adb);}return _0x2f1f6f;}function getFirstInterface(){var _0x4570de=_[_0x8a6c('0xa')](getInterfaces());return{'macAddress':_0x4570de&&_0x4570de[_0x8a6c('0xb')]?_0x4570de[_0x8a6c('0xb')]:_0x8a6c('0xc'),'ipAddress':_0x4570de&&_0x4570de[_0x8a6c('0xd')]?_0x4570de[_0x8a6c('0xd')]:_0x8a6c('0xe')};}exports[_0x8a6c('0xf')]=getFirstInterface;function getCPUhash(){var _0xbc6ef5=_[_0x8a6c('0x4')](os[_0x8a6c('0x10')]()[_0x8a6c('0x11')](function(_0x2eac4e){return _0x2eac4e['model'];}))['join'](':');return crypto[_0x8a6c('0x12')](_0x8a6c('0x13'))[_0x8a6c('0x14')](_0xbc6ef5)[_0x8a6c('0x15')](_0x8a6c('0x16'));}exports[_0x8a6c('0x17')]=function(){switch(os[_0x8a6c('0x18')]()){case'win32':return exec(_0x8a6c('0x19'),{'encoding':_0x8a6c('0x1a')})[_0x8a6c('0x1b')]('\x0d\x0a','');default:var _0x1db94d=getFirstInterface();var _0x571898=getCPUhash();var _0x3047ea=_0x571898+'|'+os['hostname']()+'|'+_0x1db94d[_0x8a6c('0x1c')]+'|'+_0x1db94d['ipAddress'];var _0x20420b=crypto['createHash'](_0x8a6c('0x13'))[_0x8a6c('0x14')](_0x3047ea)[_0x8a6c('0x15')]('hex');return _0x20420b[_0x8a6c('0x1d')](0x0,0x8)+'-'+_0x20420b[_0x8a6c('0x1d')](0x8,0xc)+'-'+_0x20420b['substring'](0xc,0x10)+'-'+_0x20420b[_0x8a6c('0x1d')](0x10,0x14)+'-'+_0x20420b[_0x8a6c('0x1d')](0x14);}}; \ No newline at end of file +var _0x6609=['hostname','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','filter','family','IPv4','internal','concat','mac','getFirstInterface','orderBy','model','createHash','md5','update','digest','hex','getUuid','platform','win32','utf8'];(function(_0x44834a,_0x55463c){var _0x3c76c7=function(_0x4110d4){while(--_0x4110d4){_0x44834a['push'](_0x44834a['shift']());}};_0x3c76c7(++_0x55463c);}(_0x6609,0x1d8));var _0x9660=function(_0x51c1d2,_0x44f20a){_0x51c1d2=_0x51c1d2-0x0;var _0x538f59=_0x6609[_0x51c1d2];return _0x538f59;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9660('0x0'));var machine=require(_0x9660('0x1'));var exec=require(_0x9660('0x2'))[_0x9660('0x3')];function getInterfaces(){var _0xf40fd0=[];var _0xae6016=os['networkInterfaces']();var _0x31590e=_['orderBy'](_['keys'](_0xae6016));for(var _0x5da929=0x0;_0x5da929<_0x31590e['length'];_0x5da929++){var _0x4fbfed=_0xae6016[_0x31590e[_0x5da929]][_0x9660('0x4')](function(_0x58f9c0){return _0x58f9c0[_0x9660('0x5')]===_0x9660('0x6')&&_0x58f9c0[_0x9660('0x7')]===![];});_0xf40fd0=_0xf40fd0[_0x9660('0x8')](_0x4fbfed);}return _0xf40fd0;}function getFirstInterface(){var _0x237928=_['head'](getInterfaces());return{'macAddress':_0x237928&&_0x237928[_0x9660('0x9')]?_0x237928['mac']:'00:00:00:00:00:00','ipAddress':_0x237928&&_0x237928['address']?_0x237928['address']:'127.0.0.1'};}exports[_0x9660('0xa')]=getFirstInterface;function getCPUhash(){var _0x1fa2d6=_[_0x9660('0xb')](os['cpus']()['map'](function(_0x195d72){return _0x195d72[_0x9660('0xc')];}))['join'](':');return crypto[_0x9660('0xd')](_0x9660('0xe'))[_0x9660('0xf')](_0x1fa2d6)[_0x9660('0x10')](_0x9660('0x11'));}exports[_0x9660('0x12')]=function(){switch(os[_0x9660('0x13')]()){case _0x9660('0x14'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x9660('0x15')})['replace']('\x0d\x0a','');default:var _0x7775c0=getFirstInterface();var _0x494c91=getCPUhash();var _0x35472d=_0x494c91+'|'+os[_0x9660('0x16')]()+'|'+_0x7775c0[_0x9660('0x17')]+'|'+_0x7775c0[_0x9660('0x18')];var _0x596d05=crypto[_0x9660('0xd')](_0x9660('0xe'))[_0x9660('0xf')](_0x35472d)['digest'](_0x9660('0x11'));return _0x596d05[_0x9660('0x19')](0x0,0x8)+'-'+_0x596d05[_0x9660('0x19')](0x8,0xc)+'-'+_0x596d05[_0x9660('0x19')](0xc,0x10)+'-'+_0x596d05[_0x9660('0x19')](0x10,0x14)+'-'+_0x596d05['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 62083e5..6c93090 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 _0x76b9=['|uuid|','|email|','getFirstInterface','MOTLICENSE','Motion\x20License\x20Alert','Alert','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','format','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','crypto','moment','bluebird','pkginfo','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','catch','createCipher','secrets','session','base64','createDecipher','aes-256-ctr','update','utf8','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|'];(function(_0x488446,_0x3bdd26){var _0x2b5be8=function(_0x2684b3){while(--_0x2684b3){_0x488446['push'](_0x488446['shift']());}};_0x2b5be8(++_0x3bdd26);}(_0x76b9,0x1d1));var _0x976b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x76b9[_0x5834bc];return _0x3e183a;};'use strict';var util=require(_0x976b('0x0'));var crypto=require(_0x976b('0x1'));var moment=require(_0x976b('0x2'));var rp=require('request-promise');var BPromise=require(_0x976b('0x3'));var pkginfo=require(_0x976b('0x4'))(module,_0x976b('0x5'));var db=require(_0x976b('0x6'))['db'];var config=require('../environment');var hardware=require(_0x976b('0x7'));var logger=require('../logger')(_0x976b('0x8'));var jira=require(_0x976b('0x9'));var HOST=_0x976b('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x7b95de){return new BPromise(function(_0x128247,_0x454754){var _0x256941=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x7b95de,module['exports'][_0x976b('0x5')]);if(oldToken){_0x256941=util['format'](_0x976b('0xb'),HOST,_0x7b95de,module[_0x976b('0xc')][_0x976b('0x5')],oldToken);}var _0x4056da={'uri':_0x256941,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4056da)[_0x976b('0xd')](function(_0x3f1823){_0x128247(_0x3f1823);})[_0x976b('0xe')](function(_0x2ea4b7){_0x454754(_0x2ea4b7);});});}function encryptDate(_0xa24673){var _0x6d88ef=crypto[_0x976b('0xf')]('aes-256-ctr',config[_0x976b('0x10')][_0x976b('0x11')]);var _0x2a57d7=_0x6d88ef['update'](_0xa24673,'utf8','base64');_0x2a57d7+=_0x6d88ef['final'](_0x976b('0x12'));return _0x2a57d7;}function decryptDate(_0x40cec7){var _0x541409=crypto[_0x976b('0x13')](_0x976b('0x14'),config['secrets']['session']);var _0x4aae72=_0x541409[_0x976b('0x15')](_0x40cec7,_0x976b('0x12'),'utf8');_0x4aae72+=_0x541409['final'](_0x976b('0x16'));return _0x4aae72;}function sendJiraAlert(_0x1a5848,_0x2cec9d,_0x227239){var _0x49db06=_0x976b('0x17');return db[_0x976b('0x18')][_0x976b('0x19')]({'where':{'role':_0x976b('0x1a')},'attributes':[_0x976b('0x1b'),_0x976b('0x1c')],'raw':!![]})['then'](function(_0x1ae0ec){ADMIN=_0x1ae0ec;_0x49db06+=_0x976b('0x1d')+_0x227239+'|\x0a';_0x49db06+=_0x976b('0x1e')+_0x1a5848+'|\x0a';_0x49db06+='|machineUuid|'+_0x2cec9d+'|\x0a';_0x49db06+='|name|'+ADMIN[_0x976b('0x1b')]+'|\x0a';_0x49db06+=_0x976b('0x1f')+ADMIN[_0x976b('0x1c')]+'|\x0a';return _0x49db06;})[_0x976b('0xd')](function(_0x21361f){var _0x3ae986=hardware[_0x976b('0x20')]()['ipAddress'];return jira['openIssue']({'key':_0x976b('0x21'),'summary':_0x976b('0x22'),'description':_0x21361f,'issuetype':_0x976b('0x23'),'oldToken':_0x1a5848,'newToken':_0x2cec9d,'email':ADMIN[_0x976b('0x1c')],'name':ADMIN[_0x976b('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x3ae986});});}function manageLicense(_0x55665a,_0x8c1962){var _0x50b460=_0x8c1962['get']({'plain':!![]});httpRequest(_0x55665a)[_0x976b('0xd')](function(_0x174485){if(oldToken){oldToken=undefined;}if(_0x174485['active']){if(!_0x50b460[_0x976b('0x8')]&&_0x50b460['license']!=_0x174485[_0x976b('0x8')]||_0x50b460['license']&&_0x50b460[_0x976b('0x24')]){logger[_0x976b('0x25')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x50b460[_0x976b('0x8')]&&!_0x50b460['data2']&&_0x50b460[_0x976b('0x8')]!=_0x174485[_0x976b('0x8')]){logger['info'](_0x976b('0x26'));}if(_0x50b460[_0x976b('0x8')]&&!_0x50b460[_0x976b('0x24')]&&_0x50b460[_0x976b('0x8')]==_0x174485[_0x976b('0x8')]){return _0x8c1962;}return _0x8c1962[_0x976b('0x15')]({'data1':_0x55665a,'data2':null,'license':_0x174485[_0x976b('0x8')]});}else{if(_0x174485['license']||_0x50b460[_0x976b('0x8')]){if(!_0x50b460[_0x976b('0x24')]){if(_0x50b460['data1']==_0x55665a){GRAY_PERIOD_REASON=_0x976b('0x27');logger[_0x976b('0x25')](_0x976b('0x28'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x50b460[_0x976b('0x29')];logger[_0x976b('0x25')](_0x976b('0x2a'),_0x50b460['data1'],_0x55665a);}sendJiraAlert(_0x50b460[_0x976b('0x29')],_0x174485['uuid'],GRAY_PERIOD_REASON);logger[_0x976b('0x25')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x976b('0x2b')](_0x976b('0x2c')));return _0x8c1962[_0x976b('0x15')]({'data2':encryptDate(moment()[_0x976b('0x2b')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0x50b460[_0x976b('0x24')]),_0x976b('0x2d'))>DAYS){logger['info'](_0x976b('0x2e'),moment()[_0x976b('0x2b')](_0x976b('0x2c')));return _0x8c1962[_0x976b('0x15')]({'data1':_0x55665a,'data2':null,'license':null});}}}else{if(_0x50b460[_0x976b('0x29')]!=_0x55665a){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x50b460[_0x976b('0x29')],_0x55665a);return _0x8c1962[_0x976b('0x15')]({'data1':_0x55665a,'data2':null,'license':null});}}}return _0x8c1962;})[_0x976b('0xd')](function(_0xd6d869){_0x8c1962=_0xd6d869;})[_0x976b('0xe')](function(_0x235f98){logger[_0x976b('0x2f')](_0x235f98['message']);})[_0x976b('0x30')](function(){setTimeout(function(){manageLicense(hardware[_0x976b('0x31')](),_0x8c1962);},TIME);});}function defaultLicense(){var _0x80c693=hardware['getUuid']();if(_0x80c693){return db[_0x976b('0x32')][_0x976b('0x33')]({'where':{'id':0x1},'defaults':{'data1':_0x80c693}})['spread'](function(_0x14ecd2,_0xc17543){logger[_0x976b('0x25')](_0x976b('0x34'),_0x80c693);manageLicense(_0x80c693,_0x14ecd2);})[_0x976b('0xe')](function(_0x2298a5){logger[_0x976b('0x2f')](_0x2298a5[_0x976b('0x35')]);});}}exports[_0x976b('0x36')]=defaultLicense; \ No newline at end of file +var _0x7853=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','format','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../environment','./hardware','../logger','license','../../api/jira/jira.controller','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','||FIELD||VALUE||\x0a','findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','get','active','data2','info'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x7853,0x17b));var _0x3785=function(_0x4c4742,_0x493da6){_0x4c4742=_0x4c4742-0x0;var _0x18e733=_0x7853[_0x4c4742];return _0x18e733;};'use strict';var util=require(_0x3785('0x0'));var crypto=require('crypto');var moment=require(_0x3785('0x1'));var rp=require(_0x3785('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3785('0x3'))(module,_0x3785('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0x3785('0x5'));var hardware=require(_0x3785('0x6'));var logger=require(_0x3785('0x7'))(_0x3785('0x8'));var jira=require(_0x3785('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x1e3a8b){return new BPromise(function(_0x263d87,_0x32b6aa){var _0x201c2f=util['format'](_0x3785('0xa'),HOST,_0x1e3a8b,module[_0x3785('0xb')][_0x3785('0x4')]);if(oldToken){_0x201c2f=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x1e3a8b,module[_0x3785('0xb')]['version'],oldToken);}var _0x618bf7={'uri':_0x201c2f,'method':_0x3785('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x618bf7)[_0x3785('0xd')](function(_0x199913){_0x263d87(_0x199913);})[_0x3785('0xe')](function(_0x866813){_0x32b6aa(_0x866813);});});}function encryptDate(_0x56ac5d){var _0x1fe9dc=crypto[_0x3785('0xf')](_0x3785('0x10'),config[_0x3785('0x11')][_0x3785('0x12')]);var _0x4f7142=_0x1fe9dc[_0x3785('0x13')](_0x56ac5d,_0x3785('0x14'),_0x3785('0x15'));_0x4f7142+=_0x1fe9dc['final'](_0x3785('0x15'));return _0x4f7142;}function decryptDate(_0x390887){var _0xddf3c8=crypto['createDecipher'](_0x3785('0x10'),config[_0x3785('0x11')][_0x3785('0x12')]);var _0x6226ce=_0xddf3c8[_0x3785('0x13')](_0x390887,_0x3785('0x15'),_0x3785('0x14'));_0x6226ce+=_0xddf3c8[_0x3785('0x16')](_0x3785('0x14'));return _0x6226ce;}function sendJiraAlert(_0x421685,_0x10ffc5,_0x2a80b4){var _0x396b5c=_0x3785('0x17');return db['User'][_0x3785('0x18')]({'where':{'role':_0x3785('0x19')},'attributes':[_0x3785('0x1a'),_0x3785('0x1b')],'raw':!![]})[_0x3785('0xd')](function(_0x9e4c11){ADMIN=_0x9e4c11;_0x396b5c+=_0x3785('0x1c')+_0x2a80b4+'|\x0a';_0x396b5c+=_0x3785('0x1d')+_0x421685+'|\x0a';_0x396b5c+=_0x3785('0x1e')+_0x10ffc5+'|\x0a';_0x396b5c+=_0x3785('0x1f')+ADMIN['fullname']+'|\x0a';_0x396b5c+=_0x3785('0x20')+ADMIN[_0x3785('0x1b')]+'|\x0a';return _0x396b5c;})[_0x3785('0xd')](function(_0x154292){var _0x1e8865=hardware[_0x3785('0x21')]()[_0x3785('0x22')];return jira[_0x3785('0x23')]({'key':'MOTLICENSE','summary':_0x3785('0x24'),'description':_0x154292,'issuetype':'Alert','oldToken':_0x421685,'newToken':_0x10ffc5,'email':ADMIN[_0x3785('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x1e8865});});}function manageLicense(_0x3d177c,_0xf3ecda){var _0x4362f1=_0xf3ecda[_0x3785('0x25')]({'plain':!![]});httpRequest(_0x3d177c)[_0x3785('0xd')](function(_0xf6949e){if(oldToken){oldToken=undefined;}if(_0xf6949e[_0x3785('0x26')]){if(!_0x4362f1[_0x3785('0x8')]&&_0x4362f1[_0x3785('0x8')]!=_0xf6949e[_0x3785('0x8')]||_0x4362f1[_0x3785('0x8')]&&_0x4362f1[_0x3785('0x27')]){logger[_0x3785('0x28')](_0x3785('0x29'));}if(_0x4362f1['license']&&!_0x4362f1[_0x3785('0x27')]&&_0x4362f1[_0x3785('0x8')]!=_0xf6949e[_0x3785('0x8')]){logger[_0x3785('0x28')](_0x3785('0x2a'));}if(_0x4362f1[_0x3785('0x8')]&&!_0x4362f1['data2']&&_0x4362f1['license']==_0xf6949e[_0x3785('0x8')]){return _0xf3ecda;}return _0xf3ecda[_0x3785('0x13')]({'data1':_0x3d177c,'data2':null,'license':_0xf6949e[_0x3785('0x8')]});}else{if(_0xf6949e['license']||_0x4362f1[_0x3785('0x8')]){if(!_0x4362f1[_0x3785('0x27')]){if(_0x4362f1[_0x3785('0x2b')]==_0x3d177c){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x3785('0x2c'));}else{GRAY_PERIOD_REASON=_0x3785('0x2d');oldToken=_0x4362f1[_0x3785('0x2b')];logger['info'](_0x3785('0x2e'),_0x4362f1['data1'],_0x3d177c);}sendJiraAlert(_0x4362f1[_0x3785('0x2b')],_0xf6949e['uuid'],GRAY_PERIOD_REASON);logger[_0x3785('0x28')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x3785('0x2f')](),moment()['format'](_0x3785('0x30')));return _0xf3ecda['update']({'data2':encryptDate(moment()[_0x3785('0x31')](_0x3785('0x30')))});}else{if(moment()['diff'](decryptDate(_0x4362f1['data2']),_0x3785('0x32'))>DAYS){logger['info'](_0x3785('0x33'),moment()[_0x3785('0x31')]('YYYY-MM-DD\x20HH:mm'));return _0xf3ecda[_0x3785('0x13')]({'data1':_0x3d177c,'data2':null,'license':null});}}}else{if(_0x4362f1['data1']!=_0x3d177c){logger[_0x3785('0x28')](_0x3785('0x2e'),_0x4362f1[_0x3785('0x2b')],_0x3d177c);return _0xf3ecda[_0x3785('0x13')]({'data1':_0x3d177c,'data2':null,'license':null});}}}return _0xf3ecda;})[_0x3785('0xd')](function(_0x1d08b5){_0xf3ecda=_0x1d08b5;})[_0x3785('0xe')](function(_0x5f24d8){logger[_0x3785('0x34')](_0x5f24d8[_0x3785('0x35')]);})[_0x3785('0x36')](function(){setTimeout(function(){manageLicense(hardware[_0x3785('0x37')](),_0xf3ecda);},TIME);});}function defaultLicense(){var _0x4ae047=hardware[_0x3785('0x37')]();if(_0x4ae047){return db[_0x3785('0x38')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x4ae047}})[_0x3785('0x39')](function(_0x44852a,_0x4b1f90){logger[_0x3785('0x28')](_0x3785('0x3a'),_0x4ae047);manageLicense(_0x4ae047,_0x44852a);})[_0x3785('0xe')](function(_0x3d883e){logger[_0x3785('0x34')](_0x3d883e['message']);});}}exports[_0x3785('0x3b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 0e5780b..c9cf6a1 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 _0x671d=['getLicense','find','defaults','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','data1','data2','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','uuid','getUuid','createDecipher','secrets','session','update','deadline','add','grayReason','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license'];(function(_0x31b31b,_0x5f044e){var _0x2c8fc2=function(_0x5438aa){while(--_0x5438aa){_0x31b31b['push'](_0x31b31b['shift']());}};_0x2c8fc2(++_0x5f044e);}(_0x671d,0x6c));var _0xd671=function(_0x770c67,_0x1ea22b){_0x770c67=_0x770c67-0x0;var _0x2bdbbe=_0x671d[_0x770c67];return _0x2bdbbe;};'use strict';var crypto=require(_0xd671('0x0'));var util=require(_0xd671('0x1'));var _=require(_0xd671('0x2'));var moment=require(_0xd671('0x3'));var hardware=require(_0xd671('0x4'));var config=require(_0xd671('0x5'));var db=require(_0xd671('0x6'))['db'];function checkLicense(_0xe7832,_0x30d148){if(_0xe7832){try{var _0x1e78de=_0x30d148||_0xe7832[_0xd671('0x7')];if(_[_0xd671('0x8')](_0x1e78de)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x46620d=_0xe7832[_0xd671('0x9')];var _0xc2a94c=_0xe7832[_0xd671('0xa')];var _0x2900c3=_0x46620d[_0xd671('0xb')]('-')[0x4];var _0x215ec1=_0x46620d[_0xd671('0xb')]('-')[0x0];var _0x593f75=crypto['createDecipher'](_0xd671('0xc'),util[_0xd671('0xd')](_0xd671('0xe'),_0x2900c3,_0x46620d,_0x215ec1));var _0x24ae58=_0x593f75['update'](_0x1e78de,_0xd671('0xf'),_0xd671('0x10'));_0x24ae58+=_0x593f75[_0xd671('0x11')](_0xd671('0x10'));var _0x5c9b27=JSON['parse'](_0x24ae58);_0x5c9b27['demo']=![];_0x5c9b27[_0xd671('0x12')]=_0x46620d;_0x5c9b27['machineUuid']=hardware[_0xd671('0x13')]();if(_0xc2a94c){var _0xaacf27=crypto[_0xd671('0x14')](_0xd671('0xc'),config[_0xd671('0x15')][_0xd671('0x16')]);var _0x581744=_0xaacf27[_0xd671('0x17')](_0xc2a94c,_0xd671('0xf'),'utf8');_0x581744+=_0xaacf27[_0xd671('0x11')](_0xd671('0x10'));_0x5c9b27['gray']=_0x581744;_0x5c9b27[_0xd671('0x18')]=moment(_0x581744)[_0xd671('0x19')](0x7,'days')[_0xd671('0xd')]();_0x5c9b27[_0xd671('0x1a')]=_0x5c9b27['uuid']!=_0x5c9b27['machineUuid']?_0xd671('0x1b'):'disabled';}return _0x5c9b27;}catch(_0x28cb4a){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd671('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd671('0x1d'),'uuid':_0xe7832[_0xd671('0x9')],'machineUuid':hardware[_0xd671('0x13')](),'message':_0x28cb4a[_0xd671('0x1e')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd671('0x1f'),'uuid':_0xe7832[_0xd671('0x9')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0xd671('0x20')]=function(_0x6bf93b){return db['License'][_0xd671('0x21')](_[_0xd671('0x22')](_0x6bf93b,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x564b2f){return checkLicense(_0x564b2f,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x4481=['deadline','add','days','grayReason','disabled','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray'];(function(_0x56dd0e,_0x45768f){var _0x5ae8bf=function(_0xf53a43){while(--_0xf53a43){_0x56dd0e['push'](_0x56dd0e['shift']());}};_0x5ae8bf(++_0x45768f);}(_0x4481,0x1b2));var _0x1448=function(_0x255ee2,_0x398363){_0x255ee2=_0x255ee2-0x0;var _0x17a1e9=_0x4481[_0x255ee2];return _0x17a1e9;};'use strict';var crypto=require(_0x1448('0x0'));var util=require(_0x1448('0x1'));var _=require(_0x1448('0x2'));var moment=require(_0x1448('0x3'));var hardware=require(_0x1448('0x4'));var config=require('../environment');var db=require(_0x1448('0x5'))['db'];function checkLicense(_0x45e027,_0x5efa92){if(_0x45e027){try{var _0x24783d=_0x5efa92||_0x45e027[_0x1448('0x6')];if(_[_0x1448('0x7')](_0x24783d)){throw new Error(_0x1448('0x8'));}var _0x14fe62=_0x45e027[_0x1448('0x9')];var _0x1ff74a=_0x45e027[_0x1448('0xa')];var _0x575c26=_0x14fe62[_0x1448('0xb')]('-')[0x4];var _0xd411d9=_0x14fe62[_0x1448('0xb')]('-')[0x0];var _0x1f2a4a=crypto[_0x1448('0xc')](_0x1448('0xd'),util[_0x1448('0xe')](_0x1448('0xf'),_0x575c26,_0x14fe62,_0xd411d9));var _0x631483=_0x1f2a4a[_0x1448('0x10')](_0x24783d,_0x1448('0x11'),'utf8');_0x631483+=_0x1f2a4a[_0x1448('0x12')](_0x1448('0x13'));var _0xd11bf6=JSON[_0x1448('0x14')](_0x631483);_0xd11bf6[_0x1448('0x15')]=![];_0xd11bf6[_0x1448('0x16')]=_0x14fe62;_0xd11bf6[_0x1448('0x17')]=hardware[_0x1448('0x18')]();if(_0x1ff74a){var _0x4100ae=crypto[_0x1448('0xc')](_0x1448('0xd'),config[_0x1448('0x19')][_0x1448('0x1a')]);var _0x3fe4c0=_0x4100ae[_0x1448('0x10')](_0x1ff74a,'base64',_0x1448('0x13'));_0x3fe4c0+=_0x4100ae[_0x1448('0x12')](_0x1448('0x13'));_0xd11bf6[_0x1448('0x1b')]=_0x3fe4c0;_0xd11bf6[_0x1448('0x1c')]=moment(_0x3fe4c0)[_0x1448('0x1d')](0x7,_0x1448('0x1e'))[_0x1448('0xe')]();_0xd11bf6[_0x1448('0x1f')]=_0xd11bf6['uuid']!=_0xd11bf6['machineUuid']?'changed':_0x1448('0x20');}return _0xd11bf6;}catch(_0x484b21){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x45e027['data1'],'machineUuid':hardware[_0x1448('0x18')](),'message':_0x484b21[_0x1448('0x21')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1448('0x22'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1448('0x23'),'uuid':_0x45e027['data1'],'machineUuid':hardware[_0x1448('0x18')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x1448('0x24')]=function(_0x4f09bf){return db[_0x1448('0x25')][_0x1448('0x26')](_[_0x1448('0x27')](_0x4f09bf,{'raw':!![],'where':{'id':0x1}}))[_0x1448('0x28')](function(_0x4e51f9){return checkLicense(_0x4e51f9,null);});};exports[_0x1448('0x29')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index d97d1bb..5b94e56 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 _0x202c=['secret','exports','app-id'];(function(_0x4e443c,_0x3d62f7){var _0x414616=function(_0x2a91d8){while(--_0x2a91d8){_0x4e443c['push'](_0x4e443c['shift']());}};_0x414616(++_0x3d62f7);}(_0x202c,0x178));var _0xc202=function(_0x251e03,_0x33ab0a){_0x251e03=_0x251e03-0x0;var _0x32683e=_0x202c[_0x251e03];return _0x32683e;};'use strict';module[_0xc202('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xc202('0x1'),'GOOGLE_SECRET':_0xc202('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x8696=['http://localhost:9000','app-id','exports'];(function(_0x308634,_0x3817d5){var _0x353733=function(_0xbd89e1){while(--_0xbd89e1){_0x308634['push'](_0x308634['shift']());}};_0x353733(++_0x3817d5);}(_0x8696,0x143));var _0x6869=function(_0x177afa,_0x528318){_0x177afa=_0x177afa-0x0;var _0x562c39=_0x8696[_0x177afa];return _0x562c39;};'use strict';module[_0x6869('0x0')]={'DOMAIN':_0x6869('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x6869('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index fc88572..b839bab 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d79=['moment','winston','util','path','INFO','join','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','exports','transports','File','%s-%s','error','info','Console','debugLevel'];(function(_0x549a09,_0x2fe584){var _0x3ef978=function(_0x245752){while(--_0x245752){_0x549a09['push'](_0x549a09['shift']());}};_0x3ef978(++_0x2fe584);}(_0x1d79,0x1f4));var _0x91d7=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1d79[_0x138adb];return _0x1b27f2;};'use strict';var moment=require(_0x91d7('0x0'));var winston=require(_0x91d7('0x1'));var util=require(_0x91d7('0x2'));var path=require(_0x91d7('0x3'));var debugLevel=_0x91d7('0x4');function filename(_0x2d5231,_0xc1e73b){return path[_0x91d7('0x5')]('/var','log','xcally',util[_0x91d7('0x6')](_0x91d7('0x7'),_0x2d5231,_0xc1e73b));}function formatter(_0x1afdd4,_0xd67431){return util[_0x91d7('0x6')](_0x91d7('0x8'),moment()[_0x91d7('0x6')](_0x91d7('0x9')),_0xd67431[_0x91d7('0xa')]['toUpperCase'](),_0x1afdd4,_0xd67431[_0x91d7('0xb')]);}module[_0x91d7('0xc')]=function(_0x5b7197){return new winston['Logger']({'transports':[new winston[(_0x91d7('0xd'))][(_0x91d7('0xe'))]({'name':util[_0x91d7('0x6')](_0x91d7('0xf'),_0x5b7197,_0x91d7('0x10')),'filename':filename(_0x5b7197,_0x91d7('0x10')),'level':_0x91d7('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xc51078){return formatter(_0x5b7197,_0xc51078);}}),new winston[(_0x91d7('0xd'))][(_0x91d7('0xe'))]({'name':util[_0x91d7('0x6')]('%s-%s',_0x5b7197,_0x91d7('0x11')),'filename':filename(_0x5b7197,'info'),'level':_0x91d7('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x53ce86){return formatter(_0x5b7197,_0x53ce86);}}),new winston[(_0x91d7('0xd'))][(_0x91d7('0x12'))]({'level':process['env'][_0x91d7('0x13')]||debugLevel,'json':![],'formatter':function(_0x18a88f){return formatter(_0x5b7197,_0x18a88f);}})]});}; \ No newline at end of file +var _0x6060=['format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','moment','path','INFO','log','xcally','%s-%s.log'];(function(_0x12d0c8,_0x4c48b9){var _0x473da4=function(_0x258ffd){while(--_0x258ffd){_0x12d0c8['push'](_0x12d0c8['shift']());}};_0x473da4(++_0x4c48b9);}(_0x6060,0xae));var _0x0606=function(_0xa763f0,_0x9690a7){_0xa763f0=_0xa763f0-0x0;var _0x2e89a3=_0x6060[_0xa763f0];return _0x2e89a3;};'use strict';var moment=require(_0x0606('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x0606('0x1'));var debugLevel=_0x0606('0x2');function filename(_0xbd6c14,_0x51b3c5){return path['join']('/var',_0x0606('0x3'),_0x0606('0x4'),util['format'](_0x0606('0x5'),_0xbd6c14,_0x51b3c5));}function formatter(_0x3d7bbf,_0x5dca98){return util[_0x0606('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x0606('0x6')](_0x0606('0x7')),_0x5dca98[_0x0606('0x8')][_0x0606('0x9')](),_0x3d7bbf,_0x5dca98[_0x0606('0xa')]);}module[_0x0606('0xb')]=function(_0x2b29f4){return new winston[(_0x0606('0xc'))]({'transports':[new winston[(_0x0606('0xd'))][(_0x0606('0xe'))]({'name':util[_0x0606('0x6')](_0x0606('0xf'),_0x2b29f4,_0x0606('0x10')),'filename':filename(_0x2b29f4,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x528bb2){return formatter(_0x2b29f4,_0x528bb2);}}),new winston[(_0x0606('0xd'))][(_0x0606('0xe'))]({'name':util[_0x0606('0x6')](_0x0606('0xf'),_0x2b29f4,_0x0606('0x11')),'filename':filename(_0x2b29f4,_0x0606('0x11')),'level':_0x0606('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x18d036){return formatter(_0x2b29f4,_0x18d036);}}),new winston[(_0x0606('0xd'))]['Console']({'level':process[_0x0606('0x12')][_0x0606('0x13')]||debugLevel,'json':![],'formatter':function(_0x160f89){return formatter(_0x2b29f4,_0x160f89);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index eb50229..d9c8903 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 _0xe29e=['../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing'];(function(_0x215abe,_0x57c473){var _0xfec960=function(_0x40c71b){while(--_0x40c71b){_0x215abe['push'](_0x215abe['shift']());}};_0xfec960(++_0x57c473);}(_0xe29e,0xed));var _0xee29=function(_0x213a36,_0x204288){_0x213a36=_0x213a36-0x0;var _0x59b295=_0xe29e[_0x213a36];return _0x59b295;};'use strict';var path=require(_0xee29('0x0'));var os=require('os');var config={'apps':[{'name':_0xee29('0x1'),'script':path[_0xee29('0x2')](__dirname,_0xee29('0x3'))},{'name':_0xee29('0x4'),'script':path['join'](__dirname,_0xee29('0x5'))},{'name':_0xee29('0x6'),'script':path[_0xee29('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xee29('0x7'),'script':path[_0xee29('0x2')](__dirname,_0xee29('0x8'))},{'name':_0xee29('0x9'),'script':path[_0xee29('0x2')](__dirname,_0xee29('0xa'))},{'name':_0xee29('0xb'),'script':path[_0xee29('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xee29('0xc')]=config; \ No newline at end of file +var _0x8018=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x423549,_0x242e63){var _0xdcb104=function(_0x6bff59){while(--_0x6bff59){_0x423549['push'](_0x423549['shift']());}};_0xdcb104(++_0x242e63);}(_0x8018,0x152));var _0x8801=function(_0x979707,_0x25c133){_0x979707=_0x979707-0x0;var _0x160ad4=_0x8018[_0x979707];return _0x160ad4;};'use strict';var path=require(_0x8801('0x0'));var os=require('os');var config={'apps':[{'name':_0x8801('0x1'),'script':path[_0x8801('0x2')](__dirname,_0x8801('0x3'))},{'name':_0x8801('0x4'),'script':path[_0x8801('0x2')](__dirname,_0x8801('0x5'))},{'name':_0x8801('0x6'),'script':path[_0x8801('0x2')](__dirname,_0x8801('0x7'))},{'name':_0x8801('0x8'),'script':path['join'](__dirname,_0x8801('0x9'))},{'name':_0x8801('0xa'),'script':path[_0x8801('0x2')](__dirname,_0x8801('0xb'))},{'name':_0x8801('0xc'),'script':path[_0x8801('0x2')](__dirname,_0x8801('0xd'))}]};module[_0x8801('0xe')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4423268..fc2560d 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 _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x4219b0,_0x4ef471){var _0x540410=function(_0x174ce4){while(--_0x174ce4){_0x4219b0['push'](_0x4219b0['shift']());}};_0x540410(++_0x4ef471);}(_0xedd9,0xfc));var _0x9edd=function(_0x4057ca,_0xbe5390){_0x4057ca=_0x4057ca-0x0;var _0x20f2ea=_0xedd9[_0x4057ca];return _0x20f2ea;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});}; \ No newline at end of file +var _0x3e74=['saved','pm2','./config','connected','then','start','disconnect','stop','list','describe','delete','dump'];(function(_0x4eb9a1,_0x337a49){var _0x16d01c=function(_0x3a14b0){while(--_0x3a14b0){_0x4eb9a1['push'](_0x4eb9a1['shift']());}};_0x16d01c(++_0x337a49);}(_0x3e74,0x175));var _0x43e7=function(_0x504a12,_0x3ac837){_0x504a12=_0x504a12-0x0;var _0x122fc4=_0x3e74[_0x504a12];return _0x122fc4;};'use strict';var pm2=require(_0x43e7('0x0'));var BPromise=require('bluebird');var config=require(_0x43e7('0x1'));function connect(){return new BPromise(function(_0x287a1d,_0x151ad2){return pm2['connect'](function(_0x490ced){if(_0x490ced){return _0x151ad2(_0x490ced);}return _0x287a1d(_0x43e7('0x2'));});});};exports['start']=function(_0x128b0f){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0xe78cb7,_0x1c503b){return pm2[_0x43e7('0x4')](_0x128b0f,function(_0x503698,_0x45a0d1){if(_0x503698){return _0x1c503b(_0x503698);}pm2[_0x43e7('0x5')]();return _0xe78cb7(_0x45a0d1);});});});};exports[_0x43e7('0x6')]=function(_0x8528fc){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x516b4d,_0x212c6c){return pm2['stop'](_0x8528fc,function(_0x54948c,_0x39c8bd){if(_0x54948c){return _0x212c6c(_0x54948c);}pm2[_0x43e7('0x5')]();return _0x516b4d(_0x39c8bd);});});});};exports['restart']=function(_0x2803d9){return connect()['then'](function(){return new BPromise(function(_0xf7c520,_0x37302c){return pm2['restart'](_0x2803d9,function(_0x3eb206,_0xc960ea){if(_0x3eb206){return _0x37302c(_0x3eb206);}pm2[_0x43e7('0x5')]();return _0xf7c520(_0xc960ea);});});});};exports[_0x43e7('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x583d85,_0x2fcb36){return pm2[_0x43e7('0x7')](function(_0x44b0bd,_0x51b974){if(_0x44b0bd){return _0x2fcb36(_0x44b0bd);}pm2['disconnect']();return _0x583d85(_0x51b974);});});});};exports[_0x43e7('0x8')]=function(_0x14c146){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x328445,_0x4de324){return pm2['describe'](_0x14c146,function(_0xdf16c,_0x264575){if(_0xdf16c){return _0x4de324(_0xdf16c);}pm2[_0x43e7('0x5')]();return _0x328445(_0x264575);});});});};exports['delete']=function(_0x4b5a6b){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x1ca758,_0x9037d3){return pm2[_0x43e7('0x9')](_0x4b5a6b,function(_0x3776f5,_0x1f24fb){if(_0x3776f5){return _0x9037d3(_0x3776f5);}pm2[_0x43e7('0x5')]();return _0x1ca758(_0x1f24fb);});});});};exports[_0x43e7('0xa')]=function(){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0xab63cf,_0x191dd5){return pm2[_0x43e7('0xa')](function(_0x4b5d64){if(_0x4b5d64){return _0x191dd5(_0x4b5d64);}return _0xab63cf(_0x43e7('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b728e09..57b5e21 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 _0x1301=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','error','lodash','moment','../../config/environment','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','then','update','system'];(function(_0x41ca78,_0x509f22){var _0x4d4418=function(_0x13a75f){while(--_0x13a75f){_0x41ca78['push'](_0x41ca78['shift']());}};_0x4d4418(++_0x509f22);}(_0x1301,0x70));var _0x1130=function(_0x1e1152,_0x449dc7){_0x1e1152=_0x1e1152-0x0;var _0xd43413=_0x1301[_0x1e1152];return _0xd43413;};'use strict';var _=require(_0x1130('0x0'));var moment=require(_0x1130('0x1'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x1130('0x2'));config[_0x1130('0x3')]=_[_0x1130('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1130('0x5'))(new Redis(config[_0x1130('0x3')]));function closeInteractions(){var _0x199ff6=0x0;var _0x282638=[];return db[_0x1130('0x6')][_0x1130('0x7')]({'raw':!![],'attributes':['id',_0x1130('0x8')],'where':{'id':0x1}})['then'](function(_0x52bdfd){_0x199ff6=_0x52bdfd[_0x1130('0x8')];if(_0x199ff6){return db[_0x1130('0x9')][_0x1130('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x52bdfd['chatTimeout'],'minutes')}}});}else{return[];}})[_0x1130('0xb')](function(_0x4b4877){_0x282638=_0x4b4877;if(_0x199ff6){return db['ChatInteraction'][_0x1130('0xc')]({'closeReason':_0x1130('0xd'),'disposition':_0x1130('0xe'),'closed':!![],'closedAt':moment()[_0x1130('0xf')](_0x1130('0x10'))},{'where':{'id':_[_0x1130('0x11')](_0x282638||[],'id')}});}})[_0x1130('0xb')](function(_0x2aa72e){for(var _0x16eacc=0x0;_0x16eacc<_0x282638[_0x1130('0x12')];_0x16eacc++){io['emit'](_0x1130('0x13'),{'id':_0x282638[_0x16eacc]['id'],'closed':!![]});}})['catch'](function(_0x5ad096){console[_0x1130('0x14')](_0x5ad096);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x969d=['findAll','subtract','minutes','update','system','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','localhost','Setting','find','chatTimeout','then','ChatInteraction'];(function(_0x5b8450,_0x15d897){var _0x44b462=function(_0x229114){while(--_0x229114){_0x5b8450['push'](_0x5b8450['shift']());}};_0x44b462(++_0x15d897);}(_0x969d,0x76));var _0xd969=function(_0x128d9f,_0x52495d){_0x128d9f=_0x128d9f-0x0;var _0x271575=_0x969d[_0x128d9f];return _0x271575;};'use strict';var _=require(_0xd969('0x0'));var moment=require(_0xd969('0x1'));var Redis=require(_0xd969('0x2'));var db=require(_0xd969('0x3'))['db'];var config=require(_0xd969('0x4'));config[_0xd969('0x5')]=_['defaults'](config[_0xd969('0x5')],{'host':_0xd969('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd969('0x5')]));function closeInteractions(){var _0x179da7=0x0;var _0x92f0ed=[];return db[_0xd969('0x7')][_0xd969('0x8')]({'raw':!![],'attributes':['id',_0xd969('0x9')],'where':{'id':0x1}})[_0xd969('0xa')](function(_0x5451a8){_0x179da7=_0x5451a8['chatTimeout'];if(_0x179da7){return db[_0xd969('0xb')][_0xd969('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd969('0xd')](_0x5451a8[_0xd969('0x9')],_0xd969('0xe'))}}});}else{return[];}})[_0xd969('0xa')](function(_0x5168de){_0x92f0ed=_0x5168de;if(_0x179da7){return db['ChatInteraction'][_0xd969('0xf')]({'closeReason':_0xd969('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xd969('0x11')](_0xd969('0x12'))},{'where':{'id':_[_0xd969('0x13')](_0x92f0ed||[],'id')}});}})['then'](function(_0x3b2c74){for(var _0x292f1a=0x0;_0x292f1a<_0x92f0ed[_0xd969('0x14')];_0x292f1a++){io[_0xd969('0x15')](_0xd969('0x16'),{'id':_0x92f0ed[_0x292f1a]['id'],'closed':!![]});}})[_0xd969('0x17')](function(_0x2dd616){console[_0xd969('0x18')](_0x2dd616);});}exports[_0xd969('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index c806fc3..0117bf3 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 _0x04b4=['extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','findAll','MailServerOut','keys','toString','keyBy','intersection','difference','exists','toRun','length','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','isBetween','update','update\x20cron','run','path','moment','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','Smtp','MailAccount','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename'];(function(_0x595687,_0x4f9fdb){var _0x54e645=function(_0x5cc4fe){while(--_0x5cc4fe){_0x595687['push'](_0x595687['shift']());}};_0x54e645(++_0x4f9fdb);}(_0x04b4,0xf2));var _0x404b=function(_0x79da72,_0x14146c){_0x79da72=_0x79da72-0x0;var _0x12cad4=_0x04b4[_0x79da72];return _0x12cad4;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x404b('0x0'));var _=require('lodash');var moment=require(_0x404b('0x1'));var CronJobManager=require(_0x404b('0x2'));var jayson=require(_0x404b('0x3'));var BPromise=require('bluebird');var logger=require(_0x404b('0x4'))(_0x404b('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x404b('0x6'));var analyticDefaultReportController=require(_0x404b('0x7'));var client=jayson['client'][_0x404b('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42c7c3,_0x464e43){return function(){logger[_0x404b('0x9')](_0x404b('0xa'),_0x42c7c3['email']);var _0x90ecef=!![];var _0x42b13d={'tls':{'rejectUnauthorized':![]}};if(_0x42c7c3['MailAccount'][_0x404b('0xb')]['service']){_0x42b13d['service']=_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0xd')];}else{_0x42b13d[_0x404b('0xe')]=_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0xe')];_0x42b13d[_0x404b('0xf')]=_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0xf')];_0x42b13d[_0x404b('0x10')]=_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0x10')];}if(_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0x11')]){_0x42b13d[_0x404b('0x12')]={'user':_0x42c7c3['MailAccount'][_0x404b('0xb')]['user'],'pass':_0x42c7c3[_0x404b('0xc')][_0x404b('0xb')][_0x404b('0x13')]};}var _0x2d7afd={'account':_0x42b13d,'message':{'from':util[_0x404b('0x14')](_0x404b('0x15'),_0x42c7c3['MailAccount'][_0x404b('0x16')],_0x42c7c3[_0x404b('0xc')][_0x404b('0x17')]||_0x42c7c3['MailAccount'][_0x404b('0xb')][_0x404b('0x18')]),'to':_0x42c7c3['email'],'cc':_0x42c7c3['cc'],'bcc':_0x42c7c3[_0x404b('0x19')],'subject':util[_0x404b('0x14')](_0x404b('0x1a'),_0x464e43['name'],_0x42c7c3[_0x404b('0x1b')],_0x42c7c3[_0x404b('0x1c')])}};var _0x392a0d=path[_0x404b('0x1d')](__dirname,_0x404b('0x1e'));var _0x2ef156=_0x464e43[_0x404b('0x1f')];var _0x53adf0=util[_0x404b('0x14')](_0x404b('0x20'),path[_0x404b('0x21')](_0x464e43[_0x404b('0x1f')],path[_0x404b('0x22')](_0x464e43['savename'])),_0x404b('0x23'));var _0x56a5f5=path[_0x404b('0x1d')](_0x392a0d,_0x2ef156);var _0x1556cf=path[_0x404b('0x1d')](_0x392a0d,_0x53adf0);if(fs[_0x404b('0x24')](_0x56a5f5)){_0x464e43[_0x404b('0x25')]=_0x404b('0x26');_0x2d7afd[_0x404b('0x27')][_0x404b('0x28')]=[{'filename':_0x2ef156,'path':_0x56a5f5}];_0x2d7afd[_0x404b('0x27')][_0x404b('0x29')]=util['format'](_0x404b('0x2a'),JSON[_0x404b('0x2b')](_0x464e43,null,0x2));}else if(fs[_0x404b('0x24')](_0x1556cf)){_0x464e43[_0x404b('0x25')]='Sent';_0x2d7afd[_0x404b('0x27')]['attachments']=[{'filename':_0x53adf0,'path':_0x1556cf}];}else{_0x2d7afd[_0x404b('0x27')]['text']=_0x404b('0x2c');if(!_0x42c7c3[_0x404b('0x2d')]){_0x90ecef=![];logger[_0x404b('0x9')](_0x404b('0x2e'));}}if(_0x90ecef){return client[_0x404b('0x2f')](_0x404b('0x30'),_0x2d7afd)[_0x404b('0x31')](function(_0xbf0717){if(_0xbf0717[_0x404b('0x32')]){return logger[_0x404b('0x32')](_0x404b('0x33'),JSON[_0x404b('0x2b')](_0xbf0717));}return logger[_0x404b('0x9')](_0x404b('0x34'));})[_0x404b('0x35')](function(_0x11d19e){return logger['error']('error\x20mail',JSON[_0x404b('0x2b')](_0x11d19e));});}};}function handleError(){return function(_0x479498){return logger[_0x404b('0x32')](JSON[_0x404b('0x2b')](_0x479498));};}function handleResult(_0x39b30a){return function(_0x13c263){logger[_0x404b('0x9')](_0x404b('0x36'),JSON[_0x404b('0x2b')](_0x13c263));if(_0x39b30a[_0x404b('0xc')]&&_0x39b30a[_0x404b('0xc')]['Smtp']&&!_[_0x404b('0x37')](_0x39b30a[_0x404b('0x17')])){setTimeout(handleSendEmail(_0x39b30a,_0x13c263),0x3c*0x3e8);}};}function handleJob(_0x381230){return function(){try{if(_[_0x404b('0x37')](_0x381230[_0x404b('0x1b')])){return logger[_0x404b('0x9')](_0x404b('0x38'));}if(_[_0x404b('0x37')](_0x381230[_0x404b('0x1c')])){return logger[_0x404b('0x9')](_0x404b('0x39'));}var _0x29644a={'startDate':moment()[_0x404b('0x3a')](_0x381230[_0x404b('0x1b')],_0x381230[_0x404b('0x1c')])[_0x404b('0x14')](_0x404b('0x3b')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x404b('0x3c'),'output':_0x381230['output'],'name':_0x381230['name']};if(!_[_0x404b('0x37')](_0x381230[_0x404b('0x3d')])){logger[_0x404b('0x9')]('exec\x20defaul\x20report\x20id:%s',_0x381230[_0x404b('0x3d')]);return analyticDefaultReportController['runReport']({'id':_0x381230[_0x404b('0x3d')]},_0x29644a)['then'](handleResult(_0x381230))['catch'](handleError());}if(!_[_0x404b('0x37')](_0x381230[_0x404b('0x3e')])){logger['info'](_0x404b('0x3f'),_0x381230[_0x404b('0x3e')]);return analyticCustomReportController[_0x404b('0x40')]({'id':_0x381230['CustomReportId']},_0x29644a)[_0x404b('0x31')](handleResult(_0x381230))[_0x404b('0x35')](handleError());}}catch(_0x34d8f9){logger[_0x404b('0x32')](JSON[_0x404b('0x2b')](_0x34d8f9));}return logger['info'](_0x404b('0x41'));};}function getJobs(_0x367755){var _0xb54eb6={};if(_0x367755){_0xb54eb6['id']=_0x367755;}return db['Schedule'][_0x404b('0x42')]({'where':_0xb54eb6,'include':[{'model':db[_0x404b('0xc')],'attributes':['id',_0x404b('0x16'),'email'],'include':[{'model':db[_0x404b('0x43')],'as':'Smtp'}]}]})['then'](function(_0x9ef7a9){var _0x542a89=_[_0x404b('0x44')](manager['jobs']);var _0x16ec64=_['map'](_0x9ef7a9,function(_0x5818dd){return _0x5818dd['id'][_0x404b('0x45')]();});var _0x489ef7=_[_0x404b('0x46')](_0x9ef7a9,function(_0x44fb92){return _0x44fb92['id'][_0x404b('0x45')]();});var _0x392ba5=_0x367755?_0x16ec64:_['difference'](_0x16ec64,_0x542a89);var _0x5b0f10=_[_0x404b('0x47')](_0x16ec64,_0x542a89);var _0x3ec7cd=_[_0x404b('0x48')](_0x542a89,_0x16ec64);var _0x1cd209;var _0x19c787;for(_0x1cd209=0x0;_0x1cd209<_0x3ec7cd['length']&&!_0x367755;_0x1cd209+=0x1){_0x19c787=_0x3ec7cd[_0x1cd209]['toString']();if(manager[_0x404b('0x49')](_0x19c787)){manager['stop'](_0x19c787);manager['deleteJob'](_0x19c787);logger[_0x404b('0x9')]('delete\x20cron',_0x19c787);}}logger['info'](_0x404b('0x4a'),JSON[_0x404b('0x2b')](_0x392ba5));for(_0x1cd209=0x0;_0x1cd209<_0x392ba5[_0x404b('0x4b')];_0x1cd209+=0x1){_0x19c787=_0x392ba5[_0x1cd209][_0x404b('0x45')]();logger[_0x404b('0x9')]('index',_0x19c787);if(_0x367755){logger[_0x404b('0x9')](_0x404b('0x4c'),_0x367755);logger['info'](JSON[_0x404b('0x2b')](_0x489ef7[_0x19c787]));BPromise[_0x404b('0x4d')]()[_0x404b('0x31')](handleJob(_0x489ef7[_0x19c787]));logger['info'](_0x404b('0x4e'),_0x489ef7[_0x19c787][_0x404b('0x16')],_0x489ef7[_0x19c787][_0x404b('0x4f')]);}else if(_0x489ef7[_0x19c787][_0x404b('0x4f')]&&_0x489ef7[_0x19c787][_0x404b('0x50')]&&moment()['isBetween'](_0x489ef7[_0x19c787][_0x404b('0x51')],_0x489ef7[_0x19c787][_0x404b('0x52')])){manager[_0x404b('0x53')](_0x19c787,_0x489ef7[_0x19c787][_0x404b('0x4f')],handleJob(_0x489ef7[_0x19c787]));manager[_0x404b('0x54')](_0x19c787);logger[_0x404b('0x9')](_0x404b('0x55'),_0x489ef7[_0x19c787]['name'],_0x489ef7[_0x19c787]['cron']);}else if(manager[_0x404b('0x49')](_0x19c787)){manager['stop'](_0x19c787);manager[_0x404b('0x56')](_0x19c787);logger[_0x404b('0x9')](_0x404b('0x57'),_0x489ef7[_0x19c787][_0x404b('0x16')],_0x489ef7[_0x19c787][_0x404b('0x4f')]);}}for(_0x1cd209=0x0,_0x19c787;_0x1cd209<_0x5b0f10[_0x404b('0x4b')]&&!_0x367755;_0x1cd209+=0x1){_0x19c787=_0x5b0f10[_0x1cd209][_0x404b('0x45')]();if(manager['exists'](_0x19c787)){if(_0x489ef7[_0x19c787]['cron']&&_0x489ef7[_0x19c787][_0x404b('0x50')]&&moment()[_0x404b('0x58')](_0x489ef7[_0x19c787][_0x404b('0x51')],_0x489ef7[_0x19c787]['endAt'])){manager[_0x404b('0x59')](_0x19c787,_0x489ef7[_0x19c787][_0x404b('0x4f')],handleJob(_0x489ef7[_0x19c787]));logger[_0x404b('0x9')](_0x404b('0x5a'),_0x489ef7[_0x19c787][_0x404b('0x16')],_0x489ef7[_0x19c787][_0x404b('0x4f')]);}else{manager['stop'](_0x19c787);manager['deleteJob'](_0x19c787);logger[_0x404b('0x9')](_0x404b('0x57'),_0x489ef7[_0x19c787]['name'],_0x489ef7[_0x19c787][_0x404b('0x4f')]);}}}})['catch'](function(_0x14d1fe){logger['error'](JSON[_0x404b('0x2b')](_0x14d1fe));});}exports[_0x404b('0x5b')]=function(_0x8807a9){return getJobs(_0x8807a9);};exports[_0x404b('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa526=['join','../../files/reports','savename','basename','extname','zip','existsSync','status','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','resolve','run\x20job','active','isBetween','add','cron','start','add\x20cron','stop\x20cron','startAt','endAt','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0xa526,0x199));var _0x6a52=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0xa526[_0x967959];return _0x5c4489;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x6a52('0x0'));var _=require(_0x6a52('0x1'));var moment=require(_0x6a52('0x2'));var CronJobManager=require(_0x6a52('0x3'));var jayson=require(_0x6a52('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x6a52('0x5'));var db=require(_0x6a52('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x6a52('0x7'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5d180f,_0x31a1b0){return function(){logger[_0x6a52('0x8')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5d180f[_0x6a52('0x9')]);var _0x428cbc=!![];var _0x3a79bb={'tls':{'rejectUnauthorized':![]}};if(_0x5d180f[_0x6a52('0xa')]['Smtp'][_0x6a52('0xb')]){_0x3a79bb[_0x6a52('0xb')]=_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')]['service'];}else{_0x3a79bb[_0x6a52('0xd')]=_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')][_0x6a52('0xd')];_0x3a79bb[_0x6a52('0xe')]=_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')]['port'];_0x3a79bb['secure']=_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')][_0x6a52('0xf')];}if(_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')][_0x6a52('0x10')]){_0x3a79bb[_0x6a52('0x11')]={'user':_0x5d180f[_0x6a52('0xa')][_0x6a52('0xc')]['user'],'pass':_0x5d180f[_0x6a52('0xa')]['Smtp'][_0x6a52('0x12')]};}var _0x42e536={'account':_0x3a79bb,'message':{'from':util[_0x6a52('0x13')](_0x6a52('0x14'),_0x5d180f['MailAccount'][_0x6a52('0x15')],_0x5d180f['MailAccount'][_0x6a52('0x9')]||_0x5d180f['MailAccount']['Smtp'][_0x6a52('0x16')]),'to':_0x5d180f[_0x6a52('0x9')],'cc':_0x5d180f['cc'],'bcc':_0x5d180f['bcc'],'subject':util[_0x6a52('0x13')](_0x6a52('0x17'),_0x31a1b0[_0x6a52('0x15')],_0x5d180f[_0x6a52('0x18')],_0x5d180f[_0x6a52('0x19')])}};var _0x2de8a7=path[_0x6a52('0x1a')](__dirname,_0x6a52('0x1b'));var _0xcf8c81=_0x31a1b0[_0x6a52('0x1c')];var _0x2880d7=util[_0x6a52('0x13')]('%s.%s',path[_0x6a52('0x1d')](_0x31a1b0[_0x6a52('0x1c')],path[_0x6a52('0x1e')](_0x31a1b0[_0x6a52('0x1c')])),_0x6a52('0x1f'));var _0x231958=path[_0x6a52('0x1a')](_0x2de8a7,_0xcf8c81);var _0x2073d7=path['join'](_0x2de8a7,_0x2880d7);if(fs[_0x6a52('0x20')](_0x231958)){_0x31a1b0[_0x6a52('0x21')]='Sent';_0x42e536['message'][_0x6a52('0x22')]=[{'filename':_0xcf8c81,'path':_0x231958}];_0x42e536[_0x6a52('0x23')]['text']=util['format'](_0x6a52('0x24'),JSON[_0x6a52('0x25')](_0x31a1b0,null,0x2));}else if(fs[_0x6a52('0x20')](_0x2073d7)){_0x31a1b0[_0x6a52('0x21')]=_0x6a52('0x26');_0x42e536['message'][_0x6a52('0x22')]=[{'filename':_0x2880d7,'path':_0x2073d7}];}else{_0x42e536[_0x6a52('0x23')][_0x6a52('0x27')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5d180f[_0x6a52('0x28')]){_0x428cbc=![];logger[_0x6a52('0x8')](_0x6a52('0x29'));}}if(_0x428cbc){return client['request'](_0x6a52('0x2a'),_0x42e536)[_0x6a52('0x2b')](function(_0x4a08d9){if(_0x4a08d9[_0x6a52('0x2c')]){return logger[_0x6a52('0x2c')](_0x6a52('0x2d'),JSON['stringify'](_0x4a08d9));}return logger[_0x6a52('0x8')](_0x6a52('0x2e'));})[_0x6a52('0x2f')](function(_0x5aabe7){return logger[_0x6a52('0x2c')]('error\x20mail',JSON['stringify'](_0x5aabe7));});}};}function handleError(){return function(_0x5b2378){return logger[_0x6a52('0x2c')](JSON[_0x6a52('0x25')](_0x5b2378));};}function handleResult(_0x44212d){return function(_0xae0093){logger['info']('data',JSON['stringify'](_0xae0093));if(_0x44212d[_0x6a52('0xa')]&&_0x44212d['MailAccount'][_0x6a52('0xc')]&&!_[_0x6a52('0x30')](_0x44212d['email'])){setTimeout(handleSendEmail(_0x44212d,_0xae0093),0x3c*0x3e8);}};}function handleJob(_0x56ffac){return function(){try{if(_['isNil'](_0x56ffac['subtractNumber'])){return logger[_0x6a52('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x56ffac[_0x6a52('0x19')])){return logger[_0x6a52('0x8')](_0x6a52('0x31'));}var _0xc7c14={'startDate':moment()[_0x6a52('0x32')](_0x56ffac['subtractNumber'],_0x56ffac[_0x6a52('0x19')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x6a52('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x6a52('0x33'),'output':_0x56ffac[_0x6a52('0x34')],'name':_0x56ffac[_0x6a52('0x15')]};if(!_['isNil'](_0x56ffac[_0x6a52('0x35')])){logger[_0x6a52('0x8')](_0x6a52('0x36'),_0x56ffac['DefaultReportId']);return analyticDefaultReportController[_0x6a52('0x37')]({'id':_0x56ffac[_0x6a52('0x35')]},_0xc7c14)['then'](handleResult(_0x56ffac))[_0x6a52('0x2f')](handleError());}if(!_['isNil'](_0x56ffac[_0x6a52('0x38')])){logger['info'](_0x6a52('0x39'),_0x56ffac[_0x6a52('0x38')]);return analyticCustomReportController['runReport']({'id':_0x56ffac[_0x6a52('0x38')]},_0xc7c14)['then'](handleResult(_0x56ffac))[_0x6a52('0x2f')](handleError());}}catch(_0x3d7fe5){logger[_0x6a52('0x2c')](JSON[_0x6a52('0x25')](_0x3d7fe5));}return logger[_0x6a52('0x8')](_0x6a52('0x3a'));};}function getJobs(_0x5de5d7){var _0x3303f5={};if(_0x5de5d7){_0x3303f5['id']=_0x5de5d7;}return db[_0x6a52('0x3b')][_0x6a52('0x3c')]({'where':_0x3303f5,'include':[{'model':db[_0x6a52('0xa')],'attributes':['id',_0x6a52('0x15'),'email'],'include':[{'model':db[_0x6a52('0x3d')],'as':_0x6a52('0xc')}]}]})[_0x6a52('0x2b')](function(_0x228008){var _0x4c5dfc=_['keys'](manager[_0x6a52('0x3e')]);var _0x294f04=_[_0x6a52('0x3f')](_0x228008,function(_0x2f0a45){return _0x2f0a45['id'][_0x6a52('0x40')]();});var _0xe38adc=_['keyBy'](_0x228008,function(_0x473f7c){return _0x473f7c['id'][_0x6a52('0x40')]();});var _0x462e63=_0x5de5d7?_0x294f04:_[_0x6a52('0x41')](_0x294f04,_0x4c5dfc);var _0x394850=_[_0x6a52('0x42')](_0x294f04,_0x4c5dfc);var _0x415af1=_[_0x6a52('0x41')](_0x4c5dfc,_0x294f04);var _0x14f175;var _0x16393f;for(_0x14f175=0x0;_0x14f175<_0x415af1['length']&&!_0x5de5d7;_0x14f175+=0x1){_0x16393f=_0x415af1[_0x14f175][_0x6a52('0x40')]();if(manager[_0x6a52('0x43')](_0x16393f)){manager[_0x6a52('0x44')](_0x16393f);manager[_0x6a52('0x45')](_0x16393f);logger['info'](_0x6a52('0x46'),_0x16393f);}}logger['info']('toRun',JSON[_0x6a52('0x25')](_0x462e63));for(_0x14f175=0x0;_0x14f175<_0x462e63[_0x6a52('0x47')];_0x14f175+=0x1){_0x16393f=_0x462e63[_0x14f175]['toString']();logger[_0x6a52('0x8')](_0x6a52('0x48'),_0x16393f);if(_0x5de5d7){logger[_0x6a52('0x8')]('my\x20id',_0x5de5d7);logger[_0x6a52('0x8')](JSON['stringify'](_0xe38adc[_0x16393f]));BPromise[_0x6a52('0x49')]()[_0x6a52('0x2b')](handleJob(_0xe38adc[_0x16393f]));logger['info'](_0x6a52('0x4a'),_0xe38adc[_0x16393f][_0x6a52('0x15')],_0xe38adc[_0x16393f]['cron']);}else if(_0xe38adc[_0x16393f]['cron']&&_0xe38adc[_0x16393f][_0x6a52('0x4b')]&&moment()[_0x6a52('0x4c')](_0xe38adc[_0x16393f]['startAt'],_0xe38adc[_0x16393f]['endAt'])){manager[_0x6a52('0x4d')](_0x16393f,_0xe38adc[_0x16393f][_0x6a52('0x4e')],handleJob(_0xe38adc[_0x16393f]));manager[_0x6a52('0x4f')](_0x16393f);logger[_0x6a52('0x8')](_0x6a52('0x50'),_0xe38adc[_0x16393f]['name'],_0xe38adc[_0x16393f]['cron']);}else if(manager[_0x6a52('0x43')](_0x16393f)){manager[_0x6a52('0x44')](_0x16393f);manager[_0x6a52('0x45')](_0x16393f);logger[_0x6a52('0x8')](_0x6a52('0x51'),_0xe38adc[_0x16393f][_0x6a52('0x15')],_0xe38adc[_0x16393f][_0x6a52('0x4e')]);}}for(_0x14f175=0x0,_0x16393f;_0x14f175<_0x394850['length']&&!_0x5de5d7;_0x14f175+=0x1){_0x16393f=_0x394850[_0x14f175]['toString']();if(manager[_0x6a52('0x43')](_0x16393f)){if(_0xe38adc[_0x16393f]['cron']&&_0xe38adc[_0x16393f][_0x6a52('0x4b')]&&moment()[_0x6a52('0x4c')](_0xe38adc[_0x16393f][_0x6a52('0x52')],_0xe38adc[_0x16393f][_0x6a52('0x53')])){manager[_0x6a52('0x54')](_0x16393f,_0xe38adc[_0x16393f][_0x6a52('0x4e')],handleJob(_0xe38adc[_0x16393f]));logger[_0x6a52('0x8')](_0x6a52('0x55'),_0xe38adc[_0x16393f][_0x6a52('0x15')],_0xe38adc[_0x16393f]['cron']);}else{manager[_0x6a52('0x44')](_0x16393f);manager['deleteJob'](_0x16393f);logger[_0x6a52('0x8')](_0x6a52('0x51'),_0xe38adc[_0x16393f][_0x6a52('0x15')],_0xe38adc[_0x16393f][_0x6a52('0x4e')]);}}}})[_0x6a52('0x2f')](function(_0x551dd8){logger[_0x6a52('0x2c')](JSON[_0x6a52('0x25')](_0x551dd8));});}exports[_0x6a52('0x56')]=function(_0x5d39ed){return getJobs(_0x5d39ed);};exports[_0x6a52('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index aa1bad7..f67ca86 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1990=['hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper'];(function(_0x4e582e,_0x2c7196){var _0x19e5d1=function(_0x258a5a){while(--_0x258a5a){_0x4e582e['push'](_0x4e582e['shift']());}};_0x19e5d1(++_0x2c7196);}(_0x1990,0x90));var _0x0199=function(_0x54130a,_0x563607){_0x54130a=_0x54130a-0x0;var _0xae38ba=_0x1990[_0x54130a];return _0xae38ba;};'use strict';var util=require(_0x0199('0x0'));var db=require(_0x0199('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0199('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0199('0x3')+i,'phone':0xf879fb460+i,'email':_0x0199('0x4')+i+_0x0199('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0199('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0199('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0199('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0199('0x2')]({'id':i,'firstName':_0x0199('0x7')+i,'lastName':_0x0199('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0199('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x0199('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0199('0x6')](),'updatedAt':Date[_0x0199('0x6')]()});}db[_0x0199('0x8')][_0x0199('0x9')]({'where':{}})[_0x0199('0xa')](function(){return db[_0x0199('0x8')][_0x0199('0xb')](contacts);})['then'](function(){console[_0x0199('0xc')](_0x0199('0xd'),_0x0199('0xe'));return db[_0x0199('0xf')][_0x0199('0x9')]({'where':{}});})[_0x0199('0xa')](function(){return db[_0x0199('0xf')][_0x0199('0xb')](hopper);})[_0x0199('0xa')](function(){console[_0x0199('0xc')](_0x0199('0xd'),_0x0199('0x10'));return db[_0x0199('0x8')][_0x0199('0xb')](contacts2);})['then'](function(){console[_0x0199('0xc')]('finished\x20populating',_0x0199('0x11'));return db[_0x0199('0xf')]['bulkCreate'](hopper2);})[_0x0199('0xa')](function(){console[_0x0199('0xc')](_0x0199('0xd'),_0x0199('0x12'));})[_0x0199('0x13')](function(_0x16cdd8){console[_0x0199('0xc')](_0x16cdd8);}); \ No newline at end of file +var _0xcaf9=['push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','hopper2','catch','util'];(function(_0x9360b7,_0x4f8db1){var _0x34e5db=function(_0x3023fd){while(--_0x3023fd){_0x9360b7['push'](_0x9360b7['shift']());}};_0x34e5db(++_0x4f8db1);}(_0xcaf9,0x19d));var _0x9caf=function(_0x1f30c0,_0x4a2cb1){_0x1f30c0=_0x1f30c0-0x0;var _0x4ff065=_0xcaf9[_0x1f30c0];return _0x4ff065;};'use strict';var util=require(_0x9caf('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9caf('0x1')]({'id':i,'firstName':_0x9caf('0x2')+i,'lastName':_0x9caf('0x3')+i,'phone':0xf879fb460+i,'email':_0x9caf('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9caf('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x9caf('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9caf('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9caf('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9caf('0x3')+i,'phone':0xf879fb460+i,'email':_0x9caf('0x4')+i+_0x9caf('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x9caf('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9caf('0x5')](),'updatedAt':Date[_0x9caf('0x5')]()});}db[_0x9caf('0x7')][_0x9caf('0x8')]({'where':{}})[_0x9caf('0x9')](function(){return db[_0x9caf('0x7')][_0x9caf('0xa')](contacts);})['then'](function(){console[_0x9caf('0xb')]('finished\x20populating',_0x9caf('0xc'));return db[_0x9caf('0xd')][_0x9caf('0x8')]({'where':{}});})[_0x9caf('0x9')](function(){return db[_0x9caf('0xd')][_0x9caf('0xa')](hopper);})[_0x9caf('0x9')](function(){console['log'](_0x9caf('0xe'),_0x9caf('0xf'));return db[_0x9caf('0x7')][_0x9caf('0xa')](contacts2);})['then'](function(){console['log'](_0x9caf('0xe'),'contacts2');return db['CmHopper'][_0x9caf('0xa')](hopper2);})[_0x9caf('0x9')](function(){console[_0x9caf('0xb')]('finished\x20populating',_0x9caf('0x10'));})[_0x9caf('0x11')](function(_0x595548){console['log'](_0x595548);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 531f047..6e197c3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04ac=['then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>'];(function(_0x5524ff,_0x18a811){var _0x4eb65c=function(_0x10f706){while(--_0x10f706){_0x5524ff['push'](_0x5524ff['shift']());}};_0x4eb65c(++_0x18a811);}(_0x04ac,0xe0));var _0xc04a=function(_0x5a402c,_0x5a8f00){_0x5a402c=_0x5a402c-0x0;var _0x22d60c=_0x04ac[_0x5a402c];return _0x22d60c;};'use strict';var util=require(_0xc04a('0x0'));var db=require(_0xc04a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc04a('0x2')]({'name':util[_0xc04a('0x3')](_0xc04a('0x4'),_0xc04a('0x5'),i),'fullname':util['format'](_0xc04a('0x4'),'agent',i),'email':util[_0xc04a('0x3')](_0xc04a('0x6'),_0xc04a('0x5'),i),'role':_0xc04a('0x5'),'password':_0xc04a('0x7'),'internal':0xfa0+i,'type':_0xc04a('0x8'),'transport':[_0xc04a('0x9'),'ws','wss'],'disallow':['all'],'allow':[_0xc04a('0xa')],'defaultuser':util['format'](_0xc04a('0x4'),_0xc04a('0x5'),i),'encryption':_0xc04a('0xb'),'avpf':_0xc04a('0xb'),'force_avp':_0xc04a('0xb'),'icesupport':'yes','dtlsenable':_0xc04a('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xc04a('0xc'),'dtlssetup':'actpass','callerid':util[_0xc04a('0x3')](_0xc04a('0xd'),util['format'](_0xc04a('0x4'),'agent',i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xc04a('0xe')](function(){console[_0xc04a('0xf')](_0xc04a('0x10'));})['catch'](function(_0x47a1f8){console[_0xc04a('0xf')](_0x47a1f8);}); \ No newline at end of file +var _0x4b48=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','udp','wss','all','yes'];(function(_0x384d6e,_0x577312){var _0x7d32d8=function(_0x16f70b){while(--_0x16f70b){_0x384d6e['push'](_0x384d6e['shift']());}};_0x7d32d8(++_0x577312);}(_0x4b48,0xb4));var _0x84b4=function(_0x5cea66,_0x3ff198){_0x5cea66=_0x5cea66-0x0;var _0x5d6070=_0x4b48[_0x5cea66];return _0x5d6070;};'use strict';var util=require('util');var db=require(_0x84b4('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x84b4('0x1'),'agent',i),'fullname':util['format'](_0x84b4('0x1'),_0x84b4('0x2'),i),'email':util[_0x84b4('0x3')](_0x84b4('0x4'),'agent',i),'role':_0x84b4('0x2'),'password':_0x84b4('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x84b4('0x6'),'ws',_0x84b4('0x7')],'disallow':[_0x84b4('0x8')],'allow':['ulaw'],'defaultuser':util[_0x84b4('0x3')](_0x84b4('0x1'),'agent',i),'encryption':_0x84b4('0x9'),'avpf':_0x84b4('0x9'),'force_avp':'yes','icesupport':_0x84b4('0x9'),'dtlsenable':_0x84b4('0x9'),'dtlsverify':'no','dtlscertfile':_0x84b4('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x84b4('0xb'),'callerid':util[_0x84b4('0x3')](_0x84b4('0xc'),util[_0x84b4('0x3')](_0x84b4('0x1'),_0x84b4('0x2'),i),0xfa0+i)});}db[_0x84b4('0xd')][_0x84b4('0xe')](users)[_0x84b4('0xf')](function(){console[_0x84b4('0x10')](_0x84b4('0x11'));})[_0x84b4('0x12')](function(_0x3a7d79){console[_0x84b4('0x10')](_0x3a7d79);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ace25fa..736285d 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12cc=['SmsQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueue','MailQueue','OpenchannelQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','voice','fax','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_fax_interactions:remove','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues'];(function(_0x96d7c7,_0x187861){var _0x2cb8f5=function(_0xdba37){while(--_0xdba37){_0x96d7c7['push'](_0x96d7c7['shift']());}};_0x2cb8f5(++_0x187861);}(_0x12cc,0xa2));var _0xc12c=function(_0x2bbdf8,_0x143c30){_0x2bbdf8=_0x2bbdf8-0x0;var _0x556d07=_0x12cc[_0x2bbdf8];return _0x556d07;};'use strict';var _=require(_0xc12c('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xc12c('0x1')],'include':[{'as':_0xc12c('0x2'),'model':db[_0xc12c('0x3')],'attributes':['id',_0xc12c('0x1'),_0xc12c('0x4')],'raw':!![],'where':{'role':_0xc12c('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc12c('0x1')],'where':{'role':_0xc12c('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc12c('0x1')]};var queryAgents={'raw':!![],'attributes':['id',_0xc12c('0x1')],'where':{'role':_0xc12c('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc12c('0x1'),_0xc12c('0x7')],'where':{'type':_0xc12c('0x8')}};function getAssociatedResources(_0x58be35,_0x4d66c3,_0x39ae0a){return db[_0xc12c('0x9')][_0xc12c('0xa')]({'where':{'name':_0x58be35,'userProfileId':_0x4d66c3},'raw':!![]})['then'](function(_0x35ca06){if(_0x35ca06){if(_0x35ca06[_0xc12c('0xb')]){switch(_0x58be35){case _0xc12c('0xc'):case _0xc12c('0xd'):case'FaxQueues':case _0xc12c('0xe'):case _0xc12c('0xf'):case'OpenchannelQueues':return db[_0x39ae0a][_0xc12c('0x10')](queryQueues);case'Telephones':return db[_0x39ae0a][_0xc12c('0x10')](queryTelephones);case _0xc12c('0x11'):return db[_0x39ae0a][_0xc12c('0x10')](queryTrunks);case _0xc12c('0x12'):return db[_0x39ae0a][_0xc12c('0x10')](queryCampaigns);}}else{return db[_0xc12c('0x13')][_0xc12c('0x10')]({'attributes':[_0xc12c('0x14')],'where':{'sectionId':_0x35ca06['id']},'raw':!![]})[_0xc12c('0x15')](function(_0x5f2230){if(_0x5f2230){var _0x42de41={'where':{'id':_[_0xc12c('0x16')](_0x5f2230,_0xc12c('0x14'))},'raw':!![]};switch(_0x39ae0a){case _0xc12c('0x3'):_0x42de41[_0xc12c('0x17')][_0xc12c('0x4')]=_0xc12c('0x6');break;case _0xc12c('0x18'):_0x42de41['where'][_0xc12c('0x7')]=_0xc12c('0x8');break;}return db[_0x39ae0a][_0xc12c('0x10')](_0x42de41);}else{return[];}});}}else{return[];}})['then'](function(_0x4b7d50){return _0x4b7d50;});}function joinOrLeaveQueues(_0x369100,_0x101d6f,_0x498afb,_0x2fd461){_0x369100[_0x101d6f](util[_0xc12c('0x19')](_0xc12c('0x1a'),_0x498afb,_0x2fd461[_0xc12c('0x1')]));if(_0x2fd461['Agents']){for(var _0x3ee649=0x0;_0x3ee649<_0x2fd461['Agents'][_0xc12c('0x1b')];_0x3ee649+=0x1){_0x369100[_0x101d6f](util[_0xc12c('0x19')](_0xc12c('0x1c'),_0x2fd461[_0xc12c('0x2')][_0x3ee649]['name']));}}}function joinOrLeave(_0x48a8c0,_0x1e6edf,_0x38734d){var _0x4d0551;if(_0x48a8c0[_0xc12c('0x1d')][_0xc12c('0x1e')]['id']){db[_0xc12c('0x3')][_0xc12c('0x1f')]({'attributes':['id',_0xc12c('0x1'),'role',_0xc12c('0x20')],'where':{'id':_0x48a8c0[_0xc12c('0x1d')][_0xc12c('0x1e')]['id']},'include':[{'model':db[_0xc12c('0x21')],'as':_0xc12c('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xc12c('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xc12c('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xc12c('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc12c('0x26')],'as':_0xc12c('0x27'),'attributes':['id'],'raw':!![]}]})[_0xc12c('0x15')](function(_0x437338){if(_0x437338){_0x4d0551=_0x437338;_0x48a8c0[_0x1e6edf](util[_0xc12c('0x19')](_0xc12c('0x1c'),_0x437338[_0xc12c('0x1')]));var _0x191b50=[];switch(_0x437338[_0xc12c('0x4')]){case _0xc12c('0x28'):_0x48a8c0[_0x1e6edf](_0xc12c('0x29'));_0x48a8c0[_0x1e6edf](_0xc12c('0x2a'));if(queryQueues[_0xc12c('0x2b')](_0xc12c('0x2c'))){delete queryQueues[_0xc12c('0x2c')];}_0x191b50[_0xc12c('0x2d')](db['VoiceQueue'][_0xc12c('0x10')](queryQueues));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x2e')]['findAll'](queryQueues));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x2f')]['findAll'](queryQueues));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x30')][_0xc12c('0x10')](queryQueues));_0x191b50[_0xc12c('0x2d')](db['MailQueue'][_0xc12c('0x10')](queryQueues));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x31')]['findAll'](queryQueues));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x3')][_0xc12c('0x10')](queryTelephones));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x32')][_0xc12c('0x10')](queryTrunks));_0x191b50['push'](db['Campaign']['findAll'](queryCampaigns));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x3')][_0xc12c('0x10')](queryAgents));break;case _0xc12c('0x33'):_0x48a8c0[_0x1e6edf](_0xc12c('0x29'));_0x48a8c0[_0x1e6edf](_0xc12c('0x2a'));_0x191b50[_0xc12c('0x2d')](getAssociatedResources('VoiceQueues',_0x437338[_0xc12c('0x20')],_0xc12c('0x34')));_0x191b50['push'](getAssociatedResources(_0xc12c('0xd'),_0x437338[_0xc12c('0x20')],'ChatQueue'));_0x191b50[_0xc12c('0x2d')](getAssociatedResources('FaxQueues',_0x437338['userProfileId'],'FaxQueue'));_0x191b50[_0xc12c('0x2d')](getAssociatedResources(_0xc12c('0xe'),_0x437338['userProfileId'],'SmsQueue'));_0x191b50[_0xc12c('0x2d')](getAssociatedResources(_0xc12c('0xf'),_0x437338[_0xc12c('0x20')],_0xc12c('0x35')));_0x191b50[_0xc12c('0x2d')](getAssociatedResources(_0xc12c('0x36'),_0x437338[_0xc12c('0x20')],_0xc12c('0x31')));_0x191b50[_0xc12c('0x2d')](getAssociatedResources('Telephones',_0x437338[_0xc12c('0x20')],_0xc12c('0x3')));_0x191b50[_0xc12c('0x2d')](getAssociatedResources('Trunks',_0x437338[_0xc12c('0x20')],_0xc12c('0x32')));_0x191b50[_0xc12c('0x2d')](getAssociatedResources(_0xc12c('0x12'),_0x437338[_0xc12c('0x20')],_0xc12c('0x18')));_0x191b50[_0xc12c('0x2d')](db[_0xc12c('0x3')][_0xc12c('0x10')](queryAgents));break;case'agent':_0x48a8c0[_0x1e6edf](_0xc12c('0x29'));_0x48a8c0[_0x1e6edf]('voice:outbound');_0x191b50['push'](_0x437338['getVoiceQueues']({'attributes':['id','name']}));_0x191b50[_0xc12c('0x2d')](_0x437338[_0xc12c('0x37')]({'attributes':['id','name']}));_0x191b50[_0xc12c('0x2d')](_0x437338[_0xc12c('0x38')]({'attributes':['id',_0xc12c('0x1')]}));_0x191b50[_0xc12c('0x2d')](_0x437338[_0xc12c('0x39')]({'attributes':['id',_0xc12c('0x1')]}));_0x191b50['push'](_0x437338['getMailQueues']({'attributes':['id','name']}));_0x191b50[_0xc12c('0x2d')](_0x437338[_0xc12c('0x3a')]({'attributes':['id',_0xc12c('0x1')]}));break;}return BPromise['all'](_0x191b50);}})['then'](function(_0x35e246){if(_0x35e246&&_0x35e246['length']){for(var _0x1bdfe6=0x0;_0x1bdfe6<_0x35e246['length'];_0x1bdfe6+=0x1){for(var _0x3ab544=0x0;_0x3ab544<_0x35e246[_0x1bdfe6][_0xc12c('0x1b')];_0x3ab544+=0x1){switch(_0x1bdfe6){case 0x0:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,_0xc12c('0x3b'),_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x1:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,'chat',_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x2:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,_0xc12c('0x3c'),_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x3:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,'sms',_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x4:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,_0xc12c('0x3d'),_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x5:joinOrLeaveQueues(_0x48a8c0,_0x1e6edf,_0xc12c('0x3e'),_0x35e246[_0x1bdfe6][_0x3ab544]);break;case 0x6:_0x48a8c0[_0x1e6edf](util[_0xc12c('0x19')](_0xc12c('0x3f'),_0x35e246[_0x1bdfe6][_0x3ab544][_0xc12c('0x1')]));break;case 0x7:_0x48a8c0[_0x1e6edf](util[_0xc12c('0x19')](_0xc12c('0x40'),_0x35e246[_0x1bdfe6][_0x3ab544][_0xc12c('0x1')]));break;case 0x8:_0x48a8c0[_0x1e6edf](util[_0xc12c('0x19')](_0xc12c('0x41'),_0x35e246[_0x1bdfe6][_0x3ab544][_0xc12c('0x7')],_0x35e246[_0x1bdfe6][_0x3ab544]['name']));break;case 0x9:_0x48a8c0[_0x1e6edf](util[_0xc12c('0x19')](_0xc12c('0x1c'),_0x35e246[_0x1bdfe6][_0x3ab544][_0xc12c('0x1')]));break;}}}}})['then'](function(){if(_0x1e6edf==='leave'){var _0x3805d0=_[_0xc12c('0x16')](_0x4d0551['ChatInteractions'],'id');return _0x4d0551[_0xc12c('0x42')](_0x3805d0)['then'](function(){for(var _0x260757=0x0;_0x260757<_0x3805d0[_0xc12c('0x1b')];_0x260757+=0x1){_0x38734d['emit'](_0xc12c('0x43'),{'ChatInteractionId':Number(_0x3805d0[_0x260757]),'UserId':Number(_0x4d0551['id'])});}});}})['then'](function(){if(_0x1e6edf===_0xc12c('0x44')){var _0x3f1618=_[_0xc12c('0x16')](_0x4d0551['MailInteractions'],'id');return _0x4d0551[_0xc12c('0x45')](_0x3f1618)[_0xc12c('0x15')](function(){for(var _0x1dae7b=0x0;_0x1dae7b<_0x3f1618['length'];_0x1dae7b+=0x1){_0x38734d['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3f1618[_0x1dae7b]),'UserId':Number(_0x4d0551['id'])});}});}})[_0xc12c('0x15')](function(){if(_0x1e6edf===_0xc12c('0x44')){var _0x32b31e=_['map'](_0x4d0551[_0xc12c('0x24')],'id');return _0x4d0551['removeFaxInteractions'](_0x32b31e)['then'](function(){for(var _0x23c9b2=0x0;_0x23c9b2<_0x32b31e[_0xc12c('0x1b')];_0x23c9b2+=0x1){_0x38734d['emit'](_0xc12c('0x46'),{'FaxInteractionId':Number(_0x32b31e[_0x23c9b2]),'UserId':Number(_0x4d0551['id'])});}});}})['then'](function(){if(_0x1e6edf===_0xc12c('0x44')){var _0x4ea846=_['map'](_0x4d0551['SmsInteractions'],'id');return _0x4d0551['removeSmsInteractions'](_0x4ea846)[_0xc12c('0x15')](function(){for(var _0xa2d512=0x0;_0xa2d512<_0x4ea846['length'];_0xa2d512+=0x1){_0x38734d[_0xc12c('0x47')](_0xc12c('0x48'),{'SmsInteractionId':Number(_0x4ea846[_0xa2d512]),'UserId':Number(_0x4d0551['id'])});}});}})[_0xc12c('0x15')](function(){if(_0x1e6edf===_0xc12c('0x44')){var _0x37fa2e=_[_0xc12c('0x16')](_0x4d0551['OpenchannelInteractions'],'id');return _0x4d0551[_0xc12c('0x49')](_0x37fa2e)[_0xc12c('0x15')](function(){for(var _0xfd87a5=0x0;_0xfd87a5<_0x37fa2e[_0xc12c('0x1b')];_0xfd87a5+=0x1){_0x38734d['emit'](_0xc12c('0x4a'),{'OpenchannelInteractionId':Number(_0x37fa2e[_0xfd87a5]),'UserId':Number(_0x4d0551['id'])});}});}})[_0xc12c('0x4b')](function(_0x151d33){_0x48a8c0[_0xc12c('0x4c')](_0x151d33);});}}function onDisconnect(_0x424266,_0x3e2b50){joinOrLeave(_0x424266,'leave',_0x3e2b50);}function onConnect(_0x4048b4){joinOrLeave(_0x4048b4,_0xc12c('0x4d'));}exports[_0xc12c('0x4e')]=function(_0x5829e7){_0x5829e7['on'](_0xc12c('0x4f'),function(_0x3ea634){_0x3ea634[_0xc12c('0x50')](0x0);_0x3ea634[_0xc12c('0x51')]=_0x3ea634['request']['connection']['remoteAddress']+':'+_0x3ea634[_0xc12c('0x52')][_0xc12c('0x4f')]['remotePort'];_0x3ea634[_0xc12c('0x53')]=new Date();_0x3ea634[_0xc12c('0x4c')]=function(_0x244d51){console[_0xc12c('0x4c')](_0xc12c('0x54')+_0x3ea634[_0xc12c('0x55')][_0xc12c('0x1')]+'['+_0x3ea634[_0xc12c('0x51')]+']',_0x244d51);};_0x3ea634['on'](_0xc12c('0x56'),function(){onDisconnect(_0x3ea634,_0x5829e7);_0x3ea634[_0xc12c('0x4c')]('DISCONNECTED');});onConnect(_0x3ea634);_0x3ea634['log'](_0xc12c('0x57'));});}; \ No newline at end of file +var _0xc2c9=['ChatQueue','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','mail','openchannel','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','log','join','setMaxListeners','remoteAddress','request','connection','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','telephone','agent','type','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','role','Campaign','where','ivr','then','format','%s:queue:%s','Agents','length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','user:%s','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','Trunk','user','voice:inbound'];(function(_0x318284,_0x3b1aec){var _0x2aba1c=function(_0x341faa){while(--_0x341faa){_0x318284['push'](_0x318284['shift']());}};_0x2aba1c(++_0x3b1aec);}(_0xc2c9,0x87));var _0x9c2c=function(_0x39cb2f,_0x408bda){_0x39cb2f=_0x39cb2f-0x0;var _0x1add07=_0xc2c9[_0x39cb2f];return _0x1add07;};'use strict';var _=require(_0x9c2c('0x0'));var util=require(_0x9c2c('0x1'));var BPromise=require(_0x9c2c('0x2'));var db=require(_0x9c2c('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x9c2c('0x4')],'include':[{'as':'Agents','model':db[_0x9c2c('0x5')],'attributes':['id',_0x9c2c('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9c2c('0x4')],'where':{'role':_0x9c2c('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x9c2c('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9c2c('0x4'),_0x9c2c('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x46f0ec,_0x17aaff,_0x44558e){return db[_0x9c2c('0x9')][_0x9c2c('0xa')]({'where':{'name':_0x46f0ec,'userProfileId':_0x17aaff},'raw':!![]})['then'](function(_0x3308c7){if(_0x3308c7){if(_0x3308c7[_0x9c2c('0xb')]){switch(_0x46f0ec){case _0x9c2c('0xc'):case _0x9c2c('0xd'):case _0x9c2c('0xe'):case'SmsQueues':case _0x9c2c('0xf'):case _0x9c2c('0x10'):return db[_0x44558e][_0x9c2c('0x11')](queryQueues);case _0x9c2c('0x12'):return db[_0x44558e][_0x9c2c('0x11')](queryTelephones);case _0x9c2c('0x13'):return db[_0x44558e][_0x9c2c('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x44558e]['findAll'](queryCampaigns);}}else{return db[_0x9c2c('0x14')][_0x9c2c('0x11')]({'attributes':[_0x9c2c('0x15')],'where':{'sectionId':_0x3308c7['id']},'raw':!![]})['then'](function(_0x5793fa){if(_0x5793fa){var _0x30999a={'where':{'id':_[_0x9c2c('0x16')](_0x5793fa,_0x9c2c('0x15'))},'raw':!![]};switch(_0x44558e){case _0x9c2c('0x5'):_0x30999a['where'][_0x9c2c('0x17')]=_0x9c2c('0x6');break;case _0x9c2c('0x18'):_0x30999a[_0x9c2c('0x19')][_0x9c2c('0x8')]=_0x9c2c('0x1a');break;}return db[_0x44558e][_0x9c2c('0x11')](_0x30999a);}else{return[];}});}}else{return[];}})[_0x9c2c('0x1b')](function(_0x1c9c5e){return _0x1c9c5e;});}function joinOrLeaveQueues(_0x2e8a65,_0x2d1fd2,_0x31215f,_0x5ebac3){_0x2e8a65[_0x2d1fd2](util[_0x9c2c('0x1c')](_0x9c2c('0x1d'),_0x31215f,_0x5ebac3[_0x9c2c('0x4')]));if(_0x5ebac3[_0x9c2c('0x1e')]){for(var _0x77d23e=0x0;_0x77d23e<_0x5ebac3[_0x9c2c('0x1e')][_0x9c2c('0x1f')];_0x77d23e+=0x1){_0x2e8a65[_0x2d1fd2](util[_0x9c2c('0x1c')]('user:%s',_0x5ebac3['Agents'][_0x77d23e][_0x9c2c('0x4')]));}}}function joinOrLeave(_0x25556c,_0x11fbb8,_0x1217fd){var _0x1620be;if(_0x25556c[_0x9c2c('0x20')][_0x9c2c('0x21')]['id']){db[_0x9c2c('0x5')]['find']({'attributes':['id',_0x9c2c('0x4'),_0x9c2c('0x17'),_0x9c2c('0x22')],'where':{'id':_0x25556c[_0x9c2c('0x20')][_0x9c2c('0x21')]['id']},'include':[{'model':db[_0x9c2c('0x23')],'as':_0x9c2c('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x9c2c('0x25')],'as':_0x9c2c('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9c2c('0x27')],'as':_0x9c2c('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x9c2c('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x9c2c('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x9c2c('0x1b')](function(_0x23b5a3){if(_0x23b5a3){_0x1620be=_0x23b5a3;_0x25556c[_0x11fbb8](util[_0x9c2c('0x1c')](_0x9c2c('0x2b'),_0x23b5a3[_0x9c2c('0x4')]));var _0xaf2780=[];switch(_0x23b5a3[_0x9c2c('0x17')]){case'admin':_0x25556c[_0x11fbb8]('voice:inbound');_0x25556c[_0x11fbb8](_0x9c2c('0x2c'));if(queryQueues[_0x9c2c('0x2d')](_0x9c2c('0x2e'))){delete queryQueues[_0x9c2c('0x2e')];}_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x30')][_0x9c2c('0x11')](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x31')][_0x9c2c('0x11')](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x32')][_0x9c2c('0x11')](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x33')][_0x9c2c('0x11')](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db['OpenchannelQueue'][_0x9c2c('0x11')](queryQueues));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x5')][_0x9c2c('0x11')](queryTelephones));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x34')][_0x9c2c('0x11')](queryTrunks));_0xaf2780['push'](db[_0x9c2c('0x18')][_0x9c2c('0x11')](queryCampaigns));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x5')][_0x9c2c('0x11')](queryAgents));break;case _0x9c2c('0x35'):_0x25556c[_0x11fbb8](_0x9c2c('0x36'));_0x25556c[_0x11fbb8](_0x9c2c('0x2c'));_0xaf2780['push'](getAssociatedResources(_0x9c2c('0xc'),_0x23b5a3[_0x9c2c('0x22')],'VoiceQueue'));_0xaf2780[_0x9c2c('0x2f')](getAssociatedResources(_0x9c2c('0xd'),_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x37')));_0xaf2780['push'](getAssociatedResources(_0x9c2c('0xe'),_0x23b5a3['userProfileId'],_0x9c2c('0x31')));_0xaf2780[_0x9c2c('0x2f')](getAssociatedResources('SmsQueues',_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x32')));_0xaf2780['push'](getAssociatedResources('MailQueues',_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x33')));_0xaf2780['push'](getAssociatedResources(_0x9c2c('0x10'),_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x38')));_0xaf2780[_0x9c2c('0x2f')](getAssociatedResources('Telephones',_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x5')));_0xaf2780[_0x9c2c('0x2f')](getAssociatedResources(_0x9c2c('0x13'),_0x23b5a3[_0x9c2c('0x22')],_0x9c2c('0x34')));_0xaf2780[_0x9c2c('0x2f')](getAssociatedResources(_0x9c2c('0x39'),_0x23b5a3[_0x9c2c('0x22')],'Campaign'));_0xaf2780[_0x9c2c('0x2f')](db[_0x9c2c('0x5')]['findAll'](queryAgents));break;case'agent':_0x25556c[_0x11fbb8](_0x9c2c('0x36'));_0x25556c[_0x11fbb8](_0x9c2c('0x2c'));_0xaf2780[_0x9c2c('0x2f')](_0x23b5a3[_0x9c2c('0x3a')]({'attributes':['id',_0x9c2c('0x4')]}));_0xaf2780[_0x9c2c('0x2f')](_0x23b5a3[_0x9c2c('0x3b')]({'attributes':['id',_0x9c2c('0x4')]}));_0xaf2780[_0x9c2c('0x2f')](_0x23b5a3[_0x9c2c('0x3c')]({'attributes':['id',_0x9c2c('0x4')]}));_0xaf2780[_0x9c2c('0x2f')](_0x23b5a3[_0x9c2c('0x3d')]({'attributes':['id',_0x9c2c('0x4')]}));_0xaf2780[_0x9c2c('0x2f')](_0x23b5a3[_0x9c2c('0x3e')]({'attributes':['id',_0x9c2c('0x4')]}));_0xaf2780['push'](_0x23b5a3[_0x9c2c('0x3f')]({'attributes':['id','name']}));break;}return BPromise[_0x9c2c('0x40')](_0xaf2780);}})[_0x9c2c('0x1b')](function(_0x2028ea){if(_0x2028ea&&_0x2028ea[_0x9c2c('0x1f')]){for(var _0x59016b=0x0;_0x59016b<_0x2028ea[_0x9c2c('0x1f')];_0x59016b+=0x1){for(var _0x328732=0x0;_0x328732<_0x2028ea[_0x59016b][_0x9c2c('0x1f')];_0x328732+=0x1){switch(_0x59016b){case 0x0:joinOrLeaveQueues(_0x25556c,_0x11fbb8,_0x9c2c('0x41'),_0x2028ea[_0x59016b][_0x328732]);break;case 0x1:joinOrLeaveQueues(_0x25556c,_0x11fbb8,_0x9c2c('0x42'),_0x2028ea[_0x59016b][_0x328732]);break;case 0x2:joinOrLeaveQueues(_0x25556c,_0x11fbb8,_0x9c2c('0x43'),_0x2028ea[_0x59016b][_0x328732]);break;case 0x3:joinOrLeaveQueues(_0x25556c,_0x11fbb8,'sms',_0x2028ea[_0x59016b][_0x328732]);break;case 0x4:joinOrLeaveQueues(_0x25556c,_0x11fbb8,_0x9c2c('0x44'),_0x2028ea[_0x59016b][_0x328732]);break;case 0x5:joinOrLeaveQueues(_0x25556c,_0x11fbb8,_0x9c2c('0x45'),_0x2028ea[_0x59016b][_0x328732]);break;case 0x6:_0x25556c[_0x11fbb8](util[_0x9c2c('0x1c')]('telephone:%s',_0x2028ea[_0x59016b][_0x328732][_0x9c2c('0x4')]));break;case 0x7:_0x25556c[_0x11fbb8](util[_0x9c2c('0x1c')]('trunk:%s',_0x2028ea[_0x59016b][_0x328732]['name']));break;case 0x8:_0x25556c[_0x11fbb8](util[_0x9c2c('0x1c')](_0x9c2c('0x46'),_0x2028ea[_0x59016b][_0x328732][_0x9c2c('0x8')],_0x2028ea[_0x59016b][_0x328732]['name']));break;case 0x9:_0x25556c[_0x11fbb8](util[_0x9c2c('0x1c')](_0x9c2c('0x2b'),_0x2028ea[_0x59016b][_0x328732][_0x9c2c('0x4')]));break;}}}}})['then'](function(){if(_0x11fbb8===_0x9c2c('0x47')){var _0x3c4ad1=_['map'](_0x1620be['ChatInteractions'],'id');return _0x1620be[_0x9c2c('0x48')](_0x3c4ad1)[_0x9c2c('0x1b')](function(){for(var _0x38a537=0x0;_0x38a537<_0x3c4ad1[_0x9c2c('0x1f')];_0x38a537+=0x1){_0x1217fd[_0x9c2c('0x49')](_0x9c2c('0x4a'),{'ChatInteractionId':Number(_0x3c4ad1[_0x38a537]),'UserId':Number(_0x1620be['id'])});}});}})['then'](function(){if(_0x11fbb8===_0x9c2c('0x47')){var _0x5dc028=_['map'](_0x1620be['MailInteractions'],'id');return _0x1620be[_0x9c2c('0x4b')](_0x5dc028)['then'](function(){for(var _0x389bd6=0x0;_0x389bd6<_0x5dc028[_0x9c2c('0x1f')];_0x389bd6+=0x1){_0x1217fd['emit'](_0x9c2c('0x4c'),{'MailInteractionId':Number(_0x5dc028[_0x389bd6]),'UserId':Number(_0x1620be['id'])});}});}})[_0x9c2c('0x1b')](function(){if(_0x11fbb8===_0x9c2c('0x47')){var _0x3f77f6=_[_0x9c2c('0x16')](_0x1620be[_0x9c2c('0x28')],'id');return _0x1620be[_0x9c2c('0x4d')](_0x3f77f6)[_0x9c2c('0x1b')](function(){for(var _0xb59998=0x0;_0xb59998<_0x3f77f6[_0x9c2c('0x1f')];_0xb59998+=0x1){_0x1217fd['emit'](_0x9c2c('0x4e'),{'FaxInteractionId':Number(_0x3f77f6[_0xb59998]),'UserId':Number(_0x1620be['id'])});}});}})[_0x9c2c('0x1b')](function(){if(_0x11fbb8===_0x9c2c('0x47')){var _0x435f26=_[_0x9c2c('0x16')](_0x1620be[_0x9c2c('0x29')],'id');return _0x1620be[_0x9c2c('0x4f')](_0x435f26)[_0x9c2c('0x1b')](function(){for(var _0x19504d=0x0;_0x19504d<_0x435f26[_0x9c2c('0x1f')];_0x19504d+=0x1){_0x1217fd[_0x9c2c('0x49')](_0x9c2c('0x50'),{'SmsInteractionId':Number(_0x435f26[_0x19504d]),'UserId':Number(_0x1620be['id'])});}});}})[_0x9c2c('0x1b')](function(){if(_0x11fbb8===_0x9c2c('0x47')){var _0x3ade88=_['map'](_0x1620be['OpenchannelInteractions'],'id');return _0x1620be['removeOpenchannelInteractions'](_0x3ade88)[_0x9c2c('0x1b')](function(){for(var _0x4b4ac0=0x0;_0x4b4ac0<_0x3ade88[_0x9c2c('0x1f')];_0x4b4ac0+=0x1){_0x1217fd[_0x9c2c('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3ade88[_0x4b4ac0]),'UserId':Number(_0x1620be['id'])});}});}})['catch'](function(_0x2efdc4){_0x25556c[_0x9c2c('0x51')](_0x2efdc4);});}}function onDisconnect(_0x3f8c37,_0x12cc81){joinOrLeave(_0x3f8c37,_0x9c2c('0x47'),_0x12cc81);}function onConnect(_0x287e3e){joinOrLeave(_0x287e3e,_0x9c2c('0x52'));}exports['default']=function(_0x13548a){_0x13548a['on']('connection',function(_0xb5bdcb){_0xb5bdcb[_0x9c2c('0x53')](0x0);_0xb5bdcb['address']=_0xb5bdcb['request']['connection'][_0x9c2c('0x54')]+':'+_0xb5bdcb[_0x9c2c('0x55')][_0x9c2c('0x56')][_0x9c2c('0x57')];_0xb5bdcb[_0x9c2c('0x58')]=new Date();_0xb5bdcb[_0x9c2c('0x51')]=function(_0x17dd8c){console['log'](_0x9c2c('0x59')+_0xb5bdcb[_0x9c2c('0x5a')][_0x9c2c('0x4')]+'['+_0xb5bdcb[_0x9c2c('0x5b')]+']',_0x17dd8c);};_0xb5bdcb['on'](_0x9c2c('0x5c'),function(){onDisconnect(_0xb5bdcb,_0x13548a);_0xb5bdcb[_0x9c2c('0x51')](_0x9c2c('0x5d'));});onConnect(_0xb5bdcb);_0xb5bdcb['log'](_0x9c2c('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ad88fa4..5993c06 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 _0xbefa=['../../mysqldb','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','newinteraction','Sms','SmsInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','event','direction','UserId','name','interface','SIP/%s','incomingmessage','changed','closed','User','format','length','model','callback','toLowerCase','condition','util'];(function(_0x3bbbe5,_0x17c12b){var _0x545651=function(_0x36ad12){while(--_0x36ad12){_0x3bbbe5['push'](_0x3bbbe5['shift']());}};_0x545651(++_0x17c12b);}(_0xbefa,0x12b));var _0xabef=function(_0x122698,_0x1a0dae){_0x122698=_0x122698-0x0;var _0x5e0534=_0xbefa[_0x122698];return _0x5e0534;};'use strict';var util=require(_0xabef('0x0'));var db=require(_0xabef('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xabef('0x2'))(_0xabef('0x3'));var client=jayson[_0xabef('0x4')][_0xabef('0x5')]({'port':0x232a});var triggers=[{'channel':_0xabef('0x6'),'model':_0xabef('0x7'),'event':_0xabef('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xabef('0x6'),'model':'ChatInteraction','event':_0xabef('0x9'),'condition':_0xabef('0xa'),'callback':afterUpdate},{'channel':_0xabef('0x6'),'model':_0xabef('0xb'),'event':_0xabef('0x8'),'condition':_0xabef('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xabef('0x8'),'condition':_0xabef('0xd'),'callback':afterCreate},{'channel':_0xabef('0xe'),'model':_0xabef('0xf'),'event':_0xabef('0x9'),'condition':_0xabef('0xa'),'callback':afterUpdate},{'channel':_0xabef('0xe'),'model':'SmsMessage','event':_0xabef('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xabef('0x10'),'model':'FaxInteraction','event':_0xabef('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0xabef('0x9'),'condition':_0xabef('0xa'),'callback':afterUpdate},{'channel':'Fax','model':_0xabef('0x11'),'event':_0xabef('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xabef('0x12'),'model':_0xabef('0x13'),'event':_0xabef('0x8'),'condition':_0xabef('0xd'),'callback':afterCreate},{'channel':_0xabef('0x12'),'model':_0xabef('0x13'),'event':_0xabef('0x9'),'condition':_0xabef('0xa'),'callback':afterUpdate},{'channel':'Mail','model':_0xabef('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xabef('0x15'),'event':_0xabef('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xabef('0x16'),'model':_0xabef('0x15'),'event':_0xabef('0x9'),'condition':_0xabef('0xa'),'callback':afterUpdate},{'channel':_0xabef('0x16'),'model':_0xabef('0x17'),'event':_0xabef('0x8'),'condition':_0xabef('0xc'),'callback':afterCreateMessage}];function request(_0x2e0c9c){return client[_0xabef('0x18')](_0xabef('0x19'),_0x2e0c9c)[_0xabef('0x1a')](function(_0x455e55){logger[_0xabef('0x1b')]('Trigger,\x20%s',_0xabef('0x19'),_0x455e55);if(_0x455e55[_0xabef('0x1c')]){if(_0x455e55[_0xabef('0x1c')][_0xabef('0x1d')]===0x1f4){logger[_0xabef('0x1c')](_0xabef('0x1e'),'EventManager',_0x455e55[_0xabef('0x1c')]);}}})[_0xabef('0x1f')](function(_0x5f5493){logger[_0xabef('0x1c')](_0xabef('0x1e'),'EventManager',_0x5f5493);});}function afterCreateMessage(_0x22b053,_0x135ce3){return function(_0x38e638,_0xf2648e){_0x38e638=_0x38e638[_0xabef('0x20')]({'plain':!![]});_0x38e638[_0xabef('0x21')]=_0x22b053;_0x38e638[_0xabef('0x22')]=_0x38e638[_0xabef('0x23')];if(_0x38e638[_0xabef('0x24')]){return db['User']['find']({'where':{'id':_0x38e638[_0xabef('0x24')]},'attributes':['id',_0xabef('0x25')],'raw':!![]})[_0xabef('0x1a')](function(_0x4727c6){_0x38e638[_0xabef('0x26')]=util['format'](_0xabef('0x27'),_0x4727c6['name']);_0x38e638['channel']=_0x22b053;return request({'event':_0xabef('0x28'),'message':_0x38e638});})[_0xabef('0x1f')](function(_0x19c3ea){console['error'](_0x19c3ea);});}else{return request({'event':'outgoingmessage','message':_0x38e638});}};}function afterCreate(_0xfdfe1d,_0x344677){return function(_0x42def1,_0x5d63b2){_0x42def1=_0x42def1[_0xabef('0x20')]({'plain':!![]});_0x42def1['channel']=_0xfdfe1d;_0x42def1[_0xabef('0x22')]='opened';return request({'event':_0x344677,'message':_0x42def1});};}function afterUpdate(_0x4ae7ff,_0x473a7a){return function(_0x4da2f6,_0x855db6){if(_0x4da2f6[_0xabef('0x29')](_0xabef('0x2a'))&&_0x4da2f6[_0xabef('0x2a')]){_0x4da2f6=_0x4da2f6[_0xabef('0x20')]({'plain':!![]});_0x4da2f6[_0xabef('0x21')]=_0x4ae7ff;_0x4da2f6[_0xabef('0x22')]='closed';if(_0x4da2f6['UserId']){return db[_0xabef('0x2b')]['find']({'where':{'id':_0x4da2f6[_0xabef('0x24')]},'attributes':['id',_0xabef('0x25')],'raw':!![]})[_0xabef('0x1a')](function(_0x3a832d){_0x4da2f6[_0xabef('0x26')]=util[_0xabef('0x2c')](_0xabef('0x27'),_0x3a832d[_0xabef('0x25')]);return request({'event':_0x473a7a,'message':_0x4da2f6});})['catch'](function(_0x5de137){console['error'](_0x5de137);});}else{return request({'event':_0x473a7a,'message':_0x4da2f6});}}};}exports['default']=function(){for(var _0x4d4b7b=0x0;_0x4d4b7b0x3){var _0x5e8038=/\((.+)\)/;var _0x5eeb7b=_0x356b40['rx']['match'](_0x5e8038);if(_0x5eeb7b){_0x58b23a=_0x5eeb7b[0x1];}else{_0x58b23a=null;}}else{_0x58b23a=null;}_0x356b40['cb'](null,{'code':_0x18bffd,'result':_0x557cc2,'extra':_0x58b23a});}});_0x3662ca['on'](_0xcd3f('0x1a'),function(_0x126948){_0xe2d0fb[_0xcd3f('0xd')]('error',new AGIError(_0xcd3f('0x1b'),_0x126948[_0xcd3f('0x1c')]));});_0x3662ca['on']('close',function(){_0xe2d0fb['emit'](_0xcd3f('0x1d'),new AGIError(_0xcd3f('0x1e')));});_0x3662ca['on'](_0xcd3f('0x1f'),function(){_0xe2d0fb['emit'](_0xcd3f('0x1f'),new AGIError(_0xcd3f('0x20')));_0x3662ca[_0xcd3f('0x21')]();});_0x3662ca[_0xcd3f('0x22')](_0x1885a5);this[_0xcd3f('0x23')]=function(_0x3a6442,_0x2ca6ac){var _0x3a6442=_0x3a6442||'',_0x2ca6ac=typeof _0x2ca6ac==_0xcd3f('0x12')?_0x2ca6ac:new Function();_0x356b40={'tx':_0x3a6442,'rx':'','cb':_0x2ca6ac};_0x3662ca[_0xcd3f('0x24')](_0x3a6442+'\x0a');},this[_0xcd3f('0x1d')]=function(){_0x3662ca[_0xcd3f('0x21')]();};}util[_0xcd3f('0x25')](AGIChannel,EventEmitter);AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x27')]=function(_0x2be667){return this['command'][_0xcd3f('0x28')](this,_0x2be667);};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x29')]=function(){return this[_0xcd3f('0x27')](_0xcd3f('0x2a'));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x2b')]=function(_0x2b7b24,_0x39f93c,_0x46222f){_0x2b7b24=_0x2b7b24===undefined?_0xcd3f('0x2c'):_0x2b7b24;_0x39f93c=_0x39f93c===undefined?'5':_0x39f93c;_0x46222f=_0x46222f===undefined?'1':_0x46222f;return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x2e'),_0x2b7b24,_0x39f93c*0x3e8,_0x46222f));};AGIChannel['prototype'][_0xcd3f('0x2f')]=function(_0xf8a9c7){_0xf8a9c7=_0xf8a9c7||_0xcd3f('0x30');return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x31'),_0xf8a9c7));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x32')]=function(_0x2ffcc1,_0x4937e6){if(_[_0xcd3f('0x33')](_0x4937e6)){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x34'),_0x2ffcc1,_0x4937e6[_0xcd3f('0x35')](',')));}return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x34'),_0x2ffcc1,_0x4937e6));};AGIChannel['prototype']['setContext']=function(_0x27968d){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x36'),_0x27968d));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x37')]=function(_0x3b0e4f){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x38'),_0x3b0e4f));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x39')]=function(_0x1d2195){return this[_0xcd3f('0x27')](util['format'](_0xcd3f('0x3a'),_0x1d2195));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0xc')]=function(){return this[_0xcd3f('0x27')](_0xcd3f('0x3b'));};AGIChannel['prototype'][_0xcd3f('0x3c')]=function(_0x7f54a0,_0x2b4bc9){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x7f54a0,_0x2b4bc9?_0x2b4bc9[_0xcd3f('0x3d')]()[_0xcd3f('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xcd3f('0x3e')]=function(_0x11ea08,_0x1266c7){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x3f'),_0x11ea08,_0x1266c7));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x40')]=function(_0x53449f,_0x5c2327){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')]('SAY\x20DIGITS\x20%s\x20%s',_0x53449f,_0x5c2327));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x41')]=function(_0x51fea0,_0x380d38){return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x42'),_0x51fea0,_0x380d38));};AGIChannel[_0xcd3f('0x26')]['continueAt']=function(_0x2f8fdc,_0x59bf44,_0xd2524a){_0x59bf44=_0x59bf44||this[_0xcd3f('0x43')];_0xd2524a=_0xd2524a||0x1;this['setContext'](_0x2f8fdc);this[_0xcd3f('0x37')](_0x59bf44);this[_0xcd3f('0x39')](_0xd2524a);return this[_0xcd3f('0x2f')](util['format'](_0xcd3f('0x44'),_0x2f8fdc,_0x59bf44,_0xd2524a));};AGIChannel[_0xcd3f('0x26')]['getVariable']=function(_0x24d4d1){return this['sendRequest'](util[_0xcd3f('0x2d')](_0xcd3f('0x45'),_0x24d4d1));};AGIChannel[_0xcd3f('0x26')]['recordFile']=function(_0xbe7a60,_0x4fa3b7,_0x3fa3c4,_0x594488,_0x18b357,_0x51b66c){_0x4fa3b7=_0x4fa3b7||_0xcd3f('0x46');_0x3fa3c4=_0x3fa3c4||'';_0x594488=_0x594488===undefined?-0x1:_0x594488==='-1'?-0x1:_0x594488*0x3e8;_0x18b357=_0x18b357===undefined?'':'s='+_0x18b357;_0x51b66c=_0x51b66c?_0xcd3f('0x47'):'';return this['sendRequest'](util[_0xcd3f('0x2d')](_0xcd3f('0x48'),_0xbe7a60,_0x4fa3b7,_0x3fa3c4,_0x594488,_0x51b66c,_0x18b357));};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x49')]=function(_0x51678a,_0xfe5424){_0xfe5424=_0xfe5424||'';return this[_0xcd3f('0x27')](util[_0xcd3f('0x2d')](_0xcd3f('0x4a'),_0x51678a,_0xfe5424));};AGIChannel['prototype']['agi']=function(_0x6c6979){return this[_0xcd3f('0x32')]('AGI',_0x6c6979);};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x4b')]=function(_0x122ae9){return this[_0xcd3f('0x32')]('WAIT',_0x122ae9);};AGIChannel[_0xcd3f('0x26')][_0xcd3f('0x1a')]=function(_0x5a0f15,_0x5f4c37){this[_0xcd3f('0x2f')](util[_0xcd3f('0x2d')](_0xcd3f('0x4c'),_0x5a0f15['id'],_0x5a0f15[_0xcd3f('0x4d')],_0x5f4c37));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xcd3f('0x4e')]=AGIChannel; \ No newline at end of file +var _0xd785=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','events','./reply','call','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','replace','indexOf','substr','startsWith','length','match','error','code','close','timeout','destroy','pipe','command','write','inherits','prototype','answer','sendRequest','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd785,0x11d));var _0x5d78=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xd785[_0x117f4c];return _0x2b24e9;};'use strict';var util=require(_0x5d78('0x0'));var _=require('lodash');var EventEmitter=require(_0x5d78('0x1'))['EventEmitter'];var AGIReply=require(_0x5d78('0x2'));var AGIError=require('./error');function AGIChannel(_0x5af3ab){var _0x42ebed=this,_0x33541f=new AGIReply(),_0x1d9d39=![],_0x5877bf={};EventEmitter[_0x5d78('0x3')](_0x42ebed);_0x5af3ab['setEncoding']('utf8');_0x5af3ab[_0x5d78('0x4')](0x8*0x3c*0x3c*0x3e8);_0x33541f['setEncoding'](_0x5d78('0x5'));_0x33541f['on'](_0x5d78('0x6'),function(_0x180838){for(var _0x4e0e02 in _0x180838){_0x42ebed[_0x4e0e02]=_0x180838[_0x4e0e02];}_0x42ebed[_0x5d78('0x7')](_0x5d78('0x8'));});_0x33541f['on'](_0x5d78('0x9'),function(_0x56b9f4){if(_0x56b9f4[_0x5d78('0xa')]()==_0x5d78('0xb')){_0x42ebed[_0x5d78('0x7')](_0x5d78('0xb'));return;}if(_0x56b9f4[_0x5d78('0xc')](0x0,0xb)=='520-Invalid'){_0x1d9d39=!![];}if(_0x1d9d39){_0x5877bf['rx']+=_0x56b9f4+'\x0a';if(_0x56b9f4['search'](_0x5d78('0xd'))!=-0x1){_0x1d9d39=![];}}else{_0x5877bf['rx']=_0x56b9f4;}if(_0x1d9d39){return;}if(typeof _0x5877bf['cb']==_0x5d78('0xe')){var _0x17f310=_0x5877bf['rx']['substring'](0x0,0x3),_0x213c8e=null,_0x4ddfa9=null;_0x17f310=parseInt(_0x17f310);if(isNaN(_0x17f310)){_0x5877bf['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x17f310!=0xc8){_0x5877bf['cb'](null,{'code':_0x17f310,'result':-0x1,'extra':'KO'});return;}_0x213c8e=_0x5877bf['rx'][_0x5d78('0xc')](0x4)[_0x5d78('0xf')]('result=','');if(_0x213c8e[_0x5d78('0x10')]('\x20')!=-0x1){_0x213c8e=_0x213c8e[_0x5d78('0x11')](0x0,_0x213c8e['indexOf']('\x20'));}if(_[_0x5d78('0x12')](_0x213c8e,'-1')){_0x213c8e=parseInt(_0x213c8e);}_0x4ddfa9=_0x5877bf['rx']['split']('\x20');if(_0x4ddfa9['length']==0x3){_0x4ddfa9=_0x4ddfa9[0x2][_0x5d78('0xc')](0x1,_0x4ddfa9[0x2][_0x5d78('0x13')]-0x1);}else if(_0x4ddfa9['length']>0x3){var _0x283035=/\((.+)\)/;var _0x31fd8f=_0x5877bf['rx'][_0x5d78('0x14')](_0x283035);if(_0x31fd8f){_0x4ddfa9=_0x31fd8f[0x1];}else{_0x4ddfa9=null;}}else{_0x4ddfa9=null;}_0x5877bf['cb'](null,{'code':_0x17f310,'result':_0x213c8e,'extra':_0x4ddfa9});}});_0x5af3ab['on'](_0x5d78('0x15'),function(_0x109dd4){_0x42ebed['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x109dd4[_0x5d78('0x16')]));});_0x5af3ab['on'](_0x5d78('0x17'),function(){_0x42ebed[_0x5d78('0x7')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x5af3ab['on'](_0x5d78('0x18'),function(){_0x42ebed[_0x5d78('0x7')](_0x5d78('0x18'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5af3ab[_0x5d78('0x19')]();});_0x5af3ab[_0x5d78('0x1a')](_0x33541f);this[_0x5d78('0x1b')]=function(_0x100ce8,_0x462166){var _0x100ce8=_0x100ce8||'',_0x462166=typeof _0x462166==_0x5d78('0xe')?_0x462166:new Function();_0x5877bf={'tx':_0x100ce8,'rx':'','cb':_0x462166};_0x5af3ab[_0x5d78('0x1c')](_0x100ce8+'\x0a');},this['close']=function(){_0x5af3ab[_0x5d78('0x19')]();};}util[_0x5d78('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0x5d78('0x1e')]['sendRequest']=function(_0x2da91c){return this[_0x5d78('0x1b')]['sync'](this,_0x2da91c);};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x1f')]=function(){return this[_0x5d78('0x20')](_0x5d78('0x21'));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x22')]=function(_0x5a4562,_0x57b3ce,_0x105769){_0x5a4562=_0x5a4562===undefined?_0x5d78('0x23'):_0x5a4562;_0x57b3ce=_0x57b3ce===undefined?'5':_0x57b3ce;_0x105769=_0x105769===undefined?'1':_0x105769;return this[_0x5d78('0x20')](util[_0x5d78('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5a4562,_0x57b3ce*0x3e8,_0x105769));};AGIChannel['prototype']['noop']=function(_0x132480){_0x132480=_0x132480||_0x5d78('0x25');return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x26'),_0x132480));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x27')]=function(_0x38f851,_0x221d28){if(_['isArray'](_0x221d28)){return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x28'),_0x38f851,_0x221d28[_0x5d78('0x29')](',')));}return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x28'),_0x38f851,_0x221d28));};AGIChannel['prototype'][_0x5d78('0x2a')]=function(_0x39aa4c){return this[_0x5d78('0x20')](util[_0x5d78('0x24')]('SET\x20CONTEXT\x20%s',_0x39aa4c));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x2b')]=function(_0x425d72){return this['sendRequest'](util[_0x5d78('0x24')](_0x5d78('0x2c'),_0x425d72));};AGIChannel[_0x5d78('0x1e')]['setPriority']=function(_0x217f0f){return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x2d'),_0x217f0f));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0xb')]=function(){return this['sendRequest'](_0x5d78('0x2e'));};AGIChannel[_0x5d78('0x1e')]['setVariable']=function(_0x49704c,_0x3bc5b1){return this[_0x5d78('0x20')](util['format'](_0x5d78('0x2f'),_0x49704c,_0x3bc5b1?_0x3bc5b1[_0x5d78('0x30')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x31')]=function(_0x8c1bef,_0x361b01){return this['sendRequest'](util['format'](_0x5d78('0x32'),_0x8c1bef,_0x361b01));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x33')]=function(_0x5833a1,_0x49f406){return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x34'),_0x5833a1,_0x49f406));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x35')]=function(_0x3cc7d0,_0xe52c31){return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x36'),_0x3cc7d0,_0xe52c31));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x37')]=function(_0x5541a9,_0x4cfe06,_0x11b267){_0x4cfe06=_0x4cfe06||this[_0x5d78('0x38')];_0x11b267=_0x11b267||0x1;this[_0x5d78('0x2a')](_0x5541a9);this[_0x5d78('0x2b')](_0x4cfe06);this[_0x5d78('0x39')](_0x11b267);return this[_0x5d78('0x3a')](util[_0x5d78('0x24')]('GOTO\x20%s\x20%s\x20%s',_0x5541a9,_0x4cfe06,_0x11b267));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x3b')]=function(_0x35b2c6){return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x3c'),_0x35b2c6));};AGIChannel['prototype']['recordFile']=function(_0x2135b8,_0x379865,_0x19a70e,_0x342324,_0x5be97c,_0x251116){_0x379865=_0x379865||_0x5d78('0x3d');_0x19a70e=_0x19a70e||'';_0x342324=_0x342324===undefined?-0x1:_0x342324==='-1'?-0x1:_0x342324*0x3e8;_0x5be97c=_0x5be97c===undefined?'':'s='+_0x5be97c;_0x251116=_0x251116?_0x5d78('0x3e'):'';return this['sendRequest'](util['format'](_0x5d78('0x3f'),_0x2135b8,_0x379865,_0x19a70e,_0x342324,_0x251116,_0x5be97c));};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x40')]=function(_0x562e76,_0x360d83){_0x360d83=_0x360d83||'';return this[_0x5d78('0x20')](util[_0x5d78('0x24')](_0x5d78('0x41'),_0x562e76,_0x360d83));};AGIChannel[_0x5d78('0x1e')]['agi']=function(_0x34d58d){return this[_0x5d78('0x27')](_0x5d78('0x42'),_0x34d58d);};AGIChannel['prototype'][_0x5d78('0x43')]=function(_0x2a2026){return this[_0x5d78('0x27')](_0x5d78('0x44'),_0x2a2026);};AGIChannel[_0x5d78('0x1e')][_0x5d78('0x15')]=function(_0xbd9b24,_0x5d680b){this[_0x5d78('0x3a')](util[_0x5d78('0x24')](_0x5d78('0x45'),_0xbd9b24['id'],_0xbd9b24['label'],_0x5d680b));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index a09ce75..3557f80 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 _0x7d9b=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\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','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d9b,0x1cc));var _0xb7d9=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x7d9b[_0xa041de];return _0x1d654c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xb7d9('0x0'),'E_AGI_ARGUMENT_PORT':_0xb7d9('0x1'),'E_AGI_SERVER_ERROR':_0xb7d9('0x2'),'E_AGI_SERVER_CLOSE':_0xb7d9('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xb7d9('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xb7d9('0x5'),'E_AGI_SOCKET_ERROR':_0xb7d9('0x6'),'E_AGI_SOCKET_CLOSE':_0xb7d9('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xb7d9('0x8'),'E_AGI_COMMAND_EMPTY':_0xb7d9('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb7d9('0xa'),'E_AGI_IVR_ENTRY':_0xb7d9('0xb')};function AGIError(_0x11978d){var _0x11978d=_0x11978d||null,_0x4d95f1=_0x4d95f1||[],_0xed7fa5=0x1,_0x3784ba='';if(!error[_0x11978d]){_0x11978d=_0xb7d9('0xc');}_0x4d95f1[_0xb7d9('0xd')](error[_0x11978d]);while(arguments[_0xed7fa5]){_0x4d95f1[_0xb7d9('0xd')](arguments[_0xed7fa5]);_0xed7fa5++;}_0x3784ba=util['format'][_0xb7d9('0xe')](util,_0x4d95f1);this[_0xb7d9('0xf')]=_0x3784ba;this['name']=_0x11978d;}module['exports']=AGIError; \ No newline at end of file +var _0x4218=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x3fe164,_0xcc2525){var _0x245dab=function(_0xcf3cd5){while(--_0xcf3cd5){_0x3fe164['push'](_0x3fe164['shift']());}};_0x245dab(++_0xcc2525);}(_0x4218,0xbe));var _0x8421=function(_0x3b168f,_0x2a9751){_0x3b168f=_0x3b168f-0x0;var _0x328758=_0x4218[_0x3b168f];return _0x328758;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x8421('0x0'),'E_AGI_ARGUMENT_PORT':_0x8421('0x1'),'E_AGI_SERVER_ERROR':_0x8421('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x8421('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x8421('0x4'),'E_AGI_SOCKET_ERROR':_0x8421('0x5'),'E_AGI_SOCKET_CLOSE':_0x8421('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x8421('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8421('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3d4c53){var _0x3d4c53=_0x3d4c53||null,_0x21e0cb=_0x21e0cb||[],_0x1f3b68=0x1,_0x53e638='';if(!error[_0x3d4c53]){_0x3d4c53='E_AGI_UNDEFINED';}_0x21e0cb[_0x8421('0x9')](error[_0x3d4c53]);while(arguments[_0x1f3b68]){_0x21e0cb[_0x8421('0x9')](arguments[_0x1f3b68]);_0x1f3b68++;}_0x53e638=util[_0x8421('0xa')]['apply'](util,_0x21e0cb);this['message']=_0x53e638;this[_0x8421('0xb')]=_0x3d4c53;}module[_0x8421('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 62ed35c..4f04500 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 _0xd523=['split','agicommand','target','default','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition'];(function(_0xf493cb,_0x2a6fd4){var _0x34c038=function(_0x1298c4){while(--_0x1298c4){_0xf493cb['push'](_0xf493cb['shift']());}};_0x34c038(++_0x2a6fd4);}(_0xd523,0x153));var _0x3d52=function(_0x33df50,_0x4a0714){_0x33df50=_0x33df50-0x0;var _0x247123=_0xd523[_0x33df50];return _0x247123;};'use strict';var _=require(_0x3d52('0x0'));var logger=require(_0x3d52('0x1'))(_0x3d52('0x2'));var verticesWithRetry=[_0x3d52('0x3'),'getdigits',_0x3d52('0x4')];var Graph=function(){this[_0x3d52('0x5')]={};this[_0x3d52('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x3d52('0x7')][_0x3d52('0x8')]=function(_0xc72a69){this[_0x3d52('0x5')][_0xc72a69['id']]=_0xc72a69;this['edges'][_0xc72a69['id']]=[];};Graph['prototype'][_0x3d52('0x9')]=function(_0x2f3ebc,_0x232bd4,_0x2e03c0){this[_0x3d52('0x6')][_0x2f3ebc][_0x3d52('0xa')]({'target':_0x232bd4,'condition':_0x2e03c0});this[_0x3d52('0xb')]+=0x1;};Graph[_0x3d52('0x7')][_0x3d52('0xc')]=function(){return _['size'](this[_0x3d52('0x5')]);};Graph[_0x3d52('0x7')][_0x3d52('0xd')]=function(){return this[_0x3d52('0xb')];};Graph[_0x3d52('0x7')]['getVertex']=function(_0x7b286){return this['vertices'][_0x7b286];};Graph['prototype'][_0x3d52('0xe')]=function(_0x42b184,_0x4fcdab){if(!this['vertices'][_0x42b184]){return logger['info'](_0x3d52('0xf'));}var _0x3ddc64=_0x4fcdab(this[_0x3d52('0x5')][_0x42b184]);if(!_0x3ddc64){return logger[_0x3d52('0x10')](_0x3d52('0x11'));}if(this[_0x3d52('0x6')][_0x42b184][_0x3d52('0x12')]===0x0){return logger[_0x3d52('0x10')](_0x3d52('0x13'));}for(var _0x360659=0x0,_0x153c89=[],_0x15cc02=![];_0x360659\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','hasOwnProperty','retry','addVertex','omit','isArray','length','addEdge','target','catch','then','indexOf','agi_','substring','inspect','variables','stringify','close','hangup','sync','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','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','clear','[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','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','continueAt','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash'];(function(_0x3e2b54,_0x1a3da4){var _0x40bca0=function(_0x1f697f){while(--_0x1f697f){_0x3e2b54['push'](_0x3e2b54['shift']());}};_0x40bca0(++_0x1a3da4);}(_0x3435,0xfa));var _0x5343=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x3435[_0x14fad0];return _0x5c665f;};'use strict';var parser=require(_0x5343('0x0'));var _=require(_0x5343('0x1'));var syncho=require(_0x5343('0x2'));var util=require(_0x5343('0x3'));var moment=require(_0x5343('0x4'));var config=require(_0x5343('0x5'));var logger=require('../../config/logger')(_0x5343('0x6'));var utilLicense=require(_0x5343('0x7'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x5343('0x8'));var Vertices=require(_0x5343('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x5343('0x6')],{'ip':_0x5343('0xa'),'port':0x11dd});function connectionHandler(_0x9ea9b6){process[_0x5343('0xb')](function(){syncho(function(){try{setChannelVariables(_0x9ea9b6);agiHandler(_0x9ea9b6);}catch(_0x41673f){logger['error'](_0x41673f[_0x5343('0xc')]);}});});}function listeningHandler(){console['log'](_0x5343('0xd'),config[_0x5343('0x6')][_0x5343('0xe')]);logger[_0x5343('0xf')](util[_0x5343('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x5343('0x6')]['ip'],config[_0x5343('0x6')][_0x5343('0xe')]));}function errorHandler(_0x5f1724){if(_0x5f1724&&_0x5f1724[_0x5343('0x11')]&&_0x5f1724['message']){logger[_0x5343('0x12')](util[_0x5343('0x10')]('[%s]\x20%s',_0x5f1724[_0x5343('0x11')],_0x5f1724['message']));}else{logger[_0x5343('0x12')](util[_0x5343('0x10')](_0x5343('0x13'),_0x5f1724[_0x5343('0xc')]));}}function closeHandler(){logger['info'](util[_0x5343('0x10')](_0x5343('0x14'),this[_0x5343('0x15')],this[_0x5343('0x16')],this[_0x5343('0x17')],this[_0x5343('0x18')],this[_0x5343('0x19')]));try{createSquareReport(this);}catch(_0x4b5852){logger['error'](_0x4b5852[_0x5343('0xc')]);}}function timeoutHandler(){logger[_0x5343('0xf')](util[_0x5343('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x5343('0x15')],this[_0x5343('0x16')],this[_0x5343('0x17')],this[_0x5343('0x18')],this[_0x5343('0x19')]));}function hangupHandler(){logger[_0x5343('0xf')](util[_0x5343('0x10')](_0x5343('0x1a'),this[_0x5343('0x15')],this['calleridname'],this[_0x5343('0x17')],this[_0x5343('0x18')],this[_0x5343('0x19')]));this[_0x5343('0x1b')]=!![];}function getRoot(_0xd95a5b){return parser['toJson'](_0xd95a5b,{'object':!![]})[_0x5343('0x1c')][_0x5343('0x1d')];}function addVertex(_0x24c250,_0x380aae,_0x290ce8){_0x380aae['agicommand']=_0x290ce8;if(_0x380aae[_0x5343('0x1e')](_0x5343('0x1f'))){_0x380aae['maxRetry']=parseInt(_0x380aae[_0x5343('0x1f')],0xa);}_0x24c250[_0x5343('0x20')](_[_0x5343('0x21')](_0x380aae,'mxCell'));}function initGraph(_0x539f0b,_0x462cb6){var _0x5871de=new Graph();for(var _0x14d05a in _0x539f0b){if(_0x539f0b['hasOwnProperty'](_0x14d05a)){if(_[_0x5343('0x22')](_0x539f0b[_0x14d05a])){for(var _0x55ab94=0x0;_0x55ab94<_0x539f0b[_0x14d05a]['length'];_0x55ab94+=0x1){addVertex(_0x5871de,_0x539f0b[_0x14d05a][_0x55ab94],_0x14d05a);}}else{addVertex(_0x5871de,_0x539f0b[_0x14d05a],_0x14d05a);}}}for(var _0xd6c267=0x0;_0xd6c267<_0x462cb6[_0x5343('0x23')];_0xd6c267+=0x1){if(_0x462cb6[_0xd6c267]['source']&&_0x462cb6[_0xd6c267]['target']){_0x5871de[_0x5343('0x24')](_0x462cb6[_0xd6c267]['source'],_0x462cb6[_0xd6c267][_0x5343('0x25')],_0x462cb6[_0xd6c267]['value']);}}return _0x5871de;}function getSquareProject(_0x5c689e,_0x6316d3){rpc['getSquareProject'](_0x5c689e)['then'](function(_0x125e4c){_0x6316d3(null,_0x125e4c);})[_0x5343('0x26')](function(_0x2f446b){_0x6316d3(null,_0x2f446b);});}function createSquareReport(_0x249059,_0x4a31e8){rpc['createSquareReport'](_0x249059)[_0x5343('0x27')](function(_0x32ecf2){if(_0x4a31e8){_0x4a31e8(null,_0x32ecf2);}})[_0x5343('0x26')](function(_0x1278a1){if(_0x4a31e8){_0x4a31e8(null,_0x1278a1);}});}function setChannelVariables(_0x473c59){for(var _0xc61722 in _0x473c59){if(_0x473c59[_0x5343('0x1e')](_0xc61722)){if(_0xc61722[_0x5343('0x28')](_0x5343('0x29'))===0x0){_0x473c59[_0xc61722[_0x5343('0x2a')](0x4)]=_0x473c59[_0xc61722];delete _0x473c59[_0xc61722];}}}}function getLogFromObject(_0x28f652){return util[_0x5343('0x2b')](_0x28f652,{'showHidden':![],'depth':null});}function agiHandler(_0x55f558){var _0x510e0b,_0x235a10,_0x80b33a,_0x501083,_0x1de71b;logger['debug'](_0x5343('0x2c'),JSON[_0x5343('0x2d')](_0x55f558,null,0x2));logger[_0x5343('0xf')](util[_0x5343('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x55f558['arg_1'],_0x55f558[_0x5343('0x16')],_0x55f558['callerid'],_0x55f558[_0x5343('0x18')],_0x55f558[_0x5343('0x19')]));_0x55f558['on']('error',errorHandler);_0x55f558['on'](_0x5343('0x2e'),closeHandler);_0x55f558['on']('timeout',timeoutHandler);_0x55f558['evtHangup']=![];_0x55f558['on'](_0x5343('0x2f'),hangupHandler);var _0x16383f=getSquareProject[_0x5343('0x30')](null,_0x55f558[_0x5343('0x15')]);if(_0x16383f){if(_0x16383f['production']){_0x510e0b=getRoot(_0x16383f['production']);if(_0x510e0b&&_0x510e0b['start']){logger['debug'](_0x5343('0x1d'),JSON[_0x5343('0x2d')](_0x510e0b,null,0x2));_0x55f558[_0x5343('0x31')]=moment()[_0x5343('0x10')](_0x5343('0x32'));_0x235a10=initGraph(_[_0x5343('0x21')](_0x510e0b,_0x5343('0x33')),_0x510e0b['mxCell']);_0x80b33a=new Vertices(_0x55f558,rpc,mailRpc);logger[_0x5343('0xf')](util['format'](_0x5343('0x34'),_0x55f558[_0x5343('0x15')],_0x55f558[_0x5343('0x16')],_0x55f558[_0x5343('0x17')],_0x55f558[_0x5343('0x18')],_0x55f558[_0x5343('0x19')]));_0x235a10[_0x5343('0x35')](_0x510e0b['start']['id'],function(_0xb93d9){try{_0xb93d9=_0x80b33a['clear'](_0xb93d9);logger[_0x5343('0x36')](_0x5343('0x37'),JSON[_0x5343('0x2d')](_0xb93d9,null,0x2));if(_0xb93d9[_0x5343('0x38')]===_0x5343('0x39')){logger[_0x5343('0xf')](_0x5343('0x3a'));_0x55f558['context']=_0xb93d9[_0x5343('0x3b')]||_0x55f558[_0x5343('0x3b')];_0x55f558['extension']=_0xb93d9[_0x5343('0x3c')];_0x55f558[_0x5343('0x3d')]=_0xb93d9['priority']?_0xb93d9['priority']-0x1:0x1;return null;}else if(_0xb93d9&&_0x80b33a[_0xb93d9[_0x5343('0x38')]]){_0x1de71b=_0x80b33a[_0xb93d9[_0x5343('0x38')]](_0xb93d9);logger[_0x5343('0xf')]('response',JSON[_0x5343('0x2d')](_0x1de71b,null,0x2));if(_0x1de71b&&_0x1de71b[_0x5343('0x3e')]===AGI_CODE_SUCCESS&&_0x1de71b[_0x5343('0x3f')]!==AGI_RESULT_ERROR&&!_0x55f558[_0x5343('0x1b')]){logger[_0x5343('0x36')](_0x5343('0x40'),getLogFromObject(_0x1de71b));return _[_0x5343('0x41')](_0x1de71b['result'])?null:_0x1de71b[_0x5343('0x3f')][_0x5343('0x42')]();}else{logger[_0x5343('0x12')](_0x5343('0x40'),getLogFromObject(_0x1de71b));return null;}}else{logger[_0x5343('0x12')](_0x5343('0x43'));return null;}}catch(_0x1b07e1){logger[_0x5343('0x12')](_0x1b07e1[_0x5343('0xc')]);return null;}});if(_0x510e0b[_0x5343('0x44')]){logger[_0x5343('0xf')](util[_0x5343('0x10')](_0x5343('0x45'),_0x55f558[_0x5343('0x15')],_0x55f558[_0x5343('0x16')],_0x55f558['callerid'],_0x55f558[_0x5343('0x18')],_0x55f558[_0x5343('0x19')]));_0x235a10['traverseBFS'](_0x510e0b[_0x5343('0x44')]['id'],function(_0x302d53){try{_0x302d53=_0x80b33a[_0x5343('0x46')](_0x302d53);logger[_0x5343('0x36')](_0x5343('0x37'),JSON['stringify'](_0x302d53,null,0x2));if(_0x302d53&&_0x80b33a[_0x302d53[_0x5343('0x38')]]){_0x1de71b=_0x80b33a[_0x302d53['agicommand']](_0x302d53);if(_0x1de71b){logger['debug'](_0x5343('0x40'),getLogFromObject(_0x1de71b));return _[_0x5343('0x41')](_0x1de71b[_0x5343('0x3f')])?null:_0x1de71b[_0x5343('0x3f')]['toString']();}else{logger[_0x5343('0x12')](_0x5343('0x40'),getLogFromObject(_0x1de71b));return null;}}else{logger[_0x5343('0x12')](_0x5343('0x43'));return null;}}catch(_0xad241){logger[_0x5343('0x12')](_0xad241[_0x5343('0xc')]);return null;}});}logger[_0x5343('0xf')](util[_0x5343('0x10')](_0x5343('0x47'),_0x55f558['arg_1'],_0x55f558[_0x5343('0x16')],_0x55f558[_0x5343('0x17')],_0x55f558[_0x5343('0x18')],_0x55f558[_0x5343('0x19')]));logger[_0x5343('0xf')](util[_0x5343('0x10')](_0x5343('0x48'),_0x55f558[_0x5343('0x3b')],_0x55f558[_0x5343('0x3c')],parseInt(_0x55f558[_0x5343('0x3d')],0xa)+0x1));_0x55f558['continueAt'](_0x55f558[_0x5343('0x3b')],_0x55f558['extension'],parseInt(_0x55f558['priority'],0xa)+0x1);_0x55f558[_0x5343('0x2e')]();}}else{logger[_0x5343('0x12')](util[_0x5343('0x10')](_0x5343('0x49'),_0x55f558[_0x5343('0x15')]));_0x55f558['continueAt'](_0x55f558[_0x5343('0x3b')],_0x55f558['extension'],parseInt(_0x55f558[_0x5343('0x3d')],0xa)+0x1);_0x55f558['close']();}}else{logger[_0x5343('0x12')](util['format'](_0x5343('0x4a'),_0x55f558[_0x5343('0x15')]));_0x55f558[_0x5343('0x4b')](_0x55f558[_0x5343('0x3b')],_0x55f558[_0x5343('0x3c')],parseInt(_0x55f558['priority'],0xa)+0x1);_0x55f558[_0x5343('0x2e')]();}}function main(){var _0x159038;return utilLicense[_0x5343('0x4c')]()[_0x5343('0x27')](function(_0x246a23){if(_0x246a23){if(_0x246a23['voice']){if(_0x246a23['callysquare']&&_0x246a23[_0x5343('0x4d')]>0x0){logger['info'](util[_0x5343('0x10')](_0x5343('0x4e'),_0x246a23[_0x5343('0x4d')]));_0x159038=_0x246a23[_0x5343('0x4d')];}else{logger[_0x5343('0xf')](_0x5343('0x4f'));}}else{logger[_0x5343('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x159038=-0x1;}}})[_0x5343('0x26')](function(_0x34947e){logger['error'](_0x5343('0x50'),_0x34947e['stack']);})[_0x5343('0x44')](function(){var _0x4914e6=require(_0x5343('0x51'))(config['agi'][_0x5343('0xe')],config[_0x5343('0x6')]['ip'],_0x159038);_0x4914e6['on'](_0x5343('0x12'),errorHandler);_0x4914e6['on'](_0x5343('0x52'),listeningHandler);_0x4914e6['on'](_0x5343('0x53'),connectionHandler);_0x4914e6['on'](_0x5343('0x2e'),closeHandler);});}main(); \ No newline at end of file +var _0x61a5=['[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','addEdge','value','getSquareProject','catch','createSquareReport','then','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','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./graph','./vertices','agi','defaults','127.0.0.1','stack','log','port','format','name','message','error','[%s]\x20%s'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x61a5,0xf0));var _0x561a=function(_0x4e7844,_0x30ce77){_0x4e7844=_0x4e7844-0x0;var _0x336119=_0x61a5[_0x4e7844];return _0x336119;};'use strict';var parser=require(_0x561a('0x0'));var _=require('lodash');var syncho=require(_0x561a('0x1'));var util=require(_0x561a('0x2'));var moment=require(_0x561a('0x3'));var config=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))('agi');var utilLicense=require(_0x561a('0x6'));var rpc=require(_0x561a('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x561a('0x8'));var Vertices=require(_0x561a('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x561a('0xa')]=_[_0x561a('0xb')](config[_0x561a('0xa')],{'ip':_0x561a('0xc'),'port':0x11dd});function connectionHandler(_0x1d5814){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1d5814);agiHandler(_0x1d5814);}catch(_0x3db11c){logger['error'](_0x3db11c[_0x561a('0xd')]);}});});}function listeningHandler(){console[_0x561a('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x561a('0xa')][_0x561a('0xf')]);logger['info'](util[_0x561a('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x561a('0xa')]['ip'],config[_0x561a('0xa')][_0x561a('0xf')]));}function errorHandler(_0x155d0f){if(_0x155d0f&&_0x155d0f[_0x561a('0x11')]&&_0x155d0f[_0x561a('0x12')]){logger[_0x561a('0x13')](util[_0x561a('0x10')](_0x561a('0x14'),_0x155d0f[_0x561a('0x11')],_0x155d0f[_0x561a('0x12')]));}else{logger[_0x561a('0x13')](util['format'](_0x561a('0x15'),_0x155d0f[_0x561a('0xd')]));}}function closeHandler(){logger[_0x561a('0x16')](util[_0x561a('0x10')](_0x561a('0x17'),this[_0x561a('0x18')],this[_0x561a('0x19')],this[_0x561a('0x1a')],this[_0x561a('0x1b')],this[_0x561a('0x1c')]));try{createSquareReport(this);}catch(_0x19870a){logger['error'](_0x19870a[_0x561a('0xd')]);}}function timeoutHandler(){logger[_0x561a('0x16')](util['format'](_0x561a('0x1d'),this[_0x561a('0x18')],this['calleridname'],this[_0x561a('0x1a')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x561a('0x16')](util[_0x561a('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x561a('0x18')],this[_0x561a('0x19')],this[_0x561a('0x1a')],this[_0x561a('0x1b')],this[_0x561a('0x1c')]));this[_0x561a('0x1e')]=!![];}function getRoot(_0x4f9c3a){return parser[_0x561a('0x1f')](_0x4f9c3a,{'object':!![]})[_0x561a('0x20')][_0x561a('0x21')];}function addVertex(_0x527207,_0x58c32f,_0x25b53c){_0x58c32f[_0x561a('0x22')]=_0x25b53c;if(_0x58c32f[_0x561a('0x23')](_0x561a('0x24'))){_0x58c32f[_0x561a('0x25')]=parseInt(_0x58c32f[_0x561a('0x24')],0xa);}_0x527207[_0x561a('0x26')](_[_0x561a('0x27')](_0x58c32f,'mxCell'));}function initGraph(_0x4c2752,_0x27f42){var _0x2765c5=new Graph();for(var _0x986172 in _0x4c2752){if(_0x4c2752[_0x561a('0x23')](_0x986172)){if(_['isArray'](_0x4c2752[_0x986172])){for(var _0x186862=0x0;_0x186862<_0x4c2752[_0x986172][_0x561a('0x28')];_0x186862+=0x1){addVertex(_0x2765c5,_0x4c2752[_0x986172][_0x186862],_0x986172);}}else{addVertex(_0x2765c5,_0x4c2752[_0x986172],_0x986172);}}}for(var _0x44c851=0x0;_0x44c851<_0x27f42[_0x561a('0x28')];_0x44c851+=0x1){if(_0x27f42[_0x44c851][_0x561a('0x29')]&&_0x27f42[_0x44c851]['target']){_0x2765c5[_0x561a('0x2a')](_0x27f42[_0x44c851][_0x561a('0x29')],_0x27f42[_0x44c851]['target'],_0x27f42[_0x44c851][_0x561a('0x2b')]);}}return _0x2765c5;}function getSquareProject(_0x276ae7,_0x58db23){rpc[_0x561a('0x2c')](_0x276ae7)['then'](function(_0x54a47a){_0x58db23(null,_0x54a47a);})[_0x561a('0x2d')](function(_0x3d3cc8){_0x58db23(null,_0x3d3cc8);});}function createSquareReport(_0x4e0042,_0x10c24b){rpc[_0x561a('0x2e')](_0x4e0042)[_0x561a('0x2f')](function(_0x278c7e){if(_0x10c24b){_0x10c24b(null,_0x278c7e);}})[_0x561a('0x2d')](function(_0xbb2ae8){if(_0x10c24b){_0x10c24b(null,_0xbb2ae8);}});}function setChannelVariables(_0x33b2fc){for(var _0x1e0cd5 in _0x33b2fc){if(_0x33b2fc['hasOwnProperty'](_0x1e0cd5)){if(_0x1e0cd5[_0x561a('0x30')](_0x561a('0x31'))===0x0){_0x33b2fc[_0x1e0cd5[_0x561a('0x32')](0x4)]=_0x33b2fc[_0x1e0cd5];delete _0x33b2fc[_0x1e0cd5];}}}}function getLogFromObject(_0x40865e){return util[_0x561a('0x33')](_0x40865e,{'showHidden':![],'depth':null});}function agiHandler(_0x4ab97f){var _0xf96a9f,_0x29d120,_0x2d0063,_0x3e87b0,_0x57809f;logger[_0x561a('0x34')](_0x561a('0x35'),JSON[_0x561a('0x36')](_0x4ab97f,null,0x2));logger['info'](util['format'](_0x561a('0x37'),_0x4ab97f['arg_1'],_0x4ab97f['calleridname'],_0x4ab97f['callerid'],_0x4ab97f[_0x561a('0x1b')],_0x4ab97f[_0x561a('0x1c')]));_0x4ab97f['on'](_0x561a('0x13'),errorHandler);_0x4ab97f['on'](_0x561a('0x38'),closeHandler);_0x4ab97f['on'](_0x561a('0x39'),timeoutHandler);_0x4ab97f[_0x561a('0x1e')]=![];_0x4ab97f['on']('hangup',hangupHandler);var _0x588a39=getSquareProject[_0x561a('0x3a')](null,_0x4ab97f[_0x561a('0x18')]);if(_0x588a39){if(_0x588a39[_0x561a('0x3b')]){_0xf96a9f=getRoot(_0x588a39[_0x561a('0x3b')]);if(_0xf96a9f&&_0xf96a9f[_0x561a('0x3c')]){logger[_0x561a('0x34')](_0x561a('0x21'),JSON[_0x561a('0x36')](_0xf96a9f,null,0x2));_0x4ab97f['joinAt']=moment()[_0x561a('0x10')](_0x561a('0x3d'));_0x29d120=initGraph(_[_0x561a('0x27')](_0xf96a9f,_0x561a('0x3e')),_0xf96a9f['mxCell']);_0x2d0063=new Vertices(_0x4ab97f,rpc,mailRpc);logger[_0x561a('0x16')](util[_0x561a('0x10')](_0x561a('0x3f'),_0x4ab97f['arg_1'],_0x4ab97f[_0x561a('0x19')],_0x4ab97f[_0x561a('0x1a')],_0x4ab97f[_0x561a('0x1b')],_0x4ab97f[_0x561a('0x1c')]));_0x29d120[_0x561a('0x40')](_0xf96a9f[_0x561a('0x3c')]['id'],function(_0x214846){try{_0x214846=_0x2d0063['clear'](_0x214846);logger[_0x561a('0x34')](_0x561a('0x41'),JSON[_0x561a('0x36')](_0x214846,null,0x2));if(_0x214846[_0x561a('0x22')]===_0x561a('0x42')){logger[_0x561a('0x16')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4ab97f[_0x561a('0x43')]=_0x214846[_0x561a('0x43')]||_0x4ab97f[_0x561a('0x43')];_0x4ab97f[_0x561a('0x44')]=_0x214846[_0x561a('0x44')];_0x4ab97f[_0x561a('0x45')]=_0x214846[_0x561a('0x45')]?_0x214846[_0x561a('0x45')]-0x1:0x1;return null;}else if(_0x214846&&_0x2d0063[_0x214846[_0x561a('0x22')]]){_0x57809f=_0x2d0063[_0x214846['agicommand']](_0x214846);logger[_0x561a('0x16')](_0x561a('0x46'),JSON['stringify'](_0x57809f,null,0x2));if(_0x57809f&&_0x57809f[_0x561a('0x47')]===AGI_CODE_SUCCESS&&_0x57809f['result']!==AGI_RESULT_ERROR&&!_0x4ab97f[_0x561a('0x1e')]){logger[_0x561a('0x34')](_0x561a('0x46'),getLogFromObject(_0x57809f));return _[_0x561a('0x48')](_0x57809f[_0x561a('0x49')])?null:_0x57809f['result'][_0x561a('0x4a')]();}else{logger[_0x561a('0x13')](_0x561a('0x46'),getLogFromObject(_0x57809f));return null;}}else{logger[_0x561a('0x13')](_0x561a('0x4b'));return null;}}catch(_0x13c6c6){logger['error'](_0x13c6c6['stack']);return null;}});if(_0xf96a9f[_0x561a('0x4c')]){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4ab97f['arg_1'],_0x4ab97f['calleridname'],_0x4ab97f[_0x561a('0x1a')],_0x4ab97f[_0x561a('0x1b')],_0x4ab97f[_0x561a('0x1c')]));_0x29d120['traverseBFS'](_0xf96a9f[_0x561a('0x4c')]['id'],function(_0x57d53d){try{_0x57d53d=_0x2d0063['clear'](_0x57d53d);logger[_0x561a('0x34')](_0x561a('0x41'),JSON[_0x561a('0x36')](_0x57d53d,null,0x2));if(_0x57d53d&&_0x2d0063[_0x57d53d['agicommand']]){_0x57809f=_0x2d0063[_0x57d53d[_0x561a('0x22')]](_0x57d53d);if(_0x57809f){logger['debug'](_0x561a('0x46'),getLogFromObject(_0x57809f));return _['isUndefined'](_0x57809f[_0x561a('0x49')])?null:_0x57809f[_0x561a('0x49')][_0x561a('0x4a')]();}else{logger[_0x561a('0x13')](_0x561a('0x46'),getLogFromObject(_0x57809f));return null;}}else{logger[_0x561a('0x13')](_0x561a('0x4b'));return null;}}catch(_0x25aaf6){logger[_0x561a('0x13')](_0x25aaf6['stack']);return null;}});}logger[_0x561a('0x16')](util[_0x561a('0x10')](_0x561a('0x4d'),_0x4ab97f['arg_1'],_0x4ab97f[_0x561a('0x19')],_0x4ab97f[_0x561a('0x1a')],_0x4ab97f['dnid'],_0x4ab97f[_0x561a('0x1c')]));logger[_0x561a('0x16')](util[_0x561a('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4ab97f[_0x561a('0x43')],_0x4ab97f[_0x561a('0x44')],parseInt(_0x4ab97f[_0x561a('0x45')],0xa)+0x1));_0x4ab97f[_0x561a('0x4e')](_0x4ab97f[_0x561a('0x43')],_0x4ab97f[_0x561a('0x44')],parseInt(_0x4ab97f[_0x561a('0x45')],0xa)+0x1);_0x4ab97f['close']();}}else{logger[_0x561a('0x13')](util[_0x561a('0x10')](_0x561a('0x4f'),_0x4ab97f[_0x561a('0x18')]));_0x4ab97f[_0x561a('0x4e')](_0x4ab97f[_0x561a('0x43')],_0x4ab97f[_0x561a('0x44')],parseInt(_0x4ab97f['priority'],0xa)+0x1);_0x4ab97f[_0x561a('0x38')]();}}else{logger[_0x561a('0x13')](util[_0x561a('0x10')]('Project\x20%s\x20not\x20found',_0x4ab97f[_0x561a('0x18')]));_0x4ab97f['continueAt'](_0x4ab97f[_0x561a('0x43')],_0x4ab97f[_0x561a('0x44')],parseInt(_0x4ab97f[_0x561a('0x45')],0xa)+0x1);_0x4ab97f[_0x561a('0x38')]();}}function main(){var _0x227616;return utilLicense[_0x561a('0x50')]()[_0x561a('0x2f')](function(_0x4cad70){if(_0x4cad70){if(_0x4cad70['voice']){if(_0x4cad70[_0x561a('0x51')]&&_0x4cad70[_0x561a('0x51')]>0x0){logger[_0x561a('0x16')](util[_0x561a('0x10')](_0x561a('0x52'),_0x4cad70[_0x561a('0x51')]));_0x227616=_0x4cad70['callysquare'];}else{logger[_0x561a('0x16')](_0x561a('0x53'));}}else{logger['info'](_0x561a('0x54'));_0x227616=-0x1;}}})['catch'](function(_0x5194d5){logger[_0x561a('0x13')](_0x561a('0x55'),_0x5194d5[_0x561a('0xd')]);})[_0x561a('0x4c')](function(){var _0x4a714c=require(_0x561a('0x56'))(config['agi'][_0x561a('0xf')],config[_0x561a('0xa')]['ip'],_0x227616);_0x4a714c['on'](_0x561a('0x13'),errorHandler);_0x4a714c['on']('listening',listeningHandler);_0x4a714c['on']('connection',connectionHandler);_0x4a714c['on']('close',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 d2b0936..abda176 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 _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x5bf151,_0x59b0fc){var _0xa0bf03=function(_0x3d123f){while(--_0x3d123f){_0x5bf151['push'](_0x5bf151['shift']());}};_0xa0bf03(++_0x59b0fc);}(_0x34e8,0x12c));var _0x834e=function(_0x93c113,_0xbfb043){_0x93c113=_0x93c113-0x0;var _0x2c5ff4=_0x34e8[_0x93c113];return _0x2c5ff4;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x503f84,_0x1cce72){var _0x305d5b=function(_0x4ba9d6){while(--_0x4ba9d6){_0x503f84['push'](_0x503f84['shift']());}};_0x305d5b(++_0x1cce72);}(_0x814b,0x1a2));var _0xb814=function(_0x27e7e2,_0x3ddb8a){_0x27e7e2=_0x27e7e2-0x0;var _0x55431f=_0x814b[_0x27e7e2];return _0x55431f;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index df9bc61..f5d418f 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44061d,_0x412613){_0x44061d=_0x44061d-0x0;var _0xf3333c=_0x5f2f[_0x44061d];return _0xf3333c;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xe13e13,_0x402131){var _0x3b3d61=function(_0x1c54fb){while(--_0x1c54fb){_0xe13e13['push'](_0xe13e13['shift']());}};_0x3b3d61(++_0x402131);}(_0x5f2f,0x73));var _0xf5f2=function(_0x541c52,_0x1f9d5b){_0x541c52=_0x541c52-0x0;var _0x44d586=_0x5f2f[_0x541c52];return _0x44d586;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 79e548e..aa74815 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 _0xcc9b=['agentUnpause','agentLogout','moment','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser'];(function(_0x218696,_0x59a292){var _0x308dbf=function(_0x4e3e18){while(--_0x4e3e18){_0x218696['push'](_0x218696['shift']());}};_0x308dbf(++_0x59a292);}(_0xcc9b,0x12e));var _0xbcc9=function(_0x2167c4,_0x14ec40){_0x2167c4=_0x2167c4-0x0;var _0x13840a=_0xcc9b[_0x2167c4];return _0x13840a;};'use strict';var BPromise=require('bluebird');var moment=require(_0xbcc9('0x0'));var _=require('lodash');var util=require(_0xbcc9('0x1'));var jayson=require(_0xbcc9('0x2'));var client=jayson[_0xbcc9('0x3')][_0xbcc9('0x4')]({'port':0x2329});function request(_0x328059,_0xd06275){return new BPromise(function(_0x31dca7,_0x41b563){return client[_0xbcc9('0x5')](_0x328059,_0xd06275)[_0xbcc9('0x6')](function(_0x17a82d){if(_0x17a82d[_0xbcc9('0x7')]){return _0x41b563(_0x17a82d[_0xbcc9('0x7')][_0xbcc9('0x8')]);}else{return _0x31dca7(_0x17a82d[_0xbcc9('0x9')]);}})[_0xbcc9('0xa')](function(_0x28da47){return _0x41b563(_0x28da47);});});}exports[_0xbcc9('0xb')]=function(_0x939ab3){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x939ab3},'attributes':[_0xbcc9('0xc')]}});};exports[_0xbcc9('0xd')]=function(_0xdeb28a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xdeb28a},'include':[{'model':_0xbcc9('0xe'),'as':_0xbcc9('0xf')}],'attributes':['id',_0xbcc9('0x10'),_0xbcc9('0x11')]}});};exports['getSquareProjectById']=function(_0x3ba935){return request(_0xbcc9('0x12'),{'options':{'where':{'id':_0x3ba935},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x13')]=function(_0x2585c5){return request(_0xbcc9('0x14'),{'options':{'where':{'id':_0x2585c5},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x15')]=function(_0x609de4){return request('ShowVariable',{'options':{'where':{'id':_0x609de4},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x16')]=function(_0x1e52bf){return request(_0xbcc9('0x17'),{'options':{'where':{'id':_0x1e52bf},'attributes':[_0xbcc9('0x18')]}});};exports[_0xbcc9('0x19')]=function(_0x1f9449){return request(_0xbcc9('0x1a'),{'options':{'where':{'id':_0x1f9449},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x1b')]=function(_0x4cec4a){return request(_0xbcc9('0x1c'),{'options':{'where':{'id':_0x4cec4a},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x1d')]=function(_0x279f6f){return request(_0xbcc9('0x1e'),{'options':{'where':{'id':_0x279f6f},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x4c9029){return request(_0xbcc9('0x1f'),{'options':{'raw':![],'where':{'id':_0x4c9029},'include':[{'model':_0xbcc9('0x20'),'as':_0xbcc9('0x21')}]}});};exports[_0xbcc9('0x22')]=function(_0x2f4bc7){return request(_0xbcc9('0x23'),{'options':{'where':{'id':_0x2f4bc7},'attributes':['id','name']}});};exports[_0xbcc9('0x24')]=function(_0x27b0b7){return request(_0xbcc9('0x25'),{'body':_0x27b0b7});};exports[_0xbcc9('0x26')]=function(_0x255720){return request(_0xbcc9('0x27'),{'body':_0x255720});};exports[_0xbcc9('0x28')]=function(_0x82c245){return request(_0xbcc9('0x29'),{'body':_['merge'](_0x82c245,{'project_name':_0x82c245[_0xbcc9('0x2a')],'prev_project_name':_0x82c245[_0xbcc9('0x2b')]||'','is_subproject':_0x82c245[_0xbcc9('0x2b')]?!![]:![],'leaveAt':moment()[_0xbcc9('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xbcc9('0x2d')]=function(_0x3586b4){return request(_0xbcc9('0x2e'),{'body':_0x3586b4});};exports[_0xbcc9('0x2f')]=function(_0x48361d){return request(_0xbcc9('0x30'),{'body':_0x48361d});};exports[_0xbcc9('0x31')]=function(_0xfdaef3){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xfdaef3[_0xbcc9('0x32')],'ListId':_0xfdaef3['ListId']}}})[_0xbcc9('0x6')](function(_0x1b5e76){if(_0x1b5e76){return _0x1b5e76;}return request(_0xbcc9('0x33'),{'body':_0xfdaef3});});};exports[_0xbcc9('0x34')]=function(_0x283d5a){return request(_0xbcc9('0x35'),{'options':{'where':{'id':_0x283d5a},'attributes':[_0xbcc9('0x10')]}});};exports[_0xbcc9('0x36')]=function(_0x2f8596,_0x161055){return request(_0xbcc9('0x37'),{'body':{'interface':_0x161055},'options':{'where':_0x2f8596}});};exports[_0xbcc9('0x38')]=function(_0x3ef67c,_0xc54c18,_0x389a48){return request(_0xbcc9('0x39'),{'body':{'type':_0xc54c18,'uniqueid':_0x389a48},'options':{'where':_0x3ef67c}});};exports[_0xbcc9('0x3a')]=function(_0x3b37db){return request('UnpauseUser',{'body':{},'options':{'where':_0x3b37db}});};exports[_0xbcc9('0x3b')]=function(_0x4756f1){return request('LogoutUser',{'body':{},'options':{'where':_0x4756f1}});}; \ No newline at end of file +var _0x9421=['name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Intervals','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','MailServerOut','Smtp'];(function(_0x1328ad,_0x53e55e){var _0x59b134=function(_0x217704){while(--_0x217704){_0x1328ad['push'](_0x1328ad['shift']());}};_0x59b134(++_0x53e55e);}(_0x9421,0x155));var _0x1942=function(_0x56cf57,_0x2beec2){_0x56cf57=_0x56cf57-0x0;var _0x1b7121=_0x9421[_0x56cf57];return _0x1b7121;};'use strict';var BPromise=require(_0x1942('0x0'));var moment=require(_0x1942('0x1'));var _=require(_0x1942('0x2'));var util=require(_0x1942('0x3'));var jayson=require(_0x1942('0x4'));var client=jayson['client'][_0x1942('0x5')]({'port':0x2329});function request(_0x10e4fd,_0x550c26){return new BPromise(function(_0x5b8adc,_0x27c6fd){return client[_0x1942('0x6')](_0x10e4fd,_0x550c26)[_0x1942('0x7')](function(_0x5c4801){if(_0x5c4801[_0x1942('0x8')]){return _0x27c6fd(_0x5c4801[_0x1942('0x8')][_0x1942('0x9')]);}else{return _0x5b8adc(_0x5c4801[_0x1942('0xa')]);}})[_0x1942('0xb')](function(_0x496604){return _0x27c6fd(_0x496604);});});}exports[_0x1942('0xc')]=function(_0x3dd617){return request(_0x1942('0xd'),{'options':{'raw':![],'where':{'name':_0x3dd617},'attributes':['production']}});};exports['getMailAccountById']=function(_0x323d94){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x323d94},'include':[{'model':_0x1942('0xe'),'as':_0x1942('0xf')}],'attributes':['id',_0x1942('0x10'),_0x1942('0x11')]}});};exports[_0x1942('0x12')]=function(_0x22f070){return request(_0x1942('0xd'),{'options':{'where':{'id':_0x22f070},'attributes':[_0x1942('0x10')]}});};exports[_0x1942('0x13')]=function(_0x41237b){return request(_0x1942('0x14'),{'options':{'where':{'id':_0x41237b},'attributes':[_0x1942('0x10')]}});};exports[_0x1942('0x15')]=function(_0x51d901){return request('ShowVariable',{'options':{'where':{'id':_0x51d901},'attributes':[_0x1942('0x10')]}});};exports[_0x1942('0x16')]=function(_0x16a716){return request(_0x1942('0x17'),{'options':{'where':{'id':_0x16a716},'attributes':['dsn']}});};exports[_0x1942('0x18')]=function(_0x554d7e){return request(_0x1942('0x19'),{'options':{'where':{'id':_0x554d7e},'attributes':[_0x1942('0x10')]}});};exports[_0x1942('0x1a')]=function(_0x4755e0){return request('ShowTrunk',{'options':{'where':{'id':_0x4755e0},'attributes':[_0x1942('0x10')]}});};exports[_0x1942('0x1b')]=function(_0x28f6be){return request(_0x1942('0x1c'),{'options':{'where':{'id':_0x28f6be},'attributes':[_0x1942('0x1d')]}});};exports[_0x1942('0x1e')]=function(_0x5a8a3e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5a8a3e},'include':[{'model':'Interval','as':_0x1942('0x1f')}]}});};exports['getSmsAccountById']=function(_0x5d0879){return request(_0x1942('0x20'),{'options':{'where':{'id':_0x5d0879},'attributes':['id',_0x1942('0x10')]}});};exports['createSmsMessage']=function(_0x4843c0){return request('CreateSmsMessage',{'body':_0x4843c0});};exports[_0x1942('0x21')]=function(_0x1497d2){return request(_0x1942('0x22'),{'body':_0x1497d2});};exports[_0x1942('0x23')]=function(_0x258c67){return request(_0x1942('0x24'),{'body':_['merge'](_0x258c67,{'project_name':_0x258c67[_0x1942('0x25')],'prev_project_name':_0x258c67['arg_2']||'','is_subproject':_0x258c67[_0x1942('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x1942('0x27'))})});};exports['createSquareRecording']=function(_0x2f85aa){return request('CreateSquareRecording',{'body':_0x2f85aa});};exports[_0x1942('0x28')]=function(_0x425267){return request('CreateSquareMessage',{'body':_0x425267});};exports['createCmContact']=function(_0xe6ba2e){return request(_0x1942('0x29'),{'options':{'raw':![],'where':{'phone':_0xe6ba2e[_0x1942('0x2a')],'ListId':_0xe6ba2e[_0x1942('0x2b')]}}})[_0x1942('0x7')](function(_0x58581e){if(_0x58581e){return _0x58581e;}return request(_0x1942('0x2c'),{'body':_0xe6ba2e});});};exports[_0x1942('0x2d')]=function(_0x544c33){return request(_0x1942('0x2e'),{'options':{'where':{'id':_0x544c33},'attributes':['name']}});};exports['agentLogin']=function(_0x42670e,_0x36032a){return request('LoginUser',{'body':{'interface':_0x36032a},'options':{'where':_0x42670e}});};exports[_0x1942('0x2f')]=function(_0x5ace83,_0x959c6f,_0x4de8df){return request(_0x1942('0x30'),{'body':{'type':_0x959c6f,'uniqueid':_0x4de8df},'options':{'where':_0x5ace83}});};exports['agentUnpause']=function(_0x4a3b9a){return request(_0x1942('0x31'),{'body':{},'options':{'where':_0x4a3b9a}});};exports[_0x1942('0x32')]=function(_0x352e0d){return request('LogoutUser',{'body':{},'options':{'where':_0x352e0d}});}; \ 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 5f3ea59..057fd5d 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 _0x82c0=['./lex','exports'];(function(_0x203dd1,_0x1a62e9){var _0x19f325=function(_0x52e374){while(--_0x52e374){_0x203dd1['push'](_0x203dd1['shift']());}};_0x19f325(++_0x1a62e9);}(_0x82c0,0xe0));var _0x082c=function(_0x2dda7c,_0x138644){_0x2dda7c=_0x2dda7c-0x0;var _0x35bfe7=_0x82c0[_0x2dda7c];return _0x35bfe7;};var polly=require('./polly');var lex=require(_0x082c('0x0'));module[_0x082c('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xa799=['exports','./polly','./lex'];(function(_0x36af61,_0x311023){var _0x34a90d=function(_0x478cb0){while(--_0x478cb0){_0x36af61['push'](_0x36af61['shift']());}};_0x34a90d(++_0x311023);}(_0xa799,0x12d));var _0x9a79=function(_0x35e25c,_0x301f23){_0x35e25c=_0x35e25c-0x0;var _0x5266c6=_0xa799[_0x35e25c];return _0x5266c6;};var polly=require(_0x9a79('0x0'));var lex=require(_0x9a79('0x1'));module[_0x9a79('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 89e4196..0405e1e 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 _0x644a=['exports','./lib/api'];(function(_0x184bd6,_0x3bb0bd){var _0x24a967=function(_0x454d77){while(--_0x454d77){_0x184bd6['push'](_0x184bd6['shift']());}};_0x24a967(++_0x3bb0bd);}(_0x644a,0xfd));var _0xa644=function(_0x52949d,_0x5750ec){_0x52949d=_0x52949d-0x0;var _0x570250=_0x644a[_0x52949d];return _0x570250;};'use strict';var lex=require(_0xa644('0x0'));module[_0xa644('0x1')]=function(_0x32ada1,_0x286d20,_0x3a3218,_0x48801b,_0x1423b7,_0x704008){return lex(_0x32ada1,_0x286d20,_0x3a3218,_0x48801b,_0x1423b7,_0x704008);}; \ No newline at end of file +var _0xf403=['./lib/api'];(function(_0x1c619c,_0x3f2acc){var _0x29f43a=function(_0x5577a5){while(--_0x5577a5){_0x1c619c['push'](_0x1c619c['shift']());}};_0x29f43a(++_0x3f2acc);}(_0xf403,0x1d3));var _0x3f40=function(_0x2203e4,_0x542225){_0x2203e4=_0x2203e4-0x0;var _0x92bc99=_0xf403[_0x2203e4];return _0x92bc99;};'use strict';var lex=require(_0x3f40('0x0'));module['exports']=function(_0x456979,_0x197a40,_0x10940e,_0x3b40ca,_0x3a8288,_0x2a39f9){return lex(_0x456979,_0x197a40,_0x10940e,_0x3b40ca,_0x3a8288,_0x2a39f9);}; \ 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 d4cec92..d698d4a 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 _0x8868=['exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','slot_'];(function(_0x558c04,_0x49a6ce){var _0x40d4d0=function(_0x358014){while(--_0x358014){_0x558c04['push'](_0x558c04['shift']());}};_0x40d4d0(++_0x49a6ce);}(_0x8868,0xa3));var _0x8886=function(_0x4c8c97,_0x2654f9){_0x4c8c97=_0x4c8c97-0x0;var _0x5aeef2=_0x8868[_0x4c8c97];return _0x5aeef2;};'use strict';var BPromise=require(_0x8886('0x0'));var AWS=require(_0x8886('0x1'));function lexResult(_0x447b66,_0x555b60){return new BPromise(function(_0x5b2ced,_0xaf235e){_0x447b66[_0x8886('0x2')](_0x555b60,function(_0x1e0b13,_0x2660d4){if(_0x1e0b13){_0xaf235e(_0x1e0b13);}if(_0x2660d4[_0x8886('0x3')]){for(const _0x3bb35e in _0x2660d4[_0x8886('0x3')]){if(_0x2660d4[_0x8886('0x3')]['hasOwnProperty'](_0x3bb35e)){var _0x4df9ac=_0x2660d4['slots'][_0x3bb35e];_0x2660d4[_0x8886('0x4')+_0x3bb35e]=_0x4df9ac;}}}_0x5b2ced(_0x2660d4);});});}module[_0x8886('0x5')]=function(_0x3bada2,_0x4036df,_0xd1ba6f,_0x3edd80,_0x239b7e,_0x59c8d4){var _0x2e6438=new AWS[(_0x8886('0x6'))]({'accessKeyId':_0x4036df,'secretAccessKey':_0xd1ba6f,'region':_0x3edd80});var _0xf7d6f8={'botAlias':_0x8886('0x7'),'botName':_0x59c8d4,'inputText':_0x239b7e,'userId':_0x3bada2};return lexResult(_0x2e6438,_0xf7d6f8);}; \ No newline at end of file +var _0x3167=['LexRuntime','$LATEST','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x3167,0xc6));var _0x7316=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0x3167[_0x75267d];return _0x21ccec;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x4ed10c,_0x26bc57){return new BPromise(function(_0x3a78c7,_0x79dbf1){_0x4ed10c[_0x7316('0x0')](_0x26bc57,function(_0x4fcd9e,_0x54279c){if(_0x4fcd9e){_0x79dbf1(_0x4fcd9e);}if(_0x54279c[_0x7316('0x1')]){for(const _0x515992 in _0x54279c['slots']){if(_0x54279c['slots'][_0x7316('0x2')](_0x515992)){var _0x53261f=_0x54279c[_0x7316('0x1')][_0x515992];_0x54279c[_0x7316('0x3')+_0x515992]=_0x53261f;}}}_0x3a78c7(_0x54279c);});});}module[_0x7316('0x4')]=function(_0xc27214,_0x2a3f94,_0x42a5b4,_0x447bbc,_0x59cf04,_0x436303){var _0x5f392a=new AWS[(_0x7316('0x5'))]({'accessKeyId':_0x2a3f94,'secretAccessKey':_0x42a5b4,'region':_0x447bbc});var _0xc2ea62={'botAlias':_0x7316('0x6'),'botName':_0x436303,'inputText':_0x59cf04,'userId':_0xc27214};return lexResult(_0x5f392a,_0xc2ea62);}; \ 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 38a5fd2..5dba7f3 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 _0x068f=['exports'];(function(_0x40db09,_0x377c60){var _0x13c04c=function(_0x3ffdff){while(--_0x3ffdff){_0x40db09['push'](_0x40db09['shift']());}};_0x13c04c(++_0x377c60);}(_0x068f,0x13c));var _0xf068=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x068f[_0x2c7618];return _0x5ce3f0;};'use strict';var polly=require('./lib/api');module[_0xf068('0x0')]=function(_0x3fcc7f,_0x58b2ca,_0x3ada67,_0x22b6b7,_0x478fc9,_0x18d5a3,_0x15f40e){return polly(_0x3fcc7f,_0x58b2ca,_0x3ada67,_0x22b6b7,_0x478fc9,_0x18d5a3,_0x15f40e);}; \ No newline at end of file +var _0x091d=['./lib/api','exports'];(function(_0x52ab49,_0x279c5f){var _0x35cd22=function(_0x51c4b2){while(--_0x51c4b2){_0x52ab49['push'](_0x52ab49['shift']());}};_0x35cd22(++_0x279c5f);}(_0x091d,0x136));var _0xd091=function(_0x2fdbfd,_0x401f22){_0x2fdbfd=_0x2fdbfd-0x0;var _0x25be07=_0x091d[_0x2fdbfd];return _0x25be07;};'use strict';var polly=require(_0xd091('0x0'));module[_0xd091('0x1')]=function(_0x494d0b,_0x518875,_0x579f9c,_0x59af9a,_0x33cdb4,_0x2c9d40,_0x60d603){return polly(_0x494d0b,_0x518875,_0x579f9c,_0x59af9a,_0x33cdb4,_0x2c9d40,_0x60d603);}; \ 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 8228198..2357d4d 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 _0x34a1=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x434706,_0x585eb1){var _0x27c813=function(_0x3cc945){while(--_0x3cc945){_0x434706['push'](_0x434706['shift']());}};_0x27c813(++_0x585eb1);}(_0x34a1,0xcb));var _0x134a=function(_0x1c0a79,_0x47e5b6){_0x1c0a79=_0x1c0a79-0x0;var _0xccaad=_0x34a1[_0x1c0a79];return _0xccaad;};'use strict';var fs=require('fs');var path=require(_0x134a('0x0'));var BPromise=require(_0x134a('0x1'));var rs=require(_0x134a('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x1ca2c3,_0x4157b7,_0x11df05){return new BPromise(function(_0x502cef,_0x308333){_0x1ca2c3[_0x134a('0x3')](_0x4157b7,function(_0x1e3d97,_0x275d12){if(_0x1e3d97){_0x308333(_0x1e3d97);}else if(_0x275d12){if(_0x275d12[_0x134a('0x4')]instanceof Buffer){fs[_0x134a('0x5')](_0x11df05,_0x275d12[_0x134a('0x4')],function(_0xb07071){if(_0xb07071){_0x308333(_0xb07071);}else{_0x502cef();}});}else{_0x308333(new Error(_0x134a('0x6')));}}else{_0x308333(new Error(_0x134a('0x7')));}});});}module['exports']=function(_0x2b04c9,_0x2b1410,_0x496e42,_0x3a4b56,_0x593966,_0x117a9c,_0x325e73){var _0x10fb43=new AWS[(_0x134a('0x8'))]({'accessKeyId':_0x2b04c9,'secretAccessKey':_0x2b1410,'region':_0x496e42});var _0x16c300={'Text':_0x593966,'TextType':_0x117a9c||_0x134a('0x9'),'OutputFormat':_0x134a('0xa'),'VoiceId':_0x3a4b56};return pollyResult(_0x10fb43,_0x16c300,_0x325e73);}; \ No newline at end of file +var _0x10d4=['mp3','path','synthesizeSpeech','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10d4,0x191));var _0x410d=function(_0x3731a7,_0x19e8ab){_0x3731a7=_0x3731a7-0x0;var _0x71cae6=_0x10d4[_0x3731a7];return _0x71cae6;};'use strict';var fs=require('fs');var path=require(_0x410d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x3dfc53,_0x2e282c,_0x2cc697){return new BPromise(function(_0x593ada,_0x26ba76){_0x3dfc53[_0x410d('0x1')](_0x2e282c,function(_0x4cb904,_0x17691d){if(_0x4cb904){_0x26ba76(_0x4cb904);}else if(_0x17691d){if(_0x17691d['AudioStream']instanceof Buffer){fs['writeFile'](_0x2cc697,_0x17691d['AudioStream'],function(_0x326a23){if(_0x326a23){_0x26ba76(_0x326a23);}else{_0x593ada();}});}else{_0x26ba76(new Error(_0x410d('0x2')));}}else{_0x26ba76(new Error(_0x410d('0x3')));}});});}module[_0x410d('0x4')]=function(_0x3126dc,_0x202031,_0x4b203c,_0x2a5c9d,_0x50cbf9,_0xa58fce,_0x3b78ef){var _0x1ef73b=new AWS[(_0x410d('0x5'))]({'accessKeyId':_0x3126dc,'secretAccessKey':_0x202031,'region':_0x4b203c});var _0x1db951={'Text':_0x50cbf9,'TextType':_0xa58fce||_0x410d('0x6'),'OutputFormat':_0x410d('0x7'),'VoiceId':_0x2a5c9d};return pollyResult(_0x1ef73b,_0x1db951,_0x3b78ef);}; \ 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 e68d2cf..18b773f 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 _0x731b=['exports','./lib/api'];(function(_0x168646,_0x461871){var _0x75d611=function(_0x220382){while(--_0x220382){_0x168646['push'](_0x168646['shift']());}};_0x75d611(++_0x461871);}(_0x731b,0xf7));var _0xb731=function(_0x176623,_0x458d96){_0x176623=_0x176623-0x0;var _0x4aaf0a=_0x731b[_0x176623];return _0x4aaf0a;};'use strict';var asr=require(_0xb731('0x0'));module[_0xb731('0x1')]=function(_0x560bbf,_0x4197df,_0x43c8c1,_0x44613d){return asr(_0x560bbf,_0x4197df,_0x43c8c1);}; \ No newline at end of file +var _0xf7fb=['./lib/api'];(function(_0x1d5459,_0x16c2b3){var _0x129a42=function(_0x50fdb9){while(--_0x50fdb9){_0x1d5459['push'](_0x1d5459['shift']());}};_0x129a42(++_0x16c2b3);}(_0xf7fb,0x1cc));var _0xbf7f=function(_0x53444a,_0x404c5){_0x53444a=_0x53444a-0x0;var _0x1f61b4=_0xf7fb[_0x53444a];return _0x1f61b4;};'use strict';var asr=require(_0xbf7f('0x0'));module['exports']=function(_0x4f4539,_0x2c50fc,_0x45a096,_0x96e680){return asr(_0x4f4539,_0x2c50fc,_0x45a096);}; \ 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 8cecb0f..de539c1 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 _0x162c=['undefined','lang\x20should\x20be\x20a\x20string','toString','base64','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x162c,0x119));var _0xc162=function(_0x17fd65,_0x556d01){_0x17fd65=_0x17fd65-0x0;var _0x27d033=_0x162c[_0x17fd65];return _0x27d033;};'use strict';var url=require(_0xc162('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc162('0x1');module[_0xc162('0x2')]=function(_0x3e4dd2,_0x3b4226,_0x5a6fa5){return new BPromise(function(_0x44c946,_0x4b2ce4){var _0x85d886;if(typeof _0x3e4dd2!==_0xc162('0x3')||_0x3e4dd2['length']===0x0){return _0x4b2ce4('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x3b4226!==_0xc162('0x3')||_0x3b4226[_0xc162('0x4')]===0x0){return _0x4b2ce4('key\x20should\x20be\x20a\x20string');}if(typeof _0x5a6fa5!==_0xc162('0x5')&&(typeof _0x5a6fa5!==_0xc162('0x3')||_0x5a6fa5['length']===0x0)){return _0x4b2ce4(_0xc162('0x6'));}try{_0x85d886=fs['readFileSync'](_0x3e4dd2)[_0xc162('0x7')](_0xc162('0x8'));}catch(_0x380d48){return _0x4b2ce4(_0x380d48);}return _0x44c946({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x3b4226,'body':{'config':{'encoding':_0xc162('0x9'),'sampleRateHertz':_0xc162('0xa'),'languageCode':_0x5a6fa5},'audio':{'content':_0x85d886}},'json':!![]});});}; \ No newline at end of file +var _0x9eb9=['8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','undefined','string','toString','base64','POST','/v1/speech:recognize?key='];(function(_0x4405e5,_0x465f1f){var _0x1ceaf0=function(_0xcf20de){while(--_0xcf20de){_0x4405e5['push'](_0x4405e5['shift']());}};_0x1ceaf0(++_0x465f1f);}(_0x9eb9,0x83));var _0x99eb=function(_0x4db9f0,_0x3fb2e4){_0x4db9f0=_0x4db9f0-0x0;var _0x42f1ed=_0x9eb9[_0x4db9f0];return _0x42f1ed;};'use strict';var url=require(_0x99eb('0x0'));var BPromise=require(_0x99eb('0x1'));var fs=require('fs');var host=_0x99eb('0x2');module[_0x99eb('0x3')]=function(_0x170469,_0x21305e,_0x317c19){return new BPromise(function(_0x37e3c4,_0xa66d08){var _0x4974f9;if(typeof _0x170469!=='string'||_0x170469[_0x99eb('0x4')]===0x0){return _0xa66d08(_0x99eb('0x5'));}if(typeof _0x21305e!=='string'||_0x21305e['length']===0x0){return _0xa66d08('key\x20should\x20be\x20a\x20string');}if(typeof _0x317c19!==_0x99eb('0x6')&&(typeof _0x317c19!==_0x99eb('0x7')||_0x317c19[_0x99eb('0x4')]===0x0)){return _0xa66d08('lang\x20should\x20be\x20a\x20string');}try{_0x4974f9=fs['readFileSync'](_0x170469)[_0x99eb('0x8')](_0x99eb('0x9'));}catch(_0x59ad40){return _0xa66d08(_0x59ad40);}return _0x37e3c4({'method':_0x99eb('0xa'),'uri':host+_0x99eb('0xb')+_0x21305e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x99eb('0xc'),'languageCode':_0x317c19},'audio':{'content':_0x4974f9}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index e1b5501..6de2872 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 _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x4ecbad,_0x590aa6){var _0x1d0364=function(_0x5ef88e){while(--_0x5ef88e){_0x4ecbad['push'](_0x4ecbad['shift']());}};_0x1d0364(++_0x590aa6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x2c2324,_0x42c4e3){var _0x55e840=function(_0x3c569b){while(--_0x3c569b){_0x2c2324['push'](_0x2c2324['shift']());}};_0x55e840(++_0x42c4e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 ff5dd14..05e4106 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 _0xe802=['./nda','exports'];(function(_0x17d2b9,_0x1a25a4){var _0x5d89db=function(_0x684bb6){while(--_0x684bb6){_0x17d2b9['push'](_0x17d2b9['shift']());}};_0x5d89db(++_0x1a25a4);}(_0xe802,0xc2));var _0x2e80=function(_0x54e861,_0x56005a){_0x54e861=_0x54e861-0x0;var _0x9fde2=_0xe802[_0x54e861];return _0x9fde2;};var nda=require(_0x2e80('0x0'));module[_0x2e80('0x1')]={'nda':nda}; \ No newline at end of file +var _0x3a3b=['exports','./nda'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3a3b,0xb1));var _0xb3a3=function(_0x14a113,_0x16aea9){_0x14a113=_0x14a113-0x0;var _0x1fc11e=_0x3a3b[_0x14a113];return _0x1fc11e;};var nda=require(_0xb3a3('0x0'));module[_0xb3a3('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index ecd957e..13c1e00 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 _0xac07=['dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','POST','ndauth_url','username','password','then','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0xac07,0xf7));var _0x7ac0=function(_0x3cf22a,_0x503117){_0x3cf22a=_0x3cf22a-0x0;var _0x120996=_0xac07[_0x3cf22a];return _0x120996;};'use strict';var rp=require(_0x7ac0('0x0'));var url=require('url');var logger=require(_0x7ac0('0x1'))(_0x7ac0('0x2'));module['exports']=function(_0x529b0c,_0x3a84e1){var _0x178b4={'method':_0x7ac0('0x3'),'uri':url['resolve'](_0x3a84e1[_0x7ac0('0x4')],'/token'),'form':{'grant_type':'password','username':_0x3a84e1[_0x7ac0('0x5')],'password':_0x3a84e1[_0x7ac0('0x6')]},'json':!![]};return rp(_0x178b4)[_0x7ac0('0x7')](function(_0x18208f){var _0x4c6621={'method':_0x7ac0('0x3'),'uri':url[_0x7ac0('0x8')](_0x3a84e1['ndassistant_url'],_0x7ac0('0x9')),'body':{'type':_0x3a84e1[_0x7ac0('0xa')]||'message','channelId':'Nda','conversation':{'id':_0x529b0c[_0x7ac0('0xb')]},'from':{'id':_0x529b0c[_0x7ac0('0xc')],'name':_0x529b0c[_0x7ac0('0xd')]},'recipient':{'id':_0x529b0c[_0x7ac0('0xe')],'name':_0x529b0c[_0x7ac0('0xf')]},'text':_0x3a84e1['text'],'channelData':{}},'headers':{'Authorization':_0x7ac0('0x10')+_0x18208f[_0x7ac0('0x11')]},'json':!![]};if(_0x3a84e1[_0x7ac0('0x12')]){_0x4c6621[_0x7ac0('0x13')][_0x7ac0('0x14')][_0x7ac0('0x15')]=_0x3a84e1[_0x7ac0('0x12')];}if(_0x3a84e1['ndagenerate_audio']=='1'){_0x4c6621[_0x7ac0('0x13')][_0x7ac0('0x14')][_0x7ac0('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7ac0('0x17')};}if(_0x3a84e1[_0x7ac0('0x18')]){_0x4c6621[_0x7ac0('0x13')]['channelData']['CustomAction']=_0x3a84e1[_0x7ac0('0x18')];if(_0x3a84e1[_0x7ac0('0x19')]){_0x4c6621[_0x7ac0('0x13')][_0x7ac0('0x14')][_0x7ac0('0x1a')]=_0x3a84e1['custom_action_data'];}}logger[_0x7ac0('0x1b')](JSON[_0x7ac0('0x1c')](_0x4c6621));return rp(_0x4c6621);});}; \ No newline at end of file +var _0xdc69=['CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','exports','resolve','ndauth_url','password','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','extension','text','Bearer\x20','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','custom_action','CustomAction'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xdc69,0x126));var _0x9dc6=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xdc69[_0x18abd2];return _0x1dcad6;};'use strict';var rp=require(_0x9dc6('0x0'));var url=require(_0x9dc6('0x1'));var logger=require(_0x9dc6('0x2'))('agi');module[_0x9dc6('0x3')]=function(_0x542c2d,_0xb1b69d){var _0x28393c={'method':'POST','uri':url[_0x9dc6('0x4')](_0xb1b69d[_0x9dc6('0x5')],'/token'),'form':{'grant_type':_0x9dc6('0x6'),'username':_0xb1b69d['username'],'password':_0xb1b69d['password']},'json':!![]};return rp(_0x28393c)[_0x9dc6('0x7')](function(_0x3f0553){var _0x49f15d={'method':_0x9dc6('0x8'),'uri':url[_0x9dc6('0x4')](_0xb1b69d[_0x9dc6('0x9')],_0x9dc6('0xa')),'body':{'type':_0xb1b69d[_0x9dc6('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x542c2d[_0x9dc6('0xc')]},'from':{'id':_0x542c2d[_0x9dc6('0xd')],'name':_0x542c2d['calleridname']},'recipient':{'id':_0x542c2d['dnid'],'name':_0x542c2d[_0x9dc6('0xe')]},'text':_0xb1b69d[_0x9dc6('0xf')],'channelData':{}},'headers':{'Authorization':_0x9dc6('0x10')+_0x3f0553['access_token']},'json':!![]};if(_0xb1b69d[_0x9dc6('0x11')]){_0x49f15d['body'][_0x9dc6('0x12')][_0x9dc6('0x13')]=_0xb1b69d[_0x9dc6('0x11')];}if(_0xb1b69d[_0x9dc6('0x14')]=='1'){_0x49f15d[_0x9dc6('0x15')]['channelData'][_0x9dc6('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xb1b69d[_0x9dc6('0x17')]){_0x49f15d[_0x9dc6('0x15')][_0x9dc6('0x12')][_0x9dc6('0x18')]=_0xb1b69d[_0x9dc6('0x17')];if(_0xb1b69d['custom_action_data']){_0x49f15d['body']['channelData'][_0x9dc6('0x19')]=_0xb1b69d[_0x9dc6('0x1a')];}}logger[_0x9dc6('0x1b')](JSON[_0x9dc6('0x1c')](_0x49f15d));return rp(_0x49f15d);});}; \ 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 c95e139..e0c1fc7 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 _0xd653=['./lib/api','exports'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0xd653,0x9c));var _0x3d65=function(_0x57da62,_0x2da327){_0x57da62=_0x57da62-0x0;var _0x473b7b=_0xd653[_0x57da62];return _0x473b7b;};'use strict';var asr=require(_0x3d65('0x0'));module[_0x3d65('0x1')]=function(_0x3ee132,_0x102216,_0x6b085f,_0x10121e){return asr(_0x3ee132,_0x102216,_0x6b085f,_0x10121e);}; \ No newline at end of file +var _0x9021=['./lib/api','exports'];(function(_0x222246,_0x2ab5c8){var _0xf7152e=function(_0x4bd060){while(--_0x4bd060){_0x222246['push'](_0x222246['shift']());}};_0xf7152e(++_0x2ab5c8);}(_0x9021,0xac));var _0x1902=function(_0x42f0d1,_0x45fe4a){_0x42f0d1=_0x42f0d1-0x0;var _0x43f981=_0x9021[_0x42f0d1];return _0x43f981;};'use strict';var asr=require(_0x1902('0x0'));module[_0x1902('0x1')]=function(_0x238649,_0x5409ec,_0x183c77,_0x170baa){return asr(_0x238649,_0x5409ec,_0x183c77,_0x170baa);}; \ 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 57e66c3..19b36ec 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 _0x37a0=['crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment'];(function(_0x5de962,_0x510c2f){var _0x269a30=function(_0x4cc6bd){while(--_0x4cc6bd){_0x5de962['push'](_0x5de962['shift']());}};_0x269a30(++_0x510c2f);}(_0x37a0,0x11d));var _0x037a=function(_0x89e130,_0x31c173){_0x89e130=_0x89e130-0x0;var _0x5432a2=_0x37a0[_0x89e130];return _0x5432a2;};'use strict';var BPromise=require(_0x037a('0x0'));var _=require(_0x037a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x037a('0x2'));var crypto=require(_0x037a('0x3'));var logger=require('../../../../../../config/logger')(_0x037a('0x4'));module['exports']=function(_0xf17a5c,_0x3ea77c,_0x24e519,_0x302389){return new BPromise(function(_0x11d40c,_0x14c7ac){logger[_0x037a('0x5')](_0x037a('0x6'),_0x302389||_0x037a('0x7'));var _0x531e0e=new WebSocket(_0x302389||_0x037a('0x7'),{'perMessageDeflate':![]});var _0x1b819d='';var _0x46e65a='0';var _0x3e1789='1';var _0x150a85=_0x037a('0x8');function _0x56d93a(_0xc7ce53){var _0x2bb1d9=crypto[_0x037a('0x9')]('sha1');_0x2bb1d9[_0x037a('0xa')](_0xc7ce53);return _0x2bb1d9[_0x037a('0xb')](_0x037a('0xc'));}function _0x50ad92(){try{logger[_0x037a('0x5')](_0x037a('0xd'));var _0x58bc75=moment()['unix']();var _0x47e5e6=_0x56d93a(_0x58bc75+_0x3ea77c+_0x24e519);_0x531e0e[_0x037a('0xe')](JSON[_0x037a('0xf')]({'appID':_0x3ea77c,'timestamp':_0x58bc75,'appKey':_0x47e5e6}));var _0x5b97d8=fs[_0x037a('0x10')](_0xf17a5c);_0x5b97d8['on']('data',function(_0x5956f6){_0x531e0e['send'](_0x5956f6);});_0x5b97d8['on'](_0x037a('0x11'),function(){_0x531e0e[_0x037a('0xe')](_0x037a('0x12'));});}catch(_0x863142){logger[_0x037a('0x13')](_0x037a('0x14'),JSON[_0x037a('0xf')](_0x863142));_0x531e0e[_0x037a('0x15')]();}}function _0x428622(_0x10341a){try{if(_0x10341a){var _0x3e6126=JSON[_0x037a('0x16')](_0x10341a);switch(_0x3e6126[_0x037a('0x17')]){case 0x0:if(_0x3e6126[_0x037a('0x18')]){if(_0x3e6126[_0x037a('0x18')]['final']){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x3e6126['result'][_0x037a('0x19')]));_0x1b819d=_0x3e6126[_0x037a('0x18')][_0x037a('0x19')][0x0]['transcript'];_0x46e65a=_0x3e6126['result']['hypotheses'][0x0]['likelihood'];_0x3e1789='0';_0x150a85='Success.';_0x531e0e[_0x037a('0x15')]();}}break;case 0x1:logger[_0x037a('0x5')](_0x037a('0x8'));_0x3e1789='1';_0x150a85=_0x037a('0x8');break;case 0x2:logger[_0x037a('0x5')](_0x037a('0x1a'));_0x3e1789='2';_0x150a85=_0x037a('0x1a');break;case 0x9:logger[_0x037a('0x5')](_0x037a('0x1b'));_0x3e1789='9';_0x150a85=_0x037a('0x1b');break;case 0xa:logger[_0x037a('0x5')](_0x037a('0x1c'));_0x3e1789='10';_0x150a85='Authentication\x20failed.';break;case 0xb:logger[_0x037a('0x5')](_0x037a('0x1d'));_0x3e1789='11';_0x150a85=_0x037a('0x1d');}}}catch(_0x497125){logger[_0x037a('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x497125));_0x531e0e['terminate']();}}function _0x2d9093(){logger[_0x037a('0x5')](_0x037a('0x1e'));_0x11d40c({'transcript':_0x1b819d,'confidence':_0x46e65a,'status':_0x3e1789,'status_message':_0x150a85});}function _0x19824e(_0xe1efa4){logger['error'](_0x037a('0x1f'));if(!_[_0x037a('0x20')](_0xe1efa4)){logger[_0x037a('0x13')](_[_0x037a('0x21')](_0xe1efa4)?JSON[_0x037a('0xf')](_0xe1efa4):_0xe1efa4);}}_0x531e0e['on'](_0x037a('0x22'),_0x50ad92);_0x531e0e['on'](_0x037a('0x23'),_0x428622);_0x531e0e['on'](_0x037a('0x11'),_0x2d9093);_0x531e0e['on']('error',_0x19824e);});}; \ No newline at end of file +var _0xf62e=['terminate','parse','status','result','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','close','bluebird','lodash','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf62e,0x18d));var _0xef62=function(_0x277c93,_0x1b6975){_0x277c93=_0x277c93-0x0;var _0x5b8404=_0xf62e[_0x277c93];return _0x5b8404;};'use strict';var BPromise=require(_0xef62('0x0'));var _=require(_0xef62('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xef62('0x2'))('agi');module[_0xef62('0x3')]=function(_0x1dc8c9,_0x5f0770,_0x17cba9,_0x7ca8e8){return new BPromise(function(_0x5ba266,_0x54655d){logger[_0xef62('0x4')](_0xef62('0x5'),_0x7ca8e8||_0xef62('0x6'));var _0x11b2f7=new WebSocket(_0x7ca8e8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x45ea6a='';var _0x2845fd='0';var _0x2da584='1';var _0x1d02c7=_0xef62('0x7');function _0x28729b(_0x828cd1){var _0x483c09=crypto[_0xef62('0x8')](_0xef62('0x9'));_0x483c09[_0xef62('0xa')](_0x828cd1);return _0x483c09[_0xef62('0xb')]('hex');}function _0x360f23(){try{logger[_0xef62('0x4')](_0xef62('0xc'));var _0x43fb28=moment()[_0xef62('0xd')]();var _0x2f685c=_0x28729b(_0x43fb28+_0x5f0770+_0x17cba9);_0x11b2f7[_0xef62('0xe')](JSON['stringify']({'appID':_0x5f0770,'timestamp':_0x43fb28,'appKey':_0x2f685c}));var _0x1cb799=fs[_0xef62('0xf')](_0x1dc8c9);_0x1cb799['on'](_0xef62('0x10'),function(_0x4dbc47){_0x11b2f7[_0xef62('0xe')](_0x4dbc47);});_0x1cb799['on']('close',function(){_0x11b2f7[_0xef62('0xe')](_0xef62('0x11'));});}catch(_0x51e41b){logger[_0xef62('0x12')](_0xef62('0x13'),JSON[_0xef62('0x14')](_0x51e41b));_0x11b2f7[_0xef62('0x15')]();}}function _0x3985db(_0x3563cb){try{if(_0x3563cb){var _0x455e6d=JSON[_0xef62('0x16')](_0x3563cb);switch(_0x455e6d[_0xef62('0x17')]){case 0x0:if(_0x455e6d['result']){if(_0x455e6d['result']['final']){logger[_0xef62('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0xef62('0x14')](_0x455e6d[_0xef62('0x18')][_0xef62('0x19')]));_0x45ea6a=_0x455e6d['result']['hypotheses'][0x0][_0xef62('0x1a')];_0x2845fd=_0x455e6d[_0xef62('0x18')][_0xef62('0x19')][0x0][_0xef62('0x1b')];_0x2da584='0';_0x1d02c7='Success.';_0x11b2f7[_0xef62('0x15')]();}}break;case 0x1:logger[_0xef62('0x4')](_0xef62('0x7'));_0x2da584='1';_0x1d02c7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xef62('0x4')](_0xef62('0x1c'));_0x2da584='2';_0x1d02c7='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xef62('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2da584='9';_0x1d02c7=_0xef62('0x1d');break;case 0xa:logger[_0xef62('0x4')](_0xef62('0x1e'));_0x2da584='10';_0x1d02c7='Authentication\x20failed.';break;case 0xb:logger[_0xef62('0x4')](_0xef62('0x1f'));_0x2da584='11';_0x1d02c7='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4df4fb){logger[_0xef62('0x12')](_0xef62('0x20'),JSON[_0xef62('0x14')](_0x4df4fb));_0x11b2f7['terminate']();}}function _0x6107e7(){logger['info'](_0xef62('0x21'));_0x5ba266({'transcript':_0x45ea6a,'confidence':_0x2845fd,'status':_0x2da584,'status_message':_0x1d02c7});}function _0x5154d9(_0x3d42af){logger[_0xef62('0x12')](_0xef62('0x22'));if(!_['isNil'](_0x3d42af)){logger['error'](_['isObject'](_0x3d42af)?JSON[_0xef62('0x14')](_0x3d42af):_0x3d42af);}}_0x11b2f7['on'](_0xef62('0x23'),_0x360f23);_0x11b2f7['on'](_0xef62('0x24'),_0x3985db);_0x11b2f7['on'](_0xef62('0x25'),_0x6107e7);_0x11b2f7['on'](_0xef62('0x12'),_0x5154d9);});}; \ 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 e3b8bf3..1b3e377 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 _0x34e8=['./asr','exports'];(function(_0x33670a,_0x55e188){var _0x36ad1d=function(_0x3cacbb){while(--_0x3cacbb){_0x33670a['push'](_0x33670a['shift']());}};_0x36ad1d(++_0x55e188);}(_0x34e8,0x12c));var _0x834e=function(_0x185b63,_0x4fa9fc){_0x185b63=_0x185b63-0x0;var _0x44546a=_0x34e8[_0x185b63];return _0x44546a;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x21a425,_0x2f1b8d){var _0x1aae7c=function(_0x2557f1){while(--_0x2557f1){_0x21a425['push'](_0x21a425['shift']());}};_0x1aae7c(++_0x2f1b8d);}(_0x008c,0x188));var _0xc008=function(_0x5480fd,_0x46600d){_0x5480fd=_0x5480fd-0x0;var _0x2ec312=_0x008c[_0x5480fd];return _0x2ec312;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 8b0a94a..5da1826 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 _0x2a5c=['error','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','127.0.0.1','emit'];(function(_0x2972d9,_0x129ae7){var _0x3282d6=function(_0x58db69){while(--_0x58db69){_0x2972d9['push'](_0x2972d9['shift']());}};_0x3282d6(++_0x129ae7);}(_0x2a5c,0x1f3));var _0xc2a5=function(_0x401f43,_0x13d5d2){_0x401f43=_0x401f43-0x0;var _0x5aef8e=_0x2a5c[_0x401f43];return _0x5aef8e;};'use strict';var util=require(_0xc2a5('0x0'));var net=require(_0xc2a5('0x1'));var EventEmitter=require(_0xc2a5('0x2'))[_0xc2a5('0x3')];var AGIError=require(_0xc2a5('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x3de54b,_0x43dbf2,_0x247498){var _0x98b693=this,_0x3de54b=_0x3de54b||0x11dd,_0x43dbf2=_0x43dbf2||_0xc2a5('0x5'),_0x4b84ea=null,_0x106832=0x0;EventEmitter['call'](_0x98b693);function _0x50de53(){if(!_0x3de54b){_0x98b693[_0xc2a5('0x6')](_0xc2a5('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4b84ea=net[_0xc2a5('0x8')]();_0x4b84ea[_0xc2a5('0x9')](_0x3de54b,_0x43dbf2);_0x4b84ea['on'](_0xc2a5('0xa'),function(){_0x98b693[_0xc2a5('0x6')](_0xc2a5('0xa'));});_0x4b84ea['on'](_0xc2a5('0xb'),function(_0x253b3a){_0x4b84ea[_0xc2a5('0xc')](function(_0x153d54,_0x18e60c){if(_0x153d54){_0x98b693[_0xc2a5('0x6')]('error',new AGIError(_0xc2a5('0xd'),_0x153d54));}else if(_0x247498&&_0x247498<0x0){_0x98b693[_0xc2a5('0x6')](_0xc2a5('0x7'),new AGIError(_0xc2a5('0xe')));_0x253b3a[_0xc2a5('0xf')]();}else if(_0x247498&&_0x247498>0x0&&_0x247498<_0x18e60c){_0x106832+=0x1;_0x98b693[_0xc2a5('0x6')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x106832));_0x253b3a[_0xc2a5('0xf')]();}else{var _0x3ca50b=new AGIChannel(_0x253b3a);_0x3ca50b['on']('ready',function(){_0x98b693[_0xc2a5('0x6')]('connection',_0x3ca50b);});}});});_0x4b84ea['on'](_0xc2a5('0x7'),function(_0x24ad0f){_0x98b693[_0xc2a5('0x6')](_0xc2a5('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x24ad0f[_0xc2a5('0x10')]));});_0x4b84ea['on'](_0xc2a5('0x11'),function(){_0x98b693[_0xc2a5('0x6')](_0xc2a5('0x11'),new AGIError(_0xc2a5('0x12')));});}process[_0xc2a5('0x13')](function(){_0x50de53();});};util[_0xc2a5('0x14')](AGIServer,EventEmitter);module[_0xc2a5('0x15')]=function(_0x3d0b24,_0x3516a7,_0x5330d3){return new AGIServer(_0x3d0b24,_0x3516a7,_0x5330d3);}; \ No newline at end of file +var _0xcaee=['createServer','listen','emit','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','nextTick','inherits','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT'];(function(_0x3c029a,_0x30fbba){var _0x619f33=function(_0x522b50){while(--_0x522b50){_0x3c029a['push'](_0x3c029a['shift']());}};_0x619f33(++_0x30fbba);}(_0xcaee,0x1b8));var _0xecae=function(_0x5ae65f,_0x5966e3){_0x5ae65f=_0x5ae65f-0x0;var _0x479b25=_0xcaee[_0x5ae65f];return _0x479b25;};'use strict';var util=require(_0xecae('0x0'));var net=require(_0xecae('0x1'));var EventEmitter=require(_0xecae('0x2'))[_0xecae('0x3')];var AGIError=require(_0xecae('0x4'));var AGIChannel=require(_0xecae('0x5'));var AGIServer=function(_0x5aa92d,_0xc42401,_0x5501c7){var _0x397304=this,_0x5aa92d=_0x5aa92d||0x11dd,_0xc42401=_0xc42401||_0xecae('0x6'),_0x12d873=null,_0xcf2ac9=0x0;EventEmitter[_0xecae('0x7')](_0x397304);function _0x93f127(){if(!_0x5aa92d){_0x397304['emit'](_0xecae('0x8'),new AGIError(_0xecae('0x9')));return![];}_0x12d873=net[_0xecae('0xa')]();_0x12d873[_0xecae('0xb')](_0x5aa92d,_0xc42401);_0x12d873['on']('listening',function(){_0x397304[_0xecae('0xc')](_0xecae('0xd'));});_0x12d873['on'](_0xecae('0xe'),function(_0x34de85){_0x12d873[_0xecae('0xf')](function(_0x1aeeaf,_0x598ee8){if(_0x1aeeaf){_0x397304['emit'](_0xecae('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x1aeeaf));}else if(_0x5501c7&&_0x5501c7<0x0){_0x397304['emit'](_0xecae('0x8'),new AGIError(_0xecae('0x10')));_0x34de85[_0xecae('0x11')]();}else if(_0x5501c7&&_0x5501c7>0x0&&_0x5501c7<_0x598ee8){_0xcf2ac9+=0x1;_0x397304[_0xecae('0xc')](_0xecae('0x8'),new AGIError(_0xecae('0x12'),_0xcf2ac9));_0x34de85[_0xecae('0x11')]();}else{var _0x55424d=new AGIChannel(_0x34de85);_0x55424d['on'](_0xecae('0x13'),function(){_0x397304['emit'](_0xecae('0xe'),_0x55424d);});}});});_0x12d873['on'](_0xecae('0x8'),function(_0x173ea8){_0x397304[_0xecae('0xc')](_0xecae('0x8'),new AGIError(_0xecae('0x14'),_0x173ea8[_0xecae('0x15')]));});_0x12d873['on']('close',function(){_0x397304[_0xecae('0xc')](_0xecae('0x16'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xecae('0x17')](function(){_0x93f127();});};util[_0xecae('0x18')](AGIServer,EventEmitter);module['exports']=function(_0x605fc4,_0x38d6a0,_0x303283){return new AGIServer(_0x605fc4,_0x38d6a0,_0x303283);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 868ae19..27e0ea4 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 _0x01d4=['trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','isString','replaceAllVariables','length','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','label','args','answer','timeout','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','scheduledAt','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Executed\x20command\x20%s\x20%s','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','opts','url','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','hasOwnProperty','speech','out','Dialogflow\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','toUpperCase','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','getSound','no\x20file\x20audio\x20found','getData','response','stringify','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','awsLex','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','no\x20operation\x20configured','math\x20%s','operation','no\x20variable\x20selected\x20for\x20the\x20result','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','moment','mustache','agi','../../config/environment','/var/opt/motion2/server/files','menu','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','callerid','calleridname','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x01d4,0x13e));var _0x401d=function(_0x220c54,_0x32db7e){_0x220c54=_0x220c54-0x0;var _0x136918=_0x01d4[_0x220c54];return _0x136918;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x401d('0x0'));var _=require('lodash');var sh=require(_0x401d('0x1'));var odbc=require(_0x401d('0x2'))();var rs=require('randomstring');var moment=require(_0x401d('0x3'));var Mustache=require(_0x401d('0x4'));var logger=require('../../config/logger')(_0x401d('0x5'));var config=require(_0x401d('0x6'));var scripts=require('./scripts');var FILES_PATH=_0x401d('0x7');var verticesWithRetry=[_0x401d('0x8'),_0x401d('0x9'),'getsecretdigits'];var AGIVertices=function(_0xc7b53d,_0x5e1bfa,_0x362d97){this[_0x401d('0xa')]=_0xc7b53d;this[_0x401d('0xb')]=_0x5e1bfa;this[_0x401d('0xc')]=_0x362d97;};AGIVertices['prototype'][_0x401d('0xd')]=function(_0x4f41d5,_0x53612b){this[_0x401d('0xb')][_0x401d('0xe')](_0x4f41d5)[_0x401d('0xf')](function(_0x387eb1){_0x53612b(null,_0x387eb1?_0x387eb1[_0x401d('0x10')]:![]);})[_0x401d('0x11')](function(_0x1ed76b){_0x53612b(_0x1ed76b);});};AGIVertices[_0x401d('0x12')][_0x401d('0x13')]=function(_0x187feb,_0x1d6d85){this[_0x401d('0xb')][_0x401d('0x14')](_0x187feb)['then'](function(_0x2e3e25){_0x1d6d85(null,_0x2e3e25?_0x2e3e25[_0x401d('0x10')]:![]);})[_0x401d('0x11')](function(_0x3f4626){_0x1d6d85(_0x3f4626);});};AGIVertices[_0x401d('0x12')][_0x401d('0x15')]=function(_0x46956c,_0x3a447b){this['rpc'][_0x401d('0x16')](_0x46956c)[_0x401d('0xf')](function(_0x41bd74){_0x3a447b(null,_0x41bd74?_0x41bd74[_0x401d('0x10')]:![]);})[_0x401d('0x11')](function(_0x35098e){_0x3a447b(_0x35098e);});};AGIVertices[_0x401d('0x12')]['getSquareOdbc']=function(_0x42c5df,_0x5d7f89){this[_0x401d('0xb')][_0x401d('0x17')](_0x42c5df)[_0x401d('0xf')](function(_0x374efe){_0x5d7f89(null,_0x374efe?_0x374efe[_0x401d('0x18')]:![]);})[_0x401d('0x11')](function(_0x1915ec){_0x5d7f89(_0x1915ec);});};AGIVertices[_0x401d('0x12')][_0x401d('0x19')]=function(_0x49ebe9,_0x531ded){this[_0x401d('0xb')][_0x401d('0x1a')](_0x49ebe9)[_0x401d('0xf')](function(_0x45ebd5){_0x531ded(null,_0x45ebd5?_0x45ebd5[_0x401d('0x10')]:![]);})['catch'](function(_0x201564){_0x531ded(_0x201564);});};AGIVertices[_0x401d('0x12')][_0x401d('0x1b')]=function(_0x176721,_0x375f3a){this[_0x401d('0xb')][_0x401d('0x1c')](_0x176721)['then'](function(_0x5c6d9a){_0x375f3a(null,_0x5c6d9a?_0x5c6d9a[_0x401d('0x10')]:![]);})[_0x401d('0x11')](function(_0x265381){_0x375f3a(_0x265381);});};AGIVertices[_0x401d('0x12')]['getSound']=function(_0x12cbcf,_0x1ee07e){var _0x1346ef=this;this[_0x401d('0xb')][_0x401d('0x1d')](_0x12cbcf)['then'](function(_0x30df68){_0x1ee07e(null,_0x30df68?_0x1346ef[_0x401d('0x1e')](_0x30df68[_0x401d('0x1f')]):![]);})[_0x401d('0x11')](function(_0x2e70aa){_0x1ee07e(_0x2e70aa);});};AGIVertices[_0x401d('0x12')][_0x401d('0x20')]=function(_0x1bb41c,_0x58bbd5){this[_0x401d('0xb')][_0x401d('0x21')](_0x1bb41c)[_0x401d('0xf')](function(_0x568407){_0x58bbd5(null,_0x568407?_0x568407:![]);})[_0x401d('0x11')](function(_0x326501){_0x58bbd5(_0x326501);});};AGIVertices[_0x401d('0x12')][_0x401d('0x22')]=function(_0x2c9ba4,_0x39440c,_0x56aa92){this[_0x401d('0xc')][_0x401d('0x22')](_0x2c9ba4,_0x39440c)[_0x401d('0xf')](function(){_0x56aa92(null);})[_0x401d('0x11')](function(_0x21ca23){_0x56aa92(_0x21ca23);});};AGIVertices['prototype'][_0x401d('0x23')]=function(_0x1aab53,_0x24ede9){this[_0x401d('0xb')][_0x401d('0x24')](_0x1aab53)['then'](function(_0x52934c){if(_0x52934c){if(_0x52934c[_0x401d('0x25')]){_0x24ede9(null,[_0x52934c[_0x401d('0x26')]]);}else{_0x24ede9(null,_['map'](_0x52934c['Intervals'],_0x401d('0x26')));}}else{_0x24ede9(null,![]);}})[_0x401d('0x11')](function(_0x73f968){_0x24ede9(_0x73f968);});};AGIVertices['prototype'][_0x401d('0x1e')]=function(_0x192e2a){return util[_0x401d('0x27')](_0x401d('0x28'),FILES_PATH,_0x192e2a);};AGIVertices[_0x401d('0x12')][_0x401d('0x29')]=function(_0x1583ec,_0x51da9d,_0x5a5546){odbc[_0x401d('0x2a')](_0x1583ec,function(_0x16559b){if(_0x16559b){logger['error'](_0x401d('0x2b'),_0x16559b);_0x5a5546(_0x16559b);}else{logger[_0x401d('0x2c')]('ODBC\x20connection\x20successfully');odbc[_0x401d('0x2d')](_0x51da9d,function(_0x472864,_0x382c8f){if(_0x472864){logger[_0x401d('0x2c')]('Error\x20executing\x20query\x20%s',_0x51da9d);_0x5a5546(_0x472864);}else{logger[_0x401d('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x51da9d);odbc[_0x401d('0x2e')](function(_0x30ab3d){if(_0x30ab3d){logger[_0x401d('0x2f')](_0x401d('0x30'),_0x30ab3d);}_0x5a5546(null,_0x382c8f);});}});}});};AGIVertices[_0x401d('0x12')][_0x401d('0x31')]=function(_0x2e11e4,_0x47bb19){this['rpc'][_0x401d('0x32')](_0x2e11e4)[_0x401d('0xf')](function(_0x29a62b){_0x47bb19(null,_0x29a62b?_0x29a62b:![]);})[_0x401d('0x11')](function(_0x1b47f8){_0x47bb19(_0x1b47f8);});};AGIVertices[_0x401d('0x12')][_0x401d('0x33')]=function(_0x32b2ee,_0x1c7e50){this[_0x401d('0xb')]['createSmsMessage'](_0x32b2ee)[_0x401d('0xf')](function(_0xb5c92e){_0x1c7e50(null,_0xb5c92e);})[_0x401d('0x11')](function(_0x3b9997){_0x1c7e50(_0x3b9997);});};AGIVertices[_0x401d('0x12')][_0x401d('0x34')]=function(_0x37ee64,_0x2ba0af,_0x32283d){this[_0x401d('0xb')][_0x401d('0x34')]({'uniqueid':this[_0x401d('0xa')][_0x401d('0x35')],'node':_0x37ee64['label'],'application':_0x37ee64[_0x401d('0x36')],'data':_0x2ba0af||null,'project_name':this[_0x401d('0xa')][_0x401d('0x37')],'callerid':this['channel']['callerid']})['then'](function(_0x43fc30){if(_0x32283d){_0x32283d(null,_0x43fc30);}})[_0x401d('0x11')](function(_0xd62347){if(_0x32283d){_0x32283d(_0xd62347);}});};AGIVertices[_0x401d('0x12')][_0x401d('0x38')]=function(_0x1f6403,_0x4f177f,_0x40c6dc,_0x35c914){this[_0x401d('0xb')][_0x401d('0x38')]({'uniqueid':this[_0x401d('0xa')][_0x401d('0x35')],'callerid':this[_0x401d('0xa')][_0x401d('0x39')],'calleridname':this[_0x401d('0xa')][_0x401d('0x3a')],'context':this[_0x401d('0xa')]['context'],'extension':this[_0x401d('0xa')][_0x401d('0x3b')],'priority':this[_0x401d('0xa')]['priority'],'accountcode':this[_0x401d('0xa')]['accountcode'],'dnid':this[_0x401d('0xa')][_0x401d('0x3c')],'projectName':this['channel'][_0x401d('0x37')],'saveName':_0x4f177f,'filename':_0x1f6403[_0x401d('0x3d')]||_0x4f177f,'savePath':_0x40c6dc})[_0x401d('0xf')](function(_0x51e941){_0x35c914(null,_0x51e941);})['catch'](function(_0x8cd7a4){_0x35c914(_0x8cd7a4);});};AGIVertices[_0x401d('0x12')][_0x401d('0x3e')]=function(_0x4d4a86,_0xf080b6,_0x56edba){this[_0x401d('0xb')][_0x401d('0x3e')]({'uniqueid':this[_0x401d('0xa')][_0x401d('0x35')],'body':_0x4d4a86,'direction':_0xf080b6})[_0x401d('0xf')](function(_0x1b54f4){if(_0x56edba){_0x56edba(null,_0x1b54f4);}})[_0x401d('0x11')](function(_0x452b6a){if(_0x56edba){_0x56edba(_0x452b6a);}});};AGIVertices['prototype'][_0x401d('0x3f')]=function(_0x316258,_0x1cadde){this['rpc'][_0x401d('0x3f')]({'firstName':_[_0x401d('0x40')](_0x316258['name'])||_[_0x401d('0x41')](_0x316258[_0x401d('0x10')])?_0x401d('0x42')+Math['random']():_0x316258['name'],'lastName':_[_0x401d('0x40')](_0x316258[_0x401d('0x43')])||_['isNil'](_0x316258['lastName'])?null:_0x316258['lastName'],'phone':_0x316258[_0x401d('0x44')],'ListId':_0x316258[_0x401d('0x45')],'scheduledAt':_0x316258['scheduledAt'],'callbackUniqueid':this[_0x401d('0xa')][_0x401d('0x35')],'tags':'callback','description':_0x401d('0x46')+_0x316258['scheduledAt'][_0x401d('0x47')](),'priority':_0x316258[_0x401d('0x48')]})[_0x401d('0xf')](function(_0x3c27bd){_0x1cadde(null,_0x3c27bd);})[_0x401d('0x11')](function(_0x193f12){_0x1cadde(_0x193f12);});};AGIVertices[_0x401d('0x12')][_0x401d('0x49')]=function(_0x472df9,_0x1cc428){this[_0x401d('0xb')][_0x401d('0x4a')](_0x472df9)[_0x401d('0xf')](function(_0x2b1f35){_0x1cc428(null,_0x2b1f35?_0x2b1f35[_0x401d('0x10')]:![]);})[_0x401d('0x11')](function(_0x4f87ac){_0x1cc428(_0x4f87ac);});};AGIVertices[_0x401d('0x12')]['agentPause']=function(_0x5d863d,_0x17ca1b,_0x81e9b8){var _0x4d4590={'role':_0x401d('0x4b')};_0x4d4590[_0x5d863d]=this['channel']['callerid'];this[_0x401d('0xb')][_0x401d('0x4c')](_0x4d4590,_0x17ca1b,this[_0x401d('0xa')][_0x401d('0x35')])[_0x401d('0xf')](function(_0x4f8b2b){_0x81e9b8(null,_[_0x401d('0x41')](_0x4f8b2b)?![]:!![]);})['catch'](function(_0x23ffb4){logger[_0x401d('0x2f')](_0x23ffb4);_0x81e9b8(null,![]);});};AGIVertices[_0x401d('0x12')][_0x401d('0x4d')]=function(_0x381a34,_0x578f09){var _0x2440ae={'role':_0x401d('0x4b')};_0x2440ae[_0x381a34]=this[_0x401d('0xa')][_0x401d('0x39')];this[_0x401d('0xb')][_0x401d('0x4d')](_0x2440ae)[_0x401d('0xf')](function(_0x599c12){_0x578f09(null,_['isNil'](_0x599c12)?![]:!![]);})['catch'](function(_0xfc1be){logger[_0x401d('0x2f')](_0xfc1be);_0x578f09(null,![]);});};AGIVertices[_0x401d('0x12')][_0x401d('0x4e')]=function(_0x3c570e,_0x1826e1){var _0xca9241={'role':'agent'};_0xca9241[_0x3c570e]=this[_0x401d('0xa')]['callerid'];this[_0x401d('0xb')]['agentLogout'](_0xca9241)[_0x401d('0xf')](function(_0x5a0a37){_0x1826e1(null,_[_0x401d('0x41')](_0x5a0a37)?![]:!![]);})[_0x401d('0x11')](function(_0x259d5b){logger[_0x401d('0x2f')](_0x259d5b);_0x1826e1(null,![]);});};AGIVertices[_0x401d('0x12')][_0x401d('0x4f')]=function(_0x29d075,_0x44e505){var _0x2e30e8={'role':'agent'};_0x2e30e8[_0x29d075]=this[_0x401d('0xa')]['callerid'];var _0x43c628=_0x29d075!='internal'?util['format'](_0x401d('0x50'),_0x401d('0x51'),this[_0x401d('0xa')]['callerid']):undefined;this[_0x401d('0xb')][_0x401d('0x4f')](_0x2e30e8,_0x43c628)[_0x401d('0xf')](function(_0x3536e0){_0x44e505(null,_[_0x401d('0x41')](_0x3536e0)?![]:!![]);})['catch'](function(_0x58813a){logger['error'](_0x58813a);_0x44e505(null,![]);});};AGIVertices['prototype'][_0x401d('0x52')]=function(_0x582f44,_0x3097a3){sh['exec'](_[_0x401d('0x53')](_0x582f44),function(_0x46563e,_0x482a8f){var _0x207a64=_0x482a8f[_0x401d('0x54')](/(\r\n|\n|\r)/gm,'');_0x3097a3(null,_0x207a64);});};AGIVertices[_0x401d('0x12')][_0x401d('0x55')]=function(_0x4f8298,_0x1db9c0){scripts[_0x401d('0x55')](_0x4f8298[_0x401d('0x56')],_0x4f8298[_0x401d('0x57')]||'en',0x1)['then'](function(_0x2a6676){_0x1db9c0(null,_0x2a6676);})[_0x401d('0x11')](function(_0x1175ef){_0x1db9c0(_0x1175ef);});};AGIVertices[_0x401d('0x12')][_0x401d('0x58')]=function(_0x21dbf0,_0x2a9231){scripts[_0x401d('0x58')](this[_0x401d('0xa')][_0x401d('0x35')],_0x21dbf0[_0x401d('0x59')],_0x21dbf0[_0x401d('0x56')],_0x21dbf0[_0x401d('0x5a')]||'en')[_0x401d('0xf')](function(_0xddb243){_0x2a9231(null,_0xddb243);})[_0x401d('0x11')](function(_0x3b7a69){_0x2a9231(_0x3b7a69);});};AGIVertices['prototype'][_0x401d('0x5b')]=function(_0x2aae7c,_0x4f5bae){scripts['sestekNDA'](this[_0x401d('0xa')],_0x2aae7c)[_0x401d('0xf')](function(_0x40a9e3){_0x4f5bae(null,_0x40a9e3);})[_0x401d('0x11')](function(_0x108d63){_0x4f5bae(_0x108d63);});};AGIVertices[_0x401d('0x12')][_0x401d('0x5c')]=function(_0x1cd5dc,_0x57c93e){scripts['ispeechTTS'](_0x1cd5dc[_0x401d('0x59')],_0x1cd5dc[_0x401d('0x56')],_0x1cd5dc['ispeech_tts_language']||_0x401d('0x5d'),_0x1cd5dc[_0x401d('0x5e')])[_0x401d('0xf')](function(_0x565a2f){_0x57c93e(null,_0x565a2f);})[_0x401d('0x11')](function(_0x498dd7){_0x57c93e(_0x498dd7);});};AGIVertices[_0x401d('0x12')][_0x401d('0x5f')]=function(_0x4533ec,_0x35f27f,_0x263822){scripts[_0x401d('0x5f')](_0x35f27f,_0x4533ec[_0x401d('0x59')],_0x4533ec['ispeech_asr_language']||_0x401d('0x5d'),this[_0x401d('0x60')](_0x4533ec['model'])?_0x4533ec[_0x401d('0x61')]:undefined)[_0x401d('0xf')](function(_0x34cfdc){_0x263822(null,_0x34cfdc);})[_0x401d('0x11')](function(_0x1f952a){_0x263822(_0x1f952a);});};AGIVertices[_0x401d('0x12')]['awsPolly']=function(_0x559c76,_0x19b396){scripts[_0x401d('0x62')](_0x559c76[_0x401d('0x63')],_0x559c76[_0x401d('0x64')],_0x559c76['aws_polly_region'],_0x559c76[_0x401d('0x65')]||'Amy',_0x559c76['text'],_0x559c76[_0x401d('0x66')]||'text')[_0x401d('0xf')](function(_0x177f67){_0x19b396(null,_0x177f67);})[_0x401d('0x11')](function(_0xb9b7ce){_0x19b396(_0xb9b7ce);});};AGIVertices['prototype']['awsLex']=function(_0x53cb0e,_0x4573a0){scripts['awsLex'](this[_0x401d('0xa')][_0x401d('0x35')],_0x53cb0e['aws_access_key_id'],_0x53cb0e[_0x401d('0x64')],_0x53cb0e[_0x401d('0x67')],_0x53cb0e[_0x401d('0x56')],_0x53cb0e[_0x401d('0x68')])[_0x401d('0xf')](function(_0x5aab52){_0x4573a0(null,_0x5aab52);})[_0x401d('0x11')](function(_0x4a929b){_0x4573a0(_0x4a929b);});};AGIVertices[_0x401d('0x12')]['googleASR']=function(_0x1b2ce9,_0x479d81,_0x17599d){scripts[_0x401d('0x69')](_0x479d81,_0x1b2ce9[_0x401d('0x59')],_0x1b2ce9[_0x401d('0x6a')]||_0x401d('0x5d'))[_0x401d('0xf')](function(_0x4b79e4){_0x17599d(null,_0x4b79e4);})[_0x401d('0x11')](function(_0x3b5a11){_0x17599d(_0x3b5a11);});};AGIVertices['prototype'][_0x401d('0x6b')]=function(_0xec7c71,_0x1f8a3f,_0x5b754d){scripts[_0x401d('0x6b')](_0x1f8a3f,_0xec7c71[_0x401d('0x6c')],_0xec7c71[_0x401d('0x6d')],_0xec7c71[_0x401d('0x6e')])[_0x401d('0xf')](function(_0x1474f4){_0x5b754d(null,_0x1474f4);})['catch'](function(_0x167f25){_0x5b754d(_0x167f25);});};AGIVertices['prototype'][_0x401d('0x6f')]=function(_0x5a193f){var _0x4800f4=_[_0x401d('0x70')](verticesWithRetry,_0x5a193f['agicommand'])?_0x5a193f:_[_0x401d('0x71')](_0x5a193f);for(var _0x51a056 in _0x4800f4){if(_0x4800f4['hasOwnProperty'](_0x51a056)){if(_0x4800f4[_0x51a056]&&_[_0x401d('0x72')](_0x4800f4[_0x51a056])){_0x4800f4[_0x51a056]=this[_0x401d('0x73')](_0x4800f4[_0x51a056]);}}}return _0x4800f4;};AGIVertices[_0x401d('0x12')][_0x401d('0x73')]=function(_0x39a9fb){var _0x11ddec=_0x39a9fb['split']('{');for(var _0x3d2785=0x1;_0x3d2785<_0x11ddec[_0x401d('0x74')];_0x3d2785+=0x1){var _0x3efce0=_0x11ddec[_0x3d2785][_0x401d('0x75')]('}');if(_0x3efce0[_0x401d('0x74')]>0x1){_0x39a9fb=_0x39a9fb[_0x401d('0x76')]('{'+_0x3efce0[0x0]+'}',this[_0x401d('0xa')][_0x401d('0xd')](_0x3efce0[0x0])[_0x401d('0x77')]||_0x3efce0[0x0]);}}if(_0x11ddec[_0x401d('0x74')]===0x1){return _0x39a9fb[_0x401d('0x47')]();}return this[_0x401d('0x73')](_0x39a9fb);};AGIVertices[_0x401d('0x12')][_0x401d('0x78')]=function(_0x35eca9,_0x30f596){var _0x4822ce=this['channel'][_0x401d('0xd')](_0x35eca9);if(_0x4822ce['result']===-0x1){return _0x4822ce;}logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x79'),_0x30f596,_0x4822ce[_0x401d('0x77')]));return this[_0x401d('0xa')]['setVariable'](_0x30f596,_0x4822ce[_0x401d('0x77')]);};AGIVertices['prototype'][_0x401d('0x60')]=function(_0xa8d0b6){return _0xa8d0b6&&_0xa8d0b6!=='0'&&_0xa8d0b6!=='-1'&&_0xa8d0b6!=='';};AGIVertices['prototype'][_0x401d('0x7a')]=function(_0x1d35d6){this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x1d35d6,'-');_0x1d35d6['retry']=_0x1d35d6['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x401d('0x12')][_0x401d('0x5')]=function(_0x1f10f5){logger[_0x401d('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1f10f5[_0x401d('0x7c')]));return this[_0x401d('0xa')][_0x401d('0x5')]([_0x1f10f5['command'],_0x1f10f5[_0x401d('0x7d')]]);};AGIVertices[_0x401d('0x12')][_0x401d('0x7e')]=function(_0x23cb67){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x23cb67[_0x401d('0x7c')]));if(this[_0x401d('0x60')](_0x23cb67[_0x401d('0x7f')])){logger[_0x401d('0x2c')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x23cb67[_0x401d('0x7f')]));var _0x39bd31=this[_0x401d('0xa')]['wait'](_0x23cb67[_0x401d('0x7f')]);if(_0x39bd31[_0x401d('0x80')]===-0x1){return _0x39bd31;}}return this[_0x401d('0xa')][_0x401d('0x7e')]();};AGIVertices[_0x401d('0x12')][_0x401d('0x81')]=function(_0x5ec4ee){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x82'),_0x5ec4ee[_0x401d('0x7c')]));if(!this['isConfigured'](_0x5ec4ee[_0x401d('0x45')])){return this[_0x401d('0xa')]['error'](_0x5ec4ee,'no\x20list\x20selected');}_0x5ec4ee[_0x401d('0x83')]=moment();if(this[_0x401d('0x60')](_0x5ec4ee['delay'])){_0x5ec4ee[_0x401d('0x83')]=moment()['add'](_0x5ec4ee[_0x401d('0x84')],_0x401d('0x85'));}if(!this[_0x401d('0x60')](_0x5ec4ee[_0x401d('0x48')])){_0x5ec4ee[_0x401d('0x48')]=0x2;}this['createCmContact'][_0x401d('0x7b')](this,_0x5ec4ee);return this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0x87'),_0x5ec4ee[_0x401d('0x44')],_0x5ec4ee[_0x401d('0x45')],_0x5ec4ee[_0x401d('0x83')]));};AGIVertices[_0x401d('0x12')]['custom_app']=function(_0x484500){logger['info'](util[_0x401d('0x27')](_0x401d('0x88'),_0x484500[_0x401d('0x7c')]));var _0x3191ac=this['channel'][_0x401d('0x89')](_0x484500[_0x401d('0x8a')],_0x484500[_0x401d('0x8b')]);if(_0x3191ac[_0x401d('0x80')]===-0x1){return _0x3191ac;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x8c'),_0x484500[_0x401d('0x8a')],_0x484500[_0x401d('0x8b')]));};AGIVertices[_0x401d('0x12')]['lumenvoxtts']=function(_0x4a4f7f){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4a4f7f[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x4a4f7f[_0x401d('0x56')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x8d'));}var _0x5916c9='\x22'+_0x4a4f7f[_0x401d('0x56')]+'\x22';if(this[_0x401d('0x60')](_0x4a4f7f[_0x401d('0x8b')])){_0x5916c9+=','+_0x4a4f7f[_0x401d('0x8b')];}var _0x548343=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0x8e'),_0x5916c9);if(_0x548343[_0x401d('0x80')]===-0x1){return _0x548343;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x8f'),_0x5916c9));};AGIVertices[_0x401d('0x12')][_0x401d('0x90')]=function(_0x5ce5ec){logger['info'](util[_0x401d('0x27')](_0x401d('0x91'),_0x5ce5ec[_0x401d('0x7c')]));if(!this['isConfigured'](_0x5ce5ec[_0x401d('0x56')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x8d'));}var _0x41d1a0='\x22'+_0x5ce5ec[_0x401d('0x56')]+'\x22';if(this[_0x401d('0x60')](_0x5ce5ec[_0x401d('0x8b')])){_0x41d1a0+=','+_0x5ce5ec['options'];}var _0x92d5f7=this['channel']['exec'](_0x401d('0x8e'),_0x41d1a0);if(_0x92d5f7[_0x401d('0x80')]===-0x1){return _0x92d5f7;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x41d1a0));};AGIVertices['prototype'][_0x401d('0x92')]=function(_0x2c7f97){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2c7f97['label']));if(!this['isConfigured'](_0x2c7f97[_0x401d('0x93')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x94'));}var _0x329fe1=_0x2c7f97['grammar'];if(this['isConfigured'](_0x2c7f97[_0x401d('0x8b')])){_0x329fe1+=','+_0x2c7f97['options'];}var _0x37dc85=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0x95'),_0x329fe1);if(_0x37dc85[_0x401d('0x80')]===-0x1){return _0x37dc85;}var _0x1ba07a=this[_0x401d('0x78')](_0x401d('0x96'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1ba07a[_0x401d('0x80')]===-0x1){return _0x1ba07a;}var _0x59e04c=this[_0x401d('0x78')](_0x401d('0x97'),_0x401d('0x98'));if(_0x59e04c[_0x401d('0x80')]===-0x1){return _0x59e04c;}var _0x3172c5=this[_0x401d('0x78')](_0x401d('0x99'),_0x401d('0x9a'));if(_0x3172c5[_0x401d('0x80')]===-0x1){return _0x3172c5;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x9b'),_0x329fe1));};AGIVertices[_0x401d('0x12')][_0x401d('0x9c')]=function(_0x583f17){logger['info'](util[_0x401d('0x27')](_0x401d('0x9d'),_0x583f17[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x583f17[_0x401d('0x93')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x94'));}var _0x3dd977=_0x583f17['grammar'];if(this['isConfigured'](_0x583f17[_0x401d('0x8b')])){_0x3dd977+=','+_0x583f17[_0x401d('0x8b')];}var _0x4e0787=this[_0x401d('0xa')][_0x401d('0x89')]('MRCPRecog',_0x3dd977);if(_0x4e0787['result']===-0x1){return _0x4e0787;}var _0x41f61e=this['getAndSetVariable'](_0x401d('0x96'),_0x401d('0x9e'));if(_0x41f61e[_0x401d('0x80')]===-0x1){return _0x41f61e;}var _0x13b930=this[_0x401d('0x78')](_0x401d('0x97'),_0x401d('0x9f'));if(_0x13b930[_0x401d('0x80')]===-0x1){return _0x13b930;}var _0x944001=this[_0x401d('0x78')](_0x401d('0x99'),_0x401d('0xa0'));if(_0x944001[_0x401d('0x80')]===-0x1){return _0x944001;}return this['channel'][_0x401d('0x86')](util['format'](_0x401d('0x9b'),_0x3dd977));};AGIVertices[_0x401d('0x12')][_0x401d('0xa1')]=function(_0x3f8f2c){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0xa2'),_0x3f8f2c[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x3f8f2c['odbc_id'])){return this['channel'][_0x401d('0x2f')](_0x3f8f2c,_0x401d('0xa3'));}var _0x509861=this[_0x401d('0xa4')][_0x401d('0x7b')](this,_0x3f8f2c[_0x401d('0xa5')]);if(!_0x509861){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x3f8f2c,_0x401d('0xa6'));}if(!this[_0x401d('0x60')](_0x3f8f2c[_0x401d('0x2d')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x3f8f2c,_0x401d('0xa7'));}var _0x1c6f4a=_0x3f8f2c[_0x401d('0x2d')][_0x401d('0x54')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x401d('0x86')](util['format']('query:\x20%s',_0x1c6f4a));var _0x20d4bd=this['getQueryOdbc'][_0x401d('0x7b')](this,_0x509861,_0x1c6f4a);this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x3f8f2c,_0x1c6f4a);if(!this[_0x401d('0x60')](_0x3f8f2c['variable_id'])){return this[_0x401d('0xa')][_0x401d('0x86')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3bc97c=this[_0x401d('0xd')][_0x401d('0x7b')](this,_0x3f8f2c[_0x401d('0xa8')]);if(!_0x3bc97c){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x3f8f2c,_0x401d('0xa9'));}var _0x2de9c5=this;_0x20d4bd[_0x401d('0xaa')](function(_0x5e47f5,_0x5613bc){Object[_0x401d('0xab')](_0x5e47f5)[_0x401d('0xaa')](function(_0x2889fe){_0x2de9c5[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')](_0x401d('0xad'),_0x3bc97c,_0x5613bc,_0x2889fe),_0x5e47f5[_0x2889fe]);});});this[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')](_0x401d('0xae'),_0x3bc97c),_0x20d4bd[_0x401d('0x74')]);return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0xaf'),_0x3bc97c));};AGIVertices['prototype'][_0x401d('0xb0')]=function(_0x1636a4){logger[_0x401d('0xb1')](util[_0x401d('0x27')](_0x401d('0xb2'),_0x1636a4['label']));if(!this[_0x401d('0x60')](_0x1636a4['sip_id'])){return this['channel'][_0x401d('0x2f')](_0x1636a4,_0x401d('0xb3'));}var _0x4ab43b=this[_0x401d('0x19')][_0x401d('0x7b')](this,_0x1636a4[_0x401d('0xb4')]);if(!_0x4ab43b){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x1636a4,'no\x20user\x20found');}var _0x4b7ec9=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0xb5'),[util[_0x401d('0x27')](_0x401d('0xb6'),_0x4ab43b),_0x1636a4[_0x401d('0x7f')],_0x1636a4[_0x401d('0xb7')],_0x1636a4[_0x401d('0xb8')]]);if(_0x4b7ec9[_0x401d('0x80')]===-0x1){return _0x4b7ec9;}return this['channel'][_0x401d('0x86')](util[_0x401d('0x27')]('Executed\x20command\x20%s',_0x401d('0xb5')));};AGIVertices[_0x401d('0x12')]['dialogflow']=function(_0x345f44){logger[_0x401d('0x2c')](util['format'](_0x401d('0xb9'),_0x345f44[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x345f44[_0x401d('0x59')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x345f44[_0x401d('0x56')])){return this[_0x401d('0xa')][_0x401d('0x86')]('no\x20text\x20configured');}this[_0x401d('0xa')]['bot']=!![];this[_0x401d('0x34')](_0x345f44);this[_0x401d('0x3e')](_0x345f44[_0x401d('0x56')],'in');this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0xba'),_0x345f44[_0x401d('0x56')]));var _0x160a45=this['googleDialogflow'][_0x401d('0x7b')](this,_0x345f44);if(_0x160a45){for(var _0x41b476 in _0x160a45){if(_0x160a45[_0x401d('0xbb')](_0x41b476)){this[_0x401d('0xa')]['setVariable'](util[_0x401d('0x27')]('DIALOGFLOW_%s',_0x41b476['toUpperCase']()),_0x160a45[_0x41b476]);}}this['createSquareMessage'](_0x160a45[_0x401d('0xbc')],_0x401d('0xbd'));return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('Dialogflow\x20Result\x20%s',_0x160a45[_0x401d('0xbc')]));}return this[_0x401d('0xa')][_0x401d('0x2f')](_0x345f44,_0x401d('0xbe'));};AGIVertices['prototype']['sesteknda']=function(_0x4e6cee){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4e6cee[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x4e6cee[_0x401d('0xbf')])){return this['channel'][_0x401d('0x86')](_0x401d('0xc0'));}if(!this[_0x401d('0x60')](_0x4e6cee[_0x401d('0xc1')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0xc2'));}if(!this[_0x401d('0x60')](_0x4e6cee['password'])){return this['channel'][_0x401d('0x86')](_0x401d('0xc3'));}if(!this[_0x401d('0x60')](_0x4e6cee[_0x401d('0xc4')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x8d'));}this[_0x401d('0xa')]['bot']=!![];this[_0x401d('0x34')](_0x4e6cee);this[_0x401d('0x3e')](_0x4e6cee[_0x401d('0x56')],'in');this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('Trying\x20SestekNDA:\x20%s',_0x4e6cee[_0x401d('0x56')]));var _0x172fc8=this[_0x401d('0x5b')][_0x401d('0x7b')](this,_0x4e6cee);if(_0x172fc8){for(var _0xe4d675 in _0x172fc8){if(_0x172fc8['hasOwnProperty'](_0xe4d675)){this[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')](_0x401d('0xc5'),_0xe4d675[_0x401d('0xc6')]()),_0x172fc8[_0xe4d675]);}}this[_0x401d('0x3e')](_0x172fc8['speech'],'out');if(_0x172fc8[_0x401d('0xc7')]){this['channel'][_0x401d('0x86')](util['format'](_0x401d('0xc8'),_0x172fc8['audiofile']));var _0x5eec0d=this['channel'][_0x401d('0xc9')](_0x172fc8['audiofile']);try{fs[_0x401d('0xca')](_0x172fc8[_0x401d('0xc7')]+_0x401d('0xcb'));}catch(_0x49ab3f){logger['error'](_0x49ab3f);}return _0x5eec0d;}else{return this['channel']['noop'](util['format']('SestekNDA\x20Result\x20%s',_0x172fc8['speech']));}}return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4e6cee,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x401d('0x12')][_0x401d('0xcc')]=function(_0x1b2a18){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0xcd'),_0x1b2a18['label']));return this[_0x401d('0xa')]['noop']('end');};AGIVertices[_0x401d('0x12')][_0x401d('0xce')]=function(_0x49217a){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0xcf'),_0x49217a[_0x401d('0x7c')]));var _0x35184a='';if(_0x49217a[_0x401d('0xd0')]){if(!this['isConfigured'](_0x49217a[_0x401d('0xd0')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x49217a,'no\x20trunk\x20selected');}else{var _0x1c7ac9=parseInt(_0x49217a[_0x401d('0xd0')],0xa);if(isNaN(_0x1c7ac9)){_0x35184a=_0x49217a[_0x401d('0xd0')];}else{_0x35184a=this[_0x401d('0x1b')]['sync'](this,_0x49217a[_0x401d('0xd0')]);if(!_0x35184a){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x49217a,'no\x20trunk\x20found');}}}}else if(_0x49217a[_0x401d('0xd1')]){_0x35184a=_0x49217a[_0x401d('0xd1')];}else{return this[_0x401d('0xa')][_0x401d('0x2f')](_0x49217a,_0x401d('0xd2'));}var _0x2867a7=this[_0x401d('0xa')][_0x401d('0x89')]('DIAL',[util[_0x401d('0x27')](_0x401d('0xd3'),_0x35184a,_0x49217a[_0x401d('0x44')]),_0x49217a['timeout'],_0x49217a[_0x401d('0xb7')],_0x49217a[_0x401d('0xb8')]]);if(_0x2867a7['result']===-0x1){return _0x2867a7;}return this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0xd4'),'DIAL'));};AGIVertices[_0x401d('0x12')]['finally']=function(_0x23b0dc){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0xd5'),_0x23b0dc[_0x401d('0x7c')]));return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0xd6'));};AGIVertices[_0x401d('0x12')][_0x401d('0x9')]=function(_0x484a76){logger['info'](util[_0x401d('0x27')](_0x401d('0xd7'),_0x484a76[_0x401d('0x7c')]));if(_0x484a76[_0x401d('0xd8')]===0x0){return this[_0x401d('0x7a')](_0x484a76);}_0x484a76[_0x401d('0xd8')]-=0x1;if(!this[_0x401d('0x60')](_0x484a76[_0x401d('0xd9')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x484a76,'no\x20file\x20audio\x20selected');}var _0x111d54=this[_0x401d('0xda')][_0x401d('0x7b')](this,_0x484a76[_0x401d('0xd9')]);if(!_0x111d54){return this['channel'][_0x401d('0x2f')](_0x484a76,_0x401d('0xdb'));}if(!this[_0x401d('0x60')](_0x484a76[_0x401d('0xa8')])){return this['channel']['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x43faf6=this['channel'][_0x401d('0xdc')](_0x111d54,_0x484a76[_0x401d('0xdd')],_0x484a76['maxdigit']);var _0x49862c=_0x43faf6[_0x401d('0x80')]?_0x43faf6[_0x401d('0x80')][_0x401d('0x47')]():'';logger[_0x401d('0x2c')]('test',JSON[_0x401d('0xde')](_0x43faf6));if(_0x43faf6[_0x401d('0x80')]===-0x1){this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x484a76,_0x49862c);return _0x43faf6;}else if(_0x43faf6[_0x401d('0x77')]===_0x401d('0x7f')){_0x43faf6[_0x401d('0x80')]=_0x49862c['length']>=parseInt(_0x484a76[_0x401d('0xdf')])?'x':'i';}else{_0x43faf6[_0x401d('0x80')]=_0x49862c['length']>=parseInt(_0x484a76[_0x401d('0xdf')])&&_0x49862c['length']<=parseInt(_0x484a76[_0x401d('0xe0')])?'x':'i';}var _0x200a79=this['getVariable'][_0x401d('0x7b')](this,_0x484a76['variable_id']);if(!_0x200a79){return this['channel']['error'](_0x484a76,_0x401d('0xa9'));}this[_0x401d('0xa')][_0x401d('0xac')](_0x200a79,_0x49862c);if(this[_0x401d('0x60')](_0x484a76['hiddendigitsnum'])){var _0x468f48=parseInt(_0x484a76[_0x401d('0xe1')],0xa);var _0x304281=rs[_0x401d('0xe2')]({'charset':'*','length':_0x468f48});var _0x3c7f3c=_0x49862c[_0x401d('0x74')];if(_0x3c7f3c>0x0){if(_0x3c7f3c>_0x468f48){this['createSquareDetailsReport']['sync'](this,_0x484a76,_0x484a76[_0x401d('0xe3')]===_0x401d('0xe4')?_0x304281+_0x49862c[_0x401d('0xe5')](_0x468f48):_0x49862c[_0x401d('0xe5')](0x0,_0x3c7f3c-_0x468f48)+_0x304281);}else{this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x484a76,rs[_0x401d('0xe2')]({'charset':'*','length':_0x3c7f3c}));}}else{this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x484a76,'');}}else{this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x484a76,_0x49862c);}return _0x43faf6;};AGIVertices[_0x401d('0x12')][_0x401d('0xe6')]=function(_0x4431e0){logger['info'](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4431e0['label']));return this['getdigits'](_0x4431e0);};AGIVertices[_0x401d('0x12')]['goal']=function(_0x4b6c57){logger['info'](util[_0x401d('0x27')](_0x401d('0xe7'),_0x4b6c57[_0x401d('0x7c')]));this[_0x401d('0x34')]['sync'](this,_0x4b6c57,_0x4b6c57[_0x401d('0xe8')]);return this[_0x401d('0xa')][_0x401d('0x86')](util['format']('GOAL\x20%s',_0x4b6c57[_0x401d('0xe8')]));};AGIVertices[_0x401d('0x12')][_0x401d('0xe9')]=function(_0x84c87b){logger[_0x401d('0x2c')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x84c87b['label']));if(!this[_0x401d('0x60')](_0x84c87b[_0x401d('0x63')])||!this['isConfigured'](_0x84c87b[_0x401d('0x64')])){return this[_0x401d('0xa')]['noop'](_0x401d('0xea'));}if(!this['isConfigured'](_0x84c87b[_0x401d('0x56')])){return this[_0x401d('0xa')]['noop']('no\x20text\x20configured');}this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0xeb'),_0x84c87b[_0x401d('0x56')]));var _0xf38f40=this[_0x401d('0x62')][_0x401d('0x7b')](this,_0x84c87b);if(_0xf38f40){this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0xf38f40));var _0x1077f=this[_0x401d('0xa')][_0x401d('0xc9')](_0xf38f40);try{fs['unlink'](_0xf38f40+_0x401d('0xcb'));}catch(_0x296630){logger[_0x401d('0x2f')](_0x296630);}return _0x1077f;}return this[_0x401d('0xa')][_0x401d('0x2f')](_0x84c87b,_0x401d('0xec'));};AGIVertices['prototype'][_0x401d('0xed')]=function(_0x1c0cdd){logger[_0x401d('0x2c')](util['format'](_0x401d('0xee'),_0x1c0cdd[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x1c0cdd[_0x401d('0x63')])||!this[_0x401d('0x60')](_0x1c0cdd[_0x401d('0x64')])){return this['channel'][_0x401d('0x86')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x1c0cdd[_0x401d('0x68')])){return this['channel'][_0x401d('0x86')](_0x401d('0xef'));}if(!this[_0x401d('0x60')](_0x1c0cdd['text'])){return this[_0x401d('0xa')]['noop'](_0x401d('0x8d'));}this['channel'][_0x401d('0xf0')]=!![];this[_0x401d('0x34')](_0x1c0cdd);this['createSquareMessage'](_0x1c0cdd[_0x401d('0x56')],'in');this[_0x401d('0xa')][_0x401d('0x86')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x1c0cdd[_0x401d('0x56')]));var _0x2d6978=this[_0x401d('0xf1')]['sync'](this,_0x1c0cdd);if(_0x2d6978){for(var _0x514668 in _0x2d6978){if(_0x2d6978[_0x401d('0xbb')](_0x514668)&&_['isString'](_0x2d6978[_0x514668])){this[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')](_0x401d('0xf2'),_0x514668[_0x401d('0xc6')]()),_0x2d6978[_0x514668]);}}if(_[_0x401d('0x41')](_0x2d6978[_0x401d('0xf3')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0xf4'));}else{this['createSquareMessage'](_0x2d6978[_0x401d('0xf3')],_0x401d('0xbd'));return this['channel']['noop'](util['format'](_0x401d('0xf5'),_0x2d6978[_0x401d('0xf3')]));}}return this[_0x401d('0xa')][_0x401d('0x2f')](_0x1c0cdd,_0x401d('0xf6'));};AGIVertices['prototype'][_0x401d('0xf7')]=function(_0x15aab2){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0xf8'),_0x15aab2[_0x401d('0x7c')],_0x15aab2[_0x401d('0x7f')]));if(!this[_0x401d('0x60')](_0x15aab2[_0x401d('0x59')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0xf9'));}var _0x442119=_0x401d('0xfa');var _0x2243f1=util[_0x401d('0x27')](_0x401d('0xfb'),FILES_PATH,rs['generate'](0x4));var _0x3ca726=util[_0x401d('0x27')](_0x401d('0xfc'),_0x2243f1,_0x442119);var _0x544c9e=!![];if(_0x15aab2[_0x401d('0xfd')]===_0x401d('0xfe')){_0x544c9e=![];}var _0x5b439d=this['channel'][_0x401d('0xff')](_0x2243f1,_0x442119,_0x15aab2[_0x401d('0x100')],_0x15aab2[_0x401d('0x7f')],undefined,_0x544c9e);if(_0x5b439d[_0x401d('0x80')]!==-0x1){this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x101'),_0x3ca726));var _0x3fa6b5=this['googleASR'][_0x401d('0x7b')](this,_0x15aab2,_0x3ca726);if(_0x3fa6b5){for(var _0x2fa220 in _0x3fa6b5){if(_0x3fa6b5[_0x401d('0xbb')](_0x2fa220)){this['channel'][_0x401d('0xac')](util['format'](_0x401d('0x102'),_0x2fa220[_0x401d('0xc6')]()),_0x3fa6b5[_0x2fa220]);}}return this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0x103'),JSON[_0x401d('0xde')](_0x3fa6b5)));}}return _0x5b439d;};AGIVertices[_0x401d('0x12')]['tildeasr']=function(_0x546d34){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x104'),_0x546d34[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x546d34[_0x401d('0x6c')])){return this['channel'][_0x401d('0x86')](_0x401d('0x105'));}if(!this[_0x401d('0x60')](_0x546d34[_0x401d('0x6d')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x106'));}var _0x3125e8=_0x401d('0xfa');var _0xd2bf44=util['format'](_0x401d('0xfb'),FILES_PATH,rs[_0x401d('0xe2')](0x4));var _0x5b5e28=util[_0x401d('0x27')]('%s.%s',_0xd2bf44,_0x3125e8);var _0x31af4c=!![];if(_0x546d34[_0x401d('0xfd')]==='NOBEEP'){_0x31af4c=![];}var _0x4723e9=this[_0x401d('0xa')][_0x401d('0xff')](_0xd2bf44,_0x3125e8,_0x546d34[_0x401d('0x100')],_0x546d34[_0x401d('0x7f')],undefined,_0x31af4c);if(_0x4723e9[_0x401d('0x80')]!==-0x1){this[_0x401d('0xa')]['noop'](util[_0x401d('0x27')](_0x401d('0x107'),_0x5b5e28));var _0x3c6424=this['tildeASR'][_0x401d('0x7b')](this,_0x546d34,_0x5b5e28);if(_0x3c6424){for(var _0x24a9a7 in _0x3c6424){if(_0x3c6424[_0x401d('0xbb')](_0x24a9a7)){this[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')]('TILDE_ASR_%s',_0x24a9a7[_0x401d('0xc6')]()),_0x3c6424[_0x24a9a7]);}}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x108'),JSON[_0x401d('0xde')](_0x3c6424)));}}return _0x4723e9;};AGIVertices[_0x401d('0x12')][_0x401d('0x109')]=function(_0x354f83){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x10a'),_0x354f83['label']));return this['channel']['continueAt'](_0x354f83['context'],_0x354f83[_0x401d('0x3b')],_0x354f83[_0x401d('0x10b')]);};AGIVertices[_0x401d('0x12')][_0x401d('0x10c')]=function(_0x4e8650){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x10d'),_0x4e8650['label']));if(!this[_0x401d('0x60')](_0x4e8650[_0x401d('0x10e')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4e8650,_0x401d('0x10f'));}try{var _0x444c21=eval(_0x4e8650[_0x401d('0x10e')])?_0x401d('0x110'):_0x401d('0x111');this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x112'),_0x4e8650[_0x401d('0x10e')],_0x444c21));return{'code':0xc8,'result':_0x444c21};}catch(_0x3a85ed){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x401d('0x12')][_0x401d('0x113')]=function(_0x450adc){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x114'),_0x450adc[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x450adc['interval_id'])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x450adc,_0x401d('0x115'));}var _0x433890=this['getIntervals'][_0x401d('0x7b')](this,_0x450adc[_0x401d('0x116')]);if(!_0x433890){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x450adc,_0x401d('0x117'));}for(var _0x53a049=0x0;_0x53a049<_0x433890[_0x401d('0x74')];_0x53a049+=0x1){var _0x2ae5d1=this['channel'][_0x401d('0xd')](util[_0x401d('0x27')](_0x401d('0x118'),_0x433890[_0x53a049]));if(_0x2ae5d1['result']===-0x1){return _0x2ae5d1;}logger[_0x401d('0x2c')](util[_0x401d('0x27')]('IFTIME\x20%s\x20%s',_0x433890[_0x53a049],_0x2ae5d1['extra']));if(_0x2ae5d1[_0x401d('0x77')]===_0x401d('0x110')){logger[_0x401d('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x433890[_0x53a049],'true'));this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0x119'),_0x433890[_0x53a049],_0x401d('0x110')));return{'code':0xc8,'result':_0x401d('0x110')};}else{logger['info'](util[_0x401d('0x27')]('IFTIME\x20%s\x20%s',_0x433890[_0x53a049],_0x401d('0x111')));this['channel']['noop'](util[_0x401d('0x27')](_0x401d('0x119'),_0x433890[_0x53a049],_0x401d('0x111')));}}return{'code':0xc8,'result':_0x401d('0x111')};};AGIVertices[_0x401d('0x12')][_0x401d('0x11a')]=function(_0x2ff1d6){logger['info'](util[_0x401d('0x27')](_0x401d('0x11b'),_0x2ff1d6[_0x401d('0x7c')]));return this[_0x401d('0xa')][_0x401d('0x11a')]();};AGIVertices[_0x401d('0x12')][_0x401d('0x11c')]=function(_0x44af1e){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x11d'),_0x44af1e['label']));if(!this[_0x401d('0x60')](_0x44af1e[_0x401d('0x59')])){return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0xf9'));}var _0x59d35b=_0x401d('0xfa');var _0x579303=util[_0x401d('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x401d('0xe2')](0x4));var _0x421bb3=util['format']('%s.%s',_0x579303,_0x59d35b);var _0x44b3cb=!![];if(_0x44af1e[_0x401d('0xfd')]===_0x401d('0xfe')){_0x44b3cb=![];}var _0x2fe782=this[_0x401d('0xa')][_0x401d('0xff')](_0x579303,_0x59d35b,_0x44af1e[_0x401d('0x100')],_0x44af1e[_0x401d('0x7f')],undefined,_0x44b3cb);if(_0x2fe782[_0x401d('0x80')]!==-0x1){this['channel']['noop'](util[_0x401d('0x27')](_0x401d('0x11e'),_0x421bb3));var _0x3c383b=this['ispeechASR']['sync'](this,_0x44af1e,_0x421bb3);if(_0x3c383b){for(var _0xc944f7 in _0x3c383b){if(_0x3c383b[_0x401d('0xbb')](_0xc944f7)){this[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')]('ISPEECH_ASR_%s',_0xc944f7[_0x401d('0xc6')]()),_0x3c383b[_0xc944f7]);}}return this['channel'][_0x401d('0x86')](util['format'](_0x401d('0x11f'),JSON['stringify'](_0x3c383b)));}}return _0x2fe782;};AGIVertices[_0x401d('0x12')][_0x401d('0x120')]=function(_0x5a42c4){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5a42c4['label']));if(!this[_0x401d('0x60')](_0x5a42c4['key'])){return this['channel'][_0x401d('0x86')](_0x401d('0xf9'));}if(!this['isConfigured'](_0x5a42c4[_0x401d('0x56')])){return this['channel'][_0x401d('0x86')]('no\x20text\x20configured');}this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x121'),_0x5a42c4['text']));var _0x2f66e6=this['ispeechTTS'][_0x401d('0x7b')](this,_0x5a42c4);if(_0x2f66e6){this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x11e'),_0x2f66e6));var _0x596832=this[_0x401d('0xa')]['streamFile'](_0x2f66e6,_0x5a42c4[_0x401d('0x100')]);try{fs[_0x401d('0xca')](_0x2f66e6+_0x401d('0xcb'));}catch(_0x140768){logger[_0x401d('0x2f')](_0x140768);}return _0x596832;}return this[_0x401d('0xa')]['error'](_0x5a42c4,_0x401d('0x122'));};AGIVertices[_0x401d('0x12')][_0x401d('0x123')]=function(_0x33cd7e){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x124'),_0x33cd7e[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x33cd7e[_0x401d('0x125')])){return this['channel']['error'](_0x33cd7e,_0x401d('0x126'));}logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x127'),this[_0x401d('0xa')][_0x401d('0x39')],_0x33cd7e[_0x401d('0x125')]));var _0x2dc779=this[_0x401d('0x4f')][_0x401d('0x7b')](this,_0x33cd7e[_0x401d('0x125')]);if(_0x2dc779){logger['info'](util[_0x401d('0x27')](_0x401d('0x128'),this[_0x401d('0xa')][_0x401d('0x39')],_0x33cd7e['findBy']));this['channel'][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x128'),this[_0x401d('0xa')][_0x401d('0x39')],_0x33cd7e['findBy']));return{'code':0xc8,'result':_0x401d('0x129')};}else{logger['info'](util['format'](_0x401d('0x12a'),this[_0x401d('0xa')][_0x401d('0x39')],_0x33cd7e[_0x401d('0x125')]));this[_0x401d('0xa')]['noop'](util[_0x401d('0x27')](_0x401d('0x12a'),this[_0x401d('0xa')][_0x401d('0x39')],_0x33cd7e[_0x401d('0x125')]));return{'code':0xc8,'result':_0x401d('0x12b')};}};AGIVertices[_0x401d('0x12')][_0x401d('0x12c')]=function(_0x12ad62){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x12d'),_0x12ad62[_0x401d('0x7c')]));if(!this['isConfigured'](_0x12ad62[_0x401d('0x125')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x12ad62,_0x401d('0x126'));}logger[_0x401d('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x401d('0xa')]['callerid'],_0x12ad62[_0x401d('0x125')]));var _0x20d00e=this[_0x401d('0x4e')][_0x401d('0x7b')](this,_0x12ad62[_0x401d('0x125')]);if(_0x20d00e){logger['info'](util[_0x401d('0x27')](_0x401d('0x128'),this[_0x401d('0xa')][_0x401d('0x39')],_0x12ad62[_0x401d('0x125')]));this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x128'),this['channel']['callerid'],_0x12ad62[_0x401d('0x125')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x401d('0x27')](_0x401d('0x12a'),this[_0x401d('0xa')][_0x401d('0x39')],_0x12ad62[_0x401d('0x125')]));this['channel']['noop'](util[_0x401d('0x27')](_0x401d('0x12a'),this[_0x401d('0xa')][_0x401d('0x39')],_0x12ad62[_0x401d('0x125')]));return{'code':0xc8,'result':_0x401d('0x12b')};}};AGIVertices[_0x401d('0x12')][_0x401d('0x12e')]=function(_0x39aa45){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x39aa45['label']));if(!this[_0x401d('0x60')](_0x39aa45['operation'])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x39aa45,_0x401d('0x12f'));}this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0x130'),_0x39aa45[_0x401d('0x131')]));var _0x2e14c9=eval(_0x39aa45[_0x401d('0x131')]);if(!this[_0x401d('0x60')](_0x39aa45[_0x401d('0xa8')])){return this['channel'][_0x401d('0x86')](_0x401d('0x132'));}var _0x14aa0b=this[_0x401d('0xd')][_0x401d('0x7b')](this,_0x39aa45[_0x401d('0xa8')]);if(!_0x14aa0b){return this['channel'][_0x401d('0x2f')](_0x39aa45,_0x401d('0xa9'));}if(_[_0x401d('0x133')](_0x2e14c9)){var _0x282c91=this;_0x2e14c9['forEach'](function(_0x324155,_0x5acb3e){_0x282c91[_0x401d('0xa')][_0x401d('0xac')](util[_0x401d('0x27')](_0x401d('0x134'),_0x14aa0b,_0x5acb3e),_0x324155);});return this['channel']['noop'](util[_0x401d('0x27')](_0x401d('0x135'),_0x14aa0b));}else{return this[_0x401d('0xa')]['setVariable'](_0x14aa0b,_0x2e14c9);}};AGIVertices[_0x401d('0x12')][_0x401d('0x8')]=function(_0x4f3a18){logger['info'](util[_0x401d('0x27')](_0x401d('0x136'),_0x4f3a18[_0x401d('0x7c')]));if(_0x4f3a18['retry']===0x0){return this[_0x401d('0x7a')](_0x4f3a18);}_0x4f3a18['retry']-=0x1;if(!this['isConfigured'](_0x4f3a18[_0x401d('0xd9')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4f3a18,'no\x20file\x20audio\x20selected');}var _0x29d871=this[_0x401d('0xda')][_0x401d('0x7b')](this,_0x4f3a18[_0x401d('0xd9')]);if(!_0x29d871){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4f3a18,_0x401d('0xdb'));}var _0x41c6ad=this[_0x401d('0xa')]['getData'](_0x29d871,_0x4f3a18[_0x401d('0xdd')],_0x4f3a18[_0x401d('0x137')]);var _0x7a2740=_0x41c6ad[_0x401d('0x80')];if(_0x41c6ad[_0x401d('0x80')]===-0x1){this[_0x401d('0x34')][_0x401d('0x7b')](this,_0x4f3a18,'-1');return _0x41c6ad;}else if(_0x41c6ad[_0x401d('0x77')]===_0x401d('0x7f')){_0x41c6ad[_0x401d('0x80')]=_0x41c6ad['result'][_0x401d('0x74')]>0x0?_0x41c6ad[_0x401d('0x80')]:'t';}else if(_['isEmpty'](_0x41c6ad[_0x401d('0x80')])){_0x41c6ad['result']='#';_0x7a2740='#';}if(!this[_0x401d('0x60')](_0x4f3a18['variable_id'])){this['channel'][_0x401d('0x86')](_0x401d('0x132'));}else{var _0xa53d63=this['getVariable'][_0x401d('0x7b')](this,_0x4f3a18[_0x401d('0xa8')]);if(!_0xa53d63){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4f3a18,_0x401d('0xa9'));}this[_0x401d('0xa')][_0x401d('0xac')](_0xa53d63,_0x7a2740);}this[_0x401d('0x34')]['sync'](this,_0x4f3a18,_0x7a2740);return _0x41c6ad;};AGIVertices[_0x401d('0x12')][_0x401d('0x86')]=function(_0x5963b2){logger[_0x401d('0x2c')](util['format'](_0x401d('0x138'),_0x5963b2[_0x401d('0x7c')]));return this[_0x401d('0xa')][_0x401d('0x86')](_0x5963b2[_0x401d('0x139')]||_0x5963b2[_0x401d('0x7c')]);};AGIVertices[_0x401d('0x12')][_0x401d('0x13a')]=function(_0x48ccde){logger['info'](util[_0x401d('0x27')](_0x401d('0x13b'),_0x48ccde[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x48ccde[_0x401d('0x125')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x48ccde,_0x401d('0x126'));}logger[_0x401d('0x2c')](util[_0x401d('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x401d('0xa')][_0x401d('0x39')],_0x48ccde[_0x401d('0x125')]));var _0x387de1=this['getPause'][_0x401d('0x7b')](this,_0x48ccde[_0x401d('0x13c')]);var _0x3a213c=this[_0x401d('0x4c')][_0x401d('0x7b')](this,_0x48ccde[_0x401d('0x125')],_0x387de1);if(_0x3a213c){logger['info'](util['format'](_0x401d('0x128'),this[_0x401d('0xa')][_0x401d('0x39')],_0x48ccde[_0x401d('0x125')]));this['channel']['noop'](util[_0x401d('0x27')](_0x401d('0x128'),this[_0x401d('0xa')][_0x401d('0x39')],_0x48ccde[_0x401d('0x125')]));return{'code':0xc8,'result':_0x401d('0x129')};}else{logger[_0x401d('0x2c')](util['format'](_0x401d('0x12a'),this[_0x401d('0xa')]['callerid'],_0x48ccde[_0x401d('0x125')]));this['channel'][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x128'),this['channel'][_0x401d('0x39')],_0x48ccde['findBy']));return{'code':0xc8,'result':_0x401d('0x12b')};}};AGIVertices[_0x401d('0x12')][_0x401d('0x13d')]=function(_0x2224b6){logger['info'](util[_0x401d('0x27')](_0x401d('0x13e'),_0x2224b6[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x2224b6['file_id'])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x2224b6,'no\x20file\x20audio\x20selected');}var _0x3e490a=this[_0x401d('0xda')][_0x401d('0x7b')](this,_0x2224b6['file_id']);if(!_0x3e490a){return this[_0x401d('0xa')]['error'](_0x2224b6,'no\x20file\x20audio\x20found');}var _0x41daa0=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0x13f'),[_0x3e490a,_0x2224b6[_0x401d('0xb7')]]);if(_0x41daa0[_0x401d('0x80')]===-0x1){return _0x41daa0;}return this[_0x401d('0xa')][_0x401d('0x86')](util['format'](_0x401d('0x8c'),_0x401d('0x13f'),_0x3e490a));};AGIVertices['prototype'][_0x401d('0x140')]=function(_0x46d419){logger['info'](util[_0x401d('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x46d419[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x46d419[_0x401d('0x141')])){return this[_0x401d('0xa')]['error'](_0x46d419,_0x401d('0x142'));}var _0x3f8a36='';var _0x599876=parseInt(_0x46d419[_0x401d('0x141')],0xa);if(isNaN(_0x599876)){_0x3f8a36=_0x46d419[_0x401d('0x141')];}else{_0x3f8a36=this['getVoiceQueue'][_0x401d('0x7b')](this,_0x46d419[_0x401d('0x141')]);if(!_0x3f8a36){return this[_0x401d('0xa')]['error'](_0x46d419,_0x401d('0x143'));}}var _0x136170='';if(this[_0x401d('0x60')](_0x46d419[_0x401d('0xd9')])){var _0x227b89=this[_0x401d('0xda')][_0x401d('0x7b')](this,_0x46d419['file_id']);if(_0x227b89){_0x136170=_0x227b89;}}this['createSquareDetailsReport'][_0x401d('0x7b')](this,_0x46d419,_0x3f8a36);if(_0x46d419[_0x401d('0xb7')][_0x401d('0x144')]('x')<0x0){_0x46d419[_0x401d('0xb7')]+='x';}if(_0x46d419[_0x401d('0xb7')][_0x401d('0x144')]('X')<0x0){_0x46d419[_0x401d('0xb7')]+='X';}this['channel'][_0x401d('0xac')](_0x401d('0x145'),_0x3f8a36?_0x3f8a36[_0x401d('0x146')]():'');var _0x54638d=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0x147'),[_0x3f8a36,_0x46d419[_0x401d('0xb7')],_0x46d419[_0x401d('0xb8')],_0x136170,_0x46d419[_0x401d('0x7f')],_0x46d419[_0x401d('0x5')],_0x46d419[_0x401d('0x148')],_0x46d419[_0x401d('0x149')],'',_0x46d419[_0x401d('0x14a')]]);if(_0x54638d[_0x401d('0x80')]===-0x1){return _0x54638d;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('Executed\x20command\x20%s\x20%s',_0x401d('0x147'),_0x3f8a36));};AGIVertices[_0x401d('0x12')][_0x401d('0x14b')]=function(_0x1416d9){logger['info'](util[_0x401d('0x27')](_0x401d('0x14c'),_0x1416d9[_0x401d('0x7c')]));var _0x359a2e=_0x1416d9[_0x401d('0x14d')]||_0x401d('0xfa');var _0x274ae0=util['format'](_0x401d('0x14e'),this[_0x401d('0xa')][_0x401d('0x35')],rs['generate'](0x5));var _0x170582=util[_0x401d('0x27')](_0x401d('0x14f'),FILES_PATH,_0x274ae0,_0x359a2e);var _0x4a3582=util[_0x401d('0x27')]('%s/recordings/%s',FILES_PATH,_0x274ae0);this[_0x401d('0x38')][_0x401d('0x7b')](this,_0x1416d9,_0x274ae0,_0x170582);this[_0x401d('0xa')][_0x401d('0xac')](_0x401d('0x150'),_0x274ae0);logger[_0x401d('0x2c')](_0x401d('0x151'),_0x4a3582,_0x359a2e,_0x1416d9[_0x401d('0x152')],_0x1416d9[_0x401d('0x7f')]);return this['channel'][_0x401d('0xff')](_0x4a3582,_0x359a2e,_0x1416d9[_0x401d('0x152')],_0x1416d9[_0x401d('0x7f')],undefined,!![]);};AGIVertices[_0x401d('0x12')][_0x401d('0x153')]=function(_0x41bd43){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x41bd43[_0x401d('0x7c')]));return this[_0x401d('0xa')][_0x401d('0x154')](_0x41bd43[_0x401d('0x155')][_0x401d('0x54')](/\s+/g,''),_0x41bd43['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x3d30fb){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x156'),_0x3d30fb['label']));return this[_0x401d('0xa')][_0x401d('0x157')](_0x3d30fb[_0x401d('0x158')][_0x401d('0x54')](/\s+/g,''),_0x3d30fb[_0x401d('0x152')]);};AGIVertices[_0x401d('0x12')]['sayphonetic']=function(_0x1531bb){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x159'),_0x1531bb['label']));return this['channel']['sayPhonetic'](_0x1531bb[_0x401d('0x56')],_0x1531bb['escape_digits']);};AGIVertices[_0x401d('0x12')]['sendMail']=function(_0x59584e){logger[_0x401d('0x2c')](util[_0x401d('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x59584e[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x59584e[_0x401d('0x15a')])){return this[_0x401d('0xa')]['noop']('no\x20mail\x20account\x20configured');}var _0x3ef5e0=this[_0x401d('0x20')][_0x401d('0x7b')](this,_0x59584e[_0x401d('0x15a')]);if(!_0x3ef5e0||!_0x3ef5e0[_0x401d('0x15b')]){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x59584e,'no\x20mail\x20account\x20found');}var _0x50849c={'from':util[_0x401d('0x27')](_0x401d('0x15c'),_0x3ef5e0[_0x401d('0x10')],_0x3ef5e0['email']||_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x15d')]),'to':_0x59584e['to']||'','cc':_0x59584e['cc']||'','bcc':_0x59584e[_0x401d('0x15e')]||'','subject':_0x59584e[_0x401d('0x15f')],'html':_0x59584e[_0x401d('0x56')],'text':_0x59584e['text']};var _0x57c688={'tls':{'rejectUnauthorized':![]}};if(_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x160')]){_0x57c688[_0x401d('0x160')]=_0x3ef5e0[_0x401d('0x15b')]['service'];}else{_0x57c688['host']=_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x161')];_0x57c688[_0x401d('0x162')]=_0x3ef5e0['Smtp'][_0x401d('0x162')];_0x57c688[_0x401d('0x163')]=_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x163')];}if(_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x164')]){_0x57c688['auth']={'user':_0x3ef5e0['Smtp'][_0x401d('0x15d')],'pass':_0x3ef5e0[_0x401d('0x15b')][_0x401d('0x165')]};}if(this[_0x401d('0x60')](_0x59584e[_0x401d('0x166')])){}logger[_0x401d('0xb1')](_0x401d('0x167'),JSON['stringify'](_0x50849c));this['createSquareDetailsReport'][_0x401d('0x7b')](this,_0x59584e,_0x59584e[_0x401d('0x15a')]);this['channel'][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x168'),_0x3ef5e0['name']));this[_0x401d('0x22')][_0x401d('0x7b')](this,_0x57c688,_0x50849c);return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x169'));};AGIVertices[_0x401d('0x12')][_0x401d('0x16a')]=function(_0x5c0146){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x16b'),_0x5c0146[_0x401d('0x7c')]));return this['channel'][_0x401d('0x86')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x401d('0x12')]['sendSMS']=function(_0x3245cd){logger[_0x401d('0x2c')](util['format'](_0x401d('0x16c'),_0x3245cd[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x3245cd[_0x401d('0x16d')])){return this[_0x401d('0xa')][_0x401d('0x86')]('no\x20sms\x20account\x20configured');}var _0x35ae52=this['getSmsAccount']['sync'](this,_0x3245cd[_0x401d('0x16d')]);if(!_0x35ae52){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x3245cd,_0x401d('0x16e'));}var _0x42afa2={'body':_0x3245cd[_0x401d('0x16f')],'phone':_0x3245cd['to']||'','SmsAccountId':_0x35ae52['id']};logger[_0x401d('0xb1')](_0x401d('0x170'),JSON[_0x401d('0xde')](_0x42afa2));this[_0x401d('0x34')]['sync'](this,_0x3245cd,_0x3245cd[_0x401d('0x16d')]);this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x35ae52[_0x401d('0x10')]));this[_0x401d('0x33')][_0x401d('0x7b')](this,_0x42afa2);return this[_0x401d('0xa')][_0x401d('0x86')](_0x401d('0x171'));};AGIVertices['prototype'][_0x401d('0x172')]=function(_0x4fd58b){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x173'),_0x4fd58b[_0x401d('0x7c')]));if(!this[_0x401d('0x60')](_0x4fd58b['variable_id'])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4fd58b,_0x401d('0x174'));}var _0x314512=this[_0x401d('0xd')][_0x401d('0x7b')](this,_0x4fd58b['variable_id']);if(!_0x314512){return this[_0x401d('0xa')]['error'](_0x4fd58b,_0x401d('0xa9'));}return this[_0x401d('0xa')][_0x401d('0xac')](_0x314512,_0x4fd58b['variable_value']);};AGIVertices[_0x401d('0x12')]['start']=function(_0x16c25f){logger['info'](util['format'](_0x401d('0x175'),_0x16c25f[_0x401d('0x7c')]));this[_0x401d('0xa')][_0x401d('0x86')]('START\x20CALLY\x20SQUARE');if(_0x16c25f[_0x401d('0x7e')]===_0x401d('0x176')){this['channel'][_0x401d('0x86')](_0x401d('0x177'));return this[_0x401d('0xa')][_0x401d('0x7e')]();}return this[_0x401d('0xa')]['noop']('Skipped\x20Answer');};AGIVertices[_0x401d('0x12')][_0x401d('0x178')]=function(_0x4b69ba){logger[_0x401d('0x2c')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x4b69ba['label']));if(!this[_0x401d('0x60')](_0x4b69ba[_0x401d('0x179')])){return this['channel'][_0x401d('0x2f')](_0x4b69ba,_0x401d('0x17a'));}var _0x3bda33=this[_0x401d('0x15')]['sync'](this,_0x4b69ba['project_id']);if(!this[_0x401d('0x60')](_0x3bda33)){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4b69ba,util['format'](_0x401d('0x17b'),_0x4b69ba[_0x401d('0x179')]));}if(_0x3bda33===this['channel'][_0x401d('0x37')]){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x4b69ba,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x401d('0x34')]['sync'](this,_0x4b69ba,_0x3bda33);var _0x2820f7=this[_0x401d('0xa')][_0x401d('0x89')](_0x401d('0x17c'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x401d('0x5')]['host']||_0x401d('0x17d'),_0x3bda33,this[_0x401d('0xa')]['arg_1']));if(_0x2820f7[_0x401d('0x80')]===-0x1){return _0x2820f7;}return this['channel'][_0x401d('0x86')](util['format'](_0x401d('0x8c'),_0x401d('0x17c'),_0x3bda33));};AGIVertices['prototype'][_0x401d('0x17e')]=function(_0x4f882e){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x17f'),_0x4f882e[_0x401d('0x7c')]));var _0x150c42=this[_0x401d('0x52')][_0x401d('0x7b')](this,_0x4f882e['command']);this['createSquareDetailsReport'][_0x401d('0x7b')](this,_0x4f882e,_0x4f882e[_0x401d('0x180')]);if(this[_0x401d('0x60')](_0x4f882e[_0x401d('0xa8')])){var _0x46f553=this[_0x401d('0xd')][_0x401d('0x7b')](this,_0x4f882e[_0x401d('0xa8')]);if(_0x46f553){this['channel'][_0x401d('0xac')](_0x46f553,_0x150c42);return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x181'),_0x4f882e[_0x401d('0x180')],_0x46f553));}}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x182'),_0x4f882e[_0x401d('0x180')]));};AGIVertices[_0x401d('0x12')][_0x401d('0x183')]=function(_0x434227){logger['info'](util[_0x401d('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x434227[_0x401d('0x7c')]));if(!this['isConfigured'](_0x434227[_0x401d('0x56')])){return this['channel'][_0x401d('0x86')](_0x401d('0x8d'));}this[_0x401d('0xa')]['noop'](util['format'](_0x401d('0x184'),_0x434227[_0x401d('0x56')]));var _0x3c1433=this[_0x401d('0x55')][_0x401d('0x7b')](this,_0x434227);if(_0x3c1433){this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x185'),_0x3c1433));var _0x5110cb=this[_0x401d('0xa')][_0x401d('0xc9')](_0x3c1433);try{fs[_0x401d('0xca')](_0x3c1433+_0x401d('0xcb'));}catch(_0x4645fa){logger[_0x401d('0x2f')](_0x4645fa);}return _0x5110cb;}return this[_0x401d('0xa')][_0x401d('0x2f')](_0x434227,_0x401d('0x186'));};AGIVertices['prototype'][_0x401d('0x187')]=function(_0x371673){logger['info'](util[_0x401d('0x27')](_0x401d('0x188'),_0x371673['label']));if(!this[_0x401d('0x60')](_0x371673[_0x401d('0x125')])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x371673,'no\x20find\x20by\x20configured');}logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x127'),this[_0x401d('0xa')][_0x401d('0x39')],_0x371673[_0x401d('0x125')]));var _0x3b7cd3=this['agentUnpause'][_0x401d('0x7b')](this,_0x371673[_0x401d('0x125')]);if(_0x3b7cd3){logger['info'](util['format'](_0x401d('0x128'),this[_0x401d('0xa')]['callerid'],_0x371673[_0x401d('0x125')]));this['channel'][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x128'),this['channel']['callerid'],_0x371673[_0x401d('0x125')]));return{'code':0xc8,'result':_0x401d('0x129')};}else{logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x12a'),this[_0x401d('0xa')]['callerid'],_0x371673[_0x401d('0x125')]));this[_0x401d('0xa')]['noop'](util[_0x401d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x401d('0x39')],_0x371673['findBy']));return{'code':0xc8,'result':_0x401d('0x12b')};}};AGIVertices[_0x401d('0x12')][_0x401d('0x189')]=function(_0x2d8230){logger[_0x401d('0x2c')](util[_0x401d('0x27')](_0x401d('0x18a'),_0x2d8230['label']));var _0x5b1f3c=this[_0x401d('0xa')]['exec']('VOICEMAIL',[_0x2d8230[_0x401d('0x18b')],_0x2d8230[_0x401d('0x8b')]]);if(_0x5b1f3c['result']===-0x1){return _0x5b1f3c;}return this[_0x401d('0xa')][_0x401d('0x86')](util[_0x401d('0x27')](_0x401d('0x8c'),_0x401d('0x18c'),_0x2d8230[_0x401d('0x18b')]));};AGIVertices[_0x401d('0x12')][_0x401d('0x18d')]=function(_0x2bbefe){logger['info'](util[_0x401d('0x27')](_0x401d('0x18e'),_0x2bbefe[_0x401d('0x7c')]));if(!this['isConfigured'](_0x2bbefe['variable_id'])){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x2bbefe,_0x401d('0x174'));}var _0x20d1ae=this[_0x401d('0xd')]['sync'](this,_0x2bbefe['variable_id']);if(!_0x20d1ae){return this[_0x401d('0xa')][_0x401d('0x2f')](_0x2bbefe,_0x401d('0xa9'));}var _0x393d8c=this['channel'][_0x401d('0xd')](_0x20d1ae);return{'code':0xc8,'result':_0x393d8c[_0x401d('0x77')]?_0x393d8c[_0x401d('0x77')]:'-'};};String[_0x401d('0x12')][_0x401d('0x76')]=function(_0x57aeba,_0x4de1d1){return this[_0x401d('0x75')](_0x57aeba)[_0x401d('0x18f')](_0x4de1d1);};module[_0x401d('0x190')]=AGIVertices; \ No newline at end of file +var _0x1d33=['no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','project_id','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','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','./scripts','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','createSquareRecording','callerid','context','extension','priority','dnid','arg_1','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','includes','isString','split','length','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','delay','callback_priority','sync','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','getAndSetVariable','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','finally','no\x20file\x20audio\x20selected','getSound','response','maxdigit','stringify','mindigit','no\x20variable\x20found','generate','hiddendigitspos','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','streamFile','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','%s.%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','wav','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','isArray','Enter\x20in\x20MENU\x20(%s)\x20block','retry','file_id','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','user','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x1d33,0x1aa));var _0x31d3=function(_0x387afa,_0x6b2831){_0x387afa=_0x387afa-0x0;var _0x43edc2=_0x1d33[_0x387afa];return _0x43edc2;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x31d3('0x0'));var _=require(_0x31d3('0x1'));var sh=require(_0x31d3('0x2'));var odbc=require(_0x31d3('0x3'))();var rs=require(_0x31d3('0x4'));var moment=require('moment');var Mustache=require(_0x31d3('0x5'));var logger=require(_0x31d3('0x6'))(_0x31d3('0x7'));var config=require(_0x31d3('0x8'));var scripts=require(_0x31d3('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x31d3('0xa'),_0x31d3('0xb'),_0x31d3('0xc')];var AGIVertices=function(_0x538b36,_0x529beb,_0x8e21f4){this[_0x31d3('0xd')]=_0x538b36;this[_0x31d3('0xe')]=_0x529beb;this[_0x31d3('0xf')]=_0x8e21f4;};AGIVertices[_0x31d3('0x10')]['getVariable']=function(_0x3ce099,_0xef7ed8){this['rpc'][_0x31d3('0x11')](_0x3ce099)[_0x31d3('0x12')](function(_0x2e0e5d){_0xef7ed8(null,_0x2e0e5d?_0x2e0e5d[_0x31d3('0x13')]:![]);})[_0x31d3('0x14')](function(_0x4993dc){_0xef7ed8(_0x4993dc);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x15')]=function(_0x1b052,_0x1cac5d){this['rpc'][_0x31d3('0x16')](_0x1b052)[_0x31d3('0x12')](function(_0xce024d){_0x1cac5d(null,_0xce024d?_0xce024d['name']:![]);})[_0x31d3('0x14')](function(_0x1e9427){_0x1cac5d(_0x1e9427);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x17')]=function(_0x2ebcf7,_0x8c56be){this[_0x31d3('0xe')]['getSquareProjectById'](_0x2ebcf7)[_0x31d3('0x12')](function(_0x5f57e9){_0x8c56be(null,_0x5f57e9?_0x5f57e9[_0x31d3('0x13')]:![]);})[_0x31d3('0x14')](function(_0x17b2bf){_0x8c56be(_0x17b2bf);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x18')]=function(_0x4bd42d,_0x5cefa3){this[_0x31d3('0xe')]['getSquareOdbcById'](_0x4bd42d)[_0x31d3('0x12')](function(_0x28e122){_0x5cefa3(null,_0x28e122?_0x28e122['dsn']:![]);})[_0x31d3('0x14')](function(_0x282201){_0x5cefa3(_0x282201);});};AGIVertices['prototype'][_0x31d3('0x19')]=function(_0x713e52,_0x4521f3){this[_0x31d3('0xe')][_0x31d3('0x1a')](_0x713e52)[_0x31d3('0x12')](function(_0x3627a8){_0x4521f3(null,_0x3627a8?_0x3627a8['name']:![]);})[_0x31d3('0x14')](function(_0x12f0a6){_0x4521f3(_0x12f0a6);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x1b')]=function(_0x435f9a,_0x3a375c){this[_0x31d3('0xe')][_0x31d3('0x1c')](_0x435f9a)[_0x31d3('0x12')](function(_0x77afe6){_0x3a375c(null,_0x77afe6?_0x77afe6[_0x31d3('0x13')]:![]);})[_0x31d3('0x14')](function(_0x14a9ea){_0x3a375c(_0x14a9ea);});};AGIVertices[_0x31d3('0x10')]['getSound']=function(_0x2ba627,_0x5cd1ef){var _0xbae56a=this;this['rpc'][_0x31d3('0x1d')](_0x2ba627)[_0x31d3('0x12')](function(_0x274f22){_0x5cd1ef(null,_0x274f22?_0xbae56a[_0x31d3('0x1e')](_0x274f22[_0x31d3('0x1f')]):![]);})[_0x31d3('0x14')](function(_0x42ac33){_0x5cd1ef(_0x42ac33);});};AGIVertices[_0x31d3('0x10')]['getMailAccount']=function(_0x5a906b,_0x578930){this['rpc']['getMailAccountById'](_0x5a906b)[_0x31d3('0x12')](function(_0x24255c){_0x578930(null,_0x24255c?_0x24255c:![]);})[_0x31d3('0x14')](function(_0x5471a7){_0x578930(_0x5471a7);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x20')]=function(_0x5c8e54,_0x2108dc,_0x24e143){this['mailRpc']['sendMailMessage'](_0x5c8e54,_0x2108dc)['then'](function(){_0x24e143(null);})[_0x31d3('0x14')](function(_0x398063){_0x24e143(_0x398063);});};AGIVertices['prototype'][_0x31d3('0x21')]=function(_0x3e0c01,_0xb86b4){this[_0x31d3('0xe')][_0x31d3('0x22')](_0x3e0c01)[_0x31d3('0x12')](function(_0xb80baf){if(_0xb80baf){if(_0xb80baf['IntervalId']){_0xb86b4(null,[_0xb80baf[_0x31d3('0x23')]]);}else{_0xb86b4(null,_[_0x31d3('0x24')](_0xb80baf[_0x31d3('0x25')],_0x31d3('0x23')));}}else{_0xb86b4(null,![]);}})[_0x31d3('0x14')](function(_0x2fb893){_0xb86b4(_0x2fb893);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x1e')]=function(_0x164084){return util[_0x31d3('0x26')](_0x31d3('0x27'),FILES_PATH,_0x164084);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x28')]=function(_0x5cb53a,_0x4763fa,_0x2a77e2){odbc['open'](_0x5cb53a,function(_0xe8c6a){if(_0xe8c6a){logger[_0x31d3('0x29')](_0x31d3('0x2a'),_0xe8c6a);_0x2a77e2(_0xe8c6a);}else{logger['info'](_0x31d3('0x2b'));odbc[_0x31d3('0x2c')](_0x4763fa,function(_0x1cc539,_0x8d4c8b){if(_0x1cc539){logger[_0x31d3('0x2d')](_0x31d3('0x2e'),_0x4763fa);_0x2a77e2(_0x1cc539);}else{logger[_0x31d3('0x2d')](_0x31d3('0x2f'),_0x4763fa);odbc[_0x31d3('0x30')](function(_0x380f78){if(_0x380f78){logger['error'](_0x31d3('0x31'),_0x380f78);}_0x2a77e2(null,_0x8d4c8b);});}});}});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x32')]=function(_0x2c45f9,_0x9b99ae){this['rpc'][_0x31d3('0x33')](_0x2c45f9)[_0x31d3('0x12')](function(_0x442736){_0x9b99ae(null,_0x442736?_0x442736:![]);})[_0x31d3('0x14')](function(_0x3b9b54){_0x9b99ae(_0x3b9b54);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x34')]=function(_0x17a4ee,_0x323b4b){this[_0x31d3('0xe')][_0x31d3('0x34')](_0x17a4ee)[_0x31d3('0x12')](function(_0x3c1745){_0x323b4b(null,_0x3c1745);})[_0x31d3('0x14')](function(_0x4bb3ba){_0x323b4b(_0x4bb3ba);});};AGIVertices['prototype'][_0x31d3('0x35')]=function(_0x973e79,_0x2e0b81,_0x1ee7c2){this[_0x31d3('0xe')][_0x31d3('0x35')]({'uniqueid':this[_0x31d3('0xd')][_0x31d3('0x36')],'node':_0x973e79[_0x31d3('0x37')],'application':_0x973e79[_0x31d3('0x38')],'data':_0x2e0b81||null,'project_name':this[_0x31d3('0xd')]['arg_1'],'callerid':this['channel']['callerid']})[_0x31d3('0x12')](function(_0x20b6db){if(_0x1ee7c2){_0x1ee7c2(null,_0x20b6db);}})['catch'](function(_0x405e25){if(_0x1ee7c2){_0x1ee7c2(_0x405e25);}});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x39')]=function(_0x5b7aa2,_0x2ccf03,_0x15a42e,_0x2559ac){this[_0x31d3('0xe')][_0x31d3('0x39')]({'uniqueid':this[_0x31d3('0xd')][_0x31d3('0x36')],'callerid':this['channel'][_0x31d3('0x3a')],'calleridname':this[_0x31d3('0xd')]['calleridname'],'context':this['channel'][_0x31d3('0x3b')],'extension':this['channel'][_0x31d3('0x3c')],'priority':this['channel'][_0x31d3('0x3d')],'accountcode':this[_0x31d3('0xd')]['accountcode'],'dnid':this['channel'][_0x31d3('0x3e')],'projectName':this['channel'][_0x31d3('0x3f')],'saveName':_0x2ccf03,'filename':_0x5b7aa2['file']||_0x2ccf03,'savePath':_0x15a42e})['then'](function(_0x5c4535){_0x2559ac(null,_0x5c4535);})[_0x31d3('0x14')](function(_0x47a815){_0x2559ac(_0x47a815);});};AGIVertices[_0x31d3('0x10')]['createSquareMessage']=function(_0x5a8eaf,_0x501109,_0x129ea6){this[_0x31d3('0xe')]['createSquareMessage']({'uniqueid':this[_0x31d3('0xd')][_0x31d3('0x36')],'body':_0x5a8eaf,'direction':_0x501109})[_0x31d3('0x12')](function(_0x3d0e63){if(_0x129ea6){_0x129ea6(null,_0x3d0e63);}})[_0x31d3('0x14')](function(_0x3c20c8){if(_0x129ea6){_0x129ea6(_0x3c20c8);}});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x40')]=function(_0x8a0894,_0x49201e){this[_0x31d3('0xe')][_0x31d3('0x40')]({'firstName':_[_0x31d3('0x41')](_0x8a0894[_0x31d3('0x13')])||_[_0x31d3('0x42')](_0x8a0894['name'])?'callback_'+Math['random']():_0x8a0894[_0x31d3('0x13')],'lastName':_[_0x31d3('0x41')](_0x8a0894[_0x31d3('0x43')])||_[_0x31d3('0x42')](_0x8a0894[_0x31d3('0x43')])?null:_0x8a0894['lastName'],'phone':_0x8a0894[_0x31d3('0x44')],'ListId':_0x8a0894[_0x31d3('0x45')],'scheduledAt':_0x8a0894[_0x31d3('0x46')],'callbackUniqueid':this[_0x31d3('0xd')][_0x31d3('0x36')],'tags':'callback','description':_0x31d3('0x47')+_0x8a0894[_0x31d3('0x46')][_0x31d3('0x48')](),'priority':_0x8a0894['callback_priority']})[_0x31d3('0x12')](function(_0x5f0b78){_0x49201e(null,_0x5f0b78);})[_0x31d3('0x14')](function(_0x84ae){_0x49201e(_0x84ae);});};AGIVertices['prototype'][_0x31d3('0x49')]=function(_0x47f5ad,_0x4a12bc){this[_0x31d3('0xe')][_0x31d3('0x4a')](_0x47f5ad)[_0x31d3('0x12')](function(_0x43c503){_0x4a12bc(null,_0x43c503?_0x43c503['name']:![]);})['catch'](function(_0x56da2d){_0x4a12bc(_0x56da2d);});};AGIVertices['prototype']['agentPause']=function(_0x42c0ac,_0x54a080,_0x80c1d9){var _0x3e1541={'role':_0x31d3('0x4b')};_0x3e1541[_0x42c0ac]=this[_0x31d3('0xd')][_0x31d3('0x3a')];this[_0x31d3('0xe')]['agentPause'](_0x3e1541,_0x54a080,this['channel']['uniqueid'])[_0x31d3('0x12')](function(_0x5dc70b){_0x80c1d9(null,_['isNil'](_0x5dc70b)?![]:!![]);})[_0x31d3('0x14')](function(_0x23d488){logger['error'](_0x23d488);_0x80c1d9(null,![]);});};AGIVertices[_0x31d3('0x10')]['agentUnpause']=function(_0x57fb70,_0x28c146){var _0x5bb8b4={'role':_0x31d3('0x4b')};_0x5bb8b4[_0x57fb70]=this[_0x31d3('0xd')][_0x31d3('0x3a')];this['rpc'][_0x31d3('0x4c')](_0x5bb8b4)[_0x31d3('0x12')](function(_0x19e458){_0x28c146(null,_[_0x31d3('0x42')](_0x19e458)?![]:!![]);})[_0x31d3('0x14')](function(_0x11bf23){logger['error'](_0x11bf23);_0x28c146(null,![]);});};AGIVertices[_0x31d3('0x10')]['agentLogout']=function(_0x5d2c65,_0x194ec9){var _0x5bd11f={'role':_0x31d3('0x4b')};_0x5bd11f[_0x5d2c65]=this['channel'][_0x31d3('0x3a')];this[_0x31d3('0xe')][_0x31d3('0x4d')](_0x5bd11f)[_0x31d3('0x12')](function(_0x3ffe2a){_0x194ec9(null,_[_0x31d3('0x42')](_0x3ffe2a)?![]:!![]);})['catch'](function(_0x216c22){logger[_0x31d3('0x29')](_0x216c22);_0x194ec9(null,![]);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x4e')]=function(_0x28b24a,_0x5b0046){var _0x296424={'role':_0x31d3('0x4b')};_0x296424[_0x28b24a]=this['channel'][_0x31d3('0x3a')];var _0x479bb1=_0x28b24a!=_0x31d3('0x4f')?util[_0x31d3('0x26')]('%s/%s@from-sip/n','LOCAL',this['channel'][_0x31d3('0x3a')]):undefined;this[_0x31d3('0xe')][_0x31d3('0x4e')](_0x296424,_0x479bb1)[_0x31d3('0x12')](function(_0x116d91){_0x5b0046(null,_[_0x31d3('0x42')](_0x116d91)?![]:!![]);})[_0x31d3('0x14')](function(_0xf7b1f8){logger[_0x31d3('0x29')](_0xf7b1f8);_0x5b0046(null,![]);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x50')]=function(_0x1046fc,_0x19551f){sh[_0x31d3('0x51')](_[_0x31d3('0x52')](_0x1046fc),function(_0x2bdcef,_0x2eb6c9){var _0x2fbdf7=_0x2eb6c9[_0x31d3('0x53')](/(\r\n|\n|\r)/gm,'');_0x19551f(null,_0x2fbdf7);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x54')]=function(_0xc001ab,_0x119cf9){scripts[_0x31d3('0x54')](_0xc001ab[_0x31d3('0x55')],_0xc001ab[_0x31d3('0x56')]||'en',0x1)['then'](function(_0x23480a){_0x119cf9(null,_0x23480a);})[_0x31d3('0x14')](function(_0x5cd352){_0x119cf9(_0x5cd352);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x57')]=function(_0x3219a1,_0x4f83e7){scripts[_0x31d3('0x57')](this[_0x31d3('0xd')]['uniqueid'],_0x3219a1['key'],_0x3219a1[_0x31d3('0x55')],_0x3219a1[_0x31d3('0x58')]||'en')['then'](function(_0x2f4d49){_0x4f83e7(null,_0x2f4d49);})[_0x31d3('0x14')](function(_0x3ec7fe){_0x4f83e7(_0x3ec7fe);});};AGIVertices[_0x31d3('0x10')]['sestekNDA']=function(_0x48779a,_0x56f9f0){scripts[_0x31d3('0x59')](this['channel'],_0x48779a)[_0x31d3('0x12')](function(_0x4dbd75){_0x56f9f0(null,_0x4dbd75);})[_0x31d3('0x14')](function(_0x595ab5){_0x56f9f0(_0x595ab5);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x5a')]=function(_0x372a3a,_0x20c8a0){scripts['ispeechTTS'](_0x372a3a[_0x31d3('0x5b')],_0x372a3a[_0x31d3('0x55')],_0x372a3a[_0x31d3('0x5c')]||'en-US',_0x372a3a[_0x31d3('0x5d')])['then'](function(_0x3cb3be){_0x20c8a0(null,_0x3cb3be);})[_0x31d3('0x14')](function(_0x146cbc){_0x20c8a0(_0x146cbc);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x5e')]=function(_0x52b094,_0x540df2,_0x2120a1){scripts[_0x31d3('0x5e')](_0x540df2,_0x52b094[_0x31d3('0x5b')],_0x52b094[_0x31d3('0x5f')]||_0x31d3('0x60'),this[_0x31d3('0x61')](_0x52b094[_0x31d3('0x62')])?_0x52b094['model']:undefined)[_0x31d3('0x12')](function(_0x21d616){_0x2120a1(null,_0x21d616);})[_0x31d3('0x14')](function(_0x212ddc){_0x2120a1(_0x212ddc);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x63')]=function(_0x38da91,_0x28031a){scripts[_0x31d3('0x63')](_0x38da91[_0x31d3('0x64')],_0x38da91[_0x31d3('0x65')],_0x38da91[_0x31d3('0x66')],_0x38da91[_0x31d3('0x67')]||'Amy',_0x38da91[_0x31d3('0x55')],_0x38da91[_0x31d3('0x68')]||'text')['then'](function(_0x894ab0){_0x28031a(null,_0x894ab0);})['catch'](function(_0x377516){_0x28031a(_0x377516);});};AGIVertices['prototype'][_0x31d3('0x69')]=function(_0x928b0b,_0x5b4d0d){scripts[_0x31d3('0x69')](this[_0x31d3('0xd')][_0x31d3('0x36')],_0x928b0b[_0x31d3('0x64')],_0x928b0b['aws_secret_access_key'],_0x928b0b[_0x31d3('0x6a')],_0x928b0b[_0x31d3('0x55')],_0x928b0b[_0x31d3('0x6b')])['then'](function(_0x5f18a7){_0x5b4d0d(null,_0x5f18a7);})['catch'](function(_0x4a7012){_0x5b4d0d(_0x4a7012);});};AGIVertices[_0x31d3('0x10')][_0x31d3('0x6c')]=function(_0x16d410,_0x37ed21,_0xdb281c){scripts[_0x31d3('0x6c')](_0x37ed21,_0x16d410[_0x31d3('0x5b')],_0x16d410[_0x31d3('0x6d')]||'en-US')['then'](function(_0x4d211a){_0xdb281c(null,_0x4d211a);})[_0x31d3('0x14')](function(_0x4594ca){_0xdb281c(_0x4594ca);});};AGIVertices['prototype'][_0x31d3('0x6e')]=function(_0x34d7d5,_0x89696f,_0x2fc322){scripts[_0x31d3('0x6e')](_0x89696f,_0x34d7d5[_0x31d3('0x6f')],_0x34d7d5['appsecret'],_0x34d7d5['uri'])['then'](function(_0x5169f9){_0x2fc322(null,_0x5169f9);})[_0x31d3('0x14')](function(_0x4a7a82){_0x2fc322(_0x4a7a82);});};AGIVertices[_0x31d3('0x10')]['clear']=function(_0x4e8e9e){var _0x3ea989=_[_0x31d3('0x70')](verticesWithRetry,_0x4e8e9e[_0x31d3('0x38')])?_0x4e8e9e:_['clone'](_0x4e8e9e);for(var _0x37ef60 in _0x3ea989){if(_0x3ea989['hasOwnProperty'](_0x37ef60)){if(_0x3ea989[_0x37ef60]&&_[_0x31d3('0x71')](_0x3ea989[_0x37ef60])){_0x3ea989[_0x37ef60]=this['replaceAllVariables'](_0x3ea989[_0x37ef60]);}}}return _0x3ea989;};AGIVertices[_0x31d3('0x10')]['replaceAllVariables']=function(_0x5cbe41){var _0x4ad526=_0x5cbe41[_0x31d3('0x72')]('{');for(var _0x296794=0x1;_0x296794<_0x4ad526[_0x31d3('0x73')];_0x296794+=0x1){var _0x1ff0a1=_0x4ad526[_0x296794][_0x31d3('0x72')]('}');if(_0x1ff0a1[_0x31d3('0x73')]>0x1){_0x5cbe41=_0x5cbe41[_0x31d3('0x74')]('{'+_0x1ff0a1[0x0]+'}',this['channel'][_0x31d3('0x75')](_0x1ff0a1[0x0])[_0x31d3('0x76')]||_0x1ff0a1[0x0]);}}if(_0x4ad526[_0x31d3('0x73')]===0x1){return _0x5cbe41['toString']();}return this['replaceAllVariables'](_0x5cbe41);};AGIVertices[_0x31d3('0x10')]['getAndSetVariable']=function(_0x397e3b,_0x5c8015){var _0x1d6610=this[_0x31d3('0xd')][_0x31d3('0x75')](_0x397e3b);if(_0x1d6610[_0x31d3('0x77')]===-0x1){return _0x1d6610;}logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x78'),_0x5c8015,_0x1d6610['extra']));return this[_0x31d3('0xd')][_0x31d3('0x79')](_0x5c8015,_0x1d6610[_0x31d3('0x76')]);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x61')]=function(_0x2884ed){return _0x2884ed&&_0x2884ed!=='0'&&_0x2884ed!=='-1'&&_0x2884ed!=='';};AGIVertices['prototype'][_0x31d3('0x7a')]=function(_0x4b925a){this[_0x31d3('0x35')]['sync'](this,_0x4b925a,'-');_0x4b925a['retry']=_0x4b925a[_0x31d3('0x7a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x31d3('0x10')][_0x31d3('0x7')]=function(_0x42963b){logger['info'](util[_0x31d3('0x26')](_0x31d3('0x7b'),_0x42963b[_0x31d3('0x37')]));return this[_0x31d3('0xd')][_0x31d3('0x7')]([_0x42963b['command'],_0x42963b['args']]);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x7c')]=function(_0x1cffed){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x7d'),_0x1cffed['label']));if(this[_0x31d3('0x61')](_0x1cffed[_0x31d3('0x7e')])){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1cffed[_0x31d3('0x7e')]));var _0x2029f6=this[_0x31d3('0xd')][_0x31d3('0x7f')](_0x1cffed[_0x31d3('0x7e')]);if(_0x2029f6[_0x31d3('0x77')]===-0x1){return _0x2029f6;}}return this[_0x31d3('0xd')][_0x31d3('0x7c')]();};AGIVertices['prototype'][_0x31d3('0x80')]=function(_0x224277){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x81'),_0x224277[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x224277['list_id'])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x224277,'no\x20list\x20selected');}_0x224277['scheduledAt']=moment();if(this['isConfigured'](_0x224277['delay'])){_0x224277[_0x31d3('0x46')]=moment()[_0x31d3('0x82')](_0x224277[_0x31d3('0x83')],'minutes');}if(!this[_0x31d3('0x61')](_0x224277[_0x31d3('0x84')])){_0x224277['callback_priority']=0x2;}this['createCmContact'][_0x31d3('0x85')](this,_0x224277);return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x87'),_0x224277[_0x31d3('0x44')],_0x224277[_0x31d3('0x45')],_0x224277[_0x31d3('0x46')]));};AGIVertices[_0x31d3('0x10')]['custom_app']=function(_0x1d3cea){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x88'),_0x1d3cea[_0x31d3('0x37')]));var _0xeddc14=this[_0x31d3('0xd')][_0x31d3('0x51')](_0x1d3cea[_0x31d3('0x89')],_0x1d3cea[_0x31d3('0x8a')]);if(_0xeddc14['result']===-0x1){return _0xeddc14;}return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('Executed\x20command\x20%s\x20%s',_0x1d3cea['application'],_0x1d3cea['options']));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x8b')]=function(_0x3a11e8){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3a11e8[_0x31d3('0x37')]));if(!this['isConfigured'](_0x3a11e8[_0x31d3('0x55')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x8c'));}var _0xfc2782='\x22'+_0x3a11e8['text']+'\x22';if(this[_0x31d3('0x61')](_0x3a11e8[_0x31d3('0x8a')])){_0xfc2782+=','+_0x3a11e8[_0x31d3('0x8a')];}var _0x27dd51=this['channel'][_0x31d3('0x51')](_0x31d3('0x8d'),_0xfc2782);if(_0x27dd51[_0x31d3('0x77')]===-0x1){return _0x27dd51;}return this['channel'][_0x31d3('0x86')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0xfc2782));};AGIVertices['prototype'][_0x31d3('0x8e')]=function(_0xd79e57){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x8f'),_0xd79e57[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0xd79e57['text'])){return this[_0x31d3('0xd')]['noop'](_0x31d3('0x8c'));}var _0x58701f='\x22'+_0xd79e57[_0x31d3('0x55')]+'\x22';if(this[_0x31d3('0x61')](_0xd79e57[_0x31d3('0x8a')])){_0x58701f+=','+_0xd79e57[_0x31d3('0x8a')];}var _0x3e2e46=this[_0x31d3('0xd')][_0x31d3('0x51')]('MRCPSynth',_0x58701f);if(_0x3e2e46['result']===-0x1){return _0x3e2e46;}return this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x58701f));};AGIVertices['prototype']['lumenvoxasr']=function(_0x369bea){logger['info'](util[_0x31d3('0x26')](_0x31d3('0x90'),_0x369bea[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x369bea['grammar'])){return this[_0x31d3('0xd')][_0x31d3('0x86')]('no\x20grammar\x20configured');}var _0x400918=_0x369bea[_0x31d3('0x91')];if(this[_0x31d3('0x61')](_0x369bea[_0x31d3('0x8a')])){_0x400918+=','+_0x369bea[_0x31d3('0x8a')];}var _0x47ca6b=this[_0x31d3('0xd')][_0x31d3('0x51')]('MRCPRecog',_0x400918);if(_0x47ca6b[_0x31d3('0x77')]===-0x1){return _0x47ca6b;}var _0x288255=this[_0x31d3('0x92')]('RECOG_CONFIDENCE()',_0x31d3('0x93'));if(_0x288255[_0x31d3('0x77')]===-0x1){return _0x288255;}var _0x14d490=this[_0x31d3('0x92')]('RECOG_INPUT()',_0x31d3('0x94'));if(_0x14d490[_0x31d3('0x77')]===-0x1){return _0x14d490;}var _0x4dfdfe=this[_0x31d3('0x92')](_0x31d3('0x95'),_0x31d3('0x96'));if(_0x4dfdfe[_0x31d3('0x77')]===-0x1){return _0x4dfdfe;}return this['channel']['noop'](util[_0x31d3('0x26')](_0x31d3('0x97'),_0x400918));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x98')]=function(_0x1e6ca1){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x99'),_0x1e6ca1[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x1e6ca1[_0x31d3('0x91')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x9a'));}var _0x485c64=_0x1e6ca1[_0x31d3('0x91')];if(this[_0x31d3('0x61')](_0x1e6ca1[_0x31d3('0x8a')])){_0x485c64+=','+_0x1e6ca1[_0x31d3('0x8a')];}var _0x2a8bbc=this[_0x31d3('0xd')][_0x31d3('0x51')](_0x31d3('0x9b'),_0x485c64);if(_0x2a8bbc[_0x31d3('0x77')]===-0x1){return _0x2a8bbc;}var _0xdf5f98=this['getAndSetVariable'](_0x31d3('0x9c'),'SESTEK_ASR_CONFIDENCE');if(_0xdf5f98[_0x31d3('0x77')]===-0x1){return _0xdf5f98;}var _0x4ad655=this[_0x31d3('0x92')](_0x31d3('0x9d'),'SESTEK_ASR_TRANSCRIPT');if(_0x4ad655[_0x31d3('0x77')]===-0x1){return _0x4ad655;}var _0xdfa708=this[_0x31d3('0x92')]('RECOG_INSTANCE()',_0x31d3('0x9e'));if(_0xdfa708[_0x31d3('0x77')]===-0x1){return _0xdfa708;}return this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x97'),_0x485c64));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x9f')]=function(_0x22da15){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xa0'),_0x22da15[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x22da15[_0x31d3('0xa1')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x22da15,_0x31d3('0xa2'));}var _0x45abf1=this[_0x31d3('0x18')][_0x31d3('0x85')](this,_0x22da15[_0x31d3('0xa1')]);if(!_0x45abf1){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x22da15,_0x31d3('0xa3'));}if(!this[_0x31d3('0x61')](_0x22da15[_0x31d3('0x2c')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x22da15,_0x31d3('0xa4'));}var _0x2a2046=_0x22da15['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')]('query:\x20%s',_0x2a2046));var _0x13b1f3=this[_0x31d3('0x28')]['sync'](this,_0x45abf1,_0x2a2046);this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x22da15,_0x2a2046);if(!this['isConfigured'](_0x22da15[_0x31d3('0xa5')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xa6'));}var _0x4d59f7=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x22da15['variable_id']);if(!_0x4d59f7){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x22da15,'no\x20variable\x20found');}var _0x39d786=this;_0x13b1f3[_0x31d3('0xa7')](function(_0x2baa39,_0xa7c112){Object[_0x31d3('0xa8')](_0x2baa39)['forEach'](function(_0x51d331){_0x39d786[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')](_0x31d3('0xa9'),_0x4d59f7,_0xa7c112,_0x51d331),_0x2baa39[_0x51d331]);});});this[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')](_0x31d3('0xaa'),_0x4d59f7),_0x13b1f3[_0x31d3('0x73')]);return this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0xab'),_0x4d59f7));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xac')]=function(_0x50203e){logger[_0x31d3('0xad')](util[_0x31d3('0x26')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x50203e['label']));if(!this['isConfigured'](_0x50203e['sip_id'])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x50203e,_0x31d3('0xae'));}var _0x30af53=this[_0x31d3('0x19')][_0x31d3('0x85')](this,_0x50203e[_0x31d3('0xaf')]);if(!_0x30af53){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x50203e,_0x31d3('0xb0'));}var _0x39b4b2=this[_0x31d3('0xd')][_0x31d3('0x51')](_0x31d3('0xb1'),[util[_0x31d3('0x26')](_0x31d3('0xb2'),_0x30af53),_0x50203e[_0x31d3('0x7e')],_0x50203e[_0x31d3('0xb3')],_0x50203e[_0x31d3('0xb4')]]);if(_0x39b4b2[_0x31d3('0x77')]===-0x1){return _0x39b4b2;}return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xb5'),_0x31d3('0xb1')));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xb6')]=function(_0x1cd443){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xb7'),_0x1cd443[_0x31d3('0x37')]));if(!this['isConfigured'](_0x1cd443['key'])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xb8'));}if(!this['isConfigured'](_0x1cd443['text'])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0xb9')]=!![];this[_0x31d3('0x35')](_0x1cd443);this[_0x31d3('0xba')](_0x1cd443[_0x31d3('0x55')],'in');this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('Trying\x20Dialogflow:\x20%s',_0x1cd443[_0x31d3('0x55')]));var _0x140435=this[_0x31d3('0x57')]['sync'](this,_0x1cd443);if(_0x140435){for(var _0x92628d in _0x140435){if(_0x140435[_0x31d3('0xbb')](_0x92628d)){this[_0x31d3('0xd')]['setVariable'](util[_0x31d3('0x26')](_0x31d3('0xbc'),_0x92628d[_0x31d3('0xbd')]()),_0x140435[_0x92628d]);}}this[_0x31d3('0xba')](_0x140435['speech'],'out');return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('Dialogflow\x20Result\x20%s',_0x140435[_0x31d3('0xbe')]));}return this[_0x31d3('0xd')]['error'](_0x1cd443,_0x31d3('0xbf'));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xc0')]=function(_0x14493f){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0xc1'),_0x14493f[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x14493f[_0x31d3('0xc2')])){return this['channel'][_0x31d3('0x86')](_0x31d3('0xc3'));}if(!this[_0x31d3('0x61')](_0x14493f['username'])){return this['channel']['noop'](_0x31d3('0xc4'));}if(!this[_0x31d3('0x61')](_0x14493f[_0x31d3('0xc5')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xc6'));}if(!this[_0x31d3('0x61')](_0x14493f[_0x31d3('0xc7')])){return this['channel'][_0x31d3('0x86')](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0xb9')]=!![];this[_0x31d3('0x35')](_0x14493f);this[_0x31d3('0xba')](_0x14493f[_0x31d3('0x55')],'in');this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xc8'),_0x14493f[_0x31d3('0x55')]));var _0xce91d0=this['sestekNDA'][_0x31d3('0x85')](this,_0x14493f);if(_0xce91d0){for(var _0x489528 in _0xce91d0){if(_0xce91d0[_0x31d3('0xbb')](_0x489528)){this[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')]('SESTEK_NDA_%s',_0x489528[_0x31d3('0xbd')]()),_0xce91d0[_0x489528]);}}this[_0x31d3('0xba')](_0xce91d0[_0x31d3('0xbe')],_0x31d3('0xc9'));if(_0xce91d0[_0x31d3('0xca')]){this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xcb'),_0xce91d0[_0x31d3('0xca')]));var _0x301c50=this[_0x31d3('0xd')]['streamFile'](_0xce91d0[_0x31d3('0xca')]);try{fs['unlink'](_0xce91d0[_0x31d3('0xca')]+'.wav');}catch(_0x476b81){logger[_0x31d3('0x29')](_0x476b81);}return _0x301c50;}else{return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xcc'),_0xce91d0[_0x31d3('0xbe')]));}}return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x14493f,_0x31d3('0xcd'));};AGIVertices[_0x31d3('0x10')]['end']=function(_0x5572f3){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xce'),_0x5572f3['label']));return this[_0x31d3('0xd')]['noop']('end');};AGIVertices[_0x31d3('0x10')][_0x31d3('0xcf')]=function(_0x5f470e){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5f470e['label']));var _0x3cefcc='';if(_0x5f470e[_0x31d3('0xd0')]){if(!this[_0x31d3('0x61')](_0x5f470e[_0x31d3('0xd0')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x5f470e,_0x31d3('0xd1'));}else{var _0x4b68b5=parseInt(_0x5f470e['trunk_id'],0xa);if(isNaN(_0x4b68b5)){_0x3cefcc=_0x5f470e[_0x31d3('0xd0')];}else{_0x3cefcc=this[_0x31d3('0x1b')]['sync'](this,_0x5f470e[_0x31d3('0xd0')]);if(!_0x3cefcc){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x5f470e,_0x31d3('0xd2'));}}}}else if(_0x5f470e['trunk_name']){_0x3cefcc=_0x5f470e['trunk_name'];}else{return this[_0x31d3('0xd')]['error'](_0x5f470e,'no\x20trunk\x20selected');}var _0x14f8e5=this[_0x31d3('0xd')]['exec'](_0x31d3('0xb1'),[util[_0x31d3('0x26')]('SIP/%s/%s',_0x3cefcc,_0x5f470e[_0x31d3('0x44')]),_0x5f470e[_0x31d3('0x7e')],_0x5f470e[_0x31d3('0xb3')],_0x5f470e[_0x31d3('0xb4')]]);if(_0x14f8e5[_0x31d3('0x77')]===-0x1){return _0x14f8e5;}return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xb5'),_0x31d3('0xb1')));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xd3')]=function(_0x571f05){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x571f05[_0x31d3('0x37')]));return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xd3'));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xb')]=function(_0x1bf4b5){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1bf4b5['label']));if(_0x1bf4b5['retry']===0x0){return this[_0x31d3('0x7a')](_0x1bf4b5);}_0x1bf4b5['retry']-=0x1;if(!this[_0x31d3('0x61')](_0x1bf4b5['file_id'])){return this[_0x31d3('0xd')]['error'](_0x1bf4b5,_0x31d3('0xd4'));}var _0x2634d=this[_0x31d3('0xd5')][_0x31d3('0x85')](this,_0x1bf4b5['file_id']);if(!_0x2634d){return this['channel'][_0x31d3('0x29')](_0x1bf4b5,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x1bf4b5[_0x31d3('0xa5')])){return this[_0x31d3('0xd')][_0x31d3('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5692e4=this['channel']['getData'](_0x2634d,_0x1bf4b5[_0x31d3('0xd6')],_0x1bf4b5[_0x31d3('0xd7')]);var _0x51d0f1=_0x5692e4[_0x31d3('0x77')]?_0x5692e4['result'][_0x31d3('0x48')]():'';logger['info']('test',JSON[_0x31d3('0xd8')](_0x5692e4));if(_0x5692e4[_0x31d3('0x77')]===-0x1){this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x1bf4b5,_0x51d0f1);return _0x5692e4;}else if(_0x5692e4[_0x31d3('0x76')]===_0x31d3('0x7e')){_0x5692e4[_0x31d3('0x77')]=_0x51d0f1[_0x31d3('0x73')]>=parseInt(_0x1bf4b5[_0x31d3('0xd9')])?'x':'i';}else{_0x5692e4[_0x31d3('0x77')]=_0x51d0f1[_0x31d3('0x73')]>=parseInt(_0x1bf4b5['mindigit'])&&_0x51d0f1[_0x31d3('0x73')]<=parseInt(_0x1bf4b5[_0x31d3('0xd7')])?'x':'i';}var _0x3fb1e1=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x1bf4b5[_0x31d3('0xa5')]);if(!_0x3fb1e1){return this[_0x31d3('0xd')]['error'](_0x1bf4b5,_0x31d3('0xda'));}this[_0x31d3('0xd')][_0x31d3('0x79')](_0x3fb1e1,_0x51d0f1);if(this[_0x31d3('0x61')](_0x1bf4b5['hiddendigitsnum'])){var _0x1d5a1e=parseInt(_0x1bf4b5['hiddendigitsnum'],0xa);var _0x1421d4=rs[_0x31d3('0xdb')]({'charset':'*','length':_0x1d5a1e});var _0x4e4256=_0x51d0f1['length'];if(_0x4e4256>0x0){if(_0x4e4256>_0x1d5a1e){this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x1bf4b5,_0x1bf4b5[_0x31d3('0xdc')]==='first'?_0x1421d4+_0x51d0f1['substr'](_0x1d5a1e):_0x51d0f1['substr'](0x0,_0x4e4256-_0x1d5a1e)+_0x1421d4);}else{this[_0x31d3('0x35')]['sync'](this,_0x1bf4b5,rs[_0x31d3('0xdb')]({'charset':'*','length':_0x4e4256}));}}else{this[_0x31d3('0x35')]['sync'](this,_0x1bf4b5,'');}}else{this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x1bf4b5,_0x51d0f1);}return _0x5692e4;};AGIVertices[_0x31d3('0x10')]['getsecretdigits']=function(_0x1257b7){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xdd'),_0x1257b7[_0x31d3('0x37')]));return this[_0x31d3('0xb')](_0x1257b7);};AGIVertices[_0x31d3('0x10')][_0x31d3('0xde')]=function(_0x39d2a3){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xdf'),_0x39d2a3[_0x31d3('0x37')]));this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x39d2a3,_0x39d2a3['goalname']);return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('GOAL\x20%s',_0x39d2a3[_0x31d3('0xe0')]));};AGIVertices[_0x31d3('0x10')][_0x31d3('0xe1')]=function(_0x46fd3f){logger['info'](util[_0x31d3('0x26')](_0x31d3('0xe2'),_0x46fd3f['label']));if(!this[_0x31d3('0x61')](_0x46fd3f['aws_access_key_id'])||!this['isConfigured'](_0x46fd3f['aws_secret_access_key'])){return this[_0x31d3('0xd')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x31d3('0x61')](_0x46fd3f[_0x31d3('0x55')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0xe3'),_0x46fd3f[_0x31d3('0x55')]));var _0xe8eb20=this[_0x31d3('0x63')][_0x31d3('0x85')](this,_0x46fd3f);if(_0xe8eb20){this['channel'][_0x31d3('0x86')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0xe8eb20));var _0x13415b=this[_0x31d3('0xd')][_0x31d3('0xe4')](_0xe8eb20);try{fs[_0x31d3('0xe5')](_0xe8eb20+_0x31d3('0xe6'));}catch(_0x211b8d){logger[_0x31d3('0x29')](_0x211b8d);}return _0x13415b;}return this[_0x31d3('0xd')]['error'](_0x46fd3f,_0x31d3('0xe7'));};AGIVertices['prototype'][_0x31d3('0xe8')]=function(_0x2b804c){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2b804c[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x2b804c[_0x31d3('0x64')])||!this[_0x31d3('0x61')](_0x2b804c[_0x31d3('0x65')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xe9'));}if(!this[_0x31d3('0x61')](_0x2b804c[_0x31d3('0x6b')])){return this['channel'][_0x31d3('0x86')](_0x31d3('0xea'));}if(!this[_0x31d3('0x61')](_0x2b804c[_0x31d3('0x55')])){return this[_0x31d3('0xd')]['noop'](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0xb9')]=!![];this[_0x31d3('0x35')](_0x2b804c);this[_0x31d3('0xba')](_0x2b804c[_0x31d3('0x55')],'in');this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xeb'),_0x2b804c['text']));var _0x489e9=this[_0x31d3('0x69')][_0x31d3('0x85')](this,_0x2b804c);if(_0x489e9){for(var _0x5a0a8c in _0x489e9){if(_0x489e9['hasOwnProperty'](_0x5a0a8c)&&_['isString'](_0x489e9[_0x5a0a8c])){this['channel'][_0x31d3('0x79')](util[_0x31d3('0x26')]('AWS_LEX_%s',_0x5a0a8c['toUpperCase']()),_0x489e9[_0x5a0a8c]);}}if(_[_0x31d3('0x42')](_0x489e9[_0x31d3('0xec')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xed'));}else{this[_0x31d3('0xba')](_0x489e9[_0x31d3('0xec')],'out');return this[_0x31d3('0xd')][_0x31d3('0x86')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x489e9[_0x31d3('0xec')]));}}return this[_0x31d3('0xd')]['error'](_0x2b804c,_0x31d3('0xee'));};AGIVertices['prototype'][_0x31d3('0xef')]=function(_0x5e3b9c){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xf0'),_0x5e3b9c[_0x31d3('0x37')],_0x5e3b9c['timeout']));if(!this['isConfigured'](_0x5e3b9c[_0x31d3('0x5b')])){return this[_0x31d3('0xd')][_0x31d3('0x86')]('no\x20key\x20configured');}var _0x1f197e='wav';var _0x5e8fd9=util['format'](_0x31d3('0xf1'),FILES_PATH,rs['generate'](0x4));var _0x3f6049=util[_0x31d3('0x26')](_0x31d3('0xf2'),_0x5e8fd9,_0x1f197e);var _0xd2eb5f=!![];if(_0x5e3b9c['beep']==='NOBEEP'){_0xd2eb5f=![];}var _0x252b9a=this[_0x31d3('0xd')][_0x31d3('0xf3')](_0x5e8fd9,_0x1f197e,_0x5e3b9c[_0x31d3('0xf4')],_0x5e3b9c[_0x31d3('0x7e')],undefined,_0xd2eb5f);if(_0x252b9a['result']!==-0x1){this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0xf5'),_0x3f6049));var _0x322ed5=this[_0x31d3('0x6c')][_0x31d3('0x85')](this,_0x5e3b9c,_0x3f6049);if(_0x322ed5){for(var _0x3c9f3b in _0x322ed5){if(_0x322ed5['hasOwnProperty'](_0x3c9f3b)){this[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')](_0x31d3('0xf6'),_0x3c9f3b[_0x31d3('0xbd')]()),_0x322ed5[_0x3c9f3b]);}}return this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0xf7'),JSON[_0x31d3('0xd8')](_0x322ed5)));}}return _0x252b9a;};AGIVertices[_0x31d3('0x10')][_0x31d3('0xf8')]=function(_0x3ac0cc){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0xf9'),_0x3ac0cc[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x3ac0cc['appid'])){return this[_0x31d3('0xd')][_0x31d3('0x86')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x3ac0cc[_0x31d3('0xfa')])){return this[_0x31d3('0xd')][_0x31d3('0x86')]('no\x20appsecret\x20configured');}var _0x529e1a=_0x31d3('0xfb');var _0x218305=util[_0x31d3('0x26')](_0x31d3('0xf1'),FILES_PATH,rs['generate'](0x4));var _0x368d5f=util['format'](_0x31d3('0xf2'),_0x218305,_0x529e1a);var _0x1e3b91=!![];if(_0x3ac0cc[_0x31d3('0xfc')]===_0x31d3('0xfd')){_0x1e3b91=![];}var _0xa021a2=this[_0x31d3('0xd')][_0x31d3('0xf3')](_0x218305,_0x529e1a,_0x3ac0cc[_0x31d3('0xf4')],_0x3ac0cc[_0x31d3('0x7e')],undefined,_0x1e3b91);if(_0xa021a2[_0x31d3('0x77')]!==-0x1){this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0xfe'),_0x368d5f));var _0x178889=this[_0x31d3('0x6e')][_0x31d3('0x85')](this,_0x3ac0cc,_0x368d5f);if(_0x178889){for(var _0x180552 in _0x178889){if(_0x178889[_0x31d3('0xbb')](_0x180552)){this[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')](_0x31d3('0xff'),_0x180552[_0x31d3('0xbd')]()),_0x178889[_0x180552]);}}return this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')]('TildeASR\x20Result\x20%s',JSON[_0x31d3('0xd8')](_0x178889)));}}return _0xa021a2;};AGIVertices[_0x31d3('0x10')]['gotoc']=function(_0x5cd09e){logger['info'](util[_0x31d3('0x26')](_0x31d3('0x100'),_0x5cd09e[_0x31d3('0x37')]));return this[_0x31d3('0xd')][_0x31d3('0x101')](_0x5cd09e[_0x31d3('0x3b')],_0x5cd09e[_0x31d3('0x3c')],_0x5cd09e[_0x31d3('0x3d')]);};AGIVertices[_0x31d3('0x10')]['gotoif']=function(_0xf8c316){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x102'),_0xf8c316[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0xf8c316[_0x31d3('0x103')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0xf8c316,'no\x20condition\x20configured');}try{var _0xbc49cb=eval(_0xf8c316[_0x31d3('0x103')])?_0x31d3('0x104'):_0x31d3('0x105');this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x106'),_0xf8c316['condition'],_0xbc49cb));return{'code':0xc8,'result':_0xbc49cb};}catch(_0x4f4a1d){return{'code':0xc8,'result':_0x31d3('0x105')};}};AGIVertices[_0x31d3('0x10')][_0x31d3('0x107')]=function(_0x211770){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x108'),_0x211770[_0x31d3('0x37')]));if(!this['isConfigured'](_0x211770[_0x31d3('0x109')])){return this['channel'][_0x31d3('0x29')](_0x211770,_0x31d3('0x10a'));}var _0xfc7660=this[_0x31d3('0x21')][_0x31d3('0x85')](this,_0x211770[_0x31d3('0x109')]);if(!_0xfc7660){return this['channel'][_0x31d3('0x29')](_0x211770,_0x31d3('0x10b'));}for(var _0x4c055c=0x0;_0x4c055c<_0xfc7660[_0x31d3('0x73')];_0x4c055c+=0x1){var _0x196328=this[_0x31d3('0xd')][_0x31d3('0x75')](util['format'](_0x31d3('0x10c'),_0xfc7660[_0x4c055c]));if(_0x196328[_0x31d3('0x77')]===-0x1){return _0x196328;}logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x10d'),_0xfc7660[_0x4c055c],_0x196328[_0x31d3('0x76')]));if(_0x196328[_0x31d3('0x76')]==='true'){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x10d'),_0xfc7660[_0x4c055c],_0x31d3('0x104')));this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0x10d'),_0xfc7660[_0x4c055c],_0x31d3('0x104')));return{'code':0xc8,'result':_0x31d3('0x104')};}else{logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x10d'),_0xfc7660[_0x4c055c],'false'));this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x10d'),_0xfc7660[_0x4c055c],_0x31d3('0x105')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x374154){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x10e'),_0x374154[_0x31d3('0x37')]));return this['channel'][_0x31d3('0x10f')]();};AGIVertices[_0x31d3('0x10')][_0x31d3('0x110')]=function(_0x4502c2){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4502c2[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x4502c2[_0x31d3('0x5b')])){return this[_0x31d3('0xd')]['noop'](_0x31d3('0xb8'));}var _0x11645a='wav';var _0x48c197=util[_0x31d3('0x26')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x1e8e5d=util[_0x31d3('0x26')](_0x31d3('0xf2'),_0x48c197,_0x11645a);var _0x128934=!![];if(_0x4502c2[_0x31d3('0xfc')]===_0x31d3('0xfd')){_0x128934=![];}var _0x295095=this[_0x31d3('0xd')][_0x31d3('0xf3')](_0x48c197,_0x11645a,_0x4502c2['intKey'],_0x4502c2[_0x31d3('0x7e')],undefined,_0x128934);if(_0x295095['result']!==-0x1){this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x111'),_0x1e8e5d));var _0xcb98af=this[_0x31d3('0x5e')]['sync'](this,_0x4502c2,_0x1e8e5d);if(_0xcb98af){for(var _0x271c5a in _0xcb98af){if(_0xcb98af[_0x31d3('0xbb')](_0x271c5a)){this[_0x31d3('0xd')][_0x31d3('0x79')](util['format'](_0x31d3('0x112'),_0x271c5a[_0x31d3('0xbd')]()),_0xcb98af[_0x271c5a]);}}return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x113'),JSON[_0x31d3('0xd8')](_0xcb98af)));}}return _0x295095;};AGIVertices[_0x31d3('0x10')][_0x31d3('0x114')]=function(_0x1aa391){logger['info'](util[_0x31d3('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1aa391[_0x31d3('0x37')]));if(!this['isConfigured'](_0x1aa391[_0x31d3('0x5b')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0xb8'));}if(!this[_0x31d3('0x61')](_0x1aa391[_0x31d3('0x55')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('Trying\x20ispeech\x20TTS\x20%s',_0x1aa391[_0x31d3('0x55')]));var _0x1fcc7e=this[_0x31d3('0x5a')][_0x31d3('0x85')](this,_0x1aa391);if(_0x1fcc7e){this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x111'),_0x1fcc7e));var _0x2c60de=this[_0x31d3('0xd')][_0x31d3('0xe4')](_0x1fcc7e,_0x1aa391[_0x31d3('0xf4')]);try{fs['unlink'](_0x1fcc7e+_0x31d3('0xe6'));}catch(_0xdc1f3){logger[_0x31d3('0x29')](_0xdc1f3);}return _0x2c60de;}return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x1aa391,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x31d3('0x10')][_0x31d3('0x115')]=function(_0x5eeb22){logger['info'](util[_0x31d3('0x26')](_0x31d3('0x116'),_0x5eeb22[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x5eeb22[_0x31d3('0x117')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x5eeb22,_0x31d3('0x118'));}logger['info'](util[_0x31d3('0x26')](_0x31d3('0x119'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x5eeb22[_0x31d3('0x117')]));var _0x383538=this[_0x31d3('0x4e')][_0x31d3('0x85')](this,_0x5eeb22['findBy']);if(_0x383538){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x5eeb22[_0x31d3('0x117')]));this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0x11a'),this['channel']['callerid'],_0x5eeb22[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11b')};}else{logger[_0x31d3('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x31d3('0x3a')],_0x5eeb22['findBy']));this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x11c'),this[_0x31d3('0xd')]['callerid'],_0x5eeb22[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11d')};}};AGIVertices[_0x31d3('0x10')][_0x31d3('0x11e')]=function(_0x3889b3){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x11f'),_0x3889b3['label']));if(!this[_0x31d3('0x61')](_0x3889b3['findBy'])){return this['channel'][_0x31d3('0x29')](_0x3889b3,_0x31d3('0x118'));}logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x119'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x3889b3['findBy']));var _0x280d4f=this[_0x31d3('0x4d')][_0x31d3('0x85')](this,_0x3889b3['findBy']);if(_0x280d4f){logger['info'](util['format'](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x3889b3['findBy']));this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x3889b3[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11b')};}else{logger['info'](util[_0x31d3('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x31d3('0xd')]['callerid'],_0x3889b3['findBy']));this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0x11c'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x3889b3[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11d')};}};AGIVertices[_0x31d3('0x10')][_0x31d3('0x120')]=function(_0x1450ba){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1450ba[_0x31d3('0x37')]));if(!this['isConfigured'](_0x1450ba[_0x31d3('0x121')])){return this['channel'][_0x31d3('0x29')](_0x1450ba,_0x31d3('0x122'));}this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x123'),_0x1450ba['operation']));var _0x3bd0d2=eval(_0x1450ba[_0x31d3('0x121')]);if(!this[_0x31d3('0x61')](_0x1450ba[_0x31d3('0xa5')])){return this[_0x31d3('0xd')][_0x31d3('0x86')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x46c572=this[_0x31d3('0x75')]['sync'](this,_0x1450ba['variable_id']);if(!_0x46c572){return this[_0x31d3('0xd')]['error'](_0x1450ba,_0x31d3('0xda'));}if(_[_0x31d3('0x124')](_0x3bd0d2)){var _0x212c1e=this;_0x3bd0d2['forEach'](function(_0xb4215a,_0x1b6723){_0x212c1e[_0x31d3('0xd')][_0x31d3('0x79')](util[_0x31d3('0x26')]('%s[%s]',_0x46c572,_0x1b6723),_0xb4215a);});return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('variable\x20%s[key]\x20set',_0x46c572));}else{return this['channel']['setVariable'](_0x46c572,_0x3bd0d2);}};AGIVertices[_0x31d3('0x10')][_0x31d3('0xa')]=function(_0x461f7a){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x125'),_0x461f7a['label']));if(_0x461f7a[_0x31d3('0x126')]===0x0){return this['maxRetry'](_0x461f7a);}_0x461f7a[_0x31d3('0x126')]-=0x1;if(!this[_0x31d3('0x61')](_0x461f7a['file_id'])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x461f7a,_0x31d3('0xd4'));}var _0x5b623f=this[_0x31d3('0xd5')][_0x31d3('0x85')](this,_0x461f7a[_0x31d3('0x127')]);if(!_0x5b623f){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x461f7a,'no\x20file\x20audio\x20found');}var _0x292609=this[_0x31d3('0xd')][_0x31d3('0x128')](_0x5b623f,_0x461f7a[_0x31d3('0xd6')],_0x461f7a[_0x31d3('0x129')]);var _0x35acd3=_0x292609['result'];if(_0x292609[_0x31d3('0x77')]===-0x1){this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x461f7a,'-1');return _0x292609;}else if(_0x292609[_0x31d3('0x76')]===_0x31d3('0x7e')){_0x292609[_0x31d3('0x77')]=_0x292609[_0x31d3('0x77')][_0x31d3('0x73')]>0x0?_0x292609[_0x31d3('0x77')]:'t';}else if(_['isEmpty'](_0x292609[_0x31d3('0x77')])){_0x292609[_0x31d3('0x77')]='#';_0x35acd3='#';}if(!this[_0x31d3('0x61')](_0x461f7a[_0x31d3('0xa5')])){this[_0x31d3('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1fcd06=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x461f7a[_0x31d3('0xa5')]);if(!_0x1fcd06){return this[_0x31d3('0xd')]['error'](_0x461f7a,_0x31d3('0xda'));}this[_0x31d3('0xd')]['setVariable'](_0x1fcd06,_0x35acd3);}this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x461f7a,_0x35acd3);return _0x292609;};AGIVertices[_0x31d3('0x10')]['noop']=function(_0x4f46b9){logger['info'](util[_0x31d3('0x26')](_0x31d3('0x12a'),_0x4f46b9['label']));return this[_0x31d3('0xd')]['noop'](_0x4f46b9[_0x31d3('0x12b')]||_0x4f46b9['label']);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x12c')]=function(_0x57d613){logger[_0x31d3('0x2d')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x57d613[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x57d613[_0x31d3('0x117')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x57d613,'no\x20find\x20by\x20configured');}logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x31d3('0xd')]['callerid'],_0x57d613[_0x31d3('0x117')]));var _0x2aaade=this['getPause'][_0x31d3('0x85')](this,_0x57d613[_0x31d3('0x12d')]);var _0x12de37=this[_0x31d3('0x12e')][_0x31d3('0x85')](this,_0x57d613[_0x31d3('0x117')],_0x2aaade);if(_0x12de37){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')]['callerid'],_0x57d613[_0x31d3('0x117')]));this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x57d613[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11b')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x31d3('0x3a')],_0x57d613[_0x31d3('0x117')]));this['channel'][_0x31d3('0x86')](util['format'](_0x31d3('0x11a'),this['channel'][_0x31d3('0x3a')],_0x57d613[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11d')};}};AGIVertices[_0x31d3('0x10')][_0x31d3('0x12f')]=function(_0x107e64){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x130'),_0x107e64[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x107e64[_0x31d3('0x127')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x107e64,_0x31d3('0xd4'));}var _0x3def1b=this[_0x31d3('0xd5')]['sync'](this,_0x107e64['file_id']);if(!_0x3def1b){return this['channel'][_0x31d3('0x29')](_0x107e64,_0x31d3('0x131'));}var _0x321d54=this['channel'][_0x31d3('0x51')]('PLAYBACK',[_0x3def1b,_0x107e64[_0x31d3('0xb3')]]);if(_0x321d54[_0x31d3('0x77')]===-0x1){return _0x321d54;}return this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0x132'),_0x31d3('0x133'),_0x3def1b));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x134')]=function(_0x490138){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x135'),_0x490138[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x490138['queue_id'])){return this[_0x31d3('0xd')]['error'](_0x490138,'no\x20queue\x20selected');}var _0x16c103='';var _0x2fbc94=parseInt(_0x490138[_0x31d3('0x136')],0xa);if(isNaN(_0x2fbc94)){_0x16c103=_0x490138[_0x31d3('0x136')];}else{_0x16c103=this[_0x31d3('0x15')][_0x31d3('0x85')](this,_0x490138[_0x31d3('0x136')]);if(!_0x16c103){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x490138,_0x31d3('0x137'));}}var _0x5ca44e='';if(this[_0x31d3('0x61')](_0x490138[_0x31d3('0x127')])){var _0x131624=this[_0x31d3('0xd5')][_0x31d3('0x85')](this,_0x490138[_0x31d3('0x127')]);if(_0x131624){_0x5ca44e=_0x131624;}}this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x490138,_0x16c103);if(_0x490138[_0x31d3('0xb3')][_0x31d3('0x138')]('x')<0x0){_0x490138[_0x31d3('0xb3')]+='x';}if(_0x490138[_0x31d3('0xb3')][_0x31d3('0x138')]('X')<0x0){_0x490138['opts']+='X';}this[_0x31d3('0xd')][_0x31d3('0x79')](_0x31d3('0x139'),_0x16c103?_0x16c103[_0x31d3('0x13a')]():'');var _0x25a642=this[_0x31d3('0xd')][_0x31d3('0x51')](_0x31d3('0x13b'),[_0x16c103,_0x490138[_0x31d3('0xb3')],_0x490138[_0x31d3('0xb4')],_0x5ca44e,_0x490138[_0x31d3('0x7e')],_0x490138[_0x31d3('0x7')],_0x490138[_0x31d3('0x13c')],_0x490138[_0x31d3('0x13d')],'',_0x490138[_0x31d3('0x13e')]]);if(_0x25a642[_0x31d3('0x77')]===-0x1){return _0x25a642;}return this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')]('Executed\x20command\x20%s\x20%s',_0x31d3('0x13b'),_0x16c103));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x13f')]=function(_0x379e16){logger[_0x31d3('0x2d')](util['format'](_0x31d3('0x140'),_0x379e16[_0x31d3('0x37')]));var _0x73dd71=_0x379e16['recordingFormat']||'wav';var _0x256ae0=util[_0x31d3('0x26')](_0x31d3('0x141'),this[_0x31d3('0xd')][_0x31d3('0x36')],rs[_0x31d3('0xdb')](0x5));var _0x37a1c7=util[_0x31d3('0x26')](_0x31d3('0x142'),FILES_PATH,_0x256ae0,_0x73dd71);var _0x3d9b06=util['format']('%s/recordings/%s',FILES_PATH,_0x256ae0);this['createSquareRecording'][_0x31d3('0x85')](this,_0x379e16,_0x256ae0,_0x37a1c7);this[_0x31d3('0xd')][_0x31d3('0x79')](_0x31d3('0x143'),_0x256ae0);logger[_0x31d3('0x2d')](_0x31d3('0x144'),_0x3d9b06,_0x73dd71,_0x379e16['escape_digits'],_0x379e16[_0x31d3('0x7e')]);return this[_0x31d3('0xd')][_0x31d3('0xf3')](_0x3d9b06,_0x73dd71,_0x379e16[_0x31d3('0x145')],_0x379e16[_0x31d3('0x7e')],undefined,!![]);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x146')]=function(_0x34f2f5){logger['info'](util[_0x31d3('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x34f2f5[_0x31d3('0x37')]));return this[_0x31d3('0xd')]['sayDigits'](_0x34f2f5[_0x31d3('0x147')][_0x31d3('0x53')](/\s+/g,''),_0x34f2f5[_0x31d3('0x145')]);};AGIVertices['prototype'][_0x31d3('0x148')]=function(_0x91c010){logger[_0x31d3('0x2d')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x91c010['label']));return this['channel'][_0x31d3('0x149')](_0x91c010['number'][_0x31d3('0x53')](/\s+/g,''),_0x91c010[_0x31d3('0x145')]);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x14a')]=function(_0x4bf3eb){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4bf3eb[_0x31d3('0x37')]));return this[_0x31d3('0xd')][_0x31d3('0x14b')](_0x4bf3eb[_0x31d3('0x55')],_0x4bf3eb[_0x31d3('0x145')]);};AGIVertices[_0x31d3('0x10')]['sendMail']=function(_0x4fd4d4){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x14c'),_0x4fd4d4[_0x31d3('0x37')]));if(!this['isConfigured'](_0x4fd4d4[_0x31d3('0x14d')])){return this[_0x31d3('0xd')]['noop'](_0x31d3('0x14e'));}var _0x38c745=this[_0x31d3('0x14f')][_0x31d3('0x85')](this,_0x4fd4d4[_0x31d3('0x14d')]);if(!_0x38c745||!_0x38c745[_0x31d3('0x150')]){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x4fd4d4,_0x31d3('0x151'));}var _0x26174d={'from':util['format']('\x22%s\x22\x20<%s>',_0x38c745[_0x31d3('0x13')],_0x38c745['email']||_0x38c745['Smtp'][_0x31d3('0x152')]),'to':_0x4fd4d4['to']||'','cc':_0x4fd4d4['cc']||'','bcc':_0x4fd4d4['bcc']||'','subject':_0x4fd4d4[_0x31d3('0x153')],'html':_0x4fd4d4[_0x31d3('0x55')],'text':_0x4fd4d4[_0x31d3('0x55')]};var _0x214056={'tls':{'rejectUnauthorized':![]}};if(_0x38c745[_0x31d3('0x150')][_0x31d3('0x154')]){_0x214056[_0x31d3('0x154')]=_0x38c745[_0x31d3('0x150')][_0x31d3('0x154')];}else{_0x214056[_0x31d3('0x155')]=_0x38c745['Smtp'][_0x31d3('0x155')];_0x214056[_0x31d3('0x156')]=_0x38c745[_0x31d3('0x150')][_0x31d3('0x156')];_0x214056[_0x31d3('0x157')]=_0x38c745[_0x31d3('0x150')][_0x31d3('0x157')];}if(_0x38c745[_0x31d3('0x150')][_0x31d3('0x158')]){_0x214056[_0x31d3('0x159')]={'user':_0x38c745[_0x31d3('0x150')][_0x31d3('0x152')],'pass':_0x38c745[_0x31d3('0x150')][_0x31d3('0x15a')]};}if(this[_0x31d3('0x61')](_0x4fd4d4[_0x31d3('0x15b')])){}logger['debug'](_0x31d3('0x15c'),JSON[_0x31d3('0xd8')](_0x26174d));this[_0x31d3('0x35')]['sync'](this,_0x4fd4d4,_0x4fd4d4[_0x31d3('0x14d')]);this[_0x31d3('0xd')][_0x31d3('0x86')](util['format'](_0x31d3('0x15d'),_0x38c745[_0x31d3('0x13')]));this[_0x31d3('0x20')][_0x31d3('0x85')](this,_0x214056,_0x26174d);return this['channel'][_0x31d3('0x86')](_0x31d3('0x15e'));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x15f')]=function(_0x3ed233){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x160'),_0x3ed233['label']));return this[_0x31d3('0xd')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x31d3('0x10')][_0x31d3('0x161')]=function(_0x3aec72){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3aec72[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x3aec72[_0x31d3('0x162')])){return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x163'));}var _0x2e6313=this[_0x31d3('0x32')][_0x31d3('0x85')](this,_0x3aec72[_0x31d3('0x162')]);if(!_0x2e6313){return this[_0x31d3('0xd')]['error'](_0x3aec72,_0x31d3('0x164'));}var _0x7810a5={'body':_0x3aec72[_0x31d3('0x165')],'phone':_0x3aec72['to']||'','SmsAccountId':_0x2e6313['id']};logger['debug'](_0x31d3('0x166'),JSON[_0x31d3('0xd8')](_0x7810a5));this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x3aec72,_0x3aec72[_0x31d3('0x162')]);this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x167'),_0x2e6313[_0x31d3('0x13')]));this[_0x31d3('0x34')][_0x31d3('0x85')](this,_0x7810a5);return this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x168'));};AGIVertices['prototype'][_0x31d3('0x169')]=function(_0x7289e9){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x16a'),_0x7289e9[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x7289e9[_0x31d3('0xa5')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x7289e9,_0x31d3('0x16b'));}var _0x3a4f86=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x7289e9[_0x31d3('0xa5')]);if(!_0x3a4f86){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x7289e9,_0x31d3('0xda'));}return this['channel'][_0x31d3('0x79')](_0x3a4f86,_0x7289e9['variable_value']);};AGIVertices[_0x31d3('0x10')][_0x31d3('0x16c')]=function(_0x2abc85){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x16d'),_0x2abc85['label']));this['channel'][_0x31d3('0x86')]('START\x20CALLY\x20SQUARE');if(_0x2abc85[_0x31d3('0x7c')]===_0x31d3('0x16e')){this[_0x31d3('0xd')][_0x31d3('0x86')](_0x31d3('0x16f'));return this[_0x31d3('0xd')][_0x31d3('0x7c')]();}return this[_0x31d3('0xd')]['noop'](_0x31d3('0x170'));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x171')]=function(_0x3fe150){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3fe150[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x3fe150['project_id'])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x3fe150,_0x31d3('0x172'));}var _0x58f248=this[_0x31d3('0x17')][_0x31d3('0x85')](this,_0x3fe150['project_id']);if(!this[_0x31d3('0x61')](_0x58f248)){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x3fe150,util[_0x31d3('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3fe150[_0x31d3('0x173')]));}if(_0x58f248===this[_0x31d3('0xd')]['arg_1']){return this[_0x31d3('0xd')]['error'](_0x3fe150,_0x31d3('0x174'));}this[_0x31d3('0x35')][_0x31d3('0x85')](this,_0x3fe150,_0x58f248);var _0x461511=this[_0x31d3('0xd')][_0x31d3('0x51')](_0x31d3('0x175'),util[_0x31d3('0x26')](_0x31d3('0x176'),config[_0x31d3('0x7')][_0x31d3('0x155')]||_0x31d3('0x177'),_0x58f248,this[_0x31d3('0xd')][_0x31d3('0x3f')]));if(_0x461511['result']===-0x1){return _0x461511;}return this['channel'][_0x31d3('0x86')](util['format'](_0x31d3('0x132'),'AGI',_0x58f248));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x178')]=function(_0x426e8f){logger['info'](util['format'](_0x31d3('0x179'),_0x426e8f['label']));var _0x3487af=this[_0x31d3('0x50')][_0x31d3('0x85')](this,_0x426e8f[_0x31d3('0x17a')]);this['createSquareDetailsReport'][_0x31d3('0x85')](this,_0x426e8f,_0x426e8f['command']);if(this[_0x31d3('0x61')](_0x426e8f['variable_id'])){var _0x358d9f=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x426e8f['variable_id']);if(_0x358d9f){this[_0x31d3('0xd')][_0x31d3('0x79')](_0x358d9f,_0x3487af);return this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0x17b'),_0x426e8f[_0x31d3('0x17a')],_0x358d9f));}}return this['channel'][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x17c'),_0x426e8f[_0x31d3('0x17a')]));};AGIVertices['prototype']['tts']=function(_0x34b45d){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x17d'),_0x34b45d['label']));if(!this['isConfigured'](_0x34b45d[_0x31d3('0x55')])){return this['channel'][_0x31d3('0x86')](_0x31d3('0x8c'));}this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x17e'),_0x34b45d[_0x31d3('0x55')]));var _0x158f42=this['googleTTS'][_0x31d3('0x85')](this,_0x34b45d);if(_0x158f42){this['channel'][_0x31d3('0x86')](util['format'](_0x31d3('0x17f'),_0x158f42));var _0x43c954=this['channel'][_0x31d3('0xe4')](_0x158f42);try{fs[_0x31d3('0xe5')](_0x158f42+_0x31d3('0xe6'));}catch(_0x18d3ff){logger['error'](_0x18d3ff);}return _0x43c954;}return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x34b45d,_0x31d3('0x180'));};AGIVertices[_0x31d3('0x10')]['unpause']=function(_0x2a264d){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x181'),_0x2a264d[_0x31d3('0x37')]));if(!this[_0x31d3('0x61')](_0x2a264d[_0x31d3('0x117')])){return this[_0x31d3('0xd')][_0x31d3('0x29')](_0x2a264d,_0x31d3('0x118'));}logger['info'](util[_0x31d3('0x26')](_0x31d3('0x119'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x2a264d[_0x31d3('0x117')]));var _0x2902d6=this[_0x31d3('0x4c')][_0x31d3('0x85')](this,_0x2a264d[_0x31d3('0x117')]);if(_0x2902d6){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x2a264d[_0x31d3('0x117')]));this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')](_0x31d3('0x11a'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x2a264d[_0x31d3('0x117')]));return{'code':0xc8,'result':_0x31d3('0x11b')};}else{logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x11c'),this['channel'][_0x31d3('0x3a')],_0x2a264d[_0x31d3('0x117')]));this[_0x31d3('0xd')][_0x31d3('0x86')](util[_0x31d3('0x26')](_0x31d3('0x11c'),this[_0x31d3('0xd')][_0x31d3('0x3a')],_0x2a264d['findBy']));return{'code':0xc8,'result':_0x31d3('0x11d')};}};AGIVertices[_0x31d3('0x10')]['voicemail']=function(_0xfb76e6){logger[_0x31d3('0x2d')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0xfb76e6[_0x31d3('0x37')]));var _0x505376=this[_0x31d3('0xd')]['exec']('VOICEMAIL',[_0xfb76e6['mailbox'],_0xfb76e6['options']]);if(_0x505376[_0x31d3('0x77')]===-0x1){return _0x505376;}return this[_0x31d3('0xd')]['noop'](util[_0x31d3('0x26')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0xfb76e6[_0x31d3('0x182')]));};AGIVertices[_0x31d3('0x10')][_0x31d3('0x183')]=function(_0x4c4c24){logger[_0x31d3('0x2d')](util[_0x31d3('0x26')](_0x31d3('0x184'),_0x4c4c24['label']));if(!this[_0x31d3('0x61')](_0x4c4c24[_0x31d3('0xa5')])){return this['channel'][_0x31d3('0x29')](_0x4c4c24,'no\x20variable\x20selected');}var _0x461a64=this[_0x31d3('0x75')][_0x31d3('0x85')](this,_0x4c4c24[_0x31d3('0xa5')]);if(!_0x461a64){return this['channel'][_0x31d3('0x29')](_0x4c4c24,_0x31d3('0xda'));}var _0x1e584f=this['channel'][_0x31d3('0x75')](_0x461a64);return{'code':0xc8,'result':_0x1e584f[_0x31d3('0x76')]?_0x1e584f[_0x31d3('0x76')]:'-'};};String[_0x31d3('0x10')][_0x31d3('0x74')]=function(_0x2d23e7,_0x49deca){return this[_0x31d3('0x72')](_0x2d23e7)[_0x31d3('0x185')](_0x49deca);};module[_0x31d3('0x186')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 9ee8a2f..4a351ec 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 _0xe5b3=['error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','message','stopAcw','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]'];(function(_0x1d5f03,_0xbba796){var _0x561261=function(_0x300223){while(--_0x300223){_0x1d5f03['push'](_0x1d5f03['shift']());}};_0x561261(++_0xbba796);}(_0xe5b3,0x133));var _0x3e5b=function(_0x226b41,_0x2a7110){_0x226b41=_0x226b41-0x0;var _0x3d7262=_0xe5b3[_0x226b41];return _0x3d7262;};'use strict';var util=require('util');var _=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var ami=require(_0x3e5b('0x2'));var logger=require(_0x3e5b('0x3'))(_0x3e5b('0x4'));var RpcUser=require(_0x3e5b('0x5'));var RpcVoiceAgentReport=require(_0x3e5b('0x6'));function Acw(_0x1e58ed){this[_0x3e5b('0x7')]=_0x1e58ed[_0x3e5b('0x7')];this[_0x3e5b('0x8')]=_0x1e58ed['agents'];this[_0x3e5b('0x9')]=_0x1e58ed[_0x3e5b('0x9')];this['channels']={};ami['on'](_0x3e5b('0xa'),this[_0x3e5b('0xb')][_0x3e5b('0xc')](this));ami['on'](_0x3e5b('0xd'),this['syncHangupRequest']['bind'](this));ami['on'](_0x3e5b('0xe'),this[_0x3e5b('0xf')][_0x3e5b('0xc')](this));ami['on'](_0x3e5b('0x10'),this[_0x3e5b('0x11')]['bind'](this));ami['on'](_0x3e5b('0x12'),this['syncAttendedTransfer'][_0x3e5b('0xc')](this));ami['on'](_0x3e5b('0x13'),this[_0x3e5b('0x14')][_0x3e5b('0xc')](this));ami['on'](_0x3e5b('0x15'),this[_0x3e5b('0x16')][_0x3e5b('0xc')](this));}function getDiff(_0x560010){var _0x39a2a1=moment()['milliseconds'](0x0);var _0x51a188=moment(_0x560010)['milliseconds'](0x0);return _0x39a2a1[_0x3e5b('0x17')](_0x51a188,_0x3e5b('0x18'));}Acw[_0x3e5b('0x19')]['startAcw']=function(_0x1f81a7){try{var _0x59ddc0=this;var _0x56a453=this[_0x3e5b('0x1a')][_0x1f81a7][_0x3e5b('0x1b')];var _0x5e2f83=this[_0x3e5b('0x1a')][_0x1f81a7][_0x3e5b('0x1c')];var _0x555002=this[_0x3e5b('0x7')][_0x5e2f83];var _0x3365dd=![];var _0x52696c='ACW';if(_0x555002[_0x3e5b('0x1d')]){if(_0x555002[_0x3e5b('0x1e')][_0x3e5b('0x1f')]){_0x3365dd=!![];_0x52696c=_0x555002[_0x3e5b('0x1e')][_0x3e5b('0x1f')];}}ami[_0x3e5b('0x20')]({'action':_0x3e5b('0x21'),'interface':_0x56a453,'paused':!![],'reason':_0x52696c})[_0x3e5b('0x22')](function(_0x36c988){if(_0x59ddc0[_0x3e5b('0x8')][_0x56a453]){return RpcUser[_0x3e5b('0x23')](_0x59ddc0[_0x3e5b('0x8')][_0x56a453]['id'])[_0x3e5b('0x22')](function(_0x402873){if(_0x402873&&!_0x402873['voicePause']){logger[_0x3e5b('0x24')](_0x3e5b('0x25'),_0x1f81a7,_0x56a453,_0x5e2f83);var _0x2146d4=_0x59ddc0[_0x3e5b('0x1a')][_0x1f81a7]['attended']&&_0x59ddc0[_0x3e5b('0x1a')][_0x1f81a7]['destlinkedid']?_0x59ddc0[_0x3e5b('0x1a')][_0x1f81a7][_0x3e5b('0x26')]:_0x1f81a7;return RpcUser['savePause'](_0x59ddc0[_0x3e5b('0x8')][_0x56a453],_0x52696c,_0x2146d4)[_0x3e5b('0x22')](function(_0x42d7e9){if(!_0x3365dd){_0x59ddc0[_0x3e5b('0x9')][_0x56a453]={};logger[_0x3e5b('0x24')](_0x3e5b('0x27'),_0x1f81a7,_0x59ddc0[_0x3e5b('0x7')][_0x5e2f83][_0x3e5b('0x28')],_0x56a453,_0x5e2f83);_0x59ddc0['timers'][_0x56a453][_0x3e5b('0x29')]=setTimeout(_0x59ddc0['stopAcw'][_0x3e5b('0xc')](_0x59ddc0,_0x56a453),_0x59ddc0['voiceQueues'][_0x5e2f83][_0x3e5b('0x28')]*0x3e8);_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x2a')]=moment()[_0x3e5b('0x2b')](_0x3e5b('0x2c'));_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x2d')]=_0x1f81a7;_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x1c')]=_0x5e2f83;_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x2e')]=function(){var _0x489221=getDiff(_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x2a')]);clearTimeout(_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x29')]);_0x59ddc0[_0x3e5b('0x9')][_0x56a453][_0x3e5b('0x29')]=![];RpcVoiceAgentReport[_0x3e5b('0x2f')]({'acwtime':_0x489221},_0x59ddc0['timers'][_0x56a453][_0x3e5b('0x2d')],_0x56a453)['then'](function(_0x5b9ba3){logger[_0x3e5b('0x24')](_0x3e5b('0x30'),_0x1f81a7,_0x489221,_0x5b9ba3);})['catch'](function(_0x40e37d){logger[_0x3e5b('0x31')](_0x3e5b('0x32'),_0x1f81a7,_0x40e37d);});delete _0x59ddc0[_0x3e5b('0x9')][_0x56a453];};}});}else{logger[_0x3e5b('0x24')](_0x3e5b('0x33'),_0x1f81a7,_0x56a453,_0x5e2f83);}});}})[_0x3e5b('0x34')](function(_0x26c9ab){logger[_0x3e5b('0x31')](_0x3e5b('0x27'),_0x1f81a7,_0x59ddc0[_0x3e5b('0x7')][_0x5e2f83][_0x3e5b('0x28')],_0x56a453,_0x5e2f83);})['finally'](function(){delete _0x59ddc0[_0x3e5b('0x1a')][_0x1f81a7];});}catch(_0xec45c5){logger['error']('[ACW][START]\x20%s',_0xec45c5[_0x3e5b('0x35')]);}};Acw['prototype'][_0x3e5b('0x36')]=function(_0x3f68c6){try{var _0xb2349c=this;if(_0xb2349c[_0x3e5b('0x9')][_0x3f68c6]){_0xb2349c['timers'][_0x3f68c6][_0x3e5b('0x29')]=![];var _0x4cdcb1=_0xb2349c[_0x3e5b('0x9')][_0x3f68c6]['uniqueid'];var _0x47f7c8=_0xb2349c['timers'][_0x3f68c6][_0x3e5b('0x1c')];var _0x174ebf=_0xb2349c[_0x3e5b('0x7')][_0x47f7c8][_0x3e5b('0x28')];logger[_0x3e5b('0x24')](_0x3e5b('0x37'),_0x3f68c6);RpcUser['saveUnpause'](this['agents'][_0x3f68c6]);RpcVoiceAgentReport['update']({'acwtime':_0x174ebf,'agentacw':!![]},_0x4cdcb1,_0x3f68c6)['then'](function(_0x5f0271){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x4cdcb1,_0x174ebf,_0x5f0271);})[_0x3e5b('0x34')](function(_0x349de0){logger[_0x3e5b('0x31')](_0x3e5b('0x32'),_0x4cdcb1,_0x349de0);});}else{logger[_0x3e5b('0x31')](_0x3e5b('0x38'),_0x3f68c6);if(_0xb2349c[_0x3e5b('0x9')]){logger[_0x3e5b('0x24')](_0x3e5b('0x39'),JSON[_0x3e5b('0x3a')](_0xb2349c[_0x3e5b('0x9')]));}}}catch(_0x4ee160){logger[_0x3e5b('0x31')](_0x3e5b('0x3b'),_0x4ee160[_0x3e5b('0x35')]);}};Acw[_0x3e5b('0x19')][_0x3e5b('0xb')]=function(_0xc69499){try{if(this[_0x3e5b('0x7')][_0xc69499[_0x3e5b('0x1c')]]&&(this[_0x3e5b('0x7')][_0xc69499[_0x3e5b('0x1c')]][_0x3e5b('0x4')]||this['voiceQueues'][_0xc69499['queue']]['mandatoryDisposition'])){if(this['agents'][_0xc69499[_0x3e5b('0x1b')]]){this[_0x3e5b('0x1a')][_0xc69499[_0x3e5b('0x2d')]]={'queue':_0xc69499[_0x3e5b('0x1c')],'interface':_0xc69499[_0x3e5b('0x1b')],'destlinkedid':_0xc69499[_0x3e5b('0x26')]};}}}catch(_0x12b486){logger[_0x3e5b('0x31')](_0x3e5b('0x3c'),_0x12b486[_0x3e5b('0x35')]);}};Acw['prototype'][_0x3e5b('0x16')]=function(_0x28a105){try{if(this[_0x3e5b('0x7')][_0x28a105[_0x3e5b('0x1c')]]&&(this[_0x3e5b('0x7')][_0x28a105['queue']]['acw']||this['voiceQueues'][_0x28a105[_0x3e5b('0x1c')]][_0x3e5b('0x1d')])){if(this[_0x3e5b('0x8')][_0x28a105['interface']]){this['channels'][_0x28a105[_0x3e5b('0x2d')]]={'queue':_0x28a105[_0x3e5b('0x1c')],'interface':_0x28a105[_0x3e5b('0x1b')]};}}}catch(_0x5acf51){logger['error'](_0x3e5b('0x3d'),_0x5acf51['message']);}};Acw[_0x3e5b('0x19')][_0x3e5b('0x3e')]=function(_0x3f5835){try{if(this[_0x3e5b('0x1a')][_0x3f5835[_0x3e5b('0x2d')]]&&_[_0x3e5b('0x3f')](this[_0x3e5b('0x1a')][_0x3f5835[_0x3e5b('0x2d')]][_0x3e5b('0x40')])){logger['info'](_0x3e5b('0x41'),_0x3f5835['uniqueid']);this[_0x3e5b('0x42')](_0x3f5835[_0x3e5b('0x2d')]);}else if(this[_0x3e5b('0x1a')][_0x3f5835[_0x3e5b('0x43')]]&&_[_0x3e5b('0x3f')](this[_0x3e5b('0x1a')][_0x3f5835[_0x3e5b('0x43')]][_0x3e5b('0x40')])){logger[_0x3e5b('0x24')](_0x3e5b('0x44'),_0x3f5835[_0x3e5b('0x43')]);this[_0x3e5b('0x42')](_0x3f5835[_0x3e5b('0x43')]);}}catch(_0x59d311){logger[_0x3e5b('0x31')](_0x3e5b('0x45'),_0x59d311[_0x3e5b('0x35')]);}};Acw[_0x3e5b('0x19')][_0x3e5b('0xf')]=function(_0x2cecd3){try{if(this['channels'][_0x2cecd3[_0x3e5b('0x2d')]]&&this[_0x3e5b('0x1a')][_0x2cecd3[_0x3e5b('0x2d')]][_0x3e5b('0x40')]){logger[_0x3e5b('0x24')](_0x3e5b('0x46'),_0x2cecd3[_0x3e5b('0x2d')]);this[_0x3e5b('0x42')](_0x2cecd3['uniqueid']);}else if(this[_0x3e5b('0x1a')][_0x2cecd3['linkedid']]&&this['channels'][_0x2cecd3[_0x3e5b('0x43')]]['attended']){logger[_0x3e5b('0x24')](_0x3e5b('0x47'),_0x2cecd3[_0x3e5b('0x43')]);this[_0x3e5b('0x42')](_0x2cecd3['linkedid']);}}catch(_0x5ddeee){logger['error']('[ACW][syncHangup]\x20%s',_0x5ddeee[_0x3e5b('0x35')]);}};Acw[_0x3e5b('0x19')][_0x3e5b('0x48')]=function(_0x4149c8){try{if(!_[_0x3e5b('0x49')](this['channels'][_0x4149c8['transfereeuniqueid']])){this[_0x3e5b('0x42')](_0x4149c8[_0x3e5b('0x4a')]);if(this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4b')]]){this[_0x3e5b('0x1a')][_0x4149c8['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x4149c8['transfertargetuniqueid']]=this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4b')]];delete this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4b')]];}}else if(!_[_0x3e5b('0x49')](this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4c')]])){this[_0x3e5b('0x42')](_0x4149c8['transfertargetuniqueid']);if(this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4d')]]){this[_0x3e5b('0x1a')][_0x4149c8[_0x3e5b('0x4d')]][_0x3e5b('0x40')]=!![];this['channels'][_0x4149c8[_0x3e5b('0x4a')]]=this['channels'][_0x4149c8[_0x3e5b('0x4d')]];delete this[_0x3e5b('0x1a')][_0x4149c8['origtransfereruniqueid']];}}}catch(_0x4a7d8e){logger['error'](_0x3e5b('0x4e'),_0x4a7d8e['message']);}};Acw[_0x3e5b('0x19')][_0x3e5b('0x14')]=function(_0x1af190){try{if(this[_0x3e5b('0x1a')][_0x1af190[_0x3e5b('0x4f')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x3e5b('0x3a')](_0x1af190[_0x3e5b('0x4f')]));this[_0x3e5b('0x42')](_0x1af190['transfereruniqueid']);}else if(this[_0x3e5b('0x1a')][_0x1af190[_0x3e5b('0x50')]]){logger[_0x3e5b('0x24')](_0x3e5b('0x51'),JSON[_0x3e5b('0x3a')](_0x1af190[_0x3e5b('0x50')]));this[_0x3e5b('0x42')](_0x1af190[_0x3e5b('0x50')]);}}catch(_0x3a11a8){logger[_0x3e5b('0x31')](_0x3e5b('0x52'),_0x3a11a8[_0x3e5b('0x35')]);}};Acw[_0x3e5b('0x19')][_0x3e5b('0x11')]=function(_0x13204a){try{if(this[_0x3e5b('0x7')][_0x13204a[_0x3e5b('0x1c')]]&&this[_0x3e5b('0x7')][_0x13204a['queue']][_0x3e5b('0x53')]===_0x3e5b('0x54')){if(this['agents'][_0x13204a[_0x3e5b('0x1b')]]){logger[_0x3e5b('0x24')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x13204a['uniqueid'],_0x13204a['interface'],_0x13204a[_0x3e5b('0x1c')]);return RpcUser[_0x3e5b('0x55')](this['agents'][_0x13204a[_0x3e5b('0x1b')]],_0x3e5b('0x56'),_0x13204a['uniqueid']);}}}catch(_0x3d3bf2){logger[_0x3e5b('0x31')](_0x3e5b('0x57'),_0x3d3bf2[_0x3e5b('0x35')]);}};module[_0x3e5b('0x58')]=Acw; \ No newline at end of file +var _0x032e=['[ACW][syncAgentConnect]\x20%s','acw','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s'];(function(_0x691b43,_0x5bfb54){var _0x40f0da=function(_0x170c2f){while(--_0x170c2f){_0x691b43['push'](_0x691b43['shift']());}};_0x40f0da(++_0x5bfb54);}(_0x032e,0x124));var _0xe032=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x032e[_0x4e9628];return _0x27bc8c;};'use strict';var util=require(_0xe032('0x0'));var _=require('lodash');var moment=require(_0xe032('0x1'));var ami=require(_0xe032('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xe032('0x3'));var RpcVoiceAgentReport=require(_0xe032('0x4'));function Acw(_0x2f44f6){this[_0xe032('0x5')]=_0x2f44f6[_0xe032('0x5')];this[_0xe032('0x6')]=_0x2f44f6[_0xe032('0x6')];this[_0xe032('0x7')]=_0x2f44f6[_0xe032('0x7')];this[_0xe032('0x8')]={};ami['on'](_0xe032('0x9'),this[_0xe032('0xa')][_0xe032('0xb')](this));ami['on'](_0xe032('0xc'),this[_0xe032('0xd')][_0xe032('0xb')](this));ami['on'](_0xe032('0xe'),this[_0xe032('0xf')]['bind'](this));ami['on'](_0xe032('0x10'),this[_0xe032('0x11')][_0xe032('0xb')](this));ami['on'](_0xe032('0x12'),this[_0xe032('0x13')][_0xe032('0xb')](this));ami['on'](_0xe032('0x14'),this['syncBlindTransfer'][_0xe032('0xb')](this));ami['on'](_0xe032('0x15'),this[_0xe032('0x16')][_0xe032('0xb')](this));}function getDiff(_0x4aee44){var _0x311592=moment()[_0xe032('0x17')](0x0);var _0x176547=moment(_0x4aee44)[_0xe032('0x17')](0x0);return _0x311592[_0xe032('0x18')](_0x176547,_0xe032('0x19'));}Acw[_0xe032('0x1a')]['startAcw']=function(_0x231c35){try{var _0x749018=this;var _0x36fb7c=this[_0xe032('0x8')][_0x231c35][_0xe032('0x1b')];var _0x208b00=this['channels'][_0x231c35][_0xe032('0x1c')];var _0x25cedb=this[_0xe032('0x5')][_0x208b00];var _0x41d2a5=![];var _0x208c47='ACW';if(_0x25cedb['mandatoryDisposition']){if(_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')]){_0x41d2a5=!![];_0x208c47=_0x25cedb['mandatoryDispositionPause'][_0xe032('0x1d')];}}ami[_0xe032('0x1e')]({'action':_0xe032('0x1f'),'interface':_0x36fb7c,'paused':!![],'reason':_0x208c47})[_0xe032('0x20')](function(_0x288d91){if(_0x749018[_0xe032('0x6')][_0x36fb7c]){return RpcUser[_0xe032('0x21')](_0x749018['agents'][_0x36fb7c]['id'])[_0xe032('0x20')](function(_0x866c81){if(_0x866c81&&!_0x866c81[_0xe032('0x22')]){logger[_0xe032('0x23')](_0xe032('0x24'),_0x231c35,_0x36fb7c,_0x208b00);var _0x33d89a=_0x749018[_0xe032('0x8')][_0x231c35][_0xe032('0x25')]&&_0x749018['channels'][_0x231c35]['destlinkedid']?_0x749018['channels'][_0x231c35][_0xe032('0x26')]:_0x231c35;return RpcUser[_0xe032('0x27')](_0x749018[_0xe032('0x6')][_0x36fb7c],_0x208c47,_0x33d89a)[_0xe032('0x20')](function(_0x2bfe8f){if(!_0x41d2a5){_0x749018[_0xe032('0x7')][_0x36fb7c]={};logger[_0xe032('0x23')](_0xe032('0x28'),_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);_0x749018['timers'][_0x36fb7c][_0xe032('0x2a')]=setTimeout(_0x749018[_0xe032('0x2b')][_0xe032('0xb')](_0x749018,_0x36fb7c),_0x749018[_0xe032('0x5')][_0x208b00]['acwTimeout']*0x3e8);_0x749018['timers'][_0x36fb7c][_0xe032('0x2c')]=moment()[_0xe032('0x2d')](_0xe032('0x2e'));_0x749018[_0xe032('0x7')][_0x36fb7c]['uniqueid']=_0x231c35;_0x749018['timers'][_0x36fb7c]['queue']=_0x208b00;_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2f')]=function(){var _0x5518ac=getDiff(_0x749018[_0xe032('0x7')][_0x36fb7c]['lastPauseAt']);clearTimeout(_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]);_0x749018[_0xe032('0x7')][_0x36fb7c][_0xe032('0x2a')]=![];RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x5518ac},_0x749018['timers'][_0x36fb7c][_0xe032('0x31')],_0x36fb7c)[_0xe032('0x20')](function(_0x319a2f){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x231c35,_0x5518ac,_0x319a2f);})[_0xe032('0x32')](function(_0x4c86e9){logger[_0xe032('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x231c35,_0x4c86e9);});delete _0x749018[_0xe032('0x7')][_0x36fb7c];};}});}else{logger['info'](_0xe032('0x34'),_0x231c35,_0x36fb7c,_0x208b00);}});}})['catch'](function(_0x3970e1){logger[_0xe032('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x231c35,_0x749018[_0xe032('0x5')][_0x208b00][_0xe032('0x29')],_0x36fb7c,_0x208b00);})[_0xe032('0x35')](function(){delete _0x749018[_0xe032('0x8')][_0x231c35];});}catch(_0x4e222c){logger[_0xe032('0x33')]('[ACW][START]\x20%s',_0x4e222c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')]['stopAcw']=function(_0x450ba4){try{var _0x23b790=this;if(_0x23b790['timers'][_0x450ba4]){_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x2a')]=![];var _0x3cc437=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x31')];var _0x42f58a=_0x23b790[_0xe032('0x7')][_0x450ba4][_0xe032('0x1c')];var _0x22651f=_0x23b790[_0xe032('0x5')][_0x42f58a][_0xe032('0x29')];logger[_0xe032('0x23')](_0xe032('0x37'),_0x450ba4);RpcUser[_0xe032('0x38')](this[_0xe032('0x6')][_0x450ba4]);RpcVoiceAgentReport[_0xe032('0x30')]({'acwtime':_0x22651f,'agentacw':!![]},_0x3cc437,_0x450ba4)[_0xe032('0x20')](function(_0x555914){logger[_0xe032('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x3cc437,_0x22651f,_0x555914);})[_0xe032('0x32')](function(_0x2bcfb4){logger[_0xe032('0x33')](_0xe032('0x39'),_0x3cc437,_0x2bcfb4);});}else{logger[_0xe032('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x450ba4);if(_0x23b790[_0xe032('0x7')]){logger['info'](_0xe032('0x3a'),JSON['stringify'](_0x23b790[_0xe032('0x7')]));}}}catch(_0x475355){logger[_0xe032('0x33')](_0xe032('0x3b'),_0x475355['message']);}};Acw[_0xe032('0x1a')]['syncAgentConnect']=function(_0x2b9664){try{if(this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]&&(this[_0xe032('0x5')][_0x2b9664['queue']]['acw']||this[_0xe032('0x5')][_0x2b9664[_0xe032('0x1c')]]['mandatoryDisposition'])){if(this[_0xe032('0x6')][_0x2b9664[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x2b9664[_0xe032('0x31')]]={'queue':_0x2b9664[_0xe032('0x1c')],'interface':_0x2b9664['interface'],'destlinkedid':_0x2b9664[_0xe032('0x26')]};}}}catch(_0x7bc08){logger[_0xe032('0x33')](_0xe032('0x3c'),_0x7bc08[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x16')]=function(_0x318f86){try{if(this['voiceQueues'][_0x318f86['queue']]&&(this[_0xe032('0x5')][_0x318f86['queue']][_0xe032('0x3d')]||this[_0xe032('0x5')][_0x318f86[_0xe032('0x1c')]][_0xe032('0x3e')])){if(this[_0xe032('0x6')][_0x318f86[_0xe032('0x1b')]]){this[_0xe032('0x8')][_0x318f86[_0xe032('0x31')]]={'queue':_0x318f86[_0xe032('0x1c')],'interface':_0x318f86['interface']};}}}catch(_0x1549c){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x1549c[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0xd')]=function(_0x1e54d3){try{if(this['channels'][_0x1e54d3[_0xe032('0x31')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x31')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x40'),_0x1e54d3['uniqueid']);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x31')]);}else if(this['channels'][_0x1e54d3[_0xe032('0x42')]]&&_[_0xe032('0x3f')](this[_0xe032('0x8')][_0x1e54d3[_0xe032('0x42')]][_0xe032('0x25')])){logger[_0xe032('0x23')](_0xe032('0x43'),_0x1e54d3[_0xe032('0x42')]);this[_0xe032('0x41')](_0x1e54d3[_0xe032('0x42')]);}}catch(_0x3a0253){logger[_0xe032('0x33')](_0xe032('0x44'),_0x3a0253[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0xf')]=function(_0x53c8b2){try{if(this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x31')]][_0xe032('0x25')]){logger[_0xe032('0x23')](_0xe032('0x45'),_0x53c8b2[_0xe032('0x31')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x31')]);}else if(this[_0xe032('0x8')][_0x53c8b2['linkedid']]&&this[_0xe032('0x8')][_0x53c8b2[_0xe032('0x42')]]['attended']){logger[_0xe032('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x53c8b2[_0xe032('0x42')]);this[_0xe032('0x41')](_0x53c8b2[_0xe032('0x42')]);}}catch(_0x414243){logger[_0xe032('0x33')]('[ACW][syncHangup]\x20%s',_0x414243[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x13')]=function(_0x21a32f){try{if(!_[_0xe032('0x46')](this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]])){this['startAcw'](_0x21a32f[_0xe032('0x47')]);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x49')]]=this[_0xe032('0x8')][_0x21a32f['secondtransfereruniqueid']];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x48')]];}}else if(!_[_0xe032('0x46')](this['channels'][_0x21a32f[_0xe032('0x49')]])){this[_0xe032('0x41')](_0x21a32f['transfertargetuniqueid']);if(this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]]){this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]][_0xe032('0x25')]=!![];this[_0xe032('0x8')][_0x21a32f[_0xe032('0x47')]]=this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];delete this[_0xe032('0x8')][_0x21a32f[_0xe032('0x4a')]];}}}catch(_0x505986){logger[_0xe032('0x33')](_0xe032('0x4b'),_0x505986[_0xe032('0x36')]);}};Acw[_0xe032('0x1a')][_0xe032('0x4c')]=function(_0x4d305b){try{if(this[_0xe032('0x8')][_0x4d305b['transfereruniqueid']]){logger[_0xe032('0x23')](_0xe032('0x4d'),JSON[_0xe032('0x4e')](_0x4d305b[_0xe032('0x4f')]));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x4f')]);}else if(this[_0xe032('0x8')][_0x4d305b[_0xe032('0x50')]]){logger[_0xe032('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x4d305b['transfererlinkedid']));this[_0xe032('0x41')](_0x4d305b[_0xe032('0x50')]);}}catch(_0x889c28){logger[_0xe032('0x33')](_0xe032('0x51'),_0x889c28[_0xe032('0x36')]);}};Acw['prototype'][_0xe032('0x11')]=function(_0x1d66c3){try{if(this[_0xe032('0x5')][_0x1d66c3['queue']]&&this[_0xe032('0x5')][_0x1d66c3['queue']][_0xe032('0x52')]===_0xe032('0x53')){if(this['agents'][_0x1d66c3['interface']]){logger['info'](_0xe032('0x54'),_0x1d66c3['uniqueid'],_0x1d66c3['interface'],_0x1d66c3[_0xe032('0x1c')]);return RpcUser[_0xe032('0x27')](this[_0xe032('0x6')][_0x1d66c3['interface']],_0xe032('0x55'),_0x1d66c3['uniqueid']);}}}catch(_0x2cf342){logger[_0xe032('0x33')](_0xe032('0x56'),_0x2cf342[_0xe032('0x36')]);}};module[_0xe032('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e70cd72..268fab1 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 _0x4b11=['asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','once','close','connect','shutdown','info','fullybooted','resolve','then','catch','log','exports','asterisk-manager','bluebird','lodash','../../config/logger','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4b11,0xe2));var _0x14b1=function(_0x22e30d,_0x372894){_0x22e30d=_0x22e30d-0x0;var _0x1b8581=_0x4b11[_0x22e30d];return _0x1b8581;};'use strict';var Manager=require(_0x14b1('0x0'));var BPromise=require(_0x14b1('0x1'));var moment=require('moment');var util=require('util');var _=require(_0x14b1('0x2'));var logger=require(_0x14b1('0x3'))('ami');var config=require(_0x14b1('0x4'));var ami=new Manager(config[_0x14b1('0x5')][_0x14b1('0x6')],config[_0x14b1('0x5')]['ip'],config[_0x14b1('0x5')][_0x14b1('0x7')],config[_0x14b1('0x5')][_0x14b1('0x8')],!![]);ami[_0x14b1('0x9')]();ami[_0x14b1('0xa')]=BPromise['promisify'](ami[_0x14b1('0xb')]);function error(_0x5780c6){logger[_0x14b1('0xc')](util[_0x14b1('0xd')](_0x14b1('0xe'),config[_0x14b1('0x5')][_0x14b1('0x7')],config['asterisk']['ip'],config[_0x14b1('0x5')][_0x14b1('0x6')],util[_0x14b1('0xf')](_0x5780c6,![],null)));}function close(){logger[_0x14b1('0xc')](util[_0x14b1('0xd')](_0x14b1('0x10'),config['asterisk'][_0x14b1('0x7')],config[_0x14b1('0x5')]['ip'],config[_0x14b1('0x5')][_0x14b1('0x6')]));}ami[_0x14b1('0x11')]=function(){return function(){return ami['Action']({'action':_0x14b1('0x12')});};};ami[_0x14b1('0x13')]=function(){return function(){return ami[_0x14b1('0xa')]({'action':'devicestatelist'});};};ami[_0x14b1('0x14')]=function(){return function(){return ami[_0x14b1('0xa')]({'action':'sippeerstatus'});};};ami[_0x14b1('0x15')]=function(){return function(){return ami[_0x14b1('0xa')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x14b1('0xa')]({'action':'coreshowchannels'});};};function connect(_0x45c1bd){logger['info'](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x14b1('0x7')],config['asterisk']['ip'],config[_0x14b1('0x5')]['port']));ami[_0x14b1('0x16')](_0x14b1('0xc'),error);ami[_0x14b1('0x16')](_0x14b1('0x17'),close);}ami['on'](_0x14b1('0x18'),connect);ami['on'](_0x14b1('0x19'),function(_0x19e93d){logger[_0x14b1('0x1a')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x14b1('0x5')]['username'],config['asterisk']['ip'],config[_0x14b1('0x5')][_0x14b1('0x6')],util[_0x14b1('0xf')](_0x19e93d,![],null)));});ami['on'](_0x14b1('0x1b'),function(_0x227fd9){logger['info'](util[_0x14b1('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x14b1('0x5')]['username'],config[_0x14b1('0x5')]['ip'],config[_0x14b1('0x5')]['port']));return BPromise[_0x14b1('0x1c')]()[_0x14b1('0x1d')](ami[_0x14b1('0x11')]())[_0x14b1('0x1d')](ami[_0x14b1('0x13')]())['then'](ami['actionSipPeerStatus']())[_0x14b1('0x1d')](ami[_0x14b1('0x15')]())['then'](ami['actionCoreShowChannels']())[_0x14b1('0x1e')](function(_0x5dc7d1){console[_0x14b1('0x1f')](_0x5dc7d1);});});ami[_0x14b1('0x16')](_0x14b1('0xc'),error);ami[_0x14b1('0x16')](_0x14b1('0x17'),close);module[_0x14b1('0x20')]=ami; \ No newline at end of file +var _0x5589=['moment','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','error','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipPeerStatus','actionQueueSummary','catch','log','asterisk-manager'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0x5589,0x8f));var _0x9558=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5589[_0x167cc1];return _0x10bc4b;};'use strict';var Manager=require(_0x9558('0x0'));var BPromise=require('bluebird');var moment=require(_0x9558('0x1'));var util=require('util');var _=require(_0x9558('0x2'));var logger=require(_0x9558('0x3'))(_0x9558('0x4'));var config=require(_0x9558('0x5'));var ami=new Manager(config[_0x9558('0x6')][_0x9558('0x7')],config['asterisk']['ip'],config['asterisk'][_0x9558('0x8')],config[_0x9558('0x6')][_0x9558('0x9')],!![]);ami['keepConnected']();ami[_0x9558('0xa')]=BPromise[_0x9558('0xb')](ami[_0x9558('0xc')]);function error(_0x45b3c5){logger['error'](util[_0x9558('0xd')](_0x9558('0xe'),config['asterisk'][_0x9558('0x8')],config['asterisk']['ip'],config['asterisk'][_0x9558('0x7')],util[_0x9558('0xf')](_0x45b3c5,![],null)));}function close(){logger['error'](util[_0x9558('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x9558('0x8')],config[_0x9558('0x6')]['ip'],config['asterisk'][_0x9558('0x7')]));}ami[_0x9558('0x10')]=function(){return function(){return ami[_0x9558('0xa')]({'action':_0x9558('0x11')});};};ami[_0x9558('0x12')]=function(){return function(){return ami[_0x9558('0xa')]({'action':_0x9558('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0x9558('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x9558('0x15')});};};ami[_0x9558('0x16')]=function(){return function(){return ami[_0x9558('0xa')]({'action':_0x9558('0x17')});};};function connect(_0x6bce28){logger[_0x9558('0x18')](util[_0x9558('0xd')](_0x9558('0x19'),config['asterisk'][_0x9558('0x8')],config[_0x9558('0x6')]['ip'],config['asterisk'][_0x9558('0x7')]));ami[_0x9558('0x1a')](_0x9558('0x1b'),error);ami[_0x9558('0x1a')](_0x9558('0x1c'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x154657){logger['info'](util[_0x9558('0xd')](_0x9558('0x1d'),config[_0x9558('0x6')][_0x9558('0x8')],config[_0x9558('0x6')]['ip'],config['asterisk'][_0x9558('0x7')],util[_0x9558('0xf')](_0x154657,![],null)));});ami['on']('fullybooted',function(_0x57addb){logger[_0x9558('0x18')](util[_0x9558('0xd')](_0x9558('0x1e'),config[_0x9558('0x6')][_0x9558('0x8')],config[_0x9558('0x6')]['ip'],config[_0x9558('0x6')][_0x9558('0x7')]));return BPromise['resolve']()['then'](ami[_0x9558('0x10')]())[_0x9558('0x1f')](ami[_0x9558('0x12')]())[_0x9558('0x1f')](ami[_0x9558('0x20')]())[_0x9558('0x1f')](ami[_0x9558('0x21')]())[_0x9558('0x1f')](ami[_0x9558('0x16')]())[_0x9558('0x22')](function(_0x37ff6f){console[_0x9558('0x23')](_0x37ff6f);});});ami[_0x9558('0x1a')](_0x9558('0x1b'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 1acd802..da46edb 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 _0xa5ed=['Request','request','then','debug','rpc','error','memberReport','message','catch','exports','jayson/promise','../../config/logger','client','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa5ed,0x192));var _0xda5e=function(_0xbe0746,_0x2c30ec){_0xbe0746=_0xbe0746-0x0;var _0x42fd26=_0xa5ed[_0xbe0746];return _0x42fd26;};'use strict';var jayson=require(_0xda5e('0x0'));var BPromise=require('bluebird');var logger=require(_0xda5e('0x1'))('ami');var client=jayson[_0xda5e('0x2')][_0xda5e('0x3')]({'port':0x2329});client[_0xda5e('0x4')]=function(_0x4cb1bc,_0xaab30b){return new BPromise(function(_0x384bee,_0x4f99d2){return client[_0xda5e('0x5')](_0x4cb1bc,_0xaab30b)[_0xda5e('0x6')](function(_0x5d501f){logger[_0xda5e('0x7')](_0xda5e('0x8'),'memberReport',_0x4cb1bc,_0xaab30b,_0x5d501f);if(_0x5d501f['error']){logger[_0xda5e('0x9')](_0xda5e('0x8'),_0xda5e('0xa'),_0x4cb1bc,_0x5d501f[_0xda5e('0x9')][_0xda5e('0xb')],_0xaab30b);return _0x4f99d2(_0x5d501f['error'][_0xda5e('0xb')]);}else{return _0x384bee(_0x5d501f['result']);}})[_0xda5e('0xc')](function(_0x989a93){logger[_0xda5e('0x9')](_0xda5e('0x8'),_0xda5e('0xa'),_0x4cb1bc,_0x989a93,_0xaab30b);return _0x4f99d2(_0x989a93);});});};module[_0xda5e('0xd')]=client; \ No newline at end of file +var _0x68e2=['client','request','debug','rpc','memberReport','error','message','result','exports','bluebird','../../config/logger','ami'];(function(_0x2d5411,_0x1a439f){var _0x4f13d7=function(_0x2523c4){while(--_0x2523c4){_0x2d5411['push'](_0x2d5411['shift']());}};_0x4f13d7(++_0x1a439f);}(_0x68e2,0xe1));var _0x268e=function(_0x4d9eb5,_0x523d95){_0x4d9eb5=_0x4d9eb5-0x0;var _0xe62b9a=_0x68e2[_0x4d9eb5];return _0xe62b9a;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x268e('0x0'));var logger=require(_0x268e('0x1'))(_0x268e('0x2'));var client=jayson[_0x268e('0x3')]['http']({'port':0x2329});client['Request']=function(_0xdfc452,_0x3b0c4f){return new BPromise(function(_0x1d6662,_0x5e4c63){return client[_0x268e('0x4')](_0xdfc452,_0x3b0c4f)['then'](function(_0x5e9575){logger[_0x268e('0x5')](_0x268e('0x6'),_0x268e('0x7'),_0xdfc452,_0x3b0c4f,_0x5e9575);if(_0x5e9575[_0x268e('0x8')]){logger['error'](_0x268e('0x6'),_0x268e('0x7'),_0xdfc452,_0x5e9575[_0x268e('0x8')]['message'],_0x3b0c4f);return _0x5e4c63(_0x5e9575['error'][_0x268e('0x9')]);}else{return _0x1d6662(_0x5e9575[_0x268e('0xa')]);}})['catch'](function(_0x4aece6){logger[_0x268e('0x8')](_0x268e('0x6'),_0x268e('0x7'),_0xdfc452,_0x4aece6,_0x3b0c4f);return _0x5e4c63(_0x4aece6);});});};module[_0x268e('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 4cbb085..84ab04f 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 _0xd57a=['VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','UserId'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0xd57a,0xdf));var _0xad57=function(_0xed5688,_0x5c9168){_0xed5688=_0xed5688-0x0;var _0x5932c8=_0xd57a[_0xed5688];return _0x5932c8;};'use strict';var util=require(_0xad57('0x0'));var _=require(_0xad57('0x1'));var moment=require(_0xad57('0x2'));function checkNameSurname(_0x48a0fa,_0x2ca4a3,_0x11d3f9){var _0x3e7db3='';if(!_[_0xad57('0x3')](_0x2ca4a3)&&_0xad57('0x4')===typeof _0x2ca4a3){_0x3e7db3+=_0x2ca4a3;}if(!_['isNil'](_0x11d3f9)&&'string'===typeof _0x11d3f9){_0x3e7db3+='\x20'+_0x11d3f9;}if(_0x3e7db3!==''){return _0x3e7db3;}return _0x48a0fa;}function Action(_0x3b5f45,_0x20c6af,_0x3e916a){this[_0xad57('0x5')]=_0x3b5f45;this[_0xad57('0x6')]=_0x3e916a||undefined;this[_0xad57('0x7')]=checkNameSurname(_0x20c6af[_0xad57('0x8')]['phone'],_0x20c6af[_0xad57('0x8')][_0xad57('0x9')],_0x20c6af[_0xad57('0x8')][_0xad57('0xa')]);this[_0xad57('0xb')]=_0x20c6af[_0xad57('0x8')][_0xad57('0xc')];this[_0xad57('0xd')]=_0x3b5f45['name'];this[_0xad57('0xe')]=_0x20c6af[_0xad57('0xe')]||![];this[_0xad57('0xf')]=_0x3b5f45[_0xad57('0xf')];this[_0xad57('0x10')]=_0x3b5f45[_0xad57('0x10')]||0x3;this[_0xad57('0x11')]=_0x20c6af[_0xad57('0x11')];this[_0xad57('0x12')]=_0x20c6af[_0xad57('0x12')];this[_0xad57('0x13')]=_0x20c6af[_0xad57('0x13')];this['countnoanswerretry']=_0x20c6af[_0xad57('0x14')];this[_0xad57('0x15')]=_0x20c6af[_0xad57('0x15')];this['ListId']=_0x20c6af['ListId'];this[_0xad57('0x16')]=_0x20c6af[_0xad57('0x16')];this[_0xad57('0x17')]=_0x20c6af[_0xad57('0x17')];this['CampaignId']=_0x20c6af[_0xad57('0x18')];this[_0xad57('0x19')]=_0x20c6af['id'];this['ContactFirstName']=_0x20c6af[_0xad57('0x8')][_0xad57('0x9')]||'';this[_0xad57('0x1a')]=moment()[_0xad57('0x1b')](_0xad57('0x1c'));this[_0xad57('0x1d')]=_0x20c6af[_0xad57('0x1d')];this[_0xad57('0x1e')]=_0x20c6af[_0xad57('0x1e')];this[_0xad57('0x1f')]=_0x20c6af[_0xad57('0x1f')];this[_0xad57('0x20')]=_0x20c6af[_0xad57('0x20')];this[_0xad57('0x21')]='';this[_0xad57('0x22')]='';}Action[_0xad57('0x23')]['getCaller']=function(){return util[_0xad57('0x1b')](_0xad57('0x24'),this[_0xad57('0x7')],this[_0xad57('0x5')][_0xad57('0x25')]>0x0?this[_0xad57('0xb')][_0xad57('0x26')](this[_0xad57('0x5')][_0xad57('0x25')]):this['number']);};Action[_0xad57('0x23')][_0xad57('0x27')]=function(){return this['queue'];};module[_0xad57('0x28')]=Action; \ No newline at end of file +var _0x3087=['queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','substring','dialCutDigit','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName'];(function(_0x1e6ef6,_0x3f0982){var _0xaeb3c5=function(_0x2f7de2){while(--_0x2f7de2){_0x1e6ef6['push'](_0x1e6ef6['shift']());}};_0xaeb3c5(++_0x3f0982);}(_0x3087,0xe5));var _0x7308=function(_0x13feda,_0x2db6f3){_0x13feda=_0x13feda-0x0;var _0x42d1ad=_0x3087[_0x13feda];return _0x42d1ad;};'use strict';var util=require(_0x7308('0x0'));var _=require(_0x7308('0x1'));var moment=require(_0x7308('0x2'));function checkNameSurname(_0x18d892,_0x3aec10,_0x577085){var _0x1dfd70='';if(!_[_0x7308('0x3')](_0x3aec10)&&_0x7308('0x4')===typeof _0x3aec10){_0x1dfd70+=_0x3aec10;}if(!_[_0x7308('0x3')](_0x577085)&&_0x7308('0x4')===typeof _0x577085){_0x1dfd70+='\x20'+_0x577085;}if(_0x1dfd70!==''){return _0x1dfd70;}return _0x18d892;}function Action(_0x207a8c,_0x24efe1,_0x3c3b1d){this[_0x7308('0x5')]=_0x207a8c;this[_0x7308('0x6')]=_0x3c3b1d||undefined;this[_0x7308('0x7')]=checkNameSurname(_0x24efe1[_0x7308('0x8')][_0x7308('0x9')],_0x24efe1[_0x7308('0x8')]['firstName'],_0x24efe1[_0x7308('0x8')][_0x7308('0xa')]);this['number']=_0x24efe1['Contact'][_0x7308('0x9')];this[_0x7308('0xb')]=_0x207a8c[_0x7308('0x7')];this[_0x7308('0xc')]=_0x24efe1[_0x7308('0xc')]||![];this[_0x7308('0xd')]=_0x207a8c[_0x7308('0xd')];this[_0x7308('0xe')]=_0x207a8c['dialQueueTimeout']||0x3;this[_0x7308('0xf')]=_0x24efe1[_0x7308('0xf')];this['countbusyretry']=_0x24efe1[_0x7308('0x10')];this[_0x7308('0x11')]=_0x24efe1[_0x7308('0x11')];this[_0x7308('0x12')]=_0x24efe1[_0x7308('0x12')];this[_0x7308('0x13')]=_0x24efe1[_0x7308('0x13')];this[_0x7308('0x14')]=_0x24efe1['ListId'];this[_0x7308('0x15')]=_0x24efe1[_0x7308('0x15')];this[_0x7308('0x16')]=_0x24efe1[_0x7308('0x16')];this[_0x7308('0x17')]=_0x24efe1[_0x7308('0x17')];this[_0x7308('0x18')]=_0x24efe1['id'];this[_0x7308('0x19')]=_0x24efe1[_0x7308('0x8')]['firstName']||'';this['starttime']=moment()[_0x7308('0x1a')](_0x7308('0x1b'));this[_0x7308('0x1c')]=_0x24efe1[_0x7308('0x1c')];this[_0x7308('0x1d')]=_0x24efe1[_0x7308('0x1d')];this[_0x7308('0x1e')]=_0x24efe1['callbackat'];this['recallme']=_0x24efe1[_0x7308('0x1f')];this[_0x7308('0x20')]='';this[_0x7308('0x21')]='';}Action[_0x7308('0x22')]['getCaller']=function(){return util[_0x7308('0x1a')](_0x7308('0x23'),this[_0x7308('0x7')],this[_0x7308('0x5')]['dialCutDigit']>0x0?this[_0x7308('0x24')][_0x7308('0x25')](this[_0x7308('0x5')][_0x7308('0x26')]):this[_0x7308('0x24')]);};Action[_0x7308('0x22')]['getQueue']=function(){return this[_0x7308('0xb')];};module[_0x7308('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index a05c454..3bfea7b 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 _0xd238=['uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x144da8,_0x102180){var _0x591822=function(_0x24edf1){while(--_0x24edf1){_0x144da8['push'](_0x144da8['shift']());}};_0x591822(++_0x102180);}(_0xd238,0xfc));var _0x8d23=function(_0x2e1cbf,_0x4056c0){_0x2e1cbf=_0x2e1cbf-0x0;var _0x1eea77=_0xd238[_0x2e1cbf];return _0x1eea77;};'use strict';var util=require(_0x8d23('0x0'));var _=require(_0x8d23('0x1'));var moment=require(_0x8d23('0x2'));function getSeconds(_0x5b2f86,_0x487569){var _0xf38fde=moment(_0x5b2f86)['milliseconds'](0x0);var _0x5327de=moment(_0x487569)['milliseconds'](0x0);return _0xf38fde['diff'](_0x5327de,_0x8d23('0x3'));}function AgentComplete(_0x5ef757,_0x591366){this[_0x8d23('0x4')]=0x4;this[_0x8d23('0x5')]=_0x8d23('0x6');this[_0x8d23('0x7')]=_0x5ef757[_0x8d23('0x7')];this[_0x8d23('0x8')]=_0x5ef757[_0x8d23('0x8')];this['campaigntype']=_0x5ef757[_0x8d23('0x8')]===_0x8d23('0x9')?'queue':_0x5ef757[_0x8d23('0x8')];this['countbusyretry']=_0x5ef757[_0x8d23('0xa')];this[_0x8d23('0xb')]=_0x5ef757[_0x8d23('0xb')];this['countnoanswerretry']=_0x5ef757[_0x8d23('0xc')];this[_0x8d23('0xd')]=_0x5ef757[_0x8d23('0xa')]+_0x5ef757[_0x8d23('0xb')]+_0x5ef757['countnoanswerretry'];this[_0x8d23('0xe')]=_0x591366['uniqueid'];this[_0x8d23('0xf')]=_0x5ef757[_0x8d23('0x10')];this['calleridnum']=_0x5ef757[_0x8d23('0x11')];this[_0x8d23('0x12')]=_0x5ef757[_0x8d23('0x12')];this[_0x8d23('0x13')]=_0x5ef757[_0x8d23('0x13')];this[_0x8d23('0x14')]=_0x5ef757[_0x8d23('0x14')];this[_0x8d23('0x15')]=moment()[_0x8d23('0x16')](_0x8d23('0x17'));this['ringtime']=getSeconds(_0x5ef757[_0x8d23('0x13')],_0x5ef757[_0x8d23('0x12')]);this['holdtime']=getSeconds(_0x5ef757[_0x8d23('0x14')],_0x5ef757[_0x8d23('0x13')]);this[_0x8d23('0x18')]=getSeconds(this[_0x8d23('0x15')],_0x5ef757[_0x8d23('0x14')]);this[_0x8d23('0x19')]=_0x591366[_0x8d23('0x19')];this[_0x8d23('0x1a')]=_0x591366[_0x8d23('0x1a')];this[_0x8d23('0x1b')]=_0x591366[_0x8d23('0x1b')];this[_0x8d23('0x1c')]=_0x5ef757['callback'];this[_0x8d23('0x1d')]=_0x5ef757['callbackuniqueid'];this['callbackat']=_0x5ef757[_0x8d23('0x1e')];this['recallme']=_0x5ef757[_0x8d23('0x1f')];this['ContactId']=_0x5ef757['ContactId'];this['ListId']=_0x5ef757['ListId'];this[_0x8d23('0x20')]=_0x5ef757[_0x8d23('0x20')];this[_0x8d23('0x21')]=_0x5ef757[_0x8d23('0x21')];this[_0x8d23('0x22')]=_0x5ef757['CampaignId'];this['originatecalleridnum']=_0x5ef757[_0x8d23('0x23')]||'';this[_0x8d23('0x24')]=_0x5ef757[_0x8d23('0x24')]||'';}module[_0x8d23('0x25')]=AgentComplete; \ No newline at end of file +var _0xce65=['type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','state','Answer','scheduledat'];(function(_0x4a72a0,_0x2b8292){var _0x143dd3=function(_0x24ed68){while(--_0x24ed68){_0x4a72a0['push'](_0x4a72a0['shift']());}};_0x143dd3(++_0x2b8292);}(_0xce65,0x14f));var _0x5ce6=function(_0x450185,_0x10ba03){_0x450185=_0x450185-0x0;var _0x16431a=_0xce65[_0x450185];return _0x16431a;};'use strict';var util=require(_0x5ce6('0x0'));var _=require('lodash');var moment=require(_0x5ce6('0x1'));function getSeconds(_0xb48f26,_0x1e46e5){var _0x137fcb=moment(_0xb48f26)[_0x5ce6('0x2')](0x0);var _0x36dac2=moment(_0x1e46e5)['milliseconds'](0x0);return _0x137fcb[_0x5ce6('0x3')](_0x36dac2,'seconds');}function AgentComplete(_0x23b42d,_0x2f82f9){this[_0x5ce6('0x4')]=0x4;this['statedesc']=_0x5ce6('0x5');this['scheduledat']=_0x23b42d[_0x5ce6('0x6')];this[_0x5ce6('0x7')]=_0x23b42d[_0x5ce6('0x7')];this[_0x5ce6('0x8')]=_0x23b42d[_0x5ce6('0x7')]==='outbound'?'queue':_0x23b42d['type'];this['countbusyretry']=_0x23b42d[_0x5ce6('0x9')];this[_0x5ce6('0xa')]=_0x23b42d[_0x5ce6('0xa')];this[_0x5ce6('0xb')]=_0x23b42d[_0x5ce6('0xb')];this['countglobal']=_0x23b42d[_0x5ce6('0x9')]+_0x23b42d[_0x5ce6('0xa')]+_0x23b42d[_0x5ce6('0xb')];this[_0x5ce6('0xc')]=_0x2f82f9[_0x5ce6('0xc')];this['calleridname']=_0x23b42d[_0x5ce6('0xd')];this[_0x5ce6('0xe')]=_0x23b42d[_0x5ce6('0xf')];this[_0x5ce6('0x10')]=_0x23b42d[_0x5ce6('0x10')];this[_0x5ce6('0x11')]=_0x23b42d[_0x5ce6('0x11')];this['answertime']=_0x23b42d[_0x5ce6('0x12')];this[_0x5ce6('0x13')]=moment()['format'](_0x5ce6('0x14'));this[_0x5ce6('0x15')]=getSeconds(_0x23b42d[_0x5ce6('0x11')],_0x23b42d['starttime']);this[_0x5ce6('0x16')]=getSeconds(_0x23b42d[_0x5ce6('0x12')],_0x23b42d['responsetime']);this[_0x5ce6('0x17')]=getSeconds(this[_0x5ce6('0x13')],_0x23b42d[_0x5ce6('0x12')]);this[_0x5ce6('0x18')]=_0x2f82f9['queue'];this['membername']=_0x2f82f9['membername'];this[_0x5ce6('0x19')]=_0x2f82f9[_0x5ce6('0x19')];this[_0x5ce6('0x1a')]=_0x23b42d[_0x5ce6('0x1a')];this[_0x5ce6('0x1b')]=_0x23b42d['callbackuniqueid'];this[_0x5ce6('0x1c')]=_0x23b42d['callbackat'];this[_0x5ce6('0x1d')]=_0x23b42d[_0x5ce6('0x1d')];this['ContactId']=_0x23b42d[_0x5ce6('0x1e')];this[_0x5ce6('0x1f')]=_0x23b42d[_0x5ce6('0x1f')];this[_0x5ce6('0x20')]=_0x23b42d[_0x5ce6('0x20')];this['VoiceQueueId']=_0x23b42d[_0x5ce6('0x21')];this[_0x5ce6('0x22')]=_0x23b42d[_0x5ce6('0x22')];this[_0x5ce6('0x23')]=_0x23b42d[_0x5ce6('0x23')]||'';this[_0x5ce6('0x24')]=_0x23b42d[_0x5ce6('0x24')]||'';}module[_0x5ce6('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a512f7c..439930b 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 _0xf435=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0x1470d4,_0x5da817){var _0x1f5668=function(_0x2f57ac){while(--_0x2f57ac){_0x1470d4['push'](_0x1470d4['shift']());}};_0x1f5668(++_0x5da817);}(_0xf435,0x174));var _0x5f43=function(_0xf19a34,_0x225653){_0xf19a34=_0xf19a34-0x0;var _0x48efcc=_0xf435[_0xf19a34];return _0x48efcc;};'use strict';var util=require('util');var _=require(_0x5f43('0x0'));var moment=require(_0x5f43('0x1'));function getSeconds(_0x351b0f,_0x1d26a9){var _0x2f05a4=moment(_0x351b0f)['milliseconds'](0x0);var _0x286c03=moment(_0x1d26a9)[_0x5f43('0x2')](0x0);return _0x2f05a4[_0x5f43('0x3')](_0x286c03,_0x5f43('0x4'));}function Final(_0x4b013f){this[_0x5f43('0x5')]=_0x4b013f[_0x5f43('0x5')];this[_0x5f43('0x6')]=_0x4b013f['scheduledat'];this[_0x5f43('0x7')]=_0x4b013f[_0x5f43('0x7')];this[_0x5f43('0x8')]=_0x4b013f[_0x5f43('0x7')]===_0x5f43('0x9')?_0x5f43('0xa'):_0x4b013f[_0x5f43('0x7')];this[_0x5f43('0xb')]=_0x4b013f[_0x5f43('0xb')];this[_0x5f43('0xc')]=_0x4b013f[_0x5f43('0xc')];this['countnoanswerretry']=_0x4b013f['countnoanswerretry'];this[_0x5f43('0xd')]=_0x4b013f[_0x5f43('0xb')]+_0x4b013f[_0x5f43('0xc')]+_0x4b013f[_0x5f43('0xe')];this[_0x5f43('0xa')]=_0x4b013f[_0x5f43('0xa')];this[_0x5f43('0xf')]=_0x4b013f[_0x5f43('0xf')];this['calleridnum']=_0x4b013f[_0x5f43('0x10')];this['starttime']=_0x4b013f[_0x5f43('0x11')];this['responsetime']=_0x4b013f[_0x5f43('0x12')];this[_0x5f43('0x13')]=_0x4b013f[_0x5f43('0x12')];this[_0x5f43('0x14')]=_0x4b013f['ringtime']||0x0;this[_0x5f43('0x15')]=_0x4b013f[_0x5f43('0x15')]||0x0;this[_0x5f43('0x16')]=_0x4b013f['talktime']||0x0;this[_0x5f43('0x17')]=_0x4b013f[_0x5f43('0x17')];this[_0x5f43('0x18')]=_0x4b013f[_0x5f43('0x18')];this[_0x5f43('0x19')]=_0x4b013f[_0x5f43('0x19')];this['recallme']=_0x4b013f[_0x5f43('0x1a')];this[_0x5f43('0x1b')]=_0x4b013f['ContactId'];this[_0x5f43('0x1c')]=_0x4b013f[_0x5f43('0x1c')];this[_0x5f43('0x1d')]=_0x4b013f[_0x5f43('0x1d')];this[_0x5f43('0x1e')]=_0x4b013f[_0x5f43('0x1e')];this['CampaignId']=_0x4b013f[_0x5f43('0x1f')];this['originatecalleridnum']=_0x4b013f[_0x5f43('0x20')]||'';this['originatecalleridname']=_0x4b013f['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x4813=['seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff'];(function(_0x3a3105,_0x5f3123){var _0x3cb0ae=function(_0x539e48){while(--_0x539e48){_0x3a3105['push'](_0x3a3105['shift']());}};_0x3cb0ae(++_0x5f3123);}(_0x4813,0xdc));var _0x3481=function(_0x4b13f6,_0x53acfc){_0x4b13f6=_0x4b13f6-0x0;var _0x427747=_0x4813[_0x4b13f6];return _0x427747;};'use strict';var util=require(_0x3481('0x0'));var _=require('lodash');var moment=require(_0x3481('0x1'));function getSeconds(_0x501a35,_0x5d2ab4){var _0xe5e02e=moment(_0x501a35)[_0x3481('0x2')](0x0);var _0x57a169=moment(_0x5d2ab4)[_0x3481('0x2')](0x0);return _0xe5e02e[_0x3481('0x3')](_0x57a169,_0x3481('0x4'));}function Final(_0x3b46aa){this[_0x3481('0x5')]=_0x3b46aa[_0x3481('0x5')];this[_0x3481('0x6')]=_0x3b46aa['scheduledat'];this['type']=_0x3b46aa[_0x3481('0x7')];this['campaigntype']=_0x3b46aa[_0x3481('0x7')]===_0x3481('0x8')?_0x3481('0x9'):_0x3b46aa[_0x3481('0x7')];this[_0x3481('0xa')]=_0x3b46aa[_0x3481('0xa')];this[_0x3481('0xb')]=_0x3b46aa['countcongestionretry'];this['countnoanswerretry']=_0x3b46aa[_0x3481('0xc')];this[_0x3481('0xd')]=_0x3b46aa[_0x3481('0xa')]+_0x3b46aa[_0x3481('0xb')]+_0x3b46aa[_0x3481('0xc')];this['queue']=_0x3b46aa[_0x3481('0x9')];this[_0x3481('0xe')]=_0x3b46aa[_0x3481('0xe')];this[_0x3481('0xf')]=_0x3b46aa[_0x3481('0xf')];this['starttime']=_0x3b46aa['starttime'];this[_0x3481('0x10')]=_0x3b46aa[_0x3481('0x10')];this['endtime']=_0x3b46aa[_0x3481('0x10')];this[_0x3481('0x11')]=_0x3b46aa[_0x3481('0x11')]||0x0;this[_0x3481('0x12')]=_0x3b46aa[_0x3481('0x12')]||0x0;this[_0x3481('0x13')]=_0x3b46aa[_0x3481('0x13')]||0x0;this['callback']=_0x3b46aa[_0x3481('0x14')];this[_0x3481('0x15')]=_0x3b46aa[_0x3481('0x15')];this[_0x3481('0x16')]=_0x3b46aa[_0x3481('0x16')];this[_0x3481('0x17')]=_0x3b46aa[_0x3481('0x17')];this[_0x3481('0x18')]=_0x3b46aa['ContactId'];this[_0x3481('0x19')]=_0x3b46aa['ListId'];this[_0x3481('0x1a')]=_0x3b46aa['UserId'];this[_0x3481('0x1b')]=_0x3b46aa[_0x3481('0x1b')];this[_0x3481('0x1c')]=_0x3b46aa[_0x3481('0x1c')];this[_0x3481('0x1d')]=_0x3b46aa['originatecalleridnum']||'';this[_0x3481('0x1e')]=_0x3b46aa[_0x3481('0x1e')]||'';}module[_0x3481('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0baf3ba..8ff4760 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 _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x500692,_0x41b8cb){var _0x1487ad=function(_0x2c1089){while(--_0x2c1089){_0x500692['push'](_0x500692['shift']());}};_0x1487ad(++_0x41b8cb);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x11e1ab,_0x4bb093){var _0x530ca0=function(_0x329d8b){while(--_0x329d8b){_0x11e1ab['push'](_0x11e1ab['shift']());}};_0x530ca0(++_0x4bb093);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 91ddb13..3123f7a 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 _0x65b1=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound'];(function(_0xf1c079,_0x4f0c84){var _0x15dd1f=function(_0x3e80dd){while(--_0x3e80dd){_0xf1c079['push'](_0xf1c079['shift']());}};_0x15dd1f(++_0x4f0c84);}(_0x65b1,0x131));var _0x165b=function(_0x237e4e,_0x1b3a25){_0x237e4e=_0x237e4e-0x0;var _0x2ebf56=_0x65b1[_0x237e4e];return _0x2ebf56;};'use strict';var util=require(_0x165b('0x0'));var _=require(_0x165b('0x1'));var moment=require(_0x165b('0x2'));function getSeconds(_0xa7c568,_0x34271e){var _0x2cd64e=moment(_0xa7c568)[_0x165b('0x3')](0x0);var _0xdbbeb9=moment(_0x34271e)[_0x165b('0x3')](0x0);return _0x2cd64e[_0x165b('0x4')](_0xdbbeb9,_0x165b('0x5'));}function History(_0x13bd74){this['uniqueid']=_0x13bd74[_0x165b('0x6')];this[_0x165b('0x7')]=_0x13bd74[_0x165b('0x7')]||undefined;this['type']=_0x13bd74[_0x165b('0x8')];this['campaigntype']=_0x13bd74[_0x165b('0x8')]===_0x165b('0x9')?_0x165b('0xa'):_0x13bd74[_0x165b('0x8')];this['countbusyretry']=_0x13bd74[_0x165b('0xb')];this[_0x165b('0xc')]=_0x13bd74[_0x165b('0xc')];this[_0x165b('0xd')]=_0x13bd74[_0x165b('0xd')];this[_0x165b('0xe')]=_0x13bd74[_0x165b('0xb')]+_0x13bd74[_0x165b('0xc')]+_0x13bd74['countnoanswerretry'];this[_0x165b('0xa')]=_0x13bd74[_0x165b('0xa')];this[_0x165b('0xf')]=_0x13bd74[_0x165b('0x10')];this['calleridnum']=_0x13bd74[_0x165b('0x11')];this[_0x165b('0x12')]=_0x13bd74[_0x165b('0x12')];this[_0x165b('0x13')]=_0x13bd74['responsetime'];this[_0x165b('0x14')]=_0x13bd74[_0x165b('0x13')];this[_0x165b('0x15')]=getSeconds(_0x13bd74[_0x165b('0x13')],_0x13bd74[_0x165b('0x12')]);this[_0x165b('0x16')]=0x0;this['talktime']=0x0;this[_0x165b('0x17')]=_0x13bd74[_0x165b('0x17')];this[_0x165b('0x18')]=_0x13bd74[_0x165b('0x18')];this[_0x165b('0x19')]=_0x13bd74[_0x165b('0x19')];this['recallme']=_0x13bd74[_0x165b('0x1a')];this['ContactId']=_0x13bd74[_0x165b('0x1b')];this[_0x165b('0x1c')]=_0x13bd74[_0x165b('0x1c')];this[_0x165b('0x1d')]=_0x13bd74[_0x165b('0x1d')];this[_0x165b('0x1e')]=_0x13bd74[_0x165b('0x1e')];this[_0x165b('0x1f')]=_0x13bd74['CampaignId'];this[_0x165b('0x20')]=_0x13bd74['originatecalleridnum']||'';this[_0x165b('0x21')]=_0x13bd74[_0x165b('0x21')]||'';}module[_0x165b('0x22')]=History; \ No newline at end of file +var _0x5e76=['responsetime','endtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','number','starttime'];(function(_0xd4ed0a,_0x34aa11){var _0x27a9e3=function(_0x18fdd6){while(--_0x18fdd6){_0xd4ed0a['push'](_0xd4ed0a['shift']());}};_0x27a9e3(++_0x34aa11);}(_0x5e76,0xe7));var _0x65e7=function(_0x4cb6c1,_0x247246){_0x4cb6c1=_0x4cb6c1-0x0;var _0x33230f=_0x5e76[_0x4cb6c1];return _0x33230f;};'use strict';var util=require(_0x65e7('0x0'));var _=require(_0x65e7('0x1'));var moment=require(_0x65e7('0x2'));function getSeconds(_0xdc02b6,_0x2d5501){var _0x232591=moment(_0xdc02b6)[_0x65e7('0x3')](0x0);var _0x2cc68b=moment(_0x2d5501)['milliseconds'](0x0);return _0x232591[_0x65e7('0x4')](_0x2cc68b,'seconds');}function History(_0x5c6462){this[_0x65e7('0x5')]=_0x5c6462['uniqueid'];this[_0x65e7('0x6')]=_0x5c6462[_0x65e7('0x6')]||undefined;this[_0x65e7('0x7')]=_0x5c6462['type'];this['campaigntype']=_0x5c6462[_0x65e7('0x7')]===_0x65e7('0x8')?_0x65e7('0x9'):_0x5c6462[_0x65e7('0x7')];this['countbusyretry']=_0x5c6462[_0x65e7('0xa')];this[_0x65e7('0xb')]=_0x5c6462[_0x65e7('0xb')];this[_0x65e7('0xc')]=_0x5c6462[_0x65e7('0xc')];this['countglobal']=_0x5c6462[_0x65e7('0xa')]+_0x5c6462[_0x65e7('0xb')]+_0x5c6462[_0x65e7('0xc')];this[_0x65e7('0x9')]=_0x5c6462[_0x65e7('0x9')];this[_0x65e7('0xd')]=_0x5c6462['name'];this[_0x65e7('0xe')]=_0x5c6462[_0x65e7('0xf')];this[_0x65e7('0x10')]=_0x5c6462[_0x65e7('0x10')];this['responsetime']=_0x5c6462[_0x65e7('0x11')];this[_0x65e7('0x12')]=_0x5c6462[_0x65e7('0x11')];this['ringtime']=getSeconds(_0x5c6462[_0x65e7('0x11')],_0x5c6462[_0x65e7('0x10')]);this[_0x65e7('0x13')]=0x0;this[_0x65e7('0x14')]=0x0;this[_0x65e7('0x15')]=_0x5c6462['callback'];this['callbackuniqueid']=_0x5c6462['callbackuniqueid'];this[_0x65e7('0x16')]=_0x5c6462['callbackat'];this[_0x65e7('0x17')]=_0x5c6462[_0x65e7('0x17')];this['ContactId']=_0x5c6462[_0x65e7('0x18')];this[_0x65e7('0x19')]=_0x5c6462['ListId'];this[_0x65e7('0x1a')]=_0x5c6462['UserId'];this[_0x65e7('0x1b')]=_0x5c6462['VoiceQueueId'];this[_0x65e7('0x1c')]=_0x5c6462[_0x65e7('0x1c')];this[_0x65e7('0x1d')]=_0x5c6462['originatecalleridnum']||'';this[_0x65e7('0x1e')]=_0x5c6462['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 4bbea18..341e3c2 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 _0x955f=['\x20Amax\x20=\x20','Error','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','[busyFactor]','\x20Umin\x20=\x20','Amax\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','dialer','booked','../../../config/logger','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','originated','Trunk','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','info','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','[checkGetDataPredictive][obj]','[ErlangB]','merge','startProgressive','[freeVariablesPredictive]','handlePredictive','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','[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_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','channel','No\x20such\x20channel','queue','updateOriginated','countReScheduled','resolve','catch','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','hasOwnProperty','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','[syncHangupInAMD]','MACHINE','Machine','[syncMachine][createHistory]','AMD','[syncHangupInAMDIvr][createHistory]','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','CALLEREXIT','actionid','stateinterface','locked','queueBooked','pick','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','responsetime','response','[callProgressDetecting]\x20','countbusyretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','countnoanswerretry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalPauses','floor','erlangAbandonmentRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Agent\x20free','agent\x20max\x20free\x20','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','averageHandleTime','dialPredictiveInterval','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','abandonmentRate','agentBusyFactor','busyFactor','[CatchErlangB]','check\x20failure','erlangCallToSecond','[startMethodPredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','[Originate][historyBlacklist]','inBlackList','temp','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','talking','not_inuse','dialOrderByScheduledAt','[countReScheduled]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x955f,0x1eb));var _0xf955=function(_0x19612a,_0x55f856){_0x19612a=_0x19612a-0x0;var _0x1f460c=_0x955f[_0x19612a];return _0x1f460c;};'use strict';var util=require(_0xf955('0x0'));var _=require(_0xf955('0x1'));var BPromise=require(_0xf955('0x2'));var uuid=require(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xf955('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xf955('0x6'));var loggerBooked=require('../../../config/logger')(_0xf955('0x7'));var loggerPredictive=require(_0xf955('0x8'))(_0xf955('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xf955('0xa'));var loggerSyncQueueSummary=require(_0xf955('0x8'))('syncQueueSummary');var ami=require(_0xf955('0xb'));config[_0xf955('0xc')]=_[_0xf955('0xd')](config[_0xf955('0xc')],{'host':_0xf955('0xe'),'port':0x18eb});var io=require(_0xf955('0xf'))(new Redis(config[_0xf955('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xf955('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xf955('0x11'));var voiceQueueRt=require(_0xf955('0x12'));var Action=require(_0xf955('0x13'));var History=require('./history');var Final=require(_0xf955('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xf955('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xf955('0x16')][_0xf955('0x17')]||_0xf955('0x18');var strategy={'rrmemory':_0xf955('0x19'),'roundrobin':_0xf955('0x1a')};var Sequence=function(){};Sequence[_0xf955('0x1b')][_0xf955('0x1c')]=function(_0x2783f2){this[_0xf955('0x1d')]=this[_0xf955('0x1d')]?this['tail'][_0xf955('0x1e')](_0x2783f2):_0x2783f2();};function Dialer(_0x54e60b,_0x3139d5){this[_0xf955('0x1f')]=new Sequence();this[_0xf955('0x20')]=_0x3139d5;this[_0xf955('0x21')]=_0x54e60b['voiceQueues'];this['campaigns']=_0x54e60b[_0xf955('0x22')];this[_0xf955('0x23')]=_0x54e60b[_0xf955('0x23')];this['trunks']=_0x54e60b[_0xf955('0x24')];this[_0xf955('0x25')]=config[_0xf955('0x25')]||0x2;this[_0xf955('0x26')]={};this[_0xf955('0x27')]={};this['contactsId']={};this[_0xf955('0x28')]={};this[_0xf955('0x29')]={};this[_0xf955('0x2a')]={};this['startProgressive']={};this[_0xf955('0x2b')]={};this['queueBooked']={};this[_0xf955('0x2c')]={};ami['on'](_0xf955('0x2d'),this[_0xf955('0x2e')][_0xf955('0x2f')](this));ami['on'](_0xf955('0x30'),this['syncQueueCallerAbandon'][_0xf955('0x2f')](this));ami['on'](_0xf955('0x31'),this[_0xf955('0x32')][_0xf955('0x2f')](this));ami['on'](_0xf955('0x33'),this[_0xf955('0x34')][_0xf955('0x2f')](this));ami['on']('custom:queuesummary',this[_0xf955('0x35')][_0xf955('0x2f')](this));ami['on'](_0xf955('0x36'),this[_0xf955('0x37')][_0xf955('0x2f')](this));ami['on'](_0xf955('0x38'),this[_0xf955('0x39')]['bind'](this));ami['on'](_0xf955('0x3a'),this[_0xf955('0x3b')][_0xf955('0x2f')](this));ami['on'](_0xf955('0x3c'),this[_0xf955('0x3d')][_0xf955('0x2f')](this));ami['on']('queuestatuscomplete',this[_0xf955('0x3e')][_0xf955('0x2f')](this));this['loopCampaigns']();this[_0xf955('0x3f')]();}function isNotNull(_0x2c8df1){return _0x2c8df1!==null&&!_[_0xf955('0x40')](_0x2c8df1);}function checkIsLoggedIn(_0x1ef794,_0x59bfb5){return function(){if(_0x59bfb5<=0x0){_0x1ef794[_0xf955('0x41')]='AGENTS_NOT_LOGGED';throw _0x1ef794[_0xf955('0x42')]+_0xf955('0x43');}};}function isActive(_0x44eacf){return _0x44eacf;}function checkIsActive(_0x4069fe,_0x1e8024){return function(){if(!isActive(_0x1e8024)){_0x4069fe[_0xf955('0x41')]=_0xf955('0x44');throw _0x4069fe[_0xf955('0x42')]+'\x20NOT\x20Active';}};}function checkInterval(_0x45e913){return function(){if(!isNotNull(_0x45e913[_0xf955('0x45')])){_0x45e913[_0xf955('0x41')]=_0xf955('0x46');throw _0x45e913['name']+_0xf955('0x47');}if(!isNotNull(_0x45e913[_0xf955('0x45')][_0xf955('0x48')])){_0x45e913[_0xf955('0x41')]=_0xf955('0x46');throw _0x45e913['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x45e913[_0xf955('0x45')][_0xf955('0x48')]))){_0x45e913[_0xf955('0x41')]=_0xf955('0x46');throw _0x45e913[_0xf955('0x42')]+_0xf955('0x47');}};}function msgResponse(_0x5acb00,_0x3acc4b,_0x515dc6){return{'action':_0x5acb00,'response':_0x3acc4b,'message':_0x515dc6};}function myreject(_0x8f842f){return function(_0x2371e4){return _0x8f842f(msgResponse(_0xf955('0x49'),'Error',JSON[_0xf955('0x4a')](_0x2371e4)));};}function getSeconds(_0x4bef80,_0x2bc1a0){var _0x40edaf=moment(_0x4bef80)[_0xf955('0x4b')](0x0);var _0x45b78d=moment(_0x2bc1a0)['milliseconds'](0x0);return _0x40edaf[_0xf955('0x4c')](_0x45b78d,_0xf955('0x4d'));}function emit(_0x5a48be,_0x430e12,_0x460aa7){io['to'](_0x5a48be)[_0xf955('0x4e')](_0x430e12,_0x460aa7);}function emitVoiceQueueSummary(_0x547ed9){if(_0x547ed9[_0xf955('0x4f')]===_0xf955('0x50')){var _0x11b7e2={'id':_0x547ed9['id'],'name':_0x547ed9['name'],'strategy':_0x547ed9[_0xf955('0x51')],'answered':_0x547ed9[_0xf955('0x52')],'available':_0x547ed9[_0xf955('0x53')],'loggedIn':_0x547ed9[_0xf955('0x54')],'pTalking':_0x547ed9[_0xf955('0x55')],'sumBillable':_0x547ed9[_0xf955('0x56')],'sumDuration':_0x547ed9[_0xf955('0x57')],'sumHoldTime':_0x547ed9[_0xf955('0x58')]||0x0,'talking':_0x547ed9['talking'],'total':_0x547ed9[_0xf955('0x59')],'type':_0x547ed9[_0xf955('0x4f')],'unmanaged':_0x547ed9[_0xf955('0x5a')],'abandoned':_0x547ed9[_0xf955('0x5b')],'waiting':_0x547ed9[_0xf955('0x5c')],'loggedInDb':_0x547ed9[_0xf955('0x5d')],'dialActive':_0x547ed9[_0xf955('0x5e')],'dialMethod':_0x547ed9[_0xf955('0x5f')],'dialOriginateCallerIdName':_0x547ed9[_0xf955('0x60')],'dialOriginateCallerIdNumber':_0x547ed9[_0xf955('0x61')],'dialOriginateTimeout':_0x547ed9[_0xf955('0x62')],'dialPrefix':_0x547ed9[_0xf955('0x63')],'outboundAnswerAgiCallsDay':_0x547ed9[_0xf955('0x64')],'outboundAnswerCallsDay':_0x547ed9[_0xf955('0x65')],'outboundBlacklistCallsDay':_0x547ed9[_0xf955('0x66')],'outboundBusyCallsDay':_0x547ed9[_0xf955('0x67')],'outboundCongestionCallsDay':_0x547ed9[_0xf955('0x68')],'outboundDropCallsDayACS':_0x547ed9[_0xf955('0x69')],'outboundDropCallsDayCallersExit':_0x547ed9[_0xf955('0x6a')],'outboundDropCallsDayTimeout':_0x547ed9['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x547ed9[_0xf955('0x6b')],'outboundNoSuchCallsDay':_0x547ed9[_0xf955('0x6c')],'outboundOriginateFailureCallsDay':_0x547ed9[_0xf955('0x6d')],'outboundReCallsDay':_0x547ed9['outboundReCallsDay'],'outboundRejectCallsDay':_0x547ed9[_0xf955('0x6e')],'outboundUnknownCallsDay':_0x547ed9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x547ed9[_0xf955('0x6f')],'predictiveIntervalAvgHoldtime':_0x547ed9['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x547ed9[_0xf955('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x547ed9[_0xf955('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x547ed9[_0xf955('0x72')],'predictiveIntervalErlangCalls':_0x547ed9[_0xf955('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x547ed9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x547ed9[_0xf955('0x74')],'predictiveIntervalLowerLimit':_0x547ed9[_0xf955('0x75')],'predictiveIntervalMultiplicativeFactor':_0x547ed9[_0xf955('0x76')],'predictiveIntervalPauses':_0x547ed9['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x547ed9['predictiveIntervalTotalCalls'],'message':_0x547ed9[_0xf955('0x41')],'originated':_0x547ed9[_0xf955('0x77')]};if(_0x547ed9[_0xf955('0x78')]){_0x11b7e2[_0xf955('0x78')]={'id':_0x547ed9['Trunk']['id'],'name':_0x547ed9[_0xf955('0x78')][_0xf955('0x42')],'active':_0x547ed9[_0xf955('0x78')]['active'],'callerid':_0x547ed9[_0xf955('0x78')]['callerid']};}if(_0x547ed9[_0xf955('0x45')]){_0x11b7e2[_0xf955('0x45')]={'id':_0x547ed9[_0xf955('0x45')]['id'],'name':_0x547ed9['Interval'][_0xf955('0x42')]};}var _0x3c8634=md5(JSON[_0xf955('0x4a')](_0x11b7e2));if(_0x547ed9[_0xf955('0x79')]!==_0x3c8634){_0x547ed9['md5']=_0x3c8634;emit(util[_0xf955('0x7a')](_0xf955('0x7b'),_0x11b7e2[_0xf955('0x42')]),_0xf955('0x7c'),_0x11b7e2);}}}function emitCampaignSummary(_0x2c992c){if(_0x2c992c['type']===_0xf955('0x7d')){emit(util['format'](_0xf955('0x7e'),_0x2c992c['name']),_0xf955('0x7f'),_0x2c992c);}}function checkGetDataPredictive(_0x55e625){if(isNotNull(_0x55e625)){if(!_['isEmpty'](_0x55e625)){if(_0x55e625[_0xf955('0x80')]>0x0){if(!_[_0xf955('0x40')](_0x55e625['predictiveIntervalAvgTalktime'])&&_0x55e625[_0xf955('0x70')]>0x0){return!![];}else{loggerPredictive['info']('[checkGetDataPredictive][avgTalktime]',JSON['stringify'](_0x55e625));}if(!_['isUndefined'](_0x55e625[_0xf955('0x81')])&&_0x55e625[_0xf955('0x81')]>0x0){return!![];}else{loggerPredictive['info']('[checkGetDataPredictive][avgHoldtime]',JSON[_0xf955('0x4a')](_0x55e625));}}else{loggerPredictive[_0xf955('0x82')](_0xf955('0x83'),JSON[_0xf955('0x4a')](_0x55e625));}}else{loggerPredictive[_0xf955('0x82')](_0xf955('0x84'),JSON[_0xf955('0x4a')](_0x55e625));}}else{loggerPredictive[_0xf955('0x82')](_0xf955('0x85'),JSON[_0xf955('0x4a')](_0x55e625));}return![];}function mergeDataErlangB(_0x1b7b73){return function(_0x350873){loggerPredictive['info'](_0xf955('0x86'),JSON[_0xf955('0x4a')](_0x350873));_[_0xf955('0x87')](_0x1b7b73,_0x350873);};}function getDiff(_0x24322a){var _0x3242fe=moment()['milliseconds'](0x0);var _0xf5d575=moment(_0x24322a)[_0xf955('0x4b')](0x0);return _0x3242fe[_0xf955('0x4c')](_0xf5d575,_0xf955('0x4d'));}function ifInterval(_0x1e0ef0,_0x9057df){if(_[_0xf955('0x40')](_0x9057df)){return![];}if(getDiff(_0x9057df)<_0x1e0ef0*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x60c8a2){if(isNotNull(_0x60c8a2)){if(!_[_0xf955('0x40')](_0x60c8a2[_0xf955('0x88')])){_0x60c8a2['startProgressive']=undefined;loggerPredictive[_0xf955('0x82')](_0xf955('0x89'),_0xf955('0x88'),_0x60c8a2[_0xf955('0x42')]);}if(!_[_0xf955('0x40')](_0x60c8a2[_0xf955('0x2a')])){_0x60c8a2[_0xf955('0x2a')]=undefined;loggerPredictive[_0xf955('0x82')](_0xf955('0x89'),_0xf955('0x2a'),_0x60c8a2[_0xf955('0x42')]);}if(!_[_0xf955('0x40')](_0x60c8a2['handlePredictive'])){clearInterval(_0x60c8a2[_0xf955('0x8a')]);_0x60c8a2[_0xf955('0x8a')]=undefined;loggerPredictive[_0xf955('0x82')](_0xf955('0x89'),_0xf955('0x8a'),_0x60c8a2[_0xf955('0x42')]);}}}function erlangb(_0x1c4e2d,_0x50e16c){if(_0x50e16c===0x0){return 0x0;}var _0x5301bb=0x1;for(var _0x5e73ff=0x1;_0x5e73ff<=_0x50e16c;_0x5e73ff+=0x1){_0x5301bb=0x1+_0x5301bb*_0x5e73ff/_0x1c4e2d;}return 0x1/_0x5301bb;}function isVoiceQueueOutbound(_0x13c711){return _0x13c711==='outbound';}function isNotPreview(_0x570b6a){return _0x570b6a!==_0xf955('0x20');}function isCampaignIvr(_0x533e0f){return _0x533e0f===_0xf955('0x7d');}function getCallerId(_0x3fa5b5,_0x158469,_0x30cb80){if(!_['isUndefined'](_0x30cb80)&&_0xf955('0x8b')===typeof _0x30cb80&&!_[_0xf955('0x8c')](_0x30cb80)){if(!_[_0xf955('0x40')](_0x158469)&&_0xf955('0x8b')===typeof _0x158469&&!_[_0xf955('0x8c')](_0x158469)){return util['format'](_0xf955('0x8d'),_0x158469,_0x30cb80);}return util['format'](_0xf955('0x8d'),_0x30cb80,_0x30cb80);}if(!_[_0xf955('0x40')](_0x3fa5b5)&&_0xf955('0x8b')===typeof _0x3fa5b5&&!_['isEmpty'](_0x3fa5b5)){return _0x3fa5b5;}return _0xf955('0x8e');}function loggerCatchQueueSummary(_0x40ca54,_0x16831f){return function(_0x379aa){freeVariablesPredictive(_0x16831f);emitVoiceQueueSummary(_0x16831f);emitCampaignSummary(_0x16831f);loggerSyncQueueSummary[_0xf955('0x8f')](_0x40ca54,util[_0xf955('0x90')](_0x379aa,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3761f2,_0x47e5de){return function(_0x5f2d6c){loggerPredictive[_0xf955('0x8f')](_0x3761f2,JSON[_0xf955('0x4a')](_0x5f2d6c));freeVariablesPredictive(_0x47e5de);};}function loggerCatch(_0x3390f3){return function(_0x3f0873){logger[_0xf955('0x8f')](_0x3390f3,util[_0xf955('0x90')](_0x3f0873,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x52803a){return _0x52803a&&!_[_0xf955('0x40')](_0x52803a)&&_0x52803a[_0xf955('0x91')]>0x0;}function decremetOriginate(_0x2d20af){if(!_[_0xf955('0x40')](_0x2d20af)&&_0x2d20af!==null){if(_0x2d20af['hasOwnProperty'](_0xf955('0x77'))){if(_0x2d20af['originated']>0x0){_0x2d20af[_0xf955('0x77')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf955('0x8f')](_0xf955('0x92'));}}function checkContactLowerLimitOriginate(_0x51c8a4,_0x1e95c3,_0x28e662){if(_0x1e95c3>_0x28e662){for(var _0x5e8f86=0x0;_0x5e8f86<_0x1e95c3-_0x28e662;_0x5e8f86+=0x1){decremetOriginate(_0x51c8a4);}}}function loggerGetContactDialer(_0x50b722,_0x1e418,_0xdf351a){return function(_0x46f0e2){checkContactLowerLimitOriginate(_0x1e418,_0xdf351a,0x0);logger['error'](_0x50b722,util[_0xf955('0x90')](_0x46f0e2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x29763d){return function(_0x32ce33){if(isNotNull(_0x32ce33)&&isNotNull(_0x32ce33[0x0])){if(_0x32ce33[0x0][_0xf955('0x93')]>0x0){_0x29763d[_0xf955('0x41')]=_0xf955('0x94');logger[_0xf955('0x82')](_0xf955('0x95')+_0x29763d['name'],_0x32ce33[0x0][_0xf955('0x93')],_0xf955('0x96'));}else{_0x29763d['message']=_0xf955('0x97');logger[_0xf955('0x82')](_0xf955('0x98')+_0x29763d[_0xf955('0x42')]);}}};}function notSendMessagesQueue(_0x4e0e3f){if(_0x4e0e3f[_0xf955('0x99')]){freeVariablesPredictive(_0x4e0e3f);if(_0x4e0e3f[_0xf955('0x77')]===0x0&&_0x4e0e3f['talking']===0x0&&_0x4e0e3f['waiting']===0x0&&(_0x4e0e3f[_0xf955('0x55')]||0x0)===0x0){_0x4e0e3f[_0xf955('0x99')]=![];_0x4e0e3f[_0xf955('0x53')]=0x0;_0x4e0e3f[_0xf955('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xf955('0x8f')](_0xf955('0x9a'),_0x4e0e3f[_0xf955('0x42')],_0xf955('0x9b'));}else{_0x4e0e3f[_0xf955('0x41')]=_0xf955('0x9c');loggerSyncQueueSummary[_0xf955('0x8f')](_0xf955('0x9a'),_0x4e0e3f[_0xf955('0x42')],_0xf955('0x9d'));}emitVoiceQueueSummary(_0x4e0e3f);}}function notSendMessagesCampaign(_0x2c7ba5){if(_0x2c7ba5[_0xf955('0x99')]){if(_0x2c7ba5[_0xf955('0x77')]===0x0){_0x2c7ba5['sendMessageOneNotActive']=![];_0x2c7ba5[_0xf955('0x41')]=_0xf955('0x44');loggerSyncQueueSummary[_0xf955('0x8f')](_0xf955('0x9e'),_0x2c7ba5['name'],_0xf955('0x9b'));}else{_0x2c7ba5[_0xf955('0x41')]=_0xf955('0x9c');loggerSyncQueueSummary[_0xf955('0x8f')](_0xf955('0x9e'),_0x2c7ba5[_0xf955('0x42')],_0xf955('0x9d'));}emitCampaignSummary(_0x2c7ba5);}}function createObjHistory(_0x46a692,_0x52a73c,_0xeaa3b7,_0x2893ae,_0x57426b){_0x46a692[_0xf955('0x41')]=_0xeaa3b7;var _0x1c8c8a=new Action(_0x46a692,_0x52a73c);var _0x26ba0b=new History(_0x1c8c8a);_0x26ba0b[_0xf955('0x9f')]=_0x2893ae;_0x26ba0b[_0xf955('0xa0')]=_0x57426b;_0x26ba0b[_0xf955('0xa1')]=_0x1c8c8a[_0xf955('0xa2')];return _0x26ba0b;}Dialer['prototype'][_0xf955('0x3f')]=function(){var _0x503749=this;setInterval(function(){_0x503749[_0xf955('0xa3')](_0x503749['uniqueId'],_0xf955('0xa4'));_0x503749[_0xf955('0xa3')](_0x503749[_0xf955('0x27')],_0xf955('0xa5'));},0x32c8);};Dialer[_0xf955('0x1b')][_0xf955('0xa3')]=function(_0x4d0f28,_0x1e8926){var _0x2b0c75=this;for(var _0xf9ec26 in _0x4d0f28){if(_0x4d0f28['hasOwnProperty'](_0xf9ec26)){this['sequence'][_0xf955('0x1c')](function(){if(!_[_0xf955('0xa6')](_0x4d0f28[_0xf9ec26])){return ami[_0xf955('0xa7')]({'action':'status','channel':_0x4d0f28[_0xf9ec26][_0xf955('0xa8')]})['catch'](function(_0x36c23e){if(_0x36c23e['message']===_0xf955('0xa9')){setTimeout(function(){if(_0x4d0f28[_0xf9ec26]&&_0x4d0f28[_0xf9ec26][_0xf955('0x4f')]!==_0xf955('0x7d')){_0x2b0c75['updateOriginated'](_0x2b0c75[_0xf955('0x21')][_0x4d0f28[_0xf9ec26][_0xf955('0xaa')]]);logger[_0xf955('0x8f')]('[Dialer][checkChannel]',_0x1e8926,_0xf9ec26,_0x4d0f28[_0xf9ec26][_0xf955('0xaa')]);delete _0x4d0f28[_0xf9ec26];}if(_0x4d0f28[_0xf9ec26]&&_0x4d0f28[_0xf9ec26][_0xf955('0x4f')]===_0xf955('0x7d')){_0x2b0c75[_0xf955('0xab')](_0x2b0c75[_0xf955('0x22')][_0x4d0f28[_0xf9ec26][_0xf955('0xaa')]]);logger[_0xf955('0x8f')]('[Dialer][checkChannel][ivr]',_0x1e8926,_0xf9ec26,_0x4d0f28[_0xf9ec26][_0xf955('0xaa')]);delete _0x4d0f28[_0xf9ec26];}},0x2328);}});}});}}};Dialer[_0xf955('0x1b')][_0xf955('0xac')]=function(_0x347078){return BPromise[_0xf955('0xad')]()['then'](cmHopper[_0xf955('0xac')](_0x347078))[_0xf955('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xf955('0xaf')]=function(_0x405bb8){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopperBlack['checkIsBlackList'](_0x405bb8))[_0xf955('0xae')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0xf955('0xb1')]=function(_0x272f30){return BPromise['resolve']()['then'](cmHopperBlack[_0xf955('0xb1')](_0x272f30))[_0xf955('0xae')](loggerCatch(_0xf955('0xb2')));};Dialer['prototype']['averageHandleTime']=function(_0x406366){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopperHistory['avgHandleTime'](_0x406366))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xf955('0xb3')]=function(_0x567604){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopper[_0xf955('0xb3')](_0x567604))[_0xf955('0xae')](loggerCatch(_0xf955('0xb4')));};Dialer['prototype'][_0xf955('0xb5')]=function(_0x1aea40,_0x1d9c48,_0x39b7b4,_0x571fbd){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopper['getContactDialer'](_0x1aea40,_0x1d9c48,_0x39b7b4,_0x571fbd))[_0xf955('0xae')](loggerCatch(_0xf955('0xb6')));};Dialer[_0xf955('0x1b')][_0xf955('0xb7')]=function(_0x835b08,_0x3d83a9,_0x58080b){return BPromise['resolve']()[_0xf955('0xb0')](cmHopper['getContactDialerIvr'](_0x835b08,_0x3d83a9,_0x58080b))[_0xf955('0xae')](loggerCatch(_0xf955('0xb6')));};Dialer[_0xf955('0x1b')][_0xf955('0xb8')]=function(_0x550faf){return BPromise['resolve']()[_0xf955('0xb0')](voiceQueueRt[_0xf955('0xb8')](_0x550faf))[_0xf955('0xae')](loggerCatch(_0xf955('0xb9')));};Dialer[_0xf955('0x1b')]['moveContactManagedDialer']=function(_0x21f45e){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopper[_0xf955('0xba')](_0x21f45e))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xf955('0x1b')][_0xf955('0xbb')]=function(_0x568b39){return BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](cmHopperHistory[_0xf955('0xbb')](_0x568b39))[_0xf955('0xae')](loggerCatch('[createHistory]\x20'));};Dialer[_0xf955('0x1b')][_0xf955('0xab')]=function(_0x34b879){if(!_[_0xf955('0x40')](_0x34b879)&&_0x34b879!==null){if(_0x34b879[_0xf955('0xbc')](_0xf955('0x77'))){if(_0x34b879[_0xf955('0x77')]>0x0){_0x34b879['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf955('0x8f')](_0xf955('0xbd'));}};Dialer[_0xf955('0x1b')][_0xf955('0xbe')]=function(_0x1a672b,_0x35aa70){var _0x17e25c=this;return function(_0x4d4ede){_0x17e25c[_0xf955('0xab')](_0x35aa70);logger[_0xf955('0x8f')](_0x1a672b,util['inspect'](_0x4d4ede,{'showHidden':![],'depth':null}));};};Dialer[_0xf955('0x1b')][_0xf955('0xbf')]=function(_0x101655,_0x906f64,_0x1747ab){var _0x1eb23={'state':0x19,'statedesc':_0xf955('0xc0')};this[_0xf955('0xab')](_0x906f64);this['saveInDb'](_['merge'](_0x1eb23,_['pick'](_0x1747ab,[_0xf955('0xc1'),_0xf955('0xc2'),_0xf955('0xc3'),_0xf955('0xc4'),_0xf955('0xc5')])),'[emptyContact][createHistory]',_0xf955('0xc6'));logger[_0xf955('0x8f')](_0x101655);};Dialer[_0xf955('0x1b')][_0xf955('0xc7')]=function(_0x43e078){return _0x43e078===_0xf955('0xc8');};Dialer[_0xf955('0x1b')][_0xf955('0xc9')]=function(_0x226335){return!_['isUndefined'](_0x226335)&&_0x226335&&!_[_0xf955('0x40')](_0x226335['name'])&&!_[_0xf955('0x40')](_0x226335[_0xf955('0xca')])&&_0x226335[_0xf955('0xca')]&&(this[_0xf955('0x24')][util[_0xf955('0x7a')](_0xf955('0xcb'),_0x226335[_0xf955('0x42')])]['status']===_0xf955('0xcc')||this['trunks'][util[_0xf955('0x7a')](_0xf955('0xcb'),_0x226335['name'])][_0xf955('0xcd')]===_0xf955('0xce'));};Dialer[_0xf955('0x1b')][_0xf955('0xcf')]=function(_0x40920f,_0x541a22,_0xa0e929){this['createHistory'](_0x40920f)[_0xf955('0xae')](loggerCatch(_0x541a22));this[_0xf955('0xba')](_0x40920f)['catch'](loggerCatch(_0xa0e929));};Dialer[_0xf955('0x1b')][_0xf955('0x3b')]=function(_0x4bbba6){var _0x47d89d=this[_0xf955('0x28')][_0x4bbba6[_0xf955('0xd0')]];var _0x8b45aa;if(!_['isNil'](_0x4bbba6)&&!_[_0xf955('0xa6')](_0x4bbba6[_0xf955('0xd1')])&&!_[_0xf955('0xa6')](_0x4bbba6[_0xf955('0xd1')][_0xf955('0xd2')])&&_0x4bbba6[_0xf955('0xd3')]===_0xf955('0xd4')&&_0x47d89d){if(_0x47d89d[_0xf955('0x4f')]!==_0xf955('0x7d')&&this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]][_0xf955('0xd5')]&&_0x4bbba6[_0xf955('0xd6')]===_0xf955('0xd7')){delete this['uniqueId'][_0x4bbba6['uniqueid']];this[_0xf955('0xab')](this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]]);this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]]['outboundAnswerCallsDay']+=0x1;this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]]['outboundAnswerAgiCallsDay']+=0x1;_0x8b45aa=new Hangup(_0x47d89d,_0x4bbba6);_0x8b45aa[_0xf955('0x9f')]=0x12;_0x8b45aa[_0xf955('0xa0')]=_0xf955('0xd8');_0x8b45aa[_0xf955('0xd9')]='AMD';this[_0xf955('0xcf')](_0x8b45aa,'[syncHangupInAMD][createHistory]',_0xf955('0xda'));}if(_0x47d89d[_0xf955('0x4f')]!==_0xf955('0x7d')&&this[_0xf955('0x21')][_0x47d89d['queue']][_0xf955('0xd5')]&&_0x4bbba6[_0xf955('0xd6')]===_0xf955('0xdb')){delete this[_0xf955('0x28')][_0x4bbba6[_0xf955('0xd0')]];this['updateOriginated'](this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]]);this[_0xf955('0x21')][_0x47d89d['queue']][_0xf955('0x65')]+=0x1;this[_0xf955('0x21')][_0x47d89d[_0xf955('0xaa')]][_0xf955('0x64')]+=0x1;_0x8b45aa=new Hangup(_0x47d89d,_0x4bbba6);_0x8b45aa[_0xf955('0x9f')]=0x13;_0x8b45aa[_0xf955('0xa0')]=_0xf955('0xdc');_0x8b45aa['membername']='AMD';_0x8b45aa['amd']=!![];this[_0xf955('0xcf')](_0x8b45aa,_0xf955('0xdd'),'[syncMachine]');}if(_0x47d89d[_0xf955('0x4f')]===_0xf955('0x7d')&&this[_0xf955('0x22')][_0x47d89d['queue']][_0xf955('0xd5')]&&_0x4bbba6[_0xf955('0xd6')]==='HANGUP'){delete this['uniqueId'][_0x4bbba6[_0xf955('0xd0')]];this[_0xf955('0xab')](this[_0xf955('0x22')][_0x47d89d[_0xf955('0xaa')]]);_0x8b45aa=new Hangup(_0x47d89d,_0x4bbba6);_0x8b45aa[_0xf955('0x9f')]=0x12;_0x8b45aa['statedesc']=_0xf955('0xd8');_0x8b45aa[_0xf955('0xd9')]=_0xf955('0xde');this[_0xf955('0xcf')](_0x8b45aa,_0xf955('0xdf'),'[syncHangupInAMDIvr]');}if(_0x47d89d[_0xf955('0x4f')]===_0xf955('0x7d')&&this[_0xf955('0x22')][_0x47d89d[_0xf955('0xaa')]]['dialAMDActive']&&_0x4bbba6[_0xf955('0xd6')]===_0xf955('0xdb')){delete this[_0xf955('0x28')][_0x4bbba6[_0xf955('0xd0')]];this[_0xf955('0xab')](this['campaigns'][_0x47d89d[_0xf955('0xaa')]]);_0x8b45aa=new Hangup(_0x47d89d,_0x4bbba6);_0x8b45aa[_0xf955('0x9f')]=0x13;_0x8b45aa['statedesc']=_0xf955('0xdc');_0x8b45aa[_0xf955('0xd9')]=_0xf955('0xde');_0x8b45aa[_0xf955('0xe0')]=!![];this[_0xf955('0xcf')](_0x8b45aa,_0xf955('0xe1'),_0xf955('0xe2'));}}};Dialer[_0xf955('0x1b')][_0xf955('0x37')]=function(_0x176712){var _0x478d05=this['uniqueId'][_0x176712[_0xf955('0xd0')]];var _0x161a62=this;var _0x28ce41;if(_0x478d05&&_0x478d05[_0xf955('0x4f')]==='ivr'){delete this[_0xf955('0x28')][_0x176712[_0xf955('0xd0')]];this['updateOriginated'](this['campaigns'][_0x478d05[_0xf955('0xaa')]]);this[_0xf955('0x22')][_0x478d05[_0xf955('0xaa')]][_0xf955('0xe3')]+=0x1;_0x28ce41=new Hangup(_0x478d05,_0x176712);this['createHistory'](_0x28ce41)[_0xf955('0xae')](loggerCatch(_0xf955('0xe4')));this[_0xf955('0xba')](_0x28ce41)[_0xf955('0xae')](loggerCatch(_0xf955('0xe5')));}if(_0x478d05&&_0x478d05[_0xf955('0x4f')]!==_0xf955('0x7d')&&isNotNull(this[_0xf955('0x21')][_0x478d05['queue']][_0xf955('0xe6')])){delete this[_0xf955('0x28')][_0x176712[_0xf955('0xd0')]];this[_0xf955('0xab')](this[_0xf955('0x21')][_0x478d05[_0xf955('0xaa')]]);this[_0xf955('0x21')][_0x478d05[_0xf955('0xaa')]][_0xf955('0x65')]+=0x1;this[_0xf955('0x21')][_0x478d05['queue']][_0xf955('0x64')]+=0x1;_0x28ce41=new Hangup(_0x478d05,_0x176712);_0x28ce41[_0xf955('0x9f')]=0x10;_0x28ce41[_0xf955('0xa0')]=_0xf955('0xe7');_0x28ce41[_0xf955('0xd9')]=_0xf955('0xe8');this[_0xf955('0xbb')](_0x28ce41)['catch'](loggerCatch(_0xf955('0xe4')));this['moveContactManagedDialer'](_0x28ce41)[_0xf955('0xae')](loggerCatch(_0xf955('0xe5')));}if(_0x478d05&&_0x478d05[_0xf955('0x4f')]!==_0xf955('0x7d')&&!isNotNull(this[_0xf955('0x21')][_0x478d05[_0xf955('0xaa')]][_0xf955('0xe6')])){delete this[_0xf955('0x28')][_0x176712[_0xf955('0xd0')]];this['updateOriginated'](this[_0xf955('0x21')][_0x478d05[_0xf955('0xaa')]]);this[_0xf955('0x21')][_0x478d05[_0xf955('0xaa')]][_0xf955('0xe9')]+=0x1;_0x28ce41=new Hangup(_0x478d05,_0x176712);_0x28ce41[_0xf955('0x9f')]=0xc;_0x28ce41['statedesc']=_0x176712[_0xf955('0xea')];_0x28ce41[_0xf955('0xd9')]=_0xf955('0xeb');this['createHistory'](_0x28ce41)[_0xf955('0xae')](loggerCatch(_0xf955('0xe4')));this[_0xf955('0xba')](_0x28ce41)[_0xf955('0xae')](loggerCatch(_0xf955('0xe5')));}};Dialer[_0xf955('0x1b')]['syncAgentComplete']=function(_0x13c0ce){var _0x4775bd=this[_0xf955('0x28')][_0x13c0ce[_0xf955('0xd0')]];var _0x438f9c=this;if(this[_0xf955('0x21')][_0x13c0ce['queue']]){if(_0x4775bd&&_0x4775bd[_0xf955('0x4f')]!=='ivr'){delete this['uniqueId'][_0x13c0ce['uniqueid']];this['voiceQueues'][_0x13c0ce[_0xf955('0xaa')]]['outboundAnswerCallsDay']+=0x1;var _0x54102e=new AgentComplete(_0x4775bd,_0x13c0ce);if(_0x13c0ce[_0xf955('0xec')]==='agent'){_0x54102e[_0xf955('0xed')]=this['voiceQueues'][_0x13c0ce[_0xf955('0xaa')]]['dialQueueProject2']&&this[_0xf955('0x21')][_0x13c0ce[_0xf955('0xaa')]][_0xf955('0xee')]?moment()[_0xf955('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xf955('0xbb')](_0x54102e)['catch'](loggerCatch(_0xf955('0xef')));this[_0xf955('0xba')](_0x54102e)[_0xf955('0xae')](loggerCatch(_0xf955('0xf0')));}}};Dialer[_0xf955('0x1b')][_0xf955('0x2e')]=function(_0x1cc042){if(this[_0xf955('0x21')][_0x1cc042[_0xf955('0xaa')]]){if(this[_0xf955('0x28')][_0x1cc042['uniqueid']]&&this[_0xf955('0x28')][_0x1cc042[_0xf955('0xd0')]][_0xf955('0x4f')]!==_0xf955('0x7d')){this[_0xf955('0xab')](this[_0xf955('0x21')][_0x1cc042[_0xf955('0xaa')]]);this['uniqueId'][_0x1cc042[_0xf955('0xd0')]][_0xf955('0xf1')]=moment()[_0xf955('0x7a')](_0xf955('0xf2'));}}};Dialer[_0xf955('0x1b')][_0xf955('0xf3')]=function(_0x392191){this[_0xf955('0xbb')](_0x392191)[_0xf955('0xae')](loggerCatch(_0xf955('0xef')));this['moveContactManagedDialer'](_0x392191)[_0xf955('0xae')](loggerCatch(_0xf955('0xf4')));};Dialer[_0xf955('0x1b')][_0xf955('0xf5')]=function(_0x1342c6){var _0x14e019=this[_0xf955('0x28')][_0x1342c6[_0xf955('0xd0')]];var _0x5d1f3d=this;if(this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]]){if(_0x14e019&&_0x14e019[_0xf955('0x4f')]!==_0xf955('0x7d')){delete this[_0xf955('0x28')][_0x1342c6[_0xf955('0xd0')]];this[_0xf955('0xab')](this[_0xf955('0x21')][_0x1342c6['queue']]);_0x14e019['droptime']=moment()[_0xf955('0x7a')](_0xf955('0xf2'));var _0xeae468=new QueueCallerAbandon(_0x14e019,_0x1342c6);if(getSeconds(_0x14e019[_0xf955('0xf6')],_0x14e019['responsetime'])>=_0x14e019['dialQueueTimeout']){this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]][_0xf955('0xf7')]+=0x1;this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xeae468[_0xf955('0x9f')]=0xa;_0xeae468[_0xf955('0xa0')]=_0xf955('0xf8');_0xeae468[_0xf955('0xf9')]=_0xf955('0xfa');_0xeae468['agiafterat']=this[_0xf955('0x21')][_0x1342c6['queue']][_0xf955('0xfb')]?moment()['format'](_0xf955('0xf2')):undefined;this[_0xf955('0xf3')](_0xeae468);}else{this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]][_0xf955('0x71')]+=0x1;this[_0xf955('0x21')][_0x1342c6[_0xf955('0xaa')]][_0xf955('0x6a')]+=0x1;_0xeae468[_0xf955('0x9f')]=0xb;_0xeae468[_0xf955('0xa0')]='Abandoned';_0xeae468['dropreason']=_0xf955('0xfc');this[_0xf955('0xf3')](_0xeae468);}}}};Dialer[_0xf955('0x1b')][_0xf955('0x39')]=function(_0x5e6e24){if(this['actions'][_0x5e6e24[_0xf955('0xd0')]]){this['actions'][_0x5e6e24['uniqueid']][_0xf955('0xa8')]=_0x5e6e24['channel'];}if(this[_0xf955('0x28')][_0x5e6e24[_0xf955('0xd0')]]){this['uniqueId'][_0x5e6e24['uniqueid']][_0xf955('0xa8')]=_0x5e6e24[_0xf955('0xa8')];}};Dialer[_0xf955('0x1b')][_0xf955('0x3d')]=function(_0x30e0a1){if(strategy[this['voiceQueues'][this[_0xf955('0x27')][_0x30e0a1['actionid']]['queue']]['strategy']]===_0xf955('0x1a')){if(this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]]&&_['isNil'](this['actions'][_0x30e0a1[_0xf955('0xfd')]]['locked'])&&_0x30e0a1[_0xf955('0xcd')]==='1'&&_0x30e0a1['paused']==='0'){if(this[_0xf955('0x23')][_0x30e0a1[_0xf955('0xfe')]]){if(!this['agents'][_0x30e0a1[_0xf955('0xfe')]]['locked']){this[_0xf955('0x23')][_0x30e0a1[_0xf955('0xfe')]][_0xf955('0xff')]=!![];this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]]['locked']=!![];this['actions'][_0x30e0a1[_0xf955('0xfd')]][_0xf955('0xfe')]=_0x30e0a1[_0xf955('0xfe')];}}}}else if((strategy[this[_0xf955('0x21')][this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]][_0xf955('0xaa')]][_0xf955('0x51')]]||_0xf955('0x19'))==='rrmemory'){if(this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]]){if(this[_0xf955('0x23')][_0x30e0a1[_0xf955('0xfe')]]){this[_0xf955('0x27')][_0x30e0a1['actionid']][_0xf955('0xfe')]=_0x30e0a1[_0xf955('0xfe')];if(_['isNil'](this[_0xf955('0x100')][this['actions'][_0x30e0a1['actionid']][_0xf955('0xaa')]])){this[_0xf955('0x100')][this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]]['queue']]=[];}this[_0xf955('0x100')][this[_0xf955('0x27')][_0x30e0a1[_0xf955('0xfd')]][_0xf955('0xaa')]]['push'](_[_0xf955('0x87')](_[_0xf955('0x101')](this['actions'][_0x30e0a1[_0xf955('0xfd')]],[_0xf955('0x102'),_0xf955('0xfe')]),{'status':_0x30e0a1['status'],'paused':_0x30e0a1[_0xf955('0x103')]}));}}}};function unlockQueueStatus(_0x181fb2,_0x346e87){setTimeout(function(){if(_['isUndefined'](_0x181fb2[_0xf955('0x104')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x346e87);}_0x181fb2['queueStatusComplete']=!![];loggerBooked[_0xf955('0x82')](_0xf955('0x105'),_0x346e87,JSON[_0xf955('0x4a')](_[_0xf955('0x101')](_0x181fb2,[_0xf955('0x42'),_0xf955('0x104')])));},0x1f3);}Dialer['prototype'][_0xf955('0x3e')]=function(_0x67ef9a){var _0x363b64=this;var _0x37a8e2=_0x363b64[_0xf955('0x21')][_0x363b64[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]];if(strategy[this[_0xf955('0x21')][this[_0xf955('0x27')][_0x67ef9a['actionid']][_0xf955('0xaa')]][_0xf955('0x51')]]===_0xf955('0x1a')){if(this['actions'][_0x67ef9a['actionid']]&&this[_0xf955('0x27')][_0x67ef9a['actionid']][_0xf955('0xfe')]){this[_0xf955('0x20')][_0xf955('0x106')](this[_0xf955('0x27')][_0x67ef9a['actionid']][_0xf955('0x102')],this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]]['stateinterface'])[_0xf955('0xae')](function(_0x55c0ba){logger[_0xf955('0x8f')](_0xf955('0x107'),util[_0xf955('0x90')](_0x55c0ba,{'showHidden':![],'depth':null}));})[_0xf955('0x1e')](function(){_0x363b64['updateOriginated'](_0x363b64[_0xf955('0x21')][_0x363b64[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]]['queue']]);_0x363b64[_0xf955('0x23')][_0x363b64['actions'][_0x67ef9a[_0xf955('0xfd')]]['stateinterface']][_0xf955('0xff')]=![];delete _0x363b64['actions'][_0x67ef9a[_0xf955('0xfd')]];unlockQueueStatus(_0x37a8e2);});}else{this['updateOriginated'](this['voiceQueues'][this['actions'][_0x67ef9a[_0xf955('0xfd')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xc1')],'ListId':this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xc2')],'VoiceQueueId':this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xc5')]||undefined})[_0xf955('0xae')](loggerCatch(_0xf955('0x108')));delete this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]];unlockQueueStatus(_0x37a8e2);}}else if((strategy[this[_0xf955('0x21')][this[_0xf955('0x27')][_0x67ef9a['actionid']][_0xf955('0xaa')]][_0xf955('0x51')]]||_0xf955('0x19'))===_0xf955('0x19')){var _0x914d41;if(this[_0xf955('0x27')][_0x67ef9a['actionid']]&&!_[_0xf955('0x8c')](this[_0xf955('0x100')][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]])){if(this['queueBookedRR'][_0x363b64[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]]['queue']]){this['queueBookedRR'][_0x363b64['actions'][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]]=this[_0xf955('0x2c')][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]]?this[_0xf955('0x2c')][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]]:this['queueBooked'][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]]?this[_0xf955('0x100')][this[_0xf955('0x27')][_0x67ef9a['actionid']][_0xf955('0xaa')]][_0xf955('0x109')]||0x0:0x0;}this['queueBooked'][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]]['_rr']=this[_0xf955('0x2c')][this[_0xf955('0x27')][_0x67ef9a[_0xf955('0xfd')]][_0xf955('0xaa')]];for(var _0x1a7da8=0x0;_0x1a7da8=0x0?!![]:![];})[_0xf955('0xae')](myreject(_0x556463)));}}else{_0x3468e5[_0xf955('0x11f')](ami['Action']({'action':_0xf955('0x120'),'command':util[_0xf955('0x7a')]('iftime\x20%s,%s',_0x2c0ad2,!_[_0xf955('0x40')](config[_0xf955('0x11b')][_0x3254dc])?_0x3254dc:'')})[_0xf955('0xb0')](function(_0x2e7128){return _0x2e7128[_0xf955('0x123')][_0xf955('0x124')](_0xf955('0x125'))>=0x0?!![]:![];})['catch'](myreject(_0x556463)));}BPromise[_0xf955('0x126')](_0x3468e5)[_0xf955('0xb0')](function(_0x23b9fb){var _0xbbd8d0=_[_0xf955('0x127')](_0x23b9fb);if(_0xbbd8d0){return _0x132163(_0xbbd8d0);}else{_0x193fb4[_0xf955('0x41')]=_0x94b3bf?_0xf955('0x128'):'INTERVAL_IS_OVERTIME';return _0x556463(msgResponse(_0xf955('0x129'),_0xf955('0x11a'),_0xf955('0x12a')+_0x94b3bf+'\x20'+_0x172c70+_0xf955('0x12b')+util[_0xf955('0x90')](_0x2c0ad2,{'showHidden':![],'depth':null})+_0xf955('0x12c')+_0x3254dc));}})['catch'](function(_0x16661a){return _0x556463(msgResponse(_0xf955('0x116'),_0xf955('0x11a'),JSON[_0xf955('0x4a')](_0x16661a)));});});};Dialer['prototype']['checkDialMethod']=function(_0x25fb80){var _0x974c11=this;return function(){switch(_0x25fb80[_0xf955('0x5f')]){case'progressive':freeVariablesPredictive(_0x25fb80);_0x974c11[_0xf955('0x12d')](_0x25fb80,0x1);break;case'power':freeVariablesPredictive(_0x25fb80);_0x974c11[_0xf955('0x12d')](_0x25fb80,_0x25fb80['dialPowerLevel']);break;case'predictive':_0x974c11['predictive'](_0x25fb80);break;case _0xf955('0x7'):freeVariablesPredictive(_0x25fb80);_0x974c11[_0xf955('0x12d')](_0x25fb80,0x1);break;default:freeVariablesPredictive(_0x25fb80);logger[_0xf955('0x8f')](_0xf955('0x12e'),_0x25fb80[_0xf955('0x42')],_0xf955('0x12f'));}};};Dialer['prototype'][_0xf955('0x130')]=function(_0xdddd95){var _0xfcf598=this;return function(){_0xfcf598[_0xf955('0x131')](_0xdddd95);};};Dialer[_0xf955('0x1b')][_0xf955('0x35')]=function(_0x1c2557){var _0x5498ff=this;if(isNotPreview(_0x1c2557[_0xf955('0x5f')])){if(isVoiceQueueOutbound(_0x1c2557[_0xf955('0x4f')])&&isActive(_0x1c2557['dialActive'])){_0x1c2557[_0xf955('0x99')]=!![];BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](checkIsLoggedIn(_0x1c2557,_0x1c2557[_0xf955('0x54')]))[_0xf955('0xb0')](checkIsActive(_0x1c2557,_0x1c2557['dialActive']))[_0xf955('0xb0')](checkInterval(_0x1c2557))[_0xf955('0xb0')](_0x5498ff[_0xf955('0x132')](_0x1c2557))[_0xf955('0xb0')](_0x5498ff[_0xf955('0x115')](_0x1c2557[_0xf955('0x133')],_0x1c2557[_0xf955('0x134')],_0x1c2557[_0xf955('0x42')],_0x1c2557))[_0xf955('0xb0')](_0x5498ff[_0xf955('0x117')](_0x1c2557[_0xf955('0x45')],_0x1c2557[_0xf955('0x134')],_0x1c2557[_0xf955('0x42')],_0x1c2557))[_0xf955('0xb0')](_0x5498ff['checkDialMethod'](_0x1c2557))[_0xf955('0xae')](loggerCatchQueueSummary(_0xf955('0x135'),_0x1c2557));}else{notSendMessagesQueue(_0x1c2557);}}else{freeVariablesPredictive(_0x1c2557);}};Dialer[_0xf955('0x1b')][_0xf955('0x112')]=function(){var _0x98de30=this;var _0x41ff13;for(var _0x27bb38 in this[_0xf955('0x22')]){if(this[_0xf955('0x22')][_0xf955('0xbc')](_0x27bb38)){_0x41ff13=this[_0xf955('0x22')][_0x27bb38];if(isCampaignIvr(_0x41ff13['type'])&&isActive(_0x41ff13[_0xf955('0xca')])){_0x41ff13['sendMessageOneNotActive']=!![];BPromise[_0xf955('0xad')]()[_0xf955('0xb0')](checkIsActive(_0x41ff13,_0x41ff13[_0xf955('0xca')]))[_0xf955('0xb0')](checkInterval(_0x41ff13))[_0xf955('0xb0')](_0x98de30[_0xf955('0x132')](_0x41ff13))['then'](_0x98de30[_0xf955('0x115')](_0x41ff13['dialGlobalInterval'],_0x41ff13[_0xf955('0x134')],_0x41ff13['name'],_0x41ff13))[_0xf955('0xb0')](_0x98de30['checkIfTimeIntervals'](_0x41ff13['Interval'],_0x41ff13[_0xf955('0x134')],_0x41ff13[_0xf955('0x42')],_0x41ff13))[_0xf955('0xb0')](_0x98de30['launchHandleIvr'](_0x41ff13))[_0xf955('0xae')](loggerCatchQueueSummary(_0xf955('0x136'),_0x41ff13));}else{notSendMessagesCampaign(_0x41ff13);}}}};function getCallerIdRandom(_0x5c4cfc,_0x12ad4d){var _0x14339c,_0x1a9209,_0x4d55fa;if(_0x12ad4d<=0x0){_0x12ad4d=0x1;}_0x14339c=new RegExp(_0xf955('0x137')+_0x12ad4d+'}$');_0x1a9209=Math[_0xf955('0x138')](0xa,_0x12ad4d-0x1);_0x4d55fa=Math[_0xf955('0x138')](0xa,_0x12ad4d)-0x1;return util[_0xf955('0x7a')]('%s',_[_0xf955('0x139')](_0x5c4cfc,_0x14339c,_[_0xf955('0x13a')](_0x1a9209,_0x4d55fa)));}function extractCalleridName(_0x3a42ea){var _0x5095fc=_0x3a42ea[_0xf955('0x13b')](/"(.*?)"/);return _0x5095fc?_0x5095fc[0x1]:_0x3a42ea;}function extractCalleridNumber(_0x475008){var _0x586245=_0x475008[_0xf955('0x13b')](/<(.*?)>/);return _0x586245?_0x586245[0x1]:_0x475008;}Dialer['prototype'][_0xf955('0x13c')]=function(_0x5c8e2e,_0x3f43f4){var _0x5b9bd7=this;var _0xcdc0fb=uuid['v4']();this[_0xf955('0x27')][_0xcdc0fb]=new Action(_0x5c8e2e,_0x3f43f4,_0xcdc0fb);return new BPromise(function(_0x22291f,_0x18abd2){if(_[_0xf955('0x40')](_0x5c8e2e)&&_0xf955('0x13d')!==typeof _0x5c8e2e){return _0x18abd2(msgResponse(_0xf955('0x13e'),_0xf955('0x11a'),'voiceQueue\x20is\x20undefine'));}if(_[_0xf955('0x40')](_0x3f43f4[_0xf955('0x13f')][_0xf955('0x140')])||_0x3f43f4[_0xf955('0x13f')][_0xf955('0x140')]===null){return _0x18abd2(msgResponse(_0xf955('0x13e'),_0xf955('0x11a'),'contact\x20is\x20undefine'));}var _0x42d099={'XMD-CALLERID':_0x5b9bd7[_0xf955('0x27')][_0xcdc0fb][_0xf955('0x141')](),'XMD-AGI':_0x5c8e2e[_0xf955('0xe6')]?util[_0xf955('0x7a')](_0xf955('0x142'),ipAgi,_0x5c8e2e[_0xf955('0xe6')]):'NONE','XMD-AGIAFTER':_0x5c8e2e[_0xf955('0xfb')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5c8e2e[_0xf955('0xfb')]):_0xf955('0x143'),'XMD-QUEUE':_0x5c8e2e[_0xf955('0x4f')]===_0xf955('0x50')?util[_0xf955('0x7a')](_0xf955('0x144'),_0x5c8e2e['name'],_0x5c8e2e['dialQueueOptions']||'',_0x5c8e2e[_0xf955('0xee')]?'c':'',_0x5c8e2e[_0xf955('0x145')]||0x3):_0xf955('0x143'),'XMD-CONTACTID':_0x3f43f4['ContactId'],'XMD-CDRTYPE':_0xf955('0x6'),'CALLERID(all)':_0x5b9bd7[_0xf955('0x27')][_0xcdc0fb][_0xf955('0x141')](),'XMD-AMD':_0x5c8e2e[_0xf955('0xd5')]?_0xf955('0x146'):_0xf955('0x143'),'XMD-DESTINATION':_0xf955('0xd4')};if(_0x5c8e2e['dialAMDActive']){_0x42d099[_0xf955('0x147')]=_0x5c8e2e[_0xf955('0x148')]||0x9c4;_0x42d099['XMD-AMDGREETING']=_0x5c8e2e['dialAMDGreeting']||0x5dc;_0x42d099[_0xf955('0x149')]=_0x5c8e2e[_0xf955('0x14a')]||0x320;_0x42d099[_0xf955('0x14b')]=_0x5c8e2e[_0xf955('0x14c')]||0x1388;_0x42d099[_0xf955('0x14d')]=_0x5c8e2e['dialAMDMinWordLength']||0x64;_0x42d099[_0xf955('0x14e')]=_0x5c8e2e[_0xf955('0x14f')]||0x32;_0x42d099[_0xf955('0x150')]=_0x5c8e2e[_0xf955('0x151')]||0x3;_0x42d099[_0xf955('0x152')]=_0x5c8e2e['dialAMDSilenceThreshold']||0x100;_0x42d099[_0xf955('0x153')]=_0x5c8e2e[_0xf955('0x154')]||0x1388;}if(_0x5c8e2e[_0xf955('0x4f')]==='outbound'){_0x42d099[_0xf955('0x155')]=_0x3f43f4[_0xf955('0xc4')];}else{_0x42d099[_0xf955('0x156')]=_0x3f43f4[_0xf955('0xc5')];}for(var _0x3a8a7a in _0x3f43f4['Contact']){if(_0x3f43f4[_0xf955('0x13f')][_0xf955('0xbc')](_0x3a8a7a)){if(isNotNull(_0x3f43f4[_0xf955('0x13f')][_0x3a8a7a])&&_0x3a8a7a!=='id'&&_0x3a8a7a!==_0xf955('0x157')&&_0x3a8a7a!=='createdAt'&&_0x3a8a7a!=='updatedAt'){_0x42d099[util[_0xf955('0x7a')](_0xf955('0x158'),'XMD-',_[_0xf955('0x159')](_0x3a8a7a))]=_0x3f43f4[_0xf955('0x13f')][_0x3a8a7a];}}}var _0x1ecab4=_0x5b9bd7[_0xf955('0xc9')](_0x5c8e2e[_0xf955('0x78')])?getCallerId(_0x5c8e2e[_0xf955('0x78')]['callerid'],_0x5c8e2e[_0xf955('0x60')],_0x5c8e2e[_0xf955('0x15a')]>0x0?getCallerIdRandom(_0x5c8e2e['dialOriginateCallerIdNumber'],_0x5c8e2e[_0xf955('0x15a')]):_0x5c8e2e[_0xf955('0x61')]):getCallerId(_[_0xf955('0xa6')](_0x5c8e2e[_0xf955('0x113')])?_0x5c8e2e[_0xf955('0x78')][_0xf955('0x15b')]:_0x5c8e2e[_0xf955('0x113')]['callerid'],_0x5c8e2e[_0xf955('0x60')],_0x5c8e2e[_0xf955('0x15a')]>0x0?getCallerIdRandom(_0x5c8e2e[_0xf955('0x61')],_0x5c8e2e[_0xf955('0x15a')]):_0x5c8e2e[_0xf955('0x61')]);if(_0x1ecab4){_0x42d099[_0xf955('0x15c')]=_0x5b9bd7[_0xf955('0x27')][_0xcdc0fb][_0xf955('0x15d')]=extractCalleridName(_0x1ecab4);_0x42d099[_0xf955('0x15e')]=_0x5b9bd7['actions'][_0xcdc0fb][_0xf955('0x15f')]=extractCalleridNumber(_0x1ecab4);}return ami[_0xf955('0xa7')]({'actionid':_0xcdc0fb,'action':'originate','channel':_0x5b9bd7[_0xf955('0xc9')](_0x5c8e2e['Trunk'])?util[_0xf955('0x7a')](_0xf955('0x160'),_0x5c8e2e[_0xf955('0x78')]['name'],isNotNull(_0x5c8e2e['dialPrefix'])?_0x5c8e2e[_0xf955('0x63')][_0xf955('0x161')]()||'':'',_0x5c8e2e[_0xf955('0x162')]>0x0?_0x3f43f4['Contact']['phone'][_0xf955('0x163')](_0x5c8e2e[_0xf955('0x162')]):_0x3f43f4['Contact'][_0xf955('0x140')]):util['format'](_0xf955('0x160'),_['isNil'](_0x5c8e2e[_0xf955('0x113')])?_0x5c8e2e['Trunk'][_0xf955('0x42')]:_0x5c8e2e[_0xf955('0x113')][_0xf955('0x42')],isNotNull(_0x5c8e2e[_0xf955('0x63')])?_0x5c8e2e[_0xf955('0x63')][_0xf955('0x161')]()||'':'',_0x5c8e2e[_0xf955('0x162')]>0x0?_0x3f43f4['Contact']['phone'][_0xf955('0x163')](_0x5c8e2e[_0xf955('0x162')]):_0x3f43f4[_0xf955('0x13f')][_0xf955('0x140')]),'callerid':_0x1ecab4,'Exten':_0xf955('0xd4'),'Context':_0xf955('0x164'),'Priority':'1','variable':_0x42d099,'timeout':(_0x5c8e2e[_0xf955('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcdc0fb})['then'](function(_0x35d810){return _0x22291f(_0x35d810);})[_0xf955('0xae')](function(_0x53f9d3){_0x5c8e2e[_0xf955('0x6d')]+=0x1;var _0x2286de=new History(_0x5b9bd7[_0xf955('0x27')][_0xcdc0fb]);logger[_0xf955('0x8f')](util[_0xf955('0x7a')](_0xf955('0x165'),JSON[_0xf955('0x4a')](_0x53f9d3)));_0x2286de[_0xf955('0x9f')]=0xe;_0x2286de['statedesc']=_0xf955('0x166');_0x2286de[_0xf955('0xa2')]=moment()[_0xf955('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2286de[_0xf955('0xa1')]=_0x2286de[_0xf955('0xa2')];_0x5b9bd7[_0xf955('0xbb')](_0x2286de)['catch'](loggerCatch('[originate][error]'));_0x5b9bd7[_0xf955('0xba')](_0x2286de)[_0xf955('0xae')](loggerCatch(_0xf955('0x167')))[_0xf955('0x1e')](function(){delete _0x5b9bd7[_0xf955('0x27')][_0xcdc0fb];return _0x18abd2(msgResponse(_0xf955('0x13e'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xf955('0x1b')][_0xf955('0x32')]=function(_0x4b20c7){var _0x26b810=this[_0xf955('0x27')][_0x4b20c7[_0xf955('0xfd')]];var _0x58bbaa=this;if(_0x26b810){delete this['actions'][_0x4b20c7[_0xf955('0xfd')]];_0x26b810[_0xf955('0x168')]=moment()[_0xf955('0x7a')](_0xf955('0xf2'));var _0x21f987=_0x26b810[_0xf955('0x4f')]===_0xf955('0x7d')?this[_0xf955('0x22')][_0x26b810[_0xf955('0xaa')]]:this[_0xf955('0x21')][_0x26b810['getQueue']()];if(!this[_0xf955('0xc7')](_0x4b20c7[_0xf955('0x169')])){this[_0xf955('0xab')](_0x21f987);return this['callProgressDetecting'](_0x26b810,_0x21f987,_0x4b20c7)['then'](function(_0x6b917d){})[_0xf955('0xae')](loggerCatch(_0xf955('0x16a')));}else{this[_0xf955('0x28')][_0x4b20c7[_0xf955('0xd0')]]=_0x26b810;}}};Dialer[_0xf955('0x1b')]['checkRetriveMax']=function(_0x26b1c5,_0x43b7ce,_0x314082){var _0x3cb953=new History(_0x43b7ce);if(_0x3cb953[_0xf955('0x16b')]+_0x3cb953['countcongestionretry']+_0x3cb953['countnoanswerretry']>=_0x314082[_0xf955('0x16c')]-0x1){return!![];}switch(_0x26b1c5){case 0x3:if(_0x3cb953['countnoanswerretry']>=_0x314082[_0xf955('0x16d')]-0x1){return!![];}else{this[_0xf955('0xb3')]({'active':![],'countnoanswerretry':_0x3cb953[_0xf955('0x16e')]+=0x1,'scheduledat':moment()[_0xf955('0x16f')](_0x314082[_0xf955('0x170')],_0xf955('0x171'))['format'](_0xf955('0xf2')),'ContactId':_0x3cb953['ContactId'],'ListId':_0x3cb953['ListId'],'VoiceQueueId':_0x3cb953[_0xf955('0xc4')]||undefined,'CampaignId':_0x3cb953[_0xf955('0xc5')]||undefined})[_0xf955('0xae')](loggerCatch(_0xf955('0x172')));}break;case 0x5:if(_0x3cb953[_0xf955('0x16b')]>=_0x314082[_0xf955('0x173')]-0x1){return!![];}else{this[_0xf955('0xb3')]({'active':![],'countbusyretry':_0x3cb953[_0xf955('0x16b')]+=0x1,'scheduledat':moment()[_0xf955('0x16f')](_0x314082[_0xf955('0x174')],'minutes')[_0xf955('0x7a')](_0xf955('0xf2')),'ContactId':_0x3cb953[_0xf955('0xc1')],'ListId':_0x3cb953[_0xf955('0xc2')],'VoiceQueueId':_0x3cb953[_0xf955('0xc4')]||undefined,'CampaignId':_0x3cb953[_0xf955('0xc5')]||undefined})['catch'](loggerCatch(_0xf955('0x175')));}break;case 0x8:if(_0x3cb953[_0xf955('0x176')]>=_0x314082[_0xf955('0x177')]-0x1){return!![];}else{this[_0xf955('0xb3')]({'active':![],'countcongestionretry':_0x3cb953[_0xf955('0x176')]+=0x1,'scheduledat':moment()['add'](_0x314082[_0xf955('0x178')],_0xf955('0x171'))[_0xf955('0x7a')](_0xf955('0xf2')),'ContactId':_0x3cb953[_0xf955('0xc1')],'ListId':_0x3cb953[_0xf955('0xc2')],'VoiceQueueId':_0x3cb953[_0xf955('0xc4')]||undefined,'CampaignId':_0x3cb953['CampaignId']||undefined})[_0xf955('0xae')](loggerCatch(_0xf955('0x179')));}break;default:return!![];}};Dialer['prototype'][_0xf955('0x17a')]=function(_0x56bdc6,_0x215776,_0x190fed){var _0x284a2b=this;var _0xc3e36b=new History(_0x56bdc6);return new BPromise(function(_0x2bca9a,_0x513221){if(_[_0xf955('0x40')](_0x215776)&&_0xf955('0x13d')!==typeof _0x215776){return _0x513221(msgResponse(_0xf955('0x17b'),_0xf955('0x11a'),_0xf955('0x17c')));}if(_[_0xf955('0x40')](_0x190fed)&&'object'!==typeof _0x190fed){return _0x513221(msgResponse('[callProgressDetecting]',_0xf955('0x11a'),_0xf955('0x17d')));}switch(_0x190fed[_0xf955('0xec')]){case'0':_0x215776[_0xf955('0x6c')]+=0x1;_0xc3e36b[_0xf955('0x9f')]=0x0;_0xc3e36b[_0xf955('0xa0')]=_0xf955('0x17e');_0x284a2b[_0xf955('0xbb')](_0xc3e36b)[_0xf955('0xae')](loggerCatch(_0xf955('0x17f')));if(_0x284a2b[_0xf955('0x180')](0x0,_0x56bdc6,_0x215776)){if(_0xc3e36b[_0xf955('0x16b')]+_0xc3e36b[_0xf955('0x176')]+_0xc3e36b[_0xf955('0x16e')]>=_0x215776[_0xf955('0x16c')]){_0x284a2b[_0xf955('0x181')](_0xc3e36b,_0x2bca9a,_0x513221,_0xf955('0x182'));}else{_0x284a2b[_0xf955('0x183')](_0xc3e36b,_0x2bca9a,_0x513221,_0xf955('0x182'));}}break;case'3':_0x215776[_0xf955('0x6b')]+=0x1;_0xc3e36b[_0xf955('0x9f')]=0x3;_0xc3e36b[_0xf955('0xa0')]=_0xf955('0x184');_0xc3e36b[_0xf955('0x16e')]+=0x1;_0xc3e36b['countglobal']+=0x1;_0x284a2b[_0xf955('0xbb')](_0xc3e36b)[_0xf955('0xae')](loggerCatch(_0xf955('0x185')));if(_0x284a2b[_0xf955('0x180')](0x3,_0x56bdc6,_0x215776)){if(_0xc3e36b['countnoanswerretry']>=_0x215776[_0xf955('0x16d')]){_0x284a2b['createStateFinal'](_0xc3e36b,_0x2bca9a,_0x513221,_0xf955('0x186'));}else{_0x284a2b[_0xf955('0x181')](_0xc3e36b,_0x2bca9a,_0x513221,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x215776[_0xf955('0x67')]+=0x1;_0xc3e36b[_0xf955('0x9f')]=0x5;_0xc3e36b[_0xf955('0xa0')]=_0xf955('0x187');_0xc3e36b['countbusyretry']+=0x1;_0xc3e36b[_0xf955('0x188')]+=0x1;_0x284a2b['createHistory'](_0xc3e36b)[_0xf955('0xae')](loggerCatch(_0xf955('0x189')));if(_0x284a2b[_0xf955('0x180')](0x5,_0x56bdc6,_0x215776)){if(_0xc3e36b[_0xf955('0x16b')]>=_0x215776[_0xf955('0x173')]){_0x284a2b['createStateFinal'](_0xc3e36b,_0x2bca9a,_0x513221,'reason\x205\x20busy');}else{_0x284a2b[_0xf955('0x181')](_0xc3e36b,_0x2bca9a,_0x513221,_0xf955('0x18a'));}}break;case'8':_0x215776['outboundCongestionCallsDay']+=0x1;_0xc3e36b[_0xf955('0x9f')]=0x8;_0xc3e36b[_0xf955('0xa0')]=_0xf955('0x18b');_0xc3e36b['countcongestionretry']+=0x1;_0xc3e36b[_0xf955('0x188')]+=0x1;_0x284a2b['createHistory'](_0xc3e36b)['catch'](loggerCatch(_0xf955('0x18c')));if(_0x284a2b[_0xf955('0x180')](0x8,_0x56bdc6,_0x215776)){if(_0xc3e36b[_0xf955('0x176')]>=_0x215776['dialCongestionMaxRetry']){_0x284a2b['createStateFinal'](_0xc3e36b,_0x2bca9a,_0x513221,'reason\x208\x20congestion');}else{_0x284a2b[_0xf955('0x181')](_0xc3e36b,_0x2bca9a,_0x513221,_0xf955('0x18d'));}}break;default:_0x215776[_0xf955('0xe9')]+=0x1;_0xc3e36b['state']=0xc;_0xc3e36b[_0xf955('0xa0')]=_0x190fed[_0xf955('0xec')];_0x284a2b[_0xf955('0xbb')](_0xc3e36b)[_0xf955('0xae')](loggerCatch(_0xf955('0x18e')));if(_0x284a2b[_0xf955('0x180')](_0x190fed[_0xf955('0xec')],_0x56bdc6,_0x215776)){if(_0xc3e36b['countbusyretry']+_0xc3e36b['countcongestionretry']+_0xc3e36b[_0xf955('0x16e')]>=_0x215776[_0xf955('0x16c')]){_0x284a2b[_0xf955('0x181')](_0xc3e36b,_0x2bca9a,_0x513221,_0x190fed[_0xf955('0xec')]);}else{_0x284a2b['createStateFinal'](_0xc3e36b,_0x2bca9a,_0x513221,_0x190fed[_0xf955('0xec')]);}}}});};Dialer[_0xf955('0x1b')][_0xf955('0x181')]=function(_0xda19b9,_0x5d3200,_0x50b3e7,_0x4de334){var _0x38a765=new Final(_0xda19b9);_0x38a765['state']=0xf;_0x38a765['statedesc']=_0xf955('0x18f');this[_0xf955('0x183')](_0x38a765,_0x5d3200,_0x50b3e7,_0x4de334);};Dialer[_0xf955('0x1b')][_0xf955('0x183')]=function(_0x1efcc8,_0x2d19d4,_0x283683,_0x48456f){this[_0xf955('0xba')](_0x1efcc8)[_0xf955('0xb0')](function(_0xdd6728){return _0x2d19d4(msgResponse('[callProgressDetecting]',_0xf955('0xc8'),_0x48456f));})['catch'](function(_0x360935){return _0x283683(msgResponse(_0xf955('0x190'),_0xf955('0x11a'),_0xf955('0x191')));});};Dialer[_0xf955('0x1b')]['predictive']=function(_0x5482cb){var _0x501bbb=this;var _0x378028=_0x5482cb[_0xf955('0x192')]/0x64;var _0x5f113c=_0x5482cb['outboundDropCallsDayTimeout']/(_0x5482cb['outboundDropCallsDayTimeout']+_0x5482cb[_0xf955('0x65')]);var _0x5d1eac=_0x5482cb['loggedIn']-_0x5482cb[_0xf955('0x193')]-_0x5482cb[_0xf955('0x5c')]-_0x5482cb[_0xf955('0x77')]-_0x5482cb['talking'];var _0x458219=(_0x5482cb[_0xf955('0x54')]-_0x5482cb[_0xf955('0x193')])*_0x5482cb[_0xf955('0x75')];var _0x234146=Math[_0xf955('0x194')](_0x5482cb['erlangCalls']*_0x5482cb[_0xf955('0x195')]*_0x5482cb['predictiveIntervalHitRate']*_0x5482cb[_0xf955('0x76')]);if(_[_0xf955('0x40')](_0x5482cb[_0xf955('0x88')])){loggerPredictive[_0xf955('0x82')](_0xf955('0x196'));if(!_['isUndefined'](_0x5482cb[_0xf955('0x2a')])){_0x5482cb[_0xf955('0x2a')]=undefined;loggerPredictive['error'](_0xf955('0x197'),_0xf955('0x198'));}if(!_[_0xf955('0x40')](_0x5482cb['handlePredictive'])){loggerPredictive[_0xf955('0x8f')](_0xf955('0x197'),_0xf955('0x199'));clearInterval(_0x5482cb[_0xf955('0x8a')]);_0x5482cb['handlePredictive']=undefined;}_0x5482cb[_0xf955('0x88')]=moment()[_0xf955('0x7a')](_0xf955('0xf2'));loggerPredictive[_0xf955('0x82')]('[startMethodPredictive][StartProgressive][Date]',_0x5482cb[_0xf955('0x88')],_0x5482cb[_0xf955('0x42')]);this[_0xf955('0x12d')](_0x5482cb,0x1);}else if(ifInterval(_0x5482cb['dialPredictiveInterval'],_0x5482cb['startProgressive'])){this[_0xf955('0x12d')](_0x5482cb,0x1);loggerPredictiveCalls['info'](_0xf955('0x19a'),_0x5482cb[_0xf955('0x88')],_0x5482cb[_0xf955('0x42')]);_0x5482cb['erlangCalls']=0x0;_0x5482cb['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x378028<_0x5f113c&&_0x5482cb[_0xf955('0x19b')]===_0xf955('0x19c')){freeVariablesPredictive(_0x5482cb);loggerPredictive[_0xf955('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xf955('0x19d'),_0x5f113c,_0xf955('0x88'),_0x5482cb[_0xf955('0x42')]);}else if(_0x5d1eac>_0x458219){freeVariablesPredictive(_0x5482cb);loggerPredictive[_0xf955('0x82')]('[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]',_0xf955('0x19e'),_0x5d1eac,_0xf955('0x19f'),_0x458219);}else if(_0x234146<_0x5482cb[_0xf955('0x1a0')]&&_0x5482cb[_0xf955('0x19b')]===_0xf955('0x19c')){freeVariablesPredictive(_0x5482cb);loggerPredictive[_0xf955('0x82')](_0xf955('0x1a1'),'Max\x20Drop\x20',_0x234146,_0xf955('0x1a2'),_0x5482cb[_0xf955('0x1a0')],_0xf955('0x88'),_0x5482cb[_0xf955('0x42')]);}else if(!ifInterval(_0x5482cb['dialPredictiveInterval'],_0x5482cb['startProgressive'])&&_[_0xf955('0x40')](_0x5482cb[_0xf955('0x2a')])&&!_[_0xf955('0x40')](_0x5482cb[_0xf955('0x88')])){_0x5482cb[_0xf955('0x2a')]=moment()[_0xf955('0x7a')](_0xf955('0xf2'));loggerPredictive[_0xf955('0x82')](_0xf955('0x1a3'),_0x5482cb[_0xf955('0x2a')],_0x5482cb[_0xf955('0x42')]);this[_0xf955('0x1a4')](_0x5482cb[_0xf955('0x1a5')])['then'](this[_0xf955('0x1a6')](_0x5482cb))[_0xf955('0xb0')](mergeDataErlangB(_0x5482cb))[_0xf955('0xb0')](this[_0xf955('0x1a7')](_0x5482cb))[_0xf955('0xae')](loggerCatchPredictive(_0xf955('0x1a8'),_0x5482cb));}else if(!ifInterval(_0x5482cb['dialPredictiveInterval'],_0x5482cb[_0xf955('0x2a')])){_0x5482cb[_0xf955('0x1a0')]=0x0;_0x5482cb[_0xf955('0x2a')]=moment()[_0xf955('0x7a')](_0xf955('0xf2'));loggerPredictive[_0xf955('0x82')](_0xf955('0x1a9'),_0x5482cb[_0xf955('0x2a')],_0x5482cb[_0xf955('0x42')]);clearInterval(_0x5482cb[_0xf955('0x8a')]);_0x5482cb[_0xf955('0x8a')]=undefined;this[_0xf955('0x1a4')](_0x5482cb[_0xf955('0x1a5')])[_0xf955('0xb0')](this[_0xf955('0x1a6')](_0x5482cb))[_0xf955('0xb0')](mergeDataErlangB(_0x5482cb))[_0xf955('0xb0')](this[_0xf955('0x1a7')](_0x5482cb))['catch'](loggerCatchPredictive(_0xf955('0x1a8'),_0x5482cb));}};Dialer[_0xf955('0x1b')]['getDataPredictive']=function(_0x3f7cdb){var _0x3d6a14=this;return function(_0xe00467){return new BPromise(function(_0x188d9e,_0x3dd645){_[_0xf955('0x87')](_0x3f7cdb,_0xe00467[0x0]);if(checkGetDataPredictive(_0xe00467[0x0])){loggerPredictive['info'](JSON[_0xf955('0x4a')](_0xe00467[0x0]));if(_0x3f7cdb[_0xf955('0x19b')]===_0xf955('0x19c')){return _0x3d6a14[_0xf955('0xb8')](_0x3f7cdb['id'])[_0xf955('0xb0')](function(_0x584e00){var _0x1a88f1=_0x3f7cdb[_0xf955('0x54')]-_0x584e00[0x0][_0xf955('0x1aa')];var _0x3f76a0=_0x3f7cdb[_0xf955('0x1a5')]*0x3c;var _0x114e5e=_0xe00467[0x0][_0xf955('0x70')]+_0xe00467[0x0][_0xf955('0x81')];var _0x340ace=(_0xe00467[0x0][_0xf955('0x6f')]+_0xe00467[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xe00467[0x0][_0xf955('0x71')])/_0xe00467[0x0][_0xf955('0x80')];var _0x4ce22d=_0x3f7cdb[_0xf955('0x192')]/0x64;_0x3f7cdb[_0xf955('0x193')]=_0x584e00[0x0][_0xf955('0x1aa')]||0x0;_0x3f7cdb[_0xf955('0x74')]=_0x340ace>0x0?_0x340ace:0x1;return _0x3d6a14[_0xf955('0x1ab')](_0x1a88f1,_0x3f76a0,_0x114e5e,_0x340ace,_0x4ce22d);})[_0xf955('0xb0')](function(_0x3be319){return _0x188d9e(_0x3be319);})['catch'](function(_0x51e5e5){return _0x3dd645(msgResponse('[CatchErlangB]',_0xf955('0x11a'),JSON[_0xf955('0x4a')](_0x51e5e5)));});}if(_0x3f7cdb[_0xf955('0x19b')]===_0xf955('0x1ac')){return _0x3d6a14[_0xf955('0xb8')](_0x3f7cdb['id'])[_0xf955('0xb0')](function(_0x26df3b){var _0x201b73=_0x3f7cdb['loggedIn']-_0x26df3b[0x0]['outboundQueuePauses'];var _0x596b0f=_0x3f7cdb[_0xf955('0x1a5')]*0x3c;var _0x385a31=_0xe00467[0x0][_0xf955('0x70')]+_0xe00467[0x0][_0xf955('0x81')];var _0xaf69bf=(_0xe00467[0x0]['predictiveIntervalAnsweredCalls']+_0xe00467[0x0][_0xf955('0x72')]+_0xe00467[0x0][_0xf955('0x71')])/_0xe00467[0x0][_0xf955('0x80')];var _0x343d51=_0x3f7cdb[_0xf955('0x192')]/0x64;_0x3f7cdb[_0xf955('0x193')]=_0x26df3b[0x0]['outboundQueuePauses']||0x0;_0x3f7cdb['predictiveIntervalHitRate']=_0xaf69bf>0x0?_0xaf69bf:0x1;return _0x3d6a14[_0xf955('0x1ad')](_0x201b73,_0x596b0f,_0x385a31,_0xaf69bf,_0x343d51);})[_0xf955('0xb0')](function(_0x4a1643){return _0x188d9e(_0x4a1643);})[_0xf955('0xae')](function(_0xba4d3f){return _0x3dd645(msgResponse(_0xf955('0x1ae'),_0xf955('0x11a'),JSON[_0xf955('0x4a')](_0xba4d3f)));});}}else{return _0x3dd645(msgResponse('[getDataPredictive]','Failure',_0xf955('0x1af')));}});};};Dialer['prototype'][_0xf955('0x1a7')]=function(_0xe17396){var _0x5dda02=this;return function(){var _0x7f78b=0x0;var _0x5c57b2=Math[_0xf955('0x194')](_0xe17396[_0xf955('0x1b0')]*0x3e8);if(_0x5c57b2>0x0){_0x5c57b2=_0x5c57b2<0x64?0x64:_0x5c57b2;loggerPredictive['info'](_0xf955('0x1b1'),_0x5c57b2);_0xe17396[_0xf955('0x8a')]=setInterval(function(){_0x5dda02['handlePredictive'](_0xe17396);loggerPredictiveCalls[_0xf955('0x82')]('[handlePredictive]',_0x7f78b+=0x1);},_0x5c57b2);}else{loggerPredictive[_0xf955('0x82')](_0xf955('0x1b2'),_0xf955('0x1b3'),_0x5c57b2);}};};Dialer[_0xf955('0x1b')][_0xf955('0x1b4')]=function(_0x88337e,_0x5b72a4){var _0x56776a=this;return function(_0x12c732){if(_[_0xf955('0x8c')](_0x12c732)){if(_[_0xf955('0xa6')](_0x5b72a4[_0xf955('0xc3')])||!_0x5b72a4[_0xf955('0x1b5')]){if(_0x88337e['dialMethod']==='booked'){_0x88337e['queueStatusComplete']=_[_0xf955('0x40')](_0x88337e[_0xf955('0x104')])?!![]:_0x88337e[_0xf955('0x104')];var _0x18aabd=uuid['v4']();_0x56776a['actions'][_0x18aabd]=new Action(_0x88337e,_0x5b72a4,_0x18aabd);loggerBooked['info'](_0xf955('0x1b6'),_0x18aabd,_0xf955('0x1b7'),JSON['stringify'](_0x88337e[_0xf955('0x104')]),'Queue:\x20',_0x88337e['name']);if(_0x88337e[_0xf955('0x104')]){_0x88337e[_0xf955('0x104')]=![];_0x56776a[_0xf955('0x100')][_0x56776a[_0xf955('0x27')][_0x18aabd][_0xf955('0xaa')]]=[];ami[_0xf955('0xa7')]({'actionid':_0x18aabd,'action':_0xf955('0x1b8'),'queue':_0x88337e[_0xf955('0x42')]})['catch'](function(_0x3a0460){_0x56776a[_0xf955('0xab')](_0x88337e);_0x56776a['rescheduleContact']({'active':![],'ContactId':_0x56776a[_0xf955('0x27')][_0x18aabd][_0xf955('0xc1')],'ListId':_0x56776a[_0xf955('0x27')][_0x18aabd]['ListId'],'VoiceQueueId':_0x56776a['actions'][_0x18aabd][_0xf955('0xc4')]||undefined,'CampaignId':_0x56776a[_0xf955('0x27')][_0x18aabd][_0xf955('0xc5')]||undefined})[_0xf955('0xae')](loggerCatch(_0xf955('0x1b9')));delete _0x56776a[_0xf955('0x27')][_0x18aabd];});}else{loggerBooked['info'](_0xf955('0x1ba'),JSON[_0xf955('0x4a')](_0x88337e[_0xf955('0x104')]),'Queue:\x20',_0x88337e['name']);_0x56776a[_0xf955('0xab')](_0x88337e);_0x56776a[_0xf955('0xb3')]({'active':![],'ContactId':_0x56776a[_0xf955('0x27')][_0x18aabd]['ContactId'],'ListId':_0x56776a[_0xf955('0x27')][_0x18aabd][_0xf955('0xc2')],'VoiceQueueId':_0x56776a[_0xf955('0x27')][_0x18aabd]['VoiceQueueId']||undefined,'CampaignId':_0x56776a['actions'][_0x18aabd][_0xf955('0xc5')]||undefined})[_0xf955('0xae')](loggerCatch(_0xf955('0x1b9')));delete _0x56776a[_0xf955('0x27')][_0x18aabd];}}else{return _0x56776a[_0xf955('0x13c')](_0x88337e,_0x5b72a4);}}else{if(getDiff(_0x5b72a4[_0xf955('0x1bb')])<_0x88337e[_0xf955('0x1bc')]*0x3c){_0x56776a['preview'][_0xf955('0x106')](_0x5b72a4['id'])[_0xf955('0x1e')](function(){_0x56776a[_0xf955('0xab')](_0x88337e);});}else{_0x88337e['outboundReCallsDay']+=0x1;_0x56776a[_0xf955('0xab')](_0x88337e);if(_0x88337e[_0xf955('0x1bd')]){_0x56776a[_0xf955('0xb3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5b72a4[_0xf955('0xc1')],'ListId':_0x5b72a4[_0xf955('0xc2')],'VoiceQueueId':_0x5b72a4[_0xf955('0xc4')]||undefined,'CampaignId':_0x5b72a4[_0xf955('0xc5')]||undefined})['catch'](loggerCatch(_0xf955('0x1be')));_0x56776a[_0xf955('0xbb')](createObjHistory(_0x88337e,_0x5b72a4,_0xf955('0x1bf'),0x17,'RecallInQueue'))[_0xf955('0xae')](loggerCatch(_0xf955('0x1c0')));}else{_0x56776a[_0xf955('0xcf')](createObjHistory(_0x88337e,_0x5b72a4,_0xf955('0x1c1'),0x16,_0xf955('0x1c2')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x88337e[_0xf955('0x66')]+=0x1;_0x56776a['saveInDb'](createObjHistory(_0x88337e,_0x5b72a4,_0xf955('0x1c3'),0xd,'Blacklist'),_0xf955('0x1c4'),'[Originate][MoveBlacklist]');throw _0xf955('0x1c5');}};};Dialer[_0xf955('0x1b')][_0xf955('0x131')]=function(_0x3a8c60){var _0x2d96e2=this;var _0x331d11=[];var _0x15b0b0=_0x3a8c60['limitCalls']-_0x3a8c60['originated']-_0x3a8c60['temp'];emitCampaignSummary(_0x3a8c60);if(_0x15b0b0>0x0){if(_0x15b0b0>this[_0xf955('0x25')]){_0x15b0b0=this['maxNumberOriginate'];}_0x3a8c60[_0xf955('0x1c6')]+=_0x15b0b0;this['getContactDialerIvr'](_0x3a8c60['id'],_0x15b0b0,_0x3a8c60['dialOrderByScheduledAt'])[_0xf955('0xb0')](function(_0x2e1d97){_0x3a8c60[_0xf955('0x1c6')]-=_0x15b0b0;_0x3a8c60[_0xf955('0x1c6')]=_0x3a8c60[_0xf955('0x1c6')]>0x0?_0x3a8c60['temp']:0x0;if(!checkContactEmpty(_0x2e1d97)){_0x3a8c60[_0xf955('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xf955('0x82')](_0xf955('0x1c7')+_0x3a8c60[_0xf955('0x42')]);}else{_0x3a8c60[_0xf955('0x77')]+=_0x2e1d97[_0xf955('0x91')];_0x3a8c60[_0xf955('0x41')]=_0xf955('0x1c8');for(var _0x1a004f=0x0;_0x1a004f<_0x2e1d97[_0xf955('0x91')];_0x1a004f+=0x1){_0x3a8c60['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x2e1d97[_0x1a004f])||_[_0xf955('0xa6')](_0x2e1d97[_0x1a004f][_0xf955('0x13f')])||_['isNil'](_0x2e1d97[_0x1a004f][_0xf955('0x13f')]['phone'])){_0x2d96e2['emptyContact'](_0xf955('0x1c9'),_0x3a8c60,_0x2e1d97[_0x1a004f]);}else{_0x2d96e2[_0xf955('0xb1')](_[_0xf955('0x101')](_0x2e1d97[_0x1a004f],[_0xf955('0xc5'),_0xf955('0x1ca')]))[_0xf955('0xb0')](_0x2d96e2[_0xf955('0x1b4')](_0x3a8c60,_0x2e1d97[_0x1a004f]))['catch'](_0x2d96e2[_0xf955('0xbe')](_0xf955('0x1cb'),_0x3a8c60));}}}})[_0xf955('0xae')](loggerGetContactDialer('[getContactCampaign2]',_0x3a8c60,_0x15b0b0));}};Dialer[_0xf955('0x1b')]['handlePower']=function(_0x56156a,_0x576afd){var _0x33db30=this;var _0x4e6dae=[];var _0x49e688=_0x576afd>=0x1?_0x576afd:0x1;var _0x5dd8e6=[];if(_0x56156a[_0xf955('0x5f')]===_0xf955('0x7')){_0x49e688=0x1;}var _0x478c7e=Math[_0xf955('0x194')](_0x56156a[_0xf955('0x53')]*_0x49e688)-_0x56156a[_0xf955('0x77')]-_0x56156a[_0xf955('0x1c6')];emitVoiceQueueSummary(_0x56156a);if(_0x56156a[_0xf955('0x1cc')]>0x0){var _0x360c92=_0x56156a[_0xf955('0x1cc')]-_0x56156a['originated']-_0x56156a[_0xf955('0x1cd')]-_0x56156a[_0xf955('0x1c6')]-_0x56156a[_0xf955('0x55')];if(_0x478c7e>_0x360c92){_0x478c7e=_0x360c92;}}if(_0x478c7e>0x0){if(_0x56156a[_0xf955('0x5f')]===_0xf955('0x7')){_0x478c7e=0x1;}if(_0x478c7e>this[_0xf955('0x25')]){_0x478c7e=this[_0xf955('0x25')];}_0x56156a[_0xf955('0x1c6')]+=_0x478c7e;for(var _0x1ce002 in this[_0xf955('0x23')]){if(this[_0xf955('0x23')][_0xf955('0xbc')](_0x1ce002)){if(this[_0xf955('0x23')][_0x1ce002][_0xf955('0x9f')]===_0xf955('0x1ce')&&this[_0xf955('0x23')][_0x1ce002]['status']===_0xf955('0xcc')){_0x4e6dae['push'](this[_0xf955('0x23')][_0x1ce002]['id']);}}}this[_0xf955('0xb5')](_0x56156a['id'],_0x4e6dae,_0x478c7e,_0x56156a[_0xf955('0x1cf')])[_0xf955('0xb0')](function(_0x1b2415){_0x56156a[_0xf955('0x1c6')]-=_0x478c7e;_0x56156a['temp']=_0x56156a['temp']>0x0?_0x56156a[_0xf955('0x1c6')]:0x0;if(!checkContactEmpty(_0x1b2415)){_0x33db30['countReScheduled'](_0x56156a)[_0xf955('0xb0')](sendMessageReschedule(_0x56156a))[_0xf955('0xae')](loggerCatch(_0xf955('0x1d0')));}else{_0x56156a[_0xf955('0x77')]+=_0x1b2415[_0xf955('0x91')];_0x56156a[_0xf955('0x41')]=_0x56156a[_0xf955('0x5f')]===_0xf955('0x7')?_0xf955('0x146'):_0xf955('0x1c8');for(var _0x5eb630=0x0;_0x5eb630<_0x1b2415[_0xf955('0x91')];_0x5eb630+=0x1){if(_[_0xf955('0xa6')](_0x1b2415[_0x5eb630])||_[_0xf955('0xa6')](_0x1b2415[_0x5eb630][_0xf955('0x13f')])||_[_0xf955('0xa6')](_0x1b2415[_0x5eb630][_0xf955('0x13f')][_0xf955('0x140')])){_0x33db30['emptyContact']('[actionOriginate]\x20',_0x56156a,_0x1b2415[_0x5eb630]);}else{_0x33db30[_0xf955('0xaf')](_['pick'](_0x1b2415[_0x5eb630],[_0xf955('0xc4'),'Contact.phone']))[_0xf955('0xb0')](_0x33db30['checkContactBlack'](_0x56156a,_0x1b2415[_0x5eb630]))['catch'](_0x33db30[_0xf955('0xbe')](_0xf955('0x1c9'),_0x56156a));}}}})[_0xf955('0xae')](loggerGetContactDialer('[getContactDialer2]',_0x56156a,_0x478c7e));}};Dialer[_0xf955('0x1b')][_0xf955('0x8a')]=function(_0x263d48){var _0x1dbff2=this;if(_0x263d48[_0xf955('0x1cc')]>0x0){var _0x53e9d5=_0x263d48[_0xf955('0x1cc')]-_0x263d48[_0xf955('0x77')]-_0x263d48[_0xf955('0x1cd')];if(_0x53e9d5>0x0){this[_0xf955('0x1d1')](_0x263d48);}else{loggerPredictiveCalls[_0xf955('0x82')](_0xf955('0x1d2'));}}else{this[_0xf955('0x1d1')](_0x263d48);}};Dialer['prototype'][_0xf955('0x1d1')]=function(_0x4c9c4f){var _0x592d1b=this;var _0xcfcb5d=[];_0x4c9c4f[_0xf955('0x77')]+=0x1;for(var _0xb69b95 in this['agents']){if(this[_0xf955('0x23')][_0xf955('0xbc')](_0xb69b95)){if(this[_0xf955('0x23')][_0xb69b95]['state']===_0xf955('0x1ce')&&this[_0xf955('0x23')][_0xb69b95][_0xf955('0xcd')]==='reachable'){_0xcfcb5d[_0xf955('0x11f')](this[_0xf955('0x23')][_0xb69b95]['id']);}}}this[_0xf955('0xb5')](_0x4c9c4f['id'],_0xcfcb5d,0x1,_0x4c9c4f['dialOrderByScheduledAt'])['then'](function(_0x25b734){if(!checkContactEmpty(_0x25b734)){checkContactLowerLimitOriginate(_0x4c9c4f,0x1,0x0);_0x592d1b[_0xf955('0xac')](_0x4c9c4f)[_0xf955('0xb0')](sendMessageReschedule(_0x4c9c4f))[_0xf955('0xae')](loggerCatch(_0xf955('0x1d0')));}else{_0x4c9c4f[_0xf955('0x41')]=_0xf955('0x1c8');if(_['isNil'](_0x25b734[0x0])||_['isNil'](_0x25b734[0x0][_0xf955('0x13f')])||_['isNil'](_0x25b734[0x0][_0xf955('0x13f')][_0xf955('0x140')])){_0x592d1b[_0xf955('0xbf')](_0xf955('0x1c9'),_0x4c9c4f,_0x25b734[0x0]);}else{_0x592d1b['checkIsBlackList'](_[_0xf955('0x101')](_0x25b734[0x0],[_0xf955('0xc4'),_0xf955('0x1ca')]))['then'](_0x592d1b[_0xf955('0x1b4')](_0x4c9c4f,_0x25b734[0x0]))['catch'](_0x592d1b[_0xf955('0xbe')]('[actionOriginatePredictive]\x20',_0x4c9c4f));}}})[_0xf955('0xae')](loggerGetContactDialer(_0xf955('0x1d3'),_0x4c9c4f,0x1));emitVoiceQueueSummary(_0x4c9c4f);};Dialer['prototype'][_0xf955('0x1ab')]=function(_0x2a4441,_0x55a01d,_0x5b6aa7,_0x3a5035,_0x239773,_0x54a24a){loggerPredictive[_0xf955('0x82')](_0xf955('0x1d4'),_0xf955('0x1d5'),_0x2a4441,_0xf955('0x1d6'),_0x55a01d,_0xf955('0x1d7'),_0x5b6aa7,_0xf955('0x1d8'),_0x3a5035,_0xf955('0x1d9'),_0x239773);return new BPromise(function(_0x235d0f,_0x3405a1){if(_0x2a4441<=0x0||isNaN(_0x2a4441)){return _0x3405a1(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),'m\x20=\x20'+_0x2a4441));}if(_0x5b6aa7<=0x0||isNaN(_0x5b6aa7)){return _0x3405a1(msgResponse(_0xf955('0x1d4'),'Error',_0xf955('0x1db')+_0x5b6aa7));}if(_0x3a5035<=0x0||isNaN(_0x3a5035)){return _0x3405a1(msgResponse('[abandonmentRate]','Error',_0xf955('0x1dc')+_0x3a5035));}if(_0x55a01d<=0x0||isNaN(_0x55a01d)){return _0x3405a1(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),_0xf955('0x1dd')+_0x55a01d));}if(_0x239773<=0x0||isNaN(_0x239773)){return _0x3405a1(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),'Amax\x20=\x20'+_0x239773));}_0x54a24a=_0x54a24a||0x0;var _0x29500d=0x1/_0x5b6aa7;var _0x2ed35c=0x0;var _0x3d9525=0x0;var _0xfd3991=0x0;var _0x277fe1=0x0;for(var _0x17c330=0x0;_0xfd3991<_0x239773;_0x17c330+=0x1){_0x3d9525=_0x17c330/_0x55a01d;_0x2ed35c=(_0x3a5035*_0x3d9525+_0x54a24a)/_0x29500d;_0xfd3991=erlangb(_0x2ed35c,_0x2a4441);_0x277fe1=_0x2ed35c/_0x2a4441*(0x1-erlangb(_0x2ed35c,_0x2a4441));}return _0x235d0f({'erlangCalls':_0x17c330,'erlangCallToSecond':_0x55a01d/_0x17c330,'erlangAbandonmentRate':_0xfd3991,'erlangBusyFactor':_0x277fe1});});};Dialer[_0xf955('0x1b')][_0xf955('0x1ad')]=function(_0x27f07b,_0x54c566,_0x4e890e,_0x4619eb,_0x25281a,_0xe9468){loggerPredictive[_0xf955('0x82')](_0xf955('0x1de'),_0xf955('0x1d5'),_0x27f07b,_0xf955('0x1d6'),_0x54c566,_0xf955('0x1d7'),_0x4e890e,_0xf955('0x1d8'),_0x4619eb,_0xf955('0x1df'),_0x25281a);return new BPromise(function(_0x66708c,_0x5d9dca){if(_0x27f07b<=0x0||isNaN(_0x27f07b)){return _0x5d9dca(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),'m\x20=\x20'+_0x27f07b));}if(_0x4e890e<=0x0||isNaN(_0x4e890e)){return _0x5d9dca(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),_0xf955('0x1db')+_0x4e890e));}if(_0x4619eb<=0x0||isNaN(_0x4619eb)){return _0x5d9dca(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),'p\x20=\x20'+_0x4619eb));}if(_0x54c566<=0x0||isNaN(_0x54c566)){return _0x5d9dca(msgResponse(_0xf955('0x1d4'),_0xf955('0x1da'),_0xf955('0x1dd')+_0x54c566));}if(_0x25281a<=0x0||isNaN(_0x25281a)){return _0x5d9dca(msgResponse('[abandonmentRate]',_0xf955('0x1da'),_0xf955('0x1e0')+_0x25281a));}_0xe9468=_0xe9468||0x0;var _0x5582f2=0x1/_0x4e890e;var _0x3627f9=0x0;var _0x4ad144=0x0;var _0xcb9f21=0x0;var _0x28d631=0x0;for(var _0x2ecf1f=0x0;_0x28d631<_0x25281a;_0x2ecf1f+=0x1){_0x4ad144=_0x2ecf1f/_0x54c566;_0x3627f9=(_0x4619eb*_0x4ad144+_0xe9468)/_0x5582f2;_0xcb9f21=erlangb(_0x3627f9,_0x27f07b);_0x28d631=_0x3627f9/_0x27f07b*(0x1-erlangb(_0x3627f9,_0x27f07b));}return _0x66708c({'erlangCalls':_0x2ecf1f,'erlangCallToSecond':_0x54c566/_0x2ecf1f,'erlangAbandonmentRate':_0xcb9f21,'erlangBusyFactor':_0x28d631});});};module[_0xf955('0x1e1')]=Dialer; \ No newline at end of file +var _0xd7d1=['maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalAvgTalktime','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','merge','seconds','[freeVariablesPredictive]','handlePredictive','string','format','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','waiting','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','loopClearZombieChannels','clearZombieChannels','uniqueId','[actions]','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','Machine','membername','amd','[syncMachine][createHistory]','uniqueid','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','TIMEOUT','Abandoned','dropreason','CALLEREXIT','actionid','paused','stateinterface','locked','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','CampaignId','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','true','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','handleIvr','dialActive','loggedIn','checkIfTime','dialGlobalInterval','[syncQueueSummary]','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','add','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','Congestion','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','floor','erlangCalls','erlangAbandonmentRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','averageHandleTime','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','getDataPredictive','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','busyFactor','[getDataPredictive]','[startMethodPredictive]','[handlePredictive]','Failure\x20','recallme','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','\x20m\x20=\x20','Amax\x20=\x20','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','env','XCALLY_IP_AGI','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks'];(function(_0x33179b,_0x2633b5){var _0x7e4534=function(_0x3c6564){while(--_0x3c6564){_0x33179b['push'](_0x33179b['shift']());}};_0x7e4534(++_0x2633b5);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x4a4f27,_0x1be3fd){_0x4a4f27=_0x4a4f27-0x0;var _0x285757=_0xd7d1[_0x4a4f27];return _0x285757;};'use strict';var util=require(_0x1d7d('0x0'));var _=require(_0x1d7d('0x1'));var BPromise=require(_0x1d7d('0x2'));var uuid=require(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var rr=require('rr');var md5=require(_0x1d7d('0x5'));var Redis=require(_0x1d7d('0x6'));var config=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var loggerBooked=require(_0x1d7d('0x8'))(_0x1d7d('0xa'));var loggerPredictive=require(_0x1d7d('0x8'))('predictive');var loggerPredictiveCalls=require(_0x1d7d('0x8'))(_0x1d7d('0xb'));var loggerSyncQueueSummary=require(_0x1d7d('0x8'))(_0x1d7d('0xc'));var ami=require(_0x1d7d('0xd'));config[_0x1d7d('0xe')]=_[_0x1d7d('0xf')](config[_0x1d7d('0xe')],{'host':_0x1d7d('0x10'),'port':0x18eb});var io=require(_0x1d7d('0x11'))(new Redis(config[_0x1d7d('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x1d7d('0x12'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1d7d('0x13'));var voiceQueueRt=require(_0x1d7d('0x14'));var Action=require(_0x1d7d('0x15'));var History=require(_0x1d7d('0x16'));var Final=require('./final');var AgentComplete=require(_0x1d7d('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x1d7d('0x18')][_0x1d7d('0x19')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x1d7d('0x1a')};var Sequence=function(){};Sequence[_0x1d7d('0x1b')][_0x1d7d('0x1c')]=function(_0x183fc6){this[_0x1d7d('0x1d')]=this['tail']?this[_0x1d7d('0x1d')][_0x1d7d('0x1e')](_0x183fc6):_0x183fc6();};function Dialer(_0x51cbca,_0xb90a8c){this[_0x1d7d('0x1f')]=new Sequence();this[_0x1d7d('0x20')]=_0xb90a8c;this[_0x1d7d('0x21')]=_0x51cbca[_0x1d7d('0x21')];this['campaigns']=_0x51cbca[_0x1d7d('0x22')];this[_0x1d7d('0x23')]=_0x51cbca['agents'];this['trunks']=_0x51cbca[_0x1d7d('0x24')];this[_0x1d7d('0x25')]=config[_0x1d7d('0x25')]||0x2;this[_0x1d7d('0x26')]={};this[_0x1d7d('0x27')]={};this[_0x1d7d('0x28')]={};this['uniqueId']={};this[_0x1d7d('0x29')]={};this[_0x1d7d('0x2a')]={};this[_0x1d7d('0x2b')]={};this['ivrOriginated']={};this[_0x1d7d('0x2c')]={};this[_0x1d7d('0x2d')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x2f'),this[_0x1d7d('0x30')]['bind'](this));ami['on'](_0x1d7d('0x31'),this[_0x1d7d('0x32')][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x33'),this['syncAgentComplete'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x34'),this['syncQueueSummary']['bind'](this));ami['on'](_0x1d7d('0x35'),this['syncHangup'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x36'),this[_0x1d7d('0x37')][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x38'),this['syncVarSet'][_0x1d7d('0x2e')](this));ami['on'](_0x1d7d('0x39'),this[_0x1d7d('0x3a')]['bind'](this));ami['on'](_0x1d7d('0x3b'),this[_0x1d7d('0x3c')][_0x1d7d('0x2e')](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x53e25c){return _0x53e25c!==null&&!_[_0x1d7d('0x3d')](_0x53e25c);}function checkIsLoggedIn(_0x329f56,_0x559f19){return function(){if(_0x559f19<=0x0){_0x329f56[_0x1d7d('0x3e')]=_0x1d7d('0x3f');throw _0x329f56[_0x1d7d('0x40')]+_0x1d7d('0x41');}};}function isActive(_0x342f4e){return _0x342f4e;}function checkIsActive(_0x22fec9,_0x452293){return function(){if(!isActive(_0x452293)){_0x22fec9[_0x1d7d('0x3e')]=_0x1d7d('0x42');throw _0x22fec9[_0x1d7d('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x57c22e){return function(){if(!isNotNull(_0x57c22e[_0x1d7d('0x43')])){_0x57c22e[_0x1d7d('0x3e')]=_0x1d7d('0x44');throw _0x57c22e[_0x1d7d('0x40')]+_0x1d7d('0x45');}if(!isNotNull(_0x57c22e[_0x1d7d('0x43')][_0x1d7d('0x46')])){_0x57c22e[_0x1d7d('0x3e')]=_0x1d7d('0x44');throw _0x57c22e['name']+_0x1d7d('0x45');}if(!isNotNull(_[_0x1d7d('0x47')](_0x57c22e[_0x1d7d('0x43')][_0x1d7d('0x46')]))){_0x57c22e['message']='INTERVAL_IS_NULL';throw _0x57c22e[_0x1d7d('0x40')]+_0x1d7d('0x45');}};}function msgResponse(_0x520b56,_0x103c77,_0x3fea2e){return{'action':_0x520b56,'response':_0x103c77,'message':_0x3fea2e};}function myreject(_0x568092){return function(_0x4cd758){return _0x568092(msgResponse(_0x1d7d('0x48'),_0x1d7d('0x49'),JSON[_0x1d7d('0x4a')](_0x4cd758)));};}function getSeconds(_0x3f686d,_0x1867da){var _0x3427eb=moment(_0x3f686d)[_0x1d7d('0x4b')](0x0);var _0x37d003=moment(_0x1867da)[_0x1d7d('0x4b')](0x0);return _0x3427eb[_0x1d7d('0x4c')](_0x37d003,'seconds');}function emit(_0x5ed8a6,_0x57db7a,_0x5cab41){io['to'](_0x5ed8a6)[_0x1d7d('0x4d')](_0x57db7a,_0x5cab41);}function emitVoiceQueueSummary(_0x5e7e8b){if(_0x5e7e8b[_0x1d7d('0x4e')]===_0x1d7d('0x4f')){var _0x3d7c65={'id':_0x5e7e8b['id'],'name':_0x5e7e8b['name'],'strategy':_0x5e7e8b[_0x1d7d('0x50')],'answered':_0x5e7e8b[_0x1d7d('0x51')],'available':_0x5e7e8b[_0x1d7d('0x52')],'loggedIn':_0x5e7e8b['loggedIn'],'pTalking':_0x5e7e8b[_0x1d7d('0x53')],'sumBillable':_0x5e7e8b[_0x1d7d('0x54')],'sumDuration':_0x5e7e8b[_0x1d7d('0x55')],'sumHoldTime':_0x5e7e8b[_0x1d7d('0x56')]||0x0,'talking':_0x5e7e8b['talking'],'total':_0x5e7e8b[_0x1d7d('0x57')],'type':_0x5e7e8b[_0x1d7d('0x4e')],'unmanaged':_0x5e7e8b[_0x1d7d('0x58')],'abandoned':_0x5e7e8b[_0x1d7d('0x59')],'waiting':_0x5e7e8b['waiting'],'loggedInDb':_0x5e7e8b[_0x1d7d('0x5a')],'dialActive':_0x5e7e8b['dialActive'],'dialMethod':_0x5e7e8b[_0x1d7d('0x5b')],'dialOriginateCallerIdName':_0x5e7e8b[_0x1d7d('0x5c')],'dialOriginateCallerIdNumber':_0x5e7e8b[_0x1d7d('0x5d')],'dialOriginateTimeout':_0x5e7e8b[_0x1d7d('0x5e')],'dialPrefix':_0x5e7e8b[_0x1d7d('0x5f')],'outboundAnswerAgiCallsDay':_0x5e7e8b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5e7e8b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x5e7e8b[_0x1d7d('0x60')],'outboundBusyCallsDay':_0x5e7e8b[_0x1d7d('0x61')],'outboundCongestionCallsDay':_0x5e7e8b[_0x1d7d('0x62')],'outboundDropCallsDayACS':_0x5e7e8b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5e7e8b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5e7e8b[_0x1d7d('0x63')],'outboundNoAnswerCallsDay':_0x5e7e8b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5e7e8b[_0x1d7d('0x64')],'outboundOriginateFailureCallsDay':_0x5e7e8b[_0x1d7d('0x65')],'outboundReCallsDay':_0x5e7e8b[_0x1d7d('0x66')],'outboundRejectCallsDay':_0x5e7e8b[_0x1d7d('0x67')],'outboundUnknownCallsDay':_0x5e7e8b[_0x1d7d('0x68')],'predictiveIntervalAnsweredCalls':_0x5e7e8b[_0x1d7d('0x69')],'predictiveIntervalAvgHoldtime':_0x5e7e8b[_0x1d7d('0x6a')],'predictiveIntervalAvgTalktime':_0x5e7e8b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5e7e8b[_0x1d7d('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x5e7e8b[_0x1d7d('0x6c')],'predictiveIntervalErlangCalls':_0x5e7e8b['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5e7e8b[_0x1d7d('0x6d')],'predictiveIntervalHitRate':_0x5e7e8b[_0x1d7d('0x6e')],'predictiveIntervalLowerLimit':_0x5e7e8b[_0x1d7d('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x5e7e8b[_0x1d7d('0x70')],'predictiveIntervalPauses':_0x5e7e8b[_0x1d7d('0x71')],'predictiveIntervalTotalCalls':_0x5e7e8b[_0x1d7d('0x72')],'message':_0x5e7e8b[_0x1d7d('0x3e')],'originated':_0x5e7e8b[_0x1d7d('0x73')]};if(_0x5e7e8b[_0x1d7d('0x74')]){_0x3d7c65[_0x1d7d('0x74')]={'id':_0x5e7e8b[_0x1d7d('0x74')]['id'],'name':_0x5e7e8b[_0x1d7d('0x74')]['name'],'active':_0x5e7e8b[_0x1d7d('0x74')]['active'],'callerid':_0x5e7e8b[_0x1d7d('0x74')]['callerid']};}if(_0x5e7e8b[_0x1d7d('0x43')]){_0x3d7c65[_0x1d7d('0x43')]={'id':_0x5e7e8b[_0x1d7d('0x43')]['id'],'name':_0x5e7e8b[_0x1d7d('0x43')]['name']};}var _0x2dbb61=md5(JSON['stringify'](_0x3d7c65));if(_0x5e7e8b['md5']!==_0x2dbb61){_0x5e7e8b[_0x1d7d('0x5')]=_0x2dbb61;emit(util['format']('voice:queue:%s',_0x3d7c65[_0x1d7d('0x40')]),_0x1d7d('0x75'),_0x3d7c65);}}}function emitCampaignSummary(_0x506564){if(_0x506564[_0x1d7d('0x4e')]===_0x1d7d('0x76')){emit(util['format'](_0x1d7d('0x77'),_0x506564[_0x1d7d('0x40')]),_0x1d7d('0x78'),_0x506564);}}function checkGetDataPredictive(_0x32b6c0){if(isNotNull(_0x32b6c0)){if(!_['isEmpty'](_0x32b6c0)){if(_0x32b6c0['predictiveIntervalTotalCalls']>0x0){if(!_[_0x1d7d('0x3d')](_0x32b6c0[_0x1d7d('0x79')])&&_0x32b6c0[_0x1d7d('0x79')]>0x0){return!![];}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7b'),JSON['stringify'](_0x32b6c0));}if(!_[_0x1d7d('0x3d')](_0x32b6c0[_0x1d7d('0x6a')])&&_0x32b6c0[_0x1d7d('0x6a')]>0x0){return!![];}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7c'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x7d'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive['info'](_0x1d7d('0x7e'),JSON[_0x1d7d('0x4a')](_0x32b6c0));}}else{loggerPredictive[_0x1d7d('0x7a')]('[checkGetDataPredictive][obj]',JSON['stringify'](_0x32b6c0));}return![];}function mergeDataErlangB(_0x1d3f54){return function(_0x2d4cc3){loggerPredictive[_0x1d7d('0x7a')]('[ErlangB]',JSON[_0x1d7d('0x4a')](_0x2d4cc3));_[_0x1d7d('0x7f')](_0x1d3f54,_0x2d4cc3);};}function getDiff(_0x5eff64){var _0x12547a=moment()[_0x1d7d('0x4b')](0x0);var _0x3fc216=moment(_0x5eff64)[_0x1d7d('0x4b')](0x0);return _0x12547a['diff'](_0x3fc216,_0x1d7d('0x80'));}function ifInterval(_0x202af4,_0x4ba6ec){if(_['isUndefined'](_0x4ba6ec)){return![];}if(getDiff(_0x4ba6ec)<_0x202af4*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x115cb2){if(isNotNull(_0x115cb2)){if(!_[_0x1d7d('0x3d')](_0x115cb2['startProgressive'])){_0x115cb2['startProgressive']=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x2b'),_0x115cb2[_0x1d7d('0x40')]);}if(!_['isUndefined'](_0x115cb2[_0x1d7d('0x2a')])){_0x115cb2['startPredictive']=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x2a'),_0x115cb2[_0x1d7d('0x40')]);}if(!_['isUndefined'](_0x115cb2[_0x1d7d('0x82')])){clearInterval(_0x115cb2[_0x1d7d('0x82')]);_0x115cb2[_0x1d7d('0x82')]=undefined;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x81'),_0x1d7d('0x82'),_0x115cb2[_0x1d7d('0x40')]);}}}function erlangb(_0x2bd2a0,_0x27cebf){if(_0x27cebf===0x0){return 0x0;}var _0x17c967=0x1;for(var _0x44a187=0x1;_0x44a187<=_0x27cebf;_0x44a187+=0x1){_0x17c967=0x1+_0x17c967*_0x44a187/_0x2bd2a0;}return 0x1/_0x17c967;}function isVoiceQueueOutbound(_0x23974e){return _0x23974e===_0x1d7d('0x4f');}function isNotPreview(_0x31810f){return _0x31810f!==_0x1d7d('0x20');}function isCampaignIvr(_0x520d3c){return _0x520d3c===_0x1d7d('0x76');}function getCallerId(_0x566d27,_0x1c9fe7,_0x1e3853){if(!_[_0x1d7d('0x3d')](_0x1e3853)&&_0x1d7d('0x83')===typeof _0x1e3853&&!_[_0x1d7d('0x47')](_0x1e3853)){if(!_[_0x1d7d('0x3d')](_0x1c9fe7)&&'string'===typeof _0x1c9fe7&&!_[_0x1d7d('0x47')](_0x1c9fe7)){return util[_0x1d7d('0x84')]('\x22%s\x22\x20<%s>',_0x1c9fe7,_0x1e3853);}return util[_0x1d7d('0x84')]('\x22%s\x22\x20<%s>',_0x1e3853,_0x1e3853);}if(!_[_0x1d7d('0x3d')](_0x566d27)&&_0x1d7d('0x83')===typeof _0x566d27&&!_[_0x1d7d('0x47')](_0x566d27)){return _0x566d27;}return _0x1d7d('0x85');}function loggerCatchQueueSummary(_0x95ae40,_0x1fd6ec){return function(_0x516aa0){freeVariablesPredictive(_0x1fd6ec);emitVoiceQueueSummary(_0x1fd6ec);emitCampaignSummary(_0x1fd6ec);loggerSyncQueueSummary[_0x1d7d('0x86')](_0x95ae40,util[_0x1d7d('0x87')](_0x516aa0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4d69cc,_0x3289c2){return function(_0x3da337){loggerPredictive[_0x1d7d('0x86')](_0x4d69cc,JSON['stringify'](_0x3da337));freeVariablesPredictive(_0x3289c2);};}function loggerCatch(_0x3b3975){return function(_0xe5c3ba){logger[_0x1d7d('0x86')](_0x3b3975,util[_0x1d7d('0x87')](_0xe5c3ba,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5f15b7){return _0x5f15b7&&!_[_0x1d7d('0x3d')](_0x5f15b7)&&_0x5f15b7[_0x1d7d('0x88')]>0x0;}function decremetOriginate(_0x1e25db){if(!_[_0x1d7d('0x3d')](_0x1e25db)&&_0x1e25db!==null){if(_0x1e25db[_0x1d7d('0x89')]('originated')){if(_0x1e25db[_0x1d7d('0x73')]>0x0){_0x1e25db[_0x1d7d('0x73')]-=0x1;}else{logger['error'](_0x1d7d('0x8a'));}}}else{logger[_0x1d7d('0x86')](_0x1d7d('0x8b'));}}function checkContactLowerLimitOriginate(_0x20c900,_0x47d27e,_0x24c0a7){if(_0x47d27e>_0x24c0a7){for(var _0x4a3159=0x0;_0x4a3159<_0x47d27e-_0x24c0a7;_0x4a3159+=0x1){decremetOriginate(_0x20c900);}}}function loggerGetContactDialer(_0x3b93aa,_0x138fc2,_0x30dc64){return function(_0x5e1172){checkContactLowerLimitOriginate(_0x138fc2,_0x30dc64,0x0);logger[_0x1d7d('0x86')](_0x3b93aa,util[_0x1d7d('0x87')](_0x5e1172,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x42befe){return function(_0x55ded9){if(isNotNull(_0x55ded9)&&isNotNull(_0x55ded9[0x0])){if(_0x55ded9[0x0][_0x1d7d('0x8c')]>0x0){_0x42befe['message']=_0x1d7d('0x8d');logger[_0x1d7d('0x7a')](_0x1d7d('0x8e')+_0x42befe[_0x1d7d('0x40')],_0x55ded9[0x0][_0x1d7d('0x8c')],_0x1d7d('0x8f'));}else{_0x42befe[_0x1d7d('0x3e')]=_0x1d7d('0x90');logger[_0x1d7d('0x7a')](_0x1d7d('0x91')+_0x42befe[_0x1d7d('0x40')]);}}};}function notSendMessagesQueue(_0x5494ae){if(_0x5494ae['sendMessageOneNotActive']){freeVariablesPredictive(_0x5494ae);if(_0x5494ae[_0x1d7d('0x73')]===0x0&&_0x5494ae[_0x1d7d('0x92')]===0x0&&_0x5494ae[_0x1d7d('0x93')]===0x0&&(_0x5494ae['pTalking']||0x0)===0x0){_0x5494ae[_0x1d7d('0x94')]=![];_0x5494ae['available']=0x0;_0x5494ae[_0x1d7d('0x3e')]=_0x1d7d('0x42');loggerSyncQueueSummary['error'](_0x1d7d('0x95'),_0x5494ae[_0x1d7d('0x40')],'is\x20not\x20active');}else{_0x5494ae[_0x1d7d('0x3e')]=_0x1d7d('0x96');loggerSyncQueueSummary[_0x1d7d('0x86')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5494ae['name'],_0x1d7d('0x97'));}emitVoiceQueueSummary(_0x5494ae);}}function notSendMessagesCampaign(_0x87e6aa){if(_0x87e6aa['sendMessageOneNotActive']){if(_0x87e6aa[_0x1d7d('0x73')]===0x0){_0x87e6aa[_0x1d7d('0x94')]=![];_0x87e6aa[_0x1d7d('0x3e')]=_0x1d7d('0x42');loggerSyncQueueSummary['error'](_0x1d7d('0x98'),_0x87e6aa[_0x1d7d('0x40')],_0x1d7d('0x99'));}else{_0x87e6aa[_0x1d7d('0x3e')]=_0x1d7d('0x96');loggerSyncQueueSummary[_0x1d7d('0x86')](_0x1d7d('0x98'),_0x87e6aa[_0x1d7d('0x40')],_0x1d7d('0x97'));}emitCampaignSummary(_0x87e6aa);}}function createObjHistory(_0x1ae438,_0xe904e5,_0x2c1699,_0x332171,_0x5c2a92){_0x1ae438[_0x1d7d('0x3e')]=_0x2c1699;var _0x29d9e6=new Action(_0x1ae438,_0xe904e5);var _0x4dd390=new History(_0x29d9e6);_0x4dd390[_0x1d7d('0x9a')]=_0x332171;_0x4dd390[_0x1d7d('0x9b')]=_0x5c2a92;_0x4dd390['endtime']=_0x29d9e6['starttime'];return _0x4dd390;}Dialer['prototype'][_0x1d7d('0x9c')]=function(){var _0x60e32c=this;setInterval(function(){_0x60e32c[_0x1d7d('0x9d')](_0x60e32c[_0x1d7d('0x9e')],'[uniqueid]');_0x60e32c[_0x1d7d('0x9d')](_0x60e32c[_0x1d7d('0x27')],_0x1d7d('0x9f'));},0x32c8);};Dialer[_0x1d7d('0x1b')]['clearZombieChannels']=function(_0x162115,_0xcb5dde){var _0x135910=this;for(var _0x43d3b0 in _0x162115){if(_0x162115[_0x1d7d('0x89')](_0x43d3b0)){this[_0x1d7d('0x1f')]['enqueue'](function(){if(!_[_0x1d7d('0xa0')](_0x162115[_0x43d3b0])){return ami[_0x1d7d('0xa1')]({'action':'status','channel':_0x162115[_0x43d3b0][_0x1d7d('0xa2')]})[_0x1d7d('0xa3')](function(_0x7d394b){if(_0x7d394b['message']===_0x1d7d('0xa4')){setTimeout(function(){if(_0x162115[_0x43d3b0]&&_0x162115[_0x43d3b0]['type']!==_0x1d7d('0x76')){_0x135910[_0x1d7d('0xa5')](_0x135910['voiceQueues'][_0x162115[_0x43d3b0][_0x1d7d('0xa6')]]);logger[_0x1d7d('0x86')](_0x1d7d('0xa7'),_0xcb5dde,_0x43d3b0,_0x162115[_0x43d3b0][_0x1d7d('0xa6')]);delete _0x162115[_0x43d3b0];}if(_0x162115[_0x43d3b0]&&_0x162115[_0x43d3b0][_0x1d7d('0x4e')]===_0x1d7d('0x76')){_0x135910[_0x1d7d('0xa5')](_0x135910[_0x1d7d('0x22')][_0x162115[_0x43d3b0][_0x1d7d('0xa6')]]);logger[_0x1d7d('0x86')](_0x1d7d('0xa8'),_0xcb5dde,_0x43d3b0,_0x162115[_0x43d3b0][_0x1d7d('0xa6')]);delete _0x162115[_0x43d3b0];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0xb061a5){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xab')](_0xb061a5))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xad')]=function(_0x345c54){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopperBlack[_0x1d7d('0xad')](_0x345c54))['catch'](loggerCatch(_0x1d7d('0xae')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xaf')]=function(_0x1258e0){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopperBlack[_0x1d7d('0xaf')](_0x1258e0))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb0')));};Dialer['prototype']['averageHandleTime']=function(_0x5e4340){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopperHistory[_0x1d7d('0xb1')](_0x5e4340))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb2')]=function(_0xfe31ad){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb2')](_0xfe31ad))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb3')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb4')]=function(_0x4c8724,_0x3fefcb,_0x4e1a96,_0x7390f3){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper['getContactDialer'](_0x4c8724,_0x3fefcb,_0x4e1a96,_0x7390f3))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb5')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb6')]=function(_0x38f5b2,_0x78944f,_0x316fde){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb6')](_0x38f5b2,_0x78944f,_0x316fde))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb5')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb7')]=function(_0x1c3363){return BPromise[_0x1d7d('0xa9')]()[_0x1d7d('0xaa')](voiceQueueRt[_0x1d7d('0xb7')](_0x1c3363))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xb8')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xb9')]=function(_0xecfc39){return BPromise['resolve']()[_0x1d7d('0xaa')](cmHopper[_0x1d7d('0xb9')](_0xecfc39))[_0x1d7d('0xa3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x1d7d('0x1b')]['createHistory']=function(_0x5cac4e){return BPromise['resolve']()['then'](cmHopperHistory[_0x1d7d('0xba')](_0x5cac4e))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xbb')));};Dialer['prototype'][_0x1d7d('0xa5')]=function(_0x5df21d){if(!_[_0x1d7d('0x3d')](_0x5df21d)&&_0x5df21d!==null){if(_0x5df21d[_0x1d7d('0x89')](_0x1d7d('0x73'))){if(_0x5df21d[_0x1d7d('0x73')]>0x0){_0x5df21d[_0x1d7d('0x73')]-=0x1;}else{logger[_0x1d7d('0x86')](_0x1d7d('0xbc'));}}}else{logger[_0x1d7d('0x86')](_0x1d7d('0xbd'));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xbe')]=function(_0x49ca58,_0x15a949){var _0x113ded=this;return function(_0x2ebc42){_0x113ded['updateOriginated'](_0x15a949);logger[_0x1d7d('0x86')](_0x49ca58,util[_0x1d7d('0x87')](_0x2ebc42,{'showHidden':![],'depth':null}));};};Dialer[_0x1d7d('0x1b')]['emptyContact']=function(_0x516bc4,_0x1c7702,_0x5e8022){var _0x109277={'state':0x19,'statedesc':_0x1d7d('0xbf')};this['updateOriginated'](_0x1c7702);this[_0x1d7d('0xc0')](_[_0x1d7d('0x7f')](_0x109277,_['pick'](_0x5e8022,[_0x1d7d('0xc1'),_0x1d7d('0xc2'),_0x1d7d('0xc3'),_0x1d7d('0xc4'),'CampaignId'])),'[emptyContact][createHistory]',_0x1d7d('0xc5'));logger[_0x1d7d('0x86')](_0x516bc4);};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc6')]=function(_0x16337c){return _0x16337c===_0x1d7d('0xc7');};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc8')]=function(_0x1189a3){return!_[_0x1d7d('0x3d')](_0x1189a3)&&_0x1189a3&&!_[_0x1d7d('0x3d')](_0x1189a3[_0x1d7d('0x40')])&&!_[_0x1d7d('0x3d')](_0x1189a3[_0x1d7d('0xc9')])&&_0x1189a3[_0x1d7d('0xc9')]&&(this[_0x1d7d('0x24')][util[_0x1d7d('0x84')](_0x1d7d('0xca'),_0x1189a3['name'])][_0x1d7d('0xcb')]===_0x1d7d('0xcc')||this[_0x1d7d('0x24')][util[_0x1d7d('0x84')]('SIP/%s',_0x1189a3[_0x1d7d('0x40')])][_0x1d7d('0xcb')]===_0x1d7d('0xcd'));};Dialer[_0x1d7d('0x1b')]['saveInDb']=function(_0x1d772a,_0x48662a,_0x3eb3da){this[_0x1d7d('0xba')](_0x1d772a)[_0x1d7d('0xa3')](loggerCatch(_0x48662a));this['moveContactManagedDialer'](_0x1d772a)[_0x1d7d('0xa3')](loggerCatch(_0x3eb3da));};Dialer['prototype'][_0x1d7d('0xce')]=function(_0x1c1077){var _0x340e9d=this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];var _0x1ab80c;if(!_['isNil'](_0x1c1077)&&!_[_0x1d7d('0xa0')](_0x1c1077[_0x1d7d('0xcf')])&&!_['isNil'](_0x1c1077[_0x1d7d('0xcf')][_0x1d7d('0xd0')])&&_0x1c1077[_0x1d7d('0xd1')]===_0x1d7d('0xd2')&&_0x340e9d){if(_0x340e9d['type']!=='ivr'&&this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xd5')){delete this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]]);this[_0x1d7d('0x21')][_0x340e9d['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd6')]+=0x1;_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x12;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xd7');_0x1ab80c['membername']=_0x1d7d('0xd8');this['saveInDb'](_0x1ab80c,_0x1d7d('0xd9'),_0x1d7d('0xda'));}if(_0x340e9d['type']!==_0x1d7d('0x76')&&this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xdb')){delete this[_0x1d7d('0x9e')][_0x1c1077['uniqueid']];this[_0x1d7d('0xa5')](this['voiceQueues'][_0x340e9d[_0x1d7d('0xa6')]]);this['voiceQueues'][_0x340e9d['queue']][_0x1d7d('0xdc')]+=0x1;this[_0x1d7d('0x21')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd6')]+=0x1;_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x13;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xdd');_0x1ab80c[_0x1d7d('0xde')]=_0x1d7d('0xd8');_0x1ab80c[_0x1d7d('0xdf')]=!![];this[_0x1d7d('0xc0')](_0x1ab80c,_0x1d7d('0xe0'),'[syncMachine]');}if(_0x340e9d['type']===_0x1d7d('0x76')&&this['campaigns'][_0x340e9d[_0x1d7d('0xa6')]]['dialAMDActive']&&_0x1c1077['value']===_0x1d7d('0xd5')){delete this[_0x1d7d('0x9e')][_0x1c1077[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x22')][_0x340e9d[_0x1d7d('0xa6')]]);_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c[_0x1d7d('0x9a')]=0x12;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xd7');_0x1ab80c['membername']='AMD';this[_0x1d7d('0xc0')](_0x1ab80c,'[syncHangupInAMDIvr][createHistory]',_0x1d7d('0xe2'));}if(_0x340e9d[_0x1d7d('0x4e')]===_0x1d7d('0x76')&&this[_0x1d7d('0x22')][_0x340e9d[_0x1d7d('0xa6')]][_0x1d7d('0xd3')]&&_0x1c1077[_0x1d7d('0xd4')]===_0x1d7d('0xdb')){delete this[_0x1d7d('0x9e')][_0x1c1077[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x22')][_0x340e9d['queue']]);_0x1ab80c=new Hangup(_0x340e9d,_0x1c1077);_0x1ab80c['state']=0x13;_0x1ab80c[_0x1d7d('0x9b')]=_0x1d7d('0xdd');_0x1ab80c[_0x1d7d('0xde')]='AMD';_0x1ab80c['amd']=!![];this[_0x1d7d('0xc0')](_0x1ab80c,_0x1d7d('0xe3'),'[syncMachineIvr]');}}};Dialer[_0x1d7d('0x1b')]['syncHangup']=function(_0x30e5c4){var _0x50ec9f=this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];var _0x44f307=this;var _0x13da70;if(_0x50ec9f&&_0x50ec9f[_0x1d7d('0x4e')]===_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];this['updateOriginated'](this[_0x1d7d('0x22')][_0x50ec9f[_0x1d7d('0xa6')]]);this[_0x1d7d('0x22')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0xe4')]+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);this[_0x1d7d('0xba')](_0x13da70)['catch'](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}if(_0x50ec9f&&_0x50ec9f['type']!==_0x1d7d('0x76')&&isNotNull(this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0xe7')])){delete this['uniqueId'][_0x30e5c4[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this['voiceQueues'][_0x50ec9f['queue']]);this[_0x1d7d('0x21')][_0x50ec9f['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x50ec9f[_0x1d7d('0xa6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);_0x13da70[_0x1d7d('0x9a')]=0x10;_0x13da70[_0x1d7d('0x9b')]='AnswerAGI';_0x13da70['membername']='AGI';this[_0x1d7d('0xba')](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}if(_0x50ec9f&&_0x50ec9f['type']!=='ivr'&&!isNotNull(this[_0x1d7d('0x21')][_0x50ec9f['queue']]['dialQueueProject'])){delete this[_0x1d7d('0x9e')][_0x30e5c4[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]]);this[_0x1d7d('0x21')][_0x50ec9f[_0x1d7d('0xa6')]][_0x1d7d('0x68')]+=0x1;_0x13da70=new Hangup(_0x50ec9f,_0x30e5c4);_0x13da70['state']=0xc;_0x13da70['statedesc']=_0x30e5c4[_0x1d7d('0xe8')];_0x13da70[_0x1d7d('0xde')]=_0x1d7d('0xe9');this['createHistory'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe5')));this['moveContactManagedDialer'](_0x13da70)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xe6')));}};Dialer[_0x1d7d('0x1b')]['syncAgentComplete']=function(_0x5a0f87){var _0x854f68=this[_0x1d7d('0x9e')][_0x5a0f87[_0x1d7d('0xe1')]];var _0x124078=this;if(this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]]){if(_0x854f68&&_0x854f68['type']!==_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x5a0f87['uniqueid']];this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]]['outboundAnswerCallsDay']+=0x1;var _0x5c8d2b=new AgentComplete(_0x854f68,_0x5a0f87);if(_0x5a0f87['reason']===_0x1d7d('0xea')){_0x5c8d2b[_0x1d7d('0xeb')]=this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]][_0x1d7d('0xec')]&&this[_0x1d7d('0x21')][_0x5a0f87[_0x1d7d('0xa6')]][_0x1d7d('0xed')]?moment()[_0x1d7d('0x84')](_0x1d7d('0xee')):undefined;}this[_0x1d7d('0xba')](_0x5c8d2b)[_0x1d7d('0xa3')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x5c8d2b)['catch'](loggerCatch(_0x1d7d('0xef')));}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xf0')]=function(_0x385140){if(this[_0x1d7d('0x21')][_0x385140[_0x1d7d('0xa6')]]){if(this[_0x1d7d('0x9e')][_0x385140[_0x1d7d('0xe1')]]&&this['uniqueId'][_0x385140['uniqueid']]['type']!==_0x1d7d('0x76')){this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x385140[_0x1d7d('0xa6')]]);this['uniqueId'][_0x385140[_0x1d7d('0xe1')]][_0x1d7d('0xf1')]=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xf2')]=function(_0x4c48de){this[_0x1d7d('0xba')](_0x4c48de)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xf3')));this['moveContactManagedDialer'](_0x4c48de)['catch'](loggerCatch(_0x1d7d('0xf4')));};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x30')]=function(_0x532210){var _0x1634be=this['uniqueId'][_0x532210[_0x1d7d('0xe1')]];var _0x4565a0=this;if(this[_0x1d7d('0x21')][_0x532210['queue']]){if(_0x1634be&&_0x1634be['type']!==_0x1d7d('0x76')){delete this[_0x1d7d('0x9e')][_0x532210[_0x1d7d('0xe1')]];this[_0x1d7d('0xa5')](this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]);_0x1634be[_0x1d7d('0xf5')]=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));var _0x32aaf1=new QueueCallerAbandon(_0x1634be,_0x532210);if(getSeconds(_0x1634be[_0x1d7d('0xf5')],_0x1634be['responsetime'])>=_0x1634be[_0x1d7d('0xf6')]){this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]][_0x1d7d('0x6d')]+=0x1;_0x32aaf1['state']=0xa;_0x32aaf1[_0x1d7d('0x9b')]='Drop';_0x32aaf1['dropreason']=_0x1d7d('0xf7');_0x32aaf1[_0x1d7d('0xeb')]=this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]][_0x1d7d('0xec')]?moment()[_0x1d7d('0x84')](_0x1d7d('0xee')):undefined;this[_0x1d7d('0xf2')](_0x32aaf1);}else{this['voiceQueues'][_0x532210[_0x1d7d('0xa6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x1d7d('0x21')][_0x532210[_0x1d7d('0xa6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x32aaf1[_0x1d7d('0x9a')]=0xb;_0x32aaf1[_0x1d7d('0x9b')]=_0x1d7d('0xf8');_0x32aaf1[_0x1d7d('0xf9')]=_0x1d7d('0xfa');this[_0x1d7d('0xf2')](_0x32aaf1);}}}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x37')]=function(_0xc04751){if(this[_0x1d7d('0x27')][_0xc04751[_0x1d7d('0xe1')]]){this[_0x1d7d('0x27')][_0xc04751[_0x1d7d('0xe1')]]['channel']=_0xc04751['channel'];}if(this[_0x1d7d('0x9e')][_0xc04751['uniqueid']]){this['uniqueId'][_0xc04751[_0x1d7d('0xe1')]]['channel']=_0xc04751[_0x1d7d('0xa2')];}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x3a')]=function(_0x53f017){if(strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]===_0x1d7d('0x1a')){if(this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]]&&_[_0x1d7d('0xa0')](this['actions'][_0x53f017[_0x1d7d('0xfb')]]['locked'])&&_0x53f017['status']==='1'&&_0x53f017[_0x1d7d('0xfc')]==='0'){if(this['agents'][_0x53f017[_0x1d7d('0xfd')]]){if(!this[_0x1d7d('0x23')][_0x53f017[_0x1d7d('0xfd')]]['locked']){this['agents'][_0x53f017[_0x1d7d('0xfd')]][_0x1d7d('0xfe')]=!![];this['actions'][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xfe')]=!![];this[_0x1d7d('0x27')][_0x53f017['actionid']]['stateinterface']=_0x53f017[_0x1d7d('0xfd')];}}}}else if((strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x53f017['actionid']][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x53f017[_0x1d7d('0xfb')]]){if(this[_0x1d7d('0x23')][_0x53f017[_0x1d7d('0xfd')]]){this['actions'][_0x53f017['actionid']][_0x1d7d('0xfd')]=_0x53f017[_0x1d7d('0xfd')];if(_['isNil'](this['queueBooked'][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]]['queue']])){this[_0x1d7d('0x2c')][this['actions'][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]=[];}this[_0x1d7d('0x2c')][this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0xff')](_[_0x1d7d('0x7f')](_[_0x1d7d('0x100')](this[_0x1d7d('0x27')][_0x53f017[_0x1d7d('0xfb')]],['idHopper',_0x1d7d('0xfd')]),{'status':_0x53f017[_0x1d7d('0xcb')],'paused':_0x53f017[_0x1d7d('0xfc')]}));}}}};function unlockQueueStatus(_0x53b2b8,_0x4c5fcd){setTimeout(function(){if(_[_0x1d7d('0x3d')](_0x53b2b8[_0x1d7d('0x101')])){loggerBooked['error'](_0x1d7d('0x102'),_0x4c5fcd);}_0x53b2b8[_0x1d7d('0x101')]=!![];loggerBooked[_0x1d7d('0x7a')](_0x1d7d('0x103'),_0x4c5fcd,JSON[_0x1d7d('0x4a')](_[_0x1d7d('0x100')](_0x53b2b8,['name',_0x1d7d('0x101')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5c5d50){var _0x60e91a=this;var _0x4933a3=_0x60e91a[_0x1d7d('0x21')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50['actionid']][_0x1d7d('0xa6')]];if(strategy[this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']]['strategy']]===_0x1d7d('0x1a')){if(this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]&&this['actions'][_0x5c5d50['actionid']][_0x1d7d('0xfd')]){this['preview'][_0x1d7d('0x104')](this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0x105')],this['actions'][_0x5c5d50[_0x1d7d('0xfb')]]['stateinterface'])[_0x1d7d('0xa3')](function(_0xa41bc4){logger[_0x1d7d('0x86')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x1d7d('0x87')](_0xa41bc4,{'showHidden':![],'depth':null}));})[_0x1d7d('0x1e')](function(){_0x60e91a['updateOriginated'](_0x60e91a[_0x1d7d('0x21')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]);_0x60e91a['agents'][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xfd')]]['locked']=![];delete _0x60e91a['actions'][_0x5c5d50[_0x1d7d('0xfb')]];unlockQueueStatus(_0x4933a3);});}else{this['updateOriginated'](this[_0x1d7d('0x21')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']]);this[_0x1d7d('0xb2')]({'active':![],'ContactId':this['actions'][_0x5c5d50[_0x1d7d('0xfb')]]['ContactId'],'ListId':this[_0x1d7d('0x27')][_0x5c5d50['actionid']]['ListId'],'VoiceQueueId':this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xc4')]||undefined,'CampaignId':this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['CampaignId']||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x106')));delete this[_0x1d7d('0x27')][_0x5c5d50['actionid']];unlockQueueStatus(_0x4933a3);}}else if((strategy[this[_0x1d7d('0x21')][this['actions'][_0x5c5d50['actionid']][_0x1d7d('0xa6')]][_0x1d7d('0x50')]]||'rrmemory')===_0x1d7d('0x107')){var _0x34ef9d;if(this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]&&!_[_0x1d7d('0x47')](this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50['actionid']][_0x1d7d('0xa6')]])){if(this[_0x1d7d('0x2d')][_0x60e91a[_0x1d7d('0x27')][_0x5c5d50['actionid']]['queue']]){this['queueBookedRR'][_0x60e91a['actions'][_0x5c5d50['actionid']][_0x1d7d('0xa6')]]=this[_0x1d7d('0x2d')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]?this['queueBookedRR'][this['actions'][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]:this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]]?this['queueBooked'][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x108')]||0x0:0x0;}this[_0x1d7d('0x2c')][this['actions'][_0x5c5d50[_0x1d7d('0xfb')]][_0x1d7d('0xa6')]][_0x1d7d('0x108')]=this[_0x1d7d('0x2d')][this[_0x1d7d('0x27')][_0x5c5d50[_0x1d7d('0xfb')]]['queue']];for(var _0x339603=0x0;_0x339603=0x0?!![]:![];})[_0x1d7d('0xa3')](myreject(_0x2c6533)));}}else{_0x42a2ed[_0x1d7d('0xff')](ami[_0x1d7d('0xa1')]({'action':'command','command':util['format'](_0x1d7d('0x121'),_0x281cd9,!_[_0x1d7d('0x3d')](config[_0x1d7d('0x11d')][_0x16ff17])?_0x16ff17:'')})[_0x1d7d('0xaa')](function(_0x42b2fd){return _0x42b2fd['content'][_0x1d7d('0x124')](_0x1d7d('0x123'))>=0x0?!![]:![];})[_0x1d7d('0xa3')](myreject(_0x2c6533)));}BPromise['all'](_0x42a2ed)[_0x1d7d('0xaa')](function(_0x38e57d){var _0x18b758=_[_0x1d7d('0x125')](_0x38e57d);if(_0x18b758){return _0x1809aa(_0x18b758);}else{_0x5bfad9['message']=_0x1849a7?_0x1d7d('0x126'):_0x1d7d('0x127');return _0x2c6533(msgResponse(_0x1d7d('0x128'),'Failure',_0x1d7d('0x129')+_0x1849a7+'\x20'+_0x512202+_0x1d7d('0x12a')+util[_0x1d7d('0x87')](_0x281cd9,{'showHidden':![],'depth':null})+_0x1d7d('0x12b')+_0x16ff17));}})['catch'](function(_0x565e18){return _0x2c6533(msgResponse(_0x1d7d('0x119'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x565e18)));});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12c')]=function(_0x58bc80){var _0x6fe16d=this;return function(){switch(_0x58bc80['dialMethod']){case _0x1d7d('0x12d'):freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,0x1);break;case'power':freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,_0x58bc80['dialPowerLevel']);break;case _0x1d7d('0x12f'):_0x6fe16d[_0x1d7d('0x12f')](_0x58bc80);break;case'booked':freeVariablesPredictive(_0x58bc80);_0x6fe16d[_0x1d7d('0x12e')](_0x58bc80,0x1);break;default:freeVariablesPredictive(_0x58bc80);logger['error'](_0x1d7d('0x130'),_0x58bc80[_0x1d7d('0x40')],_0x1d7d('0x131'));}};};Dialer[_0x1d7d('0x1b')]['launchHandleIvr']=function(_0x59f5c0){var _0x3e5e37=this;return function(){_0x3e5e37[_0x1d7d('0x132')](_0x59f5c0);};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0xc')]=function(_0x2d0226){var _0x1e4bde=this;if(isNotPreview(_0x2d0226[_0x1d7d('0x5b')])){if(isVoiceQueueOutbound(_0x2d0226[_0x1d7d('0x4e')])&&isActive(_0x2d0226[_0x1d7d('0x133')])){_0x2d0226[_0x1d7d('0x94')]=!![];BPromise[_0x1d7d('0xa9')]()['then'](checkIsLoggedIn(_0x2d0226,_0x2d0226[_0x1d7d('0x134')]))[_0x1d7d('0xaa')](checkIsActive(_0x2d0226,_0x2d0226[_0x1d7d('0x133')]))[_0x1d7d('0xaa')](checkInterval(_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde['checkIsTrunkReachable'](_0x2d0226))['then'](_0x1e4bde[_0x1d7d('0x135')](_0x2d0226[_0x1d7d('0x136')],_0x2d0226['dialTimezone'],_0x2d0226[_0x1d7d('0x40')],_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde['checkIfTimeIntervals'](_0x2d0226[_0x1d7d('0x43')],_0x2d0226['dialTimezone'],_0x2d0226[_0x1d7d('0x40')],_0x2d0226))[_0x1d7d('0xaa')](_0x1e4bde[_0x1d7d('0x12c')](_0x2d0226))['catch'](loggerCatchQueueSummary(_0x1d7d('0x137'),_0x2d0226));}else{notSendMessagesQueue(_0x2d0226);}}else{freeVariablesPredictive(_0x2d0226);}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x114')]=function(){var _0x330db2=this;var _0x354573;for(var _0x10ebe1 in this[_0x1d7d('0x22')]){if(this[_0x1d7d('0x22')][_0x1d7d('0x89')](_0x10ebe1)){_0x354573=this[_0x1d7d('0x22')][_0x10ebe1];if(isCampaignIvr(_0x354573[_0x1d7d('0x4e')])&&isActive(_0x354573[_0x1d7d('0xc9')])){_0x354573[_0x1d7d('0x94')]=!![];BPromise['resolve']()[_0x1d7d('0xaa')](checkIsActive(_0x354573,_0x354573[_0x1d7d('0xc9')]))[_0x1d7d('0xaa')](checkInterval(_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x115')](_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x135')](_0x354573[_0x1d7d('0x136')],_0x354573[_0x1d7d('0x138')],_0x354573['name'],_0x354573))[_0x1d7d('0xaa')](_0x330db2[_0x1d7d('0x139')](_0x354573['Interval'],_0x354573['dialTimezone'],_0x354573[_0x1d7d('0x40')],_0x354573))['then'](_0x330db2[_0x1d7d('0x13a')](_0x354573))[_0x1d7d('0xa3')](loggerCatchQueueSummary(_0x1d7d('0x13b'),_0x354573));}else{notSendMessagesCampaign(_0x354573);}}}};function getCallerIdRandom(_0x443daf,_0x8084b3){var _0x6cb7ea,_0x34479d,_0x1d58ae;if(_0x8084b3<=0x0){_0x8084b3=0x1;}_0x6cb7ea=new RegExp(_0x1d7d('0x13c')+_0x8084b3+'}$');_0x34479d=Math[_0x1d7d('0x13d')](0xa,_0x8084b3-0x1);_0x1d58ae=Math[_0x1d7d('0x13d')](0xa,_0x8084b3)-0x1;return util[_0x1d7d('0x84')]('%s',_[_0x1d7d('0x13e')](_0x443daf,_0x6cb7ea,_[_0x1d7d('0x13f')](_0x34479d,_0x1d58ae)));}function extractCalleridName(_0x2d3060){var _0x1925fc=_0x2d3060[_0x1d7d('0x140')](/"(.*?)"/);return _0x1925fc?_0x1925fc[0x1]:_0x2d3060;}function extractCalleridNumber(_0x1e32f3){var _0x39499c=_0x1e32f3[_0x1d7d('0x140')](/<(.*?)>/);return _0x39499c?_0x39499c[0x1]:_0x1e32f3;}Dialer['prototype']['actionOriginate']=function(_0x366121,_0x59915c){var _0x5dc582=this;var _0x4d8064=uuid['v4']();this[_0x1d7d('0x27')][_0x4d8064]=new Action(_0x366121,_0x59915c,_0x4d8064);return new BPromise(function(_0x2369e9,_0x41832e){if(_[_0x1d7d('0x3d')](_0x366121)&&'object'!==typeof _0x366121){return _0x41832e(msgResponse(_0x1d7d('0x141'),'Failure',_0x1d7d('0x142')));}if(_['isUndefined'](_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')])||_0x59915c['Contact'][_0x1d7d('0x144')]===null){return _0x41832e(msgResponse('originate',_0x1d7d('0x11a'),_0x1d7d('0x145')));}var _0x4e0622={'XMD-CALLERID':_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['getCaller'](),'XMD-AGI':_0x366121[_0x1d7d('0xe7')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x366121[_0x1d7d('0xe7')]):_0x1d7d('0x146'),'XMD-AGIAFTER':_0x366121[_0x1d7d('0xec')]?util[_0x1d7d('0x84')](_0x1d7d('0x147'),ipAgi,_0x366121[_0x1d7d('0xec')]):'NONE','XMD-QUEUE':_0x366121[_0x1d7d('0x4e')]==='outbound'?util['format']('\x22%s,%s%s,,,%s\x22',_0x366121[_0x1d7d('0x40')],_0x366121['dialQueueOptions']||'',_0x366121['dialAgiAfterHangupAgent']?'c':'',_0x366121['dialQueueTimeout']||0x3):_0x1d7d('0x146'),'XMD-CONTACTID':_0x59915c['ContactId'],'XMD-CDRTYPE':_0x1d7d('0x9'),'CALLERID(all)':_0x5dc582[_0x1d7d('0x27')][_0x4d8064][_0x1d7d('0x148')](),'XMD-AMD':_0x366121[_0x1d7d('0xd3')]?_0x1d7d('0x149'):_0x1d7d('0x146'),'XMD-DESTINATION':_0x1d7d('0xd2')};if(_0x366121['dialAMDActive']){_0x4e0622[_0x1d7d('0x14a')]=_0x366121['dialAMDInitialSilence']||0x9c4;_0x4e0622[_0x1d7d('0x14b')]=_0x366121[_0x1d7d('0x14c')]||0x5dc;_0x4e0622['XMD-AMDAFTERGREETINGSILENCE']=_0x366121['dialAMDAfterGreetingSilence']||0x320;_0x4e0622[_0x1d7d('0x14d')]=_0x366121['dialAMDTotalAnalysisTime']||0x1388;_0x4e0622['XMD-AMDMINWORDLENGTH']=_0x366121[_0x1d7d('0x14e')]||0x64;_0x4e0622[_0x1d7d('0x14f')]=_0x366121[_0x1d7d('0x150')]||0x32;_0x4e0622[_0x1d7d('0x151')]=_0x366121[_0x1d7d('0x152')]||0x3;_0x4e0622[_0x1d7d('0x153')]=_0x366121['dialAMDSilenceThreshold']||0x100;_0x4e0622[_0x1d7d('0x154')]=_0x366121['dialAMDMaximumWordLength']||0x1388;}if(_0x366121['type']===_0x1d7d('0x4f')){_0x4e0622[_0x1d7d('0x155')]=_0x59915c[_0x1d7d('0xc4')];}else{_0x4e0622[_0x1d7d('0x156')]=_0x59915c['CampaignId'];}for(var _0x36ede0 in _0x59915c[_0x1d7d('0x143')]){if(_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x89')](_0x36ede0)){if(isNotNull(_0x59915c['Contact'][_0x36ede0])&&_0x36ede0!=='id'&&_0x36ede0!==_0x1d7d('0x157')&&_0x36ede0!==_0x1d7d('0x158')&&_0x36ede0!==_0x1d7d('0x159')){_0x4e0622[util[_0x1d7d('0x84')]('%s%s',_0x1d7d('0x15a'),_['toUpper'](_0x36ede0))]=_0x59915c[_0x1d7d('0x143')][_0x36ede0];}}}var _0x3f3f5a=_0x5dc582[_0x1d7d('0xc8')](_0x366121['Trunk'])?getCallerId(_0x366121[_0x1d7d('0x74')][_0x1d7d('0x15b')],_0x366121[_0x1d7d('0x5c')],_0x366121[_0x1d7d('0x15c')]>0x0?getCallerIdRandom(_0x366121[_0x1d7d('0x5d')],_0x366121[_0x1d7d('0x15c')]):_0x366121[_0x1d7d('0x5d')]):getCallerId(_[_0x1d7d('0xa0')](_0x366121[_0x1d7d('0x116')])?_0x366121[_0x1d7d('0x74')][_0x1d7d('0x15b')]:_0x366121[_0x1d7d('0x116')][_0x1d7d('0x15b')],_0x366121[_0x1d7d('0x5c')],_0x366121[_0x1d7d('0x15c')]>0x0?getCallerIdRandom(_0x366121[_0x1d7d('0x5d')],_0x366121[_0x1d7d('0x15c')]):_0x366121[_0x1d7d('0x5d')]);if(_0x3f3f5a){_0x4e0622[_0x1d7d('0x15d')]=_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['originatecalleridname']=extractCalleridName(_0x3f3f5a);_0x4e0622[_0x1d7d('0x15e')]=_0x5dc582[_0x1d7d('0x27')][_0x4d8064]['originatecalleridnum']=extractCalleridNumber(_0x3f3f5a);}return ami[_0x1d7d('0xa1')]({'actionid':_0x4d8064,'action':_0x1d7d('0x141'),'channel':_0x5dc582[_0x1d7d('0xc8')](_0x366121[_0x1d7d('0x74')])?util['format']('SIP/%s/%s%s',_0x366121[_0x1d7d('0x74')][_0x1d7d('0x40')],isNotNull(_0x366121[_0x1d7d('0x5f')])?_0x366121['dialPrefix'][_0x1d7d('0x15f')]()||'':'',_0x366121[_0x1d7d('0x160')]>0x0?_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')][_0x1d7d('0x161')](_0x366121[_0x1d7d('0x160')]):_0x59915c[_0x1d7d('0x143')]['phone']):util[_0x1d7d('0x84')](_0x1d7d('0x162'),_['isNil'](_0x366121[_0x1d7d('0x116')])?_0x366121[_0x1d7d('0x74')][_0x1d7d('0x40')]:_0x366121[_0x1d7d('0x116')]['name'],isNotNull(_0x366121[_0x1d7d('0x5f')])?_0x366121[_0x1d7d('0x5f')][_0x1d7d('0x15f')]()||'':'',_0x366121['dialCutDigit']>0x0?_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')]['substring'](_0x366121[_0x1d7d('0x160')]):_0x59915c[_0x1d7d('0x143')][_0x1d7d('0x144')]),'callerid':_0x3f3f5a,'Exten':'xcally-motion-dialer','Context':_0x1d7d('0x163'),'Priority':'1','variable':_0x4e0622,'timeout':(_0x366121[_0x1d7d('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d8064})[_0x1d7d('0xaa')](function(_0x1d7d8a){return _0x2369e9(_0x1d7d8a);})[_0x1d7d('0xa3')](function(_0x49ec3d){_0x366121[_0x1d7d('0x65')]+=0x1;var _0x65e69f=new History(_0x5dc582[_0x1d7d('0x27')][_0x4d8064]);logger[_0x1d7d('0x86')](util[_0x1d7d('0x84')](_0x1d7d('0x164'),JSON[_0x1d7d('0x4a')](_0x49ec3d)));_0x65e69f['state']=0xe;_0x65e69f['statedesc']=_0x1d7d('0x165');_0x65e69f[_0x1d7d('0x166')]=moment()[_0x1d7d('0x84')]('YYYY-MM-DD\x20HH:mm:ss');_0x65e69f['endtime']=_0x65e69f[_0x1d7d('0x166')];_0x5dc582[_0x1d7d('0xba')](_0x65e69f)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x167')));_0x5dc582['moveContactManagedDialer'](_0x65e69f)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x167')))[_0x1d7d('0x1e')](function(){delete _0x5dc582[_0x1d7d('0x27')][_0x4d8064];return _0x41832e(msgResponse(_0x1d7d('0x141'),_0x1d7d('0x49'),_0x1d7d('0x168')));});});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x32')]=function(_0xa7de2){var _0xa65657=this[_0x1d7d('0x27')][_0xa7de2['actionid']];var _0x3dce57=this;if(_0xa65657){delete this['actions'][_0xa7de2['actionid']];_0xa65657[_0x1d7d('0x169')]=moment()[_0x1d7d('0x84')]('YYYY-MM-DD\x20HH:mm:ss');var _0x10b69f=_0xa65657[_0x1d7d('0x4e')]===_0x1d7d('0x76')?this[_0x1d7d('0x22')][_0xa65657[_0x1d7d('0xa6')]]:this[_0x1d7d('0x21')][_0xa65657[_0x1d7d('0x16a')]()];if(!this['isSuccess'](_0xa7de2['response'])){this[_0x1d7d('0xa5')](_0x10b69f);return this[_0x1d7d('0x16b')](_0xa65657,_0x10b69f,_0xa7de2)['then'](function(_0x3f250a){})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x16c')));}else{this[_0x1d7d('0x9e')][_0xa7de2[_0x1d7d('0xe1')]]=_0xa65657;}}};Dialer['prototype']['checkRetriveMax']=function(_0x1418cd,_0x4fd72f,_0x1aad46){var _0x2c2753=new History(_0x4fd72f);if(_0x2c2753[_0x1d7d('0x16d')]+_0x2c2753[_0x1d7d('0x16e')]+_0x2c2753['countnoanswerretry']>=_0x1aad46[_0x1d7d('0x16f')]-0x1){return!![];}switch(_0x1418cd){case 0x3:if(_0x2c2753[_0x1d7d('0x170')]>=_0x1aad46[_0x1d7d('0x171')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2c2753['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1aad46['dialNoAnswerRetryFrequency'],_0x1d7d('0x172'))[_0x1d7d('0x84')](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})['catch'](loggerCatch(_0x1d7d('0x173')));}break;case 0x5:if(_0x2c2753[_0x1d7d('0x16d')]>=_0x1aad46[_0x1d7d('0x174')]-0x1){return!![];}else{this[_0x1d7d('0xb2')]({'active':![],'countbusyretry':_0x2c2753['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x1aad46[_0x1d7d('0x175')],_0x1d7d('0x172'))['format'](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})['catch'](loggerCatch(_0x1d7d('0x176')));}break;case 0x8:if(_0x2c2753['countcongestionretry']>=_0x1aad46['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x2c2753[_0x1d7d('0x16e')]+=0x1,'scheduledat':moment()[_0x1d7d('0x177')](_0x1aad46['dialCongestionRetryFrequency'],'minutes')[_0x1d7d('0x84')](_0x1d7d('0xee')),'ContactId':_0x2c2753[_0x1d7d('0xc1')],'ListId':_0x2c2753[_0x1d7d('0xc2')],'VoiceQueueId':_0x2c2753[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x2c2753[_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x16b')]=function(_0xee3f88,_0x33e533,_0x48c075){var _0x805334=this;var _0x460bda=new History(_0xee3f88);return new BPromise(function(_0x368729,_0x406fca){if(_['isUndefined'](_0x33e533)&&_0x1d7d('0x178')!==typeof _0x33e533){return _0x406fca(msgResponse(_0x1d7d('0x179'),'Failure',_0x1d7d('0x17a')));}if(_[_0x1d7d('0x3d')](_0x48c075)&&_0x1d7d('0x178')!==typeof _0x48c075){return _0x406fca(msgResponse(_0x1d7d('0x179'),_0x1d7d('0x11a'),_0x1d7d('0x17b')));}switch(_0x48c075[_0x1d7d('0x17c')]){case'0':_0x33e533[_0x1d7d('0x64')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x0;_0x460bda['statedesc']=_0x1d7d('0x17d');_0x805334[_0x1d7d('0xba')](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x17e')));if(_0x805334[_0x1d7d('0x17f')](0x0,_0xee3f88,_0x33e533)){if(_0x460bda['countbusyretry']+_0x460bda['countcongestionretry']+_0x460bda['countnoanswerretry']>=_0x33e533[_0x1d7d('0x16f')]){_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x181'));}else{_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x33e533[_0x1d7d('0x183')]+=0x1;_0x460bda['state']=0x3;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x184');_0x460bda[_0x1d7d('0x170')]+=0x1;_0x460bda[_0x1d7d('0x185')]+=0x1;_0x805334['createHistory'](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x186')));if(_0x805334[_0x1d7d('0x17f')](0x3,_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x170')]>=_0x33e533['dialNoAnswerMaxRetry']){_0x805334['createStateFinal'](_0x460bda,_0x368729,_0x406fca,'reason\x203\x20ringing\x20no\x20answer');}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x187'));}}break;case'5':_0x33e533[_0x1d7d('0x61')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x5;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x188');_0x460bda[_0x1d7d('0x16d')]+=0x1;_0x460bda['countglobal']+=0x1;_0x805334[_0x1d7d('0xba')](_0x460bda)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x805334['checkRetriveMax'](0x5,_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x16d')]>=_0x33e533[_0x1d7d('0x174')]){_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x189'));}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,'reason\x205\x20busy');}}break;case'8':_0x33e533[_0x1d7d('0x62')]+=0x1;_0x460bda[_0x1d7d('0x9a')]=0x8;_0x460bda[_0x1d7d('0x9b')]=_0x1d7d('0x18a');_0x460bda[_0x1d7d('0x16e')]+=0x1;_0x460bda[_0x1d7d('0x185')]+=0x1;_0x805334[_0x1d7d('0xba')](_0x460bda)[_0x1d7d('0xa3')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x805334['checkRetriveMax'](0x8,_0xee3f88,_0x33e533)){if(_0x460bda['countcongestionretry']>=_0x33e533[_0x1d7d('0x18b')]){_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x1d7d('0x18c'));}else{_0x805334[_0x1d7d('0x180')](_0x460bda,_0x368729,_0x406fca,'reason\x208\x20congestion');}}break;default:_0x33e533[_0x1d7d('0x68')]+=0x1;_0x460bda['state']=0xc;_0x460bda[_0x1d7d('0x9b')]=_0x48c075[_0x1d7d('0x17c')];_0x805334['createHistory'](_0x460bda)[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x18d')));if(_0x805334[_0x1d7d('0x17f')](_0x48c075[_0x1d7d('0x17c')],_0xee3f88,_0x33e533)){if(_0x460bda[_0x1d7d('0x16d')]+_0x460bda[_0x1d7d('0x16e')]+_0x460bda['countnoanswerretry']>=_0x33e533['dialGlobalMaxRetry']){_0x805334['stateGlobal'](_0x460bda,_0x368729,_0x406fca,_0x48c075[_0x1d7d('0x17c')]);}else{_0x805334[_0x1d7d('0x182')](_0x460bda,_0x368729,_0x406fca,_0x48c075[_0x1d7d('0x17c')]);}}}});};Dialer[_0x1d7d('0x1b')]['stateGlobal']=function(_0xe3c986,_0x418952,_0x8da0fb,_0x3b3b62){var _0x55e592=new Final(_0xe3c986);_0x55e592[_0x1d7d('0x9a')]=0xf;_0x55e592[_0x1d7d('0x9b')]=_0x1d7d('0x18e');this['createStateFinal'](_0x55e592,_0x418952,_0x8da0fb,_0x3b3b62);};Dialer['prototype'][_0x1d7d('0x182')]=function(_0x1c7021,_0x2cb9d1,_0x2c5fd6,_0x3f0a1a){this[_0x1d7d('0xb9')](_0x1c7021)[_0x1d7d('0xaa')](function(_0x17f68c){return _0x2cb9d1(msgResponse('[callProgressDetecting]',_0x1d7d('0xc7'),_0x3f0a1a));})[_0x1d7d('0xa3')](function(_0xe306ed){return _0x2c5fd6(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12f')]=function(_0x46e349){var _0x4c2a5b=this;var _0xb5e224=_0x46e349[_0x1d7d('0x18f')]/0x64;var _0x4a2e1e=_0x46e349[_0x1d7d('0x63')]/(_0x46e349[_0x1d7d('0x63')]+_0x46e349['outboundAnswerCallsDay']);var _0x57cb2a=_0x46e349[_0x1d7d('0x134')]-_0x46e349[_0x1d7d('0x71')]-_0x46e349[_0x1d7d('0x93')]-_0x46e349[_0x1d7d('0x73')]-_0x46e349['talking'];var _0x409660=(_0x46e349[_0x1d7d('0x134')]-_0x46e349[_0x1d7d('0x71')])*_0x46e349['predictiveIntervalLowerLimit'];var _0x4976e1=Math[_0x1d7d('0x190')](_0x46e349[_0x1d7d('0x191')]*_0x46e349[_0x1d7d('0x192')]*_0x46e349['predictiveIntervalHitRate']*_0x46e349[_0x1d7d('0x70')]);if(_[_0x1d7d('0x3d')](_0x46e349['startProgressive'])){loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x193'));if(!_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2a')])){_0x46e349[_0x1d7d('0x2a')]=undefined;loggerPredictive[_0x1d7d('0x86')](_0x1d7d('0x194'),_0x1d7d('0x195'));}if(!_['isUndefined'](_0x46e349[_0x1d7d('0x82')])){loggerPredictive[_0x1d7d('0x86')](_0x1d7d('0x194'),_0x1d7d('0x196'));clearInterval(_0x46e349[_0x1d7d('0x82')]);_0x46e349[_0x1d7d('0x82')]=undefined;}_0x46e349['startProgressive']=moment()['format'](_0x1d7d('0xee'));loggerPredictive[_0x1d7d('0x7a')]('[startMethodPredictive][StartProgressive][Date]',_0x46e349[_0x1d7d('0x2b')],_0x46e349[_0x1d7d('0x40')]);this[_0x1d7d('0x12e')](_0x46e349,0x1);}else if(ifInterval(_0x46e349[_0x1d7d('0x197')],_0x46e349[_0x1d7d('0x2b')])){this['handlePower'](_0x46e349,0x1);loggerPredictiveCalls[_0x1d7d('0x7a')]('[startMethodPredictive][StartProgressive][Loop]',_0x46e349[_0x1d7d('0x2b')],_0x46e349[_0x1d7d('0x40')]);_0x46e349['erlangCalls']=0x0;_0x46e349[_0x1d7d('0x6d')]=0x0;}else if(_0xb5e224<_0x4a2e1e&&_0x46e349[_0x1d7d('0x198')]===_0x1d7d('0x199')){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1d7d('0x19a'),_0x4a2e1e,_0x1d7d('0x2b'),_0x46e349[_0x1d7d('0x40')]);}else if(_0x57cb2a>_0x409660){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x19b'),_0x1d7d('0x19c'),_0x57cb2a,'agent\x20max\x20free\x20',_0x409660);}else if(_0x4976e1<_0x46e349[_0x1d7d('0x6d')]&&_0x46e349[_0x1d7d('0x198')]===_0x1d7d('0x199')){freeVariablesPredictive(_0x46e349);loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x19d'),_0x1d7d('0x19e'),_0x4976e1,_0x1d7d('0x19f'),_0x46e349[_0x1d7d('0x6d')],'startProgressive',_0x46e349[_0x1d7d('0x40')]);}else if(!ifInterval(_0x46e349['dialPredictiveInterval'],_0x46e349[_0x1d7d('0x2b')])&&_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2a')])&&!_[_0x1d7d('0x3d')](_0x46e349[_0x1d7d('0x2b')])){_0x46e349['startPredictive']=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));loggerPredictive['info'](_0x1d7d('0x1a0'),_0x46e349[_0x1d7d('0x2a')],_0x46e349['name']);this[_0x1d7d('0x1a1')](_0x46e349[_0x1d7d('0x197')])[_0x1d7d('0xaa')](this['getDataPredictive'](_0x46e349))[_0x1d7d('0xaa')](mergeDataErlangB(_0x46e349))[_0x1d7d('0xaa')](this[_0x1d7d('0x1a2')](_0x46e349))[_0x1d7d('0xa3')](loggerCatchPredictive(_0x1d7d('0x1a3'),_0x46e349));}else if(!ifInterval(_0x46e349[_0x1d7d('0x197')],_0x46e349[_0x1d7d('0x2a')])){_0x46e349[_0x1d7d('0x6d')]=0x0;_0x46e349['startPredictive']=moment()[_0x1d7d('0x84')](_0x1d7d('0xee'));loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x1a4'),_0x46e349[_0x1d7d('0x2a')],_0x46e349[_0x1d7d('0x40')]);clearInterval(_0x46e349[_0x1d7d('0x82')]);_0x46e349[_0x1d7d('0x82')]=undefined;this[_0x1d7d('0x1a1')](_0x46e349[_0x1d7d('0x197')])[_0x1d7d('0xaa')](this[_0x1d7d('0x1a5')](_0x46e349))['then'](mergeDataErlangB(_0x46e349))[_0x1d7d('0xaa')](this[_0x1d7d('0x1a2')](_0x46e349))[_0x1d7d('0xa3')](loggerCatchPredictive(_0x1d7d('0x1a3'),_0x46e349));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1a5')]=function(_0x1c929c){var _0x4136ed=this;return function(_0x53d0db){return new BPromise(function(_0x5baf23,_0x2101e4){_[_0x1d7d('0x7f')](_0x1c929c,_0x53d0db[0x0]);if(checkGetDataPredictive(_0x53d0db[0x0])){loggerPredictive[_0x1d7d('0x7a')](JSON[_0x1d7d('0x4a')](_0x53d0db[0x0]));if(_0x1c929c[_0x1d7d('0x198')]===_0x1d7d('0x199')){return _0x4136ed[_0x1d7d('0xb7')](_0x1c929c['id'])[_0x1d7d('0xaa')](function(_0x9fdc91){var _0x290996=_0x1c929c[_0x1d7d('0x134')]-_0x9fdc91[0x0][_0x1d7d('0x1a6')];var _0x22da89=_0x1c929c[_0x1d7d('0x197')]*0x3c;var _0x5d087c=_0x53d0db[0x0][_0x1d7d('0x79')]+_0x53d0db[0x0][_0x1d7d('0x6a')];var _0x31180c=(_0x53d0db[0x0][_0x1d7d('0x69')]+_0x53d0db[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x53d0db[0x0][_0x1d7d('0x6b')])/_0x53d0db[0x0][_0x1d7d('0x72')];var _0x14748e=_0x1c929c['dialPredictiveOptimizationPercentage']/0x64;_0x1c929c[_0x1d7d('0x71')]=_0x9fdc91[0x0]['outboundQueuePauses']||0x0;_0x1c929c[_0x1d7d('0x6e')]=_0x31180c>0x0?_0x31180c:0x1;return _0x4136ed[_0x1d7d('0x1a7')](_0x290996,_0x22da89,_0x5d087c,_0x31180c,_0x14748e);})[_0x1d7d('0xaa')](function(_0x2f657f){return _0x5baf23(_0x2f657f);})['catch'](function(_0x5b373e){return _0x2101e4(msgResponse(_0x1d7d('0x1a8'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x5b373e)));});}if(_0x1c929c[_0x1d7d('0x198')]===_0x1d7d('0x1a9')){return _0x4136ed[_0x1d7d('0xb7')](_0x1c929c['id'])[_0x1d7d('0xaa')](function(_0x4d8172){var _0x597cf7=_0x1c929c[_0x1d7d('0x134')]-_0x4d8172[0x0][_0x1d7d('0x1a6')];var _0x36b7cc=_0x1c929c[_0x1d7d('0x197')]*0x3c;var _0x12b1a9=_0x53d0db[0x0][_0x1d7d('0x79')]+_0x53d0db[0x0]['predictiveIntervalAvgHoldtime'];var _0x31e71f=(_0x53d0db[0x0][_0x1d7d('0x69')]+_0x53d0db[0x0][_0x1d7d('0x6c')]+_0x53d0db[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x53d0db[0x0]['predictiveIntervalTotalCalls'];var _0x5e504c=_0x1c929c[_0x1d7d('0x18f')]/0x64;_0x1c929c['predictiveIntervalPauses']=_0x4d8172[0x0][_0x1d7d('0x1a6')]||0x0;_0x1c929c[_0x1d7d('0x6e')]=_0x31e71f>0x0?_0x31e71f:0x1;return _0x4136ed[_0x1d7d('0x1aa')](_0x597cf7,_0x36b7cc,_0x12b1a9,_0x31e71f,_0x5e504c);})[_0x1d7d('0xaa')](function(_0x3aa903){return _0x5baf23(_0x3aa903);})[_0x1d7d('0xa3')](function(_0x33992a){return _0x2101e4(msgResponse(_0x1d7d('0x1a8'),_0x1d7d('0x11a'),JSON[_0x1d7d('0x4a')](_0x33992a)));});}}else{return _0x2101e4(msgResponse(_0x1d7d('0x1ab'),_0x1d7d('0x11a'),'check\x20failure'));}});};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1a2')]=function(_0x3e91f1){var _0xfab80d=this;return function(){var _0x4563c0=0x0;var _0xcff882=Math[_0x1d7d('0x190')](_0x3e91f1['erlangCallToSecond']*0x3e8);if(_0xcff882>0x0){_0xcff882=_0xcff882<0x64?0x64:_0xcff882;loggerPredictive[_0x1d7d('0x7a')](_0x1d7d('0x1ac'),_0xcff882);_0x3e91f1[_0x1d7d('0x82')]=setInterval(function(){_0xfab80d[_0x1d7d('0x82')](_0x3e91f1);loggerPredictiveCalls['info'](_0x1d7d('0x1ad'),_0x4563c0+=0x1);},_0xcff882);}else{loggerPredictive['info']('[startMethodPredictive][milliseconds]\x20',_0x1d7d('0x1ae'),_0xcff882);}};};Dialer[_0x1d7d('0x1b')]['checkContactBlack']=function(_0x298128,_0x530dda){var _0x5f5531=this;return function(_0x84457b){if(_[_0x1d7d('0x47')](_0x84457b)){if(_[_0x1d7d('0xa0')](_0x530dda[_0x1d7d('0xc3')])||!_0x530dda[_0x1d7d('0x1af')]){if(_0x298128['dialMethod']===_0x1d7d('0xa')){_0x298128[_0x1d7d('0x101')]=_[_0x1d7d('0x3d')](_0x298128['queueStatusComplete'])?!![]:_0x298128[_0x1d7d('0x101')];var _0x1e23b9=uuid['v4']();_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]=new Action(_0x298128,_0x530dda,_0x1e23b9);loggerBooked[_0x1d7d('0x7a')]('[booked][checkContactBlack]',_0x1e23b9,'queueStatusComplete:\x20',JSON[_0x1d7d('0x4a')](_0x298128[_0x1d7d('0x101')]),_0x1d7d('0x1b0'),_0x298128[_0x1d7d('0x40')]);if(_0x298128[_0x1d7d('0x101')]){_0x298128['queueStatusComplete']=![];_0x5f5531[_0x1d7d('0x2c')][_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xa6')]]=[];ami[_0x1d7d('0xa1')]({'actionid':_0x1e23b9,'action':'queuestatus','queue':_0x298128[_0x1d7d('0x40')]})[_0x1d7d('0xa3')](function(_0x3b472b){_0x5f5531[_0x1d7d('0xa5')](_0x298128);_0x5f5531[_0x1d7d('0xb2')]({'active':![],'ContactId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ContactId'],'ListId':_0x5f5531['actions'][_0x1e23b9][_0x1d7d('0xc2')],'VoiceQueueId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xc4')]||undefined,'CampaignId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5f5531[_0x1d7d('0x27')][_0x1e23b9];});}else{loggerBooked['info'](_0x1d7d('0x1b1'),JSON[_0x1d7d('0x4a')](_0x298128['queueStatusComplete']),_0x1d7d('0x1b0'),_0x298128[_0x1d7d('0x40')]);_0x5f5531[_0x1d7d('0xa5')](_0x298128);_0x5f5531[_0x1d7d('0xb2')]({'active':![],'ContactId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ContactId'],'ListId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9]['ListId'],'VoiceQueueId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0xc4')]||undefined,'CampaignId':_0x5f5531[_0x1d7d('0x27')][_0x1e23b9][_0x1d7d('0x10f')]||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x1b2')));delete _0x5f5531['actions'][_0x1e23b9];}}else{return _0x5f5531[_0x1d7d('0x1b3')](_0x298128,_0x530dda);}}else{if(getDiff(_0x530dda[_0x1d7d('0x1b4')])<_0x298128[_0x1d7d('0x1b5')]*0x3c){_0x5f5531['preview'][_0x1d7d('0x104')](_0x530dda['id'])[_0x1d7d('0x1e')](function(){_0x5f5531[_0x1d7d('0xa5')](_0x298128);});}else{_0x298128[_0x1d7d('0x66')]+=0x1;_0x5f5531['updateOriginated'](_0x298128);if(_0x298128[_0x1d7d('0x1b6')]){_0x5f5531['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x530dda[_0x1d7d('0xc1')],'ListId':_0x530dda[_0x1d7d('0xc2')],'VoiceQueueId':_0x530dda[_0x1d7d('0xc4')]||undefined,'CampaignId':_0x530dda['CampaignId']||undefined})[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0x1b7')));_0x5f5531[_0x1d7d('0xba')](createObjHistory(_0x298128,_0x530dda,'RECALLINQUEUE',0x17,_0x1d7d('0x1b8')))['catch'](loggerCatch(_0x1d7d('0x1b9')));}else{_0x5f5531[_0x1d7d('0xc0')](createObjHistory(_0x298128,_0x530dda,_0x1d7d('0x1ba'),0x16,'RecallFailedTimeout'),_0x1d7d('0x1bb'),'[Originate][HistoryRecallClose]');}}}}else{_0x298128['outboundBlacklistCallsDay']+=0x1;_0x5f5531[_0x1d7d('0xc0')](createObjHistory(_0x298128,_0x530dda,'BLACKLIST',0xd,'Blacklist'),_0x1d7d('0x1bc'),_0x1d7d('0x1bd'));throw'inBlackList';}};};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x132')]=function(_0x4e0026){var _0x768888=this;var _0x308d0e=[];var _0x242ba5=_0x4e0026['limitCalls']-_0x4e0026[_0x1d7d('0x73')]-_0x4e0026[_0x1d7d('0x1be')];emitCampaignSummary(_0x4e0026);if(_0x242ba5>0x0){if(_0x242ba5>this[_0x1d7d('0x25')]){_0x242ba5=this[_0x1d7d('0x25')];}_0x4e0026[_0x1d7d('0x1be')]+=_0x242ba5;this[_0x1d7d('0xb6')](_0x4e0026['id'],_0x242ba5,_0x4e0026[_0x1d7d('0x1bf')])['then'](function(_0x502632){_0x4e0026['temp']-=_0x242ba5;_0x4e0026[_0x1d7d('0x1be')]=_0x4e0026['temp']>0x0?_0x4e0026[_0x1d7d('0x1be')]:0x0;if(!checkContactEmpty(_0x502632)){_0x4e0026[_0x1d7d('0x3e')]=_0x1d7d('0x90');logger['info']('[getContactCampaign2][Empty]'+_0x4e0026[_0x1d7d('0x40')]);}else{_0x4e0026['originated']+=_0x502632['length'];_0x4e0026['message']=_0x1d7d('0x1c0');for(var _0x4bae63=0x0;_0x4bae63<_0x502632[_0x1d7d('0x88')];_0x4bae63+=0x1){_0x4e0026[_0x1d7d('0x1c1')]+=0x1;if(_[_0x1d7d('0xa0')](_0x502632[_0x4bae63])||_[_0x1d7d('0xa0')](_0x502632[_0x4bae63][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x502632[_0x4bae63][_0x1d7d('0x143')][_0x1d7d('0x144')])){_0x768888[_0x1d7d('0x1c2')](_0x1d7d('0x1c3'),_0x4e0026,_0x502632[_0x4bae63]);}else{_0x768888['checkIsBlackListIvr'](_['pick'](_0x502632[_0x4bae63],['CampaignId',_0x1d7d('0x1c4')]))['then'](_0x768888[_0x1d7d('0x1c5')](_0x4e0026,_0x502632[_0x4bae63]))[_0x1d7d('0xa3')](_0x768888['loggerHandler'](_0x1d7d('0x1c6'),_0x4e0026));}}}})['catch'](loggerGetContactDialer(_0x1d7d('0x1c7'),_0x4e0026,_0x242ba5));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x12e')]=function(_0x4750e3,_0x5d2ae5){var _0x346067=this;var _0x4bcccf=[];var _0x258b83=_0x5d2ae5>=0x1?_0x5d2ae5:0x1;var _0xef5c6f=[];if(_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')){_0x258b83=0x1;}var _0x1e9726=Math[_0x1d7d('0x190')](_0x4750e3[_0x1d7d('0x52')]*_0x258b83)-_0x4750e3[_0x1d7d('0x73')]-_0x4750e3[_0x1d7d('0x1be')];emitVoiceQueueSummary(_0x4750e3);if(_0x4750e3[_0x1d7d('0x1c8')]>0x0){var _0xf1054=_0x4750e3['dialLimitQueue']-_0x4750e3[_0x1d7d('0x73')]-_0x4750e3[_0x1d7d('0x92')]-_0x4750e3['temp']-_0x4750e3[_0x1d7d('0x53')];if(_0x1e9726>_0xf1054){_0x1e9726=_0xf1054;}}if(_0x1e9726>0x0){if(_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')){_0x1e9726=0x1;}if(_0x1e9726>this['maxNumberOriginate']){_0x1e9726=this[_0x1d7d('0x25')];}_0x4750e3[_0x1d7d('0x1be')]+=_0x1e9726;for(var _0x5df0d8 in this['agents']){if(this[_0x1d7d('0x23')][_0x1d7d('0x89')](_0x5df0d8)){if(this['agents'][_0x5df0d8][_0x1d7d('0x9a')]==='not_inuse'&&this[_0x1d7d('0x23')][_0x5df0d8]['status']===_0x1d7d('0xcc')){_0x4bcccf['push'](this['agents'][_0x5df0d8]['id']);}}}this[_0x1d7d('0xb4')](_0x4750e3['id'],_0x4bcccf,_0x1e9726,_0x4750e3[_0x1d7d('0x1bf')])[_0x1d7d('0xaa')](function(_0x510b66){_0x4750e3[_0x1d7d('0x1be')]-=_0x1e9726;_0x4750e3['temp']=_0x4750e3[_0x1d7d('0x1be')]>0x0?_0x4750e3[_0x1d7d('0x1be')]:0x0;if(!checkContactEmpty(_0x510b66)){_0x346067['countReScheduled'](_0x4750e3)[_0x1d7d('0xaa')](sendMessageReschedule(_0x4750e3))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));}else{_0x4750e3[_0x1d7d('0x73')]+=_0x510b66[_0x1d7d('0x88')];_0x4750e3[_0x1d7d('0x3e')]=_0x4750e3[_0x1d7d('0x5b')]===_0x1d7d('0xa')?_0x1d7d('0x149'):'RUNNING';for(var _0x25efae=0x0;_0x25efae<_0x510b66[_0x1d7d('0x88')];_0x25efae+=0x1){if(_['isNil'](_0x510b66[_0x25efae])||_['isNil'](_0x510b66[_0x25efae][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x510b66[_0x25efae][_0x1d7d('0x143')]['phone'])){_0x346067[_0x1d7d('0x1c2')]('[actionOriginate]\x20',_0x4750e3,_0x510b66[_0x25efae]);}else{_0x346067[_0x1d7d('0xad')](_['pick'](_0x510b66[_0x25efae],[_0x1d7d('0xc4'),_0x1d7d('0x1c4')]))[_0x1d7d('0xaa')](_0x346067[_0x1d7d('0x1c5')](_0x4750e3,_0x510b66[_0x25efae]))[_0x1d7d('0xa3')](_0x346067['loggerHandler'](_0x1d7d('0x1c3'),_0x4750e3));}}}})[_0x1d7d('0xa3')](loggerGetContactDialer(_0x1d7d('0x1c9'),_0x4750e3,_0x1e9726));}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x82')]=function(_0xb678e4){var _0x464391=this;if(_0xb678e4[_0x1d7d('0x1c8')]>0x0){var _0x5e81ae=_0xb678e4[_0x1d7d('0x1c8')]-_0xb678e4[_0x1d7d('0x73')]-_0xb678e4['talking'];if(_0x5e81ae>0x0){this['tryOriginatePredictive'](_0xb678e4);}else{loggerPredictiveCalls[_0x1d7d('0x7a')](_0x1d7d('0x1ca'));}}else{this[_0x1d7d('0x1cb')](_0xb678e4);}};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1cb')]=function(_0x187301){var _0x421f4b=this;var _0x1a97ef=[];_0x187301['originated']+=0x1;for(var _0x40b789 in this[_0x1d7d('0x23')]){if(this['agents'][_0x1d7d('0x89')](_0x40b789)){if(this[_0x1d7d('0x23')][_0x40b789][_0x1d7d('0x9a')]===_0x1d7d('0x1cc')&&this['agents'][_0x40b789]['status']===_0x1d7d('0xcc')){_0x1a97ef[_0x1d7d('0xff')](this[_0x1d7d('0x23')][_0x40b789]['id']);}}}this['getContactDialer'](_0x187301['id'],_0x1a97ef,0x1,_0x187301[_0x1d7d('0x1bf')])['then'](function(_0x176519){if(!checkContactEmpty(_0x176519)){checkContactLowerLimitOriginate(_0x187301,0x1,0x0);_0x421f4b[_0x1d7d('0xab')](_0x187301)[_0x1d7d('0xaa')](sendMessageReschedule(_0x187301))[_0x1d7d('0xa3')](loggerCatch(_0x1d7d('0xac')));}else{_0x187301[_0x1d7d('0x3e')]=_0x1d7d('0x1c0');if(_[_0x1d7d('0xa0')](_0x176519[0x0])||_[_0x1d7d('0xa0')](_0x176519[0x0][_0x1d7d('0x143')])||_[_0x1d7d('0xa0')](_0x176519[0x0]['Contact']['phone'])){_0x421f4b[_0x1d7d('0x1c2')](_0x1d7d('0x1c3'),_0x187301,_0x176519[0x0]);}else{_0x421f4b[_0x1d7d('0xad')](_[_0x1d7d('0x100')](_0x176519[0x0],[_0x1d7d('0xc4'),_0x1d7d('0x1c4')]))['then'](_0x421f4b[_0x1d7d('0x1c5')](_0x187301,_0x176519[0x0]))['catch'](_0x421f4b[_0x1d7d('0xbe')](_0x1d7d('0x1cd'),_0x187301));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x187301,0x1));emitVoiceQueueSummary(_0x187301);};Dialer[_0x1d7d('0x1b')]['abandonmentRate']=function(_0x2462b7,_0x35943c,_0x42dc35,_0x1a32d2,_0x5cb335,_0x128334){loggerPredictive['info']('[abandonmentRate]','\x20m\x20=\x20',_0x2462b7,_0x1d7d('0x1ce'),_0x35943c,_0x1d7d('0x1cf'),_0x42dc35,_0x1d7d('0x1d0'),_0x1a32d2,_0x1d7d('0x1d1'),_0x5cb335);return new BPromise(function(_0x5e3264,_0x2512c8){if(_0x2462b7<=0x0||isNaN(_0x2462b7)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'m\x20=\x20'+_0x2462b7));}if(_0x42dc35<=0x0||isNaN(_0x42dc35)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d3')+_0x42dc35));}if(_0x1a32d2<=0x0||isNaN(_0x1a32d2)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d4')+_0x1a32d2));}if(_0x35943c<=0x0||isNaN(_0x35943c)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),'Error',_0x1d7d('0x1d5')+_0x35943c));}if(_0x5cb335<=0x0||isNaN(_0x5cb335)){return _0x2512c8(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'Amax\x20=\x20'+_0x5cb335));}_0x128334=_0x128334||0x0;var _0x11ddd5=0x1/_0x42dc35;var _0xbdc523=0x0;var _0x5442ad=0x0;var _0x460e88=0x0;var _0x43e1c8=0x0;for(var _0x5b3da4=0x0;_0x460e88<_0x5cb335;_0x5b3da4+=0x1){_0x5442ad=_0x5b3da4/_0x35943c;_0xbdc523=(_0x1a32d2*_0x5442ad+_0x128334)/_0x11ddd5;_0x460e88=erlangb(_0xbdc523,_0x2462b7);_0x43e1c8=_0xbdc523/_0x2462b7*(0x1-erlangb(_0xbdc523,_0x2462b7));}return _0x5e3264({'erlangCalls':_0x5b3da4,'erlangCallToSecond':_0x35943c/_0x5b3da4,'erlangAbandonmentRate':_0x460e88,'erlangBusyFactor':_0x43e1c8});});};Dialer[_0x1d7d('0x1b')][_0x1d7d('0x1aa')]=function(_0x44cccb,_0x3cbff2,_0x38da01,_0x405167,_0x4fb276,_0x40c6c6){loggerPredictive[_0x1d7d('0x7a')]('[busyFactor]',_0x1d7d('0x1d6'),_0x44cccb,'\x20interval\x20=\x20',_0x3cbff2,_0x1d7d('0x1cf'),_0x38da01,_0x1d7d('0x1d0'),_0x405167,'\x20Umin\x20=\x20',_0x4fb276);return new BPromise(function(_0x492800,_0x430f29){if(_0x44cccb<=0x0||isNaN(_0x44cccb)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'m\x20=\x20'+_0x44cccb));}if(_0x38da01<=0x0||isNaN(_0x38da01)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),'Ts\x20=\x20'+_0x38da01));}if(_0x405167<=0x0||isNaN(_0x405167)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),'Error','p\x20=\x20'+_0x405167));}if(_0x3cbff2<=0x0||isNaN(_0x3cbff2)){return _0x430f29(msgResponse(_0x1d7d('0x1d2'),_0x1d7d('0x49'),_0x1d7d('0x1d5')+_0x3cbff2));}if(_0x4fb276<=0x0||isNaN(_0x4fb276)){return _0x430f29(msgResponse('[abandonmentRate]',_0x1d7d('0x49'),_0x1d7d('0x1d7')+_0x4fb276));}_0x40c6c6=_0x40c6c6||0x0;var _0x5eb393=0x1/_0x38da01;var _0x9500cd=0x0;var _0x420655=0x0;var _0x39d38b=0x0;var _0x1d8ad0=0x0;for(var _0x3d3cfc=0x0;_0x1d8ad0<_0x4fb276;_0x3d3cfc+=0x1){_0x420655=_0x3d3cfc/_0x3cbff2;_0x9500cd=(_0x405167*_0x420655+_0x40c6c6)/_0x5eb393;_0x39d38b=erlangb(_0x9500cd,_0x44cccb);_0x1d8ad0=_0x9500cd/_0x44cccb*(0x1-erlangb(_0x9500cd,_0x44cccb));}return _0x492800({'erlangCalls':_0x3d3cfc,'erlangCallToSecond':_0x3cbff2/_0x3d3cfc,'erlangAbandonmentRate':_0x39d38b,'erlangBusyFactor':_0x1d8ad0});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 1f00b14..f2703f3 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 _0x9513=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x9513,0xc6));var _0x3951=function(_0x1cd69a,_0x35728e){_0x1cd69a=_0x1cd69a-0x0;var _0x4c916d=_0x9513[_0x1cd69a];return _0x4c916d;};'use strict';var util=require(_0x3951('0x0'));var _=require(_0x3951('0x1'));var moment=require(_0x3951('0x2'));function getSeconds(_0x5e95b6,_0xa6787f){var _0x562aae=moment(_0x5e95b6)[_0x3951('0x3')](0x0);var _0x18e879=moment(_0xa6787f)[_0x3951('0x3')](0x0);return _0x562aae[_0x3951('0x4')](_0x18e879,'seconds');}function QueueCallerAbandon(_0x17044a,_0x58f5df){this[_0x3951('0x5')]=_0x17044a[_0x3951('0x5')];this[_0x3951('0x6')]=_0x17044a['type'];this['campaigntype']=_0x17044a[_0x3951('0x6')]===_0x3951('0x7')?_0x3951('0x8'):_0x17044a[_0x3951('0x6')];this[_0x3951('0x9')]=_0x17044a[_0x3951('0x9')];this['countcongestionretry']=_0x17044a[_0x3951('0xa')];this['countnoanswerretry']=_0x17044a[_0x3951('0xb')];this[_0x3951('0xc')]=_0x17044a[_0x3951('0x9')]+_0x17044a[_0x3951('0xa')]+_0x17044a[_0x3951('0xb')];this['uniqueid']=_0x58f5df[_0x3951('0xd')];this[_0x3951('0xe')]=_0x17044a[_0x3951('0xf')];this[_0x3951('0x10')]=_0x17044a[_0x3951('0x11')];this[_0x3951('0x12')]=_0x17044a['starttime'];this[_0x3951('0x13')]=_0x17044a[_0x3951('0x13')];this[_0x3951('0x14')]=_0x17044a['droptime'];this['endtime']=this['droptime'];this[_0x3951('0x15')]=getSeconds(_0x17044a[_0x3951('0x13')],_0x17044a[_0x3951('0x12')]);this[_0x3951('0x16')]=getSeconds(this['droptime'],_0x17044a['responsetime']);this[_0x3951('0x17')]=0x0;this[_0x3951('0x8')]=_0x58f5df[_0x3951('0x8')];this[_0x3951('0x18')]=_0x58f5df[_0x3951('0x19')];this['reason']=_0x58f5df[_0x3951('0x1a')];this[_0x3951('0x1b')]=_0x17044a[_0x3951('0x1b')];this[_0x3951('0x1c')]=_0x17044a[_0x3951('0x1c')];this[_0x3951('0x1d')]=_0x17044a['callbackat'];this['recallme']=_0x17044a['recallme'];this[_0x3951('0x1e')]=_0x17044a['ContactId'];this['ListId']=_0x17044a[_0x3951('0x1f')];this[_0x3951('0x20')]=_0x17044a[_0x3951('0x20')];this['VoiceQueueId']=_0x17044a[_0x3951('0x21')];this[_0x3951('0x22')]=_0x17044a[_0x3951('0x22')];this['originatecalleridnum']=_0x17044a[_0x3951('0x23')]||'';this[_0x3951('0x24')]=_0x17044a['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x52a5=['seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','diff'];(function(_0x2ae8d6,_0x4d7876){var _0x3d5145=function(_0x3c3638){while(--_0x3c3638){_0x2ae8d6['push'](_0x2ae8d6['shift']());}};_0x3d5145(++_0x4d7876);}(_0x52a5,0x1b7));var _0x552a=function(_0x1e04b4,_0xa3bbd1){_0x1e04b4=_0x1e04b4-0x0;var _0x4934a9=_0x52a5[_0x1e04b4];return _0x4934a9;};'use strict';var util=require('util');var _=require(_0x552a('0x0'));var moment=require(_0x552a('0x1'));function getSeconds(_0x2e4642,_0x1b4667){var _0x207fba=moment(_0x2e4642)['milliseconds'](0x0);var _0x45f337=moment(_0x1b4667)['milliseconds'](0x0);return _0x207fba[_0x552a('0x2')](_0x45f337,_0x552a('0x3'));}function QueueCallerAbandon(_0x41d6a2,_0xefa2dd){this[_0x552a('0x4')]=_0x41d6a2[_0x552a('0x4')];this[_0x552a('0x5')]=_0x41d6a2[_0x552a('0x5')];this['campaigntype']=_0x41d6a2[_0x552a('0x5')]===_0x552a('0x6')?_0x552a('0x7'):_0x41d6a2['type'];this[_0x552a('0x8')]=_0x41d6a2[_0x552a('0x8')];this['countcongestionretry']=_0x41d6a2[_0x552a('0x9')];this[_0x552a('0xa')]=_0x41d6a2['countnoanswerretry'];this[_0x552a('0xb')]=_0x41d6a2['countbusyretry']+_0x41d6a2['countcongestionretry']+_0x41d6a2[_0x552a('0xa')];this['uniqueid']=_0xefa2dd[_0x552a('0xc')];this['calleridname']=_0x41d6a2['name'];this['calleridnum']=_0x41d6a2[_0x552a('0xd')];this[_0x552a('0xe')]=_0x41d6a2['starttime'];this[_0x552a('0xf')]=_0x41d6a2[_0x552a('0xf')];this['droptime']=_0x41d6a2[_0x552a('0x10')];this['endtime']=this['droptime'];this[_0x552a('0x11')]=getSeconds(_0x41d6a2[_0x552a('0xf')],_0x41d6a2[_0x552a('0xe')]);this[_0x552a('0x12')]=getSeconds(this[_0x552a('0x10')],_0x41d6a2[_0x552a('0xf')]);this[_0x552a('0x13')]=0x0;this[_0x552a('0x7')]=_0xefa2dd[_0x552a('0x7')];this['membername']=_0xefa2dd[_0x552a('0x14')];this[_0x552a('0x15')]=_0xefa2dd[_0x552a('0x15')];this[_0x552a('0x16')]=_0x41d6a2[_0x552a('0x16')];this[_0x552a('0x17')]=_0x41d6a2[_0x552a('0x17')];this[_0x552a('0x18')]=_0x41d6a2['callbackat'];this[_0x552a('0x19')]=_0x41d6a2[_0x552a('0x19')];this[_0x552a('0x1a')]=_0x41d6a2[_0x552a('0x1a')];this[_0x552a('0x1b')]=_0x41d6a2[_0x552a('0x1b')];this[_0x552a('0x1c')]=_0x41d6a2[_0x552a('0x1c')];this['VoiceQueueId']=_0x41d6a2[_0x552a('0x1d')];this[_0x552a('0x1e')]=_0x41d6a2[_0x552a('0x1e')];this['originatecalleridnum']=_0x41d6a2[_0x552a('0x1f')]||'';this[_0x552a('0x20')]=_0x41d6a2['originatecalleridname']||'';}module[_0x552a('0x21')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index e09902d..570051c 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 _0x2ac5=['AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','fax','localstationid','headerinfo','path'];(function(_0x4041ef,_0x2e36ff){var _0x37f0a9=function(_0x41f2ae){while(--_0x41f2ae){_0x4041ef['push'](_0x4041ef['shift']());}};_0x37f0a9(++_0x2e36ff);}(_0x2ac5,0x1f1));var _0x52ac=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x2ac5[_0x3826ad];return _0x17b900;};'use strict';var util=require(_0x52ac('0x0'));var _=require(_0x52ac('0x1'));var moment=require(_0x52ac('0x2'));function Action(_0x1f21b1,_0x1aceec,_0x44667d){this[_0x52ac('0x3')]=_0x1f21b1||undefined;this[_0x52ac('0x4')]=util[_0x52ac('0x5')](_0x52ac('0x6'),_0x1aceec[_0x52ac('0x7')],_0x1aceec[_0x52ac('0x8')]['name'],_0x44667d[_0x52ac('0x9')]);this[_0x52ac('0xa')]=_0x1aceec['localstationid'];this[_0x52ac('0xb')]=_0x1aceec[_0x52ac('0xb')];this[_0x52ac('0xc')]=_0x44667d[_0x52ac('0xc')];this['AttachmentId']=_0x44667d[_0x52ac('0xd')];}module[_0x52ac('0xe')]=Action; \ No newline at end of file +var _0xeee3=['lodash','moment','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports'];(function(_0x58b6c7,_0x3bf35e){var _0x5f50d0=function(_0x532e10){while(--_0x532e10){_0x58b6c7['push'](_0x58b6c7['shift']());}};_0x5f50d0(++_0x3bf35e);}(_0xeee3,0xb6));var _0x3eee=function(_0x54c876,_0x274f1b){_0x54c876=_0x54c876-0x0;var _0x591f83=_0xeee3[_0x54c876];return _0x591f83;};'use strict';var util=require('util');var _=require(_0x3eee('0x0'));var moment=require(_0x3eee('0x1'));function Action(_0x40f7d5,_0x52c8db,_0x3b551e){this['uniqueid']=_0x40f7d5||undefined;this['channel']=util[_0x3eee('0x2')](_0x3eee('0x3'),_0x52c8db[_0x3eee('0x4')],_0x52c8db[_0x3eee('0x5')][_0x3eee('0x6')],_0x3b551e[_0x3eee('0x7')]);this[_0x3eee('0x8')]=_0x52c8db[_0x3eee('0x8')];this[_0x3eee('0x9')]=_0x52c8db[_0x3eee('0x9')];this[_0x3eee('0xa')]=_0x3b551e[_0x3eee('0xa')];this[_0x3eee('0xb')]=_0x3b551e['AttachmentId'];}module[_0x3eee('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 eb5ff86..6418e2f 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 _0x90f9=['.pdf','catch','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Empty\x20path','exports','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind','varset','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype','context','faxAccounts','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','syncNewState','channelstate','channelstatedesc','hasOwnProperty','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify'];(function(_0x2acaa6,_0x2c1823){var _0x42cf98=function(_0x4ed2fb){while(--_0x4ed2fb){_0x2acaa6['push'](_0x2acaa6['shift']());}};_0x42cf98(++_0x2c1823);}(_0x90f9,0x1a5));var _0x990f=function(_0x22e495,_0x37361d){_0x22e495=_0x22e495-0x0;var _0x5f3fa0=_0x90f9[_0x22e495];return _0x5f3fa0;};'use strict';var util=require(_0x990f('0x0'));var _=require('lodash');var BPromise=require(_0x990f('0x1'));var uuid=require(_0x990f('0x2'));var moment=require(_0x990f('0x3'));var path=require(_0x990f('0x4'));var tiff2pdf=require(_0x990f('0x5'));var gs=require(_0x990f('0x6'));var logger=require('../../../config/logger')(_0x990f('0x7'));var ami=require(_0x990f('0x8'));var rpcDb=require(_0x990f('0x9'));var Channel=require('./channel');var ut=require(_0x990f('0xa'));var Action=require(_0x990f('0xb'));var faxAccount=require(_0x990f('0xc'));var attachment=require(_0x990f('0xd'));var faxMessage=require(_0x990f('0xe'));function Fax(_0x379990){this[_0x990f('0xf')]={};this['faxAccounts']=_0x379990['faxAccounts'];this[_0x990f('0x10')]=_0x379990['trunks'];this['actions']={};ami['on'](_0x990f('0x11'),this[_0x990f('0x12')][_0x990f('0x13')](this));ami['on'](_0x990f('0x14'),this['syncVarSet'][_0x990f('0x13')](this));ami['on'](_0x990f('0x15'),this['syncNewState'][_0x990f('0x13')](this));ami['on']('newexten',this[_0x990f('0x16')]['bind'](this));ami['on'](_0x990f('0x17'),this[_0x990f('0x18')][_0x990f('0x13')](this));ami['on'](_0x990f('0x19'),this[_0x990f('0x1a')][_0x990f('0x13')](this));ami['on'](_0x990f('0x1b'),this['syncHangup'][_0x990f('0x13')](this));ami['on'](_0x990f('0x1c'),this['syncOriginateResponse']['bind'](this));}Fax[_0x990f('0x1d')][_0x990f('0x12')]=function(_0x155318){if(_0x155318[_0x990f('0x1e')]==='from-voip-provider'){for(var _0x5701d7 in this['faxAccounts']){if(this[_0x990f('0x1f')]['hasOwnProperty'](_0x5701d7)){if(_0x155318[_0x990f('0x20')]===this[_0x990f('0x1f')][_0x5701d7][_0x990f('0x21')]){this[_0x990f('0xf')][_0x155318['uniqueid']]={};this['channels'][_0x155318[_0x990f('0x22')]][_0x990f('0x23')]=_0x155318['channel'];this['channels'][_0x155318[_0x990f('0x22')]]['id']=this[_0x990f('0x1f')][_0x5701d7]['id'];this['channels'][_0x155318[_0x990f('0x22')]][_0x990f('0x24')]=this[_0x990f('0x1f')][_0x5701d7][_0x990f('0x24')];logger[_0x990f('0x25')](_0x155318['uniqueid'],_0x990f('0x26'));}}}}if(this[_0x990f('0x27')][_0x155318[_0x990f('0x22')]]){this['channels'][_0x155318[_0x990f('0x22')]]={};this[_0x990f('0xf')][_0x155318['uniqueid']][_0x990f('0x23')]=_0x155318['channel'];logger[_0x990f('0x25')](_0x155318[_0x990f('0x22')],_0x990f('0x26'));}};Fax['prototype'][_0x990f('0x28')]=function(_0x23099a){if(this[_0x990f('0xf')][_0x23099a[_0x990f('0x22')]]){for(var _0x15addc in _0x23099a[_0x990f('0x29')]){if(_0x23099a[_0x990f('0x29')]['hasOwnProperty'](_0x15addc)){this['channels'][_0x23099a[_0x990f('0x22')]][_0x15addc]=_0x23099a['value'];}}}};Fax[_0x990f('0x1d')][_0x990f('0x2a')]=function(_0x231f12){if(this[_0x990f('0xf')][_0x231f12[_0x990f('0x22')]]){this[_0x990f('0xf')][_0x231f12[_0x990f('0x22')]][_0x990f('0x2b')]=_0x231f12[_0x990f('0x2b')];this[_0x990f('0xf')][_0x231f12[_0x990f('0x22')]][_0x990f('0x2c')]=_0x231f12[_0x990f('0x2c')];}};Fax[_0x990f('0x1d')][_0x990f('0x16')]=function(_0x4d32a2){if(this[_0x990f('0xf')][_0x4d32a2[_0x990f('0x22')]]){for(var _0x2913bc in _0x4d32a2[_0x990f('0x29')]){if(_0x4d32a2['variable'][_0x990f('0x2d')](_0x2913bc)){this[_0x990f('0xf')][_0x4d32a2['uniqueid']][_0x2913bc]=_0x4d32a2[_0x990f('0x2e')];}}}};Fax[_0x990f('0x1d')][_0x990f('0x18')]=function(_0x484b55){if(this[_0x990f('0xf')][_0x484b55[_0x990f('0x22')]]){this[_0x990f('0xf')][_0x484b55[_0x990f('0x22')]][_0x990f('0x2f')]=_0x484b55['operation'];this['channels'][_0x484b55['uniqueid']][_0x990f('0x30')]=_0x484b55[_0x990f('0x30')];this[_0x990f('0xf')][_0x484b55['uniqueid']][_0x990f('0x21')]=_0x484b55[_0x990f('0x21')];this[_0x990f('0xf')][_0x484b55[_0x990f('0x22')]][_0x990f('0x31')]=_0x484b55[_0x990f('0x31')];logger[_0x990f('0x25')](_0x484b55[_0x990f('0x22')],_0x990f('0x32'));}};Fax['prototype'][_0x990f('0x1a')]=function(_0x2cc62f){var _0x29cb70=this;if(this['channels'][_0x2cc62f[_0x990f('0x22')]]){var _0x44fe7f=this['channels'][_0x2cc62f['uniqueid']]['id'];this[_0x990f('0xf')][_0x2cc62f[_0x990f('0x22')]][_0x990f('0x33')]=_0x2cc62f['remotestationid'];this[_0x990f('0xf')][_0x2cc62f['uniqueid']][_0x990f('0x34')]=_0x2cc62f[_0x990f('0x34')];this[_0x990f('0xf')][_0x2cc62f[_0x990f('0x22')]][_0x990f('0x21')]=_0x2cc62f['localstationid'];this['channels'][_0x2cc62f[_0x990f('0x22')]]['resolution']=_0x2cc62f[_0x990f('0x35')];this[_0x990f('0xf')][_0x2cc62f[_0x990f('0x22')]]['transferrate']=_0x2cc62f[_0x990f('0x36')];this[_0x990f('0xf')][_0x2cc62f['uniqueid']][_0x990f('0x31')]=_0x2cc62f[_0x990f('0x31')];this[_0x990f('0xf')][_0x2cc62f[_0x990f('0x22')]][_0x990f('0x37')]=_0x2cc62f[_0x990f('0x37')];if(this[_0x990f('0xf')][_0x2cc62f[_0x990f('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x2cc62f[_0x990f('0x31')],_0x990f('0x38'),function(_0x3984f6){logger[_0x990f('0x25')](_0x2cc62f[_0x990f('0x22')],_0x990f('0x39'),_0x3984f6['message']);attachment[_0x990f('0x3a')]({'name':path[_0x990f('0x3b')](_0x2cc62f[_0x990f('0x31')])['name'],'basename':path[_0x990f('0x3b')](_0x2cc62f[_0x990f('0x31')])['name']+'.pdf','type':_0x990f('0x3c')})[_0x990f('0x3d')](function(_0x2ee46){faxAccount[_0x990f('0x3e')](_0x44fe7f,{'from':_0x2cc62f[_0x990f('0x37')],'mapKey':_0x990f('0x7'),'body':path['parse'](_0x2cc62f['filename'])[_0x990f('0x24')]+_0x990f('0x3f'),'AttachmentId':_0x2ee46['id']})[_0x990f('0x40')](function(_0x533e1c){logger['error'](_0x2cc62f[_0x990f('0x22')],'\x20notify\x20',JSON[_0x990f('0x41')](_0x533e1c));});})[_0x990f('0x40')](function(_0x31848d){logger[_0x990f('0x42')](_0x2cc62f[_0x990f('0x22')],'\x20receiveFax\x20',JSON['stringify'](_0x31848d));});});}logger[_0x990f('0x25')](_0x2cc62f['uniqueid'],_0x990f('0x43'));}};Fax[_0x990f('0x1d')][_0x990f('0x44')]=function(_0x15b6e0){if(this[_0x990f('0x27')][_0x15b6e0[_0x990f('0x22')]]){_[_0x990f('0x45')](this[_0x990f('0xf')][_0x15b6e0[_0x990f('0x22')]],_[_0x990f('0x46')](_0x15b6e0,['response',_0x990f('0x47')]));}};function updateStatus(_0x448bb2){if(_0x448bb2[_0x990f('0x48')]){faxMessage[_0x990f('0x49')](_0x448bb2[_0x990f('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x990f('0x3d')](function(_0x2bdf8d){ut[_0x990f('0x4a')](_0x990f('0x4b'),_0x2bdf8d);})[_0x990f('0x40')](function(_0x5434f2){ut['logger'](_0x990f('0x4c'),_0x5434f2);});}else{ut[_0x990f('0x4a')](_0x990f('0x4d'));}}Fax[_0x990f('0x1d')][_0x990f('0x4e')]=function(_0xd9fc07,_0x444496,_0x50e69e){var _0x8956a7=this;var _0x2c9341={};if(_0x444496){_0x2c9341={'read':_0x444496};}else{_0x2c9341={'failMessage':_0x50e69e};}if(this[_0x990f('0x27')][_0xd9fc07]['AttachmentId']){faxMessage[_0x990f('0x49')](this[_0x990f('0x27')][_0xd9fc07][_0x990f('0x48')],_0x2c9341)[_0x990f('0x3d')](function(_0x3eb9c0){ut[_0x990f('0x4a')](_0x990f('0x4f'),_0x3eb9c0);})[_0x990f('0x40')](function(_0x556d81){ut[_0x990f('0x4a')](_0x990f('0x50'),_0x556d81);})[_0x990f('0x51')](function(){delete _0x8956a7[_0x990f('0xf')][_0xd9fc07];delete _0x8956a7[_0x990f('0x27')][_0xd9fc07];});}else{ut[_0x990f('0x4a')](_0x990f('0x52'));delete this[_0x990f('0xf')][_0xd9fc07];delete this[_0x990f('0x27')][_0xd9fc07];}};Fax[_0x990f('0x1d')][_0x990f('0x53')]=function(_0x4bafd0){var _0x2ecb39=this;if(this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]]){if(this[_0x990f('0x27')][_0x4bafd0[_0x990f('0x22')]]){this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]]['id']=this[_0x990f('0x27')][_0x4bafd0['uniqueid']]['id'];this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]][_0x990f('0x24')]=this[_0x990f('0x27')][_0x4bafd0[_0x990f('0x22')]][_0x990f('0x24')];}logger[_0x990f('0x25')](_0x4bafd0[_0x990f('0x22')],this[_0x990f('0x27')][_0x4bafd0[_0x990f('0x22')]]?_0x990f('0x54'):'\x20hangup\x20faxRiceive\x20',JSON[_0x990f('0x41')](this['channels'][_0x4bafd0[_0x990f('0x22')]]));if(this['actions'][_0x4bafd0['uniqueid']]){if(this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]][_0x990f('0x55')]>0x0&&this[_0x990f('0xf')][_0x4bafd0['uniqueid']][_0x990f('0x17')]===_0x990f('0x56')){this[_0x990f('0x4e')](_0x4bafd0[_0x990f('0x22')],!![]);}else{this['updateStatus'](_0x4bafd0[_0x990f('0x22')],![],this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]][_0x990f('0x57')]?_0x990f('0x58')+this[_0x990f('0xf')][_0x4bafd0[_0x990f('0x22')]][_0x990f('0x57')]:_0x990f('0x59'));}}}};Fax[_0x990f('0x1d')][_0x990f('0x5a')]=function(_0x55d7fd){var _0xa65af0=this;return new BPromise(function(_0x1bd086,_0x591cf3){_0xa65af0[_0x990f('0x5b')](_0x55d7fd,_0xa65af0[_0x990f('0x1f')][_0x55d7fd[_0x990f('0x5c')]])[_0x990f('0x3d')](function(_0x41af31){ut['logger'](_0x990f('0x5d'),_0x41af31);_0x1bd086(ut[_0x990f('0x5e')](_0x990f('0x5f')));})[_0x990f('0x40')](function(_0x93244f){ut[_0x990f('0x4a')](_0x990f('0x60'),_0x93244f);updateStatus(_0x55d7fd);_0x591cf3(ut[_0x990f('0x5e')](_0x990f('0x61')));});});};Fax['prototype'][_0x990f('0x62')]=function(_0x4da71f){var _0x14a3b8=this;return new BPromise(function(_0x469810,_0x1e7d8a){var _0x198fbc=_0x14a3b8[_0x990f('0x63')](_0x14a3b8[_0x990f('0x1f')][_0x4da71f[_0x990f('0x5c')]][_0x990f('0x64')],_0x4da71f);if(_0x198fbc['isValid']){_0x469810(ut['message'](_0x990f('0x65')));}else{_0x1e7d8a(ut[_0x990f('0x5e')](_0x198fbc[_0x990f('0x5e')]));}});};function originate(_0xce4a3,_0x176bd7,_0xc4a7f2){return new BPromise(function(_0x54d603,_0x1ee717){if(_0xc4a7f2){var _0x1da9aa=util['format'](_0x990f('0x66'),path['parse'](_0xce4a3[_0x990f('0x4')])['name'],_0xce4a3[_0x990f('0x4')]);gs[_0x990f('0x67')](_0x1da9aa)[_0x990f('0x3d')](function(){_0xce4a3[_0x990f('0x4')]=util['format'](_0x990f('0x68'),path[_0x990f('0x3b')](_0xce4a3[_0x990f('0x4')])[_0x990f('0x69')],path[_0x990f('0x3b')](_0xce4a3[_0x990f('0x4')])[_0x990f('0x24')]);_0x176bd7['XMF-PATH']=_0xce4a3['path'];ut[_0x990f('0x4a')](_0x990f('0x6a'),'');ami[_0x990f('0x6b')](ut[_0x990f('0x6c')](_0xce4a3,_0x176bd7))[_0x990f('0x3d')](function(_0x4325cf){_0x54d603(_0x4325cf);})[_0x990f('0x40')](function(_0x18c19f){_0x1ee717(_0x18c19f);});})[_0x990f('0x40')](function(_0x352c9c){_0x1ee717(_0x352c9c);});}else{ami[_0x990f('0x6b')](ut[_0x990f('0x6c')](_0xce4a3,_0x176bd7))[_0x990f('0x3d')](function(_0x166208){_0x54d603(_0x166208);})['catch'](function(_0x1317b){_0x1ee717(_0x1317b);});}});}Fax['prototype'][_0x990f('0x5b')]=function(_0x4fc35d,_0xd6b760){var _0x20f6c9=this;return new BPromise(function(_0x1cb251,_0xd0c338){var _0x1754b3=uuid['v4']();var _0x5eb7ef=ut[_0x990f('0x6d')](_0x4fc35d,_0xd6b760);_0x20f6c9[_0x990f('0x27')][_0x1754b3]=new Action(_0x1754b3,_0xd6b760,_0x4fc35d);var _0x4eabe3=_0x20f6c9[_0x990f('0x27')][_0x1754b3];if(path[_0x990f('0x3b')](_0x4fc35d[_0x990f('0x4')])[_0x990f('0x6e')]===_0x990f('0x3f')){originate(_0x4eabe3,_0x5eb7ef,!![])[_0x990f('0x3d')](function(_0x480993){_0x1cb251(_0x480993);})[_0x990f('0x40')](function(_0x2efc1d){_0xd0c338(_0x2efc1d);});}else{originate(_0x4eabe3,_0x5eb7ef,![])[_0x990f('0x3d')](function(_0xf366d6){_0x1cb251(_0xf366d6);})[_0x990f('0x40')](function(_0x1852ed){_0xd0c338(_0x1852ed);});}});};Fax[_0x990f('0x1d')][_0x990f('0x6f')]=function(_0x4ebd47){return!_['isNil'](_0x4ebd47)&&!_[_0x990f('0x70')](_0x4ebd47['name'])&&!_['isNil'](_0x4ebd47['active'])&&_0x4ebd47[_0x990f('0x71')]&&!_['isNil'](this[_0x990f('0x10')][util[_0x990f('0x72')](_0x990f('0x73'),_0x4ebd47[_0x990f('0x24')])])&&!_[_0x990f('0x70')](this[_0x990f('0x10')][util[_0x990f('0x72')](_0x990f('0x73'),_0x4ebd47[_0x990f('0x24')])]['status'])&&(this[_0x990f('0x10')][util['format']('SIP/%s',_0x4ebd47['name'])][_0x990f('0x30')]===_0x990f('0x74')||this[_0x990f('0x10')][util['format'](_0x990f('0x73'),_0x4ebd47[_0x990f('0x24')])][_0x990f('0x30')]===_0x990f('0x75'));};Fax[_0x990f('0x1d')]['checkTrunk']=function(_0x1fbd6d,_0x4f66d7){if(!this[_0x990f('0x6f')](_0x1fbd6d)){ut[_0x990f('0x4a')](_0x990f('0x76'),_[_0x990f('0x70')](_0x1fbd6d)?'':_0x1fbd6d[_0x990f('0x24')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x990f('0x70')](_0x4f66d7['fax'])){ut[_0x990f('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x990f('0x41')](_0x4f66d7));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x990f('0x70')](_0x4f66d7['path'])){ut[_0x990f('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x990f('0x41')](_0x4f66d7));return{'isValid':![],'message':_0x990f('0x77')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x990f('0x78')]=Fax; \ No newline at end of file +var _0xb2ba=['checkAfterSend','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','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','active','SIP/%s','isNil','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','channel','uniqueid','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','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed'];(function(_0x912ca5,_0xf63ac0){var _0x836f96=function(_0x1f087c){while(--_0x1f087c){_0x912ca5['push'](_0x912ca5['shift']());}};_0x836f96(++_0xf63ac0);}(_0xb2ba,0x182));var _0xab2b=function(_0x56dc2e,_0x52baeb){_0x56dc2e=_0x56dc2e-0x0;var _0x57e672=_0xb2ba[_0x56dc2e];return _0x57e672;};'use strict';var util=require(_0xab2b('0x0'));var _=require(_0xab2b('0x1'));var BPromise=require(_0xab2b('0x2'));var uuid=require(_0xab2b('0x3'));var moment=require(_0xab2b('0x4'));var path=require(_0xab2b('0x5'));var tiff2pdf=require(_0xab2b('0x6'));var gs=require(_0xab2b('0x7'));var logger=require(_0xab2b('0x8'))(_0xab2b('0x9'));var ami=require(_0xab2b('0xa'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xab2b('0xb'));var faxAccount=require(_0xab2b('0xc'));var attachment=require(_0xab2b('0xd'));var faxMessage=require(_0xab2b('0xe'));function Fax(_0x207f51){this[_0xab2b('0xf')]={};this[_0xab2b('0x10')]=_0x207f51[_0xab2b('0x10')];this[_0xab2b('0x11')]=_0x207f51[_0xab2b('0x11')];this[_0xab2b('0x12')]={};ami['on'](_0xab2b('0x13'),this[_0xab2b('0x14')]['bind'](this));ami['on'](_0xab2b('0x15'),this[_0xab2b('0x16')][_0xab2b('0x17')](this));ami['on']('newstate',this[_0xab2b('0x18')]['bind'](this));ami['on'](_0xab2b('0x19'),this[_0xab2b('0x1a')]['bind'](this));ami['on'](_0xab2b('0x1b'),this[_0xab2b('0x1c')]['bind'](this));ami['on'](_0xab2b('0x1d'),this[_0xab2b('0x1e')]['bind'](this));ami['on'](_0xab2b('0x1f'),this[_0xab2b('0x20')][_0xab2b('0x17')](this));ami['on'](_0xab2b('0x21'),this[_0xab2b('0x22')][_0xab2b('0x17')](this));}Fax[_0xab2b('0x23')]['syncNewchannel']=function(_0x52b206){if(_0x52b206[_0xab2b('0x24')]===_0xab2b('0x25')){for(var _0x2d6d84 in this[_0xab2b('0x10')]){if(this['faxAccounts'][_0xab2b('0x26')](_0x2d6d84)){if(_0x52b206['exten']===this[_0xab2b('0x10')][_0x2d6d84][_0xab2b('0x27')]){this[_0xab2b('0xf')][_0x52b206['uniqueid']]={};this[_0xab2b('0xf')][_0x52b206['uniqueid']]['channel']=_0x52b206[_0xab2b('0x28')];this[_0xab2b('0xf')][_0x52b206[_0xab2b('0x29')]]['id']=this[_0xab2b('0x10')][_0x2d6d84]['id'];this['channels'][_0x52b206[_0xab2b('0x29')]]['name']=this[_0xab2b('0x10')][_0x2d6d84][_0xab2b('0x2a')];logger[_0xab2b('0x2b')](_0x52b206[_0xab2b('0x29')],'\x20syncNewchannel\x20');}}}}if(this[_0xab2b('0x12')][_0x52b206[_0xab2b('0x29')]]){this[_0xab2b('0xf')][_0x52b206['uniqueid']]={};this['channels'][_0x52b206[_0xab2b('0x29')]][_0xab2b('0x28')]=_0x52b206['channel'];logger[_0xab2b('0x2b')](_0x52b206[_0xab2b('0x29')],_0xab2b('0x2c'));}};Fax['prototype']['syncVarSet']=function(_0x32c92d){if(this[_0xab2b('0xf')][_0x32c92d['uniqueid']]){for(var _0x8d9ad8 in _0x32c92d[_0xab2b('0x2d')]){if(_0x32c92d[_0xab2b('0x2d')][_0xab2b('0x26')](_0x8d9ad8)){this[_0xab2b('0xf')][_0x32c92d[_0xab2b('0x29')]][_0x8d9ad8]=_0x32c92d['value'];}}}};Fax[_0xab2b('0x23')][_0xab2b('0x18')]=function(_0x50efaa){if(this['channels'][_0x50efaa[_0xab2b('0x29')]]){this[_0xab2b('0xf')][_0x50efaa[_0xab2b('0x29')]][_0xab2b('0x2e')]=_0x50efaa['channelstate'];this[_0xab2b('0xf')][_0x50efaa[_0xab2b('0x29')]][_0xab2b('0x2f')]=_0x50efaa[_0xab2b('0x2f')];}};Fax['prototype'][_0xab2b('0x1a')]=function(_0x29cf36){if(this[_0xab2b('0xf')][_0x29cf36['uniqueid']]){for(var _0x2d0737 in _0x29cf36[_0xab2b('0x2d')]){if(_0x29cf36['variable'][_0xab2b('0x26')](_0x2d0737)){this[_0xab2b('0xf')][_0x29cf36['uniqueid']][_0x2d0737]=_0x29cf36[_0xab2b('0x30')];}}}};Fax['prototype'][_0xab2b('0x1c')]=function(_0x1d26db){if(this['channels'][_0x1d26db[_0xab2b('0x29')]]){this[_0xab2b('0xf')][_0x1d26db[_0xab2b('0x29')]][_0xab2b('0x31')]=_0x1d26db[_0xab2b('0x31')];this[_0xab2b('0xf')][_0x1d26db[_0xab2b('0x29')]][_0xab2b('0x32')]=_0x1d26db[_0xab2b('0x32')];this[_0xab2b('0xf')][_0x1d26db[_0xab2b('0x29')]][_0xab2b('0x27')]=_0x1d26db[_0xab2b('0x27')];this[_0xab2b('0xf')][_0x1d26db[_0xab2b('0x29')]][_0xab2b('0x33')]=_0x1d26db[_0xab2b('0x33')];logger['info'](_0x1d26db[_0xab2b('0x29')],_0xab2b('0x34'));}};Fax[_0xab2b('0x23')][_0xab2b('0x1e')]=function(_0x39a264){var _0x49b89b=this;if(this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]]){var _0x2b0e65=this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]]['id'];this['channels'][_0x39a264[_0xab2b('0x29')]][_0xab2b('0x35')]=_0x39a264[_0xab2b('0x35')];this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]][_0xab2b('0x36')]=_0x39a264[_0xab2b('0x36')];this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]][_0xab2b('0x27')]=_0x39a264[_0xab2b('0x27')];this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]][_0xab2b('0x37')]=_0x39a264[_0xab2b('0x37')];this['channels'][_0x39a264['uniqueid']][_0xab2b('0x38')]=_0x39a264[_0xab2b('0x38')];this['channels'][_0x39a264[_0xab2b('0x29')]]['filename']=_0x39a264[_0xab2b('0x33')];this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]][_0xab2b('0x39')]=_0x39a264[_0xab2b('0x39')];if(this[_0xab2b('0xf')][_0x39a264[_0xab2b('0x29')]]['pagestransferred']>0x0){tiff2pdf(_0x39a264[_0xab2b('0x33')],_0xab2b('0x3a'),function(_0x51e1f8){logger[_0xab2b('0x2b')](_0x39a264[_0xab2b('0x29')],_0xab2b('0x3b'),_0x51e1f8['message']);attachment[_0xab2b('0x3c')]({'name':path[_0xab2b('0x3d')](_0x39a264[_0xab2b('0x33')])[_0xab2b('0x2a')],'basename':path[_0xab2b('0x3d')](_0x39a264['filename'])[_0xab2b('0x2a')]+_0xab2b('0x3e'),'type':_0xab2b('0x3f')})[_0xab2b('0x40')](function(_0x5a9938){faxAccount['notify'](_0x2b0e65,{'from':_0x39a264[_0xab2b('0x39')],'mapKey':'fax','body':path[_0xab2b('0x3d')](_0x39a264[_0xab2b('0x33')])[_0xab2b('0x2a')]+_0xab2b('0x3e'),'AttachmentId':_0x5a9938['id']})['catch'](function(_0x28b3a0){logger[_0xab2b('0x41')](_0x39a264[_0xab2b('0x29')],_0xab2b('0x42'),JSON[_0xab2b('0x43')](_0x28b3a0));});})[_0xab2b('0x44')](function(_0xf9fdc0){logger['error'](_0x39a264[_0xab2b('0x29')],_0xab2b('0x45'),JSON[_0xab2b('0x43')](_0xf9fdc0));});});}logger['info'](_0x39a264[_0xab2b('0x29')],_0xab2b('0x45'));}};Fax[_0xab2b('0x23')]['syncOriginateResponse']=function(_0x474830){if(this[_0xab2b('0x12')][_0x474830['uniqueid']]){_['merge'](this['channels'][_0x474830[_0xab2b('0x29')]],_[_0xab2b('0x46')](_0x474830,['response',_0xab2b('0x47')]));}};function updateStatus(_0x101a55){if(_0x101a55['AttachmentId']){faxMessage[_0xab2b('0x48')](_0x101a55[_0xab2b('0x49')],{'failMessage':_0xab2b('0x4a')})['then'](function(_0x52dfa6){ut[_0xab2b('0x4b')]('[Fax][Message][Error][Updated]',_0x52dfa6);})[_0xab2b('0x44')](function(_0x728d67){ut[_0xab2b('0x4b')]('[Fax][Message][Error][NoUpdate1]',_0x728d67);});}else{ut[_0xab2b('0x4b')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xab2b('0x23')][_0xab2b('0x4c')]=function(_0x6b3444,_0x5912a5,_0x89edda){var _0x2759db=this;var _0x2cf23e={};if(_0x5912a5){_0x2cf23e={'read':_0x5912a5};}else{_0x2cf23e={'failMessage':_0x89edda};}if(this['actions'][_0x6b3444]['AttachmentId']){faxMessage[_0xab2b('0x48')](this[_0xab2b('0x12')][_0x6b3444][_0xab2b('0x49')],_0x2cf23e)[_0xab2b('0x40')](function(_0x198cdf){ut[_0xab2b('0x4b')](_0xab2b('0x4d'),_0x198cdf);})[_0xab2b('0x44')](function(_0x5cb898){ut[_0xab2b('0x4b')]('[Fax][Message][NoUpdate1]',_0x5cb898);})[_0xab2b('0x4e')](function(){delete _0x2759db[_0xab2b('0xf')][_0x6b3444];delete _0x2759db['actions'][_0x6b3444];});}else{ut[_0xab2b('0x4b')](_0xab2b('0x4f'));delete this[_0xab2b('0xf')][_0x6b3444];delete this['actions'][_0x6b3444];}};Fax['prototype'][_0xab2b('0x20')]=function(_0x1d9188){var _0x384f24=this;if(this['channels'][_0x1d9188[_0xab2b('0x29')]]){if(this[_0xab2b('0x12')][_0x1d9188['uniqueid']]){this[_0xab2b('0xf')][_0x1d9188['uniqueid']]['id']=this[_0xab2b('0x12')][_0x1d9188[_0xab2b('0x29')]]['id'];this[_0xab2b('0xf')][_0x1d9188[_0xab2b('0x29')]][_0xab2b('0x2a')]=this[_0xab2b('0x12')][_0x1d9188[_0xab2b('0x29')]][_0xab2b('0x2a')];}logger['info'](_0x1d9188[_0xab2b('0x29')],this[_0xab2b('0x12')][_0x1d9188[_0xab2b('0x29')]]?_0xab2b('0x50'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0xab2b('0xf')][_0x1d9188['uniqueid']]));if(this[_0xab2b('0x12')][_0x1d9188['uniqueid']]){if(this[_0xab2b('0xf')][_0x1d9188[_0xab2b('0x29')]][_0xab2b('0x51')]>0x0&&this[_0xab2b('0xf')][_0x1d9188[_0xab2b('0x29')]]['faxstatus']===_0xab2b('0x52')){this[_0xab2b('0x4c')](_0x1d9188[_0xab2b('0x29')],!![]);}else{this['updateStatus'](_0x1d9188[_0xab2b('0x29')],![],this['channels'][_0x1d9188[_0xab2b('0x29')]]['faxstatusstring']?_0xab2b('0x53')+this[_0xab2b('0xf')][_0x1d9188[_0xab2b('0x29')]][_0xab2b('0x54')]:_0xab2b('0x55'));}}}};Fax[_0xab2b('0x23')][_0xab2b('0x56')]=function(_0x1168a8){var _0x259256=this;return new BPromise(function(_0x4443ed,_0x10de54){_0x259256[_0xab2b('0x57')](_0x1168a8,_0x259256['faxAccounts'][_0x1168a8[_0xab2b('0x58')]])[_0xab2b('0x40')](function(_0x369823){ut['logger'](_0xab2b('0x59'),_0x369823);_0x4443ed(ut['message'](_0xab2b('0x5a')));})[_0xab2b('0x44')](function(_0x535e8d){ut['logger'](_0xab2b('0x5b'),_0x535e8d);updateStatus(_0x1168a8);_0x10de54(ut[_0xab2b('0x5c')](_0xab2b('0x5d')));});});};Fax[_0xab2b('0x23')][_0xab2b('0x5e')]=function(_0x4ae204){var _0x1c49cf=this;return new BPromise(function(_0x3e4f76,_0x12d1dc){var _0x491bcd=_0x1c49cf['checkTrunk'](_0x1c49cf['faxAccounts'][_0x4ae204[_0xab2b('0x58')]][_0xab2b('0x5f')],_0x4ae204);if(_0x491bcd[_0xab2b('0x60')]){_0x3e4f76(ut[_0xab2b('0x5c')]('Trunk\x20Reachable'));}else{_0x12d1dc(ut[_0xab2b('0x5c')](_0x491bcd[_0xab2b('0x5c')]));}});};function originate(_0x2e8c60,_0x4318d5,_0x171389){return new BPromise(function(_0xc15cc1,_0x198887){if(_0x171389){var _0x3da9f9=util[_0xab2b('0x61')](_0xab2b('0x62'),path['parse'](_0x2e8c60[_0xab2b('0x5')])[_0xab2b('0x2a')],_0x2e8c60[_0xab2b('0x5')]);gs['execute'](_0x3da9f9)['then'](function(){_0x2e8c60[_0xab2b('0x5')]=util['format'](_0xab2b('0x63'),path[_0xab2b('0x3d')](_0x2e8c60['path'])[_0xab2b('0x64')],path['parse'](_0x2e8c60[_0xab2b('0x5')])[_0xab2b('0x2a')]);_0x4318d5[_0xab2b('0x65')]=_0x2e8c60['path'];ut[_0xab2b('0x4b')](_0xab2b('0x66'),'');ami[_0xab2b('0x67')](ut[_0xab2b('0x68')](_0x2e8c60,_0x4318d5))[_0xab2b('0x40')](function(_0x40c583){_0xc15cc1(_0x40c583);})[_0xab2b('0x44')](function(_0x9fcea2){_0x198887(_0x9fcea2);});})[_0xab2b('0x44')](function(_0x375275){_0x198887(_0x375275);});}else{ami[_0xab2b('0x67')](ut[_0xab2b('0x68')](_0x2e8c60,_0x4318d5))[_0xab2b('0x40')](function(_0x41ab81){_0xc15cc1(_0x41ab81);})[_0xab2b('0x44')](function(_0x3cbba8){_0x198887(_0x3cbba8);});}});}Fax[_0xab2b('0x23')]['execOriginate']=function(_0x274fe9,_0x9949fe){var _0x1afe56=this;return new BPromise(function(_0x4b6a93,_0xe6fc80){var _0x1d99a1=uuid['v4']();var _0x6d4845=ut[_0xab2b('0x69')](_0x274fe9,_0x9949fe);_0x1afe56[_0xab2b('0x12')][_0x1d99a1]=new Action(_0x1d99a1,_0x9949fe,_0x274fe9);var _0x274f95=_0x1afe56[_0xab2b('0x12')][_0x1d99a1];if(path[_0xab2b('0x3d')](_0x274fe9[_0xab2b('0x5')])[_0xab2b('0x6a')]===_0xab2b('0x3e')){originate(_0x274f95,_0x6d4845,!![])[_0xab2b('0x40')](function(_0x2a4b71){_0x4b6a93(_0x2a4b71);})[_0xab2b('0x44')](function(_0x44afc8){_0xe6fc80(_0x44afc8);});}else{originate(_0x274f95,_0x6d4845,![])[_0xab2b('0x40')](function(_0x4b08de){_0x4b6a93(_0x4b08de);})[_0xab2b('0x44')](function(_0x46f4e9){_0xe6fc80(_0x46f4e9);});}});};Fax['prototype'][_0xab2b('0x6b')]=function(_0x268dca){return!_['isNil'](_0x268dca)&&!_['isNil'](_0x268dca['name'])&&!_['isNil'](_0x268dca[_0xab2b('0x6c')])&&_0x268dca['active']&&!_['isNil'](this['trunks'][util[_0xab2b('0x61')](_0xab2b('0x6d'),_0x268dca[_0xab2b('0x2a')])])&&!_[_0xab2b('0x6e')](this[_0xab2b('0x11')][util[_0xab2b('0x61')](_0xab2b('0x6d'),_0x268dca[_0xab2b('0x2a')])][_0xab2b('0x32')])&&(this[_0xab2b('0x11')][util['format'](_0xab2b('0x6d'),_0x268dca[_0xab2b('0x2a')])]['status']==='reachable'||this['trunks'][util['format']('SIP/%s',_0x268dca[_0xab2b('0x2a')])][_0xab2b('0x32')]===_0xab2b('0x6f'));};Fax[_0xab2b('0x23')][_0xab2b('0x70')]=function(_0xaef90a,_0x25ee30){if(!this[_0xab2b('0x6b')](_0xaef90a)){ut[_0xab2b('0x4b')](_0xab2b('0x71'),_[_0xab2b('0x6e')](_0xaef90a)?'':_0xaef90a[_0xab2b('0x2a')]+_0xab2b('0x72'));return{'isValid':![],'message':_0xab2b('0x73')};}if(_['isNil'](_0x25ee30[_0xab2b('0x9')])){ut[_0xab2b('0x4b')](_0xab2b('0x74'),JSON[_0xab2b('0x43')](_0x25ee30));return{'isValid':![],'message':_0xab2b('0x75')};}if(_['isNil'](_0x25ee30[_0xab2b('0x5')])){ut[_0xab2b('0x4b')](_0xab2b('0x76'),JSON[_0xab2b('0x43')](_0x25ee30));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xab2b('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5712ee4..ef83c53 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 _0x6150=['preview','lodash','../rpc/faxAccount','inspect','notify','catch','bluebird','../../../config/logger'];(function(_0x5a970d,_0x46bb70){var _0x53ede8=function(_0xf60e87){while(--_0xf60e87){_0x5a970d['push'](_0x5a970d['shift']());}};_0x53ede8(++_0x46bb70);}(_0x6150,0x7e));var _0x0615=function(_0x4ddaba,_0x59cec2){_0x4ddaba=_0x4ddaba-0x0;var _0x7d490=_0x6150[_0x4ddaba];return _0x7d490;};'use strict';var util=require('util');var BPromise=require(_0x0615('0x0'));var logger=require(_0x0615('0x1'))(_0x0615('0x2'));var _=require(_0x0615('0x3'));var faxAccount=require(_0x0615('0x4'));function loggerCatch(_0x5705a3){return function(_0x2451f6){logger['error'](_0x5705a3,util[_0x0615('0x5')](_0x2451f6,{'showHidden':![],'depth':null}));};}exports[_0x0615('0x6')]=function(_0x7fd5d7,_0x1f3061){return BPromise['resolve']()['then'](faxAccount['notify'](_0x7fd5d7,_0x1f3061))[_0x0615('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x8458=['then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x404d36,_0x7b86fc){var _0x3599e2=function(_0x594931){while(--_0x594931){_0x404d36['push'](_0x404d36['shift']());}};_0x3599e2(++_0x7b86fc);}(_0x8458,0x1a5));var _0x8845=function(_0x14c8c6,_0x4cfb52){_0x14c8c6=_0x14c8c6-0x0;var _0x43f7cc=_0x8458[_0x14c8c6];return _0x43f7cc;};'use strict';var util=require(_0x8845('0x0'));var BPromise=require('bluebird');var logger=require(_0x8845('0x1'))(_0x8845('0x2'));var _=require(_0x8845('0x3'));var faxAccount=require(_0x8845('0x4'));function loggerCatch(_0x79ebb9){return function(_0x59f76e){logger[_0x8845('0x5')](_0x79ebb9,util[_0x8845('0x6')](_0x59f76e,{'showHidden':![],'depth':null}));};}exports[_0x8845('0x7')]=function(_0x2201e4,_0x1bf1a1){return BPromise['resolve']()[_0x8845('0x8')](faxAccount['notify'](_0x2201e4,_0x1bf1a1))[_0x8845('0x9')](loggerCatch(_0x8845('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ac08bd5..8b12802 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 _0xe970=['bluebird','exec','execute','info','Exec\x20gs','inspect','../../../../config/logger','fax'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe970,0x1c6));var _0x0e97=function(_0x3ea117,_0x5748f2){_0x3ea117=_0x3ea117-0x0;var _0x2334c4=_0xe970[_0x3ea117];return _0x2334c4;};'use strict';var util=require('util');var logger=require(_0x0e97('0x0'))(_0x0e97('0x1'));var BPromise=require(_0x0e97('0x2'));var exec=require('child_process')[_0x0e97('0x3')];exports[_0x0e97('0x4')]=function(_0x5c0317){return new BPromise(function(_0x4ef2cf,_0x401893){exec(_0x5c0317,function(_0xe905b5,_0x159c79,_0x38a87f){logger[_0x0e97('0x5')](_0x0e97('0x6'),_0x159c79);if(_0xe905b5){logger[_0x0e97('0x5')](_0x0e97('0x6'),'\x20Error\x20:',util[_0x0e97('0x7')](_0xe905b5,{'showHidden':![],'depth':null}),_0x159c79,_0x38a87f);_0x401893(_0xe905b5);}_0x4ef2cf(_0x159c79);});});}; \ No newline at end of file +var _0x7513=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x161e82,_0x51b908){var _0x3b265f=function(_0x38a5e4){while(--_0x38a5e4){_0x161e82['push'](_0x161e82['shift']());}};_0x3b265f(++_0x51b908);}(_0x7513,0x188));var _0x3751=function(_0xd204b0,_0x4c7d1d){_0xd204b0=_0xd204b0-0x0;var _0xfc8310=_0x7513[_0xd204b0];return _0xfc8310;};'use strict';var util=require(_0x3751('0x0'));var logger=require(_0x3751('0x1'))(_0x3751('0x2'));var BPromise=require(_0x3751('0x3'));var exec=require(_0x3751('0x4'))[_0x3751('0x5')];exports[_0x3751('0x6')]=function(_0x1e0d8d){return new BPromise(function(_0x3a410c,_0x31d822){exec(_0x1e0d8d,function(_0x10c8e8,_0xa65965,_0x32ff1a){logger[_0x3751('0x7')]('Exec\x20gs',_0xa65965);if(_0x10c8e8){logger[_0x3751('0x7')](_0x3751('0x8'),_0x3751('0x9'),util[_0x3751('0xa')](_0x10c8e8,{'showHidden':![],'depth':null}),_0xa65965,_0x32ff1a);_0x31d822(_0x10c8e8);}_0x3a410c(_0xa65965);});});}; \ 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 3a7128b..fe4d0ad 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 _0x1898=['channel','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','originate'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x1898,0x1df));var _0x8189=function(_0x56f880,_0x246bf5){_0x56f880=_0x56f880-0x0;var _0x4efb46=_0x1898[_0x56f880];return _0x4efb46;};'use strict';var util=require(_0x8189('0x0'));var _=require(_0x8189('0x1'));var moment=require(_0x8189('0x2'));var logger=require(_0x8189('0x3'))(_0x8189('0x4'));exports[_0x8189('0x5')]=function(_0x4b5f85){return{'message':_0x4b5f85};};exports[_0x8189('0x6')]=function(_0x337312,_0x18c7d6){logger[_0x8189('0x7')](_0x337312,util[_0x8189('0x8')](_0x18c7d6,{'showHidden':![],'depth':null}));};exports[_0x8189('0x9')]=function(_0x31f404,_0x4dcb54){var _0x41926f={'XMF-ECM':_0x4dcb54[_0x8189('0xa')],'XMF-HEADERINFO':_0x4dcb54[_0x8189('0xb')],'XMF-MINRATE':_0x4dcb54['minrate'],'XMF-MAXRATE':_0x4dcb54['maxrate'],'XMF-MODEM':util[_0x8189('0xc')](_0x8189('0xd'),_0x4dcb54[_0x8189('0xe')]),'XMF-GATEWAY':_0x4dcb54['gateway'],'XMF-FAXDETECT':_0x4dcb54[_0x8189('0xf')],'XMF-T38TIMEOUT':_0x4dcb54[_0x8189('0x10')],'XMF-LOCALSTATIONID':_0x4dcb54['localstationid'],'XMF-PATH':_0x31f404[_0x8189('0x11')]};return _0x41926f;};exports[_0x8189('0x12')]=function(_0x2cb7dc,_0x5c6a1e){return{'actionid':_0x2cb7dc[_0x8189('0x13')],'action':_0x8189('0x14'),'channel':_0x2cb7dc[_0x8189('0x15')],'Exten':_0x8189('0x16'),'Context':'from-sip','Priority':'1','callerid':util[_0x8189('0xc')](_0x8189('0x17'),_0x2cb7dc['headerinfo']?_0x2cb7dc[_0x8189('0xb')]:'',_0x2cb7dc[_0x8189('0x18')]),'variable':_0x5c6a1e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2cb7dc[_0x8189('0x13')]};}; \ No newline at end of file +var _0xd08f=['maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate'];(function(_0x205c34,_0x57d036){var _0x10e8fe=function(_0x4f5690){while(--_0x4f5690){_0x205c34['push'](_0x205c34['shift']());}};_0x10e8fe(++_0x57d036);}(_0xd08f,0x16c));var _0xfd08=function(_0x143620,_0x2738da){_0x143620=_0x143620-0x0;var _0x24fcec=_0xd08f[_0x143620];return _0x24fcec;};'use strict';var util=require(_0xfd08('0x0'));var _=require(_0xfd08('0x1'));var moment=require('moment');var logger=require(_0xfd08('0x2'))(_0xfd08('0x3'));exports[_0xfd08('0x4')]=function(_0x400a00){return{'message':_0x400a00};};exports[_0xfd08('0x5')]=function(_0x1c3b35,_0x50fb0b){logger[_0xfd08('0x6')](_0x1c3b35,util[_0xfd08('0x7')](_0x50fb0b,{'showHidden':![],'depth':null}));};exports[_0xfd08('0x8')]=function(_0x108713,_0x2004dc){var _0x5197cb={'XMF-ECM':_0x2004dc['ecm'],'XMF-HEADERINFO':_0x2004dc[_0xfd08('0x9')],'XMF-MINRATE':_0x2004dc[_0xfd08('0xa')],'XMF-MAXRATE':_0x2004dc[_0xfd08('0xb')],'XMF-MODEM':util[_0xfd08('0xc')](_0xfd08('0xd'),_0x2004dc[_0xfd08('0xe')]),'XMF-GATEWAY':_0x2004dc[_0xfd08('0xf')],'XMF-FAXDETECT':_0x2004dc['faxdetect'],'XMF-T38TIMEOUT':_0x2004dc[_0xfd08('0x10')],'XMF-LOCALSTATIONID':_0x2004dc[_0xfd08('0x11')],'XMF-PATH':_0x108713['path']};return _0x5197cb;};exports[_0xfd08('0x12')]=function(_0x3f8e6b,_0x3a634a){return{'actionid':_0x3f8e6b['uniqueid'],'action':_0xfd08('0x13'),'channel':_0x3f8e6b[_0xfd08('0x14')],'Exten':_0xfd08('0x15'),'Context':_0xfd08('0x16'),'Priority':'1','callerid':util['format'](_0xfd08('0x17'),_0x3f8e6b[_0xfd08('0x9')]?_0x3f8e6b[_0xfd08('0x9')]:'',_0x3f8e6b['localstationid']),'variable':_0x3a634a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f8e6b[_0xfd08('0x18')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 3b4c948..ddbc59a 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 _0x0b33=['then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','log','sync','bluebird','util','moment','./server','./report','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','hour'];(function(_0x27dfe7,_0x3acd6f){var _0x9d647c=function(_0x200340){while(--_0x200340){_0x27dfe7['push'](_0x27dfe7['shift']());}};_0x9d647c(++_0x3acd6f);}(_0x0b33,0x114));var _0x30b3=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x0b33[_0x235f49];return _0x551139;};'use strict';var BPromise=require(_0x30b3('0x0'));var util=require(_0x30b3('0x1'));var moment=require(_0x30b3('0x2'));var server=require(_0x30b3('0x3'));var Realtime=require('./realtime');var Report=require(_0x30b3('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x30b3('0x5'));var Preview=require(_0x30b3('0x6'));var Fax=require('./fax');var user=require(_0x30b3('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x30b3('0x8'));var voiceCallReport=require(_0x30b3('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x30b3('0xa'));var template=require(_0x30b3('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x30b3('0xc'));var voiceExtension=require(_0x30b3('0xd'));var faxAccount=require(_0x30b3('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x30b3('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x30b3('0x10'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x30b3('0x11'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x30b3('0x12'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x30b3('0x12'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x30b3('0x13')](user[_0x30b3('0x14')]())['then'](realtime[_0x30b3('0x15')]())[_0x30b3('0x13')](user[_0x30b3('0x16')]())['then'](realtime[_0x30b3('0x17')]())[_0x30b3('0x13')](trunk['getTrunks']())[_0x30b3('0x13')](realtime[_0x30b3('0x18')]())[_0x30b3('0x13')](voiceQueue[_0x30b3('0x19')]())['then'](realtime[_0x30b3('0x1a')]())[_0x30b3('0x13')](trigger[_0x30b3('0x1b')]())[_0x30b3('0x13')](realtime['initTriggers']())[_0x30b3('0x13')](template[_0x30b3('0x1c')]())[_0x30b3('0x13')](realtime[_0x30b3('0x1d')]())['then'](zendesk[_0x30b3('0x1e')]())[_0x30b3('0x13')](realtime[_0x30b3('0x1f')]())[_0x30b3('0x13')](salesforce[_0x30b3('0x20')]())['then'](realtime[_0x30b3('0x21')]())[_0x30b3('0x13')](sugarcrm[_0x30b3('0x22')]())[_0x30b3('0x13')](realtime['initSugarcrmAccounts']())[_0x30b3('0x13')](freshdesk[_0x30b3('0x23')]())[_0x30b3('0x13')](realtime[_0x30b3('0x24')]())[_0x30b3('0x13')](desk[_0x30b3('0x25')]())[_0x30b3('0x13')](realtime[_0x30b3('0x26')]())[_0x30b3('0x13')](zoho[_0x30b3('0x27')]())[_0x30b3('0x13')](realtime[_0x30b3('0x28')]())[_0x30b3('0x13')](vtiger[_0x30b3('0x29')]())[_0x30b3('0x13')](realtime[_0x30b3('0x2a')]())['then'](servicenow['getServicenowAccounts']())[_0x30b3('0x13')](realtime[_0x30b3('0x2b')]())[_0x30b3('0x13')](dynamics365[_0x30b3('0x2c')]())[_0x30b3('0x13')](realtime['initDynamics365Accounts']())[_0x30b3('0x13')](campaign['getCampaigns']())[_0x30b3('0x13')](realtime[_0x30b3('0x2d')]())[_0x30b3('0x13')](voiceExtension[_0x30b3('0x2e')]())[_0x30b3('0x13')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x30b3('0x2f')]())['then'](realtime[_0x30b3('0x30')]())[_0x30b3('0x13')](function(){return realtime;});}function initParams(){return BPromise[_0x30b3('0x31')]()['then'](voiceQueueReport[_0x30b3('0x32')]())[_0x30b3('0x13')](realtime[_0x30b3('0x33')]())['then'](cmHopperHistory[_0x30b3('0x34')]())[_0x30b3('0x13')](realtime[_0x30b3('0x35')]())['then'](cmHopperHistory[_0x30b3('0x36')]())[_0x30b3('0x13')](realtime[_0x30b3('0x37')]())[_0x30b3('0x13')](voiceCallReport['getVoiceCallReports']())[_0x30b3('0x13')](realtime[_0x30b3('0x38')]())[_0x30b3('0x13')](function(_0x3df8a0){})['catch'](function(_0x391c6d){console[_0x30b3('0x39')](_0x391c6d);});}function main(){return server['listen'](realtime,preview,fax)[_0x30b3('0x13')](function(_0x3db6f8){return initRealtime();})[_0x30b3('0x13')](function(){return initParams();})[_0x30b3('0x13')](function(){report[_0x30b3('0x3a')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4525b5){console[_0x30b3('0x39')](_0x4525b5);});}main(); \ No newline at end of file +var _0xbdfb=['getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts'];(function(_0x4e2882,_0x51be9f){var _0x2dc199=function(_0x31dd2a){while(--_0x31dd2a){_0x4e2882['push'](_0x4e2882['shift']());}};_0x2dc199(++_0x51be9f);}(_0xbdfb,0x10b));var _0xbbdf=function(_0x104112,_0x342eb6){_0x104112=_0x104112-0x0;var _0x394ab4=_0xbdfb[_0x104112];return _0x394ab4;};'use strict';var BPromise=require(_0xbbdf('0x0'));var util=require(_0xbbdf('0x1'));var moment=require(_0xbbdf('0x2'));var server=require('./server');var Realtime=require(_0xbbdf('0x3'));var Report=require(_0xbbdf('0x4'));var Acw=require(_0xbbdf('0x5'));var Trigger=require(_0xbbdf('0x6'));var Dialer=require(_0xbbdf('0x7'));var Preview=require(_0xbbdf('0x8'));var Fax=require('./fax');var user=require(_0xbbdf('0x9'));var voiceQueue=require(_0xbbdf('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xbbdf('0xb'));var trigger=require(_0xbbdf('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbbdf('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xbbdf('0xe'));var salesforce=require(_0xbbdf('0xf'));var sugarcrm=require(_0xbbdf('0x10'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xbbdf('0x11'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xbbdf('0x12'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbbdf('0x13')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbbdf('0x13')](_0xbbdf('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbbdf('0x15')]()[_0xbbdf('0x16')](user['getAgents']())[_0xbbdf('0x16')](realtime[_0xbbdf('0x17')]())['then'](user[_0xbbdf('0x18')]())['then'](realtime['initTelephones']())[_0xbbdf('0x16')](trunk[_0xbbdf('0x19')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x1a')]())['then'](voiceQueue[_0xbbdf('0x1b')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x1c')]())[_0xbbdf('0x16')](trigger[_0xbbdf('0x1d')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x1e')]())[_0xbbdf('0x16')](template[_0xbbdf('0x1f')]())['then'](realtime['initTemplates']())[_0xbbdf('0x16')](zendesk[_0xbbdf('0x20')]())['then'](realtime[_0xbbdf('0x21')]())[_0xbbdf('0x16')](salesforce['getSalesforceAccounts']())[_0xbbdf('0x16')](realtime[_0xbbdf('0x22')]())[_0xbbdf('0x16')](sugarcrm[_0xbbdf('0x23')]())[_0xbbdf('0x16')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xbbdf('0x24')]())['then'](realtime['initFreshdeskAccounts']())[_0xbbdf('0x16')](desk[_0xbbdf('0x25')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x26')]())['then'](zoho[_0xbbdf('0x27')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x28')]())[_0xbbdf('0x16')](vtiger[_0xbbdf('0x29')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x2a')]())[_0xbbdf('0x16')](servicenow[_0xbbdf('0x2b')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x2c')]())['then'](dynamics365[_0xbbdf('0x2d')]())[_0xbbdf('0x16')](realtime['initDynamics365Accounts']())['then'](campaign[_0xbbdf('0x2e')]())['then'](realtime[_0xbbdf('0x2f')]())[_0xbbdf('0x16')](voiceExtension[_0xbbdf('0x30')]())['then'](realtime[_0xbbdf('0x31')]())['then'](faxAccount[_0xbbdf('0x32')]())['then'](realtime[_0xbbdf('0x33')]())[_0xbbdf('0x16')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xbbdf('0x16')](voiceQueueReport['getVoiceQueueReports']())[_0xbbdf('0x16')](realtime[_0xbbdf('0x34')]())['then'](cmHopperHistory[_0xbbdf('0x35')]())['then'](realtime[_0xbbdf('0x36')]())['then'](cmHopperHistory[_0xbbdf('0x37')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x38')]())[_0xbbdf('0x16')](voiceCallReport[_0xbbdf('0x39')]())[_0xbbdf('0x16')](realtime[_0xbbdf('0x3a')]())[_0xbbdf('0x16')](function(_0x3dcca3){})[_0xbbdf('0x3b')](function(_0x236aa8){console[_0xbbdf('0x3c')](_0x236aa8);});}function main(){return server['listen'](realtime,preview,fax)[_0xbbdf('0x16')](function(_0xb080e4){return initRealtime();})[_0xbbdf('0x16')](function(){return initParams();})[_0xbbdf('0x16')](function(){report[_0xbbdf('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x365230){console[_0xbbdf('0x3c')](_0x365230);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f80cacb..82440ff 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 _0xedb2=['address','interface','online','voiceStatus','local','prototype','state','toLowerCase','not_inuse','idle','talking','statePause','format','voiceStatusTime','voiceStatusCallerIdNumber','onhold','stringify','md5','user:%s','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status'];(function(_0x500808,_0xc7803e){var _0x5db569=function(_0x4d40e0){while(--_0x4d40e0){_0x500808['push'](_0x500808['shift']());}};_0x5db569(++_0xc7803e);}(_0xedb2,0xbe));var _0x2edb=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xedb2[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x2edb('0x0'));var util=require(_0x2edb('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x2edb('0x2'));var config=require(_0x2edb('0x3'));config[_0x2edb('0x4')]=_[_0x2edb('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2edb('0x6'))(new Redis(config[_0x2edb('0x4')]));function Agent(_0x3311e3){this['id']=_0x3311e3['id']||0x0;this['name']=_0x3311e3[_0x2edb('0x7')]||'';this[_0x2edb('0x8')]=_0x3311e3[_0x2edb('0x8')]||'';this[_0x2edb('0x9')]=_0x3311e3[_0x2edb('0x9')]||'';this[_0x2edb('0xa')]=_0x3311e3[_0x2edb('0xa')]||'';this['state']=_0x2edb('0xb');this[_0x2edb('0xc')]=0x0;this[_0x2edb('0xd')]=_0x2edb('0xb');this[_0x2edb('0xe')]='';this['phone']='';this['mobile']='';this[_0x2edb('0xf')]='';this[_0x2edb('0x10')]=_0x3311e3[_0x2edb('0x10')]||![];this[_0x2edb('0x11')]=_0x2edb('0xb');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x2edb('0x12')]=![];this['md5']='';}Agent[_0x2edb('0x13')]['updateStatusRealtime']=function(_0xc24ed6){var _0x1c14f2;if(_0xc24ed6&&_0xc24ed6[_0x2edb('0x14')]){_0x1c14f2=_0xc24ed6[_0x2edb('0x14')][_0x2edb('0x15')]();switch(_0x1c14f2){case _0x2edb('0x16'):_0x1c14f2=_0x2edb('0x17');break;case'inuse':_0x1c14f2=_0x2edb('0x18');break;}}if(_0x1c14f2&&this[_0x2edb('0x11')]!==_0x1c14f2||_0xc24ed6[_0x2edb('0x19')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x2edb('0x1a')]('x'));}if(_0x1c14f2){this[_0x2edb('0x11')]=_0x1c14f2;}var _0x2b497d={'id':this['id'],'name':this['name'],'email':this[_0x2edb('0x8')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x2edb('0x14')],'stateTime':this['stateTime'],'status':this[_0x2edb('0xd')],'address':this[_0x2edb('0xe')],'online':this[_0x2edb('0x10')],'voiceStatus':this[_0x2edb('0x11')],'voiceStatusTime':this[_0x2edb('0x1b')],'voiceStatusCallerIdNumber':this[_0x2edb('0x1c')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x2edb('0xf')],'onhold':this[_0x2edb('0x1d')]};var _0x170526=md5(JSON[_0x2edb('0x1e')](_0x2b497d));if(this['md5']!==_0x170526){this[_0x2edb('0x1f')]=_0x170526;io['to'](util[_0x2edb('0x1a')](_0x2edb('0x20'),_0x2b497d[_0x2edb('0x7')]))['emit']('user:save',_0x2b497d);}};module[_0x2edb('0x21')]=Agent; \ No newline at end of file +var _0x628f=['idle','inuse','statePause','format','name','interface','user:%s','exports','lodash','util','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','email','accountcode','fullname','state','unknown','stateTime','status','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse'];(function(_0x344f01,_0x2815ee){var _0x92719a=function(_0xf2560c){while(--_0xf2560c){_0x344f01['push'](_0x344f01['shift']());}};_0x92719a(++_0x2815ee);}(_0x628f,0x74));var _0xf628=function(_0x5dbb3e,_0x4b494d){_0x5dbb3e=_0x5dbb3e-0x0;var _0x138d23=_0x628f[_0x5dbb3e];return _0x138d23;};'use strict';var _=require(_0xf628('0x0'));var util=require(_0xf628('0x1'));var moment=require(_0xf628('0x2'));var md5=require(_0xf628('0x3'));var Redis=require(_0xf628('0x4'));var config=require(_0xf628('0x5'));config['redis']=_[_0xf628('0x6')](config[_0xf628('0x7')],{'host':_0xf628('0x8'),'port':0x18eb});var io=require(_0xf628('0x9'))(new Redis(config['redis']));function Agent(_0x4f8ccf){this['id']=_0x4f8ccf['id']||0x0;this['name']=_0x4f8ccf['name']||'';this['email']=_0x4f8ccf[_0xf628('0xa')]||'';this[_0xf628('0xb')]=_0x4f8ccf[_0xf628('0xb')]||'';this[_0xf628('0xc')]=_0x4f8ccf[_0xf628('0xc')]||'';this[_0xf628('0xd')]=_0xf628('0xe');this[_0xf628('0xf')]=0x0;this[_0xf628('0x10')]=_0xf628('0xe');this['address']='';this[_0xf628('0x11')]='';this[_0xf628('0x12')]='';this['interface']='';this[_0xf628('0x13')]=_0x4f8ccf[_0xf628('0x13')]||![];this[_0xf628('0x14')]=_0xf628('0xe');this[_0xf628('0x15')]=0x0;this[_0xf628('0x16')]='';this[_0xf628('0x17')]='';this[_0xf628('0x18')]=![];this['local']=![];this[_0xf628('0x3')]='';}Agent[_0xf628('0x19')]['updateStatusRealtime']=function(_0x5cb210){var _0x4292ca;if(_0x5cb210&&_0x5cb210['state']){_0x4292ca=_0x5cb210['state'][_0xf628('0x1a')]();switch(_0x4292ca){case _0xf628('0x1b'):_0x4292ca=_0xf628('0x1c');break;case _0xf628('0x1d'):_0x4292ca='talking';break;}}if(_0x4292ca&&this['voiceStatus']!==_0x4292ca||_0x5cb210[_0xf628('0x1e')]){this[_0xf628('0x15')]=_['toNumber'](moment()[_0xf628('0x1f')]('x'));}if(_0x4292ca){this['voiceStatus']=_0x4292ca;}var _0x51efba={'id':this['id'],'name':this[_0xf628('0x20')],'email':this[_0xf628('0xa')],'accountcode':this[_0xf628('0xb')],'fullname':this[_0xf628('0xc')],'state':this[_0xf628('0xd')],'stateTime':this[_0xf628('0xf')],'status':this[_0xf628('0x10')],'address':this['address'],'online':this[_0xf628('0x13')],'voiceStatus':this[_0xf628('0x14')],'voiceStatusTime':this[_0xf628('0x15')],'voiceStatusCallerIdNumber':this[_0xf628('0x16')],'voiceStatusQueue':this[_0xf628('0x17')],'interface':this[_0xf628('0x21')],'onhold':this[_0xf628('0x18')]};var _0x25a019=md5(JSON['stringify'](_0x51efba));if(this[_0xf628('0x3')]!==_0x25a019){this[_0xf628('0x3')]=_0x25a019;io['to'](util[_0xf628('0x1f')](_0xf628('0x22'),_0x51efba[_0xf628('0x20')]))['emit']('user:save',_0x51efba);}};module[_0xf628('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 50c44db..4989f15 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 _0x823c=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x3deb3c,_0x230f4c){var _0x501e53=function(_0x45b46b){while(--_0x45b46b){_0x3deb3c['push'](_0x3deb3c['shift']());}};_0x501e53(++_0x230f4c);}(_0x823c,0x143));var _0xc823=function(_0x3e7f0a,_0x137128){_0x3e7f0a=_0x3e7f0a-0x0;var _0x4be0c2=_0x823c[_0x3e7f0a];return _0x4be0c2;};'use strict';function Campaign(_0x1ab2d4){this['id']=_0x1ab2d4['id']||0x0;this['name']=_0x1ab2d4[_0xc823('0x0')]||'';this[_0xc823('0x1')]=_0x1ab2d4[_0xc823('0x1')]||_0xc823('0x2');this[_0xc823('0x3')]=0x0;this[_0xc823('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xc823('0x5')]=0x0;this[_0xc823('0x6')]='';this[_0xc823('0x7')]=!![];this[_0xc823('0x8')]=_0x1ab2d4[_0xc823('0x8')];this['limitCalls']=_0x1ab2d4[_0xc823('0x9')];this[_0xc823('0xa')]=_0x1ab2d4['dialTimezone']||null;this['dialGlobalInterval']=_0x1ab2d4[_0xc823('0xb')]?_0x1ab2d4[_0xc823('0xb')]:null;this['dialOriginateCallerIdName']=_0x1ab2d4[_0xc823('0xc')];this[_0xc823('0xd')]=_0x1ab2d4['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x1ab2d4[_0xc823('0xe')]||0x1e;this[_0xc823('0xf')]=_0x1ab2d4[_0xc823('0xf')];this[_0xc823('0x10')]=_0x1ab2d4[_0xc823('0x10')];this['dialBusyMaxRetry']=_0x1ab2d4[_0xc823('0x11')];this[_0xc823('0x12')]=_0x1ab2d4[_0xc823('0x12')];this[_0xc823('0x13')]=_0x1ab2d4[_0xc823('0x13')];this[_0xc823('0x14')]=_0x1ab2d4['dialNoAnswerRetryFrequency'];this[_0xc823('0x15')]=_0x1ab2d4[_0xc823('0x15')];this[_0xc823('0x16')]=_0x1ab2d4[_0xc823('0x16')]||'DESC';this['dialPrefix']=_0x1ab2d4['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1ab2d4[_0xc823('0x17')]||undefined;this['dialCutDigit']=_0x1ab2d4[_0xc823('0x18')]||undefined;this[_0xc823('0x19')]=_0x1ab2d4[_0xc823('0x19')]?_0x1ab2d4[_0xc823('0x19')]:undefined;this[_0xc823('0x1a')]=_0x1ab2d4[_0xc823('0x1a')]?_0x1ab2d4[_0xc823('0x1a')]:undefined;this['Interval']=_0x1ab2d4[_0xc823('0x1b')]?_0x1ab2d4['Interval']:undefined;this[_0xc823('0x1c')]=_0x1ab2d4[_0xc823('0x1c')]?_0x1ab2d4[_0xc823('0x1c')]:undefined;this['dialQueueProject']=_0x1ab2d4[_0xc823('0x1c')]?_0x1ab2d4[_0xc823('0x1c')][_0xc823('0x0')]:undefined;this['dialAMDActive']=_0x1ab2d4[_0xc823('0x1d')]||![];this[_0xc823('0x1e')]=_0x1ab2d4[_0xc823('0x1e')];this[_0xc823('0x1f')]=_0x1ab2d4[_0xc823('0x1f')];this[_0xc823('0x20')]=_0x1ab2d4['dialAMDAfterGreetingSilence'];this[_0xc823('0x21')]=_0x1ab2d4['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x1ab2d4[_0xc823('0x22')];this[_0xc823('0x23')]=_0x1ab2d4['dialAMDBetweenWordsSilence'];this[_0xc823('0x24')]=_0x1ab2d4[_0xc823('0x24')];this[_0xc823('0x25')]=_0x1ab2d4[_0xc823('0x25')];this[_0xc823('0x26')]=_0x1ab2d4[_0xc823('0x26')];}module[_0xc823('0x27')]=Campaign; \ No newline at end of file +var _0x1339=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x21b198,_0x375121){var _0x571041=function(_0x2ac1b6){while(--_0x2ac1b6){_0x21b198['push'](_0x21b198['shift']());}};_0x571041(++_0x375121);}(_0x1339,0x1ed));var _0x9133=function(_0x25a999,_0x1c2469){_0x25a999=_0x25a999-0x0;var _0x5535d6=_0x1339[_0x25a999];return _0x5535d6;};'use strict';function Campaign(_0x421620){this['id']=_0x421620['id']||0x0;this['name']=_0x421620[_0x9133('0x0')]||'';this[_0x9133('0x1')]=_0x421620[_0x9133('0x1')]||_0x9133('0x2');this[_0x9133('0x3')]=0x0;this[_0x9133('0x4')]=0x0;this[_0x9133('0x5')]=0x0;this[_0x9133('0x6')]=0x0;this['message']='';this[_0x9133('0x7')]=!![];this[_0x9133('0x8')]=_0x421620[_0x9133('0x8')];this['limitCalls']=_0x421620[_0x9133('0x9')];this[_0x9133('0xa')]=_0x421620[_0x9133('0xa')]||null;this[_0x9133('0xb')]=_0x421620[_0x9133('0xb')]?_0x421620[_0x9133('0xb')]:null;this[_0x9133('0xc')]=_0x421620[_0x9133('0xc')];this[_0x9133('0xd')]=_0x421620[_0x9133('0xd')];this['dialOriginateTimeout']=_0x421620[_0x9133('0xe')]||0x1e;this[_0x9133('0xf')]=_0x421620[_0x9133('0xf')];this[_0x9133('0x10')]=_0x421620[_0x9133('0x10')];this[_0x9133('0x11')]=_0x421620['dialBusyMaxRetry'];this[_0x9133('0x12')]=_0x421620[_0x9133('0x12')];this['dialNoAnswerMaxRetry']=_0x421620['dialNoAnswerMaxRetry'];this[_0x9133('0x13')]=_0x421620['dialNoAnswerRetryFrequency'];this[_0x9133('0x14')]=_0x421620[_0x9133('0x14')];this[_0x9133('0x15')]=_0x421620[_0x9133('0x15')]||_0x9133('0x16');this[_0x9133('0x17')]=_0x421620['dialPrefix']||undefined;this[_0x9133('0x18')]=_0x421620[_0x9133('0x18')]||undefined;this['dialCutDigit']=_0x421620[_0x9133('0x19')]||undefined;this[_0x9133('0x1a')]=_0x421620[_0x9133('0x1a')]?_0x421620[_0x9133('0x1a')]:undefined;this['Trunk']=_0x421620[_0x9133('0x1b')]?_0x421620['Trunk']:undefined;this[_0x9133('0x1c')]=_0x421620['Interval']?_0x421620[_0x9133('0x1c')]:undefined;this[_0x9133('0x1d')]=_0x421620['SquareProject']?_0x421620[_0x9133('0x1d')]:undefined;this['dialQueueProject']=_0x421620[_0x9133('0x1d')]?_0x421620['SquareProject']['name']:undefined;this[_0x9133('0x1e')]=_0x421620['dialAMDActive']||![];this[_0x9133('0x1f')]=_0x421620['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x421620['dialAMDGreeting'];this[_0x9133('0x20')]=_0x421620[_0x9133('0x20')];this['dialAMDTotalAnalysisTime']=_0x421620[_0x9133('0x21')];this[_0x9133('0x22')]=_0x421620[_0x9133('0x22')];this[_0x9133('0x23')]=_0x421620['dialAMDBetweenWordsSilence'];this[_0x9133('0x24')]=_0x421620['dialAMDMaximumNumberOfWords'];this[_0x9133('0x25')]=_0x421620[_0x9133('0x25')];this[_0x9133('0x26')]=_0x421620[_0x9133('0x26')];}module[_0x9133('0x27')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 5c57b46..4c1e6c3 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 _0x1a37=['endtime','unmanaged','abandoned','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x1a37,0xb4));var _0x71a3=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x1a37[_0x256b72];return _0x2183e3;};'use strict';function Channel(){this[_0x71a3('0x0')]=null;this[_0x71a3('0x1')]='';this[_0x71a3('0x2')]='';this[_0x71a3('0x3')]=0x0;this[_0x71a3('0x4')]='';this[_0x71a3('0x5')]=undefined;this[_0x71a3('0x6')]=undefined;this[_0x71a3('0x7')]=0x0;this[_0x71a3('0x8')]='';this[_0x71a3('0x9')]=0x0;this['linkedid']=0x0;this[_0x71a3('0xa')]=0x0;this['answered']=![];this[_0x71a3('0xb')]=null;this[_0x71a3('0xc')]=null;this[_0x71a3('0xd')]=![];this[_0x71a3('0xe')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x71a3('0xf')]=0x0;this[_0x71a3('0x10')]=null;this[_0x71a3('0x11')]=null;this[_0x71a3('0x12')]=null;this[_0x71a3('0x13')]=![];this[_0x71a3('0x14')]=null;this[_0x71a3('0x15')]=null;this[_0x71a3('0x16')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x71a3('0x17')]=Channel; \ No newline at end of file +var _0x97ce=['channel','destinationchannel','calleridnum','connectedlinenum','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','billableseconds','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime'];(function(_0x1f2e04,_0x1dc433){var _0x9b4e61=function(_0x250f8f){while(--_0x250f8f){_0x1f2e04['push'](_0x1f2e04['shift']());}};_0x9b4e61(++_0x1dc433);}(_0x97ce,0x151));var _0xe97c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x97ce[_0x1da527];return _0x40fc7c;};'use strict';function Channel(){this[_0xe97c('0x0')]=null;this[_0xe97c('0x1')]='';this[_0xe97c('0x2')]='';this[_0xe97c('0x3')]=0x0;this['calleridname']='';this[_0xe97c('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xe97c('0x5')]=0x0;this['context']='';this[_0xe97c('0x6')]=0x0;this[_0xe97c('0x7')]=0x0;this[_0xe97c('0x8')]=0x0;this[_0xe97c('0x9')]=![];this[_0xe97c('0xa')]=null;this[_0xe97c('0xb')]=null;this['unmanaged']=![];this[_0xe97c('0xc')]=![];this[_0xe97c('0xd')]='';this[_0xe97c('0xe')]='';this['duration']=0x0;this[_0xe97c('0xf')]=0x0;this['holdtime']=0x0;this[_0xe97c('0x10')]=null;this[_0xe97c('0x11')]=null;this[_0xe97c('0x12')]=null;this[_0xe97c('0x13')]=![];this[_0xe97c('0x14')]=null;this[_0xe97c('0x15')]=null;this[_0xe97c('0x16')]=[];this['transfercalleridnum']=undefined;this[_0xe97c('0x17')]=undefined;this[_0xe97c('0x18')]=0x0;}module[_0xe97c('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 19281ad..5ae23f7 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 _0xd2ef=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x497e13,_0x55fd6e){var _0x5a3d57=function(_0x510e08){while(--_0x510e08){_0x497e13['push'](_0x497e13['shift']());}};_0x5a3d57(++_0x55fd6e);}(_0xd2ef,0x1cf));var _0xfd2e=function(_0x15ea5c,_0x100b8e){_0x15ea5c=_0x15ea5c-0x0;var _0x21f8d8=_0xd2ef[_0x15ea5c];return _0x21f8d8;};'use strict';function DeskAccount(_0xdbf963){this['id']=_0xdbf963['id']||0x0;this[_0xfd2e('0x0')]=_0xdbf963[_0xfd2e('0x0')]||'';this[_0xfd2e('0x1')]=_0xdbf963[_0xfd2e('0x1')]||'';this[_0xfd2e('0x2')]=_0xdbf963['remoteUri']||'';this['authType']=_0xdbf963[_0xfd2e('0x3')]||'';this[_0xfd2e('0x4')]=_0xdbf963[_0xfd2e('0x4')]||'';this['consumerKey']=_0xdbf963[_0xfd2e('0x5')]||'';this[_0xfd2e('0x6')]=_0xdbf963[_0xfd2e('0x6')]||'';this[_0xfd2e('0x7')]=_0xdbf963[_0xfd2e('0x7')]||'';this['tokenSecret']=_0xdbf963[_0xfd2e('0x8')]||'';this[_0xfd2e('0x9')]=_0xdbf963[_0xfd2e('0x9')]||'';this['serverUrl']=_0xdbf963[_0xfd2e('0xa')]||'';this[_0xfd2e('0xb')]=_0xdbf963[_0xfd2e('0xb')]||{};}module[_0xfd2e('0xc')]=DeskAccount; \ No newline at end of file +var _0x0ac7=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x4fbe57,_0x4d3b8d){var _0x3acacb=function(_0x49ba36){while(--_0x49ba36){_0x4fbe57['push'](_0x4fbe57['shift']());}};_0x3acacb(++_0x4d3b8d);}(_0x0ac7,0xfb));var _0x70ac=function(_0x27fd5e,_0x4afc3a){_0x27fd5e=_0x27fd5e-0x0;var _0x4f8984=_0x0ac7[_0x27fd5e];return _0x4f8984;};'use strict';function DeskAccount(_0x37344a){this['id']=_0x37344a['id']||0x0;this[_0x70ac('0x0')]=_0x37344a[_0x70ac('0x0')]||'';this[_0x70ac('0x1')]=_0x37344a[_0x70ac('0x1')]||'';this[_0x70ac('0x2')]=_0x37344a['remoteUri']||'';this[_0x70ac('0x3')]=_0x37344a[_0x70ac('0x3')]||'';this[_0x70ac('0x4')]=_0x37344a[_0x70ac('0x4')]||'';this[_0x70ac('0x5')]=_0x37344a['consumerKey']||'';this[_0x70ac('0x6')]=_0x37344a[_0x70ac('0x6')]||'';this[_0x70ac('0x7')]=_0x37344a[_0x70ac('0x7')]||'';this[_0x70ac('0x8')]=_0x37344a[_0x70ac('0x8')]||'';this[_0x70ac('0x9')]=_0x37344a[_0x70ac('0x9')]||'';this[_0x70ac('0xa')]=_0x37344a[_0x70ac('0xa')]||'';this[_0x70ac('0xb')]=_0x37344a[_0x70ac('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 90d0b52..9641a2b 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 _0x81f4=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x310990,_0x245984){var _0x648534=function(_0xd320e5){while(--_0xd320e5){_0x310990['push'](_0x310990['shift']());}};_0x648534(++_0x245984);}(_0x81f4,0x145));var _0x481f=function(_0xa00a61,_0x17b3a4){_0xa00a61=_0xa00a61-0x0;var _0x1041e0=_0x81f4[_0xa00a61];return _0x1041e0;};'use strict';function Dynamics365Account(_0x39abe4){this['id']=_0x39abe4['id']||0x0;this[_0x481f('0x0')]=_0x39abe4[_0x481f('0x0')]||'';this[_0x481f('0x1')]=_0x39abe4['username']||'';this[_0x481f('0x2')]=_0x39abe4[_0x481f('0x2')]||'';this['remoteUri']=_0x39abe4[_0x481f('0x3')]||'';this['tenantId']=_0x39abe4[_0x481f('0x4')]||'';this[_0x481f('0x5')]=_0x39abe4[_0x481f('0x5')]||'';this[_0x481f('0x6')]=_0x39abe4[_0x481f('0x6')]||{};this[_0x481f('0x7')]=_0x39abe4['serverUrl']||'';this[_0x481f('0x8')]=_0x39abe4[_0x481f('0x8')]||{};}module[_0x481f('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xbf5d=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x5dc9f5,_0x5362c7){var _0x4faea5=function(_0x5e2d0d){while(--_0x5e2d0d){_0x5dc9f5['push'](_0x5dc9f5['shift']());}};_0x4faea5(++_0x5362c7);}(_0xbf5d,0x71));var _0xdbf5=function(_0xbf8760,_0x1d106b){_0xbf8760=_0xbf8760-0x0;var _0x25f0ed=_0xbf5d[_0xbf8760];return _0x25f0ed;};'use strict';function Dynamics365Account(_0x50c2f5){this['id']=_0x50c2f5['id']||0x0;this[_0xdbf5('0x0')]=_0x50c2f5[_0xdbf5('0x0')]||'';this['username']=_0x50c2f5[_0xdbf5('0x1')]||'';this[_0xdbf5('0x2')]=_0x50c2f5['password']||'';this[_0xdbf5('0x3')]=_0x50c2f5['remoteUri']||'';this[_0xdbf5('0x4')]=_0x50c2f5[_0xdbf5('0x4')]||'';this[_0xdbf5('0x5')]=_0x50c2f5[_0xdbf5('0x5')]||'';this[_0xdbf5('0x6')]=_0x50c2f5['clientSecret']||{};this[_0xdbf5('0x7')]=_0x50c2f5[_0xdbf5('0x7')]||'';this[_0xdbf5('0x8')]=_0x50c2f5['Configurations']||{};}module[_0xdbf5('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 c2c7403..61d1775 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 _0x9aea=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports'];(function(_0xa3dbc0,_0xcbbaf5){var _0x346380=function(_0x27a02f){while(--_0x27a02f){_0xa3dbc0['push'](_0xa3dbc0['shift']());}};_0x346380(++_0xcbbaf5);}(_0x9aea,0xdd));var _0xa9ae=function(_0xd456e,_0x4ba823){_0xd456e=_0xd456e-0x0;var _0x36ca60=_0x9aea[_0xd456e];return _0x36ca60;};'use strict';function FaxAccount(_0x18f637){this['id']=_0x18f637['id']||0x0;this['name']=_0x18f637[_0xa9ae('0x0')]||'';this['description']=_0x18f637[_0xa9ae('0x1')];this[_0xa9ae('0x2')]=_0x18f637['ecm'];this[_0xa9ae('0x3')]=_0x18f637[_0xa9ae('0x3')];this[_0xa9ae('0x4')]=_0x18f637[_0xa9ae('0x4')];this[_0xa9ae('0x5')]=_0x18f637['minrate']||0x960;this[_0xa9ae('0x6')]=_0x18f637[_0xa9ae('0x6')]||0x3840;this[_0xa9ae('0x7')]=_0x18f637['modem']||_0xa9ae('0x8');this[_0xa9ae('0x9')]=_0x18f637[_0xa9ae('0x9')]||'no';this[_0xa9ae('0xa')]=_0x18f637[_0xa9ae('0xa')]||'no';this[_0xa9ae('0xb')]=_0x18f637[_0xa9ae('0xb')]||0x1388;this[_0xa9ae('0xc')]=_0x18f637[_0xa9ae('0xc')]||'SIP';this[_0xa9ae('0xd')]=_0x18f637['Trunk']?_0x18f637[_0xa9ae('0xd')]:undefined;this[_0xa9ae('0xe')]=_0x18f637[_0xa9ae('0xe')];this[_0xa9ae('0xf')]=_0x18f637[_0xa9ae('0xf')];}module[_0xa9ae('0x10')]=FaxAccount; \ No newline at end of file +var _0x2750=['minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0x2750,0x13b));var _0x0275=function(_0x2f086a,_0x316d15){_0x2f086a=_0x2f086a-0x0;var _0x152ed4=_0x2750[_0x2f086a];return _0x152ed4;};'use strict';function FaxAccount(_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['minrate']||0x960;this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||0x3840;this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'v17,v27,v29';this[_0x0275('0x8')]=_0x1c9f4d[_0x0275('0x8')]||'no';this[_0x0275('0x9')]=_0x1c9f4d['faxdetect']||'no';this['t38timeout']=_0x1c9f4d[_0x0275('0xa')]||0x1388;this['tech']=_0x1c9f4d[_0x0275('0xb')]||_0x0275('0xc');this[_0x0275('0xd')]=_0x1c9f4d[_0x0275('0xd')]?_0x1c9f4d[_0x0275('0xd')]:undefined;this['ListId']=_0x1c9f4d[_0x0275('0xe')];this[_0x0275('0xf')]=_0x1c9f4d[_0x0275('0xf')];}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 7cc534c..c896f91 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 _0x4670=['serverUrl','exports','name','username','apiKey','token','remoteUri'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4670,0x1c2));var _0x0467=function(_0x416bc4,_0x31f267){_0x416bc4=_0x416bc4-0x0;var _0x42ba69=_0x4670[_0x416bc4];return _0x42ba69;};'use strict';function FreshdeskAccount(_0x567fab){this['id']=_0x567fab['id']||0x0;this[_0x0467('0x0')]=_0x567fab['name']||'';this[_0x0467('0x1')]=_0x567fab['username']||'';this[_0x0467('0x2')]=_0x567fab[_0x0467('0x3')]||'';this[_0x0467('0x4')]=_0x567fab['remoteUri']||'';this[_0x0467('0x5')]=_0x567fab[_0x0467('0x5')]||'';this['Configurations']=_0x567fab['Configurations']||{};}module[_0x0467('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x03b4=['apiKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x03b4,0x18a));var _0x403b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x03b4[_0x3ab51d];return _0x29a04e;};'use strict';function FreshdeskAccount(_0xe9c87c){this['id']=_0xe9c87c['id']||0x0;this['name']=_0xe9c87c[_0x403b('0x0')]||'';this[_0x403b('0x1')]=_0xe9c87c[_0x403b('0x1')]||'';this[_0x403b('0x2')]=_0xe9c87c['token']||'';this[_0x403b('0x3')]=_0xe9c87c['remoteUri']||'';this['serverUrl']=_0xe9c87c[_0x403b('0x4')]||'';this[_0x403b('0x5')]=_0xe9c87c[_0x403b('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index f32068c..2d455a4 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 _0x2fbb=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x198b09,_0x558d93){var _0x3f15cd=function(_0x358845){while(--_0x358845){_0x198b09['push'](_0x198b09['shift']());}};_0x3f15cd(++_0x558d93);}(_0x2fbb,0x19d));var _0xb2fb=function(_0x3ff5c7,_0xcab3c5){_0x3ff5c7=_0x3ff5c7-0x0;var _0x182e04=_0x2fbb[_0x3ff5c7];return _0x182e04;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this['calleridnum']='';this[_0xb2fb('0x0')]='';this[_0xb2fb('0x1')]='';this[_0xb2fb('0x2')]=null;this[_0xb2fb('0x3')]=null;this[_0xb2fb('0x4')]=0x1;this[_0xb2fb('0x5')]=0x1;this[_0xb2fb('0x6')]=![];this[_0xb2fb('0x7')]=null;this[_0xb2fb('0x8')]=![];this[_0xb2fb('0x9')]=null;this[_0xb2fb('0xa')]=![];this[_0xb2fb('0xb')]=null;this['originalposition']=0x1;this[_0xb2fb('0xc')]='';this[_0xb2fb('0xd')]='';this[_0xb2fb('0xe')]='';this['accountcode']='';this[_0xb2fb('0xf')]='';this[_0xb2fb('0x10')]='';this['priority']='';this[_0xb2fb('0x11')]=0x0;this[_0xb2fb('0x12')]=![];this[_0xb2fb('0x13')]='';this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x8556=['calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','uniqueid','calleridnum'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x8556,0x11d));var _0x6855=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x8556[_0x296809];return _0x18c0d3;};'use strict';function QueueReport(){this[_0x6855('0x0')]='inbound';this[_0x6855('0x1')]='';this[_0x6855('0x2')]='';this[_0x6855('0x3')]='';this[_0x6855('0x4')]='';this['queuecallerjoinAt']=null;this[_0x6855('0x5')]=null;this[_0x6855('0x6')]=0x1;this[_0x6855('0x7')]=0x1;this[_0x6855('0x8')]=![];this[_0x6855('0x9')]=null;this['queuecallercomplete']=![];this[_0x6855('0xa')]=null;this[_0x6855('0xb')]=![];this[_0x6855('0xc')]=null;this['originalposition']=0x1;this['channel']='';this[_0x6855('0xd')]='';this[_0x6855('0xe')]='';this[_0x6855('0xf')]='';this[_0x6855('0x10')]='';this[_0x6855('0x11')]='';this['priority']='';this[_0x6855('0x12')]=0x0;this[_0x6855('0x13')]=![];this[_0x6855('0x14')]='';this[_0x6855('0x15')]=0x0;this[_0x6855('0x16')]={};}module[_0x6855('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index ca7b97d..54cbe44 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 _0x27eb=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x30bdfc,_0x403183){var _0x5900a6=function(_0x3974cb){while(--_0x3974cb){_0x30bdfc['push'](_0x30bdfc['shift']());}};_0x5900a6(++_0x403183);}(_0x27eb,0xd7));var _0xb27e=function(_0xbc37d0,_0x4f6ba0){_0xbc37d0=_0xbc37d0-0x0;var _0x537551=_0x27eb[_0xbc37d0];return _0x537551;};'use strict';function SalesforceAccount(_0x33d595){this['id']=_0x33d595['id']||0x0;this[_0xb27e('0x0')]=_0x33d595[_0xb27e('0x0')]||'';this[_0xb27e('0x1')]=_0x33d595[_0xb27e('0x1')]||'';this[_0xb27e('0x2')]=_0x33d595[_0xb27e('0x2')]||'';this[_0xb27e('0x3')]=_0x33d595[_0xb27e('0x3')]||'';this[_0xb27e('0x4')]=_0x33d595[_0xb27e('0x4')]||'';this['clientSecret']=_0x33d595[_0xb27e('0x5')]||'';this[_0xb27e('0x6')]=_0x33d595[_0xb27e('0x6')]||'';this[_0xb27e('0x7')]=_0x33d595['type']||_0xb27e('0x8');this[_0xb27e('0x9')]=_0x33d595['serverUrl']||'';this['Configurations']=_0x33d595[_0xb27e('0xa')]||{};}module[_0xb27e('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1d17=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x3a6c99,_0x41458d){var _0x5eb82a=function(_0x570c23){while(--_0x570c23){_0x3a6c99['push'](_0x3a6c99['shift']());}};_0x5eb82a(++_0x41458d);}(_0x1d17,0x179));var _0x71d1=function(_0x49e857,_0x3dfb4d){_0x49e857=_0x49e857-0x0;var _0x4c75fe=_0x1d17[_0x49e857];return _0x4c75fe;};'use strict';function SalesforceAccount(_0x2743fc){this['id']=_0x2743fc['id']||0x0;this[_0x71d1('0x0')]=_0x2743fc[_0x71d1('0x0')]||'';this[_0x71d1('0x1')]=_0x2743fc[_0x71d1('0x1')]||'';this[_0x71d1('0x2')]=_0x2743fc['remoteUri']||'';this[_0x71d1('0x3')]=_0x2743fc[_0x71d1('0x3')]||'';this[_0x71d1('0x4')]=_0x2743fc[_0x71d1('0x4')]||'';this[_0x71d1('0x5')]=_0x2743fc[_0x71d1('0x5')]||'';this[_0x71d1('0x6')]=_0x2743fc['securityToken']||'';this[_0x71d1('0x7')]=_0x2743fc[_0x71d1('0x7')]||'integrationTab';this[_0x71d1('0x8')]=_0x2743fc['serverUrl']||'';this[_0x71d1('0x9')]=_0x2743fc[_0x71d1('0x9')]||{};}module[_0x71d1('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 cb681f4..e9e34db 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 _0x99ff=['serverUrl','Configurations','exports','password'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x99ff,0x127));var _0xf99f=function(_0xc48869,_0x56b37b){_0xc48869=_0xc48869-0x0;var _0x1f5dca=_0x99ff[_0xc48869];return _0x1f5dca;};'use strict';function ServicenowAccount(_0x2ba3b1){this['id']=_0x2ba3b1['id']||0x0;this['name']=_0x2ba3b1['name']||'';this['username']=_0x2ba3b1['username']||'';this[_0xf99f('0x0')]=_0x2ba3b1[_0xf99f('0x0')]||'';this['remoteUri']=_0x2ba3b1['remoteUri']||'';this[_0xf99f('0x1')]=_0x2ba3b1[_0xf99f('0x1')]||'';this[_0xf99f('0x2')]=_0x2ba3b1[_0xf99f('0x2')]||{};}module[_0xf99f('0x3')]=ServicenowAccount; \ No newline at end of file +var _0x6178=['password','remoteUri','Configurations','exports','name','username'];(function(_0x2c88d7,_0x16cf41){var _0x3a99e9=function(_0xde9d59){while(--_0xde9d59){_0x2c88d7['push'](_0x2c88d7['shift']());}};_0x3a99e9(++_0x16cf41);}(_0x6178,0xdc));var _0x8617=function(_0x354288,_0xb1bb72){_0x354288=_0x354288-0x0;var _0x32bb86=_0x6178[_0x354288];return _0x32bb86;};'use strict';function ServicenowAccount(_0xb3e493){this['id']=_0xb3e493['id']||0x0;this[_0x8617('0x0')]=_0xb3e493[_0x8617('0x0')]||'';this[_0x8617('0x1')]=_0xb3e493[_0x8617('0x1')]||'';this['password']=_0xb3e493[_0x8617('0x2')]||'';this[_0x8617('0x3')]=_0xb3e493[_0x8617('0x3')]||'';this['serverUrl']=_0xb3e493['serverUrl']||'';this[_0x8617('0x4')]=_0xb3e493['Configurations']||{};}module[_0x8617('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 de86c59..16f98c2 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 _0x6bdc=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xfe63df,_0x27f972){var _0x435b5b=function(_0x533c45){while(--_0x533c45){_0xfe63df['push'](_0xfe63df['shift']());}};_0x435b5b(++_0x27f972);}(_0x6bdc,0x91));var _0xc6bd=function(_0x13610c,_0x2159fd){_0x13610c=_0x13610c-0x0;var _0x2c7538=_0x6bdc[_0x13610c];return _0x2c7538;};'use strict';function SugarcrmAccount(_0x1e309d){this['id']=_0x1e309d['id']||0x0;this[_0xc6bd('0x0')]=_0x1e309d['name']||'';this['username']=_0x1e309d[_0xc6bd('0x1')]||'';this[_0xc6bd('0x2')]=_0x1e309d[_0xc6bd('0x2')]||'';this[_0xc6bd('0x3')]=_0x1e309d[_0xc6bd('0x3')]||'';this[_0xc6bd('0x4')]=_0x1e309d[_0xc6bd('0x4')]||'';this[_0xc6bd('0x5')]=_0x1e309d[_0xc6bd('0x5')]||{};}module[_0xc6bd('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8bbb=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x16b8a6,_0x31f9e3){var _0x498487=function(_0xd82803){while(--_0xd82803){_0x16b8a6['push'](_0x16b8a6['shift']());}};_0x498487(++_0x31f9e3);}(_0x8bbb,0x1bb));var _0xb8bb=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x8bbb[_0xb0fe92];return _0x41787f;};'use strict';function SugarcrmAccount(_0x4ebe33){this['id']=_0x4ebe33['id']||0x0;this['name']=_0x4ebe33['name']||'';this[_0xb8bb('0x0')]=_0x4ebe33[_0xb8bb('0x0')]||'';this['password']=_0x4ebe33[_0xb8bb('0x1')]||'';this[_0xb8bb('0x2')]=_0x4ebe33[_0xb8bb('0x2')]||'';this[_0xb8bb('0x3')]=_0x4ebe33[_0xb8bb('0x3')]||'';this[_0xb8bb('0x4')]=_0x4ebe33['Configurations']||{};}module[_0xb8bb('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index db3b976..3f136fe 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 _0x674f=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x55d88b,_0x41fd0f){var _0x5ae8b2=function(_0x548669){while(--_0x548669){_0x55d88b['push'](_0x55d88b['shift']());}};_0x5ae8b2(++_0x41fd0f);}(_0x674f,0x12a));var _0xf674=function(_0x2b3d12,_0x1163d3){_0x2b3d12=_0x2b3d12-0x0;var _0x2811db=_0x674f[_0x2b3d12];return _0x2811db;};'use strict';function Telephone(_0x4fc1b4){this['id']=_0x4fc1b4['id']||0x0;this[_0xf674('0x0')]=_0x4fc1b4['name']||'';this[_0xf674('0x1')]=_0x4fc1b4['accountcode']||'';this[_0xf674('0x2')]=_0xf674('0x3');this[_0xf674('0x4')]=0x0;this[_0xf674('0x5')]=_0xf674('0x3');this[_0xf674('0x6')]='';}module[_0xf674('0x7')]=Telephone; \ No newline at end of file +var _0x701d=['address','name','accountcode','state','unknown','stateTime'];(function(_0x19fbd8,_0x47f827){var _0x5e4c34=function(_0xc478ad){while(--_0xc478ad){_0x19fbd8['push'](_0x19fbd8['shift']());}};_0x5e4c34(++_0x47f827);}(_0x701d,0x1a5));var _0xd701=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x701d[_0x4b7b69];return _0x173b4c;};'use strict';function Telephone(_0x59fcc3){this['id']=_0x59fcc3['id']||0x0;this[_0xd701('0x0')]=_0x59fcc3[_0xd701('0x0')]||'';this['accountcode']=_0x59fcc3[_0xd701('0x1')]||'';this[_0xd701('0x2')]=_0xd701('0x3');this[_0xd701('0x4')]=0x0;this['status']=_0xd701('0x3');this[_0xd701('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index e2aee02..cd7fb91 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 _0x4522=['name','html'];(function(_0x42ce9c,_0x3a04f8){var _0x170e38=function(_0x2af05f){while(--_0x2af05f){_0x42ce9c['push'](_0x42ce9c['shift']());}};_0x170e38(++_0x3a04f8);}(_0x4522,0x1a0));var _0x2452=function(_0x16b7f8,_0x3b9f32){_0x16b7f8=_0x16b7f8-0x0;var _0x2aa045=_0x4522[_0x16b7f8];return _0x2aa045;};'use strict';function template(_0x2606f1){this['id']=_0x2606f1['id']||0x0;this['name']=_0x2606f1[_0x2452('0x0')]||'';this[_0x2452('0x1')]=_0x2606f1[_0x2452('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0x0ba7=['html','exports','name'];(function(_0x2d42a9,_0x366737){var _0xcc5e85=function(_0x2aeaed){while(--_0x2aeaed){_0x2d42a9['push'](_0x2d42a9['shift']());}};_0xcc5e85(++_0x366737);}(_0x0ba7,0x16d));var _0x70ba=function(_0x344b47,_0x1e8720){_0x344b47=_0x344b47-0x0;var _0x536015=_0x0ba7[_0x344b47];return _0x536015;};'use strict';function template(_0x4e5145){this['id']=_0x4e5145['id']||0x0;this['name']=_0x4e5145[_0x70ba('0x0')]||'';this[_0x70ba('0x1')]=_0x4e5145[_0x70ba('0x1')]||'';}module[_0x70ba('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 3db2e13..29802c9 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 _0xd610=['AnyConditions','Actions','exports','name','channel','status','AllConditions'];(function(_0x5c80f3,_0x35ab04){var _0x352830=function(_0x513a3d){while(--_0x513a3d){_0x5c80f3['push'](_0x5c80f3['shift']());}};_0x352830(++_0x35ab04);}(_0xd610,0xab));var _0x0d61=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd610[_0xf50820];return _0x2a9b10;};'use strict';function Trigger(_0x3b12dd){this['id']=_0x3b12dd['id']||0x0;this[_0x0d61('0x0')]=_0x3b12dd[_0x0d61('0x0')]||'';this['channel']=_0x3b12dd[_0x0d61('0x1')]||'voice';this[_0x0d61('0x2')]=_0x3b12dd['status']||![];this[_0x0d61('0x3')]=_0x3b12dd[_0x0d61('0x3')]||[];this['AnyConditions']=_0x3b12dd[_0x0d61('0x4')]||[];this[_0x0d61('0x5')]=_0x3b12dd['Actions']||[];}module[_0x0d61('0x6')]=Trigger; \ No newline at end of file +var _0x8f7d=['status','AllConditions','AnyConditions','Actions','channel','voice'];(function(_0x194b6b,_0x4d9f27){var _0x175963=function(_0x2c4f38){while(--_0x2c4f38){_0x194b6b['push'](_0x194b6b['shift']());}};_0x175963(++_0x4d9f27);}(_0x8f7d,0x1b4));var _0xd8f7=function(_0x59641d,_0xa7bebf){_0x59641d=_0x59641d-0x0;var _0x2da77e=_0x8f7d[_0x59641d];return _0x2da77e;};'use strict';function Trigger(_0x2e911c){this['id']=_0x2e911c['id']||0x0;this['name']=_0x2e911c['name']||'';this[_0xd8f7('0x0')]=_0x2e911c[_0xd8f7('0x0')]||_0xd8f7('0x1');this['status']=_0x2e911c[_0xd8f7('0x2')]||![];this[_0xd8f7('0x3')]=_0x2e911c['AllConditions']||[];this[_0xd8f7('0x4')]=_0x2e911c['AnyConditions']||[];this[_0xd8f7('0x5')]=_0x2e911c[_0xd8f7('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index d17f81e..22e2847 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 _0xcbc9=['stateTime','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','exports','active','name','unknown'];(function(_0x66b9f9,_0x32d667){var _0x241ce9=function(_0x2b3426){while(--_0x2b3426){_0x66b9f9['push'](_0x66b9f9['shift']());}};_0x241ce9(++_0x32d667);}(_0xcbc9,0xa5));var _0x9cbc=function(_0x1b8524,_0x1bb669){_0x1b8524=_0x1b8524-0x0;var _0x81418d=_0xcbc9[_0x1b8524];return _0x81418d;};'use strict';function Trunk(_0x591ea9){this['id']=_0x591ea9['id']||0x0;this[_0x9cbc('0x0')]=_0x591ea9['active']||![];this[_0x9cbc('0x1')]=_0x591ea9['name']||'';this['state']=_0x9cbc('0x2');this[_0x9cbc('0x3')]=0x0;this['status']=_0x9cbc('0x2');this[_0x9cbc('0x4')]=_0x591ea9[_0x9cbc('0x4')]&&_0x591ea9[_0x9cbc('0x4')][_0x9cbc('0x5')](':')?_0x591ea9[_0x9cbc('0x4')][_0x9cbc('0x6')](':')[0x0]:'';this[_0x9cbc('0x7')]='';this[_0x9cbc('0x8')]='';this[_0x9cbc('0x9')]='';this[_0x9cbc('0xa')]='';this[_0x9cbc('0xb')]='';this[_0x9cbc('0xc')]='unknown';this['registrationtime']='';this['address']='';}module[_0x9cbc('0xd')]=Trunk; \ No newline at end of file +var _0x8b62=['status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','exports','active','name','state','unknown','stateTime'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x8b62,0xd8));var _0x28b6=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x8b62[_0x166742];return _0xb7814a;};'use strict';function Trunk(_0x2a7dcd){this['id']=_0x2a7dcd['id']||0x0;this[_0x28b6('0x0')]=_0x2a7dcd[_0x28b6('0x0')]||![];this[_0x28b6('0x1')]=_0x2a7dcd[_0x28b6('0x1')]||'';this[_0x28b6('0x2')]=_0x28b6('0x3');this[_0x28b6('0x4')]=0x0;this[_0x28b6('0x5')]='unknown';this[_0x28b6('0x6')]=_0x2a7dcd[_0x28b6('0x6')]&&_0x2a7dcd[_0x28b6('0x6')][_0x28b6('0x7')](':')?_0x2a7dcd['registry'][_0x28b6('0x8')](':')[0x0]:'';this[_0x28b6('0x9')]='';this[_0x28b6('0xa')]='';this[_0x28b6('0xb')]='';this[_0x28b6('0xc')]='';this[_0x28b6('0xd')]='';this[_0x28b6('0xe')]=_0x28b6('0x3');this[_0x28b6('0xf')]='';this['address']='';}module[_0x28b6('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 29a1d6c..f09c78b 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 _0x1f1b=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f1b,0x18c));var _0xb1f1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1f1b[_0x4b369d];return _0x571a98;};'use strict';function voiceExtension(_0xe0bcf7){this['id']=_0xe0bcf7['id']||0x0;this[_0xb1f1('0x0')]=_0xe0bcf7[_0xb1f1('0x0')]||'';this[_0xb1f1('0x1')]=_0xe0bcf7[_0xb1f1('0x1')]||'none';this['mandatoryDisposition']=_0xe0bcf7[_0xb1f1('0x2')]||![];}module[_0xb1f1('0x3')]=voiceExtension; \ No newline at end of file +var _0xb0e2=['mandatoryDisposition','recordingFormat','none'];(function(_0x516d4e,_0x4560a3){var _0x55a6e1=function(_0x2f0334){while(--_0x2f0334){_0x516d4e['push'](_0x516d4e['shift']());}};_0x55a6e1(++_0x4560a3);}(_0xb0e2,0xac));var _0x2b0e=function(_0x9011f5,_0x217c55){_0x9011f5=_0x9011f5-0x0;var _0x474b90=_0xb0e2[_0x9011f5];return _0x474b90;};'use strict';function voiceExtension(_0x38d881){this['id']=_0x38d881['id']||0x0;this['exten']=_0x38d881['exten']||'';this[_0x2b0e('0x0')]=_0x38d881[_0x2b0e('0x0')]||_0x2b0e('0x1');this[_0x2b0e('0x2')]=_0x38d881[_0x2b0e('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 9b253bf..ba16464 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 _0x7dd7=['predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','invalid','unavailable','onhold','wav49','rrmemory','roundrobin','name','monitor_format','inbound','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x97d1c0,_0x25086f){var _0xe9dc07=function(_0x2730ff){while(--_0x2730ff){_0x97d1c0['push'](_0x97d1c0['shift']());}};_0xe9dc07(++_0x25086f);}(_0x7dd7,0xe2));var _0x77dd=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x7dd7[_0x44216d];return _0xeca523;};'use strict';var statusDesc=['unknown',_0x77dd('0x0'),'inuse','busy',_0x77dd('0x1'),_0x77dd('0x2'),'ringing','ringinuse',_0x77dd('0x3')];var monitorFormat={'wav':'wav','wav49':_0x77dd('0x4'),'gsm':'gsm'};var strategy={'rrmemory':_0x77dd('0x5'),'roundrobin':_0x77dd('0x6')};function VoiceQueue(_0x174286){this['id']=_0x174286['id']||0x0;this['name']=_0x174286[_0x77dd('0x7')]||'';this[_0x77dd('0x8')]=_0x174286['monitor_format']||'';this['type']=_0x174286['type']||_0x77dd('0x9');this['waiting']=0x0;this[_0x77dd('0xa')]=0x0;this['total']=0x0;this[_0x77dd('0xb')]=0x0;this[_0x77dd('0xc')]=0x0;this['sumHoldTime']=0x0;this[_0x77dd('0xd')]=0x0;this[_0x77dd('0xe')]=0x0;this[_0x77dd('0xf')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x77dd('0x10')]=_0x174286[_0x77dd('0x10')]||![];this[_0x77dd('0x11')]=_0x174286['acwTimeout']||0xa;this[_0x77dd('0x12')]=_0x174286[_0x77dd('0x12')]||'no';this[_0x77dd('0x13')]=!![];this[_0x77dd('0x14')]='';this['originated']=0x0;this[_0x77dd('0x15')]=0x0;this[_0x77dd('0x16')]=_0x174286[_0x77dd('0x16')]||null;this[_0x77dd('0x17')]=_0x174286[_0x77dd('0x17')]?_0x174286['dialGlobalInterval']:null;this['dialActive']=_0x174286[_0x77dd('0x18')];this[_0x77dd('0x19')]=_0x174286[_0x77dd('0x19')]||_0x77dd('0x1a');this[_0x77dd('0x1b')]=_0x174286[_0x77dd('0x1b')]||0x0;this[_0x77dd('0x1c')]=_0x174286[_0x77dd('0x1c')]||0x0;this[_0x77dd('0x1d')]=_0x174286['dialPowerLevel']||0x1;this[_0x77dd('0x1e')]=_0x174286['dialPredictiveOptimization']||_0x77dd('0x1f');this[_0x77dd('0x20')]=_0x174286[_0x77dd('0x20')]||0.03;this[_0x77dd('0x21')]=_0x174286[_0x77dd('0x21')]||0x258;this[_0x77dd('0x22')]=_0x174286[_0x77dd('0x22')]||_0x77dd('0x23');this[_0x77dd('0x24')]=_0x174286['dialOriginateCallerIdNumber']||_0x77dd('0x23');this[_0x77dd('0x25')]=_0x174286[_0x77dd('0x25')]||0x1e;this['dialQueueOptions']=_0x174286[_0x77dd('0x26')]||_0x77dd('0x27');this['dialQueueTimeout']=_0x174286[_0x77dd('0x28')]||0x3;this[_0x77dd('0x29')]=_0x174286[_0x77dd('0x29')]||undefined;this[_0x77dd('0x2a')]=_0x174286[_0x77dd('0x2a')]||0x3;this[_0x77dd('0x2b')]=_0x174286[_0x77dd('0x2b')]||0x96;this[_0x77dd('0x2c')]=_0x174286[_0x77dd('0x2c')]||0x3;this[_0x77dd('0x2d')]=_0x174286['dialBusyRetryFrequency']||0x96;this[_0x77dd('0x2e')]=_0x174286[_0x77dd('0x2e')]||0x3;this[_0x77dd('0x2f')]=_0x174286[_0x77dd('0x2f')]||0x96;this['dialGlobalMaxRetry']=_0x174286[_0x77dd('0x30')]||0x4;this[_0x77dd('0x31')]=_0x174286[_0x77dd('0x31')]?_0x174286[_0x77dd('0x31')]:undefined;this['TrunkBackup']=_0x174286[_0x77dd('0x32')]?_0x174286[_0x77dd('0x32')]:undefined;this[_0x77dd('0x33')]=_0x174286[_0x77dd('0x33')]||undefined;this[_0x77dd('0x34')]=_0x174286[_0x77dd('0x34')]?_0x174286['Interval']:undefined;this[_0x77dd('0x35')]=_0x174286[_0x77dd('0x35')]||'DESC';this[_0x77dd('0x36')]=_0x174286['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x174286['dialCutDigit']||undefined;this[_0x77dd('0x37')]=strategy[_0x174286[_0x77dd('0x37')]]||_0x77dd('0x5');this[_0x77dd('0x38')]=!![];this[_0x77dd('0x39')]=_0x174286['dialAMDActive']||![];this[_0x77dd('0x3a')]=_0x174286[_0x77dd('0x3a')];this[_0x77dd('0x3b')]=_0x174286[_0x77dd('0x3b')];this[_0x77dd('0x3c')]=_0x174286[_0x77dd('0x3c')];this['dialAMDTotalAnalysisTime']=_0x174286[_0x77dd('0x3d')];this[_0x77dd('0x3e')]=_0x174286[_0x77dd('0x3e')];this[_0x77dd('0x3f')]=_0x174286['dialAMDBetweenWordsSilence'];this[_0x77dd('0x40')]=_0x174286['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x174286[_0x77dd('0x41')];this[_0x77dd('0x42')]=_0x174286[_0x77dd('0x42')];this[_0x77dd('0x43')]=0x0;this[_0x77dd('0x44')]=0x0;this[_0x77dd('0x45')]=_0x174286['timeout'];this[_0x77dd('0x46')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x77dd('0x47')]=0x0;this[_0x77dd('0x48')]=0x0;this[_0x77dd('0x49')]=0x0;this[_0x77dd('0x4a')]=0x0;this[_0x77dd('0x4b')]=0x0;this[_0x77dd('0x4c')]=0x0;this[_0x77dd('0x4d')]=0x0;this[_0x77dd('0x4e')]=0x0;this[_0x77dd('0x4f')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x77dd('0x50')]=0x0;this[_0x77dd('0x51')]=undefined;this[_0x77dd('0x52')]=undefined;this[_0x77dd('0x53')]=undefined;this[_0x77dd('0x54')]=1.05;this[_0x77dd('0x55')]=0x0;this[_0x77dd('0x56')]=0x0;this[_0x77dd('0x57')]=0x0;this[_0x77dd('0x58')]=0x0;this[_0x77dd('0x59')]=0x0;this[_0x77dd('0x5a')]=0x0;this[_0x77dd('0x5b')]=0x0;this[_0x77dd('0x5c')]=0.4;this[_0x77dd('0x5d')]=0x0;this[_0x77dd('0x5e')]=0x0;this[_0x77dd('0x5f')]=0x1;this[_0x77dd('0x60')]=0x0;this[_0x77dd('0x61')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x77dd('0x62')]=0x0;this[_0x77dd('0x63')]=_0x174286[_0x77dd('0x63')]||0x1e;this[_0x77dd('0x64')]=_0x174286['dialRecallInQueue']||![];this[_0x77dd('0x65')]=_0x174286[_0x77dd('0x65')]||undefined;this[_0x77dd('0x66')]=_0x174286[_0x77dd('0x66')]||![];this[_0x77dd('0x67')]=_0x174286['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x174286[_0x77dd('0x8')]]?monitorFormat[_0x174286[_0x77dd('0x8')]]:undefined;this[_0x77dd('0x68')]=_0x174286[_0x77dd('0x68')]||![];this[_0x77dd('0x69')]=_0x174286[_0x77dd('0x69')]?_0x174286['mandatoryDispositionPause']:undefined;}module[_0x77dd('0x6a')]=VoiceQueue; \ No newline at end of file +var _0xbf3c=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','inbound','waiting','talking','total','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf3c,0x160));var _0xcbf3=function(_0x5eea36,_0x36063b){_0x5eea36=_0x5eea36-0x0;var _0x41652a=_0xbf3c[_0x5eea36];return _0x41652a;};'use strict';var statusDesc=[_0xcbf3('0x0'),_0xcbf3('0x1'),_0xcbf3('0x2'),_0xcbf3('0x3'),_0xcbf3('0x4'),_0xcbf3('0x5'),_0xcbf3('0x6'),_0xcbf3('0x7'),_0xcbf3('0x8')];var monitorFormat={'wav':_0xcbf3('0x9'),'wav49':_0xcbf3('0xa'),'gsm':_0xcbf3('0xb')};var strategy={'rrmemory':_0xcbf3('0xc'),'roundrobin':_0xcbf3('0xd')};function VoiceQueue(_0x52eb3c){this['id']=_0x52eb3c['id']||0x0;this[_0xcbf3('0xe')]=_0x52eb3c['name']||'';this['monitor_format']=_0x52eb3c[_0xcbf3('0xf')]||'';this['type']=_0x52eb3c['type']||_0xcbf3('0x10');this[_0xcbf3('0x11')]=0x0;this[_0xcbf3('0x12')]=0x0;this[_0xcbf3('0x13')]=0x0;this['answered']=0x0;this[_0xcbf3('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0xcbf3('0x15')]=0x0;this[_0xcbf3('0x16')]=0x0;this[_0xcbf3('0x17')]=0x0;this[_0xcbf3('0x18')]=0x0;this[_0xcbf3('0x19')]=0x0;this[_0xcbf3('0x1a')]=_0x52eb3c[_0xcbf3('0x1a')]||![];this[_0xcbf3('0x1b')]=_0x52eb3c[_0xcbf3('0x1b')]||0xa;this[_0xcbf3('0x1c')]=_0x52eb3c[_0xcbf3('0x1c')]||'no';this[_0xcbf3('0x1d')]=!![];this[_0xcbf3('0x1e')]='';this[_0xcbf3('0x1f')]=0x0;this[_0xcbf3('0x20')]=0x0;this[_0xcbf3('0x21')]=_0x52eb3c[_0xcbf3('0x21')]||null;this[_0xcbf3('0x22')]=_0x52eb3c[_0xcbf3('0x22')]?_0x52eb3c[_0xcbf3('0x22')]:null;this['dialActive']=_0x52eb3c[_0xcbf3('0x23')];this[_0xcbf3('0x24')]=_0x52eb3c['dialMethod']||_0xcbf3('0x25');this[_0xcbf3('0x26')]=_0x52eb3c[_0xcbf3('0x26')]||0x0;this['dialLimitQueue']=_0x52eb3c['dialLimitQueue']||0x0;this[_0xcbf3('0x27')]=_0x52eb3c[_0xcbf3('0x27')]||0x1;this['dialPredictiveOptimization']=_0x52eb3c[_0xcbf3('0x28')]||'dropRate';this[_0xcbf3('0x29')]=_0x52eb3c[_0xcbf3('0x29')]||0.03;this[_0xcbf3('0x2a')]=_0x52eb3c[_0xcbf3('0x2a')]||0x258;this[_0xcbf3('0x2b')]=_0x52eb3c[_0xcbf3('0x2b')]||'anonymous';this[_0xcbf3('0x2c')]=_0x52eb3c[_0xcbf3('0x2c')]||'anonymous';this[_0xcbf3('0x2d')]=_0x52eb3c[_0xcbf3('0x2d')]||0x1e;this[_0xcbf3('0x2e')]=_0x52eb3c[_0xcbf3('0x2e')]||_0xcbf3('0x2f');this[_0xcbf3('0x30')]=_0x52eb3c[_0xcbf3('0x30')]||0x3;this[_0xcbf3('0x31')]=_0x52eb3c[_0xcbf3('0x31')]||undefined;this[_0xcbf3('0x32')]=_0x52eb3c['dialCongestionMaxRetry']||0x3;this[_0xcbf3('0x33')]=_0x52eb3c['dialCongestionRetryFrequency']||0x96;this[_0xcbf3('0x34')]=_0x52eb3c[_0xcbf3('0x34')]||0x3;this[_0xcbf3('0x35')]=_0x52eb3c[_0xcbf3('0x35')]||0x96;this[_0xcbf3('0x36')]=_0x52eb3c[_0xcbf3('0x36')]||0x3;this['dialNoAnswerRetryFrequency']=_0x52eb3c['dialNoAnswerRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x52eb3c[_0xcbf3('0x37')]||0x4;this[_0xcbf3('0x38')]=_0x52eb3c['Trunk']?_0x52eb3c[_0xcbf3('0x38')]:undefined;this['TrunkBackup']=_0x52eb3c[_0xcbf3('0x39')]?_0x52eb3c[_0xcbf3('0x39')]:undefined;this[_0xcbf3('0x3a')]=_0x52eb3c['dialPrefix']||undefined;this[_0xcbf3('0x3b')]=_0x52eb3c[_0xcbf3('0x3b')]?_0x52eb3c[_0xcbf3('0x3b')]:undefined;this[_0xcbf3('0x3c')]=_0x52eb3c[_0xcbf3('0x3c')]||'DESC';this[_0xcbf3('0x3d')]=_0x52eb3c[_0xcbf3('0x3d')]||undefined;this[_0xcbf3('0x3e')]=_0x52eb3c['dialCutDigit']||undefined;this[_0xcbf3('0x3f')]=strategy[_0x52eb3c[_0xcbf3('0x3f')]]||'rrmemory';this[_0xcbf3('0x40')]=!![];this[_0xcbf3('0x41')]=_0x52eb3c[_0xcbf3('0x41')]||![];this[_0xcbf3('0x42')]=_0x52eb3c[_0xcbf3('0x42')];this['dialAMDGreeting']=_0x52eb3c[_0xcbf3('0x43')];this[_0xcbf3('0x44')]=_0x52eb3c[_0xcbf3('0x44')];this[_0xcbf3('0x45')]=_0x52eb3c[_0xcbf3('0x45')];this[_0xcbf3('0x46')]=_0x52eb3c[_0xcbf3('0x46')];this['dialAMDBetweenWordsSilence']=_0x52eb3c['dialAMDBetweenWordsSilence'];this[_0xcbf3('0x47')]=_0x52eb3c['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x52eb3c[_0xcbf3('0x48')];this[_0xcbf3('0x49')]=_0x52eb3c['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xcbf3('0x4a')]=0x0;this[_0xcbf3('0x4b')]=_0x52eb3c[_0xcbf3('0x4b')];this[_0xcbf3('0x4c')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xcbf3('0x4d')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xcbf3('0x4e')]=0x0;this[_0xcbf3('0x4f')]=0x0;this[_0xcbf3('0x50')]=0x0;this[_0xcbf3('0x51')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xcbf3('0x52')]=0x0;this[_0xcbf3('0x53')]=0x0;this[_0xcbf3('0x54')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0xcbf3('0x55')]=1.05;this[_0xcbf3('0x56')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xcbf3('0x57')]=0x0;this[_0xcbf3('0x58')]=0x0;this[_0xcbf3('0x59')]=0x0;this[_0xcbf3('0x5a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xcbf3('0x5b')]=0.4;this[_0xcbf3('0x5c')]=0x0;this[_0xcbf3('0x5d')]=0x0;this[_0xcbf3('0x5e')]=0x1;this['erlangCalls']=0x0;this[_0xcbf3('0x5f')]=0x0;this[_0xcbf3('0x60')]=0x0;this[_0xcbf3('0x61')]=0x0;this[_0xcbf3('0x62')]=_0x52eb3c[_0xcbf3('0x62')]||0x1e;this['dialRecallInQueue']=_0x52eb3c[_0xcbf3('0x63')]||![];this['dialQueueProject2']=_0x52eb3c[_0xcbf3('0x64')]||undefined;this['dialAgiAfterHangupClient']=_0x52eb3c['dialAgiAfterHangupClient']||![];this[_0xcbf3('0x65')]=_0x52eb3c[_0xcbf3('0x65')]||![];this['monitor_format']=monitorFormat[_0x52eb3c[_0xcbf3('0xf')]]?monitorFormat[_0x52eb3c[_0xcbf3('0xf')]]:undefined;this[_0xcbf3('0x66')]=_0x52eb3c[_0xcbf3('0x66')]||![];this[_0xcbf3('0x67')]=_0x52eb3c['mandatoryDispositionPause']?_0x52eb3c[_0xcbf3('0x67')]:undefined;}module[_0xcbf3('0x68')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ec1819e..957acd8 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 _0x27ab=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4f4897,_0x34d40f){var _0x852cdc=function(_0x3c5524){while(--_0x3c5524){_0x4f4897['push'](_0x4f4897['shift']());}};_0x852cdc(++_0x34d40f);}(_0x27ab,0x6a));var _0xb27a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x27ab[_0xa464c9];return _0x3d73c4;};'use strict';function VtigerAccount(_0x1d6113){this['id']=_0x1d6113['id']||0x0;this[_0xb27a('0x0')]=_0x1d6113[_0xb27a('0x0')]||'';this[_0xb27a('0x1')]=_0x1d6113[_0xb27a('0x1')]||'';this[_0xb27a('0x2')]=_0x1d6113[_0xb27a('0x2')]||'';this[_0xb27a('0x3')]=_0x1d6113['remoteUri']||'';this[_0xb27a('0x4')]=_0x1d6113[_0xb27a('0x4')]||'';this[_0xb27a('0x5')]=_0x1d6113['Configurations']||{};}module[_0xb27a('0x6')]=VtigerAccount; \ No newline at end of file +var _0xc6ad=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x5b756c,_0x3621b6){var _0x2e0952=function(_0xca7707){while(--_0xca7707){_0x5b756c['push'](_0x5b756c['shift']());}};_0x2e0952(++_0x3621b6);}(_0xc6ad,0xe0));var _0xdc6a=function(_0x5aea6d,_0x4029f6){_0x5aea6d=_0x5aea6d-0x0;var _0x4cd432=_0xc6ad[_0x5aea6d];return _0x4cd432;};'use strict';function VtigerAccount(_0x3c6a7e){this['id']=_0x3c6a7e['id']||0x0;this[_0xdc6a('0x0')]=_0x3c6a7e[_0xdc6a('0x0')]||'';this[_0xdc6a('0x1')]=_0x3c6a7e[_0xdc6a('0x1')]||'';this[_0xdc6a('0x2')]=_0x3c6a7e['accessKey']||'';this[_0xdc6a('0x3')]=_0x3c6a7e[_0xdc6a('0x3')]||'';this[_0xdc6a('0x4')]=_0x3c6a7e[_0xdc6a('0x4')]||'';this[_0xdc6a('0x5')]=_0x3c6a7e[_0xdc6a('0x5')]||{};}module[_0xdc6a('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0e33f32..6b2d364 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 _0xfcdd=['Configurations','exports','name','username','password','token','remoteUri','authType','type','serverUrl'];(function(_0x4c6394,_0x3408f7){var _0x3e3321=function(_0x1bc740){while(--_0x1bc740){_0x4c6394['push'](_0x4c6394['shift']());}};_0x3e3321(++_0x3408f7);}(_0xfcdd,0x8e));var _0xdfcd=function(_0xefacee,_0x1c780b){_0xefacee=_0xefacee-0x0;var _0x12fa9c=_0xfcdd[_0xefacee];return _0x12fa9c;};'use strict';function ZendeskAccount(_0x21a746){this['id']=_0x21a746['id']||0x0;this[_0xdfcd('0x0')]=_0x21a746[_0xdfcd('0x0')]||'';this[_0xdfcd('0x1')]=_0x21a746[_0xdfcd('0x1')]||'';this[_0xdfcd('0x2')]=_0x21a746[_0xdfcd('0x2')]||'';this[_0xdfcd('0x3')]=_0x21a746['token']||'';this['remoteUri']=_0x21a746[_0xdfcd('0x4')]||'';this[_0xdfcd('0x5')]=_0x21a746[_0xdfcd('0x5')]||'';this[_0xdfcd('0x6')]=_0x21a746[_0xdfcd('0x6')]||'integrationTab';this['serverUrl']=_0x21a746[_0xdfcd('0x7')]||'';this[_0xdfcd('0x8')]=_0x21a746[_0xdfcd('0x8')]||{};}module[_0xdfcd('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x2bc5=['type','integrationTab','serverUrl','Configurations','name','password','token','remoteUri','authType'];(function(_0x4ecd9e,_0x212938){var _0x3c9699=function(_0x267d7d){while(--_0x267d7d){_0x4ecd9e['push'](_0x4ecd9e['shift']());}};_0x3c9699(++_0x212938);}(_0x2bc5,0x1ab));var _0x52bc=function(_0x2c36b6,_0x911b13){_0x2c36b6=_0x2c36b6-0x0;var _0x300f6d=_0x2bc5[_0x2c36b6];return _0x300f6d;};'use strict';function ZendeskAccount(_0x2de937){this['id']=_0x2de937['id']||0x0;this[_0x52bc('0x0')]=_0x2de937[_0x52bc('0x0')]||'';this['username']=_0x2de937['username']||'';this[_0x52bc('0x1')]=_0x2de937[_0x52bc('0x1')]||'';this['token']=_0x2de937[_0x52bc('0x2')]||'';this[_0x52bc('0x3')]=_0x2de937[_0x52bc('0x3')]||'';this[_0x52bc('0x4')]=_0x2de937[_0x52bc('0x4')]||'';this['type']=_0x2de937[_0x52bc('0x5')]||_0x52bc('0x6');this[_0x52bc('0x7')]=_0x2de937[_0x52bc('0x7')]||'';this['Configurations']=_0x2de937[_0x52bc('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 1e6b138..e5b1b52 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 _0xdbf5=['name','authToken','host','Configurations','serverUrl','exports'];(function(_0x1bb6b1,_0x596d4e){var _0x44ec39=function(_0x14fb7f){while(--_0x14fb7f){_0x1bb6b1['push'](_0x1bb6b1['shift']());}};_0x44ec39(++_0x596d4e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x188722,_0x50d4b0){_0x188722=_0x188722-0x0;var _0x553413=_0xdbf5[_0x188722];return _0x553413;};'use strict';function ZohoAccount(_0xc2af80){this['id']=_0xc2af80['id']||0x0;this[_0x5dbf('0x0')]=_0xc2af80['name']||'';this['authToken']=_0xc2af80[_0x5dbf('0x1')]||'';this[_0x5dbf('0x2')]=_0xc2af80[_0x5dbf('0x2')]||'';this[_0x5dbf('0x3')]=_0xc2af80[_0x5dbf('0x3')]||{};this[_0x5dbf('0x4')]=_0xc2af80[_0x5dbf('0x4')]||'';}module[_0x5dbf('0x5')]=ZohoAccount; \ No newline at end of file +var _0x2bd8=['host','Configurations','serverUrl','exports','name','authToken'];(function(_0xfea933,_0x41cfd5){var _0x5510b7=function(_0x1b8f79){while(--_0x1b8f79){_0xfea933['push'](_0xfea933['shift']());}};_0x5510b7(++_0x41cfd5);}(_0x2bd8,0x130));var _0x82bd=function(_0x304c3c,_0x5c7cae){_0x304c3c=_0x304c3c-0x0;var _0x395122=_0x2bd8[_0x304c3c];return _0x395122;};'use strict';function ZohoAccount(_0x1f587f){this['id']=_0x1f587f['id']||0x0;this['name']=_0x1f587f[_0x82bd('0x0')]||'';this[_0x82bd('0x1')]=_0x1f587f[_0x82bd('0x1')]||'';this[_0x82bd('0x2')]=_0x1f587f[_0x82bd('0x2')]||'';this[_0x82bd('0x3')]=_0x1f587f[_0x82bd('0x3')]||{};this['serverUrl']=_0x1f587f[_0x82bd('0x4')]||'';}module[_0x82bd('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index b1619d9..3bf8613 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 _0xb5d7=['type','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','number','exports','util','string','isNil','idContact','queue','name'];(function(_0x29725a,_0x305acd){var _0x40856f=function(_0x9cb244){while(--_0x9cb244){_0x29725a['push'](_0x29725a['shift']());}};_0x40856f(++_0x305acd);}(_0xb5d7,0xc0));var _0x7b5d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb5d7[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0x7b5d('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x373a56,_0xbb32e8,_0x1aba22){var _0x28411a='';if(!_['isNil'](_0xbb32e8)&&_0x7b5d('0x1')===typeof _0xbb32e8){_0x28411a+=_0xbb32e8;}if(!_[_0x7b5d('0x2')](_0x1aba22)&&_0x7b5d('0x1')===typeof _0x1aba22){_0x28411a+='\x20'+_0x1aba22;}if(_0x28411a!==''){return _0x28411a;}return _0x373a56;}function Action(_0x2c05a9,_0x484a74,_0x4e6f49,_0x238df0,_0x1d387c){this['uniqueid']=_0x4e6f49||undefined;this[_0x7b5d('0x3')]=_0x2c05a9['id'];this[_0x7b5d('0x4')]=_0x484a74[_0x7b5d('0x5')];this[_0x7b5d('0x6')]=_0x484a74[_0x7b5d('0x6')];this['campaigntype']=_0x7b5d('0x4');this[_0x7b5d('0x7')]=![];this[_0x7b5d('0x8')]=_[_0x7b5d('0x2')](_0x2c05a9[_0x7b5d('0x9')])?undefined:_0x2c05a9[_0x7b5d('0x9')][_0x7b5d('0x5')];this[_0x7b5d('0xa')]=this[_0x7b5d('0x8')]?util[_0x7b5d('0xb')]('SIP/%s',this[_0x7b5d('0x8')]):_0x238df0||undefined;this[_0x7b5d('0xc')]=checkNameSurname(_0x2c05a9[_0x7b5d('0xd')]['phone'],_0x2c05a9['Contact'][_0x7b5d('0xe')],_0x2c05a9[_0x7b5d('0xd')]['lastName']);this[_0x7b5d('0xf')]=_0x2c05a9['active']||![];this[_0x7b5d('0x10')]=_0x2c05a9[_0x7b5d('0xd')]['phone'];this[_0x7b5d('0x11')]=_0x2c05a9[_0x7b5d('0x11')];this[_0x7b5d('0x12')]=_0x2c05a9[_0x7b5d('0x12')]||0x0;this['countcongestionretry']=_0x2c05a9[_0x7b5d('0x13')]||0x0;this[_0x7b5d('0x14')]=_0x2c05a9['countnoanswerretry']||0x0;this[_0x7b5d('0x15')]=(_0x2c05a9['countbusyretry']||0x0)+(_0x2c05a9[_0x7b5d('0x13')]||0x0)+(_0x2c05a9[_0x7b5d('0x14')]||0x0);this['callback']=_0x2c05a9[_0x7b5d('0x16')];this['callbackuniqueid']=_0x2c05a9[_0x7b5d('0x17')];this[_0x7b5d('0x18')]=_0x2c05a9['callbackat'];this[_0x7b5d('0x19')]=_0x2c05a9['recallme'];this['ContactId']=_0x2c05a9['ContactId'];this['ListId']=_0x2c05a9[_0x7b5d('0x1a')];this[_0x7b5d('0x1b')]=_[_0x7b5d('0x2')](_0x2c05a9['Agent'])?_0x2c05a9[_0x7b5d('0x1b')]:_0x2c05a9[_0x7b5d('0x9')]['id'];this[_0x7b5d('0x1c')]=_0x2c05a9[_0x7b5d('0x1c')];this[_0x7b5d('0x1d')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x7b5d('0xb')](_0x7b5d('0x1e'),this[_0x7b5d('0xc')],this[_0x7b5d('0x1f')]);};module[_0x7b5d('0x20')]=Action; \ No newline at end of file +var _0x4c62=['VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','phone','firstName','lastName','active','calleridnum','Contact','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x5cb2ec,_0xcec86b){var _0x8bba10=function(_0x76969f){while(--_0x76969f){_0x5cb2ec['push'](_0x5cb2ec['shift']());}};_0x8bba10(++_0xcec86b);}(_0x4c62,0x1b6));var _0x24c6=function(_0x3767a9,_0x317ba7){_0x3767a9=_0x3767a9-0x0;var _0x45fb38=_0x4c62[_0x3767a9];return _0x45fb38;};'use strict';var util=require(_0x24c6('0x0'));var _=require(_0x24c6('0x1'));var moment=require(_0x24c6('0x2'));function checkNameSurname(_0x3c1342,_0x4094d8,_0xefb8ec){var _0x469e69='';if(!_[_0x24c6('0x3')](_0x4094d8)&&'string'===typeof _0x4094d8){_0x469e69+=_0x4094d8;}if(!_['isNil'](_0xefb8ec)&&_0x24c6('0x4')===typeof _0xefb8ec){_0x469e69+='\x20'+_0xefb8ec;}if(_0x469e69!==''){return _0x469e69;}return _0x3c1342;}function Action(_0x97653c,_0x427871,_0x3c3ab3,_0x48510b,_0x5424b0){this[_0x24c6('0x5')]=_0x3c3ab3||undefined;this[_0x24c6('0x6')]=_0x97653c['id'];this[_0x24c6('0x7')]=_0x427871[_0x24c6('0x8')];this['type']=_0x427871[_0x24c6('0x9')];this[_0x24c6('0xa')]='queue';this[_0x24c6('0xb')]=![];this[_0x24c6('0xc')]=_[_0x24c6('0x3')](_0x97653c[_0x24c6('0xd')])?undefined:_0x97653c['Agent'][_0x24c6('0x8')];this[_0x24c6('0xe')]=this[_0x24c6('0xc')]?util[_0x24c6('0xf')](_0x24c6('0x10'),this[_0x24c6('0xc')]):_0x48510b||undefined;this['calleridname']=checkNameSurname(_0x97653c['Contact'][_0x24c6('0x11')],_0x97653c['Contact'][_0x24c6('0x12')],_0x97653c['Contact'][_0x24c6('0x13')]);this[_0x24c6('0x14')]=_0x97653c['active']||![];this[_0x24c6('0x15')]=_0x97653c[_0x24c6('0x16')][_0x24c6('0x11')];this[_0x24c6('0x17')]=_0x97653c[_0x24c6('0x17')];this[_0x24c6('0x18')]=_0x97653c[_0x24c6('0x18')]||0x0;this[_0x24c6('0x19')]=_0x97653c['countcongestionretry']||0x0;this[_0x24c6('0x1a')]=_0x97653c[_0x24c6('0x1a')]||0x0;this[_0x24c6('0x1b')]=(_0x97653c[_0x24c6('0x18')]||0x0)+(_0x97653c[_0x24c6('0x19')]||0x0)+(_0x97653c['countnoanswerretry']||0x0);this['callback']=_0x97653c[_0x24c6('0x1c')];this['callbackuniqueid']=_0x97653c[_0x24c6('0x1d')];this['callbackat']=_0x97653c[_0x24c6('0x1e')];this[_0x24c6('0x1f')]=_0x97653c[_0x24c6('0x1f')];this['ContactId']=_0x97653c[_0x24c6('0x20')];this['ListId']=_0x97653c[_0x24c6('0x21')];this['UserId']=_['isNil'](_0x97653c[_0x24c6('0xd')])?_0x97653c[_0x24c6('0x22')]:_0x97653c['Agent']['id'];this[_0x24c6('0x23')]=_0x97653c['VoiceQueueId'];this[_0x24c6('0x24')]='';this[_0x24c6('0x25')]='';}Action[_0x24c6('0x26')][_0x24c6('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x24c6('0x28')],this[_0x24c6('0x29')]);};module[_0x24c6('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 eb3a390..306f460 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 _0xe62d=['[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','activeContact','NOANSWER','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','unlockAgent','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','phone','substring','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','variables','filterKey','keys','variable','addVariable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','ioredis','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','tail','finally','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','varset','syncVarSet','blindtransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','pTalking','sumHoldTime','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','Trunk','active','Interval','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','originated','[CampaignPreview]\x20Campaign\x20Queue:\x20','logger','\x20is\x20disactive','prototype','syncCampaigns','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','stringify','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','pTalking:\x20','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','countbusyretry','logCustomer','Busy','[callProgressDetectingCustomer][logBusy]'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xe62d,0x1ae));var _0xde62=function(_0x12fb2c,_0xad4eb9){_0x12fb2c=_0x12fb2c-0x0;var _0x1431cf=_0xe62d[_0x12fb2c];return _0x1431cf;};'use strict';var util=require(_0xde62('0x0'));var _=require('lodash');var BPromise=require(_0xde62('0x1'));var uuid=require(_0xde62('0x2'));var moment=require(_0xde62('0x3'));var md5=require('md5');var Redis=require(_0xde62('0x4'));var config=require(_0xde62('0x5'));var logger=require('../../../config/logger')(_0xde62('0x6'));var loggerAction=require('../../../config/logger')(_0xde62('0x7'));var ami=require(_0xde62('0x8'));var rpcDb=require(_0xde62('0x9'));var Action=require(_0xde62('0xa'));var ut=require(_0xde62('0xb'));config[_0xde62('0xc')]=_[_0xde62('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xde62('0xe'))(new Redis(config[_0xde62('0xc')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x30dd4a){this[_0xde62('0xf')]=this[_0xde62('0xf')]?this['tail'][_0xde62('0x10')](_0x30dd4a):_0x30dd4a();};function Preview(_0x195659){this['sequence']=new Sequence();this['campaignsPreview']=_0x195659[_0xde62('0x11')];this[_0xde62('0x12')]=_0x195659[_0xde62('0x12')];this[_0xde62('0x13')]={};this[_0xde62('0x14')]=_0x195659[_0xde62('0x14')];this[_0xde62('0x15')]=0x0;ami['on'](_0xde62('0x16'),this[_0xde62('0x17')]['bind'](this));ami['on'](_0xde62('0x18'),this[_0xde62('0x19')][_0xde62('0x1a')](this));ami['on'](_0xde62('0x1b'),this[_0xde62('0x1c')]['bind'](this));ami['on']('dialend',this[_0xde62('0x1d')][_0xde62('0x1a')](this));ami['on']('newexten',this['syncNewExten'][_0xde62('0x1a')](this));ami['on'](_0xde62('0x1e'),this[_0xde62('0x1f')][_0xde62('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xde62('0x1a')](this));ami['on'](_0xde62('0x20'),this['syncBlindTransfer']['bind'](this));this[_0xde62('0x21')](this[_0xde62('0x22')]);}function emit(_0x385b9e,_0x50ee3c,_0x1f33ab){io['to'](_0x385b9e)[_0xde62('0x23')](_0x50ee3c,_0x1f33ab);}function emitCampaignPreview(_0x112cae){if(_0x112cae[_0xde62('0x24')]===_0xde62('0x25')){var _0x4125d0={'id':_0x112cae['id'],'name':_0x112cae[_0xde62('0x26')],'strategy':_0x112cae[_0xde62('0x27')],'answered':_0x112cae[_0xde62('0x28')],'available':_0x112cae[_0xde62('0x29')],'loggedIn':_0x112cae['loggedIn'],'pTalking':_0x112cae[_0xde62('0x2a')],'sumBillable':_0x112cae['sumBillable'],'sumDuration':_0x112cae['sumDuration'],'sumHoldTime':_0x112cae[_0xde62('0x2b')]||0x0,'talking':_0x112cae[_0xde62('0x2c')],'total':_0x112cae[_0xde62('0x2d')],'type':_0x112cae[_0xde62('0x24')],'unmanaged':_0x112cae[_0xde62('0x2e')],'abandoned':_0x112cae['abandoned'],'waiting':_0x112cae['waiting'],'loggedInDb':_0x112cae[_0xde62('0x2f')],'dialActive':_0x112cae['dialActive'],'dialMethod':_0x112cae[_0xde62('0x30')],'dialOriginateCallerIdName':_0x112cae['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x112cae[_0xde62('0x31')],'dialOriginateTimeout':_0x112cae[_0xde62('0x32')],'dialPrefix':_0x112cae['dialPrefix'],'outboundAnswerAgiCallsDay':_0x112cae[_0xde62('0x33')],'outboundAnswerCallsDay':_0x112cae[_0xde62('0x34')],'outboundBlacklistCallsDay':_0x112cae[_0xde62('0x35')],'outboundBusyCallsDay':_0x112cae[_0xde62('0x36')],'outboundCongestionCallsDay':_0x112cae[_0xde62('0x37')],'outboundDropCallsDayACS':_0x112cae[_0xde62('0x38')],'outboundDropCallsDayCallersExit':_0x112cae[_0xde62('0x39')],'outboundDropCallsDayTimeout':_0x112cae['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x112cae[_0xde62('0x3a')],'outboundNoSuchCallsDay':_0x112cae[_0xde62('0x3b')],'outboundOriginateFailureCallsDay':_0x112cae[_0xde62('0x3c')],'outboundReCallsDay':_0x112cae['outboundReCallsDay'],'outboundRejectCallsDay':_0x112cae['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x112cae[_0xde62('0x3d')],'predictiveIntervalAnsweredCalls':_0x112cae[_0xde62('0x3e')],'predictiveIntervalAvgHoldtime':_0x112cae[_0xde62('0x3f')],'predictiveIntervalAvgTalktime':_0x112cae[_0xde62('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x112cae[_0xde62('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x112cae['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x112cae[_0xde62('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x112cae[_0xde62('0x43')],'predictiveIntervalHitRate':_0x112cae['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x112cae[_0xde62('0x44')],'predictiveIntervalMultiplicativeFactor':_0x112cae[_0xde62('0x45')],'predictiveIntervalPauses':_0x112cae[_0xde62('0x46')],'predictiveIntervalTotalCalls':_0x112cae['predictiveIntervalTotalCalls'],'message':_0x112cae[_0xde62('0x47')],'originated':_0x112cae['originated']};if(_0x112cae[_0xde62('0x48')]){_0x4125d0['Trunk']={'id':_0x112cae[_0xde62('0x48')]['id'],'name':_0x112cae[_0xde62('0x48')][_0xde62('0x26')],'active':_0x112cae[_0xde62('0x48')][_0xde62('0x49')],'callerid':_0x112cae[_0xde62('0x48')]['callerid']};}if(_0x112cae[_0xde62('0x4a')]){_0x4125d0[_0xde62('0x4a')]={'id':_0x112cae[_0xde62('0x4a')]['id'],'name':_0x112cae['Interval'][_0xde62('0x26')]};}var _0x4f0fc5=md5(JSON['stringify'](_0x4125d0));if(_0x112cae[_0xde62('0x4b')]!==_0x4f0fc5){_0x112cae[_0xde62('0x4b')]=_0x4f0fc5;emit(util[_0xde62('0x4c')](_0xde62('0x4d'),_0x4125d0[_0xde62('0x26')]),_0xde62('0x4e'),_0x4125d0);}}}function emitVoiceQueueChannelRemove(_0x256c77){emit(util['format']('voice:queue:%s',_0x256c77[_0xde62('0x26')]),_0xde62('0x4f'),_0x256c77);}function notSendMessagesQueue(_0x3bb4ab){if(_0x3bb4ab[_0xde62('0x50')]){if(_0x3bb4ab[_0xde62('0x51')]===0x0&&_0x3bb4ab[_0xde62('0x2a')]===0x0){_0x3bb4ab[_0xde62('0x50')]=![];_0x3bb4ab[_0xde62('0x29')]=0x0;_0x3bb4ab['paused']=0x0;_0x3bb4ab[_0xde62('0x47')]='NOT_ACTIVE';ut['logger'](_0xde62('0x52'),_0x3bb4ab[_0xde62('0x26')]+'\x20is\x20not\x20active');}else{_0x3bb4ab[_0xde62('0x47')]='IS_DISACTIVED';ut[_0xde62('0x53')](_0xde62('0x52'),_0x3bb4ab['name']+_0xde62('0x54'));}emitCampaignPreview(_0x3bb4ab);}}Preview[_0xde62('0x55')]['loopCampaigns']=function(){var _0x27d672=this;setInterval(function(){_0x27d672[_0xde62('0x56')]();},0x7cf);};Preview[_0xde62('0x55')][_0xde62('0x56')]=function(){var _0x228afe=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x245c72 in _0x228afe){if(_0x228afe['hasOwnProperty'](_0x245c72)&&(_0x228afe[_0x245c72]['dialMethod']===_0xde62('0x6')||_0x228afe[_0x245c72][_0xde62('0x30')]==='booked')&&_0x228afe[_0x245c72][_0xde62('0x24')]===_0xde62('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0xde62('0x15')]=0x0;this[_0xde62('0x57')]();}}if(_0x228afe['hasOwnProperty'](_0x245c72)&&_0x228afe[_0x245c72][_0xde62('0x30')]===_0xde62('0x6')&&_0x228afe[_0x245c72][_0xde62('0x24')]===_0xde62('0x25')){if(_0x228afe[_0x245c72][_0xde62('0x58')]){this[_0xde62('0x59')](_0x228afe[_0x245c72]);this[_0xde62('0x5a')](_0x228afe[_0x245c72]);}else{notSendMessagesQueue(_0x228afe[_0x245c72]);}}}};Preview[_0xde62('0x55')][_0xde62('0x5b')]=function(_0x681ead){var _0x49ed06=this;this[_0xde62('0x5c')][_0xde62('0x5d')](function(){if(!_[_0xde62('0x5e')](_0x49ed06[_0xde62('0x13')][_0x681ead])){loggerAction[_0xde62('0x5f')](_0xde62('0x60'),_0x681ead,'Queue',_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')],_0xde62('0x62'),JSON[_0xde62('0x63')](_0x49ed06['campaignsPreview'][_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')]][_0xde62('0x51')]),'pTalking:\x20',JSON['stringify'](_0x49ed06['campaignsPreview'][_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')]][_0xde62('0x2a')]),JSON['stringify'](_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x64')]),JSON[_0xde62('0x63')](_[_0xde62('0x65')](_0x49ed06[_0xde62('0x13')][_0x681ead],['contactId',_0xde62('0x66'),_0xde62('0x67'),_0xde62('0x68')])));return ami[_0xde62('0x69')]({'action':_0xde62('0x6a'),'channel':_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x6b')]})['catch'](function(_0x1879c6){if(_0x1879c6[_0xde62('0x47')]===_0xde62('0x6c')){setTimeout(function(){if(_0x49ed06['actions'][_0x681ead]){ut[_0xde62('0x6d')](_0x49ed06[_0xde62('0x22')][_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')]],_0xde62('0x6e'));if(_0x49ed06['actions'][_0x681ead][_0xde62('0x64')]===!![]){ut[_0xde62('0x6f')](_0x49ed06[_0xde62('0x22')][_0x49ed06['actions'][_0x681ead][_0xde62('0x61')]],'[clearZombieChannel]');ut[_0xde62('0x70')](_0xde62('0x71')+_0x681ead,_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')]);}ut[_0xde62('0x70')](_0xde62('0x72')+_0x681ead,_0x49ed06[_0xde62('0x13')][_0x681ead][_0xde62('0x61')]);delete _0x49ed06[_0xde62('0x13')][_0x681ead];}},0x2328);}});}});};Preview['prototype'][_0xde62('0x57')]=function(){var _0x200449=this;loggerAction[_0xde62('0x5f')](_0xde62('0x73'),_['size'](this[_0xde62('0x13')]));for(var _0x290d33 in this[_0xde62('0x13')]){if(_0x200449[_0xde62('0x13')][_0xde62('0x74')](_0x290d33)){_0x200449[_0xde62('0x5b')](_0x290d33);}}};Preview[_0xde62('0x55')][_0xde62('0x5a')]=function(_0x114c16){var _0x261c51=this;rpcDb[_0xde62('0x75')](_0x114c16['id'],ut[_0xde62('0x76')](this[_0xde62('0x14')]))[_0xde62('0x77')](function(_0x19e785){if(!_[_0xde62('0x5e')](_0x19e785)){for(var _0x3cfe3f=0x0;_0x3cfe3f<_0x19e785[_0xde62('0x78')];_0x3cfe3f+=0x1){if(ut['getDiff'](_0x19e785[_0x3cfe3f][_0xde62('0x79')])<_0x114c16[_0xde62('0x7a')]*0x3c){_0x261c51[_0xde62('0x7b')](_0x19e785[_0x3cfe3f]['id'])['then'](ut[_0xde62('0x7c')](_0xde62('0x7d')))[_0xde62('0x7e')](ut[_0xde62('0x7c')](_0xde62('0x7d')));}else{var _0x3b22b0=new Action(_0x19e785[_0x3cfe3f],_0x114c16);_0x3b22b0[_0xde62('0x7f')]=moment()[_0xde62('0x4c')](_0xde62('0x80'));_0x114c16[_0xde62('0x81')]+=0x1;ut['logCustomer'](_0x3b22b0,0x17,_0xde62('0x82'));if(_0x114c16[_0xde62('0x83')]){rpcDb[_0xde62('0x84')](ut['createBody'](_0x19e785[_0x3cfe3f]));rpcDb[_0xde62('0x85')](_0x3b22b0,_0xde62('0x86'));}else{ut['logCustomer'](_0x3b22b0,0x16,_0xde62('0x87'));rpcDb[_0xde62('0x85')](_0x3b22b0,_0xde62('0x88'));rpcDb[_0xde62('0x89')](_0x3b22b0,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xde62('0x7c')](_0xde62('0x8a')));};Preview[_0xde62('0x55')][_0xde62('0x59')]=function(_0x4cf853){_0x4cf853['sendMessageOneNotActive']=!![];if(ut[_0xde62('0x8b')](_0x4cf853[_0xde62('0x8c')])){_0x4cf853[_0xde62('0x47')]=_0xde62('0x8d');}else if(!ut['isActive'](_0x4cf853['dialActive'])){_0x4cf853[_0xde62('0x47')]=_0xde62('0x8e');}else if(!this[_0xde62('0x8f')](_0x4cf853[_0xde62('0x48')])){if(!this[_0xde62('0x8f')](_0x4cf853[_0xde62('0x90')])){_0x4cf853[_0xde62('0x47')]='TRUNK_IS_NOT_REACHABLE';}else{_0x4cf853['message']=_0xde62('0x91');}}else{_0x4cf853['message']=_0xde62('0x91');}emitCampaignPreview(_0x4cf853);};Preview[_0xde62('0x55')][_0xde62('0x92')]=function(_0x4b6f57,_0x4d2449,_0x4d014c){var _0x5daa60=this;var _0x14f17a=this[_0xde62('0x13')][_0x4d2449];var _0x30d6d7=this['campaignsPreview'][_0x14f17a[_0xde62('0x61')]];var _0x5e5ef7;if(_0x30d6d7){switch(_0x4d014c){case'1':_0x30d6d7[_0xde62('0x3b')]+=0x1;_0x14f17a[_0xde62('0x93')]=ut['totalGlobal'](_0x14f17a);ut['logCustomer'](_0x14f17a,0x0,'NoSuchNumber');rpcDb[_0xde62('0x85')](_0x14f17a,_0xde62('0x94'));if(ut[_0xde62('0x95')](_0x14f17a)>=_0x30d6d7[_0xde62('0x96')]){_0x5e5ef7=ut['cloneAction'](_0x14f17a,0xf,_0xde62('0x97'));rpcDb[_0xde62('0x89')](_0x5e5ef7,_0xde62('0x98'));}else{rpcDb[_0xde62('0x89')](_0x14f17a,_0xde62('0x98'));}delete this[_0xde62('0x13')][_0x4b6f57[_0xde62('0x99')]];break;case _0xde62('0x9a'):var _0x4e61ec=moment()['format'](_0xde62('0x80'));_0x14f17a[_0xde62('0x9b')]=_0x4e61ec;_0x14f17a[_0xde62('0x9c')]=_0x4e61ec;_0x14f17a['dialAnswer']=!![];_0x30d6d7[_0xde62('0x2a')]+=0x1;logger[_0xde62('0x5f')]('[syncHangup][talking][increment]',_0x14f17a[_0xde62('0x9d')],_0xde62('0x9e'),_0x30d6d7[_0xde62('0x26')],_0xde62('0x9f'),_0x30d6d7[_0xde62('0x2a')]);ami['emit']('custom:agentconnect',ut[_0xde62('0xa0')](_0x14f17a,_0xde62('0xa1')));if(_0x30d6d7[_0xde62('0xa2')]){ami[_0xde62('0x23')]('custom:agentConnectPreview',ut[_0xde62('0xa3')](_0x14f17a));}break;case'16':ami['emit'](_0xde62('0xa4'),ut[_0xde62('0xa0')](_0x14f17a,_0xde62('0xa5')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x14f17a,'complete'));_0x30d6d7[_0xde62('0x34')]+=0x1;_0x30d6d7['total']+=0x1;_0x30d6d7[_0xde62('0x28')]+=0x1;ut[_0xde62('0x6f')](_0x30d6d7,'[16]');_0x14f17a[_0xde62('0x93')]=ut[_0xde62('0x95')](_0x14f17a);ut['logCustomer'](_0x14f17a,0x4,'Answer');rpcDb[_0xde62('0x85')](_0x14f17a,_0xde62('0xa6'));rpcDb['createCustomerFinal'](_0x14f17a,_0xde62('0xa7'));rpcDb[_0xde62('0xa8')](_0x14f17a);_0x30d6d7['sumDuration']+=_0x14f17a[_0xde62('0xa9')];_0x30d6d7[_0xde62('0xaa')]+=_0x14f17a[_0xde62('0xa9')];logger[_0xde62('0x5f')](_0xde62('0xab'),_0x14f17a[_0xde62('0x9d')],'\x20Queue',_0x30d6d7[_0xde62('0x26')],_0xde62('0x9f'),_0x30d6d7[_0xde62('0x2a')]);delete this[_0xde62('0x13')][_0x4b6f57[_0xde62('0x99')]];break;case'BUSY':_0x30d6d7[_0xde62('0x36')]+=0x1;_0x14f17a[_0xde62('0xac')]+=0x1;_0x14f17a[_0xde62('0x93')]=ut[_0xde62('0x95')](_0x14f17a);ut[_0xde62('0xad')](_0x14f17a,0x5,_0xde62('0xae'));rpcDb['createCustomerHistory'](_0x14f17a,_0xde62('0xaf'));if(ut[_0xde62('0x95')](_0x14f17a)>=_0x30d6d7[_0xde62('0x96')]){_0x5e5ef7=ut['cloneAction'](_0x14f17a,0xf,_0xde62('0x97'));rpcDb[_0xde62('0x89')](_0x5e5ef7,_0xde62('0xb0'));}else{if(_0x14f17a[_0xde62('0xac')]>=_0x30d6d7[_0xde62('0xb1')]){rpcDb[_0xde62('0x89')](_0x14f17a,_0xde62('0xaf'));}else{rpcDb[_0xde62('0xb2')](ut[_0xde62('0xb3')](_0x14f17a,_0xde62('0xac'),_0x30d6d7[_0xde62('0xb4')]),_0x14f17a['unlockAgent'],_0x14f17a[_0xde62('0xb5')]);}}break;case _0xde62('0xb6'):_0x30d6d7['outboundNoAnswerCallsDay']+=0x1;_0x14f17a['countnoanswerretry']+=0x1;_0x14f17a[_0xde62('0x93')]=ut[_0xde62('0x95')](_0x14f17a);ut[_0xde62('0xad')](_0x14f17a,0x3,'NoAnswer');rpcDb[_0xde62('0x85')](_0x14f17a,_0xde62('0xb7'));if(ut['totalGlobal'](_0x14f17a)>=_0x30d6d7[_0xde62('0x96')]){_0x5e5ef7=ut[_0xde62('0xb8')](_0x14f17a,0xf,'Global');rpcDb[_0xde62('0x89')](_0x5e5ef7,_0xde62('0xb9'));}else{if(_0x14f17a[_0xde62('0xba')]>=_0x30d6d7['dialNoAnswerMaxRetry']){rpcDb[_0xde62('0x89')](_0x14f17a,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xde62('0xb2')](ut[_0xde62('0xb3')](_0x14f17a,_0xde62('0xba'),_0x30d6d7['dialNoAnswerRetryFrequency']),_0x14f17a[_0xde62('0xbb')],_0x14f17a[_0xde62('0xb5')]);}}break;case'CONGESTION':_0x30d6d7[_0xde62('0x37')]+=0x1;_0x14f17a[_0xde62('0xbc')]+=0x1;_0x14f17a[_0xde62('0x93')]=ut[_0xde62('0x95')](_0x14f17a);ut['logCustomer'](_0x14f17a,0x8,_0xde62('0xbd'));rpcDb[_0xde62('0x85')](_0x14f17a,_0xde62('0xbe'));if(ut[_0xde62('0x95')](_0x14f17a)>=_0x30d6d7[_0xde62('0x96')]){_0x5e5ef7=ut[_0xde62('0xb8')](_0x14f17a,0xf,'Global');rpcDb['createCustomerFinal'](_0x5e5ef7,_0xde62('0xbf'));}else{if(_0x14f17a['countcongestionretry']>=_0x30d6d7[_0xde62('0xc0')]){rpcDb['createCustomerFinal'](_0x14f17a,_0xde62('0xbe'));}else{rpcDb['rescheduleContact'](ut[_0xde62('0xb3')](_0x14f17a,'countcongestionretry',_0x30d6d7['dialBusyRetryFrequency']),_0x14f17a['unlockAgent'],_0x14f17a['activeContact']);}}break;case _0xde62('0xc1'):_0x30d6d7[_0xde62('0xc2')]+=0x1;_0x14f17a['countglobal']=ut[_0xde62('0x95')](_0x14f17a);ut['logCustomer'](_0x14f17a,0x14,'AgentReject');rpcDb[_0xde62('0x85')](_0x14f17a,_0xde62('0xc3'));if(_0x14f17a[_0xde62('0xbb')]){rpcDb[_0xde62('0xc4')](_0x14f17a[_0xde62('0xc5')]);}if(_0x14f17a['activeContact']){rpcDb[_0xde62('0xc6')](_0x14f17a['idContact']);}break;default:if(_0x14f17a['dialAnswer']){ut[_0xde62('0x6f')](_0x30d6d7,_0xde62('0xc7'));ut[_0xde62('0x70')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x30d6d7['name'],_0x4b6f57);}_0x30d6d7[_0xde62('0x3d')]+=0x1;_0x14f17a[_0xde62('0x93')]=ut[_0xde62('0x95')](_0x14f17a);ut[_0xde62('0xad')](_0x14f17a,0xc,_0x4b6f57[_0xde62('0xc8')]||_0x4b6f57[_0xde62('0xc9')]);rpcDb[_0xde62('0x85')](_0x14f17a,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x14f17a)>=_0x30d6d7[_0xde62('0x96')]){_0x5e5ef7=ut[_0xde62('0xb8')](_0x14f17a,0xf,'Global');rpcDb['createCustomerFinal'](_0x5e5ef7,_0xde62('0xca'));}else{rpcDb['createCustomerFinal'](_0x14f17a,_0xde62('0xca'));}delete this[_0xde62('0x13')][_0x4b6f57[_0xde62('0x99')]];}if(!(_0x14f17a[_0xde62('0x64')]&&_0x4d014c==='16')){ut[_0xde62('0x6d')](_0x30d6d7,_0xde62('0xcb'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x14f17a[_0xde62('0x9d')],_0xde62('0x9e'),_0x30d6d7[_0xde62('0x26')],_0xde62('0x62'),_0x30d6d7[_0xde62('0x51')]);}if(_0x4d014c!==_0xde62('0x9a')){delete this[_0xde62('0x13')][_0x4b6f57['linkedid']];delete this[_0xde62('0x13')][_0x4b6f57['destlinkedid']];}}};Preview[_0xde62('0x55')]['callProgressDetectingAgent']=function(_0x165dd6,_0x2764b7,_0x15d342){if(_[_0xde62('0xcc')](_0x2764b7)&&_0xde62('0xcd')!==typeof _0x2764b7){return;}if(_[_0xde62('0xcc')](_0x15d342)&&'object'!==typeof _0x15d342){return;}switch(_0x15d342[_0xde62('0xce')]){case'0':ut[_0xde62('0xcf')](_0x165dd6,0x0,_0xde62('0xd0'));rpcDb[_0xde62('0xd1')](_0x165dd6,_0xde62('0xd2'));break;case'3':ut[_0xde62('0xcf')](_0x165dd6,0x3,'NoAnswer');rpcDb[_0xde62('0xd1')](_0x165dd6,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xde62('0xcf')](_0x165dd6,0x5,_0xde62('0xae'));rpcDb[_0xde62('0xd1')](_0x165dd6,_0xde62('0xd3'));break;case'8':ut['logAgent'](_0x165dd6,0x8,'Congestion');rpcDb[_0xde62('0xd1')](_0x165dd6,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xde62('0xcf')](_0x165dd6,0x16,'AnswerAGI');rpcDb[_0xde62('0xd1')](_0x165dd6,_0xde62('0xd4'));break;default:ut['logAgent'](_0x165dd6,0xc,_0x15d342[_0xde62('0xce')]);rpcDb[_0xde62('0xd1')](_0x165dd6,'[callProgressDetectingAgent][logCongestion]');}ut[_0xde62('0x6d')](_0x2764b7,_0xde62('0xd5'));logger[_0xde62('0x5f')](_0xde62('0xd6'),_0x165dd6[_0xde62('0x9d')],'\x20Queue',_0x2764b7[_0xde62('0x26')],_0xde62('0x62'),_0x2764b7[_0xde62('0x51')]);delete this[_0xde62('0x13')][_0x165dd6[_0xde62('0x9d')]];};Preview[_0xde62('0x55')][_0xde62('0xd7')]=function(_0x487382,_0x214a84,_0x4fe57d,_0x5c8f5c,_0x5e817d){var _0x463881=this;return new BPromise(function(_0x3fbbc7,_0x4d9ea3){if(_[_0xde62('0x5e')](_0x214a84)||_[_0xde62('0x5e')](_0x214a84[_0xde62('0xd8')])||_[_0xde62('0x5e')](_0x214a84[_0xde62('0xd8')]['phone'])||_[_0xde62('0x5e')](_0x214a84[_0xde62('0x67')])){_0x4d9ea3(ut[_0xde62('0x47')](_0xde62('0xd9'),_0x5c8f5c,_0x5e817d));return;}var _0x265068=uuid['v4']();var _0x4299d0=_0x463881[_0xde62('0x22')][_0x214a84['Queue'][_0xde62('0x26')]];var _0x258cbb=_0x4fe57d?_0x463881['agents'][_0x4fe57d]['id']:undefined;_0x463881[_0xde62('0x13')][_0x265068]=new Action(_0x214a84,_0x4299d0,_0x265068,_0x4fe57d,_0x258cbb);var _0x437cbc=_0x463881[_0xde62('0x13')][_0x265068];_0x437cbc[_0xde62('0xbb')]=_0x5c8f5c;_0x437cbc[_0xde62('0xb5')]=_0x5e817d;_0x437cbc['lookAgent']=_0x4fe57d;if(_[_0xde62('0xda')](_0x487382)){_0x463881[_0xde62('0xdb')](_0x437cbc,_0x4299d0,_0x214a84,_0x4fe57d)[_0xde62('0x77')](function(_0x55fb48){logger['info'](_0xde62('0xdc'),_0xde62('0xdd')+_0x437cbc['queue']+_0xde62('0xde')+_0x437cbc[_0xde62('0xc5')],JSON[_0xde62('0x63')](_0x55fb48));ami['emit'](_0xde62('0xdf'),ut[_0xde62('0xa0')](_0x437cbc,_0xde62('0xe0')));_0x3fbbc7(ut[_0xde62('0x47')](_0xde62('0xe1')));})[_0xde62('0x7e')](function(_0x5ab3ac){ut[_0xde62('0x53')]('[Preview][execCall][failure]',_0x5ab3ac);_0x4d9ea3(ut['message'](_0xde62('0xe2'),_0x5c8f5c,_0x5e817d));});}else{_0x4299d0[_0xde62('0x35')]+=0x1;ut[_0xde62('0xe3')](_0x437cbc);rpcDb[_0xde62('0xe4')](_0x437cbc,_0xde62('0xe5'));delete _0x463881[_0xde62('0x13')][_0x265068];_0x4d9ea3(ut[_0xde62('0x47')](_0xde62('0xe6'),_0x5c8f5c,_0x5e817d));}});};Preview[_0xde62('0x55')][_0xde62('0x8f')]=function(_0x113fff){return!_[_0xde62('0x5e')](_0x113fff)&&!_['isNil'](_0x113fff[_0xde62('0x26')])&&!_[_0xde62('0x5e')](_0x113fff[_0xde62('0x49')])&&_0x113fff['active']&&!_[_0xde62('0x5e')](this[_0xde62('0x12')][util[_0xde62('0x4c')](_0xde62('0xe7'),_0x113fff['name'])])&&!_['isNil'](this['trunks'][util[_0xde62('0x4c')](_0xde62('0xe7'),_0x113fff[_0xde62('0x26')])][_0xde62('0x6a')])&&(this[_0xde62('0x12')][util['format'](_0xde62('0xe7'),_0x113fff['name'])]['status']===_0xde62('0xe8')||this[_0xde62('0x12')][util[_0xde62('0x4c')](_0xde62('0xe7'),_0x113fff[_0xde62('0x26')])][_0xde62('0x6a')]===_0xde62('0xe9'));};Preview[_0xde62('0x55')][_0xde62('0x7b')]=function(_0x3100b1,_0x2c13cc){var _0x5d90f1=this;return new BPromise(function(_0x35dd44,_0x188805){_0x5d90f1[_0xde62('0xea')](_0x3100b1,_0x2c13cc)['then'](function(_0x5c6ad1){_0x35dd44(_['pick'](_0x5c6ad1,[_0xde62('0x47')]));})[_0xde62('0x7e')](function(_0x433911){if(_0x433911['unlock']){rpcDb[_0xde62('0xc4')](_0x3100b1);}if(_0x433911['active']){rpcDb[_0xde62('0xc6')](_0x3100b1);}_0x188805(_[_0xde62('0x65')](_0x433911,[_0xde62('0x47')]));});});};Preview[_0xde62('0x55')][_0xde62('0xea')]=function(_0x57983f,_0x1065d0){var _0x555b0e=this;return new BPromise(function(_0x2b1e45,_0x1bf13f){var _0x4d0e51,_0x5b5d52;rpcDb['getContactPreview'](_0x57983f)[_0xde62('0x77')](function(_0x515e9b){if(!_[_0xde62('0x5e')](_0x515e9b[0x0])){_0x5b5d52=_0x515e9b[0x0][_0xde62('0xeb')]?![]:!![];_0x4d0e51=_0x515e9b[0x0][_0xde62('0xeb')]?!![]:![];_0x4d0e51=_0x1065d0?!![]:_0x4d0e51;}var _0x32c390=_0x555b0e['validateContact'](_0x515e9b);if(_0x32c390[_0xde62('0xec')]){rpcDb[_0xde62('0xed')](_[_0xde62('0x65')](_0x515e9b[0x0],[_0xde62('0x67'),_0xde62('0xee')]))[_0xde62('0x77')](function(_0x515a63){_0x555b0e[_0xde62('0xd7')](_0x515a63,_0x515e9b[0x0],_0x1065d0,_0x5b5d52,_0x4d0e51)['then'](function(_0x2090ec){_0x2b1e45(_0x2090ec);})[_0xde62('0x7e')](function(_0xc2bf26){_0x1bf13f(_0xc2bf26);});})[_0xde62('0x7e')](function(_0x55c214){ut[_0xde62('0x53')](_0xde62('0xef'),_0x55c214);_0x1bf13f(ut[_0xde62('0x47')](_0xde62('0xf0'),_0x5b5d52,_0x4d0e51));});}else{_0x1bf13f(ut['message'](_0x32c390[_0xde62('0x47')],_0x5b5d52,_0x4d0e51));}})[_0xde62('0x7e')](function(_0x3f9c77){ut[_0xde62('0x53')](_0xde62('0xf1'),_0x3f9c77);_0x1bf13f(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x56aeea){if(_[_0xde62('0x5e')](_0x56aeea)||_[_0xde62('0xda')](_0x56aeea)||!_[_0xde62('0x5e')](_0x56aeea[0x0][_0xde62('0xf2')])&&_['isNil'](_0x56aeea[0x0][_0xde62('0xf2')][_0xde62('0x26')])){ut['logger'](_0xde62('0xf3'),_0x56aeea);return{'isValid':![],'message':_0xde62('0xf4')};}var _0x1819e9=this[_0xde62('0x22')][_0x56aeea[0x0]['Queue'][_0xde62('0x26')]];_0x1819e9[_0xde62('0x47')]=_0xde62('0x91');if(_['isNil'](_0x1819e9)){ut[_0xde62('0x53')](_0xde62('0xf5'),_0x1819e9);return{'isValid':![],'message':_0xde62('0xf6')};}if(!this[_0xde62('0x8f')](_0x1819e9[_0xde62('0x48')])){ut[_0xde62('0x53')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xde62('0xf7')+_0x1819e9[_0xde62('0x26')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xde62('0x8f')](_0x1819e9[_0xde62('0x90')])){ut[_0xde62('0x53')](_0xde62('0xf8'),_0x1819e9[_0xde62('0x26')]+_0xde62('0xf9'));return{'isValid':![],'message':_0xde62('0xfa')};}}if(!ut[_0xde62('0xfb')](_0x1819e9['dialActive'])){ut[_0xde62('0x53')](_0xde62('0xfc'),_0x1819e9[_0xde62('0x26')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xde62('0xf7')+_0x1819e9[_0xde62('0x26')]+_0xde62('0xfd')};}return{'isValid':!![],'message':_0xde62('0xfe')};};Preview[_0xde62('0x55')][_0xde62('0xdb')]=function(_0x232e6d,_0x26b47a,_0x2fa84f,_0x1dc424){var _0x332574=this;return new BPromise(function(_0x123b5d,_0xb13a){var _0x1f3bd4=_0x232e6d[_0xde62('0x9d')];var _0x5143fd=_0x332574['isTrunkReachable'](_0x26b47a[_0xde62('0x48')])?util[_0xde62('0x4c')](_0xde62('0xff'),_0x26b47a['Trunk'][_0xde62('0x26')],_[_0xde62('0x5e')](_0x26b47a['dialPrefix'])?'':_0x26b47a[_0xde62('0x100')][_0xde62('0x101')]()||'',_0x26b47a[_0xde62('0x102')]>0x0?_0x2fa84f[_0xde62('0xd8')][_0xde62('0x103')][_0xde62('0x104')](_0x26b47a[_0xde62('0x102')]):_0x2fa84f['Contact'][_0xde62('0x103')]):util[_0xde62('0x4c')](_0xde62('0xff'),_['isNil'](_0x26b47a['TrunkBackup'])?_0x26b47a['Trunk'][_0xde62('0x26')]:_0x26b47a[_0xde62('0x90')]['name'],_[_0xde62('0x5e')](_0x26b47a[_0xde62('0x100')])?'':_0x26b47a[_0xde62('0x100')][_0xde62('0x101')]()||'',_0x26b47a[_0xde62('0x102')]>0x0?_0x2fa84f['Contact'][_0xde62('0x103')][_0xde62('0x104')](_0x26b47a[_0xde62('0x102')]):_0x2fa84f[_0xde62('0xd8')][_0xde62('0x103')]);var _0x4b8384=_0x332574[_0xde62('0x8f')](_0x26b47a[_0xde62('0x48')])?ut[_0xde62('0x105')](_0x26b47a[_0xde62('0x48')][_0xde62('0x106')],_0x26b47a[_0xde62('0x107')],_0x26b47a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xde62('0x108')](_0x26b47a[_0xde62('0x31')],_0x26b47a[_0xde62('0x109')]):_0x26b47a[_0xde62('0x31')]):ut[_0xde62('0x105')](_[_0xde62('0x5e')](_0x26b47a[_0xde62('0x90')])?_0x26b47a[_0xde62('0x48')][_0xde62('0x106')]:_0x26b47a[_0xde62('0x90')][_0xde62('0x106')],_0x26b47a['dialOriginateCallerIdName'],_0x26b47a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xde62('0x108')](_0x26b47a[_0xde62('0x31')],_0x26b47a[_0xde62('0x109')]):_0x26b47a[_0xde62('0x31')]);if(_0x4b8384){_0x232e6d[_0xde62('0x10a')]=ut[_0xde62('0x10b')](_0x4b8384);_0x232e6d[_0xde62('0x10c')]=ut['extractCalleridNumber'](_0x4b8384);}var _0x267da3=ut[_0xde62('0x10d')](_0x26b47a,_0x2fa84f,_0x5143fd,_0x4b8384,_0x1f3bd4,_0x232e6d);_['merge'](_0x232e6d,ut['toLowerVariables'](_0x267da3));_0x232e6d['starttime']=moment()[_0xde62('0x4c')](_0xde62('0x80'));ami[_0xde62('0x69')](ut[_0xde62('0x10e')](_0x232e6d,_0x26b47a,_0x267da3,_0x232e6d[_0xde62('0xb5')],_0x1dc424))['then'](function(_0x111976){_0x26b47a['originated']+=0x1;logger[_0xde62('0x5f')](_0xde62('0x10f'),_0x1f3bd4,_0xde62('0x9e'),_0x26b47a[_0xde62('0x26')],_0xde62('0x62'),_0x26b47a['originated']);_0x123b5d(_0x111976);})['catch'](function(_0x4ad02a){ut[_0xde62('0xcf')](_0x232e6d,0xe,_0xde62('0x110'));rpcDb[_0xde62('0xd1')](_0x232e6d,_0xde62('0x111'));_0xb13a(_0x4ad02a);});});};Preview[_0xde62('0x55')]['syncNewExten']=function(_0x4775a3){if(this[_0xde62('0x13')][_0x4775a3['linkedid']]){this[_0xde62('0x13')][_0x4775a3[_0xde62('0x99')]]['channel']=_0x4775a3[_0xde62('0x6b')];}};Preview['prototype'][_0xde62('0x17')]=function(_0x1a39fd){var _0x16dc63=this;var _0xac7d6c=this[_0xde62('0x13')][_0x1a39fd['actionid']];if(_0xac7d6c){if(_0xac7d6c[_0xde62('0x112')]&&this['agents'][_0xac7d6c[_0xde62('0x112')]]){ut[_0xde62('0x113')](_0xac7d6c,this[_0xde62('0x14')][_0xac7d6c['lookAgent']]['name'],this[_0xde62('0x14')][_0xac7d6c[_0xde62('0x112')]]['id']);}var _0x5f00a0=_['clone'](_0xac7d6c);_0x5f00a0[_0xde62('0x9b')]=moment()[_0xde62('0x4c')](_0xde62('0x80'));var _0xcce357=_0x16dc63['campaignsPreview'][_0xac7d6c[_0xde62('0x61')]];if(ut[_0xde62('0x114')](_0x1a39fd[_0xde62('0x115')])){if(_0xac7d6c[_0xde62('0xbb')]){rpcDb[_0xde62('0xc4')](_0xac7d6c[_0xde62('0xc5')]);}if(_0xac7d6c['activeContact']){rpcDb[_0xde62('0xc6')](_0xac7d6c['idContact']);}ami[_0xde62('0x23')](_0xde62('0x116'),ut['buildObj'](_0xac7d6c,_0xde62('0x117')));this[_0xde62('0x118')](_0x5f00a0,_0xcce357,_0x1a39fd);}else{_0xac7d6c[_0xde62('0x7f')]=moment()[_0xde62('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xde62('0xcf')](_0x5f00a0,0x4,_0xde62('0x119'));rpcDb['createAgentHistory'](_0x5f00a0,_0xde62('0x11a'));}}};Preview['prototype']['syncHangup']=function(_0xc25644){var _0x433482=this;var _0x45fa4b=this[_0xde62('0x13')][_0xc25644[_0xde62('0x99')]];var _0x311613;if(_0x45fa4b){_0x311613=this['campaignsPreview'][_0x45fa4b[_0xde62('0x61')]];logger[_0xde62('0x5f')](_0xde62('0x11b'),_0xc25644[_0xde62('0x99')],_0xde62('0x9e'),_0x311613[_0xde62('0x26')],_0xde62('0x9f'),_0x311613[_0xde62('0x2a')]);}if(this[_0xde62('0x13')][_0xc25644['linkedid']]&&_0xc25644['linkedid']!==_0xc25644[_0xde62('0x9d')]){if(_0xc25644[_0xde62('0x11c')]==='16'&&this[_0xde62('0x13')][_0xc25644[_0xde62('0x99')]][_0xde62('0x64')]){this[_0xde62('0x92')](_0xc25644,_0xc25644[_0xde62('0x99')],_0xc25644[_0xde62('0x11c')]);}else if(this[_0xde62('0x13')][_0xc25644[_0xde62('0x99')]][_0xde62('0x64')]){logger[_0xde62('0x5f')]('[syncHangup][talking][cause]',_0xc25644['linkedid'],_0xc25644[_0xde62('0x11c')],'\x20Queue',_0x311613[_0xde62('0x26')],_0xde62('0x9f'),_0x311613[_0xde62('0x2a')]);this[_0xde62('0x92')](_0xc25644,_0xc25644['linkedid'],_0xc25644[_0xde62('0x11c')]);}}else if(_0x45fa4b&&_['isNil'](_0x45fa4b['statedesc'])&&_0x311613[_0xde62('0x11d')]&&_0xc25644[_0xde62('0x99')]===_0xc25644[_0xde62('0x9d')]&&_[_0xde62('0x5e')](_0xc25644[_0xde62('0xce')])&&_0xc25644['cause']==='16'&&_0xc25644[_0xde62('0x11e')]==='6'&&_['isUndefined'](_0x45fa4b['transfer'])){if(_0x45fa4b[_0xde62('0xbb')]){rpcDb[_0xde62('0xc4')](_0x45fa4b['idContact']);}if(_0x45fa4b['activeContact']){rpcDb[_0xde62('0xc6')](_0x45fa4b[_0xde62('0xc5')]);}_0xc25644[_0xde62('0xce')]='22';this[_0xde62('0x118')](_0x45fa4b,_0x311613,_0xc25644);}else if(_0x45fa4b&&_0x45fa4b[_0xde62('0x11f')]){if(_0xc25644[_0xde62('0x11c')]==='16'&&this['actions'][_0xc25644['linkedid']][_0xde62('0x64')]){logger[_0xde62('0x5f')](_0xde62('0x120'),_0xc25644[_0xde62('0x99')],_0xc25644[_0xde62('0x11c')],_0xde62('0x9e'),_0x311613[_0xde62('0x26')],_0xde62('0x9f'),_0x311613['pTalking']);this[_0xde62('0x92')](_0xc25644,_0xc25644[_0xde62('0x99')],_0xc25644[_0xde62('0x11c')]);}else if(this[_0xde62('0x13')][_0xc25644[_0xde62('0x99')]]['dialAnswer']){logger[_0xde62('0x5f')](_0xde62('0x121'),_0xc25644[_0xde62('0x99')],_0xc25644['cause'],_0xde62('0x9e'),_0x311613[_0xde62('0x26')],_0xde62('0x9f'),_0x311613[_0xde62('0x2a')]);this['callProgressDetectingCustomer'](_0xc25644,_0xc25644['linkedid'],_0xc25644[_0xde62('0x11c')]);}}};Preview[_0xde62('0x55')][_0xde62('0x1d')]=function(_0x19e5e9){if(this[_0xde62('0x13')][_0x19e5e9['destlinkedid']]&&_0x19e5e9[_0xde62('0x122')]!==_0x19e5e9[_0xde62('0x123')]){this[_0xde62('0x92')](_0x19e5e9,_0x19e5e9[_0xde62('0x122')],_0x19e5e9['dialstatus']);}};Preview[_0xde62('0x55')][_0xde62('0x1c')]=function(_0x1741de){if(this[_0xde62('0x13')][_0x1741de[_0xde62('0x99')]]&&_0x1741de[_0xde62('0x99')]!==_0x1741de[_0xde62('0x9d')]&&!this[_0xde62('0x13')][_0x1741de['linkedid']][_0xde62('0x64')]){if(_0x1741de[_0xde62('0x11c')]==='1'){this[_0xde62('0x92')](_0x1741de,_0x1741de[_0xde62('0x99')],_0x1741de[_0xde62('0x11c')]);}}};Preview['prototype']['addVariable']=function(_0x4e094a,_0x304c4d,_0x1059e2){if(this[_0xde62('0x13')][_0x4e094a]){if(_[_0xde62('0x5e')](this[_0xde62('0x13')][_0x4e094a][_0xde62('0x124')])){this[_0xde62('0x13')][_0x4e094a][_0xde62('0x124')]={};}this[_0xde62('0x13')][_0x4e094a][_0xde62('0x124')][_0x304c4d]=_0x1059e2;}};Preview['prototype'][_0xde62('0x1f')]=function(_0x31ec4b){try{if(!_[_0xde62('0x5e')](_0x31ec4b)){if(ut[_0xde62('0x125')](_[_0xde62('0x126')](_0x31ec4b[_0xde62('0x127')])[0x0])){this[_0xde62('0x128')](_0x31ec4b[_0xde62('0x9d')],_['keys'](_0x31ec4b[_0xde62('0x127')])[0x0],_0x31ec4b['value']);}}}catch(_0xc1d1da){logger['error'](_0xde62('0x129'),util[_0xde62('0x12a')](_0xc1d1da,{'showHidden':![],'depth':null}));}};Preview[_0xde62('0x55')]['syncAttendedTransfer']=function(_0xfa9c08){if(_0xfa9c08){if(this[_0xde62('0x13')][_0xfa9c08[_0xde62('0x12b')]]){this[_0xde62('0x13')][_0xfa9c08[_0xde62('0x12b')]][_0xde62('0x11f')]=!![];}}};Preview[_0xde62('0x55')][_0xde62('0x12c')]=function(_0x14314a){if(_0x14314a){if(this[_0xde62('0x13')][_0x14314a[_0xde62('0x12d')]]){this[_0xde62('0x13')][_0x14314a[_0xde62('0x12d')]][_0xde62('0x11f')]=!![];}}};module[_0xde62('0x12e')]=Preview; \ No newline at end of file +var _0x8c53=['AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','logCustomer','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','emit','buildObj','connect','custom:agentConnectPreview','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','scheduledAt','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','variables','filterKey','addVariable','keys','variable','value','error','[syncVarSet][Preview]','syncBlindTransfer','transfererlinkedid','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','originateresponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','voice:queue:%s','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','getContactRecallMe','agentReadyId','then','length','scheduledat','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8c53,0xa2));var _0x38c5=function(_0x2a69b5,_0x1ac769){_0x2a69b5=_0x2a69b5-0x0;var _0x10193e=_0x8c53[_0x2a69b5];return _0x10193e;};'use strict';var util=require(_0x38c5('0x0'));var _=require(_0x38c5('0x1'));var BPromise=require('bluebird');var uuid=require(_0x38c5('0x2'));var moment=require(_0x38c5('0x3'));var md5=require(_0x38c5('0x4'));var Redis=require(_0x38c5('0x5'));var config=require(_0x38c5('0x6'));var logger=require('../../../config/logger')(_0x38c5('0x7'));var loggerAction=require(_0x38c5('0x8'))(_0x38c5('0x9'));var ami=require(_0x38c5('0xa'));var rpcDb=require(_0x38c5('0xb'));var Action=require(_0x38c5('0xc'));var ut=require(_0x38c5('0xd'));config['redis']=_[_0x38c5('0xe')](config['redis'],{'host':_0x38c5('0xf'),'port':0x18eb});var io=require(_0x38c5('0x10'))(new Redis(config[_0x38c5('0x11')]));var Sequence=function(){};Sequence[_0x38c5('0x12')][_0x38c5('0x13')]=function(_0x35dd91){this[_0x38c5('0x14')]=this[_0x38c5('0x14')]?this[_0x38c5('0x14')][_0x38c5('0x15')](_0x35dd91):_0x35dd91();};function Preview(_0x571ab1){this[_0x38c5('0x16')]=new Sequence();this[_0x38c5('0x17')]=_0x571ab1['voiceQueues'];this['trunks']=_0x571ab1[_0x38c5('0x18')];this[_0x38c5('0x19')]={};this['agents']=_0x571ab1[_0x38c5('0x1a')];this['clockClearZombieChannels']=0x0;ami['on'](_0x38c5('0x1b'),this['syncOriginateResponse'][_0x38c5('0x1c')](this));ami['on'](_0x38c5('0x1d'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0x38c5('0x1e')][_0x38c5('0x1c')](this));ami['on'](_0x38c5('0x1f'),this[_0x38c5('0x20')]['bind'](this));ami['on'](_0x38c5('0x21'),this[_0x38c5('0x22')]['bind'](this));ami['on']('varset',this[_0x38c5('0x23')][_0x38c5('0x1c')](this));ami['on']('attendedtransfer',this[_0x38c5('0x24')][_0x38c5('0x1c')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x38c5('0x1c')](this));this[_0x38c5('0x25')](this[_0x38c5('0x17')]);}function emit(_0x10bf0c,_0x3651c5,_0x178bd5){io['to'](_0x10bf0c)['emit'](_0x3651c5,_0x178bd5);}function emitCampaignPreview(_0x49949f){if(_0x49949f[_0x38c5('0x26')]===_0x38c5('0x27')){var _0x1d8524={'id':_0x49949f['id'],'name':_0x49949f[_0x38c5('0x28')],'strategy':_0x49949f[_0x38c5('0x29')],'answered':_0x49949f[_0x38c5('0x2a')],'available':_0x49949f[_0x38c5('0x2b')],'loggedIn':_0x49949f[_0x38c5('0x2c')],'pTalking':_0x49949f[_0x38c5('0x2d')],'sumBillable':_0x49949f[_0x38c5('0x2e')],'sumDuration':_0x49949f[_0x38c5('0x2f')],'sumHoldTime':_0x49949f['sumHoldTime']||0x0,'talking':_0x49949f[_0x38c5('0x30')],'total':_0x49949f[_0x38c5('0x31')],'type':_0x49949f[_0x38c5('0x26')],'unmanaged':_0x49949f[_0x38c5('0x32')],'abandoned':_0x49949f[_0x38c5('0x33')],'waiting':_0x49949f['waiting'],'loggedInDb':_0x49949f[_0x38c5('0x34')],'dialActive':_0x49949f[_0x38c5('0x35')],'dialMethod':_0x49949f[_0x38c5('0x36')],'dialOriginateCallerIdName':_0x49949f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x49949f[_0x38c5('0x37')],'dialOriginateTimeout':_0x49949f['dialOriginateTimeout'],'dialPrefix':_0x49949f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x49949f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x49949f[_0x38c5('0x38')],'outboundBlacklistCallsDay':_0x49949f[_0x38c5('0x39')],'outboundBusyCallsDay':_0x49949f[_0x38c5('0x3a')],'outboundCongestionCallsDay':_0x49949f[_0x38c5('0x3b')],'outboundDropCallsDayACS':_0x49949f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x49949f[_0x38c5('0x3c')],'outboundDropCallsDayTimeout':_0x49949f[_0x38c5('0x3d')],'outboundNoAnswerCallsDay':_0x49949f[_0x38c5('0x3e')],'outboundNoSuchCallsDay':_0x49949f[_0x38c5('0x3f')],'outboundOriginateFailureCallsDay':_0x49949f[_0x38c5('0x40')],'outboundReCallsDay':_0x49949f[_0x38c5('0x41')],'outboundRejectCallsDay':_0x49949f[_0x38c5('0x42')],'outboundUnknownCallsDay':_0x49949f[_0x38c5('0x43')],'predictiveIntervalAnsweredCalls':_0x49949f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x49949f[_0x38c5('0x44')],'predictiveIntervalAvgTalktime':_0x49949f[_0x38c5('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x49949f[_0x38c5('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x49949f[_0x38c5('0x47')],'predictiveIntervalErlangCalls':_0x49949f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x49949f[_0x38c5('0x48')],'predictiveIntervalHitRate':_0x49949f[_0x38c5('0x49')],'predictiveIntervalLowerLimit':_0x49949f[_0x38c5('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x49949f[_0x38c5('0x4b')],'predictiveIntervalPauses':_0x49949f[_0x38c5('0x4c')],'predictiveIntervalTotalCalls':_0x49949f['predictiveIntervalTotalCalls'],'message':_0x49949f['message'],'originated':_0x49949f[_0x38c5('0x4d')]};if(_0x49949f[_0x38c5('0x4e')]){_0x1d8524[_0x38c5('0x4e')]={'id':_0x49949f[_0x38c5('0x4e')]['id'],'name':_0x49949f[_0x38c5('0x4e')]['name'],'active':_0x49949f[_0x38c5('0x4e')][_0x38c5('0x4f')],'callerid':_0x49949f[_0x38c5('0x4e')][_0x38c5('0x50')]};}if(_0x49949f[_0x38c5('0x51')]){_0x1d8524['Interval']={'id':_0x49949f['Interval']['id'],'name':_0x49949f[_0x38c5('0x51')][_0x38c5('0x28')]};}var _0x1947c1=md5(JSON[_0x38c5('0x52')](_0x1d8524));if(_0x49949f[_0x38c5('0x4')]!==_0x1947c1){_0x49949f[_0x38c5('0x4')]=_0x1947c1;emit(util[_0x38c5('0x53')]('voice:queue:%s',_0x1d8524[_0x38c5('0x28')]),_0x38c5('0x54'),_0x1d8524);}}}function emitVoiceQueueChannelRemove(_0x33e3f0){emit(util[_0x38c5('0x53')](_0x38c5('0x55'),_0x33e3f0['name']),'voice_queue_channel:remove',_0x33e3f0);}function notSendMessagesQueue(_0x24443b){if(_0x24443b[_0x38c5('0x56')]){if(_0x24443b[_0x38c5('0x4d')]===0x0&&_0x24443b[_0x38c5('0x2d')]===0x0){_0x24443b['sendMessageOneNotActive']=![];_0x24443b[_0x38c5('0x2b')]=0x0;_0x24443b[_0x38c5('0x57')]=0x0;_0x24443b[_0x38c5('0x58')]=_0x38c5('0x59');ut[_0x38c5('0x5a')](_0x38c5('0x5b'),_0x24443b[_0x38c5('0x28')]+_0x38c5('0x5c'));}else{_0x24443b['message']=_0x38c5('0x5d');ut[_0x38c5('0x5a')](_0x38c5('0x5b'),_0x24443b[_0x38c5('0x28')]+_0x38c5('0x5e'));}emitCampaignPreview(_0x24443b);}}Preview[_0x38c5('0x12')][_0x38c5('0x25')]=function(){var _0x41e6e7=this;setInterval(function(){_0x41e6e7[_0x38c5('0x5f')]();},0x7cf);};Preview[_0x38c5('0x12')]['syncCampaigns']=function(){var _0x2171b2=this[_0x38c5('0x17')];this['clockClearZombieChannels']+=0x1;for(var _0x183371 in _0x2171b2){if(_0x2171b2[_0x38c5('0x60')](_0x183371)&&(_0x2171b2[_0x183371][_0x38c5('0x36')]===_0x38c5('0x7')||_0x2171b2[_0x183371][_0x38c5('0x36')]===_0x38c5('0x61'))&&_0x2171b2[_0x183371][_0x38c5('0x26')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x38c5('0x62')]=0x0;this[_0x38c5('0x63')]();}}if(_0x2171b2[_0x38c5('0x60')](_0x183371)&&_0x2171b2[_0x183371]['dialMethod']===_0x38c5('0x7')&&_0x2171b2[_0x183371][_0x38c5('0x26')]===_0x38c5('0x27')){if(_0x2171b2[_0x183371][_0x38c5('0x35')]){this[_0x38c5('0x64')](_0x2171b2[_0x183371]);this[_0x38c5('0x65')](_0x2171b2[_0x183371]);}else{notSendMessagesQueue(_0x2171b2[_0x183371]);}}}};Preview[_0x38c5('0x12')][_0x38c5('0x66')]=function(_0x46589d){var _0x59c0d0=this;this[_0x38c5('0x16')]['enqueue'](function(){if(!_[_0x38c5('0x67')](_0x59c0d0[_0x38c5('0x19')][_0x46589d])){loggerAction['info'](_0x38c5('0x68'),_0x46589d,_0x38c5('0x69'),_0x59c0d0[_0x38c5('0x19')][_0x46589d][_0x38c5('0x6a')],_0x38c5('0x6b'),JSON[_0x38c5('0x52')](_0x59c0d0['campaignsPreview'][_0x59c0d0['actions'][_0x46589d][_0x38c5('0x6a')]][_0x38c5('0x4d')]),'pTalking:\x20',JSON[_0x38c5('0x52')](_0x59c0d0[_0x38c5('0x17')][_0x59c0d0[_0x38c5('0x19')][_0x46589d][_0x38c5('0x6a')]][_0x38c5('0x2d')]),JSON[_0x38c5('0x52')](_0x59c0d0[_0x38c5('0x19')][_0x46589d]['dialAnswer']),JSON[_0x38c5('0x52')](_[_0x38c5('0x6c')](_0x59c0d0[_0x38c5('0x19')][_0x46589d],[_0x38c5('0x6d'),_0x38c5('0x6e'),_0x38c5('0x6f'),_0x38c5('0x70')])));return ami[_0x38c5('0x71')]({'action':_0x38c5('0x72'),'channel':_0x59c0d0[_0x38c5('0x19')][_0x46589d][_0x38c5('0x73')]})[_0x38c5('0x74')](function(_0x376a28){if(_0x376a28[_0x38c5('0x58')]===_0x38c5('0x75')){setTimeout(function(){if(_0x59c0d0['actions'][_0x46589d]){ut[_0x38c5('0x76')](_0x59c0d0[_0x38c5('0x17')][_0x59c0d0[_0x38c5('0x19')][_0x46589d][_0x38c5('0x6a')]],_0x38c5('0x77'));if(_0x59c0d0['actions'][_0x46589d][_0x38c5('0x78')]===!![]){ut[_0x38c5('0x79')](_0x59c0d0[_0x38c5('0x17')][_0x59c0d0['actions'][_0x46589d][_0x38c5('0x6a')]],'[clearZombieChannel]');ut[_0x38c5('0x7a')](_0x38c5('0x7b')+_0x46589d,_0x59c0d0[_0x38c5('0x19')][_0x46589d]['queue']);}ut[_0x38c5('0x7a')](_0x38c5('0x7c')+_0x46589d,_0x59c0d0[_0x38c5('0x19')][_0x46589d][_0x38c5('0x6a')]);delete _0x59c0d0[_0x38c5('0x19')][_0x46589d];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x9d6763=this;loggerAction[_0x38c5('0x7d')](_0x38c5('0x7e'),_['size'](this[_0x38c5('0x19')]));for(var _0x568a12 in this[_0x38c5('0x19')]){if(_0x9d6763[_0x38c5('0x19')][_0x38c5('0x60')](_0x568a12)){_0x9d6763[_0x38c5('0x66')](_0x568a12);}}};Preview[_0x38c5('0x12')][_0x38c5('0x65')]=function(_0x68d696){var _0x491015=this;rpcDb[_0x38c5('0x7f')](_0x68d696['id'],ut[_0x38c5('0x80')](this[_0x38c5('0x1a')]))[_0x38c5('0x81')](function(_0x3f6123){if(!_['isNil'](_0x3f6123)){for(var _0x590bff=0x0;_0x590bff<_0x3f6123[_0x38c5('0x82')];_0x590bff+=0x1){if(ut['getDiff'](_0x3f6123[_0x590bff][_0x38c5('0x83')])<_0x68d696['dialRecallMeTimeout']*0x3c){_0x491015[_0x38c5('0x84')](_0x3f6123[_0x590bff]['id'])['then'](ut[_0x38c5('0x85')](_0x38c5('0x86')))[_0x38c5('0x74')](ut['logger2']('[RecallMe]'));}else{var _0xa6abd3=new Action(_0x3f6123[_0x590bff],_0x68d696);_0xa6abd3[_0x38c5('0x87')]=moment()[_0x38c5('0x53')](_0x38c5('0x88'));_0x68d696[_0x38c5('0x41')]+=0x1;ut['logCustomer'](_0xa6abd3,0x17,_0x38c5('0x89'));if(_0x68d696[_0x38c5('0x8a')]){rpcDb[_0x38c5('0x8b')](ut[_0x38c5('0x8c')](_0x3f6123[_0x590bff]));rpcDb['createCustomerHistory'](_0xa6abd3,_0x38c5('0x8d'));}else{ut['logCustomer'](_0xa6abd3,0x16,'RecallFailedTimeout');rpcDb[_0x38c5('0x8e')](_0xa6abd3,_0x38c5('0x8f'));rpcDb[_0x38c5('0x90')](_0xa6abd3,'[HistoryRecallClose]');}}}}})['catch'](ut[_0x38c5('0x85')](_0x38c5('0x91')));};Preview[_0x38c5('0x12')]['setMessage']=function(_0x5ae130){_0x5ae130['sendMessageOneNotActive']=!![];if(ut[_0x38c5('0x92')](_0x5ae130['loggedIn'])){_0x5ae130[_0x38c5('0x58')]=_0x38c5('0x93');}else if(!ut[_0x38c5('0x94')](_0x5ae130[_0x38c5('0x35')])){_0x5ae130[_0x38c5('0x58')]=_0x38c5('0x59');}else if(!this['isTrunkReachable'](_0x5ae130[_0x38c5('0x4e')])){if(!this[_0x38c5('0x95')](_0x5ae130[_0x38c5('0x96')])){_0x5ae130['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x5ae130[_0x38c5('0x58')]=_0x38c5('0x97');}}else{_0x5ae130[_0x38c5('0x58')]=_0x38c5('0x97');}emitCampaignPreview(_0x5ae130);};Preview[_0x38c5('0x12')][_0x38c5('0x98')]=function(_0xbdc390,_0x1cd702,_0x598d60){var _0xf2749f=this;var _0x39b144=this[_0x38c5('0x19')][_0x1cd702];var _0x30a8dd=this[_0x38c5('0x17')][_0x39b144[_0x38c5('0x6a')]];var _0x84f943;if(_0x30a8dd){switch(_0x598d60){case'1':_0x30a8dd[_0x38c5('0x3f')]+=0x1;_0x39b144[_0x38c5('0x99')]=ut['totalGlobal'](_0x39b144);ut[_0x38c5('0x9a')](_0x39b144,0x0,'NoSuchNumber');rpcDb[_0x38c5('0x8e')](_0x39b144,_0x38c5('0x9b'));if(ut[_0x38c5('0x9c')](_0x39b144)>=_0x30a8dd[_0x38c5('0x9d')]){_0x84f943=ut[_0x38c5('0x9e')](_0x39b144,0xf,_0x38c5('0x9f'));rpcDb[_0x38c5('0x90')](_0x84f943,_0x38c5('0xa0'));}else{rpcDb['createCustomerFinal'](_0x39b144,_0x38c5('0xa0'));}delete this[_0x38c5('0x19')][_0xbdc390['linkedid']];break;case _0x38c5('0xa1'):var _0x159bf6=moment()['format'](_0x38c5('0x88'));_0x39b144[_0x38c5('0xa2')]=_0x159bf6;_0x39b144[_0x38c5('0xa3')]=_0x159bf6;_0x39b144[_0x38c5('0x78')]=!![];_0x30a8dd[_0x38c5('0x2d')]+=0x1;logger[_0x38c5('0x7d')](_0x38c5('0xa4'),_0x39b144['uniqueid'],_0x38c5('0xa5'),_0x30a8dd[_0x38c5('0x28')],_0x38c5('0xa6'),_0x30a8dd[_0x38c5('0x2d')]);ami[_0x38c5('0xa7')]('custom:agentconnect',ut[_0x38c5('0xa8')](_0x39b144,_0x38c5('0xa9')));if(_0x30a8dd['acw']){ami[_0x38c5('0xa7')](_0x38c5('0xaa'),ut['buildAcw'](_0x39b144));}break;case'16':ami[_0x38c5('0xa7')](_0x38c5('0xab'),ut[_0x38c5('0xa8')](_0x39b144,'complete'));emitVoiceQueueChannelRemove(ut[_0x38c5('0xa8')](_0x39b144,_0x38c5('0xac')));_0x30a8dd['outboundAnswerCallsDay']+=0x1;_0x30a8dd[_0x38c5('0x31')]+=0x1;_0x30a8dd['answered']+=0x1;ut[_0x38c5('0x79')](_0x30a8dd,'[16]');_0x39b144[_0x38c5('0x99')]=ut[_0x38c5('0x9c')](_0x39b144);ut[_0x38c5('0x9a')](_0x39b144,0x4,_0x38c5('0xad'));rpcDb[_0x38c5('0x8e')](_0x39b144,_0x38c5('0xae'));rpcDb['createCustomerFinal'](_0x39b144,_0x38c5('0xaf'));rpcDb[_0x38c5('0xb0')](_0x39b144);_0x30a8dd[_0x38c5('0x2f')]+=_0x39b144[_0x38c5('0xb1')];_0x30a8dd[_0x38c5('0x2e')]+=_0x39b144[_0x38c5('0xb1')];logger[_0x38c5('0x7d')](_0x38c5('0xb2'),_0x39b144[_0x38c5('0xb3')],_0x38c5('0xa5'),_0x30a8dd['name'],_0x38c5('0xa6'),_0x30a8dd[_0x38c5('0x2d')]);delete this['actions'][_0xbdc390[_0x38c5('0xb4')]];break;case'BUSY':_0x30a8dd[_0x38c5('0x3a')]+=0x1;_0x39b144[_0x38c5('0xb5')]+=0x1;_0x39b144[_0x38c5('0x99')]=ut['totalGlobal'](_0x39b144);ut[_0x38c5('0x9a')](_0x39b144,0x5,_0x38c5('0xb6'));rpcDb['createCustomerHistory'](_0x39b144,_0x38c5('0xb7'));if(ut[_0x38c5('0x9c')](_0x39b144)>=_0x30a8dd['dialGlobalMaxRetry']){_0x84f943=ut[_0x38c5('0x9e')](_0x39b144,0xf,_0x38c5('0x9f'));rpcDb['createCustomerFinal'](_0x84f943,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x39b144[_0x38c5('0xb5')]>=_0x30a8dd['dialBusyMaxRetry']){rpcDb[_0x38c5('0x90')](_0x39b144,_0x38c5('0xb7'));}else{rpcDb[_0x38c5('0xb8')](ut['scheduledAt'](_0x39b144,'countbusyretry',_0x30a8dd[_0x38c5('0xb9')]),_0x39b144[_0x38c5('0xba')],_0x39b144[_0x38c5('0xbb')]);}}break;case _0x38c5('0xbc'):_0x30a8dd[_0x38c5('0x3e')]+=0x1;_0x39b144[_0x38c5('0xbd')]+=0x1;_0x39b144[_0x38c5('0x99')]=ut[_0x38c5('0x9c')](_0x39b144);ut[_0x38c5('0x9a')](_0x39b144,0x3,_0x38c5('0xbe'));rpcDb[_0x38c5('0x8e')](_0x39b144,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x38c5('0x9c')](_0x39b144)>=_0x30a8dd[_0x38c5('0x9d')]){_0x84f943=ut['cloneAction'](_0x39b144,0xf,_0x38c5('0x9f'));rpcDb[_0x38c5('0x90')](_0x84f943,_0x38c5('0xbf'));}else{if(_0x39b144[_0x38c5('0xbd')]>=_0x30a8dd[_0x38c5('0xc0')]){rpcDb[_0x38c5('0x90')](_0x39b144,_0x38c5('0xc1'));}else{rpcDb['rescheduleContact'](ut[_0x38c5('0xc2')](_0x39b144,_0x38c5('0xbd'),_0x30a8dd[_0x38c5('0xc3')]),_0x39b144[_0x38c5('0xba')],_0x39b144['activeContact']);}}break;case _0x38c5('0xc4'):_0x30a8dd[_0x38c5('0x3b')]+=0x1;_0x39b144[_0x38c5('0xc5')]+=0x1;_0x39b144['countglobal']=ut[_0x38c5('0x9c')](_0x39b144);ut['logCustomer'](_0x39b144,0x8,_0x38c5('0xc6'));rpcDb['createCustomerHistory'](_0x39b144,_0x38c5('0xc7'));if(ut[_0x38c5('0x9c')](_0x39b144)>=_0x30a8dd[_0x38c5('0x9d')]){_0x84f943=ut[_0x38c5('0x9e')](_0x39b144,0xf,_0x38c5('0x9f'));rpcDb['createCustomerFinal'](_0x84f943,_0x38c5('0xc8'));}else{if(_0x39b144[_0x38c5('0xc5')]>=_0x30a8dd[_0x38c5('0xc9')]){rpcDb[_0x38c5('0x90')](_0x39b144,_0x38c5('0xc7'));}else{rpcDb[_0x38c5('0xb8')](ut[_0x38c5('0xc2')](_0x39b144,_0x38c5('0xc5'),_0x30a8dd['dialBusyRetryFrequency']),_0x39b144[_0x38c5('0xba')],_0x39b144[_0x38c5('0xbb')]);}}break;case _0x38c5('0xca'):_0x30a8dd['outboundRejectCallsDay']+=0x1;_0x39b144[_0x38c5('0x99')]=ut['totalGlobal'](_0x39b144);ut[_0x38c5('0x9a')](_0x39b144,0x14,_0x38c5('0xcb'));rpcDb['createCustomerHistory'](_0x39b144,'[syncHangupRequest][logAgentReject]');if(_0x39b144[_0x38c5('0xba')]){rpcDb['unlockContact'](_0x39b144[_0x38c5('0xcc')]);}if(_0x39b144['activeContact']){rpcDb[_0x38c5('0xcd')](_0x39b144[_0x38c5('0xcc')]);}break;default:if(_0x39b144['dialAnswer']){ut[_0x38c5('0x79')](_0x30a8dd,_0x38c5('0xce'));ut[_0x38c5('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x30a8dd[_0x38c5('0x28')],_0xbdc390);}_0x30a8dd[_0x38c5('0x43')]+=0x1;_0x39b144[_0x38c5('0x99')]=ut[_0x38c5('0x9c')](_0x39b144);ut['logCustomer'](_0x39b144,0xc,_0xbdc390[_0x38c5('0xcf')]||_0xbdc390[_0x38c5('0xd0')]);rpcDb[_0x38c5('0x8e')](_0x39b144,_0x38c5('0xd1'));if(ut[_0x38c5('0x9c')](_0x39b144)>=_0x30a8dd[_0x38c5('0x9d')]){_0x84f943=ut[_0x38c5('0x9e')](_0x39b144,0xf,_0x38c5('0x9f'));rpcDb[_0x38c5('0x90')](_0x84f943,_0x38c5('0xd2'));}else{rpcDb[_0x38c5('0x90')](_0x39b144,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x38c5('0x19')][_0xbdc390[_0x38c5('0xb4')]];}if(!(_0x39b144['dialAnswer']&&_0x598d60==='16')){ut[_0x38c5('0x76')](_0x30a8dd,_0x38c5('0xd3'));logger['info'](_0x38c5('0xd4'),_0x39b144[_0x38c5('0xb3')],_0x38c5('0xa5'),_0x30a8dd[_0x38c5('0x28')],_0x38c5('0x6b'),_0x30a8dd['originated']);}if(_0x598d60!=='ANSWER'){delete this['actions'][_0xbdc390[_0x38c5('0xb4')]];delete this[_0x38c5('0x19')][_0xbdc390['destlinkedid']];}}};Preview[_0x38c5('0x12')][_0x38c5('0xd5')]=function(_0x62d411,_0x856ea7,_0x31eb23){if(_[_0x38c5('0xd6')](_0x856ea7)&&_0x38c5('0xd7')!==typeof _0x856ea7){return;}if(_['isUndefined'](_0x31eb23)&&_0x38c5('0xd7')!==typeof _0x31eb23){return;}switch(_0x31eb23[_0x38c5('0xd8')]){case'0':ut[_0x38c5('0xd9')](_0x62d411,0x0,_0x38c5('0xda'));rpcDb['createAgentHistory'](_0x62d411,_0x38c5('0xdb'));break;case'3':ut[_0x38c5('0xd9')](_0x62d411,0x3,'NoAnswer');rpcDb[_0x38c5('0xdc')](_0x62d411,_0x38c5('0xdd'));break;case'5':ut[_0x38c5('0xd9')](_0x62d411,0x5,_0x38c5('0xb6'));rpcDb[_0x38c5('0xdc')](_0x62d411,_0x38c5('0xde'));break;case'8':ut[_0x38c5('0xd9')](_0x62d411,0x8,_0x38c5('0xc6'));rpcDb[_0x38c5('0xdc')](_0x62d411,_0x38c5('0xdf'));break;case'22':ut[_0x38c5('0xd9')](_0x62d411,0x16,_0x38c5('0xe0'));rpcDb['createAgentHistory'](_0x62d411,_0x38c5('0xe1'));break;default:ut[_0x38c5('0xd9')](_0x62d411,0xc,_0x31eb23[_0x38c5('0xd8')]);rpcDb['createAgentHistory'](_0x62d411,_0x38c5('0xdf'));}ut[_0x38c5('0x76')](_0x856ea7,_0x38c5('0xe2'));logger[_0x38c5('0x7d')]('[originated][decrement][callProgressDetectingAgent]',_0x62d411[_0x38c5('0xb3')],_0x38c5('0xa5'),_0x856ea7[_0x38c5('0x28')],_0x38c5('0x6b'),_0x856ea7[_0x38c5('0x4d')]);delete this[_0x38c5('0x19')][_0x62d411['uniqueid']];};Preview['prototype'][_0x38c5('0xe3')]=function(_0xee07b5,_0x29495b,_0x5cd2af,_0x382261,_0x22b9ad){var _0xc536b4=this;return new BPromise(function(_0x2ecd54,_0x2a99af){if(_[_0x38c5('0x67')](_0x29495b)||_[_0x38c5('0x67')](_0x29495b[_0x38c5('0xe4')])||_[_0x38c5('0x67')](_0x29495b[_0x38c5('0xe4')][_0x38c5('0xe5')])||_[_0x38c5('0x67')](_0x29495b[_0x38c5('0x6f')])){_0x2a99af(ut[_0x38c5('0x58')](_0x38c5('0xe6'),_0x382261,_0x22b9ad));return;}var _0x2e27b4=uuid['v4']();var _0x3ef2a7=_0xc536b4[_0x38c5('0x17')][_0x29495b['Queue'][_0x38c5('0x28')]];var _0x21ff2e=_0x5cd2af?_0xc536b4[_0x38c5('0x1a')][_0x5cd2af]['id']:undefined;_0xc536b4[_0x38c5('0x19')][_0x2e27b4]=new Action(_0x29495b,_0x3ef2a7,_0x2e27b4,_0x5cd2af,_0x21ff2e);var _0xb00f68=_0xc536b4[_0x38c5('0x19')][_0x2e27b4];_0xb00f68[_0x38c5('0xba')]=_0x382261;_0xb00f68['activeContact']=_0x22b9ad;_0xb00f68[_0x38c5('0xe7')]=_0x5cd2af;if(_[_0x38c5('0xe8')](_0xee07b5)){_0xc536b4[_0x38c5('0xe9')](_0xb00f68,_0x3ef2a7,_0x29495b,_0x5cd2af)[_0x38c5('0x81')](function(_0x381cea){logger['info']('[Preview][execCall][success]',_0x38c5('0xea')+_0xb00f68['queue']+_0x38c5('0xeb')+_0xb00f68[_0x38c5('0xcc')],JSON['stringify'](_0x381cea));ami[_0x38c5('0xa7')](_0x38c5('0xec'),ut[_0x38c5('0xa8')](_0xb00f68,_0x38c5('0xed')));_0x2ecd54(ut[_0x38c5('0x58')]('Calling'));})[_0x38c5('0x74')](function(_0x21bf35){ut['logger']('[Preview][execCall][failure]',_0x21bf35);_0x2a99af(ut[_0x38c5('0x58')](_0x38c5('0xee'),_0x382261,_0x22b9ad));});}else{_0x3ef2a7[_0x38c5('0x39')]+=0x1;ut[_0x38c5('0xef')](_0xb00f68);rpcDb[_0x38c5('0xf0')](_0xb00f68,_0x38c5('0xf1'));delete _0xc536b4[_0x38c5('0x19')][_0x2e27b4];_0x2a99af(ut[_0x38c5('0x58')](_0x38c5('0xf2'),_0x382261,_0x22b9ad));}});};Preview[_0x38c5('0x12')][_0x38c5('0x95')]=function(_0x24405f){return!_[_0x38c5('0x67')](_0x24405f)&&!_['isNil'](_0x24405f[_0x38c5('0x28')])&&!_['isNil'](_0x24405f[_0x38c5('0x4f')])&&_0x24405f[_0x38c5('0x4f')]&&!_[_0x38c5('0x67')](this['trunks'][util[_0x38c5('0x53')]('SIP/%s',_0x24405f['name'])])&&!_[_0x38c5('0x67')](this['trunks'][util[_0x38c5('0x53')]('SIP/%s',_0x24405f[_0x38c5('0x28')])][_0x38c5('0x72')])&&(this['trunks'][util['format'](_0x38c5('0xf3'),_0x24405f[_0x38c5('0x28')])][_0x38c5('0x72')]===_0x38c5('0xf4')||this[_0x38c5('0x18')][util[_0x38c5('0x53')](_0x38c5('0xf3'),_0x24405f['name'])][_0x38c5('0x72')]===_0x38c5('0xf5'));};Preview[_0x38c5('0x12')][_0x38c5('0x84')]=function(_0x4c624c,_0x209b1a){var _0x27d391=this;return new BPromise(function(_0x4ca2ed,_0x378887){_0x27d391[_0x38c5('0xf6')](_0x4c624c,_0x209b1a)[_0x38c5('0x81')](function(_0x27c058){_0x4ca2ed(_['pick'](_0x27c058,['message']));})['catch'](function(_0xfca5d1){if(_0xfca5d1[_0x38c5('0xf7')]){rpcDb[_0x38c5('0xf8')](_0x4c624c);}if(_0xfca5d1['active']){rpcDb[_0x38c5('0xcd')](_0x4c624c);}_0x378887(_[_0x38c5('0x6c')](_0xfca5d1,['message']));});});};Preview[_0x38c5('0x12')][_0x38c5('0xf6')]=function(_0x6640a2,_0x9c1241){var _0x1536d3=this;return new BPromise(function(_0xa58e33,_0x11c910){var _0xea1ac6,_0x50ba0b;rpcDb[_0x38c5('0xf9')](_0x6640a2)['then'](function(_0x45f329){if(!_['isNil'](_0x45f329[0x0])){_0x50ba0b=_0x45f329[0x0][_0x38c5('0xfa')]?![]:!![];_0xea1ac6=_0x45f329[0x0]['recallme']?!![]:![];_0xea1ac6=_0x9c1241?!![]:_0xea1ac6;}var _0x27b31d=_0x1536d3['validateContact'](_0x45f329);if(_0x27b31d[_0x38c5('0xfb')]){rpcDb[_0x38c5('0xfc')](_['pick'](_0x45f329[0x0],[_0x38c5('0x6f'),_0x38c5('0xfd')]))['then'](function(_0x5cdaa3){_0x1536d3[_0x38c5('0xe3')](_0x5cdaa3,_0x45f329[0x0],_0x9c1241,_0x50ba0b,_0xea1ac6)[_0x38c5('0x81')](function(_0x35b6d6){_0xa58e33(_0x35b6d6);})[_0x38c5('0x74')](function(_0x2f366c){_0x11c910(_0x2f366c);});})[_0x38c5('0x74')](function(_0x110106){ut['logger']('[Preview][checkIsBlackList]',_0x110106);_0x11c910(ut[_0x38c5('0x58')](_0x38c5('0xfe'),_0x50ba0b,_0xea1ac6));});}else{_0x11c910(ut[_0x38c5('0x58')](_0x27b31d['message'],_0x50ba0b,_0xea1ac6));}})[_0x38c5('0x74')](function(_0xa3fedb){ut[_0x38c5('0x5a')](_0x38c5('0xff'),_0xa3fedb);_0x11c910(ut[_0x38c5('0x58')](_0x38c5('0xfe'),![],!![]));});});};Preview[_0x38c5('0x12')][_0x38c5('0x100')]=function(_0x4db226){if(_['isNil'](_0x4db226)||_[_0x38c5('0xe8')](_0x4db226)||!_['isNil'](_0x4db226[0x0][_0x38c5('0x101')])&&_[_0x38c5('0x67')](_0x4db226[0x0]['Agent'][_0x38c5('0x28')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x4db226);return{'isValid':![],'message':_0x38c5('0x102')};}var _0x4ff4f2=this[_0x38c5('0x17')][_0x4db226[0x0][_0x38c5('0x69')][_0x38c5('0x28')]];_0x4ff4f2[_0x38c5('0x58')]=_0x38c5('0x97');if(_[_0x38c5('0x67')](_0x4ff4f2)){ut[_0x38c5('0x5a')](_0x38c5('0x103'),_0x4ff4f2);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x38c5('0x95')](_0x4ff4f2[_0x38c5('0x4e')])){ut[_0x38c5('0x5a')](_0x38c5('0x104'),_0x38c5('0x105')+_0x4ff4f2['name']+_0x38c5('0x106'));if(!this[_0x38c5('0x95')](_0x4ff4f2[_0x38c5('0x96')])){ut[_0x38c5('0x5a')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x4ff4f2[_0x38c5('0x28')]+_0x38c5('0x107'));return{'isValid':![],'message':_0x38c5('0x108')};}}if(!ut[_0x38c5('0x94')](_0x4ff4f2[_0x38c5('0x35')])){ut[_0x38c5('0x5a')]('[Preview][validateContact][Campaign\x20Active]',_0x4ff4f2['name']+_0x38c5('0x109'));return{'isValid':![],'message':_0x38c5('0x105')+_0x4ff4f2[_0x38c5('0x28')]+_0x38c5('0x109')};}return{'isValid':!![],'message':_0x38c5('0x10a')};};Preview[_0x38c5('0x12')][_0x38c5('0xe9')]=function(_0x5954cb,_0x5996e6,_0x1500bb,_0x40d069){var _0x1072db=this;return new BPromise(function(_0xfc99cd,_0x1a9d7f){var _0x55805d=_0x5954cb[_0x38c5('0xb3')];var _0xbba22c=_0x1072db[_0x38c5('0x95')](_0x5996e6['Trunk'])?util[_0x38c5('0x53')](_0x38c5('0x10b'),_0x5996e6['Trunk'][_0x38c5('0x28')],_[_0x38c5('0x67')](_0x5996e6[_0x38c5('0x10c')])?'':_0x5996e6[_0x38c5('0x10c')][_0x38c5('0x10d')]()||'',_0x5996e6['dialCutDigit']>0x0?_0x1500bb[_0x38c5('0xe4')][_0x38c5('0xe5')][_0x38c5('0x10e')](_0x5996e6['dialCutDigit']):_0x1500bb[_0x38c5('0xe4')]['phone']):util[_0x38c5('0x53')](_0x38c5('0x10b'),_['isNil'](_0x5996e6[_0x38c5('0x96')])?_0x5996e6[_0x38c5('0x4e')]['name']:_0x5996e6[_0x38c5('0x96')][_0x38c5('0x28')],_[_0x38c5('0x67')](_0x5996e6[_0x38c5('0x10c')])?'':_0x5996e6[_0x38c5('0x10c')]['trim']()||'',_0x5996e6[_0x38c5('0x10f')]>0x0?_0x1500bb['Contact'][_0x38c5('0xe5')]['substring'](_0x5996e6[_0x38c5('0x10f')]):_0x1500bb[_0x38c5('0xe4')][_0x38c5('0xe5')]);var _0x47bfd5=_0x1072db[_0x38c5('0x95')](_0x5996e6['Trunk'])?ut[_0x38c5('0x110')](_0x5996e6[_0x38c5('0x4e')]['callerid'],_0x5996e6['dialOriginateCallerIdName'],_0x5996e6[_0x38c5('0x111')]>0x0?ut[_0x38c5('0x112')](_0x5996e6[_0x38c5('0x37')],_0x5996e6['dialRandomLastDigitCallerIdNumber']):_0x5996e6[_0x38c5('0x37')]):ut[_0x38c5('0x110')](_[_0x38c5('0x67')](_0x5996e6['TrunkBackup'])?_0x5996e6[_0x38c5('0x4e')]['callerid']:_0x5996e6[_0x38c5('0x96')][_0x38c5('0x50')],_0x5996e6[_0x38c5('0x113')],_0x5996e6[_0x38c5('0x111')]>0x0?ut['getCallerIdRandom'](_0x5996e6['dialOriginateCallerIdNumber'],_0x5996e6[_0x38c5('0x111')]):_0x5996e6[_0x38c5('0x37')]);if(_0x47bfd5){_0x5954cb[_0x38c5('0x114')]=ut[_0x38c5('0x115')](_0x47bfd5);_0x5954cb[_0x38c5('0x116')]=ut[_0x38c5('0x117')](_0x47bfd5);}var _0x46c752=ut[_0x38c5('0x118')](_0x5996e6,_0x1500bb,_0xbba22c,_0x47bfd5,_0x55805d,_0x5954cb);_[_0x38c5('0x119')](_0x5954cb,ut[_0x38c5('0x11a')](_0x46c752));_0x5954cb[_0x38c5('0x87')]=moment()[_0x38c5('0x53')](_0x38c5('0x88'));ami[_0x38c5('0x71')](ut['variablesAction'](_0x5954cb,_0x5996e6,_0x46c752,_0x5954cb['activeContact'],_0x40d069))[_0x38c5('0x81')](function(_0x481c68){_0x5996e6[_0x38c5('0x4d')]+=0x1;logger[_0x38c5('0x7d')](_0x38c5('0x11b'),_0x55805d,_0x38c5('0xa5'),_0x5996e6[_0x38c5('0x28')],_0x38c5('0x6b'),_0x5996e6[_0x38c5('0x4d')]);_0xfc99cd(_0x481c68);})[_0x38c5('0x74')](function(_0x51fc30){ut[_0x38c5('0xd9')](_0x5954cb,0xe,_0x38c5('0x11c'));rpcDb[_0x38c5('0xdc')](_0x5954cb,_0x38c5('0x11d'));_0x1a9d7f(_0x51fc30);});});};Preview[_0x38c5('0x12')]['syncNewExten']=function(_0x572872){if(this[_0x38c5('0x19')][_0x572872[_0x38c5('0xb4')]]){this['actions'][_0x572872[_0x38c5('0xb4')]][_0x38c5('0x73')]=_0x572872[_0x38c5('0x73')];}};Preview[_0x38c5('0x12')][_0x38c5('0x11e')]=function(_0x5e6dc1){var _0x5ed79a=this;var _0x52c908=this['actions'][_0x5e6dc1[_0x38c5('0x11f')]];if(_0x52c908){if(_0x52c908[_0x38c5('0xe7')]&&this[_0x38c5('0x1a')][_0x52c908['lookAgent']]){ut[_0x38c5('0x120')](_0x52c908,this[_0x38c5('0x1a')][_0x52c908['lookAgent']][_0x38c5('0x28')],this[_0x38c5('0x1a')][_0x52c908['lookAgent']]['id']);}var _0x23c2e2=_[_0x38c5('0x121')](_0x52c908);_0x23c2e2[_0x38c5('0xa2')]=moment()[_0x38c5('0x53')](_0x38c5('0x88'));var _0x550b6f=_0x5ed79a[_0x38c5('0x17')][_0x52c908[_0x38c5('0x6a')]];if(ut['isFailure'](_0x5e6dc1['response'])){if(_0x52c908[_0x38c5('0xba')]){rpcDb[_0x38c5('0xf8')](_0x52c908[_0x38c5('0xcc')]);}if(_0x52c908[_0x38c5('0xbb')]){rpcDb[_0x38c5('0xcd')](_0x52c908[_0x38c5('0xcc')]);}ami[_0x38c5('0xa7')](_0x38c5('0x122'),ut[_0x38c5('0xa8')](_0x52c908,'rejected'));this['callProgressDetectingAgent'](_0x23c2e2,_0x550b6f,_0x5e6dc1);}else{_0x52c908[_0x38c5('0x87')]=moment()[_0x38c5('0x53')](_0x38c5('0x88'));ut[_0x38c5('0xd9')](_0x23c2e2,0x4,_0x38c5('0xad'));rpcDb[_0x38c5('0xdc')](_0x23c2e2,_0x38c5('0x123'));}}};Preview['prototype']['syncHangup']=function(_0x317b3e){var _0x202053=this;var _0x2c3095=this['actions'][_0x317b3e[_0x38c5('0xb4')]];var _0xc87901;if(_0x2c3095){_0xc87901=this['campaignsPreview'][_0x2c3095[_0x38c5('0x6a')]];logger['info']('[syncHangup][talking]',_0x317b3e[_0x38c5('0xb4')],_0x38c5('0xa5'),_0xc87901[_0x38c5('0x28')],_0x38c5('0xa6'),_0xc87901['pTalking']);}if(this['actions'][_0x317b3e['linkedid']]&&_0x317b3e[_0x38c5('0xb4')]!==_0x317b3e[_0x38c5('0xb3')]){if(_0x317b3e[_0x38c5('0x124')]==='16'&&this[_0x38c5('0x19')][_0x317b3e['linkedid']][_0x38c5('0x78')]){this[_0x38c5('0x98')](_0x317b3e,_0x317b3e[_0x38c5('0xb4')],_0x317b3e['cause']);}else if(this['actions'][_0x317b3e[_0x38c5('0xb4')]][_0x38c5('0x78')]){logger[_0x38c5('0x7d')](_0x38c5('0x125'),_0x317b3e[_0x38c5('0xb4')],_0x317b3e[_0x38c5('0x124')],_0x38c5('0xa5'),_0xc87901['name'],_0x38c5('0xa6'),_0xc87901[_0x38c5('0x2d')]);this[_0x38c5('0x98')](_0x317b3e,_0x317b3e[_0x38c5('0xb4')],_0x317b3e[_0x38c5('0x124')]);}}else if(_0x2c3095&&_[_0x38c5('0x67')](_0x2c3095[_0x38c5('0x126')])&&_0xc87901[_0x38c5('0x127')]&&_0x317b3e[_0x38c5('0xb4')]===_0x317b3e[_0x38c5('0xb3')]&&_[_0x38c5('0x67')](_0x317b3e['reason'])&&_0x317b3e[_0x38c5('0x124')]==='16'&&_0x317b3e['channelstate']==='6'&&_[_0x38c5('0xd6')](_0x2c3095['transfer'])){if(_0x2c3095[_0x38c5('0xba')]){rpcDb['unlockContact'](_0x2c3095[_0x38c5('0xcc')]);}if(_0x2c3095[_0x38c5('0xbb')]){rpcDb[_0x38c5('0xcd')](_0x2c3095[_0x38c5('0xcc')]);}_0x317b3e[_0x38c5('0xd8')]='22';this[_0x38c5('0xd5')](_0x2c3095,_0xc87901,_0x317b3e);}else if(_0x2c3095&&_0x2c3095[_0x38c5('0x128')]){if(_0x317b3e[_0x38c5('0x124')]==='16'&&this['actions'][_0x317b3e[_0x38c5('0xb4')]][_0x38c5('0x78')]){logger[_0x38c5('0x7d')](_0x38c5('0x129'),_0x317b3e[_0x38c5('0xb4')],_0x317b3e['cause'],'\x20Queue',_0xc87901[_0x38c5('0x28')],_0x38c5('0xa6'),_0xc87901[_0x38c5('0x2d')]);this['callProgressDetectingCustomer'](_0x317b3e,_0x317b3e['linkedid'],_0x317b3e[_0x38c5('0x124')]);}else if(this['actions'][_0x317b3e['linkedid']]['dialAnswer']){logger[_0x38c5('0x7d')](_0x38c5('0x125'),_0x317b3e[_0x38c5('0xb4')],_0x317b3e[_0x38c5('0x124')],_0x38c5('0xa5'),_0xc87901[_0x38c5('0x28')],'pTalking:\x20',_0xc87901['pTalking']);this[_0x38c5('0x98')](_0x317b3e,_0x317b3e[_0x38c5('0xb4')],_0x317b3e['cause']);}}};Preview[_0x38c5('0x12')][_0x38c5('0x20')]=function(_0x3bfccc){if(this[_0x38c5('0x19')][_0x3bfccc[_0x38c5('0x12a')]]&&_0x3bfccc['destlinkedid']!==_0x3bfccc['destuniqueid']){this[_0x38c5('0x98')](_0x3bfccc,_0x3bfccc[_0x38c5('0x12a')],_0x3bfccc[_0x38c5('0xd0')]);}};Preview['prototype'][_0x38c5('0x1e')]=function(_0x1df71c){if(this['actions'][_0x1df71c[_0x38c5('0xb4')]]&&_0x1df71c[_0x38c5('0xb4')]!==_0x1df71c[_0x38c5('0xb3')]&&!this['actions'][_0x1df71c[_0x38c5('0xb4')]][_0x38c5('0x78')]){if(_0x1df71c[_0x38c5('0x124')]==='1'){this[_0x38c5('0x98')](_0x1df71c,_0x1df71c[_0x38c5('0xb4')],_0x1df71c[_0x38c5('0x124')]);}}};Preview[_0x38c5('0x12')]['addVariable']=function(_0x3a6c63,_0x1f5ab5,_0x5bc11f){if(this['actions'][_0x3a6c63]){if(_['isNil'](this[_0x38c5('0x19')][_0x3a6c63][_0x38c5('0x12b')])){this[_0x38c5('0x19')][_0x3a6c63]['variables']={};}this[_0x38c5('0x19')][_0x3a6c63][_0x38c5('0x12b')][_0x1f5ab5]=_0x5bc11f;}};Preview[_0x38c5('0x12')][_0x38c5('0x23')]=function(_0x163be4){try{if(!_[_0x38c5('0x67')](_0x163be4)){if(ut[_0x38c5('0x12c')](_['keys'](_0x163be4['variable'])[0x0])){this[_0x38c5('0x12d')](_0x163be4[_0x38c5('0xb3')],_[_0x38c5('0x12e')](_0x163be4[_0x38c5('0x12f')])[0x0],_0x163be4[_0x38c5('0x130')]);}}}catch(_0x50bc9d){logger[_0x38c5('0x131')](_0x38c5('0x132'),util['inspect'](_0x50bc9d,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x38c5('0x24')]=function(_0x4b21f5){if(_0x4b21f5){if(this[_0x38c5('0x19')][_0x4b21f5['transfertargetlinkedid']]){this[_0x38c5('0x19')][_0x4b21f5['transfertargetlinkedid']]['transfer']=!![];}}};Preview['prototype'][_0x38c5('0x133')]=function(_0x1f6c48){if(_0x1f6c48){if(this['actions'][_0x1f6c48['transfererlinkedid']]){this[_0x38c5('0x19')][_0x1f6c48[_0x38c5('0x134')]]['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 252d1b3..b0fc0a1 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 _0xc26c=['[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x54ec3f,_0x57c956){var _0x5ef410=function(_0x363317){while(--_0x363317){_0x54ec3f['push'](_0x54ec3f['shift']());}};_0x5ef410(++_0x57c956);}(_0xc26c,0xbe));var _0xcc26=function(_0xa3a524,_0x21e5a6){_0xa3a524=_0xa3a524-0x0;var _0x2b0574=_0xc26c[_0xa3a524];return _0x2b0574;};'use strict';var util=require(_0xcc26('0x0'));var BPromise=require(_0xcc26('0x1'));var logger=require(_0xcc26('0x2'))('preview');var _=require(_0xcc26('0x3'));var cmHopper=require(_0xcc26('0x4'));var cmHopperFinal=require(_0xcc26('0x5'));var cmHopperHistory=require(_0xcc26('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xcc26('0x7'));var agentReportPreview=require(_0xcc26('0x8'));var voiceQueueReport=require(_0xcc26('0x9'));function loggerCatch(_0xa3b76){return function(_0x3bb172){logger[_0xcc26('0xa')](_0xa3b76,util['inspect'](_0x3bb172,{'showHidden':![],'depth':null}));};}function create(_0xb20f94){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopperHistory[_0xcc26('0xd')](_0xb20f94))['catch'](loggerCatch(_0xcc26('0xe')));}function createAgent(_0x1913f5){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](agentReportPreview[_0xcc26('0xd')](_0x1913f5))['catch'](loggerCatch(_0xcc26('0xe')));}function moveContact(_0x2d0201){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopper['moveContactManagedDialer'](_0x2d0201,!![]))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x10')));}exports['checkIsBlackList']=function(_0x2582a9){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopperBlack['checkIsBlackList'](_0x2582a9))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x11')));};exports['getContactPreview']=function(_0x5a9bec){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopper[_0xcc26('0x12')](_0x5a9bec))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x13')));};exports[_0xcc26('0xd')]=function(_0x29481d,_0x2b9fe5){create(_0x29481d)[_0xcc26('0xf')](loggerCatch(_0x2b9fe5));moveContact(_0x29481d)[_0xcc26('0xf')](loggerCatch(_0x2b9fe5));};exports[_0xcc26('0x14')]=function(_0x3c4d33,_0x3f3272){createAgent(_0x3c4d33)[_0xcc26('0xf')](loggerCatch(_0x3f3272));};exports[_0xcc26('0x15')]=function(_0x521656,_0x978c7c){create(_0x521656)[_0xcc26('0xf')](loggerCatch(_0x978c7c));};exports['createCustomerFinal']=function(_0x4c9ac4,_0x57205f){moveContact(_0x4c9ac4)[_0xcc26('0xf')](loggerCatch(_0x57205f));};exports[_0xcc26('0x16')]=function(_0x8201b3,_0x5d5a14,_0x400250){if(_0x5d5a14){_0x8201b3['UserId']=null;}if(_0x400250){_0x8201b3[_0xcc26('0x17')]=![];}return BPromise['resolve']()[_0xcc26('0xc')](cmHopper['rescheduleContact'](_0x8201b3))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x18')));};exports['countReScheduled']=function(_0x4b81b8){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopper[_0xcc26('0x19')](_0x4b81b8))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x1a')));};exports[_0xcc26('0x1b')]=function(_0x524eed){return BPromise[_0xcc26('0xb')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x524eed,0x1))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x1c')));};exports[_0xcc26('0x1d')]=function(_0x28b848){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopper[_0xcc26('0x1b')]({'active':![]},_0x28b848,0x1))[_0xcc26('0xf')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0xa37a9a){var _0x427101={};_0x427101['type']=_0xa37a9a[_0xcc26('0x1e')];_0x427101[_0xcc26('0x1f')]=_0xa37a9a['uniqueid'];_0x427101[_0xcc26('0x20')]=_0xa37a9a[_0xcc26('0x20')];_0x427101[_0xcc26('0x21')]=_0xa37a9a[_0xcc26('0x21')];_0x427101['queue']=_0xa37a9a[_0xcc26('0x22')];_0x427101[_0xcc26('0x23')]=_0xa37a9a['answertime'];_0x427101[_0xcc26('0x24')]=_0xa37a9a[_0xcc26('0x25')];_0x427101[_0xcc26('0x26')]=0x1;_0x427101[_0xcc26('0x27')]=_0xa37a9a[_0xcc26('0x28')];_0x427101['connectedlinename']=_0xa37a9a[_0xcc26('0x29')];_0x427101['context']=_0xcc26('0x2a');_0x427101[_0xcc26('0x2b')]=_0xcc26('0x2c');_0x427101[_0xcc26('0x2d')]=0x0;_0x427101[_0xcc26('0x2e')]=0x1;_0x427101['lastAssignedTo']=_0xa37a9a['membername'];_0x427101[_0xcc26('0x2f')]=_0xcc26('0x30');return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](voiceQueueReport[_0xcc26('0x31')](_0x427101))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x32')));};exports[_0xcc26('0x33')]=function(_0xb528cb,_0x14a85b){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0xb528cb,_0x14a85b))[_0xcc26('0xf')](loggerCatch(_0xcc26('0x34')));};exports[_0xcc26('0x35')]=function(_0x4a803e){return BPromise[_0xcc26('0xb')]()[_0xcc26('0xc')](cmHopper['rescheduleContact'](_0x4a803e,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xfe45=['membername','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xfe45,0xb3));var _0x5fe4=function(_0x2bdc2c,_0x440864){_0x2bdc2c=_0x2bdc2c-0x0;var _0x12b9da=_0xfe45[_0x2bdc2c];return _0x12b9da;};'use strict';var util=require(_0x5fe4('0x0'));var BPromise=require(_0x5fe4('0x1'));var logger=require(_0x5fe4('0x2'))(_0x5fe4('0x3'));var _=require(_0x5fe4('0x4'));var cmHopper=require(_0x5fe4('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5fe4('0x6'));var cmHopperBlack=require(_0x5fe4('0x7'));var voiceQueueRt=require(_0x5fe4('0x8'));var agentReportPreview=require(_0x5fe4('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x38cfec){return function(_0x192bb4){logger[_0x5fe4('0xa')](_0x38cfec,util[_0x5fe4('0xb')](_0x192bb4,{'showHidden':![],'depth':null}));};}function create(_0xb29935){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopperHistory[_0x5fe4('0xe')](_0xb29935))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x10')));}function createAgent(_0x3e0f3){return BPromise['resolve']()[_0x5fe4('0xd')](agentReportPreview['createHistory'](_0x3e0f3))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x10')));}function moveContact(_0x5c027b){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x11')](_0x5c027b,!![]))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x12')));}exports[_0x5fe4('0x13')]=function(_0xfa021a){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopperBlack[_0x5fe4('0x13')](_0xfa021a))['catch'](loggerCatch(_0x5fe4('0x14')));};exports[_0x5fe4('0x15')]=function(_0x5efb2d){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x15')](_0x5efb2d))[_0x5fe4('0xf')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x7468eb,_0x13da76){create(_0x7468eb)[_0x5fe4('0xf')](loggerCatch(_0x13da76));moveContact(_0x7468eb)[_0x5fe4('0xf')](loggerCatch(_0x13da76));};exports['createAgentHistory']=function(_0x1f3b51,_0x549f9f){createAgent(_0x1f3b51)[_0x5fe4('0xf')](loggerCatch(_0x549f9f));};exports[_0x5fe4('0x16')]=function(_0x16e5dd,_0x46eb34){create(_0x16e5dd)[_0x5fe4('0xf')](loggerCatch(_0x46eb34));};exports['createCustomerFinal']=function(_0x191368,_0x13bb4e){moveContact(_0x191368)['catch'](loggerCatch(_0x13bb4e));};exports[_0x5fe4('0x17')]=function(_0x39be83,_0x35bfbb,_0x5a702c){if(_0x35bfbb){_0x39be83[_0x5fe4('0x18')]=null;}if(_0x5a702c){_0x39be83[_0x5fe4('0x19')]=![];}return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x17')](_0x39be83))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x1a')));};exports[_0x5fe4('0x1b')]=function(_0x564b6d){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x1b')](_0x564b6d))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x1c')));};exports[_0x5fe4('0x1d')]=function(_0x2d613d){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x1d')]({'UserId':null},_0x2d613d,0x1))[_0x5fe4('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0x5fe4('0x1e')]=function(_0x7244ed){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x1d')]({'active':![]},_0x7244ed,0x1))[_0x5fe4('0xf')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x13aa20){var _0x527c46={};_0x527c46[_0x5fe4('0x1f')]=_0x13aa20[_0x5fe4('0x1f')];_0x527c46[_0x5fe4('0x20')]=_0x13aa20[_0x5fe4('0x20')];_0x527c46[_0x5fe4('0x21')]=_0x13aa20[_0x5fe4('0x21')];_0x527c46[_0x5fe4('0x22')]=_0x13aa20[_0x5fe4('0x22')];_0x527c46[_0x5fe4('0x23')]=_0x13aa20[_0x5fe4('0x23')];_0x527c46['queuecallerjoinAt']=_0x13aa20[_0x5fe4('0x24')];_0x527c46[_0x5fe4('0x25')]=_0x13aa20[_0x5fe4('0x24')];_0x527c46[_0x5fe4('0x26')]=0x1;_0x527c46[_0x5fe4('0x27')]=_0x13aa20['endtime'];_0x527c46[_0x5fe4('0x28')]=_0x13aa20[_0x5fe4('0x29')];_0x527c46['context']=_0x5fe4('0x2a');_0x527c46['exten']=_0x5fe4('0x2b');_0x527c46[_0x5fe4('0x2c')]=0x0;_0x527c46[_0x5fe4('0x2d')]=0x1;_0x527c46[_0x5fe4('0x2e')]=_0x13aa20[_0x5fe4('0x29')];_0x527c46[_0x5fe4('0x2f')]=_0x5fe4('0x30');return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](voiceQueueReport[_0x5fe4('0x31')](_0x527c46))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('0x32')));};exports[_0x5fe4('0x33')]=function(_0x45ac99,_0x5ab8fc){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper[_0x5fe4('0x33')](_0x45ac99,_0x5ab8fc))['catch'](loggerCatch(_0x5fe4('0x34')));};exports[_0x5fe4('0x35')]=function(_0xbad123){return BPromise[_0x5fe4('0xc')]()[_0x5fe4('0xd')](cmHopper['rescheduleContact'](_0xbad123,!![],!![]))[_0x5fe4('0xf')](loggerCatch(_0x5fe4('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 a5b403e..91a8145 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 _0xe2a0=['\x5cw{0,','pow','replace','random','match','moment','../../../../config/logger','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','error','message','getCallerId','isEmpty','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','responsetime','endtime','state','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','countbusyretry','countnoanswerretry','cloneAction','clone','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countcongestionretry','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer'];(function(_0x3e895c,_0x1122c4){var _0x5dc091=function(_0x519842){while(--_0x519842){_0x3e895c['push'](_0x3e895c['shift']());}};_0x5dc091(++_0x1122c4);}(_0xe2a0,0x1a0));var _0x0e2a=function(_0x104aea,_0x541bf1){_0x104aea=_0x104aea-0x0;var _0x472ade=_0xe2a0[_0x104aea];return _0x472ade;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0e2a('0x0'));var logger=require(_0x0e2a('0x1'))('preview');var ipAgi=process['env'][_0x0e2a('0x2')]||'127.0.0.1';function getSeconds(_0x340421,_0x182550){var _0x13af16=moment(_0x340421)[_0x0e2a('0x3')](0x0);var _0x5c20b8=moment(_0x182550)[_0x0e2a('0x3')](0x0);return _0x13af16[_0x0e2a('0x4')](_0x5c20b8,_0x0e2a('0x5'));}exports[_0x0e2a('0x6')]=function(_0x26b350){return function(_0x59db04){logger['error'](_0x26b350,util['inspect'](_0x59db04,{'showHidden':![],'depth':null}));};};exports[_0x0e2a('0x7')]=function(_0x1ca601,_0x2a4bac){logger[_0x0e2a('0x8')](_0x1ca601,util[_0x0e2a('0x9')](_0x2a4bac,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3b09d2,_0x3f5b42){logger[_0x0e2a('0xa')](_0x3b09d2,util[_0x0e2a('0x9')](_0x3f5b42,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3274df){return function(_0x27d751){logger['info'](_0x3274df,util[_0x0e2a('0x9')](_0x27d751,{'showHidden':![],'depth':null}));};};exports[_0x0e2a('0xb')]=function(_0x805e81,_0x44a130,_0x40e33c){return{'message':_0x805e81,'unlock':_0x44a130,'active':_0x40e33c};};exports[_0x0e2a('0xc')]=function(_0x3dbda1,_0x53b788,_0x2c4e49){if(!_['isUndefined'](_0x2c4e49)&&'string'===typeof _0x2c4e49&&!_[_0x0e2a('0xd')](_0x2c4e49)){if(!_['isUndefined'](_0x53b788)&&_0x0e2a('0xe')===typeof _0x53b788&&!_[_0x0e2a('0xd')](_0x53b788)){return util[_0x0e2a('0xf')](_0x0e2a('0x10'),_0x53b788,_0x2c4e49);}return util['format']('\x22%s\x22\x20<%s>',_0x2c4e49,_0x2c4e49);}if(!_[_0x0e2a('0x11')](_0x3dbda1)&&_0x0e2a('0xe')===typeof _0x3dbda1&&!_['isEmpty'](_0x3dbda1)){return _0x3dbda1;}return _0x0e2a('0x12');};exports[_0x0e2a('0x13')]=function(_0x1165a0){if(_[_0x0e2a('0x14')](_0x1165a0)){return![];}return _0x1165a0;};exports[_0x0e2a('0x15')]=function(_0x51ed5b,_0x4f5ead,_0x2e346c,_0x1e06b1,_0xed0d58,_0x35145f){var _0x1da474={'XMD-QUEUE':_0x4f5ead[_0x0e2a('0x16')]?_0x4f5ead[_0x0e2a('0x16')][_0x0e2a('0x17')]:'','XMD-CALLERID':_0x1e06b1,'XMD-CALLERID-PREVIEW':_0x35145f?util[_0x0e2a('0xf')](_0x0e2a('0x10'),_0x35145f[_0x0e2a('0x18')],_0x35145f[_0x0e2a('0x19')]):_0x1e06b1,'XMD-DIALID':_0xed0d58,'XMD-CONTACTID':_0x4f5ead[_0x0e2a('0x1a')],'XMD-CDRTYPE':_0x0e2a('0x1b'),'CALLERID(all)':_0x1e06b1,'XMD-VOICEQUEUEID':_0x4f5ead['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2e346c,'XMD-DIALTIMEOUT':_0x51ed5b[_0x0e2a('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x0e2a('0xf')](_0x0e2a('0x1d'),_0x51ed5b['dialQueueProject2']?'g':'',_[_0x0e2a('0xd')](_0x51ed5b['monitor_format'])?'':_0x0e2a('0x1e')),'XMD-DIALURL':_0x51ed5b[_0x0e2a('0x1f')]||'','XMD-AGI':_0x51ed5b[_0x0e2a('0x20')]?util[_0x0e2a('0xf')](_0x0e2a('0x21'),ipAgi,_0x51ed5b[_0x0e2a('0x20')]):_0x0e2a('0x22'),'XMD-AGIAFTER':_0x51ed5b[_0x0e2a('0x23')]?util[_0x0e2a('0xf')](_0x0e2a('0x21'),ipAgi,_0x51ed5b['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x35145f?_0x35145f[_0x0e2a('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x35145f?_0x35145f[_0x0e2a('0x25')]:'','XMD-DESTINATION':_0x0e2a('0x26')};if(!_[_0x0e2a('0xd')](_0x51ed5b[_0x0e2a('0x27')])){_0x1da474[util['format']('%s',_0x0e2a('0x28'))]=_0x51ed5b['monitor_format'];_0x1da474[util[_0x0e2a('0xf')]('%s',_0x0e2a('0x29'))]=_0xed0d58;}if(_0x4f5ead&&_0x4f5ead[_0x0e2a('0x2a')]){for(var _0x4cec72 in _0x4f5ead[_0x0e2a('0x2a')]){if(_0x4f5ead[_0x0e2a('0x2a')][_0x0e2a('0x2b')](_0x4cec72)){if(!_['isNil'](_0x4f5ead['Contact'][_0x4cec72])&&_0x4cec72!=='id'&&_0x4cec72!==_0x0e2a('0x2c')&&_0x4cec72!==_0x0e2a('0x2d')&&_0x4cec72!=='updatedAt'){_0x1da474[util[_0x0e2a('0xf')](_0x0e2a('0x2e'),_0x0e2a('0x2f'),_[_0x0e2a('0x30')](_0x4cec72))]=_0x4f5ead[_0x0e2a('0x2a')][_0x4cec72];}}}}return _0x1da474;};exports[_0x0e2a('0x31')]=function(_0x113e53){var _0x593178={};for(var _0x2e91b4 in _0x113e53){if(_0x113e53[_0x0e2a('0x2b')](_0x2e91b4)){_0x593178[util[_0x0e2a('0xf')]('%s',_[_0x0e2a('0x32')](_0x2e91b4))]=_0x113e53[_0x2e91b4];}}return{'variables':_0x593178};};exports[_0x0e2a('0x33')]=function(_0x152e86,_0x58b32e){if(!_[_0x0e2a('0x14')](_0x152e86)){if(_0x152e86[_0x0e2a('0x2b')]('originated')){if(_0x152e86[_0x0e2a('0x34')]>0x0){_0x152e86['originated']-=0x1;}else{logger['error'](_0x0e2a('0x35'),_0x58b32e);}}}else{logger[_0x0e2a('0xa')](_0x0e2a('0x36'),_0x58b32e);}};exports[_0x0e2a('0x37')]=function(_0x1d19a8){var _0x2ddca8=moment()[_0x0e2a('0xf')](_0x0e2a('0x38'));_0x1d19a8['state']=0xd;_0x1d19a8[_0x0e2a('0x39')]=_0x0e2a('0x3a');_0x1d19a8['starttime']=_0x2ddca8;_0x1d19a8[_0x0e2a('0x3b')]=_0x2ddca8;_0x1d19a8[_0x0e2a('0x3c')]=_0x2ddca8;};exports['logAgent']=function(_0x597117,_0x2c0ba1,_0x118837){var _0x362518=moment()[_0x0e2a('0xf')](_0x0e2a('0x38'));_0x597117[_0x0e2a('0x3d')]=_0x2c0ba1;_0x597117['statedesc']=_0x118837;_0x597117[_0x0e2a('0x3b')]=_0x362518;_0x597117[_0x0e2a('0x3e')]=getSeconds(_0x597117[_0x0e2a('0x3b')],_0x597117[_0x0e2a('0x3f')]);};exports[_0x0e2a('0x40')]=function(_0x1b545c,_0x3c67f0,_0xd896c0){_0x1b545c[_0x0e2a('0x41')]=_0x3c67f0;_0x1b545c[_0x0e2a('0x42')]=_0xd896c0;};exports[_0x0e2a('0x43')]=function(_0x3e577a,_0x43cec2,_0x26ebf1){var _0x222cd7=moment()[_0x0e2a('0xf')](_0x0e2a('0x38'));_0x3e577a[_0x0e2a('0x3d')]=_0x43cec2;_0x3e577a['statedesc']=_0x26ebf1;_0x3e577a[_0x0e2a('0x3b')]=_0x3e577a[_0x0e2a('0x3b')]?_0x3e577a[_0x0e2a('0x3b')]:_0x222cd7;_0x3e577a[_0x0e2a('0x3c')]=_0x3e577a[_0x0e2a('0x3c')]?_0x3e577a[_0x0e2a('0x3c')]:_0x222cd7;_0x3e577a[_0x0e2a('0x3e')]=getSeconds(_0x3e577a[_0x0e2a('0x3b')]||0x0,_0x3e577a[_0x0e2a('0x3f')]||0x0);_0x3e577a[_0x0e2a('0x44')]=_0x3e577a[_0x0e2a('0x45')]?getSeconds(_0x3e577a['endtime'],_0x3e577a[_0x0e2a('0x45')]):0x0;};exports[_0x0e2a('0x46')]=function(_0x4fbe61){return _0x4fbe61===_0x0e2a('0x47');};exports[_0x0e2a('0x48')]=function(_0x54d11a,_0x216a92,_0x3d4209,_0x2462ef,_0x29ff97){var _0x27f791=_0x2462ef?_0x0e2a('0x49'):_0x54d11a[_0x0e2a('0x18')];_0x27f791=_0x29ff97?_0x0e2a('0x4a'):_0x27f791;return{'actionid':_0x54d11a[_0x0e2a('0x4b')],'action':'originate','channel':_0x54d11a[_0x0e2a('0x4c')],'callerid':util[_0x0e2a('0xf')](_0x0e2a('0x10'),_0x27f791,_0x54d11a[_0x0e2a('0x19')]),'Exten':_0x0e2a('0x26'),'Context':_0x0e2a('0x4d'),'Priority':'1','variable':_0x3d4209,'timeout':(_0x216a92['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x54d11a[_0x0e2a('0x4b')]};};exports['totalGlobal']=function(_0x14da78){return _0x14da78[_0x0e2a('0x4e')]+_0x14da78['countcongestionretry']+_0x14da78[_0x0e2a('0x4f')];};exports[_0x0e2a('0x50')]=function(_0x51aecb){var _0x3ffaea=_[_0x0e2a('0x51')](_0x51aecb);_0x3ffaea[_0x0e2a('0x3d')]=0xf;_0x3ffaea[_0x0e2a('0x39')]='Global';return _0x3ffaea;};exports['scheduledAt']=function(_0x3a47e5,_0x30f628,_0x4e583e){var _0x2955f0={};_0x2955f0[_0x30f628]=_0x3a47e5[_0x30f628];_0x2955f0[_0x0e2a('0x52')]=![];_0x2955f0['scheduledat']=moment()[_0x0e2a('0x53')](_0x4e583e,_0x0e2a('0x54'))['format'](_0x0e2a('0x38'));_0x2955f0[_0x0e2a('0x1a')]=_0x3a47e5[_0x0e2a('0x1a')];_0x2955f0[_0x0e2a('0x55')]=_0x3a47e5[_0x0e2a('0x55')];_0x2955f0[_0x0e2a('0x56')]=_0x3a47e5[_0x0e2a('0x56')]||undefined;return _0x2955f0;};exports[_0x0e2a('0x57')]=function(_0x2272a6,_0x3ef1c3){if(!_[_0x0e2a('0x14')](_0x2272a6)){if(_0x2272a6[_0x0e2a('0x58')]>0x0){_0x2272a6[_0x0e2a('0x58')]-=0x1;}else{logger[_0x0e2a('0xa')](_0x3ef1c3,_0x0e2a('0x59'));}}else{logger['error'](_0x3ef1c3,_0x0e2a('0x5a'));}};exports[_0x0e2a('0x5b')]=function(_0x4eda8d){if(_0x4eda8d<=0x0){return!![];}return![];};exports[_0x0e2a('0x5c')]=function(_0x180454,_0x2ac181){_0x180454[_0x0e2a('0x5d')]=_0x2ac181;_0x180454[_0x0e2a('0x17')]=_0x180454[_0x0e2a('0x5e')];_0x180454[_0x0e2a('0x5f')]=_0x180454['channelAgent'];return _0x180454;};exports[_0x0e2a('0x60')]=function(_0x36b2c7){var _0x1a4312={};_0x1a4312[_0x0e2a('0x5e')]=_0x36b2c7[_0x0e2a('0x5e')];_0x1a4312[_0x0e2a('0x5f')]=_0x36b2c7[_0x0e2a('0x4c')];_0x1a4312[_0x0e2a('0x4b')]=_0x36b2c7[_0x0e2a('0x4b')];return _0x1a4312;};exports[_0x0e2a('0x61')]=function(_0x227324){var _0xe8807f=[];for(var _0x285756 in _0x227324){if(_0x227324[_0x0e2a('0x2b')](_0x285756)){if(!_['isNil'](_0x227324[_0x285756])&&_0x227324[_0x285756][_0x0e2a('0x3d')]===_0x0e2a('0x62')&&_0x227324[_0x285756][_0x0e2a('0x63')]===_0x0e2a('0x64')){_0xe8807f[_0x0e2a('0x65')](_0x227324[_0x285756]['id']);}}}return _0xe8807f;};exports[_0x0e2a('0x66')]=function(_0x25cd70){var _0x17e6bf=moment()[_0x0e2a('0x3')](0x0);var _0x5d32ed=moment(_0x25cd70)[_0x0e2a('0x3')](0x0);return _0x17e6bf[_0x0e2a('0x4')](_0x5d32ed,_0x0e2a('0x5'));};exports[_0x0e2a('0x67')]=function(_0x1834d7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1834d7[_0x0e2a('0x1a')],'ListId':_0x1834d7['ListId'],'VoiceQueueId':_0x1834d7[_0x0e2a('0x56')]||undefined,'CampaignId':_0x1834d7[_0x0e2a('0x68')]||undefined};};exports[_0x0e2a('0x69')]=function(_0x5a2771){if(_0x5a2771===_0x0e2a('0x4b')||_0x5a2771===_0x0e2a('0x6a')||_0x5a2771===_0x0e2a('0x5e')||_0x5a2771===_0x0e2a('0x6b')||_0x5a2771===_0x0e2a('0x6c')||_0x5a2771==='dialAnswer'||_0x5a2771===_0x0e2a('0x41')||_0x5a2771==='channelAgent'||_0x5a2771===_0x0e2a('0x18')||_0x5a2771===_0x0e2a('0x52')||_0x5a2771==='calleridnum'||_0x5a2771===_0x0e2a('0x6d')||_0x5a2771===_0x0e2a('0x4e')||_0x5a2771===_0x0e2a('0x6e')||_0x5a2771===_0x0e2a('0x4f')||_0x5a2771==='countglobal'||_0x5a2771===_0x0e2a('0x6f')||_0x5a2771===_0x0e2a('0x70')||_0x5a2771===_0x0e2a('0x71')||_0x5a2771==='recallme'||_0x5a2771===_0x0e2a('0x1a')||_0x5a2771===_0x0e2a('0x55')||_0x5a2771===_0x0e2a('0x42')||_0x5a2771===_0x0e2a('0x56')||_0x5a2771===_0x0e2a('0x72')||_0x5a2771==='xmd-voicequeueid'||_0x5a2771===_0x0e2a('0x73')||_0x5a2771===_0x0e2a('0x74')||_0x5a2771===_0x0e2a('0x75')||_0x5a2771===_0x0e2a('0x76')||_0x5a2771===_0x0e2a('0x77')||_0x5a2771===_0x0e2a('0x78')||_0x5a2771==='xmd-dialid'||_0x5a2771===_0x0e2a('0x79')||_0x5a2771==='xmd-contactid'||_0x5a2771===_0x0e2a('0x7a')||_0x5a2771==='xmd-callerid'||_0x5a2771===_0x0e2a('0x7b')||_0x5a2771===_0x0e2a('0x7c')||_0x5a2771==='rtpaudioqos'||_0x5a2771==='rtpaudioqosbridged'||_0x5a2771===_0x0e2a('0x7d')||_0x5a2771==='rtpaudioqosjitterbridged'||_0x5a2771===_0x0e2a('0x7e')||_0x5a2771==='rtpaudioqoslossbridged'||_0x5a2771===_0x0e2a('0x7f')||_0x5a2771===_0x0e2a('0x80')||_0x5a2771===_0x0e2a('0x81')||_0x5a2771==='rtpaudioqosbridged'||_0x5a2771===_0x0e2a('0x7d')||_0x5a2771===_0x0e2a('0x82')||_0x5a2771==='rtpaudioqosloss'||_0x5a2771==='rtpaudioqoslossbridged'||_0x5a2771===_0x0e2a('0x7f')||_0x5a2771===_0x0e2a('0x80')||_0x5a2771===_0x0e2a('0x83')||_0x5a2771==='bridgepvtcallid'||_0x5a2771===_0x0e2a('0x3d')||_0x5a2771===_0x0e2a('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x123930,_0x30b83d){var _0x475f7a,_0x54f374,_0x442cc1;if(_0x30b83d<=0x0){_0x30b83d=0x1;}_0x475f7a=new RegExp(_0x0e2a('0x84')+_0x30b83d+'}$');_0x54f374=Math['pow'](0xa,_0x30b83d-0x1);_0x442cc1=Math[_0x0e2a('0x85')](0xa,_0x30b83d)-0x1;return util[_0x0e2a('0xf')]('%s',_[_0x0e2a('0x86')](_0x123930,_0x475f7a,_[_0x0e2a('0x87')](_0x54f374,_0x442cc1)));};exports['extractCalleridName']=function(_0x49ea26){var _0x165dcc=_0x49ea26['match'](/"(.*?)"/);return _0x165dcc?_0x165dcc[0x1]:_0x49ea26;};exports['extractCalleridNumber']=function(_0x3b876e){var _0xb33134=_0x3b876e[_0x0e2a('0x88')](/<(.*?)>/);return _0xb33134?_0xb33134[0x1]:_0x3b876e;}; \ No newline at end of file +var _0x6a3b=['ListId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','interface','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','active','scheduledat','callback','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','logLookAgent','UserId','logCustomer','endtime','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','channelAgent','xcally-motion-preview','timeout','uniqueid','countbusyretry','countcongestionretry','cloneAction','Global','scheduledAt'];(function(_0x832505,_0x4a5bbe){var _0x3a7e74=function(_0x46f324){while(--_0x46f324){_0x832505['push'](_0x832505['shift']());}};_0x3a7e74(++_0x4a5bbe);}(_0x6a3b,0x140));var _0xb6a3=function(_0x159210,_0x4fca0d){_0x159210=_0x159210-0x0;var _0x4c0185=_0x6a3b[_0x159210];return _0x4c0185;};'use strict';var util=require(_0xb6a3('0x0'));var _=require(_0xb6a3('0x1'));var moment=require('moment');var logger=require(_0xb6a3('0x2'))(_0xb6a3('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xb6a3('0x4');function getSeconds(_0x3a63bd,_0xf4cc67){var _0x1cdeca=moment(_0x3a63bd)[_0xb6a3('0x5')](0x0);var _0x3ed91b=moment(_0xf4cc67)[_0xb6a3('0x5')](0x0);return _0x1cdeca[_0xb6a3('0x6')](_0x3ed91b,_0xb6a3('0x7'));}exports[_0xb6a3('0x8')]=function(_0x4a937b){return function(_0x492682){logger[_0xb6a3('0x9')](_0x4a937b,util['inspect'](_0x492682,{'showHidden':![],'depth':null}));};};exports[_0xb6a3('0xa')]=function(_0x23de01,_0x5d5c87){logger[_0xb6a3('0xb')](_0x23de01,util[_0xb6a3('0xc')](_0x5d5c87,{'showHidden':![],'depth':null}));};exports[_0xb6a3('0xd')]=function(_0x461675,_0x41a88e){logger[_0xb6a3('0x9')](_0x461675,util[_0xb6a3('0xc')](_0x41a88e,{'showHidden':![],'depth':null}));};exports[_0xb6a3('0xe')]=function(_0x385105){return function(_0x371914){logger[_0xb6a3('0xb')](_0x385105,util[_0xb6a3('0xc')](_0x371914,{'showHidden':![],'depth':null}));};};exports[_0xb6a3('0xf')]=function(_0x1d1e85,_0x41a87e,_0x43bc49){return{'message':_0x1d1e85,'unlock':_0x41a87e,'active':_0x43bc49};};exports[_0xb6a3('0x10')]=function(_0x57a88c,_0xd9c25,_0x4d028a){if(!_[_0xb6a3('0x11')](_0x4d028a)&&'string'===typeof _0x4d028a&&!_['isEmpty'](_0x4d028a)){if(!_[_0xb6a3('0x11')](_0xd9c25)&&_0xb6a3('0x12')===typeof _0xd9c25&&!_[_0xb6a3('0x13')](_0xd9c25)){return util[_0xb6a3('0x14')](_0xb6a3('0x15'),_0xd9c25,_0x4d028a);}return util[_0xb6a3('0x14')](_0xb6a3('0x15'),_0x4d028a,_0x4d028a);}if(!_['isUndefined'](_0x57a88c)&&_0xb6a3('0x12')===typeof _0x57a88c&&!_[_0xb6a3('0x13')](_0x57a88c)){return _0x57a88c;}return'\x22\x22\x20<>';};exports[_0xb6a3('0x16')]=function(_0x57ee17){if(_[_0xb6a3('0x17')](_0x57ee17)){return![];}return _0x57ee17;};exports[_0xb6a3('0x18')]=function(_0x1d4fb1,_0x465c57,_0x402efc,_0x1ff258,_0x1a460a,_0x37924e){var _0x5f0ca9={'XMD-QUEUE':_0x465c57[_0xb6a3('0x19')]?_0x465c57[_0xb6a3('0x19')]['name']:'','XMD-CALLERID':_0x1ff258,'XMD-CALLERID-PREVIEW':_0x37924e?util[_0xb6a3('0x14')]('\x22%s\x22\x20<%s>',_0x37924e[_0xb6a3('0x1a')],_0x37924e[_0xb6a3('0x1b')]):_0x1ff258,'XMD-DIALID':_0x1a460a,'XMD-CONTACTID':_0x465c57[_0xb6a3('0x1c')],'XMD-CDRTYPE':_0xb6a3('0x1d'),'CALLERID(all)':_0x1ff258,'XMD-VOICEQUEUEID':_0x465c57[_0xb6a3('0x1e')],'XMD-DIALCHANNEL':_0x402efc,'XMD-DIALTIMEOUT':_0x1d4fb1[_0xb6a3('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xb6a3('0x14')](_0xb6a3('0x20'),_0x1d4fb1['dialQueueProject2']?'g':'',_[_0xb6a3('0x13')](_0x1d4fb1[_0xb6a3('0x21')])?'':_0xb6a3('0x22')),'XMD-DIALURL':_0x1d4fb1['dialPreviewUrl']||'','XMD-AGI':_0x1d4fb1['dialQueueProject']?util[_0xb6a3('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d4fb1[_0xb6a3('0x23')]):'NONE','XMD-AGIAFTER':_0x1d4fb1['dialQueueProject2']?util[_0xb6a3('0x14')](_0xb6a3('0x24'),ipAgi,_0x1d4fb1[_0xb6a3('0x25')]):_0xb6a3('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x37924e?_0x37924e[_0xb6a3('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x37924e?_0x37924e['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x1d4fb1[_0xb6a3('0x21')])){_0x5f0ca9[util[_0xb6a3('0x14')]('%s',_0xb6a3('0x28'))]=_0x1d4fb1[_0xb6a3('0x21')];_0x5f0ca9[util[_0xb6a3('0x14')]('%s',_0xb6a3('0x29'))]=_0x1a460a;}if(_0x465c57&&_0x465c57[_0xb6a3('0x2a')]){for(var _0x2f97e2 in _0x465c57[_0xb6a3('0x2a')]){if(_0x465c57[_0xb6a3('0x2a')][_0xb6a3('0x2b')](_0x2f97e2)){if(!_[_0xb6a3('0x17')](_0x465c57[_0xb6a3('0x2a')][_0x2f97e2])&&_0x2f97e2!=='id'&&_0x2f97e2!=='tags'&&_0x2f97e2!=='createdAt'&&_0x2f97e2!=='updatedAt'){_0x5f0ca9[util[_0xb6a3('0x14')](_0xb6a3('0x2c'),_0xb6a3('0x2d'),_[_0xb6a3('0x2e')](_0x2f97e2))]=_0x465c57[_0xb6a3('0x2a')][_0x2f97e2];}}}}return _0x5f0ca9;};exports[_0xb6a3('0x2f')]=function(_0x719bc9){var _0x56d746={};for(var _0x2ce895 in _0x719bc9){if(_0x719bc9[_0xb6a3('0x2b')](_0x2ce895)){_0x56d746[util[_0xb6a3('0x14')]('%s',_[_0xb6a3('0x30')](_0x2ce895))]=_0x719bc9[_0x2ce895];}}return{'variables':_0x56d746};};exports[_0xb6a3('0x31')]=function(_0x68348e,_0x22b403){if(!_['isNil'](_0x68348e)){if(_0x68348e[_0xb6a3('0x2b')](_0xb6a3('0x32'))){if(_0x68348e[_0xb6a3('0x32')]>0x0){_0x68348e[_0xb6a3('0x32')]-=0x1;}else{logger[_0xb6a3('0x9')](_0xb6a3('0x33'),_0x22b403);}}}else{logger[_0xb6a3('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x22b403);}};exports['logBlacklist']=function(_0x2f33b5){var _0x1ebd43=moment()['format'](_0xb6a3('0x34'));_0x2f33b5[_0xb6a3('0x35')]=0xd;_0x2f33b5[_0xb6a3('0x36')]=_0xb6a3('0x37');_0x2f33b5[_0xb6a3('0x38')]=_0x1ebd43;_0x2f33b5[_0xb6a3('0x39')]=_0x1ebd43;_0x2f33b5['endtime']=_0x1ebd43;};exports[_0xb6a3('0x3a')]=function(_0x5e1e02,_0x449ecf,_0x2cf5e7){var _0x3295f3=moment()[_0xb6a3('0x14')](_0xb6a3('0x34'));_0x5e1e02['state']=_0x449ecf;_0x5e1e02[_0xb6a3('0x36')]=_0x2cf5e7;_0x5e1e02['responsetime']=_0x3295f3;_0x5e1e02['ringtime']=getSeconds(_0x5e1e02[_0xb6a3('0x39')],_0x5e1e02['starttime']);};exports[_0xb6a3('0x3b')]=function(_0x2d6782,_0x2ee5c4,_0x58fb69){_0x2d6782['membername']=_0x2ee5c4;_0x2d6782[_0xb6a3('0x3c')]=_0x58fb69;};exports[_0xb6a3('0x3d')]=function(_0x137ec9,_0x1f2d14,_0x2a90a2){var _0x501ee5=moment()['format'](_0xb6a3('0x34'));_0x137ec9[_0xb6a3('0x35')]=_0x1f2d14;_0x137ec9['statedesc']=_0x2a90a2;_0x137ec9[_0xb6a3('0x39')]=_0x137ec9[_0xb6a3('0x39')]?_0x137ec9['responsetime']:_0x501ee5;_0x137ec9['endtime']=_0x137ec9[_0xb6a3('0x3e')]?_0x137ec9['endtime']:_0x501ee5;_0x137ec9[_0xb6a3('0x3f')]=getSeconds(_0x137ec9[_0xb6a3('0x39')]||0x0,_0x137ec9[_0xb6a3('0x38')]||0x0);_0x137ec9['talktime']=_0x137ec9['answertime']?getSeconds(_0x137ec9[_0xb6a3('0x3e')],_0x137ec9[_0xb6a3('0x40')]):0x0;};exports[_0xb6a3('0x41')]=function(_0x33f3af){return _0x33f3af===_0xb6a3('0x42');};exports[_0xb6a3('0x43')]=function(_0x7211a0,_0x2035f3,_0x1ecb85,_0x17d7e1,_0x2e032a){var _0x49ec81=_0x17d7e1?_0xb6a3('0x44'):_0x7211a0['calleridname'];_0x49ec81=_0x2e032a?_0xb6a3('0x45'):_0x49ec81;return{'actionid':_0x7211a0['uniqueid'],'action':'originate','channel':_0x7211a0[_0xb6a3('0x46')],'callerid':util[_0xb6a3('0x14')]('\x22%s\x22\x20<%s>',_0x49ec81,_0x7211a0[_0xb6a3('0x1b')]),'Exten':_0xb6a3('0x47'),'Context':'from-sip','Priority':'1','variable':_0x1ecb85,'timeout':(_0x2035f3[_0xb6a3('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x7211a0[_0xb6a3('0x49')]};};exports['totalGlobal']=function(_0x347d19){return _0x347d19[_0xb6a3('0x4a')]+_0x347d19[_0xb6a3('0x4b')]+_0x347d19['countnoanswerretry'];};exports[_0xb6a3('0x4c')]=function(_0x538719){var _0x1dae8e=_['clone'](_0x538719);_0x1dae8e[_0xb6a3('0x35')]=0xf;_0x1dae8e[_0xb6a3('0x36')]=_0xb6a3('0x4d');return _0x1dae8e;};exports[_0xb6a3('0x4e')]=function(_0x368d89,_0x8eaf8e,_0x280fa0){var _0x1afb4b={};_0x1afb4b[_0x8eaf8e]=_0x368d89[_0x8eaf8e];_0x1afb4b['active']=![];_0x1afb4b['scheduledat']=moment()['add'](_0x280fa0,'minutes')['format'](_0xb6a3('0x34'));_0x1afb4b[_0xb6a3('0x1c')]=_0x368d89[_0xb6a3('0x1c')];_0x1afb4b[_0xb6a3('0x4f')]=_0x368d89[_0xb6a3('0x4f')];_0x1afb4b['VoiceQueueId']=_0x368d89[_0xb6a3('0x1e')]||undefined;return _0x1afb4b;};exports[_0xb6a3('0x50')]=function(_0x1f4028,_0x42cc0f){if(!_['isNil'](_0x1f4028)){if(_0x1f4028['pTalking']>0x0){_0x1f4028['pTalking']-=0x1;}else{logger[_0xb6a3('0x9')](_0x42cc0f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x42cc0f,_0xb6a3('0x51'));}};exports[_0xb6a3('0x52')]=function(_0x6ae07c){if(_0x6ae07c<=0x0){return!![];}return![];};exports['buildObj']=function(_0x34ccb3,_0x14f371){_0x34ccb3[_0xb6a3('0x53')]=_0x14f371;_0x34ccb3[_0xb6a3('0x54')]=_0x34ccb3['queue'];_0x34ccb3[_0xb6a3('0x55')]=_0x34ccb3[_0xb6a3('0x46')];return _0x34ccb3;};exports[_0xb6a3('0x56')]=function(_0x36cc16){var _0x573cd4={};_0x573cd4[_0xb6a3('0x57')]=_0x36cc16[_0xb6a3('0x57')];_0x573cd4[_0xb6a3('0x55')]=_0x36cc16[_0xb6a3('0x46')];_0x573cd4[_0xb6a3('0x49')]=_0x36cc16[_0xb6a3('0x49')];return _0x573cd4;};exports[_0xb6a3('0x58')]=function(_0x2e300f){var _0x57fb46=[];for(var _0x4e9945 in _0x2e300f){if(_0x2e300f['hasOwnProperty'](_0x4e9945)){if(!_[_0xb6a3('0x17')](_0x2e300f[_0x4e9945])&&_0x2e300f[_0x4e9945]['state']===_0xb6a3('0x59')&&_0x2e300f[_0x4e9945][_0xb6a3('0x5a')]===_0xb6a3('0x5b')){_0x57fb46[_0xb6a3('0x5c')](_0x2e300f[_0x4e9945]['id']);}}}return _0x57fb46;};exports['getDiff']=function(_0x1a6ffa){var _0x3b1c6f=moment()[_0xb6a3('0x5')](0x0);var _0x373e4c=moment(_0x1a6ffa)[_0xb6a3('0x5')](0x0);return _0x3b1c6f[_0xb6a3('0x6')](_0x373e4c,_0xb6a3('0x7'));};exports[_0xb6a3('0x5d')]=function(_0x540ac0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x540ac0['ContactId'],'ListId':_0x540ac0[_0xb6a3('0x4f')],'VoiceQueueId':_0x540ac0[_0xb6a3('0x1e')]||undefined,'CampaignId':_0x540ac0[_0xb6a3('0x5e')]||undefined};};exports[_0xb6a3('0x5f')]=function(_0x26bd42){if(_0x26bd42===_0xb6a3('0x49')||_0x26bd42===_0xb6a3('0x60')||_0x26bd42==='queue'||_0x26bd42===_0xb6a3('0x61')||_0x26bd42===_0xb6a3('0x62')||_0x26bd42===_0xb6a3('0x63')||_0x26bd42===_0xb6a3('0x64')||_0x26bd42===_0xb6a3('0x46')||_0x26bd42===_0xb6a3('0x1a')||_0x26bd42===_0xb6a3('0x65')||_0x26bd42==='calleridnum'||_0x26bd42===_0xb6a3('0x66')||_0x26bd42==='countbusyretry'||_0x26bd42===_0xb6a3('0x4b')||_0x26bd42==='countnoanswerretry'||_0x26bd42==='countglobal'||_0x26bd42===_0xb6a3('0x67')||_0x26bd42==='callbackuniqueid'||_0x26bd42===_0xb6a3('0x68')||_0x26bd42===_0xb6a3('0x69')||_0x26bd42===_0xb6a3('0x1c')||_0x26bd42==='ListId'||_0x26bd42===_0xb6a3('0x3c')||_0x26bd42==='VoiceQueueId'||_0x26bd42===_0xb6a3('0x6a')||_0x26bd42==='xmd-voicequeueid'||_0x26bd42==='xmd-queue'||_0x26bd42===_0xb6a3('0x6b')||_0x26bd42===_0xb6a3('0x6c')||_0x26bd42==='xmd-dialurl'||_0x26bd42===_0xb6a3('0x6d')||_0x26bd42===_0xb6a3('0x6e')||_0x26bd42===_0xb6a3('0x6f')||_0x26bd42==='xmd-dialchannel'||_0x26bd42===_0xb6a3('0x70')||_0x26bd42==='xmd-cdrtype'||_0x26bd42===_0xb6a3('0x71')||_0x26bd42===_0xb6a3('0x72')||_0x26bd42===_0xb6a3('0x73')||_0x26bd42===_0xb6a3('0x74')||_0x26bd42===_0xb6a3('0x75')||_0x26bd42===_0xb6a3('0x76')||_0x26bd42==='rtpaudioqosjitterbridged'||_0x26bd42===_0xb6a3('0x77')||_0x26bd42===_0xb6a3('0x78')||_0x26bd42==='rtpaudioqosrtt'||_0x26bd42===_0xb6a3('0x79')||_0x26bd42==='rtpaudioqos'||_0x26bd42==='rtpaudioqosbridged'||_0x26bd42===_0xb6a3('0x76')||_0x26bd42===_0xb6a3('0x7a')||_0x26bd42===_0xb6a3('0x77')||_0x26bd42===_0xb6a3('0x78')||_0x26bd42===_0xb6a3('0x7b')||_0x26bd42===_0xb6a3('0x79')||_0x26bd42===_0xb6a3('0x7c')||_0x26bd42===_0xb6a3('0x7d')||_0x26bd42===_0xb6a3('0x35')||_0x26bd42===_0xb6a3('0x36')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1377dc,_0x4455db){var _0x44516e,_0x4af430,_0x4be826;if(_0x4455db<=0x0){_0x4455db=0x1;}_0x44516e=new RegExp(_0xb6a3('0x7e')+_0x4455db+'}$');_0x4af430=Math[_0xb6a3('0x7f')](0xa,_0x4455db-0x1);_0x4be826=Math['pow'](0xa,_0x4455db)-0x1;return util[_0xb6a3('0x14')]('%s',_[_0xb6a3('0x80')](_0x1377dc,_0x44516e,_[_0xb6a3('0x81')](_0x4af430,_0x4be826)));};exports[_0xb6a3('0x82')]=function(_0x2dc31e){var _0x4fcb33=_0x2dc31e[_0xb6a3('0x83')](/"(.*?)"/);return _0x4fcb33?_0x4fcb33[0x1]:_0x2dc31e;};exports[_0xb6a3('0x84')]=function(_0x1cb2c2){var _0x27ab1f=_0x1cb2c2[_0xb6a3('0x83')](/<(.*?)>/);return _0x27ab1f?_0x27ab1f[0x1]:_0x1cb2c2;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 681f23e..de6c6ba 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 _0x37c5=['number','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37c5,0xa7));var _0x537c=function(_0x47d701,_0x1294d2){_0x47d701=_0x47d701-0x0;var _0x323b99=_0x37c5[_0x47d701];return _0x323b99;};'use strict';exports['queueadd']={'queue':{'type':_0x537c('0x0'),'required':!![]},'interface':{'type':_0x537c('0x0'),'required':!![]},'membername':{'type':_0x537c('0x0'),'required':!![]},'penalty':{'type':_0x537c('0x1'),'required':![]},'paused':{'type':_0x537c('0x2'),'required':![]}};exports[_0x537c('0x3')]={'queue':{'type':_0x537c('0x0'),'required':!![]},'interface':{'type':_0x537c('0x0'),'required':!![]}};exports[_0x537c('0x4')]={'interface':{'type':_0x537c('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x537c('0x0'),'required':![]}};exports[_0x537c('0x5')]={'module':{'type':_0x537c('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x537c('0x0'),'required':!![]}};exports[_0x537c('0x6')]={'uniqueid':{'type':_0x537c('0x0'),'required':!![]},'filename':{'type':_0x537c('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x537c('0x0')}};exports[_0x537c('0x7')]={'uniqueid':{'type':_0x537c('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x537c('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xfc76=['voicequeuechannelredirect','string','number','boolean','reload','voicechannel'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xfc76,0xb5));var _0x6fc7=function(_0x581775,_0x74dd76){_0x581775=_0x581775-0x0;var _0xf30aea=_0xfc76[_0x581775];return _0xf30aea;};'use strict';exports['queueadd']={'queue':{'type':_0x6fc7('0x0'),'required':!![]},'interface':{'type':_0x6fc7('0x0'),'required':!![]},'membername':{'type':_0x6fc7('0x0'),'required':!![]},'penalty':{'type':_0x6fc7('0x1'),'required':![]},'paused':{'type':_0x6fc7('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x6fc7('0x0'),'required':!![]},'interface':{'type':_0x6fc7('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x6fc7('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x6fc7('0x0'),'required':![]}};exports[_0x6fc7('0x3')]={'module':{'type':_0x6fc7('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6fc7('0x0'),'required':!![]}};exports[_0x6fc7('0x4')]={'uniqueid':{'type':_0x6fc7('0x0'),'required':!![]},'filename':{'type':_0x6fc7('0x0')},'format':{'type':_0x6fc7('0x0')},'mixmonitorid':{'type':_0x6fc7('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6fc7('0x0'),'required':!![]}};exports[_0x6fc7('0x5')]={'uniqueid':{'type':_0x6fc7('0x0'),'required':!![]},'exten':{'type':_0x6fc7('0x0'),'required':!![]},'context':{'type':_0x6fc7('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0b05258..2361411 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 _0xe009=['../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','voiceExtensions','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','hasOwnProperty','format','SIP/%s','name','mapKeys','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','servicenowAccounts','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension'];(function(_0x3aaa2b,_0x34df19){var _0x19d17c=function(_0x298f6f){while(--_0x298f6f){_0x3aaa2b['push'](_0x3aaa2b['shift']());}};_0x19d17c(++_0x34df19);}(_0xe009,0x122));var _0x9e00=function(_0x17d44a,_0xa0fc91){_0x17d44a=_0x17d44a-0x0;var _0x503a89=_0xe009[_0x17d44a];return _0x503a89;};'use strict';var BPromise=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var _=require(_0x9e00('0x2'));var moment=require(_0x9e00('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x9e00('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9e00('0x5'));var Trigger=require(_0x9e00('0x6'));var Template=require(_0x9e00('0x7'));var Campaign=require(_0x9e00('0x8'));var VoiceExtension=require(_0x9e00('0x9'));var ZendeskAccount=require(_0x9e00('0xa'));var SalesforceAccount=require(_0x9e00('0xb'));var FreshdeskAccount=require(_0x9e00('0xc'));var SugarcrmAccount=require(_0x9e00('0xd'));var ZohoAccount=require(_0x9e00('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x9e00('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x9e00('0x10'));var Realtime=function(){this[_0x9e00('0x11')]={};this[_0x9e00('0x12')]={};this[_0x9e00('0x13')]={};this['voiceQueues']={};this[_0x9e00('0x14')]={};this[_0x9e00('0x15')]={};this[_0x9e00('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9e00('0x17')]={};this['channels']={};this['queueChannels']={};this[_0x9e00('0x18')]={};this['timers']={};this[_0x9e00('0x19')]={};this[_0x9e00('0x1a')]={};this[_0x9e00('0x1b')]={};this[_0x9e00('0x1c')]={};this[_0x9e00('0x1d')]={};this[_0x9e00('0x1e')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x9e00('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x10df77,_0x22ff8f,_0x298cb4){var _0x1ce9bd=_['mapKeys'](_0x10df77,function(_0x4f9007,_0x4e04af){return _0x4f9007[_0x298cb4];});for(var _0x4a2ce8 in _0x22ff8f){if(_0x22ff8f[_0x9e00('0x20')](_0x4a2ce8)){if(!_0x1ce9bd[_0x4a2ce8]){delete _0x22ff8f[_0x4a2ce8];}}}}function freeIsNotKeySip(_0x5971eb,_0x2c88e9){var _0x4402b=_['mapKeys'](_0x5971eb,function(_0x3113bd,_0x2f5e4d){return util[_0x9e00('0x21')](_0x9e00('0x22'),_0x3113bd[_0x9e00('0x23')]);});for(var _0x24a7e0 in _0x2c88e9){if(_0x2c88e9[_0x9e00('0x20')](_0x24a7e0)){if(!_0x4402b[_0x24a7e0]){delete _0x2c88e9[_0x24a7e0];}}}}function freeIsNotKeyAgent(_0x306094,_0x500416){var _0x53197a=_[_0x9e00('0x24')](_0x306094,function(_0x35e70b,_0x34c3dc){var _0x5c819f=_[_0x9e00('0x25')](_0x35e70b[_0x9e00('0x26')])?util[_0x9e00('0x21')]('SIP/%s',_0x35e70b[_0x9e00('0x23')]):_0x35e70b[_0x9e00('0x26')];return _0x5c819f;});for(var _0x18fac5 in _0x500416){if(_0x500416[_0x9e00('0x20')](_0x18fac5)){if(!_0x53197a[_0x18fac5]){delete _0x500416[_0x18fac5];}}}}function clearVoiceCallReports(_0x826a6){_0x826a6[_0x9e00('0x27')]=0x0;_0x826a6[_0x9e00('0x28')]=0x0;_0x826a6[_0x9e00('0x29')]=0x0;_0x826a6[_0x9e00('0x2a')]=0x0;_0x826a6[_0x9e00('0x2b')]=0x0;}function clearCampaigns(_0x2520ba){if(!_[_0x9e00('0x2c')](_0x2520ba)){for(var _0x232bcf in _0x2520ba){if(_0x2520ba[_0x9e00('0x20')](_0x232bcf)){_0x2520ba[_0x232bcf][_0x9e00('0x2d')]=0x0;_0x2520ba[_0x232bcf][_0x9e00('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x277807){if(!_[_0x9e00('0x2c')](_0x277807)){for(var _0x19a6ed in _0x277807){if(_0x277807['hasOwnProperty'](_0x19a6ed)){_0x277807[_0x19a6ed]['total']=0x0;_0x277807[_0x19a6ed]['answered']=0x0;_0x277807[_0x19a6ed][_0x9e00('0x2f')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x30')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x29')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x2a')]=0x0;_0x277807[_0x19a6ed]['sumBillable']=0x0;_0x277807[_0x19a6ed][_0x9e00('0x31')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x32')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x33')]=0x0;_0x277807[_0x19a6ed]['outboundCongestionCallsDay']=0x0;_0x277807[_0x19a6ed][_0x9e00('0x34')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x35')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x36')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x37')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x38')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x39')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x3a')]=0x0;_0x277807[_0x19a6ed][_0x9e00('0x3b')]=0x0;_0x277807[_0x19a6ed]['outboundAnswerAgiCallsDay']=0x0;_0x277807[_0x19a6ed]['outboundAnswerCallsDay']=0x0;_0x277807[_0x19a6ed][_0x9e00('0x3c')]=!![];}}}}Realtime[_0x9e00('0x3d')][_0x9e00('0x3e')]=function(_0x160ad8,_0x225caa){for(var _0x26c99b in _0x225caa){if(_0x160ad8[_0x9e00('0x20')](_0x26c99b)){_0x160ad8[_0x26c99b]=_0x225caa[_0x26c99b];}}};Realtime[_0x9e00('0x3d')]['initAgents']=function(){var _0x26f4b6=this;return function(_0x5915e2){if(_0x5915e2){freeIsNotKeyAgent(_0x5915e2,_0x26f4b6[_0x9e00('0x11')]);for(var _0xe0421e=0x0,_0x35d778={},_0x6bcd83={};_0xe0421e<_0x5915e2[_0x9e00('0x3f')];_0xe0421e+=0x1){_0x35d778=_0x5915e2[_0xe0421e];var _0x4bf063=_[_0x9e00('0x25')](_0x35d778['interface'])?util['format'](_0x9e00('0x22'),_0x35d778['name']):_0x35d778['interface'];if(_[_0x9e00('0x40')](_0x26f4b6[_0x9e00('0x11')][_0x4bf063])){_0x26f4b6[_0x9e00('0x11')][_0x4bf063]=new Agent(_0x35d778);}else{_0x26f4b6['mergeFromDatabase'](_0x26f4b6[_0x9e00('0x11')][_0x4bf063],_0x35d778);}}}return _0x26f4b6[_0x9e00('0x11')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x41')]=function(){var _0x356e0e=this;return function(_0x1af0ad){if(_0x1af0ad){freeIsNotKeySip(_0x1af0ad,_0x356e0e['telephones']);for(var _0x58f6b5=0x0,_0x35a6b3={},_0x2ecba5={};_0x58f6b5<_0x1af0ad[_0x9e00('0x3f')];_0x58f6b5+=0x1){_0x35a6b3=_0x1af0ad[_0x58f6b5];if(_['isUndefined'](_0x356e0e[_0x9e00('0x12')][util['format'](_0x9e00('0x22'),_0x35a6b3['name'])])){_0x356e0e[_0x9e00('0x12')][util[_0x9e00('0x21')]('SIP/%s',_0x35a6b3[_0x9e00('0x23')])]=new Telephone(_0x35a6b3);}else{_0x356e0e[_0x9e00('0x3e')](_0x356e0e[_0x9e00('0x12')][util[_0x9e00('0x21')](_0x9e00('0x22'),_0x35a6b3[_0x9e00('0x23')])],_0x35a6b3);}}}return _0x356e0e[_0x9e00('0x12')];};};Realtime[_0x9e00('0x3d')]['initTrunks']=function(){var _0x40ea5b=this;return function(_0x524cd1){if(_0x524cd1){freeIsNotKeySip(_0x524cd1,_0x40ea5b['trunks']);for(var _0x521b35=0x0,_0x5d6014={},_0xd5dbb0={};_0x521b35<_0x524cd1[_0x9e00('0x3f')];_0x521b35+=0x1){_0x5d6014=_0x524cd1[_0x521b35];if(_[_0x9e00('0x40')](_0x40ea5b[_0x9e00('0x13')][util[_0x9e00('0x21')]('SIP/%s',_0x5d6014['name'])])){_0x40ea5b[_0x9e00('0x13')][util[_0x9e00('0x21')](_0x9e00('0x22'),_0x5d6014[_0x9e00('0x23')])]=new Trunk(_0x5d6014);}else{_0x40ea5b[_0x9e00('0x3e')](_0x40ea5b['trunks'][util[_0x9e00('0x21')](_0x9e00('0x22'),_0x5d6014['name'])],_0x5d6014);}}}return _0x40ea5b[_0x9e00('0x13')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x42')]=function(){var _0xaaddf9=this;return function(_0x6af111){if(_0x6af111){freeIsNotKey(_0x6af111,_0xaaddf9[_0x9e00('0x43')],'name');for(var _0x5c8ade=0x0,_0x291649={},_0x2feee1={};_0x5c8ade<_0x6af111[_0x9e00('0x3f')];_0x5c8ade+=0x1){_0x291649=_0x6af111[_0x5c8ade];if(_[_0x9e00('0x40')](_0xaaddf9[_0x9e00('0x43')][_0x291649[_0x9e00('0x23')]])){_0xaaddf9[_0x9e00('0x43')][_0x291649[_0x9e00('0x23')]]=new VoiceQueue(_0x291649);}else{_0xaaddf9[_0x9e00('0x3e')](_0xaaddf9['voiceQueues'][_0x291649[_0x9e00('0x23')]],_0x291649);}}}return _0xaaddf9[_0x9e00('0x43')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x44')]=function(){var _0x1df2b=this;return function(_0x4ca8ce){if(_0x4ca8ce){freeIsNotKey(_0x4ca8ce,_0x1df2b['triggers'],'id');for(var _0x283681=0x0,_0x3059ec={},_0x2a0954={};_0x283681<_0x4ca8ce[_0x9e00('0x3f')];_0x283681+=0x1){_0x3059ec=_0x4ca8ce[_0x283681];if(_[_0x9e00('0x40')](_0x1df2b[_0x9e00('0x14')][_0x3059ec['id']])){_0x1df2b['triggers'][_0x3059ec['id']]=new Trigger(_0x3059ec);}else{_0x1df2b[_0x9e00('0x3e')](_0x1df2b[_0x9e00('0x14')][_0x3059ec['id']],_0x3059ec);}}}return _0x1df2b[_0x9e00('0x14')];};};Realtime['prototype'][_0x9e00('0x45')]=function(){var _0x555db9=this;return function(_0x41bd72){if(_0x41bd72){freeIsNotKey(_0x41bd72,_0x555db9[_0x9e00('0x16')],'id');for(var _0x551ce1=0x0,_0x2c1f40={},_0x1ab3f3={};_0x551ce1<_0x41bd72['length'];_0x551ce1+=0x1){_0x2c1f40=_0x41bd72[_0x551ce1];if(_[_0x9e00('0x40')](_0x555db9['templates'][_0x2c1f40['id']])){_0x555db9[_0x9e00('0x16')][_0x2c1f40['id']]=new Template(_0x2c1f40);}else{_0x555db9['mergeFromDatabase'](_0x555db9[_0x9e00('0x16')][_0x2c1f40['id']],_0x2c1f40);}}}return _0x555db9[_0x9e00('0x16')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x46')]=function(){var _0x5acd59=this;return function(_0x53c018){if(_0x53c018){freeIsNotKey(_0x53c018,_0x5acd59[_0x9e00('0x19')],'id');for(var _0x5a5d5e=0x0,_0x44a8ca={},_0x256894={};_0x5a5d5e<_0x53c018[_0x9e00('0x3f')];_0x5a5d5e+=0x1){_0x44a8ca=_0x53c018[_0x5a5d5e];if(_['isUndefined'](_0x5acd59['zendeskAccounts'][_0x44a8ca['id']])){_0x5acd59[_0x9e00('0x19')][_0x44a8ca['id']]=new ZendeskAccount(_0x44a8ca);}else{_0x5acd59[_0x9e00('0x3e')](_0x5acd59['zendeskAccounts'][_0x44a8ca['id']],_0x44a8ca);}}}return _0x5acd59['zendeskAccounts'];};};Realtime['prototype'][_0x9e00('0x47')]=function(){var _0x41d9c6=this;return function(_0x320254){if(_0x320254){freeIsNotKey(_0x320254,_0x41d9c6['salesforceAccounts'],'id');for(var _0x14daa5=0x0,_0x389ccb={},_0xa961db={};_0x14daa5<_0x320254[_0x9e00('0x3f')];_0x14daa5+=0x1){_0x389ccb=_0x320254[_0x14daa5];if(_['isUndefined'](_0x41d9c6[_0x9e00('0x1a')][_0x389ccb['id']])){_0x41d9c6['salesforceAccounts'][_0x389ccb['id']]=new SalesforceAccount(_0x389ccb);}else{_0x41d9c6['mergeFromDatabase'](_0x41d9c6['salesforceAccounts'][_0x389ccb['id']],_0x389ccb);}}}return _0x41d9c6[_0x9e00('0x1a')];};};Realtime['prototype'][_0x9e00('0x48')]=function(){var _0x1f9503=this;return function(_0x4738f2){if(_0x4738f2){freeIsNotKey(_0x4738f2,_0x1f9503[_0x9e00('0x1c')],'id');for(var _0xc4795a=0x0,_0x875aeb={},_0x301ddb={};_0xc4795a<_0x4738f2[_0x9e00('0x3f')];_0xc4795a+=0x1){_0x875aeb=_0x4738f2[_0xc4795a];if(_[_0x9e00('0x40')](_0x1f9503['freshdeskAccounts'][_0x875aeb['id']])){_0x1f9503[_0x9e00('0x1c')][_0x875aeb['id']]=new FreshdeskAccount(_0x875aeb);}else{_0x1f9503[_0x9e00('0x3e')](_0x1f9503[_0x9e00('0x1c')][_0x875aeb['id']],_0x875aeb);}}}return _0x1f9503[_0x9e00('0x1c')];};};Realtime['prototype'][_0x9e00('0x49')]=function(){var _0x253230=this;return function(_0x5f296f){if(_0x5f296f){freeIsNotKey(_0x5f296f,_0x253230[_0x9e00('0x1d')],'id');for(var _0x5ecb56=0x0,_0x2310ca={},_0x44902c={};_0x5ecb56<_0x5f296f[_0x9e00('0x3f')];_0x5ecb56+=0x1){_0x2310ca=_0x5f296f[_0x5ecb56];if(_[_0x9e00('0x40')](_0x253230[_0x9e00('0x1d')][_0x2310ca['id']])){_0x253230[_0x9e00('0x1d')][_0x2310ca['id']]=new ZohoAccount(_0x2310ca);}else{_0x253230[_0x9e00('0x3e')](_0x253230[_0x9e00('0x1d')][_0x2310ca['id']],_0x2310ca);}}}return _0x253230[_0x9e00('0x1d')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x4a')]=function(){var _0x1e3218=this;return function(_0xec3b03){if(_0xec3b03){freeIsNotKey(_0xec3b03,_0x1e3218[_0x9e00('0x1e')],'id');for(var _0xfa9616=0x0,_0x5c2729={},_0x5c245e={};_0xfa9616<_0xec3b03['length'];_0xfa9616+=0x1){_0x5c2729=_0xec3b03[_0xfa9616];if(_['isUndefined'](_0x1e3218[_0x9e00('0x1e')][_0x5c2729['id']])){_0x1e3218['deskAccounts'][_0x5c2729['id']]=new DeskAccount(_0x5c2729);}else{_0x1e3218[_0x9e00('0x3e')](_0x1e3218[_0x9e00('0x1e')][_0x5c2729['id']],_0x5c2729);}}}return _0x1e3218[_0x9e00('0x1e')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x4b')]=function(){var _0x2aba4c=this;return function(_0x9eba57){if(_0x9eba57){freeIsNotKey(_0x9eba57,_0x2aba4c[_0x9e00('0x1b')],'id');for(var _0x5b9ac6=0x0,_0x15dd9b={},_0x3ae4f4={};_0x5b9ac6<_0x9eba57['length'];_0x5b9ac6+=0x1){_0x15dd9b=_0x9eba57[_0x5b9ac6];if(_['isUndefined'](_0x2aba4c['sugarcrmAccounts'][_0x15dd9b['id']])){_0x2aba4c[_0x9e00('0x1b')][_0x15dd9b['id']]=new SugarcrmAccount(_0x15dd9b);}else{_0x2aba4c[_0x9e00('0x3e')](_0x2aba4c['sugarcrmAccounts'][_0x15dd9b['id']],_0x15dd9b);}}}return _0x2aba4c[_0x9e00('0x1b')];};};Realtime[_0x9e00('0x3d')]['initVtigerAccounts']=function(){var _0x18a849=this;return function(_0x1a6c8c){if(_0x1a6c8c){freeIsNotKey(_0x1a6c8c,_0x18a849['vtigerAccounts'],'id');for(var _0x34e00d=0x0,_0x5d5068={},_0x1412c8={};_0x34e00d<_0x1a6c8c['length'];_0x34e00d+=0x1){_0x5d5068=_0x1a6c8c[_0x34e00d];if(_[_0x9e00('0x40')](_0x18a849[_0x9e00('0x4c')][_0x5d5068['id']])){_0x18a849[_0x9e00('0x4c')][_0x5d5068['id']]=new VtigerAccount(_0x5d5068);}else{_0x18a849[_0x9e00('0x3e')](_0x18a849[_0x9e00('0x4c')][_0x5d5068['id']],_0x5d5068);}}}return _0x18a849[_0x9e00('0x4c')];};};Realtime[_0x9e00('0x3d')]['initServicenowAccounts']=function(){var _0x3329b2=this;return function(_0x5b4494){if(_0x5b4494){freeIsNotKey(_0x5b4494,_0x3329b2[_0x9e00('0x4d')],'id');for(var _0x273de8=0x0,_0x5aec03={},_0x53c434={};_0x273de8<_0x5b4494[_0x9e00('0x3f')];_0x273de8+=0x1){_0x5aec03=_0x5b4494[_0x273de8];if(_['isUndefined'](_0x3329b2[_0x9e00('0x4d')][_0x5aec03['id']])){_0x3329b2[_0x9e00('0x4d')][_0x5aec03['id']]=new ServicenowAccount(_0x5aec03);}else{_0x3329b2[_0x9e00('0x3e')](_0x3329b2[_0x9e00('0x4d')][_0x5aec03['id']],_0x5aec03);}}}return _0x3329b2['servicenowAccounts'];};};Realtime[_0x9e00('0x3d')]['initDynamics365Accounts']=function(){var _0x10b5ea=this;return function(_0x54aef9){if(_0x54aef9){freeIsNotKey(_0x54aef9,_0x10b5ea[_0x9e00('0x1f')],'id');for(var _0x5f5bb9=0x0,_0x47fad7={},_0x2771e6={};_0x5f5bb9<_0x54aef9[_0x9e00('0x3f')];_0x5f5bb9+=0x1){_0x47fad7=_0x54aef9[_0x5f5bb9];if(_[_0x9e00('0x40')](_0x10b5ea[_0x9e00('0x1f')][_0x47fad7['id']])){_0x10b5ea[_0x9e00('0x1f')][_0x47fad7['id']]=new Dynamics365Account(_0x47fad7);}else{_0x10b5ea['mergeFromDatabase'](_0x10b5ea[_0x9e00('0x1f')][_0x47fad7['id']],_0x47fad7);}}}return _0x10b5ea[_0x9e00('0x1f')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x674851=this;return function(_0x3eeada){for(var _0x4c812e=0x0;_0x4c812e<_0x3eeada['length'];_0x4c812e+=0x1){_[_0x9e00('0x4e')](_0x674851[_0x9e00('0x43')][_0x3eeada[_0x4c812e][_0x9e00('0x23')]],_0x3eeada[_0x4c812e]);}return _0x674851[_0x9e00('0x43')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x4f')]=function(){var _0x11cb14=this;return function(_0x31de0c){clearVoiceQueues(_0x11cb14[_0x9e00('0x43')]);if(_0x31de0c){_0x31de0c=_['groupBy'](_0x31de0c,_0x9e00('0x50'));for(var _0xe9c3f4 in _0x31de0c){if(_0x31de0c[_0x9e00('0x20')](_0xe9c3f4)){var _0xc1f7f2={};for(var _0x5cc264=0x0;_0x5cc264<_0x31de0c[_0xe9c3f4][_0x9e00('0x3f')];_0x5cc264+=0x1){var _0x41536a=_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x51')];if(_0x11cb14[_0x9e00('0x43')][_0x41536a]){if(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x52')]){_0x11cb14['voiceQueues'][_0x41536a][_0x9e00('0x2f')]+=0x1;}if(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x53')]){_0x11cb14['voiceQueues'][_0x41536a][_0x9e00('0x30')]+=0x1;}_0x11cb14[_0x9e00('0x43')][_0x41536a]['sumHoldTime']+=moment(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x54')])[_0x9e00('0x55')](moment(_0x31de0c[_0xe9c3f4][_0x5cc264]['queuecallerjoinAt']),_0x9e00('0x56'))||0x0;if(_0x5cc264===_0x31de0c[_0xe9c3f4]['length']-0x1){_0x11cb14[_0x9e00('0x43')][_0x41536a][_0x9e00('0x2a')]+=moment(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x57')]||_0x31de0c[_0xe9c3f4][_0x5cc264]['queuecallerabandonAt']||_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x58')])[_0x9e00('0x55')](moment(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x59')]),_0x9e00('0x56'))||0x0;_0x11cb14[_0x9e00('0x43')][_0x41536a][_0x9e00('0x27')]+=0x1;if(_0x31de0c[_0xe9c3f4][_0x5cc264]['queuecallercomplete']){_0x11cb14[_0x9e00('0x43')][_0x41536a][_0x9e00('0x28')]+=0x1;_0x11cb14[_0x9e00('0x43')][_0x41536a][_0x9e00('0x2b')]+=moment(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x57')])[_0x9e00('0x55')](moment(_0x31de0c[_0xe9c3f4][_0x5cc264][_0x9e00('0x54')]),_0x9e00('0x56'))||0x0;}}else{_0x11cb14['voiceQueues'][_0x41536a]['sumDuration']+=_0x11cb14[_0x9e00('0x43')][_0x41536a][_0x9e00('0x29')]||0x0;}}}}}}return _0x11cb14[_0x9e00('0x43')];};};Realtime['prototype'][_0x9e00('0x5a')]=function(){var _0x235924=this;return function(_0x534d7b){clearVoiceCallReports(_0x235924[_0x9e00('0x5b')]);if(_0x534d7b){for(var _0x20f9a7=0x0;_0x20f9a7<_0x534d7b[_0x9e00('0x3f')];_0x20f9a7+=0x1){_0x235924['outbound'][_0x9e00('0x27')]+=0x1;_0x235924[_0x9e00('0x5b')][_0x9e00('0x2a')]+=_0x534d7b[_0x20f9a7][_0x9e00('0x5c')];if(_0x534d7b[_0x20f9a7]['disposition']===_0x9e00('0x5d')){_0x235924[_0x9e00('0x5b')][_0x9e00('0x28')]+=0x1;_0x235924['outbound'][_0x9e00('0x29')]+=_0x534d7b[_0x20f9a7]['duration']-_0x534d7b[_0x20f9a7]['billableseconds']||0x0;_0x235924[_0x9e00('0x5b')][_0x9e00('0x2b')]+=_0x534d7b[_0x20f9a7][_0x9e00('0x5e')];}}}return _0x235924[_0x9e00('0x5b')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x5f')]=function(){var _0x44836f=this;return function(_0x19ee47){if(_0x19ee47){freeIsNotKey(_0x19ee47,_0x44836f[_0x9e00('0x15')],_0x9e00('0x23'));for(var _0x55e7e1=0x0,_0x433d92={};_0x55e7e1<_0x19ee47['length'];_0x55e7e1+=0x1){_0x433d92=_0x19ee47[_0x55e7e1];if(_[_0x9e00('0x40')](_0x44836f[_0x9e00('0x15')][_0x433d92[_0x9e00('0x23')]])){_0x44836f['campaigns'][_0x433d92[_0x9e00('0x23')]]=new Campaign(_0x433d92);}else{_0x44836f['mergeFromDatabase'](_0x44836f[_0x9e00('0x15')][_0x433d92[_0x9e00('0x23')]],_0x433d92);}}}return _0x44836f[_0x9e00('0x15')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x60')]=function(){var _0x3510a2=this;return function(_0x30e75f){if(_0x30e75f){freeIsNotKey(_0x30e75f,_0x3510a2[_0x9e00('0x17')],'id');for(var _0x32a4c6=0x0,_0x19b3f3={};_0x32a4c6<_0x30e75f[_0x9e00('0x3f')];_0x32a4c6+=0x1){_0x19b3f3=_0x30e75f[_0x32a4c6];if(_[_0x9e00('0x40')](_0x3510a2['voiceExtensions'][_0x19b3f3['id']])){_0x3510a2[_0x9e00('0x17')][_0x19b3f3['id']]=new VoiceExtension(_0x19b3f3);}else{_0x3510a2[_0x9e00('0x3e')](_0x3510a2[_0x9e00('0x17')][_0x19b3f3['id']],_0x19b3f3);}}}return _0x3510a2[_0x9e00('0x17')];};};Realtime[_0x9e00('0x3d')][_0x9e00('0x61')]=function(){var _0x464a79=this;return function(_0x81e43c){clearCampaigns(_0x464a79[_0x9e00('0x15')]);for(var _0x38105c=0x0;_0x38105c<_0x81e43c[_0x9e00('0x3f')];_0x38105c+=0x1){_[_0x9e00('0x4e')](_0x464a79[_0x9e00('0x15')][_0x81e43c[_0x38105c][_0x9e00('0x23')]],_0x81e43c[_0x38105c]);}return _0x464a79[_0x9e00('0x15')];};};Realtime['prototype'][_0x9e00('0x62')]=function(){var _0x5eb2d0=this;return function(_0x4caa33){if(_0x4caa33){freeIsNotKey(_0x4caa33,_0x5eb2d0[_0x9e00('0x63')],'id');for(var _0x280ff3=0x0,_0x507370={},_0x1b12a9={};_0x280ff3<_0x4caa33[_0x9e00('0x3f')];_0x280ff3+=0x1){_0x507370=_0x4caa33[_0x280ff3];if(_[_0x9e00('0x40')](_0x5eb2d0[_0x9e00('0x63')][_0x507370['id']])){_0x5eb2d0[_0x9e00('0x63')][_0x507370['id']]=new FaxAccount(_0x507370);}else{_0x5eb2d0[_0x9e00('0x3e')](_0x5eb2d0[_0x9e00('0x63')][_0x507370['id']],_0x507370);}}}return _0x5eb2d0[_0x9e00('0x63')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb09d=['zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','hasOwnProperty','mapKeys','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTrunks','initTriggers','triggers','initTemplates','templates','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallerjoinAt','seconds','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts'];(function(_0x15c818,_0x22bc5a){var _0x26c610=function(_0x9c22ba){while(--_0x9c22ba){_0x15c818['push'](_0x15c818['shift']());}};_0x26c610(++_0x22bc5a);}(_0xb09d,0x171));var _0xdb09=function(_0xd3cd9b,_0x49baea){_0xd3cd9b=_0xd3cd9b-0x0;var _0x113c2b=_0xb09d[_0xd3cd9b];return _0x113c2b;};'use strict';var BPromise=require('bluebird');var util=require(_0xdb09('0x0'));var _=require(_0xdb09('0x1'));var moment=require(_0xdb09('0x2'));var Agent=require(_0xdb09('0x3'));var Telephone=require(_0xdb09('0x4'));var Trunk=require(_0xdb09('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xdb09('0x6'));var Template=require(_0xdb09('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xdb09('0x8'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xdb09('0x9'));var DeskAccount=require(_0xdb09('0xa'));var VtigerAccount=require(_0xdb09('0xb'));var ServicenowAccount=require(_0xdb09('0xc'));var Dynamics365Account=require(_0xdb09('0xd'));var FaxAccount=require(_0xdb09('0xe'));var Realtime=function(){this[_0xdb09('0xf')]={};this[_0xdb09('0x10')]={};this[_0xdb09('0x11')]={};this[_0xdb09('0x12')]={};this['triggers']={};this[_0xdb09('0x13')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xdb09('0x14')]={};this[_0xdb09('0x15')]={};this[_0xdb09('0x16')]={};this[_0xdb09('0x17')]={};this['timers']={};this[_0xdb09('0x18')]={};this[_0xdb09('0x19')]={};this[_0xdb09('0x1a')]={};this['freshdeskAccounts']={};this[_0xdb09('0x1b')]={};this['deskAccounts']={};this[_0xdb09('0x1c')]={};this[_0xdb09('0x1d')]={};this[_0xdb09('0x1e')]={};this['faxAccounts']={};};function freeIsNotKey(_0x45d5cb,_0x62105b,_0x1c7cf2){var _0x127745=_['mapKeys'](_0x45d5cb,function(_0x1fdc26,_0x1e6818){return _0x1fdc26[_0x1c7cf2];});for(var _0x51906b in _0x62105b){if(_0x62105b[_0xdb09('0x1f')](_0x51906b)){if(!_0x127745[_0x51906b]){delete _0x62105b[_0x51906b];}}}}function freeIsNotKeySip(_0x2a6153,_0x2657ff){var _0x413bf4=_[_0xdb09('0x20')](_0x2a6153,function(_0x3598ef,_0x56d6ca){return util[_0xdb09('0x21')](_0xdb09('0x22'),_0x3598ef[_0xdb09('0x23')]);});for(var _0x15bc9a in _0x2657ff){if(_0x2657ff['hasOwnProperty'](_0x15bc9a)){if(!_0x413bf4[_0x15bc9a]){delete _0x2657ff[_0x15bc9a];}}}}function freeIsNotKeyAgent(_0x3a8912,_0x474f1){var _0x36bc5d=_[_0xdb09('0x20')](_0x3a8912,function(_0x2fe759,_0x3c3dce){var _0x2b2117=_[_0xdb09('0x24')](_0x2fe759['interface'])?util['format'](_0xdb09('0x22'),_0x2fe759[_0xdb09('0x23')]):_0x2fe759[_0xdb09('0x25')];return _0x2b2117;});for(var _0x581a91 in _0x474f1){if(_0x474f1['hasOwnProperty'](_0x581a91)){if(!_0x36bc5d[_0x581a91]){delete _0x474f1[_0x581a91];}}}}function clearVoiceCallReports(_0x2c76e3){_0x2c76e3[_0xdb09('0x26')]=0x0;_0x2c76e3[_0xdb09('0x27')]=0x0;_0x2c76e3[_0xdb09('0x28')]=0x0;_0x2c76e3[_0xdb09('0x29')]=0x0;_0x2c76e3[_0xdb09('0x2a')]=0x0;}function clearCampaigns(_0x1b35e9){if(!_[_0xdb09('0x2b')](_0x1b35e9)){for(var _0x11b8b5 in _0x1b35e9){if(_0x1b35e9['hasOwnProperty'](_0x11b8b5)){_0x1b35e9[_0x11b8b5]['ivrTotalCallsDays']=0x0;_0x1b35e9[_0x11b8b5][_0xdb09('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x42726d){if(!_[_0xdb09('0x2b')](_0x42726d)){for(var _0x58b6ff in _0x42726d){if(_0x42726d[_0xdb09('0x1f')](_0x58b6ff)){_0x42726d[_0x58b6ff]['total']=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x27')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x2d')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x2e')]=0x0;_0x42726d[_0x58b6ff]['sumHoldTime']=0x0;_0x42726d[_0x58b6ff]['sumDuration']=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x2a')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x2f')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x30')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x31')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x32')]=0x0;_0x42726d[_0x58b6ff]['outboundNoSuchCallsDay']=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x33')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x34')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x35')]=0x0;_0x42726d[_0x58b6ff]['outboundBlacklistCallsDay']=0x0;_0x42726d[_0x58b6ff]['outboundOriginateFailureCallsDay']=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x36')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x37')]=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x2f')]=0x0;_0x42726d[_0x58b6ff]['outboundAnswerCallsDay']=0x0;_0x42726d[_0x58b6ff][_0xdb09('0x38')]=!![];}}}}Realtime[_0xdb09('0x39')]['mergeFromDatabase']=function(_0x480581,_0x5c92b6){for(var _0x4f451a in _0x5c92b6){if(_0x480581[_0xdb09('0x1f')](_0x4f451a)){_0x480581[_0x4f451a]=_0x5c92b6[_0x4f451a];}}};Realtime[_0xdb09('0x39')][_0xdb09('0x3a')]=function(){var _0x2f2547=this;return function(_0x4e3399){if(_0x4e3399){freeIsNotKeyAgent(_0x4e3399,_0x2f2547[_0xdb09('0xf')]);for(var _0x66b75=0x0,_0x4eda2e={},_0xe82fbd={};_0x66b75<_0x4e3399[_0xdb09('0x3b')];_0x66b75+=0x1){_0x4eda2e=_0x4e3399[_0x66b75];var _0x2e84b8=_[_0xdb09('0x24')](_0x4eda2e[_0xdb09('0x25')])?util['format'](_0xdb09('0x22'),_0x4eda2e[_0xdb09('0x23')]):_0x4eda2e[_0xdb09('0x25')];if(_[_0xdb09('0x3c')](_0x2f2547[_0xdb09('0xf')][_0x2e84b8])){_0x2f2547[_0xdb09('0xf')][_0x2e84b8]=new Agent(_0x4eda2e);}else{_0x2f2547[_0xdb09('0x3d')](_0x2f2547[_0xdb09('0xf')][_0x2e84b8],_0x4eda2e);}}}return _0x2f2547['agents'];};};Realtime[_0xdb09('0x39')]['initTelephones']=function(){var _0xaff14f=this;return function(_0x2ca650){if(_0x2ca650){freeIsNotKeySip(_0x2ca650,_0xaff14f['telephones']);for(var _0x585060=0x0,_0x116910={},_0x54bf4a={};_0x585060<_0x2ca650['length'];_0x585060+=0x1){_0x116910=_0x2ca650[_0x585060];if(_['isUndefined'](_0xaff14f[_0xdb09('0x10')][util[_0xdb09('0x21')]('SIP/%s',_0x116910[_0xdb09('0x23')])])){_0xaff14f[_0xdb09('0x10')][util[_0xdb09('0x21')](_0xdb09('0x22'),_0x116910[_0xdb09('0x23')])]=new Telephone(_0x116910);}else{_0xaff14f[_0xdb09('0x3d')](_0xaff14f[_0xdb09('0x10')][util[_0xdb09('0x21')]('SIP/%s',_0x116910['name'])],_0x116910);}}}return _0xaff14f[_0xdb09('0x10')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x3e')]=function(){var _0x5e4954=this;return function(_0x447bb5){if(_0x447bb5){freeIsNotKeySip(_0x447bb5,_0x5e4954[_0xdb09('0x11')]);for(var _0x3f5f7=0x0,_0x9341e={},_0x49f429={};_0x3f5f7<_0x447bb5['length'];_0x3f5f7+=0x1){_0x9341e=_0x447bb5[_0x3f5f7];if(_[_0xdb09('0x3c')](_0x5e4954[_0xdb09('0x11')][util[_0xdb09('0x21')](_0xdb09('0x22'),_0x9341e[_0xdb09('0x23')])])){_0x5e4954[_0xdb09('0x11')][util['format'](_0xdb09('0x22'),_0x9341e['name'])]=new Trunk(_0x9341e);}else{_0x5e4954['mergeFromDatabase'](_0x5e4954['trunks'][util[_0xdb09('0x21')](_0xdb09('0x22'),_0x9341e['name'])],_0x9341e);}}}return _0x5e4954[_0xdb09('0x11')];};};Realtime[_0xdb09('0x39')]['initVoiceQueues']=function(){var _0x18eea4=this;return function(_0x30518a){if(_0x30518a){freeIsNotKey(_0x30518a,_0x18eea4[_0xdb09('0x12')],_0xdb09('0x23'));for(var _0x20674d=0x0,_0x53abc9={},_0xbf5273={};_0x20674d<_0x30518a[_0xdb09('0x3b')];_0x20674d+=0x1){_0x53abc9=_0x30518a[_0x20674d];if(_[_0xdb09('0x3c')](_0x18eea4['voiceQueues'][_0x53abc9['name']])){_0x18eea4[_0xdb09('0x12')][_0x53abc9[_0xdb09('0x23')]]=new VoiceQueue(_0x53abc9);}else{_0x18eea4[_0xdb09('0x3d')](_0x18eea4[_0xdb09('0x12')][_0x53abc9[_0xdb09('0x23')]],_0x53abc9);}}}return _0x18eea4['voiceQueues'];};};Realtime[_0xdb09('0x39')][_0xdb09('0x3f')]=function(){var _0x591863=this;return function(_0x559eaf){if(_0x559eaf){freeIsNotKey(_0x559eaf,_0x591863[_0xdb09('0x40')],'id');for(var _0x382cac=0x0,_0x446abc={},_0x526a92={};_0x382cac<_0x559eaf[_0xdb09('0x3b')];_0x382cac+=0x1){_0x446abc=_0x559eaf[_0x382cac];if(_[_0xdb09('0x3c')](_0x591863[_0xdb09('0x40')][_0x446abc['id']])){_0x591863[_0xdb09('0x40')][_0x446abc['id']]=new Trigger(_0x446abc);}else{_0x591863[_0xdb09('0x3d')](_0x591863['triggers'][_0x446abc['id']],_0x446abc);}}}return _0x591863[_0xdb09('0x40')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x41')]=function(){var _0x2566ca=this;return function(_0x38c572){if(_0x38c572){freeIsNotKey(_0x38c572,_0x2566ca[_0xdb09('0x42')],'id');for(var _0x304e7f=0x0,_0x1c2155={},_0x4eb060={};_0x304e7f<_0x38c572[_0xdb09('0x3b')];_0x304e7f+=0x1){_0x1c2155=_0x38c572[_0x304e7f];if(_['isUndefined'](_0x2566ca[_0xdb09('0x42')][_0x1c2155['id']])){_0x2566ca[_0xdb09('0x42')][_0x1c2155['id']]=new Template(_0x1c2155);}else{_0x2566ca[_0xdb09('0x3d')](_0x2566ca[_0xdb09('0x42')][_0x1c2155['id']],_0x1c2155);}}}return _0x2566ca['templates'];};};Realtime[_0xdb09('0x39')]['initZendeskAccounts']=function(){var _0x7e4a6b=this;return function(_0x250c8e){if(_0x250c8e){freeIsNotKey(_0x250c8e,_0x7e4a6b[_0xdb09('0x18')],'id');for(var _0x37ef11=0x0,_0x4033dd={},_0x5eb83e={};_0x37ef11<_0x250c8e[_0xdb09('0x3b')];_0x37ef11+=0x1){_0x4033dd=_0x250c8e[_0x37ef11];if(_[_0xdb09('0x3c')](_0x7e4a6b['zendeskAccounts'][_0x4033dd['id']])){_0x7e4a6b['zendeskAccounts'][_0x4033dd['id']]=new ZendeskAccount(_0x4033dd);}else{_0x7e4a6b[_0xdb09('0x3d')](_0x7e4a6b['zendeskAccounts'][_0x4033dd['id']],_0x4033dd);}}}return _0x7e4a6b[_0xdb09('0x18')];};};Realtime['prototype'][_0xdb09('0x43')]=function(){var _0x433c03=this;return function(_0x54838f){if(_0x54838f){freeIsNotKey(_0x54838f,_0x433c03[_0xdb09('0x19')],'id');for(var _0x48a60f=0x0,_0x221406={},_0x1e5d33={};_0x48a60f<_0x54838f['length'];_0x48a60f+=0x1){_0x221406=_0x54838f[_0x48a60f];if(_[_0xdb09('0x3c')](_0x433c03[_0xdb09('0x19')][_0x221406['id']])){_0x433c03[_0xdb09('0x19')][_0x221406['id']]=new SalesforceAccount(_0x221406);}else{_0x433c03[_0xdb09('0x3d')](_0x433c03[_0xdb09('0x19')][_0x221406['id']],_0x221406);}}}return _0x433c03['salesforceAccounts'];};};Realtime[_0xdb09('0x39')]['initFreshdeskAccounts']=function(){var _0x1f56e0=this;return function(_0x16fabd){if(_0x16fabd){freeIsNotKey(_0x16fabd,_0x1f56e0[_0xdb09('0x44')],'id');for(var _0x51f917=0x0,_0x3069b5={},_0x40b924={};_0x51f917<_0x16fabd[_0xdb09('0x3b')];_0x51f917+=0x1){_0x3069b5=_0x16fabd[_0x51f917];if(_[_0xdb09('0x3c')](_0x1f56e0['freshdeskAccounts'][_0x3069b5['id']])){_0x1f56e0['freshdeskAccounts'][_0x3069b5['id']]=new FreshdeskAccount(_0x3069b5);}else{_0x1f56e0['mergeFromDatabase'](_0x1f56e0['freshdeskAccounts'][_0x3069b5['id']],_0x3069b5);}}}return _0x1f56e0[_0xdb09('0x44')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x45')]=function(){var _0x113ab8=this;return function(_0x4f2d90){if(_0x4f2d90){freeIsNotKey(_0x4f2d90,_0x113ab8[_0xdb09('0x1b')],'id');for(var _0x523501=0x0,_0x5ccaca={},_0x48939f={};_0x523501<_0x4f2d90[_0xdb09('0x3b')];_0x523501+=0x1){_0x5ccaca=_0x4f2d90[_0x523501];if(_[_0xdb09('0x3c')](_0x113ab8[_0xdb09('0x1b')][_0x5ccaca['id']])){_0x113ab8[_0xdb09('0x1b')][_0x5ccaca['id']]=new ZohoAccount(_0x5ccaca);}else{_0x113ab8['mergeFromDatabase'](_0x113ab8[_0xdb09('0x1b')][_0x5ccaca['id']],_0x5ccaca);}}}return _0x113ab8[_0xdb09('0x1b')];};};Realtime[_0xdb09('0x39')]['initDeskAccounts']=function(){var _0x489ae8=this;return function(_0x261661){if(_0x261661){freeIsNotKey(_0x261661,_0x489ae8[_0xdb09('0x46')],'id');for(var _0x1a8a2e=0x0,_0x454fff={},_0x393be1={};_0x1a8a2e<_0x261661[_0xdb09('0x3b')];_0x1a8a2e+=0x1){_0x454fff=_0x261661[_0x1a8a2e];if(_[_0xdb09('0x3c')](_0x489ae8[_0xdb09('0x46')][_0x454fff['id']])){_0x489ae8[_0xdb09('0x46')][_0x454fff['id']]=new DeskAccount(_0x454fff);}else{_0x489ae8[_0xdb09('0x3d')](_0x489ae8['deskAccounts'][_0x454fff['id']],_0x454fff);}}}return _0x489ae8[_0xdb09('0x46')];};};Realtime[_0xdb09('0x39')]['initSugarcrmAccounts']=function(){var _0x4027b6=this;return function(_0x33fcf0){if(_0x33fcf0){freeIsNotKey(_0x33fcf0,_0x4027b6[_0xdb09('0x1a')],'id');for(var _0x9fe6fe=0x0,_0x402640={},_0x8ee8d5={};_0x9fe6fe<_0x33fcf0[_0xdb09('0x3b')];_0x9fe6fe+=0x1){_0x402640=_0x33fcf0[_0x9fe6fe];if(_['isUndefined'](_0x4027b6[_0xdb09('0x1a')][_0x402640['id']])){_0x4027b6[_0xdb09('0x1a')][_0x402640['id']]=new SugarcrmAccount(_0x402640);}else{_0x4027b6[_0xdb09('0x3d')](_0x4027b6[_0xdb09('0x1a')][_0x402640['id']],_0x402640);}}}return _0x4027b6['sugarcrmAccounts'];};};Realtime[_0xdb09('0x39')][_0xdb09('0x47')]=function(){var _0x31a579=this;return function(_0x4f0244){if(_0x4f0244){freeIsNotKey(_0x4f0244,_0x31a579['vtigerAccounts'],'id');for(var _0x112844=0x0,_0x4ee80b={},_0x46e394={};_0x112844<_0x4f0244[_0xdb09('0x3b')];_0x112844+=0x1){_0x4ee80b=_0x4f0244[_0x112844];if(_['isUndefined'](_0x31a579['vtigerAccounts'][_0x4ee80b['id']])){_0x31a579[_0xdb09('0x1c')][_0x4ee80b['id']]=new VtigerAccount(_0x4ee80b);}else{_0x31a579[_0xdb09('0x3d')](_0x31a579[_0xdb09('0x1c')][_0x4ee80b['id']],_0x4ee80b);}}}return _0x31a579[_0xdb09('0x1c')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x48')]=function(){var _0x424071=this;return function(_0x19ee7a){if(_0x19ee7a){freeIsNotKey(_0x19ee7a,_0x424071['servicenowAccounts'],'id');for(var _0x1a14e9=0x0,_0x17d046={},_0x3b0d53={};_0x1a14e9<_0x19ee7a['length'];_0x1a14e9+=0x1){_0x17d046=_0x19ee7a[_0x1a14e9];if(_['isUndefined'](_0x424071[_0xdb09('0x1d')][_0x17d046['id']])){_0x424071[_0xdb09('0x1d')][_0x17d046['id']]=new ServicenowAccount(_0x17d046);}else{_0x424071['mergeFromDatabase'](_0x424071['servicenowAccounts'][_0x17d046['id']],_0x17d046);}}}return _0x424071[_0xdb09('0x1d')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x49')]=function(){var _0x76b1eb=this;return function(_0x41d303){if(_0x41d303){freeIsNotKey(_0x41d303,_0x76b1eb['dynamics365Accounts'],'id');for(var _0x138226=0x0,_0x4ff451={},_0x4522fc={};_0x138226<_0x41d303['length'];_0x138226+=0x1){_0x4ff451=_0x41d303[_0x138226];if(_[_0xdb09('0x3c')](_0x76b1eb[_0xdb09('0x1e')][_0x4ff451['id']])){_0x76b1eb[_0xdb09('0x1e')][_0x4ff451['id']]=new Dynamics365Account(_0x4ff451);}else{_0x76b1eb['mergeFromDatabase'](_0x76b1eb[_0xdb09('0x1e')][_0x4ff451['id']],_0x4ff451);}}}return _0x76b1eb[_0xdb09('0x1e')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x4a')]=function(){var _0x178083=this;return function(_0x86e75f){for(var _0xa2de1d=0x0;_0xa2de1d<_0x86e75f['length'];_0xa2de1d+=0x1){_[_0xdb09('0x4b')](_0x178083[_0xdb09('0x12')][_0x86e75f[_0xa2de1d][_0xdb09('0x23')]],_0x86e75f[_0xa2de1d]);}return _0x178083[_0xdb09('0x12')];};};Realtime[_0xdb09('0x39')]['initVoiceQueueReports']=function(){var _0x3929e7=this;return function(_0xd4245d){clearVoiceQueues(_0x3929e7[_0xdb09('0x12')]);if(_0xd4245d){_0xd4245d=_[_0xdb09('0x4c')](_0xd4245d,_0xdb09('0x4d'));for(var _0x5ad65d in _0xd4245d){if(_0xd4245d[_0xdb09('0x1f')](_0x5ad65d)){var _0xb18eaa={};for(var _0x3881e9=0x0;_0x3881e9<_0xd4245d[_0x5ad65d][_0xdb09('0x3b')];_0x3881e9+=0x1){var _0x4d083f=_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x4e')];if(_0x3929e7[_0xdb09('0x12')][_0x4d083f]){if(_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x4f')]){_0x3929e7[_0xdb09('0x12')][_0x4d083f]['unmanaged']+=0x1;}if(_0xd4245d[_0x5ad65d][_0x3881e9]['queuecallerabandon']){_0x3929e7[_0xdb09('0x12')][_0x4d083f]['abandoned']+=0x1;}_0x3929e7[_0xdb09('0x12')][_0x4d083f]['sumHoldTime']+=moment(_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x50')])['diff'](moment(_0xd4245d[_0x5ad65d][_0x3881e9]['queuecallerjoinAt']),'seconds')||0x0;if(_0x3881e9===_0xd4245d[_0x5ad65d][_0xdb09('0x3b')]-0x1){_0x3929e7[_0xdb09('0x12')][_0x4d083f][_0xdb09('0x29')]+=moment(_0xd4245d[_0x5ad65d][_0x3881e9]['queuecallercompleteAt']||_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x51')]||_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x52')])[_0xdb09('0x53')](moment(_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x54')]),_0xdb09('0x55'))||0x0;_0x3929e7[_0xdb09('0x12')][_0x4d083f][_0xdb09('0x26')]+=0x1;if(_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x56')]){_0x3929e7[_0xdb09('0x12')][_0x4d083f]['answered']+=0x1;_0x3929e7[_0xdb09('0x12')][_0x4d083f]['sumBillable']+=moment(_0xd4245d[_0x5ad65d][_0x3881e9][_0xdb09('0x57')])['diff'](moment(_0xd4245d[_0x5ad65d][_0x3881e9]['queuecallerleaveAt']),_0xdb09('0x55'))||0x0;}}else{_0x3929e7['voiceQueues'][_0x4d083f][_0xdb09('0x29')]+=_0x3929e7[_0xdb09('0x12')][_0x4d083f][_0xdb09('0x28')]||0x0;}}}}}}return _0x3929e7[_0xdb09('0x12')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x58')]=function(){var _0x48eabe=this;return function(_0x559b06){clearVoiceCallReports(_0x48eabe[_0xdb09('0x59')]);if(_0x559b06){for(var _0xf07aee=0x0;_0xf07aee<_0x559b06[_0xdb09('0x3b')];_0xf07aee+=0x1){_0x48eabe[_0xdb09('0x59')][_0xdb09('0x26')]+=0x1;_0x48eabe[_0xdb09('0x59')]['sumDuration']+=_0x559b06[_0xf07aee]['duration'];if(_0x559b06[_0xf07aee][_0xdb09('0x5a')]===_0xdb09('0x5b')){_0x48eabe['outbound'][_0xdb09('0x27')]+=0x1;_0x48eabe[_0xdb09('0x59')][_0xdb09('0x28')]+=_0x559b06[_0xf07aee][_0xdb09('0x5c')]-_0x559b06[_0xf07aee][_0xdb09('0x5d')]||0x0;_0x48eabe[_0xdb09('0x59')]['sumBillable']+=_0x559b06[_0xf07aee][_0xdb09('0x5d')];}}}return _0x48eabe[_0xdb09('0x59')];};};Realtime[_0xdb09('0x39')]['initCampaigns']=function(){var _0x5be5f9=this;return function(_0x2281d7){if(_0x2281d7){freeIsNotKey(_0x2281d7,_0x5be5f9[_0xdb09('0x13')],_0xdb09('0x23'));for(var _0x112a27=0x0,_0x3caf01={};_0x112a27<_0x2281d7[_0xdb09('0x3b')];_0x112a27+=0x1){_0x3caf01=_0x2281d7[_0x112a27];if(_[_0xdb09('0x3c')](_0x5be5f9[_0xdb09('0x13')][_0x3caf01['name']])){_0x5be5f9[_0xdb09('0x13')][_0x3caf01[_0xdb09('0x23')]]=new Campaign(_0x3caf01);}else{_0x5be5f9[_0xdb09('0x3d')](_0x5be5f9[_0xdb09('0x13')][_0x3caf01[_0xdb09('0x23')]],_0x3caf01);}}}return _0x5be5f9[_0xdb09('0x13')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x5e')]=function(){var _0x31dd8d=this;return function(_0x4c3ab6){if(_0x4c3ab6){freeIsNotKey(_0x4c3ab6,_0x31dd8d[_0xdb09('0x14')],'id');for(var _0x50677c=0x0,_0x8ba525={};_0x50677c<_0x4c3ab6['length'];_0x50677c+=0x1){_0x8ba525=_0x4c3ab6[_0x50677c];if(_[_0xdb09('0x3c')](_0x31dd8d['voiceExtensions'][_0x8ba525['id']])){_0x31dd8d[_0xdb09('0x14')][_0x8ba525['id']]=new VoiceExtension(_0x8ba525);}else{_0x31dd8d['mergeFromDatabase'](_0x31dd8d[_0xdb09('0x14')][_0x8ba525['id']],_0x8ba525);}}}return _0x31dd8d[_0xdb09('0x14')];};};Realtime['prototype'][_0xdb09('0x5f')]=function(){var _0x4e3aa6=this;return function(_0x59cda0){clearCampaigns(_0x4e3aa6[_0xdb09('0x13')]);for(var _0x7800b=0x0;_0x7800b<_0x59cda0[_0xdb09('0x3b')];_0x7800b+=0x1){_[_0xdb09('0x4b')](_0x4e3aa6[_0xdb09('0x13')][_0x59cda0[_0x7800b][_0xdb09('0x23')]],_0x59cda0[_0x7800b]);}return _0x4e3aa6[_0xdb09('0x13')];};};Realtime[_0xdb09('0x39')][_0xdb09('0x60')]=function(){var _0x61a60b=this;return function(_0x44a7ff){if(_0x44a7ff){freeIsNotKey(_0x44a7ff,_0x61a60b[_0xdb09('0x61')],'id');for(var _0x31e030=0x0,_0x26f15e={},_0x532e7f={};_0x31e030<_0x44a7ff[_0xdb09('0x3b')];_0x31e030+=0x1){_0x26f15e=_0x44a7ff[_0x31e030];if(_['isUndefined'](_0x61a60b[_0xdb09('0x61')][_0x26f15e['id']])){_0x61a60b[_0xdb09('0x61')][_0x26f15e['id']]=new FaxAccount(_0x26f15e);}else{_0x61a60b[_0xdb09('0x3d')](_0x61a60b[_0xdb09('0x61')][_0x26f15e['id']],_0x26f15e);}}}return _0x61a60b[_0xdb09('0x61')];};};module[_0xdb09('0x62')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index a7a5340..736840a 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 _0x9f8d=['../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','findAgent','accountcode','name','isNil','find','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallerexit','voiceQueueReport','create','match','voiceCallReport','destination','exten','dialer','lastapplication','queue','from-voip-provider','calleridnum','channel','calleridpreview','originatecalleridnum','disposition','callerid','calleridname','monitor','length','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','startsWith','substring','indexOf','mobile','phone','blindTransfer','attendedTransfer','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport'];(function(_0x452c5f,_0x281242){var _0x281d95=function(_0x2ae9e0){while(--_0x2ae9e0){_0x452c5f['push'](_0x452c5f['shift']());}};_0x281d95(++_0x281242);}(_0x9f8d,0x10e));var _0xd9f8=function(_0x4a547b,_0x4add58){_0x4a547b=_0x4a547b-0x0;var _0xdb2390=_0x9f8d[_0x4a547b];return _0xdb2390;};'use strict';var BPromise=require(_0xd9f8('0x0'));var _=require(_0xd9f8('0x1'));var moment=require(_0xd9f8('0x2'));var util=require(_0xd9f8('0x3'));var logger=require(_0xd9f8('0x4'))(_0xd9f8('0x5'));var ami=require(_0xd9f8('0x6'));var RpcVoiceAgentReport=require(_0xd9f8('0x7'));var RpcVoiceCallReport=require(_0xd9f8('0x8'));var RpcVoiceDialReport=require(_0xd9f8('0x9'));var RpcMemberReport=require(_0xd9f8('0xa'));var RpcVoiceQueueReport=require(_0xd9f8('0xb'));var RpcVoiceRecording=require(_0xd9f8('0xc'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xd9f8('0xd'));var VoiceCallReport=require(_0xd9f8('0xe'));var VoiceAgentReport=require(_0xd9f8('0xf'));var VoiceDialReport=require(_0xd9f8('0x10'));var UserReport=require('./userReport');function Report(_0x5dec98){this[_0xd9f8('0x11')]=_0x5dec98;this[_0xd9f8('0x12')]=_0x5dec98[_0xd9f8('0x12')];this[_0xd9f8('0x13')]=_0x5dec98[_0xd9f8('0x13')];}Report[_0xd9f8('0x14')]['sync']=function(_0x818ea9){var _0x487c96=new VoiceQueueReport(this['realtime']);var _0x4b9525=new VoiceAgentReport(this[_0xd9f8('0x11')]);var _0x40bcfa=new VoiceDialReport(this[_0xd9f8('0x11')]);var _0x18fdad=new VoiceCallReport(this['realtime']);var _0x53e4b9=new UserReport(this['realtime']);};Report['prototype'][_0xd9f8('0x15')]=function(_0x2d9952){var _0x46ca8d=undefined;_0x46ca8d=_['find'](this['agents'],function(_0x3d2d53){return _0x3d2d53[_0xd9f8('0x16')]==_0x2d9952||_0x3d2d53[_0xd9f8('0x17')]==_0x2d9952;});if(_[_0xd9f8('0x18')](_0x46ca8d)){var _0xe448dd=_['find'](this[_0xd9f8('0x13')],function(_0x1616f3){return _0x1616f3[_0xd9f8('0x16')]==_0x2d9952||_0x1616f3[_0xd9f8('0x17')]==_0x2d9952;});if(_0xe448dd){_0x46ca8d=_[_0xd9f8('0x19')](this['agents'],function(_0x2ada72){return _0x2ada72['interface']==util[_0xd9f8('0x1a')](_0xd9f8('0x1b'),_0xe448dd['name']);});}}return _0x46ca8d;};Report[_0xd9f8('0x14')]['voiceQueueReport']=function(_0x1232a6){for(var _0x14b65e=0x0;_0x14b65e<_0x1232a6['length'];_0x14b65e+=0x1){var _0x2424e8=this[_0xd9f8('0x15')](_0x1232a6[_0x14b65e][_0xd9f8('0x1c')]);if(_0x2424e8){_0x1232a6[_0x14b65e][_0xd9f8('0x16')]=_0x2424e8[_0xd9f8('0x16')];_0x1232a6[_0x14b65e][_0xd9f8('0x1d')]=!![];_0x1232a6[_0x14b65e][_0xd9f8('0x1e')]=_0x2424e8[_0xd9f8('0x17')];_0x1232a6[_0x14b65e][_0xd9f8('0x1f')]=_[_0xd9f8('0x18')](_0x2424e8[_0xd9f8('0x1f')])?util[_0xd9f8('0x1a')](_0xd9f8('0x1b'),_0x2424e8[_0xd9f8('0x17')]):_0x2424e8[_0xd9f8('0x1f')];if(_0x1232a6[_0x14b65e][_0xd9f8('0x20')]){_0x1232a6[_0x14b65e]['queuecallercompleteAt']=moment()[_0xd9f8('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1232a6[_0x14b65e][_0xd9f8('0x21')]){_0x1232a6[_0x14b65e]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xd9f8('0x22')](_0x1232a6[_0x14b65e]);}RpcVoiceQueueReport[_0xd9f8('0x23')](_0x1232a6[_0x14b65e]);}};function extractCalleridNumber(_0x53236d){var _0x1802e7=_0x53236d[_0xd9f8('0x24')](/<(.*?)>/);return _0x1802e7?_0x1802e7[0x1]:_0x53236d;}Report[_0xd9f8('0x14')][_0xd9f8('0x25')]=function(_0xb47533){_0xb47533[_0xd9f8('0x26')]=_0xb47533[_0xd9f8('0x26')]||_0xb47533[_0xd9f8('0x27')];if(_0xb47533['type']==_0xd9f8('0x28')){_0xb47533[_0xd9f8('0x29')]=_0xd9f8('0x2a');_0xb47533['lastdata']=_0xb47533[_0xd9f8('0x2a')];if(_0xb47533['context']==_0xd9f8('0x2b')){_0xb47533[_0xd9f8('0x16')]='';_0xb47533[_0xd9f8('0x26')]=extractCalleridNumber(_0xb47533['callerid']);}else if(_0xb47533['context']=='from-sip'){if(_0xb47533[_0xd9f8('0x26')]=='xcally-motion-preview'){_0xb47533[_0xd9f8('0x26')]=extractCalleridNumber(_0xb47533['calleridpreview']);_0xb47533[_0xd9f8('0x2c')]=_0xb47533['originatecalleridnum'];_0xb47533['destinationchannel']=[_0xb47533[_0xd9f8('0x2d')],_0xb47533[_0xd9f8('0x2d')]=_0xb47533['destinationchannel']][0x0];_0xb47533['callerid']=_0xb47533[_0xd9f8('0x2e')];}else{_0xb47533['destination']=_0xb47533[_0xd9f8('0x2c')];_0xb47533[_0xd9f8('0x2c')]=_0xb47533[_0xd9f8('0x2f')];if(_0xb47533[_0xd9f8('0x30')]=='ANSWERED'){_0xb47533['accountcode']=_0xb47533[_0xd9f8('0x1c')];}else{_0xb47533[_0xd9f8('0x16')]='';}}}}else{_0xb47533[_0xd9f8('0x31')]=util['format']('\x22%s\x22\x20<%s>',_0xb47533[_0xd9f8('0x32')],_0xb47533[_0xd9f8('0x2c')]);}RpcVoiceCallReport['create'](_0xb47533);if(_0xb47533[_0xd9f8('0x33')]){for(var _0x39532f=0x0;_0x39532f<_0xb47533['monitors'][_0xd9f8('0x34')];_0x39532f+=0x1){_0xb47533[_0xd9f8('0x35')]=_0xb47533[_0xd9f8('0x36')][_0x39532f][_0xd9f8('0x37')];_0xb47533[_0xd9f8('0x38')]=_0xb47533[_0xd9f8('0x36')][_0x39532f][_0xd9f8('0x38')];if(_0xb47533[_0xd9f8('0x27')]==_0xd9f8('0x39')){_0xb47533[_0xd9f8('0x2c')]=_0xb47533[_0xd9f8('0x1c')];_0xb47533['calleridname']=_0xb47533[_0xd9f8('0x3a')];_0xb47533[_0xd9f8('0x1c')]=_0xb47533[_0xd9f8('0x16')];_0xb47533[_0xd9f8('0x3a')]=_0xb47533[_0xd9f8('0x3b')];_0xb47533['exten']=_0xb47533[_0xd9f8('0x2f')];}else if(_0xb47533['exten']==_0xd9f8('0x3c')){_0xb47533['calleridnum']=_0xb47533[_0xd9f8('0x26')];_0xb47533[_0xd9f8('0x27')]=_0xb47533['originatecalleridnum'];}RpcVoiceRecording[_0xd9f8('0x23')](_0xb47533);}}};Report[_0xd9f8('0x14')][_0xd9f8('0x3d')]=function(_0x2d0464){RpcVoiceAgentReport[_0xd9f8('0x23')](_0x2d0464);};Report['prototype']['voiceDialReport']=function(_0x996466){RpcVoiceDialReport[_0xd9f8('0x23')](_0x996466);var _0x41d074=undefined;var _0x47e65c=_0x996466[_0xd9f8('0x2d')];if(_[_0xd9f8('0x3e')](_0x47e65c,'Local')){var _0x514dd5=_0x47e65c[_0xd9f8('0x3f')](_0x47e65c[_0xd9f8('0x40')]('/')+0x1,_0x47e65c['indexOf']('@'));_0x41d074=_['find'](this[_0xd9f8('0x12')],function(_0x346e41){return _0x346e41[_0xd9f8('0x41')]==_0x514dd5||_0x346e41[_0xd9f8('0x42')]==_0x514dd5||_0x346e41[_0xd9f8('0x16')]==_0x514dd5;});}else{var _0x514dd5=_0x47e65c['substring'](_0x47e65c[_0xd9f8('0x40')]('/')+0x1,_0x47e65c['lastIndexOf']('-'));_0x41d074=this['findAgent'](_0x514dd5);}if(_0x41d074){_0x996466[_0xd9f8('0x1f')]=_[_0xd9f8('0x18')](_0x41d074[_0xd9f8('0x1f')])?util['format']('SIP/%s',_0x41d074['name']):_0x41d074['interface'];_0x996466[_0xd9f8('0x3b')]=_0x41d074[_0xd9f8('0x17')];_0x996466[_0xd9f8('0x16')]=_0x41d074['accountcode'];RpcMemberReport['voiceDialReport'](_0x996466);}};Report[_0xd9f8('0x14')][_0xd9f8('0x43')]=function(_0x41b303){RpcVoiceTransferReport['blindTransfer'](_0x41b303);};Report['prototype'][_0xd9f8('0x44')]=function(_0xa97ac5){RpcVoiceTransferReport['attendedTransfer'](_0xa97ac5);};module[_0xd9f8('0x45')]=Report; \ No newline at end of file +var _0x4619=['mobile','phone','blindTransfer','attendedTransfer','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./userReport','realtime','agents','telephones','prototype','sync','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','type','lastapplication','queue','context','from-sip','xcally-motion-preview','channel','destinationchannel','callerid','calleridnum','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','length','monitorFilename','createdAt','exten','membername','xcally-motion-dialer','voiceAgentReport','voiceDialReport','startsWith','Local','substring','indexOf'];(function(_0x51b4eb,_0x26013c){var _0xe72454=function(_0x288a98){while(--_0x288a98){_0x51b4eb['push'](_0x51b4eb['shift']());}};_0xe72454(++_0x26013c);}(_0x4619,0x16d));var _0x9461=function(_0x2de625,_0x1ce000){_0x2de625=_0x2de625-0x0;var _0x199c34=_0x4619[_0x2de625];return _0x199c34;};'use strict';var BPromise=require(_0x9461('0x0'));var _=require(_0x9461('0x1'));var moment=require(_0x9461('0x2'));var util=require(_0x9461('0x3'));var logger=require(_0x9461('0x4'))(_0x9461('0x5'));var ami=require(_0x9461('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9461('0x7'));var RpcMemberReport=require(_0x9461('0x8'));var RpcVoiceQueueReport=require(_0x9461('0x9'));var RpcVoiceRecording=require(_0x9461('0xa'));var RpcVoiceTransferReport=require(_0x9461('0xb'));var VoiceQueueReport=require(_0x9461('0xc'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x9461('0xd'));function Report(_0x214cff){this[_0x9461('0xe')]=_0x214cff;this['agents']=_0x214cff[_0x9461('0xf')];this[_0x9461('0x10')]=_0x214cff['telephones'];}Report[_0x9461('0x11')][_0x9461('0x12')]=function(_0x4d496f){var _0x5d8be3=new VoiceQueueReport(this[_0x9461('0xe')]);var _0xff468=new VoiceAgentReport(this[_0x9461('0xe')]);var _0x77e2c2=new VoiceDialReport(this[_0x9461('0xe')]);var _0x2e91f1=new VoiceCallReport(this[_0x9461('0xe')]);var _0x4659fa=new UserReport(this[_0x9461('0xe')]);};Report[_0x9461('0x11')][_0x9461('0x13')]=function(_0x3b2421){var _0x176299=undefined;_0x176299=_[_0x9461('0x14')](this[_0x9461('0xf')],function(_0x467208){return _0x467208[_0x9461('0x15')]==_0x3b2421||_0x467208['name']==_0x3b2421;});if(_[_0x9461('0x16')](_0x176299)){var _0x4807c0=_[_0x9461('0x14')](this[_0x9461('0x10')],function(_0x249813){return _0x249813[_0x9461('0x15')]==_0x3b2421||_0x249813[_0x9461('0x17')]==_0x3b2421;});if(_0x4807c0){_0x176299=_[_0x9461('0x14')](this['agents'],function(_0x2b60c6){return _0x2b60c6[_0x9461('0x18')]==util[_0x9461('0x19')](_0x9461('0x1a'),_0x4807c0[_0x9461('0x17')]);});}}return _0x176299;};Report[_0x9461('0x11')][_0x9461('0x1b')]=function(_0x32a97d){for(var _0x543379=0x0;_0x543379<_0x32a97d['length'];_0x543379+=0x1){var _0x2d97e2=this[_0x9461('0x13')](_0x32a97d[_0x543379][_0x9461('0x1c')]);if(_0x2d97e2){_0x32a97d[_0x543379][_0x9461('0x15')]=_0x2d97e2[_0x9461('0x15')];_0x32a97d[_0x543379][_0x9461('0x1d')]=!![];_0x32a97d[_0x543379][_0x9461('0x1e')]=_0x2d97e2['name'];_0x32a97d[_0x543379][_0x9461('0x18')]=_[_0x9461('0x16')](_0x2d97e2['interface'])?util[_0x9461('0x19')](_0x9461('0x1a'),_0x2d97e2[_0x9461('0x17')]):_0x2d97e2['interface'];if(_0x32a97d[_0x543379][_0x9461('0x1f')]){_0x32a97d[_0x543379][_0x9461('0x20')]=moment()['format'](_0x9461('0x21'));}if(_0x32a97d[_0x543379][_0x9461('0x22')]){_0x32a97d[_0x543379]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x9461('0x1b')](_0x32a97d[_0x543379]);}RpcVoiceQueueReport[_0x9461('0x23')](_0x32a97d[_0x543379]);}};function extractCalleridNumber(_0x44424a){var _0x3b40e8=_0x44424a[_0x9461('0x24')](/<(.*?)>/);return _0x3b40e8?_0x3b40e8[0x1]:_0x44424a;}Report[_0x9461('0x11')][_0x9461('0x25')]=function(_0x282d3c){_0x282d3c['destination']=_0x282d3c[_0x9461('0x26')]||_0x282d3c['exten'];if(_0x282d3c[_0x9461('0x27')]=='dialer'){_0x282d3c[_0x9461('0x28')]=_0x9461('0x29');_0x282d3c['lastdata']=_0x282d3c['queue'];if(_0x282d3c['context']=='from-voip-provider'){_0x282d3c[_0x9461('0x15')]='';_0x282d3c['destination']=extractCalleridNumber(_0x282d3c['callerid']);}else if(_0x282d3c[_0x9461('0x2a')]==_0x9461('0x2b')){if(_0x282d3c[_0x9461('0x26')]==_0x9461('0x2c')){_0x282d3c[_0x9461('0x26')]=extractCalleridNumber(_0x282d3c['calleridpreview']);_0x282d3c['calleridnum']=_0x282d3c['originatecalleridnum'];_0x282d3c['destinationchannel']=[_0x282d3c[_0x9461('0x2d')],_0x282d3c[_0x9461('0x2d')]=_0x282d3c[_0x9461('0x2e')]][0x0];_0x282d3c[_0x9461('0x2f')]=_0x282d3c['calleridpreview'];}else{_0x282d3c[_0x9461('0x26')]=_0x282d3c[_0x9461('0x30')];_0x282d3c[_0x9461('0x30')]=_0x282d3c[_0x9461('0x31')];if(_0x282d3c['disposition']==_0x9461('0x32')){_0x282d3c['accountcode']=_0x282d3c[_0x9461('0x1c')];}else{_0x282d3c['accountcode']='';}}}}else{_0x282d3c['callerid']=util['format'](_0x9461('0x33'),_0x282d3c[_0x9461('0x34')],_0x282d3c['calleridnum']);}RpcVoiceCallReport['create'](_0x282d3c);if(_0x282d3c[_0x9461('0x35')]){for(var _0x281b1a=0x0;_0x281b1a<_0x282d3c[_0x9461('0x36')][_0x9461('0x37')];_0x281b1a+=0x1){_0x282d3c[_0x9461('0x38')]=_0x282d3c[_0x9461('0x36')][_0x281b1a]['filename'];_0x282d3c[_0x9461('0x39')]=_0x282d3c[_0x9461('0x36')][_0x281b1a][_0x9461('0x39')];if(_0x282d3c[_0x9461('0x3a')]==_0x9461('0x2c')){_0x282d3c['calleridnum']=_0x282d3c[_0x9461('0x1c')];_0x282d3c['calleridname']=_0x282d3c['connectedlinename'];_0x282d3c[_0x9461('0x1c')]=_0x282d3c[_0x9461('0x15')];_0x282d3c['connectedlinename']=_0x282d3c[_0x9461('0x3b')];_0x282d3c[_0x9461('0x3a')]=_0x282d3c['originatecalleridnum'];}else if(_0x282d3c[_0x9461('0x3a')]==_0x9461('0x3c')){_0x282d3c[_0x9461('0x30')]=_0x282d3c[_0x9461('0x26')];_0x282d3c[_0x9461('0x3a')]=_0x282d3c[_0x9461('0x31')];}RpcVoiceRecording[_0x9461('0x23')](_0x282d3c);}}};Report[_0x9461('0x11')][_0x9461('0x3d')]=function(_0x5895cf){RpcVoiceAgentReport['create'](_0x5895cf);};Report[_0x9461('0x11')][_0x9461('0x3e')]=function(_0x13b169){RpcVoiceDialReport[_0x9461('0x23')](_0x13b169);var _0x607516=undefined;var _0x4cb14b=_0x13b169['channel'];if(_[_0x9461('0x3f')](_0x4cb14b,_0x9461('0x40'))){var _0x2e35d0=_0x4cb14b[_0x9461('0x41')](_0x4cb14b[_0x9461('0x42')]('/')+0x1,_0x4cb14b['indexOf']('@'));_0x607516=_['find'](this[_0x9461('0xf')],function(_0x1d8a85){return _0x1d8a85[_0x9461('0x43')]==_0x2e35d0||_0x1d8a85[_0x9461('0x44')]==_0x2e35d0||_0x1d8a85['accountcode']==_0x2e35d0;});}else{var _0x2e35d0=_0x4cb14b['substring'](_0x4cb14b[_0x9461('0x42')]('/')+0x1,_0x4cb14b['lastIndexOf']('-'));_0x607516=this[_0x9461('0x13')](_0x2e35d0);}if(_0x607516){_0x13b169[_0x9461('0x18')]=_['isNil'](_0x607516[_0x9461('0x18')])?util['format'](_0x9461('0x1a'),_0x607516[_0x9461('0x17')]):_0x607516[_0x9461('0x18')];_0x13b169[_0x9461('0x3b')]=_0x607516[_0x9461('0x17')];_0x13b169['accountcode']=_0x607516[_0x9461('0x15')];RpcMemberReport[_0x9461('0x3e')](_0x13b169);}};Report[_0x9461('0x11')][_0x9461('0x45')]=function(_0x3dc9be){RpcVoiceTransferReport[_0x9461('0x45')](_0x3dc9be);};Report[_0x9461('0x11')]['attendedTransfer']=function(_0x263300){RpcVoiceTransferReport[_0x9461('0x46')](_0x263300);};module[_0x9461('0x47')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 8e70748..582cc4d 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd6=['emit','find','username','state','merge','omit','event','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','peer','registered','address','status','[syncPeerStatus][UserReport]','exports','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','then','actionSipPeerStatus','error','inspect','prototype','actionDeviceStateList','[loopSyncRealTimeShow]','isNotNull','isUndefined'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4bd6,0x64));var _0x64bd=function(_0x32692d,_0x445918){_0x32692d=_0x32692d-0x0;var _0x1eee74=_0x4bd6[_0x32692d];return _0x1eee74;};'use strict';var _=require('lodash');var moment=require(_0x64bd('0x0'));var BPromise=require(_0x64bd('0x1'));var util=require(_0x64bd('0x2'));var Redis=require(_0x64bd('0x3'));var config=require(_0x64bd('0x4'));var logger=require(_0x64bd('0x5'))(_0x64bd('0x6'));var ami=require(_0x64bd('0x7'));config[_0x64bd('0x8')]=_[_0x64bd('0x9')](config['redis'],{'host':_0x64bd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x4d2aab){this[_0x64bd('0xb')]=_0x4d2aab[_0x64bd('0xb')];this[_0x64bd('0xc')]=_0x4d2aab[_0x64bd('0xc')];this[_0x64bd('0xd')]=_0x4d2aab[_0x64bd('0xd')];ami['on'](_0x64bd('0xe'),this['syncRegistry']['bind'](this));ami['on']('registry',this[_0x64bd('0xf')][_0x64bd('0x10')](this));ami['on'](_0x64bd('0x11'),this['syncDeviceState']['bind'](this));ami['on'](_0x64bd('0x12'),this[_0x64bd('0x13')][_0x64bd('0x10')](this));this[_0x64bd('0x14')]();return BPromise[_0x64bd('0x15')]()['then'](ami[_0x64bd('0x16')]())[_0x64bd('0x17')](ami['actionDeviceStateList']())[_0x64bd('0x17')](ami[_0x64bd('0x18')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x19f195){return function(_0x4adb3b){logger[_0x64bd('0x19')](_0x19f195,util[_0x64bd('0x1a')](_0x4adb3b,{'showHidden':![],'depth':null}));};}UserReport[_0x64bd('0x1b')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x64bd('0x15')]()[_0x64bd('0x17')](ami[_0x64bd('0x16')]())[_0x64bd('0x17')](ami[_0x64bd('0x1c')]())[_0x64bd('0x17')](ami[_0x64bd('0x18')]())['catch'](loggerCatch(_0x64bd('0x1d')));},0x32c8);};UserReport[_0x64bd('0x1b')][_0x64bd('0x1e')]=function(_0x5b44f7){return _0x5b44f7!==null&&!_[_0x64bd('0x1f')](_0x5b44f7);};UserReport['prototype'][_0x64bd('0x20')]=function(_0x43227c,_0x3c95c3,_0xa3c6ae){io['to'](_0x43227c)[_0x64bd('0x20')](_0x3c95c3,_0xa3c6ae);};UserReport[_0x64bd('0x1b')][_0x64bd('0xf')]=function(_0x2931d4){try{if(this[_0x64bd('0x1e')](_0x2931d4)){var _0x61c178=_[_0x64bd('0x21')](this[_0x64bd('0xb')],{'registry':_0x2931d4[_0x64bd('0x22')]});if(_0x61c178){_0x2931d4['stateRegistry']=_0x2931d4[_0x64bd('0x23')];_[_0x64bd('0x24')](_0x61c178,_[_0x64bd('0x25')](_0x2931d4,[_0x64bd('0x26'),'actionid',_0x64bd('0x22'),_0x64bd('0x23')]));this[_0x64bd('0x20')](util[_0x64bd('0x27')](_0x64bd('0x28'),_0x61c178[_0x64bd('0x29')]),_0x64bd('0x2a'),_0x61c178);}}}catch(_0x1e3528){logger[_0x64bd('0x19')](_0x64bd('0x2b'),util['inspect'](_0x1e3528,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x48051d){try{if(this[_0x64bd('0x1e')](_0x48051d)){if(this[_0x64bd('0xc')][_0x48051d[_0x64bd('0x2c')]]){if(!this[_0x64bd('0xc')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x2d')]||_0x48051d['state'][_0x64bd('0x2e')]()=='inuse'){this['agents'][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x2d')]=![];if(this['agents'][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x23')]!==_0x48051d[_0x64bd('0x23')][_0x64bd('0x2e')]()){this[_0x64bd('0xc')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x2f')]=_[_0x64bd('0x30')](moment()['format']('x'));}this[_0x64bd('0xc')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x23')]=_0x48051d[_0x64bd('0x23')][_0x64bd('0x2e')]();this[_0x64bd('0xc')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x31')](_0x48051d);}}else if(this[_0x64bd('0xd')][_0x48051d['device']]){if(this[_0x64bd('0xd')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x23')]!==_0x48051d['state'][_0x64bd('0x2e')]()){this[_0x64bd('0xd')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x2f')]=_[_0x64bd('0x30')](moment()[_0x64bd('0x27')]('x'));}this[_0x64bd('0xd')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x23')]=_0x48051d[_0x64bd('0x23')][_0x64bd('0x2e')]();this[_0x64bd('0x20')](util[_0x64bd('0x27')](_0x64bd('0x32'),this[_0x64bd('0xd')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x29')]),_0x64bd('0x33'),this[_0x64bd('0xd')][_0x48051d[_0x64bd('0x2c')]]);}else if(this[_0x64bd('0xb')][_0x48051d[_0x64bd('0x2c')]]){if(this[_0x64bd('0xb')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x23')]!==_0x48051d['state'][_0x64bd('0x2e')]()){this[_0x64bd('0xb')][_0x48051d[_0x64bd('0x2c')]][_0x64bd('0x2f')]=_['toNumber'](moment()[_0x64bd('0x27')]('x'));}this[_0x64bd('0xb')][_0x48051d[_0x64bd('0x2c')]]['state']=_0x48051d[_0x64bd('0x23')][_0x64bd('0x2e')]();this['emit'](util['format'](_0x64bd('0x28'),this[_0x64bd('0xb')][_0x48051d[_0x64bd('0x2c')]]['name']),'trunk:save',this[_0x64bd('0xb')][_0x48051d['device']]);}else if(_[_0x64bd('0x34')](_0x48051d['device'],_0x64bd('0x35'))){}else if(_['startsWith'](_0x48051d['device'],_0x64bd('0x36'))){var _0x43dc7c=_0x48051d[_0x64bd('0x2c')];var _0x24c743=_0x43dc7c[_0x64bd('0x37')](_0x43dc7c['indexOf']('/')+0x1,_0x43dc7c[_0x64bd('0x38')]('@'));var _0x2774bb=_[_0x64bd('0x21')](this[_0x64bd('0xc')],function(_0xd710d4){return _0xd710d4[_0x64bd('0x39')]==_0x24c743||_0xd710d4[_0x64bd('0x3a')]==_0x24c743||_0xd710d4['accountcode']==_0x24c743;});if(_0x2774bb){if(_0x2774bb[_0x64bd('0x23')]!==_0x48051d['state'][_0x64bd('0x2e')]()){_0x2774bb['stateTime']=_['toNumber'](moment()[_0x64bd('0x27')]('x'));}_0x2774bb[_0x64bd('0x23')]=_0x48051d[_0x64bd('0x23')][_0x64bd('0x2e')]();_0x2774bb[_0x64bd('0x2d')]=!![];_0x2774bb[_0x64bd('0x31')](_0x48051d);}}else{}}}catch(_0x281a06){logger[_0x64bd('0x19')](_0x64bd('0x3b'),util[_0x64bd('0x1a')](_0x281a06,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x64bd('0x13')]=function(_0x352e32){try{if(this[_0x64bd('0x1e')](_0x352e32)&&this[_0x64bd('0x1e')](_0x352e32[_0x64bd('0x12')])){if(this['agents'][_0x352e32[_0x64bd('0x3c')]]){if(!this['agents'][_0x352e32['peer']][_0x64bd('0x2d')]||_0x352e32[_0x64bd('0x12')][_0x64bd('0x2e')]()==_0x64bd('0x3d')){this[_0x64bd('0xc')][_0x352e32['peer']][_0x64bd('0x2d')]=![];this[_0x64bd('0xc')][_0x352e32[_0x64bd('0x3c')]]['status']=_0x352e32['peerstatus'][_0x64bd('0x2e')]();this[_0x64bd('0xc')][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x3e')]=_0x352e32[_0x64bd('0x3e')];this['agents'][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x31')](_0x352e32);}}else if(this[_0x64bd('0xd')][_0x352e32['peer']]){this[_0x64bd('0xd')][_0x352e32['peer']][_0x64bd('0x3f')]=_0x352e32[_0x64bd('0x12')][_0x64bd('0x2e')]();this['telephones'][_0x352e32['peer']][_0x64bd('0x3e')]=_0x352e32[_0x64bd('0x3e')];this[_0x64bd('0x20')](util[_0x64bd('0x27')](_0x64bd('0x32'),this[_0x64bd('0xd')][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x29')]),'telephone:save',this[_0x64bd('0xd')][_0x352e32[_0x64bd('0x3c')]]);}else if(this[_0x64bd('0xb')][_0x352e32[_0x64bd('0x3c')]]){this['trunks'][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x3f')]=_0x352e32[_0x64bd('0x12')][_0x64bd('0x2e')]();this[_0x64bd('0xb')][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x3e')]=_0x352e32[_0x64bd('0x3e')];this[_0x64bd('0x20')](util['format'](_0x64bd('0x28'),this[_0x64bd('0xb')][_0x352e32[_0x64bd('0x3c')]][_0x64bd('0x29')]),_0x64bd('0x2a'),this[_0x64bd('0xb')][_0x352e32[_0x64bd('0x3c')]]);}else{}}}catch(_0x3bf2ab){logger[_0x64bd('0x19')](_0x64bd('0x40'),util[_0x64bd('0x1a')](_0x3bf2ab,{'showHidden':![],'depth':null}));}};module[_0x64bd('0x41')]=UserReport; \ No newline at end of file +var _0xe0d8=['actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','loopSyncRealTimeShow','resolve','prototype','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','actionid','state','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','inuse','local','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephones','telephone:save','Queue','startsWith','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','address','exports','moment','bluebird','ioredis','../ami','defaults','redis','trunks','agents','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','then','actionSipShowRegistry','actionDeviceStateList'];(function(_0x1a4076,_0x599e47){var _0x560840=function(_0x17b155){while(--_0x17b155){_0x1a4076['push'](_0x1a4076['shift']());}};_0x560840(++_0x599e47);}(_0xe0d8,0xe3));var _0x8e0d=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xe0d8[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require('lodash');var moment=require(_0x8e0d('0x0'));var BPromise=require(_0x8e0d('0x1'));var util=require('util');var Redis=require(_0x8e0d('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x8e0d('0x3'));config['redis']=_[_0x8e0d('0x4')](config[_0x8e0d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e0d('0x5')]));function UserReport(_0x24fc9b){this['trunks']=_0x24fc9b[_0x8e0d('0x6')];this[_0x8e0d('0x7')]=_0x24fc9b[_0x8e0d('0x7')];this['telephones']=_0x24fc9b['telephones'];ami['on'](_0x8e0d('0x8'),this[_0x8e0d('0x9')][_0x8e0d('0xa')](this));ami['on']('registry',this[_0x8e0d('0x9')][_0x8e0d('0xa')](this));ami['on'](_0x8e0d('0xb'),this[_0x8e0d('0xc')][_0x8e0d('0xa')](this));ami['on'](_0x8e0d('0xd'),this['syncPeerStatus'][_0x8e0d('0xa')](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()[_0x8e0d('0xe')](ami[_0x8e0d('0xf')]())[_0x8e0d('0xe')](ami[_0x8e0d('0x10')]())[_0x8e0d('0xe')](ami[_0x8e0d('0x11')]())[_0x8e0d('0x12')](loggerCatch(_0x8e0d('0x13')));}function loggerCatch(_0x4de763){return function(_0x5d8d39){logger[_0x8e0d('0x14')](_0x4de763,util[_0x8e0d('0x15')](_0x5d8d39,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x8e0d('0x16')]=function(){setInterval(function(){BPromise[_0x8e0d('0x17')]()[_0x8e0d('0xe')](ami[_0x8e0d('0xf')]())[_0x8e0d('0xe')](ami[_0x8e0d('0x10')]())['then'](ami[_0x8e0d('0x11')]())['catch'](loggerCatch(_0x8e0d('0x13')));},0x32c8);};UserReport[_0x8e0d('0x18')][_0x8e0d('0x19')]=function(_0x200a7b){return _0x200a7b!==null&&!_[_0x8e0d('0x1a')](_0x200a7b);};UserReport[_0x8e0d('0x18')][_0x8e0d('0x1b')]=function(_0x54c165,_0x3a2e8a,_0x41b068){io['to'](_0x54c165)[_0x8e0d('0x1b')](_0x3a2e8a,_0x41b068);};UserReport[_0x8e0d('0x18')][_0x8e0d('0x9')]=function(_0x406204){try{if(this['isNotNull'](_0x406204)){var _0x1820ef=_[_0x8e0d('0x1c')](this[_0x8e0d('0x6')],{'registry':_0x406204[_0x8e0d('0x1d')]});if(_0x1820ef){_0x406204[_0x8e0d('0x1e')]=_0x406204['state'];_[_0x8e0d('0x1f')](_0x1820ef,_['omit'](_0x406204,['event',_0x8e0d('0x20'),_0x8e0d('0x1d'),_0x8e0d('0x21')]));this[_0x8e0d('0x1b')](util['format'](_0x8e0d('0x22'),_0x1820ef[_0x8e0d('0x23')]),_0x8e0d('0x24'),_0x1820ef);}}}catch(_0x5a6dc3){logger[_0x8e0d('0x14')](_0x8e0d('0x25'),util['inspect'](_0x5a6dc3,{'showHidden':![],'depth':null}));}};UserReport[_0x8e0d('0x18')][_0x8e0d('0xc')]=function(_0x22edc7){try{if(this[_0x8e0d('0x19')](_0x22edc7)){if(this[_0x8e0d('0x7')][_0x22edc7[_0x8e0d('0x26')]]){if(!this[_0x8e0d('0x7')][_0x22edc7[_0x8e0d('0x26')]]['local']||_0x22edc7[_0x8e0d('0x21')]['toLowerCase']()==_0x8e0d('0x27')){this[_0x8e0d('0x7')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x28')]=![];if(this[_0x8e0d('0x7')][_0x22edc7['device']]['state']!==_0x22edc7[_0x8e0d('0x21')][_0x8e0d('0x29')]()){this[_0x8e0d('0x7')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x2a')]=_[_0x8e0d('0x2b')](moment()[_0x8e0d('0x2c')]('x'));}this['agents'][_0x22edc7['device']]['state']=_0x22edc7[_0x8e0d('0x21')][_0x8e0d('0x29')]();this[_0x8e0d('0x7')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x2d')](_0x22edc7);}}else if(this['telephones'][_0x22edc7[_0x8e0d('0x26')]]){if(this[_0x8e0d('0x2e')][_0x22edc7['device']]['state']!==_0x22edc7['state'][_0x8e0d('0x29')]()){this[_0x8e0d('0x2e')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x2a')]=_[_0x8e0d('0x2b')](moment()[_0x8e0d('0x2c')]('x'));}this[_0x8e0d('0x2e')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x21')]=_0x22edc7['state'][_0x8e0d('0x29')]();this[_0x8e0d('0x1b')](util[_0x8e0d('0x2c')]('telephone:%s',this[_0x8e0d('0x2e')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x23')]),_0x8e0d('0x2f'),this['telephones'][_0x22edc7[_0x8e0d('0x26')]]);}else if(this[_0x8e0d('0x6')][_0x22edc7[_0x8e0d('0x26')]]){if(this[_0x8e0d('0x6')][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x21')]!==_0x22edc7['state']['toLowerCase']()){this['trunks'][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x2a')]=_[_0x8e0d('0x2b')](moment()[_0x8e0d('0x2c')]('x'));}this['trunks'][_0x22edc7[_0x8e0d('0x26')]][_0x8e0d('0x21')]=_0x22edc7[_0x8e0d('0x21')]['toLowerCase']();this['emit'](util[_0x8e0d('0x2c')]('trunk:%s',this[_0x8e0d('0x6')][_0x22edc7[_0x8e0d('0x26')]]['name']),'trunk:save',this['trunks'][_0x22edc7['device']]);}else if(_['startsWith'](_0x22edc7['device'],_0x8e0d('0x30'))){}else if(_[_0x8e0d('0x31')](_0x22edc7[_0x8e0d('0x26')],'Local')){var _0x576ec4=_0x22edc7['device'];var _0x4571d6=_0x576ec4[_0x8e0d('0x32')](_0x576ec4[_0x8e0d('0x33')]('/')+0x1,_0x576ec4[_0x8e0d('0x33')]('@'));var _0x3feba4=_[_0x8e0d('0x1c')](this[_0x8e0d('0x7')],function(_0x16662b){return _0x16662b[_0x8e0d('0x34')]==_0x4571d6||_0x16662b[_0x8e0d('0x35')]==_0x4571d6||_0x16662b[_0x8e0d('0x36')]==_0x4571d6;});if(_0x3feba4){if(_0x3feba4[_0x8e0d('0x21')]!==_0x22edc7[_0x8e0d('0x21')][_0x8e0d('0x29')]()){_0x3feba4[_0x8e0d('0x2a')]=_['toNumber'](moment()['format']('x'));}_0x3feba4['state']=_0x22edc7[_0x8e0d('0x21')][_0x8e0d('0x29')]();_0x3feba4[_0x8e0d('0x28')]=!![];_0x3feba4[_0x8e0d('0x2d')](_0x22edc7);}}else{}}}catch(_0x11e617){logger[_0x8e0d('0x14')](_0x8e0d('0x37'),util['inspect'](_0x11e617,{'showHidden':![],'depth':null}));}};UserReport[_0x8e0d('0x18')][_0x8e0d('0x38')]=function(_0x27f59f){try{if(this['isNotNull'](_0x27f59f)&&this[_0x8e0d('0x19')](_0x27f59f[_0x8e0d('0xd')])){if(this[_0x8e0d('0x7')][_0x27f59f[_0x8e0d('0x39')]]){if(!this['agents'][_0x27f59f[_0x8e0d('0x39')]][_0x8e0d('0x28')]||_0x27f59f['peerstatus'][_0x8e0d('0x29')]()==_0x8e0d('0x3a')){this[_0x8e0d('0x7')][_0x27f59f[_0x8e0d('0x39')]]['local']=![];this['agents'][_0x27f59f[_0x8e0d('0x39')]]['status']=_0x27f59f[_0x8e0d('0xd')][_0x8e0d('0x29')]();this[_0x8e0d('0x7')][_0x27f59f[_0x8e0d('0x39')]][_0x8e0d('0x3b')]=_0x27f59f['address'];this[_0x8e0d('0x7')][_0x27f59f['peer']][_0x8e0d('0x2d')](_0x27f59f);}}else if(this[_0x8e0d('0x2e')][_0x27f59f[_0x8e0d('0x39')]]){this[_0x8e0d('0x2e')][_0x27f59f[_0x8e0d('0x39')]]['status']=_0x27f59f[_0x8e0d('0xd')][_0x8e0d('0x29')]();this[_0x8e0d('0x2e')][_0x27f59f[_0x8e0d('0x39')]]['address']=_0x27f59f[_0x8e0d('0x3b')];this['emit'](util[_0x8e0d('0x2c')]('telephone:%s',this[_0x8e0d('0x2e')][_0x27f59f[_0x8e0d('0x39')]][_0x8e0d('0x23')]),_0x8e0d('0x2f'),this['telephones'][_0x27f59f[_0x8e0d('0x39')]]);}else if(this['trunks'][_0x27f59f[_0x8e0d('0x39')]]){this[_0x8e0d('0x6')][_0x27f59f[_0x8e0d('0x39')]]['status']=_0x27f59f['peerstatus']['toLowerCase']();this[_0x8e0d('0x6')][_0x27f59f[_0x8e0d('0x39')]][_0x8e0d('0x3b')]=_0x27f59f[_0x8e0d('0x3b')];this[_0x8e0d('0x1b')](util['format'](_0x8e0d('0x22'),this[_0x8e0d('0x6')][_0x27f59f[_0x8e0d('0x39')]][_0x8e0d('0x23')]),_0x8e0d('0x24'),this[_0x8e0d('0x6')][_0x27f59f[_0x8e0d('0x39')]]);}else{}}}catch(_0x294803){logger['error']('[syncPeerStatus][UserReport]',util[_0x8e0d('0x15')](_0x294803,{'showHidden':![],'depth':null}));}};module[_0x8e0d('0x3c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 571c97f..4ca01f0 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb78e=['agentringnoanswerAt','custom:agentringnoanswer','originalposition','abandoned','custom:agentqueuecallerabandon','talktime','reason','acw','acwTimeout','agentcompleteAt','COMPLETE','cause','answered_elsewhere','destuniqueid','custom:agentansweredelsewhere','custom:agentcomplete','user:agentcomplete','HANGUP','cause-txt','recalculate','complete','diffTime','clear','origtransfererchannel','ATTENDED','secondtransfereruniqueid','secondtransfererexten','transfer','transfertargetchannel','transfererchannel','transfereeuniqueid','extension','BLIND','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','keys','variable','value','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','attendedtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','prototype','info','%s|%s','uniqueid','exten','calleridnum','join','addTime','add','seconds','diff','interface','isNil','queue','emit','user:save','destchannel','format','YYYY-MM-DD\x20HH:mm:ss','calleridname','destcalleridnum','destcalleridname','accountcode','destaccountcode','channel','destexten','context','priority','type','inbound','mandatoryDisposition','membername','agent','user:%s','user:called','log','error','stack','assign','holdtime','ringtime','agentconnectAt','agentcalledAt','custom:agentconnect','user:agentconnect','CONNECT','find','channels','updateStatusRealtime','syncMusicOnHoldStop','rejected'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0xb78e,0x1c9));var _0xeb78=function(_0xa089e9,_0x5923f3){_0xa089e9=_0xa089e9-0x0;var _0x5f1d07=_0xb78e[_0xa089e9];return _0x5f1d07;};'use strict';var _=require(_0xeb78('0x0'));var moment=require(_0xeb78('0x1'));var util=require('util');var Redis=require(_0xeb78('0x2'));var config=require(_0xeb78('0x3'));var logger=require(_0xeb78('0x4'))(_0xeb78('0x5'));var ami=require(_0xeb78('0x6'));config[_0xeb78('0x7')]=_[_0xeb78('0x8')](config[_0xeb78('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xeb78('0x9'))(new Redis(config[_0xeb78('0x7')]));function VoiceAgentReport(_0x1ccc2f){this[_0xeb78('0xa')]=_0x1ccc2f[_0xeb78('0xa')];this[_0xeb78('0xb')]=_0x1ccc2f[_0xeb78('0xb')];this['channels']={};this[_0xeb78('0xc')]={};ami['on'](_0xeb78('0xd'),this[_0xeb78('0xe')][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x10'),this[_0xeb78('0x11')][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x12'),this[_0xeb78('0x13')]['bind'](this));ami['on'](_0xeb78('0x14'),this[_0xeb78('0x15')][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x16'),this[_0xeb78('0x17')][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x18'),this[_0xeb78('0x19')][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x1a'),this['syncHangup'][_0xeb78('0xf')](this));ami['on'](_0xeb78('0x1b'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xeb78('0x1c')]['bind'](this));ami['on'](_0xeb78('0x1d'),this[_0xeb78('0x1e')]['bind'](this));ami['on'](_0xeb78('0x1f'),this['syncMusicOnHoldStop'][_0xeb78('0xf')](this));}VoiceAgentReport[_0xeb78('0x20')]['log']=function(_0x45176e,_0xb97756){logger[_0xeb78('0x21')](util['format'](_0xeb78('0x22'),_0x45176e,[_0xb97756[_0xeb78('0x23')],_0xb97756['membername'],_0xb97756['queue'],_0xb97756[_0xeb78('0x24')],_0xb97756[_0xeb78('0x25')]][_0xeb78('0x26')]('|')));};VoiceAgentReport[_0xeb78('0x20')][_0xeb78('0x27')]=function(_0x425de5,_0x2cf7cc){return moment(_0x425de5)[_0xeb78('0x28')](_0x2cf7cc,_0xeb78('0x29'))['format']('YYYY-MM-DD\x20HH:mm:ss');};VoiceAgentReport['prototype']['diffTime']=function(_0x3c8e66,_0x5b15d8){return moment(_0x3c8e66)[_0xeb78('0x2a')](moment(_0x5b15d8),_0xeb78('0x29'));};VoiceAgentReport['prototype'][_0xeb78('0xe')]=function(_0x4ac816){try{var _0x9a00b=this[_0xeb78('0xb')][_0x4ac816[_0xeb78('0x2b')]];if(!_[_0xeb78('0x2c')](_0x9a00b)){_0x9a00b=_['assign'](_0x9a00b,{'queue':_0x4ac816[_0xeb78('0x2d')],'destconnectedlinenum':_0x4ac816['calleridnum']});io[_0xeb78('0x2e')](_0xeb78('0x2f'),_0x9a00b);}var _0x4493bb=this['channels'][_0x4ac816[_0xeb78('0x30')]]={'agentcalledAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'calleridnum':_0x4ac816[_0xeb78('0x25')],'calleridname':_0x4ac816[_0xeb78('0x33')],'connectedlinenum':_0x4ac816[_0xeb78('0x34')],'connectedlinename':_0x4ac816[_0xeb78('0x35')],'accountcode':_0x4ac816[_0xeb78('0x36')],'destaccountcode':_0x4ac816[_0xeb78('0x37')],'channel':_0x4ac816[_0xeb78('0x38')],'destchannel':_0x4ac816[_0xeb78('0x30')],'uniqueid':_0x4ac816['uniqueid'],'destuniqueid':_0x4ac816['destuniqueid'],'destcalleridnum':_0x4ac816['destcalleridnum'],'destcalleridname':_0x4ac816[_0xeb78('0x35')],'destexten':_0x4ac816[_0xeb78('0x39')],'context':_0x4ac816[_0xeb78('0x3a')],'exten':_0x4ac816['exten'],'priority':_0x4ac816[_0xeb78('0x3b')],'queue':_0x4ac816[_0xeb78('0x2d')],'type':this[_0xeb78('0xa')][_0x4ac816[_0xeb78('0x2d')]]?this[_0xeb78('0xa')][_0x4ac816[_0xeb78('0x2d')]][_0xeb78('0x3c')]||_0xeb78('0x3d'):_0xeb78('0x3d'),'interface':_0x4ac816['interface'],'mandatoryDisposition':this[_0xeb78('0xa')][_0x4ac816['queue']][_0xeb78('0x3e')]||0x0,'membername':_0x4ac816[_0xeb78('0x3f')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0xeb78('0x40'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0xeb78('0xb')][_0x4ac816[_0xeb78('0x2b')]]?this[_0xeb78('0xb')][_0x4ac816['interface']]['id']:null,'lastevent':'called','agentacw':![],'acwtime':0x0,'variables':this[_0xeb78('0xc')][_0x4ac816[_0xeb78('0x38')]]?this[_0xeb78('0xc')][_0x4ac816[_0xeb78('0x38')]]:{}};ami[_0xeb78('0x2e')]('custom:agentcalled',_0x4493bb);io['to'](util[_0xeb78('0x31')](_0xeb78('0x41'),_0x4493bb[_0xeb78('0x3f')]))[_0xeb78('0x2e')](_0xeb78('0x42'),_0x4493bb);this[_0xeb78('0x43')]('CALLED',this['channels'][_0x4ac816['destchannel']]);}catch(_0x493571){logger[_0xeb78('0x44')](_0x493571[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')]['syncAgentConnect']=function(_0x274e9a){try{var _0x194cb5=this['channels'][_0x274e9a['destchannel']];if(!_['isNil'](_0x194cb5)){_0x194cb5=_[_0xeb78('0x46')](_0x194cb5,{'holdtime':parseInt(_0x274e9a[_0xeb78('0x47')],0xa),'ringtime':parseInt(_0x274e9a[_0xeb78('0x48')],0xa),'agentconnect':!![],'lastevent':'connect'});_0x194cb5[_0xeb78('0x49')]=this[_0xeb78('0x27')](_0x194cb5[_0xeb78('0x4a')],_0x194cb5['ringtime']);ami[_0xeb78('0x2e')](_0xeb78('0x4b'),_0x194cb5);io['to'](util[_0xeb78('0x31')](_0xeb78('0x41'),_0x194cb5['membername']))['emit'](_0xeb78('0x4c'),_0x194cb5);this[_0xeb78('0x43')](_0xeb78('0x4d'),_0x194cb5);}}catch(_0x183095){logger[_0xeb78('0x44')](_0x183095[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')][_0xeb78('0x1e')]=function(_0x47567d){try{var _0x571552=_[_0xeb78('0x4e')](this[_0xeb78('0x4f')],{'channel':_0x47567d[_0xeb78('0x38')],'agentconnect':!![]});if(!_['isNil'](_0x571552)){if(!_[_0xeb78('0x2c')](this['agents'][_0x571552[_0xeb78('0x2b')]])){this[_0xeb78('0xb')][_0x571552[_0xeb78('0x2b')]]['onhold']=!![];this[_0xeb78('0xb')][_0x571552[_0xeb78('0x2b')]][_0xeb78('0x50')]();}}}catch(_0x2944d8){logger[_0xeb78('0x44')](_0x2944d8['stack']);}};VoiceAgentReport[_0xeb78('0x20')][_0xeb78('0x51')]=function(_0x4910e3){try{var _0xece1cb=_[_0xeb78('0x4e')](this[_0xeb78('0x4f')],{'channel':_0x4910e3['channel'],'agentconnect':!![]});if(!_[_0xeb78('0x2c')](_0xece1cb)){if(!_[_0xeb78('0x2c')](this[_0xeb78('0xb')][_0xece1cb[_0xeb78('0x2b')]])){this[_0xeb78('0xb')][_0xece1cb[_0xeb78('0x2b')]]['onhold']=![];this['agents'][_0xece1cb[_0xeb78('0x2b')]][_0xeb78('0x50')]();}}}catch(_0x521362){logger[_0xeb78('0x44')](_0x521362[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')][_0xeb78('0x13')]=function(_0x5ccd68){try{var _0x7203b7=this[_0xeb78('0x4f')][_0x5ccd68[_0xeb78('0x30')]];if(!_[_0xeb78('0x2c')](_0x7203b7)){_0x7203b7=_[_0xeb78('0x46')](_0x7203b7,{'ringtime':parseInt(_0x5ccd68[_0xeb78('0x48')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0xeb78('0x52'),'lastevent':_0xeb78('0x52')});_0x7203b7[_0xeb78('0x53')]=this[_0xeb78('0x27')](_0x7203b7['agentcalledAt'],_0x7203b7[_0xeb78('0x48')]);ami[_0xeb78('0x2e')](_0xeb78('0x54'),_0x7203b7);this[_0xeb78('0x43')]('RINGNOANSWER',_0x7203b7);}}catch(_0x35cedb){logger[_0xeb78('0x44')](_0x35cedb[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')][_0xeb78('0x15')]=function(_0x54d461){try{for(var _0x5e0644 in this['channels']){var _0x438c20=this[_0xeb78('0x4f')][_0x5e0644];if(!_['isNil'](_0x438c20)&&_0x438c20[_0xeb78('0x38')]==_0x54d461[_0xeb78('0x38')]){_0x438c20=_[_0xeb78('0x46')](_0x438c20,{'holdtime':parseInt(_0x54d461['holdtime'],0xa),'position':parseInt(_0x54d461['position'],0xa),'originalposition':parseInt(_0x54d461[_0xeb78('0x55')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'reason':'abandoned','lastevent':_0xeb78('0x56')});ami[_0xeb78('0x2e')](_0xeb78('0x57'),_0x438c20);this['log']('CALLERABANDON',_0x438c20);}}}catch(_0x4d0d2e){logger[_0xeb78('0x44')](_0x4d0d2e[_0xeb78('0x45')]);}};VoiceAgentReport['prototype'][_0xeb78('0x17')]=function(_0x31eb10){try{var _0x2a77c8=this['channels'][_0x31eb10[_0xeb78('0x30')]];if(!_['isNil'](_0x2a77c8)){_0x2a77c8=_[_0xeb78('0x46')](_0x2a77c8,{'talktime':parseInt(_0x31eb10[_0xeb78('0x58')],0xa),'reason':_0x31eb10[_0xeb78('0x59')]=='transfer'?'agent':_0x31eb10['reason'],'agentcomplete':!![],'lastevent':'complete','agentacw':this[_0xeb78('0xa')][_0x2a77c8['queue']]&&this[_0xeb78('0xa')][_0x2a77c8[_0xeb78('0x2d')]][_0xeb78('0x5a')]?!![]:![],'acwtime':this[_0xeb78('0xa')][_0x2a77c8[_0xeb78('0x2d')]]&&this[_0xeb78('0xa')][_0x2a77c8['queue']]['acw']?this[_0xeb78('0xa')][_0x2a77c8[_0xeb78('0x2d')]][_0xeb78('0x5b')]:0x0});_0x2a77c8[_0xeb78('0x5c')]=this['addTime'](_0x2a77c8[_0xeb78('0x49')],_0x2a77c8['talktime']);this[_0xeb78('0x43')](_0xeb78('0x5d'),_0x2a77c8);}}catch(_0x1d4761){logger['error'](_0x1d4761[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')]['clear']=function(_0x5a5de3){try{switch(_0x5a5de3[_0xeb78('0x5e')]){case 0x1a:_0x5a5de3=_[_0xeb78('0x46')](_0x5a5de3,{'agentringnoanswer':!![],'reason':'answered_elsewhere','lastevent':_0xeb78('0x5f')});var _0x437a3f=_['find'](this['channels'],{'channel':_0x5a5de3[_0xeb78('0x38')],'agentconnect':!![]});if(!_['isNil'](_0x437a3f)){_0x5a5de3=_['assign'](_0x5a5de3,{'agentringnoanswerAt':_0x437a3f[_0xeb78('0x49')],'answeredelsewheremembername':_0x437a3f['membername'],'answeredelsewheredestinationuniqueid':_0x437a3f[_0xeb78('0x60')]});}ami[_0xeb78('0x2e')](_0xeb78('0x61'),_0x5a5de3);break;}if(_0x5a5de3['agentcomplete']){ami[_0xeb78('0x2e')](_0xeb78('0x62'),_0x5a5de3);io['to'](util[_0xeb78('0x31')]('user:%s',_0x5a5de3[_0xeb78('0x3f')]))[_0xeb78('0x2e')](_0xeb78('0x63'),_0x5a5de3);}this[_0xeb78('0x43')](_0xeb78('0x64'),_0x5a5de3);ami[_0xeb78('0x2e')]('custom:voiceAgentReport',_0x5a5de3);if(this[_0xeb78('0x4f')][_0x5a5de3['destchannel']]){delete this[_0xeb78('0x4f')][_0x5a5de3[_0xeb78('0x30')]];}}catch(_0x27e8e8){logger[_0xeb78('0x44')](_0x27e8e8);}};VoiceAgentReport[_0xeb78('0x20')]['syncHangup']=function(_0x2ffe3b){try{var _0x2bf5a8=this[_0xeb78('0x4f')][_0x2ffe3b[_0xeb78('0x38')]];if(!_[_0xeb78('0x2c')](_0x2bf5a8)){_0x2bf5a8=_[_0xeb78('0x46')](_0x2bf5a8,{'cause':parseInt(_0x2ffe3b[_0xeb78('0x5e')],0xa),'cause-txt':_0x2ffe3b[_0xeb78('0x65')]});if(_0x2bf5a8[_0xeb78('0x66')]){_0x2bf5a8=_[_0xeb78('0x46')](_0x2bf5a8,{'agentcomplete':!![],'agentcompleteAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'lastevent':_0xeb78('0x67'),'agentacw':this[_0xeb78('0xa')][_0x2bf5a8[_0xeb78('0x2d')]]&&this[_0xeb78('0xa')][_0x2bf5a8['queue']][_0xeb78('0x5a')]?!![]:![],'acwtime':this[_0xeb78('0xa')][_0x2bf5a8[_0xeb78('0x2d')]]&&this['voiceQueues'][_0x2bf5a8[_0xeb78('0x2d')]][_0xeb78('0x5a')]?this[_0xeb78('0xa')][_0x2bf5a8[_0xeb78('0x2d')]][_0xeb78('0x5b')]:0x0});_0x2bf5a8[_0xeb78('0x58')]=this[_0xeb78('0x68')](_0x2bf5a8[_0xeb78('0x5c')],_0x2bf5a8[_0xeb78('0x49')]);}var _0x4f7714=this['agents'][_0x2bf5a8[_0xeb78('0x2b')]];if(!_[_0xeb78('0x2c')](_0x4f7714)){_0x4f7714=_[_0xeb78('0x46')](_0x4f7714,{'queue':null,'destconnectedlinenum':null});io[_0xeb78('0x2e')](_0xeb78('0x2f'),_0x4f7714);}setTimeout(this[_0xeb78('0x69')][_0xeb78('0xf')](this,_0x2bf5a8),0x3e8);}if(this[_0xeb78('0xc')][_0x2ffe3b[_0xeb78('0x38')]]){delete this[_0xeb78('0xc')][_0x2ffe3b['channel']];}}catch(_0xfa7f27){logger[_0xeb78('0x44')](_0xfa7f27[_0xeb78('0x45')]);}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x5f4995){try{var _0x4cb00a=this[_0xeb78('0x4f')][_0x5f4995[_0xeb78('0x6a')]];if(!_[_0xeb78('0x2c')](_0x4cb00a)){_0x4cb00a=_[_0xeb78('0x46')](_0x4cb00a,{'transfer':!![],'transferAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'transfertype':_0xeb78('0x6b'),'agentcomplete':!![],'agentcompleteAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'transferuniqueid':_0x5f4995[_0xeb78('0x6c')],'transfercontext':_0x5f4995[_0xeb78('0x6d')],'transferextension':_0x5f4995['secondtransferercontext'],'reason':_0xeb78('0x6e'),'lastevent':'complete','agentacw':this[_0xeb78('0xa')][_0x4cb00a['queue']]&&this[_0xeb78('0xa')][_0x4cb00a[_0xeb78('0x2d')]][_0xeb78('0x5a')]?!![]:![],'acwtime':this[_0xeb78('0xa')][_0x4cb00a[_0xeb78('0x2d')]]&&this['voiceQueues'][_0x4cb00a[_0xeb78('0x2d')]][_0xeb78('0x5a')]?this[_0xeb78('0xa')][_0x4cb00a[_0xeb78('0x2d')]][_0xeb78('0x5b')]:0x0});_0x4cb00a[_0xeb78('0x58')]=this[_0xeb78('0x68')](_0x4cb00a[_0xeb78('0x5c')],_0x4cb00a[_0xeb78('0x49')]);this[_0xeb78('0x43')]('ATTENDED',_0x4cb00a);}if(!_[_0xeb78('0x2c')](this[_0xeb78('0x4f')][_0x5f4995[_0xeb78('0x6f')]])){this[_0xeb78('0x4f')][_0x5f4995[_0xeb78('0x6f')]][_0xeb78('0x66')]=!![];}}catch(_0x37217c){logger['error'](_0x37217c[_0xeb78('0x45')]);}};VoiceAgentReport['prototype'][_0xeb78('0x1c')]=function(_0xc60eed){try{var _0x2c3e1f=this['channels'][_0xc60eed[_0xeb78('0x70')]];if(!_[_0xeb78('0x2c')](_0x2c3e1f)){_0x2c3e1f=_['assign'](_0x2c3e1f,{'transfer':!![],'transferAt':moment()[_0xeb78('0x31')](_0xeb78('0x32')),'transfertype':'BLIND','transferuniqueid':_0xc60eed[_0xeb78('0x71')],'transfercontext':_0xc60eed[_0xeb78('0x3a')],'transferextension':_0xc60eed[_0xeb78('0x72')],'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0xeb78('0x32')),'reason':_0xeb78('0x6e'),'lastevent':_0xeb78('0x67'),'agentacw':this['voiceQueues'][_0x2c3e1f[_0xeb78('0x2d')]]&&this[_0xeb78('0xa')][_0x2c3e1f['queue']]['acw']?!![]:![],'acwtime':this['voiceQueues'][_0x2c3e1f['queue']]&&this[_0xeb78('0xa')][_0x2c3e1f[_0xeb78('0x2d')]][_0xeb78('0x5a')]?this[_0xeb78('0xa')][_0x2c3e1f[_0xeb78('0x2d')]][_0xeb78('0x5b')]:0x0});_0x2c3e1f[_0xeb78('0x66')]=!![];this[_0xeb78('0x43')](_0xeb78('0x73'),_0x2c3e1f);}}catch(_0xd3ed51){logger[_0xeb78('0x44')](_0xd3ed51[_0xeb78('0x45')]);}};VoiceAgentReport[_0xeb78('0x20')]['syncVarSet']=function(_0x4afefa){var _0x6f5915=[_0xeb78('0x74'),_0xeb78('0x75'),_0xeb78('0x76'),_0xeb78('0x77'),_0xeb78('0x78'),'rtpaudioqoslossbridged',_0xeb78('0x79'),_0xeb78('0x7a'),'sipcallid',_0xeb78('0x7b'),_0xeb78('0x7c'),_0xeb78('0x7d'),_0xeb78('0x7e'),_0xeb78('0x7f'),_0xeb78('0x80'),_0xeb78('0x81'),'membername',_0xeb78('0x82'),'memberrealtime'];try{var _0x3be3b0=_[_0xeb78('0x83')](_0x4afefa[_0xeb78('0x84')])[0x0];if(!_[_0xeb78('0x2c')](_0x3be3b0)&&!_['includes'](_0x6f5915,_0x3be3b0)){if(!this[_0xeb78('0xc')][_0x4afefa['channel']]){this['variables'][_0x4afefa[_0xeb78('0x38')]]={};}this[_0xeb78('0xc')][_0x4afefa[_0xeb78('0x38')]][_0x3be3b0]=_0x4afefa[_0xeb78('0x85')];}}catch(_0x279fbf){logger[_0xeb78('0x44')](_0x279fbf[_0xeb78('0x45')]);}};module[_0xeb78('0x86')]=VoiceAgentReport; \ No newline at end of file +var _0xea28=['agentringnoanswerAt','agentcalledAt','custom:agentringnoanswer','RINGNOANSWER','position','originalposition','abandoned','talktime','transfer','reason','complete','acw','agentconnectAt','clear','cause','custom:agentansweredelsewhere','HANGUP','custom:voiceAgentReport','cause-txt','acwTimeout','origtransfererchannel','ATTENDED','secondtransferercontext','agentcompleteAt','transfertargetchannel','recalculate','transfererchannel','BLIND','transfereeuniqueid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','variable','value','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','prototype','log','info','format','%s|%s','uniqueid','exten','calleridnum','join','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','assign','user:save','destchannel','destcalleridnum','destcalleridname','accountcode','destaccountcode','channel','destuniqueid','priority','queue','type','inbound','interface','agent','called','emit','custom:agentcalled','user:%s','membername','user:called','CALLED','error','stack','syncAgentConnect','isNil','holdtime','ringtime','connect','custom:agentconnect','user:agentconnect','CONNECT','onhold','updateStatusRealtime','find','rejected'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xea28,0x13a));var _0x8ea2=function(_0xf6993b,_0x425eff){_0xf6993b=_0xf6993b-0x0;var _0x1610b8=_0xea28[_0xf6993b];return _0x1610b8;};'use strict';var _=require(_0x8ea2('0x0'));var moment=require(_0x8ea2('0x1'));var util=require(_0x8ea2('0x2'));var Redis=require(_0x8ea2('0x3'));var config=require(_0x8ea2('0x4'));var logger=require(_0x8ea2('0x5'))(_0x8ea2('0x6'));var ami=require(_0x8ea2('0x7'));config['redis']=_[_0x8ea2('0x8')](config[_0x8ea2('0x9')],{'host':_0x8ea2('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8ea2('0x9')]));function VoiceAgentReport(_0x435d78){this[_0x8ea2('0xb')]=_0x435d78[_0x8ea2('0xb')];this[_0x8ea2('0xc')]=_0x435d78[_0x8ea2('0xc')];this[_0x8ea2('0xd')]={};this[_0x8ea2('0xe')]={};ami['on'](_0x8ea2('0xf'),this[_0x8ea2('0x10')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x12'),this['syncAgentConnect']['bind'](this));ami['on'](_0x8ea2('0x13'),this[_0x8ea2('0x14')][_0x8ea2('0x11')](this));ami['on']('queuecallerabandon',this[_0x8ea2('0x15')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x16'),this[_0x8ea2('0x17')][_0x8ea2('0x11')](this));ami['on']('varset',this[_0x8ea2('0x18')]['bind'](this));ami['on']('hangup',this[_0x8ea2('0x19')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x1a'),this[_0x8ea2('0x1b')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x1c'),this[_0x8ea2('0x1d')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x1e'),this[_0x8ea2('0x1f')][_0x8ea2('0x11')](this));ami['on'](_0x8ea2('0x20'),this[_0x8ea2('0x21')][_0x8ea2('0x11')](this));}VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x23')]=function(_0x467045,_0x2a0329){logger[_0x8ea2('0x24')](util[_0x8ea2('0x25')](_0x8ea2('0x26'),_0x467045,[_0x2a0329[_0x8ea2('0x27')],_0x2a0329['membername'],_0x2a0329['queue'],_0x2a0329[_0x8ea2('0x28')],_0x2a0329[_0x8ea2('0x29')]][_0x8ea2('0x2a')]('|')));};VoiceAgentReport['prototype'][_0x8ea2('0x2b')]=function(_0x218bd0,_0x5c057a){return moment(_0x218bd0)[_0x8ea2('0x2c')](_0x5c057a,_0x8ea2('0x2d'))[_0x8ea2('0x25')](_0x8ea2('0x2e'));};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x2f')]=function(_0x199417,_0x1e4cc9){return moment(_0x199417)[_0x8ea2('0x30')](moment(_0x1e4cc9),'seconds');};VoiceAgentReport[_0x8ea2('0x22')]['syncAgentCalled']=function(_0x2660cc){try{var _0x42bec8=this[_0x8ea2('0xc')][_0x2660cc['interface']];if(!_['isNil'](_0x42bec8)){_0x42bec8=_[_0x8ea2('0x31')](_0x42bec8,{'queue':_0x2660cc['queue'],'destconnectedlinenum':_0x2660cc[_0x8ea2('0x29')]});io['emit'](_0x8ea2('0x32'),_0x42bec8);}var _0x12fa37=this[_0x8ea2('0xd')][_0x2660cc[_0x8ea2('0x33')]]={'agentcalledAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'calleridnum':_0x2660cc[_0x8ea2('0x29')],'calleridname':_0x2660cc['calleridname'],'connectedlinenum':_0x2660cc[_0x8ea2('0x34')],'connectedlinename':_0x2660cc[_0x8ea2('0x35')],'accountcode':_0x2660cc[_0x8ea2('0x36')],'destaccountcode':_0x2660cc[_0x8ea2('0x37')],'channel':_0x2660cc[_0x8ea2('0x38')],'destchannel':_0x2660cc[_0x8ea2('0x33')],'uniqueid':_0x2660cc[_0x8ea2('0x27')],'destuniqueid':_0x2660cc[_0x8ea2('0x39')],'destcalleridnum':_0x2660cc[_0x8ea2('0x34')],'destcalleridname':_0x2660cc[_0x8ea2('0x35')],'destexten':_0x2660cc['destexten'],'context':_0x2660cc['context'],'exten':_0x2660cc[_0x8ea2('0x28')],'priority':_0x2660cc[_0x8ea2('0x3a')],'queue':_0x2660cc['queue'],'type':this['voiceQueues'][_0x2660cc[_0x8ea2('0x3b')]]?this['voiceQueues'][_0x2660cc[_0x8ea2('0x3b')]][_0x8ea2('0x3c')]||'inbound':_0x8ea2('0x3d'),'interface':_0x2660cc[_0x8ea2('0x3e')],'mandatoryDisposition':this[_0x8ea2('0xb')][_0x2660cc['queue']]['mandatoryDisposition']||0x0,'membername':_0x2660cc['membername'],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0x8ea2('0x3f'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0x8ea2('0xc')][_0x2660cc[_0x8ea2('0x3e')]]?this['agents'][_0x2660cc[_0x8ea2('0x3e')]]['id']:null,'lastevent':_0x8ea2('0x40'),'agentacw':![],'acwtime':0x0,'variables':this[_0x8ea2('0xe')][_0x2660cc[_0x8ea2('0x38')]]?this[_0x8ea2('0xe')][_0x2660cc[_0x8ea2('0x38')]]:{}};ami[_0x8ea2('0x41')](_0x8ea2('0x42'),_0x12fa37);io['to'](util['format'](_0x8ea2('0x43'),_0x12fa37[_0x8ea2('0x44')]))[_0x8ea2('0x41')](_0x8ea2('0x45'),_0x12fa37);this['log'](_0x8ea2('0x46'),this['channels'][_0x2660cc[_0x8ea2('0x33')]]);}catch(_0x103d5a){logger[_0x8ea2('0x47')](_0x103d5a[_0x8ea2('0x48')]);}};VoiceAgentReport['prototype'][_0x8ea2('0x49')]=function(_0x531979){try{var _0x5adb84=this[_0x8ea2('0xd')][_0x531979['destchannel']];if(!_[_0x8ea2('0x4a')](_0x5adb84)){_0x5adb84=_[_0x8ea2('0x31')](_0x5adb84,{'holdtime':parseInt(_0x531979[_0x8ea2('0x4b')],0xa),'ringtime':parseInt(_0x531979[_0x8ea2('0x4c')],0xa),'agentconnect':!![],'lastevent':_0x8ea2('0x4d')});_0x5adb84['agentconnectAt']=this[_0x8ea2('0x2b')](_0x5adb84['agentcalledAt'],_0x5adb84[_0x8ea2('0x4c')]);ami[_0x8ea2('0x41')](_0x8ea2('0x4e'),_0x5adb84);io['to'](util[_0x8ea2('0x25')]('user:%s',_0x5adb84[_0x8ea2('0x44')]))['emit'](_0x8ea2('0x4f'),_0x5adb84);this['log'](_0x8ea2('0x50'),_0x5adb84);}}catch(_0x450e8f){logger[_0x8ea2('0x47')](_0x450e8f[_0x8ea2('0x48')]);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x1f')]=function(_0x2f4fa8){try{var _0x478d5c=_['find'](this[_0x8ea2('0xd')],{'channel':_0x2f4fa8['channel'],'agentconnect':!![]});if(!_['isNil'](_0x478d5c)){if(!_['isNil'](this[_0x8ea2('0xc')][_0x478d5c['interface']])){this[_0x8ea2('0xc')][_0x478d5c[_0x8ea2('0x3e')]][_0x8ea2('0x51')]=!![];this[_0x8ea2('0xc')][_0x478d5c[_0x8ea2('0x3e')]][_0x8ea2('0x52')]();}}}catch(_0x3b2219){logger[_0x8ea2('0x47')](_0x3b2219['stack']);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x21')]=function(_0x1db25c){try{var _0x5cb6ad=_[_0x8ea2('0x53')](this[_0x8ea2('0xd')],{'channel':_0x1db25c[_0x8ea2('0x38')],'agentconnect':!![]});if(!_[_0x8ea2('0x4a')](_0x5cb6ad)){if(!_[_0x8ea2('0x4a')](this['agents'][_0x5cb6ad[_0x8ea2('0x3e')]])){this[_0x8ea2('0xc')][_0x5cb6ad[_0x8ea2('0x3e')]]['onhold']=![];this[_0x8ea2('0xc')][_0x5cb6ad[_0x8ea2('0x3e')]][_0x8ea2('0x52')]();}}}catch(_0x402844){logger[_0x8ea2('0x47')](_0x402844[_0x8ea2('0x48')]);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x14')]=function(_0x45f15e){try{var _0x302eef=this[_0x8ea2('0xd')][_0x45f15e[_0x8ea2('0x33')]];if(!_[_0x8ea2('0x4a')](_0x302eef)){_0x302eef=_[_0x8ea2('0x31')](_0x302eef,{'ringtime':parseInt(_0x45f15e['ringtime'],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0x8ea2('0x54'),'lastevent':_0x8ea2('0x54')});_0x302eef[_0x8ea2('0x55')]=this[_0x8ea2('0x2b')](_0x302eef[_0x8ea2('0x56')],_0x302eef[_0x8ea2('0x4c')]);ami[_0x8ea2('0x41')](_0x8ea2('0x57'),_0x302eef);this['log'](_0x8ea2('0x58'),_0x302eef);}}catch(_0x37a1cf){logger[_0x8ea2('0x47')](_0x37a1cf['stack']);}};VoiceAgentReport['prototype'][_0x8ea2('0x15')]=function(_0x2d9d2a){try{for(var _0x7ffa4e in this['channels']){var _0x3d86f3=this[_0x8ea2('0xd')][_0x7ffa4e];if(!_[_0x8ea2('0x4a')](_0x3d86f3)&&_0x3d86f3[_0x8ea2('0x38')]==_0x2d9d2a[_0x8ea2('0x38')]){_0x3d86f3=_['assign'](_0x3d86f3,{'holdtime':parseInt(_0x2d9d2a['holdtime'],0xa),'position':parseInt(_0x2d9d2a[_0x8ea2('0x59')],0xa),'originalposition':parseInt(_0x2d9d2a[_0x8ea2('0x5a')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0x8ea2('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8ea2('0x5b'),'lastevent':_0x8ea2('0x5b')});ami[_0x8ea2('0x41')]('custom:agentqueuecallerabandon',_0x3d86f3);this['log']('CALLERABANDON',_0x3d86f3);}}}catch(_0x4fca65){logger['error'](_0x4fca65[_0x8ea2('0x48')]);}};VoiceAgentReport[_0x8ea2('0x22')]['syncAgentComplete']=function(_0x49cf11){try{var _0x1a7a75=this[_0x8ea2('0xd')][_0x49cf11[_0x8ea2('0x33')]];if(!_['isNil'](_0x1a7a75)){_0x1a7a75=_[_0x8ea2('0x31')](_0x1a7a75,{'talktime':parseInt(_0x49cf11[_0x8ea2('0x5c')],0xa),'reason':_0x49cf11['reason']==_0x8ea2('0x5d')?_0x8ea2('0x3f'):_0x49cf11[_0x8ea2('0x5e')],'agentcomplete':!![],'lastevent':_0x8ea2('0x5f'),'agentacw':this[_0x8ea2('0xb')][_0x1a7a75['queue']]&&this['voiceQueues'][_0x1a7a75['queue']][_0x8ea2('0x60')]?!![]:![],'acwtime':this[_0x8ea2('0xb')][_0x1a7a75[_0x8ea2('0x3b')]]&&this[_0x8ea2('0xb')][_0x1a7a75[_0x8ea2('0x3b')]][_0x8ea2('0x60')]?this[_0x8ea2('0xb')][_0x1a7a75['queue']]['acwTimeout']:0x0});_0x1a7a75['agentcompleteAt']=this[_0x8ea2('0x2b')](_0x1a7a75[_0x8ea2('0x61')],_0x1a7a75[_0x8ea2('0x5c')]);this[_0x8ea2('0x23')]('COMPLETE',_0x1a7a75);}}catch(_0x11824e){logger[_0x8ea2('0x47')](_0x11824e['stack']);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x62')]=function(_0x142ede){try{switch(_0x142ede[_0x8ea2('0x63')]){case 0x1a:_0x142ede=_[_0x8ea2('0x31')](_0x142ede,{'agentringnoanswer':!![],'reason':'answered_elsewhere','lastevent':'answered_elsewhere'});var _0x4e87fe=_[_0x8ea2('0x53')](this[_0x8ea2('0xd')],{'channel':_0x142ede[_0x8ea2('0x38')],'agentconnect':!![]});if(!_[_0x8ea2('0x4a')](_0x4e87fe)){_0x142ede=_[_0x8ea2('0x31')](_0x142ede,{'agentringnoanswerAt':_0x4e87fe['agentconnectAt'],'answeredelsewheremembername':_0x4e87fe[_0x8ea2('0x44')],'answeredelsewheredestinationuniqueid':_0x4e87fe[_0x8ea2('0x39')]});}ami[_0x8ea2('0x41')](_0x8ea2('0x64'),_0x142ede);break;}if(_0x142ede['agentcomplete']){ami[_0x8ea2('0x41')]('custom:agentcomplete',_0x142ede);io['to'](util[_0x8ea2('0x25')]('user:%s',_0x142ede[_0x8ea2('0x44')]))[_0x8ea2('0x41')]('user:agentcomplete',_0x142ede);}this['log'](_0x8ea2('0x65'),_0x142ede);ami['emit'](_0x8ea2('0x66'),_0x142ede);if(this[_0x8ea2('0xd')][_0x142ede[_0x8ea2('0x33')]]){delete this[_0x8ea2('0xd')][_0x142ede['destchannel']];}}catch(_0xdb3465){logger[_0x8ea2('0x47')](_0xdb3465);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x19')]=function(_0xdde79){try{var _0x212c16=this[_0x8ea2('0xd')][_0xdde79[_0x8ea2('0x38')]];if(!_[_0x8ea2('0x4a')](_0x212c16)){_0x212c16=_[_0x8ea2('0x31')](_0x212c16,{'cause':parseInt(_0xdde79[_0x8ea2('0x63')],0xa),'cause-txt':_0xdde79[_0x8ea2('0x67')]});if(_0x212c16['recalculate']){_0x212c16=_[_0x8ea2('0x31')](_0x212c16,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x8ea2('0x25')](_0x8ea2('0x2e')),'lastevent':_0x8ea2('0x5f'),'agentacw':this[_0x8ea2('0xb')][_0x212c16[_0x8ea2('0x3b')]]&&this[_0x8ea2('0xb')][_0x212c16[_0x8ea2('0x3b')]][_0x8ea2('0x60')]?!![]:![],'acwtime':this[_0x8ea2('0xb')][_0x212c16[_0x8ea2('0x3b')]]&&this[_0x8ea2('0xb')][_0x212c16['queue']][_0x8ea2('0x60')]?this[_0x8ea2('0xb')][_0x212c16[_0x8ea2('0x3b')]][_0x8ea2('0x68')]:0x0});_0x212c16[_0x8ea2('0x5c')]=this['diffTime'](_0x212c16['agentcompleteAt'],_0x212c16['agentconnectAt']);}var _0x17f2f2=this[_0x8ea2('0xc')][_0x212c16[_0x8ea2('0x3e')]];if(!_[_0x8ea2('0x4a')](_0x17f2f2)){_0x17f2f2=_[_0x8ea2('0x31')](_0x17f2f2,{'queue':null,'destconnectedlinenum':null});io[_0x8ea2('0x41')]('user:save',_0x17f2f2);}setTimeout(this[_0x8ea2('0x62')][_0x8ea2('0x11')](this,_0x212c16),0x3e8);}if(this['variables'][_0xdde79['channel']]){delete this[_0x8ea2('0xe')][_0xdde79[_0x8ea2('0x38')]];}}catch(_0x1bf4cb){logger[_0x8ea2('0x47')](_0x1bf4cb[_0x8ea2('0x48')]);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x1b')]=function(_0x575a01){try{var _0x435233=this[_0x8ea2('0xd')][_0x575a01[_0x8ea2('0x69')]];if(!_[_0x8ea2('0x4a')](_0x435233)){_0x435233=_['assign'](_0x435233,{'transfer':!![],'transferAt':moment()[_0x8ea2('0x25')](_0x8ea2('0x2e')),'transfertype':_0x8ea2('0x6a'),'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0x8ea2('0x2e')),'transferuniqueid':_0x575a01['secondtransfereruniqueid'],'transfercontext':_0x575a01['secondtransfererexten'],'transferextension':_0x575a01[_0x8ea2('0x6b')],'reason':_0x8ea2('0x5d'),'lastevent':'complete','agentacw':this['voiceQueues'][_0x435233['queue']]&&this[_0x8ea2('0xb')][_0x435233['queue']]['acw']?!![]:![],'acwtime':this[_0x8ea2('0xb')][_0x435233[_0x8ea2('0x3b')]]&&this[_0x8ea2('0xb')][_0x435233[_0x8ea2('0x3b')]][_0x8ea2('0x60')]?this[_0x8ea2('0xb')][_0x435233[_0x8ea2('0x3b')]][_0x8ea2('0x68')]:0x0});_0x435233[_0x8ea2('0x5c')]=this[_0x8ea2('0x2f')](_0x435233[_0x8ea2('0x6c')],_0x435233[_0x8ea2('0x61')]);this[_0x8ea2('0x23')](_0x8ea2('0x6a'),_0x435233);}if(!_['isNil'](this[_0x8ea2('0xd')][_0x575a01[_0x8ea2('0x6d')]])){this[_0x8ea2('0xd')][_0x575a01['transfertargetchannel']][_0x8ea2('0x6e')]=!![];}}catch(_0x486ae8){logger[_0x8ea2('0x47')](_0x486ae8['stack']);}};VoiceAgentReport[_0x8ea2('0x22')]['syncBlindTransfer']=function(_0x321d6f){try{var _0x165052=this['channels'][_0x321d6f[_0x8ea2('0x6f')]];if(!_['isNil'](_0x165052)){_0x165052=_[_0x8ea2('0x31')](_0x165052,{'transfer':!![],'transferAt':moment()[_0x8ea2('0x25')](_0x8ea2('0x2e')),'transfertype':_0x8ea2('0x70'),'transferuniqueid':_0x321d6f[_0x8ea2('0x71')],'transfercontext':_0x321d6f['context'],'transferextension':_0x321d6f['extension'],'agentcomplete':!![],'agentcompleteAt':moment()[_0x8ea2('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8ea2('0x5d'),'lastevent':_0x8ea2('0x5f'),'agentacw':this[_0x8ea2('0xb')][_0x165052[_0x8ea2('0x3b')]]&&this[_0x8ea2('0xb')][_0x165052[_0x8ea2('0x3b')]]['acw']?!![]:![],'acwtime':this['voiceQueues'][_0x165052['queue']]&&this[_0x8ea2('0xb')][_0x165052['queue']][_0x8ea2('0x60')]?this[_0x8ea2('0xb')][_0x165052[_0x8ea2('0x3b')]][_0x8ea2('0x68')]:0x0});_0x165052[_0x8ea2('0x6e')]=!![];this[_0x8ea2('0x23')]('BLIND',_0x165052);}}catch(_0x1a79f7){logger[_0x8ea2('0x47')](_0x1a79f7[_0x8ea2('0x48')]);}};VoiceAgentReport[_0x8ea2('0x22')][_0x8ea2('0x18')]=function(_0x5d60b3){var _0x47e585=[_0x8ea2('0x72'),_0x8ea2('0x73'),_0x8ea2('0x74'),_0x8ea2('0x75'),_0x8ea2('0x76'),_0x8ea2('0x77'),_0x8ea2('0x78'),_0x8ea2('0x79'),_0x8ea2('0x7a'),_0x8ea2('0x7b'),_0x8ea2('0x7c'),_0x8ea2('0x7d'),_0x8ea2('0x7e'),_0x8ea2('0x7f'),_0x8ea2('0x80'),_0x8ea2('0x81'),_0x8ea2('0x44'),'memberpenalty','memberrealtime'];try{var _0x222705=_['keys'](_0x5d60b3[_0x8ea2('0x82')])[0x0];if(!_[_0x8ea2('0x4a')](_0x222705)&&!_['includes'](_0x47e585,_0x222705)){if(!this[_0x8ea2('0xe')][_0x5d60b3['channel']]){this[_0x8ea2('0xe')][_0x5d60b3[_0x8ea2('0x38')]]={};}this['variables'][_0x5d60b3[_0x8ea2('0x38')]][_0x222705]=_0x5d60b3[_0x8ea2('0x83')];}}catch(_0x1131e1){logger[_0x8ea2('0x47')](_0x1131e1[_0x8ea2('0x48')]);}};module[_0x8ea2('0x84')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index eda1579..105c8cf 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53a6=['linkedid','merge','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','format','toNumber','channelstate','pick','from-sip','split','destconnectedlinenum','exten','user:%s','name','accountcode','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','starttime','duration','subtract','seconds','disposition','includes','lastdata','startsWith','cdr(','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','context','transfererchannel','isNil','mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','moment','path','ioredis','../../../config/environment','ami','../ami','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','log','isNotNull','isUndefined','emit','prototype','syncNewCallerId','uniqueid'];(function(_0x5a037a,_0x44a3fc){var _0x28ff57=function(_0x13d49f){while(--_0x13d49f){_0x5a037a['push'](_0x5a037a['shift']());}};_0x28ff57(++_0x44a3fc);}(_0x53a6,0x18f));var _0x653a=function(_0x2c01e7,_0x404cef){_0x2c01e7=_0x2c01e7-0x0;var _0x29f53c=_0x53a6[_0x2c01e7];return _0x29f53c;};'use strict';var BPromise=require(_0x653a('0x0'));var _=require('lodash');var moment=require(_0x653a('0x1'));var util=require('util');var path=require(_0x653a('0x2'));var Redis=require(_0x653a('0x3'));var config=require(_0x653a('0x4'));var logger=require('../../../config/logger')(_0x653a('0x5'));var ami=require(_0x653a('0x6'));var Channel=require('../model/channel');var statusDesc=['unknown',_0x653a('0x7'),_0x653a('0x8'),_0x653a('0x9'),_0x653a('0xa'),_0x653a('0xb'),_0x653a('0xc'),'ringinuse',_0x653a('0xd')];var applications=[_0x653a('0xe'),_0x653a('0xf'),_0x653a('0x10'),_0x653a('0x11'),_0x653a('0x12'),_0x653a('0x13')];var dispositions=[_0x653a('0x14'),_0x653a('0x15'),_0x653a('0x15'),_0x653a('0x14'),_0x653a('0x14'),_0x653a('0x14'),_0x653a('0x16'),_0x653a('0x17'),_0x653a('0x15'),_0x653a('0x15'),_0x653a('0x15')];var actions={};config[_0x653a('0x18')]=_[_0x653a('0x19')](config[_0x653a('0x18')],{'host':_0x653a('0x1a'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x653a('0x18')]));function VoiceCallReport(_0x2dbf5f){this[_0x653a('0x1b')]=_0x2dbf5f['channels'];this[_0x653a('0x1c')]=_0x2dbf5f['agents'];ami['on'](_0x653a('0x1d'),this[_0x653a('0x1e')]['bind'](this));ami['on'](_0x653a('0x1f'),this[_0x653a('0x1e')][_0x653a('0x20')](this));ami['on'](_0x653a('0x21'),this['syncNewChannel'][_0x653a('0x20')](this));ami['on'](_0x653a('0x22'),this['syncNewState']['bind'](this));ami['on'](_0x653a('0x23'),this[_0x653a('0x24')][_0x653a('0x20')](this));ami['on'](_0x653a('0x25'),this[_0x653a('0x26')][_0x653a('0x20')](this));ami['on'](_0x653a('0x27'),this['syncNewCallerId'][_0x653a('0x20')](this));ami['on']('attendedtransfer',this[_0x653a('0x28')][_0x653a('0x20')](this));ami['on'](_0x653a('0x29'),this[_0x653a('0x2a')][_0x653a('0x20')](this));ami['on'](_0x653a('0x2b'),this[_0x653a('0x2c')][_0x653a('0x20')](this));ami['on'](_0x653a('0x2d'),this[_0x653a('0x2e')][_0x653a('0x20')](this));return BPromise[_0x653a('0x2f')]()[_0x653a('0x30')](ami['actionCoreShowChannels']())[_0x653a('0x31')](function(_0x768d7f){console[_0x653a('0x32')](_0x768d7f);});}VoiceCallReport['prototype'][_0x653a('0x33')]=function(_0x25ac2a){return _0x25ac2a!==null&&!_[_0x653a('0x34')](_0x25ac2a);};VoiceCallReport['prototype'][_0x653a('0x35')]=function(_0xefa6cb,_0x25ba64,_0x1d2fcf){io['to'](_0xefa6cb)['emit'](_0x25ba64,_0x1d2fcf);};VoiceCallReport[_0x653a('0x36')][_0x653a('0x37')]=function(_0x4626c5){try{if(this[_0x653a('0x33')](_0x4626c5)){if(_0x4626c5[_0x653a('0x38')]===_0x4626c5[_0x653a('0x39')]){if(!_[_0x653a('0x34')](this['channels'][_0x4626c5[_0x653a('0x38')]])){_[_0x653a('0x3a')](this[_0x653a('0x1b')][_0x4626c5['uniqueid']],_['pick'](_0x4626c5,_[_0x653a('0x3b')](this[_0x653a('0x1b')][_0x4626c5[_0x653a('0x38')]])));}}}}catch(_0x112731){logger[_0x653a('0x3c')](_0x653a('0x3d'),util[_0x653a('0x3e')](_0x112731,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x653a('0x3f')]=function(_0x32e0ff){try{if(this[_0x653a('0x33')](_0x32e0ff)){if(_0x32e0ff['uniqueid']===_0x32e0ff[_0x653a('0x39')]&&_0x32e0ff[_0x653a('0x40')]!='OutgoingSpoolFailed'){if(_[_0x653a('0x34')](this[_0x653a('0x1b')][_0x32e0ff[_0x653a('0x38')]])){this[_0x653a('0x1b')][_0x32e0ff[_0x653a('0x38')]]=new Channel();this['channels'][_0x32e0ff[_0x653a('0x38')]]['starttime']=moment()[_0x653a('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x653a('0x1b')][_0x32e0ff[_0x653a('0x38')]]['disposition']=dispositions[_[_0x653a('0x42')](_0x32e0ff[_0x653a('0x43')])];_['merge'](this[_0x653a('0x1b')][_0x32e0ff[_0x653a('0x38')]],_[_0x653a('0x44')](_0x32e0ff,_[_0x653a('0x3b')](this[_0x653a('0x1b')][_0x32e0ff['uniqueid']])));if(_0x32e0ff['context']===_0x653a('0x45')){if(this['agents'][_0x32e0ff[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]){this['agents'][_0x32e0ff[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]][_0x653a('0x47')]=_0x32e0ff[_0x653a('0x48')];this['emit'](util[_0x653a('0x41')](_0x653a('0x49'),this[_0x653a('0x1c')][_0x32e0ff[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]][_0x653a('0x4a')]),'user:agentconnect',{'destaccountcode':this[_0x653a('0x1c')][_0x32e0ff[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]][_0x653a('0x4b')],'destconnectedlinenum':_0x32e0ff[_0x653a('0x48')]});}}}}}}catch(_0x134830){logger[_0x653a('0x3c')](_0x653a('0x4c'),util[_0x653a('0x3e')](_0x134830,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x1e')]=function(_0x2a0be1){try{if(this['isNotNull'](_0x2a0be1)){if(_0x2a0be1['uniqueid']===_0x2a0be1[_0x653a('0x39')]&&_0x2a0be1[_0x653a('0x48')]!='h'&&_0x2a0be1[_0x653a('0x40')]!=_0x653a('0x4d')){_0x2a0be1[_0x653a('0x4e')]=_0x2a0be1[_0x653a('0x4e')][_0x653a('0x4f')]();_0x2a0be1[_0x653a('0x50')]=(_0x2a0be1['appdata']||_0x2a0be1[_0x653a('0x50')])[_0x653a('0x4f')]();if(_[_0x653a('0x34')](this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]])){this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]]=new Channel();this[_0x653a('0x1b')][_0x2a0be1['uniqueid']][_0x653a('0x51')]=_0x2a0be1[_0x653a('0x52')]?moment()[_0x653a('0x53')](moment['duration'](_0x2a0be1['duration'])[_0x653a('0x54')](),_0x653a('0x54'))[_0x653a('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x653a('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2a0be1['uniqueid']][_0x653a('0x55')]=_0x653a('0x14');}_['merge'](this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]],_[_0x653a('0x44')](_0x2a0be1,_[_0x653a('0x3b')](this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]])));if(_[_0x653a('0x56')](applications,_0x2a0be1[_0x653a('0x4e')])){this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]]['lastapplication']=_0x2a0be1['application'];this['channels'][_0x2a0be1['uniqueid']][_0x653a('0x57')]=_0x2a0be1[_0x653a('0x50')];if(_0x2a0be1['application']==='set'&&_[_0x653a('0x58')](_0x2a0be1[_0x653a('0x50')],_0x653a('0x59'))){var _0x5b7378=_0x2a0be1[_0x653a('0x50')][_0x653a('0x46')]('=');var _0x510b18=_0x5b7378[0x0]['match'](/cdr\((.*)\)/);if(_0x510b18){this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]][_0x510b18[0x1]]=_0x5b7378[0x1];}}else if(_0x2a0be1['application']==='queue'){this[_0x653a('0x1b')][_0x2a0be1[_0x653a('0x38')]][_0x653a('0xf')]=_0x2a0be1['applicationdata'][_0x653a('0x46')](',')[0x0];}}}}}catch(_0x1f7900){logger['error'](_0x653a('0x5a'),util[_0x653a('0x3e')](_0x1f7900,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x5b')]=function(_0x54b548){try{if(this['isNotNull'](_0x54b548)){if(_0x54b548[_0x653a('0x38')]!==_0x54b548[_0x653a('0x39')]){if(this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]]){if(_0x54b548[_0x653a('0x43')]==='6'){if(!this['channels'][_0x54b548['linkedid']][_0x653a('0x5c')]){var _0x3bc9ee=moment();this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]]['answered']=!![];this['channels'][_0x54b548['linkedid']][_0x653a('0x5d')]=_0x3bc9ee['format'](_0x653a('0x5e'));if(this[_0x653a('0x1b')][_0x54b548['linkedid']]['starttime']){this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]][_0x653a('0x5f')]=_0x3bc9ee[_0x653a('0x60')](this[_0x653a('0x1b')][_0x54b548['linkedid']][_0x653a('0x51')],_0x653a('0x54'));}}this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]][_0x653a('0x39')]=_0x54b548['uniqueid'];if(_0x54b548[_0x653a('0x61')]!=='xcally-motion-preview'){this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]][_0x653a('0x62')]=_0x54b548['calleridnum'];}this[_0x653a('0x1b')][_0x54b548['linkedid']][_0x653a('0x63')]=_0x54b548[_0x653a('0x64')];this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]][_0x653a('0x65')]=_0x54b548[_0x653a('0x40')];this['channels'][_0x54b548[_0x653a('0x39')]][_0x653a('0x55')]=dispositions[_[_0x653a('0x42')](_0x54b548[_0x653a('0x43')])];if(this[_0x653a('0x1c')][_0x54b548[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]){this['channels'][_0x54b548[_0x653a('0x39')]]['UserId']=this[_0x653a('0x1c')][_0x54b548['channel'][_0x653a('0x46')]('-')[0x0]]['id'];this[_0x653a('0x1b')][_0x54b548[_0x653a('0x39')]][_0x653a('0x66')]=this[_0x653a('0x1c')][_0x54b548[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]['name'];}}}}else{if(this[_0x653a('0x1b')][_0x54b548[_0x653a('0x38')]]){if(_0x54b548[_0x653a('0x43')]==='6'){if(this['agents'][_0x54b548[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]){this[_0x653a('0x1b')][_0x54b548[_0x653a('0x38')]][_0x653a('0x67')]=this['agents'][_0x54b548[_0x653a('0x40')]['split']('-')[0x0]]['id'];this[_0x653a('0x1b')][_0x54b548['uniqueid']][_0x653a('0x66')]=this[_0x653a('0x1c')][_0x54b548[_0x653a('0x40')]['split']('-')[0x0]][_0x653a('0x4a')];}}}}}}catch(_0x192cfd){logger[_0x653a('0x3c')](_0x653a('0x68'),util[_0x653a('0x3e')](_0x192cfd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x69')]=function(_0x19fb17,_0x25fb5e){if(this[_0x653a('0x1b')][_0x19fb17]){this[_0x653a('0x1b')][_0x19fb17][_0x653a('0x6a')]=!![];if(_['endsWith'](_0x25fb5e,_0x653a('0x6b'))){_0x25fb5e=_0x25fb5e[_0x653a('0x6c')](_0x653a('0x6b'),_0x653a('0x6d'));}this[_0x653a('0x1b')][_0x19fb17][_0x653a('0x6e')]=_0x25fb5e;var _0x2d04fd=_[_0x653a('0x6f')](this[_0x653a('0x1b')][_0x19fb17][_0x653a('0x70')],{'filename':_0x25fb5e});if(_['isNil'](_0x2d04fd)){this['channels'][_0x19fb17][_0x653a('0x70')][_0x653a('0x71')]({'filename':_0x25fb5e,'createdAt':moment()[_0x653a('0x41')](_0x653a('0x5e')),'mixmonitorid':'','status':_0x653a('0x72')});}}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x24')]=function(_0xeff0c5){try{if(this['isNotNull'](_0xeff0c5)){if(this[_0x653a('0x1b')][_0xeff0c5[_0x653a('0x38')]]&&_0xeff0c5[_0x653a('0x40')]!=_0x653a('0x4d')){if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')])){if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x74')])){this[_0x653a('0x69')](_0xeff0c5[_0x653a('0x38')],_0xeff0c5[_0x653a('0x75')]);}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x76')])){this[_0x653a('0x1b')][_0xeff0c5[_0x653a('0x38')]][_0x653a('0x61')]=_0xeff0c5[_0x653a('0x75')];}else if(this[_0x653a('0x33')](_0xeff0c5['variable'][_0x653a('0x77')])){this['channels'][_0xeff0c5['uniqueid']][_0x653a('0x78')]=_0xeff0c5['value'];}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x79')])){this[_0x653a('0x1b')][_0xeff0c5[_0x653a('0x38')]][_0x653a('0x7a')]=_0xeff0c5[_0x653a('0x75')];}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x7b')])){this[_0x653a('0x1b')][_0xeff0c5['uniqueid']]['queue']=_0xeff0c5[_0x653a('0x75')][_0x653a('0x46')](',')[0x0];}else if(this['isNotNull'](_0xeff0c5[_0x653a('0x73')][_0x653a('0x7c')])){this[_0x653a('0x1b')][_0xeff0c5['uniqueid']][_0x653a('0x7d')]=_0xeff0c5[_0x653a('0x75')];}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x7e')])){this['channels'][_0xeff0c5['uniqueid']]['destination']=_0xeff0c5['value'];}else if(this['isNotNull'](_0xeff0c5['variable']['xmd-callerid-preview'])){this['channels'][_0xeff0c5[_0x653a('0x38')]]['calleridpreview']=_0xeff0c5[_0x653a('0x75')];}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')]['xmcs-queue'])){this['channels'][_0xeff0c5[_0x653a('0x38')]][_0x653a('0xf')]=_0xeff0c5[_0x653a('0x75')];}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x7f')])){this[_0x653a('0x1b')][_0xeff0c5[_0x653a('0x38')]][_0x653a('0x80')]=_0xeff0c5[_0x653a('0x75')];}}}else if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x74')])){if(_0xeff0c5[_0x653a('0x75')]){var _0x19231b=path['parse'](_0xeff0c5[_0x653a('0x75')])[_0x653a('0x4a')];this[_0x653a('0x69')](_0x19231b,_0xeff0c5[_0x653a('0x75')]);}}else if(this['channels'][_0xeff0c5[_0x653a('0x39')]]){if(this['isNotNull'](_0xeff0c5[_0x653a('0x73')])){if(this[_0x653a('0x33')](_0xeff0c5[_0x653a('0x73')][_0x653a('0x7f')])){this['channels'][_0xeff0c5[_0x653a('0x39')]][_0x653a('0x81')]=_0xeff0c5[_0x653a('0x75')];}}}}}catch(_0x1db6e6){logger[_0x653a('0x3c')](_0x653a('0x82'),util[_0x653a('0x3e')](_0x1db6e6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x26')]=function(_0x12e6bf){try{if(this[_0x653a('0x33')](_0x12e6bf)){if(this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]]){var _0x958a6d=moment();this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]][_0x653a('0x83')]=_0x958a6d[_0x653a('0x41')](_0x653a('0x5e'));this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]][_0x653a('0x52')]=_0x958a6d[_0x653a('0x60')](this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]]['starttime'],_0x653a('0x54'));if(this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]][_0x653a('0x5c')]){this[_0x653a('0x1b')][_0x12e6bf['uniqueid']]['billableseconds']=_0x958a6d['diff'](this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]]['answertime'],_0x653a('0x54'));this[_0x653a('0x1b')][_0x12e6bf['uniqueid']]['holdtime']=this[_0x653a('0x1b')][_0x12e6bf[_0x653a('0x38')]][_0x653a('0x52')]-this[_0x653a('0x1b')][_0x12e6bf['uniqueid']][_0x653a('0x84')];}if(_0x12e6bf['context']==='from-sip'){if(this[_0x653a('0x1c')][_0x12e6bf[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]){this[_0x653a('0x1c')][_0x12e6bf[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]]=_['omit'](this[_0x653a('0x1c')][_0x12e6bf['channel'][_0x653a('0x46')]('-')[0x0]],['destconnectedlinenum']);this[_0x653a('0x35')](util[_0x653a('0x41')](_0x653a('0x49'),this[_0x653a('0x1c')][_0x12e6bf[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]][_0x653a('0x4a')]),_0x653a('0x85'),{'destaccountcode':this[_0x653a('0x1c')][_0x12e6bf[_0x653a('0x40')][_0x653a('0x46')]('-')[0x0]][_0x653a('0x4b')]});}}ami[_0x653a('0x35')](_0x653a('0x86'),this['channels'][_0x12e6bf[_0x653a('0x38')]]);delete this[_0x653a('0x1b')][_0x12e6bf['uniqueid']];}}}catch(_0x416b70){logger['error'](_0x653a('0x87'),util[_0x653a('0x3e')](_0x416b70,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x28')]=function(_0x5c0cca){try{if(this[_0x653a('0x33')](_0x5c0cca)){if(this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x88')]]){this['channels'][_0x5c0cca['transfereeuniqueid']][_0x653a('0x89')]=_0x5c0cca['origtransferercalleridnum'];this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x88')]][_0x653a('0x8a')]=_0x5c0cca[_0x653a('0x8b')];if(this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x8c')]]){var _0x3cb0e8=this['channels'][_0x5c0cca[_0x653a('0x8c')]];this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x8c')]]=this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x88')]];this['channels'][_0x5c0cca[_0x653a('0x88')]]=_0x3cb0e8;}}else if(this[_0x653a('0x1b')][_0x5c0cca['transfertargetuniqueid']]){this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x8d')]][_0x653a('0x89')]=_0x5c0cca[_0x653a('0x8e')];this['channels'][_0x5c0cca[_0x653a('0x8d')]][_0x653a('0x8a')]=_0x5c0cca[_0x653a('0x8b')];if(this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x8f')]]){var _0x3cb0e8=this['channels'][_0x5c0cca[_0x653a('0x8f')]];this[_0x653a('0x1b')][_0x5c0cca['origtransfereruniqueid']]=this['channels'][_0x5c0cca[_0x653a('0x8d')]];this[_0x653a('0x1b')][_0x5c0cca[_0x653a('0x8d')]]=_0x3cb0e8;}}}}catch(_0x228ab6){logger['error'](_0x653a('0x90'),util[_0x653a('0x3e')](_0x228ab6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')]['syncBlindTransfer']=function(_0x4c7890){try{if(this['isNotNull'](_0x4c7890)){if(this[_0x653a('0x1b')][_0x4c7890[_0x653a('0x88')]]){this[_0x653a('0x1b')][_0x4c7890['transfereeuniqueid']][_0x653a('0x89')]=_0x4c7890[_0x653a('0x91')];this[_0x653a('0x1b')][_0x4c7890[_0x653a('0x88')]]['transferconnectedlinenum']=_0x4c7890[_0x653a('0x92')];this[_0x653a('0x26')]({'event':'BlindTransfer','uniqueid':_0x4c7890['transfereeuniqueid'],'context':_0x4c7890[_0x653a('0x93')],'channel':_0x4c7890[_0x653a('0x94')]});}}}catch(_0x4dfffc){logger[_0x653a('0x3c')]('[syncBlindTransfer][VoiceCallReport]',util[_0x653a('0x3e')](_0x4dfffc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')][_0x653a('0x2c')]=function(_0x301303){try{if(this['isNotNull'](_0x301303)){if(this[_0x653a('0x1b')][_0x301303[_0x653a('0x38')]]){if(!_[_0x653a('0x95')](this[_0x653a('0x1b')][_0x301303[_0x653a('0x38')]][_0x653a('0x5d')])){this[_0x653a('0x1b')][_0x301303[_0x653a('0x38')]][_0x653a('0x96')]=moment()[_0x653a('0x41')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0xf74cf1){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x653a('0x3e')](_0xf74cf1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x653a('0x36')]['syncMusicOnHoldStop']=function(_0x3930aa){try{if(this[_0x653a('0x33')](_0x3930aa)){if(this[_0x653a('0x1b')][_0x3930aa[_0x653a('0x38')]]){if(!_[_0x653a('0x95')](this['channels'][_0x3930aa[_0x653a('0x38')]][_0x653a('0x96')])){this[_0x653a('0x1b')][_0x3930aa['uniqueid']]['mohtime']+=moment()['milliseconds'](0x0)[_0x653a('0x60')](this[_0x653a('0x1b')][_0x3930aa[_0x653a('0x38')]][_0x653a('0x96')],_0x653a('0x54'));delete this['channels'][_0x3930aa[_0x653a('0x38')]][_0x653a('0x96')];}}}}catch(_0x51a4bb){logger[_0x653a('0x3c')](_0x653a('0x97'),util[_0x653a('0x3e')](_0x51a4bb,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x83fe=['disposition','toNumber','UserId','membername','[syncNewState][VoiceCallReport]','monitor','endsWith','replace','.WAV','find','monitors','push','variable','mixmonitor_filename','syncMixMonitorFilename','value','xmd-phone','callerid','xmd-cdrtype','type','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','diff','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','transfererchannel','isNil','mohtime','milliseconds','mohstarttime','bluebird','lodash','moment','ioredis','../../../config/logger','ami','../model/channel','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','blindtransfer','syncBlindTransfer','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','isNotNull','isUndefined','prototype','emit','uniqueid','linkedid','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed','starttime','YYYY-MM-DD\x20HH:mm:ss','channelstate','merge','pick','context','from-sip','split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','syncNewExten','application','applicationdata','appdata','toLowerCase','duration','subtract','seconds','includes','startsWith','answered','answertime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel'];(function(_0x5b3e28,_0x2ad693){var _0x21a6f4=function(_0xea4216){while(--_0xea4216){_0x5b3e28['push'](_0x5b3e28['shift']());}};_0x21a6f4(++_0x2ad693);}(_0x83fe,0xc5));var _0xe83f=function(_0x3863a8,_0x54ea4e){_0x3863a8=_0x3863a8-0x0;var _0x2e3ce9=_0x83fe[_0x3863a8];return _0x2e3ce9;};'use strict';var BPromise=require(_0xe83f('0x0'));var _=require(_0xe83f('0x1'));var moment=require(_0xe83f('0x2'));var util=require('util');var path=require('path');var Redis=require(_0xe83f('0x3'));var config=require('../../../config/environment');var logger=require(_0xe83f('0x4'))(_0xe83f('0x5'));var ami=require('../ami');var Channel=require(_0xe83f('0x6'));var statusDesc=['unknown','not_inuse','inuse','busy',_0xe83f('0x7'),_0xe83f('0x8'),_0xe83f('0x9'),_0xe83f('0xa'),_0xe83f('0xb')];var applications=[_0xe83f('0xc'),_0xe83f('0xd'),'agi',_0xe83f('0xe'),_0xe83f('0xf'),'voicemail'];var dispositions=['NO\x20ANSWER','FAILED',_0xe83f('0x10'),_0xe83f('0x11'),'NO\x20ANSWER',_0xe83f('0x11'),_0xe83f('0x12'),_0xe83f('0x13'),'FAILED',_0xe83f('0x10'),_0xe83f('0x10')];var actions={};config[_0xe83f('0x14')]=_[_0xe83f('0x15')](config[_0xe83f('0x14')],{'host':'localhost','port':0x18eb});var io=require(_0xe83f('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x45ae33){this[_0xe83f('0x17')]=_0x45ae33[_0xe83f('0x17')];this[_0xe83f('0x18')]=_0x45ae33[_0xe83f('0x18')];ami['on'](_0xe83f('0x19'),this['syncNewExten'][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x1b'),this['syncNewExten'][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x1c'),this['syncNewChannel'][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x1d'),this[_0xe83f('0x1e')]['bind'](this));ami['on'](_0xe83f('0x1f'),this[_0xe83f('0x20')][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x21'),this[_0xe83f('0x22')][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x23'),this[_0xe83f('0x24')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xe83f('0x1a')](this));ami['on'](_0xe83f('0x25'),this[_0xe83f('0x26')]['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xe83f('0x1a')](this));ami['on']('musiconholdstop',this[_0xe83f('0x27')]['bind'](this));return BPromise[_0xe83f('0x28')]()[_0xe83f('0x29')](ami[_0xe83f('0x2a')]())['catch'](function(_0x2bb352){console[_0xe83f('0x2b')](_0x2bb352);});}VoiceCallReport['prototype'][_0xe83f('0x2c')]=function(_0x44fc80){return _0x44fc80!==null&&!_[_0xe83f('0x2d')](_0x44fc80);};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x2f')]=function(_0x5c90d9,_0x538a70,_0x1186b8){io['to'](_0x5c90d9)[_0xe83f('0x2f')](_0x538a70,_0x1186b8);};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x24')]=function(_0x4db0e5){try{if(this['isNotNull'](_0x4db0e5)){if(_0x4db0e5[_0xe83f('0x30')]===_0x4db0e5[_0xe83f('0x31')]){if(!_['isUndefined'](this[_0xe83f('0x17')][_0x4db0e5['uniqueid']])){_['merge'](this[_0xe83f('0x17')][_0x4db0e5['uniqueid']],_['pick'](_0x4db0e5,_[_0xe83f('0x32')](this[_0xe83f('0x17')][_0x4db0e5[_0xe83f('0x30')]])));}}}}catch(_0xf2e2f6){logger[_0xe83f('0x33')](_0xe83f('0x34'),util[_0xe83f('0x35')](_0xf2e2f6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x36')]=function(_0x43566d){try{if(this[_0xe83f('0x2c')](_0x43566d)){if(_0x43566d[_0xe83f('0x30')]===_0x43566d[_0xe83f('0x31')]&&_0x43566d[_0xe83f('0x37')]!=_0xe83f('0x38')){if(_[_0xe83f('0x2d')](this[_0xe83f('0x17')][_0x43566d[_0xe83f('0x30')]])){this[_0xe83f('0x17')][_0x43566d[_0xe83f('0x30')]]=new Channel();this[_0xe83f('0x17')][_0x43566d['uniqueid']][_0xe83f('0x39')]=moment()['format'](_0xe83f('0x3a'));this[_0xe83f('0x17')][_0x43566d[_0xe83f('0x30')]]['disposition']=dispositions[_['toNumber'](_0x43566d[_0xe83f('0x3b')])];_[_0xe83f('0x3c')](this[_0xe83f('0x17')][_0x43566d['uniqueid']],_[_0xe83f('0x3d')](_0x43566d,_['keys'](this[_0xe83f('0x17')][_0x43566d[_0xe83f('0x30')]])));if(_0x43566d[_0xe83f('0x3e')]===_0xe83f('0x3f')){if(this[_0xe83f('0x18')][_0x43566d[_0xe83f('0x37')]['split']('-')[0x0]]){this[_0xe83f('0x18')][_0x43566d['channel'][_0xe83f('0x40')]('-')[0x0]][_0xe83f('0x41')]=_0x43566d[_0xe83f('0x42')];this[_0xe83f('0x2f')](util[_0xe83f('0x43')](_0xe83f('0x44'),this[_0xe83f('0x18')][_0x43566d['channel'][_0xe83f('0x40')]('-')[0x0]][_0xe83f('0x45')]),_0xe83f('0x46'),{'destaccountcode':this[_0xe83f('0x18')][_0x43566d[_0xe83f('0x37')]['split']('-')[0x0]][_0xe83f('0x47')],'destconnectedlinenum':_0x43566d[_0xe83f('0x42')]});}}}}}}catch(_0x30fde6){logger[_0xe83f('0x33')](_0xe83f('0x48'),util[_0xe83f('0x35')](_0x30fde6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x49')]=function(_0x498cf4){try{if(this['isNotNull'](_0x498cf4)){if(_0x498cf4[_0xe83f('0x30')]===_0x498cf4['linkedid']&&_0x498cf4['exten']!='h'&&_0x498cf4[_0xe83f('0x37')]!=_0xe83f('0x38')){_0x498cf4[_0xe83f('0x4a')]=_0x498cf4[_0xe83f('0x4a')]['toLowerCase']();_0x498cf4[_0xe83f('0x4b')]=(_0x498cf4[_0xe83f('0x4c')]||_0x498cf4['applicationdata'])[_0xe83f('0x4d')]();if(_[_0xe83f('0x2d')](this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]])){this['channels'][_0x498cf4[_0xe83f('0x30')]]=new Channel();this[_0xe83f('0x17')][_0x498cf4['uniqueid']][_0xe83f('0x39')]=_0x498cf4[_0xe83f('0x4e')]?moment()[_0xe83f('0x4f')](moment[_0xe83f('0x4e')](_0x498cf4[_0xe83f('0x4e')])[_0xe83f('0x50')](),'seconds')[_0xe83f('0x43')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xe83f('0x43')](_0xe83f('0x3a'));this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]]['disposition']=_0xe83f('0x11');}_[_0xe83f('0x3c')](this[_0xe83f('0x17')][_0x498cf4['uniqueid']],_[_0xe83f('0x3d')](_0x498cf4,_[_0xe83f('0x32')](this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]])));if(_[_0xe83f('0x51')](applications,_0x498cf4['application'])){this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]]['lastapplication']=_0x498cf4[_0xe83f('0x4a')];this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]]['lastdata']=_0x498cf4[_0xe83f('0x4b')];if(_0x498cf4['application']===_0xe83f('0xc')&&_[_0xe83f('0x52')](_0x498cf4[_0xe83f('0x4b')],'cdr(')){var _0x24f157=_0x498cf4[_0xe83f('0x4b')][_0xe83f('0x40')]('=');var _0x2b4813=_0x24f157[0x0]['match'](/cdr\((.*)\)/);if(_0x2b4813){this[_0xe83f('0x17')][_0x498cf4[_0xe83f('0x30')]][_0x2b4813[0x1]]=_0x24f157[0x1];}}else if(_0x498cf4[_0xe83f('0x4a')]==='queue'){this['channels'][_0x498cf4[_0xe83f('0x30')]][_0xe83f('0xd')]=_0x498cf4[_0xe83f('0x4b')][_0xe83f('0x40')](',')[0x0];}}}}}catch(_0x468b6c){logger[_0xe83f('0x33')]('[syncNewExten][VoiceCallReport]',util['inspect'](_0x468b6c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x1e')]=function(_0x160958){try{if(this[_0xe83f('0x2c')](_0x160958)){if(_0x160958[_0xe83f('0x30')]!==_0x160958[_0xe83f('0x31')]){if(this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]]){if(_0x160958[_0xe83f('0x3b')]==='6'){if(!this['channels'][_0x160958[_0xe83f('0x31')]][_0xe83f('0x53')]){var _0x26b460=moment();this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x53')]=!![];this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x54')]=_0x26b460[_0xe83f('0x43')](_0xe83f('0x3a'));if(this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x39')]){this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]]['holdtime']=_0x26b460['diff'](this['channels'][_0x160958[_0xe83f('0x31')]][_0xe83f('0x39')],_0xe83f('0x50'));}}this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x31')]=_0x160958[_0xe83f('0x30')];if(_0x160958[_0xe83f('0x55')]!==_0xe83f('0x56')){this[_0xe83f('0x17')][_0x160958['linkedid']][_0xe83f('0x57')]=_0x160958[_0xe83f('0x55')];}this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x58')]=_0x160958[_0xe83f('0x59')];this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x5a')]=_0x160958['channel'];this['channels'][_0x160958['linkedid']][_0xe83f('0x5b')]=dispositions[_[_0xe83f('0x5c')](_0x160958[_0xe83f('0x3b')])];if(this[_0xe83f('0x18')][_0x160958[_0xe83f('0x37')]['split']('-')[0x0]]){this['channels'][_0x160958[_0xe83f('0x31')]][_0xe83f('0x5d')]=this[_0xe83f('0x18')][_0x160958[_0xe83f('0x37')]['split']('-')[0x0]]['id'];this[_0xe83f('0x17')][_0x160958[_0xe83f('0x31')]][_0xe83f('0x5e')]=this[_0xe83f('0x18')][_0x160958[_0xe83f('0x37')][_0xe83f('0x40')]('-')[0x0]]['name'];}}}}else{if(this[_0xe83f('0x17')][_0x160958[_0xe83f('0x30')]]){if(_0x160958['channelstate']==='6'){if(this[_0xe83f('0x18')][_0x160958['channel'][_0xe83f('0x40')]('-')[0x0]]){this[_0xe83f('0x17')][_0x160958[_0xe83f('0x30')]]['UserId']=this[_0xe83f('0x18')][_0x160958[_0xe83f('0x37')][_0xe83f('0x40')]('-')[0x0]]['id'];this['channels'][_0x160958[_0xe83f('0x30')]]['membername']=this[_0xe83f('0x18')][_0x160958['channel'][_0xe83f('0x40')]('-')[0x0]][_0xe83f('0x45')];}}}}}}catch(_0x20f864){logger[_0xe83f('0x33')](_0xe83f('0x5f'),util['inspect'](_0x20f864,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')]['syncMixMonitorFilename']=function(_0x2fe997,_0xf839ee){if(this[_0xe83f('0x17')][_0x2fe997]){this['channels'][_0x2fe997][_0xe83f('0x60')]=!![];if(_[_0xe83f('0x61')](_0xf839ee,'.wav49')){_0xf839ee=_0xf839ee[_0xe83f('0x62')]('.wav49',_0xe83f('0x63'));}this['channels'][_0x2fe997]['monitorFilename']=_0xf839ee;var _0x11ce59=_[_0xe83f('0x64')](this[_0xe83f('0x17')][_0x2fe997][_0xe83f('0x65')],{'filename':_0xf839ee});if(_['isNil'](_0x11ce59)){this[_0xe83f('0x17')][_0x2fe997][_0xe83f('0x65')][_0xe83f('0x66')]({'filename':_0xf839ee,'createdAt':moment()[_0xe83f('0x43')](_0xe83f('0x3a')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x20')]=function(_0x32390b){try{if(this[_0xe83f('0x2c')](_0x32390b)){if(this['channels'][_0x32390b[_0xe83f('0x30')]]&&_0x32390b[_0xe83f('0x37')]!=_0xe83f('0x38')){if(this[_0xe83f('0x2c')](_0x32390b['variable'])){if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x68')])){this[_0xe83f('0x69')](_0x32390b[_0xe83f('0x30')],_0x32390b[_0xe83f('0x6a')]);}else if(this['isNotNull'](_0x32390b[_0xe83f('0x67')][_0xe83f('0x6b')])){this[_0xe83f('0x17')][_0x32390b[_0xe83f('0x30')]][_0xe83f('0x55')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b['variable']['xmd-callerid'])){this[_0xe83f('0x17')][_0x32390b[_0xe83f('0x30')]][_0xe83f('0x6c')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x6d')])){this['channels'][_0x32390b[_0xe83f('0x30')]][_0xe83f('0x6e')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x6f')])){this['channels'][_0x32390b[_0xe83f('0x30')]][_0xe83f('0xd')]=_0x32390b[_0xe83f('0x6a')][_0xe83f('0x40')](',')[0x0];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')]['xmd-originatecalleridnum'])){this[_0xe83f('0x17')][_0x32390b[_0xe83f('0x30')]][_0xe83f('0x70')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x71')])){this['channels'][_0x32390b['uniqueid']][_0xe83f('0x72')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x73')])){this[_0xe83f('0x17')][_0x32390b[_0xe83f('0x30')]][_0xe83f('0x74')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b['variable'][_0xe83f('0x75')])){this['channels'][_0x32390b[_0xe83f('0x30')]][_0xe83f('0xd')]=_0x32390b[_0xe83f('0x6a')];}else if(this[_0xe83f('0x2c')](_0x32390b[_0xe83f('0x67')][_0xe83f('0x76')])){this[_0xe83f('0x17')][_0x32390b[_0xe83f('0x30')]]['sipcalluniqueid']=_0x32390b[_0xe83f('0x6a')];}}}else if(this[_0xe83f('0x2c')](_0x32390b['variable']['mixmonitor_filename'])){if(_0x32390b['value']){var _0x164397=path['parse'](_0x32390b[_0xe83f('0x6a')])[_0xe83f('0x45')];this[_0xe83f('0x69')](_0x164397,_0x32390b[_0xe83f('0x6a')]);}}else if(this['channels'][_0x32390b['linkedid']]){if(this['isNotNull'](_0x32390b[_0xe83f('0x67')])){if(this['isNotNull'](_0x32390b[_0xe83f('0x67')][_0xe83f('0x76')])){this[_0xe83f('0x17')][_0x32390b['linkedid']][_0xe83f('0x77')]=_0x32390b[_0xe83f('0x6a')];}}}}}catch(_0x37402e){logger['error'](_0xe83f('0x78'),util[_0xe83f('0x35')](_0x37402e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x22')]=function(_0x1d4d6e){try{if(this['isNotNull'](_0x1d4d6e)){if(this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]]){var _0xfad40=moment();this[_0xe83f('0x17')][_0x1d4d6e['uniqueid']][_0xe83f('0x79')]=_0xfad40[_0xe83f('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]]['duration']=_0xfad40[_0xe83f('0x7a')](this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x39')],_0xe83f('0x50'));if(this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x53')]){this['channels'][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x7b')]=_0xfad40[_0xe83f('0x7a')](this['channels'][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x54')],_0xe83f('0x50'));this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]]['holdtime']=this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x4e')]-this[_0xe83f('0x17')][_0x1d4d6e[_0xe83f('0x30')]][_0xe83f('0x7b')];}if(_0x1d4d6e[_0xe83f('0x3e')]==='from-sip'){if(this[_0xe83f('0x18')][_0x1d4d6e[_0xe83f('0x37')]['split']('-')[0x0]]){this[_0xe83f('0x18')][_0x1d4d6e[_0xe83f('0x37')][_0xe83f('0x40')]('-')[0x0]]=_[_0xe83f('0x7c')](this[_0xe83f('0x18')][_0x1d4d6e[_0xe83f('0x37')][_0xe83f('0x40')]('-')[0x0]],['destconnectedlinenum']);this[_0xe83f('0x2f')](util['format'](_0xe83f('0x44'),this[_0xe83f('0x18')][_0x1d4d6e['channel'][_0xe83f('0x40')]('-')[0x0]][_0xe83f('0x45')]),_0xe83f('0x7d'),{'destaccountcode':this[_0xe83f('0x18')][_0x1d4d6e[_0xe83f('0x37')]['split']('-')[0x0]]['accountcode']});}}ami[_0xe83f('0x2f')](_0xe83f('0x7e'),this['channels'][_0x1d4d6e[_0xe83f('0x30')]]);delete this[_0xe83f('0x17')][_0x1d4d6e['uniqueid']];}}}catch(_0x3e8df5){logger['error'](_0xe83f('0x7f'),util[_0xe83f('0x35')](_0x3e8df5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')][_0xe83f('0x80')]=function(_0x3696e8){try{if(this[_0xe83f('0x2c')](_0x3696e8)){if(this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x81')]]){this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x81')]][_0xe83f('0x82')]=_0x3696e8['origtransferercalleridnum'];this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x81')]][_0xe83f('0x83')]=_0x3696e8[_0xe83f('0x84')];if(this['channels'][_0x3696e8['secondtransfereruniqueid']]){var _0x1e3ddc=this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x85')]];this['channels'][_0x3696e8[_0xe83f('0x85')]]=this['channels'][_0x3696e8[_0xe83f('0x81')]];this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x81')]]=_0x1e3ddc;}}else if(this[_0xe83f('0x17')][_0x3696e8['transfertargetuniqueid']]){this[_0xe83f('0x17')][_0x3696e8['transfertargetuniqueid']][_0xe83f('0x82')]=_0x3696e8['origtransferercalleridnum'];this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x86')]][_0xe83f('0x83')]=_0x3696e8[_0xe83f('0x84')];if(this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x87')]]){var _0x1e3ddc=this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x87')]];this['channels'][_0x3696e8[_0xe83f('0x87')]]=this[_0xe83f('0x17')][_0x3696e8[_0xe83f('0x86')]];this['channels'][_0x3696e8[_0xe83f('0x86')]]=_0x1e3ddc;}}}}catch(_0xdb51cc){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0xe83f('0x35')](_0xdb51cc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe83f('0x26')]=function(_0x36c553){try{if(this[_0xe83f('0x2c')](_0x36c553)){if(this[_0xe83f('0x17')][_0x36c553[_0xe83f('0x81')]]){this[_0xe83f('0x17')][_0x36c553[_0xe83f('0x81')]][_0xe83f('0x82')]=_0x36c553[_0xe83f('0x88')];this[_0xe83f('0x17')][_0x36c553[_0xe83f('0x81')]][_0xe83f('0x83')]=_0x36c553[_0xe83f('0x89')];this['syncHangup']({'event':_0xe83f('0x8a'),'uniqueid':_0x36c553[_0xe83f('0x81')],'context':_0x36c553[_0xe83f('0x3e')],'channel':_0x36c553[_0xe83f('0x8b')]});}}}catch(_0x249388){logger['error']('[syncBlindTransfer][VoiceCallReport]',util['inspect'](_0x249388,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe83f('0x2e')]['syncMusicOnHoldStart']=function(_0x4c9060){try{if(this['isNotNull'](_0x4c9060)){if(this[_0xe83f('0x17')][_0x4c9060['uniqueid']]){if(!_['isNil'](this[_0xe83f('0x17')][_0x4c9060['uniqueid']][_0xe83f('0x54')])){this[_0xe83f('0x17')][_0x4c9060[_0xe83f('0x30')]]['mohstarttime']=moment()['format'](_0xe83f('0x3a'));}}}}catch(_0x35da8a){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0xe83f('0x35')](_0x35da8a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe83f('0x27')]=function(_0x453fa6){try{if(this[_0xe83f('0x2c')](_0x453fa6)){if(this[_0xe83f('0x17')][_0x453fa6[_0xe83f('0x30')]]){if(!_[_0xe83f('0x8c')](this['channels'][_0x453fa6[_0xe83f('0x30')]]['mohstarttime'])){this[_0xe83f('0x17')][_0x453fa6[_0xe83f('0x30')]][_0xe83f('0x8d')]+=moment()[_0xe83f('0x8e')](0x0)['diff'](this[_0xe83f('0x17')][_0x453fa6[_0xe83f('0x30')]]['mohstarttime'],'seconds');delete this['channels'][_0x453fa6['uniqueid']][_0xe83f('0x8f')];}}}}catch(_0x14edf3){logger[_0xe83f('0x33')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x14edf3,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 5c320f8..02f6d4d 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc179=['dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','uniqueid','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','dialstatus','ANSWER','connectedlinename','answertime','format','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','inspect','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','membername','memberpenalty','isNil','includes','endtime','duration','starttime','total','answered','diff','seconds','sumHoldTime','holdtime','sumBillable','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind'];(function(_0x3a4d44,_0x13fa94){var _0x5dade8=function(_0x53cfe4){while(--_0x53cfe4){_0x3a4d44['push'](_0x3a4d44['shift']());}};_0x5dade8(++_0x13fa94);}(_0xc179,0xf4));var _0x9c17=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0xc179[_0x623e7];return _0x121131;};'use strict';var _=require('lodash');var moment=require(_0x9c17('0x0'));var util=require(_0x9c17('0x1'));var Redis=require(_0x9c17('0x2'));var config=require(_0x9c17('0x3'));var logger=require(_0x9c17('0x4'))('ami');var ami=require(_0x9c17('0x5'));config[_0x9c17('0x6')]=_[_0x9c17('0x7')](config['redis'],{'host':_0x9c17('0x8'),'port':0x18eb});var io=require(_0x9c17('0x9'))(new Redis(config[_0x9c17('0x6')]));function VoiceDialReport(_0x257da0){this[_0x9c17('0xa')]=_0x257da0[_0x9c17('0xb')];this[_0x9c17('0xc')]=_0x257da0[_0x9c17('0xc')];this[_0x9c17('0xd')]={};ami['on'](_0x9c17('0xe'),this[_0x9c17('0xf')][_0x9c17('0x10')](this));ami['on'](_0x9c17('0x11'),this[_0x9c17('0x12')]['bind'](this));ami['on'](_0x9c17('0x13'),this[_0x9c17('0x14')][_0x9c17('0x10')](this));ami['on'](_0x9c17('0x15'),this[_0x9c17('0x16')][_0x9c17('0x10')](this));}VoiceDialReport['prototype'][_0x9c17('0x17')]=function(_0x2e101e){return _0x2e101e!==null&&!_[_0x9c17('0x18')](_0x2e101e);};VoiceDialReport[_0x9c17('0x19')][_0x9c17('0x1a')]=function(_0x5324b1,_0x39c3b9,_0x28530b){io['to'](_0x5324b1)[_0x9c17('0x1a')](_0x39c3b9,_0x28530b);};VoiceDialReport['prototype'][_0x9c17('0xf')]=function(_0x40b083){try{if(this[_0x9c17('0x17')](_0x40b083)){if(this[_0x9c17('0xa')][_0x40b083[_0x9c17('0x1b')]]){_['merge'](this['channels'][_0x40b083[_0x9c17('0x1b')]],{'starttime':moment()['format'](_0x9c17('0x1c')),'lastevent':'called','interface':_0x40b083[_0x9c17('0x1d')][_0x9c17('0x1e')](0x0,_0x40b083['channel'][_0x9c17('0x1f')]('-')),'membername':_0x40b083[_0x9c17('0x1d')][_0x9c17('0x1e')](_0x40b083['channel']['lastIndexOf']('/')+0x1,_0x40b083[_0x9c17('0x1d')][_0x9c17('0x1f')]('-'))},_[_0x9c17('0x20')](_0x40b083,['event',_0x9c17('0x21')]));this[_0x9c17('0x1a')]('voice:outbound',_0x9c17('0x22'),this['channels'][_0x40b083['uniqueid']]);ami[_0x9c17('0x1a')](_0x9c17('0x23'),this[_0x9c17('0xa')][_0x40b083['uniqueid']]);}}}catch(_0x72011a){logger[_0x9c17('0x24')](_0x9c17('0x25'),util['inspect'](_0x72011a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9c17('0x19')]['syncDialEnd']=function(_0x4a831a){try{if(this[_0x9c17('0x17')](_0x4a831a)){if(this[_0x9c17('0xa')][_0x4a831a[_0x9c17('0x1b')]]){this[_0x9c17('0xa')][_0x4a831a[_0x9c17('0x1b')]][_0x9c17('0x26')]=_0x4a831a['dialstatus'];if(_0x4a831a['dialstatus']===_0x9c17('0x27')){this[_0x9c17('0xa')][_0x4a831a['uniqueid']]['connectedlinenum']=_0x4a831a['connectedlinenum'];this['channels'][_0x4a831a[_0x9c17('0x1b')]][_0x9c17('0x28')]=_0x4a831a['connectedlinename'];this[_0x9c17('0xa')][_0x4a831a[_0x9c17('0x1b')]][_0x9c17('0x29')]=moment()[_0x9c17('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9c17('0xa')][_0x4a831a[_0x9c17('0x1b')]]['lastevent']='connect';ami[_0x9c17('0x1a')](_0x9c17('0x2b'),this['channels'][_0x4a831a[_0x9c17('0x1b')]]);}this[_0x9c17('0x1a')](_0x9c17('0x2c'),_0x9c17('0x22'),this[_0x9c17('0xa')][_0x4a831a[_0x9c17('0x1b')]]);}}}catch(_0x485eb7){logger[_0x9c17('0x24')](_0x9c17('0x2d'),util[_0x9c17('0x2e')](_0x485eb7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9c17('0x14')]=function(_0x2f2dbb){try{if(this[_0x9c17('0x17')](_0x2f2dbb)){this['addVariable'](_0x2f2dbb[_0x9c17('0x1b')],_[_0x9c17('0x2f')](_0x2f2dbb[_0x9c17('0x30')])[0x0],_0x2f2dbb[_0x9c17('0x31')]);if(this[_0x9c17('0x17')](_0x2f2dbb[_0x9c17('0x30')])&&this['isNotNull'](_0x2f2dbb[_0x9c17('0x30')][_0x9c17('0x32')])){if(_[_0x9c17('0x18')](this[_0x9c17('0xa')][_0x2f2dbb[_0x9c17('0x1b')]])){this[_0x9c17('0xa')][_0x2f2dbb[_0x9c17('0x1b')]]={'routeId':_0x2f2dbb[_0x9c17('0x31')],'variables':this[_0x9c17('0xd')][_0x2f2dbb['uniqueid']]};this[_0x9c17('0x1a')](_0x9c17('0x2c'),'voice_outbound_channel:save',this[_0x9c17('0xa')][_0x2f2dbb['uniqueid']]);}}}}catch(_0x8699f0){logger[_0x9c17('0x24')](_0x9c17('0x33'),util[_0x9c17('0x2e')](_0x8699f0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9c17('0x19')][_0x9c17('0x34')]=function(_0x36ae82,_0xb794db,_0x12d5e3){var _0x2eadbc=[_0x9c17('0x35'),'rtpaudioqosbridged',_0x9c17('0x36'),_0x9c17('0x37'),_0x9c17('0x38'),_0x9c17('0x39'),_0x9c17('0x3a'),_0x9c17('0x3b'),_0x9c17('0x3c'),'sipuri',_0x9c17('0x3d'),_0x9c17('0x3e'),_0x9c17('0x3f'),'memberdynamic','memberinterface',_0x9c17('0x40'),_0x9c17('0x41'),_0x9c17('0x42'),'memberrealtime'];if(!_[_0x9c17('0x43')](_0xb794db)&&!_[_0x9c17('0x44')](_0x2eadbc,_0xb794db)){if(_[_0x9c17('0x18')](this[_0x9c17('0xd')][_0x36ae82])){this[_0x9c17('0xd')][_0x36ae82]={};}this[_0x9c17('0xd')][_0x36ae82][_0xb794db]=_0x12d5e3;}};VoiceDialReport[_0x9c17('0x19')][_0x9c17('0x16')]=function(_0x1bb384){try{if(this[_0x9c17('0x17')](_0x1bb384)){if(this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]){this['channels'][_0x1bb384[_0x9c17('0x1b')]][_0x9c17('0x45')]=moment()[_0x9c17('0x2a')](_0x9c17('0x1c'));this['channels'][_0x1bb384[_0x9c17('0x1b')]][_0x9c17('0x46')]=moment(this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]['endtime'])['diff'](this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]][_0x9c17('0x47')],'seconds');this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]['lastevent']='complete';this[_0x9c17('0xc')][_0x9c17('0x48')]+=0x1;if(this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]['answertime']){this[_0x9c17('0xc')][_0x9c17('0x49')]+=0x1;this[_0x9c17('0xa')][_0x1bb384['uniqueid']]['holdtime']=moment(this[_0x9c17('0xa')][_0x1bb384['uniqueid']]['answertime'])[_0x9c17('0x4a')](this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]][_0x9c17('0x47')],_0x9c17('0x4b'));this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]['billableseconds']=moment(this[_0x9c17('0xa')][_0x1bb384['uniqueid']][_0x9c17('0x45')])[_0x9c17('0x4a')](this[_0x9c17('0xa')][_0x1bb384['uniqueid']][_0x9c17('0x29')],_0x9c17('0x4b'));this['outbound'][_0x9c17('0x4c')]+=this[_0x9c17('0xa')][_0x1bb384['uniqueid']][_0x9c17('0x4d')]||0x0;this['outbound'][_0x9c17('0x4e')]+=this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]][_0x9c17('0x4f')];}this['outbound'][_0x9c17('0x50')]+=this[_0x9c17('0xa')][_0x1bb384['uniqueid']][_0x9c17('0x46')];ami['emit'](_0x9c17('0x51'),this['channels'][_0x1bb384[_0x9c17('0x1b')]]);ami[_0x9c17('0x1a')](_0x9c17('0x52'),this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]);this[_0x9c17('0x1a')]('voice:outbound',_0x9c17('0x53'),this[_0x9c17('0xc')]);this[_0x9c17('0x1a')](_0x9c17('0x2c'),_0x9c17('0x54'),this[_0x9c17('0xa')][_0x1bb384[_0x9c17('0x1b')]]);delete this['channels'][_0x1bb384[_0x9c17('0x1b')]];}if(this[_0x9c17('0xd')][_0x1bb384[_0x9c17('0x1b')]]){delete this[_0x9c17('0xd')][_0x1bb384['uniqueid']];}}}catch(_0xd22258){logger['error'](_0x9c17('0x55'),util['inspect'](_0xd22258,{'showHidden':![],'depth':null}));}};module[_0x9c17('0x56')]=VoiceDialReport; \ No newline at end of file +var _0xc181=['membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','complete','total','answered','holdtime','seconds','billableseconds','sumHoldTime','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','event','privilege','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','variable','outboundrouteid','voice:outbound','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall'];(function(_0x5d9b45,_0xcf24b5){var _0x40a900=function(_0x5d6db6){while(--_0x5d6db6){_0x5d9b45['push'](_0x5d9b45['shift']());}};_0x40a900(++_0xcf24b5);}(_0xc181,0x1d7));var _0x1c18=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0xc181[_0x406fbb];return _0x8e921d;};'use strict';var _=require(_0x1c18('0x0'));var moment=require('moment');var util=require(_0x1c18('0x1'));var Redis=require('ioredis');var config=require(_0x1c18('0x2'));var logger=require(_0x1c18('0x3'))(_0x1c18('0x4'));var ami=require(_0x1c18('0x5'));config[_0x1c18('0x6')]=_['defaults'](config['redis'],{'host':_0x1c18('0x7'),'port':0x18eb});var io=require(_0x1c18('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x33b991){this[_0x1c18('0x9')]=_0x33b991['outboundChannels'];this[_0x1c18('0xa')]=_0x33b991[_0x1c18('0xa')];this[_0x1c18('0xb')]={};ami['on'](_0x1c18('0xc'),this[_0x1c18('0xd')][_0x1c18('0xe')](this));ami['on'](_0x1c18('0xf'),this[_0x1c18('0x10')][_0x1c18('0xe')](this));ami['on'](_0x1c18('0x11'),this[_0x1c18('0x12')][_0x1c18('0xe')](this));ami['on'](_0x1c18('0x13'),this[_0x1c18('0x14')]['bind'](this));}VoiceDialReport[_0x1c18('0x15')][_0x1c18('0x16')]=function(_0x4a584f){return _0x4a584f!==null&&!_[_0x1c18('0x17')](_0x4a584f);};VoiceDialReport[_0x1c18('0x15')][_0x1c18('0x18')]=function(_0x58e370,_0x1d325d,_0x31a506){io['to'](_0x58e370)[_0x1c18('0x18')](_0x1d325d,_0x31a506);};VoiceDialReport[_0x1c18('0x15')][_0x1c18('0xd')]=function(_0x2ba92f){try{if(this['isNotNull'](_0x2ba92f)){if(this['channels'][_0x2ba92f[_0x1c18('0x19')]]){_[_0x1c18('0x1a')](this[_0x1c18('0x9')][_0x2ba92f[_0x1c18('0x19')]],{'starttime':moment()['format'](_0x1c18('0x1b')),'lastevent':_0x1c18('0x1c'),'interface':_0x2ba92f[_0x1c18('0x1d')]['substring'](0x0,_0x2ba92f[_0x1c18('0x1d')][_0x1c18('0x1e')]('-')),'membername':_0x2ba92f[_0x1c18('0x1d')][_0x1c18('0x1f')](_0x2ba92f[_0x1c18('0x1d')][_0x1c18('0x1e')]('/')+0x1,_0x2ba92f['channel'][_0x1c18('0x1e')]('-'))},_[_0x1c18('0x20')](_0x2ba92f,[_0x1c18('0x21'),_0x1c18('0x22')]));this[_0x1c18('0x18')]('voice:outbound',_0x1c18('0x23'),this[_0x1c18('0x9')][_0x2ba92f[_0x1c18('0x19')]]);ami[_0x1c18('0x18')]('custom:dialbegin',this['channels'][_0x2ba92f[_0x1c18('0x19')]]);}}}catch(_0x2c9a66){logger[_0x1c18('0x24')](_0x1c18('0x25'),util[_0x1c18('0x26')](_0x2c9a66,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1c18('0x15')][_0x1c18('0x10')]=function(_0x42bd69){try{if(this[_0x1c18('0x16')](_0x42bd69)){if(this[_0x1c18('0x9')][_0x42bd69[_0x1c18('0x19')]]){this[_0x1c18('0x9')][_0x42bd69['uniqueid']][_0x1c18('0x27')]=_0x42bd69[_0x1c18('0x27')];if(_0x42bd69[_0x1c18('0x27')]===_0x1c18('0x28')){this['channels'][_0x42bd69[_0x1c18('0x19')]][_0x1c18('0x29')]=_0x42bd69[_0x1c18('0x29')];this['channels'][_0x42bd69[_0x1c18('0x19')]][_0x1c18('0x2a')]=_0x42bd69[_0x1c18('0x2a')];this[_0x1c18('0x9')][_0x42bd69[_0x1c18('0x19')]][_0x1c18('0x2b')]=moment()[_0x1c18('0x2c')](_0x1c18('0x1b'));this[_0x1c18('0x9')][_0x42bd69[_0x1c18('0x19')]][_0x1c18('0x2d')]=_0x1c18('0x2e');ami[_0x1c18('0x18')](_0x1c18('0x2f'),this[_0x1c18('0x9')][_0x42bd69[_0x1c18('0x19')]]);}this[_0x1c18('0x18')]('voice:outbound',_0x1c18('0x23'),this['channels'][_0x42bd69[_0x1c18('0x19')]]);}}}catch(_0x2697fc){logger[_0x1c18('0x24')](_0x1c18('0x30'),util[_0x1c18('0x26')](_0x2697fc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1c18('0x15')][_0x1c18('0x12')]=function(_0x1c5435){try{if(this['isNotNull'](_0x1c5435)){this[_0x1c18('0x31')](_0x1c5435[_0x1c18('0x19')],_[_0x1c18('0x32')](_0x1c5435['variable'])[0x0],_0x1c5435[_0x1c18('0x33')]);if(this[_0x1c18('0x16')](_0x1c5435[_0x1c18('0x34')])&&this[_0x1c18('0x16')](_0x1c5435[_0x1c18('0x34')][_0x1c18('0x35')])){if(_[_0x1c18('0x17')](this[_0x1c18('0x9')][_0x1c5435[_0x1c18('0x19')]])){this[_0x1c18('0x9')][_0x1c5435['uniqueid']]={'routeId':_0x1c5435[_0x1c18('0x33')],'variables':this['variables'][_0x1c5435[_0x1c18('0x19')]]};this[_0x1c18('0x18')](_0x1c18('0x36'),_0x1c18('0x23'),this[_0x1c18('0x9')][_0x1c5435[_0x1c18('0x19')]]);}}}}catch(_0x1f9d96){logger[_0x1c18('0x24')](_0x1c18('0x37'),util[_0x1c18('0x26')](_0x1f9d96,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1c18('0x15')]['addVariable']=function(_0x159747,_0x14abbc,_0x5bb1bc){var _0x4490c9=['rtpaudioqos',_0x1c18('0x38'),_0x1c18('0x39'),_0x1c18('0x3a'),_0x1c18('0x3b'),_0x1c18('0x3c'),_0x1c18('0x3d'),_0x1c18('0x3e'),_0x1c18('0x3f'),'sipuri',_0x1c18('0x40'),_0x1c18('0x41'),_0x1c18('0x42'),'memberdynamic',_0x1c18('0x43'),_0x1c18('0x44'),_0x1c18('0x45'),_0x1c18('0x46'),_0x1c18('0x47')];if(!_[_0x1c18('0x48')](_0x14abbc)&&!_[_0x1c18('0x49')](_0x4490c9,_0x14abbc)){if(_[_0x1c18('0x17')](this[_0x1c18('0xb')][_0x159747])){this[_0x1c18('0xb')][_0x159747]={};}this['variables'][_0x159747][_0x14abbc]=_0x5bb1bc;}};VoiceDialReport[_0x1c18('0x15')][_0x1c18('0x14')]=function(_0x36e4a9){try{if(this[_0x1c18('0x16')](_0x36e4a9)){if(this['channels'][_0x36e4a9[_0x1c18('0x19')]]){this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x4a')]=moment()[_0x1c18('0x2c')](_0x1c18('0x1b'));this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x4b')]=moment(this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]]['endtime'])[_0x1c18('0x4c')](this[_0x1c18('0x9')][_0x36e4a9['uniqueid']][_0x1c18('0x4d')],'seconds');this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x2d')]=_0x1c18('0x4e');this[_0x1c18('0xa')][_0x1c18('0x4f')]+=0x1;if(this['channels'][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x2b')]){this['outbound'][_0x1c18('0x50')]+=0x1;this['channels'][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x51')]=moment(this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x2b')])['diff'](this['channels'][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x4d')],_0x1c18('0x52'));this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x53')]=moment(this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]]['endtime'])[_0x1c18('0x4c')](this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]]['answertime'],_0x1c18('0x52'));this[_0x1c18('0xa')][_0x1c18('0x54')]+=this[_0x1c18('0x9')][_0x36e4a9['uniqueid']]['holdtime']||0x0;this[_0x1c18('0xa')]['sumBillable']+=this['channels'][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x53')];}this[_0x1c18('0xa')]['sumDuration']+=this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]][_0x1c18('0x4b')];ami[_0x1c18('0x18')](_0x1c18('0x55'),this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]]);ami[_0x1c18('0x18')](_0x1c18('0x56'),this['channels'][_0x36e4a9[_0x1c18('0x19')]]);this['emit'](_0x1c18('0x36'),_0x1c18('0x57'),this[_0x1c18('0xa')]);this[_0x1c18('0x18')]('voice:outbound',_0x1c18('0x58'),this[_0x1c18('0x9')][_0x36e4a9[_0x1c18('0x19')]]);delete this['channels'][_0x36e4a9[_0x1c18('0x19')]];}if(this['variables'][_0x36e4a9[_0x1c18('0x19')]]){delete this['variables'][_0x36e4a9['uniqueid']];}}}catch(_0x5bcbb5){logger[_0x1c18('0x24')]('[syncHangup][VoiceDialReport]',util[_0x1c18('0x26')](_0x5bcbb5,{'showHidden':![],'depth':null}));}};module[_0x1c18('0x59')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 6e06535..b343fef 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c2a=['count','merge','pick','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','syncAgentConnect','COMPLETEDBYAGENT','assigned','queuecallerexitAt','transfer','reason','COMPLETED','channel','toLowerCase','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','keys','variable','value','CONTINUE','queueposition','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','memberinterface','membername','memberpenalty','memberrealtime','includes','length','milliseconds','diff','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','[syncMusicOnHoldStop][VoiceQueueReport]','exports','bluebird','util','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','hasOwnProperty','originated','isEmpty','talking','waiting','queueStatusComplete','unlockRR','switch','isNil','Action','status','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','Trunk','callerid','Interval','stringify','md5','voice_queue:save','clearZombieChannels','queues','then','isNotNull','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position'];(function(_0x4451e6,_0x4cfaab){var _0x4dbf17=function(_0x54e6ee){while(--_0x54e6ee){_0x4451e6['push'](_0x4451e6['shift']());}};_0x4dbf17(++_0x4cfaab);}(_0x6c2a,0x1db));var _0xa6c2=function(_0x43d165,_0x1b0b55){_0x43d165=_0x43d165-0x0;var _0x23ec69=_0x6c2a[_0x43d165];return _0x23ec69;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xa6c2('0x0'));var util=require(_0xa6c2('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xa6c2('0x2'));var logger=require(_0xa6c2('0x3'))(_0xa6c2('0x4'));var ami=require(_0xa6c2('0x5'));var QueueReport=require(_0xa6c2('0x6'));config[_0xa6c2('0x7')]=_[_0xa6c2('0x8')](config[_0xa6c2('0x7')],{'host':_0xa6c2('0x9'),'port':0x18eb});var io=require(_0xa6c2('0xa'))(new Redis(config[_0xa6c2('0x7')]));var Sequence=function(){};Sequence[_0xa6c2('0xb')][_0xa6c2('0xc')]=function(_0x447fad){this[_0xa6c2('0xd')]=this['tail']?this[_0xa6c2('0xd')][_0xa6c2('0xe')](_0x447fad):_0x447fad();};function VoiceQueueReport(_0x58dadc){this[_0xa6c2('0xf')]=new Sequence();this[_0xa6c2('0x10')]={};this[_0xa6c2('0x11')]=_0x58dadc[_0xa6c2('0x11')];this[_0xa6c2('0x12')]=_0x58dadc[_0xa6c2('0x13')];this[_0xa6c2('0x14')]=_0x58dadc[_0xa6c2('0x14')];this[_0xa6c2('0x15')]=!![];this[_0xa6c2('0x16')]=_0x58dadc[_0xa6c2('0x16')];this[_0xa6c2('0x17')]={};ami['on'](_0xa6c2('0x18'),this[_0xa6c2('0x19')]['bind'](this));ami['on'](_0xa6c2('0x1a'),this[_0xa6c2('0x1b')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x1d'),this[_0xa6c2('0x1e')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x1f'),this[_0xa6c2('0x20')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x21'),this[_0xa6c2('0x22')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x23'),this[_0xa6c2('0x24')][_0xa6c2('0x1c')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x25'),this[_0xa6c2('0x26')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x27'),this[_0xa6c2('0x28')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x29'),this[_0xa6c2('0x2a')][_0xa6c2('0x1c')](this));ami['on'](_0xa6c2('0x2b'),this[_0xa6c2('0x2c')][_0xa6c2('0x1c')](this));ami['on']('musiconholdstop',this[_0xa6c2('0x2d')][_0xa6c2('0x1c')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xa6c2('0x2e')][_0xa6c2('0x1c')](this));this[_0xa6c2('0x2f')]();this[_0xa6c2('0x30')]();}function isNotNull(_0xacf220){return _0xacf220!==null&&!_[_0xa6c2('0x31')](_0xacf220);}function clearChannels(_0x214f15){if(!_['isEmpty'](_0x214f15)){for(var _0x2604f9 in _0x214f15){if(_0x214f15[_0xa6c2('0x32')](_0x2604f9)){delete _0x214f15[_0x2604f9];}}}}function clearCampaigns(_0xe5d379){if(!_['isEmpty'](_0xe5d379)){for(var _0x52c89a in _0xe5d379){if(_0xe5d379[_0xa6c2('0x32')](_0x52c89a)){_0xe5d379[_0x52c89a][_0xa6c2('0x33')]=0x0;}}}}function clearVoiceQueues(_0x175f7a){if(!_[_0xa6c2('0x34')](_0x175f7a)){for(var _0xeb516c in _0x175f7a){if(_0x175f7a['hasOwnProperty'](_0xeb516c)){_0x175f7a[_0xeb516c]['originated']=0x0;_0x175f7a[_0xeb516c][_0xa6c2('0x35')]=0x0;_0x175f7a[_0xeb516c]['pTalking']=0x0;_0x175f7a[_0xeb516c][_0xa6c2('0x36')]=0x0;_0x175f7a[_0xeb516c][_0xa6c2('0x37')]=!![];}}}}function clearAgentBooked(_0x1f68b8){if(!_[_0xa6c2('0x34')](_0x1f68b8)){for(var _0x5240c3 in _0x1f68b8){if(_0x1f68b8[_0xa6c2('0x32')](_0x5240c3)){_0x1f68b8[_0x5240c3][_0xa6c2('0x38')]=!![];}}}}VoiceQueueReport[_0xa6c2('0xb')]['clearZombieChannels']=function(){var _0x343f26=this;for(var _0x25e180 in this[_0xa6c2('0x12')]){if(this['channels'][_0xa6c2('0x32')](_0x25e180)&&!this['channels'][_0x25e180][_0xa6c2('0x39')]){this[_0xa6c2('0xf')][_0xa6c2('0xc')](function(){if(!_[_0xa6c2('0x3a')](_0x343f26[_0xa6c2('0x12')][_0x25e180])){return ami[_0xa6c2('0x3b')]({'action':_0xa6c2('0x3c'),'channel':_0x343f26[_0xa6c2('0x12')][_0x25e180]['channel']})[_0xa6c2('0x3d')](function(_0x56a0e6){if(_0x56a0e6[_0xa6c2('0x3e')]===_0xa6c2('0x3f')){setTimeout(function(){if(_0x343f26[_0xa6c2('0x12')][_0x25e180]){delete _0x343f26[_0xa6c2('0x12')][_0x25e180];logger[_0xa6c2('0x40')](_0xa6c2('0x41'),_0x25e180);}if(_0x343f26['queueReports'][_0x25e180]){delete _0x343f26['queueReports'][_0x25e180];logger['error'](_0xa6c2('0x42'),_0x25e180);}if(_0x343f26[_0xa6c2('0x17')][_0x25e180]){delete _0x343f26[_0xa6c2('0x17')][_0x25e180];logger['error'](_0xa6c2('0x43'),_0x25e180);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xa6c2('0x2a')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xa6c2('0x12')]);this[_0xa6c2('0x44')](this[_0xa6c2('0x10')]);clearAgentBooked(this[_0xa6c2('0x11')]);clearVoiceQueues(this[_0xa6c2('0x14')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x44')]=function(_0x50018b){var _0x27f4d1=this;if(!_[_0xa6c2('0x34')](_0x50018b)){for(var _0x2fe90d in _0x50018b){if(_0x50018b[_0xa6c2('0x32')](_0x2fe90d)){_0x27f4d1[_0xa6c2('0x45')](_0x50018b[_0x2fe90d]);delete _0x50018b[_0x2fe90d];}}}};function loggerCatch(_0x2c43f8){return function(_0x3d77cc){logger[_0xa6c2('0x40')](_0x2c43f8,util[_0xa6c2('0x46')](_0x3d77cc,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x47')]=function(_0x2e2e7b,_0x44c837,_0x5a034d){io['to'](_0x2e2e7b)['emit'](_0x44c837,_0x5a034d);};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x48')]=function(_0xd59fe6){this['emit'](util[_0xa6c2('0x49')]('voice:queue:%s',_0xd59fe6[_0xa6c2('0x4a')]),_0xa6c2('0x4b'),_0xd59fe6);};VoiceQueueReport['prototype'][_0xa6c2('0x45')]=function(_0x11820d){this[_0xa6c2('0x47')](util[_0xa6c2('0x49')]('voice:queue:%s',_0x11820d[_0xa6c2('0x4a')]),_0xa6c2('0x4c'),_0x11820d);};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x4d')]=function(_0x112171){if(_0x112171['type']===_0xa6c2('0x4e')){var _0x3488cb={'id':_0x112171['id'],'name':_0x112171[_0xa6c2('0x4a')],'strategy':_0x112171[_0xa6c2('0x4f')],'answered':_0x112171[_0xa6c2('0x50')],'available':_0x112171[_0xa6c2('0x51')],'loggedIn':_0x112171[_0xa6c2('0x52')],'pTalking':_0x112171[_0xa6c2('0x53')],'sumBillable':_0x112171[_0xa6c2('0x54')],'sumDuration':_0x112171[_0xa6c2('0x55')],'sumHoldTime':_0x112171[_0xa6c2('0x56')]||0x0,'talking':_0x112171[_0xa6c2('0x35')],'total':_0x112171[_0xa6c2('0x57')],'type':_0x112171[_0xa6c2('0x58')],'unmanaged':_0x112171[_0xa6c2('0x59')],'abandoned':_0x112171[_0xa6c2('0x5a')],'waiting':_0x112171[_0xa6c2('0x36')]};if(_0x112171[_0xa6c2('0x5b')]){_0x3488cb[_0xa6c2('0x5b')]={'id':_0x112171[_0xa6c2('0x5b')]['id'],'name':_0x112171[_0xa6c2('0x5b')][_0xa6c2('0x4a')],'active':_0x112171[_0xa6c2('0x5b')]['active'],'callerid':_0x112171[_0xa6c2('0x5b')][_0xa6c2('0x5c')]};}if(_0x112171[_0xa6c2('0x5d')]){_0x3488cb[_0xa6c2('0x5d')]={'id':_0x112171[_0xa6c2('0x5d')]['id'],'name':_0x112171[_0xa6c2('0x5d')][_0xa6c2('0x4a')]};}var _0x30d996=md5(JSON[_0xa6c2('0x5e')](_0x3488cb));if(_0x112171[_0xa6c2('0x5f')]!==_0x30d996){_0x112171['md5']=_0x30d996;this[_0xa6c2('0x47')](util['format']('voice:queue:%s',_0x3488cb['name']),_0xa6c2('0x60'),_0x3488cb);}}};VoiceQueueReport[_0xa6c2('0xb')]['isNotNull']=function(_0x4a2b0a){return _0x4a2b0a!==null&&!_[_0xa6c2('0x31')](_0x4a2b0a);};VoiceQueueReport['prototype'][_0xa6c2('0x30')]=function(){var _0x1c5c26=this;setInterval(function(){_0x1c5c26[_0xa6c2('0x61')]();ami[_0xa6c2('0x3b')]({'action':_0xa6c2('0x62')})[_0xa6c2('0x3d')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x2f')]=function(){var _0x4c87c7=this;setInterval(function(){if(_0x4c87c7[_0xa6c2('0x15')]){return ami['Action']({'action':_0xa6c2('0x18')})[_0xa6c2('0x63')](function(_0x59c2f7){_0x4c87c7['flagQueueSummary']=![];})[_0xa6c2('0x3d')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x19')]=function(_0x5eb08a){try{if(this['isNotNull'](_0x5eb08a)&&this[_0xa6c2('0x64')](_0x5eb08a[_0xa6c2('0x65')])){if(this[_0xa6c2('0x14')][_0x5eb08a['queue']]){var _0x36d34e=_[_0xa6c2('0x66')](this[_0xa6c2('0x12')],_0xa6c2('0x65'))[_0x5eb08a[_0xa6c2('0x65')]]||0x0;var _0x3d0b69=_0x36d34e-_0x5eb08a[_0xa6c2('0x67')];if(this['voiceQueues'][_0x5eb08a['queue']][_0xa6c2('0x36')]!==_['toNumber'](_0x5eb08a[_0xa6c2('0x67')])||this['voiceQueues'][_0x5eb08a[_0xa6c2('0x65')]][_0xa6c2('0x52')]!==_[_0xa6c2('0x68')](_0x5eb08a['loggedin'])||this[_0xa6c2('0x14')][_0x5eb08a[_0xa6c2('0x65')]][_0xa6c2('0x51')]!==_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x51')])||this[_0xa6c2('0x14')][_0x5eb08a[_0xa6c2('0x65')]][_0xa6c2('0x35')]!==_0x3d0b69){this[_0xa6c2('0x14')][_0x5eb08a['queue']][_0xa6c2('0x36')]=_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x67')]);this[_0xa6c2('0x14')][_0x5eb08a[_0xa6c2('0x65')]]['loggedIn']=_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x69')]);this[_0xa6c2('0x14')][_0x5eb08a[_0xa6c2('0x65')]][_0xa6c2('0x51')]=_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x51')]);this[_0xa6c2('0x14')][_0x5eb08a['queue']]['talking']=_0x3d0b69>0x0?_0x3d0b69:0x0;this[_0xa6c2('0x14')][_0x5eb08a['queue']][_0xa6c2('0x35')]=this['voiceQueues'][_0x5eb08a[_0xa6c2('0x65')]][_0xa6c2('0x35')]>_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x69')])?_[_0xa6c2('0x68')](_0x5eb08a[_0xa6c2('0x69')]):this[_0xa6c2('0x14')][_0x5eb08a['queue']][_0xa6c2('0x35')];this[_0xa6c2('0x4d')](this[_0xa6c2('0x14')][_0x5eb08a[_0xa6c2('0x65')]]);}ami[_0xa6c2('0x47')](_0xa6c2('0x6a'),this['voiceQueues'][_0x5eb08a[_0xa6c2('0x65')]]);}}}catch(_0x578618){logger[_0xa6c2('0x40')](_0xa6c2('0x6b'),util[_0xa6c2('0x46')](_0x578618,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xa7256d){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xa6c2('0x6c')]=function(_0x22f868){};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x1e')]=function(_0x31d481){try{if(this[_0xa6c2('0x64')](_0x31d481)){if(_['isUndefined'](this[_0xa6c2('0x10')][_0x31d481[_0xa6c2('0x6d')]])){this['queueReports'][_0x31d481['uniqueid']]=[];this[_0xa6c2('0x12')][_0x31d481[_0xa6c2('0x6d')]]={};}var _0x5de643=new QueueReport();_0x5de643[_0xa6c2('0x4a')]=_0x31d481[_0xa6c2('0x65')];_0x5de643[_0xa6c2('0x58')]=this['voiceQueues'][_0x5de643[_0xa6c2('0x4a')]]&&this[_0xa6c2('0x14')][_0x5de643[_0xa6c2('0x4a')]][_0xa6c2('0x58')]?this[_0xa6c2('0x14')][_0x5de643[_0xa6c2('0x4a')]][_0xa6c2('0x58')]||'inbound':_0xa6c2('0x4e');_0x5de643[_0xa6c2('0x65')]=_0x31d481[_0xa6c2('0x65')];_0x5de643[_0xa6c2('0x6e')]=moment()[_0xa6c2('0x49')](_0xa6c2('0x6f'));_0x5de643[_0xa6c2('0x70')]=_0x31d481[_0xa6c2('0x70')];_0x5de643[_0xa6c2('0x71')]=_0x31d481['count'];_[_0xa6c2('0x72')](_0x5de643,_[_0xa6c2('0x73')](_0x31d481,_['keys'](_0x5de643)));this[_0xa6c2('0x10')][_0x31d481[_0xa6c2('0x6d')]]['push'](_0x5de643);this[_0xa6c2('0x12')][_0x31d481['uniqueid']]=_0x5de643;this[_0xa6c2('0x48')](_0x5de643);}}catch(_0x3848e5){logger[_0xa6c2('0x40')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xa6c2('0x46')](_0x3848e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x20')]=function(_0x2d8170){try{if(this[_0xa6c2('0x64')](_0x2d8170)){if(this['queueReports'][_0x2d8170['uniqueid']]){var _0x4d8f10=_[_0xa6c2('0x74')](this[_0xa6c2('0x10')][_0x2d8170[_0xa6c2('0x6d')]]);_0x4d8f10[_0xa6c2('0x75')]=![];_0x4d8f10[_0xa6c2('0x76')]=null;_0x4d8f10[_0xa6c2('0x77')]=_0x2d8170[_0xa6c2('0x77')];_0x4d8f10[_0xa6c2('0x78')]=_0x2d8170[_0xa6c2('0x78')];_0x4d8f10[_0xa6c2('0x1f')]=!![];_0x4d8f10[_0xa6c2('0x79')]=moment()[_0xa6c2('0x49')](_0xa6c2('0x6f'));_0x4d8f10[_0xa6c2('0x7a')]=_0xa6c2('0x7b');_0x4d8f10[_0xa6c2('0x7c')]=null;this[_0xa6c2('0x12')][_0x2d8170[_0xa6c2('0x6d')]]=_0x4d8f10;this[_0xa6c2('0x45')](_0x4d8f10);}}}catch(_0x2e1c59){logger[_0xa6c2('0x40')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xa6c2('0x46')](_0x2e1c59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6c2('0xb')]['syncQueueCallerLeave']=function(_0x456dc){try{if(this[_0xa6c2('0x64')](_0x456dc)){if(this['queueReports'][_0x456dc[_0xa6c2('0x6d')]]){var _0xb88473=_[_0xa6c2('0x74')](this[_0xa6c2('0x10')][_0x456dc[_0xa6c2('0x6d')]]);_0xb88473[_0xa6c2('0x7d')]=moment()[_0xa6c2('0x49')](_0xa6c2('0x6f'));_0xb88473['connectedlinenum']=_0x456dc[_0xa6c2('0x7e')];_0xb88473['connectedlinename']=_0x456dc[_0xa6c2('0x7f')];this[_0xa6c2('0x12')][_0x456dc['uniqueid']]=_0xb88473;this[_0xa6c2('0x48')](_0xb88473);}}}catch(_0x56d41a){logger[_0xa6c2('0x40')](_0xa6c2('0x80'),util['inspect'](_0x56d41a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x81')]=function(_0x3a79c2){try{if(this[_0xa6c2('0x64')](_0x3a79c2)){if(this[_0xa6c2('0x10')][_0x3a79c2[_0xa6c2('0x6d')]]){var _0xc981c1=_[_0xa6c2('0x74')](this[_0xa6c2('0x10')][_0x3a79c2[_0xa6c2('0x6d')]]);_0xc981c1[_0xa6c2('0x75')]=!![];_0xc981c1[_0xa6c2('0x7a')]=_0xa6c2('0x82');}}}catch(_0x4191a0){logger[_0xa6c2('0x40')]('[syncAgentConnect][VoiceQueueReport]',util[_0xa6c2('0x46')](_0x4191a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa6c2('0x24')]=function(_0x576012){try{if(this['isNotNull'](_0x576012)){if(this['queueReports'][_0x576012['uniqueid']]){var _0x5441fa=_['last'](this[_0xa6c2('0x10')][_0x576012['uniqueid']]);_0x5441fa[_0xa6c2('0x1f')]=![];_0x5441fa[_0xa6c2('0x79')]=null;_0x5441fa[_0xa6c2('0x83')]=!![];_0x5441fa[_0xa6c2('0x7c')]=_0x576012['membername'];_0x5441fa[_0xa6c2('0x77')]=_0x576012[_0xa6c2('0x77')];_0x5441fa['queuecallercomplete']=!![];_0x5441fa['queuecallerexit']=![];_0x5441fa[_0xa6c2('0x84')]=null;if(!_0x5441fa[_0xa6c2('0x85')]){if(_0x576012[_0xa6c2('0x86')]==_0xa6c2('0x85')){_0x5441fa[_0xa6c2('0x7a')]=_0xa6c2('0x87');}else{if(_['startsWith'](_0x576012[_0xa6c2('0x88')][_0xa6c2('0x89')](),'local/')){if(this[_0xa6c2('0x10')][_0x576012[_0xa6c2('0x8a')]]){var _0x31bb0a=_[_0xa6c2('0x74')](this[_0xa6c2('0x10')][_0x576012[_0xa6c2('0x8a')]]);_0x31bb0a['queuecallercomplete']=![];_0x31bb0a[_0xa6c2('0x8b')]=!![];_0x31bb0a['queuecallerexitAt']=moment(_0x5441fa[_0xa6c2('0x6e')])[_0xa6c2('0x8c')](_0x576012[_0xa6c2('0x77')],_0xa6c2('0x8d'))[_0xa6c2('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x31bb0a[_0xa6c2('0x7a')]=_0xa6c2('0x8e');_0x31bb0a['transfer']=!![];_0x31bb0a[_0xa6c2('0x8f')]=_0xa6c2('0x90');_0x31bb0a[_0xa6c2('0x91')]=_0x576012[_0xa6c2('0x92')];_0x31bb0a[_0xa6c2('0x93')]=_0x576012[_0xa6c2('0x6d')];var _0x3388c2=this['queueReports'][_0x576012['linkedid']];this[_0xa6c2('0x10')][_0x576012[_0xa6c2('0x8a')]]=this[_0xa6c2('0x10')][_0x576012[_0xa6c2('0x6d')]];this[_0xa6c2('0x10')][_0x576012[_0xa6c2('0x6d')]]=_0x3388c2;}}else{_0x5441fa[_0xa6c2('0x7a')]=_0xa6c2('0x94')+_0x576012[_0xa6c2('0x86')][_0xa6c2('0x95')]();}}}this[_0xa6c2('0x12')][_0x576012[_0xa6c2('0x6d')]]=_0x5441fa;this['emitVoiceQueueChannelRemove'](_0x5441fa);}}}catch(_0x70991b){logger[_0xa6c2('0x40')](_0xa6c2('0x96'),util['inspect'](_0x70991b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x26')]=function(_0x182ed6){try{if(this['isNotNull'](_0x182ed6)){this[_0xa6c2('0x97')](_0x182ed6[_0xa6c2('0x6d')],_[_0xa6c2('0x98')](_0x182ed6[_0xa6c2('0x99')])[0x0],_0x182ed6[_0xa6c2('0x9a')]);if(this['queueReports'][_0x182ed6['uniqueid']]){var _0x52b9b4=_[_0xa6c2('0x74')](this[_0xa6c2('0x10')][_0x182ed6[_0xa6c2('0x6d')]]);if(_0x52b9b4){if(this[_0xa6c2('0x64')](_0x182ed6['variable'])&&this['isNotNull'](_0x182ed6[_0xa6c2('0x99')]['queuestatus'])){switch(_0x182ed6[_0xa6c2('0x9a')]){case _0xa6c2('0x9b'):_0x52b9b4['queuecallerexit']=![];_0x52b9b4[_0xa6c2('0x84')]=null;break;default:_0x52b9b4[_0xa6c2('0x8b')]=!![];_0x52b9b4[_0xa6c2('0x84')]=moment()['format'](_0xa6c2('0x6f'));_0x52b9b4['queuecallerleaveAt']=moment()[_0xa6c2('0x49')](_0xa6c2('0x6f'));}_0x52b9b4[_0xa6c2('0x1f')]=![];_0x52b9b4[_0xa6c2('0x79')]=null;_0x52b9b4[_0xa6c2('0x7a')]=_0x182ed6[_0xa6c2('0x9a')];this[_0xa6c2('0x12')][_0x182ed6[_0xa6c2('0x6d')]]=_0x52b9b4;this[_0xa6c2('0x45')](_0x52b9b4);}else if(this['isNotNull'](_0x182ed6[_0xa6c2('0x99')])&&this[_0xa6c2('0x64')](_0x182ed6[_0xa6c2('0x99')][_0xa6c2('0x9c')])){if(!_0x52b9b4['queuecallerabandon']){_0x52b9b4[_0xa6c2('0x8b')]=!![];_0x52b9b4[_0xa6c2('0x84')]=moment()['format'](_0xa6c2('0x6f'));_0x52b9b4[_0xa6c2('0x7a')]='EXITWITHKEY';_0x52b9b4[_0xa6c2('0x7d')]=moment()[_0xa6c2('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa6c2('0x12')][_0x182ed6['uniqueid']]=_0x52b9b4;}}_0x52b9b4[_0xa6c2('0x17')]=this[_0xa6c2('0x17')][_0x182ed6[_0xa6c2('0x6d')]];}}}}catch(_0x30ad76){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0xa6c2('0x46')](_0x30ad76,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6c2('0xb')][_0xa6c2('0x97')]=function(_0x525539,_0x4bfd20,_0x10dfd2){var _0x8cf752=[_0xa6c2('0x9d'),_0xa6c2('0x9e'),_0xa6c2('0x9f'),'rtpaudioqosjitterbridged',_0xa6c2('0xa0'),_0xa6c2('0xa1'),_0xa6c2('0xa2'),_0xa6c2('0xa3'),'sipcallid','sipuri',_0xa6c2('0xa4'),'bridgepvtcallid','membercalls','memberdynamic',_0xa6c2('0xa5'),'memberlastcall',_0xa6c2('0xa6'),_0xa6c2('0xa7'),_0xa6c2('0xa8')];if(!_[_0xa6c2('0x3a')](_0x4bfd20)&&!_[_0xa6c2('0xa9')](_0x8cf752,_0x4bfd20)){if(_[_0xa6c2('0x31')](this[_0xa6c2('0x17')][_0x525539])){this[_0xa6c2('0x17')][_0x525539]={};}this[_0xa6c2('0x17')][_0x525539][_0x4bfd20]=_0x10dfd2;}};VoiceQueueReport['prototype'][_0xa6c2('0x28')]=function(_0x31373e){try{if(this[_0xa6c2('0x64')](_0x31373e)){if(this['queueReports'][_0x31373e[_0xa6c2('0x6d')]]){for(var _0x5c35d0=0x0,_0x1d119b={};_0x5c35d00x0?_0xb80700:0x0;this[_0xaeba('0x12')][_0x5897c7[_0xaeba('0x5c')]][_0xaeba('0x30')]=this['voiceQueues'][_0x5897c7['queue']]['talking']>_[_0xaeba('0x5f')](_0x5897c7[_0xaeba('0x60')])?_[_0xaeba('0x5f')](_0x5897c7['loggedin']):this[_0xaeba('0x12')][_0x5897c7[_0xaeba('0x5c')]]['talking'];this[_0xaeba('0x61')](this[_0xaeba('0x12')][_0x5897c7['queue']]);}ami[_0xaeba('0x44')](_0xaeba('0x62'),this[_0xaeba('0x12')][_0x5897c7['queue']]);}}}catch(_0xb001e3){logger[_0xaeba('0x3c')]('[syncQueueSummary][VoiceQueueReport]',util[_0xaeba('0x63')](_0xb001e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaeba('0xc')]['syncQueueSummaryComplete']=function(_0x501af8){this[_0xaeba('0x13')]=!![];};VoiceQueueReport[_0xaeba('0xc')]['syncNewExten']=function(_0x1597ff){};VoiceQueueReport[_0xaeba('0xc')][_0xaeba('0x1a')]=function(_0x13efd4){try{if(this['isNotNull'](_0x13efd4)){if(_[_0xaeba('0x56')](this[_0xaeba('0x3d')][_0x13efd4[_0xaeba('0x64')]])){this[_0xaeba('0x3d')][_0x13efd4['uniqueid']]=[];this[_0xaeba('0x35')][_0x13efd4[_0xaeba('0x64')]]={};}var _0x2a17e5=new QueueReport();_0x2a17e5['name']=_0x13efd4['queue'];_0x2a17e5[_0xaeba('0x47')]=this['voiceQueues'][_0x2a17e5['name']]&&this['voiceQueues'][_0x2a17e5[_0xaeba('0x45')]][_0xaeba('0x47')]?this['voiceQueues'][_0x2a17e5['name']][_0xaeba('0x47')]||'inbound':'inbound';_0x2a17e5[_0xaeba('0x5c')]=_0x13efd4[_0xaeba('0x5c')];_0x2a17e5[_0xaeba('0x65')]=moment()[_0xaeba('0x42')](_0xaeba('0x66'));_0x2a17e5[_0xaeba('0x67')]=_0x13efd4['position'];_0x2a17e5[_0xaeba('0x68')]=_0x13efd4[_0xaeba('0x68')];_[_0xaeba('0x69')](_0x2a17e5,_[_0xaeba('0x6a')](_0x13efd4,_[_0xaeba('0x6b')](_0x2a17e5)));this[_0xaeba('0x3d')][_0x13efd4['uniqueid']]['push'](_0x2a17e5);this['channels'][_0x13efd4[_0xaeba('0x64')]]=_0x2a17e5;this[_0xaeba('0x41')](_0x2a17e5);}}catch(_0x54e423){logger[_0xaeba('0x3c')]('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x54e423,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x2e556a){try{if(this['isNotNull'](_0x2e556a)){if(this[_0xaeba('0x3d')][_0x2e556a['uniqueid']]){var _0x54c66b=_[_0xaeba('0x6c')](this[_0xaeba('0x3d')][_0x2e556a[_0xaeba('0x64')]]);_0x54c66b[_0xaeba('0x6d')]=![];_0x54c66b[_0xaeba('0x6e')]=null;_0x54c66b[_0xaeba('0x6f')]=_0x2e556a[_0xaeba('0x6f')];_0x54c66b[_0xaeba('0x70')]=_0x2e556a[_0xaeba('0x70')];_0x54c66b[_0xaeba('0x1b')]=!![];_0x54c66b['queuecallerabandonAt']=moment()[_0xaeba('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x54c66b[_0xaeba('0x71')]=_0xaeba('0x72');_0x54c66b[_0xaeba('0x73')]=null;this[_0xaeba('0x35')][_0x2e556a[_0xaeba('0x64')]]=_0x54c66b;this['emitVoiceQueueChannelRemove'](_0x54c66b);}}}catch(_0x57ce94){logger['error'](_0xaeba('0x74'),util[_0xaeba('0x63')](_0x57ce94,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x26990e){try{if(this[_0xaeba('0x55')](_0x26990e)){if(this[_0xaeba('0x3d')][_0x26990e[_0xaeba('0x64')]]){var _0x5de49f=_[_0xaeba('0x6c')](this[_0xaeba('0x3d')][_0x26990e[_0xaeba('0x64')]]);_0x5de49f['queuecallerleaveAt']=moment()[_0xaeba('0x42')](_0xaeba('0x66'));_0x5de49f[_0xaeba('0x75')]=_0x26990e[_0xaeba('0x75')];_0x5de49f['connectedlinename']=_0x26990e['connectedlinename'];this[_0xaeba('0x35')][_0x26990e[_0xaeba('0x64')]]=_0x5de49f;this['emitVoiceQueueChannelSave'](_0x5de49f);}}}catch(_0x4d8581){logger['error'](_0xaeba('0x76'),util[_0xaeba('0x63')](_0x4d8581,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaeba('0xc')][_0xaeba('0x77')]=function(_0x91c97c){try{if(this['isNotNull'](_0x91c97c)){if(this[_0xaeba('0x3d')][_0x91c97c[_0xaeba('0x64')]]){var _0x75f800=_['last'](this[_0xaeba('0x3d')][_0x91c97c[_0xaeba('0x64')]]);_0x75f800[_0xaeba('0x6d')]=!![];_0x75f800['queuecallerexitreason']=_0xaeba('0x78');}}}catch(_0x3c0d87){logger['error'](_0xaeba('0x79'),util[_0xaeba('0x63')](_0x3c0d87,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaeba('0xc')][_0xaeba('0x20')]=function(_0x2d655e){try{if(this[_0xaeba('0x55')](_0x2d655e)){if(this[_0xaeba('0x3d')][_0x2d655e[_0xaeba('0x64')]]){var _0x3e5b93=_[_0xaeba('0x6c')](this[_0xaeba('0x3d')][_0x2d655e['uniqueid']]);_0x3e5b93[_0xaeba('0x1b')]=![];_0x3e5b93['queuecallerabandonAt']=null;_0x3e5b93[_0xaeba('0x7a')]=!![];_0x3e5b93[_0xaeba('0x73')]=_0x2d655e[_0xaeba('0x7b')];_0x3e5b93[_0xaeba('0x6f')]=_0x2d655e[_0xaeba('0x6f')];_0x3e5b93[_0xaeba('0x6d')]=!![];_0x3e5b93['queuecallerexit']=![];_0x3e5b93['queuecallerexitAt']=null;if(!_0x3e5b93[_0xaeba('0x7c')]){if(_0x2d655e[_0xaeba('0x7d')]==_0xaeba('0x7c')){_0x3e5b93['queuecallerexitreason']=_0xaeba('0x7e');}else{if(_[_0xaeba('0x7f')](_0x2d655e[_0xaeba('0x39')][_0xaeba('0x80')](),_0xaeba('0x81'))){if(this[_0xaeba('0x3d')][_0x2d655e[_0xaeba('0x82')]]){var _0x3e0666=_[_0xaeba('0x6c')](this[_0xaeba('0x3d')][_0x2d655e[_0xaeba('0x82')]]);_0x3e0666[_0xaeba('0x6d')]=![];_0x3e0666[_0xaeba('0x83')]=!![];_0x3e0666[_0xaeba('0x84')]=moment(_0x3e5b93['queuecallerjoinAt'])[_0xaeba('0x85')](_0x2d655e['holdtime'],'seconds')[_0xaeba('0x42')](_0xaeba('0x66'));_0x3e0666[_0xaeba('0x71')]='FORWARDTRANSFER';_0x3e0666['transfer']=!![];_0x3e0666['transfertype']=_0xaeba('0x86');_0x3e0666['transferexten']=_0x2d655e[_0xaeba('0x87')];_0x3e0666[_0xaeba('0x88')]=_0x2d655e[_0xaeba('0x64')];var _0x4a8f3d=this[_0xaeba('0x3d')][_0x2d655e['linkedid']];this['queueReports'][_0x2d655e[_0xaeba('0x82')]]=this[_0xaeba('0x3d')][_0x2d655e[_0xaeba('0x64')]];this[_0xaeba('0x3d')][_0x2d655e['uniqueid']]=_0x4a8f3d;}}else{_0x3e5b93['queuecallerexitreason']=_0xaeba('0x89')+_0x2d655e[_0xaeba('0x7d')][_0xaeba('0x8a')]();}}}this[_0xaeba('0x35')][_0x2d655e[_0xaeba('0x64')]]=_0x3e5b93;this[_0xaeba('0x40')](_0x3e5b93);}}}catch(_0x4f9c19){logger[_0xaeba('0x3c')](_0xaeba('0x8b'),util['inspect'](_0x4f9c19,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaeba('0x23')]=function(_0x2ffe33){try{if(this[_0xaeba('0x55')](_0x2ffe33)){this[_0xaeba('0x8c')](_0x2ffe33[_0xaeba('0x64')],_['keys'](_0x2ffe33['variable'])[0x0],_0x2ffe33[_0xaeba('0x8d')]);if(this[_0xaeba('0x3d')][_0x2ffe33[_0xaeba('0x64')]]){var _0x2897ed=_[_0xaeba('0x6c')](this[_0xaeba('0x3d')][_0x2ffe33[_0xaeba('0x64')]]);if(_0x2897ed){if(this['isNotNull'](_0x2ffe33[_0xaeba('0x8e')])&&this['isNotNull'](_0x2ffe33['variable'][_0xaeba('0x8f')])){switch(_0x2ffe33[_0xaeba('0x8d')]){case'CONTINUE':_0x2897ed[_0xaeba('0x83')]=![];_0x2897ed[_0xaeba('0x84')]=null;break;default:_0x2897ed[_0xaeba('0x83')]=!![];_0x2897ed[_0xaeba('0x84')]=moment()[_0xaeba('0x42')](_0xaeba('0x66'));_0x2897ed[_0xaeba('0x90')]=moment()[_0xaeba('0x42')](_0xaeba('0x66'));}_0x2897ed[_0xaeba('0x1b')]=![];_0x2897ed[_0xaeba('0x91')]=null;_0x2897ed['queuecallerexitreason']=_0x2ffe33[_0xaeba('0x8d')];this[_0xaeba('0x35')][_0x2ffe33[_0xaeba('0x64')]]=_0x2897ed;this['emitVoiceQueueChannelRemove'](_0x2897ed);}else if(this[_0xaeba('0x55')](_0x2ffe33['variable'])&&this[_0xaeba('0x55')](_0x2ffe33[_0xaeba('0x8e')][_0xaeba('0x92')])){if(!_0x2897ed[_0xaeba('0x1b')]){_0x2897ed[_0xaeba('0x83')]=!![];_0x2897ed[_0xaeba('0x84')]=moment()[_0xaeba('0x42')](_0xaeba('0x66'));_0x2897ed['queuecallerexitreason']=_0xaeba('0x93');_0x2897ed[_0xaeba('0x90')]=moment()[_0xaeba('0x42')](_0xaeba('0x66'));this[_0xaeba('0x35')][_0x2ffe33[_0xaeba('0x64')]]=_0x2897ed;}}_0x2897ed[_0xaeba('0x15')]=this[_0xaeba('0x15')][_0x2ffe33[_0xaeba('0x64')]];}}}}catch(_0x349e40){logger[_0xaeba('0x3c')](_0xaeba('0x94'),util[_0xaeba('0x63')](_0x349e40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaeba('0xc')]['addVariable']=function(_0x3bd758,_0x2c49da,_0x1f18fc){var _0x1fe1a1=[_0xaeba('0x95'),_0xaeba('0x96'),'rtpaudioqosjitter',_0xaeba('0x97'),'rtpaudioqosloss',_0xaeba('0x98'),'rtpaudioqosrtt',_0xaeba('0x99'),_0xaeba('0x9a'),_0xaeba('0x9b'),_0xaeba('0x9c'),_0xaeba('0x9d'),_0xaeba('0x9e'),'memberdynamic',_0xaeba('0x9f'),_0xaeba('0xa0'),'membername',_0xaeba('0xa1'),'memberrealtime'];if(!_[_0xaeba('0x37')](_0x2c49da)&&!_[_0xaeba('0xa2')](_0x1fe1a1,_0x2c49da)){if(_[_0xaeba('0x56')](this[_0xaeba('0x15')][_0x3bd758])){this[_0xaeba('0x15')][_0x3bd758]={};}this['variables'][_0x3bd758][_0x2c49da]=_0x1f18fc;}};VoiceQueueReport['prototype'][_0xaeba('0x24')]=function(_0x305810){try{if(this[_0xaeba('0x55')](_0x305810)){if(this[_0xaeba('0x3d')][_0x305810[_0xaeba('0x64')]]){for(var _0x306854=0x0,_0x732818={};_0x306854=0x0?moment(_0x31d998[_0xed76('0x15')])[_0xed76('0xe')](_0x31d998['starttime'],_0xed76('0xf')):null,'data1':'outbound','data2':_0x31d998[_0xed76('0x13')],'data3':_0x31d998['exten'],'data4':_0x31d998[_0xed76('0x17')]||null,'role':_0xed76('0x18'),'internal':_0x31d998['accountcode']?_[_0xed76('0x19')](_0x31d998[_0xed76('0x13')]):undefined,'uniqueid':_0x31d998[_0xed76('0x1a')]},'log':_0xed76('0x6')});}; \ No newline at end of file +var _0x5e0a=['voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','membername','starttime','endtime','outbound','toNumber','moment','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport'];(function(_0x249f54,_0x27ddeb){var _0x3367c7=function(_0x2901c7){while(--_0x2901c7){_0x249f54['push'](_0x249f54['shift']());}};_0x3367c7(++_0x27ddeb);}(_0x5e0a,0x1d5));var _0xa5e0=function(_0x5092af,_0xdc22e3){_0x5092af=_0x5092af-0x0;var _0x766861=_0x5e0a[_0x5092af];return _0x766861;};'use strict';var moment=require(_0xa5e0('0x0'));var _=require('lodash');var util=require(_0xa5e0('0x1'));var client=require('../client');exports[_0xa5e0('0x2')]=function(_0x34ddf9){var _0x35852e=_0x34ddf9[_0xa5e0('0x3')]||_0x34ddf9[_0xa5e0('0x4')];return client[_0xa5e0('0x5')](_0xa5e0('0x6'),{'body':{'channel':_0xa5e0('0x7'),'membername':_0x34ddf9[_0xa5e0('0x8')],'interface':_[_0xa5e0('0x9')](_0x34ddf9[_0xa5e0('0xa')])?util[_0xa5e0('0xb')](_0xa5e0('0xc'),_0x34ddf9[_0xa5e0('0x8')]):_0x34ddf9['interface'],'type':'TALKING','enterAt':_0x34ddf9['queuecallerleaveAt'],'exitAt':_0x35852e,'duration':moment(_0x35852e)[_0xa5e0('0xd')](_0x34ddf9[_0xa5e0('0xe')],_0xa5e0('0xf')),'data1':_0xa5e0('0x10'),'data2':_0x34ddf9[_0xa5e0('0x11')],'data3':_0x34ddf9[_0xa5e0('0x12')],'data4':null,'data5':_0x34ddf9[_0xa5e0('0x13')],'role':_0xa5e0('0x14'),'internal':_0x34ddf9[_0xa5e0('0x15')]?_['toNumber'](_0x34ddf9[_0xa5e0('0x15')]):undefined,'uniqueid':_0x34ddf9[_0xa5e0('0x16')]},'log':_0xa5e0('0x6')});};exports['voiceDialReport']=function(_0x55c7be){return client[_0xa5e0('0x5')](_0xa5e0('0x6'),{'body':{'channel':_0xa5e0('0x7'),'membername':_0x55c7be[_0xa5e0('0x17')],'interface':_0x55c7be['interface'],'type':'TALKING','enterAt':_0x55c7be[_0xa5e0('0x18')],'exitAt':_0x55c7be[_0xa5e0('0x19')],'duration':moment(_0x55c7be[_0xa5e0('0x19')])['diff'](_0x55c7be[_0xa5e0('0x18')],_0xa5e0('0xf'))>=0x0?moment(_0x55c7be[_0xa5e0('0x19')])[_0xa5e0('0xd')](_0x55c7be[_0xa5e0('0x18')],_0xa5e0('0xf')):null,'data1':_0xa5e0('0x1a'),'data2':_0x55c7be['accountcode'],'data3':_0x55c7be[_0xa5e0('0x12')],'data4':_0x55c7be['dialstring']||null,'role':'agent','internal':_0x55c7be[_0xa5e0('0x15')]?_[_0xa5e0('0x1b')](_0x55c7be[_0xa5e0('0x15')]):undefined,'uniqueid':_0x55c7be[_0xa5e0('0x16')]},'log':_0xa5e0('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 021100e..274bb13 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 _0x265d=['../client','getTemplates','name','GetTemplate'];(function(_0x3b10d7,_0xc94480){var _0x5307d7=function(_0x3d80f4){while(--_0x3d80f4){_0x3b10d7['push'](_0x3b10d7['shift']());}};_0x5307d7(++_0xc94480);}(_0x265d,0x7c));var _0xd265=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x265d[_0x62c958];return _0x57ec61;};'use strict';var client=require(_0xd265('0x0'));exports[_0xd265('0x1')]=function(_0x4abb5e){return function(_0x1875ee){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xd265('0x2'),'html']},'log':_0xd265('0x3')});};}; \ No newline at end of file +var _0x3444=['Request','GetTemplate','name','html','getTemplates'];(function(_0xb9ec58,_0x1ca2cd){var _0x50a819=function(_0xd424c7){while(--_0xd424c7){_0xb9ec58['push'](_0xb9ec58['shift']());}};_0x50a819(++_0x1ca2cd);}(_0x3444,0x167));var _0x4344=function(_0x5daacc,_0x488ecf){_0x5daacc=_0x5daacc-0x0;var _0x76d26a=_0x3444[_0x5daacc];return _0x76d26a;};'use strict';var client=require('../client');exports[_0x4344('0x0')]=function(_0x3c2825){return function(_0x154a90){return client[_0x4344('0x1')](_0x4344('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4344('0x3'),_0x4344('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 2626425..1fdaee7 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x27c487,_0x178cee){var _0x233370=function(_0x56bc3e){while(--_0x56bc3e){_0x27c487['push'](_0x27c487['shift']());}};_0x233370(++_0x178cee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x5dd66f,_0x2792a0){var _0x763a=function(_0x41cbeb){while(--_0x41cbeb){_0x5dd66f['push'](_0x5dd66f['shift']());}};_0x763a(++_0x2792a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d884557..7c02584 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 _0x3bcc=['name','../client','getTrunks','Request','GetTrunk'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0x3bcc,0x1a0));var _0xc3bc=function(_0x2c0c22,_0x584e2b){_0x2c0c22=_0x2c0c22-0x0;var _0x3f174e=_0x3bcc[_0x2c0c22];return _0x3f174e;};'use strict';var client=require(_0xc3bc('0x0'));exports[_0xc3bc('0x1')]=function(_0x39136f){return function(_0x44cfe1){return client[_0xc3bc('0x2')](_0xc3bc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc3bc('0x4'),'registry']},'log':_0xc3bc('0x3')});};}; \ No newline at end of file +var _0x9f26=['GetTrunk','registry','getTrunks'];(function(_0x444217,_0x42cf7f){var _0x5d7a0b=function(_0x3fc41b){while(--_0x3fc41b){_0x444217['push'](_0x444217['shift']());}};_0x5d7a0b(++_0x42cf7f);}(_0x9f26,0x1eb));var _0x69f2=function(_0x4993a3,_0x492845){_0x4993a3=_0x4993a3-0x0;var _0x5723ec=_0x9f26[_0x4993a3];return _0x5723ec;};'use strict';var client=require('../client');exports[_0x69f2('0x0')]=function(_0x227953){return function(_0x3f2505){return client['Request'](_0x69f2('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x69f2('0x2')]},'log':_0x69f2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9f0d457..5239689 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 _0xc383=['pauseType','lastPauseAt','voicePause','phone','interface','getTelephones','name','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','agent','getAgent','../client','getAgents','Request','GetUser','email','accountcode','fullname','online','lastLoginAt'];(function(_0x453b96,_0x3f6589){var _0x5300ef=function(_0x640653){while(--_0x640653){_0x453b96['push'](_0x453b96['shift']());}};_0x5300ef(++_0x3f6589);}(_0xc383,0xe7));var _0x3c38=function(_0x5ce14b,_0x204cab){_0x5ce14b=_0x5ce14b-0x0;var _0x29c5fc=_0xc383[_0x5ce14b];return _0x29c5fc;};'use strict';var client=require(_0x3c38('0x0'));exports[_0x3c38('0x1')]=function(){return function(){return client[_0x3c38('0x2')](_0x3c38('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name',_0x3c38('0x4'),_0x3c38('0x5'),_0x3c38('0x6'),_0x3c38('0x7'),_0x3c38('0x8'),_0x3c38('0x9'),_0x3c38('0xa'),_0x3c38('0xb'),_0x3c38('0xc'),'mobile',_0x3c38('0xd')]},'log':_0x3c38('0x1')});};};exports[_0x3c38('0xe')]=function(){return function(){return client[_0x3c38('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3c38('0xf'),_0x3c38('0x5'),_0x3c38('0x10')]},'log':'getTelephones'});};};exports[_0x3c38('0x11')]=function(_0x124788,_0x288e48,_0x49ecae){return client[_0x3c38('0x2')](_0x3c38('0x12'),{'body':{'type':_0x288e48,'uniqueid':_0x49ecae},'options':{'where':{'id':_0x124788['id']}},'log':_0x3c38('0x11')});};exports[_0x3c38('0x13')]=function(_0x1bb76c){return client[_0x3c38('0x2')](_0x3c38('0x14'),{'body':{},'options':{'where':{'id':_0x1bb76c['id']}},'log':_0x3c38('0x11')});};exports['getAgent']=function(_0x349648){return client['Request'](_0x3c38('0x15'),{'options':{'raw':![],'where':{'role':_0x3c38('0x16'),'id':_0x349648},'attributes':['id',_0x3c38('0xf'),_0x3c38('0x4'),'accountcode',_0x3c38('0x6'),'online',_0x3c38('0x8'),'pauseType',_0x3c38('0xa'),_0x3c38('0xb'),_0x3c38('0xd')]},'log':_0x3c38('0x17')});}; \ No newline at end of file +var _0x4cac=['name','email','accountcode','online','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','telephone','savePause','PauseUser','UnpauseUser','fullname','pauseType','GetUser','agent'];(function(_0x486387,_0x3bab7d){var _0x2f495b=function(_0x5baa58){while(--_0x5baa58){_0x486387['push'](_0x486387['shift']());}};_0x2f495b(++_0x3bab7d);}(_0x4cac,0x13e));var _0xc4ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4cac[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client['Request'](_0xc4ca('0x0'),{'options':{'raw':![],'where':{'role':_0xc4ca('0x1')},'attributes':['id',_0xc4ca('0x2'),_0xc4ca('0x3'),_0xc4ca('0x4'),'fullname',_0xc4ca('0x5'),_0xc4ca('0x6'),'pauseType',_0xc4ca('0x7'),_0xc4ca('0x8'),_0xc4ca('0x9'),_0xc4ca('0xa'),_0xc4ca('0xb')]},'log':'getAgents'});};};exports[_0xc4ca('0xc')]=function(){return function(){return client[_0xc4ca('0xd')](_0xc4ca('0x0'),{'options':{'raw':!![],'where':{'role':_0xc4ca('0xe')},'attributes':['id','name',_0xc4ca('0x4'),'internal']},'log':_0xc4ca('0xc')});};};exports[_0xc4ca('0xf')]=function(_0x173f72,_0x3b706c,_0x2392b1){return client[_0xc4ca('0xd')](_0xc4ca('0x10'),{'body':{'type':_0x3b706c,'uniqueid':_0x2392b1},'options':{'where':{'id':_0x173f72['id']}},'log':_0xc4ca('0xf')});};exports['saveUnpause']=function(_0x5434d9){return client[_0xc4ca('0xd')](_0xc4ca('0x11'),{'body':{},'options':{'where':{'id':_0x5434d9['id']}},'log':_0xc4ca('0xf')});};exports['getAgent']=function(_0x2ff67e){return client[_0xc4ca('0xd')]('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0x2ff67e},'attributes':['id',_0xc4ca('0x2'),_0xc4ca('0x3'),_0xc4ca('0x4'),_0xc4ca('0x12'),_0xc4ca('0x5'),'lastLoginAt',_0xc4ca('0x13'),_0xc4ca('0x7'),_0xc4ca('0x8'),'interface']},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b165e3f..0a9965d 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 _0x9392=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','Request'];(function(_0xd9c69a,_0x36109b){var _0x35dfa9=function(_0x1f4aac){while(--_0x1f4aac){_0xd9c69a['push'](_0xd9c69a['shift']());}};_0x35dfa9(++_0x36109b);}(_0x9392,0x6f));var _0x2939=function(_0x2bfb31,_0xdd9aae){_0x2bfb31=_0x2bfb31-0x0;var _0x2b00ce=_0x9392[_0x2bfb31];return _0x2b00ce;};'use strict';var client=require(_0x2939('0x0'));exports[_0x2939('0x1')]=function(_0x2f2265){return client['Request'](_0x2939('0x2'),{'body':_0x2f2265,'log':_0x2939('0x2')});};exports['update']=function(_0x523f43,_0x44bd7a,_0x94e7d2){return client[_0x2939('0x3')](_0x2939('0x4'),{'body':_0x523f43,'options':{'where':{'uniqueid':_0x44bd7a,'interface':_0x94e7d2}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xc680=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','create'];(function(_0x274f23,_0xafcf08){var _0x2c0024=function(_0x5c065b){while(--_0x5c065b){_0x274f23['push'](_0x274f23['shift']());}};_0x2c0024(++_0xafcf08);}(_0xc680,0x143));var _0x0c68=function(_0x19b988,_0x915580){_0x19b988=_0x19b988-0x0;var _0x14b90b=_0xc680[_0x19b988];return _0x14b90b;};'use strict';var client=require('../client');exports[_0x0c68('0x0')]=function(_0x9b0451){return client[_0x0c68('0x1')](_0x0c68('0x2'),{'body':_0x9b0451,'log':_0x0c68('0x2')});};exports['update']=function(_0x61a155,_0x105156,_0x380ac9){return client[_0x0c68('0x1')](_0x0c68('0x3'),{'body':_0x61a155,'options':{'where':{'uniqueid':_0x105156,'interface':_0x380ac9}},'log':_0x0c68('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 122c054..886e1a6 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 _0x2f19=['lodash','../client','create','CreateVoiceCallReport','merge','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x1b2af3,_0x3a1e61){var _0x131fa0=function(_0x481dae){while(--_0x481dae){_0x1b2af3['push'](_0x1b2af3['shift']());}};_0x131fa0(++_0x3a1e61);}(_0x2f19,0xee));var _0x92f1=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x2f19[_0x229d7e];return _0xa78280;};'use strict';var moment=require(_0x92f1('0x0'));var util=require(_0x92f1('0x1'));var _=require(_0x92f1('0x2'));var client=require(_0x92f1('0x3'));exports[_0x92f1('0x4')]=function(_0x2dced4){return client['Request'](_0x92f1('0x5'),{'body':_[_0x92f1('0x6')](_0x2dced4,{'source':_0x2dced4['calleridnum'],'destinationcontext':_0x2dced4['context'],'callerid':_0x2dced4[_0x92f1('0x7')],'amaflags':_0x92f1('0x8')}),'log':_0x92f1('0x5')});};exports[_0x92f1('0x9')]=function(){return function(){return client[_0x92f1('0xa')](_0x92f1('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x92f1('0xc')]('day')[_0x92f1('0xd')](_0x92f1('0xe')),moment()['endOf'](_0x92f1('0xf'))[_0x92f1('0xd')](_0x92f1('0xe'))]}},'attributes':['type',_0x92f1('0x10'),_0x92f1('0x11'),_0x92f1('0x12')]},'log':_0x92f1('0x13')});};}; \ No newline at end of file +var _0x1cb5=['endOf','type','duration','billableseconds','GetVoiceCallReports','moment','../client','create','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x41bb13,_0xe359ee){var _0x438e2d=function(_0x239ced){while(--_0x239ced){_0x41bb13['push'](_0x41bb13['shift']());}};_0x438e2d(++_0xe359ee);}(_0x1cb5,0x145));var _0x51cb=function(_0x339428,_0x7cfef6){_0x339428=_0x339428-0x0;var _0x1a5679=_0x1cb5[_0x339428];return _0x1a5679;};'use strict';var moment=require(_0x51cb('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x51cb('0x1'));exports[_0x51cb('0x2')]=function(_0xe5f5ab){return client['Request']('CreateVoiceCallReport',{'body':_['merge'](_0xe5f5ab,{'source':_0xe5f5ab[_0x51cb('0x3')],'destinationcontext':_0xe5f5ab[_0x51cb('0x4')],'callerid':_0xe5f5ab[_0x51cb('0x5')],'amaflags':_0x51cb('0x6')}),'log':'CreateVoiceCallReport'});};exports[_0x51cb('0x7')]=function(){return function(){return client[_0x51cb('0x8')](_0x51cb('0x9'),{'options':{'where':{'type':[_0x51cb('0xa')],'createdAt':{'$between':[moment()[_0x51cb('0xb')](_0x51cb('0xc'))[_0x51cb('0xd')](_0x51cb('0xe')),moment()[_0x51cb('0xf')](_0x51cb('0xc'))[_0x51cb('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x51cb('0x10'),'disposition',_0x51cb('0x11'),_0x51cb('0x12')]},'log':_0x51cb('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ba02080..1ec4f0e 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 _0x45fc=['create','Request'];(function(_0x5008ba,_0x488194){var _0x58d985=function(_0x16ea4c){while(--_0x16ea4c){_0x5008ba['push'](_0x5008ba['shift']());}};_0x58d985(++_0x488194);}(_0x45fc,0x13a));var _0xc45f=function(_0x4ccda7,_0x340177){_0x4ccda7=_0x4ccda7-0x0;var _0x4d5f96=_0x45fc[_0x4ccda7];return _0x4d5f96;};'use strict';var client=require('../client');exports[_0xc45f('0x0')]=function(_0x3a1a57){return client[_0xc45f('0x1')]('CreateVoiceDialReport',{'body':_0x3a1a57,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x03b6=['../client','create','Request','CreateVoiceDialReport'];(function(_0x1b99a6,_0x192cb8){var _0x19eccb=function(_0x5827a8){while(--_0x5827a8){_0x1b99a6['push'](_0x1b99a6['shift']());}};_0x19eccb(++_0x192cb8);}(_0x03b6,0x1c4));var _0x603b=function(_0x8667a6,_0xfb96e){_0x8667a6=_0x8667a6-0x0;var _0x506ee0=_0x03b6[_0x8667a6];return _0x506ee0;};'use strict';var client=require(_0x603b('0x0'));exports[_0x603b('0x1')]=function(_0x442463){return client[_0x603b('0x2')]('CreateVoiceDialReport',{'body':_0x442463,'log':_0x603b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 40f06e3..9ce07b4 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 _0xccd5=['Request','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x4b8dbf,_0x5f4bd6){var _0x42c83e=function(_0x5d009a){while(--_0x5d009a){_0x4b8dbf['push'](_0x4b8dbf['shift']());}};_0x42c83e(++_0x5f4bd6);}(_0xccd5,0x198));var _0x5ccd=function(_0x282e4f,_0x394d76){_0x282e4f=_0x282e4f-0x0;var _0x3c7c19=_0xccd5[_0x282e4f];return _0x3c7c19;};'use strict';var client=require(_0x5ccd('0x0'));exports[_0x5ccd('0x1')]=function(){return function(){return client[_0x5ccd('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x5ccd('0x3'),_0x5ccd('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x5ccd('0x1')});};}; \ No newline at end of file +var _0xf010=['recordingFormat','../client','getVoiceExtensions','exten'];(function(_0x5d4403,_0x54030c){var _0xcc205f=function(_0x3f2119){while(--_0x3f2119){_0x5d4403['push'](_0x5d4403['shift']());}};_0xcc205f(++_0x54030c);}(_0xf010,0x1e9));var _0x0f01=function(_0x197a02,_0x1e1c95){_0x197a02=_0x197a02-0x0;var _0x3ba67a=_0xf010[_0x197a02];return _0x3ba67a;};'use strict';var client=require(_0x0f01('0x0'));exports[_0x0f01('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x0f01('0x2'),_0x0f01('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 65dd589..d5f152a 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 _0x1ab1=['dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x1ab1,0x83));var _0x11ab=function(_0x133bea,_0x43f924){_0x133bea=_0x133bea-0x0;var _0x13f9a8=_0x1ab1[_0x133bea];return _0x13f9a8;};'use strict';var client=require('../client');exports[_0x11ab('0x0')]=function(){return function(){return client[_0x11ab('0x1')](_0x11ab('0x2'),{'options':{'raw':![],'attributes':['id',_0x11ab('0x3'),_0x11ab('0x4'),_0x11ab('0x5'),_0x11ab('0x6'),'monitor_format',_0x11ab('0x7'),_0x11ab('0x8'),_0x11ab('0x9'),_0x11ab('0xa'),_0x11ab('0xb'),'dialPowerLevel',_0x11ab('0xc'),_0x11ab('0xd'),_0x11ab('0xe'),_0x11ab('0xf'),'dialOriginateCallerIdNumber',_0x11ab('0x10'),_0x11ab('0x11'),_0x11ab('0x12'),_0x11ab('0x13'),_0x11ab('0x14'),_0x11ab('0x15'),_0x11ab('0x16'),'dialBusyRetryFrequency',_0x11ab('0x17'),'dialNoAnswerRetryFrequency',_0x11ab('0x18'),_0x11ab('0x19'),_0x11ab('0x1a'),'dialPrefix','dialCheckDuplicateType',_0x11ab('0x1b'),_0x11ab('0x1c'),'dialAMDGreeting',_0x11ab('0x1d'),_0x11ab('0x1e'),'dialAMDMinWordLength',_0x11ab('0x1f'),'dialAMDMaximumNumberOfWords',_0x11ab('0x20'),_0x11ab('0x21'),'timeout','dialRecallMeTimeout',_0x11ab('0x22'),_0x11ab('0x23'),_0x11ab('0x24'),_0x11ab('0x25'),_0x11ab('0x26'),_0x11ab('0x27'),_0x11ab('0x28'),_0x11ab('0x29'),_0x11ab('0x2a'),_0x11ab('0x2b')],'include':[{'model':_0x11ab('0x2c'),'as':_0x11ab('0x2c'),'attributes':['id',_0x11ab('0x3'),'callerid',_0x11ab('0x2d')]},{'model':_0x11ab('0x2e'),'as':_0x11ab('0x2f'),'attributes':['id','name']},{'model':'Trunk','as':_0x11ab('0x30'),'attributes':['id',_0x11ab('0x3'),'callerid',_0x11ab('0x2d')]},{'model':_0x11ab('0x31'),'as':'Interval','attributes':['id',_0x11ab('0x3')],'include':[{'model':'Interval','as':_0x11ab('0x32'),'attributes':['id','name',_0x11ab('0x33')]}]}]},'log':_0x11ab('0x0')});};}; \ No newline at end of file +var _0x8109=['TrunkBackup','callerid','active','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','Trunk','name','mandatoryDispositionPause'];(function(_0xa71774,_0x2771f9){var _0x5bb5c0=function(_0x595050){while(--_0x595050){_0xa71774['push'](_0xa71774['shift']());}};_0x5bb5c0(++_0x2771f9);}(_0x8109,0xa9));var _0x9810=function(_0x326ed5,_0x3b3602){_0x326ed5=_0x326ed5-0x0;var _0x418dfb=_0x8109[_0x326ed5];return _0x418dfb;};'use strict';var client=require(_0x9810('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x9810('0x1')](_0x9810('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9810('0x3'),_0x9810('0x4'),_0x9810('0x5'),_0x9810('0x6'),_0x9810('0x7'),_0x9810('0x8'),_0x9810('0x9'),_0x9810('0xa'),_0x9810('0xb'),_0x9810('0xc'),_0x9810('0xd'),'dialPredictiveOptimizationPercentage',_0x9810('0xe'),_0x9810('0xf'),_0x9810('0x10'),_0x9810('0x11'),_0x9810('0x12'),'dialQueueTimeout',_0x9810('0x13'),_0x9810('0x14'),_0x9810('0x15'),'dialBusyMaxRetry',_0x9810('0x16'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x9810('0x17'),_0x9810('0x18'),_0x9810('0x19'),_0x9810('0x1a'),_0x9810('0x1b'),_0x9810('0x1c'),'dialAMDInitialSilence',_0x9810('0x1d'),_0x9810('0x1e'),_0x9810('0x1f'),_0x9810('0x20'),_0x9810('0x21'),_0x9810('0x22'),_0x9810('0x23'),'dialAMDMaximumWordLength',_0x9810('0x24'),_0x9810('0x25'),_0x9810('0x26'),_0x9810('0x27'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x9810('0x28'),'monitor_format','strategy',_0x9810('0x29'),_0x9810('0x2a'),_0x9810('0x2b')],'include':[{'model':_0x9810('0x2c'),'as':_0x9810('0x2c'),'attributes':['id',_0x9810('0x2d'),'callerid','active']},{'model':'Pause','as':_0x9810('0x2e'),'attributes':['id',_0x9810('0x2d')]},{'model':'Trunk','as':_0x9810('0x2f'),'attributes':['id',_0x9810('0x2d'),_0x9810('0x30'),_0x9810('0x31')]},{'model':_0x9810('0x32'),'as':_0x9810('0x32'),'attributes':['id','name'],'include':[{'model':_0x9810('0x32'),'as':_0x9810('0x33'),'attributes':['id','name',_0x9810('0x34')]}]}]},'log':_0x9810('0x35')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 72da14c..f26c9a8 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 _0x8d34=['CreateVoiceQueueReport','getVoiceQueueReports','Request','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallercomplete','queuecallerexit','queuecallerexitAt','queuecallerabandon','lodash','../client'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x8d34,0x16e));var _0x48d3=function(_0x1756dd,_0x4670b4){_0x1756dd=_0x1756dd-0x0;var _0x556afb=_0x8d34[_0x1756dd];return _0x556afb;};'use strict';var moment=require('moment');var _=require(_0x48d3('0x0'));var client=require(_0x48d3('0x1'));exports['create']=function(_0x457433){return client['Request'](_0x48d3('0x2'),{'body':_0x457433,'log':_0x48d3('0x2')});};exports[_0x48d3('0x3')]=function(){return function(){return client[_0x48d3('0x4')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x48d3('0x5')](_0x48d3('0x6'))[_0x48d3('0x7')](_0x48d3('0x8')),moment()[_0x48d3('0x9')](_0x48d3('0x6'))[_0x48d3('0x7')](_0x48d3('0x8'))]}},'attributes':[_0x48d3('0xa'),_0x48d3('0xb'),'queuecallerjoinAt','queuecallerleaveAt',_0x48d3('0xc'),'queuecallercompleteAt',_0x48d3('0xd'),_0x48d3('0xe'),_0x48d3('0xf'),'queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xbd5c=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','lodash','../client','Request','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queuecallerleaveAt','queuecallercomplete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd5c,0x1ec));var _0xcbd5=function(_0x5a041c,_0x554202){_0x5a041c=_0x5a041c-0x0;var _0x590229=_0xbd5c[_0x5a041c];return _0x590229;};'use strict';var moment=require('moment');var _=require(_0xcbd5('0x0'));var client=require(_0xcbd5('0x1'));exports['create']=function(_0x3cdc17){return client[_0xcbd5('0x2')]('CreateVoiceQueueReport',{'body':_0x3cdc17,'log':'CreateVoiceQueueReport'});};exports[_0xcbd5('0x3')]=function(){return function(){return client[_0xcbd5('0x2')](_0xcbd5('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xcbd5('0x5')](_0xcbd5('0x6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xcbd5('0x6'))[_0xcbd5('0x7')](_0xcbd5('0x8'))]}},'attributes':[_0xcbd5('0x9'),'queue','queuecallerjoinAt',_0xcbd5('0xa'),_0xcbd5('0xb'),_0xcbd5('0xc'),_0xcbd5('0xd'),_0xcbd5('0xe'),_0xcbd5('0xf'),_0xcbd5('0x10')]},'log':_0xcbd5('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 5c1b2b5..0b2a216 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 _0x7b23=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7b23,0xcb));var _0x37b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b23[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x41230f){return function(){return client['Request'](_0x37b2('0x0'),{'options':{'where':{'VoiceQueueId':_0x41230f,'paused':!![]},'raw':!![]},'log':_0x37b2('0x1')});};}; \ No newline at end of file +var _0x1d7e=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client','Request'];(function(_0x2b6602,_0xd3609a){var _0x38eb9a=function(_0x4a7884){while(--_0x4a7884){_0x2b6602['push'](_0x2b6602['shift']());}};_0x38eb9a(++_0xd3609a);}(_0x1d7e,0xa2));var _0xe1d7=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x1d7e[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0xe1d7('0x0'));exports['getVoiceQueueRtPauses']=function(_0x20d8df){return function(){return client[_0xe1d7('0x1')](_0xe1d7('0x2'),{'options':{'where':{'VoiceQueueId':_0x20d8df,'paused':!![]},'raw':!![]},'log':_0xe1d7('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e85b960..324e52a 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 _0xebd9=['Request','CreateVoiceRecording','monitorFilename','create'];(function(_0x378869,_0x47cdbc){var _0x3f7c1b=function(_0x1c620c){while(--_0x1c620c){_0x378869['push'](_0x378869['shift']());}};_0x3f7c1b(++_0x47cdbc);}(_0xebd9,0xc3));var _0x9ebd=function(_0x40729e,_0x5507cf){_0x40729e=_0x40729e-0x0;var _0x1c2cf3=_0xebd9[_0x40729e];return _0x1c2cf3;};'use strict';var _=require('lodash');var client=require('../client');exports[_0x9ebd('0x0')]=function(_0xb92a38){return client[_0x9ebd('0x1')](_0x9ebd('0x2'),{'body':_['merge'](_0xb92a38,{'value':_0xb92a38[_0x9ebd('0x3')]}),'log':_0x9ebd('0x2')});}; \ No newline at end of file +var _0xa6fa=['monitorFilename','../client','Request','CreateVoiceRecording','merge'];(function(_0x302064,_0x305e81){var _0x52462=function(_0x41c062){while(--_0x41c062){_0x302064['push'](_0x302064['shift']());}};_0x52462(++_0x305e81);}(_0xa6fa,0xc4));var _0xaa6f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa6fa[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var client=require(_0xaa6f('0x0'));exports['create']=function(_0x5cc51b){return client[_0xaa6f('0x1')](_0xaa6f('0x2'),{'body':_[_0xaa6f('0x3')](_0x5cc51b,{'value':_0x5cc51b[_0xaa6f('0x4')]}),'log':_0xaa6f('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 9f9c80c..797020e 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 _0xaee9=['origtransfererexten','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','result','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','origtransferercontext'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xaee9,0x6a));var _0x9aee=function(_0xd0967f,_0x2655f9){_0xd0967f=_0xd0967f-0x0;var _0x43c812=_0xaee9[_0xd0967f];return _0x43c812;};'use strict';var client=require('../client');exports[_0x9aee('0x0')]=function(_0x591b5c){return client[_0x9aee('0x1')](_0x9aee('0x2'),{'body':{'result':_0x591b5c['result'],'transfererchannel':_0x591b5c['transfererchannel'],'transferercalleridnum':_0x591b5c[_0x9aee('0x3')],'transferercalleridname':_0x591b5c[_0x9aee('0x4')],'transfererconnectedlinenum':_0x591b5c[_0x9aee('0x5')],'transfererconnectedlinename':_0x591b5c[_0x9aee('0x6')],'transfereraccountcode':_0x591b5c[_0x9aee('0x7')],'transferercontext':_0x591b5c[_0x9aee('0x8')],'transfererexten':_0x591b5c[_0x9aee('0x9')],'transfererlinkedid':_0x591b5c[_0x9aee('0xa')],'transfereechannel':_0x591b5c[_0x9aee('0xb')],'transfereecalleridnum':_0x591b5c[_0x9aee('0xc')],'transfereecalleridname':_0x591b5c[_0x9aee('0xd')],'transfereeconnectedlinenum':_0x591b5c[_0x9aee('0xe')],'transfereeconnectedlinename':_0x591b5c[_0x9aee('0xf')],'transfereeaccountcode':_0x591b5c[_0x9aee('0x10')],'transfereecontext':_0x591b5c[_0x9aee('0x11')],'transfereeexten':_0x591b5c[_0x9aee('0x12')],'transfereelinkedid':_0x591b5c[_0x9aee('0x13')],'isexternal':_0x591b5c[_0x9aee('0x14')],'context':_0x591b5c[_0x9aee('0x15')],'extension':_0x591b5c[_0x9aee('0x16')],'type':_0x9aee('0x17')},'log':_0x9aee('0x2')});};exports['attendedTransfer']=function(_0x3f8e93){return client[_0x9aee('0x1')](_0x9aee('0x2'),{'body':{'result':_0x3f8e93[_0x9aee('0x18')],'transfererchannel':_0x3f8e93[_0x9aee('0x19')],'transferercalleridnum':_0x3f8e93['origtransferercalleridnum'],'transferercalleridname':_0x3f8e93['origtransferercalleridname'],'transfererconnectedlinenum':_0x3f8e93['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3f8e93[_0x9aee('0x1a')],'transfereraccountcode':_0x3f8e93[_0x9aee('0x1b')],'transferercontext':_0x3f8e93['secondtransferercontext'],'transfererexten':_0x3f8e93[_0x9aee('0x1c')],'transfererlinkedid':_0x3f8e93[_0x9aee('0x1d')],'transfereechannel':_0x3f8e93['transfertargetchannel'],'transfereecalleridnum':_0x3f8e93['transfertargetcalleridnum'],'transfereecalleridname':_0x3f8e93['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3f8e93[_0x9aee('0x1e')],'transfereeconnectedlinename':_0x3f8e93[_0x9aee('0x1f')],'transfereeaccountcode':_0x3f8e93['transfertargetaccountcode'],'transfereecontext':_0x3f8e93[_0x9aee('0x20')],'transfereeexten':_0x3f8e93['transfertargetexten'],'transfereelinkedid':_0x3f8e93['transfertargetlinkedid'],'isexternal':_0x3f8e93[_0x9aee('0x14')],'context':_0x3f8e93[_0x9aee('0x21')],'extension':_0x3f8e93[_0x9aee('0x22')],'type':'attended'},'log':_0x9aee('0x2')});}; \ No newline at end of file +var _0xac84=['CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','blind'];(function(_0x3d9a54,_0x3dcbed){var _0x3753a3=function(_0x32a379){while(--_0x32a379){_0x3d9a54['push'](_0x3d9a54['shift']());}};_0x3753a3(++_0x3dcbed);}(_0xac84,0x134));var _0x4ac8=function(_0x67c742,_0x24d70d){_0x67c742=_0x67c742-0x0;var _0x2b36c6=_0xac84[_0x67c742];return _0x2b36c6;};'use strict';var client=require(_0x4ac8('0x0'));exports['blindTransfer']=function(_0x25110c){return client[_0x4ac8('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x25110c[_0x4ac8('0x2')],'transfererchannel':_0x25110c[_0x4ac8('0x3')],'transferercalleridnum':_0x25110c['transferercalleridnum'],'transferercalleridname':_0x25110c['transferercalleridname'],'transfererconnectedlinenum':_0x25110c[_0x4ac8('0x4')],'transfererconnectedlinename':_0x25110c[_0x4ac8('0x5')],'transfereraccountcode':_0x25110c[_0x4ac8('0x6')],'transferercontext':_0x25110c[_0x4ac8('0x7')],'transfererexten':_0x25110c[_0x4ac8('0x8')],'transfererlinkedid':_0x25110c['transfererlinkedid'],'transfereechannel':_0x25110c['transfereechannel'],'transfereecalleridnum':_0x25110c[_0x4ac8('0x9')],'transfereecalleridname':_0x25110c[_0x4ac8('0xa')],'transfereeconnectedlinenum':_0x25110c['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x25110c[_0x4ac8('0xb')],'transfereeaccountcode':_0x25110c[_0x4ac8('0xc')],'transfereecontext':_0x25110c[_0x4ac8('0xd')],'transfereeexten':_0x25110c['transfereeexten'],'transfereelinkedid':_0x25110c[_0x4ac8('0xe')],'isexternal':_0x25110c['isexternal'],'context':_0x25110c['context'],'extension':_0x25110c['extension'],'type':_0x4ac8('0xf')},'log':_0x4ac8('0x10')});};exports[_0x4ac8('0x11')]=function(_0x2dd1bb){return client[_0x4ac8('0x1')](_0x4ac8('0x10'),{'body':{'result':_0x2dd1bb['result'],'transfererchannel':_0x2dd1bb[_0x4ac8('0x12')],'transferercalleridnum':_0x2dd1bb[_0x4ac8('0x13')],'transferercalleridname':_0x2dd1bb['origtransferercalleridname'],'transfererconnectedlinenum':_0x2dd1bb[_0x4ac8('0x14')],'transfererconnectedlinename':_0x2dd1bb[_0x4ac8('0x15')],'transfereraccountcode':_0x2dd1bb[_0x4ac8('0x16')],'transferercontext':_0x2dd1bb[_0x4ac8('0x17')],'transfererexten':_0x2dd1bb[_0x4ac8('0x18')],'transfererlinkedid':_0x2dd1bb['origtransfererlinkedid'],'transfereechannel':_0x2dd1bb[_0x4ac8('0x19')],'transfereecalleridnum':_0x2dd1bb[_0x4ac8('0x1a')],'transfereecalleridname':_0x2dd1bb['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2dd1bb[_0x4ac8('0x1b')],'transfereeconnectedlinename':_0x2dd1bb[_0x4ac8('0x1c')],'transfereeaccountcode':_0x2dd1bb['transfertargetaccountcode'],'transfereecontext':_0x2dd1bb[_0x4ac8('0x1d')],'transfereeexten':_0x2dd1bb[_0x4ac8('0x1e')],'transfereelinkedid':_0x2dd1bb[_0x4ac8('0x1f')],'isexternal':_0x2dd1bb[_0x4ac8('0x20')],'context':_0x2dd1bb[_0x4ac8('0x21')],'extension':_0x2dd1bb[_0x4ac8('0x22')],'type':_0x4ac8('0x23')},'log':_0x4ac8('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0c2c595..531fc10 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 _0x856f=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','voicechannel','length','map','find','channels','uniqueid','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','channel','destinationchannel','%s.%s','stop','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','Event\x20name\x20mandatory','emit','event','faxAccounts','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','../../../config/environment','../properties','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','username','ami\x20disconnected','join','pick','keys','module','action','Action','message','catch','asterisk','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','available','pTalking','sumBillable','sumHoldTime','talking','total','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls'];(function(_0xb6f16e,_0x57f3d1){var _0x1cd0e9=function(_0x141d05){while(--_0x141d05){_0xb6f16e['push'](_0xb6f16e['shift']());}};_0x1cd0e9(++_0x57f3d1);}(_0x856f,0x1b7));var _0xf856=function(_0x53dcd7,_0xe89b37){_0x53dcd7=_0x53dcd7-0x0;var _0x2a1bb6=_0x856f[_0x53dcd7];return _0x2a1bb6;};'use strict';var _=require(_0xf856('0x0'));var util=require(_0xf856('0x1'));var jayson=require(_0xf856('0x2'));var schema=require(_0xf856('0x3'));var BPromise=require('bluebird');var moment=require('moment');var config=require(_0xf856('0x4'));var properties=require(_0xf856('0x5'));var ami=require('../ami');exports[_0xf856('0x6')]=function(_0x511557,_0x3c4335,_0x2e0e5a){return new BPromise(function(_0x27fcce,_0x1bf4c9){var _0x111c40={'QueuePause':function(_0x31dfd4){return new Promise(function(_0x3c605a,_0x190a47){var _0x81b206=util[_0xf856('0x7')](_0xf856('0x8'),_0xf856('0x9'),_0x31dfd4['name']);if(_0x511557[_0xf856('0xa')]&&_0x511557[_0xf856('0xa')][_0x81b206]&&_0x511557['timers'][_0x81b206][_0xf856('0xb')]){_0x511557[_0xf856('0xa')][_0x81b206][_0xf856('0xc')]();}if(_0x511557[_0xf856('0xd')][_0x81b206]){_0x511557[_0xf856('0xd')][_0x81b206][_0xf856('0xe')]({'statePause':_0x31dfd4[_0xf856('0xf')]?!![]:![]});}_0x3c605a({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0xa0acf0){var _0x3eb398=this;return new Promise(function(_0x212bc0,_0x1c5820){if(ami[_0xf856('0x10')]()==![]){return _0x1c5820(_0x3eb398[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}_0xa0acf0=_[_0xf856('0x15')](_0xa0acf0,_[_0xf856('0x16')](properties[_0xf856('0x17')]));_0xa0acf0[_0xf856('0x18')]='Reload';return ami[_0xf856('0x19')](_0xa0acf0)['then'](function(_0x1e3b5b){_0x212bc0({'code':0xc8,'message':_0x1e3b5b[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0x53fed4){_0x1c5820(_0x3eb398[_0xf856('0x11')](0x1f5,_0x53fed4[_0xf856('0x1a')]));});});},'Command':function(_0x220d23){var _0x4ef2a3=this;return new Promise(function(_0x43ac96,_0x5d9a21){if(ami['isConnected']()==![]){return _0x5d9a21(_0x4ef2a3[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],_0xf856('0x13')]['join']('\x20')));}_0x220d23=_[_0xf856('0x15')](_0x220d23,_0xf856('0x1d'));_0x220d23[_0xf856('0x18')]=_0xf856('0x1e');return ami[_0xf856('0x19')](_0x220d23)[_0xf856('0x1f')](function(_0x502ebd){_0x43ac96({'code':0xc8,'message':_0x502ebd[_0xf856('0x20')]});})[_0xf856('0x1b')](function(_0xb22b6a){_0x5d9a21(_0x4ef2a3[_0xf856('0x11')](0x1f5,_0xb22b6a[_0xf856('0x1a')]));});});},'VoiceQueues':function(_0x4e88cc){return new Promise(function(_0x58bb8e,_0x187abc){var _0x40d657=[];for(var _0x10f4c9 in _0x511557[_0xf856('0x21')]){if(_0x511557[_0xf856('0x21')][_0xf856('0x22')](_0x10f4c9)){var _0x1fb449=_0x511557[_0xf856('0x21')][_0x10f4c9];var _0x484cb6={'id':_0x1fb449['id'],'name':_0x1fb449[_0xf856('0x23')],'strategy':_0x1fb449[_0xf856('0x24')],'answered':_0x1fb449['answered'],'available':_0x1fb449[_0xf856('0x25')],'loggedIn':_0x1fb449['loggedIn'],'pTalking':_0x1fb449[_0xf856('0x26')],'sumBillable':_0x1fb449[_0xf856('0x27')],'sumDuration':_0x1fb449['sumDuration'],'sumHoldTime':_0x1fb449[_0xf856('0x28')]||0x0,'talking':_0x1fb449[_0xf856('0x29')],'total':_0x1fb449[_0xf856('0x2a')],'type':_0x1fb449['type'],'unmanaged':_0x1fb449['unmanaged'],'abandoned':_0x1fb449['abandoned'],'waiting':_0x1fb449[_0xf856('0x2b')],'loggedInDb':_0x1fb449[_0xf856('0x2c')]};if(_0x1fb449[_0xf856('0x2d')]==='outbound'){_0x484cb6['dialActive']=_0x1fb449[_0xf856('0x2e')];_0x484cb6[_0xf856('0x2f')]=_0x1fb449[_0xf856('0x2f')];_0x484cb6[_0xf856('0x30')]=_0x1fb449['dialOriginateCallerIdName'];_0x484cb6[_0xf856('0x31')]=_0x1fb449['dialOriginateCallerIdNumber'];_0x484cb6[_0xf856('0x32')]=_0x1fb449[_0xf856('0x32')];_0x484cb6[_0xf856('0x33')]=_0x1fb449['dialPrefix'];_0x484cb6[_0xf856('0x34')]=_0x1fb449['outboundAnswerAgiCallsDay'];_0x484cb6['outboundAnswerCallsDay']=_0x1fb449['outboundAnswerCallsDay'];_0x484cb6['outboundBlacklistCallsDay']=_0x1fb449[_0xf856('0x35')];_0x484cb6['outboundBusyCallsDay']=_0x1fb449[_0xf856('0x36')];_0x484cb6['outboundCongestionCallsDay']=_0x1fb449['outboundCongestionCallsDay'];_0x484cb6[_0xf856('0x37')]=_0x1fb449[_0xf856('0x37')];_0x484cb6[_0xf856('0x38')]=_0x1fb449[_0xf856('0x38')];_0x484cb6[_0xf856('0x39')]=_0x1fb449['outboundDropCallsDayTimeout'];_0x484cb6[_0xf856('0x3a')]=_0x1fb449[_0xf856('0x3a')];_0x484cb6[_0xf856('0x3b')]=_0x1fb449[_0xf856('0x3b')];_0x484cb6['outboundOriginateFailureCallsDay']=_0x1fb449['outboundOriginateFailureCallsDay'];_0x484cb6[_0xf856('0x3c')]=_0x1fb449[_0xf856('0x3c')];_0x484cb6[_0xf856('0x3d')]=_0x1fb449['outboundRejectCallsDay'];_0x484cb6[_0xf856('0x3e')]=_0x1fb449[_0xf856('0x3e')];_0x484cb6[_0xf856('0x3f')]=_0x1fb449[_0xf856('0x3f')];_0x484cb6['predictiveIntervalAvgHoldtime']=_0x1fb449[_0xf856('0x40')];_0x484cb6[_0xf856('0x41')]=_0x1fb449[_0xf856('0x41')];_0x484cb6[_0xf856('0x42')]=_0x1fb449['predictiveIntervalDroppedCallsCallersExit'];_0x484cb6[_0xf856('0x43')]=_0x1fb449[_0xf856('0x43')];_0x484cb6['predictiveIntervalErlangCalls']=_0x1fb449[_0xf856('0x44')];_0x484cb6[_0xf856('0x45')]=_0x1fb449['predictiveIntervalErlangCallsDroppedCalls'];_0x484cb6[_0xf856('0x46')]=_0x1fb449[_0xf856('0x46')];_0x484cb6[_0xf856('0x47')]=_0x1fb449[_0xf856('0x47')];_0x484cb6[_0xf856('0x48')]=_0x1fb449[_0xf856('0x48')];_0x484cb6[_0xf856('0x49')]=_0x1fb449[_0xf856('0x49')];_0x484cb6[_0xf856('0x4a')]=_0x1fb449[_0xf856('0x4a')];_0x484cb6['message']=_0x1fb449['message'];_0x484cb6[_0xf856('0x4b')]=_0x1fb449[_0xf856('0x4b')];}if(_0x1fb449['Trunk']){_0x484cb6[_0xf856('0x4c')]={'id':_0x1fb449[_0xf856('0x4c')]['id'],'name':_0x1fb449[_0xf856('0x4c')][_0xf856('0x23')],'active':_0x1fb449[_0xf856('0x4c')][_0xf856('0x4d')],'callerid':_0x1fb449[_0xf856('0x4c')][_0xf856('0x4e')]};}if(_0x1fb449[_0xf856('0x4f')]){_0x484cb6[_0xf856('0x4f')]={'id':_0x1fb449['Interval']['id'],'name':_0x1fb449['Interval'][_0xf856('0x23')]};}_0x40d657['push'](_0x484cb6);}}_0x58bb8e({'count':_0x40d657['length'],'rows':_0x40d657});});},'VoiceChannels':function(_0x230b85){return new Promise(function(_0x57ee83,_0x368e68){var _0x2772c9=_['values'](_0x511557['channels']);_0x57ee83({'count':_0x2772c9['length'],'rows':_0x2772c9});});},'VoiceChannelMixMonitor':function(_0x2ef5c5){var _0x5c3321=this;return new Promise(function(_0x232044,_0x18f57d){if(ami[_0xf856('0x10')]()==![]){return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config['asterisk'][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0x3f595d=schema(properties[_0xf856('0x50')])[_0xf856('0x3')](_0x2ef5c5);if(_0x3f595d[_0xf856('0x51')]>0x0){return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x3f595d,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0x4b2ce4=_[_0xf856('0x53')](_0x511557[_0xf856('0x54')],{'uniqueid':_0x2ef5c5[_0xf856('0x55')]});if(_0x4b2ce4&&_0x4b2ce4['channel']){var _0x45715e=util['format']('%s.%s',_0x2ef5c5[_0xf856('0x56')]||_0x2ef5c5['uniqueid'],_0x2ef5c5[_0xf856('0x7')]||'wav');return ami[_0xf856('0x19')]({'action':'MixMonitor','channel':_0x4b2ce4['channel'],'file':_0x45715e,'options':_0xf856('0x57')})[_0xf856('0x1f')](function(_0x3e07be){var _0x2c0bc7=_[_0xf856('0x53')](_0x4b2ce4[_0xf856('0x58')],{'filename':_0xf856('0x59')+_0x45715e[_0xf856('0x5a')]()});if(_[_0xf856('0x5b')](_0x2c0bc7)){_0x4b2ce4['monitors'][_0xf856('0x5c')]({'filename':_0xf856('0x59')+_0x45715e[_0xf856('0x5a')](),'createdAt':moment()[_0xf856('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3e07be[_0xf856('0x5d')],'status':_0xf856('0x5e')});}else{_0x2c0bc7[_0xf856('0x5d')]=_0x3e07be[_0xf856('0x5d')];_0x2c0bc7[_0xf856('0x5f')]=_0xf856('0x5e');}_0x232044({'code':0xc8,'message':[_0x2ef5c5[_0xf856('0x55')],_0xf856('0x60'),_0x3e07be['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x3e07be[_0xf856('0x5d')]});})['catch'](function(_0x42b51f){_0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f5,[_0x2ef5c5[_0xf856('0x55')],_0x42b51f[_0xf856('0x1a')][_0xf856('0x5a')]()][_0xf856('0x14')]('\x20')));});}else{return _0x18f57d(_0x5c3321[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceChannelStopMixMonitor':function(_0x5a594d){var _0x259c85=this;return new Promise(function(_0x350bb3,_0x29eed7){if(ami['isConnected']()==![]){return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f4,[config[_0xf856('0x1c')]['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0xb57eb4=schema(properties[_0xf856('0x50')])[_0xf856('0x3')](_0x5a594d);if(_0xb57eb4[_0xf856('0x51')]>0x0){return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0xb57eb4,_0xf856('0x1a'))['join'](',\x20')));}var _0x22299e=_[_0xf856('0x53')](_0x511557['channels'],{'uniqueid':_0x5a594d[_0xf856('0x55')]});if(_0x22299e){return BPromise['resolve']()[_0xf856('0x1f')](function(){if(_0x22299e['channel']){return ami[_0xf856('0x19')]({'action':_0xf856('0x62'),'channel':_0x22299e[_0xf856('0x63')],'mixmonitorid':_0x5a594d['mixmonitorid']})[_0xf856('0x1b')](function(_0x189f49){});}})[_0xf856('0x1f')](function(){if(_0x22299e[_0xf856('0x64')]){return ami[_0xf856('0x19')]({'action':'StopMixMonitor','channel':_0x22299e[_0xf856('0x64')],'mixmonitorid':_0x5a594d['mixmonitorid']})['catch'](function(_0x3049de){});}})['then'](function(_0x35edfe){var _0x24bf52=_['find'](_0x22299e[_0xf856('0x58')],{'mixmonitorid':_0x5a594d[_0xf856('0x5d')]});if(_0x24bf52){_0x24bf52[_0xf856('0x5f')]='stop';}})[_0xf856('0x1f')](function(){var _0x24e161=util['format'](_0xf856('0x65'),_0x5a594d[_0xf856('0x56')]||_0x5a594d['uniqueid'],_0x5a594d[_0xf856('0x7')]||'wav');var _0x25949a=_[_0xf856('0x53')](_0x22299e[_0xf856('0x58')],{'filename':'/var/spool/asterisk/monitor/'+_0x24e161[_0xf856('0x5a')]()});if(_0x25949a){_0x25949a[_0xf856('0x5f')]=_0xf856('0x66');}})['then'](function(){_0x350bb3({'code':0xc8,'message':[_0x5a594d[_0xf856('0x55')],'StopMixMonitor\x20Success'][_0xf856('0x14')]('\x20')});})[_0xf856('0x1b')](function(_0x31888c){_0x29eed7(_0x259c85[_0xf856('0x11')](0x1f5,[_0x5a594d[_0xf856('0x55')],_0x31888c[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')));});}else{return _0x29eed7(_0x259c85[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannels':function(_0x51df0c){return new Promise(function(_0x4a50ea,_0xaa656b){var _0x498c90=_[_0xf856('0x67')](_0x511557[_0xf856('0x68')]);_0x4a50ea({'count':_0x498c90[_0xf856('0x51')],'rows':_0x498c90});});},'VoiceQueuesChannel':function(_0x5d0d4a){var _0x3470d1=this;return new Promise(function(_0x21f940,_0x46886f){var _0x185ad2=schema(properties[_0xf856('0x69')])['validate'](_0x5d0d4a);if(_0x185ad2[_0xf856('0x51')]>0x0){return _0x46886f(_0x3470d1[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x185ad2,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0x2e7da3=_[_0xf856('0x53')](_0x511557['queueChannels'],{'uniqueid':_0x5d0d4a['uniqueid']});if(_0x2e7da3){_0x21f940(_0x2e7da3);}else{return _0x46886f(_0x3470d1['error'](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannelHangup':function(_0x3be9aa){var _0x5440c8=this;return new Promise(function(_0x3f6198,_0x2ce3e4){if(ami['isConnected']()==![]){return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xf856('0x1c')]['username'],_0xf856('0x13')][_0xf856('0x14')]('\x20')));}var _0x3782a3=schema(properties[_0xf856('0x6a')])[_0xf856('0x3')](_0x3be9aa);if(_0x3782a3[_0xf856('0x51')]>0x0){return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f4,_['map'](_0x3782a3,'message')['join'](',\x20')));}var _0xaa43b1=_[_0xf856('0x53')](_0x511557[_0xf856('0x68')],{'uniqueid':_0x3be9aa[_0xf856('0x55')]});if(_0xaa43b1&&_0xaa43b1['channel']){return ami[_0xf856('0x19')]({'action':'Hangup','channel':_0xaa43b1['channel']})['then'](function(_0x137baf){_0x3f6198({'code':0xc8,'message':[_0x3be9aa[_0xf856('0x55')],_0x137baf[_0xf856('0x1a')]['toLowerCase']()]['join']('\x20')});})[_0xf856('0x1b')](function(_0x3f560a){_0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f5,[_0x3be9aa[_0xf856('0x55')],_0x3f560a[_0xf856('0x1a')][_0xf856('0x5a')]()]['join']('\x20')));});}else{return _0x2ce3e4(_0x5440c8[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'VoiceQueuesChannelRedirect':function(_0x134bf9){var _0x3917a6=this;return new Promise(function(_0x14da74,_0x161b2b){if(ami[_0xf856('0x10')]()==![]){return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xf856('0x1c')][_0xf856('0x12')],'ami\x20disconnected'][_0xf856('0x14')]('\x20')));}var _0x5e6871=schema(properties[_0xf856('0x6b')])['validate'](_0x134bf9);if(_0x5e6871['length']>0x0){return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f4,_[_0xf856('0x52')](_0x5e6871,_0xf856('0x1a'))[_0xf856('0x14')](',\x20')));}var _0xb0dca2=_['find'](_0x511557[_0xf856('0x68')],{'uniqueid':_0x134bf9[_0xf856('0x55')]});if(_0xb0dca2&&_0xb0dca2[_0xf856('0x63')]){return ami[_0xf856('0x19')]({'action':_0xf856('0x6c'),'channel':_0xb0dca2[_0xf856('0x63')],'exten':_0x134bf9[_0xf856('0x6d')],'context':_0x134bf9[_0xf856('0x6e')]||_0xb0dca2[_0xf856('0x6e')],'priority':0x1})['then'](function(_0x33683e){_0x14da74({'code':0xc8,'message':[_0x134bf9[_0xf856('0x55')],_0x33683e[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')});})[_0xf856('0x1b')](function(_0x5a45e5){_0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f5,[_0x134bf9[_0xf856('0x55')],_0x5a45e5[_0xf856('0x1a')]['toLowerCase']()][_0xf856('0x14')]('\x20')));});}else{return _0x161b2b(_0x3917a6[_0xf856('0x11')](0x1f5,_0xf856('0x61')));}});},'Agents':function(_0x4fae49){return new Promise(function(_0x29b124,_0x2efd62){var _0x45b256=_['values'](_0x511557[_0xf856('0xd')]);_0x29b124({'count':_0x45b256['length'],'rows':_0x45b256});});},'Telephones':function(_0x295c89){return new Promise(function(_0x5b2c8f,_0x373c5f){var _0x24d622=_[_0xf856('0x67')](_0x511557[_0xf856('0x6f')]);_0x5b2c8f({'count':_0x24d622['length'],'rows':_0x24d622});});},'Trunks':function(_0x4b33b4){return new Promise(function(_0x18e6b9,_0xe863ff){var _0x581dfa=_[_0xf856('0x67')](_0x511557[_0xf856('0x70')]);_0x18e6b9({'count':_0x581dfa[_0xf856('0x51')],'rows':_0x581dfa});});},'OutboundChannels':function(_0x338a58){return new Promise(function(_0x52cb2f,_0x134e02){var _0x438749=_[_0xf856('0x67')](_0x511557[_0xf856('0x71')]);_0x52cb2f({'count':_0x438749[_0xf856('0x51')],'rows':_0x438749});});},'Outbound':function(_0x56c0f0){return new Promise(function(_0x5c6d15,_0x4155f1){_0x5c6d15(_0x511557[_0xf856('0x72')]);});},'Campaigns':function(_0x4f8c07){return new Promise(function(_0x2971bc,_0xda0f51){var _0x11de85=_[_0xf856('0x67')](_0x511557[_0xf856('0x73')]);_0x2971bc({'count':_0x11de85[_0xf856('0x51')],'rows':_0x11de85});});},'VoiceQueuesPreview':function(_0x38f80e){var _0x47fed4=this;return new Promise(function(_0x18027e,_0x503a61){_0x3c4335['run'](_0x38f80e['id'])['then'](function(_0x27f1b8){_0x18027e({'code':0xc8,'message':_0x27f1b8[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0xb38e6b){_0x503a61(_0x47fed4['error'](0x1f4,_0xb38e6b['message']));});});},'EventManager':function(_0x24763e){var _0x59de88=this;return new Promise(function(_0x1b36b9,_0x20a8c2){if(!_0x24763e['event']){return _0x20a8c2(_0x59de88[_0xf856('0x11')](0x1f4,_0xf856('0x74')));}ami[_0xf856('0x75')]('custom:'+_0x24763e[_0xf856('0x76')],_0x24763e[_0xf856('0x1a')]);_0x1b36b9({'code':0xc8,'message':_0x24763e});});},'FaxAccounts':function(_0x4638ae){return new Promise(function(_0xa57adb,_0x5330ad){var _0x5861e1=_['values'](_0x511557[_0xf856('0x77')]);_0xa57adb({'count':_0x5861e1[_0xf856('0x51')],'rows':_0x5861e1});});},'SendFax':function(_0x49dc40){var _0x550026=this;return new Promise(function(_0x51cc16,_0x7b61fa){_0x2e0e5a[_0xf856('0x78')](_0x49dc40)[_0xf856('0x1f')](function(_0x2b664c){_0x51cc16({'code':0xc8,'message':_0x2b664c[_0xf856('0x1a')]});})[_0xf856('0x1b')](function(_0x1a82e7){_0x7b61fa(_0x550026[_0xf856('0x11')](0x1f4,_0x1a82e7[_0xf856('0x1a')]));});});},'CheckAfterSend':function(_0x1f8d52){var _0x11ccc0=this;return new Promise(function(_0x39a99b,_0x3c9c52){_0x2e0e5a[_0xf856('0x79')](_0x1f8d52)[_0xf856('0x1f')](function(_0xa93ab2){_0x39a99b({'code':0xc8,'message':_0xa93ab2['message']});})[_0xf856('0x1b')](function(_0x4f901f){_0x3c9c52(_0x11ccc0[_0xf856('0x11')](0x1f4,_0x4f901f[_0xf856('0x1a')]));});});}};var _0x791794=jayson[_0xf856('0x7a')](_0x111c40)['http']();_0x791794['on']('error',function(_0x380e47){return _0x1bf4c9(_0x380e47);});_0x791794[_0xf856('0x6')](0x232a,_0xf856('0x7b'),function(){console[_0xf856('0x7c')](_0xf856('0x7d'),0x232a);return _0x27fcce(_0xf856('0x7e')+0x232a);});});}; \ No newline at end of file +var _0xbc33=['hasOwnProperty','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','push','length','channels','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','destinationchannel','StopMixMonitor','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','context','values','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','ami\x20disconnected','command','Command','content','voiceQueues'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xbc33,0x1eb));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bc3('0x0'));var util=require(_0x3bc3('0x1'));var jayson=require(_0x3bc3('0x2'));var schema=require(_0x3bc3('0x3'));var BPromise=require(_0x3bc3('0x4'));var moment=require(_0x3bc3('0x5'));var config=require(_0x3bc3('0x6'));var properties=require(_0x3bc3('0x7'));var ami=require(_0x3bc3('0x8'));exports['listen']=function(_0x2321b0,_0x149853,_0x61ba26){return new BPromise(function(_0x1e6ed8,_0xa798a5){var _0x56a8d9={'QueuePause':function(_0x323c5f){return new Promise(function(_0xe4209b,_0x226dd9){var _0x1ddd32=util[_0x3bc3('0x9')](_0x3bc3('0xa'),'SIP',_0x323c5f[_0x3bc3('0xb')]);if(_0x2321b0[_0x3bc3('0xc')]&&_0x2321b0[_0x3bc3('0xc')][_0x1ddd32]&&_0x2321b0['timers'][_0x1ddd32][_0x3bc3('0xd')]){_0x2321b0[_0x3bc3('0xc')][_0x1ddd32]['updateAcw']();}if(_0x2321b0['agents'][_0x1ddd32]){_0x2321b0[_0x3bc3('0xe')][_0x1ddd32][_0x3bc3('0xf')]({'statePause':_0x323c5f[_0x3bc3('0x10')]?!![]:![]});}_0xe4209b({'code':0xc8,'message':_0x3bc3('0x11')});});},'Reload':function(_0x1ec95b){var _0x5da337=this;return new Promise(function(_0x80569e,_0x326326){if(ami[_0x3bc3('0x12')]()==![]){return _0x326326(_0x5da337[_0x3bc3('0x13')](0x1f4,[config[_0x3bc3('0x14')]['ip'],config[_0x3bc3('0x14')][_0x3bc3('0x15')],'ami\x20disconnected'][_0x3bc3('0x16')]('\x20')));}_0x1ec95b=_[_0x3bc3('0x17')](_0x1ec95b,_[_0x3bc3('0x18')](properties[_0x3bc3('0x19')]));_0x1ec95b[_0x3bc3('0x1a')]=_0x3bc3('0x1b');return ami[_0x3bc3('0x1c')](_0x1ec95b)[_0x3bc3('0x1d')](function(_0x59e948){_0x80569e({'code':0xc8,'message':_0x59e948[_0x3bc3('0x1e')]});})[_0x3bc3('0x1f')](function(_0x226458){_0x326326(_0x5da337['error'](0x1f5,_0x226458[_0x3bc3('0x1e')]));});});},'Command':function(_0x4e82a2){var _0x28fe85=this;return new Promise(function(_0x4d274a,_0xb3bebb){if(ami[_0x3bc3('0x12')]()==![]){return _0xb3bebb(_0x28fe85['error'](0x1f4,[config[_0x3bc3('0x14')]['ip'],config[_0x3bc3('0x14')][_0x3bc3('0x15')],_0x3bc3('0x20')][_0x3bc3('0x16')]('\x20')));}_0x4e82a2=_[_0x3bc3('0x17')](_0x4e82a2,_0x3bc3('0x21'));_0x4e82a2[_0x3bc3('0x1a')]=_0x3bc3('0x22');return ami['Action'](_0x4e82a2)[_0x3bc3('0x1d')](function(_0x53d8f3){_0x4d274a({'code':0xc8,'message':_0x53d8f3[_0x3bc3('0x23')]});})[_0x3bc3('0x1f')](function(_0xb3bab6){_0xb3bebb(_0x28fe85[_0x3bc3('0x13')](0x1f5,_0xb3bab6['message']));});});},'VoiceQueues':function(_0x3ad08c){return new Promise(function(_0x18a8e3,_0xe498b7){var _0x40ee29=[];for(var _0x78b8d4 in _0x2321b0[_0x3bc3('0x24')]){if(_0x2321b0['voiceQueues'][_0x3bc3('0x25')](_0x78b8d4)){var _0x5c7da6=_0x2321b0[_0x3bc3('0x24')][_0x78b8d4];var _0x3e3074={'id':_0x5c7da6['id'],'name':_0x5c7da6[_0x3bc3('0xb')],'strategy':_0x5c7da6[_0x3bc3('0x26')],'answered':_0x5c7da6[_0x3bc3('0x27')],'available':_0x5c7da6[_0x3bc3('0x28')],'loggedIn':_0x5c7da6['loggedIn'],'pTalking':_0x5c7da6[_0x3bc3('0x29')],'sumBillable':_0x5c7da6[_0x3bc3('0x2a')],'sumDuration':_0x5c7da6[_0x3bc3('0x2b')],'sumHoldTime':_0x5c7da6[_0x3bc3('0x2c')]||0x0,'talking':_0x5c7da6[_0x3bc3('0x2d')],'total':_0x5c7da6['total'],'type':_0x5c7da6['type'],'unmanaged':_0x5c7da6['unmanaged'],'abandoned':_0x5c7da6[_0x3bc3('0x2e')],'waiting':_0x5c7da6[_0x3bc3('0x2f')],'loggedInDb':_0x5c7da6[_0x3bc3('0x30')]};if(_0x5c7da6[_0x3bc3('0x31')]===_0x3bc3('0x32')){_0x3e3074[_0x3bc3('0x33')]=_0x5c7da6[_0x3bc3('0x33')];_0x3e3074[_0x3bc3('0x34')]=_0x5c7da6[_0x3bc3('0x34')];_0x3e3074[_0x3bc3('0x35')]=_0x5c7da6[_0x3bc3('0x35')];_0x3e3074[_0x3bc3('0x36')]=_0x5c7da6[_0x3bc3('0x36')];_0x3e3074['dialOriginateTimeout']=_0x5c7da6[_0x3bc3('0x37')];_0x3e3074['dialPrefix']=_0x5c7da6['dialPrefix'];_0x3e3074[_0x3bc3('0x38')]=_0x5c7da6['outboundAnswerAgiCallsDay'];_0x3e3074[_0x3bc3('0x39')]=_0x5c7da6[_0x3bc3('0x39')];_0x3e3074[_0x3bc3('0x3a')]=_0x5c7da6[_0x3bc3('0x3a')];_0x3e3074[_0x3bc3('0x3b')]=_0x5c7da6[_0x3bc3('0x3b')];_0x3e3074[_0x3bc3('0x3c')]=_0x5c7da6[_0x3bc3('0x3c')];_0x3e3074[_0x3bc3('0x3d')]=_0x5c7da6[_0x3bc3('0x3d')];_0x3e3074[_0x3bc3('0x3e')]=_0x5c7da6[_0x3bc3('0x3e')];_0x3e3074[_0x3bc3('0x3f')]=_0x5c7da6[_0x3bc3('0x3f')];_0x3e3074[_0x3bc3('0x40')]=_0x5c7da6['outboundNoAnswerCallsDay'];_0x3e3074['outboundNoSuchCallsDay']=_0x5c7da6['outboundNoSuchCallsDay'];_0x3e3074[_0x3bc3('0x41')]=_0x5c7da6[_0x3bc3('0x41')];_0x3e3074[_0x3bc3('0x42')]=_0x5c7da6[_0x3bc3('0x42')];_0x3e3074[_0x3bc3('0x43')]=_0x5c7da6[_0x3bc3('0x43')];_0x3e3074[_0x3bc3('0x44')]=_0x5c7da6[_0x3bc3('0x44')];_0x3e3074[_0x3bc3('0x45')]=_0x5c7da6['predictiveIntervalAnsweredCalls'];_0x3e3074[_0x3bc3('0x46')]=_0x5c7da6[_0x3bc3('0x46')];_0x3e3074['predictiveIntervalAvgTalktime']=_0x5c7da6[_0x3bc3('0x47')];_0x3e3074[_0x3bc3('0x48')]=_0x5c7da6[_0x3bc3('0x48')];_0x3e3074[_0x3bc3('0x49')]=_0x5c7da6[_0x3bc3('0x49')];_0x3e3074['predictiveIntervalErlangCalls']=_0x5c7da6[_0x3bc3('0x4a')];_0x3e3074['predictiveIntervalErlangCallsDroppedCalls']=_0x5c7da6['predictiveIntervalErlangCallsDroppedCalls'];_0x3e3074[_0x3bc3('0x4b')]=_0x5c7da6[_0x3bc3('0x4b')];_0x3e3074[_0x3bc3('0x4c')]=_0x5c7da6[_0x3bc3('0x4c')];_0x3e3074['predictiveIntervalMultiplicativeFactor']=_0x5c7da6['predictiveIntervalMultiplicativeFactor'];_0x3e3074[_0x3bc3('0x4d')]=_0x5c7da6[_0x3bc3('0x4d')];_0x3e3074[_0x3bc3('0x4e')]=_0x5c7da6[_0x3bc3('0x4e')];_0x3e3074['message']=_0x5c7da6[_0x3bc3('0x1e')];_0x3e3074[_0x3bc3('0x4f')]=_0x5c7da6['originated'];}if(_0x5c7da6[_0x3bc3('0x50')]){_0x3e3074[_0x3bc3('0x50')]={'id':_0x5c7da6[_0x3bc3('0x50')]['id'],'name':_0x5c7da6['Trunk'][_0x3bc3('0xb')],'active':_0x5c7da6[_0x3bc3('0x50')][_0x3bc3('0x51')],'callerid':_0x5c7da6['Trunk'][_0x3bc3('0x52')]};}if(_0x5c7da6[_0x3bc3('0x53')]){_0x3e3074['Interval']={'id':_0x5c7da6[_0x3bc3('0x53')]['id'],'name':_0x5c7da6[_0x3bc3('0x53')][_0x3bc3('0xb')]};}_0x40ee29[_0x3bc3('0x54')](_0x3e3074);}}_0x18a8e3({'count':_0x40ee29[_0x3bc3('0x55')],'rows':_0x40ee29});});},'VoiceChannels':function(_0x51b288){return new Promise(function(_0x53d262,_0x14bfa3){var _0x3784d0=_['values'](_0x2321b0[_0x3bc3('0x56')]);_0x53d262({'count':_0x3784d0['length'],'rows':_0x3784d0});});},'VoiceChannelMixMonitor':function(_0xd3852d){var _0x3d8246=this;return new Promise(function(_0x4eff72,_0x5c13c9){if(ami[_0x3bc3('0x12')]()==![]){return _0x5c13c9(_0x3d8246['error'](0x1f4,[config[_0x3bc3('0x14')]['ip'],config['asterisk']['username'],_0x3bc3('0x20')]['join']('\x20')));}var _0x1d4c4c=schema(properties['voicechannel'])[_0x3bc3('0x3')](_0xd3852d);if(_0x1d4c4c[_0x3bc3('0x55')]>0x0){return _0x5c13c9(_0x3d8246[_0x3bc3('0x13')](0x1f4,_[_0x3bc3('0x57')](_0x1d4c4c,_0x3bc3('0x1e'))['join'](',\x20')));}var _0x5a6614=_[_0x3bc3('0x58')](_0x2321b0[_0x3bc3('0x56')],{'uniqueid':_0xd3852d[_0x3bc3('0x59')]});if(_0x5a6614&&_0x5a6614[_0x3bc3('0x5a')]){var _0x178008=util[_0x3bc3('0x9')](_0x3bc3('0x5b'),_0xd3852d[_0x3bc3('0x5c')]||_0xd3852d[_0x3bc3('0x59')],_0xd3852d[_0x3bc3('0x9')]||_0x3bc3('0x5d'));return ami[_0x3bc3('0x1c')]({'action':_0x3bc3('0x5e'),'channel':_0x5a6614[_0x3bc3('0x5a')],'file':_0x178008,'options':_0x3bc3('0x5f')})[_0x3bc3('0x1d')](function(_0xee1c96){var _0x2e58c8=_['find'](_0x5a6614[_0x3bc3('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x178008[_0x3bc3('0x61')]()});if(_[_0x3bc3('0x62')](_0x2e58c8)){_0x5a6614[_0x3bc3('0x60')][_0x3bc3('0x54')]({'filename':_0x3bc3('0x63')+_0x178008[_0x3bc3('0x61')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xee1c96[_0x3bc3('0x64')],'status':_0x3bc3('0x65')});}else{_0x2e58c8[_0x3bc3('0x64')]=_0xee1c96[_0x3bc3('0x64')];_0x2e58c8['status']='rec';}_0x4eff72({'code':0xc8,'message':[_0xd3852d[_0x3bc3('0x59')],'MixMonitor\x20Success',_0xee1c96['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0xee1c96[_0x3bc3('0x64')]});})['catch'](function(_0x93e539){_0x5c13c9(_0x3d8246['error'](0x1f5,[_0xd3852d[_0x3bc3('0x59')],_0x93e539[_0x3bc3('0x1e')]['toLowerCase']()][_0x3bc3('0x16')]('\x20')));});}else{return _0x5c13c9(_0x3d8246[_0x3bc3('0x13')](0x1f5,_0x3bc3('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x5cb0b7){var _0xe55b77=this;return new Promise(function(_0x2f748d,_0x55ff75){if(ami['isConnected']()==![]){return _0x55ff75(_0xe55b77[_0x3bc3('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x3bc3('0x14')][_0x3bc3('0x15')],_0x3bc3('0x20')][_0x3bc3('0x16')]('\x20')));}var _0x462b24=schema(properties[_0x3bc3('0x67')])['validate'](_0x5cb0b7);if(_0x462b24[_0x3bc3('0x55')]>0x0){return _0x55ff75(_0xe55b77['error'](0x1f4,_['map'](_0x462b24,_0x3bc3('0x1e'))[_0x3bc3('0x16')](',\x20')));}var _0x58ca1f=_[_0x3bc3('0x58')](_0x2321b0[_0x3bc3('0x56')],{'uniqueid':_0x5cb0b7['uniqueid']});if(_0x58ca1f){return BPromise[_0x3bc3('0x68')]()[_0x3bc3('0x1d')](function(){if(_0x58ca1f[_0x3bc3('0x5a')]){return ami[_0x3bc3('0x1c')]({'action':'StopMixMonitor','channel':_0x58ca1f[_0x3bc3('0x5a')],'mixmonitorid':_0x5cb0b7[_0x3bc3('0x64')]})[_0x3bc3('0x1f')](function(_0x98a007){});}})[_0x3bc3('0x1d')](function(){if(_0x58ca1f[_0x3bc3('0x69')]){return ami[_0x3bc3('0x1c')]({'action':_0x3bc3('0x6a'),'channel':_0x58ca1f[_0x3bc3('0x69')],'mixmonitorid':_0x5cb0b7[_0x3bc3('0x64')]})['catch'](function(_0x12f3a9){});}})[_0x3bc3('0x1d')](function(_0x567142){var _0x22e650=_[_0x3bc3('0x58')](_0x58ca1f[_0x3bc3('0x60')],{'mixmonitorid':_0x5cb0b7['mixmonitorid']});if(_0x22e650){_0x22e650['status']=_0x3bc3('0x6b');}})[_0x3bc3('0x1d')](function(){var _0x29cf66=util[_0x3bc3('0x9')](_0x3bc3('0x5b'),_0x5cb0b7['filename']||_0x5cb0b7[_0x3bc3('0x59')],_0x5cb0b7[_0x3bc3('0x9')]||_0x3bc3('0x5d'));var _0x26fda0=_[_0x3bc3('0x58')](_0x58ca1f[_0x3bc3('0x60')],{'filename':_0x3bc3('0x63')+_0x29cf66[_0x3bc3('0x61')]()});if(_0x26fda0){_0x26fda0['status']=_0x3bc3('0x6b');}})['then'](function(){_0x2f748d({'code':0xc8,'message':[_0x5cb0b7[_0x3bc3('0x59')],'StopMixMonitor\x20Success'][_0x3bc3('0x16')]('\x20')});})[_0x3bc3('0x1f')](function(_0x25d77f){_0x55ff75(_0xe55b77[_0x3bc3('0x13')](0x1f5,[_0x5cb0b7['uniqueid'],_0x25d77f[_0x3bc3('0x1e')][_0x3bc3('0x61')]()][_0x3bc3('0x16')]('\x20')));});}else{return _0x55ff75(_0xe55b77[_0x3bc3('0x13')](0x1f5,_0x3bc3('0x66')));}});},'VoiceQueuesChannels':function(_0x139680){return new Promise(function(_0x515e7c,_0x5d9134){var _0x3df0a2=_['values'](_0x2321b0[_0x3bc3('0x6c')]);_0x515e7c({'count':_0x3df0a2[_0x3bc3('0x55')],'rows':_0x3df0a2});});},'VoiceQueuesChannel':function(_0x3304f9){var _0x180375=this;return new Promise(function(_0x3f36e9,_0x1eb9de){var _0x26d6ed=schema(properties[_0x3bc3('0x6d')])[_0x3bc3('0x3')](_0x3304f9);if(_0x26d6ed['length']>0x0){return _0x1eb9de(_0x180375[_0x3bc3('0x13')](0x1f4,_[_0x3bc3('0x57')](_0x26d6ed,_0x3bc3('0x1e'))[_0x3bc3('0x16')](',\x20')));}var _0x465a77=_[_0x3bc3('0x58')](_0x2321b0[_0x3bc3('0x6c')],{'uniqueid':_0x3304f9[_0x3bc3('0x59')]});if(_0x465a77){_0x3f36e9(_0x465a77);}else{return _0x1eb9de(_0x180375[_0x3bc3('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x451e11){var _0x3058c8=this;return new Promise(function(_0x3fdcf3,_0x509af1){if(ami[_0x3bc3('0x12')]()==![]){return _0x509af1(_0x3058c8[_0x3bc3('0x13')](0x1f4,[config[_0x3bc3('0x14')]['ip'],config[_0x3bc3('0x14')][_0x3bc3('0x15')],_0x3bc3('0x20')][_0x3bc3('0x16')]('\x20')));}var _0x26f256=schema(properties[_0x3bc3('0x6e')])['validate'](_0x451e11);if(_0x26f256[_0x3bc3('0x55')]>0x0){return _0x509af1(_0x3058c8[_0x3bc3('0x13')](0x1f4,_[_0x3bc3('0x57')](_0x26f256,_0x3bc3('0x1e'))[_0x3bc3('0x16')](',\x20')));}var _0x59fe39=_['find'](_0x2321b0[_0x3bc3('0x6c')],{'uniqueid':_0x451e11[_0x3bc3('0x59')]});if(_0x59fe39&&_0x59fe39[_0x3bc3('0x5a')]){return ami[_0x3bc3('0x1c')]({'action':'Hangup','channel':_0x59fe39[_0x3bc3('0x5a')]})[_0x3bc3('0x1d')](function(_0x333fd4){_0x3fdcf3({'code':0xc8,'message':[_0x451e11[_0x3bc3('0x59')],_0x333fd4[_0x3bc3('0x1e')][_0x3bc3('0x61')]()][_0x3bc3('0x16')]('\x20')});})['catch'](function(_0x4acc80){_0x509af1(_0x3058c8[_0x3bc3('0x13')](0x1f5,[_0x451e11[_0x3bc3('0x59')],_0x4acc80[_0x3bc3('0x1e')][_0x3bc3('0x61')]()]['join']('\x20')));});}else{return _0x509af1(_0x3058c8[_0x3bc3('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x29168c){var _0x3e3c60=this;return new Promise(function(_0x6b1644,_0x46b359){if(ami[_0x3bc3('0x12')]()==![]){return _0x46b359(_0x3e3c60[_0x3bc3('0x13')](0x1f4,[config[_0x3bc3('0x14')]['ip'],config[_0x3bc3('0x14')][_0x3bc3('0x15')],_0x3bc3('0x20')][_0x3bc3('0x16')]('\x20')));}var _0xd339a=schema(properties['voicequeuechannelredirect'])[_0x3bc3('0x3')](_0x29168c);if(_0xd339a[_0x3bc3('0x55')]>0x0){return _0x46b359(_0x3e3c60[_0x3bc3('0x13')](0x1f4,_[_0x3bc3('0x57')](_0xd339a,_0x3bc3('0x1e'))[_0x3bc3('0x16')](',\x20')));}var _0x204601=_[_0x3bc3('0x58')](_0x2321b0[_0x3bc3('0x6c')],{'uniqueid':_0x29168c[_0x3bc3('0x59')]});if(_0x204601&&_0x204601[_0x3bc3('0x5a')]){return ami[_0x3bc3('0x1c')]({'action':_0x3bc3('0x6f'),'channel':_0x204601[_0x3bc3('0x5a')],'exten':_0x29168c['exten'],'context':_0x29168c[_0x3bc3('0x70')]||_0x204601[_0x3bc3('0x70')],'priority':0x1})['then'](function(_0x11139f){_0x6b1644({'code':0xc8,'message':[_0x29168c[_0x3bc3('0x59')],_0x11139f['message'][_0x3bc3('0x61')]()][_0x3bc3('0x16')]('\x20')});})[_0x3bc3('0x1f')](function(_0x10d900){_0x46b359(_0x3e3c60['error'](0x1f5,[_0x29168c[_0x3bc3('0x59')],_0x10d900[_0x3bc3('0x1e')][_0x3bc3('0x61')]()][_0x3bc3('0x16')]('\x20')));});}else{return _0x46b359(_0x3e3c60[_0x3bc3('0x13')](0x1f5,_0x3bc3('0x66')));}});},'Agents':function(_0x2a4a42){return new Promise(function(_0x4e3af1,_0x23e3c1){var _0x22e719=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0xe')]);_0x4e3af1({'count':_0x22e719[_0x3bc3('0x55')],'rows':_0x22e719});});},'Telephones':function(_0x1b04ca){return new Promise(function(_0x4b6448,_0x4f5519){var _0x45ad47=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0x72')]);_0x4b6448({'count':_0x45ad47[_0x3bc3('0x55')],'rows':_0x45ad47});});},'Trunks':function(_0x1e53e4){return new Promise(function(_0x5e0ce3,_0xc1876d){var _0x102bd4=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0x73')]);_0x5e0ce3({'count':_0x102bd4['length'],'rows':_0x102bd4});});},'OutboundChannels':function(_0x25e604){return new Promise(function(_0xd304c6,_0x5298ad){var _0x2451db=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0x74')]);_0xd304c6({'count':_0x2451db['length'],'rows':_0x2451db});});},'Outbound':function(_0x1fe2d6){return new Promise(function(_0x2f94be,_0x2eaaca){_0x2f94be(_0x2321b0[_0x3bc3('0x32')]);});},'Campaigns':function(_0x6a53d6){return new Promise(function(_0xa2cbb5,_0x4c3584){var _0x35a80a=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0x75')]);_0xa2cbb5({'count':_0x35a80a[_0x3bc3('0x55')],'rows':_0x35a80a});});},'VoiceQueuesPreview':function(_0x17f442){var _0x16f2f4=this;return new Promise(function(_0x187d2a,_0x35c6a5){_0x149853[_0x3bc3('0x76')](_0x17f442['id'])['then'](function(_0x445ae1){_0x187d2a({'code':0xc8,'message':_0x445ae1[_0x3bc3('0x1e')]});})[_0x3bc3('0x1f')](function(_0x2e917b){_0x35c6a5(_0x16f2f4['error'](0x1f4,_0x2e917b['message']));});});},'EventManager':function(_0x10786c){var _0xc9a789=this;return new Promise(function(_0xae06e1,_0x2bf17e){if(!_0x10786c[_0x3bc3('0x77')]){return _0x2bf17e(_0xc9a789[_0x3bc3('0x13')](0x1f4,_0x3bc3('0x78')));}ami[_0x3bc3('0x79')](_0x3bc3('0x7a')+_0x10786c[_0x3bc3('0x77')],_0x10786c[_0x3bc3('0x1e')]);_0xae06e1({'code':0xc8,'message':_0x10786c});});},'FaxAccounts':function(_0x27349f){return new Promise(function(_0x212603,_0x20507c){var _0x5d01a3=_[_0x3bc3('0x71')](_0x2321b0[_0x3bc3('0x7b')]);_0x212603({'count':_0x5d01a3['length'],'rows':_0x5d01a3});});},'SendFax':function(_0x127c71){var _0x7908b8=this;return new Promise(function(_0x32a0bc,_0x993a44){_0x61ba26[_0x3bc3('0x7c')](_0x127c71)[_0x3bc3('0x1d')](function(_0x412217){_0x32a0bc({'code':0xc8,'message':_0x412217[_0x3bc3('0x1e')]});})[_0x3bc3('0x1f')](function(_0xc56c88){_0x993a44(_0x7908b8[_0x3bc3('0x13')](0x1f4,_0xc56c88[_0x3bc3('0x1e')]));});});},'CheckAfterSend':function(_0x2c2a12){var _0x25741c=this;return new Promise(function(_0x535384,_0x49d157){_0x61ba26[_0x3bc3('0x7d')](_0x2c2a12)[_0x3bc3('0x1d')](function(_0x133566){_0x535384({'code':0xc8,'message':_0x133566['message']});})[_0x3bc3('0x1f')](function(_0x57eada){_0x49d157(_0x25741c['error'](0x1f4,_0x57eada[_0x3bc3('0x1e')]));});});}};var _0x2952ea=jayson[_0x3bc3('0x7e')](_0x56a8d9)[_0x3bc3('0x7f')]();_0x2952ea['on'](_0x3bc3('0x13'),function(_0x4a085d){return _0xa798a5(_0x4a085d);});_0x2952ea['listen'](0x232a,_0x3bc3('0x80'),function(){console[_0x3bc3('0x81')](_0x3bc3('0x82'),0x232a);return _0x1e6ed8(_0x3bc3('0x83')+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 6329663..2a9ea1b 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 _0xd0db=['destcalleridname','phone','resolve','showContact','then','xmd-contactid2','user:%s','format','trigger:%s','action','merge','createContact','name','toLowerCase','catch','Error\x20creating\x20contact','util','lodash','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','emit','exec','data2','data1','calleridnum','isNil','routeId','firstName','','calleridname','uniqueid'];(function(_0x544463,_0x214963){var _0x1add2a=function(_0x5e1006){while(--_0x5e1006){_0x544463['push'](_0x544463['shift']());}};_0x1add2a(++_0x214963);}(_0xd0db,0x85));var _0xbd0d=function(_0x532da5,_0x2da6c4){_0x532da5=_0x532da5-0x0;var _0x50f23e=_0xd0db[_0x532da5];return _0x50f23e;};'use strict';var BPromise=require('bluebird');var util=require(_0xbd0d('0x0'));var _=require(_0xbd0d('0x1'));var Redis=require('ioredis');var config=require(_0xbd0d('0x2'));var logger=require(_0xbd0d('0x3'))(_0xbd0d('0x4'));var cmContactRpc=require(_0xbd0d('0x5'));config['redis']=_[_0xbd0d('0x6')](config[_0xbd0d('0x7')],{'host':_0xbd0d('0x8'),'port':0x18eb});var io=require(_0xbd0d('0x9'))(new Redis(config[_0xbd0d('0x7')]));function emit(_0x126b57,_0x5a499f,_0x4a8e19){logger[_0xbd0d('0xa')](_0x126b57,_0x5a499f,JSON[_0xbd0d('0xb')](_0x4a8e19));io['to'](_0x126b57)[_0xbd0d('0xc')](_0x5a499f,_0x4a8e19);}exports[_0xbd0d('0xd')]=function(_0x2c215b,_0x4295cc,_0x284362){_0x284362['autoCreate']=0x0;if(_0x4295cc[_0xbd0d('0xe')]&&parseInt(_0x4295cc[_0xbd0d('0xe')],0xa)){var _0x186d22={'ListId':parseInt(_0x4295cc[_0xbd0d('0xf')],0xa),'phone':_0x284362[_0xbd0d('0x10')]};if(_[_0xbd0d('0x11')](_0x284362[_0xbd0d('0x12')])){_0x186d22[_0xbd0d('0x13')]=_0x284362['calleridname']&&_0x284362['calleridname']!==_0xbd0d('0x14')?_0x284362[_0xbd0d('0x15')]:_0x284362['calleridnum']||_0x284362[_0xbd0d('0x16')];}else{_0x186d22[_0xbd0d('0x13')]=_0x284362[_0xbd0d('0x17')]&&_0x284362[_0xbd0d('0x17')]!==''?_0x284362[_0xbd0d('0x17')]:_0x284362['destcalleridnum']||_0x284362[_0xbd0d('0x16')];_0x186d22[_0xbd0d('0x18')]=_0x284362[_0xbd0d('0x17')]&&_0x284362['destcalleridname']!==''?_0x284362[_0xbd0d('0x17')]:_0x284362['destcalleridnum']||_0x284362['uniqueid'];}BPromise[_0xbd0d('0x19')]()['then'](cmContactRpc[_0xbd0d('0x1a')]({'where':_['omit'](_0x186d22,[_0xbd0d('0x13')])}))[_0xbd0d('0x1b')](function(_0x4f78cc){if(_0x4f78cc){_0x284362[_0xbd0d('0x1c')]=_0x4f78cc['id'];emit(util['format'](_0xbd0d('0x1d'),_0x2c215b['name']),util[_0xbd0d('0x1e')](_0xbd0d('0x1f'),_0x4295cc[_0xbd0d('0x20')]['toLowerCase']()),_[_0xbd0d('0x21')](_0x284362,{'ListId':parseInt(_0x4295cc[_0xbd0d('0xf')],0xa)}));return;}else{return BPromise[_0xbd0d('0x19')]()['then'](cmContactRpc[_0xbd0d('0x22')](_0x186d22));}})[_0xbd0d('0x1b')](function(_0x4c35df){if(_0x4c35df){_0x284362['xmd-contactid2']=_0x4c35df['id'];emit(util[_0xbd0d('0x1e')](_0xbd0d('0x1d'),_0x2c215b[_0xbd0d('0x23')]),util[_0xbd0d('0x1e')]('trigger:%s',_0x4295cc[_0xbd0d('0x20')][_0xbd0d('0x24')]()),_[_0xbd0d('0x21')](_0x284362,{'ListId':parseInt(_0x4295cc['data1'],0xa)}));}})[_0xbd0d('0x25')](function(_0x33545b){logger['error'](_0xbd0d('0x26'),JSON['stringify'](_0x33545b));});}else{if(_0x2c215b){emit(util['format'](_0xbd0d('0x1d'),_0x2c215b[_0xbd0d('0x23')]),util[_0xbd0d('0x1e')](_0xbd0d('0x1f'),_0x4295cc[_0xbd0d('0x20')][_0xbd0d('0x24')]()),_['merge']({'ListId':parseInt(_0x4295cc[_0xbd0d('0xf')],0xa)},_0x284362));}}}; \ No newline at end of file +var _0x3c77=['stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','resolve','then','showContact','omit','xmd-contactid2','format','action','toLowerCase','merge','user:%s','name','trigger:%s','error','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x3c77,0xca));var _0x73c7=function(_0x5c70f4,_0x2f2358){_0x5c70f4=_0x5c70f4-0x0;var _0x126045=_0x3c77[_0x5c70f4];return _0x126045;};'use strict';var BPromise=require('bluebird');var util=require(_0x73c7('0x0'));var _=require('lodash');var Redis=require('ioredis');var config=require(_0x73c7('0x1'));var logger=require(_0x73c7('0x2'))(_0x73c7('0x3'));var cmContactRpc=require(_0x73c7('0x4'));config[_0x73c7('0x5')]=_[_0x73c7('0x6')](config[_0x73c7('0x5')],{'host':_0x73c7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xf71870,_0x333252,_0x1f10eb){logger['info'](_0xf71870,_0x333252,JSON[_0x73c7('0x8')](_0x1f10eb));io['to'](_0xf71870)[_0x73c7('0x9')](_0x333252,_0x1f10eb);}exports[_0x73c7('0xa')]=function(_0x1e2aa0,_0x3b94c6,_0x1793e9){_0x1793e9[_0x73c7('0xb')]=0x0;if(_0x3b94c6[_0x73c7('0xc')]&&parseInt(_0x3b94c6['data2'],0xa)){var _0xac5eed={'ListId':parseInt(_0x3b94c6[_0x73c7('0xd')],0xa),'phone':_0x1793e9[_0x73c7('0xe')]};if(_[_0x73c7('0xf')](_0x1793e9[_0x73c7('0x10')])){_0xac5eed[_0x73c7('0x11')]=_0x1793e9['calleridname']&&_0x1793e9[_0x73c7('0x12')]!==_0x73c7('0x13')?_0x1793e9[_0x73c7('0x12')]:_0x1793e9[_0x73c7('0xe')]||_0x1793e9[_0x73c7('0x14')];}else{_0xac5eed[_0x73c7('0x11')]=_0x1793e9[_0x73c7('0x15')]&&_0x1793e9[_0x73c7('0x15')]!==_0x73c7('0x13')?_0x1793e9[_0x73c7('0x15')]:_0x1793e9['destcalleridnum']||_0x1793e9[_0x73c7('0x14')];_0xac5eed['phone']=_0x1793e9['destcalleridname']&&_0x1793e9[_0x73c7('0x15')]!==''?_0x1793e9[_0x73c7('0x15')]:_0x1793e9['destcalleridnum']||_0x1793e9[_0x73c7('0x14')];}BPromise[_0x73c7('0x16')]()[_0x73c7('0x17')](cmContactRpc[_0x73c7('0x18')]({'where':_[_0x73c7('0x19')](_0xac5eed,[_0x73c7('0x11')])}))[_0x73c7('0x17')](function(_0x23a28f){if(_0x23a28f){_0x1793e9[_0x73c7('0x1a')]=_0x23a28f['id'];emit(util[_0x73c7('0x1b')]('user:%s',_0x1e2aa0['name']),util[_0x73c7('0x1b')]('trigger:%s',_0x3b94c6[_0x73c7('0x1c')][_0x73c7('0x1d')]()),_[_0x73c7('0x1e')](_0x1793e9,{'ListId':parseInt(_0x3b94c6[_0x73c7('0xd')],0xa)}));return;}else{return BPromise['resolve']()[_0x73c7('0x17')](cmContactRpc['createContact'](_0xac5eed));}})[_0x73c7('0x17')](function(_0x41ea1a){if(_0x41ea1a){_0x1793e9[_0x73c7('0x1a')]=_0x41ea1a['id'];emit(util[_0x73c7('0x1b')](_0x73c7('0x1f'),_0x1e2aa0[_0x73c7('0x20')]),util[_0x73c7('0x1b')](_0x73c7('0x21'),_0x3b94c6[_0x73c7('0x1c')]['toLowerCase']()),_['merge'](_0x1793e9,{'ListId':parseInt(_0x3b94c6[_0x73c7('0xd')],0xa)}));}})['catch'](function(_0x3c6caf){logger[_0x73c7('0x22')]('Error\x20creating\x20contact',JSON[_0x73c7('0x8')](_0x3c6caf));});}else{if(_0x1e2aa0){emit(util[_0x73c7('0x1b')]('user:%s',_0x1e2aa0[_0x73c7('0x20')]),util[_0x73c7('0x1b')]('trigger:%s',_0x3b94c6[_0x73c7('0x1c')][_0x73c7('0x1d')]()),_[_0x73c7('0x1e')]({'ListId':parseInt(_0x3b94c6['data1'],0xa)},_0x1793e9));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e3b984d..ead468f 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 _0x00b3=['zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','salesforceAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','clone','hasOwnProperty','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','600','data6','winArguments','user:%s','name','format','trigger:%s:%s','jscripty','trigger:%s','exec','queue','routeId','urlforward','parse','query','AllConditions','checkConditions','channel','AnyConditions','some','account','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','event','lastevent','exports','lodash','url','mustache','ioredis','./integration','../rpc/cmContact','../../../config/logger','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0x00b3,0x17a));var _0x300b=function(_0x2f9c73,_0x30ac78){_0x2f9c73=_0x2f9c73-0x0;var _0x16f46c=_0x00b3[_0x2f9c73];return _0x16f46c;};'use strict';var util=require('util');var _=require(_0x300b('0x0'));var url=require(_0x300b('0x1'));var Mustache=require(_0x300b('0x2'));var Redis=require(_0x300b('0x3'));var urlforward=require('./urlforward');var integration=require(_0x300b('0x4'));var cmContact=require('./cmContact');var cmContactRpc=require(_0x300b('0x5'));var config=require('../../../config/environment');var logger=require(_0x300b('0x6'))(_0x300b('0x7'));var ami=require(_0x300b('0x8'));config[_0x300b('0x9')]=_['defaults'](config['redis'],{'host':_0x300b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x162843,_0x114d32){return _0x162843==_0x114d32;},'not_equals':function(_0x457aa3,_0x4d8d78){return _0x457aa3!=_0x4d8d78;}};var barAndWebActions=[_0x300b('0xb'),_0x300b('0x1'),_0x300b('0xc')];function Trigger(_0x212b2b){this['triggers']=_0x212b2b[_0x300b('0xd')];this[_0x300b('0xe')]=_0x212b2b[_0x300b('0xe')];this['voiceQueues']=_0x212b2b[_0x300b('0xf')];this[_0x300b('0x10')]=_0x212b2b[_0x300b('0x10')];this[_0x300b('0x11')]=_0x212b2b[_0x300b('0x11')];this[_0x300b('0x12')]=_0x212b2b[_0x300b('0x12')];this[_0x300b('0x13')]=_0x212b2b['freshdeskAccounts'];this['salesforceAccounts']=_0x212b2b['salesforceAccounts'];this['sugarcrmAccounts']=_0x212b2b[_0x300b('0x14')];this[_0x300b('0x15')]=_0x212b2b[_0x300b('0x15')];this[_0x300b('0x16')]=_0x212b2b['deskAccounts'];this['vtigerAccounts']=_0x212b2b[_0x300b('0x17')];this[_0x300b('0x18')]=_0x212b2b[_0x300b('0x18')];this[_0x300b('0x19')]=_0x212b2b['dynamics365Accounts'];this[_0x300b('0x1a')]={'zendesk':this[_0x300b('0x12')],'salesforce':this[_0x300b('0x1b')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x300b('0x14')],'zoho':this[_0x300b('0x15')],'desk':this[_0x300b('0x16')],'vtiger':this[_0x300b('0x17')],'servicenow':this['servicenowAccounts'],'dynamics365':this[_0x300b('0x19')]};ami['on'](_0x300b('0x1c'),this[_0x300b('0x1d')]['bind'](this));ami['on'](_0x300b('0x1e'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x20'),this[_0x300b('0x1d')]['bind'](this));ami['on']('custom:agentcomplete',this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x21'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x22'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x23'),this['syncCustomEvent'][_0x300b('0x1f')](this));ami['on'](_0x300b('0x24'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x300b('0x25'),this['syncCustomEvent'][_0x300b('0x1f')](this));ami['on'](_0x300b('0x26'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x27'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on'](_0x300b('0x28'),this[_0x300b('0x1d')][_0x300b('0x1f')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0x300b('0x1f')](this));}Trigger[_0x300b('0x29')][_0x300b('0x2a')]=function(_0x3d89ab,_0x4b8639,_0x2e30df){logger['info'](_0x3d89ab,_0x4b8639,JSON['stringify'](_0x2e30df));io['to'](_0x3d89ab)['emit'](_0x4b8639,_0x2e30df);};Trigger[_0x300b('0x29')][_0x300b('0x1d')]=function(_0x4c5909){var _0xa7b56a=_[_0x300b('0x2b')](_0x4c5909);this['checkTriggers'](_0xa7b56a);};Trigger[_0x300b('0x29')]['checkTriggers']=function(_0x459b32){var _0x2572c7;for(var _0xdad35f in this[_0x300b('0xd')]){if(this[_0x300b('0xd')][_0x300b('0x2c')](_0xdad35f)){if(this[_0x300b('0xd')][_0xdad35f]['status']){_0x2572c7=this[_0x300b('0x2d')](this['triggers'][_0xdad35f],_0x459b32);if(_0x2572c7){_[_0x300b('0x2e')](_0x459b32,_0x459b32[_0x300b('0x2f')]);for(var _0x4ad19a=0x0,_0x3250dc,_0x355088,_0x5a5aba;_0x4ad19a0x0){_0xb69300=_[_0x8fd8('0x26')](_0x32138a,_0x553be6);}return _0xb69300;}function getCustomFields(_0x4c6bf1,_0x2516e0){var _0x5e1d16=[];var _0x23dd42={'custom_fields':{}};if(_0x4c6bf1[_0x8fd8('0x25')]>0x0){_[_0x8fd8('0x27')](_0x4c6bf1,function(_0x19679e){if(_0x19679e[_0x8fd8('0x28')]===_0x8fd8('0x29')&&_0x19679e['nameField']&&!_0x19679e[_0x8fd8('0x2a')]){_0x23dd42[_0x19679e[_0x8fd8('0x2b')][_0x8fd8('0x2c')]()]=_0x19679e[_0x8fd8('0x2d')][_0x8fd8('0x1d')]();}else if(_0x19679e[_0x8fd8('0x28')]===_0x8fd8('0x29')&&_0x19679e['idField']&&_0x19679e[_0x8fd8('0x2a')]){_0x23dd42[_0x8fd8('0x2e')][_0x19679e[_0x8fd8('0x2f')]]=_0x19679e['content'][_0x8fd8('0x1d')]();}else if(_0x19679e[_0x8fd8('0x28')]===_0x8fd8('0x30')&&_0x19679e[_0x8fd8('0x31')]&&_0x19679e[_0x8fd8('0x2f')]&&_0x19679e[_0x8fd8('0x2a')]){_0x2516e0[_0x19679e[_0x8fd8('0x31')]]&&(_0x23dd42[_0x8fd8('0x2e')][_0x19679e[_0x8fd8('0x2f')]]=_0x2516e0[_0x19679e[_0x8fd8('0x31')]][_0x8fd8('0x1d')]());}else if(_0x19679e['type']===_0x8fd8('0x32')&&_0x19679e[_0x8fd8('0x33')]&&_0x19679e[_0x8fd8('0x33')]['name']&&_0x19679e[_0x8fd8('0x2f')]&&_0x19679e[_0x8fd8('0x2a')]){_0x2516e0[_0x19679e[_0x8fd8('0x33')][_0x8fd8('0x34')][_0x8fd8('0x2c')]()]&&(_0x23dd42[_0x8fd8('0x2e')][_0x19679e['idField']]=_0x2516e0[_0x19679e[_0x8fd8('0x33')][_0x8fd8('0x34')][_0x8fd8('0x2c')]()][_0x8fd8('0x1d')]());}});}if(_0x23dd42[_0x8fd8('0x35')]){_0x23dd42['priority']=Number(_0x23dd42['priority']);}return _0x23dd42;}function getTicket(_0x1590b7,_0x290e04,_0x2c2df5,_0x269597,_0x597329){logger[_0x8fd8('0xf')](_0x8fd8('0x36'));var _0x4e2bb8=_[_0x8fd8('0x37')]({'subject':intUtil[_0x8fd8('0x38')](_0x269597[_0x8fd8('0x39')],_0x597329,'\x20'),'type':'phone','status':_0x8fd8('0x3a'),'labels':[_0x8fd8('0x3b'),_0x8fd8('0x3c'),_0x8fd8('0x3d')][_0x8fd8('0x3e')](getTags(_0x269597[_0x8fd8('0x3f')],_0x8fd8('0x34'))),'description':intUtil[_0x8fd8('0x38')](_0x269597[_0x8fd8('0x40')],_0x597329,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x8fd8('0x41'),_0x290e04['id']),'class':_0x8fd8('0x42')}},'message':{'direction':'in','body':intUtil[_0x8fd8('0x38')](_0x269597[_0x8fd8('0x40')],_0x597329,'\x0a')}},getCustomFields(_0x269597[_0x8fd8('0x43')],_0x597329));return request({'uri':util[_0x8fd8('0x9')]('%s/customers/%d/cases',_0x1590b7[_0x8fd8('0xa')],_0x2c2df5['id']),'method':_0x8fd8('0x23'),'body':_0x4e2bb8});}exports[_0x8fd8('0x44')]=function(_0x49ddac,_0x4bf4bb,_0x9a79f3,_0x23a1fc,_0x486bb7,_0x5dc83f){var _0x42712d,_0x356a24;_0x5dc83f[_0x8fd8('0xa')]=intUtil[_0x8fd8('0x45')](_0x5dc83f[_0x8fd8('0xa')]);_0x5dc83f[_0x8fd8('0x46')]=intUtil[_0x8fd8('0x45')](_0x5dc83f[_0x8fd8('0x46')]);if(_0x486bb7&&_0x486bb7[_0x8fd8('0x47')]){logger[_0x8fd8('0xf')](_0x8fd8('0x48'),_0x8fd8('0x49'));_0x4bf4bb['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5dc83f['serverUrl'],_0x4bf4bb[_0x8fd8('0x4a')],md5(_0x4bf4bb[_0x8fd8('0x4a')]));}else{_0x4bf4bb[_0x8fd8('0x4b')]='';}headers[_0x8fd8('0x4c')]=getAuth(_0x5dc83f);return getUser(_0x5dc83f,_0x23a1fc[_0x8fd8('0x4d')])[_0x8fd8('0xb')](function(_0x2083c6){_0x42712d=_0x2083c6;logger[_0x8fd8('0xf')]('The\x20User\x20ID\x20is:',_0x42712d['id']);return getEndUser(_0x5dc83f,_0x4bf4bb[_0x8fd8('0x4e')],_0x4bf4bb[_0x8fd8('0x4f')]);})['then'](function(_0x1364e4){_0x356a24=_0x1364e4;logger[_0x8fd8('0xf')](_0x8fd8('0x50'),_0x356a24['id']);return getTicket(_0x5dc83f,_0x42712d,_0x356a24,_0x9a79f3,_0x4bf4bb);})[_0x8fd8('0xb')](function(_0x329c34){if(_0x329c34){logger[_0x8fd8('0xf')](_0x8fd8('0x51'));logger[_0x8fd8('0xf')](_0x8fd8('0x52'),_0x329c34['id']);switch(_0x5dc83f[_0x8fd8('0x28')]){case _0x8fd8('0x53'):logger[_0x8fd8('0xf')](_0x8fd8('0x48'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x8fd8('0x9')](_0x8fd8('0x54'),_0x23a1fc[_0x8fd8('0x34')]),_0x8fd8('0x55'),{'recordId':_0x329c34['id']});break;case _0x8fd8('0x56'):logger[_0x8fd8('0xf')]('[QUEUE]',_0x8fd8('0x57'));emit(util['format'](_0x8fd8('0x54'),_0x23a1fc[_0x8fd8('0x34')]),_0x8fd8('0x58'),{'uri':util[_0x8fd8('0x9')](_0x8fd8('0x59'),_0x329c34['id'])});break;default:logger[_0x8fd8('0x5a')](_0x8fd8('0x48'),_0x8fd8('0x5b'));}}})['catch'](function(_0x1c6aae){console['error'](_0x1c6aae);logger[_0x8fd8('0x5a')](_0x8fd8('0x48'),JSON[_0x8fd8('0x14')](_0x1c6aae));});};exports['outbound']=function(_0xd15aa1,_0x4b5b17,_0x16cbf6,_0x20b457,_0x4f7f45,_0x3075cb,_0x4e6e3c){var _0x8e5803,_0x534f29;_0x3075cb[_0x8fd8('0xa')]=intUtil[_0x8fd8('0x45')](_0x3075cb[_0x8fd8('0xa')]);_0x3075cb[_0x8fd8('0x46')]=intUtil[_0x8fd8('0x45')](_0x3075cb[_0x8fd8('0x46')]);if(_0x4e6e3c&&_0x4e6e3c[_0x8fd8('0x5c')]&&_0x4e6e3c[_0x8fd8('0x5c')]!==_0x8fd8('0x5d')){logger[_0x8fd8('0xf')](_0x8fd8('0x5e'),_0x8fd8('0x49'));_0x4b5b17['recordingURL']=util[_0x8fd8('0x9')](_0x8fd8('0x5f'),_0x3075cb['serverUrl'],_0x4b5b17[_0x8fd8('0x4a')],md5(_0x4b5b17['uniqueid']));}headers[_0x8fd8('0x4c')]=getAuth(_0x3075cb);return getUser(_0x3075cb,_0x20b457[_0x8fd8('0x4d')])[_0x8fd8('0xb')](function(_0x3713f3){_0x8e5803=_0x3713f3;logger[_0x8fd8('0xf')](_0x8fd8('0x60'),_0x8e5803['id']);return getEndUser(_0x3075cb,_0x4b5b17['destcalleridname'],_0x4b5b17[_0x8fd8('0x61')]);})['then'](function(_0xe709e5){_0x534f29=_0xe709e5;logger[_0x8fd8('0xf')](_0x8fd8('0x50'),_0x534f29['id']);return getTicket(_0x3075cb,_0x8e5803,_0x534f29,_0x16cbf6,_0x4b5b17);})['then'](function(_0x31e8c3){if(_0x31e8c3){logger[_0x8fd8('0xf')](_0x8fd8('0x51'));logger[_0x8fd8('0xf')](_0x8fd8('0x52'),_0x31e8c3['id']);switch(_0x3075cb[_0x8fd8('0x28')]){case _0x8fd8('0x53'):logger[_0x8fd8('0xf')]('[QUEUE]',_0x8fd8('0x62'));emit(util[_0x8fd8('0x9')](_0x8fd8('0x54'),_0x20b457[_0x8fd8('0x34')]),'trigger:desk:display',{'recordId':_0x31e8c3['id']});break;case _0x8fd8('0x56'):logger[_0x8fd8('0xf')](_0x8fd8('0x48'),_0x8fd8('0x57'));emit(util[_0x8fd8('0x9')](_0x8fd8('0x54'),_0x20b457[_0x8fd8('0x34')]),_0x8fd8('0x58'),{'uri':util[_0x8fd8('0x9')](_0x8fd8('0x63'),_0x3075cb['remoteUri'],_0x31e8c3['id'])});break;default:logger['error']('[OUTBOUND]',_0x8fd8('0x5b'));}}})[_0x8fd8('0x64')](function(_0x4d0f00){logger[_0x8fd8('0x5a')](_0x8fd8('0x5e'),JSON[_0x8fd8('0x14')](_0x4d0f00));});};exports[_0x8fd8('0x65')]=function(_0x2a2437,_0x350d3d,_0x5950d3,_0x258dae,_0x15e2f6,_0x2f8dce){var _0x3633e0,_0x39c5b4;_0x2f8dce[_0x8fd8('0xa')]=intUtil[_0x8fd8('0x45')](_0x2f8dce[_0x8fd8('0xa')]);_0x2f8dce[_0x8fd8('0x46')]=intUtil[_0x8fd8('0x45')](_0x2f8dce[_0x8fd8('0x46')]);if(_0x15e2f6&&_0x15e2f6[_0x8fd8('0x47')]){logger[_0x8fd8('0xf')](_0x8fd8('0x66'),_0x8fd8('0x49'));_0x350d3d[_0x8fd8('0x4b')]=util[_0x8fd8('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f8dce[_0x8fd8('0x46')],_0x350d3d[_0x8fd8('0x4a')],md5(_0x350d3d[_0x8fd8('0x4a')]));}else{_0x350d3d[_0x8fd8('0x4b')]='';}headers[_0x8fd8('0x4c')]=getAuth(_0x2f8dce);return getUser(_0x2f8dce)[_0x8fd8('0xb')](function(_0x3e1eff){_0x3633e0=_0x3e1eff;logger[_0x8fd8('0xf')](_0x8fd8('0x60'),_0x3633e0['id']);return getEndUser(_0x2f8dce,_0x350d3d['calleridname'],_0x350d3d['calleridnum']);})[_0x8fd8('0xb')](function(_0x5e5270){_0x39c5b4=_0x5e5270;logger[_0x8fd8('0xf')](_0x8fd8('0x50'),_0x39c5b4['id']);return getTicket(_0x2f8dce,_0x3633e0,_0x39c5b4,_0x5950d3,_0x350d3d);})[_0x8fd8('0xb')](function(_0xdc4aa9){if(_0xdc4aa9){logger[_0x8fd8('0xf')]('Ticket\x20created!');logger[_0x8fd8('0xf')](_0x8fd8('0x52'),_0xdc4aa9['id']);}})[_0x8fd8('0x64')](function(_0x516b22){logger[_0x8fd8('0x5a')](_0x8fd8('0x66'),JSON['stringify'](_0x516b22));});}; \ No newline at end of file +var _0xe07a=['string','customField','nameField','toLowerCase','content','idField','custom_fields','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','Motion','CTI','concat','Tags','Descriptions','user','%s/customers/%d/cases','POST','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','Authorization','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','abandoned','monitor_format','[ABANDONED]','calleridname','The\x20Ticket\x20ID\x20is:','lodash','md5','ioredis','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','work','map','length','forEach','type'];(function(_0x247d89,_0x148be9){var _0x55bb2d=function(_0x1701a7){while(--_0x1701a7){_0x247d89['push'](_0x247d89['shift']());}};_0x55bb2d(++_0x148be9);}(_0xe07a,0x102));var _0xae07=function(_0x3e8146,_0x2c0f0c){_0x3e8146=_0x3e8146-0x0;var _0x4ca90e=_0xe07a[_0x3e8146];return _0x4ca90e;};'use strict';var _=require(_0xae07('0x0'));var rp=require('request-promise');var md5=require(_0xae07('0x1'));var util=require('util');var Redis=require(_0xae07('0x2'));var intUtil=require(_0xae07('0x3'));var config=require(_0xae07('0x4'));var logger=require('../../../../config/logger')(_0xae07('0x5'));config[_0xae07('0x6')]=_[_0xae07('0x7')](config[_0xae07('0x6')],{'host':_0xae07('0x8'),'port':0x18eb});var io=require(_0xae07('0x9'))(new Redis(config[_0xae07('0x6')]));function emit(_0xe0816f,_0x4d804b,_0x1c32b2){io['to'](_0xe0816f)['emit'](_0x4d804b,_0x1c32b2);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x51409f,_0x51edf4){if(intUtil[_0xae07('0xa')](_0x51edf4)===!![]){logger[_0xae07('0xb')](_0xae07('0xc'),_0x51edf4);return request({'uri':util[_0xae07('0xd')](_0xae07('0xe'),_0x51409f['remoteUri'])})[_0xae07('0xf')](function(_0x2bbc90){if(_0x2bbc90[_0xae07('0x10')]){return _[_0xae07('0x11')](_0x2bbc90[_0xae07('0x12')][_0xae07('0x13')],{'email':_0x51edf4});}})[_0xae07('0xf')](function(_0x5d38fb){if(_0x5d38fb){logger['info'](_0xae07('0x14'));return _0x5d38fb;}else{logger[_0xae07('0xb')](_0xae07('0x15'));return request({'uri':util['format'](_0xae07('0x16'),_0x51409f[_0xae07('0x17')])});}});}else{logger[_0xae07('0xb')](_0xae07('0x18'));return request({'uri':util[_0xae07('0xd')](_0xae07('0x16'),_0x51409f['remoteUri'])});}}function request(_0x1bc9e3){logger[_0xae07('0x19')]('[HTTP]',JSON[_0xae07('0x1a')](_0x1bc9e3));return rp(_[_0xae07('0x7')](_0x1bc9e3,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x114898){var _0x53e16c;if(_0x114898['authType']===_0xae07('0x1b')){_0x53e16c=util['format'](_0xae07('0x1c'),_0x114898[_0xae07('0x1d')],_0x114898[_0xae07('0x1e')]);}else if(_0x114898['authType']===_0xae07('0x1f')){_0x53e16c=util[_0xae07('0xd')](_0xae07('0x20'),_0x114898[_0xae07('0x1d')],_0x114898[_0xae07('0x1f')]);}return util[_0xae07('0xd')](_0xae07('0x21'),new Buffer(_0x53e16c)[_0xae07('0x22')](_0xae07('0x23')));}function getEndUser(_0xba9f7d,_0x56d7ff,_0x519dc1){logger[_0xae07('0xb')](_0xae07('0x24'),_0x519dc1);return request({'uri':util[_0xae07('0xd')]('%s/customers/search',_0xba9f7d[_0xae07('0x17')]),'qs':{'phone':_0x519dc1}})[_0xae07('0xf')](function(_0x293253){if(_0x293253['total_entries']){logger[_0xae07('0xb')](_0xae07('0x25'));return _0x293253[_0xae07('0x12')][_0xae07('0x13')][0x0];}else{logger[_0xae07('0xb')](_0xae07('0x26'));return request({'uri':util[_0xae07('0xd')](_0xae07('0x27'),_0xba9f7d[_0xae07('0x17')]),'method':'POST','body':{'first_name':_0x56d7ff,'title':_0x56d7ff,'phone_numbers':[{'type':_0xae07('0x28'),'value':_0x519dc1}]}});}});}function getTags(_0x39e3f9,_0x4b8f16){var _0x22efa0=[];if(_0x39e3f9&&_0x39e3f9['length']>0x0){_0x22efa0=_[_0xae07('0x29')](_0x39e3f9,_0x4b8f16);}return _0x22efa0;}function getCustomFields(_0x18b2e0,_0x49ccc2){var _0x465f6f=[];var _0xf3dbb6={'custom_fields':{}};if(_0x18b2e0[_0xae07('0x2a')]>0x0){_[_0xae07('0x2b')](_0x18b2e0,function(_0x1a7888){if(_0x1a7888[_0xae07('0x2c')]===_0xae07('0x2d')&&_0x1a7888['nameField']&&!_0x1a7888[_0xae07('0x2e')]){_0xf3dbb6[_0x1a7888[_0xae07('0x2f')][_0xae07('0x30')]()]=_0x1a7888[_0xae07('0x31')]['toString']();}else if(_0x1a7888[_0xae07('0x2c')]==='string'&&_0x1a7888[_0xae07('0x32')]&&_0x1a7888[_0xae07('0x2e')]){_0xf3dbb6[_0xae07('0x33')][_0x1a7888[_0xae07('0x32')]]=_0x1a7888['content'][_0xae07('0x22')]();}else if(_0x1a7888[_0xae07('0x2c')]==='variable'&&_0x1a7888['variableName']&&_0x1a7888[_0xae07('0x32')]&&_0x1a7888[_0xae07('0x2e')]){_0x49ccc2[_0x1a7888[_0xae07('0x34')]]&&(_0xf3dbb6[_0xae07('0x33')][_0x1a7888[_0xae07('0x32')]]=_0x49ccc2[_0x1a7888[_0xae07('0x34')]][_0xae07('0x22')]());}else if(_0x1a7888[_0xae07('0x2c')]===_0xae07('0x35')&&_0x1a7888[_0xae07('0x36')]&&_0x1a7888[_0xae07('0x36')][_0xae07('0x37')]&&_0x1a7888[_0xae07('0x32')]&&_0x1a7888[_0xae07('0x2e')]){_0x49ccc2[_0x1a7888[_0xae07('0x36')][_0xae07('0x37')][_0xae07('0x30')]()]&&(_0xf3dbb6['custom_fields'][_0x1a7888['idField']]=_0x49ccc2[_0x1a7888['Variable'][_0xae07('0x37')][_0xae07('0x30')]()][_0xae07('0x22')]());}});}if(_0xf3dbb6[_0xae07('0x38')]){_0xf3dbb6[_0xae07('0x38')]=Number(_0xf3dbb6[_0xae07('0x38')]);}return _0xf3dbb6;}function getTicket(_0x560c8c,_0xe54966,_0x526d9e,_0x5b84a8,_0x3c7f1f){logger[_0xae07('0xb')](_0xae07('0x39'));var _0x1106b3=_['merge']({'subject':intUtil[_0xae07('0x3a')](_0x5b84a8[_0xae07('0x3b')],_0x3c7f1f,'\x20'),'type':'phone','status':'new','labels':[_0xae07('0x3c'),_0xae07('0x3d'),_0xae07('0x3e')][_0xae07('0x3f')](getTags(_0x5b84a8[_0xae07('0x40')],'name')),'description':intUtil['getString'](_0x5b84a8[_0xae07('0x41')],_0x3c7f1f,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0xe54966['id']),'class':_0xae07('0x42')}},'message':{'direction':'in','body':intUtil[_0xae07('0x3a')](_0x5b84a8['Descriptions'],_0x3c7f1f,'\x0a')}},getCustomFields(_0x5b84a8['Fields'],_0x3c7f1f));return request({'uri':util[_0xae07('0xd')](_0xae07('0x43'),_0x560c8c['remoteUri'],_0x526d9e['id']),'method':_0xae07('0x44'),'body':_0x1106b3});}exports['queue']=function(_0x47f4e8,_0x4a7241,_0x1b823,_0x4efdc5,_0x33e395,_0x24b8c5){var _0x43e722,_0x18a5ae;_0x24b8c5[_0xae07('0x17')]=intUtil[_0xae07('0x45')](_0x24b8c5[_0xae07('0x17')]);_0x24b8c5[_0xae07('0x46')]=intUtil[_0xae07('0x45')](_0x24b8c5[_0xae07('0x46')]);if(_0x33e395&&_0x33e395['monitor_format']){logger['info'](_0xae07('0x47'),_0xae07('0x48'));_0x4a7241[_0xae07('0x49')]=util[_0xae07('0xd')](_0xae07('0x4a'),_0x24b8c5['serverUrl'],_0x4a7241[_0xae07('0x4b')],md5(_0x4a7241[_0xae07('0x4b')]));}else{_0x4a7241[_0xae07('0x49')]='';}headers['Authorization']=getAuth(_0x24b8c5);return getUser(_0x24b8c5,_0x4efdc5[_0xae07('0x4c')])['then'](function(_0x367a50){_0x43e722=_0x367a50;logger[_0xae07('0xb')](_0xae07('0x4d'),_0x43e722['id']);return getEndUser(_0x24b8c5,_0x4a7241['calleridname'],_0x4a7241[_0xae07('0x4e')]);})['then'](function(_0x3c10c8){_0x18a5ae=_0x3c10c8;logger[_0xae07('0xb')](_0xae07('0x4f'),_0x18a5ae['id']);return getTicket(_0x24b8c5,_0x43e722,_0x18a5ae,_0x1b823,_0x4a7241);})[_0xae07('0xf')](function(_0x34553b){if(_0x34553b){logger[_0xae07('0xb')](_0xae07('0x50'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x34553b['id']);switch(_0x24b8c5[_0xae07('0x2c')]){case _0xae07('0x51'):logger[_0xae07('0xb')](_0xae07('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xae07('0xd')](_0xae07('0x52'),_0x4efdc5[_0xae07('0x37')]),_0xae07('0x53'),{'recordId':_0x34553b['id']});break;case'newTab':logger[_0xae07('0xb')](_0xae07('0x47'),_0xae07('0x54'));emit(util[_0xae07('0xd')](_0xae07('0x52'),_0x4efdc5[_0xae07('0x37')]),_0xae07('0x55'),{'uri':util[_0xae07('0xd')](_0xae07('0x56'),_0x34553b['id'])});break;default:logger[_0xae07('0x57')]('[QUEUE]',_0xae07('0x58'));}}})['catch'](function(_0x341bfc){console[_0xae07('0x57')](_0x341bfc);logger[_0xae07('0x57')](_0xae07('0x47'),JSON[_0xae07('0x1a')](_0x341bfc));});};exports[_0xae07('0x59')]=function(_0x12104a,_0x43ffd6,_0x5dd52c,_0x5dc4c1,_0x5934e8,_0x51e2e7,_0x2aacc2){var _0x5e93b8,_0x49e37c;_0x51e2e7[_0xae07('0x17')]=intUtil['stripTrailingSlash'](_0x51e2e7[_0xae07('0x17')]);_0x51e2e7[_0xae07('0x46')]=intUtil[_0xae07('0x45')](_0x51e2e7['serverUrl']);if(_0x2aacc2&&_0x2aacc2[_0xae07('0x5a')]&&_0x2aacc2[_0xae07('0x5a')]!==_0xae07('0x5b')){logger[_0xae07('0xb')](_0xae07('0x5c'),_0xae07('0x48'));_0x43ffd6['recordingURL']=util[_0xae07('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51e2e7[_0xae07('0x46')],_0x43ffd6['uniqueid'],md5(_0x43ffd6[_0xae07('0x4b')]));}headers[_0xae07('0x5d')]=getAuth(_0x51e2e7);return getUser(_0x51e2e7,_0x5dc4c1[_0xae07('0x4c')])[_0xae07('0xf')](function(_0x54d04c){_0x5e93b8=_0x54d04c;logger[_0xae07('0xb')](_0xae07('0x4d'),_0x5e93b8['id']);return getEndUser(_0x51e2e7,_0x43ffd6['destcalleridname'],_0x43ffd6['destcalleridnum']);})[_0xae07('0xf')](function(_0x2e8790){_0x49e37c=_0x2e8790;logger['info']('The\x20Enduser\x20ID\x20is:',_0x49e37c['id']);return getTicket(_0x51e2e7,_0x5e93b8,_0x49e37c,_0x5dd52c,_0x43ffd6);})[_0xae07('0xf')](function(_0x207188){if(_0x207188){logger[_0xae07('0xb')]('Ticket\x20created!');logger[_0xae07('0xb')]('The\x20Ticket\x20ID\x20is:',_0x207188['id']);switch(_0x51e2e7[_0xae07('0x2c')]){case'integrationTab':logger['info'](_0xae07('0x47'),_0xae07('0x5e'));emit(util[_0xae07('0xd')](_0xae07('0x52'),_0x5dc4c1['name']),_0xae07('0x53'),{'recordId':_0x207188['id']});break;case'newTab':logger['info'](_0xae07('0x47'),_0xae07('0x54'));emit(util[_0xae07('0xd')](_0xae07('0x52'),_0x5dc4c1[_0xae07('0x37')]),'trigger:browser:url',{'uri':util[_0xae07('0xd')](_0xae07('0x5f'),_0x51e2e7[_0xae07('0x17')],_0x207188['id'])});break;default:logger[_0xae07('0x57')]('[OUTBOUND]',_0xae07('0x58'));}}})['catch'](function(_0x304864){logger[_0xae07('0x57')](_0xae07('0x5c'),JSON[_0xae07('0x1a')](_0x304864));});};exports[_0xae07('0x60')]=function(_0xbfaa48,_0x5422a8,_0x49ae2a,_0x40ca79,_0x5e1df8,_0x2ee4ac){var _0x3e992f,_0x25f2e9;_0x2ee4ac[_0xae07('0x17')]=intUtil[_0xae07('0x45')](_0x2ee4ac[_0xae07('0x17')]);_0x2ee4ac[_0xae07('0x46')]=intUtil[_0xae07('0x45')](_0x2ee4ac[_0xae07('0x46')]);if(_0x5e1df8&&_0x5e1df8[_0xae07('0x61')]){logger['info'](_0xae07('0x62'),_0xae07('0x48'));_0x5422a8[_0xae07('0x49')]=util[_0xae07('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ee4ac['serverUrl'],_0x5422a8[_0xae07('0x4b')],md5(_0x5422a8[_0xae07('0x4b')]));}else{_0x5422a8[_0xae07('0x49')]='';}headers['Authorization']=getAuth(_0x2ee4ac);return getUser(_0x2ee4ac)[_0xae07('0xf')](function(_0x13854c){_0x3e992f=_0x13854c;logger[_0xae07('0xb')]('The\x20User\x20ID\x20is:',_0x3e992f['id']);return getEndUser(_0x2ee4ac,_0x5422a8[_0xae07('0x63')],_0x5422a8[_0xae07('0x4e')]);})[_0xae07('0xf')](function(_0x2a1e6e){_0x25f2e9=_0x2a1e6e;logger[_0xae07('0xb')]('The\x20Enduser\x20ID\x20is:',_0x25f2e9['id']);return getTicket(_0x2ee4ac,_0x3e992f,_0x25f2e9,_0x49ae2a,_0x5422a8);})[_0xae07('0xf')](function(_0x5895c3){if(_0x5895c3){logger[_0xae07('0xb')]('Ticket\x20created!');logger['info'](_0xae07('0x64'),_0x5895c3['id']);}})['catch'](function(_0x466cb9){logger[_0xae07('0x57')]('[ABANDONED]',JSON[_0xae07('0x1a')](_0x466cb9));});}; \ 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 5416287..7c0a043 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 _0x8efb=['forEach','type','string','nameField','customField','idField','substring','indexOf','content','ticketType','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','email','length','internalemailaddress','isdisabled','info','systemuserid','userId','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','destcalleridnum','/systemusers(','4.0','headers','lastIndexOf','enduserId','toLowerCase','calleridnum','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!'];(function(_0xb04b7f,_0x5b56eb){var _0x402525=function(_0xb719f4){while(--_0xb719f4){_0xb04b7f['push'](_0xb04b7f['shift']());}};_0x402525(++_0x5b56eb);}(_0x8efb,0xed));var _0xb8ef=function(_0x4908ed,_0x1408a4){_0x4908ed=_0x4908ed-0x0;var _0xf65aa9=_0x8efb[_0x4908ed];return _0xf65aa9;};'use strict';var _=require(_0xb8ef('0x0'));var BPromise=require('bluebird');var rp=require(_0xb8ef('0x1'));var util=require(_0xb8ef('0x2'));var intUtil=require(_0xb8ef('0x3'));var md5=require(_0xb8ef('0x4'));var Redis=require(_0xb8ef('0x5'));var logger=require(_0xb8ef('0x6'))(_0xb8ef('0x7'));var config=require('../../../../config/environment');config[_0xb8ef('0x8')]=_[_0xb8ef('0x9')](config[_0xb8ef('0x8')],{'host':_0xb8ef('0xa'),'port':0x18eb});var io=require(_0xb8ef('0xb'))(new Redis(config['redis']));function getAuthToken(_0x3d25d4,_0x1c9f48,_0x3e540c){var _0x63f32b={'method':_0xb8ef('0xc'),'uri':_0x1c9f48,'form':{'client_id':_0x3d25d4[_0xb8ef('0xd')],'resource':_0x3d25d4['remoteUri'],'username':_0x3d25d4[_0xb8ef('0xe')],'password':_0x3d25d4['password'],'grant_type':_0xb8ef('0xf'),'client_secret':_0x3d25d4[_0xb8ef('0x10')]},'json':!![]};return rp(_0x63f32b)[_0xb8ef('0x11')](function(_0x139943){return _0x139943['access_token'];})[_0xb8ef('0x12')](function(_0x53cc5f){logger[_0xb8ef('0x13')]('['+[_0x3e540c['toUpperCase']()]+_0xb8ef('0x14'));return _0x53cc5f[_0xb8ef('0x15')];});}function getUser(_0x47f9c2,_0x55e030,_0x2c396a,_0x3bfd37,_0x4297ab,_0x269ba0){return new BPromise(function(_0x493da4,_0x25131e){return getAuthToken(_0x55e030,_0x3bfd37,_0x269ba0)[_0xb8ef('0x11')](function(_0x26a601){var _0x17df2e={'method':_0xb8ef('0x16'),'uri':_0x4297ab+_0xb8ef('0x17'),'headers':{'Authorization':_0xb8ef('0x18')+_0x26a601,'OData-Version':'4.0'},'json':!![]};return rp(_0x17df2e);})[_0xb8ef('0x11')](function(_0x58eb17){var _0x5d9f56=_0x58eb17[_0xb8ef('0x19')];var _0x112eb1=![];var _0x3f1dcb=null;if(!_['isNil'](_0x2c396a)){if(intUtil['validateEmail'](_0x2c396a[_0xb8ef('0x1a')])){_0x47f9c2['userEmail']=_0x2c396a['email'];for(_0x3f1dcb=0x0;_0x3f1dcb<_0x5d9f56[_0xb8ef('0x1b')];_0x3f1dcb++){if(_0x5d9f56[_0x3f1dcb][_0xb8ef('0x1c')]===_0x2c396a[_0xb8ef('0x1a')]&&!_0x5d9f56[_0x3f1dcb][_0xb8ef('0x1d')]){_0x112eb1=!![];logger[_0xb8ef('0x1e')]('['+[_0x269ba0['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x5d9f56[_0x3f1dcb][_0xb8ef('0x1f')]+'!');_0x47f9c2[_0xb8ef('0x20')]=_0x5d9f56[_0x3f1dcb]['systemuserid'];}}}}if(!_0x112eb1){logger[_0xb8ef('0x1e')]('['+[_0x269ba0[_0xb8ef('0x21')]()]+_0xb8ef('0x22'));_0x47f9c2[_0xb8ef('0x23')]=_0x55e030[_0xb8ef('0xe')];for(_0x3f1dcb=0x0;_0x3f1dcb<_0x5d9f56[_0xb8ef('0x1b')];_0x3f1dcb++){if(_0x5d9f56[_0x3f1dcb]['internalemailaddress']===_0x55e030[_0xb8ef('0xe')]){_0x47f9c2[_0xb8ef('0x20')]=_0x5d9f56[_0x3f1dcb]['systemuserid'];}}}_0x493da4(_0x47f9c2);})[_0xb8ef('0x12')](function(_0xd4fd07){_0x25131e(_0xd4fd07['message']);});});}function createEndUser(_0x1a9aa1,_0x57a401,_0x7fe512,_0x6eccb,_0x2ba625,_0x821ec9){return new BPromise(function(_0x1a8c8f,_0x25a421){return getAuthToken(_0x57a401,_0x7fe512,_0x821ec9)['then'](function(_0x35760d){var _0x5b867c=_0x821ec9['toLowerCase']()===_0xb8ef('0x24')?_0x2ba625[_0xb8ef('0x25')]:_0x2ba625['calleridnum'];var _0x290228={'method':_0xb8ef('0xc'),'uri':_0x6eccb+'contacts','body':{'telephone1':_0x5b867c,'fullname':_0x5b867c,'firstname':_0x5b867c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb8ef('0x26')+_0x1a9aa1[_0xb8ef('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x35760d,'OData-Version':_0xb8ef('0x27')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x290228);})[_0xb8ef('0x11')](function(_0xf82509){var _0x2a2be6=_0xf82509[_0xb8ef('0x28')]['odata-entityid'];var _0x43afe0=_0x2a2be6['substring'](_0x2a2be6[_0xb8ef('0x29')]('(')+0x1,_0x2a2be6[_0xb8ef('0x29')](')'));_0x1a9aa1[_0xb8ef('0x2a')]=_0x43afe0;_0x1a8c8f(_0x1a9aa1);})[_0xb8ef('0x12')](function(_0xed36c3){_0x25a421(_0xed36c3[_0xb8ef('0x15')]);});});}function getEndUser(_0x131b7b,_0x23088e,_0x476349,_0x26bac5,_0x508877,_0x5e52b8){return new BPromise(function(_0x3d4774,_0x2b4820){return getAuthToken(_0x23088e,_0x476349,_0x5e52b8)[_0xb8ef('0x11')](function(_0x3a70f0){var _0x3327ed={'method':'GET','uri':_0x26bac5+'contacts?$select=telephone1','headers':{'Authorization':_0xb8ef('0x18')+_0x3a70f0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3327ed);})[_0xb8ef('0x11')](function(_0x156a69){var _0x368d07=null;if(_0x156a69){var _0x365242=_0x156a69[_0xb8ef('0x19')];var _0x5e40f2=![];for(_0x368d07=0x0;_0x368d07<_0x365242[_0xb8ef('0x1b')];_0x368d07++){var _0x417b74=_0x5e52b8[_0xb8ef('0x2b')]()===_0xb8ef('0x24')?_0x508877[_0xb8ef('0x25')]:_0x508877[_0xb8ef('0x2c')];if(_0x365242[_0x368d07][_0xb8ef('0x2d')]===_0x417b74){_0x5e40f2=!![];_0x131b7b['enduserId']=_0x365242[_0x368d07]['contactid'];}}if(_0x5e40f2){_0x3d4774(_0x131b7b);}else{return createEndUser(_0x131b7b,_0x23088e,_0x476349,_0x26bac5,_0x508877,_0x5e52b8)[_0xb8ef('0x11')](function(_0x305823){logger[_0xb8ef('0x1e')]('['+[_0x5e52b8[_0xb8ef('0x21')]()]+_0xb8ef('0x2e'),_0x305823[_0xb8ef('0x2a')]);_0x3d4774(_0x305823);});}}else{return createEndUser(_0x131b7b,_0x23088e,_0x476349,_0x26bac5,_0x508877,_0x5e52b8)[_0xb8ef('0x11')](function(_0xfba33){logger[_0xb8ef('0x1e')]('['+[_0x5e52b8[_0xb8ef('0x21')]()]+_0xb8ef('0x2f'),_0xfba33[_0xb8ef('0x2a')]);_0x3d4774(_0xfba33);});}});});}function getCustomFields(_0x7d6b1c,_0x56099a,_0x3df96f){var _0x4468b1={};if(_0x7d6b1c['length']>0x0){_[_0xb8ef('0x30')](_0x7d6b1c,function(_0x30e92d){if(_0x30e92d[_0xb8ef('0x31')]===_0xb8ef('0x32')&&_0x30e92d[_0xb8ef('0x33')]&&!_0x30e92d[_0xb8ef('0x34')]){var _0x336069=_0x30e92d[_0xb8ef('0x35')][_0xb8ef('0x2b')]();var _0xe8ba5c=_0x336069[_0xb8ef('0x36')](0x0,_0x336069[_0xb8ef('0x37')]('_'));var _0x2f0826=_0x336069[_0xb8ef('0x36')](_0x336069['indexOf']('_')+0x1);if(_0xe8ba5c===_0x3df96f){_0x4468b1[_0x2f0826]=_0x30e92d[_0xb8ef('0x38')];}}});}return _0x4468b1;}function getTicket(_0x43fdea,_0x238093,_0x4560aa,_0x44e506,_0x378fdf,_0x42213d,_0x132b42){return new BPromise(function(_0x546452,_0x240668){var _0xc5e5fd;return getAuthToken(_0x238093,_0x4560aa,_0x132b42)[_0xb8ef('0x11')](function(_0x4b30d1){if(_0x42213d[_0xb8ef('0x39')]==='incident'){_0xc5e5fd={'method':_0xb8ef('0xc'),'uri':_0x44e506+'incidents','body':Object[_0xb8ef('0x3a')]({},{'title':intUtil[_0xb8ef('0x3b')](_0x42213d[_0xb8ef('0x3c')],_0x378fdf,'\x20'),'description':intUtil[_0xb8ef('0x3b')](_0x42213d[_0xb8ef('0x3d')],_0x378fdf,'\x0a'),'customerid_contact@odata.bind':_0xb8ef('0x3e')+_0x43fdea['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x43fdea['userId']+')','caseorigincode':'1'},getCustomFields(_0x42213d[_0xb8ef('0x3f')],_0x378fdf,_0x42213d[_0xb8ef('0x39')])),'headers':{'Authorization':_0xb8ef('0x18')+_0x4b30d1,'OData-Version':_0xb8ef('0x27')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x42213d[_0xb8ef('0x39')]===_0xb8ef('0x40')){_0xc5e5fd={'method':_0xb8ef('0xc'),'uri':_0x44e506+'phonecalls','body':Object[_0xb8ef('0x3a')]({},{'subject':intUtil['getString'](_0x42213d['Subjects'],_0x378fdf,'\x20'),'phonenumber':String(_0x378fdf[_0xb8ef('0x2c')]),'description':intUtil[_0xb8ef('0x3b')](_0x42213d[_0xb8ef('0x3d')],_0x378fdf,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb8ef('0x3e')+_0x43fdea[_0xb8ef('0x2a')]+')','ownerid@odata.bind':'/systemusers('+_0x43fdea['userId']+')','directioncode':_0x43fdea[_0xb8ef('0x41')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x43fdea[_0xb8ef('0x20')]+')','participationtypemask':_0x43fdea[_0xb8ef('0x41')]===_0xb8ef('0x42')?0x2:0x1},{'partyid_contact@odata.bind':_0xb8ef('0x3e')+_0x43fdea[_0xb8ef('0x2a')]+')','participationtypemask':_0x43fdea[_0xb8ef('0x41')]===_0xb8ef('0x42')?0x1:0x2}]},getCustomFields(_0x42213d[_0xb8ef('0x3f')],_0x378fdf,_0x42213d[_0xb8ef('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0x4b30d1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xc5e5fd);})[_0xb8ef('0x11')](function(_0xa6b570){var _0x20982a=_0xa6b570[_0xb8ef('0x28')]['odata-entityid'];var _0x1500b5=_0x20982a[_0xb8ef('0x36')](_0x20982a[_0xb8ef('0x29')]('(')+0x1,_0x20982a['lastIndexOf'](')'));_0x43fdea[_0xb8ef('0x43')]=_0x1500b5;_0x546452(_0x43fdea);})['catch'](function(_0x149bc4){_0x240668(_0x149bc4[_0xb8ef('0x15')]);});});}function emit(_0x1883e1,_0x2860f9,_0x3bfd3e,_0x43e238){var _0x13054b={'uri':util['format'](_0xb8ef('0x44'),_0x1883e1,_0x3bfd3e,_0x43e238)};io['to'](util[_0xb8ef('0x45')](_0xb8ef('0x46'),_0x2860f9))[_0xb8ef('0x47')](_0xb8ef('0x48'),_0x13054b);}exports['cs']=function(_0x54bada,_0x533662,_0x2359f1,_0x2e066d,_0x48ea95,_0x35a6fe,_0x120666,_0x27561d){var _0x55f080={};_0x35a6fe[_0xb8ef('0x49')]=intUtil[_0xb8ef('0x4a')](_0x35a6fe[_0xb8ef('0x49')]);_0x35a6fe[_0xb8ef('0x4b')]=intUtil[_0xb8ef('0x4a')](_0x35a6fe[_0xb8ef('0x4b')]);_0x55f080[_0xb8ef('0x41')]=_0x27561d===_0xb8ef('0x42')||_0x27561d===_0xb8ef('0x4c')?_0xb8ef('0x42'):'outbound';var _0x4f626a=util[_0xb8ef('0x45')](_0xb8ef('0x4d'),_0x35a6fe[_0xb8ef('0x49')]);var _0x36c80c=util[_0xb8ef('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x35a6fe[_0xb8ef('0x4e')]);var _0x682dd1=util[_0xb8ef('0x45')](_0xb8ef('0x4f'),_0x35a6fe[_0xb8ef('0x4b')],_0x533662[_0xb8ef('0x50')],md5(_0x533662['uniqueid']));if(_0x48ea95&&_0x48ea95[_0xb8ef('0x51')]){logger[_0xb8ef('0x1e')](_0xb8ef('0x52'),'Recording\x20is\x20enabled!');_0x533662['recordingURL']=_0x682dd1;}else if(_0x120666&&_0x120666['recordingFormat']&&_0x120666[_0xb8ef('0x53')]!=='none'){logger['info']('[OUTBOUND]',_0xb8ef('0x54'));_0x533662[_0xb8ef('0x55')]=_0x682dd1;}else{_0x533662[_0xb8ef('0x55')]='';}return getUser(_0x55f080,_0x35a6fe,_0x2e066d,_0x36c80c,_0x4f626a,_0x27561d)[_0xb8ef('0x11')](function(_0x51678e){logger['info']('['+_0x27561d['toUpperCase']()+_0xb8ef('0x56'),_0x51678e['userId']);logger[_0xb8ef('0x1e')]('['+_0x27561d[_0xb8ef('0x21')]()+_0xb8ef('0x57'),_0x51678e[_0xb8ef('0x23')]);return getEndUser(_0x51678e,_0x35a6fe,_0x36c80c,_0x4f626a,_0x533662,_0x27561d);})[_0xb8ef('0x11')](function(_0x179b9e){logger['info']('['+_0x27561d['toUpperCase']()+_0xb8ef('0x58'),_0x179b9e[_0xb8ef('0x2a')]);logger[_0xb8ef('0x1e')]('['+_0x27561d['toUpperCase']()+_0xb8ef('0x59'),_0x533662['calleridnum']);return getTicket(_0x179b9e,_0x35a6fe,_0x36c80c,_0x4f626a,_0x533662,_0x2359f1,_0x27561d);})['then'](function(_0x2256c1){logger[_0xb8ef('0x1e')](util[_0xb8ef('0x45')]('['+_0x27561d[_0xb8ef('0x21')]()+_0xb8ef('0x5a'),_0x2359f1['ticketType'],_0x2256c1[_0xb8ef('0x43')]));logger[_0xb8ef('0x1e')](util[_0xb8ef('0x45')]('['+_0x27561d[_0xb8ef('0x21')]()+_0xb8ef('0x5b'),_0x27561d));if(_0x27561d!=='abandoned'){logger['info']('['+_0x27561d[_0xb8ef('0x21')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x35a6fe[_0xb8ef('0x49')],_0x2e066d[_0xb8ef('0x5c')],_0x2359f1['ticketType'],_0x2256c1[_0xb8ef('0x43')]);}})['catch'](function(_0x2fecbf){logger[_0xb8ef('0x13')]('['+_0x27561d[_0xb8ef('0x21')]()+_0xb8ef('0x5d'),util[_0xb8ef('0x5e')](_0x2fecbf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1105=['Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','password','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','email','userEmail','length','internalemailaddress','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','contacts?$select=telephone1','outbound','telephone1','enduserId',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','lastIndexOf','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','abandoned'];(function(_0x1ce919,_0x1bbb96){var _0x34ec94=function(_0x3f7a6f){while(--_0x3f7a6f){_0x1ce919['push'](_0x1ce919['shift']());}};_0x34ec94(++_0x1bbb96);}(_0x1105,0x124));var _0x5110=function(_0x3836fc,_0x558473){_0x3836fc=_0x3836fc-0x0;var _0x24442b=_0x1105[_0x3836fc];return _0x24442b;};'use strict';var _=require(_0x5110('0x0'));var BPromise=require('bluebird');var rp=require(_0x5110('0x1'));var util=require(_0x5110('0x2'));var intUtil=require(_0x5110('0x3'));var md5=require(_0x5110('0x4'));var Redis=require(_0x5110('0x5'));var logger=require(_0x5110('0x6'))('dynamics365');var config=require(_0x5110('0x7'));config[_0x5110('0x8')]=_[_0x5110('0x9')](config[_0x5110('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x5110('0xa'))(new Redis(config[_0x5110('0x8')]));function getAuthToken(_0x3d9812,_0x51c100,_0x5972a7){var _0x199d9f={'method':_0x5110('0xb'),'uri':_0x51c100,'form':{'client_id':_0x3d9812[_0x5110('0xc')],'resource':_0x3d9812[_0x5110('0xd')],'username':_0x3d9812['username'],'password':_0x3d9812[_0x5110('0xe')],'grant_type':_0x5110('0xe'),'client_secret':_0x3d9812['clientSecret']},'json':!![]};return rp(_0x199d9f)['then'](function(_0xf2ecc5){return _0xf2ecc5['access_token'];})['catch'](function(_0x4c7568){logger[_0x5110('0xf')]('['+[_0x5972a7[_0x5110('0x10')]()]+_0x5110('0x11'));return _0x4c7568[_0x5110('0x12')];});}function getUser(_0x3f674f,_0x1a4452,_0x590ebc,_0x8435e5,_0x5220bd,_0x51dad2){return new BPromise(function(_0x54f095,_0x2b64c3){return getAuthToken(_0x1a4452,_0x8435e5,_0x51dad2)[_0x5110('0x13')](function(_0x3d05ef){var _0x3f0cbe={'method':_0x5110('0x14'),'uri':_0x5220bd+_0x5110('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x3d05ef,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f0cbe);})['then'](function(_0x40e2fc){var _0x3aee41=_0x40e2fc[_0x5110('0x16')];var _0x2d9e17=![];var _0x48f42b=null;if(!_[_0x5110('0x17')](_0x590ebc)){if(intUtil['validateEmail'](_0x590ebc[_0x5110('0x18')])){_0x3f674f[_0x5110('0x19')]=_0x590ebc['email'];for(_0x48f42b=0x0;_0x48f42b<_0x3aee41[_0x5110('0x1a')];_0x48f42b++){if(_0x3aee41[_0x48f42b][_0x5110('0x1b')]===_0x590ebc[_0x5110('0x18')]&&!_0x3aee41[_0x48f42b]['isdisabled']){_0x2d9e17=!![];logger[_0x5110('0x1c')]('['+[_0x51dad2[_0x5110('0x10')]()]+']\x20Agent\x20found\x20'+_0x3aee41[_0x48f42b][_0x5110('0x1d')]+'!');_0x3f674f[_0x5110('0x1e')]=_0x3aee41[_0x48f42b][_0x5110('0x1d')];}}}}if(!_0x2d9e17){logger[_0x5110('0x1c')]('['+[_0x51dad2[_0x5110('0x10')]()]+_0x5110('0x1f'));_0x3f674f[_0x5110('0x19')]=_0x1a4452['username'];for(_0x48f42b=0x0;_0x48f42b<_0x3aee41[_0x5110('0x1a')];_0x48f42b++){if(_0x3aee41[_0x48f42b][_0x5110('0x1b')]===_0x1a4452[_0x5110('0x20')]){_0x3f674f[_0x5110('0x1e')]=_0x3aee41[_0x48f42b][_0x5110('0x1d')];}}}_0x54f095(_0x3f674f);})[_0x5110('0x21')](function(_0x4f3e77){_0x2b64c3(_0x4f3e77['message']);});});}function createEndUser(_0x50bd63,_0x5e4ec6,_0x14678f,_0x2b783a,_0x224ca2,_0x13a7c2){return new BPromise(function(_0xf5a331,_0x21e1a6){return getAuthToken(_0x5e4ec6,_0x14678f,_0x13a7c2)[_0x5110('0x13')](function(_0x318f79){var _0xe120b1=_0x13a7c2[_0x5110('0x22')]()==='outbound'?_0x224ca2[_0x5110('0x23')]:_0x224ca2[_0x5110('0x24')];var _0x4ad05f={'method':_0x5110('0xb'),'uri':_0x2b783a+_0x5110('0x25'),'body':{'telephone1':_0xe120b1,'fullname':_0xe120b1,'firstname':_0xe120b1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5110('0x26')+_0x50bd63[_0x5110('0x1e')]+')'},'headers':{'Authorization':_0x5110('0x27')+_0x318f79,'OData-Version':_0x5110('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4ad05f);})['then'](function(_0x441bdb){var _0x26e43c=_0x441bdb[_0x5110('0x29')][_0x5110('0x2a')];var _0x48c33f=_0x26e43c[_0x5110('0x2b')](_0x26e43c['lastIndexOf']('(')+0x1,_0x26e43c['lastIndexOf'](')'));_0x50bd63['enduserId']=_0x48c33f;_0xf5a331(_0x50bd63);})['catch'](function(_0x1bc16c){_0x21e1a6(_0x1bc16c['message']);});});}function getEndUser(_0x175cd5,_0x26c0d0,_0x571147,_0x16fab4,_0xc040eb,_0x1ffeb6){return new BPromise(function(_0x4dcca2,_0x5e2459){return getAuthToken(_0x26c0d0,_0x571147,_0x1ffeb6)[_0x5110('0x13')](function(_0x4cab93){var _0x7cb914={'method':_0x5110('0x14'),'uri':_0x16fab4+_0x5110('0x2c'),'headers':{'Authorization':_0x5110('0x27')+_0x4cab93,'If-None-Match':null,'OData-Version':_0x5110('0x28')},'json':!![]};return rp(_0x7cb914);})[_0x5110('0x13')](function(_0x353844){var _0x23a887=null;if(_0x353844){var _0x5c3a57=_0x353844[_0x5110('0x16')];var _0x3dc54e=![];for(_0x23a887=0x0;_0x23a887<_0x5c3a57['length'];_0x23a887++){var _0x357236=_0x1ffeb6[_0x5110('0x22')]()===_0x5110('0x2d')?_0xc040eb['destcalleridnum']:_0xc040eb[_0x5110('0x24')];if(_0x5c3a57[_0x23a887][_0x5110('0x2e')]===_0x357236){_0x3dc54e=!![];_0x175cd5[_0x5110('0x2f')]=_0x5c3a57[_0x23a887]['contactid'];}}if(_0x3dc54e){_0x4dcca2(_0x175cd5);}else{return createEndUser(_0x175cd5,_0x26c0d0,_0x571147,_0x16fab4,_0xc040eb,_0x1ffeb6)['then'](function(_0x2dc97e){logger[_0x5110('0x1c')]('['+[_0x1ffeb6[_0x5110('0x10')]()]+_0x5110('0x30'),_0x2dc97e[_0x5110('0x2f')]);_0x4dcca2(_0x2dc97e);});}}else{return createEndUser(_0x175cd5,_0x26c0d0,_0x571147,_0x16fab4,_0xc040eb,_0x1ffeb6)['then'](function(_0x5a51c2){logger[_0x5110('0x1c')]('['+[_0x1ffeb6['toUpperCase']()]+_0x5110('0x31'),_0x5a51c2['enduserId']);_0x4dcca2(_0x5a51c2);});}});});}function getCustomFields(_0x14c4a1,_0x35feef,_0x342948){var _0x123643={};if(_0x14c4a1[_0x5110('0x1a')]>0x0){_['forEach'](_0x14c4a1,function(_0x515476){if(_0x515476[_0x5110('0x32')]===_0x5110('0x33')&&_0x515476['nameField']&&!_0x515476[_0x5110('0x34')]){var _0x12b5ef=_0x515476[_0x5110('0x35')][_0x5110('0x22')]();var _0x4d8fc2=_0x12b5ef['substring'](0x0,_0x12b5ef['indexOf']('_'));var _0xae5e5c=_0x12b5ef[_0x5110('0x2b')](_0x12b5ef[_0x5110('0x36')]('_')+0x1);if(_0x4d8fc2===_0x342948){_0x123643[_0xae5e5c]=_0x515476['content'];}}});}return _0x123643;}function getTicket(_0x29cc88,_0x3eb09f,_0x1467db,_0xbb130b,_0x418f54,_0x2af5be,_0x4c6c73){return new BPromise(function(_0x4cb71f,_0x3c326b){var _0x3c3bd8;return getAuthToken(_0x3eb09f,_0x1467db,_0x4c6c73)[_0x5110('0x13')](function(_0x6bb450){if(_0x2af5be[_0x5110('0x37')]===_0x5110('0x38')){_0x3c3bd8={'method':_0x5110('0xb'),'uri':_0xbb130b+_0x5110('0x39'),'body':Object[_0x5110('0x3a')]({},{'title':intUtil[_0x5110('0x3b')](_0x2af5be[_0x5110('0x3c')],_0x418f54,'\x20'),'description':intUtil[_0x5110('0x3b')](_0x2af5be[_0x5110('0x3d')],_0x418f54,'\x0a'),'customerid_contact@odata.bind':_0x5110('0x3e')+_0x29cc88[_0x5110('0x2f')]+')','ownerid@odata.bind':_0x5110('0x26')+_0x29cc88[_0x5110('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x2af5be[_0x5110('0x3f')],_0x418f54,_0x2af5be['ticketType'])),'headers':{'Authorization':_0x5110('0x27')+_0x6bb450,'OData-Version':_0x5110('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2af5be[_0x5110('0x37')]===_0x5110('0x40')){_0x3c3bd8={'method':_0x5110('0xb'),'uri':_0xbb130b+_0x5110('0x41'),'body':Object[_0x5110('0x3a')]({},{'subject':intUtil[_0x5110('0x3b')](_0x2af5be[_0x5110('0x3c')],_0x418f54,'\x20'),'phonenumber':String(_0x418f54[_0x5110('0x24')]),'description':intUtil['getString'](_0x2af5be['Descriptions'],_0x418f54,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x29cc88[_0x5110('0x2f')]+')','ownerid@odata.bind':_0x5110('0x26')+_0x29cc88['userId']+')','directioncode':_0x29cc88[_0x5110('0x42')]===_0x5110('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5110('0x26')+_0x29cc88[_0x5110('0x1e')]+')','participationtypemask':_0x29cc88[_0x5110('0x42')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5110('0x3e')+_0x29cc88[_0x5110('0x2f')]+')','participationtypemask':_0x29cc88[_0x5110('0x42')]===_0x5110('0x43')?0x1:0x2}]},getCustomFields(_0x2af5be['Fields'],_0x418f54,_0x2af5be[_0x5110('0x37')])),'headers':{'Authorization':_0x5110('0x27')+_0x6bb450,'OData-Version':_0x5110('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3c3bd8);})['then'](function(_0x1ba6f9){var _0x2001fb=_0x1ba6f9[_0x5110('0x29')][_0x5110('0x2a')];var _0x369d5c=_0x2001fb['substring'](_0x2001fb[_0x5110('0x44')]('(')+0x1,_0x2001fb[_0x5110('0x44')](')'));_0x29cc88[_0x5110('0x45')]=_0x369d5c;_0x4cb71f(_0x29cc88);})['catch'](function(_0x5c2682){_0x3c326b(_0x5c2682['message']);});});}function emit(_0x536c14,_0x2318ef,_0x2ecc71,_0x395fe5){var _0x41d750={'uri':util['format'](_0x5110('0x46'),_0x536c14,_0x2ecc71,_0x395fe5)};io['to'](util[_0x5110('0x47')](_0x5110('0x48'),_0x2318ef))[_0x5110('0x49')](_0x5110('0x4a'),_0x41d750);}exports['cs']=function(_0x43cd38,_0x4907dd,_0x9d1b83,_0x2e39d9,_0x390d98,_0x408869,_0x43dce1,_0x350401){var _0x3e0c3={};_0x408869[_0x5110('0xd')]=intUtil['stripTrailingSlash'](_0x408869[_0x5110('0xd')]);_0x408869['serverUrl']=intUtil['stripTrailingSlash'](_0x408869[_0x5110('0x4b')]);_0x3e0c3[_0x5110('0x42')]=_0x350401===_0x5110('0x43')||_0x350401==='abandoned'?_0x5110('0x43'):_0x5110('0x2d');var _0x2723da=util[_0x5110('0x47')](_0x5110('0x4c'),_0x408869[_0x5110('0xd')]);var _0x519a35=util[_0x5110('0x47')](_0x5110('0x4d'),_0x408869[_0x5110('0x4e')]);var _0x2f4c94=util[_0x5110('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x408869['serverUrl'],_0x4907dd[_0x5110('0x4f')],md5(_0x4907dd['uniqueid']));if(_0x390d98&&_0x390d98['monitor_format']){logger['info'](_0x5110('0x50'),_0x5110('0x51'));_0x4907dd[_0x5110('0x52')]=_0x2f4c94;}else if(_0x43dce1&&_0x43dce1[_0x5110('0x53')]&&_0x43dce1[_0x5110('0x53')]!==_0x5110('0x54')){logger[_0x5110('0x1c')](_0x5110('0x55'),'Recording\x20is\x20enabled!');_0x4907dd[_0x5110('0x52')]=_0x2f4c94;}else{_0x4907dd['recordingURL']='';}return getUser(_0x3e0c3,_0x408869,_0x2e39d9,_0x519a35,_0x2723da,_0x350401)[_0x5110('0x13')](function(_0xc46944){logger[_0x5110('0x1c')]('['+_0x350401[_0x5110('0x10')]()+_0x5110('0x56'),_0xc46944['userId']);logger['info']('['+_0x350401[_0x5110('0x10')]()+_0x5110('0x57'),_0xc46944['userEmail']);return getEndUser(_0xc46944,_0x408869,_0x519a35,_0x2723da,_0x4907dd,_0x350401);})[_0x5110('0x13')](function(_0x40a8ec){logger[_0x5110('0x1c')]('['+_0x350401[_0x5110('0x10')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x40a8ec['enduserId']);logger[_0x5110('0x1c')]('['+_0x350401[_0x5110('0x10')]()+_0x5110('0x58'),_0x4907dd[_0x5110('0x24')]);return getTicket(_0x40a8ec,_0x408869,_0x519a35,_0x2723da,_0x4907dd,_0x9d1b83,_0x350401);})[_0x5110('0x13')](function(_0xb01f04){logger['info'](util['format']('['+_0x350401[_0x5110('0x10')]()+_0x5110('0x59'),_0x9d1b83[_0x5110('0x37')],_0xb01f04['ticketId']));logger[_0x5110('0x1c')](util[_0x5110('0x47')]('['+_0x350401['toUpperCase']()+_0x5110('0x5a'),_0x350401));if(_0x350401!==_0x5110('0x5b')){logger['info']('['+_0x350401[_0x5110('0x10')]()+']',_0x5110('0x5c'));emit(_0x408869['remoteUri'],_0x2e39d9[_0x5110('0x5d')],_0x9d1b83[_0x5110('0x37')],_0xb01f04[_0x5110('0x45')]);}})[_0x5110('0x21')](function(_0x3d131e){logger[_0x5110('0xf')]('['+_0x350401[_0x5110('0x10')]()+_0x5110('0x5e'),util[_0x5110('0x5f')](_0x3d131e,{'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 8616065..5b0c588 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 _0x690e=['lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','apiKey','toString','base64','debug','[HTTP]','stringify','GET','length','map','type','string','nameField','toLowerCase','push','idField','variable','variableName','customField','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]'];(function(_0x58fa7f,_0x4ed6e3){var _0x526007=function(_0x4d6fbc){while(--_0x4d6fbc){_0x58fa7f['push'](_0x58fa7f['shift']());}};_0x526007(++_0x4ed6e3);}(_0x690e,0x1b8));var _0xe690=function(_0x2a5965,_0x5bf50b){_0x2a5965=_0x2a5965-0x0;var _0x1ded89=_0x690e[_0x2a5965];return _0x1ded89;};'use strict';var _=require(_0xe690('0x0'));var rp=require(_0xe690('0x1'));var md5=require(_0xe690('0x2'));var util=require(_0xe690('0x3'));var Redis=require(_0xe690('0x4'));var intUtil=require(_0xe690('0x5'));var config=require(_0xe690('0x6'));var logger=require(_0xe690('0x7'))(_0xe690('0x8'));config[_0xe690('0x9')]=_[_0xe690('0xa')](config[_0xe690('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xe690('0xb'),'Accept':_0xe690('0xb')};function emit(_0x1355a0,_0x2a15a2,_0x24c446){io['to'](_0x1355a0)[_0xe690('0xc')](_0x2a15a2,_0x24c446);}function getTicket(_0x41441f,_0x571a38,_0x1ca12d,_0x19b081,_0x1829ef){logger[_0xe690('0xd')](_0xe690('0xe'));var _0x52eda9=_[_0xe690('0xf')]({'responder_id':_0x571a38['id'],'requester_id':_0x1ca12d['id'],'name':util[_0xe690('0x10')]('Caller\x20-\x20%s',_0x1829ef[_0xe690('0x11')]),'phone':_0x1829ef[_0xe690('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe690('0x13')](_0x19b081['Subjects'],_0x1829ef,'\x20'),'description':intUtil['getString'](_0x19b081['Descriptions'],_0x1829ef,_0xe690('0x14')),'tags':getTags(_0x19b081[_0xe690('0x15')],_0xe690('0x16'))},getCustomFields(_0x19b081[_0xe690('0x17')],_0x1829ef));_0x52eda9[_0xe690('0x18')]=_[_0xe690('0x19')](_[_0xe690('0x1a')](_0x52eda9['custom_fields'],'id'),'value');return request({'uri':util[_0xe690('0x10')](_0xe690('0x1b'),_0x41441f[_0xe690('0x1c')]),'method':_0xe690('0x1d'),'body':_0x52eda9})[_0xe690('0x1e')](function(_0x401e52){logger[_0xe690('0xd')](_0xe690('0x1f'));return _0x401e52;});}function getUser(_0x251c7a,_0xdb2af2){if(intUtil[_0xe690('0x20')](_0xdb2af2)){return request({'uri':util['format'](_0xe690('0x21'),_0x251c7a['remoteUri']),'qs':{'email':_0xdb2af2}})[_0xe690('0x1e')](function(_0x10fc7c){if(_0x10fc7c['length']){logger[_0xe690('0xd')]('Agent\x20found!');return _['find'](_0x10fc7c,function(_0x4577c0){return _0x4577c0[_0xe690('0x22')]['email']===_0xdb2af2;});}else{logger[_0xe690('0xd')](_0xe690('0x23'));return request({'uri':util[_0xe690('0x10')](_0xe690('0x24'),_0x251c7a[_0xe690('0x1c')])})[_0xe690('0x1e')](function(_0x5f0e79){logger[_0xe690('0xd')](_0xe690('0x25'));return _0x5f0e79;});}});}else{logger[_0xe690('0xd')](_0xe690('0x26'));return request({'uri':util[_0xe690('0x10')](_0xe690('0x24'),_0x251c7a[_0xe690('0x1c')])})[_0xe690('0x1e')](function(_0x14f54f){logger['info'](_0xe690('0x25'));return _0x14f54f;});}}function getEndUser(_0xc58dde,_0x3d44e1,_0x42b491){logger[_0xe690('0xd')](_0xe690('0x27'),_0x42b491);return request({'uri':util[_0xe690('0x10')](_0xe690('0x28'),_0xc58dde[_0xe690('0x1c')]),'qs':{'phone':_0x42b491}})[_0xe690('0x1e')](function(_0x5126e8){if(_0x5126e8['length']){logger[_0xe690('0xd')](_0xe690('0x29'));return _[_0xe690('0x2a')](_0x5126e8,{'phone':_0x42b491});}else{logger[_0xe690('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0xc58dde['remoteUri']),'method':_0xe690('0x1d'),'body':{'name':_0x3d44e1,'phone':_0x42b491}})[_0xe690('0x1e')](function(_0x2f032e){logger[_0xe690('0xd')]('Enduser\x20created.');return _0x2f032e;});}});}function getAuth(_0x5998c1){return util[_0xe690('0x10')]('Basic\x20%s',new Buffer(_0x5998c1[_0xe690('0x2b')]+':X')[_0xe690('0x2c')](_0xe690('0x2d')));}function request(_0x3ec52c){logger[_0xe690('0x2e')](_0xe690('0x2f'),JSON[_0xe690('0x30')](_0x3ec52c));return rp(_[_0xe690('0xa')](_0x3ec52c,{'method':_0xe690('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x10e6c0,_0x421a67){var _0x48b041=[];if(_0x10e6c0&&_0x10e6c0[_0xe690('0x32')]>0x0){_0x48b041=_[_0xe690('0x33')](_0x10e6c0,_0x421a67);}return _0x48b041;}function getCustomFields(_0x326e12,_0x36dea5){var _0x442920=[];var _0xb79ddd={'custom_fields':[]};if(_0x326e12[_0xe690('0x32')]>0x0){_['forEach'](_0x326e12,function(_0x11cbc6){if(_0x11cbc6[_0xe690('0x34')]===_0xe690('0x35')&&_0x11cbc6[_0xe690('0x36')]&&!_0x11cbc6['customField']){_0xb79ddd[_0x11cbc6[_0xe690('0x36')][_0xe690('0x37')]()]=_0x11cbc6['content'][_0xe690('0x2c')]();}else if(_0x11cbc6['type']===_0xe690('0x35')&&_0x11cbc6['idField']&&_0x11cbc6['customField']){_0xb79ddd[_0xe690('0x18')][_0xe690('0x38')]({'id':_0x11cbc6[_0xe690('0x39')],'value':_0x11cbc6['content']['toString']()});}else if(_0x11cbc6[_0xe690('0x34')]===_0xe690('0x3a')&&_0x11cbc6[_0xe690('0x3b')]&&_0x11cbc6['idField']&&_0x11cbc6[_0xe690('0x3c')]){_0x36dea5[_0x11cbc6['variableName']]&&_0xb79ddd[_0xe690('0x18')][_0xe690('0x38')]({'id':_0x11cbc6[_0xe690('0x39')],'value':_0x36dea5[_0x11cbc6[_0xe690('0x3b')]][_0xe690('0x2c')]()});}else if(_0x11cbc6['type']===_0xe690('0x3d')&&_0x11cbc6['Variable']&&_0x11cbc6[_0xe690('0x3e')][_0xe690('0x16')]&&_0x11cbc6[_0xe690('0x39')]&&_0x11cbc6[_0xe690('0x3c')]){_0x36dea5[_0x11cbc6[_0xe690('0x3e')][_0xe690('0x16')][_0xe690('0x37')]()]&&_0xb79ddd['custom_fields'][_0xe690('0x38')]({'id':_0x11cbc6[_0xe690('0x39')],'value':_0x36dea5[_0x11cbc6[_0xe690('0x3e')][_0xe690('0x16')]['toLowerCase']()][_0xe690('0x2c')]()});}});}return _0xb79ddd;}exports['queue']=function(_0x223389,_0x1a698a,_0x290006,_0x3d2b40,_0x249a38,_0x29e361){var _0x520eb2,_0x3721f5;_0x29e361[_0xe690('0x1c')]=intUtil[_0xe690('0x3f')](_0x29e361[_0xe690('0x1c')]);_0x29e361[_0xe690('0x40')]=intUtil[_0xe690('0x3f')](_0x29e361[_0xe690('0x40')]);if(_0x249a38&&_0x249a38[_0xe690('0x41')]){logger[_0xe690('0xd')](_0xe690('0x42'),_0xe690('0x43'));_0x1a698a[_0xe690('0x44')]=util[_0xe690('0x10')](_0xe690('0x45'),_0x29e361['serverUrl'],_0x1a698a[_0xe690('0x46')],md5(_0x1a698a[_0xe690('0x46')]));}else{_0x1a698a[_0xe690('0x44')]='';}headers[_0xe690('0x47')]=getAuth(_0x29e361);return getUser(_0x29e361,_0x3d2b40['email'])[_0xe690('0x1e')](function(_0x56df74){_0x520eb2=_0x56df74;logger['info'](_0xe690('0x48'),_0x520eb2['id']);return getEndUser(_0x29e361,_0x1a698a[_0xe690('0x11')],_0x1a698a[_0xe690('0x12')]);})[_0xe690('0x1e')](function(_0x486061){_0x3721f5=_0x486061;logger[_0xe690('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3721f5['id']);return getTicket(_0x29e361,_0x520eb2,_0x3721f5,_0x290006,_0x1a698a);})[_0xe690('0x1e')](function(_0x43ae60){if(_0x43ae60&&_0x43ae60['id']){logger[_0xe690('0xd')](_0xe690('0x1f'));logger[_0xe690('0xd')]('The\x20Ticket\x20ID\x20is:',_0x43ae60['id']);logger[_0xe690('0xd')](_0xe690('0x42'),_0xe690('0x49'));emit(util[_0xe690('0x10')](_0xe690('0x4a'),_0x3d2b40[_0xe690('0x16')]),_0xe690('0x4b'),{'uri':util[_0xe690('0x10')]('%s/helpdesk/tickets/%d',_0x29e361['remoteUri'],_0x43ae60['id'])});}})['catch'](function(_0x40e704){logger[_0xe690('0x4c')]('[QUEUE]',JSON[_0xe690('0x30')](_0x40e704));});};exports['outbound']=function(_0x541c9d,_0x25ce32,_0x461c3a,_0x32ed06,_0x3bacd3,_0x450397,_0x18b7d3){var _0x9f70b7,_0x12e781;_0x450397['remoteUri']=intUtil[_0xe690('0x3f')](_0x450397[_0xe690('0x1c')]);_0x450397[_0xe690('0x40')]=intUtil[_0xe690('0x3f')](_0x450397[_0xe690('0x40')]);if(_0x18b7d3&&_0x18b7d3[_0xe690('0x4d')]&&_0x18b7d3['recordingFormat']!==_0xe690('0x4e')){logger['info'](_0xe690('0x4f'),_0xe690('0x43'));_0x25ce32[_0xe690('0x44')]=util[_0xe690('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x450397['serverUrl'],_0x25ce32[_0xe690('0x46')],md5(_0x25ce32[_0xe690('0x46')]));}headers[_0xe690('0x47')]=getAuth(_0x450397);return getUser(_0x450397,_0x32ed06[_0xe690('0x50')])[_0xe690('0x1e')](function(_0x441351){_0x9f70b7=_0x441351;logger[_0xe690('0xd')]('The\x20User\x20ID\x20is:',_0x9f70b7['id']);return getEndUser(_0x450397,_0x25ce32[_0xe690('0x51')],_0x25ce32[_0xe690('0x52')]);})['then'](function(_0x4f642e){_0x12e781=_0x4f642e;logger[_0xe690('0xd')](_0xe690('0x53'),_0x12e781['id']);return getTicket(_0x450397,_0x9f70b7,_0x12e781,_0x461c3a,_0x25ce32);})[_0xe690('0x1e')](function(_0x583a31){if(_0x583a31&&_0x583a31['id']){logger['info'](_0xe690('0x1f'));logger[_0xe690('0xd')](_0xe690('0x54'),_0x583a31['id']);logger['info'](_0xe690('0x4f'),_0xe690('0x49'));emit(util['format']('user:%s',_0x32ed06[_0xe690('0x16')]),_0xe690('0x4b'),{'uri':util[_0xe690('0x10')](_0xe690('0x55'),_0x450397[_0xe690('0x1c')],_0x583a31['id'])});}})['catch'](function(_0x1d9b5d){logger[_0xe690('0x4c')](_0xe690('0x4f'),JSON[_0xe690('0x30')](_0x1d9b5d));});};exports[_0xe690('0x56')]=function(_0x1aaf33,_0x31c8ca,_0x57d538,_0x1514ed,_0xb65c6b,_0xd304c){var _0x2fbf01,_0x3f4017;_0xd304c[_0xe690('0x1c')]=intUtil[_0xe690('0x3f')](_0xd304c['remoteUri']);_0xd304c['serverUrl']=intUtil[_0xe690('0x3f')](_0xd304c['serverUrl']);if(_0xb65c6b&&_0xb65c6b[_0xe690('0x41')]){logger['info'](_0xe690('0x57'),_0xe690('0x43'));_0x31c8ca[_0xe690('0x44')]=util[_0xe690('0x10')](_0xe690('0x45'),_0xd304c[_0xe690('0x40')],_0x31c8ca[_0xe690('0x46')],md5(_0x31c8ca[_0xe690('0x46')]));}else{_0x31c8ca[_0xe690('0x44')]='';}headers[_0xe690('0x47')]=getAuth(_0xd304c);return getUser(_0xd304c,'')[_0xe690('0x1e')](function(_0xea7079){_0x2fbf01=_0xea7079;logger['info'](_0xe690('0x48'),_0x2fbf01['id']);return getEndUser(_0xd304c,_0x31c8ca[_0xe690('0x11')],_0x31c8ca[_0xe690('0x12')]);})[_0xe690('0x1e')](function(_0x17a1d2){_0x3f4017=_0x17a1d2;logger[_0xe690('0xd')](_0xe690('0x53'),_0x3f4017['id']);return getTicket(_0xd304c,_0x2fbf01,_0x3f4017,_0x57d538,_0x31c8ca);})[_0xe690('0x1e')](function(_0x50008d){if(_0x50008d){logger[_0xe690('0xd')]('Ticket\x20created!');logger[_0xe690('0xd')]('The\x20Ticket\x20ID\x20is:',_0x50008d['id']);}})['catch'](function(_0x36ddc5){logger[_0xe690('0x4c')](_0xe690('0x57'),JSON[_0xe690('0x30')](_0x36ddc5));});}; \ No newline at end of file +var _0x1be4=['keyBy','value','%s/api/v2/tickets','remoteUri','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','apiKey','base64','[HTTP]','stringify','GET','map','forEach','type','string','nameField','content','toString','customField','push','idField','variableName','customVariable','Variable','toLowerCase','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','abandoned','[ABANDONED]','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues'];(function(_0x5341fb,_0x20e4ec){var _0x2d5a59=function(_0x4e7994){while(--_0x4e7994){_0x5341fb['push'](_0x5341fb['shift']());}};_0x2d5a59(++_0x20e4ec);}(_0x1be4,0x1af));var _0x41be=function(_0x2f2d88,_0x32815c){_0x2f2d88=_0x2f2d88-0x0;var _0x4742ee=_0x1be4[_0x2f2d88];return _0x4742ee;};'use strict';var _=require(_0x41be('0x0'));var rp=require(_0x41be('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x41be('0x2'));var intUtil=require(_0x41be('0x3'));var config=require(_0x41be('0x4'));var logger=require(_0x41be('0x5'))(_0x41be('0x6'));config[_0x41be('0x7')]=_[_0x41be('0x8')](config[_0x41be('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x41be('0x9'))(new Redis(config[_0x41be('0x7')]));var headers={'Content-Type':_0x41be('0xa'),'Accept':_0x41be('0xa')};function emit(_0x33d299,_0x319e5b,_0x5f38d9){io['to'](_0x33d299)['emit'](_0x319e5b,_0x5f38d9);}function getTicket(_0xdb1a1,_0x266920,_0x54f3e2,_0x209a7b,_0x43689b){logger['info'](_0x41be('0xb'));var _0x1384ac=_['merge']({'responder_id':_0x266920['id'],'requester_id':_0x54f3e2['id'],'name':util[_0x41be('0xc')](_0x41be('0xd'),_0x43689b[_0x41be('0xe')]),'phone':_0x43689b[_0x41be('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x41be('0x10')](_0x209a7b[_0x41be('0x11')],_0x43689b,'\x20'),'description':intUtil[_0x41be('0x10')](_0x209a7b[_0x41be('0x12')],_0x43689b,_0x41be('0x13')),'tags':getTags(_0x209a7b['Tags'],_0x41be('0x14'))},getCustomFields(_0x209a7b[_0x41be('0x15')],_0x43689b));_0x1384ac[_0x41be('0x16')]=_[_0x41be('0x17')](_[_0x41be('0x18')](_0x1384ac[_0x41be('0x16')],'id'),_0x41be('0x19'));return request({'uri':util[_0x41be('0xc')](_0x41be('0x1a'),_0xdb1a1[_0x41be('0x1b')]),'method':'POST','body':_0x1384ac})[_0x41be('0x1c')](function(_0x1d12aa){logger[_0x41be('0x1d')](_0x41be('0x1e'));return _0x1d12aa;});}function getUser(_0x3680d3,_0x5bb2ce){if(intUtil[_0x41be('0x1f')](_0x5bb2ce)){return request({'uri':util[_0x41be('0xc')](_0x41be('0x20'),_0x3680d3[_0x41be('0x1b')]),'qs':{'email':_0x5bb2ce}})[_0x41be('0x1c')](function(_0x5e2361){if(_0x5e2361['length']){logger[_0x41be('0x1d')](_0x41be('0x21'));return _[_0x41be('0x22')](_0x5e2361,function(_0x4c5cbc){return _0x4c5cbc[_0x41be('0x23')]['email']===_0x5bb2ce;});}else{logger[_0x41be('0x1d')](_0x41be('0x24'));return request({'uri':util[_0x41be('0xc')]('%s/api/v2/agents/me',_0x3680d3['remoteUri'])})[_0x41be('0x1c')](function(_0x3e17b7){logger[_0x41be('0x1d')](_0x41be('0x25'));return _0x3e17b7;});}});}else{logger[_0x41be('0x1d')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x41be('0xc')](_0x41be('0x26'),_0x3680d3[_0x41be('0x1b')])})['then'](function(_0x5d82fd){logger[_0x41be('0x1d')]('Admin\x20account\x20selected.');return _0x5d82fd;});}}function getEndUser(_0x19fa7a,_0x12bfa2,_0x5e3b50){logger[_0x41be('0x1d')](_0x41be('0x27'),_0x5e3b50);return request({'uri':util[_0x41be('0xc')](_0x41be('0x28'),_0x19fa7a[_0x41be('0x1b')]),'qs':{'phone':_0x5e3b50}})[_0x41be('0x1c')](function(_0x58346a){if(_0x58346a[_0x41be('0x29')]){logger['info'](_0x41be('0x2a'));return _[_0x41be('0x22')](_0x58346a,{'phone':_0x5e3b50});}else{logger['info'](_0x41be('0x2b'));return request({'uri':util[_0x41be('0xc')](_0x41be('0x28'),_0x19fa7a['remoteUri']),'method':_0x41be('0x2c'),'body':{'name':_0x12bfa2,'phone':_0x5e3b50}})['then'](function(_0x55a230){logger[_0x41be('0x1d')](_0x41be('0x2d'));return _0x55a230;});}});}function getAuth(_0x18e366){return util[_0x41be('0xc')]('Basic\x20%s',new Buffer(_0x18e366[_0x41be('0x2e')]+':X')['toString'](_0x41be('0x2f')));}function request(_0x55a2a0){logger['debug'](_0x41be('0x30'),JSON[_0x41be('0x31')](_0x55a2a0));return rp(_[_0x41be('0x8')](_0x55a2a0,{'method':_0x41be('0x32'),'headers':headers,'json':!![]}));}function getTags(_0xe7c390,_0x15253f){var _0xe04f49=[];if(_0xe7c390&&_0xe7c390[_0x41be('0x29')]>0x0){_0xe04f49=_[_0x41be('0x33')](_0xe7c390,_0x15253f);}return _0xe04f49;}function getCustomFields(_0xdfaf57,_0x430050){var _0x4f050f=[];var _0xf5c932={'custom_fields':[]};if(_0xdfaf57[_0x41be('0x29')]>0x0){_[_0x41be('0x34')](_0xdfaf57,function(_0x5ef5e3){if(_0x5ef5e3[_0x41be('0x35')]===_0x41be('0x36')&&_0x5ef5e3['nameField']&&!_0x5ef5e3['customField']){_0xf5c932[_0x5ef5e3[_0x41be('0x37')]['toLowerCase']()]=_0x5ef5e3[_0x41be('0x38')][_0x41be('0x39')]();}else if(_0x5ef5e3[_0x41be('0x35')]===_0x41be('0x36')&&_0x5ef5e3['idField']&&_0x5ef5e3[_0x41be('0x3a')]){_0xf5c932[_0x41be('0x16')][_0x41be('0x3b')]({'id':_0x5ef5e3[_0x41be('0x3c')],'value':_0x5ef5e3['content'][_0x41be('0x39')]()});}else if(_0x5ef5e3[_0x41be('0x35')]==='variable'&&_0x5ef5e3['variableName']&&_0x5ef5e3[_0x41be('0x3c')]&&_0x5ef5e3[_0x41be('0x3a')]){_0x430050[_0x5ef5e3[_0x41be('0x3d')]]&&_0xf5c932[_0x41be('0x16')][_0x41be('0x3b')]({'id':_0x5ef5e3[_0x41be('0x3c')],'value':_0x430050[_0x5ef5e3[_0x41be('0x3d')]][_0x41be('0x39')]()});}else if(_0x5ef5e3[_0x41be('0x35')]===_0x41be('0x3e')&&_0x5ef5e3['Variable']&&_0x5ef5e3[_0x41be('0x3f')][_0x41be('0x14')]&&_0x5ef5e3[_0x41be('0x3c')]&&_0x5ef5e3[_0x41be('0x3a')]){_0x430050[_0x5ef5e3[_0x41be('0x3f')][_0x41be('0x14')][_0x41be('0x40')]()]&&_0xf5c932[_0x41be('0x16')][_0x41be('0x3b')]({'id':_0x5ef5e3[_0x41be('0x3c')],'value':_0x430050[_0x5ef5e3[_0x41be('0x3f')][_0x41be('0x14')]['toLowerCase']()][_0x41be('0x39')]()});}});}return _0xf5c932;}exports['queue']=function(_0x3b6997,_0x206d07,_0x3fa763,_0x3637fe,_0x2005cc,_0x473515){var _0x340d5f,_0x337422;_0x473515['remoteUri']=intUtil['stripTrailingSlash'](_0x473515[_0x41be('0x1b')]);_0x473515[_0x41be('0x41')]=intUtil[_0x41be('0x42')](_0x473515[_0x41be('0x41')]);if(_0x2005cc&&_0x2005cc[_0x41be('0x43')]){logger['info'](_0x41be('0x44'),_0x41be('0x45'));_0x206d07[_0x41be('0x46')]=util[_0x41be('0xc')](_0x41be('0x47'),_0x473515[_0x41be('0x41')],_0x206d07[_0x41be('0x48')],md5(_0x206d07[_0x41be('0x48')]));}else{_0x206d07[_0x41be('0x46')]='';}headers[_0x41be('0x49')]=getAuth(_0x473515);return getUser(_0x473515,_0x3637fe[_0x41be('0x4a')])[_0x41be('0x1c')](function(_0xd1909e){_0x340d5f=_0xd1909e;logger['info'](_0x41be('0x4b'),_0x340d5f['id']);return getEndUser(_0x473515,_0x206d07[_0x41be('0xe')],_0x206d07[_0x41be('0xf')]);})[_0x41be('0x1c')](function(_0x2e01e9){_0x337422=_0x2e01e9;logger[_0x41be('0x1d')](_0x41be('0x4c'),_0x337422['id']);return getTicket(_0x473515,_0x340d5f,_0x337422,_0x3fa763,_0x206d07);})[_0x41be('0x1c')](function(_0x44b2bb){if(_0x44b2bb&&_0x44b2bb['id']){logger[_0x41be('0x1d')](_0x41be('0x1e'));logger['info'](_0x41be('0x4d'),_0x44b2bb['id']);logger[_0x41be('0x1d')]('[QUEUE]',_0x41be('0x4e'));emit(util[_0x41be('0xc')](_0x41be('0x4f'),_0x3637fe['name']),_0x41be('0x50'),{'uri':util['format'](_0x41be('0x51'),_0x473515[_0x41be('0x1b')],_0x44b2bb['id'])});}})[_0x41be('0x52')](function(_0x1ddc8d){logger[_0x41be('0x53')](_0x41be('0x44'),JSON[_0x41be('0x31')](_0x1ddc8d));});};exports['outbound']=function(_0x2bbbb7,_0x54de3a,_0x33cccd,_0x1acc5d,_0x58243d,_0xf23e88,_0x180f17){var _0xdfc1cf,_0x26e835;_0xf23e88[_0x41be('0x1b')]=intUtil[_0x41be('0x42')](_0xf23e88[_0x41be('0x1b')]);_0xf23e88[_0x41be('0x41')]=intUtil[_0x41be('0x42')](_0xf23e88[_0x41be('0x41')]);if(_0x180f17&&_0x180f17[_0x41be('0x54')]&&_0x180f17['recordingFormat']!==_0x41be('0x55')){logger[_0x41be('0x1d')](_0x41be('0x56'),'Recording\x20is\x20enabled!');_0x54de3a[_0x41be('0x46')]=util[_0x41be('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf23e88[_0x41be('0x41')],_0x54de3a['uniqueid'],md5(_0x54de3a[_0x41be('0x48')]));}headers[_0x41be('0x49')]=getAuth(_0xf23e88);return getUser(_0xf23e88,_0x1acc5d[_0x41be('0x4a')])[_0x41be('0x1c')](function(_0x15ad01){_0xdfc1cf=_0x15ad01;logger['info'](_0x41be('0x4b'),_0xdfc1cf['id']);return getEndUser(_0xf23e88,_0x54de3a[_0x41be('0x57')],_0x54de3a[_0x41be('0x58')]);})[_0x41be('0x1c')](function(_0x4a66f5){_0x26e835=_0x4a66f5;logger[_0x41be('0x1d')](_0x41be('0x4c'),_0x26e835['id']);return getTicket(_0xf23e88,_0xdfc1cf,_0x26e835,_0x33cccd,_0x54de3a);})[_0x41be('0x1c')](function(_0x329460){if(_0x329460&&_0x329460['id']){logger[_0x41be('0x1d')](_0x41be('0x1e'));logger[_0x41be('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x329460['id']);logger[_0x41be('0x1d')](_0x41be('0x56'),_0x41be('0x4e'));emit(util[_0x41be('0xc')](_0x41be('0x4f'),_0x1acc5d[_0x41be('0x14')]),_0x41be('0x50'),{'uri':util[_0x41be('0xc')](_0x41be('0x51'),_0xf23e88['remoteUri'],_0x329460['id'])});}})[_0x41be('0x52')](function(_0x3fb9ae){logger[_0x41be('0x53')](_0x41be('0x56'),JSON['stringify'](_0x3fb9ae));});};exports[_0x41be('0x59')]=function(_0x3d3419,_0x3bfa4d,_0x5bd6cc,_0x2def9e,_0x4fc884,_0x1841ee){var _0x13c019,_0x1c0ee9;_0x1841ee[_0x41be('0x1b')]=intUtil[_0x41be('0x42')](_0x1841ee[_0x41be('0x1b')]);_0x1841ee[_0x41be('0x41')]=intUtil[_0x41be('0x42')](_0x1841ee['serverUrl']);if(_0x4fc884&&_0x4fc884['monitor_format']){logger[_0x41be('0x1d')](_0x41be('0x5a'),_0x41be('0x45'));_0x3bfa4d[_0x41be('0x46')]=util[_0x41be('0xc')](_0x41be('0x47'),_0x1841ee[_0x41be('0x41')],_0x3bfa4d['uniqueid'],md5(_0x3bfa4d[_0x41be('0x48')]));}else{_0x3bfa4d[_0x41be('0x46')]='';}headers[_0x41be('0x49')]=getAuth(_0x1841ee);return getUser(_0x1841ee,'')['then'](function(_0x6effd5){_0x13c019=_0x6effd5;logger['info'](_0x41be('0x4b'),_0x13c019['id']);return getEndUser(_0x1841ee,_0x3bfa4d[_0x41be('0xe')],_0x3bfa4d[_0x41be('0xf')]);})['then'](function(_0x3aea10){_0x1c0ee9=_0x3aea10;logger[_0x41be('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x1c0ee9['id']);return getTicket(_0x1841ee,_0x13c019,_0x1c0ee9,_0x5bd6cc,_0x3bfa4d);})[_0x41be('0x1c')](function(_0x44d2fb){if(_0x44d2fb){logger[_0x41be('0x1d')](_0x41be('0x1e'));logger[_0x41be('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x44d2fb['id']);}})[_0x41be('0x52')](function(_0x112b8d){logger['error'](_0x41be('0x5a'),JSON[_0x41be('0x31')](_0x112b8d));});}; \ 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 59963b0..9dd3c04 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 _0x519a=['dynamics365','exec','data1','toLowerCase','data2','find','queue','log','EVENT\x20UNKNOWN','abandoned','freshdesk','zoho','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','salesforce','sugarcrm','desk','vtiger'];(function(_0x51fe86,_0x422b66){var _0x3557d4=function(_0x524a6a){while(--_0x524a6a){_0x51fe86['push'](_0x51fe86['shift']());}};_0x3557d4(++_0x422b66);}(_0x519a,0x73));var _0xa519=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x519a[_0x3a3c17];return _0xd07f21;};'use strict';var _=require(_0xa519('0x0'));var util=require(_0xa519('0x1'));var zendesk=require(_0xa519('0x2'));var salesforce=require(_0xa519('0x3'));var sugarcrm=require(_0xa519('0x4'));var freshdesk=require(_0xa519('0x5'));var zoho=require(_0xa519('0x6'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0xa519('0x7'));var dynamics365=require(_0xa519('0x8'));var integrations=['zendesk',_0xa519('0x9'),_0xa519('0xa'),'freshdesk','zoho',_0xa519('0xb'),_0xa519('0xc'),'servicenow',_0xa519('0xd')];exports[_0xa519('0xe')]=function(_0x317cdc,_0x39903d,_0x3f44fb,_0x365b7b,_0x44bce6,_0x1c4ce3){if(_0x3f44fb){if(_['includes'](integrations,_0x317cdc[_0xa519('0xf')][_0xa519('0x10')]())){try{var _0x5afdcf=null;var _0x266340='';var _0xe7f16b=_0x3f44fb[_0x317cdc[_0xa519('0xf')]['toLowerCase']()];if(_0xe7f16b){var _0x3ab836=_0xe7f16b[_0x317cdc[_0xa519('0x11')]];if(_0x3ab836){var _0x302884=_[_0xa519('0x12')](_0x3ab836['Configurations'],{'id':parseInt(_0x317cdc['data3'],0xa)});if(_0x302884){if(_0x365b7b){if(_0x44bce6&&_0x39903d['queue']){_0x266340=_0xa519('0x13');}else if(_0x39903d['routeId']){_0x266340='outbound';}else{console[_0xa519('0x14')](_0xa519('0x15'),_0x39903d);}}else{_0x266340=_0xa519('0x16');}switch(_0x317cdc[_0xa519('0xf')]['toLowerCase']()){case'zendesk':zendesk[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0x9'):salesforce[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0xa'):sugarcrm[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0x17'):freshdesk[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0x18'):zoho[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0xb'):desk[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case _0xa519('0xc'):vtiger[_0x266340](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3);break;case'servicenow':servicenow['cs'](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3,_0x266340);break;case _0xa519('0xd'):dynamics365['cs'](_0x317cdc,_0x39903d,_0x302884,_0x365b7b,_0x44bce6,_0x3ab836,_0x1c4ce3,_0x266340);break;default:console['log'](_0xa519('0x19'));}}else{_0x5afdcf=require(_0xa519('0x1a'))(_0x317cdc[_0xa519('0xf')]['toLowerCase']());_0x5afdcf['error'](_0xa519('0x1b'),util[_0xa519('0x1c')](_0xa519('0x1d'),_0x317cdc['data1']['toLowerCase'](),_0x317cdc[_0xa519('0x1e')]));}}else{_0x5afdcf=require('../../../../config/logger')(_0x317cdc[_0xa519('0xf')]['toLowerCase']());_0x5afdcf['error'](_0xa519('0x1b'),util[_0xa519('0x1c')]('%s\x20account\x20#%s\x20not\x20found',_0x317cdc[_0xa519('0xf')][_0xa519('0x10')](),_0x317cdc[_0xa519('0x11')]));}}else{}}catch(_0x1d2875){console[_0xa519('0x1f')](_0x1d2875);}}}}; \ No newline at end of file +var _0x3aea=['freshdesk','zoho','servicenow','dynamics365','exec','includes','data1','toLowerCase','Configurations','data3','queue','log','EVENT\x20UNKNOWN','abandoned','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','zendesk','salesforce'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x3aea,0x79));var _0xa3ae=function(_0x234a2e,_0x383bd9){_0x234a2e=_0x234a2e-0x0;var _0x28cd45=_0x3aea[_0x234a2e];return _0x28cd45;};'use strict';var _=require(_0xa3ae('0x0'));var util=require(_0xa3ae('0x1'));var zendesk=require(_0xa3ae('0x2'));var salesforce=require(_0xa3ae('0x3'));var sugarcrm=require(_0xa3ae('0x4'));var freshdesk=require(_0xa3ae('0x5'));var zoho=require(_0xa3ae('0x6'));var desk=require(_0xa3ae('0x7'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xa3ae('0x8'));var integrations=[_0xa3ae('0x9'),_0xa3ae('0xa'),'sugarcrm',_0xa3ae('0xb'),_0xa3ae('0xc'),'desk','vtiger',_0xa3ae('0xd'),_0xa3ae('0xe')];exports[_0xa3ae('0xf')]=function(_0x3375dc,_0x1ddec4,_0x3fd6b4,_0x3936a7,_0x191fda,_0x274369){if(_0x3fd6b4){if(_[_0xa3ae('0x10')](integrations,_0x3375dc[_0xa3ae('0x11')][_0xa3ae('0x12')]())){try{var _0x1cbd11=null;var _0x384094='';var _0x329cfc=_0x3fd6b4[_0x3375dc['data1']['toLowerCase']()];if(_0x329cfc){var _0x5c17a4=_0x329cfc[_0x3375dc['data2']];if(_0x5c17a4){var _0xb9c7a4=_['find'](_0x5c17a4[_0xa3ae('0x13')],{'id':parseInt(_0x3375dc[_0xa3ae('0x14')],0xa)});if(_0xb9c7a4){if(_0x3936a7){if(_0x191fda&&_0x1ddec4[_0xa3ae('0x15')]){_0x384094=_0xa3ae('0x15');}else if(_0x1ddec4['routeId']){_0x384094='outbound';}else{console[_0xa3ae('0x16')](_0xa3ae('0x17'),_0x1ddec4);}}else{_0x384094=_0xa3ae('0x18');}switch(_0x3375dc['data1'][_0xa3ae('0x12')]()){case _0xa3ae('0x9'):zendesk[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case _0xa3ae('0xa'):salesforce[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case'sugarcrm':sugarcrm[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case _0xa3ae('0xb'):freshdesk[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case _0xa3ae('0xc'):zoho[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case _0xa3ae('0x19'):desk[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case'vtiger':vtiger[_0x384094](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369);break;case'servicenow':servicenow['cs'](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369,_0x384094);break;case _0xa3ae('0xe'):dynamics365['cs'](_0x3375dc,_0x1ddec4,_0xb9c7a4,_0x3936a7,_0x191fda,_0x5c17a4,_0x274369,_0x384094);break;default:console[_0xa3ae('0x16')](_0xa3ae('0x1a'));}}else{_0x1cbd11=require(_0xa3ae('0x1b'))(_0x3375dc[_0xa3ae('0x11')][_0xa3ae('0x12')]());_0x1cbd11[_0xa3ae('0x1c')](_0xa3ae('0x1d'),util[_0xa3ae('0x1e')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3375dc[_0xa3ae('0x11')][_0xa3ae('0x12')](),_0x3375dc[_0xa3ae('0x14')]));}}else{_0x1cbd11=require(_0xa3ae('0x1b'))(_0x3375dc[_0xa3ae('0x11')][_0xa3ae('0x12')]());_0x1cbd11['error']('[EXEC]',util[_0xa3ae('0x1e')](_0xa3ae('0x1f'),_0x3375dc['data1'][_0xa3ae('0x12')](),_0x3375dc[_0xa3ae('0x20')]));}}else{}}catch(_0x536bcc){console['error'](_0x536bcc);}}}}; \ 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 66f9900..67a55d6 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 _0xe706=['variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','format','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Subjects','Case','ContactId','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','info','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','sobject','Contact','contact','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','upperFirst','type','string','idField','content'];(function(_0x1e3e59,_0x596d22){var _0x4cdd16=function(_0xec196f){while(--_0xec196f){_0x1e3e59['push'](_0x1e3e59['shift']());}};_0x4cdd16(++_0x596d22);}(_0xe706,0xa3));var _0x6e70=function(_0x56321f,_0x1c41eb){_0x56321f=_0x56321f-0x0;var _0x5aa129=_0xe706[_0x56321f];return _0x5aa129;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var md5=require(_0x6e70('0x3'));var jsforce=require(_0x6e70('0x4'));var util=require(_0x6e70('0x5'));var Redis=require(_0x6e70('0x6'));var intUtil=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var logger=require(_0x6e70('0x9'))(_0x6e70('0xa'));config[_0x6e70('0xb')]=_[_0x6e70('0xc')](config[_0x6e70('0xb')],{'host':_0x6e70('0xd'),'port':0x18eb});var io=require(_0x6e70('0xe'))(new Redis(config[_0x6e70('0xb')]));function emit(_0x3c4843,_0x449b48,_0x954545){io['to'](_0x3c4843)[_0x6e70('0xf')](_0x449b48,_0x954545);}function getTicket(_0x100eb7,_0x463853,_0x743eb5,_0x3f474a,_0x37b3e0,_0x4600f9,_0x5b3d07,_0x47f6b2){var _0x3594c1={};if(_0x3f474a[_0x6e70('0x10')]===_0x6e70('0x11')){_0x3594c1=Object[_0x6e70('0x12')]({},{'OwnerId':_0x463853['id'],'ActivityDate':moment[_0x6e70('0x13')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6e70('0x14')](_0x3f474a[_0x6e70('0x15')],_0x37b3e0,'\x20'),'Description':intUtil[_0x6e70('0x14')](_0x3f474a['Descriptions'],_0x37b3e0,'\x0a')},getCustomFields(_0x4600f9,_0x37b3e0));if(_0x743eb5){_0x3594c1['WhoId']=_0x743eb5['id'];}}else if(_0x3f474a['ticketType']===_0x6e70('0x16')){_0x3594c1=Object['assign']({},{'OwnerId':_0x463853['id'],'Subject':intUtil['getString'](_0x3f474a[_0x6e70('0x15')],_0x37b3e0,'\x20'),'Description':intUtil[_0x6e70('0x14')](_0x3f474a['Descriptions'],_0x37b3e0,'\x0a')},getCustomFields(_0x4600f9,_0x37b3e0));if(_0x743eb5){_0x3594c1[_0x6e70('0x17')]=_0x743eb5['id'];}}return _0x5b3d07['sobject'](_0x3f474a[_0x6e70('0x10')])[_0x6e70('0x18')](_0x3594c1);}function getUser(_0x4ca554,_0x49029f,_0x3bd572){if(!_['isNil'](_0x49029f)&&intUtil[_0x6e70('0x19')](_0x49029f)){var _0x173afe={'Email':_0x49029f};var _0x53acdc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3bd572['sobject'](_0x6e70('0x1a'))[_0x6e70('0x1b')](_0x173afe,_0x53acdc)[_0x6e70('0x1c')]()[_0x6e70('0x1d')](function(_0x3af484){if(_0x3af484[_0x6e70('0x1e')]){var _0x1b2453=_[_0x6e70('0x1b')](_0x3af484,function(_0x29326f){return _0x29326f[_0x6e70('0x1f')]===_0x49029f;});if(_0x1b2453){logger['info'](_0x6e70('0x20'),_0x49029f);return BPromise[_0x6e70('0x21')]({'id':_0x1b2453['Id'],'name':_0x1b2453[_0x6e70('0x22')]});}}else{logger['info'](_0x6e70('0x23'),_0x49029f);return _0x3bd572[_0x6e70('0x24')]()[_0x6e70('0x1d')](function(_0x50da2c){return BPromise[_0x6e70('0x21')]({'id':_0x50da2c['user_id'],'name':_0x50da2c['display_name']});});}});}else{logger['info'](_0x6e70('0x23'),_0x49029f);return _0x3bd572[_0x6e70('0x24')]()['then'](function(_0x3ecdf1){return BPromise[_0x6e70('0x21')]({'id':_0x3ecdf1['user_id'],'name':_0x3ecdf1[_0x6e70('0x25')]});});}}function getEndUser(_0x67fb43,_0x2bb231,_0x4a67ac,_0x54a5fe,_0x2c4d37){var _0x3af17f={'Phone':_0x54a5fe};var _0x83c836={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6e70('0x21')]()[_0x6e70('0x1d')](function(){if(_0x2bb231['ticketType']===_0x6e70('0x11')){logger[_0x6e70('0x26')](_0x6e70('0x27'),_0x54a5fe,_0x2bb231[_0x6e70('0x28')]);switch(_0x2bb231[_0x6e70('0x28')]){case _0x6e70('0x29'):return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2b'))[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]()['then'](function(_0x1b27d8){if(_0x1b27d8&&_0x1b27d8['length']){return _0x1b27d8;}else{return _0x2c4d37[_0x6e70('0x2a')]('Lead')[_0x6e70('0x1b')](_0x3af17f,_0x83c836);}});case _0x6e70('0x2c'):return _0x2c4d37[_0x6e70('0x2a')]('Contact')[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]();case'lead':return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2d'))['find'](_0x3af17f,_0x83c836);default:return null;}}else if(_0x2bb231[_0x6e70('0x10')]===_0x6e70('0x16')){logger[_0x6e70('0x26')](_0x6e70('0x27'),_0x54a5fe,_0x6e70('0x2c'));return _0x2c4d37[_0x6e70('0x2a')](_0x6e70('0x2b'))[_0x6e70('0x1b')](_0x3af17f,_0x83c836)[_0x6e70('0x1c')]();}})[_0x6e70('0x1d')](function(_0x4d32d8){if(_0x4d32d8&&_0x4d32d8[_0x6e70('0x1e')]){var _0x4795a0=_[_0x6e70('0x1b')](_0x4d32d8,function(_0x3222a2){return _0x3222a2[_0x6e70('0x2e')]===_0x54a5fe;});if(_0x4795a0){return BPromise[_0x6e70('0x21')]({'id':_0x4795a0['Id'],'name':_0x4795a0[_0x6e70('0x22')],'phone':_0x4795a0[_0x6e70('0x2e')]});}}})[_0x6e70('0x1d')](function(_0xdd0bee){if(_0xdd0bee){logger[_0x6e70('0x26')](_0x6e70('0x2f'),_0x54a5fe);return BPromise[_0x6e70('0x21')](_0xdd0bee);}else{logger[_0x6e70('0x26')](_0x6e70('0x30'),_0x54a5fe);var _0x501b53={'LastName':_0x4a67ac!==''?_0x4a67ac:util['format'](_0x6e70('0x31'),_0x54a5fe),'Phone':_0x54a5fe};if(_0x2bb231[_0x6e70('0x32')]){if(_0x2bb231[_0x6e70('0x32')]===_0x6e70('0x2c')){logger[_0x6e70('0x26')](_0x6e70('0x33'),_0x54a5fe,_0x2bb231['moduleCreate']);}else if(_0x2bb231[_0x6e70('0x32')]===_0x6e70('0x34')&&_0x2bb231[_0x6e70('0x10')]===_0x6e70('0x11')){logger[_0x6e70('0x26')](_0x6e70('0x33'),_0x54a5fe,_0x2bb231[_0x6e70('0x32')]);_0x501b53[_0x6e70('0x35')]='No\x20Company';}else{return null;}}return _0x2c4d37[_0x6e70('0x2a')](_[_0x6e70('0x36')](_0x2bb231[_0x6e70('0x32')]))[_0x6e70('0x18')](_0x501b53);}});}function getCustomFields(_0x201da9,_0x1de947){var _0x21b0e7={};if(_0x201da9['length']>0x0){_['forEach'](_0x201da9,function(_0x5ae898){if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x38')&&_0x5ae898[_0x6e70('0x39')]){_0x21b0e7[_0x5ae898[_0x6e70('0x39')]]=_0x5ae898[_0x6e70('0x3a')]['toString']();}else if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x3b')&&_0x5ae898[_0x6e70('0x3c')]&&_0x5ae898['idField']){_0x1de947[_0x5ae898['variableName']]&&(_0x21b0e7[_0x5ae898['idField']]=_0x1de947[_0x5ae898[_0x6e70('0x3c')]]['toString']());}else if(_0x5ae898[_0x6e70('0x37')]===_0x6e70('0x3d')&&_0x5ae898[_0x6e70('0x3e')]&&_0x5ae898[_0x6e70('0x3e')]['name']&&_0x5ae898[_0x6e70('0x39')]){_0x1de947[_0x5ae898['Variable'][_0x6e70('0x3f')][_0x6e70('0x40')]()]&&(_0x21b0e7[_0x5ae898[_0x6e70('0x39')]]=_0x1de947[_0x5ae898[_0x6e70('0x3e')]['name'][_0x6e70('0x40')]()][_0x6e70('0x41')]());}});}return _0x21b0e7;}function getConnection(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x42')][_0x6e70('0x43')](_0x3d39c3[_0x6e70('0x44')]);var _0x552e7e=new jsforce[(_0x6e70('0x45'))]({'oauth2':{'loginUrl':_0x3d39c3[_0x6e70('0x46')]||_0x6e70('0x47'),'clientId':_0x3d39c3[_0x6e70('0x48')],'clientSecret':_0x3d39c3[_0x6e70('0x49')]}});return _0x552e7e[_0x6e70('0x4a')](_0x3d39c3[_0x6e70('0x4b')],_0xac87d6)['then'](function(){logger[_0x6e70('0x26')]('Connection\x20established.');return _0x552e7e;});}exports[_0x6e70('0x4c')]=function(_0x3836e4,_0x4b351e,_0x53efc3,_0x333abd,_0x25a208,_0x18fa40){var _0x587f04,_0x4af9b1,_0x238ebb,_0x11ac3d;_0x18fa40[_0x6e70('0x4d')]=intUtil[_0x6e70('0x4e')](_0x18fa40[_0x6e70('0x4d')]);_0x18fa40[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0x18fa40[_0x6e70('0x46')]);if(_0x25a208&&_0x25a208[_0x6e70('0x4f')]){logger[_0x6e70('0x26')](_0x6e70('0x50'),_0x6e70('0x51'));_0x4b351e['recordingURL']=util['format'](_0x6e70('0x52'),_0x18fa40[_0x6e70('0x4d')],_0x4b351e[_0x6e70('0x53')],md5(_0x4b351e[_0x6e70('0x53')]));}else{_0x4b351e[_0x6e70('0x54')]='';}return getConnection(_0x18fa40)['then'](function(_0x41bd0b){_0x11ac3d=_0x41bd0b;return getUser(_0x18fa40,_0x333abd[_0x6e70('0x55')],_0x11ac3d);})[_0x6e70('0x1d')](function(_0x23ebfb){_0x587f04=_0x23ebfb;return getEndUser(_0x18fa40,_0x53efc3,_0x4b351e[_0x6e70('0x56')],_0x4b351e['calleridnum'],_0x11ac3d);})[_0x6e70('0x1d')](function(_0x1dd242){_0x4af9b1=_0x1dd242;return getTicket(_0x18fa40,_0x587f04,_0x4af9b1,_0x53efc3,_0x4b351e,_0x53efc3[_0x6e70('0x57')],_0x11ac3d,_0x6e70('0x4c'));})[_0x6e70('0x1d')](function(_0x3fd03d){_0x238ebb=_0x3fd03d;logger['info'](_0x6e70('0x58'),_0x238ebb['id']);logger[_0x6e70('0x26')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x238ebb['id'],_0x333abd[_0x6e70('0x3f')],_0x18fa40[_0x6e70('0x37')]);switch(_0x18fa40['type']){case _0x6e70('0x59'):emit(util[_0x6e70('0x5a')](_0x6e70('0x5b'),_0x333abd[_0x6e70('0x3f')]),_0x6e70('0x5c'),{'recordId':_0x238ebb['id']});break;case'newTab':emit(util[_0x6e70('0x5a')](_0x6e70('0x5b'),_0x333abd[_0x6e70('0x3f')]),_0x6e70('0x5d'),{'uri':util[_0x6e70('0x5a')](_0x6e70('0x5e'),_0x11ac3d[_0x6e70('0x5f')],_0x238ebb['id'])});break;default:logger[_0x6e70('0x60')](_0x6e70('0x61'));}})[_0x6e70('0x62')](function(_0x13dd17){logger[_0x6e70('0x60')](_0x6e70('0x50'),JSON[_0x6e70('0x63')](_0x13dd17));});};exports[_0x6e70('0x64')]=function(_0x2240a1,_0x324fa6,_0x4329a6,_0x2a8627,_0x1c7dca,_0x4c6aab,_0x28898a){var _0x4434dd,_0x180a13,_0xeeab6e,_0x36757e;_0x4c6aab[_0x6e70('0x4d')]=intUtil['stripTrailingSlash'](_0x4c6aab[_0x6e70('0x4d')]);_0x4c6aab[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0x4c6aab[_0x6e70('0x46')]);if(_0x28898a&&_0x28898a[_0x6e70('0x65')]&&_0x28898a[_0x6e70('0x65')]!=='none'){logger['info'](_0x6e70('0x66'),_0x6e70('0x51'));_0x324fa6[_0x6e70('0x54')]=util[_0x6e70('0x5a')](_0x6e70('0x52'),_0x4c6aab[_0x6e70('0x4d')],_0x324fa6[_0x6e70('0x53')],md5(_0x324fa6['uniqueid']));}return getConnection(_0x4c6aab)['then'](function(_0x2c8dc6){_0x36757e=_0x2c8dc6;return getUser(_0x4c6aab,_0x2a8627[_0x6e70('0x55')],_0x36757e);})[_0x6e70('0x1d')](function(_0x2ad395){_0x4434dd=_0x2ad395;return getEndUser(_0x4c6aab,_0x4329a6,_0x324fa6['destcalleridname'],_0x324fa6['destcalleridnum'],_0x36757e);})[_0x6e70('0x1d')](function(_0x4e5545){_0x180a13=_0x4e5545;return getTicket(_0x4c6aab,_0x4434dd,_0x180a13,_0x4329a6,_0x324fa6,_0x4329a6['Fields'],_0x36757e,'outbound');})[_0x6e70('0x1d')](function(_0x47fbed){_0xeeab6e=_0x47fbed;logger[_0x6e70('0x26')](_0x6e70('0x67'),_0xeeab6e['id']);logger[_0x6e70('0x26')](_0x6e70('0x68'),_0xeeab6e['id'],_0x2a8627[_0x6e70('0x3f')],_0x4c6aab[_0x6e70('0x37')]);switch(_0x4c6aab[_0x6e70('0x37')]){case _0x6e70('0x59'):emit(util['format'](_0x6e70('0x5b'),_0x2a8627[_0x6e70('0x3f')]),_0x6e70('0x5c'),{'recordId':_0xeeab6e['id']});break;case _0x6e70('0x69'):emit(util[_0x6e70('0x5a')]('user:%s',_0x2a8627['name']),'trigger:browser:url',{'uri':util[_0x6e70('0x5a')](_0x6e70('0x5e'),_0x36757e[_0x6e70('0x5f')],_0xeeab6e['id'])});break;default:logger['error']('[OUTBOUND]',_0x6e70('0x6a'));}})[_0x6e70('0x62')](function(_0x3c2830){logger[_0x6e70('0x60')](_0x6e70('0x66'),JSON[_0x6e70('0x63')](_0x3c2830));});};exports['abandoned']=function(_0x2d2855,_0x3f5896,_0x30d11b,_0x82a9a,_0x515c0c,_0xce964b){var _0x531097,_0x5b4046,_0x30487b,_0x3249a5;_0xce964b[_0x6e70('0x4d')]=intUtil[_0x6e70('0x4e')](_0xce964b[_0x6e70('0x4d')]);_0xce964b[_0x6e70('0x46')]=intUtil['stripTrailingSlash'](_0xce964b[_0x6e70('0x46')]);if(_0x515c0c&&_0x515c0c[_0x6e70('0x4f')]){logger[_0x6e70('0x26')](_0x6e70('0x6b'),_0x6e70('0x51'));_0x3f5896[_0x6e70('0x54')]=util[_0x6e70('0x5a')](_0x6e70('0x52'),_0xce964b[_0x6e70('0x4d')],_0x3f5896[_0x6e70('0x53')],md5(_0x3f5896['uniqueid']));}else{_0x3f5896[_0x6e70('0x54')]='';}return getConnection(_0xce964b)[_0x6e70('0x1d')](function(_0x577c3b){_0x3249a5=_0x577c3b;if(!_['isNil'](_0x82a9a)){return getUser(_0xce964b,_0x82a9a['name'],_0x3249a5);}else{return getUser(_0xce964b,null,_0x3249a5);}})[_0x6e70('0x1d')](function(_0x18ecf0){_0x531097=_0x18ecf0;return getEndUser(_0xce964b,_0x30d11b,_0x3f5896[_0x6e70('0x56')],_0x3f5896[_0x6e70('0x6c')],_0x3249a5);})[_0x6e70('0x1d')](function(_0x4ec29a){_0x5b4046=_0x4ec29a;return getTicket(_0xce964b,_0x531097,_0x5b4046,_0x30d11b,_0x3f5896,_0x30d11b['Fields'],_0x3249a5);})[_0x6e70('0x1d')](function(_0x241a21){_0x30487b=_0x241a21;logger['info'](_0x6e70('0x6d'),_0x30487b['id']);logger[_0x6e70('0x26')](_0x6e70('0x6e'),_0xce964b[_0x6e70('0x37')]);})[_0x6e70('0x62')](function(_0x44bf96){logger[_0x6e70('0x60')](_0x6e70('0x6b'),JSON[_0x6e70('0x63')](_0x44bf96));});}; \ No newline at end of file +var _0x70e0=['Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','create','length','type','string','idField','content','toString','variable','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','stringify','outbound','recordingFormat','none','%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.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/logger','redis','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Descriptions','ContactId','sobject','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','lead','Contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x70e0,0x17b));var _0x070e=function(_0x121051,_0x16ffab){_0x121051=_0x121051-0x0;var _0x4caf73=_0x70e0[_0x121051];return _0x4caf73;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x070e('0x3'));var util=require(_0x070e('0x4'));var Redis=require(_0x070e('0x5'));var intUtil=require(_0x070e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x070e('0x7'))('salesforce');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));function emit(_0x604664,_0x2611e6,_0x111743){io['to'](_0x604664)[_0x070e('0xa')](_0x2611e6,_0x111743);}function getTicket(_0x11ffa8,_0x4e99e6,_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37,_0xb8d819,_0xa927a2){var _0xffcdd6={};if(_0x50f4eb[_0x070e('0xb')]===_0x070e('0xc')){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'ActivityDate':moment[_0x070e('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6['WhoId']=_0x49b2fb['id'];}}else if(_0x50f4eb['ticketType']==='Case'){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6[_0x070e('0x11')]=_0x49b2fb['id'];}}return _0xb8d819[_0x070e('0x12')](_0x50f4eb[_0x070e('0xb')])['create'](_0xffcdd6);}function getUser(_0x49861b,_0x17e2e4,_0x2bd937){if(!_[_0x070e('0x13')](_0x17e2e4)&&intUtil[_0x070e('0x14')](_0x17e2e4)){var _0x364b3f={'Email':_0x17e2e4};var _0x5037eb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2bd937[_0x070e('0x12')](_0x070e('0x15'))[_0x070e('0x16')](_0x364b3f,_0x5037eb)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0x5c16fd){if(_0x5c16fd['length']){var _0x4e958f=_[_0x070e('0x16')](_0x5c16fd,function(_0x3004f0){return _0x3004f0[_0x070e('0x19')]===_0x17e2e4;});if(_0x4e958f){logger['info'](_0x070e('0x1a'),_0x17e2e4);return BPromise['resolve']({'id':_0x4e958f['Id'],'name':_0x4e958f[_0x070e('0x1b')]});}}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()[_0x070e('0x18')](function(_0xa86797){return BPromise[_0x070e('0x1f')]({'id':_0xa86797[_0x070e('0x20')],'name':_0xa86797['display_name']});});}});}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()['then'](function(_0xf17c56){return BPromise['resolve']({'id':_0xf17c56['user_id'],'name':_0xf17c56[_0x070e('0x21')]});});}}function getEndUser(_0x25f6e,_0x41deb1,_0x1743cc,_0x4763c6,_0x497f58){var _0x374c54={'Phone':_0x4763c6};var _0x219e48={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x070e('0x1f')]()[_0x070e('0x18')](function(){if(_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,_0x41deb1['moduleSearch']);switch(_0x41deb1[_0x070e('0x23')]){case _0x070e('0x24'):return _0x497f58[_0x070e('0x12')]('Contact')['find'](_0x374c54,_0x219e48)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0xa6c0ab){if(_0xa6c0ab&&_0xa6c0ab['length']){return _0xa6c0ab;}else{return _0x497f58[_0x070e('0x12')](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);}});case _0x070e('0x26'):return _0x497f58['sobject']('Contact')['find'](_0x374c54,_0x219e48)['execute']();case _0x070e('0x27'):return _0x497f58['sobject'](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);default:return null;}}else if(_0x41deb1['ticketType']==='Case'){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,'contact');return _0x497f58['sobject'](_0x070e('0x28'))[_0x070e('0x16')](_0x374c54,_0x219e48)[_0x070e('0x17')]();}})[_0x070e('0x18')](function(_0x18f0ad){if(_0x18f0ad&&_0x18f0ad['length']){var _0x482cc2=_[_0x070e('0x16')](_0x18f0ad,function(_0x3011c4){return _0x3011c4[_0x070e('0x29')]===_0x4763c6;});if(_0x482cc2){return BPromise[_0x070e('0x1f')]({'id':_0x482cc2['Id'],'name':_0x482cc2[_0x070e('0x1b')],'phone':_0x482cc2['Phone']});}}})[_0x070e('0x18')](function(_0x1927f4){if(_0x1927f4){logger['info'](_0x070e('0x2a'),_0x4763c6);return BPromise[_0x070e('0x1f')](_0x1927f4);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x4763c6);var _0x5ddbe9={'LastName':_0x1743cc!==_0x070e('0x2b')?_0x1743cc:util[_0x070e('0x2c')](_0x070e('0x2d'),_0x4763c6),'Phone':_0x4763c6};if(_0x41deb1[_0x070e('0x2e')]){if(_0x41deb1[_0x070e('0x2e')]==='contact'){logger[_0x070e('0x1c')](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);}else if(_0x41deb1['moduleCreate']===_0x070e('0x27')&&_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger['info'](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);_0x5ddbe9['Company']=_0x070e('0x30');}else{return null;}}return _0x497f58['sobject'](_[_0x070e('0x31')](_0x41deb1[_0x070e('0x2e')]))[_0x070e('0x32')](_0x5ddbe9);}});}function getCustomFields(_0x30319c,_0xd03404){var _0x47b929={};if(_0x30319c[_0x070e('0x33')]>0x0){_['forEach'](_0x30319c,function(_0x5bd39a){if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x35')&&_0x5bd39a[_0x070e('0x36')]){_0x47b929[_0x5bd39a['idField']]=_0x5bd39a[_0x070e('0x37')][_0x070e('0x38')]();}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x39')&&_0x5bd39a['variableName']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['variableName']]&&(_0x47b929[_0x5bd39a['idField']]=_0xd03404[_0x5bd39a['variableName']][_0x070e('0x38')]());}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x3a')&&_0x5bd39a[_0x070e('0x3b')]&&_0x5bd39a[_0x070e('0x3b')]['name']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['Variable'][_0x070e('0x3c')][_0x070e('0x3d')]()]&&(_0x47b929[_0x5bd39a[_0x070e('0x36')]]=_0xd03404[_0x5bd39a['Variable']['name'][_0x070e('0x3d')]()]['toString']());}});}return _0x47b929;}function getConnection(_0x35349f){var _0x3fdb75=_0x35349f[_0x070e('0x3e')]['concat'](_0x35349f[_0x070e('0x3f')]);var _0x20a1ee=new jsforce['Connection']({'oauth2':{'loginUrl':_0x35349f['remoteUri']||_0x070e('0x40'),'clientId':_0x35349f[_0x070e('0x41')],'clientSecret':_0x35349f[_0x070e('0x42')]}});return _0x20a1ee[_0x070e('0x43')](_0x35349f[_0x070e('0x44')],_0x3fdb75)['then'](function(){logger[_0x070e('0x1c')](_0x070e('0x45'));return _0x20a1ee;});}exports[_0x070e('0x46')]=function(_0x391dee,_0x79eaa0,_0xcd1c61,_0x1f54d5,_0x1b5374,_0xd67987){var _0x66a3f3,_0x210c4d,_0x3be553,_0x5254f8;_0xd67987[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0xd67987['serverUrl']);_0xd67987[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0xd67987[_0x070e('0x49')]);if(_0x1b5374&&_0x1b5374[_0x070e('0x4a')]){logger[_0x070e('0x1c')](_0x070e('0x4b'),_0x070e('0x4c'));_0x79eaa0[_0x070e('0x4d')]=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd67987[_0x070e('0x47')],_0x79eaa0['uniqueid'],md5(_0x79eaa0[_0x070e('0x4e')]));}else{_0x79eaa0[_0x070e('0x4d')]='';}return getConnection(_0xd67987)['then'](function(_0x991d23){_0x5254f8=_0x991d23;return getUser(_0xd67987,_0x1f54d5[_0x070e('0x4f')],_0x5254f8);})[_0x070e('0x18')](function(_0xa74805){_0x66a3f3=_0xa74805;return getEndUser(_0xd67987,_0xcd1c61,_0x79eaa0[_0x070e('0x50')],_0x79eaa0[_0x070e('0x51')],_0x5254f8);})[_0x070e('0x18')](function(_0x5694fa){_0x210c4d=_0x5694fa;return getTicket(_0xd67987,_0x66a3f3,_0x210c4d,_0xcd1c61,_0x79eaa0,_0xcd1c61[_0x070e('0x52')],_0x5254f8,'queue');})['then'](function(_0x3a06c6){_0x3be553=_0x3a06c6;logger[_0x070e('0x1c')](_0x070e('0x53'),_0x3be553['id']);logger[_0x070e('0x1c')](_0x070e('0x54'),_0x3be553['id'],_0x1f54d5[_0x070e('0x3c')],_0xd67987[_0x070e('0x34')]);switch(_0xd67987[_0x070e('0x34')]){case'integrationTab':emit(util[_0x070e('0x2c')]('user:%s',_0x1f54d5['name']),_0x070e('0x55'),{'recordId':_0x3be553['id']});break;case _0x070e('0x56'):emit(util['format'](_0x070e('0x57'),_0x1f54d5[_0x070e('0x3c')]),_0x070e('0x58'),{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x5254f8[_0x070e('0x5a')],_0x3be553['id'])});break;default:logger[_0x070e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5943e3){logger[_0x070e('0x5b')](_0x070e('0x4b'),JSON[_0x070e('0x5c')](_0x5943e3));});};exports[_0x070e('0x5d')]=function(_0x5ac0b5,_0x25f34c,_0x5d3c3a,_0x212710,_0x1cbb7e,_0x476804,_0x24f303){var _0x3ab11c,_0x15dbc4,_0x5561ed,_0x20ff87;_0x476804[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x476804['serverUrl']);_0x476804[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0x476804['remoteUri']);if(_0x24f303&&_0x24f303[_0x070e('0x5e')]&&_0x24f303['recordingFormat']!==_0x070e('0x5f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25f34c[_0x070e('0x4d')]=util[_0x070e('0x2c')](_0x070e('0x60'),_0x476804[_0x070e('0x47')],_0x25f34c[_0x070e('0x4e')],md5(_0x25f34c[_0x070e('0x4e')]));}return getConnection(_0x476804)['then'](function(_0x841c89){_0x20ff87=_0x841c89;return getUser(_0x476804,_0x212710['email'],_0x20ff87);})[_0x070e('0x18')](function(_0x52becf){_0x3ab11c=_0x52becf;return getEndUser(_0x476804,_0x5d3c3a,_0x25f34c[_0x070e('0x61')],_0x25f34c[_0x070e('0x62')],_0x20ff87);})['then'](function(_0x1bcdc3){_0x15dbc4=_0x1bcdc3;return getTicket(_0x476804,_0x3ab11c,_0x15dbc4,_0x5d3c3a,_0x25f34c,_0x5d3c3a['Fields'],_0x20ff87,_0x070e('0x5d'));})[_0x070e('0x18')](function(_0x2f1604){_0x5561ed=_0x2f1604;logger[_0x070e('0x1c')](_0x070e('0x63'),_0x5561ed['id']);logger[_0x070e('0x1c')](_0x070e('0x64'),_0x5561ed['id'],_0x212710[_0x070e('0x3c')],_0x476804[_0x070e('0x34')]);switch(_0x476804[_0x070e('0x34')]){case _0x070e('0x65'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:salesforce:display',{'recordId':_0x5561ed['id']});break;case _0x070e('0x56'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:browser:url',{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x20ff87[_0x070e('0x5a')],_0x5561ed['id'])});break;default:logger[_0x070e('0x5b')](_0x070e('0x66'),_0x070e('0x67'));}})['catch'](function(_0x5251d6){logger[_0x070e('0x5b')](_0x070e('0x66'),JSON[_0x070e('0x5c')](_0x5251d6));});};exports['abandoned']=function(_0x8b9c73,_0x52804d,_0x10d95d,_0x36373d,_0x3a1ad2,_0x150bf6){var _0x2a20d4,_0x50ef9f,_0x2e48f9,_0x2e38c6;_0x150bf6[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x150bf6['serverUrl']);_0x150bf6[_0x070e('0x49')]=intUtil['stripTrailingSlash'](_0x150bf6[_0x070e('0x49')]);if(_0x3a1ad2&&_0x3a1ad2[_0x070e('0x4a')]){logger[_0x070e('0x1c')]('[ABANDONED]',_0x070e('0x4c'));_0x52804d['recordingURL']=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x150bf6[_0x070e('0x47')],_0x52804d[_0x070e('0x4e')],md5(_0x52804d['uniqueid']));}else{_0x52804d[_0x070e('0x4d')]='';}return getConnection(_0x150bf6)['then'](function(_0x1c831f){_0x2e38c6=_0x1c831f;if(!_[_0x070e('0x13')](_0x36373d)){return getUser(_0x150bf6,_0x36373d['name'],_0x2e38c6);}else{return getUser(_0x150bf6,null,_0x2e38c6);}})['then'](function(_0x29ee66){_0x2a20d4=_0x29ee66;return getEndUser(_0x150bf6,_0x10d95d,_0x52804d[_0x070e('0x50')],_0x52804d[_0x070e('0x51')],_0x2e38c6);})[_0x070e('0x18')](function(_0x25f1d0){_0x50ef9f=_0x25f1d0;return getTicket(_0x150bf6,_0x2a20d4,_0x50ef9f,_0x10d95d,_0x52804d,_0x10d95d[_0x070e('0x52')],_0x2e38c6);})[_0x070e('0x18')](function(_0x332c8a){_0x2e48f9=_0x332c8a;logger[_0x070e('0x1c')](_0x070e('0x68'),_0x2e48f9['id']);logger[_0x070e('0x1c')](_0x070e('0x69'),_0x150bf6[_0x070e('0x34')]);})['catch'](function(_0x3308b5){logger[_0x070e('0x5b')]('[ABANDONED]',JSON['stringify'](_0x3308b5));});}; \ 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 1515017..d41e838 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 _0xfc76=['],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','nameField','customField','idField','content','toString','type','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','incident','Incident','all','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/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','%s/api/now/table/','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','result','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfc76,0xb5));var _0x6fc7=function(_0x4b2caa,_0x115e60){_0x4b2caa=_0x4b2caa-0x0;var _0x100318=_0xfc76[_0x4b2caa];return _0x100318;};'use strict';var _=require('lodash');var Promise=require(_0x6fc7('0x0'));var rp=require(_0x6fc7('0x1'));var util=require(_0x6fc7('0x2'));var md5=require(_0x6fc7('0x3'));var Redis=require(_0x6fc7('0x4'));var intUtil=require('./util');var config=require(_0x6fc7('0x5'));var logger=require(_0x6fc7('0x6'))('servicenow');config[_0x6fc7('0x7')]=_['defaults'](config[_0x6fc7('0x7')],{'host':_0x6fc7('0x8'),'port':0x18eb});var io=require(_0x6fc7('0x9'))(new Redis(config['redis']));function getAdminUser(_0x21a64d,_0x407b0a,_0x347c00,_0x1d4fee,_0x36cb16,_0x23d12f){return new Promise(function(_0x4de75e,_0xdddc47){var _0x61730a={'method':_0x6fc7('0xa'),'uri':_0x1d4fee+_0x6fc7('0xb')+'&'+_0x36cb16+'&'+_0x23d12f,'auth':_0x407b0a,'json':!![]};return rp(_0x61730a)[_0x6fc7('0xc')](function(_0x3c067c){if(_0x3c067c['result'][_0x6fc7('0xd')]>0x0){_0x347c00[_0x6fc7('0xe')]=_0x3c067c['result'][0x0][_0x6fc7('0xf')];}logger[_0x6fc7('0x10')]('['+[_0x21a64d['toUpperCase']()]+_0x6fc7('0x11'),_0x347c00);_0x4de75e(_0x347c00);})[_0x6fc7('0x12')](function(_0x4af729){logger[_0x6fc7('0x13')]('['+[_0x21a64d[_0x6fc7('0x14')]()]+']',_0x4af729[_0x6fc7('0x15')]);_0xdddc47(_0x4af729['message']);});});}function getUser(_0x556e28,_0xbb4a3e,_0x45d585,_0x499bcc,_0x2b0122){return function(_0x15e4db){logger[_0x6fc7('0x10')]('['+[_0x556e28[_0x6fc7('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x15e4db);return new Promise(function(_0x816704,_0x69ea70){if(intUtil[_0x6fc7('0x16')](_0x15e4db[_0x6fc7('0x17')])){var _0x12be21={'method':_0x6fc7('0xa'),'uri':_0x45d585+'sys_user?sysparm_query=email%3D'+_0x15e4db[_0x6fc7('0x17')]+'&'+_0x499bcc+'&'+_0x2b0122,'auth':_0xbb4a3e,'json':!![]};logger[_0x6fc7('0x10')]('['+[_0x556e28[_0x6fc7('0x14')]()]+_0x6fc7('0x18'),_0x12be21);return rp(_0x12be21)[_0x6fc7('0xc')](function(_0x526dba){logger[_0x6fc7('0x10')]('['+[_0x556e28[_0x6fc7('0x14')]()]+'],\x20getUser\x20entity',_0x526dba);if(_0x526dba[_0x6fc7('0x19')]['length']>0x0&&String(_0x526dba[_0x6fc7('0x19')][0x0]['active'])===_0x6fc7('0x1a')){_0x15e4db[_0x6fc7('0x1b')]=_0x526dba[_0x6fc7('0x19')][0x0]['sys_id'];}else{_0x15e4db[_0x6fc7('0x1b')]=_0x15e4db['adminId'];_0x15e4db[_0x6fc7('0x17')]=_0x15e4db[_0x6fc7('0x1c')];}logger[_0x6fc7('0x10')]('['+[_0x556e28[_0x6fc7('0x14')]()]+_0x6fc7('0x1d'),_0x15e4db);_0x816704(_0x15e4db);})[_0x6fc7('0x12')](function(_0x190680){logger[_0x6fc7('0x13')]('['+[_0x556e28[_0x6fc7('0x14')]()]+']',_0x190680[_0x6fc7('0x15')]);_0x69ea70(_0x190680[_0x6fc7('0x15')]);});}else{logger[_0x6fc7('0x10')]('['+[_0x556e28[_0x6fc7('0x14')]()]+_0x6fc7('0x1e'));_0x15e4db[_0x6fc7('0x1b')]=_0x15e4db['adminId'];_0x15e4db[_0x6fc7('0x17')]=_0x15e4db[_0x6fc7('0x1c')];_0x816704(_0x15e4db);}});};}function createEndUser(_0x168c87,_0x82c8cd,_0x5c1fd3,_0xfff989,_0x30e579){logger[_0x6fc7('0x10')]('['+[_0x168c87[_0x6fc7('0x14')]()]+_0x6fc7('0x1f'),_0x5c1fd3);return new Promise(function(_0x1465a7,_0x367b37){var _0x2428c9={'method':'POST','uri':_0xfff989+'sys_user?'+_0x30e579,'body':{'user_name':_0x5c1fd3[_0x6fc7('0x20')],'roles':_0x6fc7('0x21'),'first_name':_0x5c1fd3[_0x6fc7('0x20')],'active':_0x6fc7('0x1a'),'date_format':_0x6fc7('0x22'),'phone':_0x5c1fd3[_0x6fc7('0x20')]},'auth':_0x82c8cd,'json':!![]};return rp(_0x2428c9)['then'](function(_0x278f8f){logger[_0x6fc7('0x10')]('['+[_0x168c87[_0x6fc7('0x14')]()]+_0x6fc7('0x23'),_0x278f8f['result']);_0x5c1fd3['endUserId']=_0x278f8f['result'][_0x6fc7('0xf')];_0x1465a7(_0x5c1fd3);})[_0x6fc7('0x12')](function(_0x2fd248){logger[_0x6fc7('0x13')]('['+[_0x168c87[_0x6fc7('0x14')]()]+']',_0x2fd248[_0x6fc7('0x15')]);_0x367b37(_0x2fd248[_0x6fc7('0x15')]);});});}function getEndUser(_0x141898,_0x3325bb,_0x54e5d5,_0x13c800,_0x549b27){return function(_0x40ee9c){logger[_0x6fc7('0x10')]('['+[_0x141898[_0x6fc7('0x14')]()]+_0x6fc7('0x24'),_0x40ee9c);return new Promise(function(_0x52aea5,_0x408dd2){var _0x3245a8={'method':_0x6fc7('0xa'),'uri':_0x54e5d5+_0x6fc7('0x25')+_0x40ee9c['endUserNumber']+'&'+_0x13c800+'&'+_0x549b27,'auth':_0x3325bb,'json':!![]};return rp(_0x3245a8)[_0x6fc7('0xc')](function(_0x5f1c2e){if(_0x5f1c2e[_0x6fc7('0x19')]['length']>0x0){_0x40ee9c['endUserId']=_0x5f1c2e['result'][0x0][_0x6fc7('0xf')];logger['info']('['+[_0x141898[_0x6fc7('0x14')]()]+_0x6fc7('0x26'),_0x40ee9c);_0x52aea5(_0x40ee9c);}else{return createEndUser(_0x141898,_0x3325bb,_0x40ee9c,_0x54e5d5,_0x13c800)[_0x6fc7('0xc')](function(_0x128acf){logger[_0x6fc7('0x10')]('['+[_0x141898[_0x6fc7('0x14')]()]+_0x6fc7('0x27'),_0x128acf);_0x52aea5(_0x128acf);});}})[_0x6fc7('0x12')](function(_0x18e6f7){logger[_0x6fc7('0x13')]('['+[_0x141898[_0x6fc7('0x14')]()]+']',_0x18e6f7[_0x6fc7('0x15')]);_0x408dd2(_0x18e6f7[_0x6fc7('0x15')]);});});};}function getCustomFields(_0xe46d5,_0x3ac76e){var _0x3be13b={};if(_0xe46d5[_0x6fc7('0xd')]>0x0){_[_0x6fc7('0x28')](_0xe46d5,function(_0x5c47dd){if(_0x5c47dd['type']===_0x6fc7('0x29')&&_0x5c47dd[_0x6fc7('0x2a')]&&!_0x5c47dd[_0x6fc7('0x2b')]){_0x3be13b[_0x5c47dd[_0x6fc7('0x2c')]['toLowerCase']()]=_0x5c47dd[_0x6fc7('0x2d')][_0x6fc7('0x2e')]();}else if(_0x5c47dd[_0x6fc7('0x2f')]===_0x6fc7('0x29')&&_0x5c47dd[_0x6fc7('0x2c')]&&_0x5c47dd[_0x6fc7('0x2b')]){_0x3be13b[_0x5c47dd[_0x6fc7('0x2c')][_0x6fc7('0x30')]()]=_0x5c47dd[_0x6fc7('0x2d')][_0x6fc7('0x2e')]();}else if(_0x5c47dd[_0x6fc7('0x2f')]===_0x6fc7('0x31')&&_0x5c47dd['variableName']&&_0x5c47dd[_0x6fc7('0x2c')]&&_0x5c47dd[_0x6fc7('0x2b')]){_0x3be13b[_0x5c47dd['idField'][_0x6fc7('0x30')]()]=_0x3ac76e[_0x5c47dd[_0x6fc7('0x32')]][_0x6fc7('0x2e')]();}else if(_0x5c47dd[_0x6fc7('0x2f')]===_0x6fc7('0x33')&&_0x5c47dd[_0x6fc7('0x34')]&&_0x5c47dd[_0x6fc7('0x34')][_0x6fc7('0x35')]&&_0x5c47dd[_0x6fc7('0x2c')]&&_0x5c47dd[_0x6fc7('0x2b')]){_0x3be13b[_0x5c47dd['idField'][_0x6fc7('0x30')]()]=_0x3ac76e[_0x5c47dd[_0x6fc7('0x34')]['name']['toLowerCase']()][_0x6fc7('0x2e')]();}});}return _0x3be13b;}function getTicket(_0x38ba18,_0x4496e4,_0x554a48,_0x1cf050,_0xfe850e,_0x53e631){return function(_0x12d65f){logger[_0x6fc7('0x10')]('['+[_0x38ba18[_0x6fc7('0x14')]()]+_0x6fc7('0x36'),_0x12d65f);return new Promise(function(_0x322fc4,_0x2b24e8){var _0x10bc97=_0x38ba18[_0x6fc7('0x30')]()===_0x6fc7('0x37')?_0x12d65f[_0x6fc7('0x1b')]:_0x12d65f[_0x6fc7('0x38')];var _0x5e08c0={'method':'POST','uri':_0x554a48+'incident'+'?'+_0x53e631,'body':Object['assign']({},{'active':_0x6fc7('0x1a'),'caller_id':_0x10bc97,'assigned_to':_0x12d65f['userId'],'short_description':intUtil[_0x6fc7('0x39')](_0x1cf050[_0x6fc7('0x3a')],_0xfe850e,'\x20'),'description':intUtil[_0x6fc7('0x39')](_0x1cf050[_0x6fc7('0x3b')],_0xfe850e,'\x0a')},getCustomFields(_0x1cf050[_0x6fc7('0x3c')],_0xfe850e)),'auth':_0x4496e4,'json':!![]};return rp(_0x5e08c0)[_0x6fc7('0xc')](function(_0x4d2313){logger[_0x6fc7('0x10')]('['+[_0x38ba18[_0x6fc7('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x4d2313[_0x6fc7('0x19')]);_0x12d65f[_0x6fc7('0x3d')]=_0x4d2313[_0x6fc7('0x19')][_0x6fc7('0xf')];_0x12d65f[_0x6fc7('0x3e')]=_0x4d2313[_0x6fc7('0x19')][_0x6fc7('0x3f')];logger[_0x6fc7('0x10')]('['+[_0x38ba18[_0x6fc7('0x14')]()]+_0x6fc7('0x40'),_0x12d65f);_0x322fc4(_0x12d65f);})['catch'](function(_0x4684bd){logger[_0x6fc7('0x13')]('['+[_0x38ba18[_0x6fc7('0x14')]()]+']',_0x4684bd['message']);_0x2b24e8(_0x4684bd[_0x6fc7('0x15')]);});});};}function createRemoteTag(_0x4bb441,_0x3cecb2,_0x59773d,_0x2e16b6){return new Promise(function(_0xcb8dc4,_0x37e6b5){var _0x63d48f={'method':_0x6fc7('0x41'),'uri':_0x59773d+_0x6fc7('0x42')+'?'+_0x2e16b6,'body':{'short_description':_0x4bb441,'global':!![],'active':!![],'name':_0x4bb441},'auth':_0x3cecb2,'json':!![]};return rp(_0x63d48f)[_0x6fc7('0xc')](function(_0x451303){var _0x5f1ce6=_0x451303[_0x6fc7('0x19')][_0x6fc7('0xf')];_0xcb8dc4(_0x5f1ce6);});});}function getRemoteTag(_0x262de2,_0x9e6e82,_0x341493,_0x4bb7f2,_0x184434){return new Promise(function(_0x118f81,_0x3974c5){var _0x1307da={'method':_0x6fc7('0xa'),'uri':_0x341493+_0x6fc7('0x42')+_0x6fc7('0x43')+_0x262de2+'&'+_0x4bb7f2,'auth':_0x9e6e82,'json':!![]};return rp(_0x1307da)[_0x6fc7('0xc')](function(_0x2975ac){if(_0x2975ac[_0x6fc7('0x19')][_0x6fc7('0xd')]>0x0){var _0x4cc178=_0x2975ac[_0x6fc7('0x19')][0x0][_0x6fc7('0xf')];_0x118f81(_0x4cc178);}else{return createRemoteTag(_0x262de2,_0x9e6e82,_0x341493,_0x4bb7f2)[_0x6fc7('0xc')](function(_0xb3d8d3){_0x118f81(_0xb3d8d3);});}});});}function assignTagToIncident(_0x4006a3,_0x2d2338,_0x39ae2f,_0x1c7a57,_0x4f3c1c){return new Promise(function(_0x6223c9,_0x578c08){var _0x5da61c={'method':'POST','uri':_0x39ae2f+_0x6fc7('0x44')+'?'+_0x4f3c1c,'body':{'label':_0x4006a3,'table':_0x6fc7('0x45'),'id_type':_0x6fc7('0x46'),'table_key':_0x1c7a57['ticketId'],'title':'Incident\x20-\x20'+_0x1c7a57[_0x6fc7('0x3e')],'id_display':_0x1c7a57['ticketNumber']},'auth':_0x2d2338,'json':!![]};return rp(_0x5da61c)[_0x6fc7('0xc')](function(_0x3d1c0f){_0x6223c9();})[_0x6fc7('0x12')](function(){_0x6223c9();});});}function manageTags(_0x38a0fc,_0x389b31,_0x376047,_0x26fb83,_0x22e569,_0x24f5dd,_0x3a8715){return new Promise(function(_0x5642df,_0x71ac49){var _0x17477c=[];_0x389b31['forEach'](function(_0x4bdf0c){_0x17477c['push'](getRemoteTag(_0x4bdf0c,_0x376047,_0x26fb83,_0x24f5dd,_0x3a8715));});return Promise[_0x6fc7('0x47')](_0x17477c)[_0x6fc7('0xc')](function(_0x340ad8){if(_0x340ad8[_0x6fc7('0xd')]){logger[_0x6fc7('0x10')]('['+[_0x38a0fc[_0x6fc7('0x14')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x340ad8);var _0x17c6c5=[];_0x340ad8[_0x6fc7('0x28')](function(_0x50765e){_0x17c6c5['push'](assignTagToIncident(_0x50765e,_0x376047,_0x26fb83,_0x22e569,_0x24f5dd));});return Promise[_0x6fc7('0x47')](_0x17c6c5)[_0x6fc7('0xc')](function(){_0x5642df();})[_0x6fc7('0x12')](function(){_0x5642df();});}else{_0x5642df();}});});}function getTags(_0x209c7b,_0x1fb13c,_0x11c99d,_0x3f80fb,_0x38b01e,_0x287604){return function(_0xbeec61){return new Promise(function(_0x589d6a,_0x1b7ad2){var _0x323259=[];var _0xa1fb1d=_0x3f80fb['Tags'];if(_0xa1fb1d&&_0xa1fb1d['length']>0x0){_0x323259=_[_0x6fc7('0x48')](_0xa1fb1d,_0x6fc7('0x35'));}if(_0x323259[_0x6fc7('0xd')]>0x0){return manageTags(_0x209c7b,_0x323259,_0x1fb13c,_0x11c99d,_0xbeec61,_0x38b01e,_0x287604)[_0x6fc7('0xc')](function(){_0x589d6a(_0xbeec61);});}else{_0x589d6a(_0xbeec61);}});};}function emit(_0x357bbe,_0xf0bf9d,_0x4d28c0){var _0x2bcfd6='%26sysparm_record_target%3Dincident'+_0x6fc7('0x49')+_0x6fc7('0x4a')+'%255EORDERBYDESCnumber';var _0x2c9c24={'uri':_0x357bbe+_0x6fc7('0x4b')+_0x4d28c0+_0x2bcfd6};io['to'](util[_0x6fc7('0x4c')](_0x6fc7('0x4d'),_0xf0bf9d))[_0x6fc7('0x4e')](_0x6fc7('0x4f'),_0x2c9c24);}exports['cs']=function(_0x5e65d3,_0x5136f6,_0x2d799d,_0x53fa59,_0x3a1472,_0x59ad1f,_0x410476,_0x27d3e3){var _0x1497db={};var _0xee23ca={'user':_0x59ad1f[_0x6fc7('0x50')],'pass':_0x59ad1f[_0x6fc7('0x51')]};var _0x4383ce=_0x6fc7('0x52');var _0x13f7c6=_0x6fc7('0x53');_0x59ad1f[_0x6fc7('0x54')]=intUtil[_0x6fc7('0x55')](_0x59ad1f[_0x6fc7('0x54')]);_0x59ad1f['serverUrl']=intUtil['stripTrailingSlash'](_0x59ad1f['serverUrl']);var _0x50c6a8=util[_0x6fc7('0x4c')](_0x6fc7('0x56'),_0x59ad1f[_0x6fc7('0x54')]);_0x1497db['userEmail']=!_['isNil'](_0x53fa59)?_0x53fa59[_0x6fc7('0x57')]:null;_0x1497db[_0x6fc7('0x1c')]=_0x59ad1f['email'];_0x1497db[_0x6fc7('0x20')]=_0x27d3e3[_0x6fc7('0x30')]()===_0x6fc7('0x37')?_0x5136f6[_0x6fc7('0x58')]:_0x5136f6['calleridnum'];_0x1497db[_0x6fc7('0x59')]=_0x27d3e3==='queue'||_0x27d3e3==='abandoned'?_0x6fc7('0x5a'):_0x6fc7('0x37');var _0x681873=util[_0x6fc7('0x4c')](_0x6fc7('0x5b'),_0x59ad1f[_0x6fc7('0x5c')],_0x5136f6['uniqueid'],md5(_0x5136f6['uniqueid']));if(_0x3a1472&&_0x3a1472[_0x6fc7('0x5d')]){logger[_0x6fc7('0x10')](_0x6fc7('0x5e'),_0x6fc7('0x5f'));_0x5136f6[_0x6fc7('0x60')]=_0x681873;}else if(_0x410476&&_0x410476['recordingFormat']&&_0x410476[_0x6fc7('0x61')]!==_0x6fc7('0x62')){logger[_0x6fc7('0x10')](_0x6fc7('0x63'),'Recording\x20is\x20enabled!');_0x5136f6[_0x6fc7('0x60')]=_0x681873;}else{_0x5136f6[_0x6fc7('0x60')]='';}return getAdminUser(_0x27d3e3,_0xee23ca,_0x1497db,_0x50c6a8,_0x13f7c6,_0x4383ce)[_0x6fc7('0xc')](getUser(_0x27d3e3,_0xee23ca,_0x50c6a8,_0x13f7c6,_0x4383ce))['then'](getEndUser(_0x27d3e3,_0xee23ca,_0x50c6a8,_0x13f7c6,_0x4383ce))['then'](getTicket(_0x27d3e3,_0xee23ca,_0x50c6a8,_0x2d799d,_0x5136f6,_0x13f7c6))[_0x6fc7('0xc')](function(_0xaa7266){logger[_0x6fc7('0x10')](util[_0x6fc7('0x4c')](_0x6fc7('0x64'),_0xaa7266[_0x6fc7('0x3d')]));logger[_0x6fc7('0x10')](util[_0x6fc7('0x4c')](_0x6fc7('0x65'),_0x27d3e3));if(_0x27d3e3!==_0x6fc7('0x66')){logger['info']('['+[_0x27d3e3[_0x6fc7('0x14')]()]+']',_0x6fc7('0x67'));emit(_0x59ad1f['remoteUri'],_0x53fa59[_0x6fc7('0x35')],_0xaa7266[_0x6fc7('0x3d')]);}})[_0x6fc7('0x12')](function(_0x17f059){logger['error']('['+[_0x27d3e3[_0x6fc7('0x14')]()]+_0x6fc7('0x68'),util[_0x6fc7('0x69')](_0x17f059,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x639d=['sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20entity','length','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','destcalleridnum','calleridnum','callDirection','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId'];(function(_0x292c3d,_0x4ec66c){var _0x2e31e1=function(_0x3919cd){while(--_0x3919cd){_0x292c3d['push'](_0x292c3d['shift']());}};_0x2e31e1(++_0x4ec66c);}(_0x639d,0xbb));var _0xd639=function(_0x52caf6,_0x435018){_0x52caf6=_0x52caf6-0x0;var _0x52d565=_0x639d[_0x52caf6];return _0x52d565;};'use strict';var _=require(_0xd639('0x0'));var Promise=require(_0xd639('0x1'));var rp=require(_0xd639('0x2'));var util=require('util');var md5=require(_0xd639('0x3'));var Redis=require(_0xd639('0x4'));var intUtil=require('./util');var config=require(_0xd639('0x5'));var logger=require('../../../../config/logger')(_0xd639('0x6'));config['redis']=_['defaults'](config[_0xd639('0x7')],{'host':_0xd639('0x8'),'port':0x18eb});var io=require(_0xd639('0x9'))(new Redis(config[_0xd639('0x7')]));function getAdminUser(_0x200b82,_0x3be7c6,_0x42b044,_0x10265c,_0x5cc490,_0x12960e){return new Promise(function(_0x2a48dc,_0x1f12aa){var _0x44bcb1={'method':_0xd639('0xa'),'uri':_0x10265c+_0xd639('0xb')+'&'+_0x5cc490+'&'+_0x12960e,'auth':_0x3be7c6,'json':!![]};return rp(_0x44bcb1)[_0xd639('0xc')](function(_0x1b0c87){if(_0x1b0c87[_0xd639('0xd')]['length']>0x0){_0x42b044[_0xd639('0xe')]=_0x1b0c87[_0xd639('0xd')][0x0][_0xd639('0xf')];}logger['info']('['+[_0x200b82[_0xd639('0x10')]()]+_0xd639('0x11'),_0x42b044);_0x2a48dc(_0x42b044);})[_0xd639('0x12')](function(_0x59a6e2){logger[_0xd639('0x13')]('['+[_0x200b82[_0xd639('0x10')]()]+']',_0x59a6e2['message']);_0x1f12aa(_0x59a6e2[_0xd639('0x14')]);});});}function getUser(_0x66d977,_0x4c7671,_0x3e4080,_0x1cc87b,_0x3b7d7b){return function(_0x1c30a1){logger[_0xd639('0x15')]('['+[_0x66d977['toUpperCase']()]+_0xd639('0x16'),_0x1c30a1);return new Promise(function(_0x3a7c21,_0x30e3d0){if(intUtil['validateEmail'](_0x1c30a1[_0xd639('0x17')])){var _0x3235a7={'method':_0xd639('0xa'),'uri':_0x3e4080+'sys_user?sysparm_query=email%3D'+_0x1c30a1[_0xd639('0x17')]+'&'+_0x1cc87b+'&'+_0x3b7d7b,'auth':_0x4c7671,'json':!![]};logger[_0xd639('0x15')]('['+[_0x66d977[_0xd639('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x3235a7);return rp(_0x3235a7)[_0xd639('0xc')](function(_0xe703a6){logger[_0xd639('0x15')]('['+[_0x66d977[_0xd639('0x10')]()]+_0xd639('0x18'),_0xe703a6);if(_0xe703a6[_0xd639('0xd')][_0xd639('0x19')]>0x0&&String(_0xe703a6['result'][0x0]['active'])===_0xd639('0x1a')){_0x1c30a1[_0xd639('0x1b')]=_0xe703a6[_0xd639('0xd')][0x0][_0xd639('0xf')];}else{_0x1c30a1[_0xd639('0x1b')]=_0x1c30a1[_0xd639('0xe')];_0x1c30a1[_0xd639('0x17')]=_0x1c30a1[_0xd639('0x1c')];}logger[_0xd639('0x15')]('['+[_0x66d977[_0xd639('0x10')]()]+_0xd639('0x1d'),_0x1c30a1);_0x3a7c21(_0x1c30a1);})['catch'](function(_0x22f65c){logger[_0xd639('0x13')]('['+[_0x66d977[_0xd639('0x10')]()]+']',_0x22f65c[_0xd639('0x14')]);_0x30e3d0(_0x22f65c[_0xd639('0x14')]);});}else{logger[_0xd639('0x15')]('['+[_0x66d977['toUpperCase']()]+_0xd639('0x1e'));_0x1c30a1[_0xd639('0x1b')]=_0x1c30a1['adminId'];_0x1c30a1[_0xd639('0x17')]=_0x1c30a1[_0xd639('0x1c')];_0x3a7c21(_0x1c30a1);}});};}function createEndUser(_0x474c90,_0x161426,_0xbd387d,_0x19f4dd,_0x4347d5){logger['info']('['+[_0x474c90[_0xd639('0x10')]()]+_0xd639('0x1f'),_0xbd387d);return new Promise(function(_0x5285d3,_0x535d05){var _0x1daf48={'method':_0xd639('0x20'),'uri':_0x19f4dd+_0xd639('0x21')+_0x4347d5,'body':{'user_name':_0xbd387d[_0xd639('0x22')],'roles':'user','first_name':_0xbd387d[_0xd639('0x22')],'active':_0xd639('0x1a'),'date_format':_0xd639('0x23'),'phone':_0xbd387d[_0xd639('0x22')]},'auth':_0x161426,'json':!![]};return rp(_0x1daf48)[_0xd639('0xc')](function(_0x582dcd){logger['info']('['+[_0x474c90['toUpperCase']()]+_0xd639('0x24'),_0x582dcd[_0xd639('0xd')]);_0xbd387d[_0xd639('0x25')]=_0x582dcd['result'][_0xd639('0xf')];_0x5285d3(_0xbd387d);})[_0xd639('0x12')](function(_0x30cf0c){logger[_0xd639('0x13')]('['+[_0x474c90[_0xd639('0x10')]()]+']',_0x30cf0c[_0xd639('0x14')]);_0x535d05(_0x30cf0c[_0xd639('0x14')]);});});}function getEndUser(_0x1338e8,_0x19f17c,_0x1f5e73,_0x1ce5bb,_0x4ae612){return function(_0x30e903){logger[_0xd639('0x15')]('['+[_0x1338e8[_0xd639('0x10')]()]+_0xd639('0x26'),_0x30e903);return new Promise(function(_0xaa7b67,_0x438553){var _0x34c9ad={'method':_0xd639('0xa'),'uri':_0x1f5e73+_0xd639('0x27')+_0x30e903[_0xd639('0x22')]+'&'+_0x1ce5bb+'&'+_0x4ae612,'auth':_0x19f17c,'json':!![]};return rp(_0x34c9ad)[_0xd639('0xc')](function(_0x57d642){if(_0x57d642[_0xd639('0xd')][_0xd639('0x19')]>0x0){_0x30e903[_0xd639('0x25')]=_0x57d642[_0xd639('0xd')][0x0][_0xd639('0xf')];logger['info']('['+[_0x1338e8['toUpperCase']()]+_0xd639('0x28'),_0x30e903);_0xaa7b67(_0x30e903);}else{return createEndUser(_0x1338e8,_0x19f17c,_0x30e903,_0x1f5e73,_0x1ce5bb)['then'](function(_0xcc708d){logger[_0xd639('0x15')]('['+[_0x1338e8[_0xd639('0x10')]()]+'],\x20createEndUser\x20crm',_0xcc708d);_0xaa7b67(_0xcc708d);});}})[_0xd639('0x12')](function(_0x44b19f){logger[_0xd639('0x13')]('['+[_0x1338e8[_0xd639('0x10')]()]+']',_0x44b19f['message']);_0x438553(_0x44b19f[_0xd639('0x14')]);});});};}function getCustomFields(_0x4c2edc,_0x5413fb){var _0x5ca371={};if(_0x4c2edc[_0xd639('0x19')]>0x0){_[_0xd639('0x29')](_0x4c2edc,function(_0xe3025){if(_0xe3025[_0xd639('0x2a')]===_0xd639('0x2b')&&_0xe3025[_0xd639('0x2c')]&&!_0xe3025[_0xd639('0x2d')]){_0x5ca371[_0xe3025[_0xd639('0x2e')][_0xd639('0x2f')]()]=_0xe3025[_0xd639('0x30')]['toString']();}else if(_0xe3025[_0xd639('0x2a')]==='string'&&_0xe3025['idField']&&_0xe3025['customField']){_0x5ca371[_0xe3025[_0xd639('0x2e')][_0xd639('0x2f')]()]=_0xe3025[_0xd639('0x30')][_0xd639('0x31')]();}else if(_0xe3025[_0xd639('0x2a')]===_0xd639('0x32')&&_0xe3025['variableName']&&_0xe3025[_0xd639('0x2e')]&&_0xe3025[_0xd639('0x2d')]){_0x5ca371[_0xe3025['idField']['toLowerCase']()]=_0x5413fb[_0xe3025['variableName']][_0xd639('0x31')]();}else if(_0xe3025['type']===_0xd639('0x33')&&_0xe3025['Variable']&&_0xe3025['Variable'][_0xd639('0x34')]&&_0xe3025[_0xd639('0x2e')]&&_0xe3025[_0xd639('0x2d')]){_0x5ca371[_0xe3025[_0xd639('0x2e')][_0xd639('0x2f')]()]=_0x5413fb[_0xe3025[_0xd639('0x35')][_0xd639('0x34')]['toLowerCase']()][_0xd639('0x31')]();}});}return _0x5ca371;}function getTicket(_0x34f11e,_0x4bc866,_0x2f3cfb,_0x2348aa,_0x32fafc,_0x52d694){return function(_0x388c08){logger[_0xd639('0x15')]('['+[_0x34f11e[_0xd639('0x10')]()]+_0xd639('0x36'),_0x388c08);return new Promise(function(_0x2a2e33,_0x27029f){var _0x537b81=_0x34f11e[_0xd639('0x2f')]()===_0xd639('0x37')?_0x388c08['userId']:_0x388c08['endUserId'];var _0x174498={'method':_0xd639('0x20'),'uri':_0x2f3cfb+_0xd639('0x38')+'?'+_0x52d694,'body':Object['assign']({},{'active':_0xd639('0x1a'),'caller_id':_0x537b81,'assigned_to':_0x388c08[_0xd639('0x1b')],'short_description':intUtil[_0xd639('0x39')](_0x2348aa['Subjects'],_0x32fafc,'\x20'),'description':intUtil['getString'](_0x2348aa[_0xd639('0x3a')],_0x32fafc,'\x0a')},getCustomFields(_0x2348aa[_0xd639('0x3b')],_0x32fafc)),'auth':_0x4bc866,'json':!![]};return rp(_0x174498)['then'](function(_0x666a47){logger[_0xd639('0x15')]('['+[_0x34f11e['toUpperCase']()]+_0xd639('0x3c'),_0x666a47[_0xd639('0xd')]);_0x388c08[_0xd639('0x3d')]=_0x666a47[_0xd639('0xd')][_0xd639('0xf')];_0x388c08[_0xd639('0x3e')]=_0x666a47[_0xd639('0xd')][_0xd639('0x3f')];logger[_0xd639('0x15')]('['+[_0x34f11e[_0xd639('0x10')]()]+_0xd639('0x40'),_0x388c08);_0x2a2e33(_0x388c08);})[_0xd639('0x12')](function(_0x3db872){logger[_0xd639('0x13')]('['+[_0x34f11e[_0xd639('0x10')]()]+']',_0x3db872[_0xd639('0x14')]);_0x27029f(_0x3db872[_0xd639('0x14')]);});});};}function createRemoteTag(_0x3f77d8,_0x1c8ec0,_0x11d342,_0x18be05){return new Promise(function(_0x38ec24,_0x14e43a){var _0x4a7e91={'method':_0xd639('0x20'),'uri':_0x11d342+'label'+'?'+_0x18be05,'body':{'short_description':_0x3f77d8,'global':!![],'active':!![],'name':_0x3f77d8},'auth':_0x1c8ec0,'json':!![]};return rp(_0x4a7e91)[_0xd639('0xc')](function(_0x4d52a2){var _0x29541c=_0x4d52a2[_0xd639('0xd')][_0xd639('0xf')];_0x38ec24(_0x29541c);});});}function getRemoteTag(_0x3d615b,_0x237e2a,_0x7345fd,_0x5db663,_0x18c62f){return new Promise(function(_0x4615d5,_0x304cce){var _0x2755d0={'method':_0xd639('0xa'),'uri':_0x7345fd+_0xd639('0x41')+_0xd639('0x42')+_0x3d615b+'&'+_0x5db663,'auth':_0x237e2a,'json':!![]};return rp(_0x2755d0)['then'](function(_0x3d4042){if(_0x3d4042[_0xd639('0xd')][_0xd639('0x19')]>0x0){var _0x5bf1e4=_0x3d4042[_0xd639('0xd')][0x0][_0xd639('0xf')];_0x4615d5(_0x5bf1e4);}else{return createRemoteTag(_0x3d615b,_0x237e2a,_0x7345fd,_0x5db663)[_0xd639('0xc')](function(_0x5b30b9){_0x4615d5(_0x5b30b9);});}});});}function assignTagToIncident(_0x3bf038,_0x157651,_0x5bd502,_0x1055f4,_0x4b2e36){return new Promise(function(_0x2758d4,_0x3817de){var _0x5ac5f1={'method':'POST','uri':_0x5bd502+'label_entry'+'?'+_0x4b2e36,'body':{'label':_0x3bf038,'table':'incident','id_type':_0xd639('0x43'),'table_key':_0x1055f4[_0xd639('0x3d')],'title':_0xd639('0x44')+_0x1055f4['ticketNumber'],'id_display':_0x1055f4[_0xd639('0x3e')]},'auth':_0x157651,'json':!![]};return rp(_0x5ac5f1)[_0xd639('0xc')](function(_0x15b329){_0x2758d4();})[_0xd639('0x12')](function(){_0x2758d4();});});}function manageTags(_0x404188,_0x471126,_0x36459d,_0x2ebe9d,_0x30bd43,_0x330b7c,_0x96ec3c){return new Promise(function(_0x2a493e,_0x4414e2){var _0x324e89=[];_0x471126[_0xd639('0x29')](function(_0x4e1b83){_0x324e89[_0xd639('0x45')](getRemoteTag(_0x4e1b83,_0x36459d,_0x2ebe9d,_0x330b7c,_0x96ec3c));});return Promise[_0xd639('0x46')](_0x324e89)['then'](function(_0x5cf6e6){if(_0x5cf6e6[_0xd639('0x19')]){logger[_0xd639('0x15')]('['+[_0x404188['toUpperCase']()]+_0xd639('0x47'),_0x5cf6e6);var _0x3e1225=[];_0x5cf6e6[_0xd639('0x29')](function(_0x554605){_0x3e1225[_0xd639('0x45')](assignTagToIncident(_0x554605,_0x36459d,_0x2ebe9d,_0x30bd43,_0x330b7c));});return Promise['all'](_0x3e1225)[_0xd639('0xc')](function(){_0x2a493e();})[_0xd639('0x12')](function(){_0x2a493e();});}else{_0x2a493e();}});});}function getTags(_0x8458d5,_0x398aa5,_0x42c9bb,_0x556338,_0x1af47a,_0x36ab90){return function(_0x385133){return new Promise(function(_0x449be7,_0x28778c){var _0x100ec6=[];var _0xb47604=_0x556338[_0xd639('0x48')];if(_0xb47604&&_0xb47604[_0xd639('0x19')]>0x0){_0x100ec6=_[_0xd639('0x49')](_0xb47604,'name');}if(_0x100ec6[_0xd639('0x19')]>0x0){return manageTags(_0x8458d5,_0x100ec6,_0x398aa5,_0x42c9bb,_0x385133,_0x1af47a,_0x36ab90)[_0xd639('0xc')](function(){_0x449be7(_0x385133);});}else{_0x449be7(_0x385133);}});};}function emit(_0x144473,_0x3b92a9,_0x4ea128){var _0x3f694b=_0xd639('0x4a')+_0xd639('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x3c82fe={'uri':_0x144473+_0xd639('0x4c')+_0x4ea128+_0x3f694b};io['to'](util[_0xd639('0x4d')](_0xd639('0x4e'),_0x3b92a9))[_0xd639('0x4f')]('trigger:browser:url',_0x3c82fe);}exports['cs']=function(_0x223b55,_0x1db218,_0x40436b,_0x2efc70,_0x1efb9e,_0xaeb5b9,_0x35b3e9,_0x273a8d){var _0x44ee47={};var _0x16def5={'user':_0xaeb5b9[_0xd639('0x50')],'pass':_0xaeb5b9[_0xd639('0x51')]};var _0x19bc89=_0xd639('0x52');var _0x43ae10=_0xd639('0x53');_0xaeb5b9[_0xd639('0x54')]=intUtil['stripTrailingSlash'](_0xaeb5b9[_0xd639('0x54')]);_0xaeb5b9[_0xd639('0x55')]=intUtil['stripTrailingSlash'](_0xaeb5b9[_0xd639('0x55')]);var _0xb0ce0a=util[_0xd639('0x4d')]('%s/api/now/table/',_0xaeb5b9[_0xd639('0x54')]);_0x44ee47['userEmail']=!_['isNil'](_0x2efc70)?_0x2efc70['email']:null;_0x44ee47['adminEmail']=_0xaeb5b9['email'];_0x44ee47[_0xd639('0x22')]=_0x273a8d['toLowerCase']()===_0xd639('0x37')?_0x1db218[_0xd639('0x56')]:_0x1db218[_0xd639('0x57')];_0x44ee47[_0xd639('0x58')]=_0x273a8d==='queue'||_0x273a8d===_0xd639('0x59')?'queue':_0xd639('0x37');var _0x4964ff=util[_0xd639('0x4d')](_0xd639('0x5a'),_0xaeb5b9['serverUrl'],_0x1db218[_0xd639('0x5b')],md5(_0x1db218[_0xd639('0x5b')]));if(_0x1efb9e&&_0x1efb9e['monitor_format']){logger[_0xd639('0x15')](_0xd639('0x5c'),'Recording\x20is\x20enabled!');_0x1db218['recordingURL']=_0x4964ff;}else if(_0x35b3e9&&_0x35b3e9[_0xd639('0x5d')]&&_0x35b3e9[_0xd639('0x5d')]!=='none'){logger[_0xd639('0x15')]('[OUTBOUND]',_0xd639('0x5e'));_0x1db218['recordingURL']=_0x4964ff;}else{_0x1db218[_0xd639('0x5f')]='';}return getAdminUser(_0x273a8d,_0x16def5,_0x44ee47,_0xb0ce0a,_0x43ae10,_0x19bc89)[_0xd639('0xc')](getUser(_0x273a8d,_0x16def5,_0xb0ce0a,_0x43ae10,_0x19bc89))[_0xd639('0xc')](getEndUser(_0x273a8d,_0x16def5,_0xb0ce0a,_0x43ae10,_0x19bc89))[_0xd639('0xc')](getTicket(_0x273a8d,_0x16def5,_0xb0ce0a,_0x40436b,_0x1db218,_0x43ae10))[_0xd639('0xc')](function(_0x254f7d){logger[_0xd639('0x15')](util['format'](_0xd639('0x60'),_0x254f7d[_0xd639('0x3d')]));logger[_0xd639('0x15')](util['format'](_0xd639('0x61'),_0x273a8d));if(_0x273a8d!=='abandoned'){logger[_0xd639('0x15')]('['+[_0x273a8d[_0xd639('0x10')]()]+']',_0xd639('0x62'));emit(_0xaeb5b9[_0xd639('0x54')],_0x2efc70[_0xd639('0x34')],_0x254f7d[_0xd639('0x3d')]);}})[_0xd639('0x12')](function(_0x47b369){logger[_0xd639('0x13')]('['+[_0x273a8d[_0xd639('0x10')]()]+_0xd639('0x63'),util[_0xd639('0x64')](_0x47b369,{'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 cf5039e..36f5869 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 _0x7bcf=['Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','direction','forEach','idField','variableName','set_entry','JSON','stringify','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','format','user_name','then','find','entry_list','name_value_list','Agent\x20found!','value','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','toLowerCase','content','customField','custom_fields','push','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','error','[ABANDONED]','calleridname','calleridnum','lodash','request-promise','bluebird','md5','ioredis','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','info'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x7bcf,0x6c));var _0xf7bc=function(_0x26daa9,_0x4920b2){_0x26daa9=_0x26daa9-0x0;var _0x5bad09=_0x7bcf[_0x26daa9];return _0x5bad09;};'use strict';var _=require(_0xf7bc('0x0'));var rp=require(_0xf7bc('0x1'));var BPromise=require(_0xf7bc('0x2'));var md5=require(_0xf7bc('0x3'));var util=require('util');var Redis=require(_0xf7bc('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf7bc('0x5'))(_0xf7bc('0x6'));config[_0xf7bc('0x7')]=_[_0xf7bc('0x8')](config[_0xf7bc('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf7bc('0x9'))(new Redis(config['redis']));var def={'method':_0xf7bc('0xa'),'json':!![]};function emit(_0x5d19d6,_0x1d8783,_0x354e8b){io['to'](_0x5d19d6)['emit'](_0x1d8783,_0x354e8b);}function getTicket(_0x9be2f,_0x3477e,_0x41c3c5,_0x57cc39,_0x2029f3,_0x5940e3,_0x26438f,_0x4e8f5f){logger[_0xf7bc('0xb')](_0xf7bc('0xc'));var _0x3f89ad=new Date();var _0x18dd29=[{'name':_0xf7bc('0xd'),'value':intUtil[_0xf7bc('0xe')](_0x57cc39[_0xf7bc('0xf')],_0x2029f3,'\x20')},{'name':_0xf7bc('0x10'),'value':_0x3477e['id']},{'name':_0xf7bc('0x11'),'value':_0x3477e['id']},{'name':_0xf7bc('0x12'),'value':intUtil[_0xf7bc('0xe')](_0x57cc39[_0xf7bc('0x13')],_0x2029f3,'\x0a')},{'name':_0xf7bc('0x14'),'value':_0x3f89ad['toISOString']()[_0xf7bc('0x15')](0x0,0x13)[_0xf7bc('0x16')]('T','\x20')},{'name':_0xf7bc('0x17'),'value':'0'},{'name':_0xf7bc('0x18'),'value':'15'},{'name':_0xf7bc('0x19'),'value':_0x41c3c5['id']},{'name':_0xf7bc('0x1a'),'value':'Contacts'},{'name':'parent_name','value':_0x41c3c5[_0xf7bc('0xd')]},{'name':_0xf7bc('0x1b'),'value':_0x4e8f5f}];if(_0x5940e3['length']){_[_0xf7bc('0x1c')](_0x5940e3,function(_0x4d6bbb){if(_0x2029f3[_0x4d6bbb['variableName']]){_0x18dd29['push']({'name':_0x4d6bbb[_0xf7bc('0x1d')],'value':_0x2029f3[_0x4d6bbb[_0xf7bc('0x1e')]]});}});}return request({'form':{'method':_0xf7bc('0x1f'),'input_type':'JSON','response_type':_0xf7bc('0x20'),'rest_data':JSON[_0xf7bc('0x21')]({'session':_0x26438f['id'],'module_name':'Calls','name_value_list':_0x18dd29})}});}function getAuth(_0xfd31d4){return util['format'](_0xf7bc('0x22'),new Buffer(_0xfd31d4[_0xf7bc('0x23')]+':X')[_0xf7bc('0x24')](_0xf7bc('0x25')));}function getServerInfo(_0x3fe9e1){return request({'form':{'method':_0xf7bc('0x26'),'input_type':_0xf7bc('0x20'),'response_type':_0xf7bc('0x20'),'rest_data':JSON[_0xf7bc('0x21')]({'session':_0x3fe9e1['id']})}});}function getUser(_0x498ba2,_0x4de1c1,_0x3420c6){if(!_[_0xf7bc('0x27')](_0x4de1c1)){logger[_0xf7bc('0xb')](_0xf7bc('0x28'),_0x4de1c1);return request({'form':{'method':'get_entry_list','input_type':_0xf7bc('0x20'),'response_type':'JSON','rest_data':JSON[_0xf7bc('0x21')]({'session':_0x3420c6['id'],'module_name':_0xf7bc('0x29'),'query':util[_0xf7bc('0x2a')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4de1c1),'order_by':'','offset':'0','select_fields':['id',_0xf7bc('0xd'),_0xf7bc('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7bc('0x2c')](function(_0x53c93f){if(_0x53c93f['entry_list']['length']){var _0x4aef63=_[_0xf7bc('0x2d')](_0x53c93f[_0xf7bc('0x2e')],function(_0xcec91){return _0xcec91[_0xf7bc('0x2f')][_0xf7bc('0x2b')]['value']===_0x4de1c1;});if(_0x4aef63){logger['info'](_0xf7bc('0x30'));return BPromise['resolve']({'id':_0x4aef63['name_value_list']['id'][_0xf7bc('0x31')],'name':_0x4aef63[_0xf7bc('0x2f')][_0xf7bc('0xd')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf7bc('0x32')]({'id':_0x3420c6[_0xf7bc('0x2f')]['user_id'][_0xf7bc('0x31')],'name':_0x3420c6[_0xf7bc('0x2f')]['user_name']['value']});});}else{logger[_0xf7bc('0xb')](_0xf7bc('0x33'));return BPromise[_0xf7bc('0x32')]({'id':_0x3420c6[_0xf7bc('0x2f')][_0xf7bc('0x34')]['value'],'name':_0x3420c6[_0xf7bc('0x2f')][_0xf7bc('0x2b')]['value']});}}function getEndUser(_0x4b766f,_0x1a0b2d,_0x10b715,_0x37bbfb){logger[_0xf7bc('0xb')](_0xf7bc('0x35'),_0x10b715);return request({'form':{'method':_0xf7bc('0x36'),'input_type':_0xf7bc('0x20'),'response_type':'JSON','rest_data':JSON[_0xf7bc('0x21')]({'session':_0x37bbfb['id'],'module_name':_0xf7bc('0x37'),'query':util[_0xf7bc('0x2a')](_0xf7bc('0x38'),_0x10b715),'order_by':'','offset':'0','select_fields':['id','name',_0xf7bc('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7bc('0x2c')](function(_0xffa63d){if(_0xffa63d[_0xf7bc('0x2e')][_0xf7bc('0x3a')]){var _0x1e1797=_[_0xf7bc('0x2d')](_0xffa63d[_0xf7bc('0x2e')],function(_0x58735d){return _0x58735d['name_value_list'][_0xf7bc('0x39')][_0xf7bc('0x31')]===_0x10b715;});if(_0x1e1797){logger[_0xf7bc('0xb')]('Enduser\x20found!');return BPromise[_0xf7bc('0x32')]({'id':_0x1e1797[_0xf7bc('0x2f')]['id'][_0xf7bc('0x31')],'name':_0x1e1797[_0xf7bc('0x2f')][_0xf7bc('0xd')][_0xf7bc('0x31')],'phone':_0x1e1797[_0xf7bc('0x2f')][_0xf7bc('0x39')][_0xf7bc('0x31')]});}}else{logger['info'](_0xf7bc('0x3b'));return request({'form':{'method':_0xf7bc('0x1f'),'input_type':_0xf7bc('0x20'),'response_type':'JSON','rest_data':JSON[_0xf7bc('0x21')]({'session':_0x37bbfb['id'],'module_name':_0xf7bc('0x37'),'name_value_list':[{'name':_0xf7bc('0x3c'),'value':_0x1a0b2d!==_0xf7bc('0x3d')?_0x1a0b2d:util[_0xf7bc('0x2a')](_0xf7bc('0x3e'),_0x10b715)},{'name':_0xf7bc('0x39'),'value':_0x10b715}]})}})[_0xf7bc('0x2c')](function(_0x27677a){logger[_0xf7bc('0xb')](_0xf7bc('0x3f'));return BPromise[_0xf7bc('0x32')]({'id':_0x27677a['id'],'name':_0x27677a[_0xf7bc('0x2e')][_0xf7bc('0x3c')][_0xf7bc('0x31')],'phone':_0x27677a[_0xf7bc('0x2e')][_0xf7bc('0x39')][_0xf7bc('0x31')]});});}});}function request(_0x2e3926){logger[_0xf7bc('0x40')](_0xf7bc('0x41'),JSON[_0xf7bc('0x21')](_0x2e3926));return rp(_['merge'](def,_0x2e3926));}function getTags(_0x355a11,_0x954ec9){var _0x425036=[];if(_0x355a11&&_0x355a11[_0xf7bc('0x3a')]>0x0){_0x425036=_[_0xf7bc('0x42')](_0x355a11,_0x954ec9);}return _0x425036;}function getCustomFields(_0x23ad29,_0x1c8987){var _0x2cd5b9=[];var _0x2fd07d={'custom_fields':[]};if(_0x23ad29[_0xf7bc('0x3a')]>0x0){_[_0xf7bc('0x1c')](_0x23ad29,function(_0x175f4f){if(_0x175f4f[_0xf7bc('0x43')]===_0xf7bc('0x44')&&_0x175f4f[_0xf7bc('0x45')]&&!_0x175f4f['customField']){_0x2fd07d[_0x175f4f[_0xf7bc('0x45')][_0xf7bc('0x46')]()]=_0x175f4f[_0xf7bc('0x47')][_0xf7bc('0x24')]();}else if(_0x175f4f[_0xf7bc('0x43')]===_0xf7bc('0x44')&&_0x175f4f[_0xf7bc('0x1d')]&&_0x175f4f[_0xf7bc('0x48')]){_0x2fd07d[_0xf7bc('0x49')][_0xf7bc('0x4a')]({'id':_0x175f4f[_0xf7bc('0x1d')],'value':_0x175f4f[_0xf7bc('0x47')][_0xf7bc('0x24')]()});}else if(_0x175f4f[_0xf7bc('0x43')]===_0xf7bc('0x4b')&&_0x175f4f[_0xf7bc('0x1e')]&&_0x175f4f['idField']&&_0x175f4f['customField']){_0x1c8987[_0x175f4f[_0xf7bc('0x1e')]]&&_0x2fd07d[_0xf7bc('0x49')][_0xf7bc('0x4a')]({'id':_0x175f4f[_0xf7bc('0x1d')],'value':_0x1c8987[_0x175f4f[_0xf7bc('0x1e')]][_0xf7bc('0x24')]()});}else if(_0x175f4f[_0xf7bc('0x43')]==='customVariable'&&_0x175f4f[_0xf7bc('0x4c')]&&_0x175f4f[_0xf7bc('0x4c')][_0xf7bc('0xd')]&&_0x175f4f[_0xf7bc('0x1d')]&&_0x175f4f[_0xf7bc('0x48')]){_0x1c8987[_0x175f4f[_0xf7bc('0x4c')][_0xf7bc('0xd')][_0xf7bc('0x46')]()]&&_0x2fd07d['custom_fields'][_0xf7bc('0x4a')]({'id':_0x175f4f[_0xf7bc('0x1d')],'value':_0x1c8987[_0x175f4f['Variable']['name']['toLowerCase']()][_0xf7bc('0x24')]()});}});}return _0x2fd07d;}function getConnection(_0x2bb0b2){return request({'method':'POST','form':{'method':_0xf7bc('0x4d'),'input_type':_0xf7bc('0x20'),'response_type':_0xf7bc('0x20'),'rest_data':JSON[_0xf7bc('0x21')]({'user_auth':{'user_name':_0x2bb0b2[_0xf7bc('0x4e')],'password':_0x2bb0b2[_0xf7bc('0x4f')],'encryption':_0xf7bc('0x50')},'application':_0xf7bc('0x51')})}})[_0xf7bc('0x2c')](function(_0x31c555){var _0x21a431=_0x31c555;if(_0x21a431['id']){def['sessionID']=_0x21a431['id'];return BPromise[_0xf7bc('0x32')](_0x21a431);}else{throw new Error(util[_0xf7bc('0x2a')]('Account\x20%d\x20is\x20not\x20valid',_0x2bb0b2['id']));}});}function setRelationship(_0x1fdb9e,_0x32ba09,_0x3bc952,_0x4c6127){return request({'form':{'method':_0xf7bc('0x52'),'input_type':_0xf7bc('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1fdb9e['id'],'module_name':_0xf7bc('0x53'),'module_id':_0x3bc952['id'],'link_field_name':_0x4c6127,'related_ids':[_0x32ba09['id']]})}});}exports[_0xf7bc('0x54')]=function(_0x3873e7,_0x305d1b,_0x548c76,_0x18d097,_0x415f26,_0x4cd441){var _0x519460,_0x37c360,_0x4c2de8,_0xbab098;_0x4cd441[_0xf7bc('0x55')]=intUtil['stripTrailingSlash'](_0x4cd441[_0xf7bc('0x55')]);_0x4cd441[_0xf7bc('0x56')]=intUtil[_0xf7bc('0x57')](_0x4cd441[_0xf7bc('0x56')]);def['uri']=util[_0xf7bc('0x2a')](_0xf7bc('0x58'),_0x4cd441[_0xf7bc('0x55')]);if(_0x415f26&&_0x415f26[_0xf7bc('0x59')]){logger['info']('[QUEUE]',_0xf7bc('0x5a'));_0x305d1b['recordingURL']=util[_0xf7bc('0x2a')](_0xf7bc('0x5b'),_0x4cd441[_0xf7bc('0x56')],_0x305d1b[_0xf7bc('0x5c')],md5(_0x305d1b[_0xf7bc('0x5c')]));}else{_0x305d1b['recordingURL']='';}return getConnection(_0x4cd441)[_0xf7bc('0x2c')](function(_0x57a07d){_0xbab098=_0x57a07d;return getUser(_0x4cd441,_0x18d097[_0xf7bc('0xd')],_0xbab098);})[_0xf7bc('0x2c')](function(_0x56252f){_0x519460=_0x56252f;logger['info'](_0xf7bc('0x5d'),_0x519460['id']);return getEndUser(_0x4cd441,_0x305d1b['calleridname'],_0x305d1b['calleridnum'],_0xbab098);})['then'](function(_0xed77a6){_0x37c360=_0xed77a6;logger[_0xf7bc('0xb')]('The\x20Enduser\x20ID\x20is:',_0x37c360['id']);return getTicket(_0x4cd441,_0x519460,_0x37c360,_0x548c76,_0x305d1b,_0x548c76[_0xf7bc('0x5e')],_0xbab098,_0xf7bc('0x5f'));})[_0xf7bc('0x2c')](function(_0x5d077){_0x4c2de8=_0x5d077;logger[_0xf7bc('0xb')](_0xf7bc('0x60'));logger[_0xf7bc('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4c2de8['id']);return setRelationship(_0xbab098,_0x519460,_0x4c2de8,_0xf7bc('0x61'));})[_0xf7bc('0x2c')](function(){return setRelationship(_0xbab098,_0x37c360,_0x4c2de8,'contacts');})[_0xf7bc('0x2c')](function(){return getServerInfo(_0xbab098);})[_0xf7bc('0x2c')](function(_0x839ce2){var _0x3e8b71=parseInt(_0x839ce2[_0xf7bc('0x62')][_0xf7bc('0x63')](0x0));var _0x23d7f6=util[_0xf7bc('0x2a')](_0xf7bc('0x64'),_0x4cd441['remoteUri'],_0x4c2de8['id']);if(_0x3e8b71>0x6){_0x23d7f6=util['format'](_0xf7bc('0x65'),_0x4cd441[_0xf7bc('0x55')],_0x4c2de8['id']);}logger[_0xf7bc('0xb')](_0xf7bc('0x66'),_0xf7bc('0x67'));emit(util[_0xf7bc('0x2a')](_0xf7bc('0x68'),_0x18d097[_0xf7bc('0xd')]),_0xf7bc('0x69'),{'uri':_0x23d7f6});})[_0xf7bc('0x6a')](function(_0x1a6d33){logger['error']('[QUEUE]',JSON[_0xf7bc('0x21')](_0x1a6d33));});};exports[_0xf7bc('0x6b')]=function(_0x435f7f,_0x3204c6,_0x2e86e5,_0x151419,_0x338a38,_0x431bf3,_0x18e974){var _0x13a04b,_0x55a9eb,_0x59cc10,_0x482d50;_0x431bf3[_0xf7bc('0x55')]=intUtil['stripTrailingSlash'](_0x431bf3[_0xf7bc('0x55')]);_0x431bf3[_0xf7bc('0x56')]=intUtil[_0xf7bc('0x57')](_0x431bf3['serverUrl']);def[_0xf7bc('0x6c')]=util[_0xf7bc('0x2a')](_0xf7bc('0x58'),_0x431bf3['remoteUri']);if(_0x18e974&&_0x18e974[_0xf7bc('0x6d')]&&_0x18e974['recordingFormat']!==_0xf7bc('0x6e')){logger['info'](_0xf7bc('0x6f'),_0xf7bc('0x5a'));_0x3204c6[_0xf7bc('0x70')]=util[_0xf7bc('0x2a')](_0xf7bc('0x5b'),_0x431bf3['serverUrl'],_0x3204c6['uniqueid'],md5(_0x3204c6[_0xf7bc('0x5c')]));}return getConnection(_0x431bf3)[_0xf7bc('0x2c')](function(_0xb3334f){_0x482d50=_0xb3334f;return getUser(_0x431bf3,_0x151419[_0xf7bc('0xd')],_0x482d50);})[_0xf7bc('0x2c')](function(_0x1cf2e9){_0x13a04b=_0x1cf2e9;logger[_0xf7bc('0xb')](_0xf7bc('0x5d'),_0x13a04b['id']);return getEndUser(_0x431bf3,_0x3204c6['destcalleridname'],_0x3204c6[_0xf7bc('0x71')],_0x482d50);})['then'](function(_0x1247f2){_0x55a9eb=_0x1247f2;logger[_0xf7bc('0xb')](_0xf7bc('0x72'),_0x55a9eb['id']);return getTicket(_0x431bf3,_0x13a04b,_0x55a9eb,_0x2e86e5,_0x3204c6,_0x2e86e5['Fields'],_0x482d50,'Outbound');})[_0xf7bc('0x2c')](function(_0x4a509d){_0x59cc10=_0x4a509d;logger[_0xf7bc('0xb')](_0xf7bc('0x60'));logger[_0xf7bc('0xb')](_0xf7bc('0x73'),_0x59cc10['id']);return setRelationship(_0x482d50,_0x13a04b,_0x59cc10,_0xf7bc('0x61'));})[_0xf7bc('0x2c')](function(){return setRelationship(_0x482d50,_0x55a9eb,_0x59cc10,'contacts');})[_0xf7bc('0x2c')](function(){return getServerInfo(_0x482d50);})[_0xf7bc('0x2c')](function(_0x45b745){var _0x403259=parseInt(_0x45b745[_0xf7bc('0x62')][_0xf7bc('0x63')](0x0));var _0xf1aa35=util[_0xf7bc('0x2a')](_0xf7bc('0x64'),_0x431bf3['remoteUri'],_0x59cc10['id']);if(_0x403259>0x6){_0xf1aa35=util[_0xf7bc('0x2a')](_0xf7bc('0x65'),_0x431bf3[_0xf7bc('0x55')],_0x59cc10['id']);}logger[_0xf7bc('0xb')](_0xf7bc('0x6f'),_0xf7bc('0x67'));emit(util['format'](_0xf7bc('0x68'),_0x151419[_0xf7bc('0xd')]),_0xf7bc('0x69'),{'uri':_0xf1aa35});})[_0xf7bc('0x6a')](function(_0x592372){logger[_0xf7bc('0x74')](_0xf7bc('0x6f'),JSON[_0xf7bc('0x21')](_0x592372));});};exports['abandoned']=function(_0x12fe66,_0x4de0cc,_0x54e00e,_0x2a9cc6,_0x1ca311,_0xcb54f9){var _0x25d029,_0x277db7,_0x4480d8,_0x4e1e42;_0xcb54f9[_0xf7bc('0x55')]=intUtil[_0xf7bc('0x57')](_0xcb54f9['remoteUri']);_0xcb54f9[_0xf7bc('0x56')]=intUtil[_0xf7bc('0x57')](_0xcb54f9['serverUrl']);def[_0xf7bc('0x6c')]=util['format'](_0xf7bc('0x58'),_0xcb54f9[_0xf7bc('0x55')]);if(_0x1ca311&&_0x1ca311['monitor_format']){logger['info'](_0xf7bc('0x75'),_0xf7bc('0x5a'));_0x4de0cc[_0xf7bc('0x70')]=util['format'](_0xf7bc('0x5b'),_0xcb54f9['serverUrl'],_0x4de0cc[_0xf7bc('0x5c')],md5(_0x4de0cc[_0xf7bc('0x5c')]));}else{_0x4de0cc[_0xf7bc('0x70')]='';}return getConnection(_0xcb54f9)['then'](function(_0x2abd22){_0x4e1e42=_0x2abd22;if(!_[_0xf7bc('0x27')](_0x2a9cc6)){return getUser(_0xcb54f9,_0x2a9cc6['name'],_0x4e1e42);}else{return getUser(_0xcb54f9,null,_0x4e1e42);}})[_0xf7bc('0x2c')](function(_0x3949f1){_0x25d029=_0x3949f1;logger[_0xf7bc('0xb')](_0xf7bc('0x5d'),_0x25d029['id']);return getEndUser(_0xcb54f9,_0x4de0cc[_0xf7bc('0x76')],_0x4de0cc[_0xf7bc('0x77')],_0x4e1e42);})[_0xf7bc('0x2c')](function(_0x5957de){_0x277db7=_0x5957de;logger['info'](_0xf7bc('0x72'),_0x277db7['id']);return getTicket(_0xcb54f9,_0x25d029,_0x277db7,_0x54e00e,_0x4de0cc,_0x54e00e[_0xf7bc('0x5e')],_0x4e1e42,'Inbound');})[_0xf7bc('0x2c')](function(_0x4e6b9a){_0x4480d8=_0x4e6b9a;logger[_0xf7bc('0xb')]('Ticket\x20created!');logger[_0xf7bc('0xb')](_0xf7bc('0x73'),_0x4480d8['id']);return setRelationship(_0x4e1e42,_0x25d029,_0x4480d8,_0xf7bc('0x61'));})['then'](function(){return setRelationship(_0x4e1e42,_0x277db7,_0x4480d8,'contacts');})[_0xf7bc('0x2c')](function(){return getServerInfo(_0x4e1e42);})[_0xf7bc('0x6a')](function(_0x198f6d){logger[_0xf7bc('0x74')]('[ABANDONED]',JSON[_0xf7bc('0x21')](_0x198f6d));});}; \ No newline at end of file +var _0x4a01=['entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','debug','map','string','nameField','toLowerCase','customField','content','custom_fields','type','customVariable','Variable','login','username','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','abandoned','[ABANDONED]','isNil','lodash','request-promise','bluebird','util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','apiKey','toString','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find'];(function(_0x527bdf,_0x20bd3a){var _0x33abdf=function(_0x415366){while(--_0x415366){_0x527bdf['push'](_0x527bdf['shift']());}};_0x33abdf(++_0x20bd3a);}(_0x4a01,0xb6));var _0x14a0=function(_0x2a9cc2,_0xea7e96){_0x2a9cc2=_0x2a9cc2-0x0;var _0x159edd=_0x4a01[_0x2a9cc2];return _0x159edd;};'use strict';var _=require(_0x14a0('0x0'));var rp=require(_0x14a0('0x1'));var BPromise=require(_0x14a0('0x2'));var md5=require('md5');var util=require(_0x14a0('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x14a0('0x4'));var logger=require(_0x14a0('0x5'))('sugarcrm');config[_0x14a0('0x6')]=_[_0x14a0('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x14a0('0x8'))(new Redis(config[_0x14a0('0x6')]));var def={'method':_0x14a0('0x9'),'json':!![]};function emit(_0x32ef5d,_0x247ac1,_0xdfbf2){io['to'](_0x32ef5d)[_0x14a0('0xa')](_0x247ac1,_0xdfbf2);}function getTicket(_0x1be6ba,_0xd2932f,_0x263af2,_0x4f10f6,_0x2e13ec,_0x5a7235,_0xf592e1,_0x2aa506){logger[_0x14a0('0xb')](_0x14a0('0xc'));var _0x2196d8=new Date();var _0xc4b501=[{'name':_0x14a0('0xd'),'value':intUtil['getString'](_0x4f10f6['Subjects'],_0x2e13ec,'\x20')},{'name':_0x14a0('0xe'),'value':_0xd2932f['id']},{'name':_0x14a0('0xf'),'value':_0xd2932f['id']},{'name':_0x14a0('0x10'),'value':intUtil[_0x14a0('0x11')](_0x4f10f6[_0x14a0('0x12')],_0x2e13ec,'\x0a')},{'name':_0x14a0('0x13'),'value':_0x2196d8[_0x14a0('0x14')]()['slice'](0x0,0x13)[_0x14a0('0x15')]('T','\x20')},{'name':_0x14a0('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x14a0('0x17'),'value':_0x263af2['id']},{'name':_0x14a0('0x18'),'value':_0x14a0('0x19')},{'name':_0x14a0('0x1a'),'value':_0x263af2[_0x14a0('0xd')]},{'name':_0x14a0('0x1b'),'value':_0x2aa506}];if(_0x5a7235[_0x14a0('0x1c')]){_[_0x14a0('0x1d')](_0x5a7235,function(_0x54108f){if(_0x2e13ec[_0x54108f[_0x14a0('0x1e')]]){_0xc4b501[_0x14a0('0x1f')]({'name':_0x54108f[_0x14a0('0x20')],'value':_0x2e13ec[_0x54108f[_0x14a0('0x1e')]]});}});}return request({'form':{'method':_0x14a0('0x21'),'input_type':_0x14a0('0x22'),'response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0xf592e1['id'],'module_name':'Calls','name_value_list':_0xc4b501})}});}function getAuth(_0x536ab3){return util[_0x14a0('0x24')]('Basic\x20%s',new Buffer(_0x536ab3[_0x14a0('0x25')]+':X')[_0x14a0('0x26')]('base64'));}function getServerInfo(_0x2305ce){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0x2305ce['id']})}});}function getUser(_0x180bba,_0x47b70f,_0x1a2ea0){if(!_['isNil'](_0x47b70f)){logger[_0x14a0('0xb')](_0x14a0('0x27'),_0x47b70f);return request({'form':{'method':_0x14a0('0x28'),'input_type':'JSON','response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0x1a2ea0['id'],'module_name':_0x14a0('0x29'),'query':util[_0x14a0('0x24')](_0x14a0('0x2a'),_0x47b70f),'order_by':'','offset':'0','select_fields':['id',_0x14a0('0xd'),_0x14a0('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x14a0('0x2c')](function(_0x1c709f){if(_0x1c709f['entry_list'][_0x14a0('0x1c')]){var _0xc8f282=_[_0x14a0('0x2d')](_0x1c709f[_0x14a0('0x2e')],function(_0x5d348a){return _0x5d348a[_0x14a0('0x2f')][_0x14a0('0x2b')][_0x14a0('0x30')]===_0x47b70f;});if(_0xc8f282){logger[_0x14a0('0xb')]('Agent\x20found!');return BPromise[_0x14a0('0x31')]({'id':_0xc8f282[_0x14a0('0x2f')]['id'][_0x14a0('0x30')],'name':_0xc8f282[_0x14a0('0x2f')][_0x14a0('0xd')]['value']});}}logger[_0x14a0('0xb')](_0x14a0('0x32'));return BPromise['resolve']({'id':_0x1a2ea0[_0x14a0('0x2f')]['user_id'][_0x14a0('0x30')],'name':_0x1a2ea0[_0x14a0('0x2f')]['user_name'][_0x14a0('0x30')]});});}else{logger[_0x14a0('0xb')](_0x14a0('0x33'));return BPromise['resolve']({'id':_0x1a2ea0[_0x14a0('0x2f')]['user_id'][_0x14a0('0x30')],'name':_0x1a2ea0[_0x14a0('0x2f')][_0x14a0('0x2b')][_0x14a0('0x30')]});}}function getEndUser(_0x23293b,_0x590ce0,_0x1eb5c8,_0xa23581){logger['info'](_0x14a0('0x34'),_0x1eb5c8);return request({'form':{'method':_0x14a0('0x28'),'input_type':_0x14a0('0x22'),'response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0xa23581['id'],'module_name':_0x14a0('0x19'),'query':util[_0x14a0('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1eb5c8),'order_by':'','offset':'0','select_fields':['id',_0x14a0('0xd'),_0x14a0('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x14a0('0x2c')](function(_0x2b1053){if(_0x2b1053['entry_list'][_0x14a0('0x1c')]){var _0x4304d9=_[_0x14a0('0x2d')](_0x2b1053[_0x14a0('0x2e')],function(_0x5a0834){return _0x5a0834['name_value_list'][_0x14a0('0x35')]['value']===_0x1eb5c8;});if(_0x4304d9){logger[_0x14a0('0xb')](_0x14a0('0x36'));return BPromise['resolve']({'id':_0x4304d9[_0x14a0('0x2f')]['id']['value'],'name':_0x4304d9[_0x14a0('0x2f')][_0x14a0('0xd')][_0x14a0('0x30')],'phone':_0x4304d9[_0x14a0('0x2f')][_0x14a0('0x35')][_0x14a0('0x30')]});}}else{logger[_0x14a0('0xb')](_0x14a0('0x37'));return request({'form':{'method':_0x14a0('0x21'),'input_type':'JSON','response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0xa23581['id'],'module_name':_0x14a0('0x19'),'name_value_list':[{'name':_0x14a0('0x38'),'value':_0x590ce0!==''?_0x590ce0:util[_0x14a0('0x24')]('Caller\x20-\x20%s',_0x1eb5c8)},{'name':_0x14a0('0x35'),'value':_0x1eb5c8}]})}})[_0x14a0('0x2c')](function(_0x5bf1ae){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x5bf1ae['id'],'name':_0x5bf1ae['entry_list'][_0x14a0('0x38')][_0x14a0('0x30')],'phone':_0x5bf1ae[_0x14a0('0x2e')][_0x14a0('0x35')][_0x14a0('0x30')]});});}});}function request(_0x2d2217){logger[_0x14a0('0x39')]('[HTTP]',JSON[_0x14a0('0x23')](_0x2d2217));return rp(_['merge'](def,_0x2d2217));}function getTags(_0x56fef6,_0x3275ca){var _0x1611e1=[];if(_0x56fef6&&_0x56fef6[_0x14a0('0x1c')]>0x0){_0x1611e1=_[_0x14a0('0x3a')](_0x56fef6,_0x3275ca);}return _0x1611e1;}function getCustomFields(_0x3bcd69,_0xb3df48){var _0x3cf407=[];var _0x2e1979={'custom_fields':[]};if(_0x3bcd69[_0x14a0('0x1c')]>0x0){_[_0x14a0('0x1d')](_0x3bcd69,function(_0x47ec47){if(_0x47ec47['type']===_0x14a0('0x3b')&&_0x47ec47[_0x14a0('0x3c')]&&!_0x47ec47['customField']){_0x2e1979[_0x47ec47[_0x14a0('0x3c')][_0x14a0('0x3d')]()]=_0x47ec47['content'][_0x14a0('0x26')]();}else if(_0x47ec47['type']===_0x14a0('0x3b')&&_0x47ec47[_0x14a0('0x20')]&&_0x47ec47[_0x14a0('0x3e')]){_0x2e1979['custom_fields'][_0x14a0('0x1f')]({'id':_0x47ec47[_0x14a0('0x20')],'value':_0x47ec47[_0x14a0('0x3f')][_0x14a0('0x26')]()});}else if(_0x47ec47['type']==='variable'&&_0x47ec47['variableName']&&_0x47ec47[_0x14a0('0x20')]&&_0x47ec47[_0x14a0('0x3e')]){_0xb3df48[_0x47ec47['variableName']]&&_0x2e1979[_0x14a0('0x40')][_0x14a0('0x1f')]({'id':_0x47ec47[_0x14a0('0x20')],'value':_0xb3df48[_0x47ec47[_0x14a0('0x1e')]][_0x14a0('0x26')]()});}else if(_0x47ec47[_0x14a0('0x41')]===_0x14a0('0x42')&&_0x47ec47['Variable']&&_0x47ec47['Variable'][_0x14a0('0xd')]&&_0x47ec47['idField']&&_0x47ec47[_0x14a0('0x3e')]){_0xb3df48[_0x47ec47[_0x14a0('0x43')]['name']['toLowerCase']()]&&_0x2e1979[_0x14a0('0x40')][_0x14a0('0x1f')]({'id':_0x47ec47[_0x14a0('0x20')],'value':_0xb3df48[_0x47ec47['Variable'][_0x14a0('0xd')][_0x14a0('0x3d')]()][_0x14a0('0x26')]()});}});}return _0x2e1979;}function getConnection(_0xb893a6){return request({'method':_0x14a0('0x9'),'form':{'method':_0x14a0('0x44'),'input_type':_0x14a0('0x22'),'response_type':'JSON','rest_data':JSON[_0x14a0('0x23')]({'user_auth':{'user_name':_0xb893a6[_0x14a0('0x45')],'password':_0xb893a6['password'],'encryption':_0x14a0('0x46')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x3368bf){var _0x4cc1ce=_0x3368bf;if(_0x4cc1ce['id']){def['sessionID']=_0x4cc1ce['id'];return BPromise[_0x14a0('0x31')](_0x4cc1ce);}else{throw new Error(util[_0x14a0('0x24')](_0x14a0('0x47'),_0xb893a6['id']));}});}function setRelationship(_0x16ea69,_0x3da7af,_0x5d4173,_0x3871ab){return request({'form':{'method':_0x14a0('0x48'),'input_type':_0x14a0('0x22'),'response_type':_0x14a0('0x22'),'rest_data':JSON[_0x14a0('0x23')]({'session':_0x16ea69['id'],'module_name':_0x14a0('0x49'),'module_id':_0x5d4173['id'],'link_field_name':_0x3871ab,'related_ids':[_0x3da7af['id']]})}});}exports[_0x14a0('0x4a')]=function(_0x49a4a8,_0x38d0ee,_0x5b3fcc,_0xb07ede,_0x5cc34d,_0x368e01){var _0x45f14e,_0x439700,_0x5d19cc,_0x24796f;_0x368e01[_0x14a0('0x4b')]=intUtil['stripTrailingSlash'](_0x368e01['remoteUri']);_0x368e01[_0x14a0('0x4c')]=intUtil[_0x14a0('0x4d')](_0x368e01[_0x14a0('0x4c')]);def[_0x14a0('0x4e')]=util['format'](_0x14a0('0x4f'),_0x368e01[_0x14a0('0x4b')]);if(_0x5cc34d&&_0x5cc34d[_0x14a0('0x50')]){logger[_0x14a0('0xb')](_0x14a0('0x51'),'Recording\x20is\x20enabled!');_0x38d0ee[_0x14a0('0x52')]=util[_0x14a0('0x24')](_0x14a0('0x53'),_0x368e01[_0x14a0('0x4c')],_0x38d0ee['uniqueid'],md5(_0x38d0ee[_0x14a0('0x54')]));}else{_0x38d0ee[_0x14a0('0x52')]='';}return getConnection(_0x368e01)[_0x14a0('0x2c')](function(_0x27cfae){_0x24796f=_0x27cfae;return getUser(_0x368e01,_0xb07ede[_0x14a0('0xd')],_0x24796f);})[_0x14a0('0x2c')](function(_0x4249fd){_0x45f14e=_0x4249fd;logger[_0x14a0('0xb')]('The\x20User\x20ID\x20is:',_0x45f14e['id']);return getEndUser(_0x368e01,_0x38d0ee[_0x14a0('0x55')],_0x38d0ee[_0x14a0('0x56')],_0x24796f);})['then'](function(_0x41df83){_0x439700=_0x41df83;logger[_0x14a0('0xb')]('The\x20Enduser\x20ID\x20is:',_0x439700['id']);return getTicket(_0x368e01,_0x45f14e,_0x439700,_0x5b3fcc,_0x38d0ee,_0x5b3fcc[_0x14a0('0x57')],_0x24796f,_0x14a0('0x58'));})['then'](function(_0x421e26){_0x5d19cc=_0x421e26;logger[_0x14a0('0xb')](_0x14a0('0x59'));logger[_0x14a0('0xb')](_0x14a0('0x5a'),_0x5d19cc['id']);return setRelationship(_0x24796f,_0x45f14e,_0x5d19cc,_0x14a0('0x5b'));})['then'](function(){return setRelationship(_0x24796f,_0x439700,_0x5d19cc,_0x14a0('0x5c'));})['then'](function(){return getServerInfo(_0x24796f);})['then'](function(_0x428f3a){var _0x28d37c=parseInt(_0x428f3a[_0x14a0('0x5d')]['charAt'](0x0));var _0x42cf6e=util[_0x14a0('0x24')](_0x14a0('0x5e'),_0x368e01[_0x14a0('0x4b')],_0x5d19cc['id']);if(_0x28d37c>0x6){_0x42cf6e=util[_0x14a0('0x24')](_0x14a0('0x5f'),_0x368e01[_0x14a0('0x4b')],_0x5d19cc['id']);}logger[_0x14a0('0xb')](_0x14a0('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x14a0('0x24')](_0x14a0('0x60'),_0xb07ede[_0x14a0('0xd')]),_0x14a0('0x61'),{'uri':_0x42cf6e});})[_0x14a0('0x62')](function(_0x427063){logger['error'](_0x14a0('0x51'),JSON['stringify'](_0x427063));});};exports['outbound']=function(_0x36ca70,_0x4ad51a,_0x29902a,_0x4f2082,_0x3ea0aa,_0x40df3f,_0x4e32b0){var _0x493bec,_0x1dab78,_0x29c18b,_0x5f7f53;_0x40df3f[_0x14a0('0x4b')]=intUtil[_0x14a0('0x4d')](_0x40df3f[_0x14a0('0x4b')]);_0x40df3f[_0x14a0('0x4c')]=intUtil['stripTrailingSlash'](_0x40df3f[_0x14a0('0x4c')]);def[_0x14a0('0x4e')]=util[_0x14a0('0x24')](_0x14a0('0x4f'),_0x40df3f[_0x14a0('0x4b')]);if(_0x4e32b0&&_0x4e32b0[_0x14a0('0x63')]&&_0x4e32b0[_0x14a0('0x63')]!==_0x14a0('0x64')){logger[_0x14a0('0xb')](_0x14a0('0x65'),_0x14a0('0x66'));_0x4ad51a['recordingURL']=util['format'](_0x14a0('0x53'),_0x40df3f[_0x14a0('0x4c')],_0x4ad51a[_0x14a0('0x54')],md5(_0x4ad51a['uniqueid']));}return getConnection(_0x40df3f)[_0x14a0('0x2c')](function(_0x5e6a37){_0x5f7f53=_0x5e6a37;return getUser(_0x40df3f,_0x4f2082[_0x14a0('0xd')],_0x5f7f53);})[_0x14a0('0x2c')](function(_0x553e0b){_0x493bec=_0x553e0b;logger[_0x14a0('0xb')](_0x14a0('0x67'),_0x493bec['id']);return getEndUser(_0x40df3f,_0x4ad51a[_0x14a0('0x68')],_0x4ad51a[_0x14a0('0x69')],_0x5f7f53);})[_0x14a0('0x2c')](function(_0xcd8aa1){_0x1dab78=_0xcd8aa1;logger[_0x14a0('0xb')](_0x14a0('0x6a'),_0x1dab78['id']);return getTicket(_0x40df3f,_0x493bec,_0x1dab78,_0x29902a,_0x4ad51a,_0x29902a[_0x14a0('0x57')],_0x5f7f53,_0x14a0('0x6b'));})['then'](function(_0x3057c5){_0x29c18b=_0x3057c5;logger['info'](_0x14a0('0x59'));logger[_0x14a0('0xb')](_0x14a0('0x5a'),_0x29c18b['id']);return setRelationship(_0x5f7f53,_0x493bec,_0x29c18b,_0x14a0('0x5b'));})[_0x14a0('0x2c')](function(){return setRelationship(_0x5f7f53,_0x1dab78,_0x29c18b,_0x14a0('0x5c'));})[_0x14a0('0x2c')](function(){return getServerInfo(_0x5f7f53);})[_0x14a0('0x2c')](function(_0x49ea73){var _0x4ec34d=parseInt(_0x49ea73[_0x14a0('0x5d')][_0x14a0('0x6c')](0x0));var _0x38d8cf=util[_0x14a0('0x24')](_0x14a0('0x5e'),_0x40df3f[_0x14a0('0x4b')],_0x29c18b['id']);if(_0x4ec34d>0x6){_0x38d8cf=util[_0x14a0('0x24')](_0x14a0('0x5f'),_0x40df3f[_0x14a0('0x4b')],_0x29c18b['id']);}logger[_0x14a0('0xb')](_0x14a0('0x65'),_0x14a0('0x6d'));emit(util[_0x14a0('0x24')]('user:%s',_0x4f2082['name']),_0x14a0('0x61'),{'uri':_0x38d8cf});})[_0x14a0('0x62')](function(_0x30e755){logger[_0x14a0('0x6e')](_0x14a0('0x65'),JSON[_0x14a0('0x23')](_0x30e755));});};exports[_0x14a0('0x6f')]=function(_0x567f93,_0x204839,_0x21b499,_0x377bd0,_0x3341b9,_0x371f7f){var _0x4568b6,_0x4c9c73,_0x19a1c8,_0x52b56e;_0x371f7f[_0x14a0('0x4b')]=intUtil[_0x14a0('0x4d')](_0x371f7f['remoteUri']);_0x371f7f[_0x14a0('0x4c')]=intUtil[_0x14a0('0x4d')](_0x371f7f['serverUrl']);def[_0x14a0('0x4e')]=util[_0x14a0('0x24')](_0x14a0('0x4f'),_0x371f7f['remoteUri']);if(_0x3341b9&&_0x3341b9[_0x14a0('0x50')]){logger['info'](_0x14a0('0x70'),_0x14a0('0x66'));_0x204839[_0x14a0('0x52')]=util['format'](_0x14a0('0x53'),_0x371f7f[_0x14a0('0x4c')],_0x204839[_0x14a0('0x54')],md5(_0x204839[_0x14a0('0x54')]));}else{_0x204839[_0x14a0('0x52')]='';}return getConnection(_0x371f7f)[_0x14a0('0x2c')](function(_0x147b7f){_0x52b56e=_0x147b7f;if(!_[_0x14a0('0x71')](_0x377bd0)){return getUser(_0x371f7f,_0x377bd0[_0x14a0('0xd')],_0x52b56e);}else{return getUser(_0x371f7f,null,_0x52b56e);}})[_0x14a0('0x2c')](function(_0x45f38b){_0x4568b6=_0x45f38b;logger['info']('The\x20User\x20ID\x20is:',_0x4568b6['id']);return getEndUser(_0x371f7f,_0x204839[_0x14a0('0x55')],_0x204839[_0x14a0('0x56')],_0x52b56e);})[_0x14a0('0x2c')](function(_0xaf87d5){_0x4c9c73=_0xaf87d5;logger['info'](_0x14a0('0x6a'),_0x4c9c73['id']);return getTicket(_0x371f7f,_0x4568b6,_0x4c9c73,_0x21b499,_0x204839,_0x21b499['Fields'],_0x52b56e,_0x14a0('0x58'));})[_0x14a0('0x2c')](function(_0x2c9166){_0x19a1c8=_0x2c9166;logger[_0x14a0('0xb')](_0x14a0('0x59'));logger[_0x14a0('0xb')]('The\x20Ticket\x20ID\x20is:',_0x19a1c8['id']);return setRelationship(_0x52b56e,_0x4568b6,_0x19a1c8,_0x14a0('0x5b'));})[_0x14a0('0x2c')](function(){return setRelationship(_0x52b56e,_0x4c9c73,_0x19a1c8,'contacts');})[_0x14a0('0x2c')](function(){return getServerInfo(_0x52b56e);})[_0x14a0('0x62')](function(_0x3c6538){logger[_0x14a0('0x6e')](_0x14a0('0x70'),JSON[_0x14a0('0x23')](_0x3c6538));});}; \ 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 c502237..1bbfd2e 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 _0x64f4=['substring','validateEmail','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','keyContent','%s:\x20%s','keyType','stripTrailingSlash','slice'];(function(_0x370627,_0x2ba63d){var _0x391d54=function(_0x254205){while(--_0x254205){_0x370627['push'](_0x370627['shift']());}};_0x391d54(++_0x2ba63d);}(_0x64f4,0x162));var _0x464f=function(_0x313e8e,_0x4b36fa){_0x313e8e=_0x313e8e-0x0;var _0x1433cf=_0x64f4[_0x313e8e];return _0x1433cf;};'use strict';var _=require(_0x464f('0x0'));var util=require(_0x464f('0x1'));exports[_0x464f('0x2')]=function(_0x2fd170,_0x39a831,_0x26e371){var _0x588c4c=[];if(_0x2fd170[_0x464f('0x3')]>0x0){var _0x57cbc9=_[_0x464f('0x4')](_0x2fd170,['id']);for(var _0x37cb26=0x0;_0x37cb26<_0x57cbc9[_0x464f('0x3')];_0x37cb26++){var _0x25f15c=_0x57cbc9[_0x37cb26];if(_0x25f15c[_0x464f('0x5')]===_0x464f('0x6')){_0x588c4c[_0x464f('0x7')](_0x25f15c[_0x464f('0x8')]);}else if(_0x25f15c[_0x464f('0x5')]===_0x464f('0x9')&&_0x25f15c[_0x464f('0xa')]){_0x39a831[_0x25f15c[_0x464f('0xa')]]&&_0x588c4c[_0x464f('0x7')](_0x39a831[_0x25f15c[_0x464f('0xa')]][_0x464f('0xb')]());}else if(_0x25f15c[_0x464f('0x5')]===_0x464f('0xc')&&_0x25f15c[_0x464f('0xd')]&&_0x25f15c[_0x464f('0xd')][_0x464f('0xe')]){_0x39a831[_0x25f15c[_0x464f('0xd')]['name'][_0x464f('0xf')]()]&&_0x588c4c[_0x464f('0x7')](_0x39a831[_0x25f15c['Variable'][_0x464f('0xe')][_0x464f('0xf')]()][_0x464f('0xb')]());}else if(_0x25f15c['type']===_0x464f('0x10')){if(_0x25f15c['keyType']===_0x464f('0x6')&&_0x25f15c[_0x464f('0x11')]){_0x588c4c[_0x464f('0x7')](util[_0x464f('0x12')]('%s:\x20%s',_0x25f15c[_0x464f('0x11')],_0x25f15c[_0x464f('0x13')]));}else if(_0x25f15c['keyType']==='variable'&&_0x25f15c[_0x464f('0xa')]&&_0x25f15c[_0x464f('0x11')]){_0x39a831[_0x25f15c[_0x464f('0xa')]]&&_0x588c4c[_0x464f('0x7')](util[_0x464f('0x12')](_0x464f('0x14'),_0x25f15c['key'],_0x39a831[_0x25f15c[_0x464f('0xa')]]));}else if(_0x25f15c[_0x464f('0x15')]===_0x464f('0xc')&&_0x25f15c[_0x464f('0xd')]&&_0x25f15c['Variable'][_0x464f('0xe')]&&_0x25f15c[_0x464f('0x11')]){_0x39a831[_0x25f15c[_0x464f('0xd')][_0x464f('0xe')][_0x464f('0xf')]()]&&_0x588c4c['push'](util['format'](_0x464f('0x14'),_0x25f15c[_0x464f('0x11')],_0x39a831[_0x25f15c[_0x464f('0xd')][_0x464f('0xe')][_0x464f('0xf')]()]));}}}}return _0x588c4c['join'](_0x26e371);};exports[_0x464f('0x16')]=function(_0x5e8f18){var _0x2b05d4=_0x5e8f18[_0x464f('0x17')](-0x1);if(_0x2b05d4==='/'){_0x5e8f18=_0x5e8f18[_0x464f('0x18')](0x0,_0x5e8f18['lastIndexOf'](_0x2b05d4));}return _0x5e8f18;};exports[_0x464f('0x19')]=function(_0x460b57){if(!_['isNil'](_0x460b57)&&_0x460b57!==''){var _0x34243d=/^(([^<>()\[\]\\.,;:\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 _0x34243d[_0x464f('0x1a')](String(_0x460b57)[_0x464f('0xf')]());}else{return![];}}; \ No newline at end of file +var _0xf66a=['stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','getString','sortBy','length','type','string','push','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','join'];(function(_0x57652d,_0x110630){var _0x44b82f=function(_0x26cfd9){while(--_0x26cfd9){_0x57652d['push'](_0x57652d['shift']());}};_0x44b82f(++_0x110630);}(_0xf66a,0x1e0));var _0xaf66=function(_0x2f0ce9,_0x57023a){_0x2f0ce9=_0x2f0ce9-0x0;var _0x4fdf79=_0xf66a[_0x2f0ce9];return _0x4fdf79;};'use strict';var _=require(_0xaf66('0x0'));var util=require('util');exports[_0xaf66('0x1')]=function(_0x503ff7,_0x46a4d9,_0x456602){var _0x252342=[];if(_0x503ff7['length']>0x0){var _0x5569ae=_[_0xaf66('0x2')](_0x503ff7,['id']);for(var _0x26f340=0x0;_0x26f340<_0x5569ae[_0xaf66('0x3')];_0x26f340++){var _0x443180=_0x5569ae[_0x26f340];if(_0x443180[_0xaf66('0x4')]===_0xaf66('0x5')){_0x252342[_0xaf66('0x6')](_0x443180['content']);}else if(_0x443180[_0xaf66('0x4')]===_0xaf66('0x7')&&_0x443180[_0xaf66('0x8')]){_0x46a4d9[_0x443180[_0xaf66('0x8')]]&&_0x252342['push'](_0x46a4d9[_0x443180[_0xaf66('0x8')]]['toString']());}else if(_0x443180[_0xaf66('0x4')]===_0xaf66('0x9')&&_0x443180['Variable']&&_0x443180[_0xaf66('0xa')][_0xaf66('0xb')]){_0x46a4d9[_0x443180['Variable'][_0xaf66('0xb')][_0xaf66('0xc')]()]&&_0x252342['push'](_0x46a4d9[_0x443180[_0xaf66('0xa')]['name']['toLowerCase']()]['toString']());}else if(_0x443180[_0xaf66('0x4')]===_0xaf66('0xd')){if(_0x443180[_0xaf66('0xe')]===_0xaf66('0x5')&&_0x443180['key']){_0x252342[_0xaf66('0x6')](util[_0xaf66('0xf')](_0xaf66('0x10'),_0x443180[_0xaf66('0x11')],_0x443180[_0xaf66('0x12')]));}else if(_0x443180[_0xaf66('0xe')]==='variable'&&_0x443180[_0xaf66('0x8')]&&_0x443180[_0xaf66('0x11')]){_0x46a4d9[_0x443180[_0xaf66('0x8')]]&&_0x252342[_0xaf66('0x6')](util['format'](_0xaf66('0x10'),_0x443180[_0xaf66('0x11')],_0x46a4d9[_0x443180[_0xaf66('0x8')]]));}else if(_0x443180[_0xaf66('0xe')]===_0xaf66('0x9')&&_0x443180[_0xaf66('0xa')]&&_0x443180['Variable'][_0xaf66('0xb')]&&_0x443180['key']){_0x46a4d9[_0x443180[_0xaf66('0xa')][_0xaf66('0xb')][_0xaf66('0xc')]()]&&_0x252342[_0xaf66('0x6')](util[_0xaf66('0xf')](_0xaf66('0x10'),_0x443180[_0xaf66('0x11')],_0x46a4d9[_0x443180['Variable'][_0xaf66('0xb')]['toLowerCase']()]));}}}}return _0x252342[_0xaf66('0x13')](_0x456602);};exports[_0xaf66('0x14')]=function(_0x370095){var _0x441263=_0x370095[_0xaf66('0x15')](-0x1);if(_0x441263==='/'){_0x370095=_0x370095['substring'](0x0,_0x370095[_0xaf66('0x16')](_0x441263));}return _0x370095;};exports[_0xaf66('0x17')]=function(_0x1faf48){if(!_[_0xaf66('0x18')](_0x1faf48)&&_0x1faf48!==''){var _0x507c13=/^(([^<>()\[\]\\.,;:\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 _0x507c13['test'](String(_0x1faf48)['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 5246f4b..53f29cc 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 _0x4c71=['outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','abandoned','[ABANDONED]','calleridname','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','length','forEach','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','merge','Normal','Open','Descriptions','format','%s/webservice.php','remoteUri','create','admin','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','stringify','Getting\x20agent\x20with\x20email','GET','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','getUser','query','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','POST','Contacts','phone','getEndUser','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]'];(function(_0x3ad068,_0x6bf7bb){var _0x5cd648=function(_0x3fc92e){while(--_0x3fc92e){_0x3ad068['push'](_0x3ad068['shift']());}};_0x5cd648(++_0x6bf7bb);}(_0x4c71,0x12b));var _0x14c7=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x4c71[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x14c7('0x0'));var rp=require(_0x14c7('0x1'));var BPromise=require('bluebird');var md5=require(_0x14c7('0x2'));var util=require(_0x14c7('0x3'));var Redis=require(_0x14c7('0x4'));var intUtil=require(_0x14c7('0x5'));var config=require(_0x14c7('0x6'));var logger=require('../../../../config/logger')(_0x14c7('0x7'));config[_0x14c7('0x8')]=_[_0x14c7('0x9')](config[_0x14c7('0x8')],{'host':_0x14c7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x14c7('0x8')]));function emit(_0x38b0fb,_0x33ffc6,_0x1ab9f0){io['to'](_0x38b0fb)[_0x14c7('0xb')](_0x33ffc6,_0x1ab9f0);}function getCustomFields(_0x542adc,_0x350ef8){var _0x4f2d04={};if(_0x542adc[_0x14c7('0xc')]>0x0){_[_0x14c7('0xd')](_0x542adc,function(_0x5b5545){if(_0x5b5545[_0x14c7('0xe')]===_0x14c7('0xf')&&_0x5b5545[_0x14c7('0x10')]){_0x4f2d04[_0x5b5545[_0x14c7('0x10')]]=_0x5b5545[_0x14c7('0x11')][_0x14c7('0x12')]();}else if(_0x5b5545['type']==='variable'&&_0x5b5545[_0x14c7('0x13')]&&_0x5b5545[_0x14c7('0x10')]&&_0x350ef8[_0x5b5545[_0x14c7('0x13')]]){_0x4f2d04[_0x5b5545[_0x14c7('0x10')]]=_0x350ef8[_0x5b5545[_0x14c7('0x13')]][_0x14c7('0x12')]();}else if(_0x5b5545['type']==='customVariable'&&_0x5b5545[_0x14c7('0x14')]&&_0x5b5545[_0x14c7('0x14')]['name']&&_0x5b5545[_0x14c7('0x10')]&&_0x350ef8[_0x5b5545[_0x14c7('0x14')][_0x14c7('0x15')][_0x14c7('0x16')]()]){_0x4f2d04[_0x5b5545[_0x14c7('0x10')]]=_0x350ef8[_0x5b5545[_0x14c7('0x14')][_0x14c7('0x15')]['toLowerCase']()][_0x14c7('0x12')]();}});}return _0x4f2d04;}function createTicket(_0x76ee68,_0x885f2f,_0x285100,_0x57d383,_0x4c504b,_0x3e033a,_0x3c6ab5){logger[_0x14c7('0x17')]('Creating\x20new\x20ticket...');var _0x266940=_[_0x14c7('0x18')]({'parent_id':'','assigned_user_id':_0x885f2f['id'],'ticketpriorities':_0x14c7('0x19'),'ticketstatus':_0x14c7('0x1a'),'ticket_title':intUtil['getString'](_0x57d383['Subjects'],_0x4c504b,'\x20'),'description':intUtil['getString'](_0x57d383[_0x14c7('0x1b')],_0x4c504b,'\x0a'),'contact_id':_0x285100['id']},getCustomFields(_0x3e033a,_0x4c504b));var _0x4944ad={'method':'POST','uri':util[_0x14c7('0x1c')](_0x14c7('0x1d'),_0x76ee68[_0x14c7('0x1e')]),'form':{'operation':_0x14c7('0x1f'),'username':_0x14c7('0x20'),'sessionName':_0x3c6ab5['sessionName'],'elementType':'HelpDesk','element':JSON['stringify'](_0x266940)},'json':!![]};return request(_0x4944ad)[_0x14c7('0x21')](function(_0x1f24b4){if(_0x1f24b4[_0x14c7('0x22')]){return BPromise[_0x14c7('0x23')]({'id':_0x1f24b4[_0x14c7('0x24')]['id']});}else{throw new Error(util[_0x14c7('0x1c')](_0x14c7('0x25'),JSON['stringify'](_0x1f24b4[_0x14c7('0x26')])));}})[_0x14c7('0x27')](function(_0x17b2e5){var _0x30a959=_0x17b2e5[_0x14c7('0x28')]||0x1f4;logger['error'](_0x14c7('0x29'),_0x14c7('0x2a'),_0x30a959,JSON[_0x14c7('0x2b')](_0x17b2e5));});}function getUser(_0x4af1bf,_0x576de4,_0x4d0f87){if(intUtil['validateEmail'](_0x576de4)){logger['info'](_0x14c7('0x2c'),_0x576de4);return request({'method':_0x14c7('0x2d'),'uri':util[_0x14c7('0x1c')](_0x14c7('0x1d'),_0x4af1bf['remoteUri']),'qs':{'operation':'query','username':'admin','sessionName':_0x4d0f87[_0x14c7('0x2e')],'query':util[_0x14c7('0x1c')](_0x14c7('0x2f'),_0x576de4)},'json':!![]})[_0x14c7('0x21')](function(_0x1aa3db){if(_0x1aa3db[_0x14c7('0x22')]&&_0x1aa3db['result'][_0x14c7('0xc')]){logger[_0x14c7('0x17')](_0x14c7('0x30'));return BPromise['resolve']({'id':_0x1aa3db['result'][0x0]['id'],'email':_0x1aa3db[_0x14c7('0x24')][0x0][_0x14c7('0x31')],'name':_0x1aa3db['result'][0x0][_0x14c7('0x32')]+'\x20'+_0x1aa3db['result'][_0x14c7('0x33')]});}else{logger[_0x14c7('0x17')](_0x14c7('0x34'));return BPromise[_0x14c7('0x23')]({'id':_0x4d0f87[_0x14c7('0x35')],'email':_0x4af1bf['username'],'name':_0x14c7('0x20')});}})[_0x14c7('0x27')](function(_0x1ba682){var _0x5a8169=_0x1ba682['statusCode']||0x1f4;logger['error'](_0x14c7('0x29'),'getUser',_0x5a8169,JSON[_0x14c7('0x2b')](_0x1ba682));});}else{logger[_0x14c7('0x17')](_0x14c7('0x34'));return BPromise[_0x14c7('0x23')]({'id':_0x4d0f87['userId'],'email':_0x4af1bf[_0x14c7('0x36')],'name':_0x14c7('0x20')})[_0x14c7('0x27')](function(_0x2daab7){var _0x5993c8=_0x2daab7['statusCode']||0x1f4;logger[_0x14c7('0x26')](_0x14c7('0x29'),_0x14c7('0x37'),_0x5993c8,JSON[_0x14c7('0x2b')](_0x2daab7));});}}function getEndUser(_0x180275,_0x1d95f7,_0x22d45e,_0x4a71b3){logger[_0x14c7('0x17')]('Searching\x20end\x20user\x20with\x20phone',_0x22d45e);return request({'method':'GET','uri':util[_0x14c7('0x1c')]('%s/webservice.php',_0x180275[_0x14c7('0x1e')]),'qs':{'operation':_0x14c7('0x38'),'username':_0x14c7('0x20'),'sessionName':_0x4a71b3[_0x14c7('0x2e')],'query':util[_0x14c7('0x1c')](_0x14c7('0x39'),_0x22d45e,_0x22d45e,_0x22d45e,_0x22d45e,_0x22d45e)},'json':!![]})['then'](function(_0x1b3da8){if(_0x1b3da8[_0x14c7('0x22')]&&_0x1b3da8[_0x14c7('0x24')][_0x14c7('0xc')]){logger['info'](_0x14c7('0x3a'));return BPromise[_0x14c7('0x23')]({'id':_0x1b3da8[_0x14c7('0x24')][0x0]['id'],'name':_0x1b3da8['result'][0x0][_0x14c7('0x3b')]+'\x20'+_0x1b3da8[_0x14c7('0x24')][0x0][_0x14c7('0x3c')],'phone':_0x22d45e});}else{logger[_0x14c7('0x17')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x14c7('0x3d'),'uri':util['format']('%s/webservice.php',_0x180275[_0x14c7('0x1e')]),'form':{'operation':'create','sessionName':_0x4a71b3[_0x14c7('0x2e')],'elementType':_0x14c7('0x3e'),'element':JSON[_0x14c7('0x2b')]({'lastname':_0x1d95f7,'phone':_0x22d45e,'assigned_user_id':'\x20'})},'json':!![]})[_0x14c7('0x21')](function(_0x4761f0){logger['info']('Enduser\x20created.');return BPromise[_0x14c7('0x23')]({'id':_0x4761f0[_0x14c7('0x24')]['id'],'name':_0x4761f0[_0x14c7('0x24')][_0x14c7('0x3c')],'phone':_0x4761f0[_0x14c7('0x24')][_0x14c7('0x3f')]});})[_0x14c7('0x27')](function(_0x243492){var _0x2b925e=_0x243492['statusCode']||0x1f4;logger[_0x14c7('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x14c7('0x40'),_0x2b925e,JSON[_0x14c7('0x2b')](_0x243492));});}});}function getConnection(_0x419779){var _0x3c87e9=_0x419779[_0x14c7('0x36')];var _0x533de4=_0x419779['accessKey'];return request({'method':'GET','uri':util[_0x14c7('0x1c')]('%s/webservice.php',_0x419779[_0x14c7('0x1e')]),'qs':{'operation':_0x14c7('0x41'),'username':_0x3c87e9},'json':!![]})['then'](function(_0x7beecf){if(_0x7beecf[_0x14c7('0x22')]){return request({'method':_0x14c7('0x3d'),'uri':util[_0x14c7('0x1c')]('%s/webservice.php',_0x419779[_0x14c7('0x1e')]),'form':{'operation':_0x14c7('0x42'),'username':_0x14c7('0x20'),'accessKey':md5(_0x7beecf[_0x14c7('0x24')][_0x14c7('0x43')]+_0x533de4)},'json':!![]});}})[_0x14c7('0x21')](function(_0x593093){if(_0x593093[_0x14c7('0x22')]){return BPromise[_0x14c7('0x23')](_0x593093['result']);}else{throw new Error(util[_0x14c7('0x1c')](_0x14c7('0x44'),_0x419779['id']));}})[_0x14c7('0x27')](function(_0xa0accb){var _0x1c41e0=_0xa0accb[_0x14c7('0x28')]||0x1f4;logger[_0x14c7('0x26')](_0x14c7('0x29'),'getConnection',_0x1c41e0,JSON[_0x14c7('0x2b')](_0xa0accb));});}function request(_0x12762c){logger[_0x14c7('0x17')](_0x14c7('0x45'),JSON[_0x14c7('0x2b')](_0x12762c));return rp(_0x12762c);}exports['queue']=function(_0x5c84ef,_0x101be,_0x4b6840,_0x17d223,_0x582dcb,_0x4f1d70){var _0x36be9e,_0x4013d7,_0x4e1ff7,_0x1c8aed;_0x4f1d70[_0x14c7('0x1e')]=intUtil[_0x14c7('0x46')](_0x4f1d70[_0x14c7('0x1e')]);if(_0x582dcb&&_0x582dcb[_0x14c7('0x47')]){logger[_0x14c7('0x17')]('[QUEUE]','Recording\x20is\x20enabled!');_0x101be[_0x14c7('0x48')]=util[_0x14c7('0x1c')](_0x14c7('0x49'),_0x4f1d70[_0x14c7('0x4a')],_0x101be['uniqueid'],md5(_0x101be[_0x14c7('0x4b')]));}else{_0x101be[_0x14c7('0x48')]='';}return getConnection(_0x4f1d70)[_0x14c7('0x21')](function(_0x14438d){_0x1c8aed=_0x14438d;return getUser(_0x4f1d70,_0x17d223['email'],_0x1c8aed);})[_0x14c7('0x21')](function(_0x518fb9){_0x36be9e=_0x518fb9;logger[_0x14c7('0x17')](_0x14c7('0x4c'),_0x36be9e['id']);return getEndUser(_0x4f1d70,_0x101be['calleridname'],_0x101be['calleridnum'],_0x1c8aed);})[_0x14c7('0x21')](function(_0x1facfd){_0x4013d7=_0x1facfd;logger[_0x14c7('0x17')](_0x14c7('0x4d'),_0x4013d7['id']);return createTicket(_0x4f1d70,_0x36be9e,_0x4013d7,_0x4b6840,_0x101be,_0x4b6840[_0x14c7('0x4e')],_0x1c8aed);})['then'](function(_0x777d3f){_0x4e1ff7=_0x777d3f;logger['info']('Ticket\x20created!');logger['info'](_0x14c7('0x4f'),_0x4e1ff7['id']);var _0x574f1d=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4f1d70[_0x14c7('0x1e')],_[_0x14c7('0x50')](_0x4e1ff7['id'],'x')[0x1]);logger['info']('[QUEUE]',_0x14c7('0x51'));emit(util[_0x14c7('0x1c')](_0x14c7('0x52'),_0x17d223[_0x14c7('0x15')]),_0x14c7('0x53'),{'uri':_0x574f1d});})[_0x14c7('0x27')](function(_0x5eab8a){logger[_0x14c7('0x26')](_0x14c7('0x54'),JSON[_0x14c7('0x2b')](_0x5eab8a));});};exports[_0x14c7('0x55')]=function(_0x263276,_0x43303f,_0x369e5e,_0x10c003,_0x125d1e,_0x58d9e9,_0x36444d){var _0x333d23,_0x1cff4c,_0x29fc3c,_0x48d297;_0x58d9e9[_0x14c7('0x1e')]=intUtil[_0x14c7('0x46')](_0x58d9e9['remoteUri']);_0x58d9e9[_0x14c7('0x4a')]=intUtil[_0x14c7('0x46')](_0x58d9e9[_0x14c7('0x4a')]);if(_0x36444d&&_0x36444d[_0x14c7('0x56')]&&_0x36444d[_0x14c7('0x56')]!=='none'){logger[_0x14c7('0x17')](_0x14c7('0x57'),'Recording\x20is\x20enabled!');_0x43303f[_0x14c7('0x48')]=util[_0x14c7('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58d9e9[_0x14c7('0x4a')],_0x43303f[_0x14c7('0x4b')],md5(_0x43303f['uniqueid']));}return getConnection(_0x58d9e9)['then'](function(_0x19c81a){_0x48d297=_0x19c81a;return getUser(_0x58d9e9,_0x10c003['email'],_0x48d297);})['then'](function(_0x5c6c4b){_0x333d23=_0x5c6c4b;logger[_0x14c7('0x17')](_0x14c7('0x4c'),_0x333d23['id']);return getEndUser(_0x58d9e9,_0x43303f[_0x14c7('0x58')],_0x43303f[_0x14c7('0x59')],_0x48d297);})[_0x14c7('0x21')](function(_0x53aa9e){_0x1cff4c=_0x53aa9e;logger[_0x14c7('0x17')](_0x14c7('0x4d'),_0x1cff4c['id']);return createTicket(_0x58d9e9,_0x333d23,_0x1cff4c,_0x369e5e,_0x43303f,_0x369e5e['Fields'],_0x48d297);})['then'](function(_0x2294c8){_0x29fc3c=_0x2294c8;logger[_0x14c7('0x17')](_0x14c7('0x5a'));logger[_0x14c7('0x17')]('The\x20Ticket\x20ID\x20is:',_0x29fc3c['id']);var _0x2b6a10=util[_0x14c7('0x1c')](_0x14c7('0x5b'),_0x58d9e9['remoteUri'],_['split'](_0x29fc3c['id'],'x')[0x1]);logger[_0x14c7('0x17')](_0x14c7('0x57'),_0x14c7('0x51'));emit(util['format'](_0x14c7('0x52'),_0x10c003[_0x14c7('0x15')]),_0x14c7('0x53'),{'uri':_0x2b6a10});})['catch'](function(_0x23f690){logger['error']('[OUTBOUND]',JSON[_0x14c7('0x2b')](_0x23f690));});};exports[_0x14c7('0x5c')]=function(_0xd5994d,_0x4590f5,_0x234882,_0x5afba1,_0x302fbf,_0x373aee){var _0x269746,_0x33f2b6,_0xd250a7,_0x581d53;_0x373aee['remoteUri']=intUtil[_0x14c7('0x46')](_0x373aee[_0x14c7('0x1e')]);_0x373aee[_0x14c7('0x4a')]=intUtil['stripTrailingSlash'](_0x373aee[_0x14c7('0x4a')]);if(_0x302fbf&&_0x302fbf['monitor_format']){logger['info'](_0x14c7('0x5d'),'Recording\x20is\x20enabled!');_0x4590f5[_0x14c7('0x48')]=util[_0x14c7('0x1c')](_0x14c7('0x49'),_0x373aee['serverUrl'],_0x4590f5[_0x14c7('0x4b')],md5(_0x4590f5[_0x14c7('0x4b')]));}else{_0x4590f5[_0x14c7('0x48')]='';}return getConnection(_0x373aee)['then'](function(_0x5309ae){_0x581d53=_0x5309ae;return getUser(_0x373aee,'',_0x581d53);})['then'](function(_0x5ee87c){_0x269746=_0x5ee87c;logger['info'](_0x14c7('0x4c'),_0x269746['id']);return getEndUser(_0x373aee,_0x4590f5[_0x14c7('0x5e')],_0x4590f5[_0x14c7('0x5f')],_0x581d53);})[_0x14c7('0x21')](function(_0x49927f){_0x33f2b6=_0x49927f;logger[_0x14c7('0x17')](_0x14c7('0x4d'),_0x33f2b6['id']);return createTicket(_0x373aee,_0x269746,_0x33f2b6,_0x234882,_0x4590f5,_0x234882[_0x14c7('0x4e')],_0x581d53);})[_0x14c7('0x21')](function(_0x4a1e81){_0xd250a7=_0x4a1e81;logger['info'](_0x14c7('0x5a'));logger['info'](_0x14c7('0x4f'),_0xd250a7['id']);})[_0x14c7('0x27')](function(_0x1bbbc4){logger['error'](_0x14c7('0x5d'),JSON['stringify'](_0x1bbbc4));});}; \ No newline at end of file +var _0x652b=['recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','bluebird','util','../../../../config/environment','../../../../config/logger','vTiger','redis','emit','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','merge','Normal','Open','getString','Subjects','POST','remoteUri','admin','sessionName','then','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','createTicket','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','getUser','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x652b,0x68));var _0xb652=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x652b[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xb652('0x0'));var rp=require(_0xb652('0x1'));var BPromise=require(_0xb652('0x2'));var md5=require('md5');var util=require(_0xb652('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb652('0x4'));var logger=require(_0xb652('0x5'))(_0xb652('0x6'));config['redis']=_['defaults'](config[_0xb652('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb652('0x7')]));function emit(_0x5c0245,_0x2b82fd,_0x117e49){io['to'](_0x5c0245)[_0xb652('0x8')](_0x2b82fd,_0x117e49);}function getCustomFields(_0x2a7fad,_0x2f06f0){var _0x374775={};if(_0x2a7fad['length']>0x0){_['forEach'](_0x2a7fad,function(_0x368635){if(_0x368635[_0xb652('0x9')]===_0xb652('0xa')&&_0x368635[_0xb652('0xb')]){_0x374775[_0x368635['idField']]=_0x368635[_0xb652('0xc')][_0xb652('0xd')]();}else if(_0x368635[_0xb652('0x9')]==='variable'&&_0x368635[_0xb652('0xe')]&&_0x368635[_0xb652('0xb')]&&_0x2f06f0[_0x368635['variableName']]){_0x374775[_0x368635['idField']]=_0x2f06f0[_0x368635['variableName']]['toString']();}else if(_0x368635[_0xb652('0x9')]==='customVariable'&&_0x368635[_0xb652('0xf')]&&_0x368635[_0xb652('0xf')][_0xb652('0x10')]&&_0x368635['idField']&&_0x2f06f0[_0x368635[_0xb652('0xf')][_0xb652('0x10')][_0xb652('0x11')]()]){_0x374775[_0x368635[_0xb652('0xb')]]=_0x2f06f0[_0x368635['Variable'][_0xb652('0x10')][_0xb652('0x11')]()][_0xb652('0xd')]();}});}return _0x374775;}function createTicket(_0x3bf3b0,_0x554d5a,_0x94d0b3,_0x4af396,_0xa6ed9b,_0x313d97,_0x22288e){logger[_0xb652('0x12')]('Creating\x20new\x20ticket...');var _0x1de010=_[_0xb652('0x13')]({'parent_id':'','assigned_user_id':_0x554d5a['id'],'ticketpriorities':_0xb652('0x14'),'ticketstatus':_0xb652('0x15'),'ticket_title':intUtil[_0xb652('0x16')](_0x4af396[_0xb652('0x17')],_0xa6ed9b,'\x20'),'description':intUtil['getString'](_0x4af396['Descriptions'],_0xa6ed9b,'\x0a'),'contact_id':_0x94d0b3['id']},getCustomFields(_0x313d97,_0xa6ed9b));var _0x71465c={'method':_0xb652('0x18'),'uri':util['format']('%s/webservice.php',_0x3bf3b0[_0xb652('0x19')]),'form':{'operation':'create','username':_0xb652('0x1a'),'sessionName':_0x22288e[_0xb652('0x1b')],'elementType':'HelpDesk','element':JSON['stringify'](_0x1de010)},'json':!![]};return request(_0x71465c)[_0xb652('0x1c')](function(_0xd6bbf9){if(_0xd6bbf9[_0xb652('0x1d')]){return BPromise[_0xb652('0x1e')]({'id':_0xd6bbf9[_0xb652('0x1f')]['id']});}else{throw new Error(util[_0xb652('0x20')](_0xb652('0x21'),JSON[_0xb652('0x22')](_0xd6bbf9['error'])));}})['catch'](function(_0x47cb7c){var _0x1f169a=_0x47cb7c['statusCode']||0x1f4;logger[_0xb652('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xb652('0x24'),_0x1f169a,JSON[_0xb652('0x22')](_0x47cb7c));});}function getUser(_0x3b74eb,_0x2b91ff,_0x147b8d){if(intUtil['validateEmail'](_0x2b91ff)){logger[_0xb652('0x12')]('Getting\x20agent\x20with\x20email',_0x2b91ff);return request({'method':_0xb652('0x25'),'uri':util['format'](_0xb652('0x26'),_0x3b74eb[_0xb652('0x19')]),'qs':{'operation':_0xb652('0x27'),'username':_0xb652('0x1a'),'sessionName':_0x147b8d[_0xb652('0x1b')],'query':util[_0xb652('0x20')](_0xb652('0x28'),_0x2b91ff)},'json':!![]})[_0xb652('0x1c')](function(_0x11978b){if(_0x11978b[_0xb652('0x1d')]&&_0x11978b[_0xb652('0x1f')]['length']){logger[_0xb652('0x12')](_0xb652('0x29'));return BPromise[_0xb652('0x1e')]({'id':_0x11978b[_0xb652('0x1f')][0x0]['id'],'email':_0x11978b[_0xb652('0x1f')][0x0][_0xb652('0x2a')],'name':_0x11978b['result'][0x0][_0xb652('0x2b')]+'\x20'+_0x11978b[_0xb652('0x1f')][_0xb652('0x2c')]});}else{logger[_0xb652('0x12')](_0xb652('0x2d'));return BPromise[_0xb652('0x1e')]({'id':_0x147b8d[_0xb652('0x2e')],'email':_0x3b74eb[_0xb652('0x2f')],'name':_0xb652('0x1a')});}})[_0xb652('0x30')](function(_0x57b980){var _0x7acfb6=_0x57b980['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xb652('0x31'),_0x7acfb6,JSON[_0xb652('0x22')](_0x57b980));});}else{logger[_0xb652('0x12')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb652('0x1e')]({'id':_0x147b8d['userId'],'email':_0x3b74eb[_0xb652('0x2f')],'name':'admin'})[_0xb652('0x30')](function(_0x5895a0){var _0x366acc=_0x5895a0[_0xb652('0x32')]||0x1f4;logger[_0xb652('0x23')](_0xb652('0x33'),'getUser',_0x366acc,JSON[_0xb652('0x22')](_0x5895a0));});}}function getEndUser(_0x11724f,_0x19ef00,_0xd20e40,_0x5dc5ba){logger[_0xb652('0x12')](_0xb652('0x34'),_0xd20e40);return request({'method':'GET','uri':util[_0xb652('0x20')]('%s/webservice.php',_0x11724f['remoteUri']),'qs':{'operation':_0xb652('0x27'),'username':_0xb652('0x1a'),'sessionName':_0x5dc5ba[_0xb652('0x1b')],'query':util['format'](_0xb652('0x35'),_0xd20e40,_0xd20e40,_0xd20e40,_0xd20e40,_0xd20e40)},'json':!![]})[_0xb652('0x1c')](function(_0x22edb1){if(_0x22edb1[_0xb652('0x1d')]&&_0x22edb1[_0xb652('0x1f')][_0xb652('0x36')]){logger[_0xb652('0x12')](_0xb652('0x37'));return BPromise[_0xb652('0x1e')]({'id':_0x22edb1[_0xb652('0x1f')][0x0]['id'],'name':_0x22edb1['result'][0x0]['firstname']+'\x20'+_0x22edb1[_0xb652('0x1f')][0x0]['lastname'],'phone':_0xd20e40});}else{logger[_0xb652('0x12')](_0xb652('0x38'));return request({'method':_0xb652('0x18'),'uri':util[_0xb652('0x20')](_0xb652('0x26'),_0x11724f[_0xb652('0x19')]),'form':{'operation':'create','sessionName':_0x5dc5ba['sessionName'],'elementType':_0xb652('0x39'),'element':JSON[_0xb652('0x22')]({'lastname':_0x19ef00,'phone':_0xd20e40,'assigned_user_id':'\x20'})},'json':!![]})[_0xb652('0x1c')](function(_0x410d93){logger['info'](_0xb652('0x3a'));return BPromise[_0xb652('0x1e')]({'id':_0x410d93[_0xb652('0x1f')]['id'],'name':_0x410d93[_0xb652('0x1f')][_0xb652('0x3b')],'phone':_0x410d93[_0xb652('0x1f')][_0xb652('0x3c')]});})[_0xb652('0x30')](function(_0x20065c){var _0x25f04c=_0x20065c[_0xb652('0x32')]||0x1f4;logger[_0xb652('0x23')](_0xb652('0x33'),_0xb652('0x3d'),_0x25f04c,JSON['stringify'](_0x20065c));});}});}function getConnection(_0x5aeb81){var _0x3a0715=_0x5aeb81[_0xb652('0x2f')];var _0x283471=_0x5aeb81['accessKey'];return request({'method':_0xb652('0x25'),'uri':util['format'](_0xb652('0x26'),_0x5aeb81[_0xb652('0x19')]),'qs':{'operation':_0xb652('0x3e'),'username':_0x3a0715},'json':!![]})[_0xb652('0x1c')](function(_0x3739b3){if(_0x3739b3[_0xb652('0x1d')]){return request({'method':_0xb652('0x18'),'uri':util[_0xb652('0x20')](_0xb652('0x26'),_0x5aeb81['remoteUri']),'form':{'operation':_0xb652('0x3f'),'username':_0xb652('0x1a'),'accessKey':md5(_0x3739b3['result'][_0xb652('0x40')]+_0x283471)},'json':!![]});}})['then'](function(_0x4f5a87){if(_0x4f5a87[_0xb652('0x1d')]){return BPromise[_0xb652('0x1e')](_0x4f5a87['result']);}else{throw new Error(util[_0xb652('0x20')](_0xb652('0x41'),_0x5aeb81['id']));}})[_0xb652('0x30')](function(_0x18e455){var _0x330bce=_0x18e455[_0xb652('0x32')]||0x1f4;logger[_0xb652('0x23')](_0xb652('0x33'),'getConnection',_0x330bce,JSON['stringify'](_0x18e455));});}function request(_0x2946f2){logger[_0xb652('0x12')]('[HTTP]',JSON['stringify'](_0x2946f2));return rp(_0x2946f2);}exports['queue']=function(_0x10ca6c,_0x938dbf,_0x242f8a,_0x15aa71,_0x573426,_0x5d5d6d){var _0x5a153e,_0x2934cc,_0x2fb6c0,_0x4768c4;_0x5d5d6d['remoteUri']=intUtil[_0xb652('0x42')](_0x5d5d6d[_0xb652('0x19')]);if(_0x573426&&_0x573426['monitor_format']){logger['info'](_0xb652('0x43'),_0xb652('0x44'));_0x938dbf[_0xb652('0x45')]=util[_0xb652('0x20')](_0xb652('0x46'),_0x5d5d6d[_0xb652('0x47')],_0x938dbf[_0xb652('0x48')],md5(_0x938dbf[_0xb652('0x48')]));}else{_0x938dbf[_0xb652('0x45')]='';}return getConnection(_0x5d5d6d)[_0xb652('0x1c')](function(_0x3e7384){_0x4768c4=_0x3e7384;return getUser(_0x5d5d6d,_0x15aa71['email'],_0x4768c4);})['then'](function(_0x4d1f95){_0x5a153e=_0x4d1f95;logger[_0xb652('0x12')](_0xb652('0x49'),_0x5a153e['id']);return getEndUser(_0x5d5d6d,_0x938dbf[_0xb652('0x4a')],_0x938dbf[_0xb652('0x4b')],_0x4768c4);})[_0xb652('0x1c')](function(_0xbe2d31){_0x2934cc=_0xbe2d31;logger[_0xb652('0x12')]('The\x20Enduser\x20ID\x20is:',_0x2934cc['id']);return createTicket(_0x5d5d6d,_0x5a153e,_0x2934cc,_0x242f8a,_0x938dbf,_0x242f8a[_0xb652('0x4c')],_0x4768c4);})[_0xb652('0x1c')](function(_0x4d0531){_0x2fb6c0=_0x4d0531;logger[_0xb652('0x12')](_0xb652('0x4d'));logger['info'](_0xb652('0x4e'),_0x2fb6c0['id']);var _0x11ae6a=util[_0xb652('0x20')](_0xb652('0x4f'),_0x5d5d6d[_0xb652('0x19')],_[_0xb652('0x50')](_0x2fb6c0['id'],'x')[0x1]);logger[_0xb652('0x12')]('[QUEUE]',_0xb652('0x51'));emit(util[_0xb652('0x20')](_0xb652('0x52'),_0x15aa71[_0xb652('0x10')]),'trigger:browser:url',{'uri':_0x11ae6a});})[_0xb652('0x30')](function(_0x357120){logger[_0xb652('0x23')](_0xb652('0x43'),JSON[_0xb652('0x22')](_0x357120));});};exports[_0xb652('0x53')]=function(_0x23adc1,_0x98a8e9,_0x3deba4,_0x4dac73,_0x4345c6,_0x188514,_0x297a8d){var _0x3bd838,_0x15d662,_0x5c2477,_0x554ea9;_0x188514[_0xb652('0x19')]=intUtil[_0xb652('0x42')](_0x188514[_0xb652('0x19')]);_0x188514[_0xb652('0x47')]=intUtil['stripTrailingSlash'](_0x188514['serverUrl']);if(_0x297a8d&&_0x297a8d[_0xb652('0x54')]&&_0x297a8d['recordingFormat']!==_0xb652('0x55')){logger[_0xb652('0x12')](_0xb652('0x56'),_0xb652('0x44'));_0x98a8e9[_0xb652('0x45')]=util['format'](_0xb652('0x46'),_0x188514[_0xb652('0x47')],_0x98a8e9[_0xb652('0x48')],md5(_0x98a8e9[_0xb652('0x48')]));}return getConnection(_0x188514)[_0xb652('0x1c')](function(_0x17654c){_0x554ea9=_0x17654c;return getUser(_0x188514,_0x4dac73[_0xb652('0x57')],_0x554ea9);})[_0xb652('0x1c')](function(_0x595e8d){_0x3bd838=_0x595e8d;logger['info']('The\x20User\x20ID\x20is:',_0x3bd838['id']);return getEndUser(_0x188514,_0x98a8e9[_0xb652('0x58')],_0x98a8e9[_0xb652('0x59')],_0x554ea9);})['then'](function(_0x4012c1){_0x15d662=_0x4012c1;logger[_0xb652('0x12')](_0xb652('0x5a'),_0x15d662['id']);return createTicket(_0x188514,_0x3bd838,_0x15d662,_0x3deba4,_0x98a8e9,_0x3deba4[_0xb652('0x4c')],_0x554ea9);})[_0xb652('0x1c')](function(_0x4f1e25){_0x5c2477=_0x4f1e25;logger[_0xb652('0x12')](_0xb652('0x4d'));logger[_0xb652('0x12')]('The\x20Ticket\x20ID\x20is:',_0x5c2477['id']);var _0x1b34de=util['format'](_0xb652('0x4f'),_0x188514[_0xb652('0x19')],_[_0xb652('0x50')](_0x5c2477['id'],'x')[0x1]);logger[_0xb652('0x12')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb652('0x20')]('user:%s',_0x4dac73[_0xb652('0x10')]),'trigger:browser:url',{'uri':_0x1b34de});})['catch'](function(_0x3c2ebc){logger[_0xb652('0x23')](_0xb652('0x56'),JSON[_0xb652('0x22')](_0x3c2ebc));});};exports[_0xb652('0x5b')]=function(_0x239959,_0x3e8920,_0x1b3cd7,_0x238dab,_0x17f2ab,_0x2c2a6d){var _0x4e20e1,_0x22985,_0x5d2c48,_0x8dc6e9;_0x2c2a6d[_0xb652('0x19')]=intUtil[_0xb652('0x42')](_0x2c2a6d['remoteUri']);_0x2c2a6d[_0xb652('0x47')]=intUtil[_0xb652('0x42')](_0x2c2a6d[_0xb652('0x47')]);if(_0x17f2ab&&_0x17f2ab[_0xb652('0x5c')]){logger[_0xb652('0x12')](_0xb652('0x5d'),_0xb652('0x44'));_0x3e8920['recordingURL']=util['format'](_0xb652('0x46'),_0x2c2a6d[_0xb652('0x47')],_0x3e8920[_0xb652('0x48')],md5(_0x3e8920[_0xb652('0x48')]));}else{_0x3e8920[_0xb652('0x45')]='';}return getConnection(_0x2c2a6d)[_0xb652('0x1c')](function(_0x178eee){_0x8dc6e9=_0x178eee;return getUser(_0x2c2a6d,'',_0x8dc6e9);})[_0xb652('0x1c')](function(_0x2f5d4e){_0x4e20e1=_0x2f5d4e;logger[_0xb652('0x12')](_0xb652('0x49'),_0x4e20e1['id']);return getEndUser(_0x2c2a6d,_0x3e8920[_0xb652('0x4a')],_0x3e8920[_0xb652('0x4b')],_0x8dc6e9);})[_0xb652('0x1c')](function(_0x5ed8b2){_0x22985=_0x5ed8b2;logger[_0xb652('0x12')](_0xb652('0x5a'),_0x22985['id']);return createTicket(_0x2c2a6d,_0x4e20e1,_0x22985,_0x1b3cd7,_0x3e8920,_0x1b3cd7[_0xb652('0x4c')],_0x8dc6e9);})[_0xb652('0x1c')](function(_0x1acf3b){_0x5d2c48=_0x1acf3b;logger[_0xb652('0x12')](_0xb652('0x4d'));logger['info'](_0xb652('0x4e'),_0x5d2c48['id']);})['catch'](function(_0x437eee){logger[_0xb652('0x23')](_0xb652('0x5d'),JSON[_0xb652('0x22')](_0x437eee));});}; \ 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 6d7c5e3..23688d6 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 _0x2334=['custom_fields','variableName','push','idField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','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','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','inspect','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','type','string','nameField','customField','toLowerCase','content'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2334,0x171));var _0x4233=function(_0x166d74,_0x1bf07e){_0x166d74=_0x166d74-0x0;var _0x13a80f=_0x2334[_0x166d74];return _0x13a80f;};'use strict';var _=require(_0x4233('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x4233('0x1'));var Redis=require(_0x4233('0x2'));var intUtil=require(_0x4233('0x3'));var config=require(_0x4233('0x4'));var logger=require(_0x4233('0x5'))(_0x4233('0x6'));config['redis']=_[_0x4233('0x7')](config[_0x4233('0x8')],{'host':_0x4233('0x9'),'port':0x18eb});var io=require(_0x4233('0xa'))(new Redis(config[_0x4233('0x8')]));function emit(_0x52c75a,_0x4ace39,_0x5d16f2){io['to'](_0x52c75a)[_0x4233('0xb')](_0x4ace39,_0x5d16f2);}var headers={'Content-Type':_0x4233('0xc'),'Accept':_0x4233('0xc')};function getTicket(_0x20fd6c,_0x35fd52,_0x2046d7,_0x3b5258,_0x4ef0c4){logger[_0x4233('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x4233('0xe')](_0x4233('0xf'),_0x20fd6c[_0x4233('0x10')]),'method':_0x4233('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x2046d7['id'],'submitter_id':_0x35fd52?_0x35fd52['id']:undefined,'assignee_id':_0x35fd52?_0x35fd52['id']:undefined,'tags':getTags(_0x3b5258[_0x4233('0x12')],_0x4233('0x13')),'subject':intUtil[_0x4233('0x14')](_0x3b5258[_0x4233('0x15')],_0x4ef0c4,'\x20'),'description':intUtil[_0x4233('0x14')](_0x3b5258[_0x4233('0x16')],_0x4ef0c4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4233('0x14')](_0x3b5258[_0x4233('0x16')],_0x4ef0c4,'\x0a')}},getCustomFields(_0x3b5258[_0x4233('0x17')],_0x4ef0c4))}})[_0x4233('0x18')](function(_0x4a5505){logger[_0x4233('0xd')](_0x4233('0x19'));return _0x4a5505[_0x4233('0x1a')];});}function getUser(_0x932b6b,_0x35964b){if(intUtil[_0x4233('0x1b')](_0x35964b)){logger[_0x4233('0xd')](_0x4233('0x1c'),_0x35964b);return request({'uri':util[_0x4233('0xe')](_0x4233('0x1d'),_0x932b6b['remoteUri']),'qs':{'query':util[_0x4233('0xe')]('type:user\x20role:agent\x20email:%s',_0x35964b)}})['then'](function(_0x3cb357){if(_0x3cb357[_0x4233('0x1e')]){logger['info'](_0x4233('0x1f'));return _[_0x4233('0x20')](_0x3cb357[_0x4233('0x21')],{'email':_0x35964b,'role':_0x4233('0x22')});}else{logger[_0x4233('0xd')](_0x4233('0x23'));return request({'uri':util[_0x4233('0xe')](_0x4233('0x24'),_0x932b6b[_0x4233('0x10')])})[_0x4233('0x18')](function(_0x4817b5){logger['info']('Admin\x20account\x20selected.');return _0x4817b5[_0x4233('0x25')];});}});}else{logger['info'](_0x4233('0x23'));return request({'uri':util['format'](_0x4233('0x24'),_0x932b6b[_0x4233('0x10')])})['then'](function(_0x77b6d3){logger[_0x4233('0xd')](_0x4233('0x26'));return _0x77b6d3[_0x4233('0x25')];});}}function getEndUser(_0x3f1d3a,_0x171ba6,_0x5d6e54){logger[_0x4233('0xd')](_0x4233('0x27'),_0x5d6e54);return request({'uri':util[_0x4233('0xe')](_0x4233('0x1d'),_0x3f1d3a['remoteUri']),'qs':{'query':util[_0x4233('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x5d6e54)}})[_0x4233('0x18')](function(_0x142adb){var _0xe3cbe9;if(_0x142adb['results'][_0x4233('0x28')]){_0x142adb['results']=_[_0x4233('0x29')](_0x142adb[_0x4233('0x21')],{'suspended':![],'role':_0x4233('0x2a')});if(_0x142adb['results'][_0x4233('0x28')]){_0xe3cbe9=_['first'](_0x142adb[_0x4233('0x21')]);}}if(_0xe3cbe9){logger[_0x4233('0xd')](_0x4233('0x2b'));return _0xe3cbe9;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x4233('0x2c'),_0x3f1d3a[_0x4233('0x10')]),'method':_0x4233('0x11'),'body':{'user':{'role':_0x4233('0x2a'),'name':util['format'](_0x4233('0x2d'),_0x171ba6||_0x5d6e54),'phone':_0x5d6e54}}})['then'](function(_0x4edeec){logger[_0x4233('0xd')]('Enduser\x20created.');return _0x4edeec['user'];});}});}function getAuth(_0x29bedb){var _0x446197;if(_0x29bedb[_0x4233('0x2e')]===_0x4233('0x2f')){_0x446197=util[_0x4233('0xe')](_0x4233('0x30'),_0x29bedb[_0x4233('0x31')],_0x29bedb[_0x4233('0x2f')]);}else if(_0x29bedb['authType']==='token'){_0x446197=util[_0x4233('0xe')]('%s/token:%s',_0x29bedb['username'],_0x29bedb['token']);}return util['format'](_0x4233('0x32'),new Buffer(_0x446197)[_0x4233('0x33')]('base64'));}function request(_0x472c85){logger[_0x4233('0x34')](_0x4233('0x35'),JSON['stringify'](_0x472c85));return rp(_['defaults'](_0x472c85,{'method':_0x4233('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x546368,_0x51683d){var _0x52760a=[];if(_0x546368&&_0x546368[_0x4233('0x28')]>0x0){_0x52760a=_[_0x4233('0x37')](_0x546368,_0x51683d);}return _0x52760a;}function getCustomFields(_0x44d6a0,_0x1323f9){var _0xa1d411=[];var _0x32e015={'custom_fields':[]};if(_0x44d6a0[_0x4233('0x28')]>0x0){_[_0x4233('0x38')](_0x44d6a0,function(_0x18afe8){if(_0x18afe8[_0x4233('0x39')]===_0x4233('0x3a')&&_0x18afe8[_0x4233('0x3b')]&&!_0x18afe8[_0x4233('0x3c')]){_0x32e015[_0x18afe8[_0x4233('0x3b')][_0x4233('0x3d')]()]=_0x18afe8[_0x4233('0x3e')][_0x4233('0x33')]();}else if(_0x18afe8[_0x4233('0x39')]==='string'&&_0x18afe8['idField']&&_0x18afe8[_0x4233('0x3c')]){_0x32e015[_0x4233('0x3f')]['push']({'id':_0x18afe8['idField'],'value':_0x18afe8[_0x4233('0x3e')][_0x4233('0x33')]()});}else if(_0x18afe8[_0x4233('0x39')]==='variable'&&_0x18afe8[_0x4233('0x40')]&&_0x18afe8['idField']&&_0x18afe8['customField']){_0x1323f9[_0x18afe8[_0x4233('0x40')]]&&_0x32e015['custom_fields'][_0x4233('0x41')]({'id':_0x18afe8[_0x4233('0x42')],'value':_0x1323f9[_0x18afe8[_0x4233('0x40')]][_0x4233('0x33')]()});}else if(_0x18afe8[_0x4233('0x39')]===_0x4233('0x43')&&_0x18afe8[_0x4233('0x44')]&&_0x18afe8[_0x4233('0x44')][_0x4233('0x13')]&&_0x18afe8[_0x4233('0x42')]&&_0x18afe8['customField']){_0x1323f9[_0x18afe8['Variable'][_0x4233('0x13')][_0x4233('0x3d')]()]&&_0x32e015[_0x4233('0x3f')]['push']({'id':_0x18afe8[_0x4233('0x42')],'value':_0x1323f9[_0x18afe8['Variable'][_0x4233('0x13')][_0x4233('0x3d')]()][_0x4233('0x33')]()});}});}return _0x32e015;}exports[_0x4233('0x45')]=function(_0x128f00,_0x3840d2,_0x333c56,_0x2a23f8,_0x164fba,_0x46ff6d){var _0xa4ab6a,_0x4a6d7d;_0x46ff6d['remoteUri']=intUtil[_0x4233('0x46')](_0x46ff6d[_0x4233('0x10')]);_0x46ff6d[_0x4233('0x47')]=intUtil[_0x4233('0x46')](_0x46ff6d['serverUrl']);if(_0x164fba&&_0x164fba[_0x4233('0x48')]){logger['info'](_0x4233('0x49'),_0x4233('0x4a'));_0x3840d2[_0x4233('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46ff6d['serverUrl'],_0x3840d2[_0x4233('0x4c')],md5(_0x3840d2[_0x4233('0x4c')]));}else{_0x3840d2[_0x4233('0x4b')]='';}headers[_0x4233('0x4d')]=getAuth(_0x46ff6d);return getUser(_0x46ff6d,_0x2a23f8[_0x4233('0x4e')])['then'](function(_0x1c5e43){_0xa4ab6a=_0x1c5e43;logger['info'](_0x4233('0x4f'),_0xa4ab6a['id']);return getEndUser(_0x46ff6d,_0x3840d2[_0x4233('0x50')],_0x3840d2[_0x4233('0x51')]);})['then'](function(_0xbdaaa4){_0x4a6d7d=_0xbdaaa4;logger[_0x4233('0xd')](_0x4233('0x52'),_0x4a6d7d['id']);return getTicket(_0x46ff6d,_0xa4ab6a,_0x4a6d7d,_0x333c56,_0x3840d2);})['then'](function(_0x59e9dd){if(_0x59e9dd){logger[_0x4233('0xd')](_0x4233('0x53'),_0x59e9dd['id']);switch(_0x46ff6d[_0x4233('0x39')]){case'integrationTab':logger[_0x4233('0xd')]('[QUEUE]',_0x4233('0x54'));return request({'uri':util[_0x4233('0xe')](_0x4233('0x55'),_0x46ff6d['remoteUri'],_0xa4ab6a['id'],_0x59e9dd['id']),'method':'POST'});case _0x4233('0x56'):logger[_0x4233('0xd')](_0x4233('0x49'),_0x4233('0x57'));emit(util[_0x4233('0xe')](_0x4233('0x58'),_0x2a23f8[_0x4233('0x13')]),_0x4233('0x59'),{'uri':util[_0x4233('0xe')](_0x4233('0x5a'),_0x46ff6d[_0x4233('0x10')],_0x59e9dd['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4233('0x5b')](function(_0xe1f2ad){logger[_0x4233('0x5c')](_0x4233('0x5d'),util['inspect'](_0xe1f2ad,{'showHidden':!![],'depth':null}));});};exports[_0x4233('0x5e')]=function(_0x1fbd15,_0x4b6b6e,_0x5b4eb6,_0x1d9ffa,_0x3546dd,_0x7b7395,_0x4c2a35){var _0x2a40d4,_0x268589;_0x7b7395['remoteUri']=intUtil[_0x4233('0x46')](_0x7b7395[_0x4233('0x10')]);_0x7b7395['serverUrl']=intUtil[_0x4233('0x46')](_0x7b7395['serverUrl']);if(_0x4c2a35&&_0x4c2a35[_0x4233('0x5f')]&&_0x4c2a35[_0x4233('0x5f')]!==_0x4233('0x60')){logger[_0x4233('0xd')](_0x4233('0x61'),_0x4233('0x4a'));_0x4b6b6e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7b7395[_0x4233('0x47')],_0x4b6b6e[_0x4233('0x4c')],md5(_0x4b6b6e['uniqueid']));}headers[_0x4233('0x4d')]=getAuth(_0x7b7395);return getUser(_0x7b7395,_0x1d9ffa['email'])[_0x4233('0x18')](function(_0x1fbdd7){_0x2a40d4=_0x1fbdd7;logger[_0x4233('0xd')]('The\x20User\x20ID\x20is:',_0x2a40d4['id']);return getEndUser(_0x7b7395,_0x4b6b6e[_0x4233('0x62')],_0x4b6b6e[_0x4233('0x63')]);})[_0x4233('0x18')](function(_0x10db3b){_0x268589=_0x10db3b;logger[_0x4233('0xd')](_0x4233('0x52'),_0x268589['id']);return getTicket(_0x7b7395,_0x2a40d4,_0x268589,_0x5b4eb6,_0x4b6b6e);})['then'](function(_0x17ad3d){if(_0x17ad3d){logger[_0x4233('0xd')](_0x4233('0x53'),_0x17ad3d['id']);switch(_0x7b7395[_0x4233('0x39')]){case _0x4233('0x64'):logger[_0x4233('0xd')]('[OUTBOUND]',_0x4233('0x54'));return request({'uri':util[_0x4233('0xe')](_0x4233('0x55'),_0x7b7395[_0x4233('0x10')],_0x2a40d4['id'],_0x17ad3d['id']),'method':_0x4233('0x11')});case _0x4233('0x56'):logger[_0x4233('0xd')]('[OUTBOUND]',_0x4233('0x57'));emit(util[_0x4233('0xe')](_0x4233('0x58'),_0x1d9ffa[_0x4233('0x13')]),_0x4233('0x59'),{'uri':util['format'](_0x4233('0x5a'),_0x7b7395[_0x4233('0x10')],_0x17ad3d['id'])});break;default:logger[_0x4233('0x5c')]('[OUTBOUND]',_0x4233('0x65'));}}})[_0x4233('0x5b')](function(_0x602555){logger[_0x4233('0x5c')](_0x4233('0x66'),util['inspect'](_0x602555,{'showHidden':!![],'depth':null}));});};exports[_0x4233('0x67')]=function(_0xd54a5e,_0x2fd69d,_0x9f5d3,_0x1798bd,_0x14b74e,_0x568061){var _0x29ca08,_0xa347be;_0x568061[_0x4233('0x10')]=intUtil[_0x4233('0x46')](_0x568061[_0x4233('0x10')]);_0x568061[_0x4233('0x47')]=intUtil[_0x4233('0x46')](_0x568061['serverUrl']);if(_0x14b74e&&_0x14b74e[_0x4233('0x48')]){logger[_0x4233('0xd')](_0x4233('0x68'),_0x4233('0x4a'));_0x2fd69d['recordingURL']=util[_0x4233('0xe')](_0x4233('0x69'),_0x568061[_0x4233('0x47')],_0x2fd69d[_0x4233('0x4c')],md5(_0x2fd69d[_0x4233('0x4c')]));}else{_0x2fd69d[_0x4233('0x4b')]='';}headers[_0x4233('0x4d')]=getAuth(_0x568061);return getUser(_0x568061)[_0x4233('0x18')](function(_0x3117a8){_0x29ca08=_0x3117a8;logger[_0x4233('0xd')](_0x4233('0x4f'),_0x29ca08['id']);return getEndUser(_0x568061,_0x2fd69d[_0x4233('0x50')],_0x2fd69d['calleridnum']);})[_0x4233('0x18')](function(_0x41eeff){_0xa347be=_0x41eeff;logger[_0x4233('0xd')](_0x4233('0x52'),_0xa347be['id']);return getTicket(_0x568061,_0x29ca08,_0xa347be,_0x9f5d3,_0x2fd69d);})['then'](function(_0x1237e3){if(_0x1237e3){logger[_0x4233('0xd')]('The\x20Ticket\x20ID\x20is:',_0x1237e3['id']);}})[_0x4233('0x5b')](function(_0x48ac6a){logger[_0x4233('0x5c')](_0x4233('0x6a'),util[_0x4233('0x6b')](_0x48ac6a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb869=['error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','destcalleridname','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','Recording\x20is\x20enabled!','calleridname','The\x20Ticket\x20ID\x20is:','catch','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','format','remoteUri','POST','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%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','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','forEach','type','string','nameField','customField','content','custom_fields','variable','idField','variableName','push','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s'];(function(_0x589fb1,_0x5d8fb5){var _0x12195c=function(_0x2f9a9c){while(--_0x2f9a9c){_0x589fb1['push'](_0x589fb1['shift']());}};_0x12195c(++_0x5d8fb5);}(_0xb869,0xe0));var _0x9b86=function(_0x41388c,_0x536d38){_0x41388c=_0x41388c-0x0;var _0x2d6f10=_0xb869[_0x41388c];return _0x2d6f10;};'use strict';var _=require('lodash');var rp=require(_0x9b86('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9b86('0x1'));var intUtil=require('./util');var config=require(_0x9b86('0x2'));var logger=require(_0x9b86('0x3'))('zendesk');config[_0x9b86('0x4')]=_[_0x9b86('0x5')](config[_0x9b86('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9b86('0x6'))(new Redis(config[_0x9b86('0x4')]));function emit(_0xa20453,_0x2550c7,_0x5ea2ad){io['to'](_0xa20453)['emit'](_0x2550c7,_0x5ea2ad);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x3fd31c,_0x518e19,_0x4f5bab,_0x5dc7b3,_0x8e78eb){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x9b86('0x7')]('%s/tickets.json',_0x3fd31c[_0x9b86('0x8')]),'method':_0x9b86('0x9'),'body':{'ticket':_['merge']({'requester_id':_0x4f5bab['id'],'submitter_id':_0x518e19?_0x518e19['id']:undefined,'assignee_id':_0x518e19?_0x518e19['id']:undefined,'tags':getTags(_0x5dc7b3[_0x9b86('0xa')],_0x9b86('0xb')),'subject':intUtil[_0x9b86('0xc')](_0x5dc7b3['Subjects'],_0x8e78eb,'\x20'),'description':intUtil['getString'](_0x5dc7b3[_0x9b86('0xd')],_0x8e78eb,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5dc7b3[_0x9b86('0xd')],_0x8e78eb,'\x0a')}},getCustomFields(_0x5dc7b3[_0x9b86('0xe')],_0x8e78eb))}})[_0x9b86('0xf')](function(_0x1fd77b){logger['info'](_0x9b86('0x10'));return _0x1fd77b[_0x9b86('0x11')];});}function getUser(_0x4ea3c0,_0x44d75f){if(intUtil[_0x9b86('0x12')](_0x44d75f)){logger[_0x9b86('0x13')](_0x9b86('0x14'),_0x44d75f);return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x15'),_0x4ea3c0['remoteUri']),'qs':{'query':util[_0x9b86('0x7')](_0x9b86('0x16'),_0x44d75f)}})[_0x9b86('0xf')](function(_0x3298ba){if(_0x3298ba['count']){logger[_0x9b86('0x13')](_0x9b86('0x17'));return _[_0x9b86('0x18')](_0x3298ba[_0x9b86('0x19')],{'email':_0x44d75f,'role':_0x9b86('0x1a')});}else{logger[_0x9b86('0x13')](_0x9b86('0x1b'));return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x1c'),_0x4ea3c0[_0x9b86('0x8')])})['then'](function(_0x5e1d09){logger['info'](_0x9b86('0x1d'));return _0x5e1d09[_0x9b86('0x1e')];});}});}else{logger[_0x9b86('0x13')](_0x9b86('0x1b'));return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x1c'),_0x4ea3c0[_0x9b86('0x8')])})[_0x9b86('0xf')](function(_0x16e9b2){logger[_0x9b86('0x13')](_0x9b86('0x1d'));return _0x16e9b2[_0x9b86('0x1e')];});}}function getEndUser(_0xdaf57d,_0x3cb8be,_0x1069f7){logger[_0x9b86('0x13')]('Searching\x20enduser\x20with\x20phone',_0x1069f7);return request({'uri':util[_0x9b86('0x7')]('%s/search.json',_0xdaf57d[_0x9b86('0x8')]),'qs':{'query':util[_0x9b86('0x7')](_0x9b86('0x1f'),_0x1069f7)}})[_0x9b86('0xf')](function(_0x27a08c){var _0x2fd8d3;if(_0x27a08c[_0x9b86('0x19')][_0x9b86('0x20')]){_0x27a08c[_0x9b86('0x19')]=_[_0x9b86('0x21')](_0x27a08c[_0x9b86('0x19')],{'suspended':![],'role':_0x9b86('0x22')});if(_0x27a08c[_0x9b86('0x19')][_0x9b86('0x20')]){_0x2fd8d3=_[_0x9b86('0x23')](_0x27a08c[_0x9b86('0x19')]);}}if(_0x2fd8d3){logger[_0x9b86('0x13')](_0x9b86('0x24'));return _0x2fd8d3;}else{logger[_0x9b86('0x13')](_0x9b86('0x25'));return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x26'),_0xdaf57d[_0x9b86('0x8')]),'method':'POST','body':{'user':{'role':_0x9b86('0x22'),'name':util[_0x9b86('0x7')](_0x9b86('0x27'),_0x3cb8be||_0x1069f7),'phone':_0x1069f7}}})[_0x9b86('0xf')](function(_0x41e1ce){logger[_0x9b86('0x13')](_0x9b86('0x28'));return _0x41e1ce[_0x9b86('0x1e')];});}});}function getAuth(_0x532c8b){var _0x42d0df;if(_0x532c8b[_0x9b86('0x29')]===_0x9b86('0x2a')){_0x42d0df=util[_0x9b86('0x7')](_0x9b86('0x2b'),_0x532c8b[_0x9b86('0x2c')],_0x532c8b['password']);}else if(_0x532c8b[_0x9b86('0x29')]==='token'){_0x42d0df=util[_0x9b86('0x7')](_0x9b86('0x2d'),_0x532c8b['username'],_0x532c8b['token']);}return util[_0x9b86('0x7')](_0x9b86('0x2e'),new Buffer(_0x42d0df)[_0x9b86('0x2f')](_0x9b86('0x30')));}function request(_0x433b95){logger[_0x9b86('0x31')](_0x9b86('0x32'),JSON['stringify'](_0x433b95));return rp(_[_0x9b86('0x5')](_0x433b95,{'method':_0x9b86('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x450680,_0x4cf96f){var _0x4d5e30=[];if(_0x450680&&_0x450680[_0x9b86('0x20')]>0x0){_0x4d5e30=_[_0x9b86('0x34')](_0x450680,_0x4cf96f);}return _0x4d5e30;}function getCustomFields(_0x16eecb,_0x11686b){var _0x140728=[];var _0x9f7295={'custom_fields':[]};if(_0x16eecb[_0x9b86('0x20')]>0x0){_[_0x9b86('0x35')](_0x16eecb,function(_0x49fb08){if(_0x49fb08[_0x9b86('0x36')]===_0x9b86('0x37')&&_0x49fb08[_0x9b86('0x38')]&&!_0x49fb08[_0x9b86('0x39')]){_0x9f7295[_0x49fb08[_0x9b86('0x38')]['toLowerCase']()]=_0x49fb08[_0x9b86('0x3a')][_0x9b86('0x2f')]();}else if(_0x49fb08['type']===_0x9b86('0x37')&&_0x49fb08['idField']&&_0x49fb08[_0x9b86('0x39')]){_0x9f7295[_0x9b86('0x3b')]['push']({'id':_0x49fb08['idField'],'value':_0x49fb08[_0x9b86('0x3a')][_0x9b86('0x2f')]()});}else if(_0x49fb08[_0x9b86('0x36')]===_0x9b86('0x3c')&&_0x49fb08['variableName']&&_0x49fb08[_0x9b86('0x3d')]&&_0x49fb08[_0x9b86('0x39')]){_0x11686b[_0x49fb08[_0x9b86('0x3e')]]&&_0x9f7295[_0x9b86('0x3b')][_0x9b86('0x3f')]({'id':_0x49fb08[_0x9b86('0x3d')],'value':_0x11686b[_0x49fb08[_0x9b86('0x3e')]]['toString']()});}else if(_0x49fb08['type']===_0x9b86('0x40')&&_0x49fb08['Variable']&&_0x49fb08['Variable']['name']&&_0x49fb08[_0x9b86('0x3d')]&&_0x49fb08[_0x9b86('0x39')]){_0x11686b[_0x49fb08[_0x9b86('0x41')]['name'][_0x9b86('0x42')]()]&&_0x9f7295[_0x9b86('0x3b')][_0x9b86('0x3f')]({'id':_0x49fb08['idField'],'value':_0x11686b[_0x49fb08[_0x9b86('0x41')][_0x9b86('0xb')][_0x9b86('0x42')]()]['toString']()});}});}return _0x9f7295;}exports[_0x9b86('0x43')]=function(_0x2f5db1,_0x3e7fef,_0x30178b,_0x120416,_0x3ca40a,_0x1816ea){var _0x47b41f,_0x30cb7a;_0x1816ea[_0x9b86('0x8')]=intUtil['stripTrailingSlash'](_0x1816ea[_0x9b86('0x8')]);_0x1816ea[_0x9b86('0x44')]=intUtil[_0x9b86('0x45')](_0x1816ea[_0x9b86('0x44')]);if(_0x3ca40a&&_0x3ca40a[_0x9b86('0x46')]){logger[_0x9b86('0x13')](_0x9b86('0x47'),'Recording\x20is\x20enabled!');_0x3e7fef[_0x9b86('0x48')]=util[_0x9b86('0x7')](_0x9b86('0x49'),_0x1816ea[_0x9b86('0x44')],_0x3e7fef[_0x9b86('0x4a')],md5(_0x3e7fef[_0x9b86('0x4a')]));}else{_0x3e7fef[_0x9b86('0x48')]='';}headers['Authorization']=getAuth(_0x1816ea);return getUser(_0x1816ea,_0x120416[_0x9b86('0x4b')])[_0x9b86('0xf')](function(_0x52a9a0){_0x47b41f=_0x52a9a0;logger[_0x9b86('0x13')](_0x9b86('0x4c'),_0x47b41f['id']);return getEndUser(_0x1816ea,_0x3e7fef['calleridname'],_0x3e7fef[_0x9b86('0x4d')]);})['then'](function(_0x571237){_0x30cb7a=_0x571237;logger[_0x9b86('0x13')](_0x9b86('0x4e'),_0x30cb7a['id']);return getTicket(_0x1816ea,_0x47b41f,_0x30cb7a,_0x30178b,_0x3e7fef);})[_0x9b86('0xf')](function(_0x3d4059){if(_0x3d4059){logger[_0x9b86('0x13')]('The\x20Ticket\x20ID\x20is:',_0x3d4059['id']);switch(_0x1816ea['type']){case _0x9b86('0x4f'):logger[_0x9b86('0x13')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x50'),_0x1816ea[_0x9b86('0x8')],_0x47b41f['id'],_0x3d4059['id']),'method':'POST'});case'newTab':logger[_0x9b86('0x13')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9b86('0x7')]('user:%s',_0x120416[_0x9b86('0xb')]),'trigger:browser:url',{'uri':util[_0x9b86('0x7')](_0x9b86('0x51'),_0x1816ea[_0x9b86('0x8')],_0x3d4059['id'])});break;default:logger[_0x9b86('0x52')](_0x9b86('0x47'),_0x9b86('0x53'));}}})['catch'](function(_0x5849e3){logger[_0x9b86('0x52')](_0x9b86('0x54'),util['inspect'](_0x5849e3,{'showHidden':!![],'depth':null}));});};exports[_0x9b86('0x55')]=function(_0x3a318f,_0x422902,_0x2cba01,_0x533d71,_0x493cc0,_0x427503,_0x5e7196){var _0x3e4dd6,_0x2aff82;_0x427503[_0x9b86('0x8')]=intUtil[_0x9b86('0x45')](_0x427503['remoteUri']);_0x427503[_0x9b86('0x44')]=intUtil[_0x9b86('0x45')](_0x427503[_0x9b86('0x44')]);if(_0x5e7196&&_0x5e7196['recordingFormat']&&_0x5e7196[_0x9b86('0x56')]!=='none'){logger['info'](_0x9b86('0x57'),'Recording\x20is\x20enabled!');_0x422902[_0x9b86('0x48')]=util['format'](_0x9b86('0x49'),_0x427503['serverUrl'],_0x422902[_0x9b86('0x4a')],md5(_0x422902[_0x9b86('0x4a')]));}headers['Authorization']=getAuth(_0x427503);return getUser(_0x427503,_0x533d71[_0x9b86('0x4b')])[_0x9b86('0xf')](function(_0x4027b8){_0x3e4dd6=_0x4027b8;logger[_0x9b86('0x13')](_0x9b86('0x4c'),_0x3e4dd6['id']);return getEndUser(_0x427503,_0x422902[_0x9b86('0x58')],_0x422902['destcalleridnum']);})[_0x9b86('0xf')](function(_0x3e1f83){_0x2aff82=_0x3e1f83;logger[_0x9b86('0x13')]('The\x20Enduser\x20ID\x20is:',_0x2aff82['id']);return getTicket(_0x427503,_0x3e4dd6,_0x2aff82,_0x2cba01,_0x422902);})['then'](function(_0xfffc51){if(_0xfffc51){logger['info']('The\x20Ticket\x20ID\x20is:',_0xfffc51['id']);switch(_0x427503[_0x9b86('0x36')]){case _0x9b86('0x4f'):logger[_0x9b86('0x13')](_0x9b86('0x57'),_0x9b86('0x59'));return request({'uri':util[_0x9b86('0x7')](_0x9b86('0x50'),_0x427503[_0x9b86('0x8')],_0x3e4dd6['id'],_0xfffc51['id']),'method':_0x9b86('0x9')});case _0x9b86('0x5a'):logger[_0x9b86('0x13')](_0x9b86('0x57'),_0x9b86('0x5b'));emit(util[_0x9b86('0x7')](_0x9b86('0x5c'),_0x533d71[_0x9b86('0xb')]),_0x9b86('0x5d'),{'uri':util[_0x9b86('0x7')](_0x9b86('0x51'),_0x427503[_0x9b86('0x8')],_0xfffc51['id'])});break;default:logger[_0x9b86('0x52')](_0x9b86('0x57'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x9c3178){logger[_0x9b86('0x52')](_0x9b86('0x5e'),util['inspect'](_0x9c3178,{'showHidden':!![],'depth':null}));});};exports[_0x9b86('0x5f')]=function(_0x1c059c,_0x3d3889,_0x29df49,_0x2fc6c9,_0xbd9baa,_0x487c8d){var _0x406c57,_0x245730;_0x487c8d[_0x9b86('0x8')]=intUtil[_0x9b86('0x45')](_0x487c8d[_0x9b86('0x8')]);_0x487c8d[_0x9b86('0x44')]=intUtil[_0x9b86('0x45')](_0x487c8d[_0x9b86('0x44')]);if(_0xbd9baa&&_0xbd9baa[_0x9b86('0x46')]){logger[_0x9b86('0x13')](_0x9b86('0x60'),_0x9b86('0x61'));_0x3d3889[_0x9b86('0x48')]=util[_0x9b86('0x7')](_0x9b86('0x49'),_0x487c8d[_0x9b86('0x44')],_0x3d3889[_0x9b86('0x4a')],md5(_0x3d3889[_0x9b86('0x4a')]));}else{_0x3d3889[_0x9b86('0x48')]='';}headers['Authorization']=getAuth(_0x487c8d);return getUser(_0x487c8d)[_0x9b86('0xf')](function(_0x44b5fb){_0x406c57=_0x44b5fb;logger['info']('The\x20User\x20ID\x20is:',_0x406c57['id']);return getEndUser(_0x487c8d,_0x3d3889[_0x9b86('0x62')],_0x3d3889['calleridnum']);})[_0x9b86('0xf')](function(_0x26f64a){_0x245730=_0x26f64a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x245730['id']);return getTicket(_0x487c8d,_0x406c57,_0x245730,_0x29df49,_0x3d3889);})[_0x9b86('0xf')](function(_0x7222a9){if(_0x7222a9){logger[_0x9b86('0x13')](_0x9b86('0x63'),_0x7222a9['id']);}})[_0x9b86('0x64')](function(_0x13e96a){logger[_0x9b86('0x52')](_0x9b86('0x65'),util['inspect'](_0x13e96a,{'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 08636e0..6ab2c1e 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 _0x7095=['SEMODULE','Leads','SEID','','hasOwnProperty','encodeXML','POST','host','crmapi','then','toJson','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','authToken','users','log','zoho\x20data\x20users','user','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','parse','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','debug','[HTTP]','forEach','string','idField','toString','type','variableName','Variable','name','toLowerCase','indexOf','split','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Inbound','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','serverUrl','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','monitor_format','[ABANDONED]','md5','util','./util','xml2json','entities','moment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Call\x20Result','Called','Answered','rejected','Rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','mm:ss','answertime','endtime','diff','CONTACTID','LEADID'];(function(_0x421453,_0x3441b9){var _0x11bb6f=function(_0x3aa84d){while(--_0x3aa84d){_0x421453['push'](_0x421453['shift']());}};_0x11bb6f(++_0x3441b9);}(_0x7095,0x15c));var _0x5709=function(_0x1a15b9,_0x2488f8){_0x1a15b9=_0x1a15b9-0x0;var _0x16fa57=_0x7095[_0x1a15b9];return _0x16fa57;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x5709('0x0'));var util=require(_0x5709('0x1'));var intUtil=require(_0x5709('0x2'));var parser=require(_0x5709('0x3'));var entities=require(_0x5709('0x4'));var moment=require(_0x5709('0x5'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x5709('0x6'))('zoho');config[_0x5709('0x7')]=_['defaults'](config[_0x5709('0x7')],{'host':_0x5709('0x8'),'port':0x18eb});var io=require(_0x5709('0x9'))(new Redis(config['redis']));function emit(_0x45912c,_0x335f9a,_0x10130b){io['to'](_0x45912c)['emit'](_0x335f9a,_0x10130b);}var headers={'Content-Type':_0x5709('0xa'),'Accept':'application/json'};function getCall(_0x50b872,_0x493ba5,_0x46b0ab,_0x1d9da2,_0x2aaf2f,_0x1bb11a){logger[_0x5709('0xb')](_0x5709('0xc'));var _0x129032=_[_0x5709('0xd')]({'SMOWNERID':_0x493ba5['id'],'Call Type':_0x1bb11a||_0x5709('0xe'),'Call Start Time':(_0x1bb11a===_0x5709('0xf')?_0x2aaf2f[_0x5709('0x10')]:_0x2aaf2f[_0x5709('0x11')])||moment()[_0x5709('0x12')](_0x5709('0x13')),'Subject':intUtil[_0x5709('0x14')](_0x1d9da2[_0x5709('0x15')],_0x2aaf2f,'\x20'),'Description':intUtil[_0x5709('0x14')](_0x1d9da2[_0x5709('0x16')],_0x2aaf2f,'\x0a')},getCustomFields(_0x1d9da2[_0x5709('0x17')],_0x2aaf2f));switch(_0x2aaf2f[_0x5709('0x18')]){case _0x5709('0x19'):_0x129032[_0x5709('0x1a')]=_0x5709('0x1b');break;case'complete':case'connect':_0x129032[_0x5709('0x1a')]=_0x5709('0x1c');break;case _0x5709('0x1d'):_0x129032['Call\x20Result']=_0x5709('0x1e');break;case _0x5709('0x1f'):_0x129032['Call\x20Result']=_0x5709('0x20');break;default:}if(_0x2aaf2f[_0x5709('0x21')]){_0x129032[_0x5709('0x22')]=moment[_0x5709('0x23')](parseInt(_0x2aaf2f[_0x5709('0x21')])*0x3e8)[_0x5709('0x12')](_0x5709('0x24'));}else if(_0x2aaf2f[_0x5709('0x25')]&&_0x2aaf2f['endtime']){_0x129032['Call\x20Duration']=moment[_0x5709('0x23')](moment(_0x2aaf2f[_0x5709('0x26')],'YYYY-MM-DD\x20HH:mm:ss')[_0x5709('0x27')](moment(_0x2aaf2f[_0x5709('0x10')],_0x5709('0x13'))))[_0x5709('0x12')]('mm:ss');}if(_0x46b0ab[_0x5709('0x28')]){_0x129032['CONTACTID']=_0x46b0ab[_0x5709('0x28')];}else if(_0x46b0ab[_0x5709('0x29')]){_0x129032[_0x5709('0x2a')]=_0x5709('0x2b');_0x129032[_0x5709('0x2c')]=_0x46b0ab[_0x5709('0x29')];}var _0x29405d=_0x5709('0x2d');for(var _0x55f65a in _0x129032){if(_0x129032[_0x5709('0x2e')](_0x55f65a)){_0x29405d+=util[_0x5709('0x12')]('%s',entities[_0x5709('0x2f')](_0x55f65a),entities[_0x5709('0x2f')](_0x129032[_0x55f65a]));}}_0x29405d+='';return request({'method':_0x5709('0x30'),'uri':util[_0x5709('0x12')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x50b872[_0x5709('0x31')]),'qs':{'authtoken':_0x50b872['authToken'],'scope':_0x5709('0x32'),'xmlData':_0x29405d},'json':!![]})[_0x5709('0x33')](function(_0x29a959){_0x29a959=JSON['parse'](parser[_0x5709('0x34')](_0x29a959));if(_0x29a959[_0x5709('0x35')]){if(_0x29a959[_0x5709('0x35')][_0x5709('0x36')]&&_0x29a959[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x37')]){logger[_0x5709('0xb')](_0x5709('0x38'));return{'id':_0x29a959[_0x5709('0x35')]['result'][_0x5709('0x37')]['FL'][0x0]['$t']};}}throw new Error(_0x5709('0x39')+JSON[_0x5709('0x3a')](_0x29a959));});}function getUser(_0x1decf8,_0xb6ef58){return request({'method':_0x5709('0x3b'),'uri':util[_0x5709('0x12')](_0x5709('0x3c'),_0x1decf8[_0x5709('0x31')]),'qs':{'type':'AllUsers','authtoken':_0x1decf8[_0x5709('0x3d')],'scope':'crmapi'},'json':!![]})['then'](function(_0x3a05ae){if(_0x3a05ae[_0x5709('0x3e')]&&_0x3a05ae['users']['user']){var _0x3b3899;console[_0x5709('0x3f')](_0x5709('0x40'),_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')]);if(_['isArrayLikeObject'](_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')])){console['log']('zoho\x20data\x20users',_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')]);if(!_[_0x5709('0x42')](_0xb6ef58)){_0x3b3899=_[_0x5709('0x43')](_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')],{'email':_0xb6ef58,'profile':_0x5709('0x44'),'status':_0x5709('0x45')});}if(!_['isNil'](_0x3b3899)){logger[_0x5709('0xb')](_0x5709('0x46'));}else{logger[_0x5709('0xb')](_0x5709('0x47'));_0x3b3899=_[_0x5709('0x43')](_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')],{'profile':_0x5709('0x48')});}console['log'](_0x5709('0x49'),_0x3b3899);return _0x3b3899;}else{if(_0x3a05ae[_0x5709('0x3e')][_0x5709('0x41')]['profile']===_0x5709('0x48')){logger[_0x5709('0xb')](_0x5709('0x47'));_0x3b3899=_0x3a05ae['users'][_0x5709('0x41')];return _0x3b3899;}else{logger[_0x5709('0x4a')](_0x5709('0x4b'),JSON['stringify'](_0x3a05ae));throw new Error(_0x5709('0x4c')+JSON[_0x5709('0x3a')](_0x3a05ae));}}}else{logger['error'](_0x5709('0x4b'),JSON[_0x5709('0x3a')](_0x3a05ae));throw new Error(_0x5709('0x4c')+JSON[_0x5709('0x3a')](_0x3a05ae));}});}function getEndUser(_0x59e66b,_0xe4b936,_0x3cd49b){logger[_0x5709('0xb')]('Searching\x20enduser\x20with\x20phone',_0x3cd49b);return request({'method':'GET','uri':util[_0x5709('0x12')](_0x5709('0x4d'),_0x59e66b[_0x5709('0x31')]),'qs':{'authtoken':_0x59e66b[_0x5709('0x3d')],'scope':'crmapi','criteria':util[_0x5709('0x12')](_0x5709('0x4e'),_0x3cd49b)},'json':!![]})[_0x5709('0x33')](function(_0x1c12ab){if(_0x1c12ab[_0x5709('0x35')]&&_0x1c12ab['response'][_0x5709('0x36')]){logger[_0x5709('0xb')](_0x5709('0x4f'));var _0x36020c={};var _0x3ac823=_0x1c12ab[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x50')][_0x5709('0x51')]['no']?_0x1c12ab[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x50')][_0x5709('0x51')]['FL']:_0x1c12ab[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x50')][_0x5709('0x51')][0x0]['FL'];for(var _0x1366ae=0x0,_0x3c15db=_0x3ac823[_0x5709('0x52')];_0x1366ae<_0x3c15db;_0x1366ae++){_0x36020c[_0x3ac823[_0x1366ae][_0x5709('0x53')]]=_0x3ac823[_0x1366ae][_0x5709('0x54')];}return _0x36020c;}else{return request({'method':_0x5709('0x3b'),'uri':util[_0x5709('0x12')](_0x5709('0x55'),_0x59e66b['host']),'qs':{'authtoken':_0x59e66b[_0x5709('0x3d')],'scope':'crmapi','criteria':util[_0x5709('0x12')](_0x5709('0x4e'),_0x3cd49b)},'json':!![]})[_0x5709('0x33')](function(_0x67f9f2){if(_0x67f9f2[_0x5709('0x35')]&&_0x67f9f2[_0x5709('0x35')][_0x5709('0x36')]){logger[_0x5709('0xb')](_0x5709('0x56'));var _0x5a4dd0={};var _0x51de78=_0x67f9f2[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x2b')]['row']['no']?_0x67f9f2[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x2b')]['row']['FL']:_0x67f9f2['response'][_0x5709('0x36')][_0x5709('0x2b')][_0x5709('0x51')][0x0]['FL'];for(var _0x12e0a8=0x0,_0x45f142=_0x51de78[_0x5709('0x52')];_0x12e0a8<_0x45f142;_0x12e0a8++){_0x5a4dd0[_0x51de78[_0x12e0a8][_0x5709('0x53')]]=_0x51de78[_0x12e0a8][_0x5709('0x54')];}return _0x5a4dd0;}else{logger[_0x5709('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0xe4b936=getName(_0xe4b936);return request({'method':_0x5709('0x30'),'uri':util['format'](_0x5709('0x57'),_0x59e66b['host']),'qs':{'authtoken':_0x59e66b[_0x5709('0x3d')],'scope':_0x5709('0x32'),'xmlData':util['format'](_0x5709('0x58'),entities[_0x5709('0x2f')](_0xe4b936[0x0]),entities[_0x5709('0x2f')](_0xe4b936[0x1]),_0x3cd49b)},'json':!![]})[_0x5709('0x33')](function(_0x5e4e1e){_0x5e4e1e=JSON[_0x5709('0x59')](parser[_0x5709('0x34')](_0x5e4e1e));if(_0x5e4e1e['response']){if(_0x5e4e1e['response'][_0x5709('0x36')]&&_0x5e4e1e['response'][_0x5709('0x36')][_0x5709('0x37')]){logger[_0x5709('0xb')]('Enduser\x20created.');return request({'method':_0x5709('0x3b'),'uri':util[_0x5709('0x12')](_0x5709('0x5a'),_0x59e66b[_0x5709('0x31')]),'qs':{'authtoken':_0x59e66b['authToken'],'scope':_0x5709('0x32'),'id':_0x5e4e1e[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x37')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x5709('0x5b')+JSON[_0x5709('0x3a')](_0x5e4e1e));})[_0x5709('0x33')](function(_0x37da7b){if(_0x37da7b['response']){if(_0x37da7b[_0x5709('0x35')]['result']){var _0x451f50={};for(var _0x77576c=0x0,_0x2b5cfb=_0x37da7b[_0x5709('0x35')]['result'][_0x5709('0x2b')][_0x5709('0x51')]['FL'][_0x5709('0x52')];_0x77576c<_0x2b5cfb;_0x77576c++){_0x451f50[_0x37da7b[_0x5709('0x35')][_0x5709('0x36')][_0x5709('0x2b')]['row']['FL'][_0x77576c][_0x5709('0x53')]]=_0x37da7b['response'][_0x5709('0x36')][_0x5709('0x2b')][_0x5709('0x51')]['FL'][_0x77576c][_0x5709('0x54')];}return _0x451f50;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x5709('0x3a')](_0x37da7b));});}});}});}function request(_0x527306){logger[_0x5709('0x5c')](_0x5709('0x5d'),JSON[_0x5709('0x3a')](_0x527306));return rp(_0x527306);}function getCustomFields(_0x3cc673,_0x44e4eb){var _0x369724={};if(_0x3cc673['length']>0x0){_[_0x5709('0x5e')](_0x3cc673,function(_0x5daa54){if(_0x5daa54['type']===_0x5709('0x5f')&&_0x5daa54[_0x5709('0x60')]){_0x369724[_0x5daa54[_0x5709('0x60')]]=_0x5daa54[_0x5709('0x54')][_0x5709('0x61')]();}else if(_0x5daa54[_0x5709('0x62')]==='variable'&&_0x5daa54[_0x5709('0x63')]&&_0x5daa54['idField']&&_0x44e4eb[_0x5daa54[_0x5709('0x63')]]){_0x369724[_0x5daa54[_0x5709('0x60')]]=_0x44e4eb[_0x5daa54[_0x5709('0x63')]]['toString']();}else if(_0x5daa54[_0x5709('0x62')]==='customVariable'&&_0x5daa54[_0x5709('0x64')]&&_0x5daa54[_0x5709('0x64')]['name']&&_0x5daa54['idField']&&_0x44e4eb[_0x5daa54['Variable'][_0x5709('0x65')][_0x5709('0x66')]()]){_0x369724[_0x5daa54[_0x5709('0x60')]]=_0x44e4eb[_0x5daa54[_0x5709('0x64')]['name'][_0x5709('0x66')]()][_0x5709('0x61')]();}});}return _0x369724;}function getName(_0x4910dd){if(_0x4910dd[_0x5709('0x67')]('\x20')>0x0){var _0x4a9980=_0x4910dd[_0x5709('0x68')](/ (.+)/);if(_0x4a9980[0x1]){return _0x4a9980;}}return[_0x4910dd,_0x4910dd];}exports[_0x5709('0x69')]=function(_0x1922b3,_0x2871af,_0x55853a,_0x289954,_0x4b8331,_0x36b67a){var _0x18d543,_0x56c9c9;_0x36b67a[_0x5709('0x31')]=intUtil[_0x5709('0x6a')](_0x36b67a['host']);_0x36b67a['serverUrl']=intUtil[_0x5709('0x6a')](_0x36b67a['serverUrl']);if(_0x4b8331&&_0x4b8331['monitor_format']){logger[_0x5709('0xb')](_0x5709('0x6b'),_0x5709('0x6c'));_0x2871af['recordingURL']=util['format'](_0x5709('0x6d'),_0x36b67a['serverUrl'],_0x2871af[_0x5709('0x6e')],md5(_0x2871af[_0x5709('0x6e')]));}else{_0x2871af['recordingURL']='';}return getUser(_0x36b67a,_0x289954[_0x5709('0x6f')])[_0x5709('0x33')](function(_0x24f2e7){_0x18d543=_0x24f2e7;logger[_0x5709('0xb')]('The\x20User\x20ID\x20is:',_0x18d543['id']);return getEndUser(_0x36b67a,_0x2871af[_0x5709('0x70')],_0x2871af[_0x5709('0x71')]);})[_0x5709('0x33')](function(_0x3d2861){_0x56c9c9=_0x3d2861;logger[_0x5709('0xb')]('The\x20Enduser\x20ID\x20is:',_0x56c9c9[_0x5709('0x28')]||_0x56c9c9[_0x5709('0x29')]);return getCall(_0x36b67a,_0x18d543,_0x56c9c9,_0x55853a,_0x2871af,_0x5709('0x72'));})['then'](function(_0x77b081){if(_0x77b081){logger[_0x5709('0xb')]('The\x20Call\x20ID\x20is:',_0x77b081['id']);logger['info'](_0x5709('0x6b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5709('0x73'),_0x289954[_0x5709('0x65')]),'trigger:browser:url',{'uri':util[_0x5709('0x12')](_0x5709('0x74'),_0x36b67a['host'],_0x77b081['id'])});}})[_0x5709('0x75')](function(_0x3baa8e){logger[_0x5709('0x4a')](_0x5709('0x6b'),JSON[_0x5709('0x3a')](_0x3baa8e));});};exports[_0x5709('0xf')]=function(_0x397c9c,_0x4385c7,_0x5042d2,_0x3d53bf,_0x33d839,_0x401770,_0xad596f){var _0x41ead1,_0x514ee7;_0x401770['host']=intUtil[_0x5709('0x6a')](_0x401770[_0x5709('0x31')]);_0x401770[_0x5709('0x76')]=intUtil[_0x5709('0x6a')](_0x401770[_0x5709('0x76')]);if(_0xad596f&&_0xad596f[_0x5709('0x77')]&&_0xad596f[_0x5709('0x77')]!==_0x5709('0x78')){logger[_0x5709('0xb')](_0x5709('0x79'),_0x5709('0x6c'));_0x4385c7[_0x5709('0x7a')]=util[_0x5709('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x401770[_0x5709('0x76')],_0x4385c7[_0x5709('0x6e')],md5(_0x4385c7[_0x5709('0x6e')]));}return getUser(_0x401770,_0x3d53bf['email'])['then'](function(_0x10c4bd){_0x41ead1=_0x10c4bd;logger['info'](_0x5709('0x7b'),_0x41ead1['id']);return getEndUser(_0x401770,_0x4385c7['destcalleridname'],_0x4385c7['destcalleridnum']);})[_0x5709('0x33')](function(_0x56867c){_0x514ee7=_0x56867c;logger[_0x5709('0xb')](_0x5709('0x7c'),_0x514ee7['CONTACTID']||_0x514ee7[_0x5709('0x29')]);return getCall(_0x401770,_0x41ead1,_0x514ee7,_0x5042d2,_0x4385c7,_0x5709('0x7d'));})[_0x5709('0x33')](function(_0xbb63f){if(_0xbb63f){logger[_0x5709('0xb')](_0x5709('0x7e'),_0xbb63f['id']);logger[_0x5709('0xb')](_0x5709('0x79'),_0x5709('0x7f'));emit(util[_0x5709('0x12')](_0x5709('0x73'),_0x3d53bf[_0x5709('0x65')]),'trigger:browser:url',{'uri':util['format'](_0x5709('0x74'),_0x401770[_0x5709('0x31')],_0xbb63f['id'])});}})[_0x5709('0x75')](function(_0x170e02){logger['error']('[OUTBOUND]',JSON[_0x5709('0x3a')](_0x170e02));});};exports[_0x5709('0x1f')]=function(_0xecccd7,_0x139267,_0x46e779,_0xd18d7a,_0x2d4bda,_0x2b5bb8){var _0x67b3e3,_0xadfe45;_0x2b5bb8[_0x5709('0x31')]=intUtil['stripTrailingSlash'](_0x2b5bb8[_0x5709('0x31')]);_0x2b5bb8[_0x5709('0x76')]=intUtil['stripTrailingSlash'](_0x2b5bb8['serverUrl']);if(_0x2d4bda&&_0x2d4bda[_0x5709('0x80')]){logger['info'](_0x5709('0x81'),_0x5709('0x6c'));_0x139267[_0x5709('0x7a')]=util[_0x5709('0x12')](_0x5709('0x6d'),_0x2b5bb8[_0x5709('0x76')],_0x139267[_0x5709('0x6e')],md5(_0x139267[_0x5709('0x6e')]));}else{_0x139267['recordingURL']='';}return getUser(_0x2b5bb8)[_0x5709('0x33')](function(_0x20c3cf){_0x67b3e3=_0x20c3cf;logger['info'](_0x5709('0x7b'),_0x67b3e3['id']);return getEndUser(_0x2b5bb8,_0x139267['calleridname'],_0x139267[_0x5709('0x71')]);})[_0x5709('0x33')](function(_0x4b5b48){_0xadfe45=_0x4b5b48;logger[_0x5709('0xb')](_0x5709('0x7c'),_0xadfe45[_0x5709('0x28')]||_0xadfe45[_0x5709('0x29')]);return getCall(_0x2b5bb8,_0x67b3e3,_0xadfe45,_0x46e779,_0x139267,_0x5709('0x72'));})['then'](function(_0x2b1001){if(_0x2b1001){logger[_0x5709('0xb')](_0x5709('0x7e'),_0x2b1001['id']);}})['catch'](function(_0x302fd3){logger[_0x5709('0x4a')](_0x5709('0x81'),JSON['stringify'](_0x302fd3));});}; \ No newline at end of file +var _0x4f39=['active','isNil','info','Agent\x20found!','zoho\x20user','profile','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','Searching\x20enduser\x20with\x20phone','GET','Enduser\x20found\x20in\x20Contacts!','row','Contacts','length','val','content','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','encodeXML','toJson','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','catch','[ABANDONED]','Inbound','lodash','request-promise','./util','xml2json','entities','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','application/json','Creating\x20new\x20call...','merge','inbound','outbound','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','called','Called','complete','Call\x20Result','Abandoned','Call\x20Duration','talktime','mm:ss','answertime','endtime','utc','diff','starttime','CONTACTID','LEADID','SEMODULE','Leads','SEID','hasOwnProperty','%s','','https://crm.%s/crm/private/xml/Calls/insertRecords','crmapi','then','parse','response','recorddetail','Call\x20created!','result','Error\x20on\x20call\x20creation:\x20','host','AllUsers','authToken','users','user','zoho\x20data\x20users','log','find','Standard'];(function(_0x400294,_0x4317c6){var _0x5e7681=function(_0x43e8a8){while(--_0x43e8a8){_0x400294['push'](_0x400294['shift']());}};_0x5e7681(++_0x4317c6);}(_0x4f39,0x1d8));var _0x94f3=function(_0x14921c,_0x37b54f){_0x14921c=_0x14921c-0x0;var _0x489e92=_0x4f39[_0x14921c];return _0x489e92;};'use strict';var _=require(_0x94f3('0x0'));var rp=require(_0x94f3('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x94f3('0x2'));var parser=require(_0x94f3('0x3'));var entities=require(_0x94f3('0x4'));var moment=require('moment');var Redis=require(_0x94f3('0x5'));var config=require(_0x94f3('0x6'));var logger=require(_0x94f3('0x7'))(_0x94f3('0x8'));config[_0x94f3('0x9')]=_[_0x94f3('0xa')](config[_0x94f3('0x9')],{'host':_0x94f3('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4455b3,_0x1eea98,_0x2bc2a9){io['to'](_0x4455b3)[_0x94f3('0xc')](_0x1eea98,_0x2bc2a9);}var headers={'Content-Type':'application/json','Accept':_0x94f3('0xd')};function getCall(_0x6f5667,_0xc533ba,_0x58913d,_0x556249,_0x16f81c,_0x2abd0a){logger['info'](_0x94f3('0xe'));var _0x3eb1e0=_[_0x94f3('0xf')]({'SMOWNERID':_0xc533ba['id'],'Call Type':_0x2abd0a||_0x94f3('0x10'),'Call Start Time':(_0x2abd0a===_0x94f3('0x11')?_0x16f81c['starttime']:_0x16f81c[_0x94f3('0x12')])||moment()[_0x94f3('0x13')](_0x94f3('0x14')),'Subject':intUtil[_0x94f3('0x15')](_0x556249[_0x94f3('0x16')],_0x16f81c,'\x20'),'Description':intUtil[_0x94f3('0x15')](_0x556249[_0x94f3('0x17')],_0x16f81c,'\x0a')},getCustomFields(_0x556249[_0x94f3('0x18')],_0x16f81c));switch(_0x16f81c['lastevent']){case _0x94f3('0x19'):_0x3eb1e0['Call\x20Result']=_0x94f3('0x1a');break;case _0x94f3('0x1b'):case'connect':_0x3eb1e0[_0x94f3('0x1c')]='Answered';break;case'rejected':_0x3eb1e0[_0x94f3('0x1c')]='Rejected';break;case'abandoned':_0x3eb1e0[_0x94f3('0x1c')]=_0x94f3('0x1d');break;default:}if(_0x16f81c['talktime']){_0x3eb1e0[_0x94f3('0x1e')]=moment['utc'](parseInt(_0x16f81c[_0x94f3('0x1f')])*0x3e8)[_0x94f3('0x13')](_0x94f3('0x20'));}else if(_0x16f81c[_0x94f3('0x21')]&&_0x16f81c[_0x94f3('0x22')]){_0x3eb1e0[_0x94f3('0x1e')]=moment[_0x94f3('0x23')](moment(_0x16f81c['endtime'],_0x94f3('0x14'))[_0x94f3('0x24')](moment(_0x16f81c[_0x94f3('0x25')],_0x94f3('0x14'))))[_0x94f3('0x13')]('mm:ss');}if(_0x58913d['CONTACTID']){_0x3eb1e0[_0x94f3('0x26')]=_0x58913d[_0x94f3('0x26')];}else if(_0x58913d[_0x94f3('0x27')]){_0x3eb1e0[_0x94f3('0x28')]=_0x94f3('0x29');_0x3eb1e0[_0x94f3('0x2a')]=_0x58913d[_0x94f3('0x27')];}var _0x38ab71='';for(var _0xa52544 in _0x3eb1e0){if(_0x3eb1e0[_0x94f3('0x2b')](_0xa52544)){_0x38ab71+=util[_0x94f3('0x13')](_0x94f3('0x2c'),entities['encodeXML'](_0xa52544),entities['encodeXML'](_0x3eb1e0[_0xa52544]));}}_0x38ab71+=_0x94f3('0x2d');return request({'method':'POST','uri':util[_0x94f3('0x13')](_0x94f3('0x2e'),_0x6f5667['host']),'qs':{'authtoken':_0x6f5667['authToken'],'scope':_0x94f3('0x2f'),'xmlData':_0x38ab71},'json':!![]})[_0x94f3('0x30')](function(_0x168a76){_0x168a76=JSON[_0x94f3('0x31')](parser['toJson'](_0x168a76));if(_0x168a76[_0x94f3('0x32')]){if(_0x168a76[_0x94f3('0x32')]['result']&&_0x168a76['response']['result'][_0x94f3('0x33')]){logger['info'](_0x94f3('0x34'));return{'id':_0x168a76[_0x94f3('0x32')][_0x94f3('0x35')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error(_0x94f3('0x36')+JSON['stringify'](_0x168a76));});}function getUser(_0x509516,_0x27e2a9){return request({'method':'GET','uri':util[_0x94f3('0x13')]('https://crm.%s/crm/private/json/Users/getUsers',_0x509516[_0x94f3('0x37')]),'qs':{'type':_0x94f3('0x38'),'authtoken':_0x509516[_0x94f3('0x39')],'scope':'crmapi'},'json':!![]})[_0x94f3('0x30')](function(_0x1f6783){if(_0x1f6783[_0x94f3('0x3a')]&&_0x1f6783['users'][_0x94f3('0x3b')]){var _0x7971a;console['log'](_0x94f3('0x3c'),_0x1f6783['users'][_0x94f3('0x3b')]);if(_['isArrayLikeObject'](_0x1f6783[_0x94f3('0x3a')][_0x94f3('0x3b')])){console[_0x94f3('0x3d')](_0x94f3('0x3c'),_0x1f6783[_0x94f3('0x3a')][_0x94f3('0x3b')]);if(!_['isNil'](_0x27e2a9)){_0x7971a=_[_0x94f3('0x3e')](_0x1f6783[_0x94f3('0x3a')][_0x94f3('0x3b')],{'email':_0x27e2a9,'profile':_0x94f3('0x3f'),'status':_0x94f3('0x40')});}if(!_[_0x94f3('0x41')](_0x7971a)){logger[_0x94f3('0x42')](_0x94f3('0x43'));}else{logger[_0x94f3('0x42')]('Using\x20the\x20admin\x20account!');_0x7971a=_[_0x94f3('0x3e')](_0x1f6783[_0x94f3('0x3a')][_0x94f3('0x3b')],{'profile':'Administrator'});}console['log'](_0x94f3('0x44'),_0x7971a);return _0x7971a;}else{if(_0x1f6783['users'][_0x94f3('0x3b')][_0x94f3('0x45')]==='Administrator'){logger[_0x94f3('0x42')](_0x94f3('0x46'));_0x7971a=_0x1f6783[_0x94f3('0x3a')][_0x94f3('0x3b')];return _0x7971a;}else{logger[_0x94f3('0x47')](_0x94f3('0x48'),JSON['stringify'](_0x1f6783));throw new Error(_0x94f3('0x49')+JSON['stringify'](_0x1f6783));}}}else{logger[_0x94f3('0x47')](_0x94f3('0x48'),JSON[_0x94f3('0x4a')](_0x1f6783));throw new Error(_0x94f3('0x49')+JSON[_0x94f3('0x4a')](_0x1f6783));}});}function getEndUser(_0x304cdd,_0x38cca8,_0x285d89){logger[_0x94f3('0x42')](_0x94f3('0x4b'),_0x285d89);return request({'method':_0x94f3('0x4c'),'uri':util[_0x94f3('0x13')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x304cdd[_0x94f3('0x37')]),'qs':{'authtoken':_0x304cdd['authToken'],'scope':'crmapi','criteria':util[_0x94f3('0x13')]('((Phone:%s))',_0x285d89)},'json':!![]})[_0x94f3('0x30')](function(_0x1f8668){if(_0x1f8668[_0x94f3('0x32')]&&_0x1f8668[_0x94f3('0x32')]['result']){logger[_0x94f3('0x42')](_0x94f3('0x4d'));var _0x49927a={};var _0x51de3e=_0x1f8668[_0x94f3('0x32')][_0x94f3('0x35')]['Contacts'][_0x94f3('0x4e')]['no']?_0x1f8668[_0x94f3('0x32')][_0x94f3('0x35')][_0x94f3('0x4f')][_0x94f3('0x4e')]['FL']:_0x1f8668[_0x94f3('0x32')][_0x94f3('0x35')]['Contacts']['row'][0x0]['FL'];for(var _0x16ef66=0x0,_0x10a8d8=_0x51de3e[_0x94f3('0x50')];_0x16ef66<_0x10a8d8;_0x16ef66++){_0x49927a[_0x51de3e[_0x16ef66][_0x94f3('0x51')]]=_0x51de3e[_0x16ef66][_0x94f3('0x52')];}return _0x49927a;}else{return request({'method':_0x94f3('0x4c'),'uri':util[_0x94f3('0x13')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x304cdd[_0x94f3('0x37')]),'qs':{'authtoken':_0x304cdd[_0x94f3('0x39')],'scope':_0x94f3('0x2f'),'criteria':util[_0x94f3('0x13')](_0x94f3('0x53'),_0x285d89)},'json':!![]})[_0x94f3('0x30')](function(_0x51f36a){if(_0x51f36a[_0x94f3('0x32')]&&_0x51f36a['response']['result']){logger[_0x94f3('0x42')](_0x94f3('0x54'));var _0x5e36a8={};var _0x17ed02=_0x51f36a[_0x94f3('0x32')][_0x94f3('0x35')][_0x94f3('0x29')][_0x94f3('0x4e')]['no']?_0x51f36a['response'][_0x94f3('0x35')][_0x94f3('0x29')]['row']['FL']:_0x51f36a[_0x94f3('0x32')]['result'][_0x94f3('0x29')][_0x94f3('0x4e')][0x0]['FL'];for(var _0x100178=0x0,_0x1883c5=_0x17ed02[_0x94f3('0x50')];_0x100178<_0x1883c5;_0x100178++){_0x5e36a8[_0x17ed02[_0x100178]['val']]=_0x17ed02[_0x100178][_0x94f3('0x52')];}return _0x5e36a8;}else{logger['info'](_0x94f3('0x55'));_0x38cca8=getName(_0x38cca8);return request({'method':_0x94f3('0x56'),'uri':util[_0x94f3('0x13')](_0x94f3('0x57'),_0x304cdd['host']),'qs':{'authtoken':_0x304cdd[_0x94f3('0x39')],'scope':_0x94f3('0x2f'),'xmlData':util[_0x94f3('0x13')](_0x94f3('0x58'),entities[_0x94f3('0x59')](_0x38cca8[0x0]),entities[_0x94f3('0x59')](_0x38cca8[0x1]),_0x285d89)},'json':!![]})[_0x94f3('0x30')](function(_0x3c0113){_0x3c0113=JSON[_0x94f3('0x31')](parser[_0x94f3('0x5a')](_0x3c0113));if(_0x3c0113[_0x94f3('0x32')]){if(_0x3c0113[_0x94f3('0x32')][_0x94f3('0x35')]&&_0x3c0113[_0x94f3('0x32')][_0x94f3('0x35')][_0x94f3('0x33')]){logger[_0x94f3('0x42')](_0x94f3('0x5b'));return request({'method':_0x94f3('0x4c'),'uri':util[_0x94f3('0x13')](_0x94f3('0x5c'),_0x304cdd[_0x94f3('0x37')]),'qs':{'authtoken':_0x304cdd['authToken'],'scope':'crmapi','id':_0x3c0113['response'][_0x94f3('0x35')][_0x94f3('0x33')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON['stringify'](_0x3c0113));})['then'](function(_0x3dbaf0){if(_0x3dbaf0[_0x94f3('0x32')]){if(_0x3dbaf0['response']['result']){var _0x1d5d9d={};for(var _0x166565=0x0,_0x178c3a=_0x3dbaf0['response'][_0x94f3('0x35')][_0x94f3('0x29')][_0x94f3('0x4e')]['FL'][_0x94f3('0x50')];_0x166565<_0x178c3a;_0x166565++){_0x1d5d9d[_0x3dbaf0[_0x94f3('0x32')][_0x94f3('0x35')]['Leads'][_0x94f3('0x4e')]['FL'][_0x166565][_0x94f3('0x51')]]=_0x3dbaf0[_0x94f3('0x32')]['result'][_0x94f3('0x29')][_0x94f3('0x4e')]['FL'][_0x166565]['content'];}return _0x1d5d9d;}}throw new Error(_0x94f3('0x5d')+JSON[_0x94f3('0x4a')](_0x3dbaf0));});}});}});}function request(_0x43ccff){logger[_0x94f3('0x5e')](_0x94f3('0x5f'),JSON['stringify'](_0x43ccff));return rp(_0x43ccff);}function getCustomFields(_0x27dc59,_0x450db3){var _0x1430e9={};if(_0x27dc59[_0x94f3('0x50')]>0x0){_[_0x94f3('0x60')](_0x27dc59,function(_0x47c977){if(_0x47c977['type']===_0x94f3('0x61')&&_0x47c977[_0x94f3('0x62')]){_0x1430e9[_0x47c977[_0x94f3('0x62')]]=_0x47c977[_0x94f3('0x52')][_0x94f3('0x63')]();}else if(_0x47c977[_0x94f3('0x64')]===_0x94f3('0x65')&&_0x47c977['variableName']&&_0x47c977[_0x94f3('0x62')]&&_0x450db3[_0x47c977['variableName']]){_0x1430e9[_0x47c977[_0x94f3('0x62')]]=_0x450db3[_0x47c977[_0x94f3('0x66')]]['toString']();}else if(_0x47c977[_0x94f3('0x64')]===_0x94f3('0x67')&&_0x47c977['Variable']&&_0x47c977[_0x94f3('0x68')][_0x94f3('0x69')]&&_0x47c977['idField']&&_0x450db3[_0x47c977[_0x94f3('0x68')][_0x94f3('0x69')][_0x94f3('0x6a')]()]){_0x1430e9[_0x47c977[_0x94f3('0x62')]]=_0x450db3[_0x47c977['Variable'][_0x94f3('0x69')][_0x94f3('0x6a')]()]['toString']();}});}return _0x1430e9;}function getName(_0xf36f63){if(_0xf36f63['indexOf']('\x20')>0x0){var _0x50b76e=_0xf36f63['split'](/ (.+)/);if(_0x50b76e[0x1]){return _0x50b76e;}}return[_0xf36f63,_0xf36f63];}exports[_0x94f3('0x6b')]=function(_0x171fc0,_0x1709fc,_0x15a5f2,_0x44adcf,_0x445de1,_0x58417d){var _0x2f62ff,_0x446bad;_0x58417d[_0x94f3('0x37')]=intUtil[_0x94f3('0x6c')](_0x58417d[_0x94f3('0x37')]);_0x58417d[_0x94f3('0x6d')]=intUtil[_0x94f3('0x6c')](_0x58417d[_0x94f3('0x6d')]);if(_0x445de1&&_0x445de1[_0x94f3('0x6e')]){logger[_0x94f3('0x42')](_0x94f3('0x6f'),_0x94f3('0x70'));_0x1709fc[_0x94f3('0x71')]=util['format'](_0x94f3('0x72'),_0x58417d[_0x94f3('0x6d')],_0x1709fc[_0x94f3('0x73')],md5(_0x1709fc[_0x94f3('0x73')]));}else{_0x1709fc[_0x94f3('0x71')]='';}return getUser(_0x58417d,_0x44adcf[_0x94f3('0x74')])[_0x94f3('0x30')](function(_0x408a4d){_0x2f62ff=_0x408a4d;logger[_0x94f3('0x42')](_0x94f3('0x75'),_0x2f62ff['id']);return getEndUser(_0x58417d,_0x1709fc[_0x94f3('0x76')],_0x1709fc[_0x94f3('0x77')]);})[_0x94f3('0x30')](function(_0x3a49cc){_0x446bad=_0x3a49cc;logger[_0x94f3('0x42')](_0x94f3('0x78'),_0x446bad[_0x94f3('0x26')]||_0x446bad[_0x94f3('0x27')]);return getCall(_0x58417d,_0x2f62ff,_0x446bad,_0x15a5f2,_0x1709fc,'Inbound');})[_0x94f3('0x30')](function(_0x1b2a06){if(_0x1b2a06){logger[_0x94f3('0x42')](_0x94f3('0x79'),_0x1b2a06['id']);logger['info'](_0x94f3('0x6f'),_0x94f3('0x7a'));emit(util[_0x94f3('0x13')]('user:%s',_0x44adcf[_0x94f3('0x69')]),_0x94f3('0x7b'),{'uri':util[_0x94f3('0x13')](_0x94f3('0x7c'),_0x58417d['host'],_0x1b2a06['id'])});}})['catch'](function(_0x245413){logger['error'](_0x94f3('0x6f'),JSON[_0x94f3('0x4a')](_0x245413));});};exports[_0x94f3('0x11')]=function(_0x320547,_0x34e31e,_0x981f80,_0x4f0eea,_0x5ef164,_0x10945b,_0x410650){var _0x5f4fa1,_0x8e32fa;_0x10945b[_0x94f3('0x37')]=intUtil[_0x94f3('0x6c')](_0x10945b[_0x94f3('0x37')]);_0x10945b[_0x94f3('0x6d')]=intUtil[_0x94f3('0x6c')](_0x10945b[_0x94f3('0x6d')]);if(_0x410650&&_0x410650[_0x94f3('0x7d')]&&_0x410650[_0x94f3('0x7d')]!=='none'){logger[_0x94f3('0x42')](_0x94f3('0x7e'),_0x94f3('0x70'));_0x34e31e[_0x94f3('0x71')]=util[_0x94f3('0x13')](_0x94f3('0x72'),_0x10945b[_0x94f3('0x6d')],_0x34e31e[_0x94f3('0x73')],md5(_0x34e31e[_0x94f3('0x73')]));}return getUser(_0x10945b,_0x4f0eea['email'])['then'](function(_0x10033c){_0x5f4fa1=_0x10033c;logger[_0x94f3('0x42')](_0x94f3('0x75'),_0x5f4fa1['id']);return getEndUser(_0x10945b,_0x34e31e[_0x94f3('0x7f')],_0x34e31e[_0x94f3('0x80')]);})[_0x94f3('0x30')](function(_0x50e3c8){_0x8e32fa=_0x50e3c8;logger[_0x94f3('0x42')]('The\x20Enduser\x20ID\x20is:',_0x8e32fa['CONTACTID']||_0x8e32fa[_0x94f3('0x27')]);return getCall(_0x10945b,_0x5f4fa1,_0x8e32fa,_0x981f80,_0x34e31e,_0x94f3('0x81'));})[_0x94f3('0x30')](function(_0x2d89fe){if(_0x2d89fe){logger[_0x94f3('0x42')](_0x94f3('0x79'),_0x2d89fe['id']);logger['info'](_0x94f3('0x7e'),_0x94f3('0x7a'));emit(util[_0x94f3('0x13')](_0x94f3('0x82'),_0x4f0eea[_0x94f3('0x69')]),_0x94f3('0x7b'),{'uri':util[_0x94f3('0x13')](_0x94f3('0x7c'),_0x10945b['host'],_0x2d89fe['id'])});}})[_0x94f3('0x83')](function(_0x3abc13){logger[_0x94f3('0x47')]('[OUTBOUND]',JSON['stringify'](_0x3abc13));});};exports['abandoned']=function(_0x67874c,_0x5a6aa1,_0xb417db,_0x21cbe1,_0x13a44a,_0x378035){var _0x3a5f07,_0x1f976e;_0x378035['host']=intUtil['stripTrailingSlash'](_0x378035[_0x94f3('0x37')]);_0x378035[_0x94f3('0x6d')]=intUtil[_0x94f3('0x6c')](_0x378035[_0x94f3('0x6d')]);if(_0x13a44a&&_0x13a44a[_0x94f3('0x6e')]){logger[_0x94f3('0x42')](_0x94f3('0x84'),_0x94f3('0x70'));_0x5a6aa1[_0x94f3('0x71')]=util[_0x94f3('0x13')](_0x94f3('0x72'),_0x378035[_0x94f3('0x6d')],_0x5a6aa1[_0x94f3('0x73')],md5(_0x5a6aa1[_0x94f3('0x73')]));}else{_0x5a6aa1[_0x94f3('0x71')]='';}return getUser(_0x378035)[_0x94f3('0x30')](function(_0x21732c){_0x3a5f07=_0x21732c;logger[_0x94f3('0x42')](_0x94f3('0x75'),_0x3a5f07['id']);return getEndUser(_0x378035,_0x5a6aa1[_0x94f3('0x76')],_0x5a6aa1[_0x94f3('0x77')]);})[_0x94f3('0x30')](function(_0x253fd7){_0x1f976e=_0x253fd7;logger[_0x94f3('0x42')](_0x94f3('0x78'),_0x1f976e[_0x94f3('0x26')]||_0x1f976e[_0x94f3('0x27')]);return getCall(_0x378035,_0x3a5f07,_0x1f976e,_0xb417db,_0x5a6aa1,_0x94f3('0x85'));})[_0x94f3('0x30')](function(_0x51a07d){if(_0x51a07d){logger[_0x94f3('0x42')](_0x94f3('0x79'),_0x51a07d['id']);}})['catch'](function(_0x2629aa){logger[_0x94f3('0x47')]('[ABANDONED]',JSON[_0x94f3('0x4a')](_0x2629aa));});}; \ 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 36001b0..12f9bda 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 _0x8b4b=['POST','body','data7','then','info','format','statusCode','catch','%s\x20%s\x20%s\x20[%s]:%s','message','request-promise','util','mustache','../../../../config/logger','trigger','exec','data1','render','data2','toUpperCase'];(function(_0xaa2d05,_0x3d9b62){var _0x10753c=function(_0x64f766){while(--_0x64f766){_0xaa2d05['push'](_0xaa2d05['shift']());}};_0x10753c(++_0x3d9b62);}(_0x8b4b,0xe6));var _0xb8b4=function(_0x5b0f32,_0x20293c){_0x5b0f32=_0x5b0f32-0x0;var _0xedc377=_0x8b4b[_0x5b0f32];return _0xedc377;};'use strict';var rp=require(_0xb8b4('0x0'));var util=require(_0xb8b4('0x1'));var Mustache=require(_0xb8b4('0x2'));var logger=require(_0xb8b4('0x3'))(_0xb8b4('0x4'));exports[_0xb8b4('0x5')]=function(_0xc1383e,_0x58db01){var _0x333ffa={'method':_0xc1383e[_0xb8b4('0x6')]['toUpperCase'](),'uri':encodeURI(Mustache[_0xb8b4('0x7')](_0xc1383e[_0xb8b4('0x8')],_0x58db01)),'json':!![],'resolveWithFullResponse':!![]};switch(_0xc1383e[_0xb8b4('0x6')][_0xb8b4('0x9')]()){case'GET':_0x333ffa['qs']=_0x58db01;break;case _0xb8b4('0xa'):_0x333ffa[_0xb8b4('0xb')]=_0xc1383e[_0xb8b4('0xc')]?Mustache[_0xb8b4('0x7')](_0xc1383e[_0xb8b4('0xc')],_0x58db01):_0x58db01;break;}rp(_0x333ffa)[_0xb8b4('0xd')](function(_0x27ae9a){logger[_0xb8b4('0xe')](util[_0xb8b4('0xf')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s',_0xc1383e[_0xb8b4('0x6')],_0xc1383e[_0xb8b4('0x8')],_0x27ae9a[_0xb8b4('0x10')],_0x27ae9a[_0xb8b4('0xb')]));})[_0xb8b4('0x11')](function(_0x464f4e){logger['error'](util[_0xb8b4('0xf')](_0xb8b4('0x12'),_0xc1383e[_0xb8b4('0x6')],_0xc1383e['data2'],_0x464f4e['statusCode'],_0x464f4e['name'],_0x464f4e[_0xb8b4('0x13')]));});}; \ No newline at end of file +var _0x873d=['body','data7','then','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','statusCode','%s\x20%s\x20%s\x20[%s]:%s','name','message','request-promise','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','GET'];(function(_0x2c3b20,_0x4fb99e){var _0x1874fc=function(_0x19d8c7){while(--_0x19d8c7){_0x2c3b20['push'](_0x2c3b20['shift']());}};_0x1874fc(++_0x4fb99e);}(_0x873d,0x8d));var _0xd873=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x873d[_0x502c7d];return _0x30b7ed;};'use strict';var rp=require(_0xd873('0x0'));var util=require(_0xd873('0x1'));var Mustache=require(_0xd873('0x2'));var logger=require(_0xd873('0x3'))(_0xd873('0x4'));exports[_0xd873('0x5')]=function(_0x537ff2,_0x1b6b93){var _0x150d8f={'method':_0x537ff2[_0xd873('0x6')][_0xd873('0x7')](),'uri':encodeURI(Mustache[_0xd873('0x8')](_0x537ff2[_0xd873('0x9')],_0x1b6b93)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x537ff2[_0xd873('0x6')][_0xd873('0x7')]()){case _0xd873('0xa'):_0x150d8f['qs']=_0x1b6b93;break;case'POST':_0x150d8f[_0xd873('0xb')]=_0x537ff2[_0xd873('0xc')]?Mustache[_0xd873('0x8')](_0x537ff2[_0xd873('0xc')],_0x1b6b93):_0x1b6b93;break;}rp(_0x150d8f)[_0xd873('0xd')](function(_0x1cbc42){logger['info'](util['format'](_0xd873('0xe'),_0x537ff2[_0xd873('0x6')],_0x537ff2[_0xd873('0x9')],_0x1cbc42[_0xd873('0xf')],_0x1cbc42[_0xd873('0xb')]));})['catch'](function(_0x40cb63){logger['error'](util['format'](_0xd873('0x10'),_0x537ff2['data1'],_0x537ff2[_0xd873('0x9')],_0x40cb63[_0xd873('0xf')],_0x40cb63[_0xd873('0x11')],_0x40cb63[_0xd873('0x12')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7b61d61..e82f4b9 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 _0xa261=['../../config/logger','routing','client','http','Request','request','then','debug','error','rpc','message','result','catch','exports','jayson/promise'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xa261,0x1a3));var _0x1a26=function(_0x1c7e5a,_0x146917){_0x1c7e5a=_0x1c7e5a-0x0;var _0x1beeea=_0xa261[_0x1c7e5a];return _0x1beeea;};'use strict';var jayson=require(_0x1a26('0x0'));var BPromise=require('bluebird');var logger=require(_0x1a26('0x1'))(_0x1a26('0x2'));var client=jayson[_0x1a26('0x3')][_0x1a26('0x4')]({'port':0x2329});client[_0x1a26('0x5')]=function(_0x54f768,_0x52360d){return new BPromise(function(_0x52a165,_0x10bec5){return client[_0x1a26('0x6')](_0x54f768,_0x52360d)[_0x1a26('0x7')](function(_0x392ee0){logger[_0x1a26('0x8')]('rpc',_0x1a26('0x2'),_0x54f768,_0x52360d,_0x392ee0);if(_0x392ee0['error']){logger[_0x1a26('0x9')](_0x1a26('0xa'),_0x1a26('0x2'),_0x54f768,_0x392ee0['error'][_0x1a26('0xb')],_0x52360d);return _0x10bec5(_0x392ee0[_0x1a26('0x9')][_0x1a26('0xb')]);}else{return _0x52a165(_0x392ee0[_0x1a26('0xc')]);}})[_0x1a26('0xd')](function(_0x576f93){logger[_0x1a26('0x9')](_0x1a26('0xa'),_0x1a26('0x2'),_0x54f768,_0x576f93,_0x52360d);return _0x10bec5(_0x576f93);});});};module[_0x1a26('0xe')]=client; \ No newline at end of file +var _0xdb13=['Request','request','then','debug','rpc','error','message','result','bluebird','../../config/logger','routing','client','http'];(function(_0x5cab94,_0x57db12){var _0x4cdeda=function(_0x51adff){while(--_0x51adff){_0x5cab94['push'](_0x5cab94['shift']());}};_0x4cdeda(++_0x57db12);}(_0xdb13,0x10c));var _0x3db1=function(_0x326d7f,_0x3e4e3e){_0x326d7f=_0x326d7f-0x0;var _0x1940cf=_0xdb13[_0x326d7f];return _0x1940cf;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3db1('0x0'));var logger=require(_0x3db1('0x1'))(_0x3db1('0x2'));var client=jayson[_0x3db1('0x3')][_0x3db1('0x4')]({'port':0x2329});client[_0x3db1('0x5')]=function(_0x581a73,_0x3352e3){return new BPromise(function(_0x41fb5d,_0x1c1495){return client[_0x3db1('0x6')](_0x581a73,_0x3352e3)[_0x3db1('0x7')](function(_0x5a2345){logger[_0x3db1('0x8')](_0x3db1('0x9'),_0x3db1('0x2'),_0x581a73,_0x3352e3,_0x5a2345);if(_0x5a2345[_0x3db1('0xa')]){logger[_0x3db1('0xa')](_0x3db1('0x9'),_0x3db1('0x2'),_0x581a73,_0x5a2345[_0x3db1('0xa')][_0x3db1('0xb')],_0x3352e3);return _0x1c1495(_0x5a2345[_0x3db1('0xa')][_0x3db1('0xb')]);}else{return _0x41fb5d(_0x5a2345[_0x3db1('0xc')]);}})['catch'](function(_0x68961e){logger[_0x3db1('0xa')](_0x3db1('0x9'),_0x3db1('0x2'),_0x581a73,_0x68961e,_0x3352e3);return _0x1c1495(_0x68961e);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index e441e02..e247cd2 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 _0x5485=['then','refresh','mailAccounts','listen','catch','./lib/email','resolve','getMailAccounts'];(function(_0x329c06,_0x5b748e){var _0x1bb36b=function(_0x19e7a2){while(--_0x19e7a2){_0x329c06['push'](_0x329c06['shift']());}};_0x1bb36b(++_0x5b748e);}(_0x5485,0x95));var _0x5548=function(_0x3ea401,_0x5d879d){_0x3ea401=_0x3ea401-0x0;var _0x164e79=_0x5485[_0x3ea401];return _0x164e79;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x5548('0x0'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5548('0x1')]()['then'](mailAccount[_0x5548('0x2')]())['then'](realtime['initMailAccounts']())[_0x5548('0x3')](function(){email[_0x5548('0x4')](realtime[_0x5548('0x5')]);return realtime;});}function main(){return server[_0x5548('0x6')](realtime,email)[_0x5548('0x3')](function(_0x45e390){return initRealtime();})[_0x5548('0x3')](function(_0x138da7){return setInterval(initRealtime,0x2710);})[_0x5548('0x7')](function(_0x42a2ec){console['log'](_0x42a2ec);});}main(); \ No newline at end of file +var _0x2c48=['bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','refresh','mailAccounts','listen','catch','log'];(function(_0x17fa71,_0x1f930e){var _0x11fd5c=function(_0x5bb182){while(--_0x5bb182){_0x17fa71['push'](_0x17fa71['shift']());}};_0x11fd5c(++_0x1f930e);}(_0x2c48,0x1a0));var _0x82c4=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x2c48[_0x34eb31];return _0x254994;};'use strict';var BPromise=require(_0x82c4('0x0'));var server=require(_0x82c4('0x1'));var Realtime=require(_0x82c4('0x2'));var EmailChannel=require(_0x82c4('0x3'));var mailAccount=require(_0x82c4('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x82c4('0x5')]()[_0x82c4('0x6')](mailAccount[_0x82c4('0x7')]())[_0x82c4('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0x82c4('0x8')](realtime[_0x82c4('0x9')]);return realtime;});}function main(){return server[_0x82c4('0xa')](realtime,email)[_0x82c4('0x6')](function(_0x2d41d5){return initRealtime();})[_0x82c4('0x6')](function(_0x10ac38){return setInterval(initRealtime,0x2710);})[_0x82c4('0xb')](function(_0x126ace){console[_0x82c4('0xc')](_0x126ace);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 6258a44..e4d112c 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 _0x3a6d=['defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','status','Imap','messageStatus','total','isNil','emit','refresh','hasOwnProperty','handleImapBox','handleImapEmail','bind','end','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','handleImapError','sendMail','verifySmtp','Smtp','lastSync','verify','then','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email'];(function(_0x5a4f5a,_0x241d79){var _0x18d10a=function(_0x1eecdf){while(--_0x1eecdf){_0x5a4f5a['push'](_0x5a4f5a['shift']());}};_0x18d10a(++_0x241d79);}(_0x3a6d,0x143));var _0xd3a6=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3a6d[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xd3a6('0x0'));var moment=require(_0xd3a6('0x1'));var BPromise=require('bluebird');var md5=require(_0xd3a6('0x2'));var Redis=require(_0xd3a6('0x3'));var config=require(_0xd3a6('0x4'));var logger=require(_0xd3a6('0x5'))(_0xd3a6('0x6'));config['redis']=_[_0xd3a6('0x7')](config[_0xd3a6('0x8')],{'host':_0xd3a6('0x9'),'port':0x18eb});var io=require(_0xd3a6('0xa'))(new Redis(config[_0xd3a6('0x8')]));var EmailImap=require(_0xd3a6('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xd3a6('0xc'));var md5Accounts={};function EmailChannel(_0x134dd3){logger[_0xd3a6('0xd')](_0xd3a6('0xe'));this[_0xd3a6('0xf')]=_0x134dd3[_0xd3a6('0xf')];this[_0xd3a6('0x10')]={};this[_0xd3a6('0x11')]=new EmailSmtp();}EmailChannel[_0xd3a6('0x12')]['emit']=function(_0x172513){var _0x1a00f7=this[_0xd3a6('0xf')][_0x172513];var _0x225399={'id':_0x1a00f7['id'],'name':_0x1a00f7[_0xd3a6('0x13')],'key':_0x1a00f7['key'],'active':_0x1a00f7['active'],'Imap':{'status':_0x1a00f7['Imap'][_0xd3a6('0x14')],'messageStatus':_0x1a00f7[_0xd3a6('0x15')][_0xd3a6('0x16')],'total':_0x1a00f7[_0xd3a6('0x15')][_0xd3a6('0x17')]}};if(_[_0xd3a6('0x18')](md5Accounts[_0x172513])){md5Accounts[_0x172513]={};}var _0xa56452=md5(JSON['stringify'](_0x225399));if(md5Accounts[_0x172513][_0xd3a6('0x2')]!==_0xa56452){md5Accounts[_0x172513][_0xd3a6('0x2')]=_0xa56452;io[_0xd3a6('0x19')]('mailAccount:update',_0x225399);}};EmailChannel[_0xd3a6('0x12')][_0xd3a6('0x1a')]=function(_0x1781f6){for(var _0x57d826 in _0x1781f6){if(_0x1781f6[_0xd3a6('0x1b')](_0x57d826)){if(_0x1781f6[_0x57d826]['Imap']&&_0x1781f6[_0x57d826]['active']){var _0x28b63c=_0x1781f6[_0x57d826][_0xd3a6('0x15')];if(!this[_0xd3a6('0x10')][_0xd3a6('0x1b')](_0x28b63c['id'])){this[_0xd3a6('0x10')][_0x28b63c['id']]=new EmailImap(_0x28b63c,_0x1781f6[_0x57d826][_0xd3a6('0x6')]);this[_0xd3a6('0x10')][_0x28b63c['id']]['on']('box',this[_0xd3a6('0x1c')]['bind'](this,_0x57d826));this[_0xd3a6('0x10')][_0x28b63c['id']]['on'](_0xd3a6('0x6'),this[_0xd3a6('0x1d')][_0xd3a6('0x1e')](this,_0x57d826));this[_0xd3a6('0x10')][_0x28b63c['id']]['on'](_0xd3a6('0x1f'),this['handleImapEnd'][_0xd3a6('0x1e')](this,_0x57d826));this[_0xd3a6('0x10')][_0x28b63c['id']]['on']('error',this['handleImapError']['bind'](this,_0x57d826));}}else{if(_['isNil'](this['mailAccounts'][_0x57d826][_0xd3a6('0x15')])){this[_0xd3a6('0xf')][_0x57d826][_0xd3a6('0x15')]={};}this['mailAccounts'][_0x57d826][_0xd3a6('0x15')]['status']=_0xd3a6('0x20');this[_0xd3a6('0xf')][_0x57d826][_0xd3a6('0x15')]['messageStatus']='';this[_0xd3a6('0x19')](_0x57d826);}}}};EmailChannel[_0xd3a6('0x12')][_0xd3a6('0x1c')]=function(_0x219e32,_0x169d11){if(this[_0xd3a6('0xf')][_0x219e32]){this['mailAccounts'][_0x219e32][_0xd3a6('0x15')][_0xd3a6('0x14')]=_0xd3a6('0x21');this[_0xd3a6('0xf')][_0x219e32][_0xd3a6('0x15')][_0xd3a6('0x16')]=_0x169d11['name'];if(_0x169d11['messages']){this[_0xd3a6('0xf')][_0x219e32][_0xd3a6('0x15')][_0xd3a6('0x17')]=_0x169d11[_0xd3a6('0x22')]['total'];}return this[_0xd3a6('0x19')](_0x219e32);}};EmailChannel[_0xd3a6('0x12')]['handleImapEmail']=function(_0x14381c,_0x5d9867){logger[_0xd3a6('0xd')](_0xd3a6('0x23'),_0x5d9867[_0xd3a6('0x24')],_0x5d9867[_0xd3a6('0x25')],_0x5d9867[_0xd3a6('0x26')],_0x14381c);if(this[_0xd3a6('0xf')][_0x14381c]){return mailAccount[_0xd3a6('0x27')](_0x14381c,_0x5d9867)['then'](function(_0x4d7b56){if(_0x4d7b56){logger[_0xd3a6('0xd')](_0xd3a6('0x28'));}})[_0xd3a6('0x29')](function(_0x59337c){logger[_0xd3a6('0x2a')](_0xd3a6('0x2b'),JSON[_0xd3a6('0x2c')](_0x59337c));});}};EmailChannel[_0xd3a6('0x12')][_0xd3a6('0x2d')]=function(_0x36b28a){if(this[_0xd3a6('0xf')][_0x36b28a]&&this[_0xd3a6('0xf')][_0x36b28a]['Imap']){if(this[_0xd3a6('0x10')][this[_0xd3a6('0xf')][_0x36b28a][_0xd3a6('0x15')]['id']]){delete this[_0xd3a6('0x10')][this[_0xd3a6('0xf')][_0x36b28a][_0xd3a6('0x15')]['id']];}this['mailAccounts'][_0x36b28a][_0xd3a6('0x15')]['lastSync']=moment();this[_0xd3a6('0x19')](_0x36b28a);}};EmailChannel[_0xd3a6('0x12')][_0xd3a6('0x2e')]=function(_0x246735,_0x524779){if(this['mailAccounts'][_0x246735]){this[_0xd3a6('0xf')][_0x246735][_0xd3a6('0x15')][_0xd3a6('0x14')]='error';this[_0xd3a6('0xf')][_0x246735][_0xd3a6('0x15')]['messageStatus']=_0x524779;return this[_0xd3a6('0x19')](_0x246735);}};EmailChannel['prototype'][_0xd3a6('0x2f')]=function(_0x2aa1dc,_0x54251d){return this[_0xd3a6('0x11')]['send'](_0x2aa1dc,_0x54251d);};EmailChannel[_0xd3a6('0x12')][_0xd3a6('0x30')]=function(_0x51af61){var _0x2cba30=this;if(this[_0xd3a6('0xf')][_0x51af61['id']]){if(_[_0xd3a6('0x18')](this[_0xd3a6('0xf')][_0x51af61['id']]['Smtp'])){this[_0xd3a6('0xf')][_0x51af61['id']][_0xd3a6('0x31')]={};}this[_0xd3a6('0xf')][_0x51af61['id']][_0xd3a6('0x31')][_0xd3a6('0x32')]=moment();return new BPromise(function(_0x56d45f,_0x32ff68){return _0x2cba30['smtp'][_0xd3a6('0x33')](_0x51af61)[_0xd3a6('0x34')](function(_0x16764c){_0x2cba30['mailAccounts'][_0x51af61['id']][_0xd3a6('0x31')]['status']=_0xd3a6('0x35');_0x2cba30['mailAccounts'][_0x51af61['id']][_0xd3a6('0x31')][_0xd3a6('0x16')]='';_0x2cba30[_0xd3a6('0x19')](_0x51af61['id']);_0x56d45f(_0x16764c);})[_0xd3a6('0x29')](function(_0x346b26){_0x2cba30[_0xd3a6('0xf')][_0x51af61['id']][_0xd3a6('0x31')]['status']=_0xd3a6('0x2a');_0x2cba30[_0xd3a6('0xf')][_0x51af61['id']][_0xd3a6('0x31')][_0xd3a6('0x16')]=_0x346b26;_0x2cba30['emit'](_0x51af61['id']);_0x32ff68(_0x346b26);});});}return this[_0xd3a6('0x11')][_0xd3a6('0x33')](_0x51af61);};module[_0xd3a6('0x36')]=EmailChannel; \ No newline at end of file +var _0x4351=['md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','Imap','total','isNil','mailAccount:update','prototype','refresh','hasOwnProperty','active','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','status','messageStatus','connected','name','messages','info','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verified','exports','lodash','moment','bluebird'];(function(_0x2f7aa6,_0x2072e5){var _0x18d006=function(_0x21f07b){while(--_0x21f07b){_0x2f7aa6['push'](_0x2f7aa6['shift']());}};_0x18d006(++_0x2072e5);}(_0x4351,0x1b5));var _0x1435=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4351[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x1435('0x0'));var moment=require(_0x1435('0x1'));var BPromise=require(_0x1435('0x2'));var md5=require(_0x1435('0x3'));var Redis=require(_0x1435('0x4'));var config=require(_0x1435('0x5'));var logger=require(_0x1435('0x6'))(_0x1435('0x7'));config[_0x1435('0x8')]=_[_0x1435('0x9')](config[_0x1435('0x8')],{'host':_0x1435('0xa'),'port':0x18eb});var io=require(_0x1435('0xb'))(new Redis(config[_0x1435('0x8')]));var EmailImap=require(_0x1435('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x1435('0xd'));var md5Accounts={};function EmailChannel(_0x5de4b0){logger['info'](_0x1435('0xe'));this[_0x1435('0xf')]=_0x5de4b0[_0x1435('0xf')];this[_0x1435('0x10')]={};this[_0x1435('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0x1435('0x12')]=function(_0x3aafce){var _0x5a64a4=this['mailAccounts'][_0x3aafce];var _0x33887d={'id':_0x5a64a4['id'],'name':_0x5a64a4['name'],'key':_0x5a64a4[_0x1435('0x13')],'active':_0x5a64a4['active'],'Imap':{'status':_0x5a64a4[_0x1435('0x14')]['status'],'messageStatus':_0x5a64a4['Imap']['messageStatus'],'total':_0x5a64a4[_0x1435('0x14')][_0x1435('0x15')]}};if(_[_0x1435('0x16')](md5Accounts[_0x3aafce])){md5Accounts[_0x3aafce]={};}var _0x4a80bc=md5(JSON['stringify'](_0x33887d));if(md5Accounts[_0x3aafce][_0x1435('0x3')]!==_0x4a80bc){md5Accounts[_0x3aafce]['md5']=_0x4a80bc;io[_0x1435('0x12')](_0x1435('0x17'),_0x33887d);}};EmailChannel[_0x1435('0x18')][_0x1435('0x19')]=function(_0x5d4b48){for(var _0x1cc531 in _0x5d4b48){if(_0x5d4b48[_0x1435('0x1a')](_0x1cc531)){if(_0x5d4b48[_0x1cc531][_0x1435('0x14')]&&_0x5d4b48[_0x1cc531][_0x1435('0x1b')]){var _0x189f4a=_0x5d4b48[_0x1cc531][_0x1435('0x14')];if(!this[_0x1435('0x10')][_0x1435('0x1a')](_0x189f4a['id'])){this[_0x1435('0x10')][_0x189f4a['id']]=new EmailImap(_0x189f4a,_0x5d4b48[_0x1cc531][_0x1435('0x7')]);this['imapAccounts'][_0x189f4a['id']]['on'](_0x1435('0x1c'),this[_0x1435('0x1d')]['bind'](this,_0x1cc531));this[_0x1435('0x10')][_0x189f4a['id']]['on']('email',this[_0x1435('0x1e')][_0x1435('0x1f')](this,_0x1cc531));this[_0x1435('0x10')][_0x189f4a['id']]['on'](_0x1435('0x20'),this[_0x1435('0x21')][_0x1435('0x1f')](this,_0x1cc531));this['imapAccounts'][_0x189f4a['id']]['on'](_0x1435('0x22'),this[_0x1435('0x23')][_0x1435('0x1f')](this,_0x1cc531));}}else{if(_[_0x1435('0x16')](this[_0x1435('0xf')][_0x1cc531][_0x1435('0x14')])){this[_0x1435('0xf')][_0x1cc531][_0x1435('0x14')]={};}this[_0x1435('0xf')][_0x1cc531][_0x1435('0x14')][_0x1435('0x24')]='disabled';this['mailAccounts'][_0x1cc531][_0x1435('0x14')][_0x1435('0x25')]='';this[_0x1435('0x12')](_0x1cc531);}}}};EmailChannel['prototype'][_0x1435('0x1d')]=function(_0x25cf29,_0x2663bf){if(this[_0x1435('0xf')][_0x25cf29]){this[_0x1435('0xf')][_0x25cf29]['Imap'][_0x1435('0x24')]=_0x1435('0x26');this[_0x1435('0xf')][_0x25cf29][_0x1435('0x14')][_0x1435('0x25')]=_0x2663bf[_0x1435('0x27')];if(_0x2663bf[_0x1435('0x28')]){this['mailAccounts'][_0x25cf29][_0x1435('0x14')][_0x1435('0x15')]=_0x2663bf[_0x1435('0x28')][_0x1435('0x15')];}return this[_0x1435('0x12')](_0x25cf29);}};EmailChannel['prototype'][_0x1435('0x1e')]=function(_0x2ed478,_0xab53ee){logger[_0x1435('0x29')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0xab53ee[_0x1435('0x2a')],_0xab53ee[_0x1435('0x2b')],_0xab53ee['from'],_0x2ed478);if(this[_0x1435('0xf')][_0x2ed478]){return mailAccount['notify'](_0x2ed478,_0xab53ee)[_0x1435('0x2c')](function(_0x1ea6a6){if(_0x1ea6a6){logger['info'](_0x1435('0x2d'));}})[_0x1435('0x2e')](function(_0x5a86ac){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x1435('0x2f')](_0x5a86ac));});}};EmailChannel['prototype'][_0x1435('0x21')]=function(_0x5ac209){if(this[_0x1435('0xf')][_0x5ac209]&&this['mailAccounts'][_0x5ac209][_0x1435('0x14')]){if(this[_0x1435('0x10')][this[_0x1435('0xf')][_0x5ac209][_0x1435('0x14')]['id']]){delete this[_0x1435('0x10')][this[_0x1435('0xf')][_0x5ac209]['Imap']['id']];}this[_0x1435('0xf')][_0x5ac209][_0x1435('0x14')][_0x1435('0x30')]=moment();this[_0x1435('0x12')](_0x5ac209);}};EmailChannel[_0x1435('0x18')]['handleImapError']=function(_0x2db5d6,_0x578845){if(this[_0x1435('0xf')][_0x2db5d6]){this[_0x1435('0xf')][_0x2db5d6]['Imap'][_0x1435('0x24')]=_0x1435('0x22');this[_0x1435('0xf')][_0x2db5d6][_0x1435('0x14')][_0x1435('0x25')]=_0x578845;return this[_0x1435('0x12')](_0x2db5d6);}};EmailChannel[_0x1435('0x18')][_0x1435('0x31')]=function(_0x1399e7,_0xeb29d0){return this[_0x1435('0x11')][_0x1435('0x32')](_0x1399e7,_0xeb29d0);};EmailChannel['prototype'][_0x1435('0x33')]=function(_0x507e35){var _0x24a431=this;if(this['mailAccounts'][_0x507e35['id']]){if(_[_0x1435('0x16')](this['mailAccounts'][_0x507e35['id']][_0x1435('0x34')])){this['mailAccounts'][_0x507e35['id']][_0x1435('0x34')]={};}this[_0x1435('0xf')][_0x507e35['id']][_0x1435('0x34')]['lastSync']=moment();return new BPromise(function(_0x280b37,_0x1fe164){return _0x24a431[_0x1435('0x11')]['verify'](_0x507e35)[_0x1435('0x2c')](function(_0x4710e5){_0x24a431['mailAccounts'][_0x507e35['id']]['Smtp'][_0x1435('0x24')]=_0x1435('0x35');_0x24a431[_0x1435('0xf')][_0x507e35['id']]['Smtp']['messageStatus']='';_0x24a431[_0x1435('0x12')](_0x507e35['id']);_0x280b37(_0x4710e5);})['catch'](function(_0x466345){_0x24a431['mailAccounts'][_0x507e35['id']][_0x1435('0x34')]['status']=_0x1435('0x22');_0x24a431['mailAccounts'][_0x507e35['id']][_0x1435('0x34')]['messageStatus']=_0x466345;_0x24a431[_0x1435('0x12')](_0x507e35['id']);_0x1fe164(_0x466345);});});}return this[_0x1435('0x11')]['verify'](_0x507e35);};module[_0x1435('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 891bd77..98fabb8 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 _0xb224=['util','imap','lodash','randomstring','mailparser','simpleParser','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','port','tls','autotls','host','getHost','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','handleReadUnseen','length','fetch','message','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','hasOwnProperty','upperFirst','exports','path'];(function(_0x368bca,_0x4b5130){var _0x1df2d8=function(_0x3639c1){while(--_0x3639c1){_0x368bca['push'](_0x368bca['shift']());}};_0x1df2d8(++_0x4b5130);}(_0xb224,0xeb));var _0x4b22=function(_0x23b0d5,_0x5c0cfc){_0x23b0d5=_0x23b0d5-0x0;var _0x2b6ef8=_0xb224[_0x23b0d5];return _0x2b6ef8;};'use strict';var fs=require('fs');var path=require(_0x4b22('0x0'));var util=require(_0x4b22('0x1'));var Imap=require(_0x4b22('0x2'));var _=require(_0x4b22('0x3'));var rs=require(_0x4b22('0x4'));var simpleParser=require(_0x4b22('0x5'))[_0x4b22('0x6')];var EventEmitter=require('events')[_0x4b22('0x7')];var utils=require('./utils');var logger=require(_0x4b22('0x8'))(_0x4b22('0x9'));function EmailImap(_0xf0bfda,_0x597080){this[_0x4b22('0xa')]='INBOX';this[_0x4b22('0xb')]=this[_0x4b22('0xc')](_0xf0bfda,_0x597080);this[_0x4b22('0x2')]=new Imap(this['account']);this['imap'][_0x4b22('0xd')](_0x4b22('0xe'),this[_0x4b22('0xf')][_0x4b22('0x10')](this));this[_0x4b22('0x2')]['once'](_0x4b22('0x11'),this[_0x4b22('0x12')][_0x4b22('0x10')](this));this['imap']['on'](_0x4b22('0x13'),this[_0x4b22('0x14')]['bind'](this));this[_0x4b22('0x2')][_0x4b22('0x15')]();}util[_0x4b22('0x16')](EmailImap,EventEmitter);EmailImap[_0x4b22('0x17')]['getAccount']=function(_0x22d9c8,_0x1b0392){var _0x148f82={'connTimeout':_0x22d9c8[_0x4b22('0x18')]?_0x22d9c8[_0x4b22('0x18')]*0x3e8:0x2710,'authTimeout':_0x22d9c8['authTimeout']?_0x22d9c8[_0x4b22('0x19')]*0x3e8:0x1388};if(_[_0x4b22('0x1a')](_0x22d9c8[_0x4b22('0x1b')])){if(_0x22d9c8[_0x4b22('0x1c')]){_0x148f82[_0x4b22('0x1d')]=_0x22d9c8[_0x4b22('0x1d')];_0x148f82[_0x4b22('0x1e')]=_0x22d9c8[_0x4b22('0x1e')];}_0x148f82['host']=_0x22d9c8['host'];_0x148f82[_0x4b22('0x1f')]=_0x22d9c8['port']||0x3e1;if(_0x22d9c8[_0x4b22('0x20')]){_0x148f82[_0x4b22('0x20')]=!![];}else{_0x148f82[_0x4b22('0x20')]=![];_0x148f82[_0x4b22('0x21')]='required';}}else{_0x148f82[_0x4b22('0x1d')]=_0x22d9c8[_0x4b22('0x1d')];_0x148f82[_0x4b22('0x1e')]=_0x22d9c8[_0x4b22('0x1e')];_0x148f82[_0x4b22('0x22')]=utils[_0x4b22('0x23')](_0x22d9c8[_0x4b22('0x1b')]);_0x148f82['port']=0x3e1;_0x148f82[_0x4b22('0x20')]=!![];}_0x148f82[_0x4b22('0x9')]=_0x1b0392||_0x22d9c8[_0x4b22('0x1d')]||'anonymous@xcally.com';return _0x148f82;};EmailImap['prototype'][_0x4b22('0xf')]=function(){this['imap'][_0x4b22('0x24')](this[_0x4b22('0xa')],![],this[_0x4b22('0x25')][_0x4b22('0x10')](this));};EmailImap[_0x4b22('0x17')][_0x4b22('0x25')]=function(_0x218052,_0x21d1b6){if(_0x218052){this[_0x4b22('0x14')](_0x218052,!![]);}else{this[_0x4b22('0x26')](_0x4b22('0x27'),_0x21d1b6);this['readUnseen']();}};EmailImap[_0x4b22('0x17')][_0x4b22('0x28')]=function(_0x40bf42){if(_0x40bf42){this[_0x4b22('0x14')](_0x40bf42,!![]);}else{this[_0x4b22('0x2')][_0x4b22('0x11')]();}};EmailImap[_0x4b22('0x17')][_0x4b22('0x29')]=function(){this['imap']['search'](['UNSEEN'],this[_0x4b22('0x2a')][_0x4b22('0x10')](this));};EmailImap['prototype'][_0x4b22('0x2a')]=function(_0x7bddc9,_0x4d7723){if(_0x7bddc9){this[_0x4b22('0x14')](_0x7bddc9,!![]);}else{if(_0x4d7723[_0x4b22('0x2b')]){try{var _0x122a92=this[_0x4b22('0x2')][_0x4b22('0x2c')](_0x4d7723,{'bodies':'','markSeen':!![]});_0x122a92['on'](_0x4b22('0x2d'),this['handleFetchMessage'][_0x4b22('0x10')](this));_0x122a92[_0x4b22('0xd')](_0x4b22('0x13'),this['handleFetchError'][_0x4b22('0x10')](this));_0x122a92['once'](_0x4b22('0x11'),this[_0x4b22('0x2e')][_0x4b22('0x10')](this));}catch(_0x279f3b){logger[_0x4b22('0x13')](_0x279f3b);}}else{this[_0x4b22('0x2')][_0x4b22('0x2f')](!![],this[_0x4b22('0x28')][_0x4b22('0x10')](this));}}};EmailImap[_0x4b22('0x17')][_0x4b22('0x30')]=function(_0x56cd15,_0x35a560){_0x56cd15['on']('body',this[_0x4b22('0x31')][_0x4b22('0x10')](this));_0x56cd15[_0x4b22('0xd')](_0x4b22('0x32'),this['handleMessageAttributes']['bind'](this));_0x56cd15[_0x4b22('0xd')](_0x4b22('0x11'),this[_0x4b22('0x33')][_0x4b22('0x10')](this));};EmailImap[_0x4b22('0x17')][_0x4b22('0x31')]=function(_0x2d4458,_0x5caa4f){simpleParser(_0x2d4458,this[_0x4b22('0x34')][_0x4b22('0x10')](this));};EmailImap[_0x4b22('0x17')]['handleMessageAttributes']=function(_0x8d2c23){};EmailImap[_0x4b22('0x17')][_0x4b22('0x33')]=function(){};EmailImap[_0x4b22('0x17')][_0x4b22('0x34')]=function(_0x355703,_0x4adfa0){if(_0x355703){logger['error'](_0x355703);}else{var _0x2f78bc=this;utils[_0x4b22('0x35')](this[_0x4b22('0xb')],_0x4adfa0,function(_0x562208){_0x2f78bc['emit'](_0x4b22('0x9'),_0x562208);});}};EmailImap['prototype'][_0x4b22('0x2e')]=function(){this[_0x4b22('0x2')][_0x4b22('0x2f')](!![],this['handleCloseBox'][_0x4b22('0x10')](this));};EmailImap['prototype'][_0x4b22('0x36')]=function(_0x30dd09){this[_0x4b22('0x14')](_0x30dd09);this[_0x4b22('0x2')][_0x4b22('0x2f')](!![],this[_0x4b22('0x28')][_0x4b22('0x10')](this));};EmailImap[_0x4b22('0x17')][_0x4b22('0x12')]=function(){this[_0x4b22('0x26')]('end');};EmailImap['prototype']['handleError']=function(_0x3b3f41,_0x45da78){logger[_0x4b22('0x13')](_0x4b22('0x14'),this[_0x4b22('0xb')][_0x4b22('0x9')],JSON[_0x4b22('0x37')](_0x3b3f41));var _0x4b07c1='';if(_0x3b3f41){if(_0x3b3f41['textCode']){_0x4b07c1=_0x3b3f41['textCode'];}else{for(var _0x58a456 in _0x3b3f41){if(_0x3b3f41[_0x4b22('0x38')](_0x58a456)){_0x4b07c1+=_[_0x4b22('0x39')](_0x58a456)+':\x20'+_0x3b3f41[_0x58a456]+'\x0a';}}}}if(_0x45da78){this['imap'][_0x4b22('0x11')]();}else{this[_0x4b22('0x26')]('error',_0x4b07c1);this[_0x4b22('0x26')](_0x4b22('0x11'));}};module[_0x4b22('0x3a')]=EmailImap; \ No newline at end of file +var _0xf432=['stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','getAccount','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','required','getHost','prototype','openBox','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','handleMessageAttributes','handleSimpleParser','parser'];(function(_0x29f356,_0x1e1ee4){var _0x12cc82=function(_0x33d8b0){while(--_0x33d8b0){_0x29f356['push'](_0x29f356['shift']());}};_0x12cc82(++_0x1e1ee4);}(_0xf432,0x19b));var _0x2f43=function(_0x4f2d17,_0x13156c){_0x4f2d17=_0x4f2d17-0x0;var _0x277b0d=_0xf432[_0x4f2d17];return _0x277b0d;};'use strict';var fs=require('fs');var path=require(_0x2f43('0x0'));var util=require(_0x2f43('0x1'));var Imap=require(_0x2f43('0x2'));var _=require(_0x2f43('0x3'));var rs=require(_0x2f43('0x4'));var simpleParser=require(_0x2f43('0x5'))['simpleParser'];var EventEmitter=require('events')[_0x2f43('0x6')];var utils=require(_0x2f43('0x7'));var logger=require(_0x2f43('0x8'))(_0x2f43('0x9'));function EmailImap(_0x522846,_0x12278c){this[_0x2f43('0xa')]=_0x2f43('0xb');this[_0x2f43('0xc')]=this['getAccount'](_0x522846,_0x12278c);this[_0x2f43('0x2')]=new Imap(this[_0x2f43('0xc')]);this[_0x2f43('0x2')][_0x2f43('0xd')](_0x2f43('0xe'),this[_0x2f43('0xf')][_0x2f43('0x10')](this));this[_0x2f43('0x2')][_0x2f43('0xd')](_0x2f43('0x11'),this[_0x2f43('0x12')]['bind'](this));this[_0x2f43('0x2')]['on'](_0x2f43('0x13'),this['handleError'][_0x2f43('0x10')](this));this['imap'][_0x2f43('0x14')]();}util[_0x2f43('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x2f43('0x16')]=function(_0x262cbf,_0x592e12){var _0x256ee6={'connTimeout':_0x262cbf[_0x2f43('0x17')]?_0x262cbf[_0x2f43('0x17')]*0x3e8:0x2710,'authTimeout':_0x262cbf['authTimeout']?_0x262cbf[_0x2f43('0x18')]*0x3e8:0x1388};if(_[_0x2f43('0x19')](_0x262cbf['service'])){if(_0x262cbf[_0x2f43('0x1a')]){_0x256ee6[_0x2f43('0x1b')]=_0x262cbf[_0x2f43('0x1b')];_0x256ee6[_0x2f43('0x1c')]=_0x262cbf[_0x2f43('0x1c')];}_0x256ee6[_0x2f43('0x1d')]=_0x262cbf[_0x2f43('0x1d')];_0x256ee6[_0x2f43('0x1e')]=_0x262cbf[_0x2f43('0x1e')]||0x3e1;if(_0x262cbf['tls']){_0x256ee6[_0x2f43('0x1f')]=!![];}else{_0x256ee6[_0x2f43('0x1f')]=![];_0x256ee6['autotls']=_0x2f43('0x20');}}else{_0x256ee6[_0x2f43('0x1b')]=_0x262cbf[_0x2f43('0x1b')];_0x256ee6[_0x2f43('0x1c')]=_0x262cbf[_0x2f43('0x1c')];_0x256ee6[_0x2f43('0x1d')]=utils[_0x2f43('0x21')](_0x262cbf['service']);_0x256ee6['port']=0x3e1;_0x256ee6[_0x2f43('0x1f')]=!![];}_0x256ee6[_0x2f43('0x9')]=_0x592e12||_0x262cbf[_0x2f43('0x1b')]||'anonymous@xcally.com';return _0x256ee6;};EmailImap[_0x2f43('0x22')][_0x2f43('0xf')]=function(){this[_0x2f43('0x2')][_0x2f43('0x23')](this[_0x2f43('0xa')],![],this['handleOpenBox'][_0x2f43('0x10')](this));};EmailImap[_0x2f43('0x22')]['handleOpenBox']=function(_0x531597,_0x2c1335){if(_0x531597){this[_0x2f43('0x24')](_0x531597,!![]);}else{this[_0x2f43('0x25')](_0x2f43('0x26'),_0x2c1335);this[_0x2f43('0x27')]();}};EmailImap[_0x2f43('0x22')][_0x2f43('0x28')]=function(_0x3f6840){if(_0x3f6840){this[_0x2f43('0x24')](_0x3f6840,!![]);}else{this['imap'][_0x2f43('0x11')]();}};EmailImap[_0x2f43('0x22')][_0x2f43('0x27')]=function(){this[_0x2f43('0x2')]['search']([_0x2f43('0x29')],this['handleReadUnseen'][_0x2f43('0x10')](this));};EmailImap[_0x2f43('0x22')][_0x2f43('0x2a')]=function(_0x269478,_0x350a72){if(_0x269478){this[_0x2f43('0x24')](_0x269478,!![]);}else{if(_0x350a72['length']){try{var _0x26d1f6=this[_0x2f43('0x2')][_0x2f43('0x2b')](_0x350a72,{'bodies':'','markSeen':!![]});_0x26d1f6['on'](_0x2f43('0x2c'),this[_0x2f43('0x2d')]['bind'](this));_0x26d1f6[_0x2f43('0xd')](_0x2f43('0x13'),this[_0x2f43('0x2e')][_0x2f43('0x10')](this));_0x26d1f6[_0x2f43('0xd')]('end',this[_0x2f43('0x2f')][_0x2f43('0x10')](this));}catch(_0x262989){logger[_0x2f43('0x13')](_0x262989);}}else{this[_0x2f43('0x2')][_0x2f43('0x30')](!![],this['handleCloseBox'][_0x2f43('0x10')](this));}}};EmailImap[_0x2f43('0x22')][_0x2f43('0x2d')]=function(_0x1721e6,_0x15fc02){_0x1721e6['on']('body',this[_0x2f43('0x31')][_0x2f43('0x10')](this));_0x1721e6[_0x2f43('0xd')]('attributes',this[_0x2f43('0x32')][_0x2f43('0x10')](this));_0x1721e6['once'](_0x2f43('0x11'),this['handleMessageEnd'][_0x2f43('0x10')](this));};EmailImap['prototype'][_0x2f43('0x31')]=function(_0x1b91b7,_0x386d2f){simpleParser(_0x1b91b7,this[_0x2f43('0x33')][_0x2f43('0x10')](this));};EmailImap[_0x2f43('0x22')]['handleMessageAttributes']=function(_0x384ccb){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap['prototype'][_0x2f43('0x33')]=function(_0x45699e,_0x17850d){if(_0x45699e){logger[_0x2f43('0x13')](_0x45699e);}else{var _0x3f8f00=this;utils[_0x2f43('0x34')](this[_0x2f43('0xc')],_0x17850d,function(_0x1d5193){_0x3f8f00['emit'](_0x2f43('0x9'),_0x1d5193);});}};EmailImap['prototype'][_0x2f43('0x2f')]=function(){this[_0x2f43('0x2')]['closeBox'](!![],this[_0x2f43('0x28')]['bind'](this));};EmailImap[_0x2f43('0x22')][_0x2f43('0x2e')]=function(_0x390340){this[_0x2f43('0x24')](_0x390340);this['imap'][_0x2f43('0x30')](!![],this[_0x2f43('0x28')][_0x2f43('0x10')](this));};EmailImap[_0x2f43('0x22')][_0x2f43('0x12')]=function(){this[_0x2f43('0x25')](_0x2f43('0x11'));};EmailImap['prototype'][_0x2f43('0x24')]=function(_0x9edde,_0x1a9635){logger[_0x2f43('0x13')](_0x2f43('0x24'),this['account'][_0x2f43('0x9')],JSON[_0x2f43('0x35')](_0x9edde));var _0x47e783='';if(_0x9edde){if(_0x9edde[_0x2f43('0x36')]){_0x47e783=_0x9edde[_0x2f43('0x36')];}else{for(var _0x3242ec in _0x9edde){if(_0x9edde[_0x2f43('0x37')](_0x3242ec)){_0x47e783+=_[_0x2f43('0x38')](_0x3242ec)+':\x20'+_0x9edde[_0x3242ec]+'\x0a';}}}}if(_0x1a9635){this[_0x2f43('0x2')]['end']();}else{this['emit']('error',_0x47e783);this[_0x2f43('0x25')]('end');}};module[_0x2f43('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6acf6b6..4b135ff 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 _0x3be3=['send','createTransport','use','compile','sendMail','toString','verify','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype'];(function(_0x3e9c8b,_0x431909){var _0x535df9=function(_0x498b90){while(--_0x498b90){_0x3e9c8b['push'](_0x3e9c8b['shift']());}};_0x535df9(++_0x431909);}(_0x3be3,0x1c4));var _0x33be=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x3be3[_0x622035];return _0x326cf2;};'use strict';var nodemailer=require(_0x33be('0x0'));var BPromise=require(_0x33be('0x1'));var inlineBase64=require(_0x33be('0x2'));function EmailSmtp(){}EmailSmtp[_0x33be('0x3')][_0x33be('0x4')]=function(_0x6ae6b0,_0x458420){return new BPromise(function(_0x4b5c2f,_0x570d44){var _0x42dff7=nodemailer[_0x33be('0x5')](_0x6ae6b0);_0x42dff7[_0x33be('0x6')](_0x33be('0x7'),inlineBase64());_0x42dff7[_0x33be('0x8')](_0x458420,function(_0x12ed32,_0x10446b){if(_0x12ed32){_0x570d44(_0x12ed32[_0x33be('0x9')]());}else{_0x4b5c2f(_0x10446b);}});});};EmailSmtp['prototype']['verify']=function(_0x84e586){return new BPromise(function(_0x2dd7b6,_0x421366){var _0x22d33f=nodemailer[_0x33be('0x5')](_0x84e586);_0x22d33f[_0x33be('0xa')](function(_0x406a0b,_0x2fb881){if(_0x406a0b){_0x421366(_0x406a0b[_0x33be('0x9')]());}else{if(_0x2fb881){_0x2dd7b6(_0x2fb881);}else{_0x421366('Not\x20verifired');}}});});};module[_0x33be('0xb')]=EmailSmtp; \ No newline at end of file +var _0x5d6d=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail','verify','Not\x20verifired','bluebird'];(function(_0x29c59a,_0x192cdf){var _0x1311d5=function(_0x13331f){while(--_0x13331f){_0x29c59a['push'](_0x29c59a['shift']());}};_0x1311d5(++_0x192cdf);}(_0x5d6d,0x19d));var _0xd5d6=function(_0x25b23b,_0x54c6f4){_0x25b23b=_0x25b23b-0x0;var _0x4477e4=_0x5d6d[_0x25b23b];return _0x4477e4;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xd5d6('0x0'));var inlineBase64=require(_0xd5d6('0x1'));function EmailSmtp(){}EmailSmtp[_0xd5d6('0x2')][_0xd5d6('0x3')]=function(_0x32ccf4,_0x2e3683){return new BPromise(function(_0x37d463,_0x4a42d8){var _0x26b8da=nodemailer[_0xd5d6('0x4')](_0x32ccf4);_0x26b8da[_0xd5d6('0x5')]('compile',inlineBase64());_0x26b8da[_0xd5d6('0x6')](_0x2e3683,function(_0x371034,_0x1199cf){if(_0x371034){_0x4a42d8(_0x371034['toString']());}else{_0x37d463(_0x1199cf);}});});};EmailSmtp[_0xd5d6('0x2')][_0xd5d6('0x7')]=function(_0x469f06){return new BPromise(function(_0x16a256,_0x262b77){var _0xb2c9b4=nodemailer['createTransport'](_0x469f06);_0xb2c9b4[_0xd5d6('0x7')](function(_0x2c1300,_0x284367){if(_0x2c1300){_0x262b77(_0x2c1300['toString']());}else{if(_0x284367){_0x16a256(_0x284367);}else{_0x262b77(_0xd5d6('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 97708d9..b62e84a 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 _0x2aa3=['head','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','value','pop','isEmpty','html','replace','body','textAsHtml','Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','../../../config/logger','email','../../../config/environment'];(function(_0x2a6644,_0x1b9d0c){var _0x33c14=function(_0x47722a){while(--_0x47722a){_0x2a6644['push'](_0x2a6644['shift']());}};_0x33c14(++_0x1b9d0c);}(_0x2aa3,0x83));var _0x32aa=function(_0x1b1791,_0x3723a1){_0x1b1791=_0x1b1791-0x0;var _0x2deba3=_0x2aa3[_0x1b1791];return _0x2deba3;};'use strict';var _=require(_0x32aa('0x0'));var moment=require(_0x32aa('0x1'));var random=require(_0x32aa('0x2'));var fs=require('fs');var path=require(_0x32aa('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x32aa('0x4'))(_0x32aa('0x5'));var config=require(_0x32aa('0x6'));function getAddress(_0x33612d){var _0x22e989=_[_0x32aa('0x7')](_0x33612d['value']);return _0x22e989&&_0x22e989[_0x32aa('0x8')]?_0x22e989[_0x32aa('0x8')]:_0x32aa('0x9')+random[_0x32aa('0xa')](0x6)+_0x32aa('0xb');}function getFirstName(_0x40c96a){var _0x2fe991=_[_0x32aa('0x7')](_0x40c96a['value']);if(_0x2fe991&&_0x2fe991[_0x32aa('0xc')]){var _0x56992d=_0x2fe991[_0x32aa('0xc')][_0x32aa('0xd')](/\s+/);return _0x56992d[_0x32aa('0xe')]?_0x56992d[_0x32aa('0xf')](0x0,-0x1)['join']('\x20'):_0x2fe991[_0x32aa('0xc')];}return _0x32aa('0x10');}function getLastName(_0x204e9e){var _0x59b0f6=_[_0x32aa('0x7')](_0x204e9e[_0x32aa('0x11')]);if(_0x59b0f6&&_0x59b0f6[_0x32aa('0xc')]){var _0x22c07a=_0x59b0f6[_0x32aa('0xc')][_0x32aa('0xd')](/\s+/);return _0x22c07a[_0x32aa('0xe')]>0x1?_0x22c07a[_0x32aa('0x12')]():'';}return'';}function getMails(_0x58d625,_0x274ae0){var _0x230d19='';for(var _0x1140a6=0x0;_0x1140a6<_0x274ae0[_0x32aa('0x11')][_0x32aa('0xe')];_0x1140a6+=0x1){if(_0x274ae0['value'][_0x1140a6][_0x32aa('0x8')]!==_0x58d625){if(!_[_0x32aa('0x13')](_0x230d19)){_0x230d19+=',';}_0x230d19+=_0x274ae0[_0x32aa('0x11')][_0x1140a6][_0x32aa('0xc')]||_0x274ae0[_0x32aa('0x11')][_0x1140a6]['address']||'';_0x230d19+='\x20<';_0x230d19+=_0x274ae0['value'][_0x1140a6][_0x32aa('0x8')]?_0x274ae0[_0x32aa('0x11')][_0x1140a6][_0x32aa('0x8')]:'anonymous'+random['generate'](0x6)+_0x32aa('0xb');_0x230d19+='>';}}return _0x230d19;}function parseEmail(_0x148255,_0x1d7490,_0xe4523f){if(_0x1d7490[_0x32aa('0x14')]){var _0x1cb0eb=/)<[^<]*)*<\/script>/gi;while(_0x1cb0eb['test'](_0x1d7490[_0x32aa('0x14')])){_0x1d7490[_0x32aa('0x14')]=_0x1d7490[_0x32aa('0x14')][_0x32aa('0x15')](_0x1cb0eb,'');}_0xe4523f[_0x32aa('0x16')]=_0x1d7490[_0x32aa('0x14')];}else{_0xe4523f[_0x32aa('0x16')]=_0x1d7490[_0x32aa('0x17')];}if(_0xe4523f[_0x32aa('0x16')]){_0xe4523f['body']=_0xe4523f[_0x32aa('0x16')]['replace'](/Empty\x20message

','Attachments','getHost','gmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','util','node-tnef','../../../config/environment','head','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','pop','address','isEmpty','html','replace','body','0x1?_0x507075[_0x8855('0x10')]():'';}return'';}function getMails(_0x273cda,_0x4281d8){var _0x3b31dd='';for(var _0x57e1bc=0x0;_0x57e1bc<_0x4281d8[_0x8855('0x9')][_0x8855('0xc')];_0x57e1bc+=0x1){if(_0x4281d8[_0x8855('0x9')][_0x57e1bc][_0x8855('0x11')]!==_0x273cda){if(!_[_0x8855('0x12')](_0x3b31dd)){_0x3b31dd+=',';}_0x3b31dd+=_0x4281d8['value'][_0x57e1bc][_0x8855('0xa')]||_0x4281d8[_0x8855('0x9')][_0x57e1bc][_0x8855('0x11')]||'';_0x3b31dd+='\x20<';_0x3b31dd+=_0x4281d8['value'][_0x57e1bc][_0x8855('0x11')]?_0x4281d8[_0x8855('0x9')][_0x57e1bc]['address']:'anonymous'+random[_0x8855('0x7')](0x6)+_0x8855('0x8');_0x3b31dd+='>';}}return _0x3b31dd;}function parseEmail(_0x19c4cb,_0x22fea9,_0x109757){if(_0x22fea9[_0x8855('0x13')]){var _0x3c4d78=/)<[^<]*)*<\/script>/gi;while(_0x3c4d78['test'](_0x22fea9['html'])){_0x22fea9[_0x8855('0x13')]=_0x22fea9[_0x8855('0x13')][_0x8855('0x14')](_0x3c4d78,'');}_0x109757[_0x8855('0x15')]=_0x22fea9[_0x8855('0x13')];}else{_0x109757['body']=_0x22fea9['textAsHtml'];}if(_0x109757[_0x8855('0x15')]){_0x109757['body']=_0x109757[_0x8855('0x15')][_0x8855('0x14')](/0x0){if(this[_0x39a76c+_0x71a6('0x27')]>0x0&&this[_0x39a76c+_0x71a6('0x28')]>=this[_0x39a76c+_0x71a6('0x27')]){return _0x71a6('0x29');}else{return _0x71a6('0x2a');}}else{return _0x71a6('0x2b');}};Agent['prototype'][_0x71a6('0x2c')]=function(){var _0x45fd9b=['mail',_0x71a6('0x2d'),_0x71a6('0x2e'),_0x71a6('0x2f'),'sms'];for(var _0x7aa06b=0x0;_0x7aa06b<_0x45fd9b[_0x71a6('0x30')];_0x7aa06b+=0x1){var _0x1413cb=this['getChannelStatus'](_0x45fd9b[_0x7aa06b]);if(this[_0x45fd9b[_0x7aa06b]+_0x71a6('0x31')]!==_0x1413cb){this[_0x45fd9b[_0x7aa06b]+_0x71a6('0x32')]=_[_0x71a6('0x33')](moment()['format']('x'));}this[_0x45fd9b[_0x7aa06b]+_0x71a6('0x31')]=_0x1413cb;}var _0x139365={'id':this['id'],'name':this[_0x71a6('0x7')],'online':this[_0x71a6('0x8')],'voicePause':this[_0x71a6('0x9')],'chatPause':this[_0x71a6('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x71a6('0xd')],'faxPause':this[_0x71a6('0xc')],'openchannelPause':this[_0x71a6('0xe')],'chatStatus':this[_0x71a6('0xf')],'chatStatusTime':this[_0x71a6('0x11')],'chatCapacity':this[_0x71a6('0x12')],'chatCurrentCapacity':this[_0x71a6('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x71a6('0x15')],'mailCapacity':this[_0x71a6('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x71a6('0x19')],'faxCapacity':this[_0x71a6('0x1a')],'faxCurrentCapacity':this[_0x71a6('0x34')],'smsStatus':this[_0x71a6('0x1b')],'smsStatusTime':this[_0x71a6('0x1c')],'smsCapacity':this[_0x71a6('0x1d')],'smsCurrentCapacity':this[_0x71a6('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x71a6('0x20')],'openchannelCapacity':this[_0x71a6('0x21')],'openchannelCurrentCapacity':this[_0x71a6('0x22')],'busy':this[_0x71a6('0x23')],'busyQueue':this['busyQueue']};var _0x16119d=md5(JSON['stringify'](_0x139365));if(this[_0x71a6('0x1')]!==_0x16119d){this['md5']=_0x16119d;io[_0x71a6('0x35')](_0x71a6('0x36'),_0x139365);}};module['exports']=Agent; \ No newline at end of file +var _0xf1ff=['mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','openchannel','length','format','Status','openchannelPause','chatStatus','mailCurrentCapacity','stringify','emit','user:save','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatCapacity','chatCurrentCapacity'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xf1ff,0xe8));var _0xff1f=function(_0x1ee35d,_0x56b6a8){_0x1ee35d=_0x1ee35d-0x0;var _0x1338d2=_0xf1ff[_0x1ee35d];return _0x1338d2;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require(_0xff1f('0x0'));var config=require('../../../config/environment');config[_0xff1f('0x1')]=_[_0xff1f('0x2')](config[_0xff1f('0x1')],{'host':_0xff1f('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xff1f('0x1')]));function Agent(_0x57c86e){this['id']=_0x57c86e['id']||0x0;this[_0xff1f('0x4')]=_0x57c86e[_0xff1f('0x4')]||'';this[_0xff1f('0x5')]=_0x57c86e[_0xff1f('0x5')]||!![];this[_0xff1f('0x6')]=_0x57c86e[_0xff1f('0x6')]||![];this[_0xff1f('0x7')]=_0x57c86e[_0xff1f('0x7')]||![];this[_0xff1f('0x8')]=_0x57c86e[_0xff1f('0x8')]||![];this[_0xff1f('0x9')]=_0x57c86e[_0xff1f('0x9')]||![];this[_0xff1f('0xa')]=_0x57c86e['smsPause']||![];this['openchannelPause']=_0x57c86e['openchannelPause']||![];this['chatStatus']='unknown';this['chatStatusTime']=0x0;this[_0xff1f('0xb')]=_0x57c86e[_0xff1f('0xb')]||0x0;this[_0xff1f('0xc')]=0x0;this[_0xff1f('0xd')]=_0xff1f('0xe');this[_0xff1f('0xf')]=0x0;this[_0xff1f('0x10')]=_0x57c86e[_0xff1f('0x10')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xff1f('0x11')]='unknown';this[_0xff1f('0x12')]=0x0;this['faxCapacity']=_0x57c86e[_0xff1f('0x13')]||0x0;this[_0xff1f('0x14')]=0x0;this[_0xff1f('0x15')]=_0xff1f('0xe');this[_0xff1f('0x16')]=0x0;this[_0xff1f('0x17')]=_0x57c86e['smsCapacity']||0x0;this[_0xff1f('0x18')]=0x0;this['openchannelStatus']=_0xff1f('0xe');this[_0xff1f('0x19')]=0x0;this[_0xff1f('0x1a')]=_0x57c86e[_0xff1f('0x1a')]||0x0;this[_0xff1f('0x1b')]=0x0;this[_0xff1f('0x1c')]=![];this[_0xff1f('0x1d')]=undefined;this[_0xff1f('0x1e')]='';this[_0xff1f('0x1f')]();}Agent[_0xff1f('0x20')][_0xff1f('0x21')]=function(_0x42adcf){if(this[_0x42adcf+_0xff1f('0x22')]>0x0){if(this[_0x42adcf+_0xff1f('0x23')]>0x0&&this[_0x42adcf+_0xff1f('0x22')]>=this[_0x42adcf+'Capacity']){return _0xff1f('0x24');}else{return'working';}}else{return'idle';}};Agent[_0xff1f('0x20')][_0xff1f('0x1f')]=function(){var _0x495a34=[_0xff1f('0x25'),_0xff1f('0x26'),_0xff1f('0x27'),'fax','sms'];for(var _0x34294b=0x0;_0x34294b<_0x495a34[_0xff1f('0x28')];_0x34294b+=0x1){var _0x2bc9f5=this[_0xff1f('0x21')](_0x495a34[_0x34294b]);if(this[_0x495a34[_0x34294b]+'Status']!==_0x2bc9f5){this[_0x495a34[_0x34294b]+'StatusTime']=_['toNumber'](moment()[_0xff1f('0x29')]('x'));}this[_0x495a34[_0x34294b]+_0xff1f('0x2a')]=_0x2bc9f5;}var _0x1c0a69={'id':this['id'],'name':this['name'],'online':this[_0xff1f('0x5')],'voicePause':this['voicePause'],'chatPause':this[_0xff1f('0x7')],'mailPause':this[_0xff1f('0x8')],'smsPause':this['smsPause'],'faxPause':this[_0xff1f('0x9')],'openchannelPause':this[_0xff1f('0x2b')],'chatStatus':this[_0xff1f('0x2c')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xff1f('0xb')],'chatCurrentCapacity':this[_0xff1f('0xc')],'mailStatus':this[_0xff1f('0xd')],'mailStatusTime':this[_0xff1f('0xf')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xff1f('0x2d')],'faxStatus':this[_0xff1f('0x11')],'faxStatusTime':this[_0xff1f('0x12')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xff1f('0x14')],'smsStatus':this[_0xff1f('0x15')],'smsStatusTime':this[_0xff1f('0x16')],'smsCapacity':this[_0xff1f('0x17')],'smsCurrentCapacity':this[_0xff1f('0x18')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xff1f('0x19')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xff1f('0x1d')]};var _0x50b354=md5(JSON[_0xff1f('0x2e')](_0x1c0a69));if(this[_0xff1f('0x1e')]!==_0x50b354){this[_0xff1f('0x1e')]=_0x50b354;io[_0xff1f('0x2f')](_0xff1f('0x30'),_0x1c0a69);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 6ab7723..f50f3b3 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 _0xaa49=['updateRouting','map','_rr','prototype','paused','length','online','loggedIn','chatPause','available','waiting','stringify','emit','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xaa49,0x195));var _0x9aa4=function(_0x83bd16,_0x32e4ff){_0x83bd16=_0x83bd16-0x0;var _0x5c7bd6=_0xaa49[_0x83bd16];return _0x5c7bd6;};'use strict';var _=require(_0x9aa4('0x0'));var md5=require(_0x9aa4('0x1'));var util=require(_0x9aa4('0x2'));var Redis=require(_0x9aa4('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x9aa4('0x4')](config[_0x9aa4('0x5')],{'host':_0x9aa4('0x6'),'port':0x18eb});var io=require(_0x9aa4('0x7'))(new Redis(config[_0x9aa4('0x5')]));function ChatQueue(_0x3a9ba9){this['id']=_0x3a9ba9['id']||0x0;this[_0x9aa4('0x8')]=_0x3a9ba9[_0x9aa4('0x8')]||'';this[_0x9aa4('0x9')]=_0x3a9ba9[_0x9aa4('0x9')]||0xa;this[_0x9aa4('0xa')]=_0x3a9ba9[_0x9aa4('0xa')]||_0x9aa4('0xb');this[_0x9aa4('0xc')]=_0x3a9ba9['Agents'];this[_0x9aa4('0xd')]={};this['waiting']=0x0;this[_0x9aa4('0x1')]='';this['updateRouting']();this[_0x9aa4('0xe')]();}ChatQueue['prototype'][_0x9aa4('0xf')]=function(){var _0x1ecf68=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x9aa4('0x10')](this['Agents'],'id');this[_0x9aa4('0xd')][_0x9aa4('0x11')]=_0x1ecf68;};ChatQueue[_0x9aa4('0x12')][_0x9aa4('0xe')]=function(){this['loggedIn']=0x0;this[_0x9aa4('0x13')]=0x0;for(var _0x1603ac=0x0;_0x1603ac=0x0?this[_0x9aa4('0x18')]:0x0;var _0x23fdf7={'id':this['id'],'available':this[_0x9aa4('0x18')],'loggedIn':this[_0x9aa4('0x16')],'name':this[_0x9aa4('0x8')],'paused':this[_0x9aa4('0x13')],'waiting':this[_0x9aa4('0x19')]};var _0x240048=md5(JSON[_0x9aa4('0x1a')](_0x23fdf7));if(this[_0x9aa4('0x1')]!==_0x240048){this['md5']=_0x240048;io['to'](util['format']('chat:queue:%s',_0x23fdf7[_0x9aa4('0x8')]))[_0x9aa4('0x1b')]('chat_queue:save',_0x23fdf7);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xf530=['chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','mapAgentsId','map','_rr','prototype','updateRealtime','paused','length','online','loggedIn','chatPause','available','stringify'];(function(_0x3b517c,_0x533b4e){var _0x5cc760=function(_0x5c9210){while(--_0x5c9210){_0x3b517c['push'](_0x3b517c['shift']());}};_0x5cc760(++_0x533b4e);}(_0xf530,0x18a));var _0x0f53=function(_0x4134c9,_0x59c7a7){_0x4134c9=_0x4134c9-0x0;var _0x2f49b9=_0xf530[_0x4134c9];return _0x2f49b9;};'use strict';var _=require(_0x0f53('0x0'));var md5=require(_0x0f53('0x1'));var util=require(_0x0f53('0x2'));var Redis=require(_0x0f53('0x3'));var config=require(_0x0f53('0x4'));config['redis']=_[_0x0f53('0x5')](config['redis'],{'host':_0x0f53('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x15b907){this['id']=_0x15b907['id']||0x0;this['name']=_0x15b907[_0x0f53('0x7')]||'';this['timeout']=_0x15b907[_0x0f53('0x8')]||0xa;this[_0x0f53('0x9')]=_0x15b907[_0x0f53('0x9')]||_0x0f53('0xa');this[_0x0f53('0xb')]=_0x15b907[_0x0f53('0xb')];this['mapAgentsId']={};this[_0x0f53('0xc')]=0x0;this[_0x0f53('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0x0f53('0xd')]=function(){var _0x58ffcd=this[_0x0f53('0xe')]['_rr'];this[_0x0f53('0xe')]=_[_0x0f53('0xf')](this[_0x0f53('0xb')],'id');this[_0x0f53('0xe')][_0x0f53('0x10')]=_0x58ffcd;};ChatQueue[_0x0f53('0x11')][_0x0f53('0x12')]=function(){this['loggedIn']=0x0;this[_0x0f53('0x13')]=0x0;for(var _0x14c212=0x0;_0x14c212=0x0?this[_0x0f53('0x18')]:0x0;var _0x3fabdb={'id':this['id'],'available':this[_0x0f53('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x0f53('0x7')],'paused':this[_0x0f53('0x13')],'waiting':this[_0x0f53('0xc')]};var _0x21ec3b=md5(JSON[_0x0f53('0x19')](_0x3fabdb));if(this[_0x0f53('0x1')]!==_0x21ec3b){this[_0x0f53('0x1')]=_0x21ec3b;io['to'](util['format'](_0x0f53('0x1a'),_0x3fabdb['name']))[_0x0f53('0x1b')](_0x0f53('0x1c'),_0x3fabdb);}};module[_0x0f53('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b409e81..7cd8b8f 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 _0x0658=['fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','faxPause','available','stringify','format'];(function(_0x540fad,_0x5874e5){var _0x8508a2=function(_0x541a07){while(--_0x541a07){_0x540fad['push'](_0x540fad['shift']());}};_0x8508a2(++_0x5874e5);}(_0x0658,0x1a8));var _0x8065=function(_0x3d6325,_0x220caa){_0x3d6325=_0x3d6325-0x0;var _0x5db5d7=_0x0658[_0x3d6325];return _0x5db5d7;};'use strict';var _=require(_0x8065('0x0'));var md5=require(_0x8065('0x1'));var util=require(_0x8065('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x8065('0x3')]=_[_0x8065('0x4')](config['redis'],{'host':_0x8065('0x5'),'port':0x18eb});var io=require(_0x8065('0x6'))(new Redis(config[_0x8065('0x3')]));function FaxQueue(_0x166bc5){this['id']=_0x166bc5['id']||0x0;this[_0x8065('0x7')]=_0x166bc5['name']||'';this[_0x8065('0x8')]=_0x166bc5[_0x8065('0x8')]||0xa;this[_0x8065('0x9')]=_0x166bc5['strategy']||'beepall';this['Agents']=_0x166bc5[_0x8065('0xa')];this[_0x8065('0xb')]={};this[_0x8065('0xc')]=0x0;this[_0x8065('0x1')]='';this[_0x8065('0xd')]();this[_0x8065('0xe')]();}FaxQueue[_0x8065('0xf')][_0x8065('0xd')]=function(){var _0x47bb1a=this[_0x8065('0xb')][_0x8065('0x10')];this[_0x8065('0xb')]=_[_0x8065('0x11')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x47bb1a;};FaxQueue[_0x8065('0xf')][_0x8065('0xe')]=function(){this['loggedIn']=0x0;this[_0x8065('0x12')]=0x0;for(var _0x5cc120=0x0;_0x5cc120=0x0?this[_0x8065('0x17')]:0x0;var _0x395cbd={'id':this['id'],'available':this[_0x8065('0x17')],'loggedIn':this[_0x8065('0x15')],'name':this[_0x8065('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x5944ab=md5(JSON[_0x8065('0x18')](_0x395cbd));if(this['md5']!==_0x5944ab){this[_0x8065('0x1')]=_0x5944ab;io['to'](util[_0x8065('0x19')](_0x8065('0x1a'),_0x395cbd[_0x8065('0x7')]))[_0x8065('0x1b')](_0x8065('0x1c'),_0x395cbd);}};module[_0x8065('0x1d')]=FaxQueue; \ No newline at end of file +var _0xcd51=['name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','lodash','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0x1d60b5,_0x56ed0f){var _0x3bc29f=function(_0x5158ae){while(--_0x5158ae){_0x1d60b5['push'](_0x1d60b5['shift']());}};_0x3bc29f(++_0x56ed0f);}(_0xcd51,0x1ac));var _0x1cd5=function(_0xa888d3,_0x37e5fe){_0xa888d3=_0xa888d3-0x0;var _0x57778c=_0xcd51[_0xa888d3];return _0x57778c;};'use strict';var _=require(_0x1cd5('0x0'));var md5=require('md5');var util=require(_0x1cd5('0x1'));var Redis=require('ioredis');var config=require(_0x1cd5('0x2'));config['redis']=_[_0x1cd5('0x3')](config[_0x1cd5('0x4')],{'host':_0x1cd5('0x5'),'port':0x18eb});var io=require(_0x1cd5('0x6'))(new Redis(config[_0x1cd5('0x4')]));function FaxQueue(_0x40b23c){this['id']=_0x40b23c['id']||0x0;this[_0x1cd5('0x7')]=_0x40b23c[_0x1cd5('0x7')]||'';this[_0x1cd5('0x8')]=_0x40b23c[_0x1cd5('0x8')]||0xa;this[_0x1cd5('0x9')]=_0x40b23c[_0x1cd5('0x9')]||'beepall';this[_0x1cd5('0xa')]=_0x40b23c[_0x1cd5('0xa')];this[_0x1cd5('0xb')]={};this[_0x1cd5('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x1cd5('0xd')][_0x1cd5('0xe')]=function(){var _0x2581eb=this[_0x1cd5('0xb')][_0x1cd5('0xf')];this[_0x1cd5('0xb')]=_[_0x1cd5('0x10')](this[_0x1cd5('0xa')],'id');this['mapAgentsId']['_rr']=_0x2581eb;};FaxQueue['prototype'][_0x1cd5('0x11')]=function(){this[_0x1cd5('0x12')]=0x0;this[_0x1cd5('0x13')]=0x0;for(var _0x4039d0=0x0;_0x4039d0=0x0?this['available']:0x0;var _0x22055e={'id':this['id'],'available':this[_0x1cd5('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x1cd5('0x7')],'paused':this[_0x1cd5('0x13')],'waiting':this[_0x1cd5('0xc')]};var _0x27c0f2=md5(JSON[_0x1cd5('0x17')](_0x22055e));if(this[_0x1cd5('0x18')]!==_0x27c0f2){this['md5']=_0x27c0f2;io['to'](util[_0x1cd5('0x19')](_0x1cd5('0x1a'),_0x22055e[_0x1cd5('0x7')]))[_0x1cd5('0x1b')](_0x1cd5('0x1c'),_0x22055e);}};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 5656c78..3a5180a 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 _0x3077=['exports','name','Intervals'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x3077,0x8b));var _0x7307=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x3077[_0x3635ce];return _0x97ecd0;};'use strict';function Interval(_0x52179c){this['id']=_0x52179c['id']||0x0;this[_0x7307('0x0')]=_0x52179c['name']||'';this[_0x7307('0x1')]=_0x52179c['Intervals']||{};}module[_0x7307('0x2')]=Interval; \ No newline at end of file +var _0xfa03=['name','Intervals'];(function(_0xd70515,_0x50cfb3){var _0x1e9a3a=function(_0xbb7d0c){while(--_0xbb7d0c){_0xd70515['push'](_0xd70515['shift']());}};_0x1e9a3a(++_0x50cfb3);}(_0xfa03,0x168));var _0x3fa0=function(_0x1881d0,_0x3e691d){_0x1881d0=_0x1881d0-0x0;var _0x8f2d9=_0xfa03[_0x1881d0];return _0x8f2d9;};'use strict';function Interval(_0x53687e){this['id']=_0x53687e['id']||0x0;this[_0x3fa0('0x0')]=_0x53687e['name']||'';this[_0x3fa0('0x1')]=_0x53687e[_0x3fa0('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 166768b..cc2eabd 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 _0x31c2=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x31c2,0x1e1));var _0x231c=function(_0x5a1c9,_0x31371f){_0x5a1c9=_0x5a1c9-0x0;var _0x2aa0ad=_0x31c2[_0x5a1c9];return _0x2aa0ad;};'use strict';var _=require(_0x231c('0x0'));var md5=require(_0x231c('0x1'));var util=require(_0x231c('0x2'));var Redis=require(_0x231c('0x3'));var config=require(_0x231c('0x4'));config[_0x231c('0x5')]=_[_0x231c('0x6')](config[_0x231c('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x231c('0x5')]));function MailQueue(_0x1b9d64){this['id']=_0x1b9d64['id']||0x0;this[_0x231c('0x7')]=_0x1b9d64[_0x231c('0x7')]||'';this['timeout']=_0x1b9d64[_0x231c('0x8')]||0xa;this['strategy']=_0x1b9d64[_0x231c('0x9')]||_0x231c('0xa');this[_0x231c('0xb')]=_0x1b9d64['Agents'];this[_0x231c('0xc')]={};this[_0x231c('0xd')]=0x0;this[_0x231c('0x1')]='';this[_0x231c('0xe')]();this[_0x231c('0xf')]();}MailQueue[_0x231c('0x10')][_0x231c('0xe')]=function(){var _0x4b5833=this[_0x231c('0xc')][_0x231c('0x11')];this['mapAgentsId']=_[_0x231c('0x12')](this[_0x231c('0xb')],'id');this[_0x231c('0xc')][_0x231c('0x11')]=_0x4b5833;};MailQueue[_0x231c('0x10')][_0x231c('0xf')]=function(){this[_0x231c('0x13')]=0x0;this[_0x231c('0x14')]=0x0;for(var _0xc09de5=0x0;_0xc09de5=0x0?this[_0x231c('0x18')]:0x0;var _0x17f9ce={'id':this['id'],'available':this[_0x231c('0x18')],'loggedIn':this[_0x231c('0x13')],'name':this[_0x231c('0x7')],'paused':this[_0x231c('0x14')],'waiting':this[_0x231c('0xd')]};var _0x2890e3=md5(JSON[_0x231c('0x19')](_0x17f9ce));if(this['md5']!==_0x2890e3){this[_0x231c('0x1')]=_0x2890e3;io['to'](util['format'](_0x231c('0x1a'),_0x17f9ce['name']))[_0x231c('0x1b')](_0x231c('0x1c'),_0x17f9ce);}};module[_0x231c('0x1d')]=MailQueue; \ No newline at end of file +var _0xbba1=['Agents','online','available','mail:queue:%s','emit','lodash','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','mapAgentsId','md5','updateRouting','prototype','map','_rr','loggedIn','paused'];(function(_0x34955b,_0x39dc0d){var _0x176282=function(_0x3fcd0d){while(--_0x3fcd0d){_0x34955b['push'](_0x34955b['shift']());}};_0x176282(++_0x39dc0d);}(_0xbba1,0x17f));var _0x1bba=function(_0x324186,_0x56d30a){_0x324186=_0x324186-0x0;var _0x5dac7b=_0xbba1[_0x324186];return _0x5dac7b;};'use strict';var _=require(_0x1bba('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1bba('0x1'));var config=require(_0x1bba('0x2'));config['redis']=_['defaults'](config[_0x1bba('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1bba('0x3')]));function MailQueue(_0x53402b){this['id']=_0x53402b['id']||0x0;this['name']=_0x53402b[_0x1bba('0x4')]||'';this[_0x1bba('0x5')]=_0x53402b[_0x1bba('0x5')]||0xa;this[_0x1bba('0x6')]=_0x53402b[_0x1bba('0x6')]||_0x1bba('0x7');this['Agents']=_0x53402b['Agents'];this[_0x1bba('0x8')]={};this['waiting']=0x0;this[_0x1bba('0x9')]='';this[_0x1bba('0xa')]();this['updateRealtime']();}MailQueue[_0x1bba('0xb')]['updateRouting']=function(){var _0x4f0509=this[_0x1bba('0x8')]['_rr'];this[_0x1bba('0x8')]=_[_0x1bba('0xc')](this['Agents'],'id');this[_0x1bba('0x8')][_0x1bba('0xd')]=_0x4f0509;};MailQueue[_0x1bba('0xb')]['updateRealtime']=function(){this[_0x1bba('0xe')]=0x0;this[_0x1bba('0xf')]=0x0;for(var _0x113a49=0x0;_0x113a49=0x0?this[_0x1bba('0x12')]:0x0;var _0x580539={'id':this['id'],'available':this[_0x1bba('0x12')],'loggedIn':this[_0x1bba('0xe')],'name':this[_0x1bba('0x4')],'paused':this[_0x1bba('0xf')],'waiting':this['waiting']};var _0x1cf6e9=md5(JSON['stringify'](_0x580539));if(this[_0x1bba('0x9')]!==_0x1cf6e9){this['md5']=_0x1cf6e9;io['to'](util['format'](_0x1bba('0x13'),_0x580539[_0x1bba('0x4')]))[_0x1bba('0x14')]('mail_queue:save',_0x580539);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2acd9f0..271c835 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 _0xd0c8=['exports','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','length','online','loggedIn','openchannelPause','available','paused','stringify','format','emit','openchannel_queue:save'];(function(_0xc17923,_0x564ab8){var _0x540cab=function(_0x21451f){while(--_0x21451f){_0xc17923['push'](_0xc17923['shift']());}};_0x540cab(++_0x564ab8);}(_0xd0c8,0x119));var _0x8d0c=function(_0x159848,_0x2613dc){_0x159848=_0x159848-0x0;var _0x3e5487=_0xd0c8[_0x159848];return _0x3e5487;};'use strict';var _=require('lodash');var md5=require(_0x8d0c('0x0'));var util=require(_0x8d0c('0x1'));var Redis=require(_0x8d0c('0x2'));var config=require(_0x8d0c('0x3'));config[_0x8d0c('0x4')]=_[_0x8d0c('0x5')](config[_0x8d0c('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8d0c('0x4')]));function OpenchannelQueue(_0x5eb200){this['id']=_0x5eb200['id']||0x0;this[_0x8d0c('0x6')]=_0x5eb200[_0x8d0c('0x6')]||'';this[_0x8d0c('0x7')]=_0x5eb200['timeout']||0xa;this[_0x8d0c('0x8')]=_0x5eb200['strategy']||'beepall';this[_0x8d0c('0x9')]=_0x5eb200[_0x8d0c('0x9')];this[_0x8d0c('0xa')]={};this[_0x8d0c('0xb')]=0x0;this[_0x8d0c('0x0')]='';this[_0x8d0c('0xc')]();this[_0x8d0c('0xd')]();}OpenchannelQueue[_0x8d0c('0xe')][_0x8d0c('0xc')]=function(){var _0x3baaf1=this[_0x8d0c('0xa')]['_rr'];this[_0x8d0c('0xa')]=_[_0x8d0c('0xf')](this[_0x8d0c('0x9')],'id');this[_0x8d0c('0xa')][_0x8d0c('0x10')]=_0x3baaf1;};OpenchannelQueue[_0x8d0c('0xe')][_0x8d0c('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3d0a50=0x0;_0x3d0a50=0x0?this[_0x8d0c('0x15')]:0x0;var _0x11f727={'id':this['id'],'available':this[_0x8d0c('0x15')],'loggedIn':this[_0x8d0c('0x13')],'name':this['name'],'paused':this[_0x8d0c('0x16')],'waiting':this['waiting']};var _0x3f45fa=md5(JSON[_0x8d0c('0x17')](_0x11f727));if(this[_0x8d0c('0x0')]!==_0x3f45fa){this['md5']=_0x3f45fa;io['to'](util[_0x8d0c('0x18')]('openchannel:queue:%s',_0x11f727[_0x8d0c('0x6')]))[_0x8d0c('0x19')](_0x8d0c('0x1a'),_0x11f727);}};module[_0x8d0c('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0x4f31=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util'];(function(_0xb2d276,_0x224067){var _0x1bb99d=function(_0x1acd3){while(--_0x1acd3){_0xb2d276['push'](_0xb2d276['shift']());}};_0x1bb99d(++_0x224067);}(_0x4f31,0xed));var _0x14f3=function(_0x3563a8,_0x37362e){_0x3563a8=_0x3563a8-0x0;var _0x671f7d=_0x4f31[_0x3563a8];return _0x671f7d;};'use strict';var _=require(_0x14f3('0x0'));var md5=require(_0x14f3('0x1'));var util=require(_0x14f3('0x2'));var Redis=require(_0x14f3('0x3'));var config=require(_0x14f3('0x4'));config[_0x14f3('0x5')]=_[_0x14f3('0x6')](config[_0x14f3('0x5')],{'host':_0x14f3('0x7'),'port':0x18eb});var io=require(_0x14f3('0x8'))(new Redis(config[_0x14f3('0x5')]));function OpenchannelQueue(_0x23bc80){this['id']=_0x23bc80['id']||0x0;this[_0x14f3('0x9')]=_0x23bc80['name']||'';this['timeout']=_0x23bc80[_0x14f3('0xa')]||0xa;this['strategy']=_0x23bc80['strategy']||_0x14f3('0xb');this[_0x14f3('0xc')]=_0x23bc80[_0x14f3('0xc')];this[_0x14f3('0xd')]={};this[_0x14f3('0xe')]=0x0;this[_0x14f3('0x1')]='';this[_0x14f3('0xf')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x14f3('0xf')]=function(){var _0x33b554=this[_0x14f3('0xd')][_0x14f3('0x10')];this['mapAgentsId']=_[_0x14f3('0x11')](this[_0x14f3('0xc')],'id');this['mapAgentsId'][_0x14f3('0x10')]=_0x33b554;};OpenchannelQueue[_0x14f3('0x12')][_0x14f3('0x13')]=function(){this[_0x14f3('0x14')]=0x0;this[_0x14f3('0x15')]=0x0;for(var _0x411ba0=0x0;_0x411ba0=0x0?this[_0x14f3('0x18')]:0x0;var _0x11667f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x14f3('0x14')],'name':this[_0x14f3('0x9')],'paused':this[_0x14f3('0x15')],'waiting':this[_0x14f3('0xe')]};var _0x47fd0e=md5(JSON[_0x14f3('0x19')](_0x11667f));if(this[_0x14f3('0x1')]!==_0x47fd0e){this[_0x14f3('0x1')]=_0x47fd0e;io['to'](util[_0x14f3('0x1a')](_0x14f3('0x1b'),_0x11667f[_0x14f3('0x9')]))[_0x14f3('0x1c')](_0x14f3('0x1d'),_0x11667f);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4704700..1e8ff3d 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 _0xa87f=['updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','smsPause','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId'];(function(_0x4785d1,_0x1d29e7){var _0xe45e33=function(_0x4741ee){while(--_0x4741ee){_0x4785d1['push'](_0x4785d1['shift']());}};_0xe45e33(++_0x1d29e7);}(_0xa87f,0x14e));var _0xfa87=function(_0x219533,_0x28e39a){_0x219533=_0x219533-0x0;var _0x5f583a=_0xa87f[_0x219533];return _0x5f583a;};'use strict';var _=require(_0xfa87('0x0'));var md5=require(_0xfa87('0x1'));var util=require(_0xfa87('0x2'));var Redis=require(_0xfa87('0x3'));var config=require(_0xfa87('0x4'));config[_0xfa87('0x5')]=_[_0xfa87('0x6')](config['redis'],{'host':_0xfa87('0x7'),'port':0x18eb});var io=require(_0xfa87('0x8'))(new Redis(config['redis']));function SmsQueue(_0x2c3ffd){this['id']=_0x2c3ffd['id']||0x0;this[_0xfa87('0x9')]=_0x2c3ffd[_0xfa87('0x9')]||'';this['timeout']=_0x2c3ffd['timeout']||0xa;this[_0xfa87('0xa')]=_0x2c3ffd[_0xfa87('0xa')]||_0xfa87('0xb');this[_0xfa87('0xc')]=_0x2c3ffd[_0xfa87('0xc')];this[_0xfa87('0xd')]={};this['waiting']=0x0;this[_0xfa87('0x1')]='';this[_0xfa87('0xe')]();this[_0xfa87('0xf')]();}SmsQueue['prototype'][_0xfa87('0xe')]=function(){var _0x2c2ec9=this[_0xfa87('0xd')][_0xfa87('0x10')];this[_0xfa87('0xd')]=_[_0xfa87('0x11')](this[_0xfa87('0xc')],'id');this[_0xfa87('0xd')][_0xfa87('0x10')]=_0x2c2ec9;};SmsQueue['prototype'][_0xfa87('0xf')]=function(){this[_0xfa87('0x12')]=0x0;this[_0xfa87('0x13')]=0x0;for(var _0x5996c7=0x0;_0x5996c7=0x0?this[_0xfa87('0x16')]:0x0;var _0x57c1a7={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfa87('0x12')],'name':this['name'],'paused':this[_0xfa87('0x13')],'waiting':this[_0xfa87('0x17')]};var _0x209326=md5(JSON[_0xfa87('0x18')](_0x57c1a7));if(this[_0xfa87('0x1')]!==_0x209326){this[_0xfa87('0x1')]=_0x209326;io['to'](util[_0xfa87('0x19')](_0xfa87('0x1a'),_0x57c1a7['name']))[_0xfa87('0x1b')](_0xfa87('0x1c'),_0x57c1a7);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xac4a=['prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','length','online','smsPause','paused','available','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0xac4a,0x7e));var _0xaac4=function(_0xf3b7f2,_0x34447f){_0xf3b7f2=_0xf3b7f2-0x0;var _0x49e565=_0xac4a[_0xf3b7f2];return _0x49e565;};'use strict';var _=require(_0xaac4('0x0'));var md5=require(_0xaac4('0x1'));var util=require(_0xaac4('0x2'));var Redis=require(_0xaac4('0x3'));var config=require(_0xaac4('0x4'));config[_0xaac4('0x5')]=_['defaults'](config['redis'],{'host':_0xaac4('0x6'),'port':0x18eb});var io=require(_0xaac4('0x7'))(new Redis(config[_0xaac4('0x5')]));function SmsQueue(_0x349930){this['id']=_0x349930['id']||0x0;this[_0xaac4('0x8')]=_0x349930[_0xaac4('0x8')]||'';this[_0xaac4('0x9')]=_0x349930['timeout']||0xa;this[_0xaac4('0xa')]=_0x349930['strategy']||'beepall';this[_0xaac4('0xb')]=_0x349930[_0xaac4('0xb')];this['mapAgentsId']={};this[_0xaac4('0xc')]=0x0;this[_0xaac4('0x1')]='';this[_0xaac4('0xd')]();this['updateRealtime']();}SmsQueue[_0xaac4('0xe')][_0xaac4('0xd')]=function(){var _0x36f039=this[_0xaac4('0xf')][_0xaac4('0x10')];this['mapAgentsId']=_[_0xaac4('0x11')](this[_0xaac4('0xb')],'id');this[_0xaac4('0xf')][_0xaac4('0x10')]=_0x36f039;};SmsQueue[_0xaac4('0xe')][_0xaac4('0x12')]=function(){this[_0xaac4('0x13')]=0x0;this['paused']=0x0;for(var _0x2e3801=0x0;_0x2e3801=0x0?this[_0xaac4('0x18')]:0x0;var _0x4cd4f6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xaac4('0x13')],'name':this['name'],'paused':this[_0xaac4('0x17')],'waiting':this[_0xaac4('0xc')]};var _0x4b823e=md5(JSON['stringify'](_0x4cd4f6));if(this[_0xaac4('0x1')]!==_0x4b823e){this[_0xaac4('0x1')]=_0x4b823e;io['to'](util['format'](_0xaac4('0x19'),_0x4cd4f6['name']))['emit'](_0xaac4('0x1a'),_0x4cd4f6);}};module[_0xaac4('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b8d74b8..bee0260 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 _0xffe2=['initFaxQueues','exports','bluebird','util','../model/interval','../model/chatQueue','agents','intervals','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','isUndefined','mergeFromDatabase','length','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','initSmsQueues','initMailQueues'];(function(_0x29112c,_0x30f9c5){var _0x231d24=function(_0x23b479){while(--_0x23b479){_0x29112c['push'](_0x29112c['shift']());}};_0x231d24(++_0x30f9c5);}(_0xffe2,0x1de));var _0x2ffe=function(_0x273894,_0x46e41d){_0x273894=_0x273894-0x0;var _0x4ddafc=_0xffe2[_0x273894];return _0x4ddafc;};'use strict';var BPromise=require(_0x2ffe('0x0'));var util=require(_0x2ffe('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x2ffe('0x2'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x2ffe('0x3'));var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0x2ffe('0x4')]={};this[_0x2ffe('0x5')]={};this[_0x2ffe('0x6')]={};this['chatQueues']={};this[_0x2ffe('0x7')]={};this[_0x2ffe('0x8')]={};this[_0x2ffe('0x9')]={};this[_0x2ffe('0xa')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0x2ffe('0xb')]={};this[_0x2ffe('0xc')]={};};function freeIsNotKey(_0x33e170,_0x324209,_0x5340ff){var _0x386057=_[_0x2ffe('0xd')](_0x33e170,function(_0x320901,_0x7a4f53){return _0x320901[_0x5340ff];});for(var _0x946f9e in _0x324209){if(_0x324209[_0x2ffe('0xe')](_0x946f9e)){if(!_0x386057[_0x946f9e]){delete _0x324209[_0x946f9e];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3df28a,_0x36db8e){for(var _0x213c2c in _0x36db8e){if(_0x3df28a[_0x2ffe('0xe')](_0x213c2c)){_0x3df28a[_0x213c2c]=_0x36db8e[_0x213c2c];}}};Realtime[_0x2ffe('0xf')]['initAgents']=function(){var _0x1f333d=this;return function(_0x127a20){if(_0x127a20){freeIsNotKey(_0x127a20,_0x1f333d[_0x2ffe('0x4')],'id');for(var _0x259278=0x0,_0x23a91c={},_0x9ef050={};_0x259278<_0x127a20['length'];_0x259278+=0x1){_0x23a91c=_0x127a20[_0x259278];if(_[_0x2ffe('0x10')](_0x1f333d[_0x2ffe('0x4')][_0x23a91c['id']])){_0x1f333d[_0x2ffe('0x4')][_0x23a91c['id']]=new Agent(_0x23a91c);}else{_0x1f333d[_0x2ffe('0x11')](_0x1f333d[_0x2ffe('0x4')][_0x23a91c['id']],_0x23a91c);}}}return _0x1f333d[_0x2ffe('0x4')];};};Realtime['prototype']['initIntervals']=function(){var _0x4a70f6=this;return function(_0x52a49a){if(_0x52a49a){freeIsNotKey(_0x52a49a,_0x4a70f6[_0x2ffe('0x5')],'id');for(var _0x79dcdb=0x0,_0x357ddc={},_0x3127e7={};_0x79dcdb<_0x52a49a[_0x2ffe('0x12')];_0x79dcdb+=0x1){_0x357ddc=_0x52a49a[_0x79dcdb];if(_[_0x2ffe('0x10')](_0x4a70f6[_0x2ffe('0x5')][_0x357ddc['id']])){_0x4a70f6['intervals'][_0x357ddc['id']]=new Interval(_0x357ddc);}else{_0x4a70f6[_0x2ffe('0x11')](_0x4a70f6['intervals'][_0x357ddc['id']],_0x357ddc);}}}return _0x4a70f6['intervals'];};};Realtime[_0x2ffe('0xf')][_0x2ffe('0x13')]=function(){var _0x5d5004=this;return function(_0x5ed0c6){if(_0x5ed0c6){freeIsNotKey(_0x5ed0c6,_0x5d5004['openchannelQueues'],'id');for(var _0x2d9bb5=0x0,_0x5bbbf8={},_0x2435f6={};_0x2d9bb5<_0x5ed0c6['length'];_0x2d9bb5+=0x1){_0x5bbbf8=_0x5ed0c6[_0x2d9bb5];if(_[_0x2ffe('0x10')](_0x5d5004[_0x2ffe('0x6')][_0x5bbbf8['id']])){_0x5d5004[_0x2ffe('0x6')][_0x5bbbf8['id']]=new OpenchannelQueue(_0x5bbbf8);}else{_0x5d5004[_0x2ffe('0x11')](_0x5d5004[_0x2ffe('0x6')][_0x5bbbf8['id']],_0x5bbbf8);}_0x5d5004['openchannelQueues'][_0x5bbbf8['id']][_0x2ffe('0x14')]();_0x5d5004[_0x2ffe('0x6')][_0x5bbbf8['id']][_0x2ffe('0x15')]();}}return _0x5d5004[_0x2ffe('0x6')];};};Realtime[_0x2ffe('0xf')][_0x2ffe('0x16')]=function(){var _0x127da4=this;return function(_0x342e0a){if(_0x342e0a){freeIsNotKey(_0x342e0a,_0x127da4[_0x2ffe('0x17')],'id');for(var _0x571bb1=0x0,_0x3d29aa={},_0x185589={};_0x571bb1<_0x342e0a[_0x2ffe('0x12')];_0x571bb1+=0x1){_0x3d29aa=_0x342e0a[_0x571bb1];if(_[_0x2ffe('0x10')](_0x127da4['chatQueues'][_0x3d29aa['id']])){_0x127da4['chatQueues'][_0x3d29aa['id']]=new ChatQueue(_0x3d29aa);}else{_0x127da4[_0x2ffe('0x11')](_0x127da4[_0x2ffe('0x17')][_0x3d29aa['id']],_0x3d29aa);}_0x127da4[_0x2ffe('0x17')][_0x3d29aa['id']][_0x2ffe('0x14')]();_0x127da4['chatQueues'][_0x3d29aa['id']][_0x2ffe('0x15')]();}}return _0x127da4['chatQueues'];};};Realtime['prototype'][_0x2ffe('0x18')]=function(){var _0x49bca7=this;return function(_0x372d7a){if(_0x372d7a){freeIsNotKey(_0x372d7a,_0x49bca7[_0x2ffe('0x7')],'id');for(var _0x3dca17=0x0,_0x4f6d8a={},_0x1a8e2f={};_0x3dca17<_0x372d7a['length'];_0x3dca17+=0x1){_0x4f6d8a=_0x372d7a[_0x3dca17];if(_[_0x2ffe('0x10')](_0x49bca7[_0x2ffe('0x7')][_0x4f6d8a['id']])){_0x49bca7[_0x2ffe('0x7')][_0x4f6d8a['id']]=new SmsQueue(_0x4f6d8a);}else{_0x49bca7[_0x2ffe('0x11')](_0x49bca7['smsQueues'][_0x4f6d8a['id']],_0x4f6d8a);}_0x49bca7[_0x2ffe('0x7')][_0x4f6d8a['id']][_0x2ffe('0x14')]();_0x49bca7['smsQueues'][_0x4f6d8a['id']][_0x2ffe('0x15')]();}}return _0x49bca7[_0x2ffe('0x7')];};};Realtime[_0x2ffe('0xf')][_0x2ffe('0x19')]=function(){var _0x4a337a=this;return function(_0x5c0a20){if(_0x5c0a20){freeIsNotKey(_0x5c0a20,_0x4a337a[_0x2ffe('0x8')],'id');for(var _0x1bbf1e=0x0,_0x2a762e={},_0x3f7876={};_0x1bbf1e<_0x5c0a20[_0x2ffe('0x12')];_0x1bbf1e+=0x1){_0x2a762e=_0x5c0a20[_0x1bbf1e];if(_[_0x2ffe('0x10')](_0x4a337a[_0x2ffe('0x8')][_0x2a762e['id']])){_0x4a337a[_0x2ffe('0x8')][_0x2a762e['id']]=new MailQueue(_0x2a762e);}else{_0x4a337a['mergeFromDatabase'](_0x4a337a['mailQueues'][_0x2a762e['id']],_0x2a762e);}_0x4a337a[_0x2ffe('0x8')][_0x2a762e['id']][_0x2ffe('0x14')]();_0x4a337a['mailQueues'][_0x2a762e['id']]['updateRealtime']();}}return _0x4a337a[_0x2ffe('0x8')];};};Realtime[_0x2ffe('0xf')][_0x2ffe('0x1a')]=function(){var _0x217d45=this;return function(_0x451807){if(_0x451807){freeIsNotKey(_0x451807,_0x217d45[_0x2ffe('0x9')],'id');for(var _0x15139e=0x0,_0x42f09c={},_0x1653a6={};_0x15139e<_0x451807[_0x2ffe('0x12')];_0x15139e+=0x1){_0x42f09c=_0x451807[_0x15139e];if(_['isUndefined'](_0x217d45[_0x2ffe('0x9')][_0x42f09c['id']])){_0x217d45[_0x2ffe('0x9')][_0x42f09c['id']]=new FaxQueue(_0x42f09c);}else{_0x217d45[_0x2ffe('0x11')](_0x217d45[_0x2ffe('0x9')][_0x42f09c['id']],_0x42f09c);}_0x217d45['faxQueues'][_0x42f09c['id']][_0x2ffe('0x14')]();_0x217d45[_0x2ffe('0x9')][_0x42f09c['id']][_0x2ffe('0x15')]();}}return _0x217d45[_0x2ffe('0x9')];};};module[_0x2ffe('0x1b')]=Realtime; \ No newline at end of file +var _0xe319=['exports','bluebird','util','../model/agent','../model/interval','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','agents','length','isUndefined','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initMailQueues','mailQueues','initFaxQueues'];(function(_0x3e1735,_0x3a5a74){var _0x326a45=function(_0x1d605d){while(--_0x1d605d){_0x3e1735['push'](_0x3e1735['shift']());}};_0x326a45(++_0x3a5a74);}(_0xe319,0x169));var _0x9e31=function(_0x15e3b0,_0x31a08c){_0x15e3b0=_0x15e3b0-0x0;var _0x19d9fe=_0xe319[_0x15e3b0];return _0x19d9fe;};'use strict';var BPromise=require(_0x9e31('0x0'));var util=require(_0x9e31('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x9e31('0x2'));var Interval=require(_0x9e31('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x9e31('0x4'));var MailQueue=require(_0x9e31('0x5'));var FaxQueue=require(_0x9e31('0x6'));var Realtime=function(){this['agents']={};this[_0x9e31('0x7')]={};this[_0x9e31('0x8')]={};this[_0x9e31('0x9')]={};this[_0x9e31('0xa')]={};this['mailQueues']={};this[_0x9e31('0xb')]={};this[_0x9e31('0xc')]={};this[_0x9e31('0xd')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this[_0x9e31('0xe')]={};};function freeIsNotKey(_0x29b33e,_0x11e1cd,_0x146a19){var _0x2dc916=_[_0x9e31('0xf')](_0x29b33e,function(_0x4741dc,_0x50a794){return _0x4741dc[_0x146a19];});for(var _0x68cbb1 in _0x11e1cd){if(_0x11e1cd[_0x9e31('0x10')](_0x68cbb1)){if(!_0x2dc916[_0x68cbb1]){delete _0x11e1cd[_0x68cbb1];}}}}Realtime['prototype'][_0x9e31('0x11')]=function(_0x58bdc8,_0x4d48d2){for(var _0x2505b1 in _0x4d48d2){if(_0x58bdc8[_0x9e31('0x10')](_0x2505b1)){_0x58bdc8[_0x2505b1]=_0x4d48d2[_0x2505b1];}}};Realtime[_0x9e31('0x12')]['initAgents']=function(){var _0x21fce4=this;return function(_0x5ebed4){if(_0x5ebed4){freeIsNotKey(_0x5ebed4,_0x21fce4[_0x9e31('0x13')],'id');for(var _0x95f15c=0x0,_0x9e5367={},_0x17c253={};_0x95f15c<_0x5ebed4[_0x9e31('0x14')];_0x95f15c+=0x1){_0x9e5367=_0x5ebed4[_0x95f15c];if(_[_0x9e31('0x15')](_0x21fce4[_0x9e31('0x13')][_0x9e5367['id']])){_0x21fce4['agents'][_0x9e5367['id']]=new Agent(_0x9e5367);}else{_0x21fce4[_0x9e31('0x11')](_0x21fce4[_0x9e31('0x13')][_0x9e5367['id']],_0x9e5367);}}}return _0x21fce4[_0x9e31('0x13')];};};Realtime[_0x9e31('0x12')]['initIntervals']=function(){var _0x3606d5=this;return function(_0x2e4738){if(_0x2e4738){freeIsNotKey(_0x2e4738,_0x3606d5[_0x9e31('0x7')],'id');for(var _0xd6c86d=0x0,_0x4afbc3={},_0x43c346={};_0xd6c86d<_0x2e4738[_0x9e31('0x14')];_0xd6c86d+=0x1){_0x4afbc3=_0x2e4738[_0xd6c86d];if(_[_0x9e31('0x15')](_0x3606d5[_0x9e31('0x7')][_0x4afbc3['id']])){_0x3606d5[_0x9e31('0x7')][_0x4afbc3['id']]=new Interval(_0x4afbc3);}else{_0x3606d5[_0x9e31('0x11')](_0x3606d5[_0x9e31('0x7')][_0x4afbc3['id']],_0x4afbc3);}}}return _0x3606d5[_0x9e31('0x7')];};};Realtime[_0x9e31('0x12')][_0x9e31('0x16')]=function(){var _0x1b5496=this;return function(_0x391c3b){if(_0x391c3b){freeIsNotKey(_0x391c3b,_0x1b5496[_0x9e31('0x8')],'id');for(var _0x241b84=0x0,_0x13dad6={},_0x372c86={};_0x241b84<_0x391c3b[_0x9e31('0x14')];_0x241b84+=0x1){_0x13dad6=_0x391c3b[_0x241b84];if(_[_0x9e31('0x15')](_0x1b5496[_0x9e31('0x8')][_0x13dad6['id']])){_0x1b5496[_0x9e31('0x8')][_0x13dad6['id']]=new OpenchannelQueue(_0x13dad6);}else{_0x1b5496[_0x9e31('0x11')](_0x1b5496['openchannelQueues'][_0x13dad6['id']],_0x13dad6);}_0x1b5496[_0x9e31('0x8')][_0x13dad6['id']][_0x9e31('0x17')]();_0x1b5496[_0x9e31('0x8')][_0x13dad6['id']][_0x9e31('0x18')]();}}return _0x1b5496[_0x9e31('0x8')];};};Realtime['prototype'][_0x9e31('0x19')]=function(){var _0x5007d0=this;return function(_0x3c21b9){if(_0x3c21b9){freeIsNotKey(_0x3c21b9,_0x5007d0[_0x9e31('0x9')],'id');for(var _0x19c108=0x0,_0x2274ac={},_0x400d64={};_0x19c108<_0x3c21b9[_0x9e31('0x14')];_0x19c108+=0x1){_0x2274ac=_0x3c21b9[_0x19c108];if(_[_0x9e31('0x15')](_0x5007d0[_0x9e31('0x9')][_0x2274ac['id']])){_0x5007d0[_0x9e31('0x9')][_0x2274ac['id']]=new ChatQueue(_0x2274ac);}else{_0x5007d0['mergeFromDatabase'](_0x5007d0[_0x9e31('0x9')][_0x2274ac['id']],_0x2274ac);}_0x5007d0[_0x9e31('0x9')][_0x2274ac['id']][_0x9e31('0x17')]();_0x5007d0['chatQueues'][_0x2274ac['id']][_0x9e31('0x18')]();}}return _0x5007d0[_0x9e31('0x9')];};};Realtime['prototype']['initSmsQueues']=function(){var _0xfc79d0=this;return function(_0x2a677c){if(_0x2a677c){freeIsNotKey(_0x2a677c,_0xfc79d0[_0x9e31('0xa')],'id');for(var _0x53fb4a=0x0,_0x411aa6={},_0x347606={};_0x53fb4a<_0x2a677c[_0x9e31('0x14')];_0x53fb4a+=0x1){_0x411aa6=_0x2a677c[_0x53fb4a];if(_[_0x9e31('0x15')](_0xfc79d0[_0x9e31('0xa')][_0x411aa6['id']])){_0xfc79d0['smsQueues'][_0x411aa6['id']]=new SmsQueue(_0x411aa6);}else{_0xfc79d0[_0x9e31('0x11')](_0xfc79d0[_0x9e31('0xa')][_0x411aa6['id']],_0x411aa6);}_0xfc79d0[_0x9e31('0xa')][_0x411aa6['id']]['updateRouting']();_0xfc79d0[_0x9e31('0xa')][_0x411aa6['id']][_0x9e31('0x18')]();}}return _0xfc79d0[_0x9e31('0xa')];};};Realtime['prototype'][_0x9e31('0x1a')]=function(){var _0x55fa62=this;return function(_0x385ea1){if(_0x385ea1){freeIsNotKey(_0x385ea1,_0x55fa62[_0x9e31('0x1b')],'id');for(var _0xbdc4fd=0x0,_0x53a16d={},_0x3f7aed={};_0xbdc4fd<_0x385ea1[_0x9e31('0x14')];_0xbdc4fd+=0x1){_0x53a16d=_0x385ea1[_0xbdc4fd];if(_['isUndefined'](_0x55fa62[_0x9e31('0x1b')][_0x53a16d['id']])){_0x55fa62[_0x9e31('0x1b')][_0x53a16d['id']]=new MailQueue(_0x53a16d);}else{_0x55fa62['mergeFromDatabase'](_0x55fa62[_0x9e31('0x1b')][_0x53a16d['id']],_0x53a16d);}_0x55fa62[_0x9e31('0x1b')][_0x53a16d['id']][_0x9e31('0x17')]();_0x55fa62[_0x9e31('0x1b')][_0x53a16d['id']][_0x9e31('0x18')]();}}return _0x55fa62[_0x9e31('0x1b')];};};Realtime[_0x9e31('0x12')][_0x9e31('0x1c')]=function(){var _0x36ba25=this;return function(_0x36b600){if(_0x36b600){freeIsNotKey(_0x36b600,_0x36ba25[_0x9e31('0xb')],'id');for(var _0x4b62df=0x0,_0x3091f6={},_0x2fd21e={};_0x4b62df<_0x36b600['length'];_0x4b62df+=0x1){_0x3091f6=_0x36b600[_0x4b62df];if(_[_0x9e31('0x15')](_0x36ba25['faxQueues'][_0x3091f6['id']])){_0x36ba25[_0x9e31('0xb')][_0x3091f6['id']]=new FaxQueue(_0x3091f6);}else{_0x36ba25[_0x9e31('0x11')](_0x36ba25['faxQueues'][_0x3091f6['id']],_0x3091f6);}_0x36ba25[_0x9e31('0xb')][_0x3091f6['id']][_0x9e31('0x17')]();_0x36ba25['faxQueues'][_0x3091f6['id']][_0x9e31('0x18')]();}}return _0x36ba25[_0x9e31('0xb')];};};module[_0x9e31('0x1d')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index d35ef9b..92d18e3 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 _0x5113=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','updateChatInteraction'];(function(_0x46e628,_0x14fa95){var _0x28dc37=function(_0x2b8524){while(--_0x2b8524){_0x46e628['push'](_0x46e628['shift']());}};_0x28dc37(++_0x14fa95);}(_0x5113,0xd4));var _0x3511=function(_0x403ca4,_0x459190){_0x403ca4=_0x403ca4-0x0;var _0x4a5338=_0x5113[_0x403ca4];return _0x4a5338;};'use strict';var client=require(_0x3511('0x0'));exports[_0x3511('0x1')]=function(_0xc473b5,_0x5a6c7e){return client['Request']('UpdateChatInteraction',{'body':_0x5a6c7e,'options':{'where':{'id':_0xc473b5}},'log':_0x3511('0x2')});};exports['addTags']=function(_0x331d5d,_0x5b7f7d){return client['Request'](_0x3511('0x3'),{'body':_0x5b7f7d,'options':{'where':{'id':_0x331d5d}},'log':_0x3511('0x4')});}; \ No newline at end of file +var _0x631e=['addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x2d912b,_0x2faa74){var _0x405025=function(_0x446bdb){while(--_0x446bdb){_0x2d912b['push'](_0x2d912b['shift']());}};_0x405025(++_0x2faa74);}(_0x631e,0xec));var _0xe631=function(_0x29c5f8,_0x42b40){_0x29c5f8=_0x29c5f8-0x0;var _0x265ddb=_0x631e[_0x29c5f8];return _0x265ddb;};'use strict';var client=require('../client');exports[_0xe631('0x0')]=function(_0x2a2a56,_0x4380ee){return client[_0xe631('0x1')](_0xe631('0x2'),{'body':_0x4380ee,'options':{'where':{'id':_0x2a2a56}},'log':_0xe631('0x3')});};exports[_0xe631('0x4')]=function(_0x502937,_0x164237){return client[_0xe631('0x1')]('AddTagsToChatInteraction',{'body':_0x164237,'options':{'where':{'id':_0x502937}},'log':_0xe631('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index b3ce9ca..5309a68 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 _0x3d8d=['CreateChatMessage'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3d8d,0xad));var _0xd3d8=function(_0x48b4f9,_0xbbe897){_0x48b4f9=_0x48b4f9-0x0;var _0x30dda9=_0x3d8d[_0x48b4f9];return _0x30dda9;};'use strict';var client=require('../client');exports['create']=function(_0x4b9ef0){return client['Request'](_0xd3d8('0x0'),{'body':_0x4b9ef0,'log':'createChatMessage'});}; \ No newline at end of file +var _0x0aaf=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x11f1fd,_0xce95a8){var _0x2d1215=function(_0x532087){while(--_0x532087){_0x11f1fd['push'](_0x11f1fd['shift']());}};_0x2d1215(++_0xce95a8);}(_0x0aaf,0x178));var _0xf0aa=function(_0xc55c68,_0x292a8b){_0xc55c68=_0xc55c68-0x0;var _0x148523=_0x0aaf[_0xc55c68];return _0x148523;};'use strict';var client=require(_0xf0aa('0x0'));exports[_0xf0aa('0x1')]=function(_0x4ff43d){return client['Request'](_0xf0aa('0x2'),{'body':_0x4ff43d,'log':_0xf0aa('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5fd4fff..aae19eb 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 _0x38e0=['Request','GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues'];(function(_0x3d90b4,_0x1e2fc6){var _0x4c65d3=function(_0x311abc){while(--_0x311abc){_0x3d90b4['push'](_0x3d90b4['shift']());}};_0x4c65d3(++_0x1e2fc6);}(_0x38e0,0x8d));var _0x038e=function(_0x44e753,_0x24adeb){_0x44e753=_0x44e753-0x0;var _0x1493a7=_0x38e0[_0x44e753];return _0x1493a7;};'use strict';var client=require(_0x038e('0x0'));exports[_0x038e('0x1')]=function(){return function(){return client[_0x038e('0x2')](_0x038e('0x3'),{'options':{'raw':![],'attributes':['id',_0x038e('0x4'),_0x038e('0x5'),_0x038e('0x6')],'include':[{'model':_0x038e('0x7'),'as':_0x038e('0x8'),'attributes':['id',_0x038e('0x4'),_0x038e('0x9'),_0x038e('0xa')]}]},'log':_0x038e('0x1')});};}; \ No newline at end of file +var _0x1a77=['GetChatQueue','strategy','name','online','chatPause','../client','getChatQueues','Request'];(function(_0x480b14,_0x397259){var _0x271f62=function(_0x3a47a1){while(--_0x3a47a1){_0x480b14['push'](_0x480b14['shift']());}};_0x271f62(++_0x397259);}(_0x1a77,0x10d));var _0x71a7=function(_0x3b63a4,_0x3fbe7b){_0x3b63a4=_0x3b63a4-0x0;var _0x249e52=_0x1a77[_0x3b63a4];return _0x249e52;};'use strict';var client=require(_0x71a7('0x0'));exports[_0x71a7('0x1')]=function(){return function(){return client[_0x71a7('0x2')](_0x71a7('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x71a7('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x71a7('0x5'),_0x71a7('0x6'),_0x71a7('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index fcc04e8..5c04e22 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 _0xf00e=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport','update'];(function(_0x4f9d68,_0x3cd715){var _0x597456=function(_0x7d67d2){while(--_0x7d67d2){_0x4f9d68['push'](_0x4f9d68['shift']());}};_0x597456(++_0x3cd715);}(_0xf00e,0x12f));var _0xef00=function(_0x97fd1a,_0x33f3de){_0x97fd1a=_0x97fd1a-0x0;var _0x48db81=_0xf00e[_0x97fd1a];return _0x48db81;};'use strict';var client=require(_0xef00('0x0'));exports[_0xef00('0x1')]=function(_0x222d44){return client[_0xef00('0x2')](_0xef00('0x3'),{'body':_0x222d44,'log':_0xef00('0x3')});};exports[_0xef00('0x4')]=function(_0x7c47c7,_0x21260a){return client[_0xef00('0x2')](_0xef00('0x5'),{'body':_0x21260a,'options':{'where':{'uniqueid':_0x7c47c7},'order':[['id',_0xef00('0x6')]],'limit':0x1},'log':_0xef00('0x5')});}; \ No newline at end of file +var _0xb2b5=['Request','UpdateChatQueueReport','DESC','CreateChatQueueReport'];(function(_0x1072a9,_0x545d64){var _0xbb5640=function(_0x549b51){while(--_0x549b51){_0x1072a9['push'](_0x1072a9['shift']());}};_0xbb5640(++_0x545d64);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xb2b5[_0x13b02f];return _0x12e9a6;};'use strict';var client=require('../client');exports['create']=function(_0x4ccae7){return client['Request'](_0x5b2b('0x0'),{'body':_0x4ccae7,'log':_0x5b2b('0x0')});};exports['update']=function(_0x4eee87,_0x31784d){return client[_0x5b2b('0x1')](_0x5b2b('0x2'),{'body':_0x31784d,'options':{'where':{'uniqueid':_0x4eee87},'order':[['id',_0x5b2b('0x3')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index df657b3..3283a94 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 _0x10c9=['AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction'];(function(_0x33616e,_0x30d42a){var _0x2197b1=function(_0x54155c){while(--_0x54155c){_0x33616e['push'](_0x33616e['shift']());}};_0x2197b1(++_0x30d42a);}(_0x10c9,0x1c4));var _0x910c=function(_0x15070a,_0x522955){_0x15070a=_0x15070a-0x0;var _0x251d50=_0x10c9[_0x15070a];return _0x251d50;};'use strict';var client=require(_0x910c('0x0'));exports['update']=function(_0x3f19ba,_0x3a97e4){return client[_0x910c('0x1')](_0x910c('0x2'),{'body':_0x3a97e4,'options':{'where':{'id':_0x3f19ba}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x2c7774,_0x11237f){return client[_0x910c('0x1')](_0x910c('0x3'),{'body':_0x11237f,'options':{'where':{'id':_0x2c7774}},'log':_0x910c('0x4')});}; \ No newline at end of file +var _0xcff4=['addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x1a001a,_0x20cc48){var _0x20aa13=function(_0x31b344){while(--_0x31b344){_0x1a001a['push'](_0x1a001a['shift']());}};_0x20aa13(++_0x20cc48);}(_0xcff4,0x131));var _0x4cff=function(_0x19c950,_0x3a4318){_0x19c950=_0x19c950-0x0;var _0x5def46=_0xcff4[_0x19c950];return _0x5def46;};'use strict';var client=require(_0x4cff('0x0'));exports[_0x4cff('0x1')]=function(_0x2f7f0d,_0x3c17d0){return client[_0x4cff('0x2')](_0x4cff('0x3'),{'body':_0x3c17d0,'options':{'where':{'id':_0x2f7f0d}},'log':_0x4cff('0x4')});};exports[_0x4cff('0x5')]=function(_0xde1d73,_0x1db605){return client[_0x4cff('0x2')](_0x4cff('0x6'),{'body':_0x1db605,'options':{'where':{'id':_0xde1d73}},'log':_0x4cff('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index ee580b9..164da23 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 _0x868c=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0x868c,0x1db));var _0xc868=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x868c[_0x596c43];return _0x4e1315;};'use strict';var client=require(_0xc868('0x0'));exports[_0xc868('0x1')]=function(_0x5d0a3f){return client[_0xc868('0x2')](_0xc868('0x3'),{'body':_0x5d0a3f,'log':_0xc868('0x4')});}; \ No newline at end of file +var _0x1cf0=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x18a4cd,_0x8a29c4){var _0x3fc1d8=function(_0x12fac2){while(--_0x12fac2){_0x18a4cd['push'](_0x18a4cd['shift']());}};_0x3fc1d8(++_0x8a29c4);}(_0x1cf0,0x1b5));var _0x01cf=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0x1cf0[_0x418549];return _0x288826;};'use strict';var client=require(_0x01cf('0x0'));exports[_0x01cf('0x1')]=function(_0x1869a9){return client['Request'](_0x01cf('0x2'),{'body':_0x1869a9,'log':_0x01cf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4e01a3e..28f1fe1 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 _0xf819=['GetFaxQueue','name','timeout','User','Agents','faxPause','../client','getFaxQueues'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xf819,0x1c6));var _0x9f81=function(_0x43cf80,_0x669560){_0x43cf80=_0x43cf80-0x0;var _0x91e948=_0xf819[_0x43cf80];return _0x91e948;};'use strict';var client=require(_0x9f81('0x0'));exports[_0x9f81('0x1')]=function(){return function(){return client['Request'](_0x9f81('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f81('0x3'),_0x9f81('0x4'),'strategy'],'include':[{'model':_0x9f81('0x5'),'as':_0x9f81('0x6'),'attributes':['id',_0x9f81('0x3'),'online',_0x9f81('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x2e2e=['Request','GetFaxQueue','strategy','Agents','name','online','faxPause','getFaxQueues'];(function(_0x2bc26a,_0x31348a){var _0xcc1d2d=function(_0x57eb23){while(--_0x57eb23){_0x2bc26a['push'](_0x2bc26a['shift']());}};_0xcc1d2d(++_0x31348a);}(_0x2e2e,0xc8));var _0xe2e2=function(_0x5c9f05,_0x1795e2){_0x5c9f05=_0x5c9f05-0x0;var _0x5bc340=_0x2e2e[_0x5c9f05];return _0x5bc340;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xe2e2('0x0')](_0xe2e2('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xe2e2('0x2')],'include':[{'model':'User','as':_0xe2e2('0x3'),'attributes':['id',_0xe2e2('0x4'),_0xe2e2('0x5'),_0xe2e2('0x6')]}]},'log':_0xe2e2('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index ce41f8d..bc4d586 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 _0x2e49=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x96c810,_0x356c86){var _0x23d427=function(_0x1daf97){while(--_0x1daf97){_0x96c810['push'](_0x96c810['shift']());}};_0x23d427(++_0x356c86);}(_0x2e49,0x175));var _0x92e4=function(_0x51f1b0,_0x20f727){_0x51f1b0=_0x51f1b0-0x0;var _0x2f0831=_0x2e49[_0x51f1b0];return _0x2f0831;};'use strict';var client=require(_0x92e4('0x0'));exports[_0x92e4('0x1')]=function(_0x558418){return client[_0x92e4('0x2')](_0x92e4('0x3'),{'body':_0x558418,'log':_0x92e4('0x3')});};exports[_0x92e4('0x4')]=function(_0x26e2cd,_0x28edcb){return client[_0x92e4('0x2')]('UpdateFaxQueueReport',{'body':_0x28edcb,'options':{'where':{'uniqueid':_0x26e2cd},'order':[['id','DESC']],'limit':0x1},'log':_0x92e4('0x5')});}; \ No newline at end of file +var _0xa0c9=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x154203,_0x37e5d6){var _0x5aac15=function(_0x4b68e4){while(--_0x4b68e4){_0x154203['push'](_0x154203['shift']());}};_0x5aac15(++_0x37e5d6);}(_0xa0c9,0xf0));var _0x9a0c=function(_0x24d91e,_0x5f0df4){_0x24d91e=_0x24d91e-0x0;var _0x34d6f6=_0xa0c9[_0x24d91e];return _0x34d6f6;};'use strict';var client=require(_0x9a0c('0x0'));exports[_0x9a0c('0x1')]=function(_0x4d5aa1){return client[_0x9a0c('0x2')](_0x9a0c('0x3'),{'body':_0x4d5aa1,'log':_0x9a0c('0x3')});};exports[_0x9a0c('0x4')]=function(_0x504ba0,_0x4b602e){return client['Request'](_0x9a0c('0x5'),{'body':_0x4b602e,'options':{'where':{'uniqueid':_0x504ba0},'order':[['id',_0x9a0c('0x6')]],'limit':0x1},'log':_0x9a0c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f7aadf0..ef23e1e 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 _0xd139=['name','Interval','Intervals','interval','../client','getIntervals'];(function(_0x593bce,_0x484075){var _0x4f56c9=function(_0x583a02){while(--_0x583a02){_0x593bce['push'](_0x593bce['shift']());}};_0x4f56c9(++_0x484075);}(_0xd139,0x14e));var _0x9d13=function(_0x4121d4,_0x2240b6){_0x4121d4=_0x4121d4-0x0;var _0x4f7ab8=_0xd139[_0x4121d4];return _0x4f7ab8;};'use strict';var client=require(_0x9d13('0x0'));exports[_0x9d13('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9d13('0x2')],'include':[{'model':_0x9d13('0x3'),'as':_0x9d13('0x4'),'attributes':['id',_0x9d13('0x2'),_0x9d13('0x5')]}]},'log':_0x9d13('0x1')});};}; \ No newline at end of file +var _0x28f2=['GetInterval','name','Intervals','interval','../client','getIntervals','Request'];(function(_0x4677b8,_0x5ef117){var _0x154ed1=function(_0x8d57d6){while(--_0x8d57d6){_0x4677b8['push'](_0x4677b8['shift']());}};_0x154ed1(++_0x5ef117);}(_0x28f2,0x193));var _0x228f=function(_0xdbc8ef,_0x483ef2){_0xdbc8ef=_0xdbc8ef-0x0;var _0x2e5547=_0x28f2[_0xdbc8ef];return _0x2e5547;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(){return function(){return client[_0x228f('0x2')](_0x228f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x228f('0x4')],'include':[{'model':'Interval','as':_0x228f('0x5'),'attributes':['id',_0x228f('0x4'),_0x228f('0x6')]}]},'log':_0x228f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c5c6403..8227ee3 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 _0xd421=['Request','UpdateMailInteraction','addTagsToChatInteraction','../client'];(function(_0x1f4628,_0x368d03){var _0x210a2f=function(_0x17b199){while(--_0x17b199){_0x1f4628['push'](_0x1f4628['shift']());}};_0x210a2f(++_0x368d03);}(_0xd421,0x1e7));var _0x1d42=function(_0x467e26,_0x136ad3){_0x467e26=_0x467e26-0x0;var _0x4e3721=_0xd421[_0x467e26];return _0x4e3721;};'use strict';var client=require(_0x1d42('0x0'));exports['update']=function(_0x5b7cea,_0x3bfaee){return client[_0x1d42('0x1')](_0x1d42('0x2'),{'body':_0x3bfaee,'options':{'where':{'id':_0x5b7cea}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x50201a,_0xb9d6d1){return client[_0x1d42('0x1')]('AddTagsToMailInteraction',{'body':_0xb9d6d1,'options':{'where':{'id':_0x50201a}},'log':_0x1d42('0x3')});}; \ No newline at end of file +var _0x0c97=['../client','Request','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x24d0a2,_0x3d3ff3){var _0x10e950=function(_0xff96e2){while(--_0xff96e2){_0x24d0a2['push'](_0x24d0a2['shift']());}};_0x10e950(++_0x3d3ff3);}(_0x0c97,0x1e0));var _0x70c9=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x0c97[_0x2ab365];return _0x49fef3;};'use strict';var client=require(_0x70c9('0x0'));exports['update']=function(_0x3f43ed,_0x20bc55){return client[_0x70c9('0x1')]('UpdateMailInteraction',{'body':_0x20bc55,'options':{'where':{'id':_0x3f43ed}},'log':_0x70c9('0x2')});};exports['addTags']=function(_0x5cad34,_0x58d86c){return client[_0x70c9('0x1')](_0x70c9('0x3'),{'body':_0x58d86c,'options':{'where':{'id':_0x5cad34}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index adcef85..0c07239 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 _0xb97c=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x305f2f,_0x445a9f){var _0x335375=function(_0x8172f2){while(--_0x8172f2){_0x305f2f['push'](_0x305f2f['shift']());}};_0x335375(++_0x445a9f);}(_0xb97c,0x111));var _0xcb97=function(_0xadaeea,_0x3d7cda){_0xadaeea=_0xadaeea-0x0;var _0x191cdf=_0xb97c[_0xadaeea];return _0x191cdf;};'use strict';var client=require(_0xcb97('0x0'));exports[_0xcb97('0x1')]=function(_0x3cc4a6){return client[_0xcb97('0x2')](_0xcb97('0x3'),{'body':_0x3cc4a6,'log':_0xcb97('0x4')});}; \ No newline at end of file +var _0x5d8d=['CreateMailMessage','../client','create','Request'];(function(_0x4704f8,_0x39fb5c){var _0x16761a=function(_0x26ead8){while(--_0x26ead8){_0x4704f8['push'](_0x4704f8['shift']());}};_0x16761a(++_0x39fb5c);}(_0x5d8d,0x1c5));var _0xd5d8=function(_0x42b568,_0x49ef95){_0x42b568=_0x42b568-0x0;var _0x13876a=_0x5d8d[_0x42b568];return _0x13876a;};'use strict';var client=require(_0xd5d8('0x0'));exports[_0xd5d8('0x1')]=function(_0x5c1283){return client[_0xd5d8('0x2')](_0xd5d8('0x3'),{'body':_0x5c1283,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d197cdd..90eee20 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 _0x60a7=['name','User','Agents','online','mailPause','getMailQueues','GetMailQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60a7,0xf3));var _0x760a=function(_0x2b598b,_0x40613e){_0x2b598b=_0x2b598b-0x0;var _0x26f8cb=_0x60a7[_0x2b598b];return _0x26f8cb;};'use strict';var client=require('../client');exports[_0x760a('0x0')]=function(){return function(){return client['Request'](_0x760a('0x1'),{'options':{'raw':![],'attributes':['id',_0x760a('0x2'),'timeout','strategy'],'include':[{'model':_0x760a('0x3'),'as':_0x760a('0x4'),'attributes':['id','name',_0x760a('0x5'),_0x760a('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x1a04=['Agents','online','mailPause','getMailQueues','../client','GetMailQueue','name','strategy'];(function(_0x363bee,_0x5eeef9){var _0x8f7d0a=function(_0x40ff70){while(--_0x40ff70){_0x363bee['push'](_0x363bee['shift']());}};_0x8f7d0a(++_0x5eeef9);}(_0x1a04,0x94));var _0x41a0=function(_0x39c9ca,_0x3de8af){_0x39c9ca=_0x39c9ca-0x0;var _0x59a56c=_0x1a04[_0x39c9ca];return _0x59a56c;};'use strict';var client=require(_0x41a0('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x41a0('0x1'),{'options':{'raw':![],'attributes':['id',_0x41a0('0x2'),'timeout',_0x41a0('0x3')],'include':[{'model':'User','as':_0x41a0('0x4'),'attributes':['id',_0x41a0('0x2'),_0x41a0('0x5'),_0x41a0('0x6')]}]},'log':_0x41a0('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 5f6ba80..c82790f 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 _0xf684=['../client','create','Request','CreateMailQueueReport','update','DESC'];(function(_0x20de39,_0x371da1){var _0x2ac9eb=function(_0x603125){while(--_0x603125){_0x20de39['push'](_0x20de39['shift']());}};_0x2ac9eb(++_0x371da1);}(_0xf684,0xc6));var _0x4f68=function(_0x56c5cc,_0x138ee2){_0x56c5cc=_0x56c5cc-0x0;var _0x367663=_0xf684[_0x56c5cc];return _0x367663;};'use strict';var client=require(_0x4f68('0x0'));exports[_0x4f68('0x1')]=function(_0x207b5a){return client[_0x4f68('0x2')](_0x4f68('0x3'),{'body':_0x207b5a,'log':_0x4f68('0x3')});};exports[_0x4f68('0x4')]=function(_0x4c1985,_0x220117){return client[_0x4f68('0x2')]('UpdateMailQueueReport',{'body':_0x220117,'options':{'where':{'uniqueid':_0x4c1985},'order':[['id',_0x4f68('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x4f45=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x21f605,_0x204d38){var _0x43591f=function(_0x12ad6f){while(--_0x12ad6f){_0x21f605['push'](_0x21f605['shift']());}};_0x43591f(++_0x204d38);}(_0x4f45,0x112));var _0x54f4=function(_0x4ec3da,_0x951e39){_0x4ec3da=_0x4ec3da-0x0;var _0x53ff18=_0x4f45[_0x4ec3da];return _0x53ff18;};'use strict';var client=require(_0x54f4('0x0'));exports[_0x54f4('0x1')]=function(_0x3d2363){return client[_0x54f4('0x2')](_0x54f4('0x3'),{'body':_0x3d2363,'log':_0x54f4('0x3')});};exports[_0x54f4('0x4')]=function(_0x26f39b,_0x2c9840){return client['Request'](_0x54f4('0x5'),{'body':_0x2c9840,'options':{'where':{'uniqueid':_0x26f39b},'order':[['id',_0x54f4('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 753f72a..b4be59e 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 _0xfb84=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x4095b9,_0x17ac01){var _0x3f6909=function(_0x3c3189){while(--_0x3c3189){_0x4095b9['push'](_0x4095b9['shift']());}};_0x3f6909(++_0x17ac01);}(_0xfb84,0x16f));var _0x4fb8=function(_0x1de43c,_0xaa29de){_0x1de43c=_0x1de43c-0x0;var _0x296d3e=_0xfb84[_0x1de43c];return _0x296d3e;};'use strict';var client=require(_0x4fb8('0x0'));exports[_0x4fb8('0x1')]=function(_0xbee53f,_0x3d1066){return client[_0x4fb8('0x2')]('UpdateOpenchannelInteraction',{'body':_0x3d1066,'options':{'where':{'id':_0xbee53f}},'log':_0x4fb8('0x3')});};exports['addTags']=function(_0x17834d,_0x267b48){return client[_0x4fb8('0x2')](_0x4fb8('0x4'),{'body':_0x267b48,'options':{'where':{'id':_0x17834d}},'log':_0x4fb8('0x5')});}; \ No newline at end of file +var _0xc565=['../client','update','Request','updateOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x5412dc,_0x3dfaa4){var _0x40f5d4=function(_0x1abcf8){while(--_0x1abcf8){_0x5412dc['push'](_0x5412dc['shift']());}};_0x40f5d4(++_0x3dfaa4);}(_0xc565,0x140));var _0x5c56=function(_0x292c6d,_0x51dc36){_0x292c6d=_0x292c6d-0x0;var _0x499c24=_0xc565[_0x292c6d];return _0x499c24;};'use strict';var client=require(_0x5c56('0x0'));exports[_0x5c56('0x1')]=function(_0x16ad40,_0x5c415c){return client[_0x5c56('0x2')]('UpdateOpenchannelInteraction',{'body':_0x5c415c,'options':{'where':{'id':_0x16ad40}},'log':_0x5c56('0x3')});};exports['addTags']=function(_0x4d4b93,_0x5a12c2){return client[_0x5c56('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x5a12c2,'options':{'where':{'id':_0x4d4b93}},'log':_0x5c56('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d99fa35..2153451 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 _0xb821=['createOpenchannelMessage','create'];(function(_0x55bb9d,_0x555588){var _0x3ecd6a=function(_0x66eb7c){while(--_0x66eb7c){_0x55bb9d['push'](_0x55bb9d['shift']());}};_0x3ecd6a(++_0x555588);}(_0xb821,0xa7));var _0x1b82=function(_0x243f49,_0x2ae818){_0x243f49=_0x243f49-0x0;var _0x3936a3=_0xb821[_0x243f49];return _0x3936a3;};'use strict';var client=require('../client');exports[_0x1b82('0x0')]=function(_0x4f6190){return client['Request']('CreateOpenchannelMessage',{'body':_0x4f6190,'log':_0x1b82('0x1')});}; \ No newline at end of file +var _0xf4eb=['../client','createOpenchannelMessage'];(function(_0x43b686,_0x5d7ff3){var _0x287803=function(_0x282a54){while(--_0x282a54){_0x43b686['push'](_0x43b686['shift']());}};_0x287803(++_0x5d7ff3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x13227f,_0x2aa0fa){_0x13227f=_0x13227f-0x0;var _0x256b0a=_0xf4eb[_0x13227f];return _0x256b0a;};'use strict';var client=require(_0xbf4e('0x0'));exports['create']=function(_0x50f2fc){return client['Request']('CreateOpenchannelMessage',{'body':_0x50f2fc,'log':_0xbf4e('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6c64004..d6ca1e2 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 _0xfa66=['online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents'];(function(_0x584ebd,_0x4aae53){var _0x520770=function(_0x532165){while(--_0x532165){_0x584ebd['push'](_0x584ebd['shift']());}};_0x520770(++_0x4aae53);}(_0xfa66,0x106));var _0x6fa6=function(_0x444202,_0x374e63){_0x444202=_0x444202-0x0;var _0xe0d204=_0xfa66[_0x444202];return _0xe0d204;};'use strict';var client=require(_0x6fa6('0x0'));exports[_0x6fa6('0x1')]=function(){return function(){return client[_0x6fa6('0x2')](_0x6fa6('0x3'),{'options':{'raw':![],'attributes':['id',_0x6fa6('0x4'),_0x6fa6('0x5'),'strategy'],'include':[{'model':_0x6fa6('0x6'),'as':_0x6fa6('0x7'),'attributes':['id','name',_0x6fa6('0x8'),_0x6fa6('0x9')]}]},'log':_0x6fa6('0x1')});};}; \ No newline at end of file +var _0x1c21=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','online','openchannelPause'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x1c21,0xa8));var _0x11c2=function(_0x1ca731,_0x2490ca){_0x1ca731=_0x1ca731-0x0;var _0xcacbce=_0x1c21[_0x1ca731];return _0xcacbce;};'use strict';var client=require('../client');exports[_0x11c2('0x0')]=function(){return function(){return client[_0x11c2('0x1')](_0x11c2('0x2'),{'options':{'raw':![],'attributes':['id',_0x11c2('0x3'),'timeout',_0x11c2('0x4')],'include':[{'model':_0x11c2('0x5'),'as':'Agents','attributes':['id',_0x11c2('0x3'),_0x11c2('0x6'),_0x11c2('0x7')]}]},'log':_0x11c2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index dba3fa4..dc82a87 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 _0x8048=['DESC','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x5ae967,_0x36cca6){var _0x457034=function(_0x59398c){while(--_0x59398c){_0x5ae967['push'](_0x5ae967['shift']());}};_0x457034(++_0x36cca6);}(_0x8048,0x74));var _0x8804=function(_0x12849e,_0x3f9cce){_0x12849e=_0x12849e-0x0;var _0xaec77b=_0x8048[_0x12849e];return _0xaec77b;};'use strict';var client=require('../client');exports[_0x8804('0x0')]=function(_0x1889cb){return client[_0x8804('0x1')](_0x8804('0x2'),{'body':_0x1889cb,'log':_0x8804('0x2')});};exports['update']=function(_0x53731f,_0x3990d2){return client[_0x8804('0x1')](_0x8804('0x3'),{'body':_0x3990d2,'options':{'where':{'uniqueid':_0x53731f},'order':[['id',_0x8804('0x4')]],'limit':0x1},'log':_0x8804('0x3')});}; \ No newline at end of file +var _0x819f=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x518067,_0x21e491){var _0xce4676=function(_0x1417a1){while(--_0x1417a1){_0x518067['push'](_0x518067['shift']());}};_0xce4676(++_0x21e491);}(_0x819f,0x9f));var _0xf819=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x819f[_0x1b5080];return _0x195c87;};'use strict';var client=require(_0xf819('0x0'));exports[_0xf819('0x1')]=function(_0x2c90eb){return client[_0xf819('0x2')](_0xf819('0x3'),{'body':_0x2c90eb,'log':_0xf819('0x3')});};exports[_0xf819('0x4')]=function(_0xbf3ed3,_0x17094b){return client[_0xf819('0x2')](_0xf819('0x5'),{'body':_0x17094b,'options':{'where':{'uniqueid':_0xbf3ed3},'order':[['id',_0xf819('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 60787b7..b25cf5e 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 _0xce68=['UpdateSmsInteraction','updateSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x3df449,_0x3126dc){var _0x2b3b6c=function(_0x45daaa){while(--_0x45daaa){_0x3df449['push'](_0x3df449['shift']());}};_0x2b3b6c(++_0x3126dc);}(_0xce68,0x10c));var _0x8ce6=function(_0x8ac318,_0xb5c070){_0x8ac318=_0x8ac318-0x0;var _0x59b774=_0xce68[_0x8ac318];return _0x59b774;};'use strict';var client=require(_0x8ce6('0x0'));exports['update']=function(_0x30b0c9,_0x127429){return client[_0x8ce6('0x1')](_0x8ce6('0x2'),{'body':_0x127429,'options':{'where':{'id':_0x30b0c9}},'log':_0x8ce6('0x3')});};exports['addTags']=function(_0x439270,_0x79f353){return client[_0x8ce6('0x1')]('AddTagsToSmsInteraction',{'body':_0x79f353,'options':{'where':{'id':_0x439270}},'log':_0x8ce6('0x4')});}; \ No newline at end of file +var _0x4b9d=['AddTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags'];(function(_0x2da4b8,_0x1efdee){var _0x3fa0cd=function(_0x2e83c6){while(--_0x2e83c6){_0x2da4b8['push'](_0x2da4b8['shift']());}};_0x3fa0cd(++_0x1efdee);}(_0x4b9d,0x1c3));var _0xd4b9=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x4b9d[_0x53cf8e];return _0x459197;};'use strict';var client=require(_0xd4b9('0x0'));exports[_0xd4b9('0x1')]=function(_0x5b800e,_0x458164){return client[_0xd4b9('0x2')]('UpdateSmsInteraction',{'body':_0x458164,'options':{'where':{'id':_0x5b800e}},'log':_0xd4b9('0x3')});};exports[_0xd4b9('0x4')]=function(_0x1cc400,_0x21338d){return client['Request'](_0xd4b9('0x5'),{'body':_0x21338d,'options':{'where':{'id':_0x1cc400}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 89b2bcf..f12a5dc 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 _0x2c50=['../client','Request','CreateSmsMessage'];(function(_0xdb6420,_0x2c7331){var _0x2dd03c=function(_0x23e51a){while(--_0x23e51a){_0xdb6420['push'](_0xdb6420['shift']());}};_0x2dd03c(++_0x2c7331);}(_0x2c50,0xa8));var _0x02c5=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x2c50[_0x39c734];return _0xb2a2f9;};'use strict';var client=require(_0x02c5('0x0'));exports['create']=function(_0x2bcce4){return client[_0x02c5('0x1')](_0x02c5('0x2'),{'body':_0x2bcce4,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x0590=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x2dd417,_0xe5e1e4){var _0x5dffc7=function(_0x54ee66){while(--_0x54ee66){_0x2dd417['push'](_0x2dd417['shift']());}};_0x5dffc7(++_0xe5e1e4);}(_0x0590,0x1d3));var _0x0059=function(_0x16d638,_0x2bf8f3){_0x16d638=_0x16d638-0x0;var _0x3d4387=_0x0590[_0x16d638];return _0x3d4387;};'use strict';var client=require(_0x0059('0x0'));exports[_0x0059('0x1')]=function(_0x4ba49d){return client[_0x0059('0x2')](_0x0059('0x3'),{'body':_0x4ba49d,'log':_0x0059('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index c9bb165..cbfeb14 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 _0x59fd=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0xd82c17,_0x12cb72){var _0x25987a=function(_0x5e2436){while(--_0x5e2436){_0xd82c17['push'](_0xd82c17['shift']());}};_0x25987a(++_0x12cb72);}(_0x59fd,0x1f3));var _0xd59f=function(_0x11c80a,_0x2f9973){_0x11c80a=_0x11c80a-0x0;var _0x31348b=_0x59fd[_0x11c80a];return _0x31348b;};'use strict';var client=require(_0xd59f('0x0'));exports[_0xd59f('0x1')]=function(){return function(){return client[_0xd59f('0x2')](_0xd59f('0x3'),{'options':{'raw':![],'attributes':['id',_0xd59f('0x4'),_0xd59f('0x5'),_0xd59f('0x6')],'include':[{'model':_0xd59f('0x7'),'as':_0xd59f('0x8'),'attributes':['id','name',_0xd59f('0x9'),'smsPause']}]},'log':_0xd59f('0x1')});};}; \ No newline at end of file +var _0x1af6=['smsPause','../client','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','online'];(function(_0x3f2c13,_0xc5974){var _0x3b7e72=function(_0x2b7ddc){while(--_0x2b7ddc){_0x3f2c13['push'](_0x3f2c13['shift']());}};_0x3b7e72(++_0xc5974);}(_0x1af6,0x121));var _0x61af=function(_0x273cc9,_0x18965b){_0x273cc9=_0x273cc9-0x0;var _0x3ab3ab=_0x1af6[_0x273cc9];return _0x3ab3ab;};'use strict';var client=require(_0x61af('0x0'));exports[_0x61af('0x1')]=function(){return function(){return client[_0x61af('0x2')](_0x61af('0x3'),{'options':{'raw':![],'attributes':['id',_0x61af('0x4'),_0x61af('0x5'),_0x61af('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x61af('0x4'),_0x61af('0x7'),_0x61af('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e8c2041..09eb332 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 _0x1042=['Request','CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','create'];(function(_0x4e0eb6,_0x240784){var _0x46e432=function(_0x24b973){while(--_0x24b973){_0x4e0eb6['push'](_0x4e0eb6['shift']());}};_0x46e432(++_0x240784);}(_0x1042,0x1de));var _0x2104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1042[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2104('0x0'));exports[_0x2104('0x1')]=function(_0xecead9){return client[_0x2104('0x2')](_0x2104('0x3'),{'body':_0xecead9,'log':'CreateSmsQueueReport'});};exports['update']=function(_0x315a77,_0x1a9be2){return client[_0x2104('0x2')](_0x2104('0x4'),{'body':_0x1a9be2,'options':{'where':{'uniqueid':_0x315a77},'order':[['id',_0x2104('0x5')]],'limit':0x1},'log':_0x2104('0x4')});}; \ No newline at end of file +var _0xe924=['CreateSmsQueueReport','update','UpdateSmsQueueReport','../client','create','Request'];(function(_0x293fbf,_0x25329b){var _0x3332df=function(_0x578c8f){while(--_0x578c8f){_0x293fbf['push'](_0x293fbf['shift']());}};_0x3332df(++_0x25329b);}(_0xe924,0x141));var _0x4e92=function(_0x9f1447,_0x5cf7cd){_0x9f1447=_0x9f1447-0x0;var _0xd35376=_0xe924[_0x9f1447];return _0xd35376;};'use strict';var client=require(_0x4e92('0x0'));exports[_0x4e92('0x1')]=function(_0x9401c9){return client[_0x4e92('0x2')](_0x4e92('0x3'),{'body':_0x9401c9,'log':_0x4e92('0x3')});};exports[_0x4e92('0x4')]=function(_0x4144ad,_0x305b76){return client[_0x4e92('0x2')](_0x4e92('0x5'),{'body':_0x305b76,'options':{'where':{'uniqueid':_0x4144ad},'order':[['id','DESC']],'limit':0x1},'log':_0x4e92('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 02d4fb9..2c936ed 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 _0x1cec=['smsPause','openchannelPause','chatCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent','lastPauseAt','voicePause','chatPause'];(function(_0x5ca7b8,_0x1d8f03){var _0x58e84e=function(_0x2f0ffa){while(--_0x2f0ffa){_0x5ca7b8['push'](_0x5ca7b8['shift']());}};_0x58e84e(++_0x1d8f03);}(_0x1cec,0x1f4));var _0xc1ce=function(_0x37c006,_0x1f647a){_0x37c006=_0x37c006-0x0;var _0x3f306e=_0x1cec[_0x37c006];return _0x3f306e;};'use strict';var client=require(_0xc1ce('0x0'));exports[_0xc1ce('0x1')]=function(){return function(){return client[_0xc1ce('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xc1ce('0x3')},'attributes':['id','name','online','pauseType',_0xc1ce('0x4'),_0xc1ce('0x5'),_0xc1ce('0x6'),'mailPause','faxPause',_0xc1ce('0x7'),_0xc1ce('0x8'),_0xc1ce('0x9'),'mailCapacity',_0xc1ce('0xa'),_0xc1ce('0xb'),_0xc1ce('0xc')]},'log':_0xc1ce('0x1')});};}; \ No newline at end of file +var _0x5ce7=['mailPause','smsPause','chatCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','name','pauseType','lastPauseAt','voicePause'];(function(_0x247d20,_0x23f4d3){var _0x3834d2=function(_0x1968c2){while(--_0x1968c2){_0x247d20['push'](_0x247d20['shift']());}};_0x3834d2(++_0x23f4d3);}(_0x5ce7,0x16e));var _0x75ce=function(_0x4b2407,_0x3fa63e){_0x4b2407=_0x4b2407-0x0;var _0x5defa2=_0x5ce7[_0x4b2407];return _0x5defa2;};'use strict';var client=require(_0x75ce('0x0'));exports[_0x75ce('0x1')]=function(){return function(){return client[_0x75ce('0x2')](_0x75ce('0x3'),{'options':{'raw':!![],'where':{'role':_0x75ce('0x4')},'attributes':['id',_0x75ce('0x5'),'online',_0x75ce('0x6'),_0x75ce('0x7'),_0x75ce('0x8'),'chatPause',_0x75ce('0x9'),'faxPause',_0x75ce('0xa'),'openchannelPause',_0x75ce('0xb'),'mailCapacity',_0x75ce('0xc'),_0x75ce('0xd'),_0x75ce('0xe')]},'log':'getAgents'});};}; \ 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 16e60ce..bd543cc 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 _0x81a6=['consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x4fad63,_0x2852c4){var _0x2e17a8=function(_0x69d8e8){while(--_0x69d8e8){_0x4fad63['push'](_0x4fad63['shift']());}};_0x2e17a8(++_0x2852c4);}(_0x81a6,0x17f));var _0x681a=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x81a6[_0xd578cb];return _0x775533;};'use strict';var schema=require(_0x681a('0x0'));var _=require('lodash');var util=require(_0x681a('0x1'));var seqqueue=require(_0x681a('0x2'));var logger=require(_0x681a('0x3'))(_0x681a('0x4'));var strategy=require(_0x681a('0x5'));var queue=schema({'name':{'type':_0x681a('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x681a('0x7'),'message':_0x681a('0x8')}});function writeLog(_0x738fed,_0xb6fd38,_0x37a569){return logger[_0x681a('0x9')](util['format'](_0x681a('0xa'),_0x738fed,_0xb6fd38[_0x681a('0xb')],_0x37a569));}function handleFindAgent(_0x4f4e6f){return function(_0x4a23a7){return _0x4a23a7[_0x681a('0xb')][_0x681a('0xc')]()===_0x4f4e6f[_0x681a('0xc')]();};}exports[_0x681a('0xd')]=function(_0x50184c,_0x594d0d,_0x5b62ff,_0x845e30){return function(_0x8469da){try{var _0x1d2f68={'name':_0x594d0d[0x0],'timeout':_0x594d0d[0x1]};var _0x37c102=queue[_0x681a('0x0')](_0x1d2f68,{'typecast':!![]});if(_0x37c102[_0x681a('0xe')]){logger[_0x681a('0xf')](_0x681a('0x10'),_0x50184c,_[_0x681a('0x11')](_0x37c102,_0x681a('0x12'))[_0x681a('0x13')](',\x20'));_0x8469da[_0x681a('0x14')]();}else{var _0x21024d=_[_0x681a('0x15')](_0x5b62ff[_0x681a('0x16')],handleFindAgent(_0x1d2f68[_0x681a('0xb')]));if(_0x21024d){var _0x9afc23=(_0x1d2f68[_0x681a('0x17')]||0xa)*0x3e8;var _0x3b5c22,_0x49a51c;var _0x5d72b8=seqqueue[_0x681a('0x18')](_0x9afc23);_0x5d72b8['id']=_0x50184c;_0x5d72b8[_0x681a('0x19')]=_0x9afc23;_0x5d72b8[_0x681a('0x1a')]=_0x845e30['channel'];writeLog(_0x50184c,_0x21024d,util[_0x681a('0x1b')](_0x681a('0x1c'),_0x9afc23));_0x5b62ff['rules'][_0x50184c]['on'](_0x681a('0x1d'),function(){_0x5d72b8[_0x681a('0x1e')]();clearTimeout(_0x49a51c);_0x49a51c=undefined;if(_0x5b62ff['rules'][_0x50184c]){delete _0x5b62ff[_0x681a('0x1f')][_0x50184c];}logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x50184c);_0x8469da[_0x681a('0x14')]();});_0x49a51c=setTimeout(function(){clearTimeout(_0x49a51c);_0x5d72b8[_0x681a('0x1e')]();logger[_0x681a('0x9')](_0x681a('0x20'),_0x50184c);_0x8469da['next']();},_0x9afc23);strategy[_0x681a('0x21')](_0x5d72b8,_0x21024d,_0x5b62ff,_0x845e30);}else{logger[_0x681a('0xf')](_0x681a('0x22'),_0x50184c,_0x1d2f68[_0x681a('0xb')]);_0x8469da[_0x681a('0x14')]();}}}catch(_0x426622){console[_0x681a('0x23')](_0x426622);logger['error']('[%s][QUEUE]\x20%s',_0x50184c,_0x426622['stack']);_0x8469da['stop']();}};}; \ No newline at end of file +var _0x4262=['validate','lodash','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x5a475e,_0x25ca36){var _0x1db0fb=function(_0x361324){while(--_0x361324){_0x5a475e['push'](_0x5a475e['shift']());}};_0x1db0fb(++_0x25ca36);}(_0x4262,0xb9));var _0x2426=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4262[_0x1facfa];return _0x9ec701;};'use strict';var schema=require(_0x2426('0x0'));var _=require(_0x2426('0x1'));var util=require(_0x2426('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x2426('0x3'))(_0x2426('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x2426('0x5'),'required':!![],'message':_0x2426('0x6')},'timeout':{'type':_0x2426('0x7'),'message':_0x2426('0x8')}});function writeLog(_0x374e5e,_0x41affe,_0x15a36a){return logger[_0x2426('0x9')](util['format'](_0x2426('0xa'),_0x374e5e,_0x41affe[_0x2426('0xb')],_0x15a36a));}function handleFindAgent(_0x3d6f5a){return function(_0x2fa831){return _0x2fa831[_0x2426('0xb')][_0x2426('0xc')]()===_0x3d6f5a[_0x2426('0xc')]();};}exports['consequence']=function(_0xbd9992,_0x366db8,_0x3917af,_0x9916b){return function(_0x14218b){try{var _0x140ac8={'name':_0x366db8[0x0],'timeout':_0x366db8[0x1]};var _0x608c1e=queue['validate'](_0x140ac8,{'typecast':!![]});if(_0x608c1e[_0x2426('0xd')]){logger[_0x2426('0xe')](_0x2426('0xf'),_0xbd9992,_[_0x2426('0x10')](_0x608c1e,'message')[_0x2426('0x11')](',\x20'));_0x14218b[_0x2426('0x12')]();}else{var _0x147c51=_[_0x2426('0x13')](_0x3917af[_0x2426('0x14')],handleFindAgent(_0x140ac8[_0x2426('0xb')]));if(_0x147c51){var _0x32acff=(_0x140ac8[_0x2426('0x15')]||0xa)*0x3e8;var _0x50a593,_0x106007;var _0x39fbbc=seqqueue[_0x2426('0x16')](_0x32acff);_0x39fbbc['id']=_0xbd9992;_0x39fbbc[_0x2426('0x17')]=_0x32acff;_0x39fbbc['channel']=_0x9916b[_0x2426('0x18')];writeLog(_0xbd9992,_0x147c51,util[_0x2426('0x19')](_0x2426('0x1a'),_0x32acff));_0x3917af[_0x2426('0x1b')][_0xbd9992]['on'](_0x2426('0x1c'),function(){_0x39fbbc['close']();clearTimeout(_0x106007);_0x106007=undefined;if(_0x3917af['rules'][_0xbd9992]){delete _0x3917af[_0x2426('0x1b')][_0xbd9992];}logger[_0x2426('0x9')](_0x2426('0x1d'),_0xbd9992);_0x14218b[_0x2426('0x12')]();});_0x106007=setTimeout(function(){clearTimeout(_0x106007);_0x39fbbc[_0x2426('0x1e')]();logger[_0x2426('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0xbd9992);_0x14218b[_0x2426('0x1f')]();},_0x32acff);strategy[_0x2426('0x20')](_0x39fbbc,_0x147c51,_0x3917af,_0x9916b);}else{logger[_0x2426('0xe')](_0x2426('0x21'),_0xbd9992,_0x140ac8['name']);_0x14218b[_0x2426('0x12')]();}}}catch(_0x3b9e92){console[_0x2426('0x22')](_0x3b9e92);logger[_0x2426('0xe')](_0x2426('0x23'),_0xbd9992,_0x3b9e92[_0x2426('0x24')]);_0x14218b[_0x2426('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index c0e092d..f33b9d1 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 _0xd8f3=['out','channel','chat','AccountId','account','upperFirst','created','isEmpty','Message','create','then','body','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','error','next','amazonlex','dialogState','Failed','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format'];(function(_0x430095,_0x122722){var _0x115f8a=function(_0x5af765){while(--_0x5af765){_0x430095['push'](_0x430095['shift']());}};_0x115f8a(++_0x122722);}(_0xd8f3,0x141));var _0x3d8f=function(_0x3410b2,_0x179573){_0x3410b2=_0x3410b2-0x0;var _0x3a6fae=_0xd8f3[_0x3410b2];return _0x3a6fae;};'use strict';var _=require(_0x3d8f('0x0'));var moment=require('moment');var AWS=require(_0x3d8f('0x1'));var utils=require(_0x3d8f('0x2'));var logger=require(_0x3d8f('0x3'))(_0x3d8f('0x4'));var rpc={'chatMessage':require(_0x3d8f('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3d8f('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3d8f('0x7'))};exports[_0x3d8f('0x8')]=function(_0x9b9b2b,_0x232aae){return function(_0x5d57e4){try{if(!_['isNil'](this[_0x3d8f('0x9')][_0x3d8f('0xa')])){logger[_0x3d8f('0xb')](_0x3d8f('0xc'),_0x9b9b2b,_0x3d8f('0xd'));return _0x5d57e4['next']();}var _0x215b62={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3d8f('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3d8f('0xf')};var _0x21f575=this[_0x3d8f('0x10')];if(_0x21f575===_0x3d8f('0x11')){_0x215b62['ChatWebsiteId']=this['account']['id'];}else{_0x215b62[_['upperFirst'](_0x21f575)+_0x3d8f('0x12')]=this[_0x3d8f('0x13')]['id'];}_0x215b62[_[_0x3d8f('0x14')](_0x21f575)+'InteractionId']=this[_0x3d8f('0x9')]['id'];if(this['interaction'][_0x3d8f('0x15')]){var _0x4b0fb2=_0x232aae[0x4];if(!_[_0x3d8f('0x16')](_0x4b0fb2)){_0x215b62['body']=utils['getMustacheRender'](_0x4b0fb2,this);return rpc[_0x21f575+_0x3d8f('0x17')][_0x3d8f('0x18')](_0x215b62)[_0x3d8f('0x19')](function(_0x320581){logger['info'](_0x3d8f('0xc'),_0x9b9b2b,_0x215b62[_0x3d8f('0x1a')]);})[_0x3d8f('0x1b')](function(_0x4e38c4){logger['error'](_0x3d8f('0xc'),_0x9b9b2b,JSON[_0x3d8f('0x1c')](_0x4e38c4));})[_0x3d8f('0x1d')](function(){logger[_0x3d8f('0xb')](_0x3d8f('0x1e'),_0x9b9b2b);_0x5d57e4[_0x3d8f('0x1f')]();});}else{logger[_0x3d8f('0xb')](_0x3d8f('0x20'),_0x9b9b2b);_0x5d57e4[_0x3d8f('0x1f')]();}}else{var _0x2cddb5=this;var _0x2d32d1=new AWS['LexRuntime']({'accessKeyId':_0x232aae[0x0],'secretAccessKey':_0x232aae[0x1],'region':_0x232aae[0x2]});var _0x46a811={'botAlias':_0x3d8f('0x21'),'botName':_0x232aae[0x3],'inputText':this[_0x3d8f('0x22')]['body'],'userId':this[_0x3d8f('0x9')]['id'][_0x3d8f('0x23')]()};_0x2d32d1[_0x3d8f('0x24')](_0x46a811,function(_0x3e6e50,_0xede6f4){if(_0x3e6e50){logger[_0x3d8f('0x25')](_0x3d8f('0xc'),_0x9b9b2b,_0x3e6e50[_0x3d8f('0x22')]);_0x5d57e4[_0x3d8f('0x26')]();}else if(_0xede6f4&&_0xede6f4[_0x3d8f('0x22')]){_0x2cddb5['body'][_0x3d8f('0x27')]=_0xede6f4;_0x215b62[_0x3d8f('0x1a')]=_0xede6f4['message'];return rpc[_0x21f575+'Message'][_0x3d8f('0x18')](_0x215b62)[_0x3d8f('0x19')](function(_0x2ca11a){logger[_0x3d8f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x9b9b2b,_0x215b62[_0x3d8f('0x1a')]);if(_0xede6f4[_0x3d8f('0x28')]==_0x3d8f('0x29')){_0x5d57e4[_0x3d8f('0x26')]();}else{_0x5d57e4[_0x3d8f('0x1f')]();}})[_0x3d8f('0x1b')](function(_0x2801db){logger[_0x3d8f('0x25')](_0x3d8f('0xc'),_0x9b9b2b,JSON[_0x3d8f('0x1c')](_0x2801db));_0x5d57e4['next']();});}else{_0x5d57e4[_0x3d8f('0x26')]();}});}}catch(_0x2dea83){logger[_0x3d8f('0x25')](_0x3d8f('0xc'),_0x9b9b2b,JSON[_0x3d8f('0x1c')](_0x2dea83));_0x5d57e4[_0x3d8f('0x1f')]();}};}; \ No newline at end of file +var _0x99da=['[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','Message','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x99da,0x7f));var _0xa99d=function(_0x3ee5cd,_0x3023f6){_0x3ee5cd=_0x3ee5cd-0x0;var _0x593fa4=_0x99da[_0x3ee5cd];return _0x593fa4;};'use strict';var _=require(_0xa99d('0x0'));var moment=require(_0xa99d('0x1'));var AWS=require(_0xa99d('0x2'));var utils=require('./utils');var logger=require(_0xa99d('0x3'))('routing');var rpc={'chatMessage':require(_0xa99d('0x4')),'openchannelMessage':require(_0xa99d('0x5')),'mailMessage':require(_0xa99d('0x6')),'smsMessage':require(_0xa99d('0x7')),'faxMessage':require(_0xa99d('0x8'))};exports[_0xa99d('0x9')]=function(_0x28fb38,_0x422d8b){return function(_0x388ded){try{if(!_[_0xa99d('0xa')](this[_0xa99d('0xb')][_0xa99d('0xc')])){logger[_0xa99d('0xd')](_0xa99d('0xe'),_0x28fb38,_0xa99d('0xf'));return _0x388ded[_0xa99d('0x10')]();}var _0x1c0a4b={'ContactId':this[_0xa99d('0x11')]['id'],'sentAt':moment()[_0xa99d('0x12')](_0xa99d('0x13')),'direction':_0xa99d('0x14')};var _0x452b44=this[_0xa99d('0x15')];if(_0x452b44===_0xa99d('0x16')){_0x1c0a4b['ChatWebsiteId']=this[_0xa99d('0x17')]['id'];}else{_0x1c0a4b[_[_0xa99d('0x18')](_0x452b44)+_0xa99d('0x19')]=this['account']['id'];}_0x1c0a4b[_[_0xa99d('0x18')](_0x452b44)+_0xa99d('0x1a')]=this[_0xa99d('0xb')]['id'];if(this[_0xa99d('0xb')][_0xa99d('0x1b')]){var _0x288849=_0x422d8b[0x4];if(!_[_0xa99d('0x1c')](_0x288849)){_0x1c0a4b[_0xa99d('0x1d')]=utils['getMustacheRender'](_0x288849,this);return rpc[_0x452b44+'Message'][_0xa99d('0x1e')](_0x1c0a4b)[_0xa99d('0x1f')](function(_0x602ecf){logger[_0xa99d('0xd')](_0xa99d('0xe'),_0x28fb38,_0x1c0a4b['body']);})[_0xa99d('0x20')](function(_0x4195b6){logger[_0xa99d('0x21')](_0xa99d('0xe'),_0x28fb38,JSON[_0xa99d('0x22')](_0x4195b6));})[_0xa99d('0x23')](function(){logger['info'](_0xa99d('0x24'),_0x28fb38);_0x388ded[_0xa99d('0x25')]();});}else{logger['info'](_0xa99d('0x26'),_0x28fb38);_0x388ded[_0xa99d('0x25')]();}}else{var _0x283f92=this;var _0x4e1d64=new AWS[(_0xa99d('0x27'))]({'accessKeyId':_0x422d8b[0x0],'secretAccessKey':_0x422d8b[0x1],'region':_0x422d8b[0x2]});var _0x124a0a={'botAlias':_0xa99d('0x28'),'botName':_0x422d8b[0x3],'inputText':this[_0xa99d('0x29')][_0xa99d('0x1d')],'userId':this['interaction']['id'][_0xa99d('0x2a')]()};_0x4e1d64[_0xa99d('0x2b')](_0x124a0a,function(_0x53099c,_0x12fc27){if(_0x53099c){logger[_0xa99d('0x21')]('[%s][AMAZONLEX]\x20%s',_0x28fb38,_0x53099c[_0xa99d('0x29')]);_0x388ded[_0xa99d('0x10')]();}else if(_0x12fc27&&_0x12fc27[_0xa99d('0x29')]){_0x283f92[_0xa99d('0x1d')]['amazonlex']=_0x12fc27;_0x1c0a4b[_0xa99d('0x1d')]=_0x12fc27[_0xa99d('0x29')];return rpc[_0x452b44+_0xa99d('0x2c')][_0xa99d('0x1e')](_0x1c0a4b)[_0xa99d('0x1f')](function(_0x5cf4ce){logger[_0xa99d('0xd')](_0xa99d('0xe'),_0x28fb38,_0x1c0a4b[_0xa99d('0x1d')]);if(_0x12fc27[_0xa99d('0x2d')]==_0xa99d('0x2e')){_0x388ded['next']();}else{_0x388ded['stop']();}})[_0xa99d('0x20')](function(_0x1e29fd){logger[_0xa99d('0x21')](_0xa99d('0xe'),_0x28fb38,JSON['stringify'](_0x1e29fd));_0x388ded[_0xa99d('0x10')]();});}else{_0x388ded[_0xa99d('0x10')]();}});}}catch(_0x18d1a8){logger[_0xa99d('0x21')](_0xa99d('0xe'),_0x28fb38,JSON[_0xa99d('0x22')](_0x18d1a8));_0x388ded['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 517eae1..3e641e9 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 _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x1dd1e5,_0x10c223){var _0x1bbfc4=function(_0x23b915){while(--_0x23b915){_0x1dd1e5['push'](_0x1dd1e5['shift']());}};_0x1bbfc4(++_0x10c223);}(_0x70e0,0x17b));var _0x070e=function(_0x5e5710,_0x18ccd0){_0x5e5710=_0x5e5710-0x0;var _0x1cd781=_0x70e0[_0x5e5710];return _0x1cd781;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x5d927f,_0x4404f1){var _0x4fad9e=function(_0x21f5e9){while(--_0x21f5e9){_0x5d927f['push'](_0x5d927f['shift']());}};_0x4fad9e(++_0x4404f1);}(_0xedd9,0xfc));var _0x9edd=function(_0x4156a5,_0x2db142){_0x4156a5=_0x4156a5-0x0;var _0x299821=_0xedd9[_0x4156a5];return _0x299821;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};}; \ 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 417515f..c9a7071 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 _0x85d3=['moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','stringify'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x85d3,0xc8));var _0x385d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x85d3[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0x385d('0x0'));var logger=require(_0x385d('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x385d('0x2')),'smsInteraction':require(_0x385d('0x3')),'mailInteraction':require(_0x385d('0x4')),'faxInteraction':require(_0x385d('0x5'))};exports[_0x385d('0x6')]=function(_0x1b543d,_0x57809f,_0x1db5f0,_0x491779){return function(_0x2faf3a){try{logger[_0x385d('0x7')](_0x385d('0x8'),_0x1b543d,_0x57809f[0x0]);var _0x2e7f52={'closed':0x1,'closedAt':moment()['format'](_0x385d('0x9')),'closeReason':_0x385d('0xa'),'disposition':_0x57809f[0x0]};if(rpc[_0x491779[_0x385d('0xb')]+_0x385d('0xc')]){rpc[_0x491779[_0x385d('0xb')]+_0x385d('0xc')]['update'](_0x491779[_0x385d('0xd')]['id'],_0x2e7f52)['then'](function(_0x550d55){logger[_0x385d('0x7')](_0x385d('0xe'),_0x1b543d,_0x491779[_0x385d('0xd')]['id']);})[_0x385d('0xf')](function(_0x9f960a){logger[_0x385d('0x10')](_0x385d('0x11'),_0x1b543d,JSON['stringify'](_0x9f960a));})['finally'](function(){_0x2faf3a[_0x385d('0x12')]();});}}catch(_0x4310b9){logger[_0x385d('0x10')]('[%s][CLOSE]\x20%s',_0x1b543d,JSON[_0x385d('0x13')](_0x4310b9));_0x2faf3a[_0x385d('0x12')]();}};}; \ No newline at end of file +var _0xd139=['consequence','[%s][CLOSE]\x20reason\x20%s','format','Interaction','channel','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xd139,0x14e));var _0x9d13=function(_0x426c24,_0x4ea696){_0x426c24=_0x426c24-0x0;var _0x1e0dda=_0xd139[_0x426c24];return _0x1e0dda;};'use strict';var moment=require(_0x9d13('0x0'));var logger=require(_0x9d13('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9d13('0x2')),'smsInteraction':require(_0x9d13('0x3')),'mailInteraction':require(_0x9d13('0x4')),'faxInteraction':require(_0x9d13('0x5'))};exports[_0x9d13('0x6')]=function(_0xdeacf6,_0x16b9f2,_0x58c6f5,_0x4c8e60){return function(_0x2918eb){try{logger['info'](_0x9d13('0x7'),_0xdeacf6,_0x16b9f2[0x0]);var _0x4b3db0={'closed':0x1,'closedAt':moment()[_0x9d13('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x16b9f2[0x0]};if(rpc[_0x4c8e60['channel']+_0x9d13('0x9')]){rpc[_0x4c8e60[_0x9d13('0xa')]+_0x9d13('0x9')][_0x9d13('0xb')](_0x4c8e60[_0x9d13('0xc')]['id'],_0x4b3db0)['then'](function(_0x151adc){logger[_0x9d13('0xd')](_0x9d13('0xe'),_0xdeacf6,_0x4c8e60['interaction']['id']);})['catch'](function(_0x22b2f7){logger[_0x9d13('0xf')](_0x9d13('0x10'),_0xdeacf6,JSON[_0x9d13('0x11')](_0x22b2f7));})[_0x9d13('0x12')](function(){_0x2918eb['stop']();});}}catch(_0x5de53f){logger[_0x9d13('0xf')](_0x9d13('0x10'),_0xdeacf6,JSON[_0x9d13('0x11')](_0x5de53f));_0x2918eb[_0x9d13('0x13')]();}};}; \ 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 95e14a8..7a3263d 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 _0xd8ed=['dialogflow','result','speech','Message','create','metadata','stringify','moment','apiai-promise','md5','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','InteractionId','created','isEmpty','then','body','catch','error','finally','stop','textRequest','message'];(function(_0x41a046,_0xf75b0e){var _0x58b6a3=function(_0x597138){while(--_0x597138){_0x41a046['push'](_0x41a046['shift']());}};_0x58b6a3(++_0xf75b0e);}(_0xd8ed,0x126));var _0xdd8e=function(_0x290547,_0x3b8125){_0x290547=_0x290547-0x0;var _0x1f3bf0=_0xd8ed[_0x290547];return _0x1f3bf0;};'use strict';var _=require('lodash');var moment=require(_0xdd8e('0x0'));var apiai=require(_0xdd8e('0x1'));var md5=require(_0xdd8e('0x2'));var utils=require(_0xdd8e('0x3'));var logger=require('../../../../config/logger')(_0xdd8e('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdd8e('0x5')),'mailMessage':require(_0xdd8e('0x6')),'smsMessage':require(_0xdd8e('0x7')),'faxMessage':require(_0xdd8e('0x8'))};exports[_0xdd8e('0x9')]=function(_0x28e170,_0x628856){return function(_0x336c14){try{if(!_[_0xdd8e('0xa')](this[_0xdd8e('0xb')]['UserId'])){logger[_0xdd8e('0xc')](_0xdd8e('0xd'),_0x28e170,_0xdd8e('0xe'));return _0x336c14[_0xdd8e('0xf')]();}var _0x3b08c2={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdd8e('0x10')](_0xdd8e('0x11')),'direction':_0xdd8e('0x12')};var _0xfa66dd=this[_0xdd8e('0x13')];if(_0xfa66dd===_0xdd8e('0x14')){_0x3b08c2['ChatWebsiteId']=this[_0xdd8e('0x15')]['id'];}else{_0x3b08c2[_['upperFirst'](_0xfa66dd)+'AccountId']=this[_0xdd8e('0x15')]['id'];}_0x3b08c2[_[_0xdd8e('0x16')](_0xfa66dd)+_0xdd8e('0x17')]=this[_0xdd8e('0xb')]['id'];if(this[_0xdd8e('0xb')][_0xdd8e('0x18')]){var _0x3386da=_0x628856[0x2];if(!_[_0xdd8e('0x19')](_0x3386da)){_0x3b08c2['body']=utils['getMustacheRender'](_0x3386da,this);return rpc[_0xfa66dd+'Message']['create'](_0x3b08c2)[_0xdd8e('0x1a')](function(_0x25000d){logger['info'](_0xdd8e('0xd'),_0x28e170,_0x3b08c2[_0xdd8e('0x1b')]);})[_0xdd8e('0x1c')](function(_0x5641c2){logger[_0xdd8e('0x1d')](_0xdd8e('0xd'),_0x28e170,JSON['stringify'](_0x5641c2));})[_0xdd8e('0x1e')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x28e170);_0x336c14['stop']();});}else{logger[_0xdd8e('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x28e170);_0x336c14[_0xdd8e('0x1f')]();}}else{var _0x3ba02e=this;var _0x1adc4d=apiai(_0x628856[0x0],{'language':_0x628856[0x1]||'en'});return _0x1adc4d[_0xdd8e('0x20')](this[_0xdd8e('0x21')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0xdd8e('0x1a')](function(_0x112112){_0x3ba02e['body'][_0xdd8e('0x22')]=_0x112112;_0x3b08c2[_0xdd8e('0x1b')]=_0x112112[_0xdd8e('0x23')]['fulfillment'][_0xdd8e('0x24')];return rpc[_0xfa66dd+_0xdd8e('0x25')][_0xdd8e('0x26')](_0x3b08c2)['then'](function(_0x4863ef){logger[_0xdd8e('0xc')](_0xdd8e('0xd'),_0x28e170,_0x3b08c2['body']);if(_0x112112[_0xdd8e('0x23')][_0xdd8e('0x27')]['endConversation']){_0x336c14[_0xdd8e('0xf')]();}else{_0x336c14[_0xdd8e('0x1f')]();}})[_0xdd8e('0x1c')](function(_0x56d3c8){logger[_0xdd8e('0x1d')](_0xdd8e('0xd'),_0x28e170,JSON[_0xdd8e('0x28')](_0x56d3c8));_0x336c14[_0xdd8e('0xf')]();});})['catch'](function(_0x81e75d){logger[_0xdd8e('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x28e170,_0x81e75d[_0xdd8e('0x21')]);_0x336c14[_0xdd8e('0xf')]();});}}catch(_0x17f50c){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x28e170,JSON[_0xdd8e('0x28')](_0x17f50c));_0x336c14[_0xdd8e('0x1f')]();}};}; \ No newline at end of file +var _0xf759=['format','out','channel','chat','account','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','fulfillment','result','metadata','endConversation','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x15411f,_0x42bef8){var _0x555650=function(_0x215e4f){while(--_0x215e4f){_0x15411f['push'](_0x15411f['shift']());}};_0x555650(++_0x42bef8);}(_0xf759,0x18d));var _0x9f75=function(_0x56a1da,_0x10317e){_0x56a1da=_0x56a1da-0x0;var _0x5e24fa=_0xf759[_0x56a1da];return _0x5e24fa;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x9f75('0x0'));var utils=require(_0x9f75('0x1'));var logger=require(_0x9f75('0x2'))(_0x9f75('0x3'));var rpc={'chatMessage':require(_0x9f75('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9f75('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x9f75('0x6')]=function(_0x21ab40,_0x27e30c){return function(_0x15c96c){try{if(!_[_0x9f75('0x7')](this[_0x9f75('0x8')][_0x9f75('0x9')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x21ab40,_0x9f75('0xa'));return _0x15c96c[_0x9f75('0xb')]();}var _0x4c3c2b={'ContactId':this[_0x9f75('0xc')]['id'],'sentAt':moment()[_0x9f75('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9f75('0xe')};var _0x8f5d7f=this[_0x9f75('0xf')];if(_0x8f5d7f===_0x9f75('0x10')){_0x4c3c2b['ChatWebsiteId']=this[_0x9f75('0x11')]['id'];}else{_0x4c3c2b[_['upperFirst'](_0x8f5d7f)+_0x9f75('0x12')]=this[_0x9f75('0x11')]['id'];}_0x4c3c2b[_[_0x9f75('0x13')](_0x8f5d7f)+_0x9f75('0x14')]=this['interaction']['id'];if(this[_0x9f75('0x8')][_0x9f75('0x15')]){var _0x4931b9=_0x27e30c[0x2];if(!_['isEmpty'](_0x4931b9)){_0x4c3c2b[_0x9f75('0x16')]=utils[_0x9f75('0x17')](_0x4931b9,this);return rpc[_0x8f5d7f+_0x9f75('0x18')][_0x9f75('0x19')](_0x4c3c2b)[_0x9f75('0x1a')](function(_0x1979ac){logger[_0x9f75('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x21ab40,_0x4c3c2b[_0x9f75('0x16')]);})[_0x9f75('0x1c')](function(_0x452fb9){logger[_0x9f75('0x1d')](_0x9f75('0x1e'),_0x21ab40,JSON[_0x9f75('0x1f')](_0x452fb9));})['finally'](function(){logger['info'](_0x9f75('0x20'),_0x21ab40);_0x15c96c[_0x9f75('0x21')]();});}else{logger[_0x9f75('0x1b')](_0x9f75('0x22'),_0x21ab40);_0x15c96c[_0x9f75('0x21')]();}}else{var _0x3d7c52=this;var _0x3af0c2=apiai(_0x27e30c[0x0],{'language':_0x27e30c[0x1]||'en'});return _0x3af0c2['textRequest'](this[_0x9f75('0x23')]['body'],{'sessionId':md5(this[_0x9f75('0x8')]['id'])})['then'](function(_0x26eb13){_0x3d7c52[_0x9f75('0x16')][_0x9f75('0x24')]=_0x26eb13;_0x4c3c2b[_0x9f75('0x16')]=_0x26eb13['result'][_0x9f75('0x25')]['speech'];return rpc[_0x8f5d7f+_0x9f75('0x18')][_0x9f75('0x19')](_0x4c3c2b)[_0x9f75('0x1a')](function(_0x254b53){logger[_0x9f75('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x21ab40,_0x4c3c2b[_0x9f75('0x16')]);if(_0x26eb13[_0x9f75('0x26')][_0x9f75('0x27')][_0x9f75('0x28')]){_0x15c96c[_0x9f75('0xb')]();}else{_0x15c96c[_0x9f75('0x21')]();}})[_0x9f75('0x1c')](function(_0x1c7f60){logger[_0x9f75('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x21ab40,JSON['stringify'](_0x1c7f60));_0x15c96c[_0x9f75('0xb')]();});})[_0x9f75('0x1c')](function(_0x59285){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x21ab40,_0x59285[_0x9f75('0x23')]);_0x15c96c[_0x9f75('0xb')]();});}}catch(_0x27f8d0){logger[_0x9f75('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x21ab40,JSON[_0x9f75('0x1f')](_0x27f8d0));_0x15c96c[_0x9f75('0x21')]();}};}; \ 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 09e576f..41f52d3 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 _0xcb23=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse'];(function(_0x5a8334,_0x164ae2){var _0x4a1bd0=function(_0x5d2c37){while(--_0x5d2c37){_0x5a8334['push'](_0x5a8334['shift']());}};_0x4a1bd0(++_0x164ae2);}(_0xcb23,0x1c8));var _0x3cb2=function(_0x1f90ae,_0x164b05){_0x1f90ae=_0x1f90ae-0x0;var _0xdb9184=_0xcb23[_0x1f90ae];return _0xdb9184;};'use strict';var schema=require(_0x3cb2('0x0'));var _=require(_0x3cb2('0x1'));var htmlToText=require(_0x3cb2('0x2'));var utils=require(_0x3cb2('0x3'));var logger=require(_0x3cb2('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3cb2('0x5'),'message':_0x3cb2('0x6')},'priorityFalse':{'type':_0x3cb2('0x5'),'message':_0x3cb2('0x7')}});exports[_0x3cb2('0x8')]=function(_0x1dfb62,_0xd72052){return function(_0x19d284){try{var _0x3a10c2={'condition':htmlToText['fromString'](utils[_0x3cb2('0x9')](_0xd72052[0x0],this),{'wordwrap':![]})[_0x3cb2('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xd72052[0x1],'priorityFalse':_0xd72052[0x2]};var _0x3aa8c2=gotoif['validate'](_0x3a10c2,{'typecast':!![]});if(_0x3aa8c2[_0x3cb2('0xb')]){logger[_0x3cb2('0xc')](_0x3cb2('0xd'),_0x1dfb62,_[_0x3cb2('0xe')](_0x3aa8c2,_0x3cb2('0xf'))[_0x3cb2('0x10')](',\x20'));_0x19d284[_0x3cb2('0x11')]();}else{try{var _0x48f19c=eval('('+_0x3a10c2['condition']+')');var _0x571ab6=_0x48f19c?_0x3a10c2[_0x3cb2('0x12')]:_0x3a10c2[_0x3cb2('0x13')];logger[_0x3cb2('0x14')](_0x3cb2('0x15'),_0x1dfb62,_0x3a10c2[_0x3cb2('0x16')],_0x48f19c,_0x571ab6||_0x3cb2('0x17'));if(_0x571ab6){var _0x522c81=_[_0x3cb2('0x18')](_0x19d284['rules'](),{'p':_0x571ab6});if(_0x522c81>=0x0){logger[_0x3cb2('0x14')](_0x3cb2('0x19'),_0x1dfb62,_0x571ab6||'next',_0x522c81);_0x19d284[_0x3cb2('0x17')](_0x522c81);}else{logger[_0x3cb2('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1dfb62,_0x571ab6||_0x3cb2('0x17'));_0x19d284[_0x3cb2('0x11')]();}}else{_0x19d284[_0x3cb2('0x17')]();}}catch(_0x179037){logger[_0x3cb2('0xc')](_0x3cb2('0x1a'),_0x1dfb62,_0x179037['message']);_0x19d284['stop']();}}}catch(_0x3bc10c){logger['error'](_0x3cb2('0xd'),_0x1dfb62,JSON[_0x3cb2('0x1b')](_0x3bc10c));_0x19d284[_0x3cb2('0x11')]();}};}; \ No newline at end of file +var _0x130e=['info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20%s','validate','lodash','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','length','error','map','message','stop','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','rules'];(function(_0xc5ad9f,_0x18e206){var _0x5c2bcc=function(_0x284b50){while(--_0x284b50){_0xc5ad9f['push'](_0xc5ad9f['shift']());}};_0x5c2bcc(++_0x18e206);}(_0x130e,0x12f));var _0xe130=function(_0x4ec243,_0x2c8649){_0x4ec243=_0x4ec243-0x0;var _0x12cf05=_0x130e[_0x4ec243];return _0x12cf05;};'use strict';var schema=require(_0xe130('0x0'));var _=require(_0xe130('0x1'));var htmlToText=require(_0xe130('0x2'));var utils=require('./utils');var logger=require(_0xe130('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xe130('0x4'),'required':!![],'message':_0xe130('0x5')},'priorityTrue':{'type':'number','message':_0xe130('0x6')},'priorityFalse':{'type':'number','message':_0xe130('0x7')}});exports[_0xe130('0x8')]=function(_0x5be7a2,_0x4780f7){return function(_0x374b73){try{var _0x13745c={'condition':htmlToText[_0xe130('0x9')](utils['getMustacheRender'](_0x4780f7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4780f7[0x1],'priorityFalse':_0x4780f7[0x2]};var _0x28be4b=gotoif['validate'](_0x13745c,{'typecast':!![]});if(_0x28be4b[_0xe130('0xa')]){logger[_0xe130('0xb')]('[%s][GOTOIF]\x20%s',_0x5be7a2,_[_0xe130('0xc')](_0x28be4b,_0xe130('0xd'))['join'](',\x20'));_0x374b73[_0xe130('0xe')]();}else{try{var _0xb0efef=eval('('+_0x13745c['condition']+')');var _0x57c94a=_0xb0efef?_0x13745c['priorityTrue']:_0x13745c[_0xe130('0xf')];logger['info'](_0xe130('0x10'),_0x5be7a2,_0x13745c[_0xe130('0x11')],_0xb0efef,_0x57c94a||'next');if(_0x57c94a){var _0x19b8a6=_['findIndex'](_0x374b73[_0xe130('0x12')](),{'p':_0x57c94a});if(_0x19b8a6>=0x0){logger[_0xe130('0x13')](_0xe130('0x14'),_0x5be7a2,_0x57c94a||_0xe130('0x15'),_0x19b8a6);_0x374b73[_0xe130('0x15')](_0x19b8a6);}else{logger[_0xe130('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5be7a2,_0x57c94a||_0xe130('0x15'));_0x374b73[_0xe130('0xe')]();}}else{_0x374b73[_0xe130('0x15')]();}}catch(_0x29408c){logger[_0xe130('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5be7a2,_0x29408c[_0xe130('0xd')]);_0x374b73['stop']();}}}catch(_0x52f9c2){logger[_0xe130('0xb')](_0xe130('0x16'),_0x5be7a2,JSON['stringify'](_0x52f9c2));_0x374b73[_0xe130('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 26854f5..708a86a 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 _0x6f35=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','lodash','../../../../config/logger','routing','number'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6f35,0x18b));var _0x56f3=function(_0x4280e0,_0x5d0fcc){_0x4280e0=_0x4280e0-0x0;var _0x391ef8=_0x6f35[_0x4280e0];return _0x391ef8;};'use strict';var schema=require('validate');var _=require(_0x56f3('0x0'));var logger=require(_0x56f3('0x1'))(_0x56f3('0x2'));var gotop=schema({'priority':{'type':_0x56f3('0x3'),'required':!![],'message':_0x56f3('0x4')}});exports[_0x56f3('0x5')]=function(_0x30176b,_0x4deae6){return function(_0x349db5){try{var _0x2a1d4d={'priority':_0x4deae6[0x0]};var _0x11b8c3=gotop[_0x56f3('0x6')](_0x2a1d4d,{'typecast':!![]});if(_0x11b8c3[_0x56f3('0x7')]){logger[_0x56f3('0x8')](_0x56f3('0x9'),_0x30176b,_[_0x56f3('0xa')](_0x11b8c3,'message')['join'](',\x20'));_0x349db5[_0x56f3('0xb')]();}else{logger['info'](_0x56f3('0xc'),_0x30176b,_0x2a1d4d[_0x56f3('0xd')]);if(_0x2a1d4d[_0x56f3('0xd')]){var _0x33fc2b=_[_0x56f3('0xe')](_0x349db5[_0x56f3('0xf')](),{'p':_0x2a1d4d['priority']});if(_0x33fc2b>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x30176b,_0x2a1d4d[_0x56f3('0xd')]||_0x56f3('0x10'),_0x33fc2b);_0x349db5[_0x56f3('0x10')](_0x33fc2b);}else{logger[_0x56f3('0x11')](_0x56f3('0x12'),_0x30176b,_0x2a1d4d[_0x56f3('0xd')]||_0x56f3('0x10'));_0x349db5[_0x56f3('0xb')]();}}else{_0x349db5[_0x56f3('0x10')]();}}}catch(_0x229d99){logger[_0x56f3('0x8')](_0x56f3('0x9'),_0x30176b,JSON['stringify'](_0x229d99));_0x349db5[_0x56f3('0xb')]();}};}; \ No newline at end of file +var _0x06d3=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x06d3,0xc0));var _0x306d=function(_0x396217,_0x211b61){_0x396217=_0x396217-0x0;var _0x206d00=_0x06d3[_0x396217];return _0x206d00;};'use strict';var schema=require('validate');var _=require(_0x306d('0x0'));var logger=require(_0x306d('0x1'))(_0x306d('0x2'));var gotop=schema({'priority':{'type':_0x306d('0x3'),'required':!![],'message':_0x306d('0x4')}});exports[_0x306d('0x5')]=function(_0x23fba2,_0x46c9c1){return function(_0xc11b29){try{var _0x1aa6dd={'priority':_0x46c9c1[0x0]};var _0x55d170=gotop[_0x306d('0x6')](_0x1aa6dd,{'typecast':!![]});if(_0x55d170[_0x306d('0x7')]){logger[_0x306d('0x8')](_0x306d('0x9'),_0x23fba2,_['map'](_0x55d170,'message')[_0x306d('0xa')](',\x20'));_0xc11b29['stop']();}else{logger[_0x306d('0xb')](_0x306d('0xc'),_0x23fba2,_0x1aa6dd[_0x306d('0xd')]);if(_0x1aa6dd[_0x306d('0xd')]){var _0x5b4c2a=_[_0x306d('0xe')](_0xc11b29[_0x306d('0xf')](),{'p':_0x1aa6dd[_0x306d('0xd')]});if(_0x5b4c2a>=0x0){logger[_0x306d('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x23fba2,_0x1aa6dd[_0x306d('0xd')]||_0x306d('0x10'),_0x5b4c2a);_0xc11b29[_0x306d('0x10')](_0x5b4c2a);}else{logger[_0x306d('0xb')](_0x306d('0x11'),_0x23fba2,_0x1aa6dd[_0x306d('0xd')]||'next');_0xc11b29[_0x306d('0x12')]();}}else{_0xc11b29[_0x306d('0x10')]();}}}catch(_0x2de7f4){logger[_0x306d('0x8')](_0x306d('0x9'),_0x23fba2,JSON['stringify'](_0x2de7f4));_0xc11b29['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 ea54467..20efef6 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 _0x1804=['interaction','Message','create','then','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId'];(function(_0x2631ab,_0x346ea4){var _0x36dca1=function(_0x24a2a8){while(--_0x24a2a8){_0x2631ab['push'](_0x2631ab['shift']());}};_0x36dca1(++_0x346ea4);}(_0x1804,0x113));var _0x4180=function(_0x405814,_0x5bfd40){_0x405814=_0x405814-0x0;var _0x5d0068=_0x1804[_0x405814];return _0x5d0068;};'use strict';var _=require('lodash');var utils=require(_0x4180('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x4180('0x1')),'openchannelMessage':require(_0x4180('0x2')),'mailMessage':require(_0x4180('0x3')),'smsMessage':require(_0x4180('0x4')),'faxMessage':require(_0x4180('0x5'))};exports['consequence']=function(_0x835461,_0x22cd9d){return function(_0x2e1fa2){try{var _0x427558={'body':utils[_0x4180('0x6')](_0x22cd9d[0x0],this),'ContactId':this['contact']['id']};if(this[_0x4180('0x7')]===_0x4180('0x8')){_0x427558[_0x4180('0x9')]=this['account']['id'];}else{_0x427558[_['upperFirst'](this[_0x4180('0x7')])+'AccountId']=this[_0x4180('0xa')]['id'];}_0x427558[_[_0x4180('0xb')](this[_0x4180('0x7')])+_0x4180('0xc')]=this[_0x4180('0xd')]['id'];if(rpc[this[_0x4180('0x7')]+_0x4180('0xe')]){return rpc[this['channel']+'Message'][_0x4180('0xf')](_0x427558)[_0x4180('0x10')](function(_0x43c0c5){logger['info']('[%s][MESSAGE]\x20%s',_0x835461,_0x427558[_0x4180('0x11')]);_0x2e1fa2[_0x4180('0x12')]();})[_0x4180('0x13')](function(_0x9134c5){logger[_0x4180('0x14')](_0x4180('0x15'),_0x835461,JSON[_0x4180('0x16')](_0x9134c5));_0x2e1fa2[_0x4180('0x17')]();});}}catch(_0x49bd4a){logger[_0x4180('0x14')]('[%s][MESSAGE]\x20%s',_0x835461,JSON[_0x4180('0x16')](_0x49bd4a));_0x2e1fa2[_0x4180('0x17')]();}};}; \ No newline at end of file +var _0x5421=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','next','error','[%s][MESSAGE]\x20%s','stringify','stop'];(function(_0x3c3830,_0x47c5d1){var _0x52f384=function(_0x579d93){while(--_0x579d93){_0x3c3830['push'](_0x3c3830['shift']());}};_0x52f384(++_0x47c5d1);}(_0x5421,0xd8));var _0x1542=function(_0x2b79f4,_0x50d267){_0x2b79f4=_0x2b79f4-0x0;var _0x111a9c=_0x5421[_0x2b79f4];return _0x111a9c;};'use strict';var _=require('lodash');var utils=require(_0x1542('0x0'));var logger=require(_0x1542('0x1'))(_0x1542('0x2'));var rpc={'chatMessage':require(_0x1542('0x3')),'openchannelMessage':require(_0x1542('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1542('0x5')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x1542('0x6')]=function(_0x25380d,_0x3a867f){return function(_0x412de8){try{var _0x4c33d5={'body':utils[_0x1542('0x7')](_0x3a867f[0x0],this),'ContactId':this[_0x1542('0x8')]['id']};if(this[_0x1542('0x9')]===_0x1542('0xa')){_0x4c33d5[_0x1542('0xb')]=this[_0x1542('0xc')]['id'];}else{_0x4c33d5[_['upperFirst'](this[_0x1542('0x9')])+'AccountId']=this[_0x1542('0xc')]['id'];}_0x4c33d5[_[_0x1542('0xd')](this[_0x1542('0x9')])+_0x1542('0xe')]=this[_0x1542('0xf')]['id'];if(rpc[this[_0x1542('0x9')]+_0x1542('0x10')]){return rpc[this['channel']+_0x1542('0x10')][_0x1542('0x11')](_0x4c33d5)[_0x1542('0x12')](function(_0x3064ad){logger['info']('[%s][MESSAGE]\x20%s',_0x25380d,_0x4c33d5['body']);_0x412de8[_0x1542('0x13')]();})['catch'](function(_0x504f3a){logger[_0x1542('0x14')](_0x1542('0x15'),_0x25380d,JSON[_0x1542('0x16')](_0x504f3a));_0x412de8[_0x1542('0x17')]();});}}catch(_0x42b842){logger[_0x1542('0x14')](_0x1542('0x15'),_0x25380d,JSON[_0x1542('0x16')](_0x42b842));_0x412de8[_0x1542('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 9761532..719de6d 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 _0x1a1f=['stringify','stop','./utils','../../../../config/logger','routing','info','next','error'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x1a1f,0x112));var _0xf1a1=function(_0xee268f,_0x12dcca){_0xee268f=_0xee268f-0x0;var _0x3590c4=_0x1a1f[_0xee268f];return _0x3590c4;};'use strict';var utils=require(_0xf1a1('0x0'));var logger=require(_0xf1a1('0x1'))(_0xf1a1('0x2'));exports['consequence']=function(_0xf68d77,_0x54afd7){return function(_0x34f701){try{logger[_0xf1a1('0x3')]('[%s][NOOP]\x20%s',_0xf68d77,utils['getMustacheRender'](_0x54afd7[0x0],this));_0x34f701[_0xf1a1('0x4')]();}catch(_0x5d953a){logger[_0xf1a1('0x5')]('[%s][NOOP]\x20%s',_0xf68d77,JSON[_0xf1a1('0x6')](_0x5d953a));_0x34f701[_0xf1a1('0x7')]();}};}; \ No newline at end of file +var _0xaab4=['[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x526818,_0x30c916){var _0x44c7e3=function(_0x364d90){while(--_0x364d90){_0x526818['push'](_0x526818['shift']());}};_0x44c7e3(++_0x30c916);}(_0xaab4,0x16c));var _0x4aab=function(_0x58299b,_0x4f5b09){_0x58299b=_0x58299b-0x0;var _0x49f0f1=_0xaab4[_0x58299b];return _0x49f0f1;};'use strict';var utils=require(_0x4aab('0x0'));var logger=require(_0x4aab('0x1'))(_0x4aab('0x2'));exports[_0x4aab('0x3')]=function(_0x1bad98,_0x44a3c3){return function(_0x1cfa07){try{logger[_0x4aab('0x4')](_0x4aab('0x5'),_0x1bad98,utils[_0x4aab('0x6')](_0x44a3c3[0x0],this));_0x1cfa07['next']();}catch(_0x503ec0){logger[_0x4aab('0x7')](_0x4aab('0x5'),_0x1bad98,JSON[_0x4aab('0x8')](_0x503ec0));_0x1cfa07['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d2f5bfb..5934249 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 _0x16fd=['queue','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','waiting','body','from','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','defaults','redis','socket.io-emitter','queue_id','account'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x16fd,0x1b5));var _0xd16f=function(_0x3f7861,_0x13619b){_0x3f7861=_0x3f7861-0x0;var _0x36fdae=_0x16fd[_0x3f7861];return _0x36fdae;};'use strict';var schema=require(_0xd16f('0x0'));var _=require('lodash');var util=require(_0xd16f('0x1'));var seqqueue=require(_0xd16f('0x2'));var moment=require(_0xd16f('0x3'));var Redis=require(_0xd16f('0x4'));var config=require(_0xd16f('0x5'));var logger=require('../../../../config/logger')(_0xd16f('0x6'));var strategy=require(_0xd16f('0x7'));config['redis']=_[_0xd16f('0x8')](config[_0xd16f('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xd16f('0xa'))(new Redis(config[_0xd16f('0x9')]));var attributes=['id',_0xd16f('0xb'),_0xd16f('0xc'),_0xd16f('0xd'),'from',_0xd16f('0xe')];function emit(_0x58d395,_0x323467,_0x5b4bd3){io['to'](_0x58d395)[_0xd16f('0xf')](_0x323467,_0x5b4bd3);}function emitChannelQueueInteraction(_0x5c4398,_0x1eafa9,_0x521b0d,_0xccd36e,_0x1293b0,_0x29c395,_0x3c4e25,_0x4cf221){_0x521b0d[_0xd16f('0xb')]=_0x4cf221;_0x521b0d['queue']=_0x1eafa9;_0x521b0d[_0xd16f('0xc')]=_0xccd36e;_0x521b0d['id']=_0x1293b0;if(_0x29c395){_0x3c4e25[util['format'](_0xd16f('0x10'),_0x5c4398)][_0x1293b0]=_[_0xd16f('0x11')](_0x521b0d,attributes);}else{delete _0x3c4e25[util['format'](_0xd16f('0x10'),_0x5c4398)][_0x1293b0];}emit(util['format']('%s:queue:%s',_0x5c4398,_0x1eafa9),util[_0xd16f('0x12')](_0xd16f('0x13'),_0x5c4398,_0x29c395?_0xd16f('0x14'):_0xd16f('0x15')),_[_0xd16f('0x11')](_0x521b0d,attributes));}var rpc={'openchannelQueueReport':require(_0xd16f('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xd16f('0x17')),'smsQueueReport':require(_0xd16f('0x18')),'faxQueueReport':require(_0xd16f('0x19'))};var queue=schema({'name':{'type':_0xd16f('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4f4dad,_0x530349,_0x5959f2,_0x5f0146){if(_0x4f4dad&&_0x530349&&_0x5959f2){_0x530349[_0xd16f('0x1b')]+=0x1;var _0x1eefc6={'uniqueid':_0x4f4dad,'from':_0x5959f2[_0xd16f('0x1c')]?_0x5959f2[_0xd16f('0x1c')][_0xd16f('0x1d')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5959f2['contact']?_0x5959f2[_0xd16f('0x1e')]['id']:null,'ListId':_0x5959f2[_0xd16f('0x1f')]?_0x5959f2['list']['id']:null};_0x1eefc6[_[_0xd16f('0x20')](_0x5959f2[_0xd16f('0x21')])+_0xd16f('0x22')]=_0x530349['id']||null;_0x1eefc6[_[_0xd16f('0x20')](_0x5959f2[_0xd16f('0x21')])+_0xd16f('0x23')]=_0x5959f2[_0xd16f('0x24')]?_0x5959f2[_0xd16f('0x24')]['id']:null;_0x1eefc6[_[_0xd16f('0x20')](_0x5959f2[_0xd16f('0x21')])+_0xd16f('0x25')]=_0x5959f2[_0xd16f('0x26')]?_0x5959f2[_0xd16f('0x26')]['id']:null;_0x1eefc6[_['upperFirst'](_0x5959f2[_0xd16f('0x21')])+(_0x5959f2[_0xd16f('0x21')]!==_0xd16f('0x27')?'AccountId':_0xd16f('0x28'))]=_0x5959f2[_0xd16f('0xc')]?_0x5959f2['account']['id']:null;logger[_0xd16f('0x29')](util[_0xd16f('0x12')](_0xd16f('0x2a'),_0x4f4dad,_0x530349[_0xd16f('0x2b')]));emitChannelQueueInteraction(_0x5959f2['channel'],_0x530349['name'],_0x1eefc6,_0x5959f2['account'][_0xd16f('0x2b')],_0x5959f2['message']['id'],!![],_0x5f0146,_0x530349['id']);if(rpc[_0x5959f2[_0xd16f('0x21')]+_0xd16f('0x2c')]){return rpc[_0x5959f2[_0xd16f('0x21')]+_0xd16f('0x2c')][_0xd16f('0x2d')](_0x1eefc6)[_0xd16f('0x2e')](function(_0x3e629d){logger[_0xd16f('0x2f')](_0xd16f('0x30'));});}}}function stopRouting(_0x568316,_0x4b9e5e,_0x54ef36,_0x592462){if(_0x568316&&_0x4b9e5e){_0x4b9e5e[_0xd16f('0x1b')]-=0x1;var _0x877676={'leaveAt':moment()[_0xd16f('0x12')](_0xd16f('0x31')),'acceptAt':moment()[_0xd16f('0x12')](_0xd16f('0x31')),'reason':_0xd16f('0x32')};logger['info'](util['format'](_0xd16f('0x33'),_0x568316,_0x4b9e5e[_0xd16f('0x2b')]));emitChannelQueueInteraction(_0x54ef36['channel'],_0x4b9e5e['name'],_0x54ef36['body'],_0x54ef36['account'][_0xd16f('0x2b')],_0x54ef36[_0xd16f('0x26')]['id'],![],_0x592462,_0x4b9e5e['id']);if(rpc[_0x54ef36['channel']+'QueueReport']){return rpc[_0x54ef36['channel']+_0xd16f('0x2c')][_0xd16f('0x34')](_0x568316,_0x877676)['catch'](function(_0x46c6ad){logger[_0xd16f('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x39347a,_0x7ac86,_0x16a85c,_0x55eec4){if(_0x39347a&&_0x7ac86){_0x7ac86['waiting']-=0x1;var _0x5e460b={'leaveAt':moment()[_0xd16f('0x12')](_0xd16f('0x31')),'exitAt':moment()[_0xd16f('0x12')](_0xd16f('0x31')),'reason':_0xd16f('0x35')};logger[_0xd16f('0x29')](util['format'](_0xd16f('0x36'),_0x39347a,_0x7ac86['name']));emitChannelQueueInteraction(_0x16a85c['channel'],_0x7ac86[_0xd16f('0x2b')],_0x16a85c[_0xd16f('0x1c')],_0x16a85c[_0xd16f('0xc')][_0xd16f('0x2b')],_0x16a85c[_0xd16f('0x26')]['id'],![],_0x55eec4);if(rpc[_0x16a85c[_0xd16f('0x21')]+_0xd16f('0x2c')]){return rpc[_0x16a85c['channel']+'QueueReport'][_0xd16f('0x34')](_0x39347a,_0x5e460b)[_0xd16f('0x2e')](function(_0x1b9f18){logger[_0xd16f('0x2f')](_0xd16f('0x37'));});}}}function handleFindQueue(_0x4ee2a3){return function(_0x29226){return _0x29226[_0xd16f('0x2b')][_0xd16f('0x38')]()===_0x4ee2a3[_0xd16f('0x38')]();};}exports[_0xd16f('0x39')]=function(_0x1bb548,_0x48ade4,_0x158824,_0xcbea97){return function(_0x7a5d30){try{var _0x2b0777={'name':_0x48ade4[0x0],'timeout':_0x48ade4[0x1]};var _0x338c87=queue[_0xd16f('0x0')](_0x2b0777,{'typecast':!![]});if(_0x338c87[_0xd16f('0x3a')]){logger[_0xd16f('0x2f')](_0xd16f('0x3b'),_0x1bb548,_['map'](_0x338c87,_0xd16f('0x26'))[_0xd16f('0x3c')](',\x20'));_0x7a5d30[_0xd16f('0x3d')]();}else{var _0x5e8b2a=_[_0xd16f('0x3e')](_0x158824[_0xcbea97[_0xd16f('0x21')]+_0xd16f('0x3f')],handleFindQueue(_0x2b0777[_0xd16f('0x2b')]));if(_0x5e8b2a){startRouting(_0x1bb548,_0x5e8b2a,_0xcbea97,_0x158824);var _0x464c8a=(_0x5e8b2a[_0xd16f('0x35')]||0xa)*0x3e8;var _0x4f922b=(_0x2b0777['timeout']||0x14)*0x3e8;var _0x5ab572,_0x4847cd;if(_0x464c8a>_0x4f922b){_0x4f922b=_0x464c8a;}var _0x328645=seqqueue['createQueue'](_0x464c8a);_0x328645['id']=_0x1bb548;_0x328645[_0xd16f('0x40')]=_0x464c8a;_0x328645['qtimeout']=_0x4f922b;_0x328645[_0xd16f('0x21')]=_0xcbea97[_0xd16f('0x21')];_0x158824[_0xd16f('0x41')][_0x1bb548]['on'](_0xd16f('0x42'),function(){stopRouting(_0x1bb548,_0x5e8b2a,_0xcbea97,_0x158824);_0x328645[_0xd16f('0x43')](!![]);clearTimeout(_0x5ab572);_0x5ab572=undefined;if(_0x158824[_0xd16f('0x41')][_0x1bb548]){delete _0x158824[_0xd16f('0x41')][_0x1bb548];}logger[_0xd16f('0x29')](_0xd16f('0x44'),_0x1bb548);_0x7a5d30['stop']();});_0x5ab572=setTimeout(function(){endRouting(_0x1bb548,_0x5e8b2a,_0xcbea97,_0x158824);clearTimeout(_0x5ab572);_0x328645[_0xd16f('0x43')](!![]);logger[_0xd16f('0x29')]('[%s][QUEUE]\x20ROUTING\x20END',_0x1bb548);_0x7a5d30[_0xd16f('0x45')]();},_0x4f922b);switch(_0x5e8b2a[_0xd16f('0x46')]){case _0xd16f('0x47'):strategy[_0xd16f('0x47')](_0x328645,_0x5e8b2a,_0x158824,_0xcbea97);break;default:strategy['beepall'](_0x328645,_0x5e8b2a,_0x158824,_0xcbea97);}}else{logger[_0xd16f('0x2f')](_0xd16f('0x48'),_0x1bb548,_0x2b0777[_0xd16f('0x2b')]);_0x7a5d30[_0xd16f('0x3d')]();}}}catch(_0x3f34e5){console[_0xd16f('0x49')](_0x3f34e5);logger[_0xd16f('0x2f')](_0xd16f('0x3b'),_0x1bb548,_0x3f34e5[_0xd16f('0x4a')]);_0x7a5d30[_0xd16f('0x3d')]();}};}; \ No newline at end of file +var _0x1518=['seq-queue','moment','ioredis','../../../../config/environment','defaults','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','%sQueuesWaitingInteractions','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','info','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','rrmemory','log','util'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x1518,0x1e2));var _0x8151=function(_0x3bbff3,_0x5ac1e4){_0x3bbff3=_0x3bbff3-0x0;var _0x475f75=_0x1518[_0x3bbff3];return _0x475f75;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8151('0x0'));var seqqueue=require(_0x8151('0x1'));var moment=require(_0x8151('0x2'));var Redis=require(_0x8151('0x3'));var config=require(_0x8151('0x4'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');config['redis']=_[_0x8151('0x5')](config[_0x8151('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x8151('0x7'))(new Redis(config['redis']));var attributes=['id',_0x8151('0x8'),_0x8151('0x9'),_0x8151('0xa'),_0x8151('0xb'),_0x8151('0xc')];function emit(_0x4ab160,_0x3cd289,_0x117ce2){io['to'](_0x4ab160)['emit'](_0x3cd289,_0x117ce2);}function emitChannelQueueInteraction(_0xa62bc3,_0x429911,_0x16faea,_0x162b52,_0x4306de,_0x47bee2,_0x527202,_0x1da52d){_0x16faea[_0x8151('0x8')]=_0x1da52d;_0x16faea[_0x8151('0xa')]=_0x429911;_0x16faea['account']=_0x162b52;_0x16faea['id']=_0x4306de;if(_0x47bee2){_0x527202[util['format'](_0x8151('0xd'),_0xa62bc3)][_0x4306de]=_['pick'](_0x16faea,attributes);}else{delete _0x527202[util[_0x8151('0xe')]('%sQueuesWaitingInteractions',_0xa62bc3)][_0x4306de];}emit(util[_0x8151('0xe')]('%s:queue:%s',_0xa62bc3,_0x429911),util['format'](_0x8151('0xf'),_0xa62bc3,_0x47bee2?_0x8151('0x10'):_0x8151('0x11')),_['pick'](_0x16faea,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8151('0x12')),'chatQueueReport':require(_0x8151('0x13')),'smsQueueReport':require(_0x8151('0x14')),'faxQueueReport':require(_0x8151('0x15'))};var queue=schema({'name':{'type':_0x8151('0x16'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8151('0x17'),'message':_0x8151('0x18')}});function startRouting(_0x4e0db8,_0xfa4b68,_0xe4bfbc,_0xfaffb){if(_0x4e0db8&&_0xfa4b68&&_0xe4bfbc){_0xfa4b68[_0x8151('0x19')]+=0x1;var _0x587f63={'uniqueid':_0x4e0db8,'from':_0xe4bfbc[_0x8151('0x1a')]?_0xe4bfbc[_0x8151('0x1a')][_0x8151('0xb')]:'','joinAt':moment()[_0x8151('0xe')](_0x8151('0x1b')),'ContactId':_0xe4bfbc[_0x8151('0x1c')]?_0xe4bfbc[_0x8151('0x1c')]['id']:null,'ListId':_0xe4bfbc[_0x8151('0x1d')]?_0xe4bfbc['list']['id']:null};_0x587f63[_[_0x8151('0x1e')](_0xe4bfbc['channel'])+_0x8151('0x1f')]=_0xfa4b68['id']||null;_0x587f63[_[_0x8151('0x1e')](_0xe4bfbc[_0x8151('0x20')])+_0x8151('0x21')]=_0xe4bfbc[_0x8151('0x22')]?_0xe4bfbc[_0x8151('0x22')]['id']:null;_0x587f63[_[_0x8151('0x1e')](_0xe4bfbc['channel'])+'MessageId']=_0xe4bfbc[_0x8151('0x23')]?_0xe4bfbc['message']['id']:null;_0x587f63[_[_0x8151('0x1e')](_0xe4bfbc[_0x8151('0x20')])+(_0xe4bfbc[_0x8151('0x20')]!==_0x8151('0x24')?_0x8151('0x25'):'WebsiteId')]=_0xe4bfbc[_0x8151('0x9')]?_0xe4bfbc[_0x8151('0x9')]['id']:null;logger['info'](util['format'](_0x8151('0x26'),_0x4e0db8,_0xfa4b68[_0x8151('0x27')]));emitChannelQueueInteraction(_0xe4bfbc[_0x8151('0x20')],_0xfa4b68[_0x8151('0x27')],_0x587f63,_0xe4bfbc[_0x8151('0x9')][_0x8151('0x27')],_0xe4bfbc[_0x8151('0x23')]['id'],!![],_0xfaffb,_0xfa4b68['id']);if(rpc[_0xe4bfbc['channel']+_0x8151('0x28')]){return rpc[_0xe4bfbc[_0x8151('0x20')]+_0x8151('0x28')][_0x8151('0x29')](_0x587f63)[_0x8151('0x2a')](function(_0x46f172){logger[_0x8151('0x2b')](_0x8151('0x2c'));});}}}function stopRouting(_0x1458aa,_0x3be10d,_0x501dd4,_0x51703b){if(_0x1458aa&&_0x3be10d){_0x3be10d[_0x8151('0x19')]-=0x1;var _0x4193f2={'leaveAt':moment()[_0x8151('0xe')](_0x8151('0x1b')),'acceptAt':moment()[_0x8151('0xe')](_0x8151('0x1b')),'reason':_0x8151('0x2d')};logger['info'](util[_0x8151('0xe')](_0x8151('0x2e'),_0x1458aa,_0x3be10d['name']));emitChannelQueueInteraction(_0x501dd4[_0x8151('0x20')],_0x3be10d[_0x8151('0x27')],_0x501dd4[_0x8151('0x1a')],_0x501dd4[_0x8151('0x9')][_0x8151('0x27')],_0x501dd4[_0x8151('0x23')]['id'],![],_0x51703b,_0x3be10d['id']);if(rpc[_0x501dd4['channel']+'QueueReport']){return rpc[_0x501dd4[_0x8151('0x20')]+_0x8151('0x28')][_0x8151('0x2f')](_0x1458aa,_0x4193f2)[_0x8151('0x2a')](function(_0x58b0b8){logger[_0x8151('0x2b')]('update\x20queue\x20report');});}}}function endRouting(_0x5d8fd2,_0x5acd60,_0xfab0bd,_0x1db2b0){if(_0x5d8fd2&&_0x5acd60){_0x5acd60[_0x8151('0x19')]-=0x1;var _0x4834df={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x8151('0xe')](_0x8151('0x1b')),'reason':_0x8151('0x30')};logger[_0x8151('0x31')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x5d8fd2,_0x5acd60[_0x8151('0x27')]));emitChannelQueueInteraction(_0xfab0bd['channel'],_0x5acd60[_0x8151('0x27')],_0xfab0bd['body'],_0xfab0bd[_0x8151('0x9')][_0x8151('0x27')],_0xfab0bd[_0x8151('0x23')]['id'],![],_0x1db2b0);if(rpc[_0xfab0bd['channel']+_0x8151('0x28')]){return rpc[_0xfab0bd[_0x8151('0x20')]+_0x8151('0x28')][_0x8151('0x2f')](_0x5d8fd2,_0x4834df)[_0x8151('0x2a')](function(_0x4529e9){logger[_0x8151('0x2b')](_0x8151('0x32'));});}}}function handleFindQueue(_0x1fda3f){return function(_0x28f542){return _0x28f542[_0x8151('0x27')][_0x8151('0x33')]()===_0x1fda3f[_0x8151('0x33')]();};}exports[_0x8151('0x34')]=function(_0x586b30,_0x159f5f,_0x5cfcc2,_0x47bed4){return function(_0x2e3cc5){try{var _0x5a7078={'name':_0x159f5f[0x0],'timeout':_0x159f5f[0x1]};var _0x3e96ae=queue['validate'](_0x5a7078,{'typecast':!![]});if(_0x3e96ae[_0x8151('0x35')]){logger['error'](_0x8151('0x36'),_0x586b30,_[_0x8151('0x37')](_0x3e96ae,_0x8151('0x23'))[_0x8151('0x38')](',\x20'));_0x2e3cc5[_0x8151('0x39')]();}else{var _0x2a2b12=_[_0x8151('0x3a')](_0x5cfcc2[_0x47bed4[_0x8151('0x20')]+_0x8151('0x3b')],handleFindQueue(_0x5a7078[_0x8151('0x27')]));if(_0x2a2b12){startRouting(_0x586b30,_0x2a2b12,_0x47bed4,_0x5cfcc2);var _0x1b7f59=(_0x2a2b12[_0x8151('0x30')]||0xa)*0x3e8;var _0x792a3e=(_0x5a7078[_0x8151('0x30')]||0x14)*0x3e8;var _0x22518f,_0x450595;if(_0x1b7f59>_0x792a3e){_0x792a3e=_0x1b7f59;}var _0x1a7ef4=seqqueue[_0x8151('0x3c')](_0x1b7f59);_0x1a7ef4['id']=_0x586b30;_0x1a7ef4[_0x8151('0x3d')]=_0x1b7f59;_0x1a7ef4['qtimeout']=_0x792a3e;_0x1a7ef4['channel']=_0x47bed4['channel'];_0x5cfcc2[_0x8151('0x3e')][_0x586b30]['on']('end',function(){stopRouting(_0x586b30,_0x2a2b12,_0x47bed4,_0x5cfcc2);_0x1a7ef4[_0x8151('0x3f')](!![]);clearTimeout(_0x22518f);_0x22518f=undefined;if(_0x5cfcc2[_0x8151('0x3e')][_0x586b30]){delete _0x5cfcc2['rules'][_0x586b30];}logger[_0x8151('0x31')](_0x8151('0x40'),_0x586b30);_0x2e3cc5[_0x8151('0x39')]();});_0x22518f=setTimeout(function(){endRouting(_0x586b30,_0x2a2b12,_0x47bed4,_0x5cfcc2);clearTimeout(_0x22518f);_0x1a7ef4[_0x8151('0x3f')](!![]);logger[_0x8151('0x31')](_0x8151('0x41'),_0x586b30);_0x2e3cc5[_0x8151('0x42')]();},_0x792a3e);switch(_0x2a2b12['strategy']){case _0x8151('0x43'):strategy[_0x8151('0x43')](_0x1a7ef4,_0x2a2b12,_0x5cfcc2,_0x47bed4);break;default:strategy['beepall'](_0x1a7ef4,_0x2a2b12,_0x5cfcc2,_0x47bed4);}}else{logger[_0x8151('0x2b')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x586b30,_0x5a7078[_0x8151('0x27')]);_0x2e3cc5[_0x8151('0x39')]();}}}catch(_0x1d076e){console[_0x8151('0x44')](_0x1d076e);logger[_0x8151('0x2b')]('[%s][QUEUE]\x20%s',_0x586b30,_0x1d076e['stack']);_0x2e3cc5[_0x8151('0x39')]();}};}; \ 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 6d7961a..b8fca2f 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 _0xdf01=['agent','push','handleRun','bind','handleTimeout','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','exports','lodash','./util','../../../../../config/logger','routing','squeue'];(function(_0x21b1e0,_0x59d6e4){var _0x18e44c=function(_0x1cbf5d){while(--_0x1cbf5d){_0x21b1e0['push'](_0x21b1e0['shift']());}};_0x18e44c(++_0x59d6e4);}(_0xdf01,0xdb));var _0x1df0=function(_0x4e9c51,_0x2f0a48){_0x4e9c51=_0x4e9c51-0x0;var _0x4f2bb2=_0xdf01[_0x4e9c51];return _0x4f2bb2;};'use strict';var _=require(_0x1df0('0x0'));var uuid=require('uuid');var util=require(_0x1df0('0x1'));var logger=require(_0x1df0('0x2'))(_0x1df0('0x3'));var Agent=function(_0x4aa9db,_0x1d0ccb,_0x249d27,_0x5465a3){this['notificationId']=uuid['v4']();this[_0x1df0('0x4')]=_0x4aa9db;this[_0x1df0('0x5')]=_0x1d0ccb;this['realtime']=_0x249d27;this[_0x1df0('0x3')]=_0x5465a3;this[_0x1df0('0x4')][_0x1df0('0x6')](this[_0x1df0('0x7')][_0x1df0('0x8')](this),this[_0x1df0('0x9')][_0x1df0('0x8')](this));this[_0x1df0('0x4')]['on']('timeout',this[_0x1df0('0x9')][_0x1df0('0x8')](this));this[_0x1df0('0x4')]['on']('drained',this['handleDrained'][_0x1df0('0x8')](this));};Agent[_0x1df0('0xa')][_0x1df0('0x6')]=function(){this[_0x1df0('0x4')][_0x1df0('0x6')](this[_0x1df0('0x7')][_0x1df0('0x8')](this),this[_0x1df0('0x9')][_0x1df0('0x8')](this));};Agent['prototype'][_0x1df0('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x1df0('0xa')][_0x1df0('0x7')]=function(_0x153596){logger[_0x1df0('0xc')](_0x1df0('0xd'),this['squeue']['id'],this[_0x1df0('0x5')]['id']);if(_['isNil'](this[_0x1df0('0xe')][_0x1df0('0xf')][this['agent']['id']])){logger[_0x1df0('0xc')](_0x1df0('0x10'),this[_0x1df0('0x4')]['id'],this[_0x1df0('0x5')]['id']);setTimeout(this[_0x1df0('0x6')][_0x1df0('0x8')](this),0x3e8);}else{if(this['routing'][_0x1df0('0x11')]||util[_0x1df0('0x12')](this['squeue']['id'],this[_0x1df0('0xe')]['agents'][this[_0x1df0('0x5')]['id']],this['squeue']['channel'],![])){this[_0x1df0('0xe')][_0x1df0('0xf')][this[_0x1df0('0x5')]['id']][_0x1df0('0x13')]=!![];this[_0x1df0('0xe')]['agents'][this[_0x1df0('0x5')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x1df0('0x14')],this[_0x1df0('0x4')]['id'],this['realtime']['agents'][this[_0x1df0('0x5')]['id']],null,this[_0x1df0('0x3')]);util[_0x1df0('0x15')](this[_0x1df0('0x4')]['id'],this['realtime'][_0x1df0('0xf')][this[_0x1df0('0x5')]['id']],_0x1df0('0x16')+(this[_0x1df0('0x3')][_0x1df0('0x11')]?_0x1df0('0x17'):''));}else{logger[_0x1df0('0xc')](_0x1df0('0x18'),this[_0x1df0('0x4')]['id'],this[_0x1df0('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x1df0('0xa')][_0x1df0('0x9')]=function(_0x5207ef){if(_['isNil'](this[_0x1df0('0xe')]['agents'][this[_0x1df0('0x5')]['id']])){return logger[_0x1df0('0xc')](_0x1df0('0x10'),this[_0x1df0('0x4')]['id'],this[_0x1df0('0x5')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x1df0('0x4')]['id'],this[_0x1df0('0x5')]['id']);util[_0x1df0('0x19')](this[_0x1df0('0x14')],this[_0x1df0('0x4')]['id'],this['realtime']['agents'][this[_0x1df0('0x5')]['id']],null,this[_0x1df0('0x3')]);this[_0x1df0('0xe')][_0x1df0('0xf')][this['agent']['id']][_0x1df0('0x13')]=![];this['realtime']['agents'][this[_0x1df0('0x5')]['id']]['busyQueue']=undefined;util[_0x1df0('0x15')](this[_0x1df0('0x4')]['id'],this[_0x1df0('0xe')][_0x1df0('0xf')][this[_0x1df0('0x5')]['id']],_0x5207ef?_0x1df0('0x1a'):'TIMEOUT');}if(!_0x5207ef){setTimeout(this['push'][_0x1df0('0x8')](this),0x3e8);}};function agent(_0x566d5d,_0x3fcbb7,_0x220c6d,_0x18b731){return new Agent(_0x566d5d,_0x3fcbb7,_0x220c6d,_0x18b731);}module[_0x1df0('0x1b')]=agent; \ No newline at end of file +var _0xfb0e=['realtime','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','squeue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfb0e,0xc1));var _0xefb0=function(_0xb7cb72,_0x19d391){_0xb7cb72=_0xb7cb72-0x0;var _0x4b7570=_0xfb0e[_0xb7cb72];return _0x4b7570;};'use strict';var _=require('lodash');var uuid=require(_0xefb0('0x0'));var util=require(_0xefb0('0x1'));var logger=require(_0xefb0('0x2'))(_0xefb0('0x3'));var Agent=function(_0x5ef7a3,_0x45ab99,_0x2ff6a9,_0x11096f){this['notificationId']=uuid['v4']();this[_0xefb0('0x4')]=_0x5ef7a3;this['agent']=_0x45ab99;this[_0xefb0('0x5')]=_0x2ff6a9;this[_0xefb0('0x3')]=_0x11096f;this[_0xefb0('0x4')][_0xefb0('0x6')](this['handleRun'][_0xefb0('0x7')](this),this[_0xefb0('0x8')]['bind'](this));this[_0xefb0('0x4')]['on']('timeout',this[_0xefb0('0x8')][_0xefb0('0x7')](this));this[_0xefb0('0x4')]['on'](_0xefb0('0x9'),this[_0xefb0('0xa')][_0xefb0('0x7')](this));};Agent[_0xefb0('0xb')][_0xefb0('0x6')]=function(){this[_0xefb0('0x4')]['push'](this[_0xefb0('0xc')]['bind'](this),this[_0xefb0('0x8')][_0xefb0('0x7')](this));};Agent[_0xefb0('0xb')]['handleDrained']=function(){this[_0xefb0('0x8')](!![]);};Agent[_0xefb0('0xb')][_0xefb0('0xc')]=function(_0x2447c8){logger[_0xefb0('0xd')](_0xefb0('0xe'),this[_0xefb0('0x4')]['id'],this[_0xefb0('0xf')]['id']);if(_['isNil'](this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']])){logger[_0xefb0('0xd')](_0xefb0('0x11'),this[_0xefb0('0x4')]['id'],this[_0xefb0('0xf')]['id']);setTimeout(this[_0xefb0('0x6')][_0xefb0('0x7')](this),0x3e8);}else{if(this['routing'][_0xefb0('0x12')]||util[_0xefb0('0x13')](this['squeue']['id'],this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']],this['squeue']['channel'],![])){this['realtime'][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']][_0xefb0('0x14')]=!![];this[_0xefb0('0x5')][_0xefb0('0x10')][this['agent']['id']][_0xefb0('0x15')]=undefined;util[_0xefb0('0x16')](this[_0xefb0('0x17')],this[_0xefb0('0x4')]['id'],this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']],null,this['routing']);util[_0xefb0('0x18')](this['squeue']['id'],this[_0xefb0('0x5')][_0xefb0('0x10')][this['agent']['id']],_0xefb0('0x19')+(this[_0xefb0('0x3')][_0xefb0('0x12')]?_0xefb0('0x1a'):''));}else{logger[_0xefb0('0xd')](_0xefb0('0x1b'),this[_0xefb0('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xefb0('0x6')][_0xefb0('0x7')](this),0x3e8);}}};Agent['prototype'][_0xefb0('0x8')]=function(_0x27b47e){if(_['isNil'](this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']])){return logger[_0xefb0('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);}else{logger['info'](_0xefb0('0x1c'),this[_0xefb0('0x4')]['id'],this[_0xefb0('0xf')]['id']);util[_0xefb0('0x1d')](this[_0xefb0('0x17')],this[_0xefb0('0x4')]['id'],this[_0xefb0('0x5')]['agents'][this[_0xefb0('0xf')]['id']],null,this[_0xefb0('0x3')]);this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']][_0xefb0('0x14')]=![];this[_0xefb0('0x5')][_0xefb0('0x10')][this[_0xefb0('0xf')]['id']][_0xefb0('0x15')]=undefined;util[_0xefb0('0x18')](this[_0xefb0('0x4')]['id'],this[_0xefb0('0x5')]['agents'][this[_0xefb0('0xf')]['id']],_0x27b47e?_0xefb0('0x1e'):_0xefb0('0x1f'));}if(!_0x27b47e){setTimeout(this[_0xefb0('0x6')][_0xefb0('0x7')](this),0x3e8);}};function agent(_0x502325,_0x44130e,_0x4a8842,_0x3b0a78){return new Agent(_0x502325,_0x44130e,_0x4a8842,_0x3b0a78);}module[_0xefb0('0x20')]=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 e94cf15..78624fd 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 _0x35d3=['notificationId','squeue','queue','routing','push','handleRun','bind','handleTimeout','timeout','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','RINGING','busy','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger'];(function(_0x109b43,_0x568597){var _0x470d66=function(_0x579adc){while(--_0x579adc){_0x109b43['push'](_0x109b43['shift']());}};_0x470d66(++_0x568597);}(_0x35d3,0xed));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x335d('0x0'));var uuid=require(_0x335d('0x1'));var util=require('./util');var logger=require(_0x335d('0x2'))('routing');var Beepall=function(_0x3031c2,_0x1cfa5c,_0x44c0b3,_0x5ec8cd){this[_0x335d('0x3')]=uuid['v4']();this[_0x335d('0x4')]=_0x3031c2;this[_0x335d('0x5')]=_0x1cfa5c;this['realtime']=_0x44c0b3;this[_0x335d('0x6')]=_0x5ec8cd;this[_0x335d('0x4')][_0x335d('0x7')](this[_0x335d('0x8')][_0x335d('0x9')](this),this[_0x335d('0xa')][_0x335d('0x9')](this));this[_0x335d('0x4')]['on'](_0x335d('0xb'),this[_0x335d('0xa')][_0x335d('0x9')](this));this[_0x335d('0x4')]['on']('drained',this['handleDrained']['bind'](this));};Beepall['prototype'][_0x335d('0x7')]=function(){this[_0x335d('0x4')][_0x335d('0x7')](this[_0x335d('0x8')]['bind'](this),this[_0x335d('0xa')][_0x335d('0x9')](this));};Beepall[_0x335d('0xc')]['handleDrained']=function(_0xcb54ee){this[_0x335d('0xa')](!![]);};Beepall[_0x335d('0xc')][_0x335d('0x8')]=function(_0x2ba193){var _0x4d2bee=!![];if(!_['isNil'](this[_0x335d('0x5')])&&!_[_0x335d('0xd')](this[_0x335d('0x5')][_0x335d('0xe')])&&this['queue']['Agents'][_0x335d('0xf')]>0x0){for(var _0x5bc346=0x0,_0x4fd157;_0x5bc3460x0){for(var _0x1224ba=0x0,_0x1a5214;_0x1224ba0x0&&_0x26b5e5[_0x4ad77f+_0xc61e('0x26')]>=_0x26b5e5[_0x4ad77f+_0xc61e('0x25')]){writeLog(_0xded5d3,_0x26b5e5,_0x4ad77f[_0xc61e('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xc61e('0x28')]=function(_0x4c1e97,_0x19e9e3,_0x266dda,_0x19fcda,_0x5583eb){return sendNotification(!![],_0x4c1e97,_0x19e9e3,_0x266dda,_0x19fcda,_0x5583eb);};exports[_0xc61e('0x29')]=function(_0x4ca876,_0x2a4655,_0x12223d,_0x5eb9d6,_0x61c00d){return sendNotification(![],_0x4ca876,_0x2a4655,_0x12223d,_0x5eb9d6,_0x61c00d);};exports[_0xc61e('0x2a')]=writeLog; \ No newline at end of file +var _0x095c=['toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','util','../utils','mustache','../../../../../config/environment','routing','redis','defaults','localhost','socket.io-emitter','emit','user:%s','user:save','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','error','format','[%s][QUEUE]\x20%s','message','save','info','isAgentAvailable','online','Pause','PAUSE','hasOwnProperty','Capacity'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x095c,0xc2));var _0xc095=function(_0x3dc463,_0x365277){_0x3dc463=_0x3dc463-0x0;var _0x53642a=_0x095c[_0x3dc463];return _0x53642a;};'use strict';var _=require('lodash');var util=require(_0xc095('0x0'));var utils=require(_0xc095('0x1'));var Mustache=require(_0xc095('0x2'));var Redis=require('ioredis');var config=require(_0xc095('0x3'));var logger=require('../../../../../config/logger')(_0xc095('0x4'));config[_0xc095('0x5')]=_[_0xc095('0x6')](config[_0xc095('0x5')],{'host':_0xc095('0x7'),'port':0x18eb});var io=require(_0xc095('0x8'))(new Redis(config[_0xc095('0x5')]));function emit(_0x6f6b62,_0x1cd9aa,_0xc8431f){io['to'](_0x6f6b62)[_0xc095('0x9')](_0x1cd9aa,_0xc8431f);}function sendNotification(_0x2b520f,_0x1d6ee6,_0x122e9e,_0x45829d,_0x22dddf,_0x55ac6c){io['to'](util['format'](_0xc095('0xa'),_0x45829d['name']))[_0xc095('0x9')](_0xc095('0xb'),_0x45829d);var _0x2cd19e=_0x55ac6c||{};var _0x4b0ff5=_0x122e9e[_0xc095('0xc')]('.');var _0x200e09={'uniqueid':_0x1d6ee6,'channel':_0x4b0ff5[0x0],'id':_0x4b0ff5[0x1],'title':_0x4b0ff5[0x0]+_0xc095('0xd'),'interactionId':_0x4b0ff5[0x2],'queue':_0x22dddf?_0x22dddf[_0xc095('0xe')]:null,'sound':_0x2cd19e[_0xc095('0xf')][_0xc095('0x10')],'shake':_0x2cd19e[_0xc095('0xf')][_0xc095('0x11')]};try{if(!_0x2cd19e[_0xc095('0x12')]){_0x2cd19e[_0xc095('0x12')]={};}if(_0x22dddf){_0x2cd19e[_0xc095('0x12')][_0xc095('0x13')]=_0x22dddf;}else if(_0x2cd19e[_0xc095('0x12')][_0xc095('0x13')]){delete _0x2cd19e[_0xc095('0x12')][_0xc095('0x13')];}_0x200e09[_0xc095('0x14')]=utils['getMustacheRender'](_0x2cd19e[_0xc095('0xf')][_0xc095('0x15')],_0x2cd19e);}catch(_0x22df6a){_0x200e09[_0xc095('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xc095('0x16')](util[_0xc095('0x17')](_0xc095('0x18'),_0x1d6ee6,_0x22df6a[_0xc095('0x19')]));}io['to'](util['format'](_0xc095('0xa'),_0x45829d[_0xc095('0xe')]))['emit'](util[_0xc095('0x17')]('notification:%s',_0x2b520f?_0xc095('0x1a'):'remove'),_0x200e09);}function writeLog(_0x595118,_0x70cb50,_0x32bb39){return logger[_0xc095('0x1b')](util[_0xc095('0x17')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x595118,_0x70cb50['name'],_0x32bb39));}exports[_0xc095('0x1c')]=function(_0x171502,_0x5dd53f,_0x58702c,_0x4025a2){if(_0x5dd53f['busy']){writeLog(_0x171502,_0x5dd53f,'BUSY');return![];}if(!_0x5dd53f[_0xc095('0x1d')]){writeLog(_0x171502,_0x5dd53f,'OFFLINE');return![];}if(_0x5dd53f[_0x58702c+_0xc095('0x1e')]){writeLog(_0x171502,_0x5dd53f,_0xc095('0x1f'));return![];}if(_0x4025a2&&_0x5dd53f['hasOwnProperty'](_0x58702c+'Capacity')&&_0x5dd53f[_0xc095('0x20')](_0x58702c+'CurrentCapacity')){if(_0x5dd53f[_0x58702c+'Capacity']>0x0&&_0x5dd53f[_0x58702c+'CurrentCapacity']>=_0x5dd53f[_0x58702c+_0xc095('0x21')]){writeLog(_0x171502,_0x5dd53f,_0x58702c[_0xc095('0x22')]()+_0xc095('0x23'));return![];}}return!![];};exports[_0xc095('0x24')]=function(_0x310674,_0x3a6220,_0x370d42,_0x4124dd,_0x4a8942){return sendNotification(!![],_0x310674,_0x3a6220,_0x370d42,_0x4124dd,_0x4a8942);};exports['hideNotification']=function(_0x23d4fc,_0x3533ac,_0x19445f,_0xf3b124,_0x301ee7){return sendNotification(![],_0x23d4fc,_0x3533ac,_0x19445f,_0xf3b124,_0x301ee7);};exports[_0xc095('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 ea4b8b6..8472e3f 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 _0xe61e=['map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','stringify','validate','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s'];(function(_0x515be2,_0x51b3ff){var _0x514679=function(_0x562c51){while(--_0x562c51){_0x515be2['push'](_0x515be2['shift']());}};_0x514679(++_0x51b3ff);}(_0xe61e,0x145));var _0xee61=function(_0x1d2ab4,_0x43f119){_0x1d2ab4=_0x1d2ab4-0x0;var _0xdd7a6a=_0xe61e[_0x1d2ab4];return _0xdd7a6a;};'use strict';var schema=require(_0xee61('0x0'));var sh=require(_0xee61('0x1'));var _=require(_0xee61('0x2'));var utils=require(_0xee61('0x3'));var logger=require('../../../../config/logger')(_0xee61('0x4'));var system=schema({'command':{'type':_0xee61('0x5'),'required':!![],'message':_0xee61('0x6')}});exports[_0xee61('0x7')]=function(_0x54a81f,_0x536ceb){return function(_0x35b31b){try{var _0x5ab09e={'command':_0x536ceb[0x0]};var _0x255691=system[_0xee61('0x0')](_0x5ab09e,{'typecast':!![]});if(_0x255691[_0xee61('0x8')]){logger[_0xee61('0x9')](_0xee61('0xa'),_0x54a81f,_[_0xee61('0xb')](_0x255691,_0xee61('0xc'))['join'](',\x20'));logger['info'](_0xee61('0xd'),_0x54a81f);_0x35b31b['next']();}else{var _0x454cc3=this;var _0x5a2e69=utils['getMustacheRender'](_0x536ceb[0x0],this);logger[_0xee61('0xe')](_0xee61('0xf'),_0x54a81f,_0x5a2e69);sh[_0xee61('0x10')](_[_0xee61('0x11')](_0x5a2e69),function(_0x268e1c,_0x5a446a){logger[_0xee61('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x54a81f,_0x268e1c);if(_0x268e1c==0x0){var _0x38eed2=_0x5a446a[_0xee61('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x536ceb[0x1])||_[_0xee61('0x13')](_0x536ceb[0x1])){logger[_0xee61('0xe')](_0xee61('0x14'),_0x54a81f);_0x454cc3['body'][_0x536ceb[0x1]]=_0x38eed2;}else{logger[_0xee61('0xe')](_0xee61('0x15'),_0x54a81f,_0x536ceb[0x1],_0x38eed2);_0x454cc3['body'][_0x536ceb[0x1]]=_0x38eed2;}}_0x35b31b[_0xee61('0x16')]();});}}catch(_0x81bedc){logger[_0xee61('0x9')](_0xee61('0xa'),_0x54a81f,_['isObject'](_0x81bedc)?JSON[_0xee61('0x17')](_0x81bedc):_0x81bedc);logger[_0xee61('0xe')](_0xee61('0xd'),_0x54a81f);_0x35b31b[_0xee61('0x16')]();}};}; \ No newline at end of file +var _0x80c7=['isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','join','next','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x2df387,_0x1d3ea1){var _0x3b1708=function(_0x49c05b){while(--_0x49c05b){_0x2df387['push'](_0x2df387['shift']());}};_0x3b1708(++_0x1d3ea1);}(_0x80c7,0x17e));var _0x780c=function(_0x56a85c,_0x5d304f){_0x56a85c=_0x56a85c-0x0;var _0x4038c0=_0x80c7[_0x56a85c];return _0x4038c0;};'use strict';var schema=require(_0x780c('0x0'));var sh=require(_0x780c('0x1'));var _=require(_0x780c('0x2'));var utils=require('./utils');var logger=require(_0x780c('0x3'))(_0x780c('0x4'));var system=schema({'command':{'type':_0x780c('0x5'),'required':!![],'message':_0x780c('0x6')}});exports[_0x780c('0x7')]=function(_0x5ef312,_0x2e84a3){return function(_0x27e0e8){try{var _0x39a601={'command':_0x2e84a3[0x0]};var _0xcfd688=system[_0x780c('0x0')](_0x39a601,{'typecast':!![]});if(_0xcfd688['length']){logger[_0x780c('0x8')]('[%s][SYSTEM]\x20%s',_0x5ef312,_[_0x780c('0x9')](_0xcfd688,_0x780c('0xa'))[_0x780c('0xb')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5ef312);_0x27e0e8[_0x780c('0xc')]();}else{var _0x55b739=this;var _0x208fb2=utils['getMustacheRender'](_0x2e84a3[0x0],this);logger[_0x780c('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5ef312,_0x208fb2);sh[_0x780c('0xe')](_[_0x780c('0xf')](_0x208fb2),function(_0x4f3c01,_0x5bdbfd){logger[_0x780c('0xd')](_0x780c('0x10'),_0x5ef312,_0x4f3c01);if(_0x4f3c01==0x0){var _0x23eba8=_0x5bdbfd[_0x780c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x780c('0x12')](_0x2e84a3[0x1])||_['isEmpty'](_0x2e84a3[0x1])){logger[_0x780c('0xd')](_0x780c('0x13'),_0x5ef312);_0x55b739[_0x780c('0x14')][_0x2e84a3[0x1]]=_0x23eba8;}else{logger[_0x780c('0xd')](_0x780c('0x15'),_0x5ef312,_0x2e84a3[0x1],_0x23eba8);_0x55b739[_0x780c('0x14')][_0x2e84a3[0x1]]=_0x23eba8;}}_0x27e0e8['next']();});}}catch(_0xeebe7a){logger[_0x780c('0x8')](_0x780c('0x16'),_0x5ef312,_['isObject'](_0xeebe7a)?JSON[_0x780c('0x17')](_0xeebe7a):_0xeebe7a);logger[_0x780c('0xd')](_0x780c('0x18'),_0x5ef312);_0x27e0e8[_0x780c('0xc')]();}};}; \ 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 7ae8082..4fb6deb 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x6dd3d1,_0x29f85c){var _0x1d3fc5=function(_0x2795e5){while(--_0x2795e5){_0x6dd3d1['push'](_0x6dd3d1['shift']());}};_0x1d3fc5(++_0x29f85c);}(_0x7a54,0x106));var _0x47a5=function(_0x142a3b,_0x54db39){_0x142a3b=_0x142a3b-0x0;var _0x5149a3=_0x7a54[_0x142a3b];return _0x5149a3;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x2ec53e,_0x59038e){var _0x3a42d0=function(_0x8dfc05){while(--_0x8dfc05){_0x2ec53e['push'](_0x2ec53e['shift']());}};_0x3a42d0(++_0x59038e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['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 69d58ba..5956f32 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 _0xf6d1=['mustache','lodash','exports','render','merge','contact','account','interaction','list'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6d1,0x99));var _0x1f6d=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xf6d1[_0x491a7f];return _0x3d8f44;};'use strict';var Mustache=require(_0x1f6d('0x0'));var _=require(_0x1f6d('0x1'));module[_0x1f6d('0x2')]={'getMustacheRender':function(_0xf2bf1f,_0x2133a6){return Mustache[_0x1f6d('0x3')](_0xf2bf1f,_[_0x1f6d('0x4')](_0x2133a6['body'],{'contact':_0x2133a6[_0x1f6d('0x5')],'message':_0x2133a6['message'],'account':_0x2133a6[_0x1f6d('0x6')],'interaction':_0x2133a6[_0x1f6d('0x7')],'list':_0x2133a6[_0x1f6d('0x8')]}))||'';}}; \ No newline at end of file +var _0xed8a=['render','merge','contact','message','list','mustache','lodash','exports'];(function(_0xf537d7,_0x2536df){var _0x17fe54=function(_0x5a7cbc){while(--_0x5a7cbc){_0xf537d7['push'](_0xf537d7['shift']());}};_0x17fe54(++_0x2536df);}(_0xed8a,0xc5));var _0xaed8=function(_0x5429a1,_0x4b414a){_0x5429a1=_0x5429a1-0x0;var _0x34bd43=_0xed8a[_0x5429a1];return _0x34bd43;};'use strict';var Mustache=require(_0xaed8('0x0'));var _=require(_0xaed8('0x1'));module[_0xaed8('0x2')]={'getMustacheRender':function(_0x43f9d1,_0x568d05){return Mustache[_0xaed8('0x3')](_0x43f9d1,_[_0xaed8('0x4')](_0x568d05['body'],{'contact':_0x568d05[_0xaed8('0x5')],'message':_0x568d05[_0xaed8('0x6')],'account':_0x568d05['account'],'interaction':_0x568d05['interaction'],'list':_0x568d05[_0xaed8('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 1766895..bdcf9cf 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 _0xe622=['slice','tag','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','rules','emit','end','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','agent','agents','busy','capacity','hasOwnProperty','CurrentCapacity','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','push','dialogflow','split'];(function(_0x52c3e1,_0x2107d0){var _0x4cf675=function(_0xb3ebbf){while(--_0xb3ebbf){_0x52c3e1['push'](_0x52c3e1['shift']());}};_0x4cf675(++_0x2107d0);}(_0xe622,0x8c));var _0x2e62=function(_0x125ee6,_0x3f3fb0){_0x125ee6=_0x125ee6-0x0;var _0xf5d534=_0xe622[_0x125ee6];return _0xf5d534;};'use strict';var _=require(_0x2e62('0x0'));var util=require('util');var path=require(_0x2e62('0x1'));var fs=require('fs');var jayson=require(_0x2e62('0x2'));var BPromise=require(_0x2e62('0x3'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x2e62('0x4'))(_0x2e62('0x5'));var rpc={'openchannelQueueReport':require(_0x2e62('0x6'))};var rpc={'openchannelQueueReport':require(_0x2e62('0x6')),'mailQueueReport':require(_0x2e62('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x2e62('0x8'))};var RuleEngine=require(_0x2e62('0x9'));function getId(_0x232dc0,_0x56a698,_0x3a6a18){return util[_0x2e62('0xa')]('%s.%s.%s',_0x232dc0,_0x56a698||0x0,_0x3a6a18||0x0);}function getIntervals(_0x3812eb,_0x374292){var _0x5d6186=[];if(!_[_0x2e62('0xb')](_0x374292[_0x2e62('0xc')])&&!_[_0x2e62('0xb')](_0x3812eb[_0x374292[_0x2e62('0xc')]])&&!_[_0x2e62('0xb')](_0x3812eb[_0x374292[_0x2e62('0xc')]][_0x2e62('0xd')])){_0x5d6186=_['map'](_0x3812eb[_0x374292[_0x2e62('0xc')]]['Intervals'],'interval');}else if(!_[_0x2e62('0xb')](_0x374292[_0x2e62('0xe')])){_0x5d6186=[_0x374292[_0x2e62('0xe')]];}return _0x5d6186;}exports[_0x2e62('0xf')]=function(_0x114712){_0x114712['rules']={};return new BPromise(function(_0x52fe8f,_0x272fc1){var _0x4eba3f={'Start':function(_0x39e26f){var _0x9d01e4=this;return new Promise(function(_0x2cd3be,_0x100025){if(_0x39e26f){try{var _0x1654b5=[];var _0x51fb04=getId(_0x39e26f[_0x2e62('0x10')],_0x39e26f[_0x2e62('0x11')]?_0x39e26f['message']['id']:0x0,_0x39e26f[_0x2e62('0x12')]?_0x39e26f[_0x2e62('0x12')]['id']:0x0);if(_0x39e26f[_0x2e62('0x13')]&&_[_0x2e62('0x14')](_0x39e26f['applications'])&&_0x39e26f[_0x2e62('0x13')][_0x2e62('0x15')]){for(var _0x325b05=0x0;_0x325b05<_0x39e26f[_0x2e62('0x13')]['length'];_0x325b05+=0x1){var _0x170774=_0x39e26f['applications'][_0x325b05];if(fs[_0x2e62('0x16')](path[_0x2e62('0x17')](__dirname,'applications',_0x170774[_0x2e62('0x18')]+_0x2e62('0x19')))){var _0x22ba18=[];switch(_0x170774['app'][_0x2e62('0x1a')]()){case _0x2e62('0x1b'):var _0x285b50=_0x170774[_0x2e62('0x1c')]['split'](',');_0x22ba18[_0x2e62('0x1d')](_0x285b50[0x0]);_0x22ba18[_0x2e62('0x1d')](_0x285b50['slice'](0x1,_0x285b50[_0x2e62('0x15')])[_0x2e62('0x17')](','));break;case _0x2e62('0x1e'):var _0x285b50=_0x170774[_0x2e62('0x1c')][_0x2e62('0x1f')](',');_0x22ba18[_0x2e62('0x1d')](_0x285b50[0x0]);_0x22ba18[_0x2e62('0x1d')](_0x285b50[0x1]);_0x22ba18[_0x2e62('0x1d')](_0x285b50[_0x2e62('0x20')](0x2,_0x285b50[_0x2e62('0x15')])['join'](','));break;case'amazonlex':var _0x285b50=_0x170774[_0x2e62('0x1c')][_0x2e62('0x1f')](',');_0x22ba18['push'](_0x285b50[0x0]);_0x22ba18['push'](_0x285b50[0x1]);_0x22ba18[_0x2e62('0x1d')](_0x285b50[0x2]);_0x22ba18[_0x2e62('0x1d')](_0x285b50[0x3]);_0x22ba18[_0x2e62('0x1d')](_0x285b50[_0x2e62('0x20')](0x4,_0x285b50[_0x2e62('0x15')])[_0x2e62('0x17')](','));break;case'message':_0x22ba18[_0x2e62('0x1d')](_0x170774[_0x2e62('0x1c')]);break;case _0x2e62('0x21'):_0x22ba18[_0x2e62('0x1d')](_0x170774['TagId']);_0x22ba18['push'](_0x170774[_0x2e62('0x1c')]);break;default:_0x22ba18=_[_0x2e62('0xb')](_0x170774[_0x2e62('0x1c')])?[]:_0x170774[_0x2e62('0x1c')][_0x2e62('0x1f')](',');}var _0x5235ca={'id':util[_0x2e62('0xa')](_0x2e62('0x22'),_0x51fb04,_0x170774['id'],_0x170774[_0x2e62('0x18')]),'condition':require(_0x2e62('0x23'))[_0x2e62('0x24')](_0x51fb04,getIntervals(_0x114712[_0x2e62('0x25')],_0x170774),_0x114712),'consequence':require(_0x2e62('0x26')+_0x170774[_0x2e62('0x18')])[_0x2e62('0x27')](_0x51fb04,_0x22ba18,_0x114712,_0x39e26f),'p':_0x170774[_0x2e62('0x28')]||0x0};logger['info'](_0x2e62('0x29'),_0x5235ca['id'],_0x2e62('0x2a'),getIntervals(_0x114712[_0x2e62('0x25')],_0x170774)[_0x2e62('0x17')]('\x20|\x20'));_0x1654b5[_0x2e62('0x1d')](_0x5235ca);}else{logger['error'](_0x2e62('0x2b'),path[_0x2e62('0x17')](__dirname,_0x2e62('0x13'),_0x170774[_0x2e62('0x18')]+_0x2e62('0x19')));}}_0x114712['rules'][_0x51fb04]=new RuleEngine(_0x1654b5);_0x114712['rules'][_0x51fb04][_0x2e62('0x2c')](_0x39e26f,function(_0x450c70){logger[_0x2e62('0x2d')]('Applications\x20executed',JSON[_0x2e62('0x2e')](_0x450c70[_0x2e62('0x2f')]));if(_0x114712[_0x2e62('0x30')][_0x51fb04]){_0x114712[_0x2e62('0x30')][_0x51fb04][_0x2e62('0x31')](_0x2e62('0x32'));}});return _0x2cd3be({'code':0xc8,'message':_0x39e26f});}else{logger[_0x2e62('0x2d')](_0x2e62('0x33'));return _0x2cd3be({'code':0xc8,'message':_0x39e26f});}}catch(_0x2da556){logger[_0x2e62('0x34')](_0x2da556['stack']);return _0x100025(_0x9d01e4[_0x2e62('0x34')](0x1f4,_0x2da556));}}return _0x100025(_0x2e62('0x35'));});},'AcceptMessage':function(_0x43a87a){var _0xc768ce=this;return new Promise(function(_0x37efdd,_0xd69259){if(_0x43a87a[_0x2e62('0x11')]&&_0x43a87a['message']['id']){try{var _0x273901=getId(_0x43a87a[_0x2e62('0x10')],_0x43a87a['message']?_0x43a87a[_0x2e62('0x11')]['id']:0x0,_0x43a87a[_0x2e62('0x12')]?_0x43a87a['interaction']['id']:0x0);if(_0x114712[_0x2e62('0x30')][_0x273901]){_0x114712[_0x2e62('0x30')][_0x273901][_0x2e62('0x31')](_0x2e62('0x32'));if(rpc[_0x43a87a[_0x2e62('0x10')]+_0x2e62('0x36')]){rpc[_0x43a87a[_0x2e62('0x10')]+_0x2e62('0x36')][_0x2e62('0x37')](_0x273901,{'UserId':_0x43a87a[_0x2e62('0x11')][_0x2e62('0x38')]})[_0x2e62('0x39')](function(_0x5517f7){logger['error']('error\x20update\x20queue\x20report');});}}return _0x37efdd({'code':0xc8,'message':_0x43a87a});}catch(_0x3ecd27){logger['error'](_0x3ecd27[_0x2e62('0x3a')]);return _0xd69259(_0xc768ce['error'](0x1f4,_0x3ecd27));}}logger[_0x2e62('0x34')]('message\x20is\x20empty');return _0xd69259(_0xc768ce[_0x2e62('0x34')](0x1f4,_0x2e62('0x3b')));});},'RejectMessage':function(_0x410740){var _0x36954d=this;return new Promise(function(_0x14a154,_0x5ac7da){if(_0x410740[_0x2e62('0x3c')]&&_0x410740[_0x2e62('0x3c')]['id']){try{if(_0x114712[_0x2e62('0x3d')][_0x410740[_0x2e62('0x3c')]['id']]){_0x114712['agents'][_0x410740[_0x2e62('0x3c')]['id']][_0x2e62('0x3e')]=![];_0x114712[_0x2e62('0x3d')][_0x410740[_0x2e62('0x3c')]['id']]['busyQueue']=undefined;}return _0x14a154({'code':0xc8,'message':_0x410740});}catch(_0x3a9903){logger[_0x2e62('0x34')](_0x3a9903[_0x2e62('0x3a')]);return _0x5ac7da(_0x36954d[_0x2e62('0x34')](0x1f4,_0x3a9903));}}logger['error'](_0x2e62('0x3b'));return _0x5ac7da(_0x36954d[_0x2e62('0x34')](0x1f4,_0x2e62('0x3b')));});},'AbandonInteraction':function(_0x41e8bb){var _0x30c1da=this;return new Promise(function(_0x43b5e5,_0x537d5b){if(_0x41e8bb[_0x2e62('0x10')]&&_0x41e8bb['interaction']&&_0x41e8bb[_0x2e62('0x12')]['id']){try{var _0x1d33a1=getId(_0x41e8bb[_0x2e62('0x10')],_0x41e8bb[_0x2e62('0x11')]?_0x41e8bb[_0x2e62('0x11')]['id']:0x0,_0x41e8bb[_0x2e62('0x12')]?_0x41e8bb[_0x2e62('0x12')]['id']:0x0);if(_0x114712[_0x2e62('0x30')][_0x1d33a1]){_0x114712[_0x2e62('0x30')][_0x1d33a1][_0x2e62('0x31')](_0x2e62('0x32'));}return _0x43b5e5({'code':0xc8,'message':_0x41e8bb});}catch(_0xb4dd26){logger['error'](_0xb4dd26[_0x2e62('0x3a')]);return _0x537d5b(_0x30c1da[_0x2e62('0x34')](0x1f4,_0xb4dd26));}}logger[_0x2e62('0x34')](_0x2e62('0x3b'));return _0x537d5b(_0x30c1da[_0x2e62('0x34')](0x1f4,_0x2e62('0x3b')));});},'AgentCapacity':function(_0x22a7fa){var _0xbd28d9=this;return new Promise(function(_0x494008,_0x53c37a){if(_0x114712[_0x2e62('0x3d')]['hasOwnProperty'](_0x22a7fa['id'])){for(var _0x24113d in _0x22a7fa[_0x2e62('0x3f')]){if(_0x22a7fa[_0x2e62('0x3f')][_0x2e62('0x40')](_0x24113d)){if(_0x114712['agents'][_0x22a7fa['id']][_0x2e62('0x40')](_0x24113d+_0x2e62('0x41'))){_0x114712[_0x2e62('0x3d')][_0x22a7fa['id']][_0x24113d+_0x2e62('0x41')]=parseInt(_0x22a7fa[_0x2e62('0x3f')][_0x24113d],0xa);}}}_0x114712[_0x2e62('0x3d')][_0x22a7fa['id']]['updateRealtime']();return _0x494008({'code':0xc8,'message':_0x114712[_0x2e62('0x3d')][_0x22a7fa['id']]});}else{return _0x53c37a(_0xbd28d9['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4bc80c){return new Promise(function(_0x47f194,_0xeefdbb){var _0xaf21b6=_[_0x2e62('0x42')](_0x114712['agents']);_0x47f194({'count':_0xaf21b6[_0x2e62('0x15')],'rows':_0xaf21b6});});},'ChatQueues':function(_0x5e8b5a){return new Promise(function(_0x14d3ba,_0x5173b1){var _0xd9748=[];for(var _0x5464b2 in _0x114712[_0x2e62('0x43')]){if(_0x114712[_0x2e62('0x43')]['hasOwnProperty'](_0x5464b2)){var _0x599a32=_0x114712['chatQueues'][_0x5464b2];var _0x44d0c7={'id':_0x599a32['id'],'available':_0x599a32[_0x2e62('0x44')],'loggedIn':_0x599a32[_0x2e62('0x45')],'name':_0x599a32[_0x2e62('0x46')],'paused':_0x599a32[_0x2e62('0x47')],'waiting':_0x599a32['waiting']};_0xd9748[_0x2e62('0x1d')](_0x44d0c7);}}_0x14d3ba({'count':_0xd9748[_0x2e62('0x15')],'rows':_0xd9748});});},'MailQueues':function(_0x3b4488){return new Promise(function(_0x48dd18,_0xdb4a49){var _0x2ee5fd=[];for(var _0x139896 in _0x114712[_0x2e62('0x48')]){if(_0x114712['mailQueues']['hasOwnProperty'](_0x139896)){var _0x24487e=_0x114712['mailQueues'][_0x139896];var _0x1cc025={'id':_0x24487e['id'],'available':_0x24487e['available'],'loggedIn':_0x24487e[_0x2e62('0x45')],'name':_0x24487e[_0x2e62('0x46')],'paused':_0x24487e[_0x2e62('0x47')],'waiting':_0x24487e[_0x2e62('0x49')]};_0x2ee5fd[_0x2e62('0x1d')](_0x1cc025);}}_0x48dd18({'count':_0x2ee5fd[_0x2e62('0x15')],'rows':_0x2ee5fd});});},'OpenchannelQueues':function(_0x48d3fa){return new Promise(function(_0x1cbf9d,_0x219cab){var _0x56d8cb=[];for(var _0x477e33 in _0x114712[_0x2e62('0x4a')]){if(_0x114712['openchannelQueues']['hasOwnProperty'](_0x477e33)){var _0xb8143b=_0x114712['openchannelQueues'][_0x477e33];var _0x2e298d={'id':_0xb8143b['id'],'available':_0xb8143b[_0x2e62('0x44')],'loggedIn':_0xb8143b[_0x2e62('0x45')],'name':_0xb8143b[_0x2e62('0x46')],'paused':_0xb8143b[_0x2e62('0x47')],'waiting':_0xb8143b['waiting']};_0x56d8cb[_0x2e62('0x1d')](_0x2e298d);}}_0x1cbf9d({'count':_0x56d8cb[_0x2e62('0x15')],'rows':_0x56d8cb});});},'SmsQueues':function(_0x3c59e5){return new Promise(function(_0x24d1cf,_0x235350){var _0xb7ca56=[];for(var _0x5e781b in _0x114712[_0x2e62('0x4b')]){if(_0x114712[_0x2e62('0x4b')][_0x2e62('0x40')](_0x5e781b)){var _0x130a55=_0x114712[_0x2e62('0x4b')][_0x5e781b];var _0x99eedd={'id':_0x130a55['id'],'available':_0x130a55[_0x2e62('0x44')],'loggedIn':_0x130a55[_0x2e62('0x45')],'name':_0x130a55['name'],'paused':_0x130a55['paused'],'waiting':_0x130a55[_0x2e62('0x49')]};_0xb7ca56[_0x2e62('0x1d')](_0x99eedd);}}_0x24d1cf({'count':_0xb7ca56[_0x2e62('0x15')],'rows':_0xb7ca56});});},'FaxQueues':function(_0x4db47e){return new Promise(function(_0x762d9a,_0x1e633c){var _0x806a1b=[];for(var _0x50fe4f in _0x114712[_0x2e62('0x4c')]){if(_0x114712[_0x2e62('0x4c')][_0x2e62('0x40')](_0x50fe4f)){var _0x272f5d=_0x114712['faxQueues'][_0x50fe4f];var _0x318bc9={'id':_0x272f5d['id'],'available':_0x272f5d[_0x2e62('0x44')],'loggedIn':_0x272f5d[_0x2e62('0x45')],'name':_0x272f5d[_0x2e62('0x46')],'paused':_0x272f5d[_0x2e62('0x47')],'waiting':_0x272f5d[_0x2e62('0x49')]};_0x806a1b[_0x2e62('0x1d')](_0x318bc9);}}_0x762d9a({'count':_0x806a1b['length'],'rows':_0x806a1b});});},'ChatQueuesWaitingInteractions':function(_0x4b6f32){return new Promise(function(_0x15f9bd,_0x3c7126){var _0x4d12a3=_[_0x2e62('0x42')](_0x114712['chatQueuesWaitingInteractions']);_0x15f9bd({'count':_0x4d12a3[_0x2e62('0x15')],'rows':_0x4d12a3});});},'MailQueuesWaitingInteractions':function(_0x2e1041){return new Promise(function(_0x594f56,_0x497871){var _0xb435c6=_[_0x2e62('0x42')](_0x114712[_0x2e62('0x4d')]);_0x594f56({'count':_0xb435c6[_0x2e62('0x15')],'rows':_0xb435c6});});},'OpenchannelQueuesWaitingInteractions':function(_0x36d2ec){return new Promise(function(_0x4ebf01,_0x579e08){var _0x39ae33=_[_0x2e62('0x42')](_0x114712[_0x2e62('0x4e')]);_0x4ebf01({'count':_0x39ae33['length'],'rows':_0x39ae33});});},'SmsQueuesWaitingInteractions':function(_0x5e1f0a){return new Promise(function(_0x16f4d7,_0x3e69d6){var _0x2b56e7=_[_0x2e62('0x42')](_0x114712[_0x2e62('0x4f')]);_0x16f4d7({'count':_0x2b56e7['length'],'rows':_0x2b56e7});});},'FaxQueuesWaitingInteractions':function(_0x4cde9c){return new Promise(function(_0x3fe24a,_0x51ca78){var _0xcfdcac=_['values'](_0x114712[_0x2e62('0x50')]);_0x3fe24a({'count':_0xcfdcac[_0x2e62('0x15')],'rows':_0xcfdcac});});}};var _0x40e6dd=jayson[_0x2e62('0x51')](_0x4eba3f)[_0x2e62('0x52')]();_0x40e6dd['on'](_0x2e62('0x34'),function(_0x3ce7ee){logger[_0x2e62('0x34')](JSON['stringify'](_0x3ce7ee));return _0x272fc1(_0x3ce7ee);});_0x40e6dd[_0x2e62('0xf')](0x232c,_0x2e62('0x53'),function(){console[_0x2e62('0x54')](_0x2e62('0x55'),0x232c);return _0x52fe8f('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x8fdd=['available','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','listen','127.0.0.1','lodash','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','IntervalId','isNil','Intervals','map','interval','channel','message','interaction','isArray','applications','length','existsSync','.js','app','autoreply','appdata','split','slice','join','dialogflow','push','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','info','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues'];(function(_0x4f18d1,_0x5b05af){var _0x2e9551=function(_0x557ef6){while(--_0x557ef6){_0x4f18d1['push'](_0x4f18d1['shift']());}};_0x2e9551(++_0x5b05af);}(_0x8fdd,0x10b));var _0xd8fd=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0x8fdd[_0x2803ab];return _0x3d6e8e;};'use strict';var _=require(_0xd8fd('0x0'));var util=require('util');var path=require(_0xd8fd('0x1'));var fs=require('fs');var jayson=require(_0xd8fd('0x2'));var BPromise=require('bluebird');var uuid=require(_0xd8fd('0x3'));var config=require(_0xd8fd('0x4'));var logger=require(_0xd8fd('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xd8fd('0x6'))};var rpc={'openchannelQueueReport':require(_0xd8fd('0x6')),'mailQueueReport':require(_0xd8fd('0x7')),'chatQueueReport':require(_0xd8fd('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd8fd('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x572c4a,_0x3ceeea,_0x387784){return util[_0xd8fd('0xa')]('%s.%s.%s',_0x572c4a,_0x3ceeea||0x0,_0x387784||0x0);}function getIntervals(_0xbbd144,_0x598e7b){var _0x223666=[];if(!_['isNil'](_0x598e7b[_0xd8fd('0xb')])&&!_[_0xd8fd('0xc')](_0xbbd144[_0x598e7b[_0xd8fd('0xb')]])&&!_[_0xd8fd('0xc')](_0xbbd144[_0x598e7b[_0xd8fd('0xb')]][_0xd8fd('0xd')])){_0x223666=_[_0xd8fd('0xe')](_0xbbd144[_0x598e7b[_0xd8fd('0xb')]][_0xd8fd('0xd')],_0xd8fd('0xf'));}else if(!_[_0xd8fd('0xc')](_0x598e7b['interval'])){_0x223666=[_0x598e7b['interval']];}return _0x223666;}exports['listen']=function(_0x2b87bf){_0x2b87bf['rules']={};return new BPromise(function(_0x51214b,_0x41e54e){var _0x123bf5={'Start':function(_0xaba285){var _0x2f6089=this;return new Promise(function(_0x20e9df,_0x3ea428){if(_0xaba285){try{var _0x5607b8=[];var _0x4c3661=getId(_0xaba285[_0xd8fd('0x10')],_0xaba285[_0xd8fd('0x11')]?_0xaba285[_0xd8fd('0x11')]['id']:0x0,_0xaba285[_0xd8fd('0x12')]?_0xaba285[_0xd8fd('0x12')]['id']:0x0);if(_0xaba285['applications']&&_[_0xd8fd('0x13')](_0xaba285[_0xd8fd('0x14')])&&_0xaba285['applications'][_0xd8fd('0x15')]){for(var _0x543c94=0x0;_0x543c94<_0xaba285['applications']['length'];_0x543c94+=0x1){var _0x537268=_0xaba285[_0xd8fd('0x14')][_0x543c94];if(fs[_0xd8fd('0x16')](path['join'](__dirname,_0xd8fd('0x14'),_0x537268['app']+_0xd8fd('0x17')))){var _0x291c87=[];switch(_0x537268[_0xd8fd('0x18')]['toLowerCase']()){case _0xd8fd('0x19'):var _0x384997=_0x537268[_0xd8fd('0x1a')][_0xd8fd('0x1b')](',');_0x291c87['push'](_0x384997[0x0]);_0x291c87['push'](_0x384997[_0xd8fd('0x1c')](0x1,_0x384997[_0xd8fd('0x15')])[_0xd8fd('0x1d')](','));break;case _0xd8fd('0x1e'):var _0x384997=_0x537268[_0xd8fd('0x1a')][_0xd8fd('0x1b')](',');_0x291c87[_0xd8fd('0x1f')](_0x384997[0x0]);_0x291c87[_0xd8fd('0x1f')](_0x384997[0x1]);_0x291c87[_0xd8fd('0x1f')](_0x384997[_0xd8fd('0x1c')](0x2,_0x384997['length'])[_0xd8fd('0x1d')](','));break;case _0xd8fd('0x20'):var _0x384997=_0x537268[_0xd8fd('0x1a')][_0xd8fd('0x1b')](',');_0x291c87[_0xd8fd('0x1f')](_0x384997[0x0]);_0x291c87['push'](_0x384997[0x1]);_0x291c87[_0xd8fd('0x1f')](_0x384997[0x2]);_0x291c87['push'](_0x384997[0x3]);_0x291c87['push'](_0x384997['slice'](0x4,_0x384997['length'])[_0xd8fd('0x1d')](','));break;case'message':_0x291c87[_0xd8fd('0x1f')](_0x537268[_0xd8fd('0x1a')]);break;case _0xd8fd('0x21'):_0x291c87[_0xd8fd('0x1f')](_0x537268[_0xd8fd('0x22')]);_0x291c87[_0xd8fd('0x1f')](_0x537268[_0xd8fd('0x1a')]);break;default:_0x291c87=_['isNil'](_0x537268[_0xd8fd('0x1a')])?[]:_0x537268[_0xd8fd('0x1a')][_0xd8fd('0x1b')](',');}var _0x29f0c6={'id':util[_0xd8fd('0xa')](_0xd8fd('0x23'),_0x4c3661,_0x537268['id'],_0x537268[_0xd8fd('0x18')]),'condition':require(_0xd8fd('0x24'))[_0xd8fd('0x25')](_0x4c3661,getIntervals(_0x2b87bf[_0xd8fd('0x26')],_0x537268),_0x2b87bf),'consequence':require(_0xd8fd('0x27')+_0x537268[_0xd8fd('0x18')])[_0xd8fd('0x28')](_0x4c3661,_0x291c87,_0x2b87bf,_0xaba285),'p':_0x537268[_0xd8fd('0x29')]||0x0};logger['info']('Push\x20new\x20rule',_0x29f0c6['id'],_0xd8fd('0x2a'),getIntervals(_0x2b87bf[_0xd8fd('0x26')],_0x537268)[_0xd8fd('0x1d')](_0xd8fd('0x2b')));_0x5607b8[_0xd8fd('0x1f')](_0x29f0c6);}else{logger[_0xd8fd('0x2c')](_0xd8fd('0x2d'),path['join'](__dirname,_0xd8fd('0x14'),_0x537268['app']+_0xd8fd('0x17')));}}_0x2b87bf[_0xd8fd('0x2e')][_0x4c3661]=new RuleEngine(_0x5607b8);_0x2b87bf[_0xd8fd('0x2e')][_0x4c3661]['execute'](_0xaba285,function(_0x57a63a){logger[_0xd8fd('0x2f')]('Applications\x20executed',JSON[_0xd8fd('0x30')](_0x57a63a[_0xd8fd('0x31')]));if(_0x2b87bf[_0xd8fd('0x2e')][_0x4c3661]){_0x2b87bf['rules'][_0x4c3661][_0xd8fd('0x32')](_0xd8fd('0x33'));}});return _0x20e9df({'code':0xc8,'message':_0xaba285});}else{logger['info'](_0xd8fd('0x34'));return _0x20e9df({'code':0xc8,'message':_0xaba285});}}catch(_0x168ffa){logger[_0xd8fd('0x2c')](_0x168ffa[_0xd8fd('0x35')]);return _0x3ea428(_0x2f6089[_0xd8fd('0x2c')](0x1f4,_0x168ffa));}}return _0x3ea428(_0xd8fd('0x36'));});},'AcceptMessage':function(_0x16da03){var _0x42b81a=this;return new Promise(function(_0x13ea80,_0x298940){if(_0x16da03[_0xd8fd('0x11')]&&_0x16da03['message']['id']){try{var _0x13e45f=getId(_0x16da03[_0xd8fd('0x10')],_0x16da03[_0xd8fd('0x11')]?_0x16da03[_0xd8fd('0x11')]['id']:0x0,_0x16da03[_0xd8fd('0x12')]?_0x16da03[_0xd8fd('0x12')]['id']:0x0);if(_0x2b87bf['rules'][_0x13e45f]){_0x2b87bf['rules'][_0x13e45f]['emit'](_0xd8fd('0x33'));if(rpc[_0x16da03[_0xd8fd('0x10')]+'QueueReport']){rpc[_0x16da03[_0xd8fd('0x10')]+_0xd8fd('0x37')][_0xd8fd('0x38')](_0x13e45f,{'UserId':_0x16da03['message'][_0xd8fd('0x39')]})[_0xd8fd('0x3a')](function(_0xe87330){logger[_0xd8fd('0x2c')]('error\x20update\x20queue\x20report');});}}return _0x13ea80({'code':0xc8,'message':_0x16da03});}catch(_0x4f2690){logger[_0xd8fd('0x2c')](_0x4f2690['stack']);return _0x298940(_0x42b81a[_0xd8fd('0x2c')](0x1f4,_0x4f2690));}}logger['error']('message\x20is\x20empty');return _0x298940(_0x42b81a['error'](0x1f4,_0xd8fd('0x3b')));});},'RejectMessage':function(_0x3a1abe){var _0x91f8cb=this;return new Promise(function(_0x41fdcb,_0xaaa4d5){if(_0x3a1abe[_0xd8fd('0x3c')]&&_0x3a1abe['agent']['id']){try{if(_0x2b87bf[_0xd8fd('0x3d')][_0x3a1abe[_0xd8fd('0x3c')]['id']]){_0x2b87bf['agents'][_0x3a1abe['agent']['id']][_0xd8fd('0x3e')]=![];_0x2b87bf[_0xd8fd('0x3d')][_0x3a1abe[_0xd8fd('0x3c')]['id']][_0xd8fd('0x3f')]=undefined;}return _0x41fdcb({'code':0xc8,'message':_0x3a1abe});}catch(_0x595b13){logger[_0xd8fd('0x2c')](_0x595b13[_0xd8fd('0x35')]);return _0xaaa4d5(_0x91f8cb['error'](0x1f4,_0x595b13));}}logger[_0xd8fd('0x2c')](_0xd8fd('0x3b'));return _0xaaa4d5(_0x91f8cb[_0xd8fd('0x2c')](0x1f4,_0xd8fd('0x3b')));});},'AbandonInteraction':function(_0x453031){var _0x533ac6=this;return new Promise(function(_0x33c3a6,_0x84270b){if(_0x453031['channel']&&_0x453031[_0xd8fd('0x12')]&&_0x453031[_0xd8fd('0x12')]['id']){try{var _0x2d2f7f=getId(_0x453031[_0xd8fd('0x10')],_0x453031[_0xd8fd('0x11')]?_0x453031[_0xd8fd('0x11')]['id']:0x0,_0x453031['interaction']?_0x453031[_0xd8fd('0x12')]['id']:0x0);if(_0x2b87bf[_0xd8fd('0x2e')][_0x2d2f7f]){_0x2b87bf['rules'][_0x2d2f7f][_0xd8fd('0x32')]('end');}return _0x33c3a6({'code':0xc8,'message':_0x453031});}catch(_0x54193e){logger[_0xd8fd('0x2c')](_0x54193e[_0xd8fd('0x35')]);return _0x84270b(_0x533ac6[_0xd8fd('0x2c')](0x1f4,_0x54193e));}}logger[_0xd8fd('0x2c')](_0xd8fd('0x3b'));return _0x84270b(_0x533ac6[_0xd8fd('0x2c')](0x1f4,_0xd8fd('0x3b')));});},'AgentCapacity':function(_0x357594){var _0x138023=this;return new Promise(function(_0x4dc734,_0x525c70){if(_0x2b87bf['agents'][_0xd8fd('0x40')](_0x357594['id'])){for(var _0x53686b in _0x357594[_0xd8fd('0x41')]){if(_0x357594[_0xd8fd('0x41')][_0xd8fd('0x40')](_0x53686b)){if(_0x2b87bf[_0xd8fd('0x3d')][_0x357594['id']][_0xd8fd('0x40')](_0x53686b+'CurrentCapacity')){_0x2b87bf[_0xd8fd('0x3d')][_0x357594['id']][_0x53686b+_0xd8fd('0x42')]=parseInt(_0x357594[_0xd8fd('0x41')][_0x53686b],0xa);}}}_0x2b87bf[_0xd8fd('0x3d')][_0x357594['id']][_0xd8fd('0x43')]();return _0x4dc734({'code':0xc8,'message':_0x2b87bf[_0xd8fd('0x3d')][_0x357594['id']]});}else{return _0x525c70(_0x138023[_0xd8fd('0x2c')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3ab29d){return new Promise(function(_0x3d51b0,_0xd41499){var _0x1a643c=_[_0xd8fd('0x44')](_0x2b87bf['agents']);_0x3d51b0({'count':_0x1a643c[_0xd8fd('0x15')],'rows':_0x1a643c});});},'ChatQueues':function(_0x504394){return new Promise(function(_0x54d534,_0x590c4b){var _0x139943=[];for(var _0x5b9e23 in _0x2b87bf['chatQueues']){if(_0x2b87bf['chatQueues']['hasOwnProperty'](_0x5b9e23)){var _0x2a24cd=_0x2b87bf[_0xd8fd('0x45')][_0x5b9e23];var _0x5e7ede={'id':_0x2a24cd['id'],'available':_0x2a24cd['available'],'loggedIn':_0x2a24cd['loggedIn'],'name':_0x2a24cd['name'],'paused':_0x2a24cd[_0xd8fd('0x46')],'waiting':_0x2a24cd[_0xd8fd('0x47')]};_0x139943[_0xd8fd('0x1f')](_0x5e7ede);}}_0x54d534({'count':_0x139943[_0xd8fd('0x15')],'rows':_0x139943});});},'MailQueues':function(_0x15e05e){return new Promise(function(_0xdfb97c,_0xcaef3c){var _0x40a59b=[];for(var _0x3e9050 in _0x2b87bf['mailQueues']){if(_0x2b87bf['mailQueues'][_0xd8fd('0x40')](_0x3e9050)){var _0xb8cad8=_0x2b87bf[_0xd8fd('0x48')][_0x3e9050];var _0x2ccd64={'id':_0xb8cad8['id'],'available':_0xb8cad8['available'],'loggedIn':_0xb8cad8[_0xd8fd('0x49')],'name':_0xb8cad8[_0xd8fd('0x4a')],'paused':_0xb8cad8[_0xd8fd('0x46')],'waiting':_0xb8cad8['waiting']};_0x40a59b[_0xd8fd('0x1f')](_0x2ccd64);}}_0xdfb97c({'count':_0x40a59b[_0xd8fd('0x15')],'rows':_0x40a59b});});},'OpenchannelQueues':function(_0x2b24df){return new Promise(function(_0x3cd6a5,_0x29266b){var _0x4d4566=[];for(var _0x17e0e9 in _0x2b87bf[_0xd8fd('0x4b')]){if(_0x2b87bf['openchannelQueues'][_0xd8fd('0x40')](_0x17e0e9)){var _0x2ff206=_0x2b87bf['openchannelQueues'][_0x17e0e9];var _0x4ae3e2={'id':_0x2ff206['id'],'available':_0x2ff206['available'],'loggedIn':_0x2ff206[_0xd8fd('0x49')],'name':_0x2ff206['name'],'paused':_0x2ff206['paused'],'waiting':_0x2ff206['waiting']};_0x4d4566[_0xd8fd('0x1f')](_0x4ae3e2);}}_0x3cd6a5({'count':_0x4d4566[_0xd8fd('0x15')],'rows':_0x4d4566});});},'SmsQueues':function(_0x3ffa1f){return new Promise(function(_0x54dbbe,_0x483771){var _0x2cc660=[];for(var _0x574ae0 in _0x2b87bf[_0xd8fd('0x4c')]){if(_0x2b87bf['smsQueues'][_0xd8fd('0x40')](_0x574ae0)){var _0x439203=_0x2b87bf[_0xd8fd('0x4c')][_0x574ae0];var _0x3bad30={'id':_0x439203['id'],'available':_0x439203[_0xd8fd('0x4d')],'loggedIn':_0x439203[_0xd8fd('0x49')],'name':_0x439203[_0xd8fd('0x4a')],'paused':_0x439203[_0xd8fd('0x46')],'waiting':_0x439203['waiting']};_0x2cc660['push'](_0x3bad30);}}_0x54dbbe({'count':_0x2cc660[_0xd8fd('0x15')],'rows':_0x2cc660});});},'FaxQueues':function(_0x2e6411){return new Promise(function(_0x3ad858,_0x55db6e){var _0x46beca=[];for(var _0x46b100 in _0x2b87bf['faxQueues']){if(_0x2b87bf[_0xd8fd('0x4e')][_0xd8fd('0x40')](_0x46b100)){var _0x215e55=_0x2b87bf[_0xd8fd('0x4e')][_0x46b100];var _0x278028={'id':_0x215e55['id'],'available':_0x215e55[_0xd8fd('0x4d')],'loggedIn':_0x215e55[_0xd8fd('0x49')],'name':_0x215e55['name'],'paused':_0x215e55['paused'],'waiting':_0x215e55[_0xd8fd('0x47')]};_0x46beca['push'](_0x278028);}}_0x3ad858({'count':_0x46beca[_0xd8fd('0x15')],'rows':_0x46beca});});},'ChatQueuesWaitingInteractions':function(_0x20c48e){return new Promise(function(_0x33744f,_0x44a2b9){var _0x574317=_[_0xd8fd('0x44')](_0x2b87bf[_0xd8fd('0x4f')]);_0x33744f({'count':_0x574317[_0xd8fd('0x15')],'rows':_0x574317});});},'MailQueuesWaitingInteractions':function(_0x333d6a){return new Promise(function(_0x50dfc8,_0x25019a){var _0x30ac8e=_[_0xd8fd('0x44')](_0x2b87bf[_0xd8fd('0x50')]);_0x50dfc8({'count':_0x30ac8e[_0xd8fd('0x15')],'rows':_0x30ac8e});});},'OpenchannelQueuesWaitingInteractions':function(_0x33e420){return new Promise(function(_0x2750bc,_0x584e96){var _0x1688ce=_[_0xd8fd('0x44')](_0x2b87bf['openchannelQueuesWaitingInteractions']);_0x2750bc({'count':_0x1688ce['length'],'rows':_0x1688ce});});},'SmsQueuesWaitingInteractions':function(_0x1d98fa){return new Promise(function(_0x13743d,_0x158bd5){var _0xbf5f80=_['values'](_0x2b87bf[_0xd8fd('0x51')]);_0x13743d({'count':_0xbf5f80[_0xd8fd('0x15')],'rows':_0xbf5f80});});},'FaxQueuesWaitingInteractions':function(_0x38d07c){return new Promise(function(_0x515f67,_0x390729){var _0x18dd38=_['values'](_0x2b87bf[_0xd8fd('0x52')]);_0x515f67({'count':_0x18dd38[_0xd8fd('0x15')],'rows':_0x18dd38});});}};var _0x41dd7e=jayson[_0xd8fd('0x53')](_0x123bf5)['http']();_0x41dd7e['on'](_0xd8fd('0x2c'),function(_0x1a52e3){logger[_0xd8fd('0x2c')](JSON['stringify'](_0x1a52e3));return _0x41e54e(_0x1a52e3);});_0x41dd7e[_0xd8fd('0x54')](0x232c,_0xd8fd('0x55'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x51214b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index ef7cc00..29d248f 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 _0x2e11=['\x20|\x20','when','join','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','then','error','message','result','catch','condition','rules','info','stop','push','format','indexOf','true','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x2e11,0x194));var _0x12e1=function(_0x5980a1,_0x2f6448){_0x5980a1=_0x5980a1-0x0;var _0x36fa6d=_0x2e11[_0x5980a1];return _0x36fa6d;};'use strict';var util=require(_0x12e1('0x0'));var BPromise=require(_0x12e1('0x1'));var jayson=require(_0x12e1('0x2'));var _=require('lodash');var logger=require(_0x12e1('0x3'))(_0x12e1('0x4'));var client=jayson[_0x12e1('0x5')]['http']({'port':0x232a});function request(_0x5b449a,_0x39ecd2){return new BPromise(function(_0x563516,_0x40d9c1){return client['request'](_0x5b449a,_0x39ecd2)[_0x12e1('0x6')](function(_0x2ba2c9){if(_0x2ba2c9[_0x12e1('0x7')]){return _0x40d9c1(_0x2ba2c9['error'][_0x12e1('0x8')]);}else{return _0x563516(_0x2ba2c9[_0x12e1('0x9')]);}})[_0x12e1('0xa')](function(_0x2c8aa8){return _0x40d9c1(_0x2c8aa8);});});}exports[_0x12e1('0xb')]=function(_0x5037ac,_0x5020aa,_0x2e3472){return function(_0x2e6958){if(_0x2e3472[_0x12e1('0xc')]&&!_0x2e3472[_0x12e1('0xc')][_0x5037ac]){logger[_0x12e1('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5037ac);return _0x2e6958[_0x12e1('0xe')]();}var _0x52ed6a=[];for(var _0xd60ef1=0x0;_0xd60ef1<_0x5020aa['length'];_0xd60ef1+=0x1){_0x52ed6a[_0x12e1('0xf')](request('Command',{'command':util[_0x12e1('0x10')]('iftime\x20%s',_0x5020aa[_0xd60ef1])})[_0x12e1('0x6')](function(_0xcc55a8){return _0xcc55a8&&_0xcc55a8[_0x12e1('0x8')]&&_0xcc55a8[_0x12e1('0x8')][_0x12e1('0x11')](_0x12e1('0x12'))>=0x0?!![]:![];})['catch'](function(_0x4b9b4c){logger[_0x12e1('0x7')]('[%s][INTERVAL]\x20%s',_0x5037ac,_0x5020aa[_0xd60ef1]);}));}BPromise['all'](_0x52ed6a)[_0x12e1('0x6')](function(_0x213401){var _0x1b8f81=_[_0x12e1('0x13')](_0x213401);logger['info'](_0x12e1('0x14'),_0x5037ac,_0x5020aa['join'](_0x12e1('0x15')),_0x1b8f81);_0x2e6958[_0x12e1('0x16')](_0x1b8f81);})[_0x12e1('0xa')](function(_0x20b7c4){console['log'](_0x20b7c4);logger['error'](_0x12e1('0x14'),_0x5037ac,_0x5020aa[_0x12e1('0x17')](_0x12e1('0x15')),_0x20b7c4[_0x12e1('0x18')]);_0x2e6958[_0x12e1('0xe')]();});};}; \ No newline at end of file +var _0xf830=['message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','error','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','jayson/promise','routing','client','request','then'];(function(_0x48a0b4,_0x52978b){var _0x218f29=function(_0x54577b){while(--_0x54577b){_0x48a0b4['push'](_0x48a0b4['shift']());}};_0x218f29(++_0x52978b);}(_0xf830,0xca));var _0x0f83=function(_0x3b2879,_0x4071fa){_0x3b2879=_0x3b2879-0x0;var _0x4f46f0=_0xf830[_0x3b2879];return _0x4f46f0;};'use strict';var util=require(_0x0f83('0x0'));var BPromise=require('bluebird');var jayson=require(_0x0f83('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0x0f83('0x2'));var client=jayson[_0x0f83('0x3')]['http']({'port':0x232a});function request(_0x26ff31,_0xc3153c){return new BPromise(function(_0x2f7a1a,_0x48f928){return client[_0x0f83('0x4')](_0x26ff31,_0xc3153c)[_0x0f83('0x5')](function(_0x445db9){if(_0x445db9['error']){return _0x48f928(_0x445db9['error'][_0x0f83('0x6')]);}else{return _0x2f7a1a(_0x445db9[_0x0f83('0x7')]);}})[_0x0f83('0x8')](function(_0x45435c){return _0x48f928(_0x45435c);});});}exports[_0x0f83('0x9')]=function(_0xdfe68a,_0x590d5c,_0xfb93cf){return function(_0x363ebd){if(_0xfb93cf['rules']&&!_0xfb93cf[_0x0f83('0xa')][_0xdfe68a]){logger['info'](_0x0f83('0xb'),_0xdfe68a);return _0x363ebd[_0x0f83('0xc')]();}var _0x256fbe=[];for(var _0x3297ce=0x0;_0x3297ce<_0x590d5c[_0x0f83('0xd')];_0x3297ce+=0x1){_0x256fbe[_0x0f83('0xe')](request(_0x0f83('0xf'),{'command':util['format'](_0x0f83('0x10'),_0x590d5c[_0x3297ce])})['then'](function(_0x23b197){return _0x23b197&&_0x23b197['message']&&_0x23b197[_0x0f83('0x6')]['indexOf']('true')>=0x0?!![]:![];})['catch'](function(_0x5a3fb0){logger[_0x0f83('0x11')]('[%s][INTERVAL]\x20%s',_0xdfe68a,_0x590d5c[_0x3297ce]);}));}BPromise[_0x0f83('0x12')](_0x256fbe)[_0x0f83('0x5')](function(_0x1938f6){var _0x4032d5=_[_0x0f83('0x13')](_0x1938f6);logger[_0x0f83('0x14')](_0x0f83('0x15'),_0xdfe68a,_0x590d5c[_0x0f83('0x16')](_0x0f83('0x17')),_0x4032d5);_0x363ebd['when'](_0x4032d5);})[_0x0f83('0x8')](function(_0x275833){console[_0x0f83('0x18')](_0x275833);logger[_0x0f83('0x11')](_0x0f83('0x15'),_0xdfe68a,_0x590d5c[_0x0f83('0x16')](_0x0f83('0x17')),_0x275833[_0x0f83('0x19')]);_0x363ebd[_0x0f83('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index a90f3c2..4e4d439 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 _0x2d3f=['util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','calleridnum','connectedlinenum','then','type','agentacw','agentcomplete','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','lastevent','called','connectedlinename','error','stack','isNil','reason','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','uniqueid','agentringnoanswer','agentringnoanswerAt','abandoned','agentconnect','agentconnectAt','now','answered_elsewhere','answeredelsewheremembername','membername','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','origtransfereruniqueid','transfertargetuniqueid','clone','hangup','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2d3f,0xfb));var _0xf2d3=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x2d3f[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xf2d3('0x0'));var util=require(_0xf2d3('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x3b9ba0,_0x11cd2f){utils[_0xf2d3('0x2')](util['format'](_0xf2d3('0x3'),_0x3b9ba0['uniqueid'],_0x3b9ba0[_0xf2d3('0x4')],_0x3b9ba0[_0xf2d3('0x5')],_0x3b9ba0['membername'],_0x3b9ba0['interface'],_0x3b9ba0[_0xf2d3('0x6')],_0x3b9ba0[_0xf2d3('0x7')],_0x3b9ba0['lastevent']));if(_0x3b9ba0[_0xf2d3('0x5')]){utils['getVoiceQueueByName'](_0x3b9ba0[_0xf2d3('0x5')])[_0xf2d3('0x8')](function(_0x7d57e0){if(_0x7d57e0){_0x3b9ba0[_0xf2d3('0x9')]=_0x7d57e0['type'];_0x3b9ba0[_0xf2d3('0xa')]=_0x3b9ba0[_0xf2d3('0xb')]?_0x7d57e0['acw']:![];_0x3b9ba0['acwtime']=_0x3b9ba0[_0xf2d3('0xa')]?_0x7d57e0['acwTimeout']:0x0;}utils[_0xf2d3('0xc')]('CreateVoiceAgentReport',_0x3b9ba0);});}else{utils[_0xf2d3('0xc')](_0xf2d3('0xd'),_0x3b9ba0);}if(_0x11cd2f){delete transfers[_0x3b9ba0['uniqueid']];}else{delete agents[_0x3b9ba0[_0xf2d3('0xe')]];}}exports[_0xf2d3('0xf')]=function(_0x1d3fe9){try{agents[_0x1d3fe9[_0xf2d3('0xe')]]=_0x1d3fe9;agents[_0x1d3fe9[_0xf2d3('0xe')]][_0xf2d3('0x10')]=utils['now']();agents[_0x1d3fe9[_0xf2d3('0xe')]][_0xf2d3('0x11')]=_0xf2d3('0x12');agents[_0x1d3fe9[_0xf2d3('0xe')]]['connectedlinenum']=null;agents[_0x1d3fe9[_0xf2d3('0xe')]][_0xf2d3('0x13')]=null;}catch(_0x499c03){utils[_0xf2d3('0x14')](_0x499c03[_0xf2d3('0x15')]);}};exports['agentringnoanswer']=function(_0x642fba){try{if(!_[_0xf2d3('0x16')](agents[_0x642fba[_0xf2d3('0xe')]])){agents[_0x642fba[_0xf2d3('0xe')]]['agentringnoanswer']=!![];agents[_0x642fba[_0xf2d3('0xe')]]['agentringnoanswerAt']=utils['now']();agents[_0x642fba[_0xf2d3('0xe')]][_0xf2d3('0x11')]='rejected';agents[_0x642fba[_0xf2d3('0xe')]][_0xf2d3('0x17')]=_0xf2d3('0x18');agents[_0x642fba[_0xf2d3('0xe')]][_0xf2d3('0x19')]=_0x642fba[_0xf2d3('0x1a')]?parseInt(_0x642fba[_0xf2d3('0x1a')])/0x3e8:0x0;agents[_0x642fba['destuniqueid']][_0xf2d3('0x1b')]=0x0;writeDB(agents[_0x642fba[_0xf2d3('0xe')]]);}}catch(_0x12ca50){utils[_0xf2d3('0x14')](_0x12ca50['stack']);}};exports[_0xf2d3('0x1c')]=function(_0x2321dc){try{_[_0xf2d3('0x1d')](agents,function(_0x7e528,_0x3a495){if(_0x7e528[_0xf2d3('0x1e')]==_0x2321dc[_0xf2d3('0x1e')]){_0x7e528[_0xf2d3('0x1f')]=!![];_0x7e528[_0xf2d3('0x20')]=utils['now']();_0x7e528['lastevent']=_0xf2d3('0x21');_0x7e528[_0xf2d3('0x17')]=_0xf2d3('0x21');_0x7e528['holdtime']=_0x2321dc['holdtime'];_0x7e528[_0xf2d3('0x1b')]=0x0;writeDB(_0x7e528);}});}catch(_0x28343b){utils[_0xf2d3('0x14')](_0x28343b[_0xf2d3('0x15')]);}};exports[_0xf2d3('0x22')]=function(_0x1217c5){try{if(agents[_0x1217c5[_0xf2d3('0xe')]]){agents[_0x1217c5[_0xf2d3('0xe')]][_0xf2d3('0x23')]=utils['now']();agents[_0x1217c5[_0xf2d3('0xe')]][_0xf2d3('0x7')]=_0x1217c5['connectedlinenum'];agents[_0x1217c5['destuniqueid']][_0xf2d3('0x13')]=_0x1217c5[_0xf2d3('0x13')];agents[_0x1217c5['destuniqueid']][_0xf2d3('0x19')]=_0x1217c5[_0xf2d3('0x1a')];agents[_0x1217c5[_0xf2d3('0xe')]]['lastevent']='connect';_['forIn'](agents,function(_0xe2b2f8,_0x42388a){if(_0xe2b2f8[_0xf2d3('0xe')]!=_0x1217c5[_0xf2d3('0xe')]&&_0xe2b2f8[_0xf2d3('0x1e')]==_0x1217c5[_0xf2d3('0x1e')]){_0xe2b2f8[_0xf2d3('0x1b')]=0x0;_0xe2b2f8[_0xf2d3('0x19')]=_0x1217c5['ringtime'];_0xe2b2f8['agentringnoanswer']=!![];_0xe2b2f8['agentringnoanswerAt']=utils[_0xf2d3('0x24')]();_0xe2b2f8['lastevent']=_0xf2d3('0x25');_0xe2b2f8[_0xf2d3('0x17')]=_0xf2d3('0x25');_0xe2b2f8['answeredelsewheredestinationuniqueid']=_0x1217c5['destuniqueid'];_0xe2b2f8[_0xf2d3('0x26')]=_0x1217c5[_0xf2d3('0x27')];writeDB(_0xe2b2f8);}});}}catch(_0x2017fb){utils['error'](_0x2017fb['stack']);}};exports[_0xf2d3('0xb')]=function(_0x5753dc){try{if(!_['isNil'](agents[_0x5753dc[_0xf2d3('0xe')]])){agents[_0x5753dc[_0xf2d3('0xe')]]['agentcomplete']=!![];agents[_0x5753dc[_0xf2d3('0xe')]]['agentcompleteAt']=utils[_0xf2d3('0x24')]();agents[_0x5753dc['destuniqueid']]['talktime']=utils[_0xf2d3('0x28')](agents[_0x5753dc[_0xf2d3('0xe')]][_0xf2d3('0x29')],agents[_0x5753dc[_0xf2d3('0xe')]][_0xf2d3('0x23')]);agents[_0x5753dc[_0xf2d3('0xe')]][_0xf2d3('0x17')]=_0x5753dc[_0xf2d3('0x17')];agents[_0x5753dc[_0xf2d3('0xe')]][_0xf2d3('0x11')]=_0xf2d3('0x2a');writeDB(agents[_0x5753dc[_0xf2d3('0xe')]]);}}catch(_0xa7dc9d){utils['error'](_0xa7dc9d['stack']);}};exports[_0xf2d3('0x2b')]=function(_0x12d29f){try{if(!_[_0xf2d3('0x16')](agents[_0x12d29f[_0xf2d3('0x2c')]])){agents[_0x12d29f[_0xf2d3('0x2c')]]['transfer']=!![];agents[_0x12d29f['transfereruniqueid']][_0xf2d3('0x2d')]=_0xf2d3('0x2e');agents[_0x12d29f[_0xf2d3('0x2c')]][_0xf2d3('0x2f')]=_0x12d29f[_0xf2d3('0x30')];agents[_0x12d29f[_0xf2d3('0x2c')]][_0xf2d3('0x31')]=agents[_0x12d29f['transfereruniqueid']][_0xf2d3('0x1e')];}}catch(_0x3f2a61){utils['error'](_0x3f2a61[_0xf2d3('0x15')]);}};exports[_0xf2d3('0x32')]=function(_0x2fab7b){try{if(_0x2fab7b['origtransfereruniqueid']==_0x2fab7b[_0xf2d3('0x33')]){if(!_['isNil'](agents[_0x2fab7b['secondtransfereruniqueid']])){agents[_0x2fab7b[_0xf2d3('0x34')]][_0xf2d3('0x35')]=!![];agents[_0x2fab7b['secondtransfereruniqueid']][_0xf2d3('0x2d')]=_0xf2d3('0x36');agents[_0x2fab7b[_0xf2d3('0x34')]][_0xf2d3('0x2f')]=_0x2fab7b['origtransfererexten'];agents[_0x2fab7b[_0xf2d3('0x34')]][_0xf2d3('0x31')]=_0x2fab7b['origtransfereruniqueid'];}if(_0x2fab7b[_0xf2d3('0x37')]&&agents[_0x2fab7b[_0xf2d3('0x37')]]){agents[_0x2fab7b['transfereeuniqueid']][_0xf2d3('0x38')]=0x1;transfers[_0x2fab7b[_0xf2d3('0x37')]]=_['clone'](agents[_0x2fab7b[_0xf2d3('0x37')]]);transfers[_0x2fab7b[_0xf2d3('0x37')]][_0xf2d3('0x6')]=agents[_0x2fab7b[_0xf2d3('0x34')]]['calleridnum'];transfers[_0x2fab7b['transfereeuniqueid']][_0xf2d3('0x39')]=agents[_0x2fab7b[_0xf2d3('0x34')]][_0xf2d3('0x39')];transfers[_0x2fab7b['transfereeuniqueid']][_0xf2d3('0x10')]=utils['now']();transfers[_0x2fab7b['transfereeuniqueid']][_0xf2d3('0x23')]=utils[_0xf2d3('0x24')]();transfers[_0x2fab7b['transfereeuniqueid']][_0xf2d3('0x19')]=0x0;transfers[_0x2fab7b[_0xf2d3('0x37')]][_0xf2d3('0x38')]=0x2;}}else if(_0x2fab7b[_0xf2d3('0x34')]==_0x2fab7b[_0xf2d3('0x3a')]){if(!_[_0xf2d3('0x16')](agents[_0x2fab7b['origtransfereruniqueid']])){agents[_0x2fab7b[_0xf2d3('0x3b')]][_0xf2d3('0x35')]=!![];agents[_0x2fab7b[_0xf2d3('0x3b')]]['transfertype']=_0xf2d3('0x36');agents[_0x2fab7b[_0xf2d3('0x3b')]][_0xf2d3('0x2f')]=_0x2fab7b['secondtransfererexten'];agents[_0x2fab7b[_0xf2d3('0x3b')]][_0xf2d3('0x31')]=_0x2fab7b[_0xf2d3('0x34')];}if(_0x2fab7b[_0xf2d3('0x3c')]&&agents[_0x2fab7b[_0xf2d3('0x3c')]]){agents[_0x2fab7b[_0xf2d3('0x3c')]][_0xf2d3('0x38')]=0x1;transfers[_0x2fab7b[_0xf2d3('0x3c')]]=_[_0xf2d3('0x3d')](agents[_0x2fab7b['transfertargetuniqueid']]);transfers[_0x2fab7b[_0xf2d3('0x3c')]][_0xf2d3('0x6')]=agents[_0x2fab7b['origtransfereruniqueid']][_0xf2d3('0x6')];transfers[_0x2fab7b['transfertargetuniqueid']][_0xf2d3('0x39')]=agents[_0x2fab7b[_0xf2d3('0x3b')]]['calleridname'];transfers[_0x2fab7b[_0xf2d3('0x3c')]][_0xf2d3('0x10')]=utils['now']();transfers[_0x2fab7b[_0xf2d3('0x3c')]][_0xf2d3('0x23')]=utils['now']();transfers[_0x2fab7b[_0xf2d3('0x3c')]][_0xf2d3('0x19')]=0x0;transfers[_0x2fab7b[_0xf2d3('0x3c')]]['agententerreason']=0x2;}}}catch(_0x1385da){utils[_0xf2d3('0x14')](_0x1385da['stack']);}};exports[_0xf2d3('0x3e')]=function(_0x1fb06f){try{if(transfers[_0x1fb06f['uniqueid']]){transfers[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0xb')]=!![];transfers[_0x1fb06f[_0xf2d3('0x1e')]]['agentcompleteAt']=utils[_0xf2d3('0x24')]();transfers[_0x1fb06f['uniqueid']][_0xf2d3('0x1b')]=utils[_0xf2d3('0x28')](transfers[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x29')],transfers[_0x1fb06f[_0xf2d3('0x1e')]]['agentconnectAt']);transfers[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x17')]='agent';transfers[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x11')]='complete';writeDB(transfers[_0x1fb06f[_0xf2d3('0x1e')]],!![]);}if(agents[_0x1fb06f[_0xf2d3('0x1e')]]&&agents[_0x1fb06f[_0xf2d3('0x1e')]]['agentconnectAt']){agents[_0x1fb06f[_0xf2d3('0x1e')]]['agentcomplete']=!![];agents[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x29')]=utils['now']();agents[_0x1fb06f['uniqueid']][_0xf2d3('0x1b')]=utils[_0xf2d3('0x28')](agents[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x29')],agents[_0x1fb06f[_0xf2d3('0x1e')]]['agentconnectAt']);agents[_0x1fb06f[_0xf2d3('0x1e')]][_0xf2d3('0x17')]=agents[_0x1fb06f[_0xf2d3('0x1e')]]['transfer']?'transfer':'agent';agents[_0x1fb06f[_0xf2d3('0x1e')]]['lastevent']=_0xf2d3('0x2a');writeDB(agents[_0x1fb06f[_0xf2d3('0x1e')]]);}}catch(_0x16af6b){utils[_0xf2d3('0x14')](_0x16af6b[_0xf2d3('0x15')]);}}; \ No newline at end of file +var _0xa1fb=['lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','CreateVoiceAgentReport','request','agentcalled','destuniqueid','now','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','forIn','uniqueid','abandoned','agentconnect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheremembername','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','transfertargetuniqueid','agentcalledAt','hangup','agent','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','queue','membername','calleridnum'];(function(_0x249d59,_0x1a1a92){var _0x150593=function(_0x4cbb22){while(--_0x4cbb22){_0x249d59['push'](_0x249d59['shift']());}};_0x150593(++_0x1a1a92);}(_0xa1fb,0x133));var _0xba1f=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xa1fb[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xba1f('0x0'));var util=require(_0xba1f('0x1'));var utils=require(_0xba1f('0x2'));var agents={};var transfers={};function writeDB(_0x4799b3,_0xf433f4){utils['info'](util[_0xba1f('0x3')](_0xba1f('0x4'),_0x4799b3['uniqueid'],_0x4799b3['channel'],_0x4799b3[_0xba1f('0x5')],_0x4799b3[_0xba1f('0x6')],_0x4799b3['interface'],_0x4799b3[_0xba1f('0x7')],_0x4799b3['connectedlinenum'],_0x4799b3[_0xba1f('0x8')]));if(_0x4799b3['queue']){utils[_0xba1f('0x9')](_0x4799b3[_0xba1f('0x5')])[_0xba1f('0xa')](function(_0x3484f1){if(_0x3484f1){_0x4799b3[_0xba1f('0xb')]=_0x3484f1[_0xba1f('0xb')];_0x4799b3[_0xba1f('0xc')]=_0x4799b3[_0xba1f('0xd')]?_0x3484f1[_0xba1f('0xe')]:![];_0x4799b3['acwtime']=_0x4799b3[_0xba1f('0xc')]?_0x3484f1['acwTimeout']:0x0;}utils['request'](_0xba1f('0xf'),_0x4799b3);});}else{utils[_0xba1f('0x10')]('CreateVoiceAgentReport',_0x4799b3);}if(_0xf433f4){delete transfers[_0x4799b3['uniqueid']];}else{delete agents[_0x4799b3['destuniqueid']];}}exports[_0xba1f('0x11')]=function(_0x14fdfe){try{agents[_0x14fdfe[_0xba1f('0x12')]]=_0x14fdfe;agents[_0x14fdfe[_0xba1f('0x12')]]['agentcalledAt']=utils[_0xba1f('0x13')]();agents[_0x14fdfe[_0xba1f('0x12')]][_0xba1f('0x8')]='called';agents[_0x14fdfe['destuniqueid']]['connectedlinenum']=null;agents[_0x14fdfe[_0xba1f('0x12')]][_0xba1f('0x14')]=null;}catch(_0x3f2250){utils[_0xba1f('0x15')](_0x3f2250[_0xba1f('0x16')]);}};exports[_0xba1f('0x17')]=function(_0x39f157){try{if(!_[_0xba1f('0x18')](agents[_0x39f157[_0xba1f('0x12')]])){agents[_0x39f157[_0xba1f('0x12')]][_0xba1f('0x17')]=!![];agents[_0x39f157[_0xba1f('0x12')]][_0xba1f('0x19')]=utils[_0xba1f('0x13')]();agents[_0x39f157[_0xba1f('0x12')]]['lastevent']=_0xba1f('0x1a');agents[_0x39f157[_0xba1f('0x12')]][_0xba1f('0x1b')]='rejected';agents[_0x39f157[_0xba1f('0x12')]][_0xba1f('0x1c')]=_0x39f157[_0xba1f('0x1d')]?parseInt(_0x39f157['ringtime'])/0x3e8:0x0;agents[_0x39f157[_0xba1f('0x12')]][_0xba1f('0x1e')]=0x0;writeDB(agents[_0x39f157[_0xba1f('0x12')]]);}}catch(_0x41018f){utils[_0xba1f('0x15')](_0x41018f[_0xba1f('0x16')]);}};exports['queuecallerabandon']=function(_0x262d1c){try{_[_0xba1f('0x1f')](agents,function(_0x3d7b9c,_0x3260c5){if(_0x3d7b9c[_0xba1f('0x20')]==_0x262d1c[_0xba1f('0x20')]){_0x3d7b9c[_0xba1f('0x17')]=!![];_0x3d7b9c[_0xba1f('0x19')]=utils[_0xba1f('0x13')]();_0x3d7b9c[_0xba1f('0x8')]=_0xba1f('0x21');_0x3d7b9c['reason']=_0xba1f('0x21');_0x3d7b9c[_0xba1f('0x1c')]=_0x262d1c[_0xba1f('0x1c')];_0x3d7b9c['talktime']=0x0;writeDB(_0x3d7b9c);}});}catch(_0x18da8a){utils[_0xba1f('0x15')](_0x18da8a['stack']);}};exports[_0xba1f('0x22')]=function(_0x7ef7aa){try{if(agents[_0x7ef7aa[_0xba1f('0x12')]]){agents[_0x7ef7aa[_0xba1f('0x12')]][_0xba1f('0x23')]=utils[_0xba1f('0x13')]();agents[_0x7ef7aa['destuniqueid']][_0xba1f('0x24')]=_0x7ef7aa['connectedlinenum'];agents[_0x7ef7aa[_0xba1f('0x12')]][_0xba1f('0x14')]=_0x7ef7aa[_0xba1f('0x14')];agents[_0x7ef7aa[_0xba1f('0x12')]][_0xba1f('0x1c')]=_0x7ef7aa[_0xba1f('0x1d')];agents[_0x7ef7aa[_0xba1f('0x12')]]['lastevent']=_0xba1f('0x25');_['forIn'](agents,function(_0xcf19ec,_0x3f9e81){if(_0xcf19ec[_0xba1f('0x12')]!=_0x7ef7aa[_0xba1f('0x12')]&&_0xcf19ec[_0xba1f('0x20')]==_0x7ef7aa[_0xba1f('0x20')]){_0xcf19ec[_0xba1f('0x1e')]=0x0;_0xcf19ec[_0xba1f('0x1c')]=_0x7ef7aa[_0xba1f('0x1d')];_0xcf19ec[_0xba1f('0x17')]=!![];_0xcf19ec[_0xba1f('0x19')]=utils[_0xba1f('0x13')]();_0xcf19ec['lastevent']='answered_elsewhere';_0xcf19ec[_0xba1f('0x1b')]=_0xba1f('0x26');_0xcf19ec['answeredelsewheredestinationuniqueid']=_0x7ef7aa[_0xba1f('0x12')];_0xcf19ec[_0xba1f('0x27')]=_0x7ef7aa[_0xba1f('0x6')];writeDB(_0xcf19ec);}});}}catch(_0x4516b0){utils['error'](_0x4516b0[_0xba1f('0x16')]);}};exports['agentcomplete']=function(_0x13ce06){try{if(!_[_0xba1f('0x18')](agents[_0x13ce06[_0xba1f('0x12')]])){agents[_0x13ce06[_0xba1f('0x12')]][_0xba1f('0xd')]=!![];agents[_0x13ce06[_0xba1f('0x12')]]['agentcompleteAt']=utils[_0xba1f('0x13')]();agents[_0x13ce06[_0xba1f('0x12')]]['talktime']=utils[_0xba1f('0x28')](agents[_0x13ce06[_0xba1f('0x12')]][_0xba1f('0x29')],agents[_0x13ce06[_0xba1f('0x12')]][_0xba1f('0x23')]);agents[_0x13ce06[_0xba1f('0x12')]]['reason']=_0x13ce06['reason'];agents[_0x13ce06[_0xba1f('0x12')]][_0xba1f('0x8')]=_0xba1f('0x2a');writeDB(agents[_0x13ce06[_0xba1f('0x12')]]);}}catch(_0x5bfc10){utils[_0xba1f('0x15')](_0x5bfc10[_0xba1f('0x16')]);}};exports[_0xba1f('0x2b')]=function(_0x48166e){try{if(!_[_0xba1f('0x18')](agents[_0x48166e[_0xba1f('0x2c')]])){agents[_0x48166e[_0xba1f('0x2c')]][_0xba1f('0x2d')]=!![];agents[_0x48166e[_0xba1f('0x2c')]][_0xba1f('0x2e')]='blind';agents[_0x48166e[_0xba1f('0x2c')]][_0xba1f('0x2f')]=_0x48166e[_0xba1f('0x30')];agents[_0x48166e[_0xba1f('0x2c')]][_0xba1f('0x31')]=agents[_0x48166e['transfereruniqueid']][_0xba1f('0x20')];}}catch(_0x205dff){utils[_0xba1f('0x15')](_0x205dff['stack']);}};exports[_0xba1f('0x32')]=function(_0x2490bb){try{if(_0x2490bb[_0xba1f('0x33')]==_0x2490bb['origtransfererlinkedid']){if(!_[_0xba1f('0x18')](agents[_0x2490bb[_0xba1f('0x34')]])){agents[_0x2490bb[_0xba1f('0x34')]]['transfer']=!![];agents[_0x2490bb['secondtransfereruniqueid']]['transfertype']=_0xba1f('0x35');agents[_0x2490bb[_0xba1f('0x34')]][_0xba1f('0x2f')]=_0x2490bb[_0xba1f('0x36')];agents[_0x2490bb[_0xba1f('0x34')]][_0xba1f('0x31')]=_0x2490bb['origtransfereruniqueid'];}if(_0x2490bb[_0xba1f('0x37')]&&agents[_0x2490bb[_0xba1f('0x37')]]){agents[_0x2490bb[_0xba1f('0x37')]][_0xba1f('0x38')]=0x1;transfers[_0x2490bb['transfereeuniqueid']]=_[_0xba1f('0x39')](agents[_0x2490bb[_0xba1f('0x37')]]);transfers[_0x2490bb[_0xba1f('0x37')]][_0xba1f('0x7')]=agents[_0x2490bb['secondtransfereruniqueid']][_0xba1f('0x7')];transfers[_0x2490bb[_0xba1f('0x37')]][_0xba1f('0x3a')]=agents[_0x2490bb[_0xba1f('0x34')]][_0xba1f('0x3a')];transfers[_0x2490bb[_0xba1f('0x37')]]['agentcalledAt']=utils[_0xba1f('0x13')]();transfers[_0x2490bb[_0xba1f('0x37')]][_0xba1f('0x23')]=utils[_0xba1f('0x13')]();transfers[_0x2490bb[_0xba1f('0x37')]]['holdtime']=0x0;transfers[_0x2490bb[_0xba1f('0x37')]][_0xba1f('0x38')]=0x2;}}else if(_0x2490bb['secondtransfereruniqueid']==_0x2490bb['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2490bb[_0xba1f('0x33')]])){agents[_0x2490bb[_0xba1f('0x33')]]['transfer']=!![];agents[_0x2490bb[_0xba1f('0x33')]][_0xba1f('0x2e')]=_0xba1f('0x35');agents[_0x2490bb[_0xba1f('0x33')]]['transferexten']=_0x2490bb['secondtransfererexten'];agents[_0x2490bb[_0xba1f('0x33')]][_0xba1f('0x31')]=_0x2490bb['secondtransfereruniqueid'];}if(_0x2490bb['transfertargetuniqueid']&&agents[_0x2490bb[_0xba1f('0x3b')]]){agents[_0x2490bb[_0xba1f('0x3b')]][_0xba1f('0x38')]=0x1;transfers[_0x2490bb[_0xba1f('0x3b')]]=_[_0xba1f('0x39')](agents[_0x2490bb[_0xba1f('0x3b')]]);transfers[_0x2490bb['transfertargetuniqueid']][_0xba1f('0x7')]=agents[_0x2490bb[_0xba1f('0x33')]][_0xba1f('0x7')];transfers[_0x2490bb[_0xba1f('0x3b')]]['calleridname']=agents[_0x2490bb['origtransfereruniqueid']]['calleridname'];transfers[_0x2490bb[_0xba1f('0x3b')]][_0xba1f('0x3c')]=utils['now']();transfers[_0x2490bb['transfertargetuniqueid']]['agentconnectAt']=utils[_0xba1f('0x13')]();transfers[_0x2490bb[_0xba1f('0x3b')]][_0xba1f('0x1c')]=0x0;transfers[_0x2490bb[_0xba1f('0x3b')]][_0xba1f('0x38')]=0x2;}}}catch(_0x4eac30){utils['error'](_0x4eac30[_0xba1f('0x16')]);}};exports[_0xba1f('0x3d')]=function(_0x316229){try{if(transfers[_0x316229['uniqueid']]){transfers[_0x316229[_0xba1f('0x20')]][_0xba1f('0xd')]=!![];transfers[_0x316229[_0xba1f('0x20')]]['agentcompleteAt']=utils['now']();transfers[_0x316229[_0xba1f('0x20')]][_0xba1f('0x1e')]=utils[_0xba1f('0x28')](transfers[_0x316229[_0xba1f('0x20')]][_0xba1f('0x29')],transfers[_0x316229['uniqueid']]['agentconnectAt']);transfers[_0x316229[_0xba1f('0x20')]][_0xba1f('0x1b')]=_0xba1f('0x3e');transfers[_0x316229[_0xba1f('0x20')]][_0xba1f('0x8')]='complete';writeDB(transfers[_0x316229['uniqueid']],!![]);}if(agents[_0x316229[_0xba1f('0x20')]]&&agents[_0x316229[_0xba1f('0x20')]][_0xba1f('0x23')]){agents[_0x316229[_0xba1f('0x20')]]['agentcomplete']=!![];agents[_0x316229[_0xba1f('0x20')]][_0xba1f('0x29')]=utils[_0xba1f('0x13')]();agents[_0x316229['uniqueid']]['talktime']=utils['diffTime'](agents[_0x316229[_0xba1f('0x20')]][_0xba1f('0x29')],agents[_0x316229['uniqueid']][_0xba1f('0x23')]);agents[_0x316229[_0xba1f('0x20')]][_0xba1f('0x1b')]=agents[_0x316229['uniqueid']][_0xba1f('0x2d')]?_0xba1f('0x2d'):_0xba1f('0x3e');agents[_0x316229[_0xba1f('0x20')]][_0xba1f('0x8')]=_0xba1f('0x2a');writeDB(agents[_0x316229[_0xba1f('0x20')]]);}}catch(_0x2a7234){utils[_0xba1f('0x15')](_0x2a7234[_0xba1f('0x16')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 23afcb2..c0ba6a3 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 _0x9bfe=['now','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','\x22\x20<','calleridname','endtime','duration','diffTime','billableseconds','stack','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','Queue','ContactId','outboundrouteid','routeid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','includes','execif','gotoif','lastapplication','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','calleridnum','exten','context'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9bfe,0xdf));var _0xe9bf=function(_0x10b81d,_0x2902c8){_0x10b81d=_0x10b81d-0x0;var _0x3f4be3=_0x9bfe[_0x10b81d];return _0x3f4be3;};'use strict';var _=require(_0xe9bf('0x0'));var util=require(_0xe9bf('0x1'));var utils=require(_0xe9bf('0x2'));var dispositions=[_0xe9bf('0x3'),'FAILED',_0xe9bf('0x4'),'NO\x20ANSWER',_0xe9bf('0x3'),_0xe9bf('0x3'),_0xe9bf('0x5'),_0xe9bf('0x6'),_0xe9bf('0x4'),_0xe9bf('0x4'),_0xe9bf('0x4')];var channels={};function writeDB(_0x32a6f8){utils[_0xe9bf('0x7')](util[_0xe9bf('0x8')](_0xe9bf('0x9'),_0x32a6f8[_0xe9bf('0xa')],_0x32a6f8[_0xe9bf('0xb')],_0x32a6f8[_0xe9bf('0xc')],_0x32a6f8[_0xe9bf('0xd')],_0x32a6f8[_0xe9bf('0xe')],_0x32a6f8[_0xe9bf('0xf')],_0x32a6f8[_0xe9bf('0x10')],_0x32a6f8['disposition']));if(_0x32a6f8[_0xe9bf('0xd')]){utils['getUserByInternal'](_0x32a6f8['accountcode'])[_0xe9bf('0x11')](function(_0x3d6c44){if(_0x3d6c44){_0x32a6f8[_0xe9bf('0x12')]=_0x3d6c44['id'];}utils[_0xe9bf('0x13')](_0xe9bf('0x14'),_0x32a6f8);});}else{utils[_0xe9bf('0x13')](_0xe9bf('0x14'),_0x32a6f8);}if(channels[_0x32a6f8['uniqueid']]){delete channels[_0x32a6f8[_0xe9bf('0xa')]];}}exports[_0xe9bf('0x15')]=function(_0x2402cb){try{if(_0x2402cb['uniqueid']==_0x2402cb[_0xe9bf('0x16')]){channels[_0x2402cb[_0xe9bf('0xa')]]={'uniqueid':_0x2402cb['uniqueid'],'accountcode':_0x2402cb['accountcode'],'source':_0x2402cb[_0xe9bf('0x17')],'destination':_0x2402cb[_0xe9bf('0x18')],'destinationcontext':_0x2402cb[_0xe9bf('0x19')],'channel':_0x2402cb[_0xe9bf('0xb')],'starttime':utils[_0xe9bf('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe9bf('0x3'),'amaflags':_0xe9bf('0x1b')};}}catch(_0x3e822d){utils[_0xe9bf('0x1c')](_0x3e822d['stack']);}};exports[_0xe9bf('0x1d')]=function(_0x124a8f){try{if(!_[_0xe9bf('0x1e')](channels[_0x124a8f[_0xe9bf('0xa')]])&&_0x124a8f[_0xe9bf('0x1f')]==0x6){if(_[_0xe9bf('0x1e')](channels[_0x124a8f['uniqueid']][_0xe9bf('0x20')])){channels[_0x124a8f[_0xe9bf('0xa')]][_0xe9bf('0x20')]=utils[_0xe9bf('0x1a')]();}}else if(!_[_0xe9bf('0x1e')](channels[_0x124a8f[_0xe9bf('0x16')]])&&_0x124a8f[_0xe9bf('0x1f')]==0x6&&_0x124a8f[_0xe9bf('0x19')]!=_0xe9bf('0x21')){channels[_0x124a8f['linkedid']][_0xe9bf('0xd')]=_0x124a8f[_0xe9bf('0xd')];channels[_0x124a8f[_0xe9bf('0x16')]][_0xe9bf('0x22')]=_0x124a8f[_0xe9bf('0xb')];if(_['isNil'](channels[_0x124a8f['linkedid']]['answertime'])){channels[_0x124a8f[_0xe9bf('0x16')]][_0xe9bf('0x23')]=utils[_0xe9bf('0x1a')]();}channels[_0x124a8f[_0xe9bf('0x16')]][_0xe9bf('0x24')]=dispositions[_[_0xe9bf('0x25')](_0x124a8f[_0xe9bf('0x1f')])]||_0xe9bf('0x5');}}catch(_0x4f8f57){utils[_0xe9bf('0x1c')](_0x4f8f57['stack']);}};exports[_0xe9bf('0x26')]=function(_0x4205eb){try{if(!_[_0xe9bf('0x1e')](channels[_0x4205eb['uniqueid']])){channels[_0x4205eb[_0xe9bf('0xa')]][_0xe9bf('0x10')]='\x22'+_0x4205eb[_0xe9bf('0x17')]+_0xe9bf('0x27')+_0x4205eb[_0xe9bf('0x28')]+'>';channels[_0x4205eb[_0xe9bf('0xa')]][_0xe9bf('0x29')]=utils['now']();channels[_0x4205eb['uniqueid']][_0xe9bf('0x2a')]=utils[_0xe9bf('0x2b')](channels[_0x4205eb['uniqueid']][_0xe9bf('0x29')],channels[_0x4205eb[_0xe9bf('0xa')]]['starttime']);channels[_0x4205eb['uniqueid']][_0xe9bf('0x2c')]=channels[_0x4205eb[_0xe9bf('0xa')]][_0xe9bf('0x23')]?utils[_0xe9bf('0x2b')](channels[_0x4205eb[_0xe9bf('0xa')]][_0xe9bf('0x29')],channels[_0x4205eb[_0xe9bf('0xa')]][_0xe9bf('0x23')]):0x0;writeDB(channels[_0x4205eb[_0xe9bf('0xa')]]);}}catch(_0x35a156){utils['error'](_0x35a156[_0xe9bf('0x2d')]);}};exports[_0xe9bf('0x2e')]=function(_0x40a634){try{if(!_[_0xe9bf('0x1e')](channels[_0x40a634[_0xe9bf('0x2f')]])){if(channels[_0x40a634[_0xe9bf('0x2f')]]['channel']==_0x40a634[_0xe9bf('0x30')]){channels[_0x40a634[_0xe9bf('0x2f')]]['destinationchannel']=_0x40a634[_0xe9bf('0x31')];channels[_0x40a634[_0xe9bf('0x2f')]][_0xe9bf('0x32')]=_0xe9bf('0x33');}else if(channels[_0x40a634[_0xe9bf('0x2f')]]['channel']=_0x40a634[_0xe9bf('0x34')]){channels[_0x40a634[_0xe9bf('0x2f')]]['destinationchannel']=_0x40a634[_0xe9bf('0x35')];channels[_0x40a634[_0xe9bf('0x2f')]][_0xe9bf('0x32')]=_0xe9bf('0x33');}}}catch(_0x4c92ed){utils[_0xe9bf('0x1c')](_0x4c92ed[_0xe9bf('0x2d')]);}};exports[_0xe9bf('0x36')]=function(_0x48d725){try{if(!_[_0xe9bf('0x1e')](channels[_0x48d725[_0xe9bf('0xa')]])){channels[_0x48d725[_0xe9bf('0xa')]][_0xe9bf('0x37')]=utils[_0xe9bf('0x1a')]();}}catch(_0x27f6f3){utils['error'](_0x27f6f3[_0xe9bf('0x2d')]);}};exports[_0xe9bf('0x38')]=function(_0x145611){try{if(!_[_0xe9bf('0x1e')](channels[_0x145611[_0xe9bf('0xa')]])){if(!_['isNil'](channels[_0x145611[_0xe9bf('0xa')]]['musiconholdstartAt'])){channels[_0x145611[_0xe9bf('0xa')]][_0xe9bf('0x39')]+=utils['diffTime'](utils[_0xe9bf('0x1a')](),channels[_0x145611[_0xe9bf('0xa')]][_0xe9bf('0x37')]);delete channels[_0x145611[_0xe9bf('0xa')]][_0xe9bf('0x37')];}}}catch(_0x17eccf){utils['error'](_0x17eccf[_0xe9bf('0x2d')]);}};exports['varset']=function(_0x258b73){try{if(!_[_0xe9bf('0x1e')](channels[_0x258b73[_0xe9bf('0xa')]])){if(!_['isNil'](_0x258b73[_0xe9bf('0x3a')][_0xe9bf('0x3b')])){channels[_0x258b73['uniqueid']][_0xe9bf('0xe')]=_0x258b73[_0xe9bf('0x3c')];}if(!_[_0xe9bf('0x1e')](_0x258b73['variable'][_0xe9bf('0x3d')])){channels[_0x258b73['uniqueid']][_0xe9bf('0xf')]=_0x258b73[_0xe9bf('0x3c')];}if(!_[_0xe9bf('0x1e')](_0x258b73[_0xe9bf('0x3a')][_0xe9bf('0x3e')])||!_[_0xe9bf('0x1e')](_0x258b73['variable'][_0xe9bf('0x3f')])){channels[_0x258b73[_0xe9bf('0xa')]][_0xe9bf('0x10')]=_0x258b73[_0xe9bf('0x3c')];}if(!_[_0xe9bf('0x1e')](_0x258b73[_0xe9bf('0x3a')][_0xe9bf('0x40')])){channels[_0x258b73[_0xe9bf('0xa')]]['lastapplication']=_0xe9bf('0x41');channels[_0x258b73[_0xe9bf('0xa')]]['lastdata']=_0x258b73[_0xe9bf('0x3c')];channels[_0x258b73[_0xe9bf('0xa')]]['queue']=!![];}if(!_['isNil'](_0x258b73['variable']['xmd-contactid'])){channels[_0x258b73[_0xe9bf('0xa')]][_0xe9bf('0x42')]=_0x258b73[_0xe9bf('0x3c')];}if(!_[_0xe9bf('0x1e')](_0x258b73[_0xe9bf('0x3a')][_0xe9bf('0x43')])){channels[_0x258b73['uniqueid']][_0xe9bf('0x44')]=_0x258b73[_0xe9bf('0x3c')];}if(!_[_0xe9bf('0x1e')](_0x258b73[_0xe9bf('0x3a')]['sipcallid'])){channels[_0x258b73[_0xe9bf('0xa')]]['sipcallid']=_0x258b73[_0xe9bf('0x3c')];}}}catch(_0x37c3c1){utils['error'](_0x37c3c1[_0xe9bf('0x2d')]);}};exports[_0xe9bf('0x45')]=function(_0x2d9bbd){try{if(!_[_0xe9bf('0x1e')](channels[_0x2d9bbd[_0xe9bf('0xa')]])){if(_0x2d9bbd[_0xe9bf('0x46')][_0xe9bf('0x47')]()==_0xe9bf('0x48')&&_[_0xe9bf('0x49')](_0x2d9bbd[_0xe9bf('0x4a')][_0xe9bf('0x47')](),_0xe9bf('0x4b'))){var _0x311bd7=_0x2d9bbd[_0xe9bf('0x4a')]['split']('=');var _0xc135d6=_0x311bd7[0x0][_0xe9bf('0x4c')](_0x311bd7[0x0][_0xe9bf('0x4d')]('(')+0x1,_0x311bd7[0x0][_0xe9bf('0x4d')](')'));var _0x1b15b9=_0x311bd7[0x1];channels[_0x2d9bbd[_0xe9bf('0xa')]][_0xc135d6]=_0x1b15b9;}if(!_[_0xe9bf('0x4e')]([_0xe9bf('0x26'),'noop',_0xe9bf('0x4f'),_0xe9bf('0x48'),_0xe9bf('0x50')],_0x2d9bbd[_0xe9bf('0x46')][_0xe9bf('0x47')]())){channels[_0x2d9bbd[_0xe9bf('0xa')]][_0xe9bf('0x51')]=_0x2d9bbd[_0xe9bf('0x46')];channels[_0x2d9bbd[_0xe9bf('0xa')]][_0xe9bf('0x52')]=_0x2d9bbd[_0xe9bf('0x4a')];}}}catch(_0x1f2b24){utils[_0xe9bf('0x1c')](_0x1f2b24[_0xe9bf('0x2d')]);}}; \ No newline at end of file +var _0x128c=['CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','callerid','disposition','then','UserId','request','CreateVoiceCallReport','exten','context','now','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','linkedid','transfer','answertime','toNumber','error','hangup','\x22\x20<','calleridname','duration','diffTime','starttime','billableseconds','endtime','attendedtransfer','localtwolinkedid','destinationchannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','outboundrouteid','routeid','sipcallid','newexten','application','set','appdata','cdr','split','includes','noop','execif','gotoif','toLowerCase','lodash','util','./utils','NO\x20ANSWER','ANSWERED','BUSY','FAILED','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x128c,0x96));var _0xc128=function(_0x5d571a,_0x4ecb5a){_0x5d571a=_0x5d571a-0x0;var _0x22bd3c=_0x128c[_0x5d571a];return _0x22bd3c;};'use strict';var _=require(_0xc128('0x0'));var util=require(_0xc128('0x1'));var utils=require(_0xc128('0x2'));var dispositions=[_0xc128('0x3'),'FAILED','FAILED',_0xc128('0x3'),_0xc128('0x3'),_0xc128('0x3'),_0xc128('0x4'),_0xc128('0x5'),_0xc128('0x6'),'FAILED',_0xc128('0x6')];var channels={};function writeDB(_0x515c2b){utils[_0xc128('0x7')](util['format'](_0xc128('0x8'),_0x515c2b[_0xc128('0x9')],_0x515c2b[_0xc128('0xa')],_0x515c2b[_0xc128('0xb')],_0x515c2b[_0xc128('0xc')],_0x515c2b[_0xc128('0xd')],_0x515c2b['destination'],_0x515c2b[_0xc128('0xe')],_0x515c2b[_0xc128('0xf')]));if(_0x515c2b[_0xc128('0xc')]){utils['getUserByInternal'](_0x515c2b['accountcode'])[_0xc128('0x10')](function(_0x519394){if(_0x519394){_0x515c2b[_0xc128('0x11')]=_0x519394['id'];}utils[_0xc128('0x12')](_0xc128('0x13'),_0x515c2b);});}else{utils[_0xc128('0x12')](_0xc128('0x13'),_0x515c2b);}if(channels[_0x515c2b[_0xc128('0x9')]]){delete channels[_0x515c2b['uniqueid']];}}exports['newchannel']=function(_0x13a9a3){try{if(_0x13a9a3[_0xc128('0x9')]==_0x13a9a3['linkedid']){channels[_0x13a9a3[_0xc128('0x9')]]={'uniqueid':_0x13a9a3[_0xc128('0x9')],'accountcode':_0x13a9a3[_0xc128('0xc')],'source':_0x13a9a3['calleridnum'],'destination':_0x13a9a3[_0xc128('0x14')],'destinationcontext':_0x13a9a3[_0xc128('0x15')],'channel':_0x13a9a3[_0xc128('0xa')],'starttime':utils[_0xc128('0x16')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc128('0x3'),'amaflags':_0xc128('0x17')};}}catch(_0x4c8274){utils['error'](_0x4c8274[_0xc128('0x18')]);}};exports[_0xc128('0x19')]=function(_0x4ffaf0){try{if(!_[_0xc128('0x1a')](channels[_0x4ffaf0[_0xc128('0x9')]])&&_0x4ffaf0[_0xc128('0x1b')]==0x6){if(_['isNil'](channels[_0x4ffaf0[_0xc128('0x9')]][_0xc128('0x1c')])){channels[_0x4ffaf0[_0xc128('0x9')]][_0xc128('0x1c')]=utils[_0xc128('0x16')]();}}else if(!_[_0xc128('0x1a')](channels[_0x4ffaf0[_0xc128('0x1d')]])&&_0x4ffaf0['channelstate']==0x6&&_0x4ffaf0[_0xc128('0x15')]!=_0xc128('0x1e')){channels[_0x4ffaf0[_0xc128('0x1d')]][_0xc128('0xc')]=_0x4ffaf0[_0xc128('0xc')];channels[_0x4ffaf0['linkedid']]['destinationchannel']=_0x4ffaf0['channel'];if(_[_0xc128('0x1a')](channels[_0x4ffaf0[_0xc128('0x1d')]][_0xc128('0x1f')])){channels[_0x4ffaf0[_0xc128('0x1d')]][_0xc128('0x1f')]=utils['now']();}channels[_0x4ffaf0[_0xc128('0x1d')]][_0xc128('0xf')]=dispositions[_[_0xc128('0x20')](_0x4ffaf0[_0xc128('0x1b')])]||'ANSWERED';}}catch(_0x56d964){utils[_0xc128('0x21')](_0x56d964[_0xc128('0x18')]);}};exports[_0xc128('0x22')]=function(_0x293af0){try{if(!_['isNil'](channels[_0x293af0[_0xc128('0x9')]])){channels[_0x293af0[_0xc128('0x9')]]['callerid']='\x22'+_0x293af0['calleridnum']+_0xc128('0x23')+_0x293af0[_0xc128('0x24')]+'>';channels[_0x293af0[_0xc128('0x9')]]['endtime']=utils[_0xc128('0x16')]();channels[_0x293af0[_0xc128('0x9')]][_0xc128('0x25')]=utils[_0xc128('0x26')](channels[_0x293af0['uniqueid']]['endtime'],channels[_0x293af0[_0xc128('0x9')]][_0xc128('0x27')]);channels[_0x293af0[_0xc128('0x9')]][_0xc128('0x28')]=channels[_0x293af0[_0xc128('0x9')]][_0xc128('0x1f')]?utils[_0xc128('0x26')](channels[_0x293af0['uniqueid']][_0xc128('0x29')],channels[_0x293af0[_0xc128('0x9')]][_0xc128('0x1f')]):0x0;writeDB(channels[_0x293af0[_0xc128('0x9')]]);}}catch(_0x2f5de3){utils[_0xc128('0x21')](_0x2f5de3[_0xc128('0x18')]);}};exports[_0xc128('0x2a')]=function(_0x525053){try{if(!_['isNil'](channels[_0x525053['localtwolinkedid']])){if(channels[_0x525053['localtwolinkedid']][_0xc128('0xa')]==_0x525053['transfereechannel']){channels[_0x525053[_0xc128('0x2b')]][_0xc128('0x2c')]=_0x525053[_0xc128('0x2d')];channels[_0x525053[_0xc128('0x2b')]][_0xc128('0x2e')]='_attended';}else if(channels[_0x525053['localtwolinkedid']][_0xc128('0xa')]=_0x525053[_0xc128('0x2f')]){channels[_0x525053[_0xc128('0x2b')]][_0xc128('0x2c')]=_0x525053[_0xc128('0x30')];channels[_0x525053[_0xc128('0x2b')]][_0xc128('0x2e')]=_0xc128('0x31');}}}catch(_0x99ca5c){utils[_0xc128('0x21')](_0x99ca5c[_0xc128('0x18')]);}};exports[_0xc128('0x32')]=function(_0x704b17){try{if(!_[_0xc128('0x1a')](channels[_0x704b17[_0xc128('0x9')]])){channels[_0x704b17[_0xc128('0x9')]][_0xc128('0x33')]=utils[_0xc128('0x16')]();}}catch(_0x5d2fe2){utils[_0xc128('0x21')](_0x5d2fe2[_0xc128('0x18')]);}};exports[_0xc128('0x34')]=function(_0xad04bf){try{if(!_[_0xc128('0x1a')](channels[_0xad04bf[_0xc128('0x9')]])){if(!_[_0xc128('0x1a')](channels[_0xad04bf[_0xc128('0x9')]][_0xc128('0x33')])){channels[_0xad04bf[_0xc128('0x9')]][_0xc128('0x35')]+=utils[_0xc128('0x26')](utils[_0xc128('0x16')](),channels[_0xad04bf[_0xc128('0x9')]]['musiconholdstartAt']);delete channels[_0xad04bf[_0xc128('0x9')]][_0xc128('0x33')];}}}catch(_0x3eef60){utils[_0xc128('0x21')](_0x3eef60[_0xc128('0x18')]);}};exports['varset']=function(_0x576d7f){try{if(!_['isNil'](channels[_0x576d7f[_0xc128('0x9')]])){if(!_[_0xc128('0x1a')](_0x576d7f[_0xc128('0x36')][_0xc128('0x37')])){channels[_0x576d7f[_0xc128('0x9')]]['source']=_0x576d7f[_0xc128('0x38')];}if(!_['isNil'](_0x576d7f['variable'][_0xc128('0x39')])){channels[_0x576d7f['uniqueid']]['destination']=_0x576d7f[_0xc128('0x38')];}if(!_['isNil'](_0x576d7f[_0xc128('0x36')]['xmd-callerid-preview'])||!_['isNil'](_0x576d7f['variable'][_0xc128('0x3a')])){channels[_0x576d7f[_0xc128('0x9')]]['callerid']=_0x576d7f[_0xc128('0x38')];}if(!_[_0xc128('0x1a')](_0x576d7f['variable'][_0xc128('0x3b')])){channels[_0x576d7f['uniqueid']][_0xc128('0x3c')]=_0xc128('0x3d');channels[_0x576d7f[_0xc128('0x9')]][_0xc128('0x3e')]=_0x576d7f[_0xc128('0x38')];channels[_0x576d7f['uniqueid']]['queue']=!![];}if(!_[_0xc128('0x1a')](_0x576d7f['variable'][_0xc128('0x3f')])){channels[_0x576d7f['uniqueid']][_0xc128('0x40')]=_0x576d7f[_0xc128('0x38')];}if(!_[_0xc128('0x1a')](_0x576d7f[_0xc128('0x36')][_0xc128('0x41')])){channels[_0x576d7f[_0xc128('0x9')]][_0xc128('0x42')]=_0x576d7f[_0xc128('0x38')];}if(!_[_0xc128('0x1a')](_0x576d7f['variable']['sipcallid'])){channels[_0x576d7f[_0xc128('0x9')]][_0xc128('0x43')]=_0x576d7f[_0xc128('0x38')];}}}catch(_0x1a0392){utils['error'](_0x1a0392[_0xc128('0x18')]);}};exports[_0xc128('0x44')]=function(_0x19face){try{if(!_['isNil'](channels[_0x19face[_0xc128('0x9')]])){if(_0x19face[_0xc128('0x45')]['toLowerCase']()==_0xc128('0x46')&&_['startsWith'](_0x19face[_0xc128('0x47')]['toLowerCase'](),_0xc128('0x48'))){var _0xfc087b=_0x19face[_0xc128('0x47')][_0xc128('0x49')]('=');var _0x2928dc=_0xfc087b[0x0]['substring'](_0xfc087b[0x0]['lastIndexOf']('(')+0x1,_0xfc087b[0x0]['lastIndexOf'](')'));var _0x272397=_0xfc087b[0x1];channels[_0x19face['uniqueid']][_0x2928dc]=_0x272397;}if(!_[_0xc128('0x4a')]([_0xc128('0x22'),_0xc128('0x4b'),_0xc128('0x4c'),'set',_0xc128('0x4d')],_0x19face[_0xc128('0x45')][_0xc128('0x4e')]())){channels[_0x19face[_0xc128('0x9')]]['lastapplication']=_0x19face[_0xc128('0x45')];channels[_0x19face[_0xc128('0x9')]]['lastdata']=_0x19face['appdata'];}}}catch(_0x645e9){utils[_0xc128('0x21')](_0x645e9[_0xc128('0x18')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index fc24b23..b38ad93 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 _0x3831=['CLOSE','managerevent','./utils','connect','info','CONNECTED','shutdown','fullybooted','FULLYBOOTED','close'];(function(_0x4edecf,_0x5c566c){var _0x3a7ac2=function(_0x102ed1){while(--_0x102ed1){_0x4edecf['push'](_0x4edecf['shift']());}};_0x3a7ac2(++_0x5c566c);}(_0x3831,0x14c));var _0x1383=function(_0x52469e,_0x3579c2){_0x52469e=_0x52469e-0x0;var _0x2e6692=_0x3831[_0x52469e];return _0x2e6692;};'use strict';var utils=require(_0x1383('0x0'));var _=require('lodash');exports[_0x1383('0x1')]=function(){utils[_0x1383('0x2')](_0x1383('0x3'));};exports[_0x1383('0x4')]=function(){utils[_0x1383('0x2')]('SHUTDOWN');};exports[_0x1383('0x5')]=function(){utils['info'](_0x1383('0x6'));};exports['error']=function(_0x5b64b1){utils['error'](_0x5b64b1);};exports[_0x1383('0x7')]=function(){utils['info'](_0x1383('0x8'));};exports[_0x1383('0x9')]=function(_0x2e9a5b){}; \ No newline at end of file +var _0x6f47=['managerevent','lodash','connect','CONNECTED','info','fullybooted','FULLYBOOTED','error','close'];(function(_0x35353d,_0x13fab9){var _0x151d54=function(_0x24f2b7){while(--_0x24f2b7){_0x35353d['push'](_0x35353d['shift']());}};_0x151d54(++_0x13fab9);}(_0x6f47,0xc7));var _0x76f4=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x6f47[_0x4a3898];return _0x25ceb0;};'use strict';var utils=require('./utils');var _=require(_0x76f4('0x0'));exports[_0x76f4('0x1')]=function(){utils['info'](_0x76f4('0x2'));};exports['shutdown']=function(){utils[_0x76f4('0x3')]('SHUTDOWN');};exports[_0x76f4('0x4')]=function(){utils[_0x76f4('0x3')](_0x76f4('0x5'));};exports[_0x76f4('0x6')]=function(_0x5754ca){utils[_0x76f4('0x6')](_0x5754ca);};exports[_0x76f4('0x7')]=function(){utils[_0x76f4('0x3')]('CLOSE');};exports[_0x76f4('0x8')]=function(_0x25656d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 162aeb0..170cc75 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 _0x6d75=['dialbegin','starttime','now','lastevent','called','dialend','ANSWER','answertime','connect','assign','complete','duration','diffTime','holdtime','endtime','lodash','util','./utils','format','uniqueid','channel','dialstring','connectedlinenum','dialstatus','application','toLowerCase','set','startsWith','appdata','error','stack','isNil','variable'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x6d75,0x117));var _0x56d7=function(_0x366028,_0x33ec1d){_0x366028=_0x366028-0x0;var _0x2577be=_0x6d75[_0x366028];return _0x2577be;};'use strict';var _=require(_0x56d7('0x0'));var util=require(_0x56d7('0x1'));var utils=require(_0x56d7('0x2'));var dials={};function writeDB(_0x4dd98d){utils['info'](util[_0x56d7('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x4dd98d[_0x56d7('0x4')],_0x4dd98d[_0x56d7('0x5')],_0x4dd98d[_0x56d7('0x6')],_0x4dd98d['calleridnum'],_0x4dd98d[_0x56d7('0x7')],_0x4dd98d[_0x56d7('0x8')]));utils['request']('CreateVoiceDialReport',_0x4dd98d);delete dials[_0x4dd98d[_0x56d7('0x4')]];}exports['newexten']=function(_0x594529){try{if(_0x594529[_0x56d7('0x9')][_0x56d7('0xa')]()==_0x56d7('0xb')&&_[_0x56d7('0xc')](_0x594529[_0x56d7('0xd')]['toLowerCase'](),'cdr(routeid)')){var _0x17c797=_0x594529[_0x56d7('0xd')]['split']('=');dials[_0x594529[_0x56d7('0x4')]]={'routeId':_0x17c797[0x1]};}}catch(_0x2ec05f){utils[_0x56d7('0xe')](_0x2ec05f[_0x56d7('0xf')]);}};exports['varset']=function(_0x60cd12){try{if(!_[_0x56d7('0x10')](_0x60cd12[_0x56d7('0x11')]['outboundrouteid'])){dials[_0x60cd12[_0x56d7('0x4')]]={'routeId':_0x60cd12['value']};}}catch(_0x1087be){utils[_0x56d7('0xe')](_0x1087be[_0x56d7('0xf')]);}};exports[_0x56d7('0x12')]=function(_0x2853d8){try{if(!_[_0x56d7('0x10')](dials[_0x2853d8['uniqueid']])){dials[_0x2853d8[_0x56d7('0x4')]]=_['assign'](dials[_0x2853d8['uniqueid']],_0x2853d8);dials[_0x2853d8[_0x56d7('0x4')]][_0x56d7('0x13')]=utils[_0x56d7('0x14')]();dials[_0x2853d8[_0x56d7('0x4')]][_0x56d7('0x15')]=_0x56d7('0x16');}}catch(_0x2551e0){utils[_0x56d7('0xe')](_0x2551e0[_0x56d7('0xf')]);}};exports[_0x56d7('0x17')]=function(_0x28b79a){try{if(!_[_0x56d7('0x10')](dials[_0x28b79a[_0x56d7('0x4')]])){dials[_0x28b79a[_0x56d7('0x4')]][_0x56d7('0x8')]=_0x28b79a[_0x56d7('0x8')];if(_0x28b79a['dialstatus']==_0x56d7('0x18')){dials[_0x28b79a[_0x56d7('0x4')]]=_['assign'](dials[_0x28b79a[_0x56d7('0x4')]],_0x28b79a);dials[_0x28b79a[_0x56d7('0x4')]][_0x56d7('0x19')]=utils[_0x56d7('0x14')]();dials[_0x28b79a[_0x56d7('0x4')]][_0x56d7('0x15')]=_0x56d7('0x1a');}}}catch(_0xa0bd32){utils[_0x56d7('0xe')](_0xa0bd32['stack']);}};exports['hangup']=function(_0x4a2294){try{if(!_[_0x56d7('0x10')](dials[_0x4a2294[_0x56d7('0x4')]])){dials[_0x4a2294[_0x56d7('0x4')]]=_[_0x56d7('0x1b')](dials[_0x4a2294[_0x56d7('0x4')]],{'endtime':utils['now'](),'lastevent':_0x56d7('0x1c')});dials[_0x4a2294[_0x56d7('0x4')]][_0x56d7('0x1d')]=utils[_0x56d7('0x1e')](dials[_0x4a2294[_0x56d7('0x4')]]['endtime'],dials[_0x4a2294[_0x56d7('0x4')]][_0x56d7('0x13')]);dials[_0x4a2294['uniqueid']][_0x56d7('0x1f')]=utils[_0x56d7('0x1e')](dials[_0x4a2294[_0x56d7('0x4')]][_0x56d7('0x19')]||dials[_0x4a2294['uniqueid']][_0x56d7('0x20')],dials[_0x4a2294['uniqueid']][_0x56d7('0x13')]);dials[_0x4a2294[_0x56d7('0x4')]]['billableseconds']=dials[_0x4a2294[_0x56d7('0x4')]]['answertime']?utils['diffTime'](dials[_0x4a2294['uniqueid']][_0x56d7('0x20')],dials[_0x4a2294[_0x56d7('0x4')]][_0x56d7('0x19')]):0x0;writeDB(dials[_0x4a2294[_0x56d7('0x4')]]);}}catch(_0x4dfef6){utils['error'](_0x4dfef6[_0x56d7('0xf')]);}}; \ No newline at end of file +var _0x4254=['DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','application','toLowerCase','set','cdr(routeid)','split','error','stack','outboundrouteid','dialbegin','isNil','assign','starttime','now','lastevent','called','dialend','dialstatus','answertime','connect','duration','diffTime','endtime','holdtime','billableseconds','util','./utils','format'];(function(_0x4876ef,_0x3589cc){var _0x5c169c=function(_0x511faf){while(--_0x511faf){_0x4876ef['push'](_0x4876ef['shift']());}};_0x5c169c(++_0x3589cc);}(_0x4254,0x1aa));var _0x4425=function(_0x397dc1,_0x4714b1){_0x397dc1=_0x397dc1-0x0;var _0x129607=_0x4254[_0x397dc1];return _0x129607;};'use strict';var _=require('lodash');var util=require(_0x4425('0x0'));var utils=require(_0x4425('0x1'));var dials={};function writeDB(_0x3f082d){utils['info'](util[_0x4425('0x2')](_0x4425('0x3'),_0x3f082d[_0x4425('0x4')],_0x3f082d['channel'],_0x3f082d[_0x4425('0x5')],_0x3f082d[_0x4425('0x6')],_0x3f082d[_0x4425('0x7')],_0x3f082d['dialstatus']));utils['request'](_0x4425('0x8'),_0x3f082d);delete dials[_0x3f082d[_0x4425('0x4')]];}exports['newexten']=function(_0x5d81e2){try{if(_0x5d81e2[_0x4425('0x9')][_0x4425('0xa')]()==_0x4425('0xb')&&_['startsWith'](_0x5d81e2['appdata'][_0x4425('0xa')](),_0x4425('0xc'))){var _0x59d096=_0x5d81e2['appdata'][_0x4425('0xd')]('=');dials[_0x5d81e2[_0x4425('0x4')]]={'routeId':_0x59d096[0x1]};}}catch(_0x1ea84a){utils[_0x4425('0xe')](_0x1ea84a[_0x4425('0xf')]);}};exports['varset']=function(_0x49ad39){try{if(!_['isNil'](_0x49ad39['variable'][_0x4425('0x10')])){dials[_0x49ad39['uniqueid']]={'routeId':_0x49ad39['value']};}}catch(_0x4f7eac){utils['error'](_0x4f7eac[_0x4425('0xf')]);}};exports[_0x4425('0x11')]=function(_0x5c5fb8){try{if(!_[_0x4425('0x12')](dials[_0x5c5fb8[_0x4425('0x4')]])){dials[_0x5c5fb8[_0x4425('0x4')]]=_[_0x4425('0x13')](dials[_0x5c5fb8[_0x4425('0x4')]],_0x5c5fb8);dials[_0x5c5fb8[_0x4425('0x4')]][_0x4425('0x14')]=utils[_0x4425('0x15')]();dials[_0x5c5fb8[_0x4425('0x4')]][_0x4425('0x16')]=_0x4425('0x17');}}catch(_0x57bfba){utils[_0x4425('0xe')](_0x57bfba['stack']);}};exports[_0x4425('0x18')]=function(_0x496a1b){try{if(!_[_0x4425('0x12')](dials[_0x496a1b[_0x4425('0x4')]])){dials[_0x496a1b[_0x4425('0x4')]][_0x4425('0x19')]=_0x496a1b[_0x4425('0x19')];if(_0x496a1b['dialstatus']=='ANSWER'){dials[_0x496a1b['uniqueid']]=_['assign'](dials[_0x496a1b[_0x4425('0x4')]],_0x496a1b);dials[_0x496a1b[_0x4425('0x4')]][_0x4425('0x1a')]=utils[_0x4425('0x15')]();dials[_0x496a1b[_0x4425('0x4')]]['lastevent']=_0x4425('0x1b');}}}catch(_0xab2f86){utils[_0x4425('0xe')](_0xab2f86[_0x4425('0xf')]);}};exports['hangup']=function(_0x5debd3){try{if(!_[_0x4425('0x12')](dials[_0x5debd3[_0x4425('0x4')]])){dials[_0x5debd3[_0x4425('0x4')]]=_['assign'](dials[_0x5debd3[_0x4425('0x4')]],{'endtime':utils[_0x4425('0x15')](),'lastevent':'complete'});dials[_0x5debd3['uniqueid']][_0x4425('0x1c')]=utils[_0x4425('0x1d')](dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1e')],dials[_0x5debd3[_0x4425('0x4')]]['starttime']);dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1f')]=utils['diffTime'](dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1a')]||dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1e')],dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x14')]);dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x20')]=dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1a')]?utils[_0x4425('0x1d')](dials[_0x5debd3[_0x4425('0x4')]]['endtime'],dials[_0x5debd3[_0x4425('0x4')]][_0x4425('0x1a')]):0x0;writeDB(dials[_0x5debd3['uniqueid']]);}}catch(_0x41194d){utils[_0x4425('0xe')](_0x41194d[_0x4425('0xf')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 822fb87..b69a630 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 _0xb7e7=['asterisk','username','password','keepConnected','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./agents.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','./utils'];(function(_0x76b303,_0x3e255a){var _0x278e3d=function(_0x5593ec){while(--_0x5593ec){_0x76b303['push'](_0x76b303['shift']());}};_0x278e3d(++_0x3e255a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb7e7[_0x166d93];return _0xba708;};var AsteriskManager=require(_0x7b7e('0x0'));var config=require('../../config/environment');var agents=require(_0x7b7e('0x1'));var calls=require('./calls.controller');var queues=require(_0x7b7e('0x2'));var recordings=require('./recordings.controller');var members=require(_0x7b7e('0x3'));var dials=require('./dials.controller');var transfers=require(_0x7b7e('0x4'));var core=require(_0x7b7e('0x5'));var utils=require(_0x7b7e('0x6'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0x7b7e('0x7')]['ip'],config[_0x7b7e('0x7')][_0x7b7e('0x8')],config['asterisk'][_0x7b7e('0x9')],!![]);ami[_0x7b7e('0xa')]();ami['on'](_0x7b7e('0xb'),core[_0x7b7e('0xb')]);ami['on'](_0x7b7e('0xc'),core[_0x7b7e('0xc')]);ami['on'](_0x7b7e('0xd'),core['fullybooted']);ami['on'](_0x7b7e('0xe'),core[_0x7b7e('0xe')]);ami['on'](_0x7b7e('0xf'),core[_0x7b7e('0xf')]);ami['on'](_0x7b7e('0x10'),core[_0x7b7e('0x10')]);ami['on'](_0x7b7e('0x11'),function(_0x55620b){try{members[_0x7b7e('0x11')](_0x55620b);}catch(_0x54d8ce){utils[_0x7b7e('0xe')](_0x54d8ce);}});ami['on'](_0x7b7e('0x12'),function(_0x50d7d2){try{agents[_0x7b7e('0x12')](_0x50d7d2);}catch(_0x5976ac){utils['error'](_0x5976ac);}});ami['on'](_0x7b7e('0x13'),function(_0xd304f5){try{agents[_0x7b7e('0x13')](_0xd304f5);}catch(_0x457ec5){utils[_0x7b7e('0xe')](_0x457ec5);}});ami['on']('agentconnect',function(_0x51baf6){try{agents[_0x7b7e('0x14')](_0x51baf6);queues[_0x7b7e('0x14')](_0x51baf6);}catch(_0x27f999){utils[_0x7b7e('0xe')](_0x27f999);}});ami['on'](_0x7b7e('0x15'),function(_0x3bf2f0){try{agents[_0x7b7e('0x15')](_0x3bf2f0);queues[_0x7b7e('0x15')](_0x3bf2f0);members[_0x7b7e('0x15')](_0x3bf2f0);}catch(_0x429a0e){utils[_0x7b7e('0xe')](_0x429a0e);}});ami['on'](_0x7b7e('0x16'),function(_0x448980){try{agents[_0x7b7e('0x16')](_0x448980);queues[_0x7b7e('0x16')](_0x448980);}catch(_0x864287){utils[_0x7b7e('0xe')](_0x864287);}});ami['on']('queuecallerjoin',function(_0x69262b){try{queues[_0x7b7e('0x17')](_0x69262b);recordings[_0x7b7e('0x17')](_0x69262b);}catch(_0x4c0647){utils[_0x7b7e('0xe')](_0x4c0647);}});ami['on'](_0x7b7e('0x18'),function(_0x14243b){try{queues[_0x7b7e('0x18')](_0x14243b);}catch(_0x2b7211){utils[_0x7b7e('0xe')](_0x2b7211);}});ami['on'](_0x7b7e('0x19'),function(_0x10a66a){try{queues['musiconholdstart'](_0x10a66a);calls['musiconholdstart'](_0x10a66a);}catch(_0x4a836a){utils[_0x7b7e('0xe')](_0x4a836a);}});ami['on'](_0x7b7e('0x1a'),function(_0x23bfa3){try{queues['musiconholdstop'](_0x23bfa3);calls['musiconholdstop'](_0x23bfa3);}catch(_0x5dadbb){utils[_0x7b7e('0xe')](_0x5dadbb);}});ami['on'](_0x7b7e('0x1b'),function(_0x16a3c7){try{calls[_0x7b7e('0x1b')](_0x16a3c7);recordings[_0x7b7e('0x1b')](_0x16a3c7);}catch(_0x48fad1){utils[_0x7b7e('0xe')](_0x48fad1);}});ami['on'](_0x7b7e('0x1c'),function(_0x4c46b8){try{calls['hangup'](_0x4c46b8);recordings['hangup'](_0x4c46b8);dials[_0x7b7e('0x1c')](_0x4c46b8);agents[_0x7b7e('0x1c')](_0x4c46b8);queues['hangup'](_0x4c46b8);}catch(_0x3db8c4){utils['error'](_0x3db8c4);}});ami['on'](_0x7b7e('0x1d'),function(_0xb9b6bf){try{members[_0x7b7e('0x1d')](_0xb9b6bf);}catch(_0x5515ca){utils[_0x7b7e('0xe')](_0x5515ca);}});ami['on'](_0x7b7e('0x1e'),function(_0x35602a){try{queues[_0x7b7e('0x1e')](_0x35602a);agents[_0x7b7e('0x1e')](_0x35602a);transfers['blindtransfer'](_0x35602a);}catch(_0x41af57){utils['error'](_0x41af57);}});ami['on'](_0x7b7e('0x1f'),function(_0x1c7de4){try{queues[_0x7b7e('0x1f')](_0x1c7de4);transfers[_0x7b7e('0x1f')](_0x1c7de4);agents[_0x7b7e('0x1f')](_0x1c7de4);calls[_0x7b7e('0x1f')](_0x1c7de4);}catch(_0x29cb58){utils['error'](_0x29cb58);}});ami['on']('varset',function(_0xebcdbc){try{queues[_0x7b7e('0x20')](_0xebcdbc);recordings['varset'](_0xebcdbc);calls[_0x7b7e('0x20')](_0xebcdbc);dials[_0x7b7e('0x20')](_0xebcdbc);}catch(_0x2ca366){utils['error'](_0x2ca366);}});ami['on'](_0x7b7e('0x21'),function(_0x256908){try{calls[_0x7b7e('0x21')](_0x256908);recordings[_0x7b7e('0x21')](_0x256908);dials[_0x7b7e('0x21')](_0x256908);}catch(_0x2b09b8){utils[_0x7b7e('0xe')](_0x2b09b8);}});ami['on'](_0x7b7e('0x22'),function(_0x44497c){try{calls[_0x7b7e('0x22')](_0x44497c);recordings[_0x7b7e('0x22')](_0x44497c);}catch(_0x2d0620){utils[_0x7b7e('0xe')](_0x2d0620);}});ami['on'](_0x7b7e('0x23'),function(_0x116563){try{dials[_0x7b7e('0x23')](_0x116563);}catch(_0x5a4f92){utils[_0x7b7e('0xe')](_0x5a4f92);}});ami['on'](_0x7b7e('0x24'),function(_0xb20532){try{dials[_0x7b7e('0x24')](_0xb20532);}catch(_0x36abfc){utils[_0x7b7e('0xe')](_0x36abfc);}}); \ No newline at end of file +var _0xb10b=['./transfers.controller','./core.controller','./utils','asterisk','password','keepConnected','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller'];(function(_0x3acf39,_0x50706b){var _0x2ddedf=function(_0x36462f){while(--_0x36462f){_0x3acf39['push'](_0x3acf39['shift']());}};_0x2ddedf(++_0x50706b);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d8b1d,_0x1c0f88){_0x3d8b1d=_0x3d8b1d-0x0;var _0x2bb57a=_0xb10b[_0x3d8b1d];return _0x2bb57a;};var AsteriskManager=require(_0xbb10('0x0'));var config=require('../../config/environment');var agents=require(_0xbb10('0x1'));var calls=require(_0xbb10('0x2'));var queues=require(_0xbb10('0x3'));var recordings=require('./recordings.controller');var members=require(_0xbb10('0x4'));var dials=require(_0xbb10('0x5'));var transfers=require(_0xbb10('0x6'));var core=require(_0xbb10('0x7'));var utils=require(_0xbb10('0x8'));var ami=new AsteriskManager(config[_0xbb10('0x9')]['port'],config[_0xbb10('0x9')]['ip'],config[_0xbb10('0x9')]['username'],config[_0xbb10('0x9')][_0xbb10('0xa')],!![]);ami[_0xbb10('0xb')]();ami['on'](_0xbb10('0xc'),core[_0xbb10('0xc')]);ami['on'](_0xbb10('0xd'),core[_0xbb10('0xd')]);ami['on'](_0xbb10('0xe'),core['fullybooted']);ami['on']('error',core[_0xbb10('0xf')]);ami['on'](_0xbb10('0x10'),core[_0xbb10('0x10')]);ami['on']('managerevent',core[_0xbb10('0x11')]);ami['on']('devicestatechange',function(_0x44fb19){try{members[_0xbb10('0x12')](_0x44fb19);}catch(_0x285009){utils[_0xbb10('0xf')](_0x285009);}});ami['on'](_0xbb10('0x13'),function(_0x147230){try{agents['agentcalled'](_0x147230);}catch(_0x26e021){utils[_0xbb10('0xf')](_0x26e021);}});ami['on'](_0xbb10('0x14'),function(_0x17fd46){try{agents[_0xbb10('0x14')](_0x17fd46);}catch(_0x2f2ebf){utils[_0xbb10('0xf')](_0x2f2ebf);}});ami['on'](_0xbb10('0x15'),function(_0x3e26f4){try{agents[_0xbb10('0x15')](_0x3e26f4);queues['agentconnect'](_0x3e26f4);}catch(_0x2eca0f){utils[_0xbb10('0xf')](_0x2eca0f);}});ami['on'](_0xbb10('0x16'),function(_0x42db98){try{agents[_0xbb10('0x16')](_0x42db98);queues[_0xbb10('0x16')](_0x42db98);members[_0xbb10('0x16')](_0x42db98);}catch(_0x30efc6){utils[_0xbb10('0xf')](_0x30efc6);}});ami['on'](_0xbb10('0x17'),function(_0x48b6e9){try{agents[_0xbb10('0x17')](_0x48b6e9);queues[_0xbb10('0x17')](_0x48b6e9);}catch(_0x388fab){utils[_0xbb10('0xf')](_0x388fab);}});ami['on'](_0xbb10('0x18'),function(_0x44e563){try{queues['queuecallerjoin'](_0x44e563);recordings[_0xbb10('0x18')](_0x44e563);}catch(_0x12ef77){utils['error'](_0x12ef77);}});ami['on']('queuecallerleave',function(_0x8e2b97){try{queues[_0xbb10('0x19')](_0x8e2b97);}catch(_0x2e911d){utils[_0xbb10('0xf')](_0x2e911d);}});ami['on'](_0xbb10('0x1a'),function(_0x1824b7){try{queues[_0xbb10('0x1a')](_0x1824b7);calls[_0xbb10('0x1a')](_0x1824b7);}catch(_0x7f2377){utils[_0xbb10('0xf')](_0x7f2377);}});ami['on'](_0xbb10('0x1b'),function(_0x26ad93){try{queues['musiconholdstop'](_0x26ad93);calls['musiconholdstop'](_0x26ad93);}catch(_0x4fb5e0){utils[_0xbb10('0xf')](_0x4fb5e0);}});ami['on'](_0xbb10('0x1c'),function(_0x2c89b9){try{calls['newstate'](_0x2c89b9);recordings[_0xbb10('0x1c')](_0x2c89b9);}catch(_0x24d586){utils[_0xbb10('0xf')](_0x24d586);}});ami['on'](_0xbb10('0x1d'),function(_0x1acce9){try{calls[_0xbb10('0x1d')](_0x1acce9);recordings[_0xbb10('0x1d')](_0x1acce9);dials['hangup'](_0x1acce9);agents[_0xbb10('0x1d')](_0x1acce9);queues[_0xbb10('0x1d')](_0x1acce9);}catch(_0xfc3595){utils[_0xbb10('0xf')](_0xfc3595);}});ami['on'](_0xbb10('0x1e'),function(_0x2ff4c1){try{members['cdr'](_0x2ff4c1);}catch(_0x221624){utils['error'](_0x221624);}});ami['on'](_0xbb10('0x1f'),function(_0x56f2da){try{queues[_0xbb10('0x1f')](_0x56f2da);agents[_0xbb10('0x1f')](_0x56f2da);transfers[_0xbb10('0x1f')](_0x56f2da);}catch(_0x491db4){utils['error'](_0x491db4);}});ami['on'](_0xbb10('0x20'),function(_0x34f65e){try{queues['attendedtransfer'](_0x34f65e);transfers[_0xbb10('0x20')](_0x34f65e);agents[_0xbb10('0x20')](_0x34f65e);calls[_0xbb10('0x20')](_0x34f65e);}catch(_0x1c0b57){utils[_0xbb10('0xf')](_0x1c0b57);}});ami['on'](_0xbb10('0x21'),function(_0xf85197){try{queues['varset'](_0xf85197);recordings[_0xbb10('0x21')](_0xf85197);calls[_0xbb10('0x21')](_0xf85197);dials[_0xbb10('0x21')](_0xf85197);}catch(_0x8c1ce6){utils[_0xbb10('0xf')](_0x8c1ce6);}});ami['on'](_0xbb10('0x22'),function(_0x188cbd){try{calls[_0xbb10('0x22')](_0x188cbd);recordings[_0xbb10('0x22')](_0x188cbd);dials['newexten'](_0x188cbd);}catch(_0x2b5352){utils[_0xbb10('0xf')](_0x2b5352);}});ami['on'](_0xbb10('0x23'),function(_0x3c3c45){try{calls['newchannel'](_0x3c3c45);recordings[_0xbb10('0x23')](_0x3c3c45);}catch(_0x5de37b){utils['error'](_0x5de37b);}});ami['on'](_0xbb10('0x24'),function(_0x40c164){try{dials[_0xbb10('0x24')](_0x40c164);}catch(_0x120d21){utils[_0xbb10('0xf')](_0x120d21);}});ami['on'](_0xbb10('0x25'),function(_0x547062){try{dials[_0xbb10('0x25')](_0x547062);}catch(_0x25d72f){utils['error'](_0x25d72f);}}); \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index f9bd5bd..6c6cb27 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 _0x82f6=['CreateMemberReport','getUserByName','split','catch','startsWith','devicestatechange','state','INUSE','device','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','uniqueid','agentcomplete','cdr','channel','assign','type','source','destination','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','interface','data2','membername','getUserByInterface','then','name','internal','request'];(function(_0x4db8a9,_0x42d6f0){var _0x50b636=function(_0x57a4e2){while(--_0x57a4e2){_0x4db8a9['push'](_0x4db8a9['shift']());}};_0x50b636(++_0x42d6f0);}(_0x82f6,0x6d));var _0x682f=function(_0x1b92db,_0x532b2d){_0x1b92db=_0x1b92db-0x0;var _0x2c08b2=_0x82f6[_0x1b92db];return _0x2c08b2;};'use strict';var _=require(_0x682f('0x0'));var util=require('util');var utils=require(_0x682f('0x1'));var members={};var exclude=[_0x682f('0x2'),_0x682f('0x3')];function writeDB(_0x275f5d){utils[_0x682f('0x4')](util['format'](_0x682f('0x5'),_0x275f5d['uniqueid'],_0x275f5d[_0x682f('0x6')],_0x275f5d['channel'],_0x275f5d[_0x682f('0x7')],_0x275f5d[_0x682f('0x8')],_0x275f5d['type']));if(_0x275f5d[_0x682f('0x6')]){utils[_0x682f('0x9')](_0x275f5d[_0x682f('0x6')])[_0x682f('0xa')](function(_0x4f9503){if(_0x4f9503){_0x275f5d[_0x682f('0x8')]=_0x4f9503[_0x682f('0xb')];_0x275f5d['internal']=_0x4f9503[_0x682f('0xc')];utils[_0x682f('0xd')](_0x682f('0xe'),_0x275f5d);}else{utils[_0x682f('0xf')](_0x275f5d['interface'][_0x682f('0x10')]('/')[0x1])[_0x682f('0xa')](function(_0x3ccb31){if(_0x3ccb31){_0x275f5d['membername']=_0x3ccb31[_0x682f('0xb')];_0x275f5d[_0x682f('0xc')]=_0x3ccb31[_0x682f('0xc')];utils[_0x682f('0xd')]('CreateMemberReport',_0x275f5d);}});}})[_0x682f('0x11')](function(_0x105b77){utils['error'](_0x105b77);});}delete members[_0x275f5d[_0x682f('0x6')]];}function startsWith(_0xc82411,_0x5b672d){return _['some'](_0xc82411,function(_0x397afa){return _[_0x682f('0x12')](_0x5b672d,_0x397afa);});}exports[_0x682f('0x13')]=function(_0x280ed7){switch(_0x280ed7[_0x682f('0x14')]){case _0x682f('0x15'):case'BUSY':if(!startsWith(exclude,_0x280ed7[_0x682f('0x16')])){members[_0x280ed7[_0x682f('0x16')]]={'channel':_0x682f('0x17'),'interface':_0x280ed7[_0x682f('0x16')],'type':_0x682f('0x18'),'enterAt':utils[_0x682f('0x19')](),'role':_0x682f('0x1a')};}break;case _0x682f('0x1b'):if(!_[_0x682f('0x1c')](members[_0x280ed7['device']])){members[_0x280ed7[_0x682f('0x16')]]['exitAt']=utils[_0x682f('0x19')]();members[_0x280ed7[_0x682f('0x16')]][_0x682f('0x1d')]=utils[_0x682f('0x1e')](members[_0x280ed7[_0x682f('0x16')]][_0x682f('0x1f')],members[_0x280ed7['device']]['enterAt']);if(members[_0x280ed7[_0x682f('0x16')]][_0x682f('0x20')]){writeDB(members[_0x280ed7['device']]);}}default:break;}};exports[_0x682f('0x21')]=function(_0x3f8513){if(!_[_0x682f('0x1c')](members[_0x3f8513[_0x682f('0x6')]])){members[_0x3f8513[_0x682f('0x6')]]=_['assign'](members[_0x3f8513[_0x682f('0x6')]],{'data4':_0x3f8513['queue'],'uniqueid':_0x3f8513[_0x682f('0x20')]});}};exports[_0x682f('0x22')]=function(_0xe6b7ee){if(_0xe6b7ee[_0x682f('0x23')]){var _0x45f287=_0xe6b7ee[_0x682f('0x23')][_0x682f('0x10')]('-')[0x0];if(!_[_0x682f('0x1c')](members[_0x45f287])){members[_0x45f287]=_[_0x682f('0x24')](members[_0x45f287],{'data1':members[_0x45f287]['data1']||_0xe6b7ee[_0x682f('0x25')],'data2':members[_0x45f287][_0x682f('0x7')]||_0xe6b7ee[_0x682f('0x26')],'data3':members[_0x45f287]['data3']||_0xe6b7ee[_0x682f('0x27')],'uniqueid':members[_0x45f287]['uniqueid']||_0xe6b7ee[_0x682f('0x20')]});if(members[_0x45f287]['exitAt']){writeDB(members[_0x45f287]);}}}if(_0xe6b7ee[_0x682f('0x28')]){var _0x3d0aad=_0xe6b7ee[_0x682f('0x28')][_0x682f('0x10')]('-')[0x0];if(!_[_0x682f('0x1c')](members[_0x3d0aad])){members[_0x3d0aad]=_[_0x682f('0x24')](members[_0x3d0aad],{'data1':members[_0x3d0aad]['data1']||_0xe6b7ee[_0x682f('0x25')],'data2':members[_0x3d0aad][_0x682f('0x7')]||_0xe6b7ee[_0x682f('0x26')],'data3':members[_0x3d0aad]['data3']||_0xe6b7ee[_0x682f('0x27')],'uniqueid':members[_0x3d0aad][_0x682f('0x20')]||_0xe6b7ee[_0x682f('0x20')]});if(members[_0x3d0aad]['exitAt']){writeDB(members[_0x3d0aad]);}}}}; \ No newline at end of file +var _0xa5cd=['split','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','interface','channel','membername','type','getUserByInterface','then','name','internal','CreateMemberReport','request','catch','error','some','startsWith','state','INUSE','device','voice','TALKING','isNil','exitAt','now','duration','diffTime','uniqueid','assign','queue','data1','data2','destination','destinationchannel'];(function(_0x2563d6,_0x51f996){var _0x58ee04=function(_0x37bf80){while(--_0x37bf80){_0x2563d6['push'](_0x2563d6['shift']());}};_0x58ee04(++_0x51f996);}(_0xa5cd,0xf2));var _0xda5c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa5cd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xda5c('0x0'));var util=require(_0xda5c('0x1'));var utils=require(_0xda5c('0x2'));var members={};var exclude=[_0xda5c('0x3'),_0xda5c('0x4')];function writeDB(_0x354302){utils[_0xda5c('0x5')](util[_0xda5c('0x6')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x354302['uniqueid'],_0x354302[_0xda5c('0x7')],_0x354302[_0xda5c('0x8')],_0x354302['data2'],_0x354302[_0xda5c('0x9')],_0x354302[_0xda5c('0xa')]));if(_0x354302['interface']){utils[_0xda5c('0xb')](_0x354302[_0xda5c('0x7')])[_0xda5c('0xc')](function(_0x305a95){if(_0x305a95){_0x354302[_0xda5c('0x9')]=_0x305a95[_0xda5c('0xd')];_0x354302[_0xda5c('0xe')]=_0x305a95[_0xda5c('0xe')];utils['request'](_0xda5c('0xf'),_0x354302);}else{utils['getUserByName'](_0x354302['interface']['split']('/')[0x1])['then'](function(_0x78a879){if(_0x78a879){_0x354302[_0xda5c('0x9')]=_0x78a879[_0xda5c('0xd')];_0x354302[_0xda5c('0xe')]=_0x78a879['internal'];utils[_0xda5c('0x10')](_0xda5c('0xf'),_0x354302);}});}})[_0xda5c('0x11')](function(_0x512fa5){utils[_0xda5c('0x12')](_0x512fa5);});}delete members[_0x354302[_0xda5c('0x7')]];}function startsWith(_0x1c6511,_0x3b9875){return _[_0xda5c('0x13')](_0x1c6511,function(_0x2040a9){return _[_0xda5c('0x14')](_0x3b9875,_0x2040a9);});}exports['devicestatechange']=function(_0x4c75d4){switch(_0x4c75d4[_0xda5c('0x15')]){case _0xda5c('0x16'):case'BUSY':if(!startsWith(exclude,_0x4c75d4[_0xda5c('0x17')])){members[_0x4c75d4[_0xda5c('0x17')]]={'channel':_0xda5c('0x18'),'interface':_0x4c75d4[_0xda5c('0x17')],'type':_0xda5c('0x19'),'enterAt':utils['now'](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xda5c('0x1a')](members[_0x4c75d4[_0xda5c('0x17')]])){members[_0x4c75d4[_0xda5c('0x17')]][_0xda5c('0x1b')]=utils[_0xda5c('0x1c')]();members[_0x4c75d4[_0xda5c('0x17')]][_0xda5c('0x1d')]=utils[_0xda5c('0x1e')](members[_0x4c75d4[_0xda5c('0x17')]][_0xda5c('0x1b')],members[_0x4c75d4[_0xda5c('0x17')]]['enterAt']);if(members[_0x4c75d4[_0xda5c('0x17')]][_0xda5c('0x1f')]){writeDB(members[_0x4c75d4[_0xda5c('0x17')]]);}}default:break;}};exports['agentcomplete']=function(_0x3956e9){if(!_[_0xda5c('0x1a')](members[_0x3956e9[_0xda5c('0x7')]])){members[_0x3956e9[_0xda5c('0x7')]]=_[_0xda5c('0x20')](members[_0x3956e9[_0xda5c('0x7')]],{'data4':_0x3956e9[_0xda5c('0x21')],'uniqueid':_0x3956e9[_0xda5c('0x1f')]});}};exports['cdr']=function(_0x4dda15){if(_0x4dda15[_0xda5c('0x8')]){var _0x19b5d2=_0x4dda15[_0xda5c('0x8')]['split']('-')[0x0];if(!_[_0xda5c('0x1a')](members[_0x19b5d2])){members[_0x19b5d2]=_[_0xda5c('0x20')](members[_0x19b5d2],{'data1':members[_0x19b5d2][_0xda5c('0x22')]||_0x4dda15[_0xda5c('0xa')],'data2':members[_0x19b5d2][_0xda5c('0x23')]||_0x4dda15['source'],'data3':members[_0x19b5d2]['data3']||_0x4dda15[_0xda5c('0x24')],'uniqueid':members[_0x19b5d2][_0xda5c('0x1f')]||_0x4dda15[_0xda5c('0x1f')]});if(members[_0x19b5d2][_0xda5c('0x1b')]){writeDB(members[_0x19b5d2]);}}}if(_0x4dda15[_0xda5c('0x25')]){var _0x2eb784=_0x4dda15[_0xda5c('0x25')][_0xda5c('0x26')]('-')[0x0];if(!_['isNil'](members[_0x2eb784])){members[_0x2eb784]=_[_0xda5c('0x20')](members[_0x2eb784],{'data1':members[_0x2eb784][_0xda5c('0x22')]||_0x4dda15['type'],'data2':members[_0x2eb784]['data2']||_0x4dda15['source'],'data3':members[_0x2eb784][_0xda5c('0x27')]||_0x4dda15['destination'],'uniqueid':members[_0x2eb784][_0xda5c('0x1f')]||_0x4dda15[_0xda5c('0x1f')]});if(members[_0x2eb784][_0xda5c('0x1b')]){writeDB(members[_0x2eb784]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index cf50ce4..7144501 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 _0xd768=['mohtime','diffTime','lodash','uniqueid','channel','queue','lastAssignedTo','accountcode','then','type','CreateVoiceQueueReport','request','transfereduniqueid','position','now','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','queuecallerenterreason','varset','isNil','queuestatus','value','toUpperCase','variable','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentcomplete','assigned','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','origtransfereruniqueid','transfereelinkedid','calleridnum','calleridname','holdtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','clone','error','stack','musiconholdstart','musiconholdstop','musiconholdstartAt'];(function(_0xf73ebe,_0x1c05ea){var _0x10c152=function(_0x3a7d62){while(--_0x3a7d62){_0xf73ebe['push'](_0xf73ebe['shift']());}};_0x10c152(++_0x1c05ea);}(_0xd768,0x16a));var _0x8d76=function(_0x40d339,_0xb726c3){_0x40d339=_0x40d339-0x0;var _0x5cbd0b=_0xd768[_0x40d339];return _0x5cbd0b;};'use strict';var _=require(_0x8d76('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x3ef06d){utils['info'](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x3ef06d[_0x8d76('0x1')],_0x3ef06d[_0x8d76('0x2')],_0x3ef06d[_0x8d76('0x3')],_0x3ef06d[_0x8d76('0x4')],_0x3ef06d['calleridnum'],_0x3ef06d[_0x8d76('0x5')],_0x3ef06d['queuecallerexitreason']));if(_0x3ef06d[_0x8d76('0x3')]){utils['getVoiceQueueByName'](_0x3ef06d[_0x8d76('0x3')])[_0x8d76('0x6')](function(_0x881e63){if(_0x881e63){_0x3ef06d[_0x8d76('0x7')]=_0x881e63['type'];}utils['request'](_0x8d76('0x8'),_0x3ef06d);});}else{utils[_0x8d76('0x9')](_0x8d76('0x8'),_0x3ef06d);}if(_0x3ef06d[_0x8d76('0xa')]){delete queues[_0x3ef06d['transfereduniqueid']];}else{delete queues[_0x3ef06d['uniqueid']];}}exports['queuecallerjoin']=function(_0x2d330d){queues[_0x2d330d[_0x8d76('0x1')]]=_['assign'](_0x2d330d,{'originalposition':_0x2d330d[_0x8d76('0xb')],'queuecallerjoinAt':utils[_0x8d76('0xc')](),'mohtime':0x0});};exports['hangup']=function(_0x1581f9){if(!_['isNil'](queues[_0x1581f9[_0x8d76('0x1')]])){if(queues[_0x1581f9[_0x8d76('0x1')]]['queuecallerleaveAt']){if(!queues[_0x1581f9['uniqueid']][_0x8d76('0xd')]&&!queues[_0x1581f9[_0x8d76('0x1')]][_0x8d76('0xe')]){queues[_0x1581f9[_0x8d76('0x1')]][_0x8d76('0xf')]=!![];queues[_0x1581f9[_0x8d76('0x1')]][_0x8d76('0x10')]=utils[_0x8d76('0xc')]();queues[_0x1581f9[_0x8d76('0x1')]][_0x8d76('0x11')]='COMPLETEDBYAGENT';}writeDB(queues[_0x1581f9[_0x8d76('0x1')]]);}else{if(queues[_0x1581f9[_0x8d76('0x1')]]['transfereduniqueid']){queues[queues[_0x1581f9['uniqueid']][_0x8d76('0xa')]]=queues[_0x1581f9['uniqueid']];queues[queues[_0x1581f9[_0x8d76('0x1')]]['transfereduniqueid']][_0x8d76('0x12')]=0x2;delete queues[_0x1581f9[_0x8d76('0x1')]];}}}};exports[_0x8d76('0x13')]=function(_0x5e52e4){if(!_[_0x8d76('0x14')](_0x5e52e4['variable'][_0x8d76('0x15')])){if(!_['isNil'](queues[_0x5e52e4[_0x8d76('0x1')]])){queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0xd')]=![];queues[_0x5e52e4[_0x8d76('0x1')]]['queuecallerabandonAt']=null;queues[_0x5e52e4[_0x8d76('0x1')]]['queuecallerexit']=!![];queues[_0x5e52e4[_0x8d76('0x1')]]['queuecallerexitAt']=utils[_0x8d76('0xc')]();queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0x11')]=_0x5e52e4[_0x8d76('0x16')][_0x8d76('0x17')]();writeDB(queues[_0x5e52e4[_0x8d76('0x1')]]);}}else if(!_[_0x8d76('0x14')](_0x5e52e4[_0x8d76('0x18')][_0x8d76('0x19')])){if(!_[_0x8d76('0x14')](queues[_0x5e52e4[_0x8d76('0x1')]])&&!queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0xd')]){queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0xd')]=![];queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0x1a')]=null;queues[_0x5e52e4['uniqueid']][_0x8d76('0xe')]=!![];queues[_0x5e52e4[_0x8d76('0x1')]][_0x8d76('0x1b')]=utils[_0x8d76('0xc')]();queues[_0x5e52e4['uniqueid']][_0x8d76('0x11')]=_0x8d76('0x1c');}}};exports[_0x8d76('0xd')]=function(_0x41dd69){if(!_[_0x8d76('0x14')](queues[_0x41dd69[_0x8d76('0x1')]])){queues[_0x41dd69[_0x8d76('0x1')]][_0x8d76('0xe')]=![];queues[_0x41dd69[_0x8d76('0x1')]][_0x8d76('0x1b')]=null;queues[_0x41dd69[_0x8d76('0x1')]][_0x8d76('0xd')]=!![];queues[_0x41dd69[_0x8d76('0x1')]][_0x8d76('0x1a')]=utils['now']();queues[_0x41dd69[_0x8d76('0x1')]]['queuecallerexitreason']=_0x8d76('0x1d');}};exports[_0x8d76('0x1e')]=function(_0x122240){if(!_[_0x8d76('0x14')](queues[_0x122240[_0x8d76('0x1')]])){queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x1e')]=!![];queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x1f')]=utils[_0x8d76('0xc')]();queues[_0x122240['uniqueid']]['holdtime']=utils['diffTime'](queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x1f')],queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x20')]);queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0xb')]=_0x122240[_0x8d76('0xb')];queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x21')]=_0x122240[_0x8d76('0x21')];queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x22')]=_0x122240[_0x8d76('0x22')];queues[_0x122240[_0x8d76('0x1')]][_0x8d76('0x23')]=_0x122240['connectedlinename'];}};exports['agentconnect']=function(_0xb66d48){if(!_['isNil'](queues[_0xb66d48[_0x8d76('0x1')]])){queues[_0xb66d48[_0x8d76('0x1')]][_0x8d76('0xd')]=![];queues[_0xb66d48['uniqueid']]['queuecallerabandon']=![];queues[_0xb66d48[_0x8d76('0x1')]][_0x8d76('0x1a')]=null;queues[_0xb66d48[_0x8d76('0x1')]][_0x8d76('0xe')]=![];queues[_0xb66d48[_0x8d76('0x1')]][_0x8d76('0x1b')]=null;queues[_0xb66d48[_0x8d76('0x1')]]['assigned']=!![];queues[_0xb66d48['uniqueid']][_0x8d76('0x4')]=_0xb66d48['membername'];}};exports[_0x8d76('0x24')]=function(_0xcd3706){if(!_['isNil'](queues[_0xcd3706[_0x8d76('0x1')]])){if(queues[_0xcd3706[_0x8d76('0x1')]]['queuecallerleaveAt']){queues[_0xcd3706[_0x8d76('0x1')]]['queuecallerabandon']=![];queues[_0xcd3706['uniqueid']][_0x8d76('0xd')]=![];queues[_0xcd3706[_0x8d76('0x1')]][_0x8d76('0x1a')]=null;queues[_0xcd3706[_0x8d76('0x1')]][_0x8d76('0xe')]=![];queues[_0xcd3706[_0x8d76('0x1')]]['queuecallerexitAt']=null;queues[_0xcd3706[_0x8d76('0x1')]][_0x8d76('0x25')]=!![];queues[_0xcd3706[_0x8d76('0x1')]][_0x8d76('0x4')]=_0xcd3706['membername'];queues[_0xcd3706['uniqueid']][_0x8d76('0xf')]=!![];queues[_0xcd3706[_0x8d76('0x1')]][_0x8d76('0x10')]=utils[_0x8d76('0xc')]();if(_0xcd3706[_0x8d76('0x26')]==_0x8d76('0x27')){if(!queues[_0xcd3706['uniqueid']][_0x8d76('0x27')]){queues[_0xcd3706[_0x8d76('0x1')]]['queuecallerexitreason']=_0x8d76('0x28');}}else{queues[_0xcd3706['uniqueid']][_0x8d76('0x11')]=_0x8d76('0x29')+_0xcd3706[_0x8d76('0x26')][_0x8d76('0x17')]();}writeDB(queues[_0xcd3706[_0x8d76('0x1')]]);}}};exports[_0x8d76('0x2a')]=function(_0x4e3815){if(!_[_0x8d76('0x14')](queues[_0x4e3815[_0x8d76('0x2b')]])){queues[_0x4e3815[_0x8d76('0x2b')]]['transfer']=!![];queues[_0x4e3815[_0x8d76('0x2b')]][_0x8d76('0x2c')]=_0x8d76('0x2d');queues[_0x4e3815[_0x8d76('0x2b')]][_0x8d76('0x2e')]=_0x4e3815[_0x8d76('0x2f')];queues[_0x4e3815['transfereeuniqueid']][_0x8d76('0x30')]=_0x4e3815['transfereeuniqueid'];queues[_0x4e3815[_0x8d76('0x2b')]]['queuecallerexitreason']='BLINDTRANSFER';}};exports[_0x8d76('0x31')]=function(_0xea1995){try{if(_0xea1995['origtransfereruniqueid']==_0xea1995[_0x8d76('0x32')]){if(!_[_0x8d76('0x14')](queues[_0xea1995[_0x8d76('0x33')]])){queues[_0xea1995[_0x8d76('0x33')]][_0x8d76('0x27')]=!![];queues[_0xea1995[_0x8d76('0x33')]]['transfertype']='ATTENDED';queues[_0xea1995[_0x8d76('0x33')]]['transferexten']=_0xea1995[_0x8d76('0x34')];queues[_0xea1995[_0x8d76('0x33')]][_0x8d76('0x30')]=_0xea1995[_0x8d76('0x35')];queues[_0xea1995[_0x8d76('0x33')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x8d76('0x14')](queues[_0xea1995[_0x8d76('0x32')]])){if(_0xea1995[_0x8d76('0x36')]&&queues[_0xea1995[_0x8d76('0x36')]]){queues[_0xea1995[_0x8d76('0x36')]][_0x8d76('0x12')]=0x1;queues[_0xea1995[_0x8d76('0x2b')]]=_['clone'](queues[_0xea1995['transfereelinkedid']]);queues[_0xea1995[_0x8d76('0x2b')]]['transfereduniqueid']=_0xea1995['transfertargetuniqueid'];queues[_0xea1995['transfereeuniqueid']][_0x8d76('0x12')]=0x2;queues[_0xea1995['transfereeuniqueid']]['calleridnum']=queues[_0xea1995[_0x8d76('0x33')]][_0x8d76('0x37')];queues[_0xea1995[_0x8d76('0x2b')]][_0x8d76('0x38')]=queues[_0xea1995['secondtransfererlinkedid']][_0x8d76('0x38')];queues[_0xea1995[_0x8d76('0x2b')]][_0x8d76('0x20')]=utils['now']();queues[_0xea1995[_0x8d76('0x2b')]][_0x8d76('0x1f')]=utils[_0x8d76('0xc')]();queues[_0xea1995[_0x8d76('0x2b')]][_0x8d76('0x39')]=0x0;queues[_0xea1995['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0xea1995[_0x8d76('0x32')]][_0x8d76('0xa')]=_0xea1995[_0x8d76('0x33')];}}}else if(_0xea1995[_0x8d76('0x3a')]==_0xea1995['secondtransfererlinkedid']){if(!_['isNil'](queues[_0xea1995[_0x8d76('0x32')]])){queues[_0xea1995['origtransfererlinkedid']][_0x8d76('0x27')]=!![];queues[_0xea1995[_0x8d76('0x32')]]['transfertype']=_0x8d76('0x3b');queues[_0xea1995[_0x8d76('0x32')]]['transferexten']=_0xea1995[_0x8d76('0x3c')];queues[_0xea1995[_0x8d76('0x32')]][_0x8d76('0x30')]=_0xea1995[_0x8d76('0x3a')];queues[_0xea1995[_0x8d76('0x32')]]['queuecallerexitreason']=_0x8d76('0x3d');}if(!_[_0x8d76('0x14')](queues[_0xea1995[_0x8d76('0x33')]])){if(_0xea1995[_0x8d76('0x3e')]&&queues[_0xea1995[_0x8d76('0x3e')]]){queues[_0xea1995[_0x8d76('0x3e')]][_0x8d76('0x12')]=0x1;queues[_0xea1995[_0x8d76('0x3f')]]=_[_0x8d76('0x40')](queues[_0xea1995['transfertargetlinkedid']]);queues[_0xea1995[_0x8d76('0x3f')]][_0x8d76('0xa')]=_0xea1995[_0x8d76('0x3f')];queues[_0xea1995['transfertargetuniqueid']][_0x8d76('0x12')]=0x2;queues[_0xea1995['transfertargetuniqueid']]['calleridnum']=queues[_0xea1995['origtransfererlinkedid']][_0x8d76('0x37')];queues[_0xea1995[_0x8d76('0x3f')]][_0x8d76('0x38')]=queues[_0xea1995[_0x8d76('0x32')]][_0x8d76('0x38')];queues[_0xea1995[_0x8d76('0x3f')]][_0x8d76('0x20')]=utils[_0x8d76('0xc')]();queues[_0xea1995[_0x8d76('0x3f')]][_0x8d76('0x1f')]=utils['now']();queues[_0xea1995[_0x8d76('0x3f')]][_0x8d76('0x39')]=0x0;queues[_0xea1995[_0x8d76('0x3f')]]['mohtime']=0x0;}else{queues[_0xea1995[_0x8d76('0x33')]][_0x8d76('0xa')]=_0xea1995[_0x8d76('0x32')];}}}}catch(_0x405cfb){utils[_0x8d76('0x41')](_0x405cfb[_0x8d76('0x42')]);}};exports[_0x8d76('0x43')]=function(_0x1dd6ce){if(!_[_0x8d76('0x14')](queues[_0x1dd6ce['uniqueid']])){queues[_0x1dd6ce[_0x8d76('0x1')]]['musiconholdstartAt']=utils[_0x8d76('0xc')]();}};exports[_0x8d76('0x44')]=function(_0x2f378c){if(!_['isNil'](queues[_0x2f378c['uniqueid']])){if(!_[_0x8d76('0x14')](queues[_0x2f378c[_0x8d76('0x1')]][_0x8d76('0x45')])){queues[_0x2f378c[_0x8d76('0x1')]][_0x8d76('0x46')]+=utils[_0x8d76('0x47')](utils['now'](),queues[_0x2f378c['uniqueid']]['musiconholdstartAt']);delete queues[_0x2f378c[_0x8d76('0x1')]][_0x8d76('0x45')];}}}; \ No newline at end of file +var _0x1b1a=['QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallerexitreason','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','agentcomplete','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x1b1a,0x120));var _0xa1b1=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x1b1a[_0x263a2f];return _0x8020e8;};'use strict';var _=require(_0xa1b1('0x0'));var util=require(_0xa1b1('0x1'));var utils=require(_0xa1b1('0x2'));var queues={};function writeDB(_0x572172){utils[_0xa1b1('0x3')](util['format'](_0xa1b1('0x4'),_0x572172[_0xa1b1('0x5')],_0x572172[_0xa1b1('0x6')],_0x572172[_0xa1b1('0x7')],_0x572172[_0xa1b1('0x8')],_0x572172['calleridnum'],_0x572172[_0xa1b1('0x9')],_0x572172['queuecallerexitreason']));if(_0x572172['queue']){utils[_0xa1b1('0xa')](_0x572172[_0xa1b1('0x7')])['then'](function(_0x5a6aba){if(_0x5a6aba){_0x572172[_0xa1b1('0xb')]=_0x5a6aba[_0xa1b1('0xb')];}utils[_0xa1b1('0xc')](_0xa1b1('0xd'),_0x572172);});}else{utils[_0xa1b1('0xc')](_0xa1b1('0xd'),_0x572172);}if(_0x572172[_0xa1b1('0xe')]){delete queues[_0x572172[_0xa1b1('0xe')]];}else{delete queues[_0x572172[_0xa1b1('0x5')]];}}exports['queuecallerjoin']=function(_0x24ec08){queues[_0x24ec08['uniqueid']]=_['assign'](_0x24ec08,{'originalposition':_0x24ec08[_0xa1b1('0xf')],'queuecallerjoinAt':utils[_0xa1b1('0x10')](),'mohtime':0x0});};exports[_0xa1b1('0x11')]=function(_0x2a49ee){if(!_[_0xa1b1('0x12')](queues[_0x2a49ee[_0xa1b1('0x5')]])){if(queues[_0x2a49ee[_0xa1b1('0x5')]][_0xa1b1('0x13')]){if(!queues[_0x2a49ee['uniqueid']][_0xa1b1('0x14')]&&!queues[_0x2a49ee[_0xa1b1('0x5')]]['queuecallerexit']){queues[_0x2a49ee['uniqueid']][_0xa1b1('0x15')]=!![];queues[_0x2a49ee[_0xa1b1('0x5')]]['queuecallercompleteAt']=utils[_0xa1b1('0x10')]();queues[_0x2a49ee[_0xa1b1('0x5')]][_0xa1b1('0x16')]='COMPLETEDBYAGENT';}writeDB(queues[_0x2a49ee[_0xa1b1('0x5')]]);}else{if(queues[_0x2a49ee[_0xa1b1('0x5')]][_0xa1b1('0xe')]){queues[queues[_0x2a49ee[_0xa1b1('0x5')]][_0xa1b1('0xe')]]=queues[_0x2a49ee[_0xa1b1('0x5')]];queues[queues[_0x2a49ee[_0xa1b1('0x5')]][_0xa1b1('0xe')]][_0xa1b1('0x17')]=0x2;delete queues[_0x2a49ee[_0xa1b1('0x5')]];}}}};exports[_0xa1b1('0x18')]=function(_0x2f115e){if(!_[_0xa1b1('0x12')](_0x2f115e[_0xa1b1('0x19')][_0xa1b1('0x1a')])){if(!_[_0xa1b1('0x12')](queues[_0x2f115e[_0xa1b1('0x5')]])){queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x14')]=![];queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x1b')]=null;queues[_0x2f115e['uniqueid']][_0xa1b1('0x1c')]=!![];queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x1d')]=utils['now']();queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x16')]=_0x2f115e[_0xa1b1('0x1e')][_0xa1b1('0x1f')]();writeDB(queues[_0x2f115e[_0xa1b1('0x5')]]);}}else if(!_[_0xa1b1('0x12')](_0x2f115e['variable'][_0xa1b1('0x20')])){if(!_[_0xa1b1('0x12')](queues[_0x2f115e[_0xa1b1('0x5')]])&&!queues[_0x2f115e['uniqueid']][_0xa1b1('0x14')]){queues[_0x2f115e[_0xa1b1('0x5')]]['queuecallerabandon']=![];queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x1b')]=null;queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x1c')]=!![];queues[_0x2f115e[_0xa1b1('0x5')]]['queuecallerexitAt']=utils[_0xa1b1('0x10')]();queues[_0x2f115e[_0xa1b1('0x5')]][_0xa1b1('0x16')]=_0xa1b1('0x21');}}};exports['queuecallerabandon']=function(_0x3a406c){if(!_[_0xa1b1('0x12')](queues[_0x3a406c['uniqueid']])){queues[_0x3a406c[_0xa1b1('0x5')]][_0xa1b1('0x1c')]=![];queues[_0x3a406c[_0xa1b1('0x5')]][_0xa1b1('0x1d')]=null;queues[_0x3a406c[_0xa1b1('0x5')]][_0xa1b1('0x14')]=!![];queues[_0x3a406c[_0xa1b1('0x5')]]['queuecallerabandonAt']=utils[_0xa1b1('0x10')]();queues[_0x3a406c[_0xa1b1('0x5')]][_0xa1b1('0x16')]=_0xa1b1('0x22');}};exports[_0xa1b1('0x23')]=function(_0x2fb60f){if(!_[_0xa1b1('0x12')](queues[_0x2fb60f[_0xa1b1('0x5')]])){queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x23')]=!![];queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x13')]=utils[_0xa1b1('0x10')]();queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x24')]=utils['diffTime'](queues[_0x2fb60f['uniqueid']][_0xa1b1('0x13')],queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x25')]);queues[_0x2fb60f['uniqueid']][_0xa1b1('0xf')]=_0x2fb60f[_0xa1b1('0xf')];queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x26')]=_0x2fb60f['count'];queues[_0x2fb60f[_0xa1b1('0x5')]][_0xa1b1('0x27')]=_0x2fb60f['connectedlinenum'];queues[_0x2fb60f['uniqueid']][_0xa1b1('0x28')]=_0x2fb60f[_0xa1b1('0x28')];}};exports[_0xa1b1('0x29')]=function(_0x41c5b5){if(!_[_0xa1b1('0x12')](queues[_0x41c5b5['uniqueid']])){queues[_0x41c5b5[_0xa1b1('0x5')]][_0xa1b1('0x14')]=![];queues[_0x41c5b5[_0xa1b1('0x5')]][_0xa1b1('0x14')]=![];queues[_0x41c5b5[_0xa1b1('0x5')]]['queuecallerabandonAt']=null;queues[_0x41c5b5[_0xa1b1('0x5')]][_0xa1b1('0x1c')]=![];queues[_0x41c5b5[_0xa1b1('0x5')]]['queuecallerexitAt']=null;queues[_0x41c5b5['uniqueid']][_0xa1b1('0x2a')]=!![];queues[_0x41c5b5[_0xa1b1('0x5')]][_0xa1b1('0x8')]=_0x41c5b5['membername'];}};exports[_0xa1b1('0x2b')]=function(_0x3df0b6){if(!_[_0xa1b1('0x12')](queues[_0x3df0b6[_0xa1b1('0x5')]])){if(queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x13')]){queues[_0x3df0b6['uniqueid']][_0xa1b1('0x14')]=![];queues[_0x3df0b6[_0xa1b1('0x5')]]['queuecallerabandon']=![];queues[_0x3df0b6[_0xa1b1('0x5')]]['queuecallerabandonAt']=null;queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x1c')]=![];queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x1d')]=null;queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x2a')]=!![];queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x8')]=_0x3df0b6['membername'];queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x15')]=!![];queues[_0x3df0b6[_0xa1b1('0x5')]]['queuecallercompleteAt']=utils[_0xa1b1('0x10')]();if(_0x3df0b6['reason']=='transfer'){if(!queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x2c')]){queues[_0x3df0b6[_0xa1b1('0x5')]][_0xa1b1('0x16')]=_0xa1b1('0x2d');}}else{queues[_0x3df0b6[_0xa1b1('0x5')]]['queuecallerexitreason']=_0xa1b1('0x2e')+_0x3df0b6['reason']['toUpperCase']();}writeDB(queues[_0x3df0b6[_0xa1b1('0x5')]]);}}};exports[_0xa1b1('0x2f')]=function(_0x48ab70){if(!_[_0xa1b1('0x12')](queues[_0x48ab70[_0xa1b1('0x30')]])){queues[_0x48ab70[_0xa1b1('0x30')]][_0xa1b1('0x2c')]=!![];queues[_0x48ab70['transfereeuniqueid']][_0xa1b1('0x31')]=_0xa1b1('0x32');queues[_0x48ab70[_0xa1b1('0x30')]][_0xa1b1('0x33')]=_0x48ab70[_0xa1b1('0x34')];queues[_0x48ab70[_0xa1b1('0x30')]][_0xa1b1('0x35')]=_0x48ab70['transfereeuniqueid'];queues[_0x48ab70[_0xa1b1('0x30')]][_0xa1b1('0x16')]=_0xa1b1('0x36');}};exports[_0xa1b1('0x37')]=function(_0xe67eee){try{if(_0xe67eee[_0xa1b1('0x38')]==_0xe67eee[_0xa1b1('0x39')]){if(!_[_0xa1b1('0x12')](queues[_0xe67eee[_0xa1b1('0x3a')]])){queues[_0xe67eee[_0xa1b1('0x3a')]]['transfer']=!![];queues[_0xe67eee[_0xa1b1('0x3a')]]['transfertype']='ATTENDED';queues[_0xe67eee['secondtransfererlinkedid']]['transferexten']=_0xe67eee[_0xa1b1('0x3b')];queues[_0xe67eee[_0xa1b1('0x3a')]]['transferuniqueid']=_0xe67eee[_0xa1b1('0x38')];queues[_0xe67eee['secondtransfererlinkedid']][_0xa1b1('0x16')]=_0xa1b1('0x3c');}if(!_[_0xa1b1('0x12')](queues[_0xe67eee[_0xa1b1('0x39')]])){if(_0xe67eee[_0xa1b1('0x3d')]&&queues[_0xe67eee[_0xa1b1('0x3d')]]){queues[_0xe67eee[_0xa1b1('0x3d')]][_0xa1b1('0x17')]=0x1;queues[_0xe67eee['transfereeuniqueid']]=_[_0xa1b1('0x3e')](queues[_0xe67eee['transfereelinkedid']]);queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0xe')]=_0xe67eee['transfertargetuniqueid'];queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0x17')]=0x2;queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0x3f')]=queues[_0xe67eee['secondtransfererlinkedid']][_0xa1b1('0x3f')];queues[_0xe67eee['transfereeuniqueid']][_0xa1b1('0x40')]=queues[_0xe67eee['secondtransfererlinkedid']][_0xa1b1('0x40')];queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0x25')]=utils[_0xa1b1('0x10')]();queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0x13')]=utils[_0xa1b1('0x10')]();queues[_0xe67eee[_0xa1b1('0x30')]][_0xa1b1('0x24')]=0x0;queues[_0xe67eee['transfereeuniqueid']][_0xa1b1('0x41')]=0x0;}else{queues[_0xe67eee['origtransfererlinkedid']][_0xa1b1('0xe')]=_0xe67eee[_0xa1b1('0x3a')];}}}else if(_0xe67eee[_0xa1b1('0x42')]==_0xe67eee[_0xa1b1('0x3a')]){if(!_[_0xa1b1('0x12')](queues[_0xe67eee['origtransfererlinkedid']])){queues[_0xe67eee[_0xa1b1('0x39')]][_0xa1b1('0x2c')]=!![];queues[_0xe67eee[_0xa1b1('0x39')]]['transfertype']=_0xa1b1('0x43');queues[_0xe67eee[_0xa1b1('0x39')]]['transferexten']=_0xe67eee['secondtransfererexten'];queues[_0xe67eee[_0xa1b1('0x39')]][_0xa1b1('0x35')]=_0xe67eee[_0xa1b1('0x42')];queues[_0xe67eee['origtransfererlinkedid']][_0xa1b1('0x16')]=_0xa1b1('0x3c');}if(!_['isNil'](queues[_0xe67eee[_0xa1b1('0x3a')]])){if(_0xe67eee['transfertargetlinkedid']&&queues[_0xe67eee[_0xa1b1('0x44')]]){queues[_0xe67eee[_0xa1b1('0x44')]]['queuecallerenterreason']=0x1;queues[_0xe67eee[_0xa1b1('0x45')]]=_[_0xa1b1('0x3e')](queues[_0xe67eee['transfertargetlinkedid']]);queues[_0xe67eee[_0xa1b1('0x45')]][_0xa1b1('0xe')]=_0xe67eee[_0xa1b1('0x45')];queues[_0xe67eee['transfertargetuniqueid']][_0xa1b1('0x17')]=0x2;queues[_0xe67eee[_0xa1b1('0x45')]][_0xa1b1('0x3f')]=queues[_0xe67eee[_0xa1b1('0x39')]][_0xa1b1('0x3f')];queues[_0xe67eee[_0xa1b1('0x45')]][_0xa1b1('0x40')]=queues[_0xe67eee[_0xa1b1('0x39')]]['calleridname'];queues[_0xe67eee[_0xa1b1('0x45')]][_0xa1b1('0x25')]=utils[_0xa1b1('0x10')]();queues[_0xe67eee[_0xa1b1('0x45')]][_0xa1b1('0x13')]=utils[_0xa1b1('0x10')]();queues[_0xe67eee['transfertargetuniqueid']]['holdtime']=0x0;queues[_0xe67eee['transfertargetuniqueid']][_0xa1b1('0x41')]=0x0;}else{queues[_0xe67eee['secondtransfererlinkedid']][_0xa1b1('0xe')]=_0xe67eee[_0xa1b1('0x39')];}}}}catch(_0x487139){utils['error'](_0x487139[_0xa1b1('0x46')]);}};exports['musiconholdstart']=function(_0x5dfdd7){if(!_[_0xa1b1('0x12')](queues[_0x5dfdd7['uniqueid']])){queues[_0x5dfdd7['uniqueid']][_0xa1b1('0x47')]=utils[_0xa1b1('0x10')]();}};exports[_0xa1b1('0x48')]=function(_0x2120d2){if(!_[_0xa1b1('0x12')](queues[_0x2120d2[_0xa1b1('0x5')]])){if(!_[_0xa1b1('0x12')](queues[_0x2120d2[_0xa1b1('0x5')]][_0xa1b1('0x47')])){queues[_0x2120d2[_0xa1b1('0x5')]][_0xa1b1('0x41')]+=utils['diffTime'](utils['now'](),queues[_0x2120d2['uniqueid']][_0xa1b1('0x47')]);delete queues[_0x2120d2['uniqueid']][_0xa1b1('0x47')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 52ee7f6..fa4faeb 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 _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x573630,_0x1fab96){var _0x47182a=function(_0x20e89e){while(--_0x20e89e){_0x573630['push'](_0x573630['shift']());}};_0x47182a(++_0x1fab96);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0xcb91[_0x3c4e4c];return _0x144a87;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file +var _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x4f0fcd,_0x11151b){var _0x4f2c76=function(_0x2dfdc9){while(--_0x2dfdc9){_0x4f0fcd['push'](_0x4f0fcd['shift']());}};_0x4f2c76(++_0x11151b);}(_0x70e0,0x17b));var _0x070e=function(_0x4043fb,_0xd9fa12){_0x4043fb=_0x4043fb-0x0;var _0x31a56b=_0x70e0[_0x4043fb];return _0x31a56b;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2cf9d66..3efbb8e 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 _0xe184=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel'];(function(_0x371b64,_0x67b4bb){var _0x3cf3b1=function(_0x362941){while(--_0x362941){_0x371b64['push'](_0x371b64['shift']());}};_0x3cf3b1(++_0x67b4bb);}(_0xe184,0x188));var _0x4e18=function(_0x4591e4,_0x4668de){_0x4591e4=_0x4591e4-0x0;var _0xf7413d=_0xe184[_0x4591e4];return _0xf7413d;};'use strict';var _=require(_0x4e18('0x0'));var util=require(_0x4e18('0x1'));var utils=require(_0x4e18('0x2'));function writeDB(_0x303a4f){utils[_0x4e18('0x3')](util[_0x4e18('0x4')](_0x4e18('0x5'),_0x303a4f[_0x4e18('0x6')]));utils[_0x4e18('0x7')](_0x4e18('0x8'),_0x303a4f);}exports[_0x4e18('0x9')]=function(_0x2c3a51){try{_0x2c3a51[_0x4e18('0x6')]=_0x4e18('0xa');writeDB(_0x2c3a51);}catch(_0x27285c){utils[_0x4e18('0xb')](_0x27285c[_0x4e18('0xc')]);}};exports[_0x4e18('0xd')]=function(_0x160be5){try{_0x160be5=_[_0x4e18('0xe')](_0x160be5,{'transfererchannel':_0x160be5[_0x4e18('0xf')],'transferercalleridnum':_0x160be5[_0x4e18('0x10')],'transferercalleridname':_0x160be5[_0x4e18('0x11')],'transfererconnectedlinenum':_0x160be5['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x160be5[_0x4e18('0x12')],'transfereraccountcode':_0x160be5[_0x4e18('0x13')],'transferercontext':_0x160be5[_0x4e18('0x14')],'transfererexten':_0x160be5['secondtransfererexten'],'transfererlinkedid':_0x160be5[_0x4e18('0x15')],'context':_0x160be5[_0x4e18('0x16')],'extension':_0x160be5[_0x4e18('0x17')],'type':_0x4e18('0x18')});if(_[_0x4e18('0x19')](_0x160be5[_0x4e18('0x1a')])){_0x160be5=_['assign'](_0x160be5,{'transfereechannel':_0x160be5['transfertargetchannel'],'transfereecalleridnum':_0x160be5[_0x4e18('0x1b')],'transfereecalleridname':_0x160be5[_0x4e18('0x1c')],'transfereeconnectedlinenum':_0x160be5[_0x4e18('0x1d')],'transfereeconnectedlinename':_0x160be5[_0x4e18('0x1e')],'transfereeaccountcode':_0x160be5[_0x4e18('0x1f')],'transfereecontext':_0x160be5[_0x4e18('0x20')],'transfereeexten':_0x160be5['transfertargetexten'],'transfereelinkedid':_0x160be5[_0x4e18('0x21')]});}writeDB(_0x160be5);}catch(_0x55b2aa){utils[_0x4e18('0xb')](_0x55b2aa['stack']);}}; \ No newline at end of file +var _0x5947=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','TRANSFER|%s','request','CreateVoiceTransferReport','type','blind','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5947,0x14b));var _0x7594=function(_0xebc4ff,_0xdd3e1a){_0xebc4ff=_0xebc4ff-0x0;var _0x2d58b3=_0x5947[_0xebc4ff];return _0x2d58b3;};'use strict';var _=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var utils=require(_0x7594('0x2'));function writeDB(_0x1f5fb0){utils[_0x7594('0x3')](util[_0x7594('0x4')](_0x7594('0x5'),_0x1f5fb0['type']));utils[_0x7594('0x6')](_0x7594('0x7'),_0x1f5fb0);}exports['blindtransfer']=function(_0x424db2){try{_0x424db2[_0x7594('0x8')]=_0x7594('0x9');writeDB(_0x424db2);}catch(_0x565d76){utils['error'](_0x565d76[_0x7594('0xa')]);}};exports[_0x7594('0xb')]=function(_0x4940fd){try{_0x4940fd=_[_0x7594('0xc')](_0x4940fd,{'transfererchannel':_0x4940fd[_0x7594('0xd')],'transferercalleridnum':_0x4940fd[_0x7594('0xe')],'transferercalleridname':_0x4940fd[_0x7594('0xf')],'transfererconnectedlinenum':_0x4940fd[_0x7594('0x10')],'transfererconnectedlinename':_0x4940fd[_0x7594('0x11')],'transfereraccountcode':_0x4940fd[_0x7594('0x12')],'transferercontext':_0x4940fd[_0x7594('0x13')],'transfererexten':_0x4940fd[_0x7594('0x14')],'transfererlinkedid':_0x4940fd[_0x7594('0x15')],'context':_0x4940fd['origtransferercontext'],'extension':_0x4940fd[_0x7594('0x16')],'type':_0x7594('0x17')});if(_[_0x7594('0x18')](_0x4940fd[_0x7594('0x19')])){_0x4940fd=_[_0x7594('0xc')](_0x4940fd,{'transfereechannel':_0x4940fd[_0x7594('0x1a')],'transfereecalleridnum':_0x4940fd[_0x7594('0x1b')],'transfereecalleridname':_0x4940fd[_0x7594('0x1c')],'transfereeconnectedlinenum':_0x4940fd['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4940fd[_0x7594('0x1d')],'transfereeaccountcode':_0x4940fd[_0x7594('0x1e')],'transfereecontext':_0x4940fd[_0x7594('0x1f')],'transfereeexten':_0x4940fd[_0x7594('0x20')],'transfereelinkedid':_0x4940fd[_0x7594('0x21')]});}writeDB(_0x4940fd);}catch(_0x38298e){utils[_0x7594('0x22')](_0x38298e['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 950f4d3..696e080 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 _0x0669=['bluebird','client','http','xdr','info','debug','stringify','error','request','then','catch','stack','GetUser','internal','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','subtract','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0x5a5e02,_0x2fa1d9){var _0x2ccdcf=function(_0x12c1d6){while(--_0x12c1d6){_0x5a5e02['push'](_0x5a5e02['shift']());}};_0x2ccdcf(++_0x2fa1d9);}(_0x0669,0x190));var _0x9066=function(_0x3b6aaf,_0x4aef36){_0x3b6aaf=_0x3b6aaf-0x0;var _0x295fa9=_0x0669[_0x3b6aaf];return _0x295fa9;};'use strict';var jayson=require('jayson/promise');var moment=require('moment');var BPromise=require(_0x9066('0x0'));var client=jayson[_0x9066('0x1')][_0x9066('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0x9066('0x3'));exports[_0x9066('0x4')]=function(_0x25ad97){logger[_0x9066('0x4')](_0x25ad97);};exports[_0x9066('0x5')]=function(_0x47029f){logger[_0x9066('0x5')](JSON[_0x9066('0x6')](_0x47029f));};exports[_0x9066('0x7')]=function(_0x2154e7){logger[_0x9066('0x7')](_0x2154e7['stack']);};exports[_0x9066('0x8')]=function(_0xd28309,_0x54efef){return client[_0x9066('0x8')](_0xd28309,{'body':_0x54efef})[_0x9066('0x9')](function(_0x31c2ea){logger[_0x9066('0x5')](JSON[_0x9066('0x6')](_0x31c2ea));})[_0x9066('0xa')](function(_0x2d8a5){logger[_0x9066('0x7')](_0x2d8a5[_0x9066('0xb')]);});};function getUser(_0x9b03a4){return client[_0x9066('0x8')](_0x9066('0xc'),{'options':{'raw':!![],'attributes':['id',_0x9066('0xd'),'name','interface'],'where':_0x9b03a4,'limit':0x1}})['then'](function(_0x56510f){logger[_0x9066('0x4')](_0x9066('0xe')+JSON['stringify'](_0x9b03a4)+'|'+(_0x56510f[_0x9066('0xf')][_0x9066('0x10')]?_0x9066('0x11'):_0x9066('0x12')));return _0x56510f[_0x9066('0xf')][_0x9066('0x10')]?_0x56510f[_0x9066('0xf')][0x0]:null;});}exports[_0x9066('0x13')]=function(_0x51eceb){return new BPromise(function(_0x4806e0,_0x11bd11){if(_0x51eceb){return getUser({'internal':_0x51eceb})[_0x9066('0x9')](function(_0x4cbccf){return _0x4806e0(_0x4cbccf);})[_0x9066('0xa')](function(_0x50f44e){logger[_0x9066('0x7')](_0x50f44e[_0x9066('0xb')]);return _0x4806e0(null);});}else{return _0x4806e0(null);}});};exports[_0x9066('0x14')]=function(_0x54c3f8){return new BPromise(function(_0x473e8e,_0x54c888){if(_0x54c3f8){return getUser({'interface':_0x54c3f8})['then'](function(_0x5e0123){return _0x473e8e(_0x5e0123);})['catch'](function(_0x38a4a7){logger[_0x9066('0x7')](_0x38a4a7[_0x9066('0xb')]);return _0x473e8e(null);});}else{return _0x473e8e(null);}});};exports['getUserByName']=function(_0x2c6d9d){return new BPromise(function(_0x52039c,_0xe247c0){if(_0x2c6d9d){return getUser({'name':_0x2c6d9d})[_0x9066('0x9')](function(_0x1d6aeb){return _0x52039c(_0x1d6aeb);})['catch'](function(_0x33bac1){logger[_0x9066('0x7')](_0x33bac1[_0x9066('0xb')]);return _0x52039c(null);});}else{return _0x52039c(null);}});};exports[_0x9066('0x15')]=function(_0x460abe){return new BPromise(function(_0x1abe58,_0x16091d){if(_0x460abe){return client[_0x9066('0x8')](_0x9066('0x16'),{'options':{'raw':!![],'attributes':['id',_0x9066('0x17'),_0x9066('0x18'),_0x9066('0x19'),_0x9066('0x1a')],'where':{'name':_0x460abe},'limit':0x1}})[_0x9066('0x9')](function(_0x4db057){logger[_0x9066('0x4')](_0x9066('0x1b')+_0x460abe+'|'+(_0x4db057[_0x9066('0xf')][_0x9066('0x10')]?_0x9066('0x11'):'NOTFOUND'));return _0x1abe58(_0x4db057[_0x9066('0xf')][_0x9066('0x10')]?_0x4db057[_0x9066('0xf')][0x0]:null);})[_0x9066('0xa')](function(_0x194ec7){logger[_0x9066('0x7')](_0x194ec7['stack']);return _0x1abe58(null);});}else{return _0x1abe58(null);}});};exports[_0x9066('0x1c')]=function(_0x225e79,_0x2455c1){return moment(_0x225e79)[_0x9066('0x1d')](_0x2455c1,_0x9066('0x1e'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x4e9d32,_0x126be7){return moment(_0x4e9d32)[_0x9066('0x1f')](_0x126be7,_0x9066('0x1e'))[_0x9066('0x20')](_0x9066('0x21'));};exports[_0x9066('0x22')]=function(_0x50982d,_0x3965b5){return moment(_0x50982d)[_0x9066('0x23')](moment(_0x3965b5),_0x9066('0x1e'));};exports[_0x9066('0x24')]=function(_0x447c9f,_0x2d99cb){return parseInt(_0x447c9f,0xa)+parseInt(_0x2d99cb,0xa);};exports[_0x9066('0x25')]=function(){return moment()[_0x9066('0x20')](_0x9066('0x21'));};exports[_0x9066('0x26')]=function(_0x452ce7,_0x53e5c1){if(_0x53e5c1){return moment(_0x452ce7)['isAfter'](_0x53e5c1);}else{return!![];}};exports[_0x9066('0x27')]=function(_0x4c4912,_0x2cb32d){if(_0x2cb32d){return moment(_0x4c4912)[_0x9066('0x27')](_0x2cb32d);}else if(_0x4c4912){return!![];}else{return![];}}; \ No newline at end of file +var _0xd769=['bluebird','client','http','../../config/logger','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','interface','GETUSER|','length','FOUND','NOTFOUND','result','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment'];(function(_0x36bdfc,_0x3c67f1){var _0x22a5be=function(_0x81f4b2){while(--_0x81f4b2){_0x36bdfc['push'](_0x36bdfc['shift']());}};_0x22a5be(++_0x3c67f1);}(_0xd769,0x178));var _0x9d76=function(_0x20ad64,_0x2fb942){_0x20ad64=_0x20ad64-0x0;var _0x1bbe57=_0xd769[_0x20ad64];return _0x1bbe57;};'use strict';var jayson=require(_0x9d76('0x0'));var moment=require(_0x9d76('0x1'));var BPromise=require(_0x9d76('0x2'));var client=jayson[_0x9d76('0x3')][_0x9d76('0x4')]({'port':0x2329});var logger=require(_0x9d76('0x5'))('xdr');exports[_0x9d76('0x6')]=function(_0x2e8beb){logger[_0x9d76('0x6')](_0x2e8beb);};exports[_0x9d76('0x7')]=function(_0x59d775){logger[_0x9d76('0x7')](JSON[_0x9d76('0x8')](_0x59d775));};exports[_0x9d76('0x9')]=function(_0x1779e1){logger[_0x9d76('0x9')](_0x1779e1[_0x9d76('0xa')]);};exports[_0x9d76('0xb')]=function(_0x541af6,_0x1a6db0){return client[_0x9d76('0xb')](_0x541af6,{'body':_0x1a6db0})[_0x9d76('0xc')](function(_0x139283){logger['debug'](JSON[_0x9d76('0x8')](_0x139283));})[_0x9d76('0xd')](function(_0x4e300f){logger['error'](_0x4e300f['stack']);});};function getUser(_0xca06d9){return client[_0x9d76('0xb')](_0x9d76('0xe'),{'options':{'raw':!![],'attributes':['id',_0x9d76('0xf'),'name',_0x9d76('0x10')],'where':_0xca06d9,'limit':0x1}})[_0x9d76('0xc')](function(_0x2b1fff){logger[_0x9d76('0x6')](_0x9d76('0x11')+JSON[_0x9d76('0x8')](_0xca06d9)+'|'+(_0x2b1fff['result'][_0x9d76('0x12')]?_0x9d76('0x13'):_0x9d76('0x14')));return _0x2b1fff[_0x9d76('0x15')][_0x9d76('0x12')]?_0x2b1fff[_0x9d76('0x15')][0x0]:null;});}exports['getUserByInternal']=function(_0x3558aa){return new BPromise(function(_0xdfbe00,_0x32fb50){if(_0x3558aa){return getUser({'internal':_0x3558aa})[_0x9d76('0xc')](function(_0x59c5a0){return _0xdfbe00(_0x59c5a0);})[_0x9d76('0xd')](function(_0x48bfc8){logger['error'](_0x48bfc8[_0x9d76('0xa')]);return _0xdfbe00(null);});}else{return _0xdfbe00(null);}});};exports[_0x9d76('0x16')]=function(_0x38b339){return new BPromise(function(_0x447f8a,_0x2cabb3){if(_0x38b339){return getUser({'interface':_0x38b339})[_0x9d76('0xc')](function(_0x21f760){return _0x447f8a(_0x21f760);})[_0x9d76('0xd')](function(_0xae5ee3){logger[_0x9d76('0x9')](_0xae5ee3[_0x9d76('0xa')]);return _0x447f8a(null);});}else{return _0x447f8a(null);}});};exports[_0x9d76('0x17')]=function(_0x159103){return new BPromise(function(_0x570543,_0x147130){if(_0x159103){return getUser({'name':_0x159103})[_0x9d76('0xc')](function(_0x188fa4){return _0x570543(_0x188fa4);})[_0x9d76('0xd')](function(_0x502096){logger[_0x9d76('0x9')](_0x502096[_0x9d76('0xa')]);return _0x570543(null);});}else{return _0x570543(null);}});};exports[_0x9d76('0x18')]=function(_0x5042b4){return new BPromise(function(_0x3f48c1,_0x47ab32){if(_0x5042b4){return client[_0x9d76('0xb')](_0x9d76('0x19'),{'options':{'raw':!![],'attributes':['id','name',_0x9d76('0x1a'),_0x9d76('0x1b'),_0x9d76('0x1c')],'where':{'name':_0x5042b4},'limit':0x1}})['then'](function(_0x394985){logger['info'](_0x9d76('0x1d')+_0x5042b4+'|'+(_0x394985[_0x9d76('0x15')][_0x9d76('0x12')]?'FOUND':_0x9d76('0x14')));return _0x3f48c1(_0x394985[_0x9d76('0x15')]['length']?_0x394985[_0x9d76('0x15')][0x0]:null);})['catch'](function(_0x225381){logger[_0x9d76('0x9')](_0x225381[_0x9d76('0xa')]);return _0x3f48c1(null);});}else{return _0x3f48c1(null);}});};exports[_0x9d76('0x1e')]=function(_0x563650,_0x1a422d){return moment(_0x563650)[_0x9d76('0x1f')](_0x1a422d,_0x9d76('0x20'))['format'](_0x9d76('0x21'));};exports['subtractTime']=function(_0x515a85,_0x14d4a8){return moment(_0x515a85)[_0x9d76('0x22')](_0x14d4a8,'seconds')[_0x9d76('0x23')](_0x9d76('0x21'));};exports[_0x9d76('0x24')]=function(_0x5b41a3,_0x6697fc){return moment(_0x5b41a3)[_0x9d76('0x25')](moment(_0x6697fc),_0x9d76('0x20'));};exports[_0x9d76('0x26')]=function(_0x3b090b,_0x166114){return parseInt(_0x3b090b,0xa)+parseInt(_0x166114,0xa);};exports[_0x9d76('0x27')]=function(){return moment()[_0x9d76('0x23')](_0x9d76('0x21'));};exports[_0x9d76('0x28')]=function(_0x3e21bd,_0x4e5135){if(_0x4e5135){return moment(_0x3e21bd)[_0x9d76('0x28')](_0x4e5135);}else{return!![];}};exports[_0x9d76('0x29')]=function(_0x3278b1,_0x4132bf){if(_0x4132bf){return moment(_0x3278b1)['isBefore'](_0x4132bf);}else if(_0x3278b1){return!![];}else{return![];}}; \ No newline at end of file -- 1.7.1